@ehfuse/mui-virtual-data-table 1.1.30 → 1.1.32

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,7 +1,7 @@
1
- "use strict";var Ge=Object.defineProperty;var ot=Object.getOwnPropertyDescriptor;var it=Object.getOwnPropertyNames;var lt=Object.prototype.hasOwnProperty;var at=(i,p)=>{for(var m in p)Ge(i,m,{get:p[m],enumerable:!0})},st=(i,p,m,T)=>{if(p&&typeof p=="object"||typeof p=="function")for(let S of it(p))!lt.call(i,S)&&S!==m&&Ge(i,S,{get:()=>p[S],enumerable:!(T=ot(p,S))||T.enumerable});return i};var ct=i=>st(Ge({},"__esModule",{value:!0}),i);var wt={};at(wt,{VirtualDataTable:()=>tt});module.exports=ct(wt);var c=require("react"),d=require("@mui/material"),et=require("react-virtuoso");var ze=require("react/jsx-runtime"),Te=require("react"),Be=require("@mui/material"),Oe=function(){return Oe=Object.assign||function(p){for(var m,T=1,S=arguments.length;T<S;T++){m=arguments[T];for(var k in m)Object.prototype.hasOwnProperty.call(m,k)&&(p[k]=m[k])}return p},Oe.apply(this,arguments)};function Xe(i){var p=i.visible,m=i.onComplete,T=i.fadeoutDuration,S=T===void 0?200:T,k=i.exitDelay,v=k===void 0?0:k,L=i.size,O=L===void 0?40:L,G=i.className,J=i.style,_=i.sx,Q=i.indicator,F=i.background,X=F===void 0?{show:!0,color:"255, 255, 255",opacity:.9}:F,me=(0,Te.useRef)(void 0),u=(0,Te.useRef)(null),U=(0,Te.useState)(p),ge=U[0],be=U[1],q=X.show,Z=q===void 0?!0:q,H=X.color,P=H===void 0?"255, 255, 255":H,ae=X.opacity,se=ae===void 0?.9:ae;if((0,Te.useEffect)(function(){var ce=me.current;if(ce===!0&&p===!1&&u.current){var ue=u.current;ue.style.opacity="0",setTimeout(function(){be(!1),m?.()},S+v)}else p===!0&&(be(!0),u.current&&(u.current.style.opacity="1"));me.current=p},[p,m,S,v]),!ge)return null;var Le=function(){return typeof Q=="string"?(0,ze.jsx)("img",{src:Q,alt:"Loading",style:{width:O,height:O}}):Q||(0,ze.jsx)(Be.CircularProgress,{size:O})},ee=function(){return Z?P.startsWith("rgba")?{backgroundColor:P}:/^\d+,\s*\d+,\s*\d+$/.test(P)?{backgroundColor:"rgba(".concat(P,", ").concat(se,")")}:se!==1?{backgroundColor:P,"&::before":{content:'""',position:"absolute",top:0,left:0,right:0,bottom:0,backgroundColor:P,opacity:se,zIndex:-1}}:{backgroundColor:P}:{backgroundColor:"transparent"}};return(0,ze.jsx)(Be.Box,{ref:u,className:G,style:Oe({},J),sx:Oe(Oe({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(S,"ms ease-out")},ee()),_),children:Le()})}var ke=require("react/jsx-runtime"),ut=`
1
+ "use strict";var Ge=Object.defineProperty;var ut=Object.getOwnPropertyDescriptor;var dt=Object.getOwnPropertyNames;var pt=Object.prototype.hasOwnProperty;var ft=(l,d)=>{for(var f in d)Ge(l,f,{get:d[f],enumerable:!0})},ht=(l,d,f,C)=>{if(d&&typeof d=="object"||typeof d=="function")for(let w of dt(d))!pt.call(l,w)&&w!==f&&Ge(l,w,{get:()=>d[w],enumerable:!(C=ut(d,w))||C.enumerable});return l};var mt=l=>ht(Ge({},"__esModule",{value:!0}),l);var Dt={};ft(Dt,{VirtualDataTable:()=>lt});module.exports=mt(Dt);var c=require("react"),u=require("@mui/material"),it=require("react-virtuoso");var Ae=require("react/jsx-runtime"),ye=require("react"),ze=require("@mui/material"),$e=function(){return $e=Object.assign||function(d){for(var f,C=1,w=arguments.length;C<w;C++){f=arguments[C];for(var T in f)Object.prototype.hasOwnProperty.call(f,T)&&(d[T]=f[T])}return d},$e.apply(this,arguments)};function et(l){var d=l.visible,f=l.onComplete,C=l.fadeoutDuration,w=C===void 0?200:C,T=l.exitDelay,g=T===void 0?0:T,S=l.size,F=S===void 0?40:S,W=l.className,X=l.style,z=l.sx,K=l.indicator,H=l.background,q=H===void 0?{show:!0,color:"255, 255, 255",opacity:.9}:H,ce=(0,ye.useRef)(void 0),p=(0,ye.useRef)(null),V=(0,ye.useState)(d),ue=V[0],we=V[1],P=q.show,j=P===void 0?!0:P,L=q.color,O=L===void 0?"255, 255, 255":L,oe=q.opacity,ie=oe===void 0?.9:oe;if((0,ye.useEffect)(function(){var le=ce.current;if(le===!0&&d===!1&&p.current){var ae=p.current;ae.style.opacity="0",setTimeout(function(){we(!1),f?.()},w+g)}else d===!0&&(we(!0),p.current&&(p.current.style.opacity="1"));ce.current=d},[d,f,w,g]),!ue)return null;var Me=function(){return typeof K=="string"?(0,Ae.jsx)("img",{src:K,alt:"Loading",style:{width:F,height:F}}):K||(0,Ae.jsx)(ze.CircularProgress,{size:F})},G=function(){return j?O.startsWith("rgba")?{backgroundColor:O}:/^\d+,\s*\d+,\s*\d+$/.test(O)?{backgroundColor:"rgba(".concat(O,", ").concat(ie,")")}:ie!==1?{backgroundColor:O,"&::before":{content:'""',position:"absolute",top:0,left:0,right:0,bottom:0,backgroundColor:O,opacity:ie,zIndex:-1}}:{backgroundColor:O}:{backgroundColor:"transparent"}};return(0,Ae.jsx)(ze.Box,{ref:p,className:W,style:$e({},X),sx:$e($e({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(w,"ms ease-out")},G()),z),children:Me()})}var ve=require("react/jsx-runtime"),gt=`
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 Ue({size:i=54}){return(0,ke.jsxs)(ke.Fragment,{children:[(0,ke.jsx)("style",{children:ut}),(0,ke.jsx)("span",{className:"vdt-css-spinner",role:"progressbar","aria-label":"loading",style:{display:"inline-block",width:i,height:i}})]})}var n=require("react"),le=require("react/jsx-runtime"),dt=["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"],Ze=(i,p)=>{let m=i.tagName.toLowerCase(),T=["text","password","email","number","search","tel","url","checkbox","radio"];if(m==="input"){let S=i.type;return T.includes(S)}if(["textarea","select","button"].includes(m)||["svg","path","circle","rect","line","polygon","polyline"].includes(m)||i.getAttribute("contenteditable")==="true")return!0;if(p?.excludeSelectors){for(let S of p.excludeSelectors)if(i.matches(S))return!0}return pt(i,p)},pt=(i,p)=>{let m=[...dt,...p?.excludeClasses||[]],T=i,S=0,k=5;for(;T&&S<=k;){if(m.some(v=>T.classList.contains(v)))return!0;if(T.classList.contains("MuiDialogContent-root"))break;T=T.parentElement,S++}return!1},ft={},ht={},mt={},gt={},bt={},xt=(0,n.forwardRef)(({className:i="",style:p={},containerStyle:m={},contentStyle:T={},children:S,onScroll:k,thumb:v=ft,track:L=ht,arrows:O=mt,dragScroll:G=gt,autoHide:J=bt,showScrollbar:_=!0,detectInnerScroll:Q=!1},F)=>{let X=(0,n.useRef)({});(0,n.useEffect)(()=>{X.current={children:S,onScroll:k,showScrollbar:_,thumb:v,track:L,arrows:O,dragScroll:G,autoHide:J}});let me=(0,n.useRef)(null),u=(0,n.useRef)(null),U=(0,n.useRef)(null),ge=(0,n.useRef)(null),be=(0,n.useRef)(null),q=(0,n.useRef)(null),[Z,H]=(0,n.useState)(!1),[P,ae]=(0,n.useState)(!1),[se,Le]=(0,n.useState)(!1),[ee,ce]=(0,n.useState)({y:0,scrollTop:0}),[ue,qe]=(0,n.useState)(0),[Ve,Fe]=(0,n.useState)(0),[Ee,Pe]=(0,n.useState)(!1),[ve,we]=(0,n.useState)(!1),[de,We]=(0,n.useState)({x:0,y:0,scrollTop:0,scrollLeft:0}),[rt,I]=(0,n.useState)(null),[x,xe]=(0,n.useState)(null),[je,He]=(0,n.useState)(!1),Me=(0,n.useRef)(null),[Ie,Ae]=(0,n.useState)(!1),Ce=(0,n.useRef)(null),ye=(0,n.useRef)(null),pe=(0,n.useRef)(null),j=(0,n.useMemo)(()=>{let t=v.color??"#606060";return{width:v.width??8,minHeight:v.minHeight??50,radius:v.radius??(v.width??8)/2,color:t,opacity:v.opacity??.6,hoverColor:v.hoverColor??t,hoverOpacity:v.hoverOpacity??1}},[v]),w=(0,n.useMemo)(()=>({width:L.width??16,color:L.color??"rgba(128, 128, 128, 0.1)",visible:L.visible??!0,alignment:L.alignment??"center",radius:L.radius??j.radius??4,margin:L.margin??4}),[L,j.radius]),Y=(0,n.useMemo)(()=>{let t=O.color??"#808080";return{visible:O.visible??!1,step:O.step??50,color:t,opacity:O.opacity??.6,hoverColor:O.hoverColor??t,hoverOpacity:O.hoverOpacity??1}},[O]),Se=(0,n.useMemo)(()=>({enabled:G.enabled??!0,excludeClasses:G.excludeClasses??[],excludeSelectors:G.excludeSelectors??[]}),[G]),M=(0,n.useMemo)(()=>({enabled:J.enabled??!0,delay:J.delay??1500,delayOnWheel:J.delayOnWheel??700}),[J]),D=j.width,$e=w.width,fe=j.minHeight,V=Y.visible,he=Y.step,re=(0,n.useCallback)(()=>{if(!u.current)return;let t=document.activeElement;t&&u.current.contains(t)&&t!==u.current||u.current.focus()},[]);(0,n.useImperativeHandle)(F,()=>({getScrollContainer:()=>u.current,scrollTo:t=>{u.current&&u.current.scrollTo(t)},get scrollTop(){return u.current?.scrollTop||0},get scrollHeight(){return u.current?.scrollHeight||0},get clientHeight(){return u.current?.clientHeight||0}}),[]);let R=(0,n.useCallback)(()=>{if(q.current){let o=q.current;if(document.contains(o)&&o.scrollHeight>o.clientHeight+2)return o;q.current=null}if(!u.current)return null;if(U.current&&U.current.scrollHeight>u.current.clientHeight+2)return q.current=u.current,u.current;if(!Q)return null;let t=u.current.querySelectorAll('[data-virtuoso-scroller], [style*="overflow"], .virtuoso-scroller, [style*="overflow: auto"], [style*="overflow:auto"]');for(let o of t){let a=o;if(a!==u.current&&a.classList.contains("overlay-scrollbar-container"))continue;let h=a.parentElement,f=!1;for(;h&&h!==u.current;){if(h.classList.contains("overlay-scrollbar-container")&&h!==u.current){f=!0;break}h=h.parentElement}if(!f&&a.scrollHeight>a.clientHeight+2)return q.current=a,a}return null},[]),ne=(0,n.useCallback)(()=>R()!==null,[R]),A=(0,n.useCallback)(()=>{Ce.current&&(clearTimeout(Ce.current),Ce.current=null)},[]),_e=(0,n.useCallback)(()=>{ye.current&&(clearTimeout(ye.current),ye.current=null)},[]),oe=(0,n.useCallback)(()=>{pe.current&&(clearTimeout(pe.current),pe.current=null)},[]),z=(0,n.useCallback)(t=>{M.enabled&&(A(),Ce.current=setTimeout(()=>{H(!1),Ce.current=null},t))},[A,M.enabled]),E=(0,n.useCallback)(()=>{let t=R();if(!t){H(!1),Pe(!1),A();return}if(Pe(!0),!ge.current)return;M.enabled||(H(!0),A());let o=t.clientHeight,a=t.scrollHeight,h=t.scrollTop,f=0;if(me.current){let Re=window.getComputedStyle(me.current),Ke=parseFloat(Re.paddingTop)||0,nt=parseFloat(Re.paddingBottom)||0;f=Ke+nt}let C=V?D*2+w.margin*4:w.margin*2,$=o-C+f,N=o/a,te=Math.max($*N,fe),ie=a-o,K=$-te,Ne=ie>0?h/ie*K:0;qe(te),Fe(Ne)},[R,A,V,D,fe,M.enabled]),Ye=(0,n.useCallback)(t=>{t.preventDefault(),t.stopPropagation();let o=R();o&&(ae(!0),ce({y:t.clientY,scrollTop:o.scrollTop}),A(),H(!0),re())},[R,A,re]),De=(0,n.useCallback)(t=>{if(!P)return;let o=R();if(!o)return;let a=o.clientHeight,h=o.scrollHeight-a,f=t.clientY-ee.y,C=a-ue,$=f/C*h,N=Math.max(0,Math.min(h,ee.scrollTop+$));o.scrollTop=N,E()},[P,ee,ue,E,R]),l=(0,n.useCallback)(()=>{ae(!1),ne()&&z(M.delay)},[ne,z,M.delay]),r=(0,n.useCallback)(t=>{if(!ge.current)return;let o=ge.current.getBoundingClientRect(),a=t.clientY-o.top,h=R();if(!h)return;let f=h.clientHeight,C=h.scrollHeight,$=a/f*(C-f);h.scrollTop=Math.max(0,Math.min(C-f,$)),E(),H(!0),z(M.delay),re()},[E,z,M.delay,R,re]),g=(0,n.useCallback)(t=>{if(t.preventDefault(),t.stopPropagation(),!u.current)return;let o=Math.max(0,u.current.scrollTop-he);u.current.scrollTop=o,E(),H(!0),z(M.delay),re()},[E,z,he,M.delay,re]),y=(0,n.useCallback)(t=>{if(t.preventDefault(),t.stopPropagation(),!u.current||!U.current)return;let o=u.current,a=U.current.scrollHeight-o.clientHeight,h=Math.min(a,o.scrollTop+he);o.scrollTop=h,E(),H(!0),z(M.delay),re()},[E,z,he,M.delay,re]),b=(0,n.useCallback)(t=>{if(!Se.enabled)return;let o=t.target;if(Ze(o,Se)||t.button!==0)return;let a=R();a&&(a.scrollHeight<=a.clientHeight||(t.preventDefault(),we(!0),We({x:t.clientX,y:t.clientY,scrollTop:a.scrollTop,scrollLeft:a.scrollLeft||0}),A()))},[Se,Ze,R,A]),e=(0,n.useCallback)(t=>{if(!ve)return;let o=R();if(!o)return;let a=de.x-t.clientX,h=de.y-t.clientY;if(Math.abs(h)<3&&Math.abs(a)<3)return;H(!0);let f=Math.max(0,Math.min(o.scrollHeight-o.clientHeight,de.scrollTop+h));o.scrollTop=f,E()},[ve,de,R,E]),B=(0,n.useCallback)(()=>{we(!1),ne()&&z(M.delay)},[ne,z,M.delay]);(0,n.useEffect)(()=>{let t=C=>{E(),A(),H(!0);let $=Ie?M.delayOnWheel:M.delay;z($),k&&k(C)},o=()=>{Ae(!0),Me.current&&clearTimeout(Me.current),Me.current=setTimeout(()=>{Ae(!1)},300),A(),oe(),pe.current=setTimeout(()=>{H(!0),pe.current=null},50)},a=[],h=R();h&&a.push(h);let f=u.current;return f&&!h&&(a.push(f),f.querySelectorAll('[data-virtuoso-scroller], [style*="overflow"], .virtuoso-scroller, [style*="overflow: auto"], [style*="overflow:auto"]').forEach(C=>{let $=C;if($!==f&&$.classList.contains("overlay-scrollbar-container"))return;let N=$.parentElement;for(;N&&N!==f;){if(N.classList.contains("overlay-scrollbar-container")&&N!==f)return;N=N.parentElement}a.push($)})),a.forEach(C=>{C.addEventListener("scroll",t,{passive:!0}),C.addEventListener("wheel",o,{passive:!0})}),()=>{a.forEach(C=>{C.removeEventListener("scroll",t),C.removeEventListener("wheel",o)}),Me.current&&clearTimeout(Me.current),pe.current&&clearTimeout(pe.current)}},[R,E,k,A,z,M,Ie]),(0,n.useEffect)(()=>{let t=a=>{let h=R();if(!h)return;let{key:f}=a,{scrollTop:C,scrollHeight:$,clientHeight:N}=h,te=$-N,ie=50,K=null;switch(f){case"ArrowUp":a.preventDefault(),K=Math.max(0,C-ie);break;case"ArrowDown":a.preventDefault(),K=Math.min(te,C+ie);break;case"PageUp":a.preventDefault(),K=Math.max(0,C-N);break;case"PageDown":a.preventDefault(),K=Math.min(te,C+N);break;case"Home":a.preventDefault(),K=0;break;case"End":a.preventDefault(),K=te;break;default:return}if(K!==null){let Ne=K/te,Re=V?D*2+w.margin*4:w.margin*2,Ke=(N-Re-ue)*Ne;Fe(Ke),h.scrollTop=K,A(),H(!0),z(M.delay)}},o=u.current;if(o)return o.addEventListener("keydown",t),()=>{o.removeEventListener("keydown",t)}},[R,V,D,w.margin,ue,A,z,M.delay]),(0,n.useEffect)(()=>{if(ve)return document.addEventListener("mousemove",e),document.addEventListener("mouseup",B),()=>{document.removeEventListener("mousemove",e),document.removeEventListener("mouseup",B)}},[ve,e,B]),(0,n.useEffect)(()=>{if(P)return document.addEventListener("mousemove",De),document.addEventListener("mouseup",l),()=>{document.removeEventListener("mousemove",De),document.removeEventListener("mouseup",l)}},[P,De,l]),(0,n.useEffect)(()=>{E();let t=setTimeout(()=>{E()},100);return()=>clearTimeout(t)},[E]),(0,n.useLayoutEffect)(()=>{He(!0),E(),!M.enabled&&ne()&&H(!0)},[ne,E,M.enabled]),(0,n.useEffect)(()=>{let t=new ResizeObserver(()=>{E()}),o=[];return u.current&&o.push(u.current),U.current&&o.push(U.current),q.current&&document.contains(q.current)&&o.push(q.current),o.forEach(a=>{t.observe(a)}),()=>t.disconnect()},[E]),(0,n.useEffect)(()=>{if(!u.current)return;let t=new MutationObserver(()=>{q.current=null,E()});return t.observe(u.current,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["style"]}),()=>t.disconnect()},[E]);let W=Math.max($e,D);return(0,n.useEffect)(()=>{let t="overlay-scrollbar-webkit-hide",o=document.getElementById(t);o&&o.remove();let a=document.createElement("style");return a.id=t,a.textContent=`
4
+ `;function tt({size:l=54}){return(0,ve.jsxs)(ve.Fragment,{children:[(0,ve.jsx)("style",{children:gt}),(0,ve.jsx)("span",{className:"vdt-css-spinner",role:"progressbar","aria-label":"loading",style:{display:"inline-block",width:l,height:l}})]})}var o=require("react"),ne=require("react/jsx-runtime"),bt=["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"],rt=(l,d)=>{let f=l.tagName.toLowerCase(),C=["text","password","email","number","search","tel","url","checkbox","radio"];if(f==="input"){let w=l.type;return C.includes(w)}if(["textarea","select","button"].includes(f)||["svg","path","circle","rect","line","polygon","polyline"].includes(f)||l.getAttribute("contenteditable")==="true")return!0;if(d?.excludeSelectors){for(let w of d.excludeSelectors)if(l.matches(w))return!0}return xt(l,d)},xt=(l,d)=>{let f=[...bt,...d?.excludeClasses||[]],C=l,w=0,T=5;for(;C&&w<=T;){if(f.some(g=>C.classList.contains(g)))return!0;if(C.classList.contains("MuiDialogContent-root"))break;C=C.parentElement,w++}return!1},yt={},vt={},wt={},Mt={},Ct={},Tt=(0,o.forwardRef)(({className:l="",style:d={},containerStyle:f={},contentStyle:C={},children:w,onScroll:T,thumb:g=yt,track:S=vt,arrows:F=wt,dragScroll:W=Mt,autoHide:X=Ct,showScrollbar:z=!0,detectInnerScroll:K=!1},H)=>{let q=(0,o.useRef)({});(0,o.useEffect)(()=>{q.current={children:w,onScroll:T,showScrollbar:z,thumb:g,track:S,arrows:F,dragScroll:W,autoHide:X}});let ce=(0,o.useRef)(null),p=(0,o.useRef)(null),V=(0,o.useRef)(null),ue=(0,o.useRef)(null),we=(0,o.useRef)(null),P=(0,o.useRef)(null),[j,L]=(0,o.useState)(!1),[O,oe]=(0,o.useState)(!1),[ie,Me]=(0,o.useState)(!1),[G,le]=(0,o.useState)({y:0,scrollTop:0}),[ae,me]=(0,o.useState)(0),[Ue,Z]=(0,o.useState)(0),[J,Ce]=(0,o.useState)(!1),[se,De]=(0,o.useState)(!1),[Te,We]=(0,o.useState)({x:0,y:0,scrollTop:0,scrollLeft:0}),[Ze,Je]=(0,o.useState)(null),[Se,ke]=(0,o.useState)(null),[Qe,Le]=(0,o.useState)(!1),Q=(0,o.useRef)(null),[Ne,qe]=(0,o.useState)(!1),b=(0,o.useRef)(null),h=(0,o.useRef)(null),U=(0,o.useRef)(null),$=(0,o.useMemo)(()=>{let e=g.color??"#606060";return{width:g.width??8,minHeight:g.minHeight??50,radius:g.radius??(g.width??8)/2,color:e,opacity:g.opacity??.6,hoverColor:g.hoverColor??e,hoverOpacity:g.hoverOpacity??1}},[g]),y=(0,o.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??$.radius??4,margin:S.margin??4}),[S,$.radius]),_=(0,o.useMemo)(()=>{let e=F.color??"#808080";return{visible:F.visible??!1,step:F.step??50,color:e,opacity:F.opacity??.6,hoverColor:F.hoverColor??e,hoverOpacity:F.hoverOpacity??1}},[F]),Re=(0,o.useMemo)(()=>({enabled:W.enabled??!0,excludeClasses:W.excludeClasses??[],excludeSelectors:W.excludeSelectors??[]}),[W]),M=(0,o.useMemo)(()=>({enabled:X.enabled??!0,delay:X.delay??1500,delayOnWheel:X.delayOnWheel??700}),[X]),I=$.width,Fe=y.width,Ee=$.minHeight,ee=_.visible,de=_.step,Y=(0,o.useCallback)(()=>{if(!p.current)return;let e=document.activeElement;e&&p.current.contains(e)&&e!==p.current||p.current.focus()},[]);(0,o.useImperativeHandle)(H,()=>({getScrollContainer:()=>p.current,scrollTo:e=>{p.current&&p.current.scrollTo(e)},get scrollTop(){return p.current?.scrollTop||0},get scrollHeight(){return p.current?.scrollHeight||0},get clientHeight(){return p.current?.clientHeight||0}}),[]);let k=(0,o.useCallback)(()=>{if(P.current){let t=P.current;if(document.contains(t)&&t.scrollHeight>t.clientHeight+2)return t;P.current=null}if(!p.current)return null;if(V.current&&V.current.scrollHeight>p.current.clientHeight+2)return P.current=p.current,p.current;if(!K)return null;let e=p.current.querySelectorAll('[data-virtuoso-scroller], [style*="overflow"], .virtuoso-scroller, [style*="overflow: auto"], [style*="overflow:auto"]');for(let t of e){let n=t;if(n!==p.current&&n.classList.contains("overlay-scrollbar-container"))continue;let i=n.parentElement,a=!1;for(;i&&i!==p.current;){if(i.classList.contains("overlay-scrollbar-container")&&i!==p.current){a=!0;break}i=i.parentElement}if(!a&&n.scrollHeight>n.clientHeight+2)return P.current=n,n}return null},[]),te=(0,o.useCallback)(()=>k()!==null,[k]),R=(0,o.useCallback)(()=>{b.current&&(clearTimeout(b.current),b.current=null)},[]),He=(0,o.useCallback)(()=>{h.current&&(clearTimeout(h.current),h.current=null)},[]),ge=(0,o.useCallback)(()=>{U.current&&(clearTimeout(U.current),U.current=null)},[]),D=(0,o.useCallback)(e=>{M.enabled&&(R(),b.current=setTimeout(()=>{L(!1),b.current=null},e))},[R,M.enabled]),x=(0,o.useCallback)(()=>{let e=k();if(!e){L(!1),Ce(!1),R();return}if(Ce(!0),!ue.current)return;M.enabled||(L(!0),R());let t=e.clientHeight,n=e.scrollHeight,i=e.scrollTop,a=0;if(ce.current){let E=window.getComputedStyle(ce.current),he=parseFloat(E.paddingTop)||0,Oe=parseFloat(E.paddingBottom)||0;a=he+Oe}let r=ee?I*2+y.margin*4:y.margin*2,m=t-r+a,v=t/n,B=Math.max(m*v,Ee),A=n-t,N=m-B,fe=A>0?i/A*N:0;me(B),Z(fe)},[k,R,ee,I,Ee,M.enabled]),Ve=(0,o.useCallback)(e=>{e.preventDefault(),e.stopPropagation();let t=k();t&&(oe(!0),le({y:e.clientY,scrollTop:t.scrollTop}),R(),L(!0),Y())},[k,R,Y]),be=(0,o.useCallback)(e=>{if(!O)return;let t=k();if(!t)return;let n=t.clientHeight,i=t.scrollHeight-n,a=e.clientY-G.y,r=n-ae,m=a/r*i,v=Math.max(0,Math.min(i,G.scrollTop+m));t.scrollTop=v,x()},[O,G,ae,x,k]),xe=(0,o.useCallback)(()=>{oe(!1),te()&&D(M.delay)},[te,D,M.delay]),je=(0,o.useCallback)(e=>{if(!ue.current)return;let t=ue.current.getBoundingClientRect(),n=e.clientY-t.top,i=k();if(!i)return;let a=i.clientHeight,r=i.scrollHeight,m=n/a*(r-a);i.scrollTop=Math.max(0,Math.min(r-a,m)),x(),L(!0),D(M.delay),Y()},[x,D,M.delay,k,Y]),_e=(0,o.useCallback)(e=>{if(e.preventDefault(),e.stopPropagation(),!p.current)return;let t=Math.max(0,p.current.scrollTop-de);p.current.scrollTop=t,x(),L(!0),D(M.delay),Y()},[x,D,de,M.delay,Y]),re=(0,o.useCallback)(e=>{if(e.preventDefault(),e.stopPropagation(),!p.current||!V.current)return;let t=p.current,n=V.current.scrollHeight-t.clientHeight,i=Math.min(n,t.scrollTop+de);t.scrollTop=i,x(),L(!0),D(M.delay),Y()},[x,D,de,M.delay,Y]),Ye=(0,o.useCallback)(e=>{if(!Re.enabled)return;let t=e.target;if(rt(t,Re)||e.button!==0)return;let n=k();n&&(n.scrollHeight<=n.clientHeight||(e.preventDefault(),De(!0),We({x:e.clientX,y:e.clientY,scrollTop:n.scrollTop,scrollLeft:n.scrollLeft||0}),R()))},[Re,rt,k,R]),Pe=(0,o.useCallback)(e=>{if(!se)return;let t=k();if(!t)return;let n=Te.x-e.clientX,i=Te.y-e.clientY;if(Math.abs(i)<3&&Math.abs(n)<3)return;L(!0);let a=Math.max(0,Math.min(t.scrollHeight-t.clientHeight,Te.scrollTop+i));t.scrollTop=a,x()},[se,Te,k,x]),Ie=(0,o.useCallback)(()=>{De(!1),te()&&D(M.delay)},[te,D,M.delay]);(0,o.useEffect)(()=>{let e=r=>{x(),R(),L(!0);let m=Ne?M.delayOnWheel:M.delay;D(m),T&&T(r)},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)},n=[],i=k();i&&n.push(i);let a=p.current;return a&&!i&&(n.push(a),a.querySelectorAll('[data-virtuoso-scroller], [style*="overflow"], .virtuoso-scroller, [style*="overflow: auto"], [style*="overflow:auto"]').forEach(r=>{let m=r;if(m!==a&&m.classList.contains("overlay-scrollbar-container"))return;let v=m.parentElement;for(;v&&v!==a;){if(v.classList.contains("overlay-scrollbar-container")&&v!==a)return;v=v.parentElement}n.push(m)})),n.forEach(r=>{r.addEventListener("scroll",e,{passive:!0}),r.addEventListener("wheel",t,{passive:!0})}),()=>{n.forEach(r=>{r.removeEventListener("scroll",e),r.removeEventListener("wheel",t)}),Q.current&&clearTimeout(Q.current),U.current&&clearTimeout(U.current)}},[k,x,T,R,D,M,Ne]),(0,o.useEffect)(()=>{let e=n=>{let i=k();if(!i)return;let{key:a}=n,{scrollTop:r,scrollHeight:m,clientHeight:v}=i,B=m-v,A=50,N=null;switch(a){case"ArrowUp":n.preventDefault(),N=Math.max(0,r-A);break;case"ArrowDown":n.preventDefault(),N=Math.min(B,r+A);break;case"PageUp":n.preventDefault(),N=Math.max(0,r-v);break;case"PageDown":n.preventDefault(),N=Math.min(B,r+v);break;case"Home":n.preventDefault(),N=0;break;case"End":n.preventDefault(),N=B;break;default:return}if(N!==null){let fe=N/B,E=ee?I*2+y.margin*4:y.margin*2,he=(v-E-ae)*fe;Z(he),i.scrollTop=N,R(),L(!0),D(M.delay)}},t=p.current;if(t)return t.addEventListener("keydown",e),()=>{t.removeEventListener("keydown",e)}},[k,ee,I,y.margin,ae,R,D,M.delay]),(0,o.useEffect)(()=>{if(se)return document.addEventListener("mousemove",Pe),document.addEventListener("mouseup",Ie),()=>{document.removeEventListener("mousemove",Pe),document.removeEventListener("mouseup",Ie)}},[se,Pe,Ie]),(0,o.useEffect)(()=>{if(O)return document.addEventListener("mousemove",be),document.addEventListener("mouseup",xe),()=>{document.removeEventListener("mousemove",be),document.removeEventListener("mouseup",xe)}},[O,be,xe]),(0,o.useEffect)(()=>{x();let e=setTimeout(()=>{x()},100);return()=>clearTimeout(e)},[x]),(0,o.useLayoutEffect)(()=>{Le(!0),x(),!M.enabled&&te()&&L(!0)},[te,x,M.enabled]),(0,o.useEffect)(()=>{let e=new ResizeObserver(()=>{x()}),t=[];return p.current&&t.push(p.current),V.current&&t.push(V.current),P.current&&document.contains(P.current)&&t.push(P.current),t.forEach(n=>{e.observe(n)}),()=>e.disconnect()},[x]),(0,o.useEffect)(()=>{if(!p.current)return;let e=new MutationObserver(()=>{P.current=null,x()});return e.observe(p.current,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["style"]}),()=>e.disconnect()},[x]);let pe=Math.max(Fe,I);return(0,o.useEffect)(()=>{let e="overlay-scrollbar-webkit-hide",t=document.getElementById(e);t&&t.remove();let n=document.createElement("style");return n.id=e,n.textContent=`
5
5
  .overlay-scrollbar-container::-webkit-scrollbar {
6
6
  display: none !important;
7
7
  width: 0 !important;
@@ -21,7 +21,7 @@
21
21
  outline: 2px solid rgba(0, 123, 255, 0.5);
22
22
  outline-offset: -2px;
23
23
  }
24
- `,document.head.appendChild(a),()=>{let h=document.getElementById(t);h&&h.remove()}},[]),(0,le.jsxs)("div",{ref:me,className:`overlay-scrollbar-wrapper ${i}`,style:{display:"flex",flexDirection:"column",position:"relative",minHeight:0,height:"100%",flex:"1 1 0%",...p},children:[(0,le.jsx)("div",{ref:u,className:"overlay-scrollbar-container",tabIndex:-1,onMouseDown:b,style:{display:"flex",width:"100%",flex:"1 1 auto",minHeight:0,overflow:"auto",scrollbarWidth:"none",msOverflowStyle:"none",outline:"none",userSelect:ve?"none":"auto",...m},children:(0,le.jsx)("div",{ref:U,className:"overlay-scrollbar-content",style:{flex:"1 1 0%",minHeight:0,display:"flex",flexDirection:"column",...T},children:S})}),_&&Ee&&(0,le.jsxs)("div",{ref:ge,className:"overlay-scrollbar-track",onMouseEnter:()=>{A(),ye.current=setTimeout(()=>{H(!0),ye.current=null},100)},onMouseLeave:()=>{_e(),P||z(M.delay)},style:{position:"absolute",top:0,right:0,width:`${W}px`,height:"100%",opacity:Z?1:0,transition:"opacity 0.2s ease-in-out",cursor:"pointer",zIndex:1e3,pointerEvents:"auto"},children:[w.visible&&(0,le.jsx)("div",{className:"overlay-scrollbar-track-background",onClick:t=>{t.preventDefault(),t.stopPropagation(),r(t)},style:{position:"absolute",top:V?`${j.width+w.margin*2}px`:`${w.margin}px`,right:w.alignment==="right"?"0px":`${(W-j.width)/2}px`,width:`${j.width}px`,height:V?`calc(100% - ${j.width*2+w.margin*4}px)`:`calc(100% - ${w.margin*2}px)`,backgroundColor:w.color,borderRadius:`${w.radius}px`,cursor:"pointer"}}),(0,le.jsx)("div",{ref:be,className:"overlay-scrollbar-thumb",onMouseDown:Ye,onMouseEnter:()=>Le(!0),onMouseLeave:()=>Le(!1),style:{position:"absolute",top:`${(V?D+w.margin*2:w.margin)+Ve}px`,right:w.alignment==="right"?"0px":`${(W-D)/2}px`,width:`${D}px`,height:`${Math.max(ue,fe)}px`,backgroundColor:se||P?j.hoverColor:j.color,opacity:se||P?j.hoverOpacity:j.opacity,borderRadius:`${j.radius}px`,cursor:"pointer",transition:"background-color 0.2s ease-in-out, opacity 0.2s ease-in-out"}})]}),_&&Ee&&V&&(0,le.jsx)("div",{className:"overlay-scrollbar-up-arrow",onClick:g,onMouseEnter:()=>xe("up"),onMouseLeave:()=>xe(null),style:{position:"absolute",top:`${w.margin}px`,right:w.alignment==="right"?"0px":`${(W-D)/2}px`,width:`${D}px`,height:`${D}px`,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",fontSize:`${Math.max(D*.75,8)}px`,color:x==="up"?Y.hoverColor:Y.color,userSelect:"none",zIndex:1001,opacity:Z?x==="up"?Y.hoverOpacity:Y.opacity:0,transition:"opacity 0.2s ease-in-out, color 0.15s ease-in-out"},children:"\u25B2"}),_&&Ee&&V&&(0,le.jsx)("div",{className:"overlay-scrollbar-down-arrow",onClick:y,onMouseEnter:()=>xe("down"),onMouseLeave:()=>xe(null),style:{position:"absolute",bottom:`${w.margin}px`,right:w.alignment==="right"?"0px":`${(W-D)/2}px`,width:`${D}px`,height:`${D}px`,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",fontSize:`${Math.max(D*.75,8)}px`,color:x==="down"?Y.hoverColor:Y.color,userSelect:"none",zIndex:1001,opacity:Z?x==="down"?Y.hoverOpacity:Y.opacity:0,transition:"opacity 0.2s ease-in-out, color 0.15s ease-in-out"},children:"\u25BC"})]})}),Je=xt;var s=require("react/jsx-runtime"),yt={alignment:"right",margin:0,radius:0},Qe=5;function vt({data:i,loading:p=!1,columns:m,onRowClick:T,getRowId:S,selectedRowId:k,selectedRowSx:v,rowHeight:L=50,columnHeight:O=56,striped:G,rowDivider:J=!0,onSort:_,onLoadMore:Q,sortBy:F,sortDirection:X,showPaper:me=!0,paddingX:u="1rem",paddingTop:U=0,paddingBottom:ge=0,rowHoverColor:be,rowHoverOpacity:q,viewportBuffer:Z,overscan:H,scrollbars:P,emptyMessage:ae="NO DATA",LoadingComponent:se,showFooter:Le,footerHeight:ee,footerSx:ce}){let ue=Math.max(L*12,480),qe=Math.max(L*12,480),Ve=typeof Z=="number"?Z:Z?.top??ue,Fe=typeof Z=="number"?Z:Z?.bottom??qe,Ee=Math.max(L*8,420),Pe=Math.max(L*10,520),ve=typeof H=="number"?H:{main:H?.main??Ee,reverse:H?.reverse??Pe},we=L+(J?1:0),de=!v||typeof v!="function",We=(0,c.useMemo)(()=>!de||k===null||k===void 0||!v?null:{[`& tbody tr[data-row-id="${String(k).replace(/["\\]/g,"\\$&")}"]`]:v},[de,k,v]),rt=typeof window<"u"&&(window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1"),[I]=(0,c.useState)(()=>typeof window>"u"?!1:window.localStorage.getItem("vdt-perf-debug")==="1"),x=(0,c.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}),xe=(0,c.useCallback)(l=>{if(!I)return;let r=x.current;if(!(r.wheelEvents>0||r.rangeChangedCalls>0||r.rowContentCalls>0||r.cellRenderCalls>0))return;let y=r.rowContentCalls>0?r.rowContentMs/r.rowContentCalls:0,b=r.cellRenderCalls>0?r.cellRenderMs/r.cellRenderCalls:0;console.log("[VDT perf]",{reason:l,wheel:{events:r.wheelEvents,inputPx:Math.round(r.wheelInputPx),handlerMs:Number(r.wheelHandlerMs.toFixed(2)),rafFlushes:r.wheelRafFlushes,rafMs:Number(r.wheelRafMs.toFixed(2))},rangeChanged:{calls:r.rangeChangedCalls,totalMs:Number(r.rangeChangedMs.toFixed(2))},rowContent:{calls:r.rowContentCalls,totalMs:Number(r.rowContentMs.toFixed(2)),avgMs:Number(y.toFixed(3)),maxMs:Number(r.rowContentMaxMs.toFixed(3))},cellRender:{calls:r.cellRenderCalls,totalMs:Number(r.cellRenderMs.toFixed(2)),avgMs:Number(b.toFixed(3)),maxMs:Number(r.cellRenderMaxMs.toFixed(3))}}),x.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}},[I]);(0,c.useEffect)(()=>{if(!I||typeof window>"u")return;console.log("[VDT perf] enabled (localStorage vdt-perf-debug=1)");let l=window.setInterval(()=>{xe("interval")},1500);return()=>{window.clearInterval(l),xe("cleanup")}},[xe,I]);let je=(0,c.useMemo)(()=>(0,c.forwardRef)((l,r)=>{let g=(0,c.useRef)(null),y=(0,c.useRef)(0),b=(0,c.useRef)(null);return(0,c.useEffect)(()=>{let e=g.current;if(!e)return;let B=W=>{let t=I?performance.now():0;W.preventDefault();let o=W.deltaY;W.deltaMode===1?o*=40:W.deltaMode===2&&(o*=e.clientHeight),I&&(x.current.wheelEvents+=1,x.current.wheelInputPx+=o),y.current+=o,b.current===null&&(b.current=requestAnimationFrame(()=>{let a=I?performance.now():0,h=Math.max(e.clientHeight*.4,160),f=Math.max(-h,Math.min(h,y.current));y.current=0,b.current=null,f!==0&&(e.scrollTop+=f),I&&(x.current.wheelRafFlushes+=1,x.current.wheelRafMs+=performance.now()-a)}),I&&(x.current.wheelHandlerMs+=performance.now()-t))};return e.addEventListener("wheel",B,{passive:!1}),()=>{e.removeEventListener("wheel",B),b.current!==null&&(cancelAnimationFrame(b.current),b.current=null),y.current=0}},[]),(0,s.jsx)(Je,{detectInnerScroll:!0,track:yt,...P,children:(0,s.jsx)(d.TableContainer,{component:d.Box,...l,ref:e=>{g.current=e,typeof r=="function"?r(e):r&&(r.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:u,paddingTop:U,paddingBottom:ge}}})})}),[]),He=(0,c.useMemo)(()=>{if(G===!0)return"#f5f5f5";if(typeof G=="string")return G},[G]),[Me,Ie]=(0,c.useState)(p),[Ae,Ce]=(0,c.useState)(0);(0,c.useEffect)(()=>{p&&Ie(!0)},[p]);let ye=(0,c.useCallback)(()=>{Ie(!1)},[]),pe=Me,j=p&&i.length>0,w=(0,c.useRef)(!1),Y=(0,c.useRef)(-1),Se=(0,c.useRef)(null),M=(0,c.useRef)(T);M.current=T;let D=(0,c.useRef)(S);D.current=S;let $e=!!T,fe=(0,c.useRef)(!1),V=(0,c.useRef)({x:0,y:0});(0,c.useEffect)(()=>{let l=r=>{let g=r.clientX-V.current.x,y=r.clientY-V.current.y;Math.sqrt(g*g+y*y)>Qe&&(fe.current=!0)};return document.addEventListener("mousemove",l),()=>{document.removeEventListener("mousemove",l)}},[]),(0,c.useEffect)(()=>{let l=document.querySelector('[data-testid="virtuoso-scroller"]');l&&l.querySelectorAll(".MuiTableSortLabel-root").forEach(g=>{let y=new MouseEvent("mouseleave",{bubbles:!0,cancelable:!0});g.dispatchEvent(y)})},[F]);let he=(0,c.useCallback)(l=>{if(!_)return;_(l,F===l&&X==="asc"?"desc":"asc")},[_,F,X]),re=(0,c.useCallback)(l=>{let r=I?performance.now():0;if(!Q){I&&(x.current.rangeChangedCalls+=1,x.current.rangeChangedMs+=performance.now()-r);return}if(p&&i.length===0){I&&(x.current.rangeChangedCalls+=1,x.current.rangeChangedMs+=performance.now()-r);return}let g=i.length>=30,y=l>=i.length-1,b=Y.current===i.length;if(y&&g&&!w.current&&!b){w.current=!0,Y.current=i.length;let e=i.length;Q(e,50)}I&&(x.current.rangeChangedCalls+=1,x.current.rangeChangedMs+=performance.now()-r)},[i.length,p,Q,I]);(0,c.useEffect)(()=>{w.current=!1},[i.length]),(0,c.useEffect)(()=>{p||(w.current=!1)},[p]),(0,c.useEffect)(()=>{i.length===0&&Ce(l=>l+1)},[i.length]);let R=(0,c.useRef)(i.length),ne=(0,c.useRef)(void 0);(0,c.useEffect)(()=>{let l=R.current,r=i.length,g=r>0?D.current?D.current(i[0],0):i[0]:void 0,y=ne.current;if(r>l&&l>0){R.current=r,ne.current=g;return}let b=r<l||l>0&&g!==y;Se.current&&r>0&&b&&Se.current.scrollToIndex({index:0,align:"start",behavior:"auto"}),R.current=r,ne.current=g},[i]);let A=(0,c.useCallback)(()=>{let l={},r=[];if(m.forEach(e=>{e.group?(l[e.group]||(l[e.group]=[]),l[e.group].push(e)):r.push(e)}),!(Object.keys(l).length>0))return(0,s.jsx)(d.TableRow,{children:m.map(e=>(0,s.jsx)(d.TableCell,{align:e.align||"left",style:{width:e.width,minWidth:e.width,...e.style,fontWeight:"bold",position:"sticky",top:0,zIndex:2,padding:"16px"},children:e.sortable?(0,s.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,s.jsxs)(d.Box,{sx:{position:"relative",cursor:"default","&:hover .MuiTableSortLabel-root":{opacity:"1 !important","& .MuiSvgIcon-root":{color:"#000",opacity:"1 !important"}}},onClick:()=>he(String(e.id)),children:[e.text,(0,s.jsx)(d.TableSortLabel,{active:F===e.id,direction:F===e.id?X:"desc",sx:{position:"absolute",left:"100%",top:"50%",transform:"translateY(-50%)",marginLeft:"4px",minWidth:"auto",width:"16px",height:"16px",cursor:"default",opacity:F===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 y=[...r.map(e=>(0,s.jsx)(d.TableCell,{rowSpan:2,align:e.align||"left",style:{width:e.width,minWidth:e.width,...e.style,fontWeight:"bold",position:"sticky",top:0,zIndex:2,padding:"16px"},children:e.sortable&&_?(0,s.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,s.jsxs)(d.Box,{sx:{position:"relative",cursor:"default","&:hover .MuiTableSortLabel-root":{opacity:"1 !important","& .MuiSvgIcon-root":{color:"#000",opacity:"1 !important"}}},onClick:()=>he(String(e.id)),children:[e.text,(0,s.jsx)(d.TableSortLabel,{active:F===e.id,direction:F===e.id?X:"desc",sx:{position:"absolute",left:"100%",top:"50%",transform:"translateY(-50%)",marginLeft:"4px",minWidth:"auto",width:"16px",height:"16px",cursor:"default",opacity:F===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(l).map(([e,B])=>(0,s.jsx)(d.TableCell,{align:"center",colSpan:B.length,style:{fontWeight:"bold",position:"sticky",top:0,zIndex:2,padding:"16px"},children:e},e))],b=[...Object.values(l).flat().map(e=>(0,s.jsx)(d.TableCell,{align:e.align||"left",style:{width:e.width,minWidth:e.width,...e.style,fontWeight:"bold",position:"sticky",top:0,zIndex:2,padding:"16px"},children:e.sortable&&_?(0,s.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,s.jsxs)(d.Box,{sx:{position:"relative",cursor:"default","&:hover .MuiTableSortLabel-root":{opacity:"1 !important","& .MuiSvgIcon-root":{color:"#000",opacity:"1 !important"}}},onClick:()=>he(String(e.id)),children:[e.text,(0,s.jsx)(d.TableSortLabel,{active:F===e.id,direction:F===e.id?X:"desc",sx:{position:"absolute",left:"100%",top:"50%",transform:"translateY(-50%)",marginLeft:"4px",minWidth:"auto",width:"16px",height:"16px",cursor:"default",opacity:F===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,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(d.TableRow,{children:y}),(0,s.jsx)(d.TableRow,{children:b})]})},[m,F,X,he,_,O]),_e=(0,c.useCallback)((l,r)=>{let g=I?performance.now():0;if(!r){if(I){x.current.rowContentCalls+=1;let b=performance.now()-g;x.current.rowContentMs+=b,x.current.rowContentMaxMs=Math.max(x.current.rowContentMaxMs,b)}return null}let y=m.map(b=>{let e=I?performance.now():0,B=b.render?b.render(r,l):String(r[b.id]||"");if(I){let W=performance.now()-e;x.current.cellRenderCalls+=1,x.current.cellRenderMs+=W,x.current.cellRenderMaxMs=Math.max(x.current.cellRenderMaxMs,W)}return(0,s.jsx)(d.TableCell,{align:b.align||"left",style:{width:b.width,minWidth:b.width,...b.style,padding:"8px 16px"},children:B},String(b.id))});if(I){x.current.rowContentCalls+=1;let b=performance.now()-g;x.current.rowContentMs+=b,x.current.rowContentMaxMs=Math.max(x.current.rowContentMaxMs,b)}return(0,s.jsx)(s.Fragment,{children:y})},[m,I]),oe=Le??m.some(l=>typeof l.footer=="function"),z=(0,c.useCallback)(()=>{if(!oe)return null;let l=[];for(let r=0;r<m.length;r+=1){let g=m[r],y=g.footerColSpan&&g.footerColSpan>1?Math.min(g.footerColSpan,m.length-r):1;l.push((0,s.jsx)(d.TableCell,{align:g.align||"left",colSpan:y>1?y:void 0,style:{...y>1?{}:{width:g.width,minWidth:g.width},...g.style,fontWeight:"bold",padding:"16px"},children:g.footer?g.footer(i):null},String(g.id))),r+=y-1}return(0,s.jsx)(d.TableRow,{children:l})},[oe,m,i]),Ye=(0,c.useMemo)(()=>({Scroller:je,Table:l=>(0,s.jsx)(d.Table,{...l,sx:{borderCollapse:"separate",tableLayout:"fixed",marginRight:"16px",...oe?{height:"100%"}:{}}}),TableHead:(0,c.forwardRef)((l,r)=>(0,s.jsx)(d.TableHead,{...l,ref:r,sx:{userSelect:"none","& tr":{height:O,"& th":{padding:"16px",position:"sticky",top:0,zIndex:2,fontWeight:"bold"}}}})),TableRow:l=>{let{item:r,selected:g,"aria-selected":y,className:b,...e}=l,B=e["data-index"]??0,W=B%2===1,t=r&&D.current?D.current(r,B):B,o=!de&&k!==null&&k!==void 0&&t===k,a=o&&v?typeof v=="function"?v(r,B):v:void 0,h=String(b??"").split(/\s+/).filter(f=>f!=="Mui-selected"&&f!=="Mui-focusVisible").join(" ");return(0,s.jsx)(d.TableRow,{...e,"data-row-id":t!=null?String(t):void 0,className:h||void 0,selected:o,onMouseDown:f=>{fe.current=!1,V.current={x:f.clientX,y:f.clientY}},onClick:f=>{let C=f.clientX-V.current.x,$=f.clientY-V.current.y;if(Math.sqrt(C*C+$*$)>Qe||fe.current){f.preventDefault(),f.stopPropagation(),fe.current=!1;return}r&&M.current&&M.current(r,B),fe.current=!1},sx:[{userSelect:"none",height:we,maxHeight:we,boxSizing:"border-box",backgroundColor:W&&He?He:"transparent","& td":{padding:"8px 16px",boxSizing:"border-box",borderBottom:J?"1px solid rgba(224, 224, 224, 1)":"none"},"& th":{padding:"8px 16px",borderBottom:"none"},"&:hover":$e&&!o?{backgroundColor:f=>{let C=f.palette.mode==="dark",N=be??"#000000",te=q??.06;if(!be)return C?`rgba(255, 255, 255, ${te})`:`rgba(0, 0, 0, ${te})`;let ie=N.replace("#","").trim();if(ie.length!==6)return N;let K=parseInt(ie.substring(0,2),16),Ne=parseInt(ie.substring(2,4),16),Re=parseInt(ie.substring(4,6),16);return`rgba(${K}, ${Ne}, ${Re}, ${te})`}}:void 0,cursor:$e?"pointer":void 0},a]})},TableBody:(0,c.forwardRef)((l,r)=>{let{children:g,...y}=l;return(0,s.jsxs)(d.TableBody,{...y,ref:r,sx:oe?{height:"100%"}:void 0,children:[g,oe&&(0,s.jsx)("tr",{"aria-hidden":!0,style:{height:"100%"},children:(0,s.jsx)("td",{colSpan:m.length,style:{padding:0,border:0}})})]})}),TableFoot:(0,c.forwardRef)((l,r)=>(0,s.jsx)(d.TableFooter,{...l,ref:r,sx:[{"& tr":{height:ee??L,maxHeight:ee??L,boxSizing:"border-box"},"& td":{height:ee??L,boxSizing:"border-box",backgroundColor:g=>g.palette.mode==="dark"?"#1e1e1e":"#ffffff",padding:"0 16px",color:"inherit",fontSize:"0.875rem",border:"none",boxShadow:"inset 0 1px 0 0 #000000"}},...Array.isArray(ce)?ce:ce?[ce]:[]]}))}),[$e,de?null:k,v,L,He,J,O,be,q,je,ee,ce,oe,m]),De=(0,s.jsxs)(d.Box,{sx:{position:"relative",height:"100%",width:"100%","& .MuiTableHead-root":{backgroundColor:l=>l.palette.mode==="dark"?"#1e1e1e !important":"#ffffff !important"},...We??{}},children:[(0,s.jsx)(et.TableVirtuoso,{ref:Se,data:i,totalCount:Q?i.length+1:i.length,defaultItemHeight:we,fixedItemHeight:we,fixedHeaderContent:A,fixedFooterContent:oe?z:void 0,itemContent:_e,endReached:re,style:{height:"100%"},increaseViewportBy:{top:Ve,bottom:Fe},overscan:ve,followOutput:!1,components:Ye},Ae),i.length===0&&!p&&(0,s.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 ae=="string"?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(d.Box,{sx:{width:48,height:48,display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"50%",backgroundColor:"#f5f5f5",color:"#999"},children:"\u{1F4C4}"}),(0,s.jsx)(d.Typography,{variant:"body1",sx:{color:"text.secondary"},children:ae})]}):ae}),pe&&(0,s.jsx)(s.Fragment,{children:se?(0,s.jsx)(se,{visible:p,onComplete:ye}):(0,s.jsx)(Xe,{visible:p,onComplete:ye,size:40,indicator:(0,s.jsx)(Ue,{}),sx:{top:`${m.some(l=>l.group)?O*2:O}px`,bottom:`${oe?ee??L:0}px`},background:{show:i.length===0,opacity:.8}})})]});return me?(0,s.jsx)(d.Paper,{className:"grow",elevation:1,sx:{padding:0,paddingLeft:u,height:"100%",minHeight:0,flex:1,display:"flex",flexDirection:"column"},children:De}):(0,s.jsx)(d.Box,{className:"grow",style:{padding:0,paddingLeft:u,height:"100%",minHeight:0,flex:1,display:"flex",flexDirection:"column"},children:De})}var tt=(0,c.memo)(vt);
24
+ `,document.head.appendChild(n),()=>{let i=document.getElementById(e);i&&i.remove()}},[]),(0,ne.jsxs)("div",{ref:ce,className:`overlay-scrollbar-wrapper ${l}`,style:{display:"flex",flexDirection:"column",position:"relative",minHeight:0,height:"100%",flex:"1 1 0%",...d},children:[(0,ne.jsx)("div",{ref:p,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:se?"none":"auto",...f},children:(0,ne.jsx)("div",{ref:V,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:ue,className:"overlay-scrollbar-track",onMouseEnter:()=>{R(),h.current=setTimeout(()=>{L(!0),h.current=null},100)},onMouseLeave:()=>{He(),O||D(M.delay)},style:{position:"absolute",top:0,right:0,width:`${pe}px`,height:"100%",opacity:j?1:0,transition:"opacity 0.2s ease-in-out",cursor:"pointer",zIndex:1e3,pointerEvents:"auto"},children:[y.visible&&(0,ne.jsx)("div",{className:"overlay-scrollbar-track-background",onClick:e=>{e.preventDefault(),e.stopPropagation(),je(e)},style:{position:"absolute",top:ee?`${$.width+y.margin*2}px`:`${y.margin}px`,right:y.alignment==="right"?"0px":`${(pe-$.width)/2}px`,width:`${$.width}px`,height:ee?`calc(100% - ${$.width*2+y.margin*4}px)`:`calc(100% - ${y.margin*2}px)`,backgroundColor:y.color,borderRadius:`${y.radius}px`,cursor:"pointer"}}),(0,ne.jsx)("div",{ref:we,className:"overlay-scrollbar-thumb",onMouseDown:Ve,onMouseEnter:()=>Me(!0),onMouseLeave:()=>Me(!1),style:{position:"absolute",top:`${(ee?I+y.margin*2:y.margin)+Ue}px`,right:y.alignment==="right"?"0px":`${(pe-I)/2}px`,width:`${I}px`,height:`${Math.max(ae,Ee)}px`,backgroundColor:ie||O?$.hoverColor:$.color,opacity:ie||O?$.hoverOpacity:$.opacity,borderRadius:`${$.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:_e,onMouseEnter:()=>ke("up"),onMouseLeave:()=>ke(null),style:{position:"absolute",top:`${y.margin}px`,right:y.alignment==="right"?"0px":`${(pe-I)/2}px`,width:`${I}px`,height:`${I}px`,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",fontSize:`${Math.max(I*.75,8)}px`,color:Se==="up"?_.hoverColor:_.color,userSelect:"none",zIndex:1001,opacity:j?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:`${y.margin}px`,right:y.alignment==="right"?"0px":`${(pe-I)/2}px`,width:`${I}px`,height:`${I}px`,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",fontSize:`${Math.max(I*.75,8)}px`,color:Se==="down"?_.hoverColor:_.color,userSelect:"none",zIndex:1001,opacity:j?Se==="down"?_.hoverOpacity:_.opacity:0,transition:"opacity 0.2s ease-in-out, color 0.15s ease-in-out"},children:"\u25BC"})]})}),nt=Tt;var s=require("react/jsx-runtime"),St={alignment:"right",margin:0,radius:0},ot=5,kt={bg:"#ffffff",border:"#e6e6e3",borderStrong:"#dedddb",headerColor:"#787774",hoverBg:"#f8f8f7"},Lt={bg:"#1e1e1e",border:"#2c333c",borderStrong:"#3b434e",headerColor:"#a3adbb",hoverBg:"#272d36"};function Rt({data:l,loading:d=!1,columns:f,onRowClick:C,getRowId:w,selectedRowId:T,selectedRowSx:g,rowHeight:S=50,columnHeight:F,striped:W,rowDivider:X=!0,onSort:z,onLoadMore:K,sortBy:H,sortDirection:q,showPaper:ce=!0,paddingX:p,paddingTop:V=0,paddingBottom:ue=0,rowHoverColor:we,rowHoverOpacity:P,viewportBuffer:j,overscan:L,scrollbars:O,emptyMessage:oe="NO DATA",LoadingComponent:ie,showFooter:Me,footerHeight:G,footerSx:le,variant:ae="default"}){let me=ae==="notion",Z=(0,u.useTheme)().palette.mode==="dark"?Lt:kt,J=F??(me?40:56),Ce=p??(me?"12px":"1rem"),se=we??(me?Z.hoverBg:void 0),De=P??(me?1:void 0),Te=Math.max(S*12,480),We=Math.max(S*12,480),Ze=typeof j=="number"?j:j?.top??Te,Je=typeof j=="number"?j:j?.bottom??We,Se=Math.max(S*8,420),ke=Math.max(S*10,520),Qe=typeof L=="number"?L:{main:L?.main??Se,reverse:L?.reverse??ke},Le=S+(X?1:0),Q=!g||typeof g!="function",Ne=(0,c.useMemo)(()=>!Q||T===null||T===void 0||!g?null:{[`& tbody tr[data-row-id="${String(T).replace(/["\\]/g,"\\$&")}"]`]:g},[Q,T,g]),qe=typeof window<"u"&&(window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1"),[b]=(0,c.useState)(()=>typeof window>"u"?!1:window.localStorage.getItem("vdt-perf-debug")==="1"),h=(0,c.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,c.useCallback)(e=>{if(!b)return;let t=h.current;if(!(t.wheelEvents>0||t.rangeChangedCalls>0||t.rowContentCalls>0||t.cellRenderCalls>0))return;let i=t.rowContentCalls>0?t.rowContentMs/t.rowContentCalls:0,a=t.cellRenderCalls>0?t.cellRenderMs/t.cellRenderCalls:0;console.log("[VDT perf]",{reason:e,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(i.toFixed(3)),maxMs:Number(t.rowContentMaxMs.toFixed(3))},cellRender:{calls:t.cellRenderCalls,totalMs:Number(t.cellRenderMs.toFixed(2)),avgMs:Number(a.toFixed(3)),maxMs:Number(t.cellRenderMaxMs.toFixed(3))}}),h.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}},[b]);(0,c.useEffect)(()=>{if(!b||typeof window>"u")return;console.log("[VDT perf] enabled (localStorage vdt-perf-debug=1)");let e=window.setInterval(()=>{U("interval")},1500);return()=>{window.clearInterval(e),U("cleanup")}},[U,b]);let $=(0,c.useMemo)(()=>(0,c.forwardRef)((e,t)=>{let n=(0,c.useRef)(null),i=(0,c.useRef)(0),a=(0,c.useRef)(null);return(0,c.useEffect)(()=>{let r=n.current;if(!r)return;let m=v=>{let B=b?performance.now():0;v.preventDefault();let A=v.deltaY;v.deltaMode===1?A*=40:v.deltaMode===2&&(A*=r.clientHeight),b&&(h.current.wheelEvents+=1,h.current.wheelInputPx+=A),i.current+=A,a.current===null&&(a.current=requestAnimationFrame(()=>{let N=b?performance.now():0,fe=Math.max(r.clientHeight*.4,160),E=Math.max(-fe,Math.min(fe,i.current));i.current=0,a.current=null,E!==0&&(r.scrollTop+=E),b&&(h.current.wheelRafFlushes+=1,h.current.wheelRafMs+=performance.now()-N)}),b&&(h.current.wheelHandlerMs+=performance.now()-B))};return r.addEventListener("wheel",m,{passive:!1}),()=>{r.removeEventListener("wheel",m),a.current!==null&&(cancelAnimationFrame(a.current),a.current=null),i.current=0}},[]),(0,s.jsx)(nt,{detectInnerScroll:!0,track:St,...O,children:(0,s.jsx)(u.TableContainer,{component:u.Box,...e,ref:r=>{n.current=r,typeof t=="function"?t(r):t&&(t.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:Ce,paddingTop:V,paddingBottom:ue}}})})}),[]),y=(0,c.useMemo)(()=>{if(W===!0)return"#f5f5f5";if(typeof W=="string")return W},[W]),[_,Re]=(0,c.useState)(d),[M,I]=(0,c.useState)(0);(0,c.useEffect)(()=>{d&&Re(!0)},[d]);let Fe=(0,c.useCallback)(()=>{Re(!1)},[]),Ee=_,ee=d&&l.length>0,de=(0,c.useRef)(!1),Y=(0,c.useRef)(-1),k=(0,c.useRef)(null),te=(0,c.useRef)(C);te.current=C;let R=(0,c.useRef)(w);R.current=w;let He=!!C,ge=(0,c.useRef)(!1),D=(0,c.useRef)({x:0,y:0});(0,c.useEffect)(()=>{let e=t=>{let n=t.clientX-D.current.x,i=t.clientY-D.current.y;Math.sqrt(n*n+i*i)>ot&&(ge.current=!0)};return document.addEventListener("mousemove",e),()=>{document.removeEventListener("mousemove",e)}},[]),(0,c.useEffect)(()=>{let e=document.querySelector('[data-testid="virtuoso-scroller"]');e&&e.querySelectorAll(".MuiTableSortLabel-root").forEach(n=>{let i=new MouseEvent("mouseleave",{bubbles:!0,cancelable:!0});n.dispatchEvent(i)})},[H]);let x=(0,c.useCallback)(e=>{if(!z)return;z(e,H===e&&q==="asc"?"desc":"asc")},[z,H,q]),Ve=(0,c.useCallback)(e=>{let t=b?performance.now():0;if(!K){b&&(h.current.rangeChangedCalls+=1,h.current.rangeChangedMs+=performance.now()-t);return}if(d&&l.length===0){b&&(h.current.rangeChangedCalls+=1,h.current.rangeChangedMs+=performance.now()-t);return}let n=l.length>=30,i=e>=l.length-1,a=Y.current===l.length;if(i&&n&&!de.current&&!a){de.current=!0,Y.current=l.length;let r=l.length;K(r,50)}b&&(h.current.rangeChangedCalls+=1,h.current.rangeChangedMs+=performance.now()-t)},[l.length,d,K,b]);(0,c.useEffect)(()=>{d||(de.current=!1)},[d]),(0,c.useEffect)(()=>{l.length===0&&I(e=>e+1)},[l.length]);let be=(0,c.useRef)(l.length),xe=(0,c.useRef)(void 0);(0,c.useEffect)(()=>{let e=be.current,t=l.length,n=t>0?R.current?R.current(l[0],0):l[0]:void 0,i=xe.current;if(t>e&&e>0){be.current=t,xe.current=n;return}let a=t<e||e>0&&n!==i;a&&(Y.current=-1),k.current&&t>0&&a&&k.current.scrollToIndex({index:0,align:"start",behavior:"auto"}),be.current=t,xe.current=n},[l]);let je=(0,c.useCallback)(()=>{let e={},t=[];if(f.forEach(r=>{r.group?(e[r.group]||(e[r.group]=[]),e[r.group].push(r)):t.push(r)}),!(Object.keys(e).length>0))return(0,s.jsx)(u.TableRow,{children:f.map(r=>(0,s.jsx)(u.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,s.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,s.jsxs)(u.Box,{sx:{position:"relative",cursor:"default","&:hover .MuiTableSortLabel-root":{opacity:"1 !important","& .MuiSvgIcon-root":{color:"#000",opacity:"1 !important"}}},onClick:()=>x(String(r.id)),children:[r.text,(0,s.jsx)(u.TableSortLabel,{active:H===r.id,direction:H===r.id?q:"desc",sx:{position:"absolute",left:"100%",top:"50%",transform:"translateY(-50%)",marginLeft:"4px",minWidth:"auto",width:"16px",height:"16px",cursor:"default",opacity:H===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 i=[...t.map(r=>(0,s.jsx)(u.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,s.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,s.jsxs)(u.Box,{sx:{position:"relative",cursor:"default","&:hover .MuiTableSortLabel-root":{opacity:"1 !important","& .MuiSvgIcon-root":{color:"#000",opacity:"1 !important"}}},onClick:()=>x(String(r.id)),children:[r.text,(0,s.jsx)(u.TableSortLabel,{active:H===r.id,direction:H===r.id?q:"desc",sx:{position:"absolute",left:"100%",top:"50%",transform:"translateY(-50%)",marginLeft:"4px",minWidth:"auto",width:"16px",height:"16px",cursor:"default",opacity:H===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(e).map(([r,m])=>(0,s.jsx)(u.TableCell,{align:"center",colSpan:m.length,style:{fontWeight:"bold",position:"sticky",top:0,zIndex:2,padding:"16px"},children:r},r))],a=[...Object.values(e).flat().map(r=>(0,s.jsx)(u.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,s.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,s.jsxs)(u.Box,{sx:{position:"relative",cursor:"default","&:hover .MuiTableSortLabel-root":{opacity:"1 !important","& .MuiSvgIcon-root":{color:"#000",opacity:"1 !important"}}},onClick:()=>x(String(r.id)),children:[r.text,(0,s.jsx)(u.TableSortLabel,{active:H===r.id,direction:H===r.id?q:"desc",sx:{position:"absolute",left:"100%",top:"50%",transform:"translateY(-50%)",marginLeft:"4px",minWidth:"auto",width:"16px",height:"16px",cursor:"default",opacity:H===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,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(u.TableRow,{children:i}),(0,s.jsx)(u.TableRow,{children:a})]})},[f,H,q,x,z,J]),_e=(0,c.useCallback)((e,t)=>{let n=b?performance.now():0;if(!t){if(b){h.current.rowContentCalls+=1;let a=performance.now()-n;h.current.rowContentMs+=a,h.current.rowContentMaxMs=Math.max(h.current.rowContentMaxMs,a)}return null}let i=f.map(a=>{let r=b?performance.now():0,m=a.render?a.render(t,e):String(t[a.id]||"");if(b){let v=performance.now()-r;h.current.cellRenderCalls+=1,h.current.cellRenderMs+=v,h.current.cellRenderMaxMs=Math.max(h.current.cellRenderMaxMs,v)}return(0,s.jsx)(u.TableCell,{align:a.align||"left",style:{width:a.width,minWidth:a.width,...a.style,padding:"8px 16px"},children:m},String(a.id))});if(b){h.current.rowContentCalls+=1;let a=performance.now()-n;h.current.rowContentMs+=a,h.current.rowContentMaxMs=Math.max(h.current.rowContentMaxMs,a)}return(0,s.jsx)(s.Fragment,{children:i})},[f,b]),re=Me??f.some(e=>typeof e.footer=="function"),Ye=(0,c.useCallback)(()=>{if(!re)return null;let e=[];for(let t=0;t<f.length;t+=1){let n=f[t],i=n.footerColSpan&&n.footerColSpan>1?Math.min(n.footerColSpan,f.length-t):1;e.push((0,s.jsx)(u.TableCell,{align:n.align||"left",colSpan:i>1?i:void 0,style:{...i>1?{}:{width:n.width,minWidth:n.width},...n.style,fontWeight:"bold",padding:"16px"},children:n.footer?n.footer(l):null},String(n.id))),t+=i-1}return(0,s.jsx)(u.TableRow,{children:e})},[re,f,l]),Ie=(0,c.useMemo)(()=>({Scroller:$,Table:e=>(0,s.jsx)(u.Table,{...e,sx:{borderCollapse:"separate",tableLayout:"fixed",marginRight:"16px",...re?{height:"100%"}:{}}}),TableHead:(0,c.forwardRef)((e,t)=>(0,s.jsx)(u.TableHead,{...e,ref:t,sx:{userSelect:"none","& tr":{height:J,"& th":{padding:"16px",position:"sticky",top:0,zIndex:2,fontWeight:"bold"}}}})),TableRow:e=>{let{item:t,selected:n,"aria-selected":i,className:a,...r}=e,m=r["data-index"]??0,v=m%2===1,B=t&&R.current?R.current(t,m):m,A=!Q&&T!==null&&T!==void 0&&B===T,N=A&&g?typeof g=="function"?g(t,m):g:void 0,fe=String(a??"").split(/\s+/).filter(E=>E!=="Mui-selected"&&E!=="Mui-focusVisible").join(" ");return(0,s.jsx)(u.TableRow,{...r,"data-row-id":B!=null?String(B):void 0,className:fe||void 0,selected:A,onMouseDown:E=>{ge.current=!1,D.current={x:E.clientX,y:E.clientY}},onClick:E=>{let he=E.clientX-D.current.x,Oe=E.clientY-D.current.y;if(Math.sqrt(he*he+Oe*Oe)>ot||ge.current){E.preventDefault(),E.stopPropagation(),ge.current=!1;return}t&&te.current&&te.current(t,m),ge.current=!1},sx:[{userSelect:"none",height:Le,maxHeight:Le,boxSizing:"border-box",backgroundColor:v&&y?y:"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":He&&!A?{backgroundColor:E=>{let he=E.palette.mode==="dark",Xe=se??"#000000",Ke=De??.06;if(!se)return he?`rgba(255, 255, 255, ${Ke})`:`rgba(0, 0, 0, ${Ke})`;let Be=Xe.replace("#","").trim();if(Be.length!==6)return Xe;let at=parseInt(Be.substring(0,2),16),st=parseInt(Be.substring(2,4),16),ct=parseInt(Be.substring(4,6),16);return`rgba(${at}, ${st}, ${ct}, ${Ke})`}}:void 0,cursor:He?"pointer":void 0},N]})},TableBody:(0,c.forwardRef)((e,t)=>{let{children:n,...i}=e;return(0,s.jsxs)(u.TableBody,{...i,ref:t,sx:re?{height:"100%"}:void 0,children:[n,re&&(0,s.jsx)("tr",{"aria-hidden":!0,style:{height:"100%"},children:(0,s.jsx)("td",{colSpan:f.length,style:{padding:0,border:0}})})]})}),TableFoot:(0,c.forwardRef)((e,t)=>(0,s.jsx)(u.TableFooter,{...e,ref:t,sx:[{"& tr":{height:G??S,maxHeight:G??S,boxSizing:"border-box"},"& td":{height:G??S,boxSizing:"border-box",backgroundColor:n=>n.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]:[]]}))}),[He,Q?null:T,g,S,y,X,J,se,De,$,G,le,re,f]),pe=(0,s.jsxs)(u.Box,{sx:{position:"relative",height:"100%",width:"100%","& .MuiTableHead-root":{backgroundColor:e=>e.palette.mode==="dark"?"#1e1e1e !important":"#ffffff !important"},...Ne??{},...me?{"& 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:`1px solid ${Z.borderStrong}`,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,s.jsx)(it.TableVirtuoso,{ref:k,data:l,totalCount:K?l.length+1:l.length,defaultItemHeight:Le,fixedItemHeight:Le,fixedHeaderContent:je,fixedFooterContent:re?Ye:void 0,itemContent:_e,endReached:Ve,style:{height:"100%"},increaseViewportBy:{top:Ze,bottom:Je},overscan:Qe,followOutput:!1,components:Ie},M),l.length===0&&!d&&(0,s.jsx)(u.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,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(u.Box,{sx:{width:48,height:48,display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"50%",backgroundColor:"#f5f5f5",color:"#999"},children:"\u{1F4C4}"}),(0,s.jsx)(u.Typography,{variant:"body1",sx:{color:"text.secondary"},children:oe})]}):oe}),Ee&&(0,s.jsx)(s.Fragment,{children:ie?(0,s.jsx)(ie,{visible:d,onComplete:Fe}):(0,s.jsx)(et,{visible:d,onComplete:Fe,size:40,indicator:(0,s.jsx)(tt,{}),sx:{top:`${f.some(e=>e.group)?J*2:J}px`,bottom:`${re?G??S:0}px`},background:{show:l.length===0,opacity:.8}})})]});return ce?(0,s.jsx)(u.Paper,{className:"grow",elevation:1,sx:{padding:0,paddingLeft:Ce,height:"100%",minHeight:0,flex:1,display:"flex",flexDirection:"column"},children:pe}):(0,s.jsx)(u.Box,{className:"grow",style:{padding:0,paddingLeft:Ce,height:"100%",minHeight:0,flex:1,display:"flex",flexDirection:"column"},children:pe})}var lt=(0,c.memo)(Rt);
25
25
  /**
26
26
  * Virtual Data Table - A high-performance virtual data table component for React
27
27
  *