import{a3 as $n,a4 as gn,r as c,al as Ji,am as re,ao as h,j as v,aq as ec,as as fe,at as Ve,cA as zr,cB as ls,be as tc,Y as wt,av as nc,b4 as Ne,$ as Rt,cC as yt,cD as sr,bO as Je,b5 as ss,bz as fn,bC as oc,P as is,bt as ir,b3 as It,cE as cr,bN as rc,_ as ze,cj as lc,cF as cs,ar as zn,aB as De,M as rt,aL as rn,aM as ln,cd as sc,e as as,bw as vn,ac as ic,h as cc,ch as Dn,bQ as ac,C as uc,K as dc,v as us,I as ds,g as gc,S as fc,J as hc,a8 as mc,cG as bc,w as B,aj as Cc,ak as pc,cH as wc,b8 as gs,u as Sc,a2 as xc,x as vc,y as yc,R as kn,T as Vr,B as no,b9 as Qn,cI as Ic,b_ as Pc}from"./index-B1H8BCL7.js";import{A as fs,c as Mc}from"./Autocomplete-D8_Y_gp5.js";import{C as hs}from"./ClickAwayListener-CqfRJnqH.js";import{s as He}from"./Stack-BIAbaqpj.js";import{I as kc}from"./InputAdornment-BMBVR6Ec.js";import{C as Ec}from"./Checkbox-C0X963rT.js";import{F as Ar}from"./FormControlLabel-DYmaLmBq.js";import{T as Fc,t as Nr}from"./TablePagination-CVPyh-M-.js";import{a as Nt,l as Tc,d as Hc,b as jr,r as Dc}from"./colorManipulator-B4HuGLt1.js";import{u as Oc}from"./useThemeProps-DcBTMaaC.js";import{d as Lc}from"./AddCircleOutlineOutlined-xJ_QWEuj.js";import{t as Gc}from"./tabClasses-Dx7YJmjE.js";import{e as ms,u as ar}from"./useSlotProps-eBp3I9mO.js";function Rc(e){return String(e).match(/[\d.\-+]*\s*(.*)/)[1]||""}function $c(e){return parseFloat(e)}function zc(e){return $n("MuiSkeleton",e)}gn("MuiSkeleton",["root","text","rectangular","rounded","circular","pulse","wave","withChildren","fitContent","heightAuto"]);const Vc=["animation","className","component","height","style","variant","width"];let io=e=>e,_r,Br,Wr,Ur;const Ac=e=>{const{classes:t,variant:n,animation:o,hasChildren:r,width:l,height:s}=e;return fe({root:["root",n,o,r&&"withChildren",r&&!l&&"fitContent",r&&!s&&"heightAuto"]},zc,t)},Nc=ls(_r||(_r=io`
  0% {
    opacity: 1;
  }

  50% {
    opacity: 0.4;
  }

  100% {
    opacity: 1;
  }
`)),jc=ls(Br||(Br=io`
  0% {
    transform: translateX(-100%);
  }

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

  100% {
    transform: translateX(100%);
  }
`)),_c=Ve("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=Rc(e.shape.borderRadius)||"px",o=$c(e.shape.borderRadius);return h({display:"block",backgroundColor:e.vars?e.vars.palette.Skeleton.bg:Nt(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"&&zr(Wr||(Wr=io`
      animation: ${0} 2s ease-in-out 0.5s infinite;
    `),Nc),({ownerState:e,theme:t})=>e.animation==="wave"&&zr(Ur||(Ur=io`
      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;
      }
    `),jc,(t.vars||t).palette.action.hover)),Bc=c.forwardRef(function(t,n){const o=Ji({props:t,name:"MuiSkeleton"}),{animation:r="pulse",className:l,component:s="span",height:a,style:i,variant:d="text",width:u}=o,g=re(o,Vc),f=h({},o,{animation:r,component:s,variant:d,hasChildren:!!g.children}),x=Ac(f);return v.jsx(_c,h({as:s,ref:n,className:ec(x.root,l),ownerState:f},g,{style:h({width:u,height:a},i)}))});function Wc(e){const{disabled:t=!1,focusableWhenDisabled:n,href:o,ref:r,tabIndex:l,to:s,type:a}=e,i=c.useRef(),[d,u]=c.useState(!1),{isFocusVisibleRef:g,onFocus:f,onBlur:x,ref:I}=tc(),[y,w]=c.useState(!1);t&&!n&&y&&w(!1),c.useEffect(()=>{g.current=y},[y,g]);const[m,p]=c.useState(""),E=M=>b=>{var C;y&&b.preventDefault(),(C=M.onMouseLeave)==null||C.call(M,b)},R=M=>b=>{var C;x(b),g.current===!1&&w(!1),(C=M.onBlur)==null||C.call(M,b)},H=M=>b=>{var C;if(i.current||(i.current=b.currentTarget),f(b),g.current===!0){var $;w(!0),($=M.onFocusVisible)==null||$.call(M,b)}(C=M.onFocus)==null||C.call(M,b)},V=()=>{const M=i.current;return m==="BUTTON"||m==="INPUT"&&["button","submit","reset"].includes(M==null?void 0:M.type)||m==="A"&&(M==null?void 0:M.href)},A=M=>b=>{if(!t){var C;(C=M.onClick)==null||C.call(M,b)}},L=M=>b=>{var C;t||(u(!0),document.addEventListener("mouseup",()=>{u(!1)},{once:!0})),(C=M.onMouseDown)==null||C.call(M,b)},P=M=>b=>{var C;if((C=M.onKeyDown)==null||C.call(M,b),!b.defaultPrevented&&(b.target===b.currentTarget&&!V()&&b.key===" "&&b.preventDefault(),b.target===b.currentTarget&&b.key===" "&&!t&&u(!0),b.target===b.currentTarget&&!V()&&b.key==="Enter"&&!t)){var $;($=M.onClick)==null||$.call(M,b),b.preventDefault()}},D=M=>b=>{var C;if(b.target===b.currentTarget&&u(!1),(C=M.onKeyUp)==null||C.call(M,b),b.target===b.currentTarget&&!V()&&!t&&b.key===" "&&!b.defaultPrevented){var $;($=M.onClick)==null||$.call(M,b)}},z=c.useCallback(M=>{var b;p((b=M==null?void 0:M.tagName)!=null?b:"")},[]),F=wt(z,r,I,i),T={};return m==="BUTTON"?(T.type=a??"button",n?T["aria-disabled"]=t:T.disabled=t):m!==""&&(!o&&!s&&(T.role="button",T.tabIndex=l??0),t&&(T["aria-disabled"]=t,T.tabIndex=n?l??0:-1)),{getRootProps:(M={})=>{const b=ms(e),C=h({},b,M);return delete C.onFocusVisible,h({type:a},C,T,{onBlur:R(C),onClick:A(C),onFocus:H(C),onKeyDown:P(C),onKeyUp:D(C),onMouseDown:L(C),onMouseLeave:E(C),ref:F})},focusVisible:y,setFocusVisible:w,disabled:t,active:d}}function Uc(e){return $n("MuiTabs",e)}gn("MuiTabs",["root","horizontal","vertical"]);const Kc=e=>{const{value:t,defaultValue:n,onChange:o,orientation:r,direction:l,selectionFollowsFocus:s}=e,[a,i]=nc({controlled:t,default:n,name:"Tabs",state:"value"}),d=Ne(),u=c.useCallback((f,x)=>{i(x),o&&o(f,x)},[o,i]);return{tabsContextValue:c.useMemo(()=>({idPrefix:d,value:a,onSelected:u,orientation:r,direction:l,selectionFollowsFocus:s}),[d,a,u,r,l,s])}},bs=c.createContext(null);function Cs(){return c.useContext(bs)}function qc(e,t){const{idPrefix:n}=e;return n===null?null:`${e.idPrefix}-P-${t}`}function Xc(e,t){const{idPrefix:n}=e;return n===null?null:`${e.idPrefix}-T-${t}`}const Yc=["children","value","defaultValue","orientation","direction","component","onChange","selectionFollowsFocus","slotProps","slots"],Qc=e=>{const{orientation:t}=e;return fe({root:["root",t]},Uc,{})},Zc=c.forwardRef((e,t)=>{var n;const{children:o,orientation:r="horizontal",direction:l="ltr",component:s,slotProps:a={},slots:i={}}=e,d=re(e,Yc),{tabsContextValue:u}=Kc(e),g=h({},e,{orientation:r,direction:l}),f=Qc(g),x=(n=s??i.root)!=null?n:"div",I=ar({elementType:x,externalSlotProps:a.root,externalForwardedProps:d,additionalProps:{ref:t},ownerState:g,className:f.root});return v.jsx(x,h({},I,{children:v.jsx(bs.Provider,{value:u,children:o})}))});function Jc(e){return $n("MuiTabsList",e)}gn("MuiTabsList",["root","horizontal","vertical"]);const Kr=(e,t)=>e?e===t?e.firstChild:t&&t.nextElementSibling?t.nextElementSibling:e.firstChild:null,qr=(e,t)=>e?e===t?e.lastChild:t&&t.previousElementSibling?t.previousElementSibling:e.lastChild:null,Zn=(e,t,n)=>{let o=!1,r=n(e,t);for(;e&&r;){if(r===e.firstChild){if(o)return;o=!0}const l=r.disabled||r.getAttribute("aria-disabled")==="true";if(!r.hasAttribute("tabindex")||l)r=n(e,r);else{r.focus();return}}},ea=e=>{const{"aria-label":t,"aria-labelledby":n,children:o,ref:r}=e,l=c.createRef(),s=wt(l,r),a=Cs();if(a===null)throw new Error("No TabContext provided");const{value:i,orientation:d="horizontal",direction:u="ltr"}=a,g=u==="rtl",f=w=>{const m=l.current,p=Rt(m).activeElement;if((p==null?void 0:p.getAttribute("role"))!=="tab")return;let R=d==="horizontal"?"ArrowLeft":"ArrowUp",H=d==="horizontal"?"ArrowRight":"ArrowDown";switch(d==="horizontal"&&g&&(R="ArrowRight",H="ArrowLeft"),w.key){case R:w.preventDefault(),Zn(m,p,qr);break;case H:w.preventDefault(),Zn(m,p,Kr);break;case"Home":w.preventDefault(),Zn(m,null,Kr);break;case"End":w.preventDefault(),Zn(m,null,qr);break}},x=w=>m=>{var p;f(m),(p=w.onKeyDown)==null||p.call(w,m)},I=(w={})=>{const m=ms(e),p=h({},m,w),E={onKeyDown:x(p)},R=h({},p,E);return h({"aria-label":t,"aria-labelledby":n,"aria-orientation":d==="vertical"?"vertical":void 0,role:"tablist",ref:s},R)},y=c.useCallback(()=>{const w=new Map;let m=0;return c.Children.map(o,E=>{if(!c.isValidElement(E))return null;const R=E.props.value===void 0?m:E.props.value;return w.set(R,m),m+=1,c.cloneElement(E,h({value:R},m===1&&i===!1&&!E.props.tabIndex||i===R?{tabIndex:0}:{tabIndex:-1}))})},[o,i]);return{isRtl:g,orientation:d,value:i,processChildren:y,getRootProps:I}},ta=["children","component","slotProps","slots"],na=e=>{const{orientation:t}=e;return fe({root:["root",t]},Jc,{})},oa=c.forwardRef((e,t)=>{var n;const{component:o,slotProps:r={},slots:l={}}=e,s=re(e,ta),{isRtl:a,orientation:i,getRootProps:d,processChildren:u}=ea(h({},e,{ref:t})),g=h({},e,{isRtl:a,orientation:i}),f=na(g),x=(n=o??l.root)!=null?n:"div",I=ar({elementType:x,getSlotProps:d,externalSlotProps:r.root,externalForwardedProps:s,ownerState:g,className:f.root}),y=u();return v.jsx(x,h({},I,{children:y}))});function ra(e){return $n("MuiTab",e)}gn("MuiTab",["root","selected","disabled"]);const la=["getRootProps"],sa=e=>{var t,n;const{value:o,onChange:r,onClick:l,onFocus:s}=e,a=Wc(e),{getRootProps:i}=a,d=re(a,la),u=Cs();if(u===null)throw new Error("No TabContext provided");const g=o??0,f=u.value===g,x=u.selectionFollowsFocus,I={role:"tab","aria-controls":(t=qc(u,g))!=null?t:void 0,id:(n=Xc(u,g))!=null?n:void 0,"aria-selected":f,disabled:d.disabled},y=p=>E=>{var R;(R=p.onFocus)==null||R.call(p,E),!E.defaultPrevented&&(x&&!f&&(r&&r(E,g),u.onSelected(E,g)),s&&s(E))},w=p=>E=>{var R;(R=p.onClick)==null||R.call(p,E),!E.defaultPrevented&&(f||(r&&r(E,g),u.onSelected(E,g)),l&&l(E))};return h({getRootProps:(p={})=>{const E=i(h({},p,{onClick:w(p),onFocus:y(p)}));return h({},E,I)}},d,{selected:f})},ia=["action","children","value","disabled","onChange","onClick","onFocus","component","slotProps","slots"],ca=e=>{const{selected:t,disabled:n}=e;return fe({root:["root",t&&"selected",n&&"disabled"]},ra,{})},aa=c.forwardRef(function(t,n){var o;const{action:r,children:l,disabled:s=!1,component:a,slotProps:i={},slots:d={}}=t,u=re(t,ia),g=c.useRef(),f=wt(g,n),{active:x,focusVisible:I,setFocusVisible:y,selected:w,getRootProps:m}=sa(h({},t,{ref:f}));c.useImperativeHandle(r,()=>({focusVisible:()=>{y(!0),g.current.focus()}}),[y]);const p=h({},t,{active:x,focusVisible:I,disabled:s,selected:w}),E=ca(p),R=(o=a??d.root)!=null?o:"button",H=ar({elementType:R,getSlotProps:m,externalSlotProps:i.root,externalForwardedProps:u,additionalProps:{ref:n},ownerState:p,className:E.root});return v.jsx(R,h({},H,{children:l}))}),ps=c.createContext(void 0);function he(){const e=c.useContext(ps);if(e===void 0)throw new Error(["MUI X: 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 ws=c.createContext(void 0),ne=()=>{const e=c.useContext(ws);if(!e)throw new Error("MUI X: useGridRootProps should only be used inside the DataGrid, DataGridPro or DataGridPremium component.");return e},ua=parseInt(c.version,10),Ie=e=>{if(ua>=19){const t=n=>e(n,n.ref??null);return t.displayName=e.displayName??e.name,t}return c.forwardRef(e)};var co=Symbol("NOT_FOUND");function da(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function ga(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function fa(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(n=>typeof n=="function")){const n=e.map(o=>typeof o=="function"?`function ${o.name||"unnamed"}()`:typeof o).join(", ");throw new TypeError(`${t}[${n}]`)}}var Xr=e=>Array.isArray(e)?e:[e];function ha(e){const t=Array.isArray(e[0])?e[0]:e;return fa(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function ma(e,t){const n=[],{length:o}=e;for(let r=0;r<o;r++)n.push(e[r].apply(null,t));return n}function ba(e){let t;return{get(n){return t&&e(t.key,n)?t.value:co},put(n,o){t={key:n,value:o}},getEntries(){return t?[t]:[]},clear(){t=void 0}}}function Ca(e,t){let n=[];function o(a){const i=n.findIndex(d=>t(a,d.key));if(i>-1){const d=n[i];return i>0&&(n.splice(i,1),n.unshift(d)),d.value}return co}function r(a,i){o(a)===co&&(n.unshift({key:a,value:i}),n.length>e&&n.pop())}function l(){return n}function s(){n=[]}return{get:o,put:r,getEntries:l,clear:s}}var pa=(e,t)=>e===t;function wa(e){return function(n,o){if(n===null||o===null||n.length!==o.length)return!1;const{length:r}=n;for(let l=0;l<r;l++)if(!e(n[l],o[l]))return!1;return!0}}function Ss(e,t){const n=typeof t=="object"?t:{equalityCheck:t},{equalityCheck:o=pa,maxSize:r=1,resultEqualityCheck:l}=n,s=wa(o);let a=0;const i=r<=1?ba(s):Ca(r,s);function d(){let u=i.get(arguments);if(u===co){if(u=e.apply(null,arguments),a++,l){const f=i.getEntries().find(x=>l(x.value,u));f&&(u=f.value,a!==0&&a--)}i.put(arguments,u)}return u}return d.clearCache=()=>{i.clear(),d.resetResultsCount()},d.resultsCount=()=>a,d.resetResultsCount=()=>{a=0},d}var Sa=class{constructor(e){this.value=e}deref(){return this.value}},xa=typeof WeakRef<"u"?WeakRef:Sa,va=0,Yr=1;function Jn(){return{s:va,v:void 0,o:null,p:null}}function xs(e,t={}){let n=Jn();const{resultEqualityCheck:o}=t;let r,l=0;function s(){var g;let a=n;const{length:i}=arguments;for(let f=0,x=i;f<x;f++){const I=arguments[f];if(typeof I=="function"||typeof I=="object"&&I!==null){let y=a.o;y===null&&(a.o=y=new WeakMap);const w=y.get(I);w===void 0?(a=Jn(),y.set(I,a)):a=w}else{let y=a.p;y===null&&(a.p=y=new Map);const w=y.get(I);w===void 0?(a=Jn(),y.set(I,a)):a=w}}const d=a;let u;if(a.s===Yr)u=a.v;else if(u=e.apply(null,arguments),l++,o){const f=((g=r==null?void 0:r.deref)==null?void 0:g.call(r))??r;f!=null&&o(f,u)&&(u=f,l!==0&&l--),r=typeof u=="object"&&u!==null||typeof u=="function"?new xa(u):u}return d.s=Yr,d.v=u,u}return s.clearCache=()=>{n=Jn(),s.resetResultsCount()},s.resultsCount=()=>l,s.resetResultsCount=()=>{l=0},s}function vs(e,...t){const n=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,o=(...r)=>{let l=0,s=0,a,i={},d=r.pop();typeof d=="object"&&(i=d,d=r.pop()),da(d,`createSelector expects an output function after the inputs, but received: [${typeof d}]`);const u={...n,...i},{memoize:g,memoizeOptions:f=[],argsMemoize:x=xs,argsMemoizeOptions:I=[]}=u,y=Xr(f),w=Xr(I),m=ha(r),p=g(function(){return l++,d.apply(null,arguments)},...y),E=x(function(){s++;const H=ma(m,arguments);return a=p.apply(null,H),a},...w);return Object.assign(E,{resultFunc:d,memoizedResultFunc:p,dependencies:m,dependencyRecomputations:()=>s,resetDependencyRecomputations:()=>{s=0},lastResult:()=>a,recomputations:()=>l,resetRecomputations:()=>{l=0},memoize:g,argsMemoize:x})};return Object.assign(o,{withTypes:()=>o}),o}var ys=vs(xs),ya=Object.assign((e,t=ys)=>{ga(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);const n=Object.keys(e),o=n.map(l=>e[l]);return t(o,(...l)=>l.reduce((s,a,i)=>(s[n[i]]=a,s),{}))},{withTypes:()=>ya});const Ia=Object.is;function Is(e,t){if(e===t)return!0;if(!(e instanceof Object)||!(t instanceof Object))return!1;let n=0,o=0;for(const r in e)if(n+=1,!Ia(e[r],t[r])||!(r in t))return!1;for(const r in t)o+=1;return n===o}function Ps(e){return e.acceptsApiRef}function Qr(e,t){return Ps(t)?t(e):t(e.current.state)}function zo(e,t,n,o){return Ps(t)?t(e,n):t(e.current.state,o)}const Ms=Object.is,ur=Is,Pa=(e,t)=>e===t?!0:e.length===t.length&&e.every((n,o)=>n===t[o]),Ma=(e,t)=>{let n=Object.is;return t instanceof Array?n=Pa:t instanceof Object&&(n=ur),n(e,t)},ks=()=>({state:null,equals:null,selector:null,args:void 0}),ao=[],Es=()=>null,K=(e,t,n=Ms)=>{const o=yt(ks),r=o.current.selector!==null,[l,s]=c.useState(r?null:Qr(e,t));o.current.state=l,o.current.equals=n,o.current.selector=t;const a=c.useCallback(()=>(o.current.subscription||(o.current.subscription=e.current.store.subscribe(()=>{const d=Qr(e,o.current.selector);o.current.equals(o.current.state,d)||(o.current.state=d,s(d))})),null),ao),i=c.useCallback(()=>()=>{o.current.subscription&&(o.current.subscription(),o.current.subscription=void 0)},ao);return sr.useSyncExternalStore(i,a,Es),l},On=(e,t,n=void 0,o=Ms)=>{const r=yt(ks),l=r.current.selector!==null,[s,a]=c.useState(l?null:zo(e,t,n,e.current.instanceId));r.current.state=s,r.current.equals=o,r.current.selector=t;const i=r.current.args;if(r.current.args=n,l&&!Ma(i,n)){const g=zo(e,r.current.selector,r.current.args,e.current.instanceId);r.current.equals(r.current.state,g)||(r.current.state=g,a(g))}const d=c.useCallback(()=>(r.current.subscription||(r.current.subscription=e.current.store.subscribe(()=>{const g=zo(e,r.current.selector,r.current.args,e.current.instanceId);r.current.equals(r.current.state,g)||(r.current.state=g,a(g))})),null),ao),u=c.useCallback(()=>()=>{r.current.subscription&&(r.current.subscription(),r.current.subscription=void 0)},ao);return sr.useSyncExternalStore(u,d,Es),s},ka=vs({memoize:Ss,memoizeOptions:{maxSize:1,equalityCheck:Object.is}}),Zr=new WeakMap;function mt(e){return"current"in e&&"instanceId"in e.current}const bt={id:"default"},le=(e,t,n,o,r,l,...s)=>{if(s.length>0)throw new Error("Unsupported number of selectors");let a;if(e&&t&&n&&o&&r&&l)a=(i,d)=>{const u=mt(i),g=d??(u?i.current.instanceId:bt),f=u?i.current.state:i,x=e(f,g),I=t(f,g),y=n(f,g),w=o(f,g),m=r(f,g);return l(x,I,y,w,m)};else if(e&&t&&n&&o&&r)a=(i,d)=>{const u=mt(i),g=d??(u?i.current.instanceId:bt),f=u?i.current.state:i,x=e(f,g),I=t(f,g),y=n(f,g),w=o(f,g);return r(x,I,y,w)};else if(e&&t&&n&&o)a=(i,d)=>{const u=mt(i),g=d??(u?i.current.instanceId:bt),f=u?i.current.state:i,x=e(f,g),I=t(f,g),y=n(f,g);return o(x,I,y)};else if(e&&t&&n)a=(i,d)=>{const u=mt(i),g=d??(u?i.current.instanceId:bt),f=u?i.current.state:i,x=e(f,g),I=t(f,g);return n(x,I)};else if(e&&t)a=(i,d)=>{const u=mt(i),g=d??(u?i.current.instanceId:bt),f=u?i.current.state:i,x=e(f,g);return t(x)};else throw new Error("Missing arguments");return a.acceptsApiRef=!0,a},Vn=(e,t,n,o,r,l,...s)=>{if(s.length>0)throw new Error("Unsupported number of selectors");let a;if(e&&t&&n&&o&&r&&l)a=(i,d,u)=>{const g=mt(i),f=u??(g?i.current.instanceId:bt),x=g?i.current.state:i,I=e(x,d,f),y=t(x,d,f),w=n(x,d,f),m=o(x,d,f),p=r(x,d,f);return l(I,y,w,m,p,d)};else if(e&&t&&n&&o&&r)a=(i,d,u)=>{const g=mt(i),f=u??(g?i.current.instanceId:bt),x=g?i.current.state:i,I=e(x,d,f),y=t(x,d,f),w=n(x,d,f),m=o(x,d,f);return r(I,y,w,m,d)};else if(e&&t&&n&&o)a=(i,d,u)=>{const g=mt(i),f=u??(g?i.current.instanceId:bt),x=g?i.current.state:i,I=e(x,d,f),y=t(x,d,f),w=n(x,d,f);return o(I,y,w,d)};else if(e&&t&&n)a=(i,d,u)=>{const g=mt(i),f=u??(g?i.current.instanceId:bt),x=g?i.current.state:i,I=e(x,d,f),y=t(x,d,f);return n(I,y,d)};else if(e&&t)a=(i,d,u)=>{const g=mt(i),f=u??(g?i.current.instanceId:bt),x=g?i.current.state:i,I=e(x,d,f);return t(I,d)};else throw new Error("Missing arguments");return a.acceptsApiRef=!0,a},Pe=(...e)=>{const t=(n,o)=>{const r=mt(n),l=r?n.current.instanceId:o??bt,s=r?n.current.state:n,a=Zr.get(l),i=a??new Map,d=i==null?void 0:i.get(e);if(i&&d)return d(s,l);const u=ka(...e);return a||Zr.set(l,i),i.set(e,u),u(s,l)};return t.acceptsApiRef=!0,t},qe=e=>e.dimensions,vo=le(qe,e=>e.columnsTotalWidth),dr=e=>e.dimensions.rowHeight,Ea=e=>e.dimensions.contentSize.height,Fa=e=>e.dimensions.hasScrollX,Ta=e=>e.dimensions.hasScrollY,Fs=e=>e.dimensions.columnsTotalWidth<e.dimensions.viewportOuterSize.width,Ha=e=>e.dimensions.headerHeight,Da=e=>e.dimensions.groupHeaderHeight,Ts=e=>e.dimensions.hasScrollY?e.dimensions.scrollbarSize:0,Oa=e=>{const t=e.dimensions.hasScrollX?e.dimensions.scrollbarSize:0,n=e.dimensions.viewportOuterSize.height-e.dimensions.minimumSize.height>0;return!(t===0&&!n)};function Hs(e){var t,n,o="";if(typeof e=="string"||typeof e=="number")o+=e;else if(typeof e=="object")if(Array.isArray(e)){var r=e.length;for(t=0;t<r;t++)e[t]&&(n=Hs(e[t]))&&(o&&(o+=" "),o+=n)}else for(n in e)e[n]&&(o&&(o+=" "),o+=n);return o}function ve(){for(var e,t,n=0,o="",r=arguments.length;n<r;n++)(e=arguments[n])&&(t=Hs(e))&&(o&&(o+=" "),o+=t);return o}function Ft(e){return c.memo(e,Is)}const La={noRowsLabel:"No rows",noResultsOverlayLabel:"No results found.",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",columnsManagementSearchTitle:"Search",columnsManagementNoColumns:"No columns",columnsManagementShowHideAllText:"Show/Hide All",columnsManagementReset:"Reset",columnsManagementDeleteIconLabel:"Clear",filterPanelAddFilter:"Add filter",filterPanelRemoveAll:"Remove all",filterPanelDeleteIconLabel:"Delete",filterPanelLogicOperator:"Logic operator",filterPanelOperator:"Operator",filterPanelOperatorAnd:"And",filterPanelOperatorOr:"Or",filterPanelColumns:"Columns",filterPanelInputLabel:"Value",filterPanelInputPlaceholder:"Filter value",filterOperatorContains:"contains",filterOperatorDoesNotContain:"does not contain",filterOperatorEquals:"equals",filterOperatorDoesNotEqual:"does not equal",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","filterOperator=":"=","filterOperator!=":"!=","filterOperator>":">","filterOperator>=":">=","filterOperator<":"<","filterOperator<=":"<=",headerFilterOperatorContains:"Contains",headerFilterOperatorDoesNotContain:"Does not contain",headerFilterOperatorEquals:"Equals",headerFilterOperatorDoesNotEqual:"Does not equal",headerFilterOperatorStartsWith:"Starts with",headerFilterOperatorEndsWith:"Ends with",headerFilterOperatorIs:"Is",headerFilterOperatorNot:"Is not",headerFilterOperatorAfter:"Is after",headerFilterOperatorOnOrAfter:"Is on or after",headerFilterOperatorBefore:"Is before",headerFilterOperatorOnOrBefore:"Is on or before",headerFilterOperatorIsEmpty:"Is empty",headerFilterOperatorIsNotEmpty:"Is not empty",headerFilterOperatorIsAnyOf:"Is any of","headerFilterOperator=":"Equals","headerFilterOperator!=":"Not equals","headerFilterOperator>":"Greater than","headerFilterOperator>=":"Greater than or equal to","headerFilterOperator<":"Less than","headerFilterOperator<=":"Less than or equal to",filterValueAny:"any",filterValueTrue:"true",filterValueFalse:"false",columnMenuLabel:"Menu",columnMenuShowColumns:"Show columns",columnMenuManageColumns:"Manage columns",columnMenuFilter:"Filter",columnMenuHideColumn:"Hide column",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"};function pe(e){return $n("MuiDataGrid",e)}const S=gn("MuiDataGrid",["actionsCell","aggregationColumnHeader","aggregationColumnHeader--alignLeft","aggregationColumnHeader--alignCenter","aggregationColumnHeader--alignRight","aggregationColumnHeaderLabel","autoHeight","autosizing","booleanCell","cell--editable","cell--editing","cell--flex","cell--textCenter","cell--textLeft","cell--textRight","cell--rangeTop","cell--rangeBottom","cell--rangeLeft","cell--rangeRight","cell--pinnedLeft","cell--pinnedRight","cell--selectionMode","cell","cellCheckbox","cellEmpty","cellSkeleton","cellOffsetLeft","checkboxInput","columnHeader","columnHeader--alignCenter","columnHeader--alignLeft","columnHeader--alignRight","columnHeader--dragging","columnHeader--moving","columnHeader--numeric","columnHeader--sortable","columnHeader--sorted","columnHeader--filtered","columnHeader--pinnedLeft","columnHeader--pinnedRight","columnHeader--last","columnHeader--lastUnpinned","columnHeader--siblingFocused","columnHeaderCheckbox","columnHeaderDraggableContainer","columnHeaderTitle","columnHeaderTitleContainer","columnHeaderTitleContainerContent","columnHeader--filledGroup","columnHeader--emptyGroup","columnHeaders","columnSeparator--resizable","columnSeparator--resizing","columnSeparator--sideLeft","columnSeparator--sideRight","columnSeparator","columnsManagement","columnsManagementRow","columnsManagementHeader","columnsManagementSearchInput","columnsManagementFooter","container--top","container--bottom","detailPanel","detailPanels","detailPanelToggleCell","detailPanelToggleCell--expanded","footerCell","panel","panelHeader","panelWrapper","panelContent","panelFooter","paper","editBooleanCell","editInputCell","filler","filler--borderBottom","filler--pinnedLeft","filler--pinnedRight","filterForm","filterFormDeleteIcon","filterFormLogicOperatorInput","filterFormColumnInput","filterFormOperatorInput","filterFormValueInput","filterIcon","footerContainer","headerFilterRow","iconButtonContainer","iconSeparator","main","main--hasPinnedRight","main--hasSkeletonLoadingOverlay","menu","menuIcon","menuIconButton","menuOpen","menuList","overlay","overlayWrapper","overlayWrapperInner","root","root--densityStandard","root--densityComfortable","root--densityCompact","root--disableUserSelection","root--noToolbar","row","row--editable","row--editing","row--firstVisible","row--lastVisible","row--dragging","row--dynamicHeight","row--detailPanelExpanded","row--borderBottom","rowReorderCellPlaceholder","rowCount","rowReorderCellContainer","rowReorderCell","rowReorderCell--draggable","rowSkeleton","scrollArea--left","scrollArea--right","scrollArea","scrollbar","scrollbar--vertical","scrollbar--horizontal","scrollbarFiller","scrollbarFiller--header","scrollbarFiller--borderTop","scrollbarFiller--borderBottom","scrollbarFiller--pinnedRight","selectedRowCount","sortIcon","toolbarContainer","toolbarFilterList","virtualScroller","virtualScroller--hasScrollX","virtualScrollerContent","virtualScrollerContent--overflowed","virtualScrollerRenderZone","pinnedColumns","withVerticalBorder","withBorderColor","cell--withRightBorder","cell--withLeftBorder","columnHeader--withRightBorder","columnHeader--withLeftBorder","treeDataGroupingCell","treeDataGroupingCellToggle","treeDataGroupingCellLoadingContainer","groupingCriteriaCell","groupingCriteriaCellToggle","groupingCriteriaCellLoadingContainer","pinnedRows","pinnedRows--top","pinnedRows--bottom","pinnedRowsRenderZone"]),Jr=1e3;class Ga{constructor(t=Jr){this.timeouts=new Map,this.cleanupTimeout=Jr,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 Ra{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 dt=function(e){return e.DataGrid="DataGrid",e.DataGridPro="DataGridPro",e.DataGridPremium="DataGridPremium",e}(dt||{});class $a{}function za(e){let t=0;return function(o,r,l,s){e.registry===null&&(e.registry=typeof FinalizationRegistry<"u"?new Ra:new Ga);const[a]=c.useState(new $a),i=c.useRef(null),d=c.useRef(null);d.current=l;const u=c.useRef(null);if(!i.current&&d.current){const g=(f,x,I)=>{var y;x.defaultMuiPrevented||(y=d.current)==null||y.call(d,f,x,I)};i.current=o.current.subscribeEvent(r,g,s),t+=1,u.current={cleanupToken:t},e.registry.register(a,()=>{var f;(f=i.current)==null||f.call(i),i.current=null,u.current=null},u.current)}else!d.current&&i.current&&(i.current(),i.current=null,u.current&&(e.registry.unregister(u.current),u.current=null));c.useEffect(()=>{if(!i.current&&d.current){const g=(f,x,I)=>{var y;x.defaultMuiPrevented||(y=d.current)==null||y.call(d,f,x,I)};i.current=o.current.subscribeEvent(r,g,s)}return u.current&&e.registry&&(e.registry.unregister(u.current),u.current=null),()=>{var g;(g=i.current)==null||g.call(i),i.current=null}},[o,r,s])}}const Va={registry:null},ee=za(Va),Aa={isFirst:!0};function Te(e,t,n){ee(e,t,n,Aa)}const Na=.7,ja=1.3,_a={compact:Na,comfortable:ja,standard:1},en=e=>e.density,hn=le(en,e=>_a[e]),Ba=["id","value","formattedValue","api","field","row","rowNode","colDef","cellMode","isEditable","tabIndex","hasFocus","isValidating","debounceMs","isProcessingProps","onValueChange"],Wa=e=>{const{classes:t}=e;return fe({root:["editInputCell"]},pe,t)},Ua=Ve(ss,{name:"MuiDataGrid",slot:"EditInputCell",overridesResolver:(e,t)=>t.editInputCell})(({theme:e})=>h({},e.typography.body2,{padding:"1px 0","& input":{padding:"0 16px",height:"100%"}})),Ka=Ie((e,t)=>{const n=ne(),{id:o,value:r,field:l,colDef:s,hasFocus:a,debounceMs:i=200,isProcessingProps:d,onValueChange:u}=e,g=re(e,Ba),f=he(),x=c.useRef(null),[I,y]=c.useState(r),w=Wa(n),m=c.useCallback(async E=>{const R=E.target.value;u&&await u(E,R);const H=f.current.getColumn(l);let V=R;H.valueParser&&(V=H.valueParser(R,f.current.getRow(o),H,f)),y(V),f.current.setEditCellValue({id:o,field:l,value:V,debounceMs:i,unstable_skipValueParser:!0},E)},[f,i,l,o,u]),p=f.current.unstable_getEditCellMeta(o,l);return c.useEffect(()=>{(p==null?void 0:p.changeReason)!=="debouncedSetEditCellValue"&&y(r)},[p,r]),Je(()=>{a&&x.current.focus()},[a]),v.jsx(Ua,h({inputRef:x,className:w.root,ownerState:n,fullWidth:!0,type:s.type==="number"?s.type:"text",value:I??"",onChange:m,endAdornment:d?v.jsx(n.slots.loadIcon,{fontSize:"small",color:"action"}):void 0},g,{ref:t}))}),qa=e=>v.jsx(Ka,h({},e)),Ds=(e,t)=>t&&e.length>1?[e[0]]:e,el=(e,t)=>n=>h({},n,{sorting:h({},n.sorting,{sortModel:Ds(e,t)})}),Xa=e=>e==="desc",Ya=(e,t)=>{const n=t.current.getColumn(e.field);if(!n||e.sort===null)return null;let o;return n.getSortComparator?o=n.getSortComparator(e.sort):o=Xa(e.sort)?(...l)=>-1*n.sortComparator(...l):n.sortComparator,o?{getSortCellParams:l=>({id:l,field:n.field,rowNode:t.current.getRowNode(l),value:t.current.getCellValue(l,n.field),api:t.current}),comparator:o}:null},Qa=(e,t,n)=>e.reduce((o,r,l)=>{if(o!==0)return o;const s=t.params[l],a=n.params[l];return o=r.comparator(s.value,a.value,s,a),o},0),Za=(e,t)=>{const n=e.map(o=>Ya(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)=>Qa(n,r,l)).map(r=>r.node.id)},tl=(e,t)=>{const n=e.indexOf(t);return!t||n===-1||n+1===e.length?e[0]:e[n+1]},gr=(e,t)=>e==null&&t!=null?-1:t==null&&e!=null?1:e==null&&t==null?0:null,Ja=new Intl.Collator,eu=(e,t)=>{const n=gr(e,t);return n!==null?n:typeof e=="string"?Ja.compare(e.toString(),t.toString()):e-t},Os=(e,t)=>{const n=gr(e,t);return n!==null?n:Number(e)-Number(t)},Ls=(e,t)=>{const n=gr(e,t);return n!==null?n:e>t?1:e<t?-1:0},tu=["item","applyValue","type","apiRef","focusElementRef","tabIndex","disabled","isFilterActive","clearButton","InputProps","variant"];function ct(e){var R;const{item:t,applyValue:n,type:o,apiRef:r,focusElementRef:l,tabIndex:s,disabled:a,clearButton:i,InputProps:d,variant:u="standard"}=e,g=re(e,tu),f=fn(),[x,I]=c.useState(Vo(t.value)),[y,w]=c.useState(!1),m=Ne(),p=ne(),E=c.useCallback(H=>{const V=Vo(H.target.value);I(V),w(!0),f.start(p.filterDebounceMs,()=>{const A=h({},t,{value:o==="number"&&!Number.isNaN(Number(V))?Number(V):V,fromInput:m});n(A),w(!1)})},[f,p.filterDebounceMs,t,o,m,n]);return c.useEffect(()=>{(t.fromInput!==m||t.value==null)&&I(Vo(t.value))},[m,t]),v.jsx(p.slots.baseTextField,h({id:m,label:r.current.getLocaleText("filterPanelInputLabel"),placeholder:r.current.getLocaleText("filterPanelInputPlaceholder"),value:x??"",onChange:E,variant:u,type:o||"text",InputProps:h({},y||i?{endAdornment:y?v.jsx(p.slots.loadIcon,{fontSize:"small",color:"action"}):i}:{},{disabled:a},d,{inputProps:h({tabIndex:s},d==null?void 0:d.inputProps)}),InputLabelProps:{shrink:!0},inputRef:l},g,(R=p.slotProps)==null?void 0:R.baseTextField))}function Vo(e){if(!(e==null||e===""))return String(e)}function nu(e){return typeof e=="number"&&!Number.isNaN(e)}function Gs(e){return typeof e=="function"}function fr(e){return typeof e=="object"&&e!==null}function ou(){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 uo(e){return e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}const lt=(e,t,n)=>Math.max(t,Math.min(n,e));function nl(e,t){return Array.from({length:t-e}).map((n,o)=>e+o)}function jt(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(!jt(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 s=r[l];if(!jt(s[1],t.get(s[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(!jt(e[l],t[l]))return!1}return!0}return e!==e&&t!==t}function ru(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 lu(e){const t=ru(e);return(n,o)=>n+(o-n)*t()}function Rs(e){return typeof structuredClone=="function"?structuredClone(e):JSON.parse(JSON.stringify(e))}const yn=(e,t)=>n=>{e&&t(n)},su=["item","applyValue","type","apiRef","focusElementRef","color","error","helperText","size","variant"],iu=["key"];function $s(e){const{item:t,applyValue:n,type:o,apiRef:r,focusElementRef:l,color:s,error:a,helperText:i,size:d,variant:u="standard"}=e,g=re(e,su),f={color:s,error:a,helperText:i,size:d,variant:u},[x,I]=c.useState(t.value||[]),y=Ne(),w=ne();c.useEffect(()=>{const p=t.value??[];I(p.map(String))},[t.value]);const m=c.useCallback((p,E)=>{I(E.map(String)),n(h({},t,{value:[...E.map(R=>o==="number"?Number(R):R)]}))},[n,t,o]);return v.jsx(fs,h({multiple:!0,freeSolo:!0,options:[],filterOptions:(p,E)=>{const{inputValue:R}=E;return R==null||R===""?[]:[R]},id:y,value:x,onChange:m,renderTags:(p,E)=>p.map((R,H)=>{const V=E({index:H}),{key:A}=V,L=re(V,iu);return v.jsx(w.slots.baseChip,h({variant:"outlined",size:"small",label:R},L),A)}),renderInput:p=>{var E;return v.jsx(w.slots.baseTextField,h({},p,{label:r.current.getLocaleText("filterPanelInputLabel"),placeholder:r.current.getLocaleText("filterPanelInputPlaceholder"),InputLabelProps:h({},p.InputLabelProps,{shrink:!0}),inputRef:l,type:o||"text"},f,(E=w.slotProps)==null?void 0:E.baseTextField))}},g))}var vt=function(e){return e.Cell="cell",e.Row="row",e}(vt||{}),Fe=function(e){return e.Edit="edit",e.View="view",e}(Fe||{}),Oe=function(e){return e.Edit="edit",e.View="view",e}(Oe||{}),tt=function(e){return e.And="and",e.Or="or",e}(tt||{}),Pt=function(e){return e.enterKeyDown="enterKeyDown",e.cellDoubleClick="cellDoubleClick",e.printableKeyDown="printableKeyDown",e.deleteKeyDown="deleteKeyDown",e.pasteKeyDown="pasteKeyDown",e}(Pt||{}),ft=function(e){return e.cellFocusOut="cellFocusOut",e.escapeKeyDown="escapeKeyDown",e.enterKeyDown="enterKeyDown",e.tabKeyDown="tabKeyDown",e.shiftTabKeyDown="shiftTabKeyDown",e}(ft||{}),Ot=function(e){return e.enterKeyDown="enterKeyDown",e.cellDoubleClick="cellDoubleClick",e.printableKeyDown="printableKeyDown",e.deleteKeyDown="deleteKeyDown",e}(Ot||{}),St=function(e){return e.rowFocusOut="rowFocusOut",e.escapeKeyDown="escapeKeyDown",e.enterKeyDown="enterKeyDown",e.tabKeyDown="tabKeyDown",e.shiftTabKeyDown="shiftTabKeyDown",e}(St||{});function zs(e){return e.field!==void 0}const Vs={filteredRowsLookup:{},filteredChildrenCountLookup:{},filteredDescendantCountLookup:{}},Ln=()=>({items:[],logicOperator:tt.And,quickFilterValues:[],quickFilterLogicOperator:tt.And});function As(e){return{current:e.current.getPublicApi()}}let Lt=function(e){return e.LEFT="left",e.RIGHT="right",e}({});const go={left:[],right:[]},cu=e=>e.isRtl,xt=e=>e.columns,kt=le(xt,e=>e.orderedFields),Tt=le(xt,e=>e.lookup),Ct=Pe(kt,Tt,(e,t)=>e.map(n=>t[n])),at=le(xt,e=>e.columnVisibilityModel),je=Pe(Ct,at,(e,t)=>e.filter(n=>t[n.field]!==!1)),mn=Pe(je,e=>e.map(t=>t.field)),au=e=>e.pinnedColumns,bn=Pe(xt,au,mn,cu,(e,t,n,o)=>{const r=uu(t,n,o);return{left:r.left.map(s=>e.lookup[s]),right:r.right.map(s=>e.lookup[s])}});function uu(e,t,n){var a,i;if(!Array.isArray(e.left)&&!Array.isArray(e.right)||((a=e.left)==null?void 0:a.length)===0&&((i=e.right)==null?void 0:i.length)===0)return go;const o=(d,u)=>Array.isArray(d)?d.filter(g=>u.includes(g)):[],r=o(e.left,t),l=t.filter(d=>!r.includes(d)),s=o(e.right,l);return n?{left:s,right:r}:{left:r,right:s}}const Vt=Pe(je,e=>{const t=[];let n=0;for(let o=0;o<e.length;o+=1)t.push(n),n+=e[o].computedWidth;return t}),Ns=Pe(Ct,e=>e.filter(t=>t.filterable)),du=Pe(Ct,e=>e.reduce((t,n)=>(n.filterable&&(t[n.field]=n),t),{})),gu=Pe(Ct,e=>e.some(t=>t.colSpan!==void 0));let In;function fu(){if(In!==void 0)return In;try{In=new Function("return true")()}catch{In=!1}return In}const Xo=(e,t)=>{const n=h({},e);if(n.id==null&&(n.id=Math.round(Math.random()*1e5)),n.operator==null){const o=Tt(t)[n.field];n.operator=o&&o.filterOperators[0].value}return n},hr=(e,t,n)=>{const o=e.items.length>1;let r;o&&t?r=[e.items[0]]:r=e.items;const l=o&&r.some(a=>a.id==null);return r.some(a=>a.operator==null)||l?h({},e,{items:r.map(a=>Xo(a,n))}):e.items!==r?h({},e,{items:r}):e},ol=(e,t,n)=>o=>h({},o,{filterModel:hr(e,t,n)}),Gn=e=>typeof e=="string"?e.normalize("NFD").replace(/[\u0300-\u036f]/g,""):e,js=(e,t)=>{var u;if(!e.field||!e.operator)return null;const n=t.current.getColumn(e.field);if(!n)return null;let o;if(n.valueParser){const g=n.valueParser;o=Array.isArray(e.value)?(u=e.value)==null?void 0:u.map(f=>g(f,void 0,n,t)):g(e.value,void 0,n,t)}else o=e.value;const{ignoreDiacritics:r}=t.current.rootProps;r&&(o=Gn(o));const l=h({},e,{value:o}),s=n.filterOperators;if(!(s!=null&&s.length))throw new Error(`MUI X: No filter operators found for column '${n.field}'.`);const a=s.find(g=>g.value===l.operator);if(!a)throw new Error(`MUI X: No filter operator found for column '${n.field}' and operator value '${l.operator}'.`);const i=As(t),d=a.getApplyFilterFn(l,n);return typeof d!="function"?null:{item:l,fn:g=>{let f=t.current.getRowValue(g,n);return r&&(f=Gn(f)),d(f,g,n,i)}}};let rl=1;const hu=(e,t,n)=>{const{items:o}=e,r=o.map(a=>js(a,t)).filter(a=>!!a);if(r.length===0)return null;if(n||!fu())return(a,i)=>{const d={};for(let u=0;u<r.length;u+=1){const g=r[u];(!i||i(g.item.field))&&(d[g.item.id]=g.fn(a))}return d};const l=new Function("appliers","row","shouldApplyFilter",`"use strict";
${r.map((a,i)=>`const shouldApply${i} = !shouldApplyFilter || shouldApplyFilter(${JSON.stringify(a.item.field)});`).join(`
`)}

const result$$ = {
${r.map((a,i)=>`  ${JSON.stringify(String(a.item.id))}: !shouldApply${i} ? false : appliers[${i}].fn(row),`).join(`
`)}
};

return result$$;`.replaceAll("$$",String(rl)));return rl+=1,(a,i)=>l(r,a,i)},_s=e=>e.quickFilterExcludeHiddenColumns??!0,mu=(e,t)=>{var a;const n=((a=e.quickFilterValues)==null?void 0:a.filter(Boolean))??[];if(n.length===0)return null;const o=_s(e)?mn(t):kt(t),r=[],{ignoreDiacritics:l}=t.current.rootProps,s=As(t);return o.forEach(i=>{const d=t.current.getColumn(i),u=d==null?void 0:d.getApplyQuickFilterFn;u&&r.push({column:d,appliers:n.map(g=>{const f=l?Gn(g):g;return{fn:u(f,d,s)}})})}),function(d,u){const g={};e:for(let f=0;f<n.length;f+=1){const x=n[f];for(let I=0;I<r.length;I+=1){const{column:y,appliers:w}=r[I],{field:m}=y;if(u&&!u(m))continue;const p=w[f];let E=t.current.getRowValue(d,y);if(p.fn===null)continue;if(l&&(E=Gn(E)),p.fn(E,d,y,s)){g[x]=!0;continue e}}g[x]=!1}return g}},bu=(e,t,n)=>{const o=hu(e,t,n),r=mu(e,t);return function(s,a,i){i.passingFilterItems=(o==null?void 0:o(s,a))??null,i.passingQuickFilterValues=(r==null?void 0:r(s,a))??null}},ll=e=>e!=null,Cu=(e,t,n)=>(e.cleanedFilterItems||(e.cleanedFilterItems=n.filter(o=>js(o,t)!==null)),e.cleanedFilterItems),pu=(e,t,n,o,r)=>{const l=Cu(r,o,n.items),s=e.filter(ll),a=t.filter(ll);if(s.length>0){const i=u=>s.some(g=>g[u.id]);if((n.logicOperator??Ln().logicOperator)===tt.And){if(!l.every(i))return!1}else if(!l.some(i))return!1}if(a.length>0&&n.quickFilterValues!=null){const i=u=>a.some(g=>g[u]);if((n.quickFilterLogicOperator??Ln().quickFilterLogicOperator)===tt.And){if(!n.quickFilterValues.every(i))return!1}else if(!n.quickFilterValues.some(i))return!1}return!0},wu=e=>{if(!e)return null;const t=new RegExp(uo(e),"i");return(n,o,r,l)=>{let s=l.current.getRowFormattedValue(o,r);return l.current.ignoreDiacritics&&(s=Gn(s)),s!=null?t.test(s.toString()):!1}},sl=(e,t)=>n=>{if(!n.value)return null;const o=e?n.value:n.value.trim(),r=new RegExp(uo(o),"i");return l=>{if(l==null)return t;const s=r.test(String(l));return t?!s:s}},il=(e,t)=>n=>{if(!n.value)return null;const o=e?n.value:n.value.trim(),r=new Intl.Collator(void 0,{sensitivity:"base",usage:"search"});return l=>{if(l==null)return t;const s=r.compare(o,l.toString())===0;return t?!s:s}},cl=e=>()=>t=>{const n=t===""||t==null;return e?!n:n},Su=(e=!1)=>[{value:"contains",getApplyFilterFn:sl(e,!1),InputComponent:ct},{value:"doesNotContain",getApplyFilterFn:sl(e,!0),InputComponent:ct},{value:"equals",getApplyFilterFn:il(e,!1),InputComponent:ct},{value:"doesNotEqual",getApplyFilterFn:il(e,!0),InputComponent:ct},{value:"startsWith",getApplyFilterFn:t=>{if(!t.value)return null;const n=e?t.value:t.value.trim(),o=new RegExp(`^${uo(n)}.*$`,"i");return r=>r!=null?o.test(r.toString()):!1},InputComponent:ct},{value:"endsWith",getApplyFilterFn:t=>{if(!t.value)return null;const n=e?t.value:t.value.trim(),o=new RegExp(`.*${uo(n)}$`,"i");return r=>r!=null?o.test(r.toString()):!1},InputComponent:ct},{value:"isEmpty",getApplyFilterFn:cl(!1),requiresFilterValue:!1},{value:"isNotEmpty",getApplyFilterFn:cl(!0),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 r=>r!=null?n.some(l=>o.compare(l,r.toString()||"")===0):!1},InputComponent:$s}],pt={width:100,minWidth:50,maxWidth:1/0,hideable:!0,sortable:!0,resizable:!0,filterable:!0,groupable:!0,pinnable:!0,aggregable:!0,editable:!1,sortComparator:eu,type:"string",align:"left",filterOperators:Su(),renderEditCell:qa,getApplyQuickFilterFn:wu},xu=["open","target","onClose","children","position","className","onExited"],vu=e=>{const{classes:t}=e;return fe({root:["menu"]},pe,t)},yu=Ve(ir,{name:"MuiDataGrid",slot:"Menu",overridesResolver:(e,t)=>t.menu})(({theme:e})=>({zIndex:e.zIndex.modal,[`& .${S.menuList}`]:{outline:0}})),Iu={"bottom-start":"top left","bottom-end":"top right"};function mr(e){var y;const{open:t,target:n,onClose:o,children:r,position:l,className:s,onExited:a}=e,i=re(e,xu),d=he(),u=ne(),g=vu(u),f=c.useRef(null);Je(()=>{var w,m;t?f.current=document.activeElement instanceof HTMLElement?document.activeElement:null:((m=(w=f.current)==null?void 0:w.focus)==null||m.call(w),f.current=null)},[t]),c.useEffect(()=>{const w=t?"menuOpen":"menuClose";d.current.publishEvent(w,{target:n})},[d,t,n]);const x=w=>m=>{w&&w(),a&&a(m)},I=w=>{w.target&&(n===w.target||n!=null&&n.contains(w.target))||o(w)};return v.jsx(yu,h({as:u.slots.basePopper,className:ve(g.root,s),ownerState:u,open:t,anchorEl:n,transition:!0,placement:l},i,(y=u.slotProps)==null?void 0:y.basePopper,{children:({TransitionProps:w,placement:m})=>v.jsx(hs,{onClickAway:I,mouseEvent:"onMouseDown",children:v.jsx(oc,h({},w,{style:{transformOrigin:Iu[m]},onExited:x(w==null?void 0:w.onExited),children:v.jsx(is,{children:r})}))})}))}const Pu=["api","colDef","id","hasFocus","isEditable","field","value","formattedValue","row","rowNode","cellMode","tabIndex","position","focusElementRef"],Mu=e=>typeof e.getActions=="function";function ku(e){var b;const{colDef:t,id:n,hasFocus:o,tabIndex:r,position:l="bottom-end",focusElementRef:s}=e,a=re(e,Pu),[i,d]=c.useState(-1),[u,g]=c.useState(!1),f=he(),x=c.useRef(null),I=c.useRef(null),y=c.useRef(!1),w=c.useRef({}),m=It(),p=Ne(),E=Ne(),R=ne();if(!Mu(t))throw new Error("MUI X: Missing the `getActions` property in the `GridColDef`.");const H=t.getActions(f.current.getRowParams(n)),V=H.filter(C=>!C.props.showInMenu),A=H.filter(C=>C.props.showInMenu),L=V.length+(A.length?1:0);c.useLayoutEffect(()=>{o||Object.entries(w.current).forEach(([C,$])=>{$==null||$.stop({},()=>{delete w.current[C]})})},[o]),c.useEffect(()=>{if(i<0||!x.current||i>=x.current.children.length)return;x.current.children[i].focus({preventScroll:!0})},[i]),c.useEffect(()=>{o||(d(-1),y.current=!1)},[o]),c.useImperativeHandle(s,()=>({focus(){if(!y.current){const C=H.findIndex($=>!$.props.disabled);d(C)}}}),[H]),c.useEffect(()=>{i>=L&&d(L-1)},[i,L]);const P=()=>{g(!0),d(L-1),y.current=!0},D=()=>{g(!1)},z=()=>{u?D():P()},F=C=>$=>{w.current[C]=$},T=(C,$)=>k=>{d(C),y.current=!0,$&&$(k)},G=C=>{if(L<=1)return;const $=(O,j)=>{var U;if(O<0||O>H.length)return O;const _=(j==="left"?-1:1)*(m?-1:1);return(U=H[O+_])!=null&&U.props.disabled?$(O+_,j):O+_};let k=i;C.key==="ArrowRight"?k=$(i,"right"):C.key==="ArrowLeft"&&(k=$(i,"left")),!(k<0||k>=L)&&k!==i&&(C.preventDefault(),C.stopPropagation(),d(k))},M=C=>{C.key==="Tab"&&C.preventDefault(),["Tab","Escape"].includes(C.key)&&D()};return v.jsxs("div",h({role:"menu",ref:x,tabIndex:-1,className:S.actionsCell,onKeyDown:G},a,{children:[V.map((C,$)=>c.cloneElement(C,{key:$,touchRippleRef:F($),onClick:T($,C.props.onClick),tabIndex:i===$?r:-1})),A.length>0&&E&&v.jsx(R.slots.baseIconButton,h({ref:I,id:E,"aria-label":f.current.getLocaleText("actionsCellMore"),"aria-haspopup":"menu","aria-expanded":u,"aria-controls":u?p:void 0,role:"menuitem",size:"small",onClick:z,touchRippleRef:F(E),tabIndex:i===V.length?r:-1},(b=R.slotProps)==null?void 0:b.baseIconButton,{children:v.jsx(R.slots.moreActionsIcon,{fontSize:"small"})})),A.length>0&&v.jsx(mr,{open:u,target:I.current,position:l,onClose:D,children:v.jsx(cr,{id:p,className:S.menuList,onKeyDown:M,"aria-labelledby":E,variant:"menu",autoFocusItem:!0,children:A.map((C,$)=>c.cloneElement(C,{key:$,closeMenu:D}))})})]}))}const Eu=e=>v.jsx(ku,h({},e)),yo="actions",Fu=h({},pt,{sortable:!1,filterable:!1,aggregable:!1,width:100,display:"flex",align:"center",headerAlign:"center",headerName:"",disableColumnMenu:!0,disableExport:!0,renderCell:Eu,getApplyQuickFilterFn:void 0}),gt=e=>e.rows,An=le(gt,e=>e.totalRowCount),Tu=le(gt,e=>e.loading),Hu=le(gt,e=>e.totalTopLevelRowCount),ut=le(gt,e=>e.dataRowIdToModelLookup),al=le(gt,e=>e.dataRowIdToIdLookup),Ze=le(gt,e=>e.tree),Du=le(gt,e=>e.groupsToFetch),Ou=le(gt,e=>e.groupingName),ul=le(gt,e=>e.treeDepths),Ut=Pe(gt,e=>{const t=Object.entries(e.treeDepths);return t.length===0?1:(t.filter(([,n])=>n>0).map(([n])=>Number(n)).sort((n,o)=>o-n)[0]??0)+1}),En=le(gt,e=>e.dataRowIds),Lu=le(gt,e=>e==null?void 0:e.additionalRowGroups),Cn=Pe(Lu,e=>{var n,o;const t=e==null?void 0:e.pinnedRows;return{bottom:((n=t==null?void 0:t.bottom)==null?void 0:n.map(r=>({id:r.id,model:r.model??{}})))??[],top:((o=t==null?void 0:t.top)==null?void 0:o.map(r=>({id:r.id,model:r.model??{}})))??[]}}),Bs=le(Cn,e=>{var t,n;return(((t=e==null?void 0:e.top)==null?void 0:t.length)||0)+(((n=e==null?void 0:e.bottom)==null?void 0:n.length)||0)}),Ye="auto-generated-group-node-root",sn=Symbol("mui.id_autogenerated"),Gu=()=>({type:"group",id:Ye,depth:-1,groupingField:null,groupingKey:null,isAutoGenerated:!0,children:[],childrenFromPath:{},childrenExpanded:!0,parent:null});function Ru(e,t,n="A row was provided without id in the rows prop:"){if(e==null)throw new Error(["MUI X: 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 Io=(e,t,n)=>{const o=t?t(e):e.id;return Ru(o,e,n),o},oo=({rows:e,getRowId:t,loading:n,rowCount:o})=>{const r={type:"full",rows:[]},l={},s={};for(let a=0;a<e.length;a+=1){const i=e[a],d=Io(i,t);l[d]=i,s[d]=d,r.rows.push(d)}return{rowsBeforePartialUpdates:e,loadingPropBeforePartialUpdates:n,rowCountPropBeforePartialUpdates:o,updates:r,dataRowIdToIdLookup:s,dataRowIdToModelLookup:l}},Ws=({tree:e,rowCountProp:t=0})=>{const n=e[Ye];return Math.max(t,n.children.length+(n.footerId==null?0:1))},Us=({apiRef:e,rowCountProp:t=0,loadingProp:n,previousTree:o,previousTreeDepths:r,previousGroupsToFetch:l})=>{const s=e.current.caches.rows,{tree:a,treeDepths:i,dataRowIds:d,groupingName:u,groupsToFetch:g=[]}=e.current.applyStrategyProcessor("rowTreeCreation",{previousTree:o,previousTreeDepths:r,updates:s.updates,dataRowIdToIdLookup:s.dataRowIdToIdLookup,dataRowIdToModelLookup:s.dataRowIdToModelLookup,previousGroupsToFetch:l}),f=e.current.unstable_applyPipeProcessors("hydrateRows",{tree:a,treeDepths:i,dataRowIdToIdLookup:s.dataRowIdToIdLookup,dataRowIds:d,dataRowIdToModelLookup:s.dataRowIdToModelLookup});return e.current.caches.rows.updates={type:"partial",actions:{insert:[],modify:[],remove:[]},idToActionLookup:{}},h({},f,{totalRowCount:Math.max(t,f.dataRowIds.length),totalTopLevelRowCount:Ws({tree:f.tree,rowCountProp:t}),groupingName:u,loading:n,groupsToFetch:g})},an=e=>e.type==="skeletonRow"||e.type==="footer"||e.type==="group"&&e.isAutoGenerated||e.type==="pinnedRow"&&e.isAutoGenerated,br=(e,t,n)=>{const o=e[t];if(o.type!=="group")return[];const r=[];for(let l=0;l<o.children.length;l+=1){const s=o.children[l];(!n||!an(e[s]))&&r.push(s);const a=br(e,s,n);for(let i=0;i<a.length;i+=1)r.push(a[i])}return!n&&o.footerId!=null&&r.push(o.footerId),r},dl=({previousCache:e,getRowId:t,updates:n,groupKeys:o})=>{if(e.updates.type==="full")throw new Error("MUI X: Unable to prepare a partial update if a full update is not applied yet.");const r=new Map;n.forEach(u=>{const g=Io(u,t,"A row was provided without id when calling updateRows():");r.has(g)?r.set(g,h({},r.get(g),u)):r.set(g,u)});const l={type:"partial",actions:{insert:[...e.updates.actions.insert??[]],modify:[...e.updates.actions.modify??[]],remove:[...e.updates.actions.remove??[]]},idToActionLookup:h({},e.updates.idToActionLookup),groupKeys:o},s=h({},e.dataRowIdToModelLookup),a=h({},e.dataRowIdToIdLookup),i={insert:{},modify:{},remove:{}};r.forEach((u,g)=>{const f=l.idToActionLookup[g];if(u._action==="delete"){if(f==="remove"||!s[g])return;f!=null&&(i[f][g]=!0),l.actions.remove.push(g),delete s[g],delete a[g];return}const x=s[g];if(x){f==="remove"?(i.remove[g]=!0,l.actions.modify.push(g)):f==null&&l.actions.modify.push(g),s[g]=h({},x,u);return}f==="remove"?(i.remove[g]=!0,l.actions.insert.push(g)):f==null&&l.actions.insert.push(g),s[g]=u,a[g]=g});const d=Object.keys(i);for(let u=0;u<d.length;u+=1){const g=d[u],f=i[g];Object.keys(f).length>0&&(l.actions[g]=l.actions[g].filter(x=>!f[x]))}return{dataRowIdToModelLookup:s,dataRowIdToIdLookup:a,updates:l,rowsBeforePartialUpdates:e.rowsBeforePartialUpdates,loadingPropBeforePartialUpdates:e.loadingPropBeforePartialUpdates,rowCountPropBeforePartialUpdates:e.rowCountPropBeforePartialUpdates}},Ks="var(--DataGrid-overlayHeight, calc(var(--height) * 2))";function gl(e,t,n){const o=[];return t.forEach(r=>{const l=Io(r,n,"A row was provided without id when calling updateRows():"),s=e.current.getRowNode(l);if((s==null?void 0:s.type)==="pinnedRow"){const a=e.current.caches.pinnedRows,i=a.idLookup[l];i&&(a.idLookup[l]=h({},i,r))}else o.push(r)}),o}const qs=(e,t,n)=>typeof e=="number"&&e>0?e:t,$u="__tree_data_group__",Xs="__row_group_by_columns_group__",Po="__detail_panel_toggle__";let me=function(e){return e[e.NONE=0]="NONE",e[e.LEFT=1]="LEFT",e[e.RIGHT=2]="RIGHT",e[e.VIRTUAL=3]="VIRTUAL",e}({});const zu=["id","value","formattedValue","api","field","row","rowNode","colDef","cellMode","isEditable","hasFocus","tabIndex","hideDescendantCount"],Vu=e=>{const{classes:t}=e;return fe({root:["booleanCell"]},pe,t)};function Au(e){const{value:t,rowNode:n}=e,o=re(e,zu),r=he(),l=ne(),s={classes:l.classes},a=Vu(s),d=K(r,Ut)>0&&n.type==="group"&&l.treeData===!1,u=c.useMemo(()=>t?l.slots.booleanCellTrueIcon:l.slots.booleanCellFalseIcon,[l.slots.booleanCellFalseIcon,l.slots.booleanCellTrueIcon,t]);return d&&t===void 0?null:v.jsx(u,h({fontSize:"small",className:a.root,titleAccess:r.current.getLocaleText(t?"booleanCellTrueLabel":"booleanCellFalseLabel"),"data-value":!!t},o))}const Nu=c.memo(Au),ju=e=>e.field!==Xs&&an(e.rowNode)?"":v.jsx(Nu,h({},e)),_u=["id","value","formattedValue","api","field","row","rowNode","colDef","cellMode","isEditable","tabIndex","className","hasFocus","isValidating","isProcessingProps","error","onValueChange"],Bu=e=>{const{classes:t}=e;return fe({root:["editBooleanCell"]},pe,t)};function Wu(e){var m;const{id:t,value:n,field:o,className:r,hasFocus:l,onValueChange:s}=e,a=re(e,_u),i=he(),d=c.useRef(null),u=Ne(),[g,f]=c.useState(n),x=ne(),I={classes:x.classes},y=Bu(I),w=c.useCallback(async p=>{const E=p.target.checked;s&&await s(p,E),f(E),await i.current.setEditCellValue({id:t,field:o,value:E},p)},[i,o,t,s]);return c.useEffect(()=>{f(n)},[n]),Je(()=>{l&&d.current.focus()},[l]),v.jsx("label",h({htmlFor:u,className:ve(y.root,r)},a,{children:v.jsx(x.slots.baseCheckbox,h({id:u,inputRef:d,checked:!!g,onChange:w,size:"small"},(m=x.slotProps)==null?void 0:m.baseCheckbox))}))}const Uu=e=>v.jsx(Wu,h({},e)),Ku=["item","applyValue","apiRef","focusElementRef","isFilterActive","clearButton","tabIndex","label","variant","InputLabelProps"],ro=e=>{if(String(e).toLowerCase()==="true")return!0;if(String(e).toLowerCase()==="false")return!1},qu=Ve("div")({display:"flex",alignItems:"center",width:"100%","& button":{margin:"auto 0px 5px 5px"}});function Xu(e){var R,H,V;const{item:t,applyValue:n,apiRef:o,focusElementRef:r,clearButton:l,tabIndex:s,label:a,variant:i="standard"}=e,d=re(e,Ku),[u,g]=c.useState(ro(t.value)),f=ne(),x=Ne(),I=Ne(),y=((R=f.slotProps)==null?void 0:R.baseSelect)||{},w=y.native??!1,m=((H=f.slotProps)==null?void 0:H.baseSelectOption)||{},p=c.useCallback(A=>{const L=ro(A.target.value);g(L),n(h({},t,{value:L}))},[n,t]);c.useEffect(()=>{g(ro(t.value))},[t.value]);const E=a??o.current.getLocaleText("filterPanelInputLabel");return v.jsxs(qu,{children:[v.jsxs(f.slots.baseFormControl,{fullWidth:!0,children:[v.jsx(f.slots.baseInputLabel,h({},(V=f.slotProps)==null?void 0:V.baseInputLabel,{id:x,shrink:!0,variant:i,children:E})),v.jsxs(f.slots.baseSelect,h({labelId:x,id:I,label:E,value:u===void 0?"":String(u),onChange:p,variant:i,notched:i==="outlined"?!0:void 0,native:w,displayEmpty:!0,inputProps:{ref:r,tabIndex:s}},d,y,{children:[v.jsx(f.slots.baseSelectOption,h({},m,{native:w,value:"",children:o.current.getLocaleText("filterValueAny")})),v.jsx(f.slots.baseSelectOption,h({},m,{native:w,value:"true",children:o.current.getLocaleText("filterValueTrue")})),v.jsx(f.slots.baseSelectOption,h({},m,{native:w,value:"false",children:o.current.getLocaleText("filterValueFalse")}))]}))]}),l]})}const Yu=()=>[{value:"is",getApplyFilterFn:e=>{const t=ro(e.value);return t===void 0?null:n=>!!n===t},InputComponent:Xu}],Qu=(e,t,n,o)=>e?o.current.getLocaleText("booleanCellTrueLabel"):o.current.getLocaleText("booleanCellFalseLabel"),Zu=e=>{switch(e.toLowerCase().trim()){case"true":case"yes":case"1":return!0;case"false":case"no":case"0":case"null":case"undefined":return!1;default:return}},Ys=h({},pt,{type:"boolean",display:"flex",align:"center",headerAlign:"center",renderCell:ju,renderEditCell:Uu,sortComparator:Os,valueFormatter:Qu,filterOperators:Yu(),getApplyQuickFilterFn:void 0,aggregable:!1,pastedValueParser:e=>Zu(e)}),Qs=e=>e.sorting,pn=le(Qs,e=>e.sortedRows),Cr=Pe(pn,ut,Ze,(e,t,n)=>e.reduce((o,r)=>{const l=t[r];if(l)o.push({id:r,model:l});else{const s=n[r];s&&an(s)&&o.push({id:r,model:{[sn]:r}})}return o},[])),ht=le(Qs,e=>e.sortModel),Ju=Pe(ht,e=>e.reduce((n,o,r)=>(n[o.field]={sortDirection:o.sort,sortIndex:e.length>1?r+1:void 0},n),{}));Pe(pn,e=>e.reduce((t,n,o)=>(t[n]=o,t),Object.create(null)));const Mo=e=>e.filter,Xe=le(Mo,e=>e.filterModel),ed=le(Xe,e=>e.quickFilterValues),td=e=>e.visibleRowsLookup,wn=le(Mo,e=>e.filteredRowsLookup);le(Mo,e=>e.filteredChildrenCountLookup);le(Mo,e=>e.filteredDescendantCountLookup);const At=Pe(td,Cr,Ut,Xe,ed,(e,t,n,o,r)=>n<2&&!o.items.length&&!(r!=null&&r.length)?t:t.filter(l=>e[l.id]!==!1)),cn=Pe(At,e=>e.map(t=>t.id)),Zs=Pe(wn,Cr,(e,t)=>t.filter(n=>e[n.id]!==!1)),Js=Pe(Zs,e=>e.map(t=>t.id));Pe(cn,Ze,(e,t)=>{const n={};let o=0;return e.reduce((r,l)=>{const s=t[l];return n[s.depth]||(n[s.depth]=0),s.depth>o&&(n[s.depth]=0),o=s.depth,n[s.depth]+=1,r[l]=n[s.depth],r},{})});const ei=Pe(At,Ze,Ut,(e,t,n)=>n<2?e:e.filter(o=>{var r;return((r=t[o.id])==null?void 0:r.depth)===0})),pr=le(At,e=>e.length),wr=le(ei,e=>e.length),nd=le(Zs,e=>e.length);le(nd,wr,(e,t)=>e-t);const od=Pe(Xe,Tt,(e,t)=>{var n;return(n=e.items)==null?void 0:n.filter(o=>{var s,a;if(!o.field)return!1;const r=t[o.field];if(!(r!=null&&r.filterOperators)||((s=r==null?void 0:r.filterOperators)==null?void 0:s.length)===0)return!1;const l=r.filterOperators.find(i=>i.value===o.operator);return l?!l.InputComponent||o.value!=null&&((a=o.value)==null?void 0:a.toString())!=="":!1})}),rd=Pe(od,e=>e.reduce((n,o)=>(n[o.field]?n[o.field].push(o):n[o.field]=[o],n),{})),it=e=>e.rowSelection,ld=le(it,e=>e.length),sd=Pe(it,ut,(e,t)=>new Map(e.map(n=>[n,t[n]]))),Et=Pe(it,e=>e.reduce((t,n)=>(t[n]=n,t),{}));function ti(e,t){var i;const n=Ze(e),o=pn(e),r=wn(e),l=n[t];if(!l||l.type!=="group")return[];const s=[],a=o.findIndex(d=>d===t)+1;for(let d=a;d<o.length&&((i=n[o[d]])==null?void 0:i.depth)>l.depth;d+=1){const u=o[d];r[u]!==!1&&e.current.isRowSelectable(u)&&s.push(u)}return s}function id(e,t){return le(Ze,pn,wn,Et,(n,o,r,l)=>{var u;const s=n[e];if(!s||s.type!=="group")return{isIndeterminate:!1,isChecked:l[e]===e};if(l[e]===e)return{isIndeterminate:!1,isChecked:!0};let a=0,i=0;const d=o.findIndex(g=>g===e)+1;for(let g=d;g<o.length&&((u=n[o[g]])==null?void 0:u.depth)>s.depth;g+=1){const f=o[g];r[f]!==!1&&(a+=1,l[f]!==void 0&&(i+=1))}return{isIndeterminate:i>0&&(i<a||l[e]===void 0),isChecked:t?i>0:l[e]===e}})}function Sr(e){return e.signature===dt.DataGrid?e.checkboxSelection&&e.disableMultipleRowSelection!==!0:!e.disableMultipleRowSelection}const cd=(e,t)=>{const n=[];let o=t;for(;o!=null&&o!==Ye;){const r=e[o];if(!r)return n;n.push(o),o=r.parent}return n},ad=(e,t,n)=>{const o=e[n];if(!o)return[];const r=o.parent;return r==null?[]:e[r].children.filter(s=>s!==n&&t[s]!==!1)},eo=(e,t,n,o,r,l)=>{const s=wn(e),a=Et(e),i=new Set([]);if(!(!o&&!r)){if(o){const d=t[n];(d==null?void 0:d.type)==="group"&&ti(e,n).forEach(g=>{l(g),i.add(g)})}if(r){const d=g=>{if(a[g]!==g&&!i.has(g))return!1;const f=t[g];return(f==null?void 0:f.type)!=="group"?!0:f.children.every(d)},u=g=>{const f=ad(t,s,g);if(f.length===0||f.every(d)){const I=t[g].parent;I!=null&&I!==Ye&&e.current.isRowSelectable(I)&&(l(I),i.add(I),u(I))}};u(n)}}},fl=(e,t,n,o,r,l)=>{const s=Et(e);if(!(!r&&!o)&&(r&&cd(t,n).forEach(i=>{s[i]===i&&l(i)}),o)){const a=t[n];(a==null?void 0:a.type)==="group"&&ti(e,n).forEach(d=>{l(d)})}},ud=["field","id","formattedValue","row","rowNode","colDef","isEditable","cellMode","hasFocus","tabIndex","api"],dd=e=>{const{classes:t}=e;return fe({root:["checkboxInput"]},pe,t)},gd=Ie(function(t,n){var L,P;const{field:o,id:r,rowNode:l,hasFocus:s,tabIndex:a}=t,i=re(t,ud),d=he(),u=ne(),g={classes:u.classes},f=dd(g),x=c.useRef(null),I=c.useRef(null),y=wt(x,n),w=D=>{const z={value:D.target.checked,id:r};d.current.publishEvent("rowSelectionCheckboxChange",z,D)};c.useLayoutEffect(()=>{if(a===0){const D=d.current.getCellElement(r,o);D&&(D.tabIndex=-1)}},[d,a,r,o]),c.useEffect(()=>{var D;if(s){const z=(D=x.current)==null?void 0:D.querySelector("input");z==null||z.focus({preventScroll:!0})}else I.current&&I.current.stop({})},[s]);const m=c.useCallback(D=>{D.key===" "&&D.stopPropagation()},[]),p=d.current.isRowSelectable(r),E=id(r,((L=u.rowSelectionPropagation)==null?void 0:L.parents)??!1),{isIndeterminate:R,isChecked:H}=K(d,E,ur);if(l.type==="footer"||l.type==="pinnedRow")return null;const V=u.indeterminateCheckboxAction==="select"?H&&!R:H,A=d.current.getLocaleText(V?"checkboxSelectionUnselectRow":"checkboxSelectionSelectRow");return v.jsx(u.slots.baseCheckbox,h({tabIndex:a,checked:V,onChange:w,className:f.root,inputProps:{"aria-label":A,name:"select_row"},onKeyDown:m,indeterminate:R,disabled:!p,touchRippleRef:I},(P=u.slotProps)==null?void 0:P.baseCheckbox,i,{ref:y}))}),fd=gd,ko=e=>e.focus,ot=le(ko,e=>e.cell),hd=le(ko,e=>e.columnHeader);le(ko,e=>e.columnHeaderFilter);const fo=le(ko,e=>e.columnGroupHeader),Eo=e=>e.tabIndex,xr=le(Eo,e=>e.cell),ni=le(Eo,e=>e.columnHeader);le(Eo,e=>e.columnHeaderFilter);const md=le(Eo,e=>e.columnGroupHeader);function de(e,t,n){const o=c.useRef(!0);Je(()=>{o.current=!1,e.current.register(n,t)},[e,n,t]),o.current&&e.current.register(n,t)}function Ue(e,t){const n=c.useRef(null);if(n.current)return n.current;const o=e.current.getLogger(t);return n.current=o,o}const oi=(e,t,n,o,r)=>{const l=Ue(e,"useNativeEventListener"),[s,a]=c.useState(!1),i=c.useRef(o),d=Gs(t)?t():(t==null?void 0:t.current)??null,u=c.useCallback(g=>i.current&&i.current(g),[]);c.useEffect(()=>{i.current=o},[o]),c.useEffect(()=>{if(d&&n&&!s){l.debug(`Binding native ${n} event`),d.addEventListener(n,u,r),a(!0);const g=()=>{l.debug(`Clearing native ${n} event`),d.removeEventListener(n,u,r)};e.current.subscribeEvent("unmount",g)}},[d,u,n,s,l,r,e])},Nn=e=>{const t=c.useRef(!0);t.current&&(t.current=!1,e())},bd=()=>{},Cd=(e,t)=>{const n=c.useRef(!1);Je(()=>n.current||!e?bd:(n.current=!0,t()),[n.current||e])},pd=100,wd=e=>e?0:100,ri=(e,t,n)=>t>0&&e>0?Math.ceil(e/t):e===-1?n+2:0,li=e=>({page:0,pageSize:e?0:100}),Sd=(e,t=0)=>t===0?e:Math.max(Math.min(e,t-1),0),si=(e,t)=>{if(t===dt.DataGrid&&e>pd)throw new Error(["MUI X: `pageSize` cannot exceed 100 in the MIT version of the DataGrid.","You need to upgrade to DataGridPro or DataGridPremium component to unlock this feature."].join(`
`))},xd=-1,jn=e=>e.pagination,ii=le(jn,e=>e.enabled&&e.paginationMode==="client"),et=le(jn,e=>e.paginationModel),tn=le(jn,e=>e.rowCount),Fn=le(jn,e=>e.meta),vd=le(et,e=>e.page),ci=le(et,e=>e.pageSize),ai=le(et,tn,(e,t)=>ri(t,e.pageSize,e.page)),vr=Pe(ii,et,Ze,Ut,At,ei,(e,t,n,o,r,l)=>{var I;if(!e)return null;const s=l.length,a=Math.min(t.pageSize*t.page,s-1),i=t.pageSize===xd?s-1:Math.min(a+t.pageSize-1,s-1);if(a===-1||i===-1)return null;if(o<2)return{firstRowIndex:a,lastRowIndex:i};const d=l[a],u=i-a+1,g=r.findIndex(y=>y.id===d.id);let f=g,x=0;for(;f<r.length&&x<=u;){const y=r[f],w=(I=n[y.id])==null?void 0:I.depth;w===void 0?f+=1:((x<u||w>0)&&(f+=1),w===0&&(x+=1))}return{firstRowIndex:g,lastRowIndex:f-1}}),yd=Pe(At,vr,(e,t)=>t?e.slice(t.firstRowIndex,t.lastRowIndex+1):[]),ui=Pe(cn,vr,(e,t)=>t?e.slice(t.firstRowIndex,t.lastRowIndex+1):[]),_n=Pe(ii,vr,yd,At,(e,t,n,o)=>e?{rows:n,range:t,rowToIndexMap:n.reduce((r,l,s)=>(r.set(l.model,s),r),new Map)}:{rows:o,range:o.length===0?null:{firstRowIndex:0,lastRowIndex:o.length-1},rowToIndexMap:o.reduce((r,l,s)=>(r.set(l.model,s),r),new Map)}),Id=["field","colDef"],Pd=e=>{const{classes:t}=e;return fe({root:["checkboxInput"]},pe,t)},Md=Ie(function(t,n){var L;const o=re(t,Id),[,r]=c.useState(!1),l=he(),s=ne(),a={classes:s.classes},i=Pd(a),d=K(l,ni),u=K(l,it),g=K(l,cn),f=K(l,ui),x=c.useMemo(()=>typeof s.isRowSelectable!="function"?u:u.filter(P=>s.keepNonExistentRowsSelected?!0:l.current.getRow(P)?s.isRowSelectable(l.current.getRowParams(P)):!1),[l,s.isRowSelectable,u,s.keepNonExistentRowsSelected]),I=c.useMemo(()=>(!s.pagination||!s.checkboxSelectionVisibleOnly?g:f).reduce((D,z)=>(D[z]=!0,D),{}),[s.pagination,s.checkboxSelectionVisibleOnly,f,g]),y=c.useMemo(()=>x.filter(P=>I[P]).length,[x,I]),w=y>0&&y<Object.keys(I).length,m=y>0,p=P=>{const D={value:P.target.checked};l.current.publishEvent("headerSelectionCheckboxChange",D)},E=d!==null&&d.field===t.field?0:-1;c.useLayoutEffect(()=>{const P=l.current.getColumnHeaderElement(t.field);E===0&&P&&(P.tabIndex=-1)},[E,l,t.field]);const R=c.useCallback(P=>{P.key===" "&&l.current.publishEvent("headerSelectionCheckboxChange",{value:!m})},[l,m]),H=c.useCallback(()=>{r(P=>!P)},[]);c.useEffect(()=>l.current.subscribeEvent("rowSelectionChange",H),[l,H]);const V=s.indeterminateCheckboxAction==="select"?m&&!w:m,A=l.current.getLocaleText(V?"checkboxSelectionUnselectAllRows":"checkboxSelectionSelectAllRows");return v.jsx(s.slots.baseCheckbox,h({indeterminate:w,checked:V,onChange:p,className:i.root,inputProps:{"aria-label":A,name:"select_all_rows"},tabIndex:E,onKeyDown:R,disabled:!Sr(s)},(L=s.slotProps)==null?void 0:L.baseCheckbox,o,{ref:n}))}),Mt="__check__",Sn=h({},Ys,{type:"custom",field:Mt,width:50,resizable:!1,sortable:!1,filterable:!1,aggregable:!1,disableColumnMenu:!0,disableReorder:!0,disableExport:!0,getApplyQuickFilterFn:void 0,display:"flex",valueGetter:(e,t,n,o)=>{const r=Et(o),l=o.current.getRowId(t);return r[l]!==void 0},renderHeader:e=>v.jsx(Md,h({},e)),renderCell:e=>v.jsx(fd,h({},e))}),kd=["item","applyValue","type","apiRef","focusElementRef","InputProps","isFilterActive","clearButton","tabIndex","disabled"];function hl(e,t){if(e==null)return"";const n=new Date(e);return Number.isNaN(n.getTime())?"":t==="date"?n.toISOString().substring(0,10):t==="datetime-local"?(n.setMinutes(n.getMinutes()-n.getTimezoneOffset()),n.toISOString().substring(0,19)):n.toISOString().substring(0,10)}function Kt(e){var E;const{item:t,applyValue:n,type:o,apiRef:r,focusElementRef:l,InputProps:s,clearButton:a,tabIndex:i,disabled:d}=e,u=re(e,kd),g=fn(),[f,x]=c.useState(()=>hl(t.value,o)),[I,y]=c.useState(!1),w=Ne(),m=ne(),p=c.useCallback(R=>{g.clear();const H=R.target.value;x(H),y(!0),g.start(m.filterDebounceMs,()=>{const V=new Date(H);n(h({},t,{value:Number.isNaN(V.getTime())?void 0:V})),y(!1)})},[n,t,m.filterDebounceMs,g]);return c.useEffect(()=>{const R=hl(t.value,o);x(R)},[t.value,o]),v.jsx(m.slots.baseTextField,h({fullWidth:!0,id:w,label:r.current.getLocaleText("filterPanelInputLabel"),placeholder:r.current.getLocaleText("filterPanelInputPlaceholder"),value:f,onChange:p,variant:"standard",type:o||"text",InputLabelProps:{shrink:!0},inputRef:l,InputProps:h({},I||a?{endAdornment:I?v.jsx(m.slots.loadIcon,{fontSize:"small",color:"action"}):a}:{},{disabled:d},s,{inputProps:h({max:o==="datetime-local"?"9999-12-31T23:59":"9999-12-31",tabIndex:i},s==null?void 0:s.inputProps)})},u,(E=m.slotProps)==null?void 0:E.baseTextField))}function qt(e,t,n,o){if(!e.value)return null;const r=new Date(e.value);n?r.setSeconds(0,0):(r.setMinutes(r.getMinutes()+r.getTimezoneOffset()),r.setHours(0,0,0,0));const l=r.getTime();return s=>{if(!s)return!1;if(o)return t(s.getTime(),l);const a=new Date(s);return n?a.setSeconds(0,0):a.setHours(0,0,0,0),t(a.getTime(),l)}}const di=e=>[{value:"is",getApplyFilterFn:t=>qt(t,(n,o)=>n===o,e),InputComponent:Kt,InputComponentProps:{type:e?"datetime-local":"date"}},{value:"not",getApplyFilterFn:t=>qt(t,(n,o)=>n!==o,e),InputComponent:Kt,InputComponentProps:{type:e?"datetime-local":"date"}},{value:"after",getApplyFilterFn:t=>qt(t,(n,o)=>n>o,e),InputComponent:Kt,InputComponentProps:{type:e?"datetime-local":"date"}},{value:"onOrAfter",getApplyFilterFn:t=>qt(t,(n,o)=>n>=o,e),InputComponent:Kt,InputComponentProps:{type:e?"datetime-local":"date"}},{value:"before",getApplyFilterFn:t=>qt(t,(n,o)=>n<o,e,!e),InputComponent:Kt,InputComponentProps:{type:e?"datetime-local":"date"}},{value:"onOrBefore",getApplyFilterFn:t=>qt(t,(n,o)=>n<=o,e),InputComponent:Kt,InputComponentProps:{type:e?"datetime-local":"date"}},{value:"isEmpty",getApplyFilterFn:()=>t=>t==null,requiresFilterValue:!1},{value:"isNotEmpty",getApplyFilterFn:()=>t=>t!=null,requiresFilterValue:!1}],Ed=["id","value","formattedValue","api","field","row","rowNode","colDef","cellMode","isEditable","tabIndex","hasFocus","inputProps","isValidating","isProcessingProps","onValueChange"],Fd=Ve(ss)({fontSize:"inherit"}),Td=e=>{const{classes:t}=e;return fe({root:["editInputCell"]},pe,t)};function Hd(e){const{id:t,value:n,field:o,colDef:r,hasFocus:l,inputProps:s,onValueChange:a}=e,i=re(e,Ed),d=r.type==="dateTime",u=he(),g=c.useRef(null),f=c.useMemo(()=>{let R;n==null?R=null:n instanceof Date?R=n:R=new Date((n??"").toString());let H;return R==null||Number.isNaN(R.getTime())?H="":H=new Date(R.getTime()-R.getTimezoneOffset()*60*1e3).toISOString().substr(0,d?16:10),{parsed:R,formatted:H}},[n,d]),[x,I]=c.useState(f),w={classes:ne().classes},m=Td(w),p=c.useCallback(R=>{if(R==="")return null;const[H,V]=R.split("T"),[A,L,P]=H.split("-"),D=new Date;if(D.setFullYear(Number(A),Number(L)-1,Number(P)),D.setHours(0,0,0,0),V){const[z,F]=V.split(":");D.setHours(Number(z),Number(F),0,0)}return D},[]),E=c.useCallback(async R=>{const H=R.target.value,V=p(H);a&&await a(R,V),I({parsed:V,formatted:H}),u.current.setEditCellValue({id:t,field:o,value:V},R)},[u,o,t,a,p]);return c.useEffect(()=>{I(R=>{var H,V;return f.parsed!==R.parsed&&((H=f.parsed)==null?void 0:H.getTime())!==((V=R.parsed)==null?void 0:V.getTime())?f:R})},[f]),Je(()=>{l&&g.current.focus()},[l]),v.jsx(Fd,h({inputRef:g,fullWidth:!0,className:m.root,type:d?"datetime-local":"date",inputProps:h({max:d?"9999-12-31T23:59":"9999-12-31"},s),value:x.formatted,onChange:E},i))}const gi=e=>v.jsx(Hd,h({},e));function fi({value:e,columnType:t,rowId:n,field:o}){if(!(e instanceof Date))throw new Error([`MUI X: \`${t}\` column type only accepts \`Date\` objects as values.`,"Use `valueGetter` to transform the value into a `Date` object.",`Row ID: ${n}, field: "${o}".`].join(`
`))}const Dd=(e,t,n,o)=>{if(!e)return"";const r=o.current.getRowId(t);return fi({value:e,columnType:"date",rowId:r,field:n.field}),e.toLocaleDateString()},Od=(e,t,n,o)=>{if(!e)return"";const r=o.current.getRowId(t);return fi({value:e,columnType:"dateTime",rowId:r,field:n.field}),e.toLocaleString()},Ld=h({},pt,{type:"date",sortComparator:Ls,valueFormatter:Dd,filterOperators:di(),renderEditCell:gi,pastedValueParser:e=>new Date(e)}),Gd=h({},pt,{type:"dateTime",sortComparator:Ls,valueFormatter:Od,filterOperators:di(!0),renderEditCell:gi,pastedValueParser:e=>new Date(e)}),Gt=e=>e==null?null:Number(e),Rd=e=>e==null||Number.isNaN(e)||e===""?null:t=>Gt(t)===Gt(e),$d=()=>[{value:"=",getApplyFilterFn:e=>e.value==null||Number.isNaN(e.value)?null:t=>Gt(t)===e.value,InputComponent:ct,InputComponentProps:{type:"number"}},{value:"!=",getApplyFilterFn:e=>e.value==null||Number.isNaN(e.value)?null:t=>Gt(t)!==e.value,InputComponent:ct,InputComponentProps:{type:"number"}},{value:">",getApplyFilterFn:e=>e.value==null||Number.isNaN(e.value)?null:t=>t==null?!1:Gt(t)>e.value,InputComponent:ct,InputComponentProps:{type:"number"}},{value:">=",getApplyFilterFn:e=>e.value==null||Number.isNaN(e.value)?null:t=>t==null?!1:Gt(t)>=e.value,InputComponent:ct,InputComponentProps:{type:"number"}},{value:"<",getApplyFilterFn:e=>e.value==null||Number.isNaN(e.value)?null:t=>t==null?!1:Gt(t)<e.value,InputComponent:ct,InputComponentProps:{type:"number"}},{value:"<=",getApplyFilterFn:e=>e.value==null||Number.isNaN(e.value)?null:t=>t==null?!1:Gt(t)<=e.value,InputComponent:ct,InputComponentProps:{type:"number"}},{value:"isEmpty",getApplyFilterFn:()=>e=>e==null,requiresFilterValue:!1},{value:"isNotEmpty",getApplyFilterFn:()=>e=>e!=null,requiresFilterValue:!1},{value:"isAnyOf",getApplyFilterFn:e=>!Array.isArray(e.value)||e.value.length===0?null:t=>t!=null&&e.value.includes(Number(t)),InputComponent:$s,InputComponentProps:{type:"number"}}],zd=h({},pt,{type:"number",align:"right",headerAlign:"right",sortComparator:Os,valueParser:e=>e===""?null:Number(e),valueFormatter:e=>nu(e)?e.toLocaleString():e||"",filterOperators:$d(),getApplyQuickFilterFn:Rd});function un(e){return(e==null?void 0:e.type)==="singleSelect"}function _t(e,t){if(e)return typeof e.valueOptions=="function"?e.valueOptions(h({field:e.field},t)):e.valueOptions}function ho(e,t,n){if(t===void 0)return;const o=t.find(r=>{const l=n(r);return String(l)===String(e)});return n(o)}const Vd=["id","value","formattedValue","api","field","row","rowNode","colDef","cellMode","isEditable","tabIndex","className","hasFocus","isValidating","isProcessingProps","error","onValueChange","initialOpen"],Ad=["MenuProps"];function Nd(e){return!!e.key}function jd(e){var F,T;const t=ne(),{id:n,value:o,field:r,row:l,colDef:s,hasFocus:a,error:i,onValueChange:d,initialOpen:u=t.editMode===vt.Cell}=e,g=re(e,Vd),f=he(),x=c.useRef(null),I=c.useRef(null),[y,w]=c.useState(u),p=(((F=t.slotProps)==null?void 0:F.baseSelect)||{}).native??!1,E=((T=t.slotProps)==null?void 0:T.baseSelect)||{},{MenuProps:R}=E,H=re(E,Ad);if(Je(()=>{var G;a&&((G=I.current)==null||G.focus())},[a]),!un(s))return null;const V=_t(s,{id:n,row:l});if(!V)return null;const A=s.getOptionValue,L=s.getOptionLabel,P=async G=>{if(!un(s)||!V)return;w(!1);const M=G.target,b=ho(M.value,V,A);d&&await d(G,b),await f.current.setEditCellValue({id:n,field:r,value:b},G)},D=(G,M)=>{if(t.editMode===vt.Row){w(!1);return}if(M==="backdropClick"||G.key==="Escape"){const b=f.current.getCellParams(n,r);f.current.publishEvent("cellEditStop",h({},b,{reason:G.key==="Escape"?ft.escapeKeyDown:ft.cellFocusOut}))}},z=G=>{Nd(G)&&G.key==="Enter"||w(!0)};return!V||!s?null:v.jsx(t.slots.baseSelect,h({ref:x,inputRef:I,value:o,onChange:P,open:y,onOpen:z,MenuProps:h({onClose:D},R),error:i,native:p,fullWidth:!0},g,H,{children:V.map(G=>{var b;const M=A(G);return c.createElement(t.slots.baseSelectOption,h({},((b=t.slotProps)==null?void 0:b.baseSelectOption)||{},{native:p,key:M,value:M}),L(G))})}))}const _d=e=>v.jsx(jd,h({},e)),Bd=["item","applyValue","type","apiRef","focusElementRef","placeholder","tabIndex","label","variant","isFilterActive","clearButton","InputLabelProps"],Wd=({column:e,OptionComponent:t,getOptionLabel:n,getOptionValue:o,isSelectNative:r,baseSelectOptionProps:l})=>["",..._t(e)||[]].map(a=>{const i=o(a);let d=n(a);return d===""&&(d=" "),c.createElement(t,h({},l,{native:r,key:i,value:i}),d)}),Ud=Ve("div")({display:"flex",alignItems:"flex-end",width:"100%","& button":{margin:"auto 0px 5px 5px"}});function ml(e){var A,L,P,D,z;const{item:t,applyValue:n,type:o,apiRef:r,focusElementRef:l,placeholder:s,tabIndex:a,label:i,variant:d="standard",clearButton:u}=e,g=re(e,Bd),f=t.value??"",x=Ne(),I=Ne(),y=ne(),w=((L=(A=y.slotProps)==null?void 0:A.baseSelect)==null?void 0:L.native)??!1;let m=null;if(t.field){const F=r.current.getColumn(t.field);un(F)&&(m=F)}const p=m==null?void 0:m.getOptionValue,E=m==null?void 0:m.getOptionLabel,R=c.useMemo(()=>_t(m),[m]),H=c.useCallback(F=>{let T=F.target.value;T=ho(T,R,p),n(h({},t,{value:T}))},[R,p,n,t]);if(!un(m))return null;const V=i??r.current.getLocaleText("filterPanelInputLabel");return v.jsxs(Ud,{children:[v.jsxs(y.slots.baseFormControl,{fullWidth:!0,children:[v.jsx(y.slots.baseInputLabel,h({},(P=y.slotProps)==null?void 0:P.baseInputLabel,{id:I,htmlFor:x,shrink:!0,variant:d,children:V})),v.jsx(y.slots.baseSelect,h({id:x,label:V,labelId:I,value:f,onChange:H,variant:d,type:o||"text",inputProps:{tabIndex:a,ref:l,placeholder:s??r.current.getLocaleText("filterPanelInputPlaceholder")},native:w,notched:d==="outlined"?!0:void 0},g,(D=y.slotProps)==null?void 0:D.baseSelect,{children:Wd({column:m,OptionComponent:y.slots.baseSelectOption,getOptionLabel:E,getOptionValue:p,isSelectNative:w,baseSelectOptionProps:(z=y.slotProps)==null?void 0:z.baseSelectOption})}))]}),u]})}const Kd=["item","applyValue","type","apiRef","focusElementRef","color","error","helperText","size","variant"],qd=["key"],Xd=Mc();function Yd(e){const{item:t,applyValue:n,apiRef:o,focusElementRef:r,color:l,error:s,helperText:a,size:i,variant:d="standard"}=e,u=re(e,Kd),g={color:l,error:s,helperText:a,size:i,variant:d},f=Ne(),x=ne();let I=null;if(t.field){const H=o.current.getColumn(t.field);un(H)&&(I=H)}const y=I==null?void 0:I.getOptionValue,w=I==null?void 0:I.getOptionLabel,m=c.useCallback((H,V)=>y(H)===y(V),[y]),p=c.useMemo(()=>_t(I)||[],[I]),E=c.useMemo(()=>Array.isArray(t.value)?t.value.reduce((H,V)=>{const A=p.find(L=>y(L)===V);return A!=null&&H.push(A),H},[]):[],[y,t.value,p]),R=c.useCallback((H,V)=>{n(h({},t,{value:V.map(y)}))},[n,t,y]);return v.jsx(fs,h({multiple:!0,options:p,isOptionEqualToValue:m,filterOptions:Xd,id:f,value:E,onChange:R,getOptionLabel:w,renderTags:(H,V)=>H.map((A,L)=>{const P=V({index:L}),{key:D}=P,z=re(P,qd);return v.jsx(x.slots.baseChip,h({variant:"outlined",size:"small",label:w(A)},z),D)}),renderInput:H=>{var V;return v.jsx(x.slots.baseTextField,h({},H,{label:o.current.getLocaleText("filterPanelInputLabel"),placeholder:o.current.getLocaleText("filterPanelInputPlaceholder"),InputLabelProps:h({},H.InputLabelProps,{shrink:!0}),inputRef:r,type:"singleSelect"},g,(V=x.slotProps)==null?void 0:V.baseTextField))}},u))}const Xt=e=>e==null||!fr(e)?e:e.value,Qd=()=>[{value:"is",getApplyFilterFn:e=>e.value==null||e.value===""?null:t=>Xt(t)===Xt(e.value),InputComponent:ml},{value:"not",getApplyFilterFn:e=>e.value==null||e.value===""?null:t=>Xt(t)!==Xt(e.value),InputComponent:ml},{value:"isAnyOf",getApplyFilterFn:e=>{if(!Array.isArray(e.value)||e.value.length===0)return null;const t=e.value.map(Xt);return n=>t.includes(Xt(n))},InputComponent:Yd}],Zd=e=>typeof e[0]=="object",Jd=e=>fr(e)?e.value:e,eg=e=>fr(e)?e.label:String(e),tg=h({},pt,{type:"singleSelect",getOptionLabel:eg,getOptionValue:Jd,valueFormatter(e,t,n,o){const r=o.current.getRowId(t);if(!un(n))return"";const l=_t(n,{id:r,row:t});if(e==null)return"";if(!l)return e;if(!Zd(l))return n.getOptionLabel(e);const s=l.find(a=>n.getOptionValue(a)===e);return s?n.getOptionLabel(s):""},renderEditCell:_d,filterOperators:Qd(),pastedValueParser:(e,t,n)=>{const o=n,r=_t(o)||[],l=o.getOptionValue;if(r.find(a=>l(a)===e))return e}}),ng="string",og=()=>({string:pt,number:zd,date:Ld,dateTime:Gd,boolean:Ys,singleSelect:tg,[yo]:Fu,custom:pt}),yr=e=>e.headerFiltering,rg=le(yr,e=>(e==null?void 0:e.enabled)??!1),lg=le(yr,e=>e.editing),sg=le(yr,e=>e.menuOpen),Fo=e=>e.columnGrouping,hi=Pe(Fo,e=>(e==null?void 0:e.unwrappedGroupingModel)??{}),mi=Pe(Fo,e=>(e==null?void 0:e.lookup)??{}),ig=Pe(Fo,e=>(e==null?void 0:e.headerStructure)??[]),Bn=le(Fo,e=>(e==null?void 0:e.maxDepth)??0),bi=["maxWidth","minWidth","width","flex"],Ao=og();function cg({initialFreeSpace:e,totalFlexUnits:t,flexColumns:n}){const o=new Set(n.map(s=>s.field)),r={all:{},frozenFields:[],freeze:s=>{const a=r.all[s];a&&a.frozen!==!0&&(r.all[s].frozen=!0,r.frozenFields.push(s))}};function l(){if(r.frozenFields.length===o.size)return;const s={min:{},max:{}};let a=e,i=t,d=0;r.frozenFields.forEach(u=>{a-=r.all[u].computedWidth,i-=r.all[u].flex});for(let u=0;u<n.length;u+=1){const g=n[u];if(r.all[g.field]&&r.all[g.field].frozen===!0)continue;let x=a/i*g.flex;x<g.minWidth?(d+=g.minWidth-x,x=g.minWidth,s.min[g.field]=!0):x>g.maxWidth&&(d+=g.maxWidth-x,x=g.maxWidth,s.max[g.field]=!0),r.all[g.field]={frozen:!1,computedWidth:x,flex:g.flex}}d<0?Object.keys(s.max).forEach(u=>{r.freeze(u)}):d>0?Object.keys(s.min).forEach(u=>{r.freeze(u)}):n.forEach(({field:u})=>{r.freeze(u)}),l()}return l(),r.all}const Yo=(e,t)=>{const n={};let o=0,r=0;const l=[];e.orderedFields.forEach(i=>{let d=e.lookup[i],u=0,g=!1;e.columnVisibilityModel[i]!==!1&&(d.flex&&d.flex>0?(o+=d.flex,g=!0):u=lt(d.width||pt.width,d.minWidth||pt.minWidth,d.maxWidth||pt.maxWidth),r+=u),d.computedWidth!==u&&(d=h({},d,{computedWidth:u})),g&&l.push(d),n[i]=d});const s=t===void 0?0:t.viewportOuterSize.width-(t.hasScrollY?t.scrollbarSize:0),a=Math.max(s-r,0);if(o>0&&s>0){const i=cg({initialFreeSpace:a,totalFlexUnits:o,flexColumns:l});Object.keys(i).forEach(d=>{n[d].computedWidth=i[d].computedWidth})}return h({},e,{lookup:n})},ag=(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={},s=[];for(let u=0;u<n.length;u+=1){const g=n[u];e.lookup[g]&&(l[g]=!0,s.push(g))}const a=s.length===0?e.orderedFields:[...s,...e.orderedFields.filter(u=>!l[u])],i=h({},e.lookup);for(let u=0;u<r.length;u+=1){const g=r[u],f=h({},i[g],{hasBeenResized:!0});Object.entries(o[g]).forEach(([x,I])=>{f[x]=I===-1?1/0:I}),i[g]=f}return h({},e,{orderedFields:a,lookup:i})};function bl(e){let t=Ao[ng];return e&&Ao[e]&&(t=Ao[e]),t}const Zt=({apiRef:e,columnsToUpsert:t,initialState:n,columnVisibilityModel:o=at(e),keepOnlyColumnsToUpsert:r=!1})=>{var u,g;const l=!e.current.state.columns;let s;if(l)s={orderedFields:[],lookup:{},columnVisibilityModel:o};else{const f=xt(e.current.state);s={orderedFields:r?[]:[...f.orderedFields],lookup:h({},f.lookup),columnVisibilityModel:o}}let a={};r&&!l&&(a=Object.keys(s.lookup).reduce((f,x)=>h({},f,{[x]:!1}),{})),t.forEach(f=>{const{field:x}=f;a[x]=!0;let I=s.lookup[x];I==null?(I=h({},bl(f.type),{field:x,hasBeenResized:!1}),s.orderedFields.push(x)):r&&s.orderedFields.push(x),I&&I.type!==f.type&&(I=h({},bl(f.type),{field:x}));let y=I.hasBeenResized;bi.forEach(w=>{f[w]!==void 0&&(y=!0,f[w]===-1&&(f[w]=1/0))}),s.lookup[x]=rc(I,h({},f,{hasBeenResized:y}))}),r&&!l&&Object.keys(s.lookup).forEach(f=>{a[f]||delete s.lookup[f]});const i=e.current.unstable_applyPipeProcessors("hydrateColumns",s),d=ag(i,n);return Yo(d,((g=(u=e.current).getRootDimensions)==null?void 0:g.call(u))??void 0)};function ug({firstColumnToRender:e,apiRef:t,firstRowToRender:n,lastRowToRender:o,visibleRows:r}){let l=e;for(let s=n;s<o;s+=1)if(r[s]){const i=r[s].id,d=t.current.unstable_getCellColSpanInfo(i,e);d&&d.spannedByColSpan&&(l=d.leftVisibleCellIndex)}return l}function Ir(e,t){if(t.unstable_listView)return 0;const n=hn(e),o=Bn(e),r=rg(e),l=Math.floor(t.columnHeaderHeight*n),s=Math.floor((t.columnGroupHeaderHeight??t.columnHeaderHeight)*n),a=r?Math.floor((t.headerFilterHeight??t.columnHeaderHeight)*n):0;return l+s*o+a}const Cl=1,dg=1.5,gg=e=>{const{scrollDirection:t,classes:n}=e,o={root:["scrollArea",`scrollArea--${t}`]};return fe(o,pe,n)},fg=He("div",{name:"MuiDataGrid",slot:"ScrollArea",overridesResolver:(e,t)=>[{[`&.${S["scrollArea--left"]}`]:t["scrollArea--left"]},{[`&.${S["scrollArea--right"]}`]:t["scrollArea--right"]},t.scrollArea]})(()=>({position:"absolute",top:0,zIndex:101,width:20,bottom:0,[`&.${S["scrollArea--left"]}`]:{left:0},[`&.${S["scrollArea--right"]}`]:{right:0}})),hg=Vn(qe,(e,t)=>t==="left"?e.leftPinnedWidth:t==="right"?e.rightPinnedWidth+(e.hasScrollX?e.scrollbarSize:0):0);function mg(e){const t=he(),[n,o]=c.useState(!1);return ee(t,"columnHeaderDragStart",()=>o(!0)),ee(t,"columnHeaderDragEnd",()=>o(!1)),n?v.jsx(bg,h({},e)):null}function bg(e){const{scrollDirection:t,scrollPosition:n}=e,o=c.useRef(null),r=he(),l=fn(),s=K(r,hn),a=K(r,vo),i=On(r,hg,t),d=()=>{const R=qe(r.current.state);if(t==="left")return n.current.left>0;if(t==="right"){const H=a-R.viewportInnerSize.width;return n.current.left<H}return!1},[u,g]=c.useState(d),f=ne(),x=h({},f,{scrollDirection:t}),I=gg(x),y=Ir(r,f),w=Math.floor(f.columnHeaderHeight*s),m={height:w,top:y-w};t==="left"?m.left=i:t==="right"&&(m.right=i);const p=()=>{g(d)},E=ze(R=>{let H;if(R.preventDefault(),t==="left")H=R.clientX-o.current.getBoundingClientRect().right;else if(t==="right")H=Math.max(1,R.clientX-o.current.getBoundingClientRect().left);else throw new Error("MUI X: Wrong drag direction");H=(H-Cl)*dg+Cl,l.start(0,()=>{r.current.scroll({left:n.current.left+H,top:n.current.top})})});return ee(r,"scrollPositionChange",p),u?v.jsx(fg,{ref:o,className:ve(I.root),ownerState:x,onDragOver:E,style:m}):null}const pl=Ft(mg);var Pr={},Ci={exports:{}},pi={exports:{}};(function(e){function t(n){"@babel/helpers - typeof";return e.exports=t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(o){return typeof o}:function(o){return o&&typeof Symbol=="function"&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},e.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})(pi);var Cg=pi.exports;(function(e){var t=Cg.default;function n(r){if(typeof WeakMap!="function")return null;var l=new WeakMap,s=new WeakMap;return(n=function(i){return i?s:l})(r)}function o(r,l){if(!l&&r&&r.__esModule)return r;if(r===null||t(r)!="object"&&typeof r!="function")return{default:r};var s=n(l);if(s&&s.has(r))return s.get(r);var a={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var d in r)if(d!=="default"&&{}.hasOwnProperty.call(r,d)){var u=i?Object.getOwnPropertyDescriptor(r,d):null;u&&(u.get||u.set)?Object.defineProperty(a,d,u):a[d]=r[d]}return a.default=r,s&&s.set(r,a),a}e.exports=o,e.exports.__esModule=!0,e.exports.default=e.exports})(Ci);var pg=Ci.exports,wg=pg.default;Object.defineProperty(Pr,"__esModule",{value:!0});var wi=Pr.default=void 0,Sg=wg(c);wi=Pr.default=parseInt(Sg.version,10);const Si=c.createContext(void 0);function st(){const e=c.useContext(Si);if(e===void 0)throw new Error(["MUI X: Could not find the Data Grid private 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 $t=(e,t)=>_n(e),Mr=(e,t)=>K(e,_n),xg=typeof navigator<"u"?navigator.userAgent.toLowerCase():"empty",vg=xg.includes("firefox"),Wn=e=>e.rowsMeta,To=e=>e.virtualization;le(To,e=>e.enabled);const xi=le(To,e=>e.enabledForColumns),yg=le(To,e=>e.enabledForRows),Un=le(To,e=>e.renderContext),Ig=Pe(e=>e.virtualization.renderContext.firstColumnIndex,e=>e.virtualization.renderContext.lastColumnIndex,(e,t)=>({firstColumnIndex:e,lastColumnIndex:t})),Qo={firstRowIndex:0,lastRowIndex:0,firstColumnIndex:0,lastColumnIndex:0},Pg=(e,t)=>{const{disableVirtualization:n,autoHeight:o}=t;return h({},e,{virtualization:{enabled:!n,enabledForColumns:!n,enabledForRows:!n&&!o,renderContext:Qo}})};function Mg(e,t){const n=l=>{e.current.setState(s=>h({},s,{virtualization:h({},s.virtualization,{enabled:l,enabledForColumns:l,enabledForRows:l&&!t.autoHeight})}))};de(e,{unstable_setVirtualization:n,unstable_setColumnVirtualization:l=>{e.current.setState(s=>h({},s,{virtualization:h({},s.virtualization,{enabledForColumns:l})}))}},"public"),c.useEffect(()=>{n(!t.disableVirtualization)},[t.disableVirtualization,t.autoHeight])}const kr=e=>e.rowSpanning,vi=le(kr,e=>e.hiddenCells),kg=le(kr,e=>e.spannedCells),Eg=le(kr,e=>e.hiddenCellOriginMap),dn=e=>e.listViewColumn,Fg=ys(ot,Un,_n,je,ut,(e,t,n,o,r)=>{if(!e)return!1;const l=r[e.id];if(!l)return!1;const s=n.rowToIndexMap.get(l),a=o.slice(t.firstColumnIndex,t.lastColumnIndex).findIndex(d=>d.field===e.field);return!(s!==void 0&&a!==-1&&s>=t.firstRowIndex&&s<=t.lastRowIndex)}),Tg=Pe(Fg,je,_n,ut,ot,(e,t,n,o,r)=>{if(!e)return null;const l=o[r.id];if(!l)return null;const s=n.rowToIndexMap.get(l);if(s===void 0)return null;const a=t.findIndex(i=>i.field===r.field);return a===-1?null:h({},r,{rowIndex:s,columnIndex:a})});function nn(e,t){return Math.round(e*10**t)/10**t}const mo=typeof window<"u"&&/jsdom|HappyDOM/.test(window.navigator.userAgent),No=50;var Be=function(e){return e[e.NONE=0]="NONE",e[e.UP=1]="UP",e[e.DOWN=2]="DOWN",e[e.LEFT=3]="LEFT",e[e.RIGHT=4]="RIGHT",e}(Be||{});const wl={top:0,left:0},Hg=Object.freeze(new Map),Dg=(e,t,n,o,r)=>({direction:Be.NONE,buffer:Ii(e,Be.NONE,t,n,o,r)}),Og=()=>{var oe;const e=st(),t=ne(),{unstable_listView:n}=t,o=K(e,()=>n?[dn(e.current.state)]:je(e)),r=K(e,yg)&&!mo,l=K(e,xi)&&!mo,s=K(e,Cn),a=bn(e),i=n?go:a,d=s.bottom.length>0,[u,g]=c.useState(Hg),f=It(),x=K(e,Et),I=Mr(e),y=e.current.mainElementRef,w=e.current.virtualScrollerRef,m=e.current.virtualScrollbarVerticalRef,p=e.current.virtualScrollbarHorizontalRef,E=K(e,gu),R=c.useRef(!1),H=K(e,dr),V=K(e,Ea),A=K(e,vo),L=K(e,Lg),P=K(e,Ts),D=K(e,Fs),z=c.useRef(null),F=c.useCallback(X=>{if(y.current=X,!X)return;const ie=X.getBoundingClientRect();let xe={width:nn(ie.width,1),height:nn(ie.height,1)};if((!z.current||xe.width!==z.current.width&&xe.height!==z.current.height)&&(z.current=xe,e.current.publishEvent("resize",xe)),typeof ResizeObserver>"u")return;const Ce=new ResizeObserver(ye=>{const be=ye[0];if(!be)return;const $e={width:nn(be.contentRect.width,1),height:nn(be.contentRect.height,1)};$e.width===xe.width&&$e.height===xe.height||(e.current.publishEvent("resize",$e),xe=$e)});if(Ce.observe(X),wi>=19)return()=>{y.current=null,Ce.disconnect()}},[e,y]),T=c.useRef(((oe=t.initialState)==null?void 0:oe.scroll)??wl),G=c.useRef(!1),M=c.useRef(wl),b=c.useRef(Qo),C=K(e,Un),$=K(e,Tg),k=fn(),O=c.useRef(void 0),j=yt(()=>Dg(f,t.rowBufferPx,t.columnBufferPx,H*15,No*6)).current,N=c.useCallback(X=>{if($g(X,e.current.state.virtualization.renderContext))return;const ie=X.firstRowIndex!==b.current.firstRowIndex||X.lastRowIndex!==b.current.lastRowIndex;e.current.setState(Ce=>h({},Ce,{virtualization:h({},Ce.virtualization,{renderContext:X})})),qe(e.current.state).isReady&&ie&&(b.current=X,e.current.publishEvent("renderedRowsIntervalChange",X)),M.current=T.current},[e]),_=ze(()=>{const X=w.current;if(!X)return;const ie=qe(e.current.state),xe=Math.ceil(ie.minimumSize.height-ie.viewportOuterSize.height),Ce=Math.ceil(ie.minimumSize.width-ie.viewportInnerSize.width),ye={top:lt(X.scrollTop,0,xe),left:f?lt(X.scrollLeft,-Ce,0):lt(X.scrollLeft,0,Ce)},be=ye.left-T.current.left,$e=ye.top-T.current.top,Qe=be!==0||$e!==0;T.current=ye;const Le=Qe?zg(be,$e):Be.NONE,Ae=Math.abs(T.current.top-M.current.top),_e=Math.abs(T.current.left-M.current.left),ae=Ae>=H||_e>=No,Me=j.direction!==Le;if(!(ae||Me))return C;if(Me)switch(Le){case Be.NONE:case Be.LEFT:case Be.RIGHT:O.current=void 0;break;default:O.current=C;break}j.direction=Le,j.buffer=Ii(f,Le,t.rowBufferPx,t.columnBufferPx,H*15,No*6);const we=Sl(e,t,r,l),ke=xl(we,T.current,j);return lc.flushSync(()=>{N(ke)}),k.start(1e3,_),ke}),U=()=>{if(!qe(e.current.state).isReady&&(r||l))return;const X=Sl(e,t,r,l),ie=xl(X,T.current,j);O.current=void 0,N(ie)},q=ze(()=>{if(G.current){G.current=!1;return}const X=_();e.current.publishEvent("scrollPositionChange",{top:T.current.top,left:T.current.left,renderContext:X})}),W=ze(X=>{e.current.publishEvent("virtualScrollerWheel",{},X)}),Y=ze(X=>{e.current.publishEvent("virtualScrollerTouchMove",{},X)}),Q=(X={})=>{var ce;if(!X.rows&&!I.range)return[];let ie=C;X.renderContext&&(ie=X.renderContext,ie.firstColumnIndex=C.firstColumnIndex,ie.lastColumnIndex=C.lastColumnIndex);const xe=!d&&X.position===void 0||d&&X.position==="bottom",Ce=X.position!==void 0;let ye;switch(X.position){case"top":ye=0;break;case"bottom":ye=s.top.length+I.rows.length;break;case void 0:ye=s.top.length;break}const be=X.rows??I.rows,$e=ie.firstRowIndex,Qe=Math.min(ie.lastRowIndex,be.length),Le=X.rows?nl(0,X.rows.length):nl($e,Qe);let Ae=-1;!Ce&&$&&($.rowIndex<$e&&(Le.unshift($.rowIndex),Ae=$.rowIndex),$.rowIndex>Qe&&(Le.push($.rowIndex),Ae=$.rowIndex));const _e=[],ae=(ce=t.slotProps)==null?void 0:ce.row,Me=Vt(e);return Le.forEach(we=>{var Yn,Gr,Rr;const{id:ke,model:se}=be[we],ge=(((Yn=I==null?void 0:I.range)==null?void 0:Yn.firstRowIndex)||0)+ye+we;if(E){const $o=i.left.length,$r=o.length-i.right.length;e.current.calculateColSpan({rowId:ke,minFirstColumn:$o,maxLastColumn:$r,columns:o}),i.left.length>0&&e.current.calculateColSpan({rowId:ke,minFirstColumn:0,maxLastColumn:i.left.length,columns:o}),i.right.length>0&&e.current.calculateColSpan({rowId:ke,minFirstColumn:o.length-i.right.length,maxLastColumn:o.length,columns:o})}const Se=e.current.rowHasAutoHeight(ke)?"auto":e.current.unstable_getRowHeight(ke);let ue;x[ke]==null?ue=!1:ue=e.current.isRowSelectable(ke);let Ge=!1;X.position===void 0&&(Ge=we===0);let Ee=!1;const nt=we===be.length-1;if(xe)if(Ce)Ee=nt;else{const $o=I.rows.length-1;we===$o&&(Ee=!0)}let Dt=ie;O.current&&we>=O.current.firstRowIndex&&we<O.current.lastRowIndex&&(Dt=O.current);const qn=we===Ae,Do=($==null?void 0:$.rowIndex)===ge,Oo=yi(Me,Dt,i.left.length),Lo=nt&&X.position==="top",Go=Dt.firstColumnIndex,Ro=Dt.lastColumnIndex;if(_e.push(v.jsx(t.slots.row,h({row:se,rowId:ke,index:ge,selected:ue,offsetLeft:Oo,columnsTotalWidth:A,rowHeight:Se,pinnedColumns:i,visibleColumns:o,firstColumnIndex:Go,lastColumnIndex:Ro,focusedColumnIndex:Do?$.columnIndex:void 0,isFirstVisible:Ge,isLastVisible:Ee,isNotVisible:qn,showBottomBorder:Lo,scrollbarWidth:P,gridHasFiller:D},ae),ke)),qn)return;const Xn=u.get(ke);Xn&&_e.push(Xn),X.position===void 0&&nt&&_e.push((Rr=(Gr=e.current).getInfiniteLoadingTriggerElement)==null?void 0:Rr.call(Gr,{lastRowId:ke}))}),_e},Z=c.useMemo(()=>({overflowX:!L||n?"hidden":void 0,overflowY:t.autoHeight?"hidden":void 0}),[L,t.autoHeight,n]),J=c.useMemo(()=>{const X={width:L?A:"auto",flexBasis:V,flexShrink:0};return X.flexBasis===0&&(X.flexBasis=Ks),X},[A,V,L]),te=c.useCallback(X=>{X&&e.current.publishEvent("virtualScrollerContentSizeChange",{columnsTotalWidth:A,contentHeight:V})},[e,A,V]);return Je(()=>{var X,ie;R.current&&((ie=(X=e.current).updateRenderContext)==null||ie.call(X))},[e,l,r]),Je(()=>{n&&(w.current.scrollLeft=0)},[n,w]),Cd(C!==Qo,()=>{var X;if(e.current.publishEvent("scrollPositionChange",{top:T.current.top,left:T.current.left,renderContext:C}),R.current=!0,(X=t.initialState)!=null&&X.scroll&&w.current){const ie=w.current,{top:xe,left:Ce}=t.initialState.scroll,ye={top:!(xe>0),left:!(Ce>0)};if(!ye.left&&A&&(ie.scrollLeft=Ce,G.current=!0,ye.left=!0),!ye.top&&V&&(ie.scrollTop=xe,G.current=!0,ye.top=!0),!ye.top||!ye.left){const be=e.current.subscribeEvent("virtualScrollerContentSizeChange",$e=>{!ye.left&&$e.columnsTotalWidth&&(ie.scrollLeft=Ce,G.current=!0,ye.left=!0),!ye.top&&$e.contentHeight&&(ie.scrollTop=xe,G.current=!0,ye.top=!0),ye.left&&ye.top&&be()});return be}}}),e.current.register("private",{updateRenderContext:U}),Te(e,"sortedRowsSet",U),Te(e,"paginationModelChange",U),Te(e,"columnsChange",U),{renderContext:C,setPanels:g,getRows:Q,getContainerProps:()=>({ref:F}),getScrollerProps:()=>({ref:w,onScroll:q,onWheel:W,onTouchMove:Y,style:Z,role:"presentation",tabIndex:vg?-1:void 0}),getContentProps:()=>({style:J,role:"presentation",ref:te}),getRenderZoneProps:()=>({role:"rowgroup"}),getScrollbarVerticalProps:()=>({ref:m,role:"presentation",scrollPosition:T}),getScrollbarHorizontalProps:()=>({ref:p,role:"presentation",scrollPosition:T}),getScrollAreaProps:()=>({scrollPosition:T})}};function Lg(e){return e.dimensions.viewportOuterSize.width>0&&e.dimensions.columnsTotalWidth>e.dimensions.viewportOuterSize.width}function Sl(e,t,n,o){const r=qe(e.current.state),l=$t(e),s=t.unstable_listView?[dn(e.current.state)]:je(e),a=Eg(e),i=e.current.state.rows.dataRowIds.at(-1),d=s.at(-1);return{enabledForRows:n,enabledForColumns:o,apiRef:e,autoHeight:t.autoHeight,rowBufferPx:t.rowBufferPx,columnBufferPx:t.columnBufferPx,leftPinnedWidth:r.leftPinnedWidth,columnsTotalWidth:r.columnsTotalWidth,viewportInnerWidth:r.viewportInnerSize.width,viewportInnerHeight:r.viewportInnerSize.height,lastRowHeight:i!==void 0?e.current.unstable_getRowHeight(i):0,lastColumnWidth:(d==null?void 0:d.computedWidth)??0,rowsMeta:Wn(e.current.state),columnPositions:Vt(e),rows:l.rows,range:l.range,pinnedColumns:bn(e),visibleColumns:s,hiddenCellsOriginMap:a,listView:t.unstable_listView??!1,virtualizeColumnsWithAutoRowHeight:t.virtualizeColumnsWithAutoRowHeight}}function xl(e,t,n){const o={firstRowIndex:0,lastRowIndex:e.rows.length,firstColumnIndex:0,lastColumnIndex:e.visibleColumns.length};if(e.listView)return h({},o,{lastColumnIndex:1});const{top:r,left:l}=t,s=Math.abs(l)+e.leftPinnedWidth;if(e.enabledForRows){let i=Math.min(vl(e,r,{atStart:!0,lastPosition:e.rowsMeta.positions[e.rowsMeta.positions.length-1]+e.lastRowHeight}),e.rowsMeta.positions.length-1);const d=e.hiddenCellsOriginMap[i];if(d){const g=Math.min(...Object.values(d));i=Math.min(i,g)}const u=e.autoHeight?i+e.rows.length:vl(e,r+e.viewportInnerHeight);o.firstRowIndex=i,o.lastRowIndex=u}if(e.enabledForColumns){let i=0,d=e.columnPositions.length,u=!1;const[g,f]=Zo({firstIndex:o.firstRowIndex,lastIndex:o.lastRowIndex,minFirstIndex:0,maxLastIndex:e.rows.length,bufferBefore:n.buffer.rowBefore,bufferAfter:n.buffer.rowAfter,positions:e.rowsMeta.positions,lastSize:e.lastRowHeight});if(!e.virtualizeColumnsWithAutoRowHeight)for(let x=g;x<f&&!u;x+=1){const I=e.rows[x];u=e.apiRef.current.rowHasAutoHeight(I.id)}(!u||e.virtualizeColumnsWithAutoRowHeight)&&(i=zt(s,e.columnPositions,{atStart:!0,lastPosition:e.columnsTotalWidth}),d=zt(s+e.viewportInnerWidth,e.columnPositions)),o.firstColumnIndex=i,o.lastColumnIndex=d}return Gg(e,o,n)}function vl(e,t,n){var s,a;const o=e.apiRef.current.getLastMeasuredRowIndex();let r=o===1/0;(s=e.range)!=null&&s.lastRowIndex&&!r&&(r=o>=e.range.lastRowIndex);const l=lt(o-(((a=e.range)==null?void 0:a.firstRowIndex)||0),0,e.rowsMeta.positions.length);return r||e.rowsMeta.positions[l]>=t?zt(t,e.rowsMeta.positions,n):Rg(t,e.rowsMeta.positions,l,n)}function Gg(e,t,n){const[o,r]=Zo({firstIndex:t.firstRowIndex,lastIndex:t.lastRowIndex,minFirstIndex:0,maxLastIndex:e.rows.length,bufferBefore:n.buffer.rowBefore,bufferAfter:n.buffer.rowAfter,positions:e.rowsMeta.positions,lastSize:e.lastRowHeight}),[l,s]=Zo({firstIndex:t.firstColumnIndex,lastIndex:t.lastColumnIndex,minFirstIndex:e.pinnedColumns.left.length,maxLastIndex:e.visibleColumns.length-e.pinnedColumns.right.length,bufferBefore:n.buffer.columnBefore,bufferAfter:n.buffer.columnAfter,positions:e.columnPositions,lastSize:e.lastColumnWidth}),a=ug({firstColumnToRender:l,apiRef:e.apiRef,firstRowToRender:o,lastRowToRender:r,visibleRows:e.rows});return{firstRowIndex:o,lastRowIndex:r,firstColumnIndex:a,lastColumnIndex:s}}function zt(e,t,n=void 0,o=0,r=t.length){if(t.length<=0)return-1;if(o>=r)return o;const l=o+Math.floor((r-o)/2),s=t[l];let a;if(n!=null&&n.atStart){const i=(l===t.length-1?n.lastPosition:t[l+1])-s;a=e-i<s}else a=e<=s;return a?zt(e,t,n,o,l):zt(e,t,n,l+1,r)}function Rg(e,t,n,o=void 0){let r=1;for(;n<t.length&&Math.abs(t[n])<e;)n+=r,r*=2;return zt(e,t,o,Math.floor(n/2),Math.min(n,t.length))}function Zo({firstIndex:e,lastIndex:t,bufferBefore:n,bufferAfter:o,minFirstIndex:r,maxLastIndex:l,positions:s,lastSize:a}){const i=s[e]-n,d=s[t]+o,u=zt(i,s,{atStart:!0,lastPosition:s[s.length-1]+a}),g=zt(d,s);return[lt(u,r,l),lt(g,r,l)]}function $g(e,t){return e===t?!0:e.firstRowIndex===t.firstRowIndex&&e.lastRowIndex===t.lastRowIndex&&e.firstColumnIndex===t.firstColumnIndex&&e.lastColumnIndex===t.lastColumnIndex}function yi(e,t,n){const o=(e[t.firstColumnIndex]??0)-(e[n]??0);return Math.abs(o)}function zg(e,t){return e===0&&t===0?Be.NONE:Math.abs(t)>=Math.abs(e)?t>0?Be.DOWN:Be.UP:e>0?Be.RIGHT:Be.LEFT}function Ii(e,t,n,o,r,l){if(e)switch(t){case Be.LEFT:t=Be.RIGHT;break;case Be.RIGHT:t=Be.LEFT;break}switch(t){case Be.NONE:return{rowAfter:n,rowBefore:n,columnAfter:o,columnBefore:o};case Be.LEFT:return{rowAfter:0,rowBefore:0,columnAfter:0,columnBefore:l};case Be.RIGHT:return{rowAfter:0,rowBefore:0,columnAfter:l,columnBefore:0};case Be.UP:return{rowAfter:0,rowBefore:r,columnAfter:0,columnBefore:0};case Be.DOWN:return{rowAfter:r,rowBefore:0,columnAfter:0,columnBefore:0};default:throw new Error("unreachable")}}const Vg=()=>{var g,f;const e=he(),t=ne(),n=K(e,An),o=K(e,pr),r=K(e,Bs),l=n===0&&r===0,s=K(e,Tu),a=!s&&l,i=!s&&n>0&&o===0;let d=null,u=null;return a&&(d="noRowsOverlay"),i&&(d="noResultsOverlay"),s&&(d="loadingOverlay",u=((f=(g=t.slotProps)==null?void 0:g.loadingOverlay)==null?void 0:f[l?"noRowsVariant":"variant"])||null),{overlayType:d,loadingOverlayVariant:u}},Ag=He("div",{name:"MuiDataGrid",slot:"OverlayWrapper",shouldForwardProp:e=>e!=="overlayType"&&e!=="loadingOverlayVariant",overridesResolver:(e,t)=>t.overlayWrapper})(({overlayType:e,loadingOverlayVariant:t})=>t!=="skeleton"?{position:"sticky",top:"var(--DataGrid-headersTotalHeight)",left:0,width:0,height:0,zIndex:e==="loadingOverlay"?5:4}:{}),Ng=He("div",{name:"MuiDataGrid",slot:"OverlayWrapperInner",shouldForwardProp:e=>e!=="overlayType"&&e!=="loadingOverlayVariant",overridesResolver:(e,t)=>t.overlayWrapperInner})({}),jg=e=>{const{classes:t}=e;return fe({root:["overlayWrapper"],inner:["overlayWrapperInner"]},pe,t)};function _g(e){const t=he(),n=ne(),o=K(t,qe);let r=Math.max(o.viewportOuterSize.height-o.topContainerHeight-o.bottomContainerHeight-(o.hasScrollX?o.scrollbarSize:0),0);r===0&&(r=Ks);const l=jg(h({},e,{classes:n.classes}));return v.jsx(Ag,h({className:ve(l.root)},e,{children:v.jsx(Ng,h({className:ve(l.inner),style:{height:r,width:o.viewportOuterSize.width}},e))}))}function Bg(e){var l,s;const{overlayType:t}=e,n=ne();if(!t)return null;const o=(l=n.slots)==null?void 0:l[t],r=(s=n.slotProps)==null?void 0:s[t];return v.jsx(_g,h({},e,{children:v.jsx(o,h({},r))}))}const lo=e=>e.columnMenu;function Wg(){var w;const e=st(),t=ne(),n=K(e,je),o=K(e,rd),r=K(e,Ju),l=K(e,ni),s=K(e,()=>xr(e)===null),a=K(e,md),i=K(e,hd),d=K(e,fo),u=K(e,Bn),g=K(e,lo),f=K(e,at),x=K(e,ig),I=!(a===null&&l===null&&s),y=e.current.columnHeadersContainerRef;return v.jsx(t.slots.columnHeaders,h({ref:y,visibleColumns:n,filterColumnLookup:o,sortColumnLookup:r,columnHeaderTabIndexState:l,columnGroupHeaderTabIndexState:a,columnHeaderFocus:i,columnGroupHeaderFocus:d,headerGroupingMaxDepth:u,columnMenuState:g,columnVisibility:f,columnGroupsHeaderStructure:x,hasOtherElementInTabSequence:I},(w=t.slotProps)==null?void 0:w.columnHeaders))}const Ug=Ft(Wg),Pi=c.createContext(void 0),Mi=()=>{const e=c.useContext(Pi);if(e===void 0)throw new Error(["MUI X: Could not find the Data Grid configuration 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},Kg=He("div")({position:"absolute",top:"var(--DataGrid-headersTotalHeight)",left:0,width:"calc(100% - (var(--DataGrid-hasScrollY) * var(--DataGrid-scrollbarSize)))"}),qg=He("div",{name:"MuiDataGrid",slot:"Main",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.main,n.hasPinnedRight&&t["main--hasPinnedRight"],n.loadingOverlayVariant==="skeleton"&&t["main--hasSkeletonLoadingOverlay"]]}})({flexGrow:1,position:"relative",overflow:"hidden",display:"flex",flexDirection:"column"}),Xg=Ie((e,t)=>{var s;const{ownerState:n}=e,o=ne(),l=Mi().hooks.useGridAriaAttributes();return v.jsxs(qg,h({ownerState:n,className:e.className,tabIndex:-1},l,(s=o.slotProps)==null?void 0:s.main,{ref:t,children:[v.jsx(Kg,{role:"presentation","data-id":"gridPanelAnchor"}),e.children]}))}),Yg=()=>fe({root:["topContainer"]},pe,{}),Qg=He("div")({position:"sticky",zIndex:4,top:0});function Zg(e){const t=Yg();return v.jsx(Qg,h({},e,{className:ve(t.root,S["container--top"]),role:"presentation"}))}const Jg=()=>fe({root:["bottomContainer"]},pe,{}),ef=He("div")({position:"sticky",zIndex:4,bottom:"calc(var(--DataGrid-hasScrollX) * var(--DataGrid-scrollbarSize))"});function tf(e){const t=Jg();return v.jsx(ef,h({},e,{className:ve(t.root,S["container--bottom"]),role:"presentation"}))}const nf=(e,t)=>{const{classes:n}=e;return fe({root:["virtualScrollerContent",t&&"virtualScrollerContent--overflowed"]},pe,n)},of=He("div",{name:"MuiDataGrid",slot:"VirtualScrollerContent",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.virtualScrollerContent,n.overflowedContent&&t["virtualScrollerContent--overflowed"]]}})({}),rf=Ie(function(t,n){var a;const o=ne(),r=!o.autoHeight&&((a=t.style)==null?void 0:a.minHeight)==="auto",l=nf(o,r),s={classes:o.classes,overflowedContent:r};return v.jsx(of,h({},t,{ownerState:s,className:ve(l.root,t.className),ref:n}))}),lf=He("div")({display:"flex",flexDirection:"row",width:"var(--DataGrid-rowWidth)",boxSizing:"border-box"}),ki=He("div")({position:"sticky",height:"100%",boxSizing:"border-box",borderTop:"1px solid var(--rowBorderColor)",backgroundColor:"var(--DataGrid-pinnedBackground)"}),sf=He(ki)({left:0,borderRight:"1px solid var(--rowBorderColor)"}),cf=He(ki)({right:0,borderLeft:"1px solid var(--rowBorderColor)"}),af=He("div")({flexGrow:1,borderTop:"1px solid var(--rowBorderColor)"});function uf({rowsLength:e}){const t=he(),{viewportOuterSize:n,minimumSize:o,hasScrollX:r,hasScrollY:l,scrollbarSize:s,leftPinnedWidth:a,rightPinnedWidth:i}=K(t,qe),d=r?s:0,u=n.height-o.height>0;return d===0&&!u?null:v.jsxs(lf,{className:S.filler,role:"presentation",style:{height:d,"--rowBorderColor":e===0?"transparent":"var(--DataGrid-rowBorderColor)"},children:[a>0&&v.jsx(sf,{className:S["filler--pinnedLeft"],style:{width:a}}),v.jsx(af,{}),i>0&&v.jsx(cf,{className:S["filler--pinnedRight"],style:{width:i+(l?s:0)}})]})}const df=Ft(uf),gf=["className"],ff=e=>{const{classes:t}=e;return fe({root:["virtualScrollerRenderZone"]},pe,t)},hf=He("div",{name:"MuiDataGrid",slot:"VirtualScrollerRenderZone",overridesResolver:(e,t)=>t.virtualScrollerRenderZone})({position:"absolute",display:"flex",flexDirection:"column"}),mf=Ie(function(t,n){const{className:o}=t,r=re(t,gf),l=he(),s=ne(),a=ff(s),i=K(l,()=>{const d=Un(l);return Wn(l.current.state).positions[d.firstRowIndex]??0});return v.jsx(hf,h({className:ve(a.root,o),ownerState:s,style:{transform:`translate3d(0, ${i}px, 0)`}},r,{ref:n}))}),bf={includeHeaders:!0,includeOutliers:!1,outliersFactor:1.5,expand:!1,disableColumnVirtualization:!0},We=e=>e.editRows,Ei=Vn(We,(e,{rowId:t,editMode:n})=>n===vt.Row&&!!e[t]),Cf=Vn(We,(e,{rowId:t,field:n})=>{var o;return((o=e[t])==null?void 0:o[n])??null}),Rn=e=>e.preferencePanel,pf=Vn(Rn,(e,t)=>!!(e.open&&e.labelId===t));var Bt=function(e){return e.filters="filters",e.columns="columns",e}(Bt||{});const wf=(e,t)=>{const{classes:n}=e,o={root:["scrollbar",`scrollbar--${t}`],content:["scrollbarContent"]};return fe(o,pe,n)},Fi=He("div")({position:"absolute",display:"inline-block",zIndex:6,"&:hover":{zIndex:7},"--size":"calc(max(var(--DataGrid-scrollbarSize), 14px))"}),Sf=He(Fi)({width:"var(--size)",height:"calc(var(--DataGrid-hasScrollY) * (100% - var(--DataGrid-topContainerHeight) - var(--DataGrid-bottomContainerHeight) - var(--DataGrid-hasScrollX) * var(--DataGrid-scrollbarSize)))",overflowY:"auto",overflowX:"hidden",outline:0,"& > div":{width:"var(--size)"},top:"var(--DataGrid-topContainerHeight)",right:"0px"}),xf=He(Fi)({width:"100%",height:"var(--size)",overflowY:"hidden",overflowX:"auto",outline:0,"& > div":{height:"var(--size)"},bottom:"0px"}),yl=Ie(function(t,n){const o=st(),r=ne(),l=c.useRef(!1),s=c.useRef(0),a=c.useRef(null),i=c.useRef(null),d=wf(r,t.position),u=K(o,qe),g=t.position==="vertical"?"height":"width",f=t.position==="vertical"?"scrollTop":"scrollLeft",x=t.position==="vertical"?"top":"left",I=t.position==="vertical"?u.hasScrollX:u.hasScrollY,y=u.minimumSize[g]+(I?u.scrollbarSize:0),m=(t.position==="vertical"?u.viewportInnerSize.height:u.viewportOuterSize.width)*(y/u.viewportOuterSize[g]),p=ze(()=>{const H=a.current,V=t.scrollPosition.current;if(!H||V[x]===s.current)return;if(s.current=V[x],l.current){l.current=!1;return}l.current=!0;const A=V[x]/y;H[f]=A*m}),E=ze(()=>{const H=o.current.virtualScrollerRef.current,V=a.current;if(!V)return;if(l.current){l.current=!1;return}l.current=!0;const A=V[f]/m;H[f]=A*y});cs(()=>{const H=o.current.virtualScrollerRef.current,V=a.current,A={passive:!0};return H.addEventListener("scroll",p,A),V.addEventListener("scroll",E,A),()=>{H.removeEventListener("scroll",p,A),V.removeEventListener("scroll",E,A)}}),c.useEffect(()=>{i.current.style.setProperty(g,`${m}px`)},[m,g]);const R=t.position==="vertical"?Sf:xf;return v.jsx(R,{ref:wt(n,a),className:d.root,style:t.position==="vertical"&&r.unstable_listView?{height:"100%",top:0}:void 0,tabIndex:-1,"aria-hidden":"true",children:v.jsx("div",{ref:i,className:d.content})})}),vf=e=>{const{classes:t,hasScrollX:n,hasPinnedRight:o,loadingOverlayVariant:r}=e;return fe({root:["main",o&&"main--hasPinnedRight",r==="skeleton"&&"main--hasSkeletonLoadingOverlay"],scroller:["virtualScroller",n&&"virtualScroller--hasScrollX"]},pe,t)},yf=He("div",{name:"MuiDataGrid",slot:"VirtualScroller",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.virtualScroller,n.hasScrollX&&t["virtualScroller--hasScrollX"]]}})({position:"relative",height:"100%",flexGrow:1,overflow:"scroll",scrollbarWidth:"none",display:"flex",flexDirection:"column","&::-webkit-scrollbar":{display:"none"},"@media print":{overflow:"hidden"},zIndex:0}),If=e=>e.dimensions.rightPinnedWidth>0;function Pf(e){const t=he(),n=ne(),o=K(t,Ta),r=K(t,Fa),l=K(t,If),s=K(t,Oa),a=Vg(),i={classes:n.classes,hasScrollX:r,hasPinnedRight:l,loadingOverlayVariant:a.loadingOverlayVariant},d=vf(i),u=Og(),{getContainerProps:g,getScrollerProps:f,getContentProps:x,getRenderZoneProps:I,getScrollbarVerticalProps:y,getScrollbarHorizontalProps:w,getRows:m,getScrollAreaProps:p}=u,E=m();return v.jsxs(Xg,h({className:d.root},g(),{ownerState:i,children:[v.jsx(pl,h({scrollDirection:"left"},p())),v.jsx(pl,h({scrollDirection:"right"},p())),v.jsxs(yf,h({className:d.scroller},f(),{ownerState:i,children:[v.jsxs(Zg,{children:[!n.unstable_listView&&v.jsx(Ug,{}),v.jsx(n.slots.pinnedRows,{position:"top",virtualScroller:u})]}),v.jsx(Bg,h({},a)),v.jsx(rf,h({},x(),{children:v.jsxs(mf,h({},I(),{children:[E,v.jsx(n.slots.detailPanels,{virtualScroller:u})]}))})),s&&v.jsx(df,{rowsLength:E.length}),v.jsx(tf,{children:v.jsx(n.slots.pinnedRows,{position:"bottom",virtualScroller:u})})]})),r&&!n.unstable_listView&&v.jsx(yl,h({position:"horizontal"},w())),o&&v.jsx(yl,h({position:"vertical"},y())),e.children]}))}function Mf(){var t;const e=ne();return e.hideFooter?null:v.jsx(e.slots.footer,h({},(t=e.slotProps)==null?void 0:t.footer))}let jo;function kf(){return jo===void 0&&document.createElement("div").focus({get preventScroll(){return jo=!0,!1}}),jo}function Ef({defaultSlots:e,slots:t}){const n=t;if(!n||Object.keys(n).length===0)return e;const o=h({},e);return Object.keys(n).forEach(r=>{const l=r;n[l]!==void 0&&(o[l]=n[l])}),o}function Ff(e){var r;if((r=e.slotProps)!=null&&r.root)return e;const t=Object.keys(e);if(!t.some(l=>l.startsWith("aria-")||l.startsWith("data-")))return e;const n={},o=e.forwardedProps??{};for(let l=0;l<t.length;l+=1){const s=t[l];s.startsWith("aria-")||s.startsWith("data-")?o[s]=e[s]:n[s]=e[s]}return n.forwardedProps=o,n}function Tf(e){return c.useMemo(()=>Ff(e),[e])}const Hf=e=>{const t=e.match(/^__row_group_by_columns_group_(.*)__$/);return t?t[1]:null},Df=e=>e===Xs||Hf(e)!==null,Ti=(e,t)=>{if(e)if(t){if(e===me.LEFT)return"right";if(e===me.RIGHT)return"left"}else{if(e===me.LEFT)return"left";if(e===me.RIGHT)return"right"}};function Ho(e,t,n,o){const r=Ti(n,t);return!r||o===void 0||(e[r]=o),e}const Of=["column","row","rowId","rowNode","align","children","colIndex","width","className","style","colSpan","disableDragEvents","isNotVisible","pinnedOffset","pinnedPosition","showRightBorder","showLeftBorder","onClick","onDoubleClick","onMouseDown","onMouseUp","onMouseOver","onKeyDown","onKeyUp","onDragEnter","onDragOver"],Lf=["changeReason","unstable_updateValueOnRender"];me.LEFT+"",Lt.LEFT,me.RIGHT+"",Lt.RIGHT,me.NONE+"",me.VIRTUAL+"";const Gf=e=>{const{align:t,showLeftBorder:n,showRightBorder:o,pinnedPosition:r,isEditable:l,isSelected:s,isSelectionMode:a,classes:i}=e,d={root:["cell",`cell--text${zn(t)}`,s&&"selected",l&&"cell--editable",n&&"cell--withLeftBorder",o&&"cell--withRightBorder",r===me.LEFT&&"cell--pinnedLeft",r===me.RIGHT&&"cell--pinnedRight",a&&!l&&"cell--selectionMode"]};return fe(d,pe,i)},Rf=Ie(function(t,n){var se,ge,Se;const{column:o,row:r,rowId:l,rowNode:s,align:a,colIndex:i,width:d,className:u,style:g,colSpan:f,disableDragEvents:x,isNotVisible:I,pinnedOffset:y,pinnedPosition:w,showRightBorder:m,showLeftBorder:p,onClick:E,onDoubleClick:R,onMouseDown:H,onMouseUp:V,onMouseOver:A,onKeyDown:L,onKeyUp:P,onDragEnter:D,onDragOver:z}=t,F=re(t,Of),T=st(),G=ne(),M=It(),b=o.field,C=On(T,Cf,{rowId:l,field:b}),$=C?Fe.Edit:Fe.View,k=T.current.getCellParamsForRow(l,b,r,{colDef:o,cellMode:$,rowNode:s,tabIndex:K(T,()=>{const ue=xr(T);return ue&&ue.field===b&&ue.id===l?0:-1}),hasFocus:K(T,()=>{const ue=ot(T);return(ue==null?void 0:ue.id)===l&&ue.field===b})});k.api=T.current;const O=K(T,()=>T.current.unstable_applyPipeProcessors("isCellSelected",!1,{id:l,field:b})),j=K(T,vi),N=K(T,kg),{hasFocus:_,isEditable:U=!1,value:q}=k,W=o.type==="actions"&&((se=o.getActions)==null?void 0:se.call(o,T.current.getRowParams(l)).some(ue=>!ue.props.disabled)),Y=($==="view"||!U)&&!W?k.tabIndex:-1,{classes:Q,getCellClassName:Z}=G,te=[K(T,()=>T.current.unstable_applyPipeProcessors("cellClassName",[],{id:l,field:b}).filter(Boolean).join(" "))];o.cellClassName&&te.push(typeof o.cellClassName=="function"?o.cellClassName(k):o.cellClassName),o.display==="flex"&&te.push(S["cell--flex"]),Z&&te.push(Z(k));const oe=k.formattedValue??q,X=c.useRef(null),ie=wt(n,X),xe=c.useRef(null),Ce=G.cellSelection??!1,ye={align:a,showLeftBorder:p,showRightBorder:m,isEditable:U,classes:G.classes,pinnedPosition:w,isSelected:O,isSelectionMode:Ce},be=Gf(ye),$e=c.useCallback(ue=>Ge=>{const Ee=T.current.getCellParams(l,b||"");T.current.publishEvent(ue,Ee,Ge),V&&V(Ge)},[T,b,V,l]),Qe=c.useCallback(ue=>Ge=>{const Ee=T.current.getCellParams(l,b||"");T.current.publishEvent(ue,Ee,Ge),H&&H(Ge)},[T,b,H,l]),Le=c.useCallback((ue,Ge)=>Ee=>{if(!T.current.getRow(l))return;const nt=T.current.getCellParams(l,b||"");T.current.publishEvent(ue,nt,Ee),Ge&&Ge(Ee)},[T,b,l]),Ae=((ge=j[l])==null?void 0:ge[b])??!1,_e=((Se=N[l])==null?void 0:Se[b])??1,ae=c.useMemo(()=>{if(I)return{padding:0,opacity:0,width:0,height:0,border:0};const ue=Ho(h({"--width":`${d}px`},g),M,w,y),Ge=w===me.LEFT,Ee=w===me.RIGHT;return _e>1&&(ue.height=`calc(var(--height) * ${_e})`,ue.zIndex=5,(Ge||Ee)&&(ue.zIndex=6)),ue},[d,I,g,y,w,M,_e]);if(c.useEffect(()=>{if(!_||$===Fe.Edit)return;const ue=Rt(T.current.rootElementRef.current);if(X.current&&!X.current.contains(ue.activeElement)){const Ge=X.current.querySelector('[tabindex="0"]'),Ee=xe.current||Ge||X.current;if(kf())Ee.focus({preventScroll:!0});else{const nt=T.current.getScrollPosition();Ee.focus(),T.current.scroll(nt)}}},[_,$,T]),Ae)return v.jsx("div",{"data-colindex":i,role:"presentation",style:h({width:"var(--width)"},ae)});let Me=F.onFocus,ce,we;if(C===null&&o.renderCell&&(ce=o.renderCell(k)),C!==null&&o.renderEditCell){const ue=T.current.getRowWithUpdatedValues(l,o.field),Ge=re(C,Lf),Ee=o.valueFormatter?o.valueFormatter(C.value,ue,o,T):k.formattedValue,nt=h({},k,{row:ue,formattedValue:Ee},Ge);ce=o.renderEditCell(nt),te.push(S["cell--editing"]),te.push(Q==null?void 0:Q["cell--editing"])}if(ce===void 0){const ue=oe==null?void 0:oe.toString();ce=ue,we=ue}c.isValidElement(ce)&&W&&(ce=c.cloneElement(ce,{focusElementRef:xe}));const ke=x?null:{onDragEnter:Le("cellDragEnter",D),onDragOver:Le("cellDragOver",z)};return v.jsx("div",h({className:ve(be.root,te,u),role:"gridcell","data-field":b,"data-colindex":i,"aria-colindex":i+1,"aria-colspan":f,"aria-rowspan":_e,style:ae,title:we,tabIndex:Y,onClick:Le("cellClick",E),onDoubleClick:Le("cellDoubleClick",R),onMouseOver:Le("cellMouseOver",A),onMouseDown:Qe("cellMouseDown"),onMouseUp:$e("cellMouseUp"),onKeyDown:Le("cellKeyDown",L),onKeyUp:Le("cellKeyUp",P)},ke,F,{onFocus:Me,ref:ie,children:ce}))}),$f=Ft(Rf),zf=["field","type","align","width","height","empty","style","className"],Il="1.3em",Vf="1.2em",Pl=[40,80],Af={number:[40,60],string:[40,80],date:[40,60],dateTime:[60,80],singleSelect:[40,80]},Nf=e=>{const{align:t,classes:n,empty:o}=e,r={root:["cell","cellSkeleton",`cell--text${t?zn(t):"Left"}`,o&&"cellEmpty"]};return fe(r,pe,n)},jf=lu(12345);function _f(e){const{field:t,type:n,align:o,width:r,height:l,empty:s=!1,style:a,className:i}=e,d=re(e,zf),g={classes:ne().classes,align:o,empty:s},f=Nf(g),x=c.useMemo(()=>{if(n==="boolean"||n==="actions")return{variant:"circular",width:Il,height:Il};const[y,w]=n?Af[n]??Pl:Pl;return{variant:"text",width:`${Math.round(jf(y,w))}%`,height:Vf}},[n]);return v.jsx("div",h({"data-field":t,className:ve(f.root,i),style:h({height:l,maxWidth:r,minWidth:r},a)},d,{children:!s&&v.jsx(Bc,h({},x))}))}const Bf=Ft(_f);function Wf(e){return e.vars?e.vars.palette.TableCell.border:e.palette.mode==="light"?Tc(Nt(e.palette.divider,1),.88):Hc(Nt(e.palette.divider,1),.68)}const Ml={[`& .${S.iconButtonContainer}`]:{visibility:"visible",width:"auto"},[`& .${S.menuIcon}`]:{width:"auto",visibility:"visible"}},Uf=10,to=-5,Yt=1,kl={width:3,rx:1.5,x:10.5},Kf="/* emotion-disable-server-rendering-unsafe-selector-warning-please-do-not-use-this-the-warning-exists-for-a-reason */",qf=e=>e.dimensions.hasScrollX&&(!e.dimensions.hasScrollY||e.dimensions.scrollbarSize===0),Xf=Ve("div",{name:"MuiDataGrid",slot:"Root",overridesResolver:(e,t)=>[t.root,{[`&.${S.autoHeight}`]:t.autoHeight},{[`&.${S.autosizing}`]:t.autosizing},{[`&.${S["root--densityStandard"]}`]:t["root--densityStandard"]},{[`&.${S["root--densityComfortable"]}`]:t["root--densityComfortable"]},{[`&.${S["root--densityCompact"]}`]:t["root--densityCompact"]},{[`&.${S["root--disableUserSelection"]}`]:t["root--disableUserSelection"]},{[`&.${S["root--noToolbar"]}`]:t["root--noToolbar"]},{[`&.${S.withVerticalBorder}`]:t.withVerticalBorder},{[`& .${S.actionsCell}`]:t.actionsCell},{[`& .${S.booleanCell}`]:t.booleanCell},{[`& .${S.cell}`]:t.cell},{[`& .${S["cell--editable"]}`]:t["cell--editable"]},{[`& .${S["cell--editing"]}`]:t["cell--editing"]},{[`& .${S["cell--flex"]}`]:t["cell--flex"]},{[`& .${S["cell--pinnedLeft"]}`]:t["cell--pinnedLeft"]},{[`& .${S["cell--pinnedRight"]}`]:t["cell--pinnedRight"]},{[`& .${S["cell--rangeBottom"]}`]:t["cell--rangeBottom"]},{[`& .${S["cell--rangeLeft"]}`]:t["cell--rangeLeft"]},{[`& .${S["cell--rangeRight"]}`]:t["cell--rangeRight"]},{[`& .${S["cell--rangeTop"]}`]:t["cell--rangeTop"]},{[`& .${S["cell--selectionMode"]}`]:t["cell--selectionMode"]},{[`& .${S["cell--textCenter"]}`]:t["cell--textCenter"]},{[`& .${S["cell--textLeft"]}`]:t["cell--textLeft"]},{[`& .${S["cell--textRight"]}`]:t["cell--textRight"]},{[`& .${S["cell--withLeftBorder"]}`]:t["cell--withLeftBorder"]},{[`& .${S["cell--withRightBorder"]}`]:t["cell--withRightBorder"]},{[`& .${S.cellCheckbox}`]:t.cellCheckbox},{[`& .${S.cellEmpty}`]:t.cellEmpty},{[`& .${S.cellOffsetLeft}`]:t.cellOffsetLeft},{[`& .${S.cellSkeleton}`]:t.cellSkeleton},{[`& .${S.checkboxInput}`]:t.checkboxInput},{[`& .${S.columnHeader}`]:t.columnHeader},{[`& .${S["columnHeader--alignCenter"]}`]:t["columnHeader--alignCenter"]},{[`& .${S["columnHeader--alignLeft"]}`]:t["columnHeader--alignLeft"]},{[`& .${S["columnHeader--alignRight"]}`]:t["columnHeader--alignRight"]},{[`& .${S["columnHeader--dragging"]}`]:t["columnHeader--dragging"]},{[`& .${S["columnHeader--emptyGroup"]}`]:t["columnHeader--emptyGroup"]},{[`& .${S["columnHeader--filledGroup"]}`]:t["columnHeader--filledGroup"]},{[`& .${S["columnHeader--filtered"]}`]:t["columnHeader--filtered"]},{[`& .${S["columnHeader--last"]}`]:t["columnHeader--last"]},{[`& .${S["columnHeader--lastUnpinned"]}`]:t["columnHeader--lastUnpinned"]},{[`& .${S["columnHeader--moving"]}`]:t["columnHeader--moving"]},{[`& .${S["columnHeader--numeric"]}`]:t["columnHeader--numeric"]},{[`& .${S["columnHeader--pinnedLeft"]}`]:t["columnHeader--pinnedLeft"]},{[`& .${S["columnHeader--pinnedRight"]}`]:t["columnHeader--pinnedRight"]},{[`& .${S["columnHeader--siblingFocused"]}`]:t["columnHeader--siblingFocused"]},{[`& .${S["columnHeader--sortable"]}`]:t["columnHeader--sortable"]},{[`& .${S["columnHeader--sorted"]}`]:t["columnHeader--sorted"]},{[`& .${S["columnHeader--withLeftBorder"]}`]:t["columnHeader--withLeftBorder"]},{[`& .${S["columnHeader--withRightBorder"]}`]:t["columnHeader--withRightBorder"]},{[`& .${S.columnHeaderCheckbox}`]:t.columnHeaderCheckbox},{[`& .${S.columnHeaderDraggableContainer}`]:t.columnHeaderDraggableContainer},{[`& .${S.columnHeaderTitleContainer}`]:t.columnHeaderTitleContainer},{[`& .${S.columnHeaderTitleContainerContent}`]:t.columnHeaderTitleContainerContent},{[`& .${S.columnSeparator}`]:t.columnSeparator},{[`& .${S["columnSeparator--resizable"]}`]:t["columnSeparator--resizable"]},{[`& .${S["columnSeparator--resizing"]}`]:t["columnSeparator--resizing"]},{[`& .${S["columnSeparator--sideLeft"]}`]:t["columnSeparator--sideLeft"]},{[`& .${S["columnSeparator--sideRight"]}`]:t["columnSeparator--sideRight"]},{[`& .${S["container--bottom"]}`]:t["container--bottom"]},{[`& .${S["container--top"]}`]:t["container--top"]},{[`& .${S.detailPanelToggleCell}`]:t.detailPanelToggleCell},{[`& .${S["detailPanelToggleCell--expanded"]}`]:t["detailPanelToggleCell--expanded"]},{[`& .${S.editBooleanCell}`]:t.editBooleanCell},{[`& .${S.filterIcon}`]:t.filterIcon},{[`& .${S["filler--borderBottom"]}`]:t["filler--borderBottom"]},{[`& .${S["filler--pinnedLeft"]}`]:t["filler--pinnedLeft"]},{[`& .${S["filler--pinnedRight"]}`]:t["filler--pinnedRight"]},{[`& .${S.groupingCriteriaCell}`]:t.groupingCriteriaCell},{[`& .${S.groupingCriteriaCellLoadingContainer}`]:t.groupingCriteriaCellLoadingContainer},{[`& .${S.groupingCriteriaCellToggle}`]:t.groupingCriteriaCellToggle},{[`& .${S.headerFilterRow}`]:t.headerFilterRow},{[`& .${S.iconSeparator}`]:t.iconSeparator},{[`& .${S.menuIcon}`]:t.menuIcon},{[`& .${S.menuIconButton}`]:t.menuIconButton},{[`& .${S.menuList}`]:t.menuList},{[`& .${S.menuOpen}`]:t.menuOpen},{[`& .${S.overlayWrapperInner}`]:t.overlayWrapperInner},{[`& .${S.pinnedRows}`]:t.pinnedRows},{[`& .${S["pinnedRows--bottom"]}`]:t["pinnedRows--bottom"]},{[`& .${S["pinnedRows--top"]}`]:t["pinnedRows--top"]},{[`& .${S.row}`]:t.row},{[`& .${S["row--borderBottom"]}`]:t["row--borderBottom"]},{[`& .${S["row--detailPanelExpanded"]}`]:t["row--detailPanelExpanded"]},{[`& .${S["row--dragging"]}`]:t["row--dragging"]},{[`& .${S["row--dynamicHeight"]}`]:t["row--dynamicHeight"]},{[`& .${S["row--editable"]}`]:t["row--editable"]},{[`& .${S["row--editing"]}`]:t["row--editing"]},{[`& .${S["row--firstVisible"]}`]:t["row--firstVisible"]},{[`& .${S["row--lastVisible"]}`]:t["row--lastVisible"]},{[`& .${S.rowReorderCell}`]:t.rowReorderCell},{[`& .${S["rowReorderCell--draggable"]}`]:t["rowReorderCell--draggable"]},{[`& .${S.rowReorderCellContainer}`]:t.rowReorderCellContainer},{[`& .${S.rowReorderCellPlaceholder}`]:t.rowReorderCellPlaceholder},{[`& .${S.rowSkeleton}`]:t.rowSkeleton},{[`& .${S.scrollbar}`]:t.scrollbar},{[`& .${S["scrollbar--horizontal"]}`]:t["scrollbar--horizontal"]},{[`& .${S["scrollbar--vertical"]}`]:t["scrollbar--vertical"]},{[`& .${S.scrollbarFiller}`]:t.scrollbarFiller},{[`& .${S["scrollbarFiller--borderBottom"]}`]:t["scrollbarFiller--borderBottom"]},{[`& .${S["scrollbarFiller--borderTop"]}`]:t["scrollbarFiller--borderTop"]},{[`& .${S["scrollbarFiller--header"]}`]:t["scrollbarFiller--header"]},{[`& .${S["scrollbarFiller--pinnedRight"]}`]:t["scrollbarFiller--pinnedRight"]},{[`& .${S.sortIcon}`]:t.sortIcon},{[`& .${S.treeDataGroupingCell}`]:t.treeDataGroupingCell},{[`& .${S.treeDataGroupingCellLoadingContainer}`]:t.treeDataGroupingCellLoadingContainer},{[`& .${S.treeDataGroupingCellToggle}`]:t.treeDataGroupingCellToggle},{[`& .${S.withBorderColor}`]:t.withBorderColor}]})(({theme:e})=>{var L,P;const t=st(),n=K(t,qf),o=Wf(e),r=e.shape.borderRadius,l=e.vars?e.vars.palette.background.default:((L=e.mixins.MuiDataGrid)==null?void 0:L.containerBackground)??e.palette.background.default,s=((P=e.mixins.MuiDataGrid)==null?void 0:P.pinnedBackground)??l,a=e.vars?`rgba(${e.vars.palette.background.defaultChannel} / ${e.vars.palette.action.disabledOpacity})`:Nt(e.palette.background.default,e.palette.action.disabledOpacity),i=(e.vars||e).palette.action.hoverOpacity,d=(e.vars||e).palette.action.hover,u=(e.vars||e).palette.action.selectedOpacity,g=e.vars?`calc(${i} + ${u})`:i+u,f=e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${u})`:Nt(e.palette.primary.main,u),x=e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${g})`:Nt(e.palette.primary.main,g),I=e.vars?Zf:Yf,y=D=>({[`& .${S["cell--pinnedLeft"]}, & .${S["cell--pinnedRight"]}`]:{backgroundColor:D,"&.Mui-selected":{backgroundColor:I(D,f,u),"&:hover":{backgroundColor:I(D,f,g)}}}}),w=I(s,d,i),m=y(w),p=I(s,f,u),E=y(p),R=I(s,x,g),H=y(R),V={backgroundColor:f,"&:hover":{backgroundColor:x,"@media (hover: none)":{backgroundColor:f}}};return h({"--unstable_DataGrid-radius":typeof r=="number"?`${r}px`:r,"--unstable_DataGrid-headWeight":e.typography.fontWeightMedium,"--unstable_DataGrid-overlayBackground":a,"--DataGrid-containerBackground":l,"--DataGrid-pinnedBackground":s,"--DataGrid-rowBorderColor":o,"--DataGrid-cellOffsetMultiplier":2,"--DataGrid-width":"0px","--DataGrid-hasScrollX":"0","--DataGrid-hasScrollY":"0","--DataGrid-scrollbarSize":"10px","--DataGrid-rowWidth":"0px","--DataGrid-columnsTotalWidth":"0px","--DataGrid-leftPinnedWidth":"0px","--DataGrid-rightPinnedWidth":"0px","--DataGrid-headerHeight":"0px","--DataGrid-headersTotalHeight":"0px","--DataGrid-topContainerHeight":"0px","--DataGrid-bottomContainerHeight":"0px",flex:1,boxSizing:"border-box",position:"relative",borderWidth:"1px",borderStyle:"solid",borderColor:o,borderRadius:"var(--unstable_DataGrid-radius)",color:(e.vars||e).palette.text.primary},e.typography.body2,{outline:"none",height:"100%",display:"flex",minWidth:0,minHeight:0,flexDirection:"column",overflow:"hidden",overflowAnchor:"none",[`.${S.main} > *:first-child${Kf}`]:{borderTopLeftRadius:"var(--unstable_DataGrid-radius)",borderTopRightRadius:"var(--unstable_DataGrid-radius)"},[`&.${S.autoHeight}`]:{height:"auto"},[`&.${S.autosizing}`]:{[`& .${S.columnHeaderTitleContainerContent} > *`]:{overflow:"visible !important"},"@media (hover: hover)":{[`& .${S.menuIcon}`]:{width:"0 !important",visibility:"hidden !important"}},[`& .${S.cell}`]:{overflow:"visible !important",whiteSpace:"nowrap",minWidth:"max-content !important",maxWidth:"max-content !important"},[`& .${S.groupingCriteriaCell}`]:{width:"unset"},[`& .${S.treeDataGroupingCell}`]:{width:"unset"}},[`& .${S.columnHeader}, & .${S.cell}`]:{WebkitTapHighlightColor:"transparent",padding:"0 10px",boxSizing:"border-box"},[`& .${S.columnHeader}:focus-within, & .${S.cell}:focus-within`]:{outline:`solid ${e.vars?`rgba(${e.vars.palette.primary.mainChannel} / 0.5)`:Nt(e.palette.primary.main,.5)} ${Yt}px`,outlineOffset:Yt*-1},[`& .${S.columnHeader}:focus, & .${S.cell}:focus`]:{outline:`solid ${e.palette.primary.main} ${Yt}px`,outlineOffset:Yt*-1},[`& .${S.columnHeader}:focus,
      & .${S["columnHeader--withLeftBorder"]},
      & .${S["columnHeader--withRightBorder"]},
      & .${S["columnHeader--siblingFocused"]},
      & .${S["virtualScroller--hasScrollX"]} .${S["columnHeader--lastUnpinned"]},
      & .${S["virtualScroller--hasScrollX"]} .${S["columnHeader--last"]}
      `]:{[`& .${S.columnSeparator}`]:{opacity:0},"@media (hover: none)":{[`& .${S["columnSeparator--resizable"]}`]:{opacity:1}},[`& .${S["columnSeparator--resizable"]}:hover`]:{opacity:1}},[`&.${S["root--noToolbar"]} [aria-rowindex="1"] [aria-colindex="1"]`]:{borderTopLeftRadius:"calc(var(--unstable_DataGrid-radius) - 1px)"},[`&.${S["root--noToolbar"]} [aria-rowindex="1"] .${S["columnHeader--last"]}`]:{borderTopRightRadius:n?"calc(var(--unstable_DataGrid-radius) - 1px)":void 0},[`& .${S.columnHeaderCheckbox}, & .${S.cellCheckbox}`]:{padding:0,justifyContent:"center",alignItems:"center"},[`& .${S.columnHeader}`]:{position:"relative",display:"flex",alignItems:"center"},[`& .${S["virtualScroller--hasScrollX"]} .${S["columnHeader--last"]}`]:{overflow:"hidden"},[`& .${S["columnHeader--sorted"]} .${S.iconButtonContainer}, & .${S["columnHeader--filtered"]} .${S.iconButtonContainer}`]:{visibility:"visible",width:"auto"},[`& .${S.columnHeader}:not(.${S["columnHeader--sorted"]}) .${S.sortIcon}`]:{opacity:0,transition:e.transitions.create(["opacity"],{duration:e.transitions.duration.shorter})},[`& .${S.columnHeaderTitleContainer}`]:{display:"flex",alignItems:"center",gap:e.spacing(.25),minWidth:0,flex:1,whiteSpace:"nowrap",overflow:"hidden"},[`& .${S.columnHeaderTitleContainerContent}`]:{overflow:"hidden",display:"flex",alignItems:"center"},[`& .${S["columnHeader--filledGroup"]} .${S.columnHeaderTitleContainer}`]:{borderBottomWidth:"1px",borderBottomStyle:"solid",boxSizing:"border-box"},[`& .${S.sortIcon}, & .${S.filterIcon}`]:{fontSize:"inherit"},[`& .${S["columnHeader--sortable"]}`]:{cursor:"pointer"},[`& .${S["columnHeader--alignCenter"]} .${S.columnHeaderTitleContainer}`]:{justifyContent:"center"},[`& .${S["columnHeader--alignRight"]} .${S.columnHeaderDraggableContainer}, & .${S["columnHeader--alignRight"]} .${S.columnHeaderTitleContainer}`]:{flexDirection:"row-reverse"},[`& .${S["columnHeader--alignCenter"]} .${S.menuIcon}`]:{marginLeft:"auto"},[`& .${S["columnHeader--alignRight"]} .${S.menuIcon}`]:{marginRight:"auto",marginLeft:-5},[`& .${S["columnHeader--moving"]}`]:{backgroundColor:(e.vars||e).palette.action.hover},[`& .${S["columnHeader--pinnedLeft"]}, & .${S["columnHeader--pinnedRight"]}`]:{position:"sticky",zIndex:4,background:"var(--DataGrid-pinnedBackground)"},[`& .${S.columnSeparator}`]:{position:"absolute",overflow:"hidden",zIndex:3,display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",maxWidth:Uf,color:o},[`& .${S.columnHeaders}`]:{width:"var(--DataGrid-rowWidth)"},"@media (hover: hover)":{[`& .${S.columnHeader}:hover`]:Ml,[`& .${S.columnHeader}:not(.${S["columnHeader--sorted"]}):hover .${S.sortIcon}`]:{opacity:.5}},"@media (hover: none)":{[`& .${S.columnHeader}`]:Ml,[`& .${S.columnHeader}:focus,
        & .${S["columnHeader--siblingFocused"]}`]:{[`.${S["columnSeparator--resizable"]}`]:{color:(e.vars||e).palette.primary.main}}},[`& .${S["columnSeparator--sideLeft"]}`]:{left:to},[`& .${S["columnSeparator--sideRight"]}`]:{right:to},[`& .${S["columnHeader--withRightBorder"]} .${S["columnSeparator--sideLeft"]}`]:{left:to-.5},[`& .${S["columnHeader--withRightBorder"]} .${S["columnSeparator--sideRight"]}`]:{right:to-.5},[`& .${S["columnSeparator--resizable"]}`]:{cursor:"col-resize",touchAction:"none",[`&.${S["columnSeparator--resizing"]}`]:{color:(e.vars||e).palette.primary.main},"@media (hover: none)":{[`& .${S.iconSeparator} rect`]:kl},"@media (hover: hover)":{"&:hover":{color:(e.vars||e).palette.primary.main,[`& .${S.iconSeparator} rect`]:kl}},"& svg":{pointerEvents:"none"}},[`& .${S.iconSeparator}`]:{color:"inherit",transition:e.transitions.create(["color","width"],{duration:e.transitions.duration.shortest})},[`& .${S.menuIcon}`]:{width:0,visibility:"hidden",fontSize:20,marginRight:-5,display:"flex",alignItems:"center"},[`.${S.menuOpen}`]:{visibility:"visible",width:"auto"},[`& .${S.headerFilterRow}`]:{[`& .${S.columnHeader}`]:{boxSizing:"border-box",borderBottom:"1px solid var(--DataGrid-rowBorderColor)"}},[`& .${S["row--borderBottom"]} .${S.columnHeader},
      & .${S["row--borderBottom"]} .${S.filler},
      & .${S["row--borderBottom"]} .${S.scrollbarFiller}`]:{borderBottom:"1px solid var(--DataGrid-rowBorderColor)"},[`& .${S["row--borderBottom"]} .${S.cell}`]:{borderBottom:"1px solid var(--rowBorderColor)"},[`.${S.row}`]:{display:"flex",width:"var(--DataGrid-rowWidth)",breakInside:"avoid","--rowBorderColor":"var(--DataGrid-rowBorderColor)",[`&.${S["row--firstVisible"]}`]:{"--rowBorderColor":"transparent"},"&:hover":{backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${S.rowSkeleton}:hover`]:{backgroundColor:"transparent"},"&.Mui-selected":V},[`& .${S["container--top"]}, & .${S["container--bottom"]}`]:{"[role=row]":{background:"var(--DataGrid-containerBackground)"}},[`& .${S.cell}`]:{flex:"0 0 auto",height:"var(--height)",width:"var(--width)",lineHeight:"calc(var(--height) - 1px)",boxSizing:"border-box",borderTop:"1px solid var(--rowBorderColor)",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis","&.Mui-selected":V},[`& .${S["virtualScrollerContent--overflowed"]} .${S["row--lastVisible"]} .${S.cell}`]:{borderTopColor:"transparent"},[`& .${S["pinnedRows--top"]} :first-of-type`]:{[`& .${S.cell}, .${S.scrollbarFiller}`]:{borderTop:"none"}},[`&.${S["root--disableUserSelection"]} .${S.cell}`]:{userSelect:"none"},[`& .${S["row--dynamicHeight"]} > .${S.cell}`]:{whiteSpace:"initial",lineHeight:"inherit"},[`& .${S.cellEmpty}`]:{flex:1,padding:0,height:"unset"},[`& .${S.cell}.${S["cell--selectionMode"]}`]:{cursor:"default"},[`& .${S.cell}.${S["cell--editing"]}`]:{padding:1,display:"flex",boxShadow:e.shadows[2],backgroundColor:(e.vars||e).palette.background.paper,"&:focus-within":{outline:`${Yt}px solid ${(e.vars||e).palette.primary.main}`,outlineOffset:Yt*-1}},[`& .${S["row--editing"]}`]:{boxShadow:e.shadows[2]},[`& .${S["row--editing"]} .${S.cell}`]:{boxShadow:e.shadows[0],backgroundColor:(e.vars||e).palette.background.paper},[`& .${S.editBooleanCell}`]:{display:"flex",height:"100%",width:"100%",alignItems:"center",justifyContent:"center"},[`& .${S.booleanCell}[data-value="true"]`]:{color:(e.vars||e).palette.text.secondary},[`& .${S.booleanCell}[data-value="false"]`]:{color:(e.vars||e).palette.text.disabled},[`& .${S.actionsCell}`]:{display:"inline-flex",alignItems:"center",gridGap:e.spacing(1)},[`& .${S.rowReorderCell}`]:{display:"inline-flex",flex:1,alignItems:"center",justifyContent:"center",opacity:(e.vars||e).palette.action.disabledOpacity},[`& .${S["rowReorderCell--draggable"]}`]:{cursor:"move",opacity:1},[`& .${S.rowReorderCellContainer}`]:{padding:0,display:"flex",alignItems:"stretch"},[`.${S.withBorderColor}`]:{borderColor:o},[`& .${S["cell--withLeftBorder"]}, & .${S["columnHeader--withLeftBorder"]}`]:{borderLeftColor:"var(--DataGrid-rowBorderColor)",borderLeftWidth:"1px",borderLeftStyle:"solid"},[`& .${S["cell--withRightBorder"]}, & .${S["columnHeader--withRightBorder"]}`]:{borderRightColor:"var(--DataGrid-rowBorderColor)",borderRightWidth:"1px",borderRightStyle:"solid"},[`& .${S["cell--flex"]}`]:{display:"flex",alignItems:"center",lineHeight:"inherit"},[`& .${S["cell--textLeft"]}`]:{textAlign:"left",justifyContent:"flex-start"},[`& .${S["cell--textRight"]}`]:{textAlign:"right",justifyContent:"flex-end"},[`& .${S["cell--textCenter"]}`]:{textAlign:"center",justifyContent:"center"},[`& .${S["cell--pinnedLeft"]}, & .${S["cell--pinnedRight"]}`]:{position:"sticky",zIndex:3,background:"var(--DataGrid-pinnedBackground)","&.Mui-selected":{backgroundColor:p}},[`& .${S.virtualScrollerContent} .${S.row}`]:{"&:hover":m,"&.Mui-selected":E,"&.Mui-selected:hover":H},[`& .${S.cellOffsetLeft}`]:{flex:"0 0 auto",display:"inline-block"},[`& .${S.cellSkeleton}`]:{flex:"0 0 auto",height:"100%",display:"inline-flex",alignItems:"center"},[`& .${S.columnHeaderDraggableContainer}`]:{display:"flex",width:"100%",height:"100%"},[`& .${S.rowReorderCellPlaceholder}`]:{display:"none"},[`& .${S["columnHeader--dragging"]}, & .${S["row--dragging"]}`]:{background:(e.vars||e).palette.background.paper,padding:"0 12px",borderRadius:"var(--unstable_DataGrid-radius)",opacity:(e.vars||e).palette.action.disabledOpacity},[`& .${S["row--dragging"]}`]:{background:(e.vars||e).palette.background.paper,padding:"0 12px",borderRadius:"var(--unstable_DataGrid-radius)",opacity:(e.vars||e).palette.action.disabledOpacity,[`& .${S.rowReorderCellPlaceholder}`]:{display:"flex"}},[`& .${S.treeDataGroupingCell}`]:{display:"flex",alignItems:"center",width:"100%"},[`& .${S.treeDataGroupingCellToggle}`]:{flex:"0 0 28px",alignSelf:"stretch",marginRight:e.spacing(2)},[`& .${S.treeDataGroupingCellLoadingContainer}, .${S.groupingCriteriaCellLoadingContainer}`]:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%"},[`& .${S.groupingCriteriaCell}`]:{display:"flex",alignItems:"center",width:"100%"},[`& .${S.groupingCriteriaCellToggle}`]:{flex:"0 0 28px",alignSelf:"stretch",marginRight:e.spacing(2)},[`.${S.scrollbarFiller}`]:{minWidth:"calc(var(--DataGrid-hasScrollY) * var(--DataGrid-scrollbarSize))",alignSelf:"stretch",[`&.${S["scrollbarFiller--borderTop"]}`]:{borderTop:"1px solid var(--DataGrid-rowBorderColor)"},[`&.${S["scrollbarFiller--borderBottom"]}`]:{borderBottom:"1px solid var(--DataGrid-rowBorderColor)"},[`&.${S["scrollbarFiller--pinnedRight"]}`]:{backgroundColor:"var(--DataGrid-pinnedBackground)",position:"sticky",right:0}},[`& .${S.filler}`]:{flex:"1 0 auto"},[`& .${S["filler--borderBottom"]}`]:{borderBottom:"1px solid var(--DataGrid-rowBorderColor)"},[`& .${S["main--hasSkeletonLoadingOverlay"]}`]:{[`& .${S.virtualScrollerContent}`]:{position:"fixed",visibility:"hidden"},[`& .${S["scrollbar--vertical"]}, & .${S.pinnedRows}, & .${S.virtualScroller} > .${S.filler}`]:{display:"none"}}})});function Yf(e,t,n,o=1){const r=(i,d)=>Math.round((i**(1/o)*(1-n)+d**(1/o)*n)**o),l=jr(e),s=jr(t),a=[r(l.values[0],s.values[0]),r(l.values[1],s.values[1]),r(l.values[2],s.values[2])];return Dc({type:"rgb",values:a})}const Qf=e=>`rgb(from ${e} r g b / 1)`;function Zf(e,t,n){return`color-mix(in srgb,${e}, ${Qf(t)} calc(${n} * 100%))`}const Jf=()=>()=>{},eh=()=>!1,th=()=>!0,nh=()=>sr.useSyncExternalStore(Jf,eh,th);function oh(){var l,s;const e=he(),t=K(e,Ct),n=ne(),o=K(e,Rn),r=e.current.unstable_applyPipeProcessors("preferencePanel",null,o.openedPanelValue??Bt.filters);return v.jsx(n.slots.panel,h({as:n.slots.basePopper,open:t.length>0&&o.open,id:o.panelId,"aria-labelledby":o.labelId},(l=n.slotProps)==null?void 0:l.panel,(s=n.slotProps)==null?void 0:s.basePopper,{children:r}))}function rh(){var t;const e=ne();return v.jsxs(c.Fragment,{children:[v.jsx(oh,{}),e.slots.toolbar&&v.jsx(e.slots.toolbar,h({},(t=e.slotProps)==null?void 0:t.toolbar))]})}const lh=["className","children"],sh=(e,t)=>{const{autoHeight:n,classes:o,showCellVerticalBorder:r}=e,l={root:["root",n&&"autoHeight",`root--density${zn(t)}`,e.slots.toolbar===null&&"root--noToolbar","withBorderColor",r&&"withVerticalBorder"]};return fe(l,pe,o)},ih=Ie(function(t,n){const o=ne(),{className:r,children:l}=t,s=re(t,lh),a=st(),i=K(a,en),d=a.current.rootElementRef,u=c.useCallback(y=>{y!==null&&a.current.publishEvent("rootMount",y)},[a]),g=wt(d,n,u),f=o,x=sh(f,i);return nh()?null:v.jsxs(Xf,h({className:ve(x.root,r),ownerState:f},s,{ref:g,children:[v.jsx(rh,{}),v.jsx(Pf,{children:l}),v.jsx(Mf,{})]}))}),ch=Ft(ih),ah=["className"],uh=e=>{const{classes:t}=e;return fe({root:["footerContainer","withBorderColor"]},pe,t)},dh=He("div",{name:"MuiDataGrid",slot:"FooterContainer",overridesResolver:(e,t)=>t.footerContainer})({display:"flex",justifyContent:"space-between",alignItems:"center",minHeight:52,borderTop:"1px solid"}),gh=Ie(function(t,n){const{className:o}=t,r=re(t,ah),l=ne(),s=uh(l);return v.jsx(dh,h({className:ve(s.root,o),ownerState:l},r,{ref:n}))}),fh=["className"],hh=e=>{const{classes:t}=e;return fe({root:["overlay"]},pe,t)},mh=He("div",{name:"MuiDataGrid",slot:"Overlay",overridesResolver:(e,t)=>t.overlay})({width:"100%",height:"100%",display:"flex",alignSelf:"center",alignItems:"center",justifyContent:"center",backgroundColor:"var(--unstable_DataGrid-overlayBackground)"}),Er=Ie(function(t,n){const{className:o}=t,r=re(t,fh),l=ne(),s=hh(l);return v.jsx(mh,h({className:ve(s.root,o),ownerState:l},r,{ref:n}))}),bh=e=>{const{classes:t,open:n}=e;return fe({root:["menuIcon",n&&"menuOpen"],button:["menuIconButton"]},pe,t)},Ch=c.memo(e=>{var g,f;const{colDef:t,open:n,columnMenuId:o,columnMenuButtonId:r,iconButtonRef:l}=e,s=he(),a=ne(),i=h({},e,{classes:a.classes}),d=bh(i),u=c.useCallback(x=>{x.preventDefault(),x.stopPropagation(),s.current.toggleColumnMenu(t.field)},[s,t.field]);return v.jsx("div",{className:d.root,children:v.jsx(a.slots.baseTooltip,h({title:s.current.getLocaleText("columnMenuLabel"),enterDelay:1e3},(g=a.slotProps)==null?void 0:g.baseTooltip,{children:v.jsx(a.slots.baseIconButton,h({ref:l,tabIndex:-1,className:d.button,"aria-label":s.current.getLocaleText("columnMenuLabel"),size:"small",onClick:u,"aria-haspopup":"menu","aria-expanded":n,"aria-controls":n?o:void 0,id:r},(f=a.slotProps)==null?void 0:f.baseIconButton,{children:v.jsx(a.slots.columnMenuIcon,{fontSize:"inherit"})}))}))})});function ph({columnMenuId:e,columnMenuButtonId:t,ContentComponent:n,contentComponentProps:o,field:r,open:l,target:s,onExited:a}){const i=he(),d=i.current.getColumn(r),u=ze(g=>{g&&(g.stopPropagation(),s!=null&&s.contains(g.target))||i.current.hideColumnMenu()});return!s||!d?null:v.jsx(mr,{placement:`bottom-${d.align==="right"?"start":"end"}`,open:l,target:s,onClose:u,onExited:a,children:v.jsx(n,h({colDef:d,hideMenu:u,open:l,id:e,labelledby:t},o))})}function wh(e){return e.scrollHeight>e.clientHeight||e.scrollWidth>e.clientWidth}function bo(e,t){return e.closest(`.${t}`)}function Ht(e){return e.replace(/["\\]/g,"\\$&")}function Sh(e,t){return e.querySelector(`[role="columnheader"][data-field="${Ht(t)}"]`)}function Hi(e){return`.${S.row}[data-id="${Ht(String(e))}"]`}function xh(e,t){return e.querySelector(Hi(t))}function vh(e,{id:t,field:n}){const o=Hi(t),r=`.${S.cell}[data-field="${Ht(n)}"]`,l=`${o} ${r}`;return e.querySelector(l)}function Kn(e){return e.target.nodeType===1&&!e.currentTarget.contains(e.target)}function yh(e){return e.getAttribute("data-field")}function Ih(e,t){return e.querySelector(`[data-field="${Ht(t)}"]`)}function Ph(e){return e.getAttribute("data-fields").slice(2,-2).split("-|-")}function Mh(e,t){return Array.from(e.querySelectorAll(`[data-fields*="|-${Ht(t)}-|"]`)??[])}function kh(e,t){var s;if(!bo(e,S.root))throw new Error("MUI X: The root element is not found.");const o=e.getAttribute("aria-colindex");if(!o)return[];const r=Number(o)-1,l=[];return(s=t.virtualScrollerRef)!=null&&s.current?(Li(t).forEach(a=>{const i=a.getAttribute("data-id");if(!i)return;let d=r;const u=t.unstable_getCellColSpanInfo(i,r);u&&u.spannedByColSpan&&(d=u.leftVisibleCellIndex);const g=a.querySelector(`[data-colindex="${d}"]`);g&&l.push(g)}),l):[]}function El(e,t){return e.rootElementRef.current.querySelector(`.${S[t]}`)}const Di=({api:e,colIndex:t,position:n,filterFn:o})=>{if(t===null)return[];const r=[];return Li(e).forEach(l=>{l.getAttribute("data-id")&&l.querySelectorAll(`.${S[n==="left"?"cell--pinnedLeft":"cell--pinnedRight"]}`).forEach(a=>{const i=xn(a);i!==null&&o(i)&&r.push(a)})}),r};function Eh(e,t,n){const o=xn(t);return Di({api:e,colIndex:o,position:n?"right":"left",filterFn:r=>n?r<o:r>o})}function Fh(e,t,n){const o=xn(t);return Di({api:e,colIndex:o,position:n?"left":"right",filterFn:r=>n?r>o:r<o})}const Oi=({api:e,colIndex:t,position:n,filterFn:o})=>{var l;if(!((l=e.columnHeadersContainerRef)!=null&&l.current))return[];if(t===null)return[];const r=[];return e.columnHeadersContainerRef.current.querySelectorAll(`.${S[n==="left"?"columnHeader--pinnedLeft":"columnHeader--pinnedRight"]}`).forEach(s=>{const a=xn(s);a!==null&&o(a,s)&&r.push(s)}),r};function Th(e,t,n){const o=xn(t);return Oi({api:e,position:n?"right":"left",colIndex:o,filterFn:r=>n?r<o:r>o})}function Hh(e,t,n){const o=xn(t);return Oi({api:e,position:n?"left":"right",colIndex:o,filterFn:(r,l)=>l.classList.contains(S["columnHeader--last"])?!1:n?r>o:r<o})}function Dh(e,t){return e.columnHeadersContainerRef.current.querySelector(`:scope > div > [data-field="${Ht(t)}"][role="columnheader"]`)}function Oh(e,t){const n=e.virtualScrollerRef.current;return Array.from(n.querySelectorAll(`:scope > div > div > div > [data-field="${Ht(t)}"][role="gridcell"]`))}function Li(e){return e.virtualScrollerRef.current.querySelectorAll(`:scope > div > div > .${S.row}`)}function xn(e){const t=e.getAttribute("aria-colindex");return t?Number(t)-1:null}const Lh=["className","aria-label"],Gh=e=>{const{classes:t}=e;return fe({root:["columnHeaderTitle"]},pe,t)},Rh=He("div",{name:"MuiDataGrid",slot:"ColumnHeaderTitle",overridesResolver:(e,t)=>t.columnHeaderTitle})({textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap",fontWeight:"var(--unstable_DataGrid-headWeight)",lineHeight:"normal"}),$h=Ie(function(t,n){const{className:o}=t,r=re(t,Lh),l=ne(),s=Gh(l);return v.jsx(Rh,h({className:ve(s.root,o),ownerState:l},r,{ref:n}))});function zh(e){var i;const{label:t,description:n}=e,o=ne(),r=c.useRef(null),[l,s]=c.useState(""),a=c.useCallback(()=>{if(!n&&(r!=null&&r.current)){const d=wh(r.current);s(d?t:"")}},[n,t]);return v.jsx(o.slots.baseTooltip,h({title:n||l},(i=o.slotProps)==null?void 0:i.baseTooltip,{children:v.jsx($h,{onMouseOver:a,ref:r,children:t})}))}const Vh=["resizable","resizing","height","side"];var Fr=function(e){return e.Left="left",e.Right="right",e}(Fr||{});const Ah=e=>{const{resizable:t,resizing:n,classes:o,side:r}=e,l={root:["columnSeparator",t&&"columnSeparator--resizable",n&&"columnSeparator--resizing",r&&`columnSeparator--side${zn(r)}`],icon:["iconSeparator"]};return fe(l,pe,o)};function Nh(e){const{height:t,side:n=Fr.Right}=e,o=re(e,Vh),r=ne(),l=h({},e,{side:n,classes:r.classes}),s=Ah(l),a=c.useCallback(i=>{i.preventDefault(),i.stopPropagation()},[]);return v.jsx("div",h({className:s.root,style:{minHeight:t}},o,{onClick:a,children:v.jsx(r.slots.columnResizeIcon,{className:s.icon})}))}const jh=c.memo(Nh),_h=["classes","columnMenuOpen","colIndex","height","isResizing","sortDirection","hasFocus","tabIndex","separatorSide","isDraggable","headerComponent","description","elementId","width","columnMenuIconButton","columnMenu","columnTitleIconButtons","headerClassName","label","resizable","draggableContainerProps","columnHeaderSeparatorProps","style"],Gi=Ie(function(t,n){const{classes:o,colIndex:r,height:l,isResizing:s,sortDirection:a,hasFocus:i,tabIndex:d,separatorSide:u,isDraggable:g,headerComponent:f,description:x,width:I,columnMenuIconButton:y=null,columnMenu:w=null,columnTitleIconButtons:m=null,headerClassName:p,label:E,resizable:R,draggableContainerProps:H,columnHeaderSeparatorProps:V,style:A}=t,L=re(t,_h),P=st(),D=ne(),z=c.useRef(null),F=wt(z,n);let T="none";return a!=null&&(T=a==="asc"?"ascending":"descending"),c.useLayoutEffect(()=>{var M;const G=P.current.state.columnMenu;if(i&&!G.open){const C=z.current.querySelector('[tabindex="0"]')||z.current;C==null||C.focus(),(M=P.current.columnHeadersContainerRef)!=null&&M.current&&(P.current.columnHeadersContainerRef.current.scrollLeft=0)}},[P,i]),v.jsxs("div",h({className:ve(o.root,p),style:h({},A,{height:l,width:I}),role:"columnheader",tabIndex:d,"aria-colindex":r+1,"aria-sort":T},L,{ref:F,children:[v.jsxs("div",h({className:o.draggableContainer,draggable:g,role:"presentation"},H,{children:[v.jsxs("div",{className:o.titleContainer,role:"presentation",children:[v.jsx("div",{className:o.titleContainerContent,children:f!==void 0?f:v.jsx(zh,{label:E,description:x,columnWidth:I})}),m]}),y]})),v.jsx(jh,h({resizable:!D.disableColumnResize&&!!R,resizing:s,height:l,side:u},V)),w]}))}),Bh=e=>{const{colDef:t,classes:n,isDragging:o,sortDirection:r,showRightBorder:l,showLeftBorder:s,filterItemsCounter:a,pinnedPosition:i,isLastUnpinned:d,isSiblingFocused:u}=e,g=r!=null,f=a!=null&&a>0,x=t.type==="number",I={root:["columnHeader",t.headerAlign==="left"&&"columnHeader--alignLeft",t.headerAlign==="center"&&"columnHeader--alignCenter",t.headerAlign==="right"&&"columnHeader--alignRight",t.sortable&&"columnHeader--sortable",o&&"columnHeader--moving",g&&"columnHeader--sorted",f&&"columnHeader--filtered",x&&"columnHeader--numeric","withBorderColor",l&&"columnHeader--withRightBorder",s&&"columnHeader--withLeftBorder",i===me.LEFT&&"columnHeader--pinnedLeft",i===me.RIGHT&&"columnHeader--pinnedRight",d&&"columnHeader--lastUnpinned",u&&"columnHeader--siblingFocused"],draggableContainer:["columnHeaderDraggableContainer"],titleContainer:["columnHeaderTitleContainer"],titleContainerContent:["columnHeaderTitleContainerContent"]};return fe(I,pe,n)};function Wh(e){var Q,Z,J;const{colDef:t,columnMenuOpen:n,colIndex:o,headerHeight:r,isResizing:l,isLast:s,sortDirection:a,sortIndex:i,filterItemsCounter:d,hasFocus:u,tabIndex:g,disableReorder:f,separatorSide:x,showLeftBorder:I,showRightBorder:y,pinnedPosition:w,pinnedOffset:m}=e,p=st(),E=ne(),R=It(),H=c.useRef(null),V=Ne(),A=Ne(),L=c.useRef(null),[P,D]=c.useState(n),z=c.useMemo(()=>!E.disableColumnReorder&&!f&&!t.disableReorder,[E.disableColumnReorder,f,t.disableReorder]);let F;t.renderHeader&&(F=t.renderHeader(p.current.getColumnHeaderParams(t.field)));const T=h({},e,{classes:E.classes,showRightBorder:y,showLeftBorder:I}),G=Bh(T),M=c.useCallback(te=>oe=>{Kn(oe)||p.current.publishEvent(te,p.current.getColumnHeaderParams(t.field),oe)},[p,t.field]),b=c.useMemo(()=>({onClick:M("columnHeaderClick"),onContextMenu:M("columnHeaderContextMenu"),onDoubleClick:M("columnHeaderDoubleClick"),onMouseOver:M("columnHeaderOver"),onMouseOut:M("columnHeaderOut"),onMouseEnter:M("columnHeaderEnter"),onMouseLeave:M("columnHeaderLeave"),onKeyDown:M("columnHeaderKeyDown"),onFocus:M("columnHeaderFocus"),onBlur:M("columnHeaderBlur")}),[M]),C=c.useMemo(()=>z?{onDragStart:M("columnHeaderDragStart"),onDragEnter:M("columnHeaderDragEnter"),onDragOver:M("columnHeaderDragOver"),onDragEnd:M("columnHeaderDragEnd")}:{},[z,M]),$=c.useMemo(()=>({onMouseDown:M("columnSeparatorMouseDown"),onDoubleClick:M("columnSeparatorDoubleClick")}),[M]);c.useEffect(()=>{P||D(n)},[P,n]);const k=c.useCallback(()=>{D(!1)},[]),O=!E.disableColumnMenu&&!t.disableColumnMenu&&v.jsx(Ch,{colDef:t,columnMenuId:V,columnMenuButtonId:A,open:P,iconButtonRef:L}),j=v.jsx(ph,{columnMenuId:V,columnMenuButtonId:A,field:t.field,open:n,target:L.current,ContentComponent:E.slots.columnMenu,contentComponentProps:(Q=E.slotProps)==null?void 0:Q.columnMenu,onExited:k}),N=t.sortingOrder??E.sortingOrder,_=(t.sortable||a!=null)&&!t.hideSortIcons&&!E.disableColumnSorting,U=v.jsxs(c.Fragment,{children:[!E.disableColumnFilter&&v.jsx(E.slots.columnHeaderFilterIconButton,h({field:t.field,counter:d},(Z=E.slotProps)==null?void 0:Z.columnHeaderFilterIconButton)),_&&v.jsx(E.slots.columnHeaderSortIcon,h({field:t.field,direction:a,index:i,sortingOrder:N,disabled:!t.sortable},(J=E.slotProps)==null?void 0:J.columnHeaderSortIcon))]});c.useLayoutEffect(()=>{var oe;const te=p.current.state.columnMenu;if(u&&!te.open){const ie=H.current.querySelector('[tabindex="0"]')||H.current;ie==null||ie.focus(),(oe=p.current.columnHeadersContainerRef)!=null&&oe.current&&(p.current.columnHeadersContainerRef.current.scrollLeft=0)}},[p,u]);const q=typeof t.headerClassName=="function"?t.headerClassName({field:t.field,colDef:t}):t.headerClassName,W=t.headerName??t.field,Y=c.useMemo(()=>Ho(h({},e.style),R,w,m),[w,m,e.style,R]);return v.jsx(Gi,h({ref:H,classes:G,columnMenuOpen:n,colIndex:o,height:r,isResizing:l,sortDirection:a,hasFocus:u,tabIndex:g,separatorSide:x,isDraggable:z,headerComponent:F,description:t.description,elementId:t.field,width:t.computedWidth,columnMenuIconButton:O,columnTitleIconButtons:U,headerClassName:ve(q,s&&S["columnHeader--last"]),label:W,resizable:!E.disableColumnResize&&!!t.resizable,"data-field":t.field,columnMenu:j,draggableContainerProps:C,columnHeaderSeparatorProps:$,style:Y},b))}const Uh=Ft(Wh),Kh=["className"],qh=e=>{const{classes:t}=e;return fe({root:["iconButtonContainer"]},pe,t)},Xh=He("div",{name:"MuiDataGrid",slot:"IconButtonContainer",overridesResolver:(e,t)=>t.iconButtonContainer})(()=>({display:"flex",visibility:"hidden",width:0})),Ri=Ie(function(t,n){const{className:o}=t,r=re(t,Kh),l=ne(),s=qh(l);return v.jsx(Xh,h({className:ve(s.root,o),ownerState:l},r,{ref:n}))}),Yh=["direction","index","sortingOrder","disabled"],Qh=e=>{const{classes:t}=e;return fe({icon:["sortIcon"]},pe,t)};function Zh(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?v.jsx(r,h({fontSize:"small",className:n},l)):null}function Jh(e){var f;const{direction:t,index:n,sortingOrder:o,disabled:r}=e,l=re(e,Yh),s=he(),a=ne(),i=h({},e,{classes:a.classes}),d=Qh(i),u=Zh(a.slots,t,d.icon,o);if(!u)return null;const g=v.jsx(a.slots.baseIconButton,h({tabIndex:-1,"aria-label":s.current.getLocaleText("columnHeaderSortIconLabel"),title:s.current.getLocaleText("columnHeaderSortIconLabel"),size:"small",disabled:r},(f=a.slotProps)==null?void 0:f.baseIconButton,l,{children:u}));return v.jsxs(Ri,{children:[n!=null&&v.jsx(a.slots.baseBadge,{badgeContent:n,color:"default",overlap:"circular",children:g}),n==null&&g]})}const em=c.memo(Jh),tm=e=>{const{classes:t}=e;return fe({icon:["filterIcon"]},pe,t)};function nm(e){return e.counter?v.jsx(om,h({},e)):null}function om(e){var x,I;const{counter:t,field:n,onClick:o}=e,r=he(),l=ne(),s=h({},e,{classes:l.classes}),a=tm(s),i=Ne(),d=On(r,pf,i),u=Ne(),g=c.useCallback(y=>{y.preventDefault(),y.stopPropagation();const{open:w,openedPanelValue:m}=Rn(r.current.state);w&&m===Bt.filters?r.current.hideFilterPanel():r.current.showFilterPanel(void 0,u,i),o&&o(r.current.getColumnHeaderParams(n),y)},[r,n,o,u,i]);if(!t)return null;const f=v.jsx(l.slots.baseIconButton,h({id:i,onClick:g,color:"default","aria-label":r.current.getLocaleText("columnHeaderFiltersLabel"),size:"small",tabIndex:-1,"aria-haspopup":"menu","aria-expanded":d,"aria-controls":d?u:void 0},(x=l.slotProps)==null?void 0:x.baseIconButton,{children:v.jsx(l.slots.columnFilteredIcon,{className:a.icon,fontSize:"small"})}));return v.jsx(l.slots.baseTooltip,h({title:r.current.getLocaleText("columnHeaderFiltersTooltipActive")(t),enterDelay:1e3},(I=l.slotProps)==null?void 0:I.baseTooltip,{children:v.jsxs(Ri,{children:[t>1&&v.jsx(l.slots.baseBadge,{badgeContent:t,color:"default",children:f}),t===1&&f]})}))}const Fl=De(v.jsx("path",{d:"M4 12l1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8-8 8z"}),"ArrowUpward"),Tl=De(v.jsx("path",{d:"M20 12l-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z"}),"ArrowDownward"),Hl=De(v.jsx("path",{d:"M8.59 16.59 13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"}),"KeyboardArrowRight"),Dl=De(v.jsx("path",{d:"M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z"}),"ExpandMore"),rm=De(v.jsx("path",{d:"M10 18h4v-2h-4v2zM3 6v2h18V6H3zm3 7h12v-2H6v2z"}),"FilterList"),Ol=De(v.jsx("path",{d:"M4.25 5.61C6.27 8.2 10 13 10 13v6c0 .55.45 1 1 1h2c.55 0 1-.45 1-1v-6s3.72-4.8 5.74-7.39c.51-.66.04-1.61-.79-1.61H5.04c-.83 0-1.3.95-.79 1.61z"}),"FilterAlt"),lm=De(v.jsx("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"}),"Search");De(v.jsx("path",{d:"M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z"}),"Menu");De(v.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"}),"CheckCircle");const sm=De(v.jsx("path",{d:"M6 5H3c-.55 0-1 .45-1 1v12c0 .55.45 1 1 1h3c.55 0 1-.45 1-1V6c0-.55-.45-1-1-1zm14 0h-3c-.55 0-1 .45-1 1v12c0 .55.45 1 1 1h3c.55 0 1-.45 1-1V6c0-.55-.45-1-1-1zm-7 0h-3c-.55 0-1 .45-1 1v12c0 .55.45 1 1 1h3c.55 0 1-.45 1-1V6c0-.55-.45-1-1-1z"}),"ColumnIcon"),im=De(v.jsx("rect",{width:"1",height:"24",x:"11.5",rx:"0.5"}),"Separator"),cm=De(v.jsx("path",{d:"M4 15h16v-2H4v2zm0 4h16v-2H4v2zm0-8h16V9H4v2zm0-6v2h16V5H4z"}),"ViewHeadline"),am=De(v.jsx("path",{d:"M21,8H3V4h18V8z M21,10H3v4h18V10z M21,16H3v4h18V16z"}),"TableRows"),um=De(v.jsx("path",{d:"M4 18h17v-6H4v6zM4 5v6h17V5H4z"}),"ViewStream"),dm=De(v.jsx("path",{d:"M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"}),"TripleDotsVertical"),_o=De(v.jsx("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close"),Ll=De(v.jsx("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"}),"Add"),gm=De(v.jsx("path",{d:"M19 13H5v-2h14v2z"}),"Remove"),fm=De(v.jsx("path",{d:"M12 4V1L8 5l4 4V6c3.31 0 6 2.69 6 6 0 1.01-.25 1.97-.7 2.8l1.46 1.46C19.54 15.03 20 13.57 20 12c0-4.42-3.58-8-8-8zm0 14c-3.31 0-6-2.69-6-6 0-1.01.25-1.97.7-2.8L5.24 7.74C4.46 8.97 4 10.43 4 12c0 4.42 3.58 8 8 8v3l4-4-4-4v3z"}),"Load"),Gl=De(v.jsx("path",{d:"M11 18c0 1.1-.9 2-2 2s-2-.9-2-2 .9-2 2-2 2 .9 2 2zm-2-8c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0-6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm6 4c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"}),"Drag"),hm=De(v.jsx("path",{d:"M19 12v7H5v-7H3v7c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-7h-2zm-6 .67l2.59-2.58L17 11.5l-5 5-5-5 1.41-1.41L11 12.67V3h2z"}),"SaveAlt"),mm=De(v.jsx("path",{d:"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"}),"Check"),bm=De(v.jsx("path",{d:"M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"}),"MoreVert"),Cm=De(v.jsx("path",{d:"M12 7c2.76 0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4 0-2.74.25-3.98.7l2.16 2.16C10.74 7.13 11.35 7 12 7zM2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3 2 4.27zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65 0 1.66 1.34 3 3 3 .22 0 .44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76 0-5-2.24-5-5 0-.79.2-1.53.53-2.2zm4.31-.78l3.15 3.15.02-.16c0-1.66-1.34-3-3-3l-.17.01z"}),"VisibilityOff"),pm=De(v.jsx("g",{children:v.jsx("path",{d:"M14.67,5v14H9.33V5H14.67z M15.67,19H21V5h-5.33V19z M8.33,19V5H3v14H8.33z"})}),"ViewColumn"),wm=De(v.jsx("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Clear");De(v.jsx("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z"}),"Delete");const Sm=De(v.jsx("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zm2.46-7.12l1.41-1.41L12 12.59l2.12-2.12 1.41 1.41L13.41 14l2.12 2.12-1.41 1.41L12 15.41l-2.12 2.12-1.41-1.41L10.59 14l-2.13-2.12zM15.5 4l-1-1h-5l-1 1H5v2h14V4z"}),"Delete");function $i(e){return e.key.length===1&&!e.ctrlKey&&!e.metaKey}const Co=e=>e.indexOf("Arrow")===0||e.indexOf("Page")===0||e===" "||e==="Home"||e==="End",xm=e=>!!e.key,zi=e=>e==="Tab"||e==="Escape";function Vi(e){return(e.ctrlKey||e.metaKey)&&String.fromCharCode(e.keyCode)==="V"&&!e.shiftKey&&!e.altKey}function vm(e){return(e.ctrlKey||e.metaKey)&&String.fromCharCode(e.keyCode)==="C"&&!e.shiftKey&&!e.altKey}const ym=["hideMenu","colDef","id","labelledby","className","children","open"],Im=Ve(cr)(()=>({minWidth:248})),Pm=Ie(function(t,n){const{hideMenu:o,id:r,labelledby:l,className:s,children:a,open:i}=t,d=re(t,ym),u=c.useCallback(g=>{g.key==="Tab"&&g.preventDefault(),zi(g.key)&&o(g)},[o]);return v.jsx(Im,h({id:r,className:ve(S.menuList,s),"aria-labelledby":l,onKeyDown:u,autoFocus:i},d,{ref:n,children:a}))}),Mm=["displayOrder"],km=e=>{const t=st(),n=ne(),{defaultSlots:o,defaultSlotProps:r,slots:l={},slotProps:s={},hideMenu:a,colDef:i,addDividers:d=!0}=e,u=c.useMemo(()=>h({},o,l),[o,l]),g=c.useMemo(()=>{if(!s||Object.keys(s).length===0)return r;const I=h({},s);return Object.entries(r).forEach(([y,w])=>{I[y]=h({},w,s[y]||{})}),I},[r,s]),f=t.current.unstable_applyPipeProcessors("columnMenu",[],e.colDef),x=c.useMemo(()=>{const I=Object.keys(o);return Object.keys(l).filter(y=>!I.includes(y))},[l,o]);return c.useMemo(()=>{const w=Array.from(new Set([...f,...x])).filter(m=>u[m]!=null).sort((m,p)=>{const E=g[m],R=g[p],H=Number.isFinite(E==null?void 0:E.displayOrder)?E.displayOrder:100,V=Number.isFinite(R==null?void 0:R.displayOrder)?R.displayOrder:100;return H-V});return w.reduce((m,p,E)=>{let R={colDef:i,onClick:a};const H=g[p];if(H){const V=re(H,Mm);R=h({},R,V)}return d&&E!==w.length-1?[...m,[u[p],R],[n.slots.baseDivider,{}]]:[...m,[u[p],R]]},[])},[d,i,f,a,u,g,x,n.slots.baseDivider])};function Em(e){const{colDef:t,onClick:n}=e,o=he(),r=ne(),a=je(o).filter(d=>d.disableColumnMenu!==!0).length===1,i=c.useCallback(d=>{a||(o.current.setColumnVisibility(t.field,!1),n(d))},[o,t.field,n,a]);return r.disableColumnSelector||t.hideable===!1?null:v.jsxs(rt,{onClick:i,disabled:a,children:[v.jsx(rn,{children:v.jsx(r.slots.columnMenuHideIcon,{fontSize:"small"})}),v.jsx(ln,{children:o.current.getLocaleText("columnMenuHideColumn")})]})}function Fm(e){const{onClick:t}=e,n=he(),o=ne(),r=c.useCallback(l=>{t(l),n.current.showPreferences(Bt.columns)},[n,t]);return o.disableColumnSelector?null:v.jsxs(rt,{onClick:r,children:[v.jsx(rn,{children:v.jsx(o.slots.columnMenuManageColumnsIcon,{fontSize:"small"})}),v.jsx(ln,{children:n.current.getLocaleText("columnMenuManageColumns")})]})}function Tm(e){return v.jsxs(c.Fragment,{children:[v.jsx(Em,h({},e)),v.jsx(Fm,h({},e))]})}function Hm(e){const{colDef:t,onClick:n}=e,o=he(),r=ne(),l=c.useCallback(s=>{n(s),o.current.showFilterPanel(t.field)},[o,t.field,n]);return r.disableColumnFilter||!t.filterable?null:v.jsxs(rt,{onClick:l,children:[v.jsx(rn,{children:v.jsx(r.slots.columnMenuFilterIcon,{fontSize:"small"})}),v.jsx(ln,{children:o.current.getLocaleText("columnMenuFilter")})]})}function Dm(e){const{colDef:t,onClick:n}=e,o=he(),r=K(o,ht),l=ne(),s=c.useMemo(()=>{if(!t)return null;const u=r.find(g=>g.field===t.field);return u==null?void 0:u.sort},[t,r]),a=t.sortingOrder??l.sortingOrder,i=c.useCallback(u=>{n(u);const g=u.currentTarget.getAttribute("data-value")||null;o.current.sortColumn(t.field,g===s?null:g)},[o,t,n,s]);if(l.disableColumnSorting||!t||!t.sortable||!a.some(u=>!!u))return null;const d=u=>{const g=o.current.getLocaleText(u);return typeof g=="function"?g(t):g};return v.jsxs(c.Fragment,{children:[a.includes("asc")&&s!=="asc"?v.jsxs(rt,{onClick:i,"data-value":"asc",children:[v.jsx(rn,{children:v.jsx(l.slots.columnMenuSortAscendingIcon,{fontSize:"small"})}),v.jsx(ln,{children:d("columnMenuSortAsc")})]}):null,a.includes("desc")&&s!=="desc"?v.jsxs(rt,{onClick:i,"data-value":"desc",children:[v.jsx(rn,{children:v.jsx(l.slots.columnMenuSortDescendingIcon,{fontSize:"small"})}),v.jsx(ln,{children:d("columnMenuSortDesc")})]}):null,a.includes(null)&&s!=null?v.jsxs(rt,{onClick:i,children:[v.jsx(rn,{}),v.jsx(ln,{children:o.current.getLocaleText("columnMenuUnsort")})]}):null]})}const Om=["defaultSlots","defaultSlotProps","slots","slotProps"],Lm={columnMenuSortItem:Dm,columnMenuFilterItem:Hm,columnMenuColumnsItem:Tm},Gm={columnMenuSortItem:{displayOrder:10},columnMenuFilterItem:{displayOrder:20},columnMenuColumnsItem:{displayOrder:30}},Rm=Ie(function(t,n){const{defaultSlots:o,defaultSlotProps:r,slots:l,slotProps:s}=t,a=re(t,Om),i=km(h({},a,{defaultSlots:o,defaultSlotProps:r,slots:l,slotProps:s}));return v.jsx(Pm,h({},a,{ref:n,children:i.map(([d,u],g)=>v.jsx(d,h({},u),g))}))}),$m=Ie(function(t,n){return v.jsx(Rm,h({},t,{ref:n,defaultSlots:Lm,defaultSlotProps:Gm}))}),zm=["className","slotProps"],Vm=e=>{const{classes:t}=e;return fe({root:["panelWrapper"]},pe,t)},Am=Ve("div",{name:"MuiDataGrid",slot:"PanelWrapper",overridesResolver:(e,t)=>t.panelWrapper})({display:"flex",flexDirection:"column",flex:1,"&:focus":{outline:0}}),Nm=()=>!0,Ai=Ie(function(t,n){const{className:o,slotProps:r={}}=t,l=re(t,zm),s=ne(),a=Vm(s);return v.jsx(sc,h({open:!0,disableEnforceFocus:!0,isEnabled:Nm},r.TrapFocus,{children:v.jsx(Am,h({tabIndex:-1,className:ve(a.root,o),ownerState:s},l,{ref:n}))}))});function jm(e){var n;const t=ne();return v.jsx(Ai,h({},e,{children:v.jsx(t.slots.columnsManagement,h({},(n=t.slotProps)==null?void 0:n.columnsManagement))}))}const _m=["children","className","classes"],Bm=gn("MuiDataGrid",["panel","paper"]),Wm=Ve(ir,{name:"MuiDataGrid",slot:"Panel",overridesResolver:(e,t)=>t.panel})(({theme:e})=>({zIndex:e.zIndex.modal})),Um=Ve(is,{name:"MuiDataGrid",slot:"Paper",overridesResolver:(e,t)=>t.paper})(({theme:e})=>({backgroundColor:(e.vars||e).palette.background.paper,minWidth:300,maxHeight:450,display:"flex",maxWidth:`calc(100vw - ${e.spacing(.5)})`,overflow:"auto"})),Km=Ie((e,t)=>{const{children:n,className:o}=e,r=re(e,_m),l=he(),s=ne(),a=Bm,[i,d]=c.useState(!1),u=c.useCallback(()=>{l.current.hidePreferences()},[l]),g=c.useCallback(y=>{y.key==="Escape"&&l.current.hidePreferences()},[l]),f=c.useMemo(()=>[{name:"flip",enabled:!0,options:{rootBoundary:"document"}},{name:"isPlaced",enabled:!0,phase:"main",fn:()=>{d(!0)},effect:()=>()=>{d(!1)}}],[]),[x,I]=c.useState(null);return c.useEffect(()=>{var w,m;const y=(m=(w=l.current.rootElementRef)==null?void 0:w.current)==null?void 0:m.querySelector('[data-id="gridPanelAnchor"]');y&&I(y)},[l]),x?v.jsx(Wm,h({placement:"bottom-start",className:ve(a.panel,o),ownerState:s,anchorEl:x,modifiers:f},r,{ref:t,children:v.jsx(hs,{mouseEvent:"onPointerUp",touchEvent:!1,onClickAway:u,children:v.jsx(Um,{className:a.paper,ownerState:s,elevation:8,onKeyDown:g,children:i&&n})})})):null}),qm=["className"],Xm=e=>{const{classes:t}=e;return fe({root:["panelContent"]},pe,t)},Ym=He("div",{name:"MuiDataGrid",slot:"PanelContent",overridesResolver:(e,t)=>t.panelContent})({display:"flex",flexDirection:"column",overflow:"auto",flex:"1 1",maxHeight:400});function Qm(e){const{className:t}=e,n=re(e,qm),o=ne(),r=Xm(o);return v.jsx(Ym,h({className:ve(r.root,t),ownerState:o},n))}const Zm=["className"],Jm=e=>{const{classes:t}=e;return fe({root:["panelFooter"]},pe,t)},eb=He("div",{name:"MuiDataGrid",slot:"PanelFooter",overridesResolver:(e,t)=>t.panelFooter})(({theme:e})=>({padding:e.spacing(.5),display:"flex",justifyContent:"space-between"}));function tb(e){const{className:t}=e,n=re(e,Zm),o=ne(),r=Jm(o);return v.jsx(eb,h({className:ve(r.root,t),ownerState:o},n))}const nb=["item","hasMultipleFilters","deleteFilter","applyFilterChanges","showMultiFilterOperators","disableMultiFilterOperator","applyMultiFilterOperatorChanges","focusElementRef","logicOperators","columnsSort","filterColumns","deleteIconProps","logicOperatorInputProps","operatorInputProps","columnInputProps","valueInputProps","readOnly","children"],ob=["InputComponentProps"],rb=e=>{const{classes:t}=e;return fe({root:["filterForm"],deleteIcon:["filterFormDeleteIcon"],logicOperatorInput:["filterFormLogicOperatorInput"],columnInput:["filterFormColumnInput"],operatorInput:["filterFormOperatorInput"],valueInput:["filterFormValueInput"]},pe,t)},lb=Ve("div",{name:"MuiDataGrid",slot:"FilterForm",overridesResolver:(e,t)=>t.filterForm})(({theme:e})=>({display:"flex",padding:e.spacing(1)})),sb=Ve("div",{name:"MuiDataGrid",slot:"FilterFormDeleteIcon",overridesResolver:(e,t)=>t.filterFormDeleteIcon})(({theme:e})=>({flexShrink:0,justifyContent:"flex-end",marginRight:e.spacing(.5),marginBottom:e.spacing(.2)})),ib=Ve("div",{name:"MuiDataGrid",slot:"FilterFormLogicOperatorInput",overridesResolver:(e,t)=>t.filterFormLogicOperatorInput})({minWidth:55,marginRight:5,justifyContent:"end"}),cb=Ve("div",{name:"MuiDataGrid",slot:"FilterFormColumnInput",overridesResolver:(e,t)=>t.filterFormColumnInput})({width:150}),ab=Ve("div",{name:"MuiDataGrid",slot:"FilterFormOperatorInput",overridesResolver:(e,t)=>t.filterFormOperatorInput})({width:150}),ub=Ve("div",{name:"MuiDataGrid",slot:"FilterFormValueInput",overridesResolver:(e,t)=>t.filterFormValueInput})({width:190}),db=e=>{switch(e){case tt.And:return"filterPanelOperatorAnd";case tt.Or:return"filterPanelOperatorOr";default:throw new Error("MUI X: Invalid `logicOperator` property in the `GridFilterPanel`.")}},Pn=e=>e.headerName||e.field,Rl=new Intl.Collator,$l=Ie(function(t,n){var xe,Ce,ye,be,$e,Qe,Le,Ae,_e;const{item:o,hasMultipleFilters:r,deleteFilter:l,applyFilterChanges:s,showMultiFilterOperators:a,disableMultiFilterOperator:i,applyMultiFilterOperatorChanges:d,focusElementRef:u,logicOperators:g=[tt.And,tt.Or],columnsSort:f,filterColumns:x,deleteIconProps:I={},logicOperatorInputProps:y={},operatorInputProps:w={},columnInputProps:m={},valueInputProps:p={},readOnly:E}=t,R=re(t,nb),H=he(),V=K(H,Tt),A=K(H,Ns),L=K(H,Xe),P=Ne(),D=Ne(),z=Ne(),F=Ne(),T=ne(),G=rb(T),M=c.useRef(null),b=c.useRef(null),C=L.logicOperator??tt.And,$=r&&g.length>0,k=((xe=T.slotProps)==null?void 0:xe.baseFormControl)||{},j=(((Ce=T.slotProps)==null?void 0:Ce.baseSelect)||{}).native??!1,N=((ye=T.slotProps)==null?void 0:ye.baseInputLabel)||{},_=((be=T.slotProps)==null?void 0:be.baseSelectOption)||{},{InputComponentProps:U}=p,q=re(p,ob),{filteredColumns:W,selectedField:Y}=c.useMemo(()=>{let ae=o.field;const Me=V[o.field].filterable===!1?V[o.field]:null;if(Me)return{filteredColumns:[Me],selectedField:ae};if(x===void 0||typeof x!="function")return{filteredColumns:A,selectedField:ae};const ce=x({field:o.field,columns:A,currentFilters:(L==null?void 0:L.items)||[]});return{filteredColumns:A.filter(we=>{const ke=ce.includes(we.field);return we.field===o.field&&!ke&&(ae=void 0),ke}),selectedField:ae}},[x,L==null?void 0:L.items,A,o.field,V]),Q=c.useMemo(()=>{switch(f){case"asc":return W.sort((ae,Me)=>Rl.compare(Pn(ae),Pn(Me)));case"desc":return W.sort((ae,Me)=>-Rl.compare(Pn(ae),Pn(Me)));default:return W}},[W,f]),Z=o.field?H.current.getColumn(o.field):null,J=c.useMemo(()=>{var ae;return!o.operator||!Z?null:(ae=Z.filterOperators)==null?void 0:ae.find(Me=>Me.value===o.operator)},[o,Z]),te=c.useCallback(ae=>{const Me=ae.target.value,ce=H.current.getColumn(Me);if(ce.field===Z.field)return;const we=ce.filterOperators.find(ge=>ge.value===o.operator)||ce.filterOperators[0];let se=!we.InputComponent||we.InputComponent!==(J==null?void 0:J.InputComponent)||ce.type!==Z.type?void 0:o.value;if(ce.type==="singleSelect"&&se!==void 0){const ge=ce,Se=_t(ge);Array.isArray(se)?se=se.filter(ue=>ho(ue,Se,ge==null?void 0:ge.getOptionValue)!==void 0):ho(o.value,Se,ge==null?void 0:ge.getOptionValue)===void 0&&(se=void 0)}s(h({},o,{field:Me,operator:we.value,value:se}))},[H,s,o,Z,J]),oe=c.useCallback(ae=>{const Me=ae.target.value,ce=Z==null?void 0:Z.filterOperators.find(ke=>ke.value===Me),we=!(ce!=null&&ce.InputComponent)||(ce==null?void 0:ce.InputComponent)!==(J==null?void 0:J.InputComponent);s(h({},o,{operator:Me,value:we?void 0:o.value}))},[s,o,Z,J]),X=c.useCallback(ae=>{const Me=ae.target.value===tt.And.toString()?tt.And:tt.Or;d(Me)},[d]),ie=()=>{l(o)};return c.useImperativeHandle(u,()=>({focus:()=>{var ae;J!=null&&J.InputComponent?(ae=M==null?void 0:M.current)==null||ae.focus():b.current.focus()}}),[J]),v.jsxs(lb,h({className:G.root,"data-id":o.id,ownerState:T},R,{ref:n,children:[v.jsx(sb,h({variant:"standard",as:T.slots.baseFormControl},k,I,{className:ve(G.deleteIcon,k.className,I.className),ownerState:T,children:v.jsx(T.slots.baseIconButton,h({"aria-label":H.current.getLocaleText("filterPanelDeleteIconLabel"),title:H.current.getLocaleText("filterPanelDeleteIconLabel"),onClick:ie,size:"small",disabled:E},($e=T.slotProps)==null?void 0:$e.baseIconButton,{children:v.jsx(T.slots.filterPanelDeleteIcon,{fontSize:"small"})}))})),v.jsx(ib,h({variant:"standard",as:T.slots.baseFormControl},k,y,{sx:[$?{display:"flex"}:{display:"none"},a?{visibility:"visible"}:{visibility:"hidden"},k.sx,y.sx],className:ve(G.logicOperatorInput,k.className,y.className),ownerState:T,children:v.jsx(T.slots.baseSelect,h({inputProps:{"aria-label":H.current.getLocaleText("filterPanelLogicOperator")},value:C??"",onChange:X,disabled:!!i||g.length===1,native:j},(Qe=T.slotProps)==null?void 0:Qe.baseSelect,{children:g.map(ae=>c.createElement(T.slots.baseSelectOption,h({},_,{native:j,key:ae.toString(),value:ae.toString()}),H.current.getLocaleText(db(ae))))}))})),v.jsxs(cb,h({variant:"standard",as:T.slots.baseFormControl},k,m,{className:ve(G.columnInput,k.className,m.className),ownerState:T,children:[v.jsx(T.slots.baseInputLabel,h({},N,{htmlFor:P,id:D,children:H.current.getLocaleText("filterPanelColumns")})),v.jsx(T.slots.baseSelect,h({labelId:D,id:P,label:H.current.getLocaleText("filterPanelColumns"),value:Y??"",onChange:te,native:j,disabled:E},(Le=T.slotProps)==null?void 0:Le.baseSelect,{children:Q.map(ae=>c.createElement(T.slots.baseSelectOption,h({},_,{native:j,key:ae.field,value:ae.field}),Pn(ae)))}))]})),v.jsxs(ab,h({variant:"standard",as:T.slots.baseFormControl},k,w,{className:ve(G.operatorInput,k.className,w.className),ownerState:T,children:[v.jsx(T.slots.baseInputLabel,h({},N,{htmlFor:z,id:F,children:H.current.getLocaleText("filterPanelOperator")})),v.jsx(T.slots.baseSelect,h({labelId:F,label:H.current.getLocaleText("filterPanelOperator"),id:z,value:o.operator,onChange:oe,native:j,inputRef:b,disabled:E},(Ae=T.slotProps)==null?void 0:Ae.baseSelect,{children:(_e=Z==null?void 0:Z.filterOperators)==null?void 0:_e.map(ae=>c.createElement(T.slots.baseSelectOption,h({},_,{native:j,key:ae.value,value:ae.value}),ae.label||H.current.getLocaleText(`filterOperator${zn(ae.value)}`)))}))]})),v.jsx(ub,h({variant:"standard",as:T.slots.baseFormControl},k,q,{className:ve(G.valueInput,k.className,q.className),ownerState:T,children:J!=null&&J.InputComponent?v.jsx(J.InputComponent,h({apiRef:H,item:o,applyValue:s,focusElementRef:M,disabled:E},J.InputComponentProps,U),o.field):null}))]}))}),gb=["logicOperators","columnsSort","filterFormProps","getColumnForNewFilter","children","disableAddFilterButton","disableRemoveAllButton"],zl=e=>({field:e.field,operator:e.filterOperators[0].value,id:Math.round(Math.random()*1e5)}),fb=Ie(function(t,n){var F,T;const o=he(),r=ne(),l=K(o,Xe),s=K(o,Ns),a=K(o,du),i=c.useRef(null),d=c.useRef(null),{logicOperators:u=[tt.And,tt.Or],columnsSort:g,filterFormProps:f,getColumnForNewFilter:x,disableAddFilterButton:I=!1,disableRemoveAllButton:y=!1}=t,w=re(t,gb),m=o.current.upsertFilterItem,p=c.useCallback(G=>{o.current.setFilterLogicOperator(G)},[o]),E=c.useCallback(()=>{let G;if(x&&typeof x=="function"){const M=x({currentFilters:(l==null?void 0:l.items)||[],columns:s});if(M===null)return null;G=s.find(({field:b})=>b===M)}else G=s.find(M=>{var b;return(b=M.filterOperators)==null?void 0:b.length});return G?zl(G):null},[l==null?void 0:l.items,s,x]),R=c.useCallback(()=>{if(x===void 0||typeof x!="function")return E();const G=l.items.length?l.items:[E()].filter(Boolean),M=x({currentFilters:G,columns:s});if(M===null)return null;const b=s.find(({field:C})=>C===M);return b?zl(b):null},[l.items,s,x,E]),H=c.useMemo(()=>l.items.length?l.items:(d.current||(d.current=E()),d.current?[d.current]:[]),[l.items,E]),V=H.length>1,{readOnlyFilters:A,validFilters:L}=c.useMemo(()=>H.reduce((G,M)=>(a[M.field]?G.validFilters.push(M):G.readOnlyFilters.push(M),G),{readOnlyFilters:[],validFilters:[]}),[H,a]),P=c.useCallback(()=>{const G=R();G&&o.current.upsertFilterItems([...H,G])},[o,R,H]),D=c.useCallback(G=>{const M=L.length===1;o.current.deleteFilterItem(G),M&&o.current.hideFilterPanel()},[o,L.length]),z=c.useCallback(()=>L.length===1&&L[0].value===void 0?(o.current.deleteFilterItem(L[0]),o.current.hideFilterPanel()):o.current.setFilterModel(h({},l,{items:A}),"removeAllFilterItems"),[o,A,l,L]);return c.useEffect(()=>{u.length>0&&l.logicOperator&&!u.includes(l.logicOperator)&&p(u[0])},[u,p,l.logicOperator]),c.useEffect(()=>{L.length>0&&i.current.focus()},[L.length]),v.jsxs(Ai,h({},w,{ref:n,children:[v.jsxs(Qm,{children:[A.map((G,M)=>v.jsx($l,h({item:G,applyFilterChanges:m,deleteFilter:D,hasMultipleFilters:V,showMultiFilterOperators:M>0,disableMultiFilterOperator:M!==1,applyMultiFilterOperatorChanges:p,focusElementRef:null,readOnly:!0,logicOperators:u,columnsSort:g},f),G.id==null?M:G.id)),L.map((G,M)=>v.jsx($l,h({item:G,applyFilterChanges:m,deleteFilter:D,hasMultipleFilters:V,showMultiFilterOperators:A.length+M>0,disableMultiFilterOperator:A.length+M!==1,applyMultiFilterOperatorChanges:p,focusElementRef:M===L.length-1?i:null,logicOperators:u,columnsSort:g},f),G.id==null?M+A.length:G.id))]}),!r.disableMultipleColumnsFiltering&&!(I&&y)?v.jsxs(tb,{children:[I?v.jsx("span",{}):v.jsx(r.slots.baseButton,h({onClick:P,startIcon:v.jsx(r.slots.filterPanelAddIcon,{})},(F=r.slotProps)==null?void 0:F.baseButton,{children:o.current.getLocaleText("filterPanelAddFilter")})),!y&&L.length>0?v.jsx(r.slots.baseButton,h({onClick:z,startIcon:v.jsx(r.slots.filterPanelRemoveAllIcon,{})},(T=r.slotProps)==null?void 0:T.baseButton,{children:o.current.getLocaleText("filterPanelRemoveAll")})):null]}):null]}))}),hb=(e,t)=>{const n=new Set(Object.keys(e).filter(l=>e[l]===!1)),o=new Set(Object.keys(t).filter(l=>t[l]===!1));if(n.size!==o.size)return!1;let r=!0;return n.forEach(l=>{o.has(l)||(r=!1)}),r},mb=(e,t)=>(e.headerName||e.field).toLowerCase().indexOf(t)>-1,bb=e=>{const{classes:t}=e;return fe({root:["columnsManagement"],header:["columnsManagementHeader"],searchInput:["columnsManagementSearchInput"],footer:["columnsManagementFooter"],row:["columnsManagementRow"]},pe,t)},Vl=new Intl.Collator;function Cb(e){var M,b,C,$;const t=he(),n=c.useRef(null),o=K(t,Ct),r=yt(()=>at(t)).current,l=K(t,at),s=ne(),[a,i]=c.useState(""),d=bb(s),{sort:u,searchPredicate:g=mb,autoFocusSearchField:f=!0,disableShowHideToggle:x=!1,disableResetButton:I=!1,toggleAllMode:y="all",getTogglableColumns:w,searchInputProps:m}=e,p=c.useMemo(()=>hb(l,r),[l,r]),E=c.useMemo(()=>{switch(u){case"asc":return[...o].sort((k,O)=>Vl.compare(k.headerName||k.field,O.headerName||O.field));case"desc":return[...o].sort((k,O)=>-Vl.compare(k.headerName||k.field,O.headerName||O.field));default:return o}},[o,u]),R=k=>{const{name:O}=k.target;t.current.setColumnVisibility(O,l[O]===!1)},H=c.useMemo(()=>{const k=w?w(E):null,O=k?E.filter(({field:j})=>k.includes(j)):E;return a?O.filter(j=>g(j,a.toLowerCase())):O},[E,a,g,w]),V=c.useCallback(k=>{const O=at(t),j=h({},O),N=w?w(o):null;return(y==="filteredOnly"?H:o).forEach(_=>{_.hideable&&(N==null||N.includes(_.field))&&(k?delete j[_.field]:j[_.field]=!1)}),t.current.setColumnVisibilityModel(j)},[t,o,w,y,H]),A=c.useCallback(k=>{i(k.target.value)},[]),L=c.useMemo(()=>H.filter(k=>k.hideable),[H]),P=c.useMemo(()=>L.every(k=>l[k.field]==null||l[k.field]!==!1),[l,L]),D=c.useMemo(()=>L.every(k=>l[k.field]===!1),[l,L]),z=c.useRef(null);c.useEffect(()=>{f?n.current.focus():z.current&&typeof z.current.focus=="function"&&z.current.focus()},[f]);let F=!1;const T=k=>F===!1&&k.hideable!==!1?(F=!0,!0):!1,G=c.useCallback(()=>{i(""),n.current.focus()},[]);return v.jsxs(c.Fragment,{children:[v.jsx(wb,{className:d.header,ownerState:s,children:v.jsx(Sb,h({as:s.slots.baseTextField,ownerState:s,placeholder:t.current.getLocaleText("columnsManagementSearchTitle"),inputRef:n,className:d.searchInput,value:a,onChange:A,variant:"outlined",size:"small",type:"search",InputProps:{startAdornment:v.jsx(s.slots.baseInputAdornment,{position:"start",children:v.jsx(s.slots.quickFilterIcon,{})}),endAdornment:v.jsx(s.slots.baseIconButton,h({"aria-label":t.current.getLocaleText("columnsManagementDeleteIconLabel"),size:"small",sx:[a?{visibility:"visible"}:{visibility:"hidden"}],tabIndex:-1,onClick:G},(M=s.slotProps)==null?void 0:M.baseIconButton,{children:v.jsx(s.slots.quickFilterClearIcon,{fontSize:"small"})}))},inputProps:{"aria-label":t.current.getLocaleText("columnsManagementSearchTitle")},autoComplete:"off",fullWidth:!0},(b=s.slotProps)==null?void 0:b.baseTextField,m))}),v.jsxs(pb,{className:d.root,ownerState:s,children:[H.map(k=>{var O;return v.jsx(Ar,{className:d.row,control:v.jsx(s.slots.baseCheckbox,h({disabled:k.hideable===!1,checked:l[k.field]!==!1,onClick:R,name:k.field,sx:{p:.5},inputRef:T(k)?z:void 0},(O=s.slotProps)==null?void 0:O.baseCheckbox)),label:k.headerName||k.field},k.field)}),H.length===0&&v.jsx(vb,{ownerState:s,children:t.current.getLocaleText("columnsManagementNoColumns")})]}),(!x||!I)&&H.length>0?v.jsxs(xb,{ownerState:s,className:d.footer,children:[x?v.jsx("span",{}):v.jsx(Ar,{control:v.jsx(s.slots.baseCheckbox,h({disabled:L.length===0,checked:P,indeterminate:!P&&!D,onClick:()=>V(!P),name:t.current.getLocaleText("columnsManagementShowHideAllText"),sx:{p:.5}},(C=s.slotProps)==null?void 0:C.baseCheckbox)),label:t.current.getLocaleText("columnsManagementShowHideAllText")}),I?null:v.jsx(s.slots.baseButton,h({onClick:()=>t.current.setColumnVisibilityModel(r),disabled:p},($=s.slotProps)==null?void 0:$.baseButton,{children:t.current.getLocaleText("columnsManagementReset")}))]}):null]})}const pb=Ve("div",{name:"MuiDataGrid",slot:"ColumnsManagement",overridesResolver:(e,t)=>t.columnsManagement})(({theme:e})=>({padding:e.spacing(0,3,1.5),display:"flex",flexDirection:"column",overflow:"auto",flex:"1 1",maxHeight:400,alignItems:"flex-start"})),wb=Ve("div",{name:"MuiDataGrid",slot:"ColumnsManagementHeader",overridesResolver:(e,t)=>t.columnsManagementHeader})(({theme:e})=>({padding:e.spacing(1.5,3)})),Sb=Ve(as,{name:"MuiDataGrid",slot:"ColumnsManagementSearchInput",overridesResolver:(e,t)=>t.columnsManagementSearchInput})(({theme:e})=>({[`& .${vn.root}`]:{padding:e.spacing(0,1.5,0,1.5)},[`& .${vn.input}::-webkit-search-decoration,
  & .${vn.input}::-webkit-search-cancel-button,
  & .${vn.input}::-webkit-search-results-button,
  & .${vn.input}::-webkit-search-results-decoration`]:{display:"none"}})),xb=Ve("div",{name:"MuiDataGrid",slot:"ColumnsManagementFooter",overridesResolver:(e,t)=>t.columnsManagementFooter})(({theme:e})=>({padding:e.spacing(.5,1,.5,3),display:"flex",justifyContent:"space-between",borderTop:`1px solid ${e.palette.divider}`})),vb=Ve("div")(({theme:e})=>({padding:e.spacing(.5,0),color:e.palette.grey[500]})),yb=Ie(function(t,n){var p,E;const{children:o,slotProps:r={}}=t,l=r.button||{},s=r.tooltip||{},a=he(),i=ne(),d=Ne(),u=Ne(),[g,f]=c.useState(!1),x=c.useRef(null),I=wt(n,x),y=R=>{var H;f(V=>!V),(H=l.onClick)==null||H.call(l,R)},w=()=>f(!1),m=R=>{R.key==="Tab"&&R.preventDefault(),zi(R.key)&&w()};return o==null?null:v.jsxs(c.Fragment,{children:[v.jsx(i.slots.baseTooltip,h({title:a.current.getLocaleText("toolbarExportLabel"),enterDelay:1e3},(p=i.slotProps)==null?void 0:p.baseTooltip,s,{children:v.jsx(i.slots.baseButton,h({size:"small",startIcon:v.jsx(i.slots.exportIcon,{}),"aria-expanded":g,"aria-label":a.current.getLocaleText("toolbarExportLabel"),"aria-haspopup":"menu","aria-controls":g?u:void 0,id:d},(E=i.slotProps)==null?void 0:E.baseButton,l,{onClick:y,ref:I,children:a.current.getLocaleText("toolbarExport")}))})),v.jsx(mr,{open:g,target:x.current,onClose:w,position:"bottom-start",children:v.jsx(cr,{id:u,className:S.menuList,"aria-labelledby":d,onKeyDown:m,autoFocusItem:g,children:c.Children.map(o,R=>c.isValidElement(R)?c.cloneElement(R,{hideMenu:w}):R)})})]})}),Ib=["hideMenu","options"],Pb=["hideMenu","options"],Mb=["csvOptions","printOptions","excelOptions"];function kb(e){const t=he(),{hideMenu:n,options:o}=e,r=re(e,Ib);return v.jsx(rt,h({onClick:()=>{t.current.exportDataAsCsv(o),n==null||n()}},r,{children:t.current.getLocaleText("toolbarExportCSV")}))}function Eb(e){const t=he(),{hideMenu:n,options:o}=e,r=re(e,Pb);return v.jsx(rt,h({onClick:()=>{t.current.exportDataAsPrint(o),n==null||n()}},r,{children:t.current.getLocaleText("toolbarExportPrint")}))}Ie(function(t,n){const o=t,{csvOptions:r={},printOptions:l={},excelOptions:s}=o,a=re(o,Mb),d=he().current.unstable_applyPipeProcessors("exportMenu",[],{excelOptions:s,csvOptions:r,printOptions:l}).sort((u,g)=>u.componentName>g.componentName?1:-1);return d.length===0?null:v.jsx(yb,h({},a,{ref:n,children:d.map((u,g)=>c.cloneElement(u.component,{key:g}))}))});const Fb=["className","selectedRowCount"],Tb=e=>{const{classes:t}=e;return fe({root:["selectedRowCount"]},pe,t)},Hb=He("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"}})),Db=Ie(function(t,n){const{className:o,selectedRowCount:r}=t,l=re(t,Fb),s=he(),a=ne(),i=Tb(a),d=s.current.getLocaleText("footerRowSelected")(r);return v.jsx(Hb,h({className:ve(i.root,o),ownerState:a},l,{ref:n,children:d}))}),Ob=Ie(function(t,n){var g,f;const o=he(),r=ne(),l=K(o,Hu),s=K(o,ld),a=K(o,wr),i=!r.hideFooterSelectedRowCount&&s>0?v.jsx(Db,{selectedRowCount:s}):v.jsx("div",{}),d=!r.hideFooterRowCount&&!r.pagination?v.jsx(r.slots.footerRowCount,h({},(g=r.slotProps)==null?void 0:g.footerRowCount,{rowCount:l,visibleRowCount:a})):null,u=r.pagination&&!r.hideFooterPagination&&r.slots.pagination&&v.jsx(r.slots.pagination,h({},(f=r.slotProps)==null?void 0:f.pagination));return v.jsxs(gh,h({},t,{ref:n,children:[i,d,u]}))}),Hn=(e,t,n,o,r,l)=>{let s;switch(e){case me.LEFT:s=o[n];break;case me.RIGHT:s=r-o[n]-t+l;break;default:s=void 0;break}return s},po=(e,t,n,o,r)=>{const l=t===n-1;return e===me.LEFT&&l?!0:o?e===me.LEFT?!0:e===me.RIGHT?!l:!l||r:!1},wo=(e,t)=>e===me.RIGHT&&t===0,Mn={root:S.scrollbarFiller,header:S["scrollbarFiller--header"],borderTop:S["scrollbarFiller--borderTop"],borderBottom:S["scrollbarFiller--borderBottom"],pinnedRight:S["scrollbarFiller--pinnedRight"]};function Tr({header:e,borderTop:t=!0,borderBottom:n,pinnedRight:o}){return v.jsx("div",{role:"presentation",className:ve(Mn.root,e&&Mn.header,t&&Mn.borderTop,n&&Mn.borderBottom,o&&Mn.pinnedRight)})}const Lb=He("div",{name:"MuiDataGrid",slot:"SkeletonLoadingOverlay",overridesResolver:(e,t)=>t.skeletonLoadingOverlay})({minWidth:"100%",width:"max-content",height:"100%",overflow:"clip"}),Gb=e=>{const{classes:t}=e;return fe({root:["skeletonLoadingOverlay"]},pe,t)},Al=e=>parseInt(e.getAttribute("data-colindex"),10),Rb=Ie(function(t,n){const o=ne(),{slots:r}=o,l=It(),s=Gb({classes:o.classes}),a=c.useRef(null),i=wt(a,n),d=he(),u=K(d,qe),g=(u==null?void 0:u.viewportInnerSize.height)??0,f=Math.ceil(g/u.rowHeight),x=K(d,vo),I=K(d,Vt),y=c.useMemo(()=>I.filter(V=>V<=x).length,[x,I]),w=K(d,je),m=c.useMemo(()=>w.slice(0,y),[w,y]),p=K(d,bn),E=c.useCallback(V=>{if(p.left.findIndex(A=>A.field===V)!==-1)return me.LEFT;if(p.right.findIndex(A=>A.field===V)!==-1)return me.RIGHT},[p.left,p.right]),R=c.useMemo(()=>{const V=[];for(let A=0;A<f;A+=1){const L=[];for(let P=0;P<m.length;P+=1){const D=m[P],z=E(D.field),F=z===me.LEFT,T=z===me.RIGHT,G=Ti(z,l),M=G?p[G].length:m.length-p.left.length-p.right.length,b=G?p[G].findIndex(J=>J.field===D.field):P-p.left.length,C=u.hasScrollY?u.scrollbarSize:0,$=Ho({},l,z,Hn(z,D.computedWidth,P,I,u.columnsTotalWidth,C)),k=u.columnsTotalWidth<u.viewportOuterSize.width,O=po(z,b,M,o.showCellVerticalBorder,k),j=wo(z,b),N=P===m.length-1,_=T&&b===0,U=_&&k,q=N&&!_&&k,W=u.viewportOuterSize.width-u.columnsTotalWidth,Y=Math.max(0,W),Q=v.jsx(r.skeletonCell,{width:Y,empty:!0},`skeleton-filler-column-${A}`),Z=N&&C!==0;U&&L.push(Q),L.push(v.jsx(r.skeletonCell,{field:D.field,type:D.type,align:D.align,width:"var(--width)",height:u.rowHeight,"data-colindex":P,className:ve(F&&S["cell--pinnedLeft"],T&&S["cell--pinnedRight"],O&&S["cell--withRightBorder"],j&&S["cell--withLeftBorder"]),style:h({"--width":`${D.computedWidth}px`},$)},`skeleton-column-${A}-${D.field}`)),q&&L.push(Q),Z&&L.push(v.jsx(Tr,{pinnedRight:p.right.length>0},`skeleton-scrollbar-filler-${A}`))}V.push(v.jsx("div",{className:ve(S.row,S.rowSkeleton,A===0&&S["row--firstVisible"]),children:L},`skeleton-row-${A}`))}return V},[r,m,p,f,o.showCellVerticalBorder,u,I,E,l]);return ee(d,"columnResize",V=>{var b,C,$;const{colDef:A,width:L}=V,P=(b=a.current)==null?void 0:b.querySelectorAll(`[data-field="${Ht(A.field)}"]`);if(!P)throw new Error("MUI X: Expected skeleton cells to be defined with `data-field` attribute.");const D=m.findIndex(k=>k.field===A.field),z=E(A.field),F=z===me.LEFT,T=z===me.RIGHT,G=getComputedStyle(P[0]).getPropertyValue("--width"),M=parseInt(G,10)-L;if(P&&P.forEach(k=>{k.style.setProperty("--width",`${L}px`)}),F){const k=(C=a.current)==null?void 0:C.querySelectorAll(`.${S["cell--pinnedLeft"]}`);k==null||k.forEach(O=>{Al(O)>D&&(O.style.left=`${parseInt(getComputedStyle(O).left,10)-M}px`)})}if(T){const k=($=a.current)==null?void 0:$.querySelectorAll(`.${S["cell--pinnedRight"]}`);k==null||k.forEach(O=>{Al(O)<D&&(O.style.right=`${parseInt(getComputedStyle(O).right,10)+M}px`)})}}),v.jsx(Lb,h({className:s.root},t,{ref:i,children:R}))}),$b=["variant","noRowsVariant","style"],zb={"circular-progress":{component:cc,style:{}},"linear-progress":{component:ic,style:{display:"block"}},skeleton:{component:Rb,style:{display:"block"}}},Vb=Ie(function(t,n){const{variant:o="circular-progress",noRowsVariant:r="circular-progress",style:l}=t,s=re(t,$b),a=he(),i=K(a,An),d=zb[i===0?r:o];return v.jsx(Er,h({style:h({},d.style,l)},s,{ref:n,children:v.jsx(d.component,{})}))}),Ab=Ie(function(t,n){const r=he().current.getLocaleText("noRowsLabel");return v.jsx(Er,h({},t,{ref:n,children:r}))}),Nb=Ve(Fc)(({theme:e})=>({maxHeight:"calc(100% + 1px)",flexGrow:1,[`& .${Nr.selectLabel}`]:{display:"none",[e.breakpoints.up("sm")]:{display:"block"}},[`& .${Nr.input}`]:{display:"none",[e.breakpoints.up("sm")]:{display:"inline-flex"}}})),jb=(e,t)=>({from:n,to:o,count:r,page:l})=>e({from:n,to:o,count:r,page:l,estimated:t}),_b=({from:e,to:t,count:n,estimated:o})=>o?`${e}–${t} of ${n!==-1?n:`more than ${o>t?o:t}`}`:`${e}–${t} of ${n!==-1?n:`more than ${t}`}`,Bb=Ie(function(t,n){const o=he(),r=ne(),l=K(o,et),s=K(o,tn),a=K(o,ai),{paginationMode:i,loading:d,estimatedRowCount:u}=r,g=c.useMemo(()=>s===-1&&i==="server"&&d?{backIconButtonProps:{disabled:!0},nextIconButtonProps:{disabled:!0}}:{},[d,i,s]),f=c.useMemo(()=>Math.max(0,a-1),[a]),x=c.useMemo(()=>s===-1||l.page<=f?l.page:f,[f,l.page,s]),I=c.useCallback(R=>{const H=Number(R.target.value);o.current.setPageSize(H)},[o]),y=c.useCallback((R,H)=>{o.current.setPage(H)},[o]),m=(R=>{for(let H=0;H<r.pageSizeOptions.length;H+=1){const V=r.pageSizeOptions[H];if(typeof V=="number"){if(V===R)return!0}else if(V.value===R)return!0}return!1})(l.pageSize)?r.pageSizeOptions:[],p=o.current.getLocaleText("MuiTablePagination"),E=jb(p.labelDisplayedRows||_b,u);return v.jsx(Nb,h({component:"div",count:s,page:x,rowsPerPageOptions:m,rowsPerPage:l.pageSize,onPageChange:y,onRowsPerPageChange:I},g,p,{labelDisplayedRows:E},t,{ref:n}))}),Wb=["className","rowCount","visibleRowCount"],Ub=e=>{const{classes:t}=e;return fe({root:["rowCount"]},pe,t)},Kb=He("div",{name:"MuiDataGrid",slot:"RowCount",overridesResolver:(e,t)=>t.rowCount})(({theme:e})=>({alignItems:"center",display:"flex",margin:e.spacing(0,2)})),qb=Ie(function(t,n){const{className:o,rowCount:r,visibleRowCount:l}=t,s=re(t,Wb),a=he(),i=ne(),d=Ub(i);if(r===0)return null;const u=l<r?a.current.getLocaleText("footerTotalVisibleRows")(l,r):r.toLocaleString();return v.jsxs(Kb,h({className:ve(d.root,o),ownerState:i},s,{ref:n,children:[a.current.getLocaleText("footerTotalRows")," ",u]}))});function Xb(e){for(const t in e)return!1;return!0}function Yb(e,t){return fe(t,pe,e)}const Qb=["selected","rowId","row","index","style","rowHeight","className","visibleColumns","pinnedColumns","offsetLeft","columnsTotalWidth","firstColumnIndex","lastColumnIndex","focusedColumnIndex","isFirstVisible","isLastVisible","isNotVisible","showBottomBorder","scrollbarWidth","gridHasFiller","onClick","onDoubleClick","onMouseEnter","onMouseLeave","onMouseOut","onMouseOver"],Zb=Vn(We,(e,t)=>t?!!Xb(e):!1),Jb=Ie(function(t,n){var ke;const{selected:o,rowId:r,row:l,index:s,style:a,rowHeight:i,className:d,visibleColumns:u,pinnedColumns:g,offsetLeft:f,columnsTotalWidth:x,firstColumnIndex:I,lastColumnIndex:y,focusedColumnIndex:w,isFirstVisible:m,isLastVisible:p,isNotVisible:E,showBottomBorder:R,scrollbarWidth:H,gridHasFiller:V,onClick:A,onDoubleClick:L,onMouseEnter:P,onMouseLeave:D,onMouseOut:z,onMouseOver:F}=t,T=re(t,Qb),G=st(),M=Mi(),b=c.useRef(null),C=ne(),$=Mr(G),k=K(G,ht),O=K(G,Ut),j=K(G,Vt),N=C.rowReordering,_=On(G,Zb,N),U=wt(b,n),q=G.current.getRowNode(r),W=On(G,Ei,{rowId:r,editMode:C.editMode}),Y=C.editMode===vt.Row,Q=w!==void 0,Z=Q&&w>=g.left.length&&w<I,J=Q&&w<u.length-g.right.length&&w>=y,te=Yb(C.classes,{root:["row",o&&"selected",Y&&"row--editable",W&&"row--editing",m&&"row--firstVisible",p&&"row--lastVisible",R&&"row--borderBottom",i==="auto"&&"row--dynamicHeight"]}),oe=M.hooks.useGridRowAriaAttributes();c.useLayoutEffect(()=>{if($.range){const se=G.current.getRowIndexRelativeToVisibleRows(r);se!==void 0&&G.current.unstable_setLastMeasuredRowIndex(se)}if(b.current&&i==="auto")return G.current.observeRowHeight(b.current,r)},[G,$.range,i,r]);const X=c.useCallback((se,ge)=>Se=>{Kn(Se)||G.current.getRow(r)&&(G.current.publishEvent(se,G.current.getRowParams(r),Se),ge&&ge(Se))},[G,r]),ie=c.useCallback(se=>{const ge=bo(se.target,S.cell),Se=ge==null?void 0:ge.getAttribute("data-field");if(Se){if(Se===Sn.field||Se===Po||Se==="__reorder__"||G.current.getCellMode(r,Se)===Fe.Edit)return;const ue=G.current.getColumn(Se);if((ue==null?void 0:ue.type)===yo)return}X("rowClick",A)(se)},[G,A,X,r]),{slots:xe,slotProps:Ce,disableColumnReorder:ye}=C,be=K(G,()=>h({},G.current.getRowHeightEntry(r)),ur),$e=c.useMemo(()=>{if(E)return{opacity:0,width:0,height:0};const se=h({},a,{maxHeight:i==="auto"?"none":i,minHeight:i,"--height":typeof i=="number"?`${i}px`:i});if(be.spacingTop){const ge=C.rowSpacingType==="border"?"borderTopWidth":"marginTop";se[ge]=be.spacingTop}if(be.spacingBottom){const ge=C.rowSpacingType==="border"?"borderBottomWidth":"marginBottom";let Se=se[ge];typeof Se!="number"&&(Se=parseInt(Se||"0",10)),Se+=be.spacingBottom,se[ge]=Se}return se},[E,i,a,be,C.rowSpacingType]),Qe=G.current.unstable_applyPipeProcessors("rowClassName",[],r),Le=q?oe(q,s):void 0;if(typeof C.getRowClassName=="function"){const se=s-(((ke=$.range)==null?void 0:ke.firstRowIndex)||0),ge=h({},G.current.getRowParams(r),{isFirstVisible:se===0,isLastVisible:se===$.rows.length-1,indexRelativeToCurrentPage:se});Qe.push(C.getRowClassName(ge))}if(!q)return null;const Ae=(se,ge,Se,ue,Ge=me.NONE)=>{const Ee=G.current.unstable_getCellColSpanInfo(r,Se);if(Ee!=null&&Ee.spannedByColSpan)return null;const nt=(Ee==null?void 0:Ee.cellProps.width)??se.computedWidth,Dt=(Ee==null?void 0:Ee.cellProps.colSpan)??1,qn=Hn(Ge,se.computedWidth,Se,j,x,H);if((q==null?void 0:q.type)==="skeletonRow")return v.jsx(xe.skeletonCell,{type:se.type,width:nt,height:i,field:se.field,align:se.align},se.field);const Do=se.field==="__reorder__",Oo=!(ye||se.disableReorder),Lo=_&&!k.length&&O<=1,Go=!(Oo||Do&&Lo),Ro=Ge===me.VIRTUAL,Xn=wo(Ge,ge),Yn=po(Ge,ge,ue,C.showCellVerticalBorder,V);return v.jsx(xe.cell,h({column:se,width:nt,rowId:r,align:se.align||"left",colIndex:Se,colSpan:Dt,disableDragEvents:Go,isNotVisible:Ro,pinnedOffset:qn,pinnedPosition:Ge,showLeftBorder:Xn,showRightBorder:Yn,row:l,rowNode:q},Ce==null?void 0:Ce.cell),se.field)},_e=g.left.map((se,ge)=>Ae(se,ge,ge,g.left.length,me.LEFT)),ae=g.right.map((se,ge)=>{const Se=u.length-g.right.length+ge;return Ae(se,ge,Se,g.right.length,me.RIGHT)}),Me=u.length-g.left.length-g.right.length,ce=[];Z&&ce.push(Ae(u[w],w-g.left.length,w,Me,me.VIRTUAL));for(let se=I;se<y;se+=1){const ge=u[se],Se=se-g.left.length;ge&&ce.push(Ae(ge,Se,se,Me))}J&&ce.push(Ae(u[w],w-g.left.length,w,Me,me.VIRTUAL));const we=l?{onClick:ie,onDoubleClick:X("rowDoubleClick",L),onMouseEnter:X("rowMouseEnter",P),onMouseLeave:X("rowMouseLeave",D),onMouseOut:X("rowMouseOut",z),onMouseOver:X("rowMouseOver",F)}:null;return v.jsxs("div",h({"data-id":r,"data-rowindex":s,role:"row",className:ve(...Qe,te.root,d),style:$e},Le,we,T,{ref:U,children:[_e,v.jsx("div",{role:"presentation",className:S.cellOffsetLeft,style:{width:f}}),ce,v.jsx("div",{role:"presentation",className:ve(S.cell,S.cellEmpty)}),ae,H!==0&&v.jsx(Tr,{pinnedRight:g.right.length>0,borderTop:!m})]}))}),eC=Ft(Jb),tC=()=>{const e=st(),t=ne(),n=K(e,je),o=K(e,pr),r=K(e,Bn),l=K(e,Bs);return{role:"grid","aria-colcount":n.length,"aria-rowcount":r+1+l+o,"aria-multiselectable":Sr(t)}},nC=()=>{const e=st(),t=K(e,Et),n=K(e,Bn);return c.useCallback((o,r)=>{const l={},s=r+n+2;return l["aria-rowindex"]=s,e.current.isRowSelectable(o.id)&&(l["aria-selected"]=t[o.id]!==void 0),l},[e,t,n])};function oC({privateApiRef:e,configuration:t,props:n,children:o}){const r=c.useRef(e.current.getPublicApi());return v.jsx(Pi.Provider,{value:t,children:v.jsx(ws.Provider,{value:n,children:v.jsx(Si.Provider,{value:e,children:v.jsx(ps.Provider,{value:r,children:o})})})})}const rC=e=>{const t=c.useRef(null),n=c.useRef(null),o=c.useRef(null),r=c.useRef(null),l=c.useRef(null),s=c.useRef(null);e.current.register("public",{rootElementRef:t}),e.current.register("private",{mainElementRef:n,virtualScrollerRef:o,virtualScrollbarVerticalRef:r,virtualScrollbarHorizontalRef:l,columnHeadersContainerRef:s})},lC=e=>{const t=It();e.current.state.isRtl===void 0&&(e.current.state.isRtl=t);const n=c.useRef(!0);c.useEffect(()=>{n.current?n.current=!1:e.current.setState(o=>h({},o,{isRtl:t}))},[e,t])},sC=ou()&&window.localStorage.getItem("DEBUG")!=null,Tn=()=>{},iC={debug:Tn,info:Tn,warn:Tn,error:Tn},Nl=["debug","info","warn","error"];function jl(e,t,n=console){const o=Nl.indexOf(t);if(o===-1)throw new Error(`MUI X: Log level ${t} not recognized.`);return Nl.reduce((l,s,a)=>(a>=o?l[s]=(...i)=>{const[d,...u]=i;n[s](`MUI X: ${e} - ${d}`,...u)}:l[s]=Tn,l),{})}const cC=(e,t)=>{const n=c.useCallback(o=>sC?jl(o,"debug",t.logger):t.logLevel?jl(o,t.logLevel.toString(),t.logger):iC,[t.logLevel,t.logger]);de(e,{getLogger:n},"private")};class aC{constructor(){this.maxListeners=20,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 s=r.length-1;s>=0;s-=1){const a=r[s];o.highPriority.has(a)&&a.apply(this,n)}for(let s=0;s<l.length;s+=1){const a=l[s];o.regular.has(a)&&a.apply(this,n)}}once(t,n){const o=this;this.on(t,function r(...l){o.removeListener(t,r),n.apply(o,l)})}}class Hr{static create(t){return new Hr(t)}constructor(t){this.value=void 0,this.listeners=void 0,this.subscribe=n=>(this.listeners.add(n),()=>{this.listeners.delete(n)}),this.getSnapshot=()=>this.value,this.update=n=>{this.value=n,this.listeners.forEach(o=>o(n))},this.value=t,this.listeners=new Set}}const Ni=Symbol("mui.api_private"),uC=e=>e.isPropagationStopped!==void 0;let _l=0;function dC(e){var r;const t=(r=e.current)==null?void 0:r[Ni];if(t)return t;const n={},o={state:n,store:Hr.create(n),instanceId:{id:_l}};return _l+=1,o.getPublicApi=()=>e.current,o.register=(l,s)=>{Object.keys(s).forEach(a=>{const i=s[a],d=o[a];if((d==null?void 0:d.spying)===!0?d.target=i:o[a]=i,l==="public"){const u=e.current,g=u[a];(g==null?void 0:g.spying)===!0?g.target=i:u[a]=i}})},o.register("private",{caches:{},eventManager:new aC}),o}function gC(e){return{get state(){return e.current.state},get store(){return e.current.store},get instanceId(){return e.current.instanceId},[Ni]:e.current}}function fC(e,t){var s;const n=c.useRef(null),o=c.useRef(null);o.current||(o.current=dC(n)),n.current||(n.current=gC(o));const r=c.useCallback((...a)=>{const[i,d,u={}]=a;if(u.defaultMuiPrevented=!1,uC(u)&&u.isPropagationStopped())return;const g=t.signature===dt.DataGridPro||t.signature===dt.DataGridPremium?{api:o.current.getPublicApi()}:{};o.current.eventManager.emit(i,d,u,g)},[o,t.signature]),l=c.useCallback((a,i,d)=>{o.current.eventManager.on(a,i,d);const u=o.current;return()=>{u.eventManager.removeListener(a,i)}},[o]);return de(o,{subscribeEvent:l,publishEvent:r},"public"),e&&!((s=e.current)!=null&&s.state)&&(e.current=n.current),c.useImperativeHandle(e,()=>n.current,[n]),c.useEffect(()=>{const a=o.current;return()=>{a.publishEvent("unmount")}},[o]),o}const hC=(e,t)=>{const n=c.useCallback(o=>{if(t.localeText[o]==null)throw new Error(`Missing translation for key ${o}.`);return t.localeText[o]},[t.localeText]);e.current.register("public",{getLocaleText:n})},mC=e=>{const t=c.useRef({}),n=c.useRef(!1),o=c.useCallback(u=>{n.current||!u||(n.current=!0,Object.values(u.appliers).forEach(g=>{g()}),n.current=!1)},[]),r=c.useCallback((u,g,f)=>{t.current[u]||(t.current[u]={processors:new Map,processorsAsArray:[],appliers:{}});const x=t.current[u];return x.processors.get(g)!==f&&(x.processors.set(g,f),x.processorsAsArray=Array.from(t.current[u].processors.values()),o(x)),()=>{t.current[u].processors.delete(g),t.current[u].processorsAsArray=Array.from(t.current[u].processors.values())}},[o]),l=c.useCallback((u,g,f)=>(t.current[u]||(t.current[u]={processors:new Map,processorsAsArray:[],appliers:{}}),t.current[u].appliers[g]=f,()=>{const x=t.current[u].appliers,I=re(x,[g].map(Dn));t.current[u].appliers=I}),[]),s=c.useCallback(u=>{o(t.current[u])},[o]),a=c.useCallback((...u)=>{const[g,f,x]=u;if(!t.current[g])return f;const I=t.current[g].processorsAsArray;let y=f;for(let w=0;w<I.length;w+=1)y=I[w](y,x);return y},[]),i={registerPipeProcessor:r,registerPipeApplier:l,requestPipeProcessorsApplication:s},d={unstable_applyPipeProcessors:a};de(e,i,"private"),de(e,d,"public")},Re=(e,t,n,o=!0)=>{const r=c.useRef(null),l=c.useRef(`mui-${Math.round(Math.random()*1e9)}`),s=c.useCallback(()=>{r.current=e.current.registerPipeProcessor(t,l.current,n)},[e,n,t]);Nn(()=>{o&&s()});const a=c.useRef(!0);c.useEffect(()=>(a.current?a.current=!1:o&&s(),()=>{r.current&&(r.current(),r.current=null)}),[s,o])},Dr=(e,t,n)=>{const o=c.useRef(null),r=c.useRef(`mui-${Math.round(Math.random()*1e9)}`),l=c.useCallback(()=>{o.current=e.current.registerPipeApplier(t,r.current,n)},[e,n,t]);Nn(()=>{l()});const s=c.useRef(!0);c.useEffect(()=>(s.current?s.current=!1:l(),()=>{o.current&&(o.current(),o.current=null)}),[l])},So=(e,t,n,o)=>{const r=c.useCallback(()=>{e.current.registerStrategyProcessor(t,n,o)},[e,o,n,t]);Nn(()=>{r()});const l=c.useRef(!0);c.useEffect(()=>{l.current?l.current=!1:r()},[r])},Wt="none",Bl={rowTreeCreation:"rowTree",filtering:"rowTree",sorting:"rowTree",visibleRowsLookupCreation:"rowTree"},bC=e=>{const t=c.useRef(new Map),n=c.useRef({}),o=c.useCallback((i,d,u)=>{const g=()=>{const I=n.current[d],y=re(I,[i].map(Dn));n.current[d]=y};n.current[d]||(n.current[d]={});const f=n.current[d],x=f[i];return f[i]=u,!x||x===u||i===e.current.getActiveStrategy(Bl[d])&&e.current.publishEvent("activeStrategyProcessorChange",d),g},[e]),r=c.useCallback((i,d)=>{const u=e.current.getActiveStrategy(Bl[i]);if(u==null)throw new Error("Can't apply a strategy processor before defining an active strategy");const g=n.current[i];if(!g||!g[u])throw new Error(`No processor found for processor "${i}" on strategy "${u}"`);const f=g[u];return f(d)},[e]),l=c.useCallback(i=>{const u=Array.from(t.current.entries()).find(([,g])=>g.group!==i?!1:g.isAvailable());return(u==null?void 0:u[0])??Wt},[]),s=c.useCallback((i,d,u)=>{t.current.set(d,{group:i,isAvailable:u}),e.current.publishEvent("strategyAvailabilityChange")},[e]);de(e,{registerStrategyProcessor:o,applyStrategyProcessor:r,getActiveStrategy:l,setStrategyAvailability:s},"private")},CC=e=>{const t=c.useRef({}),n=c.useCallback(i=>{t.current[i.stateId]=i},[]),o=c.useCallback((i,d)=>{let u;if(Gs(i)?u=i(e.current.state):u=i,e.current.state===u)return!1;let g=!1;const f=[];if(Object.keys(t.current).forEach(x=>{const I=t.current[x],y=I.stateSelector(e.current.state,e.current.instanceId),w=I.stateSelector(u,e.current.instanceId);w!==y&&(f.push({stateId:I.stateId,hasPropChanged:w!==I.propModel}),I.propModel!==void 0&&w!==I.propModel&&(g=!0))}),f.length>1)throw new Error(`You're not allowed to update several sub-state in one transaction. You already updated ${f[0].stateId}, therefore, you're not allowed to update ${f.map(x=>x.stateId).join(", ")} in the same transaction.`);if(g||(e.current.state=u,e.current.publishEvent("stateChange",u),e.current.store.update(u)),f.length===1){const{stateId:x,hasPropChanged:I}=f[0],y=t.current[x],w=y.stateSelector(u,e.current.instanceId);y.propOnChange&&I&&y.propOnChange(w,{reason:d,api:e.current}),g||e.current.publishEvent(y.changeEvent,w,{reason:d})}return!g},[e]),r=c.useCallback((i,d,u)=>e.current.setState(g=>h({},g,{[i]:d(g[i])}),u),[e]),l=c.useCallback(()=>{},[]),s={setState:o,forceUpdate:l},a={updateControlState:r,registerControlState:n};de(e,s,"public"),de(e,a,"private")},pC=(e,t)=>{const n=fC(e,t);return rC(n),lC(n),cC(n,t),CC(n),mC(n),bC(n),hC(n,t),n.current.register("private",{rootProps:t}),n},Ke=(e,t,n)=>{const o=c.useRef(!1);o.current||(t.current.state=e(t.current.state,n,t),o.current=!0)};function Jo(e,t){if(e==null)return"";const n=typeof e=="string"?e:`${e}`;if(t.shouldAppendQuotes||t.escapeFormulas){const o=n.replace(/"/g,'""');return t.escapeFormulas&&["=","+","-","@","	","\r"].includes(o[0])?`"'${o}"`:[t.delimiter,`
`,"\r",'"'].some(r=>n.includes(r))?`"${o}"`:o}return n}const ji=(e,t)=>{var l,s;const{csvOptions:n,ignoreValueFormatter:o}=t;let r;if(o){const a=e.colDef.type;a==="number"?r=String(e.value):a==="date"||a==="dateTime"?r=(l=e.value)==null?void 0:l.toISOString():typeof((s=e.value)==null?void 0:s.toString)=="function"?r=e.value.toString():r=e.value}else r=e.formattedValue;return Jo(r,n)};class er{constructor(t){this.options=void 0,this.rowString="",this.isEmpty=!0,this.options=t}addValue(t){this.isEmpty||(this.rowString+=this.options.csvOptions.delimiter),typeof this.options.sanitizeCellValue=="function"?this.rowString+=this.options.sanitizeCellValue(t,this.options.csvOptions):this.rowString+=t,this.isEmpty=!1}getRowString(){return this.rowString}}const wC=({id:e,columns:t,getCellParams:n,csvOptions:o,ignoreValueFormatter:r})=>{const l=new er({csvOptions:o});return t.forEach(s=>{const a=n(e,s.field);l.addValue(ji(a,{ignoreValueFormatter:r,csvOptions:o}))}),l.getRowString()};function SC(e){const{columns:t,rowIds:n,csvOptions:o,ignoreValueFormatter:r,apiRef:l}=e,s=n.reduce((g,f)=>`${g}${wC({id:f,columns:t,getCellParams:l.current.getCellParams,ignoreValueFormatter:r,csvOptions:o})}\r
`,"").trim();if(!o.includeHeaders)return s;const a=t.filter(g=>g.field!==Sn.field),i=[];if(o.includeColumnGroupsHeaders){const g=l.current.getAllGroupDetails();let f=0;const x=a.reduce((I,y)=>{const w=l.current.getColumnGroupPath(y.field);return I[y.field]=w,f=Math.max(f,w.length),I},{});for(let I=0;I<f;I+=1){const y=new er({csvOptions:o,sanitizeCellValue:Jo});i.push(y),a.forEach(w=>{const m=(x[w.field]||[])[I],p=g[m];y.addValue(p?p.headerName||p.groupId:"")})}}const d=new er({csvOptions:o,sanitizeCellValue:Jo});return a.forEach(g=>{d.addValue(g.headerName||g.field)}),i.push(d),`${`${i.map(g=>g.getRowString()).join(`\r
`)}\r
`}${s}`.trim()}function Wl(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 xC(e){navigator.clipboard?navigator.clipboard.writeText(e).catch(()=>{Wl(e)}):Wl(e)}function vC(e){var t;return!!((t=window.getSelection())!=null&&t.toString()||e&&(e.selectionEnd||0)-(e.selectionStart||0)>0)}const yC=(e,t)=>{const n=t.ignoreValueFormatterDuringExport,o=(typeof n=="object"?n==null?void 0:n.clipboardExport:n)||!1,r=t.clipboardCopyCellDelimiter,l=c.useCallback(s=>{if(!vm(s)||vC(s.target))return;let a="";if(e.current.getSelectedRows().size>0)a=e.current.getDataAsCsv({includeHeaders:!1,delimiter:r,shouldAppendQuotes:!1,escapeFormulas:!1});else{const d=ot(e);if(d){const u=e.current.getCellParams(d.id,d.field);a=ji(u,{csvOptions:{delimiter:r,shouldAppendQuotes:!1,escapeFormulas:!1},ignoreValueFormatter:o})}}a=e.current.unstable_applyPipeProcessors("clipboardCopy",a),a&&(xC(a),e.current.publishEvent("clipboardCopy",a))},[e,o,r]);oi(e,e.current.rootElementRef,"keydown",l),Te(e,"clipboardCopy",t.onClipboardCopy)},IC=e=>h({},e,{columnMenu:{open:!1}}),PC=e=>{const t=Ue(e,"useGridColumnMenu"),n=c.useCallback(s=>{const a=lo(e.current.state),i={open:!0,field:s};(i.open!==a.open||i.field!==a.field)&&(e.current.setState(u=>u.columnMenu.open&&u.columnMenu.field===s?u:(t.debug("Opening Column Menu"),h({},u,{columnMenu:{open:!0,field:s}}))),e.current.hidePreferences())},[e,t]),o=c.useCallback(()=>{const s=lo(e.current.state);if(s.field){const d=Tt(e),u=at(e),g=kt(e);let f=s.field;if(d[f]||(f=g[0]),u[f]===!1){const x=g.filter(y=>y===f?!0:u[y]!==!1),I=x.indexOf(f);f=x[I+1]||x[I-1]}e.current.setColumnHeaderFocus(f)}const a={open:!1,field:void 0};(a.open!==s.open||a.field!==s.field)&&e.current.setState(d=>(t.debug("Hiding Column Menu"),h({},d,{columnMenu:a})))},[e,t]),r=c.useCallback(s=>{t.debug("Toggle Column Menu");const a=lo(e.current.state);!a.open||a.field!==s?n(s):o()},[e,t,n,o]);de(e,{showColumnMenu:n,hideColumnMenu:o,toggleColumnMenu:r},"public"),ee(e,"columnResizeStart",o),ee(e,"virtualScrollerWheel",e.current.hideColumnMenu),ee(e,"virtualScrollerTouchMove",e.current.hideColumnMenu)},MC=(e,t,n)=>{var r,l,s;const o=Zt({apiRef:n,columnsToUpsert:t.columns,initialState:(r=t.initialState)==null?void 0:r.columns,columnVisibilityModel:t.columnVisibilityModel??((s=(l=t.initialState)==null?void 0:l.columns)==null?void 0:s.columnVisibilityModel)??{},keepOnlyColumnsToUpsert:!0});return h({},e,{columns:o,pinnedColumns:e.pinnedColumns??go})};function kC(e,t){var D,z;const n=Ue(e,"useGridColumns"),o=c.useRef(t.columns);e.current.registerControlState({stateId:"visibleColumns",propModel:t.columnVisibilityModel,propOnChange:t.onColumnVisibilityModelChange,stateSelector:at,changeEvent:"columnVisibilityModelChange"});const r=c.useCallback(F=>{var T,G;n.debug("Updating columns state."),e.current.setState(Ul(F)),e.current.publishEvent("columnsChange",F.orderedFields),(G=(T=e.current).updateRenderContext)==null||G.call(T),e.current.forceUpdate()},[n,e]),l=c.useCallback(F=>Tt(e)[F],[e]),s=c.useCallback(()=>Ct(e),[e]),a=c.useCallback(()=>je(e),[e]),i=c.useCallback((F,T=!0)=>(T?je(e):Ct(e)).findIndex(M=>M.field===F),[e]),d=c.useCallback(F=>{const T=i(F);return Vt(e)[T]},[e,i]),u=c.useCallback(F=>{var G,M;at(e)!==F&&(e.current.setState(b=>h({},b,{columns:Zt({apiRef:e,columnsToUpsert:[],initialState:void 0,columnVisibilityModel:F,keepOnlyColumnsToUpsert:!1})})),(M=(G=e.current).updateRenderContext)==null||M.call(G),e.current.forceUpdate())},[e]),g=c.useCallback(F=>{const T=Zt({apiRef:e,columnsToUpsert:F,initialState:void 0,keepOnlyColumnsToUpsert:!1});r(T)},[e,r]),f=c.useCallback((F,T)=>{const G=at(e),M=G[F]??!0;if(T!==M){const b=h({},G,{[F]:T});e.current.setColumnVisibilityModel(b)}},[e]),x=c.useCallback(F=>kt(e).findIndex(G=>G===F),[e]),I=c.useCallback((F,T)=>{const G=kt(e),M=x(F);if(M===T)return;n.debug(`Moving column ${F} to index ${T}`);const b=[...G],C=b.splice(M,1)[0];b.splice(T,0,C),r(h({},xt(e.current.state),{orderedFields:b}));const $={column:e.current.getColumn(F),targetIndex:e.current.getColumnIndexRelativeToVisibleColumns(F),oldIndex:M};e.current.publishEvent("columnIndexChange",$)},[e,n,r,x]),y=c.useCallback((F,T)=>{n.debug(`Updating column ${F} width to ${T}`);const G=xt(e.current.state),M=G.lookup[F],b=h({},M,{width:T,hasBeenResized:!0});r(Yo(h({},G,{lookup:h({},G.lookup,{[F]:b})}),e.current.getRootDimensions())),e.current.publishEvent("columnWidthChange",{element:e.current.getColumnHeaderElement(F),colDef:b,width:T})},[e,n,r]),w={getColumn:l,getAllColumns:s,getColumnIndex:i,getColumnPosition:d,getVisibleColumns:a,getColumnIndexRelativeToVisibleColumns:x,updateColumns:g,setColumnVisibilityModel:u,setColumnVisibility:f,setColumnWidth:y},m={setColumnIndex:I};de(e,w,"public"),de(e,m,t.signature===dt.DataGrid?"private":"public");const p=c.useCallback((F,T)=>{var k,O;const G={},M=at(e);(!T.exportOnlyDirtyModels||t.columnVisibilityModel!=null||Object.keys(((O=(k=t.initialState)==null?void 0:k.columns)==null?void 0:O.columnVisibilityModel)??{}).length>0||Object.keys(M).length>0)&&(G.columnVisibilityModel=M),G.orderedFields=kt(e);const C=Ct(e),$={};return C.forEach(j=>{if(j.hasBeenResized){const N={};bi.forEach(_=>{let U=j[_];U===1/0&&(U=-1),N[_]=U}),$[j.field]=N}}),Object.keys($).length>0&&(G.dimensions=$),h({},F,{columns:G})},[e,t.columnVisibilityModel,(D=t.initialState)==null?void 0:D.columns]),E=c.useCallback((F,T)=>{var C;const G=(C=T.stateToRestore.columns)==null?void 0:C.columnVisibilityModel,M=T.stateToRestore.columns;if(G==null&&M==null)return F;const b=Zt({apiRef:e,columnsToUpsert:[],initialState:M,columnVisibilityModel:G,keepOnlyColumnsToUpsert:!1});return e.current.setState(Ul(b)),M!=null&&e.current.publishEvent("columnsChange",b.orderedFields),F},[e]),R=c.useCallback((F,T)=>{var G;if(T===Bt.columns){const M=t.slots.columnsPanel;return v.jsx(M,h({},(G=t.slotProps)==null?void 0:G.columnsPanel))}return F},[t.slots.columnsPanel,(z=t.slotProps)==null?void 0:z.columnsPanel]),H=c.useCallback(F=>t.disableColumnSelector?F:[...F,"columnMenuColumnsItem"],[t.disableColumnSelector]);Re(e,"columnMenu",H),Re(e,"exportState",p),Re(e,"restoreState",E),Re(e,"preferencePanel",R);const V=c.useRef(null);ee(e,"viewportInnerSizeChange",F=>{if(V.current!==F.width){if(V.current=F.width,!je(e).some(G=>G.flex&&G.flex>0))return;r(Yo(xt(e.current.state),e.current.getRootDimensions()))}});const L=c.useCallback(()=>{n.info("Columns pipe processing have changed, regenerating the columns");const F=Zt({apiRef:e,columnsToUpsert:[],initialState:void 0,keepOnlyColumnsToUpsert:!1});r(F)},[e,n,r]);Dr(e,"hydrateColumns",L);const P=c.useRef(!0);c.useEffect(()=>{if(P.current){P.current=!1;return}if(n.info(`GridColumns have changed, new length ${t.columns.length}`),o.current===t.columns)return;const F=Zt({apiRef:e,initialState:void 0,columnsToUpsert:t.columns,keepOnlyColumnsToUpsert:!0});o.current=t.columns,r(F)},[n,e,r,t.columns]),c.useEffect(()=>{t.columnVisibilityModel!==void 0&&e.current.setColumnVisibilityModel(t.columnVisibilityModel)},[e,n,t.columnVisibilityModel])}function Ul(e){return t=>h({},t,{columns:e})}const EC=(e,t)=>{var n;return h({},e,{density:((n=t.initialState)==null?void 0:n.density)??t.density??"standard"})},FC=(e,t)=>{var a;const n=Ue(e,"useDensity");e.current.registerControlState({stateId:"density",propModel:t.density,propOnChange:t.onDensityChange,stateSelector:en,changeEvent:"densityChange"});const r={setDensity:ze(i=>{en(e.current.state)!==i&&(n.debug(`Set grid density to ${i}`),e.current.setState(u=>h({},u,{density:i})))})};de(e,r,"public");const l=c.useCallback((i,d)=>{var f;const u=en(e.current.state);return!d.exportOnlyDirtyModels||t.density!=null||((f=t.initialState)==null?void 0:f.density)!=null?h({},i,{density:u}):i},[e,t.density,(a=t.initialState)==null?void 0:a.density]),s=c.useCallback((i,d)=>{var g;const u=(g=d.stateToRestore)!=null&&g.density?d.stateToRestore.density:en(e.current.state);return e.current.setState(f=>h({},f,{density:u})),i},[e]);Re(e,"exportState",l),Re(e,"restoreState",s),c.useEffect(()=>{t.density&&e.current.setDensity(t.density)},[e,t.density])};function TC(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 X: exportAs not supported.")}const _i=({apiRef:e,options:t})=>{const n=Ct(e);return t.fields?t.fields.reduce((r,l)=>{const s=n.find(a=>a.field===l);return s&&r.push(s),r},[]):(t.allColumns?n:je(e)).filter(r=>!r.disableExport)},Bi=({apiRef:e})=>{var i,d;const t=Js(e),n=Ze(e),o=e.current.getSelectedRows(),r=t.filter(u=>n[u].type!=="footer"),l=Cn(e),s=((i=l==null?void 0:l.top)==null?void 0:i.map(u=>u.id))||[],a=((d=l==null?void 0:l.bottom)==null?void 0:d.map(u=>u.id))||[];return r.unshift(...s),r.push(...a),o.size>0?r.filter(u=>o.has(u)):r},HC=(e,t)=>{const n=Ue(e,"useGridCsvExport"),o=t.ignoreValueFormatterDuringExport,r=(typeof o=="object"?o==null?void 0:o.csvExport:o)||!1,l=c.useCallback((d={})=>{n.debug("Get data as CSV");const u=_i({apiRef:e,options:d}),f=(d.getRowsToExport??Bi)({apiRef:e});return SC({columns:u,rowIds:f,csvOptions:{delimiter:d.delimiter||",",shouldAppendQuotes:d.shouldAppendQuotes??!0,includeHeaders:d.includeHeaders??!0,includeColumnGroupsHeaders:d.includeColumnGroupsHeaders??!0,escapeFormulas:d.escapeFormulas??!0},ignoreValueFormatter:r,apiRef:e})},[n,e,r]),s=c.useCallback(d=>{n.debug("Export data as CSV");const u=l(d),g=new Blob([d!=null&&d.utf8WithBom?new Uint8Array([239,187,191]):"",u],{type:"text/csv"});TC(g,"csv",d==null?void 0:d.fileName)},[n,l]);de(e,{getDataAsCsv:l,exportDataAsCsv:s},"public");const i=c.useCallback((d,u)=>{var g;return(g=u.csvOptions)!=null&&g.disableToolbarButton?d:[...d,{component:v.jsx(kb,{options:u.csvOptions}),componentName:"csvExport"}]},[]);Re(e,"exportMenu",i)},so=(e,t,n)=>{let o=e.paginationModel;const r=e.rowCount,l=(n==null?void 0:n.pageSize)??o.pageSize,s=(n==null?void 0:n.page)??o.page,a=ri(r,l,s);n&&((n==null?void 0:n.page)!==o.page||(n==null?void 0:n.pageSize)!==o.pageSize)&&(o=n);const i=Sd(o.page,a);return i!==o.page&&(o=h({},o,{page:i})),si(o.pageSize,t),o},DC=(e,t)=>{var y,w;const n=Ue(e,"useGridPaginationModel"),o=K(e,hn),r=Math.floor(t.rowHeight*o);e.current.registerControlState({stateId:"paginationModel",propModel:t.paginationModel,propOnChange:t.onPaginationModelChange,stateSelector:et,changeEvent:"paginationModelChange"});const l=c.useCallback(m=>{const p=et(e);m!==p.page&&(n.debug(`Setting page to ${m}`),e.current.setPaginationModel({page:m,pageSize:p.pageSize}))},[e,n]),s=c.useCallback(m=>{const p=et(e);m!==p.pageSize&&(n.debug(`Setting page size to ${m}`),e.current.setPaginationModel({pageSize:m,page:p.page}))},[e,n]),a=c.useCallback(m=>{const p=et(e);m!==p&&(n.debug("Setting 'paginationModel' to",m),e.current.setState(E=>h({},E,{pagination:h({},E.pagination,{paginationModel:so(E.pagination,t.signature,m)})}),"setPaginationModel"))},[e,n,t.signature]);de(e,{setPage:l,setPageSize:s,setPaginationModel:a},"public");const d=c.useCallback((m,p)=>{var H,V;const E=et(e);return!p.exportOnlyDirtyModels||t.paginationModel!=null||((V=(H=t.initialState)==null?void 0:H.pagination)==null?void 0:V.paginationModel)!=null||E.page!==0&&E.pageSize!==wd(t.autoPageSize)?h({},m,{pagination:h({},m.pagination,{paginationModel:E})}):m},[e,t.paginationModel,(w=(y=t.initialState)==null?void 0:y.pagination)==null?void 0:w.paginationModel,t.autoPageSize]),u=c.useCallback((m,p)=>{var R,H;const E=(R=p.stateToRestore.pagination)!=null&&R.paginationModel?h({},li(t.autoPageSize),(H=p.stateToRestore.pagination)==null?void 0:H.paginationModel):et(e);return e.current.setState(V=>h({},V,{pagination:h({},V.pagination,{paginationModel:so(V.pagination,t.signature,E)})}),"stateRestorePreProcessing"),m},[e,t.autoPageSize,t.signature]);Re(e,"exportState",d),Re(e,"restoreState",u);const g=()=>{var p;const m=et(e);(p=e.current.virtualScrollerRef)!=null&&p.current&&e.current.scrollToIndexes({rowIndex:m.page*m.pageSize})},f=c.useCallback(()=>{if(!t.autoPageSize)return;const m=e.current.getRootDimensions(),p=Math.floor(m.viewportInnerSize.height/r);e.current.setPageSize(p)},[e,t.autoPageSize,r]),x=c.useCallback(m=>{if(m==null)return;const p=et(e),E=ai(e);p.page>E-1&&e.current.setPage(Math.max(0,E-1))},[e]);ee(e,"viewportInnerSizeChange",f),ee(e,"paginationModelChange",g),ee(e,"rowCountChange",x);const I=c.useRef(!0);c.useEffect(()=>{if(I.current){I.current=!1;return}t.pagination&&e.current.setState(m=>h({},m,{pagination:h({},m.pagination,{paginationModel:so(m.pagination,t.signature,t.paginationModel)})}))},[e,t.paginationModel,t.signature,t.pagination]),c.useEffect(()=>{e.current.setState(m=>{const p=t.pagination===!0;return m.pagination.paginationMode===t.paginationMode||m.pagination.enabled===p?m:h({},m,{pagination:h({},m.pagination,{paginationMode:t.paginationMode,enabled:t.pagination===!0})})})},[e,t.paginationMode,t.pagination]),c.useEffect(f,[f])};function OC(){return new Promise(e=>{requestAnimationFrame(()=>{e()})})}function LC(e){const t=document.createElement("iframe");return t.style.position="absolute",t.style.width="0px",t.style.height="0px",t.title=e||document.title,t}const GC=(e,t)=>{const n=e.current.rootElementRef.current!==null,o=Ue(e,"useGridPrintExport"),r=c.useRef(null),l=c.useRef(null),s=c.useRef({}),a=c.useRef([]),i=c.useRef(null);c.useEffect(()=>{r.current=Rt(e.current.rootElementRef.current)},[e,n]);const d=c.useCallback((w,m,p)=>new Promise(E=>{const R=_i({apiRef:e,options:{fields:w,allColumns:m}}).map(A=>A.field),H=Ct(e),V={};H.forEach(A=>{V[A.field]=R.includes(A.field)}),p&&(V[Sn.field]=!0),e.current.setColumnVisibilityModel(V),E()}),[e]),u=c.useCallback(w=>{const p=w({apiRef:e}).reduce((E,R)=>{const H=e.current.getRow(R);return H[sn]||E.push(H),E},[]);e.current.setRows(p)},[e]),g=c.useCallback((w,m)=>{var G,M,b,C;const p=h({copyStyles:!0,hideToolbar:!1,hideFooter:!1,includeCheckboxes:!1},m),E=w.contentDocument;if(!E)return;const R=Wn(e.current.state),H=e.current.rootElementRef.current,V=H.cloneNode(!0),A=V.querySelector(`.${S.main}`);A.style.overflow="visible",V.style.contain="size";let L=((G=H.querySelector(`.${S.toolbarContainer}`))==null?void 0:G.offsetHeight)||0,P=((M=H.querySelector(`.${S.footerContainer}`))==null?void 0:M.offsetHeight)||0;p.hideToolbar&&((b=V.querySelector(`.${S.toolbarContainer}`))==null||b.remove(),L=0),p.hideFooter&&((C=V.querySelector(`.${S.footerContainer}`))==null||C.remove(),P=0);const D=R.currentPageTotalHeight+Ir(e,t)+L+P;if(V.style.height=`${D}px`,V.style.boxSizing="content-box",!p.hideFooter){const $=V.querySelector(`.${S.footerContainer}`);$.style.position="absolute",$.style.width="100%",$.style.top=`${D-P}px`}const z=document.createElement("div");z.appendChild(V),E.body.style.marginTop="0px",E.body.innerHTML=z.innerHTML;const F=typeof p.pageStyle=="function"?p.pageStyle():p.pageStyle;if(typeof F=="string"){const $=E.createElement("style");$.appendChild(E.createTextNode(F)),E.head.appendChild($)}p.bodyClassName&&E.body.classList.add(...p.bodyClassName.split(" "));const T=[];if(p.copyStyles){const $=H.getRootNode(),O=($.constructor.name==="ShadowRoot"?$:r.current).querySelectorAll("style, link[rel='stylesheet']");for(let j=0;j<O.length;j+=1){const N=O[j];if(N.tagName==="STYLE"){const _=E.createElement(N.tagName),U=N.sheet;if(U){let q="";for(let W=0;W<U.cssRules.length;W+=1)typeof U.cssRules[W].cssText=="string"&&(q+=`${U.cssRules[W].cssText}\r
`);_.appendChild(E.createTextNode(q)),E.head.appendChild(_)}}else if(N.getAttribute("href")){const _=E.createElement(N.tagName);for(let U=0;U<N.attributes.length;U+=1){const q=N.attributes[U];q&&_.setAttribute(q.nodeName,q.nodeValue||"")}T.push(new Promise(U=>{_.addEventListener("load",()=>U())})),E.head.appendChild(_)}}}Promise.all(T).then(()=>{w.contentWindow.print()})},[e,r,t]),f=c.useCallback(w=>{var m,p;r.current.body.removeChild(w),e.current.restoreState(l.current||{}),(p=(m=l.current)==null?void 0:m.columns)!=null&&p.columnVisibilityModel||e.current.setColumnVisibilityModel(s.current),e.current.setState(E=>h({},E,{virtualization:i.current})),e.current.setRows(a.current),l.current=null,s.current={},a.current=[]},[e]),I={exportDataAsPrint:c.useCallback(async w=>{if(o.debug("Export data as Print"),!e.current.rootElementRef.current)throw new Error("MUI X: No grid root element available.");if(l.current=e.current.exportState(),s.current=at(e),a.current=e.current.getSortedRows().filter(p=>!p[sn]),t.pagination){const E={page:0,pageSize:pr(e)};e.current.setState(R=>h({},R,{pagination:h({},R.pagination,{paginationModel:so(R.pagination,"DataGridPro",E)})}))}i.current=e.current.state.virtualization,e.current.setState(p=>h({},p,{virtualization:h({},p.virtualization,{enabled:!1,enabledForColumns:!1})})),await d(w==null?void 0:w.fields,w==null?void 0:w.allColumns,w==null?void 0:w.includeCheckboxes),u((w==null?void 0:w.getRowsToExport)??Bi),await OC();const m=LC(w==null?void 0:w.fileName);m.onload=()=>{g(m,w),m.contentWindow.matchMedia("print").addEventListener("change",E=>{E.matches===!1&&f(m)})},r.current.body.appendChild(m)},[t,o,e,g,f,d,u])};de(e,I,"public");const y=c.useCallback((w,m)=>{var p;return(p=m.printOptions)!=null&&p.disableToolbarButton?w:[...w,{component:v.jsx(Eb,{options:m.printOptions}),componentName:"printExport"}]},[]);Re(e,"exportMenu",y)},RC=(e,t,n)=>{var r,l;const o=t.filterModel??((l=(r=t.initialState)==null?void 0:r.filter)==null?void 0:l.filterModel)??Ln();return h({},e,{filter:h({filterModel:hr(o,t.disableMultipleColumnsFiltering,n)},Vs),visibleRowsLookup:{}})},$C=e=>e.filteredRowsLookup;function Kl(e,t){return e.current.applyStrategyProcessor("visibleRowsLookupCreation",{tree:t.rows.tree,filteredRowsLookup:t.filter.filteredRowsLookup})}function zC(){return Ss(Object.values)}const VC=(e,t)=>{var P,D,z;const n=Ue(e,"useGridFilter");e.current.registerControlState({stateId:"filter",propModel:t.filterModel,propOnChange:t.onFilterModelChange,stateSelector:Xe,changeEvent:"filterModelChange"});const o=c.useCallback(()=>{e.current.setState(F=>{const T=Xe(F,e.current.instanceId),G=e.current.getFilterState(T),M=h({},F,{filter:h({},F.filter,G)}),b=Kl(e,M);return h({},M,{visibleRowsLookup:b})}),e.current.publishEvent("filteredRowsSet")},[e]),r=c.useCallback((F,T)=>T==null||T.filterable===!1||t.disableColumnFilter?F:[...F,"columnMenuFilterItem"],[t.disableColumnFilter]),l=c.useCallback(()=>{o(),e.current.forceUpdate()},[e,o]),s=c.useCallback(F=>{const T=Xe(e),G=[...T.items],M=G.findIndex(b=>b.id===F.id);M===-1?G.push(F):G[M]=F,e.current.setFilterModel(h({},T,{items:G}),"upsertFilterItem")},[e]),a=c.useCallback(F=>{const T=Xe(e),G=[...T.items];F.forEach(M=>{const b=G.findIndex(C=>C.id===M.id);b===-1?G.push(M):G[b]=M}),e.current.setFilterModel(h({},T,{items:G}),"upsertFilterItems")},[e]),i=c.useCallback(F=>{const T=Xe(e),G=T.items.filter(M=>M.id!==F.id);G.length!==T.items.length&&e.current.setFilterModel(h({},T,{items:G}),"deleteFilterItem")},[e]),d=c.useCallback((F,T,G)=>{if(n.debug("Displaying filter panel"),F){const M=Xe(e),b=M.items.filter(O=>{var U;if(O.value!==void 0)return!(Array.isArray(O.value)&&O.value.length===0);const N=(U=e.current.getColumn(O.field).filterOperators)==null?void 0:U.find(q=>q.value===O.operator);return!(typeof(N==null?void 0:N.requiresFilterValue)>"u"?!0:N==null?void 0:N.requiresFilterValue)});let C;const $=b.find(O=>O.field===F),k=e.current.getColumn(F);$?C=b:t.disableMultipleColumnsFiltering?C=[Xo({field:F,operator:k.filterOperators[0].value},e)]:C=[...b,Xo({field:F,operator:k.filterOperators[0].value},e)],e.current.setFilterModel(h({},M,{items:C}))}e.current.showPreferences(Bt.filters,T,G)},[e,n,t.disableMultipleColumnsFiltering]),u=c.useCallback(()=>{n.debug("Hiding filter panel"),e.current.hidePreferences()},[e,n]),g=c.useCallback(F=>{const T=Xe(e);T.logicOperator!==F&&e.current.setFilterModel(h({},T,{logicOperator:F}),"changeLogicOperator")},[e]),f=c.useCallback(F=>{const T=Xe(e);jt(T.quickFilterValues,F)||e.current.setFilterModel(h({},T,{quickFilterValues:[...F]}))},[e]),x=c.useCallback((F,T)=>{Xe(e)!==F&&(n.debug("Setting filter model"),e.current.updateControlState("filter",ol(F,t.disableMultipleColumnsFiltering,e),T),e.current.unstable_applyFilters())},[e,n,t.disableMultipleColumnsFiltering]),I=c.useCallback(F=>{const T=hr(F,t.disableMultipleColumnsFiltering,e),G=t.filterMode==="client"?bu(T,e,t.disableEval):null,M=e.current.applyStrategyProcessor("filtering",{isRowMatchingFilters:G,filterModel:T??Ln()});return h({},M,{filterModel:T})},[t.disableMultipleColumnsFiltering,t.filterMode,t.disableEval,e]),y={setFilterLogicOperator:g,unstable_applyFilters:l,deleteFilterItem:i,upsertFilterItem:s,upsertFilterItems:a,setFilterModel:x,showFilterPanel:d,hideFilterPanel:u,setQuickFilterValues:f,ignoreDiacritics:t.ignoreDiacritics,getFilterState:I};de(e,y,"public");const w=c.useCallback((F,T)=>{var b,C;const G=Xe(e);return!T.exportOnlyDirtyModels||t.filterModel!=null||((C=(b=t.initialState)==null?void 0:b.filter)==null?void 0:C.filterModel)!=null||!jt(G,Ln())?h({},F,{filter:{filterModel:G}}):F},[e,t.filterModel,(D=(P=t.initialState)==null?void 0:P.filter)==null?void 0:D.filterModel]),m=c.useCallback((F,T)=>{var M;const G=(M=T.stateToRestore.filter)==null?void 0:M.filterModel;return G==null?F:(e.current.updateControlState("filter",ol(G,t.disableMultipleColumnsFiltering,e),"restoreState"),h({},F,{callbacks:[...F.callbacks,e.current.unstable_applyFilters]}))},[e,t.disableMultipleColumnsFiltering]),p=c.useCallback((F,T)=>{var G;if(T===Bt.filters){const M=t.slots.filterPanel;return v.jsx(M,h({},(G=t.slotProps)==null?void 0:G.filterPanel))}return F},[t.slots.filterPanel,(z=t.slotProps)==null?void 0:z.filterPanel]),{getRowId:E}=t,R=yt(zC),H=c.useCallback(F=>{var j;if(t.filterMode!=="client"||!F.isRowMatchingFilters||!F.filterModel.items.length&&!((j=F.filterModel.quickFilterValues)!=null&&j.length))return Vs;const T=ut(e),G={},{isRowMatchingFilters:M}=F,b={},C={passingFilterItems:null,passingQuickFilterValues:null},$=R.current(e.current.state.rows.dataRowIdToModelLookup);for(let N=0;N<$.length;N+=1){const _=$[N],U=E?E(_):_.id;M(_,void 0,C);const q=pu([C.passingFilterItems],[C.passingQuickFilterValues],F.filterModel,e,b);G[U]=q}const k="auto-generated-group-footer-root";return T[k]&&(G[k]=!0),{filteredRowsLookup:G,filteredChildrenCountLookup:{},filteredDescendantCountLookup:{}}},[e,t.filterMode,E,R]);Re(e,"columnMenu",r),Re(e,"exportState",w),Re(e,"restoreState",m),Re(e,"preferencePanel",p),So(e,Wt,"filtering",H),So(e,Wt,"visibleRowsLookupCreation",$C);const V=c.useCallback(()=>{n.debug("onColUpdated - GridColumns changed, applying filters");const F=Xe(e),T=Tt(e),G=F.items.filter(M=>M.field&&T[M.field]);G.length<F.items.length&&e.current.setFilterModel(h({},F,{items:G}))},[e,n]),A=c.useCallback(F=>{F==="filtering"&&e.current.unstable_applyFilters()},[e]),L=c.useCallback(()=>{e.current.setState(F=>h({},F,{visibleRowsLookup:Kl(e,F)})),e.current.forceUpdate()},[e]);ee(e,"rowsSet",o),ee(e,"columnsChange",V),ee(e,"activeStrategyProcessorChange",A),ee(e,"rowExpansionChange",L),ee(e,"columnVisibilityModelChange",()=>{const F=Xe(e);F.quickFilterValues&&_s(F)&&e.current.unstable_applyFilters()}),Nn(()=>{e.current.unstable_applyFilters()}),Je(()=>{t.filterModel!==void 0&&e.current.setFilterModel(t.filterModel)},[e,n,t.filterModel])},AC=e=>h({},e,{focus:{cell:null,columnHeader:null,columnHeaderFilter:null,columnGroupHeader:null},tabIndex:{cell:null,columnHeader:null,columnHeaderFilter:null,columnGroupHeader:null}}),NC=(e,t)=>{const n=Ue(e,"useGridFocus"),o=c.useRef(null),r=e.current.rootElementRef.current!==null,l=c.useCallback((L,P)=>{L&&e.current.getRow(L.id)&&e.current.publishEvent("cellFocusOut",e.current.getCellParams(L.id,L.field),P)},[e]),s=c.useCallback((L,P)=>{const D=ot(e);(D==null?void 0:D.id)===L&&(D==null?void 0:D.field)===P||(e.current.setState(z=>(n.debug(`Focusing on cell with id=${L} and field=${P}`),h({},z,{tabIndex:{cell:{id:L,field:P},columnHeader:null,columnHeaderFilter:null,columnGroupHeader:null},focus:{cell:{id:L,field:P},columnHeader:null,columnHeaderFilter:null,columnGroupHeader:null}}))),e.current.forceUpdate(),e.current.getRow(L)&&(D&&l(D,{}),e.current.publishEvent("cellFocusIn",e.current.getCellParams(L,P))))},[e,n,l]),a=c.useCallback((L,P={})=>{const D=ot(e);l(D,P),e.current.setState(z=>(n.debug(`Focusing on column header with colIndex=${L}`),h({},z,{tabIndex:{columnHeader:{field:L},columnHeaderFilter:null,cell:null,columnGroupHeader:null},focus:{columnHeader:{field:L},columnHeaderFilter:null,cell:null,columnGroupHeader:null}}))),e.current.forceUpdate()},[e,n,l]),i=c.useCallback((L,P={})=>{const D=ot(e);l(D,P),e.current.setState(z=>(n.debug(`Focusing on column header filter with colIndex=${L}`),h({},z,{tabIndex:{columnHeader:null,columnHeaderFilter:{field:L},cell:null,columnGroupHeader:null},focus:{columnHeader:null,columnHeaderFilter:{field:L},cell:null,columnGroupHeader:null}}))),e.current.forceUpdate()},[e,n,l]),d=c.useCallback((L,P,D={})=>{const z=ot(e);z&&e.current.publishEvent("cellFocusOut",e.current.getCellParams(z.id,z.field),D),e.current.setState(F=>h({},F,{tabIndex:{columnGroupHeader:{field:L,depth:P},columnHeader:null,columnHeaderFilter:null,cell:null},focus:{columnGroupHeader:{field:L,depth:P},columnHeader:null,columnHeaderFilter:null,cell:null}})),e.current.forceUpdate()},[e]),u=c.useCallback(()=>fo(e),[e]),g=c.useCallback((L,P,D)=>{let z=e.current.getColumnIndex(P);const F=je(e),T=$t(e,{pagination:t.pagination,paginationMode:t.paginationMode}),G=Cn(e),M=[].concat(G.top||[],T.rows,G.bottom||[]);let b=M.findIndex(O=>O.id===L);D==="right"?z+=1:D==="left"?z-=1:b+=1,z>=F.length?(b+=1,b<M.length&&(z=0)):z<0&&(b-=1,b>=0&&(z=F.length-1)),b=lt(b,0,M.length-1);const C=M[b];if(!C)return;const $=e.current.unstable_getCellColSpanInfo(C.id,z);$&&$.spannedByColSpan&&(D==="left"||D==="below"?z=$.leftVisibleCellIndex:D==="right"&&(z=$.rightVisibleCellIndex)),z=lt(z,0,F.length-1);const k=F[z];e.current.setCellFocus(C.id,k.field)},[e,t.pagination,t.paginationMode]),f=c.useCallback(({id:L,field:P})=>{e.current.setCellFocus(L,P)},[e]),x=c.useCallback((L,P)=>{P.key==="Enter"||P.key==="Tab"||P.key==="Shift"||Co(P.key)||e.current.setCellFocus(L.id,L.field)},[e]),I=c.useCallback(({field:L},P)=>{P.target===P.currentTarget&&e.current.setColumnHeaderFocus(L,P)},[e]),y=c.useCallback(({fields:L,depth:P},D)=>{if(D.target!==D.currentTarget)return;const z=fo(e);z!==null&&z.depth===P&&L.includes(z.field)||e.current.setColumnGroupHeaderFocus(L[0],P,D)},[e]),w=c.useCallback((L,P)=>{var D,z;(z=(D=P.relatedTarget)==null?void 0:D.getAttribute("class"))!=null&&z.includes(S.columnHeader)||(n.debug("Clearing focus"),e.current.setState(F=>h({},F,{focus:{cell:null,columnHeader:null,columnHeaderFilter:null,columnGroupHeader:null}})))},[n,e]),m=c.useCallback(L=>{o.current=L},[]),p=c.useCallback(L=>{const P=o.current;o.current=null;const D=ot(e);if(!e.current.unstable_applyPipeProcessors("canUpdateFocus",!0,{event:L,cell:P}))return;if(!D){P&&e.current.setCellFocus(P.id,P.field);return}if((P==null?void 0:P.id)===D.id&&(P==null?void 0:P.field)===D.field)return;const F=e.current.getCellElement(D.id,D.field);F!=null&&F.contains(L.target)||(P?e.current.setCellFocus(P.id,P.field):(e.current.setState(T=>h({},T,{focus:{cell:null,columnHeader:null,columnHeaderFilter:null,columnGroupHeader:null}})),e.current.forceUpdate(),l(D,L)))},[e,l]),E=c.useCallback(L=>{if(L.cellMode==="view")return;const P=ot(e);((P==null?void 0:P.id)!==L.id||(P==null?void 0:P.field)!==L.field)&&e.current.setCellFocus(L.id,L.field)},[e]),R=c.useCallback(()=>{const L=ot(e);if(L&&!e.current.getRow(L.id)){const P=L.id;let D=null;if(typeof P<"u"){const z=e.current.getRowElement(P),F=z!=null&&z.dataset.rowindex?Number(z==null?void 0:z.dataset.rowindex):0,T=$t(e,{pagination:t.pagination,paginationMode:t.paginationMode}),G=T.rows[lt(F,0,T.rows.length-1)];D=(G==null?void 0:G.id)??null}e.current.setState(z=>h({},z,{focus:{cell:D===null?null:{id:D,field:L.field},columnHeader:null,columnHeaderFilter:null,columnGroupHeader:null}}))}},[e,t.pagination,t.paginationMode]),H=ze(()=>{const L=ot(e);if(!L)return;const P=$t(e,{pagination:t.pagination,paginationMode:t.paginationMode});if(P.rows.find(F=>F.id===L.id))return;const z=je(e);e.current.setState(F=>h({},F,{tabIndex:{cell:{id:P.rows[0].id,field:z[0].field},columnGroupHeader:null,columnHeader:null,columnHeaderFilter:null}}))}),V={setCellFocus:s,setColumnHeaderFocus:a,setColumnHeaderFilterFocus:i},A={moveFocusToRelativeCell:g,setColumnGroupHeaderFocus:d,getColumnGroupHeaderFocus:u};de(e,V,"public"),de(e,A,"private"),c.useEffect(()=>{const L=Rt(e.current.rootElementRef.current);return L.addEventListener("mouseup",p),()=>{L.removeEventListener("mouseup",p)}},[e,r,p]),ee(e,"columnHeaderBlur",w),ee(e,"cellDoubleClick",f),ee(e,"cellMouseDown",m),ee(e,"cellKeyDown",x),ee(e,"cellModeChange",E),ee(e,"columnHeaderFocus",I),ee(e,"columnGroupHeaderFocus",y),ee(e,"rowsSet",R),ee(e,"paginationModelChange",H)},Bo=({currentColIndex:e,firstColIndex:t,lastColIndex:n,isRtl:o})=>{if(o){if(e<n)return e+1}else if(!o&&e>t)return e-1;return null},Wo=({currentColIndex:e,firstColIndex:t,lastColIndex:n,isRtl:o})=>{if(o){if(e>t)return e-1}else if(!o&&e<n)return e+1;return null};function jC(e,t,n,o){var a,i;const r=vi(e);if(!((a=r[t])!=null&&a[n]))return t;const l=Js(e);let s=l.indexOf(t)+(o==="down"?1:-1);for(;s>=0&&s<l.length;){const d=l[s];if(!((i=r[d])!=null&&i[n]))return d;s+=o==="down"?1:-1}return t}const _C=Pe(_n,Cn,(e,t)=>(t.top||[]).concat(e.rows,t.bottom||[])),BC=(e,t)=>{const n=Ue(e,"useGridKeyboardNavigation"),o=It(),r=t.unstable_listView,l=c.useCallback(()=>_C(e),[e]),s=t.signature!=="DataGrid"&&t.headerFilters,a=c.useCallback((m,p,E="left",R="up")=>{const H=At(e),V=e.current.unstable_getCellColSpanInfo(p,m);V&&V.spannedByColSpan&&(E==="left"?m=V.leftVisibleCellIndex:E==="right"&&(m=V.rightVisibleCellIndex));const A=r?dn(e.current.state).field:mn(e)[m],L=jC(e,p,A,R),P=H.findIndex(D=>D.id===L);n.debug(`Navigating to cell row ${P}, col ${m}`),e.current.scrollToIndexes({colIndex:m,rowIndex:P}),e.current.setCellFocus(L,A)},[e,n,r]),i=c.useCallback((m,p)=>{n.debug(`Navigating to header col ${m}`),e.current.scrollToIndexes({colIndex:m});const E=e.current.getVisibleColumns()[m].field;e.current.setColumnHeaderFocus(E,p)},[e,n]),d=c.useCallback((m,p)=>{n.debug(`Navigating to header filter col ${m}`),e.current.scrollToIndexes({colIndex:m});const E=e.current.getVisibleColumns()[m].field;e.current.setColumnHeaderFilterFocus(E,p)},[e,n]),u=c.useCallback((m,p,E)=>{n.debug(`Navigating to header col ${m}`),e.current.scrollToIndexes({colIndex:m});const{field:R}=e.current.getVisibleColumns()[m];e.current.setColumnGroupHeaderFocus(R,p,E)},[e,n]),g=c.useCallback(m=>{var p;return(p=l()[m])==null?void 0:p.id},[l]),f=c.useCallback((m,p)=>{const E=p.currentTarget.querySelector(`.${S.columnHeaderTitleContainerContent}`);if(!!E&&E.contains(p.target)&&m.field!==Sn.field)return;const H=l(),V=e.current.getViewportPageSize(),A=m.field?e.current.getColumnIndex(m.field):0,L=H.length>0?0:null,P=H.length-1,D=0,z=je(e).length-1,F=Bn(e);let T=!0;switch(p.key){case"ArrowDown":{s?d(A,p):L!==null&&a(A,g(L));break}case"ArrowRight":{const G=Wo({currentColIndex:A,firstColIndex:D,lastColIndex:z,isRtl:o});G!==null&&i(G,p);break}case"ArrowLeft":{const G=Bo({currentColIndex:A,firstColIndex:D,lastColIndex:z,isRtl:o});G!==null&&i(G,p);break}case"ArrowUp":{F>0&&u(A,F-1,p);break}case"PageDown":{L!==null&&P!==null&&a(A,g(Math.min(L+V,P)));break}case"Home":{i(D,p);break}case"End":{i(z,p);break}case"Enter":{(p.ctrlKey||p.metaKey)&&e.current.toggleColumnMenu(m.field);break}case" ":break;default:T=!1}T&&p.preventDefault()},[e,l,s,d,a,g,o,i,u]),x=c.useCallback((m,p)=>{const E=lg(e)===m.field,R=sg(e)===m.field;if(E||R||!Co(p.key))return;const H=l(),V=e.current.getViewportPageSize(),A=m.field?e.current.getColumnIndex(m.field):0,L=0,P=H.length-1,D=0,z=je(e).length-1;let F=!0;switch(p.key){case"ArrowDown":{const T=g(L);T!=null&&a(A,T);break}case"ArrowRight":{const T=Wo({currentColIndex:A,firstColIndex:D,lastColIndex:z,isRtl:o});T!==null&&d(T,p);break}case"ArrowLeft":{const T=Bo({currentColIndex:A,firstColIndex:D,lastColIndex:z,isRtl:o});T!==null?d(T,p):e.current.setColumnHeaderFilterFocus(m.field,p);break}case"ArrowUp":{i(A,p);break}case"PageDown":{P!==null&&a(A,g(Math.min(L+V,P)));break}case"Home":{d(D,p);break}case"End":{d(z,p);break}case" ":break;default:F=!1}F&&p.preventDefault()},[e,l,d,o,i,a,g]),I=c.useCallback((m,p)=>{const E=fo(e);if(E===null)return;const{field:R,depth:H}=E,{fields:V,depth:A,maxDepth:L}=m,P=l(),D=e.current.getViewportPageSize(),z=e.current.getColumnIndex(R),F=R?e.current.getColumnIndex(R):0,T=0,G=P.length-1,M=0,b=je(e).length-1;let C=!0;switch(p.key){case"ArrowDown":{A===L-1?i(z,p):u(z,H+1,p);break}case"ArrowUp":{A>0&&u(z,H-1,p);break}case"ArrowRight":{const $=V.length-V.indexOf(R)-1;z+$+1<=b&&u(z+$+1,H,p);break}case"ArrowLeft":{const $=V.indexOf(R);z-$-1>=M&&u(z-$-1,H,p);break}case"PageDown":{G!==null&&a(F,g(Math.min(T+D,G)));break}case"Home":{u(M,H,p);break}case"End":{u(b,H,p);break}case" ":break;default:C=!1}C&&p.preventDefault()},[e,l,i,u,a,g]),y=c.useCallback((m,p)=>{if(Kn(p))return;const E=e.current.getCellParams(m.id,m.field);if(E.cellMode===Fe.Edit||!Co(p.key)||!e.current.unstable_applyPipeProcessors("canUpdateFocus",!0,{event:p,cell:E}))return;const H=l();if(H.length===0)return;const V=e.current.getViewportPageSize(),A=r?()=>0:e.current.getColumnIndex,L=m.field?A(m.field):0,P=H.findIndex(b=>b.id===m.id),D=0,z=H.length-1,F=0,G=(r?[dn(e.current.state)]:je(e)).length-1;let M=!0;switch(p.key){case"ArrowDown":{P<z&&a(L,g(P+1),o?"right":"left","down");break}case"ArrowUp":{P>D?a(L,g(P-1)):s?d(L,p):i(L,p);break}case"ArrowRight":{const b=Wo({currentColIndex:L,firstColIndex:F,lastColIndex:G,isRtl:o});b!==null&&a(b,g(P),o?"left":"right");break}case"ArrowLeft":{const b=Bo({currentColIndex:L,firstColIndex:F,lastColIndex:G,isRtl:o});b!==null&&a(b,g(P),o?"right":"left");break}case"Tab":{p.shiftKey&&L>F?a(L-1,g(P),"left"):!p.shiftKey&&L<G&&a(L+1,g(P),"right");break}case" ":{if(m.field===Po)break;const C=m.colDef;if(C&&(C.field===$u||Df(C.field)))break;!p.shiftKey&&P<z&&a(L,g(Math.min(P+V,z)));break}case"PageDown":{P<z&&a(L,g(Math.min(P+V,z)));break}case"PageUp":{const b=Math.max(P-V,D);b!==P&&b>=D?a(L,g(b)):i(L,p);break}case"Home":{p.ctrlKey||p.metaKey||p.shiftKey?a(F,g(D)):a(F,g(P));break}case"End":{p.ctrlKey||p.metaKey||p.shiftKey?a(G,g(z)):a(G,g(P));break}default:M=!1}M&&p.preventDefault()},[e,l,o,a,g,s,d,i,r]),w=c.useCallback((m,{event:p})=>p.key===" "?!1:m,[]);Re(e,"canStartEditing",w),ee(e,"columnHeaderKeyDown",f),ee(e,"headerFilterKeyDown",x),ee(e,"columnGroupHeaderKeyDown",I),ee(e,"cellKeyDown",y)},WC=(e,t)=>{var I,y;const n=Ue(e,"useGridRowCount"),o=K(e,wr),r=K(e,tn),l=K(e,Fn),s=K(e,et),a=yt(()=>et(e).pageSize);e.current.registerControlState({stateId:"paginationRowCount",propModel:t.rowCount,propOnChange:t.onRowCountChange,stateSelector:tn,changeEvent:"rowCountChange"});const d={setRowCount:c.useCallback(w=>{r!==w&&(n.debug("Setting 'rowCount' to",w),e.current.setState(m=>h({},m,{pagination:h({},m.pagination,{rowCount:w})})))},[e,n,r])};de(e,d,"public");const u=c.useCallback((w,m)=>{var R,H;const p=tn(e);return!m.exportOnlyDirtyModels||t.rowCount!=null||((H=(R=t.initialState)==null?void 0:R.pagination)==null?void 0:H.rowCount)!=null?h({},w,{pagination:h({},w.pagination,{rowCount:p})}):w},[e,t.rowCount,(y=(I=t.initialState)==null?void 0:I.pagination)==null?void 0:y.rowCount]),g=c.useCallback((w,m)=>{var E;const p=(E=m.stateToRestore.pagination)!=null&&E.rowCount?m.stateToRestore.pagination.rowCount:tn(e);return e.current.setState(R=>h({},R,{pagination:h({},R.pagination,{rowCount:p})})),w},[e]);Re(e,"exportState",u),Re(e,"restoreState",g);const f=c.useCallback(w=>{t.paginationMode==="client"||!a.current||w.pageSize!==a.current&&(a.current=w.pageSize,r===-1&&e.current.setPage(0))},[t.paginationMode,a,r,e]);ee(e,"paginationModelChange",f),c.useEffect(()=>{t.paginationMode==="client"?e.current.setRowCount(o):t.rowCount!=null&&e.current.setRowCount(t.rowCount)},[e,t.paginationMode,o,t.rowCount]);const x=l.hasNextPage===!1;c.useEffect(()=>{x&&r===-1&&e.current.setRowCount(s.pageSize*s.page+o)},[e,o,x,r,s])},UC=(e,t)=>{var i,d;const n=Ue(e,"useGridPaginationMeta"),o=K(e,Fn);e.current.registerControlState({stateId:"paginationMeta",propModel:t.paginationMeta,propOnChange:t.onPaginationMetaChange,stateSelector:Fn,changeEvent:"paginationMetaChange"});const l={setPaginationMeta:c.useCallback(u=>{o!==u&&(n.debug("Setting 'paginationMeta' to",u),e.current.setState(g=>h({},g,{pagination:h({},g.pagination,{meta:u})})))},[e,n,o])};de(e,l,"public");const s=c.useCallback((u,g)=>{var I,y;const f=Fn(e);return!g.exportOnlyDirtyModels||t.paginationMeta!=null||((y=(I=t.initialState)==null?void 0:I.pagination)==null?void 0:y.meta)!=null?h({},u,{pagination:h({},u.pagination,{meta:f})}):u},[e,t.paginationMeta,(d=(i=t.initialState)==null?void 0:i.pagination)==null?void 0:d.meta]),a=c.useCallback((u,g)=>{var x;const f=(x=g.stateToRestore.pagination)!=null&&x.meta?g.stateToRestore.pagination.meta:Fn(e);return e.current.setState(I=>h({},I,{pagination:h({},I.pagination,{meta:f})})),u},[e]);Re(e,"exportState",s),Re(e,"restoreState",a),c.useEffect(()=>{t.paginationMeta&&e.current.setPaginationMeta(t.paginationMeta)},[e,t.paginationMeta])},KC=(e,t)=>{var l,s,a,i,d,u,g;const n=h({},li(t.autoPageSize),t.paginationModel??((s=(l=t.initialState)==null?void 0:l.pagination)==null?void 0:s.paginationModel));si(n.pageSize,t.signature);const o=t.rowCount??((i=(a=t.initialState)==null?void 0:a.pagination)==null?void 0:i.rowCount)??(t.paginationMode==="client"?(d=e.rows)==null?void 0:d.totalRowCount:void 0),r=t.paginationMeta??((g=(u=t.initialState)==null?void 0:u.pagination)==null?void 0:g.meta)??{};return h({},e,{pagination:h({},e.pagination,{paginationModel:n,rowCount:o,meta:r,enabled:t.pagination===!0,paginationMode:t.paginationMode})})},qC=(e,t)=>{UC(e,t),DC(e,t),WC(e,t)},XC=(e,t)=>{var n;return h({},e,{preferencePanel:((n=t.initialState)==null?void 0:n.preferencePanel)??{open:!1}})},YC=(e,t)=>{var a;const n=Ue(e,"useGridPreferencesPanel"),o=c.useCallback(()=>{e.current.setState(i=>{if(!i.preferencePanel.open)return i;n.debug("Hiding Preferences Panel");const d=Rn(i);return e.current.publishEvent("preferencePanelClose",{openedPanelValue:d.openedPanelValue}),h({},i,{preferencePanel:{open:!1}})})},[e,n]),r=c.useCallback((i,d,u)=>{n.debug("Opening Preferences Panel"),e.current.setState(g=>h({},g,{preferencePanel:h({},g.preferencePanel,{open:!0,openedPanelValue:i,panelId:d,labelId:u})})),e.current.publishEvent("preferencePanelOpen",{openedPanelValue:i})},[n,e]);de(e,{showPreferences:r,hidePreferences:o},"public");const l=c.useCallback((i,d)=>{var f;const u=Rn(e.current.state);return!d.exportOnlyDirtyModels||((f=t.initialState)==null?void 0:f.preferencePanel)!=null||u.open?h({},i,{preferencePanel:u}):i},[e,(a=t.initialState)==null?void 0:a.preferencePanel]),s=c.useCallback((i,d)=>{const u=d.stateToRestore.preferencePanel;return u!=null&&e.current.setState(g=>h({},g,{preferencePanel:u})),i},[e]);Re(e,"exportState",l),Re(e,"restoreState",s)},tr=e=>{switch(e.type){case"boolean":return!1;case"date":case"dateTime":case"number":return;case"singleSelect":return null;case"string":default:return""}},QC=["id","field"],ZC=["id","field"],JC=(e,t)=>{const[n,o]=c.useState({}),r=c.useRef(n),l=c.useRef({}),{processRowUpdate:s,onProcessRowUpdateError:a,cellModesModel:i,onCellModesModelChange:d}=t,u=M=>(...b)=>{t.editMode===vt.Cell&&M(...b)},g=c.useCallback((M,b)=>{const C=e.current.getCellParams(M,b);if(!e.current.isCellEditable(C))throw new Error(`MUI X: The cell with id=${M} and field=${b} is not editable.`)},[e]),f=c.useCallback((M,b,C)=>{if(e.current.getCellMode(M,b)!==C)throw new Error(`MUI X: The cell with id=${M} and field=${b} is not in ${C} mode.`)},[e]),x=c.useCallback((M,b)=>{if(!M.isEditable||M.cellMode===Fe.Edit)return;const C=h({},M,{reason:Pt.cellDoubleClick});e.current.publishEvent("cellEditStart",C,b)},[e]),I=c.useCallback((M,b)=>{if(M.cellMode===Fe.View||e.current.getCellMode(M.id,M.field)===Fe.View)return;const C=h({},M,{reason:ft.cellFocusOut});e.current.publishEvent("cellEditStop",C,b)},[e]),y=c.useCallback((M,b)=>{if(M.cellMode===Fe.Edit){if(b.which===229)return;let C;if(b.key==="Escape"?C=ft.escapeKeyDown:b.key==="Enter"?C=ft.enterKeyDown:b.key==="Tab"&&(C=b.shiftKey?ft.shiftTabKeyDown:ft.tabKeyDown,b.preventDefault()),C){const $=h({},M,{reason:C});e.current.publishEvent("cellEditStop",$,b)}}else if(M.isEditable){let C;if(!e.current.unstable_applyPipeProcessors("canStartEditing",!0,{event:b,cellParams:M,editMode:"cell"}))return;if($i(b)?C=Pt.printableKeyDown:Vi(b)?C=Pt.pasteKeyDown:b.key==="Enter"?C=Pt.enterKeyDown:(b.key==="Backspace"||b.key==="Delete")&&(C=Pt.deleteKeyDown),C){const k=h({},M,{reason:C,key:b.key});e.current.publishEvent("cellEditStart",k,b)}}},[e]),w=c.useCallback(M=>{const{id:b,field:C,reason:$}=M,k={id:b,field:C};($===Pt.printableKeyDown||$===Pt.deleteKeyDown||$===Pt.pasteKeyDown)&&(k.deleteValue=!0),e.current.startCellEditMode(k)},[e]),m=c.useCallback(M=>{const{id:b,field:C,reason:$}=M;e.current.runPendingEditCellValueMutation(b,C);let k;$===ft.enterKeyDown?k="below":$===ft.tabKeyDown?k="right":$===ft.shiftTabKeyDown&&(k="left");const O=$==="escapeKeyDown";e.current.stopCellEditMode({id:b,field:C,ignoreModifications:O,cellToFocusAfter:k})},[e]),p=M=>async(...b)=>{var C;if(M){const{id:$,field:k}=b[0];((C=e.current.state.editRows[$][k])==null?void 0:C.error)||M(...b)}};ee(e,"cellDoubleClick",u(x)),ee(e,"cellFocusOut",u(I)),ee(e,"cellKeyDown",u(y)),ee(e,"cellEditStart",u(w)),ee(e,"cellEditStop",u(m)),Te(e,"cellEditStart",t.onCellEditStart),Te(e,"cellEditStop",p(t.onCellEditStop));const E=c.useCallback((M,b)=>{const C=We(e.current.state);return C[M]&&C[M][b]?Fe.Edit:Fe.View},[e]),R=ze(M=>{const b=M!==t.cellModesModel;d&&b&&d(M,{api:e.current}),!(t.cellModesModel&&b)&&(o(M),r.current=M,e.current.publishEvent("cellModesModelChange",M))}),H=c.useCallback((M,b,C)=>{const $=h({},r.current);if(C!==null)$[M]=h({},$[M],{[b]:h({},C)});else{const k=$[M],O=re(k,[b].map(Dn));$[M]=O,Object.keys($[M]).length===0&&delete $[M]}R($)},[R]),V=c.useCallback((M,b,C)=>{e.current.setState($=>{const k=h({},$.editRows);return C!==null?k[M]=h({},k[M],{[b]:h({},C)}):(delete k[M][b],Object.keys(k[M]).length===0&&delete k[M]),h({},$,{editRows:k})}),e.current.forceUpdate()},[e]),A=c.useCallback(M=>{const{id:b,field:C}=M,$=re(M,QC);g(b,C),f(b,C,Fe.View),H(b,C,h({mode:Fe.Edit},$))},[g,f,H]),L=ze(async M=>{const{id:b,field:C,deleteValue:$,initialValue:k}=M,O=e.current.getCellValue(b,C);let j=O;$?j=tr(e.current.getColumn(C)):k&&(j=k);const N=e.current.getColumn(C),_=!!N.preProcessEditCellProps&&$;let U={value:j,error:!1,isProcessingProps:_};if(V(b,C,U),e.current.setCellFocus(b,C),_&&(U=await Promise.resolve(N.preProcessEditCellProps({id:b,row:e.current.getRow(b),props:U,hasChanged:j!==O})),e.current.getCellMode(b,C)===Fe.Edit)){const q=We(e.current.state);V(b,C,h({},U,{value:q[b][C].value,isProcessingProps:!1}))}}),P=c.useCallback(M=>{const{id:b,field:C}=M,$=re(M,ZC);f(b,C,Fe.Edit),H(b,C,h({mode:Fe.View},$))},[f,H]),D=ze(async M=>{const{id:b,field:C,ignoreModifications:$,cellToFocusAfter:k="none"}=M;f(b,C,Fe.Edit),e.current.runPendingEditCellValueMutation(b,C);const O=()=>{V(b,C,null),H(b,C,null),k!=="none"&&e.current.moveFocusToRelativeCell(b,C,k)};if($){O();return}const j=We(e.current.state),{error:N,isProcessingProps:_}=j[b][C];if(N||_){l.current[b][C].mode=Fe.Edit,H(b,C,{mode:Fe.Edit});return}const U=e.current.getRowWithUpdatedValuesFromCellEditing(b,C);if(s){const q=W=>{l.current[b][C].mode=Fe.Edit,H(b,C,{mode:Fe.Edit}),a&&a(W)};try{const W=e.current.getRow(b);Promise.resolve(s(U,W,{rowId:b})).then(Y=>{e.current.updateRows([Y]),O()}).catch(q)}catch(W){q(W)}}else e.current.updateRows([U]),O()}),z=c.useCallback(async M=>{var W,Y;const{id:b,field:C,value:$,debounceMs:k,unstable_skipValueParser:O}=M;g(b,C),f(b,C,Fe.Edit);const j=e.current.getColumn(C),N=e.current.getRow(b);let _=$;j.valueParser&&!O&&(_=j.valueParser($,N,j,e));let U=We(e.current.state),q=h({},U[b][C],{value:_,changeReason:k?"debouncedSetEditCellValue":"setEditCellValue"});if(j.preProcessEditCellProps){const Q=$!==U[b][C].value;q=h({},q,{isProcessingProps:!0}),V(b,C,q),q=await Promise.resolve(j.preProcessEditCellProps({id:b,row:N,props:q,hasChanged:Q}))}return e.current.getCellMode(b,C)===Fe.View?!1:(U=We(e.current.state),q=h({},q,{isProcessingProps:!1}),q.value=j.preProcessEditCellProps?U[b][C].value:_,V(b,C,q),U=We(e.current.state),!((Y=(W=U[b])==null?void 0:W[C])!=null&&Y.error))},[e,g,f,V]),F=c.useCallback((M,b)=>{const C=e.current.getColumn(b),$=We(e.current.state),k=e.current.getRow(M);if(!$[M]||!$[M][b])return e.current.getRow(M);const{value:O}=$[M][b];return C.valueSetter?C.valueSetter(O,k,C,e):h({},k,{[b]:O})},[e]),T={getCellMode:E,startCellEditMode:A,stopCellEditMode:P},G={setCellEditingEditCellValue:z,getRowWithUpdatedValuesFromCellEditing:F};de(e,T,"public"),de(e,G,"private"),c.useEffect(()=>{i&&R(i)},[i,R]),Je(()=>{const M=ut(e),b=l.current;l.current=Rs(n),Object.entries(n).forEach(([C,$])=>{Object.entries($).forEach(([k,O])=>{var _,U;const j=((U=(_=b[C])==null?void 0:_[k])==null?void 0:U.mode)||Fe.View,N=M[C]?e.current.getRowId(M[C]):C;O.mode===Fe.Edit&&j===Fe.View?L(h({id:N,field:k},O)):O.mode===Fe.View&&j===Fe.Edit&&D(h({id:N,field:k},O))})})},[e,n,L,D])},ep=["id"],tp=["id"],np=(e,t)=>{const[n,o]=c.useState({}),r=c.useRef(n),l=c.useRef({}),s=c.useRef(void 0),a=c.useRef(null),{processRowUpdate:i,onProcessRowUpdateError:d,rowModesModel:u,onRowModesModelChange:g}=t,f=k=>(...O)=>{t.editMode===vt.Row&&k(...O)},x=c.useCallback((k,O)=>{const j=e.current.getCellParams(k,O);if(!e.current.isCellEditable(j))throw new Error(`MUI X: The cell with id=${k} and field=${O} is not editable.`)},[e]),I=c.useCallback((k,O)=>{if(e.current.getRowMode(k)!==O)throw new Error(`MUI X: The row with id=${k} is not in ${O} mode.`)},[e]),y=c.useCallback(k=>{const O=We(e.current.state);return Object.values(O[k]).some(j=>j.error)},[e]),w=c.useCallback((k,O)=>{if(!k.isEditable||e.current.getRowMode(k.id)===Oe.Edit)return;const j=e.current.getRowParams(k.id),N=h({},j,{field:k.field,reason:Ot.cellDoubleClick});e.current.publishEvent("rowEditStart",N,O)},[e]),m=c.useCallback(k=>{a.current=k},[]),p=c.useCallback((k,O)=>{k.isEditable&&e.current.getRowMode(k.id)!==Oe.View&&(a.current=null,s.current=setTimeout(()=>{var j;if(((j=a.current)==null?void 0:j.id)!==k.id){if(!e.current.getRow(k.id)||e.current.getRowMode(k.id)===Oe.View||y(k.id))return;const N=e.current.getRowParams(k.id),_=h({},N,{field:k.field,reason:St.rowFocusOut});e.current.publishEvent("rowEditStop",_,O)}}))},[e,y]);c.useEffect(()=>()=>{clearTimeout(s.current)},[]);const E=c.useCallback((k,O)=>{if(k.cellMode===Oe.Edit){if(O.which===229)return;let j;if(O.key==="Escape")j=St.escapeKeyDown;else if(O.key==="Enter")j=St.enterKeyDown;else if(O.key==="Tab"){const N=mn(e).filter(_=>e.current.getColumn(_).type===yo?!0:e.current.isCellEditable(e.current.getCellParams(k.id,_)));if(O.shiftKey?k.field===N[0]&&(j=St.shiftTabKeyDown):k.field===N[N.length-1]&&(j=St.tabKeyDown),O.preventDefault(),!j){const _=N.findIndex(q=>q===k.field),U=N[O.shiftKey?_-1:_+1];e.current.setCellFocus(k.id,U)}}if(j){if(j!==St.escapeKeyDown&&y(k.id))return;const N=h({},e.current.getRowParams(k.id),{reason:j,field:k.field});e.current.publishEvent("rowEditStop",N,O)}}else if(k.isEditable){let j;if(!e.current.unstable_applyPipeProcessors("canStartEditing",!0,{event:O,cellParams:k,editMode:"row"}))return;if($i(O)||Vi(O)?j=Ot.printableKeyDown:O.key==="Enter"?j=Ot.enterKeyDown:(O.key==="Backspace"||O.key==="Delete")&&(j=Ot.deleteKeyDown),j){const _=e.current.getRowParams(k.id),U=h({},_,{field:k.field,reason:j});e.current.publishEvent("rowEditStart",U,O)}}},[e,y]),R=c.useCallback(k=>{const{id:O,field:j,reason:N}=k,_={id:O,fieldToFocus:j};(N===Ot.printableKeyDown||N===Ot.deleteKeyDown)&&(_.deleteValue=!!j),e.current.startRowEditMode(_)},[e]),H=c.useCallback(k=>{const{id:O,reason:j,field:N}=k;e.current.runPendingEditCellValueMutation(O);let _;j===St.enterKeyDown?_="below":j===St.tabKeyDown?_="right":j===St.shiftTabKeyDown&&(_="left");const U=j==="escapeKeyDown";e.current.stopRowEditMode({id:O,ignoreModifications:U,field:N,cellToFocusAfter:_})},[e]);ee(e,"cellDoubleClick",f(w)),ee(e,"cellFocusIn",f(m)),ee(e,"cellFocusOut",f(p)),ee(e,"cellKeyDown",f(E)),ee(e,"rowEditStart",f(R)),ee(e,"rowEditStop",f(H)),Te(e,"rowEditStart",t.onRowEditStart),Te(e,"rowEditStop",t.onRowEditStop);const V=c.useCallback(k=>Ei(e,{rowId:k,editMode:t.editMode})?Oe.Edit:Oe.View,[e,t.editMode]),A=ze(k=>{const O=k!==t.rowModesModel;g&&O&&g(k,{api:e.current}),!(t.rowModesModel&&O)&&(o(k),r.current=k,e.current.publishEvent("rowModesModelChange",k))}),L=c.useCallback((k,O)=>{const j=h({},r.current);O!==null?j[k]=h({},O):delete j[k],A(j)},[A]),P=c.useCallback((k,O)=>{e.current.setState(j=>{const N=h({},j.editRows);return O!==null?N[k]=O:delete N[k],h({},j,{editRows:N})}),e.current.forceUpdate()},[e]),D=c.useCallback((k,O,j)=>{e.current.setState(N=>{const _=h({},N.editRows);return j!==null?_[k]=h({},_[k],{[O]:h({},j)}):(delete _[k][O],Object.keys(_[k]).length===0&&delete _[k]),h({},N,{editRows:_})}),e.current.forceUpdate()},[e]),z=c.useCallback(k=>{const{id:O}=k,j=re(k,ep);I(O,Oe.View),L(O,h({mode:Oe.Edit},j))},[I,L]),F=ze(k=>{const{id:O,fieldToFocus:j,deleteValue:N,initialValue:_}=k,U=kt(e),q=U.reduce((W,Y)=>{if(!e.current.getCellParams(O,Y).isEditable)return W;const Z=e.current.getColumn(Y);let J=e.current.getCellValue(O,Y);return j===Y&&(N||_)&&(N?J=tr(Z):_&&(J=_)),W[Y]={value:J,error:!1,isProcessingProps:!!Z.preProcessEditCellProps&&N},W},{});P(O,q),j&&e.current.setCellFocus(O,j),U.filter(W=>!!e.current.getColumn(W).preProcessEditCellProps&&N).forEach(W=>{const Y=e.current.getColumn(W),Q=e.current.getCellValue(O,W),Z=N?tr(Y):_??Q;Promise.resolve(Y.preProcessEditCellProps({id:O,row:e.current.getRow(O),props:q[W],hasChanged:Z!==Q})).then(J=>{if(e.current.getRowMode(O)===Oe.Edit){const te=We(e.current.state);D(O,W,h({},J,{value:te[O][W].value,isProcessingProps:!1}))}})})}),T=c.useCallback(k=>{const{id:O}=k,j=re(k,tp);I(O,Oe.Edit),L(O,h({mode:Oe.View},j))},[I,L]),G=ze(k=>{const{id:O,ignoreModifications:j,field:N,cellToFocusAfter:_="none"}=k;e.current.runPendingEditCellValueMutation(O);const U=()=>{_!=="none"&&N&&e.current.moveFocusToRelativeCell(O,N,_),P(O,null),L(O,null)};if(j){U();return}const q=We(e.current.state),W=e.current.getRow(O);if(Object.values(q[O]).some(Z=>Z.isProcessingProps)){l.current[O].mode=Oe.Edit;return}if(y(O)){l.current[O].mode=Oe.Edit,L(O,{mode:Oe.Edit});return}const Q=e.current.getRowWithUpdatedValuesFromRowEditing(O);if(i){const Z=J=>{l.current[O].mode=Oe.Edit,L(O,{mode:Oe.Edit}),d&&d(J)};try{Promise.resolve(i(Q,W,{rowId:O})).then(J=>{e.current.updateRows([J]),U()}).catch(Z)}catch(J){Z(J)}}else e.current.updateRows([Q]),U()}),M=c.useCallback(k=>{const{id:O,field:j,value:N,debounceMs:_,unstable_skipValueParser:U}=k;x(O,j);const q=e.current.getColumn(j),W=e.current.getRow(O);let Y=N;q.valueParser&&!U&&(Y=q.valueParser(N,W,q,e));let Q=We(e.current.state),Z=h({},Q[O][j],{value:Y,changeReason:_?"debouncedSetEditCellValue":"setEditCellValue"});return q.preProcessEditCellProps||D(O,j,Z),new Promise(J=>{const te=[];if(q.preProcessEditCellProps){const oe=Z.value!==Q[O][j].value;Z=h({},Z,{isProcessingProps:!0}),D(O,j,Z);const X=Q[O],ie=re(X,[j].map(Dn)),xe=Promise.resolve(q.preProcessEditCellProps({id:O,row:W,props:Z,hasChanged:oe,otherFieldsProps:ie})).then(Ce=>{if(e.current.getRowMode(O)===Oe.View){J(!1);return}Q=We(e.current.state),Ce=h({},Ce,{isProcessingProps:!1}),Ce.value=q.preProcessEditCellProps?Q[O][j].value:Y,D(O,j,Ce)});te.push(xe)}Object.entries(Q[O]).forEach(([oe,X])=>{if(oe===j)return;const ie=e.current.getColumn(oe);if(!ie.preProcessEditCellProps)return;X=h({},X,{isProcessingProps:!0}),D(O,oe,X),Q=We(e.current.state);const xe=Q[O],Ce=re(xe,[oe].map(Dn)),ye=Promise.resolve(ie.preProcessEditCellProps({id:O,row:W,props:X,hasChanged:!1,otherFieldsProps:Ce})).then(be=>{if(e.current.getRowMode(O)===Oe.View){J(!1);return}be=h({},be,{isProcessingProps:!1}),D(O,oe,be)});te.push(ye)}),Promise.all(te).then(()=>{e.current.getRowMode(O)===Oe.Edit?(Q=We(e.current.state),J(!Q[O][j].error)):J(!1)})})},[e,x,D]),b=c.useCallback(k=>{const O=We(e.current.state),j=e.current.getRow(k);if(!O[k])return e.current.getRow(k);let N=h({},j);return Object.entries(O[k]).forEach(([_,U])=>{const q=e.current.getColumn(_);q.valueSetter?N=q.valueSetter(U.value,N,q,e):N[_]=U.value}),N},[e]),C={getRowMode:V,startRowEditMode:z,stopRowEditMode:T},$={setRowEditingEditCellValue:M,getRowWithUpdatedValuesFromRowEditing:b};de(e,C,"public"),de(e,$,"private"),c.useEffect(()=>{u&&A(u)},[u,A]),Je(()=>{const k=ut(e),O=l.current;l.current=Rs(n);const j=new Set([...Object.keys(n),...Object.keys(O)]);Array.from(j).forEach(N=>{var W;const _=n[N]??{mode:Oe.View},U=((W=O[N])==null?void 0:W.mode)||Oe.View,q=k[N]?e.current.getRowId(k[N]):N;_.mode===Oe.Edit&&U===Oe.View?F(h({id:q},_)):_.mode===Oe.View&&U===Oe.Edit&&G(h({id:q},_))})},[e,n,F,G])},op=e=>h({},e,{editRows:{}}),rp=(e,t)=>{JC(e,t),np(e,t);const n=c.useRef({}),{isCellEditable:o}=t,r=c.useCallback(f=>an(f.rowNode)||!f.colDef.editable||!f.colDef.renderEditCell?!1:o?o(f):!0,[o]),l=(f,x,I,y)=>{if(!I){y();return}if(n.current[f]||(n.current[f]={}),n.current[f][x]){const[p]=n.current[f][x];clearTimeout(p)}const w=()=>{const[p]=n.current[f][x];clearTimeout(p),y(),delete n.current[f][x]},m=setTimeout(()=>{y(),delete n.current[f][x]},I);n.current[f][x]=[m,w]};c.useEffect(()=>{const f=n.current;return()=>{Object.entries(f).forEach(([x,I])=>{Object.keys(I).forEach(y=>{const[w]=f[x][y];clearTimeout(w),delete f[x][y]})})}},[]);const s=c.useCallback((f,x)=>{if(n.current[f]){if(!x)Object.keys(n.current[f]).forEach(I=>{const[,y]=n.current[f][I];y()});else if(n.current[f][x]){const[,I]=n.current[f][x];I()}}},[]),a=c.useCallback(f=>{const{id:x,field:I,debounceMs:y}=f;return new Promise(w=>{l(x,I,y,async()=>{const m=t.editMode===vt.Row?e.current.setRowEditingEditCellValue:e.current.setCellEditingEditCellValue;if(e.current.getCellMode(x,I)===Fe.Edit){const p=await m(f);w(p)}})})},[e,t.editMode]),i=c.useCallback((f,x)=>t.editMode===vt.Cell?e.current.getRowWithUpdatedValuesFromCellEditing(f,x):e.current.getRowWithUpdatedValuesFromRowEditing(f),[e,t.editMode]),d=c.useCallback((f,x)=>{var y;return((y=We(e.current.state)[f])==null?void 0:y[x])??null},[e]),u={isCellEditable:r,setEditCellValue:a,getRowWithUpdatedValues:i,unstable_getEditCellMeta:d},g={runPendingEditCellValueMutation:s};de(e,u,"public"),de(e,g,"private")},lp=(e,t,n)=>{const o=!!t.unstable_dataSource;return n.current.caches.rows=oo({rows:o?[]:t.rows,getRowId:t.getRowId,loading:t.loading,rowCount:t.rowCount}),h({},e,{rows:Us({apiRef:n,rowCountProp:t.rowCount,loadingProp:o?!0:t.loading,previousTree:null,previousTreeDepths:null})})},sp=(e,t)=>{const n=Ue(e,"useGridRows"),o=c.useRef(Date.now()),r=c.useRef(t.rowCount),l=fn(),s=c.useCallback(b=>{const C=ut(e)[b];if(C)return C;const $=e.current.getRowNode(b);return $&&an($)?{[sn]:b}:null},[e]),a=t.getRowId,i=c.useCallback(b=>sn in b?b[sn]:a?a(b):b.id,[a]),d=c.useCallback(({cache:b,throttle:C})=>{const $=()=>{o.current=Date.now(),e.current.setState(O=>h({},O,{rows:Us({apiRef:e,rowCountProp:t.rowCount,loadingProp:t.loading,previousTree:Ze(e),previousTreeDepths:ul(e),previousGroupsToFetch:Du(e)})})),e.current.publishEvent("rowsSet"),e.current.forceUpdate()};if(l.clear(),e.current.caches.rows=b,!C){$();return}const k=t.throttleRowsMs-(Date.now()-o.current);if(k>0){l.start(k,$);return}$()},[t.throttleRowsMs,t.rowCount,t.loading,e,l]),u=c.useCallback(b=>{n.debug(`Updating all rows, new length ${b.length}`);const C=oo({rows:b,getRowId:t.getRowId,loading:t.loading,rowCount:t.rowCount}),$=e.current.caches.rows;C.rowsBeforePartialUpdates=$.rowsBeforePartialUpdates,d({cache:C,throttle:!0})},[n,t.getRowId,t.loading,t.rowCount,d,e]),g=c.useCallback(b=>{if(t.signature===dt.DataGrid&&b.length>1)throw new Error(["MUI X: You cannot 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 C=gl(e,b,t.getRowId),$=dl({updates:C,getRowId:t.getRowId,previousCache:e.current.caches.rows});d({cache:$,throttle:!0})},[t.signature,t.getRowId,d,e]),f=c.useCallback((b,C)=>{const $=gl(e,b,t.getRowId),k=dl({updates:$,getRowId:t.getRowId,previousCache:e.current.caches.rows,groupKeys:C??[]});d({cache:k,throttle:!1})},[t.getRowId,d,e]),x=c.useCallback(b=>{b!==t.loading&&(n.debug(`Setting loading to ${b}`),e.current.setState(C=>h({},C,{rows:h({},C.rows,{loading:b})})),e.current.caches.rows.loadingPropBeforePartialUpdates=b)},[t.loading,e,n]),I=c.useCallback(()=>{const b=En(e),C=ut(e);return new Map(b.map($=>[$,C[$]??{}]))},[e]),y=c.useCallback(()=>An(e),[e]),w=c.useCallback(()=>En(e),[e]),m=c.useCallback(b=>{const C=e.current.getRow(b),{rowToIndexMap:$}=$t(e);return $.get(C)},[e]),p=c.useCallback((b,C)=>{const $=e.current.getRowNode(b);if(!$)throw new Error(`MUI X: No row with id #${b} found.`);if($.type!=="group")throw new Error("MUI X: Only group nodes can be expanded or collapsed.");const k=h({},$,{childrenExpanded:C});e.current.setState(O=>h({},O,{rows:h({},O.rows,{tree:h({},O.rows.tree,{[b]:k})})})),e.current.forceUpdate(),e.current.publishEvent("rowExpansionChange",k)},[e]),E=c.useCallback(b=>Ze(e)[b]??null,[e]),R=c.useCallback(({skipAutoGeneratedRows:b=!0,groupId:C,applySorting:$,applyFiltering:k})=>{const O=Ze(e);let j;if($){const N=O[C];if(!N)return[];const _=pn(e);j=[];const U=_.findIndex(q=>q===C)+1;for(let q=U;q<_.length&&O[_[q]].depth>N.depth;q+=1){const W=_[q];(!b||!an(O[W]))&&j.push(W)}}else j=br(O,C,b);if(k){const N=wn(e);j=j.filter(_=>N[_]!==!1)}return j},[e]),H=c.useCallback((b,C)=>{const $=e.current.getRowNode(b);if(!$)throw new Error(`MUI X: No row with id #${b} found.`);if($.parent!==Ye)throw new Error("MUI X: The row reordering do not support reordering of grouped rows yet.");if($.type!=="leaf")throw new Error("MUI X: The row reordering do not support reordering of footer or grouping rows.");e.current.setState(k=>{const O=Ze(k,e.current.instanceId)[Ye],j=O.children,N=j.findIndex(U=>U===b);if(N===-1||N===C)return k;n.debug(`Moving row ${b} to index ${C}`);const _=[...j];return _.splice(C,0,_.splice(N,1)[0]),h({},k,{rows:h({},k.rows,{tree:h({},k.rows.tree,{[Ye]:h({},O,{children:_})})})})}),e.current.publishEvent("rowsSet")},[e,n]),V=c.useCallback((b,C)=>{if(t.signature===dt.DataGrid&&C.length>1)throw new Error(["MUI X: You cannot 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(C.length===0)return;if(Ut(e)>1)throw new Error("`apiRef.current.unstable_replaceRows` is not compatible with tree data and row grouping");const k=h({},Ze(e)),O=h({},ut(e)),j=h({},al(e)),N=k[Ye],_=[...N.children],U=new Set;for(let W=0;W<C.length;W+=1){const Y=C[W],Q=Io(Y,t.getRowId,"A row was provided without id when calling replaceRows()."),[Z]=_.splice(b+W,1,Q);U.has(Z)||(delete O[Z],delete j[Z],delete k[Z]);const J={id:Q,depth:0,parent:Ye,type:"leaf",groupingKey:null};O[Q]=Y,j[Q]=Q,k[Q]=J,U.add(Q)}k[Ye]=h({},N,{children:_});const q=_.filter(W=>{var Y;return((Y=k[W])==null?void 0:Y.type)==="leaf"});e.current.caches.rows.dataRowIdToModelLookup=O,e.current.caches.rows.dataRowIdToIdLookup=j,e.current.setState(W=>h({},W,{rows:h({},W.rows,{dataRowIdToModelLookup:O,dataRowIdToIdLookup:j,dataRowIds:q,tree:k})})),e.current.publishEvent("rowsSet")},[e,t.signature,t.getRowId]),A={getRow:s,setLoading:x,getRowId:i,getRowModels:I,getRowsCount:y,getAllRowIds:w,setRows:u,updateRows:g,getRowNode:E,getRowIndexRelativeToVisibleRows:m,unstable_replaceRows:V},L={setRowIndex:H,setRowChildrenExpansion:p,getRowGroupChildren:R},P={updateServerRows:f},D=c.useCallback(()=>{n.info("Row grouping pre-processing have changed, regenerating the row tree");let b;e.current.caches.rows.rowsBeforePartialUpdates===t.rows?b=h({},e.current.caches.rows,{updates:{type:"full",rows:En(e)}}):b=oo({rows:t.rows,getRowId:t.getRowId,loading:t.loading,rowCount:t.rowCount}),d({cache:b,throttle:!1})},[n,e,t.rows,t.getRowId,t.loading,t.rowCount,d]),z=yt(()=>t.unstable_dataSource),F=c.useCallback(b=>{if(t.unstable_dataSource&&t.unstable_dataSource!==z.current){z.current=t.unstable_dataSource;return}b==="rowTreeCreation"&&D()},[D,z,t.unstable_dataSource]),T=c.useCallback(()=>{e.current.getActiveStrategy("rowTree")!==Ou(e)&&D()},[e,D]);ee(e,"activeStrategyProcessorChange",F),ee(e,"strategyAvailabilityChange",T);const G=c.useCallback(()=>{e.current.setState(b=>{const C=e.current.unstable_applyPipeProcessors("hydrateRows",{tree:Ze(b,e.current.instanceId),treeDepths:ul(b,e.current.instanceId),dataRowIds:En(b,e.current.instanceId),dataRowIdToModelLookup:ut(b,e.current.instanceId),dataRowIdToIdLookup:al(b,e.current.instanceId)});return h({},b,{rows:h({},b.rows,C,{totalTopLevelRowCount:Ws({tree:C.tree,rowCountProp:t.rowCount})})})}),e.current.publishEvent("rowsSet"),e.current.forceUpdate()},[e,t.rowCount]);Dr(e,"hydrateRows",G),de(e,A,"public"),de(e,L,t.signature===dt.DataGrid?"private":"public"),de(e,P,"private");const M=c.useRef(!0);c.useEffect(()=>{var O;if(M.current){M.current=!1;return}let b=!1;t.rowCount!==r.current&&(b=!0,r.current=t.rowCount);const C=e.current.caches.rows.rowsBeforePartialUpdates===t.rows,$=e.current.caches.rows.loadingPropBeforePartialUpdates===t.loading,k=e.current.caches.rows.rowCountPropBeforePartialUpdates===t.rowCount;C&&($||(e.current.setState(j=>h({},j,{rows:h({},j.rows,{loading:t.loading})})),e.current.caches.rows.loadingPropBeforePartialUpdates=t.loading,e.current.forceUpdate()),k||(e.current.setState(j=>h({},j,{rows:h({},j.rows,{totalRowCount:Math.max(t.rowCount||0,j.rows.totalRowCount),totalTopLevelRowCount:Math.max(t.rowCount||0,j.rows.totalTopLevelRowCount)})})),e.current.caches.rows.rowCountPropBeforePartialUpdates=t.rowCount,e.current.forceUpdate()),!b)||(n.debug(`Updating all rows, new length ${(O=t.rows)==null?void 0:O.length}`),d({cache:oo({rows:t.rows,getRowId:t.getRowId,loading:t.loading,rowCount:t.rowCount}),throttle:!1}))},[t.rows,t.rowCount,t.getRowId,t.loading,n,d,e])},ip=e=>{const t={[Ye]:h({},Gu(),{children:e})};for(let n=0;n<e.length;n+=1){const o=e[n];t[o]={id:o,depth:0,parent:Ye,type:"leaf",groupingKey:null}}return{groupingName:Wt,tree:t,treeDepths:{0:e.length},dataRowIds:e}},cp=({previousTree:e,actions:t})=>{const n=h({},e),o={};for(let s=0;s<t.remove.length;s+=1){const a=t.remove[s];o[a]=!0,delete n[a]}for(let s=0;s<t.insert.length;s+=1){const a=t.insert[s];n[a]={id:a,depth:0,parent:Ye,type:"leaf",groupingKey:null}}const r=n[Ye];let l=[...r.children,...t.insert];return Object.values(o).length&&(l=l.filter(s=>!o[s])),n[Ye]=h({},r,{children:l}),{groupingName:Wt,tree:n,treeDepths:{0:l.length},dataRowIds:l}},ap=e=>e.updates.type==="full"?ip(e.updates.rows):cp({previousTree:e.previousTree,actions:e.updates.actions}),up=e=>{So(e,Wt,"rowTreeCreation",ap)};class Uo extends Error{}function dp(e,t){var I;const n=c.useCallback(y=>({field:y,colDef:e.current.getColumn(y)}),[e]),o=c.useCallback(y=>{const w=e.current.getRow(y);if(!w)throw new Uo(`No row with id #${y} found`);return{id:y,columns:e.current.getAllColumns(),row:w}},[e]),r=c.useCallback((y,w,m,{cellMode:p,colDef:E,hasFocus:R,rowNode:H,tabIndex:V})=>{const A=m[w],L=E!=null&&E.valueGetter?E.valueGetter(A,m,E,e):A,P={id:y,field:w,row:m,rowNode:H,colDef:E,cellMode:p,hasFocus:R,tabIndex:V,value:L,formattedValue:L,isEditable:!1,api:null};return E&&E.valueFormatter&&(P.formattedValue=E.valueFormatter(L,m,E,e)),P.isEditable=E&&e.current.isCellEditable(P),P},[e]),l=c.useCallback((y,w)=>{var V;const m=e.current.getRow(y),p=e.current.getRowNode(y);if(!m||!p)throw new Uo(`No row with id #${y} found`);const E=ot(e),R=xr(e),H=e.current.getCellMode(y,w);return e.current.getCellParamsForRow(y,w,m,{colDef:t.unstable_listView&&((V=t.unstable_listColumn)==null?void 0:V.field)===w?dn(e.current.state):e.current.getColumn(w),rowNode:p,hasFocus:E!==null&&E.field===w&&E.id===y,tabIndex:R&&R.field===w&&R.id===y?0:-1,cellMode:H})},[e,t.unstable_listView,(I=t.unstable_listColumn)==null?void 0:I.field]),s=c.useCallback((y,w)=>{const m=e.current.getColumn(w),p=e.current.getRow(y);if(!p)throw new Uo(`No row with id #${y} found`);return!m||!m.valueGetter?p[w]:m.valueGetter(p[m.field],p,m,e)},[e]),a=c.useCallback((y,w)=>{const m=w.field;if(!w||!w.valueGetter)return y[m];const p=y[w.field];return w.valueGetter(p,y,w,e)},[e]),i=c.useCallback((y,w)=>{const m=a(y,w);return!w||!w.valueFormatter?m:w.valueFormatter(m,y,w,e)},[e,a]),d=c.useCallback(y=>e.current.rootElementRef.current?Sh(e.current.rootElementRef.current,y):null,[e]),u=c.useCallback(y=>e.current.rootElementRef.current?xh(e.current.rootElementRef.current,y):null,[e]),g=c.useCallback((y,w)=>e.current.rootElementRef.current?vh(e.current.rootElementRef.current,{id:y,field:w}):null,[e]),f={getCellValue:s,getCellParams:l,getCellElement:g,getRowValue:a,getRowFormattedValue:i,getRowParams:o,getRowElement:u,getColumnHeaderParams:n,getColumnHeaderElement:d},x={getCellParamsForRow:r};de(e,f,"public"),de(e,x,"private")}const Wi=(e,t)=>e==null||Array.isArray(e)?e:t&&t[0]===e?t:[e],gp=(e,t)=>h({},e,{rowSelection:t.rowSelection?Wi(t.rowSelectionModel)??[]:[]}),fp=(e,t)=>{var M,b,C,$,k,O,j;const n=Ue(e,"useGridSelection"),o=c.useCallback(N=>(..._)=>{t.rowSelection&&N(..._)},[t.rowSelection]),r=t.signature!==dt.DataGrid&&(((M=t.rowSelectionPropagation)==null?void 0:M.parents)||((b=t.rowSelectionPropagation)==null?void 0:b.descendants)),l=c.useMemo(()=>Wi(t.rowSelectionModel,it(e.current.state)),[e,t.rowSelectionModel]),s=c.useRef(null);e.current.registerControlState({stateId:"rowSelection",propModel:l,propOnChange:t.onRowSelectionModelChange,stateSelector:it,changeEvent:"rowSelectionChange"});const{checkboxSelection:a,disableRowSelectionOnClick:i,isRowSelectable:d}=t,u=Sr(t),g=K(e,Ze),f=K(e,Ut)>1,x=c.useCallback(N=>{let _=N;const U=s.current??N,q=e.current.isRowSelected(N);if(q){const W=cn(e),Y=W.findIndex(Z=>Z===U),Q=W.findIndex(Z=>Z===_);if(Y===Q)return;Y>Q?_=W[Q+1]:_=W[Q-1]}s.current=N,e.current.selectRowRange({startId:U,endId:_},!q)},[e]),I=c.useCallback(N=>{if(t.signature===dt.DataGrid&&!u&&Array.isArray(N)&&N.length>1)throw new Error(["MUI X: `rowSelectionModel` can only contain 1 item in DataGrid.","You need to upgrade to DataGridPro or DataGridPremium component to unlock multiple selection."].join(`
`));it(e.current.state)!==N&&(n.debug("Setting selection model"),e.current.setState(U=>h({},U,{rowSelection:t.rowSelection?N:[]})),e.current.forceUpdate())},[e,n,t.rowSelection,t.signature,u]),y=c.useCallback(N=>it(e.current.state).includes(N),[e]),w=c.useCallback(N=>{if(t.rowSelection===!1||d&&!d(e.current.getRowParams(N)))return!1;const _=e.current.getRowNode(N);return!((_==null?void 0:_.type)==="footer"||(_==null?void 0:_.type)==="pinnedRow")},[e,t.rowSelection,d]),m=c.useCallback(()=>sd(e),[e]),p=c.useCallback((N,_=!0,U=!1)=>{var q,W,Y,Q,Z,J;if(e.current.isRowSelectable(N))if(s.current=N,U){n.debug(`Setting selection for row ${N}`);const te=[],oe=X=>{te.push(X)};_&&(oe(N),r&&eo(e,g,N,((q=t.rowSelectionPropagation)==null?void 0:q.descendants)??!1,((W=t.rowSelectionPropagation)==null?void 0:W.parents)??!1,oe)),e.current.setRowSelectionModel(te)}else{n.debug(`Toggling selection for row ${N}`);const te=it(e.current.state),oe=new Set(te);oe.delete(N);const X=Ce=>{oe.add(Ce)},ie=Ce=>{oe.delete(Ce)};_?(X(N),r&&eo(e,g,N,((Y=t.rowSelectionPropagation)==null?void 0:Y.descendants)??!1,((Q=t.rowSelectionPropagation)==null?void 0:Q.parents)??!1,X)):r&&fl(e,g,N,((Z=t.rowSelectionPropagation)==null?void 0:Z.descendants)??!1,((J=t.rowSelectionPropagation)==null?void 0:J.parents)??!1,ie),(oe.size<2||u)&&e.current.setRowSelectionModel(Array.from(oe))}},[e,n,r,g,(C=t.rowSelectionPropagation)==null?void 0:C.descendants,($=t.rowSelectionPropagation)==null?void 0:$.parents,u]),E=c.useCallback((N,_=!0,U=!1)=>{n.debug("Setting selection for several rows");const q=N.filter(Q=>e.current.isRowSelectable(Q));let W;if(U){if(_){if(W=new Set(q),r){const Z=J=>{W.add(J)};q.forEach(J=>{var te,oe;eo(e,g,J,((te=t.rowSelectionPropagation)==null?void 0:te.descendants)??!1,((oe=t.rowSelectionPropagation)==null?void 0:oe.parents)??!1,Z)})}}else W=new Set;const Q=Et(e);if(W.size===Object.keys(Q).length&&Array.from(W).every(Z=>Q[Z]===Z))return}else{W=new Set(Object.values(Et(e)));const Q=J=>{W.add(J)},Z=J=>{W.delete(J)};q.forEach(J=>{var te,oe,X,ie;_?(W.add(J),r&&eo(e,g,J,((te=t.rowSelectionPropagation)==null?void 0:te.descendants)??!1,((oe=t.rowSelectionPropagation)==null?void 0:oe.parents)??!1,Q)):(Z(J),r&&fl(e,g,J,((X=t.rowSelectionPropagation)==null?void 0:X.descendants)??!1,((ie=t.rowSelectionPropagation)==null?void 0:ie.parents)??!1,Z))})}(W.size<2||u)&&e.current.setRowSelectionModel(Array.from(W))},[n,r,u,e,g,(k=t.rowSelectionPropagation)==null?void 0:k.descendants,(O=t.rowSelectionPropagation)==null?void 0:O.parents]),R=c.useCallback(({startId:N,endId:_},U=!0,q=!1)=>{if(!e.current.getRow(N)||!e.current.getRow(_))return;n.debug(`Expanding selection from row ${N} to row ${_}`);const W=cn(e),Y=W.indexOf(N),Q=W.indexOf(_),[Z,J]=Y>Q?[Q,Y]:[Y,Q],te=W.slice(Z,J+1);e.current.selectRows(te,U,q)},[e,n]),H={selectRow:p,setRowSelectionModel:I,getSelectedRows:m,isRowSelected:y,isRowSelectable:w},V={selectRows:E,selectRowRange:R};de(e,H,"public"),de(e,V,t.signature===dt.DataGrid?"private":"public");const A=c.useCallback((N=!1)=>{var J;const _=it(e.current.state),U=ut(e),q=wn(e),W=h({},Et(e)),Y=te=>t.filterMode==="server"?!U[te]:!U[te]||q[te]===!1;let Q=!1;_.forEach(te=>{var X;if(Y(te)){if(t.keepNonExistentRowsSelected)return;delete W[te],Q=!0;return}if(!((X=t.rowSelectionPropagation)!=null&&X.parents))return;const oe=g[te];if(oe.type==="group"){if(oe.isAutoGenerated){delete W[te],Q=!0;return}oe.children.every(xe=>q[xe]===!1)||(delete W[te],Q=!0)}});const Z=f&&((J=t.rowSelectionPropagation)==null?void 0:J.parents)&&Object.keys(W).length>0;if(Q||Z&&!N){const te=Object.values(W);Z?e.current.selectRows(te,!0,!0):e.current.setRowSelectionModel(te)}},[e,f,(j=t.rowSelectionPropagation)==null?void 0:j.parents,t.keepNonExistentRowsSelected,t.filterMode,g]),L=c.useCallback((N,_)=>{const U=_.metaKey||_.ctrlKey,q=!a&&!U&&!xm(_),W=!u||q,Y=e.current.isRowSelected(N);W?e.current.selectRow(N,q?!0:!Y,!0):e.current.selectRow(N,!Y,!1)},[e,u,a]),P=c.useCallback((N,_)=>{var W;if(i)return;const U=(W=_.target.closest(`.${S.cell}`))==null?void 0:W.getAttribute("data-field");if(U===Sn.field||U===Po)return;if(U){const Y=e.current.getColumn(U);if((Y==null?void 0:Y.type)===yo)return}e.current.getRowNode(N.id).type!=="pinnedRow"&&(_.shiftKey&&u?x(N.id):L(N.id,_))},[i,u,e,x,L]),D=c.useCallback((N,_)=>{var U;u&&_.shiftKey&&((U=window.getSelection())==null||U.removeAllRanges())},[u]),z=c.useCallback((N,_)=>{u&&_.nativeEvent.shiftKey?x(N.id):e.current.selectRow(N.id,N.value,!u)},[e,x,u]),F=c.useCallback(N=>{const _=t.pagination&&t.checkboxSelectionVisibleOnly&&t.paginationMode==="client"?ui(e):cn(e);e.current.selectRows(_,N.value)},[e,t.checkboxSelectionVisibleOnly,t.pagination,t.paginationMode]),T=c.useCallback((N,_)=>{if(e.current.getCellMode(N.id,N.field)!==Fe.Edit&&!Kn(_)){if(Co(_.key)&&_.shiftKey){const U=ot(e);if(U&&U.id!==N.id){_.preventDefault();const q=e.current.isRowSelected(U.id);if(!u){e.current.selectRow(U.id,!q,!0);return}const W=e.current.getRowIndexRelativeToVisibleRows(U.id),Y=e.current.getRowIndexRelativeToVisibleRows(N.id);let Q,Z;W>Y?q?(Q=Y,Z=W-1):(Q=Y,Z=W):q?(Q=W+1,Z=Y):(Q=W,Z=Y);const te=$t(e).rows.slice(Q,Z+1).map(oe=>oe.id);e.current.selectRows(te,!q);return}}if(_.key===" "&&_.shiftKey){_.preventDefault(),L(N.id,_);return}String.fromCharCode(_.keyCode)==="A"&&(_.ctrlKey||_.metaKey)&&(_.preventDefault(),E(e.current.getAllRowIds(),!0))}},[e,L,E,u]);ee(e,"sortedRowsSet",o(()=>A(!0))),ee(e,"filteredRowsSet",o(A)),ee(e,"rowClick",o(P)),ee(e,"rowSelectionCheckboxChange",o(z)),ee(e,"headerSelectionCheckboxChange",F),ee(e,"cellMouseDown",o(D)),ee(e,"cellKeyDown",o(T)),c.useEffect(()=>{l!==void 0&&e.current.setRowSelectionModel(l)},[e,l,t.rowSelection]),c.useEffect(()=>{t.rowSelection||e.current.setRowSelectionModel([])},[e,t.rowSelection]);const G=l!=null;c.useEffect(()=>{if(G||!t.rowSelection)return;const N=it(e.current.state);if(w){const _=N.filter(U=>w(U));_.length<N.length&&e.current.setRowSelectionModel(_)}},[e,w,G,t.rowSelection]),c.useEffect(()=>{if(!t.rowSelection||G)return;const N=it(e.current.state);!u&&N.length>1&&e.current.setRowSelectionModel([])},[e,u,a,G,t.rowSelection]),c.useEffect(()=>{o(A)},[A,o])},hp=e=>{const{classes:t}=e;return c.useMemo(()=>fe({cellCheckbox:["cellCheckbox"],columnHeaderCheckbox:["columnHeaderCheckbox"]},pe,t),[t])},mp=(e,t)=>{const n={classes:t.classes},o=hp(n),r=c.useCallback(l=>{const s=h({},Sn,{cellClassName:o.cellCheckbox,headerClassName:o.columnHeaderCheckbox,headerName:e.current.getLocaleText("checkboxSelectionHeaderName")}),a=t.checkboxSelection,i=l.lookup[Mt]!=null;return a&&!i?(l.lookup[Mt]=s,l.orderedFields=[Mt,...l.orderedFields]):!a&&i?(delete l.lookup[Mt],l.orderedFields=l.orderedFields.filter(d=>d!==Mt)):a&&i&&(l.lookup[Mt]=h({},s,l.lookup[Mt])),l},[e,o,t.checkboxSelection]);Re(e,"hydrateColumns",r)},bp=(e,t)=>{var o,r;const n=t.sortModel??((r=(o=t.initialState)==null?void 0:o.sorting)==null?void 0:r.sortModel)??[];return h({},e,{sorting:{sortModel:Ds(n,t.disableMultipleColumnsSorting),sortedRows:[]}})},Cp=(e,t)=>{var H,V;const n=Ue(e,"useGridSorting");e.current.registerControlState({stateId:"sortModel",propModel:t.sortModel,propOnChange:t.onSortModelChange,stateSelector:ht,changeEvent:"sortModelChange"});const o=c.useCallback((A,L)=>{const P=ht(e),D=P.findIndex(F=>F.field===A);let z=[...P];return D>-1?(L==null?void 0:L.sort)==null?z.splice(D,1):z.splice(D,1,L):z=[...P,L],z},[e]),r=c.useCallback((A,L)=>{const D=ht(e).find(z=>z.field===A.field);if(D){const z=L===void 0?tl(A.sortingOrder??t.sortingOrder,D.sort):L;return z===void 0?void 0:h({},D,{sort:z})}return{field:A.field,sort:L===void 0?tl(A.sortingOrder??t.sortingOrder):L}},[e,t.sortingOrder]),l=c.useCallback((A,L)=>L==null||L.sortable===!1||t.disableColumnSorting?A:(L.sortingOrder||t.sortingOrder).some(D=>!!D)?[...A,"columnMenuSortItem"]:A,[t.sortingOrder,t.disableColumnSorting]),s=c.useCallback(()=>{e.current.setState(A=>{if(t.sortingMode==="server")return n.debug("Skipping sorting rows as sortingMode = server"),h({},A,{sorting:h({},A.sorting,{sortedRows:br(Ze(e),Ye,!1)})});const L=ht(A,e.current.instanceId),P=Za(L,e),D=e.current.applyStrategyProcessor("sorting",{sortRowList:P});return h({},A,{sorting:h({},A.sorting,{sortedRows:D})})}),e.current.publishEvent("sortedRowsSet"),e.current.forceUpdate()},[e,n,t.sortingMode]),a=c.useCallback(A=>{ht(e)!==A&&(n.debug("Setting sort model"),e.current.setState(el(A,t.disableMultipleColumnsSorting)),e.current.forceUpdate(),e.current.applySorting())},[e,n,t.disableMultipleColumnsSorting]),i=c.useCallback((A,L,P)=>{const D=e.current.getColumn(A),z=r(D,L);let F;!P||t.disableMultipleColumnsSorting?F=(z==null?void 0:z.sort)==null?[]:[z]:F=o(D.field,z),e.current.setSortModel(F)},[e,o,r,t.disableMultipleColumnsSorting]),d=c.useCallback(()=>ht(e),[e]),u=c.useCallback(()=>Cr(e).map(L=>L.model),[e]),g=c.useCallback(()=>pn(e),[e]),f=c.useCallback(A=>e.current.getSortedRowIds()[A],[e]);de(e,{getSortModel:d,getSortedRows:u,getSortedRowIds:g,getRowIdFromRowIndex:f,setSortModel:a,sortColumn:i,applySorting:s},"public");const I=c.useCallback((A,L)=>{var z,F;const P=ht(e);return!L.exportOnlyDirtyModels||t.sortModel!=null||((F=(z=t.initialState)==null?void 0:z.sorting)==null?void 0:F.sortModel)!=null||P.length>0?h({},A,{sorting:{sortModel:P}}):A},[e,t.sortModel,(V=(H=t.initialState)==null?void 0:H.sorting)==null?void 0:V.sortModel]),y=c.useCallback((A,L)=>{var D;const P=(D=L.stateToRestore.sorting)==null?void 0:D.sortModel;return P==null?A:(e.current.setState(el(P,t.disableMultipleColumnsSorting)),h({},A,{callbacks:[...A.callbacks,e.current.applySorting]}))},[e,t.disableMultipleColumnsSorting]),w=c.useCallback(A=>{const L=Ze(e),P=L[Ye],D=A.sortRowList?A.sortRowList(P.children.map(z=>L[z])):[...P.children];return P.footerId!=null&&D.push(P.footerId),D},[e]);Re(e,"exportState",I),Re(e,"restoreState",y),So(e,Wt,"sorting",w);const m=c.useCallback(({field:A,colDef:L},P)=>{if(!L.sortable||t.disableColumnSorting)return;const D=P.shiftKey||P.metaKey||P.ctrlKey;i(A,void 0,D)},[i,t.disableColumnSorting]),p=c.useCallback(({field:A,colDef:L},P)=>{!L.sortable||t.disableColumnSorting||P.key==="Enter"&&!P.ctrlKey&&!P.metaKey&&i(A,void 0,P.shiftKey)},[i,t.disableColumnSorting]),E=c.useCallback(()=>{const A=ht(e),L=Tt(e);if(A.length>0){const P=A.filter(D=>L[D.field]);P.length<A.length&&e.current.setSortModel(P)}},[e]),R=c.useCallback(A=>{A==="sorting"&&e.current.applySorting()},[e]);Re(e,"columnMenu",l),ee(e,"columnHeaderClick",m),ee(e,"columnHeaderKeyDown",p),ee(e,"rowsSet",e.current.applySorting),ee(e,"columnsChange",E),ee(e,"activeStrategyProcessorChange",R),Nn(()=>{e.current.applySorting()}),Je(()=>{t.sortModel!==void 0&&e.current.setSortModel(t.sortModel)},[e,t.sortModel])};function ql(e){const{containerSize:t,scrollPosition:n,elementSize:o,elementOffset:r}=e,l=r+o;if(o>t)return r;if(l-t>n)return l-t;if(r<n)return r}const pp=(e,t)=>{const n=It(),o=Ue(e,"useGridScroll"),r=e.current.columnHeadersContainerRef,l=e.current.virtualScrollerRef,s=K(e,At),a=c.useCallback(g=>{var m;const f=qe(e.current.state),x=An(e),I=t.unstable_listView?[dn(e.current.state)]:je(e);if(!(g.rowIndex==null)&&x===0||I.length===0)return!1;o.debug(`Scrolling to cell at row ${g.rowIndex}, col: ${g.colIndex} `);let w={};if(g.colIndex!==void 0){const p=Vt(e);let E;if(typeof g.rowIndex<"u"){const R=(m=s[g.rowIndex])==null?void 0:m.id,H=e.current.unstable_getCellColSpanInfo(R,g.colIndex);H&&!H.spannedByColSpan&&(E=H.cellProps.width)}typeof E>"u"&&(E=I[g.colIndex].computedWidth),w.left=ql({containerSize:f.viewportOuterSize.width,scrollPosition:Math.abs(l.current.scrollLeft),elementSize:E,elementOffset:p[g.colIndex]})}if(g.rowIndex!==void 0){const p=Wn(e.current.state),E=vd(e),R=ci(e),H=t.pagination?g.rowIndex-E*R:g.rowIndex,V=p.positions[H+1]?p.positions[H+1]-p.positions[H]:p.currentPageTotalHeight-p.positions[H];w.top=ql({containerSize:f.viewportInnerSize.height,scrollPosition:l.current.scrollTop,elementSize:V,elementOffset:p.positions[H]})}return w=e.current.unstable_applyPipeProcessors("scrollToIndexes",w,g),typeof w.left!==void 0||typeof w.top!==void 0?(e.current.scroll(w),!0):!1},[o,e,l,t.pagination,s,t.unstable_listView]),i=c.useCallback(g=>{if(l.current&&g.left!==void 0&&r.current){const f=n?-1:1;r.current.scrollLeft=g.left,l.current.scrollLeft=f*g.left,o.debug(`Scrolling left: ${g.left}`)}l.current&&g.top!==void 0&&(l.current.scrollTop=g.top,o.debug(`Scrolling top: ${g.top}`)),o.debug("Scrolling, updating container, and viewport")},[l,n,r,o]),d=c.useCallback(()=>l!=null&&l.current?{top:l.current.scrollTop,left:l.current.scrollLeft}:{top:0,left:0},[l]);de(e,{scroll:i,scrollToIndexes:a,getScrollPosition:d},"public")};function wp(e,t){Te(e,"columnHeaderClick",t.onColumnHeaderClick),Te(e,"columnHeaderContextMenu",t.onColumnHeaderContextMenu),Te(e,"columnHeaderDoubleClick",t.onColumnHeaderDoubleClick),Te(e,"columnHeaderOver",t.onColumnHeaderOver),Te(e,"columnHeaderOut",t.onColumnHeaderOut),Te(e,"columnHeaderEnter",t.onColumnHeaderEnter),Te(e,"columnHeaderLeave",t.onColumnHeaderLeave),Te(e,"cellClick",t.onCellClick),Te(e,"cellDoubleClick",t.onCellDoubleClick),Te(e,"cellKeyDown",t.onCellKeyDown),Te(e,"preferencePanelClose",t.onPreferencePanelClose),Te(e,"preferencePanelOpen",t.onPreferencePanelOpen),Te(e,"menuOpen",t.onMenuOpen),Te(e,"menuClose",t.onMenuClose),Te(e,"rowDoubleClick",t.onRowDoubleClick),Te(e,"rowClick",t.onRowClick),Te(e,"stateChange",t.onStateChange)}function Sp(e,t=166){let n,o;const r=()=>{n=void 0,e(...o)};function l(...s){o=s,n===void 0&&(n=setTimeout(r,t))}return l.clear=()=>{clearTimeout(n),n=void 0},l}const nr={autoHeight:!1,autoPageSize:!1,autosizeOnMount:!1,checkboxSelection:!1,checkboxSelectionVisibleOnly:!1,clipboardCopyCellDelimiter:"	",columnBufferPx:150,columnHeaderHeight:56,disableAutosize:!1,disableColumnFilter:!1,disableColumnMenu:!1,disableColumnReorder:!1,disableColumnResize:!1,disableColumnSelector:!1,disableColumnSorting:!1,disableDensitySelector:!1,disableEval:!1,disableMultipleColumnsFiltering:!1,disableMultipleColumnsSorting:!1,disableMultipleRowSelection:!1,disableRowSelectionOnClick:!1,disableVirtualization:!1,editMode:vt.Cell,filterDebounceMs:150,filterMode:"client",hideFooter:!1,hideFooterPagination:!1,hideFooterRowCount:!1,hideFooterSelectedRowCount:!1,ignoreDiacritics:!1,ignoreValueFormatterDuringExport:!1,indeterminateCheckboxAction:"deselect",keepColumnPositionIfDraggedOutside:!1,keepNonExistentRowsSelected:!1,loading:!1,logger:console,logLevel:"error",pageSizeOptions:[25,50,100],pagination:!1,paginationMode:"client",resizeThrottleMs:60,rowBufferPx:150,rowHeight:52,rowPositionsDebounceMs:166,rows:[],rowSelection:!0,rowSpacingType:"margin",showCellVerticalBorder:!1,showColumnVerticalBorder:!1,sortingMode:"client",sortingOrder:["asc","desc",null],throttleRowsMs:0,unstable_rowSpanning:!1,virtualizeColumnsWithAutoRowHeight:!1},Jt={width:0,height:0},xp={isReady:!1,root:Jt,viewportOuterSize:Jt,viewportInnerSize:Jt,contentSize:Jt,minimumSize:Jt,hasScrollX:!1,hasScrollY:!1,scrollbarSize:0,headerHeight:0,groupHeaderHeight:0,headerFilterHeight:0,rowWidth:0,rowHeight:0,columnsTotalWidth:0,leftPinnedWidth:0,rightPinnedWidth:0,headersTotalHeight:0,topContainerHeight:0,bottomContainerHeight:0},vp=(e,t,n)=>{const o=xp,r=hn(n);return h({},e,{dimensions:h({},o,Ki(t,n,r,bn(n)))})},Ui=le(je,Vt,(e,t)=>{const n=e.length;return n===0?0:nn(t[n-1]+e[n-1].computedWidth,1)});function yp(e,t){const n=Ue(e,"useResizeContainer"),o=c.useRef(!1),r=c.useRef(Jt),l=K(e,bn),s=K(e,hn),a=K(e,Ui),i=c.useRef(!0),{rowHeight:d,headerHeight:u,groupHeaderHeight:g,headerFilterHeight:f,headersTotalHeight:x,leftPinnedWidth:I,rightPinnedWidth:y}=Ki(t,e,s,l),w=c.useRef(void 0),m=c.useCallback(()=>qe(e.current.state),[e]),p=c.useCallback(F=>{e.current.setState(T=>h({},T,{dimensions:F})),e.current.rootElementRef.current&&Xl(e.current.rootElementRef.current,qe(e.current.state))},[e]),E=c.useCallback(()=>{const F=e.current.mainElementRef.current;if(!F)return;const T=ac(F).getComputedStyle(F),G={width:parseFloat(T.width)||0,height:parseFloat(T.height)||0};(!w.current||!Ql(w.current,G))&&(e.current.publishEvent("resize",G),w.current=G)},[e]),R=c.useCallback(()=>{const F=qe(e.current.state);if(!F.isReady)return 0;const T=$t(e);if(t.getRowHeight){const M=Un(e),b=M.lastRowIndex-M.firstRowIndex;return Math.min(b-1,T.rows.length)}const G=Math.floor(F.viewportInnerSize.height/d);return Math.min(G,T.rows.length)},[e,t.getRowHeight,d]),H=c.useCallback(()=>{var Y,Q;if(i.current)return;const F=e.current.rootElementRef.current,T=Ip(F,t.scrollbarSize),G=Wn(e.current.state),M=x+G.pinnedTopRowsTotalHeight,b=G.pinnedBottomRowsTotalHeight,$={width:a-I-y,height:nn(G.currentPageTotalHeight,1)};let k,O,j=!1,N=!1;if(t.autoHeight)N=!1,j=Math.round(a)>Math.round(r.current.width),k={width:r.current.width,height:M+b+$.height},O={width:Math.max(0,k.width-(N?T:0)),height:Math.max(0,k.height-(j?T:0))};else{k={width:r.current.width,height:r.current.height},O={width:Math.max(0,k.width-I-y),height:Math.max(0,k.height-M-b)};const Z=$,J=O,te=Z.width>J.width,oe=Z.height>J.height;(te||oe)&&(N=oe,j=Z.width+(N?T:0)>J.width,j&&(N=Z.height+T>J.height)),N&&(O.width-=T),j&&(O.height-=T)}const _=Math.max(k.width,a+(N?T:0)),U={width:a,height:M+$.height+b},q={isReady:!0,root:r.current,viewportOuterSize:k,viewportInnerSize:O,contentSize:$,minimumSize:U,hasScrollX:j,hasScrollY:N,scrollbarSize:T,headerHeight:u,groupHeaderHeight:g,headerFilterHeight:f,rowWidth:_,rowHeight:d,columnsTotalWidth:a,leftPinnedWidth:I,rightPinnedWidth:y,headersTotalHeight:x,topContainerHeight:M,bottomContainerHeight:b},W=e.current.state.dimensions;jt(W,q)||(p(q),Ql(q.viewportInnerSize,W.viewportInnerSize)||e.current.publishEvent("viewportInnerSizeChange",q.viewportInnerSize),(Q=(Y=e.current).updateRenderContext)==null||Q.call(Y))},[e,p,t.scrollbarSize,t.autoHeight,d,u,g,f,a,x,I,y]),V=ze(H),A=c.useMemo(()=>t.resizeThrottleMs>0?Sp(()=>{V(),e.current.publishEvent("debouncedResize",r.current)},t.resizeThrottleMs):void 0,[e,t.resizeThrottleMs,V]);c.useEffect(()=>A==null?void 0:A.clear,[A]);const L={resize:E,getRootDimensions:m},P={updateDimensions:H,getViewportPageSize:R};Je(H,[H]),de(e,L,"public"),de(e,P,"private");const D=c.useCallback(F=>{Xl(F,qe(e.current.state))},[e]),z=c.useCallback(F=>{if(r.current=F,F.height===0&&!o.current&&!t.autoHeight&&!mo&&(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),F.width===0&&!o.current&&!mo&&(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),i.current||!A){i.current=!1,H();return}A()},[H,t.autoHeight,A,n]);Te(e,"rootMount",D),Te(e,"resize",z),Te(e,"debouncedResize",t.onResize)}function Xl(e,t){const n=(o,r)=>e.style.setProperty(o,r);n("--DataGrid-hasScrollX",`${Number(t.hasScrollX)}`),n("--DataGrid-hasScrollY",`${Number(t.hasScrollY)}`),n("--DataGrid-scrollbarSize",`${t.scrollbarSize}px`),n("--DataGrid-rowWidth",`${t.rowWidth}px`),n("--DataGrid-columnsTotalWidth",`${t.columnsTotalWidth}px`),n("--DataGrid-leftPinnedWidth",`${t.leftPinnedWidth}px`),n("--DataGrid-rightPinnedWidth",`${t.rightPinnedWidth}px`),n("--DataGrid-headerHeight",`${t.headerHeight}px`),n("--DataGrid-headersTotalHeight",`${t.headersTotalHeight}px`),n("--DataGrid-topContainerHeight",`${t.topContainerHeight}px`),n("--DataGrid-bottomContainerHeight",`${t.bottomContainerHeight}px`),n("--height",`${t.rowHeight}px`)}function Ki(e,t,n,o){const r=qs(e.rowHeight,nr.rowHeight);return{rowHeight:Math.floor(r*n),headerHeight:Math.floor(e.columnHeaderHeight*n),groupHeaderHeight:Math.floor((e.columnGroupHeaderHeight??e.columnHeaderHeight)*n),headerFilterHeight:Math.floor((e.headerFilterHeight??e.columnHeaderHeight)*n),columnsTotalWidth:Ui(t),headersTotalHeight:Ir(t,e),leftPinnedWidth:o.left.reduce((l,s)=>l+s.computedWidth,0),rightPinnedWidth:o.right.reduce((l,s)=>l+s.computedWidth,0)}}const Yl=new WeakMap;function Ip(e,t){if(t!==void 0)return t;if(e===null)return 0;const n=Yl.get(e);if(n!==void 0)return n;const r=Rt(e).createElement("div");r.style.width="99px",r.style.height="99px",r.style.position="absolute",r.style.overflow="scroll",r.className="scrollDiv",e.appendChild(r);const l=r.offsetWidth-r.clientWidth;return e.removeChild(r),Yl.set(e,l),l}function Ql(e,t){return e.width===t.width&&e.height===t.height}const Pp=typeof globalThis.ResizeObserver<"u"?globalThis.ResizeObserver:class{observe(){}unobserve(){}disconnect(){}},Mp=(e,t,n)=>{n.current.caches.rowsMeta={heights:new Map};const o=dr(n.current.state),r=An(n),l=jn(n.current.state),s=Math.min(l.enabled?l.paginationModel.pageSize:r,r);return h({},e,{rowsMeta:{currentPageTotalHeight:s*o,positions:Array.from({length:s},(a,i)=>i*o),pinnedTopRowsTotalHeight:0,pinnedBottomRowsTotalHeight:0}})},kp=(e,t)=>{const{getRowHeight:n,getRowSpacing:o,getEstimatedRowHeight:r}=t,l=e.current.caches.rowsMeta.heights,s=c.useRef(-1),a=c.useRef(!1),i=c.useRef(!1),d=K(e,hn),u=Mr(e),g=K(e,Cn),f=K(e,dr),x=D=>{let z=l.get(D);return z===void 0&&(z={content:f,spacingTop:0,spacingBottom:0,detail:0,autoHeight:!1,needsFirstMeasurement:!0},l.set(D,z)),z},I=c.useCallback(D=>{const z=qe(e.current.state).rowHeight,F=e.current.getRowHeightEntry(D.id);if(!n)F.content=z,F.needsFirstMeasurement=!1;else{const T=n(h({},D,{densityFactor:d}));if(T==="auto"){if(F.needsFirstMeasurement){const G=r?r(h({},D,{densityFactor:d})):z;F.content=G??z}a.current=!0,F.autoHeight=!0}else F.content=qs(T,z),F.needsFirstMeasurement=!1,F.autoHeight=!1}if(o){const T=e.current.getRowIndexRelativeToVisibleRows(D.id),G=o(h({},D,{isFirstVisible:T===0,isLastVisible:T===u.rows.length-1,indexRelativeToCurrentPage:T}));F.spacingTop=G.top??0,F.spacingBottom=G.bottom??0}else F.spacingTop=0,F.spacingBottom=0;return e.current.unstable_applyPipeProcessors("rowHeight",F,D),F},[e,u.rows,n,r,f,o,d]),y=c.useCallback(()=>{a.current=!1;const D=g.top.reduce((b,C)=>{const $=I(C);return b+$.content+$.spacingTop+$.spacingBottom+$.detail},0),z=g.bottom.reduce((b,C)=>{const $=I(C);return b+$.content+$.spacingTop+$.spacingBottom+$.detail},0),F=[],T=u.rows.reduce((b,C)=>{F.push(b);const $=I(C),k=$.content+$.spacingTop+$.spacingBottom+$.detail;return b+k},0);a.current||(s.current=1/0);const G=D!==e.current.state.rowsMeta.pinnedTopRowsTotalHeight||z!==e.current.state.rowsMeta.pinnedBottomRowsTotalHeight||T!==e.current.state.rowsMeta.currentPageTotalHeight,M={currentPageTotalHeight:T,positions:F,pinnedTopRowsTotalHeight:D,pinnedBottomRowsTotalHeight:z};e.current.setState(b=>h({},b,{rowsMeta:M})),G&&e.current.updateDimensions(),i.current=!0},[e,g,u.rows,I]),w=D=>{var z;return((z=l.get(D))==null?void 0:z.content)??f},m=(D,z)=>{const F=e.current.getRowHeightEntry(D),T=F.content!==z;F.needsFirstMeasurement=!1,F.content=z,i.current&&(i.current=!T)},p=D=>{var z;return((z=l.get(D))==null?void 0:z.autoHeight)??!1},E=()=>s.current,R=D=>{a.current&&D>s.current&&(s.current=D)},H=()=>{l.clear(),y()},V=yt(()=>new Pp(D=>{for(let z=0;z<D.length;z+=1){const F=D[z],T=F.borderBoxSize&&F.borderBoxSize.length>0?F.borderBoxSize[0].blockSize:F.contentRect.height,G=F.target.__mui_id;e.current.unstable_storeRowHeightMeasurement(G,T)}i.current||e.current.requestPipeProcessorsApplication("rowHeight")})).current,A=(D,z)=>(D.__mui_id=z,V.observe(D),()=>V.unobserve(D));Dr(e,"rowHeight",y),Je(()=>{y()},[y]);const L={unstable_getRowHeight:w,unstable_setLastMeasuredRowIndex:R,unstable_storeRowHeightMeasurement:m,resetRowHeights:H},P={hydrateRowsMeta:y,observeRowHeight:A,rowHasAutoHeight:p,getRowHeightEntry:x,getLastMeasuredRowIndex:E};de(e,L,"public"),de(e,P,"private")},Ep=e=>{const t=c.useCallback((r={})=>e.current.unstable_applyPipeProcessors("exportState",{},r),[e]),n=c.useCallback(r=>{e.current.unstable_applyPipeProcessors("restoreState",{callbacks:[]},{stateToRestore:r}).callbacks.forEach(s=>{s()}),e.current.forceUpdate()},[e]);de(e,{exportState:t,restoreState:n},"public")},Fp=e=>{const t=c.useRef({}),n=(a,i)=>{var d;return(d=t.current[a])==null?void 0:d[i]},o=()=>{t.current={}},r=c.useCallback(({rowId:a,minFirstColumn:i,maxLastColumn:d,columns:u})=>{for(let g=i;g<d;g+=1){const f=Tp({apiRef:e,lookup:t.current,columnIndex:g,rowId:a,minFirstColumnIndex:i,maxLastColumnIndex:d,columns:u});f.colSpan>1&&(g+=f.colSpan-1)}},[e]),l={unstable_getCellColSpanInfo:n},s={resetColSpan:o,calculateColSpan:r};de(e,l,"public"),de(e,s,"private"),ee(e,"columnOrderChange",o)};function Tp(e){const{apiRef:t,lookup:n,columnIndex:o,rowId:r,minFirstColumnIndex:l,maxLastColumnIndex:s,columns:a}=e,i=a.length,d=a[o],u=t.current.getRow(r),g=t.current.getRowValue(u,d),f=typeof d.colSpan=="function"?d.colSpan(g,u,d,t):d.colSpan;if(!f||f===1)return Ko(n,r,o,{spannedByColSpan:!1,cellProps:{colSpan:1,width:d.computedWidth}}),{colSpan:1};let x=d.computedWidth;for(let I=1;I<f;I+=1){const y=o+I;if(y>=l&&y<s){const w=a[y];x+=w.computedWidth,Ko(n,r,o+I,{spannedByColSpan:!0,rightVisibleCellIndex:Math.min(o+f,i-1),leftVisibleCellIndex:o})}Ko(n,r,o,{spannedByColSpan:!1,cellProps:{colSpan:f,width:x}})}return{colSpan:f}}function Ko(e,t,n,o){e[t]||(e[t]={}),e[t][n]=o}const qi=(e,t,n)=>{if(zs(e)){if(n[e.field]!==void 0)throw new Error(["MUI X: columnGroupingModel contains duplicated field",`column field ${e.field} occurs 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=>{qi(l,[...t,o],n)})},or=e=>{if(!e)return{};const t={};return e.forEach(n=>{qi(n,[],t)}),t},rr=(e,t,n)=>{const o=i=>t[i]??[],r=[],l=Math.max(...e.map(i=>o(i).length)),s=(i,d,u)=>jt(o(i).slice(0,u+1),o(d).slice(0,u+1)),a=(i,d)=>!!(n!=null&&n.left&&n.left.includes(i)&&!n.left.includes(d)||n!=null&&n.right&&!n.right.includes(i)&&n.right.includes(d));for(let i=0;i<l;i+=1){const d=e.reduce((u,g)=>{const f=o(g)[i]??null;if(u.length===0)return[{columnFields:[g],groupId:f}];const x=u[u.length-1],I=x.columnFields[x.columnFields.length-1];return x.groupId!==f||!s(I,g,i)||a(I,g)?[...u,{columnFields:[g],groupId:f}]:[...u.slice(0,u.length-1),{columnFields:[...x.columnFields,g],groupId:f}]},[]);r.push(d)}return r},Hp=["groupId","children"],Or=e=>{let t={};return e.forEach(n=>{if(zs(n))return;const{groupId:o,children:r}=n,l=re(n,Hp);if(!o)throw new Error("MUI X: An element of the columnGroupingModel does not have either `field` or `groupId`.");const s=h({},l,{groupId:o}),a=Or(r);if(a[o]!==void 0||t[o]!==void 0)throw new Error(`MUI X: The groupId ${o} is used multiple times in the columnGroupingModel.`);t=h({},t,a,{[o]:s})}),h({},t)},Dp=(e,t,n)=>{if(!t.columnGroupingModel)return e;const o=kt(n),r=mn(n),l=Or(t.columnGroupingModel??[]),s=or(t.columnGroupingModel??[]),a=rr(o,s,n.current.state.pinnedColumns??{}),i=r.length===0?0:Math.max(...r.map(d=>{var u;return((u=s[d])==null?void 0:u.length)??0}));return h({},e,{columnGrouping:{lookup:l,unwrappedGroupingModel:s,headerStructure:a,maxDepth:i}})},Op=(e,t)=>{const n=c.useCallback(a=>hi(e)[a]??[],[e]),o=c.useCallback(()=>mi(e),[e]);de(e,{getColumnGroupPath:n,getAllGroupDetails:o},"public");const l=c.useCallback(()=>{const a=or(t.columnGroupingModel??[]);e.current.setState(i=>{var f;const d=((f=i.columns)==null?void 0:f.orderedFields)??[],u=i.pinnedColumns??{},g=rr(d,a,u);return h({},i,{columnGrouping:h({},i.columnGrouping,{headerStructure:g})})})},[e,t.columnGroupingModel]),s=c.useCallback(a=>{var y,w;const i=((w=(y=e.current).getPinnedColumns)==null?void 0:w.call(y))??{},d=kt(e),u=mn(e),g=Or(a??[]),f=or(a??[]),x=rr(d,f,i),I=u.length===0?0:Math.max(...u.map(m=>{var p;return((p=f[m])==null?void 0:p.length)??0}));e.current.setState(m=>h({},m,{columnGrouping:{lookup:g,unwrappedGroupingModel:f,headerStructure:x,maxDepth:I}}))},[e]);ee(e,"columnIndexChange",l),ee(e,"columnsChange",()=>{s(t.columnGroupingModel)}),ee(e,"columnVisibilityModelChange",()=>{s(t.columnGroupingModel)}),c.useEffect(()=>{s(t.columnGroupingModel)},[s,t.columnGroupingModel])};function Lp(){let e,t;const n=new Promise((o,r)=>{e=o,t=r});return n.resolve=e,n.reject=t,n}function Zl(e,t){if(t!==void 0&&e.changedTouches){for(let n=0;n<e.changedTouches.length;n+=1){const o=e.changedTouches[n];if(o.identifier===t)return{x:o.clientX,y:o.clientY}}return!1}return{x:e.clientX,y:e.clientY}}function Jl(e,t,n,o){let r=e;return o==="Right"?r+=t-n.left:r+=n.right-t,r}function Gp(e,t,n){return n==="Left"?e-t.left:t.right-e}function Rp(e){return e==="Right"?"Left":"Right"}function $p(e,t){const n=e.classList.contains(S["columnSeparator--sideRight"])?"Right":"Left";return t?Rp(n):n}function es(e){e.preventDefault(),e.stopImmediatePropagation()}function zp(e){const t=c.useRef(void 0),n=()=>xi(e),o=K(e,n);return c.useEffect(()=>{t.current&&o===!1&&(t.current.resolve(),t.current=void 0)}),()=>{if(!t.current){if(n()===!1)return Promise.resolve();t.current=Lp()}return t.current}}function Vp(e,t){if(e.length<4)return e;const n=e.slice();n.sort((a,i)=>a-i);const o=n[Math.floor(n.length*.25)],r=n[Math.floor(n.length*.75)-1],l=r-o,s=l<5?5:l*t;return n.filter(a=>a>o-s&&a<r+s)}function Ap(e,t,n){const o={},r=e.current.rootElementRef.current;return r.classList.add(S.autosizing),n.forEach(l=>{const a=Oh(e.current,l.field).map(I=>I.getBoundingClientRect().width??0),i=t.includeOutliers?a:Vp(a,t.outliersFactor);if(t.includeHeaders){const I=Dh(e.current,l.field);if(I){const y=I.querySelector(`.${S.columnHeaderTitle}`),w=I.querySelector(`.${S.columnHeaderTitleContainerContent}`),m=I.querySelector(`.${S.iconButtonContainer}`),p=I.querySelector(`.${S.menuIcon}`),E=y??w,R=window.getComputedStyle(I,null),H=parseInt(R.paddingLeft,10)+parseInt(R.paddingRight,10),A=E.scrollWidth+1+H+((m==null?void 0:m.clientWidth)??0)+((p==null?void 0:p.clientWidth)??0);i.push(A)}}const d=l.minWidth!==-1/0&&l.minWidth!==void 0,u=l.maxWidth!==1/0&&l.maxWidth!==void 0,g=d?l.minWidth:0,f=u?l.maxWidth:1/0,x=i.length===0?0:Math.max(...i);o[l.field]=lt(x,g,f)}),r.classList.remove(S.autosizing),o}const Np=e=>h({},e,{columnResize:{resizingColumnField:""}});function jp(){return{colDef:void 0,initialColWidth:0,initialTotalWidth:0,previousMouseClickEvent:void 0,columnHeaderElement:void 0,headerFilterElement:void 0,groupHeaderElements:[],cellElements:[],leftPinnedCellsAfter:[],rightPinnedCellsBefore:[],fillerLeft:void 0,fillerRight:void 0,leftPinnedHeadersAfter:[],rightPinnedHeadersBefore:[]}}const _p=(e,t)=>{const n=It(),o=Ue(e,"useGridColumnResize"),r=yt(jp).current,l=c.useRef(null),s=c.useRef(null),a=fn(),i=c.useRef(void 0),d=P=>{var M,b;o.debug(`Updating width to ${P} for col ${r.colDef.field}`);const D=r.columnHeaderElement.offsetWidth,z=P-D,F=P-r.initialColWidth;if(F>0){const C=r.initialTotalWidth+F;(b=(M=e.current.rootElementRef)==null?void 0:M.current)==null||b.style.setProperty("--DataGrid-rowWidth",`${C}px`)}r.colDef.computedWidth=P,r.colDef.width=P,r.colDef.flex=0,r.columnHeaderElement.style.width=`${P}px`;const T=r.headerFilterElement;T&&(T.style.width=`${P}px`),r.groupHeaderElements.forEach(C=>{const $=C;let k;$.getAttribute("aria-colspan")==="1"?k=`${P}px`:k=`${$.offsetWidth+z}px`,$.style.width=k}),r.cellElements.forEach(C=>{const $=C;let k;$.getAttribute("aria-colspan")==="1"?k=`${P}px`:k=`${$.offsetWidth+z}px`,$.style.setProperty("--width",k)});const G=e.current.unstable_applyPipeProcessors("isColumnPinned",!1,r.colDef.field);G===Lt.LEFT&&(Qt(r.fillerLeft,"width",z),r.leftPinnedCellsAfter.forEach(C=>{Qt(C,"left",z)}),r.leftPinnedHeadersAfter.forEach(C=>{Qt(C,"left",z)})),G===Lt.RIGHT&&(Qt(r.fillerRight,"width",z),r.rightPinnedCellsBefore.forEach(C=>{Qt(C,"right",z)}),r.rightPinnedHeadersBefore.forEach(C=>{Qt(C,"right",z)}))},u=P=>{if(m(),r.previousMouseClickEvent){const D=r.previousMouseClickEvent,z=D.timeStamp,F=D.clientX,T=D.clientY;if(P.timeStamp-z<300&&P.clientX===F&&P.clientY===T){r.previousMouseClickEvent=void 0,e.current.publishEvent("columnResizeStop",null,P);return}}if(r.colDef){e.current.setColumnWidth(r.colDef.field,r.colDef.width),o.debug(`Updating col ${r.colDef.field} with new width: ${r.colDef.width}`);const D=xt(e.current.state);r.groupHeaderElements.forEach(z=>{const F=Ph(z),T=z,M=`${F.reduce((b,C)=>D.columnVisibilityModel[C]!==!1?b+D.lookup[C].computedWidth:b,0)}px`;T.style.width=M})}a.start(0,()=>{e.current.publishEvent("columnResizeStop",null,P)})},g=(P,D,z)=>{var M;const F=e.current.rootElementRef.current;r.initialColWidth=P.computedWidth,r.initialTotalWidth=e.current.getRootDimensions().rowWidth,r.colDef=P,r.columnHeaderElement=Ih(e.current.columnHeadersContainerRef.current,P.field);const T=F.querySelector(`.${S.headerFilterRow} [data-field="${Ht(P.field)}"]`);T&&(r.headerFilterElement=T),r.groupHeaderElements=Mh((M=e.current.columnHeadersContainerRef)==null?void 0:M.current,P.field),r.cellElements=kh(r.columnHeaderElement,e.current),r.fillerLeft=El(e.current,n?"filler--pinnedRight":"filler--pinnedLeft"),r.fillerRight=El(e.current,n?"filler--pinnedLeft":"filler--pinnedRight");const G=e.current.unstable_applyPipeProcessors("isColumnPinned",!1,r.colDef.field);r.leftPinnedCellsAfter=G!==Lt.LEFT?[]:Eh(e.current,r.columnHeaderElement,n),r.rightPinnedCellsBefore=G!==Lt.RIGHT?[]:Fh(e.current,r.columnHeaderElement,n),r.leftPinnedHeadersAfter=G!==Lt.LEFT?[]:Th(e.current,r.columnHeaderElement,n),r.rightPinnedHeadersBefore=G!==Lt.RIGHT?[]:Hh(e.current,r.columnHeaderElement,n),s.current=$p(D,n),l.current=Gp(z,r.columnHeaderElement.getBoundingClientRect(),s.current)},f=ze(u),x=ze(P=>{if(P.buttons===0){f(P);return}let D=Jl(l.current,P.clientX,r.columnHeaderElement.getBoundingClientRect(),s.current);D=lt(D,r.colDef.minWidth,r.colDef.maxWidth),d(D);const z={element:r.columnHeaderElement,colDef:r.colDef,width:D};e.current.publishEvent("columnResize",z,P)}),I=ze(P=>{Zl(P,i.current)&&u(P)}),y=ze(P=>{const D=Zl(P,i.current);if(!D)return;if(P.type==="mousemove"&&P.buttons===0){I(P);return}let z=Jl(l.current,D.x,r.columnHeaderElement.getBoundingClientRect(),s.current);z=lt(z,r.colDef.minWidth,r.colDef.maxWidth),d(z);const F={element:r.columnHeaderElement,colDef:r.colDef,width:z};e.current.publishEvent("columnResize",F,P)}),w=ze(P=>{const D=bo(P.target,S["columnSeparator--resizable"]);if(!D)return;const z=P.changedTouches[0];z!=null&&(i.current=z.identifier);const F=bo(P.target,S.columnHeader),T=yh(F),G=e.current.getColumn(T);o.debug(`Start Resize on col ${G.field}`),e.current.publishEvent("columnResizeStart",{field:T},P),g(G,D,z.clientX);const M=Rt(P.currentTarget);M.addEventListener("touchmove",y),M.addEventListener("touchend",I)}),m=c.useCallback(()=>{const P=Rt(e.current.rootElementRef.current);P.body.style.removeProperty("cursor"),P.removeEventListener("mousemove",x),P.removeEventListener("mouseup",f),P.removeEventListener("touchmove",y),P.removeEventListener("touchend",I),setTimeout(()=>{P.removeEventListener("click",es,!0)},100),r.columnHeaderElement&&(r.columnHeaderElement.style.pointerEvents="unset")},[e,r,x,f,y,I]),p=c.useCallback(({field:P})=>{e.current.setState(D=>h({},D,{columnResize:h({},D.columnResize,{resizingColumnField:P})})),e.current.forceUpdate()},[e]),E=c.useCallback(()=>{e.current.setState(P=>h({},P,{columnResize:h({},P.columnResize,{resizingColumnField:""})})),e.current.forceUpdate()},[e]),R=ze(({colDef:P},D)=>{if(D.button!==0||!D.currentTarget.classList.contains(S["columnSeparator--resizable"]))return;D.preventDefault(),o.debug(`Start Resize on col ${P.field}`),e.current.publishEvent("columnResizeStart",{field:P.field},D),g(P,D.currentTarget,D.clientX);const z=Rt(e.current.rootElementRef.current);z.body.style.cursor="col-resize",r.previousMouseClickEvent=D.nativeEvent,z.addEventListener("mousemove",x),z.addEventListener("mouseup",f),z.addEventListener("click",es,!0)}),H=ze((P,D)=>{if(t.disableAutosize||D.button!==0)return;const z=e.current.state.columns.lookup[P.field];z.resizable!==!1&&e.current.autosizeColumns(h({},t.autosizeOptions,{disableColumnVirtualization:!1,columns:[z.field]}))}),V=zp(e),A=c.useRef(!1),L=c.useCallback(async P=>{var G;if(!((G=e.current.rootElementRef)==null?void 0:G.current)||A.current)return;A.current=!0;const z=xt(e.current.state),F=h({},bf,P,{columns:(P==null?void 0:P.columns)??z.orderedFields});F.columns=F.columns.filter(M=>z.columnVisibilityModel[M]!==!1);const T=F.columns.map(M=>e.current.state.columns.lookup[M]);try{!t.disableVirtualization&&F.disableColumnVirtualization&&(e.current.unstable_setColumnVirtualization(!1),await V());const M=Ap(e,F,T),b=T.map(C=>h({},C,{width:M[C.field],computedWidth:M[C.field],flex:0}));if(F.expand){const $=z.orderedFields.map(N=>z.lookup[N]).filter(N=>z.columnVisibilityModel[N.field]!==!1).reduce((N,_)=>N+(M[_.field]??_.computedWidth??_.width),0),j=e.current.getRootDimensions().viewportInnerSize.width-$;if(j>0){const N=j/(b.length||1);b.forEach(_=>{_.width+=N,_.computedWidth+=N})}}e.current.updateColumns(b),b.forEach((C,$)=>{if(C.width!==T[$].width){const k=C.width;e.current.publishEvent("columnWidthChange",{element:e.current.getColumnHeaderElement(C.field),colDef:C,width:k})}})}finally{t.disableVirtualization||e.current.unstable_setColumnVirtualization(!0),A.current=!1}},[e,V,t.disableVirtualization]);c.useEffect(()=>m,[m]),cs(()=>{t.autosizeOnMount&&Promise.resolve().then(()=>{e.current.autosizeColumns(t.autosizeOptions)})}),oi(e,()=>{var P;return(P=e.current.columnHeadersContainerRef)==null?void 0:P.current},"touchstart",w,{passive:!0}),de(e,{autosizeColumns:L},"public"),ee(e,"columnResizeStop",E),ee(e,"columnResizeStart",p),ee(e,"columnSeparatorMouseDown",R),ee(e,"columnSeparatorDoubleClick",H),Te(e,"columnResize",t.onColumnResize),Te(e,"columnWidthChange",t.onColumnWidthChange)};function Qt(e,t,n){e&&(e.style[t]=`${parseInt(e.style[t],10)+n}px`)}function Bp(e,t){return e.firstRowIndex>=t.firstRowIndex&&e.lastRowIndex<=t.lastRowIndex?null:e.firstRowIndex>=t.firstRowIndex&&e.lastRowIndex>t.lastRowIndex?{firstRowIndex:t.lastRowIndex,lastRowIndex:e.lastRowIndex}:e.firstRowIndex<t.firstRowIndex&&e.lastRowIndex<=t.lastRowIndex?{firstRowIndex:e.firstRowIndex,lastRowIndex:t.firstRowIndex-1}:e}function ts(e){return e.firstRowIndex!==0||e.lastRowIndex!==0}const qo=(e,t,n)=>{if(!e)return null;let o=e[t.field];const r=t.rowSpanValueGetter??t.valueGetter;return r&&(o=r(o,e,t,n)),o},on={spannedCells:{},hiddenCells:{},hiddenCellOriginMap:{}},xo={firstRowIndex:0,lastRowIndex:0},Wp=new Set([Mt,"__reorder__",Po]),ns=20,Xi=(e,t,n,o,r,l,s)=>{const a=l?{}:h({},e.current.state.rowSpanning.spannedCells),i=l?{}:h({},e.current.state.rowSpanning.hiddenCells),d=l?{}:h({},e.current.state.rowSpanning.hiddenCellOriginMap);return l&&(s=xo),t.forEach(u=>{var g;if(!Wp.has(u.field)){for(let f=r.firstRowIndex;f<r.lastRowIndex;f+=1){const x=n[f];if((g=i[x.id])!=null&&g[u.field])continue;const I=qo(x.model,u,e);if(I==null)continue;let y=x.id,w=f,m=0;const p=[];if(f===r.firstRowIndex){let R=f-1,H=n[R];for(;R>=o.firstRowIndex&&H&&qo(H.model,u,e)===I;){const V=n[R+1];i[V.id]?i[V.id][u.field]=!0:i[V.id]={[u.field]:!0},p.push(f),m+=1,y=H.id,w=R,R-=1,H=n[R]}}p.forEach(R=>{d[R]?d[R][u.field]=w:d[R]={[u.field]:w}});let E=f+1;for(;E<=o.lastRowIndex&&n[E]&&qo(n[E].model,u,e)===I;){const R=n[E];i[R.id]?i[R.id][u.field]=!0:i[R.id]={[u.field]:!0},d[E]?d[E][u.field]=w:d[E]={[u.field]:w},E+=1,m+=1}m>0&&(a[y]?a[y][u.field]=m+1:a[y]={[u.field]:m+1})}s={firstRowIndex:Math.min(s.firstRowIndex,r.firstRowIndex),lastRowIndex:Math.max(s.lastRowIndex,r.lastRowIndex)}}}),{spannedCells:a,hiddenCells:i,hiddenCellOriginMap:d,processedRange:s}},Yi=(e,t)=>{const n=En(t).length;if(e.pagination){const o=ci(t);let r=ns;return o>0&&(r=o-1),{firstRowIndex:0,lastRowIndex:Math.min(r,n)}}return{firstRowIndex:0,lastRowIndex:Math.min(ns,n)}},Up=(e,t,n)=>{var I;if(!t.unstable_rowSpanning)return h({},e,{rowSpanning:on});const o=e.rows.dataRowIds||[],r=e.columns.orderedFields||[],l=e.rows.dataRowIdToModelLookup,s=e.columns.lookup,a=!!e.filter.filterModel.items.length||!!((I=e.filter.filterModel.quickFilterValues)!=null&&I.length);if(!o.length||!r.length||!l||!s||a)return h({},e,{rowSpanning:on});const i=Yi(t,n),d=o.map(y=>({id:y,model:l[y]})),u=r.map(y=>s[y]),{spannedCells:g,hiddenCells:f,hiddenCellOriginMap:x}=Xi(n,u,d,i,i,!0,xo);return h({},e,{rowSpanning:{spannedCells:g,hiddenCells:f,hiddenCellOriginMap:x}})},Kp=(e,t)=>{const n=yt(()=>e.current.state.rowSpanning!==on?Yi(t,e):xo),o=c.useCallback((l,s=!1)=>{const{range:a,rows:i}=$t(e,{pagination:t.pagination,paginationMode:t.paginationMode});if(a===null||!ts(l))return;s&&(n.current=xo);const d=Bp({firstRowIndex:l.firstRowIndex,lastRowIndex:Math.min(l.lastRowIndex,a.lastRowIndex+1)},n.current);if(d===null)return;const u=je(e),{spannedCells:g,hiddenCells:f,hiddenCellOriginMap:x,processedRange:I}=Xi(e,u,i,a,d,s,n.current);n.current=I;const y=Object.keys(g).length,w=Object.keys(f).length,m=Object.keys(e.current.state.rowSpanning.spannedCells).length,p=Object.keys(e.current.state.rowSpanning.hiddenCells).length;!(s||y!==m||w!==p)||y===0&&m===0||e.current.setState(H=>h({},H,{rowSpanning:{spannedCells:g,hiddenCells:f,hiddenCellOriginMap:x}}))},[e,n,t.pagination,t.paginationMode]),r=c.useCallback(()=>{const l=Un(e);ts(l)&&o(l,!0)},[e,o]);ee(e,"renderedRowsIntervalChange",yn(t.unstable_rowSpanning,o)),ee(e,"sortedRowsSet",yn(t.unstable_rowSpanning,r)),ee(e,"paginationModelChange",yn(t.unstable_rowSpanning,r)),ee(e,"filteredRowsSet",yn(t.unstable_rowSpanning,r)),ee(e,"columnsChange",yn(t.unstable_rowSpanning,r)),c.useEffect(()=>{t.unstable_rowSpanning?e.current.state.rowSpanning===on&&r():e.current.state.rowSpanning!==on&&e.current.setState(l=>h({},l,{rowSpanning:on}))},[e,r,t.unstable_rowSpanning])},qp=(e,t,n)=>h({},e,{listViewColumn:t.unstable_listColumn?h({},t.unstable_listColumn,{computedWidth:lr(n)}):void 0});function Xp(e,t){const n=()=>{e.current.setState(l=>l.listViewColumn?h({},l,{listViewColumn:h({},l.listViewColumn,{computedWidth:lr(e)})}):l)},o=c.useRef(null);ee(e,"viewportInnerSizeChange",l=>{o.current!==l.width&&(o.current=l.width,n())}),ee(e,"columnVisibilityModelChange",n),Je(()=>{const l=t.unstable_listColumn;l&&e.current.setState(s=>h({},s,{listViewColumn:h({},l,{computedWidth:lr(e)})}))},[e,t.unstable_listColumn]),c.useEffect(()=>{t.unstable_listView&&t.unstable_listColumn},[t.unstable_listView,t.unstable_listColumn])}function lr(e){return qe(e.current.state).viewportInnerSize.width}const Yp=(e,t)=>{const n=pC(e,t);return mp(n,t),up(n),Ke(gp,n,t),Ke(MC,n,t),Ke(KC,n,t),Ke(lp,n,t),Ke(op,n,t),Ke(AC,n,t),Ke(bp,n,t),Ke(XC,n,t),Ke(RC,n,t),Ke(Up,n,t),Ke(EC,n,t),Ke(Np,n,t),Ke(IC,n,t),Ke(Dp,n,t),Ke(Pg,n,t),Ke(vp,n,t),Ke(Mp,n,t),Ke(qp,n,t),BC(n,t),fp(n,t),kC(n,t),sp(n,t),Kp(n,t),dp(n,t),Fp(n),Op(n,t),rp(n,t),NC(n,t),YC(n,t),VC(n,t),Cp(n,t),FC(n,t),_p(n,t),qC(n,t),kp(n,t),pp(n,t),PC(n),HC(n,t),GC(n,t),yC(n,t),yp(n,t),wp(n,t),Ep(n),Mg(n,t),Xp(n,t),n},Qp=e=>{const{classes:t,headerAlign:n,isDragging:o,isLastColumn:r,showLeftBorder:l,showRightBorder:s,groupId:a,pinnedPosition:i}=e,d={root:["columnHeader",n==="left"&&"columnHeader--alignLeft",n==="center"&&"columnHeader--alignCenter",n==="right"&&"columnHeader--alignRight",o&&"columnHeader--moving",s&&"columnHeader--withRightBorder",l&&"columnHeader--withLeftBorder","withBorderColor",a===null?"columnHeader--emptyGroup":"columnHeader--filledGroup",i===me.LEFT&&"columnHeader--pinnedLeft",i===me.RIGHT&&"columnHeader--pinnedRight",r&&"columnHeader--last"],draggableContainer:["columnHeaderDraggableContainer"],titleContainer:["columnHeaderTitleContainer","withBorderColor"],titleContainerContent:["columnHeaderTitleContainerContent"]};return fe(d,pe,t)};function Zp(e){var $;const{groupId:t,width:n,depth:o,maxDepth:r,fields:l,height:s,colIndex:a,hasFocus:i,tabIndex:d,isLastColumn:u,pinnedPosition:g,pinnedOffset:f}=e,x=ne(),I=It(),y=c.useRef(null),w=he(),m=K(w,mi),p=t?m[t]:{},{headerName:E=t??"",description:R="",headerAlign:H=void 0}=p;let V;const A=t&&(($=m[t])==null?void 0:$.renderHeaderGroup),L=c.useMemo(()=>({groupId:t,headerName:E,description:R,depth:o,maxDepth:r,fields:l,colIndex:a,isLastColumn:u}),[t,E,R,o,r,l,a,u]);t&&A&&(V=A(L));const P=h({},e,{classes:x.classes,headerAlign:H,depth:o,isDragging:!1}),D=E??t,z=Ne(),F=t===null?`empty-group-cell-${z}`:t,T=Qp(P);c.useLayoutEffect(()=>{if(i){const O=y.current.querySelector('[tabindex="0"]')||y.current;O==null||O.focus()}},[w,i]);const G=c.useCallback(k=>O=>{Kn(O)||w.current.publishEvent(k,L,O)},[w,L]),M=c.useMemo(()=>({onKeyDown:G("columnGroupHeaderKeyDown"),onFocus:G("columnGroupHeaderFocus"),onBlur:G("columnGroupHeaderBlur")}),[G]),b=typeof p.headerClassName=="function"?p.headerClassName(L):p.headerClassName,C=c.useMemo(()=>Ho(h({},e.style),I,g,f),[g,f,e.style,I]);return v.jsx(Gi,h({ref:y,classes:T,columnMenuOpen:!1,colIndex:a,height:s,isResizing:!1,sortDirection:null,hasFocus:!1,tabIndex:d,isDraggable:!1,headerComponent:V,headerClassName:b,description:R,elementId:F,width:n,columnMenuIconButton:null,columnTitleIconButtons:null,resizable:!1,label:D,"aria-colspan":l.length,"data-fields":`|-${l.join("-|-")}-|`,style:C},M))}const os=Ve("div",{name:"MuiDataGrid",slot:"ColumnHeaderRow",overridesResolver:(e,t)=>t.columnHeaderRow})({display:"flex"}),Jp=e=>{const{visibleColumns:t,sortColumnLookup:n,filterColumnLookup:o,columnHeaderTabIndexState:r,columnGroupHeaderTabIndexState:l,columnHeaderFocus:s,columnGroupHeaderFocus:a,headerGroupingMaxDepth:i,columnMenuState:d,columnVisibility:u,columnGroupsHeaderStructure:g,hasOtherElementInTabSequence:f}=e,[x,I]=c.useState(""),[y,w]=c.useState(""),m=st(),p=ne(),E=K(m,hi),R=K(m,Vt),H=K(m,Ig),V=K(m,bn),A=K(m,Tt),L=yi(R,H,V.left.length),P=K(m,vo),D=K(m,Fs),z=K(m,Ha),F=K(m,Da),T=K(m,Ts),G=c.useCallback(W=>w(W.field),[]),M=c.useCallback(()=>w(""),[]),b=c.useCallback(W=>I(W.field),[]),C=c.useCallback(()=>I(""),[]),$=c.useMemo(()=>V.left.length?{firstColumnIndex:0,lastColumnIndex:V.left.length}:null,[V.left.length]),k=c.useMemo(()=>V.right.length?{firstColumnIndex:t.length-V.right.length,lastColumnIndex:t.length}:null,[V.right.length,t.length]);ee(m,"columnResizeStart",G),ee(m,"columnResizeStop",M),ee(m,"columnHeaderDragStart",b),ee(m,"columnHeaderDragEnd",C);const O=W=>{const{renderContext:Y=H}=W||{},Q=Y.firstColumnIndex,Z=Y.lastColumnIndex;return{renderedColumns:t.slice(Q,Z),firstColumnToRender:Q,lastColumnToRender:Z}},j=(W,Y,Q,Z=!1)=>{const J=(W==null?void 0:W.position)===me.RIGHT,te=(W==null?void 0:W.position)===void 0,oe=V.right.length>0&&J||V.right.length===0&&te,X=L-Q;return v.jsxs(c.Fragment,{children:[te&&v.jsx("div",{role:"presentation",style:{width:X}}),Y,te&&v.jsx("div",{role:"presentation",className:ve(S.filler,Z&&S["filler--borderBottom"])}),oe&&v.jsx(Tr,{header:!0,pinnedRight:J,borderBottom:Z,borderTop:!1})]})},N=(W,Y={})=>{const{renderedColumns:Q,firstColumnToRender:Z}=O(W),J=[];for(let te=0;te<Q.length;te+=1){const oe=Q[te],X=Z+te,ie=X===0,xe=r!==null&&r.field===oe.field||ie&&!f?0:-1,Ce=s!==null&&s.field===oe.field,ye=d.open&&d.field===oe.field,be=W==null?void 0:W.position,$e=Hn(be,oe.computedWidth,X,R,P,T),Qe=be===me.RIGHT?Q[te-1]:Q[te+1],Le=Qe?s!==null&&s.field===Qe.field:!1,Ae=X+1===R.length-V.right.length,_e=te,ae=Q.length,Me=wo(be,_e),ce=po(be,_e,ae,p.showCellVerticalBorder,D);J.push(v.jsx(Uh,h({},n[oe.field],{columnMenuOpen:ye,filterItemsCounter:o[oe.field]&&o[oe.field].length,headerHeight:z,isDragging:oe.field===x,colDef:oe,colIndex:X,isResizing:y===oe.field,isLast:X===R.length-1,hasFocus:Ce,tabIndex:xe,pinnedPosition:be,pinnedOffset:$e,isLastUnpinned:Ae,isSiblingFocused:Le,showLeftBorder:Me,showRightBorder:ce},Y),oe.field))}return j(W,J,0)},_=()=>v.jsxs(os,{role:"row","aria-rowindex":i+1,ownerState:p,className:S["row--borderBottom"],children:[$&&N({position:me.LEFT,renderContext:$},{disableReorder:!0}),N({renderContext:H}),k&&N({position:me.RIGHT,renderContext:k},{disableReorder:!0,separatorSide:Fr.Left})]}),U=({depth:W,params:Y})=>{var ae,Me;const Q=O(Y);if(Q.renderedColumns.length===0)return null;const{firstColumnToRender:Z,lastColumnToRender:J}=Q,te=g[W],oe=t[Z].field,X=((ae=E[oe])==null?void 0:ae[W])??null,ie=te.findIndex(({groupId:ce,columnFields:we})=>ce===X&&we.includes(oe)),xe=t[J-1].field,Ce=((Me=E[xe])==null?void 0:Me[W])??null,ye=te.findIndex(({groupId:ce,columnFields:we})=>ce===Ce&&we.includes(xe)),be=te.slice(ie,ye+1).map(ce=>h({},ce,{columnFields:ce.columnFields.filter(we=>u[we]!==!1)})).filter(ce=>ce.columnFields.length>0),$e=be[0].columnFields.indexOf(oe),Le=be[0].columnFields.slice(0,$e).reduce((ce,we)=>{const ke=A[we];return ce+(ke.computedWidth??0)},0);let Ae=Z;const _e=be.map(({groupId:ce,columnFields:we},ke)=>{const se=a!==null&&a.depth===W&&we.includes(a.field),ge=l!==null&&l.depth===W&&we.includes(l.field)?0:-1,Se={width:we.reduce((nt,Dt)=>nt+A[Dt].computedWidth,0),fields:we,colIndex:Ae},ue=Y.position,Ge=Hn(ue,Se.width,Ae,R,P,T);Ae+=we.length;let Ee=ke;return ue===me.LEFT&&(Ee=Ae-1),v.jsx(Zp,{groupId:ce,width:Se.width,fields:Se.fields,colIndex:Se.colIndex,depth:W,isLastColumn:ke===be.length-1,maxDepth:i,height:F,hasFocus:se,tabIndex:ge,pinnedPosition:ue,pinnedOffset:Ge,showLeftBorder:wo(ue,Ee),showRightBorder:po(ue,Ee,be.length,p.showCellVerticalBorder,D)},ke)});return j(Y,_e,Le)};return{renderContext:H,leftRenderContext:$,rightRenderContext:k,pinnedColumns:V,visibleColumns:t,columnPositions:R,getFillers:j,getColumnHeadersRow:_,getColumnsToRender:O,getColumnGroupHeadersRows:()=>{if(i===0)return null;const W=[];for(let Y=0;Y<i;Y+=1)W.push(v.jsxs(os,{role:"row","aria-rowindex":Y+1,ownerState:p,children:[$&&U({depth:Y,params:{position:me.LEFT,renderContext:$,maxLastColumn:$.lastColumnIndex}}),U({depth:Y,params:{renderContext:H}}),k&&U({depth:Y,params:{position:me.RIGHT,renderContext:k,maxLastColumn:k.lastColumnIndex}})]},Y));return W},getPinnedCellOffset:Hn,isDragging:!!x,getInnerProps:()=>({role:"rowgroup"})}},ew=["className"],tw=e=>{const{classes:t}=e;return fe({root:["columnHeaders"]},pe,t)},nw=He("div",{name:"MuiDataGrid",slot:"ColumnHeaders",overridesResolver:(e,t)=>t.columnHeaders})({display:"flex",flexDirection:"column",borderTopLeftRadius:"var(--unstable_DataGrid-radius)",borderTopRightRadius:"var(--unstable_DataGrid-radius)"}),ow=Ie(function(t,n){const{className:o}=t,r=re(t,ew),l=ne(),s=tw(l);return v.jsx(nw,h({className:ve(s.root,o),ownerState:l},r,{role:"presentation",ref:n}))}),rw=["className","visibleColumns","sortColumnLookup","filterColumnLookup","columnHeaderTabIndexState","columnGroupHeaderTabIndexState","columnHeaderFocus","columnGroupHeaderFocus","headerGroupingMaxDepth","columnMenuState","columnVisibility","columnGroupsHeaderStructure","hasOtherElementInTabSequence"],lw=Ie(function(t,n){const{visibleColumns:o,sortColumnLookup:r,filterColumnLookup:l,columnHeaderTabIndexState:s,columnGroupHeaderTabIndexState:a,columnHeaderFocus:i,columnGroupHeaderFocus:d,headerGroupingMaxDepth:u,columnMenuState:g,columnVisibility:f,columnGroupsHeaderStructure:x,hasOtherElementInTabSequence:I}=t,y=re(t,rw),{getInnerProps:w,getColumnHeadersRow:m,getColumnGroupHeadersRows:p}=Jp({visibleColumns:o,sortColumnLookup:r,filterColumnLookup:l,columnHeaderTabIndexState:s,columnGroupHeaderTabIndexState:a,columnHeaderFocus:i,columnGroupHeaderFocus:d,headerGroupingMaxDepth:u,columnMenuState:g,columnVisibility:f,columnGroupsHeaderStructure:x,hasOtherElementInTabSequence:I});return v.jsxs(ow,h({},y,w(),{ref:n,children:[p(),m()]}))}),sw=Ft(lw);function iw(e){return null}function cw(e){return null}const aw=Ie(function(t,n){const r=he().current.getLocaleText("noResultsOverlayLabel");return v.jsx(Er,h({},t,{ref:n,children:r}))}),uw=["sortingOrder"],dw=c.memo(function(t){const{sortingOrder:n}=t,o=re(t,uw),r=ne(),[l]=n,s=l==="asc"?r.slots.columnSortedAscendingIcon:r.slots.columnSortedDescendingIcon;return s?v.jsx(s,h({},o)):null}),gw=["native"];function fw(e){let{native:t}=e,n=re(e,gw);return t?v.jsx("option",h({},n)):v.jsx(rt,h({},n))}const hw={booleanCellTrueIcon:mm,booleanCellFalseIcon:_o,columnMenuIcon:dm,openFilterButtonIcon:rm,filterPanelDeleteIcon:_o,columnFilteredIcon:Ol,columnSelectorIcon:sm,columnUnsortedIcon:dw,columnSortedAscendingIcon:Fl,columnSortedDescendingIcon:Tl,columnResizeIcon:im,densityCompactIcon:cm,densityStandardIcon:am,densityComfortableIcon:um,exportIcon:hm,moreActionsIcon:bm,treeDataCollapseIcon:Dl,treeDataExpandIcon:Hl,groupingCriteriaCollapseIcon:Dl,groupingCriteriaExpandIcon:Hl,detailPanelExpandIcon:Ll,detailPanelCollapseIcon:gm,rowReorderIcon:Gl,quickFilterIcon:lm,quickFilterClearIcon:_o,columnMenuHideIcon:Cm,columnMenuSortAscendingIcon:Fl,columnMenuSortDescendingIcon:Tl,columnMenuFilterIcon:Ol,columnMenuManageColumnsIcon:pm,columnMenuClearIcon:wm,loadIcon:fm,filterPanelAddIcon:Ll,filterPanelRemoveAllIcon:Sm,columnReorderIcon:Gl},mw=h({},hw,{baseBadge:bc,baseCheckbox:Ec,baseDivider:mc,baseTextField:as,baseFormControl:hc,baseSelect:fc,baseButton:gc,baseIconButton:ds,baseInputAdornment:kc,baseTooltip:us,basePopper:ir,baseInputLabel:dc,baseSelectOption:fw,baseChip:uc}),bw=h({},mw,{cell:$f,skeletonCell:Bf,columnHeaderFilterIconButton:nm,columnHeaderSortIcon:em,columnMenu:$m,columnHeaders:sw,detailPanels:iw,footer:Ob,footerRowCount:qb,toolbar:null,pinnedRows:cw,loadingOverlay:Vb,noResultsOverlay:aw,noRowsOverlay:Ab,pagination:Bb,filterPanel:fb,columnsPanel:jm,columnsManagement:Cb,panel:Km,row:eC}),Cw={disableMultipleColumnsFiltering:!0,disableMultipleColumnsSorting:!0,throttleRowsMs:void 0,hideFooterRowCount:!1,pagination:!0,checkboxSelectionVisibleOnly:!1,disableColumnReorder:!0,keepColumnPositionIfDraggedOutside:!1,signature:"DataGrid",unstable_listView:!1},pw=bw,ww=e=>{const t=Tf(Oc({props:e,name:"MuiDataGrid"})),n=c.useMemo(()=>h({},La,t.localeText),[t.localeText]),o=c.useMemo(()=>Ef({defaultSlots:pw,slots:t.slots}),[t.slots]),r=c.useMemo(()=>Object.keys(nr).reduce((l,s)=>(l[s]=t[s]??nr[s],l),{}),[t]);return c.useMemo(()=>h({},t,r,{localeText:n,slots:o},Cw),[t,n,o,r])},Sw={hooks:{useGridAriaAttributes:tC,useGridRowAriaAttributes:nC}},Qi=Ie(function(t,n){var l;const o=ww(t),r=Yp(o.apiRef,o);return v.jsx(oC,{privateApiRef:r,configuration:Sw,props:o,children:v.jsx(ch,h({className:o.className,style:o.style,sx:o.sx},o.forwardedProps,(l=o.slotProps)==null?void 0:l.root,{ref:n}))})}),Ww=c.memo(Qi);Qi.propTypes={apiRef:B.shape({current:B.object.isRequired}),"aria-label":B.string,"aria-labelledby":B.string,autoHeight:B.bool,autoPageSize:B.bool,autosizeOnMount:B.bool,autosizeOptions:B.shape({columns:B.arrayOf(B.string),disableColumnVirtualization:B.bool,expand:B.bool,includeHeaders:B.bool,includeOutliers:B.bool,outliersFactor:B.number}),cellModesModel:B.object,checkboxSelection:B.bool,classes:B.object,clipboardCopyCellDelimiter:B.string,columnBufferPx:B.number,columnGroupHeaderHeight:B.number,columnGroupingModel:B.arrayOf(B.object),columnHeaderHeight:B.number,columns:B.arrayOf(B.object).isRequired,columnVisibilityModel:B.object,density:B.oneOf(["comfortable","compact","standard"]),disableAutosize:B.bool,disableColumnFilter:B.bool,disableColumnMenu:B.bool,disableColumnResize:B.bool,disableColumnSelector:B.bool,disableColumnSorting:B.bool,disableDensitySelector:B.bool,disableEval:B.bool,disableMultipleRowSelection:B.bool,disableRowSelectionOnClick:B.bool,disableVirtualization:B.bool,editMode:B.oneOf(["cell","row"]),estimatedRowCount:B.number,experimentalFeatures:B.shape({warnIfFocusStateIsNotSynced:B.bool}),filterDebounceMs:B.number,filterMode:B.oneOf(["client","server"]),filterModel:B.shape({items:B.arrayOf(B.shape({field:B.string.isRequired,id:B.oneOfType([B.number,B.string]),operator:B.string.isRequired,value:B.any})).isRequired,logicOperator:B.oneOf(["and","or"]),quickFilterExcludeHiddenColumns:B.bool,quickFilterLogicOperator:B.oneOf(["and","or"]),quickFilterValues:B.array}),forwardedProps:B.object,getCellClassName:B.func,getDetailPanelContent:B.func,getEstimatedRowHeight:B.func,getRowClassName:B.func,getRowHeight:B.func,getRowId:B.func,getRowSpacing:B.func,hideFooter:B.bool,hideFooterPagination:B.bool,hideFooterSelectedRowCount:B.bool,ignoreDiacritics:B.bool,ignoreValueFormatterDuringExport:B.oneOfType([B.shape({clipboardExport:B.bool,csvExport:B.bool}),B.bool]),indeterminateCheckboxAction:B.oneOf(["deselect","select"]),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,onCellEditStart:B.func,onCellEditStop:B.func,onCellKeyDown:B.func,onCellModesModelChange:B.func,onClipboardCopy:B.func,onColumnHeaderClick:B.func,onColumnHeaderContextMenu:B.func,onColumnHeaderDoubleClick:B.func,onColumnHeaderEnter:B.func,onColumnHeaderLeave:B.func,onColumnHeaderOut:B.func,onColumnHeaderOver:B.func,onColumnOrderChange:B.func,onColumnResize:B.func,onColumnVisibilityModelChange:B.func,onColumnWidthChange:B.func,onDensityChange:B.func,onFilterModelChange:B.func,onMenuClose:B.func,onMenuOpen:B.func,onPaginationMetaChange:B.func,onPaginationModelChange:B.func,onPreferencePanelClose:B.func,onPreferencePanelOpen:B.func,onProcessRowUpdateError:B.func,onResize:B.func,onRowClick:B.func,onRowCountChange:B.func,onRowDoubleClick:B.func,onRowEditStart:B.func,onRowEditStop:B.func,onRowModesModelChange:B.func,onRowSelectionModelChange:B.func,onSortModelChange:B.func,onStateChange:B.func,pageSizeOptions:B.arrayOf(B.oneOfType([B.number,B.shape({label:B.string.isRequired,value:B.number.isRequired})]).isRequired),pagination:B.oneOf([!0]),paginationMeta:B.shape({hasNextPage:B.bool}),paginationMode:B.oneOf(["client","server"]),paginationModel:B.shape({page:B.number.isRequired,pageSize:B.number.isRequired}),processRowUpdate:B.func,resizeThrottleMs:B.number,rowBufferPx:B.number,rowCount:B.number,rowHeight:B.number,rowModesModel:B.object,rowPositionsDebounceMs:B.number,rows:B.arrayOf(B.object),rowSelection:B.bool,rowSelectionModel:B.oneOfType([B.arrayOf(B.oneOfType([B.number,B.string]).isRequired),B.number,B.string]),rowSpacingType:B.oneOf(["border","margin"]),scrollbarSize:B.number,showCellVerticalBorder:B.bool,showColumnVerticalBorder:B.bool,slotProps:B.object,slots:B.object,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]),unstable_rowSpanning:B.bool,virtualizeColumnsWithAutoRowHeight:B.bool};const xw="_dataTableTab_1d5l8_75",vw={dataTableTab:xw},yw=De(v.jsx("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close");var Lr={},Iw=pc;Object.defineProperty(Lr,"__esModule",{value:!0});var Zi=Lr.default=void 0,Pw=Iw(Cc()),Mw=v,kw=(0,Pw.default)((0,Mw.jsx)("path",{d:"M14 4v5c0 1.12.37 2.16 1 3H9c.65-.86 1-1.9 1-3V4h4m3-2H7c-.55 0-1 .45-1 1s.45 1 1 1h1v5c0 1.66-1.34 3-3 3v2h5.97v7l1 1 1-1v-7H19v-2c-1.66 0-3-1.34-3-3V4h1c.55 0 1-.45 1-1s-.45-1-1-1z"}),"PushPinOutlined");Zi=Lr.default=kw;const rs=He(aa)`
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 500;
  background-color: transparent;
  padding: 8px 16px;
  border: none;
  border-radius: 10px 10px 0 0;
  display: flex;
  justify-content: center;
  align-items: center;
  min-width: 120px;
  max-width: fit-content;
  color: var(--text-secondary);
  transition: all 0.2s ease;
  position: relative;

  &:hover {
    background-color: var(--primary-shades-hover);
    color: var(--text-primary);
  }

  &.${Gc.selected} {
    background-color: var(--background-paper-elevation-0);
    color: var(--primary-main);
    font-weight: 600;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.06);
  }

  &.${wc.disabled} {
    opacity: 0.5;
    cursor: not-allowed;
  }
`,Ew=He(oa)`
  height: 44px;
  min-height: 44px;
  width: 100%;
  display: flex;
  align-items: flex-end;
  gap: 4px;
  padding: 6px 8px 0;
  background-color: var(--action-hover);
  border-bottom: 1px solid var(--other-divider);
  border-top: none;
  border-left: none;
  border-right: none;
  border-radius: 12px 12px 0 0;
  position: sticky;
  top: 0;
  z-index: 9;
  overflow: auto;
  scrollbar-width: none;
  &::-webkit-scrollbar {
    display: none;
  }
`,Fw=(e,t,n)=>{const o=[...e];var r=o[t];return o.splice(t,1),o.splice(n,0,r),o},Tw=({item:e,tabIndex:t,isActive:n,activeItems:o,setActiveTab:r,setActiveItems:l,setMaxTabsOpen:s,ChildComponent:a})=>{const{toggleTabPin:i,activateTab:d,unsavedTabs:u,markTabAsUnsaved:g,markTabAsSaved:f,hasUnsavedData:x,registerType:I,updateTabState:y,closeCurrentTab:w}=gs(),m=kn.useMemo(()=>({activeTab:t,activeItem:e,activeItems:o,setActiveTab:r,setActiveItems:l,setMaxTabsOpen:s,toggleTabPin:i,activateTab:d,unsavedTabs:u,markTabAsUnsaved:g,markTabAsSaved:f,hasUnsavedData:x,registerType:I,updateTabState:y,closeCurrentTab:w}),[t,e,o,r,l,s,i,d,u,g,f,x,I,y,w]);return v.jsx(no,{display:n?"contents":"none",children:v.jsx(Ic.Provider,{value:m,children:v.jsx(a,{})})})},Uw=({type:e,title:t,parentComponent:n,childComponent:o})=>{const{activeTab:r,activeItems:l,setActiveTab:s,setActiveItems:a,setMaxTabsOpen:i,toggleTabPin:d,registerType:u}=gs(),g=Sc(),f=xc(),x=vc(yc),I=(x==null?void 0:x.navType)||"light",m=I==="dark"||I==="ultra-dark";kn.useEffect(()=>{u(e)},[u,e]);const[p,E]=kn.useState(null),[R,H]=kn.useState(null),[V,A]=kn.useState(null),L=(C,$)=>{C.preventDefault(),A(V===null?{mouseX:C.clientX-2,mouseY:C.clientY-4,item:$}:null)},P=()=>A(null),D=()=>{const C=`new-tab-${Date.now()}`,$=l.length+1,k={id:C,patientName:`Tab ${$}`,isNew:!0},O=[...l,k],j=O.length;a(O),s(j),g(Qn({type:e,tabData:O,activeTabId:j}))},z=(C,$)=>{typeof $=="number"&&(s($),g(Qn({type:e,tabData:l,activeTabId:$})))},F=()=>{p!==null&&R!==null&&a(Fw(l,p,R)),E(null),H(null)},T=C=>H(parseInt(C.target.id,10)),G=(C,$)=>{var _;const k=r===$+1,O=(_=C.tabState)==null?void 0:_.flash,j=C.patientName||C.name||"Untitled",N=j.length>20?`${j.slice(0,20)}...`:j;return v.jsx(us,{title:j,children:v.jsxs(rs,{draggable:!0,value:$+1,id:$.toString(),onDragStart:U=>E(parseInt(U.target.id,10)),onDragEnd:F,onDragEnter:T,onContextMenu:U=>L(U,C),onClick:()=>{const U=$+1;s(U),g(Qn({type:e,tabData:l,activeTabId:U}))},sx:{padding:"7px 16px",borderRadius:"10px 10px 0 0",fontSize:13,cursor:"pointer",userSelect:"none",fontWeight:k?600:400,transition:"all 0.2s ease",background:O?"#ff4d4f":k?m?f.palette.background.paper:"#ffffff":"transparent",color:O?"#ffffff":k?m?"#ffffff":f.palette.primary.main:m?f.palette.text.secondary:"#666",border:"none",borderBottom:k?`2px solid ${f.palette.primary.main}`:"2px solid transparent",boxShadow:k?m?"0 2px 8px rgba(0,0,0,0.3)":"0 1px 4px rgba(0,0,0,0.08)":"none",zIndex:k?10:"auto",position:"relative","&:hover":{background:k?m?f.palette.background.paper:"#ffffff":m?"rgba(255,255,255,0.05)":"rgba(0,0,0,0.04)",color:k?m?"#ffffff":f.palette.primary.main:m?"#fff":"#333"}},children:[v.jsxs(no,{display:"flex",alignItems:"center",gap:.5,children:[C.pinned&&v.jsx(Zi,{sx:{fontSize:14,color:"inherit"}}),v.jsx(Vr,{variant:"body2",noWrap:!0,sx:{color:"inherit",fontWeight:"inherit",fontSize:"inherit"},children:N})]}),!C.pinned&&k&&v.jsx(yw,{onClick:U=>{U.stopPropagation(),M("one",C)},sx:{cursor:"pointer",marginLeft:.5,fontSize:15,color:"inherit",opacity:.6,borderRadius:"50%",padding:"1px",transition:"all 0.15s ease","&:hover":{opacity:1,backgroundColor:m?"rgba(255, 255, 255, 0.15)":"rgba(0, 0, 0, 0.08)"}}})]})},C.id)},M=(C,$)=>{var q;const k=$||(V==null?void 0:V.item);if(!k)return;const O=l.findIndex(W=>W.id===k.id);if(O===-1)return;let j=[...l],N=O,_=r;switch(C){case"all":j=j.filter(W=>W.pinned),N=0;break;case"left":j=j.filter((W,Y)=>Y>=O||W.pinned),N=0;break;case"right":j=j.filter((W,Y)=>Y<=O||W.pinned),N=Math.min(j.length-1,O);break;default:if(k.pinned){P();return}j.splice(O,1),N=O;break}const U=(q=l[r-1])==null?void 0:q.id;if(j.length===0)_=0;else{const W=U?j.findIndex(Y=>Y.id===U):-1;W!==-1?_=W+1:_=Math.max(0,Math.min(j.length-1,N))+1}g(Qn({type:e,tabData:j,activeTabId:_})),a(j),s(_),P()},b=()=>{const C=V==null?void 0:V.item,$=C==null?void 0:C.pinned;return v.jsxs(Pc,{open:V!==null,onClose:P,anchorReference:"anchorPosition",anchorPosition:V!==null?{top:V.mouseY,left:V.mouseX}:void 0,componentsProps:{root:{onContextMenu:k=>{k.preventDefault(),P()}}},children:[v.jsx(rt,{onClick:()=>d(C==null?void 0:C.id),children:$?"Unpin tab":"Pin tab"}),v.jsx(rt,{onClick:()=>M("one",C),disabled:$,children:"Close"}),v.jsx(rt,{onClick:()=>M("all"),children:"Close all"}),v.jsx(rt,{onClick:()=>M("right"),children:"Close all to the right"}),v.jsx(rt,{onClick:()=>M("left"),children:"Close all to the left"})]})};return v.jsxs(v.Fragment,{children:[v.jsxs(Zc,{value:r,onChange:z,style:{width:"100%",display:"flex",flexDirection:"column"},children:[l.length>0&&v.jsxs(Ew,{children:[v.jsx(rs,{className:vw.dataTableTab,value:0,sx:{minWidth:"auto",px:1.5,borderRadius:"10px 10px 0 0"},children:v.jsx(Vr,{variant:"body2",children:t})}),l.map((C,$)=>G(C,$)),v.jsx(ds,{size:"small","aria-label":"add tab",onClick:D,sx:{ml:.5,width:28,height:28,backgroundColor:"transparent",color:m?f.palette.text.secondary:"#888",borderRadius:"8px",transition:"all 0.2s ease","&:hover":{backgroundColor:m?"rgba(255,255,255,0.08)":"rgba(0,0,0,0.06)",color:m?"#fff":f.palette.primary.main},"&:active":{transform:"scale(0.95)"}},children:v.jsx(Lc,{sx:{fontSize:18}})})]}),v.jsxs(no,{flex:1,overflow:"hidden",sx:{borderRadius:"0 0 12px 12px",backgroundColor:m?"transparent":"#ffffff"},children:[v.jsx(no,{display:r===0?"contents":"none",children:v.jsx(n,{})}),l.map((C,$)=>{const k=$+1,O=r===k,j=C.id||(C.patientName&&C.patientName.startsWith("New ")?`new-tab-${C.patientName}`:C.patientName?`patient-${C.patientName}`:`item-${C.name||"untitled"}-${C.isNew?"new":"existing"}`);return v.jsx(Tw,{item:C,tabIndex:k,isActive:O,activeItems:l,setActiveTab:s,setActiveItems:a,setMaxTabsOpen:i,ChildComponent:o},j)})]})]}),b()]})};export{yw as C,Ww as D,Uw as a};
