@ehfuse/mui-virtual-data-table 1.1.34 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,27 +1,7 @@
1
- "use strict";var Ue=Object.defineProperty;var pt=Object.getOwnPropertyDescriptor;var ft=Object.getOwnPropertyNames;var ht=Object.prototype.hasOwnProperty;var mt=(l,p)=>{for(var h in p)Ue(l,h,{get:p[h],enumerable:!0})},gt=(l,p,h,C)=>{if(p&&typeof p=="object"||typeof p=="function")for(let w of ft(p))!ht.call(l,w)&&w!==h&&Ue(l,w,{get:()=>p[w],enumerable:!(C=pt(p,w))||C.enumerable});return l};var bt=l=>gt(Ue({},"__esModule",{value:!0}),l);var Ht={};mt(Ht,{VirtualDataTable:()=>st});module.exports=bt(Ht);var u=require("react"),d=require("@mui/material"),at=require("react-virtuoso");var ze=require("react/jsx-runtime"),ve=require("react"),Ae=require("@mui/material"),Ne=function(){return Ne=Object.assign||function(p){for(var h,C=1,w=arguments.length;C<w;C++){h=arguments[C];for(var T in h)Object.prototype.hasOwnProperty.call(h,T)&&(p[T]=h[T])}return p},Ne.apply(this,arguments)};function tt(l){var p=l.visible,h=l.onComplete,C=l.fadeoutDuration,w=C===void 0?200:C,T=l.exitDelay,b=T===void 0?0:T,S=l.size,F=S===void 0?40:S,A=l.className,X=l.style,z=l.sx,K=l.indicator,I=l.background,W=I===void 0?{show:!0,color:"255, 255, 255",opacity:.9}:I,de=(0,ve.useRef)(void 0),f=(0,ve.useRef)(null),q=(0,ve.useState)(p),pe=q[0],Me=q[1],B=W.show,V=B===void 0?!0:B,L=W.color,N=L===void 0?"255, 255, 255":L,oe=W.opacity,ie=oe===void 0?.9:oe;if((0,ve.useEffect)(function(){var le=de.current;if(le===!0&&p===!1&&f.current){var ae=f.current;ae.style.opacity="0",setTimeout(function(){Me(!1),h?.()},w+b)}else p===!0&&(Me(!0),f.current&&(f.current.style.opacity="1"));de.current=p},[p,h,w,b]),!pe)return null;var Ce=function(){return typeof K=="string"?(0,ze.jsx)("img",{src:K,alt:"Loading",style:{width:F,height:F}}):K||(0,ze.jsx)(Ae.CircularProgress,{size:F})},G=function(){return V?N.startsWith("rgba")?{backgroundColor:N}:/^\d+,\s*\d+,\s*\d+$/.test(N)?{backgroundColor:"rgba(".concat(N,", ").concat(ie,")")}:ie!==1?{backgroundColor:N,"&::before":{content:'""',position:"absolute",top:0,left:0,right:0,bottom:0,backgroundColor:N,opacity:ie,zIndex:-1}}:{backgroundColor:N}:{backgroundColor:"transparent"}};return(0,ze.jsx)(Ae.Box,{ref:f,className:A,style:Ne({},X),sx:Ne(Ne({position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e3,opacity:p?1:0,transition:"opacity ".concat(w,"ms ease-out")},G()),z),children:Ce()})}var we=require("react/jsx-runtime"),xt=`
1
+ "use strict";var Dt=Object.create;var me=Object.defineProperty;var Lt=Object.getOwnPropertyDescriptor;var Et=Object.getOwnPropertyNames;var Pt=Object.getPrototypeOf,It=Object.prototype.hasOwnProperty;var Ht=(o,d)=>{for(var l in d)me(o,l,{get:d[l],enumerable:!0})},Je=(o,d,l,w)=>{if(d&&typeof d=="object"||typeof d=="function")for(let m of Et(d))!It.call(o,m)&&m!==l&&me(o,m,{get:()=>d[m],enumerable:!(w=Lt(d,m))||w.enumerable});return o};var At=(o,d,l)=>(l=o!=null?Dt(Pt(o)):{},Je(d||!o||!o.__esModule?me(l,"default",{value:o,enumerable:!0}):l,o)),Nt=o=>Je(me({},"__esModule",{value:!0}),o);var $t={};Ht($t,{VirtualDataTable:()=>nt});module.exports=Nt($t);var a=require("react"),i=require("@mui/material"),et=require("react-virtuoso");var xe=require("react/jsx-runtime"),j=require("react"),ye=require("@mui/material"),re=function(){return re=Object.assign||function(d){for(var l,w=1,m=arguments.length;w<m;w++){l=arguments[w];for(var y in l)Object.prototype.hasOwnProperty.call(l,y)&&(d[y]=l[y])}return d},re.apply(this,arguments)};function Ue(o){var d=o.visible,l=o.onComplete,w=o.fadeoutDuration,m=w===void 0?200:w,y=o.exitDelay,oe=y===void 0?0:y,ae=o.size,G=ae===void 0?40:ae,X=o.className,J=o.style,I=o.sx,D=o.indicator,x=o.background,S=x===void 0?{show:!0,color:"255, 255, 255",opacity:.9}:x,ie=(0,j.useRef)(void 0),B=(0,j.useRef)(null),se=(0,j.useState)(d),Ce=se[0],le=se[1],de=S.show,H=de===void 0?!0:de,O=S.color,L=O===void 0?"255, 255, 255":O,E=S.opacity,v=E===void 0?.9:E;if((0,j.useEffect)(function(){var F=ie.current;if(F===!0&&d===!1&&B.current){var z=B.current;z.style.opacity="0",setTimeout(function(){le(!1),l?.()},m+oe)}else d===!0&&(le(!0),B.current&&(B.current.style.opacity="1"));ie.current=d},[d,l,m,oe]),!Ce)return null;var ce=function(){return typeof D=="string"?(0,xe.jsx)("img",{src:D,alt:"Loading",style:{width:G,height:G}}):D||(0,xe.jsx)(ye.CircularProgress,{size:G})},we=function(){return H?L.startsWith("rgba")?{backgroundColor:L}:/^\d+,\s*\d+,\s*\d+$/.test(L)?{backgroundColor:"rgba(".concat(L,", ").concat(v,")")}:v!==1?{backgroundColor:L,"&::before":{content:'""',position:"absolute",top:0,left:0,right:0,bottom:0,backgroundColor:L,opacity:v,zIndex:-1}}:{backgroundColor:L}:{backgroundColor:"transparent"}};return(0,xe.jsx)(ye.Box,{ref:B,className:X,style:re({},J),sx:re(re({position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e3,opacity:d?1:0,transition:"opacity ".concat(m,"ms ease-out")},we()),I),children:ce()})}var Y=require("react/jsx-runtime"),Bt=`
2
2
  .vdt-css-spinner{box-sizing:border-box;border-radius:50%;border:4px solid rgba(28,64,125,0.14);border-top-color:#1c407d;animation:vdt-css-spinner-spin .75s linear infinite}
3
3
  @keyframes vdt-css-spinner-spin{to{transform:rotate(360deg)}}
4
- `;function rt({size:l=54}){return(0,we.jsxs)(we.Fragment,{children:[(0,we.jsx)("style",{children:xt}),(0,we.jsx)("span",{className:"vdt-css-spinner",role:"progressbar","aria-label":"loading",style:{display:"inline-block",width:l,height:l}})]})}var i=require("react"),ne=require("react/jsx-runtime"),yt=["editor","textarea","input","select","textfield","form-control","contenteditable","MuiInputBase-input","MuiSelect-select","MuiOutlinedInput-input","MuiFilledInput-input","MuiInput-input","MuiFormControl-root","MuiTextField-root","MuiSelect-root","MuiOutlinedInput-root","MuiFilledInput-root","MuiInput-root","MuiAutocomplete-input","MuiDatePicker-input","MuiSlider-thumb","MuiSlider-rail","MuiSlider-track","MuiSlider-mark","MuiSlider-markLabel","MuiSlider-root","MuiSlider-colorPrimary","MuiSlider-sizeMedium","MuiIconButton-root","MuiButton-root","MuiButtonBase-root","MuiTouchRipple-root","MuiCheckbox-root","MuiRadio-root","MuiSwitch-root","PrivateSwitchBase-root","ant-input","ant-input-affix-wrapper","ant-input-group-addon","ant-input-number","ant-input-number-handler","ant-select","ant-select-selector","ant-select-selection-search","ant-select-dropdown","ant-cascader","ant-cascader-input","ant-picker","ant-picker-input","ant-time-picker","ant-calendar-picker","ant-slider","ant-slider-track","ant-slider-handle","ant-switch","ant-checkbox","ant-checkbox-wrapper","ant-radio","ant-radio-wrapper","ant-rate","ant-upload","ant-upload-drag","ant-form-item","ant-form-item-control","ant-btn","ant-dropdown","ant-dropdown-trigger","ant-menu","ant-menu-item","ant-tooltip","ant-popover","ant-modal","ant-drawer","ant-tree-select","ant-auto-complete","ant-mentions","ant-transfer","ui-input","ui-textarea","ui-select","ui-select-trigger","ui-select-content","ui-select-item","ui-button","ui-checkbox","ui-radio-group","ui-switch","ui-slider","ui-range-slider","ui-calendar","ui-date-picker","ui-combobox","ui-command","ui-command-input","ui-popover","ui-dialog","ui-sheet","ui-dropdown-menu","ui-context-menu","ui-menubar","ui-navigation-menu","ui-form","ui-form-control","ui-form-item","ui-form-field","ui-label","radix-ui","radix-select","radix-dropdown","radix-dialog","radix-popover","radix-accordion","radix-tabs","radix-slider","radix-switch","radix-checkbox","radix-radio","ql-editor","ql-container","ql-toolbar","ql-picker","ql-picker-label","ql-picker-options","ql-formats","ql-snow","ql-bubble","quill","quilleditor","monaco-editor","monaco-editor-background","view-lines","decorationsOverviewRuler","monaco-scrollable-element","CodeMirror","CodeMirror-code","CodeMirror-lines","CodeMirror-scroll","CodeMirror-sizer","cm-editor","cm-focused","cm-content","tox-editor-container","tox-editor-header","tox-edit-area","tox-tinymce","mce-content-body","ck-editor","ck-content","ck-toolbar","ck-editor__editable","ck-widget","slate-editor","slate-content","DraftEditor-root","DraftEditor-editorContainer","public-DraftEditor-content","ehfuse-editor","ehfuse-editor-wrapper","ehfuse-editor-content","ehfuse-toolbar","ehfuse-toolbar-group","ehfuse-cursor","text-editor","rich-text-editor","wysiwyg","ace_editor","ace_content"],nt=(l,p)=>{let h=l.tagName.toLowerCase(),C=["text","password","email","number","search","tel","url","checkbox","radio"];if(h==="input"){let w=l.type;return C.includes(w)}if(["textarea","select","button"].includes(h)||["svg","path","circle","rect","line","polygon","polyline"].includes(h)||l.getAttribute("contenteditable")==="true")return!0;if(p?.excludeSelectors){for(let w of p.excludeSelectors)if(l.matches(w))return!0}return vt(l,p)},vt=(l,p)=>{let h=[...yt,...p?.excludeClasses||[]],C=l,w=0,T=5;for(;C&&w<=T;){if(h.some(b=>C.classList.contains(b)))return!0;if(C.classList.contains("MuiDialogContent-root"))break;C=C.parentElement,w++}return!1},wt={},Mt={},Ct={},Tt={},St={},kt=(0,i.forwardRef)(({className:l="",style:p={},containerStyle:h={},contentStyle:C={},children:w,onScroll:T,thumb:b=wt,track:S=Mt,arrows:F=Ct,dragScroll:A=Tt,autoHide:X=St,showScrollbar:z=!0,detectInnerScroll:K=!1},I)=>{let W=(0,i.useRef)({});(0,i.useEffect)(()=>{W.current={children:w,onScroll:T,showScrollbar:z,thumb:b,track:S,arrows:F,dragScroll:A,autoHide:X}});let de=(0,i.useRef)(null),f=(0,i.useRef)(null),q=(0,i.useRef)(null),pe=(0,i.useRef)(null),Me=(0,i.useRef)(null),B=(0,i.useRef)(null),[V,L]=(0,i.useState)(!1),[N,oe]=(0,i.useState)(!1),[ie,Ce]=(0,i.useState)(!1),[G,le]=(0,i.useState)({y:0,scrollTop:0}),[ae,se]=(0,i.useState)(0),[Ze,Z]=(0,i.useState)(0),[J,me]=(0,i.useState)(!1),[ce,Ee]=(0,i.useState)(!1),[Te,We]=(0,i.useState)({x:0,y:0,scrollTop:0,scrollLeft:0}),[Je,Qe]=(0,i.useState)(null),[Se,ke]=(0,i.useState)(null),[et,Le]=(0,i.useState)(!1),Q=(0,i.useRef)(null),[$e,qe]=(0,i.useState)(!1),x=(0,i.useRef)(null),m=(0,i.useRef)(null),U=(0,i.useRef)(null),P=(0,i.useMemo)(()=>{let n=b.color??"#606060";return{width:b.width??8,minHeight:b.minHeight??50,radius:b.radius??(b.width??8)/2,color:n,opacity:b.opacity??.6,hoverColor:b.hoverColor??n,hoverOpacity:b.hoverOpacity??1}},[b]),v=(0,i.useMemo)(()=>({width:S.width??16,color:S.color??"rgba(128, 128, 128, 0.1)",visible:S.visible??!0,alignment:S.alignment??"center",radius:S.radius??P.radius??4,margin:S.margin??4}),[S,P.radius]),_=(0,i.useMemo)(()=>{let n=F.color??"#808080";return{visible:F.visible??!1,step:F.step??50,color:n,opacity:F.opacity??.6,hoverColor:F.hoverColor??n,hoverOpacity:F.hoverOpacity??1}},[F]),Re=(0,i.useMemo)(()=>({enabled:A.enabled??!0,excludeClasses:A.excludeClasses??[],excludeSelectors:A.excludeSelectors??[]}),[A]),M=(0,i.useMemo)(()=>({enabled:X.enabled??!0,delay:X.delay??1500,delayOnWheel:X.delayOnWheel??700}),[X]),O=P.width,Pe=v.width,He=P.minHeight,ee=_.visible,fe=_.step,j=(0,i.useCallback)(()=>{if(!f.current)return;let n=document.activeElement;n&&f.current.contains(n)&&n!==f.current||f.current.focus()},[]);(0,i.useImperativeHandle)(I,()=>({getScrollContainer:()=>f.current,scrollTo:n=>{f.current&&f.current.scrollTo(n)},get scrollTop(){return f.current?.scrollTop||0},get scrollHeight(){return f.current?.scrollHeight||0},get clientHeight(){return f.current?.clientHeight||0}}),[]);let k=(0,i.useCallback)(()=>{if(B.current){let t=B.current;if(document.contains(t)&&t.scrollHeight>t.clientHeight+2)return t;B.current=null}if(!f.current)return null;if(q.current&&q.current.scrollHeight>f.current.clientHeight+2)return B.current=f.current,f.current;if(!K)return null;let n=f.current.querySelectorAll('[data-virtuoso-scroller], [style*="overflow"], .virtuoso-scroller, [style*="overflow: auto"], [style*="overflow:auto"]');for(let t of n){let e=t;if(e!==f.current&&e.classList.contains("overlay-scrollbar-container"))continue;let o=e.parentElement,s=!1;for(;o&&o!==f.current;){if(o.classList.contains("overlay-scrollbar-container")&&o!==f.current){s=!0;break}o=o.parentElement}if(!s&&e.scrollHeight>e.clientHeight+2)return B.current=e,e}return null},[]),te=(0,i.useCallback)(()=>k()!==null,[k]),R=(0,i.useCallback)(()=>{x.current&&(clearTimeout(x.current),x.current=null)},[]),Ie=(0,i.useCallback)(()=>{m.current&&(clearTimeout(m.current),m.current=null)},[]),ge=(0,i.useCallback)(()=>{U.current&&(clearTimeout(U.current),U.current=null)},[]),D=(0,i.useCallback)(n=>{M.enabled&&(R(),x.current=setTimeout(()=>{L(!1),x.current=null},n))},[R,M.enabled]),y=(0,i.useCallback)(()=>{let n=k();if(!n){L(!1),me(!1),R();return}if(me(!0),!pe.current)return;M.enabled||(L(!0),R());let t=n.clientHeight,e=n.scrollHeight,o=n.scrollTop,s=0;if(de.current){let ue=window.getComputedStyle(de.current),H=parseFloat(ue.paddingTop)||0,De=parseFloat(ue.paddingBottom)||0;s=H+De}let a=ee?O*2+v.margin*4:v.margin*2,r=t-a+s,g=t/e,$=Math.max(r*g,He),Y=e-t,E=r-$,ye=Y>0?o/Y*E:0;se($),Z(ye)},[k,R,ee,O,He,M.enabled]),Ve=(0,i.useCallback)(n=>{n.preventDefault(),n.stopPropagation();let t=k();t&&(oe(!0),le({y:n.clientY,scrollTop:t.scrollTop}),R(),L(!0),j())},[k,R,j]),be=(0,i.useCallback)(n=>{if(!N)return;let t=k();if(!t)return;let e=t.clientHeight,o=t.scrollHeight-e,s=n.clientY-G.y,a=e-ae,r=s/a*o,g=Math.max(0,Math.min(o,G.scrollTop+r));t.scrollTop=g,y()},[N,G,ae,y,k]),xe=(0,i.useCallback)(()=>{oe(!1),te()&&D(M.delay)},[te,D,M.delay]),_e=(0,i.useCallback)(n=>{if(!pe.current)return;let t=pe.current.getBoundingClientRect(),e=n.clientY-t.top,o=k();if(!o)return;let s=o.clientHeight,a=o.scrollHeight,r=e/s*(a-s);o.scrollTop=Math.max(0,Math.min(a-s,r)),y(),L(!0),D(M.delay),j()},[y,D,M.delay,k,j]),je=(0,i.useCallback)(n=>{if(n.preventDefault(),n.stopPropagation(),!f.current)return;let t=Math.max(0,f.current.scrollTop-fe);f.current.scrollTop=t,y(),L(!0),D(M.delay),j()},[y,D,fe,M.delay,j]),re=(0,i.useCallback)(n=>{if(n.preventDefault(),n.stopPropagation(),!f.current||!q.current)return;let t=f.current,e=q.current.scrollHeight-t.clientHeight,o=Math.min(e,t.scrollTop+fe);t.scrollTop=o,y(),L(!0),D(M.delay),j()},[y,D,fe,M.delay,j]),Ye=(0,i.useCallback)(n=>{if(!Re.enabled)return;let t=n.target;if(nt(t,Re)||n.button!==0)return;let e=k();e&&(e.scrollHeight<=e.clientHeight||(n.preventDefault(),Ee(!0),We({x:n.clientX,y:n.clientY,scrollTop:e.scrollTop,scrollLeft:e.scrollLeft||0}),R()))},[Re,nt,k,R]),Fe=(0,i.useCallback)(n=>{if(!ce)return;let t=k();if(!t)return;let e=Te.x-n.clientX,o=Te.y-n.clientY;if(Math.abs(o)<3&&Math.abs(e)<3)return;L(!0);let s=Math.max(0,Math.min(t.scrollHeight-t.clientHeight,Te.scrollTop+o));t.scrollTop=s,y()},[ce,Te,k,y]),Oe=(0,i.useCallback)(()=>{Ee(!1),te()&&D(M.delay)},[te,D,M.delay]);(0,i.useEffect)(()=>{let n=a=>{y(),R(),L(!0);let r=$e?M.delayOnWheel:M.delay;D(r),T&&T(a)},t=()=>{qe(!0),Q.current&&clearTimeout(Q.current),Q.current=setTimeout(()=>{qe(!1)},300),R(),ge(),U.current=setTimeout(()=>{L(!0),U.current=null},50)},e=[],o=k();o&&e.push(o);let s=f.current;return s&&!o&&(e.push(s),s.querySelectorAll('[data-virtuoso-scroller], [style*="overflow"], .virtuoso-scroller, [style*="overflow: auto"], [style*="overflow:auto"]').forEach(a=>{let r=a;if(r!==s&&r.classList.contains("overlay-scrollbar-container"))return;let g=r.parentElement;for(;g&&g!==s;){if(g.classList.contains("overlay-scrollbar-container")&&g!==s)return;g=g.parentElement}e.push(r)})),e.forEach(a=>{a.addEventListener("scroll",n,{passive:!0}),a.addEventListener("wheel",t,{passive:!0})}),()=>{e.forEach(a=>{a.removeEventListener("scroll",n),a.removeEventListener("wheel",t)}),Q.current&&clearTimeout(Q.current),U.current&&clearTimeout(U.current)}},[k,y,T,R,D,M,$e]),(0,i.useEffect)(()=>{let n=e=>{let o=k();if(!o)return;let{key:s}=e,{scrollTop:a,scrollHeight:r,clientHeight:g}=o,$=r-g,Y=50,E=null;switch(s){case"ArrowUp":e.preventDefault(),E=Math.max(0,a-Y);break;case"ArrowDown":e.preventDefault(),E=Math.min($,a+Y);break;case"PageUp":e.preventDefault(),E=Math.max(0,a-g);break;case"PageDown":e.preventDefault(),E=Math.min($,a+g);break;case"Home":e.preventDefault(),E=0;break;case"End":e.preventDefault(),E=$;break;default:return}if(E!==null){let ye=E/$,ue=ee?O*2+v.margin*4:v.margin*2,H=(g-ue-ae)*ye;Z(H),o.scrollTop=E,R(),L(!0),D(M.delay)}},t=f.current;if(t)return t.addEventListener("keydown",n),()=>{t.removeEventListener("keydown",n)}},[k,ee,O,v.margin,ae,R,D,M.delay]),(0,i.useEffect)(()=>{if(ce)return document.addEventListener("mousemove",Fe),document.addEventListener("mouseup",Oe),()=>{document.removeEventListener("mousemove",Fe),document.removeEventListener("mouseup",Oe)}},[ce,Fe,Oe]),(0,i.useEffect)(()=>{if(N)return document.addEventListener("mousemove",be),document.addEventListener("mouseup",xe),()=>{document.removeEventListener("mousemove",be),document.removeEventListener("mouseup",xe)}},[N,be,xe]),(0,i.useEffect)(()=>{y();let n=setTimeout(()=>{y()},100);return()=>clearTimeout(n)},[y]),(0,i.useLayoutEffect)(()=>{Le(!0),y(),!M.enabled&&te()&&L(!0)},[te,y,M.enabled]),(0,i.useEffect)(()=>{let n=new ResizeObserver(()=>{y()}),t=[];return f.current&&t.push(f.current),q.current&&t.push(q.current),B.current&&document.contains(B.current)&&t.push(B.current),t.forEach(e=>{n.observe(e)}),()=>n.disconnect()},[y]),(0,i.useEffect)(()=>{if(!f.current)return;let n=new MutationObserver(()=>{B.current=null,y()});return n.observe(f.current,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["style"]}),()=>n.disconnect()},[y]);let he=Math.max(Pe,O);return(0,i.useEffect)(()=>{let n="overlay-scrollbar-webkit-hide",t=document.getElementById(n);t&&t.remove();let e=document.createElement("style");return e.id=n,e.textContent=`
5
- .overlay-scrollbar-container::-webkit-scrollbar {
6
- display: none !important;
7
- width: 0 !important;
8
- height: 0 !important;
9
- }
10
- .overlay-scrollbar-container::-webkit-scrollbar-track {
11
- display: none !important;
12
- }
13
- .overlay-scrollbar-container::-webkit-scrollbar-thumb {
14
- display: none !important;
15
- }
16
- .overlay-scrollbar-container:focus {
17
- outline: 2px solid rgba(0, 123, 255, 0.3);
18
- outline-offset: -2px;
19
- }
20
- .overlay-scrollbar-container:focus-visible {
21
- outline: 2px solid rgba(0, 123, 255, 0.5);
22
- outline-offset: -2px;
23
- }
24
- `,document.head.appendChild(e),()=>{let o=document.getElementById(n);o&&o.remove()}},[]),(0,ne.jsxs)("div",{ref:de,className:`overlay-scrollbar-wrapper ${l}`,style:{display:"flex",flexDirection:"column",position:"relative",minHeight:0,height:"100%",flex:"1 1 0%",...p},children:[(0,ne.jsx)("div",{ref:f,className:"overlay-scrollbar-container",tabIndex:-1,onMouseDown:Ye,style:{display:"flex",width:"100%",flex:"1 1 auto",minHeight:0,overflow:"auto",scrollbarWidth:"none",msOverflowStyle:"none",outline:"none",userSelect:ce?"none":"auto",...h},children:(0,ne.jsx)("div",{ref:q,className:"overlay-scrollbar-content",style:{flex:"1 1 0%",minHeight:0,display:"flex",flexDirection:"column",...C},children:w})}),z&&J&&(0,ne.jsxs)("div",{ref:pe,className:"overlay-scrollbar-track",onMouseEnter:()=>{R(),m.current=setTimeout(()=>{L(!0),m.current=null},100)},onMouseLeave:()=>{Ie(),N||D(M.delay)},style:{position:"absolute",top:0,right:0,width:`${he}px`,height:"100%",opacity:V?1:0,transition:"opacity 0.2s ease-in-out",cursor:"pointer",zIndex:1e3,pointerEvents:"auto"},children:[v.visible&&(0,ne.jsx)("div",{className:"overlay-scrollbar-track-background",onClick:n=>{n.preventDefault(),n.stopPropagation(),_e(n)},style:{position:"absolute",top:ee?`${P.width+v.margin*2}px`:`${v.margin}px`,right:v.alignment==="right"?"0px":`${(he-P.width)/2}px`,width:`${P.width}px`,height:ee?`calc(100% - ${P.width*2+v.margin*4}px)`:`calc(100% - ${v.margin*2}px)`,backgroundColor:v.color,borderRadius:`${v.radius}px`,cursor:"pointer"}}),(0,ne.jsx)("div",{ref:Me,className:"overlay-scrollbar-thumb",onMouseDown:Ve,onMouseEnter:()=>Ce(!0),onMouseLeave:()=>Ce(!1),style:{position:"absolute",top:`${(ee?O+v.margin*2:v.margin)+Ze}px`,right:v.alignment==="right"?"0px":`${(he-O)/2}px`,width:`${O}px`,height:`${Math.max(ae,He)}px`,backgroundColor:ie||N?P.hoverColor:P.color,opacity:ie||N?P.hoverOpacity:P.opacity,borderRadius:`${P.radius}px`,cursor:"pointer",transition:"background-color 0.2s ease-in-out, opacity 0.2s ease-in-out"}})]}),z&&J&&ee&&(0,ne.jsx)("div",{className:"overlay-scrollbar-up-arrow",onClick:je,onMouseEnter:()=>ke("up"),onMouseLeave:()=>ke(null),style:{position:"absolute",top:`${v.margin}px`,right:v.alignment==="right"?"0px":`${(he-O)/2}px`,width:`${O}px`,height:`${O}px`,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",fontSize:`${Math.max(O*.75,8)}px`,color:Se==="up"?_.hoverColor:_.color,userSelect:"none",zIndex:1001,opacity:V?Se==="up"?_.hoverOpacity:_.opacity:0,transition:"opacity 0.2s ease-in-out, color 0.15s ease-in-out"},children:"\u25B2"}),z&&J&&ee&&(0,ne.jsx)("div",{className:"overlay-scrollbar-down-arrow",onClick:re,onMouseEnter:()=>ke("down"),onMouseLeave:()=>ke(null),style:{position:"absolute",bottom:`${v.margin}px`,right:v.alignment==="right"?"0px":`${(he-O)/2}px`,width:`${O}px`,height:`${O}px`,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",fontSize:`${Math.max(O*.75,8)}px`,color:Se==="down"?_.hoverColor:_.color,userSelect:"none",zIndex:1001,opacity:V?Se==="down"?_.hoverOpacity:_.opacity:0,transition:"opacity 0.2s ease-in-out, color 0.15s ease-in-out"},children:"\u25BC"})]})}),ot=kt;var c=require("react/jsx-runtime"),Lt={alignment:"right",margin:0,radius:0},it=5,Rt={bg:"#ffffff",border:"#e6e6e3",borderStrong:"#dedddb",headerColor:"#787774",hoverBg:"#f8f8f7"},lt="12px",Dt={bg:"#1e1e1e",border:"#2c333c",borderStrong:"#3b434e",headerColor:"#a3adbb",hoverBg:"#272d36"};function Et({data:l,loading:p=!1,columns:h,onRowClick:C,getRowId:w,selectedRowId:T,selectedRowSx:b,rowHeight:S=50,columnHeight:F,striped:A,rowDivider:X=!0,onSort:z,onLoadMore:K,sortBy:I,sortDirection:W,showPaper:de=!0,paddingX:f,paddingTop:q=0,paddingBottom:pe=0,rowHoverColor:Me,rowHoverOpacity:B,viewportBuffer:V,overscan:L,scrollbars:N,emptyMessage:oe="NO DATA",LoadingComponent:ie,showFooter:Ce,footerHeight:G,footerSx:le,variant:ae="default"}){let se=ae==="notion",Z=(0,d.useTheme)().palette.mode==="dark"?Dt:Rt,J=F??(se?40:56),me=f??(se?"12px":"1rem"),ce=Me??(se?Z.hoverBg:void 0),Ee=B??(se?1:void 0),Te=Math.max(S*12,480),We=Math.max(S*12,480),Je=typeof V=="number"?V:V?.top??Te,Qe=typeof V=="number"?V:V?.bottom??We,Se=Math.max(S*8,420),ke=Math.max(S*10,520),et=typeof L=="number"?L:{main:L?.main??Se,reverse:L?.reverse??ke},Le=S+(X?1:0),Q=!b||typeof b!="function",$e=(0,u.useMemo)(()=>!Q||T===null||T===void 0||!b?null:{[`& tbody tr[data-row-id="${String(T).replace(/["\\]/g,"\\$&")}"]`]:b},[Q,T,b]),qe=typeof window<"u"&&(window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1"),[x]=(0,u.useState)(()=>typeof window>"u"?!1:window.localStorage.getItem("vdt-perf-debug")==="1"),m=(0,u.useRef)({wheelEvents:0,wheelInputPx:0,wheelHandlerMs:0,wheelRafFlushes:0,wheelRafMs:0,rangeChangedCalls:0,rangeChangedMs:0,rowContentCalls:0,rowContentMs:0,rowContentMaxMs:0,cellRenderCalls:0,cellRenderMs:0,cellRenderMaxMs:0}),U=(0,u.useCallback)(t=>{if(!x)return;let e=m.current;if(!(e.wheelEvents>0||e.rangeChangedCalls>0||e.rowContentCalls>0||e.cellRenderCalls>0))return;let s=e.rowContentCalls>0?e.rowContentMs/e.rowContentCalls:0,a=e.cellRenderCalls>0?e.cellRenderMs/e.cellRenderCalls:0;console.log("[VDT perf]",{reason:t,wheel:{events:e.wheelEvents,inputPx:Math.round(e.wheelInputPx),handlerMs:Number(e.wheelHandlerMs.toFixed(2)),rafFlushes:e.wheelRafFlushes,rafMs:Number(e.wheelRafMs.toFixed(2))},rangeChanged:{calls:e.rangeChangedCalls,totalMs:Number(e.rangeChangedMs.toFixed(2))},rowContent:{calls:e.rowContentCalls,totalMs:Number(e.rowContentMs.toFixed(2)),avgMs:Number(s.toFixed(3)),maxMs:Number(e.rowContentMaxMs.toFixed(3))},cellRender:{calls:e.cellRenderCalls,totalMs:Number(e.cellRenderMs.toFixed(2)),avgMs:Number(a.toFixed(3)),maxMs:Number(e.cellRenderMaxMs.toFixed(3))}}),m.current={wheelEvents:0,wheelInputPx:0,wheelHandlerMs:0,wheelRafFlushes:0,wheelRafMs:0,rangeChangedCalls:0,rangeChangedMs:0,rowContentCalls:0,rowContentMs:0,rowContentMaxMs:0,cellRenderCalls:0,cellRenderMs:0,cellRenderMaxMs:0}},[x]);(0,u.useEffect)(()=>{if(!x||typeof window>"u")return;console.log("[VDT perf] enabled (localStorage vdt-perf-debug=1)");let t=window.setInterval(()=>{U("interval")},1500);return()=>{window.clearInterval(t),U("cleanup")}},[U,x]);let P=(0,u.useMemo)(()=>(0,u.forwardRef)((t,e)=>{let o=(0,u.useRef)(null),s=(0,u.useRef)(0),a=(0,u.useRef)(null);return(0,u.useEffect)(()=>{let r=o.current;if(!r)return;let g=$=>{let Y=x?performance.now():0;$.preventDefault();let E=$.deltaY;$.deltaMode===1?E*=40:$.deltaMode===2&&(E*=r.clientHeight),x&&(m.current.wheelEvents+=1,m.current.wheelInputPx+=E),s.current+=E,a.current===null&&(a.current=requestAnimationFrame(()=>{let ye=x?performance.now():0,ue=Math.max(r.clientHeight*.4,160),H=Math.max(-ue,Math.min(ue,s.current));s.current=0,a.current=null,H!==0&&(r.scrollTop+=H),x&&(m.current.wheelRafFlushes+=1,m.current.wheelRafMs+=performance.now()-ye)}),x&&(m.current.wheelHandlerMs+=performance.now()-Y))};return r.addEventListener("wheel",g,{passive:!1}),()=>{r.removeEventListener("wheel",g),a.current!==null&&(cancelAnimationFrame(a.current),a.current=null),s.current=0}},[]),(0,c.jsx)(ot,{detectInnerScroll:!0,track:Lt,...N,children:(0,c.jsx)(d.TableContainer,{component:d.Box,...t,ref:r=>{o.current=r,typeof e=="function"?e(r):e&&(e.current=r)},sx:{userSelect:"auto",WebkitUserSelect:"auto",position:"relative",width:"100%",height:"100%",overflow:"auto",display:"flex",flexDirection:"column",scrollbarWidth:"none",msOverflowStyle:"none",transform:"translateZ(0)",backfaceVisibility:"hidden",willChange:"scroll-position","&::-webkit-scrollbar":{display:"none"},"& .MuiTable-root":{paddingRight:se?0:me,paddingTop:q,paddingBottom:pe}}})})}),[]),v=(0,u.useMemo)(()=>{if(A===!0)return"#f5f5f5";if(typeof A=="string")return A},[A]),[_,Re]=(0,u.useState)(p),[M,O]=(0,u.useState)(0);(0,u.useEffect)(()=>{p&&Re(!0)},[p]);let Pe=(0,u.useCallback)(()=>{Re(!1)},[]),He=_,ee=p&&l.length>0,fe=(0,u.useRef)(!1),j=(0,u.useRef)(-1),k=(0,u.useRef)(null),te=(0,u.useRef)(C);te.current=C;let R=(0,u.useRef)(w);R.current=w;let Ie=!!C,ge=(0,u.useRef)(!1),D=(0,u.useRef)({x:0,y:0});(0,u.useEffect)(()=>{let t=e=>{let o=e.clientX-D.current.x,s=e.clientY-D.current.y;Math.sqrt(o*o+s*s)>it&&(ge.current=!0)};return document.addEventListener("mousemove",t),()=>{document.removeEventListener("mousemove",t)}},[]),(0,u.useEffect)(()=>{let t=document.querySelector('[data-testid="virtuoso-scroller"]');t&&t.querySelectorAll(".MuiTableSortLabel-root").forEach(o=>{let s=new MouseEvent("mouseleave",{bubbles:!0,cancelable:!0});o.dispatchEvent(s)})},[I]);let y=(0,u.useCallback)(t=>{if(!z)return;z(t,I===t&&W==="asc"?"desc":"asc")},[z,I,W]),Ve=(0,u.useCallback)(t=>{let e=x?performance.now():0;if(!K){x&&(m.current.rangeChangedCalls+=1,m.current.rangeChangedMs+=performance.now()-e);return}if(p&&l.length===0){x&&(m.current.rangeChangedCalls+=1,m.current.rangeChangedMs+=performance.now()-e);return}let o=l.length>=30,s=t>=l.length-1,a=j.current===l.length;if(s&&o&&!fe.current&&!a){fe.current=!0,j.current=l.length;let r=l.length;K(r,50)}x&&(m.current.rangeChangedCalls+=1,m.current.rangeChangedMs+=performance.now()-e)},[l.length,p,K,x]);(0,u.useEffect)(()=>{p||(fe.current=!1)},[p]),(0,u.useEffect)(()=>{l.length===0&&O(t=>t+1)},[l.length]);let be=(0,u.useRef)(l.length),xe=(0,u.useRef)(void 0);(0,u.useEffect)(()=>{let t=be.current,e=l.length,o=e>0?R.current?R.current(l[0],0):l[0]:void 0,s=xe.current;if(e>t&&t>0){be.current=e,xe.current=o;return}let a=e<t||t>0&&o!==s;a&&(j.current=-1),k.current&&e>0&&a&&k.current.scrollToIndex({index:0,align:"start",behavior:"auto"}),be.current=e,xe.current=o},[l]);let _e=(0,u.useCallback)(()=>{let t={},e=[];if(h.forEach(r=>{r.group?(t[r.group]||(t[r.group]=[]),t[r.group].push(r)):e.push(r)}),!(Object.keys(t).length>0))return(0,c.jsx)(d.TableRow,{children:h.map(r=>(0,c.jsx)(d.TableCell,{align:r.align||"left",style:{width:r.width,minWidth:r.width,...r.style,fontWeight:"bold",position:"sticky",top:0,zIndex:2,padding:"16px"},children:r.sortable?(0,c.jsx)("div",{style:{display:"flex",alignItems:"center",justifyContent:r.align==="center"?"center":r.align==="right"?"flex-end":"flex-start",position:"relative",width:"100%"},children:(0,c.jsxs)(d.Box,{sx:{position:"relative",cursor:"default","&:hover .MuiTableSortLabel-root":{opacity:"1 !important","& .MuiSvgIcon-root":{color:"#000",opacity:"1 !important"}}},onClick:()=>y(String(r.id)),children:[r.text,(0,c.jsx)(d.TableSortLabel,{active:I===r.id,direction:I===r.id?W:"desc",sx:{position:"absolute",left:"100%",top:"50%",transform:"translateY(-50%)",marginLeft:"4px",minWidth:"auto",width:"16px",height:"16px",cursor:"default",opacity:I===r.id?1:0,transition:"opacity 0.2s ease","& .MuiTableSortLabel-icon":{position:"relative",marginLeft:0,marginRight:0,opacity:1,transition:"color 0.2s ease"},"& .MuiTableSortLabel-iconDirectionAsc":{transform:"rotate(180deg)"},"& .MuiTableSortLabel-iconDirectionDesc":{transform:"rotate(0deg)"}}})]})}):r.text},String(r.id)))});let s=[...e.map(r=>(0,c.jsx)(d.TableCell,{rowSpan:2,align:r.align||"left",style:{width:r.width,minWidth:r.width,...r.style,fontWeight:"bold",position:"sticky",top:0,zIndex:2,padding:"16px"},children:r.sortable&&z?(0,c.jsx)("div",{style:{display:"flex",alignItems:"center",justifyContent:r.align==="center"?"center":r.align==="right"?"flex-end":"flex-start",position:"relative",width:"100%"},children:(0,c.jsxs)(d.Box,{sx:{position:"relative",cursor:"default","&:hover .MuiTableSortLabel-root":{opacity:"1 !important","& .MuiSvgIcon-root":{color:"#000",opacity:"1 !important"}}},onClick:()=>y(String(r.id)),children:[r.text,(0,c.jsx)(d.TableSortLabel,{active:I===r.id,direction:I===r.id?W:"desc",sx:{position:"absolute",left:"100%",top:"50%",transform:"translateY(-50%)",marginLeft:"4px",minWidth:"auto",width:"16px",height:"16px",cursor:"default",opacity:I===r.id?1:0,transition:"opacity 0.2s ease","&:hover":{opacity:"1 !important","& .MuiSvgIcon-root":{color:"#000",opacity:"1 !important"}},"& .MuiTableSortLabel-icon":{position:"relative",marginLeft:0,marginRight:0,opacity:1,transition:"color 0.2s ease"},"& .MuiTableSortLabel-iconDirectionAsc":{transform:"rotate(180deg)"},"& .MuiTableSortLabel-iconDirectionDesc":{transform:"rotate(0deg)"}}})]})}):r.text},String(r.id))),...Object.entries(t).map(([r,g])=>(0,c.jsx)(d.TableCell,{align:"center",colSpan:g.length,style:{fontWeight:"bold",position:"sticky",top:0,zIndex:2,padding:"16px"},children:r},r))],a=[...Object.values(t).flat().map(r=>(0,c.jsx)(d.TableCell,{align:r.align||"left",style:{width:r.width,minWidth:r.width,...r.style,fontWeight:"bold",position:"sticky",top:0,zIndex:2,padding:"16px"},children:r.sortable&&z?(0,c.jsx)("div",{style:{display:"flex",alignItems:"center",justifyContent:r.align==="center"?"center":r.align==="right"?"flex-end":"flex-start",position:"relative",width:"100%"},children:(0,c.jsxs)(d.Box,{sx:{position:"relative",cursor:"default","&:hover .MuiTableSortLabel-root":{opacity:"1 !important","& .MuiSvgIcon-root":{color:"#000",opacity:"1 !important"}}},onClick:()=>y(String(r.id)),children:[r.text,(0,c.jsx)(d.TableSortLabel,{active:I===r.id,direction:I===r.id?W:"desc",sx:{position:"absolute",left:"100%",top:"50%",transform:"translateY(-50%)",marginLeft:"4px",minWidth:"auto",width:"16px",height:"16px",cursor:"default",opacity:I===r.id?1:0,transition:"opacity 0.2s ease","&:hover":{opacity:"1 !important","& .MuiSvgIcon-root":{color:"#000",opacity:"1 !important"}},"& .MuiTableSortLabel-icon":{position:"relative",marginLeft:0,marginRight:0,opacity:1,transition:"color 0.2s ease"},"& .MuiTableSortLabel-iconDirectionAsc":{transform:"rotate(0deg)"},"& .MuiTableSortLabel-iconDirectionDesc":{transform:"rotate(180deg)"}}})]})}):r.text},String(r.id)))];return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(d.TableRow,{children:s}),(0,c.jsx)(d.TableRow,{children:a})]})},[h,I,W,y,z,J]),je=(0,u.useCallback)((t,e)=>{let o=x?performance.now():0;if(!e){if(x){m.current.rowContentCalls+=1;let a=performance.now()-o;m.current.rowContentMs+=a,m.current.rowContentMaxMs=Math.max(m.current.rowContentMaxMs,a)}return null}let s=h.map(a=>{let r=x?performance.now():0,g=a.render?a.render(e,t):String(e[a.id]||"");if(x){let $=performance.now()-r;m.current.cellRenderCalls+=1,m.current.cellRenderMs+=$,m.current.cellRenderMaxMs=Math.max(m.current.cellRenderMaxMs,$)}return(0,c.jsx)(d.TableCell,{align:a.align||"left",style:{width:a.width,minWidth:a.width,...a.style,padding:"8px 16px"},children:g},String(a.id))});if(x){m.current.rowContentCalls+=1;let a=performance.now()-o;m.current.rowContentMs+=a,m.current.rowContentMaxMs=Math.max(m.current.rowContentMaxMs,a)}return(0,c.jsx)(c.Fragment,{children:s})},[h,x]),re=Ce??h.some(t=>typeof t.footer=="function"),Ye=(0,u.useCallback)(()=>{if(!re)return null;let t=[];for(let e=0;e<h.length;e+=1){let o=h[e],s=o.footerColSpan&&o.footerColSpan>1?Math.min(o.footerColSpan,h.length-e):1;t.push((0,c.jsx)(d.TableCell,{align:o.align||"left",colSpan:s>1?s:void 0,style:{...s>1?{}:{width:o.width,minWidth:o.width},...o.style,fontWeight:"bold",padding:"16px"},children:o.footer?o.footer(l):null},String(o.id))),e+=s-1}return(0,c.jsx)(d.TableRow,{children:t})},[re,h,l]),Oe=(0,u.useMemo)(()=>({Scroller:P,Table:t=>(0,c.jsx)(d.Table,{...t,sx:{borderCollapse:"separate",tableLayout:"fixed",marginRight:"16px",...re?{height:"100%"}:{}}}),TableHead:(0,u.forwardRef)((t,e)=>(0,c.jsx)(d.TableHead,{...t,ref:e,sx:{userSelect:"none","& tr":{height:J,"& th":{padding:"16px",position:"sticky",top:0,zIndex:2,fontWeight:"bold"}}}})),TableRow:t=>{let{item:e,selected:o,"aria-selected":s,className:a,...r}=t,g=r["data-index"]??0,$=g%2===1,Y=e&&R.current?R.current(e,g):g,E=!Q&&T!==null&&T!==void 0&&Y===T,ye=E&&b?typeof b=="function"?b(e,g):b:void 0,ue=String(a??"").split(/\s+/).filter(H=>H!=="Mui-selected"&&H!=="Mui-focusVisible").join(" ");return(0,c.jsx)(d.TableRow,{...r,"data-row-id":Y!=null?String(Y):void 0,className:ue||void 0,selected:E,onMouseDown:H=>{ge.current=!1,D.current={x:H.clientX,y:H.clientY}},onClick:H=>{let De=H.clientX-D.current.x,Xe=H.clientY-D.current.y;if(Math.sqrt(De*De+Xe*Xe)>it||ge.current){H.preventDefault(),H.stopPropagation(),ge.current=!1;return}e&&te.current&&te.current(e,g),ge.current=!1},sx:[{userSelect:"none",height:Le,maxHeight:Le,boxSizing:"border-box",backgroundColor:$&&v?v:"transparent","& td":{padding:"8px 16px",boxSizing:"border-box",borderBottom:X?"1px solid rgba(224, 224, 224, 1)":"none"},"& th":{padding:"8px 16px",borderBottom:"none"},"&:hover":Ie&&!E?{backgroundColor:H=>{let De=H.palette.mode==="dark",Ke=ce??"#000000",Ge=Ee??.06;if(!ce)return De?`rgba(255, 255, 255, ${Ge})`:`rgba(0, 0, 0, ${Ge})`;let Be=Ke.replace("#","").trim();if(Be.length!==6)return Ke;let ct=parseInt(Be.substring(0,2),16),ut=parseInt(Be.substring(2,4),16),dt=parseInt(Be.substring(4,6),16);return`rgba(${ct}, ${ut}, ${dt}, ${Ge})`}}:void 0,cursor:Ie?"pointer":void 0},ye]})},TableBody:(0,u.forwardRef)((t,e)=>{let{children:o,...s}=t;return(0,c.jsxs)(d.TableBody,{...s,ref:e,sx:re?{height:"100%"}:void 0,children:[o,re&&(0,c.jsx)("tr",{"aria-hidden":!0,style:{height:"100%"},children:(0,c.jsx)("td",{colSpan:h.length,style:{padding:0,border:0}})})]})}),TableFoot:(0,u.forwardRef)((t,e)=>(0,c.jsx)(d.TableFooter,{...t,ref:e,sx:[{"& tr":{height:G??S,maxHeight:G??S,boxSizing:"border-box"},"& td":{height:G??S,boxSizing:"border-box",backgroundColor:o=>o.palette.mode==="dark"?"#1e1e1e":"#ffffff",padding:"0 16px",color:"inherit",fontSize:"0.875rem",border:"none",boxShadow:"inset 0 1px 0 0 #000000"}},...Array.isArray(le)?le:le?[le]:[]]}))}),[Ie,Q?null:T,b,S,v,X,J,ce,Ee,P,G,le,re,h]),he=(0,c.jsxs)(d.Box,{sx:{position:"relative",height:"100%",width:"100%","& .MuiTableHead-root":{backgroundColor:t=>t.palette.mode==="dark"?"#1e1e1e !important":"#ffffff !important"},...$e??{},...se?{border:`1px solid ${Z.borderStrong}`,borderRadius:"4px",overflow:"hidden","& thead tr th":{height:J,boxSizing:"border-box",padding:"0 14px !important",fontSize:13,fontWeight:"500 !important",color:Z.headerColor,backgroundColor:`${Z.bg} !important`,borderTop:"none",borderBottom:`1px solid ${Z.borderStrong}`,borderRight:`1px solid ${Z.border}`,"&:last-of-type":{borderRight:"none"}},"& tbody tr td":{padding:"0 14px !important",fontSize:14,borderBottom:`1px solid ${Z.border}`}}:{}},children:[(0,c.jsx)(at.TableVirtuoso,{ref:k,data:l,totalCount:K?l.length+1:l.length,defaultItemHeight:Le,fixedItemHeight:Le,fixedHeaderContent:_e,fixedFooterContent:re?Ye:void 0,itemContent:je,endReached:Ve,style:{height:"100%"},increaseViewportBy:{top:Je,bottom:Qe},overscan:et,followOutput:!1,components:Oe},M),l.length===0&&!p&&(0,c.jsx)(d.Box,{sx:{position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:2},children:typeof oe=="string"?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(d.Box,{sx:{width:48,height:48,display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"50%",backgroundColor:"#f5f5f5",color:"#999"},children:"\u{1F4C4}"}),(0,c.jsx)(d.Typography,{variant:"body1",sx:{color:"text.secondary"},children:oe})]}):oe}),He&&(0,c.jsx)(c.Fragment,{children:ie?(0,c.jsx)(ie,{visible:p,onComplete:Pe}):(0,c.jsx)(tt,{visible:p,onComplete:Pe,size:40,indicator:(0,c.jsx)(rt,{}),sx:{top:`${h.some(t=>t.group)?J*2:J}px`,bottom:`${re?G??S:0}px`},background:{show:l.length===0,opacity:.8}})})]}),n=se?{paddingRight:me,paddingTop:lt,paddingBottom:lt}:{};return de?(0,c.jsx)(d.Paper,{className:"grow",elevation:1,sx:{padding:0,paddingLeft:me,...n,boxSizing:"border-box",height:"100%",minHeight:0,flex:1,display:"flex",flexDirection:"column"},children:he}):(0,c.jsx)(d.Box,{className:"grow",style:{padding:0,paddingLeft:me,...n,boxSizing:"border-box",height:"100%",minHeight:0,flex:1,display:"flex",flexDirection:"column"},children:he})}var st=(0,u.memo)(Et);
4
+ `;function Ze({size:o=54}){return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)("style",{children:Bt}),(0,Y.jsx)("span",{className:"vdt-css-spinner",role:"progressbar","aria-label":"loading",style:{display:"inline-block",width:o,height:o}})]})}var tt=At(require("@ehfuse/overlay-scrollbar"),1),r=require("react/jsx-runtime"),Ot={alignment:"default",margin:0,radius:0},Oe=5,Ft={bg:"#ffffff",border:"#e6e6e3",borderStrong:"#dedddb",headerColor:"#787774",hoverBg:"#f8f8f7",emptyColor:"#9b9a97",selectedBg:"#dbeafe",selectedBar:"#3b82f6"},Qe="12px",zt={bg:"#1e1e1e",border:"#2c333c",borderStrong:"#3b434e",headerColor:"#a3adbb",hoverBg:"#272d36",emptyColor:"#7d8590",selectedBg:"rgba(59, 130, 246, 0.22)",selectedBar:"#60a5fa"};function Vt({data:o,loading:d=!1,columns:l,onRowClick:w,getRowId:m,selectedRowId:y,selectedRowSx:oe,rowHeight:ae,columnHeight:G,striped:X,rowDivider:J=!0,onSort:I,onLoadMore:D,sortBy:x,sortDirection:S,showPaper:ie=!0,paddingX:B,paddingTop:se=0,paddingBottom:Ce=0,rowHoverColor:le,rowHoverOpacity:de,viewportBuffer:H,overscan:O,scrollbars:L,emptyMessage:E="NO DATA",autoHeight:v=!1,LoadingComponent:ce,showFooter:we,footerHeight:F,footerSx:z,variant:rt="default",framed:U=!0,rowHeightMode:ot="fixed",tableLayout:Fe="fixed",renderFullWidthRow:ve,fullWidthRowSx:Z,onRowContextMenu:ze}){let f=rt==="notion",Me=(0,i.useTheme)(),h=Me.palette.mode==="dark"?zt:Ft,V=G??(f?40:56),R=ae??(f?48:50),ue=U?B??(f?"12px":"1rem"):0,Te=ot==="auto",Se=le??(f?h.hoverBg:void 0),Ve=de??(f?1:void 0),at=Math.max(R*12,480),it=Math.max(R*12,480),st=typeof H=="number"?H:H?.top??at,lt=typeof H=="number"?H:H?.bottom??it,dt=Math.max(R*8,420),ct=Math.max(R*10,520),ut=typeof O=="number"?O:{main:O?.main??dt,reverse:O?.reverse??ct},Q=R+(J?1:0),pt=(0,a.useMemo)(()=>f?{backgroundColor:h.selectedBg,"& > td:first-of-type":{boxShadow:`inset 3px 0 0 ${h.selectedBar}`},"& > td[data-vdt-pinned]":{backgroundColor:h.selectedBg}}:void 0,[f,h]),k=oe??pt,pe=!k||typeof k!="function",ft=(0,a.useMemo)(()=>!pe||y===null||y===void 0||!k?null:{[`& tbody tr[data-row-id="${String(y).replace(/["\\]/g,"\\$&")}"]`]:k},[pe,y,k]),_t=typeof window<"u"&&(window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1"),[g]=(0,a.useState)(()=>typeof window>"u"?!1:window.localStorage.getItem("vdt-perf-debug")==="1"),u=(0,a.useRef)({wheelEvents:0,wheelInputPx:0,wheelHandlerMs:0,wheelRafFlushes:0,wheelRafMs:0,rangeChangedCalls:0,rangeChangedMs:0,rowContentCalls:0,rowContentMs:0,rowContentMaxMs:0,cellRenderCalls:0,cellRenderMs:0,cellRenderMaxMs:0}),Re=(0,a.useCallback)(n=>{if(!g)return;let t=u.current;if(!(t.wheelEvents>0||t.rangeChangedCalls>0||t.rowContentCalls>0||t.cellRenderCalls>0))return;let c=t.rowContentCalls>0?t.rowContentMs/t.rowContentCalls:0,b=t.cellRenderCalls>0?t.cellRenderMs/t.cellRenderCalls:0;console.log("[VDT perf]",{reason:n,wheel:{events:t.wheelEvents,inputPx:Math.round(t.wheelInputPx),handlerMs:Number(t.wheelHandlerMs.toFixed(2)),rafFlushes:t.wheelRafFlushes,rafMs:Number(t.wheelRafMs.toFixed(2))},rangeChanged:{calls:t.rangeChangedCalls,totalMs:Number(t.rangeChangedMs.toFixed(2))},rowContent:{calls:t.rowContentCalls,totalMs:Number(t.rowContentMs.toFixed(2)),avgMs:Number(c.toFixed(3)),maxMs:Number(t.rowContentMaxMs.toFixed(3))},cellRender:{calls:t.cellRenderCalls,totalMs:Number(t.cellRenderMs.toFixed(2)),avgMs:Number(b.toFixed(3)),maxMs:Number(t.cellRenderMaxMs.toFixed(3))}}),u.current={wheelEvents:0,wheelInputPx:0,wheelHandlerMs:0,wheelRafFlushes:0,wheelRafMs:0,rangeChangedCalls:0,rangeChangedMs:0,rowContentCalls:0,rowContentMs:0,rowContentMaxMs:0,cellRenderCalls:0,cellRenderMs:0,cellRenderMaxMs:0}},[g]);(0,a.useEffect)(()=>{if(!g||typeof window>"u")return;console.log("[VDT perf] enabled (localStorage vdt-perf-debug=1)");let n=window.setInterval(()=>{Re("interval")},1500);return()=>{window.clearInterval(n),Re("cleanup")}},[Re,g]);let $e=(0,a.useMemo)(()=>(0,a.forwardRef)((n,t)=>{let s=(0,a.useRef)(null),c=(0,a.useRef)(0),b=(0,a.useRef)(null);return(0,a.useEffect)(()=>{let e=s.current;if(!e)return;let C=M=>{let A=g?performance.now():0;if(M.shiftKey||Math.abs(M.deltaX)>Math.abs(M.deltaY))return;M.preventDefault();let T=M.deltaY;M.deltaMode===1?T*=40:M.deltaMode===2&&(T*=e.clientHeight),g&&(u.current.wheelEvents+=1,u.current.wheelInputPx+=T),c.current+=T,b.current===null&&(b.current=requestAnimationFrame(()=>{let _=g?performance.now():0,N=Math.max(e.clientHeight*.4,160),p=Math.max(-N,Math.min(N,c.current));c.current=0,b.current=null,p!==0&&(e.scrollTop+=p),g&&(u.current.wheelRafFlushes+=1,u.current.wheelRafMs+=performance.now()-_)}),g&&(u.current.wheelHandlerMs+=performance.now()-A))};return e.addEventListener("wheel",C,{passive:!1}),()=>{e.removeEventListener("wheel",C),b.current!==null&&(cancelAnimationFrame(b.current),b.current=null),c.current=0}},[]),(0,r.jsx)(tt.default,{detectInnerScroll:!0,track:Ot,...L,children:(0,r.jsx)(i.TableContainer,{component:i.Box,...n,ref:e=>{s.current=e,typeof t=="function"?t(e):t&&(t.current=e)},sx:{userSelect:"auto",WebkitUserSelect:"auto",position:"relative",width:"100%",height:"100%",overflow:"auto",display:"flex",flexDirection:"column",scrollbarWidth:"none",msOverflowStyle:"none",transform:"translateZ(0)",backfaceVisibility:"hidden",willChange:"scroll-position","&::-webkit-scrollbar":{display:"none"},"& .MuiTable-root":{paddingRight:f?0:ue,paddingTop:se,paddingBottom:Ce}}})})}),[]),ke=(0,a.useMemo)(()=>{if(X===!0)return"#f5f5f5";if(typeof X=="string")return X},[X]),[gt,_e]=(0,a.useState)(d),[bt,ht]=(0,a.useState)(0);(0,a.useEffect)(()=>{d&&_e(!0)},[d]);let We=(0,a.useCallback)(()=>{_e(!1)},[]),mt=gt,Wt=d&&o.length>0,De=(0,a.useRef)(!1),Le=(0,a.useRef)(-1),Ee=(0,a.useRef)(null),Pe=(0,a.useRef)(w);Pe.current=w;let ee=(0,a.useRef)(m);ee.current=m;let Ie=(0,a.useRef)(ze);Ie.current=ze;let fe=(0,a.useMemo)(()=>{let n=new Map,t=0;return l.forEach(s=>{s.pinned==="left"&&(n.set(String(s.id),t),t+=typeof s.width=="number"?s.width:0)}),n},[l]),K=(0,a.useCallback)((n,t)=>{let s=fe.get(String(n.id));return s===void 0?{}:{position:"sticky",left:s,zIndex:t?3:1}},[fe]),ge=!!w,te=(0,a.useRef)(!1),$=(0,a.useRef)({x:0,y:0});(0,a.useEffect)(()=>{let n=t=>{let s=t.clientX-$.current.x,c=t.clientY-$.current.y;Math.sqrt(s*s+c*c)>Oe&&(te.current=!0)};return document.addEventListener("mousemove",n),()=>{document.removeEventListener("mousemove",n)}},[]),(0,a.useEffect)(()=>{let n=document.querySelector('[data-testid="virtuoso-scroller"]');n&&n.querySelectorAll(".MuiTableSortLabel-root").forEach(s=>{let c=new MouseEvent("mouseleave",{bubbles:!0,cancelable:!0});s.dispatchEvent(c)})},[x]);let be=(0,a.useCallback)(n=>{if(!I)return;I(n,x===n&&S==="asc"?"desc":"asc")},[I,x,S]),xt=(0,a.useCallback)(n=>{let t=g?performance.now():0;if(!D){g&&(u.current.rangeChangedCalls+=1,u.current.rangeChangedMs+=performance.now()-t);return}if(d&&o.length===0){g&&(u.current.rangeChangedCalls+=1,u.current.rangeChangedMs+=performance.now()-t);return}let s=o.length>=30,c=n>=o.length-1,b=Le.current===o.length;if(c&&s&&!De.current&&!b){De.current=!0,Le.current=o.length;let e=o.length;D(e,50)}g&&(u.current.rangeChangedCalls+=1,u.current.rangeChangedMs+=performance.now()-t)},[o.length,d,D,g]);(0,a.useEffect)(()=>{d||(De.current=!1)},[d]),(0,a.useEffect)(()=>{o.length===0&&ht(n=>n+1)},[o.length]);let He=(0,a.useRef)(o.length),Ae=(0,a.useRef)(void 0);(0,a.useEffect)(()=>{let n=He.current,t=o.length,s=t>0?ee.current?ee.current(o[0],0):o[0]:void 0,c=Ae.current;if(t>n&&n>0){He.current=t,Ae.current=s;return}let b=t<n||n>0&&s!==c;b&&(Le.current=-1),Ee.current&&t>0&&b&&Ee.current.scrollToIndex({index:0,align:"start",behavior:"auto"}),He.current=t,Ae.current=s},[o]);let je=(0,a.useCallback)(()=>{let n={},t=[];if(l.forEach(e=>{e.group?(n[e.group]||(n[e.group]=[]),n[e.group].push(e)):t.push(e)}),!(Object.keys(n).length>0))return(0,r.jsx)(i.TableRow,{children:l.map(e=>(0,r.jsx)(i.TableCell,{align:e.align||"left",...e.headerProps,style:{width:e.width,minWidth:e.width,...e.style,fontWeight:"bold",position:"sticky",top:0,zIndex:2,padding:"16px",...K(e,!0),...e.headerProps?.style},children:e.sortable?(0,r.jsx)("div",{style:{display:"flex",alignItems:"center",justifyContent:e.align==="center"?"center":e.align==="right"?"flex-end":"flex-start",position:"relative",width:"100%"},children:(0,r.jsxs)(i.Box,{sx:{position:"relative",cursor:"default","&:hover .MuiTableSortLabel-root":{opacity:"1 !important","& .MuiSvgIcon-root":{color:"#000",opacity:"1 !important"}}},onClick:()=>be(String(e.id)),children:[e.text,(0,r.jsx)(i.TableSortLabel,{active:x===e.id,direction:x===e.id?S:"desc",sx:{position:"absolute",left:"100%",top:"50%",transform:"translateY(-50%)",marginLeft:"4px",minWidth:"auto",width:"16px",height:"16px",cursor:"default",opacity:x===e.id?1:0,transition:"opacity 0.2s ease","& .MuiTableSortLabel-icon":{position:"relative",marginLeft:0,marginRight:0,opacity:1,transition:"color 0.2s ease"},"& .MuiTableSortLabel-iconDirectionAsc":{transform:"rotate(180deg)"},"& .MuiTableSortLabel-iconDirectionDesc":{transform:"rotate(0deg)"}}})]})}):e.text},String(e.id)))});let c=[...t.map(e=>(0,r.jsx)(i.TableCell,{rowSpan:2,align:e.align||"left",...e.headerProps,style:{width:e.width,minWidth:e.width,...e.style,fontWeight:"bold",position:"sticky",top:0,zIndex:2,padding:"16px",...K(e,!0),...e.headerProps?.style},children:e.sortable&&I?(0,r.jsx)("div",{style:{display:"flex",alignItems:"center",justifyContent:e.align==="center"?"center":e.align==="right"?"flex-end":"flex-start",position:"relative",width:"100%"},children:(0,r.jsxs)(i.Box,{sx:{position:"relative",cursor:"default","&:hover .MuiTableSortLabel-root":{opacity:"1 !important","& .MuiSvgIcon-root":{color:"#000",opacity:"1 !important"}}},onClick:()=>be(String(e.id)),children:[e.text,(0,r.jsx)(i.TableSortLabel,{active:x===e.id,direction:x===e.id?S:"desc",sx:{position:"absolute",left:"100%",top:"50%",transform:"translateY(-50%)",marginLeft:"4px",minWidth:"auto",width:"16px",height:"16px",cursor:"default",opacity:x===e.id?1:0,transition:"opacity 0.2s ease","&:hover":{opacity:"1 !important","& .MuiSvgIcon-root":{color:"#000",opacity:"1 !important"}},"& .MuiTableSortLabel-icon":{position:"relative",marginLeft:0,marginRight:0,opacity:1,transition:"color 0.2s ease"},"& .MuiTableSortLabel-iconDirectionAsc":{transform:"rotate(180deg)"},"& .MuiTableSortLabel-iconDirectionDesc":{transform:"rotate(0deg)"}}})]})}):e.text},String(e.id))),...Object.entries(n).map(([e,C])=>(0,r.jsx)(i.TableCell,{align:"center",colSpan:C.length,style:{fontWeight:"bold",position:"sticky",top:0,zIndex:2,padding:"16px"},children:e},e))],b=[...Object.values(n).flat().map(e=>(0,r.jsx)(i.TableCell,{align:e.align||"left",...e.headerProps,style:{width:e.width,minWidth:e.width,...e.style,fontWeight:"bold",position:"sticky",top:0,zIndex:2,padding:"16px",...K(e,!0),...e.headerProps?.style},children:e.sortable&&I?(0,r.jsx)("div",{style:{display:"flex",alignItems:"center",justifyContent:e.align==="center"?"center":e.align==="right"?"flex-end":"flex-start",position:"relative",width:"100%"},children:(0,r.jsxs)(i.Box,{sx:{position:"relative",cursor:"default","&:hover .MuiTableSortLabel-root":{opacity:"1 !important","& .MuiSvgIcon-root":{color:"#000",opacity:"1 !important"}}},onClick:()=>be(String(e.id)),children:[e.text,(0,r.jsx)(i.TableSortLabel,{active:x===e.id,direction:x===e.id?S:"desc",sx:{position:"absolute",left:"100%",top:"50%",transform:"translateY(-50%)",marginLeft:"4px",minWidth:"auto",width:"16px",height:"16px",cursor:"default",opacity:x===e.id?1:0,transition:"opacity 0.2s ease","&:hover":{opacity:"1 !important","& .MuiSvgIcon-root":{color:"#000",opacity:"1 !important"}},"& .MuiTableSortLabel-icon":{position:"relative",marginLeft:0,marginRight:0,opacity:1,transition:"color 0.2s ease"},"& .MuiTableSortLabel-iconDirectionAsc":{transform:"rotate(0deg)"},"& .MuiTableSortLabel-iconDirectionDesc":{transform:"rotate(180deg)"}}})]})}):e.text},String(e.id)))];return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(i.TableRow,{children:c}),(0,r.jsx)(i.TableRow,{children:b})]})},[l,x,S,be,I,V,K]),Ye=(0,a.useCallback)((n,t)=>{let s=g?performance.now():0;if(!t){if(g){u.current.rowContentCalls+=1;let e=performance.now()-s;u.current.rowContentMs+=e,u.current.rowContentMaxMs=Math.max(u.current.rowContentMaxMs,e)}return null}let c=ve?ve(t,n):null;if(c!=null)return(0,r.jsx)(i.TableCell,{colSpan:l.length,"data-vdt-pad":"",sx:[{padding:f?"0 14px":"8px 16px"},...Array.isArray(Z)?Z:Z?[Z]:[]],children:c});let b=l.map(e=>{let C=g?performance.now():0,M=e.render?e.render(t,n):String(t[e.id]||"");if(g){let p=performance.now()-C;u.current.cellRenderCalls+=1,u.current.cellRenderMs+=p,u.current.cellRenderMaxMs=Math.max(u.current.cellRenderMaxMs,p)}let A=fe.has(String(e.id)),T=e.cellPadding!==void 0,_=e.rowSpan?e.rowSpan(t,n):1;if(_<=0)return null;let N=e.onCellClick;return(0,r.jsx)(i.TableCell,{align:e.align||"left",rowSpan:_>1?_:void 0,"data-vdt-pad":T?"":void 0,"data-vdt-pinned":A?"":void 0,"data-vdt-cell-click":N?"":void 0,onClick:N?p=>{let W=p.clientX-$.current.x,q=p.clientY-$.current.y;p.stopPropagation(),!(Math.sqrt(W*W+q*q)>Oe)&&N(t,n,p)}:void 0,style:{width:e.width,minWidth:e.width,...e.primary?{fontSize:15}:{},...e.style,...e.cellStyle?e.cellStyle(t,n):{},padding:T?e.cellPadding:"8px 16px",...K(e,!1)},children:M},String(e.id))});if(g){u.current.rowContentCalls+=1;let e=performance.now()-s;u.current.rowContentMs+=e,u.current.rowContentMaxMs=Math.max(u.current.rowContentMaxMs,e)}return(0,r.jsx)(r.Fragment,{children:b})},[l,g,ve,Z,f,fe,K]),P=we??l.some(n=>typeof n.footer=="function"),Xe=(0,a.useCallback)(()=>{if(!P)return null;let n=[];for(let t=0;t<l.length;t+=1){let s=l[t],c=s.footerColSpan&&s.footerColSpan>1?Math.min(s.footerColSpan,l.length-t):1;n.push((0,r.jsx)(i.TableCell,{align:s.align||"left",colSpan:c>1?c:void 0,style:{...c>1?{}:{width:s.width,minWidth:s.width},...s.style,fontWeight:"bold",padding:f?"0 14px":"16px"},children:s.footer?s.footer(o):null},String(s.id))),t+=c-1}return(0,r.jsx)(i.TableRow,{children:n})},[P,l,o,f]),Ke=(0,a.useMemo)(()=>({Scroller:$e,Table:n=>(0,r.jsx)(i.Table,{...n,sx:{borderCollapse:"separate",tableLayout:Fe,marginRight:U?"16px":0,...P?{height:"100%"}:{}}}),TableHead:(0,a.forwardRef)((n,t)=>(0,r.jsx)(i.TableHead,{...n,ref:t,sx:{userSelect:"none","& tr":{height:V,"& th":{padding:"16px",position:"sticky",top:0,zIndex:2,fontWeight:"bold"}}}})),TableRow:n=>{let{item:t,selected:s,"aria-selected":c,className:b,...e}=n,C=e["data-index"]??0,M=C%2===1,A=t&&ee.current?ee.current(t,C):C,T=!pe&&y!==null&&y!==void 0&&A===y,_=T&&k?typeof k=="function"?k(t,C):k:void 0,N=String(b??"").split(/\s+/).filter(p=>p!=="Mui-selected"&&p!=="Mui-focusVisible").join(" ");return(0,r.jsx)(i.TableRow,{...e,"data-row-id":A!=null?String(A):void 0,className:N||void 0,selected:T,onMouseDown:p=>{te.current=!1,$.current={x:p.clientX,y:p.clientY}},onContextMenu:p=>{t&&Ie.current&&Ie.current(t,C,p)},onClick:p=>{let W=p.clientX-$.current.x,q=p.clientY-$.current.y;if(Math.sqrt(W*W+q*q)>Oe||te.current){p.preventDefault(),p.stopPropagation(),te.current=!1;return}t&&Pe.current&&Pe.current(t,C),te.current=!1},sx:[{userSelect:"none",...Te?{"& > td":{height:Q}}:{height:Q,maxHeight:Q},boxSizing:"border-box",backgroundColor:M&&ke?ke:"transparent","& td:not([data-vdt-pad])":{padding:"8px 16px"},"& td":{boxSizing:"border-box",borderBottom:J?"1px solid rgba(224, 224, 224, 1)":"none"},"& th":{padding:"8px 16px",borderBottom:"none"},"&:hover":ge&&!T?{backgroundColor:p=>{let W=p.palette.mode==="dark",Ne=Se??"#000000",Be=Ve??.06;if(!Se)return W?`rgba(255, 255, 255, ${Be})`:`rgba(0, 0, 0, ${Be})`;let he=Ne.replace("#","").trim();if(he.length!==6)return Ne;let St=parseInt(he.substring(0,2),16),Rt=parseInt(he.substring(2,4),16),kt=parseInt(he.substring(4,6),16);return`rgba(${St}, ${Rt}, ${kt}, ${Be})`}}:void 0,cursor:ge?"pointer":void 0},_]})},TableBody:(0,a.forwardRef)((n,t)=>{let{children:s,...c}=n;return(0,r.jsxs)(i.TableBody,{...c,ref:t,sx:P?{height:"100%"}:void 0,children:[s,P&&(0,r.jsx)("tr",{"aria-hidden":!0,style:{height:"100%"},children:(0,r.jsx)("td",{colSpan:l.length,style:{padding:0,border:0}})})]})}),TableFoot:(0,a.forwardRef)((n,t)=>(0,r.jsx)(i.TableFooter,{...n,ref:t,sx:[{"& tr":{height:F??R,maxHeight:F??R,boxSizing:"border-box"},"& td":{height:F??R,boxSizing:"border-box",backgroundColor:s=>s.palette.mode==="dark"?"#1e1e1e":"#ffffff",padding:"0 16px",color:"inherit",fontSize:"0.875rem",border:"none",boxShadow:`inset 0 1px 0 0 ${f?h.borderStrong:"#000000"}`}},...Array.isArray(z)?z:z?[z]:[]]}))}),[ge,pe?null:y,k,R,ke,J,V,Se,Ve,$e,F,z,P,f,h,l,Fe,U,Te]),yt=Ke,ne=Ke,Ct=ne.Table,wt=ne.TableHead,vt=ne.TableBody,Mt=ne.TableRow,Tt=ne.TableFoot,qe=(0,r.jsxs)(i.Box,{sx:{position:"relative",height:v?"auto":"100%",width:"100%","& .MuiTableHead-root":{backgroundColor:n=>n.palette.mode==="dark"?"#1e1e1e !important":"#ffffff !important"},...ft??{},"& tbody td[data-vdt-pinned]":{backgroundColor:f?h.bg:Me.palette.background.paper},"& tbody td[data-vdt-cell-click]":{cursor:"pointer"},"& tbody td[data-vdt-cell-click]:hover":{backgroundColor:f?h.hoverBg:Me.palette.mode==="dark"?"rgba(255, 255, 255, 0.06)":"rgba(0, 0, 0, 0.04)"},...f&&ge?{"& tbody tr:hover td[data-vdt-pinned]":{backgroundColor:h.hoverBg}}:{},...f?{...U?{border:`1px solid ${h.borderStrong}`,borderRadius:"4px"}:{"& table":{backgroundColor:h.bg}},overflow:"hidden","& thead tr th":{height:V,boxSizing:"border-box",padding:"0 14px !important",fontSize:13,fontWeight:"500 !important",color:h.headerColor,backgroundColor:`${h.bg} !important`,borderTop:"none",borderBottom:`1px solid ${h.borderStrong}`,borderRight:`1px solid ${h.border}`,"&:last-of-type":{borderRight:"none"}},"& tbody tr td:not([data-vdt-pad])":{padding:"0 14px !important"},"& tbody tr td":{fontSize:14,borderBottom:`1px solid ${h.border}`}}:{}},children:[v?(0,r.jsx)(i.Box,{sx:{overflowX:"auto",width:"100%"},children:(0,r.jsxs)(Ct,{children:[(0,r.jsx)(wt,{children:je()}),(0,r.jsx)(vt,{children:o.map((n,t)=>(0,r.jsx)(Mt,{item:n,"data-index":t,children:Ye(t,n)},m?String(m(n,t)):t))}),P?(0,r.jsx)(Tt,{children:Xe()}):null]})}):(0,r.jsx)(et.TableVirtuoso,{ref:Ee,data:o,totalCount:D?o.length+1:o.length,defaultItemHeight:Q,fixedItemHeight:Te?void 0:Q,fixedHeaderContent:je,fixedFooterContent:P?Xe:void 0,itemContent:Ye,endReached:xt,style:{height:"100%"},increaseViewportBy:{top:st,bottom:lt},overscan:ut,followOutput:!1,components:yt},bt),o.length===0&&!d&&f&&typeof E=="string"&&(0,r.jsx)(i.Box,{sx:{position:v?"static":"absolute",top:V,left:0,right:0,py:6,textAlign:"center",fontSize:14,color:h.emptyColor},children:E}),o.length===0&&!d&&!(f&&typeof E=="string")&&(0,r.jsx)(i.Box,{sx:{position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:2},children:typeof E=="string"?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(i.Box,{sx:{width:48,height:48,display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"50%",backgroundColor:"#f5f5f5",color:"#999"},children:"\u{1F4C4}"}),(0,r.jsx)(i.Typography,{variant:"body1",sx:{color:"text.secondary"},children:E})]}):E}),mt&&(0,r.jsx)(r.Fragment,{children:ce?(0,r.jsx)(ce,{visible:d,onComplete:We}):(0,r.jsx)(Ue,{visible:d,onComplete:We,size:40,indicator:(0,r.jsx)(Ze,{}),sx:{top:`${l.some(n=>n.group)?V*2:V}px`,bottom:`${P?F??R:0}px`},background:{show:o.length===0,opacity:.8}})})]}),Ge=f&&U?{paddingRight:ue,paddingTop:Qe,paddingBottom:Qe}:{};return ie?(0,r.jsx)(i.Paper,{className:"grow",elevation:1,sx:{padding:0,paddingLeft:ue,...Ge,boxSizing:"border-box",height:v?"auto":"100%",minHeight:0,flex:v?"none":1,display:"flex",flexDirection:"column"},children:qe}):(0,r.jsx)(i.Box,{className:"grow",style:{padding:0,paddingLeft:ue,...Ge,boxSizing:"border-box",height:v?"auto":"100%",minHeight:0,flex:v?"none":1,display:"flex",flexDirection:"column"},children:qe})}var nt=(0,a.memo)(Vt);
25
5
  /**
26
6
  * Virtual Data Table - A high-performance virtual data table component for React
27
7
  *