import{a1 as yt,a0 as Ft,K as ie,bd as gl,eR as ml,Z as m,bf as Ot,r as s,as as Bt,X as Z,eZ as wo,a7 as Ue,a3 as rt,j as _,au as Xe,a9 as ce,fg as or,ab as We,fh as vo,c as vn,fi as rr,aB as Pe,a8 as So,f as we,a4 as je,a5 as It,fe as fl,fd as hl,a6 as pl,h as ot,aZ as lr,a2 as Te,fj as zn,fk as Cl,ax as Po,fb as pe,fl as Nn,bK as Un,fm as bl,P as sr,bj as Kn,fn as Wn,fo as jn,aT as ir,aV as ar,fp as wl,fq as vl,fr as Sl,b2 as Pl,fs as cr,o as zt,bw as yo,ft as ur,aU as yl,ac as xl,l as Il,fu as El,m as Ml,b0 as kl,fv as Fl,ey as En,fw as Tl,fx as $l,fy as _l,fz as Dl,fA as Rl,fB as Ol,fC as Hl,fD as Ll,fE as Vl,fF as Gl,fG as Al,fH as Bl,fI as xo,fJ as Io,fK as zl,fL as Nl,be as dr,$ as Ul,bq as gr,ad as B}from"./index-4e7882bc.js";import{t as Xt}from"./toPropertyKey-4015efc6.js";import{d as Eo}from"./dividerClasses-9982a278.js";import{l as Mo,b as ko}from"./listItemTextClasses-0d3e3a1a.js";function Mn(e,t){return()=>null}function Kl(e){return String(e).match(/[\d.\-+]*\s*(.*)/)[1]||""}function Wl(e){return parseFloat(e)}function jl(e){return Ft("MuiMenuItem",e)}const ql=yt("MuiMenuItem",["root","focusVisible","dense","disabled","divider","gutters","selected"]),Kt=ql,Yl=["autoFocus","component","dense","divider","disableGutters","focusVisibleClassName","role","tabIndex","className"],Ql=(e,t)=>{const{ownerState:n}=e;return[t.root,n.dense&&t.dense,n.divider&&t.divider,!n.disableGutters&&t.gutters]},Xl=e=>{const{disabled:t,dense:n,divider:o,disableGutters:r,selected:l,classes:i}=e,a=ce({root:["root",n&&"dense",t&&"disabled",!r&&"gutters",o&&"divider",l&&"selected"]},jl,i);return m({},i,a)},Zl=ie(gl,{shouldForwardProp:e=>ml(e)||e==="classes",name:"MuiMenuItem",slot:"Root",overridesResolver:Ql})(({theme:e,ownerState:t})=>m({},e.typography.body1,{display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",minHeight:48,paddingTop:6,paddingBottom:6,boxSizing:"border-box",whiteSpace:"nowrap"},!t.disableGutters&&{paddingLeft:16,paddingRight:16},t.divider&&{borderBottom:`1px solid ${(e.vars||e).palette.divider}`,backgroundClip:"padding-box"},{"&:hover":{textDecoration:"none",backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${Kt.selected}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:Ot(e.palette.primary.main,e.palette.action.selectedOpacity),[`&.${Kt.focusVisible}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))`:Ot(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.focusOpacity)}},[`&.${Kt.selected}:hover`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:Ot(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:Ot(e.palette.primary.main,e.palette.action.selectedOpacity)}},[`&.${Kt.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},[`&.${Kt.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity},[`& + .${Eo.root}`]:{marginTop:e.spacing(1),marginBottom:e.spacing(1)},[`& + .${Eo.inset}`]:{marginLeft:52},[`& .${Mo.root}`]:{marginTop:0,marginBottom:0},[`& .${Mo.inset}`]:{paddingLeft:36},[`& .${ko.root}`]:{minWidth:36}},!t.dense&&{[e.breakpoints.up("sm")]:{minHeight:"auto"}},t.dense&&m({minHeight:32,paddingTop:4,paddingBottom:4},e.typography.body2,{[`& .${ko.root} svg`]:{fontSize:"1.25rem"}}))),Jl=s.forwardRef(function(t,n){const o=Bt({props:t,name:"MuiMenuItem"}),{autoFocus:r=!1,component:l="li",dense:i=!1,divider:c=!1,disableGutters:a=!1,focusVisibleClassName:g,role:d="menuitem",tabIndex:u,className:f}=o,C=Z(o,Yl),P=s.useContext(wo),b=s.useMemo(()=>({dense:i||P.dense||!1,disableGutters:a}),[P.dense,i,a]),p=s.useRef(null);Ue(()=>{r&&p.current&&p.current.focus()},[r]);const I=m({},o,{dense:b.dense,divider:c,disableGutters:a}),$=Xl(o),v=rt(p,n);let h;return o.disabled||(h=u!==void 0?u:-1),_(wo.Provider,{value:b,children:_(Zl,m({ref:v,role:d,tabIndex:h,component:l,focusVisibleClassName:Xe($.focusVisible,g),className:Xe($.root,f)},C,{ownerState:I,classes:$}))})}),Ae=Jl;function es(e){return Ft("MuiSkeleton",e)}yt("MuiSkeleton",["root","text","rectangular","rounded","circular","pulse","wave","withChildren","fitContent","heightAuto"]);const ts=["animation","className","component","height","style","variant","width"];let mn=e=>e,Fo,To,$o,_o;const ns=e=>{const{classes:t,variant:n,animation:o,hasChildren:r,width:l,height:i}=e;return ce({root:["root",n,o,r&&"withChildren",r&&!l&&"fitContent",r&&!i&&"heightAuto"]},es,t)},os=or(Fo||(Fo=mn`
  0% {
    opacity: 1;
  }

  50% {
    opacity: 0.4;
  }

  100% {
    opacity: 1;
  }
`)),rs=or(To||(To=mn`
  0% {
    transform: translateX(-100%);
  }

  50% {
    /* +0.5s of delay between each loop */
    transform: translateX(100%);
  }

  100% {
    transform: translateX(100%);
  }
`)),ls=ie("span",{name:"MuiSkeleton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],n.animation!==!1&&t[n.animation],n.hasChildren&&t.withChildren,n.hasChildren&&!n.width&&t.fitContent,n.hasChildren&&!n.height&&t.heightAuto]}})(({theme:e,ownerState:t})=>{const n=Kl(e.shape.borderRadius)||"px",o=Wl(e.shape.borderRadius);return m({display:"block",backgroundColor:e.vars?e.vars.palette.Skeleton.bg:We(e.palette.text.primary,e.palette.mode==="light"?.11:.13),height:"1.2em"},t.variant==="text"&&{marginTop:0,marginBottom:0,height:"auto",transformOrigin:"0 55%",transform:"scale(1, 0.60)",borderRadius:`${o}${n}/${Math.round(o/.6*10)/10}${n}`,"&:empty:before":{content:'"\\00a0"'}},t.variant==="circular"&&{borderRadius:"50%"},t.variant==="rounded"&&{borderRadius:(e.vars||e).shape.borderRadius},t.hasChildren&&{"& > *":{visibility:"hidden"}},t.hasChildren&&!t.width&&{maxWidth:"fit-content"},t.hasChildren&&!t.height&&{height:"auto"})},({ownerState:e})=>e.animation==="pulse"&&vo($o||($o=mn`
      animation: ${0} 2s ease-in-out 0.5s infinite;
    `),os),({ownerState:e,theme:t})=>e.animation==="wave"&&vo(_o||(_o=mn`
      position: relative;
      overflow: hidden;

      /* Fix bug in Safari https://bugs.webkit.org/show_bug.cgi?id=68196 */
      -webkit-mask-image: -webkit-radial-gradient(white, black);

      &::after {
        animation: ${0} 2s linear 0.5s infinite;
        background: linear-gradient(
          90deg,
          transparent,
          ${0},
          transparent
        );
        content: '';
        position: absolute;
        transform: translateX(-100%); /* Avoid flash during server-side hydration */
        bottom: 0;
        left: 0;
        right: 0;
        top: 0;
      }
    `),rs,(t.vars||t).palette.action.hover)),ss=s.forwardRef(function(t,n){const o=Bt({props:t,name:"MuiSkeleton"}),{animation:r="pulse",className:l,component:i="span",height:c,style:a,variant:g="text",width:d}=o,u=Z(o,ts),f=m({},o,{animation:r,component:i,variant:g,hasChildren:!!u.children}),C=ns(f);return _(ls,m({as:i,ref:n,className:Xe(C.root,l),ownerState:f},u,{style:m({width:d,height:c},a)}))}),is=ss,as=vn(_("path",{d:"M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z"}),"KeyboardArrowLeft"),cs=vn(_("path",{d:"M8.59 16.34l4.58-4.59-4.58-4.59L10 5.75l6 6-6 6z"}),"KeyboardArrowRight");function us(e){const{badgeContent:t,invisible:n=!1,max:o=99,showZero:r=!1}=e,l=rr({badgeContent:t,max:o});let i=n;n===!1&&t===0&&!r&&(i=!0);const{badgeContent:c,max:a=o}=i?l:e,g=c&&Number(c)>a?`${a}+`:c;return{badgeContent:c,invisible:i,max:a,displayValue:g}}function ds(e){return Ft("MuiBadge",e)}const gs=yt("MuiBadge",["root","badge","dot","standard","anchorOriginTopRight","anchorOriginBottomRight","anchorOriginTopLeft","anchorOriginBottomLeft","invisible","colorError","colorInfo","colorPrimary","colorSecondary","colorSuccess","colorWarning","overlapRectangular","overlapCircular","anchorOriginTopLeftCircular","anchorOriginTopLeftRectangular","anchorOriginTopRightCircular","anchorOriginTopRightRectangular","anchorOriginBottomLeftCircular","anchorOriginBottomLeftRectangular","anchorOriginBottomRightCircular","anchorOriginBottomRightRectangular"]),mt=gs,ms=["anchorOrigin","className","classes","component","components","componentsProps","children","overlap","color","invisible","max","badgeContent","slots","slotProps","showZero","variant"],kn=10,Fn=4,fs=e=>{const{color:t,anchorOrigin:n,invisible:o,overlap:r,variant:l,classes:i={}}=e,c={root:["root"],badge:["badge",l,o&&"invisible",`anchorOrigin${Pe(n.vertical)}${Pe(n.horizontal)}`,`anchorOrigin${Pe(n.vertical)}${Pe(n.horizontal)}${Pe(r)}`,`overlap${Pe(r)}`,t!=="default"&&`color${Pe(t)}`]};return ce(c,ds,i)},hs=ie("span",{name:"MuiBadge",slot:"Root",overridesResolver:(e,t)=>t.root})({position:"relative",display:"inline-flex",verticalAlign:"middle",flexShrink:0}),ps=ie("span",{name:"MuiBadge",slot:"Badge",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.badge,t[n.variant],t[`anchorOrigin${Pe(n.anchorOrigin.vertical)}${Pe(n.anchorOrigin.horizontal)}${Pe(n.overlap)}`],n.color!=="default"&&t[`color${Pe(n.color)}`],n.invisible&&t.invisible]}})(({theme:e})=>{var t;return{display:"flex",flexDirection:"row",flexWrap:"wrap",justifyContent:"center",alignContent:"center",alignItems:"center",position:"absolute",boxSizing:"border-box",fontFamily:e.typography.fontFamily,fontWeight:e.typography.fontWeightMedium,fontSize:e.typography.pxToRem(12),minWidth:kn*2,lineHeight:1,padding:"0 6px",height:kn*2,borderRadius:kn,zIndex:1,transition:e.transitions.create("transform",{easing:e.transitions.easing.easeInOut,duration:e.transitions.duration.enteringScreen}),variants:[...Object.keys(((t=e.vars)!=null?t:e).palette).filter(n=>{var o,r;return((o=e.vars)!=null?o:e).palette[n].main&&((r=e.vars)!=null?r:e).palette[n].contrastText}).map(n=>({props:{color:n},style:{backgroundColor:(e.vars||e).palette[n].main,color:(e.vars||e).palette[n].contrastText}})),{props:{variant:"dot"},style:{borderRadius:Fn,height:Fn*2,minWidth:Fn*2,padding:0}},{props:({ownerState:n})=>n.anchorOrigin.vertical==="top"&&n.anchorOrigin.horizontal==="right"&&n.overlap==="rectangular",style:{top:0,right:0,transform:"scale(1) translate(50%, -50%)",transformOrigin:"100% 0%",[`&.${mt.invisible}`]:{transform:"scale(0) translate(50%, -50%)"}}},{props:({ownerState:n})=>n.anchorOrigin.vertical==="bottom"&&n.anchorOrigin.horizontal==="right"&&n.overlap==="rectangular",style:{bottom:0,right:0,transform:"scale(1) translate(50%, 50%)",transformOrigin:"100% 100%",[`&.${mt.invisible}`]:{transform:"scale(0) translate(50%, 50%)"}}},{props:({ownerState:n})=>n.anchorOrigin.vertical==="top"&&n.anchorOrigin.horizontal==="left"&&n.overlap==="rectangular",style:{top:0,left:0,transform:"scale(1) translate(-50%, -50%)",transformOrigin:"0% 0%",[`&.${mt.invisible}`]:{transform:"scale(0) translate(-50%, -50%)"}}},{props:({ownerState:n})=>n.anchorOrigin.vertical==="bottom"&&n.anchorOrigin.horizontal==="left"&&n.overlap==="rectangular",style:{bottom:0,left:0,transform:"scale(1) translate(-50%, 50%)",transformOrigin:"0% 100%",[`&.${mt.invisible}`]:{transform:"scale(0) translate(-50%, 50%)"}}},{props:({ownerState:n})=>n.anchorOrigin.vertical==="top"&&n.anchorOrigin.horizontal==="right"&&n.overlap==="circular",style:{top:"14%",right:"14%",transform:"scale(1) translate(50%, -50%)",transformOrigin:"100% 0%",[`&.${mt.invisible}`]:{transform:"scale(0) translate(50%, -50%)"}}},{props:({ownerState:n})=>n.anchorOrigin.vertical==="bottom"&&n.anchorOrigin.horizontal==="right"&&n.overlap==="circular",style:{bottom:"14%",right:"14%",transform:"scale(1) translate(50%, 50%)",transformOrigin:"100% 100%",[`&.${mt.invisible}`]:{transform:"scale(0) translate(50%, 50%)"}}},{props:({ownerState:n})=>n.anchorOrigin.vertical==="top"&&n.anchorOrigin.horizontal==="left"&&n.overlap==="circular",style:{top:"14%",left:"14%",transform:"scale(1) translate(-50%, -50%)",transformOrigin:"0% 0%",[`&.${mt.invisible}`]:{transform:"scale(0) translate(-50%, -50%)"}}},{props:({ownerState:n})=>n.anchorOrigin.vertical==="bottom"&&n.anchorOrigin.horizontal==="left"&&n.overlap==="circular",style:{bottom:"14%",left:"14%",transform:"scale(1) translate(-50%, 50%)",transformOrigin:"0% 100%",[`&.${mt.invisible}`]:{transform:"scale(0) translate(-50%, 50%)"}}},{props:{invisible:!0},style:{transition:e.transitions.create("transform",{easing:e.transitions.easing.easeInOut,duration:e.transitions.duration.leavingScreen})}}]}}),Cs=s.forwardRef(function(t,n){var o,r,l,i,c,a;const g=Bt({props:t,name:"MuiBadge"}),{anchorOrigin:d={vertical:"top",horizontal:"right"},className:u,component:f,components:C={},componentsProps:P={},children:b,overlap:p="rectangular",color:I="default",invisible:$=!1,max:v=99,badgeContent:h,slots:k,slotProps:F,showZero:S=!1,variant:w="standard"}=g,E=Z(g,ms),{badgeContent:T,invisible:M,max:A,displayValue:H}=us({max:v,invisible:$,badgeContent:h,showZero:S}),x=rr({anchorOrigin:d,color:I,overlap:p,variant:w,badgeContent:h}),y=M||T==null&&w!=="dot",{color:O=I,overlap:V=p,anchorOrigin:R=d,variant:D=w}=y?x:g,G=D!=="dot"?H:void 0,z=m({},g,{badgeContent:T,invisible:y,max:A,displayValue:G,showZero:S,anchorOrigin:R,color:O,overlap:V,variant:D}),N=fs(z),K=(o=(r=k==null?void 0:k.root)!=null?r:C.Root)!=null?o:hs,W=(l=(i=k==null?void 0:k.badge)!=null?i:C.Badge)!=null?l:ps,te=(c=F==null?void 0:F.root)!=null?c:P.root,q=(a=F==null?void 0:F.badge)!=null?a:P.badge,oe=So({elementType:K,externalSlotProps:te,externalForwardedProps:E,additionalProps:{ref:n,as:f},ownerState:z,className:Xe(te==null?void 0:te.className,N.root,u)}),U=So({elementType:W,externalSlotProps:q,ownerState:z,className:Xe(N.badge,q==null?void 0:q.className)});return we(K,m({},oe,{children:[b,_(W,m({},U,{children:G}))]}))}),mr=Cs;function Do(e){return e.substring(2).toLowerCase()}function bs(e,t){return t.documentElement.clientWidth<e.clientX||t.documentElement.clientHeight<e.clientY}function fr(e){const{children:t,disableReactTree:n=!1,mouseEvent:o="onClick",onClickAway:r,touchEvent:l="onTouchEnd"}=e,i=s.useRef(!1),c=s.useRef(null),a=s.useRef(!1),g=s.useRef(!1);s.useEffect(()=>(setTimeout(()=>{a.current=!0},0),()=>{a.current=!1}),[]);const d=rt(t.ref,c),u=je(P=>{const b=g.current;g.current=!1;const p=It(c.current);if(!a.current||!c.current||"clientX"in P&&bs(P,p))return;if(i.current){i.current=!1;return}let I;P.composedPath?I=P.composedPath().indexOf(c.current)>-1:I=!p.documentElement.contains(P.target)||c.current.contains(P.target),!I&&(n||!b)&&r(P)}),f=P=>b=>{g.current=!0;const p=t.props[P];p&&p(b)},C={ref:d};return l!==!1&&(C[l]=f(l)),s.useEffect(()=>{if(l!==!1){const P=Do(l),b=It(c.current),p=()=>{i.current=!0};return b.addEventListener(P,u),b.addEventListener("touchmove",p),()=>{b.removeEventListener(P,u),b.removeEventListener("touchmove",p)}}},[u,l]),o!==!1&&(C[o]=f(o)),s.useEffect(()=>{if(o!==!1){const P=Do(o),b=It(c.current);return b.addEventListener(P,u),()=>{b.removeEventListener(P,u)}}},[u,o]),_(s.Fragment,{children:s.cloneElement(t,C)})}const ws=vn(_("path",{d:"M18.41 16.59L13.82 12l4.59-4.59L17 6l-6 6 6 6zM6 6h2v12H6z"}),"FirstPage"),vs=vn(_("path",{d:"M5.59 7.41L10.18 12l-4.59 4.59L7 18l6-6-6-6zM16 6h2v12h-2z"}),"LastPage"),Ss=s.createContext(),Ps=Ss,ys=s.createContext(),xs=ys;function Is(e){return Ft("MuiTableCell",e)}const Es=yt("MuiTableCell",["root","head","body","footer","sizeSmall","sizeMedium","paddingCheckbox","paddingNone","alignLeft","alignCenter","alignRight","alignJustify","stickyHeader"]),Ms=Es,ks=["align","className","component","padding","scope","size","sortDirection","variant"],Fs=e=>{const{classes:t,variant:n,align:o,padding:r,size:l,stickyHeader:i}=e,c={root:["root",n,i&&"stickyHeader",o!=="inherit"&&`align${Pe(o)}`,r!=="normal"&&`padding${Pe(r)}`,`size${Pe(l)}`]};return ce(c,Is,t)},Ts=ie("td",{name:"MuiTableCell",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],t[`size${Pe(n.size)}`],n.padding!=="normal"&&t[`padding${Pe(n.padding)}`],n.align!=="inherit"&&t[`align${Pe(n.align)}`],n.stickyHeader&&t.stickyHeader]}})(({theme:e,ownerState:t})=>m({},e.typography.body2,{display:"table-cell",verticalAlign:"inherit",borderBottom:e.vars?`1px solid ${e.vars.palette.TableCell.border}`:`1px solid
    ${e.palette.mode==="light"?fl(Ot(e.palette.divider,1),.88):hl(Ot(e.palette.divider,1),.68)}`,textAlign:"left",padding:16},t.variant==="head"&&{color:(e.vars||e).palette.text.primary,lineHeight:e.typography.pxToRem(24),fontWeight:e.typography.fontWeightMedium},t.variant==="body"&&{color:(e.vars||e).palette.text.primary},t.variant==="footer"&&{color:(e.vars||e).palette.text.secondary,lineHeight:e.typography.pxToRem(21),fontSize:e.typography.pxToRem(12)},t.size==="small"&&{padding:"6px 16px",[`&.${Ms.paddingCheckbox}`]:{width:24,padding:"0 12px 0 16px","& > *":{padding:0}}},t.padding==="checkbox"&&{width:48,padding:"0 0 0 4px"},t.padding==="none"&&{padding:0},t.align==="left"&&{textAlign:"left"},t.align==="center"&&{textAlign:"center"},t.align==="right"&&{textAlign:"right",flexDirection:"row-reverse"},t.align==="justify"&&{textAlign:"justify"},t.stickyHeader&&{position:"sticky",top:0,zIndex:2,backgroundColor:(e.vars||e).palette.background.default})),$s=s.forwardRef(function(t,n){const o=Bt({props:t,name:"MuiTableCell"}),{align:r="inherit",className:l,component:i,padding:c,scope:a,size:g,sortDirection:d,variant:u}=o,f=Z(o,ks),C=s.useContext(Ps),P=s.useContext(xs),b=P&&P.variant==="head";let p;i?p=i:p=b?"th":"td";let I=a;p==="td"?I=void 0:!I&&b&&(I="col");const $=u||P&&P.variant,v=m({},o,{align:r,component:p,padding:c||(C&&C.padding?C.padding:"normal"),size:g||(C&&C.size?C.size:"medium"),sortDirection:d,stickyHeader:$==="head"&&C&&C.stickyHeader,variant:$}),h=Fs(v);let k=null;return d&&(k=d==="asc"?"ascending":"descending"),_(Ts,m({as:p,ref:n,className:Xe(h.root,l),"aria-sort":k,scope:I,ownerState:v},f))}),Dn=$s;function _s(e){return Ft("MuiToolbar",e)}yt("MuiToolbar",["root","gutters","regular","dense"]);const Ds=["className","component","disableGutters","variant"],Rs=e=>{const{classes:t,disableGutters:n,variant:o}=e;return ce({root:["root",!n&&"gutters",o]},_s,t)},Os=ie("div",{name:"MuiToolbar",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,!n.disableGutters&&t.gutters,t[n.variant]]}})(({theme:e,ownerState:t})=>m({position:"relative",display:"flex",alignItems:"center"},!t.disableGutters&&{paddingLeft:e.spacing(2),paddingRight:e.spacing(2),[e.breakpoints.up("sm")]:{paddingLeft:e.spacing(3),paddingRight:e.spacing(3)}},t.variant==="dense"&&{minHeight:48}),({theme:e,ownerState:t})=>t.variant==="regular"&&e.mixins.toolbar),Hs=s.forwardRef(function(t,n){const o=Bt({props:t,name:"MuiToolbar"}),{className:r,component:l="div",disableGutters:i=!1,variant:c="regular"}=o,a=Z(o,Ds),g=m({},o,{component:l,disableGutters:i,variant:c}),d=Rs(g);return _(Os,m({as:l,className:Xe(d.root,r),ref:n,ownerState:g},a))}),Ls=Hs,Vs=["backIconButtonProps","count","disabled","getItemAriaLabel","nextIconButtonProps","onPageChange","page","rowsPerPage","showFirstButton","showLastButton","slots","slotProps"],Gs=s.forwardRef(function(t,n){var o,r,l,i,c,a,g,d;const{backIconButtonProps:u,count:f,disabled:C=!1,getItemAriaLabel:P,nextIconButtonProps:b,onPageChange:p,page:I,rowsPerPage:$,showFirstButton:v,showLastButton:h,slots:k={},slotProps:F={}}=t,S=Z(t,Vs),w=pl(),E=Y=>{p(Y,0)},T=Y=>{p(Y,I-1)},M=Y=>{p(Y,I+1)},A=Y=>{p(Y,Math.max(0,Math.ceil(f/$)-1))},H=(o=k.firstButton)!=null?o:ot,x=(r=k.lastButton)!=null?r:ot,y=(l=k.nextButton)!=null?l:ot,O=(i=k.previousButton)!=null?i:ot,V=(c=k.firstButtonIcon)!=null?c:ws,R=(a=k.lastButtonIcon)!=null?a:vs,D=(g=k.nextButtonIcon)!=null?g:cs,G=(d=k.previousButtonIcon)!=null?d:as,z=w?x:H,N=w?y:O,K=w?O:y,W=w?H:x,te=w?F.lastButton:F.firstButton,q=w?F.nextButton:F.previousButton,oe=w?F.previousButton:F.nextButton,U=w?F.firstButton:F.lastButton;return we("div",m({ref:n},S,{children:[v&&_(z,m({onClick:E,disabled:C||I===0,"aria-label":P("first",I),title:P("first",I)},te,{children:w?_(R,m({},F.lastButtonIcon)):_(V,m({},F.firstButtonIcon))})),_(N,m({onClick:T,disabled:C||I===0,color:"inherit","aria-label":P("previous",I),title:P("previous",I)},q??u,{children:w?_(D,m({},F.nextButtonIcon)):_(G,m({},F.previousButtonIcon))})),_(K,m({onClick:M,disabled:C||(f!==-1?I>=Math.ceil(f/$)-1:!1),color:"inherit","aria-label":P("next",I),title:P("next",I)},oe??b,{children:w?_(G,m({},F.previousButtonIcon)):_(D,m({},F.nextButtonIcon))})),h&&_(W,m({onClick:A,disabled:C||I>=Math.ceil(f/$)-1,"aria-label":P("last",I),title:P("last",I)},U,{children:w?_(V,m({},F.firstButtonIcon)):_(R,m({},F.lastButtonIcon))}))]}))}),As=Gs;function Bs(e){return Ft("MuiTablePagination",e)}const zs=yt("MuiTablePagination",["root","toolbar","spacer","selectLabel","selectRoot","select","selectIcon","input","menuItem","displayedRows","actions"]),Et=zs;var Ro;const Ns=["ActionsComponent","backIconButtonProps","className","colSpan","component","count","disabled","getItemAriaLabel","labelDisplayedRows","labelRowsPerPage","nextIconButtonProps","onPageChange","onRowsPerPageChange","page","rowsPerPage","rowsPerPageOptions","SelectProps","showFirstButton","showLastButton","slotProps","slots"],Us=ie(Dn,{name:"MuiTablePagination",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>({overflow:"auto",color:(e.vars||e).palette.text.primary,fontSize:e.typography.pxToRem(14),"&:last-child":{padding:0}})),Ks=ie(Ls,{name:"MuiTablePagination",slot:"Toolbar",overridesResolver:(e,t)=>m({[`& .${Et.actions}`]:t.actions},t.toolbar)})(({theme:e})=>({minHeight:52,paddingRight:2,[`${e.breakpoints.up("xs")} and (orientation: landscape)`]:{minHeight:52},[e.breakpoints.up("sm")]:{minHeight:52,paddingRight:2},[`& .${Et.actions}`]:{flexShrink:0,marginLeft:20}})),Ws=ie("div",{name:"MuiTablePagination",slot:"Spacer",overridesResolver:(e,t)=>t.spacer})({flex:"1 1 100%"}),js=ie("p",{name:"MuiTablePagination",slot:"SelectLabel",overridesResolver:(e,t)=>t.selectLabel})(({theme:e})=>m({},e.typography.body2,{flexShrink:0})),qs=ie(lr,{name:"MuiTablePagination",slot:"Select",overridesResolver:(e,t)=>m({[`& .${Et.selectIcon}`]:t.selectIcon,[`& .${Et.select}`]:t.select},t.input,t.selectRoot)})({color:"inherit",fontSize:"inherit",flexShrink:0,marginRight:32,marginLeft:8,[`& .${Et.select}`]:{paddingLeft:8,paddingRight:24,textAlign:"right",textAlignLast:"right"}}),Ys=ie(Ae,{name:"MuiTablePagination",slot:"MenuItem",overridesResolver:(e,t)=>t.menuItem})({}),Qs=ie("p",{name:"MuiTablePagination",slot:"DisplayedRows",overridesResolver:(e,t)=>t.displayedRows})(({theme:e})=>m({},e.typography.body2,{flexShrink:0}));function Xs({from:e,to:t,count:n}){return`${e}–${t} of ${n!==-1?n:`more than ${t}`}`}function Zs(e){return`Go to ${e} page`}const Js=e=>{const{classes:t}=e;return ce({root:["root"],toolbar:["toolbar"],spacer:["spacer"],selectLabel:["selectLabel"],select:["select"],input:["input"],selectIcon:["selectIcon"],menuItem:["menuItem"],displayedRows:["displayedRows"],actions:["actions"]},Bs,t)},ei=s.forwardRef(function(t,n){var o;const r=Bt({props:t,name:"MuiTablePagination"}),{ActionsComponent:l=As,backIconButtonProps:i,className:c,colSpan:a,component:g=Dn,count:d,disabled:u=!1,getItemAriaLabel:f=Zs,labelDisplayedRows:C=Xs,labelRowsPerPage:P="Rows per page:",nextIconButtonProps:b,onPageChange:p,onRowsPerPageChange:I,page:$,rowsPerPage:v,rowsPerPageOptions:h=[10,25,50,100],SelectProps:k={},showFirstButton:F=!1,showLastButton:S=!1,slotProps:w={},slots:E={}}=r,T=Z(r,Ns),M=r,A=Js(M),H=(o=w==null?void 0:w.select)!=null?o:k,x=H.native?"option":Ys;let y;(g===Dn||g==="td")&&(y=a||1e3);const O=Te(H.id),V=Te(H.labelId),R=()=>d===-1?($+1)*v:v===-1?d:Math.min(d,($+1)*v);return _(Us,m({colSpan:y,ref:n,as:g,ownerState:M,className:Xe(A.root,c)},T,{children:we(Ks,{className:A.toolbar,children:[_(Ws,{className:A.spacer}),h.length>1&&_(js,{className:A.selectLabel,id:V,children:P}),h.length>1&&_(qs,m({variant:"standard"},!H.variant&&{input:Ro||(Ro=_(zn,{}))},{value:v,onChange:I,id:O,labelId:V},H,{classes:m({},H.classes,{root:Xe(A.input,A.selectRoot,(H.classes||{}).root),select:Xe(A.select,(H.classes||{}).select),icon:Xe(A.selectIcon,(H.classes||{}).icon)}),disabled:u,children:h.map(D=>s.createElement(x,m({},!Cl(x)&&{ownerState:M},{className:A.menuItem,key:D.label?D.label:D,value:D.value?D.value:D}),D.label?D.label:D))})),_(Qs,{className:A.displayedRows,children:C({from:d===0?0:$*v+1,to:R(),count:d===-1?-1:d,page:$})}),_(l,{className:A.actions,backIconButtonProps:i,count:d,nextIconButtonProps:b,onPageChange:p,page:$,rowsPerPage:v,showFirstButton:F,showLastButton:S,slotProps:w.actions,slots:E.actions,getItemAriaLabel:f,disabled:u})]})}))}),ti=ei,hr=s.createContext(void 0);function se(){const e=s.useContext(hr);if(e===void 0)throw new Error(["MUI: Could not find the data grid context.","It looks like you rendered your component outside of a DataGrid, DataGridPro or DataGridPremium parent component.","This can also happen if you are bundling multiple versions of the data grid."].join(`
`));return e}const pr=s.createContext(void 0),J=()=>{const e=s.useContext(pr);if(!e)throw new Error("MUI: useGridRootProps should only be used inside the DataGrid, DataGridPro or DataGridPremium component.");return e};function ge(e){return Ft("MuiDataGrid",e)}const L=yt("MuiDataGrid",["actionsCell","aggregationColumnHeader","aggregationColumnHeader--alignLeft","aggregationColumnHeader--alignCenter","aggregationColumnHeader--alignRight","autoHeight","booleanCell","cell--editable","cell--editing","cell--textCenter","cell--textLeft","cell--textRight","cell--withRenderer","cell","cellContent","cellCheckbox","cellSkeleton","checkboxInput","columnHeader--alignCenter","columnHeader--alignLeft","columnHeader--alignRight","columnHeader--dragging","columnHeader--moving","columnHeader--numeric","columnHeader--sortable","columnHeader--sorted","columnHeader--filtered","columnHeader","columnHeaderCheckbox","columnHeaderDraggableContainer","columnHeaderDropZone","columnHeaderTitle","columnHeaderTitleContainer","columnHeaderTitleContainerContent","columnGroupHeader","columnHeader--filledGroup","columnHeader--emptyGroup","columnHeader--showColumnBorder","columnHeaders","columnHeadersInner","columnHeadersInner--scrollable","columnSeparator--resizable","columnSeparator--resizing","columnSeparator--sideLeft","columnSeparator--sideRight","columnSeparator","columnsPanel","columnsPanelRow","detailPanel","detailPanels","detailPanelToggleCell","detailPanelToggleCell--expanded","footerCell","panel","panelHeader","panelWrapper","panelContent","panelFooter","paper","editBooleanCell","editInputCell","filterForm","filterFormDeleteIcon","filterFormLinkOperatorInput","filterFormColumnInput","filterFormOperatorInput","filterFormValueInput","filterIcon","footerContainer","iconButtonContainer","iconSeparator","main","menu","menuIcon","menuIconButton","menuOpen","menuList","overlay","root","root--densityStandard","root--densityComfortable","root--densityCompact","row","row--editable","row--editing","row--lastVisible","row--dragging","row--dynamicHeight","row--detailPanelExpanded","rowReorderCellPlaceholder","rowCount","rowReorderCellContainer","rowReorderCell","rowReorderCell--draggable","scrollArea--left","scrollArea--right","scrollArea","selectedRowCount","sortIcon","toolbarContainer","toolbarFilterList","virtualScroller","virtualScrollerContent","virtualScrollerContent--overflowed","virtualScrollerRenderZone","pinnedColumns","pinnedColumns--left","pinnedColumns--right","pinnedColumnHeaders","pinnedColumnHeaders--left","pinnedColumnHeaders--right","withBorder","treeDataGroupingCell","treeDataGroupingCellToggle","groupingCriteriaCell","groupingCriteriaCellToggle","pinnedRows","pinnedRows--top","pinnedRows--bottom","pinnedRowsRenderZone"]),ni=e=>{const{classes:t}=e;return ce({root:["main"]},ge,t)},oi=ie("div",{name:"MuiDataGrid",slot:"Main",overridesResolver:(e,t)=>t.main})(()=>({position:"relative",flexGrow:1,display:"flex",flexDirection:"column",overflow:"hidden"}));function Cr(e){const t=J(),n=ni(t);return _(oi,{className:n.root,ownerState:t,children:e.children})}function ri(e,t){var n=function(h){var k=h.__resizeTriggers__,F=k.firstElementChild,S=k.lastElementChild,w=F.firstElementChild;S.scrollLeft=S.scrollWidth,S.scrollTop=S.scrollHeight,w.style.width=F.offsetWidth+1+"px",w.style.height=F.offsetHeight+1+"px",F.scrollLeft=F.scrollWidth,F.scrollTop=F.scrollHeight},o=function(h){return h.offsetWidth!=h.__resizeLast__.width||h.offsetHeight!=h.__resizeLast__.height},r=function(h){if(!(h.target.className.indexOf("contract-trigger")<0&&h.target.className.indexOf("expand-trigger")<0)){var k=this;n(this),this.__resizeRAF__&&t.cancelAnimationFrame(this.__resizeRAF__),this.__resizeRAF__=t.requestAnimationFrame(function(){o(k)&&(k.__resizeLast__.width=k.offsetWidth,k.__resizeLast__.height=k.offsetHeight,k.__resizeListeners__.forEach(function(F){F.call(k,h)}))})}},l=!1,i="",c="animationstart",a="Webkit Moz O ms".split(" "),g="webkitAnimationStart animationstart oAnimationStart MSAnimationStart".split(" "),d="";{var u=document.createElement("fakeelement");if(u.style.animationName!==void 0&&(l=!0),l===!1){for(var f=0;f<a.length;f++)if(u.style[a[f]+"AnimationName"]!==void 0){d=a[f],i="-"+d.toLowerCase()+"-",c=g[f],l=!0;break}}}var C="resizeanim",P="@"+i+"keyframes "+C+" { from { opacity: 0; } to { opacity: 0; } } ",b=i+"animation: 1ms "+C+"; ",p=function(h,k){if(!k.getElementById("muiDetectElementResize")){var F=(P||"")+".Mui-resizeTriggers { "+(b||"")+'visibility: hidden; opacity: 0; } .Mui-resizeTriggers, .Mui-resizeTriggers > div, .contract-trigger:before { content: " "; display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; z-index: -1; } .Mui-resizeTriggers > div { background: #eee; overflow: auto; } .contract-trigger:before { width: 200%; height: 200%; }',S=k.constructor.name==="ShadowRoot"?k:h.head||h.getElementsByTagName("head")[0],w=h.createElement("style");w.id="muiDetectElementResize",w.type="text/css",e!=null&&w.setAttribute("nonce",e),w.styleSheet?w.styleSheet.cssText=F:w.appendChild(h.createTextNode(F)),S.appendChild(w)}},I=function(h,k){if(!h.__resizeTriggers__){var F=h.ownerDocument,S=t.getComputedStyle(h);S&&S.position=="static"&&(h.style.position="relative"),p(F,h.getRootNode()),h.__resizeLast__={},h.__resizeListeners__=[],(h.__resizeTriggers__=F.createElement("div")).className="Mui-resizeTriggers",h.__resizeTriggers__.innerHTML='<div class="expand-trigger"><div></div></div><div class="contract-trigger"></div>',h.appendChild(h.__resizeTriggers__),n(h),h.addEventListener("scroll",r,!0),c&&(h.__resizeTriggers__.__animationListener__=function(E){E.animationName==C&&n(h)},h.__resizeTriggers__.addEventListener(c,h.__resizeTriggers__.__animationListener__))}h.__resizeListeners__.push(k)},$=function(h,k){if(h.__resizeListeners__.splice(h.__resizeListeners__.indexOf(k),1),!h.__resizeListeners__.length){h.removeEventListener("scroll",r,!0),h.__resizeTriggers__.__animationListener__&&(h.__resizeTriggers__.removeEventListener(c,h.__resizeTriggers__.__animationListener__),h.__resizeTriggers__.__animationListener__=null);try{h.__resizeTriggers__=!h.removeChild(h.__resizeTriggers__)}catch{}}};return{addResizeListener:I,removeResizeListener:$}}const li=["children","defaultHeight","defaultWidth","disableHeight","disableWidth","nonce","onResize","style"],si=s.forwardRef(function(t,n){const{children:o,defaultHeight:r=null,defaultWidth:l=null,disableHeight:i=!1,disableWidth:c=!1,nonce:a,onResize:g,style:d}=t,u=Z(t,li),[f,C]=s.useState({height:r,width:l}),P=s.useRef(null),b=s.useRef(null),p=je(()=>{if(b.current){const h=b.current.offsetHeight||0,k=b.current.offsetWidth||0,S=Po(b.current).getComputedStyle(b.current),w=parseInt(S.paddingLeft,10)||0,E=parseInt(S.paddingRight,10)||0,T=parseInt(S.paddingTop,10)||0,M=parseInt(S.paddingBottom,10)||0,A=h-T-M,H=k-w-E;(!i&&f.height!==A||!c&&f.width!==H)&&(C({height:A,width:H}),g&&g({height:A,width:H}))}});Ue(()=>{var h;if(b.current=P.current.parentElement,!b)return;const k=Po((h=b.current)!=null?h:void 0),F=ri(a,k);return F.addResizeListener(b.current,p),p(),()=>{F.removeResizeListener(b.current,p)}},[a,p]);const I={overflow:"visible"},$={};i||(I.height=0,$.height=f.height),c||(I.width=0,$.width=f.width);const v=rt(P,n);return _("div",m({ref:v,style:m({},I,d)},u,{children:f.height===null&&f.width===null?null:o($)}))}),Je=(e,t="warning")=>{let n=!1;const o=Array.isArray(e)?e.join(`
`):e;return()=>{n||(n=!0,t==="error"?console.error(o):console.warn(o))}},qn=(e,t)=>e;function ii(e){return e.acceptsApiRef}Je(["MUI: `useGridSelector` has been called before the initialization of the state.","This hook can only be used inside the context of the grid."]);const ee=(e,t)=>ii(t)?t(e):t(e.current.state);var fn="NOT_FOUND";function ai(e){var t;return{get:function(o){return t&&e(t.key,o)?t.value:fn},put:function(o,r){t={key:o,value:r}},getEntries:function(){return t?[t]:[]},clear:function(){t=void 0}}}function ci(e,t){var n=[];function o(c){var a=n.findIndex(function(d){return t(c,d.key)});if(a>-1){var g=n[a];return a>0&&(n.splice(a,1),n.unshift(g)),g.value}return fn}function r(c,a){o(c)===fn&&(n.unshift({key:c,value:a}),n.length>e&&n.pop())}function l(){return n}function i(){n=[]}return{get:o,put:r,getEntries:l,clear:i}}var ui=function(t,n){return t===n};function di(e){return function(n,o){if(n===null||o===null||n.length!==o.length)return!1;for(var r=n.length,l=0;l<r;l++)if(!e(n[l],o[l]))return!1;return!0}}function br(e,t){var n=typeof t=="object"?t:{equalityCheck:t},o=n.equalityCheck,r=o===void 0?ui:o,l=n.maxSize,i=l===void 0?1:l,c=n.resultEqualityCheck,a=di(r),g=i===1?ai(a):ci(i,a);function d(){var u=g.get(arguments);if(u===fn){if(u=e.apply(null,arguments),c){var f=g.getEntries(),C=f.find(function(P){return c(P.value,u)});C&&(u=C.value)}g.put(arguments,u)}return u}return d.clearCache=function(){return g.clear()},d}function gi(e){var t=Array.isArray(e[0])?e[0]:e;if(!t.every(function(o){return typeof o=="function"})){var n=t.map(function(o){return typeof o=="function"?"function "+(o.name||"unnamed")+"()":typeof o}).join(", ");throw new Error("createSelector expects all input-selectors to be functions, but received the following types: ["+n+"]")}return t}function mi(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),o=1;o<t;o++)n[o-1]=arguments[o];var r=function(){for(var i=arguments.length,c=new Array(i),a=0;a<i;a++)c[a]=arguments[a];var g=0,d,u={memoizeOptions:void 0},f=c.pop();if(typeof f=="object"&&(u=f,f=c.pop()),typeof f!="function")throw new Error("createSelector expects an output function after the inputs, but received: ["+typeof f+"]");var C=u,P=C.memoizeOptions,b=P===void 0?n:P,p=Array.isArray(b)?b:[b],I=gi(c),$=e.apply(void 0,[function(){return g++,f.apply(null,arguments)}].concat(p)),v=e(function(){for(var k=[],F=I.length,S=0;S<F;S++)k.push(I[S].apply(null,arguments));return d=$.apply(null,k),d});return Object.assign(v,{resultFunc:f,memoizedResultFunc:$,dependencies:I,lastResult:function(){return d},recomputations:function(){return g},resetRecomputations:function(){return g=0}}),v};return r}var fi=mi(br);const ct={cache:null};Je(["MUI: A selector was called without passing the instance ID, which may impact the performance of the grid.","To fix, call it with `apiRef`, e.g. `mySelector(apiRef)`, or pass the instance ID explicitly, e.g `mySelector(state, apiRef.current.instanceId)`."]);const ne=(...e)=>{ct.cache===null&&(ct.cache={});const t=(...n)=>{const[o,r]=n,l=!!o.current,i=l?o.current.instanceId:r??"default",c=l?o.current.state:o;ct.cache===null&&(ct.cache={});const{cache:a}=ct;if(a[i]&&a[i].get(e))return a[i].get(e)(c,i);const g=fi(...e);return a[i]||(a[i]=new Map),a[i].set(e,g),g(c,i)};return t.acceptsApiRef=!0,t},hi=e=>{typeof e<"u"?ct.cache&&ct.cache[e]&&delete ct.cache[e]:ct.cache=null},lt=e=>e.rows,Sn=ne(lt,e=>e.totalRowCount),pi=ne(lt,e=>e.loading),Ci=ne(lt,e=>e.totalTopLevelRowCount),Ht=ne(lt,e=>e.idRowsLookup),Yn=ne(lt,e=>e.idToIdLookup),bt=ne(lt,e=>e.tree),bi=ne(lt,e=>e.groupingName),Qn=ne(lt,e=>e.treeDepth),xt=ne(lt,e=>e.ids),wi=ne(lt,e=>e==null?void 0:e.additionalRowGroups),tn=ne(wi,e=>e==null?void 0:e.pinnedRows),vi=ne(tn,e=>{var t,n;return((e==null||(t=e.top)==null?void 0:t.length)||0)+((e==null||(n=e.bottom)==null?void 0:n.length)||0)}),Xn=e=>e.sorting,Zn=ne(Xn,e=>e.sortedRows),Jn=ne(Zn,Ht,(e,t)=>e.map(n=>({id:n,model:t[n]}))),Ye=ne(Xn,e=>e.sortModel),Si=ne(Ye,e=>e.reduce((n,o,r)=>(n[o.field]={sortDirection:o.sort,sortIndex:e.length>1?r+1:void 0},n),{})),Mt=e=>e.columns,Gt=ne(Mt,e=>e.all),Nt=ne(Mt,e=>e.lookup),Ze=ne(Gt,Nt,(e,t)=>e.map(n=>t[n])),ut=ne(Mt,e=>e.columnVisibilityModel),Oe=ne(Ze,ut,(e,t)=>e.filter(n=>t[n.field]!==!1));ne(Oe,e=>e.map(t=>t.field));const kt=ne(Oe,e=>{const t=[];let n=0;for(let o=0;o<e.length;o+=1)t.push(n),n+=e[o].computedWidth;return t}),Pn=ne(Oe,kt,(e,t)=>{const n=e.length;return n===0?0:t[n-1]+e[n-1].computedWidth}),eo=ne(Ze,e=>e.filter(t=>t.filterable)),Pi=ne(Ze,e=>e.reduce((t,n)=>(n.filterable&&(t[n.field]=n),t),{}));qn(ne(eo,e=>e.map(t=>t.field)));qn(ne(Oe,e=>e.length));const yi=qn(ne(kt,Pn,(e,t)=>({totalWidth:t,positions:e}))),nn=e=>e.filter,Ge=ne(nn,e=>e.filterModel),Ef=ne(Ge,e=>e.quickFilterValues),xi=ne(nn,e=>e.visibleRowsLookup),wr=ne(nn,e=>e.filteredRowsLookup);ne(nn,e=>e.filteredDescendantCountLookup);const gt=ne(xi,Jn,(e,t)=>t.filter(n=>e[n.id]!==!1)),Yt=ne(gt,e=>e.map(t=>t.id)),Ii=ne(wr,Jn,(e,t)=>t.filter(n=>e[n.id]!==!1)),Ei=ne(Ii,e=>e.map(t=>t.id)),vr=ne(gt,bt,Qn,(e,t,n)=>n<2?e:e.filter(o=>{var r;return((r=t[o.id])==null?void 0:r.depth)===0})),Sr=ne(gt,e=>e.length),Pr=ne(vr,e=>e.length),Mi=ne(Ge,Nt,(e,t)=>{var n;return(n=e.items)==null?void 0:n.filter(o=>{var r,l;if(!o.columnField)return!1;const i=t[o.columnField];if(!(i!=null&&i.filterOperators)||(i==null||(r=i.filterOperators)==null?void 0:r.length)===0)return!1;const c=i.filterOperators.find(a=>a.value===o.operatorValue);return c?!c.InputComponent||o.value!=null&&((l=o.value)==null?void 0:l.toString())!=="":!1})}),ki=ne(Mi,e=>e.reduce((n,o)=>(n[o.columnField]?n[o.columnField].push(o):n[o.columnField]=[o],n),{})),Tt=e=>e.density,Fi=ne(Tt,e=>e.value),on=ne(Tt,e=>e.rowHeight),yr=ne(Tt,e=>e.headerHeight),to=ne(Tt,e=>e.headerGroupingMaxDepth),Ti=ne(Tt,e=>e.factor),rn=ne(Tt,e=>e.headerHeight*(1+e.headerGroupingMaxDepth));function $i(e){var t,n;const o=se(),r=J(),l=ee(o,rn),[i,c]=s.useState(()=>{var d,u;return(d=(u=o.current.getRootDimensions())==null?void 0:u.viewportInnerSize)!=null?d:null}),a=s.useCallback(()=>{var d,u;c((d=(u=o.current.getRootDimensions())==null?void 0:u.viewportInnerSize)!=null?d:null)},[o]);Ue(()=>o.current.subscribeEvent("viewportInnerSizeChange",a),[o,a]);let g=(t=i==null?void 0:i.height)!=null?t:0;return r.autoHeight&&g===0&&(g="auto"),i?_("div",m({style:{height:g,width:(n=i==null?void 0:i.width)!=null?n:0,position:"absolute",top:l,bottom:g==="auto"?0:void 0}},e)):null}function _i(){const e=se(),t=J(),n=ee(e,Sn),o=ee(e,Sr),r=ee(e,pi),l=!r&&n===0,i=!r&&n>0&&o===0;let c=null;if(l){var a;c=_(t.components.NoRowsOverlay,m({},(a=t.componentsProps)==null?void 0:a.noRowsOverlay))}if(i){var g;c=_(t.components.NoResultsOverlay,m({},(g=t.componentsProps)==null?void 0:g.noResultsOverlay))}if(r){var d;c=_(t.components.LoadingOverlay,m({},(d=t.componentsProps)==null?void 0:d.loadingOverlay))}return c===null?null:_($i,{children:c})}function Di(e){const{children:t,VirtualScrollerComponent:n,ColumnHeadersComponent:o}=e,r=se(),l=J(),i=ee(r,rn),[c,a]=s.useState(l.disableVirtualization),g=s.useCallback(()=>{a(!0)},[]),d=s.useCallback(()=>{a(!1)},[]);s.useEffect(()=>{a(l.disableVirtualization)},[l.disableVirtualization]),r.current.unstable_disableVirtualization=g,r.current.unstable_enableVirtualization=d;const u=s.useRef(null),f=s.useRef(null),C=s.useRef(null),P=s.useRef(null);r.current.columnHeadersContainerElementRef=f,r.current.columnHeadersElementRef=u,r.current.windowRef=C,r.current.renderingZoneRef=P;const b=s.useCallback(p=>{r.current.publishEvent("resize",p)},[r]);return we(Cr,{children:[_(_i,{}),_(o,{ref:f,innerRef:u}),_(si,{nonce:l.nonce,disableHeight:l.autoHeight,onResize:b,children:p=>{const I={width:p.width,height:p.height?p.height-i:"auto",marginTop:i};return _(n,{ref:C,style:I,disableVirtualization:c})}}),t]})}function Me(e,t){const n=s.useRef(null);if(n.current)return n.current;const o=e.current.getLogger(t);return n.current=o,o}class Ri extends s.Component{static getDerivedStateFromError(t){return{hasError:!0,error:t}}componentDidCatch(t,n){this.props.api.current&&(this.logError(t),this.props.api.current.showError({error:t,errorInfo:n}))}logError(t,n){this.props.logger.error(`An unexpected error occurred. Error: ${t&&t.message}. `,t,n)}render(){var t;return this.props.hasError||(t=this.state)!=null&&t.hasError?this.props.render(this.state):this.props.children}}function Oi(e){const{children:t}=e,n=se(),o=Me(n,"GridErrorHandler"),r=J(),l=n.current.state.error;return _(Ri,{hasError:l!=null,api:n,logger:o,render:i=>{var c;return _(Cr,{children:_(r.components.ErrorOverlay,m({},i,l,(c=r.componentsProps)==null?void 0:c.errorOverlay))})},children:t})}function Hi(){var e;const t=se(),n=J(),o=s.useRef(null);return t.current.footerRef=o,n.hideFooter?null:_("div",{ref:o,children:_(n.components.Footer,m({},(e=n.componentsProps)==null?void 0:e.footer))})}function Li(){var e;const t=se(),n=J(),o=s.useRef(null);return t.current.headerRef=o,_("div",{ref:o,children:_(n.components.Header,m({},(e=n.componentsProps)==null?void 0:e.header))})}var Re;(function(e){e.Cell="cell",e.Row="row"})(Re||(Re={}));var ue;(function(e){e.Edit="edit",e.View="view"})(ue||(ue={}));var he;(function(e){e.Edit="edit",e.View="view"})(he||(he={}));const Lt={client:"client",server:"server"};var He;(function(e){e.And="and",e.Or="or"})(He||(He={}));var it;(function(e){e.enterKeyDown="enterKeyDown",e.cellDoubleClick="cellDoubleClick",e.printableKeyDown="printableKeyDown",e.deleteKeyDown="deleteKeyDown"})(it||(it={}));var et;(function(e){e.cellFocusOut="cellFocusOut",e.escapeKeyDown="escapeKeyDown",e.enterKeyDown="enterKeyDown",e.tabKeyDown="tabKeyDown",e.shiftTabKeyDown="shiftTabKeyDown"})(et||(et={}));var at;(function(e){e.enterKeyDown="enterKeyDown",e.cellDoubleClick="cellDoubleClick",e.printableKeyDown="printableKeyDown",e.deleteKeyDown="deleteKeyDown"})(at||(at={}));var tt;(function(e){e.rowFocusOut="rowFocusOut",e.escapeKeyDown="escapeKeyDown",e.enterKeyDown="enterKeyDown",e.tabKeyDown="tabKeyDown",e.shiftTabKeyDown="shiftTabKeyDown"})(tt||(tt={}));var Zt;(function(e){e.Compact="compact",e.Standard="standard",e.Comfortable="comfortable"})(Zt||(Zt={}));function xr(e){return e.field!==void 0}const Ir=e=>e.focus,Qe=ne(Ir,e=>e.cell),Vi=ne(Ir,e=>e.columnHeader),Er=e=>e.tabIndex,hn=ne(Er,e=>e.cell),Mr=ne(Er,e=>e.columnHeader),Gi=["align","children","colIndex","colDef","cellMode","field","formattedValue","hasFocus","height","isEditable","rowId","tabIndex","value","width","className","showRightBorder","extendRowFullWidth","row","colSpan","disableDragEvents","onClick","onDoubleClick","onMouseDown","onMouseUp","onKeyDown","onDragEnter","onDragOver"];let Tn;function Ai(){return Tn===void 0&&document.createElement("div").focus({get preventScroll(){return Tn=!0,!1}}),Tn}const Bi=e=>{const{align:t,showRightBorder:n,isEditable:o,classes:r}=e,l={root:["cell",`cell--text${Pe(t)}`,o&&"cell--editable",n&&"withBorder"],content:["cellContent"]};return ce(l,ge,r)};function zi(e){const{align:t,children:n,colIndex:o,cellMode:r,field:l,formattedValue:i,hasFocus:c,height:a,isEditable:g,rowId:d,tabIndex:u,value:f,width:C,className:P,showRightBorder:b,colSpan:p,disableDragEvents:I,onClick:$,onDoubleClick:v,onMouseDown:h,onMouseUp:k,onKeyDown:F,onDragEnter:S,onDragOver:w}=e,E=Z(e,Gi),T=i??f,M=s.useRef(null),A=s.useRef(null),H=se(),x=J(),y={align:t,showRightBorder:b,isEditable:g,classes:x.classes},O=Bi(y),V=s.useCallback(q=>oe=>{const U=H.current.getCellParams(d,l||"");H.current.publishEvent(q,U,oe),k&&k(oe)},[H,l,k,d]),R=s.useCallback(q=>oe=>{const U=H.current.getCellParams(d,l||"");H.current.publishEvent(q,U,oe),h&&h(oe)},[H,l,h,d]),D=s.useCallback((q,oe)=>U=>{if(!U.currentTarget.contains(U.target)||!H.current.getRow(d))return;const Y=H.current.getCellParams(d,l||"");H.current.publishEvent(q,Y,U),oe&&oe(U)},[H,l,d]),G={minWidth:C,maxWidth:C,minHeight:a,maxHeight:a==="auto"?"none":a};s.useEffect(()=>{if(!c||r===ue.Edit)return;const q=It(H.current.rootElementRef.current);if(M.current&&!M.current.contains(q.activeElement)){const oe=M.current.querySelector('[tabindex="0"]'),U=A.current||oe||M.current;if(Ai())U.focus({preventScroll:!0});else{const Y=H.current.getScrollPosition();U.focus(),H.current.scroll(Y)}}},[c,r,H]);let z=E.onFocus;const K=H.current.getColumn(l).type==="actions",W=()=>{if(n==null){const q=T==null?void 0:T.toString();return _("div",{title:q,className:O.content,children:q})}return s.isValidElement(n)&&K?s.cloneElement(n,{focusElementRef:A}):n},te=I?null:{onDragEnter:D("cellDragEnter",S),onDragOver:D("cellDragOver",w)};return _("div",m({ref:M,className:pe(P,O.root),role:"cell","data-field":l,"data-colindex":o,"aria-colindex":o+1,"aria-colspan":p,style:G,tabIndex:(r==="view"||!g)&&!K?u:-1,onClick:D("cellClick",$),onDoubleClick:D("cellDoubleClick",v),onMouseDown:R("cellMouseDown"),onMouseUp:V("cellMouseUp"),onKeyDown:D("cellKeyDown",F)},te,E,{onFocus:z,children:W()}))}const Ni=["id","value","formattedValue","api","field","row","rowNode","colDef","cellMode","isEditable","hasFocus","tabIndex","getValue"],Ui=e=>{const{classes:t}=e;return ce({root:["booleanCell"]},ge,t)},Ki=e=>{const{value:t}=e,n=Z(e,Ni),o=se(),r=J(),l={classes:r.classes},i=Ui(l),c=s.useMemo(()=>t?r.components.BooleanCellTrueIcon:r.components.BooleanCellFalseIcon,[r.components.BooleanCellFalseIcon,r.components.BooleanCellTrueIcon,t]);return _(c,m({fontSize:"small",className:i.root,titleAccess:o.current.getLocaleText(t?"booleanCellTrueLabel":"booleanCellFalseLabel"),"data-value":!!t},n))},Wi=s.memo(Ki),ji=e=>e.rowNode.isAutoGenerated?"":_(Wi,m({},e)),qi=["id","value","formattedValue","api","field","row","rowNode","colDef","cellMode","isEditable","tabIndex","className","getValue","hasFocus","isValidating","isProcessingProps","error","onValueChange"],Yi=e=>{const{classes:t}=e;return ce({root:["editBooleanCell"]},ge,t)};function Qi(e){var t;const{id:n,value:o,field:r,className:l,hasFocus:i,onValueChange:c}=e,a=Z(e,qi),g=se(),d=s.useRef(null),u=Te(),[f,C]=s.useState(o),P=J(),b={classes:P.classes},p=Yi(b),I=s.useCallback(async $=>{const v=$.target.checked;c&&await c($,v),C(v),await g.current.setEditCellValue({id:n,field:r,value:v},$)},[g,r,n,c]);return s.useEffect(()=>{C(o)},[o]),Ue(()=>{i&&d.current.focus()},[i]),_("label",m({htmlFor:u,className:pe(p.root,l)},a,{children:_(P.components.BaseCheckbox,m({id:u,inputRef:d,checked:!!f,onChange:I,size:"small"},(t=P.componentsProps)==null?void 0:t.baseCheckbox))}))}const Xi=e=>_(Qi,m({},e)),Zi=["id","value","formattedValue","api","field","row","rowNode","colDef","cellMode","isEditable","tabIndex","hasFocus","getValue","inputProps","isValidating","isProcessingProps","onValueChange"],Ji=ie(zn)({fontSize:"inherit"}),ea=e=>{const{classes:t}=e;return ce({root:["editInputCell"]},ge,t)};function ta(e){const{id:t,value:n,field:o,colDef:r,hasFocus:l,inputProps:i,onValueChange:c}=e,a=Z(e,Zi),g=r.type==="dateTime",d=se(),u=s.useRef(),f=s.useMemo(()=>{let v;n==null?v=null:n instanceof Date?v=n:v=new Date((n??"").toString());let h;return v==null||Number.isNaN(v.getTime())?h="":h=new Date(v.getTime()-v.getTimezoneOffset()*60*1e3).toISOString().substr(0,g?16:10),{parsed:v,formatted:h}},[n,g]),[C,P]=s.useState(f),p={classes:J().classes},I=ea(p),$=s.useCallback(async v=>{const h=v.target.value;let k;if(h==="")k=null;else{const[F,S]=h.split("T"),[w,E,T]=F.split("-");if(k=new Date,k.setFullYear(Number(w),Number(E)-1,Number(T)),k.setHours(0,0,0,0),S){const[M,A]=S.split(":");k.setHours(Number(M),Number(A),0,0)}}c&&await c(v,k),P({parsed:k,formatted:h}),d.current.setEditCellValue({id:t,field:o,value:k},v)},[d,o,t,c]);return s.useEffect(()=>{P(v=>{var h,k;return f.parsed!==v.parsed&&((h=f.parsed)==null?void 0:h.getTime())!==((k=v.parsed)==null?void 0:k.getTime())?f:v})},[f]),Ue(()=>{l&&u.current.focus()},[l]),_(Ji,m({inputRef:u,fullWidth:!0,className:I.root,type:g?"datetime-local":"date",inputProps:m({max:g?"9999-12-31T23:59":"9999-12-31"},i),value:C.formatted,onChange:$},a))}const kr=e=>_(ta,m({},e));function wt(e){return typeof e=="object"&&e!==null?e.value:e}function pn(e,t){if(t===void 0)return;const n=t.find(o=>{const r=wt(o);return String(r)===String(e)});return wt(n)}const na=["item","applyValue","type","apiRef","focusElementRef"],oa=({valueOptions:e,valueFormatter:t,field:n},o,r)=>(typeof e=="function"?["",...e({field:n})]:["",...e||[]]).map(i=>{const c=typeof i=="object",a=c?i.value:i,g=c?i.value:i,d=t&&i!==""?t({value:i,field:n,api:o}):i,u=c?i.label:d;return _(r,{value:g,children:u},a)}),Fr=500;function nt(e){var t,n,o,r,l;const{item:i,applyValue:c,type:a,apiRef:g,focusElementRef:d}=e,u=Z(e,na),f=s.useRef(),[C,P]=s.useState((t=i.value)!=null?t:""),[b,p]=s.useState(!1),I=Te(),$=J(),h=(o=(((n=$.componentsProps)==null?void 0:n.baseSelect)||{}).native)!=null?o:!0,k=a==="singleSelect"?{select:!0,SelectProps:m({native:h},(r=$.componentsProps)==null?void 0:r.baseSelect),children:oa(g.current.getColumn(i.columnField),g.current,h?"option":Ae)}:{},F=s.useCallback(w=>{let E=w.target.value;if(a==="singleSelect"){const T=g.current.getColumn(i.columnField),M=typeof T.valueOptions=="function"?T.valueOptions({field:T.field}):T.valueOptions;E=pn(E,M)}clearTimeout(f.current),P(String(E)),p(!0),f.current=setTimeout(()=>{c(m({},i,{value:E})),p(!1)},Fr)},[g,c,i,a]);s.useEffect(()=>()=>{clearTimeout(f.current)},[]),s.useEffect(()=>{var w;const E=(w=i.value)!=null?w:"";P(String(E))},[i.value]);const S=b?{endAdornment:_(Nn,{})}:u.InputProps;return _($.components.BaseTextField,m({id:I,label:g.current.getLocaleText("filterPanelInputLabel"),placeholder:g.current.getLocaleText("filterPanelInputPlaceholder"),value:C,onChange:F,variant:"standard",type:a||"text",InputProps:S,InputLabelProps:{shrink:!0},inputRef:d},k,u,(l=$.componentsProps)==null?void 0:l.baseTextField))}const ra=["id","value","formattedValue","api","field","row","rowNode","colDef","cellMode","isEditable","tabIndex","hasFocus","getValue","isValidating","debounceMs","isProcessingProps","onValueChange"],la=e=>{const{classes:t}=e;return ce({root:["editInputCell"]},ge,t)},sa=ie(zn,{name:"MuiDataGrid",slot:"EditInputCell",overridesResolver:(e,t)=>t.editInputCell})(({theme:e})=>m({},e.typography.body2,{padding:"1px 0","& input":{padding:"0 16px",height:"100%"}})),ia=s.forwardRef((e,t)=>{var n,o;const r=J(),{id:l,value:i,field:c,colDef:a,hasFocus:g,debounceMs:d=(n=r.experimentalFeatures)!=null&&n.newEditingApi?200:Fr,isProcessingProps:u,onValueChange:f}=e,C=Z(e,ra),P=se(),b=s.useRef(),[p,I]=s.useState(i),$=la(r),v=s.useCallback(async k=>{var F;const S=k.target.value;f&&await f(k,S);const w=P.current.getColumn(c);let E=S;w.valueParser&&(F=r.experimentalFeatures)!=null&&F.newEditingApi&&(E=w.valueParser(S,P.current.getCellParams(l,c))),I(E),P.current.setEditCellValue({id:l,field:c,value:E,debounceMs:d,unstable_skipValueParser:!0},k)},[P,d,c,l,f,(o=r.experimentalFeatures)==null?void 0:o.newEditingApi]),h=P.current.unstable_getEditCellMeta?P.current.unstable_getEditCellMeta(l,c):{};return s.useEffect(()=>{h.changeReason!=="debouncedSetEditCellValue"&&I(i)},[h.changeReason,i]),Ue(()=>{g&&b.current.focus()},[g]),_(sa,m({ref:t,inputRef:b,className:$.root,ownerState:r,fullWidth:!0,type:a.type==="number"?a.type:"text",value:p??"",onChange:v,endAdornment:u?_(Nn,{}):void 0},C))}),aa=e=>_(ia,m({},e)),no=e=>e==="Escape",Tr=e=>e==="Enter",oo=e=>e==="Tab",$r=e=>e===" ",ca=e=>e.indexOf("Arrow")===0,ua=e=>e==="Home"||e==="End",da=e=>e.indexOf("Page")===0,Rn=e=>e==="Delete"||e==="Backspace";function yn(e){return e.key.length===1&&e.ctrlKey===!1&&e.metaKey===!1}const ga=["Enter","Escape","Tab"],ma=["Enter","Tab"],fa=e=>Tr(e.key)||Rn(e.key)||yn(e),ha=e=>ga.indexOf(e)>-1,Oo=e=>ma.indexOf(e)>-1,ln=e=>ua(e)||ca(e)||da(e)||$r(e),On=e=>!!e.key,_r=e=>oo(e)||no(e),pa=["id","value","formattedValue","api","field","row","rowNode","colDef","cellMode","isEditable","tabIndex","className","getValue","hasFocus","isValidating","isProcessingProps","error","onValueChange","initialOpen"],Ca=(e,t)=>{const n=typeof e=="object",o=n?e.value:e,r=n?e.value:e,l=n?e.label:e;return _(t,{value:r,children:l},o)};function ba(e){return!!e.key}function wa(e){var t,n,o;const r=J(),{id:l,value:i,api:c,field:a,row:g,colDef:d,hasFocus:u,error:f,onValueChange:C,initialOpen:P=r.editMode===Re.Cell}=e,b=Z(e,pa),p=se(),I=s.useRef(),$=s.useRef(),[v,h]=s.useState(P),F=(n=(((t=r.componentsProps)==null?void 0:t.baseSelect)||{}).native)!=null?n:!1;let S;typeof d.valueOptions=="function"?S=d.valueOptions({id:l,row:g,field:a}):S=d.valueOptions,d.valueFormatter&&(S=S.map(M=>{if(typeof M=="object")return M;const A={field:a,api:c,value:M};return{value:M,label:String(d.valueFormatter(A))}}));const w=async M=>{var A;h(!1);const H=M.target,x=pn(H.value,S);C&&await C(M,x);const y=await p.current.setEditCellValue({id:l,field:a,value:x},M);if((A=r.experimentalFeatures)!=null&&A.newEditingApi||r.editMode===Re.Row||y===!1)return;if(await Promise.resolve(p.current.commitCellChange({id:l,field:a},M))&&(p.current.setCellMode(l,a,"view"),M.key)){const V=p.current.getCellParams(l,a);p.current.publishEvent("cellNavigationKeyDown",V,M)}},E=(M,A)=>{if(r.editMode===Re.Row){h(!1);return}if(A==="backdropClick"||no(M.key)){var H;(H=r.experimentalFeatures)!=null&&H.newEditingApi?p.current.stopCellEditMode({id:l,field:a,ignoreModifications:!0}):p.current.setCellMode(l,a,"view")}},T=M=>{ba(M)&&M.key==="Enter"||h(!0)};return Ue(()=>{u&&$.current.focus()},[u]),_(r.components.BaseSelect,m({ref:I,inputRef:$,value:i,onChange:w,open:v,onOpen:T,MenuProps:{onClose:E},error:f,native:F,fullWidth:!0},b,(o=r.componentsProps)==null?void 0:o.baseSelect,{children:S.map(M=>Ca(M,F?"option":Ae))}))}const va=e=>_(wa,m({},e)),Sa=["open","target","onClickAway","children","position","className","onExited"],Pa=e=>{const{classes:t}=e;return ce({root:["menu"]},ge,t)},ya=ie(Un,{name:"MuiDataGrid",slot:"Menu",overridesResolver:(e,t)=>t.menu})(({theme:e})=>({zIndex:e.zIndex.modal,[`& .${L.menuList}`]:{outline:0}})),xa={"bottom-start":"top left","bottom-end":"top right"},ro=e=>{var t;const{open:n,target:o,onClickAway:r,children:l,position:i,className:c,onExited:a}=e,g=Z(e,Sa),d=se(),u=s.useRef(o),f=s.useRef(n),C=J(),P=Pa(C);s.useEffect(()=>{f.current&&u.current&&u.current.focus();const p=n?"menuOpen":"menuClose";d.current.publishEvent(p,{target:o}),f.current=n,u.current=o},[d,n,o]);const b=p=>I=>{p&&p(),a&&a(I)};return _(ya,m({as:C.components.BasePopper,className:pe(c,P.root),ownerState:C,open:n,anchorEl:o,transition:!0,placement:i},g,(t=C.componentsProps)==null?void 0:t.basePopper,{children:({TransitionProps:p,placement:I})=>_(fr,{onClickAway:r,mouseEvent:"onMouseDown",children:_(bl,m({},p,{style:{transformOrigin:xa[I]},onExited:b(p==null?void 0:p.onExited),children:_(sr,{children:l})}))})}))},Ia=["colDef","id","api","hasFocus","isEditable","field","value","formattedValue","row","rowNode","cellMode","getValue","tabIndex","position","focusElementRef"],Ea=e=>typeof e.getActions=="function",Ma=e=>{const{colDef:t,id:n,hasFocus:o,tabIndex:r,position:l="bottom-end",focusElementRef:i}=e,c=Z(e,Ia),[a,g]=s.useState(-1),[d,u]=s.useState(!1),f=se(),C=s.useRef(null),P=s.useRef(null),b=s.useRef(!1),p=s.useRef({}),I=Te(),$=Te(),v=J();if(s.useLayoutEffect(()=>{o||Object.entries(p.current).forEach(([x,y])=>{y==null||y.stop({},()=>{delete p.current[x]})})},[o]),s.useEffect(()=>{if(a<0||!C.current||a>=C.current.children.length)return;C.current.children[a].focus({preventScroll:!0})},[a]),s.useEffect(()=>{o||(g(-1),b.current=!1)},[o]),s.useImperativeHandle(i,()=>({focus(){b.current||g(0)}}),[]),!Ea(t))throw new Error("MUI: Missing the `getActions` property in the `GridColDef`.");const h=t.getActions(f.current.getRowParams(n)),k=h.filter(x=>!x.props.showInMenu),F=h.filter(x=>x.props.showInMenu),S=k.length+(F.length?1:0);s.useEffect(()=>{a>=S&&g(S-1)},[a,S]);const w=()=>{u(!0),g(S-1),b.current=!0},E=()=>{u(!1)},T=x=>y=>{p.current[x]=y},M=(x,y)=>O=>{g(x),b.current=!0,y&&y(O)},A=x=>{if(S<=1)return;let y=a;x.key==="ArrowRight"?y+=1:x.key==="ArrowLeft"&&(y-=1),!(y<0||y>=S)&&y!==a&&(x.preventDefault(),x.stopPropagation(),g(y))},H=x=>{x.key==="Tab"&&x.preventDefault(),["Tab","Enter","Escape"].includes(x.key)&&E()};return we("div",m({role:"menu",ref:C,tabIndex:-1,className:L.actionsCell,onKeyDown:A},c,{children:[k.map((x,y)=>s.cloneElement(x,{key:y,touchRippleRef:T(y),onClick:M(y,x.props.onClick),tabIndex:a===y?r:-1})),F.length>0&&$&&_(ot,{ref:P,id:$,"aria-label":f.current.getLocaleText("actionsCellMore"),"aria-controls":I,"aria-expanded":d?"true":void 0,"aria-haspopup":"true",role:"menuitem",size:"small",onClick:w,touchRippleRef:T($),tabIndex:a===k.length?r:-1,children:_(v.components.MoreActionsIcon,{fontSize:"small"})}),F.length>0&&_(ro,{onClickAway:E,onClick:E,open:d,target:P.current,position:l,children:_(Kn,{id:I,className:L.menuList,onKeyDown:H,"aria-labelledby":$,variant:"menu",autoFocusItem:!0,children:F.map((x,y)=>s.cloneElement(x,{key:y}))})})]}))},ka=e=>_(Ma,m({},e)),Fa=["field","align","width","contentWidth"],Ta=e=>{const{align:t,classes:n}=e,o={root:["cell","cellSkeleton",`cell--text${Pe(t)}`]};return ce(o,ge,n)};function $a(e){const{align:t,width:n,contentWidth:o}=e,r=Z(e,Fa),i={classes:J().classes,align:t},c=Ta(i);return _("div",m({className:c.root,style:{width:n}},r,{children:_(is,{width:`${o}%`})}))}const _a=ie("div",{name:"MuiDataGrid",slot:"Root",overridesResolver:(e,t)=>[{[`&.${L.autoHeight}`]:t.autoHeight},{[`&.${L.aggregationColumnHeader}`]:t.aggregationColumnHeader},{[`&.${L["aggregationColumnHeader--alignLeft"]}`]:t["aggregationColumnHeader--alignLeft"]},{[`&.${L["aggregationColumnHeader--alignCenter"]}`]:t["aggregationColumnHeader--alignCenter"]},{[`&.${L["aggregationColumnHeader--alignRight"]}`]:t["aggregationColumnHeader--alignRight"]},{[`&.${L.aggregationColumnHeaderLabel}`]:t.aggregationColumnHeaderLabel},{[`& .${L.editBooleanCell}`]:t.editBooleanCell},{[`& .${L["cell--editing"]}`]:t["cell--editing"]},{[`& .${L["cell--textCenter"]}`]:t["cell--textCenter"]},{[`& .${L["cell--textLeft"]}`]:t["cell--textLeft"]},{[`& .${L["cell--textRight"]}`]:t["cell--textRight"]},{[`& .${L["cell--withRenderer"]}`]:t["cell--withRenderer"]},{[`& .${L.cell}`]:t.cell},{[`& .${L.cellContent}`]:t.cellContent},{[`& .${L.cellCheckbox}`]:t.cellCheckbox},{[`& .${L.cellSkeleton}`]:t.cellSkeleton},{[`& .${L.checkboxInput}`]:t.checkboxInput},{[`& .${L["columnHeader--alignCenter"]}`]:t["columnHeader--alignCenter"]},{[`& .${L["columnHeader--alignLeft"]}`]:t["columnHeader--alignLeft"]},{[`& .${L["columnHeader--alignRight"]}`]:t["columnHeader--alignRight"]},{[`& .${L["columnHeader--dragging"]}`]:t["columnHeader--dragging"]},{[`& .${L["columnHeader--moving"]}`]:t["columnHeader--moving"]},{[`& .${L["columnHeader--numeric"]}`]:t["columnHeader--numeric"]},{[`& .${L["columnHeader--sortable"]}`]:t["columnHeader--sortable"]},{[`& .${L["columnHeader--sorted"]}`]:t["columnHeader--sorted"]},{[`& .${L.columnHeader}`]:t.columnHeader},{[`& .${L.columnHeaderCheckbox}`]:t.columnHeaderCheckbox},{[`& .${L.columnHeaderDraggableContainer}`]:t.columnHeaderDraggableContainer},{[`& .${L.columnHeaderTitleContainer}`]:t.columnHeaderTitleContainer},{[`& .${L["columnSeparator--resizable"]}`]:t["columnSeparator--resizable"]},{[`& .${L["columnSeparator--resizing"]}`]:t["columnSeparator--resizing"]},{[`& .${L.columnSeparator}`]:t.columnSeparator},{[`& .${L.filterIcon}`]:t.filterIcon},{[`& .${L.iconSeparator}`]:t.iconSeparator},{[`& .${L.menuIcon}`]:t.menuIcon},{[`& .${L.menuIconButton}`]:t.menuIconButton},{[`& .${L.menuOpen}`]:t.menuOpen},{[`& .${L.menuList}`]:t.menuList},{[`& .${L["row--editable"]}`]:t["row--editable"]},{[`& .${L["row--editing"]}`]:t["row--editing"]},{[`& .${L["row--dragging"]}`]:t["row--dragging"]},{[`& .${L.row}`]:t.row},{[`& .${L.rowReorderCellPlaceholder}`]:t.rowReorderCellPlaceholder},{[`& .${L.rowReorderCell}`]:t.rowReorderCell},{[`& .${L["rowReorderCell--draggable"]}`]:t["rowReorderCell--draggable"]},{[`& .${L.sortIcon}`]:t.sortIcon},{[`& .${L.withBorder}`]:t.withBorder},{[`& .${L.treeDataGroupingCell}`]:t.treeDataGroupingCell},{[`& .${L.treeDataGroupingCellToggle}`]:t.treeDataGroupingCellToggle},{[`& .${L.detailPanelToggleCell}`]:t.detailPanelToggleCell},{[`& .${L["detailPanelToggleCell--expanded"]}`]:t["detailPanelToggleCell--expanded"]},t.root]})(({theme:e})=>{const t=e.palette.mode==="light"?Wn(We(e.palette.divider,1),.88):jn(We(e.palette.divider,1),.68);return m({flex:1,boxSizing:"border-box",position:"relative",border:`1px solid ${t}`,borderRadius:e.shape.borderRadius,color:e.palette.text.primary},e.typography.body2,{outline:"none",height:"100%",display:"flex",flexDirection:"column",[`&.${L.autoHeight}`]:{height:"auto",[`& .${L["row--lastVisible"]} .${L.cell}`]:{borderBottomColor:"transparent"}},[`& .${L["virtualScrollerContent--overflowed"]} .${L["row--lastVisible"]} .${L.cell}`]:{borderBottomColor:"transparent"},[`& .${L.columnHeader}, & .${L.cell}`]:{WebkitTapHighlightColor:"transparent",lineHeight:null,padding:"0 10px",boxSizing:"border-box"},[`& .${L.columnHeader}:focus-within, & .${L.cell}:focus-within`]:{outline:`solid ${We(e.palette.primary.main,.5)} 1px`,outlineWidth:1,outlineOffset:-1},[`& .${L.columnHeader}:focus, & .${L.cell}:focus`]:{outline:`solid ${e.palette.primary.main} 1px`},[`& .${L.columnHeaderCheckbox}, & .${L.cellCheckbox}`]:{padding:0,justifyContent:"center",alignItems:"center"},[`& .${L.columnHeader}`]:{position:"relative",display:"flex",alignItems:"center"},[`& .${L["columnHeader--sorted"]} .${L.iconButtonContainer}, & .${L["columnHeader--filtered"]} .${L.iconButtonContainer}`]:{visibility:"visible",width:"auto"},[`& .${L.columnHeader}:not(.${L["columnHeader--sorted"]}) .${L.sortIcon}`]:{opacity:0,transition:e.transitions.create(["opacity"],{duration:e.transitions.duration.shorter})},[`& .${L.columnHeader}:not(.${L["columnHeader--sorted"]}):hover .${L.sortIcon}`]:{opacity:.5},[`& .${L.columnHeaderTitleContainer}`]:{display:"flex",alignItems:"center",minWidth:0,flex:1,whiteSpace:"nowrap",overflow:"hidden"},[`& .${L.columnHeaderTitleContainerContent}`]:{overflow:"hidden",display:"flex",alignItems:"center"},[`& .${L["columnHeader--filledGroup"]} .${L.columnHeaderTitleContainer}`]:{borderBottom:`solid ${t} 1px`,boxSizing:"border-box"},[`& .${L["columnHeader--filledGroup"]}.${L["columnHeader--showColumnBorder"]} .${L.columnHeaderTitleContainer}`]:{borderBottom:"none"},[`& .${L["columnHeader--filledGroup"]}.${L["columnHeader--showColumnBorder"]}`]:{borderBottom:`solid ${t} 1px`,boxSizing:"border-box"},[`& .${L.sortIcon}, & .${L.filterIcon}`]:{fontSize:"inherit"},[`& .${L["columnHeader--sortable"]}`]:{cursor:"pointer"},[`& .${L["columnHeader--alignCenter"]} .${L.columnHeaderTitleContainer}`]:{justifyContent:"center"},[`& .${L["columnHeader--alignRight"]} .${L.columnHeaderDraggableContainer}, & .${L["columnHeader--alignRight"]} .${L.columnHeaderTitleContainer}`]:{flexDirection:"row-reverse"},[`& .${L["columnHeader--alignCenter"]} .${L.menuIcon}, & .${L["columnHeader--alignRight"]} .${L.menuIcon}`]:{marginRight:"auto",marginLeft:-6},[`& .${L["columnHeader--alignRight"]} .${L.menuIcon}, & .${L["columnHeader--alignRight"]} .${L.menuIcon}`]:{marginRight:"auto",marginLeft:-10},[`& .${L["columnHeader--moving"]}`]:{backgroundColor:e.palette.action.hover},[`& .${L.columnSeparator}`]:{position:"absolute",zIndex:100,display:"flex",flexDirection:"column",justifyContent:"center",color:t},[`& .${L["columnSeparator--sideLeft"]}`]:{left:-12},[`& .${L["columnSeparator--sideRight"]}`]:{right:-12},[`& .${L["columnSeparator--resizable"]}`]:{cursor:"col-resize",touchAction:"none","&:hover":{color:e.palette.text.primary,"@media (hover: none)":{color:t}},[`&.${L["columnSeparator--resizing"]}`]:{color:e.palette.text.primary},"& svg":{pointerEvents:"none"}},[`& .${L.iconSeparator}`]:{color:"inherit"},[`& .${L.menuIcon}`]:{width:0,visibility:"hidden",fontSize:20,marginRight:-10,display:"flex",alignItems:"center"},[`& .${L.columnHeader}:hover`]:{[`& .${L.iconButtonContainer}`]:{visibility:"visible",width:"auto"},[`& .${L.menuIcon}`]:{width:"auto",visibility:"visible"}},[`.${L.menuOpen}`]:{visibility:"visible",width:"auto"},[`& .${L.row}`]:{display:"flex",width:"fit-content",breakInside:"avoid","&:hover, &.Mui-hovered":{backgroundColor:e.palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},"&.Mui-selected":{backgroundColor:We(e.palette.primary.main,e.palette.action.selectedOpacity),"&:hover, &.Mui-hovered":{backgroundColor:We(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:We(e.palette.primary.main,e.palette.action.selectedOpacity)}}}},[`& .${L.cell}`]:{display:"flex",alignItems:"center",borderBottom:`1px solid ${t}`},[`& .${L.row}:not(.${L["row--dynamicHeight"]}) > .${L.cell}`]:{overflow:"hidden",whiteSpace:"nowrap"},[`& .${L.cellContent}`]:{overflow:"hidden",textOverflow:"ellipsis"},[`& .${L.cell}.${L["cell--editing"]}`]:{padding:1,display:"flex",boxShadow:e.shadows[2],backgroundColor:e.palette.background.paper,"&:focus-within":{outline:`solid ${e.palette.primary.main} 1px`,outlineOffset:"-1px"}},[`& .${L["row--editing"]}`]:{boxShadow:e.shadows[2]},[`& .${L["row--editing"]} .${L.cell}`]:{boxShadow:e.shadows[0],backgroundColor:e.palette.background.paper},[`& .${L.editBooleanCell}`]:{display:"flex",height:"100%",width:"100%",alignItems:"center",justifyContent:"center"},[`& .${L.booleanCell}[data-value="true"]`]:{color:e.palette.text.secondary},[`& .${L.booleanCell}[data-value="false"]`]:{color:e.palette.text.disabled},[`& .${L.actionsCell}`]:{display:"inline-flex",alignItems:"center",gridGap:e.spacing(1)},[`& .${L.rowReorderCell}`]:{display:"inline-flex",flex:1,alignItems:"center",justifyContent:"center",opacity:e.palette.action.disabledOpacity},[`& .${L["rowReorderCell--draggable"]}`]:{cursor:"move",opacity:1},[`& .${L.rowReorderCellContainer}`]:{padding:0,alignItems:"stretch"},[`& .${L.withBorder}`]:{borderRight:`1px solid ${t}`},[`& .${L["cell--textLeft"]}`]:{justifyContent:"flex-start"},[`& .${L["cell--textRight"]}`]:{justifyContent:"flex-end"},[`& .${L["cell--textCenter"]}`]:{justifyContent:"center"},[`& .${L.columnHeaderDraggableContainer}`]:{display:"flex",width:"100%",height:"100%"},[`& .${L.rowReorderCellPlaceholder}`]:{display:"none"},[`& .${L["columnHeader--dragging"]}, & .${L["row--dragging"]}`]:{background:e.palette.background.paper,padding:"0 12px",borderRadius:e.shape.borderRadius,opacity:e.palette.action.disabledOpacity},[`& .${L["row--dragging"]}`]:{background:e.palette.background.paper,padding:"0 12px",borderRadius:e.shape.borderRadius,opacity:e.palette.action.disabledOpacity,[`& .${L.rowReorderCellPlaceholder}`]:{display:"flex"}},[`& .${L.treeDataGroupingCell}`]:{display:"flex",alignItems:"center",width:"100%"},[`& .${L.treeDataGroupingCellToggle}`]:{flex:"0 0 28px",alignSelf:"stretch",marginRight:e.spacing(2)},[`& .${L.groupingCriteriaCell}`]:{display:"flex",alignItems:"center",width:"100%"},[`& .${L.groupingCriteriaCellToggle}`]:{flex:"0 0 28px",alignSelf:"stretch",marginRight:e.spacing(2)}})}),Da=["children","className"],Ra=e=>{const{autoHeight:t,density:n,classes:o}=e,r={root:["root",t&&"autoHeight",`root--density${Pe(n)}`]};return ce(r,ge,o)},Oa=s.forwardRef(function(t,n){const o=J(),{children:r,className:l}=t,i=Z(t,Da),c=se(),a=ee(c,Oe),g=ee(c,Sn),d=ee(c,Fi),u=ee(c,to),f=s.useRef(null),C=rt(f,n),P=ee(c,vi),b=m({},o,{density:d}),p=Ra(b);c.current.rootElementRef=f;const[I,$]=s.useState(!1);return Ue(()=>{$(!0)},[]),Ue(()=>{I&&c.current.unstable_updateGridDimensionsRef()},[c,I]),I?_(_a,m({ref:C,className:pe(l,p.root),ownerState:b,role:"grid","aria-colcount":a.length,"aria-rowcount":u+1+P+g,"aria-multiselectable":!o.disableMultipleSelection,"aria-label":o["aria-label"],"aria-labelledby":o["aria-labelledby"]},i,{children:r})):null}),Ha=["className"],La=e=>{const{classes:t}=e;return ce({root:["footerContainer"]},ge,t)},Va=ie("div",{name:"MuiDataGrid",slot:"FooterContainer",overridesResolver:(e,t)=>t.footerContainer})(({theme:e})=>({display:"flex",justifyContent:"space-between",alignItems:"center",minHeight:52,borderTop:`1px solid ${e.palette.mode==="light"?Wn(We(e.palette.divider,1),.88):jn(We(e.palette.divider,1),.68)}`})),Ga=s.forwardRef(function(t,n){const{className:o}=t,r=Z(t,Ha),l=J(),i=La(l);return _(Va,m({ref:n,className:pe(i.root,o),ownerState:l},r))}),Aa=["className"],Ba=e=>{const{classes:t}=e;return ce({root:["overlay"]},ge,t)},za=ie("div",{name:"MuiDataGrid",slot:"Overlay",overridesResolver:(e,t)=>t.overlay})(({theme:e})=>({position:"absolute",top:0,zIndex:4,width:"100%",height:"100%",pointerEvents:"none",display:"flex",alignSelf:"center",alignItems:"center",justifyContent:"center",backgroundColor:We(e.palette.background.default,e.palette.action.disabledOpacity)})),xn=s.forwardRef(function(t,n){const{className:o}=t,r=Z(t,Aa),l=J(),i=Ba(l);return _(za,m({ref:n,className:pe(i.root,o),ownerState:l},r))}),Na=["className"],Ua=e=>{const{classes:t}=e;return ce({root:["iconButtonContainer"]},ge,t)},Ka=ie("div",{name:"MuiDataGrid",slot:"IconButtonContainer",overridesResolver:(e,t)=>t.iconButtonContainer})(()=>({display:"flex",visibility:"hidden",width:0})),Dr=s.forwardRef(function(t,n){const{className:o}=t,r=Z(t,Na),l=J(),i=Ua(l);return _(Ka,m({ref:n,className:pe(i.root,o),ownerState:l},r))}),Wa=e=>{const{classes:t}=e;return ce({icon:["sortIcon"]},ge,t)};function ja(e,t,n,o){let r;const l={};return t==="asc"?r=e.ColumnSortedAscendingIcon:t==="desc"?r=e.ColumnSortedDescendingIcon:(r=e.ColumnUnsortedIcon,l.sortingOrder=o),r?_(r,m({fontSize:"small",className:n},l)):null}function qa(e){const{direction:t,index:n,sortingOrder:o}=e,r=se(),l=J(),i=m({},e,{classes:l.classes}),c=Wa(i),a=ja(l.components,t,c.icon,o);if(!a)return null;const g=_(ot,{tabIndex:-1,"aria-label":r.current.getLocaleText("columnHeaderSortIconLabel"),title:r.current.getLocaleText("columnHeaderSortIconLabel"),size:"small",children:a});return we(Dr,{children:[n!=null&&_(mr,{badgeContent:n,color:"default",children:g}),n==null&&g]})}const Ya=s.memo(qa),Qa=e=>{const{classes:t,open:n}=e;return ce({root:["menuIcon",n&&"menuOpen"],button:["menuIconButton"]},ge,t)},Xa=s.memo(e=>{const{column:t,open:n,columnMenuId:o,columnMenuButtonId:r,iconButtonRef:l}=e,i=se(),c=J(),a=m({},e,{classes:c.classes}),g=Qa(a),d=s.useCallback(u=>{u.preventDefault(),u.stopPropagation(),i.current.toggleColumnMenu(t.field)},[i,t.field]);return _("div",{className:g.root,children:_(ot,{ref:l,tabIndex:-1,className:g.button,"aria-label":i.current.getLocaleText("columnMenuLabel"),title:i.current.getLocaleText("columnMenuLabel"),size:"small",onClick:d,"aria-expanded":n?"true":void 0,"aria-haspopup":"true","aria-controls":o,id:r,children:_(c.components.ColumnMenuIcon,{fontSize:"small"})})})});function Za({columnMenuId:e,columnMenuButtonId:t,ContentComponent:n,contentComponentProps:o,field:r,open:l,target:i,onExited:c}){const a=se(),g=a.current.getColumn(r),d=s.useCallback(u=>{u.stopPropagation(),a.current.hideColumnMenu()},[a]);return i?_(ro,{placement:`bottom-${g.align==="right"?"start":"end"}`,open:l,target:i,onClickAway:d,onExited:c,children:_(n,m({currentColumn:g,hideMenu:d,open:l,id:e,labelledby:t},o))}):null}function Ja(e){return e.scrollHeight>e.clientHeight||e.scrollWidth>e.clientWidth}function ec(e,t){return e.closest(`.${t}`)}function lo(e){return e.replace(/["\\]/g,"\\$&")}function tc(e,t){return e.querySelector(`[role="columnheader"][data-field="${lo(t)}"]`)}function Rr(e){return`.${L.row}[data-id="${lo(String(e))}"]`}function nc(e,t){return e.querySelector(Rr(t))}function oc(e,{id:t,field:n}){const o=Rr(t),r=`.${L.cell}[data-field="${lo(n)}"]`,l=`${o} ${r}`;return e.querySelector(l)}const rc=["className"],lc=e=>{const{classes:t}=e;return ce({root:["columnHeaderTitle"]},ge,t)},sc=ie("div",{name:"MuiDataGrid",slot:"ColumnHeaderTitle",overridesResolver:(e,t)=>t.columnHeaderTitle})(({theme:e})=>({textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap",fontWeight:e.typography.fontWeightMedium})),ic=s.forwardRef(function(t,n){const{className:o}=t,r=Z(t,rc),l=J(),i=lc(l);return _(sc,m({ref:n,className:pe(i.root,o),ownerState:l},r))});function ac(e){var t;const{label:n,description:o,columnWidth:r}=e,l=J(),i=s.useRef(null),[c,a]=s.useState("");return s.useEffect(()=>{if(!o&&i&&i.current){const g=Ja(i.current);a(g?n:"")}},[i,r,o,n]),_(l.components.BaseTooltip,m({title:o||c},(t=l.componentsProps)==null?void 0:t.baseTooltip,{children:_(ic,{ref:i,children:n})}))}const cc=["resizable","resizing","height","side"];var Hn;(function(e){e.Left="left",e.Right="right"})(Hn||(Hn={}));const uc=e=>{const{resizable:t,resizing:n,classes:o,side:r}=e,l={root:["columnSeparator",t&&"columnSeparator--resizable",n&&"columnSeparator--resizing",r&&`columnSeparator--side${Pe(r)}`],icon:["iconSeparator"]};return ce(l,ge,o)};function dc(e){const{height:t,side:n=Hn.Right}=e,o=Z(e,cc),r=J(),l=m({},e,{side:n,classes:r.classes}),i=uc(l),c=s.useCallback(a=>{a.preventDefault(),a.stopPropagation()},[]);return _("div",m({className:i.root,style:{minHeight:t,opacity:r.showColumnRightBorder?0:1}},o,{onClick:c,children:_(r.components.ColumnResizeIcon,{className:i.icon})}))}const gc=s.memo(dc),mc=["classes","columnMenuOpen","colIndex","height","isResizing","sortDirection","hasFocus","tabIndex","separatorSide","isDraggable","headerComponent","description","elementId","width","columnMenuIconButton","columnMenu","columnTitleIconButtons","headerClassName","label","resizable","draggableContainerProps","columnHeaderSeparatorProps","disableHeaderSeparator"],Or=s.forwardRef(function(t,n){const{classes:o,columnMenuOpen:r,colIndex:l,height:i,isResizing:c,sortDirection:a,hasFocus:g,tabIndex:d,separatorSide:u,isDraggable:f,headerComponent:C,description:P,width:b,columnMenuIconButton:p=null,columnMenu:I=null,columnTitleIconButtons:$=null,headerClassName:v,label:h,resizable:k,draggableContainerProps:F,columnHeaderSeparatorProps:S,disableHeaderSeparator:w}=t,E=Z(t,mc),T=se(),M=J(),A=s.useRef(null),[H,x]=s.useState(r),y=rt(A,n);let O="none";return a!=null&&(O=a==="asc"?"ascending":"descending"),s.useEffect(()=>{H||x(r)},[H,r]),s.useLayoutEffect(()=>{const V=T.current.state.columnMenu;if(g&&!V.open){const D=A.current.querySelector('[tabindex="0"]')||A.current;D==null||D.focus(),T.current.columnHeadersContainerElementRef.current.scrollLeft=0}},[T,g]),we("div",m({ref:y,className:pe(o.root,v),style:{height:i,width:b,minWidth:b,maxWidth:b},role:"columnheader",tabIndex:d,"aria-colindex":l+1,"aria-sort":O,"aria-label":C==null?h:void 0},E,{children:[we("div",m({className:o.draggableContainer,draggable:f},F,{children:[we("div",{className:o.titleContainer,children:[_("div",{className:o.titleContainerContent,children:C!==void 0?C:_(ac,{label:h,description:P,columnWidth:b})}),$]}),p]})),!w&&_(gc,m({resizable:!M.disableColumnResize&&!!k,resizing:c,height:i,side:u},S)),I]}))}),fc=e=>{const{column:t,classes:n,isDragging:o,sortDirection:r,showRightBorder:l,filterItemsCounter:i}=e,c=r!=null,a=i!=null&&i>0,g=t.type==="number",d={root:["columnHeader",t.headerAlign==="left"&&"columnHeader--alignLeft",t.headerAlign==="center"&&"columnHeader--alignCenter",t.headerAlign==="right"&&"columnHeader--alignRight",t.sortable&&"columnHeader--sortable",o&&"columnHeader--moving",c&&"columnHeader--sorted",a&&"columnHeader--filtered",g&&"columnHeader--numeric",l&&"withBorder"],draggableContainer:["columnHeaderDraggableContainer"],titleContainer:["columnHeaderTitleContainer"],titleContainerContent:["columnHeaderTitleContainerContent"]};return ce(d,ge,n)};function hc(e){var t,n,o,r,l;const{column:i,columnMenuOpen:c,colIndex:a,headerHeight:g,isResizing:d,isLastColumn:u,sortDirection:f,sortIndex:C,filterItemsCounter:P,hasFocus:b,tabIndex:p,extendRowFullWidth:I,disableReorder:$,separatorSide:v}=e,h=se(),k=J(),F=s.useRef(null),S=Te(),w=Te(),E=s.useRef(null),[T,M]=s.useState(c),{hasScrollX:A,hasScrollY:H}=(t=h.current.getRootDimensions())!=null?t:{hasScrollX:!1,hasScrollY:!1},x=s.useMemo(()=>!k.disableColumnReorder&&!$&&!i.disableReorder,[k.disableColumnReorder,$,i.disableReorder]);let y;i.renderHeader&&(y=i.renderHeader(h.current.getColumnHeaderParams(i.field)));const V=u?!(u&&A&&!H)&&!I:k.showColumnRightBorder,R=m({},e,{classes:k.classes,showRightBorder:V}),D=fc(R),G=s.useCallback(ae=>de=>{de.currentTarget.contains(de.target)&&h.current.publishEvent(ae,h.current.getColumnHeaderParams(i.field),de)},[h,i.field]),z=s.useMemo(()=>({onClick:G("columnHeaderClick"),onDoubleClick:G("columnHeaderDoubleClick"),onMouseOver:G("columnHeaderOver"),onMouseOut:G("columnHeaderOut"),onMouseEnter:G("columnHeaderEnter"),onMouseLeave:G("columnHeaderLeave"),onKeyDown:G("columnHeaderKeyDown"),onFocus:G("columnHeaderFocus"),onBlur:G("columnHeaderBlur")}),[G]),N=s.useMemo(()=>x?{onDragStart:G("columnHeaderDragStart"),onDragEnter:G("columnHeaderDragEnter"),onDragOver:G("columnHeaderDragOver"),onDragEnd:G("columnHeaderDragEnd")}:{},[x,G]),K=s.useMemo(()=>({onMouseDown:G("columnSeparatorMouseDown")}),[G]);s.useEffect(()=>{T||M(c)},[T,c]);const W=s.useCallback(()=>{M(!1)},[]),te=!k.disableColumnMenu&&!i.disableColumnMenu&&_(Xa,{column:i,columnMenuId:S,columnMenuButtonId:w,open:T,iconButtonRef:E}),q=_(Za,{columnMenuId:S,columnMenuButtonId:w,field:i.field,open:c,target:E.current,ContentComponent:k.components.ColumnMenu,contentComponentProps:(n=k.componentsProps)==null?void 0:n.columnMenu,onExited:W}),oe=(o=i.sortingOrder)!=null?o:k.sortingOrder,U=we(s.Fragment,{children:[!k.disableColumnFilter&&_(k.components.ColumnHeaderFilterIconButton,m({field:i.field,counter:P},(r=k.componentsProps)==null?void 0:r.columnHeaderFilterIconButton)),i.sortable&&!i.hideSortIcons&&_(Ya,{direction:f,index:C,sortingOrder:oe})]});s.useLayoutEffect(()=>{const ae=h.current.state.columnMenu;if(b&&!ae.open){const be=F.current.querySelector('[tabindex="0"]')||F.current;be==null||be.focus(),h.current.columnHeadersContainerElementRef.current.scrollLeft=0}},[h,b]);const Y=typeof i.headerClassName=="function"?i.headerClassName({field:i.field,colDef:i}):i.headerClassName,X=(l=i.headerName)!=null?l:i.field;return _(Or,m({ref:F,classes:D,columnMenuOpen:c,colIndex:a,height:g,isResizing:d,sortDirection:f,hasFocus:b,tabIndex:p,separatorSide:v,isDraggable:x,headerComponent:y,description:i.description,elementId:i.field,width:i.computedWidth,columnMenuIconButton:te,columnTitleIconButtons:U,headerClassName:Y,label:X,resizable:!k.disableColumnResize&&!!i.resizable,"data-field":i.field,columnMenu:q,draggableContainerProps:N,columnHeaderSeparatorProps:K},z))}const Cn=e=>e.preferencePanel;var vt;(function(e){e.filters="filters",e.columns="columns"})(vt||(vt={}));const pc=e=>{const{classes:t}=e;return ce({icon:["filterIcon"]},ge,t)};function Cc(e){var t;const{counter:n,field:o,onClick:r}=e,l=se(),i=J(),c=m({},e,{classes:i.classes}),a=pc(c),g=s.useCallback(u=>{u.preventDefault(),u.stopPropagation();const{open:f,openedPanelValue:C}=Cn(l.current.state);f&&C===vt.filters?l.current.hideFilterPanel():l.current.showFilterPanel(),r&&r(l.current.getColumnHeaderParams(o),u)},[l,o,r]);if(!n)return null;const d=_(ot,{onClick:g,color:"default","aria-label":l.current.getLocaleText("columnHeaderFiltersLabel"),size:"small",tabIndex:-1,children:_(i.components.ColumnFilteredIcon,{className:a.icon,fontSize:"small"})});return _(i.components.BaseTooltip,m({title:l.current.getLocaleText("columnHeaderFiltersTooltipActive")(n),enterDelay:1e3},(t=i.componentsProps)==null?void 0:t.baseTooltip,{children:we(Dr,{children:[n>1&&_(mr,{badgeContent:n,color:"default",children:d}),n===1&&d]})}))}const bc=["field","id","value","formattedValue","row","rowNode","colDef","isEditable","cellMode","hasFocus","tabIndex","getValue","api"],wc=e=>{const{classes:t}=e;return ce({root:["checkboxInput"]},ge,t)},vc=s.forwardRef(function(t,n){var o;const{field:r,id:l,value:i,rowNode:c,hasFocus:a,tabIndex:g}=t,d=Z(t,bc),u=se(),f=J(),C={classes:f.classes},P=wc(C),b=s.useRef(null),p=s.useRef(),I=rt(b,n),$=u.current.getCellElement(l,r),v=S=>{const w={value:S.target.checked,id:l};u.current.publishEvent("rowSelectionCheckboxChange",w,S)};s.useLayoutEffect(()=>{g===0&&$&&($.tabIndex=-1)},[$,g]),s.useEffect(()=>{if(a){var S;const w=(S=b.current)==null?void 0:S.querySelector("input");w==null||w.focus({preventScroll:!0})}else p.current&&p.current.stop({})},[a]);const h=s.useCallback(S=>{$r(S.key)&&S.stopPropagation(),ln(S.key)&&!S.shiftKey&&u.current.publishEvent("cellNavigationKeyDown",t,S)},[u,t]);if(c.position==="footer")return null;const k=u.current.isRowSelectable(l),F=u.current.getLocaleText(i?"checkboxSelectionUnselectRow":"checkboxSelectionSelectRow");return c.isPinned?null:_(f.components.BaseCheckbox,m({ref:I,tabIndex:g,checked:i,onChange:v,className:P.root,inputProps:{"aria-label":F},onKeyDown:h,disabled:!k,touchRippleRef:p},(o=f.componentsProps)==null?void 0:o.baseCheckbox,d))}),Sc=vc,Ke=e=>e.selection,Pc=ne(Ke,e=>e.length),yc=ne(Ke,Ht,(e,t)=>new Map(e.map(n=>[n,t[n]]))),bn=ne(Ke,e=>e.reduce((t,n)=>(t[n]=n,t),{})),Ut=e=>e.pagination,jt=ne(Ut,e=>e.page),Qt=ne(Ut,e=>e.pageSize),Mf=ne(Ut,e=>e.pageCount),so=ne(Ut,bt,Qn,gt,vr,(e,t,n,o,r)=>{const l=r.length,i=Math.min(e.pageSize*e.page,l-1),c=Math.min(i+e.pageSize-1,l-1);if(i===-1||c===-1)return null;if(n<2)return{firstRowIndex:i,lastRowIndex:c};const a=r[i],g=c-i+1,d=o.findIndex(C=>C.id===a.id);let u=d,f=0;for(;u<o.length&&f<=g;){const C=o[u],P=t[C.id].depth;(f<g||P>0)&&(u+=1),P===0&&(f+=1)}return{firstRowIndex:d,lastRowIndex:u-1}}),xc=ne(gt,so,(e,t)=>t?e.slice(t.firstRowIndex,t.lastRowIndex+1):[]),Hr=ne(Yt,so,(e,t)=>t?e.slice(t.firstRowIndex,t.lastRowIndex+1):[]),Ic=["field","colDef"],Ec=e=>{const{classes:t}=e;return ce({root:["checkboxInput"]},ge,t)},Mc=s.forwardRef(function(t,n){var o;const r=Z(t,Ic),[,l]=s.useState(!1),i=se(),c=J(),a={classes:c.classes},g=Ec(a),d=ee(i,Mr),u=ee(i,Ke),f=ee(i,Yt),C=ee(i,Hr),P=s.useMemo(()=>typeof c.isRowSelectable!="function"?u:u.filter(w=>i.current.getRow(w)?c.isRowSelectable(i.current.getRowParams(w)):!1),[i,c.isRowSelectable,u]),b=s.useMemo(()=>(!c.pagination||!c.checkboxSelectionVisibleOnly?f:C).reduce((E,T)=>(E[T]=!0,E),{}),[c.pagination,c.checkboxSelectionVisibleOnly,C,f]),p=s.useMemo(()=>P.filter(w=>b[w]).length,[P,b]),I=p>0&&p<Object.keys(b).length,$=p>0,v=w=>{const E={value:w.target.checked};i.current.publishEvent("headerSelectionCheckboxChange",E)},h=d!==null&&d.field===t.field?0:-1;s.useLayoutEffect(()=>{const w=i.current.getColumnHeaderElement(t.field);h===0&&w&&(w.tabIndex=-1)},[h,i,t.field]);const k=s.useCallback(w=>{w.key===" "&&i.current.publishEvent("headerSelectionCheckboxChange",{value:!$}),ln(w.key)&&!w.shiftKey&&i.current.publishEvent("columnHeaderNavigationKeyDown",t,w)},[i,t,$]),F=s.useCallback(()=>{l(w=>!w)},[]);s.useEffect(()=>i.current.subscribeEvent("selectionChange",F),[i,F]);const S=i.current.getLocaleText($?"checkboxSelectionUnselectAllRows":"checkboxSelectionSelectAllRows");return _(c.components.BaseCheckbox,m({ref:n,indeterminate:I,checked:$,onChange:v,className:g.root,inputProps:{"aria-label":S},tabIndex:h,onKeyDown:k},(o=c.componentsProps)==null?void 0:o.baseCheckbox,r))}),kc=e=>{const{onClick:t}=e,n=se(),o=J(),r=s.useCallback(l=>{t(l),n.current.showPreferences(vt.columns)},[n,t]);return o.disableColumnSelector?null:_(Ae,{onClick:r,children:n.current.getLocaleText("columnMenuShowColumns")})},Fc=e=>{const{column:t,onClick:n}=e,o=se(),r=J(),l=s.useCallback(i=>{n(i),o.current.showFilterPanel(t==null?void 0:t.field)},[o,t==null?void 0:t.field,n]);return r.disableColumnFilter||!(t!=null&&t.filterable)?null:_(Ae,{onClick:l,children:o.current.getLocaleText("columnMenuFilter")})},Tc=["hideMenu","currentColumn","open","id","labelledby","className","children"],$c=s.forwardRef(function(t,n){const{hideMenu:o,open:r,id:l,labelledby:i,className:c,children:a}=t,g=Z(t,Tc),d=s.useCallback(u=>{oo(u.key)&&u.preventDefault(),_r(u.key)&&o(u)},[o]);return _(Kn,m({id:l,ref:n,className:pe(L.menuList,c),"aria-labelledby":i,onKeyDown:d,autoFocus:r},g,{children:a}))}),_c=Je(["MUI: The `sortModel` can only contain a single item when the `disableMultipleColumnsSorting` prop is set to `true`.","If you are using the community version of the `DataGrid`, this prop is always `true`."],"error"),Lr=(e,t)=>t&&e.length>1?(_c(),[e[0]]):e,Ho=(e,t)=>n=>m({},n,{sorting:m({},n.sorting,{sortModel:Lr(e,t)})}),Dc=e=>e==="desc",Rc=(e,t)=>{const n=t.current.getColumn(e.field);if(!n)return null;const o=Dc(e.sort)?(...l)=>-1*n.sortComparator(...l):n.sortComparator;return{getSortCellParams:l=>({id:l,field:n.field,rowNode:t.current.getRowNode(l),value:t.current.getCellValue(l,n.field),api:t.current}),comparator:o}},Oc=(e,t,n)=>e.reduce((o,r,l)=>{if(o!==0)return o;const i=t.params[l],c=n.params[l];return o=r.comparator(i.value,c.value,i,c),o},0),Hc=(e,t)=>{const n=e.map(o=>Rc(o,t)).filter(o=>!!o);return n.length===0?null:o=>o.map(r=>({node:r,params:n.map(l=>l.getSortCellParams(r.id))})).sort((r,l)=>Oc(n,r,l)).map(r=>r.node.id)},Lo=(e,t)=>{const n=e.indexOf(t);return!t||n===-1||n+1===e.length?e[0]:e[n+1]},io=(e,t)=>e==null&&t!=null?-1:t==null&&e!=null?1:e==null&&t==null?0:null,Lc=new Intl.Collator,Vc=(e,t)=>{const n=io(e,t);return n!==null?n:typeof e=="string"?Lc.compare(e.toString(),t.toString()):e-t},Vr=(e,t)=>{const n=io(e,t);return n!==null?n:Number(e)-Number(t)},Gr=(e,t)=>{const n=io(e,t);return n!==null?n:e>t?1:e<t?-1:0};function Gc(e){return typeof e=="number"}function Ar(e){return typeof e=="function"}function Ac(){try{const e="__some_random_key_you_are_not_going_to_use__";return window.localStorage.setItem(e,e),window.localStorage.removeItem(e),!0}catch{return!1}}function dn(e){return e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}const At=(e,t,n)=>Math.max(t,Math.min(n,e));function dt(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;if(Array.isArray(e)){const r=e.length;if(r!==t.length)return!1;for(let l=0;l<r;l+=1)if(!dt(e[l],t[l]))return!1;return!0}if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;const r=Array.from(e.entries());for(let l=0;l<r.length;l+=1)if(!t.has(r[l][0]))return!1;for(let l=0;l<r.length;l+=1){const i=r[l];if(!dt(i[1],t.get(i[0])))return!1}return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;const r=Array.from(e.entries());for(let l=0;l<r.length;l+=1)if(!t.has(r[l][0]))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){const r=e.length;if(r!==t.length)return!1;for(let l=0;l<r;l+=1)if(e[l]!==t[l])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();const n=Object.keys(e),o=n.length;if(o!==Object.keys(t).length)return!1;for(let r=0;r<o;r+=1)if(!Object.prototype.hasOwnProperty.call(t,n[r]))return!1;for(let r=0;r<o;r+=1){const l=n[r];if(!dt(e[l],t[l]))return!1}return!0}return e!==e&&t!==t}function Bc(e){return()=>{let t=e+=1831565813;return t=Math.imul(t^t>>>15,t|1),t^=t+Math.imul(t^t>>>7,t|61),((t^t>>>14)>>>0)/4294967296}}function zc(e,t,n){const o=Bc(e);return()=>t+(n-t)*o()}function Br(e){return typeof structuredClone=="function"?structuredClone(e):JSON.parse(JSON.stringify(e))}const Nc=["item","applyValue","type","apiRef","focusElementRef","color","error","helperText","size","variant"];function zr(e){const{item:t,applyValue:n,type:o,apiRef:r,focusElementRef:l,color:i,error:c,helperText:a,size:g,variant:d}=e,u=Z(e,Nc),f={color:i,error:c,helperText:a,size:g,variant:d},[C,P]=s.useState(t.value||[]),b=Te(),p=J();s.useEffect(()=>{var $;const v=($=t.value)!=null?$:[];P(v.map(String))},[t.value]);const I=s.useCallback(($,v)=>{P(v.map(String)),n(m({},t,{value:[...v]}))},[n,t]);return _(ir,m({multiple:!0,freeSolo:!0,options:[],filterOptions:($,v)=>{const{inputValue:h}=v;return h==null||h===""?[]:[h]},id:b,value:C,onChange:I,renderTags:($,v)=>$.map((h,k)=>_(ar,m({variant:"outlined",size:"small",label:h},v({index:k})))),renderInput:$=>{var v;return _(p.components.BaseTextField,m({},$,{label:r.current.getLocaleText("filterPanelInputLabel"),placeholder:r.current.getLocaleText("filterPanelInputPlaceholder"),InputLabelProps:m({},$.InputLabelProps,{shrink:!0}),inputRef:l,type:o||"text"},f,(v=p.componentsProps)==null?void 0:v.baseTextField))}},u))}const Uc=e=>{if(!e)return null;const t=new RegExp(dn(e),"i");return({value:n})=>n!=null?t.test(n.toString()):!1},Kc=(e=!1)=>[{value:"contains",getApplyFilterFn:t=>{if(!t.value)return null;const n=e?t.value:t.value.trim(),o=new RegExp(dn(n),"i");return({value:r})=>r!=null?o.test(r.toString()):!1},InputComponent:nt},{value:"equals",getApplyFilterFn:t=>{if(!t.value)return null;const n=e?t.value:t.value.trim(),o=new Intl.Collator(void 0,{sensitivity:"base",usage:"search"});return({value:r})=>r!=null?o.compare(n,r.toString())===0:!1},InputComponent:nt},{value:"startsWith",getApplyFilterFn:t=>{if(!t.value)return null;const n=e?t.value:t.value.trim(),o=new RegExp(`^${dn(n)}.*$`,"i");return({value:r})=>r!=null?o.test(r.toString()):!1},InputComponent:nt},{value:"endsWith",getApplyFilterFn:t=>{if(!t.value)return null;const n=e?t.value:t.value.trim(),o=new RegExp(`.*${dn(n)}$`,"i");return({value:r})=>r!=null?o.test(r.toString()):!1},InputComponent:nt},{value:"isEmpty",getApplyFilterFn:()=>({value:t})=>t===""||t==null,requiresFilterValue:!1},{value:"isNotEmpty",getApplyFilterFn:()=>({value:t})=>t!==""&&t!=null,requiresFilterValue:!1},{value:"isAnyOf",getApplyFilterFn:t=>{if(!Array.isArray(t.value)||t.value.length===0)return null;const n=e?t.value:t.value.map(r=>r.trim()),o=new Intl.Collator(void 0,{sensitivity:"base",usage:"search"});return({value:r})=>r!=null?n.some(l=>o.compare(l,r.toString()||"")===0):!1},InputComponent:zr}],St={width:100,minWidth:50,maxWidth:1/0,hide:!1,hideable:!0,sortable:!0,resizable:!0,filterable:!0,groupable:!0,pinnable:!0,aggregable:!0,editable:!1,sortComparator:Vc,type:"string",align:"left",filterOperators:Kc(),renderEditCell:aa,getApplyQuickFilterFn:Uc},ao="actions",Wc=m({},St,{sortable:!1,filterable:!1,aggregable:!1,width:100,align:"center",headerAlign:"center",headerName:"",disableColumnMenu:!0,disableExport:!0,renderCell:ka,getApplyQuickFilterFn:void 0}),jc=["item","applyValue","apiRef","focusElementRef"];function qc(e){var t,n,o,r;const{item:l,applyValue:i,apiRef:c,focusElementRef:a}=e,g=Z(e,jc),[d,u]=s.useState(l.value||""),f=J(),P=(n=(((t=f.componentsProps)==null?void 0:t.baseSelect)||{}).native)!=null?n:!0,b=P?"option":Ae,p=s.useCallback(I=>{const $=I.target.value;u($),i(m({},l,{value:$}))},[i,l]);return s.useEffect(()=>{u(l.value||"")},[l.value]),we(f.components.BaseTextField,m({label:c.current.getLocaleText("filterPanelInputLabel"),value:d,onChange:p,select:!0,variant:"standard",SelectProps:m({native:P,displayEmpty:!0},(o=f.componentsProps)==null?void 0:o.baseSelect),InputLabelProps:{shrink:!0},inputRef:a},g,(r=f.componentsProps)==null?void 0:r.baseTextField,{children:[_(b,{value:"",children:c.current.getLocaleText("filterValueAny")}),_(b,{value:"true",children:c.current.getLocaleText("filterValueTrue")}),_(b,{value:"false",children:c.current.getLocaleText("filterValueFalse")})]}))}const Yc=()=>[{value:"is",getApplyFilterFn:e=>{if(!e.value)return null;const t=e.value==="true";return({value:n})=>!!n===t},InputComponent:qc}];function Qc({value:e,api:t}){return e?t.getLocaleText("booleanCellTrueLabel"):t.getLocaleText("booleanCellFalseLabel")}const Nr=m({},St,{type:"boolean",align:"center",headerAlign:"center",renderCell:ji,renderEditCell:Xi,sortComparator:Vr,valueFormatter:Qc,filterOperators:Yc(),getApplyQuickFilterFn:void 0,aggregable:!1}),ft="__check__",sn=m({},Nr,{field:ft,type:"checkboxSelection",width:50,resizable:!1,sortable:!1,filterable:!1,aggregable:!1,disableColumnMenu:!0,disableReorder:!0,disableExport:!0,getApplyQuickFilterFn:void 0,valueGetter:e=>bn(e.api.state,e.api.instanceId)[e.id]!==void 0,renderHeader:e=>_(Mc,m({},e)),renderCell:e=>_(Sc,m({},e))}),Xc=["item","applyValue","type","apiRef","focusElementRef","InputProps"],Zc=500;function _t(e){var t,n;const{item:o,applyValue:r,type:l,apiRef:i,focusElementRef:c,InputProps:a}=e,g=Z(e,Xc),d=s.useRef(),[u,f]=s.useState((t=o.value)!=null?t:""),[C,P]=s.useState(!1),b=Te(),p=J(),I=s.useCallback($=>{const v=$.target.value;clearTimeout(d.current),f(String(v)),P(!0),d.current=setTimeout(()=>{r(m({},o,{value:v})),P(!1)},Zc)},[r,o]);return s.useEffect(()=>()=>{clearTimeout(d.current)},[]),s.useEffect(()=>{var $;const v=($=o.value)!=null?$:"";f(String(v))},[o.value]),_(p.components.BaseTextField,m({id:b,label:i.current.getLocaleText("filterPanelInputLabel"),placeholder:i.current.getLocaleText("filterPanelInputPlaceholder"),value:u,onChange:I,variant:"standard",type:l||"text",InputLabelProps:{shrink:!0},inputRef:c,InputProps:m({},C?{endAdornment:_(Nn,{})}:{},a,{inputProps:m({max:l==="datetime-local"?"9999-12-31T23:59":"9999-12-31"},a==null?void 0:a.inputProps)})},g,(n=p.componentsProps)==null?void 0:n.baseTextField))}const Jc=/(\d+)-(\d+)-(\d+)/,eu=/(\d+)-(\d+)-(\d+)T(\d+):(\d+)/;function Dt(e,t,n,o){if(!e.value)return null;const[r,l,i,c,a]=e.value.match(n?eu:Jc).slice(1).map(Number),g=new Date(r,l-1,i,c||0,a||0).getTime();return({value:d})=>{if(!d)return!1;const u=d instanceof Date?d:new Date(d.toString());if(o)return t(u.getTime(),g);const C=(d instanceof Date?new Date(u):u).setHours(n?u.getHours():0,n?u.getMinutes():0,0,0);return t(C,g)}}const Ur=e=>[{value:"is",getApplyFilterFn:t=>Dt(t,(n,o)=>n===o,e),InputComponent:_t,InputComponentProps:{type:e?"datetime-local":"date"}},{value:"not",getApplyFilterFn:t=>Dt(t,(n,o)=>n!==o,e),InputComponent:_t,InputComponentProps:{type:e?"datetime-local":"date"}},{value:"after",getApplyFilterFn:t=>Dt(t,(n,o)=>n>o,e),InputComponent:_t,InputComponentProps:{type:e?"datetime-local":"date"}},{value:"onOrAfter",getApplyFilterFn:t=>Dt(t,(n,o)=>n>=o,e),InputComponent:_t,InputComponentProps:{type:e?"datetime-local":"date"}},{value:"before",getApplyFilterFn:t=>Dt(t,(n,o)=>n<o,e,!e),InputComponent:_t,InputComponentProps:{type:e?"datetime-local":"date"}},{value:"onOrBefore",getApplyFilterFn:t=>Dt(t,(n,o)=>n<=o,e),InputComponent:_t,InputComponentProps:{type:e?"datetime-local":"date"}},{value:"isEmpty",getApplyFilterFn:()=>({value:t})=>t==null,requiresFilterValue:!1},{value:"isNotEmpty",getApplyFilterFn:()=>({value:t})=>t!=null,requiresFilterValue:!1}];function tu({value:e}){return e instanceof Date?e.toLocaleDateString():e??""}function nu({value:e}){return e instanceof Date?e.toLocaleString():e??""}const ou=m({},St,{type:"date",sortComparator:Gr,valueFormatter:tu,filterOperators:Ur(),renderEditCell:kr,getApplyQuickFilterFn:void 0}),ru=m({},St,{type:"dateTime",sortComparator:Gr,valueFormatter:nu,filterOperators:Ur(!0),renderEditCell:kr,getApplyQuickFilterFn:void 0}),ht=e=>e==null?null:Number(e),lu=e=>e==null||Number.isNaN(e)||e===""?null:({value:t})=>ht(t)===ht(e),su=()=>[{label:"=",value:"=",getApplyFilterFn:e=>e.value==null||Number.isNaN(e.value)?null:({value:t})=>ht(t)===e.value,InputComponent:nt,InputComponentProps:{type:"number"}},{label:"!=",value:"!=",getApplyFilterFn:e=>e.value==null||Number.isNaN(e.value)?null:({value:t})=>ht(t)!==e.value,InputComponent:nt,InputComponentProps:{type:"number"}},{label:">",value:">",getApplyFilterFn:e=>e.value==null||Number.isNaN(e.value)?null:({value:t})=>t==null?!1:ht(t)>e.value,InputComponent:nt,InputComponentProps:{type:"number"}},{label:">=",value:">=",getApplyFilterFn:e=>e.value==null||Number.isNaN(e.value)?null:({value:t})=>t==null?!1:ht(t)>=e.value,InputComponent:nt,InputComponentProps:{type:"number"}},{label:"<",value:"<",getApplyFilterFn:e=>e.value==null||Number.isNaN(e.value)?null:({value:t})=>t==null?!1:ht(t)<e.value,InputComponent:nt,InputComponentProps:{type:"number"}},{label:"<=",value:"<=",getApplyFilterFn:e=>e.value==null||Number.isNaN(e.value)?null:({value:t})=>t==null?!1:ht(t)<=e.value,InputComponent:nt,InputComponentProps:{type:"number"}},{value:"isEmpty",getApplyFilterFn:()=>({value:e})=>e==null,requiresFilterValue:!1},{value:"isNotEmpty",getApplyFilterFn:()=>({value:e})=>e!=null,requiresFilterValue:!1},{value:"isAnyOf",getApplyFilterFn:e=>!Array.isArray(e.value)||e.value.length===0?null:({value:t})=>t!=null&&e.value.includes(Number(t)),InputComponent:zr,InputComponentProps:{type:"number"}}],iu=m({},St,{type:"number",align:"right",headerAlign:"right",sortComparator:Vr,valueParser:e=>e===""?null:Number(e),valueFormatter:({value:e})=>Gc(e)?e.toLocaleString():e||"",filterOperators:su(),getApplyQuickFilterFn:lu}),au=["item","applyValue","type","apiRef","focusElementRef"],cu=({valueOptions:e,valueFormatter:t,field:n},o,r)=>(typeof e=="function"?["",...e({field:n})]:["",...e||[]]).map(i=>{const c=typeof i=="object",a=c?i.value:i,g=c?i.value:i,d=t&&i!==""?t({value:i,field:n,api:o}):i,u=c?i.label:d;return _(r,{value:g,children:u},a)});function Vo(e){var t,n,o,r,l;const{item:i,applyValue:c,type:a,apiRef:g,focusElementRef:d}=e,u=Z(e,au),[f,C]=s.useState((t=i.value)!=null?t:""),P=Te(),b=J(),I=(o=(((n=b.componentsProps)==null?void 0:n.baseSelect)||{}).native)!=null?o:!0,$=i.columnField?g.current.getColumn(i.columnField):null,v=s.useMemo(()=>{if($!==null)return typeof $.valueOptions=="function"?$.valueOptions({field:$.field}):$.valueOptions},[$]),h=s.useCallback(k=>{let F=k.target.value;F=pn(F,v),C(String(F)),c(m({},i,{value:F}))},[c,i,v]);return s.useEffect(()=>{var k;let F;if(v!==void 0){if(F=pn(i.value,v),F!==i.value){c(m({},i,{value:F}));return}}else F=i.value;F=(k=F)!=null?k:"",C(String(F))},[i,v,c]),_(b.components.BaseTextField,m({id:P,label:g.current.getLocaleText("filterPanelInputLabel"),placeholder:g.current.getLocaleText("filterPanelInputPlaceholder"),value:f,onChange:h,variant:"standard",type:a||"text",InputLabelProps:{shrink:!0},inputRef:d,select:!0,SelectProps:m({native:I},(r=b.componentsProps)==null?void 0:r.baseSelect)},u,(l=b.componentsProps)==null?void 0:l.baseTextField,{children:cu(g.current.getColumn(i.columnField),g.current,I?"option":Ae)}))}const uu=["item","applyValue","type","apiRef","focusElementRef","color","error","helperText","size","variant"],du=(e,t)=>wt(e)===wt(t),gu=wl();function mu(e){const{item:t,applyValue:n,apiRef:o,focusElementRef:r,color:l,error:i,helperText:c,size:a,variant:g="standard"}=e,d=Z(e,uu),u={color:l,error:i,helperText:c,size:a,variant:g},f=Te(),C=J(),P=t.columnField?o.current.getColumn(t.columnField):null,b=s.useMemo(()=>P!=null&&P.valueOptions?typeof P.valueOptions=="function"?P.valueOptions({field:P.field}):P.valueOptions:[],[P]),p=s.useMemo(()=>b==null?void 0:b.map(wt),[b]),{valueFormatter:I,field:$}=o.current.getColumn(t.columnField),v=F=>typeof F=="object"?F.label:I&&F!==""?I({value:F,field:$,api:o.current}):F,h=s.useMemo(()=>Array.isArray(t.value)?b!==void 0?t.value.map(S=>{const w=wt(S);return(p==null?void 0:p.findIndex(T=>T===w))||0}).filter(S=>S>=0).map(S=>b[S]):t.value:[],[t.value,b,p]);s.useEffect(()=>{(!Array.isArray(t.value)||h.length!==t.value.length)&&n(m({},t,{value:h.map(wt)}))},[t,h,n]);const k=s.useCallback((F,S)=>{n(m({},t,{value:[...S.map(wt)]}))},[n,t]);return _(ir,m({multiple:!0,options:b,isOptionEqualToValue:du,filterOptions:gu,id:f,value:h,onChange:k,renderTags:(F,S)=>F.map((w,E)=>_(ar,m({variant:"outlined",size:"small",label:v(w)},S({index:E})))),renderInput:F=>{var S;return _(C.components.BaseTextField,m({},F,{label:o.current.getLocaleText("filterPanelInputLabel"),placeholder:o.current.getLocaleText("filterPanelInputPlaceholder"),InputLabelProps:m({},F.InputLabelProps,{shrink:!0}),inputRef:r,type:"singleSelect"},u,(S=C.componentsProps)==null?void 0:S.baseTextField))}},d))}const pt=e=>e==null||typeof e!="object"?e:e.value,fu=(e,t,n)=>{if(!e)return null;const{valueOptions:o,valueFormatter:r,field:l}=t,i=[pt(e).toString()],c=typeof o=="function"?o({field:l}):o||[];return c&&c.forEach(a=>{let g,d;typeof a=="object"?(g=a.value,d=a.label):(g=a,r?d=r({value:a,field:l,api:n.current}):d=a),d.slice(0,e.length).toLowerCase()===e.toLowerCase()&&(i.includes(g)||i.push(g.toString()))}),({value:a})=>a!=null?i.includes(pt(a).toString()):!1},hu=()=>[{value:"is",getApplyFilterFn:e=>e.value==null||e.value===""?null:({value:t})=>pt(t)===pt(e.value),InputComponent:Vo},{value:"not",getApplyFilterFn:e=>e.value==null||e.value===""?null:({value:t})=>pt(t)!==pt(e.value),InputComponent:Vo},{value:"isAnyOf",getApplyFilterFn:e=>{if(!Array.isArray(e.value)||e.value.length===0)return null;const t=e.value.map(pt);return({value:n})=>t.includes(pt(n))},InputComponent:mu}],pu=m({},St,{type:"singleSelect",renderEditCell:va,filterOperators:hu(),getApplyQuickFilterFn:fu}),wn="__default__",Cu=()=>({string:St,number:iu,date:ou,dateTime:ru,boolean:Nr,singleSelect:pu,[ao]:Wc,[wn]:St}),Kr=["maxWidth","minWidth","width","flex"],Wr=(e={})=>{const t=m({},Cu());return Object.entries(e).forEach(([n,o])=>{t[n]?t[n]=m({},t[n],o):t[n]=m({},t[o.extendType||wn],o)}),t};function bu({initialFreeSpace:e,totalFlexUnits:t,flexColumns:n}){const o={all:{},frozenFields:[],freeze:l=>{const i=o.all[l];i&&i.frozen!==!0&&(o.all[l].frozen=!0,o.frozenFields.push(l))}};function r(){if(o.frozenFields.length===n.length)return;const l={min:{},max:{}};let i=e,c=t,a=0;o.frozenFields.forEach(g=>{i-=o.all[g].computedWidth,c-=o.all[g].flex});for(let g=0;g<n.length;g+=1){const d=n[g];if(o.all[d.field]&&o.all[d.field].frozen===!0)continue;let f=i/c*d.flex;f<d.minWidth?(a+=d.minWidth-f,f=d.minWidth,l.min[d.field]=!0):f>d.maxWidth&&(a+=d.maxWidth-f,f=d.maxWidth,l.max[d.field]=!0),o.all[d.field]={frozen:!1,computedWidth:f,flex:d.flex}}a<0?Object.keys(l.max).forEach(g=>{o.freeze(g)}):a>0?Object.keys(l.min).forEach(g=>{o.freeze(g)}):n.forEach(({field:g})=>{o.freeze(g)}),r()}return r(),o.all}const jr=(e,t)=>{const n={};let o=0,r=0;const l=[];e.all.forEach(c=>{const a=m({},e.lookup[c]);if(e.columnVisibilityModel[c]===!1)a.computedWidth=0;else{let g;a.flex&&a.flex>0?(o+=a.flex,g=0,l.push(a)):g=At(a.width,a.minWidth,a.maxWidth),r+=g,a.computedWidth=g}n[c]=a});const i=Math.max(t-r,0);if(o>0&&t>0){const c=bu({initialFreeSpace:i,totalFlexUnits:o,flexColumns:l});Object.keys(c).forEach(a=>{n[a].computedWidth=c[a].computedWidth})}return m({},e,{lookup:n})},wu=(e,t)=>{if(!t)return e;const{orderedFields:n=[],dimensions:o={}}=t,r=Object.keys(o);if(r.length===0&&n.length===0)return e;const l={},i=[];for(let d=0;d<n.length;d+=1){const u=n[d];e.lookup[u]&&(l[u]=!0,i.push(u))}const c=i.length===0?e.all:[...i,...e.all.filter(d=>!l[d])],a=m({},e.lookup);for(let d=0;d<r.length;d+=1){const u=r[d],f=m({},a[u],{hasBeenResized:!0});Object.entries(o[u]).forEach(([C,P])=>{f[C]=P===-1?1/0:P}),a[u]=f}return{all:c,lookup:a}},vu=(e,t)=>!t||!e[t]?e[wn]:e[t],Rt=({apiRef:e,columnsToUpsert:t,initialState:n,columnTypes:o,currentColumnVisibilityModel:r=ut(e),shouldRegenColumnVisibilityModelFromColumns:l,keepOnlyColumnsToUpsert:i=!1})=>{var c,a,g,d;const u=!e.current.state.columns;let f;if(u)f={all:[],lookup:{}};else{const h=Mt(e.current.state);f={all:i?[]:[...h.all],lookup:m({},h.lookup)}}let C={};i&&!u&&(C=Object.keys(f.lookup).reduce((h,k)=>m({},h,{[k]:!1}),{}));const P={};t.forEach(h=>{const{field:k}=h;P[k]=!0,C[k]=!0;let F=f.lookup[k];F==null?(F=m({},vu(o,h.type),{field:k,hasBeenResized:!1}),f.all.push(k)):i&&f.all.push(k);let S=F.hasBeenResized;Kr.forEach(w=>{h[w]!==void 0&&(S=!0,h[w]===-1&&(h[w]=1/0))}),f.lookup[k]=m({},F,{hide:h.hide==null?!1:h.hide},h,{hasBeenResized:S})}),i&&!u&&Object.keys(f.lookup).forEach(h=>{C[h]||delete f.lookup[h]});const b=m({},f.lookup),p=e.current.unstable_applyPipeProcessors("hydrateColumns",f);let I={};if(l){let h=!1;const k=m({},r);u?p.all.forEach(F=>{k[F]=!f.lookup[F].hide}):i&&Object.keys(k).forEach(F=>{p.lookup[F]||(delete k[F],h=!0)}),p.all.forEach(F=>{if(!P[F]&&b[F]===p.lookup[F])return;let S=r[F];S===void 0&&(u?S=!0:S=!!Mt(e.current.state).lookup[F]);const w=!p.lookup[F].hide;w!==S&&(h=!0,k[F]=w)}),h||u?I=k:I=r}else I=r;const $=wu(p,n),v=m({},$,{columnVisibilityModel:I});return jr(v,(c=(a=(g=e.current).getRootDimensions)==null||(d=a.call(g))==null?void 0:d.viewportInnerSize.width)!=null?c:0)},Go=e=>t=>m({},t,{columns:e});function Ln({firstColumnToRender:e,apiRef:t,firstRowToRender:n,lastRowToRender:o,visibleRows:r}){let l=e;for(let i=n;i<o;i+=1)if(r[i]){const a=r[i].id,g=t.current.unstable_getCellColSpanInfo(a,e);g&&g.spannedByColSpan&&(l=g.leftVisibleCellIndex)}return l}function Su({firstColumnIndex:e,minColumnIndex:t,columnBuffer:n,firstRowToRender:o,lastRowToRender:r,apiRef:l,visibleRows:i}){const c=Math.max(e-n,t);return Ln({firstColumnToRender:c,apiRef:l,firstRowToRender:o,lastRowToRender:r,visibleRows:i})}const Pu=e=>{const{column:t,onClick:n}=e,o=se(),r=J(),l=s.useRef(),a=Oe(o).filter(d=>d.disableColumnMenu!==!0).length===1,g=s.useCallback(d=>{a||(n(d),l.current=setTimeout(()=>{o.current.setColumnVisibility(t==null?void 0:t.field,!1)},100))},[o,t==null?void 0:t.field,n,a]);return s.useEffect(()=>()=>clearTimeout(l.current),[]),r.disableColumnSelector||t.hideable===!1?null:_(Ae,{onClick:g,disabled:a,children:o.current.getLocaleText("columnMenuHideColumn")})};function yu(e){var t;const{column:n,onClick:o}=e,r=se(),l=ee(r,Ye),i=J(),c=(t=n.sortingOrder)!=null?t:i.sortingOrder,a=s.useMemo(()=>{if(!n)return null;const d=l.find(u=>u.field===n.field);return d==null?void 0:d.sort},[n,l]),g=s.useCallback(d=>{o(d);const u=d.currentTarget.getAttribute("data-value")||null;r.current.sortColumn(n,u)},[r,n,o]);return!n||!n.sortable?null:we(s.Fragment,{children:[c.includes(null)?_(Ae,{onClick:g,disabled:a==null,children:r.current.getLocaleText("columnMenuUnsort")}):null,c.includes("asc")?_(Ae,{onClick:g,"data-value":"asc",disabled:a==="asc",children:r.current.getLocaleText("columnMenuSortAsc")}):null,c.includes("desc")?_(Ae,{onClick:g,"data-value":"desc",disabled:a==="desc",children:r.current.getLocaleText("columnMenuSortDesc")}):null]})}const xu=s.forwardRef(function(t,n){const{hideMenu:o,currentColumn:r}=t,l=se(),i=[_(yu,{onClick:o,column:r}),_(Fc,{onClick:o,column:r}),_(Pu,{onClick:o,column:r}),_(kc,{onClick:o,column:r})],c=l.current.unstable_applyPipeProcessors("columnMenu",i,r);return _($c,m({ref:n},t,{children:c.map((a,g)=>s.cloneElement(a,{key:g,onClick:o,column:r}))}))}),Iu=["className"],Eu=e=>{const{classes:t}=e;return ce({root:["panelContent"]},ge,t)},Mu=ie("div",{name:"MuiDataGrid",slot:"PanelContent",overridesResolver:(e,t)=>t.panelContent})({display:"flex",flexDirection:"column",overflow:"auto",flex:"1 1",maxHeight:400});function qr(e){const{className:t}=e,n=Z(e,Iu),o=J(),r=Eu(o);return _(Mu,m({className:pe(t,r.root),ownerState:o},n))}const ku=["className"],Fu=e=>{const{classes:t}=e;return ce({root:["panelFooter"]},ge,t)},Tu=ie("div",{name:"MuiDataGrid",slot:"PanelFooter",overridesResolver:(e,t)=>t.panelFooter})(({theme:e})=>({padding:e.spacing(.5),display:"flex",justifyContent:"space-between"}));function Yr(e){const{className:t}=e,n=Z(e,ku),o=J(),r=Fu(o);return _(Tu,m({className:pe(t,r.root),ownerState:o},n))}const $u=["className"],_u=e=>{const{classes:t}=e;return ce({root:["panelHeader"]},ge,t)},Du=ie("div",{name:"MuiDataGrid",slot:"PanelHeader",overridesResolver:(e,t)=>t.panelHeader})(({theme:e})=>({padding:e.spacing(1)}));function Ru(e){const{className:t}=e,n=Z(e,$u),o=J(),r=_u(o);return _(Du,m({className:pe(t,r.root),ownerState:o},n))}const Ou=["className","slotProps"],Hu=e=>{const{classes:t}=e;return ce({root:["panelWrapper"]},ge,t)},Lu=ie("div",{name:"MuiDataGrid",slot:"PanelWrapper",overridesResolver:(e,t)=>t.panelWrapper})({display:"flex",flexDirection:"column",flex:1,"&:focus":{outline:0}}),Vu=()=>!0,Qr=s.forwardRef(function(t,n){const{className:o,slotProps:r={}}=t,l=Z(t,Ou),i=J(),c=Hu(i);return _(vl,m({open:!0,disableEnforceFocus:!0,isEnabled:Vu},r.TrapFocus,{children:_(Lu,m({ref:n,tabIndex:-1,className:pe(o,c.root),ownerState:i},l))}))}),Gu=!1,Au=["sort","searchPredicate","autoFocusSearchField"],Bu=e=>{const{classes:t}=e;return ce({root:["columnsPanel"],columnsPanelRow:["columnsPanelRow"]},ge,t)},zu=ie("div",{name:"MuiDataGrid",slot:"ColumnsPanel",overridesResolver:(e,t)=>t.columnsPanel})({padding:"8px 0px 8px 8px"}),Nu=ie("div",{name:"MuiDataGrid",slot:"ColumnsPanelRow",overridesResolver:(e,t)=>t.columnsPanelRow})(({theme:e})=>({display:"flex",justifyContent:"space-between",padding:"1px 8px 1px 7px",[`& .${Sl.root}`]:{marginRight:e.spacing(.5)}})),Uu=ie(ot)({justifyContent:"flex-end"}),Ao=new Intl.Collator,Ku=(e,t)=>(e.headerName||e.field).toLowerCase().indexOf(t)>-1;function Wu(e){var t,n,o;const r=se(),l=s.useRef(null),i=ee(r,Ze),c=ee(r,ut),a=J(),[g,d]=s.useState(""),u=Bu(a),{sort:f,searchPredicate:C=Ku,autoFocusSearchField:P=!0}=e,b=Z(e,Au),p=s.useMemo(()=>{switch(f){case"asc":return[...i].sort((w,E)=>Ao.compare(w.headerName||w.field,E.headerName||E.field));case"desc":return[...i].sort((w,E)=>-Ao.compare(w.headerName||w.field,E.headerName||E.field));default:return i}},[i,f]),I=w=>{const{name:E}=w.target;r.current.setColumnVisibility(E,c[E]===!1)},$=s.useCallback(w=>{if(r.current.unstable_caches.columns.isUsingColumnVisibilityModel){const E=ut(r),T=m({},E);return i.forEach(M=>{M.hideable&&(w?delete T[M.field]:T[M.field]=!1)}),r.current.setColumnVisibilityModel(T)}return r.current.updateColumns(i.map(E=>E.hideable!==!1?{field:E.field,hide:!w}:E))},[r,i]),v=s.useCallback(w=>{d(w.target.value)},[]),h=s.useMemo(()=>{if(!g)return p;const w=g.toLowerCase();return p.filter(E=>C(E,w))},[p,g,C]),k=s.useRef(null);s.useEffect(()=>{P?l.current.focus():k.current&&typeof k.current.focus=="function"&&k.current.focus()},[P]);let F=!1;const S=w=>F===!1&&w.hideable!==!1?(F=!0,!0):!1;return we(Qr,m({},b,{children:[_(Ru,{children:_(a.components.BaseTextField,m({label:r.current.getLocaleText("columnsPanelTextFieldLabel"),placeholder:r.current.getLocaleText("columnsPanelTextFieldPlaceholder"),inputRef:l,value:g,onChange:v,variant:"standard",fullWidth:!0},(t=a.componentsProps)==null?void 0:t.baseTextField))}),_(qr,{children:_(zu,{className:u.root,ownerState:a,children:h.map(w=>{var E;return we(Nu,{className:u.columnsPanelRow,ownerState:a,children:[_(Pl,{control:_(a.components.BaseSwitch,m({disabled:w.hideable===!1,checked:c[w.field]!==!1,onClick:I,name:w.field,size:"small",inputRef:S(w)?k:void 0},(E=a.componentsProps)==null?void 0:E.baseSwitch)),label:w.headerName||w.field}),!a.disableColumnReorder&&Gu&&_(Uu,{draggable:!0,"aria-label":r.current.getLocaleText("columnsPanelDragIconLabel"),title:r.current.getLocaleText("columnsPanelDragIconLabel"),size:"small",disabled:!0,children:_(cr,{})})]},w.field)})})}),we(Yr,{children:[_(a.components.BaseButton,m({onClick:()=>$(!1)},(n=a.componentsProps)==null?void 0:n.baseButton,{children:r.current.getLocaleText("columnsPanelHideAllButton")})),_(a.components.BaseButton,m({onClick:()=>$(!0)},(o=a.componentsProps)==null?void 0:o.baseButton,{children:r.current.getLocaleText("columnsPanelShowAllButton")}))]})]}))}const ju=["children","className","classes"],qu=yt("MuiDataGrid",["panel","paper"]),Yu=ie(Un,{name:"MuiDataGrid",slot:"Panel",overridesResolver:(e,t)=>t.panel})(({theme:e})=>({zIndex:e.zIndex.modal})),Qu=ie(sr,{name:"MuiDataGrid",slot:"Paper",overridesResolver:(e,t)=>t.paper})(({theme:e})=>({backgroundColor:e.palette.background.paper,minWidth:300,maxHeight:450,display:"flex"})),Xu=s.forwardRef((e,t)=>{var n;const{children:o,className:r}=e,l=Z(e,ju),i=se(),c=J(),a=qu,[g,d]=s.useState(!1),u=s.useCallback(()=>{i.current.hidePreferences()},[i]),f=s.useCallback(b=>{no(b.key)&&i.current.hidePreferences()},[i]),C=s.useMemo(()=>[{name:"flip",enabled:!1},{name:"isPlaced",enabled:!0,phase:"main",fn:()=>{d(!0)},effect:()=>()=>{d(!1)}}],[]),P=(n=i.current.columnHeadersContainerElementRef)==null?void 0:n.current;return P?_(Yu,m({ref:t,placement:"bottom-start",className:pe(r,a.panel),ownerState:c,anchorEl:P,modifiers:C},l,{children:_(fr,{mouseEvent:"onMouseUp",onClickAway:u,children:_(Qu,{className:a.paper,ownerState:c,elevation:8,onKeyDown:f,children:g&&o})})})):null}),Zu=s.forwardRef(function(t,n){var o,r,l;const i=se(),c=ee(i,Ze),a=J(),g=ee(i,Cn),d=i.current.unstable_applyPipeProcessors("preferencePanel",null,(o=g.openedPanelValue)!=null?o:vt.filters);return _(a.components.Panel,m({ref:n,as:a.components.BasePopper,open:c.length>0&&g.open},(r=a.componentsProps)==null?void 0:r.panel,t,(l=a.componentsProps)==null?void 0:l.basePopper,{children:d}))}),Ju=["item","hasMultipleFilters","deleteFilter","applyFilterChanges","multiFilterOperator","showMultiFilterOperators","disableMultiFilterOperator","applyMultiFilterOperatorChanges","focusElementRef","linkOperators","columnsSort","deleteIconProps","linkOperatorInputProps","operatorInputProps","columnInputProps","valueInputProps","children"],ed=["InputComponentProps"],td=e=>{const{classes:t}=e;return ce({root:["filterForm"],deleteIcon:["filterFormDeleteIcon"],linkOperatorInput:["filterFormLinkOperatorInput"],columnInput:["filterFormColumnInput"],operatorInput:["filterFormOperatorInput"],valueInput:["filterFormValueInput"]},ge,t)},nd=ie("div",{name:"MuiDataGrid",slot:"FilterForm",overridesResolver:(e,t)=>t.filterForm})(({theme:e})=>({display:"flex",padding:e.spacing(1)})),od=ie(zt,{name:"MuiDataGrid",slot:"FilterFormDeleteIcon",overridesResolver:(e,t)=>t.filterFormDeleteIcon})(({theme:e})=>({flexShrink:0,justifyContent:"flex-end",marginRight:e.spacing(.5),marginBottom:e.spacing(.2)})),rd=ie(zt,{name:"MuiDataGrid",slot:"FilterFormLinkOperatorInput",overridesResolver:(e,t)=>t.filterFormLinkOperatorInput})({minWidth:55,marginRight:5,justifyContent:"end"}),ld=ie(zt,{name:"MuiDataGrid",slot:"FilterFormColumnInput",overridesResolver:(e,t)=>t.filterFormColumnInput})({width:150}),sd=ie(zt,{name:"MuiDataGrid",slot:"FilterFormOperatorInput",overridesResolver:(e,t)=>t.filterFormOperatorInput})({width:120}),id=ie(zt,{name:"MuiDataGrid",slot:"FilterFormValueInput",overridesResolver:(e,t)=>t.filterFormValueInput})({width:190}),ad=e=>{switch(e){case He.And:return"filterPanelOperatorAnd";case He.Or:return"filterPanelOperatorOr";default:throw new Error("MUI: Invalid `linkOperator` property in the `GridFilterPanel`.")}},Wt=e=>e.headerName||e.field,Bo=new Intl.Collator,cd=s.forwardRef(function(t,n){var o,r,l,i,c,a,g;const{item:d,hasMultipleFilters:u,deleteFilter:f,applyFilterChanges:C,multiFilterOperator:P,showMultiFilterOperators:b,disableMultiFilterOperator:p,applyMultiFilterOperatorChanges:I,focusElementRef:$,linkOperators:v=[He.And,He.Or],columnsSort:h,deleteIconProps:k={},linkOperatorInputProps:F={},operatorInputProps:S={},columnInputProps:w={},valueInputProps:E={}}=t,T=Z(t,Ju),M=se(),A=ee(M,eo),H=Te(),x=Te(),y=Te(),O=Te(),V=J(),R=td(V),D=s.useRef(null),G=s.useRef(null),z=u&&v.length>0,N=((o=V.componentsProps)==null?void 0:o.baseFormControl)||{},W=(l=(((r=V.componentsProps)==null?void 0:r.baseSelect)||{}).native)!=null?l:!0,te=W?"option":Ae,{InputComponentProps:q}=E,oe=Z(E,ed),U=s.useMemo(()=>{switch(h){case"asc":return A.sort((j,re)=>Bo.compare(Wt(j),Wt(re)));case"desc":return A.sort((j,re)=>-Bo.compare(Wt(j),Wt(re)));default:return A}},[A,h]),Y=d.columnField?M.current.getColumn(d.columnField):null,X=s.useMemo(()=>{var j;return!d.operatorValue||!Y?null:(j=Y.filterOperators)==null?void 0:j.find(re=>re.value===d.operatorValue)},[d,Y]),ae=s.useCallback(j=>{const re=j.target.value,le=M.current.getColumn(re);if(le.field===Y.field)return;const fe=le.filterOperators.find(Be=>Be.value===d.operatorValue)||le.filterOperators[0],ve=!fe.InputComponent||fe.InputComponent!==(X==null?void 0:X.InputComponent);C(m({},d,{columnField:re,operatorValue:fe.value,value:ve?void 0:d.value}))},[M,C,d,Y,X]),de=s.useCallback(j=>{const re=j.target.value,le=Y==null?void 0:Y.filterOperators.find(ve=>ve.value===re),fe=!(le!=null&&le.InputComponent)||(le==null?void 0:le.InputComponent)!==(X==null?void 0:X.InputComponent);C(m({},d,{operatorValue:re,value:fe?void 0:d.value}))},[C,d,Y,X]),be=s.useCallback(j=>{const re=j.target.value===He.And.toString()?He.And:He.Or;I(re)},[I]),xe=()=>{V.disableMultipleColumnsFiltering?d.value===void 0?f(d):C(m({},d,{value:void 0})):f(d)};return s.useImperativeHandle($,()=>({focus:()=>{if(X!=null&&X.InputComponent){var j;D==null||(j=D.current)==null||j.focus()}else G.current.focus()}}),[X]),we(nd,m({ref:n,className:R.root,ownerState:V},T,{children:[_(od,m({variant:"standard",as:V.components.BaseFormControl},N,k,{className:pe(R.deleteIcon,N.className,k.className),ownerState:V,children:_(ot,{"aria-label":M.current.getLocaleText("filterPanelDeleteIconLabel"),title:M.current.getLocaleText("filterPanelDeleteIconLabel"),onClick:xe,size:"small",children:_(V.components.FilterPanelDeleteIcon,{fontSize:"small"})})})),_(rd,m({variant:"standard",as:V.components.BaseFormControl},N,F,{sx:m({display:z?"flex":"none",visibility:b?"visible":"hidden"},N.sx||{},F.sx||{}),className:pe(R.linkOperatorInput,N.className,F.className),ownerState:V,children:_(V.components.BaseSelect,m({inputProps:{"aria-label":M.current.getLocaleText("filterPanelLinkOperator")},value:P,onChange:be,disabled:!!p||v.length===1,native:W},(i=V.componentsProps)==null?void 0:i.baseSelect,{children:v.map(j=>_(te,{value:j.toString(),children:M.current.getLocaleText(ad(j))},j.toString()))}))})),we(ld,m({variant:"standard",as:V.components.BaseFormControl},N,w,{className:pe(R.columnInput,N.className,w.className),ownerState:V,children:[_(yo,{htmlFor:H,id:x,children:M.current.getLocaleText("filterPanelColumns")}),_(V.components.BaseSelect,m({labelId:x,id:H,label:M.current.getLocaleText("filterPanelColumns"),value:d.columnField||"",onChange:ae,native:W},(c=V.componentsProps)==null?void 0:c.baseSelect,{children:U.map(j=>_(te,{value:j.field,children:Wt(j)},j.field))}))]})),we(sd,m({variant:"standard",as:V.components.BaseFormControl},N,S,{className:pe(R.operatorInput,N.className,S.className),ownerState:V,children:[_(yo,{htmlFor:y,id:O,children:M.current.getLocaleText("filterPanelOperators")}),_(V.components.BaseSelect,m({labelId:O,label:M.current.getLocaleText("filterPanelOperators"),id:y,value:d.operatorValue,onChange:de,native:W,inputRef:G},(a=V.componentsProps)==null?void 0:a.baseSelect,{children:Y==null||(g=Y.filterOperators)==null?void 0:g.map(j=>_(te,{value:j.value,children:j.label||M.current.getLocaleText(`filterOperator${Pe(j.value)}`)},j.value))}))]})),_(id,m({variant:"standard",as:V.components.BaseFormControl},N,oe,{className:pe(R.valueInput,N.className,oe.className),ownerState:V,children:X!=null&&X.InputComponent?_(X.InputComponent,m({apiRef:M,item:d,applyValue:C,focusElementRef:D},X.InputComponentProps,q)):null}))]}))}),ud=["linkOperators","columnsSort","filterFormProps","children"],dd=s.forwardRef(function(t,n){var o;const r=se(),l=J(),i=ee(r,Ge),c=ee(r,eo),a=s.useRef(null),{linkOperators:g=[He.And,He.Or],columnsSort:d,filterFormProps:u}=t,f=Z(t,ud),C=s.useCallback(h=>{r.current.upsertFilterItem(h)},[r]),P=s.useCallback(h=>{r.current.setFilterLinkOperator(h)},[r]),b=s.useCallback(()=>{const h=c.find(k=>{var F;return(F=k.filterOperators)==null?void 0:F.length});return h?{columnField:h.field,operatorValue:h.filterOperators[0].value,id:Math.round(Math.random()*1e5)}:null},[c]),p=s.useMemo(()=>{if(i.items.length)return i.items;const h=b();return h?[h]:[]},[i.items,b]),I=p.length>1,$=()=>{const h=b();h&&r.current.upsertFilterItems([...p,h])},v=s.useCallback(h=>{const k=p.length===1;r.current.deleteFilterItem(h),k&&r.current.hideFilterPanel()},[r,p.length]);return s.useEffect(()=>{g.length>0&&i.linkOperator&&!g.includes(i.linkOperator)&&P(g[0])},[g,P,i.linkOperator]),s.useEffect(()=>{p.length>0&&a.current.focus()},[p.length]),we(Qr,m({ref:n},f,{children:[_(qr,{children:p.map((h,k)=>_(cd,m({item:h,applyFilterChanges:C,deleteFilter:v,hasMultipleFilters:I,showMultiFilterOperators:k>0,multiFilterOperator:i.linkOperator,disableMultiFilterOperator:k!==1,applyMultiFilterOperatorChanges:P,focusElementRef:k===p.length-1?a:null,linkOperators:g,columnsSort:d},u),h.id==null?k:h.id))}),!l.disableMultipleColumnsFiltering&&_(Yr,{children:_(l.components.BaseButton,m({onClick:$,startIcon:_(ur,{})},(o=l.componentsProps)==null?void 0:o.baseButton,{children:r.current.getLocaleText("filterPanelAddFilter")}))})]}))}),gd=["children","onClick"],md=s.forwardRef(function(t,n){var o;const{children:r,onClick:l}=t,i=Z(t,gd),c=se(),a=J(),g=Te(),d=Te(),[u,f]=s.useState(!1),C=s.useRef(null),P=rt(n,C),b=v=>{f(h=>!h),l==null||l(v)},p=()=>f(!1),I=v=>{oo(v.key)&&v.preventDefault(),_r(v.key)&&p()},$=v=>{var h;C.current===v.target||(h=C.current)!=null&&h.contains(v.target)||f(!1)};return r==null?null:we(s.Fragment,{children:[_(a.components.BaseButton,m({ref:P,size:"small",startIcon:_(a.components.ExportIcon,{}),"aria-expanded":u?"true":void 0,"aria-label":c.current.getLocaleText("toolbarExportLabel"),"aria-haspopup":"menu","aria-labelledby":d,id:g},i,{onClick:b},(o=a.componentsProps)==null?void 0:o.baseButton,{children:c.current.getLocaleText("toolbarExport")})),_(ro,{open:u,target:C.current,onClickAway:$,position:"bottom-start",children:_(Kn,{id:d,className:L.menuList,"aria-labelledby":g,onKeyDown:I,autoFocusItem:u,children:s.Children.map(r,v=>s.isValidElement(v)?s.cloneElement(v,{hideMenu:p}):v)})})]})}),fd=["hideMenu","options"],hd=["hideMenu","options"],pd=["csvOptions","printOptions","excelOptions"],Cd=e=>{const t=se(),{hideMenu:n,options:o}=e,r=Z(e,fd);return _(Ae,m({onClick:()=>{t.current.exportDataAsCsv(o),n==null||n()}},r,{children:t.current.getLocaleText("toolbarExportCSV")}))},bd=e=>{const t=se(),{hideMenu:n,options:o}=e,r=Z(e,hd);return _(Ae,m({onClick:()=>{t.current.exportDataAsPrint(o),n==null||n()}},r,{children:t.current.getLocaleText("toolbarExportPrint")}))},kf=s.forwardRef(function(t,n){const{csvOptions:o={},printOptions:r={},excelOptions:l}=t,i=Z(t,pd),a=se().current.unstable_applyPipeProcessors("exportMenu",[],{excelOptions:l,csvOptions:o,printOptions:r}).sort((g,d)=>g.componentName>d.componentName?1:-1);return a.length===0?null:_(md,m({},i,{ref:n,children:a.map((g,d)=>s.cloneElement(g.component,{key:d}))}))}),Jt=()=>({items:[],linkOperator:He.And,quickFilterValues:[],quickFilterLogicOperator:He.And}),wd=["className","rowCount","visibleRowCount"],vd=e=>{const{classes:t}=e;return ce({root:["rowCount"]},ge,t)},Sd=ie("div",{name:"MuiDataGrid",slot:"RowCount",overridesResolver:(e,t)=>t.rowCount})(({theme:e})=>({alignItems:"center",display:"flex",margin:e.spacing(0,2)})),Pd=s.forwardRef(function(t,n){const{className:o,rowCount:r,visibleRowCount:l}=t,i=Z(t,wd),c=se(),a=J(),g=vd(a);if(r===0)return null;const d=l<r?c.current.getLocaleText("footerTotalVisibleRows")(l,r):r.toLocaleString();return we(Sd,m({ref:n,className:pe(g.root,o),ownerState:a},i,{children:[c.current.getLocaleText("footerTotalRows")," ",d]}))}),yd=["className","selectedRowCount"],xd=e=>{const{classes:t}=e;return ce({root:["selectedRowCount"]},ge,t)},Id=ie("div",{name:"MuiDataGrid",slot:"SelectedRowCount",overridesResolver:(e,t)=>t.selectedRowCount})(({theme:e})=>({alignItems:"center",display:"flex",margin:e.spacing(0,2),visibility:"hidden",width:0,height:0,[e.breakpoints.up("sm")]:{visibility:"visible",width:"auto",height:"auto"}})),Ed=s.forwardRef(function(t,n){const{className:o,selectedRowCount:r}=t,l=Z(t,yd),i=se(),c=J(),a=xd(c),g=i.current.getLocaleText("footerRowSelected")(r);return _(Id,m({ref:n,className:pe(a.root,o),ownerState:c},l,{children:g}))}),Md=s.forwardRef(function(t,n){var o;const r=se(),l=J(),i=ee(r,Ci),c=ee(r,Pc),a=ee(r,Pr),g=!l.hideFooterSelectedRowCount&&c>0?_(Ed,{selectedRowCount:c}):_("div",{}),d=!l.hideFooterRowCount&&!l.pagination?_(Pd,{rowCount:i,visibleRowCount:a}):null,u=l.pagination&&!l.hideFooterPagination&&l.components.Pagination&&_(l.components.Pagination,m({},(o=l.componentsProps)==null?void 0:o.pagination));return we(Ga,m({ref:n},t,{children:[g,d,u]}))}),kd=s.forwardRef(function(t,n){var o,r;const l=J();return we("div",m({ref:n},t,{children:[_(l.components.PreferencesPanel,m({},(o=l.componentsProps)==null?void 0:o.preferencesPanel)),l.components.Toolbar&&_(l.components.Toolbar,m({},(r=l.componentsProps)==null?void 0:r.toolbar))]}))}),Fd=s.forwardRef(function(t,n){return _(xn,m({ref:n},t,{children:_(yl,{})}))}),Td=s.forwardRef(function(t,n){const r=se().current.getLocaleText("noRowsLabel");return _(xn,m({ref:n},t,{children:r}))}),$d=ie(ti)(({theme:e})=>({[`& .${Et.selectLabel}`]:{display:"none",[e.breakpoints.up("sm")]:{display:"block"}},[`& .${Et.input}`]:{display:"none",[e.breakpoints.up("sm")]:{display:"inline-flex"}}})),_d=s.forwardRef(function(t,n){var o;const r=se(),l=J(),i=ee(r,Ut),c=s.useMemo(()=>Math.floor(i.rowCount/(i.pageSize||1)),[i.rowCount,i.pageSize]),a=s.useCallback(d=>{const u=Number(d.target.value);r.current.setPageSize(u)},[r]),g=s.useCallback((d,u)=>{r.current.setPage(u)},[r]);return _($d,m({ref:n,component:"div",count:i.rowCount,page:i.page<=c?i.page:c,rowsPerPageOptions:(o=l.rowsPerPageOptions)!=null&&o.includes(i.pageSize)?l.rowsPerPageOptions:[],rowsPerPage:i.pageSize,onPageChange:g,onRowsPerPageChange:a},r.current.getLocaleText("MuiTablePagination"),t))}),In=(e,t)=>{let n,o;return t.pagination&&t.paginationMode==="client"?(o=so(e),n=xc(e)):(n=gt(e),n.length===0?o=null:o={firstRowIndex:0,lastRowIndex:n.length-1}),{rows:n,range:o}},$t=(e,t)=>{const n=In(e,t);return s.useMemo(()=>({rows:n.rows,range:n.range}),[n.rows,n.range])},co="__detail_panel_toggle__",Dd=["selected","rowId","row","index","style","position","rowHeight","className","visibleColumns","renderedColumns","containerWidth","firstColumnToRender","lastColumnToRender","cellFocus","cellTabIndex","editRowsState","isLastVisible","onClick","onDoubleClick","onMouseEnter","onMouseLeave"],Rd=["changeReason"],Od=e=>{const{editable:t,editing:n,selected:o,isLastVisible:r,rowHeight:l,classes:i}=e;return ce({root:["row",o&&"selected",t&&"row--editable",n&&"row--editing",r&&"row--lastVisible",l==="auto"&&"row--dynamicHeight"]},ge,i)},Hd=({width:e})=>e?_("div",{className:"MuiDataGrid-cell",style:{width:e}}):null,Ld=s.forwardRef(function(t,n){var o;const{selected:r,rowId:l,row:i,index:c,style:a,position:g,rowHeight:d,className:u,visibleColumns:f,renderedColumns:C,containerWidth:P,firstColumnToRender:b,cellFocus:p,cellTabIndex:I,editRowsState:$,isLastVisible:v=!1,onClick:h,onDoubleClick:k,onMouseEnter:F,onMouseLeave:S}=t,w=Z(t,Dd),E=se(),T=s.useRef(null),M=J(),A=$t(E,M),H=ee(E,Pn),x=ee(E,Ye),y=ee(E,Qn),O=ee(E,to),V=rt(T,n),R=c+O+2,{hasScrollX:D,hasScrollY:G}=(o=E.current.getRootDimensions())!=null?o:{hasScrollX:!1,hasScrollY:!1},z={selected:r,isLastVisible:v,classes:M.classes,editing:E.current.getRowMode(l)===he.Edit,editable:M.editMode===Re.Row,rowHeight:d},N=Od(z);s.useLayoutEffect(()=>{d==="auto"&&T.current&&typeof ResizeObserver>"u"&&E.current.unstable_storeRowHeightMeasurement(l,T.current.clientHeight,g)},[E,d,l,g]),s.useLayoutEffect(()=>{if(A.range){const fe=E.current.getRowIndexRelativeToVisibleRows(l);fe!=null&&E.current.unstable_setLastMeasuredRowIndex(fe)}const j=T.current;if(!j||d!=="auto"||typeof ResizeObserver>"u")return;const le=new ResizeObserver(fe=>{const[ve]=fe,Be=ve.borderBoxSize&&ve.borderBoxSize.length>0?ve.borderBoxSize[0].blockSize:ve.contentRect.height;E.current.unstable_storeRowHeightMeasurement(l,Be,g)});return le.observe(j),()=>le.disconnect()},[E,A.range,c,d,l,g]);const K=s.useCallback((j,re)=>le=>{le.target.nodeType===1&&!le.currentTarget.contains(le.target)||E.current.getRow(l)&&(E.current.publishEvent(j,E.current.getRowParams(l),le),re&&re(le))},[E,l]),W=s.useCallback(j=>{const re=ec(j.target,L.cell),le=re==null?void 0:re.getAttribute("data-field");le&&(le===sn.field||le===co||le==="__reorder__"||E.current.getCellMode(l,le)===ue.Edit||E.current.getColumn(le).type===ao)||K("rowClick",h)(j)},[E,h,K,l]),te=s.useCallback((j,re)=>{var le;const fe=E.current.getCellParams(l,j.field),ve=[],Be=M.disableColumnReorder&&j.disableReorder||!M.rowReordering&&!!x.length&&y>1&&Object.keys($).length>0;j.cellClassName&&ve.push(pe(typeof j.cellClassName=="function"?j.cellClassName(fe):j.cellClassName));const Le=$[l]?$[l][j.field]:null;let ze=null;if(Le==null&&j.renderCell){var Se;ze=j.renderCell(m({},fe,{api:E.current})),ve.push(pe(L["cell--withRenderer"],(Se=M.classes)==null?void 0:Se["cell--withRenderer"]))}if(Le!=null&&j.renderEditCell){var $e;let Ie=i;E.current.unstable_getRowWithUpdatedValues&&(Ie=E.current.unstable_getRowWithUpdatedValues(l,j.field));const _e=Z(Le,Rd),Ve=m({},fe,{row:Ie},_e,{api:E.current});ze=j.renderEditCell(Ve),ve.push(pe(L["cell--editing"],($e=M.classes)==null?void 0:$e["cell--editing"]))}M.getCellClassName&&ve.push(M.getCellClassName(fe));const st=p!==null&&p.id===l&&p.field===j.field,Ee=I!==null&&I.id===l&&I.field===j.field&&fe.cellMode==="view"?0:-1;return _(M.components.Cell,m({value:fe.value,field:j.field,width:re.width,rowId:l,height:d,showRightBorder:re.showRightBorder,formattedValue:fe.formattedValue,align:j.align||"left",cellMode:fe.cellMode,colIndex:re.indexRelativeToAllColumns,isEditable:fe.isEditable,hasFocus:st,tabIndex:Ee,className:pe(ve),colSpan:re.colSpan,disableDragEvents:Be},(le=M.componentsProps)==null?void 0:le.cell,{children:ze}),j.field)},[E,I,$,p,M,i,d,l,y,x.length]),q=E.current.unstable_getRowInternalSizes(l);let oe=d;if(oe==="auto"&&q){let j=0;const re=Object.entries(q).reduce((le,[fe,ve])=>/^base[A-Z]/.test(fe)?(j+=1,ve>le?ve:le):le,0);re>0&&j>1&&(oe=re)}const U=m({},a,{maxHeight:d==="auto"?"none":d,minHeight:oe});if(q!=null&&q.spacingTop){const j=M.rowSpacingType==="border"?"borderTopWidth":"marginTop";U[j]=q.spacingTop}if(q!=null&&q.spacingBottom){const j=M.rowSpacingType==="border"?"borderBottomWidth":"marginBottom";let re=U[j];typeof re!="number"&&(re=parseInt(re||"0",10)),re+=q.spacingBottom,U[j]=re}const Y=E.current.unstable_applyPipeProcessors("rowClassName",[],l);if(typeof M.getRowClassName=="function"){var X;const j=c-(((X=A.range)==null?void 0:X.firstRowIndex)||0),re=m({},E.current.getRowParams(l),{isFirstVisible:j===0,isLastVisible:j===A.rows.length-1,indexRelativeToCurrentPage:j});Y.push(M.getRowClassName(re))}const ae=zc(1e4,20,80),de=[];for(let j=0;j<C.length;j+=1){const re=C[j],le=b+j,fe=le===f.length-1,Be=fe?!(fe&&D&&!G)&&M.disableExtendRowFullWidth:M.showCellRightBorder,Le=E.current.unstable_getCellColSpanInfo(l,le);if(Le&&!Le.spannedByColSpan)if(i){const{colSpan:ze,width:Se}=Le.cellProps,$e={width:Se,colSpan:ze,showRightBorder:Be,indexRelativeToAllColumns:le};de.push(te(re,$e))}else{const{width:ze}=Le.cellProps,Se=Math.round(ae());de.push(_(M.components.SkeletonCell,{width:ze,contentWidth:Se,field:re.field,align:re.align},re.field))}}const be=P-H,xe=i?{onClick:W,onDoubleClick:K("rowDoubleClick",k),onMouseEnter:K("rowMouseEnter",F),onMouseLeave:K("rowMouseLeave",S)}:null;return we("div",m({ref:V,"data-id":l,"data-rowindex":c,role:"row",className:pe(...Y,N.root,u),"aria-rowindex":R,"aria-selected":r,style:U},xe,w,{children:[de,be>0&&_(Hd,{width:be})]}))}),zo=1e3;class Vd{constructor(t=zo){this.timeouts=new Map,this.cleanupTimeout=zo,this.cleanupTimeout=t}register(t,n,o){this.timeouts||(this.timeouts=new Map);const r=setTimeout(()=>{typeof n=="function"&&n(),this.timeouts.delete(o.cleanupToken)},this.cleanupTimeout);this.timeouts.set(o.cleanupToken,r)}unregister(t){const n=this.timeouts.get(t.cleanupToken);n&&(this.timeouts.delete(t.cleanupToken),clearTimeout(n))}reset(){this.timeouts&&(this.timeouts.forEach((t,n)=>{this.unregister({cleanupToken:n})}),this.timeouts=void 0)}}class Gd{constructor(){this.registry=new FinalizationRegistry(t=>{typeof t=="function"&&t()})}register(t,n,o){this.registry.register(t,n,o)}unregister(t){this.registry.unregister(t)}reset(){}}var Pt;(function(e){e.DataGrid="DataGrid",e.DataGridPro="DataGridPro"})(Pt||(Pt={}));class Ad{}function Bd(e){let t=0;return function(o,r,l,i){e.registry===null&&(e.registry=typeof FinalizationRegistry<"u"?new Gd:new Vd);const[c]=s.useState(new Ad),a=s.useRef(null),g=s.useRef();g.current=l;const d=s.useRef(null);if(!a.current&&g.current){const u=(f,C,P)=>{if(!C.defaultMuiPrevented){var b;(b=g.current)==null||b.call(g,f,C,P)}};a.current=o.current.subscribeEvent(r,u,i),t+=1,d.current={cleanupToken:t},e.registry.register(c,()=>{var f;(f=a.current)==null||f.call(a),a.current=null,d.current=null},d.current)}else!g.current&&a.current&&(a.current(),a.current=null,d.current&&(e.registry.unregister(d.current),d.current=null));s.useEffect(()=>{if(!a.current&&g.current){const u=(f,C,P)=>{if(!C.defaultMuiPrevented){var b;(b=g.current)==null||b.call(g,f,C,P)}};a.current=o.current.subscribeEvent(r,u,i)}return d.current&&e.registry&&(e.registry.unregister(d.current),d.current=null),()=>{var u;(u=a.current)==null||u.call(a),a.current=null}},[o,r,i])}}const zd={registry:null},Q=Bd(zd),Nd={isFirst:!0};function me(e,t,n){Q(e,t,n,Nd)}const No=1,Ud=1.5,Kd=e=>{const{scrollDirection:t,classes:n}=e,o={root:["scrollArea",`scrollArea--${t}`]};return ce(o,ge,n)},Wd=ie("div",{name:"MuiDataGrid",slot:"ScrollArea",overridesResolver:(e,t)=>[{[`&.${L["scrollArea--left"]}`]:t["scrollArea--left"]},{[`&.${L["scrollArea--right"]}`]:t["scrollArea--right"]},t.scrollArea]})(()=>({position:"absolute",top:0,zIndex:101,width:20,bottom:0,[`&.${L["scrollArea--left"]}`]:{left:0},[`&.${L["scrollArea--right"]}`]:{right:0}}));function jd(e){const{scrollDirection:t}=e,n=s.useRef(null),o=se(),r=s.useRef(),[l,i]=s.useState(!1),c=ee(o,yr),a=s.useRef({left:0,top:0}),g=J(),d=m({},g,{scrollDirection:t}),u=Kd(d),f=s.useCallback(b=>{a.current=b},[]),C=s.useCallback(b=>{let p;if(t==="left")p=b.clientX-n.current.getBoundingClientRect().right;else if(t==="right")p=Math.max(1,b.clientX-n.current.getBoundingClientRect().left);else throw new Error("MUI: Wrong drag direction");p=(p-No)*Ud+No,clearTimeout(r.current),r.current=setTimeout(()=>{o.current.scroll({left:a.current.left+p,top:a.current.top})})},[t,o]);s.useEffect(()=>()=>{clearTimeout(r.current)},[]);const P=s.useCallback(()=>{i(b=>!b)},[]);return Q(o,"rowsScroll",f),Q(o,"columnHeaderDragStart",P),Q(o,"columnHeaderDragEnd",P),l?_(Wd,{ref:n,className:pe(u.root),ownerState:d,onDragOver:C,style:{height:c}}):null}const Uo=s.memo(jd),qd=({apiRef:e,props:t,children:n})=>_(pr.Provider,{value:t,children:_(hr.Provider,{value:e,children:n})}),Yd=Ac()&&window.localStorage.getItem("DEBUG")!=null,qt=()=>{},Qd={debug:qt,info:qt,warn:qt,error:qt},Ko=["debug","info","warn","error"];function Wo(e,t,n=console){const o=Ko.indexOf(t);if(o===-1)throw new Error(`MUI: Log level ${t} not recognized.`);return Ko.reduce((l,i,c)=>(c>=o?l[i]=(...a)=>{const[g,...d]=a;n[i](`MUI: ${e} - ${g}`,...d)}:l[i]=qt,l),{})}const Xd=(e,t)=>{e.current.getLogger=s.useCallback(n=>Yd?Wo(n,"debug",t.logger):t.logLevel?Wo(n,t.logLevel.toString(),t.logger):Qd,[t.logLevel,t.logger])};function Ce(e,t,n){const o=s.useRef(t),[r]=s.useState(Object.keys(t)),l=s.useCallback(()=>{e.current&&r.forEach(i=>{e.current.hasOwnProperty(i)||(e.current[i]=(...c)=>o.current[i](...c))})},[r,e]);s.useEffect(()=>{o.current=t},[t]),s.useEffect(()=>{l()},[l]),l()}class Zd{constructor(){this.maxListeners=10,this.warnOnce=!1,this.events={}}on(t,n,o={}){let r=this.events[t];r||(r={highPriority:new Map,regular:new Map},this.events[t]=r),o.isFirst?r.highPriority.set(n,!0):r.regular.set(n,!0)}removeListener(t,n){this.events[t]&&(this.events[t].regular.delete(n),this.events[t].highPriority.delete(n))}removeAllListeners(){this.events={}}emit(t,...n){const o=this.events[t];if(!o)return;const r=Array.from(o.highPriority.keys()),l=Array.from(o.regular.keys());for(let i=r.length-1;i>=0;i-=1){const c=r[i];o.highPriority.has(c)&&c.apply(this,n)}for(let i=0;i<l.length;i+=1){const c=l[i];o.regular.has(c)&&c.apply(this,n)}}once(t,n){const o=this;this.on(t,function r(...l){o.removeListener(t,r),n.apply(o,l)})}}const Jd=e=>e.isPropagationStopped!==void 0;let jo=0;function eg(e,t){const n=s.useRef();n.current||(n.current={unstable_eventManager:new Zd,unstable_caches:{},state:{},instanceId:jo},jo+=1),s.useImperativeHandle(e,()=>n.current,[n]);const o=s.useCallback((...i)=>{const[c,a,g={}]=i;if(g.defaultMuiPrevented=!1,Jd(g)&&g.isPropagationStopped())return;const d=t.signature===Pt.DataGridPro?{api:n.current}:{};n.current.unstable_eventManager.emit(c,a,g,d)},[n,t.signature]),r=s.useCallback((i,c,a)=>{n.current.unstable_eventManager.on(i,c,a);const g=n.current;return()=>{g.unstable_eventManager.removeListener(i,c)}},[n]),l=s.useCallback(i=>{n.current.publishEvent("componentError",i)},[n]);return Ce(n,{subscribeEvent:r,publishEvent:o,showError:l}),s.useEffect(()=>{const i=n.current;return()=>{hi(i.instanceId),i.publishEvent("unmount")}},[n]),n}function tg(e,t){const n=s.useCallback(o=>{e.current.setState(r=>m({},r,{error:o}))},[e]);s.useEffect(()=>{t.error?n({error:t.error}):n(null)},[n,t.error]),Q(e,"componentError",n)}const ng=(e,t)=>{const n=s.useCallback(o=>{if(t.localeText[o]==null)throw new Error(`Missing translation for key ${o}.`);return t.localeText[o]},[t.localeText]);e.current.getLocaleText=n},og=e=>{const t=s.useRef({}),n=s.useCallback(a=>{a&&Object.values(a.appliers).forEach(g=>{g()})},[]),o=s.useCallback((a,g,d)=>{t.current[a]||(t.current[a]={processors:new Map,appliers:{}});const u=t.current[a];return u.processors.get(g)!==d&&(u.processors.set(g,d),n(u)),()=>{t.current[a].processors.set(g,null)}},[n]),r=s.useCallback((a,g,d)=>(t.current[a]||(t.current[a]={processors:new Map,appliers:{}}),t.current[a].appliers[g]=d,()=>{const u=t.current[a].appliers,f=Z(u,[g].map(Xt));t.current[a].appliers=f}),[]),l=s.useCallback(a=>{const g=t.current[a];n(g)},[n]),i=s.useCallback((...a)=>{const[g,d,u]=a;return t.current[g]?Array.from(t.current[g].processors.values()).reduce((C,P)=>P?P(C,u):C,d):d},[]);Ce(e,{unstable_registerPipeProcessor:o,unstable_registerPipeApplier:r,unstable_requestPipeProcessorsApplication:l,unstable_applyPipeProcessors:i})},an=e=>{const t=s.useRef(!0);t.current&&(t.current=!1,e())},De=(e,t,n)=>{const o=s.useRef(),r=s.useRef(`mui-${Math.round(Math.random()*1e9)}`),l=s.useCallback(()=>{o.current=e.current.unstable_registerPipeProcessor(t,r.current,n)},[e,n,t]);an(()=>{l()});const i=s.useRef(!0);s.useEffect(()=>(i.current?i.current=!1:l(),()=>{o.current&&(o.current(),o.current=null)}),[l])},uo=(e,t,n)=>{const o=s.useRef(),r=s.useRef(`mui-${Math.round(Math.random()*1e9)}`),l=s.useCallback(()=>{o.current=e.current.unstable_registerPipeApplier(t,r.current,n)},[e,n,t]);an(()=>{l()});const i=s.useRef(!0);s.useEffect(()=>(i.current?i.current=!1:l(),()=>{o.current&&(o.current(),o.current=null)}),[l])},go=(e,t,n,o)=>{const r=s.useCallback(()=>{e.current.unstable_registerStrategyProcessor(t,n,o)},[e,o,n,t]);an(()=>{r()});const l=s.useRef(!0);s.useEffect(()=>{l.current?l.current=!1:r()},[r])},cn="none",qo={rowTreeCreation:"rowTree",filtering:"rowTree",sorting:"rowTree"},rg=e=>{const t=s.useRef(new Map),n=s.useRef({}),o=s.useCallback((a,g,d)=>{const u=()=>{const P=n.current[g],b=Z(P,[a].map(Xt));n.current[g]=b};n.current[g]||(n.current[g]={});const f=n.current[g],C=f[a];return f[a]=d,!C||C===d||a===e.current.unstable_getActiveStrategy(qo[g])&&e.current.publishEvent("activeStrategyProcessorChange",g),u},[e]),r=s.useCallback((a,g)=>{const d=e.current.unstable_getActiveStrategy(qo[a]);if(d==null)throw new Error("Can't apply a strategy processor before defining an active strategy");const u=n.current[a];if(!u||!u[d])throw new Error(`No processor found for processor "${a}" on strategy "${d}"`);const f=u[d];return f(g)},[e]),l=s.useCallback(a=>{var g;const u=Array.from(t.current.entries()).find(([,f])=>f.group!==a?!1:f.isAvailable());return(g=u==null?void 0:u[0])!=null?g:cn},[]),i=s.useCallback((a,g,d)=>{t.current.set(g,{group:a,isAvailable:d}),e.current.publishEvent("strategyAvailabilityChange")},[e]);Ce(e,{unstable_registerStrategyProcessor:o,unstable_applyStrategyProcessor:r,unstable_getActiveStrategy:l,unstable_setStrategyAvailability:i})},lg=(e,t,n,o,r)=>{const l=Me(e,"useNativeEventListener"),[i,c]=s.useState(!1),a=s.useRef(o),g=s.useCallback(d=>a.current&&a.current(d),[]);s.useEffect(()=>{a.current=o},[o]),s.useEffect(()=>{let d;if(Ar(t)?d=t():d=t&&t.current?t.current:null,d&&n&&!i){l.debug(`Binding native ${n} event`),d.addEventListener(n,g,r);const u=d;c(!0);const f=()=>{l.debug(`Clearing native ${n} event`),u.removeEventListener(n,g,r)};e.current.subscribeEvent("unmount",f)}},[t,g,n,i,l,r,e])},sg=["stateId"],ig=(e,t)=>{const n=s.useRef({}),[,o]=s.useState(),r=s.useCallback(g=>{const{stateId:d}=g,u=Z(g,sg);n.current[d]=m({},u,{stateId:d})},[]),l=s.useCallback((g,d)=>{let u;if(Ar(g)?u=g(e.current.state):u=g,e.current.state===u)return!1;let f=!1;const C=[];if(Object.keys(n.current).forEach(P=>{const b=n.current[P],p=b.stateSelector(e.current.state,e.current.instanceId),I=b.stateSelector(u,e.current.instanceId);I!==p&&(C.push({stateId:b.stateId,hasPropChanged:I!==b.propModel}),b.propModel!==void 0&&I!==b.propModel&&(f=!0))}),C.length>1)throw new Error(`You're not allowed to update several sub-state in one transaction. You already updated ${C[0].stateId}, therefore, you're not allowed to update ${C.map(P=>P.stateId).join(", ")} in the same transaction.`);if(f||(e.current.state=u,e.current.publishEvent&&e.current.publishEvent("stateChange",u)),C.length===1){const{stateId:P,hasPropChanged:b}=C[0],p=n.current[P],I=p.stateSelector(u,e.current.instanceId);if(p.propOnChange&&b){const $=t.signature===Pt.DataGridPro?{api:e.current,reason:d}:{reason:d};p.propOnChange(I,$)}f||e.current.publishEvent(p.changeEvent,I,{reason:d})}return!f},[e,t.signature]),i=s.useCallback((g,d,u)=>e.current.setState(f=>m({},f,{[g]:d(f[g])}),u),[e]),c=s.useCallback(()=>o(()=>e.current.state),[e]);Ce(e,{setState:l,forceUpdate:c,unstable_updateControlState:i,unstable_registerControlState:r})},ag=(e,t)=>{const n=eg(e,t);return Xd(n,t),tg(n,t),ig(n,t),og(n),rg(n),ng(n,t),n},Ne=(e,t,n)=>{const o=s.useRef(!1);o.current||(t.current.state=e(t.current.state,n,t),o.current=!0)};function Yo(e){const t=document.createElement("span");t.style.whiteSpace="pre",t.style.userSelect="all",t.style.opacity="0px",t.textContent=e,document.body.appendChild(t);const n=document.createRange();n.selectNode(t);const o=window.getSelection();o.removeAllRanges(),o.addRange(n);try{document.execCommand("copy")}finally{document.body.removeChild(t)}}function cg(e){var t;return((t=window.getSelection())==null?void 0:t.toString())!==""?!0:e?(e.selectionEnd||0)-(e.selectionStart||0)>0:!1}const ug=e=>{const t=s.useCallback((r=!1)=>{if(e.current.getSelectedRows().size===0)return;const l=e.current.getDataAsCsv({includeHeaders:r,delimiter:"	"});navigator.clipboard?navigator.clipboard.writeText(l).catch(()=>{Yo(l)}):Yo(l)},[e]),n=s.useCallback(r=>{const l=r.ctrlKey||r.metaKey||r.altKey;String.fromCharCode(r.keyCode)!=="C"||!l||cg(r.target)||e.current.unstable_copySelectedRowsToClipboard(r.altKey)},[e]);lg(e,e.current.rootElementRef,"keydown",n),Ce(e,{unstable_copySelectedRowsToClipboard:t})},Xr=e=>e.columnMenu,dg=e=>m({},e,{columnMenu:{open:!1}}),gg=e=>{const t=Me(e,"useGridColumnMenu"),n=s.useCallback(c=>{e.current.setState(g=>g.columnMenu.open&&g.columnMenu.field===c?g:(t.debug("Opening Column Menu"),m({},g,{columnMenu:{open:!0,field:c}})))&&(e.current.hidePreferences(),e.current.forceUpdate())},[e,t]),o=s.useCallback(()=>{e.current.setState(a=>!a.columnMenu.open&&a.columnMenu.field===void 0?a:(t.debug("Hiding Column Menu"),m({},a,{columnMenu:m({},a.columnMenu,{open:!1,field:void 0})})))&&e.current.forceUpdate()},[e,t]),r=s.useCallback(c=>{t.debug("Toggle Column Menu");const a=Xr(e.current.state);!a.open||a.field!==c?n(c):o()},[e,t,n,o]);Ce(e,{showColumnMenu:n,hideColumnMenu:o,toggleColumnMenu:r});const i=s.useCallback((c,a)=>{if(!a.target.classList.contains(L.menuIconButton)||!a.relatedTarget)return;const g=a.relatedTarget.classList.contains(L.menuList),d=a.relatedTarget.getAttribute("role")==="menuitem";(g||d)&&e.current.setColumnHeaderFocus(c.field)},[e]);Q(e,"columnResizeStart",o),Q(e,"columnHeaderFocus",i),Q(e,"virtualScrollerWheel",e.current.hideColumnMenu),Q(e,"virtualScrollerTouchMove",e.current.hideColumnMenu)},mg=(e,t,n)=>{var o,r,l,i,c,a,g;const d=!!t.columnVisibilityModel||!!((o=t.initialState)!=null&&(r=o.columns)!=null&&r.columnVisibilityModel);n.current.unstable_caches.columns={isUsingColumnVisibilityModel:d};const u=Wr(t.columnTypes),f=Rt({apiRef:n,columnTypes:u,columnsToUpsert:t.columns,initialState:(l=t.initialState)==null?void 0:l.columns,shouldRegenColumnVisibilityModelFromColumns:!d,currentColumnVisibilityModel:(i=(c=t.columnVisibilityModel)!=null?c:(a=t.initialState)==null||(g=a.columns)==null?void 0:g.columnVisibilityModel)!=null?i:{},keepOnlyColumnsToUpsert:!0});return m({},e,{columns:f})};function fg(e,t){var n,o;const r=Me(e,"useGridColumns"),l=s.useMemo(()=>Wr(t.columnTypes),[t.columnTypes]),i=s.useRef(t.columns),c=s.useRef(l);e.current.unstable_registerControlState({stateId:"visibleColumns",propModel:t.columnVisibilityModel,propOnChange:t.onColumnVisibilityModelChange,stateSelector:ut,changeEvent:"columnVisibilityModelChange"});const a=s.useCallback(H=>{r.debug("Updating columns state."),e.current.setState(Go(H)),e.current.forceUpdate(),e.current.publishEvent("columnsChange",H.all)},[r,e]),g=s.useCallback(H=>Nt(e)[H],[e]),d=s.useCallback(()=>Ze(e),[e]),u=s.useCallback(()=>Oe(e),[e]),f=s.useCallback(()=>yi(e),[e]),C=s.useCallback((H,x=!0)=>(x?Oe(e):Ze(e)).findIndex(O=>O.field===H),[e]),P=s.useCallback(H=>{const x=C(H);return kt(e)[x]},[e,C]),b=s.useCallback(H=>{ut(e)!==H&&(e.current.setState(y=>m({},y,{columns:Rt({apiRef:e,columnTypes:l,columnsToUpsert:[],initialState:void 0,shouldRegenColumnVisibilityModelFromColumns:!1,currentColumnVisibilityModel:H,keepOnlyColumnsToUpsert:!1})})),e.current.forceUpdate())},[e,l]),p=s.useCallback(H=>{const x=Rt({apiRef:e,columnTypes:l,columnsToUpsert:H,initialState:void 0,shouldRegenColumnVisibilityModelFromColumns:!0,keepOnlyColumnsToUpsert:!1});a(x)},[e,a,l]),I=s.useCallback(H=>e.current.updateColumns([H]),[e]),$=s.useCallback((H,x)=>{if(e.current.unstable_caches.columns.isUsingColumnVisibilityModel){var y;const O=ut(e),V=(y=O[H])!=null?y:!0;if(x!==V){const R=m({},O,{[H]:x});e.current.setColumnVisibilityModel(R)}}else{const O=e.current.getColumn(H),V=m({},O,{hide:!x});e.current.updateColumns([V]);const R={field:H,colDef:V,isVisible:x};e.current.publishEvent("columnVisibilityChange",R)}},[e]),v=s.useCallback((H,x)=>{const y=Gt(e),O=y.findIndex(G=>G===H);if(O===x)return;r.debug(`Moving column ${H} to index ${x}`);const V=[...y],R=V.splice(O,1)[0];V.splice(x,0,R),a(m({},Mt(e.current.state),{all:V}));const D={field:H,element:e.current.getColumnHeaderElement(H),colDef:e.current.getColumn(H),targetIndex:x,oldIndex:O};e.current.publishEvent("columnOrderChange",D)},[e,r,a]),h=s.useCallback((H,x)=>{r.debug(`Updating column ${H} width to ${x}`);const y=e.current.getColumn(H),O=m({},y,{width:x});e.current.updateColumns([O]),e.current.publishEvent("columnWidthChange",{element:e.current.getColumnHeaderElement(H),colDef:O,width:x})},[e,r]);Ce(e,{getColumn:g,getAllColumns:d,getColumnIndex:C,getColumnPosition:P,getVisibleColumns:u,getColumnsMeta:f,updateColumn:I,updateColumns:p,setColumnVisibilityModel:b,setColumnVisibility:$,setColumnIndex:v,setColumnWidth:h});const F=s.useCallback((H,x)=>{const y={};if(e.current.unstable_caches.columns.isUsingColumnVisibilityModel){var O,V,R;const z=ut(e);(!x.exportOnlyDirtyModels||t.columnVisibilityModel!=null||Object.keys((O=(V=t.initialState)==null||(R=V.columns)==null?void 0:R.columnVisibilityModel)!=null?O:{}).length>0||Object.keys(z).length>0)&&(y.columnVisibilityModel=z)}y.orderedFields=Gt(e);const D=Ze(e),G={};return D.forEach(z=>{if(z.hasBeenResized){const N={};Kr.forEach(K=>{let W=z[K];W===1/0&&(W=-1),N[K]=W}),G[z.field]=N}}),Object.keys(G).length>0&&(y.dimensions=G),m({},H,{columns:y})},[e,t.columnVisibilityModel,(n=t.initialState)==null?void 0:n.columns]),S=s.useCallback((H,x)=>{var y;const O=e.current.unstable_caches.columns.isUsingColumnVisibilityModel?(y=x.stateToRestore.columns)==null?void 0:y.columnVisibilityModel:void 0,V=x.stateToRestore.columns;if(O==null&&V==null)return H;const R=Rt({apiRef:e,columnTypes:l,columnsToUpsert:[],initialState:V,shouldRegenColumnVisibilityModelFromColumns:!e.current.unstable_caches.columns.isUsingColumnVisibilityModel,currentColumnVisibilityModel:O,keepOnlyColumnsToUpsert:!1});return e.current.setState(Go(R)),V!=null&&e.current.publishEvent("columnsChange",R.all),H},[e,l]),w=s.useCallback((H,x)=>{if(x===vt.columns){var y;const O=t.components.ColumnsPanel;return _(O,m({},(y=t.componentsProps)==null?void 0:y.columnsPanel))}return H},[t.components.ColumnsPanel,(o=t.componentsProps)==null?void 0:o.columnsPanel]);De(e,"exportState",F),De(e,"restoreState",S),De(e,"preferencePanel",w);const E=s.useRef(null);Q(e,"viewportInnerSizeChange",H=>{E.current!==H.width&&(E.current=H.width,a(jr(Mt(e.current.state),H.width)))}),me(e,"columnVisibilityChange",t.onColumnVisibilityChange);const M=s.useCallback(()=>{r.info("Columns pipe processing have changed, regenerating the columns");const H=Rt({apiRef:e,columnTypes:l,columnsToUpsert:[],initialState:void 0,shouldRegenColumnVisibilityModelFromColumns:!e.current.unstable_caches.columns.isUsingColumnVisibilityModel,keepOnlyColumnsToUpsert:!1});a(H)},[e,r,a,l]);uo(e,"hydrateColumns",M);const A=s.useRef(!0);s.useEffect(()=>{if(A.current){A.current=!1;return}if(r.info(`GridColumns have changed, new length ${t.columns.length}`),i.current===t.columns&&c.current===l)return;const H=Rt({apiRef:e,columnTypes:l,initialState:void 0,shouldRegenColumnVisibilityModelFromColumns:!e.current.unstable_caches.columns.isUsingColumnVisibilityModel,columnsToUpsert:t.columns,keepOnlyColumnsToUpsert:!0});i.current=t.columns,c.current=l,a(H)},[r,e,a,t.columns,l]),s.useEffect(()=>{t.columnVisibilityModel!==void 0&&e.current.setColumnVisibilityModel(t.columnVisibilityModel)},[e,r,t.columnVisibilityModel])}const hg=e=>e.columnGrouping,Zr=ne(hg,e=>e.lookup),pg=["groupId","children"];function Cg(e){return e.groupPath!==void 0}const Jr=(e,t,n)=>{if(xr(e)){if(n[e.field]!==void 0)throw new Error(["MUI: columnGroupingModel contains duplicated field",`column field ${e.field} occurrs two times in the grouping model:`,`- ${n[e.field].join(" > ")}`,`- ${t.join(" > ")}`].join(`
`));n[e.field]=t;return}const{groupId:o,children:r}=e;r.forEach(l=>{Jr(l,[...t,o],n)})},el=e=>{if(!e)return{};const t={};return e.forEach(n=>{Jr(n,[],t)}),t},mo=e=>{let t={};return e.forEach(n=>{if(xr(n))return;const{groupId:o,children:r}=n,l=Z(n,pg);if(!o)throw new Error("MUI: An element of the columnGroupingModel does not have either `field` or `groupId`.");r||console.warn(`MUI: group groupId=${o} has no children.`);const i=m({},l,{groupId:o}),c=mo(r);if(c[o]!==void 0||t[o]!==void 0)throw new Error(`MUI: The groupId ${o} is used multiple times in the columnGroupingModel.`);t=m({},t,c,{[o]:i})}),m({},t)},bg=(e,t)=>{var n;const o=mo((n=t.columnGroupingModel)!=null?n:[]);return m({},e,{columnGrouping:{lookup:o,groupCollapsedModel:{}}})},wg=(e,t)=>{var n;const o=s.useCallback(c=>{var a,g;return(a=(g=Nt(e)[c])==null?void 0:g.groupPath)!=null?a:[]},[e]),r=s.useCallback(()=>Zr(e),[e]);Ce(e,{unstable_getColumnGroupPath:o,unstable_getAllGroupDetails:r});const i=s.useRef(!0);s.useEffect(()=>{var c,a;if(i.current){i.current=!1;return}if(!((c=t.experimentalFeatures)!=null&&c.columnGrouping))return;const g=mo((a=t.columnGroupingModel)!=null?a:[]);e.current.setState(d=>m({},d,{columnGrouping:m({},d.columnGrouping,{lookup:g})}))},[e,t.columnGroupingModel,(n=t.experimentalFeatures)==null?void 0:n.columnGrouping])},$n=.7,_n=1.3,tl=(e,t,n,o)=>{switch(e){case Zt.Compact:return{value:e,headerHeight:Math.floor(t*$n),rowHeight:Math.floor(n*$n),headerGroupingMaxDepth:o,factor:$n};case Zt.Comfortable:return{value:e,headerHeight:Math.floor(t*_n),rowHeight:Math.floor(n*_n),headerGroupingMaxDepth:o,factor:_n};default:return{value:e,headerHeight:t,rowHeight:n,headerGroupingMaxDepth:o,factor:1}}},vg=(e,t)=>{let n;if(t.columnGroupingModel==null||Object.keys(t.columnGroupingModel).length===0)n=0;else{const o=el(t.columnGroupingModel),r=e.columns,l=r.all.filter(i=>r.columnVisibilityModel[i]!==!1);l.length===0?n=0:n=Math.max(...l.map(i=>{var c,a;return(c=(a=o[i])==null?void 0:a.length)!=null?c:0}))}return m({},e,{density:tl(t.density,t.headerHeight,t.rowHeight,n)})},Sg=(e,t)=>{const n=ee(e,Oe),o=n.length>0?Math.max(...n.map(c=>{var a,g;return(a=(g=c.groupPath)==null?void 0:g.length)!=null?a:0})):0,r=Me(e,"useDensity"),l=s.useCallback((c,a=t.headerHeight,g=t.rowHeight,d=o)=>{r.debug(`Set grid density to ${c}`),e.current.setState(u=>{const f=Tt(u),C=tl(c,a,g,d);return dt(f,C)?u:m({},u,{density:C})}),e.current.forceUpdate()},[r,e,t.headerHeight,t.rowHeight,o]);s.useEffect(()=>{e.current.setDensity(t.density,t.headerHeight,t.rowHeight,o)},[e,t.density,t.rowHeight,t.headerHeight,o]),Ce(e,{setDensity:l})};function Pg(e,t="csv",n=document.title||"untitled"){const o=`${n}.${t}`;if("download"in HTMLAnchorElement.prototype){const r=URL.createObjectURL(e),l=document.createElement("a");l.href=r,l.download=o,l.click(),setTimeout(()=>{URL.revokeObjectURL(r)});return}throw new Error("MUI: exportAs not supported")}const nl=(e,t)=>{if(typeof e=="string"){const n=e.replace(/"/g,'""');return[t,`
`,"\r"].some(o=>n.includes(o))?`"${n}"`:n}return e};Je(["MUI: When the value of a field is an object or a `renderCell` is provided, the CSV export might not display the value correctly.","You can provide a `valueFormatter` with a string representation to be used."]);const yg=(e,t,n,o)=>t.map(r=>{const l=n(e,r.field);return nl(l.formattedValue,o)});function xg(e){const{columns:t,rowIds:n,getCellParams:o,delimiterCharacter:r,includeHeaders:l}=e,i=n.reduce((a,g)=>`${a}${yg(g,t,o,r).join(r)}\r
`,"").trim();return l?`${`${t.filter(a=>a.field!==sn.field).map(a=>nl(a.headerName||a.field,r)).join(r)}\r
`}${i}`.trim():i}const ol=({apiRef:e,options:t})=>{const n=Ze(e);return t.fields?t.fields.map(r=>n.find(l=>l.field===r)).filter(r=>!!r):(t.allColumns?n:Oe(e)).filter(r=>!r.disableExport)},Ig=({apiRef:e})=>{var t,n;const o=Ei(e),r=bt(e),l=e.current.getSelectedRows(),i=o.filter(d=>{var u;return((u=r[d].position)!=null?u:"body")==="body"}),c=tn(e),a=(c==null||(t=c.top)==null?void 0:t.map(d=>d.id))||[],g=(c==null||(n=c.bottom)==null?void 0:n.map(d=>d.id))||[];return i.unshift(...a),i.push(...g),l.size>0?i.filter(d=>l.has(d)):i},Eg=e=>{const t=Me(e,"useGridCsvExport"),n=s.useCallback((i={})=>{var c,a;t.debug("Get data as CSV");const g=ol({apiRef:e,options:i}),u=((c=i.getRowsToExport)!=null?c:Ig)({apiRef:e});return xg({columns:g,rowIds:u,getCellParams:e.current.getCellParams,delimiterCharacter:i.delimiter||",",includeHeaders:(a=i.includeHeaders)!=null?a:!0})},[t,e]),o=s.useCallback(i=>{t.debug("Export data as CSV");const c=n(i),a=new Blob([i!=null&&i.utf8WithBom?new Uint8Array([239,187,191]):"",c],{type:"text/csv"});Pg(a,"csv",i==null?void 0:i.fileName)},[t,n]);Ce(e,{getDataAsCsv:n,exportDataAsCsv:o});const l=s.useCallback((i,c)=>{var a;return(a=c.csvOptions)!=null&&a.disableToolbarButton?i:[...i,{component:_(Cd,{options:c.csvOptions}),componentName:"csvExport"}]},[]);De(e,"exportMenu",l)},en=e=>e.rowsMeta;function Mg(){return new Promise(e=>{requestAnimationFrame(()=>{e()})})}function kg(){const e=navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./);return e?parseInt(e[2],10):null}const Fg=(e,t)=>{const n=Me(e,"useGridPrintExport"),o=s.useRef(null),r=s.useRef(null),l=s.useRef({});s.useEffect(()=>{o.current=It(e.current.rootElementRef.current)},[e]);const i=s.useCallback((C,P)=>new Promise(b=>{if(!C&&!P){b();return}const p=ol({apiRef:e,options:{fields:C,allColumns:P}}).map(v=>v.field),I=Ze(e),$={};I.forEach(v=>{$[v.field]=p.includes(v.field)}),e.current.setColumnVisibilityModel($),b()}),[e]),c=s.useCallback(C=>{const P=document.createElement("iframe");return P.style.position="absolute",P.style.width="0px",P.style.height="0px",P.title=C||document.title,P},[]),a=s.useCallback((C,P)=>{var b,p;const I=m({copyStyles:!0,hideToolbar:!1,hideFooter:!1},P),$=C.contentDocument;if(!$)return;const v=rn(e),h=en(e.current.state),k=e.current.rootElementRef.current,F=k.cloneNode(!0),S=F.querySelector(`.${L.virtualScroller}`);S.style.height="auto",S.style.width="auto",S.parentElement.style.width="auto",S.parentElement.style.height="auto";const w=F.querySelector(`.${L.main}`);w.style.overflow="visible";const E=kg();E&&E>=108&&(F.style.contain="size");const M=F.querySelector(`.${L.columnHeaders}`).querySelector(`.${L.columnHeadersInner}`);M.style.width="100%";let A=((b=k.querySelector(`.${L.toolbarContainer}`))==null?void 0:b.clientHeight)||0,H=((p=k.querySelector(`.${L.footerContainer}`))==null?void 0:p.clientHeight)||0;if(I.hideToolbar){var x;(x=F.querySelector(`.${L.toolbarContainer}`))==null||x.remove(),A=0}if(I.hideFooter){var y;(y=F.querySelector(`.${L.footerContainer}`))==null||y.remove(),H=0}F.style.height=`${h.currentPageTotalHeight+v+A+H}px`;const O=document.createElement("div");O.appendChild(F),$.body.innerHTML=O.innerHTML;const V=typeof I.pageStyle=="function"?I.pageStyle():I.pageStyle;if(typeof V=="string"){const R=$.createElement("style");R.appendChild($.createTextNode(V)),$.head.appendChild(R)}if(I.bodyClassName&&$.body.classList.add(...I.bodyClassName.split(" ")),I.copyStyles){const R=o.current.querySelectorAll("style, link[rel='stylesheet']");for(let D=0;D<R.length;D+=1){const G=R[D];if(G.tagName==="STYLE"){const z=$.createElement(G.tagName),N=G.sheet;if(N){let K="";for(let W=0;W<N.cssRules.length;W+=1)typeof N.cssRules[W].cssText=="string"&&(K+=`${N.cssRules[W].cssText}\r
`);z.appendChild($.createTextNode(K)),$.head.appendChild(z)}}else if(G.getAttribute("href")){const z=$.createElement(G.tagName);for(let N=0;N<G.attributes.length;N+=1){const K=G.attributes[N];K&&z.setAttribute(K.nodeName,K.nodeValue||"")}$.head.appendChild(z)}}}C.contentWindow.print()},[e,o]),g=s.useCallback(C=>{var P,b;o.current.body.removeChild(C),e.current.restoreState(r.current||{}),(P=r.current)!=null&&(b=P.columns)!=null&&b.columnVisibilityModel||e.current.setColumnVisibilityModel(l.current),e.current.unstable_enableVirtualization(),r.current=null,l.current={}},[e]),u={exportDataAsPrint:s.useCallback(async C=>{if(n.debug("Export data as Print"),!e.current.rootElementRef.current)throw new Error("MUI: No grid root element available.");if(r.current=e.current.exportState(),l.current=ut(e),t.pagination){const b=Sr(e);e.current.setPageSize(b)}await i(C==null?void 0:C.fields,C==null?void 0:C.allColumns),e.current.unstable_disableVirtualization(),await Mg();const P=c(C==null?void 0:C.fileName);P.onload=()=>{a(P,C),P.contentWindow.matchMedia("print").addEventListener("change",p=>{p.matches===!1&&g(P)})},o.current.body.appendChild(P)},[t,n,e,c,a,g,i])};Ce(e,u);const f=s.useCallback((C,P)=>{var b;return(b=P.printOptions)!=null&&b.disableToolbarButton?C:[...C,{component:_(bd,{options:P.printOptions}),componentName:"printExport"}]},[]);De(e,"exportMenu",f)},Tg=["rowsBeforePartialUpdates"];function $g(e,t,n="A row was provided without id in the rows prop:"){if(e==null)throw new Error(["MUI: The data grid component requires all rows to have a unique `id` property.","Alternatively, you can use the `getRowId` prop to specify a custom id for each row.",n,JSON.stringify(t)].join(`
`))}const Vn=(e,t,n)=>{const o=t?t(e):e.id;return $g(o,e,n),o},gn=({rows:e,getRowId:t,loading:n,rowCount:o})=>{const r={rowsBeforePartialUpdates:e,loadingPropBeforePartialUpdates:n,rowCountPropBeforePartialUpdates:o,idRowsLookup:{},idToIdLookup:{},ids:[]};for(let l=0;l<e.length;l+=1){const i=e[l],c=Vn(i,t);r.idRowsLookup[c]=i,r.idToIdLookup[c]=c,r.ids.push(c)}return r},rl=({apiRef:e,previousTree:t,rowCountProp:n,loadingProp:o})=>{const r=e.current.unstable_caches.rows,l=Z(r,Tg),i=n??0,c=e.current.unstable_applyStrategyProcessor("rowTreeCreation",m({},l,{previousTree:t})),a=e.current.unstable_applyPipeProcessors("hydrateRows",c),g=a.treeDepth===1?a.ids.length:Object.values(a.tree).filter(d=>d.parent==null&&!d.isPinned).length;return m({},a,{groupingResponseBeforeRowHydration:c,loading:o,totalRowCount:Math.max(i,a.ids.length),totalTopLevelRowCount:Math.max(i,g)})},ll=(e,t,n)=>{var o;const r=(o=e[t])==null?void 0:o.children;if(r==null)return[];const l=[];for(let i=0;i<r.length;i+=1){const c=r[i],a=e[c];(!n||!a.isAutoGenerated)&&l.push(c),l.push(...ll(e,a.id,n))}return l};function sl(e){var t,n;const o=tn(e),r=(o==null||(t=o.top)==null?void 0:t.reduce((i,c)=>(i+=e.current.unstable_getRowHeight(c.id),i),0))||0,l=(o==null||(n=o.bottom)==null?void 0:n.reduce((i,c)=>(i+=e.current.unstable_getRowHeight(c.id),i),0))||0;return{top:r,bottom:l}}const Gn=(e,t)=>{const n=m({},e);if(n.id==null&&(n.id=Math.round(Math.random()*1e5)),n.operatorValue==null){const o=Nt(t)[n.columnField];n.operatorValue=o&&o.filterOperators[0].value}return n},_g=Je(["MUI: The `filterModel` can only contain a single item when the `disableMultipleColumnsFiltering` prop is set to `true`.","If you are using the community version of the `DataGrid`, this prop is always `true`."],"error"),Dg=Je("MUI: The 'id' field is required on `filterModel.items` when you use multiple filters.","error"),Rg=Je(["MUI: One of your filtering item have no `operatorValue` provided.","This property will become required on `@mui/x-data-grid@6.X`."]),il=(e,t,n)=>{const o=e.items.length>1;let r;o&&t?(_g(),r=[e.items[0]]):r=e.items;const l=o&&r.some(c=>c.id==null),i=r.some(c=>c.operatorValue==null);return l&&Dg(),i&&Rg(),i||l?m({},e,{items:r.map(c=>Gn(c,n))}):e.items!==r?m({},e,{items:r}):e},Qo=(e,t,n)=>o=>m({},o,{filterModel:il(e,t,n)}),al=(e,t)=>{if(!e.columnField||!e.operatorValue)return null;const n=t.current.getColumn(e.columnField);if(!n)return null;let o;if(n.valueParser){var r;const d=n.valueParser;o=Array.isArray(e.value)?(r=e.value)==null?void 0:r.map(u=>d(u)):d(e.value)}else o=e.value;const l=m({},e,{value:o}),i=n.filterOperators;if(!(i!=null&&i.length))throw new Error(`MUI: No filter operators found for column '${n.field}'.`);const c=i.find(d=>d.value===l.operatorValue);if(!c)throw new Error(`MUI: No filter operator found for column '${n.field}' and operator value '${l.operatorValue}'.`);const a=c.getApplyFilterFn(l,n);return typeof a!="function"?null:{fn:d=>{const u=t.current.getCellParams(d,l.columnField);return a(u)},item:l}},Og=(e,t)=>{const{items:n}=e,o=n.map(r=>al(r,t)).filter(r=>!!r);return o.length===0?null:(r,l)=>{const i={};return(l?o.filter(a=>l(a.item.columnField)):o).forEach(a=>{i[a.item.id]=a.fn(r)}),i}},Hg=(e,t)=>{const{quickFilterValues:n=[]}=e;if(n.length===0)return null;const o=Gt(t),r={};o.forEach(i=>{const c=t.current.getColumn(i),a=c==null?void 0:c.getApplyQuickFilterFn;a&&(r[i]=n.map(g=>a(g,c,t)))});const l=n.filter((i,c)=>Object.keys(r).some(a=>r[a][c]!=null));return l.length===0?null:(i,c)=>{const a={},g=[];Object.keys(r).forEach(u=>{(!c||c(u))&&(a[u]=t.current.getCellParams(i,u),g.push(u))});const d={};return l.forEach((u,f)=>{const C=g.some(P=>{var b,p;return r[P][f]==null?!1:(b=(p=r[P])[f])==null?void 0:b.call(p,a[P])});d[u]=C}),d}},Lg=(e,t)=>{const n=Og(e,t),o=Hg(e,t);return(r,l)=>({passingFilterItems:n&&n(r,l),passingQuickFilterValues:o&&o(r,l)})},Vg=(e,t,n,o)=>{var r,l;const i=n.items.filter(u=>al(u,o)!==null),c=e.filter(u=>u!=null),a=t.filter(u=>u!=null),g=(r=n.quickFilterLogicOperator)!=null?r:Jt().quickFilterLogicOperator,d=(l=n.linkOperator)!=null?l:Jt().linkOperator;if(c.length>0){const u=f=>c.some(C=>C[f.id]);if(d===He.And){if(!i.every(u))return!1}else if(!i.some(u))return!1}if(a.length>0&&n.quickFilterValues!=null){const u=f=>a.some(C=>C[f]);if(g===He.And){if(!n.quickFilterValues.every(u))return!1}else if(!n.quickFilterValues.some(u))return!1}return!0},Gg=(e,t,n)=>{var o,r,l,i;const c=(o=(r=t.filterModel)!=null?r:(l=t.initialState)==null||(i=l.filter)==null?void 0:i.filterModel)!=null?o:Jt();return m({},e,{filter:{filterModel:il(c,t.disableMultipleColumnsFiltering,n),visibleRowsLookup:{},filteredDescendantCountLookup:{}}})},Ag=(e,t)=>{var n,o,r;const l=Me(e,"useGridFilter");e.current.unstable_registerControlState({stateId:"filter",propModel:t.filterModel,propOnChange:t.onFilterModelChange,stateSelector:Ge,changeEvent:"filterModelChange"});const i=s.useCallback(()=>{e.current.setState(w=>{const E=Ge(w,e.current.instanceId),T=t.filterMode===Lt.client?Lg(E,e):null,M=e.current.unstable_applyStrategyProcessor("filtering",{isRowMatchingFilters:T,filterModel:E??Jt()});return m({},w,{filter:m({},w.filter,M)})}),e.current.publishEvent("filteredRowsSet")},[t.filterMode,e]),c=s.useCallback(()=>{i(),e.current.forceUpdate()},[e,i]),a=s.useCallback(w=>{const E=Ge(e),T=[...E.items],M=T.findIndex(A=>A.id===w.id);M===-1?T.push(w):T[M]=w,e.current.setFilterModel(m({},E,{items:T}),"upsertFilterItem")},[e]),g=s.useCallback(w=>{const E=Ge(e),T=[...E.items];w.forEach(M=>{const A=w.findIndex(H=>H.id===M.id);A===-1?T.push(M):T[A]=M}),e.current.setFilterModel(m({},E,{items:w}),"upsertFilterItems")},[e]),d=s.useCallback(w=>{const E=Ge(e),T=E.items.filter(M=>M.id!==w.id);T.length!==E.items.length&&e.current.setFilterModel(m({},E,{items:T}),"deleteFilterItem")},[e]),u=s.useCallback(w=>{if(l.debug("Displaying filter panel"),w){const E=Ge(e),T=E.items.filter(H=>{var x;if(H.value!==void 0)return!0;const O=(x=e.current.getColumn(H.columnField).filterOperators)==null?void 0:x.find(R=>R.value===H.operatorValue);return!(typeof(O==null?void 0:O.requiresFilterValue)>"u"?!0:O==null?void 0:O.requiresFilterValue)});let M;T.find(H=>H.columnField===w)?M=T:t.disableMultipleColumnsFiltering?M=[Gn({columnField:w},e)]:M=[...T,Gn({columnField:w},e)],e.current.setFilterModel(m({},E,{items:M}))}e.current.showPreferences(vt.filters)},[e,l,t.disableMultipleColumnsFiltering]),f=s.useCallback(()=>{l.debug("Hiding filter panel"),e.current.hidePreferences()},[e,l]),C=s.useCallback(w=>{const E=Ge(e);E.linkOperator!==w&&e.current.setFilterModel(m({},E,{linkOperator:w}),"changeLogicOperator")},[e]),P=s.useCallback(w=>{const E=Ge(e);dt(E.quickFilterValues,w)||e.current.setFilterModel(m({},E,{quickFilterValues:[...w]}))},[e]),b=s.useCallback((w,E)=>{Ge(e)!==w&&(l.debug("Setting filter model"),e.current.unstable_updateControlState("filter",Qo(w,t.disableMultipleColumnsFiltering,e),E),e.current.unstable_applyFilters())},[e,l,t.disableMultipleColumnsFiltering]),p=s.useCallback(()=>{const w=gt(e);return new Map(w.map(E=>[E.id,E.model]))},[e]);Ce(e,{setFilterLinkOperator:C,unstable_applyFilters:c,deleteFilterItem:d,upsertFilterItem:a,upsertFilterItems:g,setFilterModel:b,showFilterPanel:u,hideFilterPanel:f,getVisibleRowModels:p,setQuickFilterValues:P});const $=s.useCallback((w,E)=>{var T,M;const A=Ge(e);return!E.exportOnlyDirtyModels||t.filterModel!=null||((T=t.initialState)==null||(M=T.filter)==null?void 0:M.filterModel)!=null||!dt(A,Jt())?m({},w,{filter:{filterModel:A}}):w},[e,t.filterModel,(n=t.initialState)==null||(o=n.filter)==null?void 0:o.filterModel]),v=s.useCallback((w,E)=>{var T;const M=(T=E.stateToRestore.filter)==null?void 0:T.filterModel;return M==null?w:(e.current.unstable_updateControlState("filter",Qo(M,t.disableMultipleColumnsFiltering,e),"restoreState"),m({},w,{callbacks:[...w.callbacks,e.current.unstable_applyFilters]}))},[e,t.disableMultipleColumnsFiltering]),h=s.useCallback((w,E)=>{if(E===vt.filters){var T;const M=t.components.FilterPanel;return _(M,m({},(T=t.componentsProps)==null?void 0:T.filterPanel))}return w},[t.components.FilterPanel,(r=t.componentsProps)==null?void 0:r.filterPanel]),k=s.useCallback(w=>{if(t.filterMode===Lt.client&&w.isRowMatchingFilters){const E=xt(e),T={};for(let M=0;M<E.length;M+=1){const A=E[M];let H;if(typeof A=="string"&&A.startsWith("auto-generated-group-footer"))H=!0;else{const{passingFilterItems:x,passingQuickFilterValues:y}=w.isRowMatchingFilters(A);H=Vg([x],[y],w.filterModel,e)}T[A]=H}return{filteredRowsLookup:T,visibleRowsLookup:T,filteredDescendantCountLookup:{}}}return{visibleRowsLookup:{},filteredRowsLookup:{},filteredDescendantCountLookup:{}}},[e,t.filterMode]);De(e,"exportState",$),De(e,"restoreState",v),De(e,"preferencePanel",h),go(e,cn,"filtering",k);const F=s.useCallback(()=>{l.debug("onColUpdated - GridColumns changed, applying filters");const w=Ge(e),E=Pi(e),T=w.items.filter(M=>M.columnField&&E[M.columnField]);T.length<w.items.length&&e.current.setFilterModel(m({},w,{items:T}))},[e,l]),S=s.useCallback(w=>{w==="filtering"&&e.current.unstable_applyFilters()},[e]);Q(e,"rowsSet",i),Q(e,"rowExpansionChange",e.current.unstable_applyFilters),Q(e,"columnsChange",F),Q(e,"activeStrategyProcessorChange",S),an(()=>{e.current.unstable_applyFilters()}),s.useEffect(()=>{t.filterModel!==void 0&&e.current.setFilterModel(t.filterModel)},[e,l,t.filterModel])},Bg=e=>m({},e,{focus:{cell:null,columnHeader:null},tabIndex:{cell:null,columnHeader:null}}),zg=(e,t)=>{const n=Me(e,"useGridFocus"),o=s.useRef(null),r=s.useCallback((p,I)=>{p&&e.current.getRow(p.id)&&e.current.publishEvent("cellFocusOut",e.current.getCellParams(p.id,p.field),I)},[e]),l=s.useCallback((p,I)=>{const $=Qe(e);($==null?void 0:$.id)===p&&($==null?void 0:$.field)===I||(e.current.setState(v=>(n.debug(`Focusing on cell with id=${p} and field=${I}`),m({},v,{tabIndex:{cell:{id:p,field:I},columnHeader:null},focus:{cell:{id:p,field:I},columnHeader:null}}))),e.current.forceUpdate(),e.current.getRow(p)&&($&&r($,{}),e.current.publishEvent("cellFocusIn",e.current.getCellParams(p,I))))},[e,n,r]),i=s.useCallback((p,I={})=>{const $=Qe(e);r($,I),e.current.setState(v=>(n.debug(`Focusing on column header with colIndex=${p}`),m({},v,{tabIndex:{columnHeader:{field:p},cell:null},focus:{columnHeader:{field:p},cell:null}}))),e.current.forceUpdate()},[e,n,r]),c=s.useCallback((p,I,$)=>{let v=e.current.getColumnIndex(I),h=e.current.getRowIndexRelativeToVisibleRows(p);const k=Oe(e);$==="right"?v+=1:$==="left"?v-=1:h+=1;const F=In(e,{pagination:t.pagination,paginationMode:t.paginationMode});v>=k.length?(h+=1,h<F.rows.length&&(v=0)):v<0&&(h-=1,h>=0&&(v=k.length-1)),h=At(h,0,F.rows.length-1);const S=F.rows[h],w=e.current.unstable_getCellColSpanInfo(S.id,v);w&&w.spannedByColSpan&&($==="left"||$==="below"?v=w.leftVisibleCellIndex:$==="right"&&(v=w.rightVisibleCellIndex)),v=At(v,0,k.length-1);const E=k[v];e.current.setCellFocus(S.id,E.field)},[e,t.pagination,t.paginationMode]),a=s.useCallback(({id:p,field:I})=>{e.current.setCellFocus(p,I)},[e]),g=s.useCallback((p,I)=>{I.key==="Enter"||I.key==="Tab"||ln(I.key)||e.current.setCellFocus(p.id,p.field)},[e]),d=s.useCallback(({field:p},I)=>{I.target===I.currentTarget&&e.current.setColumnHeaderFocus(p,I)},[e]),u=s.useCallback(()=>{n.debug("Clearing focus"),e.current.setState(p=>m({},p,{focus:{cell:null,columnHeader:null}}))},[n,e]),f=s.useCallback(p=>{o.current=p},[]),C=s.useCallback(p=>{const I=o.current;o.current=null;const $=Qe(e);if(!$){I&&e.current.setCellFocus(I.id,I.field);return}if((I==null?void 0:I.id)===$.id&&(I==null?void 0:I.field)===$.field)return;const v=e.current.getCellElement($.id,$.field);v!=null&&v.contains(p.target)||(I?e.current.setCellFocus(I.id,I.field):(e.current.setState(h=>m({},h,{focus:{cell:null,columnHeader:null}})),e.current.forceUpdate(),r($,p)))},[e,r]),P=s.useCallback(p=>{if(p.cellMode==="view")return;const I=Qe(e);((I==null?void 0:I.id)!==p.id||(I==null?void 0:I.field)!==p.field)&&e.current.setCellFocus(p.id,p.field)},[e]),b=s.useCallback(()=>{const p=Qe(e);p&&!e.current.getRow(p.id)&&e.current.setState(I=>m({},I,{focus:{cell:null,columnHeader:null}}))},[e]);Ce(e,{setCellFocus:l,setColumnHeaderFocus:i,unstable_moveFocusToRelativeCell:c}),s.useEffect(()=>{const p=It(e.current.rootElementRef.current);return p.addEventListener("click",C),()=>{p.removeEventListener("click",C)}},[e,C]),Q(e,"columnHeaderBlur",u),Q(e,"cellDoubleClick",a),Q(e,"cellMouseDown",f),Q(e,"cellKeyDown",g),Q(e,"cellModeChange",P),Q(e,"columnHeaderFocus",d),Q(e,"rowsSet",b)};function Ng(e,t){const n=tn(e)||{};return[...n.top||[],...t,...n.bottom||[]]}const Ug=(e,t)=>{const n=Me(e,"useGridKeyboardNavigation"),o=$t(e,t).rows,r=s.useMemo(()=>Ng(e,o),[e,o]),l=s.useCallback((u,f,C="left")=>{const P=gt(e),b=e.current.unstable_getCellColSpanInfo(f,u);b&&b.spannedByColSpan&&(C==="left"?u=b.leftVisibleCellIndex:C==="right"&&(u=b.rightVisibleCellIndex));const p=P.findIndex($=>$.id===f);n.debug(`Navigating to cell row ${p}, col ${u}`),e.current.scrollToIndexes({colIndex:u,rowIndex:p});const I=e.current.getVisibleColumns()[u].field;e.current.setCellFocus(f,I)},[e,n]),i=s.useCallback((u,f)=>{n.debug(`Navigating to header col ${u}`),e.current.scrollToIndexes({colIndex:u});const C=e.current.getVisibleColumns()[u].field;e.current.setColumnHeaderFocus(C,f)},[e,n]),c=s.useCallback(u=>r[u].id,[r]),a=s.useCallback((u,f)=>{const C=e.current.getRootDimensions();if(r.length===0||!C)return;const P=e.current.unstable_getViewportPageSize(),b=u.field?e.current.getColumnIndex(u.field):0,p=r.findIndex(F=>F.id===u.id),I=0,$=r.length-1,v=0,h=Oe(e).length-1;let k=!0;switch(f.key){case"ArrowDown":case"Enter":{p<$&&l(b,c(p+1));break}case"ArrowUp":{p>I?l(b,c(p-1)):i(b,f);break}case"ArrowRight":{b<h&&l(b+1,c(p),"right");break}case"ArrowLeft":{b>v&&l(b-1,c(p));break}case"Tab":{f.shiftKey&&b>v?l(b-1,c(p),"left"):!f.shiftKey&&b<h&&l(b+1,c(p),"right");break}case" ":{if(u.field===co)break;const S=u.colDef;if(S&&S.type==="treeDataGroup")break;!f.shiftKey&&p<$&&l(b,c(Math.min(p+P,$)));break}case"PageDown":{p<$&&l(b,c(Math.min(p+P,$)));break}case"PageUp":{const F=Math.max(p-P,I);F!==p&&F>=I?l(b,c(F)):i(b,f);break}case"Home":{f.ctrlKey||f.metaKey||f.shiftKey?l(v,c(I)):l(v,c(p));break}case"End":{f.ctrlKey||f.metaKey||f.shiftKey?l(h,c($)):l(h,c(p));break}default:k=!1}k&&f.preventDefault()},[e,r,l,i,c]),g=s.useCallback((u,f)=>{const C=f.currentTarget.querySelector(`.${L.columnHeaderTitleContainerContent}`);if(!!C&&C.contains(f.target)&&u.field!==sn.field||!e.current.getRootDimensions())return;const p=e.current.unstable_getViewportPageSize(),I=u.field?e.current.getColumnIndex(u.field):0,$=0,v=r.length-1,h=0,k=Oe(e).length-1;let F=!0;switch(f.key){case"ArrowDown":{l(I,c($));break}case"ArrowRight":{I<k&&i(I+1,f);break}case"ArrowLeft":{I>h&&i(I-1,f);break}case"PageDown":{v!==null&&l(I,c(Math.min($+p,v)));break}case"Home":{i(h,f);break}case"End":{i(k,f);break}case"Enter":{(f.ctrlKey||f.metaKey)&&e.current.toggleColumnMenu(u.field);break}case" ":break;default:F=!1}F&&f.preventDefault()},[e,r,l,i,c]),d=s.useCallback((u,f)=>{if(!f.currentTarget.contains(f.target))return;const C=e.current.getCellParams(u.id,u.field);C.cellMode!==ue.Edit&&ln(f.key)&&e.current.publishEvent("cellNavigationKeyDown",C,f)},[e]);Q(e,"cellNavigationKeyDown",a),Q(e,"columnHeaderKeyDown",g),Q(e,"cellKeyDown",d)},cl=e=>e?0:100,Xo=e=>t=>m({},t,{pagination:m({},t.pagination,{pageSize:e})}),Kg=(e,t)=>{var n,o;const r=Me(e,"useGridPageSize"),l=ee(e,on);e.current.unstable_registerControlState({stateId:"pageSize",propModel:t.pageSize,propOnChange:t.onPageSizeChange,stateSelector:Qt,changeEvent:"pageSizeChange"});const c={setPageSize:s.useCallback(u=>{u!==Qt(e)&&(r.debug(`Setting page size to ${u}`),e.current.setState(Xo(u)),e.current.forceUpdate())},[e,r])};Ce(e,c);const a=s.useCallback((u,f)=>{var C,P;const b=Qt(e);return!f.exportOnlyDirtyModels||t.pageSize!=null||((C=t.initialState)==null||(P=C.pagination)==null?void 0:P.pageSize)!=null||b!==cl(t.autoPageSize)?m({},u,{pagination:m({},u.pagination,{pageSize:b})}):u},[e,t.pageSize,(n=t.initialState)==null||(o=n.pagination)==null?void 0:o.pageSize,t.autoPageSize]),g=s.useCallback((u,f)=>{var C;const P=(C=f.stateToRestore.pagination)==null?void 0:C.pageSize;return P!=null&&e.current.setState(Xo(P)),u},[e]);De(e,"exportState",a),De(e,"restoreState",g);const d=s.useCallback(()=>{const u=e.current.getRootDimensions();if(!t.autoPageSize||!u)return;const f=sl(e),C=Math.floor((u.viewportInnerSize.height-f.top-f.bottom)/l);e.current.setPageSize(C)},[e,t.autoPageSize,l]);Q(e,"viewportInnerSizeChange",d),s.useEffect(()=>{t.pageSize!=null&&!t.autoPageSize&&e.current.setPageSize(t.pageSize)},[e,t.autoPageSize,t.pageSize]),s.useEffect(()=>{d()},[d])},An=(e,t)=>t>0&&e>0?Math.ceil(e/t):0,Bn=e=>e.pageCount?m({},e,{page:Math.max(Math.min(e.page,e.pageCount-1),0)}):e,Zo=e=>t=>m({},t,{pagination:Bn(m({},t.pagination,{page:e}))});Je(["MUI: the 'rowCount' prop is undefined while using paginationMode='server'","For more detail, see http://mui.com/components/data-grid/pagination/#basic-implementation"],"error");const Wg=(e,t)=>{var n,o;const r=Me(e,"useGridPage"),l=ee(e,Pr);e.current.unstable_registerControlState({stateId:"page",propModel:t.page,propOnChange:t.onPageChange,stateSelector:jt,changeEvent:"pageChange"});const c={setPage:s.useCallback(f=>{r.debug(`Setting page to ${f}`),e.current.setState(Zo(f)),e.current.forceUpdate()},[e,r])};Ce(e,c);const a=s.useCallback((f,C)=>{var P,b;const p=jt(e);return!C.exportOnlyDirtyModels||t.page!=null||((P=t.initialState)==null||(b=P.pagination)==null?void 0:b.page)!=null||p!==0?m({},f,{pagination:m({},f.pagination,{page:p})}):f},[e,t.page,(n=t.initialState)==null||(o=n.pagination)==null?void 0:o.page]),g=s.useCallback((f,C)=>{var P,b;const p=(P=(b=C.stateToRestore.pagination)==null?void 0:b.page)!=null?P:jt(e);return e.current.setState(Zo(p)),f},[e]);De(e,"exportState",a),De(e,"restoreState",g);const d=f=>{e.current.setState(C=>{const P=An(C.pagination.rowCount,f);return m({},C,{pagination:Bn(m({},C.pagination,{pageCount:P,page:C.pagination.page}))})}),e.current.forceUpdate()},u=()=>e.current.scrollToIndexes({rowIndex:jt(e)*Qt(e)});Q(e,"pageSizeChange",d),Q(e,"pageChange",u),s.useEffect(()=>{},[t.rowCount,t.paginationMode]),s.useEffect(()=>{e.current.setState(f=>{const C=t.rowCount!==void 0?t.rowCount:l,P=An(C,f.pagination.pageSize),b=t.page==null?f.pagination.page:t.page;return m({},f,{pagination:Bn(m({},f.pagination,{page:b,rowCount:C,pageCount:P}))})}),e.current.forceUpdate()},[l,t.rowCount,t.page,t.paginationMode,e])},jg=(e,t)=>{var n,o,r,l,i,c,a,g;let d;return t.pageSize!=null?d=t.pageSize:((n=t.initialState)==null||(o=n.pagination)==null?void 0:o.pageSize)!=null?d=t.initialState.pagination.pageSize:d=cl(t.autoPageSize),m({},e,{pagination:{pageSize:d,page:(r=(l=t.page)!=null?l:(i=t.initialState)==null||(c=i.pagination)==null?void 0:c.page)!=null?r:0,pageCount:An((a=t.rowCount)!=null?a:0,d),rowCount:(g=t.rowCount)!=null?g:0}})},qg=(e,t)=>{Kg(e,t),Wg(e,t)},Yg=(e,t)=>{var n,o;return m({},e,{preferencePanel:(n=(o=t.initialState)==null?void 0:o.preferencePanel)!=null?n:{open:!1}})},Qg=(e,t)=>{var n;const o=Me(e,"useGridPreferencesPanel"),r=s.useRef(),l=s.useRef(),i=s.useCallback(()=>{o.debug("Hiding Preferences Panel");const f=Cn(e.current.state);f.openedPanelValue&&e.current.publishEvent("preferencePanelClose",{openedPanelValue:f.openedPanelValue}),e.current.setState(C=>m({},C,{preferencePanel:{open:!1}})),e.current.forceUpdate()},[e,o]),c=s.useCallback(()=>{l.current=setTimeout(()=>clearTimeout(r.current),0)},[]),a=s.useCallback(()=>{r.current=setTimeout(i,100)},[i]),g=s.useCallback(f=>{o.debug("Opening Preferences Panel"),c(),e.current.setState(C=>m({},C,{preferencePanel:m({},C.preferencePanel,{open:!0,openedPanelValue:f})})),e.current.publishEvent("preferencePanelOpen",{openedPanelValue:f}),e.current.forceUpdate()},[o,c,e]);Ce(e,{showPreferences:g,hidePreferences:a});const d=s.useCallback((f,C)=>{var P;const b=Cn(e.current.state);return!C.exportOnlyDirtyModels||((P=t.initialState)==null?void 0:P.preferencePanel)!=null||b.open?m({},f,{preferencePanel:b}):f},[e,(n=t.initialState)==null?void 0:n.preferencePanel]),u=s.useCallback((f,C)=>{const P=C.stateToRestore.preferencePanel;return P!=null&&e.current.setState(b=>m({},b,{preferencePanel:P})),f},[e]);De(e,"exportState",d),De(e,"restoreState",u),s.useEffect(()=>()=>{clearTimeout(r.current),clearTimeout(l.current)},[])},ye=e=>e.editRows;function Jo(e){return typeof e.then=="function"}const Xg=(e,t)=>{var n;const o=Me(e,"useGridEditRows"),r=v=>(...h)=>{t.editMode===Re.Cell&&v(...h)},l=s.useCallback((v,h,k)=>{e.current.getCellMode(v,h)!==k&&(o.debug(`Switching cell id: ${v} field: ${h} to mode: ${k}`),e.current.setState(F=>{const S=m({},F.editRows);return S[v]=m({},S[v]),k===ue.Edit?S[v][h]={value:e.current.getCellValue(v,h)}:(delete S[v][h],Object.keys(S[v]).length||delete S[v]),m({},F,{editRows:S})}),e.current.forceUpdate(),e.current.publishEvent("cellModeChange",e.current.getCellParams(v,h)))},[e,o]),i=s.useCallback((v,h)=>{const k=ye(e.current.state);return k[v]&&k[v][h]?ue.Edit:ue.View},[e]),c=s.useCallback((v,h={})=>{var k;const{id:F,field:S}=v;e.current.unstable_runPendingEditCellValueMutation(F,S);const w=e.current.getEditRowsModel();if(!w[F]||!w[F][S])throw new Error(`MUI: Cell at id: ${F} and field: ${S} is not in edit mode.`);const E=w[F][S],T=e.current.getColumn(S),M=e.current.getRow(F);if((k=t.experimentalFeatures)!=null&&k.preventCommitWhileValidating){const x=w[F][S];if(x.isValidating||x.error)return!1}const A=m({},v,{value:E.value});let H=!!E.error;if(!H&&typeof T.preProcessEditCellProps=="function"){const x=T.preProcessEditCellProps({id:F,row:M,props:E});if(Jo(x))return x.then(y=>(e.current.unstable_setEditCellProps({id:F,field:S,props:y}),y.error?!1:(e.current.publishEvent("cellEditCommit",A,h),!0)));e.current.unstable_setEditCellProps({id:F,field:S,props:x}),H=!!x.error}return H?!1:(e.current.publishEvent("cellEditCommit",A,h),!0)},[e,(n=t.experimentalFeatures)==null?void 0:n.preventCommitWhileValidating]),a=s.useCallback(v=>{const h=e.current.getColumn(v.field),k=e.current.getRow(v.id);return new Promise(F=>{let S={value:v.value};const E=e.current.getEditRowsModel()[v.id][v.field];if(typeof h.preProcessEditCellProps!="function"){e.current.unstable_setEditCellProps(m({},v,{props:S})),F(!0);return}S=e.current.unstable_setEditCellProps(m({},v,{props:m({},E,{isValidating:!0})})),Promise.resolve(h.preProcessEditCellProps({id:v.id,row:k,props:m({},S,{value:e.current.unstable_parseValue(v.id,v.field,v.value)})})).then(T=>{e.current.unstable_setEditCellProps(m({},v,{props:m({},T,{isValidating:!1})})),F(!T.error)})})},[e]);Ce(e,{setCellMode:l,getCellMode:i,commitCellChange:c,unstable_setCellEditingEditCellValue:a});const d=s.useCallback(async(v,h)=>{if(h.which===229)return;const{id:k,field:F,cellMode:S,isEditable:w}=v;if(!w)return;const E=S===ue.Edit,T=h.ctrlKey||h.metaKey||h.altKey;if(!E&&fa(h)&&!T&&!(h.key===" "&&h.shiftKey)&&e.current.publishEvent("cellEditStart",v,h),!E&&Rn(h.key)&&(e.current.setEditCellValue({id:k,field:F,value:""}),e.current.commitCellChange({id:k,field:F},h),e.current.publishEvent("cellEditStop",v,h)),E&&Oo(h.key)){const M={id:k,field:F};if(!await e.current.commitCellChange(M,h))return}E&&ha(h.key)&&e.current.publishEvent("cellEditStop",v,h)},[e]),u=s.useCallback((v,h)=>{v.isEditable&&e.current.publishEvent("cellEditStart",v,h)},[e]),f=async(v,h)=>{v.cellMode!==ue.View&&(await e.current.commitCellChange(v,h),e.current.publishEvent("cellEditStop",v,h))},C=je((v,h)=>{f(v,h)}),P=je(()=>{const v=Qe(e);if(!v)return;const h=e.current.getCellParams(v.id,v.field);f(h,{})}),b=s.useCallback((v,h)=>{v.isEditable&&(e.current.setCellMode(v.id,v.field,ue.Edit),On(h)&&yn(h)&&e.current.unstable_setEditCellProps({id:v.id,field:v.field,props:{value:""}}))},[e]),p=s.useCallback((v,h)=>{if(e.current.setCellMode(v.id,v.field,ue.View),!!On(h)){if(Oo(h.key)){e.current.publishEvent("cellNavigationKeyDown",v,h);return}(h.key==="Escape"||Rn(h.key))&&e.current.setCellFocus(v.id,v.field)}},[e]),I=s.useCallback(v=>{const{id:h,field:k}=v,F=e.current.getEditRowsModel(),{value:S}=F[h][k];o.debug(`Setting cell id: ${h} field: ${k} to value: ${S==null?void 0:S.toString()}`);const w=e.current.getRow(h);if(w){const E=e.current.getColumn(v.field);let T=m({},w,{[k]:S});E.valueSetter&&(T=E.valueSetter({row:w,value:S})),e.current.updateRows([T])}},[e,o]),$=s.useCallback(v=>{const h=e.current.getRow(v.id),k=e.current.getColumn(v.field),F=k.preProcessEditCellProps?k.preProcessEditCellProps({id:v.id,row:h,props:v.props}):v.props;Jo(F)?F.then(S=>{e.current.unstable_setEditCellProps(m({},v,{props:S}))}):e.current.unstable_setEditCellProps(m({},v,{props:F}))},[e]);Q(e,"cellKeyDown",r(d)),Q(e,"cellDoubleClick",r(u)),Q(e,"cellFocusOut",r(C)),Q(e,"columnHeaderDragStart",r(P)),Q(e,"cellEditStart",r(b)),Q(e,"cellEditStop",r(p)),Q(e,"cellEditCommit",r(I)),Q(e,"editCellPropsChange",r($)),me(e,"cellEditCommit",t.onCellEditCommit),me(e,"cellEditStart",t.onCellEditStart),me(e,"cellEditStop",t.onCellEditStop)},Zg=(e,t)=>{var n,o;const r=s.useRef(null),l=s.useRef(null),i=ee(e,Ze),c=S=>(...w)=>{t.editMode===Re.Row&&S(...w)},a=s.useCallback((S,w)=>{w!==e.current.getRowMode(S)&&(e.current.setState(E=>{const T=m({},E.editRows);return w===he.Edit?(T[S]={},i.forEach(M=>{const A=e.current.getCellParams(S,M.field);A.isEditable&&(T[S][M.field]={value:A.value})})):delete T[S],m({},E,{editRows:T})}),e.current.forceUpdate())},[e,i]),g=s.useCallback(S=>t.editMode===Re.Cell?he.View:ye(e.current.state)[S]?he.Edit:he.View,[e,t.editMode]),d=s.useCallback((S,w={})=>{var E;if(t.editMode===Re.Cell)throw new Error("MUI: You can't commit changes when the edit mode is 'cell'.");e.current.unstable_runPendingEditCellValueMutation(S);const M=e.current.getEditRowsModel()[S];if(!M)throw new Error(`MUI: Row at id: ${S} is not being edited.`);if((E=t.experimentalFeatures)!=null&&E.preventCommitWhileValidating&&!Object.keys(M).reduce((y,O)=>y&&!M[O].isValidating&&!M[O].error,!0)||Object.values(M).some(x=>!!x.error))return!1;const H=Object.keys(M).filter(x=>typeof e.current.getColumn(x).preProcessEditCellProps=="function");if(H.length>0){const x=e.current.getRow(S),y=H.map(async O=>{const V=e.current.getColumn(O),R=await Promise.resolve(V.preProcessEditCellProps({id:S,row:x,props:M[O]}));return e.current.unstable_setEditCellProps({id:S,field:O,props:R}),R.error});return Promise.all(y).then(O=>O.some(V=>!!V)?!1:(e.current.publishEvent("rowEditCommit",S,w),!0))}return e.current.publishEvent("rowEditCommit",S,w),!0},[e,t.editMode,(n=t.experimentalFeatures)==null?void 0:n.preventCommitWhileValidating]),u=s.useCallback(S=>{const E=e.current.getEditRowsModel()[S.id],T=e.current.getRow(S.id);let M=!0;return new Promise(A=>{Object.keys(E).forEach(async H=>{const x=e.current.getColumn(H);let y=H===S.field?{value:S.value}:E[H];y=e.current.unstable_setEditCellProps({id:S.id,field:H,props:m({},y,{isValidating:!0})}),x.preProcessEditCellProps&&(y=await Promise.resolve(x.preProcessEditCellProps({id:S.id,row:T,props:m({},y,{value:H===S.field?e.current.unstable_parseValue(S.id,H,S.value):y.value})}))),y.error&&(M=!1),e.current.unstable_setEditCellProps({id:S.id,field:H,props:m({},y,{isValidating:!1})})}),A(M)})},[e]);Ce(e,{setRowMode:a,getRowMode:g,commitRowChange:d,unstable_setRowEditingEditCellValue:u});const C=s.useCallback(async(S,w)=>{if(w.which===229)return;const{cellMode:E,isEditable:T}=S;if(!T)return;const M=E===ue.Edit,A=e.current.getRowParams(S.id);if(M)if(w.key==="Enter"){var H;if(!await e.current.commitRowChange(S.id)&&(H=t.experimentalFeatures)!=null&&H.preventCommitWhileValidating)return;e.current.publishEvent("rowEditStop",A,w)}else w.key==="Escape"&&e.current.publishEvent("rowEditStop",A,w);else w.key==="Enter"&&e.current.publishEvent("rowEditStart",A,w)},[e,(o=t.experimentalFeatures)==null?void 0:o.preventCommitWhileValidating]),P=s.useCallback((S,w)=>{if(!S.isEditable)return;const E=e.current.getRowParams(S.id);e.current.publishEvent("rowEditStart",E,w)},[e]),b=s.useCallback(S=>{const w=e.current.getRow(S.id),T=e.current.getEditRowsModel()[S.id];Object.keys(T).forEach(async M=>{const A=e.current.getColumn(M);if(A.preProcessEditCellProps){const H=M===S.field?S.props:T[M],x=await Promise.resolve(A.preProcessEditCellProps({id:S.id,row:w,props:H}));e.current.unstable_setEditCellProps({id:S.id,field:M,props:x})}else M===S.field&&e.current.unstable_setEditCellProps(S)})},[e]),p=s.useCallback(S=>{e.current.setRowMode(S.id,he.Edit)},[e]),I=s.useCallback((S,w)=>{e.current.setRowMode(S.id,he.View),w.key==="Enter"&&e.current.publishEvent("cellNavigationKeyDown",S,w)},[e]),$=s.useCallback(S=>{const E=e.current.getEditRowsModel()[S];if(!E)throw new Error(`MUI: Row at id: ${S} is not being edited.`);const T=e.current.getRow(S);if(T){let M=m({},T);Object.keys(E).forEach(A=>{const H=e.current.getColumn(A),x=E[A].value;H.valueSetter?M=H.valueSetter({row:M,value:x}):M[A]=x}),e.current.updateRows([M])}},[e]),v=s.useCallback(S=>{l.current=S},[]),h=async(S,w)=>{S.cellMode!==ue.View&&(l.current=null,r.current=setTimeout(async()=>{var E;if(((E=l.current)==null?void 0:E.id)!==S.id){await e.current.commitRowChange(S.id,w);const T=e.current.getRowParams(S.id);e.current.publishEvent("rowEditStop",T,w)}}))},k=je((S,w)=>{h(S,w)}),F=je(()=>{const S=Qe(e);if(!S)return;const w=e.current.getCellParams(S.id,S.field);h(w,{})});Q(e,"cellKeyDown",c(C)),Q(e,"cellDoubleClick",c(P)),Q(e,"editCellPropsChange",c(b)),Q(e,"rowEditStart",c(p)),Q(e,"rowEditStop",c(I)),Q(e,"rowEditCommit",c($)),Q(e,"cellFocusIn",c(v)),Q(e,"cellFocusOut",c(k)),Q(e,"columnHeaderDragStart",c(F)),me(e,"rowEditCommit",t.onRowEditCommit),me(e,"rowEditStart",t.onRowEditStart),me(e,"rowEditStop",t.onRowEditStop)},Jg=e=>m({},e,{editRows:{}});function em(e,t){var n;const o=Me(e,"useGridEditRows");Xg(e,t),Zg(e,t);const r=s.useRef({});e.current.unstable_registerControlState({stateId:"editRows",propModel:t.editRowsModel,propOnChange:t.onEditRowsModelChange,stateSelector:ye,changeEvent:"editRowsModelChange"});const l=s.useCallback(b=>!b.rowNode.isAutoGenerated&&!b.rowNode.isPinned&&!!b.colDef.editable&&!!b.colDef.renderEditCell&&(!t.isCellEditable||t.isCellEditable(b)),[t.isCellEditable]),i=(b,p,I,$)=>{if(!I){$();return}if(r.current[b]||(r.current[b]={}),r.current[b][p]){const[k]=r.current[b][p];clearTimeout(k)}const v=()=>{$();const[k]=r.current[b][p];clearTimeout(k),delete r.current[b][p]},h=setTimeout(()=>{$(),delete r.current[b][p]},I);r.current[b][p]=[h,v]},c=s.useCallback((b,p)=>{if(r.current[b]){if(!p)Object.keys(r.current[b]).forEach(I=>{const[,$]=r.current[b][I];$()});else if(r.current[b][p]){const[,I]=r.current[b][p];I()}}},[]),a=s.useCallback((b,p={})=>{i(b.id,b.field,b.debounceMs,()=>{var I;if((I=t.experimentalFeatures)!=null&&I.preventCommitWhileValidating)return t.editMode==="row"?e.current.unstable_setRowEditingEditCellValue(b):e.current.unstable_setCellEditingEditCellValue(b);const $={id:b.id,field:b.field,props:{value:b.value}};return e.current.publishEvent("editCellPropsChange",$,p)})},[e,t.editMode,(n=t.experimentalFeatures)==null?void 0:n.preventCommitWhileValidating]),g=s.useCallback((b,p,I)=>{const $=e.current.getColumn(p);return $.valueParser?$.valueParser(I,e.current.getCellParams(b,p)):I},[e]),d=s.useCallback(b=>{const{id:p,field:I,props:$}=b;return o.debug(`Setting cell props on id: ${p} field: ${I}`),e.current.setState(h=>{const k=m({},h.editRows);return k[p]=m({},h.editRows[p]),k[p][I]=m({},$,{value:g(p,I,$.value)}),m({},h,{editRows:k})}),e.current.forceUpdate(),ye(e.current.state)[p][I]},[e,o,g]),u=s.useCallback(b=>{ye(e.current.state)!==b&&(o.debug("Setting editRows model"),e.current.setState(I=>m({},I,{editRows:b})),e.current.forceUpdate())},[e,o]),f=s.useCallback(()=>ye(e.current.state),[e]),C=s.useCallback((b,p)=>{const I=p.detail>1;b.isEditable&&b.cellMode===ue.View&&I&&p.preventDefault()},[]);Q(e,"cellMouseDown",C),me(e,"editCellPropsChange",t.onEditCellPropsChange),Ce(e,{isCellEditable:l,setEditRowsModel:u,getEditRowsModel:f,setEditCellValue:a,unstable_setEditCellProps:d,unstable_parseValue:g,unstable_runPendingEditCellValueMutation:c}),s.useEffect(()=>{t.editRowsModel!==void 0&&e.current.setEditRowsModel(t.editRowsModel)},[e,t.editRowsModel])}const tm=["id","field"],nm=["id","field"],om=Je(["MUI: A call to `processRowUpdate` threw an error which was not handled because `onProcessRowUpdateError` is missing.","To handle the error pass a callback to the `onProcessRowUpdateError` prop, e.g. `<DataGrid onProcessRowUpdateError={(error) => ...} />`.","For more detail, see http://mui.com/components/data-grid/editing/#persistence."],"error"),rm=(e,t)=>{const[n,o]=s.useState({}),r=s.useRef(n),l=s.useRef({}),{processRowUpdate:i,onProcessRowUpdateError:c,cellModesModel:a,onCellModesModelChange:g,signature:d}=t,u=x=>(...y)=>{t.editMode===Re.Cell&&x(...y)},f=s.useCallback((x,y)=>{const O=e.current.getCellParams(x,y);if(!e.current.isCellEditable(O))throw new Error(`MUI: The cell with id=${x} and field=${y} is not editable.`)},[e]),C=s.useCallback((x,y,O)=>{if(e.current.getCellMode(x,y)!==O)throw new Error(`MUI: The cell with id=${x} and field=${y} is not in ${O} mode.`)},[e]),P=s.useCallback((x,y)=>{if(!x.isEditable||x.cellMode===ue.Edit)return;const O=m({},x,{reason:it.cellDoubleClick});e.current.publishEvent("cellEditStart",O,y)},[e]),b=s.useCallback((x,y)=>{if(x.cellMode===ue.View||e.current.getCellMode(x.id,x.field)===ue.View)return;const O=m({},x,{reason:et.cellFocusOut});e.current.publishEvent("cellEditStop",O,y)},[e]),p=s.useCallback((x,y)=>{if(x.cellMode===ue.Edit){if(y.which===229)return;let O;if(y.key==="Escape"?O=et.escapeKeyDown:y.key==="Enter"?O=et.enterKeyDown:y.key==="Tab"&&(O=y.shiftKey?et.shiftTabKeyDown:et.tabKeyDown,y.preventDefault()),O){const V=m({},x,{reason:O});e.current.publishEvent("cellEditStop",V,y)}}else if(x.isEditable){let O;if(y.key===" "&&y.shiftKey)return;if(yn(y)||(y.ctrlKey||y.metaKey)&&y.key==="v"?O=it.printableKeyDown:y.key==="Enter"?O=it.enterKeyDown:(y.key==="Delete"||y.key==="Backspace")&&(O=it.deleteKeyDown),O){const V=m({},x,{reason:O,key:y.key});e.current.publishEvent("cellEditStart",V,y)}}},[e]),I=s.useCallback(x=>{const{id:y,field:O,reason:V,key:R}=x,D={id:y,field:O};V===it.printableKeyDown?s.version.startsWith("18")?D.initialValue=R:D.deleteValue=!0:V===it.deleteKeyDown&&(D.deleteValue=!0),e.current.startCellEditMode(D)},[e]),$=s.useCallback(x=>{const{id:y,field:O,reason:V}=x;e.current.unstable_runPendingEditCellValueMutation(y,O);let R;V===et.enterKeyDown?R="below":V===et.tabKeyDown?R="right":V===et.shiftTabKeyDown&&(R="left");let D=V==="escapeKeyDown";ye(e.current.state)[y][O].isProcessingProps&&!t.disableIgnoreModificationsIfProcessingProps&&(D=!0),e.current.stopCellEditMode({id:y,field:O,ignoreModifications:D,cellToFocusAfter:R})},[e,t.disableIgnoreModificationsIfProcessingProps]);Q(e,"cellDoubleClick",u(P)),Q(e,"cellFocusOut",u(b)),Q(e,"cellKeyDown",u(p)),Q(e,"cellEditStart",u(I)),Q(e,"cellEditStop",u($)),me(e,"cellEditStart",t.onCellEditStart),me(e,"cellEditStop",t.onCellEditStop);const v=s.useCallback((x,y)=>{const O=ye(e.current.state);return O[x]&&O[x][y]?ue.Edit:ue.View},[e]),h=je(x=>{const y=x!==t.cellModesModel;if(g&&y){const O=d===Pt.DataGridPro?{api:e.current}:{};g(x,O)}t.cellModesModel&&y||(o(x),r.current=x,e.current.publishEvent("cellModesModelChange",x))}),k=s.useCallback((x,y,O)=>{const V=m({},r.current);if(O!==null)V[x]=m({},V[x],{[y]:m({},O)});else{const R=V[x],D=Z(R,[y].map(Xt));V[x]=D,Object.keys(V[x]).length===0&&delete V[x]}h(V)},[h]),F=s.useCallback((x,y,O)=>{e.current.setState(V=>{const R=m({},V.editRows);return O!==null?R[x]=m({},R[x],{[y]:m({},O)}):(delete R[x][y],Object.keys(R[x]).length===0&&delete R[x]),m({},V,{editRows:R})}),e.current.forceUpdate()},[e]),S=s.useCallback(x=>{const{id:y,field:O}=x,V=Z(x,tm);f(y,O),C(y,O,ue.View),k(y,O,m({mode:ue.Edit},V))},[f,C,k]),w=je(x=>{const{id:y,field:O,deleteValue:V,initialValue:R}=x;let D=e.current.getCellValue(y,O);(V||R)&&(D=V?"":R),F(y,O,{value:D,error:!1,isProcessingProps:!1}),e.current.setCellFocus(y,O)}),E=s.useCallback(x=>{const{id:y,field:O}=x,V=Z(x,nm);C(y,O,ue.Edit),k(y,O,m({mode:ue.View},V))},[C,k]),T=je(async x=>{const{id:y,field:O,ignoreModifications:V,cellToFocusAfter:R="none"}=x;C(y,O,ue.Edit),e.current.unstable_runPendingEditCellValueMutation(y,O);const D=()=>{F(y,O,null),k(y,O,null),R!=="none"&&e.current.unstable_moveFocusToRelativeCell(y,O,R)};if(V){D();return}const G=ye(e.current.state),{error:z,isProcessingProps:N}=G[y][O];if(z||N){l.current[y][O].mode=ue.Edit,k(y,O,{mode:ue.Edit});return}const K=e.current.unstable_getRowWithUpdatedValuesFromCellEditing(y,O);if(i){const W=te=>{l.current[y][O].mode=ue.Edit,k(y,O,{mode:ue.Edit}),c?c(te):om()};try{const te=e.current.getRow(y);Promise.resolve(i(K,te)).then(q=>{e.current.updateRows([q]),D()}).catch(W)}catch(te){W(te)}}else e.current.updateRows([K]),D()}),M=s.useCallback(async x=>{var y,O;const{id:V,field:R,value:D,debounceMs:G,unstable_skipValueParser:z}=x;f(V,R),C(V,R,ue.Edit);const N=e.current.getColumn(R),K=e.current.getRow(V);let W=D;N.valueParser&&!z&&(W=N.valueParser(D,e.current.getCellParams(V,R)));let te=ye(e.current.state),q=m({},te[V][R],{value:W,changeReason:G?"debouncedSetEditCellValue":"setEditCellValue"});if(N.preProcessEditCellProps){const oe=D!==te[V][R].value;q=m({},q,{isProcessingProps:!0}),F(V,R,q),q=await Promise.resolve(N.preProcessEditCellProps({id:V,row:K,props:q,hasChanged:oe}))}return e.current.getCellMode(V,R)===ue.View?!1:(te=ye(e.current.state),q=m({},q,{isProcessingProps:!1}),q.value=N.preProcessEditCellProps?te[V][R].value:W,F(V,R,q),te=ye(e.current.state),!((y=te[V])!=null&&(O=y[R])!=null&&O.error))},[e,f,C,F]),A=s.useCallback((x,y)=>{const O=e.current.getColumn(y),V=ye(e.current.state),{value:R}=V[x][y],D=e.current.getRow(x);return O.valueSetter?O.valueSetter({value:R,row:D}):m({},D,{[y]:R})},[e]);Ce(e,{getCellMode:v,startCellEditMode:S,stopCellEditMode:E,unstable_setCellEditingEditCellValue:M,unstable_getRowWithUpdatedValuesFromCellEditing:A}),s.useEffect(()=>{a&&h(a)},[a,h]),s.useEffect(()=>{const x=Yn(e),y=l.current;l.current=Br(n),Object.entries(n).forEach(([O,V])=>{Object.entries(V).forEach(([R,D])=>{var G,z,N;const K=((G=y[O])==null||(z=G[R])==null?void 0:z.mode)||ue.View,W=(N=x[O])!=null?N:O;D.mode===ue.Edit&&K===ue.View?w(m({id:W,field:R},D)):D.mode===ue.View&&K===ue.Edit&&T(m({id:W,field:R},D))})})},[e,n,w,T])},lm=["id"],sm=["id"],im=Je(["MUI: A call to `processRowUpdate` threw an error which was not handled because `onProcessRowUpdateError` is missing.","To handle the error pass a callback to the `onProcessRowUpdateError` prop, e.g. `<DataGrid onProcessRowUpdateError={(error) => ...} />`.","For more detail, see http://mui.com/components/data-grid/editing/#persistence."],"error"),am=(e,t)=>{const[n,o]=s.useState({}),r=s.useRef(n),l=s.useRef({}),i=s.useRef(null),c=s.useRef(null),{processRowUpdate:a,onProcessRowUpdateError:g,rowModesModel:d,onRowModesModelChange:u,signature:f}=t,C=R=>(...D)=>{t.editMode===Re.Row&&R(...D)},P=s.useCallback((R,D)=>{const G=e.current.getCellParams(R,D);if(!e.current.isCellEditable(G))throw new Error(`MUI: The cell with id=${R} and field=${D} is not editable.`)},[e]),b=s.useCallback((R,D)=>{if(e.current.getRowMode(R)!==D)throw new Error(`MUI: The row with id=${R} is not in ${D} mode.`)},[e]),p=s.useCallback((R,D)=>{if(!R.isEditable||e.current.getRowMode(R.id)===he.Edit)return;const G=e.current.getRowParams(R.id),z=m({},G,{field:R.field,reason:at.cellDoubleClick});e.current.publishEvent("rowEditStart",z,D)},[e]),I=s.useCallback(R=>{c.current=R},[]),$=s.useCallback((R,D)=>{R.isEditable&&e.current.getRowMode(R.id)!==he.View&&(c.current=null,i.current=setTimeout(()=>{var G;if(i.current=null,((G=c.current)==null?void 0:G.id)!==R.id){if(!e.current.getRow(R.id)||e.current.getRowMode(R.id)===he.View)return;const z=e.current.getRowParams(R.id),N=m({},z,{field:R.field,reason:tt.rowFocusOut});e.current.publishEvent("rowEditStop",N,D)}}))},[e]);s.useEffect(()=>()=>{clearTimeout(i.current)},[]);const v=s.useCallback((R,D)=>{if(R.cellMode===he.Edit){if(D.which===229)return;let G;if(D.key==="Escape")G=tt.escapeKeyDown;else if(D.key==="Enter")G=tt.enterKeyDown;else if(D.key==="Tab"){const z=Gt(e).filter(N=>e.current.isCellEditable(e.current.getCellParams(R.id,N)));D.shiftKey?R.field===z[0]&&(G=tt.shiftTabKeyDown):R.field===z[z.length-1]&&(G=tt.tabKeyDown),G&&D.preventDefault()}if(G){const z=e.current.getRowParams(R.id),N=m({},z,{reason:G,field:R.field});e.current.publishEvent("rowEditStop",N,D)}}else if(R.isEditable){let G;if(D.key===" "&&D.shiftKey)return;if(yn(D)||(D.ctrlKey||D.metaKey)&&D.key==="v"?G=at.printableKeyDown:D.key==="Enter"?G=at.enterKeyDown:(D.key==="Delete"||D.key==="Backspace")&&(G=at.deleteKeyDown),G){const z=e.current.getRowParams(R.id),N=m({},z,{field:R.field,key:D.key,reason:G});e.current.publishEvent("rowEditStart",N,D)}}},[e]),h=s.useCallback(R=>{const{id:D,field:G,reason:z,key:N}=R,K={id:D,fieldToFocus:G};z===at.printableKeyDown?s.version.startsWith("18")?K.initialValue=N:K.deleteValue=!!G:z===at.deleteKeyDown&&(K.deleteValue=!!G),e.current.startRowEditMode(K)},[e]),k=s.useCallback(R=>{const{id:D,reason:G,field:z}=R;e.current.unstable_runPendingEditCellValueMutation(D);let N;G===tt.enterKeyDown?N="below":G===tt.tabKeyDown?N="right":G===tt.shiftTabKeyDown&&(N="left");let K=G==="escapeKeyDown";const W=ye(e.current.state);!K&&!t.disableIgnoreModificationsIfProcessingProps&&(K=Object.values(W[D]).some(te=>te.isProcessingProps)),e.current.stopRowEditMode({id:D,ignoreModifications:K,field:z,cellToFocusAfter:N})},[e,t.disableIgnoreModificationsIfProcessingProps]);Q(e,"cellDoubleClick",C(p)),Q(e,"cellFocusIn",C(I)),Q(e,"cellFocusOut",C($)),Q(e,"cellKeyDown",C(v)),Q(e,"rowEditStart",C(h)),Q(e,"rowEditStop",C(k)),me(e,"rowEditStart",t.onRowEditStart),me(e,"rowEditStop",t.onRowEditStop);const F=s.useCallback(R=>{if(t.editMode===Re.Cell)return he.View;const D=ye(e.current.state);return D[R]&&Object.keys(D[R]).length>0?he.Edit:he.View},[e,t.editMode]),S=je(R=>{const D=R!==t.rowModesModel;if(u&&D){const G=f===Pt.DataGridPro?{api:e.current}:{};u(R,G)}t.rowModesModel&&D||(o(R),r.current=R,e.current.publishEvent("rowModesModelChange",R))}),w=s.useCallback((R,D)=>{const G=m({},r.current);D!==null?G[R]=m({},D):delete G[R],S(G)},[S]),E=s.useCallback((R,D)=>{e.current.setState(G=>{const z=m({},G.editRows);return D!==null?z[R]=D:delete z[R],m({},G,{editRows:z})}),e.current.forceUpdate()},[e]),T=s.useCallback((R,D,G)=>{e.current.setState(z=>{const N=m({},z.editRows);return G!==null?N[R]=m({},N[R],{[D]:m({},G)}):(delete N[R][D],Object.keys(N[R]).length===0&&delete N[R]),m({},z,{editRows:N})}),e.current.forceUpdate()},[e]),M=s.useCallback(R=>{const{id:D}=R,G=Z(R,lm);b(D,he.View),w(D,m({mode:he.Edit},G))},[b,w]),A=je(R=>{const{id:D,fieldToFocus:G,deleteValue:z,initialValue:N}=R,W=Gt(e).reduce((te,q)=>{if(!e.current.getCellParams(D,q).isEditable)return te;let U=e.current.getCellValue(D,q);return G===q&&(z||N)&&(U=z?"":N),te[q]={value:U,error:!1,isProcessingProps:!1},te},{});E(D,W),G&&e.current.setCellFocus(D,G)}),H=s.useCallback(R=>{const{id:D}=R,G=Z(R,sm);b(D,he.Edit),w(D,m({mode:he.View},G))},[b,w]),x=je(R=>{const{id:D,ignoreModifications:G,field:z,cellToFocusAfter:N="none"}=R;e.current.unstable_runPendingEditCellValueMutation(D);const K=()=>{N!=="none"&&z&&e.current.unstable_moveFocusToRelativeCell(D,z,N),E(D,null),w(D,null)};if(G){K();return}const W=ye(e.current.state),te=e.current.getRow(D);if(Object.values(W[D]).some(Y=>Y.isProcessingProps)){l.current[D].mode=he.Edit;return}if(Object.values(W[D]).some(Y=>Y.error)){l.current[D].mode=he.Edit,w(D,{mode:he.Edit});return}const U=e.current.unstable_getRowWithUpdatedValuesFromRowEditing(D);if(a){const Y=X=>{l.current[D].mode=he.Edit,w(D,{mode:he.Edit}),g?g(X):im()};try{Promise.resolve(a(U,te)).then(X=>{e.current.updateRows([X]),K()}).catch(Y)}catch(X){Y(X)}}else e.current.updateRows([U]),K()}),y=s.useCallback(R=>{const{id:D,field:G,value:z,debounceMs:N,unstable_skipValueParser:K}=R;P(D,G);const W=e.current.getColumn(G),te=e.current.getRow(D);let q=z;W.valueParser&&!K&&(q=W.valueParser(z,e.current.getCellParams(D,G)));let oe=ye(e.current.state),U=m({},oe[D][G],{value:q,changeReason:N?"debouncedSetEditCellValue":"setEditCellValue"});return W.preProcessEditCellProps||T(D,G,U),new Promise(Y=>{const X=[];if(W.preProcessEditCellProps){const ae=U.value!==oe[D][G].value;U=m({},U,{isProcessingProps:!0}),T(D,G,U);const de=oe[D],be=Z(de,[G].map(Xt)),xe=Promise.resolve(W.preProcessEditCellProps({id:D,row:te,props:U,hasChanged:ae,otherFieldsProps:be})).then(j=>{if(e.current.getRowMode(D)===he.View){Y(!1);return}oe=ye(e.current.state),j=m({},j,{isProcessingProps:!1}),j.value=W.preProcessEditCellProps?oe[D][G].value:q,T(D,G,j)});X.push(xe)}Object.entries(oe[D]).forEach(([ae,de])=>{if(ae===G)return;const be=e.current.getColumn(ae);if(!be.preProcessEditCellProps)return;de=m({},de,{isProcessingProps:!0}),T(D,ae,de),oe=ye(e.current.state);const xe=oe[D],j=Z(xe,[ae].map(Xt)),re=Promise.resolve(be.preProcessEditCellProps({id:D,row:te,props:de,hasChanged:!1,otherFieldsProps:j})).then(le=>{if(e.current.getRowMode(D)===he.View){Y(!1);return}le=m({},le,{isProcessingProps:!1}),T(D,ae,le)});X.push(re)}),Promise.all(X).then(()=>{e.current.getRowMode(D)===he.Edit?(oe=ye(e.current.state),Y(!oe[D][G].error)):Y(!1)})})},[e,P,T]),O=s.useCallback(R=>{const D=ye(e.current.state),G=e.current.getRow(R);let z=m({},G);return Object.entries(D[R]).forEach(([N,K])=>{const W=e.current.getColumn(N);W.valueSetter?z=W.valueSetter({value:K.value,row:z}):z[N]=K.value}),z},[e]);Ce(e,{getRowMode:F,startRowEditMode:M,stopRowEditMode:H,unstable_setRowEditingEditCellValue:y,unstable_getRowWithUpdatedValuesFromRowEditing:O}),s.useEffect(()=>{d&&S(d)},[d,S]),s.useEffect(()=>{const R=Yn(e),D=l.current;l.current=Br(n),Object.entries(n).forEach(([G,z])=>{var N,K;const W=((N=D[G])==null?void 0:N.mode)||he.View,te=(K=R[G])!=null?K:G;z.mode===he.Edit&&W===he.View?A(m({id:te},z)):z.mode===he.View&&W===he.Edit&&x(m({id:te},z))})},[e,n,A,x])},cm=e=>m({},e,{editRows:{}}),um=(e,t)=>{rm(e,t),am(e,t);const n=s.useRef({}),{isCellEditable:o}=t,r=s.useCallback(u=>u.rowNode.isAutoGenerated||!u.colDef.editable||!u.colDef.renderEditCell?!1:o?o(u):!u.rowNode.isPinned,[o]),l=(u,f,C,P)=>{if(!C){P();return}if(n.current[u]||(n.current[u]={}),n.current[u][f]){const[I]=n.current[u][f];clearTimeout(I)}const b=()=>{const[I]=n.current[u][f];clearTimeout(I),P(),delete n.current[u][f]},p=setTimeout(()=>{P(),delete n.current[u][f]},C);n.current[u][f]=[p,b]};s.useEffect(()=>{const u=n.current;return()=>{Object.entries(u).forEach(([f,C])=>{Object.keys(C).forEach(P=>{const[b]=u[f][P];clearTimeout(b),delete u[f][P]})})}},[]);const i=s.useCallback((u,f)=>{if(n.current[u]){if(!f)Object.keys(n.current[u]).forEach(C=>{const[,P]=n.current[u][C];P()});else if(n.current[u][f]){const[,C]=n.current[u][f];C()}}},[]),c=s.useCallback(u=>{const{id:f,field:C,debounceMs:P}=u;return new Promise(b=>{l(f,C,P,async()=>{const p=t.editMode===Re.Row?e.current.unstable_setRowEditingEditCellValue:e.current.unstable_setCellEditingEditCellValue;if(e.current.getCellMode(f,C)===ue.Edit){const I=await p(u);b(I)}})})},[e,t.editMode]),a=s.useCallback((u,f)=>t.editMode===Re.Cell?e.current.unstable_getRowWithUpdatedValuesFromCellEditing(u,f):e.current.unstable_getRowWithUpdatedValuesFromRowEditing(u),[e,t.editMode]),g=s.useCallback((u,f)=>({changeReason:ye(e.current.state)[u][f].changeReason}),[e]);Ce(e,{isCellEditable:r,setEditCellValue:c,unstable_runPendingEditCellValueMutation:i,unstable_getRowWithUpdatedValues:a,unstable_getEditCellMeta:g})},dm=(e,t,n)=>(n.current.unstable_caches.rows=gn({rows:t.rows,getRowId:t.getRowId,loading:t.loading,rowCount:t.rowCount}),m({},e,{rows:rl({apiRef:n,previousTree:null,rowCountProp:t.rowCount,loadingProp:t.loading})})),gm=(e,t)=>{const n=Me(e,"useGridRows"),o=$t(e,t),r=s.useRef(Date.now()),l=s.useRef(null),i=s.useCallback(T=>{var M;return(M=Ht(e)[T])!=null?M:null},[e]),c=s.useMemo(()=>o.rows.reduce((T,{id:M},A)=>(T[M]=A,T),{}),[o.rows]),a=s.useCallback((T,M)=>{const A=()=>{l.current=null,r.current=Date.now(),e.current.setState(x=>m({},x,{rows:rl({apiRef:e,previousTree:bt(e),rowCountProp:t.rowCount,loadingProp:t.loading})})),e.current.publishEvent("rowsSet"),e.current.forceUpdate()};if(l.current&&(clearTimeout(l.current),l.current=null),e.current.unstable_caches.rows=T,!M){A();return}const H=t.throttleRowsMs-(Date.now()-r.current);if(H>0){l.current=setTimeout(A,H);return}A()},[t.throttleRowsMs,t.rowCount,t.loading,e]),g=s.useCallback(T=>{n.debug(`Updating all rows, new length ${T.length}`);const M=gn({rows:T,getRowId:t.getRowId,loading:t.loading,rowCount:t.rowCount}),A=e.current.unstable_caches.rows;M.rowsBeforePartialUpdates=A.rowsBeforePartialUpdates,a(M,!0)},[n,t.getRowId,t.loading,t.rowCount,a,e]),d=s.useCallback(T=>{if(t.signature===Pt.DataGrid&&T.length>1)throw new Error(["MUI: You can't update several rows at once in `apiRef.current.updateRows` on the DataGrid.","You need to upgrade to DataGridPro or DataGridPremium component to unlock this feature."].join(`
`));const M=new Map;T.forEach(y=>{const O=Vn(y,t.getRowId,"A row was provided without id when calling updateRows():");M.has(O)?M.set(O,m({},M.get(O),y)):M.set(O,y)});const A=[],H=e.current.unstable_caches.rows,x={rowsBeforePartialUpdates:H.rowsBeforePartialUpdates,loadingPropBeforePartialUpdates:H.loadingPropBeforePartialUpdates,rowCountPropBeforePartialUpdates:H.rowCountPropBeforePartialUpdates,idRowsLookup:m({},H.idRowsLookup),idToIdLookup:m({},H.idToIdLookup),ids:[...H.ids]};M.forEach((y,O)=>{if(y._action==="delete"){delete x.idRowsLookup[O],delete x.idToIdLookup[O],A.push(O);return}if(!e.current.getRow(O)){x.idRowsLookup[O]=y,x.idToIdLookup[O]=O,x.ids.push(O);return}x.idRowsLookup[O]=m({},e.current.getRow(O),y)}),A.length>0&&(x.ids=x.ids.filter(y=>!A.includes(y))),a(x,!0)},[t.signature,t.getRowId,a,e]),u=s.useCallback(()=>{const T=xt(e),M=Ht(e);return new Map(T.map(A=>[A,M[A]]))},[e]),f=s.useCallback(()=>Sn(e),[e]),C=s.useCallback(()=>xt(e),[e]),P=s.useCallback(T=>c[T],[c]),b=s.useCallback((T,M)=>{const A=e.current.getRowNode(T);if(!A)throw new Error(`MUI: No row with id #${T} found`);const H=m({},A,{childrenExpanded:M});e.current.setState(x=>m({},x,{rows:m({},x.rows,{tree:m({},x.rows.tree,{[T]:H})})})),e.current.forceUpdate(),e.current.publishEvent("rowExpansionChange",H)},[e]),p=s.useCallback(T=>{var M;return(M=bt(e)[T])!=null?M:null},[e]),I=s.useCallback(({skipAutoGeneratedRows:T=!0,groupId:M,applySorting:A,applyFiltering:H})=>{const x=bt(e);let y;if(A){const O=x[M];if(!O)return[];const V=Zn(e);y=[];const R=V.findIndex(D=>D===M)+1;for(let D=R;D<V.length&&x[V[D]].depth>O.depth;D+=1){const G=V[D],z=x[G];(!T||!z.isAutoGenerated)&&y.push(G)}}else y=ll(x,M,T);if(H){const O=wr(e);y=y.filter(V=>O[V]!==!1)}return y},[e]),$=s.useCallback((T,M)=>{const A=xt(e),H=A.findIndex(y=>y===T);if(H===-1||H===M)return;n.debug(`Moving row ${T} to index ${M}`);const x=[...A];x.splice(M,0,x.splice(H,1)[0]),e.current.setState(y=>m({},y,{rows:m({},y.rows,{ids:x})})),e.current.unstable_caches.rows.ids=x,e.current.publishEvent("rowsSet")},[e,n]),v=s.useCallback((T,M)=>{if(t.signature===Pt.DataGrid&&M.length>1)throw new Error(["MUI: You can't replace rows using `apiRef.current.unstable_replaceRows` on the DataGrid.","You need to upgrade to DataGridPro or DataGridPremium component to unlock this feature."].join(`
`));if(M.length===0)return;const H=[...xt(e)],x=Ht(e),y=Yn(e),O=bt(e),V=m({},x),R=m({},y),D=m({},O),G=M.map(z=>({id:Vn(z,t.getRowId,"A row was provided without id when calling replaceRows()."),model:z}));G.forEach((z,N)=>{const[K]=H.splice(T+N,1,z.id);delete V[K],delete R[K],delete D[K]}),G.forEach(z=>{const N={id:z.id,parent:null,depth:0,groupingKey:null,groupingField:null};V[z.id]=z.model,R[z.id]=z.id,D[z.id]=N}),e.current.unstable_caches.rows.idRowsLookup=V,e.current.unstable_caches.rows.idToIdLookup=R,e.current.unstable_caches.rows.ids=H,e.current.setState(z=>{const N={idRowsLookup:V,idToIdLookup:R,tree:D,ids:H};return m({},z,{rows:m({},z.rows,N,{groupingResponseBeforeRowHydration:m({},z.rows.groupingResponseBeforeRowHydration,N)})})}),e.current.publishEvent("rowsSet")},[e,t.signature,t.getRowId]),h={getRow:i,getRowModels:u,getRowsCount:f,getAllRowIds:C,setRows:g,setRowIndex:$,updateRows:d,setRowChildrenExpansion:b,getRowNode:p,getRowIndexRelativeToVisibleRows:P,getRowGroupChildren:I,unstable_replaceRows:v},k=s.useCallback(()=>{n.info("Row grouping pre-processing have changed, regenerating the row tree");let T;e.current.unstable_caches.rows.rowsBeforePartialUpdates===t.rows?T=e.current.unstable_caches.rows:T=gn({rows:t.rows,getRowId:t.getRowId,loading:t.loading,rowCount:t.rowCount}),a(T,!1)},[n,e,t.rows,t.getRowId,t.loading,t.rowCount,a]),F=s.useCallback(T=>{T==="rowTreeCreation"&&k()},[k]),S=s.useCallback(()=>{e.current.unstable_getActiveStrategy("rowTree")!==bi(e)&&k()},[e,k]);Q(e,"activeStrategyProcessorChange",F),Q(e,"strategyAvailabilityChange",S);const w=s.useCallback(()=>{e.current.setState(T=>m({},T,{rows:m({},T.rows,e.current.unstable_applyPipeProcessors("hydrateRows",T.rows.groupingResponseBeforeRowHydration))})),e.current.publishEvent("rowsSet"),e.current.forceUpdate()},[e]);uo(e,"hydrateRows",w),Ce(e,h),s.useEffect(()=>()=>{l.current!==null&&clearTimeout(l.current)},[]);const E=s.useRef(!0);s.useEffect(()=>{if(E.current){E.current=!1;return}const T=e.current.unstable_caches.rows.rowsBeforePartialUpdates===t.rows,M=e.current.unstable_caches.rows.loadingPropBeforePartialUpdates===t.loading,A=e.current.unstable_caches.rows.rowCountPropBeforePartialUpdates===t.rowCount;if(T){M||(e.current.setState(H=>m({},H,{rows:m({},H.rows,{loading:t.loading})})),e.current.unstable_caches.rows.loadingPropBeforePartialUpdates=t.loading,e.current.forceUpdate()),A||(e.current.setState(H=>m({},H,{rows:m({},H.rows,{totalRowCount:Math.max(t.rowCount||0,H.rows.totalRowCount),totalTopLevelRowCount:Math.max(t.rowCount||0,H.rows.totalTopLevelRowCount)})})),e.current.unstable_caches.rows.rowCountPropBeforePartialUpdates=t.rowCount,e.current.forceUpdate());return}n.debug(`Updating all rows, new length ${t.rows.length}`),a(gn({rows:t.rows,getRowId:t.getRowId,loading:t.loading,rowCount:t.rowCount}),!1)},[t.rows,t.rowCount,t.getRowId,t.loading,n,a,e])},mm=({ids:e,idRowsLookup:t,idToIdLookup:n,previousTree:o})=>{const r={};for(let l=0;l<e.length;l+=1){const i=e[l];o&&o[i]&&o[i].depth===0&&o[i].parent==null&&!o[i].isPinned?r[i]=o[i]:r[i]={id:i,depth:0,parent:null,groupingKey:"",groupingField:null}}return{groupingName:cn,tree:r,treeDepth:1,idRowsLookup:t,idToIdLookup:n,ids:e}},fm=e=>{go(e,cn,"rowTreeCreation",mm)};Je(["MUI: You are calling getValue. This method is deprecated and will be removed in the next major version.","Instead, you can access the data from `params.row`."]);function hm(e){const t=s.useCallback(u=>({field:u,colDef:e.current.getColumn(u)}),[e]),n=s.useCallback((...u)=>e.current.getCellValue(...u),[e]),o=s.useCallback(u=>{const f=e.current.getRow(u);if(!f)throw new Error(`No row with id #${u} found`);return{id:u,columns:e.current.getAllColumns(),row:f,getValue:n}},[e,n]),r=s.useCallback((u,f)=>{const C=e.current.getRow(u),P=e.current.getRowNode(u);if(!C||!P)throw new Error(`No row with id #${u} found`);const b=Qe(e),p=hn(e);return{id:u,field:f,row:C,rowNode:P,value:C[f],colDef:e.current.getColumn(f),cellMode:e.current.getCellMode(u,f),getValue:n,api:e.current,hasFocus:b!==null&&b.field===f&&b.id===u,tabIndex:p&&p.field===f&&p.id===u?0:-1}},[e,n]),l=s.useCallback((u,f)=>{const C=e.current.getColumn(f),P=e.current.getCellValue(u,f),b=e.current.getRow(u),p=e.current.getRowNode(u);if(!b||!p)throw new Error(`No row with id #${u} found`);const I=Qe(e),$=hn(e),v={id:u,field:f,row:b,rowNode:p,colDef:C,cellMode:e.current.getCellMode(u,f),getValue:n,hasFocus:I!==null&&I.field===f&&I.id===u,tabIndex:$&&$.field===f&&$.id===u?0:-1,value:P,formattedValue:P};return C&&C.valueFormatter&&(v.formattedValue=C.valueFormatter({id:u,field:v.field,value:v.value,api:e.current})),v.isEditable=C&&e.current.isCellEditable(v),v},[e,n]),i=s.useCallback((u,f)=>{const C=e.current.getColumn(f);if(!C||!C.valueGetter){const P=e.current.getRow(u);if(!P)throw new Error(`No row with id #${u} found`);return P[f]}return C.valueGetter(r(u,f))},[e,r]),c=s.useCallback(u=>e.current.rootElementRef.current?tc(e.current.rootElementRef.current,u):null,[e]),a=s.useCallback(u=>e.current.rootElementRef.current?nc(e.current.rootElementRef.current,u):null,[e]),g=s.useCallback((u,f)=>e.current.rootElementRef.current?oc(e.current.rootElementRef.current,{id:u,field:f}):null,[e]);Ce(e,{getCellValue:i,getCellParams:l,getCellElement:g,getRowParams:o,getRowElement:a,getColumnHeaderParams:t,getColumnHeaderElement:c})}const ul=(e,t)=>e==null||Array.isArray(e)?e:t&&t[0]===e?t:[e],pm=(e,t)=>{var n;return m({},e,{selection:(n=ul(t.selectionModel))!=null?n:[]})},Cm=(e,t)=>{const n=Me(e,"useGridSelection"),o=s.useMemo(()=>ul(t.selectionModel,Ke(e.current.state)),[e,t.selectionModel]),r=s.useRef(null);e.current.unstable_registerControlState({stateId:"selection",propModel:o,propOnChange:t.onSelectionModelChange,stateSelector:Ke,changeEvent:"selectionChange"});const{checkboxSelection:l,disableMultipleSelection:i,disableSelectionOnClick:c,pagination:a,paginationMode:g,isRowSelectable:d}=t,u=!i||l,f=$t(e,t),C=s.useCallback(x=>{var y;let O=x;const V=(y=r.current)!=null?y:x,R=e.current.isRowSelected(x);if(R){const D=Yt(e),G=D.findIndex(N=>N===V),z=D.findIndex(N=>N===O);if(G===z)return;G>z?O=D[z+1]:O=D[z-1]}r.current=x,e.current.selectRowRange({startId:V,endId:O},!R)},[e]),P=s.useCallback(x=>{Ke(e.current.state)!==x&&(n.debug("Setting selection model"),e.current.setState(O=>m({},O,{selection:x})),e.current.forceUpdate())},[e,n]),b=s.useCallback(x=>Ke(e.current.state).includes(x),[e]),p=s.useCallback(x=>{if(d&&!d(e.current.getRowParams(x)))return!1;const y=e.current.getRowNode(x);return!((y==null?void 0:y.position)==="footer"||y!=null&&y.isPinned)},[e,d]),I=s.useCallback(()=>yc(e),[e]),$=s.useCallback((x,y=!0,O=!1)=>{if(e.current.isRowSelectable(x))if(r.current=x,O)n.debug(`Setting selection for row ${x}`),e.current.setSelectionModel(y?[x]:[]);else{n.debug(`Toggling selection for row ${x}`);const R=Ke(e.current.state).filter(G=>G!==x);y&&R.push(x),(R.length<2||u)&&e.current.setSelectionModel(R)}},[e,n,u]),v=s.useCallback((x,y=!0,O=!1)=>{n.debug("Setting selection for several rows");const V=x.filter(G=>e.current.isRowSelectable(G));let R;if(O)R=y?V:[];else{const G=m({},bn(e));V.forEach(z=>{y?G[z]=z:delete G[z]}),R=Object.values(G)}(R.length<2||u)&&e.current.setSelectionModel(R)},[e,n,u]),h=s.useCallback(({startId:x,endId:y},O=!0,V)=>{if(!e.current.getRow(x)||!e.current.getRow(y))return;n.debug(`Expanding selection from row ${x} to row ${y}`);const R=Yt(e),D=R.indexOf(x),G=R.indexOf(y),[z,N]=D>G?[G,D]:[D,G],K=R.slice(z,N+1);e.current.selectRows(K,O,V)},[e,n]);Ce(e,{selectRow:$,selectRows:v,selectRowRange:h,setSelectionModel:P,getSelectedRows:I,isRowSelected:b,isRowSelectable:p});const F=s.useCallback(()=>{if(t.keepNonExistentRowsSelected)return;const x=Ke(e.current.state),y=Ht(e),O=m({},bn(e));let V=!1;x.forEach(R=>{y[R]||(delete O[R],V=!0)}),V&&e.current.setSelectionModel(Object.values(O))},[e,t.keepNonExistentRowsSelected]),S=s.useCallback((x,y)=>{const O=y.metaKey||y.ctrlKey,V=!l&&!O&&!On(y),R=!u||V,D=e.current.isRowSelected(x);R?e.current.selectRow(x,V?!0:!D,!0):e.current.selectRow(x,!D,!1)},[e,u,l]),w=s.useCallback((x,y)=>{var O;if(c)return;const V=(O=y.target.closest(`.${L.cell}`))==null?void 0:O.getAttribute("data-field");V===sn.field||V===co||V&&e.current.getColumn(V).type===ao||e.current.getRowNode(x.id).isPinned||(y.shiftKey&&(u||l)?C(x.id):S(x.id,y))},[c,u,l,e,C,S]),E=s.useCallback((x,y)=>{if(u&&y.shiftKey){var O;(O=window.getSelection())==null||O.removeAllRanges()}},[u]),T=s.useCallback((x,y)=>{y.nativeEvent.shiftKey?C(x.id):e.current.selectRow(x.id,x.value)},[e,C]),M=s.useCallback(x=>{const O=t.checkboxSelectionVisibleOnly&&t.pagination?Hr(e):Yt(e);e.current.selectRows(O,x.value)},[e,t.checkboxSelectionVisibleOnly,t.pagination]),A=s.useCallback((x,y)=>{if(e.current.getCellMode(x.id,x.field)!==ue.Edit&&y.currentTarget.contains(y.target)){if(ln(y.key)&&y.shiftKey){const O=Qe(e);if(O&&O.id!==x.id){y.preventDefault();const V=e.current.isRowSelected(O.id);if(!u){e.current.selectRow(O.id,!V,!0);return}const R=e.current.getRowIndexRelativeToVisibleRows(O.id),D=e.current.getRowIndexRelativeToVisibleRows(x.id);let G,z;R>D?V?(G=D,z=R-1):(G=D,z=R):V?(G=R+1,z=D):(G=R,z=D);const N=f.rows.slice(G,z+1).map(K=>K.id);e.current.selectRows(N,!V);return}}if(y.key===" "&&y.shiftKey){y.preventDefault(),S(x.id,y);return}y.key.toLowerCase()==="a"&&(y.ctrlKey||y.metaKey)&&(y.preventDefault(),v(e.current.getAllRowIds(),!0))}},[e,S,v,f.rows,u]);Q(e,"sortedRowsSet",F),Q(e,"rowClick",w),Q(e,"rowSelectionCheckboxChange",T),Q(e,"headerSelectionCheckboxChange",M),Q(e,"cellMouseDown",E),Q(e,"cellKeyDown",A),s.useEffect(()=>{o!==void 0&&e.current.setSelectionModel(o)},[e,o]);const H=o!=null;s.useEffect(()=>{if(H)return;const x=Ke(e.current.state);if(p){const y=x.filter(O=>p(O));y.length<x.length&&e.current.setSelectionModel(y)}},[e,p,H]),s.useEffect(()=>{const x=Ke(e.current.state);if(!u&&x.length>1){const{rows:y}=In(e,{pagination:a,paginationMode:g}),O=y.reduce((R,{id:D})=>(R[D]=!0,R),{}),V=x.find(R=>{let D=!0;return p&&(D=p(R)),D&&O[R]});e.current.setSelectionModel(V!==void 0?[V]:[])}},[e,u,l,i,p,a,g])},bm={noRowsLabel:"No rows",noResultsOverlayLabel:"No results found.",errorOverlayDefaultLabel:"An error occurred.",toolbarDensity:"Density",toolbarDensityLabel:"Density",toolbarDensityCompact:"Compact",toolbarDensityStandard:"Standard",toolbarDensityComfortable:"Comfortable",toolbarColumns:"Columns",toolbarColumnsLabel:"Select columns",toolbarFilters:"Filters",toolbarFiltersLabel:"Show filters",toolbarFiltersTooltipHide:"Hide filters",toolbarFiltersTooltipShow:"Show filters",toolbarFiltersTooltipActive:e=>e!==1?`${e} active filters`:`${e} active filter`,toolbarQuickFilterPlaceholder:"Search…",toolbarQuickFilterLabel:"Search",toolbarQuickFilterDeleteIconLabel:"Clear",toolbarExport:"Export",toolbarExportLabel:"Export",toolbarExportCSV:"Download as CSV",toolbarExportPrint:"Print",toolbarExportExcel:"Download as Excel",columnsPanelTextFieldLabel:"Find column",columnsPanelTextFieldPlaceholder:"Column title",columnsPanelDragIconLabel:"Reorder column",columnsPanelShowAllButton:"Show all",columnsPanelHideAllButton:"Hide all",filterPanelAddFilter:"Add filter",filterPanelDeleteIconLabel:"Delete",filterPanelLinkOperator:"Logic operator",filterPanelOperators:"Operator",filterPanelOperatorAnd:"And",filterPanelOperatorOr:"Or",filterPanelColumns:"Columns",filterPanelInputLabel:"Value",filterPanelInputPlaceholder:"Filter value",filterOperatorContains:"contains",filterOperatorEquals:"equals",filterOperatorStartsWith:"starts with",filterOperatorEndsWith:"ends with",filterOperatorIs:"is",filterOperatorNot:"is not",filterOperatorAfter:"is after",filterOperatorOnOrAfter:"is on or after",filterOperatorBefore:"is before",filterOperatorOnOrBefore:"is on or before",filterOperatorIsEmpty:"is empty",filterOperatorIsNotEmpty:"is not empty",filterOperatorIsAnyOf:"is any of",filterValueAny:"any",filterValueTrue:"true",filterValueFalse:"false",columnMenuLabel:"Menu",columnMenuShowColumns:"Show columns",columnMenuFilter:"Filter",columnMenuHideColumn:"Hide",columnMenuUnsort:"Unsort",columnMenuSortAsc:"Sort by ASC",columnMenuSortDesc:"Sort by DESC",columnHeaderFiltersTooltipActive:e=>e!==1?`${e} active filters`:`${e} active filter`,columnHeaderFiltersLabel:"Show filters",columnHeaderSortIconLabel:"Sort",footerRowSelected:e=>e!==1?`${e.toLocaleString()} rows selected`:`${e.toLocaleString()} row selected`,footerTotalRows:"Total Rows:",footerTotalVisibleRows:(e,t)=>`${e.toLocaleString()} of ${t.toLocaleString()}`,checkboxSelectionHeaderName:"Checkbox selection",checkboxSelectionSelectAllRows:"Select all rows",checkboxSelectionUnselectAllRows:"Unselect all rows",checkboxSelectionSelectRow:"Select row",checkboxSelectionUnselectRow:"Unselect row",booleanCellTrueLabel:"yes",booleanCellFalseLabel:"no",actionsCellMore:"more",pinToLeft:"Pin to left",pinToRight:"Pin to right",unpin:"Unpin",treeDataGroupingHeaderName:"Group",treeDataExpand:"see children",treeDataCollapse:"hide children",groupingColumnHeaderName:"Group",groupColumn:e=>`Group by ${e}`,unGroupColumn:e=>`Stop grouping by ${e}`,detailPanelToggle:"Detail panel toggle",expandDetailPanel:"Expand",collapseDetailPanel:"Collapse",MuiTablePagination:{},rowReorderingHeaderName:"Row reordering",aggregationMenuItemHeader:"Aggregation",aggregationFunctionLabelSum:"sum",aggregationFunctionLabelAvg:"avg",aggregationFunctionLabelMin:"min",aggregationFunctionLabelMax:"max",aggregationFunctionLabelSize:"size"},wm=["sortingOrder"],vm=s.memo(function(t){const{sortingOrder:n}=t,o=Z(t,wm),r=J(),[l]=n,i=l==="asc"?r.components.ColumnSortedAscendingIcon:r.components.ColumnSortedDescendingIcon;return i?_(i,m({},o)):null}),Sm=["error","hasError","errorInfo"],Pm=s.forwardRef(function(t,n){const{error:o}=t,r=Z(t,Sm),l=se(),i=l.current.getLocaleText("errorOverlayDefaultLabel"),c=ee(l,on);return _(xn,m({ref:n,sx:{width:"100%",minHeight:2*c}},r,{children:(o==null?void 0:o.message)||i}))}),ym=s.forwardRef(function(t,n){const r=se().current.getLocaleText("noResultsOverlayLabel");return _(xn,m({ref:n},t,{children:r}))}),xm={BooleanCellTrueIcon:Fl,BooleanCellFalseIcon:En,ColumnMenuIcon:Tl,OpenFilterButtonIcon:$l,FilterPanelDeleteIcon:En,ColumnFilteredIcon:_l,ColumnSelectorIcon:Dl,ColumnUnsortedIcon:vm,ColumnSortedAscendingIcon:Rl,ColumnSortedDescendingIcon:Ol,ColumnResizeIcon:Hl,DensityCompactIcon:Ll,DensityStandardIcon:Vl,DensityComfortableIcon:Gl,ExportIcon:Al,MoreActionsIcon:Bl,TreeDataCollapseIcon:xo,TreeDataExpandIcon:Io,GroupingCriteriaCollapseIcon:xo,GroupingCriteriaExpandIcon:Io,DetailPanelExpandIcon:ur,DetailPanelCollapseIcon:zl,RowReorderIcon:cr,QuickFilterIcon:Nl,QuickFilterClearIcon:En},er=m({},xm,{BaseCheckbox:xl,BaseTextField:Il,BaseFormControl:zt,BaseSelect:lr,BaseSwitch:El,BaseButton:Ml,BaseTooltip:kl,BasePopper:Un,Cell:zi,SkeletonCell:$a,ColumnHeaderFilterIconButton:Cc,ColumnMenu:xu,ErrorOverlay:Pm,Footer:Md,Header:kd,Toolbar:null,PreferencesPanel:Zu,LoadingOverlay:Fd,NoResultsOverlay:ym,NoRowsOverlay:Td,Pagination:_d,FilterPanel:dd,ColumnsPanel:Wu,Panel:Xu,Row:Ld}),Im=e=>{const{classes:t}=e;return s.useMemo(()=>ce({cellCheckbox:["cellCheckbox"],columnHeaderCheckbox:["columnHeaderCheckbox"]},ge,t),[t])},Em=(e,t)=>{const n={classes:t.classes},o=Im(n),r=s.useCallback(l=>{const i=m({},sn,{cellClassName:o.cellCheckbox,headerClassName:o.columnHeaderCheckbox,headerName:e.current.getLocaleText("checkboxSelectionHeaderName")}),c=t.checkboxSelection,a=l.lookup[ft]!=null;return c&&!a?(l.lookup[ft]=i,l.all=[ft,...l.all]):!c&&a?(delete l.lookup[ft],l.all=l.all.filter(g=>g!==ft)):c&&a&&(l.lookup[ft]=m({},i,l.lookup[ft])),l},[e,o,t.checkboxSelection]);De(e,"hydrateColumns",r)},Mm=(e,t)=>{var n,o,r,l;const i=(n=(o=t.sortModel)!=null?o:(r=t.initialState)==null||(l=r.sorting)==null?void 0:l.sortModel)!=null?n:[];return m({},e,{sorting:{sortModel:Lr(i,t.disableMultipleColumnsSorting),sortedRows:[]}})},km=(e,t)=>{var n,o;const r=Me(e,"useGridSorting");e.current.unstable_registerControlState({stateId:"sortModel",propModel:t.sortModel,propOnChange:t.onSortModelChange,stateSelector:Ye,changeEvent:"sortModelChange"});const l=s.useCallback((S,w)=>{const E=Ye(e),T=E.findIndex(A=>A.field===S);let M=[...E];return T>-1?w?M.splice(T,1,w):M.splice(T,1):M=[...E,w],M},[e]),i=s.useCallback((S,w)=>{var E;const M=Ye(e).find(H=>H.field===S.field);if(M){var A;const H=w===void 0?Lo((A=S.sortingOrder)!=null?A:t.sortingOrder,M.sort):w;return H==null?void 0:m({},M,{sort:H})}return{field:S.field,sort:w===void 0?Lo((E=S.sortingOrder)!=null?E:t.sortingOrder):w}},[e,t.sortingOrder]),c=s.useCallback(()=>{e.current.setState(S=>{if(t.sortingMode===Lt.server)return r.debug("Skipping sorting rows as sortingMode = server"),m({},S,{sorting:m({},S.sorting,{sortedRows:xt(S,e.current.instanceId)})});const w=Ye(S,e.current.instanceId),E=Hc(w,e),T=e.current.unstable_applyStrategyProcessor("sorting",{sortRowList:E});return m({},S,{sorting:m({},S.sorting,{sortedRows:T})})}),e.current.publishEvent("sortedRowsSet"),e.current.forceUpdate()},[e,r,t.sortingMode]),a=s.useCallback(S=>{Ye(e)!==S&&(r.debug("Setting sort model"),e.current.setState(Ho(S,t.disableMultipleColumnsSorting)),e.current.forceUpdate(),e.current.applySorting())},[e,r,t.disableMultipleColumnsSorting]),g=s.useCallback((S,w,E)=>{if(!S.sortable)return;const T=i(S,w);let M;!E||t.disableMultipleColumnsSorting?M=T?[T]:[]:M=l(S.field,T),e.current.setSortModel(M)},[e,l,i,t.disableMultipleColumnsSorting]),d=s.useCallback(()=>Ye(e),[e]),u=s.useCallback(()=>Jn(e).map(w=>w.model),[e]),f=s.useCallback(()=>Zn(e),[e]),C=s.useCallback(S=>e.current.getSortedRowIds().indexOf(S),[e]),P=s.useCallback(S=>e.current.getSortedRowIds()[S],[e]);Ce(e,{getSortModel:d,getSortedRows:u,getSortedRowIds:f,getRowIndex:C,getRowIdFromRowIndex:P,setSortModel:a,sortColumn:g,applySorting:c});const p=s.useCallback((S,w)=>{var E,T;const M=Ye(e);return!w.exportOnlyDirtyModels||t.sortModel!=null||((E=t.initialState)==null||(T=E.sorting)==null?void 0:T.sortModel)!=null||M.length>0?m({},S,{sorting:{sortModel:M}}):S},[e,t.sortModel,(n=t.initialState)==null||(o=n.sorting)==null?void 0:o.sortModel]),I=s.useCallback((S,w)=>{var E;const T=(E=w.stateToRestore.sorting)==null?void 0:E.sortModel;return T==null?S:(e.current.setState(Ho(T,t.disableMultipleColumnsSorting)),m({},S,{callbacks:[...S.callbacks,e.current.applySorting]}))},[e,t.disableMultipleColumnsSorting]),$=s.useCallback(S=>{const w=bt(e);if(!S.sortRowList){const M=[],A=[];return xt(e).forEach(H=>{w[H].isPinned||(w[H].position==="footer"?A.push(H):M.push(H))}),[...M,...A]}const E=[],T=[];return Object.values(w).forEach(M=>{M.isPinned||(M.position==="footer"?T.push(M.id):E.push(M))}),[...S.sortRowList(E),...T]},[e]);De(e,"exportState",p),De(e,"restoreState",I),go(e,cn,"sorting",$);const v=s.useCallback(({colDef:S},w)=>{const E=w.shiftKey||w.metaKey||w.ctrlKey;g(S,void 0,E)},[g]),h=s.useCallback(({colDef:S},w)=>{Tr(w.key)&&!w.ctrlKey&&!w.metaKey&&g(S,void 0,w.shiftKey)},[g]),k=s.useCallback(()=>{const S=Ye(e),w=Nt(e);if(S.length>0){const E=S.filter(T=>w[T.field]);E.length<S.length&&e.current.setSortModel(E)}},[e]),F=s.useCallback(S=>{S==="sorting"&&e.current.applySorting()},[e]);Q(e,"columnHeaderClick",v),Q(e,"columnHeaderKeyDown",h),Q(e,"rowsSet",e.current.applySorting),Q(e,"columnsChange",k),Q(e,"activeStrategyProcessorChange",F),an(()=>{e.current.applySorting()}),s.useEffect(()=>{t.sortModel!==void 0&&e.current.setSortModel(t.sortModel)},[e,t.sortModel])};function tr(e){const{clientHeight:t,scrollTop:n,offsetHeight:o,offsetTop:r}=e,l=r+o;if(o>t)return r;if(l-t>n)return l-t;if(r<n)return r}const Fm=(e,t)=>{const n=Me(e,"useGridScroll"),o=e.current.columnHeadersElementRef,r=e.current.windowRef,l=ee(e,gt),i=s.useCallback(d=>{const u=Sn(e),f=Oe(e);if(!(d.rowIndex==null)&&u===0||f.length===0)return!1;n.debug(`Scrolling to cell at row ${d.rowIndex}, col: ${d.colIndex} `);let P={};if(d.colIndex!=null){const $=kt(e);let v;if(typeof d.rowIndex<"u"){var b;const h=(b=l[d.rowIndex])==null?void 0:b.id,k=e.current.unstable_getCellColSpanInfo(h,d.colIndex);k&&!k.spannedByColSpan&&(v=k.cellProps.width)}typeof v>"u"&&(v=f[d.colIndex].computedWidth),P.left=tr({clientHeight:r.current.clientWidth,scrollTop:r.current.scrollLeft,offsetHeight:v,offsetTop:$[d.colIndex]})}if(d.rowIndex!=null){var p,I;const $=en(e.current.state),v=jt(e),h=Qt(e),k=t.pagination?d.rowIndex-v*h:d.rowIndex,F=$.positions[k+1]?$.positions[k+1]-$.positions[k]:$.currentPageTotalHeight-$.positions[k],S=((p=r.current.querySelector(`.${L["pinnedRows--top"]}`))==null?void 0:p.clientHeight)||0,w=((I=r.current.querySelector(`.${L["pinnedRows--bottom"]}`))==null?void 0:I.clientHeight)||0;P.top=tr({clientHeight:r.current.clientHeight-S-w,scrollTop:r.current.scrollTop,offsetHeight:F,offsetTop:$.positions[k]})}return P=e.current.unstable_applyPipeProcessors("scrollToIndexes",P,d),typeof P.left!==void 0||typeof P.top!==void 0?(e.current.scroll(P),!0):!1},[n,e,r,t.pagination,l]),c=s.useCallback(d=>{r.current&&d.left!=null&&o.current&&(o.current.scrollLeft=d.left,r.current.scrollLeft=d.left,n.debug(`Scrolling left: ${d.left}`)),r.current&&d.top!=null&&(r.current.scrollTop=d.top,n.debug(`Scrolling top: ${d.top}`)),n.debug("Scrolling, updating container, and viewport")},[r,o,n]),a=s.useCallback(()=>r!=null&&r.current?{top:r.current.scrollTop,left:r.current.scrollLeft}:{top:0,left:0},[r]);Ce(e,{scroll:c,scrollToIndexes:i,getScrollPosition:a})};function Tm(e,t){me(e,"columnHeaderClick",t.onColumnHeaderClick),me(e,"columnHeaderDoubleClick",t.onColumnHeaderDoubleClick),me(e,"columnHeaderOver",t.onColumnHeaderOver),me(e,"columnHeaderOut",t.onColumnHeaderOut),me(e,"columnHeaderEnter",t.onColumnHeaderEnter),me(e,"columnHeaderLeave",t.onColumnHeaderLeave),me(e,"columnOrderChange",t.onColumnOrderChange),me(e,"cellClick",t.onCellClick),me(e,"cellDoubleClick",t.onCellDoubleClick),me(e,"cellKeyDown",t.onCellKeyDown),me(e,"cellFocusOut",t.onCellFocusOut),me(e,"preferencePanelClose",t.onPreferencePanelClose),me(e,"preferencePanelOpen",t.onPreferencePanelOpen),me(e,"menuOpen",t.onMenuOpen),me(e,"menuClose",t.onMenuClose),me(e,"rowDoubleClick",t.onRowDoubleClick),me(e,"rowClick",t.onRowClick),me(e,"componentError",t.onError),me(e,"stateChange",t.onStateChange)}const $m=({content:e,container:t,scrollBarSize:n})=>{const o=e.width>t.width,r=e.height>t.height;let l=!1,i=!1;return(o||r)&&(l=o,i=e.height+(l?n:0)>t.height,i&&(l=e.width+n>t.width)),{hasScrollX:l,hasScrollY:i}};function _m(e,t){const n=Me(e,"useResizeContainer"),o=s.useRef(!1),r=s.useRef(null),l=s.useRef(null),i=ee(e,en),c=ee(e,rn),a=s.useCallback(()=>{var p;const I=(p=e.current.rootElementRef)==null?void 0:p.current,$=Pn(e),v=sl(e);if(!r.current)return;let h;if(t.scrollbarSize!=null)h=t.scrollbarSize;else if(!$||!I)h=0;else{const A=It(I).createElement("div");A.style.width="99px",A.style.height="99px",A.style.position="absolute",A.style.overflow="scroll",A.className="scrollDiv",I.appendChild(A),h=A.offsetWidth-A.clientWidth,I.removeChild(A)}let k,F,S;if(t.autoHeight)S=!1,F=Math.round($)>r.current.width,k={width:r.current.width,height:i.currentPageTotalHeight+(F?h:0)};else{k={width:r.current.width,height:r.current.height-c};const M=$m({content:{width:Math.round($),height:i.currentPageTotalHeight},container:{width:k.width,height:k.height-v.top-v.bottom},scrollBarSize:h});S=M.hasScrollY,F=M.hasScrollX}const w={width:k.width-(S?h:0),height:k.height-(F?h:0)},E={viewportOuterSize:k,viewportInnerSize:w,hasScrollX:F,hasScrollY:S,scrollBarSize:h},T=l.current;l.current=E,(E.viewportInnerSize.width!==(T==null?void 0:T.viewportInnerSize.width)||E.viewportInnerSize.height!==(T==null?void 0:T.viewportInnerSize.height))&&e.current.publishEvent("viewportInnerSizeChange",E.viewportInnerSize)},[e,t.scrollbarSize,t.autoHeight,c,i.currentPageTotalHeight]),g=s.useCallback(()=>{a(),e.current.publishEvent("debouncedResize",r.current)},[e,a]),d=s.useCallback(()=>l.current,[]),u=s.useCallback(()=>{const p=e.current.getRootDimensions();if(!p)return 0;const I=In(e,{pagination:t.pagination,paginationMode:t.paginationMode});if(t.getRowHeight){const v=e.current.unstable_getRenderContext(),h=v.lastRowIndex-v.firstRowIndex;return Math.min(h-1,I.rows.length)}const $=Math.floor(p.viewportInnerSize.height/on(e));return Math.min($,I.rows.length)},[e,t.pagination,t.paginationMode,t.getRowHeight]);Ce(e,{resize:g,getRootDimensions:d,unstable_getViewportPageSize:u,unstable_updateGridDimensionsRef:a});const C=s.useMemo(()=>dr(g,60),[g]),P=s.useRef(!0),b=s.useCallback(p=>{r.current=p;const I=/jsdom/.test(window.navigator.userAgent);if(p.height===0&&!o.current&&!t.autoHeight&&!I&&(n.error(["The parent DOM element of the data grid has an empty height.","Please make sure that this element has an intrinsic height.","The grid displays with a height of 0px.","","More details: https://mui.com/r/x-data-grid-no-dimensions."].join(`
`)),o.current=!0),p.width===0&&!o.current&&!I&&(n.error(["The parent DOM element of the data grid has an empty width.","Please make sure that this element has an intrinsic width.","The grid displays with a width of 0px.","","More details: https://mui.com/r/x-data-grid-no-dimensions."].join(`
`)),o.current=!0),P.current){g(),P.current=!1;return}C()},[t.autoHeight,C,n,g]);Ue(()=>a(),[a]),me(e,"sortedRowsSet",a),me(e,"pageChange",a),me(e,"pageSizeChange",a),me(e,"columnsChange",a),Q(e,"resize",b),me(e,"debouncedResize",t.onResize)}const Dm=e=>m({},e,{rowsMeta:{currentPageTotalHeight:0,positions:[]}}),Rm=(e,t)=>{const{getRowHeight:n,getRowSpacing:o,getEstimatedRowHeight:r}=t,l=s.useRef({}),i=s.useRef(-1),c=s.useRef(!1),a=ee(e,on),g=ee(e,nn),d=ee(e,Ut),u=ee(e,Xn),f=$t(e,t),C=ee(e,tn),P=s.useCallback(()=>{var E,T;c.current=!1;const M=Ti(e.current.state,e.current.instanceId),A=y=>{l.current[y.id]||(l.current[y.id]={sizes:{baseCenter:a},isResized:!1,autoHeight:!1,needsFirstMeasurement:!0});const{isResized:O,needsFirstMeasurement:V,sizes:R}=l.current[y.id];let D=a;const G=R.baseCenter;if(O)D=G;else if(n){const q=n(m({},y,{densityFactor:M}));if(q==="auto"){if(V){const oe=r?r(m({},y,{densityFactor:M})):a;D=oe??a}else D=G;c.current=!0,l.current[y.id].autoHeight=!0}else D=q??a,l.current[y.id].needsFirstMeasurement=!1,l.current[y.id].autoHeight=!1}else l.current[y.id].needsFirstMeasurement=!1;const z=Object.entries(R).reduce((q,[oe,U])=>(/^base[A-Z]/.test(oe)&&(q[oe]=U),q),{}),N=m({},z,{baseCenter:D});if(o){var K,W;const q=e.current.getRowIndexRelativeToVisibleRows(y.id),oe=o(m({},y,{isFirstVisible:q===0,isLastVisible:q===f.rows.length-1,indexRelativeToCurrentPage:q}));N.spacingTop=(K=oe.top)!=null?K:0,N.spacingBottom=(W=oe.bottom)!=null?W:0}const te=e.current.unstable_applyPipeProcessors("rowHeight",N,y);return l.current[y.id].sizes=te,te},H=[],x=f.rows.reduce((y,O)=>{H.push(y);let V=0,R=0;const D=A(O);return Object.entries(D).forEach(([G,z])=>{/^base[A-Z]/.test(G)?V=z>V?z:V:R+=z}),y+V+R},0);C==null||(E=C.top)==null||E.forEach(y=>{A(y)}),C==null||(T=C.bottom)==null||T.forEach(y=>{A(y)}),e.current.setState(y=>m({},y,{rowsMeta:{currentPageTotalHeight:x,positions:H}})),c.current||(i.current=1/0),e.current.forceUpdate()},[e,f.rows,a,n,o,r,C]),b=s.useCallback(E=>{const T=l.current[E];return T?T.sizes.baseCenter:a},[a]),p=E=>{var T;return(T=l.current[E])==null?void 0:T.sizes},I=s.useCallback((E,T)=>{l.current[E].sizes.baseCenter=T,l.current[E].isResized=!0,l.current[E].needsFirstMeasurement=!1,P()},[P]),$=s.useMemo(()=>dr(P),[P]),v=s.useCallback((E,T,M)=>{if(!l.current[E]||!l.current[E].autoHeight)return;const A=l.current[E].sizes[`base${Pe(M)}`]!==T;l.current[E].needsFirstMeasurement=!1,l.current[E].sizes[`base${Pe(M)}`]=T,A&&$()},[$]),h=s.useCallback(E=>{var T;return((T=l.current[E])==null?void 0:T.autoHeight)||!1},[]),k=s.useCallback(()=>i.current,[]),F=s.useCallback(E=>{c.current&&E>i.current&&(i.current=E)},[]),S=s.useCallback(()=>{l.current={},P()},[P]);s.useEffect(()=>{P()},[a,g,d,u,P]),uo(e,"rowHeight",P),Ce(e,{unstable_getLastMeasuredRowIndex:k,unstable_setLastMeasuredRowIndex:F,unstable_rowHasAutoHeight:h,unstable_getRowHeight:b,unstable_getRowInternalSizes:p,unstable_setRowHeight:I,unstable_storeRowHeightMeasurement:v,resetRowHeights:S})},Om=e=>{const t=s.useCallback((r={})=>e.current.unstable_applyPipeProcessors("exportState",{},r),[e]),n=s.useCallback(r=>{e.current.unstable_applyPipeProcessors("restoreState",{callbacks:[]},{stateToRestore:r}).callbacks.forEach(i=>{i()}),e.current.forceUpdate()},[e]);Ce(e,{exportState:t,restoreState:n})},Hm=e=>{const t=s.useRef({}),n=s.useCallback((a,g,d)=>{const u=t.current;u[a]||(u[a]={}),u[a][g]=d},[]),o=s.useCallback((a,g)=>{var d;return(d=t.current[a])==null?void 0:d[g]},[]),r=s.useCallback(a=>{const{columnIndex:g,rowId:d,minFirstColumnIndex:u,maxLastColumnIndex:f,columns:C}=a,P=C.length,b=C[g],p=typeof b.colSpan=="function"?b.colSpan(e.current.getCellParams(d,b.field)):b.colSpan;if(!p||p===1)return n(d,g,{spannedByColSpan:!1,cellProps:{colSpan:1,width:b.computedWidth}}),{colSpan:1};let I=b.computedWidth;for(let $=1;$<p;$+=1){const v=g+$;if(v>=u&&v<f){const h=C[v];I+=h.computedWidth,n(d,g+$,{spannedByColSpan:!0,rightVisibleCellIndex:Math.min(g+p,P-1),leftVisibleCellIndex:g})}n(d,g,{spannedByColSpan:!1,cellProps:{colSpan:p,width:I}})}return{colSpan:p}},[e,n]),l=s.useCallback(({rowId:a,minFirstColumn:g,maxLastColumn:d,columns:u})=>{for(let f=g;f<d;f+=1){const C=r({columnIndex:f,rowId:a,minFirstColumnIndex:g,maxLastColumnIndex:d,columns:u});C.colSpan>1&&(f+=C.colSpan-1)}},[r]);Ce(e,{unstable_getCellColSpanInfo:o,unstable_calculateColSpan:l});const c=s.useCallback(()=>{t.current={}},[]);Q(e,"columnOrderChange",c)},Lm=(e,t)=>{var n;const o=s.useCallback(r=>{var l;if(!((l=t.experimentalFeatures)!=null&&l.columnGrouping))return r;const i=el(t.columnGroupingModel);return r.all.forEach(c=>{var a,g;const d=(a=i[c])!=null?a:[],u=r.lookup[c];Cg(u)&&dt(d,u==null?void 0:u.groupPath)||(r.lookup[c]=m({},r.lookup[c],{groupPath:(g=i[c])!=null?g:[]}))}),r},[t.columnGroupingModel,(n=t.experimentalFeatures)==null?void 0:n.columnGrouping]);De(e,"hydrateColumns",o)},Vm=e=>{var t,n;const o=ag(void 0,e);return Lm(o,e),Em(o,e),fm(o),Ne(pm,o,e),Ne(mg,o,e),Ne(bg,o,e),Ne(dm,o,e),Ne((t=e.experimentalFeatures)!=null&&t.newEditingApi?cm:Jg,o,e),Ne(Bg,o,e),Ne(Mm,o,e),Ne(Yg,o,e),Ne(Gg,o,e),Ne(vg,o,e),Ne(jg,o,e),Ne(Dm,o,e),Ne(dg,o,e),Ug(o,e),Cm(o,e),fg(o,e),gm(o,e),hm(o),Hm(o),wg(o,e),((n=e.experimentalFeatures)!=null&&n.newEditingApi?um:em)(o,e),zg(o,e),Qg(o,e),Ag(o,e),km(o,e),Sg(o,e),qg(o,e),Rm(o,e),Fm(o,e),gg(o),Eg(o),Fg(o,e),ug(o),_m(o,e),Tm(o,e),Om(o),o},Gm={apiRef:void 0,disableMultipleColumnsFiltering:!0,disableMultipleColumnsSorting:!0,disableMultipleSelection:!0,throttleRowsMs:void 0,hideFooterRowCount:!1,pagination:!0,checkboxSelectionVisibleOnly:!1,disableColumnReorder:!0,disableColumnResize:!0,keepColumnPositionIfDraggedOutside:!1,signature:"DataGrid"},Am=100,Bm={autoHeight:!1,autoPageSize:!1,checkboxSelection:!1,checkboxSelectionVisibleOnly:!1,columnBuffer:3,rowBuffer:3,columnThreshold:3,rowThreshold:3,density:Zt.Standard,disableExtendRowFullWidth:!1,disableColumnFilter:!1,disableColumnMenu:!1,disableColumnSelector:!1,disableDensitySelector:!1,disableMultipleColumnsFiltering:!1,disableMultipleSelection:!1,disableMultipleColumnsSorting:!1,disableSelectionOnClick:!1,disableVirtualization:!1,disableIgnoreModificationsIfProcessingProps:!1,editMode:Re.Cell,filterMode:Lt.client,headerHeight:56,hideFooter:!1,hideFooterPagination:!1,hideFooterRowCount:!1,hideFooterSelectedRowCount:!1,logger:console,logLevel:"error",pagination:!1,paginationMode:Lt.client,rowHeight:52,rowsPerPageOptions:[25,50,100],rowSpacingType:"margin",showCellRightBorder:!1,showColumnRightBorder:!1,sortingOrder:["asc","desc",null],sortingMode:Lt.client,throttleRowsMs:0,disableColumnReorder:!1,disableColumnResize:!1,keepNonExistentRowsSelected:!1,keepColumnPositionIfDraggedOutside:!1},zm=e=>{if(e.pageSize>Am)throw new Error("'props.pageSize' cannot exceed 100 in DataGrid.");const t=Ul({props:e,name:"MuiDataGrid"}),n=s.useMemo(()=>m({},bm,t.localeText),[t.localeText]),o=s.useMemo(()=>{const r=t.components;if(!r)return m({},er);const l={};return Object.entries(er).forEach(([i,c])=>{l[i]=r[i]===void 0?c:r[i]}),l},[t.components]);return s.useMemo(()=>m({},Bm,t,{localeText:n,components:o},Gm),[t,n,o])},Nm=["className"],Um=e=>{const{classes:t}=e;return ce({root:["virtualScroller"]},ge,t)},Km=ie("div",{name:"MuiDataGrid",slot:"VirtualScroller",overridesResolver:(e,t)=>t.virtualScroller})({overflow:"auto",position:"relative","@media print":{overflow:"hidden"}}),Wm=s.forwardRef(function(t,n){const{className:o}=t,r=Z(t,Nm),l=J(),i=Um(l);return _(Km,m({ref:n,className:pe(i.root,o),ownerState:l},r))}),jm=["className","style"],qm=e=>{const{classes:t,overflowedContent:n}=e;return ce({root:["virtualScrollerContent",n&&"virtualScrollerContent--overflowed"]},ge,t)},Ym=ie("div",{name:"MuiDataGrid",slot:"VirtualScrollerContent",overridesResolver:(e,t)=>t.virtualScrollerContent})({}),Qm=s.forwardRef(function(t,n){const{className:o,style:r}=t,l=Z(t,jm),i=J(),c=m({},i,{overflowedContent:!i.autoHeight&&(r==null?void 0:r.minHeight)==="auto"}),a=qm(c);return _(Ym,m({ref:n,className:pe(a.root,o),ownerState:c,style:r},l))}),Xm=["className"],Zm=e=>{const{classes:t}=e;return ce({root:["virtualScrollerRenderZone"]},ge,t)},Jm=ie("div",{name:"MuiDataGrid",slot:"VirtualScrollerRenderZone",overridesResolver:(e,t)=>t.virtualScrollerRenderZone})({position:"absolute",display:"flex",flexDirection:"column"}),ef=s.forwardRef(function(t,n){const{className:o}=t,r=Z(t,Xm),l=J(),i=Zm(l);return _(Jm,m({ref:n,className:pe(i.root,o),ownerState:l},r))}),tf=["style"];function Vt(e,t,n=0,o=t.length){if(t.length<=0)return-1;if(n>=o)return n;const r=n+Math.floor((o-n)/2),l=t[r];return e<=l?Vt(e,t,n,r):Vt(e,t,r+1,o)}function nf(e,t,n){let o=1;for(;n<t.length&&t[n]<e;)n+=o,o*=2;return Vt(e,t,Math.floor(n/2),Math.min(n,t.length))}const Ct=({firstIndex:e,lastIndex:t,buffer:n,minFirstIndex:o,maxLastIndex:r})=>[At(e-n,o,r),At(t+n,o,r)],of=(e,t)=>e===t?!0:e.firstRowIndex===t.firstRowIndex&&e.lastRowIndex===t.lastRowIndex&&e.firstColumnIndex===t.firstColumnIndex&&e.lastColumnIndex===t.lastColumnIndex,rf=e=>{var t,n;const o=se(),r=J(),l=ee(o,Oe),{ref:i,disableVirtualization:c,onRenderZonePositioning:a,renderZoneMinColumnIndex:g=0,renderZoneMaxColumnIndex:d=l.length,getRowProps:u}=e,f=ee(o,kt),C=ee(o,Pn),P=ee(o,on),b=ee(o,Qe),p=ee(o,hn),I=ee(o,en),$=ee(o,ye),v=ee(o,bn),h=$t(o,r),k=s.useRef(null),F=s.useRef(null),S=rt(i,F),[w,E]=s.useState(null),T=s.useRef(w),M=s.useRef({top:0,left:0}),[A,H]=s.useState({width:null,height:null}),x=s.useRef(C),y=s.useCallback(U=>{var Y,X;const ae=o.current.unstable_getLastMeasuredRowIndex();let de=ae===1/0;(Y=h.range)!=null&&Y.lastRowIndex&&!de&&(de=ae>=h.range.lastRowIndex);const be=At(ae-(((X=h.range)==null?void 0:X.firstRowIndex)||0),0,I.positions.length);return de||I.positions[be]>=U?Vt(U,I.positions):nf(U,I.positions,be)},[o,(t=h.range)==null?void 0:t.firstRowIndex,(n=h.range)==null?void 0:n.lastRowIndex,I.positions]),O=s.useCallback(()=>{if(c)return{firstRowIndex:0,lastRowIndex:h.rows.length,firstColumnIndex:0,lastColumnIndex:l.length};const{top:U,left:Y}=M.current,X=Math.min(y(U),I.positions.length-1),ae=r.autoHeight?X+h.rows.length:y(U+A.height);let de=!1,be=0,xe=f.length;const[j,re]=Ct({firstIndex:X,lastIndex:ae,minFirstIndex:0,maxLastIndex:h.rows.length,buffer:r.rowBuffer});for(let le=j;le<re&&!de;le+=1){const fe=h.rows[le];de=o.current.unstable_rowHasAutoHeight(fe.id)}return de||(be=Vt(Y,f),xe=Vt(Y+A.width,f)),{firstRowIndex:X,lastRowIndex:ae,firstColumnIndex:be,lastColumnIndex:xe}},[c,y,I.positions.length,r.autoHeight,r.rowBuffer,h.rows,f,l.length,o,A]);Ue(()=>{c?k.current.style.transform="translate3d(0px, 0px, 0px)":(F.current.scrollLeft=0,F.current.scrollTop=0)},[c]),Ue(()=>{H({width:F.current.clientWidth,height:F.current.clientHeight})},[I.currentPageTotalHeight]);const V=s.useCallback(U=>{H({width:U.width,height:U.height})},[]);Q(o,"resize",V);const R=s.useCallback(U=>{const[Y,X]=Ct({firstIndex:U.firstRowIndex,lastIndex:U.lastRowIndex,minFirstIndex:0,maxLastIndex:h.rows.length,buffer:r.rowBuffer}),[ae]=Ct({firstIndex:U.firstColumnIndex,lastIndex:U.lastColumnIndex,minFirstIndex:g,maxLastIndex:d,buffer:r.columnBuffer}),de=Ln({firstColumnToRender:ae,apiRef:o,firstRowToRender:Y,lastRowToRender:X,visibleRows:h.rows}),be=en(o.current.state).positions[Y],xe=kt(o)[de];k.current.style.transform=`translate3d(${xe}px, ${be}px, 0px)`,typeof a=="function"&&a({top:be,left:xe})},[o,h.rows,a,g,d,r.columnBuffer,r.rowBuffer]),D=s.useCallback(U=>{if(T.current&&of(U,T.current)){R(U);return}E(U),R(U);const[Y,X]=Ct({firstIndex:U.firstRowIndex,lastIndex:U.lastRowIndex,minFirstIndex:0,maxLastIndex:h.rows.length,buffer:r.rowBuffer});o.current.publishEvent("renderedRowsIntervalChange",{firstRowToRender:Y,lastRowToRender:X}),T.current=U},[o,E,T,h.rows.length,r.rowBuffer,R]);Ue(()=>{if(A.width==null)return;const U=O();D(U);const{top:Y,left:X}=M.current,ae={top:Y,left:X,renderContext:U};o.current.publishEvent("rowsScroll",ae)},[o,O,A.width,D]);const G=U=>{const{scrollTop:Y,scrollLeft:X}=U.currentTarget;if(M.current.top=Y,M.current.left=X,X<0||Y<0||!T.current)return;const ae=c?T.current:O(),de=Math.abs(ae.firstRowIndex-T.current.firstRowIndex),be=Math.abs(ae.lastRowIndex-T.current.lastRowIndex),xe=Math.abs(ae.firstColumnIndex-T.current.firstColumnIndex),j=Math.abs(ae.lastColumnIndex-T.current.lastColumnIndex),re=de>=r.rowThreshold||be>=r.rowThreshold||xe>=r.columnThreshold||j>=r.columnThreshold||x.current!==C;o.current.publishEvent("rowsScroll",{top:Y,left:X,renderContext:re?ae:T.current},U),re&&(gr.flushSync(()=>{D(ae)}),x.current=C)},z=U=>{o.current.publishEvent("virtualScrollerWheel",{},U)},N=U=>{o.current.publishEvent("virtualScrollerTouchMove",{},U)},K=(U={renderContext:w})=>{const{renderContext:Y,minFirstColumn:X=g,maxLastColumn:ae=d,availableSpace:de=A.width,rowIndexOffset:be=0,position:xe="center"}=U;if(!Y||de==null)return null;const j=c?0:r.rowBuffer,re=c?0:r.columnBuffer,[le,fe]=Ct({firstIndex:Y.firstRowIndex,lastIndex:Y.lastRowIndex,minFirstIndex:0,maxLastIndex:h.rows.length,buffer:j}),ve=[];if(U.rows)U.rows.forEach(Ie=>{ve.push(Ie),o.current.unstable_calculateColSpan({rowId:Ie.id,minFirstColumn:X,maxLastColumn:ae,columns:l})});else{if(!h.range)return null;for(let Ie=le;Ie<fe;Ie+=1){const _e=h.rows[Ie];ve.push(_e),o.current.unstable_calculateColSpan({rowId:_e.id,minFirstColumn:X,maxLastColumn:ae,columns:l})}}const[Be,Le]=Ct({firstIndex:Y.firstColumnIndex,lastIndex:Y.lastColumnIndex,minFirstIndex:X,maxLastIndex:ae,buffer:re}),ze=Ln({firstColumnToRender:Be,apiRef:o,firstRowToRender:le,lastRowToRender:fe,visibleRows:h.rows}),Se=l.slice(ze,Le),$e=[];for(let Ie=0;Ie<ve.length;Ie+=1){var st,Ee;const{id:_e,model:Ve}=ve[Ie],un=le+Ie===h.rows.length-1,ke=o.current.unstable_rowHasAutoHeight(_e)?"auto":o.current.unstable_getRowHeight(_e);let Fe;v[_e]==null?Fe=!1:Fe=o.current.isRowSelectable(_e),$e.push(_(r.components.Row,m({row:Ve,rowId:_e,rowHeight:ke,cellFocus:b,cellTabIndex:p,editRowsState:$,renderedColumns:Se,visibleColumns:l,firstColumnToRender:ze,lastColumnToRender:Le,selected:Fe,index:be+((h==null||(st=h.range)==null?void 0:st.firstRowIndex)||0)+le+Ie,containerWidth:de,isLastVisible:un,position:xe},typeof u=="function"?u(_e,Ve):{},(Ee=r.componentsProps)==null?void 0:Ee.row),_e))}return $e},W=A.width&&C>A.width,te=s.useMemo(()=>{const U=Math.max(I.currentPageTotalHeight,1);let Y=!1;F!=null&&F.current&&U<=(F==null?void 0:F.current.clientHeight)&&(Y=!0);const X={width:W?C:"auto",height:U,minHeight:Y?"100%":"auto"};return r.autoHeight&&h.rows.length===0&&(X.height=2*P),X},[F,C,I.currentPageTotalHeight,h.rows.length,W,r.autoHeight,P]);s.useEffect(()=>{o.current.publishEvent("virtualScrollerContentSizeChange")},[o,te]),r.autoHeight&&h.rows.length===0&&(te.height=2*P);const q={};W||(q.overflowX="hidden"),r.autoHeight&&(q.overflowY="hidden");const oe=s.useCallback(()=>T.current,[]);return o.current.unstable_getRenderContext=oe,{renderContext:w,updateRenderZonePosition:R,getRows:K,getRootProps:(U={})=>{let{style:Y={}}=U,X=Z(U,tf);return m({ref:S,onScroll:G,onWheel:z,onTouchMove:N,style:m({},Y,q)},X)},getContentProps:({style:U={}}={})=>({style:m({},U,te)}),getRenderZoneProps:()=>({ref:k})}},lf=["className","disableVirtualization"],sf=s.forwardRef(function(t,n){const{className:o,disableVirtualization:r}=t,l=Z(t,lf),{getRootProps:i,getContentProps:c,getRenderZoneProps:a,getRows:g}=rf({ref:n,disableVirtualization:r});return _(Wm,m({className:o},i(l),{children:_(Qm,m({},c(),{children:_(ef,m({},a(),{children:g()}))}))}))}),af=e=>{const{classes:t,headerAlign:n,isDragging:o,showRightBorder:r,showColumnBorder:l,groupId:i}=e;return ce({root:["columnHeader",n==="left"&&"columnHeader--alignLeft",n==="center"&&"columnHeader--alignCenter",n==="right"&&"columnHeader--alignRight",o&&"columnHeader--moving",r&&"withBorder",l&&"columnHeader--showColumnBorder",i===null?"columnHeader--emptyGroup":"columnHeader--filledGroup"],draggableContainer:["columnHeaderDraggableContainer"],titleContainer:["columnHeaderTitleContainer"],titleContainerContent:["columnHeaderTitleContainerContent"]},ge,t)};function cf(e){var t,n;const{groupId:o,width:r,depth:l,maxDepth:i,fields:c,height:a,colIndex:g,isLastColumn:d,extendRowFullWidth:u}=e,f=J(),C=se(),P=ee(C,Zr),{hasScrollX:b,hasScrollY:p}=(t=C.current.getRootDimensions())!=null?t:{hasScrollX:!1,hasScrollY:!1},I=o?P[o]:{},{headerName:$=o??"",description:v="",headerAlign:h=void 0}=I;let k;const F=o&&((n=P[o])==null?void 0:n.renderHeaderGroup),S={groupId:o,headerName:$,description:v,depth:l,maxDepth:i,fields:c,colIndex:g,isLastColumn:d};o&&F&&(k=F(S));const E=d?!(d&&b&&!p)&&!u:f.showColumnRightBorder,T=f.showColumnRightBorder,M=m({},e,{classes:f.classes,showRightBorder:E,showColumnBorder:T,headerAlign:h,depth:l,isDragging:!1}),A=$??o,H=Te(),x=o===null?`empty-group-cell-${H}`:o,y=af(M),O=typeof I.headerClassName=="function"?I.headerClassName(S):I.headerClassName;return _(Or,{classes:y,columnMenuOpen:!1,colIndex:g,height:a,isResizing:!1,sortDirection:null,hasFocus:!1,tabIndex:-1,isDraggable:!1,headerComponent:k,headerClassName:O,description:v,elementId:x,width:r,columnMenuIconButton:null,columnTitleIconButtons:null,resizable:!1,label:A,"aria-colspan":c.length,"data-fields":`|-${c.join("-|-")}-|`,disableHeaderSeparator:!0})}const nr=ie("div",{name:"MuiDataGrid",slot:"ColumnHeaderRow",overridesResolver:(e,t)=>t.columnHeaderRow})(()=>({display:"flex"}));function uf(e){return!!e.target}const df=e=>{const{innerRef:t,minColumnIndex:n=0}=e,[o,r]=s.useState(""),[l,i]=s.useState(""),c=se(),a=ee(c,Oe),g=ee(c,kt),d=ee(c,Mr),u=ee(c,hn),f=ee(c,Vi),C=ee(c,yr),P=ee(c,to),b=ee(c,rn),p=ee(c,ki),I=ee(c,Si),$=ee(c,Xr),v=J(),h=s.useRef(null),k=rt(t,h),[F,S]=s.useState(null),w=s.useRef(F),E=s.useRef(0),T=$t(c,v);s.useEffect(()=>{c.current.columnHeadersContainerElementRef.current.scrollLeft=0},[c]);const M=s.useRef(br(Su,{equalityCheck:(K,W)=>["firstColumnIndex","minColumnIndex","columnBuffer"].every(te=>K[te]===W[te])})),A=s.useCallback(K=>{const[W,te]=Ct({firstIndex:K.firstRowIndex,lastIndex:K.lastRowIndex,minFirstIndex:0,maxLastIndex:T.rows.length,buffer:v.rowBuffer}),q=M.current({firstColumnIndex:K.firstColumnIndex,minColumnIndex:n,columnBuffer:v.columnBuffer,firstRowToRender:W,lastRowToRender:te,apiRef:c,visibleRows:T.rows}),oe=q>0?E.current-g[q]:E.current;h.current.style.transform=`translate3d(${-oe}px, 0px, 0px)`},[g,n,v.columnBuffer,c,T.rows,v.rowBuffer]);s.useLayoutEffect(()=>{F&&A(F)},[F,A]);const H=s.useCallback(({left:K,renderContext:W=null},te)=>{var q,oe;if(!h.current||E.current===K&&((q=w.current)==null?void 0:q.firstColumnIndex)===(W==null?void 0:W.firstColumnIndex)&&((oe=w.current)==null?void 0:oe.lastColumnIndex)===(W==null?void 0:W.lastColumnIndex))return;E.current=K;let U=!1;W!==w.current||!w.current?(uf(te)?(gr.flushSync(()=>{S(W)}),U=!0):S(W),w.current=W):U=!0,W&&U&&A(W)},[A]),x=s.useCallback(K=>i(K.field),[]),y=s.useCallback(()=>i(""),[]),O=s.useCallback(K=>r(K.field),[]),V=s.useCallback(()=>r(""),[]);Q(c,"columnResizeStart",x),Q(c,"columnResizeStop",y),Q(c,"columnHeaderDragStart",O),Q(c,"columnHeaderDragEnd",V),Q(c,"rowsScroll",H);const R=K=>{const{renderContext:W=F,minFirstColumn:te=n,maxLastColumn:q=a.length}=K||{};if(!W)return null;const[oe,U]=Ct({firstIndex:W.firstRowIndex,lastIndex:W.lastRowIndex,minFirstIndex:0,maxLastIndex:T.rows.length,buffer:v.rowBuffer}),Y=M.current({firstColumnIndex:W.firstColumnIndex,minColumnIndex:te,columnBuffer:v.columnBuffer,apiRef:c,firstRowToRender:oe,lastRowToRender:U,visibleRows:T.rows}),X=Math.min(W.lastColumnIndex+v.columnBuffer,q);return{renderedColumns:a.slice(Y,X),firstColumnToRender:Y,lastColumnToRender:X,minFirstColumn:te,maxLastColumn:q}},D=(K,W={})=>{const te=R(K);if(te==null)return null;const{renderedColumns:q,firstColumnToRender:oe}=te,U=[];for(let Y=0;Y<q.length;Y+=1){const X=q[Y],ae=oe+Y,de=ae===0,be=!(d===null&&u===null),xe=d!==null&&d.field===X.field||de&&!be?0:-1,j=f!==null&&f.field===X.field,re=$.open&&$.field===X.field;U.push(_(hc,m({},I[X.field],{columnMenuOpen:re,filterItemsCounter:p[X.field]&&p[X.field].length,headerHeight:C,isDragging:X.field===o,column:X,colIndex:ae,isResizing:l===X.field,isLastColumn:ae===a.length-1,extendRowFullWidth:!v.disableExtendRowFullWidth,hasFocus:j,tabIndex:xe},W),X.field))}return _(nr,{role:"row","aria-rowindex":P+1,ownerState:v,children:U})},G=(K=[],W)=>K.slice(0,W+1),z=K=>{if(P===0)return null;const W=R(K);if(W==null||W.renderedColumns.length===0)return null;const{renderedColumns:te,firstColumnToRender:q,lastColumnToRender:oe,maxLastColumn:U}=W,Y=[],X=[];for(let Se=0;Se<P;Se+=1){var ae,de,be;const $e=[];let st=0,Ee=q-1;const Ie=(ae=a[q])==null||(de=ae.groupPath)==null?void 0:de[Se],_e=G((be=a[q])==null?void 0:be.groupPath,Se);for(;Ie!==null&&Ee>=n&&(xe=a[Ee])!=null&&xe.groupPath&&dt(G((j=a[Ee])==null?void 0:j.groupPath,Se),_e);){var xe,j,re;const ke=a[Ee];if(st+=(re=ke.computedWidth)!=null?re:0,$e.length===0){var le;$e.push({width:(le=ke.computedWidth)!=null?le:0,fields:[ke.field],groupId:Ie,groupParents:_e,colIndex:Ee})}else{var fe;$e[0].width+=(fe=ke.computedWidth)!=null?fe:0,$e[0].fields.push(ke.field),$e[0].colIndex=Ee}Ee-=1}const Ve=te.reduce((ke,Fe,fo)=>{var ho;const qe=ke[ke.length-1];if(Fe.groupPath&&Fe.groupPath.length>Se){var po;if(qe&&qe.groupId===Fe.groupPath[Se]){var Co;return[...ke.slice(0,ke.length-1),m({},qe,{width:qe.width+((Co=Fe.computedWidth)!=null?Co:0),fields:[...qe.fields,Fe.field]})]}return[...ke,{groupId:Fe.groupPath[Se],groupParents:G(Fe.groupPath,Se),width:(po=Fe.computedWidth)!=null?po:0,fields:[Fe.field],colIndex:q+fo}]}if(qe&&qe.groupId===null&&dt(G(Fe.groupPath,Se),qe.groupParents)){var bo;return[...ke.slice(0,ke.length-1),m({},qe,{width:qe.width+((bo=Fe.computedWidth)!=null?bo:0),fields:[...qe.fields,Fe.field]})]}return[...ke,{groupId:null,groupParents:G(Fe.groupPath,Se),width:(ho=Fe.computedWidth)!=null?ho:0,fields:[Fe.field],colIndex:q+fo}]},$e);Ee=oe;const un=Ve[Ve.length-1].groupId;for(;un!==null&&Ee<U&&(ve=a[Ee])!=null&&ve.groupPath&&((Be=a[Ee])==null||(Le=Be.groupPath)==null?void 0:Le[Se])===un;){var ve,Be,Le,ze;const ke=a[Ee];Ve[Ve.length-1].width+=(ze=ke.computedWidth)!=null?ze:0,Ve[Ve.length-1].fields.push(ke.field),Ee+=1}X.push({leftOverflow:st,elements:[...Ve]})}return X.forEach((Se,$e)=>{Y.push(_(nr,{style:{height:`${C}px`,transform:`translateX(-${Se.leftOverflow}px)`},role:"row","aria-rowindex":$e+1,ownerState:v,children:Se.elements.map(({groupId:st,width:Ee,fields:Ie,colIndex:_e},Ve)=>_(cf,{groupId:st,width:Ee,fields:Ie,colIndex:_e,depth:$e,isLastColumn:_e===a.length-Ie.length,extendRowFullWidth:!v.disableExtendRowFullWidth,maxDepth:X.length,height:C},Ve))},$e))}),Y},N={minHeight:b,maxHeight:b,lineHeight:`${C}px`};return{renderContext:F,getColumnHeaders:D,getColumnGroupHeaders:z,isDragging:!!o,getRootProps:(K={})=>m({style:N},K),getInnerProps:()=>({ref:k,role:"rowgroup"})}},gf=["className"],mf=e=>{const{classes:t}=e;return ce({root:["columnHeaders"]},ge,t)},ff=ie("div",{name:"MuiDataGrid",slot:"ColumnHeaders",overridesResolver:(e,t)=>t.columnHeaders})(({theme:e})=>({position:"absolute",top:0,left:0,right:0,overflow:"hidden",display:"flex",alignItems:"center",boxSizing:"border-box",borderBottom:`1px solid ${e.palette.mode==="light"?Wn(We(e.palette.divider,1),.88):jn(We(e.palette.divider,1),.68)}`,borderTopLeftRadius:e.shape.borderRadius,borderTopRightRadius:e.shape.borderRadius})),hf=s.forwardRef(function(t,n){const{className:o}=t,r=Z(t,gf),l=J(),i=mf(l);return _(ff,m({ref:n,className:pe(o,i.root),ownerState:l},r))}),pf=["isDragging","className"],Cf=e=>{const{isDragging:t,hasScrollX:n,classes:o}=e;return ce({root:["columnHeadersInner",t&&"columnHeaderDropZone",n&&"columnHeadersInner--scrollable"]},ge,o)},bf=ie("div",{name:"MuiDataGrid",slot:"columnHeadersInner",overridesResolver:(e,t)=>[{[`&.${L.columnHeaderDropZone}`]:t.columnHeaderDropZone},t.columnHeadersInner]})(()=>({display:"flex",alignItems:"flex-start",flexDirection:"column",[`&.${L.columnHeaderDropZone} .${L.columnHeaderDraggableContainer}`]:{cursor:"move"},[`&.${L["columnHeadersInner--scrollable"]} .${L.columnHeader}:last-child`]:{borderRight:"none"}})),wf=s.forwardRef(function(t,n){var o,r;const{isDragging:l,className:i}=t,c=Z(t,pf),a=se(),g=J(),d=m({},g,{isDragging:l,hasScrollX:(o=(r=a.current.getRootDimensions())==null?void 0:r.hasScrollX)!=null?o:!1}),u=Cf(d);return _(bf,m({ref:n,className:pe(i,u.root),ownerState:d},c))}),vf=["innerRef","className"],Sf=s.forwardRef(function(t,n){const{innerRef:o}=t,r=Z(t,vf),{isDragging:l,getRootProps:i,getInnerProps:c,getColumnHeaders:a,getColumnGroupHeaders:g}=df({innerRef:o});return we(hf,m({ref:n},i(r),{children:[_(Uo,{scrollDirection:"left"}),we(wf,m({isDragging:l},c(),{children:[g(),a()]})),_(Uo,{scrollDirection:"right"})]}))}),dl=s.forwardRef(function(t,n){const o=zm(t),r=Vm(o);return _(qd,{apiRef:r,props:o,children:_(Oa,{className:o.className,style:o.style,sx:o.sx,ref:n,children:we(Oi,{children:[_(Li,{}),_(Di,{ColumnHeadersComponent:Sf,VirtualScrollerComponent:sf}),_(Hi,{})]})})})}),Ff=s.memo(dl);dl.propTypes={"aria-label":B.string,"aria-labelledby":B.string,autoHeight:B.bool,autoPageSize:B.bool,cellModesModel:B.object,checkboxSelection:B.bool,classes:B.object,columnBuffer:B.number,columnGroupingModel:B.arrayOf(B.object),columns:Mn(B.array.isRequired),columnThreshold:B.number,columnTypes:B.object,columnVisibilityModel:B.object,components:B.object,componentsProps:B.object,density:B.oneOf(["comfortable","compact","standard"]),disableColumnFilter:B.bool,disableColumnMenu:B.bool,disableColumnSelector:B.bool,disableDensitySelector:B.bool,disableExtendRowFullWidth:B.bool,disableIgnoreModificationsIfProcessingProps:B.bool,disableSelectionOnClick:B.bool,disableVirtualization:B.bool,editMode:B.oneOf(["cell","row"]),editRowsModel:B.object,error:B.any,experimentalFeatures:B.shape({columnGrouping:B.bool,newEditingApi:B.bool,preventCommitWhileValidating:B.bool,warnIfFocusStateIsNotSynced:B.bool}),filterMode:B.oneOf(["client","server"]),filterModel:B.shape({items:B.arrayOf(B.shape({columnField:B.string.isRequired,id:B.oneOfType([B.number,B.string]),operatorValue:B.string,value:B.any})).isRequired,linkOperator:B.oneOf(["and","or"]),quickFilterLogicOperator:B.oneOf(["and","or"]),quickFilterValues:B.array}),getCellClassName:B.func,getDetailPanelContent:B.func,getEstimatedRowHeight:B.func,getRowClassName:B.func,getRowHeight:B.func,getRowId:B.func,getRowSpacing:B.func,headerHeight:B.number,hideFooter:B.bool,hideFooterPagination:B.bool,hideFooterSelectedRowCount:B.bool,initialState:B.object,isCellEditable:B.func,isRowSelectable:B.func,keepNonExistentRowsSelected:B.bool,loading:B.bool,localeText:B.object,logger:B.shape({debug:B.func.isRequired,error:B.func.isRequired,info:B.func.isRequired,warn:B.func.isRequired}),logLevel:B.oneOf(["debug","error","info","warn",!1]),nonce:B.string,onCellClick:B.func,onCellDoubleClick:B.func,onCellEditCommit:B.func,onCellEditStart:B.func,onCellEditStop:B.func,onCellFocusOut:B.func,onCellKeyDown:B.func,onCellModesModelChange:B.func,onColumnHeaderClick:B.func,onColumnHeaderDoubleClick:B.func,onColumnHeaderEnter:B.func,onColumnHeaderLeave:B.func,onColumnHeaderOut:B.func,onColumnHeaderOver:B.func,onColumnOrderChange:B.func,onColumnVisibilityChange:B.func,onColumnVisibilityModelChange:B.func,onEditCellPropsChange:B.func,onEditRowsModelChange:B.func,onError:B.func,onFilterModelChange:B.func,onMenuClose:B.func,onMenuOpen:B.func,onPageChange:B.func,onPageSizeChange:B.func,onPreferencePanelClose:B.func,onPreferencePanelOpen:B.func,onProcessRowUpdateError:B.func,onResize:B.func,onRowClick:B.func,onRowDoubleClick:B.func,onRowEditCommit:B.func,onRowEditStart:B.func,onRowEditStop:B.func,onRowModesModelChange:B.func,onSelectionModelChange:B.func,onSortModelChange:B.func,onStateChange:B.func,page:B.number,pageSize:Mn(B.number),pagination:e=>e.pagination===!1?new Error(["MUI: `<DataGrid pagination={false} />` is not a valid prop.","Infinite scrolling is not available in the MIT version.","","You need to upgrade to DataGridPro or DataGridPremium component to disable the pagination."].join(`
`)):null,paginationMode:B.oneOf(["client","server"]),processRowUpdate:B.func,rowBuffer:B.number,rowCount:B.number,rowHeight:B.number,rowModesModel:B.object,rows:B.arrayOf(B.object).isRequired,rowSpacingType:B.oneOf(["border","margin"]),rowsPerPageOptions:B.arrayOf(B.number),rowThreshold:B.number,scrollbarSize:B.number,selectionModel:Mn(B.oneOfType([B.number,B.string,B.array])),showCellRightBorder:B.bool,showColumnRightBorder:B.bool,sortingMode:B.oneOf(["client","server"]),sortingOrder:B.arrayOf(B.oneOf(["asc","desc"])),sortModel:B.arrayOf(B.shape({field:B.string.isRequired,sort:B.oneOf(["asc","desc"])})),sx:B.oneOfType([B.arrayOf(B.oneOfType([B.func,B.object,B.bool])),B.func,B.object])};export{mr as B,Ff as D,ws as F,tt as G,as as K,vs as L,Ae as M,is as S,Ls as T,ee as a,Mf as b,cs as c,Ps as d,xs as e,J as f,jt as g,Cn as h,vt as i,Zt as j,ro as k,L as l,Fi as m,oo as n,_r as o,ge as p,Mi as q,Nt as r,dt as s,Ef as t,se as u,kf as v,Dn as w,ti as x};
