@infinite-table/infinite-react 10.2.0 → 11.0.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/index.js CHANGED
@@ -1,7 +1,7 @@
1
- "use strict";var Yb=Object.create;var Ii=Object.defineProperty;var qb=Object.getOwnPropertyDescriptor;var Xb=Object.getOwnPropertyNames;var Zb=Object.getPrototypeOf,Qb=Object.prototype.hasOwnProperty;var Jb=(o,e)=>()=>(e||o((e={exports:{}}).exports,e),e.exports),eT=(o,e)=>{for(var t in e)Ii(o,t,{get:e[t],enumerable:!0})},Du=(o,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Xb(e))!Qb.call(o,r)&&r!==t&&Ii(o,r,{get:()=>e[r],enumerable:!(n=qb(e,r))||n.enumerable});return o};var H=(o,e,t)=>(t=o!=null?Yb(Zb(o)):{},Du(e||!o||!o.__esModule?Ii(t,"default",{value:o,enumerable:!0}):t,o)),tT=o=>Du(Ii({},"__esModule",{value:!0}),o);var an=Jb((qE,_p)=>{"use strict";_p.exports=function(o,e,t,n,r){var i,a;if(n===void 0)n=0;else if(n=n|0,n<0||n>=o.length)throw new RangeError("invalid lower bound");if(r===void 0)r=o.length-1;else if(r=r|0,r<n||r>=o.length)throw new RangeError("invalid upper bound");for(;n<=r;)if(i=n+(r-n>>>1),a=+t(o[i],e,i,o),a<0)n=i+1;else if(a>0)r=i-1;else return i;return~n}});var pv={};eT(pv,{AutoScroller:()=>gn,CellSelectionState:()=>Ue,DRAG_ITEM_ATTRIBUTE:()=>Tt,DataClient:()=>Su,DataSource:()=>kI,DataSourceActionType:()=>Eh,DeepMap:()=>q,DragDropProvider:()=>ta,DragInteractionTarget:()=>ar,DragList:()=>Wo,FixedSizeSet:()=>Vl,FlashingColumnCell:()=>Eb,GroupRowsState:()=>xt,INTERNAL_MatrixDebugger:()=>Ab,InfiniteTable:()=>co,InfiniteTableClassName:()=>Jt,InfiniteTableComponent:()=>Sb,Menu:()=>Yt,RowDetailCache:()=>mr,RowDetailState:()=>At,RowDisabledState:()=>Et,RowSelectionState:()=>Oe,TreeDataSource:()=>iv,TreeExpandState:()=>ft,TreeGrid:()=>Cb,TreeSelectionState:()=>Je,WeakFixedSizeSet:()=>Hl,alignNode:()=>Cl,components:()=>dv,createDefaultProxy:()=>wa,createFlashingColumnCellComponent:()=>bu,debounce:()=>Nt,debug:()=>Ye,defaultDragProxyMove:()=>va,defaultFilterFunction:()=>Tc,defaultFilterTypes:()=>No,defaultTreeFilterFunction:()=>$a,eventMatchesKeyboardShortcut:()=>Sl,filterDataArray:()=>kc,filterTypes:()=>No,flatten:()=>pf,getComponentStateRoot:()=>kt,group:()=>pa,interceptMap:()=>Ib,keyboardShortcuts:()=>Rb,multisort:()=>ro,multisortNested:()=>el,queryKeyToCacheKey:()=>_n,toTreeDataArray:()=>Kg,useComponentState:()=>zt,useDataSourceApi:()=>xh,useDataSourceInternal:()=>fr,useDataSourceSelector:()=>Ne,useDataSourceState:()=>tl,useDragDropProvider:()=>fo,useDragListContext:()=>hn,useEffectWhen:()=>Bl,useEffectWhenSameDeps:()=>wb,useEffectWithChanges:()=>vn,useEffectWithObject:()=>EI,useGridScroll:()=>Al,useInfiniteColumnApi:()=>yb,useInfiniteColumnCell:()=>$r,useInfiniteColumnEditor:()=>ya,useInfiniteColumnFilterEditor:()=>Un,useInfiniteHeaderCell:()=>Lr,useInfinitePortalContainer:()=>BS,useInfiniteTableApi:()=>hb,useLayoutEffectWithChanges:()=>xI,useManagedDataSource:()=>Vc,useMasterRowInfo:()=>Mo,useOverlay:()=>lo,useOverlayPortal:()=>jy,usePrevious:()=>Oo,useRowInfoReducers:()=>zI,useVisibleColumnSizes:()=>NS,withSelectedLeafNodesOnly:()=>yu});module.exports=tT(pv);function Nt(o,{wait:e}){let t=null;return function(...n){let r=this;t!==null&&clearTimeout(t),t=setTimeout(()=>{o.apply(r,n)},e)}}var Ee=H(require("react"));var X=(...o)=>o.filter(e=>!!`${e}`).join(" ");var tn=H(require("react")),ts=require("react");var oT=H(require("react")),Do=require("react");var Nn=(o,e,t={debounce:0})=>{let n=t.debounce??0,r=window.ResizeObserver,i=n?Nt(e,{wait:n}):e,a=new r(l=>{let s=l[0],{width:c,height:u}=s.contentRect;if(s.borderBoxSize?.[0])u=s.borderBoxSize[0].blockSize,c=s.borderBoxSize[0].inlineSize;else{let d=o.getBoundingClientRect();u=d.height,c=d.width}i({width:c,height:u})});return a.observe(o),()=>{a.disconnect()}};var wi=(o,e,t={earlyAttach:!1,debounce:0})=>{let n=(0,Do.useRef)({width:0,height:0}),r=i=>{let a;return o.current&&(a=Nn(o.current,l=>{l={width:Math.round(l.width),height:Math.round(l.height)};let s=n.current;(s.width!==l.width||s.height!==l.height)&&(n.current=l,i(l))},{debounce:t.debounce})),()=>{a&&a()}};(0,Do.useEffect)(()=>t.earlyAttach?()=>{}:r(e),[o.current,e,t.earlyAttach,t.debounce]),(0,Do.useLayoutEffect)(()=>t.earlyAttach?r(e):()=>{},[o.current,e,t.earlyAttach])};function Ce(o=!1){let e=null,t=[],n=null,r=(i,a)=>{let l=[];if(o)n!=null&&(cancelAnimationFrame(n),n=null),requestAnimationFrame(()=>{e=i,n=null;for(let s=0,c=t.length;s<c;s++)l.push(t[s](i));a?.(l)});else{e=i;for(let s=0,c=t.length;s<c;s++)l.push(t[s](i));a?.(l)}};return r.get=()=>e,r.onChange=i=>(t.push(i),()=>{t=t.filter(a=>a!==i)}),r.destroy=()=>{r(null),t.length=0},r.getListenersCount=()=>t.length,r}function yt(o){let e=!1,t=null;return(...r)=>(e||(e=!0,t=o(...r)),t)}var xu=(o,e)=>o-e;var vi=(o,e)=>xu(o.revision,e.revision),q=class o{constructor(e){this.map=new Map;this.length=0;this.revision=0;this.mutations=0;this.emptyKey=Symbol("emptyKey");this.visit=e=>{this.map.forEach((t,n)=>this.visitKey(n,this.map,[],e,!1))};this.visitSome=e=>{this.visitWithNext([],e,!0)};this.visitDepthFirst=e=>{this.visitWithNext([],e,!1)};this.visitWithNext=(e,t,n,r=this.map,i,a)=>{if(!r)return;let l=0,s=r.has(this.emptyKey),c=!a;if(i!==void 0){if(i<0)return;i--}let u=(d,p)=>{let f=r.get(p);if(!f)return;let{map:m}=f,g=p===this.emptyKey;if(g&&!c)return;let h=g?[]:[...e,p],S=m?()=>this.visitWithNext(h,t,n,m,i!==void 0?i-1:void 0):void 0;if(f.hasOwnProperty("value")){let y=t(f.value,h,l,S,f);if(n&&y===!0)return!0;l++}else S?.()};s&&(u(void 0,this.emptyKey),c=!1,l=0);for(let[d,p]of r){let f=u(p,d);if(n&&f===!0)return f}};this.fill(e)}get version(){return this.mutations}static clone(e){let t=new o;return e.visit((n,r)=>{t.set(r,n.value)}),t}fill(e){e&&e.forEach(t=>{let[n,r]=t;this.set(n,r)})}getValuesStartingWith(e,t){let n=[];return this.getStartingWith(e,(r,i)=>{n.push(i)},t),n}getEntriesStartingWith(e,t){let n=[];return this.getStartingWith(e,(r,i)=>{n.push([r,i])},t),n}getLeafNodesStartingWith(e,t,n){let{respectOrder:r=!1}=n||{},i=[],a=[];return this.getStartingWith(e,(l,s,c)=>{!c.map&&c.hasOwnProperty("value")&&(r?i.push(c):a.push(t(c)))},n),r?i.sort(vi).map(t):a}getKeysForLeafNodesStartingWith(e,t){return this.getLeafNodesStartingWith(e,n=>n.keys,t)}getKeysAndValuesForLeafNodesStartingWith(e,t){return this.getLeafNodesStartingWith(e,n=>[n.keys,n.value],t)}getKeysOfFirstChildOnEachBranchStartingWith(e,t){let{excludeSelf:n,depthLimit:r,respectOrder:i=!0}=t||{},a=[],l=[],s=p=>{i?a.push(p):l.push(p.keys)},c=this.map,u,d=!1;if(e.length)for(let p=0,f=e.length;p<f;p++){let m=e[p];if(u=c.get(m),!u||!u.map)if(d=!0,p===f-1){d=!0;break}else return[];c=u.map}else if(!n&&c.has(this.emptyKey))return[[]];return u&&u.value!==void 0&&(n||(s({...u,keys:e}),d=!0)),d?i?a.sort(vi).map(p=>p.keys):l:(this.visitWithNext(e,(p,f,m,g,h)=>{s({...h,keys:f})},!1,c,r,n),i?a.sort(vi).map(p=>p.keys):l)}getKeysStartingWith(e,t){let n=[];return this.getStartingWith(e,r=>{n.push(r)},t),n}getStartingWith(e,t,n){let{excludeSelf:r,depthLimit:i}=n||{},a=this.map,l,s=!1;if(e.length)for(let c=0,u=e.length;c<u;c++){let d=e[c];if(l=a.get(d),!l||!l.map)if(s=!0,c===u-1){s=!0;break}else return;a=l.map}l&&l.value!==void 0&&(r||t(e,l.value,{...l,keys:e})),!s&&this.visitWithNext(e,(c,u,d,p,f)=>{t(u,c,{...f,keys:u}),p?.()},!1,a,i,r)}getMapAt(e){let t=this.map,n;if(!e.length)return this.map;for(let r=0,i=e.length;r<i;r++){let a=e[r];if(n=t.get(a),!n||!n.map)return;t=n.map}return t}getAllChildrenSizeFor(e){let t=this.map,n;if(!e.length)return this.length;for(let r=0,i=e.length;r<i;r++){let a=e[r];if(n=t.get(a),!n||!n.map)return 0;t=n.map}return n.length}getDirectChildrenSizeFor(e){let t=this.map;e.length||(e=[this.emptyKey]);for(let n=0,r=e.length;n<r;n++){let i=e[n],a=n===r-1,l=t.get(i);if(!l||!l.map)return 0;if(t=l.map,a)return t?.size??0}return 0}set(e,t){let n=this.map;this.mutations++,e.length||(e=[this.emptyKey]);for(let r=0,i=e.length;r<i;r++){let a=e[r],l=r===i-1,s=n.get(a)||{length:0};l?(s.revision=this.revision++,s.value=t,n.set(a,s),this.length++):(s.map||(s.map=new Map,n.set(a,s)),s.length++,n=s.map)}return this}get(e){let t=this.map;e.length||(e=[this.emptyKey]);for(let n=0,r=e.length;n<r;n++){let i=e[n],a=n===r-1,l=t.get(i);if(a)return l?l.value:void 0;if(!l||!l.map)return;t=l.map}}get size(){return this.length}clear(){let e=t=>{t.forEach((n,r)=>{let{map:i}=n;i&&e(i)}),t.clear()};e(this.map),this.length=0,this.revision=0,this.mutations++}delete(e){let t=this.map;this.mutations++,e.length?e=[...e]:e=[this.emptyKey];let n=[t],r=[],i=!1;for(let a=0,l=e.length;a<l;a++){let s=e[a],c=a===l-1,u=t.get(s);if(c){u&&(u.hasOwnProperty("value")&&(delete u.value,delete u.revision,i=!0,r.forEach(d=>{d.length--}),this.length--),u.map&&u.map.size===0&&delete u.map,u.map||t.delete(s));break}else{if(!u||!u.map){i=!1;break}r.push(u),t=u.map,n.push(t)}}for(;n.length;){let a=n.pop(),l=e.length;if(e.pop(),l>0&&a?.size===0){let s=n[n.length-1],c=e[e.length-1],u=s?.get(c);u&&(delete u.map,u.hasOwnProperty("value")||s.delete(c))}}return i}has(e){let t=this.map;e.length||(e=[this.emptyKey]);for(let n=0,r=e.length;n<r;n++){let i=e[n],a=n===r-1,l=t.get(i);if(a)return l?l.hasOwnProperty("value"):!1;if(!l||!l.map)return!1;t=l.map}return!1}visitKey(e,t,n,r,i){let a=t.get(e);if(!a)return;let{map:l}=a,s=e===this.emptyKey?[]:[...n,e],c=yt(()=>{if(l)for(let[u]of l){let d=this.visitKey(u,l,s,r,i);if(i&&d===!0)return!0}return!1});if(a.hasOwnProperty("value")){let u=r(a,s,c);if(i&&u===!0)return!0}c()}getArray(e){let t=[];return this.visit((n,r)=>{let i=e({...n,keys:r});r.length===0?t.splice(0,0,i):t.push(i)}),t}rawKeysAt(e){let t=this.getMapAt(e);return t?[...t.keys()]:[]}valuesAt(e){let t=this.getMapAt(e);if(!t)return[];let n=[];return t.forEach(r=>{r.value!==void 0&&n.push(r.value)}),n}values(){return this.sortedIterator(e=>e.value)}keys(){return this.sortedIterator(t=>t.keys)}entries(){return this.sortedIterator(e=>[e.keys,e.value])}topDownEntries(){return this.getArray(e=>[e.keys,e.value])}topDownKeys(){return this.getArray(e=>e.keys)}topDownValues(){return this.getArray(e=>e.value)}sortedIterator(e){let t=[];this.visit((r,i)=>{t.push({...r,keys:i})}),t.sort(vi);function*n(){for(let r=0,i=t.length;r<i;r++)yield e(t[r])}return n()}};globalThis.DeepMap=q;function Fe(){return globalThis}var Di=["#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],Eu=Symbol("color"),Pi=new WeakMap,Yl=Ce();function ql(o=Di){Pi.set(o,o.map(e=>0))}ql();var nT=(o=Di)=>{let e=[];Pi.has(o)?e=Pi.get(o):(e=o.map(n=>0),Pi.set(o,e));let t=e.reduce((n,r,i,a)=>r<a[n]?i:n,0);return e[t]!=null&&e[t]++,o[t]??o[0]??Di[0]},Dr=":",Xl="*",Mu="-",rT=",",iT="debug",aT="diffdebug",_u=!1,Pr=new q,xr=new Map;function Zl(o,e){let t=o.split(Dr),n=new q;n.set(t,!0);let r=e.split(Dr),i=new Set(r).has(Xl),a=r.indexOf(Xl),l=i?r.slice(0,a):r;if(n.getKeysStartingWith(l,{excludeSelf:i}).length>0){let s=r.slice(a+1);return s.length?o.endsWith(s.join(Dr)):!0}}function Ou(o,e){let t=`channel=${o}_permissions=${e}`;if(xr.has(t))return xr.get(t);let n=e.split(rT);function r(l){return xr.set(t,l),l}let i=[],a=[];n.forEach(l=>{l.includes(Xl)?a.push(l):i.push(l)});for(let l=0;l<i.length;l++){let s=i[l],c=s.startsWith(Mu);if(c&&(s=s.substring(Mu.length)),Zl(o,s))return r(!c)}for(let l=0;l<a.length;l++){let s=a[l],c=s.startsWith("-");if(c&&(s=s.substring(1)),Zl(o,s))return r(!c)}return r(!1)}var Ql=()=>Ye.enable??(Fe()&&Fe().localStorage?.getItem(iT))??"",lT=()=>Ye.diffenable??(Fe()&&Fe().localStorage?.getItem(aT))??`${_u}`,Jl="",Fu=_u;function es(o){Fu=`${lT()}`=="true",Jl!==o&&(Jl=o,xr.clear())}function Nu(o){es(Ql()),typeof Fe()<"u"&&Fe().addEventListener&&Fe().addEventListener("storage",function(){es(Ql())});function e(t,n){let r=n?`${n}${Dr}${t}`:t,i=r.split(Dr),a=Pr.get(i);if(a)return a;let l=Pr.get(i.slice(0,-1)),s=(l?l.logFn:Ye.logFn)??Lu,c=s,u,d=0,p=()=>u??Ou(r,Jl),f=nT(Ye.colors),m=Object.defineProperties((...g)=>{let h=Yl.getListenersCount(),S;if(h>0&&(S=S??Date.now(),Yl({color:f,channel:r,args:g,timestamp:S})),p()){if(S=S??Date.now(),d&&Fu){let b=S-d;c(`%c[${r}]`,`color: ${f}`,`+${b}ms:`)}d=S;let y=[],T;if(g.forEach(b=>{if(b[Eu])T===void 0&&(T=!0),y.push(...b);else{if(typeof b!="string"&&typeof b!="number"){T=!1;return}y.push(`${b}%s`)}}),T){let b=[`%c[${r}]%c %s`,`color: ${f}`,"",...y,""];c(...b)}else c(`%c[${r}]%c %s`,`color: ${f}`,"",...g)}},{channel:{value:r},color:{value:(g,...h)=>{let S=[`%c${h.join(" ")}%c%s`,`color: ${g}`,""];return S.toString=()=>h.join(" "),S[Eu]=!0,S}},extend:{value:g=>e(g,r)},enabled:{get:()=>p(),set:g=>{u=g}},logFn:{configurable:!1,get:()=>c,set:g=>{c=g??s}},destroy:{value:()=>{Pr.delete(i)}}});return Pr.set(i,m),m}return e(o)}var Lu=console.log.bind(console),Au;Object.defineProperty(Nu,"enable",{get:()=>Au,set:o=>{Au=o,es(Ql())}});var Ye=Nu;Ye.colors=Di;Ye.logFn=Lu;var sT=(o,e)=>Yl.onChange(t=>{if(!t)return;let{channel:n,args:r,color:i,timestamp:a}=t;Zl(n,o)&&e({channel:n,color:i,args:r,timestamp:a})});Ye.onLogIntent=sT;Ye.isChannelEnabled=Ou;Ye.destroyAll=()=>{ql(),ql(Ye.colors),Pr.clear(),xr.clear()};var Lt=o=>{let e=Ye(o?`IT:${o}:TYPE=debug`:"IT:TYPE=debug");return e.logFn=console.log.bind(console),e},xo=o=>{let e=Ye(o?`IT:${o}:TYPE=error`:"IT:TYPE=error");return e.logFn=console.error.bind(console),e},Er=()=>Er;Er.extend=()=>Er;var It=class{constructor(e){this.debug=Er,this.error=Er}};var ku=xo("CSSVariableWatch"),zu=Lt("CSSVariableWatch"),Vu={position:"absolute",pointerEvents:"none",width:"0px",height:"0px",lineHeight:0,fontSize:0,overflow:"hidden"};function Gu(o){return o.startsWith("var(")||o.startsWith("calc(")?o:`var(${o})`}var cT=o=>{let e=(0,ts.useRef)(0),t=tn.useCallback(({height:n})=>{n!=null&&n!==e.current&&(e.current=n,o.onChange(n))},[o.onChange]);wi(o.ref,t,{earlyAttach:!0}),tn.useLayoutEffect(()=>{let n=o.ref.current.getBoundingClientRect().height;if(n!=null)return e.current=n,zu(`Variable ${o.varName} found and equals ${n}.`),o.onChange(n);ku(`Specified variable ${o.varName} not found or does not have a numeric value.`)},[])},Mr=o=>{let e=(0,ts.useRef)(null);cT({...o,ref:e});let t=Gu(o.varName),{allowInts:n=!1}=o;return tn.createElement("div",{"data-name":"css-variable-watcher","data-var":o.varName,style:Vu},tn.createElement("div",{ref:e,style:{height:n?`calc(1px * ${t})`:t}}))};var zn=require("react");function Eo(){let o=null,e=new Set;return{getSnapshot(){return o},setSnapshot(t){o=t},subscribe(t){return e.add(t),()=>{e.delete(t)}},notify(){for(let t of e)t()}}}var uo=require("react");function wt(o,e,t){if(o===e)return!0;if(!o||!e)return!1;let n=typeof o;if(n!==typeof e||n!=="object")return!1;var i=Object.keys(o),a=Object.keys(e);t&&(i=i.filter(u=>!t.has(u)),a=a.filter(u=>!t.has(u)));var l=i.length;if(a.length!==l)return!1;for(var s=0;s<l;s++){var c=i[s];if(!(t&&t.has(c))&&(o[c]!==e[c]||!Object.prototype.hasOwnProperty.call(e,c)))return!1}return!0}function Hu(o,e,t){let n=(0,uo.useRef)(e);n.current=e;let r=(0,uo.useRef)(t);r.current=t;let i=(0,uo.useRef)(void 0),a=(0,uo.useRef)(!1),l=(0,uo.useCallback)(()=>{let s=o.getSnapshot(),c=n.current(s);return a.current&&r.current(i.current,c)?i.current:(i.current=c,a.current=!0,c)},[o]);return(0,uo.useSyncExternalStore)(o.subscribe,l,l)}function xi(o,e){return Hu(o,e,Object.is)}function Ln(o,e){return Hu(o,e,wt)}var Ku=H(require("react")),os;function kn(){return os||(os=Ku.createContext(null))}var Bu=Eo(),Wu=()=>{};function Ei(){let o=kn();return(0,zn.useContext)(o)||void 0}function Mi(){let o=Ei();return(0,zn.useCallback)(()=>o?.getSnapshot(),[o])}function Ai(o){let e=kn(),t=(0,zn.useContext)(e),n=Ln(t||Bu,t?o:Wu);return t?n??void 0:void 0}function Mo(){let o=kn(),e=(0,zn.useContext)(o),n=xi(e||Bu,e?r=>r.masterRowInfo:Wu);return e?n:void 0}var Vn=H(require("react")),lt=require("react");function Ao(o){if(o==null)return!1;let e=o;return!0}var _o=require("react");var _i=require("react"),qt=()=>{let[o,e]=(0,_i.useState)(0);return[o,(0,_i.useCallback)(()=>{e(t=>t+1)},[e])]};var ju=o=>{let e=(0,_o.useCallback)(o,[]),t=(0,_o.useRef)(!1),n=(0,_o.useRef)(!1),r=(0,_o.useRef)(void 0),[i,a]=qt();t.current&&(n.current=!0),(0,_o.useEffect)(()=>(t.current||(r.current=e,t.current=!0),a(),()=>{n.current&&r.current&&r.current()}),[])};var Oi=require("react");function Le(o){let e=(0,Oi.useRef)(o);return e.current=o,(0,Oi.useCallback)(()=>e.current,[])}var Fi=require("react"),Oo=(o,e)=>{let t=(0,Fi.useRef)(e===void 0?o:e);return(0,Fi.useLayoutEffect)(()=>{t.current=o}),t.current};var Ar={DataSource:{track:"DataSource",labels:{RemoteDataLoad:"Remote data load",TreeUnfilteredTreePaths:"Computing unfiltered tree paths",Filter:"Filter",Sort:"Sort",Group:"Group",LazyGroup:"Lazy group",Tree:"Tree",FlattenTree:"Flatten tree",Flatten:"Flatten groups",PrepareData:"Preparing data",ComputeSelectionCount:"Computing selection count",ComputeSelectionCountLazy:"Computing selection count (lazy)",PrepareRowInfo:"Preparing row info array",DiffRowInfoInStore:"setDataArray diffing in RowInfoStore"}},InfiniteTable:{track:"InfiniteTable",labels:{Render:"Rendering"}},MatrixBrain:{track:"Layout Computations",labels:{ComputeRenderRange:"Computing render range"}},ComponentState:{track:"ComponentState",labels:{PropUpdate:"Prop update"}}};var uT="\u200B",ns=class o{constructor(e){this.debugId=e;this.markerDetails={label:"",track:"",trackGroup:void 0,color:void 0,details:[],tooltip:void 0};this.stopped=!1;this.start=e=>{if(this.markerDetails.startTs)return this;let t=performance.now();return this.markerDetails.details=e?.details??[],this.markerDetails.startTs=t,this};this.end=(e={})=>{if(this.stopped)return this;this.stopped=!0;let t=e.startTs??this.markerDetails.startTs,n=e.endTs??this.markerDetails.endTs??performance.now(),r=e.color||this.markerDetails.color||"primary",i=e.trackGroup||this.markerDetails.trackGroup||`Infinite Table (${this.debugId})`,a=[...this.markerDetails.details||[],...e.details||[]],l=e.tooltip||this.markerDetails.tooltip,s=e.label||this.markerDetails.label||"Unknown",c=e.track||this.markerDetails.track||"Unknown",u=uT+s;return performance.measure(u,{start:t,end:n,detail:{devtools:{dataType:"track-entry",trackGroup:i,track:c,color:r,properties:a.length>0?a.map(d=>[d.name,d.value]):void 0,tooltipText:l}}}),performance.clearMeasures(u),this};this.debugId=e}static create(e){return new o(e)}get startTimestamp(){return this.markerDetails.startTs}get track(){let e=this;return Object.keys(Ar).reduce((t,n)=>{let r={start:e.start,end:i=>e.end({...i,track:Ar[n].track,label:i.label}),get label(){let i=Ar[n];return Object.keys(i.labels).reduce((a,l)=>{let s={start:e.start,end:c=>e.end({...c,track:i.track,label:i.labels[l]})};return Object.defineProperty(a,l,{get:()=>(e.markerDetails.label=i.labels[l],s)}),a},{})}};return Object.defineProperty(t,n,{get:()=>{let i=Ar[n];return e.markerDetails.track=i.track,r}}),t},{})}};function st(o){return ns.create(o)}function Uu(o,e){let t=new Set;function n(...r){let i=e?e.getProxyTargetFromArgs(...r):r[0];t.clear();let a={get:function(c,u){return t.add(u),c[u]}},l=new Proxy(i,a),s=e?e.putProxyToArgs(l,...r):[l];return o.apply(this,s)}return{fn:n,propertyReads:t}}var rs=o=>o&&o.substr(0,1).toUpperCase()+o.substr(1);function _r(o){return o!==void 0}function Fo(o,e){let t=e[o];return _r(t)}var $u=(o,e,t)=>{let n=o[e];typeof n=="function"&&n(...t)};function dT(o,e,t){let n={};for(let r in o)if(o.hasOwnProperty(r)){let i=o[r],a=Fo(r,e)?e[r]:e[`default${rs(r)}`];typeof i=="function"&&(a=i(a,t)),n[r]=a}return n}function Yu(o,e,t){let{fn:n,propertyReads:r}=Uu(o,{getProxyTargetFromArgs:a=>a.props,putProxyToArgs:(a,l)=>[{...l,props:a}]}),i=n(e);return r.forEach(a=>t.add(a)),i}function qu(o){let{props:e,initialSetupState:t,propsToForward:n,parentState:r,mapPropsToState:i,propsToStateSet:a}=o,l={};n&&(l=dT(n,e,t));let s={...t,...l};if(i){let c=Yu(i,{props:e,state:s,oldState:null,parentState:r},a);return{...s,...c}}return s}function Xu(o,e,t){let{getProps:n,getParentState:r,mapPropsToState:i,concludeReducer:a,propsToStateSet:l}=t;if(e.type==="REPLACE_STATE")return e.payload;let s=r?.()??null,c=e.payload.mappedState,u=e.payload.updatedPropsToState,d={...o};if(c&&Object.assign(d,c),i){let f=Yu(i,{props:n(),state:d,oldState:o,parentState:s},l);Object.assign(d,f)}return e.type==="ASSIGN_STATE"&&Object.assign(d,e.payload),a?a({previousState:o,state:d,updatedProps:u,parentState:s}):d}function Zu(o){let{dispatch:e,getState:t,getProps:n,propsToForward:r,allowedControlledPropOverrides:i,interceptedActions:a,mappedCallbacks:l,notify:s=$u}=o,c=t();return Object.keys(c).reduce((u,d)=>{let p=d;return Object.defineProperty(u,d,{set:m=>{let g=n(),h=t(),S=!0;if(a&&typeof a[p]=="function"&&a[p](m,{actions:u,state:h})===!1&&(S=!1),S){let b=[m],R=`on${rs(d)}Change`;if(l&&l[p]){let C=l[p](m,h);R=C.callbackName||R,b=C.callbackParams}s(g,R,b)}let y=r[p];typeof y=="function"&&(m=y(m));let T=!!i?.[p];Fo(d,g)&&!T||e({payload:{updatedProps:null,mappedState:{[d]:m}}})}}),u},{})}function Qu(o){let{currentProps:e,prevProps:t,state:n,propsToForward:r,propsToStateSet:i}=o,a={},l=0,s={},c=0,u={},d=0;return new Set([...Object.keys(e),...Object.keys(t)]).forEach(f=>{let m=f,g=t[m],h=e[m];if(m!=="children"&&g!==h&&(u[m]={newValue:h,oldValue:g},d++,Fo(m,e)||Fo(m,t)))if(r.hasOwnProperty(f)){let S=h,y=r[f];typeof y=="function"&&(S=y(h)),n[m]!==S&&(a[m]=S,l++)}else i.has(f)&&(s[m]=e[m],c++)}),{newMappedState:a,newMappedStateCount:l,updatedPropsToState:s,updatedPropsToStateCount:c,rawUpdatedProps:u,rawUpdatedPropsCount:d}}var is;function Ju(){return is||(is=(0,lt.createContext)(null))}function kt(o){let e=o.getParentState||(()=>null);function t(r){let[i]=(0,lt.useState)(()=>o.initSetupState?o.initSetupState(r):{}),a=(0,lt.useRef)(new Set),l=(0,lt.useMemo)(()=>o.forwardProps?o.forwardProps(i,r):{},[i]),s=e(),c=Le(s);function u(){return qu({props:r,initialSetupState:i,propsToForward:l,parentState:s,mapPropsToState:o.mapPropsToState,propsToStateSet:a.current})}let[d]=(0,lt.useState)(u),p=Le(r),f=(w,v)=>Xu(w,v,{getProps:p,getParentState:()=>c?.()??null,mapPropsToState:o.mapPropsToState,concludeReducer:o.concludeReducer,propsToStateSet:a.current}),[m,g]=(0,lt.useReducer)(f,d),h=Le(m),{allowedControlledPropOverrides:S}=o,y=(0,lt.useMemo)(()=>Zu({dispatch:g,getState:h,getProps:p,propsToForward:l,allowedControlledPropOverrides:S,interceptedActions:o.interceptActions,mappedCallbacks:o.mappedCallbacks}),[g,l,S]),T=o.Context??Ju(),b=(0,lt.useMemo)(()=>({componentState:m,componentActions:y,getComponentState:h,replaceState:w=>{g({type:"REPLACE_STATE",payload:w})},assignState:w=>{g({type:"ASSIGN_STATE",payload:w})}}),[m,y,h]),R=Oo(r),C=(0,lt.useRef)(!1);C.current=!1;let I=o.layoutEffect?lt.useLayoutEffect:lt.useEffect;return I(()=>{let w=r,{newMappedState:v,newMappedStateCount:P,updatedPropsToState:E,updatedPropsToStateCount:M,rawUpdatedProps:D,rawUpdatedPropsCount:x}=Qu({currentProps:w,prevProps:R,state:m,propsToForward:l,propsToStateSet:a.current});if(M>0||P>0){let O=m.debugId,F=O?st(O).track.ComponentState.label.PropUpdate.start():void 0,z=o.debugName?typeof o.debugName=="function"?`${o.debugName(w)}:rerender`:`${o.debugName}:rerender`:"rerender";Lt(z)("Triggered by new values for the following props",...Object.keys(v??{}),...Object.keys(E??{})),F&&F.end({label:z,details:[P>0?{name:"Updated properties",value:Object.keys(v).join(", ")}:void 0,M>0?{name:"Updated props",value:Object.keys(E).join(", ")}:void 0,M>0||E?{name:"Details",value:"The time for this marker is not accurate. The marker is only displayed so you can easily identify the props that triggered the rerender."}:void 0].filter(Ao)});let B={payload:{mappedState:P?v:null,updatedPropsToState:M?E:null}};if(C.current=!0,g(B),o.onPropChange){for(var A in D)if(D.hasOwnProperty(A)){let{newValue:Y,oldValue:V}=D[A];o.onPropChange({name:A,newValue:Y,oldValue:V},r,y,m)}}o.onPropsChange&&x&&o.onPropsChange(D,r,y,m)}}),I(()=>{s!=null&&!C.current&&g({type:"PARENT_STATE_CHANGE",payload:{}})},[s]),ju(()=>()=>{o.cleanup?.(h())}),{contextValue:b,ContextComponent:T}}return{ManagedComponentContextProvider:Vn.memo(function(i){let{contextValue:a,ContextComponent:l}=t(i);return Vn.createElement(l.Provider,{value:a},i.children)}),useManagedComponent:t}}function zt(o){return o=o??Ju(),Vn.useContext(o)}var pd=H(require("react"));var St="Infinite",ze={rootClassName:St};var Ni=()=>ze;var ed="_16lm1iw2 _16lm1iw23 _16lm1iw26 _16lm1iw2c _16lm1iw2a",td={center:"_16lm1iw2j",stretch:"_16lm1iw2k",start:"_16lm1iw2l",end:"_16lm1iw2m"};var Ht="_16lm1iw3b _16lm1iw3c _16lm1iw35",od={pointer:"_16lm1iwk",default:"_16lm1iwl",colResize:"_16lm1iwm",grabbing:"_16lm1iwn",grab:"_16lm1iwo"},Gn={flex:"_16lm1iw1p",contents:"_16lm1iw1q",none:"_16lm1iw1r",block:"_16lm1iw1s",grid:"_16lm1iw1t",inlineBlock:"_16lm1iw1u",inlineFlex:"_16lm1iw1v",inlineGrid:"_16lm1iw1w"};var Li={1:"_16lm1iw1c",none:"_16lm1iw1d"},Or={column:"_16lm1iw2f",columnReverse:"_16lm1iw2g",row:"_16lm1iw2h",rowReverse:"_16lm1iw2i"};var nd={0:"_16lm1iw1y","100%":"_16lm1iw1z","50%":"_16lm1iw20"},rd={center:"_16lm1iw30",spaceBetween:"_16lm1iw31",spaceAround:"_16lm1iw32",start:"_16lm1iw33",end:"_16lm1iw34"},id={0:"_16lm1iw26","100%":"_16lm1iw27","50%":"_16lm1iw28",auto:"_16lm1iw29"};var ad={none:"_16lm1iwd"},ld={hidden:"_16lm1iw35",auto:"_16lm1iw36",visible:"_16lm1iw37"};var ki={relative:"_16lm1iw1",absolute:"_16lm1iw2",static:"_16lm1iw3",sticky:"_16lm1iw4",fixed:"_16lm1iw5"};var sd={0:"_16lm1iw23","100%":"_16lm1iw24","50%":"_16lm1iw25"};var cd={none:"_16lm1iw1x"};var ud={visible:"_16lm1iw38",hidden:"_16lm1iw39"};var dd={1:"_16lm1iw1e",10:"_16lm1iw1f",100:"_16lm1iw1g",1e3:"_16lm1iw1h",1e4:"_16lm1iw1i",1e5:"_16lm1iw1j",1e6:"_16lm1iw1k",1e7:"_16lm1iw1l","1k":"_16lm1iw1m","10k":"_16lm1iw1n","100k":"_16lm1iw1o"};function fd(o){let{rootClassName:e}=Ni();return pd.createElement("div",{...o,className:X(`${e}Footer`,ki.relative,Gn.flex,Or.row,o.className)})}var _e=H(require("react")),So=require("react"),fg=require("react-dom");function zi(o){let e={};return Object.keys(o).forEach(t=>{e[t]=t}),e}function Q(o){return o.slice(4,-1)}var hd=H(require("react"));var Hn={expandCollapse:"_1jm33zv0",loading:"_1jm33zv1",done:"_1jm33zv2",clear:"_1jm33zv3",hidden:"_1jm33zv4",filterOperatorContains:"_1jm33zv5",filterOperatorStartsWith:"_1jm33zv6",filterOperatorEndsWith:"_1jm33zv7",filterOperatorEq:"_1jm33zv8",filterOperatorNeq:"_1jm33zv9",filterOperatorGt:"_1jm33zva",filterOperatorGte:"_1jm33zvb",filterOperatorLt:"_1jm33zvc",filterOperatorLte:"_1jm33zvd"},md="_1jm33zvf";var gd={expandCollapse:"expand-collapse",loading:"loading",done:"done",clear:"clear",hidden:"hidden",filterOperatorContains:"filter-operator-contains",filterOperatorStartsWith:"filter-operator-starts-with",filterOperatorEndsWith:"filter-operator-ends-with",filterOperatorEq:"filter-operator-eq",filterOperatorNeq:"filter-operator-neq",filterOperatorGt:"filter-operator-gt",filterOperatorGte:"filter-operator-gte",filterOperatorLt:"filter-operator-lt",filterOperatorLte:"filter-operator-lte"};var ct="InfiniteIcon";var Ve=o=>{let{icon:e,...t}=o,n=o.size??"var(--infinite-icon-size)",r={flex:"none",width:n,height:n,fill:"currentColor",...o.style};return hd.createElement("svg",{viewBox:"0 0 24 24",...t,className:e?X(o.className,Hn[e],ct,`${ct}-${gd[e]}`):o.className,style:r},o.children)};var as=H(require("react"));var Ge={includesOperator:["M11.14 4L6.43 16H8.36L9.32 13.43H14.67L15.64 16H17.57L12.86 4H11.14M12 6.29L14.03 11.71H9.96L12 6.29","M4 18V15H2V20H22V18Z","M20 14V18H2V20H22V14Z"],startsWithOperator:["M11.14 4L6.43 16H8.36L9.32 13.43H14.67L15.64 16H17.57L12.86 4M12 6.29L14.03 11.71H9.96M4 18V15H2V20H22V18Z"],endsWithOperator:["M11.14 4L6.43 16H8.36L9.32 13.43H14.67L15.64 16H17.57L12.86 4M12 6.29L14.03 11.71H9.96M20 14V18H2V20H22V14Z"],eqOperator:["M19,10H5V8H19V10M19,16H5V14H19V16Z"],neqOperator:["M21,10H9V8H21V10M21,16H9V14H21V16M4,5H6V16H4V5M6,18V20H4V18H6Z"],gtOperator:["M5.5,4.14L4.5,5.86L15,12L4.5,18.14L5.5,19.86L19,12L5.5,4.14Z"],gteOperator:["M6.5,2.27L20,10.14L6.5,18L5.5,16.27L16.03,10.14L5.5,4L6.5,2.27M20,20V22H5V20H20Z"],ltOperator:["M18.5,4.14L19.5,5.86L8.97,12L19.5,18.14L18.5,19.86L5,12L18.5,4.14Z"],lteOperator:["M18.5,2.27L5,10.14L18.5,18L19.5,16.27L8.97,10.14L19.5,4L18.5,2.27M5,20V22H20V20H5Z"],done:["m9.55 19-6.725-6.725L5.25 9.85l4.3 4.325 9.225-9.225 2.425 2.4Z"],hidden:["m644-428-58-58q9-47-27-88t-93-32l-58-58q17-8 34.5-12t37.5-4q75 0 127.5 52.5T660-500q0 20-4 37.5T644-428Zm128 126-58-56q38-29 67.5-63.5T832-500q-50-101-143.5-160.5T480-720q-29 0-57 4t-55 12l-62-62q41-17 84-25.5t90-8.5q151 0 269 83.5T920-500q-23 59-60.5 109.5T772-302Zm20 246L624-222q-35 11-70.5 16.5T480-200q-151 0-269-83.5T40-500q21-53 53-98.5t73-81.5L56-792l56-56 736 736-56 56ZM222-624q-29 26-53 57t-41 67q50 101 143.5 160.5T480-280q20 0 39-2.5t39-5.5l-36-38q-11 3-21 4.5t-21 1.5q-75 0-127.5-52.5T300-500q0-11 1.5-21t4.5-21l-84-82Zm319 93Zm-151 75Z"],clear:["M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"]};var yd=o=>as.createElement(Ve,{...o,icon:"filterOperatorContains"},Ge.includesOperator.map(e=>as.createElement("path",{key:e,d:e})));var ls=H(require("react"));var Sd=o=>ls.createElement(Ve,{...o,icon:"filterOperatorEndsWith"},ls.createElement("path",{d:Ge.endsWithOperator[0]}));var ss=H(require("react"));var bd=o=>ss.createElement(Ve,{...o,icon:"filterOperatorEq"},ss.createElement("path",{d:Ge.eqOperator[0]}));var cs=H(require("react"));var Td=o=>cs.createElement(Ve,{...o,icon:"filterOperatorGte"},cs.createElement("path",{d:Ge.gteOperator[0]}));var us=H(require("react"));var Cd=o=>us.createElement(Ve,{...o,icon:"filterOperatorGt"},us.createElement("path",{d:Ge.gtOperator[0]}));var ds=H(require("react"));var Rd=o=>ds.createElement(Ve,{...o,icon:"filterOperatorLte"},ds.createElement("path",{d:Ge.lteOperator[0]}));var ps=H(require("react"));var Id=o=>ps.createElement(Ve,{...o,icon:"filterOperatorLt"},ps.createElement("path",{d:Ge.ltOperator[0]}));var fs=H(require("react"));var wd=o=>fs.createElement(Ve,{...o,icon:"filterOperatorNeq"},fs.createElement("path",{d:Ge.neqOperator[0]}));var ms=H(require("react"));var vd=o=>ms.createElement(Ve,{...o,icon:"filterOperatorStartsWith"},ms.createElement("path",{d:Ge.startsWithOperator[0]}));var ws=H(require("react"));var dt=H(require("react")),Nr=require("react");var Kn=H(require("react")),on=require("react");function pT(o,e){if(typeof o!="object"||!o)return o;var t=o[Symbol.toPrimitive];if(t!==void 0){var n=t.call(o,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(o)}function fT(o){var e=pT(o,"string");return typeof e=="symbol"?e:String(e)}function mT(o,e,t){return e=fT(e),e in o?Object.defineProperty(o,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):o[e]=t,o}function Pd(o,e){var t=Object.keys(o);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(o);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(o,r).enumerable})),t.push.apply(t,n)}return t}function Dd(o){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Pd(Object(t),!0).forEach(function(n){mT(o,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(t)):Pd(Object(t)).forEach(function(n){Object.defineProperty(o,n,Object.getOwnPropertyDescriptor(t,n))})}return o}function xd(o,e){var t={};for(var n in o)t[n]=e(o[n],n);return t}var gT=(o,e,t)=>{for(var n of Object.keys(o)){var r;if(o[n]!==((r=e[n])!==null&&r!==void 0?r:t[n]))return!1}return!0},Se=o=>{var e=t=>{var n=o.defaultClassName,r=Dd(Dd({},o.defaultVariants),t);for(var i in r){var a,l=(a=r[i])!==null&&a!==void 0?a:o.defaultVariants[i];if(l!=null){var s=l;typeof s=="boolean"&&(s=s===!0?"true":"false");var c=o.variantClassNames[i][s];c&&(n+=" "+c)}}for(var[u,d]of o.compoundVariants)gT(u,r,o.defaultVariants)&&(n+=" "+d);return n};return e.variants=()=>Object.keys(o.variantClassNames),e.classNames={get base(){return o.defaultClassName.split(" ")[0]},get variants(){return xd(o.variantClassNames,t=>xd(t,n=>n.split(" ")[0]))}},e};var Ed="_1eexc2a6";var Md=Se({defaultClassName:"_12zfob12c _16lm1iw1z _16lm1iw22 _16lm1iw1p _16lm1iw2h _16lm1iw2j _16lm1iw33",variantClassNames:{filtered:{false:"_12zfob12d",true:"_12zfob12e"},verticalAlign:{start:"_12zfob12f",end:"_12zfob12g",center:"_12zfob12h"},align:{start:"_12zfob12i",end:"_12zfob12j",center:"_12zfob12k"}},defaultVariants:{},compoundVariants:[]}),Ad="_12zfob1q _16lm1iw2 _16lm1iw1k _16lm1iw3b _16lm1iw3c _16lm1iw35",_d=Se({defaultClassName:"_16lm1iw2 _16lm1iw25 _16lm1iw26 _16lm1iwh _16lm1iwf",variantClassNames:{visible:{true:"_12zfob19",false:"_12zfob1a"}},defaultVariants:{},compoundVariants:[]}),Od=Se({defaultClassName:"_12zfob1r",variantClassNames:{rowActive:{false:"_12zfob1s",true:"_12zfob1t"},cellSelected:{false:"_12zfob1u",true:"_12zfob1v"},rowSelected:{false:"_12zfob1w",true:"_12zfob1x",null:"_12zfob1y"},rowDisabled:{false:"_12zfob1z",true:"_12zfob110"},firstRow:{false:"_12zfob111",true:"_12zfob112"},treeNode:{parent:"_12zfob113",leaf:"_12zfob114",false:"_12zfob115"},firstRowInHorizontalLayoutPage:{false:"_12zfob116",true:"_12zfob117"},groupRow:{false:"_12zfob118",true:"_12zfob119"},groupCell:{false:"_12zfob11a",true:"_12zfob11b"},align:{start:"_12zfob11c",end:"_12zfob11d",center:"_12zfob11e"},verticalAlign:{start:"_12zfob11f",end:"_12zfob11g",center:"_12zfob11h"},zebra:{false:"_12zfob11i",even:"_12zfob11j",odd:"_12zfob11k"},dragging:{true:"_12zfob11l",false:"_12zfob11m"},insideDisabledDraggingPage:{true:"_12zfob11n",false:"_12zfob11o"},first:{true:"_12zfob11p",false:"_12zfob11q"},last:{true:"_12zfob11r",false:"_12zfob11s"},groupByField:{true:"_12zfob11t",false:"_12zfob11u"},firstInCategory:{true:"_12zfob11v",false:"_12zfob11w"},lastInCategory:{true:"_12zfob11x",false:"_12zfob11y"},pinned:{start:"_12zfob11z",end:"_12zfob120",false:"_12zfob121"},filtered:{true:"_12zfob122",false:"_12zfob123"}},defaultVariants:{},compoundVariants:[[{pinned:"start",lastInCategory:!0},"_12zfob124"],[{pinned:"end",firstInCategory:!0},"_12zfob125"],[{pinned:!1,lastInCategory:!0},"_12zfob126"]]}),Fd=Se({defaultClassName:"_12zfob1c _16lm1iw1s _16lm1iw2",variantClassNames:{pinned:{start:"_12zfob1d",end:"_12zfob1e",false:"_12zfob1f"},firstInCategory:{true:"_12zfob1g",false:"_12zfob1h"},lastInCategory:{true:"_12zfob1i",false:"_12zfob1j"},overflow:{true:"_12zfob1k",false:"_12zfob1l"}},defaultVariants:{},compoundVariants:[[{overflow:!0,pinned:"start"},"_12zfob1m"],[{pinned:"start",firstInCategory:!0},"_12zfob1n"],[{overflow:!0,pinned:"end"},"_12zfob1o"],[{pinned:"end",lastInCategory:!0},"_12zfob1p"]]}),Nd="_12zfob12u _16lm1iw22 _16lm1iw1z";var Ld="_12zfob17",kd="_12zfob12q _16lm1iw1p _16lm1iw2h _16lm1iw2j _16lm1iw1",zd=Se({defaultClassName:"_12zfob12r _16lm1iw1 _16lm1iw23",variantClassNames:{disabled:{true:"_12zfob12s",false:"_12zfob12t"}},defaultVariants:{},compoundVariants:[]}),gs=Se({defaultClassName:"_12zfob12n _16lm1iw1p _16lm1iw2h _16lm1iw2k _16lm1iw1",variantClassNames:{active:{true:"_12zfob12o",false:"_12zfob12p"}},defaultVariants:{},compoundVariants:[]}),Vd="_12zfob12m _16lm1iw1p _16lm1iw2h _16lm1iw2j",Gd=Se({defaultClassName:"_12zfob127 _16lm1iw1 _16lm1iw1p _16lm1iw2f _16lm1iw32 _16lm1iw39",variantClassNames:{menuVisible:{true:"_12zfob128"},reserveSpaceWhenHidden:{true:"_12zfob129",false:"_12zfob12a"}},defaultVariants:{},compoundVariants:[[{menuVisible:!0,reserveSpaceWhenHidden:!1},"_12zfob12b"]]}),Hd="_12zfob1b _16lm1iw2",Kd="_16lm1iw1",Bd="_12zfob16",Wd=Se({defaultClassName:"_12zfob12",variantClassNames:{align:{start:"_12zfob13",center:"_12zfob14",end:"_12zfob15"}},defaultVariants:{},compoundVariants:[]}),jd="_12zfob12l _16lm1iw35 _16lm1iw1 _16lm1iw1p _16lm1iw2h";var Ud="_1nnkya20 _16lm1iw1p _16lm1iw2f _16lm1iw1 _16lm1iw32 _16lm1iw2j",Vi="_1nnkya21";var $d={transition:"width 0.25s, opacity 0.25s"},lx=Object.keys({size:1,lineWidth:1,lineStyle:1,style:1,className:1,index:1});function Bn(o){let[e,t]=(0,on.useState)(!0),[n,r]=(0,on.useState)(0),{lineWidth:i=1,style:a,className:l,index:s}=o,c=s!=null&&s>0,u=o.size??16,d=Math.floor(u/4),p=[u-1*d,u-2*d,u-3*d],f={...$d,borderTop:`${i}px solid currentColor`,...o.lineStyle,opacity:n};if((0,on.useEffect)(()=>{if(!e)return;let g=requestAnimationFrame(()=>{r(1)});return()=>{cancelAnimationFrame(g)}},[e]),(0,on.useLayoutEffect)(()=>{t(!0)},[]),!e)return null;let m={};return Kn.createElement("div",{"data-name":"filter-icon",style:{...a,width:u},className:X(l,ct,Ud,`${ct}-filter`)},c?Kn.createElement("div",{"data-name":"index",style:m,className:Ld},s):null,Kn.createElement("div",{className:Vi,style:{width:p[0],...f}}),Kn.createElement("div",{className:Vi,style:{width:p[1],...f}}),Kn.createElement("div",{className:Vi,style:{width:p[2],...f}}))}var Gi=Object.freeze({}),hT={string:Gi,number:{}};function Wn(o,e){let t=e.default||Gi;return o.type===void 0?t:o.type===null?Gi:typeof o.type=="string"?e[o.type]||hT[o.type]||Gi:o.type.reduce((n,r)=>Object.assign(n,e[r]),{})}var ys=o=>{let{availableSize:e,items:t,minSize:n,maxSize:r}=o;if(e<0)throw"The provided availableSize cannot be negative!";let i=0,a=0,l=0,s=[],c=[];t.forEach((I,w)=>{let v=I.maxSize??r??void 0,P=I.minSize??n??void 0;s.push(P),c.push(v),I.size!=null&&(v!=null&&I.size>v&&(I.size=v),P!=null&&I.size<P&&(I.size=P));let E=I.flex==0?null:I.flex;if(I.size==null&&E==null)throw`Items must specify either a size or a flex property. Item at index ${w} doesn't have either of those.`;E!=null&&(l+=1),a+=E??0,i+=I.size??0});let u=o.computeSpecialSpaceDistribution?Math.max(e,0):Math.max(e-i,0),d=u/a,p={},f={},m=0;t.forEach((I,w)=>{if(I.flex!=null){let v=d*I.flex,P=I.maxSize??r??void 0,E=I.minSize??n??void 0,M=!1,D=0;P!=null&&v>P&&(p[w]=!0,M=!0,D=P),E!=null&&v<E&&(f[w]=!0,M=!0,D=E),M&&(m+=1,l-=1,a-=I.flex,u-=D)}}),m&&(d=u/a);let g=[],h=0,S=u,y=a,T=0,b=0,R=[];return{items:t.map((I,w)=>{let v={...I},P=I.maxSize??r??void 0,E=I.minSize??n??void 0,M=0,D=p[w],x=f[w],A=D||x,O=I.size??0;if(I.flex!=null){if(A)x&&(M=E),D&&(M=P);else{h+=1;let F=z=>(P!=null&&z>P&&(z=P),E!=null&&z<E&&(z=E),z);h===l?M=F(S):(M=F(Math.round(I.flex*d)),b+=M,S=u-b,y-=I.flex,d=S/y)}O=M,v.flexSize=M}return g.push(M),R.push(O),v.computedSize=O,T+=O,v}),flexSizes:g,minSizes:s,maxSizes:c,computedSizes:R,remainingSize:Math.round(e-T)}};function Hi(o,e,t,n){return e!=null&&o<=e?{value:e,clamped:"min",diff:(o-e)*n}:t!=null&&o>=t?{value:t,clamped:"max",diff:(t-o)*n}:{value:o,clamped:!1,diff:0}}function qd(o,e,t){let n=!1,r=0;for(let i of o)i.computedFlex&&(n=!0),r+=i.computedWidth;return n&&Math.round(r)>Math.round(e-t)}function hs(o,e){return o.computedFlex&&!e?"flex":"width"}function Fr(o,e,t){if(e==="width"){let{flex:n,...r}=o??{};return{...r,width:t}}return{...o,flex:t}}var Ss=o=>{let{availableSize:e,reservedWidth:t=0}=o,n=Object.keys(o.columnSizing).reduce((E,M)=>(E[M]={...o.columnSizing[M]},E),{});if(e<0)throw"The provided availableSize cannot be negative!";let r=o.dragHandleOffset,i=o.dragHandlePositionAfter,a=o.dragHandlePositionAfter+1,l=o.items[i],s=o.items[a],c=l.id,u=s?.id,d=qd(o.items,e,t),p=l.computedWidth,f=l.computedMinWidth,m=l.computedMaxWidth,g=hs(l,d),h=s?.computedWidth,S=s?.computedMinWidth,y=s?.computedMaxWidth,T=s?hs(s,d):"width",b=!1,R=!1,C=r>0?1:-1,{value:I,clamped:w,diff:v}=Hi(Math.round(p+r),f,m,C);if(o.shareSpaceOnResize){if(s==null)return n[c]=Fr(n[c],g,I),R=w==="min",b=w==="max",{adjustedDiff:I-p,reservedWidth:t,columnSizing:n,minReached:R,maxReached:b,constrained:R||b};let{value:E,clamped:M,diff:D}=Hi(Math.round(h-r),S,y,C);if(w&&M&&(Math.abs(v)>Math.abs(D)?M=!1:w=!1),!(!w&&!M)){if(w){let x=Hi(Math.round(h-r-v),S,y,C);E=x.value,M=x.clamped,D=x.diff}else if(M){let x=Hi(Math.round(p+r+D),f,m,C);I=x.value,w=x.clamped,v=x.diff}}n[c]=Fr(n[c],g,I),n[u]=Fr(n[u],T,E),R=w==="min"||M==="min",b=w==="max"||M==="max"}else n[c]=Fr(n[c],g,I),R=w==="min",b=w==="max";let P=I-p;return{adjustedDiff:P,reservedWidth:o.shareSpaceOnResize?t:Math.round(t-P),columnSizing:n,minReached:R,maxReached:b,constrained:R||b}};function Yd(o,e){return o+e}function yT(o){return Object.keys(o).reduce((t,n)=>(t[n]={...o[n]},t),{})}var Xd=o=>{let{availableSize:e,reservedWidth:t=0}=o,n=Object.keys(o.columnSizing).reduce((y,T)=>(y[T]={...o.columnSizing[T]},y),{});if(e<0)throw"The provided availableSize cannot be negative!";let r=o.dragHandleOffset,i=[...new Array(o.columnGroupSize)].map((y,T)=>o.dragHandlePositionAfter-T).reverse(),a=i.map(y=>o.items[y]),l=a.map(y=>y.computedWidth),s=qd(o.items,e,t),c=a.map(y=>hs(y,s)),u=0,{computedSizes:d}=ys({items:a.map(y=>(y.resizable===!1&&(u+=y.computedWidth),{maxSize:y.computedMaxWidth,minSize:y.computedMinWidth,flex:y.resizable?y.computedWidth:null,size:0})),computeSpecialSpaceDistribution:!0,availableSize:Math.max(l.reduce(Yd,0)+r-u,0)}),p=a.map((y,T)=>d[T]-y.computedWidth),f=!0,m=!0,g=!0,h=[];p.forEach((y,T)=>{let b=a[T];if(!b.resizable){h.push(0);return}let R=c[T],C=l[T],I=yT(n),{maxReached:w,minReached:v,constrained:P,adjustedDiff:E}=Ss({availableSize:o.availableSize,reservedWidth:o.reservedWidth,dragHandleOffset:y,dragHandlePositionAfter:i[T],shareSpaceOnResize:!1,items:o.items,columnSizing:I});n[b.id]=Fr(I[b.id],R,Math.round(C+E)),h.push(E),w||(m=!1),v||(f=!1),P||(g=!1)});let S=h.reduce(Yd,0);return{minReached:f,maxReached:m,constrained:g,adjustedDiffs:h,adjustedDiff:S,columnSizing:n,reservedWidth:Math.round(t-S)}};var Ki;function Xt(){if(Ki!=null)return Ki;let o=Fe().document??null;if(!o)return 0;let e=o.createElement("div");e.style.visibility="hidden",e.style.overflow="scroll",o.body.appendChild(e);let t=o.createElement("div");return e.appendChild(t),Ki=e.offsetWidth-t.offsetWidth,e.parentNode?.removeChild(e),Ki}var Zd=["start",void 0,"end"],Qd=(o,e)=>(e&&Object.keys(e).length>0&&o.sort((t,n)=>{let r=e[t],i=e[n];return r===!0&&(r="start"),i===!0&&(i="start"),r==i?0:Zd.indexOf(r)-Zd.indexOf(i)}),o);function Jd(o,e,...t){let n=e;return t.forEach(r=>{for(let i in r)r.hasOwnProperty(i)&&o(r[i],i)&&(n[i]=r[i])}),n}function bs(o,...e){return Jd(t=>t!=null,o,...e)}function ep(o,e,...t){return Jd((n,r)=>!(r in o),e,...t)}var Bi=!0,ST=!0,bT=!0,tp="string",po="unknown";var TT=xo("getComputedVisibleColumns"),CT=(o,e,t)=>o[t]!==!1,Ts=(o,e)=>{if(!e)return!1;let t=e[o];return t==="start"||t===!0?"start":t==="end"?"end":!1};function nn(o,e){if(o)return o[e]?o[e]:Object.values(o).find(t=>t.field===e)}function RT(o,e){let t=Wn(o,e);return o.sortType?o.sortType:t.sortType?t.sortType:typeof o.type=="string"?o.type:tp}function IT(o,e,t){let r=(Array.isArray(o)?o:o?[o]:[]).flatMap(i=>{let a=i.field??i.groupField;if(!a)return[po];let l=nn(e,a);if(!l)return[po];let s=RT(l,t);return Array.isArray(s)?s:[s]});return r.every(i=>i===po)?po:r.length===1?r[0]:r}function Cs(o,e){let{colType:t,sortable:n,columnDefaultSortable:r}=e,i=o.defaultSortable??t.defaultSortable,a=!!o.groupByForColumn;if(i==null&&!a){let l=o.field??t.field,s=o.valueGetter??t.valueGetter;l==null&&s==null&&(i=!1)}return n??i??r??Bi}var op=({columns:o,userColumns:e,bodySize:t,columnMinWidth:n,columnMaxWidth:r,columnDefaultWidth:i,columnDefaultFlex:a,scrollbarWidth:l,columnCssEllipsis:s,columnHeaderCssEllipsis:c,pinnedStartMaxWidth:u,pinnedEndMaxWidth:d,filterValue:p,sortable:f,sortInfo:m,multiSort:g,filterTypes:h=No,viewportReservedWidth:S,resizableColumns:y,draggableColumns:T,columnDefaultDraggable:b,columnOrder:R,columnPinning:C,editable:I,columnDefaultEditable:w,columnDefaultFilterable:v,columnDefaultGroupable:P,columnDefaultSortable:E,columnSizing:M,columnTypes:D,columnVisibility:x,columnVisibilityAssumeVisible:A,groupBy:O})=>{let F=0,z={};O.forEach((G,te)=>{G.field&&(z[G.field]=te)});let L=(p||[]).reduce((G,te)=>{let{id:ye,field:Ie}=te;return Ie&&(G[Ie]=te),ye&&(G[ye]=te),G},{}),B=Qd(R===!0?Object.keys(o):R,C),Y=B.filter(G=>o[G]?CT(x,A,G):(TT(`Column with id "${G}" specified in columnOrder array cannot be found in the columns map.`),!1)),V=new Map,W=Y.map((G,te)=>{let ye=o[G];return V.set(G,te),ye}),N=(m??[]).reduce((G,te,ye)=>(te.id?G[te.id]={sortInfo:te,index:ye}:te.field&&(G[te.field]={sortInfo:te,index:ye}),G),{});function K(G){let te=o[G],ye=Wn(te,D),Ie={minWidth:ye?.minWidth,maxWidth:ye?.maxWidth,width:ye?.defaultWidth,flex:ye?.defaultFlex},ut={width:te?.defaultWidth,flex:te?.defaultFlex,minWidth:te?.minWidth,maxWidth:te?.maxWidth},le=M[G];le?.width!=null&&le.flex==null&&delete ut.flex,le?.flex!=null&&le.width==null&&delete ut.width;let $=bs(ut,le);$.width!=null&&delete Ie.flex,$.flex!=null&&delete Ie.width,$=bs(Ie,$);let tt=$.flex??void 0,ce=$.minWidth??te?.minWidth??n,Ae=$.maxWidth??te?.maxWidth??r,Ze=tt!=null?void 0:$.width??(a?void 0:i);return!Ze&&tt==null&&(a?tt=a:Ze=ce),{size:Ze,flex:tt,minSize:ce,maxSize:Ae}}let ae=ys({availableSize:Math.max(t.width-(S??0)-(l??Xt()),0),maxSize:r,minSize:n,items:Y.map(K)}),{computedSizes:re,flexSizes:ue,minSizes:fe,maxSizes:be}=ae,de=[],U=[],ie=[],ge=[];ge.length=Y.length;let Z=new Map,ee=new Map,j=0,se=0,ne=0,pe=null,k=[],_=0,me=0,Te=0;W.forEach((G,te)=>{let ye=Y[te],Ie=re[te],ut=k[te]=Ts(ye,C);ut==="start"?_+=Ie:ut==="end"?Te+=Ie:me+=Ie});let Pe=t.width-Te,Re=[],Me=new Map;Y.forEach((G,te)=>{let ye=W[te];Me.set(G,ye)});let qe=[];Object.keys(o).forEach(G=>{let te=o[G];qe.push(G),Me.has(G)||Me.set(G,te)});let We=new Map;Me.forEach((G,te)=>{let ye=V.get(te);ye==null&&(ye=-1);let Ie=ye!=-1,ut=Y[ye+1],le=Wn(G,D),$=ye,tt=N[te]?N[te]:G.field?N[G.field]??null:null,ce=tt?.sortInfo??null,Ae=!!ce,Ze=Ae&&ce.dir===1,Rt=Ae&&!Ze,Tu=tt?.index??-1,Wl=Ie?{}:K(te),Cu=Ie?re[ye]:Wl.size||0,Ob=Ie&&ue[ye]||null,Fb=Ie?fe[ye]||0:Wl.minSize||0,Nb=Ie?be[ye]||1e4:Wl.maxSize||1e4,Mt=Ie?Ts(te,C):!1,Ru=Ie?ye===Y.length-1:!1,Ci=$,Lb=Ie?Mt==="start"?se:Mt==="end"?ne:F-se:0;Mt=="start"?Ci=Ie?$:-1:Mt==="end"?Ci=Ie?$-(de.length+ie.length):-1:Ci=Ie?$-de.length:-1;let kb=Ie?Mt==="start"||Mt===!1?F:Pe+ne:-1,zb=Ie?Mt!==pe:!1,Vb=Ie?Ru||Mt!==Ts(ut,C):!1,Iu=G.cssEllipsis??le.cssEllipsis??s,Gb=G.headerCssEllipsis??le.cssEllipsis??G.cssEllipsis??le.headerCssEllipsis??c??Iu,Ri=Ie&&(L[te]||G.field||G.groupByForColumn)&&(L[te]||L[G.field||G.groupByForColumn])||null,Hb=G.defaultFilterable??le.defaultFilterable??v??!0,Kb=I??G.defaultEditable??le.defaultEditable??w??!1,jl=G.dataType||le.dataType||(Array.isArray(G.type)?G.type[0]:G.type)||tp,Bb=G.sortType||le.sortType||jl,wu=G.filterType||le.filterType||jl,vu=!1;if(Ri!=null&&!Ri.disabled){let $l=h[wu];$l&&(!$l.emptyValues||!$l.emptyValues.includes(Ri.filter.value))&&(vu=!0)}let Fn=G.field??le.field,Wb=G.valueGetter??le.valueGetter,Ul=G.defaultGroupable??le.defaultGroupable??P??!!Fn;Fn||(Ul=!1),G.groupByForColumn&&(Ul=!1);let Pu=Fn?z[Fn]!==void 0:!1,jb=Pu?z[Fn]:void 0,Ub=Cs(G,{colType:le,sortable:f,columnDefaultSortable:E}),$b=G.resizable??le.resizable??y??ST,Qe={colType:le,align:le.align,headerAlign:le.headerAlign,computedVisible:Ie,verticalAlign:le.verticalAlign,defaultHiddenWhenGroupedBy:le.defaultHiddenWhenGroupedBy,valueGetter:Wb,valueFormatter:le.valueFormatter,renderValue:le.renderValue,render:le.render,style:le.style,className:le.className,contentFocusable:le.contentFocusable,renderMenuIcon:le.renderMenuIcon,renderSortIcon:le.renderSortIcon,renderRowDetailIcon:le.renderRowDetailIcon,renderSelectionCheckBox:le.renderSelectionCheckBox,renderHeaderSelectionCheckBox:le.renderHeaderSelectionCheckBox,headerStyle:le.headerStyle,headerClassName:le.headerClassName,columnGroup:le.columnGroup,getValueToEdit:le.getValueToEdit,getValueToPersist:le.getValueToPersist,shouldAcceptEdit:le.shouldAcceptEdit,field:Fn,...G,components:{...le.components,...G.components},computedResizable:$b,computedMinWidth:Fb,computedMaxWidth:Nb,computedFlex:Ob,computedDataType:jl,computedEditable:Kb,computedSortType:Bb,computedFilterType:wu,cssEllipsis:Iu,headerCssEllipsis:Gb,computedFilterValue:Ri,computedFiltered:vu,computedFilterable:Hb,computedGroupable:Ul,computedGroupedBy:Pu,computedGroupedByIndex:jb,computedWidth:Cu,computedAbsoluteOffset:kb,computedPinningOffset:Lb,computedVisibleIndexInCategory:Ci,computedOffset:F,computedSortable:Ub,computedSortInfo:ce,computedSortIndex:Tu,computedMultiSort:g,computedSorted:Ae,computedSortedAsc:Ze,computedSortedDesc:Rt,computedVisibleIndex:$,computedPinned:Mt,computedDraggable:T??G.defaultDraggable??b??bT,computedFirstInCategory:zb,computedLastInCategory:Vb,computedFirst:ye===0,computedLast:Ru,id:te,header:G.header??le.header??G.name??G.field};Ie&&(F+=Cu,Z.set(Qe.id,Qe),ge[ye]=Qe,Mt==="start"&&(de.push(Qe),se+=Qe.computedWidth),Mt==="end"&&(U.push(Qe),ne+=Qe.computedWidth),Mt||(ie.push(Qe),j+=Qe.computedWidth),pe=Mt),Qe.groupByForColumn&&(Qe.computedSortType=G.sortType||le.sortType||IT(Qe.groupByForColumn,e,D),Re.push(Qe)),ee.set(Qe.id,Qe),Qe.field&&!Qe.groupByForColumn&&!We.has(Qe.field)&&We.set(Qe.field,Qe)}),Re.forEach(G=>{G.computedSortable=np(G,{fieldsToColumn:We,userColumns:e,columnTypes:D,sortable:f,columnDefaultSortable:E})});let it=new Map;qe.forEach(G=>{let te=ee.get(G);te&&it.set(G,te)}),ee.forEach(G=>{it.has(G.id)||it.set(G.id,G)});let at=u!=null?Math.min(u,se):se,et=d!=null?Math.min(d,ne):ne;return{computedRemainingSpace:t.width-(_+Te+me),computedPinnedStartColumnsWidth:se,computedPinnedEndColumnsWidth:ne,computedUnpinnedColumnsWidth:j,computedColumnOrder:B,computedPinnedStartColumns:de,computedPinnedEndColumns:U,computedUnpinnedOffset:se,computedPinnedEndOffset:se+j,computedUnpinnedColumns:ie,computedVisibleColumns:ge,computedColumnsMap:ee,computedColumnsMapInInitialOrder:it,computedVisibleColumnsMap:Z,computedPinnedEndWidth:et,computedPinnedStartWidth:at,renderSelectionCheckBox:ge.reduce((G,te)=>G||!!te.renderSelectionCheckBox,!1),fieldsToColumn:We}};function np(o,e){let{sortable:t,fieldsToColumn:n,columnDefaultSortable:r,userColumns:i,columnTypes:a}=e;if(t)return t;let l=o.defaultSortable??o.colType.defaultSortable;if(l!=null)return l;let s=r??Bi,c=o.sortType??o.colType.sortType;return c!=null&&c!==po&&s?!0:d=>{let{column:p,api:f}=d,m=p.groupByForColumn||[];return m!=null&&!Array.isArray(m)&&(m=[m]),(m||[]).reduce((g,h)=>{if(!g)return!1;let S=h.field||h.groupField,y;if(S){let T=n.get(S),b=T?f.getColumnApi(T.id):void 0;if(T&&b)y=b.isSortable();else{let R=nn(i,S);if(R){let C=Cs(R,{colType:Wn(R,a??{}),sortable:t,columnDefaultSortable:r});y=typeof C=="boolean"?C:void 0}else y=!1}}return y===void 0&&h.valueGetter&&(y=!0),y??r??Bi},!0)}}function bt(o,e){let{getComputed:t,getState:n,actions:r,api:i}=e;typeof o=="number"&&(o=t().computedVisibleColumns[o]);let a=typeof o=="string"?t().computedColumnsMap.get(o):o;if(!a)return null;let l={getCellValuesByPrimaryKey(s){return e.api.getCellValues({columnId:a.id,primaryKey:s})},getCellValueByPrimaryKey(s){return l.getCellValuesByPrimaryKey(s)?.value??null},toggleContextMenu(s){n().columnMenuVisibleForColumnId===a.id?this.hideContextMenu():this.showContextMenu(s)},toggleFilterOperatorMenu(s){n().filterOperatorMenuVisibleForColumnId===a.id?this.hideFilterOperatorMenu():this.showFilterOperatorMenu(s)},showFilterOperatorMenu(s){n().onFilterOperatorMenuClick({target:s,column:a})},hideFilterOperatorMenu(){i.hideFilterOperatorMenu()},showContextMenu(s){n().onColumnMenuClick({target:s,column:a})},hideContextMenu(){r.columnMenuVisibleForColumnId=null},isVisible(){return t().computedVisibleColumnsMap.has(a.id)},setVisible(s){i.setVisibilityForColumn(a.id,s)},toggleSort(s={multiSortBehavior:"replace"}){return i.toggleSortingForColumn(a.id,s)},isSortable(){let{computedColumnsMap:s}=t();return typeof a.computedSortable=="function"?a.computedSortable({api:i,columnApi:l,column:a,columns:s}):a.computedSortable},getSortDir(){return i.getSortingForColumn(a.id)},setFilter(s){return i.setColumnFilter(a.id,s)},clearFilter(){return i.clearColumnFilter(a.id)},getSortInfo(){return i.getSortInfoForColumn(a.id)},setSort(s){s?i.setSortingForColumn(a.id,s):i.setSortInfoForColumn(a.id,null)},clearSort(){this.setSort(null)},getColumnId(){return a.id},getComputedColumn(){return a}};return l}function rn(o,e,t){let n=typeof o=="string"?e.getComputed().computedColumnsMap.get(o):o,{api:r,getComputed:i,getDataSourceState:a,actions:l,dataSourceActions:s,dataSourceApi:c}=e,u=a(),{allRowsSelected:d,someRowsSelected:p,selectionMode:f}=u,m=i(),g=n.header&&typeof n.header!="function"?n.header:n.name||n.id||"";if(typeof n.header=="function"){let h=bt(n.id,{...e,actions:l,dataSourceActions:s,dataSourceApi:c});g=n.header({horizontalLayoutPageIndex:null,column:n,columnApi:h,dataSourceApi:c,renderLocation:t,dragging:!1,columnsMap:m.computedColumnsMap,columnSortInfo:n.computedSortInfo,columnFilterValue:n.computedFilterValue,filtered:n.computedFiltered,allRowsSelected:d,someRowsSelected:p,selectionMode:f,api:r,renderBag:{header:g}})??null}return g}var rp=H(require("react"));var jn=`${St}HeaderCell__filter`,Wi=`${St}HeaderCell__filterOperator`,Lx=`${jn}__input`;var Rs=rp.createContext(null);var ap=require("react");var ip=require("react"),Is;function ji(){return Is||(Is=(0,ip.createContext)(null))}function oe(o){let e=ji(),t=(0,ap.useContext)(e);return Ln(t,o)}function Ke(){return oe(o=>({getState:o.getState,actions:o.actions,getComputed:o.getComputed,getDataSourceState:o.getDataSourceState,dataSourceApi:o.dataSourceApi,dataSourceActions:o.dataSourceActions,api:o.api,getDataSourceMasterContext:o.getDataSourceMasterContext}))}var wT=`${jn}__input`,Ui=o=>o.stopPropagation();function lp(o){let{filterOperatorMenuVisibleForColumnId:e}=oe(u=>({filterOperatorMenuVisibleForColumnId:u.state.filterOperatorMenuVisibleForColumnId})),{column:t}=Lr(),n=o.filterEditor,r=o.filterOperatorSwitch,[i,a]=(0,Nr.useState)(!1),l=dt.useCallback(()=>{a(!0)},[]),s=dt.useCallback(()=>{a(!1)},[]),c=e===t.id||i;return dt.createElement("div",{onPointerUp:Ui,onPointerDown:Ui,onFocus:l,onBlur:s,className:`${jn} ${gs({active:c})}`,style:{height:o.columnHeaderHeight}},dt.createElement(Rs.Provider,{value:o},dt.createElement(r,null),dt.createElement(n,null)))}function sp(){let{columnApi:o,disabled:e,operator:t}=Un(),n=t?.components?.Icon??Bn;return dt.createElement("div",{"data-name":"filter-operator","data-disabled":e,onMouseDown:r=>{r.stopPropagation(),!e&&o.toggleFilterOperatorMenu(r.target)},className:X(Wi,kd,e?`${Wi}--disabled`:"")},dt.createElement(n,{size:20,className:`${zd({disabled:e})}`}))}function cp(){return dt.createElement("div",{onPointerUp:Ui,onPointerDown:Ui,className:`${jn} ${gs({active:!1})} ${nd["50%"]}`})}function Un(){let o=Ke(),{column:e,columnApi:t}=Lr(),n=rn(e,o,"column-filter"),r=dt.useContext(Rs),{columnFilterType:i,filterTypes:a,columnFilterValue:l}=r,s=a[i],[c,u]=(0,Nr.useState)(l?.filter.value??""),d=dt.useCallback(h=>{u(h),r.onChange(h)},[r.onChange]),p=dt.useCallback(()=>{o.api.clearColumnFilter(e.id)},[e.id]),f=dt.useCallback(()=>{o.api.removeColumnFilter(e.id)},[e.id]);(0,Nr.useEffect)(()=>{if(l)c!==l.filter.value&&u(l.filter.value);else if(s){let h=[...s.emptyValues][0];h!==c&&u(h)}},[l?.filter.value]);let m=r.operator,g=m?.name;return{api:o.api,column:e,columnFilterValue:l,columnApi:t,operatorName:g,operator:m,value:c,disabled:l?.disabled,filterType:s,filterTypes:a,filterTypeKey:i,filtered:e.computedFiltered,setValue:d,clearValue:p,removeColumnFilter:f,ariaLabel:`Filter for ${n}`,className:`${Nd} ${wT}`}}function $n(){let{ariaLabel:o,value:e,setValue:t,className:n,disabled:r}=Un();return ws.createElement("input",{"data-xxx":!0,"aria-label":o,type:"text",disabled:r,value:e,onChange:i=>{t(i.target.value)},className:n})}function $i(){let{ariaLabel:o,value:e,setValue:t,className:n,disabled:r}=Un();return ws.createElement("input",{"aria-label":o,type:"number","data-yyy":!0,disabled:r,value:e??"",onChange:i=>{let a=isNaN(i.target.valueAsNumber)?i.target.value:i.target.valueAsNumber;t(a)},className:n})}var Zt=(o,e)=>{let t=o?.[e];return t?{components:{Icon:t}}:{}};function up(o={}){let{StringFilterEditor:e,NumberFilterEditor:t,icons:n}=o;return{string:{label:"Text",emptyValues:[""],defaultOperator:"includes",components:e?{FilterEditor:e}:void 0,operators:[{name:"includes",...Zt(n,"includes"),label:"Includes",fn:({currentValue:r,filterValue:i})=>typeof r=="string"&&typeof i=="string"&&r.toLowerCase().includes(i.toLowerCase())},{label:"Equals",...Zt(n,"eq"),name:"eq",fn:({currentValue:r,filterValue:i})=>typeof r=="string"&&r===i},{name:"startsWith",...Zt(n,"startsWith"),label:"Starts With",fn:({currentValue:r,filterValue:i})=>r.startsWith(i)},{name:"endsWith",...Zt(n,"endsWith"),label:"Ends With",fn:({currentValue:r,filterValue:i})=>r.endsWith(i)}]},number:{label:"Number",emptyValues:["",null,void 0],defaultOperator:"eq",components:t?{FilterEditor:t}:void 0,operators:[{label:"Equals",...Zt(n,"eq"),name:"eq",fn:({currentValue:r,filterValue:i})=>r==i},{label:"Not Equals",...Zt(n,"neq"),name:"neq",fn:({currentValue:r,filterValue:i})=>r!=i},{name:"gt",label:"Greater Than",...Zt(n,"gt"),fn:({currentValue:r,filterValue:i,emptyValues:a})=>a.includes(r)?!0:r>i},{name:"gte",...Zt(n,"gte"),label:"Greater Than or Equal",fn:({currentValue:r,filterValue:i,emptyValues:a})=>a.includes(r)?!0:r>=i},{name:"lt",...Zt(n,"lt"),label:"Less Than",fn:({currentValue:r,filterValue:i,emptyValues:a})=>a.includes(r)?!0:r<i},{name:"lte",...Zt(n,"lte"),label:"Less Than or Equal",fn:({currentValue:r,filterValue:i,emptyValues:a})=>a.includes(r)?!0:r<=i}]}}}var No=up({StringFilterEditor:$n,NumberFilterEditor:$i,icons:{includes:yd,eq:bd,neq:wd,startsWith:vd,endsWith:Sd,gt:Cd,gte:Td,lt:Id,lte:Rd}});function Yi(o,e,t,n){let r=[...e],i={filtered:o.computedFiltered,first:o.computedFirst,last:o.computedLast,groupByField:!!o.groupByForColumn,firstInCategory:o.computedFirstInCategory,lastInCategory:o.computedLastInCategory,pinned:o.computedPinned||!1,cellSelected:n.cellSelected||!1,rowSelected:n.rowSelected??"null",rowActive:n.rowActive,dragging:n.dragging,insideDisabledDraggingPage:n.insideDisabledDraggingPage,firstRow:n.firstRow??!1,firstRowInHorizontalLayoutPage:n.firstRowInHorizontalLayoutPage??!1,rowDisabled:n.rowDisabled,groupRow:n.groupRow,groupCell:n.groupCell,treeNode:n.treeNode,verticalAlign:n.verticalAlign,align:n.align,zebra:n.zebra},a=t(i);return r.push(a),o.computedFirst&&r.push(...e.map(l=>`${l}--first`)),o.groupByForColumn&&r.push(...e.map(l=>`${l}--group-column`)),o.computedLast&&r.push(...e.map(l=>`${l}--last`)),o.computedFirstInCategory&&r.push(...e.map(l=>`${l}--first-in-category`)),o.computedLastInCategory&&r.push(...e.map(l=>`${l}--last-in-category`)),n.rowSelected===null?r.push(...e.map(l=>`${l}--row-partially-selected`)):n.rowSelected&&r.push(...e.map(l=>`${l}--row-selected`)),n.cellSelected&&r.push(...e.map(l=>`${l}--cell-selected`)),n.firstRow&&r.push(...e.map(l=>`${l}--first-row`)),n.firstRowInHorizontalLayoutPage&&r.push(...e.map(l=>`${l}--first-row-in-horizontal-layout-page`)),n.rowDisabled&&r.push(...e.map(l=>`${l}--disabled`)),n.treeNode&&r.push(...e.map(l=>`${l}--tree-node ${l}-tree-${n.treeNode}-node`)),n.groupRow&&(r.push(...e.map(l=>`${l}--group-row`)),r.push(...e.map(l=>`${l}--${n.rowExpanded?"group-row-expanded":"group-row-collapsed"}`))),o.computedPinned?r.push(...e.map(l=>`${l}--pinned-${o.computedPinned}`)):r.push(...e.map(l=>`${l}--unpinned`)),r.filter(Boolean).join(" ")}var Qn=require("react"),Zp=require("react-dom");function Lo(o,e){let t=o;if(!t)return null;if(t&&t.matches(e))return t;for(;t=t.parentElement;)if(t.matches(e))return t;return null}function dp(o,e,t){let n=o;if(!n)return null;if(n&&n.matches(e))return n;for(;n=n.parentElement;){if(n.matches(e))return n;if(n===t)return null}return null}var J={currentColumnTransformX:"var(--_16hkbkc0)",y:"var(--_16hkbkc1)",currentFlashingBackground:"var(--_16hkbkc2)",currentFlashingDuration:"var(--_16hkbkc3)",activeCellRowOffset:"var(--_16hkbkc4)",activeCellRowOffsetX:"var(--_16hkbkc5)",activeCellRowHeight:"var(--_16hkbkc6)",activeCellOffsetX:"var(--_16hkbkc7)",activeCellOffsetY:"var(--_16hkbkc8)",scrollTopForActiveRow:"var(--_16hkbkc9)",scrollLeftForActiveRowWhenHorizontalLayout:"var(--_16hkbkca)",activeCellColWidth:"var(--_16hkbkcb)",activeCellColOffset:"var(--_16hkbkcc)",columnReorderEffectDurationAtIndex:"var(--_16hkbkcd)",columnWidthAtIndex:"var(--_16hkbkce)",columnOffsetAtIndex:"var(--_16hkbkcf)",columnOffsetAtIndexWhileReordering:"var(--_16hkbkcg)",columnVisibilityAtIndex:"var(--_16hkbkch)",columnZIndexAtIndex:"var(--_16hkbkci)",pinnedStartWidth:"var(--_16hkbkcj)",pinnedEndWidth:"var(--_16hkbkck)",pinnedEndOffset:"var(--_16hkbkcl)",computedVisibleColumnsCount:"var(--_16hkbkcm)",baseZIndexForCells:"var(--_16hkbkcn)",bodyWidth:"var(--_16hkbkco)",bodyHeight:"var(--_16hkbkcp)",scrollbarWidthHorizontal:"var(--_16hkbkcq)",scrollbarWidthVertical:"var(--_16hkbkcr)",scrollLeft:"var(--_16hkbkcs)",scrollTop:"var(--_16hkbkct)"};var qi="true",he={loaded:"var(--infinite-loaded)",themeName:"var(--infinite-theme-name)",themeMode:"var(--infinite-theme-mode)",color:{accent:"var(--infinite-accent-color)",success:"var(--infinite-success-color)",error:"var(--infinite-error-color)",color:"var(--infinite-color)"},spacing:{0:"var(--infinite-space-0)",1:"var(--infinite-space-1)",2:"var(--infinite-space-2)",3:"var(--infinite-space-3)",4:"var(--infinite-space-4)",5:"var(--infinite-space-5)",6:"var(--infinite-space-6)",7:"var(--infinite-space-7)",8:"var(--infinite-space-8)",9:"var(--infinite-space-9)",10:"var(--infinite-space-10)"},fontSize:{0:"var(--infinite-font-size-0)",1:"var(--infinite-font-size-1)",2:"var(--infinite-font-size-2)",3:"var(--infinite-font-size-3)",4:"var(--infinite-font-size-4)",5:"var(--infinite-font-size-5)",6:"var(--infinite-font-size-6)",7:"var(--infinite-font-size-7)"},fontFamily:"var(--infinite-font-family)",baseFontSize:"var(--infinite-font-size)",minHeight:"var(--infinite-min-height)",borderRadius:"var(--infinite-border-radius)",focusOutline:"var(--infinite-focus-outline)",background:"var(--infinite-background)",iconSize:"var(--infinite-icon-size)",rowHeight:"var(--infinite-row-height)",densityScale:"var(--infinite-density-scale)",icons:{expandCollapse:"var(--infinite-icon-expand-collapse)",loading:"var(--infinite-icon-loading)",sortAsc:"var(--infinite-icon-sort-asc)",sortDesc:"var(--infinite-icon-sort-desc)",filter:"var(--infinite-icon-filter)",menu:"var(--infinite-icon-menu)",done:"var(--infinite-icon-done)",clear:"var(--infinite-icon-clear)",hidden:"var(--infinite-icon-hidden)",filterOperatorContains:"var(--infinite-icon-filter-operator-contains)",filterOperatorStartsWith:"var(--infinite-icon-filter-operator-starts-with)",filterOperatorEndsWith:"var(--infinite-icon-filter-operator-ends-with)",filterOperatorEq:"var(--infinite-icon-filter-operator-eq)",filterOperatorNeq:"var(--infinite-icon-filter-operator-neq)",filterOperatorGt:"var(--infinite-icon-filter-operator-gt)",filterOperatorGte:"var(--infinite-icon-filter-operator-gte)",filterOperatorLt:"var(--infinite-icon-filter-operator-lt)",filterOperatorLte:"var(--infinite-icon-filter-operator-lte)"},runtime:{bodyWidth:"var(--infinite-runtime-body-content-width)",totalVisibleColumnsWidthValue:"var(--infinite-runtime-total-visible-columns-width)",totalVisibleColumnsWidthVar:"var(--infinite-runtime-total-visible-columns-width-var)",visibleColumnsCount:"var(--infinite-runtime-visible-columns-count)",browserScrollbarWidth:"var(--infinite-runtime-browser-scrollbar-width)"},components:{GroupingToolbar:{color:"var(--infinite-grouping-toolbar-color)",background:"var(--infinite-grouping-toolbar-background)",rejectBackground:"var(--infinite-grouping-toolbar-reject-background)",activeBackground:"var(--infinite-grouping-toolbar-active-background)",activeBackgroundAlpha:"var(--infinite-grouping-toolbar-active-background-alpha)",padding:"var(--infinite-grouping-toolbar-padding)",border:"var(--infinite-grouping-toolbar-border)",rejectBorder:"var(--infinite-grouping-toolbar-reject-border)",gap:"var(--infinite-grouping-toolbar-gap)"},GroupingToolbarItem:{border:"var(--infinite-grouping-toolbar-item-border)",borderRadius:"var(--infinite-grouping-toolbar-item-border-radius)",activeBorder:"var(--infinite-grouping-toolbar-item-active-border)",background:"var(--infinite-grouping-toolbar-item-background)",activeBackground:"var(--infinite-grouping-toolbar-item-active-background)",activeBackgroundAlpha:"var(--infinite-grouping-toolbar-item-active-background-alpha)"},LoadMask:{padding:"var(--infinite-load-mask-padding)",color:"var(--infinite-load-mask-color)",textBackground:"var(--infinite-load-mask-text-background)",overlayBackground:"var(--infinite-load-mask-overlay-background)",overlayOpacity:"var(--infinite-load-mask-overlay-opacity)",borderRadius:"var(--infinite-load-mask-border-radius)"},Header:{background:"var(--infinite-header-background)",color:"var(--infinite-header-color)",columnHeaderHeight:"var(--infinite-column-header-height)"},HeaderCell:{background:"var(--infinite-header-cell-background)",hoverBackground:"var(--infinite-header-cell-hover-background)",border:"var(--infinite-header-cell-border)",padding:"var(--infinite-header-cell-padding)",paddingX:"var(--infinite-header-cell-padding-x)",paddingY:"var(--infinite-header-cell-padding-y)",iconSize:"var(--infinite-header-cell-icon-size)",menuIconLineWidth:"var(--infinite-header-cell-menu-icon-line-width)",sortIconMargin:"var(--infinite-header-cell-sort-icon-margin)",borderRight:"var(--infinite-header-cell-border-right)",resizeHandleActiveAreaWidth:"var(--infinite-resize-handle-active-area-width)",resizeHandleWidth:"var(--infinite-resize-handle-width)",resizeHandleHoverBackground:"var(--infinite-resize-handle-hover-background)",resizeHandleConstrainedHoverBackground:"var(--infinite-resize-handle-constrained-hover-background)",filterOperatorPaddingX:"var(--infinite-filter-operator-padding-x)",filterEditorPaddingX:"var(--infinite-filter-editor-padding-x)",filterEditorMarginX:"var(--infinite-filter-editor-margin-x)",filterOperatorPaddingY:"var(--infinite-filter-operator-padding-y)",filterEditorPaddingY:"var(--infinite-filter-editor-padding-y)",filterEditorMarginY:"var(--infinite-filter-editor-margin-y)",filterEditorBackground:"var(--infinite-filter-editor-background)",filterEditorBorder:"var(--infinite-filter-editor-border)",filterEditorFocusBorderColor:"var(--infinite-filter-editor-focus-border-color)",filterEditorBorderRadius:"var(--infinite-filter-editor-border-radius)",filterEditorColor:"var(--infinite-filter-editor-color)"},ActiveCellIndicator:{inset:"var(--infinite-active-cell-indicator-inset)"},Cell:{flashingDuration:"var(--infinite-flashing-duration)",flashingAnimationName:"var(--infinite-flashing-animation-name)",flashingOverlayZIndex:"var(--infinite-flashing-overlay-z-index)",flashingBackground:"var(--infinite-flashing-background)",flashingUpBackground:"var(--infinite-flashing-up-background)",flashingDownBackground:"var(--infinite-flashing-down-background)",padding:"var(--infinite-cell-padding)",paddingX:"var(--infinite-cell-padding-x)",paddingY:"var(--infinite-cell-padding-y)",borderWidth:"var(--infinite-cell-border-width)",borderColor:"var(--infinite-cell-border-color)",border:"var(--infinite-cell-border)",borderLeft:"var(--infinite-cell-border-left)",borderRight:"var(--infinite-cell-border-right)",borderTop:"var(--infinite-cell-border-top)",borderInvisible:"var(--infinite-cell-border-invisible)",borderRadius:"var(--infinite-cell-border-radius)",reorderEffectDuration:"var(--infinite-column-reorder-effect-duration)",pinnedBorder:"var(--infinite-pinned-cell-border)",horizontalLayoutColumnReorderDisabledPageOpacity:"var(--infinite-horizontal-layout-column-reorder-disabled-page-opacity)",color:"var(--infinite-cell-color)",selectedBackground:"var(--infinite-selected-cell-background)",selectedBackgroundDefault:"var(--infinite-selected-cell-background-default)",selectedBackgroundAlpha:"var(--infinite-selected-cell-background-alpha)",selectedBackgroundAlphaWhenTableUnfocused:"var(--infinite-selected-cell-background-alpha--table-unfocused)",selectedBorderColor:"var(--infinite-selected-cell-border-color)",selectedBorderWidth:"var(--infinite-selected-cell-border-width)",selectedBorderStyle:"var(--infinite-selected-cell-border-style)",selectedBorder:"var(--infinite-selected-cell-border)",activeBackgroundAlpha:"var(--infinite-active-cell-background-alpha)",activeBackgroundAlphaWhenTableUnfocused:"var(--infinite-active-cell-background-alpha--table-unfocused)",activeBackground:"var(--infinite-active-cell-background)",activeBackgroundDefault:"var(--infinite-active-cell-background-default)",activeBorderColor:"var(--infinite-active-cell-border-color)",activeBorderWidth:"var(--infinite-active-cell-border-width)",activeBorderStyle:"var(--infinite-active-cell-border-style)",activeBorder:"var(--infinite-active-cell-border)"},SelectionCheckBox:{marginInline:"var(--infinite-selection-checkbox-margin-inline)"},ExpandCollapseIcon:{color:"var(--infinite-expand-collapse-icon-color)"},Menu:{background:"var(--infinite-menu-background)",color:"var(--infinite-menu-color)",separatorColor:"var(--infinite-menu-separator-color)",padding:"var(--infinite-menu-padding)",cellPaddingVertical:"var(--infinite-menu-cell-padding-vertical)",cellPaddingHorizontal:"var(--infinite-menu-cell-padding-horizontal)",cellMarginVertical:"var(--infinite-menu-cell-margin-vertical)",itemDisabledBackground:"var(--infinite-menu-item-disabled-background)",itemActiveBackground:"var(--infinite-menu-item-active-background)",itemActiveOpacity:"var(--infinite-menu-item-active-opacity)",itemPressedOpacity:"var(--infinite-menu-item-pressed-opacity)",itemPressedBackground:"var(--infinite-menu-item-pressed-background)",itemDisabledOpacity:"var(--infinite-menu-item-disabled-opacity)",borderRadius:"var(--infinite-menu-border-radius)",shadowColor:"var(--infinite-menu-shadow-color)"},RowDetail:{background:"var(--infinite-rowdetail-background)",padding:"var(--infinite-rowdetail-padding)",gridHeight:"var(--infinite-rowdetail-grid-height)"},Row:{background:"var(--infinite-row-background)",oddBackground:"var(--infinite-row-odd-background)",disabledBackground:"var(--infinite-row-disabled-background)",oddDisabledBackground:"var(--infinite-row-odd-disabled-background)",selectedBackground:"var(--infinite-row-selected-background)",disabledOpacity:"var(--infinite-row-disabled-opacity)",activeBackground:"var(--infinite-active-row-background)",activeBorderColor:"var(--infinite-active-row-border-color)",activeBorderWidth:"var(--infinite-active-row-border-width)",activeBorderStyle:"var(--infinite-active-row-border-style)",activeBorder:"var(--infinite-active-row-border)",activeBackgroundAlpha:"var(--infinite-active-row-background-alpha)",activeBackgroundAlphaWhenTableUnfocused:"var(--infinite-active-row-background-alpha--table-unfocused)",hoverBackground:"var(--infinite-row-hover-background)",selectedHoverBackground:"var(--infinite-row-selected-hover-background)",selectedDisabledBackground:"var(--infinite-row-selected-disabled-background)",groupRowBackground:"var(--infinite-group-row-background)",groupRowColumnNesting:"var(--infinite-group-row-column-nesting)",groupNesting:"var(--infinite-dont-override-group-row-nesting-length)",pointerEventsWhileScrolling:"var(--infinite-row-pointer-events-while-scrolling)"},ColumnCell:{background:"var(--infinite-column-cell-bg-dont-override)"}}},pp="column-header-height";var fp=`.${ze.rootClassName}`;function vs(o){return Lo(o,fp)}var mp=Q(J.scrollLeft),vT=Q(J.scrollTop),PT=Q(J.columnWidthAtIndex),Ps=Q(J.columnOffsetAtIndex),gp=Q(J.columnReorderEffectDurationAtIndex),DT=Q(J.columnOffsetAtIndexWhileReordering),xT=Q(J.columnVisibilityAtIndex),ET=Q(J.columnZIndexAtIndex);function Qt(o,e,t){let n=t?vs(t):document.querySelector(fp);MT(o,e,n)}function MT(o,e,t){if(t){let n=o,r=J[n]?Q(J[n]):o;t.style.setProperty(r,`${e}`)}}function Yn(o,e){if(e)for(var t in o){let n=J[t]?Q(J[t]):t,r=`${o[t]}`;e.style.setProperty(n,r)}}function Ds(o,e,t){Qt(`${Ps}-${o.computedVisibleIndex}`,o.computedPinned?`calc( ${o.computedAbsoluteOffset+e}px + var(${mp}))`:`${o.computedAbsoluteOffset+e}px`,t)}function xs(o,e,t){Qt(`${ET}-${o}`,`${e}`,t)}function kr(o,e,t){Qt(`${DT}-${o}`,typeof e=="number"?`calc( var(${Ps}-${o}) + ${e}px )`:e,t)}function zr(o,e,t){Qt(`${xT}-${o}`,e,t)}function Xi(o,e,t){Qt(`${gp}-${o}`,t??"",e)}function Es(o,e){let t=`${gp}-${o}`;Qt(t,he.components.Cell.reorderEffectDuration,e)}var ve={columnWidths:{get(o){return`var(${this.getVarName(o)})`},getVarName(o){return this.varName.get(o)},varName:{get(o){return`${PT}-${o}`}},set(o,e,t){e=typeof e=="number"?e+"px":e,Qt(this.varName.get(o),e,t)}},columnOffsets:{get(o){return`var(${this.getVarName(o)})`},getVarName(o){return this.varName.get(o)},varName:{get(o){return`${Ps}-${o}`}},set(o,e,t){e=typeof e=="number"?e+"px":e,Qt(this.varName.get(o),e,t)}}};function hp(o,e){Yn({[mp]:`${o.scrollLeft}px`,[vT]:`${o.scrollTop}px`},e)}var yp="_16lm1iw1",Sp="_1yeub2v0 _16lm1iw1 _16lm1iw1p _16lm1iw2f _16lm1iw0",bp="_1yeub2vs",Tp="_1yeub2vr",Cp=Se({defaultClassName:"_1yeub2v2",variantClassNames:{horizontalLayout:{true:"_1yeub2v3",false:"_1yeub2v4"},focused:{true:"_1yeub2v5",false:"_1yeub2v6"},focusedWithin:{true:"_1yeub2v7",false:"_1yeub2v8"},hasPinnedStart:{true:"_1yeub2v9",false:"_1yeub2va"},hasPinnedEnd:{true:"_1yeub2vb",false:"_1yeub2vc"},hasPinnedStartOverflow:{true:"_1yeub2vd",false:"_1yeub2ve"},hasPinnedEndOverflow:{true:"_1yeub2vf",false:"_1yeub2vg"}},defaultVariants:{},compoundVariants:[[{focused:!1,focusedWithin:!1},"_1yeub2vh"]]});var Ms="_1yeub2vp";var AE=Se({defaultClassName:"_1yeub2vl",variantClassNames:{pinned:{start:"_1yeub2vm",end:"_1yeub2vn",false:"_1yeub2vo"}},defaultVariants:{},compoundVariants:[]});var Mp=require("react");var Vr={bodyWidth:{name:Q(he.runtime.bodyWidth),value:""},totalVisibleColumnsWidthValue:{name:Q(he.runtime.totalVisibleColumnsWidthValue),value:""},totalVisibleColumnsWidthVar:{name:Q(he.runtime.totalVisibleColumnsWidthVar),value:""},visibleColumnsCount:{name:Q(he.runtime.visibleColumnsCount),value:""},browserScrollbarWidth:{name:Q(he.runtime.browserScrollbarWidth),value:""}},AT=Q(J.scrollbarWidthHorizontal),Rp=Q(J.scrollbarWidthVertical),_T=Q(J.columnWidthAtIndex),OT=Q(J.columnZIndexAtIndex),Ip=Q(J.scrollLeft),FT=Q(J.activeCellColWidth),wp=Q(J.activeCellColOffset),xp=Q(J.baseZIndexForCells),NT=Q(J.pinnedStartWidth),vp=Q(J.bodyWidth),LT=Q(J.bodyHeight),Pp=Q(J.pinnedEndOffset),Dp=Q(J.pinnedEndWidth),kT=Q(J.computedVisibleColumnsCount);function Zi(o,e){let t="auto",n=o.computedVisibleIndex;return o.computedPinned?o.computedPinned==="start"?t=e.pinnedStartColsCount-o.computedVisibleIndexInCategory:o.computedPinned==="end"&&(t=e.visibleColsCount+o.computedVisibleIndexInCategory):t=-n*10,typeof t=="number"?`calc( var(${xp}) `+(t<0?"-":"+")+` ${Math.abs(t)} )`:"auto"}function Ep(o){let{computedVisibleColumns:e,computedPinnedStartColumns:t,computedPinnedEndColumns:n,computedPinnedStartColumnsWidth:r,computedPinnedEndColumnsWidth:i,computedUnpinnedColumnsWidth:a,bodySize:l,activeCellIndex:s,brain:c,scrollbars:u}=o,d=Xt(),p=[],f=e.reduce((m,g)=>{let h=g.computedVisibleIndex;m[ve.columnWidths.varName.get(h)]=g.computedWidth+"px",m[ve.columnOffsets.varName.get(h)]=g.computedPinned==="start"?`calc( ${g.computedOffset}px + var(${Ip}) )`:g.computedPinned==="end"?`calc( var(${Pp}) ${p.length?"+":""} ${p.map(y=>ve.columnWidths.get(y.computedVisibleIndex)).join(" + ")} + var(${Ip}) )`:`${g.computedOffset}px`;let S=Zi(g,{pinnedStartColsCount:t.length,visibleColsCount:e.length});return m[`${OT}-${h}`]=`${S}`,g.computedPinned==="end"&&p.push(g),m},{});if(l.width&&(f[Vr.browserScrollbarWidth.name]=`${Xt()}px`),f[Vr.bodyWidth.name]=`calc(${J.bodyWidth} - ${J.scrollbarWidthVertical})`,f[Vr.totalVisibleColumnsWidthValue.name]=`${r+i+a}px`,f[Vr.totalVisibleColumnsWidthVar.name]=`calc(${e.map((m,g)=>`var(${_T}-${g})`).join(" + ")})`,f[Vr.visibleColumnsCount.name]=e.length,s!=null){f[FT]=ve.columnWidths.get(s[1]);let m=ve.columnOffsets.get(s[1]);if(c.isHorizontalLayoutBrain){let g=c.getPageIndexForRow(s[0]);f[wp]=g?`calc( ${he.runtime.totalVisibleColumnsWidthVar} * ${g} + ${m})`:m}else f[wp]=m}return f[kT]=e.length,f[AT]=u.horizontal?`${d}px`:"0px",f[Rp]=u.vertical?`${d}px`:"0px",f[NT]="calc( "+t.map(m=>ve.columnWidths.get(m.computedVisibleIndex)).join(" + ")+")",f[Dp]="calc( "+n.map(m=>ve.columnWidths.get(m.computedVisibleIndex)).join(" + ")+")",f[xp]=e.length*10,f[Pp]=`calc( var(${vp}) - var(${Dp}) - var(${Rp}) )`,f[vp]=`${l.width}px`,f[LT]=`${l.height}px`,f}var As=o=>{let e=0;return(...t)=>{e&&cancelAnimationFrame(e),e=requestAnimationFrame(()=>{e=0,o(...t)})}};function Ap(o){let{actions:e,getState:t,focused:n,focusedWithin:r,domRef:i,scrollerDOMRef:a,onBlurWithin:l,onFocusWithin:s,onSelfFocus:c,onSelfBlur:u,bodySize:d,activeCellIndex:p,wrapRowsHorizontally:f,computedPinnedStartColumnsWidth:m,computedPinnedEndColumnsWidth:g,computedPinnedStartColumns:h,computedPinnedEndColumns:S,computedVisibleColumns:y,computedUnpinnedColumnsWidth:T,scrollbars:b,focusedClassName:R,focusedWithinClassName:C,computedPinnedStartOverflow:I,computedPinnedEndOverflow:w,focusedStyle:v,focusedWithinStyle:P,brain:E}=oe(L=>{let{state:B,computed:Y}=L;return{brain:B.brain,actions:L.actions,getState:L.getState,focused:B.focused,focusedWithin:B.focusedWithin,domRef:B.domRef,scrollerDOMRef:B.scrollerDOMRef,onBlurWithin:B.onBlurWithin,onFocusWithin:B.onFocusWithin,onSelfFocus:B.onSelfFocus,onSelfBlur:B.onSelfBlur,bodySize:B.bodySize,activeCellIndex:B.activeCellIndex,wrapRowsHorizontally:B.wrapRowsHorizontally,computedPinnedStartColumnsWidth:Y.computedPinnedStartColumnsWidth,computedPinnedEndColumnsWidth:Y.computedPinnedEndColumnsWidth,computedPinnedStartColumns:Y.computedPinnedStartColumns,computedPinnedEndColumns:Y.computedPinnedEndColumns,computedVisibleColumns:Y.computedVisibleColumns,computedUnpinnedColumnsWidth:Y.computedUnpinnedColumnsWidth,scrollbars:Y.scrollbars,focusedClassName:L.state.focusedClassName,focusedWithinClassName:L.state.focusedWithinClassName,computedPinnedStartOverflow:Y.computedPinnedStartOverflow,computedPinnedEndOverflow:Y.computedPinnedEndOverflow,focusedStyle:L.state.focusedStyle,focusedWithinStyle:L.state.focusedWithinStyle}}),M=(0,Mp.useMemo)(()=>Ep({computedVisibleColumns:y,computedPinnedStartColumns:h,computedPinnedEndColumns:S,computedPinnedStartColumnsWidth:m,computedPinnedEndColumnsWidth:g,computedUnpinnedColumnsWidth:T,bodySize:d,activeCellIndex:p,brain:E,scrollbars:b}),[y,h,S,m,g,T,d,p,E,b]),D=As(L=>{e.focused=L}),x=As(L=>{e.focusedWithin=L}),F={...o,onFocus:L=>{if(o?.onFocus?.(L),L.target===i.current||L.target===a.current){if(t().focused)return;D(!0),c?.(L),r&&(x(!1),l?.(L));return}r||(x(!0),s?.(L))},onBlur:L=>{if(o?.onBlur?.(L),L.target===i.current||L.target===a.current){if(!t().focused)return;D(!1),u?.(L),r&&(x(!1),l?.(L));return}i.current?.contains(L.relatedTarget)||(x(!1),l?.(L))}},z=X(Jt,Sp,f?`${Jt}--horizontal-layout`:null,F?.className,m?`${Jt}--has-pinned-start ${Tp}`:null,g?`${Jt}--has-pinned-end ${bp}`:null,n?`${Jt}--focused`:null,r?`${Jt}--focused-within`:null,n&&R?R:null,r&&C?C:null,I?`${Jt}--has-pinned-start-overflow`:null,w?`${Jt}--has-pinned-end-overflow`:null,Cp({horizontalLayout:!!f,hasPinnedStart:!!m,hasPinnedEnd:!!g,focused:n,focusedWithin:r}));return F.className=z,F.style={...o?.style,...M},n&&v&&Object.assign(F.style,v),r&&P&&Object.assign(F.style,P),F}var Hp=H(an());function Qi(o){return o.map(e=>e instanceof ko?e:new ko(null,[e]))}var ko=class o{constructor(e,t=[]){this.__operands=[];this.__operation=null;this.__operands=t,this.__operation=e}add(...e){return new o("+",[this,...e])}subtract(...e){return new o("-",[this,...e])}minus(...e){return this.subtract(...e)}multiply(...e){return new o("*",[this,...e])}divide(...e){return new o("/",[this,...e])}__get(e){let{__operation:t,__operands:n}=this,r=n.map(a=>zT(a,this)).join(` ${t} `);return(n.length<=1?!0:e?.__operation==="+"||e?.__operation==="-")?r:`(${r})`}done(){let e=this.__get();return`calc${e.startsWith("(")&&e.endsWith(")")?e:`(${e})`}`}};function zT(o,e){return typeof o=="string"||typeof o=="number"?`${o}`:e?o.__get(e):o.done()}var VT=(...o)=>new ko("+",Qi(o)),Op=(...o)=>new ko("-",Qi(o)),GT=(...o)=>new ko("*",Qi(o)),HT=(...o)=>new ko("/",Qi(o)),Gr={add:VT,subtract:Op,minus:Op,multiply:GT,divide:HT};var ln=(o,e,t)=>{if(o=[...o],e===t||o[e]===void 0||o[t]===void 0)return o;let n=o[e];return t<e,o.splice(e,1),o.splice(t,0,n),o};var He=Fe().requestAnimationFrame||(o=>setTimeout(o,16)),Kt=Fe().cancelAnimationFrame||(o=>clearTimeout(o));var Fp=o=>{let e=null,t=null;return{stop(){e!==null&&Kt(e),t!=null&&Kt(t)},scroll(n){e!==null&&Kt(e),t!=null&&Kt(t);let r={offset:100,scrollAmountsPerRaf:[1,1,2,4,6,8,11,15],...o,...n},i=this;function a(){let s=r.scrollOffsetStart+r.offset-r.mousePosition.clientX;if(!(s>0&&s<=r.offset))return!1;let u=r.scrollAmountsPerRaf.length,d=Math.round(r.offset/u),p=0;for(let f=0;f<u;f++)s>(f+1)*d&&(p=r.scrollAmountsPerRaf[f]);return n.scrollLeft=n.scrollLeft-p,e=He(()=>{i.scroll(n)}),!0}function l(){let s=r.mousePosition.clientX-(r.scrollOffsetEnd-r.offset);if(!(s>0&&s<=r.offset))return!1;let u=r.scrollAmountsPerRaf.length,d=Math.round(r.offset/u),p=0;for(let f=0;f<u;f++)s>(f+1)*d&&(p=r.scrollAmountsPerRaf[f]);return n.scrollLeft=n.scrollLeft+p,t=He(()=>{i.scroll(n)}),!0}return!!(a()||l())}}};var je=class o{constructor(e){this.top=0;this.left=0;this.left=e.left,this.top=e.top}static clone(e){return new o(e)}static from(e){return new o(e)}shift(e){return e.top!=null&&(this.top+=e.top),e.left!=null&&(this.left+=e.left),this}getDistanceToPoint(e){let t=e.top-this.top,n=e.left-this.left;return{top:t,left:n}}};function Np(o,e){let t=Math.atan2(o.top-e.top,o.left-e.left);return t<=0&&(t=2*Math.PI+t),t}function Lp(o,e){return Math.sqrt((e.top-o.top)**2+(e.left-o.left)**2)}function KT(o,e,t){let n=Np(o,t),r=Np(e,t);return n===r?Lp(t,e)-Lp(t,o):n-r}function kp(o){if(o.length<3)return o;let[...e]=o,t={top:0,left:0};return o.forEach(n=>{t.top+=n.top,t.left+=n.left}),t.top/=o.length,t.left/=o.length,e.sort((n,r)=>KT(n,r,t)),e}function BT(o){if(o.length<2)return!1;let e=o[0].left,t=o[0].top,n={left:!1,top:!1};for(let r=1,i=o.length;r<i;r++){if(n.left&&n.top)return!1;o[r].left!==e&&(n.left=!0),o[r].top!==t&&(n.top=!0)}return!(n.left&&n.top)}function WT(o,e){if(o.length<2)return o[0]?o[0].left===e.left&&o[0].top===e.top:!1;o=kp(o);let t=o[0],n=o[o.length-1];return t.left===n.left?e.left===t.left&&e.top>=Math.min(t.top,n.top)&&e.top<=Math.max(t.top,n.top):e.top===t.top&&e.left>=Math.min(t.left,n.left)&&e.left<=Math.max(t.left,n.left)}function zp(o,e){if(BT(o))return WT(o,e);o=kp(o);let[t]=o;for(let n=1,r=o.length-1;n<r;n++){let i=o[n],a=o[n+1];if(jT([t,i,a],e))return!0}return!1}function jT(o,e){let[t,n,r]=o,i=e,a=(n.left-t.left)*(r.top-t.top)-(n.top-t.top)*(r.left-t.left);return a*((n.left-t.left)*(i.top-t.top)-(n.top-t.top)*(i.left-t.left))>=0&&a*((r.left-n.left)*(i.top-n.top)-(r.top-n.top)*(i.left-n.left))>=0&&a*((t.left-r.left)*(i.top-r.top)-(t.top-r.top)*(i.left-r.left))>=0}var qn=class{containsPoint(e){return zp(this.getPoints(),e)}contains(e){let t=e.getPoints();for(let n=0,r=t.length;n<r;n++)if(!this.containsPoint(t[n]))return!1;return!0}intersects(e){return this.privateIntersects(e,!1)}privateIntersects(e,t){let n=e.getPoints();for(let r=0,i=n.length;r<i;r++)if(this.containsPoint(n[r]))return!0;return t?!1:e.privateIntersects(this,!0)}};var Xn=class o extends qn{static clone(e){return new o(e)}constructor(e){super(),this.points=e.map(je.clone)}getPoints(){return this.points}shift(e){return this.points.forEach(t=>{t.shift(e)}),this}};function UT(o,e){let t=Math.min(o.left,e.left),n=Math.min(o.top,e.top),r=o.left+o.width,i=e.left+e.width,a=Math.max(r,i),l=o.top+o.height,s=e.top+e.height,c=Math.max(l,s);return new De({top:n,left:t,width:a-t,height:c-n})}var De=class o extends qn{constructor(t){super();this.top=0;this.left=0;this.width=0;this.height=0;this.top=t.top,this.left=t.left,typeof t.width=="number"?(this.width=t.width,this.height=t.height):(this.width=t.right-t.left,this.height=t.bottom-t.top)}static fromDOMRect(t){return new o(t)}static clone(t){return new o(t)}static from(t){return o.clone(t)}static fromPoint(t){return o.from({top:t.top,left:t.left,width:0,height:0})}getMinimumBoundingRectangle(...t){let n=this;for(let r of t)n=UT(n,r);return n}toDOMRect(){return{top:this.top,left:this.left,bottom:this.top+this.height,right:this.left+this.width,height:this.height,width:this.width,x:this.left,y:this.top,toJSON:()=>({top:this.top,left:this.left,bottom:this.top+this.height,right:this.left+this.width,height:this.height,width:this.width,x:this.left,y:this.top})}}containsPoint(t){return new Xn(this.getPoints()).containsPoint(t)}getTopLeft(){return{left:this.left,top:this.top}}getTopRight(){return{left:this.left+this.width,top:this.top}}getBottomLeft(){return{left:this.left,top:this.top+this.height}}getBottomRight(){return{left:this.left+this.width,top:this.top+this.height}}getCenter(){return{left:this.left+this.width/2,top:this.top+this.height/2}}getPoints(){return[this.getTopLeft(),this.getTopRight(),this.getBottomLeft(),this.getBottomRight()].map(je.from)}shift(t){return t.top!=null&&(this.top+=t.top),t.left!=null&&(this.left+=t.left),this}};var _s;function $T(){if(typeof document>"u"||!document.body)return 1/0;let o=document.createElement("div");o.style.cssText="position:absolute;top:0;left:0;width:1px;visibility:hidden;pointer-events:none",document.body.appendChild(o);let e=n=>(o.style.height=`${n}px`,Math.abs(o.getBoundingClientRect().height-n)<1),t=1e6;if(!e(t))return o.remove(),1/0;for(;t<64e6&&e(t*2);)t*=2;return o.remove(),t}function Ji(){return _s===void 0&&(_s=$T()),_s}function ea(o){return o<=4e6?!1:o>Ji()}function Os(o,e){if(!ea(o))return 1;let t=Ji()-e,n=o-e;return t>0&&n>0?n/t:1}function Vp(o){let e=null;return{get value(){let t=o.getScrollPosition(),n=o.getScrollRatio();return n>1&&e!==null&&Math.abs(e-t)<=n?e:(e=null,t)},set value(t){e=t,o.setScrollPosition(t)}}}function Fs(o,e,t=Math.floor){return Math.abs(o-e)<=1e6?e:t(o)}var Gp=10,YT=Q(J.pinnedStartWidth);function Kp(o){let{computedVisibleColumns:e,computedVisibleColumnsMap:t,computedPinnedEndColumns:n,computedPinnedStartColumns:r,dragColumnId:i,infiniteDOMNode:a,brain:l,dragColumnHeaderTargetRect:s,draggableColumnsRestrictTo:c,tableRect:u,acceptDropToReorderRect:d,allowColumnHideOnDrag:p,setProxyPosition:f,setDragColumnOutside:m,getCurrentDragSourceAndTarget:g,groupingToolbarDragListId:h,api:S,horizontalLayoutPageIndex:y,pageWidth:T}=o;function b(Z){let ee=Z==="start"?L:B;return O===z?ee:z===Z?ee+x.computedWidth:O===Z?ee-x.computedWidth:ee}function R(Z){if(Z.columnIndex===A||y!=null)return!0;let ee=e[Z.columnIndex];if(ee.computedPinned)return!0;let j=l.getScrollPosition().scrollLeft,se=ee.computedOffset+(y!=null&&T!=null?T*y:0);return se>=j+b("start")&&se+ee.computedWidth<=j+u.width-b("end")}let C=(Z,ee)=>{let{restrictToParentGroup:j,dragColumn:se}=ee,ne=[];if(Z.forEach(k=>{if(k.computedVisibleIndex===A)return;let _={columnId:k.id,columnIndex:k.computedVisibleIndex,offsetX:k.computedOffset+Math.round(k.computedWidth/2)};R(_)&&ne.push(_)}),j){let _=function(Te,Pe,Re){let Me=Z[Te];Me&&(Me.columnGroup!==se.columnGroup&&Re.add(Me.id),_(Te+Pe,Pe,Re))};var pe=_;let k=se.computedVisibleIndex,me=new Set;_(k-1,-1,me),_(k+1,1,me),ne=ne.filter(Te=>!me.has(Te.columnId))}return ne},w=r.length,v={clientX:Math.round(o.initialMousePosition.clientX),clientY:Math.round(o.initialMousePosition.clientY)},P={left:v.clientX-u.left-(v.clientX-s.left)+Gp,top:v.clientY-u.top-(v.clientY-s.top)+Gp},E=l.getScrollPosition(),M=e.map(Z=>Z.computedVisibleIndex),D=M,x=t.get(i),A=x.computedVisibleIndex,O=x?.computedPinned,F=A,z=O,L=l.getFixedStartColsWidth(),B=l.getFixedEndColsWidth(),Y=v,V={x:0,y:0},W=1,N=0;function K(Z){let ee=Math.round(Z.clientX),j=Math.round(Z.clientY);if(ee===Y.clientX&&j===Y.clientY)return De.from(s).shift({left:V.x,top:V.y});Y={clientX:ee,clientY:j};let ne=l.getScrollPosition().scrollLeft-E.scrollLeft;return V.x=Y.clientX-v.clientX,V.y=Y.clientY-v.clientY,N=V.x+ne,W=N<0?-1:1,f({left:P.left+V.x,top:P.top+V.y}),De.from(s).shift({left:V.x,top:V.y})}function ae(Z){let ee=0;O?O==="start"&&Z.forEach((j,se)=>{ee||e[j]?.computedPinned!=="start"&&(ee=se)}):Z.forEach((j,se)=>{e[j]?.computedPinned==="start"&&(ee=se+1)}),w=ee,re("start",Z,ee)}function re(Z,ee,j){if(Z==="start"){let se=0;for(let ne=0;ne<j;ne++){let pe=ee[ne],k=e[pe];se+=k.computedWidth}Qt(YT,`${se}px`,a)}}function ue(Z){if(Z==null||Z===F)return;if(F===-1&&Z!==-1&&(zr(A,"",a),m(!1)),F=Z,Z===-1){fe(A);return}let ee=ln(M,A,F>A?F-1:F);w=0;let se=new Set;return ee.forEach((ne,pe)=>{let k=D[pe];ne!==k&&se.add(ne),ae(ee)}),D=ee,be(se),{newColumnIndexes:ee,indexesWithTransition:se,pinnedStartCount:w}}function fe(Z){D=D.filter(j=>j!==Z),e.forEach(j=>{let se=j.computedVisibleIndex,ne=se>Z;Es(se,a);let pe="";ne&&(pe=Gr.minus(ve.columnOffsets.get(se),ve.columnWidths.get(Z)).done()),kr(se,pe,a)}),zr(Z,"hidden",a),m(!0)}function be(Z){e.forEach(ee=>{let j=ee.computedVisibleIndex;Z.has(j)?Es(j,a):Xi(j,a);let se=j===A,ne=W===-1?j<F||j>A:j<A||j>=F,pe="";W===-1?pe=se?ve.columnOffsets.get(F):ne?ve.columnOffsets.get(j):Gr.add(ve.columnOffsets.get(j),ve.columnWidths.get(A)).done():pe=ne?ve.columnOffsets.get(j):se?Gr.add(ve.columnOffsets.get(F-1),ve.columnWidths.get(F-1)).minus(ve.columnWidths.get(A)).done():Gr.minus(ve.columnOffsets.get(j),ve.columnWidths.get(A)).done(),kr(j,pe,a)})}let de=u.left+b("start"),U=u.right-b("end"),ie=Fp({scrollOffsetStart:de,scrollOffsetEnd:U}),ge=Vp({getScrollPosition:()=>l.getScrollPosition().scrollLeft,setScrollPosition:Z=>{S.scrollLeft=Z},getScrollRatio:()=>l.getScrollRatio("horizontal")});return K(v),{speedScroller:ie,stop(){ie.stop()},onMove(Z){let ee=K(Z);if(g().dropTargetListId===h||p&&!d.containsPoint(ee.getCenter()))return p&&ue(-1),null;ie.scroll({mousePosition:Y,get scrollLeft(){return ge.value},set scrollLeft(_){ge.value=_}});let j=C(e,{dragColumn:x,restrictToParentGroup:c==="group"}),se=W===-1?x.computedOffset+N:x.computedOffset+x.computedWidth+N,ne=(0,Hp.default)(j,se,({offsetX:_},me)=>_<me?-1:_>me?1:0);ne<0&&(ne=~ne),j.length?ne=j[ne]?j[ne].columnIndex:j[j.length-1].columnIndex+1:(e.length>1&&console.error("No breakpoints available, something is wrong!"),ne=0),ne===A+1&&(ne=A),ue(ne);let pe={};n.forEach(_=>{pe[_.id]="end"});for(let _=0;_<w;_++){let me=D[_],Te=e[me];pe[Te.id]="start"}let k=D.map(_=>e[_].id);return{columnPinning:pe,columnOrder:k}}}}function Ns(o){let{newColumnOrder:e,visibleColumnOrder:t,existingColumnOrder:n,dragColumnId:r}=o;if(t.length!==e.length)return console.warn("new column order cannot contain less columns than the visible column order"),e;let i=t.indexOf(r),a=e.indexOf(r);if(i===a)return n;if(a>i){let l=e.indexOf(r),s=e[l-1],c=n.indexOf(s),u=n.indexOf(r);return ln(n,u,c)}else{let l=e.indexOf(r),s=e[l+1],c=n.indexOf(s),u=n.indexOf(r);return ln(n,u,c)}return e}var ot=H(require("react"));var sn=class{constructor(e){this.listeners={};e&&Object.keys(e).forEach(t=>{this.on(t,e[t])})}on(e,t){return this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(t),()=>this.off(e,t)}once(e,t){let n=((...r)=>{this.off(e,n),t(...r)});return this.on(e,n)}off(e,t){let n=this.listeners[e];if(!n)return;let r=n.indexOf(t);r!==-1&&n.splice(r,1)}emit(e,...t){let n=this.listeners[e];n&&n.slice().forEach(r=>{try{r(...t)}catch(i){console.error(`Error in event handler for event '${String(e)}':`,i)}})}clear(e){this.listeners[e]&&(this.listeners[e]=[])}clearAll(){Object.keys(this.listeners).forEach(e=>{this.listeners[e]=[]})}};var Bp=H(an());var Wp=(o,e)=>{let{offset:t,activeDragSource:n}=o,{orientation:r,draggableItems:i,listId:a,listRectangle:l}=e.getData(),{dragItem:s,listId:c,dragIndex:u,dragRectangle:d}=n,p=c===a,f=je.from(d.getCenter());if(!l.containsPoint(f))return null;e.activeDragSourcePosition="inside";let m=p?r==="horizontal"?t.left>0?1:-1:t.top>0?1:-1:1,g=d.toDOMRect(),h=e.breakpoints,S=Math.round(m===1?r==="horizontal"?g.right-(p?0:g.width/2):g.bottom-(p?0:g.height/2):r==="horizontal"?g.left+(p?0:g.width/2):g.top+(p?0:g.height/2)),y=(0,Bp.default)(h,S,(I,w)=>I-w);y<0&&(y=~y),m===1&&y===u+1&&p&&y--;let T=Math.min(u,y),b=Math.max(u,y),R=p?i.map((I,w)=>{if(w===u&&p)return t;if(w<T||w>=b)return{left:0,top:0};let v=y<=w?1:-1;return r==="horizontal"?{left:Math.round(v*g.width),top:0}:{left:0,top:Math.round(v*g.height)}}):i.map((I,w)=>{let v=y<=w?1:0;return r==="horizontal"?{left:Math.round(v*g.width),top:0}:{left:0,top:Math.round(v*g.height)}}),C={offset:t,dropIndex:y,dragSourceListId:c,dropTargetListId:a,dragIndex:u,outside:!1,items:i,dragItem:s,offsetsForItems:R,dragRect:g,status:"accepted"};return e.acceptsDrop(C)?{event:C,error:null,success:!0}:(C.status="rejected",{event:C,error:"rejected by interaction target",success:!1})},jp=(o,e)=>{let{offset:t,activeDragSource:n}=o,{orientation:r,listId:i,listRectangle:a,draggableItems:l}=e.getData(),{dragRectangle:s,dragItem:c,listId:u}=n,d=je.from(s.getCenter()),p=u===i,f=a.containsPoint(d);if(f&&!(p&&!e.acceptsSelfDrops())||e.activeDragSourcePosition==="outside"&&!p)return null;e.activeDragSourcePosition="outside";let m=p?n.dragIndex:-1,g=s.toDOMRect(),h={offset:t,dropIndex:-1,dragIndex:m,dragItem:c,outside:!f,items:l,dragSourceListId:u,dropTargetListId:i,offsetsForItems:p?l.map((S,y)=>S.id===c.id?t:f?{left:0,top:0}:y>m&&!e.getData().preserveDragSpace?r==="horizontal"?{left:-c.rect.width,top:0}:{left:0,top:-c.rect.height}:{left:0,top:0}):l.map(S=>({left:0,top:0})),dragRect:g,status:"accepted"};return e.acceptsDrop(h)?{event:h,error:null,success:!0}:(h.status="rejected",{event:h,error:"rejected by interaction target",success:!1})};var xe=class xe{static startDrag(e,t){let n=e instanceof Zn?e:new Zn(e),r=new Ls({activeDragSource:n,startPoint:t});return xe.currentDragOperation=r,r.on("start",xe.onDragStart),r.on("move",xe.onDragMove),r.on("drop",xe.onDragDrop),r.start(),r}static retriggerMove(){let e=xe.currentDragOperation;e&&e.phase==="move"&&xe.onDragMove(e)}static emit(e,...t){xe.emitter.emit(e,...t)}static on(e,t){return xe.emitter.on(e,t)}static registerDragInteractionTarget(e){let{listId:t}=e,n=xe.dragInteractionTargetsMap.get(t);if(n&&n!==e){console.warn(`DragInteractionTarget with listId ${t} already registered`);return}return n||(xe.dragInteractionTargetsMap.set(t,e),xe.emit("register",e)),()=>{xe.unregisterDragInteractionTarget(e)}}static unregisterAll(){xe.dragInteractionTargetsMap.forEach(e=>{xe.unregisterDragInteractionTarget(e)})}static unregisterDragInteractionTarget(e){if(!e)return;let{listId:t}=e;xe.dragInteractionTargetsMap.get(t)===e&&(xe.dragInteractionTargetsMap.delete(t),e.unregister(),xe.emit("unregister",e))}static onDragStart(e){let{dragItem:t,dragIndex:n}=e.activeDragSource,r=e.activeDragSource.listId,a=xe.dragInteractionTargetsMap.get(r)?.getData().acceptDropsFrom,s=!a||a.includes(r)?r:null;xe.dragInteractionTargetsMap.forEach(c=>{let u=c.getData();c.start({dragIndex:u.listId===r?n:-1,dragItem:t,dragSourceListId:r,dropTargetListId:s})}),xe.emitter.emit("drag-start",{dragSourceListId:r,dropTargetListId:s,dragItem:t,dragIndex:n})}static withDragMove(e,t){let{activeDragSource:n}=e,{listId:r}=n,i=[],a=!0,l=xe.dragInteractionTargetsMap.get(r);l&&(a=l.acceptsSelfDrops(),a&&i.push(xe.dragInteractionTargetsMap.get(r))),xe.dragInteractionTargetsMap.forEach(s=>{s.listId!==r&&i.push(s)});for(let s of i){let c=Wp(e,s);if(c){t(s,c),i.splice(i.indexOf(s),1);break}}a||i.unshift(l);for(let s of i){let c=jp(e,s);c&&t(s,c)}}static onDragMove(e){let{activeDragSource:t}=e,{listId:n,dragItem:r}=t,i=null,a=[];xe.withDragMove(e,(c,{event:u})=>{c.move(u),a.push(u),u.outside||(i=u)});let l=i??a[0]??null,s=l?.dropTargetListId??null;xe.emit("drag-move",{dragSourceListId:n,dropTargetListId:s,items:l?.items??[],dragItem:r,status:l?.status??"accepted",dragIndex:l?.dragIndex??-1,dropIndex:l?.dropIndex??-1})}static onDragDrop(e){let{activeDragSource:t}=e,{listId:n,dragItem:r}=t,i=null,a=[];xe.withDragMove(e,(s,{event:c})=>{e.cancelled&&(c={...c,dropTargetListId:null,dropIndex:-1,outside:!1}),s.drop(c),a.push(c),c.outside||(i=c)});let l=i??a[0]??null;xe.emit("drag-drop",{dragSourceListId:n,dropTargetListId:l?.dropTargetListId??null,items:l?.items??[],dragItem:r,status:l?.status??"accepted",dragIndex:l?.dragIndex??-1,dropIndex:l?.dropIndex??-1}),xe.currentDragOperation=null,xe.unregisterAll()}};xe.dragInteractionTargetsMap=new Map,xe.currentDragOperation=null,xe.emitter=new sn;var pt=xe,Zn=class o{static clone(e){let t=e.getData();return new o(t)}constructor(e){this.setData(e)}get listId(){return this.data.listId}get dragIndex(){return this.data.dragIndex??-1}get dragItem(){return this.data.dragItem}setData(e){wt(this.data,e)||(this.data=e,this.dragRectangle=new De(this.data.dragItem.rect))}getData(){return this.data}static shift(e,t){let n=o.clone(e),r=De.from(n.dragRectangle);return r.shift(t),n.dragRectangle=r,n}},Ls=class extends sn{constructor(t){super(t.listeners);this.phase="start";this.cancelled=!1;this.currentOffset={top:0,left:0};this.initialDragSource=Zn.clone(t.activeDragSource),this.activeDragSource=this.initialDragSource,this.startPoint={top:Math.round(t.startPoint.top),left:Math.round(t.startPoint.left)}}get offset(){return this.currentOffset}start(){let{listId:t,dragItem:n}=this.activeDragSource,r={dragSourceListId:t,dragItemId:n.id,startPoint:this.startPoint};return this.emit("start",this,r),r}drop(){this.phase="drop",this.emit("drop",this)}cancel(){this.cancelled=!0,this.drop()}move(t){if(this.phase!=="start"&&this.phase!=="move")return;this.phase="move";let n={top:Math.round(t.top-this.startPoint.top),left:Math.round(t.left-this.startPoint.left)};this.activeDragSource=Zn.shift(this.initialDragSource,n),this.currentOffset=n,this.emit("move",this)}};globalThis.DragManager=pt;var Up=require("react"),$p=ot.createContext({dragSourceListId:null,dropTargetListId:null,dragItemId:"",status:"accepted",updateDragOperationSourceAndTarget:o=>{},getCurrentDragSourceAndTarget:()=>({dragSourceListId:null,dropTargetListId:null,status:"accepted",dragItemId:""})}),fo=()=>ot.useContext($p),Yp=ot.createContext(""),cn=o=>{let e=ot.useContext(Yp);return e?`${o}-${e}`:o},ta=o=>{let[e,t]=ot.useState({dragSourceListId:null,dropTargetListId:null,dragItemId:"",status:"accepted"}),n=ot.useId(),r=ot.useRef(e);r.current=e;let i=ot.useCallback(()=>{let l=r.current;return{dragSourceListId:l.dragSourceListId,dropTargetListId:l.dropTargetListId,dragItemId:l.dragItemId,status:l.status}},[]),a=ot.useMemo(()=>({dragSourceListId:e.dragSourceListId,dropTargetListId:e.dropTargetListId,dragItemId:e.dragItemId,status:e.status,updateDragOperationSourceAndTarget:t,getCurrentDragSourceAndTarget:i}),[e,t]);return(0,Up.useEffect)(()=>{let l=pt.on("drag-start",u=>{t({dragSourceListId:u.dragSourceListId,dropTargetListId:u.dropTargetListId,dragItemId:u.dragItem.id,status:"accepted"})}),s=pt.on("drag-move",u=>{let d=r.current,p={dragSourceListId:u.dragSourceListId,dropTargetListId:u.dropTargetListId,dragItemId:u.dragItem.id,status:u.status};JSON.stringify(d)!==JSON.stringify(p)&&t(p)}),c=pt.on("drag-drop",()=>{t({dragSourceListId:null,dropTargetListId:null,dragItemId:"",status:"accepted"})});return()=>{l(),s(),c()}},[pt,t]),ot.createElement(Yp.Provider,{value:n},ot.createElement($p.Provider,{value:a},typeof o.children=="function"?o.children(a):o.children))};var oa="header",na="grouping-toolbar";var ks=`${St}Body`,qp=o=>o.querySelector(`.${ks}`);var un=`${St}HeaderCell`,zs=`${St}HeaderWrapper`,Xp=o=>Array.from(o.querySelectorAll(`.${zs}`));function Hr(o){if(!o)return!1;let e=o.tagName;return e==="INPUT"||e==="BUTTON"}var qT=Q(J.baseZIndexForCells),XT=(o,e)=>{let t=!o||Object.keys(o).length===0,n=!e||Object.keys(e).length===0;return t&&n?!0:!!o!=!!e?!1:wt(o,e)},Qp=({columnId:o,domRef:e,horizontalLayoutPageIndex:t,allowColumnHideOnDrag:n})=>{let[r,i]=(0,Qn.useState)(null),[a,l]=(0,Qn.useState)(!1),{getCurrentDragSourceAndTarget:s}=fo(),c=cn(na),{getComputed:u,getState:d,api:p,computedDraggable:f,rootRef:m,actions:g}=oe(y=>({actions:y.actions,getComputed:y.getComputed,getState:y.getState,api:y.api,computedDraggable:y.computed.computedVisibleColumnsMap.get(o)?.computedDraggable,rootRef:y.state.domRef})),h=(0,Qn.useCallback)(y=>{let T=u().computedVisibleColumnsMap.get(o);if(!T||!T.computedSortable)return;let{multiSortBehavior:b}=d();p.toggleSortingForColumn(o,{multiSortBehavior:b==="replace"&&(y.ctrlKey||y.metaKey)?"append":b})},[]),S=(0,Qn.useCallback)(y=>{if(Hr(y.target))return;let{brain:T,draggableColumnsRestrictTo:b}=d(),{computedVisibleColumns:R,computedVisibleColumnsMap:C,computedPinnedStartColumns:I,computedUnpinnedColumns:w,computedPinnedEndColumns:v}=u(),P=C.get(o);if(!P.computedDraggable){h(y);return}let E=e.current,M=E.getBoundingClientRect(),D=m.current.getBoundingClientRect(),x=T.getAvailableSize(),A=P.computedVisibleIndex,O=T.getVirtualColIndex(P.computedVisibleIndex,{pageIndex:t||0}),F=T.isHorizontalLayoutBrain?T.getPageWidth():null,z=E.style.cursor??"auto",L=!1,B=m.current,Y=De.from(qp(B).getBoundingClientRect()),V=Xp(B).map(de=>De.from(de.getBoundingClientRect())),W=Y.getMinimumBoundingRectangle(...V),N=Kp({brain:T,horizontalLayoutPageIndex:t,allowColumnHideOnDrag:n,pageWidth:F,draggableColumnsRestrictTo:b,computedPinnedEndColumns:v,computedPinnedStartColumns:I,computedUnpinnedColumns:w,computedVisibleColumns:R,computedVisibleColumnsMap:C,dragColumnHeaderTargetRect:M,dragColumnId:o,getCurrentDragSourceAndTarget:s,groupingToolbarDragListId:c,api:p,infiniteDOMNode:m.current,setProxyPosition:i,setDragColumnOutside:l,tableRect:D,acceptDropToReorderRect:W,initialMousePosition:{clientX:y.clientX,clientY:y.clientY}}),K=null,ae,re;function ue(de){let{columnPinning:U,columnOrder:ie}=de;XT(d().columnPinning,U)||(g.columnPinning=U);let ge=u().computedColumnOrder;JSON.stringify(ie,ge)&&(g.columnOrder=Ns({newColumnOrder:ie,visibleColumnOrder:u().computedVisibleColumns.map(Z=>Z.id),existingColumnOrder:ge,dragColumnId:o}))}let fe=de=>{let{headerBrain:U,brain:ie}=d();if(!L){L=!0;let ge=ie.keepColumnRendered(O),Z=U.keepColumnRendered(O);if(ie.isHorizontalLayoutBrain){let j=ie.extendRenderRange({start:!0,end:!0,direction:"horizontal"}),se=U.extendRenderRange({start:!0,end:!0,direction:"horizontal"});re=()=>{j(),se()}}ae=()=>{ge(),Z()},g.columnReorderDragColumnId=P.id,t!=null&&(g.columnReorderInPageIndex=t),xs(A,`calc( var(${qT}) + 10000 )`,m.current),m.current?.classList.add(Ms),E.style.cursor="grabbing"}K=N.onMove(de)},be=de=>{let U=de.pointerId;requestAnimationFrame(()=>{let{multiSortBehavior:ie}=d(),ge=m.current;ge?.classList.remove(Ms),N.stop(),T.update({...x}),ae?.(),re?.(),E.style.cursor=z,E.hasPointerCapture?.(U)&&E.releasePointerCapture(U),E.removeEventListener("pointermove",fe),E.removeEventListener("pointerup",be),i(null);let Z=p.getColumnApi(P.id)?.isSortable()??!1;!L&&Z&&p.toggleSortingForColumn(P.id,{multiSortBehavior:ie==="replace"&&(de.ctrlKey||de.metaKey)?"append":ie}),(0,Zp.flushSync)(()=>{K?ue(K):L&&n&&p.setVisibilityForColumn(P.id,!1),g.columnReorderDragColumnId=!1,t!=null&&(g.columnReorderInPageIndex=null)}),R.forEach(ee=>{Xi(ee.computedVisibleIndex,ge),zr(ee.computedVisibleIndex,"",ge),kr(ee.computedVisibleIndex,"",ge)}),xs(A,Zi(P,{pinnedStartColsCount:I.length,visibleColsCount:R.length}),ge)})};E.addEventListener("pointermove",fe),E.addEventListener("pointerup",be),E.setPointerCapture(y.pointerId)},[o,t,c]);return{onPointerDown:f?S:h,dragColumnOutside:a,proxyPosition:r}};var rr=H(require("react"));var we=H(require("react")),ke=require("react");var ef=Symbol("REPAINT_CELLS_KEY_NO_ROW");function tf(o){return typeof o=="function"}function Jp(o,e){let{column:t,rowIndex:n,rowInfoStore:r,getDataSourceState:i}=e,a=r.getRowInfoAtIndex(n);if(!a)return ef;let l=r.getDataSourceStates();return o({rowInfo:a,column:t,dataSourceState:l.dataSourceState??i(),previousDataSourceState:l.previousDataSourceState})}function of(o,e,t){let n=Jp(o,e);return e.rowInfoStore.subscribeToDataArrayChange(()=>{let r=Jp(o,e);r!==ef&&(Object.is(r,n)||(n=r,t()))})}var nf="_1eexc2a7 _1eexc2a6",rf=Se({defaultClassName:"_1eexc2an",variantClassNames:{dragging:{false:"_1eexc2ao",true:"_1eexc2ap"},insideDisabledDraggingPage:{true:"_1eexc2aq",false:"_1eexc2ar"},cellSelected:{false:"_1eexc2as",true:"_1eexc2at"},treeNode:{parent:"_1eexc2au",leaf:"_1eexc2av",false:"_1eexc2aw"},align:{start:"_1eexc2ax",end:"_1eexc2ay",center:"_1eexc2az"},verticalAlign:{start:"_1eexc2a10",end:"_1eexc2a11",center:"_1eexc2a12"},rowActive:{false:"_1eexc2a13",true:"_1eexc2a14"},groupRow:{false:"_1eexc2a15",true:"_1eexc2a16"},groupCell:{false:"_1eexc2a17",true:"_1eexc2a18"},rowDisabled:{false:"_1eexc2a19",true:"_1eexc2a1a"},zebra:{false:"_1eexc2a1b",even:"_1eexc2a1c",odd:"_1eexc2a1d"},rowSelected:{true:"_1eexc2a1e",false:"_1eexc2a1f",null:"_1eexc2a1g"},first:{true:"_1eexc2a1h",false:"_1eexc2a1i"},last:{true:"_1eexc2a1j",false:"_1eexc2a1k"},groupByField:{true:"_1eexc2a1l",false:"_1eexc2a1m"},firstInCategory:{true:"_1eexc2a1n",false:"_1eexc2a1o"},firstRow:{true:"_1eexc2a1p",false:"_1eexc2a1q"},firstRowInHorizontalLayoutPage:{true:"_1eexc2a1r",false:"_1eexc2a1s"},lastInCategory:{true:"_1eexc2a1t",false:"_1eexc2a1u"},pinned:{start:"_1eexc2a1v",end:"_1eexc2a1w",false:"_1eexc2a1x"},filtered:{true:"_1eexc2a1y",false:"_1eexc2a1z"}},defaultVariants:{},compoundVariants:[[{firstRowInHorizontalLayoutPage:!0,firstRow:!1},"_1eexc2a20"],[{pinned:"start",lastInCategory:!0},"_1eexc2a21"],[{pinned:"start",firstInCategory:!0},"_1eexc2a22"],[{pinned:"end",firstInCategory:!0},"_1eexc2a23"],[{pinned:"end",lastInCategory:!0},"_1eexc2a24"],[{align:"center",groupCell:!1},"_1eexc2a25"],[{rowDisabled:!0,zebra:"odd"},"_1eexc2a26"]]}),af=Se({defaultClassName:"_1eexc2ae",variantClassNames:{right:{true:"_1eexc2af",false:"_1eexc2ag"},left:{true:"_1eexc2ah",false:"_1eexc2ai"},top:{true:"_1eexc2aj",false:"_1eexc2ak"},bottom:{true:"_1eexc2al",false:"_1eexc2am"}},defaultVariants:{},compoundVariants:[]});var lf="_1eexc2a5",ra=Se({defaultClassName:"_1eexc2aa",variantClassNames:{direction:{up:"_1eexc2ab",down:"_1eexc2ac",neutral:"_1eexc2ad"}},defaultVariants:{},compoundVariants:[]}),Jn="_1eexc2a8";var ia=H(require("react")),aa=require("react");var sf="qz8ht90 _16lm1iwk";function ZT(){return{checked:1,disabled:o=>o??!1,domProps:1}}var{ManagedComponentContextProvider:QT}=kt({forwardProps:ZT,mappedCallbacks:{checked:o=>({callbackName:"onChange",callbackParams:[o]})},debugName:"InfiniteCheckBox"});function JT(){let{componentState:o,componentActions:e}=zt(),{checked:t,domProps:n,disabled:r}=o,i=(0,aa.useRef)(null);return(0,aa.useEffect)(()=>{i.current.indeterminate=t==null},[t]),ia.createElement("input",{...n,className:X("InfiniteCheckBox",sf,n?.className),type:"checkbox",ref:i,checked:!!t,disabled:r,onChange:()=>{r||(e.checked=!t)}})}function zo(o){return ia.createElement(QT,{...o},ia.createElement(JT,null))}var eC="*",Ue=class{constructor(e){this.wildcard=eC;this.cache=new q;this.selectedRowsToColumns=new Map;this.selectedColumnsToRows=new Map;this.deselectedRowsToColumns=new Map;this.deselectedColumnsToRows=new Map;this.defaultSelection=!1;this.debugId="";this.deselectAll=()=>{this.update({defaultSelection:!1,selectedCells:[]})};this.selectAll=()=>{this.update({defaultSelection:!0,deselectedCells:[]})};let t=e&&e instanceof Object.getPrototypeOf(this).constructor?e.getState():e;t&&this.update(t)}selectCell(e,t){this.setCellSelected(e,t,!0)}deselectCell(e,t){this.setCellSelected(e,t,!1)}selectColumn(e){this.setCellSelected(this.wildcard,e,!0)}deselectColumn(e){this.setCellSelected(this.wildcard,e,!1)}setCellSelected(e,t,n){let r=e===this.wildcard,i=t===this.wildcard;if(this.isCellSelected_Internal(e,t)===n)return;let l=[];if(r){let c=this.deselectedColumnsToRows.get(t),u=this.selectedColumnsToRows.get(t);c?.forEach(d=>{d!==this.wildcard&&this.setCellInDeselection(d,t,!1)}),u?.forEach(d=>{d!==this.wildcard&&this.setCellInSelection(d,t,!1)}),[...this.cache.keys()].forEach(d=>{let[p,f]=d;f===t&&l.push([p,t])})}if(i){let c=this.deselectedRowsToColumns.get(t),u=this.selectedRowsToColumns.get(t);c?.forEach(d=>{d!==this.wildcard&&this.setCellInDeselection(e,d,!1)}),u?.forEach(d=>{d!==this.wildcard&&this.setCellInSelection(e,d,!1)}),[...this.cache.keys()].forEach(d=>{let[p]=d;p===e&&l.push([e,t])})}let s=[e,t];if(l.forEach(c=>{this.cache.delete(c)}),this.cache.delete(s),n)if(this.defaultSelection){let c=this.deselectedRowsToColumns.get(e);c&&c.has(t)&&this.setCellInDeselection(e,t,!1);let u=this.deselectedRowsToColumns.get(this.wildcard),d=this.deselectedColumnsToRows.get(this.wildcard);(u?.has(t)||d?.has(e))&&this.setCellInSelection(e,t,!0)}else{let c=this.deselectedRowsToColumns.get(e);c&&c.has(t)&&this.setCellInDeselection(e,t,!1),this.setCellInSelection(e,t,!0)}else if(this.defaultSelection)this.selectedRowsToColumns.get(e)?.has(t)&&this.setCellInSelection(e,t,!1),this.setCellInDeselection(e,t,!0);else{this.selectedRowsToColumns.get(e)?.has(t)&&this.setCellInSelection(e,t,!1);let u=this.selectedRowsToColumns.get(this.wildcard),d=this.selectedColumnsToRows.get(this.wildcard);if(u?.has(t)||d?.has(e)){this.setCellInDeselection(e,t,!0);return}}}setCellInDeselection(e,t,n){if(n){let r=this.deselectedRowsToColumns.get(e)||new Set;r.add(t),this.deselectedRowsToColumns.set(e,r)}else{let r=this.deselectedRowsToColumns.get(e);r&&(r.delete(t),r.size===0&&this.deselectedRowsToColumns.delete(e))}if(n){let r=this.deselectedColumnsToRows.get(t)||new Set;r.add(e),this.deselectedColumnsToRows.set(t,r)}else{let r=this.deselectedColumnsToRows.get(t);r&&(r.delete(e),r.size===0&&this.deselectedColumnsToRows.delete(t))}}setCellInSelection(e,t,n){if(e===this.wildcard&&t===this.wildcard)throw new Error("rowId and colId cannot be used as a wildcard at the same time!");if(n){let r=this.selectedRowsToColumns.get(e)||new Set;r.add(t),this.selectedRowsToColumns.set(e,r)}else{let r=this.selectedRowsToColumns.get(e);r&&(r.delete(t),r.size===0&&this.selectedRowsToColumns.delete(e))}if(n){let r=this.selectedColumnsToRows.get(t)||new Set;r.add(e),this.selectedColumnsToRows.set(t,r)}else{let r=this.selectedColumnsToRows.get(t);r&&(r.delete(e),r.size===0&&this.selectedColumnsToRows.delete(t))}}update(e){let t=e.selectedCells||null,n=e.deselectedCells||null;this.selectedRowsToColumns.clear(),this.selectedColumnsToRows.clear(),this.deselectedRowsToColumns.clear(),this.deselectedColumnsToRows.clear(),this.cache.clear(),t&&t.forEach(([r,i])=>{this.setCellInSelection(r,i,!0)}),n&&n.forEach(([r,i])=>{this.setCellInDeselection(r,i,!0)}),this.defaultSelection=e.defaultSelection}isCellSelectionInRow(e,t){if(this.defaultSelection){let r=this.deselectedRowsToColumns.get(e);if(r){if(r.has(this.wildcard)){let i=this.selectedRowsToColumns.get(e);return i&&i.size>0?t.some(a=>i.has(a)):!1}return t.some(i=>!r.has(i))}return!0}let n=this.selectedRowsToColumns.get(e);if(n){if(n.has(this.wildcard)){let r=this.deselectedRowsToColumns.get(e);return r&&r.size>0?!t.every(a=>r.has(a)):!0}return t?t.some(r=>n.has(r)):!1}return!1}error(e){xo(`${this.debugId}:CellSelectionState`)(e)}isCellSelected(e,t){return e===this.wildcard||t===this.wildcard?(this.error("CellSelectionState.isCellSelected should not be called with wildcard"),!1):this.isCellSelected_Internal(e,t)}isCellSelected_Internal(e,t){let n=[e,t],{cache:r}=this,i=r.get(n);if(i!=null)return i;let a=()=>(r.set(n,!1),!1),l=()=>(r.set(n,!0),!0),s=this.deselectedColumnsToRows.get(this.wildcard),c=this.deselectedRowsToColumns.get(this.wildcard),u=this.selectedColumnsToRows.get(this.wildcard),d=this.selectedRowsToColumns.get(this.wildcard);if(this.defaultSelection){let m=this.deselectedRowsToColumns.get(e);return m&&m.has(t)?a():s?.has(e)||c?.has(t)?this.selectedRowsToColumns.get(e)?.has(t)?l():a():l()}let f=this.selectedRowsToColumns.get(e);return f&&f.has(t)?l():u?.has(e)||d?.has(t)?this.deselectedRowsToColumns.get(e)?.has(t)?a():l():a()}getState(){let e=[],t=[];return this.deselectedRowsToColumns.forEach((n,r)=>{n.forEach(i=>{e.push([r,i])})}),this.selectedRowsToColumns.forEach((n,r)=>{n.forEach(i=>{t.push([r,i])})}),{defaultSelection:this.defaultSelection,deselectedCells:e,selectedCells:t}}};function Vo(o,e){return e().dataArray[o]}function la(o){return o().dataArray}var ft=class{constructor(e){this.collapsedPathsMap=new q;this.expandedPathsMap=new q;this.collapsedIdsMap=new Map;this.expandedIdsMap=new Map;this._mode="path";this.defaultExpanded=!1;this.expandAll=()=>{this.update({defaultExpanded:!0,collapsedPaths:[]})};this.collapseAll=()=>{this.update({defaultExpanded:!1,expandedPaths:[]})};let t=e&&e instanceof Object.getPrototypeOf(this).constructor?e.getState():e;t&&this.update(t)}get mode(){return this._mode}reset(){this.collapsedPathsMap.clear(),this.expandedPathsMap.clear(),this.collapsedIdsMap.clear(),this.expandedIdsMap.clear()}destroy(){this.reset()}expandNode(e){this.setNodeExpanded(e,!0)}collapseNode(e){this.setNodeExpanded(e,!1)}setNodeExpanded(e,t){let{collapsedPathsMap:n,collapsedIdsMap:r,expandedPathsMap:i,expandedIdsMap:a,defaultExpanded:l,_mode:s}=this;s==="id"&&Array.isArray(e)&&(e=e[e.length-1]),t===l?t?s==="path"&&Array.isArray(e)?n.delete(e):r.delete(e):s==="path"&&Array.isArray(e)?i.delete(e):a.delete(e):t?s==="path"&&Array.isArray(e)?i.set(e,!0):a.set(e,!0):s==="path"&&Array.isArray(e)?n.set(e,!0):r.set(e,!0)}isNodeExpandedByPath(e){return this.isNodeExpanded(e)}isNodeExpandedById(e){return this.isNodeExpanded(e)}isNodeExpanded(e){if(this._mode==="id"&&Array.isArray(e)&&(e=e[e.length-1]),this._mode==="id"&&Array.isArray(e))throw`You try to check if a node is expanded by id (${e}) but your TreeExpandState is configured to use node paths.`;if(this._mode==="path"&&!Array.isArray(e))throw`You try to check if a node is expanded by path (${e}) but your TreeExpandState is configured to use node ids.`;return this.defaultExpanded?this._mode==="path"&&Array.isArray(e)?!this.collapsedPathsMap.has(e):!this.collapsedIdsMap.has(e):this._mode==="path"&&Array.isArray(e)?this.expandedPathsMap.has(e):this.expandedIdsMap.has(e)}update(e){if(this.defaultExpanded=e.defaultExpanded,this.reset(),e.expandedPaths||e.collapsedPaths){this._mode="path";let r=e.expandedPaths||null,i=e.collapsedPaths||null;if(r)for(let a=0,l=r.length;a<l;a++)this.expandedPathsMap.set(r[a],!0);if(i)for(let a=0,l=i.length;a<l;a++)this.collapsedPathsMap.set(i[a],!0);return}this._mode="id";let t=e.expandedIds||null,n=e.collapsedIds||null;if(t)for(let r=0,i=t.length;r<i;r++)this.expandedIdsMap.set(t[r],!0);if(n)for(let r=0,i=n.length;r<i;r++)this.collapsedIdsMap.set(n[r],!0)}getState(){if(this._mode==="path"){let n=Array.from(this.collapsedPathsMap.keys()),r=Array.from(this.expandedPathsMap.keys());return{defaultExpanded:this.defaultExpanded,collapsedPaths:n,expandedPaths:r}}let e=Array.from(this.collapsedIdsMap.keys()),t=Array.from(this.expandedIdsMap.keys());return{defaultExpanded:this.defaultExpanded,collapsedIds:e,expandedIds:t}}};var Vs=o=>Array.isArray(o)?new q(o.map(e=>[e,!0])):o,tC=(o,e)=>o.length-e.length,Je=class o{constructor(e,t){this.selectedPaths=null;this.deselectedPaths=null;this.defaultSelection=!1;this.selectionMap=new q;this.cache=new q;this.strictMode=!1;let n=e instanceof Object.getPrototypeOf(this).constructor,r=n?e.getState():e;this.setConfig(t||(n?e.config:{treePaths:new q})),this.disableStrictMode(),this.update(r),this.config.strictCheckPaths&&this.enableStrictMode()}getTreePaths(e){return e?Vs(e):this.config.treePaths}withTreePaths(e,t){let n=this.config.treePaths;t=this.getTreePaths(t);let r=t!==n;r&&this.xcache(),this.config.treePaths=t;let i=e(t);return this.config.treePaths=n,r&&this.xcache(),i}getLeafNodePaths(e=[],t){return this.withTreePaths(n=>n.getKeysForLeafNodesStartingWith(e),t)}forEachLeafNodePath(e,t=[],n){let r={selected:!1};this.withTreePaths(i=>{i.getLeafNodesStartingWith(t,a=>{r.selected=this.isNodeSelected(a.keys)===!0,e(a.keys,r)})},n)}getSelectedLeafNodePaths(e=[],t){let n=[];return this.withTreePaths(r=>{r.getLeafNodesStartingWith(e,i=>{this.isNodeSelected(i.keys)&&n.push(i.keys)})},t),n}getDeselectedLeafNodePaths(e=[],t){let n=[];return this.withTreePaths(r=>{r.getLeafNodesStartingWith(e,i=>{this.isNodeSelected(i.keys)||n.push(i.keys)})},t),n}isLeafNode(e){let{treePaths:t}=this.config;return t.has(e)?t.getKeysForLeafNodesStartingWith(e).length===1:null}getLeafNodesCount(e){return this.config.treePaths.getKeysForLeafNodesStartingWith(e).length}static from(e,t){return new o(e,t)}setConfig(e){let t=typeof e=="function"?e():e;this.config={treePaths:Vs(t.treePaths),strictCheckPaths:t.strictCheckPaths??!0,multiRowSelectionTarget:t.multiRowSelectionTarget,unfilteredTreePaths:t.unfilteredTreePaths?Vs(t.unfilteredTreePaths):void 0},this.xcache()}hasFilteredOutLeavesInside(e){let{multiRowSelectionTarget:t,unfilteredTreePaths:n,treePaths:r}=this.config;return t!=="visible"||!n||n===r?!1:n.getAllChildrenSizeFor(e)>r.getAllChildrenSizeFor(e)}setVisibleLeafNodesSelection(e,t){let{unfilteredTreePaths:n,treePaths:r}=this.config;this.xcache(),r.getKeysForLeafNodesStartingWith(e).forEach(i=>{n.getAllChildrenSizeFor(i)>0||(this.selectionMap.delete(i),this.isNodeSelected(i)!==t&&this.setSelectionForPath(i,t))}),this.xcache()}xcache(){this.cache.clear()}update(e){this.selectedPaths=e.selectedPaths||null,this.deselectedPaths=e.deselectedPaths||null;let{selectionMap:t,selectedPaths:n,deselectedPaths:r}=this;t.clear(),n?.forEach(i=>this.setSelectionForPath(i,!0)),r?.forEach(i=>this.setSelectionForPath(i,!1)),this.defaultSelection=e.defaultSelection,this.xcache()}setSelectionForPath(e,t){this.isPathAvailable(e)&&this.selectionMap.set(e,t)}getState(){let e=[],t=[];return this.selectionMap.topDownEntries().forEach(([n,r])=>{r?e.push(n):t.push(n)}),{defaultSelection:this.defaultSelection,selectedPaths:e,deselectedPaths:t}}deselectAll(){if(this.hasFilteredOutLeavesInside([])){this.setVisibleLeafNodesSelection([],!1);return}this.update({defaultSelection:!1,selectedPaths:[],deselectedPaths:[]})}selectAll(){if(this.hasFilteredOutLeavesInside([])){this.setVisibleLeafNodesSelection([],!0);return}this.update({defaultSelection:!0,deselectedPaths:[],selectedPaths:[]})}enableStrictMode(){this.strictMode=!0}disableStrictMode(){this.strictMode=!1}isPathAvailable(e){if(!this.strictMode)return!0;let{treePaths:t}=this.config;return t.has(e)}isNodeSelected(e){return this.isPathSelected(e)}isSelfSelected(e){return this.selectionMap.get(e)??null}cacheIt(e,t){return this.cache.set(e,t),t}getSelectionStateForNode(e,t){let n=this.cache.get(e);if(n)return n;if(this.isLeafNode(e)!==!1){let d=this.isSelfSelected(e);if(d!==null)return this.cacheIt(e,{selected:d,selectedCount:d?1:0,deselectedCount:d?0:1,leafCount:1})}let r=this.getLeafNodesCount(e),i=this.isSelfSelected(e),{selectionMap:a}=this,l=a.getKeysOfFirstChildOnEachBranchStartingWith(e,{excludeSelf:!0}).sort(tC);if(this.strictMode&&(l=l.filter(d=>this.isPathAvailable(d))),!l.length){if(i!==null){let p=r?i:!1;return this.cacheIt(e,{selected:p,selectedCount:p?r:0,deselectedCount:p?0:r,leafCount:r})}let d=this.getNodeBooleanSelectionStateFromParent(e);return this.cacheIt(e,{selected:d,selectedCount:d?r:0,deselectedCount:d?0:r,leafCount:r})}let s=0,c=0,u=this.getNodeBooleanSelectionStateFromParent(e);u?s+=r:c+=r;for(let d=0,p=l.length;d<p;d++){let f=l[d],{selectedCount:m,deselectedCount:g}=this.getSelectionStateForNode(f);if(u?(s-=g,c+=g):(c-=m,s+=m),t&&m>0&&g>0)return this.cacheIt(e,{selected:null,leafCount:r,selectedCount:s,deselectedCount:c})}if(!s&&!c)return this.cacheIt(e,{selected:u,selectedCount:u?r:0,deselectedCount:u?0:r,leafCount:r});if(s){let d=s===r?!0:null;return this.cacheIt(e,{selected:d,selectedCount:s,deselectedCount:c,leafCount:r})}return this.cacheIt(e,{selected:!1,selectedCount:0,deselectedCount:r,leafCount:r})}isPathSelected(e){return this.isPathAvailable(e)?this.getSelectionStateForNode(e,!0).selected:!1}getNodeBooleanSelectionStateFromParent(e){let{defaultSelection:t,selectionMap:n}=this;if(!e.length)return t;let r=[...e];do{let i=n.get(r);if(i!==void 0)return i;r.pop()}while(r.length);return t}setNodeSelection(e,t){if(!e.length)return;if(this.hasFilteredOutLeavesInside(e)){this.setVisibleLeafNodesSelection(e,t);return}if(this.xcache(),this.selectionMap.getKeysStartingWith(e).forEach(r=>{this.selectionMap.delete(r)}),!(e.length===1&&this.defaultSelection===t)){if(this.setSelectionForPath(e,t),e.length>1){let r=e.slice(0,-1);this.isNodeSelected(r)===t&&this.setNodeSelection(r,t)}}}selectNode(e){this.setNodeSelection(e,!0)}deselectNode(e){this.setNodeSelection(e,!1)}toggleNodeSelection(e){this.setNodeSelection(e,!this.isNodeSelected(e))}getSelectedCount(){return this.getSelectionCountFor([]).selectedCount}getDeselectedCount(){return this.getSelectionCountFor([]).deselectedCount}getSelectionCountFor(e=[]){let{selectedCount:t,deselectedCount:n}=this.getSelectionStateForNode(e);return{selectedCount:t,deselectedCount:n}}destroy(){this.config=void 0,this.xcache(),this.selectionMap.clear()}};function tr(o,e){return new Je(o,er(e))}function er(o){return()=>{let e=typeof o=="function"?o():o,{treePaths:t,unfilteredTreePaths:n,multiRowSelectionTarget:r}=e;return r==="visible"?{treePaths:t,unfilteredTreePaths:n,multiRowSelectionTarget:r}:{treePaths:n??t,multiRowSelectionTarget:r}}}var sa=class{constructor(e){this.setNodeSelection=(e,t,n)=>{let{treeSelectionState:r,selectionMode:i}=this.getState();if(!this.isNodeSelectable(e)&&!n?.force)return;if(i==="single-row"){this.actions.treeSelection=t?e[e.length-1]:null;return}if(i!=="multi-row")throw"Selection mode is not multi-row or single-row";if(!(r instanceof Je))throw"Invalid tree selection";let a=new Je(r,er(this.getState));a.setNodeSelection(e,t),this.getState().lastSelectionUpdatedNodePathRef.current={nodePath:e,selected:t},this.actions.treeSelection=a};this.getCallbackParam=e=>({dataSourceApi:this.dataSourceApi});this.getState=e.getState,this.actions=e.actions,this.dataSourceApi=e.dataSourceApi}getSelectedLeafNodePaths(e){let{treePaths:t}=this.getState(),n=e?.treeSelectionState||this.getState().treeSelectionState;return n?n.getSelectedLeafNodePaths(e?.rootNodePath,t):[]}getDeselectedLeafNodePaths(e){let{treePaths:t}=this.getState(),n=e?.treeSelectionState||this.getState().treeSelectionState;return n?n.getDeselectedLeafNodePaths(e?.rootNodePath,t):[]}getSelectedLeafRowInfos(e){let{treePaths:t}=this.getState(),n=e?.treeSelectionState||this.getState().treeSelectionState;if(!t||!n)return[];let r=e?.rootNodePath||[],i=[];return t.getLeafNodesStartingWith(r,a=>{if(n.isNodeSelected(a.keys)){let l=this.getRowInfoByPath(a.keys);l&&i.push(l)}},{excludeSelf:!0}),i}get allRowsSelected(){return this.getState().allRowsSelected}isNodeReadOnly(e){let t=this.getRowInfoByPath(e),n=this.getState().isNodeReadOnly;return t&&t.isTreeNode&&t.isParentNode&&n?n(t):!1}isNodeSelectable(e){let t=this.getRowInfoByPath(e),n=this.getState().isNodeSelectable;return t&&t.isTreeNode?n(t):!1}isNodeExpanded(e){let t=this.getState(),{isNodeExpanded:n,isNodeCollapsed:r,treeExpandState:i}=t,a=this.getRowInfoByPath(e);if(a){if(!a.isTreeNode||!a.isParentNode)return!1;if(r)return!n(a,i);if(n)return n(a,i)}return i.isNodeExpanded(e)}expandAll(){let e=new ft({defaultExpanded:!0,collapsedPaths:[]});this.getState().lastExpandStateInfoRef.current={state:"expanded",nodePath:null},this.actions.treeExpandState=e}collapseAll(){let e=new ft({defaultExpanded:!1,expandedPaths:[]});this.getState().lastExpandStateInfoRef.current={state:"collapsed",nodePath:null},this.actions.treeExpandState=e}expandNode(e,t){if(this.isNodeReadOnly(e)&&!t?.force)return;let n=this.getState(),r=new ft(n.treeExpandState);r.expandNode(e),this.getState().lastExpandStateInfoRef.current={state:"expanded",nodePath:e},this.actions.treeExpandState=r,n.onNodeExpand?.(e,this.getCallbackParam(e))}collapseNode(e,t){if(this.isNodeReadOnly(e)&&!t?.force)return;let n=this.getState(),r=new ft(n.treeExpandState);r.collapseNode(e),this.getState().lastExpandStateInfoRef.current={state:"collapsed",nodePath:e},this.actions.treeExpandState=r,n.onNodeCollapse?.(e,this.getCallbackParam(e))}toggleNode(e,t){let n=this.getState(),r=new ft(n.treeExpandState),i=!this.isNodeExpanded(e);this.isNodeReadOnly(e)&&!t?.force||(r.setNodeExpanded(e,i),this.getState().lastExpandStateInfoRef.current={state:i?"expanded":"collapsed",nodePath:e},this.actions.treeExpandState=r,i?n.onNodeExpand?.(e,this.getCallbackParam(e)):n.onNodeCollapse?.(e,this.getCallbackParam(e)))}getNodeDataByPath(e){if(!e.length)return null;let t=this.getRowInfoByPath(e);return t?t.data:null}getRowInfoByPath(e){let{pathToIndexMap:t}=this.getState(),n=t.get(e);return n!==void 0?Vo(n,this.getState):null}selectAll(){let{treeSelectionState:e,selectionMode:t}=this.getState();if(t!=="multi-row")throw"Selection mode is not multi-row";if(!(e instanceof Je))throw"Invalid node selection";let n=new Je(e,er(this.getState));n.selectAll(),this.getState().lastSelectionUpdatedNodePathRef.current=null,this.actions.treeSelection=n}deselectAll(){let{treeSelectionState:e,selectionMode:t}=this.getState();if(t!=="multi-row")throw"Selection mode is not multi-row";if(!(e instanceof Je))throw"Invalid node selection";let n=new Je(e,er(this.getState));n.deselectAll(),this.getState().lastSelectionUpdatedNodePathRef.current=null,this.actions.treeSelection=n}isNodeSelected(e){let{treeSelectionState:t,treeSelection:n,selectionMode:r}=this.getState();if(r==="single-row"){let i=e[e.length-1];return Array.isArray(n)?treeSelection.join(",")===e.join(","):n===i}if(r!=="multi-row")throw"Selection mode is not multi-row or single-row";if(!(t instanceof Je))throw"Invalid tree selection";return t.isNodeSelected(e)}selectNode(e,t){this.setNodeSelection(e,!0,t)}deselectNode(e,t){this.setNodeSelection(e,!1,t)}toggleNodeSelection(e,t){this.isNodeSelected(e)?this.deselectNode(e,t):this.selectNode(e,t)}};function Gs(o){return o.map(eo)}function eo(o){if(Fe().structuredClone)return Fe().structuredClone(o);if(o===null||typeof o!="object")return o;if(Array.isArray(o))return Gs(o);if(o instanceof Date)return new Date(o);if(o instanceof Set)return new Set(Gs(Array.from(o)));if(o instanceof Map)return new Map(Gs(Array.from(o)));let e={};for(let t in o)o.hasOwnProperty(t)&&(e[t]=eo(o[t]));return e}function Kr(o){return o}var ca="____not_loaded_yet____";function Hs(o){return typeof o=="string"&&o.startsWith(ca)}var dn=Object.seal({data:null,field:null});var vt="____root____";function Go(){return!1}function Ks(o){if(!o||!Object.keys(o).length)return{};let e={};for(let t in o)if(o.hasOwnProperty(t)){let n=o[t].initialValue;e[t]=typeof n=="function"?n():n}return e}function ua(o,e,t,n,r){if(!(!t||!Object.keys(t).length)){for(let i in t)if(t.hasOwnProperty(i)){let a=t[i];if(typeof a.reducer!="function")continue;let l=n[i],s=a.getter?a.getter(o)??null:a.field?o[a.field]:null;n[i]=a.reducer(l,s,o,e,r)}}}function uf(o,e){let{marker:t,reducers:n={},pivot:r,groupBy:i,indexer:a,toPrimaryKey:l,cache:s,mappings:c}=o;t&&t.start();let u=new q;function d(S,y,T,b=0,R=[]){let C=!T.length||b===T.length-1,I=y[c?.values||"values"]||{};for(let w in I)if(I.hasOwnProperty(w)){let v=w;R.push(v),p.set(R,!0),S.set(R,{reducerResults:I[w][c?.totals||"totals"]||{},items:[]}),C||d(S,I[w],T,b+1,R),R.pop()}}let p=r?new q:void 0,f=[],m=Ks(n),g=eo(m);e.visitDepthFirst((S,y,T,b)=>{let[R,...C]=y,I=S.children,w=u.get(C);if(w&&(w.cache=S.cache,w.childrenLoading=S.childrenLoading,w.childrenAvailable=S.childrenAvailable,w.error=S.error),C.length==i.length&&i.length){if(w){w.items=I;for(let P=0,E=C.length;P<E;P++){let M=C.slice(0,P),D=u.get(M);D&&(D.items=D.items||[],D.items=D.items.concat(I))}I=a.indexArray(I,{toPrimaryKey:l,cache:s,nodesKey:void 0})}return b?.()}for(let v=0,P=I.length;v<P;v++){if(!I[v]){let x={items:[],reducerResults:{},cache:!1,childrenLoading:!1,childrenAvailable:!1,isTree:!1,isGroupBy:!0};u.set([...C,`${ca}${v}`],x);continue}let E=I[v].data,M=I[v].keys||[];if(M.length){let x=M[M.length-1];C.push(x)}let D={items:[],cache:!1,childrenLoading:!1,childrenAvailable:!1,commonData:E,totalChildrenCount:I[v].totalChildrenCount,totalChildrenCountUnfiltered:I[v].totalChildrenCountUnfiltered,reducerResults:I[v].aggregations||{},isTree:!1,isGroupBy:!0};if(u.set(C,D),r){let x=D.pivotDeepMap=new q,A=I[v].pivot;d(x,A,r,0,f)}M.length&&C.pop()}b?.()});let h={deepMap:u,groupParams:o,initialData:e,reducerResults:g};return r&&(h.topLevelPivotColumns=p,h.pivot=r),t&&t.end({details:[{name:"Group by fields",value:i.map(S=>S.field).join(", ")}]}),h}function cf(o,e,t,n,r,i,a,l,s,c=Kr){let{items:u,reducerResults:d,pivotDeepMap:p}=o.get(e);if(u.push(n),a&&ua(n,r,a,d,e),i){for(let f=0,m=i.length;f<m;f++){let{field:g,valueGetter:h,toKey:S}=i[f],y=g?n[g]:null;h&&(dn.data=n,dn.field=g,y=h(dn));let T=(S||c)(y,n);t.push(T),p.has(t)||(l.set(t,!0),p?.set(t,{reducerResults:eo(s),items:[]}));let{reducerResults:b,items:R}=p.get(t);R.push(n),a&&ua(n,r,a,b,e)}t.length=0}}function df(o,e,t,n,r,i,a,l){let{isLeafNode:s,getNodeChildren:c,toKey:u}=o,d=u(r),p=[...n,d],f=s(r);if(t.set(p,!0),f){for(let S=0,y=n.length;S<=y;S++){let T=n.slice(0,S),b=e.get(T),{reducerResults:R,items:C}=b;C.push(r),b.leavesAvailableCount++,b.totalLeafNodesCount++,a&&ua(r,i,a,R,T)}return}let m=eo(l),g=[];e.set(p,{items:g,isTree:!0,isGroupBy:!1,node:r,reducerResults:m,cache:!1,childrenLoading:!1,childrenAvailable:!0,totalLeafNodesCount:0,leavesAvailableCount:0,treeNesting:n.length});let h=c(r);if(!(!h||!Array.isArray(h))){for(let S=0,y=h.length;S<y;S++){let T=h[S];df(o,e,t,p,T,S,a,l)}a&&Br(a,m,g)}}function Bs(o,e){let{reducers:t,marker:n}=o;if(n){let c=Object.keys(t??{});n.start({details:c.length>0?[{name:"Reducers",value:c.join(", ")}]:void 0})}let r=Ks(t),i=eo(r),a=new q,l=new q;a.set([],{items:[],isTree:!0,isGroupBy:!1,reducerResults:i,cache:!1,childrenLoading:!1,childrenAvailable:!0,totalLeafNodesCount:0,leavesAvailableCount:0,node:null,treeNesting:-1});for(let c=0,u=e.length;c<u;c++)df(o,a,l,[],e[c],c,t,r);t&&Br(t,i,e);let s={deepMap:a,treeParams:o,treePaths:l,initialData:e,reducerResults:i};return n&&n.end(),s}function pa(o,e){let{marker:t,groupBy:n,defaultToKey:r=Kr,pivot:i,reducers:a}=o;t&&t.start();let l=n.length,s=i?new q:void 0,c=new q,u=[],d=[],p=Ks(a),f=eo(p);if(!l){let g={items:[],isTree:!1,isGroupBy:!0,cache:!1,childrenLoading:!1,childrenAvailable:!1,reducerResults:eo(p)};i&&(g.pivotDeepMap=new q),c.set(u,g)}for(let g=0,h=e.length;g<h;g++){let S=e[g],y={};for(let T=0;T<l;T++){let{field:b,groupField:R,valueGetter:C,toKey:I}=n[T],w=b?S[b]:null;C&&(dn.data=S,dn.field=b,w=C(dn));let v=(I||r)(w,S);if(y[b||R]=v,u.push(v),!c.has(u)){let P={items:[],isTree:!1,isGroupBy:!0,cache:!1,commonData:{...y},childrenLoading:!1,childrenAvailable:!1,reducerResults:eo(p)};i&&(P.pivotDeepMap=new q),c.set(u,P)}cf(c,u,d,S,g,i,a,s,p,r)}l||cf(c,u,d,S,g,i,a,s,p,r),a&&ua(S,g,a,f,u),u.length=0}a&&(c.visitDepthFirst((g,h,S,y)=>{Br(a,g.reducerResults,g.items),i&&g.pivotDeepMap.visitDepthFirst(({items:T,reducerResults:b},R,C,I)=>{Br(a,b,T),I?.()}),y?.()}),Br(a,f,e));let m={deepMap:c,groupParams:o,initialData:e,reducerResults:f};return i&&(m.topLevelPivotColumns=s,m.pivot=i),t&&t.end({details:[{name:"Group by fields",value:n.map(g=>g.field).join(", ")}]}),m}function pf(o){let{groupParams:e,deepMap:t}=o,n=e.groupBy.length,r=[];return t.topDownKeys().reduce((i,a)=>{if(a.length===n){let l=t.get(a).items;i.push(...l)}return i},r),r}function oC(o,e){let{groupBy:t,groupKeys:n,parents:r,reducers:i,lazyLoad:a}=o,l=n.length,{items:s,reducerResults:c,pivotDeepMap:u,commonData:d}=e,p=d??null,f;if(Object.keys(c).length>0){p={...d},f={};for(let y in i)if(i.hasOwnProperty(y)){let b=i[y].field;b&&(f[b]=c[y]),b&&p[b]==null&&(p[b]=c[y])}}let m=!0,g=n[n.length-1],h=g;if(p!=null){let y=t[n.length-1];y&&y.field&&(h=p[y.field]),y&&y.toKey&&(h=y.toKey(h,p)),h=h??g}return typeof h=="string"&&h.startsWith(ca)&&(m=!1,h=null),{data:p,reducerData:f,groupCount:s.length,groupData:s,groupKeys:n,isTreeNode:!1,rowSelected:!1,selectedChildredCount:0,deselectedChildredCount:0,id:`${n}`,collapsed:!1,dataSourceHasGrouping:!0,rowDisabled:!1,isCellSelected:Go,hasSelectedCells:Go,selfLoaded:m,error:o.error,parents:r,deepRowInfoArray:[],collapsedChildrenCount:0,collapsedGroupsCount:0,totalChildrenCount:o.totalChildrenCount,childrenAvailable:a?o.childrenAvailable:!0,childrenLoading:o.childrenLoading,indexInParentGroups:o.indexInParentGroups,indexInGroup:o.indexInGroup,indexInAll:o.indexInAll,directChildrenCount:o.directChildrenCount,directChildrenLoadedCount:a?o.directChildrenLoadedCount:o.directChildrenCount,value:h,rootGroupBy:t,groupBy:l===t.length?t:t.slice(0,l),isGroupRow:!0,pivotValuesMap:u,groupNesting:l,reducerResults:c}}function da(o,e,t){return{...o,id:`duplicate_row_on_page_${t}_for__${o.id}`,indexInAll:e,duplicateOf:o.id}}function Br(o,e,t){if(o){for(let n in o)if(o.hasOwnProperty(n)){let r=o[n];r.done&&(e[n]=r.done(e[n],t))}}return e}function ff(o,e,t,n,r,i){let a=e.length,{isLeafNode:l,getNodeChildren:s}=r.treeParams,{toPrimaryKey:c,treeResult:u,isRowDisabled:d,isNodeSelected:p,withRowInfo:f,isNodeExpanded:m,treeSelectionState:g,repeatWrappedGroupRows:h,rowsPerPage:S}=r,{deepMap:y}=u,T=o.length,b=t[t.length-1],R=b?b.nodeExpanded:!0;for(let C=0;C<T;C++){let I=o[C],w=c(I,C),v=[...e,w];if(l(I)){let O={id:w,nodePath:v,isGroupRow:!1,data:I,treeNesting:a,totalLeafNodesCount:0,collapsedLeafNodesCount:0,isTreeNode:!0,isParentNode:!1,selfLoaded:!0,rowSelected:!1,rowDisabled:!1,isCellSelected:Go,hasSelectedCells:Go,dataSourceHasGrouping:!1,parentNodes:Array.from(t),indexInParentNodes:[...n,C],indexInParent:C,indexInAll:R?i.length:-1};p&&(O.rowSelected=p(O)),d&&(O.rowDisabled=d(O)),f&&f(O);let F=h&&S!=null&&S>0&&O.indexInAll%S===0?O.indexInAll/S:null;for(let z=0,L=t.length;z<L;z++){let B=t[z];if(R||(B.collapsedLeafNodesCount+=1),B.deepRowInfoArray.push(O),F!=null&&R){if(typeof h=="function"&&h(B)!==!0)continue;let Y=da(B,O.indexInAll,F);i[Y.indexInAll]=Y,O.indexInAll++}}R&&(i[O.indexInAll]=O);continue}let M=y.get(v)?.totalLeafNodesCount??0,D={dataSourceHasGrouping:!1,nodeExpanded:!1,selfExpanded:!1,nodePath:v,id:w,data:I,indexInAll:i.length,indexInParent:C,indexInParentNodes:[...n,C],totalLeafNodesCount:M,treeNesting:a,selfLoaded:!0,isParentNode:!0,isTreeNode:!0,isGroupRow:!1,deepRowInfoArray:[],parentNodes:Array.from(t),collapsedLeafNodesCount:0,rowSelected:!1,rowDisabled:!1,isCellSelected:Go,hasSelectedCells:Go,selectedLeafNodesCount:0,deselectedLeafNodesCount:0};if(p&&(D.rowSelected=p(D),g)){let O=g.getSelectionCountFor(D.nodePath);D.selectedLeafNodesCount=O.selectedCount,D.deselectedLeafNodesCount=O.deselectedCount}d&&(D.rowDisabled=d(D)),f&&f(D);let x=!0;if(m&&(D.selfExpanded=x=m(D)),R||(x=!1),D.nodeExpanded=x,R&&h&&S!=null&&S>0){let O=D.indexInAll,F=D.parentNodes;if(F.length>0&&O%S===0){let z=O/S,L=0;F.forEach(B=>{typeof h=="function"&&h(B)!==!0||(i.push(da(B,O+L,z)),L++,D.indexInAll++)})}}R&&(i[D.indexInAll]=D);let A=s(I);Array.isArray(A)&&ff(A,v,[...t,D],D.indexInParentNodes,r,i)}return i}function mf(o){let{dataArray:e,marker:t}=o;t&&t.start();let n=[];return ff(e,[],[],[],o,n),t&&t.end(),{data:n}}function gf(o){let{marker:e,lazyLoad:t,groupResult:n,rowsPerPage:r,repeatWrappedGroupRows:i,withRowInfo:a,toPrimaryKey:l,groupRowsState:s,isRowDisabled:c,isRowSelected:u,rowSelectionState:d,generateGroupRows:p,reducers:f={}}=o,{groupParams:m,deepMap:g,pivot:h}=n,{groupBy:S}=m;e&&e.start({details:[{name:"Group by fields",value:S.map(C=>C.field).join(", ")}]});let y=[],T=[],b=[],R=[];return g.visitDepthFirst((C,I,w,v)=>{let P=C.items,E=I.length,M=s?.isGroupRowCollapsed(I)??!1;R.push(w);let D=oC({lazyLoad:t,groupBy:S,parents:Array.from(b),reducers:f,indexInGroup:w,indexInParentGroups:Array.from(R),indexInAll:y.length,groupKeys:I,error:C.error,totalChildrenCount:C.totalChildrenCount,childrenLoading:(C.childrenLoading||!M&&!C.childrenAvailable)&&t,childrenAvailable:C.childrenAvailable,directChildrenCount:I.length===S.length?C.items.length:g.getDirectChildrenSizeFor(I),directChildrenLoadedCount:0},C);if(u&&(D.rowSelected=u(D),d)){let z=d.getSelectionCountFor(D.groupKeys);D.selectedChildredCount=z.selectedCount,D.deselectedChildredCount=z.deselectedCount}c&&(D.rowDisabled=c(D));let x=b[b.length-1],A=x?.collapsed??!1;A&&(M=!0),D.collapsed=M;let O=p||M;if(A&&(O=!1),O){if(i&&r!=null&&r>0){let z=D.indexInAll,L=D.parents;if(L.length>0&&z%r===0){let B=z/r,Y=0;L.forEach(V=>{typeof i=="function"&&i(V)!==!0||(y.push(da(V,z+Y,B)),Y++,D.indexInAll++)})}}y.push(D),T.push(y.length-1)}D.collapsedChildrenCount=0,b.forEach(z=>{z.deepRowInfoArray.push(D),z.collapsedGroupsCount+=M?1:0}),x&&D.selfLoaded&&t&&(x.directChildrenLoadedCount+=1),a&&a(D),b.push(D);let F=!0;if(F){if(v)v();else if(!h){let z=y.length;M||(y.length+=P.length);let L=0;for(let B=0,Y=P.length;B<Y;B++){let V=P[B];if(!M&&i&&r!=null&&r>0){let ae=z+B+L;if(ae%r===0){let re=ae/r;b.forEach(ue=>{if(typeof i=="function"&&i(ue)!==!0)return;let fe=z+B+L;y[fe]=da(ue,fe,re),L++,y.length++})}}let W=z+B+L,K={id:V?l(V,W):`${I}-${B}`,data:V,isCellSelected:Go,hasSelectedCells:Go,dataSourceHasGrouping:!0,isTreeNode:!1,isGroupRow:!1,selfLoaded:!!V,rowSelected:!1,rowDisabled:!1,rootGroupBy:S,collapsed:M,groupKeys:I,parents:Array.from(b),indexInParentGroups:[...R,B],indexInGroup:B,indexInAll:W,groupBy:S,groupNesting:E+1,groupCount:D.groupCount};u&&(K.rowSelected=u(K)),c&&(K.rowDisabled=c(K)),a&&a(K),b.forEach((ae,re)=>{re===b.length-1&&V&&(ae.directChildrenLoadedCount+=1),M&&(ae.collapsedChildrenCount+=1),ae.deepRowInfoArray.push(K)}),M||(y[z+B+L]=K)}}}b.pop(),R.pop()}),e&&e.end(),{data:y,groupRowsIndexes:T}}function Ho(o,e){return e.reduce((t,n)=>{let{field:r,valueGetter:i,toKey:a}=n,l=r?o[r]:i?.({data:o,field:r}),s=(a||Kr)(l,o);return t.push(s),t},[])}var nC=new q,hf=new WeakMap;function fa(o){let{originalDataArray:e,groupBy:t,toPrimaryKey:n}=o;if(!e||!t.length)return nC;let r=hf.get(e);if(r&&r.groupBy===t)return r.groups;let i=new q,a=t.length,l=[];return e.forEach(s=>{let c=Ho(s,t);l.length=0;for(let u=0;u<c.length;u++){l.push(c[u]);let d=i.get(l);d||(d={count:0},l.length===a&&(d.primaryKeys=[]),i.set(l,d)),d.count++,d.primaryKeys?.push(n(s))}}),hf.set(e,{groupBy:t,groups:i}),i}function rC(o,e){let t=[];return o.getLeafNodesStartingWith(e,n=>{let r=n.value?.primaryKeys;if(r)for(let i=0;i<r.length;i++)t.push(r[i])}),t}var Oe=class o{constructor(e,t,n){this.selectedRows=null;this.deselectedRows=null;this.defaultSelection=!1;this.selectedMap=new q;this.deselectedMap=new q;this.onlyUsePrimaryKeys=!1;this.selectionCache=new q;this.selectionCountCache=new q;this.lazyEntries=null;this.lazyLoadedRows=null;this.lazyChildrenLoaded=null;this.lazyRowCounts=null;this.mapSet=(e,t)=>{Array.isArray(t)||(this.onlyUsePrimaryKeys?t=[t]:t=[...this.getGroupKeysForPrimaryKey(t),t]),this.xcache(),e==="selected"?this.selectedMap.set(t,!0):this.deselectedMap.set(t,!0)};this._selectedMapSet=e=>{this.mapSet("selected",e)};this._deselectedMapSet=e=>{this.mapSet("deselected",e)};let r=e instanceof Object.getPrototypeOf(this).constructor?e.getState():e;this.getConfig=t,this.onlyUsePrimaryKeys=t().onlyUsePrimaryKeys,n&&Object.assign(this,n),this.update(r)}getGroupKeysForPrimaryKey(e){let{indexer:t,groupBy:n}=this.getConfig(),r=t.getDataForPrimaryKey(e);return r?Ho(r,n):[]}getGroupDeepMap(){return this.getConfig().groupDeepMap}targetsVisibleRowsOnly(){let{multiRowSelectionTarget:e,someRowsFilteredOut:t}=this.getConfig();return e==="visible"&&!!t}targetsFilteredOutRows(){let{multiRowSelectionTarget:e,someRowsFilteredOut:t}=this.getConfig();return e!=="visible"&&!!t}getVisibleDataInsideGroup(e){let{postFilterDataArray:t,groupDeepMap:n}=this.getConfig();return e.length?n?.get(e)?.items??[]:t??[]}hasFilteredOutRowsInsideGroup(e){let t=this.getConfig();return t.someRowsFilteredOut?(e.length?fa(t).get(e)?.count??0:t.originalDataArray?.length??0)>this.getVisibleDataInsideGroup(e).length:!1}setVisibleRowsSelection(e,t){let{groupBy:n,toPrimaryKey:r}=this.getConfig(),i=t?this.selectedMap:this.deselectedMap,a=t?this.deselectedMap:this.selectedMap;this.xcache(),this.getVisibleDataInsideGroup(e).forEach(l=>{let s=Ho(l,n),c=r(l),u=[...s,c];a.delete(u),this.isRowSelected(c,s)!==t&&i.set(u,!0)}),this.xcache()}getLazyUnfilteredCount(e){let t=this.getConfig();if(!(!t.lazyLoad||t.multiRowSelectionTarget==="visible"))return e.length?t.groupDeepMap?.get(e)?.totalChildrenCountUnfiltered:t.lazyUnfilteredCount}getLazyHiddenRowsCount(e){let t=e.length<this.getGroupByLength()?this.getLazyUnfilteredCount(e):void 0;if(t===void 0)return 0;let{groupDeepMap:n}=this.getConfig(),r=0;return this.getGroupKeysDirectlyInsideGroup(e).forEach(i=>{r+=this.getLazyUnfilteredCount(i)??(n?.get(i)?.totalChildrenCount||0)}),Math.max(t-r,0)}getLazyEntries(){let e=`${this.selectedMap.version}:${this.deselectedMap.version}`;if(this.lazyEntries?.version!==e){let t=new q;this.selectedMap.getKeysStartingWith([]).forEach(n=>t.set(n,!0)),this.deselectedMap.getKeysStartingWith([]).forEach(n=>t.set(n,!1)),this.lazyEntries={version:e,entries:t}}return this.lazyEntries.entries}getLazyRowCount(e){this.lazyRowCounts=this.lazyRowCounts??new q;let t=this.lazyRowCounts.get(e);if(t!==void 0)return t??void 0;let n=this.computeLazyRowCount(e);return this.lazyRowCounts.set(e,n??null),n}computeLazyRowCount(e){let t=this.getConfig(),n=this.getGroupByLength(),r=this.getLazyUnfilteredCount(e);if(r!==void 0)return r;if(!e.length&&!n)return t.totalCount;let i=e.length?t.groupDeepMap?.get(e):void 0,a=e.length?i?.totalChildrenCount:t.lazyGroupedRowCount;if(a!=null)return a;if(e.length===n)return i?.childrenAvailable?i.items.length:void 0;let l=t.groupDeepMap?.getKeysStartingWith(e,{excludeSelf:!0,depthLimit:1})??[];if(l.length)return l.reduce((s,c)=>s+(Hs(c[c.length-1])?1:this.getLazyRowCount(c)??1),0)}areLazyChildrenLoaded(e){this.lazyChildrenLoaded=this.lazyChildrenLoaded??new q;let t=this.lazyChildrenLoaded.get(e);if(t!==void 0)return t;let n=this.computeLazyChildrenLoaded(e);return this.lazyChildrenLoaded.set(e,n),n}computeLazyChildrenLoaded(e){let{groupDeepMap:t}=this.getConfig(),n=e.length?t?.get(e):void 0;return e.length&&!n?.childrenAvailable?!1:e.length===this.getGroupByLength()?this.getLazyLoadedRows(e).complete:(t?.getKeysStartingWith(e,{excludeSelf:!0,depthLimit:1})??[]).every(r=>!Hs(r[r.length-1]))}getLazyLoadedRows(e){this.lazyLoadedRows=this.lazyLoadedRows??new q;let t=this.lazyLoadedRows.get(e);if(!t){let{groupDeepMap:n,originalDataArray:r,toPrimaryKey:i,totalCount:a}=this.getConfig(),l=e.length?n?.get(e):void 0,s=l?l.items:r??[],c=l?l.totalChildrenCount:a,u=new Set,d=c==null||s.length>=c;for(let p=0;p<s.length;p++){let f=s[p];f==null?d=!1:u.add(i(f))}t={primaryKeys:u,complete:d},this.lazyLoadedRows.set(e,t)}return t}isLazyEntryFilteredOut(e){let{groupDeepMap:t}=this.getConfig(),n=this.getGroupByLength();for(let r=1;r<=e.length;r++){let i=e.slice(0,r-1);if(!(r>n?this.getLazyLoadedRows(i).primaryKeys.has(e[r-1]):!!t?.get(e.slice(0,r))))return this.areLazyChildrenLoaded(i)}return!1}getLazySelectionCountFor(e,t){let n=this.selectionCountCache.get(e);if(n!=null)return n;let r=this.getLazyEntries(),i=this.getGroupByLength()+1,a=this.getLazyUnfilteredCount([])!==void 0,l=0,s=0;r.getKeysOfFirstChildOnEachBranchStartingWith(e,{excludeSelf:!0,respectOrder:!1}).forEach(p=>{if(!a&&this.isLazyEntryFilteredOut(p))return;let f=r.get(p);if(p.length>=i){f?l++:s++;return}let m=this.getLazySelectionCountFor(p,f);l+=m.selectedCount,s+=m.deselectedCount});let c=this.getLazyRowCount(e),u=c===void 0?1:Math.max(c-l-s,0);t?l+=u:s+=u;let d={selectedCount:l,deselectedCount:s};return this.selectionCountCache.set(e,d),d}getGroupCount(e){if(e.length==0)return this.getLazyUnfilteredCount([])??this.getConfig().totalCount;if(this.targetsFilteredOutRows())return fa(this.getConfig()).get(e)?.count??0;let n=this.getGroupDeepMap()?.get(e);return n?this.getLazyUnfilteredCount(e)??n.totalChildrenCount??(n.items.length||0):0}getGroupKeysDirectlyInsideGroup(e){let t=this.getConfig(),n={excludeSelf:!0,depthLimit:1};return this.targetsFilteredOutRows()?fa(t).getKeysStartingWith(e,n):t.groupDeepMap?.getKeysStartingWith(e,n)||[]}getAllPrimaryKeysInsideGroup(e){let t=this.getConfig(),{groupDeepMap:n,toPrimaryKey:r}=t;if(this.targetsFilteredOutRows())return e.length?rC(fa(t),e):(t.originalDataArray??[]).map(r);if(!t.groupBy.length)return this.getVisibleDataInsideGroup([]).map(r);if(!e.length)return(n?.getKeysStartingWith([],{excludeSelf:!0,depthLimit:1})||[]).map(l=>this.getAllPrimaryKeysInsideGroup(l)).flat();let i=n?.get(e);return i?i.items.map(this.getConfig().toPrimaryKey):[]}getGroupByLength(){return this.getConfig().groupBy.length}static from(e,t,n){return new o(e,t,n)}update(e){this.selectedRows=e.selectedRows||null,this.deselectedRows=e.deselectedRows||null,this.selectedMap.clear(),this.deselectedMap.clear(),this.selectedRows?.forEach(this._selectedMapSet),this.deselectedRows?.forEach(this._deselectedMapSet),this.defaultSelection=e.defaultSelection,this.xcache()}xcache(){this.selectionCache.clear(),this.selectionCountCache.clear(),this.lazyLoadedRows=null,this.lazyChildrenLoaded=null,this.lazyRowCounts=null}getState(){let e=r=>{let i=this.getGroupByLength();return r.map(a=>this.onlyUsePrimaryKeys||i===0&&a.length===1?a[0]:a)},t=e(this.selectedMap.topDownKeys()),n=e(this.deselectedMap.topDownKeys());return{defaultSelection:this.defaultSelection,selectedRows:t,deselectedRows:n}}deselectAll(){if(this.targetsVisibleRowsOnly()){this.onlyUsePrimaryKeys?this.deselectGroupRow([]):this.setVisibleRowsSelection([],!1);return}this.update({defaultSelection:!1,selectedRows:[],deselectedRows:[]})}selectAll(){if(this.targetsVisibleRowsOnly()){this.onlyUsePrimaryKeys?this.selectGroupRow([]):this.setVisibleRowsSelection([],!0);return}this.update({defaultSelection:!0,deselectedRows:[],selectedRows:[]})}isRowDefaultSelected(){return this.defaultSelection===!0}isRowDefaultDeselected(){return this.defaultSelection===!1}isRowSelected(e,t){if(this.onlyUsePrimaryKeys)return this.defaultSelection?!this.deselectedMap.has([e]):this.selectedMap.has([e]);t=t||this.getGroupKeysForPrimaryKey(e);let n=[...t,e],r=this.selectionCache.get(n);if(r!==void 0)return r;let i=this.selectedMap.has(n),a=this.deselectedMap.has(n);if(i)return this.selectionCache.set(n,!0),!0;if(a)return this.selectionCache.set(n,!1),!1;if(this.selectedMap.has(t))return this.selectionCache.set(n,!0),!0;if(this.deselectedMap.has(t))return this.selectionCache.set(n,!1),!1;for(t=[...t];t.length;){t.pop();let l=this.selectedMap.has(t),s=this.deselectedMap.has(t);if(l)return this.selectionCache.set(n,!0),!0;if(s)return this.selectionCache.set(n,!1),!1}return this.selectionCache.set(n,this.defaultSelection),this.defaultSelection}isRowDeselected(e,t){return!this.isRowSelected(e,t)}setRowSelected(e,t,n){t?this.setRowAsSelected(e,n):this.setRowAsDeselected(e,n)}getGroupRowSelectionState(e){let t=this.selectionCache.get(e);if(t!==void 0)return t;let{selectedCount:n,deselectedCount:r}=this.getSelectionCountFor(e,this.onlyUsePrimaryKeys?void 0:this.getGroupRowBooleanSelectionStateFromParent(e)),i=n&&r?null:!!n;return this.selectionCache.set(e,i),i}getGroupRowBooleanSelectionStateFromParent(e){if(!e.length)return this.defaultSelection;let t=[...e],n=this.deselectedMap.has(t),r=this.selectedMap.has(t),i=r&&!n?!0:n&&!r?!1:void 0;if(i===void 0)for(;t.length;){if(t.pop(),this.deselectedMap.has(t)){i=!1;break}if(this.selectedMap.has(t)){i=!0;break}}return i===void 0&&(i=this.defaultSelection),i}isGroupRowPartlySelected(e){return this.getGroupRowSelectionState(e)===null}isGroupRowSelected(e){return this.getGroupRowSelectionState(e)===!0}isGroupRowDeselected(e){return this.getGroupRowSelectionState(e)===!1}selectGroupRow(e){if(this.onlyUsePrimaryKeys){this.getAllPrimaryKeysInsideGroup(e).forEach(i=>{this.defaultSelection===!0?this.deselectedMap.delete([i]):this._selectedMapSet(i)}),this.xcache();return}if(this.targetsVisibleRowsOnly()&&this.hasFilteredOutRowsInsideGroup(e)){this.setVisibleRowsSelection(e,!0);return}this.selectedMap.getKeysStartingWith(e,{excludeSelf:!0}).forEach(r=>{this.selectedMap.delete(r)}),e.length===1&&this.defaultSelection===!0||this._selectedMapSet(e),this.deselectedMap.getKeysStartingWith(e).forEach(r=>{this.deselectedMap.delete(r)}),this.xcache()}deselectGroupRow(e){if(this.onlyUsePrimaryKeys){this.getAllPrimaryKeysInsideGroup(e).forEach(i=>{this.defaultSelection===!1?this.selectedMap.delete([i]):this._deselectedMapSet(i)}),this.xcache();return}if(this.targetsVisibleRowsOnly()&&this.hasFilteredOutRowsInsideGroup(e)){this.setVisibleRowsSelection(e,!1);return}this.deselectedMap.getKeysStartingWith(e,{excludeSelf:!0}).forEach(r=>{this.deselectedMap.delete(r)}),e.length===1&&this.defaultSelection===!1||this._deselectedMapSet(e),this.selectedMap.getKeysStartingWith(e).forEach(r=>{this.selectedMap.delete(r)}),this.xcache()}setRowAsSelected(e,t){if(this.onlyUsePrimaryKeys){this.defaultSelection?this.deselectedMap.delete([e]):this._selectedMapSet(e),this.xcache();return}t=t||this.getGroupKeysForPrimaryKey(e);let n=[...t,e];this.deselectedMap.delete(n),this.xcache(),this.getGroupRowSelectionState(t)!==!0&&(this._selectedMapSet(n),this.getGroupRowSelectionState(t)===!0&&this.selectGroupRow(t))}setRowAsDeselected(e,t){if(this.onlyUsePrimaryKeys){this.defaultSelection?this._deselectedMapSet(e):this.selectedMap.delete([e]),this.xcache();return}t=t||this.getGroupKeysForPrimaryKey(e);let n=[...t,e];this.selectedMap.delete(n),this.xcache(),this.getGroupRowSelectionState(t)!==!1&&(this._deselectedMapSet(n),this.getGroupRowSelectionState(t)===!1&&this.deselectGroupRow(t))}deselectRow(e,t){this.setRowSelected(e,!1,t)}selectRow(e,t){this.setRowSelected(e,!0,t)}toggleGroupRowSelection(e){this.getGroupRowSelectionState(e)===!0?this.deselectGroupRow(e):this.selectGroupRow(e)}toggleRowSelection(e,t){this.isRowSelected(e,t)?this.deselectRow(e,t):this.selectRow(e,t)}getSelectedCount(){return this.getSelectionCountFor([]).selectedCount}getDeselectedCount(){return this.getSelectionCountFor([]).deselectedCount}getSelectionCountFor(e=[],t){let n=this.selectionCountCache.get(e);if(n!=null)return n;let r=this.getGroupByLength();if(e.length>r){let c=this.isRowSelected(e)?{selectedCount:1,deselectedCount:0}:{selectedCount:0,deselectedCount:1};return this.selectionCountCache.set(e,c),c}if(this.getConfig().lazyLoad&&(!this.onlyUsePrimaryKeys||!r))return this.getLazySelectionCountFor(e,t??this.getGroupRowBooleanSelectionStateFromParent(e));if(this.onlyUsePrimaryKeys&&(r||this.targetsVisibleRowsOnly())){let c=this.getAllPrimaryKeysInsideGroup(e),u=0,d=0;c.forEach(f=>{if(this.defaultSelection){if(this.deselectedMap.has([f])){d++;return}u++}else{if(this.selectedMap.has([f])){u++;return}d++}});let p={selectedCount:u,deselectedCount:d};return this.selectionCountCache.set(e,p),p}if(e.length===r&&this.targetsVisibleRowsOnly()){let{toPrimaryKey:c}=this.getConfig(),u=0,d=0;this.getVisibleDataInsideGroup(e).forEach(f=>{this.isRowSelected(c(f),e)?u++:d++});let p={selectedCount:u,deselectedCount:d};return this.selectionCountCache.set(e,p),p}t=t??this.getGroupRowBooleanSelectionStateFromParent(e);let i=this.getGroupKeysDirectlyInsideGroup(e);if(e.length===this.getGroupByLength()){let c=this.selectedMap.has(e)?!0:this.deselectedMap.has(e)?!1:t,u=this.getGroupCount(e),d=this.selectedMap.getKeysStartingWith(e,{excludeSelf:!0,depthLimit:1}).length,p=this.deselectedMap.getKeysStartingWith(e,{excludeSelf:!0,depthLimit:1}).length,f=u-(d+p),m={selectedCount:d+(c?f:0),deselectedCount:p+(c?0:f)};return this.selectionCountCache.set(e,m),m}let a=0,l=0;i.forEach(c=>{let u=this.selectedMap.get(c),d=this.deselectedMap.get(c),p=u?!0:d?!1:t,{selectedCount:f,deselectedCount:m}=this.getSelectionCountFor(c,p);a+=f,l+=m});let s={selectedCount:a,deselectedCount:l};return this.selectionCountCache.set(e,s),s}};function or(o,e){return new Oe(o,mt(e))}function mt(o){return()=>{let e=typeof o=="function"?o():o,{originalDataArray:t,postFilterDataArray:n}=e,r=!!e.lazyLoad,i=r?e.originalLazyGroupData.get([vt]):void 0;return{lazyLoad:r,toPrimaryKey:e.toPrimaryKey,onlyUsePrimaryKeys:!e.useGroupKeysForMultiRowSelection,groupBy:e.groupBy,groupDeepMap:e.groupDeepMap,indexer:e.indexer,totalCount:r?t?.length??0:e.unfilteredCount,lazyGroupedRowCount:e.groupBy.length?i?.totalChildrenCount:void 0,lazyUnfilteredCount:e.groupBy.length?i?.totalChildrenCountUnfiltered:i?.totalCountUnfiltered,multiRowSelectionTarget:e.multiRowSelectionTarget,someRowsFilteredOut:!e.lazyLoad&&!!t&&!!n&&n.length<t.length,originalDataArray:t,postFilterDataArray:n}}}function yf(o){let{getDataSourceState:e,dataSourceActions:t}=o;return{get allRowsSelected(){return e().allRowsSelected},selectAll(){let{rowSelection:r,selectionMode:i}=e();if(i!=="multi-row")throw"Selection mode is not multi-row";if(!(r instanceof Oe))throw"Invalid row selection";let a=new Oe(r,mt(e));a.selectAll(),t.rowSelection=a},deselectAll(){let{rowSelection:r,selectionMode:i}=e();if(i!=="multi-row")throw"Selection mode is not multi-row";if(!(r instanceof Oe))throw"Invalid row selection";let a=new Oe(r,mt(e));a.deselectAll(),t.rowSelection=a},isRowSelected(r,i){let{rowSelection:a,selectionMode:l,indexer:s,groupBy:c}=e();if(l==="single-row")return a===r;if(l!=="multi-row")throw"Selection mode is not multi-row or single-row";if(!(a instanceof Oe))throw"Invalid row selection";if(!i){let u=s.getDataForPrimaryKey(r);i=u?Ho(u,c):[]}return a.isRowSelected(r,i)},isRowDeselected(r,i){return!this.isRowSelected(r,i)},selectRow(r,i){let{rowSelection:a,selectionMode:l,indexer:s,groupBy:c}=e();if(l==="single-row"){t.rowSelection=r;return}if(l!=="multi-row")throw"Selection mode is not multi-row or single-row";if(!(a instanceof Oe))throw"Invalid row selection";if(!i){let d=s.getDataForPrimaryKey(r);i=d?Ho(d,c):[]}let u=new Oe(a,mt(e));u.selectRow(r,i),t.rowSelection=u},deselectRow(r,i){let{selectionMode:a,rowSelection:l,indexer:s,groupBy:c}=e();if(a==="single-row"){t.rowSelection=null;return}if(a!=="multi-row")throw"Selection mode is not multi-row or single-row";if(!(l instanceof Oe))throw"Invalid row selection";if(a==="multi-row"){if(!i){let d=s.getDataForPrimaryKey(r);i=d?Ho(d,c):[]}let u=new Oe(l,mt(e));u.deselectRow(r,i),t.rowSelection=u}},toggleRowSelection(r,i){this.isRowSelected(r,i)?this.deselectRow(r,i):this.selectRow(r,i)},selectGroupRow(r){let{selectionMode:i,rowSelection:a,groupBy:l}=e();if(i!=="multi-row")throw'Selection mode should be "multi-row"';if(!l)throw"No grouping specified";if(!(a instanceof Oe))throw"Invalid row selection";let s=new Oe(a,mt(e));s.selectGroupRow(r),t.rowSelection=s},deselectGroupRow(r){let{selectionMode:i,rowSelection:a,groupBy:l}=e();if(i!=="multi-row")throw'Selection mode should be "multi-row"';if(!l)throw"No grouping specified";if(!(a instanceof Oe))throw"Invalid row selection";let s=new Oe(a,mt(e));s.deselectGroupRow(r),t.rowSelection=s},toggleGroupRowSelection(r){let{selectionMode:i,rowSelection:a,groupBy:l}=e();if(i!=="multi-row")throw'Selection mode should be "multi-row"';if(!l)throw"No grouping specified";if(!(a instanceof Oe))throw"Invalid row selection";let s=new Oe(a,mt(e));s.toggleGroupRowSelection(r),t.rowSelection=s},getGroupRowSelectionState(r,i){let a=e(),{selectionMode:l,groupBy:s}=a,c=i?new Oe(i,mt(a)):a.rowSelection;if(l!=="multi-row")throw'Selection mode should be "multi-row"';if(!s)throw"No grouping specified";if(!(c instanceof Oe))throw"Invalid row selection";return c.getGroupRowSelectionState(r)},getSelectedPrimaryKeys:r=>{let i=e(),a=r?new Oe(r,mt(i)):i.rowSelection,l=[];return i.lazyLoad&&console.error("getSelectedPrimaryKeys should not be called for lazy-loaded datasources as it wont return reliable results"),i.originalDataArray.forEach(s=>{let c=i.toPrimaryKey(s);a.isRowSelected(c)&&l.push(c)}),l}}}function Sf(o,e){ma(o,e),aC(o,e),e.detail===2&&iC(o,e),o.getState().onCellClick?.(o,e)}function iC(o,e){if(Hr(e.target))return;let{onCellDoubleClick:t}=o.getState(),n={preventEdit:!1};if(t){let a=t(o,e);a&&typeof a=="object"&&(n={...n,...a})}if(n.preventEdit)return;let i=o.getComputed().computedVisibleColumns[o.colIndex];o.api.startEdit({rowIndex:o.rowIndex,columnId:i.id})}function aC(o,e){let{getDataSourceState:t,getState:n,getComputed:r,rowIndex:i,colIndex:a,dataSourceActions:l}=o,s=t(),{selectionMode:c,cellSelection:u}=s;if(!u||c!=="multi-cell")return;let{multiCellSelector:d,computedVisibleColumns:p}=r(),{brain:f,debugId:m}=n(),{rowsPerPage:g}=f,h=p.length,S=new Ue(u);S.debugId=m??"",d.cellSelectionState=S;let y={rowIndex:i,colIndex:a};if(e.metaKey||e.ctrlKey)d.singleAddClick(y);else if(e.shiftKey){let T=!!n().wrapRowsHorizontally;d.multiSelectClick(y,T?{horizontalLayout:T,rowsPerPage:g,columnsPerSet:h}:{horizontalLayout:T})}else d.resetClick(y);l.cellSelection=S}function lC(o){return o.getState().multiRowSelectionWith!=="click"&&o.getComputed().renderSelectionCheckBox?"checkbox":"click"}function sC(o){return o?Hr(o)?!0:typeof o.closest!="function"?!1:!!o.closest(`.${Jn}, [data-name="expand-collapse-icon"]`):!1}function ma(o,e,t=e.key?"keyboard":"click"){let{rowIndex:n,getDataSourceState:r,getComputed:i,dataSourceActions:a,dataSourceApi:l,api:s,cloneRowSelection:c,cloneTreeSelection:u}=o,{multiRowSelector:d}=i(),p=r(),{selectionMode:f,dataArray:m,isTree:g}=p;if(t==="click"&&sC(e.target))return!1;let h=m[n];if(!h||h.rowDisabled)return!1;if(g){if(!h.isTreeNode||!h.nodePath)return!1;let{isNodeSelectable:S}=p;if(S&&!S(h))return!1}if(f==="multi-row"){let S=lC(o);if(t==="click"&&S==="checkbox")return!1;let y=t==="checkbox"||t==="keyboard"&&S==="checkbox",T=()=>{e.shiftKey?d.multiSelectClick(n):y||e.metaKey||e.ctrlKey?d.singleAddClick(n):d.resetClick(n)};if(g){let{treeSelectionState:R}=p;if(!(R instanceof Je))return!1;let C=u(R);d.treeSelectionState=C,T(),d.treeSelectionState=void 0;let I=!e.shiftKey&&(y||e.metaKey||e.ctrlKey);return p.lastSelectionUpdatedNodePathRef&&(p.lastSelectionUpdatedNodePathRef.current=I?{nodePath:h.nodePath,selected:!!C.isNodeSelected(h.nodePath)}:null),a.treeSelection=C,!0}let{rowSelection:b}=p;return!b||typeof b!="object"?!1:(b=c(b),d.rowSelectionState=b,T(),a.rowSelection=b,!0)}else if(f==="single-row"){if(h.isGroupRow)return!1;let S=e.metaKey||e.ctrlKey||t!=="click";if(g){let{treeApi:T}=l;return S?T.toggleNodeSelection(h.nodePath):T.selectNode(h.nodePath),!0}let y=h.id;return S?s.rowSelectionApi.toggleRowSelection(y):s.rowSelectionApi.selectRow(y),!0}return!1}function bf(o,e){let{getComputed:t,dataSourceActions:n,dataSourceApi:r}=o,i=t().multiRowSelector,a=i.lastPointerDown;i.lastPointerDown=void 0;let l=o.getDataSourceState;return ma({rowIndex:e,api:o,getComputed:t,getState:o.getState,getDataSourceState:l,dataSourceActions:n,dataSourceApi:r,cloneRowSelection:s=>or(s,l),cloneTreeSelection:s=>tr(s,l)},{key:"",metaKey:!1,ctrlKey:!1,shiftKey:a?.rowIndex===e&&a.shiftKey,preventDefault:()=>{}},"checkbox")}var Wr=H(require("react")),If=require("react");var Tf="_96uiwi0 _16lm1iw1d _16lm1iwk _16lm1iw9",Cf=Se({defaultClassName:"_96uiwi1",variantClassNames:{expanded:{true:"_16lm1iwi",false:"_96uiwi3"},direction:{end:"_96uiwi4",start:"_96uiwi5"},disabled:{true:"_96uiwi6",false:"_96uiwi7"}},defaultVariants:{},compoundVariants:[[{expanded:!1,direction:"end"},"_16lm1iwj"]]});var Rf="M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z",C1=Object.keys({size:1,expanded:1,defaultExpanded:1,onChange:1,style:1,disabled:1,className:1,direction:1});var ga=`${ct}-expand-collapse`;function pn(o){let{size:e=24,direction:t="start",disabled:n=!1}=o,[r,i]=(0,If.useState)(o.expanded??o.defaultExpanded),a=()=>{o.onChange?.(!r),Fo("expanded",o)||i(!r)};Wr.useEffect(()=>{Fo("expanded",o)&&i(o.expanded)},[o.expanded]);let l=r?"expanded":"collapsed";return Wr.createElement("svg",{"data-name":"expand-collapse-icon","data-state":l,"data-disabled":n,xmlns:"http://www.w3.org/2000/svg",height:`${e}px`,viewBox:"0 0 24 24",width:`${e}px`,style:o.style,onClick:n?void 0:a,className:X(o.className,Tf,Hn.expandCollapse,Cf({direction:t||"start",expanded:r,disabled:n}),`${ct}`,`${ga}`,`${ga}--${l}`,`${ga}--${t==="end"?"end":"start"}`,n?`${ga}--disabled`:"")},Wr.createElement("path",{d:Rf}))}function wf(o){return typeof o.field=="string"}function vf(o){let{column:e,rowInfo:t,fieldsToColumn:n}=o,r;if(e.groupByForColumn){if(t.isGroupRow){let i=t.groupBy[t.groupBy.length-1];(Array.isArray(e.groupByForColumn)||e.groupByForColumn===i)&&(r=i?n.get(i.field||i.groupField):void 0)}!r&&e.field&&(r=n.get(e.field))}return r}function to(o){let{getComputed:e,getDataSourceState:t,getState:n,rowIndex:r,columnId:i,api:a,dataSourceApi:l}=o,{dataArray:s}=t(),c=s[r],{isGroupRow:u,isTreeNode:d}=c,p=e().computedColumnsMap.get(i),{activeRowIndex:f,keyboardNavigation:m,isRowDetailEnabled:g}=n(),h=r===f&&m==="row",S=!g||typeof g=="function"&&!g(c)?!1:a.rowDetailApi.isRowDetailExpanded(c.id)?"expanded":"collapsed",{formattedValue:y,formattedValueContext:{rawValue:T}}=nr({column:p,rowInfo:c,rowDetailState:S,columnsMap:e().computedColumnsMap,context:o}),b=bt(p.id,o);return u?{api:a,dataSourceApi:l,column:p,columnApi:b,isParentNode:!1,isGroupRow:!0,isTreeNode:!1,nodeExpanded:!1,rowDetailState:!1,data:c.data,rowActive:h,rowInfo:c,rowSelected:c.rowSelected,value:y,rawValue:T}:d?c.isParentNode?{api:a,dataSourceApi:l,columnApi:b,column:p,nodeExpanded:c.nodeExpanded,isTreeNode:!0,isGroupRow:!1,isParentNode:!0,rowDetailState:S,data:c.data,rowActive:h,rowInfo:c,rowSelected:c.rowSelected,value:y,rawValue:T}:{api:a,dataSourceApi:l,columnApi:b,column:p,nodeExpanded:!1,isTreeNode:!0,isGroupRow:!1,isParentNode:!1,rowDetailState:S,data:c.data,rowActive:h,rowInfo:c,rowSelected:c.rowSelected,value:y,rawValue:T}:{api:a,dataSourceApi:l,columnApi:b,column:p,isTreeNode:!1,isParentNode:!1,isGroupRow:!1,nodeExpanded:!1,rowDetailState:S,data:c.data,rowActive:h,rowInfo:c,rowSelected:c.rowSelected,value:y,rawValue:T}}function Pf(o){return xf(o.column,o.rowInfo)}function Df(o){let{column:e,context:t,rowInfo:n,visibleColumnIds:r}=o,i=vf({rowInfo:n,column:e,fieldsToColumn:o.fieldsToColumn,groupRenderStrategy:t.getState().groupRenderStrategy}),{getState:a}=t,{editingCell:l}=a(),s=nr(o),{formattedValueContext:c}=s,u=t.api.isEditorVisibleForCell({columnId:e.id,rowIndex:n.indexInAll}),d=Object.assign({rowIndexInHorizontalLayoutPage:o.rowIndexInHorizontalLayoutPage,horizontalLayoutPageIndex:o.horizontalLayoutPageIndex,column:o.column,inEdit:u,rowHasSelectedCells:!1},c,{editError:l&&l.primaryKey===n.id&&l.columnId===e.id&&!l.active&&l.accepted instanceof Error?l.accepted:void 0});Object.defineProperty(d,"rowHasSelectedCells",{get(){return n.hasSelectedCells(r)}});let p=typeof e.align=="function"?e.align({isHeader:!1,...d}):e.align??"start",f=typeof e.verticalAlign=="function"?e.verticalAlign({isHeader:!1,...d}):e.verticalAlign??"center";return{inEdit:u,stylingParam:d,formattedValueContext:c,renderFunctions:{renderGroupIcon:e.renderGroupIcon||i?.renderGroupIcon,renderSelectionCheckBox:e.renderSelectionCheckBox,renderRowDetailIcon:e.renderRowDetailIcon,renderTreeIcon:e.renderTreeIcon,renderTreeIconForParentNode:e.renderTreeIconForParentNode,renderTreeIconForLeafNode:e.renderTreeIconForLeafNode,renderValue:e.renderValue||i?.renderValue,renderGroupValue:e.renderGroupValue||i?.renderGroupValue,renderLeafValue:e.renderLeafValue||i?.renderLeafValue},renderParams:cC({rowIndexInHorizontalLayoutPage:o.rowIndexInHorizontalLayoutPage,horizontalLayoutPageIndex:o.horizontalLayoutPageIndex,column:o.column,rowInfo:o.rowInfo,visibleColumnIds:o.visibleColumnIds,columnsMap:o.columnsMap,fieldsToColumn:o.fieldsToColumn,context:o.context,align:p,verticalAlign:f,formattedValueContext:c}),groupByColumnReference:i}}function cC(o){let{column:e,context:t,rowInfo:n,align:r,verticalAlign:i,visibleColumnIds:a,columnsMap:l,fieldsToColumn:s,formattedValueContext:c}=o,{value:u}=c,{api:d,getDataSourceState:p,getState:f,dataSourceApi:m}=t,{editingCell:g}=f(),{indexInAll:h}=n,S=p(),{selectionMode:y,cellSelection:T}=S,b=vf({rowInfo:n,column:e,fieldsToColumn:s,groupRenderStrategy:t.getState().groupRenderStrategy}),R=d.toggleGroupRow,C=T?.isCellSelected(n.id,e.id)??!1,I={column:e,columnsMap:l,fieldsToColumn:s,align:r,verticalAlign:i,cellSelected:C,rowHasSelectedCells:!1,horizontalLayoutPageIndex:o.horizontalLayoutPageIndex,rowIndexInHorizontalLayoutPage:o.rowIndexInHorizontalLayoutPage,...c,editError:g&&g.primaryKey===n.id&&g.columnId===e.id&&!g.active&&g.accepted instanceof Error?g.accepted:void 0,groupByColumn:b,selectionMode:y,api:d,dataSourceApi:m,toggleCurrentRowDetails:()=>d.rowDetailApi.toggleRowDetail(n.id),toggleRowDetails:d.rowDetailApi.toggleRowDetail,expandRowDetails:d.rowDetailApi.expandRowDetail,collapseRowDetails:d.rowDetailApi.collapseRowDetail,toggleCurrentTreeNode:()=>{m.treeApi.toggleNode(n.nodePath)},toggleTreeNode:m.treeApi.toggleNode,expandTreeNode:m.treeApi.expandNode,collapseTreeNode:m.treeApi.collapseNode,selectTreeNode:m.treeApi.selectNode,deselectTreeNode:m.treeApi.deselectNode,toggleTreeNodeSelection:m.treeApi.toggleNodeSelection,toggleCurrentTreeNodeSelection:()=>{n.isTreeNode&&m.treeApi.toggleNodeSelection(n.nodePath)},selectRow:d.rowSelectionApi.selectRow,deselectRow:d.rowSelectionApi.deselectRow,toggleRowSelection:d.rowSelectionApi.toggleRowSelection,toggleGroupRowSelection:d.rowSelectionApi.toggleGroupRowSelection,selectCell:()=>{d.cellSelectionApi.selectCell({rowId:n.id,colId:e.id})},deselectCell:()=>{d.cellSelectionApi.deselectCell({rowId:n.id,colId:e.id})},renderBag:{all:null,value:typeof u=="boolean"?`${u}`:u,selectionCheckBox:null,groupIcon:null,treeIcon:null},selectCurrentRow:()=>{if(!n.isTreeNode)return d.rowSelectionApi.selectRow(n.id,n.dataSourceHasGrouping?n.groupKeys:void 0)},deselectCurrentRow:()=>{if(!n.isTreeNode)return d.rowSelectionApi.deselectRow(n.id,n.dataSourceHasGrouping?n.groupKeys:void 0)},rowIndex:h,toggleGroupRow:R,toggleCurrentGroupRow:()=>{n.isGroupRow&&R(n.groupKeys)},toggleCurrentRowSelection:()=>{if(!(n.isGroupRow||n.isTreeNode))return d.rowSelectionApi.toggleRowSelection(n.id)},toggleCurrentGroupRowSelection:()=>{if(n.isGroupRow)return d.rowSelectionApi.toggleGroupRowSelection(n.isGroupRow?n.groupKeys:[])},rootGroupBy:S.groupBy,pivotBy:S.pivotBy};return Object.defineProperty(I,"rowHasSelectedCells",{get(){return n.hasSelectedCells(a)}}),I}function uC(o,e){if(!o.isGroupRow)return;let t=o.groupData;if(!t.length)return;let n=t[0][e];for(let r=1,i=t.length;r<i;r++)if(t[r][e]!==n)return;return n}function xf(o,e){let{data:t,isGroupRow:n,dataSourceHasGrouping:r}=e,i=r?e.groupBy:void 0,a=n&&i&&o.groupByForColumn&&(Array.isArray(o.groupByForColumn)||o.groupByForColumn===i[i.length-1])?e.value:wf(o)?t?.[o.field]:null;return o.field&&e.isGroupRow&&e.reducerData&&e.reducerData[o.field]!=null&&(a=e.reducerData[o.field]),a===void 0&&e.isGroupRow&&o.groupByForColumn&&wf(o)&&(a=uC(e,o.field)),o.valueGetter&&!e.isGroupRow&&e.data&&(a=o.valueGetter({data:e.data,field:o.field})),a}function dC(o,e,t,n,r){let{rowSelected:i,indexInAll:a}=t,{activeRowIndex:l,keyboardNavigation:s}=n.getState(),c=a===l&&s==="row";return t.isGroupRow?{rowInfo:t,isGroupRow:!0,isTreeNode:!1,isParentNode:!1,nodeExpanded:!1,data:t.data,rowDetailState:!1,rowSelected:i,rowActive:c,value:o,rawValue:o,field:e.field}:t.isTreeNode?t.isParentNode?{rowInfo:t,isGroupRow:!1,isTreeNode:!0,isParentNode:!0,nodeExpanded:t.nodeExpanded,data:t.data,rowDetailState:r,rowSelected:i,rowActive:c,value:o,rawValue:o,field:e.field}:{rowInfo:t,isGroupRow:!1,isTreeNode:!0,isParentNode:!1,nodeExpanded:!1,data:t.data,rowDetailState:r,rowSelected:i,rowActive:c,value:o,rawValue:o,field:e.field}:{rowInfo:t,isGroupRow:!1,isTreeNode:!1,isParentNode:!1,nodeExpanded:!1,data:t.data,rowDetailState:r,rowSelected:i,rowActive:c,value:o,rawValue:o,field:e.field}}function nr(o){let{column:e,rowInfo:t,context:n,rowDetailState:r}=o,i=xf(e,t),a=dC(i,e,t,n,r),l=e.valueFormatter?e.valueFormatter(a):i;return a.value=l,{formattedValue:l,formattedValueContext:a}}var Ef=Se({defaultClassName:"_7pupv01",variantClassNames:{align:{start:"_7pupv02",center:"_7pupv03",end:"_7pupv04"}},defaultVariants:{},compoundVariants:[]}),Mf="_7pupv00",Af=Se({defaultClassName:"_7pupv05",variantClassNames:{align:{start:"_7pupv06",center:"_7pupv07",end:"_7pupv08"}},defaultVariants:{},compoundVariants:[]});var{rootClassName:_f}=ze,mo=`${_f}Cell`,jr=`${_f}Cell_content`;var{rootClassName:pC}=ze,oo=`${pC}ColumnCell`;var fC=Q(J.columnZIndexAtIndex),mC=Q(J.columnVisibilityAtIndex);function Of({rowInfo:o,column:e}){let t=0;if(o.dataSourceHasGrouping)if(o.isGroupRow){let n=e?.groupByForColumn,r=o.groupBy[o.groupBy.length-1],i=!!o.pivotValuesMap,a=i&&!!e?.field&&!!n&&!Array.isArray(n)&&(n.field??n.groupField)!==(r?.field??r?.groupField),l=i&&Array.isArray(n)&&o.groupNesting===o.rootGroupBy.length;t=a||l?o.groupNesting:o.groupNesting-1}else t=o.groupNesting;return{[Q(he.components.Row.groupNesting)]:t}}function Ff({rowInfo:o}){return{[Q(he.components.Row.groupNesting)]:o.isTreeNode?o.isParentNode?o.treeNesting:o.treeNesting+1:0}}function Ws(o,e){return o?typeof o=="function"?o(e):o:void 0}function js(o,e,t){return typeof e=="function"?{...o,...e(t)}:{...o,...e}}function Nf(o){let{column:e,rowInfo:t,rowIndex:n,rowHeight:r,rowIndexInHorizontalLayoutPage:i,horizontalLayoutPageIndex:a,align:l,verticalAlign:s,stylingParam:c,formattedValueContext:u,groupByColumnReference:d,rowStyle:p,rowClassName:f,cellStyle:m,cellClassName:g,showZebraRows:h,rowActive:S,rowDisabled:y,rowSelected:T,cellSelected:b,cellSelection:R,getData:C,computedVisibleColumns:I,visibleColumnIds:w,computedColumnOrder:v,columnReorderInPageIndex:P}=o,E=w??I.map(ue=>ue.id),M=v,D,x={...u,visibleColumnIds:E,allColumnIds:M,rowIndex:n,get rowHasSelectedCells(){return D===void 0&&(D=t.hasSelectedCells(E)),D}},A=!!(t.isTreeNode&&(e.renderTreeIcon||e.renderTreeIconForLeafNode||e.renderTreeIconForParentNode)),O=typeof f=="function"?f(x):f,F;d?.className&&(F=Ws(d.className,c)),g&&(F=X(F,Ws(g,c))),e.className&&(F=X(F,Ws(e.className,c))),A&&(F=X(F,Af({align:l})));let z;t.dataSourceHasGrouping&&e.groupByForColumn&&(z=Of({rowInfo:t,column:e})),A&&(z=Ff({rowInfo:t})),p&&(z=typeof p=="function"?{...z,...p(x)}:{...z,...p}),m&&(z=js(z,m,c)),d?.style&&(z=js(z,d.style,c)),e.style&&(z=js(z,e.style,c)),z=z||{},z.height=r,z.zIndex=`var(${fC}-${e.computedVisibleIndex})`,z.visibility=`var(${mC}-${e.computedVisibleIndex}, visible)`;let L=i!=null?i%2===1:(t.indexInAll!=null?t.indexInAll:n)%2===1,B=h?L?"odd":"even":!1,Y=!1,V=!1,W=!1,N=!1;if(R&&b){let ue=C(),fe=ue[t.indexInAll-1],be=ue[t.indexInAll+1],de=I[e.computedVisibleIndex+1],U=I[e.computedVisibleIndex-1];Y=fe?!R.isCellSelected(fe.id,e.id):!0,e.computedPinned==="end"&&e.computedFirstInCategory?V=!0:V=U?!R.isCellSelected(t.id,U.id):!0,e.computedPinned==="start"&&e.computedLastInCategory?W=!0:W=de?!R.isCellSelected(t.id,de.id):!0,N=be?!R.isCellSelected(be.id,e.id):!0}let K=R&&b?{top:Y,left:V,right:W,bottom:N}:null,ae=P!=null?a!==P:!1,re=X(K?af(K):"",Yi(e,[oo,mo],rf,{dragging:!1,insideDisabledDraggingPage:ae,zebra:B,align:l,verticalAlign:s,rowDisabled:y,rowActive:S,cellSelected:b,rowSelected:T,treeNode:t.isTreeNode?t.isParentNode?"parent":"leaf":!1,firstRow:t.indexInAll===0,firstRowInHorizontalLayoutPage:i===0,groupRow:t.isGroupRow,groupCell:t.isGroupRow?!!e.groupByForColumn:!1,rowExpanded:t.isGroupRow?!t.collapsed:!1}),F,O);return{style:z,className:re,cellSelectionBorders:K,zebra:B,columnIsTree:A}}var go=H(require("react"));var gC=Q(J.columnWidthAtIndex),hC=Q(J.columnReorderEffectDurationAtIndex);function yC(o){let{cssEllipsis:e=!0,virtualized:t=!0,skipColumnShifting:n=!1,contentStyle:r,column:i,domRef:a,width:l,contentClassName:s,rowId:c,afterChildren:u,beforeChildren:d,cellType:p,cssPosition:f,renderChildren:m,horizontalLayoutPageIndex:g,...h}=o,S=typeof m=="function"?m():m,y={width:`var(${gC}-${i.computedVisibleIndex})`,transition:`transform var(${hC}-${i.computedVisibleIndex}, 0s)`,...h.style},T={...h,style:y,"data-column-id":i.id,"data-z-index":y.zIndex,className:X(h.className,mo,nf),children:go.createElement(go.Fragment,null,d,go.createElement("div",{className:X(jr,e?Ht:ld.hidden,s),style:r},S),u)};c!=null&&(T["data-row-id"]=`${c}`);let b=p==="body"?i.components?.ColumnCell:i.components?.HeaderCell;return b?go.createElement(b,{...T,ref:a}):go.createElement("div",{...T,ref:a})}var ha=go.memo(yC);var mn=H(require("react")),fn=require("react");function Lf(){let{initialValue:o,setValue:e,confirmEdit:t,cancelEdit:n,readOnly:r}=ya(),i=(0,fn.useRef)(null),a=(0,fn.useRef)(!1),l=mn.useCallback(u=>{i.current=u,u&&u.focus()},[]),s=(0,fn.useCallback)(u=>{let{key:d}=u;d==="Enter"||d==="Tab"?t():d==="Escape"?(a.current=!0,n()):u.stopPropagation()},[]),c=(0,fn.useCallback)(()=>{a.current||t()},[]);return mn.createElement(mn.Fragment,null,mn.createElement("input",{readOnly:r,ref:l,onKeyDown:s,onBlur:c,className:X(ed,ad.none),type:"text",defaultValue:o,onChange:(0,fn.useCallback)(u=>{e(u.target.value)},[])}))}function kf(o,e){let t=[];for(let n in o)o.hasOwnProperty(n)&&!e.hasOwnProperty(n)&&t.push(o[n]);return t}var Ur=we.createContext(null),SC=o=>{let{toggleCurrentRowDetails:e,rowDetailState:t}=o;return we.createElement(pn,{style:{visibility:t===!1?"hidden":"visible"},expanded:t==="expanded",onChange:e})},bC={display:"inline-block",visibility:"visible"},Us=o=>{let{rowInfo:e,toggleCurrentTreeNode:t,nodeExpanded:n,api:r}=o,i=r.getDataSourceState().isNodeReadOnly;return we.createElement(pn,{disabled:e.isTreeNode&&e.isParentNode?i(e):!1,style:bC,expanded:n,onChange:t})},TC=o=>{let{rowInfo:e,rowIndex:t,column:n,api:r}=o;e.isGroupRow&&n.groupByForColumn;let{components:i}=r.getState(),a=r.getDataSourceState().isNodeSelectable,l=i?.CheckBox||zo;return we.createElement(l,{domProps:{className:Jn},disabled:e.isTreeNode?!a(e):!1,onChange:()=>{bf(r,t)},checked:e.rowSelected})};function CC(o){let{repaintCellsKey:e,column:t,rowIndex:n,rowInfoStore:r,getDataSourceState:i}=o,[,a]=(0,ke.useReducer)(s=>s+1,0),l=tf(e)?e:void 0;(0,ke.useEffect)(()=>{if(l)return of(l,{column:t,rowIndex:n,rowInfoStore:r,getDataSourceState:i},a)},[l,t,n,r,i])}function RC(o){let{dataSourceStatePartialForCell:e,rowInfoStore:t,rowStyle:n,rowClassName:r,rowIndexInHorizontalLayoutPage:i,horizontalLayoutPageIndex:a,getData:l,visibleColumnIds:s,computedColumnOrder:c,cellStyle:u,cellClassName:d,repaintCellsKey:p,rowDetailState:f,width:m,column:g,onMouseLeave:h,onMouseEnter:S,onRowMouseEnter:y,onRowMouseLeave:T,rowIndex:b,rowHeight:R,columnsMap:C,fieldsToColumn:I,domRef:w,hidden:v,showZebraRows:P,getDataSourceState:E,dataSourceApi:M,dataSourceActions:D,getState:x,imperativeApi:A,componentActions:O,getComputed:F,getDataSourceMasterContext:z}=o,L=(0,ke.useSyncExternalStore)((0,ke.useCallback)(ce=>t.subscribeToRowIndex(b,ce),[t,b]),(0,ke.useCallback)(()=>t.getRowInfoAtIndex(b),[t,b]));CC({repaintCellsKey:p,column:g,rowIndex:b,rowInfoStore:t,getDataSourceState:E});let B=!L,Y=!g,V=we.useRef(null),W=(0,ke.useCallback)(ce=>{V.current=ce,w&&w(ce)},[w]),N=L??{id:"",indexInAll:b,rowSelected:!1,rowDisabled:!1,isCellSelected:()=>!1,hasSelectedCells:()=>!1,isGroupRow:!1,isTreeNode:!1,isParentNode:!1,treeNesting:0,nodePath:[],collapsed:!1,dataSourceHasGrouping:!1,selfLoaded:!0,data:{}},{rowSelected:K}=N,ae=F(),{activeRowIndex:re,keyboardNavigation:ue,columnReorderInPageIndex:fe}=x(),be=b===re&&ue==="row",de={getState:x,getDataSourceState:E,getDataSourceMasterContext:z,actions:O,dataSourceActions:D,api:A,dataSourceApi:M},U=N.rowDisabled,ie=Df({horizontalLayoutPageIndex:a,rowIndexInHorizontalLayoutPage:i,column:g,rowInfo:N,rowDetailState:f,columnsMap:C,visibleColumnIds:s,fieldsToColumn:I,context:de}),{stylingParam:ge,renderParams:Z,formattedValueContext:ee,renderFunctions:j,groupByColumnReference:se,inEdit:ne}=ie,{align:pe,verticalAlign:k}=Z,_=Z,me=we.useRef(_),Te=y&&S?ce=>{let Ze={...ee,rowIndex:b};y(Ze,ce),S(ce)}:S,Pe=T&&h?ce=>{let Ae={...ee,rowIndex:b,rowInfo:N};T(Ae,ce),h(ce)}:h,Re=(0,ke.useCallback)(ce=>{let Ae=g.computedVisibleIndex;x().cellClick({rowIndex:b,colIndex:Ae,event:ce})},[b,g.computedVisibleIndex,ue]),Me=(0,ke.useCallback)(ce=>{let Ae=g.computedVisibleIndex;if(x().cellMouseDown({rowIndex:b,colIndex:Ae,event:ce}),ue==="row"){U||(O.activeRowIndex=b);return}ue==="cell"&&(O.activeCellIndex=[b,Ae])},[b,U,g.computedVisibleIndex,ue]),{selectionMode:qe,cellSelection:We,isNodeReadOnly:it}=e,at=_.cellSelected;_.domRef=W,_.htmlElementRef=V,_.toggleCurrentTreeNode=(0,ke.useCallback)(_.toggleCurrentTreeNode,[N]),_.selectCell=(0,ke.useCallback)(_.selectCell,[N]),_.deselectCell=(0,ke.useCallback)(_.deselectCell,[N]),_.selectCurrentRow=(0,ke.useCallback)(_.selectCurrentRow,[N]),_.deselectCurrentRow=(0,ke.useCallback)(_.deselectCurrentRow,[N]),_.toggleCurrentGroupRow=(0,ke.useCallback)(_.toggleCurrentGroupRow,[N]),_.toggleCurrentRowSelection=(0,ke.useCallback)(_.toggleCurrentRowSelection,[N]),_.toggleCurrentGroupRowSelection=(0,ke.useCallback)(_.toggleCurrentGroupRowSelection,[N]),_.toggleCurrentTreeNodeSelection=(0,ke.useCallback)(_.toggleCurrentTreeNodeSelection,[N]);let et=g.components?.Editor??Lf,Xe=ne?we.createElement(Vf,{contextValue:_},we.createElement(et,null)):null,G=(0,ke.useCallback)(yt(()=>{if(v||ne)return null;if(me.current=_,j.renderGroupIcon&&(_.renderBag.groupIcon=we.createElement(Pt,{render:j.renderGroupIcon,renderParam:{..._,renderBag:{..._.renderBag}}})),j.renderSelectionCheckBox&&qe=="multi-row"&&(_.renderBag.selectionCheckBox=we.createElement(Pt,{render:TC,renderParam:_}),j.renderSelectionCheckBox!==!0&&(_.renderBag.selectionCheckBox=we.createElement(Pt,{render:j.renderSelectionCheckBox,renderParam:{..._,renderBag:{..._.renderBag}}}))),N.isTreeNode){let{isParentNode:Ze}=N,Rt;Rt=(Ze?j.renderTreeIconForParentNode:j.renderTreeIconForLeafNode)||typeof j.renderTreeIcon=="function"?j.renderTreeIcon:Ze&&j.renderTreeIcon===!0?Us:void 0,Rt===!0?Rt=Us:Rt&&(_.renderBag.treeIcon=we.createElement(Pt,{render:Us,renderParam:_})),Rt&&(_.renderBag.treeIcon=we.createElement(Pt,{render:Rt,renderParam:{..._,renderBag:{..._.renderBag}}}))}j.renderRowDetailIcon&&(_.renderBag.rowDetailsIcon=we.createElement(Pt,{render:SC,renderParam:{..._,renderBag:{..._.renderBag}}}),typeof j.renderRowDetailIcon=="function"&&(_.renderBag.rowDetailsIcon=we.createElement(Pt,{render:j.renderRowDetailIcon,renderParam:{..._,renderBag:{..._.renderBag}}}))),j.renderValue&&(_.renderBag.value=we.createElement(Pt,{render:j.renderValue,renderParam:{..._,renderBag:{..._.renderBag}}})),N.isGroupRow&&j.renderGroupValue&&(_.renderBag.value=we.createElement(Pt,{render:j.renderGroupValue,renderParam:{..._,renderBag:{..._.renderBag}}})),!N.isGroupRow&&j.renderLeafValue&&(_.renderBag.value=we.createElement(Pt,{render:j.renderLeafValue,renderParam:{..._,renderBag:{..._.renderBag}}})),me.current=_;let ce=_.renderBag.value;ce instanceof Date&&(ce=ce.toLocaleDateString());let Ae=we.createElement(we.Fragment,null,pe!=="end"?_.renderBag.treeIcon:null,pe!=="end"?_.renderBag.groupIcon:null,pe!=="end"?_.renderBag.rowDetailsIcon:null,pe!=="end"?_.renderBag.selectionCheckBox:null,ce,pe==="end"?_.renderBag.selectionCheckBox:null,pe==="end"?_.renderBag.rowDetailsIcon:null,pe==="end"?_.renderBag.groupIcon:null,pe==="end"?_.renderBag.treeIcon:null);return g.render?we.createElement(Pt,{render:g.render,renderParam:{..._,renderBag:{..._.renderBag,all:Ae}}}):Ae}),[g,v,ne,f,g.renderTreeIcon||g.renderTreeIconForParentNode?it:!1,...kf(_,{renderBag:!0,selectCell:!0,deselectCell:!0,selectCurrentRow:!0,deselectCurrentRow:!0,toggleCurrentGroupRow:!0,toggleCurrentRowDetails:!0,toggleCurrentRowSelection:!0,toggleCurrentGroupRowSelection:!0,toggleCurrentTreeNodeSelection:!0,toggleCurrentTreeNode:!0,rowHasSelectedCells:!0})]),{style:te,className:ye}=Nf({column:g,rowInfo:N,rowIndex:b,rowHeight:R,rowIndexInHorizontalLayoutPage:i,horizontalLayoutPageIndex:a,align:pe,verticalAlign:k,stylingParam:ge,formattedValueContext:ee,groupByColumnReference:se,rowStyle:n,rowClassName:r,cellStyle:u,cellClassName:d,showZebraRows:P,rowActive:be,rowDisabled:U,rowSelected:K,cellSelected:at,cellSelection:We,getData:l,visibleColumnIds:s,computedVisibleColumns:ae.computedVisibleColumns,computedColumnOrder:c,columnReorderInPageIndex:fe}),Ie=(0,ke.useMemo)(()=>te,[te?JSON.stringify(te):null]),ut=Xe,le=G(),$={domRef:W,cellType:"body",column:g,width:m,rowId:N.id,horizontalLayoutPageIndex:a,style:Ie,onMouseLeave:Pe,onMouseEnter:Te,onClick:Re,afterChildren:ut,onMouseDown:Me,cssEllipsis:g.cssEllipsis??!0,className:ye,renderChildren:(0,ke.useCallback)(()=>le,[G])},tt=Ur.Provider;return Y||B?we.createElement("div",{ref:W,style:{display:"none"}}):we.createElement(tt,{value:me.current},we.createElement(ha,{...$}))}var zf=we.memo(RC);function $r(){return(0,ke.useContext)(Ur)}function ya(){let{api:o,editingValueRef:e,editingCell:t}=oe(f=>({api:f.api,editingCell:f.state.editingCell,editingValueRef:f.state.editingValueRef})),{column:n,rowInfo:r}=$r(),[i]=we.useState(()=>t?.value),[a,l]=we.useState(i),s=t?!t.active&&!!t.waiting:!1,c=we.useCallback(f=>{e.current=f,l(f)},[]);we.useLayoutEffect(()=>{e.current=i},[]);let u=o.confirmEdit,d=o.cancelEdit,p=o.rejectEdit;return{api:o,initialValue:i,value:a,readOnly:s,column:n,rowInfo:r,setValue:c,confirmEdit:u,cancelEdit:d,rejectEdit:p}}function Yr(o){return o.render(o.renderParam)??null}function Pt(o){let e=Ur.Provider;return rr.createElement(e,{value:o.renderParam},rr.createElement(Yr,{render:o.render,renderParam:o.renderParam}))}function Vf(o){let e=Ur.Provider;return rr.createElement(e,{value:o.contextValue},o.children)}function Ko(o){let e=Sa.Provider;return rr.createElement(e,{value:o.renderParam},rr.createElement(Yr,{render:o.render,renderParam:o.renderParam}))}var Bo=H(require("react"));var Gf="yhvuzb1",Hf="yhvuzb0";var qr=zi({"data-name":""}),Xr={[qr["data-name"]]:"menu-icon"},N_=`[${qr["data-name"]}="${Xr["data-name"]}"]`;var IC={width:"100%",pointerEvents:"none"},$s=X(`${ct}-menu`,Gf);function Zr(o){let{style:e,className:t,domProps:n,reserveSpaceWhenHidden:r,menuVisible:i,children:a}=o,l={...IC,borderTop:`${he.components.HeaderCell.menuIconLineWidth} solid currentColor`,...o.lineStyle};return Bo.createElement("div",{...n,style:e,...Xr,onPointerDown:s=>s.stopPropagation(),className:X(t,Gd({menuVisible:i,reserveSpaceWhenHidden:r}),ct,`${ct}-menu`,a==null?Hf:"")},a??Bo.createElement(Bo.Fragment,null,Bo.createElement("div",{className:$s,style:l}),Bo.createElement("div",{className:$s,style:l}),Bo.createElement("div",{className:$s,style:l})))}var ir=H(require("react")),Qr=require("react");var Kf="_1b8djff0 _16lm1iw1p _16lm1iw2f _16lm1iw1 _16lm1iw32",Bf={asc:"_1b8djff1",desc:"_1b8djff2",none:"_1b8djff3"},ba="_1b8djff4";var Wf={transition:"width 0.25s, opacity 0.25s"},q_=Object.keys({direction:1,size:1,lineWidth:1,lineStyle:1,style:1,className:1,index:1,forceSize:1});function Ta(o){let[e,t]=(0,Qr.useState)(!0),[n,r]=(0,Qr.useState)(0),{direction:i,lineWidth:a=1,style:l,className:s,index:c}=o,u=c!=null&&c>0,d=o.size??16,p=Math.floor(d/4),f=i?[d-3*p,d-2*p,d-p]:[0,0,0];i===-1&&f.reverse();let m={...Wf,borderTop:`${a}px solid currentColor`,...o.lineStyle,opacity:n};(0,Qr.useEffect)(()=>{let y=i!=0?1:0;if(!e&&y&&t(!0),y!==n){let T=requestAnimationFrame(()=>{r(y)});return()=>{cancelAnimationFrame(T)}}return()=>{}},[i,e]);let g=()=>{let T=!(n===0&&i===0);T!==e&&t(T)};if(!e&&!o.forceSize)return null;let h=i===1?"asc":i===-1?"desc":"none",S={};return i===-1&&(S.top="100%"),ir.createElement("div",{"data-name":"sort-icon",style:{...l,width:d},className:X(s,ct,Kf,Bf[h],`${ct}-sort`,`${ct}-sort--${h}`)},u?ir.createElement("div",{"data-name":"index",style:S,className:Bd},c):null,ir.createElement("div",{className:ba,style:{width:f[0],...m},onTransitionEnd:g}),ir.createElement("div",{className:ba,style:{width:f[1],...m}}),ir.createElement("div",{className:ba,style:{width:f[2],...m}}))}var qf=H(require("react")),qs=require("react");function Ys(o){return Math.max(o.width-Xt(),0)}function jf(o){let{context:e,column:t,diff:n,shareSpaceOnResize:r}=o,i=e.getState(),{columnSizing:a,viewportReservedWidth:l,bodySize:s}=i,c=e.getComputed().computedVisibleColumns,u=!1,d=c.reduce((f,m)=>(m.computedFlex&&(f[m.id]={...a[m.id],flex:m.computedWidth},u=!0),f),{}),p=u?{...a,...d}:a;return Ss({shareSpaceOnResize:r,availableSize:Ys(s),reservedWidth:l||0,dragHandleOffset:n,dragHandlePositionAfter:t.computedVisibleIndex,columnSizing:p,items:c.map(f=>({id:f.id,computedFlex:f.computedFlex,computedWidth:f.computedWidth,computedMinWidth:f.computedMinWidth,computedMaxWidth:f.computedMaxWidth}))})}var Jr=require("react"),ei=H(require("react"));function Uf(o,{columns:e,shareSpaceOnResize:t,domRef:n}){let r=e[o];return{resize(i){ve.columnWidths.set(o,r.computedWidth+i,n.current);let a=o+1;if(t){let l=e[a];if(!l)return;ve.columnWidths.set(a,l.computedWidth-i,n.current),l.computedPinned==="start"?Ds(l,i,n.current):ve.columnOffsets.set(a,l.computedOffset+i,n.current);return}if(r.computedPinned!=="end"){if(r.computedPinned==="start"){for(let l=a,s=e.length;l<s;l++){let c=e[l];if(c.computedPinned==="start"){Ds(c,i,n.current);continue}c.computedPinned!=="end"&&ve.columnOffsets.set(l,c.computedOffset+i,n.current)}return}for(let l=a,s=e.length;l<s;l++){let c=e[l];c.computedPinned||ve.columnOffsets.set(l,c.computedOffset+i,n.current)}}}}}function $f(o,e){let t=o[o.length-1];return{resize(n){let{columns:r,domRef:i}=e,a=r[o[0]],l=a.computedOffset,s=0,c=i.current;if(n.forEach((u,d)=>{s+=u;let p=o[d],f=r[p],m=f.computedWidth+u;ve.columnWidths.set(p,m,c),f.computedPinned!=="end"&&(l&&ve.columnOffsets.set(p,l,c),l+=m)}),a.computedPinned!=="end")for(let u=t+1;u<r.length;u++){let d=r[u];d.computedPinned!=="end"&&ve.columnOffsets.set(u,d.computedOffset+s,c)}}}}var Ca="zneyzh0 _16lm1iw2 _16lm1iw23 _16lm1iw2c _16lm1iw2a _16lm1iwm _16lm1iw35",Ra=Se({defaultClassName:"zneyzhc _16lm1iw2 _16lm1iw23 _16lm1iw2a",variantClassNames:{constrained:{false:"zneyzhd",true:"zneyzhe"},computedPinned:{start:"zneyzhf",end:"zneyzhg",false:"zneyzhh"},computedFirstInCategory:{true:"zneyzhi",false:"zneyzhj"},computedLastInCategory:{true:"zneyzhk",false:"zneyzhl"}},defaultVariants:{},compoundVariants:[[{computedPinned:"start",computedLastInCategory:!0,computedFirstInCategory:!1},"zneyzhm"],[{computedPinned:"end",computedFirstInCategory:!0,computedLastInCategory:!1},"zneyzhn"]]}),Ia=Se({defaultClassName:"zneyzh1",variantClassNames:{computedPinned:{start:"zneyzh2",end:"zneyzh3 _16lm1iw26 _16lm1iw2e",false:"zneyzh4"},computedFirstInCategory:{true:"zneyzh5",false:"zneyzh6"},computedLastInCategory:{true:"zneyzh7",false:"zneyzh8"}},defaultVariants:{},compoundVariants:[[{computedPinned:"end",computedLastInCategory:!1,computedFirstInCategory:!0},"zneyzh9"],[{computedPinned:!1,computedFirstInCategory:!1,computedLastInCategory:!0},"zneyzha"],[{computedPinned:"start",computedFirstInCategory:!1,computedLastInCategory:!0},"zneyzhb"]]});var{rootClassName:wC}=ze,vC=`${wC}HeaderCell_ResizeHandle`;function PC(o){let{brain:e,headerBrain:t}=oe(g=>({brain:g.state.brain,headerBrain:g.state.headerBrain})),n=(0,Jr.useRef)(null),[r,i]=(0,Jr.useState)(!1),a=(0,Jr.useRef)(r);a.current=r;let l=o.columns[o.columnIndex],s=o.horizontalLayoutPageIndex;if(!l)return null;let c=l.computedPinned,u=l.computedFirstInCategory,d=l.computedLastInCategory,p=()=>{},f=g=>{g.stopPropagation();let h=!!g.shiftKey,S=g.pointerId,y=g.clientX,T=g.target;if(e.isHorizontalLayoutBrain){let w=e.extendRenderRange({start:!0,end:!0,direction:"horizontal"}),v=t.extendRenderRange({start:!0,end:!0,direction:"horizontal"});p=()=>{w(),v()}}T.setPointerCapture(S);let b=Uf(o.columnIndex,{columns:o.columns,shareSpaceOnResize:h,domRef:n}),R=(w,{done:v}={})=>{s&&(w=w/(s+1),v&&(w=Math.round(w))),c==="end"&&(w*=-1);let{adjustedDiff:P,constrained:E}=o.computeResize({diff:w,shareSpaceOnResize:h});return a.current!==E&&i(E),b.resize(P),P},C=w=>{R(Math.round(w.clientX-y))},I=w=>{T.releasePointerCapture(S),T.removeEventListener("pointermove",C),T.removeEventListener("pointerup",I);let v=Math.round(w.clientX-y),P=R(v,{done:!0});p(),b.resize(0),o.onResize({diff:P,shareSpaceOnResize:h})};T.addEventListener("pointermove",C),T.addEventListener("pointerup",I)},m=(c===!1||c==="start")&&d?{right:c==="start"?void 0:0}:c==="end"&&u?{right:void 0}:void 0;return ei.createElement("div",{ref:n,className:`${vC} ${Ca} ${Ia({computedPinned:c,computedFirstInCategory:u,computedLastInCategory:d})}`,onPointerDown:f},ei.createElement("div",{style:m,className:Ra({constrained:r,computedPinned:c,computedFirstInCategory:u,computedLastInCategory:d})}))}var Yf=ei.memo(PC);function Xf(o,e){let{computedVisibleColumns:t,getState:n,getComputed:r,actions:i}=oe(c=>({computedVisibleColumns:c.computed.computedVisibleColumns,getState:c.getState,getComputed:c.getComputed,actions:c.actions})),a=(0,qs.useCallback)(({diff:c,shareSpaceOnResize:u})=>jf({context:{getState:n,getComputed:r},column:o,diff:c,shareSpaceOnResize:u}),[o,n,r]),l=(0,qs.useCallback)(({diff:c,shareSpaceOnResize:u})=>{let{columnSizing:d,reservedWidth:p}=a({diff:c,shareSpaceOnResize:u});u||(i.viewportReservedWidth=p),i.columnSizing=d},[a,i]);return o.computedResizable?qf.createElement(Yf,{horizontalLayoutPageIndex:e.horizontalLayoutPageIndex,columns:t,columnIndex:o.computedVisibleIndex,computeResize:a,onResize:l}):null}var $e=H(require("react")),Bt=require("react");var Zf=Se({defaultClassName:"_16lm1iw3a _16lm1iw1",variantClassNames:{dragging:{true:"_16lm1iwn _16lm1iw1x"}},defaultVariants:{},compoundVariants:[]}),Qf=Se({defaultClassName:"_16lm1iw3a _16lm1iw1 _16lm1iwo",variantClassNames:{active:{true:"_3dmbka5 _16lm1iw1k _3dmbka2"},draggingInProgress:{true:"_16lm1iw1x"}},defaultVariants:{},compoundVariants:[[{active:!1,draggingInProgress:!0},"_3dmbka3"]]});function Jf(o,e){return wt(o,e)}var ar=class extends sn{constructor(t){super();this.dragIndex=-1;this.breakpoints=[];this.activeDragSourcePosition="outside";this.previousAcceptsDropResult=!0;this.setData(t)}get listId(){return this.data.listId}setData(t){return Jf(this.data,t)?!1:(this.data=t,!0)}getData(){return this.data}isEqual(t){return Jf(this.data,t.getData())}acceptsSelfDrops(){return!this.data.acceptDropsFrom||this.data.acceptDropsFrom.includes(this.data.listId)}acceptsDrop(t){let n=!0;return typeof this.data.shouldAcceptDrop=="function"&&(n=this.data.shouldAcceptDrop(t)),n=!!n,n!==this.previousAcceptsDropResult&&(this.previousAcceptsDropResult=n,n?this.emit("accept-feedback",t):this.emit("reject-feedback",t)),n}adjustForScroll(t){this.breakpoints=this.breakpoints.map(n=>n-t),this.data.orientation==="vertical"?this.data.listRectangle.shift({top:-t,left:0}):this.data.listRectangle.shift({top:0,left:-t})}move(t){this.emit("move",t)}unregister(){this.emit("unregister",this)}start(t){let n=t.dragSourceListId===this.data.listId,{draggableItems:r}=this.data,i=r.length;this.breakpoints=r.map((a,l)=>n||l===i-1?this.data.orientation==="horizontal"?a.rect.left+a.rect.width/2:a.rect.top+a.rect.height/2:this.data.orientation==="horizontal"?a.rect.right:a.rect.bottom),this.activeDragSourcePosition=n?"inside":"outside",this.emit("start",t)}drop(t){let{dropIndex:n,dragIndex:r,items:i,dragSourceListId:a,dropTargetListId:l,dragItem:s,outside:c}=t,u=Array.from({length:i.length},(f,m)=>m),d=[];n===-1?d=u.filter(f=>f!==r):d=ln(u,r,n>r?n-1:n);let p={dragIndex:r,dropIndex:n,dragItem:s,items:i,dragSourceListId:a,dropTargetListId:l,sortedIndexes:d,outside:c,status:t.status};this.emit("drop",p)}};var DC={startFromPercentage:.25,maxScrollAtPercentage:.05,maxPixelScroll:28,ease:o=>o**2,durationDampening:{stopDampeningAt:1200,accelerateAt:360}};function xC(o,e){let t=getComputedStyle(o),n=e==="vertical"?t.overflowY:t.overflowX;return n!=="auto"&&n!=="scroll"?!1:e==="vertical"?o.scrollHeight>o.clientHeight:o.scrollWidth>o.clientWidth}function EC(o,e){let t=o;for(;t&&!(t===document.documentElement||t===document.body);){if(xC(t,e))return t;t=t.parentElement}return null}function MC(o,e){return{startScrollingFrom:o*e.startFromPercentage,maxScrollValueAt:o*e.maxScrollAtPercentage}}var Xs=1;function em(o,e,t){if(o>e.startScrollingFrom)return 0;if(o<=e.maxScrollValueAt)return t.maxPixelScroll;if(o===e.startScrollingFrom)return Xs;let r=1-(o-e.maxScrollValueAt)/(e.startScrollingFrom-e.maxScrollValueAt);return Math.ceil(t.maxPixelScroll*t.ease(r))}function AC(o,e,t){let{accelerateAt:n,stopDampeningAt:r}=t.durationDampening,i=Date.now()-e;if(i>=r)return o;if(i<n)return Xs;let a=(i-n)/(r-n);return Math.max(Xs,Math.ceil(o*t.ease(a)))}function tm(o,e,t,n,r,i,a){if(o<e||o>t)return 0;let l=MC(n,r),s=o-e,c=t-o,u=c<s,d;return u?d=em(c,l,r):d=-em(s,l,r),d===0?0:a?(d>0?1:-1)*AC(Math.abs(d),i,r):d}var gn=class{constructor(e){this.scrollContainer=null;this.rafId=null;this.lastPointer={left:0,top:0};this.dragStartTime=0;this.shouldUseDampening=!1;this.active=!1;this.maxScrollTop=0;this.maxScrollLeft=0;this.orientation=e.orientation,this.onScroll=e.onScroll,this.config={...DC,...e.config}}start(e){this.scrollContainer=EC(e,this.orientation),this.scrollContainer&&(this.maxScrollTop=this.scrollContainer.scrollHeight-this.scrollContainer.clientHeight,this.maxScrollLeft=this.scrollContainer.scrollWidth-this.scrollContainer.clientWidth),this.dragStartTime=Date.now(),this.shouldUseDampening=!0,this.active=!0}getScrollContainer(){return this.scrollContainer}updatePointer(e){this.lastPointer=e,!this.rafId&&this.active&&this.scheduleScroll()}scheduleScroll(){this.rafId=requestAnimationFrame(()=>{if(this.rafId=null,!this.active||!this.scrollContainer)return;let e=this.computeScroll();if(e.top===0&&e.left===0)return;let t={top:this.scrollContainer.scrollTop,left:this.scrollContainer.scrollLeft},n=Math.max(0,Math.min(this.maxScrollTop,t.top+e.top)),r=Math.max(0,Math.min(this.maxScrollLeft,t.left+e.left));this.scrollContainer.scrollTop=n,this.scrollContainer.scrollLeft=r;let i={top:this.scrollContainer.scrollTop-t.top,left:this.scrollContainer.scrollLeft-t.left},a=i.top!==0||i.left!==0;a&&this.onScroll(i),this.active&&a&&this.scheduleScroll()})}computeScroll(){if(!this.scrollContainer)return{top:0,left:0};let e=this.scrollContainer.getBoundingClientRect();if(this.orientation==="vertical"){if(this.lastPointer.left<e.left||this.lastPointer.left>e.right)return{top:0,left:0}}else if(this.lastPointer.top<e.top||this.lastPointer.top>e.bottom)return{top:0,left:0};let t=0,n=0;return this.orientation==="vertical"?t=tm(this.lastPointer.top,e.top,e.bottom,e.height,this.config,this.dragStartTime,this.shouldUseDampening):n=tm(this.lastPointer.left,e.left,e.right,e.width,this.config,this.dragStartTime,this.shouldUseDampening),{top:t,left:n}}stop(){this.active=!1,this.rafId!=null&&(cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollContainer=null}};var Zs="data-drag-list-id",Tt="data-drag-item-id",lr="data-drag-item-list-id",om=`[${Tt}]`,nm=()=>null,rm=o=>{let{node:e,offset:t}=o;if(!t){e.style.transform="none";return}e.style.transform=`translate3d(${t.left}px, ${t.top}px, 0px)`},_C=o=>`${o.getAttribute(Tt)}`;function Qs(o,e){let t=o.current?.querySelectorAll(om)??[];return Array.from(t).filter(r=>r.getAttribute(lr)===`${e}`)}function OC(o,e){let t=Qs(o,e);return Array.from(t).map(r=>{let i=_C(r),a=r.getBoundingClientRect();return{id:i,rect:a}})}function FC(o){let{domRef:e,orientation:t,dragListId:n}=o,r=OC(e,n),i=e.current.getBoundingClientRect(),a=i.top,l=i.left,s=i.bottom,c=i.right;for(let p of r){let f=p.rect;f.top<a&&(a=f.top),f.left<l&&(l=f.left),f.bottom>s&&(s=f.bottom),f.right>c&&(c=f.right)}let u=De.from({top:a,left:l,width:c-l,height:s-a});return{draggableItems:r,orientation:t,listId:n,listRectangle:u,acceptDropsFrom:o.acceptDropsFrom,shouldAcceptDrop:o.shouldAcceptDrop,initial:o.initial,preserveDragSpace:o.preserveDragSpace}}function im(o){return new ar(FC(o))}function am(o,e){let t=document.querySelector(`[${Zs}="${e}"]`);t?o.current=t:console.warn(`DragList with id "${e}" not found. You're probably not spreading the domProps to the parent element. Make sure you also include the "className" prop.`)}function lm(o,e){let t=o.current;t&&t!==e&&pt.unregisterDragInteractionTarget(t),o.current=e,e&&pt.registerDragInteractionTarget(e)}function sm(o){let{getProps:e,domRef:t,setInteractionTarget:n}=o;return pt.on("register",r=>{let{dragListId:i,acceptDropsFrom:a,orientation:l,shouldAcceptDrop:s}=e(),c=r.getData();if(c.initial&&c.listId!==i&&a?.includes(c.listId)){let u=im({domRef:t,orientation:l,dragListId:i,initial:!1,acceptDropsFrom:a,shouldAcceptDrop:s});r.once("unregister",()=>{n(null)}),n(u)}})}function wa(o,e){let t=o.cloneNode(!0);return t.removeAttribute(Tt),t.style.position="fixed",t.style.top=`${e.top}px`,t.style.left=`${e.left}px`,t.style.width=`${e.width}px`,t.style.height=`${e.height}px`,t.style.zIndex="999999",t.style.pointerEvents="none",t.style.margin="0",t.style.boxSizing="border-box",t.style.transform="none",document.body.appendChild(t),t}function va({proxyElement:o,dx:e,dy:t}){o.style.transform=`translate3d(${e}px, ${t}px, 0)`}function cm(o){let e=o.current;e&&(e.cleanup?e.cleanup({proxyElement:e.proxyElement}):e.proxyElement.remove(),e.originalNode.style.visibility="",o.current=null)}function um(o,e,t){let n=o.current;return(!n||n.length===0)&&(n=Qs(e,t),o.current=n),n}function dm(o,e){let{dragListId:t,orientation:n,domRef:r,proxyStateRef:i,sourceScrollOffsetRef:a,dragItemsRef:l,getDragItems:s,getOnDrop:c,getOnAcceptDrop:u,getOnRemove:d,getUpdatePosition:p,updateDragOperationSourceAndTarget:f,updateDragProxyRenderState:m}=e,g=o.on("start",({dragItem:C,dragSourceListId:I,dropTargetListId:w})=>{f({dragSourceListId:I,dropTargetListId:w,dragItemId:C.id,status:"accepted"})}),h=o.on("move",({offsetsForItems:C,items:I,status:w,dragItem:v})=>{if(w==="rejected")return;let P=s(),E=p(),M=i.current;I.forEach((D,x)=>{let A=C[x],O=P[x];if(O&&!(M&&D.id===M.dragItemId)){if(!M&&D.id===v.id){let F=a.current;A={left:A.left+F.left,top:A.top+F.top}}E({id:D.id,node:O,offset:A})}})}),S=o.on("drop",C=>{let{sortedIndexes:I,dragIndex:w,dropIndex:v,dragItem:P,items:E,dragSourceListId:M,dropTargetListId:D,outside:x,status:A}=C,O=s();l.current=[];let F=u(),z=d(),L=c(),B=p();E.forEach((W,N)=>{let K=O[N];K&&B({id:W.id,node:K,offset:null})}),cm(i),m(W=>W&&(requestAnimationFrame(()=>m(nm)),{...W,dragItemId:null})),t===D&&M!==t&&F&&A==="accepted"&&F({dragItemId:P.id,dragSourceListId:M,dropTargetListId:D,dragIndex:w,dropIndex:v,dropItemId:E[v]?.id});let V=null;v===-1&&M===t&&D===t&&x&&(V=z),v!==-1&&D===t&&M===t&&(V=L),V&&V?.(I,{dragIndex:w,dropIndex:v,dragItemId:E[w].id,dropItemId:E[v]?.id})}),y=null,T=null,b=null,R=null;if(!o.getData().initial&&r.current){if(y=new gn({orientation:n,onScroll:()=>{}}),y.start(r.current),T=y.getScrollContainer(),T){let C=n==="vertical"?T.scrollTop:T.scrollLeft;b=()=>{let I=n==="vertical"?T.scrollTop:T.scrollLeft,w=I-C;C=I,w!==0&&(o.adjustForScroll(w),pt.retriggerMove())},T.addEventListener("scroll",b)}R=C=>{y.updatePointer({left:C.clientX,top:C.clientY})},Fe().addEventListener("pointermove",R)}return()=>{g(),h(),S(),y&&y.stop(),T&&b&&T.removeEventListener("scroll",b),R&&Fe().removeEventListener("pointermove",R)}}function pm(o,e,t){let{dragListId:n,orientation:r,acceptDropsFrom:i,preserveDragSpace:a,onDragProxySetup:l}=e,{domRef:s,proxyStateRef:c,sourceScrollOffsetRef:u,dragItemsRef:d,setInteractionTarget:p,updateDragProxyRenderState:f}=t,m=e.dragStrategy??"proxy",g=m==="proxy"&&!e.renderDragProxy,h=m==="proxy"&&!!e.renderDragProxy,S=e.onDragProxyMove??va,y=o.currentTarget,T=y.getAttribute(Tt);if(T==null){let N=Lo(y,om);N&&(T=N.getAttribute(Tt))}if(T==null){console.warn("Could not find drag item id for element",y,`Make sure you have a parent element with a ${Tt} attribute`);return}T=`${T}`;let b=null,R=Qs(s,n);d.current=R;let C=im({domRef:s,orientation:r,dragListId:n,acceptDropsFrom:i,initial:!0,preserveDragSpace:a}),I=C.getData().draggableItems,w=I.findIndex(N=>N.id===T);if(w===-1)return;let v=I[w],P=R[w]?.getAttribute(Tt)===`${T}`?R[w]:R.find(N=>N.getAttribute(Tt)===`${T}`);p(C);let E={left:o.clientX,top:o.clientY},M={left:o.clientX,top:o.clientY};u.current={top:0,left:0};let D=new gn({orientation:r,onScroll:()=>{}});s.current&&D.start(s.current);let x=D.getScrollContainer(),A=x?r==="vertical"?x.scrollTop:x.scrollLeft:0;function O(){b&&b.move({left:M.left,top:M.top})}let F=()=>{if(!x)return;let N=r==="vertical"?x.scrollTop:x.scrollLeft,K=N-A;A=N,K!==0&&(C.adjustForScroll(K),r==="vertical"?u.current.top+=K:u.current.left+=K),O()};x?.addEventListener("scroll",F);let z=N=>{if(M={left:N.clientX,top:N.clientY},!b){if(b=pt.startDrag({listId:n,dragItem:v,dragIndex:w},E),P&&g){let re=P.getBoundingClientRect(),ue=null,fe={dragItemNode:P,dragItemId:`${T}`,initialRect:re,initialCoords:E,get proxyElement(){return ue||(ue=wa(P,re)),ue}},be=l?.(fe),de=be?.proxyElement??fe.proxyElement;P.style.visibility="hidden",c.current={proxyElement:de,originalNode:P,dragItemId:`${T}`,initialRect:re,cleanup:be?.cleanup}}if(P&&h){let re=P.getBoundingClientRect();P.style.visibility="hidden",c.current={proxyElement:P,originalNode:P,dragItemId:`${T}`,initialRect:re,cleanup:()=>{}};let ue={dragItemId:`${T}`,initialRect:re,dx:0,dy:0};f(()=>ue)}}let K=N.clientX-E.left,ae=N.clientY-E.top;if(h)f(re=>re&&{...re,dx:K,dy:ae});else{let re=c.current;re&&S({proxyElement:re.proxyElement,dx:K,dy:ae})}D.updatePointer({left:N.clientX,top:N.clientY}),O()},L=N=>{N.preventDefault()},B=N=>{if(D.stop(),x?.removeEventListener("scroll",F),W.removeEventListener("pointermove",z),W.removeEventListener("pointerup",Y),W.removeEventListener("pointercancel",V),W.removeEventListener("dragstart",L,!0),h&&(f(K=>K&&{...K,dragItemId:null}),requestAnimationFrame(()=>{f(nm)})),!b){cm(c),p(null);return}N?b.cancel():b.drop(),b=null},Y=()=>B(!1),V=()=>B(!0),W=Fe();W.addEventListener("pointermove",z),W.addEventListener("pointerup",Y),W.addEventListener("pointercancel",V),W.addEventListener("dragstart",L,!0)}var fm=$e.createContext({dragItemId:null,onDragItemPointerDown:()=>{},draggingInProgress:!1,dragListId:"",status:"accepted",dragSourceListId:null,dropTargetListId:null}),hn=()=>$e.useContext(fm);function NC(o,e){let t=Le(e),[n,r]=$e.useState(null),i=$e.useRef(null),a=(0,Bt.useCallback)(s=>{lm(i,s),r(s)},[]),l=Le(n);return(0,Bt.useEffect)(()=>()=>{pt.unregisterDragInteractionTarget(i.current),i.current=null},[]),(0,Bt.useEffect)(()=>sm({getProps:t,domRef:o,setInteractionTarget:a}),[t]),{interactionTarget:n,setInteractionTarget:a,getInteractionTarget:l}}var Wo=o=>{let e=$e.useRef(null),t=$e.useRef(null),[n,r]=(0,Bt.useState)(null),i=$e.useRef({top:0,left:0}),a=$e.useRef(null),l=$e.useCallback(P=>{a.current=P},[]),{dropTargetListId:s,dragSourceListId:c}=fo(),{updateDragOperationSourceAndTarget:u,dragItemId:d,status:p}=fo(),f=Le(o.onDrop),m=Le(o.onAcceptDrop),g=Le(o.onRemove),h=Le(o.updatePosition??rm),{interactionTarget:S,setInteractionTarget:y}=NC(e,o);(0,Bt.useEffect)(()=>{am(e,o.dragListId)},[o.dragListId]),(0,Bt.useEffect)(()=>{if(S)return dm(S,{dragListId:o.dragListId,orientation:o.orientation,domRef:e,proxyStateRef:t,sourceScrollOffsetRef:i,dragItemsRef:T,getDragItems:b,getOnDrop:f,getOnAcceptDrop:m,getOnRemove:g,getUpdatePosition:h,updateDragOperationSourceAndTarget:u,updateDragProxyRenderState:r})},[S,o.dragListId]);let T=$e.useRef([]),b=(0,Bt.useCallback)(()=>um(T,e,o.dragListId),[o.dragListId]),R=(0,Bt.useCallback)(P=>{pm(P,o,{domRef:e,proxyStateRef:t,sourceScrollOffsetRef:i,dragItemsRef:T,setInteractionTarget:y,updateDragProxyRenderState:r})},[o.orientation,o.dragListId,o.acceptDropsFrom,o.removeOnDropOutside,o.dragStrategy,o.renderDragProxy,o.onDragProxySetup,o.onDragProxyMove]),C=!!d,I=$e.useMemo(()=>({dragItemId:d,onDragItemPointerDown:R,dragSourceListId:c,dropTargetListId:s,status:p,dragListId:o.dragListId,draggingInProgress:C}),[d,R,C,c,s,o.dragListId]),w={className:X("DragList",C?"DragList--dragging":"",Zf({dragging:C})),[Zs]:o.dragListId},v=typeof o.children=="function"?o.children(w,I):o.children;return $e.createElement(fm.Provider,{value:I},v,n&&o.renderDragProxy?o.renderDragProxy({...n,ref:l}):null)},LC=$e.createContext({dragItemId:"",dragListId:"",active:!1,draggingInProgress:!1,dragSourceListId:"",dropTargetListId:""}),kC=o=>{let{onDragItemPointerDown:e,draggingInProgress:t,dragListId:n,dragItemId:r,dragSourceListId:i,dropTargetListId:a}=hn(),l=o.dragListId??n,s=i===l&&r===`${o.id}`,c=$e.useMemo(()=>({dragItemId:o.id,active:s,dragListId:l,draggingInProgress:t,dragSourceListId:i,dropTargetListId:a}),[o.id,s,l,t,i,a]),u={[Tt]:`${o.id}`,[lr]:l,onPointerDown:e,className:X("DraggableItem",s?"DraggableItem--active":"",Qf({active:s,draggingInProgress:t}))},d=typeof o.children=="function"?o.children(u,c):o.children;return $e.createElement(LC.Provider,{value:c},d)};Wo.DraggableItem=kC;var Js=H(require("react"));var mm=o=>Js.createElement(Ve,{...o,icon:"hidden",viewBox:"0 -960 960 960"},Js.createElement("path",{d:Ge.hidden[0]}));var si=H(require("react"));function gm(){return{}}var hm=o=>({allowColumnHideWhileDragging:e=>e??!0});var ym=require("react"),zC=(0,ym.createContext)(null);function ec(){return zC}var Wt=H(require("react"));var Rn=H(require("react")),Dt=require("react");var Pa=H(require("react"));function VC(o){let{height:e,width:t,count:n}=o;return Pa.createElement("div",{"data-count":n,"data-placeholder-width":void 0,"data-placeholder-height":void 0,"data-name":"SpacePlaceholder",style:{height:e,width:t,zIndex:-1,opacity:0,pointerEvents:"none",contain:"strict"}})}var Sm=Pa.memo(VC);var bm="mlx2t3";var Da=H(require("react")),Dm=require("react");var Tm=require("react"),Cm=(o,e)=>{(0,Tm.useEffect)(()=>{let t=o?.current,n=i=>{let a=i.target;e?.({scrollTop:a.scrollTop,scrollLeft:a.scrollLeft})},r={passive:!1};return t?.addEventListener("scroll",n,r),()=>{t?.removeEventListener("scroll",n)}},[e,o?.current])};var Rm={true:"_1ueijco2",false:"_1ueijco3",visible:"_1ueijco4",auto:"_1ueijco5",hidden:"_1ueijco6"},Im={true:"_1ueijco7",false:"_1ueijco8",visible:"_1ueijco9",auto:"_1ueijcoa",hidden:"_1ueijcob"},wm={true:"_1ueijcoc",false:"_1ueijcod",visible:"_1ueijcoe",auto:"_1ueijcof",hidden:"_1ueijcog"},tc="_1ueijco1",vm="_1ueijco0 _16lm1iw0";var Pm=o=>{let e="";return typeof o=="boolean"||typeof o=="string"?e=Rm[`${o}`]:e=X(Im[`${o.horizontal}`],wm[`${o.vertical}`]),e};var GC="InfiniteVirtualScrollContainer";var xm=Da.forwardRef(function(e,t){let{children:n,scrollable:r=!0,onContainerScroll:i,className:a,tabIndex:l,style:s,autoFocus:c}=e,u=t??(0,Dm.useRef)(null);return Cm(u,i),Da.createElement("div",{ref:u,style:s,autoFocus:c,tabIndex:l,className:X(a,GC,vm,Pm(r))},n)});var za=H(require("react")),bn=require("react");var Em=H(require("react")),sr=require("react");function HC(o){let[e,t]=(0,sr.useState)(o.updater.get),n=(0,sr.useRef)(null);return(0,sr.useLayoutEffect)(()=>{function r(a){o.useraf?(n.current!=null&&cancelAnimationFrame(n.current),n.current=requestAnimationFrame(()=>{t(a)})):t(a)}let i=o.updater.onChange(r);return()=>{n.current!=null&&cancelAnimationFrame(n.current),i()}},[o.updater,o.useraf]),e??null}var jo=Em.memo(HC);var Mm=H(an());var oc=(o,e)=>o-e,ho={horizontal:!0,vertical:!0};function xa(o,e){let t=e.length;if(!t)return 0;let n=-1;for(let r=0;r<t;r++){let i=0,a=0;if(t-r<=n)break;for(let l=r;l<t;l++)if(i+=e[l],a++,i>o){a>n&&(n=a);break}}return n<0?t:Math.min(n,t)}var nc="DebugID=";function Uo(o,e){return e&&e.startsWith(nc)?e:e?`${nc}${o}:${e}`:`${nc}${o}`}var Ea={start:0,end:0},rc=o=>{o()},ic=o=>{let{start:e,end:t}=o,[n,r]=e,[i,a]=t,l=i-n,s=a-r;return l*s},Am=o=>{let{start:e,end:t}=o,[n]=e,[r]=t;return r-n},ti=typeof window<"u"?requestAnimationFrame:o=>setTimeout(o,0);function KC(o){return o.horizontalChange||o.verticalChange}var yn=class extends It{constructor(t){let n=Uo(t,`${t}:MatrixBrain`);super(n);this.scrolling=!1;this.RENDER_COUNT_SAFETY_MARGIN_START=1;this.RENDER_COUNT_SAFETY_MARGIN_END=1;this.availableWidth=0;this.availableRenderWidth=0;this.isHorizontalLayoutBrain=!1;this.name="";this.availableHeight=0;this.availableRenderHeight=0;this.cols=0;this.rows=0;this.alwaysRenderedColumns=new Set;this._rowsPerPage=0;this.rowHeight=0;this.colWidth=0;this.verticalTotalSize=0;this.horizontalTotalSize=0;this.horizontalRenderCount=void 0;this.verticalRenderCount=void 0;this.maxHorizontalRenderCount=0;this.maxVerticalRenderCount=0;this.horizontalExtendRangeBy=Ea;this.verticalExtendRangeBy=Ea;this.horizontalRenderRange={startIndex:0,endIndex:0};this.verticalRenderRange={startIndex:0,endIndex:0};this.extraSpanCells=[];this.scrollPosition={scrollLeft:0,scrollTop:0};this.largeContent={vertical:!1,horizontal:!1};this.scrollRatio={vertical:1,horizontal:1};this.scrollOrigin={scrollLeft:0,scrollTop:0};this.onScrollOriginChangeFns=new Set;this.onScrollFns=[];this.onRenderRangeChangeFns=new Set;this.onVerticalRenderRangeChangeFns=new Set;this.onHorizontalRenderRangeChangeFns=new Set;this.onDestroyFns=[];this.destroyed=!1;this.onRenderCountChangeFns=new Set;this.onAvailableSizeChangeFns=new Set;this.onScrollStartFns=[];this.onScrollStopFns=[];this.scrollTimeoutId=0;this.scrollStopDelay=250;this.fixedColsStart=0;this.fixedColsEnd=0;this.fixedRowsStart=0;this.fixedRowsEnd=0;this.setScrollStopDelay=t=>{this.scrollStopDelay=t};this.getRowCount=()=>this.rows;this.getColCount=()=>this.cols;this.onScrollOriginChange=t=>this.onScrollOriginChangeForBrain(t);this.setScrolling=t=>{let n=this.scrolling;this.scrolling=t,t&&(this.scrollTimeoutId&&clearTimeout(this.scrollTimeoutId),this.scrollTimeoutId=setTimeout(()=>{this.setScrolling(!1),this.scrollTimeoutId=0},this.scrollStopDelay)),t!==n&&(t?this.notifyScrollStart():this.notifyScrollStop())};this.notifyScrollStart=()=>{if(this.destroyed)return;let t=this.onScrollStartFns;for(let n=0,r=t.length;n<r;n++)t[n]()};this.notifyScrollStop=()=>{if(this.destroyed)return;let t=this.onScrollStopFns,n=this.scrollPosition,r=this.getRenderRange();for(let i=0,a=t.length;i<a;i++)t[i](n,r)};this.notifyAvailableSizeChange=()=>{if(this.destroyed)return;let t=this.onAvailableSizeChangeFns,n=this.getAvailableSize();t.forEach(r=>{ti(()=>{this.destroyed||t.has(r)&&r(n)})})};this.notifyVerticalRenderRangeChange=(t=!1)=>{if(this.destroyed)return;let n=this.onVerticalRenderRangeChangeFns,r=this.verticalRenderRange,i=t?rc:ti;n.forEach(a=>{i(()=>{this.destroyed||n.has(a)&&a([r.startIndex,r.endIndex])})})};this.notifyHorizontalRenderRangeChange=(t=!1)=>{if(this.destroyed)return;let n=this.onHorizontalRenderRangeChangeFns,r=this.horizontalRenderRange,i=t?rc:ti;n.forEach(a=>{i(()=>{this.destroyed||n.has(a)&&a([r.startIndex,r.endIndex])})})};this.isColFixedEnd=t=>this.fixedColsEnd?t>=this.cols-this.fixedColsEnd:!1;this.isColFixedStart=t=>this.fixedColsStart?t<this.fixedColsStart:!1;this.isRowFixedEnd=t=>this.fixedRowsEnd?t>=this.rows-this.fixedRowsEnd:!1;this.isRowFixedStart=t=>this.fixedRowsStart?t<this.fixedRowsStart:!1;this.isColFixed=t=>this.isColFixedStart(t)||this.isColFixedEnd(t);this.isRowFixed=t=>this.isRowFixedStart(t)||this.isRowFixedEnd(t);this.getFixedEndColsWidth=()=>{if(!this.fixedColsEnd)return 0;let t=0;for(let n=this.cols-this.fixedColsEnd;n<this.cols;n++)t+=this.getColWidth(n);return t};this.getFixedEndColsOffsets=({skipScroll:t}={skipScroll:!1})=>{if(!this.fixedColsEnd)return[];let{scrollLeft:n}=this.scrollPosition,{width:r}=this.getAvailableSize(),i=[],a=[],l=0;for(let u=this.cols-this.fixedColsEnd;u<this.cols;u++){let d=this.getColWidth(u);a.push(d),l+=d}let s=r-l+(t?0:n);l=0;let c=0;for(let u=this.cols-this.fixedColsEnd;u<this.cols;u++){let d=s+l;i[u]=d,l+=a[c],c++}return i};this.getFixedEndRowsOffsets=({skipScroll:t}={skipScroll:!1})=>{if(!this.fixedRowsEnd)return[];let{scrollTop:n}=this.scrollPosition,{height:r}=this.getAvailableSize(),i=[],a=[],l=0;for(let u=this.rows-this.fixedRowsEnd;u<this.rows;u++){let d=this.getRowHeight(u);a.push(d),l+=d}let s=r-l+(t?0:n);l=0;let c=0;for(let u=this.rows-this.fixedRowsEnd;u<this.rows;u++){let d=s+l;i[u]=d,l+=a[c],c++}return i};this.getFixedStartColsWidth=()=>{if(!this.fixedColsStart)return 0;let t=0;for(let n=0;n<this.fixedColsStart;n++)t+=this.getColWidth(n);return t};this.getFixedEndRowsHeight=()=>{if(!this.fixedRowsEnd)return 0;let t=0;for(let n=this.rows-this.fixedRowsEnd;n<this.rows;n++)t+=this.getRowHeight(n);return t};this.getFixedStartRowsHeight=()=>{if(!this.fixedRowsStart)return 0;let t=0;for(let n=0;n<this.fixedRowsStart;n++)t+=this.getRowHeight(n);return t};this.computeRenderCount=(t=ho)=>{let n=t.horizontal,r=t.vertical,i=this.horizontalRenderCount||0,a=this.verticalRenderCount||0;return n&&(i=this.computeDirectionalRenderCount("horizontal",this.colWidth,this.cols,this.getAvailableRenderSize())),r&&(a=this.computeDirectionalRenderCount("vertical",this.rowHeight,this.rows,this.getAvailableRenderSize())),{horizontal:i,vertical:a}};this.setRenderCount=({horizontal:t,vertical:n})=>{t===void 0&&(t=this.horizontalRenderCount),n===void 0&&(n=this.verticalRenderCount);let r=t===this.horizontalRenderCount,i=n===this.verticalRenderCount;r&&i||(this.horizontalRenderCount=t,this.verticalRenderCount=n,this.updateRenderRange({horizontal:!r,vertical:!i}),this.notifyRenderCountChange())};this.updateFixedCells=t=>{t.fixedColsStart!=this.fixedColsStart&&(this.fixedColsStart=t.fixedColsStart||0),t.fixedColsEnd!=this.fixedColsEnd&&(this.fixedColsEnd=t.fixedColsEnd||0),t.fixedRowsStart!=this.fixedRowsStart&&(this.fixedRowsStart=t.fixedRowsStart||0),t.fixedRowsEnd!=this.fixedRowsEnd&&(this.fixedRowsEnd=t.fixedRowsEnd||0)};this.getFixedCellInfo=()=>{let{fixedRowsStart:t,fixedColsStart:n,fixedRowsEnd:r,fixedColsEnd:i}=this;return{fixedRowsStart:t,fixedColsStart:n,fixedRowsEnd:r,fixedColsEnd:i}};this.updateRenderRange=(t=ho)=>{this.setRenderRange(this.computeRenderRange(t))};this.getExtraSpanCellsForRange=({horizontal:t,vertical:n})=>{let{colspan:r,rowspan:i}=this,a=[];if(i){let l=n.startIndex,s=t.startIndex,c=t.endIndex;for(let u=s;u<c;u++){this.computeItemSpanUpTo(l,u,"vertical");let d=this.rowspanParent.get(u);if(d[l]!=l){let p=l;for(;d[p]!=p;)p--;a.push([p,u])}}}if(r){let l=t.startIndex,s=n.startIndex,c=n.endIndex;for(let u=s;u<c;u++){this.computeItemSpanUpTo(u,l,"horizontal");let d=this.colspanParent.get(u);if(d[l]!=l){let p=l;for(;d[p]!=p;)p--;a.push([u,p])}}}return a};this.computeRenderRange=(t=ho)=>{let n=t.horizontal?this.computeDirectionalRenderRange("horizontal"):this.horizontalRenderRange,r=t.vertical?this.computeDirectionalRenderRange("vertical"):this.verticalRenderRange;return{horizontal:n,vertical:r,extraCells:this.getExtraSpanCellsForRange({horizontal:n,vertical:r})}};this.computeDirectionalRenderRange=t=>{let n=t==="horizontal"?this.colWidth:this.rowHeight,r=t==="horizontal"?this.horizontalRenderCount:this.verticalRenderCount,i=t==="horizontal"?this.cols:this.rows;if(!r)return{startIndex:0,endIndex:0};let a=(t==="horizontal"?this.fixedColsStart:this.fixedRowsStart)||0,l=t==="horizontal"?this.scrollPosition.scrollLeft:this.scrollPosition.scrollTop;l+=this.getFixedStartSize(t);let s=typeof n!="function",c=t==="horizontal"?this.horizontalExtendRangeBy:this.verticalExtendRangeBy,u=this.getItemAt(l,t),d=c.start||0,p=c.end||0;s||(d+=this.RENDER_COUNT_SAFETY_MARGIN_START,p+=this.RENDER_COUNT_SAFETY_MARGIN_END),d&&(u=Math.max(0,u-d),r+=d),p&&(r+=p);let f=u+r,m=Math.max(a,i-(t==="horizontal"?this.fixedColsEnd:this.fixedRowsEnd));return f>m&&(f=m,u=Math.max(a,f-r)),{startIndex:u,endIndex:f}};this.getItemAt=(t,n)=>{let r=n==="horizontal"?this.colWidth:this.rowHeight,i=n==="horizontal"?this.cols:this.rows;if(typeof r!="function")return Math.min(Math.max(0,Math.floor(t/r)),i-1);let a=n==="horizontal"?this.colOffsetCache:this.rowOffsetCache,l=n==="horizontal"?this.colWidthCache:this.rowHeightCache,s=a.length-1,c=l.length-1,u=a[s],d;for(;u<t;)if(s>=i||(c+=1,this.computeCacheFor(c,n),d=u,u=a[c],d===u&&d!=0))return i-1;let p=(0,Mm.default)(a,t,oc);return p>=0?p:~p-1};this.computeCacheFor=(t,n)=>{let r=n==="horizontal"?this.colWidth:this.rowHeight,i=n==="horizontal"?this.colWidthCache:this.rowHeightCache,a=n==="horizontal"?this.colOffsetCache:this.rowOffsetCache;if(typeof r!="function")return;let l=r(t);if(i[t]=l,t>0){let s=a[t-1],c=i[t-1];s==null&&console.error(`Offset was not available for ${n==="horizontal"?"col":"row"} ${t-1}`),c==null&&console.error(`Size was not available for ${n==="horizontal"?"col":"row"} ${t-1}`);let u=s+c;a[t]=u}};this.computeItemSpanUpTo=(t,n,r)=>{let i=r==="horizontal"?n:t,a=r==="horizontal"?t:n,l=r==="horizontal"?this.cols:this.rows,s=r==="horizontal"?this.colspan:this.rowspan;if(!s)return;let c=r==="horizontal"?this.colspanParent:this.rowspanParent;c.has(a)||c.set(a,[]);let u=r==="horizontal"?this.colspanValue:this.rowspanValue;u.has(a)||u.set(a,[]);let d=c.get(a),p=u.get(a);if(d[i]===void 0){let f=d.length,m=l?Math.min(i,l-1):0,g={rowIndex:t,colIndex:n};for(;f<=m;f++)if(d[f]===void 0){g[r==="horizontal"?"colIndex":"rowIndex"]=f;let h=s(g);d[f]=f,p[f]=h;let S=f;for(;h>1;)S+=1,d[S]=f,p[S]=0,h-=1}}};this.getCellSpan=(t,n,r)=>{let i=r==="horizontal"?this.colspan:this.rowspan,a=r==="horizontal"?n:t,l=r==="horizontal"?t:n;if(!i)return 1;let s=r==="horizontal"?this.colspanValue:this.rowspanValue,c=s.get(l);return(!c||c[a]===void 0)&&this.computeItemSpanUpTo(t,n,r),c||(c=s.get(l)),c[a]||1};this.getRowspan=(t,n)=>this.getCellSpan(t,n,"vertical");this.getColspan=(t,n)=>this.getCellSpan(t,n,"horizontal");this.getRowspanParent=(t,n)=>this.getItemSpanParent(t,n,"vertical");this.getColspanParent=(t,n)=>this.getItemSpanParent(t,n,"horizontal");this.getItemSpanParent=(t,n,r)=>{let i=r=="horizontal"?this.colspan:this.rowspan,a=r==="horizontal"?n:t,l=r==="horizontal"?t:n;if(!i)return a;let s=r==="horizontal"?this.colspanParent:this.rowspanParent,c=s.get(l);return(!c||c[a]===void 0)&&this.computeItemSpanUpTo(t,n,r),c||(c=s.get(l)),c[a]};this.getRowHeightWithSpan=(t,n,r)=>this.getItemSizeWithSpan(t,n,r,"vertical");this.getColWidthWithSpan=(t,n,r)=>this.getItemSizeWithSpan(t,n,r,"horizontal");this.getItemSizeWithSpan=(t,n,r,i)=>{let a=i==="horizontal"?n:t,l=this.getItemSize(a,i);for(;r>1;)a+=1,r-=1,l+=this.getItemSize(a,i);return l};this.getRowHeight=t=>this.getItemSize(t,"vertical");this.getColWidth=t=>this.getItemSize(t,"horizontal");this.getItemSize=(t,n)=>{let r=n==="horizontal"?this.cols:this.rows,i=n==="horizontal"?this.colWidth:this.rowHeight;if(typeof i!="function")return i;let a=this.getItemSizeCacheFor(t,n),l=n==="horizontal"?this.colWidthCache:this.rowHeightCache;if(a===void 0){let s=l.length,c=Math.min(t,r-1);for(;s<=c;s++)this.computeCacheFor(s,n);a=this.getItemSizeCacheFor(t,n)}return a};this.keepColumnRendered=t=>(this.alwaysRenderedColumns.add(t),()=>{this.alwaysRenderedColumns.delete(t)});this.getAlwaysRenderedColumns=()=>Array.from(this.alwaysRenderedColumns);this.setRenderRange=({horizontal:t,vertical:n,extraCells:r})=>{let i=!1;(t.startIndex!==this.horizontalRenderRange.startIndex||t.endIndex!==this.horizontalRenderRange.endIndex)&&(this.horizontalRenderRange=t,i=!0);let a=!1;(n.startIndex!==this.verticalRenderRange.startIndex||n.endIndex!==this.verticalRenderRange.endIndex)&&(this.verticalRenderRange=n,a=!0),this.extraSpanCells=r||[],(i||a)&&this.notifyRenderRangeChange(),a&&this.notifyVerticalRenderRangeChange(),i&&this.notifyHorizontalRenderRangeChange()};this.getRenderRangeCellCount=ic;this.getMaxCellCount=()=>this.maxHorizontalRenderCount*this.maxVerticalRenderCount;this.getExtraCells=()=>this.extraSpanCells;this.getScrollPosition=()=>this.scrollPosition;this.getRenderRange=()=>({start:[this.verticalRenderRange.startIndex,this.horizontalRenderRange.startIndex],end:[this.verticalRenderRange.endIndex,this.horizontalRenderRange.endIndex]});this.onScroll=t=>(this.onScrollFns.push(t),()=>{this.onScrollFns=this.onScrollFns.filter(n=>n!==t)});this.onScrollStart=t=>(this.onScrollStartFns.push(t),()=>{this.onScrollStartFns=this.onScrollStartFns.filter(n=>n!==t)});this.onScrollStop=t=>(this.onScrollStopFns.push(t),()=>{this.onScrollStopFns=this.onScrollStopFns.filter(n=>n!==t)});this.onRenderRangeChange=t=>(this.onRenderRangeChangeFns.add(t),()=>{this.onRenderRangeChangeFns.delete(t)});this.onVerticalRenderRangeChange=t=>(this.onVerticalRenderRangeChangeFns.add(t),()=>{this.onVerticalRenderRangeChangeFns.delete(t)});this.onHorizontalRenderRangeChange=t=>(this.onHorizontalRenderRangeChangeFns.add(t),()=>{this.onHorizontalRenderRangeChangeFns.delete(t)});this.onRenderCountChange=t=>(this.onRenderCountChangeFns.add(t),()=>{this.onRenderCountChangeFns.delete(t)});this.onAvailableSizeChange=t=>(this.onAvailableSizeChangeFns.add(t),()=>{this.onAvailableSizeChangeFns.delete(t)});this.onDestroy=t=>(this.onDestroyFns.push(t),()=>{this.onDestroyFns=this.onDestroyFns.filter(n=>n!==t)});this.getAvailableSize=()=>({width:this.availableWidth,height:this.availableHeight});this.getAvailableRenderSize=()=>({width:this.availableRenderWidth??this.availableWidth,height:this.availableRenderHeight??this.availableHeight});this.name=n,this.update=this.update.bind(this),this.destroy=this.destroy.bind(this),this.getCellOffset=this.getCellOffset.bind(this),this.reset()}set rowsPerPage(t){t!=this._rowsPerPage&&(this._rowsPerPage=t)}get rowsPerPage(){return this._rowsPerPage}reset(t=ho){t.vertical&&this.resetVertical(),t.horizontal&&this.resetHorizontal(),this.extraSpanCells=[]}resetVertical(){this.rowspanParent=new Map,this.rowspanValue=new Map,this.rowHeightCache=[],this.rowOffsetCache=[0],this.verticalRenderCount=void 0,this.verticalTotalSize=0,this.verticalRenderRange={startIndex:0,endIndex:0}}resetHorizontal(){this.colspanParent=new Map,this.colspanValue=new Map,this.colWidthCache=[],this.colOffsetCache=[0],this.horizontalRenderCount=void 0,this.horizontalTotalSize=0,this.horizontalRenderRange={startIndex:0,endIndex:0}}getVirtualColIndex(t,n){return t}update(t,n){let{rows:r,cols:i,rowHeight:a,colWidth:l,width:s,height:c}=t,u=typeof s=="number",d=typeof c=="number",p=u&&s!==this.availableWidth,f=d&&c!==this.availableHeight;p&&(this.availableWidth=s,this.availableRenderWidth=s),f&&(this.availableHeight=c,this.availableRenderHeight=c),(p||f)&&this.notifyAvailableSizeChange();let m=typeof r=="number",g=typeof i=="number",h=m&&r!==this.rows,S=g&&i!==this.cols;m&&(this.rows=r,this.rowsPerPage=r),g&&(this.cols=i);let y=a!=null,T=l!=null,b=y&&a!==this.rowHeight,R=T&&l!==this.colWidth;y&&(this.rowHeight=a),T&&(this.colWidth=l);let C=t.rowspan!=null,I=t.colspan!=null,w=C&&t.rowspan!=this.rowspan,v=I&&t.colspan!=this.colspan;w&&(this.rowspan=t.rowspan),v&&(this.colspan=t.colspan);let P=S||R||p||v,E=h||b||f||w;(n||KC)({horizontalChange:P,verticalChange:E,colsChanged:S,colWidthChanged:R,widthChanged:p,colspanChanged:v,rowsChanged:h,rowHeightChanged:b,heightChanged:f,rowspanChanged:w})&&this.updateRenderCount({horizontal:P,vertical:E})}extendRenderRange(t){let{direction:n}=t,r=n==="horizontal",i=r?this.horizontalRenderCount||this.getInitialCols():this.verticalRenderCount||this.getInitialRows(),a=typeof t.start=="number"?t.start:t.start===!0?i:0,l=typeof t.end=="number"?t.end:t.end===!0?i:0;return r?this.horizontalExtendRangeBy={start:a,end:l}:this.verticalExtendRangeBy={start:a,end:l},this.updateRenderRange({horizontal:r,vertical:!r}),()=>{this.extendRenderRange({start:0,end:0,direction:n})}}updateRenderCount(t=ho){this.reset(t),this.doUpdateRenderCount(t),this.updateLargeContent()}supportsLargeContent(t){return t==="vertical"}alignScrollOrigin(t,n){return Math.floor(n)}updateLargeContent(){let t=this.getVirtualizedContentSize(),n=this.supportsLargeContent("vertical")&&ea(t.height),r=this.supportsLargeContent("horizontal")&&ea(t.width);this.largeContent={vertical:n,horizontal:r},this.scrollRatio={vertical:n?Os(t.height,this.availableHeight):1,horizontal:r?Os(t.width,this.availableWidth):1},this.updateScrollOrigin()}isLargeContent(t){return this.largeContent[t]}getScrollRatio(t){return this.scrollRatio[t]}getNativeScrollSize(){let t=this.getVirtualizedContentSize(),{largeContent:n}=this;if(!n.vertical&&!n.horizontal)return t;let r=Ji();return{width:n.horizontal?r:t.width,height:n.vertical?r:t.height}}toContentScrollPosition(t){let{vertical:n,horizontal:r}=this.scrollRatio;return n===1&&r===1?t:{scrollTop:t.scrollTop*n,scrollLeft:t.scrollLeft*r}}toNativeScrollPosition(t){let{vertical:n,horizontal:r}=this.scrollRatio;return n===1&&r===1?t:{scrollTop:t.scrollTop/n,scrollLeft:t.scrollLeft/r}}getScrollOrigin(){return this.scrollOrigin}getDOMScrollPosition(t=this.getScrollPosition()){let n=this.getScrollOrigin();return!n.scrollTop&&!n.scrollLeft?t:{scrollTop:t.scrollTop-n.scrollTop,scrollLeft:t.scrollLeft-n.scrollLeft}}onScrollOriginChangeForBrain(t){return this.onScrollOriginChangeFns.add(t),()=>{this.onScrollOriginChangeFns.delete(t)}}updateScrollOrigin(){let{scrollPosition:t,largeContent:n,scrollOrigin:r}=this,i=c=>this.alignScrollOrigin("vertical",c),a=c=>this.alignScrollOrigin("horizontal",c),l=n.vertical?Fs(t.scrollTop,i(r.scrollTop),i):0,s=n.horizontal?Fs(t.scrollLeft,a(r.scrollLeft),a):0;l===r.scrollTop&&s===r.scrollLeft||(this.scrollOrigin={scrollTop:l,scrollLeft:s},this.notifyScrollOriginChange())}notifyScrollOriginChange(){if(this.destroyed)return;let t=this.getScrollOrigin();this.onScrollOriginChangeFns.forEach(n=>n(t))}doUpdateRenderCount(t=ho){if(!this.availableWidth||!this.availableHeight){let n={horizontal:void 0,vertical:void 0};this.availableWidth||(n.horizontal=0),this.availableHeight||(n.vertical=0),this.setRenderCount(n)}this.setRenderCount(this.computeRenderCount(t))}get scrollTopMax(){return this.getVirtualizedContentSize().height-this.availableHeight}get scrollLeftMax(){return this.getVirtualizedContentSize().width-this.availableWidth}setScrollPosition(t,n){this.setScrolling(!0);let r=t.scrollLeft!==this.scrollPosition.scrollLeft,i=t.scrollTop!==this.scrollPosition.scrollTop;this.scrollPosition=t,(r||i)&&(this.updateScrollOrigin(),n?.(t),this.updateRenderRange({horizontal:r,vertical:i}),this.notifyScrollChange())}notifyRenderRangeChange(t=!1){if(this.destroyed)return;let n=this.onRenderRangeChangeFns,r=this.getRenderRange(),i=t?rc:ti;n.forEach(a=>{i(()=>{this.destroyed||n.has(a)&&a(r)})})}notifyScrollChange(){if(this.destroyed)return;let{scrollPosition:t}=this,n=this.onScrollFns;for(let r=0,i=n.length;r<i;r++)n[r](t)}computeDirectionalRenderCount(t,n,r,i){let a=0,l=t==="horizontal"?i.width:i.height;if(l-=this.getFixedSize(t),l<=0)return 0;let s=t==="horizontal"?this.fixedColsStart:this.fixedRowsStart,c=t==="horizontal"?this.fixedColsEnd:this.fixedRowsEnd;if(typeof n=="function"){let u=[],d=0,p=r;d+=s,p-=c;for(let f=d;f<p;f++)u.push(this.getItemSize(f,t));a=xa(l,u)}else a=(n?Math.ceil(l/n):0)+1;return a+=s+c,t==="horizontal"?this.maxHorizontalRenderCount=a:this.maxVerticalRenderCount=a,a=Math.min(r,a),a}getFixedSize(t){return t==="horizontal"?this.getFixedStartColsWidth()+this.getFixedEndColsWidth():this.getFixedStartRowsHeight()+this.getFixedEndRowsHeight()}getFixedStartSize(t){return t==="horizontal"?this.getFixedStartColsWidth():this.getFixedStartRowsHeight()}getFixedEndSize(t){return t==="horizontal"?this.getFixedEndColsWidth():this.getFixedEndRowsHeight()}notifyRenderCountChange(){if(this.destroyed)return;let{horizontalRenderCount:t,verticalRenderCount:n}=this,r={horizontal:t,vertical:n},i=this.onRenderCountChangeFns;i.forEach(a=>{ti(()=>{this.destroyed||i.has(a)&&a(r)})})}getCellOffset(t,n){return{x:this.getItemOffsetFor(n,"horizontal"),y:this.getItemOffsetFor(t,"vertical")}}getInitialRowHeight(){return this.rowHeight}getInitialCols(){return this.cols}getInitialRows(){return this.rows}getItemOffsetFor(t,n){let r=n==="horizontal"?this.colWidth:this.rowHeight;if(typeof r!="function")return t*r;let i=n==="horizontal"?this.colOffsetCache:this.rowOffsetCache,a=n==="horizontal"?this.colWidthCache:this.rowHeightCache,l=i[t];if(l==null){let s=a.length-1;for(;s<t;)s+=1,this.computeCacheFor(s,n);l=i[t]}return l}getItemSizeCacheFor(t,n){return(n==="horizontal"?this.colWidthCache:this.rowHeightCache)[t]}getRowIndexInPage(t){return t}getPageIndexForRow(t){return 0}getVirtualizedContentSize(){return{height:this.getVirtualizedContentSizeFor("vertical"),width:this.getVirtualizedContentSizeFor("horizontal")}}getVirtualizedContentSizeFor(t){let n=t==="horizontal"?this.cols:this.rows,r=t==="horizontal"?this.colWidth:this.rowHeight,i=t==="horizontal"?this.horizontalTotalSize:this.verticalTotalSize;if(typeof r!="function")return r*n;if(i!==0&&!isNaN(i))return i;let a=t==="horizontal"?this.colOffsetCache:this.rowOffsetCache,l=n?this.getItemSize(n-1,t):0,s=n?a[n-1]:0,c=l+s;return t==="horizontal"?this.horizontalTotalSize=c:this.verticalTotalSize=c,c}notifyDestroy(){let t=this.onDestroyFns;for(let n=0,r=t.length;n<r;n++)t[n]()}destroy(){this.destroyed||(this.notifyDestroy(),this.reset(),this.rowspanParent.clear(),this.colspanParent.clear(),this.alwaysRenderedColumns.clear(),this.horizontalExtendRangeBy=Ea,this.verticalExtendRangeBy=Ea,this.destroyed=!0,this.onDestroyFns=[],this.onScrollFns=[],this.onScrollStartFns=[],this.onScrollStopFns=[],this.onRenderCountChangeFns.clear(),this.onScrollOriginChangeFns.clear(),this.onRenderRangeChangeFns.clear(),this.onVerticalRenderRangeChangeFns.clear(),this.onHorizontalRenderRangeChangeFns.clear())}};var ac=H(an());function _m(...o){if(!o.length)return new Set;let[e,...t]=o;return new Set([...e].filter(n=>t.every(r=>r.has(n))))}function Om(o,e){let t=new Set;for(let n of o)e(n)&&t.add(n);return t}function oi(o,e){for(let t of o)if(e(t))return t}var Ma=(o,e)=>o-e,Aa=class extends It{constructor(t,n){super(`${t}:GridCellManager`);this.matrix=new q;this.rowsWithCellsHistory=new Map;this.columnsWithCellsHistory=new Map;this.cellToMatrixPosition=new WeakMap;this.getCellsOutsideRenderRange=t=>{let{start:n,end:r}=t,[i,a]=n,[l,s]=r,c=new Set;return this.matrix.visit(({value:u},d)=>{if(!u)return;let[p,f]=d,m=p<i,g=p>=l,h=f<a,S=f>=s;(m||g||h||S)&&c.add(u)}),c};this.debugId=t,this.pool=n,this.offRemoveCell=this.pool.onRemoveCell(r=>this.onRemoveCell(r))}onRemoveCell(t){let n=this.cellToMatrixPosition.get(t);this.cellToMatrixPosition.delete(t),n&&this.clearCellFromMatrix(t,n,{skipHistory:!1})}set poolSize(t){this.pool.poolSize=t}get poolSize(){return this.pool.poolSize}getDetachedCell(){return this.pool.getDetachedCell()}clearCellFromMatrix(t,n,r){if(this.matrix.delete(n),r.skipHistory)return;let[i,a]=n,l=this.rowsWithCellsHistory.get(i),s=this.columnsWithCellsHistory.get(a);l&&(l.delete(t),l.size===0&&this.rowsWithCellsHistory.delete(i)),s&&(s.delete(t),s.size===0&&this.columnsWithCellsHistory.delete(a))}addCellToMatrix(t,n){let[r,i]=n;this.matrix.set(n,t),this.cellToMatrixPosition.set(t,n);let a=this.rowsWithCellsHistory.get(r),l=this.columnsWithCellsHistory.get(i);a?a.add(t):(a=new Set,a.add(t),this.rowsWithCellsHistory.set(r,a)),l?l.add(t):(l=new Set,l.add(t),this.columnsWithCellsHistory.set(i,l))}setCellPositionInMatrix(t,n){let r=this.cellToMatrixPosition.get(t);if(n==null){r&&this.clearCellFromMatrix(t,r,{skipHistory:!0});return}let[i,a]=n,l=r&&r[0]===i&&r[1]===a;r&&!l&&this.clearCellFromMatrix(t,r,{skipHistory:!1}),this.addCellToMatrix(t,n)}renderNodeAtCell(t,n,r,i){let a=this.getCellAt(r);return a&&a!==n&&this.detachCellAt(r),this.pool.attachCell(n),this.setCellPositionInMatrix(n,r),n.update(t,i),n}getCellPosition(t){let n=this.cellToMatrixPosition.get(t);return!n||this.getCellAt(n)!=t?null:n}getCellAt(t){return this.matrix.get(t)}getCellFor(t,n){let r=this.getCellAt(t);if(r)return r;let[i,a]=t;if(n==="row"){let l=this.rowsWithCellsHistory.get(i);l&&(r=oi(l,s=>!this.isCellAttached(s)))}if(n==="column"){let l=this.columnsWithCellsHistory.get(a);l&&(r=oi(l,s=>!this.isCellAttached(s)))}return r??this.getDetachedCell()}isCellAttached(t){return this.getCellPosition(t)!==null}isCellAttachedAt(t){let n=this.getCellAt(t);return n?this.isCellAttached(n):!1}getMatrix(){let t=this.getRowsWithCells().pop()??-1,n=this.getColumnsWithCells().pop()??-1;return Array.from({length:t+1},(i,a)=>Array.from({length:n+1},(s,c)=>{let u=[a,c],d=this.getCellAt(u);return d?d.getNode():null}))}getAllCells(){return[...this.pool.getAllCells()]}getCellsForRow(t){return this.matrix.getKeysStartingWith([t]).map(n=>this.getCellAt(n)).filter(Boolean)}getOneAttachedCell(){return this.pool.getAttachedCells().values().next().value}getRowsWithCells(){return this.matrix.rawKeysAt([]).sort(Ma)}getColumnsWithCells(){let t=this.matrix.getKeysOfFirstChildOnEachBranchStartingWith([],{excludeSelf:!0});return[...new Set(t.map(r=>r[1])).values()].sort(Ma)}isRowAttached(t){return this.getRowsWithCells().includes(t)}isColumnAttached(t){return this.getColumnsWithCells().includes(t)}detachRow(t){this.matrix.getKeysStartingWith([t]).forEach(r=>this.detachCellAt(r))}detachCol(t){this.matrix.visit((n,r)=>{r[1]===t&&this.detachCellAt(r)})}detachCell(t){return t?(this.pool.detachCell(t)&&this.setCellPositionInMatrix(t,null),!0):!1}detachCells(t){t.forEach(n=>this.detachCell(n))}detachRowsStartingWith(t){let n=this.getRowsWithCells().sort(),r=(0,ac.default)(n,t,Ma);r<0&&(r=~r),n.slice(r).forEach(a=>this.detachRow(a))}detachColsStartingWith(t){let n=this.getColumnsWithCells().sort(),r=(0,ac.default)(n,t,Ma);r<0&&(r=~r),n.slice(r).forEach(a=>this.detachCol(a))}detachCellsStartingAt(t){let[n,r]=t;this.matrix.visit((i,a)=>{let[l,s]=a;l>n&&this.detachCellAt(a),l===n&&s>=r&&this.detachCellAt(a)})}detachCellAt(t){let n=this.getCellAt(t);return n?this.detachCell(n):!1}onCellAttachmentChange(t){return this.pool.onCellAttachmentChange(t)}getCellFromListForRow(t,n){return oi(t,r=>this.getCellPosition(r)?.[0]===n)}getCellFromListForColumn(t,n){return oi(t,r=>this.getCellPosition(r)?.[1]===n)}getCellCountInMatrix(){return this.matrix.size}flushPendingAfterCommitWork(){this.pool.flushPendingAfterCommitWork()}destroy(){this.reset()}reset(){this.pool.reset(),this.matrix.clear(),this.rowsWithCellsHistory.clear(),this.columnsWithCellsHistory.clear(),this.offRemoveCell(),this.offRemoveCell=()=>{}}makeDetachedCellsEmpty(){this.pool.getDetachedCells().forEach(t=>{t.update(null)})}withDetachedCells(t){this.pool.getDetachedCells().forEach(t)}};var Fm=H(an());var _a=class extends It{constructor(t,n){super(`${t}:ListRowManager`);this.indexToRow=new Map;this.rowToIndex=new WeakMap;this.debugId=t,this.pool=n,this.offRemoveRow=this.pool.onRemoveRow(r=>this.onRemoveRow(r))}onRemoveRow(t){let n=this.rowToIndex.get(t);n!=null&&(this.rowToIndex.delete(t),this.indexToRow.delete(n))}set poolSize(t){this.pool.poolSize=t}get poolSize(){return this.pool.poolSize}getDetachedRow(){return this.pool.getDetachedRow()}getRowFor(t){return this.getRowAt(t)??this.getDetachedRow()}setRowIndexInList(t,n){let r=this.rowToIndex.get(t);r!=null&&this.indexToRow.delete(r),n==null?this.rowToIndex.delete(t):(this.rowToIndex.set(t,n),this.indexToRow.set(n,t))}detachStartingWith(t){let n=this.getAttachedIndexes(),r=(0,Fm.default)(n,t,(a,l)=>a-l);r<0&&(r=~r),n.slice(r).forEach(a=>this.detachRowAt(a))}getRowAt(t){return this.indexToRow.get(t)}getRowIndex(t){return this.rowToIndex.get(t)}isRowAttached(t){return this.getRowIndex(t)!=null}isRowAttachedAt(t){return!!this.getRowAt(t)}getList(){let t=Math.max(...this.indexToRow.keys());return Array.from({length:t+1},(r,i)=>{let a=this.indexToRow.get(i);return a?a.getNode():null})}getAttachedCount(){return this.indexToRow.size}forEachAttachedRow(t){this.indexToRow.forEach(t)}getAttachedIndexes(){return Array.from(this.indexToRow.keys()).sort()}getAllRows(){return[...this.pool.getAllRows()]}detachRowAt(t){let n=this.getRowAt(t);n&&(this.setRowIndexInList(n,null),this.pool.detachRow(n))}detachRow(t){let n=this.getRowIndex(t);n!=null&&this.detachRowAt(n)}renderNodeAtRow(t,n,r){let i=this.getRowAt(r);return i&&i!==n&&this.detachRowAt(r),this.pool.attachRow(n),this.setRowIndexInList(n,r),n.update(t),n}makeDetachedRowsEmpty(){this.pool.getDetachedRows().forEach(t=>{t.update(null)})}onRowAttachmentChange(t){return this.pool.onRowAttachmentChange(t)}withDetachedRows(t){this.pool.getDetachedRows().forEach(t)}destroy(){this.reset()}reset(){this.pool.reset(),this.indexToRow.clear(),this.offRemoveRow(),this.offRemoveRow=()=>{}}};var Nm=!0,Sn=Q(J.y),Lm=Q(J.scrollTop),lN=Q(J.columnOffsetAtIndex),lc=Q(J.columnOffsetAtIndexWhileReordering),cr=class extends It{constructor(t,n,r){n=n||"ReactHeadlessTableRenderer";super(n);this.debugId="";this.destroyed=!1;this.scrolling=!1;this.cellHoverClassNames=[];this.cellDetachedClassNames=[];this.lastEnteredRow=-1;this.lastExitedRow=-1;this.hoverRowUpdatesInProgress=new Map;this.infiniteNode=null;this.setDetailTransform=(t,n,{y:r,scrollTop:i,scrollLeft:a})=>{i||(r-=this.brain.getScrollOrigin().scrollTop),t.style.setProperty(Sn,i?`calc( ${r}px + var(${Lm}) )`:`${r}px`),t.style.transform=`translate3d(${a||0}px, var(${Sn}), 0)`};this.setTransform=(t,n,r,{x:i,y:a,scrollLeft:l,scrollTop:s},c)=>{let u=ve.columnOffsets.get(r),d=`${lc}-${r}`,p=s?`calc( ${a}px + var(${Lm}) )`:`${a-this.brain.getScrollOrigin().scrollTop}px`;t.__currentTransformY!==p&&(t.__currentTransformY=p,t.style.setProperty(Sn,p));let f=`translate3d(var(${d}, ${u}), var(${Sn}), 0)`;t.__transformValue!==f&&(t.__transformValue=f,t.style.transform=f),c!=null};this.onScrollOriginChange=()=>{this.destroyed||(this.cellManager.getAllCells().forEach(t=>{this.updateElementPosition(t,void 0,{immediate:!0})}),this.rowManager.forEachAttachedRow(t=>{this.updateDetailElementPosition(t)}),this.adjustFixedElementsOnScroll())};this.getFullyVisibleRowsRange=()=>{let{start:[t],end:[n]}=this.brain.getRenderRange();for(;!this.isRowFullyVisible(t);)if(t++,t===n)return null;for(;!this.isRowFullyVisible(n);)if(n--,n===t)return null;return{start:t,end:n}};this.getScrollPositionForScrollRowIntoView=(t,n={offset:0})=>{if(this.destroyed)return null;let{brain:r}=this,i=r.getScrollPosition(),a=i.scrollLeft,{scrollAdjustPosition:l,offset:s=0}=n;if(this.isRowFullyVisible(t)&&!l)return i;let c=r.getItemOffsetFor(t,"vertical"),u=r.getItemSize(t,"vertical"),d=r.getFixedStartRowsHeight(),p=r.getFixedEndRowsHeight(),f=i.scrollTop,m=r.getAvailableSize();if(!m.height)return null;let g=f+m.height;l||(l=c>g-p?"end":c<f+d?"start":"end");let h=i.scrollTop;if(l==="center"?h=c-Math.floor((r.getAvailableSize().height-d-p)/2):l==="start"?(s=-s,h+=c-f+s-d):(s+=u,h+=c-g+s+p),this.brain.isHorizontalLayoutBrain){let S=n.colIndex??Math.ceil(this.brain.getInitialCols()/2),y=this.getScrollPositionForScrollColumnIntoView(S,{...n,horizontalLayoutPageIndex:this.brain.getPageIndexForRow(t)});y&&(a=y.scrollLeft)}return{scrollLeft:a,scrollTop:h}};this.getScrollPositionForScrollColumnIntoView=(t,n={offset:0})=>{if(this.destroyed)return null;let{brain:r}=this,i=r.getScrollPosition(),a=n.horizontalLayoutPageIndex!=null?{horizontalLayoutPageIndex:n.horizontalLayoutPageIndex}:void 0,{scrollAdjustPosition:l,offset:s=0}=n;if(this.isColumnFullyVisible(t,void 0,a)&&!l)return i;a&&(t=r.getInitialCols()*a.horizontalLayoutPageIndex+t);let c=r.getItemOffsetFor(t,"horizontal"),u=r.getItemSize(t,"horizontal"),d=r.getFixedStartColsWidth(),p=r.getFixedStartColsWidth(),f=i.scrollLeft,m=r.getAvailableSize();if(!m.width)return null;let g=f+m.width;l||(l=c>g-p?"end":c<f+d?"start":"end");let h=i.scrollLeft;return l==="center"?h=c-Math.floor((r.getAvailableSize().width-d-p)/2):l==="start"?(s=-s,h+=c-f+s-d):(s+=u,h+=c-g+s+p),{...i,scrollLeft:h}};this.getScrollPositionForScrollCellIntoView=(t,n,r={offsetLeft:0,offsetTop:0})=>{if(this.destroyed)return null;let i=this.getScrollPositionForScrollColumnIntoView(n,{scrollAdjustPosition:r.colScrollAdjustPosition||r.scrollAdjustPosition,offset:r.offsetLeft}),a=this.getScrollPositionForScrollRowIntoView(t,{scrollAdjustPosition:r.rowScrollAdjustPosition||r.scrollAdjustPosition,offset:r.offsetTop});if(!i||!a)return null;let{scrollLeft:l}=i,{scrollTop:s}=a;return{scrollLeft:l,scrollTop:s}};this.isRowFullyVisible=(t,n=2)=>this.isRowVisible(t,this.brain.getRowHeight(t)-n);this.isRowVisible=(t,n=10)=>{if(!this.isRowRendered(t))return!1;t=this.brain.getPageIndexForRow(t)&&this.brain.rowsPerPage?t%this.brain.rowsPerPage:t;let{brain:i}=this;if(i.isRowFixed(t))return!0;let{start:[a],end:[l]}=this.brain.getRenderRange(),s=Math.floor((a+l)/2);if(t<a||t>=l)return!1;if(t>=s){let c=i.getItemAt(i.getAvailableSize().height+i.getScrollPosition().scrollTop-n,"vertical");return t<=c}if(t<s){let c=i.getItemAt(i.getScrollPosition().scrollTop+n,"vertical");return t>=c}return!0};this.isRowRendered=t=>{if(!this.brain.isHorizontalLayoutBrain)return this.cellManager.isRowAttached(t);let n=t;return t=this.brain.rowsPerPage?t%this.brain.rowsPerPage:t,this.cellManager.getCellsForRow(t).filter(r=>r.getAdditionalInfo()?.renderRowIndex===n).length>0};this.isCellVisible=(t,n)=>this.isRowVisible(t)&&this.isColumnVisible(n);this.isCellFullyVisible=(t,n,r)=>this.isRowFullyVisible(t)&&this.isColumnVisible(n,void 0,r);this.isColumnFullyVisible=(t,n=2,r)=>this.isColumnVisible(t,this.brain.getColWidth(t)-n,r);this.isColumnVisible=(t,n=10,r)=>{if(!this.isColumnRendered(t,r))return!1;let{brain:i}=this;if(i.isColFixed(t))return!0;r&&r.horizontalLayoutPageIndex!=null&&(t=i.getVirtualColIndex(t,{pageIndex:r.horizontalLayoutPageIndex}));let{start:[a,l],end:[s,c]}=i.getRenderRange();if(t<l||t>=c)return!1;let u=Math.floor((l+c)/2);if(t>=u){let d=i.getItemAt(i.getAvailableSize().width+i.getScrollPosition().scrollLeft-n-i.getFixedEndColsWidth(),"horizontal");return t<=d}if(t<u){let d=i.getItemAt(i.getScrollPosition().scrollLeft+n+i.getFixedStartColsWidth(),"horizontal");return t>=d}return!0};this.isCellRendered=(t,n,r)=>this.isRowRendered(t)&&this.isColumnRendered(n,r);this.isColumnRendered=(t,n)=>{let{start:[r]}=this.brain.getRenderRange();return n?.horizontalLayoutPageIndex!=null&&(t=this.brain.getInitialCols()*n.horizontalLayoutPageIndex+t),this.cellManager.isCellAttachedAt([r,t])};this.getExtraSpanCellsForRange=t=>{let{start:n,end:r}=t,[i,a]=n,[l,s]=r;return this.brain.getExtraSpanCellsForRange({horizontal:{startIndex:a,endIndex:s},vertical:{startIndex:i,endIndex:l}})};this.getFixedRanges=t=>{let{fixedRowsStart:n,fixedRowsEnd:r,fixedColsStart:i,fixedColsEnd:a}=this.brain.getFixedCellInfo();if(!n&&!i&&!r&&!a)return[];let l=this.brain.getColCount(),s=this.brain.getRowCount(),{start:c,end:u}=t,[d,p]=c,[f,m]=u,g=[];if(i&&(n&&g.push({rowFixed:"start",colFixed:"start",start:[0,0],end:[n,i]}),r&&g.push({rowFixed:"end",colFixed:"start",start:[s-r,0],end:[s,i]}),g.push({rowFixed:!1,colFixed:"start",start:[d,0],end:[f,i]})),a&&(n&&g.push({colFixed:"end",rowFixed:"start",start:[0,l-a],end:[n,l]}),r&&g.push({colFixed:"end",rowFixed:"end",start:[s-r,l-a],end:[s,l]}),g.push({colFixed:"end",rowFixed:!1,start:[d,l-a],end:[f,l]})),n){let h={start:[0,p],end:[n,m],rowFixed:"start",colFixed:!1};g.push(h)}if(r){let h={rowFixed:"end",colFixed:!1,start:[s-r,p],end:[s,m]};g.push(h)}return g};this.isCellFixed=(t,n)=>{let{fixedRowsStart:r,fixedRowsEnd:i,fixedColsStart:a,fixedColsEnd:l}=this.brain.getFixedCellInfo(),s=this.brain.getColCount(),c=this.brain.getRowCount(),u=!1,d=!1,p=!1;if(t<r&&(u=!0,p="start"),i&&!u){let f=c-i;t>=f&&(u=!0,p="end")}if(n<a&&(d=!0,p="start"),l&&!d){let f=s-l;n>=f&&(d=!0,p="end")}return{row:u?p:!1,col:d?p:!1}};this.isCellCovered=(t,n)=>{let r=this.brain.getRowspanParent(t,n),i=this.brain.getColspanParent(t,n),a=r!=t,l=i!=n;return a||l?[r,i]:!1};this.onMouseEnterNotBound=t=>{let n=this.getMatrixRowIndexFromElement(t.currentTarget);this.onMouseEnter(n)};this.onMouseLeaveNotBound=t=>{let n=this.getMatrixRowIndexFromElement(t.currentTarget);this.onMouseLeave(n)};this.onMouseEnter=t=>{this.lastEnteredRow=t,this.lastExitedRow=-1,!this.scrolling&&t!=-1&&this.addHoverClass(t)};this.addHoverClass=t=>{this.cellManager.getCellsForRow(t).forEach(n=>{let r=n.getElement();r&&this.cellHoverClassNames.forEach(i=>{r.classList.add(i)})})};this.onMouseLeave=t=>{this.lastExitedRow=t,this.lastEnteredRow=-1,!this.scrolling&&t!=-1&&this.removeHoverClass(t)};this.removeHoverClass=t=>{this.cellManager.getCellsForRow(t).forEach(n=>{let r=n.getElement();r&&this.cellHoverClassNames.forEach(i=>{r.classList.remove(i)})})};this.updateHoverClassNamesForRow=t=>{if(this.scrolling||this.hoverRowUpdatesInProgress.has(t))return;this.hoverRowUpdatesInProgress.set(t,!0);let n=()=>{!this.scrolling&&this.lastEnteredRow!=-1&&(this.lastEnteredRow===t?this.addHoverClass(t):this.removeHoverClass(t))};He(()=>{this.destroyed||(n(),this.hoverRowUpdatesInProgress.delete(t))})};this.updateElementPosition=(t,n,r)=>{if(this.destroyed)return;let i=t.getElement(),a=this.cellManager.getCellPosition(t);if(!a)return;let[l,s]=a,c=this.brain.getCellOffset(l,s);if(c==null)return;let{x:u,y:d}=c;if(i){let p=()=>{this.updateHoverClassNamesForRow(l);let f=this.getCellRealCoordinates(l,s);if(i.dataset.rowIndex=f.rowIndex,i.dataset.colIndex=f.colIndex,Nm){this.setTransform(i,l,s,{x:u,y:d},null),i.style.willChange="transform",i.style.backfaceVisibility="hidden";let g=(n?n.hidden:!!this.isCellCovered(l,s))?"-1":i.dataset.zIndex||"auto";i.__zIndex!==g&&(i.__zIndex=g,i.style.zIndex=g)}else i.style.display="",i.style.left=`${u}px`,i.style.top=`${d}px`};this.scrolling&&this.brain.isHorizontalLayoutBrain&&!r?.immediate?t.setPendingAfterCommitWork(p):p()}};this.updateDetailElementPosition=t=>{if(this.destroyed)return;let n=t.getElement(),r=this.rowManager.getRowIndex(t);if(r==null)return;let i=this.brain.getItemOffsetFor(r,"vertical");if(i==null)return;let a=i;n&&(n.dataset.detailRowIndex=r,Nm&&(this.setDetailTransform(n,r,{y:a,scrollLeft:this.brain.getDOMScrollPosition().scrollLeft}),n.style.willChange="transform",n.style.backfaceVisibility="hidden",n.style.zIndex=n.dataset.zIndex||"auto"))};this.onScrollStart=()=>{this.scrolling=!0,this.lastEnteredRow!=-1&&this.removeHoverClass(this.lastEnteredRow)};this.onScrollStop=()=>{this.scrolling=!1,this.flushPendingAfterCommitWork(),this.lastEnteredRow!=-1&&this.addHoverClass(this.lastEnteredRow),this.lastExitedRow!=-1&&this.removeHoverClass(this.lastExitedRow)};this.adjustFixedElementsOnScroll=(t=this.brain.getScrollPosition())=>{let{brain:n,cellManager:r,rowManager:i}=this,a=this.brain.getColCount(),l=this.brain.getRowCount(),{fixedColsStart:s,fixedColsEnd:c,fixedRowsStart:u,fixedRowsEnd:d}=this.brain.getFixedCellInfo();if(i.getAttachedCount()&&i.forEachAttachedRow(x=>{let A=i.getRowIndex(x);if(A!=null){let O=this.brain.getItemOffsetFor(A,"vertical");if(O==null)return;let F=x.getElement();if(!F)return;this.setDetailTransform(F,A,{y:O,scrollLeft:n.getDOMScrollPosition(t).scrollLeft})}}),!s&&!c&&!u&&!d)return;let p=this.cellManager.getOneAttachedCell();p&&hp(n.getDOMScrollPosition(t),this.getInfiniteNode(p.getElement()));let f=this.brain.getFixedEndColsOffsets({skipScroll:!0}),m=this.brain.getFixedEndRowsOffsets({skipScroll:!0}),{start:g,end:h}=this.brain.getRenderRange(),[S,y]=g,[T,b]=h;function R(x,A,O){let F=r.getCellAt([x,A]);if(F==null)return;let z=n.getCellOffset(x,A),L=F.getElement();L&&z&&O(x,A,L,z)}let C=(x,A,O,{x:F,y:z})=>{this.setTransform(O,x,A,{x:F,y:z,scrollLeft:!0},s-A)},I=(x,A,O,F)=>{this.setTransform(O,x,A,{x:F.x,y:F.y,scrollTop:!0},u-x)},w=(x,A,O,{y:F})=>{let z=f[A];this.setTransform(O,x,A,{x:z,y:F,scrollLeft:!0},a-A)},v=(x,A,O,F)=>{this.setTransform(O,x,A,{x:F.x,y:m[x],scrollTop:!0},l-x)},P=(x,A,O,{x:F,y:z})=>{this.setTransform(O,x,A,{x:F,scrollLeft:!0,y:z,scrollTop:!0},1e5)},E=(x,A,O,{x:F})=>{this.setTransform(O,x,A,{x:F,scrollLeft:!0,y:m[x],scrollTop:!0},2e5)},M=(x,A,O,F)=>{this.setTransform(O,x,A,{x:f[A],y:F.y,scrollLeft:!0,scrollTop:!0},3e5)},D=(x,A,O)=>{this.setTransform(O,x,A,{x:f[A],y:m[x],scrollLeft:!0,scrollTop:!0},4e5)};if(s||c)for(let x=S;x<T;x++){for(let A=0;A<s;A++)R(x,A,C);if(c){let A=a-c;for(let O=A;O<a;O++)R(x,O,w)}}if(u||d)for(let x=y;x<b;x++){for(let A=0;A<u;A++)R(A,x,I);if(d){let A=l-d;for(let O=A;O<l;O++)R(O,x,v)}}if(s&&u)for(let x=0;x<u;x++)for(let A=0;A<s;A++)R(x,A,P);if(s&&d){let x=l-d;for(let A=x;A<l;A++)for(let O=0;O<s;O++)R(A,O,E)}if(c&&u){let x=a-c;for(let A=0;A<u;A++)for(let O=x;O<a;O++)R(A,O,M)}if(c&&d){let x=l-d,A=a-c;for(let O=x;O<l;O++)for(let F=A;F<a;F++)R(O,F,D)}};this.flushPendingAfterCommitWork=()=>{this.destroyed||this.cellManager.flushPendingAfterCommitWork()};this.destroy=()=>{this.destroyed||(this.destroyed=!0,this.reset(),this.onDestroy(),this.hoverRowUpdatesInProgress.clear(),this.hoverRowUpdatesInProgress=null,this.brain=null)};this.brain=t,this.debugId=n,this.cellManager=new Aa(n,r.cellPool),this.cellManager.onCellAttachmentChange((u,d)=>{d?this.onCellAttached(u):this.onCellDetached(u)}),this.rowManager=new _a(n,r.rowPool),this.rowManager.onRowAttachmentChange((u,d)=>{d?this.onRowAttached(u):this.onRowDetached(u)}),this.renderRange=this.renderRange.bind(this);let i=t.onScroll(this.adjustFixedElementsOnScroll),a=t.onAvailableSizeChange(()=>{this.adjustFixedElementsOnScroll(),He(()=>{this.destroyed||this.adjustFixedElementsOnScroll()})}),l=t.onScrollStart(this.onScrollStart),s=t.onScrollStop(this.onScrollStop),c=t.onScrollOriginChange(this.onScrollOriginChange);this.onDestroy=()=>{c(),i(),a(),l(),s()}}getInfiniteNode(t){return this.infiniteNode||(this.infiniteNode=vs(t)),this.infiniteNode}onCellAttached(t){if(this.cellDetachedClassNames.length){let n=t.getElement();n&&this.cellDetachedClassNames.forEach(r=>{n.classList.remove(r)})}}onCellDetached(t){if(this.cellDetachedClassNames.length){let n=t.getElement();n&&this.cellDetachedClassNames.forEach(r=>{n.classList.add(r)})}}onRowAttached(t){if(this.cellDetachedClassNames.length){let n=t.getElement();n&&this.cellDetachedClassNames.forEach(r=>{n.classList.remove(r)})}}onRowDetached(t){if(this.cellDetachedClassNames.length){let n=t.getElement();n&&this.cellDetachedClassNames.forEach(r=>{n.classList.add(r)})}}isCellRenderedAndMappedCorrectly(t,n){let r=!!this.cellManager.getCellAt([t,n]);return{rendered:r,mapped:r}}renderRange(t,{renderCell:n,renderDetailRow:r,force:i,onRender:a}){if(this.destroyed)return[];let{start:l,end:s}=t,c=this.brain.isHorizontalLayoutBrain,{rowManager:u,cellManager:d}=this,p=this.getFixedRanges(t),f=[t,...p],m=this.brain.getAlwaysRenderedColumns();if(m.length>0){let P=t.start[1],E=t.end[1];m.forEach(M=>{P<=M&&M<E||f.push({start:[t.start[0],M],end:[t.end[0],M+1]})})}let g=new Map,h=f.map(this.getExtraSpanCellsForRange).flat();h&&h.forEach(([P,E])=>{g.set(`${P}:${E}`,!0)});let S=f.reduce((P,E)=>P+ic(E),0),y=r?f.reduce((P,E)=>P+Am(E),0):0,T=this.brain.getRowCount(),b=this.brain.getColCount();d.detachCellsStartingAt([T,b]);let R=Math.min(T*b,S);r&&(u.detachStartingWith(this.brain.getRowCount()),u.poolSize>y&&(u.poolSize=y));let C=_m(...f.map(P=>d.getCellsOutsideRenderRange(P)));C=Om(C,P=>{let E=d.getCellPosition(P);return!(E&&g.has(`${E[0]}:${E[1]}`))}),d.detachCells(C),d.poolSize=R;let I=new Map,w=new Map;f.forEach(P=>{let{start:E,end:M}=P,[D,x]=E,[A,O]=M;for(let F=D;F<A;F++){for(let L=x;L<O;L++){let B=`${F}:${L}`;if(I.has(B))continue;I.set(B,!0);let{rendered:Y,mapped:V}=this.isCellRenderedAndMappedCorrectly(F,L);if(F===D||L===x){let N=this.isCellCovered(F,L);if(N&&g.has(`${N[0]}:${N[1]}`)){let K=d.getCellAt([F,L]);K!=null&&d.detachCell(K);continue}}if(Y&&!i&&V)continue;let W;Y?W=d.getCellAt([F,L]):W=d.getCellFor([F,L],c?"row":"column"),W==null&&(W=d.getDetachedCell()),this.renderCellAt(F,L,W,n)}!r||w.has(F)||(w.set(F,!0),u.isRowAttachedAt(F)&&!i)||this.renderDetailRowAtElement(F,this.rowManager.getRowFor(F),r)}}),h.forEach(([P,E])=>{let{rendered:M,mapped:D}=this.isCellRenderedAndMappedCorrectly(P,E);if(M){if(i||!D){let A=[P,E],O=d.getCellAt(A);this.renderCellAt(P,E,O,n)}return}let x=d.getCellFor([P,E],c?"row":"column");x!=null&&this.renderCellAt(P,E,x,n)});let v=d.getAllCells().map(P=>P.getNode());return r&&u.getAllRows().forEach(P=>{v.push(P.getNode())}),this.adjustFixedElementsOnScroll(),a&&a(v),v}renderDetailRowAtElement(t,n,r){if(this.destroyed)return;let i=!1,a=this.brain.getRowHeight(t),l=this.brain.isRowFixedStart(t)?"start":this.brain.isRowFixedEnd(t)?"end":!1,c=r({rowIndex:t,height:a,rowFixed:l,hidden:!!i,onMouseEnter:()=>{},onMouseLeave:()=>{},domRef:n.ref});if(n.isMounted()||n.onMount(u=>{let d=u.getElement();d&&(d.style.position="absolute",d.style.left="0px"),this.updateDetailElementPosition(u)}),!c){this.rowManager.detachRow(n);return}this.rowManager.renderNodeAtRow(c,n,t),this.updateDetailElementPosition(n)}getCellRealCoordinates(t,n){return{rowIndex:t,colIndex:n}}getMatrixRowIndexFromElement(t){let n=Number(t.dataset.rowIndex);return this.brain.isHorizontalLayoutBrain?this.brain.getRowIndexInPage(n):n}renderCellAt(t,n,r,i){if(this.destroyed)return;let a=this.isCellCovered(t,n),l=this.brain.getRowHeight(t),s=this.brain.getColWidth(n),c=this.brain.getRowspan(t,n),u=this.brain.getColspan(t,n),d=c===1?l:this.brain.getRowHeightWithSpan(t,n,c),p=u===1?s:this.brain.getColWidthWithSpan(t,n,u),{row:f,col:m}=this.isCellFixed(t,n),g=!!a,{rowIndex:h,colIndex:S}=this.getCellRealCoordinates(t,n),y=i({rowIndex:h,colIndex:S,height:l,width:s,rowspan:c,colspan:u,rowFixed:f,colFixed:m,hidden:g,heightWithRowspan:d,widthWithColspan:p,onMouseEnter:this.onMouseEnterNotBound,onMouseLeave:this.onMouseLeaveNotBound,domRef:r.ref});r.isMounted()||r.onMount(R=>{let C=R.getElement();C&&(C.style.position="absolute",C.style.left="0px",C.style.top="0px"),this.updateElementPosition(R)});let T=this.brain.isHorizontalLayoutBrain?{renderRowIndex:h,renderColIndex:S}:void 0,b=this.brain.isHorizontalLayoutBrain;if(!y){b?this.cellManager.detachCell(r):this.cellManager.detachCell(r);return}this.cellManager.renderNodeAtCell(y,r,[t,n],T),this.updateElementPosition(r,{hidden:g,rowspan:c,colspan:u})}reset(){this.cellManager.reset(),this.rowManager.reset()}};var Oa=class extends cr{constructor(t,n,r){super(t,n,r);this.setTransform=(t,n,r,i,a)=>{let l=this.getCellRealCoordinates(n,r),{y:s}=i,c=Math.floor(l.rowIndex/this.brain.rowsPerPage)-this.brain.getScrollOriginPageIndex(),u=he.runtime.totalVisibleColumnsWidthVar,d=c?`calc(${u} * ${c})`:"0px",p=ve.columnOffsets.get(l.colIndex),f=`${lc}-${l.colIndex}`,m=`${s}px`;t.__currentTransformY!==m&&(t.__currentTransformY=m,t.style.setProperty(Sn,m));let g=`calc(var(${f}, ${p}) + ${d})`,h=`var(${Sn})`,S=`translate3d(${g}, ${h}, 0px)`;t.__transformValue!==S&&(t.__transformValue=S,t.style.transform=S)};this.brain=t}getCellRealCoordinates(t,n){return this.brain.getHorizontalLayoutPositionFromMatrixCoordinates({rowIndex:t,colIndex:n})}isCellRenderedAndMappedCorrectly(t,n){let r=this.cellManager.getCellAt([t,n]),i=!!r;if(!i)return{rendered:i,mapped:!1};let a=r.getAdditionalInfo();if(!a)return{rendered:i,mapped:!1};let l=this.getCellRealCoordinates(t,n),s=l.colIndex===a.renderColIndex&&l.rowIndex===a.renderRowIndex;return{rendered:i,mapped:s}}};var zm=H(require("react"));var ur=class ur extends It{constructor(t){super(t);this.cellRemoveSubscription=Ce();this.cellAttachmentChangeSubscription=Ce();this.attachedCells=new Set,this.detachedCells=new Set,this.allCellsOrdered=new Set}destroy(){this.reset()}onRemoveCell(t){return this.cellRemoveSubscription.onChange(r=>{r!=null&&t(r)})}onCellAttachmentChange(t){return this.cellAttachmentChangeSubscription.onChange(r=>{if(r==null)return;let{cell:i,attached:a}=r;t(i,a)})}reset(){this.attachedCells.clear(),this.detachedCells.clear(),this.allCellsOrdered.clear(),this.cellRemoveSubscription.destroy(),this.cellAttachmentChangeSubscription.destroy()}getAttachedCells(){return this.attachedCells}getDetachedCells(){return this.detachedCells}getAllCells(){return this.allCellsOrdered}createCell(){let t=this.createCellInstance();return this.detachedCells.add(t),this.allCellsOrdered.add(t),t}removeCell(t){this.detachedCells.delete(t),this.attachedCells.delete(t),this.allCellsOrdered.delete(t),t.destroy(),this.cellRemoveSubscription(t)}attachCell(t){return t&&this.attachedCells.has(t)||(t||(t=this.getDetachedCell()),this.detachedCells.delete(t),this.attachedCells.add(t),this.cellAttachmentChangeSubscription({cell:t,attached:!0})),t}detachCell(t){return this.detachedCells.has(t)?!1:(this.attachedCells.delete(t),this.detachedCells.add(t),this.cellAttachmentChangeSubscription({cell:t,attached:!1}),!0)}getDetachedCell(){let{detachedCells:t}=this,n=t.values().next().value;return n||(this.poolSize+=ur.POOL_SIZE_INCREMENT,n=t.values().next().value),n||this.error("No cells available in the pool!"),n}get attachedSize(){return this.attachedCells.size}get detachedSize(){return this.detachedCells.size}get poolSize(){return this.allCellsOrdered.size}flushPendingAfterCommitWork(){for(let t of this.attachedCells)t.flushPendingAfterCommitWork()}set poolSize(t){t=Math.ceil(t/ur.POOL_SIZE_INCREMENT)*ur.POOL_SIZE_INCREMENT;let n=this.poolSize;if(t===n)return;let{detachedCells:r}=this,i=n-t;if(i>0){i>r.size&&(i=r.size,this.debug("Trying to destroy more cells than are currently detached!"));let a=r.values();for(;i>0;){let l=a.next().value;this.removeCell(l),i--}}else for(i=-i;i>0;)this.createCell(),i--}};ur.POOL_SIZE_INCREMENT=1;var Fa=ur;var km=new Map,BC=()=>{},sc=class{constructor(e,t){this.element=null;this.mounted=!1;this.pendingAfterCommitWork=null;this.mountSubscription=Ce();let n=km.get(e)??0,r=`${e}:GridCellReact:${n}`;km.set(e,n+1),this.debugId=r,this.cellInfo=t,this.updater=Ce(),this.node=zm.createElement(jo,{key:r,name:r,updater:this.updater}),this.ref=i=>{this.element=i,i?(this.mounted=!0,this.mountSubscription(this)):this.mounted=!1}}setPendingAfterCommitWork(e){this.pendingAfterCommitWork=e}flushPendingAfterCommitWork(){if(this.pendingAfterCommitWork){let e=this.pendingAfterCommitWork;this.pendingAfterCommitWork=null,e()}}isMounted(){return this.mounted}onMount(e){return this.mountSubscription.onChange(n=>{n!=null&&e(n)})}destroy(){this.mountSubscription.destroy(),this.updater.destroy(),this.pendingAfterCommitWork=null,this.ref=BC,this.element=null,this.node=null}getNode(){return this.node}update(e,t){this.updater(e),this.cellInfo=t}getAdditionalInfo(){return this.cellInfo}getElement(){return this.element}},Na=class extends Fa{constructor(t){super(`${t}:GridCellPoolForReact`);this.cellDebugId=t}createCellInstance(){return new sc(this.cellDebugId)}};var Gm=H(require("react"));var dr=class dr extends It{constructor(t){super(t);this.rowRemoveSubscription=Ce();this.rowAttachmentChangeSubscription=Ce();this.attachedRows=new Set,this.detachedRows=new Set,this.allRowsOrdered=new Set}destroy(){this.reset()}onRemoveRow(t){return this.rowRemoveSubscription.onChange(r=>{r!=null&&t(r)})}onRowAttachmentChange(t){return this.rowAttachmentChangeSubscription.onChange(r=>{if(r==null)return;let{row:i,attached:a}=r;t(i,a)})}reset(){this.attachedRows.clear(),this.detachedRows.clear(),this.allRowsOrdered.clear(),this.rowRemoveSubscription.destroy(),this.rowAttachmentChangeSubscription.destroy()}getAttachedRows(){return this.attachedRows}getDetachedRows(){return this.detachedRows}getAllRows(){return this.allRowsOrdered}createRow(){let t=this.createRowInstance();return this.detachedRows.add(t),this.allRowsOrdered.add(t),t}removeRow(t){this.detachedRows.delete(t),this.attachedRows.delete(t),this.allRowsOrdered.delete(t),t.destroy(),this.rowRemoveSubscription(t)}attachRow(t){return t&&this.attachedRows.has(t)||(t||(t=this.getDetachedRow()),this.detachedRows.delete(t),this.attachedRows.add(t),this.rowAttachmentChangeSubscription({row:t,attached:!0})),t}detachRow(t){return this.detachedRows.has(t)?!1:(this.attachedRows.delete(t),this.detachedRows.add(t),this.rowAttachmentChangeSubscription({row:t,attached:!1}),!0)}getDetachedRow(){let{detachedRows:t}=this,n=t.values().next().value;return n||(this.poolSize+=dr.POOL_SIZE_INCREMENT),n=t.values().next().value,n||this.error("No rows available in the pool!"),n}get attachedSize(){return this.attachedRows.size}get detachedSize(){return this.detachedRows.size}get poolSize(){return this.allRowsOrdered.size}set poolSize(t){t=Math.ceil(t/dr.POOL_SIZE_INCREMENT)*dr.POOL_SIZE_INCREMENT;let n=this.poolSize;if(t===n)return;let{detachedRows:r}=this,i=n-t;if(i>0){i>r.size&&(i=r.size,this.debug("Trying to destroy more rows than are currently detached!"));let a=r.values();for(;i>0;){let l=a.next().value;this.removeRow(l),i--}}else for(i=-i;i>0;)this.createRow(),i--}};dr.POOL_SIZE_INCREMENT=1;var La=dr;var Vm=new Map,WC=()=>{},cc=class{constructor(e){this.element=null;this.mounted=!1;this.mountSubscription=Ce();let t=Vm.get(e)??0,n=`${e}:ListRowReact:${t}`;Vm.set(e,t+1),this.debugId=n,this.updater=Ce(),this.node=Gm.createElement(jo,{key:`detail-row-${n}`,name:`detail-row-${n}`,updater:this.updater}),this.ref=r=>{this.element=r,r?(this.mounted=!0,this.mountSubscription(this)):this.mounted=!1}}isMounted(){return this.mounted}onMount(e){return this.mountSubscription.onChange(n=>{n!=null&&e(n)})}destroy(){this.mountSubscription.destroy(),this.updater.destroy(),this.ref=WC,this.element=null,this.node=null}getNode(){return this.node}update(e){this.updater(e)}getElement(){return this.element}},ka=class extends La{constructor(t){super(`${t}:ListRowPoolForReact`);this.rowDebugId=t}createRowInstance(){return new cc(this.rowDebugId)}};function Hm(o){return{cellPool:new Na(o),rowPool:new ka(o)}}function ni(o){let e=o.isHorizontalLayoutBrain?new Oa(o,`${o.name}:HorizontalLayoutTableRenderer`,Hm(`${o.name}:HorizontalLayoutTableRenderer`)):new cr(o,`${o.name}:ReactHeadlessTableRenderer`,Hm(`${o.name}:ReactHeadlessTableRenderer`)),t=Ce();return o.onDestroy(()=>{e.destroy(),t.destroy()}),{renderer:e,onRenderUpdater:t}}function jC(o){let{brain:e,renderCell:t,renderDetailRow:n,forceRerenderTimestamp:r}=o,{renderer:i,onRenderUpdater:a}=(0,bn.useMemo)(()=>o.onRenderUpdater&&o.renderer?{renderer:o.renderer,onRenderUpdater:o.onRenderUpdater}:ni(e),[e,o.onRenderUpdater,o.renderer]);return(0,bn.useLayoutEffect)(()=>{i.cellHoverClassNames=o.cellHoverClassNames||[]},[i,o.cellHoverClassNames]),(0,bn.useLayoutEffect)(()=>{i.cellDetachedClassNames=o.cellDetachedClassNames||[]},[i,o.cellDetachedClassNames]),(0,bn.useLayoutEffect)(()=>{let l=e.getRenderRange();return i.renderRange(l,{onRender:a,force:!0,renderCell:t,renderDetailRow:n}),e.onRenderRangeChange(c=>{i.renderRange(c,{force:!1,onRender:u=>{let d=a.get();d&&u&&d.length===u.length||a(u)},renderCell:t,renderDetailRow:n})})},[i,e,t,n,a,r]),(0,bn.useLayoutEffect)(()=>{i.flushPendingAfterCommitWork()}),za.createElement(jo,{updater:a})}var Va=za.memo(jC);var ri=H(require("react")),Tn=require("react");var Km=Se({defaultClassName:"nxbq1c1 _16lm1iwz _16lm1iw2",variantClassNames:{visible:{true:"nxbq1c3",false:"nxbq1c4"}},defaultVariants:{},compoundVariants:[]}),Ga="nxbq1c0 _16lm1iwz _16lm1iw4 _16lm1iw26 _16lm1iw23 _16lm1iw1y _16lm1iw1k";var Bm=Se({defaultClassName:"j26lrx0 _16lm1iwz _16lm1iw2 _16lm1iw23 _16lm1iw26",variantClassNames:{active:{true:"j26lrx2",false:"j26lrx3"}},defaultVariants:{},compoundVariants:[]});function Wm(o,e){let t=e-o.getScrollOriginPageIndex();return t?`calc(${he.runtime.totalVisibleColumnsWidthVar} * ${t})`:null}function jm(o,e){let t="0px",n=e;o.isHorizontalLayoutBrain&&o.rowsPerPage&&(t=Wm(o,o.getPageIndexForRow(n))??"0px",n=n%o.rowsPerPage);let r=o.getRowHeight(n),i=o.getItemOffsetFor(n,"vertical")-o.getScrollOrigin().scrollTop;return{activeCellRowHeight:`${r}px`,activeCellRowOffset:`${i}px`,activeCellRowOffsetX:t}}function Um(o,e){let{scrollTop:t,scrollLeft:n}=o.getDOMScrollPosition(e);return{scrollTopForActiveRow:`${-t}px`,scrollLeftForActiveRowWhenHorizontalLayout:o.isHorizontalLayoutBrain?`${-n}px`:"0px"}}function $m(o,e,t){let[n]=e,r=e[1],i;if(o.isHorizontalLayoutBrain&&o.rowsPerPage){let c=ve.columnOffsets.get(r),u=Wm(o,o.getPageIndexForRow(n));i=u?`calc( ${u} + ${c})`:c,n=n%o.rowsPerPage}let a=typeof t=="function"?t(n):t??o.getRowHeight(n),l=o.getItemOffsetFor(n,"vertical")-o.getScrollOrigin().scrollTop,s={activeCellRowHeight:`${a}px`,activeCellRowOffset:`${l}px`};return i!==void 0&&(s.activeCellColOffset=i),s}var{rootClassName:UC}=ze,$C=`${UC}-ActiveRowIndicator`,YC=`calc(${J.activeCellRowOffsetX} + var(${Q(J.scrollLeftForActiveRowWhenHorizontalLayout)}, 0px))`,qC={[Q(J.activeCellOffsetY)]:J.activeCellRowOffset,transform:`translate3d(${YC}, calc( ${J.activeCellOffsetY} + var(${Q(J.scrollTopForActiveRow)}, 0px)), 0px)`,height:J.activeCellRowHeight,maxWidth:he.runtime.totalVisibleColumnsWidthVar},XC=o=>{let{brain:e}=o,t=(0,Tn.useRef)(null),n=o.activeRowIndex!=null&&e.getInitialRows()>o.activeRowIndex,[r,i]=qt(),a=(0,Tn.useRef)(o.activeRowIndex);a.current=o.activeRowIndex;let l=()=>{let s=a.current;s==null||!t.current||Yn(jm(e,s),t.current)};return(0,Tn.useLayoutEffect)(l,[o.activeRowIndex,e]),(0,Tn.useEffect)(()=>{let s=p=>{Yn(Um(e,p),t.current)};s(e.getScrollPosition());let c=e.onScroll(s),u=e.onRenderCountChange(i),d=e.onScrollOriginChange(l);return()=>{d(),u(),c()}},[e]),ri.createElement("div",{className:Ga,"data-name":"active-row"},ri.createElement("div",{ref:t,"data-name":"active-row-indicator",className:`${$C} ${Bm({active:n})}`,style:n?qC:void 0}))},Ym=ri.memo(XC);var ii=H(require("react")),Cn=require("react");var{rootClassName:ZC}=ze,QC=`${ZC}-ActiveCellIndicator`,JC=Q(J.columnZIndexAtIndex),qm=(o,e,t,n)=>{e!=null&&Yn($m(o,e,t),n.current)},eR=o=>{let{brain:e}=o,[t,n]=qt(),r=(0,Cn.useRef)(null),i=o.activeCellIndex!=null&&e.getInitialRows()>o.activeCellIndex[0];(0,Cn.useLayoutEffect)(()=>{qm(e,o.activeCellIndex,o.rowHeight,r)},[o.activeCellIndex,o.rowHeight,e]);let a=(0,Cn.useRef)(o);return a.current=o,(0,Cn.useEffect)(()=>{let l=e.onRenderCountChange(()=>{n()}),s=e.onScrollOriginChange(()=>{let{activeCellIndex:c,rowHeight:u}=a.current;qm(e,c,u,r)});return()=>{l(),s()}},[e]),ii.createElement("div",{className:Ga,ref:r,"data-name":"active-cell",style:i?{zIndex:`var(${JC}-${o.activeCellIndex[1]})`}:void 0},ii.createElement("div",{"data-name":"active-cell-indicator",className:`${QC} ${Km({visible:i})}`}))},Xm=ii.memo(eR);var Ha=[lf,`${St}DetachedCell`];function Ka(o,e,t){t&&(t.fixedColsStart||t.fixedColsEnd||t.fixedRowsStart||t.fixedRowsEnd)&&o.updateFixedCells({fixedColsStart:t.fixedColsStart,fixedColsEnd:t.fixedColsEnd,fixedRowsStart:t.fixedRowsStart,fixedRowsEnd:t.fixedRowsEnd}),o.update({height:e.height,width:e.width,cols:e.cols,rows:e.rows,colWidth:e.colWidth,rowHeight:e.rowHeight,rowspan:e.rowspan,colspan:e.colspan})}var tR=X(bm,tc);function Zm(o){let{brain:e,scrollerDOMRef:t,scrollStopDelay:n,renderCell:r,renderDetailRow:i,activeCellRowHeight:a,cellHoverClassNames:l,renderer:s,activeRowIndex:c,activeCellIndex:u,onRenderUpdater:d,wrapRowsHorizontally:p,forceRerenderTimestamp:f,scrollVarHostRef:m,...g}=o,{autoFocus:h}=g,S=(0,Dt.useRef)(null),[y,T]=(0,Dt.useState)({width:0,height:0});(0,Dt.useEffect)(()=>{n!=null&&e.setScrollStopDelay(n)},[n,e]),(0,Dt.useEffect)(()=>{let I=S.current?.parentNode;return I?(h&&document.activeElement!==I&&I.focus(),Nn(I,()=>{let P={height:I.clientHeight,width:I.clientWidth};e.update(P)},{debounce:50})):void 0},[p,e]);let b=(0,Dt.useCallback)(I=>{let w=e.getDOMScrollPosition(I);requestAnimationFrame(()=>{S.current&&S.current.style.setProperty("transform",`translate3d(${-w.scrollLeft}px, ${-w.scrollTop}px, 0px)`)})},[e]),R=(0,Dt.useCallback)(I=>{e.setScrollPosition(e.toContentScrollPosition(I),b)},[e,b]);(0,Dt.useEffect)(()=>{let I=e.onRenderCountChange(()=>{T(e.getNativeScrollSize())});return T(e.getNativeScrollSize()),b(e.getScrollPosition()||{scrollLeft:0,scrollTop:0}),I},[e]);let C=(0,Dt.useRef)({brain:e,vertical:1,horizontal:1});return(0,Dt.useLayoutEffect)(()=>{let I=C.current,w=e.getScrollRatio("vertical"),v=e.getScrollRatio("horizontal");C.current={brain:e,vertical:w,horizontal:v};let P=S.current?.parentElement;if(!P||I.brain!==e||I.vertical===w&&I.horizontal===v)return;let E=e.toNativeScrollPosition(e.getScrollPosition());I.vertical!==w&&(P.scrollTop=E.scrollTop),I.horizontal!==v&&(P.scrollLeft=E.scrollLeft)},[y,e]),Rn.createElement(xm,{onContainerScroll:R,...g,ref:t},Rn.createElement("div",{ref:S,className:tR,"data-name":"scroll-transform-target"},Rn.createElement(Va,{forceRerenderTimestamp:f,renderer:s,onRenderUpdater:d,renderCell:r,renderDetailRow:i,brain:e,cellHoverClassNames:l,cellDetachedClassNames:Ha}),u!=null?Rn.createElement(Xm,{brain:e,rowHeight:a,activeCellIndex:u}):null),c!=null?Rn.createElement(Ym,{brain:e,activeRowIndex:c}):null,Rn.createElement(Sm,{width:y.width,height:y.height}))}function Qm(o,e,t,n){let r=new Map,i=new Map,a=new Map;o.forEach((u,d)=>{let p=u.id,f=o[d-1],m=f?.id??"",g=new Set,h=f?.computedPinned!==u.computedPinned?new Set:a.get(m)??new Set;a.set(p,g);let S={type:"column",id:p,ref:u,groupOffset:0,computedPinned:u.computedPinned,computedWidth:u.computedWidth,depth:u.columnGroup?(t.get(u.columnGroup)??0)+1:0};r.set([p],S);let y=u.columnGroup,T,b=S;for(;y;){let R=e[y];if(R){g.add(y);let C=[p,...g];T=h.has(y)?i.get(y):void 0,T||(T={id:y,type:"group",ref:R,columnItems:[],children:[],groupOffset:0,uniqueGroupId:[y],computedWidth:0,computedPinned:S.computedPinned,depth:t.get(y)??0},r.set(C,T),i.set(y,T)),T.columnItems.push(S),T.uniqueGroupId.push(S.id),b&&!h.has(b.id)&&T.children.push(b),b=T,y=R.columnGroup}else break}});let l=[],s=new q,c=0;return r.forEach(u=>{if(!u.ref.columnGroup){let d=u.type==="column"?u.ref.computedWidth:u.columnItems.reduce((p,f)=>p+f.ref.computedWidth,0);u.groupOffset=c,u.computedWidth=d,u.type==="group"&&Jm(u.children),l.push(u),c+=d}if(u.type==="group")u.columnItems.forEach(d=>{s.set([u.depth,d.ref.computedVisibleIndex],u)});else for(let d=u.depth;d<=n+1;d++)s.set([d,u.ref.computedVisibleIndex],u)}),r.clear(),i.clear(),{tree:l,pathsToCells:s}}function Jm(o,e=0){o.forEach(t=>{let n=t.type==="column"?t.ref.computedWidth:t.columnItems.reduce((r,i)=>r+i.ref.computedWidth,0);t.computedWidth=n,t.groupOffset=e,t.type==="group"&&Jm(t.children),e+=n})}var $o=H(require("react")),yo=require("react");var dc=H(require("react"));var tg=H(require("react")),uc=require("react");var ai=require("react"),li=H(require("react"));var{rootClassName:oR}=ze,nR=`${oR}HeaderCell_ResizeHandle`;function rR(o){let e=(0,ai.useRef)(null),[t,n]=(0,ai.useState)(!1),r=(0,ai.useRef)(t);r.current=t;let i=o.groupColumns[0];if(!i)return null;let a=i.computedPinned,l=i.computedFirstInCategory,s=i.computedLastInCategory,c=d=>{d.stopPropagation();let p=d.pointerId,f=d.clientX,m=d.target;m.setPointerCapture(p);let g=!0,h=$f(o.groupColumns.map(b=>b.computedVisibleIndex),{columns:o.columns,domRef:e}),S=b=>{a==="end"&&(b*=-1);let{constrained:R,adjustedDiffs:C,adjustedDiff:I}=o.computeResize(b);return r.current!==R&&n(R),h.resize(C),I},y=b=>{if(g){let R=o.groupColumns.reduce((w,v)=>w+v.computedWidth-v.computedMinWidth,0),C=o.brain.getAvailableSize(),I={width:C.width+R,height:C.height};o.brain.update(I),g=!1}S(Math.round(b.clientX-f))},T=b=>{m.releasePointerCapture(p),m.removeEventListener("pointermove",y),m.removeEventListener("pointerup",T);let R=Math.round(b.clientX-f),C=S(R);h.resize(o.groupColumns.map(()=>0)),o.onResize(C)};m.addEventListener("pointermove",y),m.addEventListener("pointerup",T)},u=(a===!1||a==="start")&&s?{right:a==="start"?void 0:he.components.HeaderCell.resizeHandleWidth}:a==="end"&&l?{right:void 0}:void 0;return li.createElement("div",{ref:e,className:`${nR} ${Ca} ${Ia({computedPinned:a,computedFirstInCategory:l,computedLastInCategory:s})}`,onPointerDown:c},li.createElement("div",{style:{...u,...o.style},className:Ra({constrained:t})}))}var eg=li.memo(rR);function og(o,e){let{bodyBrain:t,groupHeight:n,columnGroup:r,columnGroupsMaxDepth:i}=e,{computedVisibleColumns:a,getState:l,getComputed:s,actions:c}=oe(g=>({computedVisibleColumns:g.computed.computedVisibleColumns,getState:g.getState,getComputed:g.getComputed,actions:g.actions})),u=o[o.length-1],d=(0,uc.useCallback)(g=>{let h=l(),{columnSizing:S,viewportReservedWidth:y,bodySize:T}=h,b=s().computedVisibleColumns,R=!1,C=b.reduce((v,P)=>(P.computedFlex&&(v[P.id]={...S[P.id],flex:P.computedWidth},R=!0),v),{}),I=R?{...S,...C}:S;return Xd({availableSize:Ys(T),reservedWidth:y||0,dragHandleOffset:g,dragHandlePositionAfter:u.computedVisibleIndex,columnSizing:I,columnGroupSize:o.length,items:b.map(v=>({id:v.id,resizable:v.computedResizable,computedFlex:v.computedFlex,computedWidth:v.computedWidth,computedMinWidth:v.computedMinWidth,computedMaxWidth:v.computedMaxWidth}))})},[u]),p=(0,uc.useCallback)(g=>{let{columnSizing:h,reservedWidth:S}=d(g);c.viewportReservedWidth=S,c.columnSizing=h},[d]);return o.some(g=>g.computedResizable)?tg.createElement(eg,{brain:t,style:{height:n*(i-r.depth+2)},columns:a,groupColumns:o,computeResize:d,onResize:p}):null}var ng=`${St}HeaderGroup`,rg=Q(J.columnWidthAtIndex),iR=Q(J.columnZIndexAtIndex);function ig(o){let{columnGroup:e,height:t,columns:n,bodyBrain:r,columnGroupsMaxDepth:i}=o,{header:a,style:l}=e;a instanceof Function&&(a=a({columnGroup:e,horizontalLayoutPageIndex:o.horizontalLayoutPageIndex}));let s=og(n,{bodyBrain:r,groupHeight:t,columnGroup:e,columnGroupsMaxDepth:i}),c=n[0],u=n.length>1?"calc( "+n.map(f=>`var(${rg}-${f.computedVisibleIndex})`).join(" + ")+" )":`var(${rg}-${c.computedVisibleIndex})`,d=`calc(var(${iR}-${c.computedVisibleIndex}) + ${i-e.depth})`,p=typeof l=="function"?l({columnGroup:e,horizontalLayoutPageIndex:o.horizontalLayoutPageIndex}):l;return p=p&&typeof p=="object"?p:{},p.width=u,p.height=t,dc.createElement("div",{ref:o.domRef,"data-group-id":e.uniqueGroupId,className:X(Vd,ng),style:p,"data-z-index":d},dc.createElement("div",{className:X(`${ng}__header-content`,Ht)},a),s)}var ag=require("react");var mc=H(require("react")),pc;function gc(){return pc||(pc=mc.createContext({dataSourceApi:null,getDataSourceState:()=>null,assignState:()=>null,getDataSourceMasterContext:()=>{},dataSourceState:null,dataSourceActions:null}))}var fc;function Ba(){return fc||(fc=mc.createContext(null))}function Ne(o){let e=Ba(),t=(0,ag.useContext)(e);return Ln(t,o)}function no(){return Ne(o=>({getDataSourceState:o.getDataSourceState,getDataSourceMasterContext:o.getDataSourceMasterContext,dataSourceActions:o.dataSourceActions,dataSourceApi:o.dataSourceApi,assignState:o.assignState}))}var{rootClassName:aR}=ze,lR=[],lg=`${aR}Header`,sR=Fd({overflow:!1}),sg=()=>{};function cR(o){let{bodyBrain:e,headerBrain:t,columns:n,style:r,className:i,columnHeaderHeight:a,columnAndGroupTreeInfo:l,columnGroupsMaxDepth:s}=o,{getState:c,headerOptions:u,headerRenderer:d,headerOnRenderUpdater:p,showColumnFilters:f,computedColumnsMap:m}=oe(D=>({computedColumnsMap:D.computed.computedColumnsMap,getState:D.getState,headerOptions:D.state.headerOptions,headerRenderer:D.state.headerRenderer,headerOnRenderUpdater:D.state.headerOnRenderUpdater,showColumnFilters:D.state.showColumnFilters})),g=(0,yo.useRef)(null),h=(0,yo.useCallback)(D=>{if(g.current){let{scrollLeft:x}=t.getDOMScrollPosition(D);g.current.style.transform=`translate3d(${-x}px, 0px, 0px)`}},[t]);(0,yo.useEffect)(()=>{let D=t.onScroll(h);return h(t.getScrollPosition()||{scrollLeft:0,scrollTop:0}),D},[t]);let S={ref:g,className:X(lg,`${lg}--virtualized`,i,sR),style:{...r,height:a}},{getDataSourceState:y,dataSourceApi:T,dataSourceActions:b}=no(),{allRowsSelected:R,someRowsSelected:C,selectionMode:I,filterTypes:w,filterDelay:v}=Ne(D=>({allRowsSelected:D.dataSourceState.allRowsSelected,someRowsSelected:D.dataSourceState.someRowsSelected,selectionMode:D.dataSourceState.selectionMode,filterTypes:D.dataSourceState.filterTypes,filterDelay:D.dataSourceState.filterDelay})),P=(0,yo.useMemo)(()=>({allRowsSelected:R,someRowsSelected:C,selectionMode:I}),[R,C,I]),E=(0,yo.useCallback)(D=>{let{rowIndex:x,colIndex:A,domRef:O,height:F,widthWithColspan:z,heightWithRowspan:L,hidden:B}=D,Y=n[A];if(!Y||B)return null;let V=t.isHorizontalLayoutBrain?t.getPageIndexForRow(x):null,W=l?l.pathsToCells.get([x,A]):null;if(W&&W.type==="group"){let N=W.columnItems.map(re=>re.ref),K={...W.ref,id:W.id,uniqueGroupId:W.uniqueGroupId,depth:W.depth,columns:N.map(re=>re.id),computedWidth:W.computedWidth,groupOffset:W.groupOffset};return c().columnGroupVisibility[W.id]!==!1?$o.createElement(ig,{horizontalLayoutPageIndex:V,bodyBrain:e,columnGroupsMaxDepth:s,domRef:O,columns:N,width:z,height:F,columnGroup:K}):null}return $o.createElement(ug,{domRef:O,column:Y,horizontalLayoutPageIndex:V,headerOptions:u,dataSourceStatePartialForHeaderCell:P,filterTypes:w,filterDelay:v,getDataSourceState:y,dataSourceApi:T,dataSourceActions:b,width:z,height:L,columnsMap:m})},[u,n,a,l,s,f,t,y,T,b,w,v,P]),M=cn(oa);return $o.createElement(Wo,{orientation:"horizontal",dragListId:M,dragStrategy:"inline",onDrop:sg,updatePosition:sg},D=>$o.createElement("div",{...D,...S,className:X(D.className,S.className)},$o.createElement(Va,{name:"header",renderCell:E,brain:t,renderer:d,onRenderUpdater:p,cellHoverClassNames:lR,cellDetachedClassNames:Ha})))}var cg=$o.memo(cR);function dg(o){let{headerBrain:e,bodyBrain:t,scrollbars:n}=o,{computedPinnedStartColumns:r,computedPinnedEndColumns:i,computedVisibleColumns:a,columnSize:l}=oe(C=>({computedPinnedStartColumns:C.computed.computedPinnedStartColumns,computedPinnedEndColumns:C.computed.computedPinnedEndColumns,computedVisibleColumns:C.computed.computedVisibleColumns,columnSize:C.computed.columnSize})),{columnHeaderHeight:s,columnGroupsDepthsMap:c,columnGroupsMaxDepth:u,computedColumnGroups:d,showColumnFilters:p}=oe(C=>({columnHeaderHeight:C.state.columnHeaderHeight,columnGroupsDepthsMap:C.state.columnGroupsDepthsMap,columnGroupsMaxDepth:C.state.columnGroupsMaxDepth,computedColumnGroups:C.state.computedColumnGroups,showColumnFilters:C.state.showColumnFilters})),f=!d||!Object.keys(d).length?1:u+2,m=f*s+(p?s:0),g=Wt.useMemo(()=>{if(!(!d||!Object.keys(d).length))return Qm(a,d,c,u)},[a,d,c]),h=Wt.useCallback(({rowIndex:C,colIndex:I})=>{let w=a[I],v=1,P=1;if(!w||!g)return{rowspan:v,colspan:P};let E=g.pathsToCells.get([C,I]);if(!E)return{rowspan:v,colspan:P};if(E.type==="column")return{colspan:P,rowspan:f-E.depth};let M=E.columnItems.findIndex(D=>D.id===w.id);return{rowspan:v,colspan:M===0?E.columnItems.length:1}},[d,u,a,g,f,c]),S=Wt.useCallback(({rowIndex:C,colIndex:I})=>h({rowIndex:C,colIndex:I}).rowspan,[h]),y=Wt.useCallback(({rowIndex:C,colIndex:I})=>h({rowIndex:C,colIndex:I}).colspan,[h]),T=Wt.useCallback(C=>p?C<f-1?s:2*s:s,[f,p,s]);Ka(e,{colWidth:l,rowHeight:T,rows:f,cols:a.length,height:m,rowspan:S,colspan:y},{fixedColsEnd:i.length,fixedColsStart:r.length});let b=Wt.createElement(cg,{columns:a,headerBrain:e,bodyBrain:t,columnHeaderHeight:m,columnGroupsMaxDepth:u,columnAndGroupTreeInfo:g}),R=n.vertical&&Xt()?Wt.createElement("div",{className:Hd,style:{zIndex:1e3,width:Xt()}}):null;return Wt.createElement("div",{className:`${zs} ${jd}`,style:{height:m}},b,R)}var{ManagedComponentContextProvider:uR}=kt({initSetupState:gm,forwardProps:hm,Context:ec()});function hc(o){let{getComputed:e,header:t,brain:n,headerBrain:r,wrapRowsHorizontally:i}=oe(l=>({getComputed:l.getComputed,header:l.state.header,brain:l.state.brain,headerBrain:l.state.headerBrain,wrapRowsHorizontally:l.state.wrapRowsHorizontally})),{scrollbars:a}=e();return t?si.createElement(uR,{...o},si.createElement(dg,{wrapRowsHorizontally:!!i,bodyBrain:n,headerBrain:r,scrollbars:a})):null}function pg(){return si.useContext(ec()).componentState}var dR=o=>{let{allRowsSelected:e,someRowsSelected:t,api:n,dataSourceApi:r}=o,i=e?!0:t?null:!1,{components:a,isTree:l}=n.getState(),s=a?.CheckBox||zo;return _e.createElement(s,{domProps:{className:Jn},onChange:c=>{if(l){c?r.treeApi.selectAll():r.treeApi.deselectAll();return}c?n.rowSelectionApi.selectAll():n.rowSelectionApi.deselectAll()},checked:i})},Sa=_e.createContext(null);var pR=Q(J.columnZIndexAtIndex),fR=Q(J.columnVisibilityAtIndex),yc=_e.createElement("div",{className:Li[1]}),mg=zi({"data-name":"","data-field":"","data-header-align":"","data-column-id":"","data-sort":"","data-sort-index":"",[Tt]:"",[lr]:""});function mR(o){let e=o.column,{allowColumnHideWhileDragging:t}=pg(),{dataSourceStatePartialForHeaderCell:n,horizontalLayoutPageIndex:r,getDataSourceState:i,dataSourceApi:a,dataSourceActions:l,filterTypes:s,filterDelay:c}=o,{allRowsSelected:u,someRowsSelected:d,selectionMode:p}=n,{onDragItemPointerDown:f,dragListId:m}=hn(),{api:g,getComputed:h,getState:S,actions:y,getDataSourceMasterContext:T,showColumnFilters:b,components:R,portalDOMRef:C,columnHeaderHeight:I,columnReorderDragColumnId:w,columnMenuVisibleForColumnId:v,columnReorderInPageIndex:P}=oe($=>({api:$.api,getComputed:$.getComputed,getState:$.getState,actions:$.actions,getDataSourceMasterContext:$.getDataSourceMasterContext,showColumnFilters:$.state.showColumnFilters,components:$.state.components,portalDOMRef:$.state.portalDOMRef,columnHeaderHeight:$.state.columnHeaderHeight,columnReorderDragColumnId:$.state.columnReorderDragColumnId,columnMenuVisibleForColumnId:$.state.columnMenuVisibleForColumnId,columnReorderInPageIndex:$.state.columnReorderInPageIndex})),E=w===e.id,M=P!=null?r!==P:!1,{onResize:D,height:x,width:A,headerOptions:O,columnsMap:F}=o,z=e.computedSortInfo,L=e.header,B=(0,So.useCallback)($=>{ge.current=$,o.domRef?.($)},[o.domRef]),Y=O.alwaysReserveSpaceForSortIcon,V=e.headerAlign??e.align,W=(typeof V=="function"?V({isHeader:!0,column:e}):V)??"start",N=(typeof e.verticalAlign=="function"?e.verticalAlign({isHeader:!0,column:e}):e.verticalAlign)??"center",K=bt(e,{actions:y,api:g,dataSourceActions:l,dataSourceApi:a,getComputed:h,getDataSourceState:i,getDataSourceMasterContext:T,getState:S}),ae=K.isSortable(),re=ae&&(e.computedSorted||Y)?_e.createElement(Ta,{index:e.computedMultiSort?e.computedSortIndex+1:void 0,style:{marginInlineStart:he.spacing[2],marginInlineEnd:he.spacing[2]},className:`${un}__sort-icon ${Kd} ${Wd({align:W})}`,direction:e.computedSorted?e.computedSortedAsc?1:-1:0}):null,fe=e.computedFilterable&&e.computedFiltered?_e.createElement(Bn,null):null,be=e.headerCssEllipsis??e.cssEllipsis??!0,de={reserveSpaceWhenHidden:W==="center",menuVisible:v===e.id,style:W==="end"?{marginInlineStart:`calc(${he.components.HeaderCell.resizeHandleActiveAreaWidth} / 2)`,marginInlineEnd:he.spacing[2]}:{marginInlineEnd:`calc(${he.components.HeaderCell.resizeHandleActiveAreaWidth} / 2)`,marginInlineStart:he.spacing[2]},domProps:{onMouseDown:$=>{$.stopPropagation(),K.toggleContextMenu($.target)}}},U=e.components?.MenuIcon||R?.MenuIcon||Zr,ie=_e.createElement(U,{...de}),ge=(0,So.useRef)(null),Z={horizontalLayoutPageIndex:r,dragging:E,domRef:B,htmlElementRef:ge,renderLocation:"column-header",column:e,columnsMap:F,columnSortInfo:z,columnFilterValue:e.computedFilterValue,filtered:e.computedFiltered,someRowsSelected:d,allRowsSelected:u,selectionMode:p,api:g,dataSourceApi:a,columnApi:K,renderBag:{sortIcon:re,filterIcon:fe,menuIcon:ie,menuIconProps:de,selectionCheckBox:null,header:e.header&&typeof e.header!="function"?e.header:e.name}},ee=Z,j=ee.renderBag.header,se=()=>{let $={...Z,renderBag:{...Z.renderBag}};if(e.renderSortIcon&&($.renderBag.sortIcon=_e.createElement(Ko,{render:e.renderSortIcon,renderParam:{...$,renderBag:{...$.renderBag}}})),e.renderFilterIcon&&($.renderBag.filterIcon=_e.createElement(Ko,{render:e.renderFilterIcon,renderParam:{...$,renderBag:{...$.renderBag}}})),typeof e.renderMenuIcon=="function"&&($.renderBag.menuIcon=_e.createElement(Ko,{render:Ze=>{if(typeof e.renderMenuIcon!="function")return null;let Rt=e.renderMenuIcon(Ze);return Rt?Rt.type===U||Rt.type===Zr?Rt:_e.createElement(U,{...de},Rt):null},renderParam:{...$,renderBag:{...$.renderBag}}})),e.renderSelectionCheckBox&&p==="multi-row"){$.renderBag.selectionCheckBox=_e.createElement(Ko,{render:dR,renderParam:{...$,renderBag:{...$.renderBag}}});let Ze=e.renderHeaderSelectionCheckBox??e.renderSelectionCheckBox;Ze&&Ze!==!0&&($.renderBag.selectionCheckBox=_e.createElement(Ko,{render:Ze,renderParam:{...$,renderBag:{...$.renderBag}}}))}L instanceof Function&&($.renderBag.header=j=_e.createElement(Ko,{render:L,renderParam:{...$,renderBag:{...$.renderBag}}}));let tt=e.renderMenuIcon===!1?null:$.renderBag.menuIcon,ce=be?_e.createElement("div",{className:Ht},$.renderBag.header):$.renderBag.header,Ae=_e.createElement(_e.Fragment,null,W==="center"?yc:null,$.renderBag.selectionCheckBox,ce,$.renderBag.sortIcon,$.renderBag.filterIcon,W==="center"?yc:null,W!=="center"?yc:null,tt);return e.renderHeader?_e.createElement(Ko,{render:e.renderHeader,renderParam:{...$,renderBag:{...$.renderBag,all:Ae}}}):Ae};(0,So.useEffect)(()=>{let $=null,tt=ge.current;return D&&tt&&($=Nn(tt,D)),()=>{$?.()}},[ge.current,o.onResize]);let ne={height:x};e.headerStyle&&(ne=typeof e.headerStyle=="function"?{...ne,...e.headerStyle(ee)||{}}:{...ne,...e.headerStyle});let pe=typeof e.headerClassName=="function"?e.headerClassName(ee):e.headerClassName,{onPointerDown:k,proxyPosition:_,dragColumnOutside:me}=Qp({columnId:e.id,domRef:ge,horizontalLayoutPageIndex:r,allowColumnHideOnDrag:t}),Te=null,Pe=Sa.Provider,Re={filtered:e.computedFiltered,verticalAlign:N,align:W},Me=_e.useMemo(()=>{let $=tt=>{g.setColumnFilter(e.id,tt)};return c>0?Nt($,{wait:c}):$},[c,e.id]),qe=e.computedFilterType,We=s[qe],it=e.computedFilterable?e.computedFilterValue?.filter.operator??We?.defaultOperator:void 0,at=e.computedFilterable&&We?We.operators.find($=>$.name===it):void 0,et=at?.components?.FilterEditor||We?.components?.FilterEditor||e.components?.FilterEditor||$n,Xe=We?.components?.FilterOperatorSwitch||e.components?.FilterOperatorSwitch,G=Xf(e,{horizontalLayoutPageIndex:r}),te=`var(${pR}-${e.computedVisibleIndex})`;ne.zIndex=te,ne.visibility=`var(${fR}-${e.computedVisibleIndex}, visible)`;let ye={"data-field":`${e.field||""}`,"data-column-id":e.id,[Tt]:e.id,[lr]:m,"data-header-align":W,"data-name":"HeaderCell","data-sort":e.computedSortedAsc?"asc":e.computedSortedDesc?"desc":"none","data-sort-index":`${e.computedSortIndex??-1}`},Ie=e.computedFilterable?_e.createElement(lp,{horizontalLayoutPageIndex:r,filterEditor:et,filterOperatorSwitch:Xe??sp,operator:at,filterTypes:s,onChange:Me,columnFilterType:qe,columnLabel:e.field||e.name||e.id,columnFilterValue:e.computedFilterValue,columnHeaderHeight:I}):_e.createElement(cp,null);ee.renderBag.filterEditor=Ie;let ut=(0,So.useCallback)($=>{k($),f($)},[k,f]),le=se();return E&&_&&(Te=_e.createElement("div",{key:e.id,className:`${un}Proxy ${Ad}`,style:{height:x,width:A,left:_.left??0,top:_.top??0}},_e.createElement("div",{className:_d({visible:me})},_e.createElement(mm,{size:16})),j),Te=(0,fg.createPortal)(Te,C.current)),_e.createElement(Pe,{value:ee},_e.createElement(ha,{domRef:B,horizontalLayoutPageIndex:o.horizontalLayoutPageIndex,cellType:"header",column:e,...ye,"data-z-index":te,style:ne,width:A,onPointerDown:ut,contentClassName:X(Md(Re),rd[W]),contentStyle:b?{height:x/2}:void 0,className:X(un,cd.none,ae?od.pointer:"",pe,Yi(e,[un,mo],Od,{dragging:E,insideDisabledDraggingPage:M,align:W,verticalAlign:N,rowSelected:!1,cellSelected:!1,rowDisabled:!1,zebra:!1,rowActive:!1,firstRow:!0,firstRowInHorizontalLayoutPage:!0,treeNode:!1,groupCell:!1,groupRow:!1,rowExpanded:!1}),Ed),cssEllipsis:be,afterChildren:_e.createElement(_e.Fragment,null,b?Ie:null,G),renderChildren:le}),Te)}var ug=_e.memo(mR);function Lr(){return(0,So.useContext)(Sa)}var bo=H(require("react")),Rg=require("react");function gg(o,e){let{separator:t}=e??{separator:"-"};return o.replace(/([a-z\d])([A-Z])/g,"$1"+t+"$2").replace(new RegExp("("+t+"[A-Z])([A-Z])","g"),"$1"+t+"$2").toLowerCase()}var yg="https://infinite-table.com",Sg="Invalid Infinite Table license. See console for details.",bg={padding:he.spacing[2],textAlign:"end",opacity:"1",visibility:"visible",display:"block",fontSize:"0.85rem"},gR={...bg,background:"white",color:"black"},hR={...bg,background:"#fee2e2",color:"#991b1b"},Tg={opacity:"1",visibility:"visible",display:"inline-block",pointerEvents:"all",textDecoration:"underline"},yR={...Tg,color:"black"},SR={...Tg,color:"#991b1b"};function Sc(o){return o?{footer:hR,anchor:SR}:{footer:gR,anchor:yR}}var hg=(o,e)=>{if(o)for(let[t,n]of Object.entries(e))o.style.setProperty(gg(t),n,"important")};function Cg(o,e){let t=Sc(e),n=()=>{setTimeout(()=>{let i=o();hg(i,t.footer),hg(i?.querySelector("a")??null,t.anchor)})};n();let r=setInterval(n,1e3);return()=>{clearInterval(r)}}var Ig=bo.forwardRef(function(e,t){let{invalid:n=!1,...r}=e,{rootClassName:i}=Ni(),a=bo.useRef(null),l=bo.useCallback(c=>{a.current=c,t&&(typeof t=="function"?t(c):t.current=c)},[]);(0,Rg.useEffect)(()=>Cg(()=>a.current,n),[n]);let s=Sc(n);return bo.createElement("div",{ref:l,...r,className:X(`${i}-Footer`,n?`${i}-Footer--invalid`:null,yp,r.className),style:s.footer},n?`${Sg} `:null,"Powered by"," ",bo.createElement("a",{href:yg,rel:"noopener noreferrer",role:"link",target:"_blank",style:s.anchor},"Infinite Table"))});var Wa=class{constructor(e){let t=e instanceof Object.getPrototypeOf(this).constructor?e.getState():e,n=this.getPositiveFromState(t),r=this.getNegativeFromState(t);this.update({negativeItems:r,positiveItems:n})}getInitialState(){return this.initialState}destroy(){this.positiveMap?.clear(),this.negativeMap?.clear(),delete this.positiveMap,delete this.negativeMap}update(e){let{positiveItems:t,negativeItems:n}=e;if(this.allNegative=n===!0,this.allPositive=t===!0,this.allNegative&&this.allPositive)throw"Cannot have both negativeItems and positiveItems be true!";n!==!0&&(this.negativeMap?(this.negativeMap.clear(),this.negativeMap.fill(n.map(r=>[r,!0]))):this.negativeMap=new q(n.map(r=>[r,!0])),this.positiveMap&&this.positiveMap.clear()),t!==!0&&(this.positiveMap?(this.positiveMap.clear(),this.positiveMap.fill(t.map(r=>[r,!0]))):this.positiveMap=new q(t.map(r=>[r,!0])),this.negativeMap&&this.negativeMap.clear())}areAllNegative(){return this.allNegative&&(this.positiveMap?this.positiveMap.size===0:!0)}areAllPositive(){return this.allPositive&&(this.negativeMap?this.negativeMap.size===0:!0)}makeAllNegative(){this.update({negativeItems:!0,positiveItems:[]})}makeAllPositive(){this.update({positiveItems:!0,negativeItems:[]})}isItemPositive(e){if(this.allPositive===!0){if(this.allNegative===!0)throw'Cannot have both positiveItems and negativeItems be "true"';return!this.negativeMap?.has(e)}return this.positiveMap?.has(e)}isItemNegative(e){return!this.isItemPositive(e)}setItemValue(e,t){if(t!==this.isItemPositive(e)){if(t){if(this.allNegative===!0){if(!this.positiveMap)throw`No positiveMap found when trying to set item ${e.join(",")} be positive`;this.positiveMap.set(e,!0)}else if(this.allPositive===!0){if(!this.negativeMap)throw`No negativeMap found when trying to set item ${e.join(",")} be positive`;this.negativeMap.delete(e)}}else if(this.allPositive===!0){if(!this.negativeMap)throw`No negativeMap found when trying to set item ${e.join(",")} be negative`;this.negativeMap.set(e,!0)}else if(this.allNegative===!0){if(!this.positiveMap)throw`No positiveMap found when trying to set item ${e.join(",")} be negative`;this.positiveMap?.delete(e)}}}makeItemNegative(e){this.setItemValue(e,!1)}makeItemPositive(e){this.setItemValue(e,!0)}toggleItem(e){this.setItemValue(e,!this.isItemPositive(e))}};var xt=class extends Wa{constructor(e){super(e)}getState(){return{expandedRows:this.allPositive?!0:this.positiveMap?.topDownKeys()??[],collapsedRows:this.allNegative?!0:this.negativeMap?.topDownKeys()??[]}}getPositiveFromState(e){return e.expandedRows}getNegativeFromState(e){return e.collapsedRows}areAllCollapsed(){return this.areAllNegative()}areAllExpanded(){return this.areAllPositive()}collapseAll(){this.makeAllNegative()}expandAll(){this.makeAllPositive()}isGroupRowExpanded(e){return this.isItemPositive(e)}isGroupRowCollapsed(e){return!this.isGroupRowExpanded(e)}setGroupRowExpanded(e,t){return this.setItemValue(e,t)}collapseGroupRow(e){this.setGroupRowExpanded(e,!1)}expandGroupRow(e){this.setGroupRowExpanded(e,!0)}toggleGroupRow(e){this.toggleItem(e)}};function Vt(){let o=Fe().performance?.now();return`${Date.now()}:${o}`}function ja(o,e){return o&&o.filter(t=>{let n=e[t.filter.type];return!(!n||n.emptyValues&&n.emptyValues.includes(t.filter.value))})}var wg=new WeakMap;function Ua(o,e){if(!o||!o.length)return[];let t=wg.get(o);t||(t=new WeakMap,wg.set(o,t));let n=t.get(e);if(n)return n;let r=[],i=ja(o,e)||[];for(let a=0,l=i.length;a<l;a++){let s=i[a],c=e[s.filter.type];if(s.disabled||!c)continue;let u;for(let d=0;d<c.operators.length;d++){let p=c.operators[d];p.name===s.filter.operator&&(u=p.fn)}u&&r.push({field:s.field,valueGetter:s.valueGetter||c.valueGetter,fn:u,value:s.filter.value,emptyValues:c.emptyValues})}return t.set(e,r),r}function bc(o,e){if(!o.length)return!0;let{data:t}=e,n={data:t,index:e.index,dataArray:e.dataArray,primaryKey:e.primaryKey,field:void 0,filterValue:void 0,currentValue:void 0,emptyValues:[]};for(let r=0,i=o.length;r<i;r++){let a=o[r];if(n.field=a.field,n.filterValue=a.value,n.currentValue=a.valueGetter?a.valueGetter(n):a.field?t[a.field]:t,n.emptyValues=a.emptyValues,!a.fn(n))return!1}return!0}var bR=0;function Tc(o){return bR++,bc(Ua(o.filterValue,o.filterTypes),o)}function $a(o){return Ua(o.filterValue,o.filterTypes).length?o.isLeafNode?Tc(o):o.filterTreeNode(o.data):!0}var TR="group-by",vg="group-by-";function Pg(o){let e=o.map(t=>t.valueGetter?n=>t.valueGetter({data:n,field:t.field}):t.field??t.groupField).filter(Boolean);if(e.length)return e.length===1&&typeof e[0]!="function"?e[0]:e}function Ya(o,e){if(!o?.length||!e?.length)return o;let t=!1,n=o.map(r=>{if(r.field!=null||!r.id)return r;if(r.id===TR){let i=Pg(e);return i==null?r:(t=!0,{...r,field:i})}if(r.id.startsWith(vg)){let i=r.id.slice(vg.length),a=e.find(s=>String(s.field)===i||s.groupField===i);if(!a)return r;let l=Pg([a]);return l==null?r:(t=!0,{...r,field:l})}return r});return t?n:o}var Dg=!0,CR={originalDataArray:!0,changes:!0},RR={filterValue:(o,e)=>JSON.stringify(o)===JSON.stringify(e),groupRowsState:(o,e)=>JSON.stringify(o)===JSON.stringify(e)};function jt(o,e,t){let n=Ya(o.sortInfo,o.groupBy),r=o.multiSort?n:n?.[0]??null,i={append:!1,originalDataArray:o.originalDataArray,sortInfo:r,refetchKey:o.refetchKey,groupBy:o.groupBy,pivotBy:o.pivotBy,filterValue:o.filterValue,aggregationReducers:o.aggregationReducers};if(t&&(i.masterRowInfo=t.masterRowInfo),i.groupBy&&(i.groupRowsState=o.groupRowsState.getState()),o.livePagination!==void 0&&(i.livePaginationCursor=o.livePaginationCursor,i.__cursorId=o.cursorId),o.lazyLoad&&(o.lazyLoadBatchSize!=null&&o.lazyLoadBatchSize>0&&(i.lazyLoadBatchSize=o.lazyLoadBatchSize,i.lazyLoadStartIndex=0),i.groupKeys=[],o.selectionMode==="multi-row"&&(i.multiRowSelectionTarget=o.multiRowSelectionTarget)),e&&Object.assign(i,e),i.filterValue&&i.filterValue.length){let s=Cc(i.filterValue,{filterMode:o.filterMode,filterTypes:o.filterTypes});s&&s.length&&(i.filterValue=s)}let a={},l=o.dataParams||{};for(let s in i)if(i.hasOwnProperty(s)&&!CR[s]){let c=s,u=RR[c],d=i[c],p=l[c];(u?u(d,p):d===p)||(a[c]=!0)}return i.changes=a,i}function To(o,e,t,n,r){let i=jt(e,n,r),a=i.append;if(e.lazyLoad){let u=e.originalLazyGroupData,d=[vt,...i.groupKeys||[]],p=u.get(d);if(!p){let f=[...i.groupKeys||[],i.lazyLoadStartIndex??0];e.lazyLoadCacheOfLoadedBatches.set(f,!0)}if(p&&p.cache&&d.length>1){let f=p.children,m=f.length,g=!0;for(let h=0;h<m;h++)if(f[h]==null){g=!1;break}if(g)return Promise.resolve(!0)}p?p.childrenLoading||(p.childrenLoading=!0):u.set(d,{error:void 0,children:[],childrenLoading:!0,childrenAvailable:!1,cache:Dg,totalCount:0}),t.originalLazyGroupDataChangeDetect=Vt()}if(typeof o=="function")try{o=o(i)}catch(u){o=Promise.reject(u)}let s=typeof o=="object"&&typeof o.then=="function"&&(!e.lazyLoad||!a&&!i.groupKeys?.length);s&&(t.loading=!0);let c=u=>{if(console.error('The DataSource "data" function failed:',u),e.lazyLoad){let d=i.groupKeys||[],p=e.originalLazyGroupData.get([vt,...d]),f=u instanceof Error?u.message:String(u);if(d.length&&p&&!p.childrenAvailable)p.childrenLoading=!1,p.cache=!1,p.error=f,t.originalLazyGroupDataChangeDetect=Vt();else{let m=e.lazyLoadCacheOfLoadedBatches,g=[...d,i.lazyLoadStartIndex??0];m.has(g)&&m.set(g,"failed"),p&&(p.childrenLoading=!1,p.error=f)}}s&&(t.loading=!1)};return Promise.resolve(o).then(u=>{let d=[],p=!1;if(Array.isArray(u.data)){let m=u;if(d=m.data,m.livePaginationCursor!==void 0&&(t.livePaginationCursor=m.livePaginationCursor),m.mappings&&(t.pivotMappings=m.mappings),e.lazyLoad||(t.unfilteredCount=m.totalCountUnfiltered??d.length),e.lazyLoad){let h=function(S,y,T){let b=[vt,...S],R=y.data,C={cache:y.cache??Dg,childrenLoading:!1,childrenAvailable:!0,totalCount:y.totalCount??R.length,totalCountUnfiltered:y.totalCountUnfiltered,totalChildrenCount:y.totalChildrenCount,totalChildrenCountUnfiltered:y.totalChildrenCountUnfiltered,children:R,error:y.error},I=[];if(i.lazyLoadBatchSize&&!T){let v=g.get(b),P=!v,E=ep({children:!0},v||{},C);P&&(E.chidren=[]),E.children.length=E.totalCount;let M=i.lazyLoadStartIndex??0,D=Math.min(y.totalCount??R.length,M+i.lazyLoadBatchSize);for(let x=M;x<D;x++){let A=C.children[x-M];if(!A)throw`lazily loaded item not found at index ${x-M}`;E.children[x]=A,A.dataset&&I.push({keys:A.keys,dataset:A.dataset})}P&&g.set(b,E)}else C.children.forEach(v=>{v&&v.dataset&&I.push({keys:v.keys,dataset:v.dataset})}),C.children.length=C.totalCount,g.set(b,C);let w=!1;if(!S||!S.length){let v=g.get([vt]);t.originalDataArray=[...v.children],w=!0}if(w||(t.originalLazyGroupDataChangeDetect=Vt()),I.length){let v=S;I.forEach(({keys:P,dataset:E})=>{h(P,E,v)})}};var f=h;let g=e.originalLazyGroupData;p=!0,h(i.groupKeys||[],m)}}else d=u;p||(t.originalDataArray=a?e.originalDataArray.concat(d):d),s&&(t.loading=!1)}).catch(c)}function Cc(o,{filterTypes:e,filterMode:t}){return t==="local"?!o||!o.some(n=>n.valueGetter)?o:o.map(xg):(ja(o,e)||[]).map(xg)}function xg(o){if(!o.valueGetter)return o;let e={...o};return delete e.valueGetter,e}function Eg(){let o;return(e,t,n)=>{if(o&&o.filterValue===e&&o.filterTypes===t&&o.filterMode===n)return o.result;let r=Cc(e,{filterTypes:t,filterMode:n});return o&&o.filterValue===e&&JSON.stringify(o.result)===JSON.stringify(r)&&(r=o.result),o={filterValue:e,filterTypes:t,filterMode:n,result:r},r}}var IR=()=>new Promise(o=>{He(o)});function Rc(o,e){let t=!!o,{stateReadyAsDetails:n}=e(),r=t&&o.shouldRestoreState?n:!0;return{isDetail:t,isDetailReady:r}}function Mg(o){let{lazyLoad:e,lazyLoadBatchSize:t,lazyLoadCacheOfLoadedBatches:n}=o;if(!e||!t||t<=0)return!1;for(let r of n.keys())if(r.length===1)return!0;return!1}function Ag(o){for(let[e,t]of o.entries())t==="failed"&&o.delete(e)}function _g(o,e){let{startIndex:t,endIndex:n,lazyLoadBatchSize:r,componentState:i,componentActions:a,dismissLoadedRows:l}=o,{dataArray:s}=i,c=l?()=>!1:g=>s[g].data!=null,u=!l,d=new q,p=["_______xxx______"];for(let g=t;g<=n;g++){let h=s[g];if(!h)continue;let S=c(g),y=h.dataSourceHasGrouping&&h.groupKeys?[...h.groupKeys]:[];h.isGroupRow&&h.dataSourceHasGrouping&&h.groupKeys&&y.pop();let T=y.length?y:p,b=h.dataSourceHasGrouping?h.indexInGroup:h.indexInAll;if(h.isGroupRow&&!h.collapsed&&!h.childrenAvailable){let R={lazyLoadStartIndex:0,lazyLoadBatchSize:r,groupKeys:h.groupKeys,append:u},C=h.groupKeys,I=d.get(C);if(!I?.[h.id]){let w=!I;I=I||{},I[h.id]||(I[h.id]=R),w&&d.set(C,I)}}if(!S&&r!=null){let R=d.get(T),C=Math.floor(b/r)*r,I=b-C,w=s[h.indexInAll-I].indexInAll,v=c(w),P=s[w].id;if(v||R?.[P])continue;let E=!R;R=R||{};let M={lazyLoadStartIndex:C,lazyLoadBatchSize:r,groupKeys:y,append:u};R[P]||(R[P]=M),E&&d.set(T,R)}}let f=Promise.resolve(!0),m=[];d.topDownValues().forEach(g=>{m.push(...Object.values(g))}),m.reduce((g,h)=>{let S=[...h.groupKeys,h.lazyLoadStartIndex];if(e&&e.has(S))return g;e?.set(S,!0);let y=[i.data,i,a,h];return g.then(()=>IR()).then(()=>To(...y))},f)}function Ic(o,e){let{rowIndex:t,primaryKey:n}=e,{dataArray:r}=o.getDataSourceState();if(n!==void 0){let i=o.dataSourceApi.getIndexByPrimaryKey(n);if(i!==-1)return i;if(r[t]?.id!==n)return-1}return r[t]?t:-1}function ci(o,e){let t=Ic(o,e);return t===-1?null:to({...o,rowIndex:t,columnId:e.columnId})}function ui(o,e){console.warn(`Skipping "${o}": the edited row (primaryKey: ${String(e.primaryKey)}, rowIndex: ${e.rowIndex}) is no longer in the data array.`)}function wc(o){let{getComputed:e,getState:t,actions:n}=o,r=t().columnMenuVisibleForColumnId;if(!r)return;let i=e(),a=i.computedVisibleColumnsMap,l=i.computedColumnOrder;if(a.has(r)){n.columnMenuVisibleKey=Date.now();return}function s(f,m){let g=l[c+f*m],h=a.get(g);if(h&&h.renderMenuIcon!==!1)return g}let c=l.indexOf(r),u=0,d=-1,p;for(;!p&&u<l.length&&(u++,p=s(u,d),p||(d*=-1,p=s(u,d)),!p););return p&&(n.columnMenuVisibleForColumnId=p),p}function qa(o,e){let{rowIndex:t,colIndex:n}=o,{rowIndex:r,colIndex:i}=e,[a,l]=n>i?[i,n]:[n,i],[s,c]=t>r?[r,t]:[t,r];return[{rowIndex:s,colIndex:a},{rowIndex:c,colIndex:l}]}function vc(o,e,t){let{rowsPerPage:n}=t;return n?Math.floor(o.rowIndex/n)===Math.floor(e.rowIndex/n):!0}function Og(o,e,t){if(vc(o,e,t))throw"You should not call this when the positions are in the same page";let{rowsPerPage:n,columnsPerSet:r}=t;if(n===0)throw"rowsPerPage cannot be 0";let i=o,a=e;Math.floor(o.rowIndex/n)>Math.floor(e.rowIndex/n)&&(i=e,a=o);let{rowIndex:l,colIndex:s}=i,{rowIndex:c,colIndex:u}=a,d=Math.floor(l/n),p=Math.floor(c/n),f=l%n,m=c%n,g=Math.min(f,m),h=Math.max(f,m),S=[];for(let y=d;y<=p;y++)for(let T=g;T<=h;T++){let b=y*n+T;if(y===d)for(let R=s;R<r;R++)S.push({rowIndex:b,colIndex:R});else if(y===p)for(let R=0;R<=u;R++)S.push({rowIndex:b,colIndex:R});else for(let R=0;R<r;R++)S.push({rowIndex:b,colIndex:R})}return S}function wR(o,e){let t=new Set(o);return e.map(n=>t.has(n)?n:null).filter(n=>n!=null)}var Pc=class{constructor(e){this.getCellSelectionPosition=e=>{let t=e.rowId??Vo(e.rowIndex,this.getDataSourceState)?.id,n=e.colId??this.getComputed().computedVisibleColumns[e.colIndex].id;return[t,n]};this.setRangeSelected=(e,t,n)=>{let r=this.getDataSourceState(),i=r.cellSelection;if(!i)return;let a=new Ue(i);a.debugId=r.debugId??"";let[l,s]=this.getCellSelectionPosition(e),[c,u]=this.getCellSelectionPosition(t),d=this.getComputed().computedVisibleColumnsMap.get(s),p=this.getComputed().computedVisibleColumnsMap.get(u);if(!d||!p)return;let f=d.computedVisibleIndex,m=p.computedVisibleIndex,g=Vo(l,this.getDataSourceState),h=Vo(c,this.getDataSourceState);if(!g||!h)return;let S=g.indexInAll,y=h.indexInAll,[T,b]=qa({rowIndex:S,colIndex:f},{rowIndex:y,colIndex:m});for(let R=T.rowIndex;R<=b.rowIndex;R++)for(let C=T.colIndex;C<=b.colIndex;C++){let I={rowIndex:R,colIndex:C},[w,v]=this.getCellSelectionPosition(I);n?a.selectCell(w,v):a.deselectCell(w,v)}this.dataSourceActions.cellSelection=a};this.getCellSelectionPositionsWithFn=(e,t)=>{let n=la(this.getDataSourceState),{computedVisibleColumns:r}=this.getComputed(),i=r.map(d=>d.id),a=new Set,l=[],s=new Set;n.filter(d=>{r.forEach(p=>{this.isCellSelected({rowId:d.id,colId:p.id})&&(a.has(p.id)||a.add(p.id),s.has(d.id)||(s.add(d.id),l.push(d)))})});let c=wR(Array.from(a),i),u=l.map(d=>c.map(p=>this.isCellSelected({rowId:d.id,colId:p})?e(d,p):t));return{columnIds:c,positions:u}};this.getAllCellSelectionPositions=()=>this.getCellSelectionPositionsWithFn((e,t)=>[e.id,t],null);this.mapCellSelectionPositions=(e,t)=>this.getCellSelectionPositionsWithFn(e,t);this.deselectAll=()=>{let e=this.getDataSourceState(),t=e.cellSelection;if(!t)return;let n=new Ue(t);n.debugId=e.debugId??"",n.deselectAll(),this.dataSourceActions.cellSelection=n};this.clear=()=>{this.deselectAll()};this.selectAll=()=>{let e=this.getDataSourceState(),t=e.cellSelection;if(!t)return;let n=new Ue(t);n.debugId=e.debugId??"",n.selectAll(),this.dataSourceActions.cellSelection=n};this.selectRange=(e,t)=>{this.setRangeSelected(e,t,!0)};this.deselectRange=(e,t)=>{this.setRangeSelected(e,t,!1)};this.isCellSelected=e=>{let[t,n]=this.getCellSelectionPosition(e);return this.getDataSourceState().cellSelection?.isCellSelected(t,n)??!1};this.selectCell=e=>{let t=this.getDataSourceState(),n=t.cellSelection;if(!n)return;let[r,i]=this.getCellSelectionPosition(e),a=e.clear?new Ue:new Ue(n);a.debugId=t.debugId??"",a.selectCell(r,i),this.dataSourceActions.cellSelection=a};this.deselectCell=e=>{let t=this.getDataSourceState(),n=t.cellSelection;if(!n)return;let[r,i]=this.getCellSelectionPosition(e),a=new Ue(n);a.debugId=t.debugId??"",a.deselectCell(r,i),this.dataSourceActions.cellSelection=a};this.selectColumn=(e,t)=>{t?.clear&&this.deselectAll();let n=this.getDataSourceState(),r=n.cellSelection;if(!r)return;let i=new Ue(r);i.debugId=n.debugId??"",i.selectColumn(e),this.dataSourceActions.cellSelection=i};this.deselectColumn=e=>{let t=this.getDataSourceState(),n=t.cellSelection;if(!n)return;let r=new Ue(n);r.debugId=t.debugId??"",r.deselectColumn(e),this.dataSourceActions.cellSelection=r};this.getComputed=e.getComputed,this.getDataSourceState=e.getDataSourceState,this.dataSourceActions=e.dataSourceActions}};function Fg(o){return new Pc(o)}var pr=class{constructor(e){let t=e instanceof Object.getPrototypeOf(this).constructor?e.getState():e,n=this.getPositiveFromState(t),r=this.getNegativeFromState(t);this.update({negativeItems:r,positiveItems:n})}getInitialState(){return this.initialState}destroy(){this.positiveMap?.clear(),this.negativeMap?.clear(),delete this.positiveMap,delete this.negativeMap}update(e){let{positiveItems:t,negativeItems:n}=e;if(this.allNegative=n===!0,this.allPositive=t===!0,this.allNegative&&this.allPositive)throw"Cannot have both negativeItems and positiveItems be true!";if(n&&n!==!0){this.negativeMap||(this.negativeMap=new Map),this.negativeMap.clear();for(let r of n)this.negativeMap.set(r,!0);this.positiveMap&&this.positiveMap.clear()}if(t&&t!==!0){this.positiveMap||(this.positiveMap=new Map),this.positiveMap.clear();for(let r of t)this.positiveMap.set(r,!0);this.negativeMap&&this.negativeMap.clear()}}isDefaultNegativeSelection(){return this.allNegative}isDefaultPositiveSelection(){return this.allPositive}areAllNegative(){return this.allNegative&&(this.positiveMap?this.positiveMap.size===0:!0)}areAllPositive(){return this.allPositive&&(this.negativeMap?this.negativeMap.size===0:!0)}makeAllNegative(){this.update({negativeItems:!0,positiveItems:[]})}makeAllPositive(){this.update({positiveItems:!0,negativeItems:[]})}isItemPositive(e){if(this.allPositive===!0){if(this.allNegative===!0)throw'Cannot have both positiveItems and negativeItems be "true"';return!this.negativeMap?.has(e)}return!!this.positiveMap?.has(e)}isItemNegative(e){return!this.isItemPositive(e)}setItemValue(e,t){if(t!==this.isItemPositive(e)){if(t){if(this.allNegative===!0){if(!this.positiveMap)throw`No positiveMap found when trying to set item ${e} be positive`;this.positiveMap.set(e,!0)}else if(this.allPositive===!0){if(!this.negativeMap)throw`No negativeMap found when trying to set item ${e} be positive`;this.negativeMap.delete(e)}}else if(this.allPositive===!0){if(!this.negativeMap)throw`No negativeMap found when trying to set item ${e} be negative`;this.negativeMap.set(e,!0)}else if(this.allNegative===!0){if(!this.positiveMap)throw`No positiveMap found when trying to set item ${e} be negative`;this.positiveMap?.delete(e)}}}makeItemNegative(e){this.setItemValue(e,!1)}makeItemPositive(e){this.setItemValue(e,!0)}toggleItem(e){this.setItemValue(e,!this.isItemPositive(e))}};var At=class extends pr{constructor(t){super(t);this.isRowDetailsExpanded=t=>!!this.isItemPositive(t)}getState(){let t=this.allPositive?!0:[...this.positiveMap?.keys()??[]],n=this.allNegative?!0:[...this.negativeMap?.keys()??[]];return{expandedRows:t,collapsedRows:n}}getPositiveFromState(t){return t.expandedRows}getNegativeFromState(t){return t.collapsedRows}areAllCollapsed(){return this.areAllNegative()}areAllExpanded(){return this.areAllPositive()}collapseAll(){this.makeAllNegative()}expandAll(){this.makeAllPositive()}isRowDetailsCollapsed(t){return!this.isRowDetailsExpanded(t)}setRowDetailsExpanded(t,n){return this.setItemValue(t,n)}collapseRowDetails(t){this.setRowDetailsExpanded(t,!1)}expandRowDetails(t){this.setRowDetailsExpanded(t,!0)}toggleRowDetails(t){this.toggleItem(t)}};function Ng(o){let{dataSourceApi:e,getState:t,actions:n}=o,r={collapseAllDetails(){n.rowDetailState=new At({collapsedRows:!0,expandedRows:[]})},expandAllDetails(){n.rowDetailState=new At({expandedRows:!0,collapsedRows:[]})},isRowDetailCollapsed(i){let a=t().isRowDetailExpanded;if(!a)return!0;let l=e.getRowInfoByPrimaryKey(i);return l?!a(l):!0},isRowDetailEnabledForRow(i){let{isRowDetailEnabled:a}=t();if(!a)return!1;if(typeof a=="function"){let l=e.getRowInfoByPrimaryKey(i);return l?a(l):!1}return!0},isRowDetailExpanded(i){return!r.isRowDetailCollapsed(i)},collapseRowDetail(i){let a=t(),l=a.rowDetailState;if(!l){console.error("Cannot collapse row details via rowDetailState, as no props.rowDetailState is provided.");return}let s=new At(l);s.collapseRowDetails(i),a.lastRowToExpandRef.current=null,a.lastRowToCollapseRef.current=i,n.rowDetailState=s},expandRowDetail(i){let a=t(),l=a.rowDetailState;if(!l){console.error("Cannot expand row details via rowDetailState, as no props.rowDetailState is provided.");return}let s=new At(l);s.expandRowDetails(i),a.lastRowToCollapseRef.current=null,a.lastRowToExpandRef.current=i,n.rowDetailState=s},toggleRowDetail(i){r.isRowDetailExpanded(i)?r.collapseRowDetail(i):r.expandRowDetail(i)}};return r}function Yo(o,e,t){return Math.min(Math.max(o,e),t)}function Xa(o,e,t){let n=o().dataArray,r=0,i=n.length-1,a=e;do{a+=t;let l=n[a];if(!l)return a<r?r:i;if(!l.rowDisabled)return a}while(a>=r&&a<=i);return Yo(a,r,i)}function vR(o,e){let{getState:t,getDataSourceState:n,actions:r,api:i,dataSourceApi:a}=o,{key:l}=e,s=n().dataArray,c=s.length,u=t(),{brain:d}=u,{activeRowIndex:p}=u;if(p==null)return!1;let{start:[f],end:[m]}=d.getRenderRange(),g=p,h=m-f-1,S=0,y=c-1,T={ArrowDown:()=>{p=Xa(n,p,1)},ArrowUp:()=>{p=Xa(n,p,-1)},ArrowLeft:()=>{let R=s[p];if(d.isHorizontalLayoutBrain){let C=d.rowsPerPage;p-C>=S?p=p-C:T.ArrowUp();return}return R&&R.isGroupRow?i.collapseGroupRow(R.groupKeys):R&&i.rowDetailApi.isRowDetailEnabledForRow(R.id)?i.rowDetailApi.collapseRowDetail(R.id):!1},ArrowRight:()=>{let R=s[p];if(d.isHorizontalLayoutBrain){let C=d.rowsPerPage;p+C<=y?p=p+C:T.ArrowDown();return}return R&&R.isGroupRow?i.expandGroupRow(R.groupKeys):R&&i.rowDetailApi.isRowDetailEnabledForRow(R.id)?i.rowDetailApi.expandRowDetail(R.id):!1},Enter:()=>{let R=s[p];return R&&R.isGroupRow?i.toggleGroupRow(R.groupKeys):R&&R.isTreeNode&&R.isParentNode?a.treeApi.toggleNode(R.nodePath):i.rowDetailApi.isRowDetailEnabledForRow(R.id)?i.rowDetailApi.toggleRowDetail(R.id):!1},PageDown:()=>{p=Math.min(p+h,c-1)},PageUp:()=>{p=Math.max(p-h,S)},End:()=>{p=y},Home:()=>{p=S}},b=T[l];return b?(b(),g!==p?(r.activeRowIndex=p,!0):!1):!1}function Dc(o,e){let{api:t,getState:n,getComputed:r,getDataSourceState:i,dataSourceApi:a}=o,{key:l,shiftKey:s}=e,c=i().dataArray,u=n(),{activeCellIndex:d,brain:p}=u;if(!d)return!1;let[f,m]=d,{start:[g,h],end:[S,y]}=p.getRenderRange(),T=S-g-1,b=y-h-1,R=i().dataArray.length-1,C=r().computedVisibleColumns.length-1,I=0,w=0;f=Yo(f,0,R),m=Yo(m,0,C);let v={ArrowDown:()=>{f=Yo(f+1,I,R)},ArrowUp:()=>{f=Yo(f-1,I,R)},ArrowLeft:()=>{if(m===w)if(f!==I&&(m=C),p.isHorizontalLayoutBrain){let E=p.rowsPerPage;f-E>=I?f=f-E:v.ArrowUp()}else v.ArrowUp();else m=Yo(m-1,w,C)},ArrowRight:()=>{if(m===C)if(f!==R&&(m=w),p.isHorizontalLayoutBrain){let E=p.rowsPerPage;f+E<=R?f=f+E:v.ArrowDown()}else v.ArrowDown();else m=Yo(m+1,w,C)},Enter:()=>{let E=c[f];return E&&E.isGroupRow?t.toggleGroupRow(E.groupKeys):E&&E.isTreeNode&&E.isParentNode?a.treeApi.toggleNode(E.nodePath):E&&t.rowDetailApi.isRowDetailEnabledForRow(E.id)?t.rowDetailApi.toggleRowDetail(E.id):!1},PageDown:()=>{s?m=Math.min(m+b,C):f=Math.min(f+T,R)},PageUp:()=>{s?m=Math.max(m-b,w):f=Math.max(f-T,I)},End:()=>{s?m=C:f=R},Home:()=>{s?m=w:f=I}},P=v[l];return P?(P(),[f,m]):!1}function PR(o,e){let t=Dc(o,e);return t?(o.actions.activeCellIndex=t,!0):!1}var DR={ArrowUp:!0,ArrowDown:!0,ArrowLeft:!0,ArrowRight:!0,PageUp:!0,PageDown:!0,Home:!0,End:!0,Enter:!0," ":!0};function Lg(o,e){let{key:t}=e,{getState:n}=o,r=n(),{activeRowIndex:i,activeCellIndex:a,keyboardNavigation:l,cellContextMenuVisibleFor:s,contextMenuVisibleFor:c}=r;return s||c||!DR[t]?!1:i!=null&&l==="row"?vR(o,e):a!=null&&l==="cell"?PR(o,e):!1}var xc=class{constructor(e){this.param=e}setKeyboardNavigation(e){this.param.actions.keyboardNavigation=e}setActiveCellIndex(e){this.param.actions.activeCellIndex=e}setActiveRowIndex(e){this.param.actions.activeRowIndex=e}gotoRowWithDirection(e){let{getDataSourceState:t,getState:n}=this.param,{activeRowIndex:r,keyboardNavigation:i}=n();if(i!=="row")return console.error("Keyboard navigation is not enabled for rows"),!1;if(r==null)return!1;let a=Xa(t,r,e);return a!==r?(this.param.actions.activeRowIndex=a,a):!1}gotoRow(e){return this.gotoRowWithDirection(e)}gotoNextRow(){return this.gotoRow(1)}gotoPreviousRow(){return this.gotoRow(-1)}gotoCell(e){let{direction:t}=e,n=t=="top"?"ArrowUp":t=="bottom"?"ArrowDown":t=="left"?"ArrowLeft":"ArrowRight",r=Dc(this.param,{key:n,shiftKey:!1});return r===!1?!1:(this.param.actions.activeCellIndex=r,r)}};function kg(o){return new xc(o)}function zg(o,e){return o.id?o.id===e.id:!!(o.field&&o.field===e.field)}var Ec=class{constructor(e){this.columnApiById=new Map;this.getVisibleRenderRange=()=>this.getState().brain.getRenderRange();this.hideFilterOperatorMenu=()=>{this.actions.filterOperatorMenuVisibleForColumnId=null};this.setGroupRenderStrategy=e=>{this.actions.groupRenderStrategy=e};this.getColumnOrder=()=>this.getComputed().computedColumnOrder;this.getComputedColumnById=e=>this.getComputed().computedColumnsMap.get(e);this.getVisibleColumnOrder=()=>{let e=this.getColumnOrder(),t=this.getComputed().computedVisibleColumnsMap;return e.filter(n=>t.has(n))};this.persistEdit=async e=>{e=e??{};let{editingCell:t,editingValueRef:n}=this.getState();if(!t)return Promise.resolve(new Error("no edit in progress"));await new Promise(p=>requestAnimationFrame(p));let r=this.getComputed().computedColumnsMap.get(t.columnId),i=e.value??t.value;!t.active&&t.waiting!=="persist"&&(this.actions.editingCell={...t,active:!1,waiting:"persist"});let a=Ic({...this.context,api:this},t);if(a===-1){let p=new Error(`Cannot persist edit: the edited row (primaryKey: ${String(t.primaryKey)}, rowIndex: ${t.rowIndex}) is no longer in the data array.`);return this.actions.editingCell={...t,active:!1,accepted:!1,waiting:!1,persisted:p},Promise.resolve(p)}let l={...to({rowIndex:a,columnId:t.columnId,...this.context,api:this}),value:i,initialValue:t.initialValue},s=i;n.current=null,r.getValueToPersist&&(s=await r.getValueToPersist(l)),l.value=s,t.value=s;let c=this.getState().persistEdit??(()=>{if(!l.column.field)return i;let p=this.getDataSourceState().primaryKey,f=l.data&&typeof p=="string"?{[p]:l.data[p],[l.column.field]:s}:{...l.data,[l.column.field]:s};return this.context.dataSourceApi.updateData(f)}),u;try{u=await c(l)}catch(p){u=p}let d=u instanceof Error?u:!0;return this.actions.editingCell={...t,active:!1,accepted:!1,waiting:!1,persisted:d},Promise.resolve(d)};this.clearEditInfo=()=>{this.actions.editingCell=null};this.isEditInProgress=()=>{let{editingCell:e}=this.getState();return e?e.active:!1};this.isEditorVisibleForCell=e=>{let{rowIndex:t,columnId:n}=e,{dataArray:r}=this.getDataSourceState(),{editingCell:i}=this.getState(),a=r[t];return!a||!i?!1:i.columnId===n&&i.primaryKey===a.id&&!!(i.active||i.waiting)};this.confirmEdit=e=>this.stopEdit({value:e});this.stopEdit=async e=>{let t=this.getState(),{editingCell:n,editingValueRef:r}=t;if(!n)return!0;e||(e={});let i=e.value??r.current;if(!e.cancel&&!e.reject){let{rowIndex:a,columnId:l}=n;this.actions.editingCell={...t.editingCell,value:i,active:!1,waiting:"accept"};let{computedColumnsMap:s}=this.getComputed(),c=s.get(l),u=t.shouldAcceptEdit??c.shouldAcceptEdit,d=u?u({...to({...this.context,api:this,dataSourceApi:this.context.dataSourceApi,columnId:l,rowIndex:a}),value:i,initialValue:n.initialValue}):!0;return await new Promise(p=>requestAnimationFrame(p)),Promise.resolve(d).then(p=>{if(p===!0)return this.actions.editingCell={...t.editingCell,active:!1,accepted:!0,persisted:!1,waiting:"persist",value:i},!0;throw p}).catch(p=>(p instanceof Error||(p=new Error(`Edit rejected: ${p}`)),this.actions.editingCell={...n,value:i,persisted:!1,active:!1,waiting:!1,accepted:p},{reject:p,value:i}))}return e.cancel&&n?.active?(this.actions.editingCell={...n,active:!1,cancelled:!0,waiting:!1,persisted:!1},{cancel:!0,value:i}):e.reject&&n?.active?(this.actions.editingCell={...n,value:i,active:!1,persisted:!1,waiting:!1,accepted:e.reject},{reject:e.reject,value:i}):!0};this.cancelEdit=()=>this.stopEdit({cancel:!0});this.rejectEdit=e=>this.stopEdit({reject:e});this.getColumnAtIndex=e=>this.getComputed().computedVisibleColumns[e]??null;this.isCellEditable=e=>{let{rowIndex:t,primaryKey:n,columnId:r}=e,i=t??this.context.dataSourceApi.getIndexByPrimaryKey(n),{computedColumnsMap:a}=this.getComputed(),l=a.get(r);if(!l||!l.computedEditable||l.groupByForColumn)return Promise.resolve(!1);let s=this.getDataSourceState().dataArray[i];if(!s||s.isGroupRow)return Promise.resolve(!1);if(l.computedEditable===!0)return Promise.resolve(!0);let c=l.computedEditable(to({...this.context,api:this,columnId:r,rowIndex:i}));return typeof c=="boolean"?Promise.resolve(c):c};this.getColumnApi=e=>{let t=typeof e=="string"?e:this.getComputed().computedVisibleColumns[e]?.id,n=this.columnApiById.get(t);if(n)return n;let r=bt(e,{...this.context,api:this});return r&&this.columnApiById.set(r.getColumnId(),r),r};this.isColumnSortable=e=>this.getColumnApi(e)?.isSortable()??!1;this.getCellValue=e=>this.getCellValues(e)?.value??null;this.getCellValues=e=>{let{rowIndex:t,primaryKey:n,columnId:r}=e,{dataSourceApi:i,getState:a}=this.context,{computedColumnsMap:l}=this.getComputed(),s=t??i.getIndexByPrimaryKey(n),c=l.get(r),u=i.getRowInfoByIndex(s),d=u?.id;if(!u||!c)return c||console.warn(`No column found with id: "${r}"`),u||console.warn(`No row found with index: "${s}" or primary key: "${d}"`),null;let p=this,{isRowDetailEnabled:f}=a(),m=!f||typeof f=="function"&&!f(u)?!1:this.rowDetailApi.isRowDetailExpanded(u.id)?"expanded":"collapsed",g=nr({column:c,rowInfo:u,columnsMap:l,context:{...this.context,api:p},rowDetailState:m});return{value:g.formattedValueContext.value,formattedValue:g.formattedValue,rawValue:g.formattedValueContext.rawValue}};this.getVerticalRenderRange=()=>{let e=this.getState().brain.getRenderRange();return{renderStartIndex:e.start[0],renderEndIndex:e.end[0]}};this.setColumnOrder=e=>{this.actions.columnOrder=e};this.setVisibilityForColumnGroup=(e,t)=>{let n={...this.getState().columnGroupVisibility};t?delete n[e]:n[e]=!1,this.actions.columnGroupVisibility=n};this.collapseAllGroupRows=()=>{let e=this.getDataSourceState(),t=new xt(e.groupRowsState);t.collapseAll(),this.dataSourceActions.groupRowsState=t};this.collapseGroupRow=e=>this.getDataSourceState().groupRowsState.isGroupRowExpanded(e)?(this.toggleGroupRow(e),!0):!1;this.expandGroupRow=e=>this.getDataSourceState().groupRowsState.isGroupRowCollapsed(e)?(this.toggleGroupRow(e),!0):!1;this.toggleGroupRow=e=>{let t=this.getDataSourceState(),n=new xt(t.groupRowsState);if(n.toggleGroupRow(e),this.dataSourceActions.groupRowsState=n,t.lazyLoad){let r=[vt,...e],i=t.originalLazyGroupData.get(r);n.isGroupRowExpanded(e)?i?.cache||To(t.data,t,this.dataSourceActions,{groupKeys:e},this.context.getDataSourceMasterContext()):i?.cache||(t.lazyLoadCacheOfLoadedBatches.getKeysStartingWith(e).forEach(l=>{t.lazyLoadCacheOfLoadedBatches.delete(l)}),this.dataSourceActions.lazyLoadCacheOfLoadedBatches=q.clone(t.lazyLoadCacheOfLoadedBatches),t.originalLazyGroupData.delete(r),this.dataSourceActions.originalLazyGroupDataChangeDetect=Vt())}};this.toggleSortingForColumn=(e,t)=>{if(!this.getComputed().computedColumnsMap.get(e))return;let r=this.getSortingForColumn(e);r===null?r=1:r=r===1?-1:null,this.setSortingForColumn(e,r,t)};this.getState=()=>this.context.getState();this.getComputed=()=>this.context.getComputed();this.getDataSourceState=()=>this.context.getDataSourceState();this.scrollCellIntoView=(e,t,n={offset:0})=>{let r=this.getState(),i=this.getComputed(),a=t;if(typeof t=="string"){let g=i.computedVisibleColumnsMap.get(t);if(!g)return!1;a=g.computedVisibleIndex}if(r.brain.isHorizontalLayoutBrain){n=n||{};let g=r.brain.getPageIndexForRow(e);n.horizontalLayoutPageIndex=g||0}let l=r.renderer.getScrollPositionForScrollColumnIntoView(a,n),s=r.renderer.getScrollPositionForScrollRowIntoView(e,n);if(!l||!s)return!1;let c={scrollLeft:l.scrollLeft,scrollTop:s.scrollTop},u=r.brain.getScrollPosition(),d=r.brain.scrollLeftMax,p=r.brain.scrollTopMax;if(d<0&&p<0)return!0;let f=c.scrollLeft>d+(n.offset||0),m=c.scrollTop>p+(n.offset||0);return f&&m?!1:(c.scrollLeft!==u.scrollLeft&&!f&&this.setNativeScroll({scrollLeft:c.scrollLeft}),c.scrollTop!==u.scrollTop&&!m&&this.setNativeScroll({scrollTop:c.scrollTop}),!0)};this.context=e,this.rowSelectionApi=yf({dataSourceActions:e.dataSourceActions,getDataSourceState:e.getDataSourceState}),this.keyboardNavigationApi=kg({getState:e.getState,getDataSourceState:e.getDataSourceState,actions:e.actions,getComputed:e.getComputed,api:this,dataSourceApi:e.dataSourceApi}),this.rowDetailApi=Ng({getState:e.getState,actions:e.actions,dataSourceApi:e.dataSourceApi}),this.cellSelectionApi=Fg({dataSourceActions:e.dataSourceActions,getDataSourceState:e.getDataSourceState,getComputed:e.getComputed})}get actions(){return this.context.actions}get dataSourceActions(){return this.context.dataSourceActions}get dataSourceApi(){return this.context.dataSourceApi}focus(){this.getState().scrollerDOMRef.current?.focus()}hideContextMenu(){this.actions.contextMenuVisibleFor=null,this.actions.cellContextMenuVisibleFor=null}realignColumnContextMenu(e){let t={actions:this.actions,getState:this.getState,getComputed:this.getComputed},n=this.getState().columnMenuRealignDelay;(!n||n<0)&&(wc(t),e?.()),setTimeout(()=>{this.isDestroyed()||(wc(t),e?.())},n)}isDestroyed(){return!this.getState().domRef.current}async startEdit(e){let{columnId:t,rowIndex:n,primaryKey:r,value:i}=e,a=n??this.context.dataSourceApi.getIndexByPrimaryKey(r);return this.isCellEditable({rowIndex:a,columnId:t}).then(async l=>{if(l){let s=this.getDataSourceState().dataArray,u=this.getComputed().computedColumnsMap.get(t),d=s[a],p=i??Pf({column:u,rowInfo:d}),f=p;u.getValueToEdit&&(p=await u.getValueToEdit(to({...this.context,rowIndex:a,columnId:t,api:this}))),this.actions.editingCell={active:!0,accepted:!1,persisted:!1,columnId:t,value:p,initialValue:f,rowIndex:a,primaryKey:s[a]?.id}}return l})}setSortingForColumn(e,t,n){let{computedColumnsMap:r}=this.getComputed(),i=r.get(e);if(!i||this.getSortingForColumn(e)===t&&this.getDataSourceState().multiSort===!1)return;if(t===null){this.setSortInfoForColumn(e,null,n);return}let l=!!i.pivotColumn,s=i.groupByForColumn,c=l?void 0:i.field,u=s?Array.isArray(s)?s:[s]:[],d=u.map(m=>m.valueGetter?g=>m.valueGetter({data:g,field:m.field}):m.field?m.field:m.groupField??void 0).filter(Ao);d.length&&(c=d);let p=i.computedSortType;if(u.length&&p===po){let m=this.getState().initialColumns;p=u.flatMap(h=>{let S=h.field??h.groupField,y=S?r.get(S):null;if(y)return y.computedSortType;let T=S?nn(m,S):void 0;return T?T.sortType||(typeof T.type=="string"?T.type:"string"):[po]})}u.length&&!Array.isArray(p)&&(p=[p]);let f={dir:t,id:i.id,field:c,type:p};!l&&i.valueGetter&&(f.valueGetter=m=>i.valueGetter({data:m,field:i.field})),this.setSortInfoForColumn(e,f,n)}setSortInfoForColumn(e,t,n){let r=this.getDataSourceState(),i=this.getComputed().computedColumnsMap.get(e);if(!i)return;if(!r.multiSort){this.dataSourceApi.setSortInfo(t?[t]:null);return}let a=i.field,l={id:e,field:a},s=r.sortInfo?.slice()??[];if(t===null){s=s.filter(d=>!zg(d,l)),this.dataSourceApi.setSortInfo(s);return}let c=!1;if((n?.multiSortBehavior??this.getState().multiSortBehavior)==="replace"){this.dataSourceApi.setSortInfo([t]);return}s=s.map(d=>c?d:zg(d,l)?(c=!0,t):d),c||s.push(t),this.dataSourceApi.setSortInfo(s)}getSortTypeForColumn(e){let t=this.getComputed().computedColumnsMap.get(e);return t?t.computedSortType:null}getSortInfoForColumn(e){let t=this.getComputed().computedColumnsMap.get(e);return t?t.computedSortInfo:null}getSortingForColumn(e){let t=this.getSortInfoForColumn(e);return t?t.dir:null}setPinningForColumn(e,t){let n={...this.getState().columnPinning};t===!1?delete n[e]:n[e]=t,this.actions.columnPinning=n}setColumnFilter(e,t){let n=this.getComputed().computedColumnsMap.get(e);if(!n)return;let r=this.getDataSourceState(),{filterTypes:i}=r,a;if(n.computedFilterValue)a={...n.computedFilterValue,filter:{...n.computedFilterValue.filter}};else{let l=n.computedFilterType;if(!i[l])return;let s={filter:{type:l,value:t,operator:i[l].defaultOperator},valueGetter:n.valueGetter};(n.field||typeof n.groupByForColumn=="string")&&(s.field=n.field||n.groupByForColumn),a=s}a.id=n.id,a.filter.value=t,this.setFilterValueForColumn(e,a)}setColumnFilterOperator(e,t){let n=this.getComputed().computedColumnsMap.get(e);if(!n)return;let r=this.getDataSourceState(),{filterTypes:i}=r,a=n.computedFilterType,l=i[a].operators,s=l.find(d=>d.name===t)??l.find(d=>d.name===i[a].defaultOperator),c=s.name,u;n.computedFilterValue?(u={...n.computedFilterValue,filter:{...n.computedFilterValue.filter,operator:c}},s.defaultFilterValue!==void 0&&(u.filter.value=s.defaultFilterValue)):(u={filter:{operator:c,type:a,value:s.defaultFilterValue!==void 0?s.defaultFilterValue:[...i[a].emptyValues.values()][0]},valueGetter:n.valueGetter},n.field&&(u.field=n.field)),u.id=n.id,this.setFilterValueForColumn(e,u)}setFilterValueForColumn(e,t){let n=this.getComputed().computedColumnsMap.get(e);if(!n)return;let i=this.getDataSourceState().filterValue??[],a=!1;i=i.map(l=>l===n.computedFilterValue?(a=!0,t):l),a||i.push(t),this.dataSourceActions.filterValue=i}removeColumnFilter(e){let t=this.getComputed().computedColumnsMap.get(e);if(!t)return;let r=this.getDataSourceState().filterValue??[],i=!1;r=r.filter(a=>a===t.computedFilterValue?(i=!0,!1):!0),i&&(this.dataSourceActions.filterValue=r)}clearColumnFilter(e){let t=this.getComputed().computedColumnsMap.get(e);if(!t)return;let n=this.getDataSourceState(),r=n.filterValue??[],i=!1;r=r.map(a=>{if(a===t.computedFilterValue){let l=t.computedFilterValue.filter.type,s=n.operatorsByFilterType[l],c=n.filterTypes[l];if(i=!0,!c)return null;let u=a.filter.operator??c?.defaultOperator,p=s[u].defaultFilterValue??(c.emptyValues||[])[0]??void 0;return{...a,filter:{...a.filter,operator:u,value:p}}}return a}).filter(Ao),i&&(this.dataSourceActions.filterValue=r)}setVisibilityForColumn(e,t){let n={...this.getState().columnVisibility};t?delete n[e]:n[e]=!1,this.actions.columnVisibility=n}getVisibleColumnsCount(){return this.getComputed().computedVisibleColumns.length}setColumnVisibility(e){this.actions.columnVisibility=e}get scrollContainer(){return this.getState().scrollerDOMRef.current}setNativeScroll(e){let t=this.getState(),n=t.scrollerDOMRef.current;if(!n)return;let r=t.brain.toNativeScrollPosition({scrollTop:e.scrollTop??0,scrollLeft:e.scrollLeft??0});e.scrollTop!==void 0&&(n.scrollTop=r.scrollTop),e.scrollLeft!==void 0&&(n.scrollLeft=r.scrollLeft)}get scrollLeftMax(){return this.getState().brain.scrollLeftMax}get scrollTopMax(){return this.getState().brain.scrollTopMax}get scrollLeft(){return this.getState().brain.getScrollPosition().scrollLeft}set scrollLeft(e){this.setNativeScroll({scrollLeft:Math.max(e,0)})}get scrollTop(){return this.getState().brain.getScrollPosition().scrollTop}set scrollTop(e){this.setNativeScroll({scrollTop:Math.max(e,0)})}scrollRowIntoView(e,t={offset:0}){let n=this.getState(),r=this.getComputed(),i=n.brain.getScrollPosition(),a=t.columnId,l;!a&&n.brain.isHorizontalLayoutBrain&&r.computedVisibleColumns.length>0&&(a=r.computedVisibleColumns[Math.ceil(r.computedVisibleColumns.length/2)].id,l=r.computedVisibleColumnsMap.get(a)?.computedVisibleIndex);let s=n.renderer.getScrollPositionForScrollRowIntoView(e,{...t,colIndex:l});if(!s)return!1;let c=n.brain.scrollTopMax,u=s.scrollLeft!==i.scrollLeft,d=s.scrollTop<=c+(t.offset||0);return!d&&!u?!1:(d&&s.scrollTop!==i.scrollTop&&this.setNativeScroll({scrollTop:s.scrollTop}),u&&this.setNativeScroll({scrollLeft:s.scrollLeft}),!0)}scrollColumnIntoView(e,t={offset:0}){let n=this.getState(),i=this.getComputed().computedVisibleColumnsMap.get(e);if(!i)return!1;let a=i.computedVisibleIndex,l=n.renderer.getScrollPositionForScrollColumnIntoView(a,t);if(!l)return!1;let s=n.brain.getScrollPosition(),c=n.brain.scrollLeftMax;return l.scrollLeft>c+(t.offset||0)?!1:(l.scrollLeft!==s.scrollLeft&&this.setNativeScroll({scrollLeft:l.scrollLeft}),!0)}};function Vg(o){return new Ec(o)}var In=require("react");var xR=10;function Gg(o,e){let{includeHeader:t,columnsToResize:n,columnsToSkip:r}=e,i=`.${mo} > .${jr}`,a=o.current?.querySelectorAll(i),l={},s={};return a&&a.length&&a.forEach(c=>{let u=c.parentElement,d=u.matches(`.${un}`);if(t===!1&&d)return;let p=u.getAttribute("data-column-id"),f=c.cloneNode(!0);f.style.visibility="hidden",f.style.pointerEvents="none",f.classList.remove(...Ht.split(" ")),f.style.position="absolute",f.style.width="auto",u.appendChild(f);let m=f.offsetWidth;if(u.removeChild(f),!s[p]){let g=Fe().getComputedStyle(u);s[p]=parseInt(g.paddingLeft,10)+parseInt(g.paddingRight,10)+parseInt(g.borderLeftWidth,10)+parseInt(g.borderRightWidth,10)+xR}if(m+=s[p],d){let g=0;u.childNodes.forEach(h=>{if(h!==c&&h.nodeType===1){let S=h,y=Math.max(S.offsetWidth,parseInt(S.style.width,10));if(isNaN(y)&&(y=0),g+=y,y>0){let T=Fe().getComputedStyle(S);g+=parseInt(T.marginLeft,10)+parseInt(T.marginRight,10)}}}),m+=g}r&&r.has(p)||n&&!n.has(p)||(l[p]=Math.max(m,l[p]||0))}),l}function Hg(){let{getComponentState:o,componentActions:e,componentState:{domRef:t,ready:n,autoSizeColumnsKey:r,brain:i}}=zt(),[a,l]=(0,In.useState)(0),s=typeof r=="object"?r.key:r,c=Le(s),u=(0,In.useRef)(null);(0,In.useEffect)(()=>{if(c()==null)return;let{current:p}=u,f=()=>{r!==p&&l(a+1)};return i.onRenderRangeChange(f)},[i]),(0,In.useEffect)(()=>{if(s==null)return;let{autoSizeColumnsKey:d}=o(),p,f,m=!0;typeof d=="object"&&(d.columnsToResize&&(p=new Set(d.columnsToResize)),d.columnsToSkip&&(f=new Set(d.columnsToSkip)),m=d.includeHeader??m),u.current=s;let g=Gg(t,{includeHeader:m,columnsToResize:p,columnsToSkip:f}),h=Object.keys(g);if(!h.length)return;let S=o().columnSizing,y={...S},T=!1;h.forEach(b=>{y[b]={width:g[b]},T=T||y[b].width!==S[b]?.width}),T&&(e.columnSizing=y)},[s,n,a])}var Qo=require("react");var Za=class{constructor(e){this.multiSelectStartPosition={rowIndex:0,colIndex:0};this.getPrimaryKeyByIndex=e.getPrimaryKeyByIndex,this.getColumnIdByIndex=e.getColumnIdByIndex}getCellSelectionPosition(e){let{rowIndex:t,colIndex:n}=e,r=this.getPrimaryKeyByIndex(t),i=this.getColumnIdByIndex(n);if(!(r===void 0||!i))return[r,i]}set cellSelectionState(e){this._cellSelectionState=e}get cellSelectionState(){return this._cellSelectionState}resetClick(e){this.cellSelectionState.deselectAll();let t=this.getCellSelectionPosition(e);t&&(this.cellSelectionState.deselectAll(),this.cellSelectionState.selectCell(...t),this.multiSelectStartPosition=e,this.multiSelectEndPosition=void 0)}singleAddClick(e){let t=this.getCellSelectionPosition(e);if(t)if(this.cellSelectionState.isCellSelected(...t)){this.cellSelectionState.deselectCell(...t);let n={rowIndex:e.rowIndex+1,colIndex:e.colIndex};this.getCellSelectionPosition(n)&&(this.multiSelectStartPosition=n)}else this.cellSelectionState.selectCell(...t),this.multiSelectStartPosition=e,this.multiSelectEndPosition=void 0}multiSelectClick(e,t){!this.multiSelectStartPosition||!this.getCellSelectionPosition(e)||(this.multiSelectEndPosition&&this.deselectRange(this.multiSelectStartPosition,this.multiSelectEndPosition,t),this.selectRange(this.multiSelectStartPosition,e,t),this.multiSelectEndPosition=e)}setRangeSelected(e,t,n,r){if(r.horizontalLayout&&!vc(e,t,r)){Og(e,t,{rowsPerPage:r.rowsPerPage,columnsPerSet:r.columnsPerSet}).forEach(u=>{let d=this.getCellSelectionPosition({rowIndex:u.rowIndex,colIndex:u.colIndex});d&&(n?this.cellSelectionState.selectCell(...d):this.cellSelectionState.deselectCell(...d))});return}let[i,a]=qa(e,t),l=this.getCellSelectionPosition(i),s=this.getCellSelectionPosition(a);if(!(!l||!s))for(let c=i.rowIndex;c<=a.rowIndex;c++)for(let u=i.colIndex;u<=a.colIndex;u++){let d=this.getCellSelectionPosition({rowIndex:c,colIndex:u});d&&(n?this.cellSelectionState.selectCell(...d):this.cellSelectionState.deselectCell(...d))}}deselectRange(e,t,n){this.setRangeSelected(e,t,!1,n)}selectRange(e,t,n){this.setRangeSelected(e,t,!0,n)}};function ER(o,e){return o<e?[o,e]:[e,o]}var Qa=class{constructor(e){this.multiSelectStartIndex=0;this.getRowAt=e.getRowAt,this.isNodeSelectable=e.isNodeSelectable??(()=>!0)}set rowSelectionState(e){this._rowSelectionState=e,this._treeSelectionState=void 0}get rowSelectionState(){return this._rowSelectionState}set treeSelectionState(e){this._treeSelectionState=e}get treeSelectionState(){return this._treeSelectionState}deselectAll(){(this._treeSelectionState??this._rowSelectionState).deselectAll()}isContainerRow(e){return e.isGroupRow||!!e.isParentNode}isExpanded(e){return e.isGroupRow?!e.collapsed:!!e.nodeExpanded}getPath(e){if(e)return this._treeSelectionState?e.nodePath:this.getGroupKeys(e)}getGroupKeys(e){return e.groupKeys&&e.groupKeys.length?e.groupKeys:void 0}setSelectedAt(e,t){let n=this.getRowAt(e);if(!n||n.rowDisabled||n.selfLoaded===!1)return;let r=this._treeSelectionState;if(r){n.nodePath&&this.isNodeSelectable(n)&&r.setNodeSelection(n.nodePath,t);return}let i=this.rowSelectionState,a=this.getGroupKeys(n);if(n.isGroupRow){if(!a)return;t?i.selectGroupRow(a):i.deselectGroupRow(a);return}t?i.selectRow(n.id,a):i.deselectRow(n.id,a)}isSelectedAt(e){let t=this.getRowAt(e);if(!t)return!1;if(this._treeSelectionState)return t.nodePath?this._treeSelectionState.isNodeSelected(t.nodePath):!1;let n=this.getGroupKeys(t);return t.isGroupRow?n?this.rowSelectionState.isGroupRowSelected(n):!1:this.rowSelectionState.isRowSelected(t.id,n)}setRangeSelected(e,t,n){let[r,i]=ER(e,t);for(let a=r;a<=i;a++){let l=this.getRowAt(a);l&&(a!==e&&this.isFollowedByItsChildren(a,l)||this.setSelectedAt(a,n))}}isFollowedByItsChildren(e,t){if(!this.isContainerRow(t)||!this.isExpanded(t))return!1;let n=this.getPath(t),r=this.getPath(this.getRowAt(e+1));return!n||!r||r.length<n.length?!1:n.every((i,a)=>i===r[a])}resetClick(e){this.deselectAll(),this.setSelectedAt(e,!0),this.multiSelectStartIndex=e,this.multiSelectEndIndex=void 0}singleAddClick(e){if(this.isSelectedAt(e))this.setSelectedAt(e,!1),this.isSelectedAt(e+1)&&(this.multiSelectStartIndex=e+1);else{this.setSelectedAt(e,!0),this.multiSelectStartIndex=e;let t;for(let n=e-1;n>=0&&this.isSelectedAt(n);n--)t=n;this.multiSelectEndIndex=t}}multiSelectClick(e){this.multiSelectEndIndex!=null&&this.setRangeSelected(this.multiSelectStartIndex,this.multiSelectEndIndex,!1),this.setRangeSelected(this.multiSelectStartIndex,e,!0),this.multiSelectEndIndex=e}};var Ah=require("react");var Mh=H(require("react"));var MR=()=>{};function Kg(o,e){let t=new q,n=e.nodesKey??"children",r=e.emptyGroup??{},i=typeof e.pathKey=="function"?e.pathKey:l=>l[e.pathKey];for(let l of o){let s=i(l);for(let c=0;c<s.length;c++){let u=s.slice(0,c);t.has(u)||t.set(u,void 0)}t.set(s,l)}function a(l,s){let c=t.getKeysStartingWith(l,{excludeSelf:!0,depthLimit:1});for(let u of c){let d=[...l,u[u.length-1]],p=t.get(d),f=p?p[n]??[]:[];a(d,f),f.length&&(p||(p=typeof r=="function"?r(d,f):r),p[n]=f),s.push(p)}return s}return a([],[])}function Bg(o,e,t,n){let{isLeafNode:r,getNodeChildren:i,toKey:a}=o,{onParentNode:l,onNode:s,onLeafNode:c}=e,u=a(n),d=[...t,u],p=r(n),f=yt(()=>{let m=i(n);if(!(!m||!Array.isArray(m)))for(let g=0,h=m.length;g<h;g++){let S=m[g];Bg(o,e,d,S)}});p?(c?.(n),s?.(n,MR)):(l?.(n,f,i(n)),s?.(n,f))}function Wg(o,e,t){for(let n=0,r=t.length;n<r;n++)Bg(o,e,[],t[n])}var AR=function(o,e){return o-e},_R=new Set(["ca","de","de-AT","en","en-DE","en-GB","en-US","fi","fr","id","id-ID","it","ms","nl","pl","pt","ro","sl","sv","sw","vi"]),Ja;function OR(){try{let o=new Intl.Collator;return _R.has(o.resolvedOptions().locale)?null:o}catch{return null}}var FR=function(o,e){return o=`${o}`,e=`${e}`,Ja===void 0&&(Ja=OR()),Ja?Ja.compare(o,e):o.localeCompare(e)},NR=function(o,e){return o-e},LR={number:AR,string:FR,date:NR},qo=LR;function jg(o){return o.map(t=>Array.isArray(t.field)?t.field.map((n,r)=>{let i=Array.isArray(t.type)?t.type[r]??t.type[0]:t.type;return typeof n=="function"?{...t,valueGetter:n,field:void 0,type:i}:{...t,type:i,field:n}}):t).flat()}var ro=(o,e,t)=>{let n=typeof t=="function"?t:t?.get,r=t&&typeof t=="object"?t.marker:void 0;return r&&r.start(),e.sort(Ug(jg(o),n)),r&&r.end(),e},el=(o,e,t)=>{let{marker:n}=t;n&&n.start();let r=Ug(jg(o),t.get),i=t.depthFirst??!1,a=t.inplace??!1;i||(a?e.sort(r):e=[...e].sort(r));let{nodesKey:l,toKey:s}=t,c=d=>d[l],u=d=>d[l]===void 0;return Wg({isLeafNode:t.isLeafNode??u,getNodeChildren:t.getNodeChildren??c,toKey:s},{onParentNode:(d,p,f)=>{if(i&&p(),Array.isArray(f)){let m=a?f.sort(r):[...f].sort(r);d[l]=m}i||p()}},e),i&&(a?e.sort(r):e=[...e].sort(r)),n&&n.end(),e};ro.knownTypes=qo;var kR=o=>{if(!o)return;let e=o.field,t=o.valueGetter,n=o.dir<0?-1:o.dir>0?1:0;if(!n)return;let r=o.fn;if(!r&&o.type){let i=Array.isArray(o.type)?o.type[0]:o.type;r=ro.knownTypes[i],r||console.warn(`Unknown sort type "${o.type}" - please pass one of ${Object.keys(ro.knownTypes).join(", ")}`)}return r||(r=qo.string),(i,a)=>{let l=t?t(i):e?i[e]:i,s=t?t(a):e?a[e]:a,c=r(l,s);return c===0?c:n*c}},zR=o=>o.map(kR).filter(e=>e instanceof Function),Ug=(o,e)=>{let t=zR(o);return(n,r)=>{e&&(n=e(n),r=e(r));let i=0,a=0,l,s=t.length;for(;a<s;a++)if(l=t[a],!!l&&(i=l(n,r),i!==0))return i;return i}};var VR=H(require("react"));function tl(o){return Ne(e=>o(e.dataSourceState))}var GR=Ye("IT:InfiniteTable"),HR="#dc3545",KR="#eb9316";var Yg="Warn",qg="Error",BR="Info",WR="Success",jR="Logs",ol=GR.extend(jR),Jz=ol.extend(BR),UR=ol.extend(Yg),$R=ol.extend(qg),eV=ol.extend(WR);var YR=KR,qR=HR;var XR=(o,e)=>{e=e?e.extend?e.extend(Yg):e:UR,e(typeof e.color=="function"?e.color(YR,o):o)},ZR=(o,e)=>{e=e?e.extend?e.extend(qg):e:$R,e(typeof e.color=="function"?e.color(qR,o):o)};var $g=new q,Xg=(o,...e)=>{$g.has(e)||($g.set(e,!0),o())};var Zg=(o,e=o,t)=>{Xg(()=>XR(o,t),e,"warn")},Qg=(o,e=o,t)=>{Xg(()=>ZR(o,t),e,"error")};var Mc=new WeakMap,QR=o=>o;function Jg(o,e=50,t){Mc.set(o,{lastCallTime:0,lastCallArg:null});let n=t??QR;return r=>{let{lastCallTime:i,lastCallArg:a}=Mc.get(o)||{lastCallTime:0,lastCallArg:null},l=Date.now(),s=l-i,c=wt(n(a),n(r));s<e&&c||(Mc.set(o,{lastCallTime:l,lastCallArg:r}),o(r))}}var nl=class{constructor(){this.primaryKeyToData=new Map;this.nodePathsToData=new q;this.removeNodePath=(e,t)=>{if(this.nodePathsToData.delete(e),this.remove(e[e.length-1]),!t)return;let n=this.nodePathsToData.get(e);if(n){let r=t.getNodeChildren?t.getNodeChildren(n):t.nodesKey?n[t.nodesKey]:null;if(r&&Array.isArray(r))for(let i=0,a=r.length;i<a;i++){let l=r[i],s=[...e,t.toPrimaryKey(l)];this.removeNodePath(s,t)}}};this.remove=e=>{this.primaryKeyToData.delete(e)};this.add=(e,t)=>{this.primaryKeyToData.set(e,t)};this.addNodePath=(e,t,n)=>{if(this.nodePathsToData.set(e,t),this.add(e[e.length-1],t),!n)return;let r=n.getNodeChildren?n.getNodeChildren(t):n.nodesKey?t[n.nodesKey]:null;if(r&&Array.isArray(r))for(let i=0,a=r.length;i<a;i++){let l=r[i],s=[...e,n.toPrimaryKey(l)];this.addNodePath(s,l,n)}};this.clear=()=>{this.primaryKeyToData.clear(),this.nodePathsToData.clear()};this.getDataForPrimaryKey=e=>this.primaryKeyToData.get(e);this.getDataForNodePath=e=>this.nodePathsToData.get(e);this.indexArray=(e,t)=>{let{cache:n,toPrimaryKey:r,getNodeChildren:i,isLeafNode:a,nodesKey:l}=t,s=!!i&&!!a;n&&n.shouldResetDataSource()&&(this.clear(),e=[]);let c=n&&!n.isEmpty();if(c&&(e=e.concat()),!e.length&&n){if(!n.isEmpty()){let u=[...n.getMutationsArray(),...n.getTreeMutationsArray()];for(let d=0,p=u.length;d<p;d++){let f=u[d];if(f.type==="insert"){let m=r(f.data);s?this.addNodePath([m],f.data,t):this.add(m,f.data),e.push(f.data)}}n?.removeInfo(void 0)}}else{let u=(d,p)=>{for(let f=0;f<d.length;f++){let m=d[f];c&&s&&Array.isArray(m[l])&&(m=d[f]={...m});let g=!1;if(m!=null){let h=r(m),S=s?[...p,h]:void 0,y=s&&!!S,T=y?n?.getMutationsForNodePath(S):n?.getMutationsForPrimaryKey(h);if(T&&T.length){for(let b=0,R=T.length;b<R;b++){let C=T[b];if(C.type==="delete"&&!g&&(y?this.removeNodePath(S,t):this.remove(h),g=!0,d.splice(f,1),f--),C.type==="update"&&!g&&(m={...m,...C.data},d[f]=m),C.type==="update-children"&&!g){let I=C.children(m[l],m);m={...m},I!==void 0?m[l]=I:delete m[l],d[f]=m}C.type==="insert"&&(C.position==="before"?(d.splice(f,0,C.data),f--):d.splice(f+1,0,C.data))}y?n?.removeNodePathInfo(S):n?.removeInfo(h)}if(!g)if(y){this.addNodePath(S,m);let b=a(m),R=b?null:i(m);!b&&Array.isArray(R)&&(p.push(h),c&&(m[l]=R=R.concat()),u(R,p),p.pop())}else this.add(h,m)}}};u(e,[])}return e}}};var JR=Object.freeze([]),eh=(o,e)=>{let t=o??JR,n=Array.isArray(t)?t:[t];if(e&&e.has(t)){let r=e.get(t);if(r&&r.length===n.length)return r}return e&&t&&e.set(t,n),n};var Et=class extends pr{constructor(t){super(t);this.isRowEnabled=t=>!!this.isItemPositive(t)}getState(){let t=this.allPositive?!0:[...this.positiveMap?.keys()??[]],n=this.allNegative?!0:[...this.negativeMap?.keys()??[]];return{enabledRows:t,disabledRows:n}}getPositiveFromState(t){return t.enabledRows}getNegativeFromState(t){return t.disabledRows}areAllDisabled(){return this.areAllNegative()}areAllEnabled(){return this.areAllPositive()}disableAll(){this.makeAllNegative()}enableAll(){this.makeAllPositive()}isRowDisabled(t){return!this.isRowEnabled(t)}setRowEnabled(t,n){return this.setItemValue(t,n)}disableRow(t){this.setRowEnabled(t,!1)}enableRow(t){this.setRowEnabled(t,!0)}toggleRow(t){this.toggleItem(t)}};function rl(o,e){if(o===e)return!0;if(o==null||e==null)return o===e;if(typeof o!=typeof e)return!1;if(Array.isArray(o)&&Array.isArray(e)){if(o.length!==e.length)return!1;for(let t=0,n=o.length;t<n;t++)if(!rl(o[t],e[t]))return!1;return!0}if(typeof o=="object"){let t=Object.keys(o),n=Object.keys(e);if(t.length!==n.length)return!1;for(let r of t)if(!Object.prototype.hasOwnProperty.call(e,r)||!rl(o[r],e[r]))return!1;return!0}return!1}function eI(o,e){return!(o===void 0||e===void 0||o.isGroupRow!==e.isGroupRow||o.dataSourceHasGrouping!==e.dataSourceHasGrouping||o.isTreeNode!==e.isTreeNode||o.isTreeNode&&o.isParentNode!==e.isParentNode)}var il={id:!0,value:!0,indexInAll:!0,rowSelected:!0,rowDisabled:!0,isCellSelected:!1,hasSelectedCells:!1},th={...il,dataSourceHasGrouping:!0,isTreeNode:!0,data:!1,isGroupRow:!0,selfLoaded:!0},tI={indexInGroup:!0,groupKeys:!0,groupBy:!0,rootGroupBy:!0,parents:!1,indexInParentGroups:!0,groupCount:!0,groupNesting:!0,collapsed:!0,selfLoaded:!0},oI={...il,...tI,dataSourceHasGrouping:!0,isTreeNode:!0,data:!1,reducerData:!0,isGroupRow:!0,duplicateOf:!1,deepRowInfoArray:!1,error:!0,reducerResults:!0,groupCount:!0,groupData:!0,selectedChildredCount:!0,deselectedChildredCount:!0,totalChildrenCount:!0,collapsedChildrenCount:!0,collapsedGroupsCount:!0,directChildrenCount:!0,directChildrenLoadedCount:!0,pivotValuesMap:!0,childrenAvailable:!0,childrenLoading:!0},oh={isTreeNode:!0,isParentNode:!0,indexInParent:!0,nodePath:!0,parentNodes:!1,indexInParentNodes:!0,totalLeafNodesCount:!0,collapsedLeafNodesCount:!0,treeNesting:!0,selfLoaded:!0},nI={...il,...oh,dataSourceHasGrouping:!0,isTreeNode:!0,isGroupRow:!0,isParentNode:!0,data:!1},rI={...il,...oh,dataSourceHasGrouping:!0,isParentNode:!0,isGroupRow:!0,nodeExpanded:!0,selfExpanded:!0,data:!1,selectedLeafNodesCount:!0,deepRowInfoArray:!1,deselectedLeafNodesCount:!0,duplicateOf:!1},iI=Object.entries(th).map(([o,e])=>e?o:void 0).filter(Boolean),aI=Object.entries(th).map(([o,e])=>e?o:void 0),lI=Object.entries(oI).map(([o,e])=>e?o:void 0),sI=Object.entries(nI).map(([o,e])=>e?o:void 0),cI=Object.entries(rI).map(([o,e])=>e?o:void 0);function uI(o,e){if(o===e)return!0;if(!o||!e||!eI(o,e)||o.id!==e.id||o.data!==e.data&&!rl(o.data,e.data))return!1;let t=[];o.dataSourceHasGrouping?t=o.isGroupRow?lI:aI:o.isTreeNode?t=o.isTreeNode&&o.isParentNode?cI:sI:t=iI;for(let n of t){let r=o[n],i=e[n];if(!(typeof r=="function"||typeof i=="function")&&!rl(r,i))return!1}return!0}function nh(){let o=[],e=new Map,t=new Set,n={dataSourceState:void 0,previousDataSourceState:void 0},r=(p,f)=>{let m=o,g=f?.marker,S=p!==m&&t.size>0;S&&(n={dataSourceState:f?.dataSourceState,previousDataSourceState:f?.previousDataSourceState}),g&&g.start({details:[{name:"new dataArray length",value:p.length},{name:"old dataArray length",value:m.length}]});let y=[],T=l();for(let b of T){let R=m[b],C=p[b];if(C===void 0){y.push(b);continue}uI(R,C)||y.push(b)}o=p,(y.length>0||S)&&queueMicrotask(()=>{for(let b=0,R=y.length;b<R;b++){let C=y[b],I=e.get(C);if(I)for(let w of I)w()}if(S)for(let b of Array.from(t))b()}),g&&g.end({details:[{name:"updated row infos",value:y.length}]})},i=p=>o[p],a=(p,f)=>{let m=e.get(p);return m||(m=new Set,e.set(p,m)),m.add(f),()=>{let g=e.get(p);g&&(g.delete(f),g.size===0&&e.delete(p))}},l=()=>Array.from(e.keys());return{notifyDataArray:r,getRowInfoAtIndex:i,subscribeToRowIndex:a,subscribeToDataArrayChange:p=>(t.add(p),()=>{t.delete(p),t.size===0&&(n={dataSourceState:void 0,previousDataSourceState:void 0})}),getDataSourceStates:()=>n,getDataArray:()=>o,clear:()=>{o=[],e.clear(),t.clear(),n={dataSourceState:void 0,previousDataSourceState:void 0}}}}var Co=new Map,Ro=new Map,Xo=new Map,Io=new Map,io=new Map;var dI=Symbol("cursorId"),rh=o=>o.totalLeafNodesCount===0,pI=o=>o.isParentNode?!rh(o):!0;function ih(o){let e=Date.now(),t=[],n=[],r=new q;return{logger:Lt(`${o.debugId}:DataSource`),debugTimings:new Map,debugWarnings:new Map,devToolsDetected:!!globalThis.__INFINITE_TABLE_DEVTOOLS_HOOK__,rowInfoStore:nh(),indexer:new nl,totalLeafNodesCount:0,__apiRef:{current:null},repeatWrappedGroupRows:!1,destroyedRef:{current:!1},lastSelectionUpdatedNodePathRef:{current:null},lastExpandStateInfoRef:{current:{state:"collapsed",nodePath:null}},idToIndexMap:new Map,idToPathMap:new Map,pathToIndexMap:new q,waitForNodePathPromises:new q,getDataSourceMasterContextRef:{current:()=>{}},cache:void 0,detailDataSourcesStateToRestore:new Map,stateReadyAsDetails:!1,originalDataArrayChanged:!1,originalDataArrayChangedInfo:{timestamp:0,mutations:void 0},rowsPerPage:null,lazyLoadCacheOfLoadedBatches:new q,dataParams:void 0,onCleanup:Ce(),notifyScrollbarsChange:Ce(),notifyScrollStop:Ce(),notifyRenderRangeChange:Ce(),pivotTotalColumnPosition:"end",pivotGrandTotalColumnPosition:!1,scrollStopDelayUpdatedByTable:100,originalLazyGroupData:r,originalLazyGroupDataChangeDetect:0,originalDataArray:t,cursorId:dI,showSeparatePivotColumnForSingleAggregation:!1,propsCache:new Map([["sortInfo",new WeakMap],["rowDisabledState",new WeakMap],["isRowDisabled",new WeakMap],["cellSelection",new WeakMap],["treeSelection",new WeakMap],["treeExpandState",new WeakMap],["groupRowsState",new WeakMap]]),rowInfoReducerResults:void 0,pivotMappings:void 0,pivotColumns:void 0,pivotColumnGroups:void 0,dataArray:n,unfilteredCount:n.length,filteredCount:n.length,updatedAt:e,groupedAt:0,sortedAt:0,treeAt:0,filteredAt:0,reducedAt:e,generateGroupRows:!0,groupDeepMap:void 0,reducerResults:void 0,allRowsSelected:!1,someRowsSelected:!1,postSortDataArray:void 0,postGroupDataArray:void 0,lastSortDataArray:void 0,lastGroupDataArray:void 0,forceRerenderTimestamp:0}}function fI(o){let e={...o};return delete e.originalDataArray,e}var mI=[],ah=o=>{o.destroyedRef.current=!0,o.__apiRef.current=null,o.lastSelectionUpdatedNodePathRef.current=null,o.lastExpandStateInfoRef.current={state:"collapsed",nodePath:null},o.treeExpandState?.destroy(),o.treePaths?.clear(),o.unfilteredTreePaths?.clear(),o.waitForNodePathPromises.clear(),o.pathToIndexMap?.clear(),o.rowDisabledState?.destroy(),o.groupRowsState?.destroy(),o.treeSelectionState?.destroy(),o.idToPathMap.clear(),o.idToIndexMap.clear(),o.rowInfoStore.clear()},lh=(o,e)=>({onDataParamsChange:t=>t?Jg(t,100,fI):void 0,lazyLoad:t=>!!t,isNodeReadOnly:t=>t??rh,isNodeSelectable:t=>t??pI,data:1,nodesKey:1,isNodeExpanded:1,isNodeCollapsed:1,pivotBy:1,primaryKey:1,livePagination:1,treeSelection:1,refetchKey:t=>t??"",filterFunction:1,treeFilterFunction:1,filterValue:1,useGroupKeysForMultiRowSelection:t=>t??!1,multiRowSelectionTarget:t=>t??"all",filterDelay:t=>t??200,filterTypes:t=>({...No,...t}),sortTypes:t=>({...qo,...t}),sortFunction:1,onReady:1,rowInfoReducers:(t,n)=>{let r={initialValue:()=>{n.idToIndexMap.clear()},reducer:(a,l)=>{e.debugId&&!e.nodesKey&&n.idToIndexMap.has(l.id)&&console.warn(`Duplicate id found in data source: ${l.id}`),n.idToIndexMap.set(l.id,l.indexInAll)}},i=t?{...t,__idToIndex:r}:{__idToIndex:r};if(e.nodesKey){let a={initialValue:()=>{n.idToPathMap.clear(),n.pathToIndexMap.clear()},reducer:(l,s)=>{s.isTreeNode&&(n.idToPathMap.set(s.id,s.nodePath),e.debugId&&n.pathToIndexMap.has(s.nodePath)&&console.warn(`Duplicate node path found in data source (debugId: ${e.debugId||"none"}): ${s.nodePath}`),n.pathToIndexMap.set(s.nodePath,s.indexInAll))}};i.__pathToIndex=a}return i},onNodeCollapse:1,onNodeExpand:1,batchOperationDelay:1,isRowSelected:1,isNodeSelected:1,isRowDisabled:1,rowDisabledState:t=>{if(!t)return null;if(t instanceof Et)return t;let n=o.propsCache.get("rowDisabledState"),r=n.get(t);return r||(r=new Et(t),n.set(t,r)),t=r,t??null},onDataArrayChange:1,onDataMutations:1,onTreeDataMutations:1,aggregationReducers:1,collapseGroupRowsOnDataFunctionChange:t=>t??!0,loading:t=>t??!1,sortInfo:t=>eh(t,o.propsCache.get("sortInfo")),groupBy:t=>t??mI});function gI(o,e){return typeof o=="function"?o({array:e.originalDataArray,length:e.originalDataArray.length,lastItem:e.originalDataArray[e.originalDataArray.length-1]}):o}function hI(o){if(typeof o=="boolean")return{filterValue:o,sortInfo:o,groupBy:o,pivotBy:o};let e={};return o.filterValue!=null&&(e.filterValue=o.filterValue),o.sortInfo!=null&&(e.sortInfo=o.sortInfo),o.groupBy!=null&&(e.groupBy=o.groupBy),o.pivotBy!=null&&(e.pivotBy=o.pivotBy),e}var yI={selectedPaths:[],deselectedPaths:[],defaultSelection:!1};function sh(o,e,t){if(e!="multi-row")throw new Error(`TreeSelectionState is only supported for multi-row selection. Your current selection mode is "${e}". See https://infinite-table.com/docs/reference/datasource-props#selectionMode for details.
1
+ "use strict";var PT=Object.create;var Ci=Object.defineProperty;var xT=Object.getOwnPropertyDescriptor;var DT=Object.getOwnPropertyNames;var MT=Object.getPrototypeOf,ET=Object.prototype.hasOwnProperty;var AT=(n,e)=>()=>(e||n((e={exports:{}}).exports,e),e.exports),_T=(n,e)=>{for(var t in e)Ci(n,t,{get:e[t],enumerable:!0})},Pu=(n,e,t,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of DT(e))!ET.call(n,r)&&r!==t&&Ci(n,r,{get:()=>e[r],enumerable:!(o=xT(e,r))||o.enumerable});return n};var H=(n,e,t)=>(t=n!=null?PT(MT(n)):{},Pu(e||!n||!n.__esModule?Ci(t,"default",{value:n,enumerable:!0}):t,n)),OT=n=>Pu(Ci({},"__esModule",{value:!0}),n);var ro=AT((AE,_p)=>{"use strict";_p.exports=function(n,e,t,o,r){var i,a;if(o===void 0)o=0;else if(o=o|0,o<0||o>=n.length)throw new RangeError("invalid lower bound");if(r===void 0)r=n.length-1;else if(r=r|0,r<o||r>=n.length)throw new RangeError("invalid upper bound");for(;o<=r;)if(i=o+(r-o>>>1),a=+t(n[i],e,i,n),a<0)o=i+1;else if(a>0)r=i-1;else return i;return~o}});var $v={};_T($v,{AutoScroller:()=>mo,CellSelectionState:()=>Ue,DRAG_ITEM_ATTRIBUTE:()=>bt,DataClient:()=>yu,DataSource:()=>bw,DataSourceActionType:()=>_h,DeepMap:()=>U,DragDropProvider:()=>Ji,DragInteractionTarget:()=>ir,DragList:()=>Wn,FixedSizeSet:()=>zl,FlashingColumnCell:()=>lT,GroupRowsState:()=>xt,INTERNAL_MatrixDebugger:()=>cT,InfiniteTable:()=>un,InfiniteTableClassName:()=>Jt,InfiniteTableComponent:()=>Xb,Menu:()=>sn,RowDetailCache:()=>fr,RowDetailState:()=>At,RowDisabledState:()=>Dt,RowSelectionState:()=>Oe,TreeDataSource:()=>Gv,TreeExpandState:()=>ft,TreeGrid:()=>Jb,TreeSelectionState:()=>Je,WeakFixedSizeSet:()=>Gl,alignNode:()=>bl,components:()=>Uv,createDefaultProxy:()=>Ia,createFlashingColumnCellComponent:()=>Su,debounce:()=>Nt,debug:()=>Ye,defaultDragProxyMove:()=>Ra,defaultFilterFunction:()=>Cc,defaultFilterTypes:()=>Nn,defaultTreeFilterFunction:()=>ja,eventMatchesKeyboardShortcut:()=>hl,filterDataArray:()=>Vc,filterTypes:()=>Nn,flatten:()=>pf,getComponentStateRoot:()=>kt,group:()=>ua,interceptMap:()=>tT,keyboardShortcuts:()=>eT,multisort:()=>Ut,multisortNested:()=>Qa,queryKeyToCacheKey:()=>Eo,toTreeDataArray:()=>Bg,useComponentState:()=>zt,useDataSourceApi:()=>Ah,useDataSourceInternal:()=>pr,useDataSourceSelector:()=>Ne,useDataSourceState:()=>Ja,useDragDropProvider:()=>fn,useDragListContext:()=>go,useEffectWhen:()=>Kl,useEffectWhenSameDeps:()=>nT,useEffectWithChanges:()=>wo,useEffectWithObject:()=>dw,useGridScroll:()=>El,useInfiniteColumnApi:()=>qb,useInfiniteColumnCell:()=>Ur,useInfiniteColumnEditor:()=>ga,useInfiniteColumnFilterEditor:()=>jo,useInfiniteHeaderCell:()=>Nr,useInfinitePortalContainer:()=>Cb,useInfiniteTableApi:()=>Yb,useLayoutEffectWithChanges:()=>uw,useManagedDataSource:()=>Hc,useMasterRowInfo:()=>En,useOverlay:()=>ln,useOverlayPortal:()=>Yy,usePrevious:()=>On,useRowInfoReducers:()=>Tw,useVisibleColumnSizes:()=>fb,withSelectedLeafNodesOnly:()=>hu});module.exports=OT($v);function Nt(n,{wait:e}){let t=null;return function(...o){let r=this;t!==null&&clearTimeout(t),t=setTimeout(()=>{n.apply(r,o)},e)}}var De=H(require("react"));var $=(...n)=>n.filter(e=>!!`${e}`).join(" ");var to=H(require("react")),es=require("react");var FT=H(require("react")),xn=require("react");var Oo=(n,e,t={debounce:0})=>{let o=t.debounce??0,r=window.ResizeObserver,i=o?Nt(e,{wait:o}):e,a=new r(l=>{let s=l[0],{width:c,height:u}=s.contentRect;if(s.borderBoxSize?.[0])u=s.borderBoxSize[0].blockSize,c=s.borderBoxSize[0].inlineSize;else{let d=n.getBoundingClientRect();u=d.height,c=d.width}i({width:c,height:u})});return a.observe(n),()=>{a.disconnect()}};var Ii=(n,e,t={earlyAttach:!1,debounce:0})=>{let o=(0,xn.useRef)({width:0,height:0}),r=i=>{let a;return n.current&&(a=Oo(n.current,l=>{l={width:Math.round(l.width),height:Math.round(l.height)};let s=o.current;(s.width!==l.width||s.height!==l.height)&&(o.current=l,i(l))},{debounce:t.debounce})),()=>{a&&a()}};(0,xn.useEffect)(()=>t.earlyAttach?()=>{}:r(e),[n.current,e,t.earlyAttach,t.debounce]),(0,xn.useLayoutEffect)(()=>t.earlyAttach?r(e):()=>{},[n.current,e,t.earlyAttach])};function Se(n=!1){let e=null,t=[],o=null,r=(i,a)=>{let l=[];if(n)o!=null&&(cancelAnimationFrame(o),o=null),requestAnimationFrame(()=>{e=i,o=null;for(let s=0,c=t.length;s<c;s++)l.push(t[s](i));a?.(l)});else{e=i;for(let s=0,c=t.length;s<c;s++)l.push(t[s](i));a?.(l)}};return r.get=()=>e,r.onChange=i=>(t.push(i),()=>{t=t.filter(a=>a!==i)}),r.destroy=()=>{r(null),t.length=0},r.getListenersCount=()=>t.length,r}function ht(n){let e=!1,t=null;return(...r)=>(e||(e=!0,t=n(...r)),t)}var xu=(n,e)=>n-e;var Ri=(n,e)=>xu(n.revision,e.revision),U=class n{constructor(e){this.map=new Map;this.length=0;this.revision=0;this.mutations=0;this.emptyKey=Symbol("emptyKey");this.visit=e=>{this.map.forEach((t,o)=>this.visitKey(o,this.map,[],e,!1))};this.visitSome=e=>{this.visitWithNext([],e,!0)};this.visitDepthFirst=e=>{this.visitWithNext([],e,!1)};this.visitWithNext=(e,t,o,r=this.map,i,a)=>{if(!r)return;let l=0,s=r.has(this.emptyKey),c=!a;if(i!==void 0){if(i<0)return;i--}let u=(d,p)=>{let f=r.get(p);if(!f)return;let{map:m}=f,g=p===this.emptyKey;if(g&&!c)return;let h=g?[]:[...e,p],S=m?()=>this.visitWithNext(h,t,o,m,i!==void 0?i-1:void 0):void 0;if(f.hasOwnProperty("value")){let y=t(f.value,h,l,S,f);if(o&&y===!0)return!0;l++}else S?.()};s&&(u(void 0,this.emptyKey),c=!1,l=0);for(let[d,p]of r){let f=u(p,d);if(o&&f===!0)return f}};this.fill(e)}get version(){return this.mutations}static clone(e){let t=new n;return e.visit((o,r)=>{t.set(r,o.value)}),t}fill(e){e&&e.forEach(t=>{let[o,r]=t;this.set(o,r)})}getValuesStartingWith(e,t){let o=[];return this.getStartingWith(e,(r,i)=>{o.push(i)},t),o}getEntriesStartingWith(e,t){let o=[];return this.getStartingWith(e,(r,i)=>{o.push([r,i])},t),o}getLeafNodesStartingWith(e,t,o){let{respectOrder:r=!1}=o||{},i=[],a=[];return this.getStartingWith(e,(l,s,c)=>{!c.map&&c.hasOwnProperty("value")&&(r?i.push(c):a.push(t(c)))},o),r?i.sort(Ri).map(t):a}getKeysForLeafNodesStartingWith(e,t){return this.getLeafNodesStartingWith(e,o=>o.keys,t)}getKeysAndValuesForLeafNodesStartingWith(e,t){return this.getLeafNodesStartingWith(e,o=>[o.keys,o.value],t)}getKeysOfFirstChildOnEachBranchStartingWith(e,t){let{excludeSelf:o,depthLimit:r,respectOrder:i=!0}=t||{},a=[],l=[],s=p=>{i?a.push(p):l.push(p.keys)},c=this.map,u,d=!1;if(e.length)for(let p=0,f=e.length;p<f;p++){let m=e[p];if(u=c.get(m),!u||!u.map)if(d=!0,p===f-1){d=!0;break}else return[];c=u.map}else if(!o&&c.has(this.emptyKey))return[[]];return u&&u.value!==void 0&&(o||(s({...u,keys:e}),d=!0)),d?i?a.sort(Ri).map(p=>p.keys):l:(this.visitWithNext(e,(p,f,m,g,h)=>{s({...h,keys:f})},!1,c,r,o),i?a.sort(Ri).map(p=>p.keys):l)}getKeysStartingWith(e,t){let o=[];return this.getStartingWith(e,r=>{o.push(r)},t),o}getStartingWith(e,t,o){let{excludeSelf:r,depthLimit:i}=o||{},a=this.map,l,s=!1;if(e.length)for(let c=0,u=e.length;c<u;c++){let d=e[c];if(l=a.get(d),!l||!l.map)if(s=!0,c===u-1){s=!0;break}else return;a=l.map}l&&l.value!==void 0&&(r||t(e,l.value,{...l,keys:e})),!s&&this.visitWithNext(e,(c,u,d,p,f)=>{t(u,c,{...f,keys:u}),p?.()},!1,a,i,r)}getMapAt(e){let t=this.map,o;if(!e.length)return this.map;for(let r=0,i=e.length;r<i;r++){let a=e[r];if(o=t.get(a),!o||!o.map)return;t=o.map}return t}getAllChildrenSizeFor(e){let t=this.map,o;if(!e.length)return this.length;for(let r=0,i=e.length;r<i;r++){let a=e[r];if(o=t.get(a),!o||!o.map)return 0;t=o.map}return o.length}getDirectChildrenSizeFor(e){let t=this.map;e.length||(e=[this.emptyKey]);for(let o=0,r=e.length;o<r;o++){let i=e[o],a=o===r-1,l=t.get(i);if(!l||!l.map)return 0;if(t=l.map,a)return t?.size??0}return 0}set(e,t){let o=this.map;this.mutations++,e.length||(e=[this.emptyKey]);for(let r=0,i=e.length;r<i;r++){let a=e[r],l=r===i-1,s=o.get(a)||{length:0};l?(s.revision=this.revision++,s.value=t,o.set(a,s),this.length++):(s.map||(s.map=new Map,o.set(a,s)),s.length++,o=s.map)}return this}get(e){let t=this.map;e.length||(e=[this.emptyKey]);for(let o=0,r=e.length;o<r;o++){let i=e[o],a=o===r-1,l=t.get(i);if(a)return l?l.value:void 0;if(!l||!l.map)return;t=l.map}}get size(){return this.length}clear(){let e=t=>{t.forEach((o,r)=>{let{map:i}=o;i&&e(i)}),t.clear()};e(this.map),this.length=0,this.revision=0,this.mutations++}delete(e){let t=this.map;this.mutations++,e.length?e=[...e]:e=[this.emptyKey];let o=[t],r=[],i=!1;for(let a=0,l=e.length;a<l;a++){let s=e[a],c=a===l-1,u=t.get(s);if(c){u&&(u.hasOwnProperty("value")&&(delete u.value,delete u.revision,i=!0,r.forEach(d=>{d.length--}),this.length--),u.map&&u.map.size===0&&delete u.map,u.map||t.delete(s));break}else{if(!u||!u.map){i=!1;break}r.push(u),t=u.map,o.push(t)}}for(;o.length;){let a=o.pop(),l=e.length;if(e.pop(),l>0&&a?.size===0){let s=o[o.length-1],c=e[e.length-1],u=s?.get(c);u&&(delete u.map,u.hasOwnProperty("value")||s.delete(c))}}return i}has(e){let t=this.map;e.length||(e=[this.emptyKey]);for(let o=0,r=e.length;o<r;o++){let i=e[o],a=o===r-1,l=t.get(i);if(a)return l?l.hasOwnProperty("value"):!1;if(!l||!l.map)return!1;t=l.map}return!1}visitKey(e,t,o,r,i){let a=t.get(e);if(!a)return;let{map:l}=a,s=e===this.emptyKey?[]:[...o,e],c=ht(()=>{if(l)for(let[u]of l){let d=this.visitKey(u,l,s,r,i);if(i&&d===!0)return!0}return!1});if(a.hasOwnProperty("value")){let u=r(a,s,c);if(i&&u===!0)return!0}c()}getArray(e){let t=[];return this.visit((o,r)=>{let i=e({...o,keys:r});r.length===0?t.splice(0,0,i):t.push(i)}),t}rawKeysAt(e){let t=this.getMapAt(e);return t?[...t.keys()]:[]}valuesAt(e){let t=this.getMapAt(e);if(!t)return[];let o=[];return t.forEach(r=>{r.value!==void 0&&o.push(r.value)}),o}values(){return this.sortedIterator(e=>e.value)}keys(){return this.sortedIterator(t=>t.keys)}entries(){return this.sortedIterator(e=>[e.keys,e.value])}topDownEntries(){return this.getArray(e=>[e.keys,e.value])}topDownKeys(){return this.getArray(e=>e.keys)}topDownValues(){return this.getArray(e=>e.value)}sortedIterator(e){let t=[];this.visit((r,i)=>{t.push({...r,keys:i})}),t.sort(Ri);function*o(){for(let r=0,i=t.length;r<i;r++)yield e(t[r])}return o()}};globalThis.DeepMap=U;function Fe(){return globalThis}var vi=["#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],Du=Symbol("color"),wi=new WeakMap,$l=Se();function Yl(n=vi){wi.set(n,n.map(e=>0))}Yl();var NT=(n=vi)=>{let e=[];wi.has(n)?e=wi.get(n):(e=n.map(o=>0),wi.set(n,e));let t=e.reduce((o,r,i,a)=>r<a[o]?i:o,0);return e[t]!=null&&e[t]++,n[t]??n[0]??vi[0]},Pr=":",ql="*",Mu="-",LT=",",kT="debug",zT="diffdebug",Au=!1,vr=new U,xr=new Map;function Xl(n,e){let t=n.split(Pr),o=new U;o.set(t,!0);let r=e.split(Pr),i=new Set(r).has(ql),a=r.indexOf(ql),l=i?r.slice(0,a):r;if(o.getKeysStartingWith(l,{excludeSelf:i}).length>0){let s=r.slice(a+1);return s.length?n.endsWith(s.join(Pr)):!0}}function _u(n,e){let t=`channel=${n}_permissions=${e}`;if(xr.has(t))return xr.get(t);let o=e.split(LT);function r(l){return xr.set(t,l),l}let i=[],a=[];o.forEach(l=>{l.includes(ql)?a.push(l):i.push(l)});for(let l=0;l<i.length;l++){let s=i[l],c=s.startsWith(Mu);if(c&&(s=s.substring(Mu.length)),Xl(n,s))return r(!c)}for(let l=0;l<a.length;l++){let s=a[l],c=s.startsWith("-");if(c&&(s=s.substring(1)),Xl(n,s))return r(!c)}return r(!1)}var Zl=()=>Ye.enable??(Fe()&&Fe().localStorage?.getItem(kT))??"",VT=()=>Ye.diffenable??(Fe()&&Fe().localStorage?.getItem(zT))??`${Au}`,Ql="",Ou=Au;function Jl(n){Ou=`${VT()}`=="true",Ql!==n&&(Ql=n,xr.clear())}function Fu(n){Jl(Zl()),typeof Fe()<"u"&&Fe().addEventListener&&Fe().addEventListener("storage",function(){Jl(Zl())});function e(t,o){let r=o?`${o}${Pr}${t}`:t,i=r.split(Pr),a=vr.get(i);if(a)return a;let l=vr.get(i.slice(0,-1)),s=(l?l.logFn:Ye.logFn)??Nu,c=s,u,d=0,p=()=>u??_u(r,Ql),f=NT(Ye.colors),m=Object.defineProperties((...g)=>{let h=$l.getListenersCount(),S;if(h>0&&(S=S??Date.now(),$l({color:f,channel:r,args:g,timestamp:S})),p()){if(S=S??Date.now(),d&&Ou){let T=S-d;c(`%c[${r}]`,`color: ${f}`,`+${T}ms:`)}d=S;let y=[],C;if(g.forEach(T=>{if(T[Du])C===void 0&&(C=!0),y.push(...T);else{if(typeof T!="string"&&typeof T!="number"){C=!1;return}y.push(`${T}%s`)}}),C){let T=[`%c[${r}]%c %s`,`color: ${f}`,"",...y,""];c(...T)}else c(`%c[${r}]%c %s`,`color: ${f}`,"",...g)}},{channel:{value:r},color:{value:(g,...h)=>{let S=[`%c${h.join(" ")}%c%s`,`color: ${g}`,""];return S.toString=()=>h.join(" "),S[Du]=!0,S}},extend:{value:g=>e(g,r)},enabled:{get:()=>p(),set:g=>{u=g}},logFn:{configurable:!1,get:()=>c,set:g=>{c=g??s}},destroy:{value:()=>{vr.delete(i)}}});return vr.set(i,m),m}return e(n)}var Nu=console.log.bind(console),Eu;Object.defineProperty(Fu,"enable",{get:()=>Eu,set:n=>{Eu=n,Jl(Zl())}});var Ye=Fu;Ye.colors=vi;Ye.logFn=Nu;var GT=(n,e)=>$l.onChange(t=>{if(!t)return;let{channel:o,args:r,color:i,timestamp:a}=t;Xl(o,n)&&e({channel:o,color:i,args:r,timestamp:a})});Ye.onLogIntent=GT;Ye.isChannelEnabled=_u;Ye.destroyAll=()=>{Yl(),Yl(Ye.colors),vr.clear(),xr.clear()};var Lt=n=>{let e=Ye(n?`IT:${n}:TYPE=debug`:"IT:TYPE=debug");return e.logFn=console.log.bind(console),e},Dn=n=>{let e=Ye(n?`IT:${n}:TYPE=error`:"IT:TYPE=error");return e.logFn=console.error.bind(console),e},Dr=()=>Dr;Dr.extend=()=>Dr;var It=class{constructor(e){this.debug=Dr,this.error=Dr}};var Lu=Dn("CSSVariableWatch"),ku=Lt("CSSVariableWatch"),zu={position:"absolute",pointerEvents:"none",width:"0px",height:"0px",lineHeight:0,fontSize:0,overflow:"hidden"};function Vu(n){return n.startsWith("var(")||n.startsWith("calc(")?n:`var(${n})`}var HT=n=>{let e=(0,es.useRef)(0),t=to.useCallback(({height:o})=>{o!=null&&o!==e.current&&(e.current=o,n.onChange(o))},[n.onChange]);Ii(n.ref,t,{earlyAttach:!0}),to.useLayoutEffect(()=>{let o=n.ref.current.getBoundingClientRect().height;if(o!=null)return e.current=o,ku(`Variable ${n.varName} found and equals ${o}.`),n.onChange(o);Lu(`Specified variable ${n.varName} not found or does not have a numeric value.`)},[])},Mr=n=>{let e=(0,es.useRef)(null);HT({...n,ref:e});let t=Vu(n.varName),{allowInts:o=!1}=n;return to.createElement("div",{"data-name":"css-variable-watcher","data-var":n.varName,style:zu},to.createElement("div",{ref:e,style:{height:o?`calc(1px * ${t})`:t}}))};var Lo=require("react");function Mn(){let n=null,e=new Set;return{getSnapshot(){return n},setSnapshot(t){n=t},subscribe(t){return e.add(t),()=>{e.delete(t)}},notify(){for(let t of e)t()}}}var dn=require("react");function Rt(n,e,t){if(n===e)return!0;if(!n||!e)return!1;let o=typeof n;if(o!==typeof e||o!=="object")return!1;var i=Object.keys(n),a=Object.keys(e);t&&(i=i.filter(u=>!t.has(u)),a=a.filter(u=>!t.has(u)));var l=i.length;if(a.length!==l)return!1;for(var s=0;s<l;s++){var c=i[s];if(!(t&&t.has(c))&&(n[c]!==e[c]||!Object.prototype.hasOwnProperty.call(e,c)))return!1}return!0}function Gu(n,e,t){let o=(0,dn.useRef)(e);o.current=e;let r=(0,dn.useRef)(t);r.current=t;let i=(0,dn.useRef)(void 0),a=(0,dn.useRef)(!1),l=(0,dn.useCallback)(()=>{let s=n.getSnapshot(),c=o.current(s);return a.current&&r.current(i.current,c)?i.current:(i.current=c,a.current=!0,c)},[n]);return(0,dn.useSyncExternalStore)(n.subscribe,l,l)}function Pi(n,e){return Gu(n,e,Object.is)}function Fo(n,e){return Gu(n,e,Rt)}var Hu=H(require("react")),ts;function No(){return ts||(ts=Hu.createContext(null))}var Ku=Mn(),Bu=()=>{};function xi(){let n=No();return(0,Lo.useContext)(n)||void 0}function Di(){let n=xi();return(0,Lo.useCallback)(()=>n?.getSnapshot(),[n])}function Mi(n){let e=No(),t=(0,Lo.useContext)(e),o=Fo(t||Ku,t?n:Bu);return t?o??void 0:void 0}function En(){let n=No(),e=(0,Lo.useContext)(n),o=Pi(e||Ku,e?r=>r.masterRowInfo:Bu);return e?o:void 0}var ko=H(require("react")),lt=require("react");function An(n){if(n==null)return!1;let e=n;return!0}var _n=require("react");var Ei=require("react"),qt=()=>{let[n,e]=(0,Ei.useState)(0);return[n,(0,Ei.useCallback)(()=>{e(t=>t+1)},[e])]};var Wu=n=>{let e=(0,_n.useCallback)(n,[]),t=(0,_n.useRef)(!1),o=(0,_n.useRef)(!1),r=(0,_n.useRef)(void 0),[i,a]=qt();t.current&&(o.current=!0),(0,_n.useEffect)(()=>(t.current||(r.current=e,t.current=!0),a(),()=>{o.current&&r.current&&r.current()}),[])};var Ai=require("react");function Le(n){let e=(0,Ai.useRef)(n);return e.current=n,(0,Ai.useCallback)(()=>e.current,[])}var _i=require("react"),On=(n,e)=>{let t=(0,_i.useRef)(e===void 0?n:e);return(0,_i.useLayoutEffect)(()=>{t.current=n}),t.current};var Er={DataSource:{track:"DataSource",labels:{RemoteDataLoad:"Remote data load",TreeUnfilteredTreePaths:"Computing unfiltered tree paths",Filter:"Filter",Sort:"Sort",Group:"Group",LazyGroup:"Lazy group",Tree:"Tree",FlattenTree:"Flatten tree",Flatten:"Flatten groups",PrepareData:"Preparing data",ComputeSelectionCount:"Computing selection count",ComputeSelectionCountLazy:"Computing selection count (lazy)",PrepareRowInfo:"Preparing row info array",DiffRowInfoInStore:"setDataArray diffing in RowInfoStore"}},InfiniteTable:{track:"InfiniteTable",labels:{Render:"Rendering"}},MatrixBrain:{track:"Layout Computations",labels:{ComputeRenderRange:"Computing render range"}},ComponentState:{track:"ComponentState",labels:{PropUpdate:"Prop update"}}};var KT="\u200B",ns=class n{constructor(e){this.debugId=e;this.markerDetails={label:"",track:"",trackGroup:void 0,color:void 0,details:[],tooltip:void 0};this.stopped=!1;this.start=e=>{if(this.markerDetails.startTs)return this;let t=performance.now();return this.markerDetails.details=e?.details??[],this.markerDetails.startTs=t,this};this.end=(e={})=>{if(this.stopped)return this;this.stopped=!0;let t=e.startTs??this.markerDetails.startTs,o=e.endTs??this.markerDetails.endTs??performance.now(),r=e.color||this.markerDetails.color||"primary",i=e.trackGroup||this.markerDetails.trackGroup||`Infinite Table (${this.debugId})`,a=[...this.markerDetails.details||[],...e.details||[]],l=e.tooltip||this.markerDetails.tooltip,s=e.label||this.markerDetails.label||"Unknown",c=e.track||this.markerDetails.track||"Unknown",u=KT+s;return performance.measure(u,{start:t,end:o,detail:{devtools:{dataType:"track-entry",trackGroup:i,track:c,color:r,properties:a.length>0?a.map(d=>[d.name,d.value]):void 0,tooltipText:l}}}),performance.clearMeasures(u),this};this.debugId=e}static create(e){return new n(e)}get startTimestamp(){return this.markerDetails.startTs}get track(){let e=this;return Object.keys(Er).reduce((t,o)=>{let r={start:e.start,end:i=>e.end({...i,track:Er[o].track,label:i.label}),get label(){let i=Er[o];return Object.keys(i.labels).reduce((a,l)=>{let s={start:e.start,end:c=>e.end({...c,track:i.track,label:i.labels[l]})};return Object.defineProperty(a,l,{get:()=>(e.markerDetails.label=i.labels[l],s)}),a},{})}};return Object.defineProperty(t,o,{get:()=>{let i=Er[o];return e.markerDetails.track=i.track,r}}),t},{})}};function st(n){return ns.create(n)}function ju(n,e){let t=new Set;function o(...r){let i=e?e.getProxyTargetFromArgs(...r):r[0];t.clear();let a={get:function(c,u){return t.add(u),c[u]}},l=new Proxy(i,a),s=e?e.putProxyToArgs(l,...r):[l];return n.apply(this,s)}return{fn:o,propertyReads:t}}var os=n=>n&&n.substr(0,1).toUpperCase()+n.substr(1);function Ar(n){return n!==void 0}function Fn(n,e){let t=e[n];return Ar(t)}var Uu=(n,e,t)=>{let o=n[e];typeof o=="function"&&o(...t)};function BT(n,e,t){let o={};for(let r in n)if(n.hasOwnProperty(r)){let i=n[r],a=Fn(r,e)?e[r]:e[`default${os(r)}`];typeof i=="function"&&(a=i(a,t)),o[r]=a}return o}function $u(n,e,t){let{fn:o,propertyReads:r}=ju(n,{getProxyTargetFromArgs:a=>a.props,putProxyToArgs:(a,l)=>[{...l,props:a}]}),i=o(e);return r.forEach(a=>t.add(a)),i}function Yu(n){let{props:e,initialSetupState:t,propsToForward:o,parentState:r,mapPropsToState:i,propsToStateSet:a}=n,l={};o&&(l=BT(o,e,t));let s={...t,...l};if(i){let c=$u(i,{props:e,state:s,oldState:null,parentState:r},a);return{...s,...c}}return s}function qu(n,e,t){let{getProps:o,getParentState:r,mapPropsToState:i,concludeReducer:a,propsToStateSet:l}=t;if(e.type==="REPLACE_STATE")return e.payload;let s=r?.()??null,c=e.payload.mappedState,u=e.payload.updatedPropsToState,d={...n};if(c&&Object.assign(d,c),i){let f=$u(i,{props:o(),state:d,oldState:n,parentState:s},l);Object.assign(d,f)}return e.type==="ASSIGN_STATE"&&Object.assign(d,e.payload),a?a({previousState:n,state:d,updatedProps:u,parentState:s}):d}function Xu(n){let{dispatch:e,getState:t,getProps:o,propsToForward:r,allowedControlledPropOverrides:i,interceptedActions:a,mappedCallbacks:l,notify:s=Uu}=n,c=t();return Object.keys(c).reduce((u,d)=>{let p=d;return Object.defineProperty(u,d,{set:m=>{let g=o(),h=t(),S=!0;if(a&&typeof a[p]=="function"&&a[p](m,{actions:u,state:h})===!1&&(S=!1),S){let T=[m],I=`on${os(d)}Change`;if(l&&l[p]){let b=l[p](m,h);I=b.callbackName||I,T=b.callbackParams}s(g,I,T)}let y=r[p];typeof y=="function"&&(m=y(m));let C=!!i?.[p];Fn(d,g)&&!C||e({payload:{updatedProps:null,mappedState:{[d]:m}}})}}),u},{})}function WT(n){let{currentProps:e,prevProps:t,state:o,propsToForward:r,propsToStateSet:i}=n,a={},l=0,s={},c=0,u={},d=0;return new Set([...Object.keys(e),...Object.keys(t)]).forEach(f=>{let m=f,g=t[m],h=e[m];if(m!=="children"&&g!==h&&(u[m]={newValue:h,oldValue:g},d++,Fn(m,e)||Fn(m,t)))if(r.hasOwnProperty(f)){let S=h,y=r[f];typeof y=="function"&&(S=y(h)),o[m]!==S&&(a[m]=S,l++)}else i.has(f)&&(s[m]=e[m],c++)}),{newMappedState:a,newMappedStateCount:l,updatedPropsToState:s,updatedPropsToStateCount:c,rawUpdatedProps:u,rawUpdatedPropsCount:d}}function Zu(n){let{currentProps:e,prevProps:t,state:o,propsToForward:r,propsToStateSet:i,dispatch:a,actions:l,onPropChange:s,onPropsChange:c,beforeDispatch:u}=n,d=WT({currentProps:e,prevProps:t,state:o,propsToForward:r,propsToStateSet:i}),{newMappedState:p,newMappedStateCount:f,updatedPropsToState:m,updatedPropsToStateCount:g,rawUpdatedProps:h,rawUpdatedPropsCount:S}=d;if(g===0&&f===0)return!1;if(u?.(d),a({payload:{mappedState:f?p:null,updatedPropsToState:g?m:null}}),s){for(let y in h)if(h.hasOwnProperty(y)){let{newValue:C,oldValue:T}=h[y];s({name:y,newValue:C,oldValue:T},e,l,o)}}return c&&S&&c(h,e,l,o),!0}var rs;function Qu(){return rs||(rs=(0,lt.createContext)(null))}function kt(n){let e=n.getParentState||(()=>null);function t(r){let[i]=(0,lt.useState)(()=>n.initSetupState?n.initSetupState(r):{}),a=(0,lt.useRef)(new Set),l=(0,lt.useMemo)(()=>n.forwardProps?n.forwardProps(i,r):{},[i]),s=e(),c=Le(s);function u(){return Yu({props:r,initialSetupState:i,propsToForward:l,parentState:s,mapPropsToState:n.mapPropsToState,propsToStateSet:a.current})}let[d]=(0,lt.useState)(u),p=Le(r),f=(w,v)=>qu(w,v,{getProps:p,getParentState:()=>c?.()??null,mapPropsToState:n.mapPropsToState,concludeReducer:n.concludeReducer,propsToStateSet:a.current}),[m,g]=(0,lt.useReducer)(f,d),h=Le(m),{allowedControlledPropOverrides:S}=n,y=(0,lt.useMemo)(()=>Xu({dispatch:g,getState:h,getProps:p,propsToForward:l,allowedControlledPropOverrides:S,interceptedActions:n.interceptActions,mappedCallbacks:n.mappedCallbacks}),[g,l,S]),C=n.Context??Qu(),T=(0,lt.useMemo)(()=>({componentState:m,componentActions:y,getComponentState:h,replaceState:w=>{g({type:"REPLACE_STATE",payload:w})},assignState:w=>{g({type:"ASSIGN_STATE",payload:w})}}),[m,y,h]),I=On(r),b=(0,lt.useRef)(!1);b.current=!1;let R=n.layoutEffect?lt.useLayoutEffect:lt.useEffect;return R(()=>{let w=r;Zu({currentProps:w,prevProps:I,state:m,propsToForward:l,propsToStateSet:a.current,dispatch:g,actions:y,onPropChange:n.onPropChange,onPropsChange:n.onPropsChange,beforeDispatch:({newMappedState:P,newMappedStateCount:D,updatedPropsToState:M,updatedPropsToStateCount:x})=>{let E=m.debugId,z=E?st(E).track.ComponentState.label.PropUpdate.start():void 0,V=n.debugName?typeof n.debugName=="function"?`${n.debugName(w)}:rerender`:`${n.debugName}:rerender`:"rerender";Lt(V)("Triggered by new values for the following props",...Object.keys(P??{}),...Object.keys(M??{})),z&&z.end({label:V,details:[D>0?{name:"Updated properties",value:Object.keys(P).join(", ")}:void 0,x>0?{name:"Updated props",value:Object.keys(M).join(", ")}:void 0,x>0||M?{name:"Details",value:"The time for this marker is not accurate. The marker is only displayed so you can easily identify the props that triggered the rerender."}:void 0].filter(An)})}})&&(b.current=!0)}),R(()=>{s!=null&&!b.current&&g({type:"PARENT_STATE_CHANGE",payload:{}})},[s]),Wu(()=>()=>{n.cleanup?.(h())}),{contextValue:T,ContextComponent:C}}return{ManagedComponentContextProvider:ko.memo(function(i){let{contextValue:a,ContextComponent:l}=t(i);return ko.createElement(l.Provider,{value:a},i.children)}),useManagedComponent:t}}function zt(n){return n=n??Qu(),ko.useContext(n)}var dd=H(require("react"));var yt="Infinite",ze={rootClassName:yt};var Oi=()=>ze;var Ju="_16lm1iw2 _16lm1iw23 _16lm1iw26 _16lm1iw2c _16lm1iw2a",ed={center:"_16lm1iw2j",stretch:"_16lm1iw2k",start:"_16lm1iw2l",end:"_16lm1iw2m"};var Ht="_16lm1iw3b _16lm1iw3c _16lm1iw35",td={pointer:"_16lm1iwk",default:"_16lm1iwl",colResize:"_16lm1iwm",grabbing:"_16lm1iwn",grab:"_16lm1iwo"},zo={flex:"_16lm1iw1p",contents:"_16lm1iw1q",none:"_16lm1iw1r",block:"_16lm1iw1s",grid:"_16lm1iw1t",inlineBlock:"_16lm1iw1u",inlineFlex:"_16lm1iw1v",inlineGrid:"_16lm1iw1w"};var Fi={1:"_16lm1iw1c",none:"_16lm1iw1d"},_r={column:"_16lm1iw2f",columnReverse:"_16lm1iw2g",row:"_16lm1iw2h",rowReverse:"_16lm1iw2i"};var nd={0:"_16lm1iw1y","100%":"_16lm1iw1z","50%":"_16lm1iw20"},od={center:"_16lm1iw30",spaceBetween:"_16lm1iw31",spaceAround:"_16lm1iw32",start:"_16lm1iw33",end:"_16lm1iw34"},rd={0:"_16lm1iw26","100%":"_16lm1iw27","50%":"_16lm1iw28",auto:"_16lm1iw29"};var id={none:"_16lm1iwd"},ad={hidden:"_16lm1iw35",auto:"_16lm1iw36",visible:"_16lm1iw37"};var Ni={relative:"_16lm1iw1",absolute:"_16lm1iw2",static:"_16lm1iw3",sticky:"_16lm1iw4",fixed:"_16lm1iw5"};var ld={0:"_16lm1iw23","100%":"_16lm1iw24","50%":"_16lm1iw25"};var sd={none:"_16lm1iw1x"};var cd={visible:"_16lm1iw38",hidden:"_16lm1iw39"};var ud={1:"_16lm1iw1e",10:"_16lm1iw1f",100:"_16lm1iw1g",1e3:"_16lm1iw1h",1e4:"_16lm1iw1i",1e5:"_16lm1iw1j",1e6:"_16lm1iw1k",1e7:"_16lm1iw1l","1k":"_16lm1iw1m","10k":"_16lm1iw1n","100k":"_16lm1iw1o"};function pd(n){let{rootClassName:e}=Oi();return dd.createElement("div",{...n,className:$(`${e}Footer`,Ni.relative,zo.flex,_r.row,n.className)})}var Ae=H(require("react")),Sn=require("react"),gg=require("react-dom");function Li(n){let e={};return Object.keys(n).forEach(t=>{e[t]=t}),e}function Y(n){return n.slice(4,-1)}var gd=H(require("react"));var Vo={expandCollapse:"_1jm33zv0",loading:"_1jm33zv1",done:"_1jm33zv2",clear:"_1jm33zv3",hidden:"_1jm33zv4",filterOperatorContains:"_1jm33zv5",filterOperatorStartsWith:"_1jm33zv6",filterOperatorEndsWith:"_1jm33zv7",filterOperatorEq:"_1jm33zv8",filterOperatorNeq:"_1jm33zv9",filterOperatorGt:"_1jm33zva",filterOperatorGte:"_1jm33zvb",filterOperatorLt:"_1jm33zvc",filterOperatorLte:"_1jm33zvd"},fd="_1jm33zvf";var md={expandCollapse:"expand-collapse",loading:"loading",done:"done",clear:"clear",hidden:"hidden",filterOperatorContains:"filter-operator-contains",filterOperatorStartsWith:"filter-operator-starts-with",filterOperatorEndsWith:"filter-operator-ends-with",filterOperatorEq:"filter-operator-eq",filterOperatorNeq:"filter-operator-neq",filterOperatorGt:"filter-operator-gt",filterOperatorGte:"filter-operator-gte",filterOperatorLt:"filter-operator-lt",filterOperatorLte:"filter-operator-lte"};var ct="InfiniteIcon";var Ve=n=>{let{icon:e,...t}=n,o=n.size??"var(--infinite-icon-size)",r={flex:"none",width:o,height:o,fill:"currentColor",...n.style};return gd.createElement("svg",{viewBox:"0 0 24 24",...t,className:e?$(n.className,Vo[e],ct,`${ct}-${md[e]}`):n.className,style:r},n.children)};var is=H(require("react"));var Ge={includesOperator:["M11.14 4L6.43 16H8.36L9.32 13.43H14.67L15.64 16H17.57L12.86 4H11.14M12 6.29L14.03 11.71H9.96L12 6.29","M4 18V15H2V20H22V18Z","M20 14V18H2V20H22V14Z"],startsWithOperator:["M11.14 4L6.43 16H8.36L9.32 13.43H14.67L15.64 16H17.57L12.86 4M12 6.29L14.03 11.71H9.96M4 18V15H2V20H22V18Z"],endsWithOperator:["M11.14 4L6.43 16H8.36L9.32 13.43H14.67L15.64 16H17.57L12.86 4M12 6.29L14.03 11.71H9.96M20 14V18H2V20H22V14Z"],eqOperator:["M19,10H5V8H19V10M19,16H5V14H19V16Z"],neqOperator:["M21,10H9V8H21V10M21,16H9V14H21V16M4,5H6V16H4V5M6,18V20H4V18H6Z"],gtOperator:["M5.5,4.14L4.5,5.86L15,12L4.5,18.14L5.5,19.86L19,12L5.5,4.14Z"],gteOperator:["M6.5,2.27L20,10.14L6.5,18L5.5,16.27L16.03,10.14L5.5,4L6.5,2.27M20,20V22H5V20H20Z"],ltOperator:["M18.5,4.14L19.5,5.86L8.97,12L19.5,18.14L18.5,19.86L5,12L18.5,4.14Z"],lteOperator:["M18.5,2.27L5,10.14L18.5,18L19.5,16.27L8.97,10.14L19.5,4L18.5,2.27M5,20V22H20V20H5Z"],done:["m9.55 19-6.725-6.725L5.25 9.85l4.3 4.325 9.225-9.225 2.425 2.4Z"],hidden:["m644-428-58-58q9-47-27-88t-93-32l-58-58q17-8 34.5-12t37.5-4q75 0 127.5 52.5T660-500q0 20-4 37.5T644-428Zm128 126-58-56q38-29 67.5-63.5T832-500q-50-101-143.5-160.5T480-720q-29 0-57 4t-55 12l-62-62q41-17 84-25.5t90-8.5q151 0 269 83.5T920-500q-23 59-60.5 109.5T772-302Zm20 246L624-222q-35 11-70.5 16.5T480-200q-151 0-269-83.5T40-500q21-53 53-98.5t73-81.5L56-792l56-56 736 736-56 56ZM222-624q-29 26-53 57t-41 67q50 101 143.5 160.5T480-280q20 0 39-2.5t39-5.5l-36-38q-11 3-21 4.5t-21 1.5q-75 0-127.5-52.5T300-500q0-11 1.5-21t4.5-21l-84-82Zm319 93Zm-151 75Z"],clear:["M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"]};var hd=n=>is.createElement(Ve,{...n,icon:"filterOperatorContains"},Ge.includesOperator.map(e=>is.createElement("path",{key:e,d:e})));var as=H(require("react"));var yd=n=>as.createElement(Ve,{...n,icon:"filterOperatorEndsWith"},as.createElement("path",{d:Ge.endsWithOperator[0]}));var ls=H(require("react"));var Sd=n=>ls.createElement(Ve,{...n,icon:"filterOperatorEq"},ls.createElement("path",{d:Ge.eqOperator[0]}));var ss=H(require("react"));var bd=n=>ss.createElement(Ve,{...n,icon:"filterOperatorGte"},ss.createElement("path",{d:Ge.gteOperator[0]}));var cs=H(require("react"));var Td=n=>cs.createElement(Ve,{...n,icon:"filterOperatorGt"},cs.createElement("path",{d:Ge.gtOperator[0]}));var us=H(require("react"));var Cd=n=>us.createElement(Ve,{...n,icon:"filterOperatorLte"},us.createElement("path",{d:Ge.lteOperator[0]}));var ds=H(require("react"));var Id=n=>ds.createElement(Ve,{...n,icon:"filterOperatorLt"},ds.createElement("path",{d:Ge.ltOperator[0]}));var ps=H(require("react"));var Rd=n=>ps.createElement(Ve,{...n,icon:"filterOperatorNeq"},ps.createElement("path",{d:Ge.neqOperator[0]}));var fs=H(require("react"));var wd=n=>fs.createElement(Ve,{...n,icon:"filterOperatorStartsWith"},fs.createElement("path",{d:Ge.startsWithOperator[0]}));var Rs=H(require("react"));var dt=H(require("react")),Fr=require("react");var Go=H(require("react")),no=require("react");function jT(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var o=t.call(n,e||"default");if(typeof o!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function UT(n){var e=jT(n,"string");return typeof e=="symbol"?e:String(e)}function $T(n,e,t){return e=UT(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function vd(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);e&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,o)}return t}function Pd(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?vd(Object(t),!0).forEach(function(o){$T(n,o,t[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):vd(Object(t)).forEach(function(o){Object.defineProperty(n,o,Object.getOwnPropertyDescriptor(t,o))})}return n}function xd(n,e){var t={};for(var o in n)t[o]=e(n[o],o);return t}var YT=(n,e,t)=>{for(var o of Object.keys(n)){var r;if(n[o]!==((r=e[o])!==null&&r!==void 0?r:t[o]))return!1}return!0},he=n=>{var e=t=>{var o=n.defaultClassName,r=Pd(Pd({},n.defaultVariants),t);for(var i in r){var a,l=(a=r[i])!==null&&a!==void 0?a:n.defaultVariants[i];if(l!=null){var s=l;typeof s=="boolean"&&(s=s===!0?"true":"false");var c=n.variantClassNames[i][s];c&&(o+=" "+c)}}for(var[u,d]of n.compoundVariants)YT(u,r,n.defaultVariants)&&(o+=" "+d);return o};return e.variants=()=>Object.keys(n.variantClassNames),e.classNames={get base(){return n.defaultClassName.split(" ")[0]},get variants(){return xd(n.variantClassNames,t=>xd(t,o=>o.split(" ")[0]))}},e};var Dd="_1eexc2a6";var Md=he({defaultClassName:"_12zfob12c _16lm1iw1z _16lm1iw22 _16lm1iw1p _16lm1iw2h _16lm1iw2j _16lm1iw33",variantClassNames:{filtered:{false:"_12zfob12d",true:"_12zfob12e"},verticalAlign:{start:"_12zfob12f",end:"_12zfob12g",center:"_12zfob12h"},align:{start:"_12zfob12i",end:"_12zfob12j",center:"_12zfob12k"}},defaultVariants:{},compoundVariants:[]}),Ed="_12zfob1q _16lm1iw2 _16lm1iw1k _16lm1iw3b _16lm1iw3c _16lm1iw35",Ad=he({defaultClassName:"_16lm1iw2 _16lm1iw25 _16lm1iw26 _16lm1iwh _16lm1iwf",variantClassNames:{visible:{true:"_12zfob19",false:"_12zfob1a"}},defaultVariants:{},compoundVariants:[]}),_d=he({defaultClassName:"_12zfob1r",variantClassNames:{rowActive:{false:"_12zfob1s",true:"_12zfob1t"},cellSelected:{false:"_12zfob1u",true:"_12zfob1v"},rowSelected:{false:"_12zfob1w",true:"_12zfob1x",null:"_12zfob1y"},rowDisabled:{false:"_12zfob1z",true:"_12zfob110"},firstRow:{false:"_12zfob111",true:"_12zfob112"},treeNode:{parent:"_12zfob113",leaf:"_12zfob114",false:"_12zfob115"},firstRowInHorizontalLayoutPage:{false:"_12zfob116",true:"_12zfob117"},groupRow:{false:"_12zfob118",true:"_12zfob119"},groupCell:{false:"_12zfob11a",true:"_12zfob11b"},align:{start:"_12zfob11c",end:"_12zfob11d",center:"_12zfob11e"},verticalAlign:{start:"_12zfob11f",end:"_12zfob11g",center:"_12zfob11h"},zebra:{false:"_12zfob11i",even:"_12zfob11j",odd:"_12zfob11k"},dragging:{true:"_12zfob11l",false:"_12zfob11m"},insideDisabledDraggingPage:{true:"_12zfob11n",false:"_12zfob11o"},first:{true:"_12zfob11p",false:"_12zfob11q"},last:{true:"_12zfob11r",false:"_12zfob11s"},groupByField:{true:"_12zfob11t",false:"_12zfob11u"},firstInCategory:{true:"_12zfob11v",false:"_12zfob11w"},lastInCategory:{true:"_12zfob11x",false:"_12zfob11y"},pinned:{start:"_12zfob11z",end:"_12zfob120",false:"_12zfob121"},filtered:{true:"_12zfob122",false:"_12zfob123"}},defaultVariants:{},compoundVariants:[[{pinned:"start",lastInCategory:!0},"_12zfob124"],[{pinned:"end",firstInCategory:!0},"_12zfob125"],[{pinned:!1,lastInCategory:!0},"_12zfob126"]]}),Od=he({defaultClassName:"_12zfob1c _16lm1iw1s _16lm1iw2",variantClassNames:{pinned:{start:"_12zfob1d",end:"_12zfob1e",false:"_12zfob1f"},firstInCategory:{true:"_12zfob1g",false:"_12zfob1h"},lastInCategory:{true:"_12zfob1i",false:"_12zfob1j"},overflow:{true:"_12zfob1k",false:"_12zfob1l"}},defaultVariants:{},compoundVariants:[[{overflow:!0,pinned:"start"},"_12zfob1m"],[{pinned:"start",firstInCategory:!0},"_12zfob1n"],[{overflow:!0,pinned:"end"},"_12zfob1o"],[{pinned:"end",lastInCategory:!0},"_12zfob1p"]]}),Fd="_12zfob12u _16lm1iw22 _16lm1iw1z";var Nd="_12zfob17",Ld="_12zfob12q _16lm1iw1p _16lm1iw2h _16lm1iw2j _16lm1iw1",kd=he({defaultClassName:"_12zfob12r _16lm1iw1 _16lm1iw23",variantClassNames:{disabled:{true:"_12zfob12s",false:"_12zfob12t"}},defaultVariants:{},compoundVariants:[]}),ms=he({defaultClassName:"_12zfob12n _16lm1iw1p _16lm1iw2h _16lm1iw2k _16lm1iw1",variantClassNames:{active:{true:"_12zfob12o",false:"_12zfob12p"}},defaultVariants:{},compoundVariants:[]}),zd="_12zfob12m _16lm1iw1p _16lm1iw2h _16lm1iw2j",Vd=he({defaultClassName:"_12zfob127 _16lm1iw1 _16lm1iw39",variantClassNames:{menuVisible:{true:"_12zfob128"},reserveSpaceWhenHidden:{true:"_12zfob129",false:"_12zfob12a"}},defaultVariants:{},compoundVariants:[[{menuVisible:!0,reserveSpaceWhenHidden:!1},"_12zfob12b"]]}),Gd="_12zfob1b _16lm1iw2",Hd="_16lm1iw1",Kd="_12zfob16",Bd=he({defaultClassName:"_12zfob12",variantClassNames:{align:{start:"_12zfob13",center:"_12zfob14",end:"_12zfob15"}},defaultVariants:{},compoundVariants:[]}),Wd="_12zfob12l _16lm1iw35 _16lm1iw1 _16lm1iw1p _16lm1iw2h";var jd="_1nnkya20 _16lm1iw1p _16lm1iw2f _16lm1iw1 _16lm1iw32 _16lm1iw2j",ki="_1nnkya21";var Ud={transition:"width 0.25s, opacity 0.25s"},BD=Object.keys({size:1,lineWidth:1,lineStyle:1,style:1,className:1,index:1});function Ho(n){let[e,t]=(0,no.useState)(!0),[o,r]=(0,no.useState)(0),{lineWidth:i=1,style:a,className:l,index:s}=n,c=s!=null&&s>0,u=n.size??16,d=Math.floor(u/4),p=[u-1*d,u-2*d,u-3*d],f={...Ud,borderTop:`${i}px solid currentColor`,...n.lineStyle,opacity:o};if((0,no.useEffect)(()=>{if(!e)return;let g=requestAnimationFrame(()=>{r(1)});return()=>{cancelAnimationFrame(g)}},[e]),(0,no.useLayoutEffect)(()=>{t(!0)},[]),!e)return null;let m={};return Go.createElement("div",{"data-name":"filter-icon",style:{...a,width:u},className:$(l,ct,jd,`${ct}-filter`)},c?Go.createElement("div",{"data-name":"index",style:m,className:Nd},s):null,Go.createElement("div",{className:ki,style:{width:p[0],...f}}),Go.createElement("div",{className:ki,style:{width:p[1],...f}}),Go.createElement("div",{className:ki,style:{width:p[2],...f}}))}var zi=Object.freeze({}),qT={string:zi,number:{}};function Ko(n,e){let t=e.default||zi;return n.type===void 0?t:n.type===null?zi:typeof n.type=="string"?e[n.type]||qT[n.type]||zi:n.type.reduce((o,r)=>Object.assign(o,e[r]),{})}var hs=n=>{let{availableSize:e,items:t,minSize:o,maxSize:r}=n;if(e<0)throw"The provided availableSize cannot be negative!";let i=0,a=0,l=0,s=[],c=[];t.forEach((R,w)=>{let v=R.maxSize??r??void 0,P=R.minSize??o??void 0;s.push(P),c.push(v),R.size!=null&&(v!=null&&R.size>v&&(R.size=v),P!=null&&R.size<P&&(R.size=P));let D=R.flex==0?null:R.flex;if(R.size==null&&D==null)throw`Items must specify either a size or a flex property. Item at index ${w} doesn't have either of those.`;D!=null&&(l+=1),a+=D??0,i+=R.size??0});let u=n.computeSpecialSpaceDistribution?Math.max(e,0):Math.max(e-i,0),d=u/a,p={},f={},m=0;t.forEach((R,w)=>{if(R.flex!=null){let v=d*R.flex,P=R.maxSize??r??void 0,D=R.minSize??o??void 0,M=!1,x=0;P!=null&&v>P&&(p[w]=!0,M=!0,x=P),D!=null&&v<D&&(f[w]=!0,M=!0,x=D),M&&(m+=1,l-=1,a-=R.flex,u-=x)}}),m&&(d=u/a);let g=[],h=0,S=u,y=a,C=0,T=0,I=[];return{items:t.map((R,w)=>{let v={...R},P=R.maxSize??r??void 0,D=R.minSize??o??void 0,M=0,x=p[w],E=f[w],z=x||E,V=R.size??0;if(R.flex!=null){if(z)E&&(M=D),x&&(M=P);else{h+=1;let N=L=>(P!=null&&L>P&&(L=P),D!=null&&L<D&&(L=D),L);h===l?M=N(S):(M=N(Math.round(R.flex*d)),T+=M,S=u-T,y-=R.flex,d=S/y)}V=M,v.flexSize=M}return g.push(M),I.push(V),v.computedSize=V,C+=V,v}),flexSizes:g,minSizes:s,maxSizes:c,computedSizes:I,remainingSize:Math.round(e-C)}};function Vi(n,e,t,o){return e!=null&&n<=e?{value:e,clamped:"min",diff:(n-e)*o}:t!=null&&n>=t?{value:t,clamped:"max",diff:(t-n)*o}:{value:n,clamped:!1,diff:0}}function Yd(n,e,t){let o=!1,r=0;for(let i of n)i.computedFlex&&(o=!0),r+=i.computedWidth;return o&&Math.round(r)>Math.round(e-t)}function gs(n,e){return n.computedFlex&&!e?"flex":"width"}function Or(n,e,t){if(e==="width"){let{flex:o,...r}=n??{};return{...r,width:t}}return{...n,flex:t}}var ys=n=>{let{availableSize:e,reservedWidth:t=0}=n,o=Object.keys(n.columnSizing).reduce((D,M)=>(D[M]={...n.columnSizing[M]},D),{});if(e<0)throw"The provided availableSize cannot be negative!";let r=n.dragHandleOffset,i=n.dragHandlePositionAfter,a=n.dragHandlePositionAfter+1,l=n.items[i],s=n.items[a],c=l.id,u=s?.id,d=Yd(n.items,e,t),p=l.computedWidth,f=l.computedMinWidth,m=l.computedMaxWidth,g=gs(l,d),h=s?.computedWidth,S=s?.computedMinWidth,y=s?.computedMaxWidth,C=s?gs(s,d):"width",T=!1,I=!1,b=r>0?1:-1,{value:R,clamped:w,diff:v}=Vi(Math.round(p+r),f,m,b);if(n.shareSpaceOnResize){if(s==null)return o[c]=Or(o[c],g,R),I=w==="min",T=w==="max",{adjustedDiff:R-p,reservedWidth:t,columnSizing:o,minReached:I,maxReached:T,constrained:I||T};let{value:D,clamped:M,diff:x}=Vi(Math.round(h-r),S,y,b);if(w&&M&&(Math.abs(v)>Math.abs(x)?M=!1:w=!1),!(!w&&!M)){if(w){let E=Vi(Math.round(h-r-v),S,y,b);D=E.value,M=E.clamped,x=E.diff}else if(M){let E=Vi(Math.round(p+r+x),f,m,b);R=E.value,w=E.clamped,v=E.diff}}o[c]=Or(o[c],g,R),o[u]=Or(o[u],C,D),I=w==="min"||M==="min",T=w==="max"||M==="max"}else o[c]=Or(o[c],g,R),I=w==="min",T=w==="max";let P=R-p;return{adjustedDiff:P,reservedWidth:n.shareSpaceOnResize?t:Math.round(t-P),columnSizing:o,minReached:I,maxReached:T,constrained:I||T}};function $d(n,e){return n+e}function XT(n){return Object.keys(n).reduce((t,o)=>(t[o]={...n[o]},t),{})}var qd=n=>{let{availableSize:e,reservedWidth:t=0}=n,o=Object.keys(n.columnSizing).reduce((y,C)=>(y[C]={...n.columnSizing[C]},y),{});if(e<0)throw"The provided availableSize cannot be negative!";let r=n.dragHandleOffset,i=[...new Array(n.columnGroupSize)].map((y,C)=>n.dragHandlePositionAfter-C).reverse(),a=i.map(y=>n.items[y]),l=a.map(y=>y.computedWidth),s=Yd(n.items,e,t),c=a.map(y=>gs(y,s)),u=0,{computedSizes:d}=hs({items:a.map(y=>(y.resizable===!1&&(u+=y.computedWidth),{maxSize:y.computedMaxWidth,minSize:y.computedMinWidth,flex:y.resizable?y.computedWidth:null,size:0})),computeSpecialSpaceDistribution:!0,availableSize:Math.max(l.reduce($d,0)+r-u,0)}),p=a.map((y,C)=>d[C]-y.computedWidth),f=!0,m=!0,g=!0,h=[];p.forEach((y,C)=>{let T=a[C];if(!T.resizable){h.push(0);return}let I=c[C],b=l[C],R=XT(o),{maxReached:w,minReached:v,constrained:P,adjustedDiff:D}=ys({availableSize:n.availableSize,reservedWidth:n.reservedWidth,dragHandleOffset:y,dragHandlePositionAfter:i[C],shareSpaceOnResize:!1,items:n.items,columnSizing:R});o[T.id]=Or(R[T.id],I,Math.round(b+D)),h.push(D),w||(m=!1),v||(f=!1),P||(g=!1)});let S=h.reduce($d,0);return{minReached:f,maxReached:m,constrained:g,adjustedDiffs:h,adjustedDiff:S,columnSizing:o,reservedWidth:Math.round(t-S)}};var Gi;function Xt(){if(Gi!=null)return Gi;let n=Fe().document??null;if(!n)return 0;let e=n.createElement("div");e.style.visibility="hidden",e.style.overflow="scroll",n.body.appendChild(e);let t=n.createElement("div");return e.appendChild(t),Gi=e.offsetWidth-t.offsetWidth,e.parentNode?.removeChild(e),Gi}var Xd=["start",void 0,"end"],Zd=(n,e)=>(e&&Object.keys(e).length>0&&n.sort((t,o)=>{let r=e[t],i=e[o];return r===!0&&(r="start"),i===!0&&(i="start"),r==i?0:Xd.indexOf(r)-Xd.indexOf(i)}),n);function Qd(n,e,...t){let o=e;return t.forEach(r=>{for(let i in r)r.hasOwnProperty(i)&&n(r[i],i)&&(o[i]=r[i])}),o}function Ss(n,...e){return Qd(t=>t!=null,n,...e)}function Jd(n,e,...t){return Qd((o,r)=>!(r in n),e,...t)}var Hi=!0,ZT=!0,QT=!0,ep="string",pn="unknown";var JT=Dn("getComputedVisibleColumns"),eC=(n,e,t)=>n[t]!==!1,bs=(n,e)=>{if(!e)return!1;let t=e[n];return t==="start"||t===!0?"start":t==="end"?"end":!1};function oo(n,e){if(n)return n[e]?n[e]:Object.values(n).find(t=>t.field===e)}function tC(n,e){let t=Ko(n,e);return n.sortType?n.sortType:t.sortType?t.sortType:typeof n.type=="string"?n.type:ep}function nC(n,e,t){let r=(Array.isArray(n)?n:n?[n]:[]).flatMap(i=>{let a=i.field??i.groupField;if(!a)return[pn];let l=oo(e,a);if(!l)return[pn];let s=tC(l,t);return Array.isArray(s)?s:[s]});return r.every(i=>i===pn)?pn:r.length===1?r[0]:r}function Ts(n,e){let{colType:t,sortable:o,columnDefaultSortable:r}=e,i=n.defaultSortable??t.defaultSortable,a=!!n.groupByForColumn;if(i==null&&!a){let l=n.field??t.field,s=n.valueGetter??t.valueGetter;l==null&&s==null&&(i=!1)}return o??i??r??Hi}var tp=({columns:n,userColumns:e,bodySize:t,columnMinWidth:o,columnMaxWidth:r,columnDefaultWidth:i,columnDefaultFlex:a,scrollbarWidth:l,columnCssEllipsis:s,columnHeaderCssEllipsis:c,pinnedStartMaxWidth:u,pinnedEndMaxWidth:d,filterValue:p,sortable:f,sortInfo:m,multiSort:g,filterTypes:h=Nn,viewportReservedWidth:S,resizableColumns:y,draggableColumns:C,columnDefaultDraggable:T,columnOrder:I,columnPinning:b,editable:R,columnDefaultEditable:w,columnDefaultFilterable:v,columnDefaultGroupable:P,columnDefaultSortable:D,columnSizing:M,columnTypes:x,columnVisibility:E,columnVisibilityAssumeVisible:z,groupBy:V})=>{let N=0,L={};V.forEach((G,ee)=>{G.field&&(L[G.field]=ee)});let F=(p||[]).reduce((G,ee)=>{let{id:ge,field:Te}=ee;return Te&&(G[Te]=ee),ge&&(G[ge]=ee),G},{}),B=Zd(I===!0?Object.keys(n):I,b),X=B.filter(G=>n[G]?eC(E,z,G):(JT(`Column with id "${G}" specified in columnOrder array cannot be found in the columns map.`),!1)),_=new Map,k=X.map((G,ee)=>{let ge=n[G];return _.set(G,ee),ge}),K=(m??[]).reduce((G,ee,ge)=>(ee.id?G[ee.id]={sortInfo:ee,index:ge}:ee.field&&(G[ee.field]={sortInfo:ee,index:ge}),G),{});function Q(G){let ee=n[G],ge=Ko(ee,x),Te={minWidth:ge?.minWidth,maxWidth:ge?.maxWidth,width:ge?.defaultWidth,flex:ge?.defaultFlex},ut={width:ee?.defaultWidth,flex:ee?.defaultFlex,minWidth:ee?.minWidth,maxWidth:ee?.maxWidth},re=M[G];re?.width!=null&&re.flex==null&&delete ut.flex,re?.flex!=null&&re.width==null&&delete ut.width;let j=Ss(ut,re);j.width!=null&&delete Te.flex,j.flex!=null&&delete Te.width,j=Ss(Te,j);let tt=j.flex??void 0,ae=j.minWidth??ee?.minWidth??o,Ee=j.maxWidth??ee?.maxWidth??r,Ze=tt!=null?void 0:j.width??(a?void 0:i);return!Ze&&tt==null&&(a?tt=a:Ze=ae),{size:Ze,flex:tt,minSize:ae,maxSize:Ee}}let Ie=hs({availableSize:Math.max(t.width-(S??0)-(l??Xt()),0),maxSize:r,minSize:o,items:X.map(Q)}),{computedSizes:se,flexSizes:me,minSizes:ve,maxSizes:Pe}=Ie,ue=[],oe=[],ce=[],pe=[];pe.length=X.length;let Z=new Map,J=new Map,W=0,ie=0,ne=0,le=null,O=[],A=0,de=0,ye=0;k.forEach((G,ee)=>{let ge=X[ee],Te=se[ee],ut=O[ee]=bs(ge,b);ut==="start"?A+=Te:ut==="end"?ye+=Te:de+=Te});let we=t.width-ye,be=[],Me=new Map;X.forEach((G,ee)=>{let ge=k[ee];Me.set(G,ge)});let qe=[];Object.keys(n).forEach(G=>{let ee=n[G];qe.push(G),Me.has(G)||Me.set(G,ee)});let We=new Map;Me.forEach((G,ee)=>{let ge=_.get(ee);ge==null&&(ge=-1);let Te=ge!=-1,ut=X[ge+1],re=Ko(G,x),j=ge,tt=K[ee]?K[ee]:G.field?K[G.field]??null:null,ae=tt?.sortInfo??null,Ee=!!ae,Ze=Ee&&ae.dir===1,Ct=Ee&&!Ze,bu=tt?.index??-1,Bl=Te?{}:Q(ee),Tu=Te?se[ge]:Bl.size||0,dT=Te&&me[ge]||null,pT=Te?ve[ge]||0:Bl.minSize||0,fT=Te?Pe[ge]||1e4:Bl.maxSize||1e4,Et=Te?bs(ee,b):!1,Cu=Te?ge===X.length-1:!1,bi=j,mT=Te?Et==="start"?ie:Et==="end"?ne:N-ie:0;Et=="start"?bi=Te?j:-1:Et==="end"?bi=Te?j-(ue.length+ce.length):-1:bi=Te?j-ue.length:-1;let gT=Te?Et==="start"||Et===!1?N:we+ne:-1,hT=Te?Et!==le:!1,yT=Te?Cu||Et!==bs(ut,b):!1,Iu=G.cssEllipsis??re.cssEllipsis??s,ST=G.headerCssEllipsis??re.cssEllipsis??G.cssEllipsis??re.headerCssEllipsis??c??Iu,Ti=Te&&(F[ee]||G.field||G.groupByForColumn)&&(F[ee]||F[G.field||G.groupByForColumn])||null,bT=G.defaultFilterable??re.defaultFilterable??v??!0,TT=R??G.defaultEditable??re.defaultEditable??w??!1,Wl=G.dataType||re.dataType||(Array.isArray(G.type)?G.type[0]:G.type)||ep,CT=G.sortType||re.sortType||Wl,Ru=G.filterType||re.filterType||Wl,wu=!1;if(Ti!=null&&!Ti.disabled){let Ul=h[Ru];Ul&&(!Ul.emptyValues||!Ul.emptyValues.includes(Ti.filter.value))&&(wu=!0)}let _o=G.field??re.field,IT=G.valueGetter??re.valueGetter,jl=G.defaultGroupable??re.defaultGroupable??P??!!_o;_o||(jl=!1),G.groupByForColumn&&(jl=!1);let vu=_o?L[_o]!==void 0:!1,RT=vu?L[_o]:void 0,wT=Ts(G,{colType:re,sortable:f,columnDefaultSortable:D}),vT=G.resizable??re.resizable??y??ZT,Qe={colType:re,align:re.align,headerAlign:re.headerAlign,computedVisible:Te,verticalAlign:re.verticalAlign,defaultHiddenWhenGroupedBy:re.defaultHiddenWhenGroupedBy,valueGetter:IT,valueFormatter:re.valueFormatter,renderValue:re.renderValue,render:re.render,style:re.style,className:re.className,contentFocusable:re.contentFocusable,renderMenuIcon:re.renderMenuIcon,renderSortIcon:re.renderSortIcon,renderRowDetailIcon:re.renderRowDetailIcon,renderSelectionCheckBox:re.renderSelectionCheckBox,renderHeaderSelectionCheckBox:re.renderHeaderSelectionCheckBox,headerStyle:re.headerStyle,headerClassName:re.headerClassName,columnGroup:re.columnGroup,getValueToEdit:re.getValueToEdit,getValueToPersist:re.getValueToPersist,shouldAcceptEdit:re.shouldAcceptEdit,field:_o,...G,components:{...re.components,...G.components},computedResizable:vT,computedMinWidth:pT,computedMaxWidth:fT,computedFlex:dT,computedDataType:Wl,computedEditable:TT,computedSortType:CT,computedFilterType:Ru,cssEllipsis:Iu,headerCssEllipsis:ST,computedFilterValue:Ti,computedFiltered:wu,computedFilterable:bT,computedGroupable:jl,computedGroupedBy:vu,computedGroupedByIndex:RT,computedWidth:Tu,computedAbsoluteOffset:gT,computedPinningOffset:mT,computedVisibleIndexInCategory:bi,computedOffset:N,computedSortable:wT,computedSortInfo:ae,computedSortIndex:bu,computedMultiSort:g,computedSorted:Ee,computedSortedAsc:Ze,computedSortedDesc:Ct,computedVisibleIndex:j,computedPinned:Et,computedDraggable:C??G.defaultDraggable??T??QT,computedFirstInCategory:hT,computedLastInCategory:yT,computedFirst:ge===0,computedLast:Cu,id:ee,header:G.header??re.header??G.name??G.field};Te&&(N+=Tu,Z.set(Qe.id,Qe),pe[ge]=Qe,Et==="start"&&(ue.push(Qe),ie+=Qe.computedWidth),Et==="end"&&(oe.push(Qe),ne+=Qe.computedWidth),Et||(ce.push(Qe),W+=Qe.computedWidth),le=Et),Qe.groupByForColumn&&(Qe.computedSortType=G.sortType||re.sortType||nC(Qe.groupByForColumn,e,x),be.push(Qe)),J.set(Qe.id,Qe),Qe.field&&!Qe.groupByForColumn&&!We.has(Qe.field)&&We.set(Qe.field,Qe)}),be.forEach(G=>{G.computedSortable=np(G,{fieldsToColumn:We,userColumns:e,columnTypes:x,sortable:f,columnDefaultSortable:D})});let it=new Map;qe.forEach(G=>{let ee=J.get(G);ee&&it.set(G,ee)}),J.forEach(G=>{it.has(G.id)||it.set(G.id,G)});let at=u!=null?Math.min(u,ie):ie,et=d!=null?Math.min(d,ne):ne;return{computedRemainingSpace:t.width-(A+ye+de),computedPinnedStartColumnsWidth:ie,computedPinnedEndColumnsWidth:ne,computedUnpinnedColumnsWidth:W,computedColumnOrder:B,computedPinnedStartColumns:ue,computedPinnedEndColumns:oe,computedUnpinnedOffset:ie,computedPinnedEndOffset:ie+W,computedUnpinnedColumns:ce,computedVisibleColumns:pe,computedColumnsMap:J,computedColumnsMapInInitialOrder:it,computedVisibleColumnsMap:Z,computedPinnedEndWidth:et,computedPinnedStartWidth:at,renderSelectionCheckBox:pe.reduce((G,ee)=>G||!!ee.renderSelectionCheckBox,!1),fieldsToColumn:We}};function np(n,e){let{sortable:t,fieldsToColumn:o,columnDefaultSortable:r,userColumns:i,columnTypes:a}=e;if(t)return t;let l=n.defaultSortable??n.colType.defaultSortable;if(l!=null)return l;let s=r??Hi,c=n.sortType??n.colType.sortType;return c!=null&&c!==pn&&s?!0:d=>{let{column:p,api:f}=d,m=p.groupByForColumn||[];return m!=null&&!Array.isArray(m)&&(m=[m]),(m||[]).reduce((g,h)=>{if(!g)return!1;let S=h.field||h.groupField,y;if(S){let C=o.get(S),T=C?f.getColumnApi(C.id):void 0;if(C&&T)y=T.isSortable();else{let I=oo(i,S);if(I){let b=Ts(I,{colType:Ko(I,a??{}),sortable:t,columnDefaultSortable:r});y=typeof b=="boolean"?b:void 0}else y=!1}}return y===void 0&&h.valueGetter&&(y=!0),y??r??Hi},!0)}}function St(n,e){let{getComputed:t,getState:o,actions:r,api:i}=e;typeof n=="number"&&(n=t().computedVisibleColumns[n]);let a=typeof n=="string"?t().computedColumnsMap.get(n):n;if(!a)return null;let l={getCellValuesByPrimaryKey(s){return e.api.getCellValues({columnId:a.id,primaryKey:s})},getCellValueByPrimaryKey(s){return l.getCellValuesByPrimaryKey(s)?.value??null},toggleContextMenu(s){o().columnMenuVisibleForColumnId===a.id?this.hideContextMenu():this.showContextMenu(s)},toggleFilterOperatorMenu(s){o().filterOperatorMenuVisibleForColumnId===a.id?this.hideFilterOperatorMenu():this.showFilterOperatorMenu(s)},showFilterOperatorMenu(s){o().onFilterOperatorMenuClick({target:s,column:a})},hideFilterOperatorMenu(){i.hideFilterOperatorMenu()},showContextMenu(s){o().onColumnMenuClick({target:s,column:a})},hideContextMenu(){r.columnMenuVisibleForColumnId=null},isVisible(){return t().computedVisibleColumnsMap.has(a.id)},setVisible(s){i.setVisibilityForColumn(a.id,s)},toggleSort(s={multiSortBehavior:"replace"}){return i.toggleSortingForColumn(a.id,s)},isSortable(){let{computedColumnsMap:s}=t();return typeof a.computedSortable=="function"?a.computedSortable({api:i,columnApi:l,column:a,columns:s}):a.computedSortable},getSortDir(){return i.getSortingForColumn(a.id)},setFilter(s){return i.setColumnFilter(a.id,s)},clearFilter(){return i.clearColumnFilter(a.id)},getSortInfo(){return i.getSortInfoForColumn(a.id)},setSort(s){s?i.setSortingForColumn(a.id,s):i.setSortInfoForColumn(a.id,null)},clearSort(){this.setSort(null)},getColumnId(){return a.id},getComputedColumn(){return a}};return l}function op(n,e,t){let{api:o,getComputed:r,getDataSourceState:i,actions:a,dataSourceActions:l,dataSourceApi:s}=e,c=i(),{allRowsSelected:u,someRowsSelected:d,selectionMode:p}=c,f=r(),m=St(n.id,{...e,actions:a,dataSourceActions:l,dataSourceApi:s});return{horizontalLayoutPageIndex:null,column:n,columnApi:m,dataSourceApi:s,renderLocation:t,dragging:!1,columnsMap:f.computedColumnsMap,columnSortInfo:n.computedSortInfo,columnFilterValue:n.computedFilterValue,filtered:n.computedFiltered,allRowsSelected:u,someRowsSelected:d,selectionMode:p,api:o,renderBag:{header:n.name||n.id||""}}}function Bo(n,e,t,o){let r=typeof n=="string"?e.getComputed().computedColumnsMap.get(n):n,i=r.header;if(typeof i=="function"){let a=op(r,e,t),l=i(a)??null;return o?o(l,a):l}return i?o?o(i,op(r,e,t)):i:r.name||r.id||""}var rp=H(require("react"));var Wo=`${yt}HeaderCell__filter`,Ki=`${yt}HeaderCell__filterOperator`,SM=`${Wo}__input`;var Cs=rp.createContext(null);var ap=require("react");var ip=require("react"),Is;function Bi(){return Is||(Is=(0,ip.createContext)(null))}function te(n){let e=Bi(),t=(0,ap.useContext)(e);return Fo(t,n)}function Ke(){return te(n=>({getState:n.getState,actions:n.actions,getComputed:n.getComputed,getDataSourceState:n.getDataSourceState,dataSourceApi:n.dataSourceApi,dataSourceActions:n.dataSourceActions,api:n.api,getDataSourceMasterContext:n.getDataSourceMasterContext}))}var oC=`${Wo}__input`,Wi=n=>n.stopPropagation();function lp(n){let{filterOperatorMenuVisibleForColumnId:e}=te(u=>({filterOperatorMenuVisibleForColumnId:u.state.filterOperatorMenuVisibleForColumnId})),{column:t}=Nr(),o=n.filterEditor,r=n.filterOperatorSwitch,[i,a]=(0,Fr.useState)(!1),l=dt.useCallback(()=>{a(!0)},[]),s=dt.useCallback(()=>{a(!1)},[]),c=e===t.id||i;return dt.createElement("div",{onPointerUp:Wi,onPointerDown:Wi,onFocus:l,onBlur:s,className:`${Wo} ${ms({active:c})}`,style:{height:n.columnHeaderHeight}},dt.createElement(Cs.Provider,{value:n},dt.createElement(r,null),dt.createElement(o,null)))}function sp(){let{columnApi:n,disabled:e,operator:t}=jo(),o=t?.components?.Icon??Ho;return dt.createElement("div",{"data-name":"filter-operator","data-disabled":e,onMouseDown:r=>{r.stopPropagation(),!e&&n.toggleFilterOperatorMenu(r.target)},className:$(Ki,Ld,e?`${Ki}--disabled`:"")},dt.createElement(o,{size:20,className:`${kd({disabled:e})}`}))}function cp(){return dt.createElement("div",{onPointerUp:Wi,onPointerDown:Wi,className:`${Wo} ${ms({active:!1})} ${nd["50%"]}`})}function jo(){let n=Ke(),{column:e,columnApi:t}=Nr(),o=Bo(e,n,"column-filter"),r=dt.useContext(Cs),{columnFilterType:i,filterTypes:a,columnFilterValue:l}=r,s=a[i],[c,u]=(0,Fr.useState)(l?.filter.value??""),d=dt.useCallback(h=>{u(h),r.onChange(h)},[r.onChange]),p=dt.useCallback(()=>{n.api.clearColumnFilter(e.id)},[e.id]),f=dt.useCallback(()=>{n.api.removeColumnFilter(e.id)},[e.id]);(0,Fr.useEffect)(()=>{if(l)c!==l.filter.value&&u(l.filter.value);else if(s){let h=[...s.emptyValues][0];h!==c&&u(h)}},[l?.filter.value]);let m=r.operator,g=m?.name;return{api:n.api,column:e,columnFilterValue:l,columnApi:t,operatorName:g,operator:m,value:c,disabled:l?.disabled,filterType:s,filterTypes:a,filterTypeKey:i,filtered:e.computedFiltered,setValue:d,clearValue:p,removeColumnFilter:f,ariaLabel:`Filter for ${o}`,className:`${Fd} ${oC}`}}function Uo(){let{ariaLabel:n,value:e,setValue:t,className:o,disabled:r}=jo();return Rs.createElement("input",{"data-xxx":!0,"aria-label":n,type:"text",disabled:r,value:e,onChange:i=>{t(i.target.value)},className:o})}function ji(){let{ariaLabel:n,value:e,setValue:t,className:o,disabled:r}=jo();return Rs.createElement("input",{"aria-label":n,type:"number","data-yyy":!0,disabled:r,value:e??"",onChange:i=>{let a=isNaN(i.target.valueAsNumber)?i.target.value:i.target.valueAsNumber;t(a)},className:o})}var Zt=(n,e)=>{let t=n?.[e];return t?{components:{Icon:t}}:{}};function up(n={}){let{StringFilterEditor:e,NumberFilterEditor:t,icons:o}=n;return{string:{label:"Text",emptyValues:[""],defaultOperator:"includes",components:e?{FilterEditor:e}:void 0,operators:[{name:"includes",...Zt(o,"includes"),label:"Includes",fn:({currentValue:r,filterValue:i})=>typeof r=="string"&&typeof i=="string"&&r.toLowerCase().includes(i.toLowerCase())},{label:"Equals",...Zt(o,"eq"),name:"eq",fn:({currentValue:r,filterValue:i})=>typeof r=="string"&&r===i},{name:"startsWith",...Zt(o,"startsWith"),label:"Starts With",fn:({currentValue:r,filterValue:i})=>r.startsWith(i)},{name:"endsWith",...Zt(o,"endsWith"),label:"Ends With",fn:({currentValue:r,filterValue:i})=>r.endsWith(i)}]},number:{label:"Number",emptyValues:["",null,void 0],defaultOperator:"eq",components:t?{FilterEditor:t}:void 0,operators:[{label:"Equals",...Zt(o,"eq"),name:"eq",fn:({currentValue:r,filterValue:i})=>r==i},{label:"Not Equals",...Zt(o,"neq"),name:"neq",fn:({currentValue:r,filterValue:i})=>r!=i},{name:"gt",label:"Greater Than",...Zt(o,"gt"),fn:({currentValue:r,filterValue:i,emptyValues:a})=>a.includes(r)?!0:r>i},{name:"gte",...Zt(o,"gte"),label:"Greater Than or Equal",fn:({currentValue:r,filterValue:i,emptyValues:a})=>a.includes(r)?!0:r>=i},{name:"lt",...Zt(o,"lt"),label:"Less Than",fn:({currentValue:r,filterValue:i,emptyValues:a})=>a.includes(r)?!0:r<i},{name:"lte",...Zt(o,"lte"),label:"Less Than or Equal",fn:({currentValue:r,filterValue:i,emptyValues:a})=>a.includes(r)?!0:r<=i}]}}}var Nn=up({StringFilterEditor:Uo,NumberFilterEditor:ji,icons:{includes:hd,eq:Sd,neq:Rd,startsWith:wd,endsWith:yd,gt:Td,gte:bd,lt:Id,lte:Cd}});function Ui(n,e,t,o){let r=[...e],i={filtered:n.computedFiltered,first:n.computedFirst,last:n.computedLast,groupByField:!!n.groupByForColumn,firstInCategory:n.computedFirstInCategory,lastInCategory:n.computedLastInCategory,pinned:n.computedPinned||!1,cellSelected:o.cellSelected||!1,rowSelected:o.rowSelected??"null",rowActive:o.rowActive,dragging:o.dragging,insideDisabledDraggingPage:o.insideDisabledDraggingPage,firstRow:o.firstRow??!1,firstRowInHorizontalLayoutPage:o.firstRowInHorizontalLayoutPage??!1,rowDisabled:o.rowDisabled,groupRow:o.groupRow,groupCell:o.groupCell,treeNode:o.treeNode,verticalAlign:o.verticalAlign,align:o.align,zebra:o.zebra},a=t(i);return r.push(a),n.computedFirst&&r.push(...e.map(l=>`${l}--first`)),n.groupByForColumn&&r.push(...e.map(l=>`${l}--group-column`)),n.computedLast&&r.push(...e.map(l=>`${l}--last`)),n.computedFirstInCategory&&r.push(...e.map(l=>`${l}--first-in-category`)),n.computedLastInCategory&&r.push(...e.map(l=>`${l}--last-in-category`)),o.rowSelected===null?r.push(...e.map(l=>`${l}--row-partially-selected`)):o.rowSelected&&r.push(...e.map(l=>`${l}--row-selected`)),o.cellSelected&&r.push(...e.map(l=>`${l}--cell-selected`)),o.firstRow&&r.push(...e.map(l=>`${l}--first-row`)),o.firstRowInHorizontalLayoutPage&&r.push(...e.map(l=>`${l}--first-row-in-horizontal-layout-page`)),o.rowDisabled&&r.push(...e.map(l=>`${l}--disabled`)),o.treeNode&&r.push(...e.map(l=>`${l}--tree-node ${l}-tree-${o.treeNode}-node`)),o.groupRow&&(r.push(...e.map(l=>`${l}--group-row`)),r.push(...e.map(l=>`${l}--${o.rowExpanded?"group-row-expanded":"group-row-collapsed"}`))),n.computedPinned?r.push(...e.map(l=>`${l}--pinned-${n.computedPinned}`)):r.push(...e.map(l=>`${l}--unpinned`)),r.filter(Boolean).join(" ")}var Zo=require("react"),Zp=require("react-dom");function Ln(n,e){let t=n;if(!t)return null;if(t&&t.matches(e))return t;for(;t=t.parentElement;)if(t.matches(e))return t;return null}function dp(n,e,t){let o=n;if(!o)return null;if(o&&o.matches(e))return o;for(;o=o.parentElement;){if(o.matches(e))return o;if(o===t)return null}return null}var q={currentColumnTransformX:"var(--_16hkbkc0)",y:"var(--_16hkbkc1)",currentFlashingBackground:"var(--_16hkbkc2)",currentFlashingDuration:"var(--_16hkbkc3)",activeCellRowOffset:"var(--_16hkbkc4)",activeCellRowOffsetX:"var(--_16hkbkc5)",activeCellRowHeight:"var(--_16hkbkc6)",activeCellOffsetX:"var(--_16hkbkc7)",activeCellOffsetY:"var(--_16hkbkc8)",scrollTopForActiveRow:"var(--_16hkbkc9)",scrollLeftForActiveRowWhenHorizontalLayout:"var(--_16hkbkca)",activeCellColWidth:"var(--_16hkbkcb)",activeCellColOffset:"var(--_16hkbkcc)",columnReorderEffectDurationAtIndex:"var(--_16hkbkcd)",columnWidthAtIndex:"var(--_16hkbkce)",columnOffsetAtIndex:"var(--_16hkbkcf)",columnOffsetAtIndexWhileReordering:"var(--_16hkbkcg)",columnVisibilityAtIndex:"var(--_16hkbkch)",columnZIndexAtIndex:"var(--_16hkbkci)",pinnedStartWidth:"var(--_16hkbkcj)",pinnedEndWidth:"var(--_16hkbkck)",pinnedEndOffset:"var(--_16hkbkcl)",computedVisibleColumnsCount:"var(--_16hkbkcm)",baseZIndexForCells:"var(--_16hkbkcn)",bodyWidth:"var(--_16hkbkco)",bodyHeight:"var(--_16hkbkcp)",scrollbarWidthHorizontal:"var(--_16hkbkcq)",scrollbarWidthVertical:"var(--_16hkbkcr)",scrollLeft:"var(--_16hkbkcs)",scrollTop:"var(--_16hkbkct)"};var $i="true",fe={loaded:"var(--infinite-loaded)",themeName:"var(--infinite-theme-name)",themeMode:"var(--infinite-theme-mode)",color:{accent:"var(--infinite-accent-color)",success:"var(--infinite-success-color)",error:"var(--infinite-error-color)",color:"var(--infinite-color)"},spacing:{0:"var(--infinite-space-0)",1:"var(--infinite-space-1)",2:"var(--infinite-space-2)",3:"var(--infinite-space-3)",4:"var(--infinite-space-4)",5:"var(--infinite-space-5)",6:"var(--infinite-space-6)",7:"var(--infinite-space-7)",8:"var(--infinite-space-8)",9:"var(--infinite-space-9)",10:"var(--infinite-space-10)"},fontSize:{0:"var(--infinite-font-size-0)",1:"var(--infinite-font-size-1)",2:"var(--infinite-font-size-2)",3:"var(--infinite-font-size-3)",4:"var(--infinite-font-size-4)",5:"var(--infinite-font-size-5)",6:"var(--infinite-font-size-6)",7:"var(--infinite-font-size-7)"},fontFamily:"var(--infinite-font-family)",baseFontSize:"var(--infinite-font-size)",minHeight:"var(--infinite-min-height)",borderRadius:"var(--infinite-border-radius)",focusOutline:"var(--infinite-focus-outline)",background:"var(--infinite-background)",iconSize:"var(--infinite-icon-size)",rowHeight:"var(--infinite-row-height)",densityScale:"var(--infinite-density-scale)",icons:{expandCollapse:"var(--infinite-icon-expand-collapse)",loading:"var(--infinite-icon-loading)",sortAsc:"var(--infinite-icon-sort-asc)",sortDesc:"var(--infinite-icon-sort-desc)",filter:"var(--infinite-icon-filter)",menu:"var(--infinite-icon-menu)",done:"var(--infinite-icon-done)",clear:"var(--infinite-icon-clear)",hidden:"var(--infinite-icon-hidden)",filterOperatorContains:"var(--infinite-icon-filter-operator-contains)",filterOperatorStartsWith:"var(--infinite-icon-filter-operator-starts-with)",filterOperatorEndsWith:"var(--infinite-icon-filter-operator-ends-with)",filterOperatorEq:"var(--infinite-icon-filter-operator-eq)",filterOperatorNeq:"var(--infinite-icon-filter-operator-neq)",filterOperatorGt:"var(--infinite-icon-filter-operator-gt)",filterOperatorGte:"var(--infinite-icon-filter-operator-gte)",filterOperatorLt:"var(--infinite-icon-filter-operator-lt)",filterOperatorLte:"var(--infinite-icon-filter-operator-lte)"},runtime:{bodyWidth:"var(--infinite-runtime-body-content-width)",totalVisibleColumnsWidthValue:"var(--infinite-runtime-total-visible-columns-width)",totalVisibleColumnsWidthVar:"var(--infinite-runtime-total-visible-columns-width-var)",visibleColumnsCount:"var(--infinite-runtime-visible-columns-count)",browserScrollbarWidth:"var(--infinite-runtime-browser-scrollbar-width)"},components:{GroupingToolbar:{color:"var(--infinite-grouping-toolbar-color)",background:"var(--infinite-grouping-toolbar-background)",rejectBackground:"var(--infinite-grouping-toolbar-reject-background)",activeBackground:"var(--infinite-grouping-toolbar-active-background)",activeBackgroundAlpha:"var(--infinite-grouping-toolbar-active-background-alpha)",padding:"var(--infinite-grouping-toolbar-padding)",border:"var(--infinite-grouping-toolbar-border)",rejectBorder:"var(--infinite-grouping-toolbar-reject-border)",gap:"var(--infinite-grouping-toolbar-gap)"},GroupingToolbarItem:{border:"var(--infinite-grouping-toolbar-item-border)",borderRadius:"var(--infinite-grouping-toolbar-item-border-radius)",activeBorder:"var(--infinite-grouping-toolbar-item-active-border)",background:"var(--infinite-grouping-toolbar-item-background)",activeBackground:"var(--infinite-grouping-toolbar-item-active-background)",activeBackgroundAlpha:"var(--infinite-grouping-toolbar-item-active-background-alpha)"},LoadMask:{padding:"var(--infinite-load-mask-padding)",color:"var(--infinite-load-mask-color)",textBackground:"var(--infinite-load-mask-text-background)",overlayBackground:"var(--infinite-load-mask-overlay-background)",overlayOpacity:"var(--infinite-load-mask-overlay-opacity)",borderRadius:"var(--infinite-load-mask-border-radius)"},Header:{background:"var(--infinite-header-background)",color:"var(--infinite-header-color)",columnHeaderHeight:"var(--infinite-column-header-height)"},HeaderCell:{background:"var(--infinite-header-cell-background)",hoverBackground:"var(--infinite-header-cell-hover-background)",border:"var(--infinite-header-cell-border)",padding:"var(--infinite-header-cell-padding)",paddingX:"var(--infinite-header-cell-padding-x)",paddingY:"var(--infinite-header-cell-padding-y)",iconSize:"var(--infinite-header-cell-icon-size)",menuIconLineWidth:"var(--infinite-header-cell-menu-icon-line-width)",sortIconMargin:"var(--infinite-header-cell-sort-icon-margin)",borderRight:"var(--infinite-header-cell-border-right)",resizeHandleActiveAreaWidth:"var(--infinite-resize-handle-active-area-width)",resizeHandleWidth:"var(--infinite-resize-handle-width)",resizeHandleHoverBackground:"var(--infinite-resize-handle-hover-background)",resizeHandleConstrainedHoverBackground:"var(--infinite-resize-handle-constrained-hover-background)",filterOperatorPaddingX:"var(--infinite-filter-operator-padding-x)",filterEditorPaddingX:"var(--infinite-filter-editor-padding-x)",filterEditorMarginX:"var(--infinite-filter-editor-margin-x)",filterOperatorPaddingY:"var(--infinite-filter-operator-padding-y)",filterEditorPaddingY:"var(--infinite-filter-editor-padding-y)",filterEditorMarginY:"var(--infinite-filter-editor-margin-y)",filterEditorBackground:"var(--infinite-filter-editor-background)",filterEditorBorder:"var(--infinite-filter-editor-border)",filterEditorFocusBorderColor:"var(--infinite-filter-editor-focus-border-color)",filterEditorBorderRadius:"var(--infinite-filter-editor-border-radius)",filterEditorColor:"var(--infinite-filter-editor-color)"},ActiveCellIndicator:{inset:"var(--infinite-active-cell-indicator-inset)"},Cell:{flashingDuration:"var(--infinite-flashing-duration)",flashingAnimationName:"var(--infinite-flashing-animation-name)",flashingOverlayZIndex:"var(--infinite-flashing-overlay-z-index)",flashingBackground:"var(--infinite-flashing-background)",flashingUpBackground:"var(--infinite-flashing-up-background)",flashingDownBackground:"var(--infinite-flashing-down-background)",padding:"var(--infinite-cell-padding)",paddingX:"var(--infinite-cell-padding-x)",paddingY:"var(--infinite-cell-padding-y)",borderWidth:"var(--infinite-cell-border-width)",borderColor:"var(--infinite-cell-border-color)",border:"var(--infinite-cell-border)",borderLeft:"var(--infinite-cell-border-left)",borderRight:"var(--infinite-cell-border-right)",borderTop:"var(--infinite-cell-border-top)",borderInvisible:"var(--infinite-cell-border-invisible)",borderRadius:"var(--infinite-cell-border-radius)",reorderEffectDuration:"var(--infinite-column-reorder-effect-duration)",pinnedBorder:"var(--infinite-pinned-cell-border)",horizontalLayoutColumnReorderDisabledPageOpacity:"var(--infinite-horizontal-layout-column-reorder-disabled-page-opacity)",color:"var(--infinite-cell-color)",selectedBackground:"var(--infinite-selected-cell-background)",selectedBackgroundDefault:"var(--infinite-selected-cell-background-default)",selectedBackgroundAlpha:"var(--infinite-selected-cell-background-alpha)",selectedBackgroundAlphaWhenTableUnfocused:"var(--infinite-selected-cell-background-alpha--table-unfocused)",selectedBorderColor:"var(--infinite-selected-cell-border-color)",selectedBorderWidth:"var(--infinite-selected-cell-border-width)",selectedBorderStyle:"var(--infinite-selected-cell-border-style)",selectedBorder:"var(--infinite-selected-cell-border)",activeBackgroundAlpha:"var(--infinite-active-cell-background-alpha)",activeBackgroundAlphaWhenTableUnfocused:"var(--infinite-active-cell-background-alpha--table-unfocused)",activeBackground:"var(--infinite-active-cell-background)",activeBackgroundDefault:"var(--infinite-active-cell-background-default)",activeBorderColor:"var(--infinite-active-cell-border-color)",activeBorderWidth:"var(--infinite-active-cell-border-width)",activeBorderStyle:"var(--infinite-active-cell-border-style)",activeBorder:"var(--infinite-active-cell-border)"},SelectionCheckBox:{marginInline:"var(--infinite-selection-checkbox-margin-inline)"},ExpandCollapseIcon:{color:"var(--infinite-expand-collapse-icon-color)"},Menu:{background:"var(--infinite-menu-background)",color:"var(--infinite-menu-color)",separatorColor:"var(--infinite-menu-separator-color)",padding:"var(--infinite-menu-padding)",cellPaddingVertical:"var(--infinite-menu-cell-padding-vertical)",cellPaddingHorizontal:"var(--infinite-menu-cell-padding-horizontal)",cellMarginVertical:"var(--infinite-menu-cell-margin-vertical)",itemDisabledBackground:"var(--infinite-menu-item-disabled-background)",itemActiveBackground:"var(--infinite-menu-item-active-background)",itemActiveOpacity:"var(--infinite-menu-item-active-opacity)",itemPressedOpacity:"var(--infinite-menu-item-pressed-opacity)",itemPressedBackground:"var(--infinite-menu-item-pressed-background)",itemDisabledOpacity:"var(--infinite-menu-item-disabled-opacity)",borderRadius:"var(--infinite-menu-border-radius)",shadowColor:"var(--infinite-menu-shadow-color)"},RowDetail:{background:"var(--infinite-rowdetail-background)",padding:"var(--infinite-rowdetail-padding)",gridHeight:"var(--infinite-rowdetail-grid-height)"},Row:{background:"var(--infinite-row-background)",oddBackground:"var(--infinite-row-odd-background)",disabledBackground:"var(--infinite-row-disabled-background)",oddDisabledBackground:"var(--infinite-row-odd-disabled-background)",selectedBackground:"var(--infinite-row-selected-background)",disabledOpacity:"var(--infinite-row-disabled-opacity)",activeBackground:"var(--infinite-active-row-background)",activeBorderColor:"var(--infinite-active-row-border-color)",activeBorderWidth:"var(--infinite-active-row-border-width)",activeBorderStyle:"var(--infinite-active-row-border-style)",activeBorder:"var(--infinite-active-row-border)",activeBackgroundAlpha:"var(--infinite-active-row-background-alpha)",activeBackgroundAlphaWhenTableUnfocused:"var(--infinite-active-row-background-alpha--table-unfocused)",hoverBackground:"var(--infinite-row-hover-background)",selectedHoverBackground:"var(--infinite-row-selected-hover-background)",selectedDisabledBackground:"var(--infinite-row-selected-disabled-background)",groupRowBackground:"var(--infinite-group-row-background)",groupRowColumnNesting:"var(--infinite-group-row-column-nesting)",groupNesting:"var(--infinite-dont-override-group-row-nesting-length)",pointerEventsWhileScrolling:"var(--infinite-row-pointer-events-while-scrolling)"},ColumnCell:{background:"var(--infinite-column-cell-bg-dont-override)"}}},pp="column-header-height";var fp=`.${ze.rootClassName}`;function ws(n){return Ln(n,fp)}var mp=Y(q.scrollLeft),rC=Y(q.scrollTop),iC=Y(q.columnWidthAtIndex),vs=Y(q.columnOffsetAtIndex),gp=Y(q.columnReorderEffectDurationAtIndex),aC=Y(q.columnOffsetAtIndexWhileReordering),lC=Y(q.columnVisibilityAtIndex),sC=Y(q.columnZIndexAtIndex);function Qt(n,e,t){let o=t?ws(t):document.querySelector(fp);cC(n,e,o)}function cC(n,e,t){if(t){let o=n,r=q[o]?Y(q[o]):n;t.style.setProperty(r,`${e}`)}}function $o(n,e){if(e)for(var t in n){let o=q[t]?Y(q[t]):t,r=`${n[t]}`;e.style.setProperty(o,r)}}function Ps(n,e,t){Qt(`${vs}-${n.computedVisibleIndex}`,n.computedPinned?`calc( ${n.computedAbsoluteOffset+e}px + var(${mp}))`:`${n.computedAbsoluteOffset+e}px`,t)}function xs(n,e,t){Qt(`${sC}-${n}`,`${e}`,t)}function Lr(n,e,t){Qt(`${aC}-${n}`,typeof e=="number"?`calc( var(${vs}-${n}) + ${e}px )`:e,t)}function kr(n,e,t){Qt(`${lC}-${n}`,e,t)}function Yi(n,e,t){Qt(`${gp}-${n}`,t??"",e)}function Ds(n,e){let t=`${gp}-${n}`;Qt(t,fe.components.Cell.reorderEffectDuration,e)}var Re={columnWidths:{get(n){return`var(${this.getVarName(n)})`},getVarName(n){return this.varName.get(n)},varName:{get(n){return`${iC}-${n}`}},set(n,e,t){e=typeof e=="number"?e+"px":e,Qt(this.varName.get(n),e,t)}},columnOffsets:{get(n){return`var(${this.getVarName(n)})`},getVarName(n){return this.varName.get(n)},varName:{get(n){return`${vs}-${n}`}},set(n,e,t){e=typeof e=="number"?e+"px":e,Qt(this.varName.get(n),e,t)}}};function hp(n,e){$o({[mp]:`${n.scrollLeft}px`,[rC]:`${n.scrollTop}px`},e)}var yp="_16lm1iw1",Sp="_1yeub2v0 _16lm1iw1 _16lm1iw1p _16lm1iw2f _16lm1iw0",bp="_1yeub2vs",Tp="_1yeub2vr",Cp=he({defaultClassName:"_1yeub2v2",variantClassNames:{horizontalLayout:{true:"_1yeub2v3",false:"_1yeub2v4"},focused:{true:"_1yeub2v5",false:"_1yeub2v6"},focusedWithin:{true:"_1yeub2v7",false:"_1yeub2v8"},hasPinnedStart:{true:"_1yeub2v9",false:"_1yeub2va"},hasPinnedEnd:{true:"_1yeub2vb",false:"_1yeub2vc"},hasPinnedStartOverflow:{true:"_1yeub2vd",false:"_1yeub2ve"},hasPinnedEndOverflow:{true:"_1yeub2vf",false:"_1yeub2vg"}},defaultVariants:{},compoundVariants:[[{focused:!1,focusedWithin:!1},"_1yeub2vh"]]});var Ms="_1yeub2vp";var fE=he({defaultClassName:"_1yeub2vl",variantClassNames:{pinned:{start:"_1yeub2vm",end:"_1yeub2vn",false:"_1yeub2vo"}},defaultVariants:{},compoundVariants:[]});var Ep=require("react");var zr={bodyWidth:{name:Y(fe.runtime.bodyWidth),value:""},totalVisibleColumnsWidthValue:{name:Y(fe.runtime.totalVisibleColumnsWidthValue),value:""},totalVisibleColumnsWidthVar:{name:Y(fe.runtime.totalVisibleColumnsWidthVar),value:""},visibleColumnsCount:{name:Y(fe.runtime.visibleColumnsCount),value:""},browserScrollbarWidth:{name:Y(fe.runtime.browserScrollbarWidth),value:""}},uC=Y(q.scrollbarWidthHorizontal),Ip=Y(q.scrollbarWidthVertical),dC=Y(q.columnWidthAtIndex),pC=Y(q.columnZIndexAtIndex),Rp=Y(q.scrollLeft),fC=Y(q.activeCellColWidth),wp=Y(q.activeCellColOffset),Dp=Y(q.baseZIndexForCells),mC=Y(q.pinnedStartWidth),vp=Y(q.bodyWidth),gC=Y(q.bodyHeight),Pp=Y(q.pinnedEndOffset),xp=Y(q.pinnedEndWidth),hC=Y(q.computedVisibleColumnsCount);function qi(n,e){let t="auto",o=n.computedVisibleIndex;return n.computedPinned?n.computedPinned==="start"?t=e.pinnedStartColsCount-n.computedVisibleIndexInCategory:n.computedPinned==="end"&&(t=e.visibleColsCount+n.computedVisibleIndexInCategory):t=-o*10,typeof t=="number"?`calc( var(${Dp}) `+(t<0?"-":"+")+` ${Math.abs(t)} )`:"auto"}function Mp(n){let{computedVisibleColumns:e,computedPinnedStartColumns:t,computedPinnedEndColumns:o,computedPinnedStartColumnsWidth:r,computedPinnedEndColumnsWidth:i,computedUnpinnedColumnsWidth:a,bodySize:l,activeCellIndex:s,brain:c,scrollbars:u}=n,d=Xt(),p=[],f=e.reduce((m,g)=>{let h=g.computedVisibleIndex;m[Re.columnWidths.varName.get(h)]=g.computedWidth+"px",m[Re.columnOffsets.varName.get(h)]=g.computedPinned==="start"?`calc( ${g.computedOffset}px + var(${Rp}) )`:g.computedPinned==="end"?`calc( var(${Pp}) ${p.length?"+":""} ${p.map(y=>Re.columnWidths.get(y.computedVisibleIndex)).join(" + ")} + var(${Rp}) )`:`${g.computedOffset}px`;let S=qi(g,{pinnedStartColsCount:t.length,visibleColsCount:e.length});return m[`${pC}-${h}`]=`${S}`,g.computedPinned==="end"&&p.push(g),m},{});if(l.width&&(f[zr.browserScrollbarWidth.name]=`${Xt()}px`),f[zr.bodyWidth.name]=`calc(${q.bodyWidth} - ${q.scrollbarWidthVertical})`,f[zr.totalVisibleColumnsWidthValue.name]=`${r+i+a}px`,f[zr.totalVisibleColumnsWidthVar.name]=`calc(${e.map((m,g)=>`var(${dC}-${g})`).join(" + ")})`,f[zr.visibleColumnsCount.name]=e.length,s!=null){f[fC]=Re.columnWidths.get(s[1]);let m=Re.columnOffsets.get(s[1]);if(c.isHorizontalLayoutBrain){let g=c.getPageIndexForRow(s[0]);f[wp]=g?`calc( ${fe.runtime.totalVisibleColumnsWidthVar} * ${g} + ${m})`:m}else f[wp]=m}return f[hC]=e.length,f[uC]=u.horizontal?`${d}px`:"0px",f[Ip]=u.vertical?`${d}px`:"0px",f[mC]="calc( "+t.map(m=>Re.columnWidths.get(m.computedVisibleIndex)).join(" + ")+")",f[xp]="calc( "+o.map(m=>Re.columnWidths.get(m.computedVisibleIndex)).join(" + ")+")",f[Dp]=e.length*10,f[Pp]=`calc( var(${vp}) - var(${xp}) - var(${Ip}) )`,f[vp]=`${l.width}px`,f[gC]=`${l.height}px`,f}var Es=n=>{let e=0;return(...t)=>{e&&cancelAnimationFrame(e),e=requestAnimationFrame(()=>{e=0,n(...t)})}};function Ap(n){let{actions:e,getState:t,focused:o,focusedWithin:r,domRef:i,scrollerDOMRef:a,onBlurWithin:l,onFocusWithin:s,onSelfFocus:c,onSelfBlur:u,bodySize:d,activeCellIndex:p,wrapRowsHorizontally:f,computedPinnedStartColumnsWidth:m,computedPinnedEndColumnsWidth:g,computedPinnedStartColumns:h,computedPinnedEndColumns:S,computedVisibleColumns:y,computedUnpinnedColumnsWidth:C,scrollbars:T,focusedClassName:I,focusedWithinClassName:b,computedPinnedStartOverflow:R,computedPinnedEndOverflow:w,focusedStyle:v,focusedWithinStyle:P,brain:D}=te(F=>{let{state:B,computed:X}=F;return{brain:B.brain,actions:F.actions,getState:F.getState,focused:B.focused,focusedWithin:B.focusedWithin,domRef:B.domRef,scrollerDOMRef:B.scrollerDOMRef,onBlurWithin:B.onBlurWithin,onFocusWithin:B.onFocusWithin,onSelfFocus:B.onSelfFocus,onSelfBlur:B.onSelfBlur,bodySize:B.bodySize,activeCellIndex:B.activeCellIndex,wrapRowsHorizontally:B.wrapRowsHorizontally,computedPinnedStartColumnsWidth:X.computedPinnedStartColumnsWidth,computedPinnedEndColumnsWidth:X.computedPinnedEndColumnsWidth,computedPinnedStartColumns:X.computedPinnedStartColumns,computedPinnedEndColumns:X.computedPinnedEndColumns,computedVisibleColumns:X.computedVisibleColumns,computedUnpinnedColumnsWidth:X.computedUnpinnedColumnsWidth,scrollbars:X.scrollbars,focusedClassName:F.state.focusedClassName,focusedWithinClassName:F.state.focusedWithinClassName,computedPinnedStartOverflow:X.computedPinnedStartOverflow,computedPinnedEndOverflow:X.computedPinnedEndOverflow,focusedStyle:F.state.focusedStyle,focusedWithinStyle:F.state.focusedWithinStyle}}),M=(0,Ep.useMemo)(()=>Mp({computedVisibleColumns:y,computedPinnedStartColumns:h,computedPinnedEndColumns:S,computedPinnedStartColumnsWidth:m,computedPinnedEndColumnsWidth:g,computedUnpinnedColumnsWidth:C,bodySize:d,activeCellIndex:p,brain:D,scrollbars:T}),[y,h,S,m,g,C,d,p,D,T]),x=Es(F=>{e.focused=F}),E=Es(F=>{e.focusedWithin=F}),N={...n,onFocus:F=>{if(n?.onFocus?.(F),F.target===i.current||F.target===a.current){if(t().focused)return;x(!0),c?.(F),r&&(E(!1),l?.(F));return}r||(E(!0),s?.(F))},onBlur:F=>{if(n?.onBlur?.(F),F.target===i.current||F.target===a.current){if(!t().focused)return;x(!1),u?.(F),r&&(E(!1),l?.(F));return}i.current?.contains(F.relatedTarget)||(E(!1),l?.(F))}},L=$(Jt,Sp,f?`${Jt}--horizontal-layout`:null,N?.className,m?`${Jt}--has-pinned-start ${Tp}`:null,g?`${Jt}--has-pinned-end ${bp}`:null,o?`${Jt}--focused`:null,r?`${Jt}--focused-within`:null,o&&I?I:null,r&&b?b:null,R?`${Jt}--has-pinned-start-overflow`:null,w?`${Jt}--has-pinned-end-overflow`:null,Cp({horizontalLayout:!!f,hasPinnedStart:!!m,hasPinnedEnd:!!g,focused:o,focusedWithin:r}));return N.className=L,N.style={...n?.style,...M},o&&v&&Object.assign(N.style,v),r&&P&&Object.assign(N.style,P),N}var Hp=H(ro());function Xi(n){return n.map(e=>e instanceof kn?e:new kn(null,[e]))}var kn=class n{constructor(e,t=[]){this.__operands=[];this.__operation=null;this.__operands=t,this.__operation=e}add(...e){return new n("+",[this,...e])}subtract(...e){return new n("-",[this,...e])}minus(...e){return this.subtract(...e)}multiply(...e){return new n("*",[this,...e])}divide(...e){return new n("/",[this,...e])}__get(e){let{__operation:t,__operands:o}=this,r=o.map(a=>yC(a,this)).join(` ${t} `);return(o.length<=1?!0:e?.__operation==="+"||e?.__operation==="-")?r:`(${r})`}done(){let e=this.__get();return`calc${e.startsWith("(")&&e.endsWith(")")?e:`(${e})`}`}};function yC(n,e){return typeof n=="string"||typeof n=="number"?`${n}`:e?n.__get(e):n.done()}var SC=(...n)=>new kn("+",Xi(n)),Op=(...n)=>new kn("-",Xi(n)),bC=(...n)=>new kn("*",Xi(n)),TC=(...n)=>new kn("/",Xi(n)),Vr={add:SC,subtract:Op,minus:Op,multiply:bC,divide:TC};var io=(n,e,t)=>{if(n=[...n],e===t||n[e]===void 0||n[t]===void 0)return n;let o=n[e];return t<e,n.splice(e,1),n.splice(t,0,o),n};var He=Fe().requestAnimationFrame||(n=>setTimeout(n,16)),Kt=Fe().cancelAnimationFrame||(n=>clearTimeout(n));var Fp=n=>{let e=null,t=null;return{stop(){e!==null&&Kt(e),t!=null&&Kt(t)},scroll(o){e!==null&&Kt(e),t!=null&&Kt(t);let r={offset:100,scrollAmountsPerRaf:[1,1,2,4,6,8,11,15],...n,...o},i=this;function a(){let s=r.scrollOffsetStart+r.offset-r.mousePosition.clientX;if(!(s>0&&s<=r.offset))return!1;let u=r.scrollAmountsPerRaf.length,d=Math.round(r.offset/u),p=0;for(let f=0;f<u;f++)s>(f+1)*d&&(p=r.scrollAmountsPerRaf[f]);return o.scrollLeft=o.scrollLeft-p,e=He(()=>{i.scroll(o)}),!0}function l(){let s=r.mousePosition.clientX-(r.scrollOffsetEnd-r.offset);if(!(s>0&&s<=r.offset))return!1;let u=r.scrollAmountsPerRaf.length,d=Math.round(r.offset/u),p=0;for(let f=0;f<u;f++)s>(f+1)*d&&(p=r.scrollAmountsPerRaf[f]);return o.scrollLeft=o.scrollLeft+p,t=He(()=>{i.scroll(o)}),!0}return!!(a()||l())}}};var je=class n{constructor(e){this.top=0;this.left=0;this.left=e.left,this.top=e.top}static clone(e){return new n(e)}static from(e){return new n(e)}shift(e){return e.top!=null&&(this.top+=e.top),e.left!=null&&(this.left+=e.left),this}getDistanceToPoint(e){let t=e.top-this.top,o=e.left-this.left;return{top:t,left:o}}};function Np(n,e){let t=Math.atan2(n.top-e.top,n.left-e.left);return t<=0&&(t=2*Math.PI+t),t}function Lp(n,e){return Math.sqrt((e.top-n.top)**2+(e.left-n.left)**2)}function CC(n,e,t){let o=Np(n,t),r=Np(e,t);return o===r?Lp(t,e)-Lp(t,n):o-r}function kp(n){if(n.length<3)return n;let[...e]=n,t={top:0,left:0};return n.forEach(o=>{t.top+=o.top,t.left+=o.left}),t.top/=n.length,t.left/=n.length,e.sort((o,r)=>CC(o,r,t)),e}function IC(n){if(n.length<2)return!1;let e=n[0].left,t=n[0].top,o={left:!1,top:!1};for(let r=1,i=n.length;r<i;r++){if(o.left&&o.top)return!1;n[r].left!==e&&(o.left=!0),n[r].top!==t&&(o.top=!0)}return!(o.left&&o.top)}function RC(n,e){if(n.length<2)return n[0]?n[0].left===e.left&&n[0].top===e.top:!1;n=kp(n);let t=n[0],o=n[n.length-1];return t.left===o.left?e.left===t.left&&e.top>=Math.min(t.top,o.top)&&e.top<=Math.max(t.top,o.top):e.top===t.top&&e.left>=Math.min(t.left,o.left)&&e.left<=Math.max(t.left,o.left)}function zp(n,e){if(IC(n))return RC(n,e);n=kp(n);let[t]=n;for(let o=1,r=n.length-1;o<r;o++){let i=n[o],a=n[o+1];if(wC([t,i,a],e))return!0}return!1}function wC(n,e){let[t,o,r]=n,i=e,a=(o.left-t.left)*(r.top-t.top)-(o.top-t.top)*(r.left-t.left);return a*((o.left-t.left)*(i.top-t.top)-(o.top-t.top)*(i.left-t.left))>=0&&a*((r.left-o.left)*(i.top-o.top)-(r.top-o.top)*(i.left-o.left))>=0&&a*((t.left-r.left)*(i.top-r.top)-(t.top-r.top)*(i.left-r.left))>=0}var Yo=class{containsPoint(e){return zp(this.getPoints(),e)}contains(e){let t=e.getPoints();for(let o=0,r=t.length;o<r;o++)if(!this.containsPoint(t[o]))return!1;return!0}intersects(e){return this.privateIntersects(e,!1)}privateIntersects(e,t){let o=e.getPoints();for(let r=0,i=o.length;r<i;r++)if(this.containsPoint(o[r]))return!0;return t?!1:e.privateIntersects(this,!0)}};var qo=class n extends Yo{static clone(e){return new n(e)}constructor(e){super(),this.points=e.map(je.clone)}getPoints(){return this.points}shift(e){return this.points.forEach(t=>{t.shift(e)}),this}};function vC(n,e){let t=Math.min(n.left,e.left),o=Math.min(n.top,e.top),r=n.left+n.width,i=e.left+e.width,a=Math.max(r,i),l=n.top+n.height,s=e.top+e.height,c=Math.max(l,s);return new _e({top:o,left:t,width:a-t,height:c-o})}var _e=class n extends Yo{constructor(t){super();this.top=0;this.left=0;this.width=0;this.height=0;this.top=t.top,this.left=t.left,typeof t.width=="number"?(this.width=t.width,this.height=t.height):(this.width=t.right-t.left,this.height=t.bottom-t.top)}static fromDOMRect(t){return new n(t)}static clone(t){return new n(t)}static from(t){return n.clone(t)}static fromPoint(t){return n.from({top:t.top,left:t.left,width:0,height:0})}getMinimumBoundingRectangle(...t){let o=this;for(let r of t)o=vC(o,r);return o}toDOMRect(){return{top:this.top,left:this.left,bottom:this.top+this.height,right:this.left+this.width,height:this.height,width:this.width,x:this.left,y:this.top,toJSON:()=>({top:this.top,left:this.left,bottom:this.top+this.height,right:this.left+this.width,height:this.height,width:this.width,x:this.left,y:this.top})}}containsPoint(t){return new qo(this.getPoints()).containsPoint(t)}getTopLeft(){return{left:this.left,top:this.top}}getTopRight(){return{left:this.left+this.width,top:this.top}}getBottomLeft(){return{left:this.left,top:this.top+this.height}}getBottomRight(){return{left:this.left+this.width,top:this.top+this.height}}getCenter(){return{left:this.left+this.width/2,top:this.top+this.height/2}}getPoints(){return[this.getTopLeft(),this.getTopRight(),this.getBottomLeft(),this.getBottomRight()].map(je.from)}shift(t){return t.top!=null&&(this.top+=t.top),t.left!=null&&(this.left+=t.left),this}};var As;function PC(){if(typeof document>"u"||!document.body)return 1/0;let n=document.createElement("div");n.style.cssText="position:absolute;top:0;left:0;width:1px;visibility:hidden;pointer-events:none",document.body.appendChild(n);let e=o=>(n.style.height=`${o}px`,Math.abs(n.getBoundingClientRect().height-o)<1),t=1e6;if(!e(t))return n.remove(),1/0;for(;t<64e6&&e(t*2);)t*=2;return n.remove(),t}function Zi(){return As===void 0&&(As=PC()),As}function Qi(n){return n<=4e6?!1:n>Zi()}function _s(n,e){if(!Qi(n))return 1;let t=Zi()-e,o=n-e;return t>0&&o>0?o/t:1}function Vp(n){let e=null;return{get value(){let t=n.getScrollPosition(),o=n.getScrollRatio();return o>1&&e!==null&&Math.abs(e-t)<=o?e:(e=null,t)},set value(t){e=t,n.setScrollPosition(t)}}}function Os(n,e,t=Math.floor){return Math.abs(n-e)<=1e6?e:t(n)}var Gp=10,xC=Y(q.pinnedStartWidth);function Kp(n){let{computedVisibleColumns:e,computedVisibleColumnsMap:t,computedPinnedEndColumns:o,computedPinnedStartColumns:r,dragColumnId:i,infiniteDOMNode:a,brain:l,dragColumnHeaderTargetRect:s,draggableColumnsRestrictTo:c,tableRect:u,acceptDropToReorderRect:d,allowColumnHideOnDrag:p,setProxyPosition:f,setDragColumnOutside:m,getCurrentDragSourceAndTarget:g,groupingToolbarDragListId:h,api:S,horizontalLayoutPageIndex:y,pageWidth:C}=n;function T(Z){let J=Z==="start"?F:B;return V===L?J:L===Z?J+E.computedWidth:V===Z?J-E.computedWidth:J}function I(Z){if(Z.columnIndex===z||y!=null)return!0;let J=e[Z.columnIndex];if(J.computedPinned)return!0;let W=l.getScrollPosition().scrollLeft,ie=J.computedOffset+(y!=null&&C!=null?C*y:0);return ie>=W+T("start")&&ie+J.computedWidth<=W+u.width-T("end")}let b=(Z,J)=>{let{restrictToParentGroup:W,dragColumn:ie}=J,ne=[];if(Z.forEach(O=>{if(O.computedVisibleIndex===z)return;let A={columnId:O.id,columnIndex:O.computedVisibleIndex,offsetX:O.computedOffset+Math.round(O.computedWidth/2)};I(A)&&ne.push(A)}),W){let A=function(ye,we,be){let Me=Z[ye];Me&&(Me.columnGroup!==ie.columnGroup&&be.add(Me.id),A(ye+we,we,be))};var le=A;let O=ie.computedVisibleIndex,de=new Set;A(O-1,-1,de),A(O+1,1,de),ne=ne.filter(ye=>!de.has(ye.columnId))}return ne},w=r.length,v={clientX:Math.round(n.initialMousePosition.clientX),clientY:Math.round(n.initialMousePosition.clientY)},P={left:v.clientX-u.left-(v.clientX-s.left)+Gp,top:v.clientY-u.top-(v.clientY-s.top)+Gp},D=l.getScrollPosition(),M=e.map(Z=>Z.computedVisibleIndex),x=M,E=t.get(i),z=E.computedVisibleIndex,V=E?.computedPinned,N=z,L=V,F=l.getFixedStartColsWidth(),B=l.getFixedEndColsWidth(),X=v,_={x:0,y:0},k=1,K=0;function Q(Z){let J=Math.round(Z.clientX),W=Math.round(Z.clientY);if(J===X.clientX&&W===X.clientY)return _e.from(s).shift({left:_.x,top:_.y});X={clientX:J,clientY:W};let ne=l.getScrollPosition().scrollLeft-D.scrollLeft;return _.x=X.clientX-v.clientX,_.y=X.clientY-v.clientY,K=_.x+ne,k=K<0?-1:1,f({left:P.left+_.x,top:P.top+_.y}),_e.from(s).shift({left:_.x,top:_.y})}function Ie(Z){let J=0;V?V==="start"&&Z.forEach((W,ie)=>{J||e[W]?.computedPinned!=="start"&&(J=ie)}):Z.forEach((W,ie)=>{e[W]?.computedPinned==="start"&&(J=ie+1)}),w=J,se("start",Z,J)}function se(Z,J,W){if(Z==="start"){let ie=0;for(let ne=0;ne<W;ne++){let le=J[ne],O=e[le];ie+=O.computedWidth}Qt(xC,`${ie}px`,a)}}function me(Z){if(Z==null||Z===N)return;if(N===-1&&Z!==-1&&(kr(z,"",a),m(!1)),N=Z,Z===-1){ve(z);return}let J=io(M,z,N>z?N-1:N);w=0;let ie=new Set;return J.forEach((ne,le)=>{let O=x[le];ne!==O&&ie.add(ne),Ie(J)}),x=J,Pe(ie),{newColumnIndexes:J,indexesWithTransition:ie,pinnedStartCount:w}}function ve(Z){x=x.filter(W=>W!==Z),e.forEach(W=>{let ie=W.computedVisibleIndex,ne=ie>Z;Ds(ie,a);let le="";ne&&(le=Vr.minus(Re.columnOffsets.get(ie),Re.columnWidths.get(Z)).done()),Lr(ie,le,a)}),kr(Z,"hidden",a),m(!0)}function Pe(Z){e.forEach(J=>{let W=J.computedVisibleIndex;Z.has(W)?Ds(W,a):Yi(W,a);let ie=W===z,ne=k===-1?W<N||W>z:W<z||W>=N,le="";k===-1?le=ie?Re.columnOffsets.get(N):ne?Re.columnOffsets.get(W):Vr.add(Re.columnOffsets.get(W),Re.columnWidths.get(z)).done():le=ne?Re.columnOffsets.get(W):ie?Vr.add(Re.columnOffsets.get(N-1),Re.columnWidths.get(N-1)).minus(Re.columnWidths.get(z)).done():Vr.minus(Re.columnOffsets.get(W),Re.columnWidths.get(z)).done(),Lr(W,le,a)})}let ue=u.left+T("start"),oe=u.right-T("end"),ce=Fp({scrollOffsetStart:ue,scrollOffsetEnd:oe}),pe=Vp({getScrollPosition:()=>l.getScrollPosition().scrollLeft,setScrollPosition:Z=>{S.scrollLeft=Z},getScrollRatio:()=>l.getScrollRatio("horizontal")});return Q(v),{speedScroller:ce,stop(){ce.stop()},onMove(Z){let J=Q(Z);if(g().dropTargetListId===h||p&&!d.containsPoint(J.getCenter()))return p&&me(-1),null;ce.scroll({mousePosition:X,get scrollLeft(){return pe.value},set scrollLeft(A){pe.value=A}});let W=b(e,{dragColumn:E,restrictToParentGroup:c==="group"}),ie=k===-1?E.computedOffset+K:E.computedOffset+E.computedWidth+K,ne=(0,Hp.default)(W,ie,({offsetX:A},de)=>A<de?-1:A>de?1:0);ne<0&&(ne=~ne),W.length?ne=W[ne]?W[ne].columnIndex:W[W.length-1].columnIndex+1:(e.length>1&&console.error("No breakpoints available, something is wrong!"),ne=0),ne===z+1&&(ne=z),me(ne);let le={};o.forEach(A=>{le[A.id]="end"});for(let A=0;A<w;A++){let de=x[A],ye=e[de];le[ye.id]="start"}let O=x.map(A=>e[A].id);return{columnPinning:le,columnOrder:O}}}}function Fs(n){let{newColumnOrder:e,visibleColumnOrder:t,existingColumnOrder:o,dragColumnId:r}=n;if(t.length!==e.length)return console.warn("new column order cannot contain less columns than the visible column order"),e;let i=t.indexOf(r),a=e.indexOf(r);if(i===a)return o;if(a>i){let l=e.indexOf(r),s=e[l-1],c=o.indexOf(s),u=o.indexOf(r);return io(o,u,c)}else{let l=e.indexOf(r),s=e[l+1],c=o.indexOf(s),u=o.indexOf(r);return io(o,u,c)}return e}var nt=H(require("react"));var ao=class{constructor(e){this.listeners={};e&&Object.keys(e).forEach(t=>{this.on(t,e[t])})}on(e,t){return this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(t),()=>this.off(e,t)}once(e,t){let o=((...r)=>{this.off(e,o),t(...r)});return this.on(e,o)}off(e,t){let o=this.listeners[e];if(!o)return;let r=o.indexOf(t);r!==-1&&o.splice(r,1)}emit(e,...t){let o=this.listeners[e];o&&o.slice().forEach(r=>{try{r(...t)}catch(i){console.error(`Error in event handler for event '${String(e)}':`,i)}})}clear(e){this.listeners[e]&&(this.listeners[e]=[])}clearAll(){Object.keys(this.listeners).forEach(e=>{this.listeners[e]=[]})}};var Bp=H(ro());var Wp=(n,e)=>{let{offset:t,activeDragSource:o}=n,{orientation:r,draggableItems:i,listId:a,listRectangle:l}=e.getData(),{dragItem:s,listId:c,dragIndex:u,dragRectangle:d}=o,p=c===a,f=je.from(d.getCenter());if(!l.containsPoint(f))return null;e.activeDragSourcePosition="inside";let m=p?r==="horizontal"?t.left>0?1:-1:t.top>0?1:-1:1,g=d.toDOMRect(),h=e.breakpoints,S=Math.round(m===1?r==="horizontal"?g.right-(p?0:g.width/2):g.bottom-(p?0:g.height/2):r==="horizontal"?g.left+(p?0:g.width/2):g.top+(p?0:g.height/2)),y=(0,Bp.default)(h,S,(R,w)=>R-w);y<0&&(y=~y),m===1&&y===u+1&&p&&y--;let C=Math.min(u,y),T=Math.max(u,y),I=p?i.map((R,w)=>{if(w===u&&p)return t;if(w<C||w>=T)return{left:0,top:0};let v=y<=w?1:-1;return r==="horizontal"?{left:Math.round(v*g.width),top:0}:{left:0,top:Math.round(v*g.height)}}):i.map((R,w)=>{let v=y<=w?1:0;return r==="horizontal"?{left:Math.round(v*g.width),top:0}:{left:0,top:Math.round(v*g.height)}}),b={offset:t,dropIndex:y,dragSourceListId:c,dropTargetListId:a,dragIndex:u,outside:!1,items:i,dragItem:s,offsetsForItems:I,dragRect:g,status:"accepted"};return e.acceptsDrop(b)?{event:b,error:null,success:!0}:(b.status="rejected",{event:b,error:"rejected by interaction target",success:!1})},jp=(n,e)=>{let{offset:t,activeDragSource:o}=n,{orientation:r,listId:i,listRectangle:a,draggableItems:l}=e.getData(),{dragRectangle:s,dragItem:c,listId:u}=o,d=je.from(s.getCenter()),p=u===i,f=a.containsPoint(d);if(f&&!(p&&!e.acceptsSelfDrops())||e.activeDragSourcePosition==="outside"&&!p)return null;e.activeDragSourcePosition="outside";let m=p?o.dragIndex:-1,g=s.toDOMRect(),h={offset:t,dropIndex:-1,dragIndex:m,dragItem:c,outside:!f,items:l,dragSourceListId:u,dropTargetListId:i,offsetsForItems:p?l.map((S,y)=>S.id===c.id?t:f?{left:0,top:0}:y>m&&!e.getData().preserveDragSpace?r==="horizontal"?{left:-c.rect.width,top:0}:{left:0,top:-c.rect.height}:{left:0,top:0}):l.map(S=>({left:0,top:0})),dragRect:g,status:"accepted"};return e.acceptsDrop(h)?{event:h,error:null,success:!0}:(h.status="rejected",{event:h,error:"rejected by interaction target",success:!1})};var xe=class xe{static startDrag(e,t){let o=e instanceof Xo?e:new Xo(e),r=new Ns({activeDragSource:o,startPoint:t});return xe.currentDragOperation=r,r.on("start",xe.onDragStart),r.on("move",xe.onDragMove),r.on("drop",xe.onDragDrop),r.start(),r}static retriggerMove(){let e=xe.currentDragOperation;e&&e.phase==="move"&&xe.onDragMove(e)}static emit(e,...t){xe.emitter.emit(e,...t)}static on(e,t){return xe.emitter.on(e,t)}static registerDragInteractionTarget(e){let{listId:t}=e,o=xe.dragInteractionTargetsMap.get(t);if(o&&o!==e){console.warn(`DragInteractionTarget with listId ${t} already registered`);return}return o||(xe.dragInteractionTargetsMap.set(t,e),xe.emit("register",e)),()=>{xe.unregisterDragInteractionTarget(e)}}static unregisterAll(){xe.dragInteractionTargetsMap.forEach(e=>{xe.unregisterDragInteractionTarget(e)})}static unregisterDragInteractionTarget(e){if(!e)return;let{listId:t}=e;xe.dragInteractionTargetsMap.get(t)===e&&(xe.dragInteractionTargetsMap.delete(t),e.unregister(),xe.emit("unregister",e))}static onDragStart(e){let{dragItem:t,dragIndex:o}=e.activeDragSource,r=e.activeDragSource.listId,a=xe.dragInteractionTargetsMap.get(r)?.getData().acceptDropsFrom,s=!a||a.includes(r)?r:null;xe.dragInteractionTargetsMap.forEach(c=>{let u=c.getData();c.start({dragIndex:u.listId===r?o:-1,dragItem:t,dragSourceListId:r,dropTargetListId:s})}),xe.emitter.emit("drag-start",{dragSourceListId:r,dropTargetListId:s,dragItem:t,dragIndex:o})}static withDragMove(e,t){let{activeDragSource:o}=e,{listId:r}=o,i=[],a=!0,l=xe.dragInteractionTargetsMap.get(r);l&&(a=l.acceptsSelfDrops(),a&&i.push(xe.dragInteractionTargetsMap.get(r))),xe.dragInteractionTargetsMap.forEach(s=>{s.listId!==r&&i.push(s)});for(let s of i){let c=Wp(e,s);if(c){t(s,c),i.splice(i.indexOf(s),1);break}}a||i.unshift(l);for(let s of i){let c=jp(e,s);c&&t(s,c)}}static onDragMove(e){let{activeDragSource:t}=e,{listId:o,dragItem:r}=t,i=null,a=[];xe.withDragMove(e,(c,{event:u})=>{c.move(u),a.push(u),u.outside||(i=u)});let l=i??a[0]??null,s=l?.dropTargetListId??null;xe.emit("drag-move",{dragSourceListId:o,dropTargetListId:s,items:l?.items??[],dragItem:r,status:l?.status??"accepted",dragIndex:l?.dragIndex??-1,dropIndex:l?.dropIndex??-1})}static onDragDrop(e){let{activeDragSource:t}=e,{listId:o,dragItem:r}=t,i=null,a=[];xe.withDragMove(e,(s,{event:c})=>{e.cancelled&&(c={...c,dropTargetListId:null,dropIndex:-1,outside:!1}),s.drop(c),a.push(c),c.outside||(i=c)});let l=i??a[0]??null;xe.emit("drag-drop",{dragSourceListId:o,dropTargetListId:l?.dropTargetListId??null,items:l?.items??[],dragItem:r,status:l?.status??"accepted",dragIndex:l?.dragIndex??-1,dropIndex:l?.dropIndex??-1}),xe.currentDragOperation=null,xe.unregisterAll()}};xe.dragInteractionTargetsMap=new Map,xe.currentDragOperation=null,xe.emitter=new ao;var pt=xe,Xo=class n{static clone(e){let t=e.getData();return new n(t)}constructor(e){this.setData(e)}get listId(){return this.data.listId}get dragIndex(){return this.data.dragIndex??-1}get dragItem(){return this.data.dragItem}setData(e){Rt(this.data,e)||(this.data=e,this.dragRectangle=new _e(this.data.dragItem.rect))}getData(){return this.data}static shift(e,t){let o=n.clone(e),r=_e.from(o.dragRectangle);return r.shift(t),o.dragRectangle=r,o}},Ns=class extends ao{constructor(t){super(t.listeners);this.phase="start";this.cancelled=!1;this.currentOffset={top:0,left:0};this.initialDragSource=Xo.clone(t.activeDragSource),this.activeDragSource=this.initialDragSource,this.startPoint={top:Math.round(t.startPoint.top),left:Math.round(t.startPoint.left)}}get offset(){return this.currentOffset}start(){let{listId:t,dragItem:o}=this.activeDragSource,r={dragSourceListId:t,dragItemId:o.id,startPoint:this.startPoint};return this.emit("start",this,r),r}drop(){this.phase="drop",this.emit("drop",this)}cancel(){this.cancelled=!0,this.drop()}move(t){if(this.phase!=="start"&&this.phase!=="move")return;this.phase="move";let o={top:Math.round(t.top-this.startPoint.top),left:Math.round(t.left-this.startPoint.left)};this.activeDragSource=Xo.shift(this.initialDragSource,o),this.currentOffset=o,this.emit("move",this)}};globalThis.DragManager=pt;var Up=require("react"),$p=nt.createContext({dragSourceListId:null,dropTargetListId:null,dragItemId:"",status:"accepted",updateDragOperationSourceAndTarget:n=>{},getCurrentDragSourceAndTarget:()=>({dragSourceListId:null,dropTargetListId:null,status:"accepted",dragItemId:""})}),fn=()=>nt.useContext($p),Yp=nt.createContext(""),lo=n=>{let e=nt.useContext(Yp);return e?`${n}-${e}`:n},Ji=n=>{let[e,t]=nt.useState({dragSourceListId:null,dropTargetListId:null,dragItemId:"",status:"accepted"}),o=nt.useId(),r=nt.useRef(e);r.current=e;let i=nt.useCallback(()=>{let l=r.current;return{dragSourceListId:l.dragSourceListId,dropTargetListId:l.dropTargetListId,dragItemId:l.dragItemId,status:l.status}},[]),a=nt.useMemo(()=>({dragSourceListId:e.dragSourceListId,dropTargetListId:e.dropTargetListId,dragItemId:e.dragItemId,status:e.status,updateDragOperationSourceAndTarget:t,getCurrentDragSourceAndTarget:i}),[e,t]);return(0,Up.useEffect)(()=>{let l=pt.on("drag-start",u=>{t({dragSourceListId:u.dragSourceListId,dropTargetListId:u.dropTargetListId,dragItemId:u.dragItem.id,status:"accepted"})}),s=pt.on("drag-move",u=>{let d=r.current,p={dragSourceListId:u.dragSourceListId,dropTargetListId:u.dropTargetListId,dragItemId:u.dragItem.id,status:u.status};JSON.stringify(d)!==JSON.stringify(p)&&t(p)}),c=pt.on("drag-drop",()=>{t({dragSourceListId:null,dropTargetListId:null,dragItemId:"",status:"accepted"})});return()=>{l(),s(),c()}},[pt,t]),nt.createElement(Yp.Provider,{value:o},nt.createElement($p.Provider,{value:a},typeof n.children=="function"?n.children(a):n.children))};var ea="header",ta="grouping-toolbar";var Ls=`${yt}Body`,qp=n=>n.querySelector(`.${Ls}`);var so=`${yt}HeaderCell`,ks=`${yt}HeaderWrapper`,Xp=n=>Array.from(n.querySelectorAll(`.${ks}`));function Gr(n){if(!n)return!1;let e=n.tagName;return e==="INPUT"||e==="BUTTON"}var DC=Y(q.baseZIndexForCells),MC=(n,e)=>{let t=!n||Object.keys(n).length===0,o=!e||Object.keys(e).length===0;return t&&o?!0:!!n!=!!e?!1:Rt(n,e)},Qp=({columnId:n,domRef:e,horizontalLayoutPageIndex:t,allowColumnHideOnDrag:o})=>{let[r,i]=(0,Zo.useState)(null),[a,l]=(0,Zo.useState)(!1),{getCurrentDragSourceAndTarget:s}=fn(),c=lo(ta),{getComputed:u,getState:d,api:p,computedDraggable:f,rootRef:m,actions:g}=te(y=>({actions:y.actions,getComputed:y.getComputed,getState:y.getState,api:y.api,computedDraggable:y.computed.computedVisibleColumnsMap.get(n)?.computedDraggable,rootRef:y.state.domRef})),h=(0,Zo.useCallback)(y=>{let C=u().computedVisibleColumnsMap.get(n);if(!C||!C.computedSortable)return;let{multiSortBehavior:T}=d();p.toggleSortingForColumn(n,{multiSortBehavior:T==="replace"&&(y.ctrlKey||y.metaKey)?"append":T})},[]),S=(0,Zo.useCallback)(y=>{if(Gr(y.target))return;let{brain:C,draggableColumnsRestrictTo:T}=d(),{computedVisibleColumns:I,computedVisibleColumnsMap:b,computedPinnedStartColumns:R,computedUnpinnedColumns:w,computedPinnedEndColumns:v}=u(),P=b.get(n);if(!P.computedDraggable){h(y);return}let D=e.current,M=D.getBoundingClientRect(),x=m.current.getBoundingClientRect(),E=C.getAvailableSize(),z=P.computedVisibleIndex,V=C.getVirtualColIndex(P.computedVisibleIndex,{pageIndex:t||0}),N=C.isHorizontalLayoutBrain?C.getPageWidth():null,L=D.style.cursor??"auto",F=!1,B=m.current,X=_e.from(qp(B).getBoundingClientRect()),_=Xp(B).map(ue=>_e.from(ue.getBoundingClientRect())),k=X.getMinimumBoundingRectangle(..._),K=Kp({brain:C,horizontalLayoutPageIndex:t,allowColumnHideOnDrag:o,pageWidth:N,draggableColumnsRestrictTo:T,computedPinnedEndColumns:v,computedPinnedStartColumns:R,computedUnpinnedColumns:w,computedVisibleColumns:I,computedVisibleColumnsMap:b,dragColumnHeaderTargetRect:M,dragColumnId:n,getCurrentDragSourceAndTarget:s,groupingToolbarDragListId:c,api:p,infiniteDOMNode:m.current,setProxyPosition:i,setDragColumnOutside:l,tableRect:x,acceptDropToReorderRect:k,initialMousePosition:{clientX:y.clientX,clientY:y.clientY}}),Q=null,Ie,se;function me(ue){let{columnPinning:oe,columnOrder:ce}=ue;MC(d().columnPinning,oe)||(g.columnPinning=oe);let pe=u().computedColumnOrder;JSON.stringify(ce,pe)&&(g.columnOrder=Fs({newColumnOrder:ce,visibleColumnOrder:u().computedVisibleColumns.map(Z=>Z.id),existingColumnOrder:pe,dragColumnId:n}))}let ve=ue=>{let{headerBrain:oe,brain:ce}=d();if(!F){F=!0;let pe=ce.keepColumnRendered(V),Z=oe.keepColumnRendered(V);if(ce.isHorizontalLayoutBrain){let W=ce.extendRenderRange({start:!0,end:!0,direction:"horizontal"}),ie=oe.extendRenderRange({start:!0,end:!0,direction:"horizontal"});se=()=>{W(),ie()}}Ie=()=>{pe(),Z()},g.columnReorderDragColumnId=P.id,t!=null&&(g.columnReorderInPageIndex=t),xs(z,`calc( var(${DC}) + 10000 )`,m.current),m.current?.classList.add(Ms),D.style.cursor="grabbing"}Q=K.onMove(ue)},Pe=ue=>{let oe=ue.pointerId;requestAnimationFrame(()=>{let{multiSortBehavior:ce}=d(),pe=m.current;pe?.classList.remove(Ms),K.stop(),C.update({...E}),Ie?.(),se?.(),D.style.cursor=L,D.hasPointerCapture?.(oe)&&D.releasePointerCapture(oe),D.removeEventListener("pointermove",ve),D.removeEventListener("pointerup",Pe),i(null);let Z=p.getColumnApi(P.id)?.isSortable()??!1;!F&&Z&&p.toggleSortingForColumn(P.id,{multiSortBehavior:ce==="replace"&&(ue.ctrlKey||ue.metaKey)?"append":ce}),(0,Zp.flushSync)(()=>{Q?me(Q):F&&o&&p.setVisibilityForColumn(P.id,!1),g.columnReorderDragColumnId=!1,t!=null&&(g.columnReorderInPageIndex=null)}),I.forEach(J=>{Yi(J.computedVisibleIndex,pe),kr(J.computedVisibleIndex,"",pe),Lr(J.computedVisibleIndex,"",pe)}),xs(z,qi(P,{pinnedStartColsCount:R.length,visibleColsCount:I.length}),pe)})};D.addEventListener("pointermove",ve),D.addEventListener("pointerup",Pe),D.setPointerCapture(y.pointerId)},[n,t,c]);return{onPointerDown:f?S:h,dragColumnOutside:a,proxyPosition:r}};var or=H(require("react"));var Ce=H(require("react")),ke=require("react");var ef=Symbol("REPAINT_CELLS_KEY_NO_ROW");function tf(n){return typeof n=="function"}function Jp(n,e){let{column:t,rowIndex:o,rowInfoStore:r,getDataSourceState:i}=e,a=r.getRowInfoAtIndex(o);if(!a)return ef;let l=r.getDataSourceStates();return n({rowInfo:a,column:t,dataSourceState:l.dataSourceState??i(),previousDataSourceState:l.previousDataSourceState})}function nf(n,e,t){let o=Jp(n,e);return e.rowInfoStore.subscribeToDataArrayChange(()=>{let r=Jp(n,e);r!==ef&&(Object.is(r,o)||(o=r,t()))})}var of="_1eexc2a7 _1eexc2a6",rf=he({defaultClassName:"_1eexc2an",variantClassNames:{dragging:{false:"_1eexc2ao",true:"_1eexc2ap"},insideDisabledDraggingPage:{true:"_1eexc2aq",false:"_1eexc2ar"},cellSelected:{false:"_1eexc2as",true:"_1eexc2at"},treeNode:{parent:"_1eexc2au",leaf:"_1eexc2av",false:"_1eexc2aw"},align:{start:"_1eexc2ax",end:"_1eexc2ay",center:"_1eexc2az"},verticalAlign:{start:"_1eexc2a10",end:"_1eexc2a11",center:"_1eexc2a12"},rowActive:{false:"_1eexc2a13",true:"_1eexc2a14"},groupRow:{false:"_1eexc2a15",true:"_1eexc2a16"},groupCell:{false:"_1eexc2a17",true:"_1eexc2a18"},rowDisabled:{false:"_1eexc2a19",true:"_1eexc2a1a"},zebra:{false:"_1eexc2a1b",even:"_1eexc2a1c",odd:"_1eexc2a1d"},rowSelected:{true:"_1eexc2a1e",false:"_1eexc2a1f",null:"_1eexc2a1g"},first:{true:"_1eexc2a1h",false:"_1eexc2a1i"},last:{true:"_1eexc2a1j",false:"_1eexc2a1k"},groupByField:{true:"_1eexc2a1l",false:"_1eexc2a1m"},firstInCategory:{true:"_1eexc2a1n",false:"_1eexc2a1o"},firstRow:{true:"_1eexc2a1p",false:"_1eexc2a1q"},firstRowInHorizontalLayoutPage:{true:"_1eexc2a1r",false:"_1eexc2a1s"},lastInCategory:{true:"_1eexc2a1t",false:"_1eexc2a1u"},pinned:{start:"_1eexc2a1v",end:"_1eexc2a1w",false:"_1eexc2a1x"},filtered:{true:"_1eexc2a1y",false:"_1eexc2a1z"}},defaultVariants:{},compoundVariants:[[{firstRowInHorizontalLayoutPage:!0,firstRow:!1},"_1eexc2a20"],[{pinned:"start",lastInCategory:!0},"_1eexc2a21"],[{pinned:"start",firstInCategory:!0},"_1eexc2a22"],[{pinned:"end",firstInCategory:!0},"_1eexc2a23"],[{pinned:"end",lastInCategory:!0},"_1eexc2a24"],[{align:"center",groupCell:!1},"_1eexc2a25"],[{rowDisabled:!0,zebra:"odd"},"_1eexc2a26"]]}),af=he({defaultClassName:"_1eexc2ae",variantClassNames:{right:{true:"_1eexc2af",false:"_1eexc2ag"},left:{true:"_1eexc2ah",false:"_1eexc2ai"},top:{true:"_1eexc2aj",false:"_1eexc2ak"},bottom:{true:"_1eexc2al",false:"_1eexc2am"}},defaultVariants:{},compoundVariants:[]});var lf="_1eexc2a5",na=he({defaultClassName:"_1eexc2aa",variantClassNames:{direction:{up:"_1eexc2ab",down:"_1eexc2ac",neutral:"_1eexc2ad"}},defaultVariants:{},compoundVariants:[]}),Qo="_1eexc2a8";var oa=H(require("react")),ra=require("react");var sf="qz8ht90 _16lm1iwk";function EC(){return{checked:1,disabled:n=>n??!1,domProps:1}}var{ManagedComponentContextProvider:AC}=kt({forwardProps:EC,mappedCallbacks:{checked:n=>({callbackName:"onChange",callbackParams:[n]})},debugName:"InfiniteCheckBox"});function _C(){let{componentState:n,componentActions:e}=zt(),{checked:t,domProps:o,disabled:r}=n,i=(0,ra.useRef)(null);return(0,ra.useEffect)(()=>{i.current.indeterminate=t==null},[t]),oa.createElement("input",{...o,className:$("InfiniteCheckBox",sf,o?.className),type:"checkbox",ref:i,checked:!!t,disabled:r,onChange:()=>{r||(e.checked=!t)}})}function zn(n){return oa.createElement(AC,{...n},oa.createElement(_C,null))}var OC="*",Ue=class{constructor(e){this.wildcard=OC;this.cache=new U;this.selectedRowsToColumns=new Map;this.selectedColumnsToRows=new Map;this.deselectedRowsToColumns=new Map;this.deselectedColumnsToRows=new Map;this.defaultSelection=!1;this.debugId="";this.deselectAll=()=>{this.update({defaultSelection:!1,selectedCells:[]})};this.selectAll=()=>{this.update({defaultSelection:!0,deselectedCells:[]})};let t=e&&e instanceof Object.getPrototypeOf(this).constructor?e.getState():e;t&&this.update(t)}selectCell(e,t){this.setCellSelected(e,t,!0)}deselectCell(e,t){this.setCellSelected(e,t,!1)}selectColumn(e){this.setCellSelected(this.wildcard,e,!0)}deselectColumn(e){this.setCellSelected(this.wildcard,e,!1)}setCellSelected(e,t,o){let r=e===this.wildcard,i=t===this.wildcard;if(this.isCellSelected_Internal(e,t)===o)return;let l=[];if(r){let c=this.deselectedColumnsToRows.get(t),u=this.selectedColumnsToRows.get(t);c?.forEach(d=>{d!==this.wildcard&&this.setCellInDeselection(d,t,!1)}),u?.forEach(d=>{d!==this.wildcard&&this.setCellInSelection(d,t,!1)}),[...this.cache.keys()].forEach(d=>{let[p,f]=d;f===t&&l.push([p,t])})}if(i){let c=this.deselectedRowsToColumns.get(t),u=this.selectedRowsToColumns.get(t);c?.forEach(d=>{d!==this.wildcard&&this.setCellInDeselection(e,d,!1)}),u?.forEach(d=>{d!==this.wildcard&&this.setCellInSelection(e,d,!1)}),[...this.cache.keys()].forEach(d=>{let[p]=d;p===e&&l.push([e,t])})}let s=[e,t];if(l.forEach(c=>{this.cache.delete(c)}),this.cache.delete(s),o)if(this.defaultSelection){let c=this.deselectedRowsToColumns.get(e);c&&c.has(t)&&this.setCellInDeselection(e,t,!1);let u=this.deselectedRowsToColumns.get(this.wildcard),d=this.deselectedColumnsToRows.get(this.wildcard);(u?.has(t)||d?.has(e))&&this.setCellInSelection(e,t,!0)}else{let c=this.deselectedRowsToColumns.get(e);c&&c.has(t)&&this.setCellInDeselection(e,t,!1),this.setCellInSelection(e,t,!0)}else if(this.defaultSelection)this.selectedRowsToColumns.get(e)?.has(t)&&this.setCellInSelection(e,t,!1),this.setCellInDeselection(e,t,!0);else{this.selectedRowsToColumns.get(e)?.has(t)&&this.setCellInSelection(e,t,!1);let u=this.selectedRowsToColumns.get(this.wildcard),d=this.selectedColumnsToRows.get(this.wildcard);if(u?.has(t)||d?.has(e)){this.setCellInDeselection(e,t,!0);return}}}setCellInDeselection(e,t,o){if(o){let r=this.deselectedRowsToColumns.get(e)||new Set;r.add(t),this.deselectedRowsToColumns.set(e,r)}else{let r=this.deselectedRowsToColumns.get(e);r&&(r.delete(t),r.size===0&&this.deselectedRowsToColumns.delete(e))}if(o){let r=this.deselectedColumnsToRows.get(t)||new Set;r.add(e),this.deselectedColumnsToRows.set(t,r)}else{let r=this.deselectedColumnsToRows.get(t);r&&(r.delete(e),r.size===0&&this.deselectedColumnsToRows.delete(t))}}setCellInSelection(e,t,o){if(e===this.wildcard&&t===this.wildcard)throw new Error("rowId and colId cannot be used as a wildcard at the same time!");if(o){let r=this.selectedRowsToColumns.get(e)||new Set;r.add(t),this.selectedRowsToColumns.set(e,r)}else{let r=this.selectedRowsToColumns.get(e);r&&(r.delete(t),r.size===0&&this.selectedRowsToColumns.delete(e))}if(o){let r=this.selectedColumnsToRows.get(t)||new Set;r.add(e),this.selectedColumnsToRows.set(t,r)}else{let r=this.selectedColumnsToRows.get(t);r&&(r.delete(e),r.size===0&&this.selectedColumnsToRows.delete(t))}}update(e){let t=e.selectedCells||null,o=e.deselectedCells||null;this.selectedRowsToColumns.clear(),this.selectedColumnsToRows.clear(),this.deselectedRowsToColumns.clear(),this.deselectedColumnsToRows.clear(),this.cache.clear(),t&&t.forEach(([r,i])=>{this.setCellInSelection(r,i,!0)}),o&&o.forEach(([r,i])=>{this.setCellInDeselection(r,i,!0)}),this.defaultSelection=e.defaultSelection}isCellSelectionInRow(e,t){if(this.defaultSelection){let r=this.deselectedRowsToColumns.get(e);if(r){if(r.has(this.wildcard)){let i=this.selectedRowsToColumns.get(e);return i&&i.size>0?t.some(a=>i.has(a)):!1}return t.some(i=>!r.has(i))}return!0}let o=this.selectedRowsToColumns.get(e);if(o){if(o.has(this.wildcard)){let r=this.deselectedRowsToColumns.get(e);return r&&r.size>0?!t.every(a=>r.has(a)):!0}return t?t.some(r=>o.has(r)):!1}return!1}error(e){Dn(`${this.debugId}:CellSelectionState`)(e)}isCellSelected(e,t){return e===this.wildcard||t===this.wildcard?(this.error("CellSelectionState.isCellSelected should not be called with wildcard"),!1):this.isCellSelected_Internal(e,t)}isCellSelected_Internal(e,t){let o=[e,t],{cache:r}=this,i=r.get(o);if(i!=null)return i;let a=()=>(r.set(o,!1),!1),l=()=>(r.set(o,!0),!0),s=this.deselectedColumnsToRows.get(this.wildcard),c=this.deselectedRowsToColumns.get(this.wildcard),u=this.selectedColumnsToRows.get(this.wildcard),d=this.selectedRowsToColumns.get(this.wildcard);if(this.defaultSelection){let m=this.deselectedRowsToColumns.get(e);return m&&m.has(t)?a():s?.has(e)||c?.has(t)?this.selectedRowsToColumns.get(e)?.has(t)?l():a():l()}let f=this.selectedRowsToColumns.get(e);return f&&f.has(t)?l():u?.has(e)||d?.has(t)?this.deselectedRowsToColumns.get(e)?.has(t)?a():l():a()}getState(){let e=[],t=[];return this.deselectedRowsToColumns.forEach((o,r)=>{o.forEach(i=>{e.push([r,i])})}),this.selectedRowsToColumns.forEach((o,r)=>{o.forEach(i=>{t.push([r,i])})}),{defaultSelection:this.defaultSelection,deselectedCells:e,selectedCells:t}}};function Vn(n,e){return e().dataArray[n]}function ia(n){return n().dataArray}var ft=class{constructor(e){this.collapsedPathsMap=new U;this.expandedPathsMap=new U;this.collapsedIdsMap=new Map;this.expandedIdsMap=new Map;this._mode="path";this.defaultExpanded=!1;this.expandAll=()=>{this.update({defaultExpanded:!0,collapsedPaths:[]})};this.collapseAll=()=>{this.update({defaultExpanded:!1,expandedPaths:[]})};let t=e&&e instanceof Object.getPrototypeOf(this).constructor?e.getState():e;t&&this.update(t)}get mode(){return this._mode}reset(){this.collapsedPathsMap.clear(),this.expandedPathsMap.clear(),this.collapsedIdsMap.clear(),this.expandedIdsMap.clear()}destroy(){this.reset()}expandNode(e){this.setNodeExpanded(e,!0)}collapseNode(e){this.setNodeExpanded(e,!1)}setNodeExpanded(e,t){let{collapsedPathsMap:o,collapsedIdsMap:r,expandedPathsMap:i,expandedIdsMap:a,defaultExpanded:l,_mode:s}=this;s==="id"&&Array.isArray(e)&&(e=e[e.length-1]),t===l?t?s==="path"&&Array.isArray(e)?o.delete(e):r.delete(e):s==="path"&&Array.isArray(e)?i.delete(e):a.delete(e):t?s==="path"&&Array.isArray(e)?i.set(e,!0):a.set(e,!0):s==="path"&&Array.isArray(e)?o.set(e,!0):r.set(e,!0)}isNodeExpandedByPath(e){return this.isNodeExpanded(e)}isNodeExpandedById(e){return this.isNodeExpanded(e)}isNodeExpanded(e){if(this._mode==="id"&&Array.isArray(e)&&(e=e[e.length-1]),this._mode==="id"&&Array.isArray(e))throw`You try to check if a node is expanded by id (${e}) but your TreeExpandState is configured to use node paths.`;if(this._mode==="path"&&!Array.isArray(e))throw`You try to check if a node is expanded by path (${e}) but your TreeExpandState is configured to use node ids.`;return this.defaultExpanded?this._mode==="path"&&Array.isArray(e)?!this.collapsedPathsMap.has(e):!this.collapsedIdsMap.has(e):this._mode==="path"&&Array.isArray(e)?this.expandedPathsMap.has(e):this.expandedIdsMap.has(e)}update(e){if(this.defaultExpanded=e.defaultExpanded,this.reset(),e.expandedPaths||e.collapsedPaths){this._mode="path";let r=e.expandedPaths||null,i=e.collapsedPaths||null;if(r)for(let a=0,l=r.length;a<l;a++)this.expandedPathsMap.set(r[a],!0);if(i)for(let a=0,l=i.length;a<l;a++)this.collapsedPathsMap.set(i[a],!0);return}this._mode="id";let t=e.expandedIds||null,o=e.collapsedIds||null;if(t)for(let r=0,i=t.length;r<i;r++)this.expandedIdsMap.set(t[r],!0);if(o)for(let r=0,i=o.length;r<i;r++)this.collapsedIdsMap.set(o[r],!0)}getState(){if(this._mode==="path"){let o=Array.from(this.collapsedPathsMap.keys()),r=Array.from(this.expandedPathsMap.keys());return{defaultExpanded:this.defaultExpanded,collapsedPaths:o,expandedPaths:r}}let e=Array.from(this.collapsedIdsMap.keys()),t=Array.from(this.expandedIdsMap.keys());return{defaultExpanded:this.defaultExpanded,collapsedIds:e,expandedIds:t}}};var zs=n=>Array.isArray(n)?new U(n.map(e=>[e,!0])):n,FC=(n,e)=>n.length-e.length,Je=class n{constructor(e,t){this.selectedPaths=null;this.deselectedPaths=null;this.defaultSelection=!1;this.selectionMap=new U;this.cache=new U;this.strictMode=!1;let o=e instanceof Object.getPrototypeOf(this).constructor,r=o?e.getState():e;this.setConfig(t||(o?e.config:{treePaths:new U})),this.disableStrictMode(),this.update(r),this.config.strictCheckPaths&&this.enableStrictMode()}getTreePaths(e){return e?zs(e):this.config.treePaths}withTreePaths(e,t){let o=this.config.treePaths;t=this.getTreePaths(t);let r=t!==o;r&&this.xcache(),this.config.treePaths=t;let i=e(t);return this.config.treePaths=o,r&&this.xcache(),i}getLeafNodePaths(e=[],t){return this.withTreePaths(o=>o.getKeysForLeafNodesStartingWith(e),t)}forEachLeafNodePath(e,t=[],o){let r={selected:!1};this.withTreePaths(i=>{i.getLeafNodesStartingWith(t,a=>{r.selected=this.isNodeSelected(a.keys)===!0,e(a.keys,r)})},o)}getSelectedLeafNodePaths(e=[],t){let o=[];return this.withTreePaths(r=>{r.getLeafNodesStartingWith(e,i=>{this.isNodeSelected(i.keys)&&o.push(i.keys)})},t),o}getDeselectedLeafNodePaths(e=[],t){let o=[];return this.withTreePaths(r=>{r.getLeafNodesStartingWith(e,i=>{this.isNodeSelected(i.keys)||o.push(i.keys)})},t),o}isLeafNode(e){let{treePaths:t}=this.config;return t.has(e)?t.getKeysForLeafNodesStartingWith(e).length===1:null}getLeafNodesCount(e){return this.config.treePaths.getKeysForLeafNodesStartingWith(e).length}static from(e,t){return new n(e,t)}setConfig(e){let t=typeof e=="function"?e():e;this.config={treePaths:zs(t.treePaths),strictCheckPaths:t.strictCheckPaths??!0,multiRowSelectionTarget:t.multiRowSelectionTarget,unfilteredTreePaths:t.unfilteredTreePaths?zs(t.unfilteredTreePaths):void 0},this.xcache()}hasFilteredOutLeavesInside(e){let{multiRowSelectionTarget:t,unfilteredTreePaths:o,treePaths:r}=this.config;return t!=="visible"||!o||o===r?!1:o.getAllChildrenSizeFor(e)>r.getAllChildrenSizeFor(e)}setVisibleLeafNodesSelection(e,t){let{unfilteredTreePaths:o,treePaths:r}=this.config;this.xcache(),r.getKeysForLeafNodesStartingWith(e).forEach(i=>{o.getAllChildrenSizeFor(i)>0||(this.selectionMap.delete(i),this.isNodeSelected(i)!==t&&this.setSelectionForPath(i,t))}),this.xcache()}xcache(){this.cache.clear()}update(e){this.selectedPaths=e.selectedPaths||null,this.deselectedPaths=e.deselectedPaths||null;let{selectionMap:t,selectedPaths:o,deselectedPaths:r}=this;t.clear(),o?.forEach(i=>this.setSelectionForPath(i,!0)),r?.forEach(i=>this.setSelectionForPath(i,!1)),this.defaultSelection=e.defaultSelection,this.xcache()}setSelectionForPath(e,t){this.isPathAvailable(e)&&this.selectionMap.set(e,t)}getState(){let e=[],t=[];return this.selectionMap.topDownEntries().forEach(([o,r])=>{r?e.push(o):t.push(o)}),{defaultSelection:this.defaultSelection,selectedPaths:e,deselectedPaths:t}}deselectAll(){if(this.hasFilteredOutLeavesInside([])){this.setVisibleLeafNodesSelection([],!1);return}this.update({defaultSelection:!1,selectedPaths:[],deselectedPaths:[]})}selectAll(){if(this.hasFilteredOutLeavesInside([])){this.setVisibleLeafNodesSelection([],!0);return}this.update({defaultSelection:!0,deselectedPaths:[],selectedPaths:[]})}enableStrictMode(){this.strictMode=!0}disableStrictMode(){this.strictMode=!1}isPathAvailable(e){if(!this.strictMode)return!0;let{treePaths:t}=this.config;return t.has(e)}isNodeSelected(e){return this.isPathSelected(e)}isSelfSelected(e){return this.selectionMap.get(e)??null}cacheIt(e,t){return this.cache.set(e,t),t}getSelectionStateForNode(e,t){let o=this.cache.get(e);if(o)return o;if(this.isLeafNode(e)!==!1){let d=this.isSelfSelected(e);if(d!==null)return this.cacheIt(e,{selected:d,selectedCount:d?1:0,deselectedCount:d?0:1,leafCount:1})}let r=this.getLeafNodesCount(e),i=this.isSelfSelected(e),{selectionMap:a}=this,l=a.getKeysOfFirstChildOnEachBranchStartingWith(e,{excludeSelf:!0}).sort(FC);if(this.strictMode&&(l=l.filter(d=>this.isPathAvailable(d))),!l.length){if(i!==null){let p=r?i:!1;return this.cacheIt(e,{selected:p,selectedCount:p?r:0,deselectedCount:p?0:r,leafCount:r})}let d=this.getNodeBooleanSelectionStateFromParent(e);return this.cacheIt(e,{selected:d,selectedCount:d?r:0,deselectedCount:d?0:r,leafCount:r})}let s=0,c=0,u=this.getNodeBooleanSelectionStateFromParent(e);u?s+=r:c+=r;for(let d=0,p=l.length;d<p;d++){let f=l[d],{selectedCount:m,deselectedCount:g}=this.getSelectionStateForNode(f);if(u?(s-=g,c+=g):(c-=m,s+=m),t&&m>0&&g>0)return this.cacheIt(e,{selected:null,leafCount:r,selectedCount:s,deselectedCount:c})}if(!s&&!c)return this.cacheIt(e,{selected:u,selectedCount:u?r:0,deselectedCount:u?0:r,leafCount:r});if(s){let d=s===r?!0:null;return this.cacheIt(e,{selected:d,selectedCount:s,deselectedCount:c,leafCount:r})}return this.cacheIt(e,{selected:!1,selectedCount:0,deselectedCount:r,leafCount:r})}isPathSelected(e){return this.isPathAvailable(e)?this.getSelectionStateForNode(e,!0).selected:!1}getNodeBooleanSelectionStateFromParent(e){let{defaultSelection:t,selectionMap:o}=this;if(!e.length)return t;let r=[...e];do{let i=o.get(r);if(i!==void 0)return i;r.pop()}while(r.length);return t}setNodeSelection(e,t){if(!e.length)return;if(this.hasFilteredOutLeavesInside(e)){this.setVisibleLeafNodesSelection(e,t);return}if(this.xcache(),this.selectionMap.getKeysStartingWith(e).forEach(r=>{this.selectionMap.delete(r)}),!(e.length===1&&this.defaultSelection===t)){if(this.setSelectionForPath(e,t),e.length>1){let r=e.slice(0,-1);this.isNodeSelected(r)===t&&this.setNodeSelection(r,t)}}}selectNode(e){this.setNodeSelection(e,!0)}deselectNode(e){this.setNodeSelection(e,!1)}toggleNodeSelection(e){this.setNodeSelection(e,!this.isNodeSelected(e))}getSelectedCount(){return this.getSelectionCountFor([]).selectedCount}getDeselectedCount(){return this.getSelectionCountFor([]).deselectedCount}getSelectionCountFor(e=[]){let{selectedCount:t,deselectedCount:o}=this.getSelectionStateForNode(e);return{selectedCount:t,deselectedCount:o}}destroy(){this.config=void 0,this.xcache(),this.selectionMap.clear()}};function er(n,e){return new Je(n,Jo(e))}function Jo(n){return()=>{let e=typeof n=="function"?n():n,{treePaths:t,unfilteredTreePaths:o,multiRowSelectionTarget:r}=e;return r==="visible"?{treePaths:t,unfilteredTreePaths:o,multiRowSelectionTarget:r}:{treePaths:o??t,multiRowSelectionTarget:r}}}var aa=class{constructor(e){this.setNodeSelection=(e,t,o)=>{let{treeSelectionState:r,selectionMode:i}=this.getState();if(!this.isNodeSelectable(e)&&!o?.force)return;if(i==="single-row"){this.actions.treeSelection=t?e[e.length-1]:null;return}if(i!=="multi-row")throw"Selection mode is not multi-row or single-row";if(!(r instanceof Je))throw"Invalid tree selection";let a=new Je(r,Jo(this.getState));a.setNodeSelection(e,t),this.getState().lastSelectionUpdatedNodePathRef.current={nodePath:e,selected:t},this.actions.treeSelection=a};this.getCallbackParam=e=>({dataSourceApi:this.dataSourceApi});this.getState=e.getState,this.actions=e.actions,this.dataSourceApi=e.dataSourceApi}getSelectedLeafNodePaths(e){let{treePaths:t}=this.getState(),o=e?.treeSelectionState||this.getState().treeSelectionState;return o?o.getSelectedLeafNodePaths(e?.rootNodePath,t):[]}getDeselectedLeafNodePaths(e){let{treePaths:t}=this.getState(),o=e?.treeSelectionState||this.getState().treeSelectionState;return o?o.getDeselectedLeafNodePaths(e?.rootNodePath,t):[]}getSelectedLeafRowInfos(e){let{treePaths:t}=this.getState(),o=e?.treeSelectionState||this.getState().treeSelectionState;if(!t||!o)return[];let r=e?.rootNodePath||[],i=[];return t.getLeafNodesStartingWith(r,a=>{if(o.isNodeSelected(a.keys)){let l=this.getRowInfoByPath(a.keys);l&&i.push(l)}},{excludeSelf:!0}),i}get allRowsSelected(){return this.getState().allRowsSelected}isNodeReadOnly(e){let t=this.getRowInfoByPath(e),o=this.getState().isNodeReadOnly;return t&&t.isTreeNode&&t.isParentNode&&o?o(t):!1}isNodeSelectable(e){let t=this.getRowInfoByPath(e),o=this.getState().isNodeSelectable;return t&&t.isTreeNode?o(t):!1}isNodeExpanded(e){let t=this.getState(),{isNodeExpanded:o,isNodeCollapsed:r,treeExpandState:i}=t,a=this.getRowInfoByPath(e);if(a){if(!a.isTreeNode||!a.isParentNode)return!1;if(r)return!o(a,i);if(o)return o(a,i)}return i.isNodeExpanded(e)}expandAll(){let e=new ft({defaultExpanded:!0,collapsedPaths:[]});this.getState().lastExpandStateInfoRef.current={state:"expanded",nodePath:null},this.actions.treeExpandState=e}collapseAll(){let e=new ft({defaultExpanded:!1,expandedPaths:[]});this.getState().lastExpandStateInfoRef.current={state:"collapsed",nodePath:null},this.actions.treeExpandState=e}expandNode(e,t){if(this.isNodeReadOnly(e)&&!t?.force)return;let o=this.getState(),r=new ft(o.treeExpandState);r.expandNode(e),this.getState().lastExpandStateInfoRef.current={state:"expanded",nodePath:e},this.actions.treeExpandState=r,o.onNodeExpand?.(e,this.getCallbackParam(e))}collapseNode(e,t){if(this.isNodeReadOnly(e)&&!t?.force)return;let o=this.getState(),r=new ft(o.treeExpandState);r.collapseNode(e),this.getState().lastExpandStateInfoRef.current={state:"collapsed",nodePath:e},this.actions.treeExpandState=r,o.onNodeCollapse?.(e,this.getCallbackParam(e))}toggleNode(e,t){let o=this.getState(),r=new ft(o.treeExpandState),i=!this.isNodeExpanded(e);this.isNodeReadOnly(e)&&!t?.force||(r.setNodeExpanded(e,i),this.getState().lastExpandStateInfoRef.current={state:i?"expanded":"collapsed",nodePath:e},this.actions.treeExpandState=r,i?o.onNodeExpand?.(e,this.getCallbackParam(e)):o.onNodeCollapse?.(e,this.getCallbackParam(e)))}getNodeDataByPath(e){if(!e.length)return null;let t=this.getRowInfoByPath(e);return t?t.data:null}getRowInfoByPath(e){let{pathToIndexMap:t}=this.getState(),o=t.get(e);return o!==void 0?Vn(o,this.getState):null}selectAll(){let{treeSelectionState:e,selectionMode:t}=this.getState();if(t!=="multi-row")throw"Selection mode is not multi-row";if(!(e instanceof Je))throw"Invalid node selection";let o=new Je(e,Jo(this.getState));o.selectAll(),this.getState().lastSelectionUpdatedNodePathRef.current=null,this.actions.treeSelection=o}deselectAll(){let{treeSelectionState:e,selectionMode:t}=this.getState();if(t!=="multi-row")throw"Selection mode is not multi-row";if(!(e instanceof Je))throw"Invalid node selection";let o=new Je(e,Jo(this.getState));o.deselectAll(),this.getState().lastSelectionUpdatedNodePathRef.current=null,this.actions.treeSelection=o}isNodeSelected(e){let{treeSelectionState:t,treeSelection:o,selectionMode:r}=this.getState();if(r==="single-row"){let i=e[e.length-1];return Array.isArray(o)?treeSelection.join(",")===e.join(","):o===i}if(r!=="multi-row")throw"Selection mode is not multi-row or single-row";if(!(t instanceof Je))throw"Invalid tree selection";return t.isNodeSelected(e)}selectNode(e,t){this.setNodeSelection(e,!0,t)}deselectNode(e,t){this.setNodeSelection(e,!1,t)}toggleNodeSelection(e,t){this.isNodeSelected(e)?this.deselectNode(e,t):this.selectNode(e,t)}};function Vs(n){return n.map(en)}function en(n){if(Fe().structuredClone)return Fe().structuredClone(n);if(n===null||typeof n!="object")return n;if(Array.isArray(n))return Vs(n);if(n instanceof Date)return new Date(n);if(n instanceof Set)return new Set(Vs(Array.from(n)));if(n instanceof Map)return new Map(Vs(Array.from(n)));let e={};for(let t in n)n.hasOwnProperty(t)&&(e[t]=en(n[t]));return e}function Hr(n){return n}var la="____not_loaded_yet____";function Gs(n){return typeof n=="string"&&n.startsWith(la)}var co=Object.seal({data:null,field:null});var wt="____root____";function Gn(){return!1}function Hs(n){if(!n||!Object.keys(n).length)return{};let e={};for(let t in n)if(n.hasOwnProperty(t)){let o=n[t].initialValue;e[t]=typeof o=="function"?o():o}return e}function sa(n,e,t,o,r){if(!(!t||!Object.keys(t).length)){for(let i in t)if(t.hasOwnProperty(i)){let a=t[i];if(typeof a.reducer!="function")continue;let l=o[i],s=a.getter?a.getter(n)??null:a.field?n[a.field]:null;o[i]=a.reducer(l,s,n,e,r)}}}function uf(n,e){let{marker:t,reducers:o={},pivot:r,groupBy:i,indexer:a,toPrimaryKey:l,cache:s,mappings:c}=n;t&&t.start();let u=new U;function d(S,y,C,T=0,I=[]){let b=!C.length||T===C.length-1,R=y[c?.values||"values"]||{};for(let w in R)if(R.hasOwnProperty(w)){let v=w;I.push(v),p.set(I,!0),S.set(I,{reducerResults:R[w][c?.totals||"totals"]||{},items:[]}),b||d(S,R[w],C,T+1,I),I.pop()}}let p=r?new U:void 0,f=[],m=Hs(o),g=en(m);e.visitDepthFirst((S,y,C,T)=>{let[I,...b]=y,R=S.children,w=u.get(b);if(w&&(w.cache=S.cache,w.childrenLoading=S.childrenLoading,w.childrenAvailable=S.childrenAvailable,w.error=S.error),b.length==i.length&&i.length){if(w){w.items=R;for(let P=0,D=b.length;P<D;P++){let M=b.slice(0,P),x=u.get(M);x&&(x.items=x.items||[],x.items=x.items.concat(R))}R=a.indexArray(R,{toPrimaryKey:l,cache:s,nodesKey:void 0})}return T?.()}for(let v=0,P=R.length;v<P;v++){if(!R[v]){let E={items:[],reducerResults:{},cache:!1,childrenLoading:!1,childrenAvailable:!1,isTree:!1,isGroupBy:!0};u.set([...b,`${la}${v}`],E);continue}let D=R[v].data,M=R[v].keys||[];if(M.length){let E=M[M.length-1];b.push(E)}let x={items:[],cache:!1,childrenLoading:!1,childrenAvailable:!1,commonData:D,totalChildrenCount:R[v].totalChildrenCount,totalChildrenCountUnfiltered:R[v].totalChildrenCountUnfiltered,reducerResults:R[v].aggregations||{},isTree:!1,isGroupBy:!0};if(u.set(b,x),r){let E=x.pivotDeepMap=new U,z=R[v].pivot;d(E,z,r,0,f)}M.length&&b.pop()}T?.()});let h={deepMap:u,groupParams:n,initialData:e,reducerResults:g};return r&&(h.topLevelPivotColumns=p,h.pivot=r),t&&t.end({details:[{name:"Group by fields",value:i.map(S=>S.field).join(", ")}]}),h}function cf(n,e,t,o,r,i,a,l,s,c=Hr){let{items:u,reducerResults:d,pivotDeepMap:p}=n.get(e);if(u.push(o),a&&sa(o,r,a,d,e),i){for(let f=0,m=i.length;f<m;f++){let{field:g,valueGetter:h,toKey:S}=i[f],y=g?o[g]:null;h&&(co.data=o,co.field=g,y=h(co));let C=(S||c)(y,o);t.push(C),p.has(t)||(l.set(t,!0),p?.set(t,{reducerResults:en(s),items:[]}));let{reducerResults:T,items:I}=p.get(t);I.push(o),a&&sa(o,r,a,T,e)}t.length=0}}function df(n,e,t,o,r,i,a,l){let{isLeafNode:s,getNodeChildren:c,toKey:u}=n,d=u(r),p=[...o,d],f=s(r);if(t.set(p,!0),f){for(let S=0,y=o.length;S<=y;S++){let C=o.slice(0,S),T=e.get(C),{reducerResults:I,items:b}=T;b.push(r),T.leavesAvailableCount++,T.totalLeafNodesCount++,a&&sa(r,i,a,I,C)}return}let m=en(l),g=[];e.set(p,{items:g,isTree:!0,isGroupBy:!1,node:r,reducerResults:m,cache:!1,childrenLoading:!1,childrenAvailable:!0,totalLeafNodesCount:0,leavesAvailableCount:0,treeNesting:o.length});let h=c(r);if(!(!h||!Array.isArray(h))){for(let S=0,y=h.length;S<y;S++){let C=h[S];df(n,e,t,p,C,S,a,l)}a&&Kr(a,m,g)}}function Ks(n,e){let{reducers:t,marker:o}=n;if(o){let c=Object.keys(t??{});o.start({details:c.length>0?[{name:"Reducers",value:c.join(", ")}]:void 0})}let r=Hs(t),i=en(r),a=new U,l=new U;a.set([],{items:[],isTree:!0,isGroupBy:!1,reducerResults:i,cache:!1,childrenLoading:!1,childrenAvailable:!0,totalLeafNodesCount:0,leavesAvailableCount:0,node:null,treeNesting:-1});for(let c=0,u=e.length;c<u;c++)df(n,a,l,[],e[c],c,t,r);t&&Kr(t,i,e);let s={deepMap:a,treeParams:n,treePaths:l,initialData:e,reducerResults:i};return o&&o.end(),s}function ua(n,e){let{marker:t,groupBy:o,defaultToKey:r=Hr,pivot:i,reducers:a}=n;t&&t.start();let l=o.length,s=i?new U:void 0,c=new U,u=[],d=[],p=Hs(a),f=en(p);if(!l){let g={items:[],isTree:!1,isGroupBy:!0,cache:!1,childrenLoading:!1,childrenAvailable:!1,reducerResults:en(p)};i&&(g.pivotDeepMap=new U),c.set(u,g)}for(let g=0,h=e.length;g<h;g++){let S=e[g],y={};for(let C=0;C<l;C++){let{field:T,groupField:I,valueGetter:b,toKey:R}=o[C],w=T?S[T]:null;b&&(co.data=S,co.field=T,w=b(co));let v=(R||r)(w,S);if(y[T||I]=v,u.push(v),!c.has(u)){let P={items:[],isTree:!1,isGroupBy:!0,cache:!1,commonData:{...y},childrenLoading:!1,childrenAvailable:!1,reducerResults:en(p)};i&&(P.pivotDeepMap=new U),c.set(u,P)}cf(c,u,d,S,g,i,a,s,p,r)}l||cf(c,u,d,S,g,i,a,s,p,r),a&&sa(S,g,a,f,u),u.length=0}a&&(c.visitDepthFirst((g,h,S,y)=>{Kr(a,g.reducerResults,g.items),i&&g.pivotDeepMap.visitDepthFirst(({items:C,reducerResults:T},I,b,R)=>{Kr(a,T,C),R?.()}),y?.()}),Kr(a,f,e));let m={deepMap:c,groupParams:n,initialData:e,reducerResults:f};return i&&(m.topLevelPivotColumns=s,m.pivot=i),t&&t.end({details:[{name:"Group by fields",value:o.map(g=>g.field).join(", ")}]}),m}function pf(n){let{groupParams:e,deepMap:t}=n,o=e.groupBy.length,r=[];return t.topDownKeys().reduce((i,a)=>{if(a.length===o){let l=t.get(a).items;i.push(...l)}return i},r),r}function NC(n,e){let{groupBy:t,groupKeys:o,parents:r,reducers:i,lazyLoad:a}=n,l=o.length,{items:s,reducerResults:c,pivotDeepMap:u,commonData:d}=e,p=d??null,f;if(Object.keys(c).length>0){p={...d},f={};for(let y in i)if(i.hasOwnProperty(y)){let T=i[y].field;T&&(f[T]=c[y]),T&&p[T]==null&&(p[T]=c[y])}}let m=!0,g=o[o.length-1],h=g;if(p!=null){let y=t[o.length-1];y&&y.field&&(h=p[y.field]),y&&y.toKey&&(h=y.toKey(h,p)),h=h??g}return typeof h=="string"&&h.startsWith(la)&&(m=!1,h=null),{data:p,reducerData:f,groupCount:s.length,groupData:s,groupKeys:o,isTreeNode:!1,rowSelected:!1,selectedChildredCount:0,deselectedChildredCount:0,id:`${o}`,collapsed:!1,dataSourceHasGrouping:!0,rowDisabled:!1,isCellSelected:Gn,hasSelectedCells:Gn,selfLoaded:m,error:n.error,parents:r,deepRowInfoArray:[],collapsedChildrenCount:0,collapsedGroupsCount:0,totalChildrenCount:n.totalChildrenCount,childrenAvailable:a?n.childrenAvailable:!0,childrenLoading:n.childrenLoading,indexInParentGroups:n.indexInParentGroups,indexInGroup:n.indexInGroup,indexInAll:n.indexInAll,directChildrenCount:n.directChildrenCount,directChildrenLoadedCount:a?n.directChildrenLoadedCount:n.directChildrenCount,value:h,rootGroupBy:t,groupBy:l===t.length?t:t.slice(0,l),isGroupRow:!0,pivotValuesMap:u,groupNesting:l,reducerResults:c}}function ca(n,e,t){return{...n,id:`duplicate_row_on_page_${t}_for__${n.id}`,indexInAll:e,duplicateOf:n.id}}function Kr(n,e,t){if(n){for(let o in n)if(n.hasOwnProperty(o)){let r=n[o];r.done&&(e[o]=r.done(e[o],t))}}return e}function ff(n,e,t,o,r,i){let a=e.length,{isLeafNode:l,getNodeChildren:s}=r.treeParams,{toPrimaryKey:c,treeResult:u,isRowDisabled:d,isNodeSelected:p,withRowInfo:f,isNodeExpanded:m,treeSelectionState:g,repeatWrappedGroupRows:h,rowsPerPage:S}=r,{deepMap:y}=u,C=n.length,T=t[t.length-1],I=T?T.nodeExpanded:!0;for(let b=0;b<C;b++){let R=n[b],w=c(R,b),v=[...e,w];if(l(R)){let V={id:w,nodePath:v,isGroupRow:!1,data:R,treeNesting:a,totalLeafNodesCount:0,collapsedLeafNodesCount:0,isTreeNode:!0,isParentNode:!1,selfLoaded:!0,rowSelected:!1,rowDisabled:!1,isCellSelected:Gn,hasSelectedCells:Gn,dataSourceHasGrouping:!1,parentNodes:Array.from(t),indexInParentNodes:[...o,b],indexInParent:b,indexInAll:I?i.length:-1};p&&(V.rowSelected=p(V)),d&&(V.rowDisabled=d(V)),f&&f(V);let N=h&&S!=null&&S>0&&V.indexInAll%S===0?V.indexInAll/S:null;for(let L=0,F=t.length;L<F;L++){let B=t[L];if(I||(B.collapsedLeafNodesCount+=1),B.deepRowInfoArray.push(V),N!=null&&I){if(typeof h=="function"&&h(B)!==!0)continue;let X=ca(B,V.indexInAll,N);i[X.indexInAll]=X,V.indexInAll++}}I&&(i[V.indexInAll]=V);continue}let M=y.get(v)?.totalLeafNodesCount??0,x={dataSourceHasGrouping:!1,nodeExpanded:!1,selfExpanded:!1,nodePath:v,id:w,data:R,indexInAll:i.length,indexInParent:b,indexInParentNodes:[...o,b],totalLeafNodesCount:M,treeNesting:a,selfLoaded:!0,isParentNode:!0,isTreeNode:!0,isGroupRow:!1,deepRowInfoArray:[],parentNodes:Array.from(t),collapsedLeafNodesCount:0,rowSelected:!1,rowDisabled:!1,isCellSelected:Gn,hasSelectedCells:Gn,selectedLeafNodesCount:0,deselectedLeafNodesCount:0};if(p&&(x.rowSelected=p(x),g)){let V=g.getSelectionCountFor(x.nodePath);x.selectedLeafNodesCount=V.selectedCount,x.deselectedLeafNodesCount=V.deselectedCount}d&&(x.rowDisabled=d(x)),f&&f(x);let E=!0;if(m&&(x.selfExpanded=E=m(x)),I||(E=!1),x.nodeExpanded=E,I&&h&&S!=null&&S>0){let V=x.indexInAll,N=x.parentNodes;if(N.length>0&&V%S===0){let L=V/S,F=0;N.forEach(B=>{typeof h=="function"&&h(B)!==!0||(i.push(ca(B,V+F,L)),F++,x.indexInAll++)})}}I&&(i[x.indexInAll]=x);let z=s(R);Array.isArray(z)&&ff(z,v,[...t,x],x.indexInParentNodes,r,i)}return i}function mf(n){let{dataArray:e,marker:t}=n;t&&t.start();let o=[];return ff(e,[],[],[],n,o),t&&t.end(),{data:o}}function gf(n){let{marker:e,lazyLoad:t,groupResult:o,rowsPerPage:r,repeatWrappedGroupRows:i,withRowInfo:a,toPrimaryKey:l,groupRowsState:s,isRowDisabled:c,isRowSelected:u,rowSelectionState:d,generateGroupRows:p,reducers:f={}}=n,{groupParams:m,deepMap:g,pivot:h}=o,{groupBy:S}=m;e&&e.start({details:[{name:"Group by fields",value:S.map(b=>b.field).join(", ")}]});let y=[],C=[],T=[],I=[];return g.visitDepthFirst((b,R,w,v)=>{let P=b.items,D=R.length,M=s?.isGroupRowCollapsed(R)??!1;I.push(w);let x=NC({lazyLoad:t,groupBy:S,parents:Array.from(T),reducers:f,indexInGroup:w,indexInParentGroups:Array.from(I),indexInAll:y.length,groupKeys:R,error:b.error,totalChildrenCount:b.totalChildrenCount,childrenLoading:(b.childrenLoading||!M&&!b.childrenAvailable)&&t,childrenAvailable:b.childrenAvailable,directChildrenCount:R.length===S.length?b.items.length:g.getDirectChildrenSizeFor(R),directChildrenLoadedCount:0},b);if(u&&(x.rowSelected=u(x),d)){let L=d.getSelectionCountFor(x.groupKeys);x.selectedChildredCount=L.selectedCount,x.deselectedChildredCount=L.deselectedCount}c&&(x.rowDisabled=c(x));let E=T[T.length-1],z=E?.collapsed??!1;z&&(M=!0),x.collapsed=M;let V=p||M;if(z&&(V=!1),V){if(i&&r!=null&&r>0){let L=x.indexInAll,F=x.parents;if(F.length>0&&L%r===0){let B=L/r,X=0;F.forEach(_=>{typeof i=="function"&&i(_)!==!0||(y.push(ca(_,L+X,B)),X++,x.indexInAll++)})}}y.push(x),C.push(y.length-1)}x.collapsedChildrenCount=0,T.forEach(L=>{L.deepRowInfoArray.push(x),L.collapsedGroupsCount+=M?1:0}),E&&x.selfLoaded&&t&&(E.directChildrenLoadedCount+=1),a&&a(x),T.push(x);let N=!0;if(N){if(v)v();else if(!h){let L=y.length;M||(y.length+=P.length);let F=0;for(let B=0,X=P.length;B<X;B++){let _=P[B];if(!M&&i&&r!=null&&r>0){let Ie=L+B+F;if(Ie%r===0){let se=Ie/r;T.forEach(me=>{if(typeof i=="function"&&i(me)!==!0)return;let ve=L+B+F;y[ve]=ca(me,ve,se),F++,y.length++})}}let k=L+B+F,Q={id:_?l(_,k):`${R}-${B}`,data:_,isCellSelected:Gn,hasSelectedCells:Gn,dataSourceHasGrouping:!0,isTreeNode:!1,isGroupRow:!1,selfLoaded:!!_,rowSelected:!1,rowDisabled:!1,rootGroupBy:S,collapsed:M,groupKeys:R,parents:Array.from(T),indexInParentGroups:[...I,B],indexInGroup:B,indexInAll:k,groupBy:S,groupNesting:D+1,groupCount:x.groupCount};u&&(Q.rowSelected=u(Q)),c&&(Q.rowDisabled=c(Q)),a&&a(Q),T.forEach((Ie,se)=>{se===T.length-1&&_&&(Ie.directChildrenLoadedCount+=1),M&&(Ie.collapsedChildrenCount+=1),Ie.deepRowInfoArray.push(Q)}),M||(y[L+B+F]=Q)}}}T.pop(),I.pop()}),e&&e.end(),{data:y,groupRowsIndexes:C}}function Hn(n,e){return e.reduce((t,o)=>{let{field:r,valueGetter:i,toKey:a}=o,l=r?n[r]:i?.({data:n,field:r}),s=(a||Hr)(l,n);return t.push(s),t},[])}var LC=new U,hf=new WeakMap;function da(n){let{originalDataArray:e,groupBy:t,toPrimaryKey:o}=n;if(!e||!t.length)return LC;let r=hf.get(e);if(r&&r.groupBy===t)return r.groups;let i=new U,a=t.length,l=[];return e.forEach(s=>{let c=Hn(s,t);l.length=0;for(let u=0;u<c.length;u++){l.push(c[u]);let d=i.get(l);d||(d={count:0},l.length===a&&(d.primaryKeys=[]),i.set(l,d)),d.count++,d.primaryKeys?.push(o(s))}}),hf.set(e,{groupBy:t,groups:i}),i}function kC(n,e){let t=[];return n.getLeafNodesStartingWith(e,o=>{let r=o.value?.primaryKeys;if(r)for(let i=0;i<r.length;i++)t.push(r[i])}),t}var Oe=class n{constructor(e,t,o){this.selectedRows=null;this.deselectedRows=null;this.defaultSelection=!1;this.selectedMap=new U;this.deselectedMap=new U;this.onlyUsePrimaryKeys=!1;this.selectionCache=new U;this.selectionCountCache=new U;this.lazyEntries=null;this.lazyLoadedRows=null;this.lazyChildrenLoaded=null;this.lazyRowCounts=null;this.mapSet=(e,t)=>{Array.isArray(t)||(this.onlyUsePrimaryKeys?t=[t]:t=[...this.getGroupKeysForPrimaryKey(t),t]),this.xcache(),e==="selected"?this.selectedMap.set(t,!0):this.deselectedMap.set(t,!0)};this._selectedMapSet=e=>{this.mapSet("selected",e)};this._deselectedMapSet=e=>{this.mapSet("deselected",e)};let r=e instanceof Object.getPrototypeOf(this).constructor?e.getState():e;this.getConfig=t,this.onlyUsePrimaryKeys=t().onlyUsePrimaryKeys,o&&Object.assign(this,o),this.update(r)}getGroupKeysForPrimaryKey(e){let{indexer:t,groupBy:o}=this.getConfig(),r=t.getDataForPrimaryKey(e);return r?Hn(r,o):[]}getGroupDeepMap(){return this.getConfig().groupDeepMap}targetsVisibleRowsOnly(){let{multiRowSelectionTarget:e,someRowsFilteredOut:t}=this.getConfig();return e==="visible"&&!!t}targetsFilteredOutRows(){let{multiRowSelectionTarget:e,someRowsFilteredOut:t}=this.getConfig();return e!=="visible"&&!!t}getVisibleDataInsideGroup(e){let{postFilterDataArray:t,groupDeepMap:o}=this.getConfig();return e.length?o?.get(e)?.items??[]:t??[]}hasFilteredOutRowsInsideGroup(e){let t=this.getConfig();return t.someRowsFilteredOut?(e.length?da(t).get(e)?.count??0:t.originalDataArray?.length??0)>this.getVisibleDataInsideGroup(e).length:!1}setVisibleRowsSelection(e,t){let{groupBy:o,toPrimaryKey:r}=this.getConfig(),i=t?this.selectedMap:this.deselectedMap,a=t?this.deselectedMap:this.selectedMap;this.xcache(),this.getVisibleDataInsideGroup(e).forEach(l=>{let s=Hn(l,o),c=r(l),u=[...s,c];a.delete(u),this.isRowSelected(c,s)!==t&&i.set(u,!0)}),this.xcache()}getLazyUnfilteredCount(e){let t=this.getConfig();if(!(!t.lazyLoad||t.multiRowSelectionTarget==="visible"))return e.length?t.groupDeepMap?.get(e)?.totalChildrenCountUnfiltered:t.lazyUnfilteredCount}getLazyHiddenRowsCount(e){let t=e.length<this.getGroupByLength()?this.getLazyUnfilteredCount(e):void 0;if(t===void 0)return 0;let{groupDeepMap:o}=this.getConfig(),r=0;return this.getGroupKeysDirectlyInsideGroup(e).forEach(i=>{r+=this.getLazyUnfilteredCount(i)??(o?.get(i)?.totalChildrenCount||0)}),Math.max(t-r,0)}getLazyEntries(){let e=`${this.selectedMap.version}:${this.deselectedMap.version}`;if(this.lazyEntries?.version!==e){let t=new U;this.selectedMap.getKeysStartingWith([]).forEach(o=>t.set(o,!0)),this.deselectedMap.getKeysStartingWith([]).forEach(o=>t.set(o,!1)),this.lazyEntries={version:e,entries:t}}return this.lazyEntries.entries}getLazyRowCount(e){this.lazyRowCounts=this.lazyRowCounts??new U;let t=this.lazyRowCounts.get(e);if(t!==void 0)return t??void 0;let o=this.computeLazyRowCount(e);return this.lazyRowCounts.set(e,o??null),o}computeLazyRowCount(e){let t=this.getConfig(),o=this.getGroupByLength(),r=this.getLazyUnfilteredCount(e);if(r!==void 0)return r;if(!e.length&&!o)return t.totalCount;let i=e.length?t.groupDeepMap?.get(e):void 0,a=e.length?i?.totalChildrenCount:t.lazyGroupedRowCount;if(a!=null)return a;if(e.length===o)return i?.childrenAvailable?i.items.length:void 0;let l=t.groupDeepMap?.getKeysStartingWith(e,{excludeSelf:!0,depthLimit:1})??[];if(l.length)return l.reduce((s,c)=>s+(Gs(c[c.length-1])?1:this.getLazyRowCount(c)??1),0)}areLazyChildrenLoaded(e){this.lazyChildrenLoaded=this.lazyChildrenLoaded??new U;let t=this.lazyChildrenLoaded.get(e);if(t!==void 0)return t;let o=this.computeLazyChildrenLoaded(e);return this.lazyChildrenLoaded.set(e,o),o}computeLazyChildrenLoaded(e){let{groupDeepMap:t}=this.getConfig(),o=e.length?t?.get(e):void 0;return e.length&&!o?.childrenAvailable?!1:e.length===this.getGroupByLength()?this.getLazyLoadedRows(e).complete:(t?.getKeysStartingWith(e,{excludeSelf:!0,depthLimit:1})??[]).every(r=>!Gs(r[r.length-1]))}getLazyLoadedRows(e){this.lazyLoadedRows=this.lazyLoadedRows??new U;let t=this.lazyLoadedRows.get(e);if(!t){let{groupDeepMap:o,originalDataArray:r,toPrimaryKey:i,totalCount:a}=this.getConfig(),l=e.length?o?.get(e):void 0,s=l?l.items:r??[],c=l?l.totalChildrenCount:a,u=new Set,d=c==null||s.length>=c;for(let p=0;p<s.length;p++){let f=s[p];f==null?d=!1:u.add(i(f))}t={primaryKeys:u,complete:d},this.lazyLoadedRows.set(e,t)}return t}isLazyEntryFilteredOut(e){let{groupDeepMap:t}=this.getConfig(),o=this.getGroupByLength();for(let r=1;r<=e.length;r++){let i=e.slice(0,r-1);if(!(r>o?this.getLazyLoadedRows(i).primaryKeys.has(e[r-1]):!!t?.get(e.slice(0,r))))return this.areLazyChildrenLoaded(i)}return!1}getLazySelectionCountFor(e,t){let o=this.selectionCountCache.get(e);if(o!=null)return o;let r=this.getLazyEntries(),i=this.getGroupByLength()+1,a=this.getLazyUnfilteredCount([])!==void 0,l=0,s=0;r.getKeysOfFirstChildOnEachBranchStartingWith(e,{excludeSelf:!0,respectOrder:!1}).forEach(p=>{if(!a&&this.isLazyEntryFilteredOut(p))return;let f=r.get(p);if(p.length>=i){f?l++:s++;return}let m=this.getLazySelectionCountFor(p,f);l+=m.selectedCount,s+=m.deselectedCount});let c=this.getLazyRowCount(e),u=c===void 0?1:Math.max(c-l-s,0);t?l+=u:s+=u;let d={selectedCount:l,deselectedCount:s};return this.selectionCountCache.set(e,d),d}getGroupCount(e){if(e.length==0)return this.getLazyUnfilteredCount([])??this.getConfig().totalCount;if(this.targetsFilteredOutRows())return da(this.getConfig()).get(e)?.count??0;let o=this.getGroupDeepMap()?.get(e);return o?this.getLazyUnfilteredCount(e)??o.totalChildrenCount??(o.items.length||0):0}getGroupKeysDirectlyInsideGroup(e){let t=this.getConfig(),o={excludeSelf:!0,depthLimit:1};return this.targetsFilteredOutRows()?da(t).getKeysStartingWith(e,o):t.groupDeepMap?.getKeysStartingWith(e,o)||[]}getAllPrimaryKeysInsideGroup(e){let t=this.getConfig(),{groupDeepMap:o,toPrimaryKey:r}=t;if(this.targetsFilteredOutRows())return e.length?kC(da(t),e):(t.originalDataArray??[]).map(r);if(!t.groupBy.length)return this.getVisibleDataInsideGroup([]).map(r);if(!e.length)return(o?.getKeysStartingWith([],{excludeSelf:!0,depthLimit:1})||[]).map(l=>this.getAllPrimaryKeysInsideGroup(l)).flat();let i=o?.get(e);return i?i.items.map(this.getConfig().toPrimaryKey):[]}getGroupByLength(){return this.getConfig().groupBy.length}static from(e,t,o){return new n(e,t,o)}update(e){this.selectedRows=e.selectedRows||null,this.deselectedRows=e.deselectedRows||null,this.selectedMap.clear(),this.deselectedMap.clear(),this.selectedRows?.forEach(this._selectedMapSet),this.deselectedRows?.forEach(this._deselectedMapSet),this.defaultSelection=e.defaultSelection,this.xcache()}xcache(){this.selectionCache.clear(),this.selectionCountCache.clear(),this.lazyLoadedRows=null,this.lazyChildrenLoaded=null,this.lazyRowCounts=null}getState(){let e=r=>{let i=this.getGroupByLength();return r.map(a=>this.onlyUsePrimaryKeys||i===0&&a.length===1?a[0]:a)},t=e(this.selectedMap.topDownKeys()),o=e(this.deselectedMap.topDownKeys());return{defaultSelection:this.defaultSelection,selectedRows:t,deselectedRows:o}}deselectAll(){if(this.targetsVisibleRowsOnly()){this.onlyUsePrimaryKeys?this.deselectGroupRow([]):this.setVisibleRowsSelection([],!1);return}this.update({defaultSelection:!1,selectedRows:[],deselectedRows:[]})}selectAll(){if(this.targetsVisibleRowsOnly()){this.onlyUsePrimaryKeys?this.selectGroupRow([]):this.setVisibleRowsSelection([],!0);return}this.update({defaultSelection:!0,deselectedRows:[],selectedRows:[]})}isRowDefaultSelected(){return this.defaultSelection===!0}isRowDefaultDeselected(){return this.defaultSelection===!1}isRowSelected(e,t){if(this.onlyUsePrimaryKeys)return this.defaultSelection?!this.deselectedMap.has([e]):this.selectedMap.has([e]);t=t||this.getGroupKeysForPrimaryKey(e);let o=[...t,e],r=this.selectionCache.get(o);if(r!==void 0)return r;let i=this.selectedMap.has(o),a=this.deselectedMap.has(o);if(i)return this.selectionCache.set(o,!0),!0;if(a)return this.selectionCache.set(o,!1),!1;if(this.selectedMap.has(t))return this.selectionCache.set(o,!0),!0;if(this.deselectedMap.has(t))return this.selectionCache.set(o,!1),!1;for(t=[...t];t.length;){t.pop();let l=this.selectedMap.has(t),s=this.deselectedMap.has(t);if(l)return this.selectionCache.set(o,!0),!0;if(s)return this.selectionCache.set(o,!1),!1}return this.selectionCache.set(o,this.defaultSelection),this.defaultSelection}isRowDeselected(e,t){return!this.isRowSelected(e,t)}setRowSelected(e,t,o){t?this.setRowAsSelected(e,o):this.setRowAsDeselected(e,o)}getGroupRowSelectionState(e){let t=this.selectionCache.get(e);if(t!==void 0)return t;let{selectedCount:o,deselectedCount:r}=this.getSelectionCountFor(e,this.onlyUsePrimaryKeys?void 0:this.getGroupRowBooleanSelectionStateFromParent(e)),i=o&&r?null:!!o;return this.selectionCache.set(e,i),i}getGroupRowBooleanSelectionStateFromParent(e){if(!e.length)return this.defaultSelection;let t=[...e],o=this.deselectedMap.has(t),r=this.selectedMap.has(t),i=r&&!o?!0:o&&!r?!1:void 0;if(i===void 0)for(;t.length;){if(t.pop(),this.deselectedMap.has(t)){i=!1;break}if(this.selectedMap.has(t)){i=!0;break}}return i===void 0&&(i=this.defaultSelection),i}isGroupRowPartlySelected(e){return this.getGroupRowSelectionState(e)===null}isGroupRowSelected(e){return this.getGroupRowSelectionState(e)===!0}isGroupRowDeselected(e){return this.getGroupRowSelectionState(e)===!1}selectGroupRow(e){if(this.onlyUsePrimaryKeys){this.getAllPrimaryKeysInsideGroup(e).forEach(i=>{this.defaultSelection===!0?this.deselectedMap.delete([i]):this._selectedMapSet(i)}),this.xcache();return}if(this.targetsVisibleRowsOnly()&&this.hasFilteredOutRowsInsideGroup(e)){this.setVisibleRowsSelection(e,!0);return}this.selectedMap.getKeysStartingWith(e,{excludeSelf:!0}).forEach(r=>{this.selectedMap.delete(r)}),e.length===1&&this.defaultSelection===!0||this._selectedMapSet(e),this.deselectedMap.getKeysStartingWith(e).forEach(r=>{this.deselectedMap.delete(r)}),this.xcache()}deselectGroupRow(e){if(this.onlyUsePrimaryKeys){this.getAllPrimaryKeysInsideGroup(e).forEach(i=>{this.defaultSelection===!1?this.selectedMap.delete([i]):this._deselectedMapSet(i)}),this.xcache();return}if(this.targetsVisibleRowsOnly()&&this.hasFilteredOutRowsInsideGroup(e)){this.setVisibleRowsSelection(e,!1);return}this.deselectedMap.getKeysStartingWith(e,{excludeSelf:!0}).forEach(r=>{this.deselectedMap.delete(r)}),e.length===1&&this.defaultSelection===!1||this._deselectedMapSet(e),this.selectedMap.getKeysStartingWith(e).forEach(r=>{this.selectedMap.delete(r)}),this.xcache()}setRowAsSelected(e,t){if(this.onlyUsePrimaryKeys){this.defaultSelection?this.deselectedMap.delete([e]):this._selectedMapSet(e),this.xcache();return}t=t||this.getGroupKeysForPrimaryKey(e);let o=[...t,e];this.deselectedMap.delete(o),this.xcache(),this.getGroupRowSelectionState(t)!==!0&&(this._selectedMapSet(o),this.getGroupRowSelectionState(t)===!0&&this.selectGroupRow(t))}setRowAsDeselected(e,t){if(this.onlyUsePrimaryKeys){this.defaultSelection?this._deselectedMapSet(e):this.selectedMap.delete([e]),this.xcache();return}t=t||this.getGroupKeysForPrimaryKey(e);let o=[...t,e];this.selectedMap.delete(o),this.xcache(),this.getGroupRowSelectionState(t)!==!1&&(this._deselectedMapSet(o),this.getGroupRowSelectionState(t)===!1&&this.deselectGroupRow(t))}deselectRow(e,t){this.setRowSelected(e,!1,t)}selectRow(e,t){this.setRowSelected(e,!0,t)}toggleGroupRowSelection(e){this.getGroupRowSelectionState(e)===!0?this.deselectGroupRow(e):this.selectGroupRow(e)}toggleRowSelection(e,t){this.isRowSelected(e,t)?this.deselectRow(e,t):this.selectRow(e,t)}getSelectedCount(){return this.getSelectionCountFor([]).selectedCount}getDeselectedCount(){return this.getSelectionCountFor([]).deselectedCount}getSelectionCountFor(e=[],t){let o=this.selectionCountCache.get(e);if(o!=null)return o;let r=this.getGroupByLength();if(e.length>r){let c=this.isRowSelected(e)?{selectedCount:1,deselectedCount:0}:{selectedCount:0,deselectedCount:1};return this.selectionCountCache.set(e,c),c}if(this.getConfig().lazyLoad&&(!this.onlyUsePrimaryKeys||!r))return this.getLazySelectionCountFor(e,t??this.getGroupRowBooleanSelectionStateFromParent(e));if(this.onlyUsePrimaryKeys&&(r||this.targetsVisibleRowsOnly())){let c=this.getAllPrimaryKeysInsideGroup(e),u=0,d=0;c.forEach(f=>{if(this.defaultSelection){if(this.deselectedMap.has([f])){d++;return}u++}else{if(this.selectedMap.has([f])){u++;return}d++}});let p={selectedCount:u,deselectedCount:d};return this.selectionCountCache.set(e,p),p}if(e.length===r&&this.targetsVisibleRowsOnly()){let{toPrimaryKey:c}=this.getConfig(),u=0,d=0;this.getVisibleDataInsideGroup(e).forEach(f=>{this.isRowSelected(c(f),e)?u++:d++});let p={selectedCount:u,deselectedCount:d};return this.selectionCountCache.set(e,p),p}t=t??this.getGroupRowBooleanSelectionStateFromParent(e);let i=this.getGroupKeysDirectlyInsideGroup(e);if(e.length===this.getGroupByLength()){let c=this.selectedMap.has(e)?!0:this.deselectedMap.has(e)?!1:t,u=this.getGroupCount(e),d=this.selectedMap.getKeysStartingWith(e,{excludeSelf:!0,depthLimit:1}).length,p=this.deselectedMap.getKeysStartingWith(e,{excludeSelf:!0,depthLimit:1}).length,f=u-(d+p),m={selectedCount:d+(c?f:0),deselectedCount:p+(c?0:f)};return this.selectionCountCache.set(e,m),m}let a=0,l=0;i.forEach(c=>{let u=this.selectedMap.get(c),d=this.deselectedMap.get(c),p=u?!0:d?!1:t,{selectedCount:f,deselectedCount:m}=this.getSelectionCountFor(c,p);a+=f,l+=m});let s={selectedCount:a,deselectedCount:l};return this.selectionCountCache.set(e,s),s}};function tr(n,e){return new Oe(n,mt(e))}function mt(n){return()=>{let e=typeof n=="function"?n():n,{originalDataArray:t,postFilterDataArray:o}=e,r=!!e.lazyLoad,i=r?e.originalLazyGroupData.get([wt]):void 0;return{lazyLoad:r,toPrimaryKey:e.toPrimaryKey,onlyUsePrimaryKeys:!e.useGroupKeysForMultiRowSelection,groupBy:e.groupBy,groupDeepMap:e.groupDeepMap,indexer:e.indexer,totalCount:r?t?.length??0:e.unfilteredCount,lazyGroupedRowCount:e.groupBy.length?i?.totalChildrenCount:void 0,lazyUnfilteredCount:e.groupBy.length?i?.totalChildrenCountUnfiltered:i?.totalCountUnfiltered,multiRowSelectionTarget:e.multiRowSelectionTarget,someRowsFilteredOut:!e.lazyLoad&&!!t&&!!o&&o.length<t.length,originalDataArray:t,postFilterDataArray:o}}}function yf(n){let{getDataSourceState:e,dataSourceActions:t}=n;return{get allRowsSelected(){return e().allRowsSelected},selectAll(){let{rowSelection:r,selectionMode:i}=e();if(i!=="multi-row")throw"Selection mode is not multi-row";if(!(r instanceof Oe))throw"Invalid row selection";let a=new Oe(r,mt(e));a.selectAll(),t.rowSelection=a},deselectAll(){let{rowSelection:r,selectionMode:i}=e();if(i!=="multi-row")throw"Selection mode is not multi-row";if(!(r instanceof Oe))throw"Invalid row selection";let a=new Oe(r,mt(e));a.deselectAll(),t.rowSelection=a},isRowSelected(r,i){let{rowSelection:a,selectionMode:l,indexer:s,groupBy:c}=e();if(l==="single-row")return a===r;if(l!=="multi-row")throw"Selection mode is not multi-row or single-row";if(!(a instanceof Oe))throw"Invalid row selection";if(!i){let u=s.getDataForPrimaryKey(r);i=u?Hn(u,c):[]}return a.isRowSelected(r,i)},isRowDeselected(r,i){return!this.isRowSelected(r,i)},selectRow(r,i){let{rowSelection:a,selectionMode:l,indexer:s,groupBy:c}=e();if(l==="single-row"){t.rowSelection=r;return}if(l!=="multi-row")throw"Selection mode is not multi-row or single-row";if(!(a instanceof Oe))throw"Invalid row selection";if(!i){let d=s.getDataForPrimaryKey(r);i=d?Hn(d,c):[]}let u=new Oe(a,mt(e));u.selectRow(r,i),t.rowSelection=u},deselectRow(r,i){let{selectionMode:a,rowSelection:l,indexer:s,groupBy:c}=e();if(a==="single-row"){t.rowSelection=null;return}if(a!=="multi-row")throw"Selection mode is not multi-row or single-row";if(!(l instanceof Oe))throw"Invalid row selection";if(a==="multi-row"){if(!i){let d=s.getDataForPrimaryKey(r);i=d?Hn(d,c):[]}let u=new Oe(l,mt(e));u.deselectRow(r,i),t.rowSelection=u}},toggleRowSelection(r,i){this.isRowSelected(r,i)?this.deselectRow(r,i):this.selectRow(r,i)},selectGroupRow(r){let{selectionMode:i,rowSelection:a,groupBy:l}=e();if(i!=="multi-row")throw'Selection mode should be "multi-row"';if(!l)throw"No grouping specified";if(!(a instanceof Oe))throw"Invalid row selection";let s=new Oe(a,mt(e));s.selectGroupRow(r),t.rowSelection=s},deselectGroupRow(r){let{selectionMode:i,rowSelection:a,groupBy:l}=e();if(i!=="multi-row")throw'Selection mode should be "multi-row"';if(!l)throw"No grouping specified";if(!(a instanceof Oe))throw"Invalid row selection";let s=new Oe(a,mt(e));s.deselectGroupRow(r),t.rowSelection=s},toggleGroupRowSelection(r){let{selectionMode:i,rowSelection:a,groupBy:l}=e();if(i!=="multi-row")throw'Selection mode should be "multi-row"';if(!l)throw"No grouping specified";if(!(a instanceof Oe))throw"Invalid row selection";let s=new Oe(a,mt(e));s.toggleGroupRowSelection(r),t.rowSelection=s},getGroupRowSelectionState(r,i){let a=e(),{selectionMode:l,groupBy:s}=a,c=i?new Oe(i,mt(a)):a.rowSelection;if(l!=="multi-row")throw'Selection mode should be "multi-row"';if(!s)throw"No grouping specified";if(!(c instanceof Oe))throw"Invalid row selection";return c.getGroupRowSelectionState(r)},getSelectedPrimaryKeys:r=>{let i=e(),a=r?new Oe(r,mt(i)):i.rowSelection,l=[];return i.lazyLoad&&console.error("getSelectedPrimaryKeys should not be called for lazy-loaded datasources as it wont return reliable results"),i.originalDataArray.forEach(s=>{let c=i.toPrimaryKey(s);a.isRowSelected(c)&&l.push(c)}),l}}}function Sf(n,e){pa(n,e),VC(n,e),e.detail===2&&zC(n,e),n.getState().onCellClick?.(n,e)}function zC(n,e){if(Gr(e.target))return;let{onCellDoubleClick:t}=n.getState(),o={preventEdit:!1};if(t){let a=t(n,e);a&&typeof a=="object"&&(o={...o,...a})}if(o.preventEdit)return;let i=n.getComputed().computedVisibleColumns[n.colIndex];n.api.startEdit({rowIndex:n.rowIndex,columnId:i.id})}function VC(n,e){let{getDataSourceState:t,getState:o,getComputed:r,rowIndex:i,colIndex:a,dataSourceActions:l}=n,s=t(),{selectionMode:c,cellSelection:u}=s;if(!u||c!=="multi-cell")return;let{multiCellSelector:d,computedVisibleColumns:p}=r(),{brain:f,debugId:m}=o(),{rowsPerPage:g}=f,h=p.length,S=new Ue(u);S.debugId=m??"",d.cellSelectionState=S;let y={rowIndex:i,colIndex:a};if(e.metaKey||e.ctrlKey)d.singleAddClick(y);else if(e.shiftKey){let C=!!o().wrapRowsHorizontally;d.multiSelectClick(y,C?{horizontalLayout:C,rowsPerPage:g,columnsPerSet:h}:{horizontalLayout:C})}else d.resetClick(y);l.cellSelection=S}function GC(n){return n.getState().multiRowSelectionWith!=="click"&&n.getComputed().renderSelectionCheckBox?"checkbox":"click"}function HC(n){return n?Gr(n)?!0:typeof n.closest!="function"?!1:!!n.closest(`.${Qo}, [data-name="expand-collapse-icon"]`):!1}function pa(n,e,t=e.key?"keyboard":"click"){let{rowIndex:o,getDataSourceState:r,getComputed:i,dataSourceActions:a,dataSourceApi:l,api:s,cloneRowSelection:c,cloneTreeSelection:u}=n,{multiRowSelector:d}=i(),p=r(),{selectionMode:f,dataArray:m,isTree:g}=p;if(t==="click"&&HC(e.target))return!1;let h=m[o];if(!h||h.rowDisabled)return!1;if(g){if(!h.isTreeNode||!h.nodePath)return!1;let{isNodeSelectable:S}=p;if(S&&!S(h))return!1}if(f==="multi-row"){let S=GC(n);if(t==="click"&&S==="checkbox")return!1;let y=t==="checkbox"||t==="keyboard"&&S==="checkbox",C=()=>{e.shiftKey?d.multiSelectClick(o):y||e.metaKey||e.ctrlKey?d.singleAddClick(o):d.resetClick(o)};if(g){let{treeSelectionState:I}=p;if(!(I instanceof Je))return!1;let b=u(I);d.treeSelectionState=b,C(),d.treeSelectionState=void 0;let R=!e.shiftKey&&(y||e.metaKey||e.ctrlKey);return p.lastSelectionUpdatedNodePathRef&&(p.lastSelectionUpdatedNodePathRef.current=R?{nodePath:h.nodePath,selected:!!b.isNodeSelected(h.nodePath)}:null),a.treeSelection=b,!0}let{rowSelection:T}=p;return!T||typeof T!="object"?!1:(T=c(T),d.rowSelectionState=T,C(),a.rowSelection=T,!0)}else if(f==="single-row"){if(h.isGroupRow)return!1;let S=e.metaKey||e.ctrlKey||t!=="click";if(g){let{treeApi:C}=l;return S?C.toggleNodeSelection(h.nodePath):C.selectNode(h.nodePath),!0}let y=h.id;return S?s.rowSelectionApi.toggleRowSelection(y):s.rowSelectionApi.selectRow(y),!0}return!1}function bf(n,e){let{getComputed:t,dataSourceActions:o,dataSourceApi:r}=n,i=t().multiRowSelector,a=i.lastPointerDown;i.lastPointerDown=void 0;let l=n.getDataSourceState;return pa({rowIndex:e,api:n,getComputed:t,getState:n.getState,getDataSourceState:l,dataSourceActions:o,dataSourceApi:r,cloneRowSelection:s=>tr(s,l),cloneTreeSelection:s=>er(s,l)},{key:"",metaKey:!1,ctrlKey:!1,shiftKey:a?.rowIndex===e&&a.shiftKey,preventDefault:()=>{}},"checkbox")}var Br=H(require("react")),Rf=require("react");var Tf="_96uiwi0 _16lm1iw1d _16lm1iwk _16lm1iw9",Cf=he({defaultClassName:"_96uiwi1",variantClassNames:{expanded:{true:"_16lm1iwi",false:"_96uiwi3"},direction:{end:"_96uiwi4",start:"_96uiwi5"},disabled:{true:"_96uiwi6",false:"_96uiwi7"}},defaultVariants:{},compoundVariants:[[{expanded:!1,direction:"end"},"_16lm1iwj"]]});var If="M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z",o1=Object.keys({size:1,expanded:1,defaultExpanded:1,onChange:1,style:1,disabled:1,className:1,direction:1});var fa=`${ct}-expand-collapse`;function uo(n){let{size:e=24,direction:t="start",disabled:o=!1}=n,[r,i]=(0,Rf.useState)(n.expanded??n.defaultExpanded),a=()=>{n.onChange?.(!r),Fn("expanded",n)||i(!r)};Br.useEffect(()=>{Fn("expanded",n)&&i(n.expanded)},[n.expanded]);let l=r?"expanded":"collapsed";return Br.createElement("svg",{"data-name":"expand-collapse-icon","data-state":l,"data-disabled":o,xmlns:"http://www.w3.org/2000/svg",height:`${e}px`,viewBox:"0 0 24 24",width:`${e}px`,style:n.style,onClick:o?void 0:a,className:$(n.className,Tf,Vo.expandCollapse,Cf({direction:t||"start",expanded:r,disabled:o}),`${ct}`,`${fa}`,`${fa}--${l}`,`${fa}--${t==="end"?"end":"start"}`,o?`${fa}--disabled`:"")},Br.createElement("path",{d:If}))}function wf(n){return typeof n.field=="string"}function vf(n){let{column:e,rowInfo:t,fieldsToColumn:o}=n,r;if(e.groupByForColumn){if(t.isGroupRow){let i=t.groupBy[t.groupBy.length-1];(Array.isArray(e.groupByForColumn)||e.groupByForColumn===i)&&(r=i?o.get(i.field||i.groupField):void 0)}!r&&e.field&&(r=o.get(e.field))}return r}function tn(n){let{getComputed:e,getDataSourceState:t,getState:o,rowIndex:r,columnId:i,api:a,dataSourceApi:l}=n,{dataArray:s}=t(),c=s[r],{isGroupRow:u,isTreeNode:d}=c,p=e().computedColumnsMap.get(i),{activeRowIndex:f,keyboardNavigation:m,isRowDetailEnabled:g}=o(),h=r===f&&m==="row",S=!g||typeof g=="function"&&!g(c)?!1:a.rowDetailApi.isRowDetailExpanded(c.id)?"expanded":"collapsed",{formattedValue:y,formattedValueContext:{rawValue:C}}=nr({column:p,rowInfo:c,rowDetailState:S,columnsMap:e().computedColumnsMap,context:n}),T=St(p.id,n);return u?{api:a,dataSourceApi:l,column:p,columnApi:T,isParentNode:!1,isGroupRow:!0,isTreeNode:!1,nodeExpanded:!1,rowDetailState:!1,data:c.data,rowActive:h,rowInfo:c,rowSelected:c.rowSelected,value:y,rawValue:C}:d?c.isParentNode?{api:a,dataSourceApi:l,columnApi:T,column:p,nodeExpanded:c.nodeExpanded,isTreeNode:!0,isGroupRow:!1,isParentNode:!0,rowDetailState:S,data:c.data,rowActive:h,rowInfo:c,rowSelected:c.rowSelected,value:y,rawValue:C}:{api:a,dataSourceApi:l,columnApi:T,column:p,nodeExpanded:!1,isTreeNode:!0,isGroupRow:!1,isParentNode:!1,rowDetailState:S,data:c.data,rowActive:h,rowInfo:c,rowSelected:c.rowSelected,value:y,rawValue:C}:{api:a,dataSourceApi:l,columnApi:T,column:p,isTreeNode:!1,isParentNode:!1,isGroupRow:!1,nodeExpanded:!1,rowDetailState:S,data:c.data,rowActive:h,rowInfo:c,rowSelected:c.rowSelected,value:y,rawValue:C}}function Pf(n){return Df(n.column,n.rowInfo)}function xf(n){let{column:e,context:t,rowInfo:o,visibleColumnIds:r}=n,i=vf({rowInfo:o,column:e,fieldsToColumn:n.fieldsToColumn,groupRenderStrategy:t.getState().groupRenderStrategy}),{getState:a}=t,{editingCell:l}=a(),s=nr(n),{formattedValueContext:c}=s,u=t.api.isEditorVisibleForCell({columnId:e.id,rowIndex:o.indexInAll}),d=Object.assign({rowIndexInHorizontalLayoutPage:n.rowIndexInHorizontalLayoutPage,horizontalLayoutPageIndex:n.horizontalLayoutPageIndex,column:n.column,inEdit:u,rowHasSelectedCells:!1},c,{editError:l&&l.primaryKey===o.id&&l.columnId===e.id&&!l.active&&l.accepted instanceof Error?l.accepted:void 0});Object.defineProperty(d,"rowHasSelectedCells",{get(){return o.hasSelectedCells(r)}});let p=typeof e.align=="function"?e.align({isHeader:!1,...d}):e.align??"start",f=typeof e.verticalAlign=="function"?e.verticalAlign({isHeader:!1,...d}):e.verticalAlign??"center";return{inEdit:u,stylingParam:d,formattedValueContext:c,renderFunctions:{renderGroupIcon:e.renderGroupIcon||i?.renderGroupIcon,renderSelectionCheckBox:e.renderSelectionCheckBox,renderRowDetailIcon:e.renderRowDetailIcon,renderTreeIcon:e.renderTreeIcon,renderTreeIconForParentNode:e.renderTreeIconForParentNode,renderTreeIconForLeafNode:e.renderTreeIconForLeafNode,renderValue:e.renderValue||i?.renderValue,renderGroupValue:e.renderGroupValue||i?.renderGroupValue,renderLeafValue:e.renderLeafValue||i?.renderLeafValue},renderParams:KC({rowIndexInHorizontalLayoutPage:n.rowIndexInHorizontalLayoutPage,horizontalLayoutPageIndex:n.horizontalLayoutPageIndex,column:n.column,rowInfo:n.rowInfo,visibleColumnIds:n.visibleColumnIds,columnsMap:n.columnsMap,fieldsToColumn:n.fieldsToColumn,context:n.context,align:p,verticalAlign:f,formattedValueContext:c}),groupByColumnReference:i}}function KC(n){let{column:e,context:t,rowInfo:o,align:r,verticalAlign:i,visibleColumnIds:a,columnsMap:l,fieldsToColumn:s,formattedValueContext:c}=n,{value:u}=c,{api:d,getDataSourceState:p,getState:f,dataSourceApi:m}=t,{editingCell:g}=f(),{indexInAll:h}=o,S=p(),{selectionMode:y,cellSelection:C}=S,T=vf({rowInfo:o,column:e,fieldsToColumn:s,groupRenderStrategy:t.getState().groupRenderStrategy}),I=d.toggleGroupRow,b=C?.isCellSelected(o.id,e.id)??!1,R={column:e,columnsMap:l,fieldsToColumn:s,align:r,verticalAlign:i,cellSelected:b,rowHasSelectedCells:!1,horizontalLayoutPageIndex:n.horizontalLayoutPageIndex,rowIndexInHorizontalLayoutPage:n.rowIndexInHorizontalLayoutPage,...c,editError:g&&g.primaryKey===o.id&&g.columnId===e.id&&!g.active&&g.accepted instanceof Error?g.accepted:void 0,groupByColumn:T,selectionMode:y,api:d,dataSourceApi:m,toggleCurrentRowDetails:()=>d.rowDetailApi.toggleRowDetail(o.id),toggleRowDetails:d.rowDetailApi.toggleRowDetail,expandRowDetails:d.rowDetailApi.expandRowDetail,collapseRowDetails:d.rowDetailApi.collapseRowDetail,toggleCurrentTreeNode:()=>{m.treeApi.toggleNode(o.nodePath)},toggleTreeNode:m.treeApi.toggleNode,expandTreeNode:m.treeApi.expandNode,collapseTreeNode:m.treeApi.collapseNode,selectTreeNode:m.treeApi.selectNode,deselectTreeNode:m.treeApi.deselectNode,toggleTreeNodeSelection:m.treeApi.toggleNodeSelection,toggleCurrentTreeNodeSelection:()=>{o.isTreeNode&&m.treeApi.toggleNodeSelection(o.nodePath)},selectRow:d.rowSelectionApi.selectRow,deselectRow:d.rowSelectionApi.deselectRow,toggleRowSelection:d.rowSelectionApi.toggleRowSelection,toggleGroupRowSelection:d.rowSelectionApi.toggleGroupRowSelection,selectCell:()=>{d.cellSelectionApi.selectCell({rowId:o.id,colId:e.id})},deselectCell:()=>{d.cellSelectionApi.deselectCell({rowId:o.id,colId:e.id})},renderBag:{all:null,value:typeof u=="boolean"?`${u}`:u,selectionCheckBox:null,groupIcon:null,treeIcon:null},selectCurrentRow:()=>{if(!o.isTreeNode)return d.rowSelectionApi.selectRow(o.id,o.dataSourceHasGrouping?o.groupKeys:void 0)},deselectCurrentRow:()=>{if(!o.isTreeNode)return d.rowSelectionApi.deselectRow(o.id,o.dataSourceHasGrouping?o.groupKeys:void 0)},rowIndex:h,toggleGroupRow:I,toggleCurrentGroupRow:()=>{o.isGroupRow&&I(o.groupKeys)},toggleCurrentRowSelection:()=>{if(!(o.isGroupRow||o.isTreeNode))return d.rowSelectionApi.toggleRowSelection(o.id)},toggleCurrentGroupRowSelection:()=>{if(o.isGroupRow)return d.rowSelectionApi.toggleGroupRowSelection(o.isGroupRow?o.groupKeys:[])},rootGroupBy:S.groupBy,pivotBy:S.pivotBy};return Object.defineProperty(R,"rowHasSelectedCells",{get(){return o.hasSelectedCells(a)}}),R}function BC(n,e){if(!n.isGroupRow)return;let t=n.groupData;if(!t.length)return;let o=t[0][e];for(let r=1,i=t.length;r<i;r++)if(t[r][e]!==o)return;return o}function Df(n,e){let{data:t,isGroupRow:o,dataSourceHasGrouping:r}=e,i=r?e.groupBy:void 0,a=o&&i&&n.groupByForColumn&&(Array.isArray(n.groupByForColumn)||n.groupByForColumn===i[i.length-1])?e.value:wf(n)?t?.[n.field]:null;return n.field&&e.isGroupRow&&e.reducerData&&e.reducerData[n.field]!=null&&(a=e.reducerData[n.field]),a===void 0&&e.isGroupRow&&n.groupByForColumn&&wf(n)&&(a=BC(e,n.field)),n.valueGetter&&!e.isGroupRow&&e.data&&(a=n.valueGetter({data:e.data,field:n.field})),a}function WC(n,e,t,o,r){let{rowSelected:i,indexInAll:a}=t,{activeRowIndex:l,keyboardNavigation:s}=o.getState(),c=a===l&&s==="row";return t.isGroupRow?{rowInfo:t,isGroupRow:!0,isTreeNode:!1,isParentNode:!1,nodeExpanded:!1,data:t.data,rowDetailState:!1,rowSelected:i,rowActive:c,value:n,rawValue:n,field:e.field}:t.isTreeNode?t.isParentNode?{rowInfo:t,isGroupRow:!1,isTreeNode:!0,isParentNode:!0,nodeExpanded:t.nodeExpanded,data:t.data,rowDetailState:r,rowSelected:i,rowActive:c,value:n,rawValue:n,field:e.field}:{rowInfo:t,isGroupRow:!1,isTreeNode:!0,isParentNode:!1,nodeExpanded:!1,data:t.data,rowDetailState:r,rowSelected:i,rowActive:c,value:n,rawValue:n,field:e.field}:{rowInfo:t,isGroupRow:!1,isTreeNode:!1,isParentNode:!1,nodeExpanded:!1,data:t.data,rowDetailState:r,rowSelected:i,rowActive:c,value:n,rawValue:n,field:e.field}}function nr(n){let{column:e,rowInfo:t,context:o,rowDetailState:r}=n,i=Df(e,t),a=WC(i,e,t,o,r),l=e.valueFormatter?e.valueFormatter(a):i;return a.value=l,{formattedValue:l,formattedValueContext:a}}var Mf=he({defaultClassName:"_7pupv01",variantClassNames:{align:{start:"_7pupv02",center:"_7pupv03",end:"_7pupv04"}},defaultVariants:{},compoundVariants:[]}),Ef="_7pupv00",Af=he({defaultClassName:"_7pupv05",variantClassNames:{align:{start:"_7pupv06",center:"_7pupv07",end:"_7pupv08"}},defaultVariants:{},compoundVariants:[]});var{rootClassName:_f}=ze,mn=`${_f}Cell`,Wr=`${_f}Cell_content`;var{rootClassName:jC}=ze,nn=`${jC}ColumnCell`;var UC=Y(q.columnZIndexAtIndex),$C=Y(q.columnVisibilityAtIndex);function Of({rowInfo:n,column:e}){let t=0;if(n.dataSourceHasGrouping)if(n.isGroupRow){let o=e?.groupByForColumn,r=n.groupBy[n.groupBy.length-1],i=!!n.pivotValuesMap,a=i&&!!e?.field&&!!o&&!Array.isArray(o)&&(o.field??o.groupField)!==(r?.field??r?.groupField),l=i&&Array.isArray(o)&&n.groupNesting===n.rootGroupBy.length;t=a||l?n.groupNesting:n.groupNesting-1}else t=n.groupNesting;return{[Y(fe.components.Row.groupNesting)]:t}}function Ff({rowInfo:n}){return{[Y(fe.components.Row.groupNesting)]:n.isTreeNode?n.isParentNode?n.treeNesting:n.treeNesting+1:0}}function Bs(n,e){return n?typeof n=="function"?n(e):n:void 0}function Ws(n,e,t){return typeof e=="function"?{...n,...e(t)}:{...n,...e}}function Nf(n){let{column:e,rowInfo:t,rowIndex:o,rowHeight:r,rowIndexInHorizontalLayoutPage:i,horizontalLayoutPageIndex:a,align:l,verticalAlign:s,stylingParam:c,formattedValueContext:u,groupByColumnReference:d,rowStyle:p,rowClassName:f,cellStyle:m,cellClassName:g,showZebraRows:h,rowActive:S,rowDisabled:y,rowSelected:C,cellSelected:T,cellSelection:I,getData:b,computedVisibleColumns:R,visibleColumnIds:w,computedColumnOrder:v,columnReorderInPageIndex:P}=n,D=w??R.map(me=>me.id),M=v,x,E={...u,visibleColumnIds:D,allColumnIds:M,rowIndex:o,get rowHasSelectedCells(){return x===void 0&&(x=t.hasSelectedCells(D)),x}},z=!!(t.isTreeNode&&(e.renderTreeIcon||e.renderTreeIconForLeafNode||e.renderTreeIconForParentNode)),V=typeof f=="function"?f(E):f,N;d?.className&&(N=Bs(d.className,c)),g&&(N=$(N,Bs(g,c))),e.className&&(N=$(N,Bs(e.className,c))),z&&(N=$(N,Af({align:l})));let L;t.dataSourceHasGrouping&&e.groupByForColumn&&(L=Of({rowInfo:t,column:e})),z&&(L=Ff({rowInfo:t})),p&&(L=typeof p=="function"?{...L,...p(E)}:{...L,...p}),m&&(L=Ws(L,m,c)),d?.style&&(L=Ws(L,d.style,c)),e.style&&(L=Ws(L,e.style,c)),L=L||{},L.height=r,L.zIndex=`var(${UC}-${e.computedVisibleIndex})`,L.visibility=`var(${$C}-${e.computedVisibleIndex}, visible)`;let F=i!=null?i%2===1:(t.indexInAll!=null?t.indexInAll:o)%2===1,B=h?F?"odd":"even":!1,X=!1,_=!1,k=!1,K=!1;if(I&&T){let me=b(),ve=me[t.indexInAll-1],Pe=me[t.indexInAll+1],ue=R[e.computedVisibleIndex+1],oe=R[e.computedVisibleIndex-1];X=ve?!I.isCellSelected(ve.id,e.id):!0,e.computedPinned==="end"&&e.computedFirstInCategory?_=!0:_=oe?!I.isCellSelected(t.id,oe.id):!0,e.computedPinned==="start"&&e.computedLastInCategory?k=!0:k=ue?!I.isCellSelected(t.id,ue.id):!0,K=Pe?!I.isCellSelected(Pe.id,e.id):!0}let Q=I&&T?{top:X,left:_,right:k,bottom:K}:null,Ie=P!=null?a!==P:!1,se=$(Q?af(Q):"",Ui(e,[nn,mn],rf,{dragging:!1,insideDisabledDraggingPage:Ie,zebra:B,align:l,verticalAlign:s,rowDisabled:y,rowActive:S,cellSelected:T,rowSelected:C,treeNode:t.isTreeNode?t.isParentNode?"parent":"leaf":!1,firstRow:t.indexInAll===0,firstRowInHorizontalLayoutPage:i===0,groupRow:t.isGroupRow,groupCell:t.isGroupRow?!!e.groupByForColumn:!1,rowExpanded:t.isGroupRow?!t.collapsed:!1}),N,V);return{style:L,className:se,cellSelectionBorders:Q,zebra:B,columnIsTree:z}}var gn=H(require("react"));var YC=Y(q.columnWidthAtIndex),qC=Y(q.columnReorderEffectDurationAtIndex);function XC(n){let{cssEllipsis:e=!0,virtualized:t=!0,skipColumnShifting:o=!1,contentStyle:r,column:i,domRef:a,width:l,contentClassName:s,rowId:c,afterChildren:u,beforeChildren:d,cellType:p,cssPosition:f,renderChildren:m,horizontalLayoutPageIndex:g,...h}=n,S=typeof m=="function"?m():m,y={width:`var(${YC}-${i.computedVisibleIndex})`,transition:`transform var(${qC}-${i.computedVisibleIndex}, 0s)`,...h.style},C={...h,style:y,"data-column-id":i.id,"data-z-index":y.zIndex,className:$(h.className,mn,of),children:gn.createElement(gn.Fragment,null,d,gn.createElement("div",{className:$(Wr,e?Ht:ad.hidden,s),style:r},S),u)};c!=null&&(C["data-row-id"]=`${c}`);let T=p==="body"?i.components?.ColumnCell:i.components?.HeaderCell;return T?gn.createElement(T,{...C,ref:a}):gn.createElement("div",{...C,ref:a})}var ma=gn.memo(XC);var fo=H(require("react")),po=require("react");function Lf(){let{initialValue:n,setValue:e,confirmEdit:t,cancelEdit:o,readOnly:r}=ga(),i=(0,po.useRef)(null),a=(0,po.useRef)(!1),l=fo.useCallback(u=>{i.current=u,u&&u.focus()},[]),s=(0,po.useCallback)(u=>{let{key:d}=u;d==="Enter"||d==="Tab"?t():d==="Escape"?(a.current=!0,o()):u.stopPropagation()},[]),c=(0,po.useCallback)(()=>{a.current||t()},[]);return fo.createElement(fo.Fragment,null,fo.createElement("input",{readOnly:r,ref:l,onKeyDown:s,onBlur:c,className:$(Ju,id.none),type:"text",defaultValue:n,onChange:(0,po.useCallback)(u=>{e(u.target.value)},[])}))}function kf(n,e){let t=[];for(let o in n)n.hasOwnProperty(o)&&!e.hasOwnProperty(o)&&t.push(n[o]);return t}var jr=Ce.createContext(null),ZC=n=>{let{toggleCurrentRowDetails:e,rowDetailState:t}=n;return Ce.createElement(uo,{style:{visibility:t===!1?"hidden":"visible"},expanded:t==="expanded",onChange:e})},QC={display:"inline-block",visibility:"visible"},js=n=>{let{rowInfo:e,toggleCurrentTreeNode:t,nodeExpanded:o,api:r}=n,i=r.getDataSourceState().isNodeReadOnly;return Ce.createElement(uo,{disabled:e.isTreeNode&&e.isParentNode?i(e):!1,style:QC,expanded:o,onChange:t})},JC=n=>{let{rowInfo:e,rowIndex:t,column:o,api:r}=n;e.isGroupRow&&o.groupByForColumn;let{components:i}=r.getState(),a=r.getDataSourceState().isNodeSelectable,l=i?.CheckBox||zn;return Ce.createElement(l,{domProps:{className:Qo},disabled:e.isTreeNode?!a(e):!1,onChange:()=>{bf(r,t)},checked:e.rowSelected})};function eI(n){let{repaintCellsKey:e,column:t,rowIndex:o,rowInfoStore:r,getDataSourceState:i}=n,[,a]=(0,ke.useReducer)(s=>s+1,0),l=tf(e)?e:void 0;(0,ke.useEffect)(()=>{if(l)return nf(l,{column:t,rowIndex:o,rowInfoStore:r,getDataSourceState:i},a)},[l,t,o,r,i])}function tI(n){let{dataSourceStatePartialForCell:e,rowInfoStore:t,rowStyle:o,rowClassName:r,rowIndexInHorizontalLayoutPage:i,horizontalLayoutPageIndex:a,getData:l,visibleColumnIds:s,computedColumnOrder:c,cellStyle:u,cellClassName:d,repaintCellsKey:p,rowDetailState:f,width:m,column:g,onMouseLeave:h,onMouseEnter:S,onRowMouseEnter:y,onRowMouseLeave:C,rowIndex:T,rowHeight:I,columnsMap:b,fieldsToColumn:R,domRef:w,hidden:v,showZebraRows:P,getDataSourceState:D,dataSourceApi:M,dataSourceActions:x,getState:E,imperativeApi:z,componentActions:V,getComputed:N,getDataSourceMasterContext:L}=n,F=(0,ke.useSyncExternalStore)((0,ke.useCallback)(ae=>t.subscribeToRowIndex(T,ae),[t,T]),(0,ke.useCallback)(()=>t.getRowInfoAtIndex(T),[t,T]));eI({repaintCellsKey:p,column:g,rowIndex:T,rowInfoStore:t,getDataSourceState:D});let B=!F,X=!g,_=Ce.useRef(null),k=(0,ke.useCallback)(ae=>{_.current=ae,w&&w(ae)},[w]),K=F??{id:"",indexInAll:T,rowSelected:!1,rowDisabled:!1,isCellSelected:()=>!1,hasSelectedCells:()=>!1,isGroupRow:!1,isTreeNode:!1,isParentNode:!1,treeNesting:0,nodePath:[],collapsed:!1,dataSourceHasGrouping:!1,selfLoaded:!0,data:{}},{rowSelected:Q}=K,Ie=N(),{activeRowIndex:se,keyboardNavigation:me,columnReorderInPageIndex:ve}=E(),Pe=T===se&&me==="row",ue={getState:E,getDataSourceState:D,getDataSourceMasterContext:L,actions:V,dataSourceActions:x,api:z,dataSourceApi:M},oe=K.rowDisabled,ce=xf({horizontalLayoutPageIndex:a,rowIndexInHorizontalLayoutPage:i,column:g,rowInfo:K,rowDetailState:f,columnsMap:b,visibleColumnIds:s,fieldsToColumn:R,context:ue}),{stylingParam:pe,renderParams:Z,formattedValueContext:J,renderFunctions:W,groupByColumnReference:ie,inEdit:ne}=ce,{align:le,verticalAlign:O}=Z,A=Z,de=Ce.useRef(A),ye=y&&S?ae=>{let Ze={...J,rowIndex:T};y(Ze,ae),S(ae)}:S,we=C&&h?ae=>{let Ee={...J,rowIndex:T,rowInfo:K};C(Ee,ae),h(ae)}:h,be=(0,ke.useCallback)(ae=>{let Ee=g.computedVisibleIndex;E().cellClick({rowIndex:T,colIndex:Ee,event:ae})},[T,g.computedVisibleIndex,me]),Me=(0,ke.useCallback)(ae=>{let Ee=g.computedVisibleIndex;if(E().cellMouseDown({rowIndex:T,colIndex:Ee,event:ae}),me==="row"){oe||(V.activeRowIndex=T);return}me==="cell"&&(V.activeCellIndex=[T,Ee])},[T,oe,g.computedVisibleIndex,me]),{selectionMode:qe,cellSelection:We,isNodeReadOnly:it}=e,at=A.cellSelected;A.domRef=k,A.htmlElementRef=_,A.toggleCurrentTreeNode=(0,ke.useCallback)(A.toggleCurrentTreeNode,[K]),A.selectCell=(0,ke.useCallback)(A.selectCell,[K]),A.deselectCell=(0,ke.useCallback)(A.deselectCell,[K]),A.selectCurrentRow=(0,ke.useCallback)(A.selectCurrentRow,[K]),A.deselectCurrentRow=(0,ke.useCallback)(A.deselectCurrentRow,[K]),A.toggleCurrentGroupRow=(0,ke.useCallback)(A.toggleCurrentGroupRow,[K]),A.toggleCurrentRowSelection=(0,ke.useCallback)(A.toggleCurrentRowSelection,[K]),A.toggleCurrentGroupRowSelection=(0,ke.useCallback)(A.toggleCurrentGroupRowSelection,[K]),A.toggleCurrentTreeNodeSelection=(0,ke.useCallback)(A.toggleCurrentTreeNodeSelection,[K]);let et=g.components?.Editor??Lf,Xe=ne?Ce.createElement(Vf,{contextValue:A},Ce.createElement(et,null)):null,G=(0,ke.useCallback)(ht(()=>{if(v||ne)return null;if(de.current=A,W.renderGroupIcon&&(A.renderBag.groupIcon=Ce.createElement(vt,{render:W.renderGroupIcon,renderParam:{...A,renderBag:{...A.renderBag}}})),W.renderSelectionCheckBox&&qe=="multi-row"&&(A.renderBag.selectionCheckBox=Ce.createElement(vt,{render:JC,renderParam:A}),W.renderSelectionCheckBox!==!0&&(A.renderBag.selectionCheckBox=Ce.createElement(vt,{render:W.renderSelectionCheckBox,renderParam:{...A,renderBag:{...A.renderBag}}}))),K.isTreeNode){let{isParentNode:Ze}=K,Ct;Ct=(Ze?W.renderTreeIconForParentNode:W.renderTreeIconForLeafNode)||typeof W.renderTreeIcon=="function"?W.renderTreeIcon:Ze&&W.renderTreeIcon===!0?js:void 0,Ct===!0?Ct=js:Ct&&(A.renderBag.treeIcon=Ce.createElement(vt,{render:js,renderParam:A})),Ct&&(A.renderBag.treeIcon=Ce.createElement(vt,{render:Ct,renderParam:{...A,renderBag:{...A.renderBag}}}))}W.renderRowDetailIcon&&(A.renderBag.rowDetailsIcon=Ce.createElement(vt,{render:ZC,renderParam:{...A,renderBag:{...A.renderBag}}}),typeof W.renderRowDetailIcon=="function"&&(A.renderBag.rowDetailsIcon=Ce.createElement(vt,{render:W.renderRowDetailIcon,renderParam:{...A,renderBag:{...A.renderBag}}}))),W.renderValue&&(A.renderBag.value=Ce.createElement(vt,{render:W.renderValue,renderParam:{...A,renderBag:{...A.renderBag}}})),K.isGroupRow&&W.renderGroupValue&&(A.renderBag.value=Ce.createElement(vt,{render:W.renderGroupValue,renderParam:{...A,renderBag:{...A.renderBag}}})),!K.isGroupRow&&W.renderLeafValue&&(A.renderBag.value=Ce.createElement(vt,{render:W.renderLeafValue,renderParam:{...A,renderBag:{...A.renderBag}}})),de.current=A;let ae=A.renderBag.value;ae instanceof Date&&(ae=ae.toLocaleDateString());let Ee=Ce.createElement(Ce.Fragment,null,le!=="end"?A.renderBag.treeIcon:null,le!=="end"?A.renderBag.groupIcon:null,le!=="end"?A.renderBag.rowDetailsIcon:null,le!=="end"?A.renderBag.selectionCheckBox:null,ae,le==="end"?A.renderBag.selectionCheckBox:null,le==="end"?A.renderBag.rowDetailsIcon:null,le==="end"?A.renderBag.groupIcon:null,le==="end"?A.renderBag.treeIcon:null);return g.render?Ce.createElement(vt,{render:g.render,renderParam:{...A,renderBag:{...A.renderBag,all:Ee}}}):Ee}),[g,v,ne,f,g.renderTreeIcon||g.renderTreeIconForParentNode?it:!1,...kf(A,{renderBag:!0,selectCell:!0,deselectCell:!0,selectCurrentRow:!0,deselectCurrentRow:!0,toggleCurrentGroupRow:!0,toggleCurrentRowDetails:!0,toggleCurrentRowSelection:!0,toggleCurrentGroupRowSelection:!0,toggleCurrentTreeNodeSelection:!0,toggleCurrentTreeNode:!0,rowHasSelectedCells:!0})]),{style:ee,className:ge}=Nf({column:g,rowInfo:K,rowIndex:T,rowHeight:I,rowIndexInHorizontalLayoutPage:i,horizontalLayoutPageIndex:a,align:le,verticalAlign:O,stylingParam:pe,formattedValueContext:J,groupByColumnReference:ie,rowStyle:o,rowClassName:r,cellStyle:u,cellClassName:d,showZebraRows:P,rowActive:Pe,rowDisabled:oe,rowSelected:Q,cellSelected:at,cellSelection:We,getData:l,visibleColumnIds:s,computedVisibleColumns:Ie.computedVisibleColumns,computedColumnOrder:c,columnReorderInPageIndex:ve}),Te=(0,ke.useMemo)(()=>ee,[ee?JSON.stringify(ee):null]),ut=Xe,re=G(),j={domRef:k,cellType:"body",column:g,width:m,rowId:K.id,horizontalLayoutPageIndex:a,style:Te,onMouseLeave:we,onMouseEnter:ye,onClick:be,afterChildren:ut,onMouseDown:Me,cssEllipsis:g.cssEllipsis??!0,className:ge,renderChildren:(0,ke.useCallback)(()=>re,[G])},tt=jr.Provider;return X||B?Ce.createElement("div",{ref:k,style:{display:"none"}}):Ce.createElement(tt,{value:de.current},Ce.createElement(ma,{...j}))}var zf=Ce.memo(tI);function Ur(){return(0,ke.useContext)(jr)}function ga(){let{api:n,editingValueRef:e,editingCell:t}=te(f=>({api:f.api,editingCell:f.state.editingCell,editingValueRef:f.state.editingValueRef})),{column:o,rowInfo:r}=Ur(),[i]=Ce.useState(()=>t?.value),[a,l]=Ce.useState(i),s=t?!t.active&&!!t.waiting:!1,c=Ce.useCallback(f=>{e.current=f,l(f)},[]);Ce.useLayoutEffect(()=>{e.current=i},[]);let u=n.confirmEdit,d=n.cancelEdit,p=n.rejectEdit;return{api:n,initialValue:i,value:a,readOnly:s,column:o,rowInfo:r,setValue:c,confirmEdit:u,cancelEdit:d,rejectEdit:p}}function $r(n){return n.render(n.renderParam)??null}function vt(n){let e=jr.Provider;return or.createElement(e,{value:n.renderParam},or.createElement($r,{render:n.render,renderParam:n.renderParam}))}function Vf(n){let e=jr.Provider;return or.createElement(e,{value:n.contextValue},n.children)}function Kn(n){let e=ha.Provider;return or.createElement(e,{value:n.renderParam},or.createElement($r,{render:n.render,renderParam:n.renderParam}))}var Bn=H(require("react"));var Gf="yhvuzb1",Hf="yhvuzb0";var Us=Li({"data-name":""}),$s={[Us["data-name"]]:"menu-icon"},Kf=`[${Us["data-name"]}="${$s["data-name"]}"]`;var nI={width:"100%",pointerEvents:"none"},Ys=$(`${ct}-menu`,Gf);function Yr(n){let{style:e,className:t,domProps:o,reserveSpaceWhenHidden:r,menuVisible:i,children:a}=n,l={...nI,borderTop:`${fe.components.HeaderCell.menuIconLineWidth} solid currentColor`,...n.lineStyle};return Bn.createElement("div",{...o,style:e,...$s,onPointerDown:s=>s.stopPropagation(),className:$(t,Vd({menuVisible:i,reserveSpaceWhenHidden:r}),ct,`${ct}-menu`,a==null?Hf:"")},a??Bn.createElement(Bn.Fragment,null,Bn.createElement("div",{className:Ys,style:l}),Bn.createElement("div",{className:Ys,style:l}),Bn.createElement("div",{className:Ys,style:l})))}var rr=H(require("react")),qr=require("react");var Bf="_1b8djff1 _16lm1iw1",Wf={asc:"_1b8djff2",desc:"_1b8djff3",none:"_1b8djff4"},ya="_1b8djff5",jf="--_1b8djff0";var Uf={transition:"width 0.25s, opacity 0.25s"},EO=Object.keys({direction:1,size:1,lineWidth:1,lineStyle:1,style:1,className:1,index:1,forceSize:1});function Sa(n){let[e,t]=(0,qr.useState)(!0),[o,r]=(0,qr.useState)(0),{direction:i,lineWidth:a=1,style:l,className:s,index:c}=n,u=c!=null&&c>0,d=n.size??16,p=Math.floor(d/4),f=i?[d-3*p,d-2*p,d-p]:[0,0,0];i===-1&&f.reverse();let m={...Uf,borderTop:`${a}px solid currentColor`,...n.lineStyle,opacity:o};(0,qr.useEffect)(()=>{let y=i!=0?1:0;if(!e&&y&&t(!0),y!==o){let C=requestAnimationFrame(()=>{r(y)});return()=>{cancelAnimationFrame(C)}}return()=>{}},[i,e]);let g=()=>{let C=!(o===0&&i===0);C!==e&&t(C)};if(!e&&!n.forceSize)return null;let h=i===1?"asc":i===-1?"desc":"none",S={};return i===-1&&(S.top="100%"),rr.createElement("div",{"data-name":"sort-icon",style:{...l,width:d,[jf]:`${a}px`},className:$(s,ct,Bf,Wf[h],`${ct}-sort`,`${ct}-sort--${h}`)},u?rr.createElement("div",{"data-name":"index",style:S,className:Kd},c):null,rr.createElement("div",{className:ya,style:{width:f[0],...m},onTransitionEnd:g}),rr.createElement("div",{className:ya,style:{width:f[1],...m}}),rr.createElement("div",{className:ya,style:{width:f[2],...m}}))}var Zf=H(require("react")),Xs=require("react");function qs(n){return Math.max(n.width-Xt(),0)}function $f(n){let{context:e,column:t,diff:o,shareSpaceOnResize:r}=n,i=e.getState(),{columnSizing:a,viewportReservedWidth:l,bodySize:s}=i,c=e.getComputed().computedVisibleColumns,u=!1,d=c.reduce((f,m)=>(m.computedFlex&&(f[m.id]={...a[m.id],flex:m.computedWidth},u=!0),f),{}),p=u?{...a,...d}:a;return ys({shareSpaceOnResize:r,availableSize:qs(s),reservedWidth:l||0,dragHandleOffset:o,dragHandlePositionAfter:t.computedVisibleIndex,columnSizing:p,items:c.map(f=>({id:f.id,computedFlex:f.computedFlex,computedWidth:f.computedWidth,computedMinWidth:f.computedMinWidth,computedMaxWidth:f.computedMaxWidth}))})}var Xr=require("react"),Zr=H(require("react"));function Yf(n,{columns:e,shareSpaceOnResize:t,domRef:o}){let r=e[n];return{resize(i){Re.columnWidths.set(n,r.computedWidth+i,o.current);let a=n+1;if(t){let l=e[a];if(!l)return;Re.columnWidths.set(a,l.computedWidth-i,o.current),l.computedPinned==="start"?Ps(l,i,o.current):Re.columnOffsets.set(a,l.computedOffset+i,o.current);return}if(r.computedPinned!=="end"){if(r.computedPinned==="start"){for(let l=a,s=e.length;l<s;l++){let c=e[l];if(c.computedPinned==="start"){Ps(c,i,o.current);continue}c.computedPinned!=="end"&&Re.columnOffsets.set(l,c.computedOffset+i,o.current)}return}for(let l=a,s=e.length;l<s;l++){let c=e[l];c.computedPinned||Re.columnOffsets.set(l,c.computedOffset+i,o.current)}}}}}function qf(n,e){let t=n[n.length-1];return{resize(o){let{columns:r,domRef:i}=e,a=r[n[0]],l=a.computedOffset,s=0,c=i.current;if(o.forEach((u,d)=>{s+=u;let p=n[d],f=r[p],m=f.computedWidth+u;Re.columnWidths.set(p,m,c),f.computedPinned!=="end"&&(l&&Re.columnOffsets.set(p,l,c),l+=m)}),a.computedPinned!=="end")for(let u=t+1;u<r.length;u++){let d=r[u];d.computedPinned!=="end"&&Re.columnOffsets.set(u,d.computedOffset+s,c)}}}}var ba="zneyzh0 _16lm1iw2 _16lm1iw23 _16lm1iw2c _16lm1iw2a _16lm1iwm _16lm1iw35",Ta=he({defaultClassName:"zneyzhc _16lm1iw2 _16lm1iw23 _16lm1iw2a",variantClassNames:{constrained:{false:"zneyzhd",true:"zneyzhe"},computedPinned:{start:"zneyzhf",end:"zneyzhg",false:"zneyzhh"},computedFirstInCategory:{true:"zneyzhi",false:"zneyzhj"},computedLastInCategory:{true:"zneyzhk",false:"zneyzhl"}},defaultVariants:{},compoundVariants:[[{computedPinned:"start",computedLastInCategory:!0,computedFirstInCategory:!1},"zneyzhm"],[{computedPinned:"end",computedFirstInCategory:!0,computedLastInCategory:!1},"zneyzhn"]]}),Ca=he({defaultClassName:"zneyzh1",variantClassNames:{computedPinned:{start:"zneyzh2",end:"zneyzh3 _16lm1iw26 _16lm1iw2e",false:"zneyzh4"},computedFirstInCategory:{true:"zneyzh5",false:"zneyzh6"},computedLastInCategory:{true:"zneyzh7",false:"zneyzh8"}},defaultVariants:{},compoundVariants:[[{computedPinned:"end",computedLastInCategory:!1,computedFirstInCategory:!0},"zneyzh9"],[{computedPinned:!1,computedFirstInCategory:!1,computedLastInCategory:!0},"zneyzha"],[{computedPinned:"start",computedFirstInCategory:!1,computedLastInCategory:!0},"zneyzhb"]]});var{rootClassName:oI}=ze,rI=`${oI}HeaderCell_ResizeHandle`;function iI(n){let{brain:e,headerBrain:t}=te(g=>({brain:g.state.brain,headerBrain:g.state.headerBrain})),o=(0,Xr.useRef)(null),[r,i]=(0,Xr.useState)(!1),a=(0,Xr.useRef)(r);a.current=r;let l=n.columns[n.columnIndex],s=n.horizontalLayoutPageIndex;if(!l)return null;let c=l.computedPinned,u=l.computedFirstInCategory,d=l.computedLastInCategory,p=()=>{},f=g=>{g.stopPropagation();let h=!!g.shiftKey,S=g.pointerId,y=g.clientX,C=g.target;if(e.isHorizontalLayoutBrain){let w=e.extendRenderRange({start:!0,end:!0,direction:"horizontal"}),v=t.extendRenderRange({start:!0,end:!0,direction:"horizontal"});p=()=>{w(),v()}}C.setPointerCapture(S);let T=Yf(n.columnIndex,{columns:n.columns,shareSpaceOnResize:h,domRef:o}),I=(w,{done:v}={})=>{s&&(w=w/(s+1),v&&(w=Math.round(w))),c==="end"&&(w*=-1);let{adjustedDiff:P,constrained:D}=n.computeResize({diff:w,shareSpaceOnResize:h});return a.current!==D&&i(D),T.resize(P),P},b=w=>{I(Math.round(w.clientX-y))},R=w=>{C.releasePointerCapture(S),C.removeEventListener("pointermove",b),C.removeEventListener("pointerup",R);let v=Math.round(w.clientX-y),P=I(v,{done:!0});p(),T.resize(0),n.onResize({diff:P,shareSpaceOnResize:h})};C.addEventListener("pointermove",b),C.addEventListener("pointerup",R)},m=(c===!1||c==="start")&&d?{right:c==="start"?void 0:0}:c==="end"&&u?{right:void 0}:void 0;return Zr.createElement("div",{ref:o,className:`${rI} ${ba} ${Ca({computedPinned:c,computedFirstInCategory:u,computedLastInCategory:d})}`,onPointerDown:f},Zr.createElement("div",{style:m,className:Ta({constrained:r,computedPinned:c,computedFirstInCategory:u,computedLastInCategory:d})}))}var Xf=Zr.memo(iI);function Qf(n,e){let{computedVisibleColumns:t,getState:o,getComputed:r,actions:i}=te(c=>({computedVisibleColumns:c.computed.computedVisibleColumns,getState:c.getState,getComputed:c.getComputed,actions:c.actions})),a=(0,Xs.useCallback)(({diff:c,shareSpaceOnResize:u})=>$f({context:{getState:o,getComputed:r},column:n,diff:c,shareSpaceOnResize:u}),[n,o,r]),l=(0,Xs.useCallback)(({diff:c,shareSpaceOnResize:u})=>{let{columnSizing:d,reservedWidth:p}=a({diff:c,shareSpaceOnResize:u});u||(i.viewportReservedWidth=p),i.columnSizing=d},[a,i]);return n.computedResizable?Zf.createElement(Xf,{horizontalLayoutPageIndex:e.horizontalLayoutPageIndex,columns:t,columnIndex:n.computedVisibleIndex,computeResize:a,onResize:l}):null}var $e=H(require("react")),Bt=require("react");var Jf=he({defaultClassName:"_16lm1iw3a _16lm1iw1",variantClassNames:{dragging:{true:"_16lm1iwn _16lm1iw1x"}},defaultVariants:{},compoundVariants:[]}),em=he({defaultClassName:"_16lm1iw3a _16lm1iw1 _16lm1iwo",variantClassNames:{active:{true:"_3dmbka5 _16lm1iw1k _3dmbka2"},draggingInProgress:{true:"_16lm1iw1x"}},defaultVariants:{},compoundVariants:[[{active:!1,draggingInProgress:!0},"_3dmbka3"]]});function tm(n,e){return Rt(n,e)}var ir=class extends ao{constructor(t){super();this.dragIndex=-1;this.breakpoints=[];this.activeDragSourcePosition="outside";this.previousAcceptsDropResult=!0;this.setData(t)}get listId(){return this.data.listId}setData(t){return tm(this.data,t)?!1:(this.data=t,!0)}getData(){return this.data}isEqual(t){return tm(this.data,t.getData())}acceptsSelfDrops(){return!this.data.acceptDropsFrom||this.data.acceptDropsFrom.includes(this.data.listId)}acceptsDrop(t){let o=!0;return typeof this.data.shouldAcceptDrop=="function"&&(o=this.data.shouldAcceptDrop(t)),o=!!o,o!==this.previousAcceptsDropResult&&(this.previousAcceptsDropResult=o,o?this.emit("accept-feedback",t):this.emit("reject-feedback",t)),o}adjustForScroll(t){this.breakpoints=this.breakpoints.map(o=>o-t),this.data.orientation==="vertical"?this.data.listRectangle.shift({top:-t,left:0}):this.data.listRectangle.shift({top:0,left:-t})}move(t){this.emit("move",t)}unregister(){this.emit("unregister",this)}start(t){let o=t.dragSourceListId===this.data.listId,{draggableItems:r}=this.data,i=r.length;this.breakpoints=r.map((a,l)=>o||l===i-1?this.data.orientation==="horizontal"?a.rect.left+a.rect.width/2:a.rect.top+a.rect.height/2:this.data.orientation==="horizontal"?a.rect.right:a.rect.bottom),this.activeDragSourcePosition=o?"inside":"outside",this.emit("start",t)}drop(t){let{dropIndex:o,dragIndex:r,items:i,dragSourceListId:a,dropTargetListId:l,dragItem:s,outside:c}=t,u=Array.from({length:i.length},(f,m)=>m),d=[];o===-1?d=u.filter(f=>f!==r):d=io(u,r,o>r?o-1:o);let p={dragIndex:r,dropIndex:o,dragItem:s,items:i,dragSourceListId:a,dropTargetListId:l,sortedIndexes:d,outside:c,status:t.status};this.emit("drop",p)}};var aI={startFromPercentage:.25,maxScrollAtPercentage:.05,maxPixelScroll:28,ease:n=>n**2,durationDampening:{stopDampeningAt:1200,accelerateAt:360}};function lI(n,e){let t=getComputedStyle(n),o=e==="vertical"?t.overflowY:t.overflowX;return o!=="auto"&&o!=="scroll"?!1:e==="vertical"?n.scrollHeight>n.clientHeight:n.scrollWidth>n.clientWidth}function sI(n,e){let t=n;for(;t&&!(t===document.documentElement||t===document.body);){if(lI(t,e))return t;t=t.parentElement}return null}function cI(n,e){return{startScrollingFrom:n*e.startFromPercentage,maxScrollValueAt:n*e.maxScrollAtPercentage}}var Zs=1;function nm(n,e,t){if(n>e.startScrollingFrom)return 0;if(n<=e.maxScrollValueAt)return t.maxPixelScroll;if(n===e.startScrollingFrom)return Zs;let r=1-(n-e.maxScrollValueAt)/(e.startScrollingFrom-e.maxScrollValueAt);return Math.ceil(t.maxPixelScroll*t.ease(r))}function uI(n,e,t){let{accelerateAt:o,stopDampeningAt:r}=t.durationDampening,i=Date.now()-e;if(i>=r)return n;if(i<o)return Zs;let a=(i-o)/(r-o);return Math.max(Zs,Math.ceil(n*t.ease(a)))}function om(n,e,t,o,r,i,a){if(n<e||n>t)return 0;let l=cI(o,r),s=n-e,c=t-n,u=c<s,d;return u?d=nm(c,l,r):d=-nm(s,l,r),d===0?0:a?(d>0?1:-1)*uI(Math.abs(d),i,r):d}var mo=class{constructor(e){this.scrollContainer=null;this.rafId=null;this.lastPointer={left:0,top:0};this.dragStartTime=0;this.shouldUseDampening=!1;this.active=!1;this.maxScrollTop=0;this.maxScrollLeft=0;this.orientation=e.orientation,this.onScroll=e.onScroll,this.config={...aI,...e.config}}start(e){this.scrollContainer=sI(e,this.orientation),this.scrollContainer&&(this.maxScrollTop=this.scrollContainer.scrollHeight-this.scrollContainer.clientHeight,this.maxScrollLeft=this.scrollContainer.scrollWidth-this.scrollContainer.clientWidth),this.dragStartTime=Date.now(),this.shouldUseDampening=!0,this.active=!0}getScrollContainer(){return this.scrollContainer}updatePointer(e){this.lastPointer=e,!this.rafId&&this.active&&this.scheduleScroll()}scheduleScroll(){this.rafId=requestAnimationFrame(()=>{if(this.rafId=null,!this.active||!this.scrollContainer)return;let e=this.computeScroll();if(e.top===0&&e.left===0)return;let t={top:this.scrollContainer.scrollTop,left:this.scrollContainer.scrollLeft},o=Math.max(0,Math.min(this.maxScrollTop,t.top+e.top)),r=Math.max(0,Math.min(this.maxScrollLeft,t.left+e.left));this.scrollContainer.scrollTop=o,this.scrollContainer.scrollLeft=r;let i={top:this.scrollContainer.scrollTop-t.top,left:this.scrollContainer.scrollLeft-t.left},a=i.top!==0||i.left!==0;a&&this.onScroll(i),this.active&&a&&this.scheduleScroll()})}computeScroll(){if(!this.scrollContainer)return{top:0,left:0};let e=this.scrollContainer.getBoundingClientRect();if(this.orientation==="vertical"){if(this.lastPointer.left<e.left||this.lastPointer.left>e.right)return{top:0,left:0}}else if(this.lastPointer.top<e.top||this.lastPointer.top>e.bottom)return{top:0,left:0};let t=0,o=0;return this.orientation==="vertical"?t=om(this.lastPointer.top,e.top,e.bottom,e.height,this.config,this.dragStartTime,this.shouldUseDampening):o=om(this.lastPointer.left,e.left,e.right,e.width,this.config,this.dragStartTime,this.shouldUseDampening),{top:t,left:o}}stop(){this.active=!1,this.rafId!=null&&(cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollContainer=null}};var Qs="data-drag-list-id",bt="data-drag-item-id",ar="data-drag-item-list-id",rm=`[${bt}]`,im=()=>null,am=n=>{let{node:e,offset:t}=n;if(!t){e.style.transform="none";return}e.style.transform=`translate3d(${t.left}px, ${t.top}px, 0px)`},dI=n=>`${n.getAttribute(bt)}`;function Js(n,e){let t=n.current?.querySelectorAll(rm)??[];return Array.from(t).filter(r=>r.getAttribute(ar)===`${e}`)}function pI(n,e){let t=Js(n,e);return Array.from(t).map(r=>{let i=dI(r),a=r.getBoundingClientRect();return{id:i,rect:a}})}function fI(n){let{domRef:e,orientation:t,dragListId:o}=n,r=pI(e,o),i=e.current.getBoundingClientRect(),a=i.top,l=i.left,s=i.bottom,c=i.right;for(let p of r){let f=p.rect;f.top<a&&(a=f.top),f.left<l&&(l=f.left),f.bottom>s&&(s=f.bottom),f.right>c&&(c=f.right)}let u=_e.from({top:a,left:l,width:c-l,height:s-a});return{draggableItems:r,orientation:t,listId:o,listRectangle:u,acceptDropsFrom:n.acceptDropsFrom,shouldAcceptDrop:n.shouldAcceptDrop,initial:n.initial,preserveDragSpace:n.preserveDragSpace}}function lm(n){return new ir(fI(n))}function sm(n,e){let t=document.querySelector(`[${Qs}="${e}"]`);t?n.current=t:console.warn(`DragList with id "${e}" not found. You're probably not spreading the domProps to the parent element. Make sure you also include the "className" prop.`)}function cm(n,e){let t=n.current;t&&t!==e&&pt.unregisterDragInteractionTarget(t),n.current=e,e&&pt.registerDragInteractionTarget(e)}function um(n){let{getProps:e,domRef:t,setInteractionTarget:o}=n;return pt.on("register",r=>{let{dragListId:i,acceptDropsFrom:a,orientation:l,shouldAcceptDrop:s}=e(),c=r.getData();if(c.initial&&c.listId!==i&&a?.includes(c.listId)){let u=lm({domRef:t,orientation:l,dragListId:i,initial:!1,acceptDropsFrom:a,shouldAcceptDrop:s});r.once("unregister",()=>{o(null)}),o(u)}})}function Ia(n,e){let t=n.cloneNode(!0);return t.removeAttribute(bt),t.style.position="fixed",t.style.top=`${e.top}px`,t.style.left=`${e.left}px`,t.style.width=`${e.width}px`,t.style.height=`${e.height}px`,t.style.zIndex="999999",t.style.pointerEvents="none",t.style.margin="0",t.style.boxSizing="border-box",t.style.transform="none",document.body.appendChild(t),t}function Ra({proxyElement:n,dx:e,dy:t}){n.style.transform=`translate3d(${e}px, ${t}px, 0)`}function dm(n){let e=n.current;e&&(e.cleanup?e.cleanup({proxyElement:e.proxyElement}):e.proxyElement.remove(),e.originalNode.style.visibility="",n.current=null)}function pm(n,e,t){let o=n.current;return(!o||o.length===0)&&(o=Js(e,t),n.current=o),o}function fm(n,e){let{dragListId:t,orientation:o,domRef:r,proxyStateRef:i,sourceScrollOffsetRef:a,dragItemsRef:l,getDragItems:s,getOnDrop:c,getOnAcceptDrop:u,getOnRemove:d,getUpdatePosition:p,updateDragOperationSourceAndTarget:f,updateDragProxyRenderState:m}=e,g=n.on("start",({dragItem:b,dragSourceListId:R,dropTargetListId:w})=>{f({dragSourceListId:R,dropTargetListId:w,dragItemId:b.id,status:"accepted"})}),h=n.on("move",({offsetsForItems:b,items:R,status:w,dragItem:v})=>{if(w==="rejected")return;let P=s(),D=p(),M=i.current;R.forEach((x,E)=>{let z=b[E],V=P[E];if(V&&!(M&&x.id===M.dragItemId)){if(!M&&x.id===v.id){let N=a.current;z={left:z.left+N.left,top:z.top+N.top}}D({id:x.id,node:V,offset:z})}})}),S=n.on("drop",b=>{let{sortedIndexes:R,dragIndex:w,dropIndex:v,dragItem:P,items:D,dragSourceListId:M,dropTargetListId:x,outside:E,status:z}=b,V=s();l.current=[];let N=u(),L=d(),F=c(),B=p();D.forEach((k,K)=>{let Q=V[K];Q&&B({id:k.id,node:Q,offset:null})}),dm(i),m(k=>k&&(requestAnimationFrame(()=>m(im)),{...k,dragItemId:null})),t===x&&M!==t&&N&&z==="accepted"&&N({dragItemId:P.id,dragSourceListId:M,dropTargetListId:x,dragIndex:w,dropIndex:v,dropItemId:D[v]?.id});let _=null;v===-1&&M===t&&x===t&&E&&(_=L),v!==-1&&x===t&&M===t&&(_=F),_&&_?.(R,{dragIndex:w,dropIndex:v,dragItemId:D[w].id,dropItemId:D[v]?.id})}),y=null,C=null,T=null,I=null;if(!n.getData().initial&&r.current){if(y=new mo({orientation:o,onScroll:()=>{}}),y.start(r.current),C=y.getScrollContainer(),C){let b=o==="vertical"?C.scrollTop:C.scrollLeft;T=()=>{let R=o==="vertical"?C.scrollTop:C.scrollLeft,w=R-b;b=R,w!==0&&(n.adjustForScroll(w),pt.retriggerMove())},C.addEventListener("scroll",T)}I=b=>{y.updatePointer({left:b.clientX,top:b.clientY})},Fe().addEventListener("pointermove",I)}return()=>{g(),h(),S(),y&&y.stop(),C&&T&&C.removeEventListener("scroll",T),I&&Fe().removeEventListener("pointermove",I)}}function mm(n,e,t){let{dragListId:o,orientation:r,acceptDropsFrom:i,preserveDragSpace:a,onDragProxySetup:l}=e,{domRef:s,proxyStateRef:c,sourceScrollOffsetRef:u,dragItemsRef:d,setInteractionTarget:p,updateDragProxyRenderState:f}=t,m=e.dragStrategy??"proxy",g=m==="proxy"&&!e.renderDragProxy,h=m==="proxy"&&!!e.renderDragProxy,S=e.onDragProxyMove??Ra,y=n.currentTarget,C=y.getAttribute(bt);if(C==null){let K=Ln(y,rm);K&&(C=K.getAttribute(bt))}if(C==null){console.warn("Could not find drag item id for element",y,`Make sure you have a parent element with a ${bt} attribute`);return}C=`${C}`;let T=null,I=Js(s,o);d.current=I;let b=lm({domRef:s,orientation:r,dragListId:o,acceptDropsFrom:i,initial:!0,preserveDragSpace:a}),R=b.getData().draggableItems,w=R.findIndex(K=>K.id===C);if(w===-1)return;let v=R[w],P=I[w]?.getAttribute(bt)===`${C}`?I[w]:I.find(K=>K.getAttribute(bt)===`${C}`);p(b);let D={left:n.clientX,top:n.clientY},M={left:n.clientX,top:n.clientY};u.current={top:0,left:0};let x=new mo({orientation:r,onScroll:()=>{}});s.current&&x.start(s.current);let E=x.getScrollContainer(),z=E?r==="vertical"?E.scrollTop:E.scrollLeft:0;function V(){T&&T.move({left:M.left,top:M.top})}let N=()=>{if(!E)return;let K=r==="vertical"?E.scrollTop:E.scrollLeft,Q=K-z;z=K,Q!==0&&(b.adjustForScroll(Q),r==="vertical"?u.current.top+=Q:u.current.left+=Q),V()};E?.addEventListener("scroll",N);let L=K=>{if(M={left:K.clientX,top:K.clientY},!T){if(T=pt.startDrag({listId:o,dragItem:v,dragIndex:w},D),P&&g){let se=P.getBoundingClientRect(),me=null,ve={dragItemNode:P,dragItemId:`${C}`,initialRect:se,initialCoords:D,get proxyElement(){return me||(me=Ia(P,se)),me}},Pe=l?.(ve),ue=Pe?.proxyElement??ve.proxyElement;P.style.visibility="hidden",c.current={proxyElement:ue,originalNode:P,dragItemId:`${C}`,initialRect:se,cleanup:Pe?.cleanup}}if(P&&h){let se=P.getBoundingClientRect();P.style.visibility="hidden",c.current={proxyElement:P,originalNode:P,dragItemId:`${C}`,initialRect:se,cleanup:()=>{}};let me={dragItemId:`${C}`,initialRect:se,dx:0,dy:0};f(()=>me)}}let Q=K.clientX-D.left,Ie=K.clientY-D.top;if(h)f(se=>se&&{...se,dx:Q,dy:Ie});else{let se=c.current;se&&S({proxyElement:se.proxyElement,dx:Q,dy:Ie})}x.updatePointer({left:K.clientX,top:K.clientY}),V()},F=K=>{K.preventDefault()},B=K=>{if(x.stop(),E?.removeEventListener("scroll",N),k.removeEventListener("pointermove",L),k.removeEventListener("pointerup",X),k.removeEventListener("pointercancel",_),k.removeEventListener("dragstart",F,!0),h&&(f(Q=>Q&&{...Q,dragItemId:null}),requestAnimationFrame(()=>{f(im)})),!T){dm(c),p(null);return}K?T.cancel():T.drop(),T=null},X=()=>B(!1),_=()=>B(!0),k=Fe();k.addEventListener("pointermove",L),k.addEventListener("pointerup",X),k.addEventListener("pointercancel",_),k.addEventListener("dragstart",F,!0)}var gm=$e.createContext({dragItemId:null,onDragItemPointerDown:()=>{},draggingInProgress:!1,dragListId:"",status:"accepted",dragSourceListId:null,dropTargetListId:null}),go=()=>$e.useContext(gm);function mI(n,e){let t=Le(e),[o,r]=$e.useState(null),i=$e.useRef(null),a=(0,Bt.useCallback)(s=>{cm(i,s),r(s)},[]),l=Le(o);return(0,Bt.useEffect)(()=>()=>{pt.unregisterDragInteractionTarget(i.current),i.current=null},[]),(0,Bt.useEffect)(()=>um({getProps:t,domRef:n,setInteractionTarget:a}),[t]),{interactionTarget:o,setInteractionTarget:a,getInteractionTarget:l}}var Wn=n=>{let e=$e.useRef(null),t=$e.useRef(null),[o,r]=(0,Bt.useState)(null),i=$e.useRef({top:0,left:0}),a=$e.useRef(null),l=$e.useCallback(P=>{a.current=P},[]),{dropTargetListId:s,dragSourceListId:c}=fn(),{updateDragOperationSourceAndTarget:u,dragItemId:d,status:p}=fn(),f=Le(n.onDrop),m=Le(n.onAcceptDrop),g=Le(n.onRemove),h=Le(n.updatePosition??am),{interactionTarget:S,setInteractionTarget:y}=mI(e,n);(0,Bt.useEffect)(()=>{sm(e,n.dragListId)},[n.dragListId]),(0,Bt.useEffect)(()=>{if(S)return fm(S,{dragListId:n.dragListId,orientation:n.orientation,domRef:e,proxyStateRef:t,sourceScrollOffsetRef:i,dragItemsRef:C,getDragItems:T,getOnDrop:f,getOnAcceptDrop:m,getOnRemove:g,getUpdatePosition:h,updateDragOperationSourceAndTarget:u,updateDragProxyRenderState:r})},[S,n.dragListId]);let C=$e.useRef([]),T=(0,Bt.useCallback)(()=>pm(C,e,n.dragListId),[n.dragListId]),I=(0,Bt.useCallback)(P=>{mm(P,n,{domRef:e,proxyStateRef:t,sourceScrollOffsetRef:i,dragItemsRef:C,setInteractionTarget:y,updateDragProxyRenderState:r})},[n.orientation,n.dragListId,n.acceptDropsFrom,n.removeOnDropOutside,n.dragStrategy,n.renderDragProxy,n.onDragProxySetup,n.onDragProxyMove]),b=!!d,R=$e.useMemo(()=>({dragItemId:d,onDragItemPointerDown:I,dragSourceListId:c,dropTargetListId:s,status:p,dragListId:n.dragListId,draggingInProgress:b}),[d,I,b,c,s,n.dragListId]),w={className:$("DragList",b?"DragList--dragging":"",Jf({dragging:b})),[Qs]:n.dragListId},v=typeof n.children=="function"?n.children(w,R):n.children;return $e.createElement(gm.Provider,{value:R},v,o&&n.renderDragProxy?n.renderDragProxy({...o,ref:l}):null)},gI=$e.createContext({dragItemId:"",dragListId:"",active:!1,draggingInProgress:!1,dragSourceListId:"",dropTargetListId:""}),hI=n=>{let{onDragItemPointerDown:e,draggingInProgress:t,dragListId:o,dragItemId:r,dragSourceListId:i,dropTargetListId:a}=go(),l=n.dragListId??o,s=i===l&&r===`${n.id}`,c=$e.useMemo(()=>({dragItemId:n.id,active:s,dragListId:l,draggingInProgress:t,dragSourceListId:i,dropTargetListId:a}),[n.id,s,l,t,i,a]),u={[bt]:`${n.id}`,[ar]:l,onPointerDown:e,className:$("DraggableItem",s?"DraggableItem--active":"",em({active:s,draggingInProgress:t}))},d=typeof n.children=="function"?n.children(u,c):n.children;return $e.createElement(gI.Provider,{value:c},d)};Wn.DraggableItem=hI;var ec=H(require("react"));var hm=n=>ec.createElement(Ve,{...n,icon:"hidden",viewBox:"0 -960 960 960"},ec.createElement("path",{d:Ge.hidden[0]}));var ii=H(require("react"));function ym(){return{}}var Sm=n=>({allowColumnHideWhileDragging:e=>e??!0});var bm=require("react"),yI=(0,bm.createContext)(null);function tc(){return yI}var Wt=H(require("react"));var Co=H(require("react")),Pt=require("react");var wa=H(require("react"));function SI(n){let{height:e,width:t,count:o}=n;return wa.createElement("div",{"data-count":o,"data-placeholder-width":void 0,"data-placeholder-height":void 0,"data-name":"SpacePlaceholder",style:{height:e,width:t,zIndex:-1,opacity:0,pointerEvents:"none",contain:"strict"}})}var Tm=wa.memo(SI);var Cm="mlx2t3";var va=H(require("react")),Mm=require("react");var Im=require("react"),Rm=(n,e)=>{(0,Im.useEffect)(()=>{let t=n?.current,o=i=>{let a=i.target;e?.({scrollTop:a.scrollTop,scrollLeft:a.scrollLeft})},r={passive:!1};return t?.addEventListener("scroll",o,r),()=>{t?.removeEventListener("scroll",o)}},[e,n?.current])};var wm={true:"_1ueijco2",false:"_1ueijco3",visible:"_1ueijco4",auto:"_1ueijco5",hidden:"_1ueijco6"},vm={true:"_1ueijco7",false:"_1ueijco8",visible:"_1ueijco9",auto:"_1ueijcoa",hidden:"_1ueijcob"},Pm={true:"_1ueijcoc",false:"_1ueijcod",visible:"_1ueijcoe",auto:"_1ueijcof",hidden:"_1ueijcog"},nc="_1ueijco1",xm="_1ueijco0 _16lm1iw0";var Dm=n=>{let e="";return typeof n=="boolean"||typeof n=="string"?e=wm[`${n}`]:e=$(vm[`${n.horizontal}`],Pm[`${n.vertical}`]),e};var bI="InfiniteVirtualScrollContainer";var Em=va.forwardRef(function(e,t){let{children:o,scrollable:r=!0,onContainerScroll:i,className:a,tabIndex:l,style:s,autoFocus:c}=e,u=t??(0,Mm.useRef)(null);return Rm(u,i),va.createElement("div",{ref:u,style:s,autoFocus:c,tabIndex:l,className:$(a,bI,xm,Dm(r))},o)});var La=H(require("react")),So=require("react");var Am=H(require("react")),lr=require("react");function TI(n){let[e,t]=(0,lr.useState)(n.updater.get),o=(0,lr.useRef)(null);return(0,lr.useLayoutEffect)(()=>{function r(a){n.useraf?(o.current!=null&&cancelAnimationFrame(o.current),o.current=requestAnimationFrame(()=>{t(a)})):t(a)}let i=n.updater.onChange(r);return()=>{o.current!=null&&cancelAnimationFrame(o.current),i()}},[n.updater,n.useraf]),e??null}var jn=Am.memo(TI);var _m=H(ro());var oc=(n,e)=>n-e,hn={horizontal:!0,vertical:!0};function Pa(n,e){let t=e.length;if(!t)return 0;let o=-1;for(let r=0;r<t;r++){let i=0,a=0;if(t-r<=o)break;for(let l=r;l<t;l++)if(i+=e[l],a++,i>n){a>o&&(o=a);break}}return o<0?t:Math.min(o,t)}var rc="DebugID=";function Un(n,e){return e&&e.startsWith(rc)?e:e?`${rc}${n}:${e}`:`${rc}${n}`}var xa={start:0,end:0},ic=n=>{n()},ac=n=>{let{start:e,end:t}=n,[o,r]=e,[i,a]=t,l=i-o,s=a-r;return l*s},Om=n=>{let{start:e,end:t}=n,[o]=e,[r]=t;return r-o},Qr=typeof window<"u"?requestAnimationFrame:n=>setTimeout(n,0);function CI(n){return n.horizontalChange||n.verticalChange}var ho=class extends It{constructor(t){let o=Un(t,`${t}:MatrixBrain`);super(o);this.scrolling=!1;this.RENDER_COUNT_SAFETY_MARGIN_START=1;this.RENDER_COUNT_SAFETY_MARGIN_END=1;this.availableWidth=0;this.availableRenderWidth=0;this.isHorizontalLayoutBrain=!1;this.name="";this.availableHeight=0;this.availableRenderHeight=0;this.cols=0;this.rows=0;this.alwaysRenderedColumns=new Set;this._rowsPerPage=0;this.rowHeight=0;this.colWidth=0;this.verticalTotalSize=0;this.horizontalTotalSize=0;this.horizontalRenderCount=void 0;this.verticalRenderCount=void 0;this.maxHorizontalRenderCount=0;this.maxVerticalRenderCount=0;this.horizontalExtendRangeBy=xa;this.verticalExtendRangeBy=xa;this.horizontalRenderRange={startIndex:0,endIndex:0};this.verticalRenderRange={startIndex:0,endIndex:0};this.extraSpanCells=[];this.scrollPosition={scrollLeft:0,scrollTop:0};this.largeContent={vertical:!1,horizontal:!1};this.scrollRatio={vertical:1,horizontal:1};this.scrollOrigin={scrollLeft:0,scrollTop:0};this.onScrollOriginChangeFns=new Set;this.onScrollFns=[];this.onRenderRangeChangeFns=new Set;this.onVerticalRenderRangeChangeFns=new Set;this.onHorizontalRenderRangeChangeFns=new Set;this.onDestroyFns=[];this.destroyed=!1;this.onRenderCountChangeFns=new Set;this.onAvailableSizeChangeFns=new Set;this.onScrollStartFns=[];this.onScrollStopFns=[];this.scrollTimeoutId=0;this.scrollStopDelay=250;this.fixedColsStart=0;this.fixedColsEnd=0;this.fixedRowsStart=0;this.fixedRowsEnd=0;this.setScrollStopDelay=t=>{this.scrollStopDelay=t};this.getRowCount=()=>this.rows;this.getColCount=()=>this.cols;this.onScrollOriginChange=t=>this.onScrollOriginChangeForBrain(t);this.setScrolling=t=>{let o=this.scrolling;this.scrolling=t,t&&(this.scrollTimeoutId&&clearTimeout(this.scrollTimeoutId),this.scrollTimeoutId=setTimeout(()=>{this.setScrolling(!1),this.scrollTimeoutId=0},this.scrollStopDelay)),t!==o&&(t?this.notifyScrollStart():this.notifyScrollStop())};this.notifyScrollStart=()=>{if(this.destroyed)return;let t=this.onScrollStartFns;for(let o=0,r=t.length;o<r;o++)t[o]()};this.notifyScrollStop=()=>{if(this.destroyed)return;let t=this.onScrollStopFns,o=this.scrollPosition,r=this.getRenderRange();for(let i=0,a=t.length;i<a;i++)t[i](o,r)};this.notifyAvailableSizeChange=()=>{if(this.destroyed)return;let t=this.onAvailableSizeChangeFns,o=this.getAvailableSize();t.forEach(r=>{Qr(()=>{this.destroyed||t.has(r)&&r(o)})})};this.notifyVerticalRenderRangeChange=(t=!1)=>{if(this.destroyed)return;let o=this.onVerticalRenderRangeChangeFns,r=this.verticalRenderRange,i=t?ic:Qr;o.forEach(a=>{i(()=>{this.destroyed||o.has(a)&&a([r.startIndex,r.endIndex])})})};this.notifyHorizontalRenderRangeChange=(t=!1)=>{if(this.destroyed)return;let o=this.onHorizontalRenderRangeChangeFns,r=this.horizontalRenderRange,i=t?ic:Qr;o.forEach(a=>{i(()=>{this.destroyed||o.has(a)&&a([r.startIndex,r.endIndex])})})};this.isColFixedEnd=t=>this.fixedColsEnd?t>=this.cols-this.fixedColsEnd:!1;this.isColFixedStart=t=>this.fixedColsStart?t<this.fixedColsStart:!1;this.isRowFixedEnd=t=>this.fixedRowsEnd?t>=this.rows-this.fixedRowsEnd:!1;this.isRowFixedStart=t=>this.fixedRowsStart?t<this.fixedRowsStart:!1;this.isColFixed=t=>this.isColFixedStart(t)||this.isColFixedEnd(t);this.isRowFixed=t=>this.isRowFixedStart(t)||this.isRowFixedEnd(t);this.getFixedEndColsWidth=()=>{if(!this.fixedColsEnd)return 0;let t=0;for(let o=this.cols-this.fixedColsEnd;o<this.cols;o++)t+=this.getColWidth(o);return t};this.getFixedEndColsOffsets=({skipScroll:t}={skipScroll:!1})=>{if(!this.fixedColsEnd)return[];let{scrollLeft:o}=this.scrollPosition,{width:r}=this.getAvailableSize(),i=[],a=[],l=0;for(let u=this.cols-this.fixedColsEnd;u<this.cols;u++){let d=this.getColWidth(u);a.push(d),l+=d}let s=r-l+(t?0:o);l=0;let c=0;for(let u=this.cols-this.fixedColsEnd;u<this.cols;u++){let d=s+l;i[u]=d,l+=a[c],c++}return i};this.getFixedEndRowsOffsets=({skipScroll:t}={skipScroll:!1})=>{if(!this.fixedRowsEnd)return[];let{scrollTop:o}=this.scrollPosition,{height:r}=this.getAvailableSize(),i=[],a=[],l=0;for(let u=this.rows-this.fixedRowsEnd;u<this.rows;u++){let d=this.getRowHeight(u);a.push(d),l+=d}let s=r-l+(t?0:o);l=0;let c=0;for(let u=this.rows-this.fixedRowsEnd;u<this.rows;u++){let d=s+l;i[u]=d,l+=a[c],c++}return i};this.getFixedStartColsWidth=()=>{if(!this.fixedColsStart)return 0;let t=0;for(let o=0;o<this.fixedColsStart;o++)t+=this.getColWidth(o);return t};this.getFixedEndRowsHeight=()=>{if(!this.fixedRowsEnd)return 0;let t=0;for(let o=this.rows-this.fixedRowsEnd;o<this.rows;o++)t+=this.getRowHeight(o);return t};this.getFixedStartRowsHeight=()=>{if(!this.fixedRowsStart)return 0;let t=0;for(let o=0;o<this.fixedRowsStart;o++)t+=this.getRowHeight(o);return t};this.computeRenderCount=(t=hn)=>{let o=t.horizontal,r=t.vertical,i=this.horizontalRenderCount||0,a=this.verticalRenderCount||0;return o&&(i=this.computeDirectionalRenderCount("horizontal",this.colWidth,this.cols,this.getAvailableRenderSize())),r&&(a=this.computeDirectionalRenderCount("vertical",this.rowHeight,this.rows,this.getAvailableRenderSize())),{horizontal:i,vertical:a}};this.setRenderCount=({horizontal:t,vertical:o})=>{t===void 0&&(t=this.horizontalRenderCount),o===void 0&&(o=this.verticalRenderCount);let r=t===this.horizontalRenderCount,i=o===this.verticalRenderCount;r&&i||(this.horizontalRenderCount=t,this.verticalRenderCount=o,this.updateRenderRange({horizontal:!r,vertical:!i}),this.notifyRenderCountChange())};this.updateFixedCells=t=>{t.fixedColsStart!=this.fixedColsStart&&(this.fixedColsStart=t.fixedColsStart||0),t.fixedColsEnd!=this.fixedColsEnd&&(this.fixedColsEnd=t.fixedColsEnd||0),t.fixedRowsStart!=this.fixedRowsStart&&(this.fixedRowsStart=t.fixedRowsStart||0),t.fixedRowsEnd!=this.fixedRowsEnd&&(this.fixedRowsEnd=t.fixedRowsEnd||0)};this.getFixedCellInfo=()=>{let{fixedRowsStart:t,fixedColsStart:o,fixedRowsEnd:r,fixedColsEnd:i}=this;return{fixedRowsStart:t,fixedColsStart:o,fixedRowsEnd:r,fixedColsEnd:i}};this.updateRenderRange=(t=hn)=>{this.setRenderRange(this.computeRenderRange(t))};this.getExtraSpanCellsForRange=({horizontal:t,vertical:o})=>{let{colspan:r,rowspan:i}=this,a=[];if(i){let l=o.startIndex,s=t.startIndex,c=t.endIndex;for(let u=s;u<c;u++){this.computeItemSpanUpTo(l,u,"vertical");let d=this.rowspanParent.get(u);if(d[l]!=l){let p=l;for(;d[p]!=p;)p--;a.push([p,u])}}}if(r){let l=t.startIndex,s=o.startIndex,c=o.endIndex;for(let u=s;u<c;u++){this.computeItemSpanUpTo(u,l,"horizontal");let d=this.colspanParent.get(u);if(d[l]!=l){let p=l;for(;d[p]!=p;)p--;a.push([u,p])}}}return a};this.computeRenderRange=(t=hn)=>{let o=t.horizontal?this.computeDirectionalRenderRange("horizontal"):this.horizontalRenderRange,r=t.vertical?this.computeDirectionalRenderRange("vertical"):this.verticalRenderRange;return{horizontal:o,vertical:r,extraCells:this.getExtraSpanCellsForRange({horizontal:o,vertical:r})}};this.computeDirectionalRenderRange=t=>{let o=t==="horizontal"?this.colWidth:this.rowHeight,r=t==="horizontal"?this.horizontalRenderCount:this.verticalRenderCount,i=t==="horizontal"?this.cols:this.rows;if(!r)return{startIndex:0,endIndex:0};let a=(t==="horizontal"?this.fixedColsStart:this.fixedRowsStart)||0,l=t==="horizontal"?this.scrollPosition.scrollLeft:this.scrollPosition.scrollTop;l+=this.getFixedStartSize(t);let s=typeof o!="function",c=t==="horizontal"?this.horizontalExtendRangeBy:this.verticalExtendRangeBy,u=this.getItemAt(l,t),d=c.start||0,p=c.end||0;s||(d+=this.RENDER_COUNT_SAFETY_MARGIN_START,p+=this.RENDER_COUNT_SAFETY_MARGIN_END),d&&(u=Math.max(0,u-d),r+=d),p&&(r+=p);let f=u+r,m=Math.max(a,i-(t==="horizontal"?this.fixedColsEnd:this.fixedRowsEnd));return f>m&&(f=m,u=Math.max(a,f-r)),{startIndex:u,endIndex:f}};this.getItemAt=(t,o)=>{let r=o==="horizontal"?this.colWidth:this.rowHeight,i=o==="horizontal"?this.cols:this.rows;if(typeof r!="function")return Math.min(Math.max(0,Math.floor(t/r)),i-1);let a=o==="horizontal"?this.colOffsetCache:this.rowOffsetCache,l=o==="horizontal"?this.colWidthCache:this.rowHeightCache,s=a.length-1,c=l.length-1,u=a[s],d;for(;u<t;)if(s>=i||(c+=1,this.computeCacheFor(c,o),d=u,u=a[c],d===u&&d!=0))return i-1;let p=(0,_m.default)(a,t,oc);return p>=0?p:~p-1};this.computeCacheFor=(t,o)=>{let r=o==="horizontal"?this.colWidth:this.rowHeight,i=o==="horizontal"?this.colWidthCache:this.rowHeightCache,a=o==="horizontal"?this.colOffsetCache:this.rowOffsetCache;if(typeof r!="function")return;let l=r(t);if(i[t]=l,t>0){let s=a[t-1],c=i[t-1];s==null&&console.error(`Offset was not available for ${o==="horizontal"?"col":"row"} ${t-1}`),c==null&&console.error(`Size was not available for ${o==="horizontal"?"col":"row"} ${t-1}`);let u=s+c;a[t]=u}};this.computeItemSpanUpTo=(t,o,r)=>{let i=r==="horizontal"?o:t,a=r==="horizontal"?t:o,l=r==="horizontal"?this.cols:this.rows,s=r==="horizontal"?this.colspan:this.rowspan;if(!s)return;let c=r==="horizontal"?this.colspanParent:this.rowspanParent;c.has(a)||c.set(a,[]);let u=r==="horizontal"?this.colspanValue:this.rowspanValue;u.has(a)||u.set(a,[]);let d=c.get(a),p=u.get(a);if(d[i]===void 0){let f=d.length,m=l?Math.min(i,l-1):0,g={rowIndex:t,colIndex:o};for(;f<=m;f++)if(d[f]===void 0){g[r==="horizontal"?"colIndex":"rowIndex"]=f;let h=s(g);d[f]=f,p[f]=h;let S=f;for(;h>1;)S+=1,d[S]=f,p[S]=0,h-=1}}};this.getCellSpan=(t,o,r)=>{let i=r==="horizontal"?this.colspan:this.rowspan,a=r==="horizontal"?o:t,l=r==="horizontal"?t:o;if(!i)return 1;let s=r==="horizontal"?this.colspanValue:this.rowspanValue,c=s.get(l);return(!c||c[a]===void 0)&&this.computeItemSpanUpTo(t,o,r),c||(c=s.get(l)),c[a]||1};this.getRowspan=(t,o)=>this.getCellSpan(t,o,"vertical");this.getColspan=(t,o)=>this.getCellSpan(t,o,"horizontal");this.getRowspanParent=(t,o)=>this.getItemSpanParent(t,o,"vertical");this.getColspanParent=(t,o)=>this.getItemSpanParent(t,o,"horizontal");this.getItemSpanParent=(t,o,r)=>{let i=r=="horizontal"?this.colspan:this.rowspan,a=r==="horizontal"?o:t,l=r==="horizontal"?t:o;if(!i)return a;let s=r==="horizontal"?this.colspanParent:this.rowspanParent,c=s.get(l);return(!c||c[a]===void 0)&&this.computeItemSpanUpTo(t,o,r),c||(c=s.get(l)),c[a]};this.getRowHeightWithSpan=(t,o,r)=>this.getItemSizeWithSpan(t,o,r,"vertical");this.getColWidthWithSpan=(t,o,r)=>this.getItemSizeWithSpan(t,o,r,"horizontal");this.getItemSizeWithSpan=(t,o,r,i)=>{let a=i==="horizontal"?o:t,l=this.getItemSize(a,i);for(;r>1;)a+=1,r-=1,l+=this.getItemSize(a,i);return l};this.getRowHeight=t=>this.getItemSize(t,"vertical");this.getColWidth=t=>this.getItemSize(t,"horizontal");this.getItemSize=(t,o)=>{let r=o==="horizontal"?this.cols:this.rows,i=o==="horizontal"?this.colWidth:this.rowHeight;if(typeof i!="function")return i;let a=this.getItemSizeCacheFor(t,o),l=o==="horizontal"?this.colWidthCache:this.rowHeightCache;if(a===void 0){let s=l.length,c=Math.min(t,r-1);for(;s<=c;s++)this.computeCacheFor(s,o);a=this.getItemSizeCacheFor(t,o)}return a};this.keepColumnRendered=t=>(this.alwaysRenderedColumns.add(t),()=>{this.alwaysRenderedColumns.delete(t)});this.getAlwaysRenderedColumns=()=>Array.from(this.alwaysRenderedColumns);this.setRenderRange=({horizontal:t,vertical:o,extraCells:r})=>{let i=!1;(t.startIndex!==this.horizontalRenderRange.startIndex||t.endIndex!==this.horizontalRenderRange.endIndex)&&(this.horizontalRenderRange=t,i=!0);let a=!1;(o.startIndex!==this.verticalRenderRange.startIndex||o.endIndex!==this.verticalRenderRange.endIndex)&&(this.verticalRenderRange=o,a=!0),this.extraSpanCells=r||[],(i||a)&&this.notifyRenderRangeChange(),a&&this.notifyVerticalRenderRangeChange(),i&&this.notifyHorizontalRenderRangeChange()};this.getRenderRangeCellCount=ac;this.getMaxCellCount=()=>this.maxHorizontalRenderCount*this.maxVerticalRenderCount;this.getExtraCells=()=>this.extraSpanCells;this.getScrollPosition=()=>this.scrollPosition;this.getRenderRange=()=>({start:[this.verticalRenderRange.startIndex,this.horizontalRenderRange.startIndex],end:[this.verticalRenderRange.endIndex,this.horizontalRenderRange.endIndex]});this.onScroll=t=>(this.onScrollFns.push(t),()=>{this.onScrollFns=this.onScrollFns.filter(o=>o!==t)});this.onScrollStart=t=>(this.onScrollStartFns.push(t),()=>{this.onScrollStartFns=this.onScrollStartFns.filter(o=>o!==t)});this.onScrollStop=t=>(this.onScrollStopFns.push(t),()=>{this.onScrollStopFns=this.onScrollStopFns.filter(o=>o!==t)});this.onRenderRangeChange=t=>(this.onRenderRangeChangeFns.add(t),()=>{this.onRenderRangeChangeFns.delete(t)});this.onVerticalRenderRangeChange=t=>(this.onVerticalRenderRangeChangeFns.add(t),()=>{this.onVerticalRenderRangeChangeFns.delete(t)});this.onHorizontalRenderRangeChange=t=>(this.onHorizontalRenderRangeChangeFns.add(t),()=>{this.onHorizontalRenderRangeChangeFns.delete(t)});this.onRenderCountChange=t=>(this.onRenderCountChangeFns.add(t),()=>{this.onRenderCountChangeFns.delete(t)});this.onAvailableSizeChange=t=>(this.onAvailableSizeChangeFns.add(t),()=>{this.onAvailableSizeChangeFns.delete(t)});this.onDestroy=t=>(this.onDestroyFns.push(t),()=>{this.onDestroyFns=this.onDestroyFns.filter(o=>o!==t)});this.getAvailableSize=()=>({width:this.availableWidth,height:this.availableHeight});this.getAvailableRenderSize=()=>({width:this.availableRenderWidth??this.availableWidth,height:this.availableRenderHeight??this.availableHeight});this.name=o,this.update=this.update.bind(this),this.destroy=this.destroy.bind(this),this.getCellOffset=this.getCellOffset.bind(this),this.reset()}set rowsPerPage(t){t!=this._rowsPerPage&&(this._rowsPerPage=t)}get rowsPerPage(){return this._rowsPerPage}reset(t=hn){t.vertical&&this.resetVertical(),t.horizontal&&this.resetHorizontal(),this.extraSpanCells=[]}resetVertical(){this.rowspanParent=new Map,this.rowspanValue=new Map,this.rowHeightCache=[],this.rowOffsetCache=[0],this.verticalRenderCount=void 0,this.verticalTotalSize=0,this.verticalRenderRange={startIndex:0,endIndex:0}}resetHorizontal(){this.colspanParent=new Map,this.colspanValue=new Map,this.colWidthCache=[],this.colOffsetCache=[0],this.horizontalRenderCount=void 0,this.horizontalTotalSize=0,this.horizontalRenderRange={startIndex:0,endIndex:0}}getVirtualColIndex(t,o){return t}update(t,o){let{rows:r,cols:i,rowHeight:a,colWidth:l,width:s,height:c}=t,u=typeof s=="number",d=typeof c=="number",p=u&&s!==this.availableWidth,f=d&&c!==this.availableHeight;p&&(this.availableWidth=s,this.availableRenderWidth=s),f&&(this.availableHeight=c,this.availableRenderHeight=c),(p||f)&&this.notifyAvailableSizeChange();let m=typeof r=="number",g=typeof i=="number",h=m&&r!==this.rows,S=g&&i!==this.cols;m&&(this.rows=r,this.rowsPerPage=r),g&&(this.cols=i);let y=a!=null,C=l!=null,T=y&&a!==this.rowHeight,I=C&&l!==this.colWidth;y&&(this.rowHeight=a),C&&(this.colWidth=l);let b=t.rowspan!=null,R=t.colspan!=null,w=b&&t.rowspan!=this.rowspan,v=R&&t.colspan!=this.colspan;w&&(this.rowspan=t.rowspan),v&&(this.colspan=t.colspan);let P=S||I||p||v,D=h||T||f||w;(o||CI)({horizontalChange:P,verticalChange:D,colsChanged:S,colWidthChanged:I,widthChanged:p,colspanChanged:v,rowsChanged:h,rowHeightChanged:T,heightChanged:f,rowspanChanged:w})&&this.updateRenderCount({horizontal:P,vertical:D})}extendRenderRange(t){let{direction:o}=t,r=o==="horizontal",i=r?this.horizontalRenderCount||this.getInitialCols():this.verticalRenderCount||this.getInitialRows(),a=typeof t.start=="number"?t.start:t.start===!0?i:0,l=typeof t.end=="number"?t.end:t.end===!0?i:0;return r?this.horizontalExtendRangeBy={start:a,end:l}:this.verticalExtendRangeBy={start:a,end:l},this.updateRenderRange({horizontal:r,vertical:!r}),()=>{this.extendRenderRange({start:0,end:0,direction:o})}}updateRenderCount(t=hn){this.reset(t),this.doUpdateRenderCount(t),this.updateLargeContent()}supportsLargeContent(t){return t==="vertical"}alignScrollOrigin(t,o){return Math.floor(o)}updateLargeContent(){let t=this.getVirtualizedContentSize(),o=this.supportsLargeContent("vertical")&&Qi(t.height),r=this.supportsLargeContent("horizontal")&&Qi(t.width);this.largeContent={vertical:o,horizontal:r},this.scrollRatio={vertical:o?_s(t.height,this.availableHeight):1,horizontal:r?_s(t.width,this.availableWidth):1},this.updateScrollOrigin()}isLargeContent(t){return this.largeContent[t]}getScrollRatio(t){return this.scrollRatio[t]}getNativeScrollSize(){let t=this.getVirtualizedContentSize(),{largeContent:o}=this;if(!o.vertical&&!o.horizontal)return t;let r=Zi();return{width:o.horizontal?r:t.width,height:o.vertical?r:t.height}}toContentScrollPosition(t){let{vertical:o,horizontal:r}=this.scrollRatio;return o===1&&r===1?t:{scrollTop:t.scrollTop*o,scrollLeft:t.scrollLeft*r}}toNativeScrollPosition(t){let{vertical:o,horizontal:r}=this.scrollRatio;return o===1&&r===1?t:{scrollTop:t.scrollTop/o,scrollLeft:t.scrollLeft/r}}getScrollOrigin(){return this.scrollOrigin}getDOMScrollPosition(t=this.getScrollPosition()){let o=this.getScrollOrigin();return!o.scrollTop&&!o.scrollLeft?t:{scrollTop:t.scrollTop-o.scrollTop,scrollLeft:t.scrollLeft-o.scrollLeft}}onScrollOriginChangeForBrain(t){return this.onScrollOriginChangeFns.add(t),()=>{this.onScrollOriginChangeFns.delete(t)}}updateScrollOrigin(){let{scrollPosition:t,largeContent:o,scrollOrigin:r}=this,i=c=>this.alignScrollOrigin("vertical",c),a=c=>this.alignScrollOrigin("horizontal",c),l=o.vertical?Os(t.scrollTop,i(r.scrollTop),i):0,s=o.horizontal?Os(t.scrollLeft,a(r.scrollLeft),a):0;l===r.scrollTop&&s===r.scrollLeft||(this.scrollOrigin={scrollTop:l,scrollLeft:s},this.notifyScrollOriginChange())}notifyScrollOriginChange(){if(this.destroyed)return;let t=this.getScrollOrigin();this.onScrollOriginChangeFns.forEach(o=>o(t))}doUpdateRenderCount(t=hn){if(!this.availableWidth||!this.availableHeight){let o={horizontal:void 0,vertical:void 0};this.availableWidth||(o.horizontal=0),this.availableHeight||(o.vertical=0),this.setRenderCount(o)}this.setRenderCount(this.computeRenderCount(t))}get scrollTopMax(){return this.getVirtualizedContentSize().height-this.availableHeight}get scrollLeftMax(){return this.getVirtualizedContentSize().width-this.availableWidth}setScrollPosition(t,o){this.setScrolling(!0);let r=t.scrollLeft!==this.scrollPosition.scrollLeft,i=t.scrollTop!==this.scrollPosition.scrollTop;this.scrollPosition=t,(r||i)&&(this.updateScrollOrigin(),o?.(t),this.updateRenderRange({horizontal:r,vertical:i}),this.notifyScrollChange())}notifyRenderRangeChange(t=!1){if(this.destroyed)return;let o=this.onRenderRangeChangeFns,r=this.getRenderRange(),i=t?ic:Qr;o.forEach(a=>{i(()=>{this.destroyed||o.has(a)&&a(r)})})}notifyScrollChange(){if(this.destroyed)return;let{scrollPosition:t}=this,o=this.onScrollFns;for(let r=0,i=o.length;r<i;r++)o[r](t)}computeDirectionalRenderCount(t,o,r,i){let a=0,l=t==="horizontal"?i.width:i.height;if(l-=this.getFixedSize(t),l<=0)return 0;let s=t==="horizontal"?this.fixedColsStart:this.fixedRowsStart,c=t==="horizontal"?this.fixedColsEnd:this.fixedRowsEnd;if(typeof o=="function"){let u=[],d=0,p=r;d+=s,p-=c;for(let f=d;f<p;f++)u.push(this.getItemSize(f,t));a=Pa(l,u)}else a=(o?Math.ceil(l/o):0)+1;return a+=s+c,t==="horizontal"?this.maxHorizontalRenderCount=a:this.maxVerticalRenderCount=a,a=Math.min(r,a),a}getFixedSize(t){return t==="horizontal"?this.getFixedStartColsWidth()+this.getFixedEndColsWidth():this.getFixedStartRowsHeight()+this.getFixedEndRowsHeight()}getFixedStartSize(t){return t==="horizontal"?this.getFixedStartColsWidth():this.getFixedStartRowsHeight()}getFixedEndSize(t){return t==="horizontal"?this.getFixedEndColsWidth():this.getFixedEndRowsHeight()}notifyRenderCountChange(){if(this.destroyed)return;let{horizontalRenderCount:t,verticalRenderCount:o}=this,r={horizontal:t,vertical:o},i=this.onRenderCountChangeFns;i.forEach(a=>{Qr(()=>{this.destroyed||i.has(a)&&a(r)})})}getCellOffset(t,o){return{x:this.getItemOffsetFor(o,"horizontal"),y:this.getItemOffsetFor(t,"vertical")}}getInitialRowHeight(){return this.rowHeight}getInitialCols(){return this.cols}getInitialRows(){return this.rows}getItemOffsetFor(t,o){let r=o==="horizontal"?this.colWidth:this.rowHeight;if(typeof r!="function")return t*r;let i=o==="horizontal"?this.colOffsetCache:this.rowOffsetCache,a=o==="horizontal"?this.colWidthCache:this.rowHeightCache,l=i[t];if(l==null){let s=a.length-1;for(;s<t;)s+=1,this.computeCacheFor(s,o);l=i[t]}return l}getItemSizeCacheFor(t,o){return(o==="horizontal"?this.colWidthCache:this.rowHeightCache)[t]}getRowIndexInPage(t){return t}getPageIndexForRow(t){return 0}getVirtualizedContentSize(){return{height:this.getVirtualizedContentSizeFor("vertical"),width:this.getVirtualizedContentSizeFor("horizontal")}}getVirtualizedContentSizeFor(t){let o=t==="horizontal"?this.cols:this.rows,r=t==="horizontal"?this.colWidth:this.rowHeight,i=t==="horizontal"?this.horizontalTotalSize:this.verticalTotalSize;if(typeof r!="function")return r*o;if(i!==0&&!isNaN(i))return i;let a=t==="horizontal"?this.colOffsetCache:this.rowOffsetCache,l=o?this.getItemSize(o-1,t):0,s=o?a[o-1]:0,c=l+s;return t==="horizontal"?this.horizontalTotalSize=c:this.verticalTotalSize=c,c}notifyDestroy(){let t=this.onDestroyFns;for(let o=0,r=t.length;o<r;o++)t[o]()}destroy(){this.destroyed||(this.notifyDestroy(),this.reset(),this.rowspanParent.clear(),this.colspanParent.clear(),this.alwaysRenderedColumns.clear(),this.horizontalExtendRangeBy=xa,this.verticalExtendRangeBy=xa,this.destroyed=!0,this.onDestroyFns=[],this.onScrollFns=[],this.onScrollStartFns=[],this.onScrollStopFns=[],this.onRenderCountChangeFns.clear(),this.onScrollOriginChangeFns.clear(),this.onRenderRangeChangeFns.clear(),this.onVerticalRenderRangeChangeFns.clear(),this.onHorizontalRenderRangeChangeFns.clear())}};var lc=H(ro());function Fm(...n){if(!n.length)return new Set;let[e,...t]=n;return new Set([...e].filter(o=>t.every(r=>r.has(o))))}function Nm(n,e){let t=new Set;for(let o of n)e(o)&&t.add(o);return t}function Jr(n,e){for(let t of n)if(e(t))return t}var Da=(n,e)=>n-e,Ma=class extends It{constructor(t,o){super(`${t}:GridCellManager`);this.matrix=new U;this.rowsWithCellsHistory=new Map;this.columnsWithCellsHistory=new Map;this.cellToMatrixPosition=new WeakMap;this.getCellsOutsideRenderRange=t=>{let{start:o,end:r}=t,[i,a]=o,[l,s]=r,c=new Set;return this.matrix.visit(({value:u},d)=>{if(!u)return;let[p,f]=d,m=p<i,g=p>=l,h=f<a,S=f>=s;(m||g||h||S)&&c.add(u)}),c};this.debugId=t,this.pool=o,this.offRemoveCell=this.pool.onRemoveCell(r=>this.onRemoveCell(r))}onRemoveCell(t){let o=this.cellToMatrixPosition.get(t);this.cellToMatrixPosition.delete(t),o&&this.clearCellFromMatrix(t,o,{skipHistory:!1})}set poolSize(t){this.pool.poolSize=t}get poolSize(){return this.pool.poolSize}getDetachedCell(){return this.pool.getDetachedCell()}clearCellFromMatrix(t,o,r){if(this.matrix.delete(o),r.skipHistory)return;let[i,a]=o,l=this.rowsWithCellsHistory.get(i),s=this.columnsWithCellsHistory.get(a);l&&(l.delete(t),l.size===0&&this.rowsWithCellsHistory.delete(i)),s&&(s.delete(t),s.size===0&&this.columnsWithCellsHistory.delete(a))}addCellToMatrix(t,o){let[r,i]=o;this.matrix.set(o,t),this.cellToMatrixPosition.set(t,o);let a=this.rowsWithCellsHistory.get(r),l=this.columnsWithCellsHistory.get(i);a?a.add(t):(a=new Set,a.add(t),this.rowsWithCellsHistory.set(r,a)),l?l.add(t):(l=new Set,l.add(t),this.columnsWithCellsHistory.set(i,l))}setCellPositionInMatrix(t,o){let r=this.cellToMatrixPosition.get(t);if(o==null){r&&this.clearCellFromMatrix(t,r,{skipHistory:!0});return}let[i,a]=o,l=r&&r[0]===i&&r[1]===a;r&&!l&&this.clearCellFromMatrix(t,r,{skipHistory:!1}),this.addCellToMatrix(t,o)}renderNodeAtCell(t,o,r,i){let a=this.getCellAt(r);return a&&a!==o&&this.detachCellAt(r),this.pool.attachCell(o),this.setCellPositionInMatrix(o,r),o.update(t,i),o}getCellPosition(t){let o=this.cellToMatrixPosition.get(t);return!o||this.getCellAt(o)!=t?null:o}getCellAt(t){return this.matrix.get(t)}getCellFor(t,o){let r=this.getCellAt(t);if(r)return r;let[i,a]=t;if(o==="row"){let l=this.rowsWithCellsHistory.get(i);l&&(r=Jr(l,s=>!this.isCellAttached(s)))}if(o==="column"){let l=this.columnsWithCellsHistory.get(a);l&&(r=Jr(l,s=>!this.isCellAttached(s)))}return r??this.getDetachedCell()}isCellAttached(t){return this.getCellPosition(t)!==null}isCellAttachedAt(t){let o=this.getCellAt(t);return o?this.isCellAttached(o):!1}getMatrix(){let t=this.getRowsWithCells().pop()??-1,o=this.getColumnsWithCells().pop()??-1;return Array.from({length:t+1},(i,a)=>Array.from({length:o+1},(s,c)=>{let u=[a,c],d=this.getCellAt(u);return d?d.getNode():null}))}getAllCells(){return[...this.pool.getAllCells()]}getCellsForRow(t){return this.matrix.getKeysStartingWith([t]).map(o=>this.getCellAt(o)).filter(Boolean)}getOneAttachedCell(){return this.pool.getAttachedCells().values().next().value}getRowsWithCells(){return this.matrix.rawKeysAt([]).sort(Da)}getColumnsWithCells(){let t=this.matrix.getKeysOfFirstChildOnEachBranchStartingWith([],{excludeSelf:!0});return[...new Set(t.map(r=>r[1])).values()].sort(Da)}isRowAttached(t){return this.getRowsWithCells().includes(t)}isColumnAttached(t){return this.getColumnsWithCells().includes(t)}detachRow(t){this.matrix.getKeysStartingWith([t]).forEach(r=>this.detachCellAt(r))}detachCol(t){this.matrix.visit((o,r)=>{r[1]===t&&this.detachCellAt(r)})}detachCell(t){return t?(this.pool.detachCell(t)&&this.setCellPositionInMatrix(t,null),!0):!1}detachCells(t){t.forEach(o=>this.detachCell(o))}detachRowsStartingWith(t){let o=this.getRowsWithCells().sort(),r=(0,lc.default)(o,t,Da);r<0&&(r=~r),o.slice(r).forEach(a=>this.detachRow(a))}detachColsStartingWith(t){let o=this.getColumnsWithCells().sort(),r=(0,lc.default)(o,t,Da);r<0&&(r=~r),o.slice(r).forEach(a=>this.detachCol(a))}detachCellsStartingAt(t){let[o,r]=t;this.matrix.visit((i,a)=>{let[l,s]=a;l>o&&this.detachCellAt(a),l===o&&s>=r&&this.detachCellAt(a)})}detachCellAt(t){let o=this.getCellAt(t);return o?this.detachCell(o):!1}onCellAttachmentChange(t){return this.pool.onCellAttachmentChange(t)}getCellFromListForRow(t,o){return Jr(t,r=>this.getCellPosition(r)?.[0]===o)}getCellFromListForColumn(t,o){return Jr(t,r=>this.getCellPosition(r)?.[1]===o)}getCellCountInMatrix(){return this.matrix.size}flushPendingAfterCommitWork(){this.pool.flushPendingAfterCommitWork()}destroy(){this.reset()}reset(){this.pool.reset(),this.matrix.clear(),this.rowsWithCellsHistory.clear(),this.columnsWithCellsHistory.clear(),this.offRemoveCell(),this.offRemoveCell=()=>{}}makeDetachedCellsEmpty(){this.pool.getDetachedCells().forEach(t=>{t.update(null)})}withDetachedCells(t){this.pool.getDetachedCells().forEach(t)}};var Lm=H(ro());var Ea=class extends It{constructor(t,o){super(`${t}:ListRowManager`);this.indexToRow=new Map;this.rowToIndex=new WeakMap;this.debugId=t,this.pool=o,this.offRemoveRow=this.pool.onRemoveRow(r=>this.onRemoveRow(r))}onRemoveRow(t){let o=this.rowToIndex.get(t);o!=null&&(this.rowToIndex.delete(t),this.indexToRow.delete(o))}set poolSize(t){this.pool.poolSize=t}get poolSize(){return this.pool.poolSize}getDetachedRow(){return this.pool.getDetachedRow()}getRowFor(t){return this.getRowAt(t)??this.getDetachedRow()}setRowIndexInList(t,o){let r=this.rowToIndex.get(t);r!=null&&this.indexToRow.delete(r),o==null?this.rowToIndex.delete(t):(this.rowToIndex.set(t,o),this.indexToRow.set(o,t))}detachStartingWith(t){let o=this.getAttachedIndexes(),r=(0,Lm.default)(o,t,(a,l)=>a-l);r<0&&(r=~r),o.slice(r).forEach(a=>this.detachRowAt(a))}getRowAt(t){return this.indexToRow.get(t)}getRowIndex(t){return this.rowToIndex.get(t)}isRowAttached(t){return this.getRowIndex(t)!=null}isRowAttachedAt(t){return!!this.getRowAt(t)}getList(){let t=Math.max(...this.indexToRow.keys());return Array.from({length:t+1},(r,i)=>{let a=this.indexToRow.get(i);return a?a.getNode():null})}getAttachedCount(){return this.indexToRow.size}forEachAttachedRow(t){this.indexToRow.forEach(t)}getAttachedIndexes(){return Array.from(this.indexToRow.keys()).sort()}getAllRows(){return[...this.pool.getAllRows()]}detachRowAt(t){let o=this.getRowAt(t);o&&(this.setRowIndexInList(o,null),this.pool.detachRow(o))}detachRow(t){let o=this.getRowIndex(t);o!=null&&this.detachRowAt(o)}renderNodeAtRow(t,o,r){let i=this.getRowAt(r);return i&&i!==o&&this.detachRowAt(r),this.pool.attachRow(o),this.setRowIndexInList(o,r),o.update(t),o}makeDetachedRowsEmpty(){this.pool.getDetachedRows().forEach(t=>{t.update(null)})}onRowAttachmentChange(t){return this.pool.onRowAttachmentChange(t)}withDetachedRows(t){this.pool.getDetachedRows().forEach(t)}destroy(){this.reset()}reset(){this.pool.reset(),this.indexToRow.clear(),this.offRemoveRow(),this.offRemoveRow=()=>{}}};var km=!0,yo=Y(q.y),zm=Y(q.scrollTop),II=Y(q.scrollLeft),KN=Y(q.columnOffsetAtIndex),sc=Y(q.columnOffsetAtIndexWhileReordering),sr=class extends It{constructor(t,o,r){o=o||"ReactHeadlessTableRenderer";super(o);this.debugId="";this.destroyed=!1;this.scrolling=!1;this.cellHoverClassNames=[];this.cellDetachedClassNames=[];this.ownsPositionVars=!1;this.lastEnteredRow=-1;this.lastExitedRow=-1;this.hoverRowUpdatesInProgress=new Map;this.infiniteNode=null;this.setDetailTransform=(t,o,{y:r,scrollTop:i,scrollLeft:a})=>{i||(r-=this.brain.getScrollOrigin().scrollTop),t.style.setProperty(yo,i?`calc( ${r}px + var(${zm}) )`:`${r}px`),t.style.transform=`translate3d(${a||0}px, var(${yo}), 0)`};this.setTransform=(t,o,r,{x:i,y:a,scrollLeft:l,scrollTop:s},c)=>{let u=Re.columnOffsets.get(r),d=`${sc}-${r}`,p=s?`calc( ${a}px + var(${zm}, 0px) )`:`${a-this.brain.getScrollOrigin().scrollTop}px`;t.__currentTransformY!==p&&(t.__currentTransformY=p,t.style.setProperty(yo,p));let m=`translate3d(${this.ownsPositionVars?l?`calc( ${i}px + var(${II}, 0px) )`:`${i-this.brain.getScrollOrigin().scrollLeft}px`:`var(${d}, ${u})`}, var(${yo}), 0)`;if(t.__transformValue!==m&&(t.__transformValue=m,t.style.transform=m),c!=null&&this.ownsPositionVars){let g=`${c}`;t.__zIndex!==g&&(t.__zIndex=g,t.style.zIndex=g)}};this.onScrollOriginChange=()=>{this.destroyed||(this.cellManager.getAllCells().forEach(t=>{this.updateElementPosition(t,void 0,{immediate:!0})}),this.rowManager.forEachAttachedRow(t=>{this.updateDetailElementPosition(t)}),this.adjustFixedElementsOnScroll())};this.cellsDetachedInRenderPass=null;this.getFullyVisibleRowsRange=()=>{let{start:[t],end:[o]}=this.brain.getRenderRange();for(;!this.isRowFullyVisible(t);)if(t++,t===o)return null;for(;!this.isRowFullyVisible(o);)if(o--,o===t)return null;return{start:t,end:o}};this.getScrollPositionForScrollRowIntoView=(t,o={offset:0})=>{if(this.destroyed)return null;let{brain:r}=this,i=r.getScrollPosition(),a=i.scrollLeft,{scrollAdjustPosition:l,offset:s=0}=o;if(this.isRowFullyVisible(t)&&!l)return i;let c=r.getItemOffsetFor(t,"vertical"),u=r.getItemSize(t,"vertical"),d=r.getFixedStartRowsHeight(),p=r.getFixedEndRowsHeight(),f=i.scrollTop,m=r.getAvailableSize();if(!m.height)return null;let g=f+m.height;l||(l=c>g-p?"end":c<f+d?"start":"end");let h=i.scrollTop;if(l==="center"?h=c-Math.floor((r.getAvailableSize().height-d-p)/2):l==="start"?(s=-s,h+=c-f+s-d):(s+=u,h+=c-g+s+p),this.brain.isHorizontalLayoutBrain){let S=o.colIndex??Math.ceil(this.brain.getInitialCols()/2),y=this.getScrollPositionForScrollColumnIntoView(S,{...o,horizontalLayoutPageIndex:this.brain.getPageIndexForRow(t)});y&&(a=y.scrollLeft)}return{scrollLeft:a,scrollTop:h}};this.getScrollPositionForScrollColumnIntoView=(t,o={offset:0})=>{if(this.destroyed)return null;let{brain:r}=this,i=r.getScrollPosition(),a=o.horizontalLayoutPageIndex!=null?{horizontalLayoutPageIndex:o.horizontalLayoutPageIndex}:void 0,{scrollAdjustPosition:l,offset:s=0}=o;if(this.isColumnFullyVisible(t,void 0,a)&&!l)return i;a&&(t=r.getInitialCols()*a.horizontalLayoutPageIndex+t);let c=r.getItemOffsetFor(t,"horizontal"),u=r.getItemSize(t,"horizontal"),d=r.getFixedStartColsWidth(),p=r.getFixedStartColsWidth(),f=i.scrollLeft,m=r.getAvailableSize();if(!m.width)return null;let g=f+m.width;l||(l=c>g-p?"end":c<f+d?"start":"end");let h=i.scrollLeft;return l==="center"?h=c-Math.floor((r.getAvailableSize().width-d-p)/2):l==="start"?(s=-s,h+=c-f+s-d):(s+=u,h+=c-g+s+p),{...i,scrollLeft:h}};this.getScrollPositionForScrollCellIntoView=(t,o,r={offsetLeft:0,offsetTop:0})=>{if(this.destroyed)return null;let i=this.getScrollPositionForScrollColumnIntoView(o,{scrollAdjustPosition:r.colScrollAdjustPosition||r.scrollAdjustPosition,offset:r.offsetLeft}),a=this.getScrollPositionForScrollRowIntoView(t,{scrollAdjustPosition:r.rowScrollAdjustPosition||r.scrollAdjustPosition,offset:r.offsetTop});if(!i||!a)return null;let{scrollLeft:l}=i,{scrollTop:s}=a;return{scrollLeft:l,scrollTop:s}};this.isRowFullyVisible=(t,o=2)=>this.isRowVisible(t,this.brain.getRowHeight(t)-o);this.isRowVisible=(t,o=10)=>{if(!this.isRowRendered(t))return!1;t=this.brain.getPageIndexForRow(t)&&this.brain.rowsPerPage?t%this.brain.rowsPerPage:t;let{brain:i}=this;if(i.isRowFixed(t))return!0;let{start:[a],end:[l]}=this.brain.getRenderRange(),s=Math.floor((a+l)/2);if(t<a||t>=l)return!1;if(t>=s){let c=i.getItemAt(i.getAvailableSize().height+i.getScrollPosition().scrollTop-o,"vertical");return t<=c}if(t<s){let c=i.getItemAt(i.getScrollPosition().scrollTop+o,"vertical");return t>=c}return!0};this.isRowRendered=t=>{if(!this.brain.isHorizontalLayoutBrain)return this.cellManager.isRowAttached(t);let o=t;return t=this.brain.rowsPerPage?t%this.brain.rowsPerPage:t,this.cellManager.getCellsForRow(t).filter(r=>r.getAdditionalInfo()?.renderRowIndex===o).length>0};this.isCellVisible=(t,o)=>this.isRowVisible(t)&&this.isColumnVisible(o);this.isCellFullyVisible=(t,o,r)=>this.isRowFullyVisible(t)&&this.isColumnVisible(o,void 0,r);this.isColumnFullyVisible=(t,o=2,r)=>this.isColumnVisible(t,this.brain.getColWidth(t)-o,r);this.isColumnVisible=(t,o=10,r)=>{if(!this.isColumnRendered(t,r))return!1;let{brain:i}=this;if(i.isColFixed(t))return!0;r&&r.horizontalLayoutPageIndex!=null&&(t=i.getVirtualColIndex(t,{pageIndex:r.horizontalLayoutPageIndex}));let{start:[a,l],end:[s,c]}=i.getRenderRange();if(t<l||t>=c)return!1;let u=Math.floor((l+c)/2);if(t>=u){let d=i.getItemAt(i.getAvailableSize().width+i.getScrollPosition().scrollLeft-o-i.getFixedEndColsWidth(),"horizontal");return t<=d}if(t<u){let d=i.getItemAt(i.getScrollPosition().scrollLeft+o+i.getFixedStartColsWidth(),"horizontal");return t>=d}return!0};this.isCellRendered=(t,o,r)=>this.isRowRendered(t)&&this.isColumnRendered(o,r);this.isColumnRendered=(t,o)=>{let{start:[r]}=this.brain.getRenderRange();return o?.horizontalLayoutPageIndex!=null&&(t=this.brain.getInitialCols()*o.horizontalLayoutPageIndex+t),this.cellManager.isCellAttachedAt([r,t])};this.getExtraSpanCellsForRange=t=>{let{start:o,end:r}=t,[i,a]=o,[l,s]=r;return this.brain.getExtraSpanCellsForRange({horizontal:{startIndex:a,endIndex:s},vertical:{startIndex:i,endIndex:l}})};this.getFixedRanges=t=>{let{fixedRowsStart:o,fixedRowsEnd:r,fixedColsStart:i,fixedColsEnd:a}=this.brain.getFixedCellInfo();if(!o&&!i&&!r&&!a)return[];let l=this.brain.getColCount(),s=this.brain.getRowCount(),{start:c,end:u}=t,[d,p]=c,[f,m]=u,g=[];if(i&&(o&&g.push({rowFixed:"start",colFixed:"start",start:[0,0],end:[o,i]}),r&&g.push({rowFixed:"end",colFixed:"start",start:[s-r,0],end:[s,i]}),g.push({rowFixed:!1,colFixed:"start",start:[d,0],end:[f,i]})),a&&(o&&g.push({colFixed:"end",rowFixed:"start",start:[0,l-a],end:[o,l]}),r&&g.push({colFixed:"end",rowFixed:"end",start:[s-r,l-a],end:[s,l]}),g.push({colFixed:"end",rowFixed:!1,start:[d,l-a],end:[f,l]})),o){let h={start:[0,p],end:[o,m],rowFixed:"start",colFixed:!1};g.push(h)}if(r){let h={rowFixed:"end",colFixed:!1,start:[s-r,p],end:[s,m]};g.push(h)}return g};this.isCellFixed=(t,o)=>{let{fixedRowsStart:r,fixedRowsEnd:i,fixedColsStart:a,fixedColsEnd:l}=this.brain.getFixedCellInfo(),s=this.brain.getColCount(),c=this.brain.getRowCount(),u=!1,d=!1,p=!1;if(t<r&&(u=!0,p="start"),i&&!u){let f=c-i;t>=f&&(u=!0,p="end")}if(o<a&&(d=!0,p="start"),l&&!d){let f=s-l;o>=f&&(d=!0,p="end")}return{row:u?p:!1,col:d?p:!1}};this.isCellCovered=(t,o)=>{let r=this.brain.getRowspanParent(t,o),i=this.brain.getColspanParent(t,o),a=r!=t,l=i!=o;return a||l?[r,i]:!1};this.onMouseEnterNotBound=t=>{let o=this.getMatrixRowIndexFromElement(t.currentTarget);this.onMouseEnter(o)};this.onMouseLeaveNotBound=t=>{let o=this.getMatrixRowIndexFromElement(t.currentTarget);this.onMouseLeave(o)};this.onMouseEnter=t=>{this.lastEnteredRow=t,this.lastExitedRow=-1,!this.scrolling&&t!=-1&&this.addHoverClass(t)};this.addHoverClass=t=>{this.cellManager.getCellsForRow(t).forEach(o=>{let r=o.getElement();r&&this.cellHoverClassNames.forEach(i=>{r.classList.add(i)})})};this.onMouseLeave=t=>{this.lastExitedRow=t,this.lastEnteredRow=-1,!this.scrolling&&t!=-1&&this.removeHoverClass(t)};this.removeHoverClass=t=>{this.cellManager.getCellsForRow(t).forEach(o=>{let r=o.getElement();r&&this.cellHoverClassNames.forEach(i=>{r.classList.remove(i)})})};this.updateHoverClassNamesForRow=t=>{if(this.scrolling||this.hoverRowUpdatesInProgress.has(t))return;this.hoverRowUpdatesInProgress.set(t,!0);let o=()=>{!this.scrolling&&this.lastEnteredRow!=-1&&(this.lastEnteredRow===t?this.addHoverClass(t):this.removeHoverClass(t))};He(()=>{this.destroyed||(o(),this.hoverRowUpdatesInProgress.delete(t))})};this.updateElementPosition=(t,o,r)=>{if(this.destroyed)return;let i=t.getElement(),a=this.cellManager.getCellPosition(t);if(!a)return;let[l,s]=a,c=this.brain.getCellOffset(l,s);if(c==null)return;let{x:u,y:d}=c;if(i){let p=()=>{this.updateHoverClassNamesForRow(l);let f=this.getCellRealCoordinates(l,s);if(i.dataset.rowIndex=f.rowIndex,i.dataset.colIndex=f.colIndex,km){let m=this.ownsPositionVars?this.getFixedCellPlacement(l,s,{x:u,y:d}):null;this.setTransform(i,l,s,m??{x:u,y:d},null),i.style.willChange="transform",i.style.backfaceVisibility="hidden";let h=(o?o.hidden:!!this.isCellCovered(l,s))?"-1":m?`${m.zIndex}`:i.dataset.zIndex||"auto";i.__zIndex!==h&&(i.__zIndex=h,i.style.zIndex=h)}else i.style.display="",i.style.left=`${u}px`,i.style.top=`${d}px`};this.scrolling&&this.brain.isHorizontalLayoutBrain&&!r?.immediate?t.setPendingAfterCommitWork(p):p()}};this.updateDetailElementPosition=t=>{if(this.destroyed)return;let o=t.getElement(),r=this.rowManager.getRowIndex(t);if(r==null)return;let i=this.brain.getItemOffsetFor(r,"vertical");if(i==null)return;let a=i;o&&(o.dataset.detailRowIndex=r,km&&(this.setDetailTransform(o,r,{y:a,scrollLeft:this.brain.getDOMScrollPosition().scrollLeft}),o.style.willChange="transform",o.style.backfaceVisibility="hidden",o.style.zIndex=o.dataset.zIndex||"auto"))};this.onScrollStart=()=>{this.scrolling=!0,this.lastEnteredRow!=-1&&this.removeHoverClass(this.lastEnteredRow)};this.onScrollStop=()=>{this.scrolling=!1,this.flushPendingAfterCommitWork(),this.lastEnteredRow!=-1&&this.addHoverClass(this.lastEnteredRow),this.lastExitedRow!=-1&&this.removeHoverClass(this.lastExitedRow)};this.adjustFixedElementsOnScroll=(t=this.brain.getScrollPosition())=>{let{brain:o,cellManager:r,rowManager:i}=this,a=this.brain.getColCount(),l=this.brain.getRowCount(),{fixedColsStart:s,fixedColsEnd:c,fixedRowsStart:u,fixedRowsEnd:d}=this.brain.getFixedCellInfo();if(i.getAttachedCount()&&i.forEachAttachedRow(I=>{let b=i.getRowIndex(I);if(b!=null){let R=this.brain.getItemOffsetFor(b,"vertical");if(R==null)return;let w=I.getElement();if(!w)return;this.setDetailTransform(w,b,{y:R,scrollLeft:o.getDOMScrollPosition(t).scrollLeft})}}),!s&&!c&&!u&&!d)return;let p=this.cellManager.getOneAttachedCell();p&&hp(o.getDOMScrollPosition(t),this.ownsPositionVars?p.getElement()?.parentElement??null:this.getInfiniteNode(p.getElement()));let f={cols:this.brain.getFixedEndColsOffsets({skipScroll:!0}),rows:this.brain.getFixedEndRowsOffsets({skipScroll:!0})},{start:m,end:g}=this.brain.getRenderRange(),[h,S]=m,[y,C]=g,T=(I,b)=>{let R=r.getCellAt([I,b])?.getElement(),w=R?o.getCellOffset(I,b):null;if(!R||!w)return;let v=this.getFixedCellPlacement(I,b,w,f);v&&this.setTransform(R,I,b,v,v.zIndex)};if(s||c)for(let I=h;I<y;I++){for(let b=0;b<s;b++)T(I,b);if(c){let b=a-c;for(let R=b;R<a;R++)T(I,R)}}if(u||d)for(let I=S;I<C;I++){for(let b=0;b<u;b++)T(b,I);if(d){let b=l-d;for(let R=b;R<l;R++)T(R,I)}}if(s&&u)for(let I=0;I<u;I++)for(let b=0;b<s;b++)T(I,b);if(s&&d){let I=l-d;for(let b=I;b<l;b++)for(let R=0;R<s;R++)T(b,R)}if(c&&u){let I=a-c;for(let b=0;b<u;b++)for(let R=I;R<a;R++)T(b,R)}if(c&&d){let I=l-d,b=a-c;for(let R=I;R<l;R++)for(let w=b;w<a;w++)T(R,w)}};this.flushPendingAfterCommitWork=()=>{this.destroyed||this.cellManager.flushPendingAfterCommitWork()};this.destroy=()=>{this.destroyed||(this.destroyed=!0,this.reset(),this.onDestroy(),this.hoverRowUpdatesInProgress.clear(),this.hoverRowUpdatesInProgress=null,this.brain=null)};this.brain=t,this.debugId=o,this.cellManager=new Ma(o,r.cellPool),this.cellManager.onCellAttachmentChange((u,d)=>{d?this.onCellAttached(u):this.onCellDetached(u)}),this.rowManager=new Ea(o,r.rowPool),this.rowManager.onRowAttachmentChange((u,d)=>{d?this.onRowAttached(u):this.onRowDetached(u)}),this.renderRange=this.renderRange.bind(this);let i=t.onScroll(this.adjustFixedElementsOnScroll),a=t.onAvailableSizeChange(()=>{this.adjustFixedElementsOnScroll(),He(()=>{this.destroyed||this.adjustFixedElementsOnScroll()})}),l=t.onScrollStart(this.onScrollStart),s=t.onScrollStop(this.onScrollStop),c=t.onScrollOriginChange(this.onScrollOriginChange);this.onDestroy=()=>{c(),i(),a(),l(),s()}}getInfiniteNode(t){return this.infiniteNode||(this.infiniteNode=ws(t)),this.infiniteNode}onCellAttached(t){if(!this.cellsDetachedInRenderPass?.delete(t)&&this.cellDetachedClassNames.length){let o=t.getElement();o&&this.cellDetachedClassNames.forEach(r=>{o.classList.remove(r)})}}onCellDetached(t){if(this.cellsDetachedInRenderPass){this.cellsDetachedInRenderPass.add(t);return}this.addDetachedClassNames(t)}addDetachedClassNames(t){if(this.cellDetachedClassNames.length){let o=t.getElement();o&&this.cellDetachedClassNames.forEach(r=>{o.classList.add(r)})}}onRowAttached(t){if(this.cellDetachedClassNames.length){let o=t.getElement();o&&this.cellDetachedClassNames.forEach(r=>{o.classList.remove(r)})}}onRowDetached(t){if(this.cellDetachedClassNames.length){let o=t.getElement();o&&this.cellDetachedClassNames.forEach(r=>{o.classList.add(r)})}}isCellRenderedAndMappedCorrectly(t,o){let r=!!this.cellManager.getCellAt([t,o]);return{rendered:r,mapped:r}}renderRange(t,o){if(this.destroyed)return[];if(this.cellsDetachedInRenderPass)return this.renderRangeInternal(t,o);let r=this.cellsDetachedInRenderPass=new Set;try{return this.renderRangeInternal(t,o)}finally{this.cellsDetachedInRenderPass=null,r.forEach(i=>this.addDetachedClassNames(i))}}renderRangeInternal(t,{renderCell:o,renderDetailRow:r,force:i,onRender:a}){let{start:l,end:s}=t,c=this.brain.isHorizontalLayoutBrain,{rowManager:u,cellManager:d}=this,p=this.getFixedRanges(t),f=[t,...p],m=this.brain.getAlwaysRenderedColumns();if(m.length>0){let P=t.start[1],D=t.end[1];m.forEach(M=>{P<=M&&M<D||f.push({start:[t.start[0],M],end:[t.end[0],M+1]})})}let g=new Map,h=f.map(this.getExtraSpanCellsForRange).flat();h&&h.forEach(([P,D])=>{g.set(`${P}:${D}`,!0)});let S=f.reduce((P,D)=>P+ac(D),0),y=r?f.reduce((P,D)=>P+Om(D),0):0,C=this.brain.getRowCount(),T=this.brain.getColCount();d.detachCellsStartingAt([C,T]);let I=Math.min(C*T,S);r&&(u.detachStartingWith(this.brain.getRowCount()),u.poolSize>y&&(u.poolSize=y));let b=Fm(...f.map(P=>d.getCellsOutsideRenderRange(P)));b=Nm(b,P=>{let D=d.getCellPosition(P);return!(D&&g.has(`${D[0]}:${D[1]}`))}),d.detachCells(b),d.poolSize=I;let R=new Map,w=new Map;f.forEach(P=>{let{start:D,end:M}=P,[x,E]=D,[z,V]=M;for(let N=x;N<z;N++){for(let F=E;F<V;F++){let B=`${N}:${F}`;if(R.has(B))continue;R.set(B,!0);let{rendered:X,mapped:_}=this.isCellRenderedAndMappedCorrectly(N,F);if(N===x||F===E){let K=this.isCellCovered(N,F);if(K&&g.has(`${K[0]}:${K[1]}`)){let Q=d.getCellAt([N,F]);Q!=null&&d.detachCell(Q);continue}}if(X&&!i&&_)continue;let k;X?k=d.getCellAt([N,F]):k=d.getCellFor([N,F],c?"row":"column"),k==null&&(k=d.getDetachedCell()),this.renderCellAt(N,F,k,o)}!r||w.has(N)||(w.set(N,!0),u.isRowAttachedAt(N)&&!i)||this.renderDetailRowAtElement(N,this.rowManager.getRowFor(N),r)}}),h.forEach(([P,D])=>{let{rendered:M,mapped:x}=this.isCellRenderedAndMappedCorrectly(P,D);if(M){if(i||!x){let z=[P,D],V=d.getCellAt(z);this.renderCellAt(P,D,V,o)}return}let E=d.getCellFor([P,D],c?"row":"column");E!=null&&this.renderCellAt(P,D,E,o)});let v=d.getAllCells().map(P=>P.getNode());return r&&u.getAllRows().forEach(P=>{v.push(P.getNode())}),this.adjustFixedElementsOnScroll(),a&&a(v),v}renderDetailRowAtElement(t,o,r){if(this.destroyed)return;let i=!1,a=this.brain.getRowHeight(t),l=this.brain.isRowFixedStart(t)?"start":this.brain.isRowFixedEnd(t)?"end":!1,c=r({rowIndex:t,height:a,rowFixed:l,hidden:!!i,onMouseEnter:()=>{},onMouseLeave:()=>{},domRef:o.ref});if(o.isMounted()||o.onMount(u=>{let d=u.getElement();d&&(d.style.position="absolute",d.style.left="0px"),this.updateDetailElementPosition(u)}),!c){this.rowManager.detachRow(o);return}this.rowManager.renderNodeAtRow(c,o,t),this.updateDetailElementPosition(o)}getCellRealCoordinates(t,o){return{rowIndex:t,colIndex:o}}getMatrixRowIndexFromElement(t){let o=Number(t.dataset.rowIndex);return this.brain.isHorizontalLayoutBrain?this.brain.getRowIndexInPage(o):o}renderCellAt(t,o,r,i){if(this.destroyed)return;let a=this.isCellCovered(t,o),l=this.brain.getRowHeight(t),s=this.brain.getColWidth(o),c=this.brain.getRowspan(t,o),u=this.brain.getColspan(t,o),d=c===1?l:this.brain.getRowHeightWithSpan(t,o,c),p=u===1?s:this.brain.getColWidthWithSpan(t,o,u),{row:f,col:m}=this.isCellFixed(t,o),g=!!a,{rowIndex:h,colIndex:S}=this.getCellRealCoordinates(t,o),y=i({rowIndex:h,colIndex:S,height:l,width:s,rowspan:c,colspan:u,rowFixed:f,colFixed:m,hidden:g,heightWithRowspan:d,widthWithColspan:p,onMouseEnter:this.onMouseEnterNotBound,onMouseLeave:this.onMouseLeaveNotBound,domRef:r.ref});r.isMounted()||r.onMount(I=>{let b=I.getElement();b&&(b.style.position="absolute",b.style.left="0px",b.style.top="0px"),this.updateElementPosition(I)});let C=this.brain.isHorizontalLayoutBrain?{renderRowIndex:h,renderColIndex:S}:void 0,T=this.brain.isHorizontalLayoutBrain;if(!y){T?this.cellManager.detachCell(r):this.cellManager.detachCell(r);return}this.cellManager.renderNodeAtCell(y,r,[t,o],C),this.updateElementPosition(r,{hidden:g,rowspan:c,colspan:u})}getFixedCellPlacement(t,o,{x:r,y:i},a){let{fixedRowsStart:l,fixedRowsEnd:s,fixedColsStart:c,fixedColsEnd:u}=this.brain.getFixedCellInfo(),d=this.brain.getColCount(),p=this.brain.getRowCount(),f=o<c,m=!f&&!!u&&o>=d-u,g=t<l,h=!g&&!!s&&t>=p-s,S=f||m,y=g||h;if(!S&&!y)return null;m&&(r=(a?.cols??this.brain.getFixedEndColsOffsets({skipScroll:!0}))[o]),h&&(i=(a?.rows??this.brain.getFixedEndRowsOffsets({skipScroll:!0}))[t]);let C=S&&y?f?g?1e5:2e5:g?3e5:4e5:f?c-o:m?d-o:g?l-t:p-t;return{x:r,y:i,scrollLeft:S,scrollTop:y,zIndex:C}}reset(){this.cellManager.reset(),this.rowManager.reset()}};var Aa=class extends sr{constructor(t,o,r){super(t,o,r);this.setTransform=(t,o,r,i,a)=>{let l=this.getCellRealCoordinates(o,r),{y:s}=i,c=Math.floor(l.rowIndex/this.brain.rowsPerPage)-this.brain.getScrollOriginPageIndex(),u=fe.runtime.totalVisibleColumnsWidthVar,d=c?`calc(${u} * ${c})`:"0px",p=Re.columnOffsets.get(l.colIndex),f=`${sc}-${l.colIndex}`,m=`${s}px`;t.__currentTransformY!==m&&(t.__currentTransformY=m,t.style.setProperty(yo,m));let g=`calc(var(${f}, ${p}) + ${d})`,h=`var(${yo})`,S=`translate3d(${g}, ${h}, 0px)`;t.__transformValue!==S&&(t.__transformValue=S,t.style.transform=S)};this.brain=t}getCellRealCoordinates(t,o){return this.brain.getHorizontalLayoutPositionFromMatrixCoordinates({rowIndex:t,colIndex:o})}isCellRenderedAndMappedCorrectly(t,o){let r=this.cellManager.getCellAt([t,o]),i=!!r;if(!i)return{rendered:i,mapped:!1};let a=r.getAdditionalInfo();if(!a)return{rendered:i,mapped:!1};let l=this.getCellRealCoordinates(t,o),s=l.colIndex===a.renderColIndex&&l.rowIndex===a.renderRowIndex;return{rendered:i,mapped:s}}};var Gm=H(require("react"));var cr=class cr extends It{constructor(t){super(t);this.cellRemoveSubscription=Se();this.cellAttachmentChangeSubscription=Se();this.attachedCells=new Set,this.detachedCells=new Set,this.allCellsOrdered=new Set}destroy(){this.reset()}onRemoveCell(t){return this.cellRemoveSubscription.onChange(r=>{r!=null&&t(r)})}onCellAttachmentChange(t){return this.cellAttachmentChangeSubscription.onChange(r=>{if(r==null)return;let{cell:i,attached:a}=r;t(i,a)})}reset(){this.attachedCells.clear(),this.detachedCells.clear(),this.allCellsOrdered.clear(),this.cellRemoveSubscription.destroy(),this.cellAttachmentChangeSubscription.destroy()}getAttachedCells(){return this.attachedCells}getDetachedCells(){return this.detachedCells}getAllCells(){return this.allCellsOrdered}createCell(){let t=this.createCellInstance();return this.detachedCells.add(t),this.allCellsOrdered.add(t),t}removeCell(t){this.detachedCells.delete(t),this.attachedCells.delete(t),this.allCellsOrdered.delete(t),t.destroy(),this.cellRemoveSubscription(t)}attachCell(t){return t&&this.attachedCells.has(t)||(t||(t=this.getDetachedCell()),this.detachedCells.delete(t),this.attachedCells.add(t),this.cellAttachmentChangeSubscription({cell:t,attached:!0})),t}detachCell(t){return this.detachedCells.has(t)?!1:(this.attachedCells.delete(t),this.detachedCells.add(t),this.cellAttachmentChangeSubscription({cell:t,attached:!1}),!0)}getDetachedCell(){let{detachedCells:t}=this,o=t.values().next().value;return o||(this.poolSize+=cr.POOL_SIZE_INCREMENT,o=t.values().next().value),o||this.error("No cells available in the pool!"),o}get attachedSize(){return this.attachedCells.size}get detachedSize(){return this.detachedCells.size}get poolSize(){return this.allCellsOrdered.size}flushPendingAfterCommitWork(){for(let t of this.attachedCells)t.flushPendingAfterCommitWork()}set poolSize(t){t=Math.ceil(t/cr.POOL_SIZE_INCREMENT)*cr.POOL_SIZE_INCREMENT;let o=this.poolSize;if(t===o)return;let{detachedCells:r}=this,i=o-t;if(i>0){i>r.size&&(i=r.size,this.debug("Trying to destroy more cells than are currently detached!"));let a=r.values();for(;i>0;){let l=a.next().value;this.removeCell(l),i--}}else for(i=-i;i>0;)this.createCell(),i--}};cr.POOL_SIZE_INCREMENT=1;var _a=cr;var Vm=new Map,RI=()=>{},cc=class{constructor(e,t){this.element=null;this.mounted=!1;this.pendingAfterCommitWork=null;this.mountSubscription=Se();let o=Vm.get(e)??0,r=`${e}:GridCellReact:${o}`;Vm.set(e,o+1),this.debugId=r,this.cellInfo=t,this.updater=Se(),this.node=Gm.createElement(jn,{key:r,name:r,updater:this.updater}),this.ref=i=>{this.element=i,i?(this.mounted=!0,this.mountSubscription(this)):this.mounted=!1}}setPendingAfterCommitWork(e){this.pendingAfterCommitWork=e}flushPendingAfterCommitWork(){if(this.pendingAfterCommitWork){let e=this.pendingAfterCommitWork;this.pendingAfterCommitWork=null,e()}}isMounted(){return this.mounted}onMount(e){return this.mountSubscription.onChange(o=>{o!=null&&e(o)})}destroy(){this.mountSubscription.destroy(),this.updater.destroy(),this.pendingAfterCommitWork=null,this.ref=RI,this.element=null,this.node=null}getNode(){return this.node}update(e,t){this.updater(e),this.cellInfo=t}getAdditionalInfo(){return this.cellInfo}getElement(){return this.element}},Oa=class extends _a{constructor(t){super(`${t}:GridCellPoolForReact`);this.cellDebugId=t}createCellInstance(){return new cc(this.cellDebugId)}};var Km=H(require("react"));var ur=class ur extends It{constructor(t){super(t);this.rowRemoveSubscription=Se();this.rowAttachmentChangeSubscription=Se();this.attachedRows=new Set,this.detachedRows=new Set,this.allRowsOrdered=new Set}destroy(){this.reset()}onRemoveRow(t){return this.rowRemoveSubscription.onChange(r=>{r!=null&&t(r)})}onRowAttachmentChange(t){return this.rowAttachmentChangeSubscription.onChange(r=>{if(r==null)return;let{row:i,attached:a}=r;t(i,a)})}reset(){this.attachedRows.clear(),this.detachedRows.clear(),this.allRowsOrdered.clear(),this.rowRemoveSubscription.destroy(),this.rowAttachmentChangeSubscription.destroy()}getAttachedRows(){return this.attachedRows}getDetachedRows(){return this.detachedRows}getAllRows(){return this.allRowsOrdered}createRow(){let t=this.createRowInstance();return this.detachedRows.add(t),this.allRowsOrdered.add(t),t}removeRow(t){this.detachedRows.delete(t),this.attachedRows.delete(t),this.allRowsOrdered.delete(t),t.destroy(),this.rowRemoveSubscription(t)}attachRow(t){return t&&this.attachedRows.has(t)||(t||(t=this.getDetachedRow()),this.detachedRows.delete(t),this.attachedRows.add(t),this.rowAttachmentChangeSubscription({row:t,attached:!0})),t}detachRow(t){return this.detachedRows.has(t)?!1:(this.attachedRows.delete(t),this.detachedRows.add(t),this.rowAttachmentChangeSubscription({row:t,attached:!1}),!0)}getDetachedRow(){let{detachedRows:t}=this,o=t.values().next().value;return o||(this.poolSize+=ur.POOL_SIZE_INCREMENT),o=t.values().next().value,o||this.error("No rows available in the pool!"),o}get attachedSize(){return this.attachedRows.size}get detachedSize(){return this.detachedRows.size}get poolSize(){return this.allRowsOrdered.size}set poolSize(t){t=Math.ceil(t/ur.POOL_SIZE_INCREMENT)*ur.POOL_SIZE_INCREMENT;let o=this.poolSize;if(t===o)return;let{detachedRows:r}=this,i=o-t;if(i>0){i>r.size&&(i=r.size,this.debug("Trying to destroy more rows than are currently detached!"));let a=r.values();for(;i>0;){let l=a.next().value;this.removeRow(l),i--}}else for(i=-i;i>0;)this.createRow(),i--}};ur.POOL_SIZE_INCREMENT=1;var Fa=ur;var Hm=new Map,wI=()=>{},uc=class{constructor(e){this.element=null;this.mounted=!1;this.mountSubscription=Se();let t=Hm.get(e)??0,o=`${e}:ListRowReact:${t}`;Hm.set(e,t+1),this.debugId=o,this.updater=Se(),this.node=Km.createElement(jn,{key:`detail-row-${o}`,name:`detail-row-${o}`,updater:this.updater}),this.ref=r=>{this.element=r,r?(this.mounted=!0,this.mountSubscription(this)):this.mounted=!1}}isMounted(){return this.mounted}onMount(e){return this.mountSubscription.onChange(o=>{o!=null&&e(o)})}destroy(){this.mountSubscription.destroy(),this.updater.destroy(),this.ref=wI,this.element=null,this.node=null}getNode(){return this.node}update(e){this.updater(e)}getElement(){return this.element}},Na=class extends Fa{constructor(t){super(`${t}:ListRowPoolForReact`);this.rowDebugId=t}createRowInstance(){return new uc(this.rowDebugId)}};function Bm(n){return{cellPool:new Oa(n),rowPool:new Na(n)}}function ei(n){let e=n.isHorizontalLayoutBrain?new Aa(n,`${n.name}:HorizontalLayoutTableRenderer`,Bm(`${n.name}:HorizontalLayoutTableRenderer`)):new sr(n,`${n.name}:ReactHeadlessTableRenderer`,Bm(`${n.name}:ReactHeadlessTableRenderer`)),t=Se();return n.onDestroy(()=>{e.destroy(),t.destroy()}),{renderer:e,onRenderUpdater:t}}function vI(n){let e=ei(n);return e.renderer.ownsPositionVars=!0,e}function PI(n){let{brain:e,renderCell:t,renderDetailRow:o,forceRerenderTimestamp:r}=n,{renderer:i,onRenderUpdater:a}=(0,So.useMemo)(()=>n.onRenderUpdater&&n.renderer?{renderer:n.renderer,onRenderUpdater:n.onRenderUpdater}:vI(e),[e,n.onRenderUpdater,n.renderer]);return(0,So.useLayoutEffect)(()=>{i.cellHoverClassNames=n.cellHoverClassNames||[]},[i,n.cellHoverClassNames]),(0,So.useLayoutEffect)(()=>{i.cellDetachedClassNames=n.cellDetachedClassNames||[]},[i,n.cellDetachedClassNames]),(0,So.useLayoutEffect)(()=>{let l=e.getRenderRange();return i.renderRange(l,{onRender:a,force:!0,renderCell:t,renderDetailRow:o}),e.onRenderRangeChange(c=>{i.renderRange(c,{force:!1,onRender:u=>{let d=a.get();d&&u&&d.length===u.length||a(u)},renderCell:t,renderDetailRow:o})})},[i,e,t,o,a,r]),(0,So.useLayoutEffect)(()=>{i.flushPendingAfterCommitWork()}),La.createElement(jn,{updater:a})}var ka=La.memo(PI);var ti=H(require("react")),bo=require("react");var Wm=he({defaultClassName:"nxbq1c1 _16lm1iwz _16lm1iw2",variantClassNames:{visible:{true:"nxbq1c3",false:"nxbq1c4"}},defaultVariants:{},compoundVariants:[]}),za="nxbq1c0 _16lm1iwz _16lm1iw4 _16lm1iw26 _16lm1iw23 _16lm1iw1y _16lm1iw1k";var jm=he({defaultClassName:"j26lrx0 _16lm1iwz _16lm1iw2 _16lm1iw23 _16lm1iw26",variantClassNames:{active:{true:"j26lrx2",false:"j26lrx3"}},defaultVariants:{},compoundVariants:[]});function Um(n,e){let t=e-n.getScrollOriginPageIndex();return t?`calc(${fe.runtime.totalVisibleColumnsWidthVar} * ${t})`:null}function $m(n,e){let t="0px",o=e;n.isHorizontalLayoutBrain&&n.rowsPerPage&&(t=Um(n,n.getPageIndexForRow(o))??"0px",o=o%n.rowsPerPage);let r=n.getRowHeight(o),i=n.getItemOffsetFor(o,"vertical")-n.getScrollOrigin().scrollTop;return{activeCellRowHeight:`${r}px`,activeCellRowOffset:`${i}px`,activeCellRowOffsetX:t}}function Ym(n,e){let{scrollTop:t,scrollLeft:o}=n.getDOMScrollPosition(e);return{scrollTopForActiveRow:`${-t}px`,scrollLeftForActiveRowWhenHorizontalLayout:n.isHorizontalLayoutBrain?`${-o}px`:"0px"}}function qm(n,e,t){let[o]=e,r=e[1],i;if(n.isHorizontalLayoutBrain&&n.rowsPerPage){let c=Re.columnOffsets.get(r),u=Um(n,n.getPageIndexForRow(o));i=u?`calc( ${u} + ${c})`:c,o=o%n.rowsPerPage}let a=typeof t=="function"?t(o):t??n.getRowHeight(o),l=n.getItemOffsetFor(o,"vertical")-n.getScrollOrigin().scrollTop,s={activeCellRowHeight:`${a}px`,activeCellRowOffset:`${l}px`};return i!==void 0&&(s.activeCellColOffset=i),s}var{rootClassName:xI}=ze,DI=`${xI}-ActiveRowIndicator`,MI=`calc(${q.activeCellRowOffsetX} + var(${Y(q.scrollLeftForActiveRowWhenHorizontalLayout)}, 0px))`,EI={[Y(q.activeCellOffsetY)]:q.activeCellRowOffset,transform:`translate3d(${MI}, calc( ${q.activeCellOffsetY} + var(${Y(q.scrollTopForActiveRow)}, 0px)), 0px)`,height:q.activeCellRowHeight,maxWidth:fe.runtime.totalVisibleColumnsWidthVar},AI=n=>{let{brain:e}=n,t=(0,bo.useRef)(null),o=n.activeRowIndex!=null&&e.getInitialRows()>n.activeRowIndex,[r,i]=qt(),a=(0,bo.useRef)(n.activeRowIndex);a.current=n.activeRowIndex;let l=()=>{let s=a.current;s==null||!t.current||$o($m(e,s),t.current)};return(0,bo.useLayoutEffect)(l,[n.activeRowIndex,e]),(0,bo.useEffect)(()=>{let s=p=>{$o(Ym(e,p),t.current)};s(e.getScrollPosition());let c=e.onScroll(s),u=e.onRenderCountChange(i),d=e.onScrollOriginChange(l);return()=>{d(),u(),c()}},[e]),ti.createElement("div",{className:za,"data-name":"active-row"},ti.createElement("div",{ref:t,"data-name":"active-row-indicator",className:`${DI} ${jm({active:o})}`,style:o?EI:void 0}))},Xm=ti.memo(AI);var ni=H(require("react")),To=require("react");var{rootClassName:_I}=ze,OI=`${_I}-ActiveCellIndicator`,FI=Y(q.columnZIndexAtIndex),Zm=(n,e,t,o)=>{e!=null&&$o(qm(n,e,t),o.current)},NI=n=>{let{brain:e}=n,[t,o]=qt(),r=(0,To.useRef)(null),i=n.activeCellIndex!=null&&e.getInitialRows()>n.activeCellIndex[0];(0,To.useLayoutEffect)(()=>{Zm(e,n.activeCellIndex,n.rowHeight,r)},[n.activeCellIndex,n.rowHeight,e]);let a=(0,To.useRef)(n);return a.current=n,(0,To.useEffect)(()=>{let l=e.onRenderCountChange(()=>{o()}),s=e.onScrollOriginChange(()=>{let{activeCellIndex:c,rowHeight:u}=a.current;Zm(e,c,u,r)});return()=>{l(),s()}},[e]),ni.createElement("div",{className:za,ref:r,"data-name":"active-cell",style:i?{zIndex:`var(${FI}-${n.activeCellIndex[1]})`}:void 0},ni.createElement("div",{"data-name":"active-cell-indicator",className:`${OI} ${Wm({visible:i})}`}))},Qm=ni.memo(NI);var Va=[lf,`${yt}DetachedCell`];function Ga(n,e,t){t&&(t.fixedColsStart||t.fixedColsEnd||t.fixedRowsStart||t.fixedRowsEnd)&&n.updateFixedCells({fixedColsStart:t.fixedColsStart,fixedColsEnd:t.fixedColsEnd,fixedRowsStart:t.fixedRowsStart,fixedRowsEnd:t.fixedRowsEnd}),n.update({height:e.height,width:e.width,cols:e.cols,rows:e.rows,colWidth:e.colWidth,rowHeight:e.rowHeight,rowspan:e.rowspan,colspan:e.colspan})}var LI=$(Cm,nc);function Jm(n){let{brain:e,scrollerDOMRef:t,scrollStopDelay:o,renderCell:r,renderDetailRow:i,activeCellRowHeight:a,cellHoverClassNames:l,renderer:s,activeRowIndex:c,activeCellIndex:u,onRenderUpdater:d,wrapRowsHorizontally:p,forceRerenderTimestamp:f,scrollVarHostRef:m,...g}=n,{autoFocus:h}=g,S=(0,Pt.useRef)(null),[y,C]=(0,Pt.useState)({width:0,height:0});(0,Pt.useEffect)(()=>{o!=null&&e.setScrollStopDelay(o)},[o,e]),(0,Pt.useEffect)(()=>{let R=S.current?.parentNode;return R?(h&&document.activeElement!==R&&R.focus(),Oo(R,()=>{let P={height:R.clientHeight,width:R.clientWidth};e.update(P)},{debounce:50})):void 0},[p,e]);let T=(0,Pt.useCallback)(R=>{let w=e.getDOMScrollPosition(R);requestAnimationFrame(()=>{S.current&&S.current.style.setProperty("transform",`translate3d(${-w.scrollLeft}px, ${-w.scrollTop}px, 0px)`)})},[e]),I=(0,Pt.useCallback)(R=>{e.setScrollPosition(e.toContentScrollPosition(R),T)},[e,T]);(0,Pt.useEffect)(()=>{let R=e.onRenderCountChange(()=>{C(e.getNativeScrollSize())});return C(e.getNativeScrollSize()),T(e.getScrollPosition()||{scrollLeft:0,scrollTop:0}),R},[e]);let b=(0,Pt.useRef)({brain:e,vertical:1,horizontal:1});return(0,Pt.useLayoutEffect)(()=>{let R=b.current,w=e.getScrollRatio("vertical"),v=e.getScrollRatio("horizontal");b.current={brain:e,vertical:w,horizontal:v};let P=S.current?.parentElement;if(!P||R.brain!==e||R.vertical===w&&R.horizontal===v)return;let D=e.toNativeScrollPosition(e.getScrollPosition());R.vertical!==w&&(P.scrollTop=D.scrollTop),R.horizontal!==v&&(P.scrollLeft=D.scrollLeft)},[y,e]),Co.createElement(Em,{onContainerScroll:I,...g,ref:t},Co.createElement("div",{ref:S,className:LI,"data-name":"scroll-transform-target"},Co.createElement(ka,{forceRerenderTimestamp:f,renderer:s,onRenderUpdater:d,renderCell:r,renderDetailRow:i,brain:e,cellHoverClassNames:l,cellDetachedClassNames:Va}),u!=null?Co.createElement(Qm,{brain:e,rowHeight:a,activeCellIndex:u}):null),c!=null?Co.createElement(Xm,{brain:e,activeRowIndex:c}):null,Co.createElement(Tm,{width:y.width,height:y.height}))}function eg(n,e,t,o){let r=new Map,i=new Map,a=new Map;n.forEach((u,d)=>{let p=u.id,f=n[d-1],m=f?.id??"",g=new Set,h=f?.computedPinned!==u.computedPinned?new Set:a.get(m)??new Set;a.set(p,g);let S={type:"column",id:p,ref:u,groupOffset:0,computedPinned:u.computedPinned,computedWidth:u.computedWidth,depth:u.columnGroup?(t.get(u.columnGroup)??0)+1:0};r.set([p],S);let y=u.columnGroup,C,T=S;for(;y;){let I=e[y];if(I){g.add(y);let b=[p,...g];C=h.has(y)?i.get(y):void 0,C||(C={id:y,type:"group",ref:I,columnItems:[],children:[],groupOffset:0,uniqueGroupId:[y],computedWidth:0,computedPinned:S.computedPinned,depth:t.get(y)??0},r.set(b,C),i.set(y,C)),C.columnItems.push(S),C.uniqueGroupId.push(S.id),T&&!h.has(T.id)&&C.children.push(T),T=C,y=I.columnGroup}else break}});let l=[],s=new U,c=0;return r.forEach(u=>{if(!u.ref.columnGroup){let d=u.type==="column"?u.ref.computedWidth:u.columnItems.reduce((p,f)=>p+f.ref.computedWidth,0);u.groupOffset=c,u.computedWidth=d,u.type==="group"&&tg(u.children),l.push(u),c+=d}if(u.type==="group")u.columnItems.forEach(d=>{s.set([u.depth,d.ref.computedVisibleIndex],u)});else for(let d=u.depth;d<=o+1;d++)s.set([d,u.ref.computedVisibleIndex],u)}),r.clear(),i.clear(),{tree:l,pathsToCells:s}}function tg(n,e=0){n.forEach(t=>{let o=t.type==="column"?t.ref.computedWidth:t.columnItems.reduce((r,i)=>r+i.ref.computedWidth,0);t.computedWidth=o,t.groupOffset=e,t.type==="group"&&tg(t.children),e+=o})}var $n=H(require("react")),yn=require("react");var pc=H(require("react"));var og=H(require("react")),dc=require("react");var oi=require("react"),ri=H(require("react"));var{rootClassName:kI}=ze,zI=`${kI}HeaderCell_ResizeHandle`;function VI(n){let e=(0,oi.useRef)(null),[t,o]=(0,oi.useState)(!1),r=(0,oi.useRef)(t);r.current=t;let i=n.groupColumns[0];if(!i)return null;let a=i.computedPinned,l=i.computedFirstInCategory,s=i.computedLastInCategory,c=d=>{d.stopPropagation();let p=d.pointerId,f=d.clientX,m=d.target;m.setPointerCapture(p);let g=!0,h=qf(n.groupColumns.map(T=>T.computedVisibleIndex),{columns:n.columns,domRef:e}),S=T=>{a==="end"&&(T*=-1);let{constrained:I,adjustedDiffs:b,adjustedDiff:R}=n.computeResize(T);return r.current!==I&&o(I),h.resize(b),R},y=T=>{if(g){let I=n.groupColumns.reduce((w,v)=>w+v.computedWidth-v.computedMinWidth,0),b=n.brain.getAvailableSize(),R={width:b.width+I,height:b.height};n.brain.update(R),g=!1}S(Math.round(T.clientX-f))},C=T=>{m.releasePointerCapture(p),m.removeEventListener("pointermove",y),m.removeEventListener("pointerup",C);let I=Math.round(T.clientX-f),b=S(I);h.resize(n.groupColumns.map(()=>0)),n.onResize(b)};m.addEventListener("pointermove",y),m.addEventListener("pointerup",C)},u=(a===!1||a==="start")&&s?{right:a==="start"?void 0:fe.components.HeaderCell.resizeHandleWidth}:a==="end"&&l?{right:void 0}:void 0;return ri.createElement("div",{ref:e,className:`${zI} ${ba} ${Ca({computedPinned:a,computedFirstInCategory:l,computedLastInCategory:s})}`,onPointerDown:c},ri.createElement("div",{style:{...u,...n.style},className:Ta({constrained:t})}))}var ng=ri.memo(VI);function rg(n,e){let{bodyBrain:t,groupHeight:o,columnGroup:r,columnGroupsMaxDepth:i}=e,{computedVisibleColumns:a,getState:l,getComputed:s,actions:c}=te(g=>({computedVisibleColumns:g.computed.computedVisibleColumns,getState:g.getState,getComputed:g.getComputed,actions:g.actions})),u=n[n.length-1],d=(0,dc.useCallback)(g=>{let h=l(),{columnSizing:S,viewportReservedWidth:y,bodySize:C}=h,T=s().computedVisibleColumns,I=!1,b=T.reduce((v,P)=>(P.computedFlex&&(v[P.id]={...S[P.id],flex:P.computedWidth},I=!0),v),{}),R=I?{...S,...b}:S;return qd({availableSize:qs(C),reservedWidth:y||0,dragHandleOffset:g,dragHandlePositionAfter:u.computedVisibleIndex,columnSizing:R,columnGroupSize:n.length,items:T.map(v=>({id:v.id,resizable:v.computedResizable,computedFlex:v.computedFlex,computedWidth:v.computedWidth,computedMinWidth:v.computedMinWidth,computedMaxWidth:v.computedMaxWidth}))})},[u]),p=(0,dc.useCallback)(g=>{let{columnSizing:h,reservedWidth:S}=d(g);c.viewportReservedWidth=S,c.columnSizing=h},[d]);return n.some(g=>g.computedResizable)?og.createElement(ng,{brain:t,style:{height:o*(i-r.depth+2)},columns:a,groupColumns:n,computeResize:d,onResize:p}):null}var ig=`${yt}HeaderGroup`,ag=Y(q.columnWidthAtIndex),GI=Y(q.columnZIndexAtIndex);function lg(n){let{columnGroup:e,height:t,columns:o,bodyBrain:r,columnGroupsMaxDepth:i}=n,{header:a,style:l}=e;a instanceof Function&&(a=a({columnGroup:e,horizontalLayoutPageIndex:n.horizontalLayoutPageIndex}));let s=rg(o,{bodyBrain:r,groupHeight:t,columnGroup:e,columnGroupsMaxDepth:i}),c=o[0],u=o.length>1?"calc( "+o.map(f=>`var(${ag}-${f.computedVisibleIndex})`).join(" + ")+" )":`var(${ag}-${c.computedVisibleIndex})`,d=`calc(var(${GI}-${c.computedVisibleIndex}) + ${i-e.depth})`,p=typeof l=="function"?l({columnGroup:e,horizontalLayoutPageIndex:n.horizontalLayoutPageIndex}):l;return p=p&&typeof p=="object"?p:{},p.width=u,p.height=t,pc.createElement("div",{ref:n.domRef,"data-group-id":e.uniqueGroupId,className:$(zd,ig),style:p,"data-z-index":d},pc.createElement("div",{className:$(`${ig}__header-content`,Ht)},a),s)}var sg=require("react");var gc=H(require("react")),fc;function hc(){return fc||(fc=gc.createContext({dataSourceApi:null,getDataSourceState:()=>null,assignState:()=>null,getDataSourceMasterContext:()=>{},dataSourceState:null,dataSourceActions:null}))}var mc;function Ha(){return mc||(mc=gc.createContext(null))}function Ne(n){let e=Ha(),t=(0,sg.useContext)(e);return Fo(t,n)}function on(){return Ne(n=>({getDataSourceState:n.getDataSourceState,getDataSourceMasterContext:n.getDataSourceMasterContext,dataSourceActions:n.dataSourceActions,dataSourceApi:n.dataSourceApi,assignState:n.assignState}))}var{rootClassName:HI}=ze,KI=[],cg=`${HI}Header`,BI=Od({overflow:!1}),ug=()=>{};function WI(n){let{bodyBrain:e,headerBrain:t,columns:o,style:r,className:i,columnHeaderHeight:a,columnAndGroupTreeInfo:l,columnGroupsMaxDepth:s}=n,{getState:c,headerOptions:u,headerRenderer:d,headerOnRenderUpdater:p,showColumnFilters:f,computedColumnsMap:m}=te(x=>({computedColumnsMap:x.computed.computedColumnsMap,getState:x.getState,headerOptions:x.state.headerOptions,headerRenderer:x.state.headerRenderer,headerOnRenderUpdater:x.state.headerOnRenderUpdater,showColumnFilters:x.state.showColumnFilters})),g=(0,yn.useRef)(null),h=(0,yn.useCallback)(x=>{if(g.current){let{scrollLeft:E}=t.getDOMScrollPosition(x);g.current.style.transform=`translate3d(${-E}px, 0px, 0px)`}},[t]);(0,yn.useEffect)(()=>{let x=t.onScroll(h);return h(t.getScrollPosition()||{scrollLeft:0,scrollTop:0}),x},[t]);let S={ref:g,className:$(cg,`${cg}--virtualized`,i,BI),style:{...r,height:a}},{getDataSourceState:y,dataSourceApi:C,dataSourceActions:T}=on(),{allRowsSelected:I,someRowsSelected:b,selectionMode:R,filterTypes:w,filterDelay:v}=Ne(x=>({allRowsSelected:x.dataSourceState.allRowsSelected,someRowsSelected:x.dataSourceState.someRowsSelected,selectionMode:x.dataSourceState.selectionMode,filterTypes:x.dataSourceState.filterTypes,filterDelay:x.dataSourceState.filterDelay})),P=(0,yn.useMemo)(()=>({allRowsSelected:I,someRowsSelected:b,selectionMode:R}),[I,b,R]),D=(0,yn.useCallback)(x=>{let{rowIndex:E,colIndex:z,domRef:V,height:N,widthWithColspan:L,heightWithRowspan:F,hidden:B}=x,X=o[z];if(!X||B)return null;let _=t.isHorizontalLayoutBrain?t.getPageIndexForRow(E):null,k=l?l.pathsToCells.get([E,z]):null;if(k&&k.type==="group"){let K=k.columnItems.map(se=>se.ref),Q={...k.ref,id:k.id,uniqueGroupId:k.uniqueGroupId,depth:k.depth,columns:K.map(se=>se.id),computedWidth:k.computedWidth,groupOffset:k.groupOffset};return c().columnGroupVisibility[k.id]!==!1?$n.createElement(lg,{horizontalLayoutPageIndex:_,bodyBrain:e,columnGroupsMaxDepth:s,domRef:V,columns:K,width:L,height:N,columnGroup:Q}):null}return $n.createElement(pg,{domRef:V,column:X,horizontalLayoutPageIndex:_,headerOptions:u,dataSourceStatePartialForHeaderCell:P,filterTypes:w,filterDelay:v,getDataSourceState:y,dataSourceApi:C,dataSourceActions:T,width:L,height:F,columnsMap:m})},[u,o,a,l,s,f,t,y,C,T,w,v,P]),M=lo(ea);return $n.createElement(Wn,{orientation:"horizontal",dragListId:M,dragStrategy:"inline",onDrop:ug,updatePosition:ug},x=>$n.createElement("div",{...x,...S,className:$(x.className,S.className)},$n.createElement(ka,{name:"header",renderCell:D,brain:t,renderer:d,onRenderUpdater:p,cellHoverClassNames:KI,cellDetachedClassNames:Va})))}var dg=$n.memo(WI);function fg(n){let{headerBrain:e,bodyBrain:t,scrollbars:o}=n,{computedPinnedStartColumns:r,computedPinnedEndColumns:i,computedVisibleColumns:a,columnSize:l}=te(b=>({computedPinnedStartColumns:b.computed.computedPinnedStartColumns,computedPinnedEndColumns:b.computed.computedPinnedEndColumns,computedVisibleColumns:b.computed.computedVisibleColumns,columnSize:b.computed.columnSize})),{columnHeaderHeight:s,columnGroupsDepthsMap:c,columnGroupsMaxDepth:u,computedColumnGroups:d,showColumnFilters:p}=te(b=>({columnHeaderHeight:b.state.columnHeaderHeight,columnGroupsDepthsMap:b.state.columnGroupsDepthsMap,columnGroupsMaxDepth:b.state.columnGroupsMaxDepth,computedColumnGroups:b.state.computedColumnGroups,showColumnFilters:b.state.showColumnFilters})),f=!d||!Object.keys(d).length?1:u+2,m=f*s+(p?s:0),g=Wt.useMemo(()=>{if(!(!d||!Object.keys(d).length))return eg(a,d,c,u)},[a,d,c]),h=Wt.useCallback(({rowIndex:b,colIndex:R})=>{let w=a[R],v=1,P=1;if(!w||!g)return{rowspan:v,colspan:P};let D=g.pathsToCells.get([b,R]);if(!D)return{rowspan:v,colspan:P};if(D.type==="column")return{colspan:P,rowspan:f-D.depth};let M=D.columnItems.findIndex(x=>x.id===w.id);return{rowspan:v,colspan:M===0?D.columnItems.length:1}},[d,u,a,g,f,c]),S=Wt.useCallback(({rowIndex:b,colIndex:R})=>h({rowIndex:b,colIndex:R}).rowspan,[h]),y=Wt.useCallback(({rowIndex:b,colIndex:R})=>h({rowIndex:b,colIndex:R}).colspan,[h]),C=Wt.useCallback(b=>p?b<f-1?s:2*s:s,[f,p,s]);Ga(e,{colWidth:l,rowHeight:C,rows:f,cols:a.length,height:m,rowspan:S,colspan:y},{fixedColsEnd:i.length,fixedColsStart:r.length});let T=Wt.createElement(dg,{columns:a,headerBrain:e,bodyBrain:t,columnHeaderHeight:m,columnGroupsMaxDepth:u,columnAndGroupTreeInfo:g}),I=o.vertical&&Xt()?Wt.createElement("div",{className:Gd,style:{zIndex:1e3,width:Xt()}}):null;return Wt.createElement("div",{className:`${ks} ${Wd}`,style:{height:m}},T,I)}var{ManagedComponentContextProvider:jI}=kt({initSetupState:ym,forwardProps:Sm,Context:tc()});function yc(n){let{getComputed:e,header:t,brain:o,headerBrain:r,wrapRowsHorizontally:i}=te(l=>({getComputed:l.getComputed,header:l.state.header,brain:l.state.brain,headerBrain:l.state.headerBrain,wrapRowsHorizontally:l.state.wrapRowsHorizontally})),{scrollbars:a}=e();return t?ii.createElement(jI,{...n},ii.createElement(fg,{wrapRowsHorizontally:!!i,bodyBrain:o,headerBrain:r,scrollbars:a})):null}function mg(){return ii.useContext(tc()).componentState}var UI=n=>{let{allRowsSelected:e,someRowsSelected:t,api:o,dataSourceApi:r}=n,i=e?!0:t?null:!1,{components:a,isTree:l}=o.getState(),s=a?.CheckBox||zn;return Ae.createElement(s,{domProps:{className:Qo},onChange:c=>{if(l){c?r.treeApi.selectAll():r.treeApi.deselectAll();return}c?o.rowSelectionApi.selectAll():o.rowSelectionApi.deselectAll()},checked:i})},ha=Ae.createContext(null);var $I=Y(q.columnZIndexAtIndex),YI=Y(q.columnVisibilityAtIndex),Sc=Ae.createElement("div",{className:Fi[1]}),Y0=Li({"data-name":"","data-field":"","data-header-align":"","data-column-id":"","data-sort":"","data-sort-index":"",[bt]:"",[ar]:""});function qI(n){let e=n.column,{allowColumnHideWhileDragging:t}=mg(),{dataSourceStatePartialForHeaderCell:o,horizontalLayoutPageIndex:r,getDataSourceState:i,dataSourceApi:a,dataSourceActions:l,filterTypes:s,filterDelay:c}=n,{allRowsSelected:u,someRowsSelected:d,selectionMode:p}=o,{onDragItemPointerDown:f,dragListId:m}=go(),{api:g,getComputed:h,getState:S,actions:y,getDataSourceMasterContext:C,showColumnFilters:T,components:I,portalDOMRef:b,columnHeaderHeight:R,columnReorderDragColumnId:w,columnMenuVisibleForColumnId:v,columnReorderInPageIndex:P}=te(j=>({api:j.api,getComputed:j.getComputed,getState:j.getState,actions:j.actions,getDataSourceMasterContext:j.getDataSourceMasterContext,showColumnFilters:j.state.showColumnFilters,components:j.state.components,portalDOMRef:j.state.portalDOMRef,columnHeaderHeight:j.state.columnHeaderHeight,columnReorderDragColumnId:j.state.columnReorderDragColumnId,columnMenuVisibleForColumnId:j.state.columnMenuVisibleForColumnId,columnReorderInPageIndex:j.state.columnReorderInPageIndex})),D=w===e.id,M=P!=null?r!==P:!1,{onResize:x,height:E,width:z,headerOptions:V,columnsMap:N}=n,L=e.computedSortInfo,F=e.header,B=(0,Sn.useCallback)(j=>{pe.current=j,n.domRef?.(j)},[n.domRef]),X=V.alwaysReserveSpaceForSortIcon,_=e.headerAlign??e.align,k=(typeof _=="function"?_({isHeader:!0,column:e}):_)??"start",K=(typeof e.verticalAlign=="function"?e.verticalAlign({isHeader:!0,column:e}):e.verticalAlign)??"center",Q=St(e,{actions:y,api:g,dataSourceActions:l,dataSourceApi:a,getComputed:h,getDataSourceState:i,getDataSourceMasterContext:C,getState:S}),Ie=Q.isSortable(),se=Ie&&(e.computedSorted||X)?Ae.createElement(Sa,{index:e.computedMultiSort?e.computedSortIndex+1:void 0,style:{marginInlineStart:fe.spacing[2],marginInlineEnd:fe.spacing[2]},className:`${so}__sort-icon ${Hd} ${Bd({align:k})}`,direction:e.computedSorted?e.computedSortedAsc?1:-1:0}):null,ve=e.computedFilterable&&e.computedFiltered?Ae.createElement(Ho,null):null,Pe=e.headerCssEllipsis??e.cssEllipsis??!0,ue={reserveSpaceWhenHidden:k==="center",menuVisible:v===e.id,style:k==="end"?{marginInlineStart:`calc(${fe.components.HeaderCell.resizeHandleActiveAreaWidth} / 2)`,marginInlineEnd:fe.spacing[2]}:{marginInlineEnd:`calc(${fe.components.HeaderCell.resizeHandleActiveAreaWidth} / 2)`,marginInlineStart:fe.spacing[2]},domProps:{onMouseDown:j=>{j.stopPropagation(),Q.toggleContextMenu(j.target)}}},oe=e.components?.MenuIcon||I?.MenuIcon||Yr,ce=Ae.createElement(oe,{...ue}),pe=(0,Sn.useRef)(null),Z={horizontalLayoutPageIndex:r,dragging:D,domRef:B,htmlElementRef:pe,renderLocation:"column-header",column:e,columnsMap:N,columnSortInfo:L,columnFilterValue:e.computedFilterValue,filtered:e.computedFiltered,someRowsSelected:d,allRowsSelected:u,selectionMode:p,api:g,dataSourceApi:a,columnApi:Q,renderBag:{sortIcon:se,filterIcon:ve,menuIcon:ce,menuIconProps:ue,selectionCheckBox:null,header:e.header&&typeof e.header!="function"?e.header:e.name}},J=Z,W=J.renderBag.header,ie=()=>{let j={...Z,renderBag:{...Z.renderBag}};if(e.renderSortIcon&&(j.renderBag.sortIcon=Ae.createElement(Kn,{render:e.renderSortIcon,renderParam:{...j,renderBag:{...j.renderBag}}})),e.renderFilterIcon&&(j.renderBag.filterIcon=Ae.createElement(Kn,{render:e.renderFilterIcon,renderParam:{...j,renderBag:{...j.renderBag}}})),typeof e.renderMenuIcon=="function"&&(j.renderBag.menuIcon=Ae.createElement(Kn,{render:Ze=>{if(typeof e.renderMenuIcon!="function")return null;let Ct=e.renderMenuIcon(Ze);return Ct?Ct.type===oe||Ct.type===Yr?Ct:Ae.createElement(oe,{...ue},Ct):null},renderParam:{...j,renderBag:{...j.renderBag}}})),e.renderSelectionCheckBox&&p==="multi-row"){j.renderBag.selectionCheckBox=Ae.createElement(Kn,{render:UI,renderParam:{...j,renderBag:{...j.renderBag}}});let Ze=e.renderHeaderSelectionCheckBox??e.renderSelectionCheckBox;Ze&&Ze!==!0&&(j.renderBag.selectionCheckBox=Ae.createElement(Kn,{render:Ze,renderParam:{...j,renderBag:{...j.renderBag}}}))}F instanceof Function&&(j.renderBag.header=W=Ae.createElement(Kn,{render:F,renderParam:{...j,renderBag:{...j.renderBag}}}));let tt=e.renderMenuIcon===!1?null:j.renderBag.menuIcon,ae=Pe?Ae.createElement("div",{className:Ht},j.renderBag.header):j.renderBag.header,Ee=Ae.createElement(Ae.Fragment,null,k==="center"?Sc:null,j.renderBag.selectionCheckBox,ae,j.renderBag.sortIcon,j.renderBag.filterIcon,k==="center"?Sc:null,k!=="center"?Sc:null,tt);return e.renderHeader?Ae.createElement(Kn,{render:e.renderHeader,renderParam:{...j,renderBag:{...j.renderBag,all:Ee}}}):Ee};(0,Sn.useEffect)(()=>{let j=null,tt=pe.current;return x&&tt&&(j=Oo(tt,x)),()=>{j?.()}},[pe.current,n.onResize]);let ne={height:E};e.headerStyle&&(ne=typeof e.headerStyle=="function"?{...ne,...e.headerStyle(J)||{}}:{...ne,...e.headerStyle});let le=typeof e.headerClassName=="function"?e.headerClassName(J):e.headerClassName,{onPointerDown:O,proxyPosition:A,dragColumnOutside:de}=Qp({columnId:e.id,domRef:pe,horizontalLayoutPageIndex:r,allowColumnHideOnDrag:t}),ye=null,we=ha.Provider,be={filtered:e.computedFiltered,verticalAlign:K,align:k},Me=Ae.useMemo(()=>{let j=tt=>{g.setColumnFilter(e.id,tt)};return c>0?Nt(j,{wait:c}):j},[c,e.id]),qe=e.computedFilterType,We=s[qe],it=e.computedFilterable?e.computedFilterValue?.filter.operator??We?.defaultOperator:void 0,at=e.computedFilterable&&We?We.operators.find(j=>j.name===it):void 0,et=at?.components?.FilterEditor||We?.components?.FilterEditor||e.components?.FilterEditor||Uo,Xe=We?.components?.FilterOperatorSwitch||e.components?.FilterOperatorSwitch,G=Qf(e,{horizontalLayoutPageIndex:r}),ee=`var(${$I}-${e.computedVisibleIndex})`;ne.zIndex=ee,ne.visibility=`var(${YI}-${e.computedVisibleIndex}, visible)`;let ge={"data-field":`${e.field||""}`,"data-column-id":e.id,[bt]:e.id,[ar]:m,"data-header-align":k,"data-name":"HeaderCell","data-sort":e.computedSortedAsc?"asc":e.computedSortedDesc?"desc":"none","data-sort-index":`${e.computedSortIndex??-1}`},Te=e.computedFilterable?Ae.createElement(lp,{horizontalLayoutPageIndex:r,filterEditor:et,filterOperatorSwitch:Xe??sp,operator:at,filterTypes:s,onChange:Me,columnFilterType:qe,columnLabel:e.field||e.name||e.id,columnFilterValue:e.computedFilterValue,columnHeaderHeight:R}):Ae.createElement(cp,null);J.renderBag.filterEditor=Te;let ut=(0,Sn.useCallback)(j=>{O(j),f(j)},[O,f]),re=ie();return D&&A&&(ye=Ae.createElement("div",{key:e.id,className:`${so}Proxy ${Ed}`,style:{height:E,width:z,left:A.left??0,top:A.top??0}},Ae.createElement("div",{className:Ad({visible:de})},Ae.createElement(hm,{size:16})),W),ye=(0,gg.createPortal)(ye,b.current)),Ae.createElement(we,{value:J},Ae.createElement(ma,{domRef:B,horizontalLayoutPageIndex:n.horizontalLayoutPageIndex,cellType:"header",column:e,...ge,"data-z-index":ee,style:ne,width:z,onPointerDown:ut,contentClassName:$(Md(be),od[k]),contentStyle:T?{height:E/2}:void 0,className:$(so,sd.none,Ie?td.pointer:"",le,Ui(e,[so,mn],_d,{dragging:D,insideDisabledDraggingPage:M,align:k,verticalAlign:K,rowSelected:!1,cellSelected:!1,rowDisabled:!1,zebra:!1,rowActive:!1,firstRow:!0,firstRowInHorizontalLayoutPage:!0,treeNode:!1,groupCell:!1,groupRow:!1,rowExpanded:!1}),Dd),cssEllipsis:Pe,afterChildren:Ae.createElement(Ae.Fragment,null,T?Te:null,G),renderChildren:re}),ye)}var pg=Ae.memo(qI);function Nr(){return(0,Sn.useContext)(ha)}var bn=H(require("react")),Rg=require("react");function hg(n,e){let{separator:t}=e??{separator:"-"};return n.replace(/([a-z\d])([A-Z])/g,"$1"+t+"$2").replace(new RegExp("("+t+"[A-Z])([A-Z])","g"),"$1"+t+"$2").toLowerCase()}var Sg="https://infinite-table.com",bg="Invalid Infinite Table license. See console for details.",Tg={padding:fe.spacing[2],textAlign:"end",opacity:"1",visibility:"visible",display:"block",fontSize:"0.85rem"},XI={...Tg,background:"white",color:"black"},ZI={...Tg,background:"#fee2e2",color:"#991b1b"},Cg={opacity:"1",visibility:"visible",display:"inline-block",pointerEvents:"all",textDecoration:"underline"},QI={...Cg,color:"black"},JI={...Cg,color:"#991b1b"};function bc(n){return n?{footer:ZI,anchor:JI}:{footer:XI,anchor:QI}}var yg=(n,e)=>{if(n)for(let[t,o]of Object.entries(e))n.style.setProperty(hg(t),o,"important")};function Ig(n,e){let t=bc(e),o=()=>{setTimeout(()=>{let i=n();yg(i,t.footer),yg(i?.querySelector("a")??null,t.anchor)})};o();let r=setInterval(o,1e3);return()=>{clearInterval(r)}}var wg=bn.forwardRef(function(e,t){let{invalid:o=!1,...r}=e,{rootClassName:i}=Oi(),a=bn.useRef(null),l=bn.useCallback(c=>{a.current=c,t&&(typeof t=="function"?t(c):t.current=c)},[]);(0,Rg.useEffect)(()=>Ig(()=>a.current,o),[o]);let s=bc(o);return bn.createElement("div",{ref:l,...r,className:$(`${i}-Footer`,o?`${i}-Footer--invalid`:null,yp,r.className),style:s.footer},o?`${bg} `:null,"Powered by"," ",bn.createElement("a",{href:Sg,rel:"noopener noreferrer",role:"link",target:"_blank",style:s.anchor},"Infinite Table"))});var Ka=class{constructor(e){let t=e instanceof Object.getPrototypeOf(this).constructor?e.getState():e,o=this.getPositiveFromState(t),r=this.getNegativeFromState(t);this.update({negativeItems:r,positiveItems:o})}getInitialState(){return this.initialState}destroy(){this.positiveMap?.clear(),this.negativeMap?.clear(),delete this.positiveMap,delete this.negativeMap}update(e){let{positiveItems:t,negativeItems:o}=e;if(this.allNegative=o===!0,this.allPositive=t===!0,this.allNegative&&this.allPositive)throw"Cannot have both negativeItems and positiveItems be true!";o!==!0&&(this.negativeMap?(this.negativeMap.clear(),this.negativeMap.fill(o.map(r=>[r,!0]))):this.negativeMap=new U(o.map(r=>[r,!0])),this.positiveMap&&this.positiveMap.clear()),t!==!0&&(this.positiveMap?(this.positiveMap.clear(),this.positiveMap.fill(t.map(r=>[r,!0]))):this.positiveMap=new U(t.map(r=>[r,!0])),this.negativeMap&&this.negativeMap.clear())}areAllNegative(){return this.allNegative&&(this.positiveMap?this.positiveMap.size===0:!0)}areAllPositive(){return this.allPositive&&(this.negativeMap?this.negativeMap.size===0:!0)}makeAllNegative(){this.update({negativeItems:!0,positiveItems:[]})}makeAllPositive(){this.update({positiveItems:!0,negativeItems:[]})}isItemPositive(e){if(this.allPositive===!0){if(this.allNegative===!0)throw'Cannot have both positiveItems and negativeItems be "true"';return!this.negativeMap?.has(e)}return this.positiveMap?.has(e)}isItemNegative(e){return!this.isItemPositive(e)}setItemValue(e,t){if(t!==this.isItemPositive(e)){if(t){if(this.allNegative===!0){if(!this.positiveMap)throw`No positiveMap found when trying to set item ${e.join(",")} be positive`;this.positiveMap.set(e,!0)}else if(this.allPositive===!0){if(!this.negativeMap)throw`No negativeMap found when trying to set item ${e.join(",")} be positive`;this.negativeMap.delete(e)}}else if(this.allPositive===!0){if(!this.negativeMap)throw`No negativeMap found when trying to set item ${e.join(",")} be negative`;this.negativeMap.set(e,!0)}else if(this.allNegative===!0){if(!this.positiveMap)throw`No positiveMap found when trying to set item ${e.join(",")} be negative`;this.positiveMap?.delete(e)}}}makeItemNegative(e){this.setItemValue(e,!1)}makeItemPositive(e){this.setItemValue(e,!0)}toggleItem(e){this.setItemValue(e,!this.isItemPositive(e))}};var xt=class extends Ka{constructor(e){super(e)}getState(){return{expandedRows:this.allPositive?!0:this.positiveMap?.topDownKeys()??[],collapsedRows:this.allNegative?!0:this.negativeMap?.topDownKeys()??[]}}getPositiveFromState(e){return e.expandedRows}getNegativeFromState(e){return e.collapsedRows}areAllCollapsed(){return this.areAllNegative()}areAllExpanded(){return this.areAllPositive()}collapseAll(){this.makeAllNegative()}expandAll(){this.makeAllPositive()}isGroupRowExpanded(e){return this.isItemPositive(e)}isGroupRowCollapsed(e){return!this.isGroupRowExpanded(e)}setGroupRowExpanded(e,t){return this.setItemValue(e,t)}collapseGroupRow(e){this.setGroupRowExpanded(e,!1)}expandGroupRow(e){this.setGroupRowExpanded(e,!0)}toggleGroupRow(e){this.toggleItem(e)}};function Vt(){let n=Fe().performance?.now();return`${Date.now()}:${n}`}function Ba(n,e){return n&&n.filter(t=>{let o=e[t.filter.type];return!(!o||o.emptyValues&&o.emptyValues.includes(t.filter.value))})}var vg=new WeakMap;function Wa(n,e){if(!n||!n.length)return[];let t=vg.get(n);t||(t=new WeakMap,vg.set(n,t));let o=t.get(e);if(o)return o;let r=[],i=Ba(n,e)||[];for(let a=0,l=i.length;a<l;a++){let s=i[a],c=e[s.filter.type];if(s.disabled||!c)continue;let u;for(let d=0;d<c.operators.length;d++){let p=c.operators[d];p.name===s.filter.operator&&(u=p.fn)}u&&r.push({field:s.field,valueGetter:s.valueGetter||c.valueGetter,fn:u,value:s.filter.value,emptyValues:c.emptyValues})}return t.set(e,r),r}function Tc(n,e){if(!n.length)return!0;let{data:t}=e,o={data:t,index:e.index,dataArray:e.dataArray,primaryKey:e.primaryKey,field:void 0,filterValue:void 0,currentValue:void 0,emptyValues:[]};for(let r=0,i=n.length;r<i;r++){let a=n[r];if(o.field=a.field,o.filterValue=a.value,o.currentValue=a.valueGetter?a.valueGetter(o):a.field?t[a.field]:t,o.emptyValues=a.emptyValues,!a.fn(o))return!1}return!0}var eR=0;function Cc(n){return eR++,Tc(Wa(n.filterValue,n.filterTypes),n)}function ja(n){return Wa(n.filterValue,n.filterTypes).length?n.isLeafNode?Cc(n):n.filterTreeNode(n.data):!0}var tR="group-by",Pg="group-by-";function xg(n){let e=n.map(t=>t.valueGetter?o=>t.valueGetter({data:o,field:t.field}):t.field??t.groupField).filter(Boolean);if(e.length)return e.length===1&&typeof e[0]!="function"?e[0]:e}function Ua(n,e){if(!n?.length||!e?.length)return n;let t=!1,o=n.map(r=>{if(r.field!=null||!r.id)return r;if(r.id===tR){let i=xg(e);return i==null?r:(t=!0,{...r,field:i})}if(r.id.startsWith(Pg)){let i=r.id.slice(Pg.length),a=e.find(s=>String(s.field)===i||s.groupField===i);if(!a)return r;let l=xg([a]);return l==null?r:(t=!0,{...r,field:l})}return r});return t?o:n}var Dg=!0,nR={originalDataArray:!0,changes:!0},oR={filterValue:(n,e)=>JSON.stringify(n)===JSON.stringify(e),groupRowsState:(n,e)=>JSON.stringify(n)===JSON.stringify(e)};function jt(n,e,t){let o=Ua(n.sortInfo,n.groupBy),r=n.multiSort?o:o?.[0]??null,i={append:!1,originalDataArray:n.originalDataArray,sortInfo:r,refetchKey:n.refetchKey,groupBy:n.groupBy,pivotBy:n.pivotBy,filterValue:n.filterValue,aggregationReducers:n.aggregationReducers};if(t&&(i.masterRowInfo=t.masterRowInfo),i.groupBy&&(i.groupRowsState=n.groupRowsState.getState()),n.livePagination!==void 0&&(i.livePaginationCursor=n.livePaginationCursor,i.__cursorId=n.cursorId),n.lazyLoad&&(n.lazyLoadBatchSize!=null&&n.lazyLoadBatchSize>0&&(i.lazyLoadBatchSize=n.lazyLoadBatchSize,i.lazyLoadStartIndex=0),i.groupKeys=[],n.selectionMode==="multi-row"&&(i.multiRowSelectionTarget=n.multiRowSelectionTarget)),e&&Object.assign(i,e),i.filterValue&&i.filterValue.length){let s=Ic(i.filterValue,{filterMode:n.filterMode,filterTypes:n.filterTypes});s&&s.length&&(i.filterValue=s)}let a={},l=n.dataParams||{};for(let s in i)if(i.hasOwnProperty(s)&&!nR[s]){let c=s,u=oR[c],d=i[c],p=l[c];(u?u(d,p):d===p)||(a[c]=!0)}return i.changes=a,i}function Tn(n,e,t,o,r){let i=jt(e,o,r),a=i.append;if(e.lazyLoad){let u=e.originalLazyGroupData,d=[wt,...i.groupKeys||[]],p=u.get(d);if(!p){let f=[...i.groupKeys||[],i.lazyLoadStartIndex??0];e.lazyLoadCacheOfLoadedBatches.set(f,!0)}if(p&&p.cache&&d.length>1){let f=p.children,m=f.length,g=!0;for(let h=0;h<m;h++)if(f[h]==null){g=!1;break}if(g)return Promise.resolve(!0)}p?p.childrenLoading||(p.childrenLoading=!0):u.set(d,{error:void 0,children:[],childrenLoading:!0,childrenAvailable:!1,cache:Dg,totalCount:0}),t.originalLazyGroupDataChangeDetect=Vt()}if(typeof n=="function")try{n=n(i)}catch(u){n=Promise.reject(u)}let s=typeof n=="object"&&typeof n.then=="function"&&(!e.lazyLoad||!a&&!i.groupKeys?.length);s&&(t.loading=!0);let c=u=>{if(console.error('The DataSource "data" function failed:',u),e.lazyLoad){let d=i.groupKeys||[],p=e.originalLazyGroupData.get([wt,...d]),f=u instanceof Error?u.message:String(u);if(d.length&&p&&!p.childrenAvailable)p.childrenLoading=!1,p.cache=!1,p.error=f,t.originalLazyGroupDataChangeDetect=Vt();else{let m=e.lazyLoadCacheOfLoadedBatches,g=[...d,i.lazyLoadStartIndex??0];m.has(g)&&m.set(g,"failed"),p&&(p.childrenLoading=!1,p.error=f)}}s&&(t.loading=!1)};return Promise.resolve(n).then(u=>{let d=[],p=!1;if(Array.isArray(u.data)){let m=u;if(d=m.data,m.livePaginationCursor!==void 0&&(t.livePaginationCursor=m.livePaginationCursor),m.mappings&&(t.pivotMappings=m.mappings),e.lazyLoad||(t.unfilteredCount=m.totalCountUnfiltered??d.length),e.lazyLoad){let h=function(S,y,C){let T=[wt,...S],I=y.data,b={cache:y.cache??Dg,childrenLoading:!1,childrenAvailable:!0,totalCount:y.totalCount??I.length,totalCountUnfiltered:y.totalCountUnfiltered,totalChildrenCount:y.totalChildrenCount,totalChildrenCountUnfiltered:y.totalChildrenCountUnfiltered,children:I,error:y.error},R=[];if(i.lazyLoadBatchSize&&!C){let v=g.get(T),P=!v,D=Jd({children:!0},v||{},b);P&&(D.chidren=[]),D.children.length=D.totalCount;let M=i.lazyLoadStartIndex??0,x=Math.min(y.totalCount??I.length,M+i.lazyLoadBatchSize);for(let E=M;E<x;E++){let z=b.children[E-M];if(!z)throw`lazily loaded item not found at index ${E-M}`;D.children[E]=z,z.dataset&&R.push({keys:z.keys,dataset:z.dataset})}P&&g.set(T,D)}else b.children.forEach(v=>{v&&v.dataset&&R.push({keys:v.keys,dataset:v.dataset})}),b.children.length=b.totalCount,g.set(T,b);let w=!1;if(!S||!S.length){let v=g.get([wt]);t.originalDataArray=[...v.children],w=!0}if(w||(t.originalLazyGroupDataChangeDetect=Vt()),R.length){let v=S;R.forEach(({keys:P,dataset:D})=>{h(P,D,v)})}};var f=h;let g=e.originalLazyGroupData;p=!0,h(i.groupKeys||[],m)}}else d=u;p||(t.originalDataArray=a?e.originalDataArray.concat(d):d),s&&(t.loading=!1)}).catch(c)}function Ic(n,{filterTypes:e,filterMode:t}){return t==="local"?!n||!n.some(o=>o.valueGetter)?n:n.map(Mg):(Ba(n,e)||[]).map(Mg)}function Mg(n){if(!n.valueGetter)return n;let e={...n};return delete e.valueGetter,e}function Eg(){let n;return(e,t,o)=>{if(n&&n.filterValue===e&&n.filterTypes===t&&n.filterMode===o)return n.result;let r=Ic(e,{filterTypes:t,filterMode:o});return n&&n.filterValue===e&&JSON.stringify(n.result)===JSON.stringify(r)&&(r=n.result),n={filterValue:e,filterTypes:t,filterMode:o,result:r},r}}var rR=()=>new Promise(n=>{He(n)});function Rc(n,e){let t=!!n,{stateReadyAsDetails:o}=e(),r=t&&n.shouldRestoreState?o:!0;return{isDetail:t,isDetailReady:r}}function Ag(n){let{lazyLoad:e,lazyLoadBatchSize:t,lazyLoadCacheOfLoadedBatches:o}=n;if(!e||!t||t<=0)return!1;for(let r of o.keys())if(r.length===1)return!0;return!1}function _g(n){for(let[e,t]of n.entries())t==="failed"&&n.delete(e)}function Og(n,e){let{startIndex:t,endIndex:o,lazyLoadBatchSize:r,componentState:i,componentActions:a,dismissLoadedRows:l}=n,{dataArray:s}=i,c=l?()=>!1:g=>s[g].data!=null,u=!l,d=new U,p=["_______xxx______"];for(let g=t;g<=o;g++){let h=s[g];if(!h)continue;let S=c(g),y=h.dataSourceHasGrouping&&h.groupKeys?[...h.groupKeys]:[];h.isGroupRow&&h.dataSourceHasGrouping&&h.groupKeys&&y.pop();let C=y.length?y:p,T=h.dataSourceHasGrouping?h.indexInGroup:h.indexInAll;if(h.isGroupRow&&!h.collapsed&&!h.childrenAvailable){let I={lazyLoadStartIndex:0,lazyLoadBatchSize:r,groupKeys:h.groupKeys,append:u},b=h.groupKeys,R=d.get(b);if(!R?.[h.id]){let w=!R;R=R||{},R[h.id]||(R[h.id]=I),w&&d.set(b,R)}}if(!S&&r!=null){let I=d.get(C),b=Math.floor(T/r)*r,R=T-b,w=s[h.indexInAll-R].indexInAll,v=c(w),P=s[w].id;if(v||I?.[P])continue;let D=!I;I=I||{};let M={lazyLoadStartIndex:b,lazyLoadBatchSize:r,groupKeys:y,append:u};I[P]||(I[P]=M),D&&d.set(C,I)}}let f=Promise.resolve(!0),m=[];d.topDownValues().forEach(g=>{m.push(...Object.values(g))}),m.reduce((g,h)=>{let S=[...h.groupKeys,h.lazyLoadStartIndex];if(e&&e.has(S))return g;e?.set(S,!0);let y=[i.data,i,a,h];return g.then(()=>rR()).then(()=>Tn(...y))},f)}function wc(n,e){let{rowIndex:t,primaryKey:o}=e,{dataArray:r}=n.getDataSourceState();if(o!==void 0){let i=n.dataSourceApi.getIndexByPrimaryKey(o);if(i!==-1)return i;if(r[t]?.id!==o)return-1}return r[t]?t:-1}function ai(n,e){let t=wc(n,e);return t===-1?null:tn({...n,rowIndex:t,columnId:e.columnId})}function li(n,e){console.warn(`Skipping "${n}": the edited row (primaryKey: ${String(e.primaryKey)}, rowIndex: ${e.rowIndex}) is no longer in the data array.`)}function vc(n){let{getComputed:e,getState:t,actions:o}=n,r=t().columnMenuVisibleForColumnId;if(!r)return;let i=e(),a=i.computedVisibleColumnsMap,l=i.computedColumnOrder;if(a.has(r)){o.columnMenuVisibleKey=Date.now();return}function s(f,m){let g=l[c+f*m],h=a.get(g);if(h&&h.renderMenuIcon!==!1)return g}let c=l.indexOf(r),u=0,d=-1,p;for(;!p&&u<l.length&&(u++,p=s(u,d),p||(d*=-1,p=s(u,d)),!p););return p&&(o.columnMenuVisibleForColumnId=p),p}function $a(n,e){let{rowIndex:t,colIndex:o}=n,{rowIndex:r,colIndex:i}=e,[a,l]=o>i?[i,o]:[o,i],[s,c]=t>r?[r,t]:[t,r];return[{rowIndex:s,colIndex:a},{rowIndex:c,colIndex:l}]}function Pc(n,e,t){let{rowsPerPage:o}=t;return o?Math.floor(n.rowIndex/o)===Math.floor(e.rowIndex/o):!0}function Fg(n,e,t){if(Pc(n,e,t))throw"You should not call this when the positions are in the same page";let{rowsPerPage:o,columnsPerSet:r}=t;if(o===0)throw"rowsPerPage cannot be 0";let i=n,a=e;Math.floor(n.rowIndex/o)>Math.floor(e.rowIndex/o)&&(i=e,a=n);let{rowIndex:l,colIndex:s}=i,{rowIndex:c,colIndex:u}=a,d=Math.floor(l/o),p=Math.floor(c/o),f=l%o,m=c%o,g=Math.min(f,m),h=Math.max(f,m),S=[];for(let y=d;y<=p;y++)for(let C=g;C<=h;C++){let T=y*o+C;if(y===d)for(let I=s;I<r;I++)S.push({rowIndex:T,colIndex:I});else if(y===p)for(let I=0;I<=u;I++)S.push({rowIndex:T,colIndex:I});else for(let I=0;I<r;I++)S.push({rowIndex:T,colIndex:I})}return S}function iR(n,e){let t=new Set(n);return e.map(o=>t.has(o)?o:null).filter(o=>o!=null)}var xc=class{constructor(e){this.getCellSelectionPosition=e=>{let t=e.rowId??Vn(e.rowIndex,this.getDataSourceState)?.id,o=e.colId??this.getComputed().computedVisibleColumns[e.colIndex].id;return[t,o]};this.setRangeSelected=(e,t,o)=>{let r=this.getDataSourceState(),i=r.cellSelection;if(!i)return;let a=new Ue(i);a.debugId=r.debugId??"";let[l,s]=this.getCellSelectionPosition(e),[c,u]=this.getCellSelectionPosition(t),d=this.getComputed().computedVisibleColumnsMap.get(s),p=this.getComputed().computedVisibleColumnsMap.get(u);if(!d||!p)return;let f=d.computedVisibleIndex,m=p.computedVisibleIndex,g=Vn(l,this.getDataSourceState),h=Vn(c,this.getDataSourceState);if(!g||!h)return;let S=g.indexInAll,y=h.indexInAll,[C,T]=$a({rowIndex:S,colIndex:f},{rowIndex:y,colIndex:m});for(let I=C.rowIndex;I<=T.rowIndex;I++)for(let b=C.colIndex;b<=T.colIndex;b++){let R={rowIndex:I,colIndex:b},[w,v]=this.getCellSelectionPosition(R);o?a.selectCell(w,v):a.deselectCell(w,v)}this.dataSourceActions.cellSelection=a};this.getCellSelectionPositionsWithFn=(e,t)=>{let o=ia(this.getDataSourceState),{computedVisibleColumns:r}=this.getComputed(),i=r.map(d=>d.id),a=new Set,l=[],s=new Set;o.filter(d=>{r.forEach(p=>{this.isCellSelected({rowId:d.id,colId:p.id})&&(a.has(p.id)||a.add(p.id),s.has(d.id)||(s.add(d.id),l.push(d)))})});let c=iR(Array.from(a),i),u=l.map(d=>c.map(p=>this.isCellSelected({rowId:d.id,colId:p})?e(d,p):t));return{columnIds:c,positions:u}};this.getAllCellSelectionPositions=()=>this.getCellSelectionPositionsWithFn((e,t)=>[e.id,t],null);this.mapCellSelectionPositions=(e,t)=>this.getCellSelectionPositionsWithFn(e,t);this.deselectAll=()=>{let e=this.getDataSourceState(),t=e.cellSelection;if(!t)return;let o=new Ue(t);o.debugId=e.debugId??"",o.deselectAll(),this.dataSourceActions.cellSelection=o};this.clear=()=>{this.deselectAll()};this.selectAll=()=>{let e=this.getDataSourceState(),t=e.cellSelection;if(!t)return;let o=new Ue(t);o.debugId=e.debugId??"",o.selectAll(),this.dataSourceActions.cellSelection=o};this.selectRange=(e,t)=>{this.setRangeSelected(e,t,!0)};this.deselectRange=(e,t)=>{this.setRangeSelected(e,t,!1)};this.isCellSelected=e=>{let[t,o]=this.getCellSelectionPosition(e);return this.getDataSourceState().cellSelection?.isCellSelected(t,o)??!1};this.selectCell=e=>{let t=this.getDataSourceState(),o=t.cellSelection;if(!o)return;let[r,i]=this.getCellSelectionPosition(e),a=e.clear?new Ue:new Ue(o);a.debugId=t.debugId??"",a.selectCell(r,i),this.dataSourceActions.cellSelection=a};this.deselectCell=e=>{let t=this.getDataSourceState(),o=t.cellSelection;if(!o)return;let[r,i]=this.getCellSelectionPosition(e),a=new Ue(o);a.debugId=t.debugId??"",a.deselectCell(r,i),this.dataSourceActions.cellSelection=a};this.selectColumn=(e,t)=>{t?.clear&&this.deselectAll();let o=this.getDataSourceState(),r=o.cellSelection;if(!r)return;let i=new Ue(r);i.debugId=o.debugId??"",i.selectColumn(e),this.dataSourceActions.cellSelection=i};this.deselectColumn=e=>{let t=this.getDataSourceState(),o=t.cellSelection;if(!o)return;let r=new Ue(o);r.debugId=t.debugId??"",r.deselectColumn(e),this.dataSourceActions.cellSelection=r};this.getComputed=e.getComputed,this.getDataSourceState=e.getDataSourceState,this.dataSourceActions=e.dataSourceActions}};function Ng(n){return new xc(n)}var dr=class{constructor(e){let t=e instanceof Object.getPrototypeOf(this).constructor?e.getState():e,o=this.getPositiveFromState(t),r=this.getNegativeFromState(t);this.update({negativeItems:r,positiveItems:o})}getInitialState(){return this.initialState}destroy(){this.positiveMap?.clear(),this.negativeMap?.clear(),delete this.positiveMap,delete this.negativeMap}update(e){let{positiveItems:t,negativeItems:o}=e;if(this.allNegative=o===!0,this.allPositive=t===!0,this.allNegative&&this.allPositive)throw"Cannot have both negativeItems and positiveItems be true!";if(o&&o!==!0){this.negativeMap||(this.negativeMap=new Map),this.negativeMap.clear();for(let r of o)this.negativeMap.set(r,!0);this.positiveMap&&this.positiveMap.clear()}if(t&&t!==!0){this.positiveMap||(this.positiveMap=new Map),this.positiveMap.clear();for(let r of t)this.positiveMap.set(r,!0);this.negativeMap&&this.negativeMap.clear()}}isDefaultNegativeSelection(){return this.allNegative}isDefaultPositiveSelection(){return this.allPositive}areAllNegative(){return this.allNegative&&(this.positiveMap?this.positiveMap.size===0:!0)}areAllPositive(){return this.allPositive&&(this.negativeMap?this.negativeMap.size===0:!0)}makeAllNegative(){this.update({negativeItems:!0,positiveItems:[]})}makeAllPositive(){this.update({positiveItems:!0,negativeItems:[]})}isItemPositive(e){if(this.allPositive===!0){if(this.allNegative===!0)throw'Cannot have both positiveItems and negativeItems be "true"';return!this.negativeMap?.has(e)}return!!this.positiveMap?.has(e)}isItemNegative(e){return!this.isItemPositive(e)}setItemValue(e,t){if(t!==this.isItemPositive(e)){if(t){if(this.allNegative===!0){if(!this.positiveMap)throw`No positiveMap found when trying to set item ${e} be positive`;this.positiveMap.set(e,!0)}else if(this.allPositive===!0){if(!this.negativeMap)throw`No negativeMap found when trying to set item ${e} be positive`;this.negativeMap.delete(e)}}else if(this.allPositive===!0){if(!this.negativeMap)throw`No negativeMap found when trying to set item ${e} be negative`;this.negativeMap.set(e,!0)}else if(this.allNegative===!0){if(!this.positiveMap)throw`No positiveMap found when trying to set item ${e} be negative`;this.positiveMap?.delete(e)}}}makeItemNegative(e){this.setItemValue(e,!1)}makeItemPositive(e){this.setItemValue(e,!0)}toggleItem(e){this.setItemValue(e,!this.isItemPositive(e))}};var At=class extends dr{constructor(t){super(t);this.isRowDetailsExpanded=t=>!!this.isItemPositive(t)}getState(){let t=this.allPositive?!0:[...this.positiveMap?.keys()??[]],o=this.allNegative?!0:[...this.negativeMap?.keys()??[]];return{expandedRows:t,collapsedRows:o}}getPositiveFromState(t){return t.expandedRows}getNegativeFromState(t){return t.collapsedRows}areAllCollapsed(){return this.areAllNegative()}areAllExpanded(){return this.areAllPositive()}collapseAll(){this.makeAllNegative()}expandAll(){this.makeAllPositive()}isRowDetailsCollapsed(t){return!this.isRowDetailsExpanded(t)}setRowDetailsExpanded(t,o){return this.setItemValue(t,o)}collapseRowDetails(t){this.setRowDetailsExpanded(t,!1)}expandRowDetails(t){this.setRowDetailsExpanded(t,!0)}toggleRowDetails(t){this.toggleItem(t)}};function Lg(n){let{dataSourceApi:e,getState:t,actions:o}=n,r={collapseAllDetails(){o.rowDetailState=new At({collapsedRows:!0,expandedRows:[]})},expandAllDetails(){o.rowDetailState=new At({expandedRows:!0,collapsedRows:[]})},isRowDetailCollapsed(i){let a=t().isRowDetailExpanded;if(!a)return!0;let l=e.getRowInfoByPrimaryKey(i);return l?!a(l):!0},isRowDetailEnabledForRow(i){let{isRowDetailEnabled:a}=t();if(!a)return!1;if(typeof a=="function"){let l=e.getRowInfoByPrimaryKey(i);return l?a(l):!1}return!0},isRowDetailExpanded(i){return!r.isRowDetailCollapsed(i)},collapseRowDetail(i){let a=t(),l=a.rowDetailState;if(!l){console.error("Cannot collapse row details via rowDetailState, as no props.rowDetailState is provided.");return}let s=new At(l);s.collapseRowDetails(i),a.lastRowToExpandRef.current=null,a.lastRowToCollapseRef.current=i,o.rowDetailState=s},expandRowDetail(i){let a=t(),l=a.rowDetailState;if(!l){console.error("Cannot expand row details via rowDetailState, as no props.rowDetailState is provided.");return}let s=new At(l);s.expandRowDetails(i),a.lastRowToCollapseRef.current=null,a.lastRowToExpandRef.current=i,o.rowDetailState=s},toggleRowDetail(i){r.isRowDetailExpanded(i)?r.collapseRowDetail(i):r.expandRowDetail(i)}};return r}function Yn(n,e,t){return Math.min(Math.max(n,e),t)}function Ya(n,e,t){let o=n().dataArray,r=0,i=o.length-1,a=e;do{a+=t;let l=o[a];if(!l)return a<r?r:i;if(!l.rowDisabled)return a}while(a>=r&&a<=i);return Yn(a,r,i)}function aR(n,e){let{getState:t,getDataSourceState:o,actions:r,api:i,dataSourceApi:a}=n,{key:l}=e,s=o().dataArray,c=s.length,u=t(),{brain:d}=u,{activeRowIndex:p}=u;if(p==null)return!1;let{start:[f],end:[m]}=d.getRenderRange(),g=p,h=m-f-1,S=0,y=c-1,C={ArrowDown:()=>{p=Ya(o,p,1)},ArrowUp:()=>{p=Ya(o,p,-1)},ArrowLeft:()=>{let I=s[p];if(d.isHorizontalLayoutBrain){let b=d.rowsPerPage;p-b>=S?p=p-b:C.ArrowUp();return}return I&&I.isGroupRow?i.collapseGroupRow(I.groupKeys):I&&i.rowDetailApi.isRowDetailEnabledForRow(I.id)?i.rowDetailApi.collapseRowDetail(I.id):!1},ArrowRight:()=>{let I=s[p];if(d.isHorizontalLayoutBrain){let b=d.rowsPerPage;p+b<=y?p=p+b:C.ArrowDown();return}return I&&I.isGroupRow?i.expandGroupRow(I.groupKeys):I&&i.rowDetailApi.isRowDetailEnabledForRow(I.id)?i.rowDetailApi.expandRowDetail(I.id):!1},Enter:()=>{let I=s[p];return I&&I.isGroupRow?i.toggleGroupRow(I.groupKeys):I&&I.isTreeNode&&I.isParentNode?a.treeApi.toggleNode(I.nodePath):i.rowDetailApi.isRowDetailEnabledForRow(I.id)?i.rowDetailApi.toggleRowDetail(I.id):!1},PageDown:()=>{p=Math.min(p+h,c-1)},PageUp:()=>{p=Math.max(p-h,S)},End:()=>{p=y},Home:()=>{p=S}},T=C[l];return T?(T(),g!==p?(r.activeRowIndex=p,!0):!1):!1}function Dc(n,e){let{api:t,getState:o,getComputed:r,getDataSourceState:i,dataSourceApi:a}=n,{key:l,shiftKey:s}=e,c=i().dataArray,u=o(),{activeCellIndex:d,brain:p}=u;if(!d)return!1;let[f,m]=d,{start:[g,h],end:[S,y]}=p.getRenderRange(),C=S-g-1,T=y-h-1,I=i().dataArray.length-1,b=r().computedVisibleColumns.length-1,R=0,w=0;f=Yn(f,0,I),m=Yn(m,0,b);let v={ArrowDown:()=>{f=Yn(f+1,R,I)},ArrowUp:()=>{f=Yn(f-1,R,I)},ArrowLeft:()=>{if(m===w)if(f!==R&&(m=b),p.isHorizontalLayoutBrain){let D=p.rowsPerPage;f-D>=R?f=f-D:v.ArrowUp()}else v.ArrowUp();else m=Yn(m-1,w,b)},ArrowRight:()=>{if(m===b)if(f!==I&&(m=w),p.isHorizontalLayoutBrain){let D=p.rowsPerPage;f+D<=I?f=f+D:v.ArrowDown()}else v.ArrowDown();else m=Yn(m+1,w,b)},Enter:()=>{let D=c[f];return D&&D.isGroupRow?t.toggleGroupRow(D.groupKeys):D&&D.isTreeNode&&D.isParentNode?a.treeApi.toggleNode(D.nodePath):D&&t.rowDetailApi.isRowDetailEnabledForRow(D.id)?t.rowDetailApi.toggleRowDetail(D.id):!1},PageDown:()=>{s?m=Math.min(m+T,b):f=Math.min(f+C,I)},PageUp:()=>{s?m=Math.max(m-T,w):f=Math.max(f-C,R)},End:()=>{s?m=b:f=I},Home:()=>{s?m=w:f=R}},P=v[l];return P?(P(),[f,m]):!1}function lR(n,e){let t=Dc(n,e);return t?(n.actions.activeCellIndex=t,!0):!1}var sR={ArrowUp:!0,ArrowDown:!0,ArrowLeft:!0,ArrowRight:!0,PageUp:!0,PageDown:!0,Home:!0,End:!0,Enter:!0," ":!0};function kg(n,e){let{key:t}=e,{getState:o}=n,r=o(),{activeRowIndex:i,activeCellIndex:a,keyboardNavigation:l,cellContextMenuVisibleFor:s,contextMenuVisibleFor:c}=r;return s||c||!sR[t]?!1:i!=null&&l==="row"?aR(n,e):a!=null&&l==="cell"?lR(n,e):!1}var Mc=class{constructor(e){this.param=e}setKeyboardNavigation(e){this.param.actions.keyboardNavigation=e}setActiveCellIndex(e){this.param.actions.activeCellIndex=e}setActiveRowIndex(e){this.param.actions.activeRowIndex=e}gotoRowWithDirection(e){let{getDataSourceState:t,getState:o}=this.param,{activeRowIndex:r,keyboardNavigation:i}=o();if(i!=="row")return console.error("Keyboard navigation is not enabled for rows"),!1;if(r==null)return!1;let a=Ya(t,r,e);return a!==r?(this.param.actions.activeRowIndex=a,a):!1}gotoRow(e){return this.gotoRowWithDirection(e)}gotoNextRow(){return this.gotoRow(1)}gotoPreviousRow(){return this.gotoRow(-1)}gotoCell(e){let{direction:t}=e,o=t=="top"?"ArrowUp":t=="bottom"?"ArrowDown":t=="left"?"ArrowLeft":"ArrowRight",r=Dc(this.param,{key:o,shiftKey:!1});return r===!1?!1:(this.param.actions.activeCellIndex=r,r)}};function zg(n){return new Mc(n)}function Vg(n,e){return n.id?n.id===e.id:!!(n.field&&n.field===e.field)}var Ec=class{constructor(e){this.columnApiById=new Map;this.getVisibleRenderRange=()=>this.getState().brain.getRenderRange();this.hideFilterOperatorMenu=()=>{this.actions.filterOperatorMenuVisibleForColumnId=null};this.setGroupRenderStrategy=e=>{this.actions.groupRenderStrategy=e};this.getColumnOrder=()=>this.getComputed().computedColumnOrder;this.getComputedColumnById=e=>this.getComputed().computedColumnsMap.get(e);this.getVisibleColumnOrder=()=>{let e=this.getColumnOrder(),t=this.getComputed().computedVisibleColumnsMap;return e.filter(o=>t.has(o))};this.persistEdit=async e=>{e=e??{};let{editingCell:t,editingValueRef:o}=this.getState();if(!t)return Promise.resolve(new Error("no edit in progress"));await new Promise(p=>requestAnimationFrame(p));let r=this.getComputed().computedColumnsMap.get(t.columnId),i=e.value??t.value;!t.active&&t.waiting!=="persist"&&(this.actions.editingCell={...t,active:!1,waiting:"persist"});let a=wc({...this.context,api:this},t);if(a===-1){let p=new Error(`Cannot persist edit: the edited row (primaryKey: ${String(t.primaryKey)}, rowIndex: ${t.rowIndex}) is no longer in the data array.`);return this.actions.editingCell={...t,active:!1,accepted:!1,waiting:!1,persisted:p},Promise.resolve(p)}let l={...tn({rowIndex:a,columnId:t.columnId,...this.context,api:this}),value:i,initialValue:t.initialValue},s=i;o.current=null,r.getValueToPersist&&(s=await r.getValueToPersist(l)),l.value=s,t.value=s;let c=this.getState().persistEdit??(()=>{if(!l.column.field)return i;let p=this.getDataSourceState().primaryKey,f=l.data&&typeof p=="string"?{[p]:l.data[p],[l.column.field]:s}:{...l.data,[l.column.field]:s};return this.context.dataSourceApi.updateData(f)}),u;try{u=await c(l)}catch(p){u=p}let d=u instanceof Error?u:!0;return this.actions.editingCell={...t,active:!1,accepted:!1,waiting:!1,persisted:d},Promise.resolve(d)};this.clearEditInfo=()=>{this.actions.editingCell=null};this.isEditInProgress=()=>{let{editingCell:e}=this.getState();return e?e.active:!1};this.isEditorVisibleForCell=e=>{let{rowIndex:t,columnId:o}=e,{dataArray:r}=this.getDataSourceState(),{editingCell:i}=this.getState(),a=r[t];return!a||!i?!1:i.columnId===o&&i.primaryKey===a.id&&!!(i.active||i.waiting)};this.confirmEdit=e=>this.stopEdit({value:e});this.stopEdit=async e=>{let t=this.getState(),{editingCell:o,editingValueRef:r}=t;if(!o)return!0;e||(e={});let i=e.value??r.current;if(!e.cancel&&!e.reject){let{rowIndex:a,columnId:l}=o;this.actions.editingCell={...t.editingCell,value:i,active:!1,waiting:"accept"};let{computedColumnsMap:s}=this.getComputed(),c=s.get(l),u=t.shouldAcceptEdit??c.shouldAcceptEdit,d=u?u({...tn({...this.context,api:this,dataSourceApi:this.context.dataSourceApi,columnId:l,rowIndex:a}),value:i,initialValue:o.initialValue}):!0;return await new Promise(p=>requestAnimationFrame(p)),Promise.resolve(d).then(p=>{if(p===!0)return this.actions.editingCell={...t.editingCell,active:!1,accepted:!0,persisted:!1,waiting:"persist",value:i},!0;throw p}).catch(p=>(p instanceof Error||(p=new Error(`Edit rejected: ${p}`)),this.actions.editingCell={...o,value:i,persisted:!1,active:!1,waiting:!1,accepted:p},{reject:p,value:i}))}return e.cancel&&o?.active?(this.actions.editingCell={...o,active:!1,cancelled:!0,waiting:!1,persisted:!1},{cancel:!0,value:i}):e.reject&&o?.active?(this.actions.editingCell={...o,value:i,active:!1,persisted:!1,waiting:!1,accepted:e.reject},{reject:e.reject,value:i}):!0};this.cancelEdit=()=>this.stopEdit({cancel:!0});this.rejectEdit=e=>this.stopEdit({reject:e});this.getColumnAtIndex=e=>this.getComputed().computedVisibleColumns[e]??null;this.isCellEditable=e=>{let{rowIndex:t,primaryKey:o,columnId:r}=e,i=t??this.context.dataSourceApi.getIndexByPrimaryKey(o),{computedColumnsMap:a}=this.getComputed(),l=a.get(r);if(!l||!l.computedEditable||l.groupByForColumn)return Promise.resolve(!1);let s=this.getDataSourceState().dataArray[i];if(!s||s.isGroupRow)return Promise.resolve(!1);if(l.computedEditable===!0)return Promise.resolve(!0);let c=l.computedEditable(tn({...this.context,api:this,columnId:r,rowIndex:i}));return typeof c=="boolean"?Promise.resolve(c):c};this.getColumnApi=e=>{let t=typeof e=="string"?e:this.getComputed().computedVisibleColumns[e]?.id,o=this.columnApiById.get(t);if(o)return o;let r=St(e,{...this.context,api:this});return r&&this.columnApiById.set(r.getColumnId(),r),r};this.isColumnSortable=e=>this.getColumnApi(e)?.isSortable()??!1;this.getCellValue=e=>this.getCellValues(e)?.value??null;this.getCellValues=e=>{let{rowIndex:t,primaryKey:o,columnId:r}=e,{dataSourceApi:i,getState:a}=this.context,{computedColumnsMap:l}=this.getComputed(),s=t??i.getIndexByPrimaryKey(o),c=l.get(r),u=i.getRowInfoByIndex(s),d=u?.id;if(!u||!c)return c||console.warn(`No column found with id: "${r}"`),u||console.warn(`No row found with index: "${s}" or primary key: "${d}"`),null;let p=this,{isRowDetailEnabled:f}=a(),m=!f||typeof f=="function"&&!f(u)?!1:this.rowDetailApi.isRowDetailExpanded(u.id)?"expanded":"collapsed",g=nr({column:c,rowInfo:u,columnsMap:l,context:{...this.context,api:p},rowDetailState:m});return{value:g.formattedValueContext.value,formattedValue:g.formattedValue,rawValue:g.formattedValueContext.rawValue}};this.getVerticalRenderRange=()=>{let e=this.getState().brain.getRenderRange();return{renderStartIndex:e.start[0],renderEndIndex:e.end[0]}};this.setColumnOrder=e=>{this.actions.columnOrder=e};this.setVisibilityForColumnGroup=(e,t)=>{let o={...this.getState().columnGroupVisibility};t?delete o[e]:o[e]=!1,this.actions.columnGroupVisibility=o};this.collapseAllGroupRows=()=>{let e=this.getDataSourceState(),t=new xt(e.groupRowsState);t.collapseAll(),this.dataSourceActions.groupRowsState=t};this.collapseGroupRow=e=>this.getDataSourceState().groupRowsState.isGroupRowExpanded(e)?(this.toggleGroupRow(e),!0):!1;this.expandGroupRow=e=>this.getDataSourceState().groupRowsState.isGroupRowCollapsed(e)?(this.toggleGroupRow(e),!0):!1;this.toggleGroupRow=e=>{let t=this.getDataSourceState(),o=new xt(t.groupRowsState);if(o.toggleGroupRow(e),this.dataSourceActions.groupRowsState=o,t.lazyLoad){let r=[wt,...e],i=t.originalLazyGroupData.get(r);o.isGroupRowExpanded(e)?i?.cache||Tn(t.data,t,this.dataSourceActions,{groupKeys:e},this.context.getDataSourceMasterContext()):i?.cache||(t.lazyLoadCacheOfLoadedBatches.getKeysStartingWith(e).forEach(l=>{t.lazyLoadCacheOfLoadedBatches.delete(l)}),this.dataSourceActions.lazyLoadCacheOfLoadedBatches=U.clone(t.lazyLoadCacheOfLoadedBatches),t.originalLazyGroupData.delete(r),this.dataSourceActions.originalLazyGroupDataChangeDetect=Vt())}};this.toggleSortingForColumn=(e,t)=>{if(!this.getComputed().computedColumnsMap.get(e))return;let r=this.getSortingForColumn(e);r===null?r=1:r=r===1?-1:null,this.setSortingForColumn(e,r,t)};this.getState=()=>this.context.getState();this.getComputed=()=>this.context.getComputed();this.getDataSourceState=()=>this.context.getDataSourceState();this.scrollCellIntoView=(e,t,o={offset:0})=>{let r=this.getState(),i=this.getComputed(),a=t;if(typeof t=="string"){let g=i.computedVisibleColumnsMap.get(t);if(!g)return!1;a=g.computedVisibleIndex}if(r.brain.isHorizontalLayoutBrain){o=o||{};let g=r.brain.getPageIndexForRow(e);o.horizontalLayoutPageIndex=g||0}let l=r.renderer.getScrollPositionForScrollColumnIntoView(a,o),s=r.renderer.getScrollPositionForScrollRowIntoView(e,o);if(!l||!s)return!1;let c={scrollLeft:l.scrollLeft,scrollTop:s.scrollTop},u=r.brain.getScrollPosition(),d=r.brain.scrollLeftMax,p=r.brain.scrollTopMax;if(d<0&&p<0)return!0;let f=c.scrollLeft>d+(o.offset||0),m=c.scrollTop>p+(o.offset||0);return f&&m?!1:(c.scrollLeft!==u.scrollLeft&&!f&&this.setNativeScroll({scrollLeft:c.scrollLeft}),c.scrollTop!==u.scrollTop&&!m&&this.setNativeScroll({scrollTop:c.scrollTop}),!0)};this.context=e,this.rowSelectionApi=yf({dataSourceActions:e.dataSourceActions,getDataSourceState:e.getDataSourceState}),this.keyboardNavigationApi=zg({getState:e.getState,getDataSourceState:e.getDataSourceState,actions:e.actions,getComputed:e.getComputed,api:this,dataSourceApi:e.dataSourceApi}),this.rowDetailApi=Lg({getState:e.getState,actions:e.actions,dataSourceApi:e.dataSourceApi}),this.cellSelectionApi=Ng({dataSourceActions:e.dataSourceActions,getDataSourceState:e.getDataSourceState,getComputed:e.getComputed})}get actions(){return this.context.actions}get dataSourceActions(){return this.context.dataSourceActions}get dataSourceApi(){return this.context.dataSourceApi}focus(){this.getState().scrollerDOMRef.current?.focus()}hideContextMenu(){this.actions.contextMenuVisibleFor=null,this.actions.cellContextMenuVisibleFor=null}realignColumnContextMenu(e){let t={actions:this.actions,getState:this.getState,getComputed:this.getComputed},o=this.getState().columnMenuRealignDelay;(!o||o<0)&&(vc(t),e?.()),setTimeout(()=>{this.isDestroyed()||(vc(t),e?.())},o)}isDestroyed(){return!this.getState().domRef.current}async startEdit(e){let{columnId:t,rowIndex:o,primaryKey:r,value:i}=e,a=o??this.context.dataSourceApi.getIndexByPrimaryKey(r);return this.isCellEditable({rowIndex:a,columnId:t}).then(async l=>{if(l){let s=this.getDataSourceState().dataArray,u=this.getComputed().computedColumnsMap.get(t),d=s[a],p=i??Pf({column:u,rowInfo:d}),f=p;u.getValueToEdit&&(p=await u.getValueToEdit(tn({...this.context,rowIndex:a,columnId:t,api:this}))),this.actions.editingCell={active:!0,accepted:!1,persisted:!1,columnId:t,value:p,initialValue:f,rowIndex:a,primaryKey:s[a]?.id}}return l})}setSortingForColumn(e,t,o){let{computedColumnsMap:r}=this.getComputed(),i=r.get(e);if(!i||this.getSortingForColumn(e)===t&&this.getDataSourceState().multiSort===!1)return;if(t===null){this.setSortInfoForColumn(e,null,o);return}let l=!!i.pivotColumn,s=i.groupByForColumn,c=l?void 0:i.field,u=s?Array.isArray(s)?s:[s]:[],d=u.map(m=>m.valueGetter?g=>m.valueGetter({data:g,field:m.field}):m.field?m.field:m.groupField??void 0).filter(An);d.length&&(c=d);let p=i.computedSortType;if(u.length&&p===pn){let m=this.getState().initialColumns;p=u.flatMap(h=>{let S=h.field??h.groupField,y=S?r.get(S):null;if(y)return y.computedSortType;let C=S?oo(m,S):void 0;return C?C.sortType||(typeof C.type=="string"?C.type:"string"):[pn]})}u.length&&!Array.isArray(p)&&(p=[p]);let f={dir:t,id:i.id,field:c,type:p};!l&&i.valueGetter&&(f.valueGetter=m=>i.valueGetter({data:m,field:i.field})),this.setSortInfoForColumn(e,f,o)}setSortInfoForColumn(e,t,o){let r=this.getDataSourceState(),i=this.getComputed().computedColumnsMap.get(e);if(!i)return;if(!r.multiSort){this.dataSourceApi.setSortInfo(t?[t]:null);return}let a=i.field,l={id:e,field:a},s=r.sortInfo?.slice()??[];if(t===null){s=s.filter(d=>!Vg(d,l)),this.dataSourceApi.setSortInfo(s);return}let c=!1;if((o?.multiSortBehavior??this.getState().multiSortBehavior)==="replace"){this.dataSourceApi.setSortInfo([t]);return}s=s.map(d=>c?d:Vg(d,l)?(c=!0,t):d),c||s.push(t),this.dataSourceApi.setSortInfo(s)}getSortTypeForColumn(e){let t=this.getComputed().computedColumnsMap.get(e);return t?t.computedSortType:null}getSortInfoForColumn(e){let t=this.getComputed().computedColumnsMap.get(e);return t?t.computedSortInfo:null}getSortingForColumn(e){let t=this.getSortInfoForColumn(e);return t?t.dir:null}setPinningForColumn(e,t){let o={...this.getState().columnPinning};t===!1?delete o[e]:o[e]=t,this.actions.columnPinning=o}setColumnFilter(e,t){let o=this.getComputed().computedColumnsMap.get(e);if(!o)return;let r=this.getDataSourceState(),{filterTypes:i}=r,a;if(o.computedFilterValue)a={...o.computedFilterValue,filter:{...o.computedFilterValue.filter}};else{let l=o.computedFilterType;if(!i[l])return;let s={filter:{type:l,value:t,operator:i[l].defaultOperator},valueGetter:o.valueGetter};(o.field||typeof o.groupByForColumn=="string")&&(s.field=o.field||o.groupByForColumn),a=s}a.id=o.id,a.filter.value=t,this.setFilterValueForColumn(e,a)}setColumnFilterOperator(e,t){let o=this.getComputed().computedColumnsMap.get(e);if(!o)return;let r=this.getDataSourceState(),{filterTypes:i}=r,a=o.computedFilterType,l=i[a].operators,s=l.find(d=>d.name===t)??l.find(d=>d.name===i[a].defaultOperator),c=s.name,u;o.computedFilterValue?(u={...o.computedFilterValue,filter:{...o.computedFilterValue.filter,operator:c}},s.defaultFilterValue!==void 0&&(u.filter.value=s.defaultFilterValue)):(u={filter:{operator:c,type:a,value:s.defaultFilterValue!==void 0?s.defaultFilterValue:[...i[a].emptyValues.values()][0]},valueGetter:o.valueGetter},o.field&&(u.field=o.field)),u.id=o.id,this.setFilterValueForColumn(e,u)}setFilterValueForColumn(e,t){let o=this.getComputed().computedColumnsMap.get(e);if(!o)return;let i=this.getDataSourceState().filterValue??[],a=!1;i=i.map(l=>l===o.computedFilterValue?(a=!0,t):l),a||i.push(t),this.dataSourceActions.filterValue=i}removeColumnFilter(e){let t=this.getComputed().computedColumnsMap.get(e);if(!t)return;let r=this.getDataSourceState().filterValue??[],i=!1;r=r.filter(a=>a===t.computedFilterValue?(i=!0,!1):!0),i&&(this.dataSourceActions.filterValue=r)}clearColumnFilter(e){let t=this.getComputed().computedColumnsMap.get(e);if(!t)return;let o=this.getDataSourceState(),r=o.filterValue??[],i=!1;r=r.map(a=>{if(a===t.computedFilterValue){let l=t.computedFilterValue.filter.type,s=o.operatorsByFilterType[l],c=o.filterTypes[l];if(i=!0,!c)return null;let u=a.filter.operator??c?.defaultOperator,p=s[u].defaultFilterValue??(c.emptyValues||[])[0]??void 0;return{...a,filter:{...a.filter,operator:u,value:p}}}return a}).filter(An),i&&(this.dataSourceActions.filterValue=r)}setVisibilityForColumn(e,t){let o={...this.getState().columnVisibility};t?delete o[e]:o[e]=!1,this.actions.columnVisibility=o}getVisibleColumnsCount(){return this.getComputed().computedVisibleColumns.length}setColumnVisibility(e){this.actions.columnVisibility=e}get scrollContainer(){return this.getState().scrollerDOMRef.current}setNativeScroll(e){let t=this.getState(),o=t.scrollerDOMRef.current;if(!o)return;let r=t.brain.toNativeScrollPosition({scrollTop:e.scrollTop??0,scrollLeft:e.scrollLeft??0});e.scrollTop!==void 0&&(o.scrollTop=r.scrollTop),e.scrollLeft!==void 0&&(o.scrollLeft=r.scrollLeft)}get scrollLeftMax(){return this.getState().brain.scrollLeftMax}get scrollTopMax(){return this.getState().brain.scrollTopMax}get scrollLeft(){return this.getState().brain.getScrollPosition().scrollLeft}set scrollLeft(e){this.setNativeScroll({scrollLeft:Math.max(e,0)})}get scrollTop(){return this.getState().brain.getScrollPosition().scrollTop}set scrollTop(e){this.setNativeScroll({scrollTop:Math.max(e,0)})}scrollRowIntoView(e,t={offset:0}){let o=this.getState(),r=this.getComputed(),i=o.brain.getScrollPosition(),a=t.columnId,l;!a&&o.brain.isHorizontalLayoutBrain&&r.computedVisibleColumns.length>0&&(a=r.computedVisibleColumns[Math.ceil(r.computedVisibleColumns.length/2)].id,l=r.computedVisibleColumnsMap.get(a)?.computedVisibleIndex);let s=o.renderer.getScrollPositionForScrollRowIntoView(e,{...t,colIndex:l});if(!s)return!1;let c=o.brain.scrollTopMax,u=s.scrollLeft!==i.scrollLeft,d=s.scrollTop<=c+(t.offset||0);return!d&&!u?!1:(d&&s.scrollTop!==i.scrollTop&&this.setNativeScroll({scrollTop:s.scrollTop}),u&&this.setNativeScroll({scrollLeft:s.scrollLeft}),!0)}scrollColumnIntoView(e,t={offset:0}){let o=this.getState(),i=this.getComputed().computedVisibleColumnsMap.get(e);if(!i)return!1;let a=i.computedVisibleIndex,l=o.renderer.getScrollPositionForScrollColumnIntoView(a,t);if(!l)return!1;let s=o.brain.getScrollPosition(),c=o.brain.scrollLeftMax;return l.scrollLeft>c+(t.offset||0)?!1:(l.scrollLeft!==s.scrollLeft&&this.setNativeScroll({scrollLeft:l.scrollLeft}),!0)}};function Gg(n){return new Ec(n)}var Io=require("react");var cR=10;function Hg(n,e){let{includeHeader:t,columnsToResize:o,columnsToSkip:r}=e,i=`.${mn} > .${Wr}`,a=n.current?.querySelectorAll(i),l={},s={};return a&&a.length&&a.forEach(c=>{let u=c.parentElement,d=u.matches(`.${so}`);if(t===!1&&d)return;let p=u.getAttribute("data-column-id"),f=c.cloneNode(!0);f.style.visibility="hidden",f.style.pointerEvents="none",f.classList.remove(...Ht.split(" ")),f.style.position="absolute",f.style.width="auto",u.appendChild(f);let m=f.offsetWidth;if(u.removeChild(f),!s[p]){let g=Fe().getComputedStyle(u);s[p]=parseInt(g.paddingLeft,10)+parseInt(g.paddingRight,10)+parseInt(g.borderLeftWidth,10)+parseInt(g.borderRightWidth,10)+cR}if(m+=s[p],d){let g=0;u.childNodes.forEach(h=>{if(h!==c&&h.nodeType===1){let S=h,y=Math.max(S.offsetWidth,parseInt(S.style.width,10));if(isNaN(y)&&(y=0),g+=y,y>0){let C=Fe().getComputedStyle(S);g+=parseInt(C.marginLeft,10)+parseInt(C.marginRight,10)}}}),m+=g}r&&r.has(p)||o&&!o.has(p)||(l[p]=Math.max(m,l[p]||0))}),l}function Kg(){let{getComponentState:n,componentActions:e,componentState:{domRef:t,ready:o,autoSizeColumnsKey:r,brain:i}}=zt(),[a,l]=(0,Io.useState)(0),s=typeof r=="object"?r.key:r,c=Le(s),u=(0,Io.useRef)(null);(0,Io.useEffect)(()=>{if(c()==null)return;let{current:p}=u,f=()=>{r!==p&&l(a+1)};return i.onRenderRangeChange(f)},[i]),(0,Io.useEffect)(()=>{if(s==null)return;let{autoSizeColumnsKey:d}=n(),p,f,m=!0;typeof d=="object"&&(d.columnsToResize&&(p=new Set(d.columnsToResize)),d.columnsToSkip&&(f=new Set(d.columnsToSkip)),m=d.includeHeader??m),u.current=s;let g=Hg(t,{includeHeader:m,columnsToResize:p,columnsToSkip:f}),h=Object.keys(g);if(!h.length)return;let S=n().columnSizing,y={...S},C=!1;h.forEach(T=>{y[T]={width:g[T]},C=C||y[T].width!==S[T]?.width}),C&&(e.columnSizing=y)},[s,o,a])}var Qn=require("react");var qa=class{constructor(e){this.multiSelectStartPosition={rowIndex:0,colIndex:0};this.getPrimaryKeyByIndex=e.getPrimaryKeyByIndex,this.getColumnIdByIndex=e.getColumnIdByIndex}getCellSelectionPosition(e){let{rowIndex:t,colIndex:o}=e,r=this.getPrimaryKeyByIndex(t),i=this.getColumnIdByIndex(o);if(!(r===void 0||!i))return[r,i]}set cellSelectionState(e){this._cellSelectionState=e}get cellSelectionState(){return this._cellSelectionState}resetClick(e){this.cellSelectionState.deselectAll();let t=this.getCellSelectionPosition(e);t&&(this.cellSelectionState.deselectAll(),this.cellSelectionState.selectCell(...t),this.multiSelectStartPosition=e,this.multiSelectEndPosition=void 0)}singleAddClick(e){let t=this.getCellSelectionPosition(e);if(t)if(this.cellSelectionState.isCellSelected(...t)){this.cellSelectionState.deselectCell(...t);let o={rowIndex:e.rowIndex+1,colIndex:e.colIndex};this.getCellSelectionPosition(o)&&(this.multiSelectStartPosition=o)}else this.cellSelectionState.selectCell(...t),this.multiSelectStartPosition=e,this.multiSelectEndPosition=void 0}multiSelectClick(e,t){!this.multiSelectStartPosition||!this.getCellSelectionPosition(e)||(this.multiSelectEndPosition&&this.deselectRange(this.multiSelectStartPosition,this.multiSelectEndPosition,t),this.selectRange(this.multiSelectStartPosition,e,t),this.multiSelectEndPosition=e)}setRangeSelected(e,t,o,r){if(r.horizontalLayout&&!Pc(e,t,r)){Fg(e,t,{rowsPerPage:r.rowsPerPage,columnsPerSet:r.columnsPerSet}).forEach(u=>{let d=this.getCellSelectionPosition({rowIndex:u.rowIndex,colIndex:u.colIndex});d&&(o?this.cellSelectionState.selectCell(...d):this.cellSelectionState.deselectCell(...d))});return}let[i,a]=$a(e,t),l=this.getCellSelectionPosition(i),s=this.getCellSelectionPosition(a);if(!(!l||!s))for(let c=i.rowIndex;c<=a.rowIndex;c++)for(let u=i.colIndex;u<=a.colIndex;u++){let d=this.getCellSelectionPosition({rowIndex:c,colIndex:u});d&&(o?this.cellSelectionState.selectCell(...d):this.cellSelectionState.deselectCell(...d))}}deselectRange(e,t,o){this.setRangeSelected(e,t,!1,o)}selectRange(e,t,o){this.setRangeSelected(e,t,!0,o)}};function uR(n,e){return n<e?[n,e]:[e,n]}var Xa=class{constructor(e){this.multiSelectStartIndex=0;this.getRowAt=e.getRowAt,this.isNodeSelectable=e.isNodeSelectable??(()=>!0)}set rowSelectionState(e){this._rowSelectionState=e,this._treeSelectionState=void 0}get rowSelectionState(){return this._rowSelectionState}set treeSelectionState(e){this._treeSelectionState=e}get treeSelectionState(){return this._treeSelectionState}deselectAll(){(this._treeSelectionState??this._rowSelectionState).deselectAll()}isContainerRow(e){return e.isGroupRow||!!e.isParentNode}isExpanded(e){return e.isGroupRow?!e.collapsed:!!e.nodeExpanded}getPath(e){if(e)return this._treeSelectionState?e.nodePath:this.getGroupKeys(e)}getGroupKeys(e){return e.groupKeys&&e.groupKeys.length?e.groupKeys:void 0}setSelectedAt(e,t){let o=this.getRowAt(e);if(!o||o.rowDisabled||o.selfLoaded===!1)return;let r=this._treeSelectionState;if(r){o.nodePath&&this.isNodeSelectable(o)&&r.setNodeSelection(o.nodePath,t);return}let i=this.rowSelectionState,a=this.getGroupKeys(o);if(o.isGroupRow){if(!a)return;t?i.selectGroupRow(a):i.deselectGroupRow(a);return}t?i.selectRow(o.id,a):i.deselectRow(o.id,a)}isSelectedAt(e){let t=this.getRowAt(e);if(!t)return!1;if(this._treeSelectionState)return t.nodePath?this._treeSelectionState.isNodeSelected(t.nodePath):!1;let o=this.getGroupKeys(t);return t.isGroupRow?o?this.rowSelectionState.isGroupRowSelected(o):!1:this.rowSelectionState.isRowSelected(t.id,o)}setRangeSelected(e,t,o){let[r,i]=uR(e,t);for(let a=r;a<=i;a++){let l=this.getRowAt(a);l&&(a!==e&&this.isFollowedByItsChildren(a,l)||this.setSelectedAt(a,o))}}isFollowedByItsChildren(e,t){if(!this.isContainerRow(t)||!this.isExpanded(t))return!1;let o=this.getPath(t),r=this.getPath(this.getRowAt(e+1));return!o||!r||r.length<o.length?!1:o.every((i,a)=>i===r[a])}resetClick(e){this.deselectAll(),this.setSelectedAt(e,!0),this.multiSelectStartIndex=e,this.multiSelectEndIndex=void 0}singleAddClick(e){if(this.isSelectedAt(e))this.setSelectedAt(e,!1),this.isSelectedAt(e+1)&&(this.multiSelectStartIndex=e+1);else{this.setSelectedAt(e,!0),this.multiSelectStartIndex=e;let t;for(let o=e-1;o>=0&&this.isSelectedAt(o);o--)t=o;this.multiSelectEndIndex=t}}multiSelectClick(e){this.multiSelectEndIndex!=null&&this.setRangeSelected(this.multiSelectStartIndex,this.multiSelectEndIndex,!1),this.setRangeSelected(this.multiSelectStartIndex,e,!0),this.multiSelectEndIndex=e}};var Fh=require("react");var Oh=H(require("react"));var dR=()=>{};function Bg(n,e){let t=new U,o=e.nodesKey??"children",r=e.emptyGroup??{},i=typeof e.pathKey=="function"?e.pathKey:l=>l[e.pathKey];for(let l of n){let s=i(l);for(let c=0;c<s.length;c++){let u=s.slice(0,c);t.has(u)||t.set(u,void 0)}t.set(s,l)}function a(l,s){let c=t.getKeysStartingWith(l,{excludeSelf:!0,depthLimit:1});for(let u of c){let d=[...l,u[u.length-1]],p=t.get(d),f=p?p[o]??[]:[];a(d,f),f.length&&(p||(p=typeof r=="function"?r(d,f):r),p[o]=f),s.push(p)}return s}return a([],[])}function Wg(n,e,t,o){let{isLeafNode:r,getNodeChildren:i,toKey:a}=n,{onParentNode:l,onNode:s,onLeafNode:c}=e,u=a(o),d=[...t,u],p=r(o),f=ht(()=>{let m=i(o);if(!(!m||!Array.isArray(m)))for(let g=0,h=m.length;g<h;g++){let S=m[g];Wg(n,e,d,S)}});p?(c?.(o),s?.(o,dR)):(l?.(o,f,i(o)),s?.(o,f))}function jg(n,e,t){for(let o=0,r=t.length;o<r;o++)Wg(n,e,[],t[o])}var Ug=new Uint8Array(new Uint32Array([1]).buffer)[0]===1;function $g(n,e,t){let o=n.length,r=new Float64Array(o);for(let p=0;p<o;p++){let f=e(n[p]);if(typeof f!="number"||f!==f)return!1;r[p]=(t<0?-f:f)+0}if(o<2)return!0;let i=new Uint32Array(r.buffer),a=Ug?0:1,l=Ug?1:0,s=new Uint32Array(8*256);for(let p=0;p<o;p++){let f=i[2*p+a],m=i[2*p+l];m&2147483648?(m=~m>>>0,f=~f>>>0,i[2*p+a]=f):m=(m|2147483648)>>>0,i[2*p+l]=m,s[f&255]++,s[256+(f>>>8&255)]++,s[512+(f>>>16&255)]++,s[768+(f>>>24)]++,s[1024+(m&255)]++,s[1280+(m>>>8&255)]++,s[1536+(m>>>16&255)]++,s[1792+(m>>>24)]++}let c=new Uint32Array(o),u=new Uint32Array(o);for(let p=0;p<o;p++)c[p]=p;for(let p=0;p<8;p++){let f=p<4?a:l,m=p%4*8,g=p*256;if(s[g+(i[f]>>>m&255)]===o)continue;let h=0;for(let y=0;y<256;y++){let C=s[g+y];s[g+y]=h,h+=C}for(let y=0;y<o;y++){let C=c[y],T=i[2*C+f]>>>m&255;u[s[g+T]++]=C}let S=c;c=u,u=S}let d=n.slice();for(let p=0;p<o;p++)n[p]=d[c[p]];return!0}var Ac=function(n,e){return n-e},pR=new Set(["ca","de","de-AT","en","en-DE","en-GB","en-US","fi","fr","id","id-ID","it","ms","nl","pl","pt","ro","sl","sv","sw","vi"]),Za;function fR(){try{let n=new Intl.Collator;return pR.has(n.resolvedOptions().locale)?null:n}catch{return null}}var mR=function(n,e){return n=`${n}`,e=`${e}`,Za===void 0&&(Za=fR()),Za?Za.compare(n,e):n.localeCompare(e)},gR=function(n,e){return n-e},hR={number:Ac,string:mR,date:gR},qn=hR;function Yg(n){return n.map(t=>Array.isArray(t.field)?t.field.map((o,r)=>{let i=Array.isArray(t.type)?t.type[r]??t.type[0]:t.type;return typeof o=="function"?{...t,valueGetter:o,field:void 0,type:i}:{...t,type:i,field:o}}):t).flat()}var Ut=(n,e,t)=>{let o=typeof t=="function"?t:t?.get,r=t&&typeof t=="object"?t.marker:void 0;r&&r.start();let i=Yg(n);return SR(i,e,o)||e.sort(qg(i,o)),r&&r.end(),e},Qa=(n,e,t)=>{let{marker:o}=t;o&&o.start();let r=qg(Yg(n),t.get),i=t.depthFirst??!1,a=t.inplace??!1;i||(a?e.sort(r):e=[...e].sort(r));let{nodesKey:l,toKey:s}=t,c=d=>d[l],u=d=>d[l]===void 0;return jg({isLeafNode:t.isLeafNode??u,getNodeChildren:t.getNodeChildren??c,toKey:s},{onParentNode:(d,p,f)=>{if(i&&p(),Array.isArray(f)){let m=a?f.sort(r):[...f].sort(r);d[l]=m}i||p()}},e),i&&(a?e.sort(r):e=[...e].sort(r)),o&&o.end(),e};Ut.knownTypes=qn;function SR(n,e,t){if(n.length!==1||e.length<1e3)return!1;let o=n[0];if(!o||o.fn||!o.type||o.dir!==1&&o.dir!==-1)return!1;let r=Array.isArray(o.type)?o.type[0]:o.type;if(Ut.knownTypes[r]!==Ac)return!1;let{field:i,valueGetter:a}=o;return $g(e,l=>(t&&(l=t(l)),a?a(l):i?l[i]:l),o.dir)}var bR=n=>{if(!n)return;let e=n.field,t=n.valueGetter,o=n.dir<0?-1:n.dir>0?1:0;if(!o)return;let r=n.fn;if(!r&&n.type){let i=Array.isArray(n.type)?n.type[0]:n.type;r=Ut.knownTypes[i],r||console.warn(`Unknown sort type "${n.type}" - please pass one of ${Object.keys(Ut.knownTypes).join(", ")}`)}return r||(r=qn.string),(i,a)=>{let l=t?t(i):e?i[e]:i,s=t?t(a):e?a[e]:a,c=r(l,s);return c===0?c:o*c}},TR=n=>n.map(bR).filter(e=>e instanceof Function),qg=(n,e)=>{let t=TR(n);return(o,r)=>{e&&(o=e(o),r=e(r));let i=0,a=0,l,s=t.length;for(;a<s;a++)if(l=t[a],!!l&&(i=l(o,r),i!==0))return i;return i}};var CR=H(require("react"));function Ja(n){return Ne(e=>n(e.dataSourceState))}var IR=Ye("IT:InfiniteTable"),RR="#dc3545",wR="#eb9316";var Zg="Warn",Qg="Error",vR="Info",PR="Success",xR="Logs",el=IR.extend(xR),kV=el.extend(vR),DR=el.extend(Zg),MR=el.extend(Qg),zV=el.extend(PR);var ER=wR,AR=RR;var _R=(n,e)=>{e=e?e.extend?e.extend(Zg):e:DR,e(typeof e.color=="function"?e.color(ER,n):n)},OR=(n,e)=>{e=e?e.extend?e.extend(Qg):e:MR,e(typeof e.color=="function"?e.color(AR,n):n)};var Xg=new U,Jg=(n,...e)=>{Xg.has(e)||(Xg.set(e,!0),n())};var eh=(n,e=n,t)=>{Jg(()=>_R(n,t),e,"warn")},th=(n,e=n,t)=>{Jg(()=>OR(n,t),e,"error")};var _c=new WeakMap,FR=n=>n;function nh(n,e=50,t){_c.set(n,{lastCallTime:0,lastCallArg:null});let o=t??FR;return r=>{let{lastCallTime:i,lastCallArg:a}=_c.get(n)||{lastCallTime:0,lastCallArg:null},l=Date.now(),s=l-i,c=Rt(o(a),o(r));s<e&&c||(_c.set(n,{lastCallTime:l,lastCallArg:r}),n(r))}}var tl=class{constructor(){this.primaryKeyToData=new Map;this.nodePathsToData=new U;this.removeNodePath=(e,t)=>{if(this.nodePathsToData.delete(e),this.remove(e[e.length-1]),!t)return;let o=this.nodePathsToData.get(e);if(o){let r=t.getNodeChildren?t.getNodeChildren(o):t.nodesKey?o[t.nodesKey]:null;if(r&&Array.isArray(r))for(let i=0,a=r.length;i<a;i++){let l=r[i],s=[...e,t.toPrimaryKey(l)];this.removeNodePath(s,t)}}};this.remove=e=>{this.primaryKeyToData.delete(e)};this.add=(e,t)=>{this.primaryKeyToData.set(e,t)};this.addNodePath=(e,t,o)=>{if(this.nodePathsToData.set(e,t),this.add(e[e.length-1],t),!o)return;let r=o.getNodeChildren?o.getNodeChildren(t):o.nodesKey?t[o.nodesKey]:null;if(r&&Array.isArray(r))for(let i=0,a=r.length;i<a;i++){let l=r[i],s=[...e,o.toPrimaryKey(l)];this.addNodePath(s,l,o)}};this.clear=()=>{this.primaryKeyToData.clear(),this.nodePathsToData.clear()};this.getDataForPrimaryKey=e=>this.primaryKeyToData.get(e);this.getDataForNodePath=e=>this.nodePathsToData.get(e);this.indexArray=(e,t)=>{let{cache:o,toPrimaryKey:r,getNodeChildren:i,isLeafNode:a,nodesKey:l}=t,s=!!i&&!!a;o&&o.shouldResetDataSource()&&(this.clear(),e=[]);let c=o&&!o.isEmpty();if(c&&(e=e.concat()),!e.length&&o){if(!o.isEmpty()){let u=[...o.getMutationsArray(),...o.getTreeMutationsArray()];for(let d=0,p=u.length;d<p;d++){let f=u[d];if(f.type==="insert"){let m=r(f.data);s?this.addNodePath([m],f.data,t):this.add(m,f.data),e.push(f.data)}}o?.removeInfo(void 0)}}else{let u=(d,p)=>{for(let f=0;f<d.length;f++){let m=d[f];c&&s&&Array.isArray(m[l])&&(m=d[f]={...m});let g=!1;if(m!=null){let h=r(m),S=s?[...p,h]:void 0,y=s&&!!S,C=y?o?.getMutationsForNodePath(S):o?.getMutationsForPrimaryKey(h);if(C&&C.length){for(let T=0,I=C.length;T<I;T++){let b=C[T];if(b.type==="delete"&&!g&&(y?this.removeNodePath(S,t):this.remove(h),g=!0,d.splice(f,1),f--),b.type==="update"&&!g&&(m={...m,...b.data},d[f]=m),b.type==="update-children"&&!g){let R=b.children(m[l],m);m={...m},R!==void 0?m[l]=R:delete m[l],d[f]=m}b.type==="insert"&&(b.position==="before"?(d.splice(f,0,b.data),f--):d.splice(f+1,0,b.data))}y?o?.removeNodePathInfo(S):o?.removeInfo(h)}if(!g)if(y){this.addNodePath(S,m);let T=a(m),I=T?null:i(m);!T&&Array.isArray(I)&&(p.push(h),c&&(m[l]=I=I.concat()),u(I,p),p.pop())}else this.add(h,m)}}};u(e,[])}return e}}};var NR=Object.freeze([]),oh=(n,e)=>{let t=n??NR,o=Array.isArray(t)?t:[t];if(e&&e.has(t)){let r=e.get(t);if(r&&r.length===o.length)return r}return e&&t&&e.set(t,o),o};var Dt=class extends dr{constructor(t){super(t);this.isRowEnabled=t=>!!this.isItemPositive(t)}getState(){let t=this.allPositive?!0:[...this.positiveMap?.keys()??[]],o=this.allNegative?!0:[...this.negativeMap?.keys()??[]];return{enabledRows:t,disabledRows:o}}getPositiveFromState(t){return t.enabledRows}getNegativeFromState(t){return t.disabledRows}areAllDisabled(){return this.areAllNegative()}areAllEnabled(){return this.areAllPositive()}disableAll(){this.makeAllNegative()}enableAll(){this.makeAllPositive()}isRowDisabled(t){return!this.isRowEnabled(t)}setRowEnabled(t,o){return this.setItemValue(t,o)}disableRow(t){this.setRowEnabled(t,!1)}enableRow(t){this.setRowEnabled(t,!0)}toggleRow(t){this.toggleItem(t)}};function nl(n,e){if(n===e)return!0;if(n==null||e==null)return n===e;if(typeof n!=typeof e)return!1;if(n instanceof Date||e instanceof Date)return n instanceof Date&&e instanceof Date&&n.getTime()===e.getTime();if(Array.isArray(n)&&Array.isArray(e)){if(n.length!==e.length)return!1;for(let t=0,o=n.length;t<o;t++)if(!nl(n[t],e[t]))return!1;return!0}if(typeof n=="object"){let t=Object.keys(n),o=Object.keys(e);if(t.length!==o.length)return!1;for(let r of t)if(!Object.prototype.hasOwnProperty.call(e,r)||!nl(n[r],e[r]))return!1;return!0}return!1}function LR(n,e){return!(n===void 0||e===void 0||n.isGroupRow!==e.isGroupRow||n.dataSourceHasGrouping!==e.dataSourceHasGrouping||n.isTreeNode!==e.isTreeNode||n.isTreeNode&&n.isParentNode!==e.isParentNode)}var ol={id:!0,value:!0,indexInAll:!0,rowSelected:!0,rowDisabled:!0,isCellSelected:!1,hasSelectedCells:!1},rh={...ol,dataSourceHasGrouping:!0,isTreeNode:!0,data:!1,isGroupRow:!0,selfLoaded:!0},kR={indexInGroup:!0,groupKeys:!0,groupBy:!0,rootGroupBy:!0,parents:!1,indexInParentGroups:!0,groupCount:!0,groupNesting:!0,collapsed:!0,selfLoaded:!0},zR={...ol,...kR,dataSourceHasGrouping:!0,isTreeNode:!0,data:!1,reducerData:!0,isGroupRow:!0,duplicateOf:!1,deepRowInfoArray:!1,error:!0,reducerResults:!0,groupCount:!0,groupData:!0,selectedChildredCount:!0,deselectedChildredCount:!0,totalChildrenCount:!0,collapsedChildrenCount:!0,collapsedGroupsCount:!0,directChildrenCount:!0,directChildrenLoadedCount:!0,pivotValuesMap:!0,childrenAvailable:!0,childrenLoading:!0},ih={isTreeNode:!0,isParentNode:!0,indexInParent:!0,nodePath:!0,parentNodes:!1,indexInParentNodes:!0,totalLeafNodesCount:!0,collapsedLeafNodesCount:!0,treeNesting:!0,selfLoaded:!0},VR={...ol,...ih,dataSourceHasGrouping:!0,isTreeNode:!0,isGroupRow:!0,isParentNode:!0,data:!1},GR={...ol,...ih,dataSourceHasGrouping:!0,isParentNode:!0,isGroupRow:!0,nodeExpanded:!0,selfExpanded:!0,data:!1,selectedLeafNodesCount:!0,deepRowInfoArray:!1,deselectedLeafNodesCount:!0,duplicateOf:!1},HR=Object.entries(rh).map(([n,e])=>e?n:void 0).filter(Boolean),KR=Object.entries(rh).map(([n,e])=>e?n:void 0),BR=Object.entries(zR).map(([n,e])=>e?n:void 0),WR=Object.entries(VR).map(([n,e])=>e?n:void 0),jR=Object.entries(GR).map(([n,e])=>e?n:void 0);function UR(n,e){if(n===e)return!0;if(!n||!e||!LR(n,e)||n.id!==e.id||n.data!==e.data&&!nl(n.data,e.data))return!1;let t=[];n.dataSourceHasGrouping?t=n.isGroupRow?BR:KR:n.isTreeNode?t=n.isTreeNode&&n.isParentNode?jR:WR:t=HR;for(let o of t){let r=n[o],i=e[o];if(!(typeof r=="function"||typeof i=="function")&&!nl(r,i))return!1}return!0}function ah(){let n=[],e=new Map,t=new Set,o={dataSourceState:void 0,previousDataSourceState:void 0},r=(p,f)=>{let m=n,g=f?.marker,S=p!==m&&t.size>0;S&&(o={dataSourceState:f?.dataSourceState,previousDataSourceState:f?.previousDataSourceState}),g&&g.start({details:[{name:"new dataArray length",value:p.length},{name:"old dataArray length",value:m.length}]});let y=[],C=l();for(let T of C){let I=m[T],b=p[T];if(b===void 0){y.push(T);continue}UR(I,b)||y.push(T)}n=p,(y.length>0||S)&&queueMicrotask(()=>{for(let T=0,I=y.length;T<I;T++){let b=y[T],R=e.get(b);if(R)for(let w of R)w()}if(S)for(let T of Array.from(t))T()}),g&&g.end({details:[{name:"updated row infos",value:y.length}]})},i=p=>n[p],a=(p,f)=>{let m=e.get(p);return m||(m=new Set,e.set(p,m)),m.add(f),()=>{let g=e.get(p);g&&(g.delete(f),g.size===0&&e.delete(p))}},l=()=>Array.from(e.keys());return{notifyDataArray:r,getRowInfoAtIndex:i,subscribeToRowIndex:a,subscribeToDataArrayChange:p=>(t.add(p),()=>{t.delete(p),t.size===0&&(o={dataSourceState:void 0,previousDataSourceState:void 0})}),getDataSourceStates:()=>o,getDataArray:()=>n,clear:()=>{n=[],e.clear(),t.clear(),o={dataSourceState:void 0,previousDataSourceState:void 0}}}}var Cn=new Map,In=new Map,Xn=new Map,Rn=new Map,rn=new Map;var $R=Symbol("cursorId"),lh=n=>n.totalLeafNodesCount===0,YR=n=>n.isParentNode?!lh(n):!0;function sh(n){let e=Date.now(),t=[],o=[],r=new U;return{logger:Lt(`${n.debugId}:DataSource`),debugTimings:new Map,debugWarnings:new Map,devToolsDetected:!!globalThis.__INFINITE_TABLE_DEVTOOLS_HOOK__,rowInfoStore:ah(),indexer:new tl,totalLeafNodesCount:0,__apiRef:{current:null},repeatWrappedGroupRows:!1,destroyedRef:{current:!1},lastSelectionUpdatedNodePathRef:{current:null},lastExpandStateInfoRef:{current:{state:"collapsed",nodePath:null}},idToIndexMap:new Map,idToPathMap:new Map,pathToIndexMap:new U,waitForNodePathPromises:new U,getDataSourceMasterContextRef:{current:()=>{}},cache:void 0,detailDataSourcesStateToRestore:new Map,stateReadyAsDetails:!1,originalDataArrayChanged:!1,originalDataArrayChangedInfo:{timestamp:0,mutations:void 0},rowsPerPage:null,lazyLoadCacheOfLoadedBatches:new U,dataParams:void 0,onCleanup:Se(),notifyScrollbarsChange:Se(),notifyScrollStop:Se(),notifyRenderRangeChange:Se(),pivotTotalColumnPosition:"end",pivotGrandTotalColumnPosition:!1,scrollStopDelayUpdatedByTable:100,originalLazyGroupData:r,originalLazyGroupDataChangeDetect:0,originalDataArray:t,cursorId:$R,showSeparatePivotColumnForSingleAggregation:!1,propsCache:new Map([["sortInfo",new WeakMap],["rowDisabledState",new WeakMap],["isRowDisabled",new WeakMap],["cellSelection",new WeakMap],["treeSelection",new WeakMap],["treeExpandState",new WeakMap],["groupRowsState",new WeakMap]]),rowInfoReducerResults:void 0,pivotMappings:void 0,pivotColumns:void 0,pivotColumnGroups:void 0,dataArray:o,unfilteredCount:o.length,filteredCount:o.length,updatedAt:e,groupedAt:0,sortedAt:0,treeAt:0,filteredAt:0,reducedAt:e,generateGroupRows:!0,groupDeepMap:void 0,reducerResults:void 0,allRowsSelected:!1,someRowsSelected:!1,postSortDataArray:void 0,postGroupDataArray:void 0,lastSortDataArray:void 0,lastGroupDataArray:void 0,forceRerenderTimestamp:0}}function qR(n){let e={...n};return delete e.originalDataArray,e}var XR=[],ch=n=>{n.destroyedRef.current=!0,n.__apiRef.current=null,n.lastSelectionUpdatedNodePathRef.current=null,n.lastExpandStateInfoRef.current={state:"collapsed",nodePath:null},n.treeExpandState?.destroy(),n.treePaths?.clear(),n.unfilteredTreePaths?.clear(),n.waitForNodePathPromises.clear(),n.pathToIndexMap?.clear(),n.rowDisabledState?.destroy(),n.groupRowsState?.destroy(),n.treeSelectionState?.destroy(),n.idToPathMap.clear(),n.idToIndexMap.clear(),n.rowInfoStore.clear()},uh=(n,e)=>({onDataParamsChange:t=>t?nh(t,100,qR):void 0,lazyLoad:t=>!!t,isNodeReadOnly:t=>t??lh,isNodeSelectable:t=>t??YR,data:1,nodesKey:1,isNodeExpanded:1,isNodeCollapsed:1,pivotBy:1,primaryKey:1,livePagination:1,treeSelection:1,refetchKey:t=>t??"",filterFunction:1,treeFilterFunction:1,filterValue:1,useGroupKeysForMultiRowSelection:t=>t??!1,multiRowSelectionTarget:t=>t??"all",filterDelay:t=>t??200,filterTypes:t=>({...Nn,...t}),sortTypes:t=>({...qn,...t}),sortFunction:1,onReady:1,rowInfoReducers:(t,o)=>{let r={initialValue:()=>{o.idToIndexMap.clear()},reducer:(a,l)=>{e.debugId&&!e.nodesKey&&o.idToIndexMap.has(l.id)&&console.warn(`Duplicate id found in data source: ${l.id}`),o.idToIndexMap.set(l.id,l.indexInAll)}},i=t?{...t,__idToIndex:r}:{__idToIndex:r};if(e.nodesKey){let a={initialValue:()=>{o.idToPathMap.clear(),o.pathToIndexMap.clear()},reducer:(l,s)=>{s.isTreeNode&&(o.idToPathMap.set(s.id,s.nodePath),e.debugId&&o.pathToIndexMap.has(s.nodePath)&&console.warn(`Duplicate node path found in data source (debugId: ${e.debugId||"none"}): ${s.nodePath}`),o.pathToIndexMap.set(s.nodePath,s.indexInAll))}};i.__pathToIndex=a}return i},onNodeCollapse:1,onNodeExpand:1,batchOperationDelay:1,isRowSelected:1,isNodeSelected:1,isRowDisabled:1,rowDisabledState:t=>{if(!t)return null;if(t instanceof Dt)return t;let o=n.propsCache.get("rowDisabledState"),r=o.get(t);return r||(r=new Dt(t),o.set(t,r)),t=r,t??null},onDataArrayChange:1,onDataMutations:1,onTreeDataMutations:1,aggregationReducers:1,collapseGroupRowsOnDataFunctionChange:t=>t??!0,loading:t=>t??!1,sortInfo:t=>oh(t,n.propsCache.get("sortInfo")),groupBy:t=>t??XR});function ZR(n,e){return typeof n=="function"?n({array:e.originalDataArray,length:e.originalDataArray.length,lastItem:e.originalDataArray[e.originalDataArray.length-1]}):n}function QR(n){if(typeof n=="boolean")return{filterValue:n,sortInfo:n,groupBy:n,pivotBy:n};let e={};return n.filterValue!=null&&(e.filterValue=n.filterValue),n.sortInfo!=null&&(e.sortInfo=n.sortInfo),n.groupBy!=null&&(e.groupBy=n.groupBy),n.pivotBy!=null&&(e.pivotBy=n.pivotBy),e}var JR={selectedPaths:[],deselectedPaths:[],defaultSelection:!1};function dh(n,e,t){if(e!="multi-row")throw new Error(`TreeSelectionState is only supported for multi-row selection. Your current selection mode is "${e}". See https://infinite-table.com/docs/reference/datasource-props#selectionMode for details.
2
2
 
3
3
 
4
- `);let n=er(t);if(o instanceof Je)return o.setConfig(n),o;(o==null||typeof o!="object")&&(o=void 0);let r=o??yI,i=t.propsCache.get("treeSelection"),a=i.get(r);return a&&a.setConfig(n),a=a??new Je(r,n),i.set(r,a),a}function ch(o){let{props:e,state:t,oldState:n}=o,r=!!t.nodesKey,i=_r(e.sortInfo),a=_r(e.filterValue),{filterTypes:l}=t,s=Object.keys(l).reduce((D,x)=>{let A=l[x].operators;D[x]=D[x]||{};let O=D[x];return A.forEach(F=>{O[F.name]=F}),D},{}),c=e,u=e.selectionMode;if(u===void 0)if(e.cellSelection!==void 0||e.defaultCellSelection!==void 0)u="multi-cell";else{let D=e.rowSelection!==void 0?e.rowSelection:e.defaultRowSelection;if(D!==void 0&&(D&&typeof D=="object"?u="multi-row":u="single-row"),!u){let x=c.treeSelection??c.defaultTreeSelection;x!==void 0&&(u=typeof x=="object"?"multi-row":"single-row")}u=u??!1}let d=null,p=null,f=e.rowSelection!==void 0?e.rowSelection:t.rowSelection===void 0?e.defaultRowSelection!==void 0?e.defaultRowSelection:null:t.rowSelection,m=e.cellSelection!==void 0?e.cellSelection:t.cellSelection===void 0?e.defaultCellSelection!==void 0?e.defaultCellSelection:null:t.cellSelection||null;if(!r&&(u!==!1&&(u==="single-row"||u==="multi-row")&&(f===null?d=u==="single-row"?null:new Oe({selectedRows:[],deselectedRows:[],defaultSelection:!1},mt(t)):u==="single-row"||f instanceof Oe?d=f:d=new Oe(f,mt(t))),u==="single-cell"||u==="multi-cell"))if(m===null)p=u==="single-cell"?null:new Ue;else if(m instanceof Ue)p=m;else{let D=t.propsCache.get("cellSelection"),x=D.get(m)??new Ue(m);D.set(m,x),p=x}let g=t.primaryKey,h=typeof g=="function"?D=>g(D):D=>D[g],S=c.treeExpandState||t.treeExpandState||c.defaultTreeExpandState;if(S&&!(S instanceof ft)){let D=t.propsCache.get("treeExpandState"),x=D.get(S)??new ft(S);D.set(S,x),S=x}S=S||new ft({defaultExpanded:!0,collapsedPaths:[]});let y=e.groupRowsState||t.groupRowsState||e.defaultGroupRowsState;if(y&&!(y instanceof xt)){let D=t.propsCache.get("groupRowsState"),x=D.get(y)??new xt(y);D.set(y,x),y=x}y=y||new xt(t.lazyLoad?{expandedRows:[],collapsedRows:!0}:{expandedRows:!0,collapsedRows:[]});let T=hI(e.shouldReloadData||{}),b=typeof e.data=="function"&&!!e.lazyLoad,R=!!e.livePagination,C={sortInfo:T.sortInfo??(b||R),filterValue:T.filterValue??(b||R),groupBy:T.groupBy??b,pivotBy:T.pivotBy??b},I=e.sortFunction?"local":C.sortInfo?"remote":"local",v=(typeof e.filterFunction=="function"||typeof e.treeFilterFunction=="function")&&!e.lazyLoad?"local":C.filterValue||e.lazyLoad?"remote":"local",P=t.rowDisabledState,E=e.isRowDisabled;if(!E&&P){let D=t.propsCache.get("isRowDisabled"),x=D.get(P);x?E=x:(E=A=>P.isRowDisabled(A.id),D.set(P,E))}let M={debugId:t.debugId??e.debugId,isTree:r,selectionMode:u,groupRowsState:y,treeExpandState:S,treeExpandMode:S.mode,shouldReloadData:C,isRowDisabled:E,rowSelection:d,cellSelection:p,sortMode:I,filterMode:v,toPrimaryKey:h,operatorsByFilterType:s,controlledSort:i,controlledFilter:a,multiSort:Array.isArray(i?e.sortInfo:e.defaultSortInfo),lazyLoadBatchSize:typeof e.lazyLoad=="object"?e.lazyLoad.batchSize:void 0};if(e.livePagination){let D=!n||n.originalDataArray!==t.originalDataArray,x=typeof e.livePaginationCursor=="function"?D?gI(e.livePaginationCursor,t):t.livePaginationCursor:e.livePaginationCursor;M.livePaginationCursor=x}if(t.devToolsDetected&&t.debugId){let D=Ro.get(t.debugId);D&&(M={...M,...D})}return M}var SI=Lt("DataSource:fullLazyLoad");function uh(o,e,t){let{name:n,newValue:r}=o;n==="data"&&typeof r=="function"&&!e.groupRowsState&&(e.lazyLoad&&SI('"data" function prop has changed'),e.collapseGroupRowsOnDataFunctionChange!==!1&&(t.groupRowsState=new xt({collapsedRows:!0,expandedRows:[]})))}function dh(){return{rowSelection:(o,e)=>e.selectionMode==="single-row"?{callbackParams:[o,"single-row"]}:{callbackParams:[o.getState(),"multi-row"]},treeSelection:(o,e)=>{if(e.selectionMode==="single-row")return{callbackParams:[o,{selectionMode:"single-row"}]};let t=e.__apiRef.current,n=t.treeApi;return{callbackParams:[o.getState(),{treeSelectionState:o,prevTreeSelectionState:e.treeSelectionState,selectionMode:"multi-row",lastUpdatedNodeInfo:e.lastSelectionUpdatedNodePathRef.current,unfilteredTreePaths:e.unfilteredTreePaths,dataSourceApi:t,treeApi:n}]}},treeExpandState:(o,e)=>({callbackParams:[o.getState(),{nodeState:e.lastExpandStateInfoRef.current.state,nodePath:e.lastExpandStateInfoRef.current.nodePath,dataSourceApi:e.__apiRef.current}]}),cellSelection:(o,e)=>e.selectionMode==="single-cell"?{callbackParams:[o instanceof Ue?o.getState().selectedCells:null,"single-cell"]}:{callbackParams:[o.getState(),"multi-cell"]}}}function ph(){return{sortInfo:(o,{actions:e,state:t})=>{let n=t.getDataSourceMasterContextRef.current,r=jt(t,{sortInfo:o,livePaginationCursor:null},n());e.dataParams=r,t.livePagination&&He(()=>{e.livePaginationCursor=null})},groupBy:(o,{actions:e,state:t})=>{let n=t.getDataSourceMasterContextRef.current,r=jt(t,{groupBy:o,livePaginationCursor:null},n());e.dataParams=r,t.livePagination&&He(()=>{e.livePaginationCursor=null})},pivotBy:(o,{actions:e,state:t})=>{let n=t.getDataSourceMasterContextRef.current,r=jt(t,{pivotBy:o,livePaginationCursor:null},n());e.dataParams=r,t.livePagination&&He(()=>{e.livePaginationCursor=null})},filterValue:(o,{actions:e,state:t})=>{let n=t.getDataSourceMasterContextRef.current,r=jt(t,{filterValue:o,livePaginationCursor:null},n());e.dataParams=r,t.livePagination&&He(()=>{e.livePaginationCursor=null})},cursorId:(o,{actions:e,state:t})=>{let n=t.getDataSourceMasterContextRef.current,r=jt(t,{__cursorId:o},n());e.dataParams=r},livePaginationCursor:(o,{actions:e,state:t})=>{let n=t.getDataSourceMasterContextRef.current,r=jt(t,{livePaginationCursor:o},n());e.dataParams=r},dataParams:(o,{state:e})=>wt(o,e.dataParams,new Set(["changes","originalDataArray","masterRowInfo"]))?!1:(Lt(Uo(e.debugId,"DataSource:dataParams"))("onDataParamsChange triggered because the following values have changed",o?.changes),!0)}}function fh(o){return{originalDataArray:o.originalDataArray,groupRowsState:o.groupRowsState,groupBy:o.groupBy,pivotBy:o.pivotBy,sortInfo:o.sortInfo,filterValue:o.filterValue,livePaginationCursor:o.livePaginationCursor}}function Ac(...o){return(...t)=>{o.forEach(n=>{typeof n=="function"&&n(...t)})}}function _c(o){let{pivotByAtIndex:e,pivotAggregator:t}=o;return e?.column&&(typeof e.column=="function"?Object.assign(o,e.column({column:o})):Object.assign(o,e.column)),t?.pivotColumn&&(typeof t.pivotColumn=="function"?Object.assign(o,t.pivotColumn({column:o})):Object.assign(o,t.pivotColumn)),o}function Oc(o){let{pivotByAtIndex:e}=o;return e?.columnGroup&&(typeof e.columnGroup=="function"?Object.assign(o,e.columnGroup({columnGroup:o})):Object.assign(o,e.columnGroup)),o}function mh({deepMap:o,pivotBy:e,pivotTotalColumnPosition:t,pivotGrandTotalColumnPosition:n,reducers:r={},showSeparatePivotColumnForSingleAggregation:i=!1}){let a=e.length,l=Object.keys(r).map(f=>({...r[f],id:f}));l.length||(i=!0,n=!1,t=!1,l.push({id:"__empty-aggregation-reducer__",name:"-",initialValue:null,reducer:()=>null}));let s={},c={},u=yt(function(){l.forEach((f,m)=>{s[`total:${f.id}`]=_c({header:`${f.name||f.id} total`,pivotBy:e,pivotColumn:!0,pivotTotalColumn:!0,pivotAggregator:f,pivotAggregatorIndex:m,pivotGroupKeys:[],pivotGroupKey:"",pivotIndex:-1,valueFormatter:({rowInfo:g})=>g.isGroupRow?g.reducerResults?.[f.id]:null})})});(!a&&t==="start"||n==="start")&&u();let d=!i&&l.length===1;return o.visitDepthFirst((f,m,g,h)=>{if(m=[...m],t==="end"&&h?.(),m.length===a){let S=e[m.length-1],T=m.slice(0,-1).join("/");if(!d){let b=T;T=m.join("/");let R=m[m.length-1];c[T]=Oc({header:`${R}`,columnGroup:b,pivotBy:e,pivotGroupKeys:m,pivotByAtIndex:S,pivotIndex:m.length-1,pivotGroupKey:R})}l.forEach((b,R)=>{let C=d?`${m[m.length-1]}`:b.name||b.id,I=_c({pivotBy:e,pivotColumn:!0,pivotTotalColumn:!1,pivotAggregator:b,pivotAggregatorIndex:R,pivotGroupKeys:m,pivotGroupKey:m[m.length-1],pivotIndex:m.length-1,pivotByAtIndex:S,columnGroup:T,header:C,valueFormatter:({rowInfo:v})=>v.isGroupRow?v.pivotValuesMap?.get(m)?.reducerResults[b.id]:null}),w=`${b.id}:${m.join("/")}`;s[w]=I})}else{let S=m.join("/"),y=m.slice(0,-1);if(c[S]=Oc({columnGroup:y.length?y.join("/"):void 0,header:`${m[m.length-1]}`,pivotBy:e,pivotGroupKeys:m,pivotIndex:m.length-1,pivotByAtIndex:e[m.length-1],pivotGroupKey:m[m.length-1]}),t!==!1){let T=e[m.length-1],b=y.length?y.join("/"):void 0;if(!d){let R=b;b=`total:${m.join("/")}`,c[b]=Oc({header:`${m[m.length-1]} total`,columnGroup:R,pivotBy:e,pivotTotalColumnGroup:!0,pivotGroupKeys:m,pivotIndex:m.length-1,pivotByAtIndex:T,pivotGroupKey:m[m.length-1]})}l.forEach((R,C)=>{let I=d?`${m[m.length-1]} total `:`${R.name||R.id} total`,w=_c({columnGroup:b,header:I,pivotAggregator:R,pivotAggregatorIndex:C,pivotColumn:!0,pivotTotalColumn:!0,pivotGroupKeys:m,pivotGroupKey:m[m.length-1],pivotByAtIndex:T,pivotIndex:m.length-1,pivotBy:e,valueFormatter:({rowInfo:v})=>v.isGroupRow?v.pivotValuesMap?.get(m)?.reducerResults[R.id]:null});s[`total:${R.id}:${m.join("/")}`]=w})}}(t==="start"||t===!1)&&h?.()}),(!a&&t==="end"||n==="end")&&u(),{columns:s,columnGroups:c}}var gh=Symbol("CLEAR"),wn=class o{constructor(e){this.affectedFields=new Set;this.allFieldsAffected=!1;this.primaryKeyToData=new Map;this.nodePathToData=new q;this.getAffectedFields=()=>this.allFieldsAffected?!0:this.affectedFields;this.delete=(e,t,n)=>{this.allFieldsAffected=!0;let r=e,i=this.primaryKeyToData.get(r)||[];i.push({type:"delete",primaryKey:e,originalData:t,metadata:n}),this.primaryKeyToData.set(r,i)};this.deleteNodePath=(e,t,n)=>{this.allFieldsAffected=!0;let r=this.nodePathToData.get(e)||[];r.push({type:"delete",nodePath:e,originalData:t,metadata:n}),this.nodePathToData.set(e,r)};this.insert=(e,t,n,r)=>{let i=e,a=this.primaryKeyToData.get(i)||[];this.allFieldsAffected=!0,a.push({type:"insert",primaryKey:e,data:t,position:n,originalData:null,metadata:r}),this.primaryKeyToData.set(i,a)};this.insertNodePath=(e,t,n,r)=>{let i=this.nodePathToData.get(e)||[];this.allFieldsAffected=!0,i.push({type:"insert",nodePath:e,data:t,position:n,originalData:null,metadata:r}),this.nodePathToData.set(e,i)};this.update=(e,t,n,r)=>{this.allFieldsAffected||(this.nodesKey&&Array.isArray(t[this.nodesKey])?this.allFieldsAffected=!0:Object.keys(t).forEach(s=>this.affectedFields.add(s)));let i=e,a=this.primaryKeyToData.get(i)||[];a.push({type:"update",primaryKey:e,data:t,originalData:n,metadata:r}),this.primaryKeyToData.set(e,a)};this.updateNodePath=(e,t,n,r)=>{this.allFieldsAffected||(this.nodesKey&&Array.isArray(t[this.nodesKey])?this.allFieldsAffected=!0:Object.keys(t).forEach(l=>this.affectedFields.add(l)));let i=this.nodePathToData.get(e)||[];i.push({type:"update",nodePath:e,data:t,originalData:n,metadata:r}),this.nodePathToData.set(e,i)};this.updateChildren=(e,t,n,r)=>{this.allFieldsAffected=!0;let i=this.nodePathToData.get(e)||[];i.push({type:"update-children",nodePath:e,children:t,originalData:n,metadata:r}),this.nodePathToData.set(e,i)};this.resetDataSource=e=>{this.clear(),this.allFieldsAffected=!0;let t=gh,n=this.primaryKeyToData.get(t)||[];n.push({type:"clear-all",primaryKey:void 0,metadata:e}),this.primaryKeyToData.set(t,n)};this.shouldResetDataSource=()=>this.primaryKeyToData.has(gh);this.clear=()=>{this.allFieldsAffected=!1,this.affectedFields.clear(),this.primaryKeyToData.clear()};this.isEmpty=()=>this.primaryKeyToData.size===0&&this.nodePathToData.size===0;this.removeInfo=e=>{this.primaryKeyToData.delete(e)};this.removeNodePathInfo=e=>{this.nodePathToData.delete(e)};this.getMutationsForPrimaryKey=e=>this.primaryKeyToData.get(e);this.getMutationsForNodePath=e=>this.nodePathToData.get(e);this.getMutationsCount=()=>this.primaryKeyToData.size;this.getMutations=()=>new Map(this.primaryKeyToData);this.getTreeMutations=()=>q.clone(this.nodePathToData);this.getMutationsArray=()=>Array.from(this.primaryKeyToData.values()).flat();this.getTreeMutationsArray=()=>Array.from(this.nodePathToData.values()).flat();this.nodesKey=e.nodesKey}static clone(e,{light:t=!1}={}){let n=new o({nodesKey:e.nodesKey});return n.allFieldsAffected=e.allFieldsAffected,n.affectedFields=new Set(e.affectedFields),n.primaryKeyToData=t?e.primaryKeyToData:new Map(e.primaryKeyToData),n.nodePathToData=t?e.nodePathToData:q.clone(e.nodePathToData),n}};var Fc=1e3;function hh(o){return new Nc(o)}var Nc=class{constructor(e){this.pendingOperations=[];this.batchOperationRafId=0;this.batchOperationTimeoutId=0;this.pendingPromise=null;this.resolvePendingPromise=null;this.toPrimaryKey=e=>this.getState().toPrimaryKey(e);this.getRowInfoArray=()=>la(this.getState);this.getRowInfoByIndex=e=>Vo(e,this.getState)??null;this.getRowInfoByPrimaryKey=e=>{let t=this.getIndexByPrimaryKey(e);return this.getRowInfoByIndex(t)};this.getRowInfoByNodePath=e=>{let t=this.getIndexByNodePath(e);return this.getRowInfoByIndex(t)};this.getIndexByPrimaryKey=e=>this.getState().idToIndexMap.get(e)??-1;this.getIndexByNodePath=e=>this.getState().pathToIndexMap.get(e)??-1;this.getNodePathById=e=>this.getState().idToPathMap.get(e)??null;this.getNodePathByIndex=e=>{let t=this.getRowInfoByIndex(e);return t&&t.isTreeNode?t.nodePath:null};this.getPrimaryKeyByIndex=e=>{let t=this.getRowInfoByIndex(e);return t?t.id:void 0};this.getOriginalDataArray=()=>this.getState().originalDataArray;this.getDataByIndex=e=>{let t=this.getRowInfoByIndex(e);return t?t.data:null};this.getDataByPrimaryKey=e=>{let{indexer:t}=this.getState();return t.getDataForPrimaryKey(e)??null};this.isNodePathAvailable=e=>this.getState().indexer.getDataForNodePath(e)!==void 0;this.getDataByNodePath=e=>{let{indexer:t}=this.getState(),n=t.getDataForNodePath(e);return n||null};this.replaceAllData=(e,t)=>(this.batchOperation({type:"replace-all",array:e,metadata:t?.metadata}),this.addDataArray(e,t));this.clearAllData=e=>this.replaceAllData([],e);this.updateData=(e,t)=>this.updateDataArray([e],t);this.updateDataArray=(e,t)=>{let n=this.getState().isTree,r=n?void 0:e.map(l=>this.toPrimaryKey(l)),i=n?e.map(l=>this.getNodePathById(this.toPrimaryKey(l))||[]):null,a=r?this.batchOperation({type:"update",array:e,primaryKeys:e.map(l=>this.toPrimaryKey(l)),metadata:t?.metadata}):this.batchOperation({type:"update",array:e,nodePaths:i||[],metadata:t?.metadata});return t?.flush&&this.commit(),a};this.withWaitForNode=(e,t,n)=>{let r=n?.waitForNode??!0;if(r===!0||typeof r=="number"){let a=r===!0?Fc:r;return isNaN(a)||(a=Fc),this.waitForNodePath(e,{timeout:a}).then(l=>{if(!l){let s=`Cannot find node path "${e.join("/")}" (we waited for it ${a}ms)`;return console.error(s),t({error:s,resolved:!1})}return t({resolved:!0})})}let i=t({resolved:void 0});return i instanceof Promise?i:Promise.resolve(i)};this.updateChildrenByNodePath=(e,t,n)=>this.withWaitForNode(t,({error:r})=>r?!1:this.updateChildrenByNodePath_Internal(e,t,n),n);this.updateChildrenByNodePath_Internal=(e,t,n)=>{let r=typeof e=="function"?e:()=>e;return this.updateDataArrayByNodePath_Internal([{nodePath:t,children:r}],n)};this.updateDataByNodePath=(e,t,n)=>this.isNodePathAvailable(t)?this.updateDataArrayByNodePath_Internal([{data:e,nodePath:t}],n):this.withWaitForNode(t,({error:r})=>r?!1:this.updateDataArrayByNodePath_Internal([{data:e,nodePath:t}],n),n);this.updateDataArrayByNodePath=(e,t)=>{if(t&&typeof t.waitForNode<"u"&&!t.waitForNode)return this.updateDataArrayByNodePath_Internal(e,t);let n=e.map(i=>i.nodePath);return Promise.allSettled(n.map(i=>this.withWaitForNode(i,({error:a})=>!a,t))).then(i=>i.every(Boolean)?this.updateDataArrayByNodePath_Internal(e,t):!1)};this.updateDataArrayByNodePath_Internal=(e,t)=>{let n=[],r=[];e.forEach(a=>{a.data?n.push(a.data):a.children&&n.push(a.children),r.push(a.nodePath)});let i=this.batchOperation({type:"update",array:n,nodePaths:r,metadata:t?.metadata});return t?.flush&&this.commit(),i};this.removeDataByPrimaryKey=(e,t)=>{if(this.getState().isTree)return this.removeDataByNodePath(this.getNodePathById(e)||[],t);let r=this.batchOperation({type:"delete",primaryKeys:[e],metadata:t?.metadata});return t?.flush&&this.commit(),r};this.removeDataByNodePath=(e,t)=>this.batchDeleteNodePaths([e],t);this.removeData=(e,t)=>{if(this.getState().isTree){let r=this.getNodePathById(this.toPrimaryKey(e));return this.removeDataByNodePath(r,t)}return this.batchDeletePrimaryKeys([this.toPrimaryKey(e)],t)};this.removeDataArrayByPrimaryKeys=(e,t)=>{if(this.getState().isTree){let r=e.map(i=>this.getNodePathById(i)||[]);return this.batchDeleteNodePaths(r,t)}return this.batchDeletePrimaryKeys(e,t)};this.batchDeleteNodePaths=(e,t)=>{let n=this.batchOperation({type:"delete",nodePaths:e||[],metadata:t?.metadata});return t?.flush&&this.commit(),n};this.batchDeletePrimaryKeys=(e,t)=>{let n=this.batchOperation({type:"delete",primaryKeys:e,metadata:t?.metadata});return t?.flush&&this.commit(),n};this.removeDataArray=(e,t)=>{if(this.getState().isTree){let i=e.map(a=>this.getNodePathById(this.toPrimaryKey(a))||[]);return this.batchDeleteNodePaths(i,t)}let r=e.map(this.toPrimaryKey);return this.batchDeletePrimaryKeys(r,t)};this.addData=(e,t)=>this.addDataArray([e],t);this.addDataArray=(e,t)=>this.insertDataArray(e,{...t,position:"end"});this.insertData=(e,t)=>this.insertDataArray([e],t);this.insertDataArray=(e,t)=>{let n=this.getState().isTree,r="before",i,a=t.nodePath;if(n&&a?.length)return this.withWaitForNode(a,({error:s})=>{if(s)return!1;if(t.position==="before"||t.position==="after")return this.batchTreeInsert(e,t.position,a,t);let c=u=>t.position==="start"?[...e,...u||[]]:[...u||[],...e];return this.updateChildrenByNodePath(c,a,t)},t);if(t.position==="before"||t.position==="after")r=t.position,i=t.primaryKey;else{let s=this.getOriginalDataArray();t.position==="start"?(r="before",s.length?i=this.toPrimaryKey(s[0]):i=void 0):(r="after",s.length?i=this.toPrimaryKey(s[s.length-1]):i=void 0)}let l=n?this.batchOperation({type:"insert",array:e,position:r,metadata:t?.metadata,nodePath:this.getNodePathById(i)||[]}):this.batchOperation({type:"insert",array:e,position:r,metadata:t?.metadata,primaryKey:i,nodePath:a});return t?.flush&&this.commit(),l};this.batchTreeInsert=(e,t,n,r)=>{if(n.length&&!this.isNodePathAvailable(n))return this.withWaitForNode(n,({error:a})=>{if(a)return!1;let l=this.batchOperation({type:"insert",array:e,position:t,metadata:r?.metadata,nodePath:n});return r?.flush&&this.commit(),l},r);let i=this.batchOperation({type:"insert",array:e,position:t,metadata:r?.metadata,nodePath:n});return r?.flush&&this.commit(),i};this.setSortInfo=e=>{let t=this.getState().multiSort;if(Array.isArray(e)){this.actions.sortInfo=e.length?t?e:e[0]:null;return}this.actions.sortInfo=e};this.setGroupBy=e=>{this.actions.groupBy=e};this.toggleGroupByField=e=>{let t=this.getState().groupBy;t.findIndex(r=>r.field===e)===-1?this.actions.groupBy=[...t,{field:e}]:this.actions.groupBy=t.filter(r=>r.field!==e)};this.isRowDisabledAt=e=>this.getRowInfoByIndex(e)?.rowDisabled??!1;this.isRowDisabled=e=>this.getRowInfoByPrimaryKey(e)?.rowDisabled??!1;this.setRowEnabledAt=(e,t)=>{let n=this.getState().rowDisabledState,r=n?new Et(n):new Et({enabledRows:!0,disabledRows:[]}),i=this.getRowInfoByIndex(e);i&&(r.setRowEnabled(i.id,t),this.actions.rowDisabledState=r)};this.setRowEnabled=(e,t)=>{let n=this.getRowInfoByPrimaryKey(e);n&&this.setRowEnabledAt(n.indexInAll,t)};this.enableAllRows=()=>{let e=this.getState().rowDisabledState;if(!e){this.actions.rowDisabledState=new Et({enabledRows:!0,disabledRows:[]});return}let t=new Et(e);t.enableAll(),this.actions.rowDisabledState=t};this.disableAllRows=()=>{let e=this.getState().rowDisabledState;if(!e){this.actions.rowDisabledState=new Et({disabledRows:!0,enabledRows:[]});return}let t=new Et(e);t.disableAll(),this.actions.rowDisabledState=t};this.areAllRowsEnabled=()=>{let e=this.getState().rowDisabledState;return e?e.areAllEnabled():!0};this.areAllRowsDisabled=()=>{let e=this.getState().rowDisabledState;return e?e.areAllDisabled():!1};this.getState=e.getState,this.getState().__apiRef.current=this,this.actions=e.actions,this.treeApi=new sa({...e,dataSourceApi:this})}getPendingOperationPromise(){return this.pendingPromise}batchOperation(e){if(!this.pendingPromise){this.pendingPromise=new Promise(n=>{this.resolvePendingPromise=n});let t=Math.max(0,this.getState().batchOperationDelay??0);t===0?this.batchOperationRafId=setTimeout(()=>{this.commit()}):this.batchOperationTimeoutId=setTimeout(()=>{this.batchOperationRafId=setTimeout(()=>{this.commit()})},t)}return e.type==="replace-all"&&(this.pendingOperations.length=0),this.pendingOperations.push(e),this.pendingPromise}commitOperations(e){if(!e.length)return;let t=this.getState().cache,{isTree:n,nodesKey:r}=this.getState(),i=t?wn.clone(t,{light:!0}):new wn({nodesKey:n?r:void 0});e.forEach(a=>{switch(a.type){case"update":a.array.forEach((u,d)=>{if(a.primaryKeys){let p=a.primaryKeys[d],f=this.getDataByPrimaryKey(p);f&&i.update(a.primaryKeys[d],u,f,a.metadata)}else if(a.nodePaths){let p=this.getDataByNodePath(a.nodePaths[d]);p&&(typeof u=="function"?i.updateChildren(a.nodePaths[d],u,p,a.metadata):i.updateNodePath(a.nodePaths[d],u,p,a.metadata))}});break;case"delete":a.primaryKeys?a.primaryKeys.forEach(u=>{let d=this.getDataByPrimaryKey(u);d&&i.delete(u,d,a.metadata)}):a.nodePaths&&a.nodePaths.forEach(u=>{let d=this.getDataByNodePath(u);d&&i.deleteNodePath(u,d,a.metadata)});break;case"insert":let l=a.primaryKey,s=a.position,c=a.nodePath;c?a.array.forEach(u=>{i.insertNodePath([...c],u,s,a.metadata),l=this.toPrimaryKey(u),c.pop(),c.push(l),s="after"}):a.array.forEach(u=>{i.insert(l,u,s,a.metadata),l=this.toPrimaryKey(u),s="after"});break;case"replace-all":i.resetDataSource(a.metadata);break}}),this.actions.cache=i}flush(){return this.commit()}waitForNodePath(e,t){let n=this.getState();if(this.isNodePathAvailable(e))return Promise.resolve(!0);let r=t?.timeout??Fc,i=n.waitForNodePathPromises.get(e);if(i)return i.promise;let a=Date.now(),l=()=>{},s=new Promise(c=>{let u,d;l=p=>{clearTimeout(d),u=p,n.waitForNodePathPromises.delete(e),c(p)},d=setTimeout(()=>{u===void 0&&l(!1)},r)});return n.waitForNodePathPromises.set(e,{timestamp:a,promise:s,resolve:l}),s}commit(){this.commitOperations(this.pendingOperations),this.pendingOperations.length=0;let e=this.pendingPromise;if(e&&this.resolvePendingPromise){let t=this.resolvePendingPromise;requestAnimationFrame(()=>{t(!0)}),this.pendingPromise=null,this.resolvePendingPromise=null}return e||Promise.resolve(!0)}};function yh(o){let e=o.cache;if(!e)return{sortInfo:!1,groupBy:!1,tree:!1,filterValue:!1,aggregationReducers:!1};let t=!1,n=!1,r=!1,i=!1,a=!1,l=e.getAffectedFields(),{sortInfo:s,groupBy:c,filterValue:u,aggregationReducers:d,nodesKey:p,isTree:f}=o;if(s&&s.length)if(l===!0)t=!0;else for(let m of s){let g=m.field;if(g&&(g=Array.isArray(g)?g:[g],t=g.reduce((h,S)=>h||typeof S!="function"?l.has(S):!1,!1),t))break}if(c&&c.length){if(l===!0)n=!0;else for(let m of c)if(m.field&&l.has(m.field)){n=!0;break}}if(f&&(l===!0?r=!0:r=l.has(p)),u&&u.length)if(l===!0)i=!0;else for(let m of u){if(m.id){i=!0;break}if(m.field&&l.has(m.field)){i=!0;break}}if(d&&Object.keys(d).length){if(l===!0)a=!0;else for(let m in d)if(d.hasOwnProperty(m)){let g=d[m];if(g.field){if(l.has(g.field)){a=!0;break}}else{a=!0;break}}}return{sortInfo:t,groupBy:n,filterValue:i,aggregationReducers:a,tree:r}}function al(o){if(!o)return;let e=Object.keys(o);if(!e.length)return;let t={};for(let n=0,r=e.length;n<r;n++){let i=e[n],a=o[i].initialValue;a!==void 0&&(t[i]=typeof a=="function"?a():a)}return t}function ll(o){let e=o.reducerKeys,t=o.reducers,n=o.results;for(let r=0,i=e.length;r<i;r++){let a=e[r],l=t[a].reducer;n[a]=l(n[a],o.rowInfo)}}function sl(o){let e=Object.keys(o.reducers||{});if(!e.length||!o.results)return o.results;let t=o.reducers,n=o.results;for(let r=0,i=e.length;r<i;r++){let a=e[r],l=t[a].done;typeof l=="function"&&(n[a]=l(n[a],o.array))}return n}function Sh(o){return"groupNesting"in o?o.groupNesting??0:0}function bh(o,e){if(!(!o.isGroupRow||!e.reducerId))return e.pivotTotalColumn&&(!e.pivotGroupKeys||e.pivotGroupKeys.length===0)?o.reducerResults?.[e.reducerId]:o.pivotValuesMap?.get(e.pivotGroupKeys)?.reducerResults?.[e.reducerId]}function bI(o,e,t,n){if(o==null&&e==null)return 0;if(o==null)return 1;if(e==null)return-1;let r=Array.isArray(t.type)?t.type[0]:t.type,a=(t.fn||r&&n[r]||n.string||qo.string)(o,e);return a===0?0:t.dir*a}function TI(o,e){if(!o?.length||!e)return[];let t=[];for(let n of o){let r=n.id?e[n.id]:void 0;!r?.pivotColumn||!r.pivotAggregator||t.push({dir:n.dir,type:n.type,fn:n.fn,pivotGroupKeys:r.pivotGroupKeys??[],reducerId:r.pivotAggregator.id,pivotTotalColumn:!!r.pivotTotalColumn})}return t}function CI(o){let e=[],t=[];for(let n of o){let r={row:n,children:[]},i=Sh(n);for(;t.length&&Sh(t[t.length-1].row)>=i;)t.pop();t.length?t[t.length-1].children.push(r):e.push(r),t.push(r)}return e}function RI(o){let e=[],t=(n,r)=>{n.forEach((i,a)=>{let l=[...r,a],s=i.row;s.indexInGroup=a,s.indexInParentGroups=l,s.indexInAll=e.length,e.push(s),t(i.children,l)})};return t(o,[]),e}function Th(o,e,t,n){let r=TI(e,t);if(!r.length||!o.length)return o;let i={...qo,...n},a=CI(o),l=(c,u)=>{for(let d of r){let p=bI(bh(c.row,d),bh(u.row,d),d,i);if(p!==0)return p}return 0},s=c=>{c.sort(l);for(let u of c)s(u.children)};return s(a),RI(a)}var ao=(o,e,t)=>{for(let n=0,r=t.length;n<r;n++){let i=t[n],a=o[i],l=e[i];if(a!==l)return!0}return!1};function II(o){let e=o.get([vt]);if(!e)return;if(e.totalChildrenCount!=null)return e.totalChildrenCount;let t=0;for(let n=0;n<e.children.length;n++){let r=e.children[n]?.totalChildrenCount;if(r==null)return;t+=r}return t}function wI(o,e){let t=o.get([vt]);if(t)return e?t.totalChildrenCountUnfiltered:t.totalCountUnfiltered}function Lc(){return!1}function vI(o,e,t,n,r,i){let a={dataSourceHasGrouping:!1,isTreeNode:!1,data:o,id:e,indexInAll:t,isGroupRow:!1,selfLoaded:!0,rowSelected:!1,rowDisabled:!1,isCellSelected:Lc,hasSelectedCells:Lc};return n&&(a.rowSelected=n(a)),r&&(a.rowDisabled=r(a)),i&&(a.isCellSelected=l=>i.isCellSelected(a.id,l),a.hasSelectedCells=l=>i.isCellSelectionInRow(a.id,l)),a}var PI=yt(()=>{console.warn(`Your "treeFilterFunction" should NOT MUTATE the data object. You're probably mutating the node children.
4
+ `);let o=Jo(t);if(n instanceof Je)return n.setConfig(o),n;(n==null||typeof n!="object")&&(n=void 0);let r=n??JR,i=t.propsCache.get("treeSelection"),a=i.get(r);return a&&a.setConfig(o),a=a??new Je(r,o),i.set(r,a),a}function ph(n){let{props:e,state:t,oldState:o}=n,r=!!t.nodesKey,i=Ar(e.sortInfo),a=Ar(e.filterValue),{filterTypes:l}=t,s=Object.keys(l).reduce((x,E)=>{let z=l[E].operators;x[E]=x[E]||{};let V=x[E];return z.forEach(N=>{V[N.name]=N}),x},{}),c=e,u=e.selectionMode;if(u===void 0)if(e.cellSelection!==void 0||e.defaultCellSelection!==void 0)u="multi-cell";else{let x=e.rowSelection!==void 0?e.rowSelection:e.defaultRowSelection;if(x!==void 0&&(x&&typeof x=="object"?u="multi-row":u="single-row"),!u){let E=c.treeSelection??c.defaultTreeSelection;E!==void 0&&(u=typeof E=="object"?"multi-row":"single-row")}u=u??!1}let d=null,p=null,f=e.rowSelection!==void 0?e.rowSelection:t.rowSelection===void 0?e.defaultRowSelection!==void 0?e.defaultRowSelection:null:t.rowSelection,m=e.cellSelection!==void 0?e.cellSelection:t.cellSelection===void 0?e.defaultCellSelection!==void 0?e.defaultCellSelection:null:t.cellSelection||null;if(!r&&(u!==!1&&(u==="single-row"||u==="multi-row")&&(f===null?d=u==="single-row"?null:new Oe({selectedRows:[],deselectedRows:[],defaultSelection:!1},mt(t)):u==="single-row"||f instanceof Oe?d=f:d=new Oe(f,mt(t))),u==="single-cell"||u==="multi-cell"))if(m===null)p=u==="single-cell"?null:new Ue;else if(m instanceof Ue)p=m;else{let x=t.propsCache.get("cellSelection"),E=x.get(m)??new Ue(m);x.set(m,E),p=E}let g=t.primaryKey,h=typeof g=="function"?x=>g(x):x=>x[g],S=c.treeExpandState||t.treeExpandState||c.defaultTreeExpandState;if(S&&!(S instanceof ft)){let x=t.propsCache.get("treeExpandState"),E=x.get(S)??new ft(S);x.set(S,E),S=E}S=S||new ft({defaultExpanded:!0,collapsedPaths:[]});let y=e.groupRowsState||t.groupRowsState||e.defaultGroupRowsState;if(y&&!(y instanceof xt)){let x=t.propsCache.get("groupRowsState"),E=x.get(y)??new xt(y);x.set(y,E),y=E}y=y||new xt(t.lazyLoad?{expandedRows:[],collapsedRows:!0}:{expandedRows:!0,collapsedRows:[]});let C=QR(e.shouldReloadData||{}),T=typeof e.data=="function"&&!!e.lazyLoad,I=!!e.livePagination,b={sortInfo:C.sortInfo??(T||I),filterValue:C.filterValue??(T||I),groupBy:C.groupBy??T,pivotBy:C.pivotBy??T},R=e.sortFunction?"local":b.sortInfo?"remote":"local",v=(typeof e.filterFunction=="function"||typeof e.treeFilterFunction=="function")&&!e.lazyLoad?"local":b.filterValue||e.lazyLoad?"remote":"local",P=t.rowDisabledState,D=e.isRowDisabled;if(!D&&P){let x=t.propsCache.get("isRowDisabled"),E=x.get(P);E?D=E:(D=z=>P.isRowDisabled(z.id),x.set(P,D))}let M={debugId:t.debugId??e.debugId,isTree:r,selectionMode:u,groupRowsState:y,treeExpandState:S,treeExpandMode:S.mode,shouldReloadData:b,isRowDisabled:D,rowSelection:d,cellSelection:p,sortMode:R,filterMode:v,toPrimaryKey:h,operatorsByFilterType:s,controlledSort:i,controlledFilter:a,multiSort:Array.isArray(i?e.sortInfo:e.defaultSortInfo),lazyLoadBatchSize:typeof e.lazyLoad=="object"?e.lazyLoad.batchSize:void 0};if(e.livePagination){let x=!o||o.originalDataArray!==t.originalDataArray,E=typeof e.livePaginationCursor=="function"?x?ZR(e.livePaginationCursor,t):t.livePaginationCursor:e.livePaginationCursor;M.livePaginationCursor=E}if(t.devToolsDetected&&t.debugId){let x=In.get(t.debugId);x&&(M={...M,...x})}return M}var ew=Lt("DataSource:fullLazyLoad");function fh(n,e,t){let{name:o,newValue:r}=n;o==="data"&&typeof r=="function"&&!e.groupRowsState&&(e.lazyLoad&&ew('"data" function prop has changed'),e.collapseGroupRowsOnDataFunctionChange!==!1&&(t.groupRowsState=new xt({collapsedRows:!0,expandedRows:[]})))}function mh(){return{rowSelection:(n,e)=>e.selectionMode==="single-row"?{callbackParams:[n,"single-row"]}:{callbackParams:[n.getState(),"multi-row"]},treeSelection:(n,e)=>{if(e.selectionMode==="single-row")return{callbackParams:[n,{selectionMode:"single-row"}]};let t=e.__apiRef.current,o=t.treeApi;return{callbackParams:[n.getState(),{treeSelectionState:n,prevTreeSelectionState:e.treeSelectionState,selectionMode:"multi-row",lastUpdatedNodeInfo:e.lastSelectionUpdatedNodePathRef.current,unfilteredTreePaths:e.unfilteredTreePaths,dataSourceApi:t,treeApi:o}]}},treeExpandState:(n,e)=>({callbackParams:[n.getState(),{nodeState:e.lastExpandStateInfoRef.current.state,nodePath:e.lastExpandStateInfoRef.current.nodePath,dataSourceApi:e.__apiRef.current}]}),cellSelection:(n,e)=>e.selectionMode==="single-cell"?{callbackParams:[n instanceof Ue?n.getState().selectedCells:null,"single-cell"]}:{callbackParams:[n.getState(),"multi-cell"]}}}function gh(){return{sortInfo:(n,{actions:e,state:t})=>{let o=t.getDataSourceMasterContextRef.current,r=jt(t,{sortInfo:n,livePaginationCursor:null},o());e.dataParams=r,t.livePagination&&He(()=>{e.livePaginationCursor=null})},groupBy:(n,{actions:e,state:t})=>{let o=t.getDataSourceMasterContextRef.current,r=jt(t,{groupBy:n,livePaginationCursor:null},o());e.dataParams=r,t.livePagination&&He(()=>{e.livePaginationCursor=null})},pivotBy:(n,{actions:e,state:t})=>{let o=t.getDataSourceMasterContextRef.current,r=jt(t,{pivotBy:n,livePaginationCursor:null},o());e.dataParams=r,t.livePagination&&He(()=>{e.livePaginationCursor=null})},filterValue:(n,{actions:e,state:t})=>{let o=t.getDataSourceMasterContextRef.current,r=jt(t,{filterValue:n,livePaginationCursor:null},o());e.dataParams=r,t.livePagination&&He(()=>{e.livePaginationCursor=null})},cursorId:(n,{actions:e,state:t})=>{let o=t.getDataSourceMasterContextRef.current,r=jt(t,{__cursorId:n},o());e.dataParams=r},livePaginationCursor:(n,{actions:e,state:t})=>{let o=t.getDataSourceMasterContextRef.current,r=jt(t,{livePaginationCursor:n},o());e.dataParams=r},dataParams:(n,{state:e})=>Rt(n,e.dataParams,new Set(["changes","originalDataArray","masterRowInfo"]))?!1:(Lt(Un(e.debugId,"DataSource:dataParams"))("onDataParamsChange triggered because the following values have changed",n?.changes),!0)}}function hh(n){return{originalDataArray:n.originalDataArray,groupRowsState:n.groupRowsState,groupBy:n.groupBy,pivotBy:n.pivotBy,sortInfo:n.sortInfo,filterValue:n.filterValue,livePaginationCursor:n.livePaginationCursor}}function Oc(...n){return(...t)=>{n.forEach(o=>{typeof o=="function"&&o(...t)})}}function Fc(n){let{pivotByAtIndex:e,pivotAggregator:t}=n;return e?.column&&(typeof e.column=="function"?Object.assign(n,e.column({column:n})):Object.assign(n,e.column)),t?.pivotColumn&&(typeof t.pivotColumn=="function"?Object.assign(n,t.pivotColumn({column:n})):Object.assign(n,t.pivotColumn)),n}function Nc(n){let{pivotByAtIndex:e}=n;return e?.columnGroup&&(typeof e.columnGroup=="function"?Object.assign(n,e.columnGroup({columnGroup:n})):Object.assign(n,e.columnGroup)),n}function yh({deepMap:n,pivotBy:e,pivotTotalColumnPosition:t,pivotGrandTotalColumnPosition:o,reducers:r={},showSeparatePivotColumnForSingleAggregation:i=!1}){let a=e.length,l=Object.keys(r).map(f=>({...r[f],id:f}));l.length||(i=!0,o=!1,t=!1,l.push({id:"__empty-aggregation-reducer__",name:"-",initialValue:null,reducer:()=>null}));let s={},c={},u=ht(function(){l.forEach((f,m)=>{s[`total:${f.id}`]=Fc({header:`${f.name||f.id} total`,pivotBy:e,pivotColumn:!0,pivotTotalColumn:!0,pivotAggregator:f,pivotAggregatorIndex:m,pivotGroupKeys:[],pivotGroupKey:"",pivotIndex:-1,valueFormatter:({rowInfo:g})=>g.isGroupRow?g.reducerResults?.[f.id]:null})})});(!a&&t==="start"||o==="start")&&u();let d=!i&&l.length===1;return n.visitDepthFirst((f,m,g,h)=>{if(m=[...m],t==="end"&&h?.(),m.length===a){let S=e[m.length-1],C=m.slice(0,-1).join("/");if(!d){let T=C;C=m.join("/");let I=m[m.length-1];c[C]=Nc({header:`${I}`,columnGroup:T,pivotBy:e,pivotGroupKeys:m,pivotByAtIndex:S,pivotIndex:m.length-1,pivotGroupKey:I})}l.forEach((T,I)=>{let b=d?`${m[m.length-1]}`:T.name||T.id,R=Fc({pivotBy:e,pivotColumn:!0,pivotTotalColumn:!1,pivotAggregator:T,pivotAggregatorIndex:I,pivotGroupKeys:m,pivotGroupKey:m[m.length-1],pivotIndex:m.length-1,pivotByAtIndex:S,columnGroup:C,header:b,valueFormatter:({rowInfo:v})=>v.isGroupRow?v.pivotValuesMap?.get(m)?.reducerResults[T.id]:null}),w=`${T.id}:${m.join("/")}`;s[w]=R})}else{let S=m.join("/"),y=m.slice(0,-1);if(c[S]=Nc({columnGroup:y.length?y.join("/"):void 0,header:`${m[m.length-1]}`,pivotBy:e,pivotGroupKeys:m,pivotIndex:m.length-1,pivotByAtIndex:e[m.length-1],pivotGroupKey:m[m.length-1]}),t!==!1){let C=e[m.length-1],T=y.length?y.join("/"):void 0;if(!d){let I=T;T=`total:${m.join("/")}`,c[T]=Nc({header:`${m[m.length-1]} total`,columnGroup:I,pivotBy:e,pivotTotalColumnGroup:!0,pivotGroupKeys:m,pivotIndex:m.length-1,pivotByAtIndex:C,pivotGroupKey:m[m.length-1]})}l.forEach((I,b)=>{let R=d?`${m[m.length-1]} total `:`${I.name||I.id} total`,w=Fc({columnGroup:T,header:R,pivotAggregator:I,pivotAggregatorIndex:b,pivotColumn:!0,pivotTotalColumn:!0,pivotGroupKeys:m,pivotGroupKey:m[m.length-1],pivotByAtIndex:C,pivotIndex:m.length-1,pivotBy:e,valueFormatter:({rowInfo:v})=>v.isGroupRow?v.pivotValuesMap?.get(m)?.reducerResults[I.id]:null});s[`total:${I.id}:${m.join("/")}`]=w})}}(t==="start"||t===!1)&&h?.()}),(!a&&t==="end"||o==="end")&&u(),{columns:s,columnGroups:c}}var Sh=Symbol("CLEAR"),Ro=class n{constructor(e){this.affectedFields=new Set;this.allFieldsAffected=!1;this.primaryKeyToData=new Map;this.nodePathToData=new U;this.getAffectedFields=()=>this.allFieldsAffected?!0:this.affectedFields;this.delete=(e,t,o)=>{this.allFieldsAffected=!0;let r=e,i=this.primaryKeyToData.get(r)||[];i.push({type:"delete",primaryKey:e,originalData:t,metadata:o}),this.primaryKeyToData.set(r,i)};this.deleteNodePath=(e,t,o)=>{this.allFieldsAffected=!0;let r=this.nodePathToData.get(e)||[];r.push({type:"delete",nodePath:e,originalData:t,metadata:o}),this.nodePathToData.set(e,r)};this.insert=(e,t,o,r)=>{let i=e,a=this.primaryKeyToData.get(i)||[];this.allFieldsAffected=!0,a.push({type:"insert",primaryKey:e,data:t,position:o,originalData:null,metadata:r}),this.primaryKeyToData.set(i,a)};this.insertNodePath=(e,t,o,r)=>{let i=this.nodePathToData.get(e)||[];this.allFieldsAffected=!0,i.push({type:"insert",nodePath:e,data:t,position:o,originalData:null,metadata:r}),this.nodePathToData.set(e,i)};this.update=(e,t,o,r)=>{this.allFieldsAffected||(this.nodesKey&&Array.isArray(t[this.nodesKey])?this.allFieldsAffected=!0:Object.keys(t).forEach(s=>this.affectedFields.add(s)));let i=e,a=this.primaryKeyToData.get(i)||[];a.push({type:"update",primaryKey:e,data:t,originalData:o,metadata:r}),this.primaryKeyToData.set(e,a)};this.updateNodePath=(e,t,o,r)=>{this.allFieldsAffected||(this.nodesKey&&Array.isArray(t[this.nodesKey])?this.allFieldsAffected=!0:Object.keys(t).forEach(l=>this.affectedFields.add(l)));let i=this.nodePathToData.get(e)||[];i.push({type:"update",nodePath:e,data:t,originalData:o,metadata:r}),this.nodePathToData.set(e,i)};this.updateChildren=(e,t,o,r)=>{this.allFieldsAffected=!0;let i=this.nodePathToData.get(e)||[];i.push({type:"update-children",nodePath:e,children:t,originalData:o,metadata:r}),this.nodePathToData.set(e,i)};this.resetDataSource=e=>{this.clear(),this.allFieldsAffected=!0;let t=Sh,o=this.primaryKeyToData.get(t)||[];o.push({type:"clear-all",primaryKey:void 0,metadata:e}),this.primaryKeyToData.set(t,o)};this.shouldResetDataSource=()=>this.primaryKeyToData.has(Sh);this.clear=()=>{this.allFieldsAffected=!1,this.affectedFields.clear(),this.primaryKeyToData.clear()};this.isEmpty=()=>this.primaryKeyToData.size===0&&this.nodePathToData.size===0;this.removeInfo=e=>{this.primaryKeyToData.delete(e)};this.removeNodePathInfo=e=>{this.nodePathToData.delete(e)};this.getMutationsForPrimaryKey=e=>this.primaryKeyToData.get(e);this.getMutationsForNodePath=e=>this.nodePathToData.get(e);this.getMutationsCount=()=>this.primaryKeyToData.size;this.getMutations=()=>new Map(this.primaryKeyToData);this.getTreeMutations=()=>U.clone(this.nodePathToData);this.getMutationsArray=()=>Array.from(this.primaryKeyToData.values()).flat();this.getTreeMutationsArray=()=>Array.from(this.nodePathToData.values()).flat();this.nodesKey=e.nodesKey}static clone(e,{light:t=!1}={}){let o=new n({nodesKey:e.nodesKey});return o.allFieldsAffected=e.allFieldsAffected,o.affectedFields=new Set(e.affectedFields),o.primaryKeyToData=t?e.primaryKeyToData:new Map(e.primaryKeyToData),o.nodePathToData=t?e.nodePathToData:U.clone(e.nodePathToData),o}};var Lc=1e3;function bh(n){return new kc(n)}var kc=class{constructor(e){this.pendingOperations=[];this.batchOperationRafId=0;this.batchOperationTimeoutId=0;this.pendingPromise=null;this.resolvePendingPromise=null;this.toPrimaryKey=e=>this.getState().toPrimaryKey(e);this.getRowInfoArray=()=>ia(this.getState);this.getRowInfoByIndex=e=>Vn(e,this.getState)??null;this.getRowInfoByPrimaryKey=e=>{let t=this.getIndexByPrimaryKey(e);return this.getRowInfoByIndex(t)};this.getRowInfoByNodePath=e=>{let t=this.getIndexByNodePath(e);return this.getRowInfoByIndex(t)};this.getIndexByPrimaryKey=e=>this.getState().idToIndexMap.get(e)??-1;this.getIndexByNodePath=e=>this.getState().pathToIndexMap.get(e)??-1;this.getNodePathById=e=>this.getState().idToPathMap.get(e)??null;this.getNodePathByIndex=e=>{let t=this.getRowInfoByIndex(e);return t&&t.isTreeNode?t.nodePath:null};this.getPrimaryKeyByIndex=e=>{let t=this.getRowInfoByIndex(e);return t?t.id:void 0};this.getOriginalDataArray=()=>this.getState().originalDataArray;this.getDataByIndex=e=>{let t=this.getRowInfoByIndex(e);return t?t.data:null};this.getDataByPrimaryKey=e=>{let{indexer:t}=this.getState();return t.getDataForPrimaryKey(e)??null};this.isNodePathAvailable=e=>this.getState().indexer.getDataForNodePath(e)!==void 0;this.getDataByNodePath=e=>{let{indexer:t}=this.getState(),o=t.getDataForNodePath(e);return o||null};this.replaceAllData=(e,t)=>(this.batchOperation({type:"replace-all",array:e,metadata:t?.metadata}),this.addDataArray(e,t));this.clearAllData=e=>this.replaceAllData([],e);this.updateData=(e,t)=>this.updateDataArray([e],t);this.updateDataArray=(e,t)=>{let o=this.getState().isTree,r=o?void 0:e.map(l=>this.toPrimaryKey(l)),i=o?e.map(l=>this.getNodePathById(this.toPrimaryKey(l))||[]):null,a=r?this.batchOperation({type:"update",array:e,primaryKeys:e.map(l=>this.toPrimaryKey(l)),metadata:t?.metadata}):this.batchOperation({type:"update",array:e,nodePaths:i||[],metadata:t?.metadata});return t?.flush&&this.commit(),a};this.withWaitForNode=(e,t,o)=>{let r=o?.waitForNode??!0;if(r===!0||typeof r=="number"){let a=r===!0?Lc:r;return isNaN(a)||(a=Lc),this.waitForNodePath(e,{timeout:a}).then(l=>{if(!l){let s=`Cannot find node path "${e.join("/")}" (we waited for it ${a}ms)`;return console.error(s),t({error:s,resolved:!1})}return t({resolved:!0})})}let i=t({resolved:void 0});return i instanceof Promise?i:Promise.resolve(i)};this.updateChildrenByNodePath=(e,t,o)=>this.withWaitForNode(t,({error:r})=>r?!1:this.updateChildrenByNodePath_Internal(e,t,o),o);this.updateChildrenByNodePath_Internal=(e,t,o)=>{let r=typeof e=="function"?e:()=>e;return this.updateDataArrayByNodePath_Internal([{nodePath:t,children:r}],o)};this.updateDataByNodePath=(e,t,o)=>this.isNodePathAvailable(t)?this.updateDataArrayByNodePath_Internal([{data:e,nodePath:t}],o):this.withWaitForNode(t,({error:r})=>r?!1:this.updateDataArrayByNodePath_Internal([{data:e,nodePath:t}],o),o);this.updateDataArrayByNodePath=(e,t)=>{if(t&&typeof t.waitForNode<"u"&&!t.waitForNode)return this.updateDataArrayByNodePath_Internal(e,t);let o=e.map(i=>i.nodePath);return Promise.allSettled(o.map(i=>this.withWaitForNode(i,({error:a})=>!a,t))).then(i=>i.every(Boolean)?this.updateDataArrayByNodePath_Internal(e,t):!1)};this.updateDataArrayByNodePath_Internal=(e,t)=>{let o=[],r=[];e.forEach(a=>{a.data?o.push(a.data):a.children&&o.push(a.children),r.push(a.nodePath)});let i=this.batchOperation({type:"update",array:o,nodePaths:r,metadata:t?.metadata});return t?.flush&&this.commit(),i};this.removeDataByPrimaryKey=(e,t)=>{if(this.getState().isTree)return this.removeDataByNodePath(this.getNodePathById(e)||[],t);let r=this.batchOperation({type:"delete",primaryKeys:[e],metadata:t?.metadata});return t?.flush&&this.commit(),r};this.removeDataByNodePath=(e,t)=>this.batchDeleteNodePaths([e],t);this.removeData=(e,t)=>{if(this.getState().isTree){let r=this.getNodePathById(this.toPrimaryKey(e));return this.removeDataByNodePath(r,t)}return this.batchDeletePrimaryKeys([this.toPrimaryKey(e)],t)};this.removeDataArrayByPrimaryKeys=(e,t)=>{if(this.getState().isTree){let r=e.map(i=>this.getNodePathById(i)||[]);return this.batchDeleteNodePaths(r,t)}return this.batchDeletePrimaryKeys(e,t)};this.batchDeleteNodePaths=(e,t)=>{let o=this.batchOperation({type:"delete",nodePaths:e||[],metadata:t?.metadata});return t?.flush&&this.commit(),o};this.batchDeletePrimaryKeys=(e,t)=>{let o=this.batchOperation({type:"delete",primaryKeys:e,metadata:t?.metadata});return t?.flush&&this.commit(),o};this.removeDataArray=(e,t)=>{if(this.getState().isTree){let i=e.map(a=>this.getNodePathById(this.toPrimaryKey(a))||[]);return this.batchDeleteNodePaths(i,t)}let r=e.map(this.toPrimaryKey);return this.batchDeletePrimaryKeys(r,t)};this.addData=(e,t)=>this.addDataArray([e],t);this.addDataArray=(e,t)=>this.insertDataArray(e,{...t,position:"end"});this.insertData=(e,t)=>this.insertDataArray([e],t);this.insertDataArray=(e,t)=>{let o=this.getState().isTree,r="before",i,a=t.nodePath;if(o&&a?.length)return this.withWaitForNode(a,({error:s})=>{if(s)return!1;if(t.position==="before"||t.position==="after")return this.batchTreeInsert(e,t.position,a,t);let c=u=>t.position==="start"?[...e,...u||[]]:[...u||[],...e];return this.updateChildrenByNodePath(c,a,t)},t);if(t.position==="before"||t.position==="after")r=t.position,i=t.primaryKey;else{let s=this.getOriginalDataArray();t.position==="start"?(r="before",s.length?i=this.toPrimaryKey(s[0]):i=void 0):(r="after",s.length?i=this.toPrimaryKey(s[s.length-1]):i=void 0)}let l=o?this.batchOperation({type:"insert",array:e,position:r,metadata:t?.metadata,nodePath:this.getNodePathById(i)||[]}):this.batchOperation({type:"insert",array:e,position:r,metadata:t?.metadata,primaryKey:i,nodePath:a});return t?.flush&&this.commit(),l};this.batchTreeInsert=(e,t,o,r)=>{if(o.length&&!this.isNodePathAvailable(o))return this.withWaitForNode(o,({error:a})=>{if(a)return!1;let l=this.batchOperation({type:"insert",array:e,position:t,metadata:r?.metadata,nodePath:o});return r?.flush&&this.commit(),l},r);let i=this.batchOperation({type:"insert",array:e,position:t,metadata:r?.metadata,nodePath:o});return r?.flush&&this.commit(),i};this.setSortInfo=e=>{let t=this.getState().multiSort;if(Array.isArray(e)){this.actions.sortInfo=e.length?t?e:e[0]:null;return}this.actions.sortInfo=e};this.setGroupBy=e=>{this.actions.groupBy=e};this.toggleGroupByField=e=>{let t=this.getState().groupBy;t.findIndex(r=>r.field===e)===-1?this.actions.groupBy=[...t,{field:e}]:this.actions.groupBy=t.filter(r=>r.field!==e)};this.isRowDisabledAt=e=>this.getRowInfoByIndex(e)?.rowDisabled??!1;this.isRowDisabled=e=>this.getRowInfoByPrimaryKey(e)?.rowDisabled??!1;this.setRowEnabledAt=(e,t)=>{let o=this.getState().rowDisabledState,r=o?new Dt(o):new Dt({enabledRows:!0,disabledRows:[]}),i=this.getRowInfoByIndex(e);i&&(r.setRowEnabled(i.id,t),this.actions.rowDisabledState=r)};this.setRowEnabled=(e,t)=>{let o=this.getRowInfoByPrimaryKey(e);o&&this.setRowEnabledAt(o.indexInAll,t)};this.enableAllRows=()=>{let e=this.getState().rowDisabledState;if(!e){this.actions.rowDisabledState=new Dt({enabledRows:!0,disabledRows:[]});return}let t=new Dt(e);t.enableAll(),this.actions.rowDisabledState=t};this.disableAllRows=()=>{let e=this.getState().rowDisabledState;if(!e){this.actions.rowDisabledState=new Dt({disabledRows:!0,enabledRows:[]});return}let t=new Dt(e);t.disableAll(),this.actions.rowDisabledState=t};this.areAllRowsEnabled=()=>{let e=this.getState().rowDisabledState;return e?e.areAllEnabled():!0};this.areAllRowsDisabled=()=>{let e=this.getState().rowDisabledState;return e?e.areAllDisabled():!1};this.getState=e.getState,this.getState().__apiRef.current=this,this.actions=e.actions,this.treeApi=new aa({...e,dataSourceApi:this})}getPendingOperationPromise(){return this.pendingPromise}batchOperation(e){if(!this.pendingPromise){this.pendingPromise=new Promise(o=>{this.resolvePendingPromise=o});let t=Math.max(0,this.getState().batchOperationDelay??0);t===0?this.batchOperationRafId=setTimeout(()=>{this.commit()}):this.batchOperationTimeoutId=setTimeout(()=>{this.batchOperationRafId=setTimeout(()=>{this.commit()})},t)}return e.type==="replace-all"&&(this.pendingOperations.length=0),this.pendingOperations.push(e),this.pendingPromise}commitOperations(e){if(!e.length)return;let t=this.getState().cache,{isTree:o,nodesKey:r}=this.getState(),i=t?Ro.clone(t,{light:!0}):new Ro({nodesKey:o?r:void 0});e.forEach(a=>{switch(a.type){case"update":a.array.forEach((u,d)=>{if(a.primaryKeys){let p=a.primaryKeys[d],f=this.getDataByPrimaryKey(p);f&&i.update(a.primaryKeys[d],u,f,a.metadata)}else if(a.nodePaths){let p=this.getDataByNodePath(a.nodePaths[d]);p&&(typeof u=="function"?i.updateChildren(a.nodePaths[d],u,p,a.metadata):i.updateNodePath(a.nodePaths[d],u,p,a.metadata))}});break;case"delete":a.primaryKeys?a.primaryKeys.forEach(u=>{let d=this.getDataByPrimaryKey(u);d&&i.delete(u,d,a.metadata)}):a.nodePaths&&a.nodePaths.forEach(u=>{let d=this.getDataByNodePath(u);d&&i.deleteNodePath(u,d,a.metadata)});break;case"insert":let l=a.primaryKey,s=a.position,c=a.nodePath;c?a.array.forEach(u=>{i.insertNodePath([...c],u,s,a.metadata),l=this.toPrimaryKey(u),c.pop(),c.push(l),s="after"}):a.array.forEach(u=>{i.insert(l,u,s,a.metadata),l=this.toPrimaryKey(u),s="after"});break;case"replace-all":i.resetDataSource(a.metadata);break}}),this.actions.cache=i}flush(){return this.commit()}waitForNodePath(e,t){let o=this.getState();if(this.isNodePathAvailable(e))return Promise.resolve(!0);let r=t?.timeout??Lc,i=o.waitForNodePathPromises.get(e);if(i)return i.promise;let a=Date.now(),l=()=>{},s=new Promise(c=>{let u,d;l=p=>{clearTimeout(d),u=p,o.waitForNodePathPromises.delete(e),c(p)},d=setTimeout(()=>{u===void 0&&l(!1)},r)});return o.waitForNodePathPromises.set(e,{timestamp:a,promise:s,resolve:l}),s}commit(){this.commitOperations(this.pendingOperations),this.pendingOperations.length=0;let e=this.pendingPromise;if(e&&this.resolvePendingPromise){let t=this.resolvePendingPromise;requestAnimationFrame(()=>{t(!0)}),this.pendingPromise=null,this.resolvePendingPromise=null}return e||Promise.resolve(!0)}};function Th(n){let e=n.cache;if(!e)return{sortInfo:!1,groupBy:!1,tree:!1,filterValue:!1,aggregationReducers:!1};let t=!1,o=!1,r=!1,i=!1,a=!1,l=e.getAffectedFields(),{sortInfo:s,groupBy:c,filterValue:u,aggregationReducers:d,nodesKey:p,isTree:f}=n;if(s&&s.length)if(l===!0)t=!0;else for(let m of s){let g=m.field;if(g&&(g=Array.isArray(g)?g:[g],t=g.reduce((h,S)=>h||typeof S!="function"?l.has(S):!1,!1),t))break}if(c&&c.length){if(l===!0)o=!0;else for(let m of c)if(m.field&&l.has(m.field)){o=!0;break}}if(f&&(l===!0?r=!0:r=l.has(p)),u&&u.length)if(l===!0)i=!0;else for(let m of u){if(m.id){i=!0;break}if(m.field&&l.has(m.field)){i=!0;break}}if(d&&Object.keys(d).length){if(l===!0)a=!0;else for(let m in d)if(d.hasOwnProperty(m)){let g=d[m];if(g.field){if(l.has(g.field)){a=!0;break}}else{a=!0;break}}}return{sortInfo:t,groupBy:o,filterValue:i,aggregationReducers:a,tree:r}}function rl(n){if(!n)return;let e=Object.keys(n);if(!e.length)return;let t={};for(let o=0,r=e.length;o<r;o++){let i=e[o],a=n[i].initialValue;a!==void 0&&(t[i]=typeof a=="function"?a():a)}return t}function il(n){let e=n.reducerKeys,t=n.reducers,o=n.results;for(let r=0,i=e.length;r<i;r++){let a=e[r],l=t[a].reducer;o[a]=l(o[a],n.rowInfo)}}function al(n){let e=Object.keys(n.reducers||{});if(!e.length||!n.results)return n.results;let t=n.reducers,o=n.results;for(let r=0,i=e.length;r<i;r++){let a=e[r],l=t[a].done;typeof l=="function"&&(o[a]=l(o[a],n.array))}return o}function Ch(n){return"groupNesting"in n?n.groupNesting??0:0}function Ih(n,e){if(!(!n.isGroupRow||!e.reducerId))return e.pivotTotalColumn&&(!e.pivotGroupKeys||e.pivotGroupKeys.length===0)?n.reducerResults?.[e.reducerId]:n.pivotValuesMap?.get(e.pivotGroupKeys)?.reducerResults?.[e.reducerId]}function tw(n,e,t,o){if(n==null&&e==null)return 0;if(n==null)return 1;if(e==null)return-1;let r=Array.isArray(t.type)?t.type[0]:t.type,a=(t.fn||r&&o[r]||o.string||qn.string)(n,e);return a===0?0:t.dir*a}function nw(n,e){if(!n?.length||!e)return[];let t=[];for(let o of n){let r=o.id?e[o.id]:void 0;!r?.pivotColumn||!r.pivotAggregator||t.push({dir:o.dir,type:o.type,fn:o.fn,pivotGroupKeys:r.pivotGroupKeys??[],reducerId:r.pivotAggregator.id,pivotTotalColumn:!!r.pivotTotalColumn})}return t}function ow(n){let e=[],t=[];for(let o of n){let r={row:o,children:[]},i=Ch(o);for(;t.length&&Ch(t[t.length-1].row)>=i;)t.pop();t.length?t[t.length-1].children.push(r):e.push(r),t.push(r)}return e}function rw(n){let e=[],t=(o,r)=>{o.forEach((i,a)=>{let l=[...r,a],s=i.row;s.indexInGroup=a,s.indexInParentGroups=l,s.indexInAll=e.length,e.push(s),t(i.children,l)})};return t(n,[]),e}function Rh(n,e,t,o){let r=nw(e,t);if(!r.length||!n.length)return n;let i={...qn,...o},a=ow(n),l=(c,u)=>{for(let d of r){let p=tw(Ih(c.row,d),Ih(u.row,d),d,i);if(p!==0)return p}return 0},s=c=>{c.sort(l);for(let u of c)s(u.children)};return s(a),rw(a)}var an=(n,e,t)=>{for(let o=0,r=t.length;o<r;o++){let i=t[o],a=n[i],l=e[i];if(a!==l)return!0}return!1};function iw(n){let e=n.get([wt]);if(!e)return;if(e.totalChildrenCount!=null)return e.totalChildrenCount;let t=0;for(let o=0;o<e.children.length;o++){let r=e.children[o]?.totalChildrenCount;if(r==null)return;t+=r}return t}function aw(n,e){let t=n.get([wt]);if(t)return e?t.totalChildrenCountUnfiltered:t.totalCountUnfiltered}function zc(){return!1}function lw(n,e,t,o,r,i){let a={dataSourceHasGrouping:!1,isTreeNode:!1,data:n,id:e,indexInAll:t,isGroupRow:!1,selfLoaded:!0,rowSelected:!1,rowDisabled:!1,isCellSelected:zc,hasSelectedCells:zc};return o&&(a.rowSelected=o(a)),r&&(a.rowDisabled=r(a)),i&&(a.isCellSelected=l=>i.isCellSelected(a.id,l),a.hasSelectedCells=l=>i.isCellSelectionInRow(a.id,l)),a}var sw=ht(()=>{console.warn(`Your "treeFilterFunction" should NOT MUTATE the data object. You're probably mutating the node children.
5
5
 
6
6
  Your filtering function probably looks like this:
7
7
 
@@ -13,18 +13,18 @@ function treeFilterFunction({ data }) {
13
13
 
14
14
  Make sure you avoid mutations.
15
15
 
16
- `)});function Ch(o){let{dataArray:e,treeFilterFunction:t,toPrimaryKey:n,getNodeChildren:r,isLeafNode:i,nodesKey:a,filterValue:l,filterTypes:s}=o,c=[],u=p=>i(p)||!Array.isArray(r(p)),d=p=>{if(u(p))return p;let f=Ch({...o,dataArray:r(p)});return f.length===0?!1:(p={...p,[a]:f},p)};for(let p=0,f=e.length;p<f;p++){let m=e[p],g=r(m),h=t({data:m,index:p,dataArray:e,primaryKey:n(m,p),filterValue:l,filterTypes:s,filterTreeNode:d,isLeafNode:u(m)});h&&(h===!0?h=m:typeof h=="object"&&h===m&&g!==r(h)&&PI(),c.push(h))}return c}var DI=[];function kc(o){let{filterTypes:e,marker:t,filterFunction:n,toPrimaryKey:r,treeFilterFunction:i,getNodeChildren:a,nodesKey:l,isLeafNode:s}=o,c=o.filterValue||DI,{dataArray:u}=o;t?.start({details:[{name:"Count before",value:u.length}]});let d=!!l&&!!a&&!!s,p=0;if(d){let f=n;u=Ch({dataArray:u,treeFilterFunction:i||(f?g=>g.isLeafNode?f(g):g.filterTreeNode(g.data):$a),toPrimaryKey:r,getNodeChildren:a,nodesKey:l,isLeafNode:s,filterValue:c,filterTypes:e})}else if(n)u=u.filter((f,m,g)=>n({data:f,index:m,dataArray:g,primaryKey:r(f,m),filterValue:c,filterTypes:e}));else{let f=Ua(c,e);f.length&&(u=u.filter((m,g,h)=>bc(f,{data:m,index:g,dataArray:h,primaryKey:r(m,g)})))}return t?.end({details:[{name:"Count after",value:u.length}]}),u}function Rh(o){let e,{state:t,previousState:n}=o,r=t.debugId,i;r&&(i=st(r).track.DataSource.label.PrepareData.start());let a=yh(t),l=Ya(t.sortInfo,t.groupBy),s=t.sortMode,c=l?.length?s==="local":!1;(t.lazyLoad||t.livePagination)&&(c=!1);let u=ao(n,t,["refetchKey"]),d=ao(n,t,["cache","originalDataArray","originalLazyGroupDataChangeDetect"]);Array.isArray(t.data)&&u&&(d=!0),!1&&(t.originalLazyGroupData=new q,d=!0);let f=t.cache?wn.clone(t.cache):void 0;f&&!f.isEmpty()&&(d=!0);let m=t.toPrimaryKey,g=t.nodesKey,h=t.isTree,S=g?k=>k[g]:void 0,y=g?k=>k[g]===void 0:void 0,T,b;d&&(t.indexer.clear(),t.lazyLoad||(T=f?.getMutations(),b=f?.getTreeMutations(),t.originalDataArray=t.indexer.indexArray(t.originalDataArray,{toPrimaryKey:m,cache:f,getNodeChildren:S,isLeafNode:y,nodesKey:g}),h&&t.waitForNodePathPromises.visit(({value:k},_)=>{k&&t.indexer.getDataForNodePath(_)!==void 0&&k.resolve(!0)}))),f&&(f.clear(),t.cache=void 0);let{filterFunction:C,treeFilterFunction:I,filterValue:w,filterTypes:v}=t,P=!!C||!!I||Array.isArray(w)&&w.length,E=t.filterMode==="local"&&!t.lazyLoad,M=P&&E,D=ao(n,t,["filterFunction","treeFilterFunction","filterValue","filterTypes"]),x=d||D,A=ao(n,t,["sortInfo"]),O=d||D||A,F=E&&(x||!t.lastFilterDataArray),z=c&&(O||!t.lastSortDataArray||a.sortInfo),L=t.groupBy,B=t.pivotBy,Y=!h&&(L.length>0||!!B),V=h,W=ao(n,t,["rowDisabledState","isRowDisabled"]),N=ao(n,t,["rowSelection","cellSelection","isRowSelected","multiRowSelectionTarget","originalLazyGroupDataChangeDetect"]),K=ao(n,t,["treeSelection","cellSelection","isNodeSelected","multiRowSelectionTarget","originalLazyGroupDataChangeDetect"]),ae=d||O||ao(n,t,["generateGroupRows","originalLazyGroupData","originalLazyGroupDataChangeDetect","groupBy","groupRowsState","pivotBy","aggregationReducers","pivotTotalColumnPosition","pivotGrandTotalColumnPosition","showSeparatePivotColumnForSingleAggregation","repeatWrappedGroupRows","rowsPerPage"]),re=d||O||ao(n,t,["originalLazyGroupData","originalLazyGroupDataChangeDetect","treeExpandState","isNodeExpanded","isNodeCollapsed","aggregationReducers","repeatWrappedGroupRows","rowsPerPage"]),ue=ao(n,t,["rowInfoReducers"]),fe=Y&&(ae||!t.lastGroupDataArray||a.groupBy)||N||W||ue,be=V&&(re||a.tree||!t.lastTreeDataArray)||K||W||ue,de=Date.now(),U=t.originalDataArray;if(V&&be){let k={marker:r?st(r).track.DataSource.label.TreeUnfilteredTreePaths.start():void 0,isLeafNode:y,getNodeChildren:S,toKey:m};t.unfilteredTreePaths=Bs(k,U).treePaths}if(P||(t.unfilteredCount=U.length),M){t.unfilteredCount=U.length;let k=de;F?(t.devToolsDetected&&(k=Date.now()),U=kc({marker:r?st(r).track.DataSource.label.Filter.start():void 0,getNodeChildren:S,isLeafNode:y,nodesKey:g,treeFilterFunction:I,dataArray:U,toPrimaryKey:m,filterTypes:v,filterFunction:C,filterValue:w}),t.devToolsDetected&&t.debugTimings.set("filter",Date.now()-k)):U=t.lastFilterDataArray,t.lastFilterDataArray=U,t.filteredAt=de}if(t.filteredCount=(t.lazyLoad&&L.length?II(t.originalLazyGroupData):void 0)??U.length,t.lazyLoad&&(t.unfilteredCount=wI(t.originalLazyGroupData,L.length>0)??t.filteredCount),t.postFilterDataArray=U,c){let k=ro.knownTypes;if(ro.knownTypes={...k,...t.sortTypes},z){let _=de;if(t.devToolsDetected&&(_=Date.now()),r&&(e=st(r).track.DataSource.label.Sort.start({details:[{name:"Count",value:U.length}]})),t.sortFunction?(U=t.sortFunction(l,[...U]),e&&(e.end(),e=void 0)):h?U=el(l,U,{marker:e,inplace:!1,isLeafNode:y,getNodeChildren:S,toKey:m,nodesKey:g}):U=ro(l,[...U],{marker:e}),r&&(e?.end(),e=void 0),t.devToolsDetected){let me=Date.now()-_;t.debugTimings.set("sort",me)}}else U=t.lastSortDataArray;ro.knownTypes=k,t.lastSortDataArray=U,t.sortedAt=de}t.postSortDataArray=U;let ie=t.dataArray,ge=t.rowSelection instanceof Oe?t.rowSelection:void 0,Z=t.treeExpandState instanceof ft?t.treeExpandState:void 0,ee=t.cellSelection instanceof Ue?t.cellSelection:void 0;ge&&(ge.getConfig=mt(t)),ge?.xcache();let j=t.selectionMode==="single-row"?k=>k.id===t.rowSelection:t.selectionMode==="multi-row"?k=>{let _=ge;return k.isGroupRow?_.getGroupRowSelectionState(k.groupKeys):_.isRowSelected(k.id,k.dataSourceHasGrouping?k.groupKeys:void 0)}:void 0,se=t.isRowDisabled||Lc;t.isRowSelected&&t.selectionMode==="multi-row"&&(j=k=>t.isRowSelected(k,ge,t.selectionMode));let ne;t.isNodeExpanded&&(ne=k=>t.isNodeExpanded(k,Z)),t.isNodeCollapsed&&(ne=k=>!t.isNodeExpanded(k,Z)),ne||(ne=_=>Z.isNodeExpanded(_.nodePath));let pe=t.rowInfoReducers;if(Y){if(fe){let k=de;t.devToolsDetected&&(k=Date.now());let _=t.aggregationReducers,me=t.lazyLoad?uf({groupBy:L,pivot:B,mappings:t.pivotMappings,reducers:_,indexer:t.indexer,toPrimaryKey:m,cache:f,marker:r?st(r).track.DataSource.label.LazyGroup.start():void 0},t.originalLazyGroupData):pa({groupBy:L,pivot:B,reducers:_,marker:r?st(r).track.DataSource.label.Group.start():void 0},U);t.groupDeepMap=me.deepMap,ge&&(ge.getConfig=mt(t));let Te=Object.keys(pe||{}),Pe=al(pe),Re={reducers:pe,results:Pe,reducerKeys:Te,rowInfo:{}},Me=Pe?Xe=>{Re.rowInfo=Xe,ll(Re)}:void 0,qe=ee?Xe=>{Xe.isCellSelected=G=>ee.isCellSelected(Xe.id,G)}:void 0,We=Me||qe?Ac(Me,qe):void 0,it=gf({marker:r?st(r).track.DataSource.label.FlattenTree.start():void 0,groupResult:me,lazyLoad:!!t.lazyLoad,reducers:_,toPrimaryKey:m,isRowSelected:j,rowSelectionState:ge,withRowInfo:We,repeatWrappedGroupRows:t.rowsPerPage!=null?t.repeatWrappedGroupRows:!1,rowsPerPage:t.rowsPerPage,groupRowsState:t.groupRowsState,generateGroupRows:t.generateGroupRows});ie=it.data,t.rowInfoReducerResults=sl({reducers:pe,results:Pe,array:ie}),t.groupRowsIndexesInDataArray=it.groupRowsIndexes,t.reducerResults=me.reducerResults;let at=B?mh({deepMap:me.topLevelPivotColumns,pivotBy:B,pivotTotalColumnPosition:t.pivotTotalColumnPosition??"end",pivotGrandTotalColumnPosition:t.pivotGrandTotalColumnPosition??!1,reducers:t.aggregationReducers,showSeparatePivotColumnForSingleAggregation:t.showSeparatePivotColumnForSingleAggregation}):void 0;t.pivotColumns=at?.columns,t.pivotColumnGroups=at?.columnGroups;let et=Th(ie,l,t.pivotColumns,t.sortTypes);et!==ie&&(ie=et,t.groupRowsIndexesInDataArray=ie.map((Xe,G)=>Xe.isGroupRow?G:-1).filter(Xe=>Xe>=0)),t.devToolsDetected&&t.debugTimings.set("group-and-pivot",Date.now()-k)}else ie=t.lastGroupDataArray;t.lastGroupDataArray=ie,t.groupedAt=de}else if(V){if(be){let k=de;t.devToolsDetected&&(k=Date.now());let _=t.aggregationReducers,me={marker:r?st(r).track.DataSource.label.Tree.start():void 0,isLeafNode:y,getNodeChildren:S,toKey:m,reducers:_},Te=Bs(me,U);t.treeDeepMap=Te.deepMap,t.treePaths=Te.treePaths;let Pe=t.selectionMode==="multi-row"?sh(t.treeSelection,t.selectionMode,t):void 0;t.treeSelectionState=Pe;let Re=Object.keys(pe||{}),Me=al(pe),qe={reducers:pe,results:Me,reducerKeys:Re,rowInfo:{}},We=Me?te=>{qe.rowInfo=te,ll(qe)}:void 0,it=ee?te=>{te.isCellSelected=ye=>ee.isCellSelected(te.id,ye)}:void 0,at=We||it?Ac(We,it):void 0,et=t.selectionMode==="single-row"?te=>te.id===t.treeSelection:t.selectionMode==="multi-row"?te=>Pe.isNodeSelected(te.nodePath):void 0,Xe=t.rowsPerPage!=null?t.repeatWrappedGroupRows:!1;ie=mf({marker:r?st(r).track.DataSource.label.FlattenTree.start():void 0,treeResult:Te,treeParams:me,dataArray:U,reducers:_,toPrimaryKey:m,isNodeSelected:et,isNodeExpanded:ne,treeSelectionState:Pe,withRowInfo:at,repeatWrappedGroupRows:Xe,rowsPerPage:t.rowsPerPage}).data,t.rowInfoReducerResults=sl({reducers:pe,results:Me,array:ie}),t.reducerResults=Te.reducerResults,t.totalLeafNodesCount=Te.deepMap.get([])?.totalLeafNodesCount??0,t.treeAt=de,t.devToolsDetected&&t.debugTimings.set("tree",Date.now()-k)}else ie=t.lastTreeDataArray;t.lastTreeDataArray=ie}else if(t.groupDeepMap=void 0,t.pivotColumns=void 0,t.pivotColumnGroups=void 0,t.groupRowsIndexesInDataArray=void 0,n.postSortDataArray!=t.postSortDataArray||ae||N||W||ue){let _=Object.keys(pe||{}),me=al(pe),Te={reducers:pe,results:me,reducerKeys:_,rowInfo:{}};ie=U.map((Pe,Re)=>{let Me=vI(Pe,Pe?m(Pe):Re,Re,j,se,ee);return me&&(Te.rowInfo=Me,ll(Te)),Me}),t.rowInfoReducerResults=sl({reducers:pe,results:me,array:ie})}if(t.postGroupDataArray=ie,ie!==t.dataArray&&(t.updatedAt=de),t.dataArray=ie,t.reducedAt=de,t.selectionMode==="multi-row"){let k=t.rowSelection instanceof Oe&&!t.rowSelection.onlyUsePrimaryKeys;if(Y&&t.lazyLoad&&!k){r&&(e=st(r).track.DataSource.label.ComputeSelectionCountLazy.start());let _=!0,me=!1;t.dataArray.forEach(Pe=>{if(!Pe.isTreeNode&&Pe.isGroupRow&&Pe.groupKeys.length===1){let{rowSelected:Re}=Pe;Re!==!0&&(_=!1),(Re===!0||Re===null)&&(me=!0)}});let{rowSelection:Te}=t;Te instanceof Oe&&Te.getLazyHiddenRowsCount([])&&(Te.defaultSelection?me=!0:_=!1),t.allRowsSelected=_,t.someRowsSelected=me,r&&(e?.end(),e=void 0)}else{r&&(e=st(r).track.DataSource.label.ComputeSelectionCount.start());let _=t.isTree?t.treeSelectionState?.getSelectionCountFor([]):t.rowSelection.getSelectionCountFor([]);_?(t.allRowsSelected=_.deselectedCount===0,t.someRowsSelected=_.selectedCount>0):(t.allRowsSelected=t.totalLeafNodesCount===0,t.someRowsSelected=!1),r&&(e?.end(),e=void 0)}}return t.originalDataArrayChanged=d,d&&(t.originalDataArrayChangedInfo={timestamp:de,mutations:T?.size?T:void 0,treeMutations:b?.size?b:void 0}),t.rowInfoStore.notifyDataArray(ie,{marker:r?st(r).track.DataSource.label.DiffRowInfoInStore:void 0,dataSourceState:t,previousDataSourceState:n}),i&&i?.track.DataSource.label.PrepareData.end({details:[F||z||fe||be?{name:"Performed operations",value:[F?"filter":null,z?"sort":null,fe?"group":null,be?"tree":null].filter(Ao).join(", ")}:null,u?{name:"Refetch key",value:`Old ${n.refetchKey} -> New ${t.refetchKey}`}:null,d?{name:"Original data array changed",value:""}:null,{name:"Unfiltered data length",value:t.originalDataArray.length}].filter(Ao)}),t}var gt=H(require("react"));function Ih(){return Eo()}var nt=require("react");var Gt=require("react");function vn(o,e){let t=(0,Gt.useRef)({}),n=(0,Gt.useRef)({}),r=n.current,i=(0,Gt.useRef)({}),a=i.current,l=[];for(let s in e)e.hasOwnProperty(s)&&(e[s]!==t.current[s]&&(a[s]=e[s],r[s]=t.current[s]),l.push(e[s]));t.current=e,(0,Gt.useEffect)(()=>{let s=i.current,c;return Object.keys(s).length!==0&&(c=o(s,r)),i.current={},n.current={},c},l)}function xI(o,e){let t=(0,Gt.useRef)({}),n=(0,Gt.useRef)({}),r=n.current,i=(0,Gt.useRef)({}),a=i.current,l=[];for(let s in e)e.hasOwnProperty(s)&&(e[s]!==t.current[s]&&(a[s]=e[s],r[s]=t.current[s]),l.push(e[s]));t.current=e,(0,Gt.useLayoutEffect)(()=>{let s=i.current,c;return Object.keys(s).length!==0&&(c=o(s,r)),i.current={},n.current={},c},l)}function EI(o,e){let t=[];for(let n in e)e.hasOwnProperty(n)&&t.push(e[n]);(0,Gt.useEffect)(o,t)}function MI(o,e,t){return e=e.replaceAll("$ERR_CODE",o),e=`${e}
16
+ `)});function wh(n){let{dataArray:e,treeFilterFunction:t,toPrimaryKey:o,getNodeChildren:r,isLeafNode:i,nodesKey:a,filterValue:l,filterTypes:s}=n,c=[],u=p=>i(p)||!Array.isArray(r(p)),d=p=>{if(u(p))return p;let f=wh({...n,dataArray:r(p)});return f.length===0?!1:(p={...p,[a]:f},p)};for(let p=0,f=e.length;p<f;p++){let m=e[p],g=r(m),h=t({data:m,index:p,dataArray:e,primaryKey:o(m,p),filterValue:l,filterTypes:s,filterTreeNode:d,isLeafNode:u(m)});h&&(h===!0?h=m:typeof h=="object"&&h===m&&g!==r(h)&&sw(),c.push(h))}return c}var cw=[];function Vc(n){let{filterTypes:e,marker:t,filterFunction:o,toPrimaryKey:r,treeFilterFunction:i,getNodeChildren:a,nodesKey:l,isLeafNode:s}=n,c=n.filterValue||cw,{dataArray:u}=n;t?.start({details:[{name:"Count before",value:u.length}]});let d=!!l&&!!a&&!!s,p=0;if(d){let f=o;u=wh({dataArray:u,treeFilterFunction:i||(f?g=>g.isLeafNode?f(g):g.filterTreeNode(g.data):ja),toPrimaryKey:r,getNodeChildren:a,nodesKey:l,isLeafNode:s,filterValue:c,filterTypes:e})}else if(o)u=u.filter((f,m,g)=>o({data:f,index:m,dataArray:g,primaryKey:r(f,m),filterValue:c,filterTypes:e}));else{let f=Wa(c,e);f.length&&(u=u.filter((m,g,h)=>Tc(f,{data:m,index:g,dataArray:h,primaryKey:r(m,g)})))}return t?.end({details:[{name:"Count after",value:u.length}]}),u}function vh(n){let e,{state:t,previousState:o}=n,r=t.debugId,i;r&&(i=st(r).track.DataSource.label.PrepareData.start());let a=Th(t),l=Ua(t.sortInfo,t.groupBy),s=t.sortMode,c=l?.length?s==="local":!1;(t.lazyLoad||t.livePagination)&&(c=!1);let u=an(o,t,["refetchKey"]),d=an(o,t,["cache","originalDataArray","originalLazyGroupDataChangeDetect"]);Array.isArray(t.data)&&u&&(d=!0),!1&&(t.originalLazyGroupData=new U,d=!0);let f=t.cache?Ro.clone(t.cache):void 0;f&&!f.isEmpty()&&(d=!0);let m=t.toPrimaryKey,g=t.nodesKey,h=t.isTree,S=g?O=>O[g]:void 0,y=g?O=>O[g]===void 0:void 0,C,T;d&&(t.indexer.clear(),t.lazyLoad||(C=f?.getMutations(),T=f?.getTreeMutations(),t.originalDataArray=t.indexer.indexArray(t.originalDataArray,{toPrimaryKey:m,cache:f,getNodeChildren:S,isLeafNode:y,nodesKey:g}),h&&t.waitForNodePathPromises.visit(({value:O},A)=>{O&&t.indexer.getDataForNodePath(A)!==void 0&&O.resolve(!0)}))),f&&(f.clear(),t.cache=void 0);let{filterFunction:b,treeFilterFunction:R,filterValue:w,filterTypes:v}=t,P=!!b||!!R||Array.isArray(w)&&w.length,D=t.filterMode==="local"&&!t.lazyLoad,M=P&&D,x=an(o,t,["filterFunction","treeFilterFunction","filterValue","filterTypes"]),E=d||x,z=an(o,t,["sortInfo"]),V=d||x||z,N=D&&(E||!t.lastFilterDataArray),L=c&&(V||!t.lastSortDataArray||a.sortInfo),F=t.groupBy,B=t.pivotBy,X=!h&&(F.length>0||!!B),_=h,k=an(o,t,["rowDisabledState","isRowDisabled"]),K=an(o,t,["rowSelection","cellSelection","isRowSelected","multiRowSelectionTarget","originalLazyGroupDataChangeDetect"]),Q=an(o,t,["treeSelection","cellSelection","isNodeSelected","multiRowSelectionTarget","originalLazyGroupDataChangeDetect"]),Ie=d||V||an(o,t,["generateGroupRows","originalLazyGroupData","originalLazyGroupDataChangeDetect","groupBy","groupRowsState","pivotBy","aggregationReducers","pivotTotalColumnPosition","pivotGrandTotalColumnPosition","showSeparatePivotColumnForSingleAggregation","repeatWrappedGroupRows","rowsPerPage"]),se=d||V||an(o,t,["originalLazyGroupData","originalLazyGroupDataChangeDetect","treeExpandState","isNodeExpanded","isNodeCollapsed","aggregationReducers","repeatWrappedGroupRows","rowsPerPage"]),me=an(o,t,["rowInfoReducers"]),ve=X&&(Ie||!t.lastGroupDataArray||a.groupBy)||K||k||me,Pe=_&&(se||a.tree||!t.lastTreeDataArray)||Q||k||me,ue=Date.now(),oe=t.originalDataArray;if(_&&Pe){let O={marker:r?st(r).track.DataSource.label.TreeUnfilteredTreePaths.start():void 0,isLeafNode:y,getNodeChildren:S,toKey:m};t.unfilteredTreePaths=Ks(O,oe).treePaths}if(P||(t.unfilteredCount=oe.length),M){t.unfilteredCount=oe.length;let O=ue;N?(t.devToolsDetected&&(O=Date.now()),oe=Vc({marker:r?st(r).track.DataSource.label.Filter.start():void 0,getNodeChildren:S,isLeafNode:y,nodesKey:g,treeFilterFunction:R,dataArray:oe,toPrimaryKey:m,filterTypes:v,filterFunction:b,filterValue:w}),t.devToolsDetected&&t.debugTimings.set("filter",Date.now()-O)):oe=t.lastFilterDataArray,t.lastFilterDataArray=oe,t.filteredAt=ue}if(t.filteredCount=(t.lazyLoad&&F.length?iw(t.originalLazyGroupData):void 0)??oe.length,t.lazyLoad&&(t.unfilteredCount=aw(t.originalLazyGroupData,F.length>0)??t.filteredCount),t.postFilterDataArray=oe,c){let O=Ut.knownTypes;if(Ut.knownTypes={...O,...t.sortTypes},L){let A=ue;if(t.devToolsDetected&&(A=Date.now()),r&&(e=st(r).track.DataSource.label.Sort.start({details:[{name:"Count",value:oe.length}]})),t.sortFunction?(oe=t.sortFunction(l,[...oe]),e&&(e.end(),e=void 0)):h?oe=Qa(l,oe,{marker:e,inplace:!1,isLeafNode:y,getNodeChildren:S,toKey:m,nodesKey:g}):oe=Ut(l,[...oe],{marker:e}),r&&(e?.end(),e=void 0),t.devToolsDetected){let de=Date.now()-A;t.debugTimings.set("sort",de)}}else oe=t.lastSortDataArray;Ut.knownTypes=O,t.lastSortDataArray=oe,t.sortedAt=ue}t.postSortDataArray=oe;let ce=t.dataArray,pe=t.rowSelection instanceof Oe?t.rowSelection:void 0,Z=t.treeExpandState instanceof ft?t.treeExpandState:void 0,J=t.cellSelection instanceof Ue?t.cellSelection:void 0;pe&&(pe.getConfig=mt(t)),pe?.xcache();let W=t.selectionMode==="single-row"?O=>O.id===t.rowSelection:t.selectionMode==="multi-row"?O=>{let A=pe;return O.isGroupRow?A.getGroupRowSelectionState(O.groupKeys):A.isRowSelected(O.id,O.dataSourceHasGrouping?O.groupKeys:void 0)}:void 0,ie=t.isRowDisabled||zc;t.isRowSelected&&t.selectionMode==="multi-row"&&(W=O=>t.isRowSelected(O,pe,t.selectionMode));let ne;t.isNodeExpanded&&(ne=O=>t.isNodeExpanded(O,Z)),t.isNodeCollapsed&&(ne=O=>!t.isNodeExpanded(O,Z)),ne||(ne=A=>Z.isNodeExpanded(A.nodePath));let le=t.rowInfoReducers;if(X){if(ve){let O=ue;t.devToolsDetected&&(O=Date.now());let A=t.aggregationReducers,de=t.lazyLoad?uf({groupBy:F,pivot:B,mappings:t.pivotMappings,reducers:A,indexer:t.indexer,toPrimaryKey:m,cache:f,marker:r?st(r).track.DataSource.label.LazyGroup.start():void 0},t.originalLazyGroupData):ua({groupBy:F,pivot:B,reducers:A,marker:r?st(r).track.DataSource.label.Group.start():void 0},oe);t.groupDeepMap=de.deepMap,pe&&(pe.getConfig=mt(t));let ye=Object.keys(le||{}),we=rl(le),be={reducers:le,results:we,reducerKeys:ye,rowInfo:{}},Me=we?Xe=>{be.rowInfo=Xe,il(be)}:void 0,qe=J?Xe=>{Xe.isCellSelected=G=>J.isCellSelected(Xe.id,G)}:void 0,We=Me||qe?Oc(Me,qe):void 0,it=gf({marker:r?st(r).track.DataSource.label.FlattenTree.start():void 0,groupResult:de,lazyLoad:!!t.lazyLoad,reducers:A,toPrimaryKey:m,isRowSelected:W,rowSelectionState:pe,withRowInfo:We,repeatWrappedGroupRows:t.rowsPerPage!=null?t.repeatWrappedGroupRows:!1,rowsPerPage:t.rowsPerPage,groupRowsState:t.groupRowsState,generateGroupRows:t.generateGroupRows});ce=it.data,t.rowInfoReducerResults=al({reducers:le,results:we,array:ce}),t.groupRowsIndexesInDataArray=it.groupRowsIndexes,t.reducerResults=de.reducerResults;let at=B?yh({deepMap:de.topLevelPivotColumns,pivotBy:B,pivotTotalColumnPosition:t.pivotTotalColumnPosition??"end",pivotGrandTotalColumnPosition:t.pivotGrandTotalColumnPosition??!1,reducers:t.aggregationReducers,showSeparatePivotColumnForSingleAggregation:t.showSeparatePivotColumnForSingleAggregation}):void 0;t.pivotColumns=at?.columns,t.pivotColumnGroups=at?.columnGroups;let et=Rh(ce,l,t.pivotColumns,t.sortTypes);et!==ce&&(ce=et,t.groupRowsIndexesInDataArray=ce.map((Xe,G)=>Xe.isGroupRow?G:-1).filter(Xe=>Xe>=0)),t.devToolsDetected&&t.debugTimings.set("group-and-pivot",Date.now()-O)}else ce=t.lastGroupDataArray;t.lastGroupDataArray=ce,t.groupedAt=ue}else if(_){if(Pe){let O=ue;t.devToolsDetected&&(O=Date.now());let A=t.aggregationReducers,de={marker:r?st(r).track.DataSource.label.Tree.start():void 0,isLeafNode:y,getNodeChildren:S,toKey:m,reducers:A},ye=Ks(de,oe);t.treeDeepMap=ye.deepMap,t.treePaths=ye.treePaths;let we=t.selectionMode==="multi-row"?dh(t.treeSelection,t.selectionMode,t):void 0;t.treeSelectionState=we;let be=Object.keys(le||{}),Me=rl(le),qe={reducers:le,results:Me,reducerKeys:be,rowInfo:{}},We=Me?ee=>{qe.rowInfo=ee,il(qe)}:void 0,it=J?ee=>{ee.isCellSelected=ge=>J.isCellSelected(ee.id,ge)}:void 0,at=We||it?Oc(We,it):void 0,et=t.selectionMode==="single-row"?ee=>ee.id===t.treeSelection:t.selectionMode==="multi-row"?ee=>we.isNodeSelected(ee.nodePath):void 0,Xe=t.rowsPerPage!=null?t.repeatWrappedGroupRows:!1;ce=mf({marker:r?st(r).track.DataSource.label.FlattenTree.start():void 0,treeResult:ye,treeParams:de,dataArray:oe,reducers:A,toPrimaryKey:m,isNodeSelected:et,isNodeExpanded:ne,treeSelectionState:we,withRowInfo:at,repeatWrappedGroupRows:Xe,rowsPerPage:t.rowsPerPage}).data,t.rowInfoReducerResults=al({reducers:le,results:Me,array:ce}),t.reducerResults=ye.reducerResults,t.totalLeafNodesCount=ye.deepMap.get([])?.totalLeafNodesCount??0,t.treeAt=ue,t.devToolsDetected&&t.debugTimings.set("tree",Date.now()-O)}else ce=t.lastTreeDataArray;t.lastTreeDataArray=ce}else if(t.groupDeepMap=void 0,t.pivotColumns=void 0,t.pivotColumnGroups=void 0,t.groupRowsIndexesInDataArray=void 0,o.postSortDataArray!=t.postSortDataArray||Ie||K||k||me){let A=Object.keys(le||{}),de=rl(le),ye={reducers:le,results:de,reducerKeys:A,rowInfo:{}};ce=oe.map((we,be)=>{let Me=lw(we,we?m(we):be,be,W,ie,J);return de&&(ye.rowInfo=Me,il(ye)),Me}),t.rowInfoReducerResults=al({reducers:le,results:de,array:ce})}if(t.postGroupDataArray=ce,ce!==t.dataArray&&(t.updatedAt=ue),t.dataArray=ce,t.reducedAt=ue,t.selectionMode==="multi-row"){let O=t.rowSelection instanceof Oe&&!t.rowSelection.onlyUsePrimaryKeys;if(X&&t.lazyLoad&&!O){r&&(e=st(r).track.DataSource.label.ComputeSelectionCountLazy.start());let A=!0,de=!1;t.dataArray.forEach(we=>{if(!we.isTreeNode&&we.isGroupRow&&we.groupKeys.length===1){let{rowSelected:be}=we;be!==!0&&(A=!1),(be===!0||be===null)&&(de=!0)}});let{rowSelection:ye}=t;ye instanceof Oe&&ye.getLazyHiddenRowsCount([])&&(ye.defaultSelection?de=!0:A=!1),t.allRowsSelected=A,t.someRowsSelected=de,r&&(e?.end(),e=void 0)}else{r&&(e=st(r).track.DataSource.label.ComputeSelectionCount.start());let A=t.isTree?t.treeSelectionState?.getSelectionCountFor([]):t.rowSelection.getSelectionCountFor([]);A?(t.allRowsSelected=A.deselectedCount===0,t.someRowsSelected=A.selectedCount>0):(t.allRowsSelected=t.totalLeafNodesCount===0,t.someRowsSelected=!1),r&&(e?.end(),e=void 0)}}return t.originalDataArrayChanged=d,d&&(t.originalDataArrayChangedInfo={timestamp:ue,mutations:C?.size?C:void 0,treeMutations:T?.size?T:void 0}),t.rowInfoStore.notifyDataArray(ce,{marker:r?st(r).track.DataSource.label.DiffRowInfoInStore:void 0,dataSourceState:t,previousDataSourceState:o}),i&&i?.track.DataSource.label.PrepareData.end({details:[N||L||ve||Pe?{name:"Performed operations",value:[N?"filter":null,L?"sort":null,ve?"group":null,Pe?"tree":null].filter(An).join(", ")}:null,u?{name:"Refetch key",value:`Old ${o.refetchKey} -> New ${t.refetchKey}`}:null,d?{name:"Original data array changed",value:""}:null,{name:"Unfiltered data length",value:t.originalDataArray.length}].filter(An)}),t}var gt=H(require("react"));function Ph(){return Mn()}var ot=require("react");var Gt=require("react");function wo(n,e){let t=(0,Gt.useRef)({}),o=(0,Gt.useRef)({}),r=o.current,i=(0,Gt.useRef)({}),a=i.current,l=[];for(let s in e)e.hasOwnProperty(s)&&(e[s]!==t.current[s]&&(a[s]=e[s],r[s]=t.current[s]),l.push(e[s]));t.current=e,(0,Gt.useEffect)(()=>{let s=i.current,c;return Object.keys(s).length!==0&&(c=n(s,r)),i.current={},o.current={},c},l)}function uw(n,e){let t=(0,Gt.useRef)({}),o=(0,Gt.useRef)({}),r=o.current,i=(0,Gt.useRef)({}),a=i.current,l=[];for(let s in e)e.hasOwnProperty(s)&&(e[s]!==t.current[s]&&(a[s]=e[s],r[s]=t.current[s]),l.push(e[s]));t.current=e,(0,Gt.useLayoutEffect)(()=>{let s=i.current,c;return Object.keys(s).length!==0&&(c=n(s,r)),i.current={},o.current={},c},l)}function dw(n,e){let t=[];for(let o in e)e.hasOwnProperty(o)&&t.push(e[o]);(0,Gt.useEffect)(n,t)}function pw(n,e,t){return e=e.replaceAll("$ERR_CODE",n),e=`${e}
17
17
 
18
- ERROR_CODE = ${o}
18
+ ERROR_CODE = ${n}
19
19
 
20
- See http://infinite-table.com/docs/reference/error-codes#${o} for more info.`,{code:o,message:e,type:t??"error"}}function wh(o){return Object.entries(o).reduce((e,[t,n])=>{let r=t,i=MI(r,typeof n=="string"?n:n.message,typeof n=="string"?void 0:n.type);return e[r]=i,e},{})}function AI(o){return{message:o.join(""),type:"warning"}}function _I(o){return{message:o.join(""),type:"error"}}var OI=wh({DS001:AI`The "data" prop of your DataSource seems to be updating too frequently.
21
- Make sure you don't pass a new reference on every render.`}),FI=wh({CSS001_CSS:_I`It appears you have not loaded the CSS file for InfiniteTable.
20
+ See http://infinite-table.com/docs/reference/error-codes#${n} for more info.`,{code:n,message:e,type:t??"error"}}function xh(n){return Object.entries(n).reduce((e,[t,o])=>{let r=t,i=pw(r,typeof o=="string"?o:o.message,typeof o=="string"?void 0:o.type);return e[r]=i,e},{})}function fw(n){return{message:n.join(""),type:"warning"}}function mw(n){return{message:n.join(""),type:"error"}}var gw=xh({DS001:fw`The "data" prop of your DataSource seems to be updating too frequently.
21
+ Make sure you don't pass a new reference on every render.`}),hw=xh({CSS001_CSS:mw`It appears you have not loaded the CSS file for InfiniteTable.
22
22
  In most environments, you should be able to fix this by adding the following line:
23
23
 
24
24
  import '@infinite-table/infinite-react/index.css'
25
- `}),vh={...OI,...FI};var Ct=new Map,Ph=o=>{Ct.delete(o),Xo.delete(o),Co.delete(o),Io.delete(o),Ro.delete(o),io.delete(o)};function zc(o,e,t){let n=Ct.get(o);if(!n)return;let r=Xo.get(o);(!r||!Object.hasOwn(r,e))&&Xo.set(o,{...r||{},[e]:n.getState()[e]}),Co.set(o,{...Co.get(o)||{},[e]:t}),n.actions[e]=t}function cl(o,e,t){let n=Ct.get(o);if(!n)return;let r=Io.get(o);(!r||!Object.hasOwn(r,e))&&Io.set(o,{...r||{},[e]:n.getDataSourceState()[e]}),Ro.set(o,{...Ro.get(o)||{},[e]:t}),n.dataSourceActions[e]=t}var NI=o=>{let e=o.type==="error"?xo(o.debugId):Lt(o.debugId),t=o.type==="error"?Qg:Zg,n=o.debugId?`${o.code}-${o.debugId}`:o.code,r=o.message;o.debugId&&(r=`${r}
25
+ `}),Dh={...gw,...hw};var Tt=new Map,Mh=n=>{Tt.delete(n),Xn.delete(n),Cn.delete(n),Rn.delete(n),In.delete(n),rn.delete(n)};function Gc(n,e,t){let o=Tt.get(n);if(!o)return;let r=Xn.get(n);(!r||!Object.hasOwn(r,e))&&Xn.set(n,{...r||{},[e]:o.getState()[e]}),Cn.set(n,{...Cn.get(n)||{},[e]:t}),o.actions[e]=t}function ll(n,e,t){let o=Tt.get(n);if(!o)return;let r=Rn.get(n);(!r||!Object.hasOwn(r,e))&&Rn.set(n,{...r||{},[e]:o.getDataSourceState()[e]}),In.set(n,{...In.get(n)||{},[e]:t}),o.dataSourceActions[e]=t}var yw=n=>{let e=n.type==="error"?Dn(n.debugId):Lt(n.debugId),t=n.type==="error"?th:eh,o=n.debugId?`${n.code}-${n.debugId}`:n.code,r=n.message;n.debugId&&(r=`${r}
26
26
 
27
- Component DEBUG_ID = "${o.debugId}"`),t(r,n,e)},di=o=>{let{debugId:e,key:t}=o,n=vh[t];if(n&&(NI({...n,debugId:e}),e&&t)){let r=Ct.get(e);r&&r.getState().devToolsDetected&&n&&(r.getState().debugWarnings.set(t,{...n,debugId:e,status:"new"}),Zo(e))}};globalThis.logDevToolsWarning=di;var Zo=o=>{let e=window.__INFINITE_TABLE_DEVTOOLS_HOOK__;if(!e)return;let t=Ct.get(o);t&&e(o,t)};function Dh(o){let{getDataSourceState:e,dataSourceActions:t,dataSourceState:n}=o,{data:r,dataArray:i,notifyScrollbarsChange:a,refetchKey:l,sortInfo:s,shouldReloadData:c,groupBy:u,pivotBy:d,filterValue:p,filterMode:f,livePagination:m,livePaginationCursor:g,filterTypes:h,cursorId:S}=n,[y,T]=(0,nt.useState)({vertical:!1,horizontal:!1}),b=(0,nt.useRef)(y);(0,nt.useEffect)(()=>(a.onChange(M=>{M&&(b.current=M,T(M))}),()=>a.destroy()),[a]),(0,nt.useEffect)(()=>{if(!m)return;let M=requestAnimationFrame(()=>{b.current?.vertical||g&&(t.cursorId=g)});return()=>cancelAnimationFrame(M)},[g]),(0,nt.useEffect)(()=>{if(!m||g!==void 0)return;let M=requestAnimationFrame(()=>{b.current?.vertical||S!=null&&i.length&&(t.cursorId=i.length)});return()=>cancelAnimationFrame(M)},[i.length,g]),(0,nt.useEffect)(()=>{let M=e(),{livePaginationCursor:D,livePagination:x,dataArray:A}=M;!y.vertical&&x&&(D?t.cursorId=D:D===void 0&&A.length&&(t.cursorId=A.length))},[y.vertical]);let C=(0,nt.useMemo)(()=>Eg(),[])(p,h,f),I={sortInfo:c.sortInfo?s:null,groupBy:c.groupBy?u:null,pivotBy:c.pivotBy?d:null,refetchKey:l,filterValue:c.filterValue?C:null,cursorId:m?S:null},w=(0,nt.useRef)(!0),v=(0,nt.useRef)(!1);LI(o,{sortInfo:s,groupBy:u,pivotBy:d,filterValue:p,refetchKey:l,cursorId:m?S:null},v);let P=Mi(),E=(0,nt.useRef)([]);vn(()=>{let M=e(),D=P(),{isDetail:x,isDetailReady:A}=Rc(D,e);if(x&&!A)return;let O=Date.now(),F=E.current;F.length>=10&&F.splice(0,1),F.push(O),O-F[0]<200&&F.length>=10&&di({debugId:M.debugId,key:"DS001"}),typeof M.data!="function"&&To(M.data,M,t,void 0,D)},{data:r}),vn(M=>{let D=Object.keys(M),x=!1;if(D.length===1){x=!!M.cursorId;let L=e().data;if(Array.isArray(L)&&M.refetchKey){t.originalDataArray=L;return}}let A=P(),{isDetail:O,isDetailReady:F}=Rc(A,e);if(O&&!F)return;let z=e();if(typeof z.data=="function"){if(v.current&&!x&&Mg(z))return;let L;z.debugId&&(L=st(z.debugId).track.DataSource.label.RemoteDataLoad.start()),To(z.data,z,t,{append:x},A).then(()=>{L?.end()})}},{...I,data:r}),(0,nt.useEffect)(()=>{v.current=!1}),vn(()=>{let M=e();if(w.current){w.current=!1;let D=jt(M,void 0,P());t.dataParams=D}},I)}function LI(o,e,t){let{getDataSourceState:n,dataSourceActions:r,dataSourceState:i}=o;(0,nt.useEffect)(()=>{r.lazyLoadCacheOfLoadedBatches=new q},[i.data,i.dataParams]);let{lazyLoadBatchSize:a,lazyLoad:l,originalLazyGroupDataChangeDetect:s,notifyRenderRangeChange:c,dataArray:u,groupRowsState:d,scrollStopDelayUpdatedByTable:p}=i,f=(0,nt.useRef)(null),m=(h,S,y=n().lazyLoadCacheOfLoadedBatches)=>{let T=n();if(h=h||f.current,!h)return;let{renderStartIndex:b,renderEndIndex:R}=h,{lazyLoadBatchSize:C,lazyLoad:I}=T;I&&((!C||C<=0)&&(!T.groupBy||T.groupBy.length===0)||_g({startIndex:b,endIndex:R,lazyLoadBatchSize:C,componentState:T,componentActions:r,dismissLoadedRows:S?.dismissLoadedRows??!1},y))},g=(0,nt.useMemo)(()=>Nt(m,{wait:p}),[p]);vn(h=>{if(l)return h.sortInfo||h.filterValue||h.groupBy||h.pivotBy||h.refetchKey||h.cursorId?(n().lazyLoadCacheOfLoadedBatches.clear(),n().originalLazyGroupData.clear(),m(c.get(),{dismissLoadedRows:!0}),t.current=!0):(h.originalLazyGroupDataChangeDetect||h.groupRowsState)&&m(c.get()),c.onChange(S=>{f.current=S,Ag(n().lazyLoadCacheOfLoadedBatches),m(S)})},{sortInfo:e.sortInfo,filterValue:e.filterValue,groupBy:e.groupBy,pivotBy:e.pivotBy,refetchKey:e.refetchKey,cursorId:e.cursorId,lazyLoadBatchSize:a,lazyLoad:l,originalLazyGroupDataChangeDetect:s,groupRowsState:d}),(0,nt.useEffect)(()=>{a&&a>0&&g()},[u])}function fr(o){let e=Mo(),t=Mi(),n=!!e,r=n?e.id:"master",{contextValue:i,ContextComponent:a}=Vc(o),{componentActions:l,componentState:s,assignState:c}=i;s.getDataSourceMasterContextRef.current=t;let u=Le(s),[d]=(0,gt.useState)(()=>hh({getState:u,actions:l})),p={dataSourceState:s,dataSourceActions:l,getDataSourceMasterContext:t,getDataSourceState:u,assignState:c,dataSourceApi:d},f=Le(i),m=Le(p),g=gc(),h=(0,gt.useCallback)(({children:S})=>{let y=Ba(),[T]=(0,gt.useState)(()=>Ih());typeof S=="function"&&(S=S(u()));let b=m();return T.setSnapshot(b),(0,gt.useLayoutEffect)(()=>{T.notify()}),gt.default.createElement(a.Provider,{key:r,value:f()},gt.default.createElement(g.Provider,{value:b},gt.default.createElement(y.Provider,{value:T},S)))},[a,n,r]);return(0,gt.useLayoutEffect)(()=>{let S=t();S&&S.registerDetail(p)},[]),(0,gt.useLayoutEffect)(()=>()=>{let S=u();S.onCleanup(S)},[]),Dh({dataSourceState:s,dataSourceActions:l,getDataSourceState:u}),(0,gt.useEffect)(()=>{s.onDataArrayChange?.(s.originalDataArray,s.originalDataArrayChangedInfo),s.onDataMutations&&s.originalDataArrayChangedInfo.mutations&&s.originalDataArrayChangedInfo.mutations.size&&s.onDataMutations({primaryKeyField:typeof s.primaryKey=="string"?s.primaryKey:void 0,dataArray:s.originalDataArray,mutations:s.originalDataArrayChangedInfo.mutations,timestamp:s.originalDataArrayChangedInfo.timestamp}),s.onTreeDataMutations&&s.originalDataArrayChangedInfo.treeMutations&&s.originalDataArrayChangedInfo.treeMutations.size&&s.onTreeDataMutations({nodesKey:s.nodesKey?s.nodesKey:void 0,dataArray:s.originalDataArray,treeMutations:s.originalDataArrayChangedInfo.treeMutations,timestamp:s.originalDataArrayChangedInfo.timestamp})},[s.originalDataArrayChangedInfo]),(0,gt.useEffect)(()=>{s.onReady?.(d)},[]),{DataSource:h,state:p.dataSourceState}}function xh(){return Ne(o=>o.dataSourceApi)}var dl=class dl{constructor(e,t){this.keysInOrder=[];if(typeof e=="number")this.maxSize=e,this.currentMap=new Map;else if(this.maxSize=t??dl.DEFAULT_SIZE,e){let n=Array.from(e);this.maxSize<n.length&&n.slice(n.length-this.maxSize),this.currentMap=new Map,n.forEach(([r,i])=>{this.set(r,i)})}else this.currentMap=new Map}values(){return this.currentMap.values()}get size(){return this.currentMap.size}delete(e){return this.currentMap.has(e)?(this.currentMap.delete(e),this.keysInOrder=this.keysInOrder.filter(t=>t!==e),!0):!1}has(e){return this.currentMap.has(e)}get(e){return this.currentMap.get(e)}set(e,t){if(this.has(e)&&this.delete(e),this.maxSize-this.currentMap.size<=0){let[r]=this.keysInOrder.splice(0,1);r!=null&&this.currentMap.delete(r)}return this.keysInOrder.push(e),this.currentMap.set(e,t),this}};dl.DEFAULT_SIZE=10;var ul=dl;var Gc=class{add(e,t){}get(e){}delete(e){}has(e){return!1}},pl=class{constructor(e){this.storage=new ul(e)}add(e,t){this.storage.set(e,t)}get(e){return this.storage.get(e)}delete(e){this.storage.delete(e)}has(e){return this.storage.has(e)}},Hc=class{constructor(){this.storage=new Map}add(e,t){this.storage.set(e,t)}get(e){return this.storage.get(e)}delete(e){this.storage.delete(e)}has(e){return this.storage.has(e)}},mr=class{constructor(e){this.cacheStorage=e===!1?new Gc:e===!0?new Hc:typeof e=="number"?new pl(e):new pl(5)}add(e,t){this.cacheStorage.add(e,t)}get(e){return this.cacheStorage.get(e)}delete(e){this.cacheStorage.delete(e)}has(e){return this.cacheStorage.has(e)}};var Eh=(e=>(e.INIT="INIT",e))(Eh||{});var{useManagedComponent:Vc}=kt({debugName:"DataSource",initSetupState:ih,forwardProps:lh,concludeReducer:Rh,mapPropsToState:ch,onPropChange:uh,cleanup:ah,interceptActions:ph(),mappedCallbacks:dh()});function kI(o){let{DataSource:e}=fr(o);return Mh.createElement(e,null,o.children??null)}function zI(){let{rowInfoReducerResults:o}=Ne(e=>({rowInfoReducerResults:e.dataSourceState.rowInfoReducerResults}));return o}function _h(o){let{getDataSourceState:e}=Ne(n=>({getDataSourceState:n.getDataSourceState}));return(0,Ah.useMemo)(()=>o.filter(r=>typeof r.rowspan=="function").length?({rowIndex:r,colIndex:i})=>{let a=e().dataArray,l=a[r];if(!l)return 1;let s=l.data,c=o[i];return!c||!c.rowspan?1:c.rowspan({column:c,data:s,dataArray:a,rowInfo:l,rowIndex:r})}:void 0,[o])}var Oh=require("react");var BH=Lt("useColumnSizeFn");function Fh(o){return(0,Oh.useCallback)(t=>{let n=o[t];return n?n.computedWidth:0},[o])}var Ut=require("react");var VI={scrollLeft:0,scrollTop:0},pi=class{constructor(){this.scrollPosition=VI;this.onScrollFns=[];this.getScrollPosition=()=>this.scrollPosition;this.onScroll=e=>(this.onScrollFns.push(e),()=>{this.onScrollFns=this.onScrollFns.filter(t=>t!==e)});this.setScrollPosition=e=>{this.scrollPosition=e,this.notifyScrollChange()};this.destroy=()=>{this.onScrollFns=[]}}notifyScrollChange(){let{scrollPosition:e}=this,t=this.onScrollFns;for(let n=0,r=t.length;n<r;n++)t[n](e)}};var fi=o=>`--infinite-${o}`;var Kc=40,mi=fi(pp),Nh=`var(${fi("density-scale")}, 1)`,gi=`calc(var(${fi("row-height")}, ${Kc}px) * ${Nh})`,Bc=`calc(var(${mi}) * ${Nh})`;function Lh(o,e){if(!o)return null;if(e.rowHeightCSSVar!==gi)return o;if(!HI())return null;let t=Math.round(o);return t===e.rowHeight?null:t}var GI=fi("loaded");function HI(){return typeof document>"u"||typeof getComputedStyle!="function"?!1:getComputedStyle(document.documentElement).getPropertyValue(GI).trim()===qi}function kh(o,e){return o?e.columnHeaderHeightCSSVar===Bc?Math.round(o):o:null}function zh(o,e){let t=new Map;function n(r){return e[r]!==!1}return Object.keys(o).forEach(r=>{let a=o[r].columnGroup,l=0;for(n(r)||(l=-1);a;){let s=o[a];if(!s)break;n(a)&&l++,a=s.columnGroup}t.set(r,l)}),t}var Vh=H(require("react"));function Gh(o){return(e,t)=>Vh.createElement(o,{key:e.id,rowInfo:e,cache:t})}var hi=class extends yn{constructor(t,n){super(`${t}:HorizontalLayout`);this.visiblePageCount=0;this.isHorizontalLayoutBrain=!0;this._totalPageCount=0;this.pageWidth=0;this.initialCols=0;this.initialRows=0;this.initialColWidth=0;this.colWidth=()=>10;this.getColWidth=t=>typeof this.initialColWidth=="number"?this.initialColWidth:this.initialColWidth(t%this.initialCols);this.onTotalPageCountChangeFns=new Set;this.onTotalPageCountChange=t=>(this.onTotalPageCountChangeFns.add(t),()=>{this.onTotalPageCountChangeFns.delete(t)});this.onScrollOriginChange=t=>this.options?.masterBrain?this.options.masterBrain.onScrollOriginChange(t):super.onScrollOriginChangeForBrain(t);this.options=n,this.options.masterBrain&&this.options.masterBrain.onTotalPageCountChange(()=>{this.updateRenderCount({horizontal:!0,vertical:!0})})}computeDirectionalRenderCount(t,n,r,i){if(t==="vertical"||typeof n=="number")return super.computeDirectionalRenderCount(t,n,r,i);let a=0,l=i.width,s=Math.floor(l/this.pageWidth);a+=s*this.initialCols;let c=l-s*this.pageWidth,u=[];for(let d=0;d<this.initialCols;d++)u.push(this.getItemSize(d,t));return a+=xa(c,u.concat(u)),t==="horizontal"?this.maxHorizontalRenderCount=a:this.maxVerticalRenderCount=a,a=Math.min(r,a),a}getRowIndexInPage(t){return this.rowsPerPage?t%this.rowsPerPage:t}getInitialCols(){return this.initialCols}getInitialRows(){return this.initialRows}getPageIndexForRow(t){return Math.floor(t/this.rowsPerPage)}getMatrixCoordinatesForHorizontalLayoutPosition(t){let n=t.rowIndex,r=t.colIndex;return t.rowIndex>=this.rowsPerPage&&this.rowsPerPage>0&&(n=t.rowIndex%this.rowsPerPage,r=Math.floor(t.rowIndex/this.rowsPerPage)*this.initialCols+r),{rowIndex:n,colIndex:r}}getHorizontalLayoutPositionFromMatrixCoordinates(t){let n=t.rowIndex,r=t.colIndex;if(t.colIndex>=this.initialCols&&this.initialCols>0){let i=Math.floor(t.colIndex/this.initialCols);r=t.colIndex-i*this.initialCols,n=this.rowsPerPage*i+t.rowIndex}return{colIndex:Math.min(r,this.initialCols),rowIndex:this.options.isHeader?n:Math.min(n,this.initialRows)}}update(t){let{rows:n,cols:r,rowHeight:i,colWidth:a,width:l,height:s}=t,c=typeof l=="number",u=typeof s=="number",d=c&&l!==this.availableWidth,p=u&&s!==this.availableHeight;d&&(this.availableWidth=l,this.availableRenderWidth=l),p&&(this.availableHeight=s,this.availableRenderHeight=s),(d||p)&&this.notifyAvailableSizeChange();let f=typeof n=="number",m=typeof r=="number",g=f&&n!==this.initialRows,h=m&&r!==this.initialCols;f&&g&&(this.initialRows=n,this.rows=n),m&&h&&(this.initialCols=r,this.cols=r);let S=i!=null,y=a!=null,T=S&&i!==this.rowHeight,b=y&&a!==this.initialColWidth;S&&(this.rowHeight=i),y&&(this.initialColWidth=a,this.colWidth=this.getColWidth);let R=g||T||p,C=h||b||d||R;(C||R)&&this.updateRenderCount({horizontal:C,vertical:R})}getInitialRowHeight(){return typeof this.rowHeight!="number"?this.getRowHeight(0):this.rowHeight}get totalPageCount(){return this.options.masterBrain?this.options.masterBrain.totalPageCount:this._totalPageCount}set totalPageCount(t){this.options.masterBrain||(this._totalPageCount=t)}getPageWidth(){return this.pageWidth}doUpdateRenderCount(t=ho){let n=this.getInitialRowHeight(),r=0;for(let a=0;a<this.initialCols;a++)r+=this.getColWidth(a);this.pageWidth=r,this.rowsPerPage=Math.floor(this.availableHeight/n);let i=!1;if(!this.options.masterBrain){let a=this.totalPageCount;this.totalPageCount=this.rowsPerPage?Math.ceil(this.initialRows/this.rowsPerPage):0,a!=this.totalPageCount&&(i=!0)}this.visiblePageCount=this.totalPageCount&&this.pageWidth?Math.max(Math.ceil(this.availableWidth/this.pageWidth),1):1,this.availableRenderHeight=this.visiblePageCount*this.rowsPerPage*n,this.cols=Math.max(this.totalPageCount*this.initialCols,this.initialCols),this.rows=this.rowsPerPage,super.doUpdateRenderCount(t),i&&this.notifyTotalPageCountChange()}notifyTotalPageCountChange(){if(this.destroyed)return;let t=this.onTotalPageCountChangeFns;t.forEach(n=>{He(()=>{this.destroyed||t.has(n)&&n(this.totalPageCount)})})}getVirtualColIndex(t,n){return this.initialCols*(n?.pageIndex??0)+t}destroy(){this.destroyed||(super.destroy(),this.options.masterBrain=void 0,this.onTotalPageCountChangeFns.clear())}supportsLargeContent(t){return t==="horizontal"}alignScrollOrigin(t,n){return t==="vertical"||!this.pageWidth?Math.floor(n):Math.floor(n/this.pageWidth)*this.pageWidth}getScrollOriginPageIndex(){let t=this.getPageWidth();return t?Math.round(this.getScrollOrigin().scrollLeft/t):0}getScrollOrigin(){return this.options?.masterBrain?this.options.masterBrain.getScrollOrigin():super.getScrollOrigin()}updateScrollOrigin(){this.options?.masterBrain||super.updateScrollOrigin()}getVirtualizedContentSizeFor(t){return t==="vertical"?this.getInitialRowHeight()*this.rowsPerPage:this.pageWidth*this.totalPageCount}};function Pn(){return{current:null}}var Wc={};function jc(o){return`.${oo}[data-row-index${o?`="${o.rowIndex}"`:""}][data-col-index${o?`="${o.colIndex}"`:""}]`}function Uc(o,e){let t=Uo(o),n=e?new hi(t,{isHeader:!1}):new yn(t),r=`${t}:header`,i=e?new hi(r,{isHeader:!0,masterBrain:n}):new yn(r);n.onScroll(u=>{i.setScrollPosition({scrollLeft:u.scrollLeft,scrollTop:0})});let{renderer:a,onRenderUpdater:l}=ni(n),{renderer:s,onRenderUpdater:c}=ni(i);return n.onAvailableSizeChange(u=>{i.update({width:u.width})}),{brain:n,headerBrain:i,renderer:a,onRenderUpdater:l,headerRenderer:s,headerOnRenderUpdater:c}}function Hh({debugId:o,wrapRowsHorizontally:e}){let t={},{brain:n,headerBrain:r,renderer:i,onRenderUpdater:a,headerRenderer:l,headerOnRenderUpdater:s}=Uc(o,!!e),c=Pn(),u=Date.now();return{debugWarnings:new Map,renderer:i,onRenderUpdater:a,headerRenderer:l,headerOnRenderUpdater:s,updatedAt:u,devToolsDetected:!!globalThis.__INFINITE_TABLE_DEVTOOLS_HOOK__,propsCache:new Map([]),lastRowToCollapseRef:{current:null},lastRowToExpandRef:{current:null},cellContextMenuVisibleFor:null,contextMenuVisibleFor:null,columnMenuVisibleForColumnId:null,columnMenuVisibleKey:0,filterOperatorMenuVisibleForColumnId:null,getDOMNodeForCell:d=>{if(!c.current)return null;let p=jc(d);return c.current.querySelector(p)||null},brain:n,headerBrain:r,domRef:c,columnMenuTargetRef:Pn(),editingValueRef:Pn(),scrollerDOMRef:Pn(),portalDOMRef:Pn(),focusDetectDOMRef:Pn(),activeCellIndicatorDOMRef:Pn(),onColumnMenuClick:Ce(),cellContextMenu:Ce(),contextMenu:Ce(),onFilterOperatorMenuClick:Ce(),flashingDurationCSSVarValue:null,onFlashingDurationCSSVarChange:Ce(),onRowHeightCSSVarChange:Ce(),onRowDetailHeightCSSVarChange:Ce(),onColumnHeaderHeightCSSVarChange:Ce(),cellClick:Ce(),cellMouseDown:Ce(),keyDown:Ce(),bodySize:{width:0,height:0},scrollPosition:{scrollTop:0,scrollLeft:0},columnReorderDragColumnId:!1,columnReorderInPageIndex:null,ready:!1,focused:!1,focusedWithin:!1,columnsWhenGrouping:t,columnVisibilityForGrouping:{},pinnedStartScrollListener:new pi,pinnedEndScrollListener:new pi,columnsWhenInlineGroupRenderStrategy:void 0,editingCell:null,forceBodyRerenderTimestamp:0}}var Kh=o=>({debugId:1,scrollTopKey:1,components:1,id:1,loadingText:1,pivotColumns:1,groupColumn:1,onReady:1,domProps:1,onKeyDown:1,onCellClick:1,onCellDoubleClick:1,focusedClassName:1,focusedWithinClassName:1,focusedStyle:1,focusedWithinStyle:1,onSelfFocus:1,onFocusWithin:1,onSelfBlur:1,onBlurWithin:1,onContextMenu:1,onCellContextMenu:1,onRenderRangeChange:1,onRowMouseEnter:1,onRowMouseLeave:1,onScrollToTop:1,onScrollToBottom:1,onScrollStop:1,scrollToBottomOffset:1,getColumnMenuItems:1,getCellContextMenuItems:1,getContextMenuItems:1,menuPortalContainer:1,menuConstrainTo:1,columnPinning:1,editable:1,columnDefaultEditable:1,columnDefaultFilterable:1,columnDefaultGroupable:1,columnDefaultSortable:1,keyboardShortcuts:1,rowStyle:1,cellStyle:1,repaintCellsKey:1,rowProps:1,rowClassName:1,rowHoverClassName:1,cellClassName:1,repeatWrappedGroupRows:1,pinnedStartMaxWidth:1,pinnedEndMaxWidth:1,pivotColumn:1,pivotColumnGroups:1,getFilterOperatorMenuItems:1,onScrollbarsChange:1,autoSizeColumnsKey:1,wrapRowsHorizontally:1,columnDefaultFlex:1,draggableColumnsRestrictTo:e=>e??!1,columnMenuRealignDelay:e=>e??50,scrollStopDelay:e=>e??250,viewportReservedWidth:e=>e??0,resizableColumns:e=>e??!0,rowDetailCache:e=>new mr(e),hideColumnWhenGrouped:e=>e??!1,columnMinWidth:e=>e??30,columnMaxWidth:e=>e??5e3,columnDefaultWidth:e=>e??200,columnCssEllipsis:e=>e??!0,draggableColumns:1,columnDefaultDraggable:1,headerOptions:e=>({alwaysReserveSpaceForSortIcon:!0,...e}),showSeparatePivotColumnForSingleAggregation:e=>e??!1,sortable:1,hideEmptyGroupColumns:e=>e??!1,pivotTotalColumnPosition:e=>e??"end",pivotGrandTotalColumnPosition:1,licenseKey:e=>e,keyboardSelection:e=>e??!0,multiRowSelectionWith:e=>e??"checkbox",activeRowIndex:1,activeCellIndex:1,columnOrder:e=>e??!0,header:e=>e??!0,showZebraRows:e=>e??!0,showHoverRows:e=>e??!0,virtualizeColumns:e=>e??!0,rowHeight:e=>typeof e=="number"||typeof e=="function"?e:e===gi?Kc:0,rowDetailHeight:e=>typeof e=="number"||typeof e=="function"?e:300,columnHeaderHeight:e=>typeof e=="number"?e:30,columns:1,columnVisibility:e=>e??Wc,columnGroupVisibility:e=>e??Wc,columnSizing:e=>e||{},columnTypes:e=>e||{},onEditCancelled:1,onEditRejected:1,onEditAccepted:1,persistEdit:1,shouldAcceptEdit:1,onEditPersistError:1,onEditPersistSuccess:1,multiSortBehavior:e=>e??"replace",collapsedColumnGroups:e=>e??new Map,columnGroups:1});function KI(o){let{groupBy:e,groupColumn:t,groupRenderStrategy:n}=o;return n||(t!=null&&typeof t=="object"?"single-column":(e.filter(i=>i.column).length,"multi-column"))}var Bh=o=>{o.brain.destroy(),o.headerBrain.destroy(),o.renderer.destroy(),o.headerRenderer.destroy(),o.onRenderUpdater.destroy(),o.headerOnRenderUpdater.destroy(),o.onFlashingDurationCSSVarChange.destroy(),o.onRowHeightCSSVarChange.destroy(),o.onColumnHeaderHeightCSSVarChange.destroy(),o.onColumnMenuClick.destroy(),o.onFilterOperatorMenuClick.destroy(),o.domRef.current=null,o.columnMenuTargetRef.current=null,o.scrollerDOMRef.current=null,o.portalDOMRef.current=null,o.onRowDetailHeightCSSVarChange.destroy(),o.pinnedEndScrollListener.destroy(),o.pinnedStartScrollListener.destroy()};function Wh(o){return o.reduce((e,t,n)=>{let r={groupBy:t,groupIndex:n};return t.field?e.set(t.field,r):t.groupField&&e.set(t.groupField,r),e},new Map)}var fl=new WeakMap;function jh(){return{rowDetailState:(o,e)=>({callbackParams:[o,{expandRow:e.lastRowToExpandRef.current,collapseRow:e.lastRowToCollapseRef.current}]})}}var Uh=o=>{let{props:e,state:t,oldState:n,parentState:r}=o,i=t.pivotColumnGroups||t.columnGroups,a=t.columnGroups&&t.columnGroups!=n?.columnGroups||t.columnGroups&&t.columnGroupVisibility!=n?.columnGroupVisibility||t.pivotColumnGroups!=n?.pivotColumnGroups?zh(i??Wc,t.columnGroupVisibility):t.columnGroupsDepthsMap,l=r?.groupBy,s=KI({groupRenderStrategy:e.groupRenderStrategy,groupBy:l,groupColumn:e.groupColumn}),c,u=e.rowDetailRenderer,d=e.components?.RowDetail;if(!u&&d){let h=fl.get(d);h||(h=Gh(d),fl.set(d,h)),u=h}u&&(c=e.rowDetailState||t.rowDetailState||e.defaultRowDetailState,c&&!(c instanceof At)&&(c=new At(c)),c=c||new At({expandedRows:[],collapsedRows:!0}));let p=t.columnsWhenGrouping||t.columnsWhenInlineGroupRenderStrategy||t.columns,f=c?e.isRowDetailExpanded:void 0;!f&&c&&(f=fl.get(c),f||(f=h=>c.isRowDetailsExpanded(h.id),typeof c=="object"&&fl.set(c,f)));let m=u?e.isRowDetailEnabled||!0:!1,g={updatedAt:Date.now(),isTree:r.isTree,rowDetailRenderer:u,rowDetailState:c,isRowDetailExpanded:f,isRowDetailEnabled:m,showColumnFilters:e.showColumnFilters??!!r.filterValue,controlledColumnVisibility:!!e.columnVisibility,groupRenderStrategy:s,groupBy:l,computedColumns:p,initialColumns:e.columns,keyboardNavigation:e.keyboardNavigation??(t.activeCellIndex!=null?"cell":t.activeRowIndex!=null?"row":"cell"),columnHeaderCssEllipsis:e.columnHeaderCssEllipsis??e.columnCssEllipsis??!0,columnGroupsDepthsMap:a,columnGroupsMaxDepth:a!=t.columnGroupsDepthsMap?Math.max(...a.values(),-1):t.columnGroupsMaxDepth,computedColumnGroups:i,rowHeightCSSVar:typeof e.rowHeight=="string"?e.rowHeight:"",rowDetailHeightCSSVar:typeof e.rowDetailHeight=="string"?e.rowDetailHeight:"",columnHeaderHeightCSSVar:typeof e.columnHeaderHeight=="string"?!e.columnHeaderHeight||e.columnHeaderHeight===mi?Bc:e.columnHeaderHeight:""};if(t.devToolsDetected&&t.debugId){let h=Co.get(t.debugId);h&&(g={...g,...h})}return g};function $h(o,e){let t={};return Object.keys(o).forEach(n=>{let r=o[n],i=r;if(!i.groupByForColumn||Array.isArray(i.groupByForColumn))return;let{groupByForColumn:a}=i,l=a.field||a.groupField;l&&e.get(l)&&(t[n]=r)}),t}function Yh(o){let{hideEmptyGroupColumns:e,groupByMap:t,computedGroupColumns:n,groupRowsIndexesInDataArray:r,dataArray:i,groupBy:a}=o,l={...o.columnVisibility};if(!e)return Object.keys(n).forEach(d=>{l[d]===!1&&delete l[d]}),l;if(!r||!r.length)return l;let s=a.length,c=0,u=r.length;for(let d=0;d<u;d++){let p=r[d],f=i[p];if(!f.isTreeNode&&f.isGroupRow&&(c=Math.max(c,f.groupNesting-1),c===s-1))break}return Object.keys(n).forEach(d=>{let p=n[d],{groupByForColumn:f}=p;if(Array.isArray(f))return;let m=f.field||f.groupField;if(!m)return;t.get(m).groupIndex>c&&e?l[d]!==!1&&(l[d]=!1):l.hasOwnProperty(d)&&delete l[d]}),l}var wo=H(require("react"));var qh=o=>o.dataSourceHasGrouping&&o.isGroupRow&&o.childrenLoading||!o.selfLoaded;var ml=H(require("react"));var Xh="_16lm1iwb _16lm1iw1d _16lm1iwk";var Zh="164.93361431346415 56.97787143782138",Qh={margin:"auto",display:"block",shapeRendering:"auto"},vK=Object.keys({size:1,style:1,className:1,viewBox:1});var Jh=o=>ml.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",style:{...Qh,...o.style},width:"24px",height:"24px",viewBox:o.viewBox??"0 0 100 100",preserveAspectRatio:"xMidYMid",className:X(o.className,Xh,Hn.loading,md,"InfiniteIcon","InfiniteIcon-loading")},ml.createElement("circle",{cx:"50",cy:"50",fill:"none",strokeWidth:"10",r:"35",strokeDasharray:Zh},ml.createElement("animateTransform",{attributeName:"transform",type:"rotate",repeatCount:"indefinite",dur:"1s",values:"0 50 50;360 50 50",keyTimes:"0;1"})));function ey(o,e,t,n){let{groupByForColumn:r,groupIndexForColumn:i,groupRenderStrategy:a}=o,l=r.column?{...r.column}:{},s=typeof t=="function"?t(o,e):t;return{header:`Group by ${r.field||r.groupField}`,groupByForColumn:r,render:n.getGroupColumnRender({groupIndexForColumn:i,groupRenderStrategy:a}),...l,...s,renderGroupIcon:n.getGroupColumnRenderGroupIcon({initialRenderGroupIcon:s?.renderGroupIcon??l.renderGroupIcon,groupIndexForColumn:i,toggleGroupRow:e,groupRenderStrategy:a})}}function ty(o,e,t,n){let r=typeof t=="function"?t(o,e):t,i={};return o.sortable!=null&&(i.sortable=o.sortable),{...i,header:"Group",groupByForColumn:o.groupBy,renderSelectionCheckBox:o.selectionMode==="multi-row",render:n.getGroupColumnRender({groupIndexForColumn:0,groupRenderStrategy:"single-column"}),...r,renderGroupIcon:n.getGroupColumnRenderGroupIcon({initialRenderGroupIcon:r?.renderGroupIcon,groupIndexForColumn:0,toggleGroupRow:e,groupRenderStrategy:"single-column"})}}function $c({groupIndexForColumn:o,groupRenderStrategy:e}){return t=>{let{rowInfo:n,renderBag:r,column:i,align:a}=t,{value:l,groupIcon:s,selectionCheckBox:c}=r,u=n,d=e==="multi-column"&&u.isGroupRow&&o+1!==u.groupNesting,p=X(Gn.flex,i.align==="end"?Or.rowReverse:Or.row,td.center,`${oo}Expander`,e==="single-column"||e==="multi-column"&&(!n.isGroupRow||c||d&&i.field)?Ef({align:a}):null);return d?i.field?wo.createElement("div",{className:p},c,wo.createElement("div",{className:Ht},l??null)):c?wo.createElement("div",{className:p},c):null:(e==="single-column"&&u.isGroupRow,wo.createElement("div",{className:p},s,c,wo.createElement("div",{className:Ht},l??null)))}}function Yc({groupIndexForColumn:o,groupRenderStrategy:e,toggleGroupRow:t,initialRenderGroupIcon:n}){return r=>{let{rowInfo:i,value:a,rootGroupBy:l,pivotBy:s,column:c}=r,u=e!=="inline"?i:i.isGroupRow&&i.parents?.[o]||i;if(!u)return null;let d=u.collapsed;if(e==="inline"){if(u.groupCount===1)return a;if(u.groupNesting===o&&d)return null}else if(!u.isGroupRow||e==="multi-column"&&o+1!==u.groupNesting)return null;let p=u.groupKeys,f=null,m=s?(u.groupKeys?.length||0)<l?.length:(u.groupKeys?.length||0)<=l?.length;return qh(u)?f=wo.createElement(Jh,null):m&&(f=wo.createElement(pn,{expanded:!d,direction:c.align==="end"?"end":"start",onChange:()=>{t(p)}})),n&&(r.renderBag.groupIcon=f,f=wo.createElement(Pt,{render:n,renderParam:r})),f}}function oy(){return{getGroupColumnRender:$c,getGroupColumnRenderGroupIcon:Yc}}function ny(o,e,t){return ey(o,e,t,oy())}function ry(o,e,t){return ty(o,e,t,oy())}function iy(o){let{pivotColumns:e,groupBy:t,pivotBy:n,selectionMode:r,groupColumn:i,pivotTotalColumnPosition:a,pivotGrandTotalColumnPosition:l,pivotColumn:s,groupRenderStrategy:c,toggleGroupRow:u,columns:d}=o;if(c==="inline")return{columns:void 0,groupColumnIds:[]};let p={},f=[];if(c==="multi-column")t.forEach((m,g,h)=>{let S=ny({groupByForColumn:m,groupBy:t,pivotBy:n,groupIndexForColumn:g,groupCount:h.length,groupRenderStrategy:c,selectionMode:r},u,i),y=S.id||`group-by-${m.field||m.groupField}`;f.push(y),p[y]=S});else if(c==="single-column"&&t.length){let m=ry({groupCount:t.length,groupBy:t,pivotBy:n,groupRenderStrategy:c,selectionMode:r},u,i),g=m.id||"group-by";f.push(g),p[g]=m}return e?Object.keys(e).forEach(m=>{let g=e[m],h=g.pivotTotalColumn&&g.columnGroup,S=g.pivotTotalColumn&&!g.columnGroup;if(h&&a===!1||S&&l===!1)return;let y={...g};s&&(typeof s=="function"?y={...y,...s({column:y,pivotBy:n,groupBy:t})}:y={...y,...s}),y.inheritFromColumn!==!1&&(y={...typeof y.inheritFromColumn=="string"?d[y.inheritFromColumn]:y.pivotAggregator?.field?nn(d,y.pivotAggregator.field):void 0,...y}),!y.render&&y.renderValue&&(y.render=T=>y.renderValue(T)),p[m]=y}):Object.keys(d).forEach(m=>{let g=d[m];p[m]=g}),{columns:Object.keys(p).length?p:void 0,groupColumnIds:f}}var ay=require("react");function qc(){let{getDataSourceState:o,dataSourceActions:e,getDataSourceMasterContext:t}=Ne(r=>({getDataSourceState:r.getDataSourceState,dataSourceActions:r.dataSourceActions,getDataSourceMasterContext:r.getDataSourceMasterContext}));return(0,ay.useCallback)(r=>{let i=o(),a=new xt(i.groupRowsState);if(a.toggleGroupRow(r),e.groupRowsState=a,i.lazyLoad){let l=[vt,...r],s=i.originalLazyGroupData.get(l);a.isGroupRowExpanded(r)?s?.cache||To(i.data,i,e,{groupKeys:r},t()):s?.cache||(i.lazyLoadCacheOfLoadedBatches.getKeysStartingWith(r).forEach(u=>{i.lazyLoadCacheOfLoadedBatches.delete(u)}),e.lazyLoadCacheOfLoadedBatches=q.clone(i.lazyLoadCacheOfLoadedBatches),i.originalLazyGroupData.delete(l),e.originalLazyGroupDataChangeDetect=Vt())}},[])}function BI(o){return(0,Ut.useMemo)(()=>Wh(o),[o])}function ly(o,e){let{groupBy:t,dataSourceActions:n}=Ne(c=>({groupBy:c.dataSourceState.groupBy,dataSourceActions:c.dataSourceActions})),{groupRenderStrategy:r,pivotTotalColumnPosition:i,pivotGrandTotalColumnPosition:a}=o;(0,Ut.useEffect)(()=>{n.generateGroupRows=r!=="inline"},[r]),(0,Ut.useEffect)(()=>{n.pivotTotalColumnPosition=i},[i]),(0,Ut.useEffect)(()=>{a!=null&&(n.pivotGrandTotalColumnPosition=a)},[a]);let l=BI(t);WI(l,o,e);let{toggleGroupRow:s}=jI();return UI(l,o,e),{toggleGroupRow:s}}function WI(o,e,t){let n=qc(),{columns:r,groupRenderStrategy:i,isTree:a}=e,l=t;function s(c,u,d,p){let f={};if(d==="inline")return Object.keys(c).forEach(m=>{let g=c[m],h={},S=u.get(g.field);if(S&&d==="inline"){let{groupIndex:T}=S;h={groupByForColumn:S.groupBy,field:S.groupBy?.field,valueGetter:S.groupBy?.valueGetter,valueFormatter:({rowInfo:b})=>b.isGroupRow?b.groupKeys?.[T]:b.value,rowspan:({rowInfo:b,dataArray:R})=>{if(b.isTreeNode||!b.isGroupRow)return 1;let C=R[b.indexInAll-1]||{indexInParentGroups:[]};if(!C||!C.dataSourceHasGrouping)return 1;let I=C.indexInParentGroups||[],w=b.indexInParentGroups||[],v=!1;for(let M=0;M<=T;M++){let D=I[M];if(w[M]!==D){v=!0;break}}if(!v)return 1;let P=b.parents[T];return P?P.groupCount-(P.collapsedChildrenCount||0)+(P.collapsedGroupsCount||0):1},renderGroupIcon:Yc({groupIndexForColumn:T,groupRenderStrategy:d,toggleGroupRow:p,initialRenderGroupIcon:g.renderGroupIcon}),render:$c({groupIndexForColumn:T,groupRenderStrategy:d})}}let y={...h,...g};f[m]=y}),Object.keys(f).length===0?void 0:f}(0,Ut.useEffect)(()=>{(()=>{l.columnsWhenInlineGroupRenderStrategy=a?void 0:s(r,o,i,n)})()},[r,o,i,n])}function jI(){let{groupBy:o,pivotBy:e,selectionMode:t}=Ne(m=>({groupBy:m.dataSourceState.groupBy,pivotBy:m.dataSourceState.pivotBy,selectionMode:m.dataSourceState.selectionMode})),{componentActions:n,componentState:{columns:r,groupColumn:i,hideColumnWhenGrouped:a,groupRenderStrategy:l,pivotColumns:s,pivotColumn:c,pivotTotalColumnPosition:u,pivotGrandTotalColumnPosition:d},getComponentState:p}=zt(),f=qc();return(0,Ut.useEffect)(()=>{(()=>{let{columns:g,groupColumnIds:h}=iy({columns:r,groupColumn:i,pivotColumn:c,pivotTotalColumnPosition:u,pivotGrandTotalColumnPosition:d,groupRenderStrategy:l==="inline"?"single-column":l,groupBy:o,pivotBy:e,pivotColumns:s,toggleGroupRow:f,selectionMode:t});n.columnsWhenGrouping=g;let S=p().columnOrder;if(h.length&&Array.isArray(S)){let y=new Set(S),T=!1;h.forEach(b=>{y.has(b)||(T=!0,S=[b,...S])}),T&&(n.columnOrder=S)}})()},[r,o,e,t,a,i,l,s,u,c]),{toggleGroupRow:f}}function UI(o,e,t){let{dataArray:n,groupRowsIndexesInDataArray:r,groupBy:i,groupRowsState:a,originalLazyGroupDataChangeDetect:l,getDataSourceState:s}=Ne(h=>({getDataSourceState:h.getDataSourceState,dataArray:h.dataSourceState.dataArray,groupRowsIndexesInDataArray:h.dataSourceState.groupRowsIndexesInDataArray,groupBy:h.dataSourceState.groupBy,groupRowsState:h.dataSourceState.groupRowsState,originalLazyGroupDataChangeDetect:h.dataSourceState.originalLazyGroupDataChangeDetect})),{columnTypes:c,computedColumns:u,hideColumnWhenGrouped:d,hideEmptyGroupColumns:p,groupRenderStrategy:f}=e,m=t,g=Le(e);(0,Ut.useLayoutEffect)(()=>{if(f!=="multi-column")return;let h=g(),S=$h(u,o),y=Yh({computedGroupColumns:S,columnVisibility:h.columnVisibility,hideEmptyGroupColumns:p,groupRowsIndexesInDataArray:r,dataArray:n,groupBy:i,groupByMap:o});wt(h.columnVisibility,y)||(m.columnVisibility=y)},[s,f,l,i,o,u,p?n:null,p?a:null,p?r:null,p]),(0,Ut.useEffect)(()=>{let h=i.length>0,S=g(),{columnVisibility:y,columnVisibilityForGrouping:T,hideColumnWhenGrouped:b}=S,R={...y},C={...T},I=!1,w=new Set,v=new Set;Object.keys(u).forEach(P=>{let E=u[P];if(E.defaultHiddenWhenGroupedBy||b!=null)if(E.defaultHiddenWhenGroupedBy==="*"&&h||(E.defaultHiddenWhenGroupedBy===!0||b)&&E.field&&o.get(E.field)||typeof E.defaultHiddenWhenGroupedBy=="string"&&o.get(E.defaultHiddenWhenGroupedBy)||typeof E.defaultHiddenWhenGroupedBy=="object"&&Object.keys(E.defaultHiddenWhenGroupedBy).reduce((D,x)=>D||o.has(x),!1)){if(C[P]!==!1){if(y[P]===!1)return;C[P]=!1,I=!0,w.add(P)}}else C[P]===!1&&(delete C[P],I=!0,v.add(P))}),I&&(m.columnVisibilityForGrouping=C,v.forEach(P=>{delete R[P]}),w.forEach(P=>{R[P]=!1}),m.columnVisibility=R)},[u,c,i,o,d])}var sy=require("react");var cy=({columns:o,userColumns:e,bodySize:t,columnMinWidth:n,columnMaxWidth:r,columnDefaultWidth:i,columnDefaultFlex:a,sortable:l,columnCssEllipsis:s,columnHeaderCssEllipsis:c,draggableColumns:u,columnDefaultDraggable:d,sortInfo:p,multiSort:f,filterValue:m,filterTypes:g,columnOrder:h,columnPinning:S,editable:y,columnDefaultEditable:T,columnDefaultFilterable:b,columnDefaultGroupable:R,columnDefaultSortable:C,scrollbarWidth:I,columnTypes:w,pinnedEndMaxWidth:v,pinnedStartMaxWidth:P,viewportReservedWidth:E,resizableColumns:M,columnVisibility:D,columnVisibilityAssumeVisible:x,columnSizing:A,groupBy:O})=>{let{computedRemainingSpace:z,computedColumnOrder:L,computedVisibleColumns:B,computedVisibleColumnsMap:Y,computedPinnedStartColumns:V,computedPinnedEndColumns:W,computedUnpinnedColumns:N,computedPinnedStartColumnsWidth:K,computedPinnedEndColumnsWidth:ae,computedUnpinnedColumnsWidth:re,computedUnpinnedOffset:ue,computedPinnedEndOffset:fe,computedPinnedEndWidth:be,computedPinnedStartWidth:de,renderSelectionCheckBox:U,computedColumnsMap:ie,computedColumnsMapInInitialOrder:ge,fieldsToColumn:Z}=(0,sy.useMemo)(()=>op({columns:o,userColumns:e,scrollbarWidth:I,bodySize:t,columnMinWidth:n,columnMaxWidth:r,columnDefaultWidth:i,columnDefaultFlex:a,columnCssEllipsis:s,columnHeaderCssEllipsis:c,viewportReservedWidth:E,resizableColumns:M,filterValue:m,filterTypes:g,sortable:l,sortInfo:p,multiSort:f,pinnedEndMaxWidth:v,pinnedStartMaxWidth:P,draggableColumns:u,columnDefaultDraggable:d,columnOrder:h,columnPinning:S,columnDefaultEditable:T,columnDefaultFilterable:b,columnDefaultGroupable:R,columnDefaultSortable:C,editable:y,columnSizing:A,columnTypes:w,columnVisibility:D,columnVisibilityAssumeVisible:x??!0,groupBy:O}),[o,e,t.width,n,r,i,E,I,l,p,f,m,g,h,D,x,d,u,M,v,P,A,w,S,T,b,R,y,O,1]);return{renderSelectionCheckBox:U,columns:o,computedColumnsMap:ie,computedPinnedEndWidth:be,computedPinnedStartWidth:de,computedRemainingSpace:z,computedUnpinnedOffset:ue,computedPinnedEndOffset:fe,computedPinnedStartColumnsWidth:K,computedPinnedEndColumnsWidth:ae,computedUnpinnedColumnsWidth:re,computedPinnedStartColumns:V,computedPinnedEndColumns:W,computedUnpinnedColumns:N,computedVisibleColumns:B,computedVisibleColumnsMap:Y,computedColumnOrder:L,computedColumnsMapInInitialOrder:ge,fieldsToColumn:Z}};var dy=require("react");var gl=class{constructor(){this.rowHeight=new Map;this.rowDetailHeight=new Map;this.getRowHeight=e=>this.rowHeight.get(e)??0;this.getRowDetailHeight=e=>this.rowDetailHeight.get(e)??0}getTotalRowHeight(e){return this.getRowHeight(e)+this.getRowDetailHeight(e)}getSize(e){let t=this.getRowHeight(e),n=this.getRowDetailHeight(e);return{rowHeight:t,rowDetailHeight:n,totalRowHeight:t+n}}};function $I(o,e){let t=o.rowDetailHeight,n=o.rowHeight,{isRowDetailsExpanded:r,isRowDetailsEnabled:i,getDataSourceState:a}=o;if(!r)return typeof n=="function"?u=>{if(e&&e.rowHeight.has(u))return e.rowHeight.get(u);let d=a().dataArray[u],p=d?n(d):0;return e&&e.rowHeight.set(u,p),p}:n;let l=typeof n=="function",s=typeof t=="function";return u=>{if(e&&e.rowHeight.has(u)&&e.rowDetailHeight.has(u))return e.rowHeight.get(u)+e.rowDetailHeight.get(u);let d=a().dataArray[u];if(!d)return e&&(e.rowHeight.set(u,0),e.rowDetailHeight.set(u,0)),0;let p=l?n(d):n;if(!!(!i||typeof i=="function"&&i(d)===!1)||!r(d))return e&&(e.rowHeight.set(u,p),e.rowDetailHeight.set(u,0)),p;let m=0;return s?m=t(d):m=t,e&&(e.rowHeight.set(u,p),e.rowDetailHeight.set(u,m)),p+m}}function uy(o){let e=new gl;return{computedRowHeight:$I(o,e),computedRowSizeCacheForDetails:o.isRowDetailsExpanded?e:void 0}}function py(o){return(0,dy.useMemo)(()=>uy(o),[o.rowHeight,o.rowDetailHeight,o.isRowDetailsExpanded,o.isRowDetailsEnabled,o.getDataSourceState])}var gr=require("react");var YI={vertical:!1,horizontal:!1};function fy(o){let e=o().brain,{getDataSourceState:t}=no(),[n,r]=(0,gr.useState)(YI);return(0,gr.useEffect)(()=>e.onRenderCountChange(()=>{let{scrollTopMax:i,scrollLeftMax:a}=e,l=i>0,s=a>0;r(c=>c.vertical===l&&c.horizontal===s?c:{vertical:l,horizontal:s})}),[e]),(0,gr.useLayoutEffect)(()=>{let i=t(),{onScrollbarsChange:a}=o(),{notifyScrollbarsChange:l}=i;a&&i.updatedAt&&i.dataArray.length&&a(n),l(n)},[n]),n}function my(o){let{state:e,actions:t,getState:n}=o,{columnOrder:r,columnCssEllipsis:i,columnHeaderCssEllipsis:a,columnMinWidth:l,columnMaxWidth:s,columnDefaultWidth:c,columnDefaultFlex:u,columnDefaultSortable:d,columnDefaultDraggable:p,pinnedStartMaxWidth:f,pinnedEndMaxWidth:m,columnVisibility:g,columnPinning:h,columnSizing:S,editable:y,columnDefaultEditable:T,columnDefaultFilterable:b,columnDefaultGroupable:R,columnTypes:C,rowHeight:I,rowDetailHeight:w,isRowDetailExpanded:v,isRowDetailEnabled:P,bodySize:E,showSeparatePivotColumnForSingleAggregation:M,onRowHeightCSSVarChange:D,onFlashingDurationCSSVarChange:x,onRowDetailHeightCSSVarChange:A,onColumnHeaderHeightCSSVarChange:O,computedColumns:F,initialColumns:z,viewportReservedWidth:L,resizableColumns:B,sortable:Y,draggableColumns:V}=e,W=t,{multiSort:N,filterValue:K,filterTypes:ae,groupBy:re,sortInfo:ue,dataSourceActions:fe,getDataSourceState:be,dataSourceApi:de}=Ne(ce=>({dataSourceActions:ce.dataSourceActions,getDataSourceState:ce.getDataSourceState,dataSourceApi:ce.dataSourceApi,sortInfo:ce.dataSourceState.sortInfo,multiSort:ce.dataSourceState.multiSort,filterValue:ce.dataSourceState.filterValue,filterTypes:ce.dataSourceState.filterTypes,groupBy:ce.dataSourceState.groupBy}));(0,Qo.useState)(()=>{D.onChange(ce=>{let Ae=Lh(ce,n());Ae!=null&&(W.rowHeight=Ae)}),x.onChange(ce=>{let Ae=ce?ce*1:null;Ae!=null&&!isNaN(Ae)&&(W.flashingDurationCSSVarValue=Ae)}),A.onChange(ce=>{ce&&(W.rowDetailHeight=ce)}),O.onChange(ce=>{let Ae=kh(ce,n());Ae!=null&&(W.columnHeaderHeight=Ae)})}),(0,Qo.useEffect)(()=>{fe.showSeparatePivotColumnForSingleAggregation=M},[M]);let{toggleGroupRow:U}=ly(e,t),ie=F,{computedColumnOrder:ge,computedVisibleColumns:Z,computedVisibleColumnsMap:ee,computedPinnedStartColumns:j,computedPinnedEndColumns:se,computedUnpinnedColumns:ne,computedPinnedStartColumnsWidth:pe,computedPinnedEndColumnsWidth:k,computedUnpinnedColumnsWidth:_,computedUnpinnedOffset:me,computedPinnedEndOffset:Te,computedRemainingSpace:Pe,computedPinnedStartWidth:Re,computedPinnedEndWidth:Me,renderSelectionCheckBox:qe,computedColumnsMap:We,computedColumnsMapInInitialOrder:it,fieldsToColumn:at}=cy({columns:ie,userColumns:z,scrollbarWidth:void 0,columnCssEllipsis:i,columnHeaderCssEllipsis:a,columnMinWidth:l,columnMaxWidth:s,columnDefaultWidth:c,columnDefaultFlex:u,columnDefaultSortable:d,columnDefaultDraggable:p,pinnedStartMaxWidth:f,pinnedEndMaxWidth:m,bodySize:E,viewportReservedWidth:L,resizableColumns:B,sortable:Y,draggableColumns:V,sortInfo:ue??void 0,multiSort:N,groupBy:re,columnOrder:r,columnVisibility:g,columnVisibilityAssumeVisible:!0,columnPinning:h,editable:y,columnDefaultEditable:T,columnDefaultFilterable:b,columnDefaultGroupable:R,filterValue:K,filterTypes:ae,columnSizing:S,columnTypes:C}),et=_h(Z),Xe=Fh(Z),G=fy(n),te=Re?pe>Re:!1,ye=Me?k>Me:!1,[Ie]=(0,Qo.useState)(()=>new Qa({getRowAt:Ae=>be().dataArray[Ae],isNodeSelectable:Ae=>{let{isNodeSelectable:Ze}=be();return Ze?Ze(Ae):!0}})),ut=Le(Z),[le]=(0,Qo.useState)(()=>new Za({getPrimaryKeyByIndex:de.getPrimaryKeyByIndex,getColumnIdByIndex:ce=>ut()[ce]?.id||""})),{computedRowHeight:$,computedRowSizeCacheForDetails:tt}=py({rowDetailHeight:w,rowHeight:I,isRowDetailsExpanded:v,isRowDetailsEnabled:P,getDataSourceState:be});return(0,Qo.useMemo)(()=>({multiRowSelector:Ie,multiCellSelector:le,computedRowSizeCacheForDetails:tt,computedRowHeight:$,scrollbars:G,columnSize:Xe,rowspan:et,toggleGroupRow:U,computedColumnsMap:We,computedColumnsMapInInitialOrder:it,renderSelectionCheckBox:qe,computedPinnedStartOverflow:te,computedPinnedEndOverflow:ye,computedPinnedStartWidth:Re,computedPinnedEndWidth:Me,computedVisibleColumns:Z,computedColumnOrder:ge,computedRemainingSpace:Pe,computedVisibleColumnsMap:ee,computedPinnedStartColumns:j,computedPinnedEndColumns:se,computedUnpinnedColumns:ne,computedPinnedStartColumnsWidth:pe,computedPinnedEndColumnsWidth:k,computedUnpinnedColumnsWidth:_,computedUnpinnedOffset:me,computedPinnedEndOffset:Te,fieldsToColumn:at}),[Ie,le,tt,$,G,Xe,et,U,We,it,qe,te,ye,Re,Me,Z,ge,Pe,ee,j,se,ne,pe,k,_,me,Te,at])}var Sy=require("react");function qI(o=3988292384){var e=new Array,t,n,r;for(t=0;t<256;t++){for(r=t,n=8;n>0;n--)(r&1)==1?r=r>>>1^o:r=r>>>1;e[t]=r}return e}function XI(){return 4294967295}function ZI(o,e,t){return e=e>>>8^o[t^e&255],e}function QI(o){return o=~o,o=o<0?4294967295+o+1:o,o}function Xc(o,e=3988292384){var t=qI(e),n=0,r;for(n=XI(),r=0;r<o.length;r++)n=ZI(t,n,o.charCodeAt(r));return n=QI(n),`${n}`}var JI=o=>{let e=o.reduce((n,r)=>(n.set(r.name,r.value),n),new Map);return{distribution:e.get("Type")==="distribution",count:e.get("DevCount")?Number(e.get("DevCount")):0,start:new Date(e.get("StartDate")),end:new Date(e.get("EndDate")),owner:e.get("Owner"),type:e.get("Type"),timestamp:e.get("TS")?Number(e.get("TS")):0,trial:e.get("Trial")==="true",ref:e.get("Ref")??""}},gy=(o,e=console.error.bind(console))=>{o=["* * * infinite-table.com * * *",...o];let t=Math.max(Math.max(...o.map(n=>n.length))+8,60);o.forEach(n=>{let r=(t-n.length)/2-1,i=0;r!==Math.round(r)&&(i=-1,r=Math.round(r));let a=r+i,l=r;e("*".repeat(a)+" "+n+" "+"*".repeat(l))}),e("*".repeat(t))},hy=(o="",e,t)=>{let n;try{n=ew(o)}catch{return gy(["You don't have a valid Infinite Table license","Please visit infinite-table.com to purchase a license.","Thank you for playing fair!"],t),"invalid"}let r=new Date(e.publishedAt),i=new Date(n.end);return i<r?(gy([`
27
+ Component DEBUG_ID = "${n.debugId}"`),t(r,o,e)},si=n=>{let{debugId:e,key:t}=n,o=Dh[t];if(o&&(yw({...o,debugId:e}),e&&t)){let r=Tt.get(e);r&&r.getState().devToolsDetected&&o&&(r.getState().debugWarnings.set(t,{...o,debugId:e,status:"new"}),Zn(e))}};globalThis.logDevToolsWarning=si;var Zn=n=>{let e=window.__INFINITE_TABLE_DEVTOOLS_HOOK__;if(!e)return;let t=Tt.get(n);t&&e(n,t)};function Eh(n){let{getDataSourceState:e,dataSourceActions:t,dataSourceState:o}=n,{data:r,dataArray:i,notifyScrollbarsChange:a,refetchKey:l,sortInfo:s,shouldReloadData:c,groupBy:u,pivotBy:d,filterValue:p,filterMode:f,livePagination:m,livePaginationCursor:g,filterTypes:h,cursorId:S}=o,[y,C]=(0,ot.useState)({vertical:!1,horizontal:!1}),T=(0,ot.useRef)(y);(0,ot.useEffect)(()=>(a.onChange(M=>{M&&(T.current=M,C(M))}),()=>a.destroy()),[a]),(0,ot.useEffect)(()=>{if(!m)return;let M=requestAnimationFrame(()=>{T.current?.vertical||g&&(t.cursorId=g)});return()=>cancelAnimationFrame(M)},[g]),(0,ot.useEffect)(()=>{if(!m||g!==void 0)return;let M=requestAnimationFrame(()=>{T.current?.vertical||S!=null&&i.length&&(t.cursorId=i.length)});return()=>cancelAnimationFrame(M)},[i.length,g]),(0,ot.useEffect)(()=>{let M=e(),{livePaginationCursor:x,livePagination:E,dataArray:z}=M;!y.vertical&&E&&(x?t.cursorId=x:x===void 0&&z.length&&(t.cursorId=z.length))},[y.vertical]);let b=(0,ot.useMemo)(()=>Eg(),[])(p,h,f),R={sortInfo:c.sortInfo?s:null,groupBy:c.groupBy?u:null,pivotBy:c.pivotBy?d:null,refetchKey:l,filterValue:c.filterValue?b:null,cursorId:m?S:null},w=(0,ot.useRef)(!0),v=(0,ot.useRef)(!1);Sw(n,{sortInfo:s,groupBy:u,pivotBy:d,filterValue:p,refetchKey:l,cursorId:m?S:null},v);let P=Di(),D=(0,ot.useRef)([]);wo(()=>{let M=e(),x=P(),{isDetail:E,isDetailReady:z}=Rc(x,e);if(E&&!z)return;let V=Date.now(),N=D.current;N.length>=10&&N.splice(0,1),N.push(V),V-N[0]<200&&N.length>=10&&si({debugId:M.debugId,key:"DS001"}),typeof M.data!="function"&&Tn(M.data,M,t,void 0,x)},{data:r}),wo(M=>{let x=Object.keys(M),E=!1;if(x.length===1){E=!!M.cursorId;let F=e().data;if(Array.isArray(F)&&M.refetchKey){t.originalDataArray=F;return}}let z=P(),{isDetail:V,isDetailReady:N}=Rc(z,e);if(V&&!N)return;let L=e();if(typeof L.data=="function"){if(v.current&&!E&&Ag(L))return;let F;L.debugId&&(F=st(L.debugId).track.DataSource.label.RemoteDataLoad.start()),Tn(L.data,L,t,{append:E},z).then(()=>{F?.end()})}},{...R,data:r}),(0,ot.useEffect)(()=>{v.current=!1}),wo(()=>{let M=e();if(w.current){w.current=!1;let x=jt(M,void 0,P());t.dataParams=x}},R)}function Sw(n,e,t){let{getDataSourceState:o,dataSourceActions:r,dataSourceState:i}=n;(0,ot.useEffect)(()=>{r.lazyLoadCacheOfLoadedBatches=new U},[i.data,i.dataParams]);let{lazyLoadBatchSize:a,lazyLoad:l,originalLazyGroupDataChangeDetect:s,notifyRenderRangeChange:c,dataArray:u,groupRowsState:d,scrollStopDelayUpdatedByTable:p}=i,f=(0,ot.useRef)(null),m=(h,S,y=o().lazyLoadCacheOfLoadedBatches)=>{let C=o();if(h=h||f.current,!h)return;let{renderStartIndex:T,renderEndIndex:I}=h,{lazyLoadBatchSize:b,lazyLoad:R}=C;R&&((!b||b<=0)&&(!C.groupBy||C.groupBy.length===0)||Og({startIndex:T,endIndex:I,lazyLoadBatchSize:b,componentState:C,componentActions:r,dismissLoadedRows:S?.dismissLoadedRows??!1},y))},g=(0,ot.useMemo)(()=>Nt(m,{wait:p}),[p]);wo(h=>{if(l)return h.sortInfo||h.filterValue||h.groupBy||h.pivotBy||h.refetchKey||h.cursorId?(o().lazyLoadCacheOfLoadedBatches.clear(),o().originalLazyGroupData.clear(),m(c.get(),{dismissLoadedRows:!0}),t.current=!0):(h.originalLazyGroupDataChangeDetect||h.groupRowsState)&&m(c.get()),c.onChange(S=>{f.current=S,_g(o().lazyLoadCacheOfLoadedBatches),m(S)})},{sortInfo:e.sortInfo,filterValue:e.filterValue,groupBy:e.groupBy,pivotBy:e.pivotBy,refetchKey:e.refetchKey,cursorId:e.cursorId,lazyLoadBatchSize:a,lazyLoad:l,originalLazyGroupDataChangeDetect:s,groupRowsState:d}),(0,ot.useEffect)(()=>{a&&a>0&&g()},[u])}function pr(n){let e=En(),t=Di(),o=!!e,r=o?e.id:"master",{contextValue:i,ContextComponent:a}=Hc(n),{componentActions:l,componentState:s,assignState:c}=i;s.getDataSourceMasterContextRef.current=t;let u=Le(s),[d]=(0,gt.useState)(()=>bh({getState:u,actions:l})),p={dataSourceState:s,dataSourceActions:l,getDataSourceMasterContext:t,getDataSourceState:u,assignState:c,dataSourceApi:d},f=Le(i),m=Le(p),g=hc(),h=(0,gt.useCallback)(({children:S})=>{let y=Ha(),[C]=(0,gt.useState)(()=>Ph());typeof S=="function"&&(S=S(u()));let T=m();return C.setSnapshot(T),(0,gt.useLayoutEffect)(()=>{C.notify()}),gt.default.createElement(a.Provider,{key:r,value:f()},gt.default.createElement(g.Provider,{value:T},gt.default.createElement(y.Provider,{value:C},S)))},[a,o,r]);return(0,gt.useLayoutEffect)(()=>{let S=t();S&&S.registerDetail(p)},[]),(0,gt.useLayoutEffect)(()=>()=>{let S=u();S.onCleanup(S)},[]),Eh({dataSourceState:s,dataSourceActions:l,getDataSourceState:u}),(0,gt.useEffect)(()=>{s.onDataArrayChange?.(s.originalDataArray,s.originalDataArrayChangedInfo),s.onDataMutations&&s.originalDataArrayChangedInfo.mutations&&s.originalDataArrayChangedInfo.mutations.size&&s.onDataMutations({primaryKeyField:typeof s.primaryKey=="string"?s.primaryKey:void 0,dataArray:s.originalDataArray,mutations:s.originalDataArrayChangedInfo.mutations,timestamp:s.originalDataArrayChangedInfo.timestamp}),s.onTreeDataMutations&&s.originalDataArrayChangedInfo.treeMutations&&s.originalDataArrayChangedInfo.treeMutations.size&&s.onTreeDataMutations({nodesKey:s.nodesKey?s.nodesKey:void 0,dataArray:s.originalDataArray,treeMutations:s.originalDataArrayChangedInfo.treeMutations,timestamp:s.originalDataArrayChangedInfo.timestamp})},[s.originalDataArrayChangedInfo]),(0,gt.useEffect)(()=>{s.onReady?.(d)},[]),{DataSource:h,state:p.dataSourceState}}function Ah(){return Ne(n=>n.dataSourceApi)}var cl=class cl{constructor(e,t){this.keysInOrder=[];if(typeof e=="number")this.maxSize=e,this.currentMap=new Map;else if(this.maxSize=t??cl.DEFAULT_SIZE,e){let o=Array.from(e);this.maxSize<o.length&&o.slice(o.length-this.maxSize),this.currentMap=new Map,o.forEach(([r,i])=>{this.set(r,i)})}else this.currentMap=new Map}values(){return this.currentMap.values()}get size(){return this.currentMap.size}delete(e){return this.currentMap.has(e)?(this.currentMap.delete(e),this.keysInOrder=this.keysInOrder.filter(t=>t!==e),!0):!1}has(e){return this.currentMap.has(e)}get(e){return this.currentMap.get(e)}set(e,t){if(this.has(e)&&this.delete(e),this.maxSize-this.currentMap.size<=0){let[r]=this.keysInOrder.splice(0,1);r!=null&&this.currentMap.delete(r)}return this.keysInOrder.push(e),this.currentMap.set(e,t),this}};cl.DEFAULT_SIZE=10;var sl=cl;var Kc=class{add(e,t){}get(e){}delete(e){}has(e){return!1}},ul=class{constructor(e){this.storage=new sl(e)}add(e,t){this.storage.set(e,t)}get(e){return this.storage.get(e)}delete(e){this.storage.delete(e)}has(e){return this.storage.has(e)}},Bc=class{constructor(){this.storage=new Map}add(e,t){this.storage.set(e,t)}get(e){return this.storage.get(e)}delete(e){this.storage.delete(e)}has(e){return this.storage.has(e)}},fr=class{constructor(e){this.cacheStorage=e===!1?new Kc:e===!0?new Bc:typeof e=="number"?new ul(e):new ul(5)}add(e,t){this.cacheStorage.add(e,t)}get(e){return this.cacheStorage.get(e)}delete(e){this.cacheStorage.delete(e)}has(e){return this.cacheStorage.has(e)}};var _h=(e=>(e.INIT="INIT",e))(_h||{});var{useManagedComponent:Hc}=kt({debugName:"DataSource",initSetupState:sh,forwardProps:uh,concludeReducer:vh,mapPropsToState:ph,onPropChange:fh,cleanup:ch,interceptActions:gh(),mappedCallbacks:mh()});function bw(n){let{DataSource:e}=pr(n);return Oh.createElement(e,null,n.children??null)}function Tw(){let{rowInfoReducerResults:n}=Ne(e=>({rowInfoReducerResults:e.dataSourceState.rowInfoReducerResults}));return n}function Nh(n){let{getDataSourceState:e}=Ne(o=>({getDataSourceState:o.getDataSourceState}));return(0,Fh.useMemo)(()=>n.filter(r=>typeof r.rowspan=="function").length?({rowIndex:r,colIndex:i})=>{let a=e().dataArray,l=a[r];if(!l)return 1;let s=l.data,c=n[i];return!c||!c.rowspan?1:c.rowspan({column:c,data:s,dataArray:a,rowInfo:l,rowIndex:r})}:void 0,[n])}var Lh=require("react");var xK=Lt("useColumnSizeFn");function kh(n){return(0,Lh.useCallback)(t=>{let o=n[t];return o?o.computedWidth:0},[n])}var $t=require("react");var Cw={scrollLeft:0,scrollTop:0},ci=class{constructor(){this.scrollPosition=Cw;this.onScrollFns=[];this.getScrollPosition=()=>this.scrollPosition;this.onScroll=e=>(this.onScrollFns.push(e),()=>{this.onScrollFns=this.onScrollFns.filter(t=>t!==e)});this.setScrollPosition=e=>{this.scrollPosition=e,this.notifyScrollChange()};this.destroy=()=>{this.onScrollFns=[]}}notifyScrollChange(){let{scrollPosition:e}=this,t=this.onScrollFns;for(let o=0,r=t.length;o<r;o++)t[o](e)}};var ui=n=>`--infinite-${n}`;var Wc=40,di=ui(pp),zh=`var(${ui("density-scale")}, 1)`,pi=`calc(var(${ui("row-height")}, ${Wc}px) * ${zh})`,jc=`calc(var(${di}) * ${zh})`;function Vh(n,e){if(!n)return null;if(e.rowHeightCSSVar!==pi)return n;if(!Rw())return null;let t=Math.round(n);return t===e.rowHeight?null:t}var Iw=ui("loaded");function Rw(){return typeof document>"u"||typeof getComputedStyle!="function"?!1:getComputedStyle(document.documentElement).getPropertyValue(Iw).trim()===$i}function Gh(n,e){return n?e.columnHeaderHeightCSSVar===jc?Math.round(n):n:null}function Hh(n,e){let t=new Map;function o(r){return e[r]!==!1}return Object.keys(n).forEach(r=>{let a=n[r].columnGroup,l=0;for(o(r)||(l=-1);a;){let s=n[a];if(!s)break;o(a)&&l++,a=s.columnGroup}t.set(r,l)}),t}var Kh=H(require("react"));function Bh(n){return(e,t)=>Kh.createElement(n,{key:e.id,rowInfo:e,cache:t})}var fi=class extends ho{constructor(t,o){super(`${t}:HorizontalLayout`);this.visiblePageCount=0;this.isHorizontalLayoutBrain=!0;this._totalPageCount=0;this.pageWidth=0;this.initialCols=0;this.initialRows=0;this.initialColWidth=0;this.colWidth=()=>10;this.getColWidth=t=>typeof this.initialColWidth=="number"?this.initialColWidth:this.initialColWidth(t%this.initialCols);this.onTotalPageCountChangeFns=new Set;this.onTotalPageCountChange=t=>(this.onTotalPageCountChangeFns.add(t),()=>{this.onTotalPageCountChangeFns.delete(t)});this.onScrollOriginChange=t=>this.options?.masterBrain?this.options.masterBrain.onScrollOriginChange(t):super.onScrollOriginChangeForBrain(t);this.options=o,this.options.masterBrain&&this.options.masterBrain.onTotalPageCountChange(()=>{this.updateRenderCount({horizontal:!0,vertical:!0})})}computeDirectionalRenderCount(t,o,r,i){if(t==="vertical"||typeof o=="number")return super.computeDirectionalRenderCount(t,o,r,i);let a=0,l=i.width,s=Math.floor(l/this.pageWidth);a+=s*this.initialCols;let c=l-s*this.pageWidth,u=[];for(let d=0;d<this.initialCols;d++)u.push(this.getItemSize(d,t));return a+=Pa(c,u.concat(u)),t==="horizontal"?this.maxHorizontalRenderCount=a:this.maxVerticalRenderCount=a,a=Math.min(r,a),a}getRowIndexInPage(t){return this.rowsPerPage?t%this.rowsPerPage:t}getInitialCols(){return this.initialCols}getInitialRows(){return this.initialRows}getPageIndexForRow(t){return Math.floor(t/this.rowsPerPage)}getMatrixCoordinatesForHorizontalLayoutPosition(t){let o=t.rowIndex,r=t.colIndex;return t.rowIndex>=this.rowsPerPage&&this.rowsPerPage>0&&(o=t.rowIndex%this.rowsPerPage,r=Math.floor(t.rowIndex/this.rowsPerPage)*this.initialCols+r),{rowIndex:o,colIndex:r}}getHorizontalLayoutPositionFromMatrixCoordinates(t){let o=t.rowIndex,r=t.colIndex;if(t.colIndex>=this.initialCols&&this.initialCols>0){let i=Math.floor(t.colIndex/this.initialCols);r=t.colIndex-i*this.initialCols,o=this.rowsPerPage*i+t.rowIndex}return{colIndex:Math.min(r,this.initialCols),rowIndex:this.options.isHeader?o:Math.min(o,this.initialRows)}}update(t){let{rows:o,cols:r,rowHeight:i,colWidth:a,width:l,height:s}=t,c=typeof l=="number",u=typeof s=="number",d=c&&l!==this.availableWidth,p=u&&s!==this.availableHeight;d&&(this.availableWidth=l,this.availableRenderWidth=l),p&&(this.availableHeight=s,this.availableRenderHeight=s),(d||p)&&this.notifyAvailableSizeChange();let f=typeof o=="number",m=typeof r=="number",g=f&&o!==this.initialRows,h=m&&r!==this.initialCols;f&&g&&(this.initialRows=o,this.rows=o),m&&h&&(this.initialCols=r,this.cols=r);let S=i!=null,y=a!=null,C=S&&i!==this.rowHeight,T=y&&a!==this.initialColWidth;S&&(this.rowHeight=i),y&&(this.initialColWidth=a,this.colWidth=this.getColWidth);let I=g||C||p,b=h||T||d||I;(b||I)&&this.updateRenderCount({horizontal:b,vertical:I})}getInitialRowHeight(){return typeof this.rowHeight!="number"?this.getRowHeight(0):this.rowHeight}get totalPageCount(){return this.options.masterBrain?this.options.masterBrain.totalPageCount:this._totalPageCount}set totalPageCount(t){this.options.masterBrain||(this._totalPageCount=t)}getPageWidth(){return this.pageWidth}doUpdateRenderCount(t=hn){let o=this.getInitialRowHeight(),r=0;for(let a=0;a<this.initialCols;a++)r+=this.getColWidth(a);this.pageWidth=r,this.rowsPerPage=Math.floor(this.availableHeight/o);let i=!1;if(!this.options.masterBrain){let a=this.totalPageCount;this.totalPageCount=this.rowsPerPage?Math.ceil(this.initialRows/this.rowsPerPage):0,a!=this.totalPageCount&&(i=!0)}this.visiblePageCount=this.totalPageCount&&this.pageWidth?Math.max(Math.ceil(this.availableWidth/this.pageWidth),1):1,this.availableRenderHeight=this.visiblePageCount*this.rowsPerPage*o,this.cols=Math.max(this.totalPageCount*this.initialCols,this.initialCols),this.rows=this.rowsPerPage,super.doUpdateRenderCount(t),i&&this.notifyTotalPageCountChange()}notifyTotalPageCountChange(){if(this.destroyed)return;let t=this.onTotalPageCountChangeFns;t.forEach(o=>{He(()=>{this.destroyed||t.has(o)&&o(this.totalPageCount)})})}getVirtualColIndex(t,o){return this.initialCols*(o?.pageIndex??0)+t}destroy(){this.destroyed||(super.destroy(),this.options.masterBrain=void 0,this.onTotalPageCountChangeFns.clear())}supportsLargeContent(t){return t==="horizontal"}alignScrollOrigin(t,o){return t==="vertical"||!this.pageWidth?Math.floor(o):Math.floor(o/this.pageWidth)*this.pageWidth}getScrollOriginPageIndex(){let t=this.getPageWidth();return t?Math.round(this.getScrollOrigin().scrollLeft/t):0}getScrollOrigin(){return this.options?.masterBrain?this.options.masterBrain.getScrollOrigin():super.getScrollOrigin()}updateScrollOrigin(){this.options?.masterBrain||super.updateScrollOrigin()}getVirtualizedContentSizeFor(t){return t==="vertical"?this.getInitialRowHeight()*this.rowsPerPage:this.pageWidth*this.totalPageCount}};function vo(){return{current:null}}var Uc={};function $c(n){return`.${nn}[data-row-index${n?`="${n.rowIndex}"`:""}][data-col-index${n?`="${n.colIndex}"`:""}]`}function Yc(n,e){let t=Un(n),o=e?new fi(t,{isHeader:!1}):new ho(t),r=`${t}:header`,i=e?new fi(r,{isHeader:!0,masterBrain:o}):new ho(r);o.onScroll(u=>{i.setScrollPosition({scrollLeft:u.scrollLeft,scrollTop:0})});let{renderer:a,onRenderUpdater:l}=ei(o),{renderer:s,onRenderUpdater:c}=ei(i);return o.onAvailableSizeChange(u=>{i.update({width:u.width})}),{brain:o,headerBrain:i,renderer:a,onRenderUpdater:l,headerRenderer:s,headerOnRenderUpdater:c}}function Wh({debugId:n,wrapRowsHorizontally:e}){let t={},{brain:o,headerBrain:r,renderer:i,onRenderUpdater:a,headerRenderer:l,headerOnRenderUpdater:s}=Yc(n,!!e),c=vo(),u=Date.now();return{debugWarnings:new Map,renderer:i,onRenderUpdater:a,headerRenderer:l,headerOnRenderUpdater:s,updatedAt:u,devToolsDetected:!!globalThis.__INFINITE_TABLE_DEVTOOLS_HOOK__,propsCache:new Map([]),lastRowToCollapseRef:{current:null},lastRowToExpandRef:{current:null},cellContextMenuVisibleFor:null,contextMenuVisibleFor:null,columnMenuVisibleForColumnId:null,columnMenuVisibleKey:0,filterOperatorMenuVisibleForColumnId:null,getDOMNodeForCell:d=>{if(!c.current)return null;let p=$c(d);return c.current.querySelector(p)||null},brain:o,headerBrain:r,domRef:c,columnMenuTargetRef:vo(),editingValueRef:vo(),scrollerDOMRef:vo(),portalDOMRef:vo(),focusDetectDOMRef:vo(),activeCellIndicatorDOMRef:vo(),onColumnMenuClick:Se(),cellContextMenu:Se(),contextMenu:Se(),onFilterOperatorMenuClick:Se(),flashingDurationCSSVarValue:null,onFlashingDurationCSSVarChange:Se(),onRowHeightCSSVarChange:Se(),onRowDetailHeightCSSVarChange:Se(),onColumnHeaderHeightCSSVarChange:Se(),cellClick:Se(),cellMouseDown:Se(),keyDown:Se(),bodySize:{width:0,height:0},scrollPosition:{scrollTop:0,scrollLeft:0},columnReorderDragColumnId:!1,columnReorderInPageIndex:null,ready:!1,focused:!1,focusedWithin:!1,columnsWhenGrouping:t,columnVisibilityForGrouping:{},pinnedStartScrollListener:new ci,pinnedEndScrollListener:new ci,columnsWhenInlineGroupRenderStrategy:void 0,editingCell:null,forceBodyRerenderTimestamp:0}}var jh=n=>({debugId:1,scrollTopKey:1,components:1,id:1,loadingText:1,pivotColumns:1,groupColumn:1,onReady:1,domProps:1,onKeyDown:1,onCellClick:1,onCellDoubleClick:1,focusedClassName:1,focusedWithinClassName:1,focusedStyle:1,focusedWithinStyle:1,onSelfFocus:1,onFocusWithin:1,onSelfBlur:1,onBlurWithin:1,onContextMenu:1,onCellContextMenu:1,onRenderRangeChange:1,onRowMouseEnter:1,onRowMouseLeave:1,onScrollToTop:1,onScrollToBottom:1,onScrollStop:1,scrollToBottomOffset:1,getColumnMenuItems:1,getCellContextMenuItems:1,getContextMenuItems:1,menuPortalContainer:1,menuConstrainTo:1,columnPinning:1,editable:1,columnDefaultEditable:1,columnDefaultFilterable:1,columnDefaultGroupable:1,columnDefaultSortable:1,keyboardShortcuts:1,rowStyle:1,cellStyle:1,repaintCellsKey:1,rowProps:1,rowClassName:1,rowHoverClassName:1,cellClassName:1,repeatWrappedGroupRows:1,pinnedStartMaxWidth:1,pinnedEndMaxWidth:1,pivotColumn:1,pivotColumnGroups:1,getFilterOperatorMenuItems:1,onScrollbarsChange:1,autoSizeColumnsKey:1,wrapRowsHorizontally:1,columnDefaultFlex:1,draggableColumnsRestrictTo:e=>e??!1,columnMenuRealignDelay:e=>e??50,scrollStopDelay:e=>e??250,viewportReservedWidth:e=>e??0,resizableColumns:e=>e??!0,rowDetailCache:e=>new fr(e),hideColumnWhenGrouped:e=>e??!1,columnMinWidth:e=>e??30,columnMaxWidth:e=>e??5e3,columnDefaultWidth:e=>e??200,columnCssEllipsis:e=>e??!0,draggableColumns:1,columnDefaultDraggable:1,headerOptions:e=>({alwaysReserveSpaceForSortIcon:!0,...e}),showSeparatePivotColumnForSingleAggregation:e=>e??!1,sortable:1,hideEmptyGroupColumns:e=>e??!1,pivotTotalColumnPosition:e=>e??"end",pivotGrandTotalColumnPosition:1,licenseKey:e=>e,keyboardSelection:e=>e??!0,multiRowSelectionWith:e=>e??"checkbox",activeRowIndex:1,activeCellIndex:1,columnOrder:e=>e??!0,header:e=>e??!0,showZebraRows:e=>e??!0,showHoverRows:e=>e??!0,virtualizeColumns:e=>e??!0,rowHeight:e=>typeof e=="number"||typeof e=="function"?e:e===pi?Wc:0,rowDetailHeight:e=>typeof e=="number"||typeof e=="function"?e:300,columnHeaderHeight:e=>typeof e=="number"?e:30,columns:1,columnVisibility:e=>e??Uc,columnGroupVisibility:e=>e??Uc,columnSizing:e=>e||{},columnTypes:e=>e||{},onEditCancelled:1,onEditRejected:1,onEditAccepted:1,persistEdit:1,shouldAcceptEdit:1,onEditPersistError:1,onEditPersistSuccess:1,multiSortBehavior:e=>e??"replace",collapsedColumnGroups:e=>e??new Map,columnGroups:1});function ww(n){let{groupBy:e,groupColumn:t,groupRenderStrategy:o}=n;return o||(t!=null&&typeof t=="object"?"single-column":(e.filter(i=>i.column).length,"multi-column"))}var Uh=n=>{n.brain.destroy(),n.headerBrain.destroy(),n.renderer.destroy(),n.headerRenderer.destroy(),n.onRenderUpdater.destroy(),n.headerOnRenderUpdater.destroy(),n.onFlashingDurationCSSVarChange.destroy(),n.onRowHeightCSSVarChange.destroy(),n.onColumnHeaderHeightCSSVarChange.destroy(),n.onColumnMenuClick.destroy(),n.onFilterOperatorMenuClick.destroy(),n.domRef.current=null,n.columnMenuTargetRef.current=null,n.scrollerDOMRef.current=null,n.portalDOMRef.current=null,n.onRowDetailHeightCSSVarChange.destroy(),n.pinnedEndScrollListener.destroy(),n.pinnedStartScrollListener.destroy()};function $h(n){return n.reduce((e,t,o)=>{let r={groupBy:t,groupIndex:o};return t.field?e.set(t.field,r):t.groupField&&e.set(t.groupField,r),e},new Map)}var dl=new WeakMap;function Yh(){return{rowDetailState:(n,e)=>({callbackParams:[n,{expandRow:e.lastRowToExpandRef.current,collapseRow:e.lastRowToCollapseRef.current}]})}}var qh=n=>{let{props:e,state:t,oldState:o,parentState:r}=n,i=t.pivotColumnGroups||t.columnGroups,a=t.columnGroups&&t.columnGroups!=o?.columnGroups||t.columnGroups&&t.columnGroupVisibility!=o?.columnGroupVisibility||t.pivotColumnGroups!=o?.pivotColumnGroups?Hh(i??Uc,t.columnGroupVisibility):t.columnGroupsDepthsMap,l=r?.groupBy,s=ww({groupRenderStrategy:e.groupRenderStrategy,groupBy:l,groupColumn:e.groupColumn}),c,u=e.rowDetailRenderer,d=e.components?.RowDetail;if(!u&&d){let h=dl.get(d);h||(h=Bh(d),dl.set(d,h)),u=h}u&&(c=e.rowDetailState||t.rowDetailState||e.defaultRowDetailState,c&&!(c instanceof At)&&(c=new At(c)),c=c||new At({expandedRows:[],collapsedRows:!0}));let p=t.columnsWhenGrouping||t.columnsWhenInlineGroupRenderStrategy||t.columns,f=c?e.isRowDetailExpanded:void 0;!f&&c&&(f=dl.get(c),f||(f=h=>c.isRowDetailsExpanded(h.id),typeof c=="object"&&dl.set(c,f)));let m=u?e.isRowDetailEnabled||!0:!1,g={updatedAt:Date.now(),isTree:r.isTree,rowDetailRenderer:u,rowDetailState:c,isRowDetailExpanded:f,isRowDetailEnabled:m,showColumnFilters:e.showColumnFilters??!!r.filterValue,controlledColumnVisibility:!!e.columnVisibility,groupRenderStrategy:s,groupBy:l,computedColumns:p,initialColumns:e.columns,keyboardNavigation:e.keyboardNavigation??(t.activeCellIndex!=null?"cell":t.activeRowIndex!=null?"row":"cell"),columnHeaderCssEllipsis:e.columnHeaderCssEllipsis??e.columnCssEllipsis??!0,columnGroupsDepthsMap:a,columnGroupsMaxDepth:a!=t.columnGroupsDepthsMap?Math.max(...a.values(),-1):t.columnGroupsMaxDepth,computedColumnGroups:i,rowHeightCSSVar:typeof e.rowHeight=="string"?e.rowHeight:"",rowDetailHeightCSSVar:typeof e.rowDetailHeight=="string"?e.rowDetailHeight:"",columnHeaderHeightCSSVar:typeof e.columnHeaderHeight=="string"?!e.columnHeaderHeight||e.columnHeaderHeight===di?jc:e.columnHeaderHeight:""};if(t.devToolsDetected&&t.debugId){let h=Cn.get(t.debugId);h&&(g={...g,...h})}return g};function Xh(n,e){let t={};return Object.keys(n).forEach(o=>{let r=n[o],i=r;if(!i.groupByForColumn||Array.isArray(i.groupByForColumn))return;let{groupByForColumn:a}=i,l=a.field||a.groupField;l&&e.get(l)&&(t[o]=r)}),t}function Zh(n){let{hideEmptyGroupColumns:e,groupByMap:t,computedGroupColumns:o,groupRowsIndexesInDataArray:r,dataArray:i,groupBy:a}=n,l={...n.columnVisibility};if(!e)return Object.keys(o).forEach(d=>{l[d]===!1&&delete l[d]}),l;if(!r||!r.length)return l;let s=a.length,c=0,u=r.length;for(let d=0;d<u;d++){let p=r[d],f=i[p];if(!f.isTreeNode&&f.isGroupRow&&(c=Math.max(c,f.groupNesting-1),c===s-1))break}return Object.keys(o).forEach(d=>{let p=o[d],{groupByForColumn:f}=p;if(Array.isArray(f))return;let m=f.field||f.groupField;if(!m)return;t.get(m).groupIndex>c&&e?l[d]!==!1&&(l[d]=!1):l.hasOwnProperty(d)&&delete l[d]}),l}var wn=H(require("react"));var Qh=n=>n.dataSourceHasGrouping&&n.isGroupRow&&n.childrenLoading||!n.selfLoaded;var pl=H(require("react"));var Jh="_16lm1iwb _16lm1iw1d _16lm1iwk";var ey="164.93361431346415 56.97787143782138",ty={margin:"auto",display:"block",shapeRendering:"auto"},cB=Object.keys({size:1,style:1,className:1,viewBox:1});var ny=n=>pl.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",style:{...ty,...n.style},width:"24px",height:"24px",viewBox:n.viewBox??"0 0 100 100",preserveAspectRatio:"xMidYMid",className:$(n.className,Jh,Vo.loading,fd,"InfiniteIcon","InfiniteIcon-loading")},pl.createElement("circle",{cx:"50",cy:"50",fill:"none",strokeWidth:"10",r:"35",strokeDasharray:ey},pl.createElement("animateTransform",{attributeName:"transform",type:"rotate",repeatCount:"indefinite",dur:"1s",values:"0 50 50;360 50 50",keyTimes:"0;1"})));function oy(n,e,t,o){let{groupByForColumn:r,groupIndexForColumn:i,groupRenderStrategy:a}=n,l=r.column?{...r.column}:{},s=typeof t=="function"?t(n,e):t;return{header:`Group by ${r.field||r.groupField}`,groupByForColumn:r,render:o.getGroupColumnRender({groupIndexForColumn:i,groupRenderStrategy:a}),...l,...s,renderGroupIcon:o.getGroupColumnRenderGroupIcon({initialRenderGroupIcon:s?.renderGroupIcon??l.renderGroupIcon,groupIndexForColumn:i,toggleGroupRow:e,groupRenderStrategy:a})}}function ry(n,e,t,o){let r=typeof t=="function"?t(n,e):t,i={};return n.sortable!=null&&(i.sortable=n.sortable),{...i,header:"Group",groupByForColumn:n.groupBy,renderSelectionCheckBox:n.selectionMode==="multi-row",render:o.getGroupColumnRender({groupIndexForColumn:0,groupRenderStrategy:"single-column"}),...r,renderGroupIcon:o.getGroupColumnRenderGroupIcon({initialRenderGroupIcon:r?.renderGroupIcon,groupIndexForColumn:0,toggleGroupRow:e,groupRenderStrategy:"single-column"})}}function qc({groupIndexForColumn:n,groupRenderStrategy:e}){return t=>{let{rowInfo:o,renderBag:r,column:i,align:a}=t,{value:l,groupIcon:s,selectionCheckBox:c}=r,u=o,d=e==="multi-column"&&u.isGroupRow&&n+1!==u.groupNesting,p=$(zo.flex,i.align==="end"?_r.rowReverse:_r.row,ed.center,`${nn}Expander`,e==="single-column"||e==="multi-column"&&(!o.isGroupRow||c||d&&i.field)?Mf({align:a}):null);return d?i.field?wn.createElement("div",{className:p},c,wn.createElement("div",{className:Ht},l??null)):c?wn.createElement("div",{className:p},c):null:(e==="single-column"&&u.isGroupRow,wn.createElement("div",{className:p},s,c,wn.createElement("div",{className:Ht},l??null)))}}function Xc({groupIndexForColumn:n,groupRenderStrategy:e,toggleGroupRow:t,initialRenderGroupIcon:o}){return r=>{let{rowInfo:i,value:a,rootGroupBy:l,pivotBy:s,column:c}=r,u=e!=="inline"?i:i.isGroupRow&&i.parents?.[n]||i;if(!u)return null;let d=u.collapsed;if(e==="inline"){if(u.groupCount===1)return a;if(u.groupNesting===n&&d)return null}else if(!u.isGroupRow||e==="multi-column"&&n+1!==u.groupNesting)return null;let p=u.groupKeys,f=null,m=s?(u.groupKeys?.length||0)<l?.length:(u.groupKeys?.length||0)<=l?.length;return Qh(u)?f=wn.createElement(ny,null):m&&(f=wn.createElement(uo,{expanded:!d,direction:c.align==="end"?"end":"start",onChange:()=>{t(p)}})),o&&(r.renderBag.groupIcon=f,f=wn.createElement(vt,{render:o,renderParam:r})),f}}function iy(){return{getGroupColumnRender:qc,getGroupColumnRenderGroupIcon:Xc}}function ay(n,e,t){return oy(n,e,t,iy())}function ly(n,e,t){return ry(n,e,t,iy())}function sy(n){let{pivotColumns:e,groupBy:t,pivotBy:o,selectionMode:r,groupColumn:i,pivotTotalColumnPosition:a,pivotGrandTotalColumnPosition:l,pivotColumn:s,groupRenderStrategy:c,toggleGroupRow:u,columns:d}=n;if(c==="inline")return{columns:void 0,groupColumnIds:[]};let p={},f=[];if(c==="multi-column")t.forEach((m,g,h)=>{let S=ay({groupByForColumn:m,groupBy:t,pivotBy:o,groupIndexForColumn:g,groupCount:h.length,groupRenderStrategy:c,selectionMode:r},u,i),y=S.id||`group-by-${m.field||m.groupField}`;f.push(y),p[y]=S});else if(c==="single-column"&&t.length){let m=ly({groupCount:t.length,groupBy:t,pivotBy:o,groupRenderStrategy:c,selectionMode:r},u,i),g=m.id||"group-by";f.push(g),p[g]=m}return e?Object.keys(e).forEach(m=>{let g=e[m],h=g.pivotTotalColumn&&g.columnGroup,S=g.pivotTotalColumn&&!g.columnGroup;if(h&&a===!1||S&&l===!1)return;let y={...g};s&&(typeof s=="function"?y={...y,...s({column:y,pivotBy:o,groupBy:t})}:y={...y,...s}),y.inheritFromColumn!==!1&&(y={...typeof y.inheritFromColumn=="string"?d[y.inheritFromColumn]:y.pivotAggregator?.field?oo(d,y.pivotAggregator.field):void 0,...y}),!y.render&&y.renderValue&&(y.render=C=>y.renderValue(C)),p[m]=y}):Object.keys(d).forEach(m=>{let g=d[m];p[m]=g}),{columns:Object.keys(p).length?p:void 0,groupColumnIds:f}}var cy=require("react");function Zc(){let{getDataSourceState:n,dataSourceActions:e,getDataSourceMasterContext:t}=Ne(r=>({getDataSourceState:r.getDataSourceState,dataSourceActions:r.dataSourceActions,getDataSourceMasterContext:r.getDataSourceMasterContext}));return(0,cy.useCallback)(r=>{let i=n(),a=new xt(i.groupRowsState);if(a.toggleGroupRow(r),e.groupRowsState=a,i.lazyLoad){let l=[wt,...r],s=i.originalLazyGroupData.get(l);a.isGroupRowExpanded(r)?s?.cache||Tn(i.data,i,e,{groupKeys:r},t()):s?.cache||(i.lazyLoadCacheOfLoadedBatches.getKeysStartingWith(r).forEach(u=>{i.lazyLoadCacheOfLoadedBatches.delete(u)}),e.lazyLoadCacheOfLoadedBatches=U.clone(i.lazyLoadCacheOfLoadedBatches),i.originalLazyGroupData.delete(l),e.originalLazyGroupDataChangeDetect=Vt())}},[])}function vw(n){return(0,$t.useMemo)(()=>$h(n),[n])}function uy(n,e){let{groupBy:t,dataSourceActions:o}=Ne(c=>({groupBy:c.dataSourceState.groupBy,dataSourceActions:c.dataSourceActions})),{groupRenderStrategy:r,pivotTotalColumnPosition:i,pivotGrandTotalColumnPosition:a}=n;(0,$t.useEffect)(()=>{o.generateGroupRows=r!=="inline"},[r]),(0,$t.useEffect)(()=>{o.pivotTotalColumnPosition=i},[i]),(0,$t.useEffect)(()=>{a!=null&&(o.pivotGrandTotalColumnPosition=a)},[a]);let l=vw(t);Pw(l,n,e);let{toggleGroupRow:s}=xw();return Dw(l,n,e),{toggleGroupRow:s}}function Pw(n,e,t){let o=Zc(),{columns:r,groupRenderStrategy:i,isTree:a}=e,l=t;function s(c,u,d,p){let f={};if(d==="inline")return Object.keys(c).forEach(m=>{let g=c[m],h={},S=u.get(g.field);if(S&&d==="inline"){let{groupIndex:C}=S;h={groupByForColumn:S.groupBy,field:S.groupBy?.field,valueGetter:S.groupBy?.valueGetter,valueFormatter:({rowInfo:T})=>T.isGroupRow?T.groupKeys?.[C]:T.value,rowspan:({rowInfo:T,dataArray:I})=>{if(T.isTreeNode||!T.isGroupRow)return 1;let b=I[T.indexInAll-1]||{indexInParentGroups:[]};if(!b||!b.dataSourceHasGrouping)return 1;let R=b.indexInParentGroups||[],w=T.indexInParentGroups||[],v=!1;for(let M=0;M<=C;M++){let x=R[M];if(w[M]!==x){v=!0;break}}if(!v)return 1;let P=T.parents[C];return P?P.groupCount-(P.collapsedChildrenCount||0)+(P.collapsedGroupsCount||0):1},renderGroupIcon:Xc({groupIndexForColumn:C,groupRenderStrategy:d,toggleGroupRow:p,initialRenderGroupIcon:g.renderGroupIcon}),render:qc({groupIndexForColumn:C,groupRenderStrategy:d})}}let y={...h,...g};f[m]=y}),Object.keys(f).length===0?void 0:f}(0,$t.useEffect)(()=>{(()=>{l.columnsWhenInlineGroupRenderStrategy=a?void 0:s(r,n,i,o)})()},[r,n,i,o])}function xw(){let{groupBy:n,pivotBy:e,selectionMode:t}=Ne(m=>({groupBy:m.dataSourceState.groupBy,pivotBy:m.dataSourceState.pivotBy,selectionMode:m.dataSourceState.selectionMode})),{componentActions:o,componentState:{columns:r,groupColumn:i,hideColumnWhenGrouped:a,groupRenderStrategy:l,pivotColumns:s,pivotColumn:c,pivotTotalColumnPosition:u,pivotGrandTotalColumnPosition:d},getComponentState:p}=zt(),f=Zc();return(0,$t.useEffect)(()=>{(()=>{let{columns:g,groupColumnIds:h}=sy({columns:r,groupColumn:i,pivotColumn:c,pivotTotalColumnPosition:u,pivotGrandTotalColumnPosition:d,groupRenderStrategy:l==="inline"?"single-column":l,groupBy:n,pivotBy:e,pivotColumns:s,toggleGroupRow:f,selectionMode:t});o.columnsWhenGrouping=g;let S=p().columnOrder;if(h.length&&Array.isArray(S)){let y=new Set(S),C=!1;h.forEach(T=>{y.has(T)||(C=!0,S=[T,...S])}),C&&(o.columnOrder=S)}})()},[r,n,e,t,a,i,l,s,u,c]),{toggleGroupRow:f}}function Dw(n,e,t){let{dataArray:o,groupRowsIndexesInDataArray:r,groupBy:i,groupRowsState:a,originalLazyGroupDataChangeDetect:l,getDataSourceState:s}=Ne(h=>({getDataSourceState:h.getDataSourceState,dataArray:h.dataSourceState.dataArray,groupRowsIndexesInDataArray:h.dataSourceState.groupRowsIndexesInDataArray,groupBy:h.dataSourceState.groupBy,groupRowsState:h.dataSourceState.groupRowsState,originalLazyGroupDataChangeDetect:h.dataSourceState.originalLazyGroupDataChangeDetect})),{columnTypes:c,computedColumns:u,hideColumnWhenGrouped:d,hideEmptyGroupColumns:p,groupRenderStrategy:f}=e,m=t,g=Le(e);(0,$t.useLayoutEffect)(()=>{if(f!=="multi-column")return;let h=g(),S=Xh(u,n),y=Zh({computedGroupColumns:S,columnVisibility:h.columnVisibility,hideEmptyGroupColumns:p,groupRowsIndexesInDataArray:r,dataArray:o,groupBy:i,groupByMap:n});Rt(h.columnVisibility,y)||(m.columnVisibility=y)},[s,f,l,i,n,u,p?o:null,p?a:null,p?r:null,p]),(0,$t.useEffect)(()=>{let h=i.length>0,S=g(),{columnVisibility:y,columnVisibilityForGrouping:C,hideColumnWhenGrouped:T}=S,I={...y},b={...C},R=!1,w=new Set,v=new Set;Object.keys(u).forEach(P=>{let D=u[P];if(D.defaultHiddenWhenGroupedBy||T!=null)if(D.defaultHiddenWhenGroupedBy==="*"&&h||(D.defaultHiddenWhenGroupedBy===!0||T)&&D.field&&n.get(D.field)||typeof D.defaultHiddenWhenGroupedBy=="string"&&n.get(D.defaultHiddenWhenGroupedBy)||typeof D.defaultHiddenWhenGroupedBy=="object"&&Object.keys(D.defaultHiddenWhenGroupedBy).reduce((x,E)=>x||n.has(E),!1)){if(b[P]!==!1){if(y[P]===!1)return;b[P]=!1,R=!0,w.add(P)}}else b[P]===!1&&(delete b[P],R=!0,v.add(P))}),R&&(m.columnVisibilityForGrouping=b,v.forEach(P=>{delete I[P]}),w.forEach(P=>{I[P]=!1}),m.columnVisibility=I)},[u,c,i,n,d])}var dy=require("react");var py=({columns:n,userColumns:e,bodySize:t,columnMinWidth:o,columnMaxWidth:r,columnDefaultWidth:i,columnDefaultFlex:a,sortable:l,columnCssEllipsis:s,columnHeaderCssEllipsis:c,draggableColumns:u,columnDefaultDraggable:d,sortInfo:p,multiSort:f,filterValue:m,filterTypes:g,columnOrder:h,columnPinning:S,editable:y,columnDefaultEditable:C,columnDefaultFilterable:T,columnDefaultGroupable:I,columnDefaultSortable:b,scrollbarWidth:R,columnTypes:w,pinnedEndMaxWidth:v,pinnedStartMaxWidth:P,viewportReservedWidth:D,resizableColumns:M,columnVisibility:x,columnVisibilityAssumeVisible:E,columnSizing:z,groupBy:V})=>{let{computedRemainingSpace:L,computedColumnOrder:F,computedVisibleColumns:B,computedVisibleColumnsMap:X,computedPinnedStartColumns:_,computedPinnedEndColumns:k,computedUnpinnedColumns:K,computedPinnedStartColumnsWidth:Q,computedPinnedEndColumnsWidth:Ie,computedUnpinnedColumnsWidth:se,computedUnpinnedOffset:me,computedPinnedEndOffset:ve,computedPinnedEndWidth:Pe,computedPinnedStartWidth:ue,renderSelectionCheckBox:oe,computedColumnsMap:ce,computedColumnsMapInInitialOrder:pe,fieldsToColumn:Z}=(0,dy.useMemo)(()=>tp({columns:n,userColumns:e,scrollbarWidth:R,bodySize:t,columnMinWidth:o,columnMaxWidth:r,columnDefaultWidth:i,columnDefaultFlex:a,columnCssEllipsis:s,columnHeaderCssEllipsis:c,viewportReservedWidth:D,resizableColumns:M,filterValue:m,filterTypes:g,sortable:l,sortInfo:p,multiSort:f,pinnedEndMaxWidth:v,pinnedStartMaxWidth:P,draggableColumns:u,columnDefaultDraggable:d,columnOrder:h,columnPinning:S,columnDefaultEditable:C,columnDefaultFilterable:T,columnDefaultGroupable:I,columnDefaultSortable:b,editable:y,columnSizing:z,columnTypes:w,columnVisibility:x,columnVisibilityAssumeVisible:E??!0,groupBy:V}),[n,e,t.width,o,r,i,D,R,l,p,f,m,g,h,x,E,d,u,M,v,P,z,w,S,C,T,I,y,V,1]);return{renderSelectionCheckBox:oe,columns:n,computedColumnsMap:ce,computedPinnedEndWidth:Pe,computedPinnedStartWidth:ue,computedRemainingSpace:L,computedUnpinnedOffset:me,computedPinnedEndOffset:ve,computedPinnedStartColumnsWidth:Q,computedPinnedEndColumnsWidth:Ie,computedUnpinnedColumnsWidth:se,computedPinnedStartColumns:_,computedPinnedEndColumns:k,computedUnpinnedColumns:K,computedVisibleColumns:B,computedVisibleColumnsMap:X,computedColumnOrder:F,computedColumnsMapInInitialOrder:pe,fieldsToColumn:Z}};var my=require("react");var fl=class{constructor(){this.rowHeight=new Map;this.rowDetailHeight=new Map;this.getRowHeight=e=>this.rowHeight.get(e)??0;this.getRowDetailHeight=e=>this.rowDetailHeight.get(e)??0}getTotalRowHeight(e){return this.getRowHeight(e)+this.getRowDetailHeight(e)}getSize(e){let t=this.getRowHeight(e),o=this.getRowDetailHeight(e);return{rowHeight:t,rowDetailHeight:o,totalRowHeight:t+o}}};function Mw(n,e){let t=n.rowDetailHeight,o=n.rowHeight,{isRowDetailsExpanded:r,isRowDetailsEnabled:i,getDataSourceState:a}=n;if(!r)return typeof o=="function"?u=>{if(e&&e.rowHeight.has(u))return e.rowHeight.get(u);let d=a().dataArray[u],p=d?o(d):0;return e&&e.rowHeight.set(u,p),p}:o;let l=typeof o=="function",s=typeof t=="function";return u=>{if(e&&e.rowHeight.has(u)&&e.rowDetailHeight.has(u))return e.rowHeight.get(u)+e.rowDetailHeight.get(u);let d=a().dataArray[u];if(!d)return e&&(e.rowHeight.set(u,0),e.rowDetailHeight.set(u,0)),0;let p=l?o(d):o;if(!!(!i||typeof i=="function"&&i(d)===!1)||!r(d))return e&&(e.rowHeight.set(u,p),e.rowDetailHeight.set(u,0)),p;let m=0;return s?m=t(d):m=t,e&&(e.rowHeight.set(u,p),e.rowDetailHeight.set(u,m)),p+m}}function fy(n){let e=new fl;return{computedRowHeight:Mw(n,e),computedRowSizeCacheForDetails:n.isRowDetailsExpanded?e:void 0}}function gy(n){return(0,my.useMemo)(()=>fy(n),[n.rowHeight,n.rowDetailHeight,n.isRowDetailsExpanded,n.isRowDetailsEnabled,n.getDataSourceState])}var mr=require("react");var Ew={vertical:!1,horizontal:!1};function hy(n){let e=n().brain,{getDataSourceState:t}=on(),[o,r]=(0,mr.useState)(Ew);return(0,mr.useEffect)(()=>e.onRenderCountChange(()=>{let{scrollTopMax:i,scrollLeftMax:a}=e,l=i>0,s=a>0;r(c=>c.vertical===l&&c.horizontal===s?c:{vertical:l,horizontal:s})}),[e]),(0,mr.useLayoutEffect)(()=>{let i=t(),{onScrollbarsChange:a}=n(),{notifyScrollbarsChange:l}=i;a&&i.updatedAt&&i.dataArray.length&&a(o),l(o)},[o]),o}function yy(n){let{state:e,actions:t,getState:o}=n,{columnOrder:r,columnCssEllipsis:i,columnHeaderCssEllipsis:a,columnMinWidth:l,columnMaxWidth:s,columnDefaultWidth:c,columnDefaultFlex:u,columnDefaultSortable:d,columnDefaultDraggable:p,pinnedStartMaxWidth:f,pinnedEndMaxWidth:m,columnVisibility:g,columnPinning:h,columnSizing:S,editable:y,columnDefaultEditable:C,columnDefaultFilterable:T,columnDefaultGroupable:I,columnTypes:b,rowHeight:R,rowDetailHeight:w,isRowDetailExpanded:v,isRowDetailEnabled:P,bodySize:D,showSeparatePivotColumnForSingleAggregation:M,onRowHeightCSSVarChange:x,onFlashingDurationCSSVarChange:E,onRowDetailHeightCSSVarChange:z,onColumnHeaderHeightCSSVarChange:V,computedColumns:N,initialColumns:L,viewportReservedWidth:F,resizableColumns:B,sortable:X,draggableColumns:_}=e,k=t,{multiSort:K,filterValue:Q,filterTypes:Ie,groupBy:se,sortInfo:me,dataSourceActions:ve,getDataSourceState:Pe,dataSourceApi:ue}=Ne(ae=>({dataSourceActions:ae.dataSourceActions,getDataSourceState:ae.getDataSourceState,dataSourceApi:ae.dataSourceApi,sortInfo:ae.dataSourceState.sortInfo,multiSort:ae.dataSourceState.multiSort,filterValue:ae.dataSourceState.filterValue,filterTypes:ae.dataSourceState.filterTypes,groupBy:ae.dataSourceState.groupBy}));(0,Qn.useState)(()=>{x.onChange(ae=>{let Ee=Vh(ae,o());Ee!=null&&(k.rowHeight=Ee)}),E.onChange(ae=>{let Ee=ae?ae*1:null;Ee!=null&&!isNaN(Ee)&&(k.flashingDurationCSSVarValue=Ee)}),z.onChange(ae=>{ae&&(k.rowDetailHeight=ae)}),V.onChange(ae=>{let Ee=Gh(ae,o());Ee!=null&&(k.columnHeaderHeight=Ee)})}),(0,Qn.useEffect)(()=>{ve.showSeparatePivotColumnForSingleAggregation=M},[M]);let{toggleGroupRow:oe}=uy(e,t),ce=N,{computedColumnOrder:pe,computedVisibleColumns:Z,computedVisibleColumnsMap:J,computedPinnedStartColumns:W,computedPinnedEndColumns:ie,computedUnpinnedColumns:ne,computedPinnedStartColumnsWidth:le,computedPinnedEndColumnsWidth:O,computedUnpinnedColumnsWidth:A,computedUnpinnedOffset:de,computedPinnedEndOffset:ye,computedRemainingSpace:we,computedPinnedStartWidth:be,computedPinnedEndWidth:Me,renderSelectionCheckBox:qe,computedColumnsMap:We,computedColumnsMapInInitialOrder:it,fieldsToColumn:at}=py({columns:ce,userColumns:L,scrollbarWidth:void 0,columnCssEllipsis:i,columnHeaderCssEllipsis:a,columnMinWidth:l,columnMaxWidth:s,columnDefaultWidth:c,columnDefaultFlex:u,columnDefaultSortable:d,columnDefaultDraggable:p,pinnedStartMaxWidth:f,pinnedEndMaxWidth:m,bodySize:D,viewportReservedWidth:F,resizableColumns:B,sortable:X,draggableColumns:_,sortInfo:me??void 0,multiSort:K,groupBy:se,columnOrder:r,columnVisibility:g,columnVisibilityAssumeVisible:!0,columnPinning:h,editable:y,columnDefaultEditable:C,columnDefaultFilterable:T,columnDefaultGroupable:I,filterValue:Q,filterTypes:Ie,columnSizing:S,columnTypes:b}),et=Nh(Z),Xe=kh(Z),G=hy(o),ee=be?le>be:!1,ge=Me?O>Me:!1,[Te]=(0,Qn.useState)(()=>new Xa({getRowAt:Ee=>Pe().dataArray[Ee],isNodeSelectable:Ee=>{let{isNodeSelectable:Ze}=Pe();return Ze?Ze(Ee):!0}})),ut=Le(Z),[re]=(0,Qn.useState)(()=>new qa({getPrimaryKeyByIndex:ue.getPrimaryKeyByIndex,getColumnIdByIndex:ae=>ut()[ae]?.id||""})),{computedRowHeight:j,computedRowSizeCacheForDetails:tt}=gy({rowDetailHeight:w,rowHeight:R,isRowDetailsExpanded:v,isRowDetailsEnabled:P,getDataSourceState:Pe});return(0,Qn.useMemo)(()=>({multiRowSelector:Te,multiCellSelector:re,computedRowSizeCacheForDetails:tt,computedRowHeight:j,scrollbars:G,columnSize:Xe,rowspan:et,toggleGroupRow:oe,computedColumnsMap:We,computedColumnsMapInInitialOrder:it,renderSelectionCheckBox:qe,computedPinnedStartOverflow:ee,computedPinnedEndOverflow:ge,computedPinnedStartWidth:be,computedPinnedEndWidth:Me,computedVisibleColumns:Z,computedColumnOrder:pe,computedRemainingSpace:we,computedVisibleColumnsMap:J,computedPinnedStartColumns:W,computedPinnedEndColumns:ie,computedUnpinnedColumns:ne,computedPinnedStartColumnsWidth:le,computedPinnedEndColumnsWidth:O,computedUnpinnedColumnsWidth:A,computedUnpinnedOffset:de,computedPinnedEndOffset:ye,fieldsToColumn:at}),[Te,re,tt,j,G,Xe,et,oe,We,it,qe,ee,ge,be,Me,Z,pe,we,J,W,ie,ne,le,O,A,de,ye,at])}var Cy=require("react");function Aw(n=3988292384){var e=new Array,t,o,r;for(t=0;t<256;t++){for(r=t,o=8;o>0;o--)(r&1)==1?r=r>>>1^n:r=r>>>1;e[t]=r}return e}function _w(){return 4294967295}function Ow(n,e,t){return e=e>>>8^n[t^e&255],e}function Fw(n){return n=~n,n=n<0?4294967295+n+1:n,n}function Qc(n,e=3988292384){var t=Aw(e),o=0,r;for(o=_w(),r=0;r<n.length;r++)o=Ow(t,o,n.charCodeAt(r));return o=Fw(o),`${o}`}var Nw=n=>{let e=n.reduce((o,r)=>(o.set(r.name,r.value),o),new Map);return{distribution:e.get("Type")==="distribution",count:e.get("DevCount")?Number(e.get("DevCount")):0,start:new Date(e.get("StartDate")),end:new Date(e.get("EndDate")),owner:e.get("Owner"),type:e.get("Type"),timestamp:e.get("TS")?Number(e.get("TS")):0,trial:e.get("Trial")==="true",ref:e.get("Ref")??""}},Sy=(n,e=console.error.bind(console))=>{n=["* * * infinite-table.com * * *",...n];let t=Math.max(Math.max(...n.map(o=>o.length))+8,60);n.forEach(o=>{let r=(t-o.length)/2-1,i=0;r!==Math.round(r)&&(i=-1,r=Math.round(r));let a=r+i,l=r;e("*".repeat(a)+" "+o+" "+"*".repeat(l))}),e("*".repeat(t))},by=(n="",e,t)=>{let o;try{o=Lw(n)}catch{return Sy(["You don't have a valid Infinite Table license","Please visit infinite-table.com to purchase a license.","Thank you for playing fair!"],t),"invalid"}let r=new Date(e.publishedAt),i=new Date(o.end);return i<r?(Sy([`
28
28
  Your Infinite Table license has expired on ${i.toDateString()}.
29
- `,`You are using version "${e.version}" of Infinite Table, which was published on ${r.toDateString()}.`,"Please visit infinite-table.com to renew your license.","Thank you for playing fair!"],t),"expired"):"valid"};var ew=o=>{let e="",t=o.split("|").map(l=>{let s=l.indexOf("="),c=s===-1?l:l.slice(0,s),u=s===-1?"":l.slice(s+1);return c==="C"&&(e=u),{name:c,value:u}});if(!e)throw"Invalid license";let n=e.split(",").reverse(),r=n.pop();n.forEach((l,s)=>{let c=t[s];if(Xc(c.value)!==l)throw"Invalid license"});let i=[...t];i.pop();let a=i.map(l=>`${l.name}=${l.value}`).join("|");if(Xc(a)!==r)throw"Invalid license";return t=t.map(l=>({...l,value:decodeURI(l.value)})),JI(t)};function yy(o="",e){if(e.isDetail)return"valid";let t=hy(o,{publishedAt:1794927345478,version:"10.2.0"});return t==="invalid"&&!o?"missing":t}var by=(o="")=>{let t=!!Mo();return(0,Sy.useMemo)(()=>yy(o,{isDetail:t}),[o,t])};var hr=require("react");var tw=10;function Ty(o,e,t){let n=(0,hr.useRef)(!1),r=(0,hr.useRef)(null);(0,hr.useEffect)(()=>{o!=null&&(n.current=!1,Kt(r.current))},[o]),(0,hr.useEffect)(()=>{if(o!=null&&!n.current){let a=function(l=0){l++,Kt(r.current),r.current=He(()=>{n.current=t.scrollCellIntoView(o[0],o[1],{offset:30}),!n.current&&l<tw&&a(l)})};var i=a;a()}return()=>{Kt(r.current)}},[o,e])}var yr=require("react"),ow=10;function Cy(o,e,t){let n=(0,yr.useRef)(!1),r=(0,yr.useRef)(null);(0,yr.useEffect)(()=>{o!=null&&(n.current=!1,cancelAnimationFrame(r.current))},[o]),(0,yr.useEffect)(()=>{if(o!=null&&!n.current){let a=function(l=0){l++,r.current=requestAnimationFrame(()=>{n.current=t.scrollRowIntoView(o,{offset:0}),!n.current&&l<ow&&a(l)})};var i=a;a()}return()=>{cancelAnimationFrame(r.current)}},[o,e])}function Ry(){return Eo()}var Sr=require("react");function Iy(o,e){o.getComputed().multiRowSelector.lastPointerDown={rowIndex:o.rowIndex,shiftKey:!!e.shiftKey},e.detail!==2&&void 0}var nw={Enter:!0," ":!0,a:!0};function wy(o,e){let{getState:t,getDataSourceState:n,dataSourceActions:r,cloneRowSelection:i,cloneTreeSelection:a}=o,{key:l,ctrlKey:s,metaKey:c}=e;if(!nw[l])return!1;let u=t(),d=n(),{activeRowIndex:p,activeCellIndex:f,keyboardNavigation:m,keyboardSelection:g}=u,{selectionMode:h,rowSelection:S,treeSelectionState:y,isTree:T}=d;if(g===!1)return!1;let b=m==="row"&&p!=null?p:m==="cell"&&f!=null?f[0]:null;if(!(b!=null?d.dataArray[b]:null)||b==null)return!1;if(l===" "&&(h==="single-row"||h==="multi-row")){let C={key:e.key,metaKey:e.metaKey,ctrlKey:e.ctrlKey,shiftKey:e.shiftKey,preventDefault:()=>e.preventDefault()};return ma({...o,rowIndex:b},C,"keyboard")}if(h!=="multi-row")return!1;if(l==="a"&&(s||c)){if(T&&y){let I=a(y);return I.selectAll(),r.treeSelection=I,!0}let C=i(S);return C.selectAll(),r.rowSelection=C,!0}return!1}var vy=["input","textarea","select","[tabindex]","a[href]","button","object"].join(", "),Py=o=>Array.from(o.querySelectorAll(vy)).filter(t=>!!t.offsetParent),hl=o=>o.querySelector(vy);var xy=H(an());async function Dy(o,e=10,t=300){return new Promise((n,r)=>{let i=Date.now();function a(){if(Date.now()-i>t)return r(!1);if(!o()){setTimeout(a,e);return}n(!0)}a()})}var rw=10,iw=(o,e)=>o-e;function yl(o,e){let{getComputed:t,getDataSourceState:n,getState:r,api:i,dataSourceApi:a}=e,{editingCell:l,isRowDetailEnabled:s}=r(),{dataArray:c}=n(),{computedVisibleColumns:u,computedColumnsMap:d}=t(),p=u[o.colIndex];if(!p)return!1;if(l&&l.columnId===p.id&&l.rowIndex===o.rowIndex)return!0;if(!p.contentFocusable)return!1;if(p.contentFocusable===!0)return!0;let f=c[o.rowIndex],m=!s||typeof s=="function"&&!s(f)?!1:i.rowDetailApi.isRowDetailExpanded(f.id)?"expanded":"collapsed",g=bt(p.id,e);return p.contentFocusable({column:p,...nr({column:p,rowInfo:f,columnsMap:d,context:e,rowDetailState:m}).formattedValueContext,columnApi:g,api:i,dataSourceApi:a})}function Zc(o,e,t){let n=t.getState().editingCell;return aw(o,e,t,{isCellFocusable:yl,isColumnElligible:i=>n&&n.columnId===i.id?!0:!!i.contentFocusable})}function Ey(o,e,t){let n=(0,xy.default)(t,o+e,iw);return n<0&&(n=~n,e>0&&n>=t.length||e<0&&n===0)?null:t[n]??null}globalThis.getNextCol=Ey;function aw(o,e,t,n){let{isColumnElligible:r,isCellFocusable:i}=n,a=t.getComputed().computedVisibleColumns.filter(r).reduce((d,p)=>(d.push(p.computedVisibleIndex),d),[]);if(!a.length)return null;let{getDataSourceState:l}=t,{dataArray:s}=l(),c=o.rowIndex,u=o.colIndex;for(;c!=null||u!=null;){if(u=u===null?a[e===-1?a.length-1:0]:Ey(u,e,a),u===null){if(c+=e,c<0||c>=s.length)return null;continue}if(i({colIndex:u,rowIndex:c},t))return{colIndex:u,rowIndex:c}}return null}async function My(o){let e={rowIndex:o.getDataSourceState().dataArray.length-1,colIndex:o.getComputed().computedVisibleColumns.length-1},t=yl(e,o)?e:Zc(e,-1,o);if(t){await Qc([t.rowIndex,t.colIndex],o);let n=o.getState().getDOMNodeForCell(t);if(!n)return;hl(n)?.focus()}}async function Qc([o,e],t){let{api:n}=t;return new Promise((r,i)=>{let a=rw,l=null,s=!1;function c(u=0){u++,Kt(l),l=He(async()=>{if(s=n.scrollCellIntoView(o,e,{offset:30}),!s&&u<a&&c(u),s){try{await Dy(()=>!!t.getState().getDOMNodeForCell({rowIndex:o,colIndex:e}))}catch(d){i(d);return}r(!0)}})}c()})}var lw=`.${oo}`;function Ay(o,e){if(e.key!=="Tab")return!1;let t=e.shiftKey?-1:1,n=e.target,r=o.getState().scrollerDOMRef.current,i=document.activeElement===r||n===r;if(!r||i&&t===-1)return!1;let a=i?null:Lo(n,lw),l=null,s=null;if(a)l=Number(a.getAttribute("data-row-index")),s=Number(a.getAttribute("data-col-index"));else if(i){let{activeCellIndex:u}=o.getState();[l,s]=u||[0,0]}if(l==null||s==null||isNaN(l)||isNaN(s))return!1;let c=i&&yl({colIndex:s,rowIndex:l},o)?{rowIndex:l,colIndex:s}:Zc({rowIndex:l,colIndex:s},t,o);if(!c){if(t===-1)r.focus();else{let u=Py(document.body),d=o.getState().focusDetectDOMRef.current,p=u.findIndex(m=>m===d);u[p+1]?.focus()}return!0}return Qc([c.rowIndex,c.colIndex],o).then(()=>{let u=o.getState().getDOMNodeForCell(c);if(!u)return;hl(u)?.focus()}),!0}var _y={control:"ctrl"},Oy={"control|cmd":"ctrl","cmd|control":"ctrl","ctrl|cmd":"ctrl","cmd|ctrl":"ctrl"},sw={esc:"escape"},Ny={cmd:o=>o.metaKey,alt:o=>o.altKey,ctrl:o=>o.ctrlKey,shift:o=>o.shiftKey},Ly=Object.keys(Ny),Jc=new Set(Ly),cw=new Set(["shift","alt"]);function Sl(o,e){return Array.isArray(e)?e.some(t=>Fy(o,t)):Fy(o,e)}function Fy(o,e){let t=o.key.toLowerCase(),n=e.split("+").map(p=>p.toLowerCase().trim()),r=n.find(p=>Oy[p]),i=n.map(p=>_y[p]||Oy[p]||sw[p]||p),a=i.filter(p=>Jc.has(p)),l=i.filter(p=>!Jc.has(p)),s=Ly.reduce((p,f)=>(p[f]=Ny[f](o),p),{});r&&s.cmd&&(s.cmd=!1,s.ctrl=!0);let c=Object.keys(s).filter(p=>s[p]);if(!a.every(p=>s[p]===!0))return!1;if(l.includes("*")){if(c.length<a.length||c.filter(f=>!cw.has(f)).length)return!1}else if(a.length!=c.length)return!1;return!l.length||Jc.has(t)||t==="meta"||_y[t]?!1:l.reduce((p,f)=>p?f==="*"||t===f:!1,!0)}async function ky(o,e){let t={...o,cloneRowSelection:a=>or(a,o.getDataSourceState),cloneTreeSelection:a=>tr(a,o.getDataSourceState)},{onKeyDown:n}=o.getState(),r={preventEdit:!1,preventEditStop:!1,preventDefaultForTabKeyWhenEditing:!0,preventSelection:!1,preventNavigation:!1};if(n){let a=n(o,e);a&&typeof a=="object"&&(r={...r,...a})}if(!r.preventSelection&&wy(t,e)&&e.preventDefault(),(Ay(t,e)||!o.getState().focusedWithin&&!r.preventNavigation&&Lg(t,e))&&e.preventDefault(),!r.preventEdit&&e.key==="Enter"&&!o.api.isEditInProgress()){let{activeCellIndex:a}=o.getState();if(a){let[l,s]=a,c=o.getComputed().computedVisibleColumns[s];c.computedEditable&&o.api.startEdit({rowIndex:l,columnId:c.id})}}o.api.isEditInProgress()&&(e.key==="Escape"&&!r.preventEditStop&&o.api.stopEdit({cancel:!0}),e.key==="Tab"&&r.preventDefaultForTabKeyWhenEditing&&e.preventDefault());let{keyboardShortcuts:i}=o.getState();if(i)for await(let a of i){if(!Sl(e,a.key)||a.when&&!await a.when(o))continue;let l=await a.handler(o,e);if(l&&l.stopNext)break}}function uw(){let{getState:o,actions:e,api:t,getComputed:n,getDataSourceMasterContext:r}=Ke(),{getDataSourceState:i,dataSourceActions:a,dataSourceApi:l}=no();return(0,Sr.useMemo)(()=>({getComputed:n,getDataSourceMasterContext:r,dataSourceApi:l,api:t,getState:o,actions:e,getDataSourceState:i,dataSourceActions:a,cloneTreeSelection:u=>tr(u,i),cloneRowSelection:u=>or(u,i)}),[o,e,i,a,t,l,n])}function dw(){let o=uw();(0,Sr.useEffect)(()=>{let e=o.getState().keyDown.onChange(a=>{ky(o,a)});function t(a){if(!a)return;let l=a.event,s=o.getComputed().computedVisibleColumns[a.colIndex],c=bt(s.id,o);Sf({...o,rowIndex:a.rowIndex,colIndex:a.colIndex,column:s,columnApi:c},{...l,key:""})}let n=o.getState().cellClick.onChange(t);function r(a){if(!a)return;let{event:l,rowIndex:s,colIndex:c}=a,u=o.getComputed().computedVisibleColumns[c],d=bt(u.id,o);Iy({...o,rowIndex:s,colIndex:c,column:u,columnApi:d},l)}let i=o.getState().cellMouseDown.onChange(r);return()=>{e(),n(),i()}},[])}function pw(){let{getState:o}=oe(t=>({getState:t.getState}));return{onKeyDown:(0,Sr.useCallback)(t=>{o().keyDown(t)},[])}}function zy(){return dw(),pw()}var iu=require("react");var Be=H(require("react")),_t=require("react"),Wy=require("react-dom");var bl="__is_infinite_menu_component";function eu(o){return!!o.tagName}function Hy(o){let{alignTarget:e,alignAnchor:t,constrainTo:n,alignPosition:r}=o,i=De.from(eu(e)?e.getBoundingClientRect():e),a=De.from(eu(t)?t.getBoundingClientRect():t),l=n?De.from(eu(n)?n.getBoundingClientRect():n):null;if(!l)return{...Vy({anchorRect:a,targetRect:i,position:r[0]}),index:0};let s=null;for(let c=0,u=r.length;c<u;c++){let d=Vy({anchorRect:a,targetRect:i,position:r[c],constrainRect:l});if(c===0&&(s={...d,index:0}),d.valid)return{...d,index:c}}return s}function Vy(o){let e=De.from(o.targetRect),t=De.from(o.anchorRect),n=o.constrainRect?De.from(o.constrainRect):null,{position:r}=o,[i,a]=r,l=Gy(e,i),s=Gy(t,a),c=l.getDistanceToPoint(s);e.shift(c);let u=n?n.contains(e):!0;return{alignPosition:r,alignedRect:e,valid:u,distance:c}}function Gy(o,e){return e==="TopLeft"?je.from({top:o.top,left:o.left}):e==="TopCenter"?je.from({top:o.top,left:o.left+(o.width>0?Math.round(o.width/2):0)}):e==="TopRight"?je.from({top:o.top,left:o.left+o.width}):e==="BottomLeft"?je.from({left:o.left,top:o.top+o.height}):e==="BottomCenter"?je.from({left:o.left+(o.width>0?Math.round(o.width/2):0),top:o.top+o.height}):e==="BottomRight"?je.from({left:o.left+o.width,top:o.top+o.height}):e==="CenterLeft"?je.from({left:o.left,top:o.top+(o.height>0?Math.round(o.height/2):0)}):e==="CenterRight"?je.from({left:o.left+o.width,top:o.top+(o.height>0?Math.round(o.height/2):0)}):je.from({left:o.left+(o.width>0?Math.round(o.width/2):0),top:o.top+(o.height>0?Math.round(o.height/2):0)})}function fw(o){return o&&typeof o.then=="function"||o instanceof Promise}function Tl(o){return o==null||typeof o=="string"?!1:typeof o.tagName=="string"}async function Ky(o){return typeof o=="function"&&(o=o()),fw(o)&&(o=await o),typeof o=="string"&&(o=document.querySelector(o)),o&&Tl(o)&&(o=o.getBoundingClientRect()),o?De.from(o):null}async function By(o){let e=null;typeof o=="function"?e=o():e=o;function t(n){let r=null;return typeof n=="string"&&(r=document.querySelector(n)),Tl(n)&&(r=n),r||null}return t(await e)}async function Cl(o,e){let{constrainTo:t,alignTo:n,alignPosition:r}=e;Object.keys(n).length===2&&n.top!==void 0&&n.left!==void 0&&(n={...n,width:0,height:0}),typeof t=="boolean"&&(t=t?document.documentElement.getBoundingClientRect():void 0);let i=t&&await Ky(t)||void 0,a=n?await Ky(n):void 0,l=De.from(o.getBoundingClientRect());if(!a)return;let{alignedRect:s}=Hy({constrainTo:i,alignAnchor:a,alignTarget:l,alignPosition:r});o.style.transform=`translate3d(${s.left}px,${s.top}px, 0px)`;let c=o.getBoundingClientRect();if(c.left!==s.left||c.top!==s.top){let u=o.offsetParent;if(u){let d=u.getBoundingClientRect(),p=d.left,f=d.top,m=s.left-p,g=s.top-f;o.style.transform=`translate3d(${m}px,${g}px, 0px)`}}}function mw(o){return Be.createElement("div",{style:{position:"fixed",top:0,left:0}},o.children)}function gw(o){let e=Be.useRef(null);return(0,_t.useEffect)(()=>o.realign.onChange(t=>{e.current&&t&&Cl(e.current,t)}),[o.realign]),Be.createElement("div",{style:{position:"absolute",top:0,left:0},ref:(0,_t.useCallback)(t=>{t&&Cl(t,o),e.current=t},[])},typeof o.children=="function"?o.children():o.children)}function jy(o,e){let[t,n]=(0,_t.useState)(null);(0,_t.useLayoutEffect)(()=>{async function a(){let l=e?await By(e):null;l!=null&&n(l)}e&&a()},[e]);let r=typeof e=="function"?e():null,i=Tl(r)?r:t;return e?i?(0,Wy.createPortal)(o,i):Be.createElement(Be.Fragment,null):e===null||e===!1?o:Be.createElement(mw,null,o)}function hw(o){if(Be.Children.count(o)===1){let e=Be.Children.only(o);if(Be.isValidElement(e))return e.props.id||e.key}return null}function yw(o,e,t){if(Be.Children.count(o)===1){let n=Be.Children.only(o);if(Be.isValidElement(n)&&n.type[bl]){let r={};return n.props.portalContainer===void 0&&(r.portalContainer=e),n.props.constrainTo===void 0&&(r.constrainTo=t),Be.cloneElement(n,r)}}return o}function lo(o){let e=o,[t]=(0,_t.useState)(()=>new Map),[n,r]=(0,_t.useState)(null),[i,a]=(0,_t.useState)(0),l=(0,_t.useCallback)(()=>{let m=[];for(let[g,h]of t)m.push(Be.createElement(gw,{...h,key:h.key}));return m},[]),[s,c]=qt(),u=jy(l(),o.portalContainer),d=(0,_t.useCallback)((m,g)=>{let S=`${g.id||hw(m)||Vt()}`,y=t.get(S),T=C=>()=>{let I=typeof C=="function"?C():C;return yw(I,e.portalContainer,g.constrainTo??e.constrainTo)},b=T(m),R=(C,I)=>{if(!y)return;let w=T(C);Object.assign(y,{children:w}),c(),!!!I?.skipRealign&&(r(y.key),a(Date.now()))};return y?(Object.assign(y,g),R(m),R):(y={key:S,children:b,alignPosition:g.alignPosition,alignTo:g.alignTo,constrainTo:g.constrainTo,realign:Ce()},t.set(y.key,y),c(),R)},[t,e.portalContainer,c]);Be.useEffect(()=>{if(n){let m=t.get(n);m&&m.realign(m)}},[n,i]);let p=m=>{m=`${m}`,t.has(m)&&(t.delete(m),c())},f=()=>{t.clear(),c()};return Be.useEffect(()=>{},[]),{portal:u,hideOverlay:p,clearAll:f,rerenderOverlays:c,showOverlay:d}}var mS=H(require("react"));var Cr=H(require("react"));var rS=H(require("react"));var oS=H(require("react"));function Rl(o){return null}Rl.defaultProps={__is_menu_item:!0};var Uy="submenu",Sw="-";function $y(){return{keyboardActiveItemKey:null,activeItemKey:null,generatedId:Vt(),focused:!1,destroyed:!1,domRef:{current:null}}}function Yy(){return{parentMenuId:1,parentMenuItemKey:1,onHideIntent:1,constrainTo:1,onAction:1,onShow:1,onHide:1,autoFocus:1,wrapLabels:1}}var tu=({columns:o,keyboardActiveItemKey:e,activeItemKey:t,menuId:n},r,i)=>{let a=r&&(r.key!=null||r.label!=null)?r:null,l=a===null?r===Sw?i.renderSeparator():r:null;return a!=null?{type:"item",parentMenuId:n,disabled:!!a.disabled,keyboardActive:a.key===e,active:a.key===t,value:a,span:a.span||1,key:a.key,menu:a.menu||null,style:a.style,className:a.className,originalMenuItem:a}:{type:"decoration",value:l,span:o.length,style:{gridColumnStart:1,gridColumnEnd:o.length+10}}},bw=[{name:"label"}],qy=(o,e)=>{let{props:t,state:n}=o,{activeItemKey:r,keyboardActiveItemKey:i}=n,{items:a,children:l,addSubmenuColumnIfNeeded:s,parentMenuId:c}=t,u=t.id||n.generatedId;c&&(u=`${c}-${u}`);let d=[...t.columns||bw],p={columns:d,keyboardActiveItemKey:i??null,activeItemKey:r??null,menuId:u},f=[];a?f=a.map(g=>tu(p,g,e)):!a&&typeof l!="function"&&(f=e.childrenToRuntimeItems?e.childrenToRuntimeItems(p,l):[]),s&&f.filter(h=>h.type==="item"&&h.menu!=null).length>0&&!d.find(h=>h.name==Uy)&&d.push({name:Uy,render:e.renderSubmenuColumn});let m=f.filter(g=>g.type==="item"&&!g.disabled);return{runtimeItems:f,runtimeSelectableItems:m,columns:d,menuId:u}};var br=H(require("react"));var Xy="db3arf0 _16lm1iw0 _16lm1iw1 _16lm1iw1w _16lm1iw2f _16lm1iw8",Zy=Se({defaultClassName:"db3arf2 _16lm1iw1p _16lm1iw2j _16lm1iw1x",variantClassNames:{disabled:{true:"db3arf3 _16lm1iwl _16lm1iw1x",false:"_16lm1iwk"},active:{true:"db3arf5",false:"db3arf6"},pressed:{false:"db3arf7",true:"db3arf8"},keyboardActive:{true:"db3arf9",false:"db3arfa"}},defaultVariants:{},compoundVariants:[[{active:!0,disabled:!1},"db3arfb"],[{pressed:!0,active:!0,disabled:!1},"db3arfc"]]}),Qy="db3arf1",Jy="db3arfd";function eS(){return br.createElement("hr",{className:Jy})}var Il={renderSeparator:()=>br.createElement(eS,null),renderSubmenuColumn:({domProps:o,item:e})=>e.menu?br.createElement("div",{...o},br.createElement(pn,{expanded:!1})):br.createElement("div",{...o})};var tS=(o,e)=>tu(o,e,Il);function nS(o,e){return oS.Children.map(e,t=>{if(t&&(t.props.__is_menu_item||t.type===Rl)){let n={...t.props};return n.key||(n.key=t.key),n.description||(n.description=t.props.children),n.label||(n.label=n.children),tS(o,n)}return tS(o,t)})||[]}function iS(){return{...$y(),domRef:rS.createRef()}}var aS=()=>Yy(),lS=o=>qy(o,{...Il,childrenToRuntimeItems:nS});var $t=H(require("react")),ht=require("react");function sS(o,e){let t=cS(o,e);if(!t.length)return null;let n=De.from(t[0]?.getBoundingClientRect()),r=De.from(t[t.length-1].getBoundingClientRect()),i=n;return i.width=r.left+r.width-n.left,i}function cS(o,e){let t=Lo(document.querySelector(`[data-menu-id="${o}"] [data-menu-item-key="${e}"]`),`[data-menu-id="${o}"]`);if(!t)return[];let n=t.querySelectorAll(`[data-menu-item-key="${e}"]`);return Array.from(n)}function uS(o,e){let t=cS(o,e);if(!t.length)return null;for(let n of t){let r=n.querySelector('input[type="checkbox"]');if(r)return r}return null}var yi=class extends Xn{constructor(e){super(e.slice(0,3))}};var Tw=250;function Cw(o,e=100){let t=Date.now();return new Promise(n=>{let r,i=()=>{if(r=o(),r!==void 0){n(r);return}if(Date.now()-t>e){n(void 0);return}He(i)};He(()=>{i()})})}var Rw=Fe(),wl=class{constructor(e){this.activeItem=null;this.currentHoveredItem=null;this.activeItemLeavePoint=null;this.menuLeaveTimeoutId=null;this.activeItemMenuRect=null;this.lastPointerMoveTimestamp=0;this.mouseMoveTimeoutId=0;this.lastHorizontalDiff=0;this.getTimeout=()=>this.params.timeout||Tw;this.getPointerMoveTarget=()=>document.documentElement||Rw;this.removePointerMoveListener=()=>{this.getPointerMoveTarget().removeEventListener("pointermove",this.onPointerMoveWhileActiveItem)};this.onPointerMoveWhileActiveItem=e=>{if(clearTimeout(this.mouseMoveTimeoutId),!e){this.lastPointerMoveTimestamp=Date.now();return}if(!this.currentHoveredItem||this.currentHoveredItem===this.activeItem)return;let t=Date.now();this.lastPointerMoveTimestamp||(this.lastPointerMoveTimestamp=t);let r=t-this.lastPointerMoveTimestamp>this.getTimeout();this.lastPointerMoveTimestamp=t;let i=()=>{this.setActiveItem(null,null),this.onItemChange(!0,this.currentHoveredItem,e)};if(r){i();return}let a=this.currentHoveredItem;this.mouseMoveTimeoutId=setTimeout(()=>{if(a!==this.currentHoveredItem)return;Date.now()-this.lastPointerMoveTimestamp>this.getTimeout()&&i()},this.getTimeout());let l=new je({left:e.clientX,top:e.clientY});if(!this.activeItemMenuRect||!this.activeItemLeavePoint)return;let s=this.activeItemLeavePoint.left<this.activeItemMenuRect.left,u=(s?1:-1)*(l.left-this.activeItemLeavePoint.left);if(u-this.lastHorizontalDiff<0){this.lastHorizontalDiff=0,i();return}this.lastHorizontalDiff=u,(s?new yi([this.activeItemLeavePoint,this.activeItemMenuRect.getTopLeft(),this.activeItemMenuRect.getBottomLeft()]):new yi([this.activeItemLeavePoint,this.activeItemMenuRect.getTopRight(),this.activeItemMenuRect.getBottomRight()])).containsPoint(l)||(this.setActiveItem(null,null),this.onItemChange(!0,this.currentHoveredItem,e))};this.setupMenuLeaveTracking=()=>{this.menuLeaveTimeoutId=setTimeout(()=>{this.activeItem&&this.params.itemHasSubMenu(this.activeItem)||this.setActiveItem(null,null)},this.getTimeout())};this.setActiveItem=(e,t)=>{if(e!==this.activeItem){if(e==null){this.removePointerMoveListener(),this.params.onItemActivate(null,null),this.activeItem=null,this.activeItemMenuRect=null;return}this.activeItem=e,this.params.onItemActivate(e,t),this.activeItemMenuRect=null,Cw(()=>this.activeItem!=e?!1:this.params.getMenuRectFor(e)).then(n=>{this.activeItem==e&&n&&(this.activeItemMenuRect=n)})}};this.onItemChange=(e,t,n)=>{if(clearTimeout(this.menuLeaveTimeoutId),clearTimeout(this.mouseMoveTimeoutId),!e){this.removePointerMoveListener(),t===this.activeItem&&(this.activeItemLeavePoint=new je({left:n.clientX,top:n.clientY})),this.setupMenuLeaveTracking();return}if(this.currentHoveredItem=t,!this.activeItem||!this.params.itemHasSubMenu(this.activeItem)){this.setActiveItem(t,n.target);return}this.onPointerMoveWhileActiveItem(),this.getPointerMoveTarget().addEventListener("pointermove",this.onPointerMoveWhileActiveItem)};this.getHandlers=()=>({onItemEnter:(e,t)=>{this.onItemChange(!0,e,t)},onItemLeave:(e,t)=>{this.onItemChange(!1,e,t)}});this.params=e}};var vl=require("react"),ou=(0,vl.createContext)(null);function nu(){return(0,vl.useContext)(ou)}var Tr=require("react");function dS(){let o=(0,Tr.useRef)(!0);return(0,Tr.useEffect)(()=>(o.current=!0,()=>{o.current=!1}),[]),(0,Tr.useCallback)(()=>o.current,[])}function Iw(o,e){let{parentMenuId:t,setSubmenuApi:n,setActiveItemKey:r,setKeyboardActiveItemKey:i,constrainTo:a,onHideIntent:l,api:s}=e,c=`${t}-submenu`,u=o.menu;return u?(typeof u=="function"&&(u=u()),$t.createElement(Yt,{key:c,parentMenuItemKey:o.key,parentMenuId:t,constrainTo:a,...u,autoFocus:!1,onShow:(d,p)=>{u?.onShow?.(d,p),n(p)},onHideIntent:d=>{u?.onHideIntent?.(d),l(d)},onHide:d=>{d.focused&&(r(null),i(o.key),s.focus())}})):null}function ww({onItemActivate:o}){let{getState:e}=nu(),[{onItemEnter:t,onItemLeave:n}]=(0,ht.useState)(()=>new wl({parentMenuId:e().parentMenuId,onItemActivate:r=>{if(!r){o(null);return}let i=e().runtimeItems.filter(a=>a.type==="item"&&a.key===r)[0];o(i)},itemHasSubMenu:r=>!!e().runtimeItems.filter(a=>a.type==="item"&&a.key===r&&a.menu)[0],getMenuRectFor:r=>{let i=`[data-submenu-for="${r}"]`,a=document.querySelector(i);return a?De.from(a.getBoundingClientRect()):void 0}}).getHandlers());return{onItemEnter:(0,ht.useCallback)(t,[]),onItemLeave:(0,ht.useCallback)(n,[])}}function pS(o){let{domProps:e}=o,{componentState:{columns:t,runtimeItems:n,menuId:r,activeItemKey:i,keyboardActiveItemKey:a,constrainTo:l,destroyed:s,onAction:c,wrapLabels:u,onShow:d,onHide:p,autoFocus:f,parentMenuItemKey:m,domRef:g},componentActions:h,getState:S}=nu(),y=(0,ht.useCallback)(N=>{h.keyboardActiveItemKey=N},[]),T=(0,ht.useCallback)(N=>{h.activeItemKey=N},[]),b=dS(),[R,C]=(0,ht.useState)(null),I=null;(0,ht.useLayoutEffect)(()=>{let{runtimeItems:N}=S(),K=N.filter(ae=>ae.type==="item"&&i===ae.key)[0];if(!K||!K.menu){C(null),E();return}if(K){let ae=sS(r,K.key);ae&&v(()=>Iw(K,{constrainTo:l,setSubmenuApi:C,setActiveItemKey:T,setKeyboardActiveItemKey:y,parentMenuId:r,onHideIntent:B,api:Y}),{id:`${r}-submenu`,alignTo:ae,alignPosition:[["TopLeft","TopRight"],["TopRight","TopLeft"]],constrainTo:l});return}},[i]);let w=(N,K)=>{y(K.key),T(K.key),K.originalMenuItem.onClick&&K.originalMenuItem.onClick(N);let ae={key:K.key,item:K.originalMenuItem,hideMenu:B};K.originalMenuItem.onAction&&K.originalMenuItem.onAction(ae),c&&c(ae),K.originalMenuItem.hideMenuOnAction&&B()},{showOverlay:v,portal:P,clearAll:E}=lo({portalContainer:!1}),{onItemEnter:M,onItemLeave:D}=ww({onItemActivate:N=>{if(!b())return;let K=N?N.key:null;T(K)}});I=n.map((N,K)=>$t.createElement(vw,{key:N.type==="item"?N.key:K,onItemEnter:(ae,re)=>{M(ae.key,re)},onItemLeave:(ae,re)=>{D(ae.key,re)},columns:t,active:N.type==="item"&&N.key===i,keyboardActive:N.type==="item"&&N.key===a,item:N,index:K,onClick:w}));let x=t.map(N=>N.width||(typeof N.flex=="number"?`${N.flex}fr`:N.flex)||"auto").join(" "),A={...e.style,gridTemplateColumns:x,gridTemplateRows:n.map(()=>"auto").join(" ")};u||(A.whiteSpace="nowrap");function O(N){let{runtimeItems:K,runtimeSelectableItems:ae}=S(),re=K.findIndex(U=>U.type==="item"&&U.key===a),ue=a,fe=K[re],be={ArrowUp:()=>{let U=K.slice(0,re).filter(ie=>ie.type==="item"&&!ie.disabled).pop();U&&U.type==="item"&&U.key&&(ue=U.key)},ArrowDown:()=>{let U=K.slice(re+1).filter(ie=>ie.type==="item"&&!ie.disabled)[0];U&&U.type==="item"&&U.key&&(ue=U.key)},Home:()=>{be.PageUp()},End:()=>{be.PageDown()},PageUp:()=>{ue=ae[0].key},PageDown:()=>{ue=ae[ae.length-1].key},ArrowLeft:()=>{T(null),S().parentMenuId&&(h.destroyed=!0)},ArrowRight:()=>{fe&&(T(fe.key),He(()=>{b()&&R&&R.getParentMenuId()===S().menuId&&R.focus()}))},Enter:()=>{if(fe)if(fe.originalMenuItem?.menu){if(fe&&fe.originalMenuItem.menu&&R){be.ArrowLeft();return}fe&&T(fe.key)}else w(N,fe)}," ":()=>{if(!fe)return;fe.originalMenuItem.menu||w(N,fe);let U=uS(r,fe.key);U&&U.click()},Escape:()=>{be.ArrowLeft();let U=S();U.parentMenuId||U.onHideIntent?.(U)}},de=be[N.key];de&&(de(),N.preventDefault()),ue!=a&&y(ue)}function F(){h.focused=!1}let z=(0,ht.useCallback)(function(){h.focused=!0,setTimeout(()=>{L.current&&g.current&&g.current===document.activeElement&&S().keyboardActiveItemKey==null&&y(S().runtimeSelectableItems[0]?.key??null)})},[]),L=(0,ht.useRef)(!0),B=(0,ht.useCallback)(()=>{let N=S();N.onHideIntent?.(N)},[S]),[Y]=(0,ht.useState)(()=>({hideMenu:B,focus:()=>{g.current&&(g.current.focus(),setTimeout(()=>{g.current&&g.current!==document.activeElement&&g.current.focus()},10),z())},getMenuId:()=>S().menuId,getParentMenuId:()=>S().parentMenuId})),V=(0,ht.useCallback)(N=>{N?(g.current=N,d?.(S(),Y),f&&Y.focus()):(p?.(S()),g.current=N)},[]),W=$t.createElement("div",{className:Gn.contents},$t.createElement("div",{...e,"data-menu-id":r,"data-submenu-for":m,tabIndex:0,ref:V,onKeyDown:N=>{e.onKeyDown?.(N),O(N)},onMouseDown:N=>{L.current=!1,e.onMouseDown?.(N)},onMouseUp:N=>{L.current=!0,e.onMouseUp?.(N)},onFocus:z,onBlur:F,className:X(Xy,e.className,"InfiniteMenu"),style:A},I),P);return s?null:W}function vw(o){let[e,t]=$t.useState(!1),{columns:n,item:r,index:i,active:a,keyboardActive:l}=o,s=r.type==="item"?r.value.key:i,c=null;if(r.type==="decoration")c=$t.createElement("div",{style:r.style},r.value);else{let u=0;c=n.map((d,p)=>{let f=r.value,m=d.field||d.name,g=p+1,h=g+r.span;if(g<u)return null;u=h;let y={style:{...d.style,...r.style,gridColumnStart:g,gridColumnEnd:h},"data-menu-column-id":`${r.parentMenuId}-col-${d.name}`,"data-menu-col-name":`${d.name}`,"data-menu-row-id":`${r.parentMenuId}-row-${i}`,"data-menu-row-index":`${i}`,"data-menu-item-key":`${r.key}`,className:X(Zy({active:a,disabled:!!r.disabled,keyboardActive:l,pressed:e||o.active}),r.className),onPointerEnter:T=>{r.disabled||o.onItemEnter?.(r,T)},onPointerLeave:T=>{r.disabled||o.onItemLeave?.(r,T)},onMouseDown:()=>{r.disabled||t(!0)},onMouseUp:()=>{r.disabled||t(!1)},onClick:T=>{r.disabled||o.onClick(T,r)}};return d.render?$t.createElement(Yr,{key:`${s}-${m}`,render:d.render,renderParam:{item:f,column:d,value:f[m],domProps:y}}):$t.createElement("div",{key:`${s}-${m}`,...y},f[m])}).filter(Boolean)}return $t.createElement("div",{className:Qy},c)}var{ManagedComponentContextProvider:Pw}=kt({initSetupState:iS,forwardProps:aS,mapPropsToState:lS,layoutEffect:!0});function Dw(o){let{componentActions:e,componentState:t}=zt(),n=Le(t);return Cr.createElement(ou.Provider,{value:{componentActions:e,componentState:t,getState:n}},Cr.createElement(pS,{domProps:o.domProps}))}function Yt(o){let{children:e,portalContainer:t,items:n,parentMenuId:r,addSubmenuColumnIfNeeded:i=!0,bubbleActionsFromSubmenus:a=!0,onShow:l,onHide:s,wrapLabels:c=!1,onAction:u,constrainTo:d,columns:p,parentMenuItemKey:f,autoFocus:m,id:g,onHideIntent:h,__is_infinite_menu_component:S,...y}=o;return Cr.createElement(Pw,{addSubmenuColumnIfNeeded:i,bubbleActionsFromSubmenus:a,wrapLabels:c,...o},Cr.createElement(Dw,{domProps:y}))}Yt[bl]=!0;var ru=H(require("react"));function fS(o,e){let{columnApi:t,column:n,getComputed:r,api:i,dataSourceApi:a,getState:l}=e,s=l().components?.CheckBox||zo,u=t.isSortable()?[{key:"sort-asc",label:"Sort Ascending",disabled:n.computedSortedAsc,onAction:()=>{i.setSortingForColumn(n.id,1)}},{key:"sort-desc",label:"Sort Descending",disabled:n.computedSortedDesc,onAction:()=>{i.setSortingForColumn(n.id,-1)}},{key:"sort-none",label:"Unsort",disabled:!n.computedSorted,onAction:()=>{i.setSortingForColumn(n.id,null)}},"-"]:[];return[...n.groupByForColumn?[{key:"collapse-all",label:"Collapse All",onAction:()=>{i.collapseAllGroupRows()}},"-"]:[],...u,n.computedFilterable?{key:"clear-filter",label:"Clear Filter",disabled:!n.computedFiltered,onAction:()=>{i.clearColumnFilter(n.id)}}:null,n.computedFilterable?"-":null,{key:"pin-start",label:"Pin to start",disabled:n.computedPinned==="start",onAction:()=>{i.setPinningForColumn(n.id,"start")}},{key:"unpin",label:"Unpin",disabled:!n.computedPinned,onAction:()=>{i.setPinningForColumn(n.id,!1)}},"-",{key:"columns",label:"Columns",menu:()=>{let p=[];return r().computedColumnsMapInInitialOrder.forEach((m,g)=>{let h=rn(m,e,"column-menu");p.push({key:g,label:h,check:ru.createElement(s,{key:m.id,disabled:m.computedVisible&&i.getVisibleColumnsCount()===1,checked:m.computedVisible,onChange:S=>{let y=!!S;i.setVisibilityForColumn(m.id,y),requestAnimationFrame(()=>{i.realignColumnContextMenu()})}})})}),{columns:[{name:"check"},{name:"label"}],items:p}}},"-",{key:"group-by",label:"Group by",menu:()=>{let p=[];return r().computedColumnsMapInInitialOrder.forEach((m,g)=>{if(m.groupByForColumn)return;let h=rn(m,e,"column-menu");p.push({key:g,label:h,check:ru.createElement(s,{key:m.id,disabled:!m.computedGroupable,checked:m.computedGroupedBy,onChange:()=>{a.toggleGroupByField(m.field)}})})}),{columns:[{name:"check"},{name:"label"}],items:p}}}].filter(p=>!!p)}function gS(o,e,t){if(o==null)return null;let{getComputed:n,getState:r}=e,{components:i,getColumnMenuItems:a}=r(),l=i?.Menu??Yt,s=n().computedColumnsMap.get(o);if(!s)return null;let c={column:s,columnApi:bt(s.id,e),...e},u=fS([],c),d=a?a(u,c):u,p=m=>{m.__insideMenu=!0},f=m=>{m.domRef.current?.parentNode?.removeEventListener("mousedown",p)};return!d||!d.length?null:mS.createElement(l,{autoFocus:!0,items:d,onShow:m=>{m.domRef.current?.parentNode?.addEventListener("mousedown",p)},onHide:f,onHideIntent:m=>{f(m),t?.()}})}function hS(o){return typeof o=="function"?o():o}function Dn(o){return hS(o.menuConstrainTo)??o.domRef.current}function yS(o,e,t){return e?()=>hS(e)??(t||o().portalDOMRef.current):t||!1}var SS=require("react");function xn(){let{getState:o,menuPortalContainer:e}=oe(r=>({getState:r.getState,menuPortalContainer:r.state.menuPortalContainer})),{portalDOMRef:t}=Ai(r=>({portalDOMRef:r.getMasterState().portalDOMRef}))||{},n=t?.current;return(0,SS.useMemo)(()=>yS(o,e,n),[o,e,n])}var xw=`[${qr["data-name"]}="${Xr["data-name"]}"]`;function Ew(o){let{columnId:e,context:t,clearAll:n,showOverlay:r}=o,{getState:i,actions:a}=t,{columnMenuTargetRef:l,domRef:s}=i();function c(){n(),a.columnMenuVisibleForColumnId=null}let u=o.target;if(u||(u=l.current??void 0,u&&!s.current.contains(u)&&(u=void 0)),!u){let d=`[${mg["data-column-id"]}="${e}"] ${xw}`;u=i().domRef.current.querySelector(d)}if(!u){console.warn(`Cannot show column menu for column "${e}"`);return}l.current=null,r(()=>gS(e,t,c),{constrainTo:Dn(i()),id:"column-menu",alignTo:u,alignPosition:[["TopLeft","BottomLeft"],["TopRight","BottomRight"]]})}function bS(){let o=Ke(),{getState:e,actions:t,columnMenuVisibleForColumnId:n,columnMenuVisibleKey:r}=oe(s=>({getState:s.getState,actions:s.actions,columnMenuVisibleForColumnId:s.state.columnMenuVisibleForColumnId,columnMenuVisibleKey:s.state.columnMenuVisibleKey})),{showOverlay:i,portal:a,clearAll:l}=lo({portalContainer:xn()});return(0,iu.useEffect)(()=>{let s=e();return s.onColumnMenuClick.onChange(c=>{c&&(s.columnMenuTargetRef.current=c.target,t.contextMenuVisibleFor=null,t.cellContextMenuVisibleFor=null,t.filterOperatorMenuVisibleForColumnId=null,t.columnMenuVisibleForColumnId=c.column.id)})},[]),(0,iu.useEffect)(()=>{let{columnMenuVisibleForColumnId:s,columnMenuTargetRef:c}=e();if(s){let d=function(p){p.__insideMenu!==!0&&(l(),t.columnMenuVisibleForColumnId=null)};var u=d;return document.documentElement.addEventListener("mousedown",d),Ew({columnId:s,context:o,clearAll:l,showOverlay:i}),()=>{document.documentElement.removeEventListener("mousedown",d)}}else c.current=null,l();return()=>{}},[n,r]),{menuPortal:a}}var TS=H(require("react")),CS=require("react");var Mw={width:0,height:0,overflow:"hidden",pointerEvents:"none",outline:"none",zIndex:-1};function RS(){let{getState:o,api:e,actions:t,getComputed:n,dataSourceApi:r,dataSourceActions:i}=Ke(),{getDataSourceState:a,getDataSourceMasterContext:l}=no(),{focusDetectDOMRef:s}=o(),c=(0,CS.useCallback)(async()=>{My({getDataSourceState:a,getDataSourceMasterContext:l,getComputed:n,actions:t,dataSourceActions:i,api:e,getState:o,dataSourceApi:r})},[]);return TS.createElement("div",{onFocus:c,ref:s,tabIndex:0,style:Mw})}var Rr=require("react");function Aw(){let o=Ke(),{getState:e,editingCell:t}=oe(r=>({getState:r.getState,editingCell:r.state.editingCell})),n=t&&!t.active?t.cancelled:void 0;(0,Rr.useEffect)(()=>{if(n){let{onEditCancelled:r}=e(),i=e().editingCell;if(!r)return;let a=ci(o,i);if(!a){ui("onEditCancelled",i);return}r({...a,initialValue:i.initialValue})}},[n])}function _w(){let o=Ke(),{getState:e,editingCell:t}=oe(r=>({getState:r.getState,editingCell:r.state.editingCell})),n=t&&!t.active&&t.accepted instanceof Error?t.accepted:void 0;(0,Rr.useEffect)(()=>{if(n){let{onEditRejected:r}=e(),i=e().editingCell;if(!r)return;let a=ci(o,i);if(!a){ui("onEditRejected",i);return}r({...a,value:i.value,error:n,initialValue:i.initialValue})}},[n])}function Ow(){let o=Ke(),{editingCell:e}=oe(r=>({editingCell:r.state.editingCell})),t=e?.active,n=Oo(t);(0,Rr.useEffect)(()=>{!t&&n&&o.api.focus()},[t,n])}function Fw(){let o=Ke(),{editingCell:e,getState:t}=oe(r=>({editingCell:r.state.editingCell,getState:r.getState})),n=e&&!e.active&&!e.cancelled&&e.accepted===!0;(0,Rr.useEffect)(()=>{if(n){let{onEditAccepted:r}=t(),i=t().editingCell,{value:a,initialValue:l}=i;if(r){let s=ci(o,i);s?r({...s,value:a,initialValue:l}):ui("onEditAccepted",i)}o.api.persistEdit({value:a})}},[n])}function Nw(){let o=Ke(),{editingCell:e,getState:t}=oe(r=>({editingCell:r.state.editingCell,getState:r.getState})),n=e?e.persisted:void 0;(0,Rr.useEffect)(()=>{if(n){let{editingCell:r,onEditPersistError:i,onEditPersistSuccess:a}=t();if(!r)return;let l=n instanceof Error?"onEditPersistError":"onEditPersistSuccess";if(!t()[l])return;let s=ci(o,r);if(!s){ui(l,r);return}let c={...s,value:r.value,initialValue:r.initialValue};n instanceof Error?i?.({...c,error:n}):a?.(c)}},[n])}function IS(){Aw(),_w(),Fw(),Nw(),Ow()}var su=require("react");var Jo=H(require("react"));var au=H(require("react"));var Pl=o=>au.createElement(Ve,{...o,icon:"clear"},au.createElement("path",{d:Ge.clear[0]}));var lu=H(require("react"));var wS=o=>lu.createElement(Ve,{...o,icon:"done"},lu.createElement("path",{d:Ge.done[0]}));function vS(o,e,t){if(o==null)return null;let{getComputed:n,getState:r,getDataSourceState:i,actions:a,dataSourceApi:l,dataSourceActions:s,api:c}=e,{components:u,getFilterOperatorMenuItems:d}=r(),p=u?.Menu??Yt,f=n().computedColumnsMap.get(o);if(!f)return null;let m=I=>{I.__insideMenu=!0},g=I=>{I.domRef.current?.parentNode?.removeEventListener("mousedown",m)},{filterTypes:h}=i(),S=h[f.computedFilterType];if(!S)return null;let y=S.operators.map(I=>{let w=I.name,v=f.computedFilterValue?f.computedFilterValue.filter.operator===w:w===S.defaultOperator,P=I.components?.Icon??Bn;return{key:w,icon:Jo.createElement(P,null),label:Jo.createElement(Jo.Fragment,null,I.label??I.name),onAction:()=>{c.setColumnFilterOperator(o,w)},checked:v?Jo.createElement(wS,{size:16}):null}}),b=[...[{key:"close",label:"Close Menu",icon:null,onAction:()=>{c.hideFilterOperatorMenu()}},{key:"reset",label:"Reset",icon:Jo.createElement(Pl,null),disabled:!f.computedFiltered,onAction:()=>{c.clearColumnFilter(o)}},"-"],...y],R={column:f,api:c,getState:r,getDataSourceState:i,getComputed:n,actions:a,dataSourceApi:l,dataSourceActions:s,columnFilterValue:f.computedFilterValue,filterTypes:h},C=d?d(b,R):b;return Jo.createElement(p,{autoFocus:!0,columns:[{name:"icon"},{name:"label"},{name:"checked"}],items:C,onShow:I=>{I.domRef.current?.parentNode?.addEventListener("mousedown",m)},onHide:g,onHideIntent:I=>{g(I),t?.()}})}var Dl=10;function PS(){let o=Ke(),{getState:e,actions:t}=o,{showOverlay:n,portal:r,clearAll:i}=lo({portalContainer:xn()});return(0,su.useEffect)(()=>e().onFilterOperatorMenuClick.onChange(l=>{if(!l)return;let{target:s,column:c}=l;function u(){i(),t.filterOperatorMenuVisibleForColumnId=null}let d=s?.parentElement||s,p=De.from(d.getBoundingClientRect());p.top-=Dl,p.left-=Dl,p.width+=2*Dl,p.height+=2*Dl,n(()=>vS(c.id,o,u),{constrainTo:Dn(e()),id:"filter-operator-menu",alignTo:p,alignPosition:[["TopLeft","BottomLeft"],["TopRight","BottomRight"]]}),t.contextMenuVisibleFor=null,t.cellContextMenuVisibleFor=null,t.columnMenuVisibleForColumnId=null,t.filterOperatorMenuVisibleForColumnId=c.id}),[]),(0,su.useEffect)(()=>{let{filterOperatorMenuVisibleForColumnId:a}=e();if(a){let s=function(c){c.__insideMenu!==!0&&(i(),t.filterOperatorMenuVisibleForColumnId=null)};var l=s;return document.documentElement.addEventListener("mousedown",s),()=>{document.documentElement.removeEventListener("mousedown",s)}}else i();return()=>{}},[e().filterOperatorMenuVisibleForColumnId]),{menuPortal:r}}var bi=require("react");var du=H(require("react"));var cu=H(require("react"));function Si(o){let e=o?Array.isArray(o)?o:o.items:null,t=o&&!Array.isArray(o)?o.columns:void 0;return{items:e,columns:t}}function xl(o){let e=r=>{r.__insideMenu=!0},t=r=>{r.domRef.current?.parentNode?.removeEventListener("mousedown",e)};return{columns:[],items:[],autoFocus:!0,onShow:r=>{r.domRef.current?.parentNode?.addEventListener("mousedown",e)},onHide:t,onHideIntent:r=>{t(r),o.onHideIntent?.()}}}function uu(o,e,t){if(!o)return null;let n=Ce();return o.then(r=>{let{items:i,columns:a}=Si(r);i&&i.length&&n(cu.createElement(t,{...e,items:i||[],columns:a}))}),cu.createElement(jo,{updater:n})}function DS(o,e,t){let{columnId:n,rowIndex:r,event:i}=o,{getComputed:a,getState:l}=e,{components:s,getCellContextMenuItems:c}=l(),u=s?.Menu??Yt,{computedColumnsMap:d}=a(),p=d.get(n),f={...to({...e,rowIndex:r,columnId:p.id}),event:i};if(!p||!c)return{cellContext:f,menu:null,preventDefault:!1};let m=xl({onHideIntent:t}),g=c(f,e),h=g instanceof Promise||Array.isArray(g)?!0:!!(g&&Array.isArray(g.items));if(g instanceof Promise)return{cellContext:f,menu:uu(g,m,u),preventDefault:h};let{items:S,columns:y}=Si(g);return!S||!S.length?{cellContext:f,menu:null,preventDefault:Array.isArray(S)}:{preventDefault:h,menu:du.createElement(u,{...m,columns:y,items:S}),cellContext:f}}function xS(o,e,t){let{getState:n,getComputed:r}=e,{components:i,getContextMenuItems:a}=n(),l=i?.Menu??Yt,{computedColumnsMap:s}=r(),c=o.columnId?s.get(o.columnId):void 0,u=c?{...o,...to({...e,rowIndex:o.rowIndex,columnId:c.id})}:o;if(!a)return{cellContext:u,menu:null,preventDefault:!1};let d=xl({onHideIntent:t}),p=a(u,e),f=p instanceof Promise||Array.isArray(p)?!0:!!(p&&Array.isArray(p.items));if(p instanceof Promise)return{cellContext:u,menu:uu(p,d,l),preventDefault:f};let{items:m,columns:g}=Si(p);return!m||!m.length?{cellContext:u,menu:null,preventDefault:Array.isArray(m)}:{preventDefault:f,menu:du.createElement(l,{...d,columns:g,items:m}),cellContext:u}}var El=5,ES=[["TopLeft","BottomLeft"],["TopRight","BottomRight"],["BottomLeft","BottomLeft"],["BottomRight","BottomRight"],["TopCenter","TopLeft"],["BottomCenter","TopLeft"],["CenterLeft","TopLeft"],["CenterRight","TopLeft"]];function MS(){let o=Ke(),{getState:e,actions:t}=o,{showOverlay:n,portal:r,clearAll:i}=lo({portalContainer:xn()});return(0,bi.useEffect)(()=>{let{actions:a,getState:l,getDataSourceState:s}=o;return l().cellContextMenu.onChange(u=>{if(!u)return;let{event:d}=u;function p(){i(),a.cellContextMenuVisibleFor=null}let{menu:f,cellContext:m,preventDefault:g}=DS(u,o,p),h=De.fromPoint({top:d.clientY,left:d.clientX});h.width+=El,h.height+=El,n(f,{constrainTo:Dn(l()),id:"cell-context-menu",alignTo:h,alignPosition:ES}),g&&d.preventDefault(),a.cellContextMenuVisibleFor={columnId:u.columnId,rowId:u.rowId,rowIndex:u.rowIndex,colIndex:u.colIndex};let{onCellContextMenu:S}=l();S&&S({...m,getState:l,getDataSourceState:s},d)})},[]),(0,bi.useEffect)(()=>{let{cellContextMenuVisibleFor:a}=e();if(a){let s=function(c){c.__insideMenu!==!0&&(i(),t.cellContextMenuVisibleFor=null)};var l=s;return document.documentElement.addEventListener("mousedown",s),()=>{document.documentElement.removeEventListener("mousedown",s)}}else i();return()=>{}},[e().cellContextMenuVisibleFor]),{menuPortal:r}}function AS(){let o=Ke(),{getState:e,actions:t}=o,{showOverlay:n,portal:r,clearAll:i}=lo({portalContainer:xn()});return(0,bi.useEffect)(()=>{let{actions:a,getState:l}=o;return l().contextMenu.onChange(c=>{if(!c)return;let{event:u}=c;function d(){i(),a.contextMenuVisibleFor=null}let{menu:p,cellContext:f,preventDefault:m}=xS(c,o,d),g={top:u.clientY,left:u.clientX},h=De.fromPoint(g);h.width+=El,h.height+=El,n(p,{constrainTo:Dn(l()),id:"table-context-menu",alignTo:h,alignPosition:ES}),m&&u.preventDefault(),a.contextMenuVisibleFor={point:g,...c};let{onContextMenu:S}=l();S&&S({...o,...f},u)})},[]),(0,bi.useEffect)(()=>{let{contextMenuVisibleFor:a}=e();if(a){let s=function(c){c.__insideMenu!==!0&&(i(),t.contextMenuVisibleFor=null)};var l=s;return document.documentElement.addEventListener("mousedown",s),()=>{document.documentElement.removeEventListener("mousedown",s)}}else i();return()=>{}},[e().contextMenuVisibleFor]),{menuPortal:r}}var _S=require("react"),OS=H(require("react"));var Ml=require("react");function Al(o,e){let{brain:t}=oe(r=>({brain:r.state.brain})),n=(0,Ml.useCallback)(o,e);(0,Ml.useEffect)(()=>t.onScroll(n),[t,n])}var pu="yzx0vj0";function FS(o){let{width:e,maxWidth:t,minWidth:n,scrollable:r,...i}=o,a=(0,_S.useRef)(null);Al(s=>{a.current&&r!==!1&&(a.current.style.transform=`translate3d(${-s.scrollLeft}px, 0px, 0px)`)},[r]);let l={...i.style};return e==="column"?l.width=he.runtime.totalVisibleColumnsWidthValue:e==="viewport"&&(l.width=he.runtime.bodyWidth),n==="column"?l.minWidth=he.runtime.totalVisibleColumnsWidthValue:n==="viewport"&&(l.minWidth=he.runtime.bodyWidth),t==="column"?l.maxWidth=he.runtime.totalVisibleColumnsWidthValue:t==="viewport"&&(l.maxWidth=he.runtime.bodyWidth),OS.createElement("div",{ref:a,...i,className:i.className?X(i.className,pu):pu,style:l},i.children)}var Lw=Q(J.columnWidthAtIndex),kw=Q(J.columnOffsetAtIndex);function NS(){let{computedVisibleColumns:o}=oe(e=>({computedVisibleColumns:e.computed.computedVisibleColumns}));return o.map(e=>({id:e.id,width:e.computedWidth,cssVarForWidth:`var(${Lw}-${e.computedVisibleIndex})`,offset:e.computedOffset,cssVarForOffset:`var(${kw}-${e.computedVisibleIndex})`,pinned:e.computedPinned}))}var _l="InfiniteTable";var LS=require("react");function kS(){let{getState:o,actions:e,dataSourceActions:t,getDataSourceState:n}=oe(u=>({getState:u.getState,actions:u.actions,dataSourceActions:u.dataSourceActions,getDataSourceState:u.getDataSourceState})),{groupBy:r,isTree:i}=n(),a=o(),{brain:l,wrapRowsHorizontally:s}=a,c=a.repeatWrappedGroupRows;s||(c=!1),(0,LS.useEffect)(()=>{if(!s){n().repeatWrappedGroupRows&&(t.repeatWrappedGroupRows=!1);return}let u=()=>{let{rowsPerPage:f,repeatWrappedGroupRows:m}=n(),g=!1,h=l.rowsPerPage,S=(r&&r.length>0||i)&&h>0?h:null;return f!=S&&(t.rowsPerPage=S,g=!0),m!=c&&(t.repeatWrappedGroupRows=c??!1,g=!0),g};u();let d,p=l.onVerticalRenderRangeChange(()=>{u()&&(d=setTimeout(()=>{e.forceBodyRerenderTimestamp=Date.now()}))});return()=>{d&&clearTimeout(d),p()}},[l,s,r,i,c])}var En=require("react");function zw(){let o=[],e=t=>{Object.keys(t).forEach(n=>{let r=t[n];if(typeof r=="string"){let i=Q(r);if(i.includes("dont-override"))return;o.push(i)}else r&&typeof r=="object"&&e(r)})};return e({...he,loaded:void 0,runtime:void 0}),o}function zS(o){if(!o)return{};let e=zw(),t=getComputedStyle(o),n={};return e.forEach(r=>{n[r]=t.getPropertyValue(r).trim()}),n}var Ti=Se({defaultClassName:"_143ofgf0",variantClassNames:{active:{true:"_143ofgf1",false:"_143ofgf2"}},defaultVariants:{},compoundVariants:[]}),VS="_143ofgf5",GS="_143ofgf3";var Vw=Q(he.loaded),fu={source:"infinite-table-page",target:"infinite-table-devtools-background"};function HS(o,e){let{type:t,debugId:n}=o;if(t==="unmount")return{...fu,url:mu(),type:t,payload:{debugId:n}};let r=e,i=r.getComputed(),a=r.getDataSourceState(),l=r.getState();return{...fu,url:mu(),type:t,payload:{debugId:n,columnVisibility:l.columnVisibility,columnOrder:i.computedColumnOrder,visibleColumnIds:i.computedVisibleColumns.map(c=>c.id),selectionMode:a.selectionMode,columns:Object.fromEntries(i.computedVisibleColumns.map(c=>[c.id,{field:c.field,dataType:c.computedDataType,sortType:c.computedSortType,filtered:c.computedFiltered,sorted:c.computedSorted,width:c.computedWidth}])),groupRenderStrategy:l.groupRenderStrategy,groupBy:a.groupBy.map(c=>c.field?`${c.field}`:"<fn>"),sortInfo:(a.sortInfo||[]).filter(c=>typeof c.field=="string").map(c=>({field:`${c.field}`,dir:c.dir,type:Array.isArray(c.type)?c.type[0]:c.type??"string"})),multiSort:a.multiSort,devToolsDetected:l.devToolsDetected,debugTimings:Object.fromEntries(a.debugTimings),debugWarnings:{...Object.fromEntries(a.debugWarnings),...Object.fromEntries(l.debugWarnings)},themeVars:zS(l.domRef.current),themeVarOverrides:{...io.get(n)||{}}}}}var mu=yt(function(){let o=new URL(window.location.href);return o.origin+o.pathname});function Gw(o){window.postMessage(o)}var Hw=yt(()=>{console.log("Infinite Table DevTools detected!");let o=(e,t)=>{if(t){Ct.set(e,t);let{devToolsDetected:n}=t.getState();n||(t.actions.devToolsDetected=!0);let r=t.getDataSourceState();r.debugId!==e&&(t.dataSourceActions.debugId=e),r.devToolsDetected||(t.dataSourceActions.devToolsDetected=!0),window.postMessage(HS({type:"update",debugId:e},t))}else Ph(e),window.postMessage(HS({type:"unmount",debugId:e},null))};return window.__INFINITE_TABLE_DEVTOOLS_HOOK__=o,Ye.onLogIntent("IT:*",e=>{Gw({...fu,url:mu(),type:"log",payload:{debugId:void 0,channel:e.channel,color:e.color,args:e.args.map(t=>{if(typeof t=="object"&&t!==null){let n="";try{n=JSON.stringify(t)}catch{console.error("Cannot stringify arg in global log interceptor",t)}return n}return String(t)}),timestamp:e.timestamp}})}),o});function KS(){let{getState:o,getDataSourceState:e,dataSourceActions:t}=oe(a=>({getState:a.getState,getDataSourceState:a.getDataSourceState,dataSourceActions:a.dataSourceActions})),n=o(),{domRef:r,debugId:i}=n;return i&&r.current&&getComputedStyle(r.current).getPropertyValue(Vw)!==`${qi}`&&di({debugId:i,key:"CSS001_CSS"}),(0,En.useEffect)(()=>{e().debugId!==i&&(t.debugId=i)},[i]),Ww()}var Ol=Ce(),Kw={revertAll:o=>{let e=Ct.get(o.debugId);if(e){let t=Xo.get(o.debugId);Xo.delete(o.debugId),Co.delete(o.debugId),t&&Object.keys(t).forEach(r=>{e.actions[r]=t[r],delete t[r]});let n=Io.get(o.debugId);Io.delete(o.debugId),Ro.delete(o.debugId),n&&Object.keys(n).forEach(r=>{e.dataSourceActions[r]=n[r],delete n[r]})}},revertProperty:o=>{let e=Ct.get(o.debugId);if(e){let t=o.property,n=Co.get(o.debugId),r=Xo.get(o.debugId),i=Ro.get(o.debugId),a=Io.get(o.debugId),l=t;r&&n&&n[l]!==void 0&&(delete n[l],e.actions[l]=r[l],delete r[l]);let s=t;if(a&&i&&i[s]!==void 0){let c=Io.get(o.debugId)||{};delete i[s],e.dataSourceActions[s]=c[s],delete c[s]}}},discardWarning:o=>{let e=Ct.get(o.debugId);if(e){let t=o.warning,n=e.getDataSourceState().debugWarnings;if(n.get(t))n.delete(t),Zo(o.debugId);else{let i=o.warning,a=e.getState().debugWarnings;a.get(i)&&(a.delete(i),Zo(o.debugId))}}},discardAllWarnings:o=>{let e=Ct.get(o.debugId);e&&(e.getDataSourceState().debugWarnings.clear(),e.getState().debugWarnings.clear(),Zo(o.debugId))},setColumnVisibility:o=>{zc(o.debugId,"columnVisibility",o.columnVisibility)},setGroupBy:o=>{cl(o.debugId,"groupBy",o.groupBy)},setGroupRenderStrategy:o=>{zc(o.debugId,"groupRenderStrategy",o.groupRenderStrategy)},setSortInfo:o=>{cl(o.debugId,"sortInfo",o.sortInfo)},setMultiSort:o=>{cl(o.debugId,"multiSort",o.multiSort)},setCssVar:o=>{let e=Ct.get(o.debugId),t=e?.getState().domRef.current;!e||!t||!o.name?.startsWith("--infinite-")||(t.style.setProperty(o.name,o.value),io.set(o.debugId,{...io.get(o.debugId)||{},[o.name]:o.value}),Zo(o.debugId))},revertCssVar:o=>{let e=Ct.get(o.debugId),t=e?.getState().domRef.current;if(!e||!t)return;t.style.removeProperty(o.name);let n={...io.get(o.debugId)||{}};delete n[o.name],io.set(o.debugId,n),Zo(o.debugId)},revertAllCssVars:o=>{let e=Ct.get(o.debugId),t=e?.getState().domRef.current;if(!e||!t)return;let n=io.get(o.debugId)||{};Object.keys(n).forEach(r=>{t.style.removeProperty(r)}),io.delete(o.debugId),Zo(o.debugId)},highlight:o=>{let e=Ct.get(o.debugId);if(e){let t=e.getState().domRef.current;if(t){let n=t.getBoundingClientRect(),r=document.querySelector(`.${Ti.classNames.base}`);r||(r=document.createElement("div"),r.classList.add(Ti.classNames.base),r.innerHTML=[`<div class="${GS}"></div>`,`<div class="${VS}"></div>`].join(""),document.body.appendChild(r));let i=r.firstElementChild;if(r){r.style.left=`${n.left}px`,r.style.top=`${n.top}px`,r.style.width=`${n.width}px`,r.style.height=`${n.height}px`,i.innerHTML=o.debugId;let a=r.lastElementChild,l=()=>{r.classList.remove(Ti.classNames.variants.active.true),a.removeEventListener("animationend",l)};a.addEventListener("animationend",l),r.classList.add(Ti.classNames.variants.active.true)}}}}};function Bw(){typeof window<"u"&&window.addEventListener("message",o=>{if(o&&o.data&&typeof o.data.source=="string"&&typeof o.data.target=="string"&&o.data.target==="infinite-table-page"&&o.data.source.startsWith("infinite-table-devtools-contentscript")&&(window.__INFINITE_TABLE_DEVTOOLS_HOOK__||(Hw(),Ol(window.__INFINITE_TABLE_DEVTOOLS_HOOK__)),typeof o.data.type=="string")){let e=o.data.type,t=Kw[e];t&&t(o.data.payload)}})}Bw();function Ww(){let{getState:o,getComputed:e,getDataSourceState:t,dataSourceActions:n,actions:r,dataSourceApi:i,api:a}=oe(u=>({getState:u.getState,getComputed:u.getComputed,getDataSourceState:u.getDataSourceState,dataSourceActions:u.dataSourceActions,actions:u.actions,dataSourceApi:u.dataSourceApi,api:u.api})),s=o().debugId,c=(0,En.useRef)(s);return c.current=s,(0,En.useEffect)(()=>{let u=c.current;if(!u)return;let d=f=>{f(u,{getState:o,getDataSourceState:t,getComputed:e,dataSourceActions:n,actions:r,api:a,dataSourceApi:i})},p=Ol.get();if(p){d(p);return}return Ol.onChange(f=>{f&&d(f)})},[]),(0,En.useEffect)(()=>{let u=c.current;if(!u)return;let d=Ol.get();d&&d(u,{getState:o,getDataSourceState:t,getComputed:e,dataSourceActions:n,actions:r,api:a,dataSourceApi:i})}),(0,En.useEffect)(()=>{if(s)return()=>{let u=globalThis.__INFINITE_TABLE_DEVTOOLS_HOOK__;u&&u(s,null)}},[s]),s}function BS(){let{masterPortalDOMRef:o}=Ai(n=>({masterPortalDOMRef:n.getMasterState().portalDOMRef}))??{},e=oe(n=>n.state.portalDOMRef);return o?.current??e?.current}var Ot=H(require("react")),Fl=require("react");var WS="hs68h8j _16lm1iwk _16lm1iwx _16lm1iw2n",jS=Se({defaultClassName:"hs68h8e _16lm1iw1x _16lm1iw2j _16lm1iw1p",variantClassNames:{active:{true:"hs68h8f _16lm1iwn _16lm1iw1h",false:"_16lm1iwo"},draggingInProgress:{true:"hs68h8h",false:"hs68h8i"}},defaultVariants:{},compoundVariants:[]}),US="hs68h81",$S=Se({defaultClassName:"hs68h80 _16lm1iw1p",variantClassNames:{orientation:{horizontal:"_16lm1iw2h _16lm1iw2j",vertical:"_16lm1iw2f"},draggingInProgress:{true:"_16lm1iw1h",false:"hs68h86"},dropRejected:{true:"hs68h87",false:"hs68h88"},active:{true:"hs68h89",false:"hs68h8a"}},defaultVariants:{},compoundVariants:[[{dropRejected:!0,active:!0},"hs68h8b"],[{dropRejected:!1,active:!0},"hs68h8c"],[{active:!1,dropRejected:!1},"hs68h8d"]]});var Mn=H(require("react"));function YS(o){return Mn.createElement("div",{...o.domProps})}function qS(o){let{active:e}=o;return Mn.createElement("div",{className:US},e?"Drop to group":"Drag columns to group")}function XS(o){let e=t=>{(t.key==="Enter"||t.key===" ")&&(t.preventDefault(),o.onClear?.())};return Mn.createElement("div",{...o.domProps},o.label,Mn.createElement("div",{className:Li[1]}),Mn.createElement("div",{tabIndex:0,role:"button","aria-label":`Clear grouping by ${o.field}`,className:WS,onKeyDown:e,onMouseDown:o.onClear},Mn.createElement(Pl,{size:20})))}var jw=(o,e)=>t=>{e&&e(t);let n=Date.now(),r=!1,i=()=>{r=!0};Fe().addEventListener("mousemove",i,{once:!0}),Fe().addEventListener("mouseup",()=>{r||(Fe().removeEventListener("mousemove",i),Date.now()-n<200&&requestAnimationFrame(()=>{o()}))},{once:!0})};function Uw(o){let{column:e,onClear:t,components:n,field:r,id:i,toggleSorting:a}=o,{dragSourceListId:l,dragItemId:s,dragListId:c}=hn(),u=l===c,d=Ke(),p=(e?rn(e.id,d,"grouping-toolbar"):r)??i,f=e?Ot.createElement(Ta,{forceSize:!0,size:20,direction:e.computedSortedAsc?1:e.computedSortedDesc?-1:0}):null,m=Ot.createElement(Ot.Fragment,null,p,f),g=s===i&&l===c,h=X(jS({draggingInProgress:u,active:g}),o.domProps?.className),S=jw(a,o.domProps?.onMouseDown),y={...o.domProps,className:h,onMouseDown:S},T=n?.ToolbarItem??XS;return Ot.createElement(T,{active:g,domProps:y,column:e,field:r,label:m,onClear:t})}function ZS(o){let{groupBy:e}=Ne(C=>({groupBy:C.dataSourceState.groupBy})),{getComputed:t,dataSourceApi:n,api:r}=oe(C=>({getComputed:C.getComputed,dataSourceApi:C.dataSourceApi,api:C.api})),{dropTargetListId:i,dragSourceListId:a}=fo(),{fieldsToColumn:l,computedColumnsMap:s}=t(),c=cn(na),u=cn(oa),d=(0,Fl.useMemo)(()=>[u,c],[u,c]),p=i===c,f=a===c,m=o.components?.Placeholder??qS,g=o.components?.Host??YS,h=e.length?Ot.createElement(Ot.Fragment,null,e.map((C,I)=>{let w=C.field?l.get(C.field):void 0,v=`${C.field??`idx-${I}`}`;return Ot.createElement(Wo.DraggableItem,{key:v,id:v},P=>Ot.createElement(Uw,{id:v,components:o.components,domProps:P,field:C.field,column:w,toggleSorting:()=>{w&&r.toggleSortingForColumn(w.id)},onClear:()=>{let E=e.filter(M=>M!==C).filter(Boolean);n.setGroupBy(E)}}))})):Ot.createElement(m,{draggingInProgress:f,active:p,groupBy:e}),S=C=>{let I=C.map(w=>e[w]);n.setGroupBy(I)},y=C=>{let{dragItemId:I}=C,w=I,v=s.get(w);if(!v||!v.field||!v.computedGroupable)return;let P=[...e];P.splice(C.dropIndex,0,{field:v.field}),n.setGroupBy(P)},T=(0,Fl.useCallback)(C=>{let{computedColumnsMap:I}=t(),w=C.dragItem.id,v=I.get(w);return!(!v||!v.computedGroupable||e.some(P=>P.field===v.field))},[e]),b=o.orientation??"horizontal",{domProps:R}=o;return Ot.createElement(Wo,{orientation:b,dragListId:c,acceptDropsFrom:d,onDrop:S,dragStrategy:"inline",onAcceptDrop:y,shouldAcceptDrop:T},(C,{draggingInProgress:I,status:w})=>{let v=X($S({active:p,orientation:b,draggingInProgress:I,dropRejected:w==="rejected"}),C.className,R?.className),P={...C,...R,className:v,children:h};return Ot.createElement(g,{active:p,rejectDrop:w==="rejected",domProps:P,orientation:b})})}var wr=H(require("react"));var Nl=require("react"),so=require("react"),Ll=H(require("react"));function QS(o){let{dataArray:e,brain:t,computedPinnedEndColumns:n,computedPinnedStartColumns:r,computedVisibleColumns:i,computedRowHeight:a,columnSize:l,rowspan:s}=o;return Ka(t,{colWidth:l,rowHeight:a,rows:e.length,cols:i.length,rowspan:s},{fixedColsEnd:n.length,fixedColsStart:r.length}),t}var vo=H(require("react"));var JS=Se({defaultClassName:"evqes20",variantClassNames:{},defaultVariants:{},compoundVariants:[]});var gu=require("react");function $w(o,e){let{masterState:t,detailContext:n}=e,r=t.detailDataSourcesStateToRestore;if(r.has(o)){let i=r.get(o);return n.assignState(i),!0}return!1}function Yw(o,e){let{detailState:t,masterState:n,masterActions:r,cacheEntryForRow:i}=e,a=new Map(n.detailDataSourcesStateToRestore),l=fh(t);i.all||(i.groupBy||delete l.groupBy,i.sortInfo||delete l.sortInfo,i.filterValue||delete l.filterValue,i.data||delete l.originalDataArray),a.set(o,l),r.detailDataSourcesStateToRestore=a}function eb(o,e){let t={current:!1};return{currentRowCache:{getRowId:()=>o,add:r=>{t.current=!0,e.add(o,r)},get:()=>e.get(o),delete:()=>(t.current=!0,e.delete(o)),has:()=>e.has(o)},cacheCalledByRowDetailRenderer:t}}function tb(o){let{rowInfo:e,currentRowCache:t,cacheCalledByRowDetailRenderer:n,getMasterDataSourceState:r,masterActions:i,getMasterState:a}=o,l=r().detailDataSourcesStateToRestore.has(e.id)&&t.has(),c={registerDetail:yt(u=>{if(n.current||t.add({all:!0}),!t.has()){requestAnimationFrame(()=>{u.dataSourceState.destroyedRef.current||(u.dataSourceActions.stateReadyAsDetails=!0)});return}$w(e.id,{masterState:r(),detailContext:u}),requestAnimationFrame(()=>{u.dataSourceState.destroyedRef.current||(u.dataSourceActions.stateReadyAsDetails=!0)}),u.dataSourceState.onCleanup.onChange(()=>{let d=t.get();d&&Yw(e.id,{detailState:u.getDataSourceState(),masterActions:i,masterState:r(),cacheEntryForRow:d})})}),shouldRestoreState:l};return c.masterRowInfo=e,c.getMasterDataSourceState=r,c.getMasterState=a,c}function ob(o){let{rowDetailsCache:e,rowInfo:t}=o,{getDataSourceState:n,dataSourceActions:r}=Ne(c=>({getDataSourceState:c.getDataSourceState,dataSourceActions:c.dataSourceActions})),{getMasterState:i}=oe(c=>({getMasterState:c.getState})),{currentRowCache:a,cacheCalledByRowDetailRenderer:l}=(0,gu.useMemo)(()=>eb(t.id,e),[e,t.id]),s=(0,gu.useMemo)(()=>tb({rowInfo:t,currentRowCache:a,cacheCalledByRowDetailRenderer:l,getMasterDataSourceState:n,masterActions:r,getMasterState:i}),[t.id,a]);return s.masterRowInfo=t,s.getMasterDataSourceState=n,s.getMasterState=i,{masterDetailContextValue:s,currentRowCache:a}}function nb(){return Eo()}var{rootClassName:qw}=ze,Xw=`${qw}RowDetail`;function Zw(o){let{domRef:e,rowDetailRenderer:t,rowDetailHeight:n,rowInfo:r,detailOffset:i,rowDetailsCache:a}=o,{masterDetailContextValue:l,currentRowCache:s}=ob({rowDetailsCache:a,rowInfo:r}),c=kn(),[u]=vo.useState(()=>nb());return u.setSnapshot(l),vo.useLayoutEffect(()=>{u.notify()},[l]),vo.createElement(c.Provider,{value:u},vo.createElement("div",{ref:e,className:X(Xw,JS({})),style:{position:"absolute",top:`${i}px`,left:0,width:`calc(${J.bodyWidth} - ${J.scrollbarWidthVertical})`,height:n}},t(r,s)))}var rb=vo.memo(Zw);var Qw=1;function ib(o){let{computed:e,bodySize:t,imperativeApi:n}=o,{actions:r,getState:i,getComputed:a,getDataSourceMasterContext:l,rowHeight:s,rowDetailHeight:c,onRowMouseEnter:u,onRowMouseLeave:d,groupRenderStrategy:p,brain:f,showZebraRows:m,rowDetailRenderer:g,isRowDetailsExpanded:h,isRowDetailsEnabled:S,cellClassName:y,cellStyle:T,repaintCellsKey:b,rowStyle:R,rowDetailCache:C,rowClassName:I,onScrollToTop:w,onScrollToBottom:v,onScrollStop:P,scrollToBottomOffset:E,wrapRowsHorizontally:M,updatedAt:D,ready:x,editingCell:A}=oe(k=>({actions:k.actions,getState:k.getState,getComputed:k.getComputed,getDataSourceMasterContext:k.getDataSourceMasterContext,rowHeight:k.state.rowHeight,rowDetailHeight:k.state.rowDetailHeight,onRowMouseEnter:k.state.onRowMouseEnter,onRowMouseLeave:k.state.onRowMouseLeave,groupRenderStrategy:k.state.groupRenderStrategy,brain:k.state.brain,showZebraRows:k.state.showZebraRows,rowDetailRenderer:k.state.rowDetailRenderer,isRowDetailsExpanded:k.state.isRowDetailExpanded,isRowDetailsEnabled:k.state.isRowDetailEnabled,cellClassName:k.state.cellClassName,cellStyle:k.state.cellStyle,repaintCellsKey:k.state.repaintCellsKey,rowStyle:k.state.rowStyle,rowDetailCache:k.state.rowDetailCache,rowClassName:k.state.rowClassName,onScrollToTop:k.state.onScrollToTop,onScrollToBottom:k.state.onScrollToBottom,onScrollStop:k.state.onScrollStop,scrollToBottomOffset:k.state.scrollToBottomOffset,wrapRowsHorizontally:k.state.wrapRowsHorizontally,updatedAt:k.state.updatedAt,ready:k.state.ready,editingCell:k.state.editingCell})),{computedPinnedStartColumns:O,computedPinnedEndColumns:F,computedVisibleColumns:z,computedColumnsMap:L,computedColumnOrder:B,computedRowHeight:Y,computedRowSizeCacheForDetails:V,fieldsToColumn:W,rowspan:N,toggleGroupRow:K,columnSize:ae}=e,re=(0,Nl.useMemo)(()=>z.map(k=>k.id),[z]),{dataArray:ue,rowInfoStore:fe,selectionMode:be,cellSelection:de,isNodeReadOnly:U,getDataSourceState:ie,dataSourceApi:ge,dataSourceActions:Z}=Ne(k=>({dataSourceApi:k.dataSourceApi,dataSourceActions:k.dataSourceActions,getDataSourceState:k.getDataSourceState,dataArray:k.dataSourceState.dataArray,rowInfoStore:k.dataSourceState.rowInfoStore,selectionMode:k.dataSourceState.selectionMode,cellSelection:k.dataSourceState.cellSelection,isNodeReadOnly:k.dataSourceState.isNodeReadOnly})),ee=Le(ue);QS({columnSize:ae,brain:f,computedPinnedStartColumns:O,computedPinnedEndColumns:F,computedVisibleColumns:z,computedRowHeight:Y,dataArray:ue,bodySize:t,rowspan:N});let j=(0,so.useRef)(0);(0,so.useEffect)(()=>f.onRenderCountChange(()=>{j.current=f.scrollTopMax}),[f]),(0,so.useEffect)(()=>f.onRenderRangeChange(k=>{i().onRenderRangeChange?.(k)}),[f]),(0,so.useEffect)(()=>f.onScrollStop(k=>{let{scrollTop:_,scrollLeft:me}=k;if(_===0&&w?.(),_+(E??Qw)>=j.current){v?.();let{livePagination:Re,livePaginationCursor:Me,dataArray:qe}=ie();Re&&(Z.cursorId=Me!==void 0?Date.now():qe.length)}if(P){let Re=f.getRenderRange();P({scrollTop:_,scrollLeft:me,renderRange:Re,viewportSize:i().bodySize,firstVisibleRowIndex:Re.start[0],lastVisibleRowIndex:Re.end[0],firstVisibleColIndex:Re.start[1],lastVisibleColIndex:Re.end[1]})}}),[f,w,v,P]),(0,so.useEffect)(()=>{t.height&&(r.ready=!0)},[!!t.height]),(0,so.useEffect)(()=>{let{onReady:k}=i();k&&k({api:n,dataSourceApi:ge})},[x]);let se=(0,Nl.useMemo)(()=>({isNodeReadOnly:U,selectionMode:be,cellSelection:de}),[U,be,de]),ne=(0,so.useCallback)(k=>{let{rowIndex:_,colIndex:me,heightWithRowspan:Te,domRef:Pe,hidden:Re,width:Me,onMouseLeave:qe,onMouseEnter:We}=k,at=ee()[_],et=z[me];if(!at||!et)return null;let Xe=V?V.getRowHeight(_):Te,G=!1;!S||typeof S=="function"&&!S(at)?G=!1:h&&(G=h(at)?"expanded":"collapsed");let te=M?f.getRowIndexInPage(_):null,ye=M?f.getPageIndexForRow(_):null,Ie=n.isEditorVisibleForCell({rowIndex:_,columnId:et.id}),ut={getData:ee,virtualized:!0,showZebraRows:m,groupRenderStrategy:p,rowIndexInHorizontalLayoutPage:te,horizontalLayoutPageIndex:ye,rowIndex:_,rowInfoStore:fe,hidden:Re,toggleGroupRow:K,rowHeight:Xe,rowDetailState:G,onMouseEnter:We,onMouseLeave:qe,onRowMouseEnter:u,onRowMouseLeave:d,domRef:Pe,width:Me,column:et,columnsMap:L,fieldsToColumn:W,rowStyle:R,rowClassName:I,cellStyle:T,cellClassName:y,repaintCellsKey:et.repaintCellsKey!==void 0?et.repaintCellsKey:b,visibleColumnIds:re,computedColumnOrder:B,inEditMode:Ie,getDataSourceState:ie,dataSourceApi:ge,dataSourceActions:Z,getState:i,imperativeApi:n,componentActions:r,getComputed:a,getDataSourceMasterContext:l,dataSourceStatePartialForCell:se};return Ll.createElement(zf,{...ut})},[s,c,u,d,V,Y,h,ee,z,L,W,p,M,K,m,f,fe,R,I,y,T,b,ie,ge,Z,i,n,r,a,l,re,B,D,A,se]),pe=(0,Nl.useMemo)(()=>{if(h)return k=>{let{rowIndex:_,domRef:me}=k,Pe=ee()[_];if(!Pe||!h(Pe)||!V)return Ll.createElement("div",{ref:me,className:ud.hidden});let{rowDetailHeight:Re,rowHeight:Me}=V.getSize(_);return Ll.createElement(rb,{rowInfo:Pe,rowDetailsCache:C,rowIndex:_,domRef:me,detailOffset:Me,rowDetailHeight:Re,rowDetailRenderer:g})}},[x,ne,g,c,h,C]);return{renderCell:ne,renderDetailRow:pe}}var ab=require("react");function lb(){let{state:o,getState:e,actions:t}=oe(i=>({state:i.state,getState:i.getState,actions:i.actions})),{wrapRowsHorizontally:n}=o,r=Oo(n);(0,ab.useEffect)(()=>{if(r!==n){let{brain:i,headerBrain:a,renderer:l,onRenderUpdater:s}=e();i.destroy(),a.destroy(),l.destroy(),s.destroy();let c=Uc(_l,!!n);t.brain=c.brain,t.headerBrain=c.headerBrain,t.renderer=c.renderer,t.onRenderUpdater=c.onRenderUpdater,t.headerRenderer=c.headerRenderer,t.headerOnRenderUpdater=c.headerOnRenderUpdater}},[r,n])}var ub=H(require("react"));var sb="_16lm1iw1 _16lm1iw1c _16lm1iwe";var cb=X(sb,ks);function db(o){return ub.createElement("div",{...o,className:o.className?X(cb,o.className):cb})}var Ir=H(require("react"));var pb={visible:"qy58ya1 qy58ya0 _16lm1iw2 _16lm1iw23 _16lm1iw26 _16lm1iw2c _16lm1iw2a",hidden:"qy58ya2 qy58ya0 _16lm1iw2 _16lm1iw23 _16lm1iw26 _16lm1iw2c _16lm1iw2a"},fb="qy58ya3 _16lm1iw2 _16lm1iw23 _16lm1iw26 _16lm1iw2c _16lm1iw2a",mb="qy58ya4";var{rootClassName:Jw}=ze,hu=`${Jw}-LoadMask`;function ev(o){let{visible:e,children:t="Loading"}=o;return Ir.createElement("div",{className:`${pb[e?"visible":"hidden"]} ${hu}`},Ir.createElement("div",{className:`${fb} ${hu}-Overlay`}),Ir.createElement("div",{className:`${mb} ${hu}-Text`},t))}var kl=Ir.memo(ev);var gb=require("react");var tv=[Mf,`${oo}--hovered`];function ov(o){return Array.isArray(o)&&(o=o.join(" ")),o.split(" ").map(e=>e.trim()).filter(Boolean)}function An(o){let e=Ke(),t=Mo(),{getComputed:n,api:r}=e,{renderer:i,onRenderUpdater:a,debugId:l,keyboardNavigation:s,activeRowIndex:c,loadingText:u,columnReorderDragColumnId:d,scrollStopDelay:p,brain:f,scrollerDOMRef:m,components:g,bodySize:h,activeCellIndex:S,rowDetailRenderer:y,showHoverRows:T,wrapRowsHorizontally:b,domProps:R,domRef:C,forceBodyRerenderTimestamp:I,rowHoverClassName:w,ready:v}=oe(V=>({ready:V.state.ready,columnReorderDragColumnId:V.state.columnReorderDragColumnId,forceBodyRerenderTimestamp:V.state.forceBodyRerenderTimestamp,renderer:V.state.renderer,onRenderUpdater:V.state.onRenderUpdater,debugId:V.state.debugId,keyboardNavigation:V.state.keyboardNavigation,activeRowIndex:V.state.activeRowIndex,loadingText:V.state.loadingText,scrollStopDelay:V.state.scrollStopDelay,brain:V.state.brain,scrollerDOMRef:V.state.scrollerDOMRef,components:V.state.components,bodySize:V.state.bodySize,activeCellIndex:V.state.activeCellIndex,rowDetailRenderer:V.state.rowDetailRenderer,showHoverRows:V.state.showHoverRows,wrapRowsHorizontally:V.state.wrapRowsHorizontally,domProps:V.state.domProps,domRef:V.state.domRef,rowHoverClassName:V.state.rowHoverClassName})),P=g?.LoadMask??kl,E=n(),{computedRowHeight:M,computedRowSizeCacheForDetails:D}=E,x=D?.getRowHeight||M,{loading:A}=Ne(V=>({loading:V.dataSourceState.loading})),O=wr.useCallback(V=>{let W=e.getState(),N=V.target;if(!t&&V._from_row_detail)return;t&&(V._from_row_detail=!0);let K=dp(N,jc(),W.domRef.current),ae,re,ue,fe;K&&(re=Number(K.dataset.colIndex),fe=Number(K.dataset.rowIndex),ae=e.getComputed().computedVisibleColumns[re].id,ue=e.dataSourceApi.getRowInfoArray()[fe].id);let be={columnId:ae,colIndex:re,rowId:ue,rowIndex:fe,event:V,target:K??V.target};K&&W.cellContextMenu(be),W.contextMenu(be)},[]),{renderCell:F,renderDetailRow:z}=ib({imperativeApi:r,getComputed:n,domRef:C,bodySize:h,computed:E}),{autoFocus:L,tabIndex:B}=R??{};lb();let Y=(0,gb.useMemo)(()=>{if(!T)return;let V=[];return w&&(V=V.concat(w)),o.rowHoverClassName&&(V=V.concat(o.rowHoverClassName)),An.rowHoverClassName&&(V=V.concat(An.rowHoverClassName)),ov(V)},[T,w,o.rowHoverClassName,An.rowHoverClassName]);return wr.createElement(db,{onContextMenu:O},wr.createElement(Zm,{forceRerenderTimestamp:I,debugId:l,tabIndex:B??0,autoFocus:L??void 0,activeRowIndex:v&&s==="row"?c:null,activeCellIndex:v&&s==="cell"&&!d?S:null,scrollStopDelay:p,renderer:i,wrapRowsHorizontally:b,onRenderUpdater:a,brain:f,activeCellRowHeight:x,renderCell:F,renderDetailRow:y?z:void 0,cellHoverClassNames:Y,scrollerDOMRef:m,scrollVarHostRef:C}),wr.createElement(P,{visible:A},u))}An.rowHoverClassName=tv;function hb(){return oe(o=>o.api)}function yb(o){return oe(e=>e.api.getColumnApi(o))}var Jt=ze.rootClassName,{ManagedComponentContextProvider:nv}=kt({initSetupState:Hh,forwardProps:Kh,mapPropsToState:Uh,cleanup:Bh,allowedControlledPropOverrides:{rowHeight:!0,columnHeaderHeight:!0},mappedCallbacks:jh(),getParentState:()=>tl(o=>o),debugName:o=>Uo(o.debugId,_l)}),Sb=Ee.memo(function(){let e=Ei(),{componentState:t,api:n,initialChildren:r}=oe(L=>({componentState:L.state,api:L.api,initialChildren:L.children})),{dataArrayLength:i,getDataSourceState:a,dataSourceActions:l,dataSourceApi:s}=Ne(L=>({dataArrayLength:L.dataSourceState.dataArray.length,getDataSourceState:L.getDataSourceState,dataSourceActions:L.dataSourceActions,dataSourceApi:L.dataSourceApi})),{domRef:c,portalDOMRef:u,onRowHeightCSSVarChange:d,onFlashingDurationCSSVarChange:p,onRowDetailHeightCSSVarChange:f,onColumnHeaderHeightCSSVarChange:m,rowHeightCSSVar:g,rowDetailHeightCSSVar:h,columnHeaderHeightCSSVar:S,scrollStopDelay:y,brain:T,activeRowIndex:b,activeCellIndex:R}=t,{licenseKey:C}=t;C===void 0&&co.licenseKey&&(C=co.licenseKey),Cy(b,i,n),Ty(R,i,n);let{onKeyDown:I}=zy();Ee.useEffect(()=>{let L=a(),B=Nt(Y=>{L.notifyRenderRangeChange({renderStartIndex:Y[0],renderEndIndex:Y[1]})},{wait:y});return T.onVerticalRenderRangeChange(B)},[T,y]);let w=by(C),{autoFocus:v,tabIndex:P,...E}=t.domProps??{},M=Ap(E);Ee.useEffect(()=>{T.setScrollStopDelay(y),l.scrollStopDelayUpdatedByTable=y},[y]),Hg(),kS(),IS();let{menuPortal:D}=bS(),{menuPortal:x}=MS(),{menuPortal:A}=AS(),{menuPortal:O}=PS();Ee.useEffect(()=>{typeof globalThis.__DO_NOT_USE_UNLESS_YOU_KNOW_WHAT_YOURE_DOING_IS_READY=="function"&&globalThis.__DO_NOT_USE_UNLESS_YOU_KNOW_WHAT_YOURE_DOING_IS_READY(t.id,t.ready,n,{dataSourceApi:s})},[t.ready,n,s]);let F=KS();Ee.useEffect(()=>{if(e){let L=e.getSnapshot();u.current=L.getMasterState().portalDOMRef.current}},[]);let z=r??Ee.createElement(Ee.Fragment,null,Ee.createElement(hc,null),Ee.createElement(An,null));return Ee.createElement("div",{"data-debug-id":F,onKeyDown:I,ref:c,...M},z,Ee.createElement("div",{ref:u,className:X(`${St}Portal`,dd[1e7],ki.absolute,sd[0],id[0])},D,x,A,O),g?Ee.createElement(Mr,{key:"row-height",varName:g,onChange:d}):null,Ee.createElement(Mr,{key:"flashing-duration",allowInts:!0,varName:he.components.Cell.flashingDuration,onChange:p}),h?Ee.createElement(Mr,{key:"row-detail-height",varName:h,onChange:f}):null,S?Ee.createElement(Mr,{key:"column-header-height",varName:S,onChange:m}):null,w==="valid"?null:Ee.createElement(Ig,{invalid:w==="invalid"}),Ee.createElement(RS,null))});function rv({children:o,store:e}){let{componentActions:t,componentState:n}=zt(),{scrollerDOMRef:r,scrollTopKey:i}=n,a=Le(n),l=my({state:n,actions:t,getState:a}),s=Le(l),c=Ei(),{getDataSourceState:u,dataSourceActions:d,getDataSourceMasterContext:p,dataSourceApi:f}=no(),[m]=Ee.useState(()=>Vg({getComputed:s,getState:a,getDataSourceState:u,getDataSourceMasterContext:p,dataSourceApi:f,actions:t,dataSourceActions:d})),g={actions:t,state:n,computed:l,dataSourceActions:d,getDataSourceMasterContext:p,getDataSourceState:u,getComputed:s,getState:a,api:m,dataSourceApi:f,children:o};return e.setSnapshot(g),Ee.useLayoutEffect(()=>{e.notify()}),wi(r,h=>{let S={width:h.width,height:h.height};t.bodySize=S},{earlyAttach:!0,debounce:50}),Ee.useEffect(()=>{r.current&&(r.current.scrollTop=0)},[i,r]),Ee.createElement(Sb,null)}var co=function(o){let[e]=Ee.useState(()=>Ry()),t=ji();return Ee.createElement(nv,{repeatWrappedGroupRows:!!o.wrapRowsHorizontally,rowHeight:gi,columnHeaderHeight:mi,...o},Ee.createElement(ta,null,Ee.createElement(t.Provider,{value:e},Ee.createElement(rv,{children:o.children,store:e}))))};co.Header=hc;co.Body=An;co.HScrollSyncContent=FS;co.Footer=()=>Ee.createElement(fd,null);co.GroupingToolbar=ZS;var bb=H(require("react"));function iv(o){let{DataSource:e}=fr({nodesKey:"children",...o});return bb.createElement(e,null,o.children??null)}var Tb=H(require("react"));var yu=o=>(t,{unfilteredTreePaths:n,treeSelectionState:r,prevTreeSelectionState:i,lastUpdatedNodeInfo:a})=>{let l=new Je(i,{treePaths:n});r.forEachLeafNodePath((u,{selected:d})=>{l.setNodeSelection(u,d)}),a&&r.forEachLeafNodePath(u=>{l.setNodeSelection(u,a.selected)},a.nodePath);let c={defaultSelection:!1,selectedPaths:l.getSelectedLeafNodePaths()};o(c)};function Cb(o){return Tb.createElement(co,{...o})}var zl=class{constructor(e){this.state="idle";this.result=void 0;this.error=void 0;this.doneAt=0;this.pendingPromise=void 0;this.debugName="";this.fetch=async(e,...t)=>{this.state="loading";let n=()=>{};try{this.logger(`Fetching query ${this.debugName}...`),this.pendingPromise=new Promise(r=>{n=r}),this.result=await e(...t),this.state="success"}catch(r){this.result=void 0,this.error=r,this.state="error"}return this.doneAt=Date.now(),this.pendingPromise=void 0,n(this),this.logger(`Fetched query ${this.debugName}. State: ${this.state}.`),this.getDoneSnapshot()};this.getCurrentSnapshot=()=>{let e={state:this.state,result:this.result,doneAt:this.doneAt,error:this.error,done:this.isDone()};return e.done||(e.promise=this.pendingPromise),e};this.getDoneSnapshot=async()=>{if(this.state==="idle")throw new Error("DataQuery is still idle");return this.pendingPromise&&await this.pendingPromise,{state:this.state,result:this.result,error:this.error,done:this.isDone(),doneAt:this.doneAt}};this.getResult=()=>{if(!this.isDone())throw new Error("DataQuery is not done yet");return this.result};this.isDone=()=>this.state==="success"||this.state==="error";this.isSuccess=()=>this.state==="success";this.debugName=e||"",this.logger=Ye(`IT:${e}:DataQuery`)}};function _n(o){if(Array.isArray(o))return o.map(_n);if(typeof o=="object"){if(o===null)return o;let e=o,t=Object.keys(e).sort((r,i)=>r.localeCompare(i)),n={};return t.forEach(r=>{let i=e[r];i!==void 0&&(n[r]=_n(i))}),JSON.stringify(n)}return o instanceof Date?o.toISOString():o}var Po=class Po{constructor(e){this.queryCache=new q;this.removeQueryIfErrored=(e,t)=>{if(e.getCurrentSnapshot().state!=="success"){let n=this.queryCache.get(t);if(e===n)return this.queryCache.delete(t),!0}return!1};this.fireQuery=e=>{let t=_n(e.key),n=this.options.cache?this.queryCache.get(t):null;if(n!=null){let i=n.getCurrentSnapshot();if(i.state==="success")return{query:n,fromCache:!0};if(i.state==="loading")return{query:n,fromCache:!0};i.state==="error"&&this.removeQueryIfErrored(n,t)}let r=new zl(`${this.name}:${e.name}`);return this.queryCache.set(t,r),r.fetch(e.fn,e.key),r.getCurrentSnapshot().promise?.then(()=>{this.removeQueryIfErrored(r,t)}),{query:r,fromCache:!1}};this.query=e=>this.fireQuery(e).query.getCurrentSnapshot();this.awaitQuery=async e=>{let{query:t,fromCache:n}=this.fireQuery(e),r=t.getCurrentSnapshot();return r.promise&&(r=await t.getDoneSnapshot(),r.state==="error"&&n)?await this.fireQuery(e).query.getDoneSnapshot():r};this.isQueryInProgress=e=>{let t=_n(e);return this.queryCache.get(t)?.getCurrentSnapshot().done??!1};this.hasQueryForKey=e=>{let t=_n(e);return this.queryCache.has(t)};this.discardQueryForKey=e=>{let t=_n(e);this.queryCache.delete(t)};if(this.options=e,Po.clients.has(e.name)){let t=`There's already a DataClient with name "${e.name}". Specify a different name for the client`;throw new Error(t)}Po.clients.set(e.name,this),this.name=e.name}static destroy(e){let t=Po.clients.get(e);t&&t.destroy()}static destroyAll(){Po.clients.forEach(e=>{Po.destroy(e.name)})}destroy(){Po.clients.delete(this.options.name)}};Po.clients=new Map;var Su=Po;var av={key:"*",when:o=>{let{activeCellIndex:e}=o.getState();if(e){let[t,n]=e,r=o.api.getColumnAtIndex(n);return r?o.api.isCellEditable({rowIndex:t,columnId:r.id}):!1}return!1},handler:(o,e)=>{let{key:t}=e;if(t!="Escape"&&t.length===1){let{activeCellIndex:n}=o.getState();if(n){let[r,i]=n,a=o.api.getColumnAtIndex(i);if(!a)return;requestAnimationFrame(()=>{o.api.startEdit({rowIndex:r,value:t,columnId:a.id})})}}}},Rb={instantEdit:av};var lv=require("react");function Ib(o,e){let{set:t,delete:n,clear:r}=o;return e.set&&(o.set=(i,a)=>(t.call(o,i,a),e.set(i,a),o)),e.delete&&(o.delete=i=>{let a=n.call(o,i);return e.delete(i),a}),(e.clear||e.beforeClear)&&(o.clear=()=>{e.beforeClear&&e.beforeClear(o);let i=r.call(o);return e.clear&&e.clear(),i}),()=>{t&&(o.set=t),n&&(o.delete=n),r&&(o.clear=r)}}var Gl=class Gl{constructor(e,t){this.orderRefs=[];if(typeof e=="number")this.maxSize=e,this.currentSet=new Set;else if(this.maxSize=t??Gl.DEFAULT_SIZE,e){let n=Array.from(e);this.maxSize<n.length&&n.slice(n.length-this.maxSize),this.currentSet=new Set,n.forEach(r=>{this.add(r)})}else this.currentSet=new Set}values(){return this.currentSet.values()}get size(){return this.currentSet.size}delete(e){return this.currentSet.has(e)?(this.currentSet.delete(e),this.orderRefs=this.orderRefs.filter(t=>t!==e),!0):!1}has(e){return this.currentSet.has(e)}add(e){if(this.currentSet.has(e))return this;if(this.maxSize-this.currentSet.size<=0){let[n]=this.orderRefs.splice(0,1);n&&this.currentSet.delete(n)}return this.orderRefs.push(e),this.currentSet.add(e),this}};Gl.DEFAULT_SIZE=10;var Vl=Gl;var Kl=class Kl{constructor(e,t){this.orderRefs=[];if(typeof e=="number")this.maxSize=e,this.currentSet=new Set;else if(this.maxSize=t??Kl.DEFAULT_SIZE,e){let n=Array.from(e);this.maxSize<n.length&&n.slice(n.length-this.maxSize),this.currentSet=new Set,n.forEach(r=>{this.add(r)})}else this.currentSet=new Set}values(){return this.currentSet.values()}get size(){return this.currentSet.size}delete(e){return this.currentSet.has(e)?(this.currentSet.delete(e),this.orderRefs=this.orderRefs.filter(t=>t.deref()!==e),!0):!1}has(e){return this.currentSet.has(e)}add(e){if(this.currentSet.has(e))return this;if(this.maxSize-this.currentSet.size<=0){let[n]=this.orderRefs.splice(0,1),r=n.deref();r&&this.currentSet.delete(r)}return this.orderRefs.push(new WeakRef(e)),this.currentSet.add(e),this}};Kl.DEFAULT_SIZE=10;var Hl=Kl;var On=require("react"),sv=(o,e)=>o.every((t,n)=>t===e[n]),wb=(o,e)=>{let t=(0,On.useRef)(e),n=sv(e,t.current),r=(0,On.useRef)(!0);t.current=e;let i=(0,On.useRef)(["same"]),a=n?[Date.now()]:i.current;i.current=a;let l=(0,On.useRef)(o);l.current=o,(0,On.useEffect)(()=>{if(r.current){r.current=!1;return}return l.current()},a)};var en=require("react"),vb=(o,e,t)=>o.every((n,r)=>t?t(n,e[r]):n===e[r]),Bl=(o,e)=>{let{same:t,different:n,compare:r}=e,i=(0,en.useRef)(t),a=(0,en.useRef)(n),l=vb(t,i.current,r),s=!vb(n,a.current,r),c=(0,en.useRef)(!0);i.current=t,a.current=n;let u=(0,en.useRef)(["same"]),d=l&&s?[Date.now()]:u.current;u.current=d;let p=(0,en.useRef)(o);p.current=o,l&&s&&(c.current=!1),(0,en.useEffect)(()=>{if(!c.current)return p.current()},d)};var Ft=H(require("react"));var Pb=Q(J.currentFlashingDuration),cv=({children:o})=>Ft.createElement(Ft.Fragment,null,o),Db=1e3,xb={up:ra({direction:"up"}).split(" "),down:ra({direction:"down"}).split(" "),neutral:ra({direction:"neutral"}).split(" ")},bu=(o={})=>{let{flashDuration:e,flashClassName:t,render:n=cv}=o;return Ft.forwardRef((i,a)=>{let l=$r(),{flashingDurationCSSVarValue:s}=oe(I=>({flashingDurationCSSVarValue:I.state.flashingDurationCSSVarValue})),c=typeof s=="number"?s??e??Db:e??Db,{domRef:u,value:d,column:p,rowInfo:f,htmlElementRef:m}=l,g=f.id,h=p.id,S=Ft.useRef(!0),y=Ft.useRef(d),T=S.current?null:y.current;S.current=!1;let b=Ft.useRef(void 0),R=Ft.useRef(void 0),C=Ft.useRef(void 0);return Bl(()=>{if(d===y.current)return;let I=()=>{let E=m.current;if(b.current&&(clearTimeout(b.current),b.current=void 0),C.current&&(clearTimeout(C.current),C.current=void 0),R.current&&E){let M=R.current,D=xb[M];E.classList.remove(...t?[t,...D]:D),E.style.removeProperty(Pb),R.current=void 0}};y.current=d;let w=m.current;if(!w)return;I();let v=typeof d=="number"?d>T?"up":"down":"neutral",P=xb[v];return w.style.setProperty(Pb,`${c}`),w.classList.add(...t?[t,...P]:P),R.current=v,b.current=setTimeout(I,c),I},{same:[h,g],different:[d]}),Ft.createElement("div",{ref:u,...i,className:X(i.className)},n({children:i.children,oldValue:T}))})},Eb=bu();var rt=H(require("react")),vr=require("react");var Mb=require("react-dom");function Ab(o){let[e,t]=rt.useState(null);return(0,vr.useEffect)(()=>{let{debugTarget:n}=o,r=setInterval(()=>{if(globalThis.INFINITE&&globalThis.INFINITE[n]){let i=globalThis.INFINITE[n].getState;clearInterval(r),t(()=>i)}},100);return()=>{clearInterval(r)}},[o.debugTarget]),typeof e=="function"?rt.createElement(_b.Provider,{value:{getState:e}},rt.createElement(uv,null)):null}var _b=rt.createContext({getState:()=>null});function uv(){let o=rt.useContext(_b),{getState:e}=o,[,t]=qt(),n=e().renderer.cellManager;(0,vr.useEffect)(()=>{let s=Nt(()=>{console.log("rerender"),t()},{wait:500});return n.onCellAttachmentChange(s)},[n,t]);let r=n.getRowsWithCells(),i=n.getColumnsWithCells(),a=(0,vr.useRef)(null),l=(0,vr.useRef)(null);return rt.createElement("div",{style:{overflow:"auto"}},(0,Mb.createPortal)(rt.createElement("div",{ref:a,style:{position:"absolute",top:0,left:0,width:"0px",height:"0px",pointerEvents:"none",background:"rgba(255, 0, 0, 0.5)",opacity:"0"}}),document.body),rt.createElement("table",{style:{borderCollapse:"collapse"}},rt.createElement("thead",null,rt.createElement("tr",null,i.map(s=>rt.createElement("th",{key:s,"data-col-index":s},s)))),rt.createElement("tbody",null,r.map(s=>rt.createElement("tr",{key:s,"data-row-index":s},i.map(c=>rt.createElement("td",{key:c,style:{padding:5,border:"1px solid gray",background:n.getCellAt([s,c])?.getNode()?"rgba(0, 255, 0, 0.3)":"rgba(255, 0, 0, 0.3)"},"data-col-index":c},rt.createElement("button",{onClick:()=>{let u=n.getCellAt([s,c])?.getElement();if(!u)return;let d=u.getBoundingClientRect();a.current.style.top=`${d.top}px`,a.current.style.left=`${d.left}px`,a.current.style.width=`${d.width}px`,a.current.style.height=`${d.height}px`,a.current.style.opacity="0.5",a.current.style.transition="opacity 0.5s",l.current&&clearTimeout(l.current),l.current=setTimeout(()=>{a.current.style.opacity="0",l.current=null},2e3),console.log(u)},style:{cursor:"pointer"}},"(",s,",",c,")"))))))))}var dv={CheckBox:zo,LoadMask:kl,MenuIcon:Zr,StringFilterEditor:$n,NumberFilterEditor:$i};0&&(module.exports={AutoScroller,CellSelectionState,DRAG_ITEM_ATTRIBUTE,DataClient,DataSource,DataSourceActionType,DeepMap,DragDropProvider,DragInteractionTarget,DragList,FixedSizeSet,FlashingColumnCell,GroupRowsState,INTERNAL_MatrixDebugger,InfiniteTable,InfiniteTableClassName,InfiniteTableComponent,Menu,RowDetailCache,RowDetailState,RowDisabledState,RowSelectionState,TreeDataSource,TreeExpandState,TreeGrid,TreeSelectionState,WeakFixedSizeSet,alignNode,components,createDefaultProxy,createFlashingColumnCellComponent,debounce,debug,defaultDragProxyMove,defaultFilterFunction,defaultFilterTypes,defaultTreeFilterFunction,eventMatchesKeyboardShortcut,filterDataArray,filterTypes,flatten,getComponentStateRoot,group,interceptMap,keyboardShortcuts,multisort,multisortNested,queryKeyToCacheKey,toTreeDataArray,useComponentState,useDataSourceApi,useDataSourceInternal,useDataSourceSelector,useDataSourceState,useDragDropProvider,useDragListContext,useEffectWhen,useEffectWhenSameDeps,useEffectWithChanges,useEffectWithObject,useGridScroll,useInfiniteColumnApi,useInfiniteColumnCell,useInfiniteColumnEditor,useInfiniteColumnFilterEditor,useInfiniteHeaderCell,useInfinitePortalContainer,useInfiniteTableApi,useLayoutEffectWithChanges,useManagedDataSource,useMasterRowInfo,useOverlay,useOverlayPortal,usePrevious,useRowInfoReducers,useVisibleColumnSizes,withSelectedLeafNodesOnly});
29
+ `,`You are using version "${e.version}" of Infinite Table, which was published on ${r.toDateString()}.`,"Please visit infinite-table.com to renew your license.","Thank you for playing fair!"],t),"expired"):"valid"};var Lw=n=>{let e="",t=n.split("|").map(l=>{let s=l.indexOf("="),c=s===-1?l:l.slice(0,s),u=s===-1?"":l.slice(s+1);return c==="C"&&(e=u),{name:c,value:u}});if(!e)throw"Invalid license";let o=e.split(",").reverse(),r=o.pop();o.forEach((l,s)=>{let c=t[s];if(Qc(c.value)!==l)throw"Invalid license"});let i=[...t];i.pop();let a=i.map(l=>`${l.name}=${l.value}`).join("|");if(Qc(a)!==r)throw"Invalid license";return t=t.map(l=>({...l,value:decodeURI(l.value)})),Nw(t)};function Ty(n="",e){if(e.isDetail)return"valid";let t=by(n,{publishedAt:1795695385989,version:"11.0.0"});return t==="invalid"&&!n?"missing":t}var Iy=(n="")=>{let t=!!En();return(0,Cy.useMemo)(()=>Ty(n,{isDetail:t}),[n,t])};var gr=require("react");var kw=10;function Ry(n,e,t){let o=(0,gr.useRef)(!1),r=(0,gr.useRef)(null);(0,gr.useEffect)(()=>{n!=null&&(o.current=!1,Kt(r.current))},[n]),(0,gr.useEffect)(()=>{if(n!=null&&!o.current){let a=function(l=0){l++,Kt(r.current),r.current=He(()=>{o.current=t.scrollCellIntoView(n[0],n[1],{offset:30}),!o.current&&l<kw&&a(l)})};var i=a;a()}return()=>{Kt(r.current)}},[n,e])}var hr=require("react"),zw=10;function wy(n,e,t){let o=(0,hr.useRef)(!1),r=(0,hr.useRef)(null);(0,hr.useEffect)(()=>{n!=null&&(o.current=!1,cancelAnimationFrame(r.current))},[n]),(0,hr.useEffect)(()=>{if(n!=null&&!o.current){let a=function(l=0){l++,r.current=requestAnimationFrame(()=>{o.current=t.scrollRowIntoView(n,{offset:0}),!o.current&&l<zw&&a(l)})};var i=a;a()}return()=>{cancelAnimationFrame(r.current)}},[n,e])}function vy(){return Mn()}var yr=require("react");function Py(n,e){n.getComputed().multiRowSelector.lastPointerDown={rowIndex:n.rowIndex,shiftKey:!!e.shiftKey},e.detail!==2&&void 0}var Vw={Enter:!0," ":!0,a:!0};function xy(n,e){let{getState:t,getDataSourceState:o,dataSourceActions:r,cloneRowSelection:i,cloneTreeSelection:a}=n,{key:l,ctrlKey:s,metaKey:c}=e;if(!Vw[l])return!1;let u=t(),d=o(),{activeRowIndex:p,activeCellIndex:f,keyboardNavigation:m,keyboardSelection:g}=u,{selectionMode:h,rowSelection:S,treeSelectionState:y,isTree:C}=d;if(g===!1)return!1;let T=m==="row"&&p!=null?p:m==="cell"&&f!=null?f[0]:null;if(!(T!=null?d.dataArray[T]:null)||T==null)return!1;if(l===" "&&(h==="single-row"||h==="multi-row")){let b={key:e.key,metaKey:e.metaKey,ctrlKey:e.ctrlKey,shiftKey:e.shiftKey,preventDefault:()=>e.preventDefault()};return pa({...n,rowIndex:T},b,"keyboard")}if(h!=="multi-row")return!1;if(l==="a"&&(s||c)){if(C&&y){let R=a(y);return R.selectAll(),r.treeSelection=R,!0}let b=i(S);return b.selectAll(),r.rowSelection=b,!0}return!1}var Dy=["input","textarea","select","[tabindex]","a[href]","button","object"].join(", "),My=n=>Array.from(n.querySelectorAll(Dy)).filter(t=>!!t.offsetParent),ml=n=>n.querySelector(Dy);var Ay=H(ro());async function Ey(n,e=10,t=300){return new Promise((o,r)=>{let i=Date.now();function a(){if(Date.now()-i>t)return r(!1);if(!n()){setTimeout(a,e);return}o(!0)}a()})}var Gw=10,Hw=(n,e)=>n-e;function gl(n,e){let{getComputed:t,getDataSourceState:o,getState:r,api:i,dataSourceApi:a}=e,{editingCell:l,isRowDetailEnabled:s}=r(),{dataArray:c}=o(),{computedVisibleColumns:u,computedColumnsMap:d}=t(),p=u[n.colIndex];if(!p)return!1;if(l&&l.columnId===p.id&&l.rowIndex===n.rowIndex)return!0;if(!p.contentFocusable)return!1;if(p.contentFocusable===!0)return!0;let f=c[n.rowIndex],m=!s||typeof s=="function"&&!s(f)?!1:i.rowDetailApi.isRowDetailExpanded(f.id)?"expanded":"collapsed",g=St(p.id,e);return p.contentFocusable({column:p,...nr({column:p,rowInfo:f,columnsMap:d,context:e,rowDetailState:m}).formattedValueContext,columnApi:g,api:i,dataSourceApi:a})}function Jc(n,e,t){let o=t.getState().editingCell;return Kw(n,e,t,{isCellFocusable:gl,isColumnElligible:i=>o&&o.columnId===i.id?!0:!!i.contentFocusable})}function _y(n,e,t){let o=(0,Ay.default)(t,n+e,Hw);return o<0&&(o=~o,e>0&&o>=t.length||e<0&&o===0)?null:t[o]??null}globalThis.getNextCol=_y;function Kw(n,e,t,o){let{isColumnElligible:r,isCellFocusable:i}=o,a=t.getComputed().computedVisibleColumns.filter(r).reduce((d,p)=>(d.push(p.computedVisibleIndex),d),[]);if(!a.length)return null;let{getDataSourceState:l}=t,{dataArray:s}=l(),c=n.rowIndex,u=n.colIndex;for(;c!=null||u!=null;){if(u=u===null?a[e===-1?a.length-1:0]:_y(u,e,a),u===null){if(c+=e,c<0||c>=s.length)return null;continue}if(i({colIndex:u,rowIndex:c},t))return{colIndex:u,rowIndex:c}}return null}async function Oy(n){let e={rowIndex:n.getDataSourceState().dataArray.length-1,colIndex:n.getComputed().computedVisibleColumns.length-1},t=gl(e,n)?e:Jc(e,-1,n);if(t){await eu([t.rowIndex,t.colIndex],n);let o=n.getState().getDOMNodeForCell(t);if(!o)return;ml(o)?.focus()}}async function eu([n,e],t){let{api:o}=t;return new Promise((r,i)=>{let a=Gw,l=null,s=!1;function c(u=0){u++,Kt(l),l=He(async()=>{if(s=o.scrollCellIntoView(n,e,{offset:30}),!s&&u<a&&c(u),s){try{await Ey(()=>!!t.getState().getDOMNodeForCell({rowIndex:n,colIndex:e}))}catch(d){i(d);return}r(!0)}})}c()})}var Bw=`.${nn}`;function Fy(n,e){if(e.key!=="Tab")return!1;let t=e.shiftKey?-1:1,o=e.target,r=n.getState().scrollerDOMRef.current,i=document.activeElement===r||o===r;if(!r||i&&t===-1)return!1;let a=i?null:Ln(o,Bw),l=null,s=null;if(a)l=Number(a.getAttribute("data-row-index")),s=Number(a.getAttribute("data-col-index"));else if(i){let{activeCellIndex:u}=n.getState();[l,s]=u||[0,0]}if(l==null||s==null||isNaN(l)||isNaN(s))return!1;let c=i&&gl({colIndex:s,rowIndex:l},n)?{rowIndex:l,colIndex:s}:Jc({rowIndex:l,colIndex:s},t,n);if(!c){if(t===-1)r.focus();else{let u=My(document.body),d=n.getState().focusDetectDOMRef.current,p=u.findIndex(m=>m===d);u[p+1]?.focus()}return!0}return eu([c.rowIndex,c.colIndex],n).then(()=>{let u=n.getState().getDOMNodeForCell(c);if(!u)return;ml(u)?.focus()}),!0}var Ny={control:"ctrl"},Ly={"control|cmd":"ctrl","cmd|control":"ctrl","ctrl|cmd":"ctrl","cmd|ctrl":"ctrl"},Ww={esc:"escape"},zy={cmd:n=>n.metaKey,alt:n=>n.altKey,ctrl:n=>n.ctrlKey,shift:n=>n.shiftKey},Vy=Object.keys(zy),tu=new Set(Vy),jw=new Set(["shift","alt"]);function hl(n,e){return Array.isArray(e)?e.some(t=>ky(n,t)):ky(n,e)}function ky(n,e){let t=n.key.toLowerCase(),o=e.split("+").map(p=>p.toLowerCase().trim()),r=o.find(p=>Ly[p]),i=o.map(p=>Ny[p]||Ly[p]||Ww[p]||p),a=i.filter(p=>tu.has(p)),l=i.filter(p=>!tu.has(p)),s=Vy.reduce((p,f)=>(p[f]=zy[f](n),p),{});r&&s.cmd&&(s.cmd=!1,s.ctrl=!0);let c=Object.keys(s).filter(p=>s[p]);if(!a.every(p=>s[p]===!0))return!1;if(l.includes("*")){if(c.length<a.length||c.filter(f=>!jw.has(f)).length)return!1}else if(a.length!=c.length)return!1;return!l.length||tu.has(t)||t==="meta"||Ny[t]?!1:l.reduce((p,f)=>p?f==="*"||t===f:!1,!0)}async function Gy(n,e){let t={...n,cloneRowSelection:a=>tr(a,n.getDataSourceState),cloneTreeSelection:a=>er(a,n.getDataSourceState)},{onKeyDown:o}=n.getState(),r={preventEdit:!1,preventEditStop:!1,preventDefaultForTabKeyWhenEditing:!0,preventSelection:!1,preventNavigation:!1};if(o){let a=o(n,e);a&&typeof a=="object"&&(r={...r,...a})}if(!r.preventSelection&&xy(t,e)&&e.preventDefault(),(Fy(t,e)||!n.getState().focusedWithin&&!r.preventNavigation&&kg(t,e))&&e.preventDefault(),!r.preventEdit&&e.key==="Enter"&&!n.api.isEditInProgress()){let{activeCellIndex:a}=n.getState();if(a){let[l,s]=a,c=n.getComputed().computedVisibleColumns[s];c.computedEditable&&n.api.startEdit({rowIndex:l,columnId:c.id})}}n.api.isEditInProgress()&&(e.key==="Escape"&&!r.preventEditStop&&n.api.stopEdit({cancel:!0}),e.key==="Tab"&&r.preventDefaultForTabKeyWhenEditing&&e.preventDefault());let{keyboardShortcuts:i}=n.getState();if(i)for await(let a of i){if(!hl(e,a.key)||a.when&&!await a.when(n))continue;let l=await a.handler(n,e);if(l&&l.stopNext)break}}function Uw(){let{getState:n,actions:e,api:t,getComputed:o,getDataSourceMasterContext:r}=Ke(),{getDataSourceState:i,dataSourceActions:a,dataSourceApi:l}=on();return(0,yr.useMemo)(()=>({getComputed:o,getDataSourceMasterContext:r,dataSourceApi:l,api:t,getState:n,actions:e,getDataSourceState:i,dataSourceActions:a,cloneTreeSelection:u=>er(u,i),cloneRowSelection:u=>tr(u,i)}),[n,e,i,a,t,l,o])}function $w(){let n=Uw();(0,yr.useEffect)(()=>{let e=n.getState().keyDown.onChange(a=>{Gy(n,a)});function t(a){if(!a)return;let l=a.event,s=n.getComputed().computedVisibleColumns[a.colIndex],c=St(s.id,n);Sf({...n,rowIndex:a.rowIndex,colIndex:a.colIndex,column:s,columnApi:c},{...l,key:""})}let o=n.getState().cellClick.onChange(t);function r(a){if(!a)return;let{event:l,rowIndex:s,colIndex:c}=a,u=n.getComputed().computedVisibleColumns[c],d=St(u.id,n);Py({...n,rowIndex:s,colIndex:c,column:u,columnApi:d},l)}let i=n.getState().cellMouseDown.onChange(r);return()=>{e(),o(),i()}},[])}function Yw(){let{getState:n}=te(t=>({getState:t.getState}));return{onKeyDown:(0,yr.useCallback)(t=>{n().keyDown(t)},[])}}function Hy(){return $w(),Yw()}var au=require("react");var Be=H(require("react")),_t=require("react"),$y=require("react-dom");var yl="__is_infinite_menu_component";function nu(n){return!!n.tagName}function Wy(n){let{alignTarget:e,alignAnchor:t,constrainTo:o,alignPosition:r}=n,i=_e.from(nu(e)?e.getBoundingClientRect():e),a=_e.from(nu(t)?t.getBoundingClientRect():t),l=o?_e.from(nu(o)?o.getBoundingClientRect():o):null;if(!l)return{...Ky({anchorRect:a,targetRect:i,position:r[0]}),index:0};let s=null;for(let c=0,u=r.length;c<u;c++){let d=Ky({anchorRect:a,targetRect:i,position:r[c],constrainRect:l});if(c===0&&(s={...d,index:0}),d.valid)return{...d,index:c}}return s}function Ky(n){let e=_e.from(n.targetRect),t=_e.from(n.anchorRect),o=n.constrainRect?_e.from(n.constrainRect):null,{position:r}=n,[i,a]=r,l=By(e,i),s=By(t,a),c=l.getDistanceToPoint(s);e.shift(c);let u=o?o.contains(e):!0;return{alignPosition:r,alignedRect:e,valid:u,distance:c}}function By(n,e){return e==="TopLeft"?je.from({top:n.top,left:n.left}):e==="TopCenter"?je.from({top:n.top,left:n.left+(n.width>0?Math.round(n.width/2):0)}):e==="TopRight"?je.from({top:n.top,left:n.left+n.width}):e==="BottomLeft"?je.from({left:n.left,top:n.top+n.height}):e==="BottomCenter"?je.from({left:n.left+(n.width>0?Math.round(n.width/2):0),top:n.top+n.height}):e==="BottomRight"?je.from({left:n.left+n.width,top:n.top+n.height}):e==="CenterLeft"?je.from({left:n.left,top:n.top+(n.height>0?Math.round(n.height/2):0)}):e==="CenterRight"?je.from({left:n.left+n.width,top:n.top+(n.height>0?Math.round(n.height/2):0)}):je.from({left:n.left+(n.width>0?Math.round(n.width/2):0),top:n.top+(n.height>0?Math.round(n.height/2):0)})}function qw(n){return n&&typeof n.then=="function"||n instanceof Promise}function Sl(n){return n==null||typeof n=="string"?!1:typeof n.tagName=="string"}async function jy(n){return typeof n=="function"&&(n=n()),qw(n)&&(n=await n),typeof n=="string"&&(n=document.querySelector(n)),n&&Sl(n)&&(n=n.getBoundingClientRect()),n?_e.from(n):null}async function Uy(n){let e=null;typeof n=="function"?e=n():e=n;function t(o){let r=null;return typeof o=="string"&&(r=document.querySelector(o)),Sl(o)&&(r=o),r||null}return t(await e)}async function bl(n,e){let{constrainTo:t,alignTo:o,alignPosition:r}=e;Object.keys(o).length===2&&o.top!==void 0&&o.left!==void 0&&(o={...o,width:0,height:0}),typeof t=="boolean"&&(t=t?document.documentElement.getBoundingClientRect():void 0);let i=t&&await jy(t)||void 0,a=o?await jy(o):void 0,l=_e.from(n.getBoundingClientRect());if(!a)return;let{alignedRect:s}=Wy({constrainTo:i,alignAnchor:a,alignTarget:l,alignPosition:r});n.style.transform=`translate3d(${s.left}px,${s.top}px, 0px)`;let c=n.getBoundingClientRect();if(c.left!==s.left||c.top!==s.top){let u=n.offsetParent;if(u){let d=u.getBoundingClientRect(),p=d.left,f=d.top,m=s.left-p,g=s.top-f;n.style.transform=`translate3d(${m}px,${g}px, 0px)`}}}function Xw(n){return Be.createElement("div",{style:{position:"fixed",top:0,left:0}},n.children)}function Zw(n){let e=Be.useRef(null);return(0,_t.useEffect)(()=>n.realign.onChange(t=>{e.current&&t&&bl(e.current,t)}),[n.realign]),Be.createElement("div",{style:{position:"absolute",top:0,left:0},ref:(0,_t.useCallback)(t=>{t&&bl(t,n),e.current=t},[])},typeof n.children=="function"?n.children():n.children)}function Yy(n,e){let[t,o]=(0,_t.useState)(null);(0,_t.useLayoutEffect)(()=>{async function a(){let l=e?await Uy(e):null;l!=null&&o(l)}e&&a()},[e]);let r=typeof e=="function"?e():null,i=Sl(r)?r:t;return e?i?(0,$y.createPortal)(n,i):Be.createElement(Be.Fragment,null):e===null||e===!1?n:Be.createElement(Xw,null,n)}function Qw(n){if(Be.Children.count(n)===1){let e=Be.Children.only(n);if(Be.isValidElement(e))return e.props.id||e.key}return null}function Jw(n,e,t){if(Be.Children.count(n)===1){let o=Be.Children.only(n);if(Be.isValidElement(o)&&o.type[yl]){let r={};return o.props.portalContainer===void 0&&(r.portalContainer=e),o.props.constrainTo===void 0&&(r.constrainTo=t),Be.cloneElement(o,r)}}return n}function ln(n){let e=n,[t]=(0,_t.useState)(()=>new Map),[o,r]=(0,_t.useState)(null),[i,a]=(0,_t.useState)(0),l=(0,_t.useCallback)(()=>{let m=[];for(let[g,h]of t)m.push(Be.createElement(Zw,{...h,key:h.key}));return m},[]),[s,c]=qt(),u=Yy(l(),n.portalContainer),d=(0,_t.useCallback)((m,g)=>{let S=`${g.id||Qw(m)||Vt()}`,y=t.get(S),C=b=>()=>{let R=typeof b=="function"?b():b;return Jw(R,e.portalContainer,g.constrainTo??e.constrainTo)},T=C(m),I=(b,R)=>{if(!y)return;let w=C(b);Object.assign(y,{children:w}),c(),!!!R?.skipRealign&&(r(y.key),a(Date.now()))};return y?(Object.assign(y,g),I(m),I):(y={key:S,children:T,alignPosition:g.alignPosition,alignTo:g.alignTo,constrainTo:g.constrainTo,realign:Se()},t.set(y.key,y),c(),I)},[t,e.portalContainer,c]);Be.useEffect(()=>{if(o){let m=t.get(o);m&&m.realign(m)}},[o,i]);let p=m=>{m=`${m}`,t.has(m)&&(t.delete(m),c())},f=()=>{t.clear(),c()};return Be.useEffect(()=>{},[]),{portal:u,hideOverlay:p,clearAll:f,rerenderOverlays:c,showOverlay:d}}var NS=H(require("react"));var Tr=H(require("react"));var lS=H(require("react"));var iS=H(require("react"));function Tl(n){return null}Tl.defaultProps={__is_menu_item:!0};var qy="submenu",ev="-";function Xy(){return{keyboardActiveItemKey:null,activeItemKey:null,generatedId:Vt(),focused:!1,destroyed:!1,domRef:{current:null}}}function Zy(){return{parentMenuId:1,parentMenuItemKey:1,onHideIntent:1,constrainTo:1,onAction:1,onShow:1,onHide:1,autoFocus:1,wrapLabels:1}}var ou=({columns:n,keyboardActiveItemKey:e,activeItemKey:t,menuId:o},r,i)=>{let a=r&&(r.key!=null||r.label!=null)?r:null,l=a===null?r===ev?i.renderSeparator():r:null;return a!=null?{type:"item",parentMenuId:o,disabled:!!a.disabled,keyboardActive:a.key===e,active:a.key===t,value:a,span:a.span||1,key:a.key,menu:a.menu||null,style:a.style,className:a.className,originalMenuItem:a}:{type:"decoration",value:l,span:n.length,style:{gridColumnStart:1,gridColumnEnd:n.length+10}}},tv=[{name:"label"}],Qy=(n,e)=>{let{props:t,state:o}=n,{activeItemKey:r,keyboardActiveItemKey:i}=o,{items:a,children:l,addSubmenuColumnIfNeeded:s,parentMenuId:c}=t,u=t.id||o.generatedId;c&&(u=`${c}-${u}`);let d=[...t.columns||tv],p={columns:d,keyboardActiveItemKey:i??null,activeItemKey:r??null,menuId:u},f=[];a?f=a.map(g=>ou(p,g,e)):!a&&typeof l!="function"&&(f=e.childrenToRuntimeItems?e.childrenToRuntimeItems(p,l):[]),s&&f.filter(h=>h.type==="item"&&h.menu!=null).length>0&&!d.find(h=>h.name==qy)&&d.push({name:qy,render:e.renderSubmenuColumn});let m=f.filter(g=>g.type==="item"&&!g.disabled);return{runtimeItems:f,runtimeSelectableItems:m,columns:d,menuId:u}};var Sr=H(require("react"));var Jy="db3arf0 _16lm1iw0 _16lm1iw1 _16lm1iw1w _16lm1iw2f _16lm1iw8",eS=he({defaultClassName:"db3arf2 _16lm1iw1p _16lm1iw2j _16lm1iw1x",variantClassNames:{disabled:{true:"db3arf3 _16lm1iwl _16lm1iw1x",false:"_16lm1iwk"},active:{true:"db3arf5",false:"db3arf6"},pressed:{false:"db3arf7",true:"db3arf8"},keyboardActive:{true:"db3arf9",false:"db3arfa"}},defaultVariants:{},compoundVariants:[[{active:!0,disabled:!1},"db3arfb"],[{pressed:!0,active:!0,disabled:!1},"db3arfc"]]}),tS="db3arf1",nS="db3arfd";function oS(){return Sr.createElement("hr",{className:nS})}var Cl={renderSeparator:()=>Sr.createElement(oS,null),renderSubmenuColumn:({domProps:n,item:e})=>e.menu?Sr.createElement("div",{...n},Sr.createElement(uo,{expanded:!1})):Sr.createElement("div",{...n})};var rS=(n,e)=>ou(n,e,Cl);function aS(n,e){return iS.Children.map(e,t=>{if(t&&(t.props.__is_menu_item||t.type===Tl)){let o={...t.props};return o.key||(o.key=t.key),o.description||(o.description=t.props.children),o.label||(o.label=o.children),rS(n,o)}return rS(n,t)})||[]}function sS(){return{...Xy(),domRef:lS.createRef()}}var cS=()=>Zy(),uS=n=>Qy(n,{...Cl,childrenToRuntimeItems:aS});var Yt=H(require("react")),Mt=require("react");var Il=require("react"),ru=(0,Il.createContext)(null);function iu(){return(0,Il.useContext)(ru)}function dS(n,e){let t=pS(n,e);if(!t.length)return null;let o=_e.from(t[0]?.getBoundingClientRect()),r=_e.from(t[t.length-1].getBoundingClientRect()),i=o;return i.width=r.left+r.width-o.left,i}function pS(n,e){let t=Ln(document.querySelector(`[data-menu-id="${n}"] [data-menu-item-key="${e}"]`),`[data-menu-id="${n}"]`);if(!t)return[];let o=t.querySelectorAll(`[data-menu-item-key="${e}"]`);return Array.from(o)}function fS(n,e){let t=pS(n,e);if(!t.length)return null;for(let o of t){let r=o.querySelector('input[type="checkbox"]');if(r)return r}return null}function mS(n){let e=n();e.onHideIntent?.(e)}function gS(n,e,t){let{getState:o,setActiveItemKey:r,setKeyboardActiveItemKey:i,hideAll:a}=t;i(e.key),r(e.key),e.originalMenuItem.onClick&&e.originalMenuItem.onClick(n);let l={key:e.key,item:e.originalMenuItem,hideMenu:a};e.originalMenuItem.onAction&&e.originalMenuItem.onAction(l);let{onAction:s}=o();s&&s(l),e.originalMenuItem.hideMenuOnAction&&a()}function hS(n,e){let{getState:t,setActiveItemKey:o,setKeyboardActiveItemKey:r,destroy:i,getSubmenuApi:a,isMounted:l,onItemClick:s}=e,{runtimeItems:c,runtimeSelectableItems:u,keyboardActiveItemKey:d}=t(),p=c.findIndex(S=>S.type==="item"&&S.key===d),f=d,m=c[p],g={ArrowUp:()=>{let S=c.slice(0,p).filter(y=>y.type==="item"&&!y.disabled).pop();S&&S.type==="item"&&S.key&&(f=S.key)},ArrowDown:()=>{let S=c.slice(p+1).filter(y=>y.type==="item"&&!y.disabled)[0];S&&S.type==="item"&&S.key&&(f=S.key)},Home:()=>{g.PageUp()},End:()=>{g.PageDown()},PageUp:()=>{f=u[0].key},PageDown:()=>{f=u[u.length-1].key},ArrowLeft:()=>{o(null),t().parentMenuId&&i()},ArrowRight:()=>{m&&(o(m.key),He(()=>{let S=a();l()&&S&&S.getParentMenuId()===t().menuId&&S.focus()}))},Enter:()=>{if(m)if(m.originalMenuItem?.menu){if(a()){g.ArrowLeft();return}o(m.key)}else s(n,m)}," ":()=>{if(!m)return;m.originalMenuItem.menu||s(n,m);let S=fS(t().menuId,m.key);S&&S.click()},Escape:()=>{g.ArrowLeft();let S=t();S.parentMenuId||S.onHideIntent?.(S)}},h=g[n.key];h&&(h(),n.preventDefault()),f!=d&&r(f)}function yS(n){let{getState:e,setFocused:t,setKeyboardActiveItemKey:o,shouldSelectFirstItemOnFocus:r,hideAll:i}=n,a=()=>{t(!0),setTimeout(()=>{let s=e().domRef.current;r()&&s&&s===document.activeElement&&e().keyboardActiveItemKey==null&&o(e().runtimeSelectableItems[0]?.key??null)})};return{api:{hideMenu:i,focus:()=>{let s=e().domRef.current;s&&(s.focus(),setTimeout(()=>{let c=e().domRef.current;c&&c!==document.activeElement&&c.focus()},10),a())},getMenuId:()=>e().menuId,getParentMenuId:()=>e().parentMenuId},onMenuFocus:a}}var mi=class extends qo{constructor(e){super(e.slice(0,3))}};var nv=250;function ov(n,e=100){let t=Date.now();return new Promise(o=>{let r,i=()=>{if(r=n(),r!==void 0){o(r);return}if(Date.now()-t>e){o(void 0);return}He(i)};He(()=>{i()})})}var rv=Fe(),Rl=class{constructor(e){this.activeItem=null;this.currentHoveredItem=null;this.activeItemLeavePoint=null;this.menuLeaveTimeoutId=null;this.activeItemMenuRect=null;this.lastPointerMoveTimestamp=0;this.mouseMoveTimeoutId=0;this.lastHorizontalDiff=0;this.getTimeout=()=>this.params.timeout||nv;this.getPointerMoveTarget=()=>document.documentElement||rv;this.removePointerMoveListener=()=>{this.getPointerMoveTarget().removeEventListener("pointermove",this.onPointerMoveWhileActiveItem)};this.onPointerMoveWhileActiveItem=e=>{if(clearTimeout(this.mouseMoveTimeoutId),!e){this.lastPointerMoveTimestamp=Date.now();return}if(!this.currentHoveredItem||this.currentHoveredItem===this.activeItem)return;let t=Date.now();this.lastPointerMoveTimestamp||(this.lastPointerMoveTimestamp=t);let r=t-this.lastPointerMoveTimestamp>this.getTimeout();this.lastPointerMoveTimestamp=t;let i=()=>{this.setActiveItem(null,null),this.onItemChange(!0,this.currentHoveredItem,e)};if(r){i();return}let a=this.currentHoveredItem;this.mouseMoveTimeoutId=setTimeout(()=>{if(a!==this.currentHoveredItem)return;Date.now()-this.lastPointerMoveTimestamp>this.getTimeout()&&i()},this.getTimeout());let l=new je({left:e.clientX,top:e.clientY});if(!this.activeItemMenuRect||!this.activeItemLeavePoint)return;let s=this.activeItemLeavePoint.left<this.activeItemMenuRect.left,u=(s?1:-1)*(l.left-this.activeItemLeavePoint.left);if(u-this.lastHorizontalDiff<0){this.lastHorizontalDiff=0,i();return}this.lastHorizontalDiff=u,(s?new mi([this.activeItemLeavePoint,this.activeItemMenuRect.getTopLeft(),this.activeItemMenuRect.getBottomLeft()]):new mi([this.activeItemLeavePoint,this.activeItemMenuRect.getTopRight(),this.activeItemMenuRect.getBottomRight()])).containsPoint(l)||(this.setActiveItem(null,null),this.onItemChange(!0,this.currentHoveredItem,e))};this.setupMenuLeaveTracking=()=>{this.menuLeaveTimeoutId=setTimeout(()=>{this.activeItem&&this.params.itemHasSubMenu(this.activeItem)||this.setActiveItem(null,null)},this.getTimeout())};this.setActiveItem=(e,t)=>{if(e!==this.activeItem){if(e==null){this.removePointerMoveListener(),this.params.onItemActivate(null,null),this.activeItem=null,this.activeItemMenuRect=null;return}this.activeItem=e,this.params.onItemActivate(e,t),this.activeItemMenuRect=null,ov(()=>this.activeItem!=e?!1:this.params.getMenuRectFor(e)).then(o=>{this.activeItem==e&&o&&(this.activeItemMenuRect=o)})}};this.onItemChange=(e,t,o)=>{if(clearTimeout(this.menuLeaveTimeoutId),clearTimeout(this.mouseMoveTimeoutId),!e){this.removePointerMoveListener(),t===this.activeItem&&(this.activeItemLeavePoint=new je({left:o.clientX,top:o.clientY})),this.setupMenuLeaveTracking();return}if(this.currentHoveredItem=t,!this.activeItem||!this.params.itemHasSubMenu(this.activeItem)){this.setActiveItem(t,o.target);return}this.onPointerMoveWhileActiveItem(),this.getPointerMoveTarget().addEventListener("pointermove",this.onPointerMoveWhileActiveItem)};this.getHandlers=()=>({onItemEnter:(e,t)=>{this.onItemChange(!0,e,t)},onItemLeave:(e,t)=>{this.onItemChange(!1,e,t)}});this.params=e}};function SS(n,e){let t=n.filter(o=>o.type==="item"&&e===o.key)[0];return t&&t.menu?t:null}function bS(n,e,t){let o=dS(n,e.key);return o?{id:`${n}-submenu`,alignTo:o,alignPosition:[["TopLeft","TopRight"],["TopRight","TopLeft"]],constrainTo:t}:null}function TS(n,e){let{parentMenuId:t,constrainTo:o,api:r,hideAll:i,setSubmenuApi:a,setActiveItemKey:l,setKeyboardActiveItemKey:s}=e,c=n.menu;if(!c)return null;typeof c=="function"&&(c=c());let u=c;return{parentMenuItemKey:n.key,parentMenuId:t,constrainTo:o,...u,autoFocus:!1,onShow:(d,p)=>{u?.onShow?.(d,p),a(p)},onHideIntent:d=>{u?.onHideIntent?.(d),i()},onHide:d=>{d.focused&&(l(null),s(n.key),r.focus())}}}function CS(n,e){return new Rl({parentMenuId:n().parentMenuId,onItemActivate:e,itemHasSubMenu:t=>!!n().runtimeItems.filter(r=>r.type==="item"&&r.key===t&&r.menu)[0],getMenuRectFor:t=>{let o=`[data-submenu-for="${t}"]`,r=document.querySelector(o);if(r)return _e.from(r.getBoundingClientRect())}}).getHandlers()}function IS(n,e,t=o=>o){let{columns:o,runtimeItems:r,wrapLabels:i}=n,a=o.map(s=>t(s.width||(typeof s.flex=="number"?`${s.flex}fr`:s.flex)||"auto")).join(" "),l={...e,gridTemplateColumns:a,gridTemplateRows:r.map(()=>"auto").join(" ")};return i||(l.whiteSpace="nowrap"),l}function RS(n,e,t,o){let{active:r,keyboardActive:i,pressed:a}=o,l=n.value.key,s=$(eS({active:r,disabled:!!n.disabled,keyboardActive:i,pressed:a||r}),n.className),c=[],u=0;return e.forEach((d,p)=>{let f=n.value,m=d.field||d.name,g=p+1,h=g+n.span;g<u||(u=h,c.push({key:`${l}-${m}`,column:d,value:f[m],style:{...d.style,...n.style,gridColumnStart:g,gridColumnEnd:h},className:s,dataAttributes:{"data-menu-column-id":`${n.parentMenuId}-col-${d.name}`,"data-menu-col-name":`${d.name}`,"data-menu-row-id":`${n.parentMenuId}-row-${t}`,"data-menu-row-index":`${t}`,"data-menu-item-key":`${n.key}`}}))}),c}var br=require("react");function wS(){let n=(0,br.useRef)(!0);return(0,br.useEffect)(()=>(n.current=!0,()=>{n.current=!1}),[]),(0,br.useCallback)(()=>n.current,[])}function iv(n,e){let t=`${e.parentMenuId}-submenu`,o=TS(n,e);return o?Yt.createElement(sn,{key:t,...o}):null}function av({onItemActivate:n}){let{getState:e}=iu(),[{onItemEnter:t,onItemLeave:o}]=(0,Mt.useState)(()=>CS(e,r=>{if(!r){n(null);return}let i=e().runtimeItems.filter(a=>a.type==="item"&&a.key===r)[0];n(i)}));return{onItemEnter:(0,Mt.useCallback)(t,[]),onItemLeave:(0,Mt.useCallback)(o,[])}}function vS(n){let{domProps:e}=n,{componentState:t,componentState:{columns:o,runtimeItems:r,menuId:i,activeItemKey:a,keyboardActiveItemKey:l,constrainTo:s,destroyed:c,onShow:u,onHide:d,autoFocus:p,parentMenuItemKey:f,domRef:m},componentActions:g,getState:h}=iu(),S=(0,Mt.useCallback)(_=>{g.keyboardActiveItemKey=_},[]),y=(0,Mt.useCallback)(_=>{g.activeItemKey=_},[]),C=wS(),[T,I]=(0,Mt.useState)(null),b=(0,Mt.useRef)(!0),[{api:R,onMenuFocus:w,hideAll:v}]=(0,Mt.useState)(()=>{let _=()=>mS(h);return{hideAll:_,...yS({getState:h,setFocused:k=>{g.focused=k},setKeyboardActiveItemKey:S,shouldSelectFirstItemOnFocus:()=>b.current,hideAll:_})}}),P=null;(0,Mt.useLayoutEffect)(()=>{let{runtimeItems:_}=h(),k=SS(_,a);if(!k){I(null),E();return}let K=bS(i,k,s);K&&M(()=>iv(k,{constrainTo:s,setSubmenuApi:I,setActiveItemKey:y,setKeyboardActiveItemKey:S,parentMenuId:i,hideAll:v,api:R}),K)},[a]);let D=(_,k)=>{gS(_,k,{getState:h,setActiveItemKey:y,setKeyboardActiveItemKey:S,hideAll:v})},{showOverlay:M,portal:x,clearAll:E}=ln({portalContainer:!1}),{onItemEnter:z,onItemLeave:V}=av({onItemActivate:_=>{if(!C())return;let k=_?_.key:null;y(k)}});P=r.map((_,k)=>Yt.createElement(lv,{key:_.type==="item"?_.key:k,onItemEnter:(K,Q)=>{z(K.key,Q)},onItemLeave:(K,Q)=>{V(K.key,Q)},columns:o,active:_.type==="item"&&_.key===a,keyboardActive:_.type==="item"&&_.key===l,item:_,index:k,onClick:D}));let N=IS(t,e.style);function L(_){hS(_,{getState:h,setActiveItemKey:y,setKeyboardActiveItemKey:S,destroy:()=>{g.destroyed=!0},getSubmenuApi:()=>T,isMounted:C,onItemClick:D})}function F(){g.focused=!1}let B=(0,Mt.useCallback)(_=>{_?(m.current=_,u?.(h(),R),p&&R.focus()):(d?.(h()),m.current=_)},[]),X=Yt.createElement("div",{className:zo.contents},Yt.createElement("div",{...e,"data-menu-id":i,"data-submenu-for":f,tabIndex:0,ref:B,onKeyDown:_=>{e.onKeyDown?.(_),L(_)},onMouseDown:_=>{b.current=!1,e.onMouseDown?.(_)},onMouseUp:_=>{b.current=!0,e.onMouseUp?.(_)},onFocus:w,onBlur:F,className:$(Jy,e.className,"InfiniteMenu"),style:N},P),x);return c?null:X}function lv(n){let[e,t]=Yt.useState(!1),{columns:o,item:r,index:i,active:a,keyboardActive:l}=n,s=null;return r.type==="decoration"?s=Yt.createElement("div",{style:r.style},r.value):s=RS(r,o,i,{active:a,keyboardActive:l,pressed:e}).map(c=>{let u=c.column,d={style:c.style,...c.dataAttributes,className:c.className,onPointerEnter:p=>{r.disabled||n.onItemEnter?.(r,p)},onPointerLeave:p=>{r.disabled||n.onItemLeave?.(r,p)},onMouseDown:()=>{r.disabled||t(!0)},onMouseUp:()=>{r.disabled||t(!1)},onClick:p=>{r.disabled||n.onClick(p,r)}};return u.render?Yt.createElement($r,{key:c.key,render:u.render,renderParam:{item:r.value,column:u,value:c.value,domProps:d}}):Yt.createElement("div",{key:c.key,...d},c.value)}),Yt.createElement("div",{className:tS},s)}var{ManagedComponentContextProvider:sv}=kt({initSetupState:sS,forwardProps:cS,mapPropsToState:uS,layoutEffect:!0});function cv(n){let{componentActions:e,componentState:t}=zt(),o=Le(t);return Tr.createElement(ru.Provider,{value:{componentActions:e,componentState:t,getState:o}},Tr.createElement(vS,{domProps:n.domProps}))}function sn(n){let{children:e,portalContainer:t,items:o,parentMenuId:r,addSubmenuColumnIfNeeded:i=!0,bubbleActionsFromSubmenus:a=!0,onShow:l,onHide:s,wrapLabels:c=!1,onAction:u,constrainTo:d,columns:p,parentMenuItemKey:f,autoFocus:m,id:g,onHideIntent:h,__is_infinite_menu_component:S,...y}=n;return Tr.createElement(sv,{addSubmenuColumnIfNeeded:i,bubbleActionsFromSubmenus:a,wrapLabels:c,...n},Tr.createElement(cv,{domProps:y}))}sn[yl]=!0;var OS=H(require("react"));function wl(n){let e=n?Array.isArray(n)?n:n.items:null,t=n&&!Array.isArray(n)?n.columns:void 0;return{items:e,columns:t}}function vl(n){let e=o=>{o.__insideMenu=!0},t=o=>{o.domRef.current?.parentNode?.removeEventListener("mousedown",e)};return{onShow:o=>{o.domRef.current?.parentNode?.addEventListener("mousedown",e)},onHide:t,onHideIntent:o=>{t(o),n?.()}}}function Pl(n){return{columns:[],items:[],autoFocus:!0,...vl(n.onHideIntent)}}function PS(n,e){let{items:t,columns:o}=wl(n);return t&&t.length?{...e,items:t||[],columns:o}:null}function xS(n,e){let{columnApi:t,column:o,getComputed:r,api:i,dataSourceApi:a}=n,s=t.isSortable()?[{key:"sort-asc",label:"Sort Ascending",disabled:o.computedSortedAsc,onAction:()=>{i.setSortingForColumn(o.id,1)}},{key:"sort-desc",label:"Sort Descending",disabled:o.computedSortedDesc,onAction:()=>{i.setSortingForColumn(o.id,-1)}},{key:"sort-none",label:"Unsort",disabled:!o.computedSorted,onAction:()=>{i.setSortingForColumn(o.id,null)}},"-"]:[];return[...o.groupByForColumn?[{key:"collapse-all",label:"Collapse All",onAction:()=>{i.collapseAllGroupRows()}},"-"]:[],...s,o.computedFilterable?{key:"clear-filter",label:"Clear Filter",disabled:!o.computedFiltered,onAction:()=>{i.clearColumnFilter(o.id)}}:null,o.computedFilterable?"-":null,{key:"pin-start",label:"Pin to start",disabled:o.computedPinned==="start",onAction:()=>{i.setPinningForColumn(o.id,"start")}},{key:"unpin",label:"Unpin",disabled:!o.computedPinned,onAction:()=>{i.setPinningForColumn(o.id,!1)}},"-",{key:"columns",label:"Columns",menu:()=>{let u=[];return r().computedColumnsMapInInitialOrder.forEach((p,f)=>{let m=e.getColumnLabel(p);u.push({key:f,label:m,check:e.renderCheckBox({key:p.id,disabled:p.computedVisible&&i.getVisibleColumnsCount()===1,checked:p.computedVisible,onChange:g=>{let h=!!g;i.setVisibilityForColumn(p.id,h),requestAnimationFrame(()=>{i.realignColumnContextMenu()})}})})}),{columns:[{name:"check"},{name:"label"}],items:u}}},"-",{key:"group-by",label:"Group by",menu:()=>{let u=[];return r().computedColumnsMapInInitialOrder.forEach((p,f)=>{if(p.groupByForColumn)return;let m=e.getColumnLabel(p);u.push({key:f,label:m,check:e.renderCheckBox({key:p.id,disabled:!p.computedGroupable,checked:p.computedGroupedBy,onChange:()=>{a.toggleGroupByField(p.field)}})})}),{columns:[{name:"check"},{name:"label"}],items:u}}}].filter(u=>!!u)}function DS(n,e,t,o){if(n==null)return null;let{getComputed:r,getState:i}=e,{getColumnMenuItems:a}=i(),l=r().computedColumnsMap.get(n);if(!l)return null;let s={column:l,columnApi:St(l.id,e),...e},c=o(s),u=a?a(c,s):c;return!u||!u.length?null:{autoFocus:!0,items:u,...vl(t)}}function MS(n,e,t,o){if(n==null)return null;let{getComputed:r,getState:i,getDataSourceState:a,actions:l,dataSourceApi:s,dataSourceActions:c,api:u}=e,{getFilterOperatorMenuItems:d}=i(),p=r().computedColumnsMap.get(n);if(!p)return null;let{filterTypes:f}=a(),m=f[p.computedFilterType];if(!m)return null;let g=m.operators.map(T=>{let I=T.name,b=p.computedFilterValue?p.computedFilterValue.filter.operator===I:I===m.defaultOperator;return{key:I,icon:o.renderOperatorIcon(T),label:o.renderOperatorLabel(T.label??T.name),onAction:()=>{u.setColumnFilterOperator(n,I)},checked:b?o.renderDoneIcon():null}}),S=[...[{key:"close",label:"Close Menu",icon:null,onAction:()=>{u.hideFilterOperatorMenu()}},{key:"reset",label:"Reset",icon:o.renderClearIcon(),disabled:!p.computedFiltered,onAction:()=>{u.clearColumnFilter(n)}},"-"],...g],y={column:p,api:u,getState:i,getDataSourceState:a,getComputed:r,actions:l,dataSourceApi:s,dataSourceActions:c,columnFilterValue:p.computedFilterValue,filterTypes:f},C=d?d(S,y):S;return{autoFocus:!0,columns:[{name:"icon"},{name:"label"},{name:"checked"}],items:C,...vl(t)}}function ES(n,e,t){let o=n instanceof Promise||Array.isArray(n)?!0:!!(n&&Array.isArray(n.items));if(n instanceof Promise)return{menu:t.renderLazyMenu(n,e),preventDefault:o};let{items:r,columns:i}=wl(n);return!r||!r.length?{menu:null,preventDefault:Array.isArray(r)}:{preventDefault:o,menu:t.renderMenu({...e,columns:i,items:r})}}function AS(n,e,t,o){let{columnId:r,rowIndex:i,event:a}=n,{getComputed:l,getState:s}=e,{getCellContextMenuItems:c}=s(),{computedColumnsMap:u}=l(),d=u.get(r),p={...tn({...e,rowIndex:i,columnId:d.id}),event:a};if(!d||!c)return{cellContext:p,menu:null,preventDefault:!1};let f=Pl({onHideIntent:t}),m=c(p,e);return{cellContext:p,...ES(m,f,o)}}function _S(n,e,t,o){let{getState:r,getComputed:i}=e,{getContextMenuItems:a}=r(),{computedColumnsMap:l}=i(),s=n.columnId?l.get(n.columnId):void 0,c=s?{...n,...tn({...e,rowIndex:n.rowIndex,columnId:s.id})}:n;if(!a)return{cellContext:c,menu:null,preventDefault:!1};let u=Pl({onHideIntent:t}),d=a(c,e);return{cellContext:c,...ES(d,u,o)}}function FS(n,e){let t=e.getState().components?.CheckBox||zn;return xS(e,{renderCheckBox:({key:o,...r})=>OS.createElement(t,{key:o,...r}),getColumnLabel:o=>Bo(o,e,"column-menu")})}function LS(n,e,t){let o=e.getState().components?.Menu??sn,r=DS(n,e,t,i=>FS([],i));return r?NS.createElement(o,{...r}):null}function kS(n){return typeof n=="function"?n():n}function gi(n){return kS(n.menuConstrainTo)??n.domRef.current}function zS(n,e,t){return e?()=>kS(e)??(t||n().portalDOMRef.current):t||!1}var VS=5,GS=[["TopLeft","BottomLeft"],["TopRight","BottomRight"],["BottomLeft","BottomLeft"],["BottomRight","BottomRight"],["TopCenter","TopLeft"],["BottomCenter","TopLeft"],["CenterLeft","TopLeft"],["CenterRight","TopLeft"]],xl=10;function HS(n){function e(t){t.__insideMenu!==!0&&n()}return document.documentElement.addEventListener("mousedown",e),()=>{document.documentElement.removeEventListener("mousedown",e)}}function hi(n,e,t){if(n)return HS(()=>{e(),t()});e()}function KS(n){let{getState:e,actions:t}=n;return o=>{o&&(e().columnMenuTargetRef.current=o.target,t.contextMenuVisibleFor=null,t.cellContextMenuVisibleFor=null,t.filterOperatorMenuVisibleForColumnId=null,t.columnMenuVisibleForColumnId=o.column.id)}}function uv(n){let{columnId:e,context:t,clearAll:o,show:r}=n,{getState:i,actions:a}=t,{columnMenuTargetRef:l,domRef:s}=i();function c(){o(),a.columnMenuVisibleForColumnId=null}let u=n.target;if(u||(u=l.current??void 0,u&&!s.current.contains(u)&&(u=void 0)),!u){let d=`[data-column-id="${e}"] ${Kf}`;u=i().domRef.current.querySelector(d)}if(!u){console.warn(`Cannot show column menu for column "${e}"`);return}l.current=null,r(c,{constrainTo:gi(i()),id:"column-menu",alignTo:u,alignPosition:[["TopLeft","BottomLeft"],["TopRight","BottomRight"]]})}function BS(n,e){let{getState:t,actions:o}=n,{clearAll:r}=e,{columnMenuVisibleForColumnId:i,columnMenuTargetRef:a}=t();if(i){let l=HS(()=>{r(),o.columnMenuVisibleForColumnId=null});return uv({columnId:i,context:n,clearAll:r,show:(s,c)=>e.show(i,s,c)}),l}a.current=null,r()}function WS(n){let e={top:n.clientY,left:n.clientX},t=_e.fromPoint(e);return t.width+=VS,t.height+=VS,{point:e,rect:t}}function jS(n,e){let{actions:t,getState:o,getDataSourceState:r}=n,{clearAll:i}=e;return a=>{if(!a)return;let{event:l}=a;function s(){i(),t.cellContextMenuVisibleFor=null}let c=e.getContent(a,s),{cellContext:u,preventDefault:d}=c,{rect:p}=WS(l);e.show(c,{constrainTo:gi(o()),id:"cell-context-menu",alignTo:p,alignPosition:GS}),d&&l.preventDefault(),t.cellContextMenuVisibleFor={columnId:a.columnId,rowId:a.rowId,rowIndex:a.rowIndex,colIndex:a.colIndex};let{onCellContextMenu:f}=o();f&&f({...u,getState:o,getDataSourceState:r},l)}}function US(n,e){let{actions:t,getState:o}=n,{clearAll:r}=e;return i=>{if(!i)return;let{event:a}=i;function l(){r(),t.contextMenuVisibleFor=null}let s=e.getContent(i,l),{cellContext:c,preventDefault:u}=s,{point:d,rect:p}=WS(a);e.show(s,{constrainTo:gi(o()),id:"table-context-menu",alignTo:p,alignPosition:GS}),u&&a.preventDefault(),t.contextMenuVisibleFor={point:d,...i};let{onContextMenu:f}=o();f&&f({...n,...c},a)}}function $S(n,e){let{getState:t,actions:o}=n,{clearAll:r}=e;return i=>{if(!i)return;let{target:a,column:l}=i;function s(){r(),o.filterOperatorMenuVisibleForColumnId=null}let c=a?.parentElement||a,u=_e.from(c.getBoundingClientRect());u.top-=xl,u.left-=xl,u.width+=2*xl,u.height+=2*xl,e.show(l.id,s,{constrainTo:gi(t()),id:"filter-operator-menu",alignTo:u,alignPosition:[["TopLeft","BottomLeft"],["TopRight","BottomRight"]]}),o.contextMenuVisibleFor=null,o.cellContextMenuVisibleFor=null,o.columnMenuVisibleForColumnId=null,o.filterOperatorMenuVisibleForColumnId=l.id}}var YS=require("react");function Po(){let{getState:n,menuPortalContainer:e}=te(r=>({getState:r.getState,menuPortalContainer:r.state.menuPortalContainer})),{portalDOMRef:t}=Mi(r=>({portalDOMRef:r.getMasterState().portalDOMRef}))||{},o=t?.current;return(0,YS.useMemo)(()=>zS(n,e,o),[n,e,o])}function qS(){let n=Ke(),{columnMenuVisibleForColumnId:e,columnMenuVisibleKey:t}=te(a=>({columnMenuVisibleForColumnId:a.state.columnMenuVisibleForColumnId,columnMenuVisibleKey:a.state.columnMenuVisibleKey})),{showOverlay:o,portal:r,clearAll:i}=ln({portalContainer:Po()});return(0,au.useEffect)(()=>n.getState().onColumnMenuClick.onChange(KS(n)),[]),(0,au.useEffect)(()=>BS(n,{clearAll:i,show:(a,l,s)=>o(()=>LS(a,n,l),s)}),[e,t]),{menuPortal:r}}var XS=H(require("react")),ZS=require("react");var dv={width:0,height:0,overflow:"hidden",pointerEvents:"none",outline:"none",zIndex:-1};function QS(){let{getState:n,api:e,actions:t,getComputed:o,dataSourceApi:r,dataSourceActions:i}=Ke(),{getDataSourceState:a,getDataSourceMasterContext:l}=on(),{focusDetectDOMRef:s}=n(),c=(0,ZS.useCallback)(async()=>{Oy({getDataSourceState:a,getDataSourceMasterContext:l,getComputed:o,actions:t,dataSourceActions:i,api:e,getState:n,dataSourceApi:r})},[]);return XS.createElement("div",{onFocus:c,ref:s,tabIndex:0,style:dv})}var Cr=require("react");function pv(){let n=Ke(),{getState:e,editingCell:t}=te(r=>({getState:r.getState,editingCell:r.state.editingCell})),o=t&&!t.active?t.cancelled:void 0;(0,Cr.useEffect)(()=>{if(o){let{onEditCancelled:r}=e(),i=e().editingCell;if(!r)return;let a=ai(n,i);if(!a){li("onEditCancelled",i);return}r({...a,initialValue:i.initialValue})}},[o])}function fv(){let n=Ke(),{getState:e,editingCell:t}=te(r=>({getState:r.getState,editingCell:r.state.editingCell})),o=t&&!t.active&&t.accepted instanceof Error?t.accepted:void 0;(0,Cr.useEffect)(()=>{if(o){let{onEditRejected:r}=e(),i=e().editingCell;if(!r)return;let a=ai(n,i);if(!a){li("onEditRejected",i);return}r({...a,value:i.value,error:o,initialValue:i.initialValue})}},[o])}function mv(){let n=Ke(),{editingCell:e}=te(r=>({editingCell:r.state.editingCell})),t=e?.active,o=On(t);(0,Cr.useEffect)(()=>{!t&&o&&n.api.focus()},[t,o])}function gv(){let n=Ke(),{editingCell:e,getState:t}=te(r=>({editingCell:r.state.editingCell,getState:r.getState})),o=e&&!e.active&&!e.cancelled&&e.accepted===!0;(0,Cr.useEffect)(()=>{if(o){let{onEditAccepted:r}=t(),i=t().editingCell,{value:a,initialValue:l}=i;if(r){let s=ai(n,i);s?r({...s,value:a,initialValue:l}):li("onEditAccepted",i)}n.api.persistEdit({value:a})}},[o])}function hv(){let n=Ke(),{editingCell:e,getState:t}=te(r=>({editingCell:r.state.editingCell,getState:r.getState})),o=e?e.persisted:void 0;(0,Cr.useEffect)(()=>{if(o){let{editingCell:r,onEditPersistError:i,onEditPersistSuccess:a}=t();if(!r)return;let l=o instanceof Error?"onEditPersistError":"onEditPersistSuccess";if(!t()[l])return;let s=ai(n,r);if(!s){li(l,r);return}let c={...s,value:r.value,initialValue:r.initialValue};o instanceof Error?i?.({...c,error:o}):a?.(c)}},[o])}function JS(){pv(),fv(),gv(),hv(),mv()}var cu=require("react");var Jn=H(require("react"));var lu=H(require("react"));var Dl=n=>lu.createElement(Ve,{...n,icon:"clear"},lu.createElement("path",{d:Ge.clear[0]}));var su=H(require("react"));var eb=n=>su.createElement(Ve,{...n,icon:"done"},su.createElement("path",{d:Ge.done[0]}));function tb(n,e,t){let o=e.getState().components?.Menu??sn,r=MS(n,e,t,{renderOperatorIcon:i=>{let a=i.components?.Icon??Ho;return Jn.createElement(a,null)},renderOperatorLabel:i=>Jn.createElement(Jn.Fragment,null,i),renderClearIcon:()=>Jn.createElement(Dl,null),renderDoneIcon:()=>Jn.createElement(eb,{size:16})});return r?Jn.createElement(o,{...r}):null}function nb(){let n=Ke(),{getState:e,actions:t}=n,{showOverlay:o,portal:r,clearAll:i}=ln({portalContainer:Po()});return(0,cu.useEffect)(()=>e().onFilterOperatorMenuClick.onChange($S(n,{clearAll:i,show:(a,l,s)=>o(()=>tb(a,n,l),s)})),[]),(0,cu.useEffect)(()=>hi(e().filterOperatorMenuVisibleForColumnId,i,()=>{t.filterOperatorMenuVisibleForColumnId=null}),[e().filterOperatorMenuVisibleForColumnId]),{menuPortal:r}}var yi=require("react");var rb=H(require("react"));var uu=H(require("react"));function ob(n,e,t){if(!n)return null;let o=Se();return n.then(r=>{let i=PS(r,e);i&&o(uu.createElement(t,{...i}))}),uu.createElement(jn,{updater:o})}function ib(n){let e=n.getState().components?.Menu??sn;return{renderMenu:t=>rb.createElement(e,{...t}),renderLazyMenu:(t,o)=>ob(t,o,e)}}function ab(n,e,t){return AS(n,e,t,ib(e))}function lb(n,e,t){return _S(n,e,t,ib(e))}function sb(){let n=Ke(),{getState:e,actions:t}=n,{showOverlay:o,portal:r,clearAll:i}=ln({portalContainer:Po()});return(0,yi.useEffect)(()=>e().cellContextMenu.onChange(jS(n,{clearAll:i,getContent:(a,l)=>ab(a,n,l),show:({menu:a},l)=>o(a,l)})),[]),(0,yi.useEffect)(()=>hi(e().cellContextMenuVisibleFor,i,()=>{t.cellContextMenuVisibleFor=null}),[e().cellContextMenuVisibleFor]),{menuPortal:r}}function cb(){let n=Ke(),{getState:e,actions:t}=n,{showOverlay:o,portal:r,clearAll:i}=ln({portalContainer:Po()});return(0,yi.useEffect)(()=>e().contextMenu.onChange(US(n,{clearAll:i,getContent:(a,l)=>lb(a,n,l),show:({menu:a},l)=>o(a,l)})),[]),(0,yi.useEffect)(()=>hi(e().contextMenuVisibleFor,i,()=>{t.contextMenuVisibleFor=null}),[e().contextMenuVisibleFor]),{menuPortal:r}}var ub=require("react"),db=H(require("react"));var Ml=require("react");function El(n,e){let{brain:t}=te(r=>({brain:r.state.brain})),o=(0,Ml.useCallback)(n,e);(0,Ml.useEffect)(()=>t.onScroll(o),[t,o])}var du="yzx0vj0";function pb(n){let{width:e,maxWidth:t,minWidth:o,scrollable:r,...i}=n,a=(0,ub.useRef)(null);El(s=>{a.current&&r!==!1&&(a.current.style.transform=`translate3d(${-s.scrollLeft}px, 0px, 0px)`)},[r]);let l={...i.style};return e==="column"?l.width=fe.runtime.totalVisibleColumnsWidthValue:e==="viewport"&&(l.width=fe.runtime.bodyWidth),o==="column"?l.minWidth=fe.runtime.totalVisibleColumnsWidthValue:o==="viewport"&&(l.minWidth=fe.runtime.bodyWidth),t==="column"?l.maxWidth=fe.runtime.totalVisibleColumnsWidthValue:t==="viewport"&&(l.maxWidth=fe.runtime.bodyWidth),db.createElement("div",{ref:a,...i,className:i.className?$(i.className,du):du,style:l},i.children)}var yv=Y(q.columnWidthAtIndex),Sv=Y(q.columnOffsetAtIndex);function fb(){let{computedVisibleColumns:n}=te(e=>({computedVisibleColumns:e.computed.computedVisibleColumns}));return n.map(e=>({id:e.id,width:e.computedWidth,cssVarForWidth:`var(${yv}-${e.computedVisibleIndex})`,offset:e.computedOffset,cssVarForOffset:`var(${Sv}-${e.computedVisibleIndex})`,pinned:e.computedPinned}))}var Al="InfiniteTable";var mb=require("react");function gb(){let{getState:n,actions:e,dataSourceActions:t,getDataSourceState:o}=te(u=>({getState:u.getState,actions:u.actions,dataSourceActions:u.dataSourceActions,getDataSourceState:u.getDataSourceState})),{groupBy:r,isTree:i}=o(),a=n(),{brain:l,wrapRowsHorizontally:s}=a,c=a.repeatWrappedGroupRows;s||(c=!1),(0,mb.useEffect)(()=>{if(!s){o().repeatWrappedGroupRows&&(t.repeatWrappedGroupRows=!1);return}let u=()=>{let{rowsPerPage:f,repeatWrappedGroupRows:m}=o(),g=!1,h=l.rowsPerPage,S=(r&&r.length>0||i)&&h>0?h:null;return f!=S&&(t.rowsPerPage=S,g=!0),m!=c&&(t.repeatWrappedGroupRows=c??!1,g=!0),g};u();let d,p=l.onVerticalRenderRangeChange(()=>{u()&&(d=setTimeout(()=>{e.forceBodyRerenderTimestamp=Date.now()}))});return()=>{d&&clearTimeout(d),p()}},[l,s,r,i,c])}var xo=require("react");function bv(){let n=[],e=t=>{Object.keys(t).forEach(o=>{let r=t[o];if(typeof r=="string"){let i=Y(r);if(i.includes("dont-override"))return;n.push(i)}else r&&typeof r=="object"&&e(r)})};return e({...fe,loaded:void 0,runtime:void 0}),n}function hb(n){if(!n)return{};let e=bv(),t=getComputedStyle(n),o={};return e.forEach(r=>{o[r]=t.getPropertyValue(r).trim()}),o}var Si=he({defaultClassName:"_143ofgf0",variantClassNames:{active:{true:"_143ofgf1",false:"_143ofgf2"}},defaultVariants:{},compoundVariants:[]}),yb="_143ofgf5",Sb="_143ofgf3";var Tv=Y(fe.loaded),pu={source:"infinite-table-page",target:"infinite-table-devtools-background"};function bb(n,e){let{type:t,debugId:o}=n;if(t==="unmount")return{...pu,url:fu(),type:t,payload:{debugId:o}};let r=e,i=r.getComputed(),a=r.getDataSourceState(),l=r.getState();return{...pu,url:fu(),type:t,payload:{debugId:o,columnVisibility:l.columnVisibility,columnOrder:i.computedColumnOrder,visibleColumnIds:i.computedVisibleColumns.map(c=>c.id),selectionMode:a.selectionMode,columns:Object.fromEntries(i.computedVisibleColumns.map(c=>[c.id,{field:c.field,dataType:c.computedDataType,sortType:c.computedSortType,filtered:c.computedFiltered,sorted:c.computedSorted,width:c.computedWidth}])),groupRenderStrategy:l.groupRenderStrategy,groupBy:a.groupBy.map(c=>c.field?`${c.field}`:"<fn>"),sortInfo:(a.sortInfo||[]).filter(c=>typeof c.field=="string").map(c=>({field:`${c.field}`,dir:c.dir,type:Array.isArray(c.type)?c.type[0]:c.type??"string"})),multiSort:a.multiSort,devToolsDetected:l.devToolsDetected,debugTimings:Object.fromEntries(a.debugTimings),debugWarnings:{...Object.fromEntries(a.debugWarnings),...Object.fromEntries(l.debugWarnings)},themeVars:hb(l.domRef.current),themeVarOverrides:{...rn.get(o)||{}}}}}var fu=ht(function(){let n=new URL(window.location.href);return n.origin+n.pathname});function Cv(n){window.postMessage(n)}var Iv=ht(()=>{console.log("Infinite Table DevTools detected!");let n=(e,t)=>{if(t){Tt.set(e,t);let{devToolsDetected:o}=t.getState();o||(t.actions.devToolsDetected=!0);let r=t.getDataSourceState();r.debugId!==e&&(t.dataSourceActions.debugId=e),r.devToolsDetected||(t.dataSourceActions.devToolsDetected=!0),window.postMessage(bb({type:"update",debugId:e},t))}else Mh(e),window.postMessage(bb({type:"unmount",debugId:e},null))};return window.__INFINITE_TABLE_DEVTOOLS_HOOK__=n,Ye.onLogIntent("IT:*",e=>{Cv({...pu,url:fu(),type:"log",payload:{debugId:void 0,channel:e.channel,color:e.color,args:e.args.map(t=>{if(typeof t=="object"&&t!==null){let o="";try{o=JSON.stringify(t)}catch{console.error("Cannot stringify arg in global log interceptor",t)}return o}return String(t)}),timestamp:e.timestamp}})}),n});function Tb(){let{getState:n,getDataSourceState:e,dataSourceActions:t}=te(a=>({getState:a.getState,getDataSourceState:a.getDataSourceState,dataSourceActions:a.dataSourceActions})),o=n(),{domRef:r,debugId:i}=o;return i&&r.current&&getComputedStyle(r.current).getPropertyValue(Tv)!==`${$i}`&&si({debugId:i,key:"CSS001_CSS"}),(0,xo.useEffect)(()=>{e().debugId!==i&&(t.debugId=i)},[i]),vv()}var _l=Se(),Rv={revertAll:n=>{let e=Tt.get(n.debugId);if(e){let t=Xn.get(n.debugId);Xn.delete(n.debugId),Cn.delete(n.debugId),t&&Object.keys(t).forEach(r=>{e.actions[r]=t[r],delete t[r]});let o=Rn.get(n.debugId);Rn.delete(n.debugId),In.delete(n.debugId),o&&Object.keys(o).forEach(r=>{e.dataSourceActions[r]=o[r],delete o[r]})}},revertProperty:n=>{let e=Tt.get(n.debugId);if(e){let t=n.property,o=Cn.get(n.debugId),r=Xn.get(n.debugId),i=In.get(n.debugId),a=Rn.get(n.debugId),l=t;r&&o&&o[l]!==void 0&&(delete o[l],e.actions[l]=r[l],delete r[l]);let s=t;if(a&&i&&i[s]!==void 0){let c=Rn.get(n.debugId)||{};delete i[s],e.dataSourceActions[s]=c[s],delete c[s]}}},discardWarning:n=>{let e=Tt.get(n.debugId);if(e){let t=n.warning,o=e.getDataSourceState().debugWarnings;if(o.get(t))o.delete(t),Zn(n.debugId);else{let i=n.warning,a=e.getState().debugWarnings;a.get(i)&&(a.delete(i),Zn(n.debugId))}}},discardAllWarnings:n=>{let e=Tt.get(n.debugId);e&&(e.getDataSourceState().debugWarnings.clear(),e.getState().debugWarnings.clear(),Zn(n.debugId))},setColumnVisibility:n=>{Gc(n.debugId,"columnVisibility",n.columnVisibility)},setGroupBy:n=>{ll(n.debugId,"groupBy",n.groupBy)},setGroupRenderStrategy:n=>{Gc(n.debugId,"groupRenderStrategy",n.groupRenderStrategy)},setSortInfo:n=>{ll(n.debugId,"sortInfo",n.sortInfo)},setMultiSort:n=>{ll(n.debugId,"multiSort",n.multiSort)},setCssVar:n=>{let e=Tt.get(n.debugId),t=e?.getState().domRef.current;!e||!t||!n.name?.startsWith("--infinite-")||(t.style.setProperty(n.name,n.value),rn.set(n.debugId,{...rn.get(n.debugId)||{},[n.name]:n.value}),Zn(n.debugId))},revertCssVar:n=>{let e=Tt.get(n.debugId),t=e?.getState().domRef.current;if(!e||!t)return;t.style.removeProperty(n.name);let o={...rn.get(n.debugId)||{}};delete o[n.name],rn.set(n.debugId,o),Zn(n.debugId)},revertAllCssVars:n=>{let e=Tt.get(n.debugId),t=e?.getState().domRef.current;if(!e||!t)return;let o=rn.get(n.debugId)||{};Object.keys(o).forEach(r=>{t.style.removeProperty(r)}),rn.delete(n.debugId),Zn(n.debugId)},highlight:n=>{let e=Tt.get(n.debugId);if(e){let t=e.getState().domRef.current;if(t){let o=t.getBoundingClientRect(),r=document.querySelector(`.${Si.classNames.base}`);r||(r=document.createElement("div"),r.classList.add(Si.classNames.base),r.innerHTML=[`<div class="${Sb}"></div>`,`<div class="${yb}"></div>`].join(""),document.body.appendChild(r));let i=r.firstElementChild;if(r){r.style.left=`${o.left}px`,r.style.top=`${o.top}px`,r.style.width=`${o.width}px`,r.style.height=`${o.height}px`,i.innerHTML=n.debugId;let a=r.lastElementChild,l=()=>{r.classList.remove(Si.classNames.variants.active.true),a.removeEventListener("animationend",l)};a.addEventListener("animationend",l),r.classList.add(Si.classNames.variants.active.true)}}}}};function wv(){typeof window<"u"&&window.addEventListener("message",n=>{if(n&&n.data&&typeof n.data.source=="string"&&typeof n.data.target=="string"&&n.data.target==="infinite-table-page"&&n.data.source.startsWith("infinite-table-devtools-contentscript")&&(window.__INFINITE_TABLE_DEVTOOLS_HOOK__||(Iv(),_l(window.__INFINITE_TABLE_DEVTOOLS_HOOK__)),typeof n.data.type=="string")){let e=n.data.type,t=Rv[e];t&&t(n.data.payload)}})}wv();function vv(){let{getState:n,getComputed:e,getDataSourceState:t,dataSourceActions:o,actions:r,dataSourceApi:i,api:a}=te(u=>({getState:u.getState,getComputed:u.getComputed,getDataSourceState:u.getDataSourceState,dataSourceActions:u.dataSourceActions,actions:u.actions,dataSourceApi:u.dataSourceApi,api:u.api})),s=n().debugId,c=(0,xo.useRef)(s);return c.current=s,(0,xo.useEffect)(()=>{let u=c.current;if(!u)return;let d=f=>{f(u,{getState:n,getDataSourceState:t,getComputed:e,dataSourceActions:o,actions:r,api:a,dataSourceApi:i})},p=_l.get();if(p){d(p);return}return _l.onChange(f=>{f&&d(f)})},[]),(0,xo.useEffect)(()=>{let u=c.current;if(!u)return;let d=_l.get();d&&d(u,{getState:n,getDataSourceState:t,getComputed:e,dataSourceActions:o,actions:r,api:a,dataSourceApi:i})}),(0,xo.useEffect)(()=>{if(s)return()=>{let u=globalThis.__INFINITE_TABLE_DEVTOOLS_HOOK__;u&&u(s,null)}},[s]),s}function Cb(){let{masterPortalDOMRef:n}=Mi(o=>({masterPortalDOMRef:o.getMasterState().portalDOMRef}))??{},e=te(o=>o.state.portalDOMRef);return n?.current??e?.current}var Ot=H(require("react")),Ol=require("react");var Ib="hs68h8j _16lm1iwk _16lm1iwx _16lm1iw2n",Rb=he({defaultClassName:"hs68h8e _16lm1iw1x _16lm1iw2j _16lm1iw1p",variantClassNames:{active:{true:"hs68h8f _16lm1iwn _16lm1iw1h",false:"_16lm1iwo"},draggingInProgress:{true:"hs68h8h",false:"hs68h8i"}},defaultVariants:{},compoundVariants:[]}),wb="hs68h81",vb=he({defaultClassName:"hs68h80 _16lm1iw1p",variantClassNames:{orientation:{horizontal:"_16lm1iw2h _16lm1iw2j",vertical:"_16lm1iw2f"},draggingInProgress:{true:"_16lm1iw1h",false:"hs68h86"},dropRejected:{true:"hs68h87",false:"hs68h88"},active:{true:"hs68h89",false:"hs68h8a"}},defaultVariants:{},compoundVariants:[[{dropRejected:!0,active:!0},"hs68h8b"],[{dropRejected:!1,active:!0},"hs68h8c"],[{active:!1,dropRejected:!1},"hs68h8d"]]});var Do=H(require("react"));function Pb(n){return Do.createElement("div",{...n.domProps})}function xb(n){let{active:e}=n;return Do.createElement("div",{className:wb},e?"Drop to group":"Drag columns to group")}function Db(n){let e=t=>{(t.key==="Enter"||t.key===" ")&&(t.preventDefault(),n.onClear?.())};return Do.createElement("div",{...n.domProps},n.label,Do.createElement("div",{className:Fi[1]}),Do.createElement("div",{tabIndex:0,role:"button","aria-label":`Clear grouping by ${n.field}`,className:Ib,onKeyDown:e,onMouseDown:n.onClear},Do.createElement(Dl,{size:20})))}var Pv=(n,e)=>t=>{e&&e(t);let o=Date.now(),r=!1,i=()=>{r=!0};Fe().addEventListener("mousemove",i,{once:!0}),Fe().addEventListener("mouseup",()=>{r||(Fe().removeEventListener("mousemove",i),Date.now()-o<200&&requestAnimationFrame(()=>{n()}))},{once:!0})};function xv(n){let{column:e,onClear:t,components:o,field:r,id:i,toggleSorting:a}=n,{dragSourceListId:l,dragItemId:s,dragListId:c}=go(),u=l===c,d=Ke(),p=(e?Bo(e.id,d,"grouping-toolbar"):r)??i,f=e?Ot.createElement(Sa,{forceSize:!0,size:20,direction:e.computedSortedAsc?1:e.computedSortedDesc?-1:0}):null,m=Ot.createElement(Ot.Fragment,null,p,f),g=s===i&&l===c,h=$(Rb({draggingInProgress:u,active:g}),n.domProps?.className),S=Pv(a,n.domProps?.onMouseDown),y={...n.domProps,className:h,onMouseDown:S},C=o?.ToolbarItem??Db;return Ot.createElement(C,{active:g,domProps:y,column:e,field:r,label:m,onClear:t})}function Mb(n){let{groupBy:e}=Ne(b=>({groupBy:b.dataSourceState.groupBy})),{getComputed:t,dataSourceApi:o,api:r}=te(b=>({getComputed:b.getComputed,dataSourceApi:b.dataSourceApi,api:b.api})),{dropTargetListId:i,dragSourceListId:a}=fn(),{fieldsToColumn:l,computedColumnsMap:s}=t(),c=lo(ta),u=lo(ea),d=(0,Ol.useMemo)(()=>[u,c],[u,c]),p=i===c,f=a===c,m=n.components?.Placeholder??xb,g=n.components?.Host??Pb,h=e.length?Ot.createElement(Ot.Fragment,null,e.map((b,R)=>{let w=b.field?l.get(b.field):void 0,v=`${b.field??`idx-${R}`}`;return Ot.createElement(Wn.DraggableItem,{key:v,id:v},P=>Ot.createElement(xv,{id:v,components:n.components,domProps:P,field:b.field,column:w,toggleSorting:()=>{w&&r.toggleSortingForColumn(w.id)},onClear:()=>{let D=e.filter(M=>M!==b).filter(Boolean);o.setGroupBy(D)}}))})):Ot.createElement(m,{draggingInProgress:f,active:p,groupBy:e}),S=b=>{let R=b.map(w=>e[w]);o.setGroupBy(R)},y=b=>{let{dragItemId:R}=b,w=R,v=s.get(w);if(!v||!v.field||!v.computedGroupable)return;let P=[...e];P.splice(b.dropIndex,0,{field:v.field}),o.setGroupBy(P)},C=(0,Ol.useCallback)(b=>{let{computedColumnsMap:R}=t(),w=b.dragItem.id,v=R.get(w);return!(!v||!v.computedGroupable||e.some(P=>P.field===v.field))},[e]),T=n.orientation??"horizontal",{domProps:I}=n;return Ot.createElement(Wn,{orientation:T,dragListId:c,acceptDropsFrom:d,onDrop:S,dragStrategy:"inline",onAcceptDrop:y,shouldAcceptDrop:C},(b,{draggingInProgress:R,status:w})=>{let v=$(vb({active:p,orientation:T,draggingInProgress:R,dropRejected:w==="rejected"}),b.className,I?.className),P={...b,...I,className:v,children:h};return Ot.createElement(g,{active:p,rejectDrop:w==="rejected",domProps:P,orientation:T})})}var Rr=H(require("react"));var Fl=require("react"),cn=require("react"),Nl=H(require("react"));function Eb(n){let{dataArray:e,brain:t,computedPinnedEndColumns:o,computedPinnedStartColumns:r,computedVisibleColumns:i,computedRowHeight:a,columnSize:l,rowspan:s}=n;return Ga(t,{colWidth:l,rowHeight:a,rows:e.length,cols:i.length,rowspan:s},{fixedColsEnd:o.length,fixedColsStart:r.length}),t}var vn=H(require("react"));var Ab=he({defaultClassName:"evqes20",variantClassNames:{},defaultVariants:{},compoundVariants:[]});var mu=require("react");function Dv(n,e){let{masterState:t,detailContext:o}=e,r=t.detailDataSourcesStateToRestore;if(r.has(n)){let i=r.get(n);return o.assignState(i),!0}return!1}function Mv(n,e){let{detailState:t,masterState:o,masterActions:r,cacheEntryForRow:i}=e,a=new Map(o.detailDataSourcesStateToRestore),l=hh(t);i.all||(i.groupBy||delete l.groupBy,i.sortInfo||delete l.sortInfo,i.filterValue||delete l.filterValue,i.data||delete l.originalDataArray),a.set(n,l),r.detailDataSourcesStateToRestore=a}function _b(n,e){let t={current:!1};return{currentRowCache:{getRowId:()=>n,add:r=>{t.current=!0,e.add(n,r)},get:()=>e.get(n),delete:()=>(t.current=!0,e.delete(n)),has:()=>e.has(n)},cacheCalledByRowDetailRenderer:t}}function Ob(n){let{rowInfo:e,currentRowCache:t,cacheCalledByRowDetailRenderer:o,getMasterDataSourceState:r,masterActions:i,getMasterState:a}=n,l=r().detailDataSourcesStateToRestore.has(e.id)&&t.has(),c={registerDetail:ht(u=>{if(o.current||t.add({all:!0}),!t.has()){requestAnimationFrame(()=>{u.dataSourceState.destroyedRef.current||(u.dataSourceActions.stateReadyAsDetails=!0)});return}Dv(e.id,{masterState:r(),detailContext:u}),requestAnimationFrame(()=>{u.dataSourceState.destroyedRef.current||(u.dataSourceActions.stateReadyAsDetails=!0)}),u.dataSourceState.onCleanup.onChange(()=>{let d=t.get();d&&Mv(e.id,{detailState:u.getDataSourceState(),masterActions:i,masterState:r(),cacheEntryForRow:d})})}),shouldRestoreState:l};return c.masterRowInfo=e,c.getMasterDataSourceState=r,c.getMasterState=a,c}function Fb(n){let{rowDetailsCache:e,rowInfo:t}=n,{getDataSourceState:o,dataSourceActions:r}=Ne(c=>({getDataSourceState:c.getDataSourceState,dataSourceActions:c.dataSourceActions})),{getMasterState:i}=te(c=>({getMasterState:c.getState})),{currentRowCache:a,cacheCalledByRowDetailRenderer:l}=(0,mu.useMemo)(()=>_b(t.id,e),[e,t.id]),s=(0,mu.useMemo)(()=>Ob({rowInfo:t,currentRowCache:a,cacheCalledByRowDetailRenderer:l,getMasterDataSourceState:o,masterActions:r,getMasterState:i}),[t.id,a]);return s.masterRowInfo=t,s.getMasterDataSourceState=o,s.getMasterState=i,{masterDetailContextValue:s,currentRowCache:a}}function Nb(){return Mn()}var{rootClassName:Ev}=ze,Av=`${Ev}RowDetail`;function _v(n){let{domRef:e,rowDetailRenderer:t,rowDetailHeight:o,rowInfo:r,detailOffset:i,rowDetailsCache:a}=n,{masterDetailContextValue:l,currentRowCache:s}=Fb({rowDetailsCache:a,rowInfo:r}),c=No(),[u]=vn.useState(()=>Nb());return u.setSnapshot(l),vn.useLayoutEffect(()=>{u.notify()},[l]),vn.createElement(c.Provider,{value:u},vn.createElement("div",{ref:e,className:$(Av,Ab({})),style:{position:"absolute",top:`${i}px`,left:0,width:`calc(${q.bodyWidth} - ${q.scrollbarWidthVertical})`,height:o}},t(r,s)))}var Lb=vn.memo(_v);var Ov=1;function kb(n){let{computed:e,bodySize:t,imperativeApi:o}=n,{actions:r,getState:i,getComputed:a,getDataSourceMasterContext:l,rowHeight:s,rowDetailHeight:c,onRowMouseEnter:u,onRowMouseLeave:d,groupRenderStrategy:p,brain:f,showZebraRows:m,rowDetailRenderer:g,isRowDetailsExpanded:h,isRowDetailsEnabled:S,cellClassName:y,cellStyle:C,repaintCellsKey:T,rowStyle:I,rowDetailCache:b,rowClassName:R,onScrollToTop:w,onScrollToBottom:v,onScrollStop:P,scrollToBottomOffset:D,wrapRowsHorizontally:M,updatedAt:x,ready:E,editingCell:z}=te(O=>({actions:O.actions,getState:O.getState,getComputed:O.getComputed,getDataSourceMasterContext:O.getDataSourceMasterContext,rowHeight:O.state.rowHeight,rowDetailHeight:O.state.rowDetailHeight,onRowMouseEnter:O.state.onRowMouseEnter,onRowMouseLeave:O.state.onRowMouseLeave,groupRenderStrategy:O.state.groupRenderStrategy,brain:O.state.brain,showZebraRows:O.state.showZebraRows,rowDetailRenderer:O.state.rowDetailRenderer,isRowDetailsExpanded:O.state.isRowDetailExpanded,isRowDetailsEnabled:O.state.isRowDetailEnabled,cellClassName:O.state.cellClassName,cellStyle:O.state.cellStyle,repaintCellsKey:O.state.repaintCellsKey,rowStyle:O.state.rowStyle,rowDetailCache:O.state.rowDetailCache,rowClassName:O.state.rowClassName,onScrollToTop:O.state.onScrollToTop,onScrollToBottom:O.state.onScrollToBottom,onScrollStop:O.state.onScrollStop,scrollToBottomOffset:O.state.scrollToBottomOffset,wrapRowsHorizontally:O.state.wrapRowsHorizontally,updatedAt:O.state.updatedAt,ready:O.state.ready,editingCell:O.state.editingCell})),{computedPinnedStartColumns:V,computedPinnedEndColumns:N,computedVisibleColumns:L,computedColumnsMap:F,computedColumnOrder:B,computedRowHeight:X,computedRowSizeCacheForDetails:_,fieldsToColumn:k,rowspan:K,toggleGroupRow:Q,columnSize:Ie}=e,se=(0,Fl.useMemo)(()=>L.map(O=>O.id),[L]),{dataArray:me,rowInfoStore:ve,selectionMode:Pe,cellSelection:ue,isNodeReadOnly:oe,getDataSourceState:ce,dataSourceApi:pe,dataSourceActions:Z}=Ne(O=>({dataSourceApi:O.dataSourceApi,dataSourceActions:O.dataSourceActions,getDataSourceState:O.getDataSourceState,dataArray:O.dataSourceState.dataArray,rowInfoStore:O.dataSourceState.rowInfoStore,selectionMode:O.dataSourceState.selectionMode,cellSelection:O.dataSourceState.cellSelection,isNodeReadOnly:O.dataSourceState.isNodeReadOnly})),J=Le(me);Eb({columnSize:Ie,brain:f,computedPinnedStartColumns:V,computedPinnedEndColumns:N,computedVisibleColumns:L,computedRowHeight:X,dataArray:me,bodySize:t,rowspan:K});let W=(0,cn.useRef)(0);(0,cn.useEffect)(()=>f.onRenderCountChange(()=>{W.current=f.scrollTopMax}),[f]),(0,cn.useEffect)(()=>f.onRenderRangeChange(O=>{i().onRenderRangeChange?.(O)}),[f]),(0,cn.useEffect)(()=>f.onScrollStop(O=>{let{scrollTop:A,scrollLeft:de}=O;if(A===0&&w?.(),A+(D??Ov)>=W.current){v?.();let{livePagination:be,livePaginationCursor:Me,dataArray:qe}=ce();be&&(Z.cursorId=Me!==void 0?Date.now():qe.length)}if(P){let be=f.getRenderRange();P({scrollTop:A,scrollLeft:de,renderRange:be,viewportSize:i().bodySize,firstVisibleRowIndex:be.start[0],lastVisibleRowIndex:be.end[0],firstVisibleColIndex:be.start[1],lastVisibleColIndex:be.end[1]})}}),[f,w,v,P]),(0,cn.useEffect)(()=>{t.height&&(r.ready=!0)},[!!t.height]),(0,cn.useEffect)(()=>{let{onReady:O}=i();O&&O({api:o,dataSourceApi:pe})},[E]);let ie=(0,Fl.useMemo)(()=>({isNodeReadOnly:oe,selectionMode:Pe,cellSelection:ue}),[oe,Pe,ue]),ne=(0,cn.useCallback)(O=>{let{rowIndex:A,colIndex:de,heightWithRowspan:ye,domRef:we,hidden:be,width:Me,onMouseLeave:qe,onMouseEnter:We}=O,at=J()[A],et=L[de];if(!at||!et)return null;let Xe=_?_.getRowHeight(A):ye,G=!1;!S||typeof S=="function"&&!S(at)?G=!1:h&&(G=h(at)?"expanded":"collapsed");let ee=M?f.getRowIndexInPage(A):null,ge=M?f.getPageIndexForRow(A):null,Te=o.isEditorVisibleForCell({rowIndex:A,columnId:et.id}),ut={getData:J,virtualized:!0,showZebraRows:m,groupRenderStrategy:p,rowIndexInHorizontalLayoutPage:ee,horizontalLayoutPageIndex:ge,rowIndex:A,rowInfoStore:ve,hidden:be,toggleGroupRow:Q,rowHeight:Xe,rowDetailState:G,onMouseEnter:We,onMouseLeave:qe,onRowMouseEnter:u,onRowMouseLeave:d,domRef:we,width:Me,column:et,columnsMap:F,fieldsToColumn:k,rowStyle:I,rowClassName:R,cellStyle:C,cellClassName:y,repaintCellsKey:et.repaintCellsKey!==void 0?et.repaintCellsKey:T,visibleColumnIds:se,computedColumnOrder:B,inEditMode:Te,getDataSourceState:ce,dataSourceApi:pe,dataSourceActions:Z,getState:i,imperativeApi:o,componentActions:r,getComputed:a,getDataSourceMasterContext:l,dataSourceStatePartialForCell:ie};return Nl.createElement(zf,{...ut})},[s,c,u,d,_,X,h,J,L,F,k,p,M,Q,m,f,ve,I,R,y,C,T,ce,pe,Z,i,o,r,a,l,se,B,x,z,ie]),le=(0,Fl.useMemo)(()=>{if(h)return O=>{let{rowIndex:A,domRef:de}=O,we=J()[A];if(!we||!h(we)||!_)return Nl.createElement("div",{ref:de,className:cd.hidden});let{rowDetailHeight:be,rowHeight:Me}=_.getSize(A);return Nl.createElement(Lb,{rowInfo:we,rowDetailsCache:b,rowIndex:A,domRef:de,detailOffset:Me,rowDetailHeight:be,rowDetailRenderer:g})}},[E,ne,g,c,h,b]);return{renderCell:ne,renderDetailRow:le}}var zb=require("react");function Vb(){let{state:n,getState:e,actions:t}=te(i=>({state:i.state,getState:i.getState,actions:i.actions})),{wrapRowsHorizontally:o}=n,r=On(o);(0,zb.useEffect)(()=>{if(r!==o){let{brain:i,headerBrain:a,renderer:l,onRenderUpdater:s}=e();i.destroy(),a.destroy(),l.destroy(),s.destroy();let c=Yc(Al,!!o);t.brain=c.brain,t.headerBrain=c.headerBrain,t.renderer=c.renderer,t.onRenderUpdater=c.onRenderUpdater,t.headerRenderer=c.headerRenderer,t.headerOnRenderUpdater=c.headerOnRenderUpdater}},[r,o])}var Kb=H(require("react"));var Gb="_16lm1iw1 _16lm1iw1c _16lm1iwe";var Hb=$(Gb,Ls);function Bb(n){return Kb.createElement("div",{...n,className:n.className?$(Hb,n.className):Hb})}var Ir=H(require("react"));var Wb={visible:"qy58ya1 qy58ya0 _16lm1iw2 _16lm1iw23 _16lm1iw26 _16lm1iw2c _16lm1iw2a",hidden:"qy58ya2 qy58ya0 _16lm1iw2 _16lm1iw23 _16lm1iw26 _16lm1iw2c _16lm1iw2a"},jb="qy58ya3 _16lm1iw2 _16lm1iw23 _16lm1iw26 _16lm1iw2c _16lm1iw2a",Ub="qy58ya4";var{rootClassName:Fv}=ze,gu=`${Fv}-LoadMask`;function Nv(n){let{visible:e,children:t="Loading"}=n;return Ir.createElement("div",{className:`${Wb[e?"visible":"hidden"]} ${gu}`},Ir.createElement("div",{className:`${jb} ${gu}-Overlay`}),Ir.createElement("div",{className:`${Ub} ${gu}-Text`},t))}var Ll=Ir.memo(Nv);var $b=require("react");var Lv=[Ef,`${nn}--hovered`];function kv(n){return Array.isArray(n)&&(n=n.join(" ")),n.split(" ").map(e=>e.trim()).filter(Boolean)}function Mo(n){let e=Ke(),t=En(),{getComputed:o,api:r}=e,{renderer:i,onRenderUpdater:a,debugId:l,keyboardNavigation:s,activeRowIndex:c,loadingText:u,columnReorderDragColumnId:d,scrollStopDelay:p,brain:f,scrollerDOMRef:m,components:g,bodySize:h,activeCellIndex:S,rowDetailRenderer:y,showHoverRows:C,wrapRowsHorizontally:T,domProps:I,domRef:b,forceBodyRerenderTimestamp:R,rowHoverClassName:w,ready:v}=te(_=>({ready:_.state.ready,columnReorderDragColumnId:_.state.columnReorderDragColumnId,forceBodyRerenderTimestamp:_.state.forceBodyRerenderTimestamp,renderer:_.state.renderer,onRenderUpdater:_.state.onRenderUpdater,debugId:_.state.debugId,keyboardNavigation:_.state.keyboardNavigation,activeRowIndex:_.state.activeRowIndex,loadingText:_.state.loadingText,scrollStopDelay:_.state.scrollStopDelay,brain:_.state.brain,scrollerDOMRef:_.state.scrollerDOMRef,components:_.state.components,bodySize:_.state.bodySize,activeCellIndex:_.state.activeCellIndex,rowDetailRenderer:_.state.rowDetailRenderer,showHoverRows:_.state.showHoverRows,wrapRowsHorizontally:_.state.wrapRowsHorizontally,domProps:_.state.domProps,domRef:_.state.domRef,rowHoverClassName:_.state.rowHoverClassName})),P=g?.LoadMask??Ll,D=o(),{computedRowHeight:M,computedRowSizeCacheForDetails:x}=D,E=x?.getRowHeight||M,{loading:z}=Ne(_=>({loading:_.dataSourceState.loading})),V=Rr.useCallback(_=>{let k=e.getState(),K=_.target;if(!t&&_._from_row_detail)return;t&&(_._from_row_detail=!0);let Q=dp(K,$c(),k.domRef.current),Ie,se,me,ve;Q&&(se=Number(Q.dataset.colIndex),ve=Number(Q.dataset.rowIndex),Ie=e.getComputed().computedVisibleColumns[se].id,me=e.dataSourceApi.getRowInfoArray()[ve].id);let Pe={columnId:Ie,colIndex:se,rowId:me,rowIndex:ve,event:_,target:Q??_.target};Q&&k.cellContextMenu(Pe),k.contextMenu(Pe)},[]),{renderCell:N,renderDetailRow:L}=kb({imperativeApi:r,getComputed:o,domRef:b,bodySize:h,computed:D}),{autoFocus:F,tabIndex:B}=I??{};Vb();let X=(0,$b.useMemo)(()=>{if(!C)return;let _=[];return w&&(_=_.concat(w)),n.rowHoverClassName&&(_=_.concat(n.rowHoverClassName)),Mo.rowHoverClassName&&(_=_.concat(Mo.rowHoverClassName)),kv(_)},[C,w,n.rowHoverClassName,Mo.rowHoverClassName]);return Rr.createElement(Bb,{onContextMenu:V},Rr.createElement(Jm,{forceRerenderTimestamp:R,debugId:l,tabIndex:B??0,autoFocus:F??void 0,activeRowIndex:v&&s==="row"?c:null,activeCellIndex:v&&s==="cell"&&!d?S:null,scrollStopDelay:p,renderer:i,wrapRowsHorizontally:T,onRenderUpdater:a,brain:f,activeCellRowHeight:E,renderCell:N,renderDetailRow:y?L:void 0,cellHoverClassNames:X,scrollerDOMRef:m,scrollVarHostRef:b}),Rr.createElement(P,{visible:z},u))}Mo.rowHoverClassName=Lv;function Yb(){return te(n=>n.api)}function qb(n){return te(e=>e.api.getColumnApi(n))}var Jt=ze.rootClassName,{ManagedComponentContextProvider:zv}=kt({initSetupState:Wh,forwardProps:jh,mapPropsToState:qh,cleanup:Uh,allowedControlledPropOverrides:{rowHeight:!0,columnHeaderHeight:!0},mappedCallbacks:Yh(),getParentState:()=>Ja(n=>n),debugName:n=>Un(n.debugId,Al)}),Xb=De.memo(function(){let e=xi(),{componentState:t,api:o,initialChildren:r}=te(F=>({componentState:F.state,api:F.api,initialChildren:F.children})),{dataArrayLength:i,getDataSourceState:a,dataSourceActions:l,dataSourceApi:s}=Ne(F=>({dataArrayLength:F.dataSourceState.dataArray.length,getDataSourceState:F.getDataSourceState,dataSourceActions:F.dataSourceActions,dataSourceApi:F.dataSourceApi})),{domRef:c,portalDOMRef:u,onRowHeightCSSVarChange:d,onFlashingDurationCSSVarChange:p,onRowDetailHeightCSSVarChange:f,onColumnHeaderHeightCSSVarChange:m,rowHeightCSSVar:g,rowDetailHeightCSSVar:h,columnHeaderHeightCSSVar:S,scrollStopDelay:y,brain:C,activeRowIndex:T,activeCellIndex:I}=t,{licenseKey:b}=t;b===void 0&&un.licenseKey&&(b=un.licenseKey),wy(T,i,o),Ry(I,i,o);let{onKeyDown:R}=Hy();De.useEffect(()=>{let F=a(),B=Nt(X=>{F.notifyRenderRangeChange({renderStartIndex:X[0],renderEndIndex:X[1]})},{wait:y});return C.onVerticalRenderRangeChange(B)},[C,y]);let w=Iy(b),{autoFocus:v,tabIndex:P,...D}=t.domProps??{},M=Ap(D);De.useEffect(()=>{C.setScrollStopDelay(y),l.scrollStopDelayUpdatedByTable=y},[y]),Kg(),gb(),JS();let{menuPortal:x}=qS(),{menuPortal:E}=sb(),{menuPortal:z}=cb(),{menuPortal:V}=nb();De.useEffect(()=>{typeof globalThis.__DO_NOT_USE_UNLESS_YOU_KNOW_WHAT_YOURE_DOING_IS_READY=="function"&&globalThis.__DO_NOT_USE_UNLESS_YOU_KNOW_WHAT_YOURE_DOING_IS_READY(t.id,t.ready,o,{dataSourceApi:s})},[t.ready,o,s]);let N=Tb();De.useEffect(()=>{if(e){let F=e.getSnapshot();u.current=F.getMasterState().portalDOMRef.current}},[]);let L=r??De.createElement(De.Fragment,null,De.createElement(yc,null),De.createElement(Mo,null));return De.createElement("div",{"data-debug-id":N,onKeyDown:R,ref:c,...M},L,De.createElement("div",{ref:u,className:$(`${yt}Portal`,ud[1e7],Ni.absolute,ld[0],rd[0])},x,E,z,V),g?De.createElement(Mr,{key:"row-height",varName:g,onChange:d}):null,De.createElement(Mr,{key:"flashing-duration",allowInts:!0,varName:fe.components.Cell.flashingDuration,onChange:p}),h?De.createElement(Mr,{key:"row-detail-height",varName:h,onChange:f}):null,S?De.createElement(Mr,{key:"column-header-height",varName:S,onChange:m}):null,w==="valid"?null:De.createElement(wg,{invalid:w==="invalid"}),De.createElement(QS,null))});function Vv({children:n,store:e}){let{componentActions:t,componentState:o}=zt(),{scrollerDOMRef:r,scrollTopKey:i}=o,a=Le(o),l=yy({state:o,actions:t,getState:a}),s=Le(l),c=xi(),{getDataSourceState:u,dataSourceActions:d,getDataSourceMasterContext:p,dataSourceApi:f}=on(),[m]=De.useState(()=>Gg({getComputed:s,getState:a,getDataSourceState:u,getDataSourceMasterContext:p,dataSourceApi:f,actions:t,dataSourceActions:d})),g={actions:t,state:o,computed:l,dataSourceActions:d,getDataSourceMasterContext:p,getDataSourceState:u,getComputed:s,getState:a,api:m,dataSourceApi:f,children:n};return e.setSnapshot(g),De.useLayoutEffect(()=>{e.notify()}),Ii(r,h=>{let S={width:h.width,height:h.height};t.bodySize=S},{earlyAttach:!0,debounce:50}),De.useEffect(()=>{r.current&&(r.current.scrollTop=0)},[i,r]),De.createElement(Xb,null)}var un=function(n){let[e]=De.useState(()=>vy()),t=Bi();return De.createElement(zv,{repeatWrappedGroupRows:!!n.wrapRowsHorizontally,rowHeight:pi,columnHeaderHeight:di,...n},De.createElement(Ji,null,De.createElement(t.Provider,{value:e},De.createElement(Vv,{children:n.children,store:e}))))};un.Header=yc;un.Body=Mo;un.HScrollSyncContent=pb;un.Footer=()=>De.createElement(pd,null);un.GroupingToolbar=Mb;var Zb=H(require("react"));function Gv(n){let{DataSource:e}=pr({nodesKey:"children",...n});return Zb.createElement(e,null,n.children??null)}var Qb=H(require("react"));var hu=n=>(t,{unfilteredTreePaths:o,treeSelectionState:r,prevTreeSelectionState:i,lastUpdatedNodeInfo:a})=>{let l=new Je(i,{treePaths:o});r.forEachLeafNodePath((u,{selected:d})=>{l.setNodeSelection(u,d)}),a&&r.forEachLeafNodePath(u=>{l.setNodeSelection(u,a.selected)},a.nodePath);let c={defaultSelection:!1,selectedPaths:l.getSelectedLeafNodePaths()};n(c)};function Jb(n){return Qb.createElement(un,{...n})}var kl=class{constructor(e){this.state="idle";this.result=void 0;this.error=void 0;this.doneAt=0;this.pendingPromise=void 0;this.debugName="";this.fetch=async(e,...t)=>{this.state="loading";let o=()=>{};try{this.logger(`Fetching query ${this.debugName}...`),this.pendingPromise=new Promise(r=>{o=r}),this.result=await e(...t),this.state="success"}catch(r){this.result=void 0,this.error=r,this.state="error"}return this.doneAt=Date.now(),this.pendingPromise=void 0,o(this),this.logger(`Fetched query ${this.debugName}. State: ${this.state}.`),this.getDoneSnapshot()};this.getCurrentSnapshot=()=>{let e={state:this.state,result:this.result,doneAt:this.doneAt,error:this.error,done:this.isDone()};return e.done||(e.promise=this.pendingPromise),e};this.getDoneSnapshot=async()=>{if(this.state==="idle")throw new Error("DataQuery is still idle");return this.pendingPromise&&await this.pendingPromise,{state:this.state,result:this.result,error:this.error,done:this.isDone(),doneAt:this.doneAt}};this.getResult=()=>{if(!this.isDone())throw new Error("DataQuery is not done yet");return this.result};this.isDone=()=>this.state==="success"||this.state==="error";this.isSuccess=()=>this.state==="success";this.debugName=e||"",this.logger=Ye(`IT:${e}:DataQuery`)}};function Eo(n){if(Array.isArray(n))return n.map(Eo);if(typeof n=="object"){if(n===null)return n;let e=n,t=Object.keys(e).sort((r,i)=>r.localeCompare(i)),o={};return t.forEach(r=>{let i=e[r];i!==void 0&&(o[r]=Eo(i))}),JSON.stringify(o)}return n instanceof Date?n.toISOString():n}var Pn=class Pn{constructor(e){this.queryCache=new U;this.removeQueryIfErrored=(e,t)=>{if(e.getCurrentSnapshot().state!=="success"){let o=this.queryCache.get(t);if(e===o)return this.queryCache.delete(t),!0}return!1};this.fireQuery=e=>{let t=Eo(e.key),o=this.options.cache?this.queryCache.get(t):null;if(o!=null){let i=o.getCurrentSnapshot();if(i.state==="success")return{query:o,fromCache:!0};if(i.state==="loading")return{query:o,fromCache:!0};i.state==="error"&&this.removeQueryIfErrored(o,t)}let r=new kl(`${this.name}:${e.name}`);return this.queryCache.set(t,r),r.fetch(e.fn,e.key),r.getCurrentSnapshot().promise?.then(()=>{this.removeQueryIfErrored(r,t)}),{query:r,fromCache:!1}};this.query=e=>this.fireQuery(e).query.getCurrentSnapshot();this.awaitQuery=async e=>{let{query:t,fromCache:o}=this.fireQuery(e),r=t.getCurrentSnapshot();return r.promise&&(r=await t.getDoneSnapshot(),r.state==="error"&&o)?await this.fireQuery(e).query.getDoneSnapshot():r};this.isQueryInProgress=e=>{let t=Eo(e);return this.queryCache.get(t)?.getCurrentSnapshot().done??!1};this.hasQueryForKey=e=>{let t=Eo(e);return this.queryCache.has(t)};this.discardQueryForKey=e=>{let t=Eo(e);this.queryCache.delete(t)};if(this.options=e,Pn.clients.has(e.name)){let t=`There's already a DataClient with name "${e.name}". Specify a different name for the client`;throw new Error(t)}Pn.clients.set(e.name,this),this.name=e.name}static destroy(e){let t=Pn.clients.get(e);t&&t.destroy()}static destroyAll(){Pn.clients.forEach(e=>{Pn.destroy(e.name)})}destroy(){Pn.clients.delete(this.options.name)}};Pn.clients=new Map;var yu=Pn;var Hv={key:"*",when:n=>{let{activeCellIndex:e}=n.getState();if(e){let[t,o]=e,r=n.api.getColumnAtIndex(o);return r?n.api.isCellEditable({rowIndex:t,columnId:r.id}):!1}return!1},handler:(n,e)=>{let{key:t}=e;if(t!="Escape"&&t.length===1){let{activeCellIndex:o}=n.getState();if(o){let[r,i]=o,a=n.api.getColumnAtIndex(i);if(!a)return;requestAnimationFrame(()=>{n.api.startEdit({rowIndex:r,value:t,columnId:a.id})})}}}},eT={instantEdit:Hv};var Kv=require("react");function tT(n,e){let{set:t,delete:o,clear:r}=n;return e.set&&(n.set=(i,a)=>(t.call(n,i,a),e.set(i,a),n)),e.delete&&(n.delete=i=>{let a=o.call(n,i);return e.delete(i),a}),(e.clear||e.beforeClear)&&(n.clear=()=>{e.beforeClear&&e.beforeClear(n);let i=r.call(n);return e.clear&&e.clear(),i}),()=>{t&&(n.set=t),o&&(n.delete=o),r&&(n.clear=r)}}var Vl=class Vl{constructor(e,t){this.orderRefs=[];if(typeof e=="number")this.maxSize=e,this.currentSet=new Set;else if(this.maxSize=t??Vl.DEFAULT_SIZE,e){let o=Array.from(e);this.maxSize<o.length&&o.slice(o.length-this.maxSize),this.currentSet=new Set,o.forEach(r=>{this.add(r)})}else this.currentSet=new Set}values(){return this.currentSet.values()}get size(){return this.currentSet.size}delete(e){return this.currentSet.has(e)?(this.currentSet.delete(e),this.orderRefs=this.orderRefs.filter(t=>t!==e),!0):!1}has(e){return this.currentSet.has(e)}add(e){if(this.currentSet.has(e))return this;if(this.maxSize-this.currentSet.size<=0){let[o]=this.orderRefs.splice(0,1);o&&this.currentSet.delete(o)}return this.orderRefs.push(e),this.currentSet.add(e),this}};Vl.DEFAULT_SIZE=10;var zl=Vl;var Hl=class Hl{constructor(e,t){this.orderRefs=[];if(typeof e=="number")this.maxSize=e,this.currentSet=new Set;else if(this.maxSize=t??Hl.DEFAULT_SIZE,e){let o=Array.from(e);this.maxSize<o.length&&o.slice(o.length-this.maxSize),this.currentSet=new Set,o.forEach(r=>{this.add(r)})}else this.currentSet=new Set}values(){return this.currentSet.values()}get size(){return this.currentSet.size}delete(e){return this.currentSet.has(e)?(this.currentSet.delete(e),this.orderRefs=this.orderRefs.filter(t=>t.deref()!==e),!0):!1}has(e){return this.currentSet.has(e)}add(e){if(this.currentSet.has(e))return this;if(this.maxSize-this.currentSet.size<=0){let[o]=this.orderRefs.splice(0,1),r=o.deref();r&&this.currentSet.delete(r)}return this.orderRefs.push(new WeakRef(e)),this.currentSet.add(e),this}};Hl.DEFAULT_SIZE=10;var Gl=Hl;var Ao=require("react"),Bv=(n,e)=>n.every((t,o)=>t===e[o]),nT=(n,e)=>{let t=(0,Ao.useRef)(e),o=Bv(e,t.current),r=(0,Ao.useRef)(!0);t.current=e;let i=(0,Ao.useRef)(["same"]),a=o?[Date.now()]:i.current;i.current=a;let l=(0,Ao.useRef)(n);l.current=n,(0,Ao.useEffect)(()=>{if(r.current){r.current=!1;return}return l.current()},a)};var eo=require("react"),oT=(n,e,t)=>n.every((o,r)=>t?t(o,e[r]):o===e[r]),Kl=(n,e)=>{let{same:t,different:o,compare:r}=e,i=(0,eo.useRef)(t),a=(0,eo.useRef)(o),l=oT(t,i.current,r),s=!oT(o,a.current,r),c=(0,eo.useRef)(!0);i.current=t,a.current=o;let u=(0,eo.useRef)(["same"]),d=l&&s?[Date.now()]:u.current;u.current=d;let p=(0,eo.useRef)(n);p.current=n,l&&s&&(c.current=!1),(0,eo.useEffect)(()=>{if(!c.current)return p.current()},d)};var Ft=H(require("react"));var rT=Y(q.currentFlashingDuration),Wv=({children:n})=>Ft.createElement(Ft.Fragment,null,n),iT=1e3,aT={up:na({direction:"up"}).split(" "),down:na({direction:"down"}).split(" "),neutral:na({direction:"neutral"}).split(" ")},Su=(n={})=>{let{flashDuration:e,flashClassName:t,render:o=Wv}=n;return Ft.forwardRef((i,a)=>{let l=Ur(),{flashingDurationCSSVarValue:s}=te(R=>({flashingDurationCSSVarValue:R.state.flashingDurationCSSVarValue})),c=typeof s=="number"?s??e??iT:e??iT,{domRef:u,value:d,column:p,rowInfo:f,htmlElementRef:m}=l,g=f.id,h=p.id,S=Ft.useRef(!0),y=Ft.useRef(d),C=S.current?null:y.current;S.current=!1;let T=Ft.useRef(void 0),I=Ft.useRef(void 0),b=Ft.useRef(void 0);return Kl(()=>{if(d===y.current)return;let R=()=>{let D=m.current;if(T.current&&(clearTimeout(T.current),T.current=void 0),b.current&&(clearTimeout(b.current),b.current=void 0),I.current&&D){let M=I.current,x=aT[M];D.classList.remove(...t?[t,...x]:x),D.style.removeProperty(rT),I.current=void 0}};y.current=d;let w=m.current;if(!w)return;R();let v=typeof d=="number"?d>C?"up":"down":"neutral",P=aT[v];return w.style.setProperty(rT,`${c}`),w.classList.add(...t?[t,...P]:P),I.current=v,T.current=setTimeout(R,c),R},{same:[h,g],different:[d]}),Ft.createElement("div",{ref:u,...i,className:$(i.className)},o({children:i.children,oldValue:C}))})},lT=Su();var rt=H(require("react")),wr=require("react");var sT=require("react-dom");function cT(n){let[e,t]=rt.useState(null);return(0,wr.useEffect)(()=>{let{debugTarget:o}=n,r=setInterval(()=>{if(globalThis.INFINITE&&globalThis.INFINITE[o]){let i=globalThis.INFINITE[o].getState;clearInterval(r),t(()=>i)}},100);return()=>{clearInterval(r)}},[n.debugTarget]),typeof e=="function"?rt.createElement(uT.Provider,{value:{getState:e}},rt.createElement(jv,null)):null}var uT=rt.createContext({getState:()=>null});function jv(){let n=rt.useContext(uT),{getState:e}=n,[,t]=qt(),o=e().renderer.cellManager;(0,wr.useEffect)(()=>{let s=Nt(()=>{console.log("rerender"),t()},{wait:500});return o.onCellAttachmentChange(s)},[o,t]);let r=o.getRowsWithCells(),i=o.getColumnsWithCells(),a=(0,wr.useRef)(null),l=(0,wr.useRef)(null);return rt.createElement("div",{style:{overflow:"auto"}},(0,sT.createPortal)(rt.createElement("div",{ref:a,style:{position:"absolute",top:0,left:0,width:"0px",height:"0px",pointerEvents:"none",background:"rgba(255, 0, 0, 0.5)",opacity:"0"}}),document.body),rt.createElement("table",{style:{borderCollapse:"collapse"}},rt.createElement("thead",null,rt.createElement("tr",null,i.map(s=>rt.createElement("th",{key:s,"data-col-index":s},s)))),rt.createElement("tbody",null,r.map(s=>rt.createElement("tr",{key:s,"data-row-index":s},i.map(c=>rt.createElement("td",{key:c,style:{padding:5,border:"1px solid gray",background:o.getCellAt([s,c])?.getNode()?"rgba(0, 255, 0, 0.3)":"rgba(255, 0, 0, 0.3)"},"data-col-index":c},rt.createElement("button",{onClick:()=>{let u=o.getCellAt([s,c])?.getElement();if(!u)return;let d=u.getBoundingClientRect();a.current.style.top=`${d.top}px`,a.current.style.left=`${d.left}px`,a.current.style.width=`${d.width}px`,a.current.style.height=`${d.height}px`,a.current.style.opacity="0.5",a.current.style.transition="opacity 0.5s",l.current&&clearTimeout(l.current),l.current=setTimeout(()=>{a.current.style.opacity="0",l.current=null},2e3),console.log(u)},style:{cursor:"pointer"}},"(",s,",",c,")"))))))))}var Uv={CheckBox:zn,LoadMask:Ll,MenuIcon:Yr,StringFilterEditor:Uo,NumberFilterEditor:ji};0&&(module.exports={AutoScroller,CellSelectionState,DRAG_ITEM_ATTRIBUTE,DataClient,DataSource,DataSourceActionType,DeepMap,DragDropProvider,DragInteractionTarget,DragList,FixedSizeSet,FlashingColumnCell,GroupRowsState,INTERNAL_MatrixDebugger,InfiniteTable,InfiniteTableClassName,InfiniteTableComponent,Menu,RowDetailCache,RowDetailState,RowDisabledState,RowSelectionState,TreeDataSource,TreeExpandState,TreeGrid,TreeSelectionState,WeakFixedSizeSet,alignNode,components,createDefaultProxy,createFlashingColumnCellComponent,debounce,debug,defaultDragProxyMove,defaultFilterFunction,defaultFilterTypes,defaultTreeFilterFunction,eventMatchesKeyboardShortcut,filterDataArray,filterTypes,flatten,getComponentStateRoot,group,interceptMap,keyboardShortcuts,multisort,multisortNested,queryKeyToCacheKey,toTreeDataArray,useComponentState,useDataSourceApi,useDataSourceInternal,useDataSourceSelector,useDataSourceState,useDragDropProvider,useDragListContext,useEffectWhen,useEffectWhenSameDeps,useEffectWithChanges,useEffectWithObject,useGridScroll,useInfiniteColumnApi,useInfiniteColumnCell,useInfiniteColumnEditor,useInfiniteColumnFilterEditor,useInfiniteHeaderCell,useInfinitePortalContainer,useInfiniteTableApi,useLayoutEffectWithChanges,useManagedDataSource,useMasterRowInfo,useOverlay,useOverlayPortal,usePrevious,useRowInfoReducers,useVisibleColumnSizes,withSelectedLeafNodesOnly});
30
30
  //!collapsed || lazyLoad;