@infinite-table/infinite-react 7.5.1 → 8.0.0-canary.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,4 +1,4 @@
1
- "use strict";var tb=Object.create;var ii=Object.defineProperty;var nb=Object.getOwnPropertyDescriptor;var ob=Object.getOwnPropertyNames;var rb=Object.getPrototypeOf,ib=Object.prototype.hasOwnProperty;var ab=(o,e)=>()=>(e||o((e={exports:{}}).exports,e),e.exports),lb=(o,e)=>{for(var t in e)ii(o,t,{get:e[t],enumerable:!0})},Mc=(o,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of ob(e))!ib.call(o,r)&&r!==t&&ii(o,r,{get:()=>e[r],enumerable:!(n=nb(e,r))||n.enumerable});return o};var V=(o,e,t)=>(t=o!=null?tb(rb(o)):{},Mc(e||!o||!o.__esModule?ii(t,"default",{value:o,enumerable:!0}):t,o)),sb=o=>Mc(ii({},"__esModule",{value:!0}),o);var jn=ab((ix,gd)=>{"use strict";gd.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 mw={};lb(mw,{CellSelectionState:()=>Be,DataClient:()=>wc,DataSource:()=>SS,DataSourceActionType:()=>um,DeepMap:()=>Q,FixedSizeSet:()=>Qa,FlashingColumnCell:()=>Wh,GroupRowsState:()=>gt,INTERNAL_MatrixDebugger:()=>$h,InfiniteTable:()=>tn,InfiniteTableClassName:()=>qt,InfiniteTableComponent:()=>_h,Menu:()=>jt,RowDetailCache:()=>Uo,RowDetailState:()=>wt,RowDisabledState:()=>ht,RowSelectionState:()=>Ee,TreeDataSource:()=>lw,TreeExpandState:()=>rt,TreeGrid:()=>Fh,TreeSelectionState:()=>Qe,WeakFixedSizeSet:()=>el,alignNode:()=>ic,components:()=>pw,createFlashingColumnCellComponent:()=>Ic,debounce:()=>Pt,debug:()=>We,defaultFilterTypes:()=>In,eventMatchesKeyboardShortcut:()=>Fa,filterDataArray:()=>zs,filterTypes:()=>In,flatten:()=>Cp,getComponentStateRoot:()=>Et,group:()=>ua,interceptMap:()=>zh,keyboardShortcuts:()=>kh,multisort:()=>Qt,multisortNested:()=>da,queryKeyToCacheKey:()=>go,toTreeDataArray:()=>Rp,useComponentState:()=>qe,useDataSourceInternal:()=>$o,useDataSourceState:()=>on,useEffectWhen:()=>nl,useEffectWhenSameDeps:()=>Vh,useEffectWithChanges:()=>lo,useEffectWithObject:()=>VT,useGridScroll:()=>$a,useInfiniteColumnCell:()=>Mr,useInfiniteColumnEditor:()=>Vi,useInfiniteColumnFilterEditor:()=>vo,useInfiniteHeaderCell:()=>Ir,useInfinitePortalContainer:()=>lh,useLayoutEffectWithChanges:()=>zT,useManagedDataSource:()=>Gs,useMasterRowInfo:()=>wS,useOverlay:()=>en,useOverlayPortal:()=>wg,usePrevious:()=>Cn,useRowInfoReducers:()=>CS,useVisibleColumnSizes:()=>eh,withSelectedLeafNodesOnly:()=>Lh});module.exports=sb(mw);function Pt(o,{wait:e}){let t=null;return function(...n){let r=this;t!==null&&clearTimeout(t),t=setTimeout(()=>{o.apply(r,n)},e)}}var De=V(require("react"));var Z=(...o)=>o.filter(e=>!!`${e}`).join(" ");var Kn=V(require("react")),bl=require("react");function Te(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 st(o){let e=!1,t=null;return(...r)=>(e||(e=!0,t=o(...r)),t)}var Ec=(o,e)=>o-e;var ai=(o,e)=>Ec(o.revision,e.revision),Q=class o{constructor(e){this.map=new Map;this.length=0;this.revision=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,f)=>{let p=r.get(f);if(!p)return;let{map:m}=p,g=f===this.emptyKey;if(g&&!c)return;let b=g?[]:[...e,f],h=m?()=>this.visitWithNext(b,t,n,m,i!==void 0?i-1:void 0):void 0;if(p.hasOwnProperty("value")){let y=t(p.value,b,l,h,p);if(n&&y===!0)return!0;l++}else h?.()};s&&(u(void 0,this.emptyKey),c=!1,l=0);for(let[d,f]of r){let p=u(f,d);if(n&&p===!0)return p}};this.fill(e)}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(ai).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=f=>{i?a.push(f):l.push(f.keys)},c=this.map,u,d=!1;if(e.length)for(let f=0,p=e.length;f<p;f++){let m=e[f];if(u=c.get(m),!u||!u.map)if(d=!0,f===p-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(ai).map(f=>f.keys):l:(this.visitWithNext(e,(f,p,m,g,b)=>{s({...b,keys:p})},!1,c,r,n),i?a.sort(ai).map(f=>f.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,f,p)=>{t(u,c,{...p,keys:u}),f?.()},!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;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}delete(e){let t=this.map;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=st(()=>{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(ai);function*n(){for(let r=0,i=t.length;r<i;r++)yield e(t[r])}return n()}};globalThis.DeepMap=Q;function xe(){return globalThis}var si=["#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"],Ac=Symbol("color"),li=new WeakMap,ul=Te();function dl(o=si){li.set(o,o.map(e=>0))}dl();var cb=(o=si)=>{let e=[];li.has(o)?e=li.get(o):(e=o.map(n=>0),li.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]??si[0]},fr=":",fl="*",_c="-",ub=",",db="debug",fb="diffdebug",Nc=!1,dr=new Q,pr=new Map;function pl(o,e){let t=o.split(fr),n=new Q;n.set(t,!0);let r=e.split(fr),i=new Set(r).has(fl),a=r.indexOf(fl),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(fr)):!0}}function Fc(o,e){let t=`channel=${o}_permissions=${e}`;if(pr.has(t))return pr.get(t);let n=e.split(ub);function r(l){return pr.set(t,l),l}let i=[],a=[];n.forEach(l=>{l.includes(fl)?a.push(l):i.push(l)});for(let l=0;l<i.length;l++){let s=i[l],c=s.startsWith(_c);if(c&&(s=s.substring(_c.length)),pl(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)),pl(o,s))return r(!c)}return r(!1)}var ml=()=>We.enable??(xe()&&xe().localStorage?.getItem(db))??"",pb=()=>We.diffenable??(xe()&&xe().localStorage?.getItem(fb))??`${Nc}`,gl="",Lc=Nc;function hl(o){Lc=`${pb()}`=="true",gl!==o&&(gl=o,pr.clear())}function kc(o){hl(ml()),typeof xe()<"u"&&xe().addEventListener&&xe().addEventListener("storage",function(){hl(ml())});function e(t,n){let r=n?`${n}${fr}${t}`:t,i=r.split(fr),a=dr.get(i);if(a)return a;let l=dr.get(i.slice(0,-1)),s=(l?l.logFn:We.logFn)??zc,c=s,u,d=0,f=()=>u??Fc(r,gl),p=cb(We.colors),m=Object.defineProperties((...g)=>{let b=ul.getListenersCount(),h;if(b>0&&(h=h??Date.now(),ul({color:p,channel:r,args:g,timestamp:h})),f()){if(h=h??Date.now(),d&&Lc){let C=h-d;c(`%c[${r}]`,`color: ${p}`,`+${C}ms:`)}d=h;let y=[],S;if(g.forEach(C=>{if(C[Ac])S===void 0&&(S=!0),y.push(...C);else{if(typeof C!="string"&&typeof C!="number"){S=!1;return}y.push(`${C}%s`)}}),S){let C=[`%c[${r}]%c %s`,`color: ${p}`,"",...y,""];c(...C)}else c(`%c[${r}]%c %s`,`color: ${p}`,"",...g)}},{channel:{value:r},color:{value:(g,...b)=>{let h=[`%c${b.join(" ")}%c%s`,`color: ${g}`,""];return h.toString=()=>b.join(" "),h[Ac]=!0,h}},extend:{value:g=>e(g,r)},enabled:{get:()=>f(),set:g=>{u=g}},logFn:{configurable:!1,get:()=>c,set:g=>{c=g??s}},destroy:{value:()=>{dr.delete(i)}}});return dr.set(i,m),m}return e(o)}var zc=console.log.bind(console),Oc;Object.defineProperty(kc,"enable",{get:()=>Oc,set:o=>{Oc=o,hl(ml())}});var We=kc;We.colors=si;We.logFn=zc;var mb=(o,e)=>ul.onChange(t=>{if(!t)return;let{channel:n,args:r,color:i,timestamp:a}=t;pl(n,o)&&e({channel:n,color:i,args:r,timestamp:a})});We.onLogIntent=mb;We.isChannelEnabled=Fc;We.destroyAll=()=>{dl(),dl(We.colors),dr.clear(),pr.clear()};var Dt=o=>{let e=We(o?`IT:${o}:TYPE=debug`:"IT:TYPE=debug");return e.logFn=console.log.bind(console),e},hn=o=>{let e=We(o?`IT:${o}:TYPE=error`:"IT:TYPE=error");return e.logFn=console.error.bind(console),e},mr=()=>mr;mr.extend=()=>mr;var ft=class{constructor(e){this.debug=mr,this.error=mr}};var gb=V(require("react")),bn=require("react");var gr=(o,e,t={debounce:0})=>{let n=t.debounce??0,r=window.ResizeObserver,i=n?Pt(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()}},ci=(o,e,t={earlyAttach:!1,debounce:0})=>{let n=(0,bn.useRef)({width:0,height:0}),r=i=>{let a;return o.current&&(a=gr(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,bn.useEffect)(()=>t.earlyAttach?()=>{}:r(e),[o.current,e,t.earlyAttach,t.debounce]),(0,bn.useLayoutEffect)(()=>t.earlyAttach?r(e):()=>{},[o.current,e,t.earlyAttach])};var hb=hn("CSSVariableWatch"),bb=Dt("CSSVariableWatch"),yb={position:"absolute",pointerEvents:"none",width:0,height:0,lineHeight:0,fontSize:0,overflow:"hidden"},Tb=o=>{let e=(0,bl.useRef)(0),t=Kn.useCallback(({height:n})=>{n!=null&&n!==e.current&&(e.current=n,o.onChange(n))},[o.onChange]);ci(o.ref,t,{earlyAttach:!0}),Kn.useLayoutEffect(()=>{let n=o.ref.current.getBoundingClientRect().height;if(n!=null)return e.current=n,bb(`Variable ${o.varName} found and equals ${n}.`),o.onChange(n);hb(`Specified variable ${o.varName} not found or does not have a numeric value.`)},[])},hr=o=>{let e=(0,bl.useRef)(null);Tb({...o,ref:e});let t=o.varName.startsWith("var(")?o.varName:`var(${o.varName})`,{allowInts:n=!1}=o;return Kn.createElement("div",{"data-name":"css-variable-watcher","data-var":o.varName,style:yb},Kn.createElement("div",{ref:e,style:{height:n?`calc(1px * ${t})`:t}}))};var di=V(require("react"));var Vc=V(require("react")),yl;function br(){return yl||(yl=Vc.createContext({api:null,getState:()=>null,assignState:()=>null,getDataSourceMasterContext:()=>{},componentState:null,componentActions:null}))}var Gc=V(require("react")),Tl;function ui(){return Tl||(Tl=Gc.createContext(void 0))}function on(){let o=br();return di.useContext(o).componentState}function Oe(){let o=br();return di.useContext(o)}function He(){let o=ui();return di.useContext(o)}var yo=V(require("react")),Ze=require("react");function Sl(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 Cl=o=>o&&o.substr(0,1).toUpperCase()+o.substr(1);function yn(o){if(o==null)return!1;let e=o;return!0}function yr(o){return o!==void 0}function Tn(o,e){let t=e[o];return yr(t)}var Sn=require("react");var fi=require("react"),Mt=()=>{let[o,e]=(0,fi.useState)(0);return[o,(0,fi.useCallback)(()=>{e(t=>t+1)},[e])]};var Hc=o=>{let e=(0,Sn.useCallback)(o,[]),t=(0,Sn.useRef)(!1),n=(0,Sn.useRef)(!1),r=(0,Sn.useRef)(void 0),[i,a]=Mt();t.current&&(n.current=!0),(0,Sn.useEffect)(()=>(t.current||(r.current=e,t.current=!0),a(),()=>{n.current&&r.current&&r.current()}),[])};var pi=require("react");function Ae(o){let e=(0,pi.useRef)(o);return e.current=o,(0,pi.useCallback)(()=>e.current,[])}var mi=require("react"),Cn=(o,e)=>{let t=(0,mi.useRef)(e===void 0?o:e);return(0,mi.useLayoutEffect)(()=>{t.current=o}),t.current};var Tr={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 wl=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";return performance.measure(s,{start:t,end:n,detail:{devtools:{dataType:"track-entry",trackGroup:i,track:c,color:r,properties:a.length>0?a.map(u=>[u.name,u.value]):void 0,tooltipText:l}}}),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(Tr).reduce((t,n)=>{let r={start:e.start,end:i=>e.end({...i,track:Tr[n].track,label:i.label}),get label(){let i=Tr[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=Tr[n];return e.markerDetails.track=i.track,r}}),t},{})}};function Je(o){return wl.create(o)}var Sb=(o,e,t)=>{let n=o[e];typeof n=="function"&&n(...t)},Il;function Kc(){return Il||(Il=(0,Ze.createContext)(null))}function Cb(o,e,t,n,r,i,a){let l=e();return Object.keys(l).reduce((s,c)=>{let u=c;return Object.defineProperty(s,c,{set:f=>{let p=t(),m=e(),g=m[u],b=!0;if(i&&typeof i[u]=="function"&&i[u](f,{actions:s,state:m})===!1&&(b=!1),b){let S=[f],C=`on${Cl(c)}Change`;if(a&&a[u]){let T=a[u](f,m);C=T.callbackName||C,S=T.callbackParams}Sb(p,C,S)}let h=n[u];typeof h=="function"&&(f=h(f));let y=!!r?.[u];Tn(c,p)&&!y||o({payload:{updatedProps:null,mappedState:{[c]:f}}})}}),s},{})}function wb(o,e,t){let n={};for(let r in o)if(o.hasOwnProperty(r)){let i=o[r],a=Tn(r,e)?e[r]:e[`default${Cl(r)}`];typeof i=="function"&&(a=i(a,t)),n[r]=a}return n}function Et(o){let e=o.getParentState||(()=>null);function t(r){let[i]=(0,Ze.useState)(()=>o.initSetupState?o.initSetupState(r):{}),a=(0,Ze.useRef)(new Set),l=(0,Ze.useMemo)(()=>o.forwardProps?o.forwardProps(i,r):{},[i]),s=e(),c=Ae(s);function u(){let v={};l&&(v=wb(l,r,i));let R={...i,...v};if(o.mapPropsToState){let{fn:x,propertyReads:M}=Sl(o.mapPropsToState,{getProxyTargetFromArgs:E=>E.props,putProxyToArgs:(E,P)=>[{...P,props:E}]}),A=x({props:r,state:R,oldState:null,parentState:s});return a.current=new Set([...a.current,...M]),{...R,...A}}return R}let[d]=(0,Ze.useState)(u),f=Ae(r),p=(v,R)=>{if(R.type==="REPLACE_STATE")return R.payload;let x=c?.()??null,M=R.payload.mappedState,A=R.payload.updatedPropsToState,E={...v};if(M&&Object.assign(E,M),o.mapPropsToState){let{fn:_,propertyReads:D}=Sl(o.mapPropsToState,{getProxyTargetFromArgs:F=>F.props,putProxyToArgs:(F,j)=>[{...j,props:F}]}),O=_({props:f(),state:E,oldState:v,parentState:x});a.current=new Set([...a.current,...D]),Object.assign(E,O)}return R.type==="ASSIGN_STATE"&&Object.assign(E,R.payload),o.concludeReducer?o.concludeReducer({previousState:v,state:E,updatedProps:A,parentState:x}):E},[m,g]=(0,Ze.useReducer)(p,d),b=Ae(m),{allowedControlledPropOverrides:h}=o,y=(0,Ze.useMemo)(()=>Cb(g,b,f,l,h,o.interceptActions,o.mappedCallbacks),[g,l,h]),S=o.Context??Kc(),C=(0,Ze.useMemo)(()=>({componentState:m,componentActions:y,getComponentState:b,replaceState:v=>{g({type:"REPLACE_STATE",payload:v})},assignState:v=>{g({type:"ASSIGN_STATE",payload:v})}}),[m,y,b]),T=Cn(r),I=(0,Ze.useRef)(!1);I.current=!1;let w=o.layoutEffect?Ze.useLayoutEffect:Ze.useEffect;return w(()=>{let v=r,R={},x=0,M={},A=0,E={},P=0;if(new Set([...Object.keys(v),...Object.keys(T)]).forEach(O=>{let F=O,j=T[F],z=v[F];if(F!=="children"&&j!==z&&(E[F]={newValue:z,oldValue:j},P++,Tn(F,r)||Tn(F,T)))if(l.hasOwnProperty(O)){let L=z,le=l[O];typeof le=="function"&&(L=le(z)),m[F]!==L&&(R[F]=L,x++)}else a.current.has(O)&&(M[F]=v[F],A++)}),A>0||x>0){let O=m.debugId,F=O?Je(O).track.ComponentState.label.PropUpdate.start():void 0,j=o.debugName?typeof o.debugName=="function"?`${o.debugName(v)}:rerender`:`${o.debugName}:rerender`:"rerender";Dt(j)("Triggered by new values for the following props",...Object.keys(R??{}),...Object.keys(M??{})),F&&F.end({label:j,details:[x>0?{name:"Updated properties",value:Object.keys(R).join(", ")}:void 0,A>0?{name:"Updated props",value:Object.keys(M).join(", ")}:void 0,A>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(yn)});let L={payload:{mappedState:x?R:null,updatedPropsToState:A?M:null}};if(I.current=!0,g(L),o.onPropChange){for(var D in E)if(E.hasOwnProperty(D)){let{newValue:le,oldValue:ne}=E[D];o.onPropChange({name:D,newValue:le,oldValue:ne},r,y,m)}}o.onPropsChange&&P&&o.onPropsChange(E,r,y,m)}}),w(()=>{s!=null&&!I.current&&g({type:"PARENT_STATE_CHANGE",payload:{}})},[s]),Hc(()=>()=>{o.cleanup?.(b())}),{contextValue:C,ContextComponent:S}}return{ManagedComponentContextProvider:yo.memo(function(i){let{contextValue:a,ContextComponent:l}=t(i);return yo.createElement(l.Provider,{value:a},i.children)}),useManagedComponent:t}}function qe(o){return o=o??Kc(),yo.useContext(o)}var tu=V(require("react"));var ct="Infinite",Le={rootClassName:ct};var gi=()=>Le;var Bc="_16lm1iw2 _16lm1iw23 _16lm1iw26 _16lm1iw2c _16lm1iw2a",Wc={center:"_16lm1iw2j",stretch:"_16lm1iw2k",start:"_16lm1iw2l",end:"_16lm1iw2m"};var Ut="_16lm1iw3b _16lm1iw3c _16lm1iw35",jc={pointer:"_16lm1iwk",default:"_16lm1iwl",colResize:"_16lm1iwm",grabbing:"_16lm1iwn",grab:"_16lm1iwo"},To={flex:"_16lm1iw1p",contents:"_16lm1iw1q",none:"_16lm1iw1r",block:"_16lm1iw1s",grid:"_16lm1iw1t",inlineBlock:"_16lm1iw1u",inlineFlex:"_16lm1iw1v",inlineGrid:"_16lm1iw1w"};var hi={1:"_16lm1iw1c",none:"_16lm1iw1d"},Sr={column:"_16lm1iw2f",columnReverse:"_16lm1iw2g",row:"_16lm1iw2h",rowReverse:"_16lm1iw2i"};var $c={0:"_16lm1iw1y","100%":"_16lm1iw1z","50%":"_16lm1iw20"},Uc={center:"_16lm1iw30",spaceBetween:"_16lm1iw31",spaceAround:"_16lm1iw32",start:"_16lm1iw33",end:"_16lm1iw34"},Yc={0:"_16lm1iw26","100%":"_16lm1iw27","50%":"_16lm1iw28",auto:"_16lm1iw29"};var qc={none:"_16lm1iwd"},Xc={hidden:"_16lm1iw35",auto:"_16lm1iw36",visible:"_16lm1iw37"};var bi={relative:"_16lm1iw1",absolute:"_16lm1iw2",static:"_16lm1iw3",sticky:"_16lm1iw4",fixed:"_16lm1iw5"};var Zc={0:"_16lm1iw23","100%":"_16lm1iw24","50%":"_16lm1iw25"};var Qc={none:"_16lm1iw1x"};var Jc={visible:"_16lm1iw38",hidden:"_16lm1iw39"};var eu={1:"_16lm1iw1e",10:"_16lm1iw1f",100:"_16lm1iw1g",1e3:"_16lm1iw1h",1e4:"_16lm1iw1i",1e5:"_16lm1iw1j",1e6:"_16lm1iw1k",1e7:"_16lm1iw1l","1k":"_16lm1iw1m","10k":"_16lm1iw1n","100k":"_16lm1iw1o"};function nu(o){let{rootClassName:e}=gi();return tu.createElement("div",{...o,className:Z(`${e}Footer`,bi.relative,To.flex,Sr.row,o.className)})}var Pe=V(require("react")),sn=require("react"),up=require("react-dom");function yi(o){let e={};return Object.keys(o).forEach(t=>{e[t]=t}),e}function q(o){return o.slice(4,-1)}var ou=V(require("react")),ke=o=>{let e=o.size??"var(--infinite-icon-size)",t={flex:"none",width:e,height:e,fill:"currentColor",...o.style};return ou.createElement("svg",{viewBox:"0 0 24 24",...o,style:t},o.children)};var Cr=V(require("react")),ru=o=>Cr.createElement(ke,{...o},Cr.createElement("path",{d:"M11.14 4L6.43 16H8.36L9.32 13.43H14.67L15.64 16H17.57L12.86 4H11.14M12 6.29L14.03 11.71H9.96L12 6.29"}),Cr.createElement("path",{d:"M4 18V15H2V20H22V18Z"}),Cr.createElement("path",{d:"M20 14V18H2V20H22V14Z"}));var vl=V(require("react")),iu=o=>vl.createElement(ke,{...o},vl.createElement("path",{d:"M11.14 4L6.43 16H8.36L9.32 13.43H14.67L15.64 16H17.57L12.86 4M12 6.29L14.03 11.71H9.96M20 14V18H2V20H22V14Z"}));var Rl=V(require("react")),xl=o=>Rl.createElement(ke,{...o},Rl.createElement("path",{d:"M19,10H5V8H19V10M19,16H5V14H19V16Z"}));var Pl=V(require("react")),au=o=>Pl.createElement(ke,{...o},Pl.createElement("path",{d:"M6.5,2.27L20,10.14L6.5,18L5.5,16.27L16.03,10.14L5.5,4L6.5,2.27M20,20V22H5V20H20Z"}));var Dl=V(require("react")),lu=o=>Dl.createElement(ke,{...o},Dl.createElement("path",{d:"M5.5,4.14L4.5,5.86L15,12L4.5,18.14L5.5,19.86L19,12L5.5,4.14Z"}));var Ml=V(require("react")),su=o=>Ml.createElement(ke,{...o},Ml.createElement("path",{d:"M18.5,2.27L5,10.14L18.5,18L19.5,16.27L8.97,10.14L19.5,4L18.5,2.27M5,20V22H20V20H5Z"}));var El=V(require("react")),cu=o=>El.createElement(ke,{...o},El.createElement("path",{d:"M18.5,4.14L19.5,5.86L8.97,12L19.5,18.14L18.5,19.86L5,12L18.5,4.14Z"}));var Al=V(require("react")),uu=o=>Al.createElement(ke,{...o},Al.createElement("path",{d:"M21,10H9V8H21V10M21,16H9V14H21V16M4,5H6V16H4V5M6,18V20H4V18H6Z"}));var _l=V(require("react")),du=o=>_l.createElement(ke,{...o},_l.createElement("path",{d:"M11.14 4L6.43 16H8.36L9.32 13.43H14.67L15.64 16H17.57L12.86 4M12 6.29L14.03 11.71H9.96M4 18V15H2V20H22V18Z"}));var Kl=V(require("react"));var nt=V(require("react")),wr=require("react");var pu=require("react");var fu=require("react"),Ol;function So(){return Ol||(Ol=(0,fu.createContext)(null))}var J=()=>{let o=So();return(0,pu.useContext)(o)};var mu=require("react");var gu=()=>{let o=So(),{state:e}=(0,mu.useContext)(o);return e};var Co=V(require("react")),Bn=require("react");function Ib(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 vb(o){var e=Ib(o,"string");return typeof e=="symbol"?e:String(e)}function Rb(o,e,t){return e=vb(e),e in o?Object.defineProperty(o,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):o[e]=t,o}function hu(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 bu(o){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?hu(Object(t),!0).forEach(function(n){Rb(o,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(t)):hu(Object(t)).forEach(function(n){Object.defineProperty(o,n,Object.getOwnPropertyDescriptor(t,n))})}return o}function yu(o,e){var t={};for(var n in o)t[n]=e(o[n],n);return t}var xb=(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},pe=o=>{var e=t=>{var n=o.defaultClassName,r=bu(bu({},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)xb(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 yu(o.variantClassNames,t=>yu(t,n=>n.split(" ")[0]))}},e};var Tu="_1eexc2a6";var Su=pe({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:[]}),Cu="_12zfob1q _16lm1iw2 _16lm1iw1k _16lm1iw3b _16lm1iw3c _16lm1iw35",wu=pe({defaultClassName:"_16lm1iw2 _16lm1iw25 _16lm1iw26 _16lm1iwh _16lm1iwf",variantClassNames:{visible:{true:"_12zfob19",false:"_12zfob1a"}},defaultVariants:{},compoundVariants:[]}),Iu=pe({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"]]}),vu=pe({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"]]}),Ru="_12zfob12u _16lm1iw22 _16lm1iw1z";var xu="_12zfob17",Pu="_12zfob12q _16lm1iw1p _16lm1iw2h _16lm1iw2j _16lm1iw1",Du=pe({defaultClassName:"_12zfob12r _16lm1iw1 _16lm1iw23",variantClassNames:{disabled:{true:"_12zfob12s",false:"_12zfob12t"}},defaultVariants:{},compoundVariants:[]}),Nl=pe({defaultClassName:"_12zfob12n _16lm1iw1p _16lm1iw2h _16lm1iw2k _16lm1iw1",variantClassNames:{active:{true:"_12zfob12o",false:"_12zfob12p"}},defaultVariants:{},compoundVariants:[]}),Mu="_12zfob12m _16lm1iw1p _16lm1iw2h _16lm1iw2j",Eu=pe({defaultClassName:"_12zfob127 _16lm1iw1 _16lm1iw1p _16lm1iw2f _16lm1iw32 _16lm1iw39",variantClassNames:{menuVisible:{true:"_12zfob128"},reserveSpaceWhenHidden:{true:"_12zfob129",false:"_12zfob12a"}},defaultVariants:{},compoundVariants:[[{menuVisible:!0,reserveSpaceWhenHidden:!1},"_12zfob12b"]]}),Au="_12zfob1b _16lm1iw2",_u="_16lm1iw1",Ou="_12zfob16",Nu=pe({defaultClassName:"_12zfob12",variantClassNames:{align:{start:"_12zfob13",center:"_12zfob14",end:"_12zfob15"}},defaultVariants:{},compoundVariants:[]}),Fu="_12zfob12l _16lm1iw35 _16lm1iw1 _16lm1iw1p _16lm1iw2h";var yt="InfiniteIcon";var Lu="_6aunoi0 _16lm1iw1p _16lm1iw2f _16lm1iw1 _16lm1iw32 _16lm1iw2j";var Pb={transition:"width 0.25s, opacity 0.25s"};function wo(o){let[e,t]=(0,Bn.useState)(!0),[n,r]=(0,Bn.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),f=[u-1*d,u-2*d,u-3*d],p={...Pb,borderTop:`${i}px solid currentColor`,...o.lineStyle,opacity:n};if((0,Bn.useEffect)(()=>{if(!e)return;let g=requestAnimationFrame(()=>{r(1)});return()=>{cancelAnimationFrame(g)}},[e]),(0,Bn.useLayoutEffect)(()=>{t(!0)},[]),!e)return null;let m={};return Co.createElement("div",{"data-name":"filter-icon",style:{...a,width:u},className:Z(l,yt,Lu,`${yt}-filter`)},c?Co.createElement("div",{"data-name":"index",style:m,className:xu},s):null,Co.createElement("div",{style:{width:f[0],...p}}),Co.createElement("div",{style:{width:f[1],...p}}),Co.createElement("div",{style:{width:f[2],...p}}))}var Fl=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((w,v)=>{let R=w.maxSize??r??void 0,x=w.minSize??n??void 0;s.push(x),c.push(R),w.size!=null&&(R!=null&&w.size>R&&(w.size=R),x!=null&&w.size<x&&(w.size=x));let M=w.flex==0?null:w.flex;if(w.size==null&&M==null)throw`Items must specify either a size or a flex property. Item at index ${v} doesn't have either of those.`;M!=null&&(l+=1),a+=M??0,i+=w.size??0});let u=o.computeSpecialSpaceDistribution?Math.max(e,0):Math.max(e-i,0),d=u/a,f={},p={},m=0;t.forEach((w,v)=>{if(w.flex!=null){let R=d*w.flex,x=w.maxSize??r??void 0,M=w.minSize??n??void 0,A=!1,E=0;x!=null&&R>x&&(f[v]=!0,A=!0,E=x),M!=null&&R<M&&(p[v]=!0,A=!0,E=M),A&&(m+=1,l-=1,a-=w.flex,u-=E)}}),m&&(d=u/a);let g=[],b=0,h=u,y=a,S=0,C=0,T=[];return{items:t.map((w,v)=>{let R={...w},x=w.maxSize??r??void 0,M=w.minSize??n??void 0,A=0,E=f[v],P=p[v],_=E||P,D=w.size??0;if(w.flex!=null){if(_)P&&(A=M),E&&(A=x);else{b+=1;let O=F=>(x!=null&&F>x&&(F=x),M!=null&&F<M&&(F=M),F);b===l?A=O(h):(A=O(Math.round(w.flex*d)),C+=A,h=u-C,y-=w.flex,d=h/y)}D=A,R.flexSize=A}return g.push(A),T.push(D),R.computedSize=D,S+=D,R}),flexSizes:g,minSizes:s,maxSizes:c,computedSizes:T,remainingSize:Math.round(e-S)}};function Ti(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}}var Ll=o=>{let{availableSize:e,reservedWidth:t=0}=o,n=Object.keys(o.columnSizing).reduce((x,M)=>(x[M]={...o.columnSizing[M]},x),{});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=l.computedWidth,f=l.computedMinWidth,p=l.computedMaxWidth,m=l.computedFlex?"flex":"width",g=s?.computedWidth,b=s?.computedMinWidth,h=s?.computedMaxWidth,y=s?.computedFlex?"flex":"width",S=!1,C=!1,T=r>0?1:-1,{value:I,clamped:w,diff:v}=Ti(d+r,f,p,T);if(o.shareSpaceOnResize){if(s==null)return n[c]={...n[c],[m]:I},C=w==="min",S=w==="max",{adjustedDiff:I-d,reservedWidth:t,columnSizing:n,minReached:C,maxReached:S,constrained:C||S};let{value:x,clamped:M,diff:A}=Ti(g-r,b,h,T);if(w&&M&&(Math.abs(v)>Math.abs(A)?M=!1:w=!1),!(!w&&!M)){if(w){let E=Ti(g-r-v,b,h,T);x=E.value,M=E.clamped,A=E.diff}else if(M){let E=Ti(d+r+A,f,p,T);I=E.value,w=E.clamped,v=E.diff}}n[c]={...n[c],[m]:I},n[u]={...n[u],[y]:x},C=w==="min"||M==="min",S=w==="max"||M==="max"}else n[c]={...n[c],[m]:I},C=w==="min",S=w==="max";let R=I-d;return{adjustedDiff:R,reservedWidth:o.shareSpaceOnResize?t:t-R,columnSizing:n,minReached:C,maxReached:S,constrained:C||S}};function ku(o,e){return o+e}function Db(o){return Object.keys(o).reduce((t,n)=>(t[n]={...o[n]},t),{})}var zu=o=>{let{availableSize:e,reservedWidth:t=0}=o,n=Object.keys(o.columnSizing).reduce((h,y)=>(h[y]={...o.columnSizing[y]},h),{});if(e<0)throw"The provided availableSize cannot be negative!";let r=o.dragHandleOffset,i=[...new Array(o.columnGroupSize)].map((h,y)=>o.dragHandlePositionAfter-y).reverse(),a=i.map(h=>o.items[h]),l=a.map(h=>h.computedWidth),s=a.map(h=>h.computedFlex?"flex":"width"),c=0,{computedSizes:u}=Fl({items:a.map(h=>(h.resizable===!1&&(c+=h.computedWidth),{maxSize:h.computedMaxWidth,minSize:h.computedMinWidth,flex:h.resizable?h.computedWidth:null,size:0})),computeSpecialSpaceDistribution:!0,availableSize:Math.max(l.reduce(ku,0)+r-c,0)}),d=a.map((h,y)=>u[y]-h.computedWidth),f=!0,p=!0,m=!0,g=[];d.forEach((h,y)=>{let S=a[y];if(!S.resizable){g.push(0);return}let C=s[y],T=l[y],I=Db(n),{maxReached:w,minReached:v,constrained:R,adjustedDiff:x}=Ll({availableSize:o.availableSize,reservedWidth:o.reservedWidth,dragHandleOffset:h,dragHandlePositionAfter:i[y],shareSpaceOnResize:!1,items:o.items,columnSizing:I});n[S.id]={...I[S.id],[C]:T+x},g.push(x),w||(p=!1),v||(f=!1),R||(m=!1)});let b=g.reduce(ku,0);return{minReached:f,maxReached:p,constrained:m,adjustedDiffs:g,adjustedDiff:b,columnSizing:n,reservedWidth:t-b}};var Si;function wn(){if(Si!=null)return Si;let o=xe().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),Si=e.offsetWidth-t.offsetWidth,e.parentNode?.removeChild(e),Si}var Vu=["start",void 0,"end"],Gu=(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:Vu.indexOf(r)-Vu.indexOf(i)}),o);function Hu(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 kl(o,...e){return Hu(t=>t!=null,o,...e)}function Ku(o,e,...t){return Hu((n,r)=>!(r in o),e,...t)}var Ci=Object.freeze({}),Mb={string:Ci,number:{}};function zl(o,e){let t=e.default||Ci;return o.type===void 0?t:o.type===null?Ci:typeof o.type=="string"?e[o.type]||Mb[o.type]||Ci:o.type.reduce((n,r)=>Object.assign(n,e[r]),{})}var wi=!0,Eb=!0,Ab=!0,_b="string",Io="unknown",Ob=hn("getComputedVisibleColumns"),Nb=(o,e,t)=>o[t]!==!1,Vl=(o,e)=>{if(!e)return!1;let t=e[o];return t==="start"||t===!0?"start":t==="end"?"end":!1},Bu=({columns:o,bodySize:e,columnMinWidth:t,columnMaxWidth:n,columnDefaultWidth:r,columnDefaultFlex:i,scrollbarWidth:a,columnCssEllipsis:l,columnHeaderCssEllipsis:s,pinnedStartMaxWidth:c,pinnedEndMaxWidth:u,filterValue:d,sortable:f,sortInfo:p,multiSort:m,filterTypes:g=In,viewportReservedWidth:b,resizableColumns:h,draggableColumns:y,columnDefaultDraggable:S,columnOrder:C,columnPinning:T,editable:I,columnDefaultEditable:w,columnDefaultFilterable:v,columnDefaultGroupable:R,columnDefaultSortable:x,columnSizing:M,columnTypes:A,columnVisibility:E,columnVisibilityAssumeVisible:P,groupBy:_})=>{let D=0,O={};_.forEach((G,oe)=>{G.field&&(O[G.field]=oe)});let F=(d||[]).reduce((G,oe)=>{let{id:ae,field:ye}=oe;return ye&&(G[ye]=oe),ae&&(G[ae]=oe),G},{}),j=Gu(C===!0?Object.keys(o):C,T),z=j.filter(G=>o[G]?Nb(E,P,G):(Ob(`Column with id "${G}" specified in columnOrder array cannot be found in the columns map.`),!1)),L=new Map,le=z.map((G,oe)=>{let ae=o[G];return L.set(G,oe),ae}),ne=(p??[]).reduce((G,oe,ae)=>(oe.id?G[oe.id]={sortInfo:oe,index:ae}:oe.field&&(G[oe.field]={sortInfo:oe,index:ae}),G),{});function W(G){let oe=o[G],ae=zl(oe,A),ye={minWidth:ae?.minWidth,maxWidth:ae?.maxWidth,width:ae?.defaultWidth,flex:ae?.defaultFlex},Ue=kl({width:oe?.defaultWidth,flex:oe?.defaultFlex,minWidth:oe?.minWidth,maxWidth:oe?.maxWidth},M[G]);Ue.width!=null&&delete ye.flex,Ue.flex!=null&&delete ye.width,Ue=kl(ye,Ue);let k=Ue.flex??void 0,Ce=Ue.minWidth??oe?.minWidth??t,gn=Ue.maxWidth??oe?.maxWidth??n,xt=k!=null?void 0:Ue.width??(i?void 0:r);return!xt&&k==null&&(i?k=i:xt=Ce),{size:xt,flex:k,minSize:Ce,maxSize:gn}}let $=Fl({availableSize:Math.max(e.width-(b??0)-(a??wn()),0),maxSize:n,minSize:t,items:z.map(W)}),{computedSizes:re,flexSizes:ge,minSizes:me,maxSizes:ue}=$,de=[],he=[],K=[],H=[];H.length=z.length;let X=new Map,B=new Map,ie=0,ee=0,fe=0,Ie=null,N=[],U=0,te=0,se=0;le.forEach((G,oe)=>{let ae=z[oe],ye=re[oe],Ue=N[oe]=Vl(ae,T);Ue==="start"?U+=ye:Ue==="end"?se+=ye:te+=ye});let Me=e.width-se,Ne=[],Fe=new Map;z.forEach((G,oe)=>{let ae=le[oe];Fe.set(G,ae)});let be=[];Object.keys(o).forEach(G=>{let oe=o[G];be.push(G),Fe.has(G)||Fe.set(G,oe)});let je=new Map;Fe.forEach((G,oe)=>{let ae=L.get(oe);ae==null&&(ae=-1);let ye=ae!=-1,Ue=z[ae+1],k=zl(G,A),Ce=ae,gn=ne[oe]?ne[oe]:G.field?ne[G.field]??null:null,xt=gn?.sortInfo??null,Ft=!!xt,Lt=Ft&&xt.dir===1,lr=Ft&&!Lt,sr=gn?.index??-1,bo=ye?{}:W(oe),cr=ye?re[ae]:bo.size||0,ol=ye&&ge[ae]||null,rl=ye?me[ae]||0:bo.minSize||0,il=ye?ue[ae]||1e4:bo.maxSize||1e4,at=ye?Vl(oe,T):!1,oi=ye?ae===z.length-1:!1,Re=Ce,lt=ye?at==="start"?ee:at==="end"?fe:D-ee:0;at=="start"?Re=ye?Ce:-1:at==="end"?Re=ye?Ce-(de.length+K.length):-1:Re=ye?Ce-de.length:-1;let nn=ye?at==="start"||at===!1?D:Me+fe:-1,kt=ye?at!==Ie:!1,ur=ye?oi||at!==Vl(Ue,T):!1,vc=G.cssEllipsis??k.cssEllipsis??l,Yh=G.headerCssEllipsis??k.cssEllipsis??G.cssEllipsis??k.headerCssEllipsis??s??vc,ri=ye&&(F[oe]||G.field||G.groupByForColumn)&&(F[oe]||F[G.field||G.groupByForColumn])||null,qh=G.defaultFilterable??k.defaultFilterable??v??!0,Xh=I??G.defaultEditable??k.defaultEditable??w??!1,al=G.dataType||k.dataType||(Array.isArray(G.type)?G.type[0]:G.type)||_b,Zh=G.sortType||k.sortType||al,Rc=G.filterType||k.filterType||al,xc=!1;if(ri!=null&&!ri.disabled){let cl=g[Rc];cl&&(!cl.emptyValues||!cl.emptyValues.includes(ri.filter.value))&&(xc=!0)}let Hn=G.field??k.field,Pc=G.valueGetter??k.valueGetter,ll=G.defaultGroupable??k.defaultGroupable??R??!!Hn;Hn||(ll=!1),G.groupByForColumn&&(ll=!1);let sl=G.defaultSortable??k.defaultSortable;sl==null&&!G.groupByForColumn&&Hn==null&&Pc==null&&(sl=!1);let Dc=Hn?O[Hn]!==void 0:!1,Qh=Dc?O[Hn]:void 0,Jh=f??sl??x??wi,eb=G.resizable??k.resizable??h??Eb,Ye={colType:k,align:k.align,headerAlign:k.headerAlign,computedVisible:ye,verticalAlign:k.verticalAlign,defaultHiddenWhenGroupedBy:k.defaultHiddenWhenGroupedBy,valueGetter:Pc,valueFormatter:k.valueFormatter,renderValue:k.renderValue,render:k.render,style:k.style,className:k.className,contentFocusable:k.contentFocusable,renderMenuIcon:k.renderMenuIcon,renderSortIcon:k.renderSortIcon,renderRowDetailIcon:k.renderRowDetailIcon,renderSelectionCheckBox:k.renderSelectionCheckBox,renderHeaderSelectionCheckBox:k.renderHeaderSelectionCheckBox,headerStyle:k.headerStyle,headerClassName:k.headerClassName,columnGroup:k.columnGroup,getValueToEdit:k.getValueToEdit,getValueToPersist:k.getValueToPersist,shouldAcceptEdit:k.shouldAcceptEdit,field:Hn,...G,components:{...k.components,...G.components},computedResizable:eb,computedMinWidth:rl,computedMaxWidth:il,computedFlex:ol,computedDataType:al,computedEditable:Xh,computedSortType:Zh,computedFilterType:Rc,cssEllipsis:vc,headerCssEllipsis:Yh,computedFilterValue:ri,computedFiltered:xc,computedFilterable:qh,computedGroupable:ll,computedGroupedBy:Dc,computedGroupedByIndex:Qh,computedWidth:cr,computedAbsoluteOffset:nn,computedPinningOffset:lt,computedVisibleIndexInCategory:Re,computedOffset:D,computedSortable:Jh,computedSortInfo:xt,computedSortIndex:sr,computedMultiSort:m,computedSorted:Ft,computedSortedAsc:Lt,computedSortedDesc:lr,computedVisibleIndex:Ce,computedPinned:at,computedDraggable:y??G.defaultDraggable??S??Ab,computedFirstInCategory:kt,computedLastInCategory:ur,computedFirst:ae===0,computedLast:oi,id:oe,header:G.header??k.header??G.name??G.field};ye&&(D+=cr,X.set(Ye.id,Ye),H[ae]=Ye,at==="start"&&(de.push(Ye),ee+=Ye.computedWidth),at==="end"&&(he.push(Ye),fe+=Ye.computedWidth),at||(K.push(Ye),ie+=Ye.computedWidth),Ie=at),Ye.groupByForColumn&&(Ye.computedSortType=G.sortType||k.sortType||Io,Ne.push(Ye)),B.set(Ye.id,Ye),Ye.field&&!Ye.groupByForColumn&&!je.has(Ye.field)&&je.set(Ye.field,Ye)}),Ne.forEach(G=>{G.computedSortable=Wu(G,{fieldsToColumn:je,sortable:f,columnDefaultSortable:x})});let $e=new Map;be.forEach(G=>{let oe=B.get(G);oe&&$e.set(G,oe)}),B.forEach(G=>{$e.has(G.id)||$e.set(G.id,G)});let bt=c!=null?Math.min(c,ee):ee,Nt=u!=null?Math.min(u,fe):fe;return{computedRemainingSpace:e.width-(U+se+te),computedPinnedStartColumnsWidth:ee,computedPinnedEndColumnsWidth:fe,computedUnpinnedColumnsWidth:ie,computedColumnOrder:j,computedPinnedStartColumns:de,computedPinnedEndColumns:he,computedUnpinnedOffset:ee,computedPinnedEndOffset:ee+ie,computedUnpinnedColumns:K,computedVisibleColumns:H,computedColumnsMap:B,computedColumnsMapInInitialOrder:$e,computedVisibleColumnsMap:X,computedPinnedEndWidth:Nt,computedPinnedStartWidth:bt,renderSelectionCheckBox:H.reduce((G,oe)=>G||!!oe.renderSelectionCheckBox,!1),fieldsToColumn:je}};function Wu(o,e){let{sortable:t,fieldsToColumn:n,columnDefaultSortable:r}=e;if(t)return t;let i=o.defaultSortable??o.colType.defaultSortable;if(i!=null)return i;let a=r??wi;return o.computedSortType!==Io&&a?!0:s=>{let{column:c,api:u}=s,d=c.groupByForColumn||[];return d!=null&&!Array.isArray(d)&&(d=[d]),(d||[]).reduce((f,p)=>{if(!f)return!1;let m=p.field||p.groupField,g;if(m){let b=n.get(m),h=b?u.getColumnApi(b.id):void 0;b&&h?g=h.isSortable():g=!1}return g===void 0&&p.valueGetter&&(g=!0),g??r??wi},!0)}}function ut(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)}};return l}function Wn(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:f,selectionMode:p}=u,m=i(),g=n.header&&typeof n.header!="function"?n.header:n.name||n.id||"";if(typeof n.header=="function"){let b=ut(n.id,{...e,actions:l,dataSourceActions:s,dataSourceApi:c});g=n.header({horizontalLayoutPageIndex:null,column:n,columnApi:b,dataSourceApi:c,renderLocation:t,dragging:!1,columnsMap:m.computedColumnsMap,columnSortInfo:n.computedSortInfo,columnFilterValue:n.computedFilterValue,filtered:n.computedFiltered,allRowsSelected:d,someRowsSelected:f,selectionMode:p,api:r,renderBag:{header:g}})??null}return g}var ju=V(require("react"));var Ii=`${ct}HeaderCell__filter`,Gl=`${ct}HeaderCell__filterOperator`,Hl=ju.createContext(null);var Fb=`${Ii}__input`,vi=o=>o.stopPropagation();function $u(o){let{filterOperatorMenuVisibleForColumnId:e}=gu(),{column:t}=Ir(),n=o.filterEditor,r=o.filterOperatorSwitch,[i,a]=(0,wr.useState)(!1),l=nt.useCallback(()=>{a(!0)},[]),s=nt.useCallback(()=>{a(!1)},[]),c=e===t.id||i;return nt.createElement("div",{onPointerUp:vi,onPointerDown:vi,onFocus:l,onBlur:s,className:`${Ii} ${Nl({active:c})}`,style:{height:o.columnHeaderHeight}},nt.createElement(Hl.Provider,{value:o},nt.createElement(r,null),nt.createElement(n,null)))}function Uu(){let{columnApi:o,disabled:e,operator:t}=vo(),n=t?.components?.Icon??wo;return nt.createElement("div",{"data-name":"filter-operator","data-disabled":e,onMouseDown:r=>{r.stopPropagation(),!e&&o.toggleFilterOperatorMenu(r.target)},className:Z(Gl,Pu,e?`${Gl}--disabled`:"")},nt.createElement(n,{size:20,className:`${Du({disabled:e})}`}))}function Yu(){return nt.createElement("div",{onPointerUp:vi,onPointerDown:vi,className:`${Ii} ${Nl({active:!1})} ${$c["50%"]}`})}function vo(){let o=J(),{column:e,columnApi:t}=Ir(),n=Wn(e,o,"column-filter"),r=nt.useContext(Hl),{columnFilterType:i,filterTypes:a,columnFilterValue:l}=r,s=a[i],[c,u]=(0,wr.useState)(l?.filter.value??""),d=nt.useCallback(b=>{u(b),r.onChange(b)},[r.onChange]),f=nt.useCallback(()=>{o.api.clearColumnFilter(e.id)},[e.id]),p=nt.useCallback(()=>{o.api.removeColumnFilter(e.id)},[e.id]);(0,wr.useEffect)(()=>{if(l)c!==l.filter.value&&u(l.filter.value);else if(s){let b=[...s.emptyValues][0];b!==c&&u(b)}},[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:f,removeColumnFilter:p,ariaLabel:`Filter for ${n}`,className:`${Ru} ${Fb}`}}function Ro(){let{ariaLabel:o,value:e,setValue:t,className:n,disabled:r}=vo();return Kl.createElement("input",{"data-xxx":!0,"aria-label":o,type:"text",disabled:r,value:e,onChange:i=>{t(i.target.value)},className:n})}function Ri(){let{ariaLabel:o,value:e,setValue:t,className:n,disabled:r}=vo();return Kl.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})}function Lb(){return{string:{label:"Text",emptyValues:[""],defaultOperator:"includes",components:{FilterEditor:Ro},operators:[{name:"includes",components:{Icon:ru},label:"Includes",fn:({currentValue:e,filterValue:t})=>typeof e=="string"&&typeof t=="string"&&e.toLowerCase().includes(t.toLowerCase())},{label:"Equals",components:{Icon:xl},name:"eq",fn:({currentValue:e,filterValue:t})=>typeof e=="string"&&e===t},{name:"startsWith",components:{Icon:du},label:"Starts With",fn:({currentValue:e,filterValue:t})=>e.startsWith(t)},{name:"endsWith",components:{Icon:iu},label:"Ends With",fn:({currentValue:e,filterValue:t})=>e.endsWith(t)}]},number:{label:"Number",emptyValues:["",null,void 0],defaultOperator:"eq",components:{FilterEditor:Ri},operators:[{label:"Equals",components:{Icon:xl},name:"eq",fn:({currentValue:e,filterValue:t})=>e==t},{label:"Not Equals",components:{Icon:uu},name:"neq",fn:({currentValue:e,filterValue:t})=>e!=t},{name:"gt",label:"Greater Than",components:{Icon:lu},fn:({currentValue:e,filterValue:t,emptyValues:n})=>n.includes(e)?!0:e>t},{name:"gte",components:{Icon:au},label:"Greater Than or Equal",fn:({currentValue:e,filterValue:t,emptyValues:n})=>n.includes(e)?!0:e>=t},{name:"lt",components:{Icon:cu},label:"Less Than",fn:({currentValue:e,filterValue:t,emptyValues:n})=>n.includes(e)?!0:e<t},{name:"lte",components:{Icon:su},label:"Less Than or Equal",fn:({currentValue:e,filterValue:t,emptyValues:n})=>n.includes(e)?!0:e<=t}]}}}var In=Lb();function xi(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&&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 Ao=require("react");function vn(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 qu(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 Y={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 Xu="true",ce={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)",minHeight:"var(--infinite-min-height)",borderRadius:"var(--infinite-border-radius)",focusOutline:"var(--infinite-focus-outline)",background:"var(--infinite-background)",iconSize:"var(--infinite-icon-size)",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)",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)"}}},Zu="column-header-height";var Qu=`.${Le.rootClassName}`;function Bl(o){return vn(o,Qu)}var Ju=q(Y.scrollLeft),kb=q(Y.scrollTop),zb=q(Y.columnWidthAtIndex),Wl=q(Y.columnOffsetAtIndex),ed=q(Y.columnReorderEffectDurationAtIndex),Vb=q(Y.columnOffsetAtIndexWhileReordering),Gb=q(Y.columnVisibilityAtIndex),Hb=q(Y.columnZIndexAtIndex);function Yt(o,e,t){let n=t?Bl(t):document.querySelector(Qu);Kb(o,e,n)}function Kb(o,e,t){if(t){let n=o,r=Y[n]?q(Y[n]):o;t.style.setProperty(r,`${e}`)}}function xo(o,e){if(e)for(var t in o){let n=Y[t]?q(Y[t]):t,r=`${o[t]}`;e.style.setProperty(n,r)}}function jl(o,e,t){Yt(`${Wl}-${o.computedVisibleIndex}`,o.computedPinned?`calc( ${o.computedAbsoluteOffset+e}px + var(${Ju}))`:`${o.computedAbsoluteOffset+e}px`,t)}function $l(o,e,t){Yt(`${Hb}-${o}`,`${e}`,t)}function Po(o,e,t){Yt(`${Vb}-${o}`,typeof e=="number"?`calc( var(${Wl}-${o}) + ${e}px )`:e,t)}function vr(o,e,t){Yt(`${Gb}-${o}`,e,t)}function Pi(o,e,t){Yt(`${ed}-${o}`,t??"",e)}function Ul(o,e){let t=`${ed}-${o}`;Yt(t,ce.components.Cell.reorderEffectDuration,e)}var we={columnWidths:{get(o){return`var(${this.getVarName(o)})`},getVarName(o){return this.varName.get(o)},varName:{get(o){return`${zb}-${o}`}},set(o,e,t){e=typeof e=="number"?e+"px":e,Yt(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`${Wl}-${o}`}},set(o,e,t){e=typeof e=="number"?e+"px":e,Yt(this.varName.get(o),e,t)}}};function td(o,e){xo({[Ju]:`${o.scrollLeft}px`,[kb]:`${o.scrollTop}px`},e)}var nd="_16lm1iw1",od="_1yeub2v0 _16lm1iw1 _16lm1iw1p _16lm1iw2f _16lm1iw0",rd="_1yeub2vs",id="_1yeub2vr",ad=pe({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 Yl="_1yeub2vp";var jR=pe({defaultClassName:"_1yeub2vl",variantClassNames:{pinned:{start:"_1yeub2vm",end:"_1yeub2vn",false:"_1yeub2vo"}},defaultVariants:{},compoundVariants:[]});var ql=o=>{let e=0;return(...t)=>{e&&cancelAnimationFrame(e),e=requestAnimationFrame(()=>{e=0,o(...t)})}};var Rr={bodyWidth:{name:q(ce.runtime.bodyWidth),value:""},totalVisibleColumnsWidthValue:{name:q(ce.runtime.totalVisibleColumnsWidthValue),value:""},totalVisibleColumnsWidthVar:{name:q(ce.runtime.totalVisibleColumnsWidthVar),value:""},visibleColumnsCount:{name:q(ce.runtime.visibleColumnsCount),value:""},browserScrollbarWidth:{name:q(ce.runtime.browserScrollbarWidth),value:""}},Bb=q(Y.scrollbarWidthHorizontal),ld=q(Y.scrollbarWidthVertical),Wb=q(Y.columnWidthAtIndex),jb=q(Y.columnZIndexAtIndex),sd=q(Y.scrollLeft),$b=q(Y.activeCellColWidth),cd=q(Y.activeCellColOffset),pd=q(Y.baseZIndexForCells),Ub=q(Y.pinnedStartWidth),ud=q(Y.bodyWidth),Yb=q(Y.bodyHeight),dd=q(Y.pinnedEndOffset),fd=q(Y.pinnedEndWidth),qb=q(Y.computedVisibleColumnsCount);function Xl(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(${pd}) `+(t<0?"-":"+")+` ${Math.abs(t)} )`:"auto"}function md(o){let e=wn(),{computed:t,state:n,actions:r,getState:i}=J(),{focused:a,focusedWithin:l,domRef:s,scrollerDOMRef:c,onBlurWithin:u,onFocusWithin:d,onSelfFocus:f,onSelfBlur:p,bodySize:m,activeCellIndex:g,wrapRowsHorizontally:b}=n,{computedPinnedStartColumnsWidth:h,computedPinnedEndColumnsWidth:y,computedPinnedStartColumns:S,computedPinnedEndColumns:C,computedVisibleColumns:T,computedUnpinnedColumnsWidth:I,scrollbars:w}=t,v=[],R=T.reduce((D,O)=>{let F=O.computedVisibleIndex;D[we.columnWidths.varName.get(F)]=O.computedWidth+"px",D[we.columnOffsets.varName.get(F)]=O.computedPinned==="start"?`calc( ${O.computedOffset}px + var(${sd}) )`:O.computedPinned==="end"?`calc( var(${dd}) ${v.length?"+":""} ${v.map(z=>we.columnWidths.get(z.computedVisibleIndex)).join(" + ")} + var(${sd}) )`:`${O.computedOffset}px`;let j=Xl(O,{pinnedStartColsCount:S.length,visibleColsCount:T.length});return D[`${jb}-${F}`]=`${j}`,O.computedPinned==="end"&&v.push(O),D},{});if(m.width&&(R[Rr.browserScrollbarWidth.name]=`${wn()}px`),R[Rr.bodyWidth.name]=`calc(${Y.bodyWidth} - ${Y.scrollbarWidthVertical})`,R[Rr.totalVisibleColumnsWidthValue.name]=`${h+y+I}px`,R[Rr.totalVisibleColumnsWidthVar.name]=`calc(${T.map((D,O)=>`var(${Wb}-${O})`).join(" + ")})`,R[Rr.visibleColumnsCount.name]=T.length,g!=null){R[$b]=we.columnWidths.get(g[1]);let D=we.columnOffsets.get(g[1]);if(n.brain.isHorizontalLayoutBrain){let O=n.brain.getPageIndexForRow(g[0]);R[cd]=O?`calc( ${ce.runtime.totalVisibleColumnsWidthVar} * ${O} + ${D})`:D}else R[cd]=D}R[qb]=T.length,R[Bb]=w.horizontal?`${e}px`:"0px",R[ld]=w.vertical?`${e}px`:"0px",R[Ub]="calc( "+S.map(D=>we.columnWidths.get(D.computedVisibleIndex)).join(" + ")+")",R[fd]="calc( "+C.map(D=>we.columnWidths.get(D.computedVisibleIndex)).join(" + ")+")",R[pd]=T.length*10,R[dd]=`calc( var(${ud}) - var(${fd}) - var(${ld}) )`,R[ud]=`${m.width}px`,R[Yb]=`${m.height}px`;let x=ql(D=>{r.focused=D}),M=ql(D=>{r.focusedWithin=D}),P={...o,onFocus:D=>{if(o?.onFocus?.(D),D.target===s.current||D.target===c.current){if(i().focused)return;x(!0),f?.(D),l&&(M(!1),u?.(D));return}l||(M(!0),d?.(D))},onBlur:D=>{if(o?.onBlur?.(D),D.target===s.current||D.target===c.current){if(!i().focused)return;x(!1),p?.(D),l&&(M(!1),u?.(D));return}s.current?.contains(D.relatedTarget)||(M(!1),u?.(D))}},_=Z(qt,od,b?`${qt}--horizontal-layout`:null,P?.className,h?`${qt}--has-pinned-start ${id}`:null,y?`${qt}--has-pinned-end ${rd}`:null,a?`${qt}--focused`:null,l?`${qt}--focused-within`:null,a&&n.focusedClassName?n.focusedClassName:null,l&&n.focusedWithinClassName?n.focusedWithinClassName:null,t.computedPinnedStartOverflow?`${qt}--has-pinned-start-overflow`:null,t.computedPinnedEndOverflow?`${qt}--has-pinned-end-overflow`:null,ad({horizontalLayout:!!b,hasPinnedStart:!!h,hasPinnedEnd:!!y,focused:a,focusedWithin:l}));return P.className=_,P.style={...o?.style,...R},a&&n.focusedStyle&&Object.assign(P.style,n.focusedStyle),l&&n.focusedWithinStyle&&Object.assign(P.style,n.focusedWithinStyle),P}var Id=V(jn());function Di(o){return o.map(e=>e instanceof Rn?e:new Rn(null,[e]))}var Rn=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=>Xb(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 Xb(o,e){return typeof o=="string"||typeof o=="number"?`${o}`:e?o.__get(e):o.done()}var Zb=(...o)=>new Rn("+",Di(o)),hd=(...o)=>new Rn("-",Di(o)),Qb=(...o)=>new Rn("*",Di(o)),Jb=(...o)=>new Rn("/",Di(o)),xr={add:Zb,subtract:hd,minus:hd,multiply:Qb,divide:Jb};var $n=(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 ze=xe().requestAnimationFrame||(o=>setTimeout(o,16)),zt=xe().cancelAnimationFrame||(o=>clearTimeout(o));var bd=o=>{let e=null,t=null;return{stop(){e!==null&&zt(e),t!=null&&zt(t)},scroll(n){e!==null&&zt(e),t!=null&&zt(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),f=0;for(let p=0;p<u;p++)s>(p+1)*d&&(f=r.scrollAmountsPerRaf[p]);return n.scrollLeft=n.scrollLeft-f,e=ze(()=>{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),f=0;for(let p=0;p<u;p++)s>(p+1)*d&&(f=r.scrollAmountsPerRaf[p]);return n.scrollLeft=n.scrollLeft+f,t=ze(()=>{i.scroll(n)}),!0}return!!(a()||l())}}};var Ke=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 yd(o,e){let t=Math.atan2(o.top-e.top,o.left-e.left);return t<=0&&(t=2*Math.PI+t),t}function Td(o,e){return Math.sqrt((e.top-o.top)**2+(e.left-o.left)**2)}function ey(o,e,t){let n=yd(o,t),r=yd(e,t);return n===r?Td(t,e)-Td(t,o):n-r}function Sd(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)=>ey(n,r,t)),e}function ty(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 ny(o,e){if(o.length<2)return o[0]?o[0].left===e.left&&o[0].top===e.top:!1;o=Sd(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 Cd(o,e){if(ty(o))return ny(o,e);o=Sd(o);let[t]=o;for(let n=1,r=o.length-1;n<r;n++){let i=o[n],a=o[n+1];if(oy([t,i,a],e))return!0}return!1}function oy(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 Do=class{containsPoint(e){return Cd(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 Mo=class o extends Do{static clone(e){return new o(e)}constructor(e){super(),this.points=e.map(Ke.clone)}getPoints(){return this.points}shift(e){return this.points.forEach(t=>{t.shift(e)}),this}};function ry(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 ve({top:n,left:t,width:a-t,height:c-n})}var ve=class o extends Do{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=ry(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 Mo(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(Ke.from)}shift(t){return t.top!=null&&(this.top+=t.top),t.left!=null&&(this.left+=t.left),this}};var wd=10,iy=q(Y.pinnedStartWidth);function vd(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:f,setProxyPosition:p,setDragColumnOutside:m,getCurrentDragSourceAndTarget:g,api:b,horizontalLayoutPageIndex:h,pageWidth:y}=o;function S(H){let X=H==="start"?F:j;return _===O?X:O===H?X+E.computedWidth:_===H?X-E.computedWidth:X}function C(H){if(H.columnIndex===P||h!=null)return!0;let X=e[H.columnIndex];if(X.computedPinned)return!0;let B=l.getScrollPosition().scrollLeft,ie=X.computedOffset+(h!=null&&y!=null?y*h:0);return ie>=B+S("start")&&ie+X.computedWidth<=B+u.width-S("end")}let T=(H,X)=>{let{restrictToParentGroup:B,dragColumn:ie}=X,ee=[];if(H.forEach(Ie=>{if(Ie.computedVisibleIndex===P)return;let N={columnId:Ie.id,columnIndex:Ie.computedVisibleIndex,offsetX:Ie.computedOffset+Math.round(Ie.computedWidth/2)};C(N)&&ee.push(N)}),B){let N=function(te,se,Me){let Ne=H[te];Ne&&(Ne.columnGroup!==ie.columnGroup&&Me.add(Ne.id),N(te+se,se,Me))};var fe=N;let Ie=ie.computedVisibleIndex,U=new Set;N(Ie-1,-1,U),N(Ie+1,1,U),ee=ee.filter(te=>!U.has(te.columnId))}return ee},w=r.length,v={clientX:Math.round(o.initialMousePosition.clientX),clientY:Math.round(o.initialMousePosition.clientY)},R={left:v.clientX-u.left-(v.clientX-s.left)+wd,top:v.clientY-u.top-(v.clientY-s.top)+wd},x=l.getScrollPosition(),M=e.map(H=>H.computedVisibleIndex),A=M,E=t.get(i),P=E.computedVisibleIndex,_=E?.computedPinned,D=P,O=_,F=l.getFixedStartColsWidth(),j=l.getFixedEndColsWidth(),z=v,L={x:0,y:0},le=1,ne=0;function W(H){let X=Math.round(H.clientX),B=Math.round(H.clientY);if(X===z.clientX&&B===z.clientY)return ve.from(s).shift({left:L.x,top:L.y});z={clientX:X,clientY:B};let ee=l.getScrollPosition().scrollLeft-x.scrollLeft;return L.x=z.clientX-v.clientX,L.y=z.clientY-v.clientY,ne=L.x+ee,le=ne<0?-1:1,p({left:R.left+L.x,top:R.top+L.y}),ve.from(s).shift({left:L.x,top:L.y})}function $(H){let X=0;_?_==="start"&&H.forEach((B,ie)=>{X||e[B]?.computedPinned!=="start"&&(X=ie)}):H.forEach((B,ie)=>{e[B]?.computedPinned==="start"&&(X=ie+1)}),w=X,re("start",H,X)}function re(H,X,B){if(H==="start"){let ie=0;for(let ee=0;ee<B;ee++){let fe=X[ee],Ie=e[fe];ie+=Ie.computedWidth}Yt(iy,`${ie}px`,a)}}function ge(H){if(H==null||H===D)return;if(D===-1&&H!==-1&&(vr(P,"",a),m(!1)),D=H,H===-1){me(P);return}let X=$n(M,P,D>P?D-1:D);w=0;let ie=new Set;return X.forEach((ee,fe)=>{let Ie=A[fe];ee!==Ie&&ie.add(ee),$(X)}),A=X,ue(ie),{newColumnIndexes:X,indexesWithTransition:ie,pinnedStartCount:w}}function me(H){A=A.filter(B=>B!==H),e.forEach(B=>{let ie=B.computedVisibleIndex,ee=ie>H;Ul(ie,a);let fe="";ee&&(fe=xr.minus(we.columnOffsets.get(ie),we.columnWidths.get(H)).done()),Po(ie,fe,a)}),vr(H,"hidden",a),m(!0)}function ue(H){e.forEach(X=>{let B=X.computedVisibleIndex;H.has(B)?Ul(B,a):Pi(B,a);let ie=B===P,ee=le===-1?B<D||B>P:B<P||B>=D,fe="";le===-1?fe=ie?we.columnOffsets.get(D):ee?we.columnOffsets.get(B):xr.add(we.columnOffsets.get(B),we.columnWidths.get(P)).done():fe=ee?we.columnOffsets.get(B):ie?xr.add(we.columnOffsets.get(D-1),we.columnWidths.get(D-1)).minus(we.columnWidths.get(P)).done():xr.minus(we.columnOffsets.get(B),we.columnWidths.get(P)).done(),Po(B,fe,a)})}let de=u.left+S("start"),he=u.right-S("end"),K=bd({scrollOffsetStart:de,scrollOffsetEnd:he});return W(v),{speedScroller:K,stop(){K.stop()},onMove(H){let X=W(H);if(g().dropTargetListId==="grouping-toolbar"||f&&!d.containsPoint(X.getCenter()))return f&&ge(-1),null;K.scroll({mousePosition:z,get scrollLeft(){return l.getScrollPosition().scrollLeft},set scrollLeft(N){b.scrollLeft=N}});let B=T(e,{dragColumn:E,restrictToParentGroup:c==="group"}),ie=le===-1?E.computedOffset+ne:E.computedOffset+E.computedWidth+ne,ee=(0,Id.default)(B,ie,({offsetX:N},U)=>N<U?-1:N>U?1:0);ee<0&&(ee=~ee),B.length?ee=B[ee]?B[ee].columnIndex:B[B.length-1].columnIndex+1:(e.length>1&&console.error("No breakpoints available, something is wrong!"),ee=0),ee===P+1&&(ee=P),ge(ee);let fe={};n.forEach(N=>{fe[N.id]="end"});for(let N=0;N<w;N++){let U=A[N],te=e[U];fe[te.id]="start"}let Ie=A.map(N=>e[N].id);return{columnPinning:fe,columnOrder:Ie}}}}function At(o,e,t){if(o===e)return!0;if(!o||!e)return!1;var n=Object.keys(o),r=Object.keys(e);t&&(n=n.filter(s=>!t.has(s)),r=r.filter(s=>!t.has(s)));var i=n.length;if(r.length!==i)return!1;for(var a=0;a<i;a++){var l=n[a];if(!(t&&t.has(l))&&(o[l]!==e[l]||!Object.prototype.hasOwnProperty.call(e,l)))return!1}return!0}function Zl(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 $n(n,u,c)}else{let l=e.indexOf(r),s=e[l+1],c=n.indexOf(s),u=n.indexOf(r);return $n(n,u,c)}return e}var pt=V(require("react"));var Un=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 Rd=V(jn());var xd=(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,f=c===a,p=Ke.from(d.getCenter());if(!l.containsPoint(p))return null;e.activeDragSourcePosition="inside";let m=f?r==="horizontal"?t.left>0?1:-1:t.top>0?1:-1:1,g=d.toDOMRect(),b=e.breakpoints,h=Math.round(m===1?r==="horizontal"?g.right-(f?0:g.width/2):g.bottom-(f?0:g.height/2):r==="horizontal"?g.left+(f?0:g.width/2):g.top+(f?0:g.height/2)),y=(0,Rd.default)(b,h,(w,v)=>w-v);y<0&&(y=~y),m===1&&y===u+1&&f&&y--;let S=Math.min(u,y),C=Math.max(u,y),T=f?i.map((w,v)=>{if(v===u&&f)return t;if(v<S||v>=C)return{left:0,top:0};let R=y<=v?1:-1;return r==="horizontal"?{left:Math.round(R*g.width),top:0}:{left:0,top:Math.round(R*g.height)}}):i.map((w,v)=>{let R=y<=v?1:0;return r==="horizontal"?{left:Math.round(R*g.width),top:0}:{left:0,top:Math.round(R*g.height)}}),I={offset:t,dropIndex:y,dragSourceListId:c,dropTargetListId:a,dragIndex:u,outside:!1,items:i,dragItem:s,offsetsForItems:T,dragRect:g,status:"accepted"};return e.acceptsDrop(I)?{event:I,error:null,success:!0}:(I.status="rejected",{event:I,error:"rejected by interaction target",success:!1})},Pd=(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=Ke.from(s.getCenter()),f=u===i,p=a.containsPoint(d);if(p&&!(f&&!e.acceptsSelfDrops())||e.activeDragSourcePosition==="outside"&&!f)return null;e.activeDragSourcePosition="outside";let m=f?n.dragIndex:-1,g=s.toDOMRect(),b={offset:t,dropIndex:-1,dragIndex:m,dragItem:c,outside:!p,items:l,dragSourceListId:u,dropTargetListId:i,offsetsForItems:f?l.map((h,y)=>h.id===c.id?t:p?{left:0,top:0}:y>m?r==="horizontal"?{left:-c.rect.width,top:0}:{left:0,top:-c.rect.height}:{left:0,top:0}):l.map(h=>({left:0,top:0})),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})};var _e=class _e{static startDrag(e,t){let n=e instanceof Eo?e:new Eo(e),r=new Ql({activeDragSource:n,startPoint:t});return r.on("start",_e.onDragStart),r.on("move",_e.onDragMove),r.on("drop",_e.onDragDrop),r.start(),r}static emit(e,...t){_e.emitter.emit(e,...t)}static on(e,t){return _e.emitter.on(e,t)}static registerDragInteractionTarget(e){if(_e.dragInteractionTargetsMap.has(e.listId)){console.warn(`DragInteractionTarget with listId ${e.listId} already registered`);return}return _e.dragInteractionTargetsMap.set(e.listId,e),_e.emit("register",e),()=>{_e.unregisterDragInteractionTarget(e)}}static unregisterAll(){_e.dragInteractionTargetsMap.forEach(e=>{_e.unregisterDragInteractionTarget(e)})}static unregisterDragInteractionTarget(e){if(e){if(!_e.dragInteractionTargetsMap.has(e.listId)){console.warn(`DragInteractionTarget with listId ${e.listId} not found`);return}_e.dragInteractionTargetsMap.delete(e.listId),e.unregister(),_e.emit("unregister",e)}}static onDragStart(e){let{dragItem:t,dragIndex:n}=e.activeDragSource,r=e.activeDragSource.listId,a=_e.dragInteractionTargetsMap.get(r)?.getData().acceptDropsFrom,s=!a||a.includes(r)?r:null;_e.dragInteractionTargetsMap.forEach(c=>{let u=c.getData();c.start({dragIndex:u.listId===r?n:-1,dragItem:t,dragSourceListId:r,dropTargetListId:s})}),_e.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=_e.dragInteractionTargetsMap.get(r);l&&(a=l.acceptsSelfDrops(),a&&i.push(_e.dragInteractionTargetsMap.get(r))),_e.dragInteractionTargetsMap.forEach(s=>{s.listId!==r&&i.push(s)});for(let s of i){let c=xd(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=Pd(e,s);c&&t(s,c)}}static onDragMove(e){let{activeDragSource:t}=e,{listId:n,dragItem:r}=t,i=null,a=[];_e.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;_e.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=[];_e.withDragMove(e,(s,{event:c})=>{s.drop(c),a.push(c),c.outside||(i=c)});let l=i??a[0]??null;_e.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}),_e.unregisterAll()}};_e.dragInteractionTargetsMap=new Map,_e.emitter=new Un;var Tt=_e,Eo=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){At(this.data,e)||(this.data=e,this.dragRectangle=new ve(this.data.dragItem.rect))}getData(){return this.data}static shift(e,t){let n=o.clone(e),r=ve.from(n.dragRectangle);return r.shift(t),n.dragRectangle=r,n}},Ql=class extends Un{constructor(t){super(t.listeners);this.phase="start";this.currentOffset={top:0,left:0};this.initialDragSource=Eo.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)}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=Eo.shift(this.initialDragSource,n),this.currentOffset=n,this.emit("move",this)}};globalThis.DragManager=Tt;var Dd=require("react"),Md=pt.createContext({dragSourceListId:null,dropTargetListId:null,dragItemId:"",status:"accepted",updateDragOperationSourceAndTarget:o=>{},getCurrentDragSourceAndTarget:()=>({dragSourceListId:null,dropTargetListId:null,status:"accepted",dragItemId:""})}),Yn=()=>pt.useContext(Md),Jl=o=>{let[e,t]=pt.useState({dragSourceListId:null,dropTargetListId:null,dragItemId:"",status:"accepted"}),n=pt.useRef(e);n.current=e;let r=pt.useCallback(()=>{let a=n.current;return{dragSourceListId:a.dragSourceListId,dropTargetListId:a.dropTargetListId,dragItemId:a.dragItemId,status:a.status}},[]),i=pt.useMemo(()=>({dragSourceListId:e.dragSourceListId,dropTargetListId:e.dropTargetListId,dragItemId:e.dragItemId,status:e.status,updateDragOperationSourceAndTarget:t,getCurrentDragSourceAndTarget:r}),[e,t]);return(0,Dd.useEffect)(()=>{let a=Tt.on("drag-start",c=>{t({dragSourceListId:c.dragSourceListId,dropTargetListId:c.dropTargetListId,dragItemId:c.dragItem.id,status:"accepted"})}),l=Tt.on("drag-move",c=>{let u=n.current,d={dragSourceListId:c.dragSourceListId,dropTargetListId:c.dropTargetListId,dragItemId:c.dragItem.id,status:c.status};JSON.stringify(u)!==JSON.stringify(d)&&t(d)}),s=Tt.on("drag-drop",()=>{t({dragSourceListId:null,dropTargetListId:null,dragItemId:"",status:"accepted"})});return()=>{a(),l(),s()}},[Tt,t]),pt.createElement(Md.Provider,{value:i},typeof o.children=="function"?o.children(i):o.children)};var es=`${ct}Body`,Ed=o=>o.querySelector(`.${es}`);var qn=`${ct}HeaderCell`,ts=`${ct}HeaderWrapper`,Ad=o=>Array.from(o.querySelectorAll(`.${ts}`));function Mi(o){if(!o)return!1;let e=o.tagName;return e==="INPUT"||e==="BUTTON"}var ay=q(Y.baseZIndexForCells),ly=(o,e)=>{let t=!o||Object.keys(o).length===0,n=!e||Object.keys(e).length===0;return t&&n?!0:!!o!=!!e?!1:At(o,e)},_d=({columnId:o,domRef:e,horizontalLayoutPageIndex:t,allowColumnHideOnDrag:n})=>{let[r,i]=(0,Ao.useState)(null),[a,l]=(0,Ao.useState)(!1),{getCurrentDragSourceAndTarget:s}=Yn(),{actions:c,computed:u,getComputed:d,getState:f,api:p,state:{domRef:m}}=J(),g=(0,Ao.useCallback)(h=>{let y=d().computedVisibleColumnsMap.get(o);if(!y||!y.computedSortable)return;let{multiSortBehavior:S}=f();p.toggleSortingForColumn(o,{multiSortBehavior:S==="replace"&&(h.ctrlKey||h.metaKey)?"append":S})},[]),b=(0,Ao.useCallback)(h=>{if(Mi(h.target))return;let{brain:y,draggableColumnsRestrictTo:S}=f(),{computedVisibleColumns:C,computedVisibleColumnsMap:T,computedPinnedStartColumns:I,computedUnpinnedColumns:w,computedPinnedEndColumns:v}=d(),R=T.get(o);if(!R.computedDraggable){g(h);return}let x=e.current,M=x.getBoundingClientRect(),A=m.current.getBoundingClientRect(),E=y.getAvailableSize(),P=R.computedVisibleIndex,_=y.getVirtualColIndex(R.computedVisibleIndex,{pageIndex:t||0}),D=y.isHorizontalLayoutBrain?y.getPageWidth():null,O=x.style.cursor??"auto",F=!1,j=m.current,z=ve.from(Ed(j).getBoundingClientRect()),L=Ad(j).map(de=>ve.from(de.getBoundingClientRect())),le=z.getMinimumBoundingRectangle(...L),ne=vd({brain:y,horizontalLayoutPageIndex:t,allowColumnHideOnDrag:n,pageWidth:D,draggableColumnsRestrictTo:S,computedPinnedEndColumns:v,computedPinnedStartColumns:I,computedUnpinnedColumns:w,computedVisibleColumns:C,computedVisibleColumnsMap:T,dragColumnHeaderTargetRect:M,dragColumnId:o,getCurrentDragSourceAndTarget:s,api:p,infiniteDOMNode:m.current,setProxyPosition:i,setDragColumnOutside:l,tableRect:A,acceptDropToReorderRect:le,initialMousePosition:{clientX:h.clientX,clientY:h.clientY}}),W=null,$,re;function ge(de){let{columnPinning:he,columnOrder:K}=de;ly(f().columnPinning,he)||(c.columnPinning=he);let H=d().computedColumnOrder;JSON.stringify(K,H)&&(C.forEach(X=>{Po(X.computedVisibleIndex,"",m.current)}),c.columnOrder=Zl({newColumnOrder:K,visibleColumnOrder:d().computedVisibleColumns.map(X=>X.id),existingColumnOrder:H,dragColumnId:o}))}let me=de=>{let{headerBrain:he,brain:K}=f();if(!F){F=!0;let H=K.keepColumnRendered(_),X=he.keepColumnRendered(_);if(K.isHorizontalLayoutBrain){let ie=K.extendRenderRange({start:!0,end:!0,direction:"horizontal"}),ee=he.extendRenderRange({start:!0,end:!0,direction:"horizontal"});re=()=>{ie(),ee()}}$=()=>{H(),X()},c.columnReorderDragColumnId=R.id,t!=null&&(c.columnReorderInPageIndex=t),$l(P,`calc( var(${ay}) + 10000 )`,m.current),m.current?.classList.add(Yl),x.style.cursor="grabbing"}W=ne.onMove(de)},ue=de=>{let he=de.pointerId;requestAnimationFrame(()=>{let{multiSortBehavior:K}=f(),H=e.current;m.current?.classList.remove(Yl),ne.stop(),y.update({...E}),$?.(),re?.(),C.forEach(B=>{Pi(B.computedVisibleIndex,m.current),vr(B.computedVisibleIndex,"",m.current),Po(B.computedVisibleIndex,"",m.current)}),$l(P,Xl(R,{pinnedStartColsCount:I.length,visibleColsCount:C.length}),m.current),H.style.cursor=O,H.releasePointerCapture(he),H.removeEventListener("pointermove",me),H.removeEventListener("pointerup",ue),i(null);let X=p.getColumnApi(R.id)?.isSortable()??!1;!F&&X&&p.toggleSortingForColumn(R.id,{multiSortBehavior:K==="replace"&&(de.ctrlKey||de.metaKey)?"append":K}),W?ge(W):F&&n&&p.setVisibilityForColumn(R.id,!1),c.columnReorderDragColumnId=!1,t!=null&&(c.columnReorderInPageIndex=null)})};x.addEventListener("pointermove",me),x.addEventListener("pointerup",ue),x.setPointerCapture(h.pointerId)},[o,t]);return{onPointerDown:u.computedVisibleColumnsMap.get(o)?.computedDraggable?b:g,dragColumnOutside:a,proxyPosition:r}};var Oo=V(require("react"));var Se=V(require("react")),Ve=require("react");var Zn=V(require("react"));var Od=o=>o.dataSourceHasGrouping&&o.isGroupRow&&o.childrenLoading||!o.selfLoaded;var Pr=V(require("react")),Ld=require("react");var Nd="_6rdmyg0 _16lm1iw1d _16lm1iwk _16lm1iw9",Fd=pe({defaultClassName:"_6rdmyg1",variantClassNames:{expanded:{true:"_16lm1iwi",false:"_6rdmyg3"},direction:{end:"_6rdmyg4",start:"_6rdmyg5"},disabled:{true:"_6rdmyg6",false:"_6rdmyg7"}},defaultVariants:{},compoundVariants:[[{expanded:!1,direction:"end"},"_16lm1iwj"]]});var Ei=`${yt}-expand-collapse`;function Xn(o){let{size:e=24,direction:t="start",disabled:n=!1}=o,[r,i]=(0,Ld.useState)(o.expanded??o.defaultExpanded),a=()=>{o.onChange?.(!r),Tn("expanded",o)||i(!r)};Pr.useEffect(()=>{Tn("expanded",o)&&i(o.expanded)},[o.expanded]);let l=r?"expanded":"collapsed";return Pr.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:Z(o.className,Nd,Fd({direction:t||"start",expanded:r,disabled:n}),`${yt}`,`${Ei}`,`${Ei}--${l}`,`${Ei}--${t==="end"?"end":"start"}`,n?`${Ei}--disabled`:"")},Pr.createElement("path",{d:"M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"}))}var Ai=V(require("react"));var kd="_16lm1iwb _16lm1iw1d _16lm1iwk";var zd=o=>Ai.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",style:{margin:"auto",display:"block",shapeRendering:"auto"},width:"24px",height:"24px",viewBox:"0 0 100 100",preserveAspectRatio:"xMidYMid",className:Z(o.className,kd,"InfiniteIcon","InfiniteIcon-loading")},Ai.createElement("circle",{cx:"50",cy:"50",fill:"none",strokeWidth:"10",r:"35",strokeDasharray:"164.93361431346415 56.97787143782138"},Ai.createElement("animateTransform",{attributeName:"transform",type:"rotate",repeatCount:"indefinite",dur:"1s",values:"0 50 50;360 50 50",keyTimes:"0;1"})));var{rootClassName:sy}=Le,Xt=`${sy}ColumnCell`;var Vd=pe({defaultClassName:"_7pupv01",variantClassNames:{align:{start:"_7pupv02",center:"_7pupv03",end:"_7pupv04"}},defaultVariants:{},compoundVariants:[]}),Gd="_7pupv00",Hd=pe({defaultClassName:"_7pupv05",variantClassNames:{align:{start:"_7pupv06",center:"_7pupv07",end:"_7pupv08"}},defaultVariants:{},compoundVariants:[]});function Kd({rowInfo:o}){return{[q(ce.components.Row.groupNesting)]:o.dataSourceHasGrouping?o.isGroupRow?o.groupNesting-1:o.groupNesting:0}}function _i({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=Z(To.flex,i.align==="end"?Sr.rowReverse:Sr.row,Wc.center,`${Xt}Expander`,e==="single-column"||e==="multi-column"&&(!n.isGroupRow||c)?Vd({align:a}):null);if(e==="multi-column"){if(o+1!==u.groupNesting&&u.isGroupRow)return c?Zn.createElement("div",{className:d},c):null}else e==="single-column"&&u.isGroupRow;return Zn.createElement("div",{className:d},s,c,Zn.createElement("div",{className:Ut},l??null))}}function Oi({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 f=u.groupKeys,p=null,m=s?(u.groupKeys?.length||0)<l?.length:(u.groupKeys?.length||0)<=l?.length;return Od(u)?p=Zn.createElement(zd,null):m&&(p=Zn.createElement(Xn,{expanded:!d,direction:c.align==="end"?"end":"start",onChange:()=>{t(f)}})),n&&(r.renderBag.groupIcon=p,p=Zn.createElement(mt,{render:n,renderParam:r})),p}}function Bd(o,e,t){let{groupByForColumn:n,groupIndexForColumn:r,groupRenderStrategy:i}=o,a=n.column?{...n.column}:{},l={header:`Group by ${n.field||n.groupField}`,groupByForColumn:n,render:_i({groupIndexForColumn:r,groupRenderStrategy:i}),...a,renderGroupIcon:Oi({initialRenderGroupIcon:a?.renderGroupIcon,groupIndexForColumn:r,toggleGroupRow:e,groupRenderStrategy:i})};return t&&(typeof t=="function"?l={...l,...t(o,e)}:l={...l,...t}),l}function Wd(o,e,t){let n=typeof t=="function"?t(o,e):t,r={};return o.sortable!=null&&(r.sortable=o.sortable),{...r,header:"Group",groupByForColumn:o.groupBy,renderSelectionCheckBox:o.selectionMode==="multi-row",render:_i({groupIndexForColumn:0,groupRenderStrategy:"single-column"}),...n,renderGroupIcon:Oi({initialRenderGroupIcon:n?.renderGroupIcon,groupIndexForColumn:0,toggleGroupRow:e,groupRenderStrategy:"single-column"})}}var jd="_1eexc2a7 _1eexc2a6",$d=pe({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"]]}),Ud=pe({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 Yd="_1eexc2a5",Ni=pe({defaultClassName:"_1eexc2aa",variantClassNames:{direction:{up:"_1eexc2ab",down:"_1eexc2ac",neutral:"_1eexc2ad"}},defaultVariants:{},compoundVariants:[]}),Fi="_1eexc2a8";var Li=V(require("react")),ki=require("react");var qd="qz8ht90 _16lm1iwk";function cy(){return{checked:1,disabled:o=>o??!1,domProps:1}}var{ManagedComponentContextProvider:uy}=Et({forwardProps:cy,mappedCallbacks:{checked:o=>({callbackName:"onChange",callbackParams:[o]})},debugName:"InfiniteCheckBox"});function dy(){let{componentState:o,componentActions:e}=qe(),{checked:t,domProps:n,disabled:r}=o,i=(0,ki.useRef)(null);return(0,ki.useEffect)(()=>{i.current.indeterminate=t==null},[t]),Li.createElement("input",{...n,className:Z("InfiniteCheckBox",qd,n?.className),type:"checkbox",ref:i,checked:!!t,disabled:r,onChange:()=>{r||(e.checked=!t)}})}function rn(o){return Li.createElement(uy,{...o},Li.createElement(dy,null))}function fy(o){return typeof o.field=="string"}function Xd(o){let{column:e,rowInfo:t,fieldsToColumn:n}=o,r;if(e.groupByForColumn){if(t.isGroupRow){let i=t.groupBy[t.groupBy.length-1];r=i?n.get(i.field||i.groupField):void 0}!r&&e.field&&(r=n.get(e.field))}return r}function St(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,f=e().computedColumnsMap.get(i),{activeRowIndex:p,keyboardNavigation:m,isRowDetailEnabled:g}=n(),b=r===p&&m==="row",h=!g||typeof g=="function"&&!g(c)?!1:a.rowDetailApi.isRowDetailExpanded(c.id)?"expanded":"collapsed",{formattedValue:y,formattedValueContext:{rawValue:S}}=_o({column:f,rowInfo:c,rowDetailState:h,columnsMap:e().computedColumnsMap,context:o}),C=ut(f.id,o);return u?{api:a,dataSourceApi:l,column:f,columnApi:C,isParentNode:!1,isGroupRow:!0,isTreeNode:!1,rowDetailState:!1,data:c.data,rowActive:b,rowInfo:c,rowSelected:c.rowSelected,value:y,rawValue:S}:d?c.isParentNode?{api:a,dataSourceApi:l,columnApi:C,column:f,nodeExpanded:c.nodeExpanded,isTreeNode:!0,isGroupRow:!1,isParentNode:!0,rowDetailState:h,data:c.data,rowActive:b,rowInfo:c,rowSelected:c.rowSelected,value:y,rawValue:S}:{api:a,dataSourceApi:l,columnApi:C,column:f,nodeExpanded:!1,isTreeNode:!0,isGroupRow:!1,isParentNode:!1,rowDetailState:h,data:c.data,rowActive:b,rowInfo:c,rowSelected:c.rowSelected,value:y,rawValue:S}:{api:a,dataSourceApi:l,columnApi:C,column:f,isTreeNode:!1,isParentNode:!1,isGroupRow:!1,rowDetailState:h,data:c.data,rowActive:b,rowInfo:c,rowSelected:c.rowSelected,value:y,rawValue:S}}function Zd(o){return Jd(o.column,o.rowInfo)}function Qd(o){let{column:e,context:t,rowInfo:n,visibleColumnsIds:r}=o,i=Xd({rowInfo:n,column:e,fieldsToColumn:o.fieldsToColumn,groupRenderStrategy:t.getState().groupRenderStrategy}),{getState:a}=t,{editingCell:l}=a(),s=_o(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 f=typeof e.align=="function"?e.align({isHeader:!1,...d}):e.align??"start",p=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:py({rowIndexInHorizontalLayoutPage:o.rowIndexInHorizontalLayoutPage,horizontalLayoutPageIndex:o.horizontalLayoutPageIndex,column:o.column,rowInfo:o.rowInfo,visibleColumnsIds:o.visibleColumnsIds,columnsMap:o.columnsMap,fieldsToColumn:o.fieldsToColumn,context:o.context,align:f,verticalAlign:p,formattedValueContext:c}),groupByColumnReference:i}}function py(o){let{column:e,context:t,rowInfo:n,align:r,verticalAlign:i,visibleColumnsIds:a,columnsMap:l,fieldsToColumn:s,formattedValueContext:c}=o,{value:u}=c,{api:d,getDataSourceState:f,getState:p,dataSourceApi:m}=t,{editingCell:g}=p(),{indexInAll:b}=n,h=f(),{selectionMode:y,cellSelection:S}=h,C=Xd({rowInfo:n,column:e,fieldsToColumn:s,groupRenderStrategy:t.getState().groupRenderStrategy}),T=d.toggleGroupRow,I=S?.isCellSelected(n.id,e.id)??!1,w={column:e,columnsMap:l,fieldsToColumn:s,align:r,verticalAlign:i,cellSelected:I,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:C,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:b,toggleGroupRow:T,toggleCurrentGroupRow:()=>{n.isGroupRow&&T(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:h.groupBy,pivotBy:h.pivotBy};return Object.defineProperty(w,"rowHasSelectedCells",{get(){return n.hasSelectedCells(a)}}),w}function Jd(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:fy(o)?t?.[o.field]:null;return o.field&&e.isGroupRow&&e.reducerData&&e.reducerData[o.field]!=null&&(a=e.reducerData[o.field]),o.valueGetter&&!e.isGroupRow&&e.data&&(a=o.valueGetter({data:e.data,field:o.field})),a}function my(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,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,data:t.data,rowDetailState:r,rowSelected:i,rowActive:c,value:o,rawValue:o,field:e.field}}function _o(o){let{column:e,rowInfo:t,context:n,rowDetailState:r}=o,i=Jd(e,t),a=my(i,e,t,n,r),l=e.valueFormatter?e.valueFormatter(a):i;return a.value=l,{formattedValue:l,formattedValueContext:a}}var an=V(require("react"));var{rootClassName:ef}=Le,Qn=`${ef}Cell`,ns=`${ef}Cell_content`,gy=q(Y.columnWidthAtIndex),hy=q(Y.columnReorderEffectDurationAtIndex);function by(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:f,cssPosition:p,renderChildren:m,horizontalLayoutPageIndex:g,...b}=o,h=typeof m=="function"?m():m,y={width:`var(${gy}-${i.computedVisibleIndex})`,transition:`transform var(${hy}-${i.computedVisibleIndex}, 0s)`,...b.style},S={...b,style:y,"data-column-id":i.id,"data-z-index":y.zIndex,className:Z(b.className,Qn,jd),children:an.createElement(an.Fragment,null,d,an.createElement("div",{className:Z(ns,e?Ut:Xc.hidden,s),style:r},h),u)};c!=null&&(S["data-row-id"]=`${c}`);let C=f==="body"?i.components?.ColumnCell:i.components?.HeaderCell;return C?an.createElement(C,{...S,ref:a}):an.createElement("div",{...S,ref:a})}var zi=an.memo(by);var eo=V(require("react")),Jn=require("react");function tf(){let{initialValue:o,setValue:e,confirmEdit:t,cancelEdit:n,readOnly:r}=Vi(),i=(0,Jn.useRef)(null),a=(0,Jn.useRef)(!1),l=eo.useCallback(u=>{i.current=u,u&&u.focus()},[]),s=(0,Jn.useCallback)(u=>{let{key:d}=u;d==="Enter"||d==="Tab"?t():d==="Escape"?(a.current=!0,n()):u.stopPropagation()},[]),c=(0,Jn.useCallback)(()=>{a.current||t()},[]);return eo.createElement(eo.Fragment,null,eo.createElement("input",{readOnly:r,ref:l,onKeyDown:s,onBlur:c,className:Z(Bc,qc.none),type:"text",defaultValue:o,onChange:(0,Jn.useCallback)(u=>{e(u.target.value)},[])}))}function nf(o,e){let t=[];for(let n in o)o.hasOwnProperty(n)&&!e.hasOwnProperty(n)&&t.push(o[n]);return t}var yy=q(Y.columnZIndexAtIndex),Ty=q(Y.columnVisibilityAtIndex);function Sy({rowInfo:o}){return{[q(ce.components.Row.groupNesting)]:o.isTreeNode?o.isParentNode?o.treeNesting:o.treeNesting+1:0}}var Dr=Se.createContext(null),Cy=o=>{let{toggleCurrentRowDetails:e,rowDetailState:t}=o;return Se.createElement(Xn,{style:{visibility:t===!1?"hidden":"visible"},expanded:t==="expanded",onChange:e})},wy={display:"inline-block",visibility:"visible"},os=o=>{let{rowInfo:e,toggleCurrentTreeNode:t,nodeExpanded:n,api:r}=o,i=r.getDataSourceState().isNodeReadOnly;return Se.createElement(Xn,{disabled:e.isTreeNode&&e.isParentNode?i(e):!1,style:wy,expanded:n,onChange:t})},Iy=o=>{let{rowInfo:e,selectCurrentRow:t,deselectCurrentRow:n,toggleCurrentGroupRowSelection:r,column:i,dataSourceApi:a,api:l}=o;e.isGroupRow&&i.groupByForColumn;let{components:s}=l.getState(),c=l.getDataSourceState().isNodeSelectable,u=s?.CheckBox||rn;return Se.createElement(u,{domProps:{className:Fi},disabled:e.isTreeNode?!c(e):!1,onChange:d=>{if(e.isTreeNode){a.treeApi.setNodeSelection(e.nodePath,d??!1);return}if(e.isGroupRow){r();return}d?t():n()},checked:e.rowSelected})};function rs(o,e){return o?typeof o=="function"?o(e):o:void 0}function is(o,e,t){return typeof e=="function"?{...o,...e(t)}:{...o,...e}}function vy(o){let{dataSourceStatePartialForCell:e,rowInfoStore:t,rowStyle:n,rowClassName:r,rowIndexInHorizontalLayoutPage:i,horizontalLayoutPageIndex:a,getData:l,cellStyle:s,cellClassName:c,rowDetailState:u,width:d,column:f,onMouseLeave:p,onMouseEnter:m,onRowMouseEnter:g,onRowMouseLeave:b,rowIndex:h,rowHeight:y,columnsMap:S,fieldsToColumn:C,domRef:T,hidden:I,showZebraRows:w,getDataSourceState:v,dataSourceApi:R,dataSourceActions:x,getState:M,imperativeApi:A,componentActions:E,getComputed:P,getDataSourceMasterContext:_}=o,D=(0,Ve.useSyncExternalStore)((0,Ve.useCallback)(Re=>t.subscribeToRowIndex(h,Re),[t,h]),(0,Ve.useCallback)(()=>t.getRowInfoAtIndex(h),[t,h])),O=!D,F=!f,j=Se.useRef(null),z=(0,Ve.useCallback)(Re=>{j.current=Re,T&&T(Re)},[T]),L=D??{id:"",indexInAll:h,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:le}=L,ne=P(),{activeRowIndex:W,keyboardNavigation:$,columnReorderInPageIndex:re}=M(),ge=h===W&&$==="row",me={getState:M,getDataSourceState:v,getDataSourceMasterContext:_,actions:E,dataSourceActions:x,api:A,dataSourceApi:R},ue=L.rowDisabled,de=ne.computedVisibleColumns.map(Re=>Re.id),he=Qd({horizontalLayoutPageIndex:a,rowIndexInHorizontalLayoutPage:i,column:f,rowInfo:L,rowDetailState:u,columnsMap:S,visibleColumnsIds:de,fieldsToColumn:C,context:me}),{stylingParam:K,renderParams:H,formattedValueContext:X,renderFunctions:B,groupByColumnReference:ie,inEdit:ee}=he,{align:fe,verticalAlign:Ie}=H,N=H,U=Se.useRef(N),te=g&&m?Re=>{let nn={...X,rowIndex:h};g(nn,Re),m(Re)}:m,se=b&&p?Re=>{let lt={...X,rowIndex:h,rowInfo:L};b(lt,Re),p(Re)}:p,Me=(0,Ve.useCallback)(Re=>{let lt=f.computedVisibleIndex;M().cellClick({rowIndex:h,colIndex:lt,event:Re})},[h,f.computedVisibleIndex,$]),Ne=(0,Ve.useCallback)(Re=>{let lt=f.computedVisibleIndex;if(M().cellMouseDown({rowIndex:h,colIndex:lt,event:Re}),$==="row"){ue||(E.activeRowIndex=h);return}$==="cell"&&(E.activeCellIndex=[h,lt])},[h,ue,f.computedVisibleIndex,$]),{selectionMode:Fe,cellSelection:be,isNodeReadOnly:je}=e,$e=N.cellSelected;N.domRef=z,N.htmlElementRef=j,N.toggleCurrentTreeNode=(0,Ve.useCallback)(N.toggleCurrentTreeNode,[L]),N.selectCell=(0,Ve.useCallback)(N.selectCell,[L]),N.deselectCell=(0,Ve.useCallback)(N.deselectCell,[L]),N.selectCurrentRow=(0,Ve.useCallback)(N.selectCurrentRow,[L]),N.deselectCurrentRow=(0,Ve.useCallback)(N.deselectCurrentRow,[L]),N.toggleCurrentGroupRow=(0,Ve.useCallback)(N.toggleCurrentGroupRow,[L]),N.toggleCurrentRowSelection=(0,Ve.useCallback)(N.toggleCurrentRowSelection,[L]),N.toggleCurrentGroupRowSelection=(0,Ve.useCallback)(N.toggleCurrentGroupRowSelection,[L]),N.toggleCurrentTreeNodeSelection=(0,Ve.useCallback)(N.toggleCurrentTreeNodeSelection,[L]);let bt=f.components?.Editor??tf,Nt=ee?Se.createElement(rf,{contextValue:N},Se.createElement(bt,null)):null,tt=(0,Ve.useCallback)(st(()=>{if(I||ee)return null;if(U.current=N,B.renderGroupIcon&&(N.renderBag.groupIcon=Se.createElement(mt,{render:B.renderGroupIcon,renderParam:{...N,renderBag:{...N.renderBag}}})),B.renderSelectionCheckBox&&Fe=="multi-row"&&(N.renderBag.selectionCheckBox=Se.createElement(mt,{render:Iy,renderParam:N}),B.renderSelectionCheckBox!==!0&&(N.renderBag.selectionCheckBox=Se.createElement(mt,{render:B.renderSelectionCheckBox,renderParam:{...N,renderBag:{...N.renderBag}}}))),L.isTreeNode){let{isParentNode:nn}=L,kt;kt=(nn?B.renderTreeIconForParentNode:B.renderTreeIconForLeafNode)||typeof B.renderTreeIcon=="function"?B.renderTreeIcon:nn&&B.renderTreeIcon===!0?os:void 0,kt===!0?kt=os:kt&&(N.renderBag.treeIcon=Se.createElement(mt,{render:os,renderParam:N})),kt&&(N.renderBag.treeIcon=Se.createElement(mt,{render:kt,renderParam:{...N,renderBag:{...N.renderBag}}}))}B.renderRowDetailIcon&&(N.renderBag.rowDetailsIcon=Se.createElement(mt,{render:Cy,renderParam:{...N,renderBag:{...N.renderBag}}}),typeof B.renderRowDetailIcon=="function"&&(N.renderBag.rowDetailsIcon=Se.createElement(mt,{render:B.renderRowDetailIcon,renderParam:{...N,renderBag:{...N.renderBag}}}))),B.renderValue&&(N.renderBag.value=Se.createElement(mt,{render:B.renderValue,renderParam:{...N,renderBag:{...N.renderBag}}})),L.isGroupRow&&B.renderGroupValue&&(N.renderBag.value=Se.createElement(mt,{render:B.renderGroupValue,renderParam:{...N,renderBag:{...N.renderBag}}})),!L.isGroupRow&&B.renderLeafValue&&(N.renderBag.value=Se.createElement(mt,{render:B.renderLeafValue,renderParam:{...N,renderBag:{...N.renderBag}}})),U.current=N;let Re=N.renderBag.value;Re instanceof Date&&(Re=Re.toLocaleDateString());let lt=Se.createElement(Se.Fragment,null,fe!=="end"?N.renderBag.treeIcon:null,fe!=="end"?N.renderBag.groupIcon:null,fe!=="end"?N.renderBag.rowDetailsIcon:null,fe!=="end"?N.renderBag.selectionCheckBox:null,Re,fe==="end"?N.renderBag.selectionCheckBox:null,fe==="end"?N.renderBag.rowDetailsIcon:null,fe==="end"?N.renderBag.groupIcon:null,fe==="end"?N.renderBag.treeIcon:null);return f.render?Se.createElement(mt,{render:f.render,renderParam:{...N,renderBag:{...N.renderBag,all:lt}}}):lt}),[f,I,ee,u,f.renderTreeIcon||f.renderTreeIconForParentNode?je:!1,...nf(N,{renderBag:!0,selectCell:!0,deselectCell:!0,selectCurrentRow:!0,deselectCurrentRow:!0,toggleCurrentGroupRow:!0,toggleCurrentRowDetails:!0,toggleCurrentRowSelection:!0,toggleCurrentGroupRowSelection:!0,toggleCurrentTreeNodeSelection:!0,toggleCurrentTreeNode:!0,rowHasSelectedCells:!0})]),G=ne.computedVisibleColumns.map(Re=>Re.id),oe=ne.computedColumnOrder,ae={...X,visibleColumnIds:G,allColumnIds:oe,rowIndex:h,rowHasSelectedCells:!1};Object.defineProperty(ae,"rowHasSelectedCells",{get(){return L.hasSelectedCells(G)}});let ye=L.isTreeNode&&(f.renderTreeIcon||f.renderTreeIconForLeafNode||f.renderTreeIconForParentNode),Ue=typeof r=="function"?r(ae):r,k;ie?.className&&(k=rs(ie.className,K)),c&&(k=Z(k,rs(c,K))),f.className&&(k=Z(k,rs(f.className,K))),ye&&(k=Z(k,Hd({align:fe})));let Ce;L.dataSourceHasGrouping&&f.groupByForColumn&&(Ce=Kd({rowInfo:L})),ye&&(Ce=Sy({rowInfo:L})),n&&(Ce=typeof n=="function"?{...Ce,...n(ae)}:{...Ce,...n}),s&&(Ce=is(Ce,s,K)),ie?.style&&(Ce=is(Ce,ie.style,K)),f.style&&(Ce=is(Ce,f.style,K)),Ce=Ce||{},Ce.height=y,Ce.zIndex=`var(${yy}-${f.computedVisibleIndex})`,Ce.visibility=`var(${Ty}-${f.computedVisibleIndex}, visible)`;let gn=(0,Ve.useMemo)(()=>Ce,[Ce?JSON.stringify(Ce):null]),xt=i!=null?i%2===1:(L.indexInAll!=null?L.indexInAll:h)%2===1,Ft=w?xt?"odd":"even":!1,Lt=!1,lr=!1,sr=!1,bo=!1;if(be&&$e){let Re=l(),lt=Re[L.indexInAll-1],nn=Re[L.indexInAll+1],kt=ne.computedVisibleColumns[f.computedVisibleIndex+1],ur=ne.computedVisibleColumns[f.computedVisibleIndex-1];Lt=lt?!be.isCellSelected(lt.id,f.id):!0,f.computedPinned==="end"&&f.computedFirstInCategory?lr=!0:lr=ur?!be.isCellSelected(L.id,ur.id):!0,f.computedPinned==="start"&&f.computedLastInCategory?sr=!0:sr=kt?!be.isCellSelected(L.id,kt.id):!0,bo=nn?!be.isCellSelected(nn.id,f.id):!0}let cr=be&&$e?{top:Lt,left:lr,right:sr,bottom:bo}:null,ol=re!=null?a!==re:!1,rl=Nt,il=tt(),at={domRef:z,cellType:"body",column:f,width:d,rowId:L.id,horizontalLayoutPageIndex:a,style:gn,onMouseLeave:se,onMouseEnter:te,onClick:Me,afterChildren:rl,onMouseDown:Ne,cssEllipsis:f.cssEllipsis??!0,className:Z(cr?Ud(cr):"",xi(f,[Xt,Qn],$d,{dragging:!1,insideDisabledDraggingPage:ol,zebra:Ft,align:fe,verticalAlign:Ie,rowDisabled:ue,rowActive:ge,cellSelected:$e,rowSelected:le,treeNode:L.isTreeNode?L.isParentNode?"parent":"leaf":!1,firstRow:L.indexInAll===0,firstRowInHorizontalLayoutPage:i===0,groupRow:L.isGroupRow,groupCell:L.isGroupRow?!!f.groupByForColumn:!1,rowExpanded:L.isGroupRow?!L.collapsed:!1}),k,Ue),renderChildren:(0,Ve.useCallback)(()=>il,[tt])},oi=Dr.Provider;return F||O?Se.createElement("div",{ref:z,style:{display:"none"}}):Se.createElement(oi,{value:U.current},Se.createElement(zi,{...at}))}var of=Se.memo(vy);function Mr(){return(0,Ve.useContext)(Dr)}function Vi(){let{api:o,state:{editingValueRef:e,editingCell:t}}=J(),{column:n,rowInfo:r}=Mr(),[i]=Se.useState(()=>t?.value),[a,l]=Se.useState(i),s=t?!t.active&&!!t.waiting:!1,c=Se.useCallback(p=>{e.current=p,l(p)},[]);Se.useLayoutEffect(()=>{e.current=i},[]);let u=o.confirmEdit,d=o.cancelEdit,f=o.rejectEdit;return{api:o,initialValue:i,value:a,readOnly:s,column:n,rowInfo:r,setValue:c,confirmEdit:u,cancelEdit:d,rejectEdit:f}}function Er(o){return o.render(o.renderParam)??null}function mt(o){let e=Dr.Provider;return Oo.createElement(e,{value:o.renderParam},Oo.createElement(Er,{render:o.render,renderParam:o.renderParam}))}function rf(o){let e=Dr.Provider;return Oo.createElement(e,{value:o.contextValue},o.children)}function xn(o){let e=Gi.Provider;return Oo.createElement(e,{value:o.renderParam},Oo.createElement(Er,{render:o.render,renderParam:o.renderParam}))}var Pn=V(require("react"));var Ry={width:"100%",pointerEvents:"none"},as=`${yt}-menu`,ls=yi({"data-name":""}),ss={[ls["data-name"]]:"menu-icon"};function Ar(o){let{style:e,className:t,domProps:n,reserveSpaceWhenHidden:r,menuVisible:i,children:a}=o,l={...Ry,borderTop:`${ce.components.HeaderCell.menuIconLineWidth} solid currentColor`,...o.lineStyle};return Pn.createElement("div",{...n,style:e,...ss,onPointerDown:s=>s.stopPropagation(),className:Z(t,Eu({menuVisible:i,reserveSpaceWhenHidden:r}),yt,`${yt}-menu`)},a??Pn.createElement(Pn.Fragment,null,Pn.createElement("div",{className:as,style:l}),Pn.createElement("div",{className:as,style:l}),Pn.createElement("div",{className:as,style:l})))}var No=V(require("react")),_r=require("react");var af="_1ek6mqy0 _16lm1iw1p _16lm1iw2f _16lm1iw1 _16lm1iw32";var xy={transition:"width 0.25s, opacity 0.25s"};function Hi(o){let[e,t]=(0,_r.useState)(!0),[n,r]=(0,_r.useState)(0),{direction:i,lineWidth:a=1,style:l,className:s,index:c}=o,u=c!=null&&c>0,d=o.size??16,f=Math.floor(d/4),p=i?[d-3*f,d-2*f,d-f]:[0,0,0];i===-1&&p.reverse();let m={...xy,borderTop:`${a}px solid currentColor`,...o.lineStyle,opacity:n};(0,_r.useEffect)(()=>{let h=i!=0?1:0;if(!e&&h&&t(!0),h!==n){let y=requestAnimationFrame(()=>{r(h)});return()=>{cancelAnimationFrame(y)}}return()=>{}},[i,e]);let g=()=>{let y=!(n===0&&i===0);y!==e&&t(y)};if(!e&&!o.forceSize)return null;let b={};return i===-1&&(b.top="100%"),No.createElement("div",{"data-name":"sort-icon",style:{...l,width:d},className:Z(s,yt,af,`${yt}-sort`)},u?No.createElement("div",{"data-name":"index",style:b,className:Ou},c):null,No.createElement("div",{style:{width:p[0],...m},onTransitionEnd:g}),No.createElement("div",{style:{width:p[1],...m}}),No.createElement("div",{style:{width:p[2],...m}}))}var uf=V(require("react")),cs=require("react");var Or=require("react"),Nr=V(require("react"));function lf(o,{columns:e,shareSpaceOnResize:t,domRef:n}){let r=e[o];return{resize(i){we.columnWidths.set(o,r.computedWidth+i,n.current);let a=o+1;if(t){let l=e[a];if(!l)return;we.columnWidths.set(a,l.computedWidth-i,n.current),l.computedPinned==="start"?jl(l,i,n.current):we.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"){jl(c,i,n.current);continue}c.computedPinned!=="end"&&we.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||we.columnOffsets.set(l,c.computedOffset+i,n.current)}}}}}function sf(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 f=o[d],p=r[f],m=p.computedWidth+u;we.columnWidths.set(f,m,c),p.computedPinned!=="end"&&(l&&we.columnOffsets.set(f,l,c),l+=m)}),a.computedPinned!=="end")for(let u=t+1;u<r.length;u++){let d=r[u];d.computedPinned!=="end"&&we.columnOffsets.set(u,d.computedOffset+s,c)}}}}var Ki="zneyzh0 _16lm1iw2 _16lm1iw23 _16lm1iw2c _16lm1iw2a _16lm1iwm _16lm1iw35",Bi=pe({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"]]}),Wi=pe({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:Py}=Le,Dy=`${Py}HeaderCell_ResizeHandle`;function My(o){let{state:{brain:e,headerBrain:t}}=J(),n=(0,Or.useRef)(null),[r,i]=(0,Or.useState)(!1),a=(0,Or.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,f=()=>{},p=g=>{g.stopPropagation();let b=!!g.shiftKey,h=g.pointerId,y=g.clientX,S=g.target;if(e.isHorizontalLayoutBrain){let v=e.extendRenderRange({start:!0,end:!0,direction:"horizontal"}),R=t.extendRenderRange({start:!0,end:!0,direction:"horizontal"});f=()=>{v(),R()}}S.setPointerCapture(h);let C=lf(o.columnIndex,{columns:o.columns,shareSpaceOnResize:b,domRef:n}),T=(v,{done:R}={})=>{s&&(v=v/(s+1),R&&(v=Math.round(v))),c==="end"&&(v*=-1);let{adjustedDiff:x,constrained:M}=o.computeResize({diff:v,shareSpaceOnResize:b});return a.current!==M&&i(M),C.resize(x),x},I=v=>{T(Math.round(v.clientX-y))},w=v=>{S.releasePointerCapture(h),S.removeEventListener("pointermove",I),S.removeEventListener("pointerup",w);let R=Math.round(v.clientX-y),x=T(R,{done:!0});f(),o.onResize({diff:x,shareSpaceOnResize:b})};S.addEventListener("pointermove",I),S.addEventListener("pointerup",w)},m=(c===!1||c==="start")&&d?{right:c==="start"?void 0:0}:c==="end"&&u?{right:void 0}:void 0;return Nr.createElement("div",{ref:n,className:`${Dy} ${Ki} ${Wi({computedPinned:c,computedFirstInCategory:u,computedLastInCategory:d})}`,onPointerDown:p},Nr.createElement("div",{style:m,className:Bi({constrained:r,computedPinned:c,computedFirstInCategory:u,computedLastInCategory:d})}))}var cf=Nr.memo(My);function df(o,e){let{computed:{computedVisibleColumns:t},getState:n,getComputed:r,actions:i}=J(),a=(0,cs.useCallback)(({diff:c,shareSpaceOnResize:u})=>{let d=n(),{columnSizing:f,viewportReservedWidth:p,bodySize:m}=d,g=r().computedVisibleColumns,b=!1,h=g.reduce((C,T)=>(T.computedFlex&&(C[T.id]={...f[T.id],flex:T.computedWidth},b=!0),C),{}),y=b?{...f,...h}:f;return Ll({shareSpaceOnResize:u,availableSize:m.width,reservedWidth:p||0,dragHandleOffset:c,dragHandlePositionAfter:o.computedVisibleIndex,columnSizing:y,items:g.map(C=>({id:C.id,computedFlex:C.computedFlex,computedWidth:C.computedWidth,computedMinWidth:C.computedMinWidth,computedMaxWidth:C.computedMaxWidth}))})},[o]),l=(0,cs.useCallback)(({diff:c,shareSpaceOnResize:u})=>{let{columnSizing:d,reservedWidth:f}=a({diff:c,shareSpaceOnResize:u});u||(i.viewportReservedWidth=f),i.columnSizing=d},[a]);return o.computedResizable?uf.createElement(cf,{horizontalLayoutPageIndex:e.horizontalLayoutPageIndex,columns:t,columnIndex:o.computedVisibleIndex,computeResize:a,onResize:l}):null}var ot=V(require("react"));var Mn=require("react");var ff=pe({defaultClassName:"_16lm1iw3a _16lm1iw1",variantClassNames:{dragging:{true:"_16lm1iwn _16lm1iw1x"}},defaultVariants:{},compoundVariants:[]}),pf=pe({defaultClassName:"_16lm1iw3a _16lm1iw1 _16lm1iwo",variantClassNames:{active:{true:"_3dmbka5 _16lm1iw1k _3dmbka2"},draggingInProgress:{true:"_16lm1iw1x"}},defaultVariants:{},compoundVariants:[[{active:!1,draggingInProgress:!0},"_3dmbka3"]]});function mf(o,e){return At(o,e)}var ji=class extends Un{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 mf(this.data,t)?!1:(this.data=t,!0)}getData(){return this.data}isEqual(t){return mf(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}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},(p,m)=>m),d=[];n===-1?d=u.filter(p=>p!==r):d=$n(u,r,n>r?n-1:n);let f={dragIndex:r,dropIndex:n,dragItem:s,items:i,dragSourceListId:a,dropTargetListId:l,sortedIndexes:d,outside:c,status:t.status};this.emit("drop",f)}};var hf=ot.createContext({dragItemId:null,onDragItemPointerDown:()=>{},draggingInProgress:!1,dragListId:"",status:"accepted",dragSourceListId:null,dropTargetListId:null}),Fr=()=>ot.useContext(hf),Ey=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)`},Ay=o=>`${o.getAttribute(Dn)}`;function _y(o){let e=o.current?.querySelectorAll($i)??[];return!e||e.length,Array.from(e).map(n=>{let r=Ay(n),i=n.getBoundingClientRect();return{id:r,rect:i}})}function Oy(o){let{domRef:e,orientation:t,dragListId:n}=o,r=ve.from(e.current.getBoundingClientRect());return{draggableItems:_y(e),orientation:t,listId:n,listRectangle:r,acceptDropsFrom:o.acceptDropsFrom,shouldAcceptDrop:o.shouldAcceptDrop,initial:o.initial}}function bf(o){return new ji(Oy(o))}function Ny(o,e){let t=Ae(e),[n,r]=ot.useState(null),i=(0,Mn.useCallback)(l=>{if(l)Tt.registerDragInteractionTarget(l);else{let s=a();s&&Tt.unregisterDragInteractionTarget(s)}r(l)},[]),a=Ae(n);return(0,Mn.useEffect)(()=>Tt.on("register",l=>{let{dragListId:s,acceptDropsFrom:c,orientation:u,shouldAcceptDrop:d}=t(),f=l.getData();if(f.initial&&f.listId!==s&&c?.includes(f.listId)){let p=bf({domRef:o,orientation:u,dragListId:s,initial:!1,acceptDropsFrom:c,shouldAcceptDrop:d});l.once("unregister",()=>{i(null)}),i(p)}}),[t]),{interactionTarget:n,setInteractionTarget:i,getInteractionTarget:a}}var to=o=>{let e=ot.useRef(null),{dropTargetListId:t,dragSourceListId:n}=Yn(),{updateDragOperationSourceAndTarget:r,dragItemId:i,status:a}=Yn(),l=Ae(o.onDrop),s=Ae(o.onAcceptDrop),c=Ae(o.onRemove),u=Ae(o.updatePosition??Ey),{interactionTarget:d,setInteractionTarget:f}=Ny(e,o);(0,Mn.useEffect)(()=>{let T=document.querySelector(`[${gf}="${o.dragListId}"]`);T?e.current=T:console.warn(`DragList with id "${o.dragListId}" not found. You're probably not spreading the domProps to the parent element. Make sure you also include the "className" prop.`)},[o.dragListId]),(0,Mn.useEffect)(()=>{if(d){let T=o.dragListId,I=d.on("start",({dragItem:R,dragSourceListId:x,dropTargetListId:M})=>{r({dragSourceListId:x,dropTargetListId:M,dragItemId:R.id,status:"accepted"})}),w=d.on("move",({offsetsForItems:R,items:x,status:M})=>{if(M==="rejected")return;let A=m(),E=u();x.forEach((P,_)=>{let D=R[_],O=A[_];O&&E({id:P.id,node:O,offset:D})})}),v=d.on("drop",R=>{let{sortedIndexes:x,dragIndex:M,dropIndex:A,dragItem:E,items:P,dragSourceListId:_,dropTargetListId:D,outside:O,status:F}=R,j=m();p.current=[];let z=s(),L=c(),le=l(),ne=u();P.forEach((re,ge)=>{let me=j[ge];me&&ne({id:re.id,node:me,offset:null})}),T===D&&_!==T&&z&&F==="accepted"&&z({dragItemId:E.id,dragSourceListId:_,dropTargetListId:D,dragIndex:M,dropIndex:A,dropItemId:P[A]?.id});let $=null;A===-1&&_===T&&D===T&&O&&($=L),A!==-1&&D===T&&_===T&&($=le),$&&$?.(x,{dragIndex:M,dropIndex:A,dragItemId:P[M].id,dropItemId:P[A]?.id})});return()=>{I(),w(),v()}}},[d,o.dragListId]);let p=ot.useRef([]),m=(0,Mn.useCallback)(()=>{let T=p.current;return(!T||T.length===0)&&(T=Array.from(e.current?.querySelectorAll($i)??[]),p.current=T),T},[]),g=(0,Mn.useCallback)(T=>{let I=T.currentTarget,w=I.getAttribute(Dn);if(w==null){let O=vn(I,$i);O&&(w=O.getAttribute(Dn))}if(w==null){console.warn("Could not find drag item id for element",I,`Make sure you have a parent element with a ${Dn} attribute`);return}w=`${w}`;let v=null,R=Array.from(e.current?.querySelectorAll($i)??[]);p.current=R;let x=bf({domRef:e,orientation:o.orientation,dragListId:o.dragListId,acceptDropsFrom:o.acceptDropsFrom,initial:!0}),M=x.getData().draggableItems,A=M.findIndex(O=>O.id===w),E=M[A];f(x);let P={left:T.clientX,top:T.clientY},_=O=>{v||(v=Tt.startDrag({listId:o.dragListId,dragItem:E,dragIndex:A},P)),v.move({left:O.clientX,top:O.clientY})},D=()=>{if(xe().removeEventListener("pointermove",_),!v){f(null);return}v.drop(),v=null};xe().addEventListener("pointermove",_),xe().addEventListener("pointerup",D,{once:!0})},[o.orientation,o.dragListId,o.acceptDropsFrom,o.removeOnDropOutside]),b=T=>T===void 0?i!=null:`${T}`===i,h=!!i,y=ot.useMemo(()=>({dragItemId:i,onDragItemPointerDown:g,dragSourceListId:n,dropTargetListId:t,status:a,dragListId:o.dragListId,draggingInProgress:h}),[i,g,b,h,n,t,o.dragListId]),S={className:Z("DragList",h?"DragList--dragging":"",ff({dragging:h})),[gf]:o.dragListId},C=typeof o.children=="function"?o.children(S,y):o.children;return ot.createElement(hf.Provider,{value:y},C)},gf="data-drag-list-id",Dn="data-drag-item-id",$i=`[${Dn}]`,Fy=ot.createContext({dragItemId:"",dragListId:"",active:!1,draggingInProgress:!1,dragSourceListId:"",dropTargetListId:""}),Ly=o=>{let{onDragItemPointerDown:e,draggingInProgress:t,dragListId:n,dragItemId:r,dragSourceListId:i,dropTargetListId:a}=Fr(),l=i===n&&r===`${o.id}`,s=ot.useMemo(()=>({dragItemId:o.id,active:l,dragListId:n,draggingInProgress:t,dragSourceListId:i,dropTargetListId:a}),[o.id,l,t,i,a]),c={"data-drag-item-id":`${o.id}`,onPointerDown:e,className:Z("DraggableItem",l?"DraggableItem--active":"",pf({active:l,draggingInProgress:t}))},u=typeof o.children=="function"?o.children(c,s):o.children;return ot.createElement(Fy.Provider,{value:s},u)};to.DraggableItem=Ly;var us=V(require("react")),yf=o=>us.createElement(ke,{...o,viewBox:"0 -960 960 960"},us.createElement("path",{d:"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"}));var Br=V(require("react"));function Tf(){return{}}var Sf=o=>({allowColumnHideWhileDragging:e=>e??!0});var Cf=require("react"),ky=(0,Cf.createContext)(null);function ds(){return ky}var Gt=V(require("react"));var ro=V(require("react")),Vt=require("react");var Ui=V(require("react"));function zy(o){let{height:e,width:t,count:n}=o;return Ui.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 wf=Ui.memo(zy);var If="mlx2t3";var Yi=V(require("react")),Af=require("react");var vf=require("react"),Rf=(o,e)=>{(0,vf.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 xf={true:"_1ueijco2",false:"_1ueijco3",visible:"_1ueijco4",auto:"_1ueijco5",hidden:"_1ueijco6"},Pf={true:"_1ueijco7",false:"_1ueijco8",visible:"_1ueijco9",auto:"_1ueijcoa",hidden:"_1ueijcob"},Df={true:"_1ueijcoc",false:"_1ueijcod",visible:"_1ueijcoe",auto:"_1ueijcof",hidden:"_1ueijcog"},fs="_1ueijco1",Mf="_1ueijco0 _16lm1iw0";var Ef=o=>{let e="";return typeof o=="boolean"||typeof o=="string"?e=xf[`${o}`]:e=Z(Pf[`${o.horizontal}`],Df[`${o.vertical}`]),e};var Vy="InfiniteVirtualScrollContainer";var _f=Yi.forwardRef(function(e,t){let{children:n,scrollable:r=!0,onContainerScroll:i,className:a,tabIndex:l,style:s,autoFocus:c}=e,u=t??(0,Af.useRef)(null);return Rf(u,i),Yi.createElement("div",{ref:u,style:s,autoFocus:c,tabIndex:l,className:Z(a,Vy,Mf,Ef(r))},n)});var oa=V(require("react")),Vo=require("react");var Of=V(require("react")),ps=require("react-dom"),Fo=require("react"),Gy=()=>!1;function Hy(o){let[e,t]=(0,Fo.useState)(o.updater.get),n=(0,Fo.useRef)(null),r=o.shouldFlushSync??Gy;return(0,Fo.useLayoutEffect)(()=>{function i(l){let s=r();o.useraf?(n.current!=null&&cancelAnimationFrame(n.current),n.current=requestAnimationFrame(()=>{s?queueMicrotask(()=>{(0,ps.flushSync)(()=>{t(l)})}):t(l)})):s?queueMicrotask(()=>{(0,ps.flushSync)(()=>{t(l)})}):t(l)}let a=o.updater.onChange(i);return()=>{n.current!=null&&cancelAnimationFrame(n.current),a()}},[o.updater,o.useraf,r]),e??null}var En=Of.memo(Hy);var Nf=V(jn());var ms=(o,e)=>o-e,ln={horizontal:!0,vertical:!0};function qi(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 gs="DebugID=";function An(o,e){return e&&e.startsWith(gs)?e:e?`${gs}${o}:${e}`:`${gs}${o}`}var Xi={start:0,end:0},hs=o=>{o()},bs=o=>{let{start:e,end:t}=o,[n,r]=e,[i,a]=t,l=i-n,s=a-r;return l*s},Ff=o=>{let{start:e,end:t}=o,[n]=e,[r]=t;return r-n},Lr=typeof window<"u"?requestAnimationFrame:o=>setTimeout(o,0);function Ky(o){return o.horizontalChange||o.verticalChange}var no=class extends ft{constructor(t){let n=An(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=Xi;this.verticalExtendRangeBy=Xi;this.horizontalRenderRange={startIndex:0,endIndex:0};this.verticalRenderRange={startIndex:0,endIndex:0};this.extraSpanCells=[];this.scrollPosition={scrollLeft:0,scrollTop:0};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.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=>{Lr(()=>{this.destroyed||t.has(r)&&r(n)})})};this.notifyVerticalRenderRangeChange=(t=!1)=>{if(this.destroyed)return;let n=this.onVerticalRenderRangeChangeFns,r=this.verticalRenderRange,i=t?hs:Lr;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?hs:Lr;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=ln)=>{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=ln)=>{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 f=l;for(;d[f]!=f;)f--;a.push([f,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 f=l;for(;d[f]!=f;)f--;a.push([u,f])}}}return a};this.computeRenderRange=(t=ln)=>{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,f=c.end||0;s||(d+=this.RENDER_COUNT_SAFETY_MARGIN_START,f+=this.RENDER_COUNT_SAFETY_MARGIN_END),d&&(u=Math.max(0,u-d),r+=d),f&&(r+=f);let p=u+r,m=Math.max(a,i-(t==="horizontal"?this.fixedColsEnd:this.fixedRowsEnd));return p>m&&(p=m,u=Math.max(a,p-r)),{startIndex:u,endIndex:p}};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 f=(0,Nf.default)(a,t,ms);return f>=0?f:~f-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),f=u.get(a);if(d[i]===void 0){let p=d.length,m=l?Math.min(i,l-1):0,g={rowIndex:t,colIndex:n};for(;p<=m;p++)if(d[p]===void 0){g[r==="horizontal"?"colIndex":"rowIndex"]=p;let b=s(g);d[p]=p,f[p]=b;let h=p;for(;b>1;)h+=1,d[h]=p,f[h]=0,b-=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=bs;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=ln){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",f=u&&s!==this.availableWidth,p=d&&c!==this.availableHeight;f&&(this.availableWidth=s,this.availableRenderWidth=s),p&&(this.availableHeight=c,this.availableRenderHeight=c),(f||p)&&this.notifyAvailableSizeChange();let m=typeof r=="number",g=typeof i=="number",b=m&&r!==this.rows,h=g&&i!==this.cols;m&&(this.rows=r,this.rowsPerPage=r),g&&(this.cols=i);let y=a!=null,S=l!=null,C=y&&a!==this.rowHeight,T=S&&l!==this.colWidth;y&&(this.rowHeight=a),S&&(this.colWidth=l);let I=t.rowspan!=null,w=t.colspan!=null,v=I&&t.rowspan!=this.rowspan,R=w&&t.colspan!=this.colspan;v&&(this.rowspan=t.rowspan),R&&(this.colspan=t.colspan);let x=h||T||f||R,M=b||C||p||v;(n||Ky)({horizontalChange:x,verticalChange:M,colsChanged:h,colWidthChanged:T,widthChanged:f,colspanChanged:R,rowsChanged:b,rowHeightChanged:C,heightChanged:p,rowspanChanged:v})&&this.updateRenderCount({horizontal:x,vertical:M})}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=ln){this.reset(t),this.doUpdateRenderCount(t)}doUpdateRenderCount(t=ln){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)&&(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?hs:Lr;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,f=r;d+=s,f-=c;for(let p=d;p<f;p++)u.push(this.getItemSize(p,t));a=qi(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=>{Lr(()=>{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=Xi,this.verticalExtendRangeBy=Xi,this.destroyed=!0,this.onDestroyFns=[],this.onScrollFns=[],this.onScrollStartFns=[],this.onScrollStopFns=[],this.onRenderCountChangeFns.clear(),this.onRenderRangeChangeFns.clear(),this.onVerticalRenderRangeChangeFns.clear(),this.onHorizontalRenderRangeChangeFns.clear())}};var Ts=V(jn());function Lf(...o){if(!o.length)return new Set;let[e,...t]=o;return new Set([...e].filter(n=>t.every(r=>r.has(n))))}function kf(o,e){let t=new Set;for(let n of o)e(n)&&t.add(n);return t}function kr(o,e){for(let t of o)if(e(t))return t}var Vf=V(require("react"));var zf=new Map,By=()=>{},ys=class{constructor(e,t){this.element=null;this.mounted=!1;this.IS_UPDATED_WHILE_SCROLLING_IN_HORIZONTAL_LAYOUT=!1;this.mountSubscription=Te();this.isUpdatedWhileScrolling=()=>this.IS_UPDATED_WHILE_SCROLLING_IN_HORIZONTAL_LAYOUT;let n=zf.get(e)??0,r=`${e}:GridCellReact:${n}`;zf.set(e,n+1),this.debugId=r,this.cellInfo=t,this.updater=Te(),this.node=Vf.createElement(En,{key:r,name:r,updater:this.updater,shouldFlushSync:this.isUpdatedWhileScrolling}),this.ref=i=>{this.element=i,i?(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=By,this.element=null,this.node=null}getNode(){return this.node}update(e,t,n){this.IS_UPDATED_WHILE_SCROLLING_IN_HORIZONTAL_LAYOUT=n?n.scrolling&&n.isHorizontalLayout:!1,this.updater(e),this.cellInfo=t}getAdditionalInfo(){return this.cellInfo}getElement(){return this.element}},Lo=class Lo extends ft{constructor(t){super(`${t}:GridCellPoolForReact`);this.debugId=t;this.cellRemoveSubscription=Te();this.cellAttachmentChangeSubscription=Te();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=new ys(this.debugId);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+=Lo.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}set poolSize(t){t=Math.ceil(t/Lo.POOL_SIZE_INCREMENT)*Lo.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--}};Lo.POOL_SIZE_INCREMENT=1;var Zi=Lo;var Qi=(o,e)=>o-e,Ji=class extends ft{constructor(t){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[f,p]=d,m=f<i,g=f>=l,b=p<a,h=p>=s;(m||g||b||h)&&c.add(u)}),c};this.debugId=t,this.pool=new Zi(t),this.offRemoveCell=this.pool.onRemoveCell(n=>this.onRemoveCell(n))}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,a){let l=this.getCellAt(r);return l&&l!==n&&this.detachCellAt(r),this.pool.attachCell(n),this.setCellPositionInMatrix(n,r),n.update(t,i,a),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=kr(l,s=>!this.isCellAttached(s)))}if(n==="column"){let l=this.columnsWithCellsHistory.get(a);l&&(r=kr(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(Qi)}getColumnsWithCells(){let t=this.matrix.getKeysOfFirstChildOnEachBranchStartingWith([],{excludeSelf:!0});return[...new Set(t.map(r=>r[1])).values()].sort(Qi)}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,Ts.default)(n,t,Qi);r<0&&(r=~r),n.slice(r).forEach(a=>this.detachRow(a))}detachColsStartingWith(t){let n=this.getColumnsWithCells().sort(),r=(0,Ts.default)(n,t,Qi);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 kr(t,r=>this.getCellPosition(r)?.[0]===n)}getCellFromListForColumn(t,n){return kr(t,r=>this.getCellPosition(r)?.[1]===n)}getCellCountInMatrix(){return this.matrix.size}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 Kf=V(jn());var Hf=V(require("react"));var Gf=new Map,Wy=()=>{},Ss=class{constructor(e){this.element=null;this.mounted=!1;this.mountSubscription=Te();let t=Gf.get(e)??0,n=`${e}:ListRowReact:${t}`;Gf.set(e,t+1),this.debugId=n,this.updater=Te(),this.node=Hf.createElement(En,{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=Wy,this.element=null,this.node=null}getNode(){return this.node}update(e){this.updater(e)}getElement(){return this.element}},ko=class ko extends ft{constructor(t){super(`${t}:ListRowPoolForReact`);this.debugId=t;this.rowRemoveSubscription=Te();this.rowAttachmentChangeSubscription=Te();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=new Ss(this.debugId);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+=ko.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/ko.POOL_SIZE_INCREMENT)*ko.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--}};ko.POOL_SIZE_INCREMENT=1;var ea=ko;var ta=class extends ft{constructor(t){super(`${t}:ListRowManager`);this.indexToRow=new Map;this.rowToIndex=new WeakMap;this.debugId=t,this.pool=new ea(t),this.offRemoveRow=this.pool.onRemoveRow(n=>this.onRemoveRow(n))}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,Kf.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 Bf=!0,oo=q(Y.y),Wf=q(Y.scrollTop),mE=q(Y.columnOffsetAtIndex),ws=q(Y.columnOffsetAtIndexWhileReordering),Cs={scrolling:!1,isHorizontalLayout:!1},zo=class extends ft{constructor(t,n){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})=>{t.style.setProperty(oo,i?`calc( ${r}px + var(${Wf}) )`:`${r}px`),t.style.transform=`translate3d(${a||0}px, var(${oo}), 0)`};this.setTransform=(t,n,r,{x:i,y:a,scrollLeft:l,scrollTop:s},c)=>{let u=we.columnOffsets.get(r),d=`${ws}-${r}`,f=s?`calc( ${a}px + var(${Wf}) )`:`${a}px`;t.__currentTransformY!==f&&(t.__currentTransformY=f,t.style.setProperty(oo,f));let p=`translate3d(var(${d}, ${u}), var(${oo}), 0)`;t.__transformValue!==p&&(t.__transformValue=p,t.style.transform=p),c!=null};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(),f=r.getFixedEndRowsHeight(),p=i.scrollTop,m=r.getAvailableSize();if(!m.height)return null;let g=p+m.height;l||(l=c>g-f?"end":c<p+d?"start":"end");let b=i.scrollTop;if(l==="center"?b=c-Math.floor((r.getAvailableSize().height-d-f)/2):l==="start"?(s=-s,b+=c-p+s-d):(s+=u,b+=c-g+s+f),this.brain.isHorizontalLayoutBrain){let h=n.colIndex??Math.ceil(this.brain.getInitialCols()/2),y=this.getScrollPositionForScrollColumnIntoView(h,{...n,horizontalLayoutPageIndex:this.brain.getPageIndexForRow(t)});y&&(a=y.scrollLeft)}return{scrollLeft:a,scrollTop:b}};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(),f=r.getFixedStartColsWidth(),p=i.scrollLeft,m=r.getAvailableSize();if(!m.width)return null;let g=p+m.width;l||(l=c>g-f?"end":c<p+d?"start":"end");let b=i.scrollLeft;return l==="center"?b=c-Math.floor((r.getAvailableSize().width-d-f)/2):l==="start"?(s=-s,b+=c-p+s-d):(s+=u,b+=c-g+s+f),{...i,scrollLeft:b}};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,f]=c,[p,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:[p,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:[p,l]})),n){let b={start:[0,f],end:[n,m],rowFixed:"start",colFixed:!1};g.push(b)}if(r){let b={rowFixed:"end",colFixed:!1,start:[s-r,f],end:[s,m]};g.push(b)}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,f=!1;if(t<r&&(u=!0,f="start"),i&&!u){let p=c-i;t>=p&&(u=!0,f="end")}if(n<a&&(d=!0,f="start"),l&&!d){let p=s-l;n>=p&&(d=!0,f="end")}return{row:u?f:!1,col:d?f:!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=Number(t.target.dataset.rowIndex);this.onMouseEnter(n)};this.onMouseLeaveNotBound=t=>{let n=Number(t.target.dataset.rowIndex);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))};ze(()=>{this.destroyed||(n(),this.hoverRowUpdatesInProgress.delete(t))})};this.updateElementPosition=(t,n)=>{if(this.destroyed)return;let r=t.getElement(),i=this.cellManager.getCellPosition(t);if(!i)return;let[a,l]=i,s=this.brain.getCellOffset(a,l);if(s==null)return;let{x:c,y:u}=s;if(r){this.updateHoverClassNamesForRow(a);let d=this.getCellRealCoordinates(a,l);if(r.dataset.rowIndex=d.rowIndex,r.dataset.colIndex=d.colIndex,Bf){this.setTransform(r,a,l,{x:c,y:u},null),r.style.willChange="transform",r.style.backfaceVisibility="hidden";let p=(n?n.hidden:!!this.isCellCovered(a,l))?"-1":r.dataset.zIndex||"auto";r.__zIndex!==p&&(r.__zIndex=p,r.style.zIndex=p)}else r.style.display="",r.style.left=`${c}px`,r.style.top=`${u}px`}};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,Bf&&(this.setDetailTransform(n,r,{y:a,scrollLeft:this.brain.getScrollPosition().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.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(P=>{let _=i.getRowIndex(P);if(_!=null){let D=this.brain.getItemOffsetFor(_,"vertical");if(D==null)return;let O=P.getElement();if(!O)return;this.setDetailTransform(O,_,{y:D,scrollLeft:t.scrollLeft})}}),!s&&!c&&!u&&!d)return;let f=this.cellManager.getOneAttachedCell();f&&td(t,this.getInfiniteNode(f.getElement()));let p=this.brain.getFixedEndColsOffsets({skipScroll:!0}),m=this.brain.getFixedEndRowsOffsets({skipScroll:!0}),{start:g,end:b}=this.brain.getRenderRange(),[h,y]=g,[S,C]=b;function T(P,_,D){let O=r.getCellAt([P,_]);if(O==null)return;let F=n.getCellOffset(P,_),j=O.getElement();j&&F&&D(P,_,j,F)}let I=(P,_,D,{x:O,y:F})=>{this.setTransform(D,P,_,{x:O,y:F,scrollLeft:!0},s-_)},w=(P,_,D,O)=>{this.setTransform(D,P,_,{x:O.x,y:O.y,scrollTop:!0},u-P)},v=(P,_,D,{y:O})=>{let F=p[_];this.setTransform(D,P,_,{x:F,y:O,scrollLeft:!0},a-_)},R=(P,_,D,O)=>{this.setTransform(D,P,_,{x:O.x,y:m[P],scrollTop:!0},l-P)},x=(P,_,D,{x:O,y:F})=>{this.setTransform(D,P,_,{x:O,scrollLeft:!0,y:F,scrollTop:!0},1e5)},M=(P,_,D,{x:O})=>{this.setTransform(D,P,_,{x:O,scrollLeft:!0,y:m[P],scrollTop:!0},2e5)},A=(P,_,D,O)=>{this.setTransform(D,P,_,{x:p[_],y:O.y,scrollLeft:!0,scrollTop:!0},3e5)},E=(P,_,D)=>{this.setTransform(D,P,_,{x:p[_],y:m[P],scrollLeft:!0,scrollTop:!0},4e5)};if(s||c)for(let P=h;P<S;P++){for(let _=0;_<s;_++)T(P,_,I);if(c){let _=a-c;for(let D=_;D<a;D++)T(P,D,v)}}if(u||d)for(let P=y;P<C;P++){for(let _=0;_<u;_++)T(_,P,w);if(d){let _=l-d;for(let D=_;D<l;D++)T(D,P,R)}}if(s&&u)for(let P=0;P<u;P++)for(let _=0;_<s;_++)T(P,_,x);if(s&&d){let P=l-d;for(let _=P;_<l;_++)for(let D=0;D<s;D++)T(_,D,M)}if(c&&u){let P=a-c;for(let _=0;_<u;_++)for(let D=P;D<a;D++)T(_,D,A)}if(c&&d){let P=l-d,_=a-c;for(let D=P;D<l;D++)for(let O=_;O<a;O++)T(D,O,E)}};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 Ji(n),this.cellManager.onCellAttachmentChange((s,c)=>{c?this.onCellAttached(s):this.onCellDetached(s)}),this.rowManager=new ta(n),this.rowManager.onRowAttachmentChange((s,c)=>{c?this.onRowAttached(s):this.onRowDetached(s)}),this.renderRange=this.renderRange.bind(this);let r=t.onScroll(this.adjustFixedElementsOnScroll),i=t.onAvailableSizeChange(()=>{this.adjustFixedElementsOnScroll(),ze(()=>{this.destroyed||this.adjustFixedElementsOnScroll()})}),a=t.onScrollStart(this.onScrollStart),l=t.onScrollStop(this.onScrollStop);this.onDestroy=()=>{r(),i(),a(),l()}}getInfiniteNode(t){return this.infiniteNode||(this.infiniteNode=Bl(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,f=this.getFixedRanges(t),p=[t,...f],m=this.brain.getAlwaysRenderedColumns();if(m.length>0){let x=t.start[1],M=t.end[1];m.forEach(A=>{x<=A&&A<M||p.push({start:[t.start[0],A],end:[t.end[0],A+1]})})}let g=new Map,b=p.map(this.getExtraSpanCellsForRange).flat();b&&b.forEach(([x,M])=>{g.set(`${x}:${M}`,!0)});let h=p.reduce((x,M)=>x+bs(M),0),y=r?p.reduce((x,M)=>x+Ff(M),0):0,S=this.brain.getRowCount(),C=this.brain.getColCount();d.detachCellsStartingAt([S,C]);let T=Math.min(S*C,h);r&&(u.detachStartingWith(this.brain.getRowCount()),u.poolSize>y&&(u.poolSize=y));let I=Lf(...p.map(x=>d.getCellsOutsideRenderRange(x)));I=kf(I,x=>{let M=d.getCellPosition(x);return!(M&&g.has(`${M[0]}:${M[1]}`))}),d.detachCells(I),d.poolSize=T;let w=new Map,v=new Map;p.forEach(x=>{let{start:M,end:A}=x,[E,P]=M,[_,D]=A;for(let O=E;O<_;O++){for(let j=P;j<D;j++){let z=`${O}:${j}`;if(w.has(z))continue;w.set(z,!0);let{rendered:L,mapped:le}=this.isCellRenderedAndMappedCorrectly(O,j);if(O===E||j===P){let W=this.isCellCovered(O,j);if(W&&g.has(`${W[0]}:${W[1]}`)){let $=d.getCellAt([O,j]);$!=null&&d.detachCell($);continue}}if(L&&!i&&le)continue;let ne;L?ne=d.getCellAt([O,j]):ne=d.getCellFor([O,j],c?"row":"column"),ne==null&&(ne=d.getDetachedCell()),this.renderCellAt(O,j,ne,n)}!r||v.has(O)||(v.set(O,!0),u.isRowAttachedAt(O)&&!i)||this.renderDetailRowAtElement(O,this.rowManager.getRowFor(O),r)}}),b.forEach(([x,M])=>{let{rendered:A,mapped:E}=this.isCellRenderedAndMappedCorrectly(x,M);if(A){if(i||!E){let _=[x,M],D=d.getCellAt(_);this.renderCellAt(x,M,D,n)}return}let P=d.getCellFor([x,M],c?"row":"column");P!=null&&this.renderCellAt(x,M,P,n)});let R=d.getAllCells().map(x=>x.getNode());return r&&u.getAllRows().forEach(x=>{R.push(x.getNode())}),this.adjustFixedElementsOnScroll(),a&&a(R),R}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}}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),f=u===1?s:this.brain.getColWidthWithSpan(t,n,u),{row:p,col:m}=this.isCellFixed(t,n),g=!!a,{rowIndex:b,colIndex:h}=this.getCellRealCoordinates(t,n),y=i({rowIndex:b,colIndex:h,height:l,width:s,rowspan:c,colspan:u,rowFixed:p,colFixed:m,hidden:g,heightWithRowspan:d,widthWithColspan:f,onMouseEnter:this.onMouseEnterNotBound,onMouseLeave:this.onMouseLeaveNotBound,domRef:r.ref});r.isMounted()||r.onMount(T=>{let I=T.getElement();I&&(I.style.position="absolute",I.style.left="0px",I.style.top="0px"),this.updateElementPosition(T)});let S=this.brain.isHorizontalLayoutBrain?{renderRowIndex:b,renderColIndex:h}:void 0,C=this.brain.isHorizontalLayoutBrain;if(!y){C?this.cellManager.detachCell(r):this.cellManager.detachCell(r);return}Cs.scrolling=this.scrolling,Cs.isHorizontalLayout=C,this.cellManager.renderNodeAtCell(y,r,[t,n],S,Cs),this.updateElementPosition(r,{hidden:g,rowspan:c,colspan:u})}reset(){this.cellManager.reset(),this.rowManager.reset()}};var na=class extends zo{constructor(t,n){super(t,n);this.setTransform=(t,n,r,i,a)=>{let l=this.getCellRealCoordinates(n,r),{y:s}=i,c=Math.floor(l.rowIndex/this.brain.rowsPerPage),u=ce.runtime.totalVisibleColumnsWidthVar,d=c?`calc(${u} * ${c})`:"0px",f=we.columnOffsets.get(l.colIndex),p=`${ws}-${l.colIndex}`,m=`${s}px`;t.__currentTransformY!==m&&(t.__currentTransformY=m,t.style.setProperty(oo,m));let g=`calc(var(${p}, ${f}) + ${d})`,b=`var(${oo})`,h=`translate3d(${g}, ${b}, 0px)`;t.__transformValue!==h&&(t.__transformValue=h,t.style.transform=h)};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}}};function zr(o){let e=o.isHorizontalLayoutBrain?new na(o,`${o.name}:HorizontalLayoutTableRenderer`):new zo(o,`${o.name}:ReactHeadlessTableRenderer`),t=Te();return o.onDestroy(()=>{e.destroy(),t.destroy()}),{renderer:e,onRenderUpdater:t}}function jy(o){let{brain:e,renderCell:t,renderDetailRow:n,forceRerenderTimestamp:r}=o,{renderer:i,onRenderUpdater:a}=(0,Vo.useMemo)(()=>o.onRenderUpdater&&o.renderer?{renderer:o.renderer,onRenderUpdater:o.onRenderUpdater}:zr(e),[e,o.onRenderUpdater,o.renderer]);return(0,Vo.useLayoutEffect)(()=>{i.cellHoverClassNames=o.cellHoverClassNames||[]},[i,o.cellHoverClassNames]),(0,Vo.useLayoutEffect)(()=>{i.cellDetachedClassNames=o.cellDetachedClassNames||[]},[i,o.cellDetachedClassNames]),(0,Vo.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]),oa.createElement(En,{updater:a})}var ra=oa.memo(jy);var Vr=V(require("react")),Go=require("react");var jf=pe({defaultClassName:"nxbq1c1 _16lm1iwz _16lm1iw2",variantClassNames:{visible:{true:"nxbq1c3",false:"nxbq1c4"}},defaultVariants:{},compoundVariants:[]}),ia="nxbq1c0 _16lm1iwz _16lm1iw4 _16lm1iw26 _16lm1iw23 _16lm1iw1y _16lm1iw1k";var $f=pe({defaultClassName:"j26lrx0 _16lm1iwz _16lm1iw2 _16lm1iw23 _16lm1iw26",variantClassNames:{active:{true:"j26lrx2",false:"j26lrx3"}},defaultVariants:{},compoundVariants:[]});var{rootClassName:$y}=Le,Uy=`${$y}-ActiveRowIndicator`,Yy=`calc(${Y.activeCellRowOffsetX} + var(${q(Y.scrollLeftForActiveRowWhenHorizontalLayout)}, 0px))`,qy={[q(Y.activeCellOffsetY)]:Y.activeCellRowOffset,transform:`translate3d(${Yy}, calc( ${Y.activeCellOffsetY} + var(${q(Y.scrollTopForActiveRow)}, 0px)), 0px)`,height:Y.activeCellRowHeight,maxWidth:ce.runtime.totalVisibleColumnsWidthVar},Xy=o=>{let{brain:e}=o,t=(0,Go.useRef)(null),n=o.activeRowIndex!=null&&e.getInitialRows()>o.activeRowIndex,[r,i]=Mt();return(0,Go.useLayoutEffect)(()=>{if(o.activeRowIndex==null)return;let a="0px",l=o.activeRowIndex;if(e.isHorizontalLayoutBrain&&e.rowsPerPage){let f=e.getPageIndexForRow(l);f>0&&(a=`calc(${ce.runtime.totalVisibleColumnsWidthVar} * ${f})`),l=l%e.rowsPerPage}let s=e.getRowHeight(l),c=e.getItemOffsetFor(l,"vertical"),u=t.current,d={activeCellRowHeight:`${s}px`,activeCellRowOffset:`${c}px`,activeCellRowOffsetX:a};xo(d,u)},[o.activeRowIndex,e]),(0,Go.useEffect)(()=>{let a=c=>{xo({scrollTopForActiveRow:`${-c.scrollTop}px`,scrollLeftForActiveRowWhenHorizontalLayout:e.isHorizontalLayoutBrain?`${-c.scrollLeft}px`:"0px"},t.current)};a(e.getScrollPosition());let l=e.onScroll(a),s=e.onRenderCountChange(i);return()=>{s(),l()}},[e]),Vr.createElement("div",{className:ia,"data-name":"active-row"},Vr.createElement("div",{ref:t,"data-name":"active-row-indicator",className:`${Uy} ${$f({active:n})}`,style:n?qy:void 0}))},Uf=Vr.memo(Xy);var Gr=V(require("react")),Ho=require("react");var{rootClassName:Zy}=Le,Qy=`${Zy}-ActiveCellIndicator`,Jy=q(Y.columnZIndexAtIndex),eT=(o,e,t,n)=>{if(e==null)return;let[r]=e;o.isHorizontalLayoutBrain&&o.rowsPerPage&&(r=r%o.rowsPerPage);let i=typeof t=="function"?t(r):t??o.getRowHeight(r),a=o.getItemOffsetFor(r,"vertical"),l=n.current;xo({activeCellRowHeight:`${i}px`,activeCellRowOffset:`${a}px`},l)},tT=o=>{let{brain:e}=o,[t,n]=Mt(),r=(0,Ho.useRef)(null),i=o.activeCellIndex!=null&&e.getInitialRows()>o.activeCellIndex[0];return(0,Ho.useLayoutEffect)(()=>{eT(e,o.activeCellIndex,o.rowHeight,r)},[o.activeCellIndex,o.rowHeight,e]),(0,Ho.useEffect)(()=>{let a=e.onRenderCountChange(()=>{n()});return()=>{a()}},[e]),Gr.createElement("div",{className:ia,ref:r,"data-name":"active-cell",style:i?{zIndex:`var(${Jy}-${o.activeCellIndex[1]})`}:void 0},Gr.createElement("div",{"data-name":"active-cell-indicator",className:`${Qy} ${jf({visible:i})}`}))},Yf=Gr.memo(tT);var aa=[Yd,`${ct}DetachedCell`];function la(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 nT=Z(If,fs);function qf(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:f,forceRerenderTimestamp:p,scrollVarHostRef:m,...g}=o,{autoFocus:b}=g,h=(0,Vt.useRef)(null),[y,S]=(0,Vt.useState)({width:0,height:0});(0,Vt.useEffect)(()=>{n!=null&&e.setScrollStopDelay(n)},[n,e]),(0,Vt.useEffect)(()=>{let I=h.current?.parentNode;return I?(b&&document.activeElement!==I&&I.focus(),gr(I,()=>{let R={height:I.clientHeight,width:I.clientWidth};e.update(R)},{debounce:50})):void 0},[f,e]);let C=(0,Vt.useCallback)(I=>{requestAnimationFrame(()=>{h.current&&h.current.style.setProperty("transform",`translate3d(${-I.scrollLeft}px, ${-I.scrollTop}px, 0px)`)})},[]),T=(0,Vt.useCallback)(I=>{e.setScrollPosition(I,C)},[e,C]);return(0,Vt.useEffect)(()=>{let I=e.onRenderCountChange(()=>{S(e.getVirtualizedContentSize())});return S(e.getVirtualizedContentSize()),C(e.getScrollPosition()||{scrollLeft:0,scrollTop:0}),I},[e]),ro.createElement(_f,{onContainerScroll:T,...g,ref:t},ro.createElement("div",{ref:h,className:nT,"data-name":"scroll-transform-target"},ro.createElement(ra,{forceRerenderTimestamp:p,renderer:s,onRenderUpdater:d,renderCell:r,renderDetailRow:i,brain:e,cellHoverClassNames:l,cellDetachedClassNames:aa}),u!=null?ro.createElement(Yf,{brain:e,rowHeight:a,activeCellIndex:u}):null),c!=null?ro.createElement(Uf,{brain:e,activeRowIndex:c}):null,ro.createElement(wf,{width:y.width,height:y.height}))}function Xf(o,e,t,n){let r=new Map,i=new Map,a=new Map;o.forEach((u,d)=>{let f=u.id,p=o[d-1],m=p?.id??"",g=new Set,b=p?.computedPinned!==u.computedPinned?new Set:a.get(m)??new Set;a.set(f,g);let h={type:"column",id:f,ref:u,groupOffset:0,computedPinned:u.computedPinned,computedWidth:u.computedWidth,depth:u.columnGroup?(t.get(u.columnGroup)??0)+1:0};r.set([f],h);let y=u.columnGroup,S,C=h;for(;y;){let T=e[y];if(T){g.add(y);let I=[f,...g];S=b.has(y)?i.get(y):void 0,S||(S={id:y,type:"group",ref:T,columnItems:[],children:[],groupOffset:0,uniqueGroupId:[y],computedWidth:0,computedPinned:h.computedPinned,depth:t.get(y)??0},r.set(I,S),i.set(y,S)),S.columnItems.push(h),S.uniqueGroupId.push(h.id),C&&!b.has(C.id)&&S.children.push(C),C=S,y=T.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((f,p)=>f+p.ref.computedWidth,0);u.groupOffset=c,u.computedWidth=d,u.type==="group"&&Zf(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 Zf(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"&&Zf(t.children),e+=n})}var _n=V(require("react")),io=require("react");var vs=V(require("react"));var Jf=V(require("react")),Is=require("react");var Hr=require("react"),Kr=V(require("react"));var{rootClassName:oT}=Le,rT=`${oT}HeaderCell_ResizeHandle`;function iT(o){let e=(0,Hr.useRef)(null),[t,n]=(0,Hr.useState)(!1),r=(0,Hr.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 f=d.pointerId,p=d.clientX,m=d.target;m.setPointerCapture(f);let g=!0,b=sf(o.groupColumns.map(C=>C.computedVisibleIndex),{columns:o.columns,domRef:e}),h=C=>{a==="end"&&(C*=-1);let{constrained:T,adjustedDiffs:I,adjustedDiff:w}=o.computeResize(C);return r.current!==T&&n(T),b.resize(I),w},y=C=>{if(g){let T=o.groupColumns.reduce((v,R)=>v+R.computedWidth-R.computedMinWidth,0),I=o.brain.getAvailableSize(),w={width:I.width+T,height:I.height};o.brain.update(w),g=!1}h(Math.round(C.clientX-p))},S=C=>{m.releasePointerCapture(f),m.removeEventListener("pointermove",y),m.removeEventListener("pointerup",S);let T=Math.round(C.clientX-p),I=h(T);o.onResize(I)};m.addEventListener("pointermove",y),m.addEventListener("pointerup",S)},u=(a===!1||a==="start")&&s?{right:a==="start"?void 0:ce.components.HeaderCell.resizeHandleWidth}:a==="end"&&l?{right:void 0}:void 0;return Kr.createElement("div",{ref:e,className:`${rT} ${Ki} ${Wi({computedPinned:a,computedFirstInCategory:l,computedLastInCategory:s})}`,onPointerDown:c},Kr.createElement("div",{style:{...u,...o.style},className:Bi({constrained:t})}))}var Qf=Kr.memo(iT);function ep(o,e){let{bodyBrain:t,groupHeight:n,columnGroup:r,columnGroupsMaxDepth:i}=e,{computed:{computedVisibleColumns:a},getState:l,getComputed:s,actions:c}=J(),u=o[o.length-1],d=(0,Is.useCallback)(g=>{let b=l(),{columnSizing:h,viewportReservedWidth:y,bodySize:S}=b,C=s().computedVisibleColumns,T=!1,I=C.reduce((R,x)=>(x.computedFlex&&(R[x.id]={...h[x.id],flex:x.computedWidth},T=!0),R),{}),w=T?{...h,...I}:h;return zu({availableSize:S.width,reservedWidth:y||0,dragHandleOffset:g,dragHandlePositionAfter:u.computedVisibleIndex,columnSizing:w,columnGroupSize:o.length,items:C.map(R=>({id:R.id,resizable:R.computedResizable,computedFlex:R.computedFlex,computedWidth:R.computedWidth,computedMinWidth:R.computedMinWidth,computedMaxWidth:R.computedMaxWidth}))})},[u]),f=(0,Is.useCallback)(g=>{let{columnSizing:b,reservedWidth:h}=d(g);c.viewportReservedWidth=h,c.columnSizing=b},[d]);return o.some(g=>g.computedResizable)?Jf.createElement(Qf,{brain:t,style:{height:n*(i-r.depth+2)},columns:a,groupColumns:o,computeResize:d,onResize:f}):null}var tp=`${ct}HeaderGroup`,np=q(Y.columnWidthAtIndex),aT=q(Y.columnZIndexAtIndex);function op(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=ep(n,{bodyBrain:r,groupHeight:t,columnGroup:e,columnGroupsMaxDepth:i}),c=n[0],u=n.length>1?"calc( "+n.map(p=>`var(${np}-${p.computedVisibleIndex})`).join(" + ")+" )":`var(${np}-${c.computedVisibleIndex})`,d=`calc(var(${aT}-${c.computedVisibleIndex}) + ${i-e.depth})`,f=typeof l=="function"?l({columnGroup:e,horizontalLayoutPageIndex:o.horizontalLayoutPageIndex}):l;return f=f&&typeof f=="object"?f:{},f.width=u,f.height=t,vs.createElement("div",{ref:o.domRef,"data-group-id":e.uniqueGroupId,className:Z(Mu,tp),style:f,"data-z-index":d},vs.createElement("div",{className:Z(`${tp}__header-content`,Ut)},a),s)}var{rootClassName:lT}=Le,sT=[],rp=`${lT}Header`,cT=vu({overflow:!1}),ip=()=>{};function uT(o){let{bodyBrain:e,columns:t,style:n,className:r,columnHeaderHeight:i,columnAndGroupTreeInfo:a,columnGroupsMaxDepth:l}=o,{computed:s,getState:c,state:{headerBrain:u,headerOptions:d,showColumnFilters:f,headerRenderer:p,headerOnRenderUpdater:m}}=J(),{computedColumnsMap:g}=s,b=(0,io.useRef)(null),h=(0,io.useCallback)(C=>{b.current&&(b.current.style.transform=`translate3d(-${C.scrollLeft}px, 0px, 0px)`)},[]);(0,io.useEffect)(()=>{let C=u.onScroll(h);return h(u.getScrollPosition()||{scrollLeft:0,scrollTop:0}),C},[u]);let y={ref:b,className:Z(rp,`${rp}--virtualized`,r,cT),style:{...n,height:i}},S=(0,io.useCallback)(C=>{let{rowIndex:T,colIndex:I,domRef:w,height:v,widthWithColspan:R,heightWithRowspan:x,hidden:M}=C,A=t[I];if(!A||M)return null;let E=u.isHorizontalLayoutBrain?u.getPageIndexForRow(T):null,P=a?a.pathsToCells.get([T,I]):null;if(P&&P.type==="group"){let _=P.columnItems.map(F=>F.ref),D={...P.ref,id:P.id,uniqueGroupId:P.uniqueGroupId,depth:P.depth,columns:_.map(F=>F.id),computedWidth:P.computedWidth,groupOffset:P.groupOffset};return c().columnGroupVisibility[P.id]!==!1?_n.createElement(op,{horizontalLayoutPageIndex:E,bodyBrain:e,columnGroupsMaxDepth:l,domRef:w,columns:_,width:R,height:v,columnGroup:D}):null}return _n.createElement(lp,{domRef:w,column:A,horizontalLayoutPageIndex:E,headerOptions:d,width:R,height:x,columnsMap:g})},[d,t,i,a,l,f,u]);return _n.createElement(to,{orientation:"horizontal",dragListId:"header",onDrop:ip,updatePosition:ip},C=>_n.createElement("div",{...C,...y,className:Z(C.className,y.className)},_n.createElement(ra,{name:"header",renderCell:S,brain:u,renderer:p,onRenderUpdater:m,cellHoverClassNames:sT,cellDetachedClassNames:aa})))}var ap=_n.memo(uT);function sp(o){let{headerBrain:e,bodyBrain:t,scrollbars:n}=o,r=J(),{computedPinnedStartColumns:i,computedPinnedEndColumns:a,computedVisibleColumns:l,columnSize:s}=r.computed,{state:{columnHeaderHeight:c,columnGroupsDepthsMap:u,columnGroupsMaxDepth:d,computedColumnGroups:f,showColumnFilters:p}}=r,m=!f||!Object.keys(f).length?1:d+2,g=m*c+(p?c:0),b=Gt.useMemo(()=>{if(!(!f||!Object.keys(f).length))return Xf(l,f,u,d)},[l,f,u]),h=Gt.useCallback(({rowIndex:w,colIndex:v})=>{let R=l[v],x=1,M=1;if(!R||!b)return{rowspan:x,colspan:M};let A=b.pathsToCells.get([w,v]);if(!A)return{rowspan:x,colspan:M};if(A.type==="column")return{colspan:M,rowspan:m-A.depth};let E=A.columnItems.findIndex(P=>P.id===R.id);return{rowspan:x,colspan:E===0?A.columnItems.length:1}},[f,d,l,b,m,u]),y=Gt.useCallback(({rowIndex:w,colIndex:v})=>h({rowIndex:w,colIndex:v}).rowspan,[h]),S=Gt.useCallback(({rowIndex:w,colIndex:v})=>h({rowIndex:w,colIndex:v}).colspan,[h]),C=Gt.useCallback(w=>p?w<m-1?c:2*c:c,[m,p,c]);la(e,{colWidth:s,rowHeight:C,rows:m,cols:l.length,height:g,rowspan:y,colspan:S},{fixedColsEnd:a.length,fixedColsStart:i.length});let T=Gt.createElement(ap,{columns:l,headerBrain:e,bodyBrain:t,columnHeaderHeight:g,columnGroupsMaxDepth:d,columnAndGroupTreeInfo:b}),I=n.vertical&&wn()?Gt.createElement("div",{className:Au,style:{zIndex:1e3,width:wn()}}):null;return Gt.createElement("div",{className:`${ts} ${Fu}`,style:{height:g}},T,I)}var{ManagedComponentContextProvider:dT}=Et({initSetupState:Tf,forwardProps:Sf,Context:ds()});function Rs(o){let e=J(),{state:t,getComputed:n}=e,{header:r,brain:i,headerBrain:a,wrapRowsHorizontally:l}=t,{scrollbars:s}=n();return r?Br.createElement(dT,{...o},Br.createElement(sp,{wrapRowsHorizontally:!!l,bodyBrain:i,headerBrain:a,scrollbars:s})):null}function cp(){return Br.useContext(ds()).componentState}var fT=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||rn;return Pe.createElement(s,{domProps:{className:Fi},onChange:c=>{if(l){c?r.treeApi.selectAll():r.treeApi.deselectAll();return}c?n.rowSelectionApi.selectAll():n.rowSelectionApi.deselectAll()},checked:i})},Gi=Pe.createContext(null);var pT=q(Y.columnZIndexAtIndex),mT=q(Y.columnVisibilityAtIndex),xs=Pe.createElement("div",{className:hi[1]}),dp=yi({"data-name":"","data-field":"","data-header-align":"","data-column-id":"","data-sort":"","data-sort-index":"",[Dn]:""});function lp(o){let e=o.column,{allowColumnHideWhileDragging:t}=cp(),{onDragItemPointerDown:n}=Fr(),{api:r,getComputed:i,getState:a,actions:l,state:{showColumnFilters:s,components:c,portalDOMRef:u,columnHeaderHeight:d,columnReorderDragColumnId:f,columnMenuVisibleForColumnId:p,columnReorderInPageIndex:m},getDataSourceMasterContext:g}=J(),{api:b,componentActions:h,getState:y,componentState:{filterDelay:S,filterTypes:C}}=Oe(),{allRowsSelected:T,someRowsSelected:I,selectionMode:w}=on(),v=o.horizontalLayoutPageIndex,R=f===e.id,x=m!=null?v!==m:!1,{onResize:M,height:A,width:E,headerOptions:P,columnsMap:_}=o,D=e.computedSortInfo,O=e.header,F=(0,sn.useCallback)(k=>{K.current=k,o.domRef?.(k)},[o.domRef]),j=P.alwaysReserveSpaceForSortIcon,z=e.headerAlign??e.align,L=(typeof z=="function"?z({isHeader:!0,column:e}):z)??"start",le=(typeof e.verticalAlign=="function"?e.verticalAlign({isHeader:!0,column:e}):e.verticalAlign)??"center",ne=ut(e,{actions:l,api:r,dataSourceActions:h,dataSourceApi:b,getComputed:i,getDataSourceState:y,getDataSourceMasterContext:g,getState:a}),W=ne.isSortable(),$=W&&(e.computedSorted||j)?Pe.createElement(Hi,{index:e.computedMultiSort?e.computedSortIndex+1:void 0,style:{marginInlineStart:ce.spacing[2],marginInlineEnd:ce.spacing[2]},className:`${qn}__sort-icon ${_u} ${Nu({align:L})}`,direction:e.computedSorted?e.computedSortedAsc?1:-1:0}):null,ge=e.computedFilterable&&e.computedFiltered?Pe.createElement(wo,null):null,me=e.headerCssEllipsis??e.cssEllipsis??!0,ue={reserveSpaceWhenHidden:L==="center",menuVisible:p===e.id,style:L==="end"?{marginInlineStart:`calc(${ce.components.HeaderCell.resizeHandleActiveAreaWidth} / 2)`,marginInlineEnd:ce.spacing[2]}:{marginInlineEnd:`calc(${ce.components.HeaderCell.resizeHandleActiveAreaWidth} / 2)`,marginInlineStart:ce.spacing[2]},domProps:{onMouseDown:k=>{k.stopPropagation(),ne.toggleContextMenu(k.target)}}},de=e.components?.MenuIcon||c?.MenuIcon||Ar,he=Pe.createElement(de,{...ue}),K=(0,sn.useRef)(null),H={horizontalLayoutPageIndex:v,dragging:R,domRef:F,htmlElementRef:K,renderLocation:"column-header",column:e,columnsMap:_,columnSortInfo:D,columnFilterValue:e.computedFilterValue,filtered:e.computedFiltered,someRowsSelected:I,allRowsSelected:T,selectionMode:w,api:r,dataSourceApi:b,columnApi:ne,renderBag:{sortIcon:$,filterIcon:ge,menuIcon:he,menuIconProps:ue,selectionCheckBox:null,header:e.header&&typeof e.header!="function"?e.header:e.name}},X=H,B=X.renderBag.header,ie=()=>{let k={...H,renderBag:{...H.renderBag}};if(e.renderSortIcon&&(k.renderBag.sortIcon=Pe.createElement(xn,{render:e.renderSortIcon,renderParam:{...k,renderBag:{...k.renderBag}}})),e.renderFilterIcon&&(k.renderBag.filterIcon=Pe.createElement(xn,{render:e.renderFilterIcon,renderParam:{...k,renderBag:{...k.renderBag}}})),typeof e.renderMenuIcon=="function"&&(k.renderBag.menuIcon=Pe.createElement(xn,{render:Ft=>{if(typeof e.renderMenuIcon!="function")return null;let Lt=e.renderMenuIcon(Ft);return Lt?Lt.type===de||Lt.type===Ar?Lt:Pe.createElement(de,{...ue},Lt):null},renderParam:{...k,renderBag:{...k.renderBag}}})),e.renderSelectionCheckBox&&w==="multi-row"){k.renderBag.selectionCheckBox=Pe.createElement(xn,{render:fT,renderParam:{...k,renderBag:{...k.renderBag}}});let Ft=e.renderHeaderSelectionCheckBox??e.renderSelectionCheckBox;Ft&&Ft!==!0&&(k.renderBag.selectionCheckBox=Pe.createElement(xn,{render:Ft,renderParam:{...k,renderBag:{...k.renderBag}}}))}O instanceof Function&&(k.renderBag.header=B=Pe.createElement(xn,{render:O,renderParam:{...k,renderBag:{...k.renderBag}}}));let Ce=e.renderMenuIcon===!1?null:k.renderBag.menuIcon,gn=me?Pe.createElement("div",{className:Ut},k.renderBag.header):k.renderBag.header,xt=Pe.createElement(Pe.Fragment,null,L==="center"?xs:null,k.renderBag.selectionCheckBox,gn,k.renderBag.sortIcon,k.renderBag.filterIcon,L==="center"?xs:null,L!=="center"?xs:null,Ce);return e.renderHeader?Pe.createElement(xn,{render:e.renderHeader,renderParam:{...k,renderBag:{...k.renderBag,all:xt}}}):xt};(0,sn.useEffect)(()=>{let k=null,Ce=K.current;return M&&Ce&&(k=gr(Ce,M)),()=>{k?.()}},[K.current,o.onResize]);let ee={height:A};e.headerStyle&&(ee=typeof e.headerStyle=="function"?{...ee,...e.headerStyle(X)||{}}:{...ee,...e.headerStyle});let fe=typeof e.headerClassName=="function"?e.headerClassName(X):e.headerClassName,{onPointerDown:Ie,proxyPosition:N,dragColumnOutside:U}=_d({columnId:e.id,domRef:K,horizontalLayoutPageIndex:v,allowColumnHideOnDrag:t}),te=null,se=Gi.Provider,Me={filtered:e.computedFiltered,verticalAlign:le,align:L},Ne=Pe.useMemo(()=>{let k=Ce=>{r.setColumnFilter(e.id,Ce)};return S>0?Pt(k,{wait:S}):k},[S,e.id]),Fe=e.computedFilterType,be=C[Fe],je=e.computedFilterable?e.computedFilterValue?.filter.operator??be?.defaultOperator:void 0,$e=e.computedFilterable&&be?be.operators.find(k=>k.name===je):void 0,bt=$e?.components?.FilterEditor||be?.components?.FilterEditor||e.components?.FilterEditor||Ro,Nt=be?.components?.FilterOperatorSwitch||e.components?.FilterOperatorSwitch,tt=df(e,{horizontalLayoutPageIndex:v}),G=`var(${pT}-${e.computedVisibleIndex})`;ee.zIndex=G,ee.visibility=`var(${mT}-${e.computedVisibleIndex}, visible)`;let oe={"data-field":`${e.field||""}`,"data-column-id":e.id,[Dn]:e.id,"data-header-align":L,"data-name":"HeaderCell","data-sort":e.computedSortedAsc?"asc":e.computedSortedDesc?"desc":"none","data-sort-index":`${e.computedSortIndex??-1}`},ae=e.computedFilterable?Pe.createElement($u,{horizontalLayoutPageIndex:v,filterEditor:bt,filterOperatorSwitch:Nt??Uu,operator:$e,filterTypes:C,onChange:Ne,columnFilterType:Fe,columnLabel:e.field||e.name||e.id,columnFilterValue:e.computedFilterValue,columnHeaderHeight:d}):Pe.createElement(Yu,null);X.renderBag.filterEditor=ae;let ye=(0,sn.useCallback)(k=>{Ie(k),n(k)},[Ie,n]),Ue=ie();return R&&N&&(te=Pe.createElement("div",{key:e.id,className:`${qn}Proxy ${Cu}`,style:{height:A,width:E,left:N.left??0,top:N.top??0}},Pe.createElement("div",{className:wu({visible:U})},Pe.createElement(yf,{size:16})),B),te=(0,up.createPortal)(te,u.current)),Pe.createElement(se,{value:X},Pe.createElement(zi,{domRef:F,horizontalLayoutPageIndex:o.horizontalLayoutPageIndex,cellType:"header",column:e,...oe,"data-z-index":G,style:ee,width:E,onPointerDown:ye,contentClassName:Z(Su(Me),Uc[L]),contentStyle:s?{height:A/2}:void 0,className:Z(qn,Qc.none,W?jc.pointer:"",fe,xi(e,[qn,Qn],Iu,{dragging:R,insideDisabledDraggingPage:x,align:L,verticalAlign:le,rowSelected:!1,cellSelected:!1,rowDisabled:!1,zebra:!1,rowActive:!1,firstRow:!0,firstRowInHorizontalLayoutPage:!0,treeNode:!1,groupCell:!1,groupRow:!1,rowExpanded:!1}),Tu),cssEllipsis:me,afterChildren:Pe.createElement(Pe.Fragment,null,s?ae:null,tt),renderChildren:Ue}),te)}function Ir(){return(0,sn.useContext)(Gi)}var cn=V(require("react")),gp=require("react");function fp(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 pp={padding:ce.spacing[2],textAlign:"end",opacity:"1",visibility:"visible",display:"block",fontSize:"0.85rem",background:"white",color:"black"},gT={opacity:1,visibility:"visible",display:"inline-block",pointerEvents:"all",color:"black",textDecoration:"underline"},mp=(o,e)=>{if(o)for(let[t,n]of Object.entries(e))o.style.setProperty(fp(t),n,"important")},hp=cn.forwardRef(function(e,t){let{rootClassName:n}=gi(),r=cn.useRef(null),i=cn.useCallback(a=>{r.current=a,t&&(typeof t=="function"?t(a):t.current=a)},[]);return(0,gp.useEffect)(()=>{let a=()=>{setTimeout(()=>{mp(r.current,pp),mp(r.current?.firstElementChild,gT)})};a();let l=setInterval(a,1e3);return()=>{clearInterval(l)}},[]),cn.createElement("div",{ref:i,...e,className:Z(`${n}-Footer`,nd,e.className),style:pp},"Powered by"," ",cn.createElement("a",{href:"https://infinite-table.com",rel:"noopener noreferrer",role:"link",target:"_blank"},"Infinite Table"))});function Ps(o){return o.map(Zt)}function Zt(o){if(xe().structuredClone)return xe().structuredClone(o);if(o===null||typeof o!="object")return o;if(Array.isArray(o))return Ps(o);if(o instanceof Date)return new Date(o);if(o instanceof Set)return new Set(Ps(Array.from(o)));if(o instanceof Map)return new Map(Ps(Array.from(o)));let e={};for(let t in o)o.hasOwnProperty(t)&&(e[t]=Zt(o[t]));return e}function Wr(o){return o}var ao=Object.seal({data:null,field:null});var Nn="____root____",yp="____not_loaded_yet____";function On(){return!1}function Ds(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 sa(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 Tp(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(h,y,S,C=0,T=[]){let I=!S.length||C===S.length-1,w=y[c?.values||"values"]||{};for(let v in w)if(w.hasOwnProperty(v)){let R=v;T.push(R),f.set(T,!0),h.set(T,{reducerResults:w[v][c?.totals||"totals"]||{},items:[]}),I||d(h,w[v],S,C+1,T),T.pop()}}let f=r?new Q:void 0,p=[],m=Ds(n),g=Zt(m);e.visitDepthFirst((h,y,S,C)=>{let[T,...I]=y,w=h.children,v=u.get(I);if(v&&(v.cache=h.cache,v.childrenLoading=h.childrenLoading,v.childrenAvailable=h.childrenAvailable,v.error=h.error),I.length==i.length&&i.length){if(v){v.items=w;for(let x=0,M=I.length;x<M;x++){let A=I.slice(0,x),E=u.get(A);E&&(E.items=E.items||[],E.items=E.items.concat(w))}w=a.indexArray(w,{toPrimaryKey:l,cache:s,nodesKey:void 0})}return C?.()}for(let R=0,x=w.length;R<x;R++){if(!w[R]){let P={items:[],reducerResults:{},cache:!1,childrenLoading:!1,childrenAvailable:!1,isTree:!1,isGroupBy:!0};u.set([...I,`${yp}${R}`],P);continue}let M=w[R].data,A=w[R].keys||[];if(A.length){let P=A[A.length-1];I.push(P)}let E={items:[],cache:!1,childrenLoading:!1,childrenAvailable:!1,commonData:M,totalChildrenCount:w[R].totalChildrenCount,reducerResults:w[R].aggregations||{},isTree:!1,isGroupBy:!0};if(u.set(I,E),r){let P=E.pivotDeepMap=new Q,_=w[R].pivot;d(P,_,r,0,p)}A.length&&I.pop()}C?.()});let b={deepMap:u,groupParams:o,initialData:e,reducerResults:g};return r&&(b.topLevelPivotColumns=f,b.pivot=r),t&&t.end({details:[{name:"Group by fields",value:i.map(h=>h.field).join(", ")}]}),b}function bp(o,e,t,n,r,i,a,l,s,c=Wr){let{items:u,reducerResults:d,pivotDeepMap:f}=o.get(e);if(u.push(n),a&&sa(n,r,a,d,e),i){for(let p=0,m=i.length;p<m;p++){let{field:g,valueGetter:b,toKey:h}=i[p],y=g?n[g]:null;b&&(ao.data=n,ao.field=g,y=b(ao));let S=(h||c)(y,n);t.push(S),f.has(t)||(l.set(t,!0),f?.set(t,{reducerResults:Zt(s),items:[]}));let{reducerResults:C,items:T}=f.get(t);T.push(n),a&&sa(n,r,a,C,e)}t.length=0}}function Sp(o,e,t,n,r,i,a,l){let{isLeafNode:s,getNodeChildren:c,toKey:u}=o,d=u(r),f=[...n,d],p=s(r);if(t.set(f,!0),p){for(let h=0,y=n.length;h<=y;h++){let S=n.slice(0,h),C=e.get(S),{reducerResults:T,items:I}=C;I.push(r),C.leavesAvailableCount++,C.totalLeafNodesCount++,a&&sa(r,i,a,T,S)}return}let m=Zt(l),g=[];e.set(f,{items:g,isTree:!0,isGroupBy:!1,node:r,reducerResults:m,cache:!1,childrenLoading:!1,childrenAvailable:!0,totalLeafNodesCount:0,leavesAvailableCount:0,treeNesting:n.length});let b=c(r);if(!(!b||!Array.isArray(b))){for(let h=0,y=b.length;h<y;h++){let S=b[h];Sp(o,e,t,f,S,h,a,l)}a&&jr(a,m,g)}}function Ms(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=Ds(t),i=Zt(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++)Sp(o,a,l,[],e[c],c,t,r);t&&jr(t,i,e);let s={deepMap:a,treeParams:o,treePaths:l,initialData:e,reducerResults:i};return n&&n.end(),s}function ua(o,e){let{marker:t,groupBy:n,defaultToKey:r=Wr,pivot:i,reducers:a}=o;t&&t.start();let l=n.length,s=i?new Q:void 0,c=new Q,u=[],d=[],f=Ds(a),p=Zt(f);if(!l){let g={items:[],isTree:!1,isGroupBy:!0,cache:!1,childrenLoading:!1,childrenAvailable:!1,reducerResults:Zt(f)};i&&(g.pivotDeepMap=new Q),c.set(u,g)}for(let g=0,b=e.length;g<b;g++){let h=e[g],y={};for(let S=0;S<l;S++){let{field:C,groupField:T,valueGetter:I,toKey:w}=n[S],v=C?h[C]:null;I&&(ao.data=h,ao.field=C,v=I(ao));let R=(w||r)(v,h);if(y[C||T]=R,u.push(R),!c.has(u)){let x={items:[],isTree:!1,isGroupBy:!0,cache:!1,commonData:{...y},childrenLoading:!1,childrenAvailable:!1,reducerResults:Zt(f)};i&&(x.pivotDeepMap=new Q),c.set(u,x)}bp(c,u,d,h,g,i,a,s,f,r)}l||bp(c,u,d,h,g,i,a,s,f,r),a&&sa(h,g,a,p,u),u.length=0}a&&(c.visitDepthFirst((g,b,h,y)=>{jr(a,g.reducerResults,g.items),i&&g.pivotDeepMap.visitDepthFirst(({items:S,reducerResults:C},T,I,w)=>{jr(a,C,S),w?.()}),y?.()}),jr(a,p,e));let m={deepMap:c,groupParams:o,initialData:e,reducerResults:p};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 Cp(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 hT(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,f=d??null,p;if(Object.keys(c).length>0){f={...d},p={};for(let y in i)if(i.hasOwnProperty(y)){let C=i[y].field;C&&(p[C]=c[y]),C&&f[C]==null&&(f[C]=c[y])}}let m=!0,g=n[n.length-1],b=g;if(f!=null){let y=t[n.length-1];y&&y.field&&(b=f[y.field]),y&&y.toKey&&(b=y.toKey(b,f)),b=b??g}return typeof b=="string"&&b.startsWith(yp)&&(m=!1,b=null),{data:f,reducerData:p,groupCount:s.length,groupData:s,groupKeys:n,isTreeNode:!1,rowSelected:!1,selectedChildredCount:0,deselectedChildredCount:0,id:`${n}`,collapsed:!1,dataSourceHasGrouping:!0,rowDisabled:!1,isCellSelected:On,hasSelectedCells:On,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:b,rootGroupBy:t,groupBy:l===t.length?t:t.slice(0,l),isGroupRow:!0,pivotValuesMap:u,groupNesting:l,reducerResults:c}}function ca(o,e,t){return{...o,id:`duplicate_row_on_page_${t}_for__${o.id}`,indexInAll:e,duplicateOf:o.id}}function jr(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 wp(o,e,t,n,r,i){let a=e.length,{isLeafNode:l,getNodeChildren:s}=r.treeParams,{toPrimaryKey:c,treeResult:u,isRowDisabled:d,isNodeSelected:f,withRowInfo:p,isNodeExpanded:m,treeSelectionState:g,repeatWrappedGroupRows:b,rowsPerPage:h}=r,{deepMap:y}=u,S=o.length,C=t[t.length-1],T=C?C.nodeExpanded:!0;for(let I=0;I<S;I++){let w=o[I],v=c(w,I),R=[...e,v];if(l(w)){let D={id:v,nodePath:R,isGroupRow:!1,data:w,treeNesting:a,totalLeafNodesCount:0,collapsedLeafNodesCount:0,isTreeNode:!0,isParentNode:!1,selfLoaded:!0,rowSelected:!1,rowDisabled:!1,isCellSelected:On,hasSelectedCells:On,dataSourceHasGrouping:!1,parentNodes:Array.from(t),indexInParentNodes:[...n,I],indexInParent:I,indexInAll:T?i.length:-1};f&&(D.rowSelected=f(D)),d&&(D.rowDisabled=d(D)),p&&p(D);let O=b&&h!=null&&h>0&&D.indexInAll%h===0?D.indexInAll/h:null;for(let F=0,j=t.length;F<j;F++){let z=t[F];if(T||(z.collapsedLeafNodesCount+=1),z.deepRowInfoArray.push(D),O!=null&&T){if(typeof b=="function"&&b(z)!==!0)continue;let L=ca(z,D.indexInAll,O);i[L.indexInAll]=L,D.indexInAll++}}T&&(i[D.indexInAll]=D);continue}let A=y.get(R)?.totalLeafNodesCount??0,E={dataSourceHasGrouping:!1,nodeExpanded:!1,selfExpanded:!1,nodePath:R,id:v,data:w,indexInAll:i.length,indexInParent:I,indexInParentNodes:[...n,I],totalLeafNodesCount:A,treeNesting:a,selfLoaded:!0,isParentNode:!0,isTreeNode:!0,isGroupRow:!1,deepRowInfoArray:[],parentNodes:Array.from(t),collapsedLeafNodesCount:0,rowSelected:!1,rowDisabled:!1,isCellSelected:On,hasSelectedCells:On,selectedLeafNodesCount:0,deselectedLeafNodesCount:0};if(f&&(E.rowSelected=f(E),g)){let D=g.getSelectionCountFor(E.nodePath);E.selectedLeafNodesCount=D.selectedCount,E.deselectedLeafNodesCount=D.deselectedCount}d&&(E.rowDisabled=d(E)),p&&p(E);let P=!0;if(m&&(E.selfExpanded=P=m(E)),T||(P=!1),E.nodeExpanded=P,T&&b&&h!=null&&h>0){let D=E.indexInAll,O=E.parentNodes;if(O.length>0&&D%h===0){let F=D/h,j=0;O.forEach(z=>{typeof b=="function"&&b(z)!==!0||(i.push(ca(z,D+j,F)),j++,E.indexInAll++)})}}T&&(i[E.indexInAll]=E);let _=s(w);Array.isArray(_)&&wp(_,R,[...t,E],E.indexInParentNodes,r,i)}return i}function Ip(o){let{dataArray:e,marker:t}=o;t&&t.start();let n=[];return wp(e,[],[],[],o,n),t&&t.end(),{data:n}}function vp(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:f,reducers:p={}}=o,{groupParams:m,deepMap:g,pivot:b}=n,{groupBy:h}=m;e&&e.start({details:[{name:"Group by fields",value:h.map(I=>I.field).join(", ")}]});let y=[],S=[],C=[],T=[];return g.visitDepthFirst((I,w,v,R)=>{let x=I.items,M=w.length,A=s?.isGroupRowCollapsed(w)??!1;T.push(v);let E=hT({lazyLoad:t,groupBy:h,parents:Array.from(C),reducers:p,indexInGroup:v,indexInParentGroups:Array.from(T),indexInAll:y.length,groupKeys:w,error:I.error,totalChildrenCount:I.totalChildrenCount,childrenLoading:(I.childrenLoading||!A&&!I.childrenAvailable)&&t,childrenAvailable:I.childrenAvailable,directChildrenCount:w.length===h.length?I.items.length:g.getDirectChildrenSizeFor(w),directChildrenLoadedCount:0},I);if(u&&(E.rowSelected=u(E),d)){let F=d.getSelectionCountFor(E.groupKeys);E.selectedChildredCount=F.selectedCount,E.deselectedChildredCount=F.deselectedCount}c&&(E.rowDisabled=c(E));let P=C[C.length-1],_=P?.collapsed??!1;_&&(A=!0),E.collapsed=A;let D=f||A;if(_&&(D=!1),D){if(i&&r!=null&&r>0){let F=E.indexInAll,j=E.parents;if(j.length>0&&F%r===0){let z=F/r,L=0;j.forEach(le=>{typeof i=="function"&&i(le)!==!0||(y.push(ca(le,F+L,z)),L++,E.indexInAll++)})}}y.push(E),S.push(y.length-1)}E.collapsedChildrenCount=0,C.forEach(F=>{F.deepRowInfoArray.push(E),F.collapsedGroupsCount+=A?1:0}),P&&E.selfLoaded&&t&&(P.directChildrenLoadedCount+=1),a&&a(E),C.push(E);let O=!0;if(O){if(R)R();else if(!b){let F=y.length;A||(y.length+=x.length);let j=0;for(let z=0,L=x.length;z<L;z++){let le=x[z];if(!A&&i&&r!=null&&r>0){let re=F+z+j;if(re%r===0){let ge=re/r;C.forEach(me=>{if(typeof i=="function"&&i(me)!==!0)return;let ue=F+z+j;y[ue]=ca(me,ue,ge),j++,y.length++})}}let ne=F+z+j,$={id:le?l(le,ne):`${w}-${z}`,data:le,isCellSelected:On,hasSelectedCells:On,dataSourceHasGrouping:!0,isTreeNode:!1,isGroupRow:!1,selfLoaded:!!le,rowSelected:!1,rowDisabled:!1,rootGroupBy:h,collapsed:A,groupKeys:w,parents:Array.from(C),indexInParentGroups:[...T,z],indexInGroup:z,indexInAll:ne,groupBy:h,groupNesting:M+1,groupCount:E.groupCount};u&&($.rowSelected=u($)),c&&($.rowDisabled=c($)),a&&a($),C.forEach((re,ge)=>{ge===C.length-1&&le&&(re.directChildrenLoadedCount+=1),A&&(re.collapsedChildrenCount+=1),re.deepRowInfoArray.push($)}),A||(y[F+z+j]=$)}}}C.pop(),T.pop()}),e&&e.end(),{data:y,groupRowsIndexes:S}}var dm=V(require("react"));var bT=()=>{};function Rp(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]],f=t.get(d),p=f?f[n]??[]:[];a(d,p),p.length&&(f||(f=typeof r=="function"?r(d,p):r),f[n]=p),s.push(f)}return s}return a([],[])}function xp(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],f=r(n),p=st(()=>{let m=i(n);if(!(!m||!Array.isArray(m)))for(let g=0,b=m.length;g<b;g++){let h=m[g];xp(o,e,d,h)}});f?(c?.(n),s?.(n,bT)):(l?.(n,p,i(n)),s?.(n,p))}function Pp(o,e,t){for(let n=0,r=t.length;n<r;n++)xp(o,e,[],t[n])}var yT=function(o,e){return o-e},TT=function(o,e){return o=`${o}`,e=`${e}`,o.localeCompare(e)},ST=function(o,e){return o-e},CT={number:yT,string:TT,date:ST},$r=CT;function Dp(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 Qt=(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(Mp(Dp(o),n)),r&&r.end(),e},da=(o,e,t)=>{let{marker:n}=t;n&&n.start();let r=Mp(Dp(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 Pp({isLeafNode:t.isLeafNode??u,getNodeChildren:t.getNodeChildren??c,toKey:s},{onParentNode:(d,f,p)=>{if(i&&f(),Array.isArray(p)){let m=a?p.sort(r):[...p].sort(r);d[l]=m}i||f()}},e),i&&(a?e.sort(r):e=[...e].sort(r)),n&&n.end(),e};Qt.knownTypes=$r;var wT=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=Qt.knownTypes[i],r||console.warn(`Unknown sort type "${o.type}" - please pass one of ${Object.keys(Qt.knownTypes).join(", ")}`)}return r||(r=$r.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}},IT=o=>o.map(wT).filter(e=>e instanceof Function),Mp=(o,e)=>{let t=IT(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 fa=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 gt=class extends fa{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 Ko(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||Wr)(l,o);return t.push(s),t},[])}var Ee=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.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?Ko(r,n):[]}getGroupDeepMap(){return this.getConfig().groupDeepMap}getGroupCount(e){if(e.length==0)return this.getConfig().totalCount;let n=this.getGroupDeepMap()?.get(e);return n?n.totalChildrenCount??(n.items.length||0):0}getGroupKeysDirectlyInsideGroup(e){let{groupDeepMap:t}=this.getConfig();return t?.getKeysStartingWith(e,{excludeSelf:!0,depthLimit:1})||[]}getAllPrimaryKeysInsideGroup(e){let{groupDeepMap:t}=this.getConfig();if(!e.length)return(t?.getKeysStartingWith([],{excludeSelf:!0,depthLimit:1})||[]).map(i=>this.getAllPrimaryKeysInsideGroup(i)).flat();let n=t?.get(e);return n?n.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()}getState(){let e=r=>{let i=this.getGroupByLength();return r.map(a=>this.onlyUsePrimaryKeys?a[0]:a.length>i?a.pop():a)},t=e(this.selectedMap.topDownKeys()),n=e(this.deselectedMap.topDownKeys());return{defaultSelection:this.defaultSelection,selectedRows:t,deselectedRows:n}}deselectAll(){this.update({defaultSelection:!1,selectedRows:[],deselectedRows:[]})}selectAll(){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}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)})}deselectGroupRow(e){if(this.onlyUsePrimaryKeys){this.getAllPrimaryKeysInsideGroup(e).forEach(i=>{this.defaultSelection===!1?this.selectedMap.delete([i]):this._deselectedMapSet(i)}),this.xcache();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)})}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(r&&this.onlyUsePrimaryKeys){let c=this.getAllPrimaryKeysInsideGroup(e),u=0,d=0;c.forEach(p=>{if(this.defaultSelection){if(this.deselectedMap.has([p])){d++;return}u++}else{if(this.selectedMap.has([p])){u++;return}d++}});let f={selectedCount:u,deselectedCount:d};return this.selectionCountCache.set(e,f),f}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,f=this.deselectedMap.getKeysStartingWith(e,{excludeSelf:!0,depthLimit:1}).length,p=u-(d+f),m={selectedCount:d+(c?p:0),deselectedCount:f+(c?0:p)};return this.selectionCountCache.set(e,m),m}let a=0,l=0;if(this.getConfig().lazyLoad&&!i.length){let c=this.getConfig().groupDeepMap?.get(e)?.totalChildrenCount||0;t?(a=c,l=this.deselectedMap.getAllChildrenSizeFor(e),l===c&&(a=0)):(l=c,a=this.selectedMap.getAllChildrenSizeFor(e),a===c&&(l=0))}i.forEach(c=>{let u=this.selectedMap.get(c),d=this.deselectedMap.get(c),f=u?!0:d?!1:t,{selectedCount:p,deselectedCount:m}=this.getSelectionCountFor(c,f);a+=p,l+=m});let s={selectedCount:a,deselectedCount:l};return this.selectionCountCache.set(e,s),s}};var vT="*",Be=class{constructor(e){this.wildcard=vT;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[f,p]=d;p===t&&l.push([f,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[f]=d;f===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){hn(`${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 p=this.selectedRowsToColumns.get(e);return p&&p.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}}};var RT=We("IT:InfiniteTable"),xT="#dc3545",PT="#eb9316";var Ap="Warn",_p="Error",DT="Info",MT="Success",ET="Logs",pa=RT.extend(ET),PO=pa.extend(DT),AT=pa.extend(Ap),_T=pa.extend(_p),DO=pa.extend(MT);var OT=PT,NT=xT;var FT=(o,e)=>{e=e?e.extend?e.extend(Ap):e:AT,e(typeof e.color=="function"?e.color(OT,o):o)},LT=(o,e)=>{e=e?e.extend?e.extend(_p):e:_T,e(typeof e.color=="function"?e.color(NT,o):o)};var Ep=new Q,Op=(o,...e)=>{Ep.has(e)||(Ep.set(e,!0),o())};var Bo=(o,e=o,t)=>{Op(()=>FT(o,t),e,"warn")},Np=(o,e=o,t)=>{Op(()=>LT(o,t),e,"error")};function ma(o,e){return new Ee(o,dt(e))}function dt(o){return()=>{let e=typeof o=="function"?o():o;return{lazyLoad:!!e.lazyLoad,toPrimaryKey:e.toPrimaryKey,onlyUsePrimaryKeys:!e.useGroupKeysForMultiRowSelection,groupBy:e.groupBy,groupDeepMap:e.groupDeepMap,indexer:e.indexer,totalCount:e.unfilteredCount}}}function Fp(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 Ee))throw"Invalid row selection";let a=new Ee(r,dt(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 Ee))throw"Invalid row selection";let a=new Ee(r,dt(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 Ee))throw"Invalid row selection";if(!i){let u=s.getDataForPrimaryKey(r);i=u?Ko(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 Ee))throw"Invalid row selection";if(!i){let d=s.getDataForPrimaryKey(r);i=d?Ko(d,c):[]}let u=new Ee(a,dt(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 Ee))throw"Invalid row selection";if(a==="multi-row"){if(!i){let d=s.getDataForPrimaryKey(r);i=d?Ko(d,c):[]}let u=new Ee(l,dt(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 Ee))throw"Invalid row selection";let s=new Ee(a,dt(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 Ee))throw"Invalid row selection";let s=new Ee(a,dt(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 Ee))throw"Invalid row selection";let s=new Ee(a,dt(e));s.toggleGroupRowSelection(r),t.rowSelection=s},getGroupRowSelectionState(r,i){let a=e(),{selectionMode:l,groupBy:s}=a,c=i?new Ee(i,dt(a)):a.rowSelection;if(l!=="multi-row")throw'Selection mode should be "multi-row"';if(!s)throw"No grouping specified";if(!(c instanceof Ee))throw"Invalid row selection";return c.getGroupRowSelectionState(r)},getSelectedPrimaryKeys:r=>{let i=e(),a=r?new Ee(r,dt(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}}}var Es=new WeakMap,kT=o=>o;function Lp(o,e=50,t){Es.set(o,{lastCallTime:0,lastCallArg:null});let n=t??kT;return r=>{let{lastCallTime:i,lastCallArg:a}=Es.get(o)||{lastCallTime:0,lastCallArg:null},l=Date.now(),s=l-i,c=At(n(a),n(r));s<e&&c||(Es.set(o,{lastCallTime:l,lastCallArg:r}),o(r))}}var ga=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,f=u.length;d<f;d++){let p=u[d];if(p.type==="insert"){let m=r(p.data);s?this.addNodePath([m],p.data,t):this.add(m,p.data),e.push(p.data)}}n?.removeInfo(void 0)}}else{let u=(d,f)=>{for(let p=0;p<d.length;p++){let m=d[p];c&&s&&Array.isArray(m[l])&&(m=d[p]={...m});let g=!1;if(m!=null){let b=r(m),h=s?[...f,b]:void 0,y=s&&!!h,S=y?n?.getMutationsForNodePath(h):n?.getMutationsForPrimaryKey(b);if(S&&S.length){for(let C=0,T=S.length;C<T;C++){let I=S[C];if(I.type==="delete"&&!g&&(y?this.removeNodePath(h,t):this.remove(b),g=!0,d.splice(p,1),p--),I.type==="update"&&!g&&(m={...m,...I.data},d[p]=m),I.type==="update-children"&&!g){let w=I.children(m[l],m);m={...m},w!==void 0?m[l]=w:delete m[l],d[p]=m}I.type==="insert"&&(I.position==="before"?(d.splice(p,0,I.data),p--):d.splice(p+1,0,I.data))}y?n?.removeNodePathInfo(h):n?.removeInfo(b)}if(!g)if(y){this.addNodePath(h,m);let C=a(m),T=C?null:i(m);!C&&Array.isArray(T)&&(f.push(b),c&&(m[l]=T=T.concat()),u(T,f),f.pop())}else this.add(b,m)}}};u(e,[])}return e}}};var et=require("react");var _t=require("react");function lo(o,e){let t=(0,_t.useRef)({}),n=(0,_t.useRef)({}),r=n.current,i=(0,_t.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,_t.useEffect)(()=>{let s=i.current,c;return Object.keys(s).length!==0&&(c=o(s,r)),i.current={},n.current={},c},l)}function zT(o,e){let t=(0,_t.useRef)({}),n=(0,_t.useRef)({}),r=n.current,i=(0,_t.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,_t.useLayoutEffect)(()=>{let s=i.current,c;return Object.keys(s).length!==0&&(c=o(s,r)),i.current={},n.current={},c},l)}function VT(o,e){let t=[];for(let n in e)e.hasOwnProperty(n)&&t.push(e[n]);(0,_t.useEffect)(o,t)}function As(...o){return(...t)=>{o.forEach(n=>{typeof n=="function"&&n(...t)})}}function _s(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 Os(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 kp({deepMap:o,pivotBy:e,pivotTotalColumnPosition:t,pivotGrandTotalColumnPosition:n,reducers:r={},showSeparatePivotColumnForSingleAggregation:i=!1}){let a=e.length,l=Object.keys(r).map(p=>({...r[p],id:p}));l.length||(i=!0,n=!1,t=!1,l.push({id:"__empty-aggregation-reducer__",name:"-",initialValue:null,reducer:()=>null}));let s={},c={},u=st(function(){l.forEach((p,m)=>{s[`total:${p.id}`]=_s({header:`${p.name||p.id} total`,pivotBy:e,pivotColumn:!0,pivotTotalColumn:!0,pivotAggregator:p,pivotAggregatorIndex:m,pivotGroupKeys:[],pivotGroupKey:"",pivotIndex:-1,valueFormatter:({rowInfo:g})=>g.isGroupRow?g.reducerResults?.[p.id]:null})})});(!a&&t==="start"||n==="start")&&u();let d=!i&&l.length===1;return o.visitDepthFirst((p,m,g,b)=>{if(m=[...m],t==="end"&&b?.(),m.length===a){let h=e[m.length-1],S=m.slice(0,-1).join("/");if(!d){let C=S;S=m.join("/");let T=m[m.length-1];c[S]=Os({header:`${T}`,columnGroup:C,pivotBy:e,pivotGroupKeys:m,pivotByAtIndex:h,pivotIndex:m.length-1,pivotGroupKey:T})}l.forEach((C,T)=>{let I=d?`${m[m.length-1]}`:C.name||C.id,w=_s({pivotBy:e,pivotColumn:!0,pivotTotalColumn:!1,pivotAggregator:C,pivotAggregatorIndex:T,pivotGroupKeys:m,pivotGroupKey:m[m.length-1],pivotIndex:m.length-1,pivotByAtIndex:h,defaultSortable:!1,columnGroup:S,header:I,valueFormatter:({rowInfo:R})=>R.isGroupRow?R.pivotValuesMap?.get(m)?.reducerResults[C.id]:null}),v=`${C.id}:${m.join("/")}`;s[v]=w})}else{let h=m.join("/"),y=m.slice(0,-1);if(c[h]=Os({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 S=e[m.length-1],C=y.length?y.join("/"):void 0;if(!d){let T=C;C=`total:${m.join("/")}`,c[C]=Os({header:`${m[m.length-1]} total`,columnGroup:T,pivotBy:e,pivotTotalColumnGroup:!0,pivotGroupKeys:m,pivotIndex:m.length-1,pivotByAtIndex:S,pivotGroupKey:m[m.length-1]})}l.forEach((T,I)=>{let w=d?`${m[m.length-1]} total `:`${T.name||T.id} total`,v=_s({columnGroup:C,header:w,pivotAggregator:T,pivotAggregatorIndex:I,pivotColumn:!0,pivotTotalColumn:!0,pivotGroupKeys:m,pivotGroupKey:m[m.length-1],pivotByAtIndex:S,pivotIndex:m.length-1,pivotBy:e,defaultSortable:!1,valueFormatter:({rowInfo:R})=>R.isGroupRow?R.pivotValuesMap?.get(m)?.reducerResults[T.id]:null});s[`total:${T.id}:${m.join("/")}`]=v})}}(t==="start"||t===!1)&&b?.()}),(!a&&t==="end"||n==="end")&&u(),{columns:s,columnGroups:c}}var zp=Symbol("CLEAR"),so=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=zp,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(zp);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}};function Fn(o,e){return e().dataArray[o]}function ha(o){return o().dataArray}var rt=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 GT=(o,e)=>o.length-e.length,Qe=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?Array.isArray(e)?new Q(e.map(t=>[t,!0])):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:Array.isArray(t.treePaths)?new Q(t.treePaths.map(n=>[n,!0])):t.treePaths,strictCheckPaths:t.strictCheckPaths??!0},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(){this.update({defaultSelection:!1,selectedPaths:[],deselectedPaths:[]})}selectAll(){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(GT);if(this.strictMode&&(l=l.filter(d=>this.isPathAvailable(d))),!l.length){if(i!==null){let f=r?i:!1;return this.cacheIt(e,{selected:f,selectedCount:f?r:0,deselectedCount:f?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,f=l.length;d<f;d++){let p=l[d],{selectedCount:m,deselectedCount:g}=this.getSelectionStateForNode(p);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.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 ya(o,e){return new Qe(o,Wo(e))}function Wo(o){return()=>({treePaths:(typeof o=="function"?o():o).treePaths})}var ba=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 Qe))throw"Invalid tree selection";let a=new Qe(r,Wo(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 rt({defaultExpanded:!0,collapsedPaths:[]});this.getState().lastExpandStateInfoRef.current={state:"expanded",nodePath:null},this.actions.treeExpandState=e}collapseAll(){let e=new rt({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 rt(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 rt(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 rt(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?Fn(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 Qe))throw"Invalid node selection";let n=new Qe(e,Wo(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 Qe))throw"Invalid node selection";let n=new Qe(e,Wo(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 Qe))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)}};var jo=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 ht=class extends jo{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)}};var Ns=1e3;function Vp(o){return new Fs(o)}var Fs=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=()=>ha(this.getState);this.getRowInfoByIndex=e=>Fn(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?Ns:r;return isNaN(a)||(a=Ns),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 ht(n):new ht({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 ht({enabledRows:!0,disabledRows:[]});return}let t=new ht(e);t.enableAll(),this.actions.rowDisabledState=t};this.disableAllRows=()=>{let e=this.getState().rowDisabledState;if(!e){this.actions.rowDisabledState=new ht({disabledRows:!0,enabledRows:[]});return}let t=new ht(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 ba({...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?so.clone(t,{light:!0}):new so({nodesKey:n?r:void 0});e.forEach(a=>{switch(a.type){case"update":a.array.forEach((u,d)=>{if(a.primaryKeys){let f=a.primaryKeys[d],p=this.getDataByPrimaryKey(f);p&&i.update(a.primaryKeys[d],u,p,a.metadata)}else if(a.nodePaths){let f=this.getDataByNodePath(a.nodePaths[d]);f&&(typeof u=="function"?i.updateChildren(a.nodePaths[d],u,f,a.metadata):i.updateNodePath(a.nodePaths[d],u,f,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??Ns,i=n.waitForNodePathPromises.get(e);if(i)return i.promise;let a=Date.now(),l=()=>{},s=new Promise(c=>{let u,d;l=f=>{clearTimeout(d),u=f,n.waitForNodePathPromises.delete(e),c(f)},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 Gp(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:f,isTree:p}=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((b,h)=>b||typeof h!="function"?l.has(h):!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(p&&(l===!0?r=!0:r=l.has(f)),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 Ta(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 Sa(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 Ca(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 ks(o,e){return o&&o.filter(t=>{let n=e[t.filter.type];return!(!n||n.emptyValues&&n.emptyValues.includes(t.filter.value))})}var Jt=(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 Ls(){return!1}function HT(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:Ls,hasSelectedCells:Ls};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 KT=st(()=>{console.warn(`Your "treeFilterFunction" should NOT MUTATE the data object. You're probably mutating the node children.
1
+ "use strict";var bb=Object.create;var ui=Object.defineProperty;var yb=Object.getOwnPropertyDescriptor;var Sb=Object.getOwnPropertyNames;var Tb=Object.getPrototypeOf,Cb=Object.prototype.hasOwnProperty;var wb=(n,e)=>()=>(e||n((e={exports:{}}).exports,e),e.exports),Ib=(n,e)=>{for(var t in e)ui(n,t,{get:e[t],enumerable:!0})},Hc=(n,e,t,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Sb(e))!Cb.call(n,r)&&r!==t&&ui(n,r,{get:()=>e[r],enumerable:!(o=yb(e,r))||o.enumerable});return n};var K=(n,e,t)=>(t=n!=null?bb(Tb(n)):{},Hc(e||!n||!n.__esModule?ui(t,"default",{value:n,enumerable:!0}):t,n)),Rb=n=>Hc(ui({},"__esModule",{value:!0}),n);var Jo=wb((wD,Pd)=>{"use strict";Pd.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 Ew={};Ib(Ew,{CellSelectionState:()=>$e,DataClient:()=>Fc,DataSource:()=>zT,DataSourceActionType:()=>Rm,DeepMap:()=>ee,FixedSizeSet:()=>ll,FlashingColumnCell:()=>ab,GroupRowsState:()=>Ct,INTERNAL_MatrixDebugger:()=>sb,InfiniteTable:()=>ro,InfiniteTableClassName:()=>Xt,InfiniteTableComponent:()=>Yh,Menu:()=>$t,RowDetailCache:()=>or,RowDetailState:()=>Pt,RowDisabledState:()=>wt,RowSelectionState:()=>Ee,TreeDataSource:()=>Rw,TreeExpandState:()=>st,TreeGrid:()=>Zh,TreeSelectionState:()=>Qe,WeakFixedSizeSet:()=>cl,alignNode:()=>bc,components:()=>Aw,createFlashingColumnCellComponent:()=>Nc,debounce:()=>Et,debug:()=>Ue,defaultFilterTypes:()=>Ao,eventMatchesKeyboardShortcut:()=>Wa,filterDataArray:()=>Xs,filterTypes:()=>Ao,flatten:()=>Fp,getComponentStateRoot:()=>Ot,group:()=>ya,interceptMap:()=>eb,keyboardShortcuts:()=>Jh,multisort:()=>eo,multisortNested:()=>Sa,queryKeyToCacheKey:()=>wn,toTreeDataArray:()=>zp,useComponentState:()=>Ft,useDataSourceInternal:()=>tr,useDataSourceSelector:()=>Fe,useDataSourceState:()=>Ca,useEffectWhen:()=>dl,useEffectWhenSameDeps:()=>tb,useEffectWithChanges:()=>gn,useEffectWithObject:()=>nT,useGridScroll:()=>tl,useInfiniteColumnCell:()=>Nr,useInfiniteColumnEditor:()=>$i,useInfiniteColumnFilterEditor:()=>On,useInfiniteHeaderCell:()=>Mr,useInfinitePortalContainer:()=>wh,useLayoutEffectWithChanges:()=>oT,useManagedDataSource:()=>Qs,useMasterRowInfo:()=>Ro,useOverlay:()=>oo,useOverlayPortal:()=>kg,usePrevious:()=>xo,useRowInfoReducers:()=>VT,useVisibleColumnSizes:()=>gh,withSelectedLeafNodesOnly:()=>Qh});module.exports=Rb(Ew);function Et(n,{wait:e}){let t=null;return function(...o){let r=this;t!==null&&clearTimeout(t),t=setTimeout(()=>{n.apply(r,o)},e)}}var Re=K(require("react"));var J=(...n)=>n.filter(e=>!!`${e}`).join(" ");var Xo=K(require("react")),Dl=require("react");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 pt(n){let e=!1,t=null;return(...r)=>(e||(e=!0,t=n(...r)),t)}var Kc=(n,e)=>n-e;var di=(n,e)=>Kc(n.revision,e.revision),ee=class n{constructor(e){this.map=new Map;this.length=0;this.revision=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,f)=>{let p=r.get(f);if(!p)return;let{map:m}=p,g=f===this.emptyKey;if(g&&!c)return;let b=g?[]:[...e,f],h=m?()=>this.visitWithNext(b,t,o,m,i!==void 0?i-1:void 0):void 0;if(p.hasOwnProperty("value")){let y=t(p.value,b,l,h,p);if(o&&y===!0)return!0;l++}else h?.()};s&&(u(void 0,this.emptyKey),c=!1,l=0);for(let[d,f]of r){let p=u(f,d);if(o&&p===!0)return p}};this.fill(e)}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(di).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=f=>{i?a.push(f):l.push(f.keys)},c=this.map,u,d=!1;if(e.length)for(let f=0,p=e.length;f<p;f++){let m=e[f];if(u=c.get(m),!u||!u.map)if(d=!0,f===p-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(di).map(f=>f.keys):l:(this.visitWithNext(e,(f,p,m,g,b)=>{s({...b,keys:p})},!1,c,r,o),i?a.sort(di).map(f=>f.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,f,p)=>{t(u,c,{...p,keys:u}),f?.()},!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;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}delete(e){let t=this.map;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=pt(()=>{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(di);function*o(){for(let r=0,i=t.length;r<i;r++)yield e(t[r])}return o()}};globalThis.DeepMap=ee;function Ae(){return globalThis}var pi=["#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"],Bc=Symbol("color"),fi=new WeakMap,Sl=Se();function Tl(n=pi){fi.set(n,n.map(e=>0))}Tl();var vb=(n=pi)=>{let e=[];fi.has(n)?e=fi.get(n):(e=n.map(o=>0),fi.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]??pi[0]},Sr=":",Cl="*",Wc="-",Db=",",Pb="debug",xb="diffdebug",$c=!1,yr=new ee,Tr=new Map;function wl(n,e){let t=n.split(Sr),o=new ee;o.set(t,!0);let r=e.split(Sr),i=new Set(r).has(Cl),a=r.indexOf(Cl),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(Sr)):!0}}function Uc(n,e){let t=`channel=${n}_permissions=${e}`;if(Tr.has(t))return Tr.get(t);let o=e.split(Db);function r(l){return Tr.set(t,l),l}let i=[],a=[];o.forEach(l=>{l.includes(Cl)?a.push(l):i.push(l)});for(let l=0;l<i.length;l++){let s=i[l],c=s.startsWith(Wc);if(c&&(s=s.substring(Wc.length)),wl(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)),wl(n,s))return r(!c)}return r(!1)}var Il=()=>Ue.enable??(Ae()&&Ae().localStorage?.getItem(Pb))??"",Mb=()=>Ue.diffenable??(Ae()&&Ae().localStorage?.getItem(xb))??`${$c}`,Rl="",Yc=$c;function vl(n){Yc=`${Mb()}`=="true",Rl!==n&&(Rl=n,Tr.clear())}function qc(n){vl(Il()),typeof Ae()<"u"&&Ae().addEventListener&&Ae().addEventListener("storage",function(){vl(Il())});function e(t,o){let r=o?`${o}${Sr}${t}`:t,i=r.split(Sr),a=yr.get(i);if(a)return a;let l=yr.get(i.slice(0,-1)),s=(l?l.logFn:Ue.logFn)??Xc,c=s,u,d=0,f=()=>u??Uc(r,Rl),p=vb(Ue.colors),m=Object.defineProperties((...g)=>{let b=Sl.getListenersCount(),h;if(b>0&&(h=h??Date.now(),Sl({color:p,channel:r,args:g,timestamp:h})),f()){if(h=h??Date.now(),d&&Yc){let T=h-d;c(`%c[${r}]`,`color: ${p}`,`+${T}ms:`)}d=h;let y=[],S;if(g.forEach(T=>{if(T[Bc])S===void 0&&(S=!0),y.push(...T);else{if(typeof T!="string"&&typeof T!="number"){S=!1;return}y.push(`${T}%s`)}}),S){let T=[`%c[${r}]%c %s`,`color: ${p}`,"",...y,""];c(...T)}else c(`%c[${r}]%c %s`,`color: ${p}`,"",...g)}},{channel:{value:r},color:{value:(g,...b)=>{let h=[`%c${b.join(" ")}%c%s`,`color: ${g}`,""];return h.toString=()=>b.join(" "),h[Bc]=!0,h}},extend:{value:g=>e(g,r)},enabled:{get:()=>f(),set:g=>{u=g}},logFn:{configurable:!1,get:()=>c,set:g=>{c=g??s}},destroy:{value:()=>{yr.delete(i)}}});return yr.set(i,m),m}return e(n)}var Xc=console.log.bind(console),jc;Object.defineProperty(qc,"enable",{get:()=>jc,set:n=>{jc=n,vl(Il())}});var Ue=qc;Ue.colors=pi;Ue.logFn=Xc;var Ab=(n,e)=>Sl.onChange(t=>{if(!t)return;let{channel:o,args:r,color:i,timestamp:a}=t;wl(o,n)&&e({channel:o,color:i,args:r,timestamp:a})});Ue.onLogIntent=Ab;Ue.isChannelEnabled=Uc;Ue.destroyAll=()=>{Tl(),Tl(Ue.colors),yr.clear(),Tr.clear()};var _t=n=>{let e=Ue(n?`IT:${n}:TYPE=debug`:"IT:TYPE=debug");return e.logFn=console.log.bind(console),e},Co=n=>{let e=Ue(n?`IT:${n}:TYPE=error`:"IT:TYPE=error");return e.logFn=console.error.bind(console),e},Cr=()=>Cr;Cr.extend=()=>Cr;var bt=class{constructor(e){this.debug=Cr,this.error=Cr}};var Eb=K(require("react")),wo=require("react");var wr=(n,e,t={debounce:0})=>{let o=t.debounce??0,r=window.ResizeObserver,i=o?Et(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()}},mi=(n,e,t={earlyAttach:!1,debounce:0})=>{let o=(0,wo.useRef)({width:0,height:0}),r=i=>{let a;return n.current&&(a=wr(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,wo.useEffect)(()=>t.earlyAttach?()=>{}:r(e),[n.current,e,t.earlyAttach,t.debounce]),(0,wo.useLayoutEffect)(()=>t.earlyAttach?r(e):()=>{},[n.current,e,t.earlyAttach])};var _b=Co("CSSVariableWatch"),Ob=_t("CSSVariableWatch"),Fb={position:"absolute",pointerEvents:"none",width:0,height:0,lineHeight:0,fontSize:0,overflow:"hidden"},Nb=n=>{let e=(0,Dl.useRef)(0),t=Xo.useCallback(({height:o})=>{o!=null&&o!==e.current&&(e.current=o,n.onChange(o))},[n.onChange]);mi(n.ref,t,{earlyAttach:!0}),Xo.useLayoutEffect(()=>{let o=n.ref.current.getBoundingClientRect().height;if(o!=null)return e.current=o,Ob(`Variable ${n.varName} found and equals ${o}.`),n.onChange(o);_b(`Specified variable ${n.varName} not found or does not have a numeric value.`)},[])},Ir=n=>{let e=(0,Dl.useRef)(null);Nb({...n,ref:e});let t=n.varName.startsWith("var(")?n.varName:`var(${n.varName})`,{allowInts:o=!1}=n;return Xo.createElement("div",{"data-name":"css-variable-watcher","data-var":n.varName,style:Fb},Xo.createElement("div",{ref:e,style:{height:o?`calc(1px * ${t})`:t}}))};var Pn=require("react");var ao=require("react");function yt(n,e,t){if(n===e)return!0;if(!n||!e)return!1;var o=Object.keys(n),r=Object.keys(e);t&&(o=o.filter(s=>!t.has(s)),r=r.filter(s=>!t.has(s)));var i=o.length;if(r.length!==i)return!1;for(var a=0;a<i;a++){var l=o[a];if(!(t&&t.has(l))&&(n[l]!==e[l]||!Object.prototype.hasOwnProperty.call(e,l)))return!1}return!0}function Io(){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()}}}function Zc(n,e,t){let o=(0,ao.useRef)(e);o.current=e;let r=(0,ao.useRef)(t);r.current=t;let i=(0,ao.useRef)(void 0),a=(0,ao.useRef)(!1),l=(0,ao.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,ao.useSyncExternalStore)(n.subscribe,l,l)}function gi(n,e){return Zc(n,e,Object.is)}function vn(n,e){return Zc(n,e,yt)}var Qc=K(require("react")),Pl;function Dn(){return Pl||(Pl=Qc.createContext(null))}var Jc=Io(),eu=()=>{};function hi(){let n=Dn();return(0,Pn.useContext)(n)||void 0}function bi(){let n=hi();return(0,Pn.useCallback)(()=>n?.getSnapshot(),[n])}function lo(n){let e=Dn(),t=(0,Pn.useContext)(e),o=vn(t||Jc,t?n:eu);return t?o??void 0:void 0}function Ro(){let n=Dn(),e=(0,Pn.useContext)(n),o=gi(e||Jc,e?r=>r.masterRowInfo:eu);return e?o:void 0}var xn=K(require("react")),Ze=require("react");function xl(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 Ml=n=>n&&n.substr(0,1).toUpperCase()+n.substr(1);function vo(n){if(n==null)return!1;let e=n;return!0}function Rr(n){return n!==void 0}function Do(n,e){let t=e[n];return Rr(t)}var Po=require("react");var yi=require("react"),Ut=()=>{let[n,e]=(0,yi.useState)(0);return[n,(0,yi.useCallback)(()=>{e(t=>t+1)},[e])]};var tu=n=>{let e=(0,Po.useCallback)(n,[]),t=(0,Po.useRef)(!1),o=(0,Po.useRef)(!1),r=(0,Po.useRef)(void 0),[i,a]=Ut();t.current&&(o.current=!0),(0,Po.useEffect)(()=>(t.current||(r.current=e,t.current=!0),a(),()=>{o.current&&r.current&&r.current()}),[])};var Si=require("react");function Oe(n){let e=(0,Si.useRef)(n);return e.current=n,(0,Si.useCallback)(()=>e.current,[])}var Ti=require("react"),xo=(n,e)=>{let t=(0,Ti.useRef)(e===void 0?n:e);return(0,Ti.useLayoutEffect)(()=>{t.current=n}),t.current};var vr={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 Al=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";return performance.measure(s,{start:t,end:o,detail:{devtools:{dataType:"track-entry",trackGroup:i,track:c,color:r,properties:a.length>0?a.map(u=>[u.name,u.value]):void 0,tooltipText:l}}}),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(vr).reduce((t,o)=>{let r={start:e.start,end:i=>e.end({...i,track:vr[o].track,label:i.label}),get label(){let i=vr[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=vr[o];return e.markerDetails.track=i.track,r}}),t},{})}};function ot(n){return Al.create(n)}var Lb=(n,e,t)=>{let o=n[e];typeof o=="function"&&o(...t)},El;function ou(){return El||(El=(0,Ze.createContext)(null))}function kb(n,e,t,o,r,i,a){let l=e();return Object.keys(l).reduce((s,c)=>{let u=c;return Object.defineProperty(s,c,{set:f=>{let p=t(),m=e(),g=m[u],b=!0;if(i&&typeof i[u]=="function"&&i[u](f,{actions:s,state:m})===!1&&(b=!1),b){let S=[f],T=`on${Ml(c)}Change`;if(a&&a[u]){let C=a[u](f,m);T=C.callbackName||T,S=C.callbackParams}Lb(p,T,S)}let h=o[u];typeof h=="function"&&(f=h(f));let y=!!r?.[u];Do(c,p)&&!y||n({payload:{updatedProps:null,mappedState:{[c]:f}}})}}),s},{})}function zb(n,e,t){let o={};for(let r in n)if(n.hasOwnProperty(r)){let i=n[r],a=Do(r,e)?e[r]:e[`default${Ml(r)}`];typeof i=="function"&&(a=i(a,t)),o[r]=a}return o}function Ot(n){let e=n.getParentState||(()=>null);function t(r){let[i]=(0,Ze.useState)(()=>n.initSetupState?n.initSetupState(r):{}),a=(0,Ze.useRef)(new Set),l=(0,Ze.useMemo)(()=>n.forwardProps?n.forwardProps(i,r):{},[i]),s=e(),c=Oe(s);function u(){let v={};l&&(v=zb(l,r,i));let D={...i,...v};if(n.mapPropsToState){let{fn:R,propertyReads:x}=xl(n.mapPropsToState,{getProxyTargetFromArgs:M=>M.props,putProxyToArgs:(M,P)=>[{...P,props:M}]}),A=R({props:r,state:D,oldState:null,parentState:s});return a.current=new Set([...a.current,...x]),{...D,...A}}return D}let[d]=(0,Ze.useState)(u),f=Oe(r),p=(v,D)=>{if(D.type==="REPLACE_STATE")return D.payload;let R=c?.()??null,x=D.payload.mappedState,A=D.payload.updatedPropsToState,M={...v};if(x&&Object.assign(M,x),n.mapPropsToState){let{fn:_,propertyReads:E}=xl(n.mapPropsToState,{getProxyTargetFromArgs:k=>k.props,putProxyToArgs:(k,V)=>[{...V,props:k}]}),L=_({props:f(),state:M,oldState:v,parentState:R});a.current=new Set([...a.current,...E]),Object.assign(M,L)}return D.type==="ASSIGN_STATE"&&Object.assign(M,D.payload),n.concludeReducer?n.concludeReducer({previousState:v,state:M,updatedProps:A,parentState:R}):M},[m,g]=(0,Ze.useReducer)(p,d),b=Oe(m),{allowedControlledPropOverrides:h}=n,y=(0,Ze.useMemo)(()=>kb(g,b,f,l,h,n.interceptActions,n.mappedCallbacks),[g,l,h]),S=n.Context??ou(),T=(0,Ze.useMemo)(()=>({componentState:m,componentActions:y,getComponentState:b,replaceState:v=>{g({type:"REPLACE_STATE",payload:v})},assignState:v=>{g({type:"ASSIGN_STATE",payload:v})}}),[m,y,b]),C=xo(r),w=(0,Ze.useRef)(!1);w.current=!1;let I=n.layoutEffect?Ze.useLayoutEffect:Ze.useEffect;return I(()=>{let v=r,D={},R=0,x={},A=0,M={},P=0;if(new Set([...Object.keys(v),...Object.keys(C)]).forEach(L=>{let k=L,V=C[k],j=v[k];if(k!=="children"&&V!==j&&(M[k]={newValue:j,oldValue:V},P++,Do(k,r)||Do(k,C)))if(l.hasOwnProperty(L)){let O=j,F=l[L];typeof F=="function"&&(O=F(j)),m[k]!==O&&(D[k]=O,R++)}else a.current.has(L)&&(x[k]=v[k],A++)}),A>0||R>0){let L=m.debugId,k=L?ot(L).track.ComponentState.label.PropUpdate.start():void 0,V=n.debugName?typeof n.debugName=="function"?`${n.debugName(v)}:rerender`:`${n.debugName}:rerender`:"rerender";_t(V)("Triggered by new values for the following props",...Object.keys(D??{}),...Object.keys(x??{})),k&&k.end({label:V,details:[R>0?{name:"Updated properties",value:Object.keys(D).join(", ")}:void 0,A>0?{name:"Updated props",value:Object.keys(x).join(", ")}:void 0,A>0||x?{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(vo)});let O={payload:{mappedState:R?D:null,updatedPropsToState:A?x:null}};if(w.current=!0,g(O),n.onPropChange){for(var E in M)if(M.hasOwnProperty(E)){let{newValue:F,oldValue:te}=M[E];n.onPropChange({name:E,newValue:F,oldValue:te},r,y,m)}}n.onPropsChange&&P&&n.onPropsChange(M,r,y,m)}}),I(()=>{s!=null&&!w.current&&g({type:"PARENT_STATE_CHANGE",payload:{}})},[s]),tu(()=>()=>{n.cleanup?.(b())}),{contextValue:T,ContextComponent:S}}return{ManagedComponentContextProvider:xn.memo(function(i){let{contextValue:a,ContextComponent:l}=t(i);return xn.createElement(l.Provider,{value:a},i.children)}),useManagedComponent:t}}function Ft(n){return n=n??ou(),xn.useContext(n)}var gu=K(require("react"));var mt="Infinite",ke={rootClassName:mt};var Ci=()=>ke;var nu="_16lm1iw2 _16lm1iw23 _16lm1iw26 _16lm1iw2c _16lm1iw2a",ru={center:"_16lm1iw2j",stretch:"_16lm1iw2k",start:"_16lm1iw2l",end:"_16lm1iw2m"};var Yt="_16lm1iw3b _16lm1iw3c _16lm1iw35",iu={pointer:"_16lm1iwk",default:"_16lm1iwl",colResize:"_16lm1iwm",grabbing:"_16lm1iwn",grab:"_16lm1iwo"},Mn={flex:"_16lm1iw1p",contents:"_16lm1iw1q",none:"_16lm1iw1r",block:"_16lm1iw1s",grid:"_16lm1iw1t",inlineBlock:"_16lm1iw1u",inlineFlex:"_16lm1iw1v",inlineGrid:"_16lm1iw1w"};var wi={1:"_16lm1iw1c",none:"_16lm1iw1d"},Dr={column:"_16lm1iw2f",columnReverse:"_16lm1iw2g",row:"_16lm1iw2h",rowReverse:"_16lm1iw2i"};var au={0:"_16lm1iw1y","100%":"_16lm1iw1z","50%":"_16lm1iw20"},lu={center:"_16lm1iw30",spaceBetween:"_16lm1iw31",spaceAround:"_16lm1iw32",start:"_16lm1iw33",end:"_16lm1iw34"},su={0:"_16lm1iw26","100%":"_16lm1iw27","50%":"_16lm1iw28",auto:"_16lm1iw29"};var cu={none:"_16lm1iwd"},uu={hidden:"_16lm1iw35",auto:"_16lm1iw36",visible:"_16lm1iw37"};var Ii={relative:"_16lm1iw1",absolute:"_16lm1iw2",static:"_16lm1iw3",sticky:"_16lm1iw4",fixed:"_16lm1iw5"};var du={0:"_16lm1iw23","100%":"_16lm1iw24","50%":"_16lm1iw25"};var fu={none:"_16lm1iw1x"};var pu={visible:"_16lm1iw38",hidden:"_16lm1iw39"};var mu={1:"_16lm1iw1e",10:"_16lm1iw1f",100:"_16lm1iw1g",1e3:"_16lm1iw1h",1e4:"_16lm1iw1i",1e5:"_16lm1iw1j",1e6:"_16lm1iw1k",1e7:"_16lm1iw1l","1k":"_16lm1iw1m","10k":"_16lm1iw1n","100k":"_16lm1iw1o"};function hu(n){let{rootClassName:e}=Ci();return gu.createElement("div",{...n,className:J(`${e}Footer`,Ii.relative,Mn.flex,Dr.row,n.className)})}var De=K(require("react")),po=require("react"),Ip=require("react-dom");function Ri(n){let e={};return Object.keys(n).forEach(t=>{e[t]=t}),e}function Q(n){return n.slice(4,-1)}var bu=K(require("react")),ze=n=>{let e=n.size??"var(--infinite-icon-size)",t={flex:"none",width:e,height:e,fill:"currentColor",...n.style};return bu.createElement("svg",{viewBox:"0 0 24 24",...n,style:t},n.children)};var Pr=K(require("react")),yu=n=>Pr.createElement(ze,{...n},Pr.createElement("path",{d:"M11.14 4L6.43 16H8.36L9.32 13.43H14.67L15.64 16H17.57L12.86 4H11.14M12 6.29L14.03 11.71H9.96L12 6.29"}),Pr.createElement("path",{d:"M4 18V15H2V20H22V18Z"}),Pr.createElement("path",{d:"M20 14V18H2V20H22V14Z"}));var _l=K(require("react")),Su=n=>_l.createElement(ze,{...n},_l.createElement("path",{d:"M11.14 4L6.43 16H8.36L9.32 13.43H14.67L15.64 16H17.57L12.86 4M12 6.29L14.03 11.71H9.96M20 14V18H2V20H22V14Z"}));var Ol=K(require("react")),Fl=n=>Ol.createElement(ze,{...n},Ol.createElement("path",{d:"M19,10H5V8H19V10M19,16H5V14H19V16Z"}));var Nl=K(require("react")),Tu=n=>Nl.createElement(ze,{...n},Nl.createElement("path",{d:"M6.5,2.27L20,10.14L6.5,18L5.5,16.27L16.03,10.14L5.5,4L6.5,2.27M20,20V22H5V20H20Z"}));var Ll=K(require("react")),Cu=n=>Ll.createElement(ze,{...n},Ll.createElement("path",{d:"M5.5,4.14L4.5,5.86L15,12L4.5,18.14L5.5,19.86L19,12L5.5,4.14Z"}));var kl=K(require("react")),wu=n=>kl.createElement(ze,{...n},kl.createElement("path",{d:"M18.5,2.27L5,10.14L18.5,18L19.5,16.27L8.97,10.14L19.5,4L18.5,2.27M5,20V22H20V20H5Z"}));var zl=K(require("react")),Iu=n=>zl.createElement(ze,{...n},zl.createElement("path",{d:"M18.5,4.14L19.5,5.86L8.97,12L19.5,18.14L18.5,19.86L5,12L18.5,4.14Z"}));var Vl=K(require("react")),Ru=n=>Vl.createElement(ze,{...n},Vl.createElement("path",{d:"M21,10H9V8H21V10M21,16H9V14H21V16M4,5H6V16H4V5M6,18V20H4V18H6Z"}));var Gl=K(require("react")),vu=n=>Gl.createElement(ze,{...n},Gl.createElement("path",{d:"M11.14 4L6.43 16H8.36L9.32 13.43H14.67L15.64 16H17.57L12.86 4M12 6.29L14.03 11.71H9.96M4 18V15H2V20H22V18Z"}));var Xl=K(require("react"));var at=K(require("react")),xr=require("react");var An=K(require("react")),Zo=require("react");function Vb(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 Gb(n){var e=Vb(n,"string");return typeof e=="symbol"?e:String(e)}function Hb(n,e,t){return e=Gb(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Du(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 Pu(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Du(Object(t),!0).forEach(function(o){Hb(n,o,t[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Du(Object(t)).forEach(function(o){Object.defineProperty(n,o,Object.getOwnPropertyDescriptor(t,o))})}return n}function xu(n,e){var t={};for(var o in n)t[o]=e(n[o],o);return t}var Kb=(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=Pu(Pu({},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)Kb(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 xu(n.variantClassNames,t=>xu(t,o=>o.split(" ")[0]))}},e};var Mu="_1eexc2a6";var Au=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:[]}),Eu="_12zfob1q _16lm1iw2 _16lm1iw1k _16lm1iw3b _16lm1iw3c _16lm1iw35",_u=he({defaultClassName:"_16lm1iw2 _16lm1iw25 _16lm1iw26 _16lm1iwh _16lm1iwf",variantClassNames:{visible:{true:"_12zfob19",false:"_12zfob1a"}},defaultVariants:{},compoundVariants:[]}),Ou=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"]]}),Fu=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"]]}),Nu="_12zfob12u _16lm1iw22 _16lm1iw1z";var Lu="_12zfob17",ku="_12zfob12q _16lm1iw1p _16lm1iw2h _16lm1iw2j _16lm1iw1",zu=he({defaultClassName:"_12zfob12r _16lm1iw1 _16lm1iw23",variantClassNames:{disabled:{true:"_12zfob12s",false:"_12zfob12t"}},defaultVariants:{},compoundVariants:[]}),Hl=he({defaultClassName:"_12zfob12n _16lm1iw1p _16lm1iw2h _16lm1iw2k _16lm1iw1",variantClassNames:{active:{true:"_12zfob12o",false:"_12zfob12p"}},defaultVariants:{},compoundVariants:[]}),Vu="_12zfob12m _16lm1iw1p _16lm1iw2h _16lm1iw2j",Gu=he({defaultClassName:"_12zfob127 _16lm1iw1 _16lm1iw1p _16lm1iw2f _16lm1iw32 _16lm1iw39",variantClassNames:{menuVisible:{true:"_12zfob128"},reserveSpaceWhenHidden:{true:"_12zfob129",false:"_12zfob12a"}},defaultVariants:{},compoundVariants:[[{menuVisible:!0,reserveSpaceWhenHidden:!1},"_12zfob12b"]]}),Hu="_12zfob1b _16lm1iw2",Ku="_16lm1iw1",Bu="_12zfob16",Wu=he({defaultClassName:"_12zfob12",variantClassNames:{align:{start:"_12zfob13",center:"_12zfob14",end:"_12zfob15"}},defaultVariants:{},compoundVariants:[]}),ju="_12zfob12l _16lm1iw35 _16lm1iw1 _16lm1iw1p _16lm1iw2h";var Rt="InfiniteIcon";var $u="_6aunoi0 _16lm1iw1p _16lm1iw2f _16lm1iw1 _16lm1iw32 _16lm1iw2j";var Bb={transition:"width 0.25s, opacity 0.25s"};function En(n){let[e,t]=(0,Zo.useState)(!0),[o,r]=(0,Zo.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),f=[u-1*d,u-2*d,u-3*d],p={...Bb,borderTop:`${i}px solid currentColor`,...n.lineStyle,opacity:o};if((0,Zo.useEffect)(()=>{if(!e)return;let g=requestAnimationFrame(()=>{r(1)});return()=>{cancelAnimationFrame(g)}},[e]),(0,Zo.useLayoutEffect)(()=>{t(!0)},[]),!e)return null;let m={};return An.createElement("div",{"data-name":"filter-icon",style:{...a,width:u},className:J(l,Rt,$u,`${Rt}-filter`)},c?An.createElement("div",{"data-name":"index",style:m,className:Lu},s):null,An.createElement("div",{style:{width:f[0],...p}}),An.createElement("div",{style:{width:f[1],...p}}),An.createElement("div",{style:{width:f[2],...p}}))}var Kl=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((I,v)=>{let D=I.maxSize??r??void 0,R=I.minSize??o??void 0;s.push(R),c.push(D),I.size!=null&&(D!=null&&I.size>D&&(I.size=D),R!=null&&I.size<R&&(I.size=R));let x=I.flex==0?null:I.flex;if(I.size==null&&x==null)throw`Items must specify either a size or a flex property. Item at index ${v} doesn't have either of those.`;x!=null&&(l+=1),a+=x??0,i+=I.size??0});let u=n.computeSpecialSpaceDistribution?Math.max(e,0):Math.max(e-i,0),d=u/a,f={},p={},m=0;t.forEach((I,v)=>{if(I.flex!=null){let D=d*I.flex,R=I.maxSize??r??void 0,x=I.minSize??o??void 0,A=!1,M=0;R!=null&&D>R&&(f[v]=!0,A=!0,M=R),x!=null&&D<x&&(p[v]=!0,A=!0,M=x),A&&(m+=1,l-=1,a-=I.flex,u-=M)}}),m&&(d=u/a);let g=[],b=0,h=u,y=a,S=0,T=0,C=[];return{items:t.map((I,v)=>{let D={...I},R=I.maxSize??r??void 0,x=I.minSize??o??void 0,A=0,M=f[v],P=p[v],_=M||P,E=I.size??0;if(I.flex!=null){if(_)P&&(A=x),M&&(A=R);else{b+=1;let L=k=>(R!=null&&k>R&&(k=R),x!=null&&k<x&&(k=x),k);b===l?A=L(h):(A=L(Math.round(I.flex*d)),T+=A,h=u-T,y-=I.flex,d=h/y)}E=A,D.flexSize=A}return g.push(A),C.push(E),D.computedSize=E,S+=E,D}),flexSizes:g,minSizes:s,maxSizes:c,computedSizes:C,remainingSize:Math.round(e-S)}};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}}var Bl=n=>{let{availableSize:e,reservedWidth:t=0}=n,o=Object.keys(n.columnSizing).reduce((R,x)=>(R[x]={...n.columnSizing[x]},R),{});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=l.computedWidth,f=l.computedMinWidth,p=l.computedMaxWidth,m=l.computedFlex?"flex":"width",g=s?.computedWidth,b=s?.computedMinWidth,h=s?.computedMaxWidth,y=s?.computedFlex?"flex":"width",S=!1,T=!1,C=r>0?1:-1,{value:w,clamped:I,diff:v}=vi(d+r,f,p,C);if(n.shareSpaceOnResize){if(s==null)return o[c]={...o[c],[m]:w},T=I==="min",S=I==="max",{adjustedDiff:w-d,reservedWidth:t,columnSizing:o,minReached:T,maxReached:S,constrained:T||S};let{value:R,clamped:x,diff:A}=vi(g-r,b,h,C);if(I&&x&&(Math.abs(v)>Math.abs(A)?x=!1:I=!1),!(!I&&!x)){if(I){let M=vi(g-r-v,b,h,C);R=M.value,x=M.clamped,A=M.diff}else if(x){let M=vi(d+r+A,f,p,C);w=M.value,I=M.clamped,v=M.diff}}o[c]={...o[c],[m]:w},o[u]={...o[u],[y]:R},T=I==="min"||x==="min",S=I==="max"||x==="max"}else o[c]={...o[c],[m]:w},T=I==="min",S=I==="max";let D=w-d;return{adjustedDiff:D,reservedWidth:n.shareSpaceOnResize?t:t-D,columnSizing:o,minReached:T,maxReached:S,constrained:T||S}};function Uu(n,e){return n+e}function Wb(n){return Object.keys(n).reduce((t,o)=>(t[o]={...n[o]},t),{})}var Yu=n=>{let{availableSize:e,reservedWidth:t=0}=n,o=Object.keys(n.columnSizing).reduce((h,y)=>(h[y]={...n.columnSizing[y]},h),{});if(e<0)throw"The provided availableSize cannot be negative!";let r=n.dragHandleOffset,i=[...new Array(n.columnGroupSize)].map((h,y)=>n.dragHandlePositionAfter-y).reverse(),a=i.map(h=>n.items[h]),l=a.map(h=>h.computedWidth),s=a.map(h=>h.computedFlex?"flex":"width"),c=0,{computedSizes:u}=Kl({items:a.map(h=>(h.resizable===!1&&(c+=h.computedWidth),{maxSize:h.computedMaxWidth,minSize:h.computedMinWidth,flex:h.resizable?h.computedWidth:null,size:0})),computeSpecialSpaceDistribution:!0,availableSize:Math.max(l.reduce(Uu,0)+r-c,0)}),d=a.map((h,y)=>u[y]-h.computedWidth),f=!0,p=!0,m=!0,g=[];d.forEach((h,y)=>{let S=a[y];if(!S.resizable){g.push(0);return}let T=s[y],C=l[y],w=Wb(o),{maxReached:I,minReached:v,constrained:D,adjustedDiff:R}=Bl({availableSize:n.availableSize,reservedWidth:n.reservedWidth,dragHandleOffset:h,dragHandlePositionAfter:i[y],shareSpaceOnResize:!1,items:n.items,columnSizing:w});o[S.id]={...w[S.id],[T]:C+R},g.push(R),I||(p=!1),v||(f=!1),D||(m=!1)});let b=g.reduce(Uu,0);return{minReached:f,maxReached:p,constrained:m,adjustedDiffs:g,adjustedDiff:b,columnSizing:o,reservedWidth:t-b}};var Di;function Mo(){if(Di!=null)return Di;let n=Ae().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),Di=e.offsetWidth-t.offsetWidth,e.parentNode?.removeChild(e),Di}var qu=["start",void 0,"end"],Xu=(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:qu.indexOf(r)-qu.indexOf(i)}),n);function Zu(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 Wl(n,...e){return Zu(t=>t!=null,n,...e)}function Qu(n,e,...t){return Zu((o,r)=>!(r in n),e,...t)}var Pi=Object.freeze({}),jb={string:Pi,number:{}};function jl(n,e){let t=e.default||Pi;return n.type===void 0?t:n.type===null?Pi:typeof n.type=="string"?e[n.type]||jb[n.type]||Pi:n.type.reduce((o,r)=>Object.assign(o,e[r]),{})}var xi=!0,$b=!0,Ub=!0,Yb="string",_n="unknown",qb=Co("getComputedVisibleColumns"),Xb=(n,e,t)=>n[t]!==!1,$l=(n,e)=>{if(!e)return!1;let t=e[n];return t==="start"||t===!0?"start":t==="end"?"end":!1},Ju=({columns:n,bodySize:e,columnMinWidth:t,columnMaxWidth:o,columnDefaultWidth:r,columnDefaultFlex:i,scrollbarWidth:a,columnCssEllipsis:l,columnHeaderCssEllipsis:s,pinnedStartMaxWidth:c,pinnedEndMaxWidth:u,filterValue:d,sortable:f,sortInfo:p,multiSort:m,filterTypes:g=Ao,viewportReservedWidth:b,resizableColumns:h,draggableColumns:y,columnDefaultDraggable:S,columnOrder:T,columnPinning:C,editable:w,columnDefaultEditable:I,columnDefaultFilterable:v,columnDefaultGroupable:D,columnDefaultSortable:R,columnSizing:x,columnTypes:A,columnVisibility:M,columnVisibilityAssumeVisible:P,groupBy:_})=>{let E=0,L={};_.forEach((B,ie)=>{B.field&&(L[B.field]=ie)});let k=(d||[]).reduce((B,ie)=>{let{id:se,field:be}=ie;return be&&(B[be]=ie),se&&(B[se]=ie),B},{}),V=Xu(T===!0?Object.keys(n):T,C),j=V.filter(B=>n[B]?Xb(M,P,B):(qb(`Column with id "${B}" specified in columnOrder array cannot be found in the columns map.`),!1)),O=new Map,F=j.map((B,ie)=>{let se=n[B];return O.set(B,ie),se}),te=(p??[]).reduce((B,ie,se)=>(ie.id?B[ie.id]={sortInfo:ie,index:se}:ie.field&&(B[ie.field]={sortInfo:ie,index:se}),B),{});function $(B){let ie=n[B],se=jl(ie,A),be={minWidth:se?.minWidth,maxWidth:se?.maxWidth,width:se?.defaultWidth,flex:se?.defaultFlex},Ye=Wl({width:ie?.defaultWidth,flex:ie?.defaultFlex,minWidth:ie?.minWidth,maxWidth:ie?.maxWidth},x[B]);Ye.width!=null&&delete be.flex,Ye.flex!=null&&delete be.width,Ye=Wl(be,Ye);let ne=Ye.flex??void 0,H=Ye.minWidth??ie?.minWidth??t,rt=Ye.maxWidth??ie?.maxWidth??o,we=ne!=null?void 0:Ye.width??(i?void 0:r);return!we&&ne==null&&(i?ne=i:we=H),{size:we,flex:ne,minSize:H,maxSize:rt}}let Y=Kl({availableSize:Math.max(e.width-(b??0)-(a??Mo()),0),maxSize:o,minSize:t,items:j.map($)}),{computedSizes:ae,flexSizes:ye,minSizes:Ce,maxSizes:ue}=Y,pe=[],ge=[],U=[],G=[];G.length=j.length;let X=new Map,W=new Map,le=0,re=0,z=0,fe=null,N=[],Z=0,ce=0,de=0;F.forEach((B,ie)=>{let se=j[ie],be=ae[ie],Ye=N[ie]=$l(se,C);Ye==="start"?Z+=be:Ye==="end"?de+=be:ce+=be});let Pe=e.width-de,xe=[],Ge=new Map;j.forEach((B,ie)=>{let se=F[ie];Ge.set(B,se)});let Ne=[];Object.keys(n).forEach(B=>{let ie=n[B];Ne.push(B),Ge.has(B)||Ge.set(B,ie)});let Le=new Map;Ge.forEach((B,ie)=>{let se=O.get(ie);se==null&&(se=-1);let be=se!=-1,Ye=j[se+1],ne=jl(B,A),H=se,rt=te[ie]?te[ie]:B.field?te[B.field]??null:null,we=rt?.sortInfo??null,it=!!we,It=it&&we.dir===1,kt=it&&!It,gr=rt?.index??-1,Rn=be?{}:$(ie),hr=be?ae[se]:Rn.size||0,fl=be&&ye[se]||null,pl=be?Ce[se]||0:Rn.minSize||0,ml=be?ue[se]||1e4:Rn.maxSize||1e4,dt=be?$l(ie,C):!1,si=be?se===j.length-1:!1,Me=H,ft=be?dt==="start"?re:dt==="end"?z:E-re:0;dt=="start"?Me=be?H:-1:dt==="end"?Me=be?H-(pe.length+U.length):-1:Me=be?H-pe.length:-1;let io=be?dt==="start"||dt===!1?E:Pe+z:-1,zt=be?dt!==fe:!1,br=be?si||dt!==$l(Ye,C):!1,Lc=B.cssEllipsis??ne.cssEllipsis??l,ub=B.headerCssEllipsis??ne.cssEllipsis??B.cssEllipsis??ne.headerCssEllipsis??s??Lc,ci=be&&(k[ie]||B.field||B.groupByForColumn)&&(k[ie]||k[B.field||B.groupByForColumn])||null,db=B.defaultFilterable??ne.defaultFilterable??v??!0,fb=w??B.defaultEditable??ne.defaultEditable??I??!1,gl=B.dataType||ne.dataType||(Array.isArray(B.type)?B.type[0]:B.type)||Yb,pb=B.sortType||ne.sortType||gl,kc=B.filterType||ne.filterType||gl,zc=!1;if(ci!=null&&!ci.disabled){let yl=g[kc];yl&&(!yl.emptyValues||!yl.emptyValues.includes(ci.filter.value))&&(zc=!0)}let qo=B.field??ne.field,Vc=B.valueGetter??ne.valueGetter,hl=B.defaultGroupable??ne.defaultGroupable??D??!!qo;qo||(hl=!1),B.groupByForColumn&&(hl=!1);let bl=B.defaultSortable??ne.defaultSortable;bl==null&&!B.groupByForColumn&&qo==null&&Vc==null&&(bl=!1);let Gc=qo?L[qo]!==void 0:!1,mb=Gc?L[qo]:void 0,gb=f??bl??R??xi,hb=B.resizable??ne.resizable??h??$b,qe={colType:ne,align:ne.align,headerAlign:ne.headerAlign,computedVisible:be,verticalAlign:ne.verticalAlign,defaultHiddenWhenGroupedBy:ne.defaultHiddenWhenGroupedBy,valueGetter:Vc,valueFormatter:ne.valueFormatter,renderValue:ne.renderValue,render:ne.render,style:ne.style,className:ne.className,contentFocusable:ne.contentFocusable,renderMenuIcon:ne.renderMenuIcon,renderSortIcon:ne.renderSortIcon,renderRowDetailIcon:ne.renderRowDetailIcon,renderSelectionCheckBox:ne.renderSelectionCheckBox,renderHeaderSelectionCheckBox:ne.renderHeaderSelectionCheckBox,headerStyle:ne.headerStyle,headerClassName:ne.headerClassName,columnGroup:ne.columnGroup,getValueToEdit:ne.getValueToEdit,getValueToPersist:ne.getValueToPersist,shouldAcceptEdit:ne.shouldAcceptEdit,field:qo,...B,components:{...ne.components,...B.components},computedResizable:hb,computedMinWidth:pl,computedMaxWidth:ml,computedFlex:fl,computedDataType:gl,computedEditable:fb,computedSortType:pb,computedFilterType:kc,cssEllipsis:Lc,headerCssEllipsis:ub,computedFilterValue:ci,computedFiltered:zc,computedFilterable:db,computedGroupable:hl,computedGroupedBy:Gc,computedGroupedByIndex:mb,computedWidth:hr,computedAbsoluteOffset:io,computedPinningOffset:ft,computedVisibleIndexInCategory:Me,computedOffset:E,computedSortable:gb,computedSortInfo:we,computedSortIndex:gr,computedMultiSort:m,computedSorted:it,computedSortedAsc:It,computedSortedDesc:kt,computedVisibleIndex:H,computedPinned:dt,computedDraggable:y??B.defaultDraggable??S??Ub,computedFirstInCategory:zt,computedLastInCategory:br,computedFirst:se===0,computedLast:si,id:ie,header:B.header??ne.header??B.name??B.field};be&&(E+=hr,X.set(qe.id,qe),G[se]=qe,dt==="start"&&(pe.push(qe),re+=qe.computedWidth),dt==="end"&&(ge.push(qe),z+=qe.computedWidth),dt||(U.push(qe),le+=qe.computedWidth),fe=dt),qe.groupByForColumn&&(qe.computedSortType=B.sortType||ne.sortType||_n,xe.push(qe)),W.set(qe.id,qe),qe.field&&!qe.groupByForColumn&&!Le.has(qe.field)&&Le.set(qe.field,qe)}),xe.forEach(B=>{B.computedSortable=ed(B,{fieldsToColumn:Le,sortable:f,columnDefaultSortable:R})});let We=new Map;Ne.forEach(B=>{let ie=W.get(B);ie&&We.set(B,ie)}),W.forEach(B=>{We.has(B.id)||We.set(B.id,B)});let Je=c!=null?Math.min(c,re):re,et=u!=null?Math.min(u,z):z;return{computedRemainingSpace:e.width-(Z+de+ce),computedPinnedStartColumnsWidth:re,computedPinnedEndColumnsWidth:z,computedUnpinnedColumnsWidth:le,computedColumnOrder:V,computedPinnedStartColumns:pe,computedPinnedEndColumns:ge,computedUnpinnedOffset:re,computedPinnedEndOffset:re+le,computedUnpinnedColumns:U,computedVisibleColumns:G,computedColumnsMap:W,computedColumnsMapInInitialOrder:We,computedVisibleColumnsMap:X,computedPinnedEndWidth:et,computedPinnedStartWidth:Je,renderSelectionCheckBox:G.reduce((B,ie)=>B||!!ie.renderSelectionCheckBox,!1),fieldsToColumn:Le}};function ed(n,e){let{sortable:t,fieldsToColumn:o,columnDefaultSortable:r}=e;if(t)return t;let i=n.defaultSortable??n.colType.defaultSortable;if(i!=null)return i;let a=r??xi;return n.computedSortType!==_n&&a?!0:s=>{let{column:c,api:u}=s,d=c.groupByForColumn||[];return d!=null&&!Array.isArray(d)&&(d=[d]),(d||[]).reduce((f,p)=>{if(!f)return!1;let m=p.field||p.groupField,g;if(m){let b=o.get(m),h=b?u.getColumnApi(b.id):void 0;b&&h?g=h.isSortable():g=!1}return g===void 0&&p.valueGetter&&(g=!0),g??r??xi},!0)}}function gt(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)}};return l}function Qo(n,e,t){let o=typeof n=="string"?e.getComputed().computedColumnsMap.get(n):n,{api:r,getComputed:i,getDataSourceState:a,actions:l,dataSourceActions:s,dataSourceApi:c}=e,u=a(),{allRowsSelected:d,someRowsSelected:f,selectionMode:p}=u,m=i(),g=o.header&&typeof o.header!="function"?o.header:o.name||o.id||"";if(typeof o.header=="function"){let b=gt(o.id,{...e,actions:l,dataSourceActions:s,dataSourceApi:c});g=o.header({horizontalLayoutPageIndex:null,column:o,columnApi:b,dataSourceApi:c,renderLocation:t,dragging:!1,columnsMap:m.computedColumnsMap,columnSortInfo:o.computedSortInfo,columnFilterValue:o.computedFilterValue,filtered:o.computedFiltered,allRowsSelected:d,someRowsSelected:f,selectionMode:p,api:r,renderBag:{header:g}})??null}return g}var td=K(require("react"));var Mi=`${mt}HeaderCell__filter`,Ul=`${mt}HeaderCell__filterOperator`,Yl=td.createContext(null);var nd=require("react");var od=require("react"),ql;function Ai(){return ql||(ql=(0,od.createContext)(null))}function oe(n){let e=Ai(),t=(0,nd.useContext)(e);return vn(t,n)}function He(){return oe(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 Zb=`${Mi}__input`,Ei=n=>n.stopPropagation();function rd(n){let{filterOperatorMenuVisibleForColumnId:e}=oe(u=>({filterOperatorMenuVisibleForColumnId:u.state.filterOperatorMenuVisibleForColumnId})),{column:t}=Mr(),o=n.filterEditor,r=n.filterOperatorSwitch,[i,a]=(0,xr.useState)(!1),l=at.useCallback(()=>{a(!0)},[]),s=at.useCallback(()=>{a(!1)},[]),c=e===t.id||i;return at.createElement("div",{onPointerUp:Ei,onPointerDown:Ei,onFocus:l,onBlur:s,className:`${Mi} ${Hl({active:c})}`,style:{height:n.columnHeaderHeight}},at.createElement(Yl.Provider,{value:n},at.createElement(r,null),at.createElement(o,null)))}function id(){let{columnApi:n,disabled:e,operator:t}=On(),o=t?.components?.Icon??En;return at.createElement("div",{"data-name":"filter-operator","data-disabled":e,onMouseDown:r=>{r.stopPropagation(),!e&&n.toggleFilterOperatorMenu(r.target)},className:J(Ul,ku,e?`${Ul}--disabled`:"")},at.createElement(o,{size:20,className:`${zu({disabled:e})}`}))}function ad(){return at.createElement("div",{onPointerUp:Ei,onPointerDown:Ei,className:`${Mi} ${Hl({active:!1})} ${au["50%"]}`})}function On(){let n=He(),{column:e,columnApi:t}=Mr(),o=Qo(e,n,"column-filter"),r=at.useContext(Yl),{columnFilterType:i,filterTypes:a,columnFilterValue:l}=r,s=a[i],[c,u]=(0,xr.useState)(l?.filter.value??""),d=at.useCallback(b=>{u(b),r.onChange(b)},[r.onChange]),f=at.useCallback(()=>{n.api.clearColumnFilter(e.id)},[e.id]),p=at.useCallback(()=>{n.api.removeColumnFilter(e.id)},[e.id]);(0,xr.useEffect)(()=>{if(l)c!==l.filter.value&&u(l.filter.value);else if(s){let b=[...s.emptyValues][0];b!==c&&u(b)}},[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:f,removeColumnFilter:p,ariaLabel:`Filter for ${o}`,className:`${Nu} ${Zb}`}}function Fn(){let{ariaLabel:n,value:e,setValue:t,className:o,disabled:r}=On();return Xl.createElement("input",{"data-xxx":!0,"aria-label":n,type:"text",disabled:r,value:e,onChange:i=>{t(i.target.value)},className:o})}function _i(){let{ariaLabel:n,value:e,setValue:t,className:o,disabled:r}=On();return Xl.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})}function Qb(){return{string:{label:"Text",emptyValues:[""],defaultOperator:"includes",components:{FilterEditor:Fn},operators:[{name:"includes",components:{Icon:yu},label:"Includes",fn:({currentValue:e,filterValue:t})=>typeof e=="string"&&typeof t=="string"&&e.toLowerCase().includes(t.toLowerCase())},{label:"Equals",components:{Icon:Fl},name:"eq",fn:({currentValue:e,filterValue:t})=>typeof e=="string"&&e===t},{name:"startsWith",components:{Icon:vu},label:"Starts With",fn:({currentValue:e,filterValue:t})=>e.startsWith(t)},{name:"endsWith",components:{Icon:Su},label:"Ends With",fn:({currentValue:e,filterValue:t})=>e.endsWith(t)}]},number:{label:"Number",emptyValues:["",null,void 0],defaultOperator:"eq",components:{FilterEditor:_i},operators:[{label:"Equals",components:{Icon:Fl},name:"eq",fn:({currentValue:e,filterValue:t})=>e==t},{label:"Not Equals",components:{Icon:Ru},name:"neq",fn:({currentValue:e,filterValue:t})=>e!=t},{name:"gt",label:"Greater Than",components:{Icon:Cu},fn:({currentValue:e,filterValue:t,emptyValues:o})=>o.includes(e)?!0:e>t},{name:"gte",components:{Icon:Tu},label:"Greater Than or Equal",fn:({currentValue:e,filterValue:t,emptyValues:o})=>o.includes(e)?!0:e>=t},{name:"lt",components:{Icon:Iu},label:"Less Than",fn:({currentValue:e,filterValue:t,emptyValues:o})=>o.includes(e)?!0:e<t},{name:"lte",components:{Icon:wu},label:"Less Than or Equal",fn:({currentValue:e,filterValue:t,emptyValues:o})=>o.includes(e)?!0:e<=t}]}}}var Ao=Qb();function Oi(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&&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 Gn=require("react");function Eo(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 ld(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 sd="true",me={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)",minHeight:"var(--infinite-min-height)",borderRadius:"var(--infinite-border-radius)",focusOutline:"var(--infinite-focus-outline)",background:"var(--infinite-background)",iconSize:"var(--infinite-icon-size)",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)",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)"}}},cd="column-header-height";var ud=`.${ke.rootClassName}`;function Zl(n){return Eo(n,ud)}var dd=Q(q.scrollLeft),Jb=Q(q.scrollTop),ey=Q(q.columnWidthAtIndex),Ql=Q(q.columnOffsetAtIndex),fd=Q(q.columnReorderEffectDurationAtIndex),ty=Q(q.columnOffsetAtIndexWhileReordering),oy=Q(q.columnVisibilityAtIndex),ny=Q(q.columnZIndexAtIndex);function qt(n,e,t){let o=t?Zl(t):document.querySelector(ud);ry(n,e,o)}function ry(n,e,t){if(t){let o=n,r=q[o]?Q(q[o]):n;t.style.setProperty(r,`${e}`)}}function Nn(n,e){if(e)for(var t in n){let o=q[t]?Q(q[t]):t,r=`${n[t]}`;e.style.setProperty(o,r)}}function Jl(n,e,t){qt(`${Ql}-${n.computedVisibleIndex}`,n.computedPinned?`calc( ${n.computedAbsoluteOffset+e}px + var(${dd}))`:`${n.computedAbsoluteOffset+e}px`,t)}function es(n,e,t){qt(`${ny}-${n}`,`${e}`,t)}function Ln(n,e,t){qt(`${ty}-${n}`,typeof e=="number"?`calc( var(${Ql}-${n}) + ${e}px )`:e,t)}function Ar(n,e,t){qt(`${oy}-${n}`,e,t)}function Fi(n,e,t){qt(`${fd}-${n}`,t??"",e)}function ts(n,e){let t=`${fd}-${n}`;qt(t,me.components.Cell.reorderEffectDuration,e)}var Ie={columnWidths:{get(n){return`var(${this.getVarName(n)})`},getVarName(n){return this.varName.get(n)},varName:{get(n){return`${ey}-${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`${Ql}-${n}`}},set(n,e,t){e=typeof e=="number"?e+"px":e,qt(this.varName.get(n),e,t)}}};function pd(n,e){Nn({[dd]:`${n.scrollLeft}px`,[Jb]:`${n.scrollTop}px`},e)}var md="_16lm1iw1",gd="_1yeub2v0 _16lm1iw1 _16lm1iw1p _16lm1iw2f _16lm1iw0",hd="_1yeub2vs",bd="_1yeub2vr",yd=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 os="_1yeub2vp";var sD=he({defaultClassName:"_1yeub2vl",variantClassNames:{pinned:{start:"_1yeub2vm",end:"_1yeub2vn",false:"_1yeub2vo"}},defaultVariants:{},compoundVariants:[]});var ns=n=>{let e=0;return(...t)=>{e&&cancelAnimationFrame(e),e=requestAnimationFrame(()=>{e=0,n(...t)})}};var Er={bodyWidth:{name:Q(me.runtime.bodyWidth),value:""},totalVisibleColumnsWidthValue:{name:Q(me.runtime.totalVisibleColumnsWidthValue),value:""},totalVisibleColumnsWidthVar:{name:Q(me.runtime.totalVisibleColumnsWidthVar),value:""},visibleColumnsCount:{name:Q(me.runtime.visibleColumnsCount),value:""},browserScrollbarWidth:{name:Q(me.runtime.browserScrollbarWidth),value:""}},iy=Q(q.scrollbarWidthHorizontal),Sd=Q(q.scrollbarWidthVertical),ay=Q(q.columnWidthAtIndex),ly=Q(q.columnZIndexAtIndex),Td=Q(q.scrollLeft),sy=Q(q.activeCellColWidth),Cd=Q(q.activeCellColOffset),vd=Q(q.baseZIndexForCells),cy=Q(q.pinnedStartWidth),wd=Q(q.bodyWidth),uy=Q(q.bodyHeight),Id=Q(q.pinnedEndOffset),Rd=Q(q.pinnedEndWidth),dy=Q(q.computedVisibleColumnsCount);function rs(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(${vd}) `+(t<0?"-":"+")+` ${Math.abs(t)} )`:"auto"}function Dd(n){let e=Mo(),{actions:t,getState:o,focused:r,focusedWithin:i,domRef:a,scrollerDOMRef:l,onBlurWithin:s,onFocusWithin:c,onSelfFocus:u,onSelfBlur:d,bodySize:f,activeCellIndex:p,wrapRowsHorizontally:m,computedPinnedStartColumnsWidth:g,computedPinnedEndColumnsWidth:b,computedPinnedStartColumns:h,computedPinnedEndColumns:y,computedVisibleColumns:S,computedUnpinnedColumnsWidth:T,scrollbars:C,focusedClassName:w,focusedWithinClassName:I,computedPinnedStartOverflow:v,computedPinnedEndOverflow:D,focusedStyle:R,focusedWithinStyle:x,brain:A}=oe(O=>{let{state:F,computed:te}=O;return{brain:F.brain,actions:O.actions,getState:O.getState,focused:F.focused,focusedWithin:F.focusedWithin,domRef:F.domRef,scrollerDOMRef:F.scrollerDOMRef,onBlurWithin:F.onBlurWithin,onFocusWithin:F.onFocusWithin,onSelfFocus:F.onSelfFocus,onSelfBlur:F.onSelfBlur,bodySize:F.bodySize,activeCellIndex:F.activeCellIndex,wrapRowsHorizontally:F.wrapRowsHorizontally,computedPinnedStartColumnsWidth:te.computedPinnedStartColumnsWidth,computedPinnedEndColumnsWidth:te.computedPinnedEndColumnsWidth,computedPinnedStartColumns:te.computedPinnedStartColumns,computedPinnedEndColumns:te.computedPinnedEndColumns,computedVisibleColumns:te.computedVisibleColumns,computedUnpinnedColumnsWidth:te.computedUnpinnedColumnsWidth,scrollbars:te.scrollbars,focusedClassName:O.state.focusedClassName,focusedWithinClassName:O.state.focusedWithinClassName,computedPinnedStartOverflow:te.computedPinnedStartOverflow,computedPinnedEndOverflow:te.computedPinnedEndOverflow,focusedStyle:O.state.focusedStyle,focusedWithinStyle:O.state.focusedWithinStyle}}),M=[],P=S.reduce((O,F)=>{let te=F.computedVisibleIndex;O[Ie.columnWidths.varName.get(te)]=F.computedWidth+"px",O[Ie.columnOffsets.varName.get(te)]=F.computedPinned==="start"?`calc( ${F.computedOffset}px + var(${Td}) )`:F.computedPinned==="end"?`calc( var(${Id}) ${M.length?"+":""} ${M.map(Y=>Ie.columnWidths.get(Y.computedVisibleIndex)).join(" + ")} + var(${Td}) )`:`${F.computedOffset}px`;let $=rs(F,{pinnedStartColsCount:h.length,visibleColsCount:S.length});return O[`${ly}-${te}`]=`${$}`,F.computedPinned==="end"&&M.push(F),O},{});if(f.width&&(P[Er.browserScrollbarWidth.name]=`${Mo()}px`),P[Er.bodyWidth.name]=`calc(${q.bodyWidth} - ${q.scrollbarWidthVertical})`,P[Er.totalVisibleColumnsWidthValue.name]=`${g+b+T}px`,P[Er.totalVisibleColumnsWidthVar.name]=`calc(${S.map((O,F)=>`var(${ay}-${F})`).join(" + ")})`,P[Er.visibleColumnsCount.name]=S.length,p!=null){P[sy]=Ie.columnWidths.get(p[1]);let O=Ie.columnOffsets.get(p[1]);if(A.isHorizontalLayoutBrain){let F=A.getPageIndexForRow(p[0]);P[Cd]=F?`calc( ${me.runtime.totalVisibleColumnsWidthVar} * ${F} + ${O})`:O}else P[Cd]=O}P[dy]=S.length,P[iy]=C.horizontal?`${e}px`:"0px",P[Sd]=C.vertical?`${e}px`:"0px",P[cy]="calc( "+h.map(O=>Ie.columnWidths.get(O.computedVisibleIndex)).join(" + ")+")",P[Rd]="calc( "+y.map(O=>Ie.columnWidths.get(O.computedVisibleIndex)).join(" + ")+")",P[vd]=S.length*10,P[Id]=`calc( var(${wd}) - var(${Rd}) - var(${Sd}) )`,P[wd]=`${f.width}px`,P[uy]=`${f.height}px`;let _=ns(O=>{t.focused=O}),E=ns(O=>{t.focusedWithin=O}),V={...n,onFocus:O=>{if(n?.onFocus?.(O),O.target===a.current||O.target===l.current){if(o().focused)return;_(!0),u?.(O),i&&(E(!1),s?.(O));return}i||(E(!0),c?.(O))},onBlur:O=>{if(n?.onBlur?.(O),O.target===a.current||O.target===l.current){if(!o().focused)return;_(!1),d?.(O),i&&(E(!1),s?.(O));return}a.current?.contains(O.relatedTarget)||(E(!1),s?.(O))}},j=J(Xt,gd,m?`${Xt}--horizontal-layout`:null,V?.className,g?`${Xt}--has-pinned-start ${bd}`:null,b?`${Xt}--has-pinned-end ${hd}`:null,r?`${Xt}--focused`:null,i?`${Xt}--focused-within`:null,r&&w?w:null,i&&I?I:null,v?`${Xt}--has-pinned-start-overflow`:null,D?`${Xt}--has-pinned-end-overflow`:null,yd({horizontalLayout:!!m,hasPinnedStart:!!g,hasPinnedEnd:!!b,focused:r,focusedWithin:i}));return V.className=j,V.style={...n?.style,...P},r&&R&&Object.assign(V.style,R),i&&x&&Object.assign(V.style,x),V}var Nd=K(Jo());function Ni(n){return n.map(e=>e instanceof _o?e:new _o(null,[e]))}var _o=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=>fy(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 fy(n,e){return typeof n=="string"||typeof n=="number"?`${n}`:e?n.__get(e):n.done()}var py=(...n)=>new _o("+",Ni(n)),xd=(...n)=>new _o("-",Ni(n)),my=(...n)=>new _o("*",Ni(n)),gy=(...n)=>new _o("/",Ni(n)),_r={add:py,subtract:xd,minus:xd,multiply:my,divide:gy};var en=(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 Ve=Ae().requestAnimationFrame||(n=>setTimeout(n,16)),Vt=Ae().cancelAnimationFrame||(n=>clearTimeout(n));var Md=n=>{let e=null,t=null;return{stop(){e!==null&&Vt(e),t!=null&&Vt(t)},scroll(o){e!==null&&Vt(e),t!=null&&Vt(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),f=0;for(let p=0;p<u;p++)s>(p+1)*d&&(f=r.scrollAmountsPerRaf[p]);return o.scrollLeft=o.scrollLeft-f,e=Ve(()=>{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),f=0;for(let p=0;p<u;p++)s>(p+1)*d&&(f=r.scrollAmountsPerRaf[p]);return o.scrollLeft=o.scrollLeft+f,t=Ve(()=>{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 Ad(n,e){let t=Math.atan2(n.top-e.top,n.left-e.left);return t<=0&&(t=2*Math.PI+t),t}function Ed(n,e){return Math.sqrt((e.top-n.top)**2+(e.left-n.left)**2)}function hy(n,e,t){let o=Ad(n,t),r=Ad(e,t);return o===r?Ed(t,e)-Ed(t,n):o-r}function _d(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)=>hy(o,r,t)),e}function by(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 yy(n,e){if(n.length<2)return n[0]?n[0].left===e.left&&n[0].top===e.top:!1;n=_d(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 Od(n,e){if(by(n))return yy(n,e);n=_d(n);let[t]=n;for(let o=1,r=n.length-1;o<r;o++){let i=n[o],a=n[o+1];if(Sy([t,i,a],e))return!0}return!1}function Sy(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 kn=class{containsPoint(e){return Od(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 zn=class n extends kn{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 Ty(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 ve({top:o,left:t,width:a-t,height:c-o})}var ve=class n extends kn{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=Ty(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 zn(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 Fd=10,Cy=Q(q.pinnedStartWidth);function Ld(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:f,setProxyPosition:p,setDragColumnOutside:m,getCurrentDragSourceAndTarget:g,api:b,horizontalLayoutPageIndex:h,pageWidth:y}=n;function S(G){let X=G==="start"?k:V;return _===L?X:L===G?X+M.computedWidth:_===G?X-M.computedWidth:X}function T(G){if(G.columnIndex===P||h!=null)return!0;let X=e[G.columnIndex];if(X.computedPinned)return!0;let W=l.getScrollPosition().scrollLeft,le=X.computedOffset+(h!=null&&y!=null?y*h:0);return le>=W+S("start")&&le+X.computedWidth<=W+u.width-S("end")}let C=(G,X)=>{let{restrictToParentGroup:W,dragColumn:le}=X,re=[];if(G.forEach(fe=>{if(fe.computedVisibleIndex===P)return;let N={columnId:fe.id,columnIndex:fe.computedVisibleIndex,offsetX:fe.computedOffset+Math.round(fe.computedWidth/2)};T(N)&&re.push(N)}),W){let N=function(ce,de,Pe){let xe=G[ce];xe&&(xe.columnGroup!==le.columnGroup&&Pe.add(xe.id),N(ce+de,de,Pe))};var z=N;let fe=le.computedVisibleIndex,Z=new Set;N(fe-1,-1,Z),N(fe+1,1,Z),re=re.filter(ce=>!Z.has(ce.columnId))}return re},I=r.length,v={clientX:Math.round(n.initialMousePosition.clientX),clientY:Math.round(n.initialMousePosition.clientY)},D={left:v.clientX-u.left-(v.clientX-s.left)+Fd,top:v.clientY-u.top-(v.clientY-s.top)+Fd},R=l.getScrollPosition(),x=e.map(G=>G.computedVisibleIndex),A=x,M=t.get(i),P=M.computedVisibleIndex,_=M?.computedPinned,E=P,L=_,k=l.getFixedStartColsWidth(),V=l.getFixedEndColsWidth(),j=v,O={x:0,y:0},F=1,te=0;function $(G){let X=Math.round(G.clientX),W=Math.round(G.clientY);if(X===j.clientX&&W===j.clientY)return ve.from(s).shift({left:O.x,top:O.y});j={clientX:X,clientY:W};let re=l.getScrollPosition().scrollLeft-R.scrollLeft;return O.x=j.clientX-v.clientX,O.y=j.clientY-v.clientY,te=O.x+re,F=te<0?-1:1,p({left:D.left+O.x,top:D.top+O.y}),ve.from(s).shift({left:O.x,top:O.y})}function Y(G){let X=0;_?_==="start"&&G.forEach((W,le)=>{X||e[W]?.computedPinned!=="start"&&(X=le)}):G.forEach((W,le)=>{e[W]?.computedPinned==="start"&&(X=le+1)}),I=X,ae("start",G,X)}function ae(G,X,W){if(G==="start"){let le=0;for(let re=0;re<W;re++){let z=X[re],fe=e[z];le+=fe.computedWidth}qt(Cy,`${le}px`,a)}}function ye(G){if(G==null||G===E)return;if(E===-1&&G!==-1&&(Ar(P,"",a),m(!1)),E=G,G===-1){Ce(P);return}let X=en(x,P,E>P?E-1:E);I=0;let le=new Set;return X.forEach((re,z)=>{let fe=A[z];re!==fe&&le.add(re),Y(X)}),A=X,ue(le),{newColumnIndexes:X,indexesWithTransition:le,pinnedStartCount:I}}function Ce(G){A=A.filter(W=>W!==G),e.forEach(W=>{let le=W.computedVisibleIndex,re=le>G;ts(le,a);let z="";re&&(z=_r.minus(Ie.columnOffsets.get(le),Ie.columnWidths.get(G)).done()),Ln(le,z,a)}),Ar(G,"hidden",a),m(!0)}function ue(G){e.forEach(X=>{let W=X.computedVisibleIndex;G.has(W)?ts(W,a):Fi(W,a);let le=W===P,re=F===-1?W<E||W>P:W<P||W>=E,z="";F===-1?z=le?Ie.columnOffsets.get(E):re?Ie.columnOffsets.get(W):_r.add(Ie.columnOffsets.get(W),Ie.columnWidths.get(P)).done():z=re?Ie.columnOffsets.get(W):le?_r.add(Ie.columnOffsets.get(E-1),Ie.columnWidths.get(E-1)).minus(Ie.columnWidths.get(P)).done():_r.minus(Ie.columnOffsets.get(W),Ie.columnWidths.get(P)).done(),Ln(W,z,a)})}let pe=u.left+S("start"),ge=u.right-S("end"),U=Md({scrollOffsetStart:pe,scrollOffsetEnd:ge});return $(v),{speedScroller:U,stop(){U.stop()},onMove(G){let X=$(G);if(g().dropTargetListId==="grouping-toolbar"||f&&!d.containsPoint(X.getCenter()))return f&&ye(-1),null;U.scroll({mousePosition:j,get scrollLeft(){return l.getScrollPosition().scrollLeft},set scrollLeft(N){b.scrollLeft=N}});let W=C(e,{dragColumn:M,restrictToParentGroup:c==="group"}),le=F===-1?M.computedOffset+te:M.computedOffset+M.computedWidth+te,re=(0,Nd.default)(W,le,({offsetX:N},Z)=>N<Z?-1:N>Z?1:0);re<0&&(re=~re),W.length?re=W[re]?W[re].columnIndex:W[W.length-1].columnIndex+1:(e.length>1&&console.error("No breakpoints available, something is wrong!"),re=0),re===P+1&&(re=P),ye(re);let z={};o.forEach(N=>{z[N.id]="end"});for(let N=0;N<I;N++){let Z=A[N],ce=e[Z];z[ce.id]="start"}let fe=A.map(N=>e[N].id);return{columnPinning:z,columnOrder:fe}}}}function is(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 en(o,u,c)}else{let l=e.indexOf(r),s=e[l+1],c=o.indexOf(s),u=o.indexOf(r);return en(o,u,c)}return e}var St=K(require("react"));var tn=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 kd=K(Jo());var zd=(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,f=c===a,p=je.from(d.getCenter());if(!l.containsPoint(p))return null;e.activeDragSourcePosition="inside";let m=f?r==="horizontal"?t.left>0?1:-1:t.top>0?1:-1:1,g=d.toDOMRect(),b=e.breakpoints,h=Math.round(m===1?r==="horizontal"?g.right-(f?0:g.width/2):g.bottom-(f?0:g.height/2):r==="horizontal"?g.left+(f?0:g.width/2):g.top+(f?0:g.height/2)),y=(0,kd.default)(b,h,(I,v)=>I-v);y<0&&(y=~y),m===1&&y===u+1&&f&&y--;let S=Math.min(u,y),T=Math.max(u,y),C=f?i.map((I,v)=>{if(v===u&&f)return t;if(v<S||v>=T)return{left:0,top:0};let D=y<=v?1:-1;return r==="horizontal"?{left:Math.round(D*g.width),top:0}:{left:0,top:Math.round(D*g.height)}}):i.map((I,v)=>{let D=y<=v?1:0;return r==="horizontal"?{left:Math.round(D*g.width),top:0}:{left:0,top:Math.round(D*g.height)}}),w={offset:t,dropIndex:y,dragSourceListId:c,dropTargetListId:a,dragIndex:u,outside:!1,items:i,dragItem:s,offsetsForItems:C,dragRect:g,status:"accepted"};return e.acceptsDrop(w)?{event:w,error:null,success:!0}:(w.status="rejected",{event:w,error:"rejected by interaction target",success:!1})},Vd=(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()),f=u===i,p=a.containsPoint(d);if(p&&!(f&&!e.acceptsSelfDrops())||e.activeDragSourcePosition==="outside"&&!f)return null;e.activeDragSourcePosition="outside";let m=f?o.dragIndex:-1,g=s.toDOMRect(),b={offset:t,dropIndex:-1,dragIndex:m,dragItem:c,outside:!p,items:l,dragSourceListId:u,dropTargetListId:i,offsetsForItems:f?l.map((h,y)=>h.id===c.id?t:p?{left:0,top:0}:y>m?r==="horizontal"?{left:-c.rect.width,top:0}:{left:0,top:-c.rect.height}:{left:0,top:0}):l.map(h=>({left:0,top:0})),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})};var _e=class _e{static startDrag(e,t){let o=e instanceof Vn?e:new Vn(e),r=new as({activeDragSource:o,startPoint:t});return r.on("start",_e.onDragStart),r.on("move",_e.onDragMove),r.on("drop",_e.onDragDrop),r.start(),r}static emit(e,...t){_e.emitter.emit(e,...t)}static on(e,t){return _e.emitter.on(e,t)}static registerDragInteractionTarget(e){if(_e.dragInteractionTargetsMap.has(e.listId)){console.warn(`DragInteractionTarget with listId ${e.listId} already registered`);return}return _e.dragInteractionTargetsMap.set(e.listId,e),_e.emit("register",e),()=>{_e.unregisterDragInteractionTarget(e)}}static unregisterAll(){_e.dragInteractionTargetsMap.forEach(e=>{_e.unregisterDragInteractionTarget(e)})}static unregisterDragInteractionTarget(e){if(e){if(!_e.dragInteractionTargetsMap.has(e.listId)){console.warn(`DragInteractionTarget with listId ${e.listId} not found`);return}_e.dragInteractionTargetsMap.delete(e.listId),e.unregister(),_e.emit("unregister",e)}}static onDragStart(e){let{dragItem:t,dragIndex:o}=e.activeDragSource,r=e.activeDragSource.listId,a=_e.dragInteractionTargetsMap.get(r)?.getData().acceptDropsFrom,s=!a||a.includes(r)?r:null;_e.dragInteractionTargetsMap.forEach(c=>{let u=c.getData();c.start({dragIndex:u.listId===r?o:-1,dragItem:t,dragSourceListId:r,dropTargetListId:s})}),_e.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=_e.dragInteractionTargetsMap.get(r);l&&(a=l.acceptsSelfDrops(),a&&i.push(_e.dragInteractionTargetsMap.get(r))),_e.dragInteractionTargetsMap.forEach(s=>{s.listId!==r&&i.push(s)});for(let s of i){let c=zd(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=Vd(e,s);c&&t(s,c)}}static onDragMove(e){let{activeDragSource:t}=e,{listId:o,dragItem:r}=t,i=null,a=[];_e.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;_e.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=[];_e.withDragMove(e,(s,{event:c})=>{s.drop(c),a.push(c),c.outside||(i=c)});let l=i??a[0]??null;_e.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}),_e.unregisterAll()}};_e.dragInteractionTargetsMap=new Map,_e.emitter=new tn;var vt=_e,Vn=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){yt(this.data,e)||(this.data=e,this.dragRectangle=new ve(this.data.dragItem.rect))}getData(){return this.data}static shift(e,t){let o=n.clone(e),r=ve.from(o.dragRectangle);return r.shift(t),o.dragRectangle=r,o}},as=class extends tn{constructor(t){super(t.listeners);this.phase="start";this.currentOffset={top:0,left:0};this.initialDragSource=Vn.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)}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=Vn.shift(this.initialDragSource,o),this.currentOffset=o,this.emit("move",this)}};globalThis.DragManager=vt;var Gd=require("react"),Hd=St.createContext({dragSourceListId:null,dropTargetListId:null,dragItemId:"",status:"accepted",updateDragOperationSourceAndTarget:n=>{},getCurrentDragSourceAndTarget:()=>({dragSourceListId:null,dropTargetListId:null,status:"accepted",dragItemId:""})}),on=()=>St.useContext(Hd),ls=n=>{let[e,t]=St.useState({dragSourceListId:null,dropTargetListId:null,dragItemId:"",status:"accepted"}),o=St.useRef(e);o.current=e;let r=St.useCallback(()=>{let a=o.current;return{dragSourceListId:a.dragSourceListId,dropTargetListId:a.dropTargetListId,dragItemId:a.dragItemId,status:a.status}},[]),i=St.useMemo(()=>({dragSourceListId:e.dragSourceListId,dropTargetListId:e.dropTargetListId,dragItemId:e.dragItemId,status:e.status,updateDragOperationSourceAndTarget:t,getCurrentDragSourceAndTarget:r}),[e,t]);return(0,Gd.useEffect)(()=>{let a=vt.on("drag-start",c=>{t({dragSourceListId:c.dragSourceListId,dropTargetListId:c.dropTargetListId,dragItemId:c.dragItem.id,status:"accepted"})}),l=vt.on("drag-move",c=>{let u=o.current,d={dragSourceListId:c.dragSourceListId,dropTargetListId:c.dropTargetListId,dragItemId:c.dragItem.id,status:c.status};JSON.stringify(u)!==JSON.stringify(d)&&t(d)}),s=vt.on("drag-drop",()=>{t({dragSourceListId:null,dropTargetListId:null,dragItemId:"",status:"accepted"})});return()=>{a(),l(),s()}},[vt,t]),St.createElement(Hd.Provider,{value:i},typeof n.children=="function"?n.children(i):n.children)};var ss=`${mt}Body`,Kd=n=>n.querySelector(`.${ss}`);var nn=`${mt}HeaderCell`,cs=`${mt}HeaderWrapper`,Bd=n=>Array.from(n.querySelectorAll(`.${cs}`));function Li(n){if(!n)return!1;let e=n.tagName;return e==="INPUT"||e==="BUTTON"}var wy=Q(q.baseZIndexForCells),Iy=(n,e)=>{let t=!n||Object.keys(n).length===0,o=!e||Object.keys(e).length===0;return t&&o?!0:!!n!=!!e?!1:yt(n,e)},Wd=({columnId:n,domRef:e,horizontalLayoutPageIndex:t,allowColumnHideOnDrag:o})=>{let[r,i]=(0,Gn.useState)(null),[a,l]=(0,Gn.useState)(!1),{getCurrentDragSourceAndTarget:s}=on(),{getComputed:c,getState:u,api:d,computedDraggable:f,rootRef:p,actions:m}=oe(h=>({actions:h.actions,getComputed:h.getComputed,getState:h.getState,api:h.api,computedDraggable:h.computed.computedVisibleColumnsMap.get(n)?.computedDraggable,rootRef:h.state.domRef})),g=(0,Gn.useCallback)(h=>{let y=c().computedVisibleColumnsMap.get(n);if(!y||!y.computedSortable)return;let{multiSortBehavior:S}=u();d.toggleSortingForColumn(n,{multiSortBehavior:S==="replace"&&(h.ctrlKey||h.metaKey)?"append":S})},[]),b=(0,Gn.useCallback)(h=>{if(Li(h.target))return;let{brain:y,draggableColumnsRestrictTo:S}=u(),{computedVisibleColumns:T,computedVisibleColumnsMap:C,computedPinnedStartColumns:w,computedUnpinnedColumns:I,computedPinnedEndColumns:v}=c(),D=C.get(n);if(!D.computedDraggable){g(h);return}let R=e.current,x=R.getBoundingClientRect(),A=p.current.getBoundingClientRect(),M=y.getAvailableSize(),P=D.computedVisibleIndex,_=y.getVirtualColIndex(D.computedVisibleIndex,{pageIndex:t||0}),E=y.isHorizontalLayoutBrain?y.getPageWidth():null,L=R.style.cursor??"auto",k=!1,V=p.current,j=ve.from(Kd(V).getBoundingClientRect()),O=Bd(V).map(pe=>ve.from(pe.getBoundingClientRect())),F=j.getMinimumBoundingRectangle(...O),te=Ld({brain:y,horizontalLayoutPageIndex:t,allowColumnHideOnDrag:o,pageWidth:E,draggableColumnsRestrictTo:S,computedPinnedEndColumns:v,computedPinnedStartColumns:w,computedUnpinnedColumns:I,computedVisibleColumns:T,computedVisibleColumnsMap:C,dragColumnHeaderTargetRect:x,dragColumnId:n,getCurrentDragSourceAndTarget:s,api:d,infiniteDOMNode:p.current,setProxyPosition:i,setDragColumnOutside:l,tableRect:A,acceptDropToReorderRect:F,initialMousePosition:{clientX:h.clientX,clientY:h.clientY}}),$=null,Y,ae;function ye(pe){let{columnPinning:ge,columnOrder:U}=pe;Iy(u().columnPinning,ge)||(m.columnPinning=ge);let G=c().computedColumnOrder;JSON.stringify(U,G)&&(T.forEach(X=>{Ln(X.computedVisibleIndex,"",p.current)}),m.columnOrder=is({newColumnOrder:U,visibleColumnOrder:c().computedVisibleColumns.map(X=>X.id),existingColumnOrder:G,dragColumnId:n}))}let Ce=pe=>{let{headerBrain:ge,brain:U}=u();if(!k){k=!0;let G=U.keepColumnRendered(_),X=ge.keepColumnRendered(_);if(U.isHorizontalLayoutBrain){let le=U.extendRenderRange({start:!0,end:!0,direction:"horizontal"}),re=ge.extendRenderRange({start:!0,end:!0,direction:"horizontal"});ae=()=>{le(),re()}}Y=()=>{G(),X()},m.columnReorderDragColumnId=D.id,t!=null&&(m.columnReorderInPageIndex=t),es(P,`calc( var(${wy}) + 10000 )`,p.current),p.current?.classList.add(os),R.style.cursor="grabbing"}$=te.onMove(pe)},ue=pe=>{let ge=pe.pointerId;requestAnimationFrame(()=>{let{multiSortBehavior:U}=u(),G=e.current;p.current?.classList.remove(os),te.stop(),y.update({...M}),Y?.(),ae?.(),T.forEach(W=>{Fi(W.computedVisibleIndex,p.current),Ar(W.computedVisibleIndex,"",p.current),Ln(W.computedVisibleIndex,"",p.current)}),es(P,rs(D,{pinnedStartColsCount:w.length,visibleColsCount:T.length}),p.current),G.style.cursor=L,G.releasePointerCapture(ge),G.removeEventListener("pointermove",Ce),G.removeEventListener("pointerup",ue),i(null);let X=d.getColumnApi(D.id)?.isSortable()??!1;!k&&X&&d.toggleSortingForColumn(D.id,{multiSortBehavior:U==="replace"&&(pe.ctrlKey||pe.metaKey)?"append":U}),$?ye($):k&&o&&d.setVisibilityForColumn(D.id,!1),m.columnReorderDragColumnId=!1,t!=null&&(m.columnReorderInPageIndex=null)})};R.addEventListener("pointermove",Ce),R.addEventListener("pointerup",ue),R.setPointerCapture(h.pointerId)},[n,t]);return{onPointerDown:f?b:g,dragColumnOutside:a,proxyPosition:r}};var Kn=K(require("react"));var Te=K(require("react")),Ke=require("react");var an=K(require("react"));var jd=n=>n.dataSourceHasGrouping&&n.isGroupRow&&n.childrenLoading||!n.selfLoaded;var Or=K(require("react")),Yd=require("react");var $d="_6rdmyg0 _16lm1iw1d _16lm1iwk _16lm1iw9",Ud=he({defaultClassName:"_6rdmyg1",variantClassNames:{expanded:{true:"_16lm1iwi",false:"_6rdmyg3"},direction:{end:"_6rdmyg4",start:"_6rdmyg5"},disabled:{true:"_6rdmyg6",false:"_6rdmyg7"}},defaultVariants:{},compoundVariants:[[{expanded:!1,direction:"end"},"_16lm1iwj"]]});var ki=`${Rt}-expand-collapse`;function rn(n){let{size:e=24,direction:t="start",disabled:o=!1}=n,[r,i]=(0,Yd.useState)(n.expanded??n.defaultExpanded),a=()=>{n.onChange?.(!r),Do("expanded",n)||i(!r)};Or.useEffect(()=>{Do("expanded",n)&&i(n.expanded)},[n.expanded]);let l=r?"expanded":"collapsed";return Or.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:J(n.className,$d,Ud({direction:t||"start",expanded:r,disabled:o}),`${Rt}`,`${ki}`,`${ki}--${l}`,`${ki}--${t==="end"?"end":"start"}`,o?`${ki}--disabled`:"")},Or.createElement("path",{d:"M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"}))}var zi=K(require("react"));var qd="_16lm1iwb _16lm1iw1d _16lm1iwk";var Xd=n=>zi.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",style:{margin:"auto",display:"block",shapeRendering:"auto"},width:"24px",height:"24px",viewBox:"0 0 100 100",preserveAspectRatio:"xMidYMid",className:J(n.className,qd,"InfiniteIcon","InfiniteIcon-loading")},zi.createElement("circle",{cx:"50",cy:"50",fill:"none",strokeWidth:"10",r:"35",strokeDasharray:"164.93361431346415 56.97787143782138"},zi.createElement("animateTransform",{attributeName:"transform",type:"rotate",repeatCount:"indefinite",dur:"1s",values:"0 50 50;360 50 50",keyTimes:"0;1"})));var{rootClassName:Ry}=ke,Zt=`${Ry}ColumnCell`;var Zd=he({defaultClassName:"_7pupv01",variantClassNames:{align:{start:"_7pupv02",center:"_7pupv03",end:"_7pupv04"}},defaultVariants:{},compoundVariants:[]}),Qd="_7pupv00",Jd=he({defaultClassName:"_7pupv05",variantClassNames:{align:{start:"_7pupv06",center:"_7pupv07",end:"_7pupv08"}},defaultVariants:{},compoundVariants:[]});function ef({rowInfo:n}){return{[Q(me.components.Row.groupNesting)]:n.dataSourceHasGrouping?n.isGroupRow?n.groupNesting-1:n.groupNesting:0}}function Vi({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=J(Mn.flex,i.align==="end"?Dr.rowReverse:Dr.row,ru.center,`${Zt}Expander`,e==="single-column"||e==="multi-column"&&(!o.isGroupRow||c)?Zd({align:a}):null);if(e==="multi-column"){if(n+1!==u.groupNesting&&u.isGroupRow)return c?an.createElement("div",{className:d},c):null}else e==="single-column"&&u.isGroupRow;return an.createElement("div",{className:d},s,c,an.createElement("div",{className:Yt},l??null))}}function Gi({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 f=u.groupKeys,p=null,m=s?(u.groupKeys?.length||0)<l?.length:(u.groupKeys?.length||0)<=l?.length;return jd(u)?p=an.createElement(Xd,null):m&&(p=an.createElement(rn,{expanded:!d,direction:c.align==="end"?"end":"start",onChange:()=>{t(f)}})),o&&(r.renderBag.groupIcon=p,p=an.createElement(Tt,{render:o,renderParam:r})),p}}function tf(n,e,t){let{groupByForColumn:o,groupIndexForColumn:r,groupRenderStrategy:i}=n,a=o.column?{...o.column}:{},l={header:`Group by ${o.field||o.groupField}`,groupByForColumn:o,render:Vi({groupIndexForColumn:r,groupRenderStrategy:i}),...a,renderGroupIcon:Gi({initialRenderGroupIcon:a?.renderGroupIcon,groupIndexForColumn:r,toggleGroupRow:e,groupRenderStrategy:i})};return t&&(typeof t=="function"?l={...l,...t(n,e)}:l={...l,...t}),l}function of(n,e,t){let o=typeof t=="function"?t(n,e):t,r={};return n.sortable!=null&&(r.sortable=n.sortable),{...r,header:"Group",groupByForColumn:n.groupBy,renderSelectionCheckBox:n.selectionMode==="multi-row",render:Vi({groupIndexForColumn:0,groupRenderStrategy:"single-column"}),...o,renderGroupIcon:Gi({initialRenderGroupIcon:o?.renderGroupIcon,groupIndexForColumn:0,toggleGroupRow:e,groupRenderStrategy:"single-column"})}}var nf="_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",Hi=he({defaultClassName:"_1eexc2aa",variantClassNames:{direction:{up:"_1eexc2ab",down:"_1eexc2ac",neutral:"_1eexc2ad"}},defaultVariants:{},compoundVariants:[]}),Ki="_1eexc2a8";var Bi=K(require("react")),Wi=require("react");var sf="qz8ht90 _16lm1iwk";function vy(){return{checked:1,disabled:n=>n??!1,domProps:1}}var{ManagedComponentContextProvider:Dy}=Ot({forwardProps:vy,mappedCallbacks:{checked:n=>({callbackName:"onChange",callbackParams:[n]})},debugName:"InfiniteCheckBox"});function Py(){let{componentState:n,componentActions:e}=Ft(),{checked:t,domProps:o,disabled:r}=n,i=(0,Wi.useRef)(null);return(0,Wi.useEffect)(()=>{i.current.indeterminate=t==null},[t]),Bi.createElement("input",{...o,className:J("InfiniteCheckBox",sf,o?.className),type:"checkbox",ref:i,checked:!!t,disabled:r,onChange:()=>{r||(e.checked=!t)}})}function so(n){return Bi.createElement(Dy,{...n},Bi.createElement(Py,null))}function xy(n){return typeof n.field=="string"}function cf(n){let{column:e,rowInfo:t,fieldsToColumn:o}=n,r;if(e.groupByForColumn){if(t.isGroupRow){let i=t.groupBy[t.groupBy.length-1];r=i?o.get(i.field||i.groupField):void 0}!r&&e.field&&(r=o.get(e.field))}return r}function Dt(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,f=e().computedColumnsMap.get(i),{activeRowIndex:p,keyboardNavigation:m,isRowDetailEnabled:g}=o(),b=r===p&&m==="row",h=!g||typeof g=="function"&&!g(c)?!1:a.rowDetailApi.isRowDetailExpanded(c.id)?"expanded":"collapsed",{formattedValue:y,formattedValueContext:{rawValue:S}}=Hn({column:f,rowInfo:c,rowDetailState:h,columnsMap:e().computedColumnsMap,context:n}),T=gt(f.id,n);return u?{api:a,dataSourceApi:l,column:f,columnApi:T,isParentNode:!1,isGroupRow:!0,isTreeNode:!1,nodeExpanded:!1,rowDetailState:!1,data:c.data,rowActive:b,rowInfo:c,rowSelected:c.rowSelected,value:y,rawValue:S}:d?c.isParentNode?{api:a,dataSourceApi:l,columnApi:T,column:f,nodeExpanded:c.nodeExpanded,isTreeNode:!0,isGroupRow:!1,isParentNode:!0,rowDetailState:h,data:c.data,rowActive:b,rowInfo:c,rowSelected:c.rowSelected,value:y,rawValue:S}:{api:a,dataSourceApi:l,columnApi:T,column:f,nodeExpanded:!1,isTreeNode:!0,isGroupRow:!1,isParentNode:!1,rowDetailState:h,data:c.data,rowActive:b,rowInfo:c,rowSelected:c.rowSelected,value:y,rawValue:S}:{api:a,dataSourceApi:l,columnApi:T,column:f,isTreeNode:!1,isParentNode:!1,isGroupRow:!1,nodeExpanded:!1,rowDetailState:h,data:c.data,rowActive:b,rowInfo:c,rowSelected:c.rowSelected,value:y,rawValue:S}}function uf(n){return ff(n.column,n.rowInfo)}function df(n){let{column:e,context:t,rowInfo:o,visibleColumnsIds:r}=n,i=cf({rowInfo:o,column:e,fieldsToColumn:n.fieldsToColumn,groupRenderStrategy:t.getState().groupRenderStrategy}),{getState:a}=t,{editingCell:l}=a(),s=Hn(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 f=typeof e.align=="function"?e.align({isHeader:!1,...d}):e.align??"start",p=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:My({rowIndexInHorizontalLayoutPage:n.rowIndexInHorizontalLayoutPage,horizontalLayoutPageIndex:n.horizontalLayoutPageIndex,column:n.column,rowInfo:n.rowInfo,visibleColumnsIds:n.visibleColumnsIds,columnsMap:n.columnsMap,fieldsToColumn:n.fieldsToColumn,context:n.context,align:f,verticalAlign:p,formattedValueContext:c}),groupByColumnReference:i}}function My(n){let{column:e,context:t,rowInfo:o,align:r,verticalAlign:i,visibleColumnsIds:a,columnsMap:l,fieldsToColumn:s,formattedValueContext:c}=n,{value:u}=c,{api:d,getDataSourceState:f,getState:p,dataSourceApi:m}=t,{editingCell:g}=p(),{indexInAll:b}=o,h=f(),{selectionMode:y,cellSelection:S}=h,T=cf({rowInfo:o,column:e,fieldsToColumn:s,groupRenderStrategy:t.getState().groupRenderStrategy}),C=d.toggleGroupRow,w=S?.isCellSelected(o.id,e.id)??!1,I={column:e,columnsMap:l,fieldsToColumn:s,align:r,verticalAlign:i,cellSelected:w,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:b,toggleGroupRow:C,toggleCurrentGroupRow:()=>{o.isGroupRow&&C(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:h.groupBy,pivotBy:h.pivotBy};return Object.defineProperty(I,"rowHasSelectedCells",{get(){return o.hasSelectedCells(a)}}),I}function ff(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:xy(n)?t?.[n.field]:null;return n.field&&e.isGroupRow&&e.reducerData&&e.reducerData[n.field]!=null&&(a=e.reducerData[n.field]),n.valueGetter&&!e.isGroupRow&&e.data&&(a=n.valueGetter({data:e.data,field:n.field})),a}function Ay(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 Hn(n){let{column:e,rowInfo:t,context:o,rowDetailState:r}=n,i=ff(e,t),a=Ay(i,e,t,o,r),l=e.valueFormatter?e.valueFormatter(a):i;return a.value=l,{formattedValue:l,formattedValueContext:a}}var co=K(require("react"));var{rootClassName:pf}=ke,ln=`${pf}Cell`,us=`${pf}Cell_content`,Ey=Q(q.columnWidthAtIndex),_y=Q(q.columnReorderEffectDurationAtIndex);function Oy(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:f,cssPosition:p,renderChildren:m,horizontalLayoutPageIndex:g,...b}=n,h=typeof m=="function"?m():m,y={width:`var(${Ey}-${i.computedVisibleIndex})`,transition:`transform var(${_y}-${i.computedVisibleIndex}, 0s)`,...b.style},S={...b,style:y,"data-column-id":i.id,"data-z-index":y.zIndex,className:J(b.className,ln,nf),children:co.createElement(co.Fragment,null,d,co.createElement("div",{className:J(us,e?Yt:uu.hidden,s),style:r},h),u)};c!=null&&(S["data-row-id"]=`${c}`);let T=f==="body"?i.components?.ColumnCell:i.components?.HeaderCell;return T?co.createElement(T,{...S,ref:a}):co.createElement("div",{...S,ref:a})}var ji=co.memo(Oy);var cn=K(require("react")),sn=require("react");function mf(){let{initialValue:n,setValue:e,confirmEdit:t,cancelEdit:o,readOnly:r}=$i(),i=(0,sn.useRef)(null),a=(0,sn.useRef)(!1),l=cn.useCallback(u=>{i.current=u,u&&u.focus()},[]),s=(0,sn.useCallback)(u=>{let{key:d}=u;d==="Enter"||d==="Tab"?t():d==="Escape"?(a.current=!0,o()):u.stopPropagation()},[]),c=(0,sn.useCallback)(()=>{a.current||t()},[]);return cn.createElement(cn.Fragment,null,cn.createElement("input",{readOnly:r,ref:l,onKeyDown:s,onBlur:c,className:J(nu,cu.none),type:"text",defaultValue:n,onChange:(0,sn.useCallback)(u=>{e(u.target.value)},[])}))}function gf(n,e){let t=[];for(let o in n)n.hasOwnProperty(o)&&!e.hasOwnProperty(o)&&t.push(n[o]);return t}var Fy=Q(q.columnZIndexAtIndex),Ny=Q(q.columnVisibilityAtIndex);function Ly({rowInfo:n}){return{[Q(me.components.Row.groupNesting)]:n.isTreeNode?n.isParentNode?n.treeNesting:n.treeNesting+1:0}}var Fr=Te.createContext(null),ky=n=>{let{toggleCurrentRowDetails:e,rowDetailState:t}=n;return Te.createElement(rn,{style:{visibility:t===!1?"hidden":"visible"},expanded:t==="expanded",onChange:e})},zy={display:"inline-block",visibility:"visible"},ds=n=>{let{rowInfo:e,toggleCurrentTreeNode:t,nodeExpanded:o,api:r}=n,i=r.getDataSourceState().isNodeReadOnly;return Te.createElement(rn,{disabled:e.isTreeNode&&e.isParentNode?i(e):!1,style:zy,expanded:o,onChange:t})},Vy=n=>{let{rowInfo:e,selectCurrentRow:t,deselectCurrentRow:o,toggleCurrentGroupRowSelection:r,column:i,dataSourceApi:a,api:l}=n;e.isGroupRow&&i.groupByForColumn;let{components:s}=l.getState(),c=l.getDataSourceState().isNodeSelectable,u=s?.CheckBox||so;return Te.createElement(u,{domProps:{className:Ki},disabled:e.isTreeNode?!c(e):!1,onChange:d=>{if(e.isTreeNode){a.treeApi.setNodeSelection(e.nodePath,d??!1);return}if(e.isGroupRow){r();return}d?t():o()},checked:e.rowSelected})};function fs(n,e){return n?typeof n=="function"?n(e):n:void 0}function ps(n,e,t){return typeof e=="function"?{...n,...e(t)}:{...n,...e}}function Gy(n){let{dataSourceStatePartialForCell:e,rowInfoStore:t,rowStyle:o,rowClassName:r,rowIndexInHorizontalLayoutPage:i,horizontalLayoutPageIndex:a,getData:l,cellStyle:s,cellClassName:c,rowDetailState:u,width:d,column:f,onMouseLeave:p,onMouseEnter:m,onRowMouseEnter:g,onRowMouseLeave:b,rowIndex:h,rowHeight:y,columnsMap:S,fieldsToColumn:T,domRef:C,hidden:w,showZebraRows:I,getDataSourceState:v,dataSourceApi:D,dataSourceActions:R,getState:x,imperativeApi:A,componentActions:M,getComputed:P,getDataSourceMasterContext:_}=n,E=(0,Ke.useSyncExternalStore)((0,Ke.useCallback)(Me=>t.subscribeToRowIndex(h,Me),[t,h]),(0,Ke.useCallback)(()=>t.getRowInfoAtIndex(h),[t,h])),L=!E,k=!f,V=Te.useRef(null),j=(0,Ke.useCallback)(Me=>{V.current=Me,C&&C(Me)},[C]),O=E??{id:"",indexInAll:h,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:F}=O,te=P(),{activeRowIndex:$,keyboardNavigation:Y,columnReorderInPageIndex:ae}=x(),ye=h===$&&Y==="row",Ce={getState:x,getDataSourceState:v,getDataSourceMasterContext:_,actions:M,dataSourceActions:R,api:A,dataSourceApi:D},ue=O.rowDisabled,pe=te.computedVisibleColumns.map(Me=>Me.id),ge=df({horizontalLayoutPageIndex:a,rowIndexInHorizontalLayoutPage:i,column:f,rowInfo:O,rowDetailState:u,columnsMap:S,visibleColumnsIds:pe,fieldsToColumn:T,context:Ce}),{stylingParam:U,renderParams:G,formattedValueContext:X,renderFunctions:W,groupByColumnReference:le,inEdit:re}=ge,{align:z,verticalAlign:fe}=G,N=G,Z=Te.useRef(N),ce=g&&m?Me=>{let io={...X,rowIndex:h};g(io,Me),m(Me)}:m,de=b&&p?Me=>{let ft={...X,rowIndex:h,rowInfo:O};b(ft,Me),p(Me)}:p,Pe=(0,Ke.useCallback)(Me=>{let ft=f.computedVisibleIndex;x().cellClick({rowIndex:h,colIndex:ft,event:Me})},[h,f.computedVisibleIndex,Y]),xe=(0,Ke.useCallback)(Me=>{let ft=f.computedVisibleIndex;if(x().cellMouseDown({rowIndex:h,colIndex:ft,event:Me}),Y==="row"){ue||(M.activeRowIndex=h);return}Y==="cell"&&(M.activeCellIndex=[h,ft])},[h,ue,f.computedVisibleIndex,Y]),{selectionMode:Ge,cellSelection:Ne,isNodeReadOnly:Le}=e,We=N.cellSelected;N.domRef=j,N.htmlElementRef=V,N.toggleCurrentTreeNode=(0,Ke.useCallback)(N.toggleCurrentTreeNode,[O]),N.selectCell=(0,Ke.useCallback)(N.selectCell,[O]),N.deselectCell=(0,Ke.useCallback)(N.deselectCell,[O]),N.selectCurrentRow=(0,Ke.useCallback)(N.selectCurrentRow,[O]),N.deselectCurrentRow=(0,Ke.useCallback)(N.deselectCurrentRow,[O]),N.toggleCurrentGroupRow=(0,Ke.useCallback)(N.toggleCurrentGroupRow,[O]),N.toggleCurrentRowSelection=(0,Ke.useCallback)(N.toggleCurrentRowSelection,[O]),N.toggleCurrentGroupRowSelection=(0,Ke.useCallback)(N.toggleCurrentGroupRowSelection,[O]),N.toggleCurrentTreeNodeSelection=(0,Ke.useCallback)(N.toggleCurrentTreeNodeSelection,[O]);let Je=f.components?.Editor??mf,et=re?Te.createElement(bf,{contextValue:N},Te.createElement(Je,null)):null,tt=(0,Ke.useCallback)(pt(()=>{if(w||re)return null;if(Z.current=N,W.renderGroupIcon&&(N.renderBag.groupIcon=Te.createElement(Tt,{render:W.renderGroupIcon,renderParam:{...N,renderBag:{...N.renderBag}}})),W.renderSelectionCheckBox&&Ge=="multi-row"&&(N.renderBag.selectionCheckBox=Te.createElement(Tt,{render:Vy,renderParam:N}),W.renderSelectionCheckBox!==!0&&(N.renderBag.selectionCheckBox=Te.createElement(Tt,{render:W.renderSelectionCheckBox,renderParam:{...N,renderBag:{...N.renderBag}}}))),O.isTreeNode){let{isParentNode:io}=O,zt;zt=(io?W.renderTreeIconForParentNode:W.renderTreeIconForLeafNode)||typeof W.renderTreeIcon=="function"?W.renderTreeIcon:io&&W.renderTreeIcon===!0?ds:void 0,zt===!0?zt=ds:zt&&(N.renderBag.treeIcon=Te.createElement(Tt,{render:ds,renderParam:N})),zt&&(N.renderBag.treeIcon=Te.createElement(Tt,{render:zt,renderParam:{...N,renderBag:{...N.renderBag}}}))}W.renderRowDetailIcon&&(N.renderBag.rowDetailsIcon=Te.createElement(Tt,{render:ky,renderParam:{...N,renderBag:{...N.renderBag}}}),typeof W.renderRowDetailIcon=="function"&&(N.renderBag.rowDetailsIcon=Te.createElement(Tt,{render:W.renderRowDetailIcon,renderParam:{...N,renderBag:{...N.renderBag}}}))),W.renderValue&&(N.renderBag.value=Te.createElement(Tt,{render:W.renderValue,renderParam:{...N,renderBag:{...N.renderBag}}})),O.isGroupRow&&W.renderGroupValue&&(N.renderBag.value=Te.createElement(Tt,{render:W.renderGroupValue,renderParam:{...N,renderBag:{...N.renderBag}}})),!O.isGroupRow&&W.renderLeafValue&&(N.renderBag.value=Te.createElement(Tt,{render:W.renderLeafValue,renderParam:{...N,renderBag:{...N.renderBag}}})),Z.current=N;let Me=N.renderBag.value;Me instanceof Date&&(Me=Me.toLocaleDateString());let ft=Te.createElement(Te.Fragment,null,z!=="end"?N.renderBag.treeIcon:null,z!=="end"?N.renderBag.groupIcon:null,z!=="end"?N.renderBag.rowDetailsIcon:null,z!=="end"?N.renderBag.selectionCheckBox:null,Me,z==="end"?N.renderBag.selectionCheckBox:null,z==="end"?N.renderBag.rowDetailsIcon:null,z==="end"?N.renderBag.groupIcon:null,z==="end"?N.renderBag.treeIcon:null);return f.render?Te.createElement(Tt,{render:f.render,renderParam:{...N,renderBag:{...N.renderBag,all:ft}}}):ft}),[f,w,re,u,f.renderTreeIcon||f.renderTreeIconForParentNode?Le:!1,...gf(N,{renderBag:!0,selectCell:!0,deselectCell:!0,selectCurrentRow:!0,deselectCurrentRow:!0,toggleCurrentGroupRow:!0,toggleCurrentRowDetails:!0,toggleCurrentRowSelection:!0,toggleCurrentGroupRowSelection:!0,toggleCurrentTreeNodeSelection:!0,toggleCurrentTreeNode:!0,rowHasSelectedCells:!0})]),B=te.computedVisibleColumns.map(Me=>Me.id),ie=te.computedColumnOrder,se={...X,visibleColumnIds:B,allColumnIds:ie,rowIndex:h,rowHasSelectedCells:!1};Object.defineProperty(se,"rowHasSelectedCells",{get(){return O.hasSelectedCells(B)}});let be=O.isTreeNode&&(f.renderTreeIcon||f.renderTreeIconForLeafNode||f.renderTreeIconForParentNode),Ye=typeof r=="function"?r(se):r,ne;le?.className&&(ne=fs(le.className,U)),c&&(ne=J(ne,fs(c,U))),f.className&&(ne=J(ne,fs(f.className,U))),be&&(ne=J(ne,Jd({align:z})));let H;O.dataSourceHasGrouping&&f.groupByForColumn&&(H=ef({rowInfo:O})),be&&(H=Ly({rowInfo:O})),o&&(H=typeof o=="function"?{...H,...o(se)}:{...H,...o}),s&&(H=ps(H,s,U)),le?.style&&(H=ps(H,le.style,U)),f.style&&(H=ps(H,f.style,U)),H=H||{},H.height=y,H.zIndex=`var(${Fy}-${f.computedVisibleIndex})`,H.visibility=`var(${Ny}-${f.computedVisibleIndex}, visible)`;let rt=(0,Ke.useMemo)(()=>H,[H?JSON.stringify(H):null]),we=i!=null?i%2===1:(O.indexInAll!=null?O.indexInAll:h)%2===1,it=I?we?"odd":"even":!1,It=!1,kt=!1,gr=!1,Rn=!1;if(Ne&&We){let Me=l(),ft=Me[O.indexInAll-1],io=Me[O.indexInAll+1],zt=te.computedVisibleColumns[f.computedVisibleIndex+1],br=te.computedVisibleColumns[f.computedVisibleIndex-1];It=ft?!Ne.isCellSelected(ft.id,f.id):!0,f.computedPinned==="end"&&f.computedFirstInCategory?kt=!0:kt=br?!Ne.isCellSelected(O.id,br.id):!0,f.computedPinned==="start"&&f.computedLastInCategory?gr=!0:gr=zt?!Ne.isCellSelected(O.id,zt.id):!0,Rn=io?!Ne.isCellSelected(io.id,f.id):!0}let hr=Ne&&We?{top:It,left:kt,right:gr,bottom:Rn}:null,fl=ae!=null?a!==ae:!1,pl=et,ml=tt(),dt={domRef:j,cellType:"body",column:f,width:d,rowId:O.id,horizontalLayoutPageIndex:a,style:rt,onMouseLeave:de,onMouseEnter:ce,onClick:Pe,afterChildren:pl,onMouseDown:xe,cssEllipsis:f.cssEllipsis??!0,className:J(hr?af(hr):"",Oi(f,[Zt,ln],rf,{dragging:!1,insideDisabledDraggingPage:fl,zebra:it,align:z,verticalAlign:fe,rowDisabled:ue,rowActive:ye,cellSelected:We,rowSelected:F,treeNode:O.isTreeNode?O.isParentNode?"parent":"leaf":!1,firstRow:O.indexInAll===0,firstRowInHorizontalLayoutPage:i===0,groupRow:O.isGroupRow,groupCell:O.isGroupRow?!!f.groupByForColumn:!1,rowExpanded:O.isGroupRow?!O.collapsed:!1}),ne,Ye),renderChildren:(0,Ke.useCallback)(()=>ml,[tt])},si=Fr.Provider;return k||L?Te.createElement("div",{ref:j,style:{display:"none"}}):Te.createElement(si,{value:Z.current},Te.createElement(ji,{...dt}))}var hf=Te.memo(Gy);function Nr(){return(0,Ke.useContext)(Fr)}function $i(){let{api:n,editingValueRef:e,editingCell:t}=oe(p=>({api:p.api,editingCell:p.state.editingCell,editingValueRef:p.state.editingValueRef})),{column:o,rowInfo:r}=Nr(),[i]=Te.useState(()=>t?.value),[a,l]=Te.useState(i),s=t?!t.active&&!!t.waiting:!1,c=Te.useCallback(p=>{e.current=p,l(p)},[]);Te.useLayoutEffect(()=>{e.current=i},[]);let u=n.confirmEdit,d=n.cancelEdit,f=n.rejectEdit;return{api:n,initialValue:i,value:a,readOnly:s,column:o,rowInfo:r,setValue:c,confirmEdit:u,cancelEdit:d,rejectEdit:f}}function Lr(n){return n.render(n.renderParam)??null}function Tt(n){let e=Fr.Provider;return Kn.createElement(e,{value:n.renderParam},Kn.createElement(Lr,{render:n.render,renderParam:n.renderParam}))}function bf(n){let e=Fr.Provider;return Kn.createElement(e,{value:n.contextValue},n.children)}function Oo(n){let e=Ui.Provider;return Kn.createElement(e,{value:n.renderParam},Kn.createElement(Lr,{render:n.render,renderParam:n.renderParam}))}var Fo=K(require("react"));var Hy={width:"100%",pointerEvents:"none"},ms=`${Rt}-menu`,gs=Ri({"data-name":""}),hs={[gs["data-name"]]:"menu-icon"};function kr(n){let{style:e,className:t,domProps:o,reserveSpaceWhenHidden:r,menuVisible:i,children:a}=n,l={...Hy,borderTop:`${me.components.HeaderCell.menuIconLineWidth} solid currentColor`,...n.lineStyle};return Fo.createElement("div",{...o,style:e,...hs,onPointerDown:s=>s.stopPropagation(),className:J(t,Gu({menuVisible:i,reserveSpaceWhenHidden:r}),Rt,`${Rt}-menu`)},a??Fo.createElement(Fo.Fragment,null,Fo.createElement("div",{className:ms,style:l}),Fo.createElement("div",{className:ms,style:l}),Fo.createElement("div",{className:ms,style:l})))}var Bn=K(require("react")),zr=require("react");var yf="_1ek6mqy0 _16lm1iw1p _16lm1iw2f _16lm1iw1 _16lm1iw32";var Ky={transition:"width 0.25s, opacity 0.25s"};function Yi(n){let[e,t]=(0,zr.useState)(!0),[o,r]=(0,zr.useState)(0),{direction:i,lineWidth:a=1,style:l,className:s,index:c}=n,u=c!=null&&c>0,d=n.size??16,f=Math.floor(d/4),p=i?[d-3*f,d-2*f,d-f]:[0,0,0];i===-1&&p.reverse();let m={...Ky,borderTop:`${a}px solid currentColor`,...n.lineStyle,opacity:o};(0,zr.useEffect)(()=>{let h=i!=0?1:0;if(!e&&h&&t(!0),h!==o){let y=requestAnimationFrame(()=>{r(h)});return()=>{cancelAnimationFrame(y)}}return()=>{}},[i,e]);let g=()=>{let y=!(o===0&&i===0);y!==e&&t(y)};if(!e&&!n.forceSize)return null;let b={};return i===-1&&(b.top="100%"),Bn.createElement("div",{"data-name":"sort-icon",style:{...l,width:d},className:J(s,Rt,yf,`${Rt}-sort`)},u?Bn.createElement("div",{"data-name":"index",style:b,className:Bu},c):null,Bn.createElement("div",{style:{width:p[0],...m},onTransitionEnd:g}),Bn.createElement("div",{style:{width:p[1],...m}}),Bn.createElement("div",{style:{width:p[2],...m}}))}var wf=K(require("react")),bs=require("react");var Vr=require("react"),Gr=K(require("react"));function Sf(n,{columns:e,shareSpaceOnResize:t,domRef:o}){let r=e[n];return{resize(i){Ie.columnWidths.set(n,r.computedWidth+i,o.current);let a=n+1;if(t){let l=e[a];if(!l)return;Ie.columnWidths.set(a,l.computedWidth-i,o.current),l.computedPinned==="start"?Jl(l,i,o.current):Ie.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"){Jl(c,i,o.current);continue}c.computedPinned!=="end"&&Ie.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||Ie.columnOffsets.set(l,c.computedOffset+i,o.current)}}}}}function Tf(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 f=n[d],p=r[f],m=p.computedWidth+u;Ie.columnWidths.set(f,m,c),p.computedPinned!=="end"&&(l&&Ie.columnOffsets.set(f,l,c),l+=m)}),a.computedPinned!=="end")for(let u=t+1;u<r.length;u++){let d=r[u];d.computedPinned!=="end"&&Ie.columnOffsets.set(u,d.computedOffset+s,c)}}}}var qi="zneyzh0 _16lm1iw2 _16lm1iw23 _16lm1iw2c _16lm1iw2a _16lm1iwm _16lm1iw35",Xi=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"]]}),Zi=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:By}=ke,Wy=`${By}HeaderCell_ResizeHandle`;function jy(n){let{brain:e,headerBrain:t}=oe(g=>({brain:g.state.brain,headerBrain:g.state.headerBrain})),o=(0,Vr.useRef)(null),[r,i]=(0,Vr.useState)(!1),a=(0,Vr.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,f=()=>{},p=g=>{g.stopPropagation();let b=!!g.shiftKey,h=g.pointerId,y=g.clientX,S=g.target;if(e.isHorizontalLayoutBrain){let v=e.extendRenderRange({start:!0,end:!0,direction:"horizontal"}),D=t.extendRenderRange({start:!0,end:!0,direction:"horizontal"});f=()=>{v(),D()}}S.setPointerCapture(h);let T=Sf(n.columnIndex,{columns:n.columns,shareSpaceOnResize:b,domRef:o}),C=(v,{done:D}={})=>{s&&(v=v/(s+1),D&&(v=Math.round(v))),c==="end"&&(v*=-1);let{adjustedDiff:R,constrained:x}=n.computeResize({diff:v,shareSpaceOnResize:b});return a.current!==x&&i(x),T.resize(R),R},w=v=>{C(Math.round(v.clientX-y))},I=v=>{S.releasePointerCapture(h),S.removeEventListener("pointermove",w),S.removeEventListener("pointerup",I);let D=Math.round(v.clientX-y),R=C(D,{done:!0});f(),n.onResize({diff:R,shareSpaceOnResize:b})};S.addEventListener("pointermove",w),S.addEventListener("pointerup",I)},m=(c===!1||c==="start")&&d?{right:c==="start"?void 0:0}:c==="end"&&u?{right:void 0}:void 0;return Gr.createElement("div",{ref:o,className:`${Wy} ${qi} ${Zi({computedPinned:c,computedFirstInCategory:u,computedLastInCategory:d})}`,onPointerDown:p},Gr.createElement("div",{style:m,className:Xi({constrained:r,computedPinned:c,computedFirstInCategory:u,computedLastInCategory:d})}))}var Cf=Gr.memo(jy);function If(n,e){let{computedVisibleColumns:t,getState:o,getComputed:r,actions:i}=oe(c=>({computedVisibleColumns:c.computed.computedVisibleColumns,getState:c.getState,getComputed:c.getComputed,actions:c.actions})),a=(0,bs.useCallback)(({diff:c,shareSpaceOnResize:u})=>{let d=o(),{columnSizing:f,viewportReservedWidth:p,bodySize:m}=d,g=r().computedVisibleColumns,b=!1,h=g.reduce((T,C)=>(C.computedFlex&&(T[C.id]={...f[C.id],flex:C.computedWidth},b=!0),T),{}),y=b?{...f,...h}:f;return Bl({shareSpaceOnResize:u,availableSize:m.width,reservedWidth:p||0,dragHandleOffset:c,dragHandlePositionAfter:n.computedVisibleIndex,columnSizing:y,items:g.map(T=>({id:T.id,computedFlex:T.computedFlex,computedWidth:T.computedWidth,computedMinWidth:T.computedMinWidth,computedMaxWidth:T.computedMaxWidth}))})},[n,o,r]),l=(0,bs.useCallback)(({diff:c,shareSpaceOnResize:u})=>{let{columnSizing:d,reservedWidth:f}=a({diff:c,shareSpaceOnResize:u});u||(i.viewportReservedWidth=f),i.columnSizing=d},[a,i]);return n.computedResizable?wf.createElement(Cf,{horizontalLayoutPageIndex:e.horizontalLayoutPageIndex,columns:t,columnIndex:n.computedVisibleIndex,computeResize:a,onResize:l}):null}var lt=K(require("react"));var Lo=require("react");var Rf=he({defaultClassName:"_16lm1iw3a _16lm1iw1",variantClassNames:{dragging:{true:"_16lm1iwn _16lm1iw1x"}},defaultVariants:{},compoundVariants:[]}),vf=he({defaultClassName:"_16lm1iw3a _16lm1iw1 _16lm1iwo",variantClassNames:{active:{true:"_3dmbka5 _16lm1iw1k _3dmbka2"},draggingInProgress:{true:"_16lm1iw1x"}},defaultVariants:{},compoundVariants:[[{active:!1,draggingInProgress:!0},"_3dmbka3"]]});function Df(n,e){return yt(n,e)}var Qi=class extends tn{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 Df(this.data,t)?!1:(this.data=t,!0)}getData(){return this.data}isEqual(t){return Df(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}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},(p,m)=>m),d=[];o===-1?d=u.filter(p=>p!==r):d=en(u,r,o>r?o-1:o);let f={dragIndex:r,dropIndex:o,dragItem:s,items:i,dragSourceListId:a,dropTargetListId:l,sortedIndexes:d,outside:c,status:t.status};this.emit("drop",f)}};var xf=lt.createContext({dragItemId:null,onDragItemPointerDown:()=>{},draggingInProgress:!1,dragListId:"",status:"accepted",dragSourceListId:null,dropTargetListId:null}),Hr=()=>lt.useContext(xf),$y=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)`},Uy=n=>`${n.getAttribute(No)}`;function Yy(n){let e=n.current?.querySelectorAll(Ji)??[];return!e||e.length,Array.from(e).map(o=>{let r=Uy(o),i=o.getBoundingClientRect();return{id:r,rect:i}})}function qy(n){let{domRef:e,orientation:t,dragListId:o}=n,r=ve.from(e.current.getBoundingClientRect());return{draggableItems:Yy(e),orientation:t,listId:o,listRectangle:r,acceptDropsFrom:n.acceptDropsFrom,shouldAcceptDrop:n.shouldAcceptDrop,initial:n.initial}}function Mf(n){return new Qi(qy(n))}function Xy(n,e){let t=Oe(e),[o,r]=lt.useState(null),i=(0,Lo.useCallback)(l=>{if(l)vt.registerDragInteractionTarget(l);else{let s=a();s&&vt.unregisterDragInteractionTarget(s)}r(l)},[]),a=Oe(o);return(0,Lo.useEffect)(()=>vt.on("register",l=>{let{dragListId:s,acceptDropsFrom:c,orientation:u,shouldAcceptDrop:d}=t(),f=l.getData();if(f.initial&&f.listId!==s&&c?.includes(f.listId)){let p=Mf({domRef:n,orientation:u,dragListId:s,initial:!1,acceptDropsFrom:c,shouldAcceptDrop:d});l.once("unregister",()=>{i(null)}),i(p)}}),[t]),{interactionTarget:o,setInteractionTarget:i,getInteractionTarget:a}}var un=n=>{let e=lt.useRef(null),{dropTargetListId:t,dragSourceListId:o}=on(),{updateDragOperationSourceAndTarget:r,dragItemId:i,status:a}=on(),l=Oe(n.onDrop),s=Oe(n.onAcceptDrop),c=Oe(n.onRemove),u=Oe(n.updatePosition??$y),{interactionTarget:d,setInteractionTarget:f}=Xy(e,n);(0,Lo.useEffect)(()=>{let T=document.querySelector(`[${Pf}="${n.dragListId}"]`);T?e.current=T:console.warn(`DragList with id "${n.dragListId}" not found. You're probably not spreading the domProps to the parent element. Make sure you also include the "className" prop.`)},[n.dragListId]),(0,Lo.useEffect)(()=>{if(d){let T=n.dragListId,C=d.on("start",({dragItem:v,dragSourceListId:D,dropTargetListId:R})=>{r({dragSourceListId:D,dropTargetListId:R,dragItemId:v.id,status:"accepted"})}),w=d.on("move",({offsetsForItems:v,items:D,status:R})=>{if(R==="rejected")return;let x=m(),A=u();D.forEach((M,P)=>{let _=v[P],E=x[P];E&&A({id:M.id,node:E,offset:_})})}),I=d.on("drop",v=>{let{sortedIndexes:D,dragIndex:R,dropIndex:x,dragItem:A,items:M,dragSourceListId:P,dropTargetListId:_,outside:E,status:L}=v,k=m();p.current=[];let V=s(),j=c(),O=l(),F=u();M.forEach((Y,ae)=>{let ye=k[ae];ye&&F({id:Y.id,node:ye,offset:null})}),T===_&&P!==T&&V&&L==="accepted"&&V({dragItemId:A.id,dragSourceListId:P,dropTargetListId:_,dragIndex:R,dropIndex:x,dropItemId:M[x]?.id});let $=null;x===-1&&P===T&&_===T&&E&&($=j),x!==-1&&_===T&&P===T&&($=O),$&&$?.(D,{dragIndex:R,dropIndex:x,dragItemId:M[R].id,dropItemId:M[x]?.id})});return()=>{C(),w(),I()}}},[d,n.dragListId]);let p=lt.useRef([]),m=(0,Lo.useCallback)(()=>{let T=p.current;return(!T||T.length===0)&&(T=Array.from(e.current?.querySelectorAll(Ji)??[]),p.current=T),T},[]),g=(0,Lo.useCallback)(T=>{let C=T.currentTarget,w=C.getAttribute(No);if(w==null){let E=Eo(C,Ji);E&&(w=E.getAttribute(No))}if(w==null){console.warn("Could not find drag item id for element",C,`Make sure you have a parent element with a ${No} attribute`);return}w=`${w}`;let I=null,v=Array.from(e.current?.querySelectorAll(Ji)??[]);p.current=v;let D=Mf({domRef:e,orientation:n.orientation,dragListId:n.dragListId,acceptDropsFrom:n.acceptDropsFrom,initial:!0}),R=D.getData().draggableItems,x=R.findIndex(E=>E.id===w),A=R[x];f(D);let M={left:T.clientX,top:T.clientY},P=E=>{I||(I=vt.startDrag({listId:n.dragListId,dragItem:A,dragIndex:x},M)),I.move({left:E.clientX,top:E.clientY})},_=()=>{if(Ae().removeEventListener("pointermove",P),!I){f(null);return}I.drop(),I=null};Ae().addEventListener("pointermove",P),Ae().addEventListener("pointerup",_,{once:!0})},[n.orientation,n.dragListId,n.acceptDropsFrom,n.removeOnDropOutside]),b=!!i,h=lt.useMemo(()=>({dragItemId:i,onDragItemPointerDown:g,dragSourceListId:o,dropTargetListId:t,status:a,dragListId:n.dragListId,draggingInProgress:b}),[i,g,b,o,t,n.dragListId]),y={className:J("DragList",b?"DragList--dragging":"",Rf({dragging:b})),[Pf]:n.dragListId},S=typeof n.children=="function"?n.children(y,h):n.children;return lt.createElement(xf.Provider,{value:h},S)},Pf="data-drag-list-id",No="data-drag-item-id",Ji=`[${No}]`,Zy=lt.createContext({dragItemId:"",dragListId:"",active:!1,draggingInProgress:!1,dragSourceListId:"",dropTargetListId:""}),Qy=n=>{let{onDragItemPointerDown:e,draggingInProgress:t,dragListId:o,dragItemId:r,dragSourceListId:i,dropTargetListId:a}=Hr(),l=i===o&&r===`${n.id}`,s=lt.useMemo(()=>({dragItemId:n.id,active:l,dragListId:o,draggingInProgress:t,dragSourceListId:i,dropTargetListId:a}),[n.id,l,t,i,a]),c={"data-drag-item-id":`${n.id}`,onPointerDown:e,className:J("DraggableItem",l?"DraggableItem--active":"",vf({active:l,draggingInProgress:t}))},u=typeof n.children=="function"?n.children(c,s):n.children;return lt.createElement(Zy.Provider,{value:s},u)};un.DraggableItem=Qy;var ys=K(require("react")),Af=n=>ys.createElement(ze,{...n,viewBox:"0 -960 960 960"},ys.createElement("path",{d:"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"}));var qr=K(require("react"));function Ef(){return{}}var _f=n=>({allowColumnHideWhileDragging:e=>e??!0});var Of=require("react"),Jy=(0,Of.createContext)(null);function Ss(){return Jy}var Ht=K(require("react"));var pn=K(require("react")),Gt=require("react");var ea=K(require("react"));function eS(n){let{height:e,width:t,count:o}=n;return ea.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 Ff=ea.memo(eS);var Nf="mlx2t3";var ta=K(require("react")),Bf=require("react");var Lf=require("react"),kf=(n,e)=>{(0,Lf.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 zf={true:"_1ueijco2",false:"_1ueijco3",visible:"_1ueijco4",auto:"_1ueijco5",hidden:"_1ueijco6"},Vf={true:"_1ueijco7",false:"_1ueijco8",visible:"_1ueijco9",auto:"_1ueijcoa",hidden:"_1ueijcob"},Gf={true:"_1ueijcoc",false:"_1ueijcod",visible:"_1ueijcoe",auto:"_1ueijcof",hidden:"_1ueijcog"},Ts="_1ueijco1",Hf="_1ueijco0 _16lm1iw0";var Kf=n=>{let e="";return typeof n=="boolean"||typeof n=="string"?e=zf[`${n}`]:e=J(Vf[`${n.horizontal}`],Gf[`${n.vertical}`]),e};var tS="InfiniteVirtualScrollContainer";var Wf=ta.forwardRef(function(e,t){let{children:o,scrollable:r=!0,onContainerScroll:i,className:a,tabIndex:l,style:s,autoFocus:c}=e,u=t??(0,Bf.useRef)(null);return kf(u,i),ta.createElement("div",{ref:u,style:s,autoFocus:c,tabIndex:l,className:J(a,tS,Hf,Kf(r))},o)});var ua=K(require("react")),Yn=require("react");var jf=K(require("react")),Cs=require("react-dom"),Wn=require("react"),oS=()=>!1;function nS(n){let[e,t]=(0,Wn.useState)(n.updater.get),o=(0,Wn.useRef)(null),r=n.shouldFlushSync??oS;return(0,Wn.useLayoutEffect)(()=>{function i(l){let s=r();n.useraf?(o.current!=null&&cancelAnimationFrame(o.current),o.current=requestAnimationFrame(()=>{s?queueMicrotask(()=>{(0,Cs.flushSync)(()=>{t(l)})}):t(l)})):s?queueMicrotask(()=>{(0,Cs.flushSync)(()=>{t(l)})}):t(l)}let a=n.updater.onChange(i);return()=>{o.current!=null&&cancelAnimationFrame(o.current),a()}},[n.updater,n.useraf,r]),e??null}var ko=jf.memo(nS);var $f=K(Jo());var ws=(n,e)=>n-e,uo={horizontal:!0,vertical:!0};function oa(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 Is="DebugID=";function zo(n,e){return e&&e.startsWith(Is)?e:e?`${Is}${n}:${e}`:`${Is}${n}`}var na={start:0,end:0},Rs=n=>{n()},vs=n=>{let{start:e,end:t}=n,[o,r]=e,[i,a]=t,l=i-o,s=a-r;return l*s},Uf=n=>{let{start:e,end:t}=n,[o]=e,[r]=t;return r-o},Kr=typeof window<"u"?requestAnimationFrame:n=>setTimeout(n,0);function rS(n){return n.horizontalChange||n.verticalChange}var dn=class extends bt{constructor(t){let o=zo(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=na;this.verticalExtendRangeBy=na;this.horizontalRenderRange={startIndex:0,endIndex:0};this.verticalRenderRange={startIndex:0,endIndex:0};this.extraSpanCells=[];this.scrollPosition={scrollLeft:0,scrollTop:0};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.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=>{Kr(()=>{this.destroyed||t.has(r)&&r(o)})})};this.notifyVerticalRenderRangeChange=(t=!1)=>{if(this.destroyed)return;let o=this.onVerticalRenderRangeChangeFns,r=this.verticalRenderRange,i=t?Rs:Kr;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?Rs:Kr;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=uo)=>{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=uo)=>{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 f=l;for(;d[f]!=f;)f--;a.push([f,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 f=l;for(;d[f]!=f;)f--;a.push([u,f])}}}return a};this.computeRenderRange=(t=uo)=>{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,f=c.end||0;s||(d+=this.RENDER_COUNT_SAFETY_MARGIN_START,f+=this.RENDER_COUNT_SAFETY_MARGIN_END),d&&(u=Math.max(0,u-d),r+=d),f&&(r+=f);let p=u+r,m=Math.max(a,i-(t==="horizontal"?this.fixedColsEnd:this.fixedRowsEnd));return p>m&&(p=m,u=Math.max(a,p-r)),{startIndex:u,endIndex:p}};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 f=(0,$f.default)(a,t,ws);return f>=0?f:~f-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),f=u.get(a);if(d[i]===void 0){let p=d.length,m=l?Math.min(i,l-1):0,g={rowIndex:t,colIndex:o};for(;p<=m;p++)if(d[p]===void 0){g[r==="horizontal"?"colIndex":"rowIndex"]=p;let b=s(g);d[p]=p,f[p]=b;let h=p;for(;b>1;)h+=1,d[h]=p,f[h]=0,b-=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=vs;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=uo){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",f=u&&s!==this.availableWidth,p=d&&c!==this.availableHeight;f&&(this.availableWidth=s,this.availableRenderWidth=s),p&&(this.availableHeight=c,this.availableRenderHeight=c),(f||p)&&this.notifyAvailableSizeChange();let m=typeof r=="number",g=typeof i=="number",b=m&&r!==this.rows,h=g&&i!==this.cols;m&&(this.rows=r,this.rowsPerPage=r),g&&(this.cols=i);let y=a!=null,S=l!=null,T=y&&a!==this.rowHeight,C=S&&l!==this.colWidth;y&&(this.rowHeight=a),S&&(this.colWidth=l);let w=t.rowspan!=null,I=t.colspan!=null,v=w&&t.rowspan!=this.rowspan,D=I&&t.colspan!=this.colspan;v&&(this.rowspan=t.rowspan),D&&(this.colspan=t.colspan);let R=h||C||f||D,x=b||T||p||v;(o||rS)({horizontalChange:R,verticalChange:x,colsChanged:h,colWidthChanged:C,widthChanged:f,colspanChanged:D,rowsChanged:b,rowHeightChanged:T,heightChanged:p,rowspanChanged:v})&&this.updateRenderCount({horizontal:R,vertical:x})}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=uo){this.reset(t),this.doUpdateRenderCount(t)}doUpdateRenderCount(t=uo){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)&&(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?Rs:Kr;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,f=r;d+=s,f-=c;for(let p=d;p<f;p++)u.push(this.getItemSize(p,t));a=oa(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=>{Kr(()=>{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=na,this.verticalExtendRangeBy=na,this.destroyed=!0,this.onDestroyFns=[],this.onScrollFns=[],this.onScrollStartFns=[],this.onScrollStopFns=[],this.onRenderCountChangeFns.clear(),this.onRenderRangeChangeFns.clear(),this.onVerticalRenderRangeChangeFns.clear(),this.onHorizontalRenderRangeChangeFns.clear())}};var Ps=K(Jo());function Yf(...n){if(!n.length)return new Set;let[e,...t]=n;return new Set([...e].filter(o=>t.every(r=>r.has(o))))}function qf(n,e){let t=new Set;for(let o of n)e(o)&&t.add(o);return t}function Br(n,e){for(let t of n)if(e(t))return t}var Zf=K(require("react"));var Xf=new Map,iS=()=>{},Ds=class{constructor(e,t){this.element=null;this.mounted=!1;this.IS_UPDATED_WHILE_SCROLLING_IN_HORIZONTAL_LAYOUT=!1;this.mountSubscription=Se();this.isUpdatedWhileScrolling=()=>this.IS_UPDATED_WHILE_SCROLLING_IN_HORIZONTAL_LAYOUT;let o=Xf.get(e)??0,r=`${e}:GridCellReact:${o}`;Xf.set(e,o+1),this.debugId=r,this.cellInfo=t,this.updater=Se(),this.node=Zf.createElement(ko,{key:r,name:r,updater:this.updater,shouldFlushSync:this.isUpdatedWhileScrolling}),this.ref=i=>{this.element=i,i?(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=iS,this.element=null,this.node=null}getNode(){return this.node}update(e,t,o){this.IS_UPDATED_WHILE_SCROLLING_IN_HORIZONTAL_LAYOUT=o?o.scrolling&&o.isHorizontalLayout:!1,this.updater(e),this.cellInfo=t}getAdditionalInfo(){return this.cellInfo}getElement(){return this.element}},jn=class jn extends bt{constructor(t){super(`${t}:GridCellPoolForReact`);this.debugId=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=new Ds(this.debugId);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+=jn.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}set poolSize(t){t=Math.ceil(t/jn.POOL_SIZE_INCREMENT)*jn.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--}};jn.POOL_SIZE_INCREMENT=1;var ra=jn;var ia=(n,e)=>n-e,aa=class extends bt{constructor(t){super(`${t}:GridCellManager`);this.matrix=new ee;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[f,p]=d,m=f<i,g=f>=l,b=p<a,h=p>=s;(m||g||b||h)&&c.add(u)}),c};this.debugId=t,this.pool=new ra(t),this.offRemoveCell=this.pool.onRemoveCell(o=>this.onRemoveCell(o))}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,a){let l=this.getCellAt(r);return l&&l!==o&&this.detachCellAt(r),this.pool.attachCell(o),this.setCellPositionInMatrix(o,r),o.update(t,i,a),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=Br(l,s=>!this.isCellAttached(s)))}if(o==="column"){let l=this.columnsWithCellsHistory.get(a);l&&(r=Br(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(ia)}getColumnsWithCells(){let t=this.matrix.getKeysOfFirstChildOnEachBranchStartingWith([],{excludeSelf:!0});return[...new Set(t.map(r=>r[1])).values()].sort(ia)}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,Ps.default)(o,t,ia);r<0&&(r=~r),o.slice(r).forEach(a=>this.detachRow(a))}detachColsStartingWith(t){let o=this.getColumnsWithCells().sort(),r=(0,Ps.default)(o,t,ia);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 Br(t,r=>this.getCellPosition(r)?.[0]===o)}getCellFromListForColumn(t,o){return Br(t,r=>this.getCellPosition(r)?.[1]===o)}getCellCountInMatrix(){return this.matrix.size}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 ep=K(Jo());var Jf=K(require("react"));var Qf=new Map,aS=()=>{},xs=class{constructor(e){this.element=null;this.mounted=!1;this.mountSubscription=Se();let t=Qf.get(e)??0,o=`${e}:ListRowReact:${t}`;Qf.set(e,t+1),this.debugId=o,this.updater=Se(),this.node=Jf.createElement(ko,{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=aS,this.element=null,this.node=null}getNode(){return this.node}update(e){this.updater(e)}getElement(){return this.element}},$n=class $n extends bt{constructor(t){super(`${t}:ListRowPoolForReact`);this.debugId=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=new xs(this.debugId);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+=$n.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/$n.POOL_SIZE_INCREMENT)*$n.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--}};$n.POOL_SIZE_INCREMENT=1;var la=$n;var sa=class extends bt{constructor(t){super(`${t}:ListRowManager`);this.indexToRow=new Map;this.rowToIndex=new WeakMap;this.debugId=t,this.pool=new la(t),this.offRemoveRow=this.pool.onRemoveRow(o=>this.onRemoveRow(o))}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,ep.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 tp=!0,fn=Q(q.y),op=Q(q.scrollTop),AE=Q(q.columnOffsetAtIndex),As=Q(q.columnOffsetAtIndexWhileReordering),Ms={scrolling:!1,isHorizontalLayout:!1},Un=class extends bt{constructor(t,o){o=o||"ReactHeadlessTableRenderer";super(o);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,o,{y:r,scrollTop:i,scrollLeft:a})=>{t.style.setProperty(fn,i?`calc( ${r}px + var(${op}) )`:`${r}px`),t.style.transform=`translate3d(${a||0}px, var(${fn}), 0)`};this.setTransform=(t,o,r,{x:i,y:a,scrollLeft:l,scrollTop:s},c)=>{let u=Ie.columnOffsets.get(r),d=`${As}-${r}`,f=s?`calc( ${a}px + var(${op}) )`:`${a}px`;t.__currentTransformY!==f&&(t.__currentTransformY=f,t.style.setProperty(fn,f));let p=`translate3d(var(${d}, ${u}), var(${fn}), 0)`;t.__transformValue!==p&&(t.__transformValue=p,t.style.transform=p),c!=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(),f=r.getFixedEndRowsHeight(),p=i.scrollTop,m=r.getAvailableSize();if(!m.height)return null;let g=p+m.height;l||(l=c>g-f?"end":c<p+d?"start":"end");let b=i.scrollTop;if(l==="center"?b=c-Math.floor((r.getAvailableSize().height-d-f)/2):l==="start"?(s=-s,b+=c-p+s-d):(s+=u,b+=c-g+s+f),this.brain.isHorizontalLayoutBrain){let h=o.colIndex??Math.ceil(this.brain.getInitialCols()/2),y=this.getScrollPositionForScrollColumnIntoView(h,{...o,horizontalLayoutPageIndex:this.brain.getPageIndexForRow(t)});y&&(a=y.scrollLeft)}return{scrollLeft:a,scrollTop:b}};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(),f=r.getFixedStartColsWidth(),p=i.scrollLeft,m=r.getAvailableSize();if(!m.width)return null;let g=p+m.width;l||(l=c>g-f?"end":c<p+d?"start":"end");let b=i.scrollLeft;return l==="center"?b=c-Math.floor((r.getAvailableSize().width-d-f)/2):l==="start"?(s=-s,b+=c-p+s-d):(s+=u,b+=c-g+s+f),{...i,scrollLeft:b}};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,f]=c,[p,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:[p,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:[p,l]})),o){let b={start:[0,f],end:[o,m],rowFixed:"start",colFixed:!1};g.push(b)}if(r){let b={rowFixed:"end",colFixed:!1,start:[s-r,f],end:[s,m]};g.push(b)}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,f=!1;if(t<r&&(u=!0,f="start"),i&&!u){let p=c-i;t>=p&&(u=!0,f="end")}if(o<a&&(d=!0,f="start"),l&&!d){let p=s-l;o>=p&&(d=!0,f="end")}return{row:u?f:!1,col:d?f:!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=Number(t.currentTarget.dataset.rowIndex);this.onMouseEnter(o)};this.onMouseLeaveNotBound=t=>{let o=Number(t.currentTarget.dataset.rowIndex);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))};Ve(()=>{this.destroyed||(o(),this.hoverRowUpdatesInProgress.delete(t))})};this.updateElementPosition=(t,o)=>{if(this.destroyed)return;let r=t.getElement(),i=this.cellManager.getCellPosition(t);if(!i)return;let[a,l]=i,s=this.brain.getCellOffset(a,l);if(s==null)return;let{x:c,y:u}=s;if(r){this.updateHoverClassNamesForRow(a);let d=this.getCellRealCoordinates(a,l);if(r.dataset.rowIndex=d.rowIndex,r.dataset.colIndex=d.colIndex,tp){this.setTransform(r,a,l,{x:c,y:u},null),r.style.willChange="transform",r.style.backfaceVisibility="hidden";let p=(o?o.hidden:!!this.isCellCovered(a,l))?"-1":r.dataset.zIndex||"auto";r.__zIndex!==p&&(r.__zIndex=p,r.style.zIndex=p)}else r.style.display="",r.style.left=`${c}px`,r.style.top=`${u}px`}};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,tp&&(this.setDetailTransform(o,r,{y:a,scrollLeft:this.brain.getScrollPosition().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.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(P=>{let _=i.getRowIndex(P);if(_!=null){let E=this.brain.getItemOffsetFor(_,"vertical");if(E==null)return;let L=P.getElement();if(!L)return;this.setDetailTransform(L,_,{y:E,scrollLeft:t.scrollLeft})}}),!s&&!c&&!u&&!d)return;let f=this.cellManager.getOneAttachedCell();f&&pd(t,this.getInfiniteNode(f.getElement()));let p=this.brain.getFixedEndColsOffsets({skipScroll:!0}),m=this.brain.getFixedEndRowsOffsets({skipScroll:!0}),{start:g,end:b}=this.brain.getRenderRange(),[h,y]=g,[S,T]=b;function C(P,_,E){let L=r.getCellAt([P,_]);if(L==null)return;let k=o.getCellOffset(P,_),V=L.getElement();V&&k&&E(P,_,V,k)}let w=(P,_,E,{x:L,y:k})=>{this.setTransform(E,P,_,{x:L,y:k,scrollLeft:!0},s-_)},I=(P,_,E,L)=>{this.setTransform(E,P,_,{x:L.x,y:L.y,scrollTop:!0},u-P)},v=(P,_,E,{y:L})=>{let k=p[_];this.setTransform(E,P,_,{x:k,y:L,scrollLeft:!0},a-_)},D=(P,_,E,L)=>{this.setTransform(E,P,_,{x:L.x,y:m[P],scrollTop:!0},l-P)},R=(P,_,E,{x:L,y:k})=>{this.setTransform(E,P,_,{x:L,scrollLeft:!0,y:k,scrollTop:!0},1e5)},x=(P,_,E,{x:L})=>{this.setTransform(E,P,_,{x:L,scrollLeft:!0,y:m[P],scrollTop:!0},2e5)},A=(P,_,E,L)=>{this.setTransform(E,P,_,{x:p[_],y:L.y,scrollLeft:!0,scrollTop:!0},3e5)},M=(P,_,E)=>{this.setTransform(E,P,_,{x:p[_],y:m[P],scrollLeft:!0,scrollTop:!0},4e5)};if(s||c)for(let P=h;P<S;P++){for(let _=0;_<s;_++)C(P,_,w);if(c){let _=a-c;for(let E=_;E<a;E++)C(P,E,v)}}if(u||d)for(let P=y;P<T;P++){for(let _=0;_<u;_++)C(_,P,I);if(d){let _=l-d;for(let E=_;E<l;E++)C(E,P,D)}}if(s&&u)for(let P=0;P<u;P++)for(let _=0;_<s;_++)C(P,_,R);if(s&&d){let P=l-d;for(let _=P;_<l;_++)for(let E=0;E<s;E++)C(_,E,x)}if(c&&u){let P=a-c;for(let _=0;_<u;_++)for(let E=P;E<a;E++)C(_,E,A)}if(c&&d){let P=l-d,_=a-c;for(let E=P;E<l;E++)for(let L=_;L<a;L++)C(E,L,M)}};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 aa(o),this.cellManager.onCellAttachmentChange((s,c)=>{c?this.onCellAttached(s):this.onCellDetached(s)}),this.rowManager=new sa(o),this.rowManager.onRowAttachmentChange((s,c)=>{c?this.onRowAttached(s):this.onRowDetached(s)}),this.renderRange=this.renderRange.bind(this);let r=t.onScroll(this.adjustFixedElementsOnScroll),i=t.onAvailableSizeChange(()=>{this.adjustFixedElementsOnScroll(),Ve(()=>{this.destroyed||this.adjustFixedElementsOnScroll()})}),a=t.onScrollStart(this.onScrollStart),l=t.onScrollStop(this.onScrollStop);this.onDestroy=()=>{r(),i(),a(),l()}}getInfiniteNode(t){return this.infiniteNode||(this.infiniteNode=Zl(t)),this.infiniteNode}onCellAttached(t){if(this.cellDetachedClassNames.length){let o=t.getElement();o&&this.cellDetachedClassNames.forEach(r=>{o.classList.remove(r)})}}onCellDetached(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,{renderCell:o,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,f=this.getFixedRanges(t),p=[t,...f],m=this.brain.getAlwaysRenderedColumns();if(m.length>0){let R=t.start[1],x=t.end[1];m.forEach(A=>{R<=A&&A<x||p.push({start:[t.start[0],A],end:[t.end[0],A+1]})})}let g=new Map,b=p.map(this.getExtraSpanCellsForRange).flat();b&&b.forEach(([R,x])=>{g.set(`${R}:${x}`,!0)});let h=p.reduce((R,x)=>R+vs(x),0),y=r?p.reduce((R,x)=>R+Uf(x),0):0,S=this.brain.getRowCount(),T=this.brain.getColCount();d.detachCellsStartingAt([S,T]);let C=Math.min(S*T,h);r&&(u.detachStartingWith(this.brain.getRowCount()),u.poolSize>y&&(u.poolSize=y));let w=Yf(...p.map(R=>d.getCellsOutsideRenderRange(R)));w=qf(w,R=>{let x=d.getCellPosition(R);return!(x&&g.has(`${x[0]}:${x[1]}`))}),d.detachCells(w),d.poolSize=C;let I=new Map,v=new Map;p.forEach(R=>{let{start:x,end:A}=R,[M,P]=x,[_,E]=A;for(let L=M;L<_;L++){for(let V=P;V<E;V++){let j=`${L}:${V}`;if(I.has(j))continue;I.set(j,!0);let{rendered:O,mapped:F}=this.isCellRenderedAndMappedCorrectly(L,V);if(L===M||V===P){let $=this.isCellCovered(L,V);if($&&g.has(`${$[0]}:${$[1]}`)){let Y=d.getCellAt([L,V]);Y!=null&&d.detachCell(Y);continue}}if(O&&!i&&F)continue;let te;O?te=d.getCellAt([L,V]):te=d.getCellFor([L,V],c?"row":"column"),te==null&&(te=d.getDetachedCell()),this.renderCellAt(L,V,te,o)}!r||v.has(L)||(v.set(L,!0),u.isRowAttachedAt(L)&&!i)||this.renderDetailRowAtElement(L,this.rowManager.getRowFor(L),r)}}),b.forEach(([R,x])=>{let{rendered:A,mapped:M}=this.isCellRenderedAndMappedCorrectly(R,x);if(A){if(i||!M){let _=[R,x],E=d.getCellAt(_);this.renderCellAt(R,x,E,o)}return}let P=d.getCellFor([R,x],c?"row":"column");P!=null&&this.renderCellAt(R,x,P,o)});let D=d.getAllCells().map(R=>R.getNode());return r&&u.getAllRows().forEach(R=>{D.push(R.getNode())}),this.adjustFixedElementsOnScroll(),a&&a(D),D}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}}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),f=u===1?s:this.brain.getColWidthWithSpan(t,o,u),{row:p,col:m}=this.isCellFixed(t,o),g=!!a,{rowIndex:b,colIndex:h}=this.getCellRealCoordinates(t,o),y=i({rowIndex:b,colIndex:h,height:l,width:s,rowspan:c,colspan:u,rowFixed:p,colFixed:m,hidden:g,heightWithRowspan:d,widthWithColspan:f,onMouseEnter:this.onMouseEnterNotBound,onMouseLeave:this.onMouseLeaveNotBound,domRef:r.ref});r.isMounted()||r.onMount(C=>{let w=C.getElement();w&&(w.style.position="absolute",w.style.left="0px",w.style.top="0px"),this.updateElementPosition(C)});let S=this.brain.isHorizontalLayoutBrain?{renderRowIndex:b,renderColIndex:h}:void 0,T=this.brain.isHorizontalLayoutBrain;if(!y){T?this.cellManager.detachCell(r):this.cellManager.detachCell(r);return}Ms.scrolling=this.scrolling,Ms.isHorizontalLayout=T,this.cellManager.renderNodeAtCell(y,r,[t,o],S,Ms),this.updateElementPosition(r,{hidden:g,rowspan:c,colspan:u})}reset(){this.cellManager.reset(),this.rowManager.reset()}};var ca=class extends Un{constructor(t,o){super(t,o);this.setTransform=(t,o,r,i,a)=>{let l=this.getCellRealCoordinates(o,r),{y:s}=i,c=Math.floor(l.rowIndex/this.brain.rowsPerPage),u=me.runtime.totalVisibleColumnsWidthVar,d=c?`calc(${u} * ${c})`:"0px",f=Ie.columnOffsets.get(l.colIndex),p=`${As}-${l.colIndex}`,m=`${s}px`;t.__currentTransformY!==m&&(t.__currentTransformY=m,t.style.setProperty(fn,m));let g=`calc(var(${p}, ${f}) + ${d})`,b=`var(${fn})`,h=`translate3d(${g}, ${b}, 0px)`;t.__transformValue!==h&&(t.__transformValue=h,t.style.transform=h)};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}}};function Wr(n){let e=n.isHorizontalLayoutBrain?new ca(n,`${n.name}:HorizontalLayoutTableRenderer`):new Un(n,`${n.name}:ReactHeadlessTableRenderer`),t=Se();return n.onDestroy(()=>{e.destroy(),t.destroy()}),{renderer:e,onRenderUpdater:t}}function lS(n){let{brain:e,renderCell:t,renderDetailRow:o,forceRerenderTimestamp:r}=n,{renderer:i,onRenderUpdater:a}=(0,Yn.useMemo)(()=>n.onRenderUpdater&&n.renderer?{renderer:n.renderer,onRenderUpdater:n.onRenderUpdater}:Wr(e),[e,n.onRenderUpdater,n.renderer]);return(0,Yn.useLayoutEffect)(()=>{i.cellHoverClassNames=n.cellHoverClassNames||[]},[i,n.cellHoverClassNames]),(0,Yn.useLayoutEffect)(()=>{i.cellDetachedClassNames=n.cellDetachedClassNames||[]},[i,n.cellDetachedClassNames]),(0,Yn.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]),ua.createElement(ko,{updater:a})}var da=ua.memo(lS);var jr=K(require("react")),qn=require("react");var np=he({defaultClassName:"nxbq1c1 _16lm1iwz _16lm1iw2",variantClassNames:{visible:{true:"nxbq1c3",false:"nxbq1c4"}},defaultVariants:{},compoundVariants:[]}),fa="nxbq1c0 _16lm1iwz _16lm1iw4 _16lm1iw26 _16lm1iw23 _16lm1iw1y _16lm1iw1k";var rp=he({defaultClassName:"j26lrx0 _16lm1iwz _16lm1iw2 _16lm1iw23 _16lm1iw26",variantClassNames:{active:{true:"j26lrx2",false:"j26lrx3"}},defaultVariants:{},compoundVariants:[]});var{rootClassName:sS}=ke,cS=`${sS}-ActiveRowIndicator`,uS=`calc(${q.activeCellRowOffsetX} + var(${Q(q.scrollLeftForActiveRowWhenHorizontalLayout)}, 0px))`,dS={[Q(q.activeCellOffsetY)]:q.activeCellRowOffset,transform:`translate3d(${uS}, calc( ${q.activeCellOffsetY} + var(${Q(q.scrollTopForActiveRow)}, 0px)), 0px)`,height:q.activeCellRowHeight,maxWidth:me.runtime.totalVisibleColumnsWidthVar},fS=n=>{let{brain:e}=n,t=(0,qn.useRef)(null),o=n.activeRowIndex!=null&&e.getInitialRows()>n.activeRowIndex,[r,i]=Ut();return(0,qn.useLayoutEffect)(()=>{if(n.activeRowIndex==null)return;let a="0px",l=n.activeRowIndex;if(e.isHorizontalLayoutBrain&&e.rowsPerPage){let f=e.getPageIndexForRow(l);f>0&&(a=`calc(${me.runtime.totalVisibleColumnsWidthVar} * ${f})`),l=l%e.rowsPerPage}let s=e.getRowHeight(l),c=e.getItemOffsetFor(l,"vertical"),u=t.current,d={activeCellRowHeight:`${s}px`,activeCellRowOffset:`${c}px`,activeCellRowOffsetX:a};Nn(d,u)},[n.activeRowIndex,e]),(0,qn.useEffect)(()=>{let a=c=>{Nn({scrollTopForActiveRow:`${-c.scrollTop}px`,scrollLeftForActiveRowWhenHorizontalLayout:e.isHorizontalLayoutBrain?`${-c.scrollLeft}px`:"0px"},t.current)};a(e.getScrollPosition());let l=e.onScroll(a),s=e.onRenderCountChange(i);return()=>{s(),l()}},[e]),jr.createElement("div",{className:fa,"data-name":"active-row"},jr.createElement("div",{ref:t,"data-name":"active-row-indicator",className:`${cS} ${rp({active:o})}`,style:o?dS:void 0}))},ip=jr.memo(fS);var $r=K(require("react")),Xn=require("react");var{rootClassName:pS}=ke,mS=`${pS}-ActiveCellIndicator`,gS=Q(q.columnZIndexAtIndex),hS=(n,e,t,o)=>{if(e==null)return;let[r]=e;n.isHorizontalLayoutBrain&&n.rowsPerPage&&(r=r%n.rowsPerPage);let i=typeof t=="function"?t(r):t??n.getRowHeight(r),a=n.getItemOffsetFor(r,"vertical"),l=o.current;Nn({activeCellRowHeight:`${i}px`,activeCellRowOffset:`${a}px`},l)},bS=n=>{let{brain:e}=n,[t,o]=Ut(),r=(0,Xn.useRef)(null),i=n.activeCellIndex!=null&&e.getInitialRows()>n.activeCellIndex[0];return(0,Xn.useLayoutEffect)(()=>{hS(e,n.activeCellIndex,n.rowHeight,r)},[n.activeCellIndex,n.rowHeight,e]),(0,Xn.useEffect)(()=>{let a=e.onRenderCountChange(()=>{o()});return()=>{a()}},[e]),$r.createElement("div",{className:fa,ref:r,"data-name":"active-cell",style:i?{zIndex:`var(${gS}-${n.activeCellIndex[1]})`}:void 0},$r.createElement("div",{"data-name":"active-cell-indicator",className:`${mS} ${np({visible:i})}`}))},ap=$r.memo(bS);var pa=[lf,`${mt}DetachedCell`];function ma(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 yS=J(Nf,Ts);function lp(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:f,forceRerenderTimestamp:p,scrollVarHostRef:m,...g}=n,{autoFocus:b}=g,h=(0,Gt.useRef)(null),[y,S]=(0,Gt.useState)({width:0,height:0});(0,Gt.useEffect)(()=>{o!=null&&e.setScrollStopDelay(o)},[o,e]),(0,Gt.useEffect)(()=>{let w=h.current?.parentNode;return w?(b&&document.activeElement!==w&&w.focus(),wr(w,()=>{let D={height:w.clientHeight,width:w.clientWidth};e.update(D)},{debounce:50})):void 0},[f,e]);let T=(0,Gt.useCallback)(w=>{requestAnimationFrame(()=>{h.current&&h.current.style.setProperty("transform",`translate3d(${-w.scrollLeft}px, ${-w.scrollTop}px, 0px)`)})},[]),C=(0,Gt.useCallback)(w=>{e.setScrollPosition(w,T)},[e,T]);return(0,Gt.useEffect)(()=>{let w=e.onRenderCountChange(()=>{S(e.getVirtualizedContentSize())});return S(e.getVirtualizedContentSize()),T(e.getScrollPosition()||{scrollLeft:0,scrollTop:0}),w},[e]),pn.createElement(Wf,{onContainerScroll:C,...g,ref:t},pn.createElement("div",{ref:h,className:yS,"data-name":"scroll-transform-target"},pn.createElement(da,{forceRerenderTimestamp:p,renderer:s,onRenderUpdater:d,renderCell:r,renderDetailRow:i,brain:e,cellHoverClassNames:l,cellDetachedClassNames:pa}),u!=null?pn.createElement(ap,{brain:e,rowHeight:a,activeCellIndex:u}):null),c!=null?pn.createElement(ip,{brain:e,activeRowIndex:c}):null,pn.createElement(Ff,{width:y.width,height:y.height}))}function sp(n,e,t,o){let r=new Map,i=new Map,a=new Map;n.forEach((u,d)=>{let f=u.id,p=n[d-1],m=p?.id??"",g=new Set,b=p?.computedPinned!==u.computedPinned?new Set:a.get(m)??new Set;a.set(f,g);let h={type:"column",id:f,ref:u,groupOffset:0,computedPinned:u.computedPinned,computedWidth:u.computedWidth,depth:u.columnGroup?(t.get(u.columnGroup)??0)+1:0};r.set([f],h);let y=u.columnGroup,S,T=h;for(;y;){let C=e[y];if(C){g.add(y);let w=[f,...g];S=b.has(y)?i.get(y):void 0,S||(S={id:y,type:"group",ref:C,columnItems:[],children:[],groupOffset:0,uniqueGroupId:[y],computedWidth:0,computedPinned:h.computedPinned,depth:t.get(y)??0},r.set(w,S),i.set(y,S)),S.columnItems.push(h),S.uniqueGroupId.push(h.id),T&&!b.has(T.id)&&S.children.push(T),T=S,y=C.columnGroup}else break}});let l=[],s=new ee,c=0;return r.forEach(u=>{if(!u.ref.columnGroup){let d=u.type==="column"?u.ref.computedWidth:u.columnItems.reduce((f,p)=>f+p.ref.computedWidth,0);u.groupOffset=c,u.computedWidth=d,u.type==="group"&&cp(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 cp(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"&&cp(t.children),e+=o})}var Vo=K(require("react")),fo=require("react");var _s=K(require("react"));var dp=K(require("react")),Es=require("react");var Ur=require("react"),Yr=K(require("react"));var{rootClassName:SS}=ke,TS=`${SS}HeaderCell_ResizeHandle`;function CS(n){let e=(0,Ur.useRef)(null),[t,o]=(0,Ur.useState)(!1),r=(0,Ur.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 f=d.pointerId,p=d.clientX,m=d.target;m.setPointerCapture(f);let g=!0,b=Tf(n.groupColumns.map(T=>T.computedVisibleIndex),{columns:n.columns,domRef:e}),h=T=>{a==="end"&&(T*=-1);let{constrained:C,adjustedDiffs:w,adjustedDiff:I}=n.computeResize(T);return r.current!==C&&o(C),b.resize(w),I},y=T=>{if(g){let C=n.groupColumns.reduce((v,D)=>v+D.computedWidth-D.computedMinWidth,0),w=n.brain.getAvailableSize(),I={width:w.width+C,height:w.height};n.brain.update(I),g=!1}h(Math.round(T.clientX-p))},S=T=>{m.releasePointerCapture(f),m.removeEventListener("pointermove",y),m.removeEventListener("pointerup",S);let C=Math.round(T.clientX-p),w=h(C);n.onResize(w)};m.addEventListener("pointermove",y),m.addEventListener("pointerup",S)},u=(a===!1||a==="start")&&s?{right:a==="start"?void 0:me.components.HeaderCell.resizeHandleWidth}:a==="end"&&l?{right:void 0}:void 0;return Yr.createElement("div",{ref:e,className:`${TS} ${qi} ${Zi({computedPinned:a,computedFirstInCategory:l,computedLastInCategory:s})}`,onPointerDown:c},Yr.createElement("div",{style:{...u,...n.style},className:Xi({constrained:t})}))}var up=Yr.memo(CS);function fp(n,e){let{bodyBrain:t,groupHeight:o,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=n[n.length-1],d=(0,Es.useCallback)(g=>{let b=l(),{columnSizing:h,viewportReservedWidth:y,bodySize:S}=b,T=s().computedVisibleColumns,C=!1,w=T.reduce((D,R)=>(R.computedFlex&&(D[R.id]={...h[R.id],flex:R.computedWidth},C=!0),D),{}),I=C?{...h,...w}:h;return Yu({availableSize:S.width,reservedWidth:y||0,dragHandleOffset:g,dragHandlePositionAfter:u.computedVisibleIndex,columnSizing:I,columnGroupSize:n.length,items:T.map(D=>({id:D.id,resizable:D.computedResizable,computedFlex:D.computedFlex,computedWidth:D.computedWidth,computedMinWidth:D.computedMinWidth,computedMaxWidth:D.computedMaxWidth}))})},[u]),f=(0,Es.useCallback)(g=>{let{columnSizing:b,reservedWidth:h}=d(g);c.viewportReservedWidth=h,c.columnSizing=b},[d]);return n.some(g=>g.computedResizable)?dp.createElement(up,{brain:t,style:{height:o*(i-r.depth+2)},columns:a,groupColumns:n,computeResize:d,onResize:f}):null}var pp=`${mt}HeaderGroup`,mp=Q(q.columnWidthAtIndex),wS=Q(q.columnZIndexAtIndex);function gp(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=fp(o,{bodyBrain:r,groupHeight:t,columnGroup:e,columnGroupsMaxDepth:i}),c=o[0],u=o.length>1?"calc( "+o.map(p=>`var(${mp}-${p.computedVisibleIndex})`).join(" + ")+" )":`var(${mp}-${c.computedVisibleIndex})`,d=`calc(var(${wS}-${c.computedVisibleIndex}) + ${i-e.depth})`,f=typeof l=="function"?l({columnGroup:e,horizontalLayoutPageIndex:n.horizontalLayoutPageIndex}):l;return f=f&&typeof f=="object"?f:{},f.width=u,f.height=t,_s.createElement("div",{ref:n.domRef,"data-group-id":e.uniqueGroupId,className:J(Vu,pp),style:f,"data-z-index":d},_s.createElement("div",{className:J(`${pp}__header-content`,Yt)},a),s)}var hp=require("react");var Ns=K(require("react")),Os;function Ls(){return Os||(Os=Ns.createContext({dataSourceApi:null,getDataSourceState:()=>null,assignState:()=>null,getDataSourceMasterContext:()=>{},dataSourceState:null,dataSourceActions:null}))}var Fs;function ga(){return Fs||(Fs=Ns.createContext(null))}function Fe(n){let e=ga(),t=(0,hp.useContext)(e);return vn(t,n)}function Qt(){return Fe(n=>({getDataSourceState:n.getDataSourceState,getDataSourceMasterContext:n.getDataSourceMasterContext,dataSourceActions:n.dataSourceActions,dataSourceApi:n.dataSourceApi,assignState:n.assignState}))}var{rootClassName:IS}=ke,RS=[],bp=`${IS}Header`,vS=Fu({overflow:!1}),yp=()=>{};function DS(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:f,showColumnFilters:p,computedColumnsMap:m}=oe(A=>({computedColumnsMap:A.computed.computedColumnsMap,getState:A.getState,headerOptions:A.state.headerOptions,headerRenderer:A.state.headerRenderer,headerOnRenderUpdater:A.state.headerOnRenderUpdater,showColumnFilters:A.state.showColumnFilters})),g=(0,fo.useRef)(null),b=(0,fo.useCallback)(A=>{g.current&&(g.current.style.transform=`translate3d(-${A.scrollLeft}px, 0px, 0px)`)},[]);(0,fo.useEffect)(()=>{let A=t.onScroll(b);return b(t.getScrollPosition()||{scrollLeft:0,scrollTop:0}),A},[t]);let h={ref:g,className:J(bp,`${bp}--virtualized`,i,vS),style:{...r,height:a}},{getDataSourceState:y,dataSourceApi:S,dataSourceActions:T}=Qt(),{allRowsSelected:C,someRowsSelected:w,selectionMode:I,filterTypes:v,filterDelay:D}=Fe(A=>({allRowsSelected:A.dataSourceState.allRowsSelected,someRowsSelected:A.dataSourceState.someRowsSelected,selectionMode:A.dataSourceState.selectionMode,filterTypes:A.dataSourceState.filterTypes,filterDelay:A.dataSourceState.filterDelay})),R=(0,fo.useMemo)(()=>({allRowsSelected:C,someRowsSelected:w,selectionMode:I}),[C,w,I]),x=(0,fo.useCallback)(A=>{let{rowIndex:M,colIndex:P,domRef:_,height:E,widthWithColspan:L,heightWithRowspan:k,hidden:V}=A,j=o[P];if(!j||V)return null;let O=t.isHorizontalLayoutBrain?t.getPageIndexForRow(M):null,F=l?l.pathsToCells.get([M,P]):null;if(F&&F.type==="group"){let te=F.columnItems.map(ae=>ae.ref),$={...F.ref,id:F.id,uniqueGroupId:F.uniqueGroupId,depth:F.depth,columns:te.map(ae=>ae.id),computedWidth:F.computedWidth,groupOffset:F.groupOffset};return c().columnGroupVisibility[F.id]!==!1?Vo.createElement(gp,{horizontalLayoutPageIndex:O,bodyBrain:e,columnGroupsMaxDepth:s,domRef:_,columns:te,width:L,height:E,columnGroup:$}):null}return Vo.createElement(Tp,{domRef:_,column:j,horizontalLayoutPageIndex:O,headerOptions:u,dataSourceStatePartialForHeaderCell:R,filterTypes:v,filterDelay:D,getDataSourceState:y,dataSourceApi:S,dataSourceActions:T,width:L,height:k,columnsMap:m})},[u,o,a,l,s,p,t,y,S,T,v,D,R]);return Vo.createElement(un,{orientation:"horizontal",dragListId:"header",onDrop:yp,updatePosition:yp},A=>Vo.createElement("div",{...A,...h,className:J(A.className,h.className)},Vo.createElement(da,{name:"header",renderCell:x,brain:t,renderer:d,onRenderUpdater:f,cellHoverClassNames:RS,cellDetachedClassNames:pa})))}var Sp=Vo.memo(DS);function Cp(n){let{headerBrain:e,bodyBrain:t,scrollbars:o}=n,{computedPinnedStartColumns:r,computedPinnedEndColumns:i,computedVisibleColumns:a,columnSize:l}=oe(w=>({computedPinnedStartColumns:w.computed.computedPinnedStartColumns,computedPinnedEndColumns:w.computed.computedPinnedEndColumns,computedVisibleColumns:w.computed.computedVisibleColumns,columnSize:w.computed.columnSize})),{columnHeaderHeight:s,columnGroupsDepthsMap:c,columnGroupsMaxDepth:u,computedColumnGroups:d,showColumnFilters:f}=oe(w=>({columnHeaderHeight:w.state.columnHeaderHeight,columnGroupsDepthsMap:w.state.columnGroupsDepthsMap,columnGroupsMaxDepth:w.state.columnGroupsMaxDepth,computedColumnGroups:w.state.computedColumnGroups,showColumnFilters:w.state.showColumnFilters})),p=!d||!Object.keys(d).length?1:u+2,m=p*s+(f?s:0),g=Ht.useMemo(()=>{if(!(!d||!Object.keys(d).length))return sp(a,d,c,u)},[a,d,c]),b=Ht.useCallback(({rowIndex:w,colIndex:I})=>{let v=a[I],D=1,R=1;if(!v||!g)return{rowspan:D,colspan:R};let x=g.pathsToCells.get([w,I]);if(!x)return{rowspan:D,colspan:R};if(x.type==="column")return{colspan:R,rowspan:p-x.depth};let A=x.columnItems.findIndex(M=>M.id===v.id);return{rowspan:D,colspan:A===0?x.columnItems.length:1}},[d,u,a,g,p,c]),h=Ht.useCallback(({rowIndex:w,colIndex:I})=>b({rowIndex:w,colIndex:I}).rowspan,[b]),y=Ht.useCallback(({rowIndex:w,colIndex:I})=>b({rowIndex:w,colIndex:I}).colspan,[b]),S=Ht.useCallback(w=>f?w<p-1?s:2*s:s,[p,f,s]);ma(e,{colWidth:l,rowHeight:S,rows:p,cols:a.length,height:m,rowspan:h,colspan:y},{fixedColsEnd:i.length,fixedColsStart:r.length});let T=Ht.createElement(Sp,{columns:a,headerBrain:e,bodyBrain:t,columnHeaderHeight:m,columnGroupsMaxDepth:u,columnAndGroupTreeInfo:g}),C=o.vertical&&Mo()?Ht.createElement("div",{className:Hu,style:{zIndex:1e3,width:Mo()}}):null;return Ht.createElement("div",{className:`${cs} ${ju}`,style:{height:m}},T,C)}var{ManagedComponentContextProvider:PS}=Ot({initSetupState:Ef,forwardProps:_f,Context:Ss()});function ks(n){let{getComputed:e,header:t,brain:o,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?qr.createElement(PS,{...n},qr.createElement(Cp,{wrapRowsHorizontally:!!i,bodyBrain:o,headerBrain:r,scrollbars:a})):null}function wp(){return qr.useContext(Ss()).componentState}var xS=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||so;return De.createElement(s,{domProps:{className:Ki},onChange:c=>{if(l){c?r.treeApi.selectAll():r.treeApi.deselectAll();return}c?o.rowSelectionApi.selectAll():o.rowSelectionApi.deselectAll()},checked:i})},Ui=De.createContext(null);var MS=Q(q.columnZIndexAtIndex),AS=Q(q.columnVisibilityAtIndex),zs=De.createElement("div",{className:wi[1]}),Rp=Ri({"data-name":"","data-field":"","data-header-align":"","data-column-id":"","data-sort":"","data-sort-index":"",[No]:""});function ES(n){let e=n.column,{allowColumnHideWhileDragging:t}=wp(),{dataSourceStatePartialForHeaderCell:o,horizontalLayoutPageIndex:r,getDataSourceState:i,dataSourceApi:a,dataSourceActions:l,filterTypes:s,filterDelay:c}=n,{allRowsSelected:u,someRowsSelected:d,selectionMode:f}=o,{onDragItemPointerDown:p}=Hr(),{api:m,getComputed:g,getState:b,actions:h,getDataSourceMasterContext:y,showColumnFilters:S,components:T,portalDOMRef:C,columnHeaderHeight:w,columnReorderDragColumnId:I,columnMenuVisibleForColumnId:v,columnReorderInPageIndex:D}=oe(H=>({api:H.api,getComputed:H.getComputed,getState:H.getState,actions:H.actions,getDataSourceMasterContext:H.getDataSourceMasterContext,showColumnFilters:H.state.showColumnFilters,components:H.state.components,portalDOMRef:H.state.portalDOMRef,columnHeaderHeight:H.state.columnHeaderHeight,columnReorderDragColumnId:H.state.columnReorderDragColumnId,columnMenuVisibleForColumnId:H.state.columnMenuVisibleForColumnId,columnReorderInPageIndex:H.state.columnReorderInPageIndex})),R=I===e.id,x=D!=null?r!==D:!1,{onResize:A,height:M,width:P,headerOptions:_,columnsMap:E}=n,L=e.computedSortInfo,k=e.header,V=(0,po.useCallback)(H=>{G.current=H,n.domRef?.(H)},[n.domRef]),j=_.alwaysReserveSpaceForSortIcon,O=e.headerAlign??e.align,F=(typeof O=="function"?O({isHeader:!0,column:e}):O)??"start",te=(typeof e.verticalAlign=="function"?e.verticalAlign({isHeader:!0,column:e}):e.verticalAlign)??"center",$=gt(e,{actions:h,api:m,dataSourceActions:l,dataSourceApi:a,getComputed:g,getDataSourceState:i,getDataSourceMasterContext:y,getState:b}),Y=$.isSortable(),ae=Y&&(e.computedSorted||j)?De.createElement(Yi,{index:e.computedMultiSort?e.computedSortIndex+1:void 0,style:{marginInlineStart:me.spacing[2],marginInlineEnd:me.spacing[2]},className:`${nn}__sort-icon ${Ku} ${Wu({align:F})}`,direction:e.computedSorted?e.computedSortedAsc?1:-1:0}):null,Ce=e.computedFilterable&&e.computedFiltered?De.createElement(En,null):null,ue=e.headerCssEllipsis??e.cssEllipsis??!0,pe={reserveSpaceWhenHidden:F==="center",menuVisible:v===e.id,style:F==="end"?{marginInlineStart:`calc(${me.components.HeaderCell.resizeHandleActiveAreaWidth} / 2)`,marginInlineEnd:me.spacing[2]}:{marginInlineEnd:`calc(${me.components.HeaderCell.resizeHandleActiveAreaWidth} / 2)`,marginInlineStart:me.spacing[2]},domProps:{onMouseDown:H=>{H.stopPropagation(),$.toggleContextMenu(H.target)}}},ge=e.components?.MenuIcon||T?.MenuIcon||kr,U=De.createElement(ge,{...pe}),G=(0,po.useRef)(null),X={horizontalLayoutPageIndex:r,dragging:R,domRef:V,htmlElementRef:G,renderLocation:"column-header",column:e,columnsMap:E,columnSortInfo:L,columnFilterValue:e.computedFilterValue,filtered:e.computedFiltered,someRowsSelected:d,allRowsSelected:u,selectionMode:f,api:m,dataSourceApi:a,columnApi:$,renderBag:{sortIcon:ae,filterIcon:Ce,menuIcon:U,menuIconProps:pe,selectionCheckBox:null,header:e.header&&typeof e.header!="function"?e.header:e.name}},W=X,le=W.renderBag.header,re=()=>{let H={...X,renderBag:{...X.renderBag}};if(e.renderSortIcon&&(H.renderBag.sortIcon=De.createElement(Oo,{render:e.renderSortIcon,renderParam:{...H,renderBag:{...H.renderBag}}})),e.renderFilterIcon&&(H.renderBag.filterIcon=De.createElement(Oo,{render:e.renderFilterIcon,renderParam:{...H,renderBag:{...H.renderBag}}})),typeof e.renderMenuIcon=="function"&&(H.renderBag.menuIcon=De.createElement(Oo,{render:It=>{if(typeof e.renderMenuIcon!="function")return null;let kt=e.renderMenuIcon(It);return kt?kt.type===ge||kt.type===kr?kt:De.createElement(ge,{...pe},kt):null},renderParam:{...H,renderBag:{...H.renderBag}}})),e.renderSelectionCheckBox&&f==="multi-row"){H.renderBag.selectionCheckBox=De.createElement(Oo,{render:xS,renderParam:{...H,renderBag:{...H.renderBag}}});let It=e.renderHeaderSelectionCheckBox??e.renderSelectionCheckBox;It&&It!==!0&&(H.renderBag.selectionCheckBox=De.createElement(Oo,{render:It,renderParam:{...H,renderBag:{...H.renderBag}}}))}k instanceof Function&&(H.renderBag.header=le=De.createElement(Oo,{render:k,renderParam:{...H,renderBag:{...H.renderBag}}}));let rt=e.renderMenuIcon===!1?null:H.renderBag.menuIcon,we=ue?De.createElement("div",{className:Yt},H.renderBag.header):H.renderBag.header,it=De.createElement(De.Fragment,null,F==="center"?zs:null,H.renderBag.selectionCheckBox,we,H.renderBag.sortIcon,H.renderBag.filterIcon,F==="center"?zs:null,F!=="center"?zs:null,rt);return e.renderHeader?De.createElement(Oo,{render:e.renderHeader,renderParam:{...H,renderBag:{...H.renderBag,all:it}}}):it};(0,po.useEffect)(()=>{let H=null,rt=G.current;return A&&rt&&(H=wr(rt,A)),()=>{H?.()}},[G.current,n.onResize]);let z={height:M};e.headerStyle&&(z=typeof e.headerStyle=="function"?{...z,...e.headerStyle(W)||{}}:{...z,...e.headerStyle});let fe=typeof e.headerClassName=="function"?e.headerClassName(W):e.headerClassName,{onPointerDown:N,proxyPosition:Z,dragColumnOutside:ce}=Wd({columnId:e.id,domRef:G,horizontalLayoutPageIndex:r,allowColumnHideOnDrag:t}),de=null,Pe=Ui.Provider,xe={filtered:e.computedFiltered,verticalAlign:te,align:F},Ge=De.useMemo(()=>{let H=rt=>{m.setColumnFilter(e.id,rt)};return c>0?Et(H,{wait:c}):H},[c,e.id]),Ne=e.computedFilterType,Le=s[Ne],We=e.computedFilterable?e.computedFilterValue?.filter.operator??Le?.defaultOperator:void 0,Je=e.computedFilterable&&Le?Le.operators.find(H=>H.name===We):void 0,et=Je?.components?.FilterEditor||Le?.components?.FilterEditor||e.components?.FilterEditor||Fn,tt=Le?.components?.FilterOperatorSwitch||e.components?.FilterOperatorSwitch,B=If(e,{horizontalLayoutPageIndex:r}),ie=`var(${MS}-${e.computedVisibleIndex})`;z.zIndex=ie,z.visibility=`var(${AS}-${e.computedVisibleIndex}, visible)`;let se={"data-field":`${e.field||""}`,"data-column-id":e.id,[No]:e.id,"data-header-align":F,"data-name":"HeaderCell","data-sort":e.computedSortedAsc?"asc":e.computedSortedDesc?"desc":"none","data-sort-index":`${e.computedSortIndex??-1}`},be=e.computedFilterable?De.createElement(rd,{horizontalLayoutPageIndex:r,filterEditor:et,filterOperatorSwitch:tt??id,operator:Je,filterTypes:s,onChange:Ge,columnFilterType:Ne,columnLabel:e.field||e.name||e.id,columnFilterValue:e.computedFilterValue,columnHeaderHeight:w}):De.createElement(ad,null);W.renderBag.filterEditor=be;let Ye=(0,po.useCallback)(H=>{N(H),p(H)},[N,p]),ne=re();return R&&Z&&(de=De.createElement("div",{key:e.id,className:`${nn}Proxy ${Eu}`,style:{height:M,width:P,left:Z.left??0,top:Z.top??0}},De.createElement("div",{className:_u({visible:ce})},De.createElement(Af,{size:16})),le),de=(0,Ip.createPortal)(de,C.current)),De.createElement(Pe,{value:W},De.createElement(ji,{domRef:V,horizontalLayoutPageIndex:n.horizontalLayoutPageIndex,cellType:"header",column:e,...se,"data-z-index":ie,style:z,width:P,onPointerDown:Ye,contentClassName:J(Au(xe),lu[F]),contentStyle:S?{height:M/2}:void 0,className:J(nn,fu.none,Y?iu.pointer:"",fe,Oi(e,[nn,ln],Ou,{dragging:R,insideDisabledDraggingPage:x,align:F,verticalAlign:te,rowSelected:!1,cellSelected:!1,rowDisabled:!1,zebra:!1,rowActive:!1,firstRow:!0,firstRowInHorizontalLayoutPage:!0,treeNode:!1,groupCell:!1,groupRow:!1,rowExpanded:!1}),Mu),cssEllipsis:ue,afterChildren:De.createElement(De.Fragment,null,S?be:null,B),renderChildren:ne}),de)}var Tp=De.memo(ES);function Mr(){return(0,po.useContext)(Ui)}var mo=K(require("react")),xp=require("react");function vp(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 Dp={padding:me.spacing[2],textAlign:"end",opacity:"1",visibility:"visible",display:"block",fontSize:"0.85rem",background:"white",color:"black"},_S={opacity:1,visibility:"visible",display:"inline-block",pointerEvents:"all",color:"black",textDecoration:"underline"},Pp=(n,e)=>{if(n)for(let[t,o]of Object.entries(e))n.style.setProperty(vp(t),o,"important")},Mp=mo.forwardRef(function(e,t){let{rootClassName:o}=Ci(),r=mo.useRef(null),i=mo.useCallback(a=>{r.current=a,t&&(typeof t=="function"?t(a):t.current=a)},[]);return(0,xp.useEffect)(()=>{let a=()=>{setTimeout(()=>{Pp(r.current,Dp),Pp(r.current?.firstElementChild,_S)})};a();let l=setInterval(a,1e3);return()=>{clearInterval(l)}},[]),mo.createElement("div",{ref:i,...e,className:J(`${o}-Footer`,md,e.className),style:Dp},"Powered by"," ",mo.createElement("a",{href:"https://infinite-table.com",rel:"noopener noreferrer",role:"link",target:"_blank"},"Infinite Table"))});function Vs(n){return n.map(Jt)}function Jt(n){if(Ae().structuredClone)return Ae().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]=Jt(n[t]));return e}function Xr(n){return n}var mn=Object.seal({data:null,field:null});var Ho="____root____",Ep="____not_loaded_yet____";function Go(){return!1}function Gs(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 ha(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 _p(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 ee;function d(h,y,S,T=0,C=[]){let w=!S.length||T===S.length-1,I=y[c?.values||"values"]||{};for(let v in I)if(I.hasOwnProperty(v)){let D=v;C.push(D),f.set(C,!0),h.set(C,{reducerResults:I[v][c?.totals||"totals"]||{},items:[]}),w||d(h,I[v],S,T+1,C),C.pop()}}let f=r?new ee:void 0,p=[],m=Gs(o),g=Jt(m);e.visitDepthFirst((h,y,S,T)=>{let[C,...w]=y,I=h.children,v=u.get(w);if(v&&(v.cache=h.cache,v.childrenLoading=h.childrenLoading,v.childrenAvailable=h.childrenAvailable,v.error=h.error),w.length==i.length&&i.length){if(v){v.items=I;for(let R=0,x=w.length;R<x;R++){let A=w.slice(0,R),M=u.get(A);M&&(M.items=M.items||[],M.items=M.items.concat(I))}I=a.indexArray(I,{toPrimaryKey:l,cache:s,nodesKey:void 0})}return T?.()}for(let D=0,R=I.length;D<R;D++){if(!I[D]){let P={items:[],reducerResults:{},cache:!1,childrenLoading:!1,childrenAvailable:!1,isTree:!1,isGroupBy:!0};u.set([...w,`${Ep}${D}`],P);continue}let x=I[D].data,A=I[D].keys||[];if(A.length){let P=A[A.length-1];w.push(P)}let M={items:[],cache:!1,childrenLoading:!1,childrenAvailable:!1,commonData:x,totalChildrenCount:I[D].totalChildrenCount,reducerResults:I[D].aggregations||{},isTree:!1,isGroupBy:!0};if(u.set(w,M),r){let P=M.pivotDeepMap=new ee,_=I[D].pivot;d(P,_,r,0,p)}A.length&&w.pop()}T?.()});let b={deepMap:u,groupParams:n,initialData:e,reducerResults:g};return r&&(b.topLevelPivotColumns=f,b.pivot=r),t&&t.end({details:[{name:"Group by fields",value:i.map(h=>h.field).join(", ")}]}),b}function Ap(n,e,t,o,r,i,a,l,s,c=Xr){let{items:u,reducerResults:d,pivotDeepMap:f}=n.get(e);if(u.push(o),a&&ha(o,r,a,d,e),i){for(let p=0,m=i.length;p<m;p++){let{field:g,valueGetter:b,toKey:h}=i[p],y=g?o[g]:null;b&&(mn.data=o,mn.field=g,y=b(mn));let S=(h||c)(y,o);t.push(S),f.has(t)||(l.set(t,!0),f?.set(t,{reducerResults:Jt(s),items:[]}));let{reducerResults:T,items:C}=f.get(t);C.push(o),a&&ha(o,r,a,T,e)}t.length=0}}function Op(n,e,t,o,r,i,a,l){let{isLeafNode:s,getNodeChildren:c,toKey:u}=n,d=u(r),f=[...o,d],p=s(r);if(t.set(f,!0),p){for(let h=0,y=o.length;h<=y;h++){let S=o.slice(0,h),T=e.get(S),{reducerResults:C,items:w}=T;w.push(r),T.leavesAvailableCount++,T.totalLeafNodesCount++,a&&ha(r,i,a,C,S)}return}let m=Jt(l),g=[];e.set(f,{items:g,isTree:!0,isGroupBy:!1,node:r,reducerResults:m,cache:!1,childrenLoading:!1,childrenAvailable:!0,totalLeafNodesCount:0,leavesAvailableCount:0,treeNesting:o.length});let b=c(r);if(!(!b||!Array.isArray(b))){for(let h=0,y=b.length;h<y;h++){let S=b[h];Op(n,e,t,f,S,h,a,l)}a&&Zr(a,m,g)}}function Hs(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=Gs(t),i=Jt(r),a=new ee,l=new ee;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++)Op(n,a,l,[],e[c],c,t,r);t&&Zr(t,i,e);let s={deepMap:a,treeParams:n,treePaths:l,initialData:e,reducerResults:i};return o&&o.end(),s}function ya(n,e){let{marker:t,groupBy:o,defaultToKey:r=Xr,pivot:i,reducers:a}=n;t&&t.start();let l=o.length,s=i?new ee:void 0,c=new ee,u=[],d=[],f=Gs(a),p=Jt(f);if(!l){let g={items:[],isTree:!1,isGroupBy:!0,cache:!1,childrenLoading:!1,childrenAvailable:!1,reducerResults:Jt(f)};i&&(g.pivotDeepMap=new ee),c.set(u,g)}for(let g=0,b=e.length;g<b;g++){let h=e[g],y={};for(let S=0;S<l;S++){let{field:T,groupField:C,valueGetter:w,toKey:I}=o[S],v=T?h[T]:null;w&&(mn.data=h,mn.field=T,v=w(mn));let D=(I||r)(v,h);if(y[T||C]=D,u.push(D),!c.has(u)){let R={items:[],isTree:!1,isGroupBy:!0,cache:!1,commonData:{...y},childrenLoading:!1,childrenAvailable:!1,reducerResults:Jt(f)};i&&(R.pivotDeepMap=new ee),c.set(u,R)}Ap(c,u,d,h,g,i,a,s,f,r)}l||Ap(c,u,d,h,g,i,a,s,f,r),a&&ha(h,g,a,p,u),u.length=0}a&&(c.visitDepthFirst((g,b,h,y)=>{Zr(a,g.reducerResults,g.items),i&&g.pivotDeepMap.visitDepthFirst(({items:S,reducerResults:T},C,w,I)=>{Zr(a,T,S),I?.()}),y?.()}),Zr(a,p,e));let m={deepMap:c,groupParams:n,initialData:e,reducerResults:p};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 Fp(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 OS(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,f=d??null,p;if(Object.keys(c).length>0){f={...d},p={};for(let y in i)if(i.hasOwnProperty(y)){let T=i[y].field;T&&(p[T]=c[y]),T&&f[T]==null&&(f[T]=c[y])}}let m=!0,g=o[o.length-1],b=g;if(f!=null){let y=t[o.length-1];y&&y.field&&(b=f[y.field]),y&&y.toKey&&(b=y.toKey(b,f)),b=b??g}return typeof b=="string"&&b.startsWith(Ep)&&(m=!1,b=null),{data:f,reducerData:p,groupCount:s.length,groupData:s,groupKeys:o,isTreeNode:!1,rowSelected:!1,selectedChildredCount:0,deselectedChildredCount:0,id:`${o}`,collapsed:!1,dataSourceHasGrouping:!0,rowDisabled:!1,isCellSelected:Go,hasSelectedCells:Go,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:b,rootGroupBy:t,groupBy:l===t.length?t:t.slice(0,l),isGroupRow:!0,pivotValuesMap:u,groupNesting:l,reducerResults:c}}function ba(n,e,t){return{...n,id:`duplicate_row_on_page_${t}_for__${n.id}`,indexInAll:e,duplicateOf:n.id}}function Zr(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 Np(n,e,t,o,r,i){let a=e.length,{isLeafNode:l,getNodeChildren:s}=r.treeParams,{toPrimaryKey:c,treeResult:u,isRowDisabled:d,isNodeSelected:f,withRowInfo:p,isNodeExpanded:m,treeSelectionState:g,repeatWrappedGroupRows:b,rowsPerPage:h}=r,{deepMap:y}=u,S=n.length,T=t[t.length-1],C=T?T.nodeExpanded:!0;for(let w=0;w<S;w++){let I=n[w],v=c(I,w),D=[...e,v];if(l(I)){let E={id:v,nodePath:D,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:[...o,w],indexInParent:w,indexInAll:C?i.length:-1};f&&(E.rowSelected=f(E)),d&&(E.rowDisabled=d(E)),p&&p(E);let L=b&&h!=null&&h>0&&E.indexInAll%h===0?E.indexInAll/h:null;for(let k=0,V=t.length;k<V;k++){let j=t[k];if(C||(j.collapsedLeafNodesCount+=1),j.deepRowInfoArray.push(E),L!=null&&C){if(typeof b=="function"&&b(j)!==!0)continue;let O=ba(j,E.indexInAll,L);i[O.indexInAll]=O,E.indexInAll++}}C&&(i[E.indexInAll]=E);continue}let A=y.get(D)?.totalLeafNodesCount??0,M={dataSourceHasGrouping:!1,nodeExpanded:!1,selfExpanded:!1,nodePath:D,id:v,data:I,indexInAll:i.length,indexInParent:w,indexInParentNodes:[...o,w],totalLeafNodesCount:A,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(f&&(M.rowSelected=f(M),g)){let E=g.getSelectionCountFor(M.nodePath);M.selectedLeafNodesCount=E.selectedCount,M.deselectedLeafNodesCount=E.deselectedCount}d&&(M.rowDisabled=d(M)),p&&p(M);let P=!0;if(m&&(M.selfExpanded=P=m(M)),C||(P=!1),M.nodeExpanded=P,C&&b&&h!=null&&h>0){let E=M.indexInAll,L=M.parentNodes;if(L.length>0&&E%h===0){let k=E/h,V=0;L.forEach(j=>{typeof b=="function"&&b(j)!==!0||(i.push(ba(j,E+V,k)),V++,M.indexInAll++)})}}C&&(i[M.indexInAll]=M);let _=s(I);Array.isArray(_)&&Np(_,D,[...t,M],M.indexInParentNodes,r,i)}return i}function Lp(n){let{dataArray:e,marker:t}=n;t&&t.start();let o=[];return Np(e,[],[],[],n,o),t&&t.end(),{data:o}}function kp(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:f,reducers:p={}}=n,{groupParams:m,deepMap:g,pivot:b}=o,{groupBy:h}=m;e&&e.start({details:[{name:"Group by fields",value:h.map(w=>w.field).join(", ")}]});let y=[],S=[],T=[],C=[];return g.visitDepthFirst((w,I,v,D)=>{let R=w.items,x=I.length,A=s?.isGroupRowCollapsed(I)??!1;C.push(v);let M=OS({lazyLoad:t,groupBy:h,parents:Array.from(T),reducers:p,indexInGroup:v,indexInParentGroups:Array.from(C),indexInAll:y.length,groupKeys:I,error:w.error,totalChildrenCount:w.totalChildrenCount,childrenLoading:(w.childrenLoading||!A&&!w.childrenAvailable)&&t,childrenAvailable:w.childrenAvailable,directChildrenCount:I.length===h.length?w.items.length:g.getDirectChildrenSizeFor(I),directChildrenLoadedCount:0},w);if(u&&(M.rowSelected=u(M),d)){let k=d.getSelectionCountFor(M.groupKeys);M.selectedChildredCount=k.selectedCount,M.deselectedChildredCount=k.deselectedCount}c&&(M.rowDisabled=c(M));let P=T[T.length-1],_=P?.collapsed??!1;_&&(A=!0),M.collapsed=A;let E=f||A;if(_&&(E=!1),E){if(i&&r!=null&&r>0){let k=M.indexInAll,V=M.parents;if(V.length>0&&k%r===0){let j=k/r,O=0;V.forEach(F=>{typeof i=="function"&&i(F)!==!0||(y.push(ba(F,k+O,j)),O++,M.indexInAll++)})}}y.push(M),S.push(y.length-1)}M.collapsedChildrenCount=0,T.forEach(k=>{k.deepRowInfoArray.push(M),k.collapsedGroupsCount+=A?1:0}),P&&M.selfLoaded&&t&&(P.directChildrenLoadedCount+=1),a&&a(M),T.push(M);let L=!0;if(L){if(D)D();else if(!b){let k=y.length;A||(y.length+=R.length);let V=0;for(let j=0,O=R.length;j<O;j++){let F=R[j];if(!A&&i&&r!=null&&r>0){let ae=k+j+V;if(ae%r===0){let ye=ae/r;T.forEach(Ce=>{if(typeof i=="function"&&i(Ce)!==!0)return;let ue=k+j+V;y[ue]=ba(Ce,ue,ye),V++,y.length++})}}let te=k+j+V,Y={id:F?l(F,te):`${I}-${j}`,data:F,isCellSelected:Go,hasSelectedCells:Go,dataSourceHasGrouping:!0,isTreeNode:!1,isGroupRow:!1,selfLoaded:!!F,rowSelected:!1,rowDisabled:!1,rootGroupBy:h,collapsed:A,groupKeys:I,parents:Array.from(T),indexInParentGroups:[...C,j],indexInGroup:j,indexInAll:te,groupBy:h,groupNesting:x+1,groupCount:M.groupCount};u&&(Y.rowSelected=u(Y)),c&&(Y.rowDisabled=c(Y)),a&&a(Y),T.forEach((ae,ye)=>{ye===T.length-1&&F&&(ae.directChildrenLoadedCount+=1),A&&(ae.collapsedChildrenCount+=1),ae.deepRowInfoArray.push(Y)}),A||(y[k+j+V]=Y)}}}T.pop(),C.pop()}),e&&e.end(),{data:y,groupRowsIndexes:S}}var vm=K(require("react"));var FS=()=>{};function zp(n,e){let t=new ee,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]],f=t.get(d),p=f?f[o]??[]:[];a(d,p),p.length&&(f||(f=typeof r=="function"?r(d,p):r),f[o]=p),s.push(f)}return s}return a([],[])}function Vp(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],f=r(o),p=pt(()=>{let m=i(o);if(!(!m||!Array.isArray(m)))for(let g=0,b=m.length;g<b;g++){let h=m[g];Vp(n,e,d,h)}});f?(c?.(o),s?.(o,FS)):(l?.(o,p,i(o)),s?.(o,p))}function Gp(n,e,t){for(let o=0,r=t.length;o<r;o++)Vp(n,e,[],t[o])}var NS=function(n,e){return n-e},LS=function(n,e){return n=`${n}`,e=`${e}`,n.localeCompare(e)},kS=function(n,e){return n-e},zS={number:NS,string:LS,date:kS},Qr=zS;function Hp(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 eo=(n,e,t)=>{let o=typeof t=="function"?t:t?.get,r=t&&typeof t=="object"?t.marker:void 0;return r&&r.start(),e.sort(Kp(Hp(n),o)),r&&r.end(),e},Sa=(n,e,t)=>{let{marker:o}=t;o&&o.start();let r=Kp(Hp(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 Gp({isLeafNode:t.isLeafNode??u,getNodeChildren:t.getNodeChildren??c,toKey:s},{onParentNode:(d,f,p)=>{if(i&&f(),Array.isArray(p)){let m=a?p.sort(r):[...p].sort(r);d[l]=m}i||f()}},e),i&&(a?e.sort(r):e=[...e].sort(r)),o&&o.end(),e};eo.knownTypes=Qr;var VS=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=eo.knownTypes[i],r||console.warn(`Unknown sort type "${n.type}" - please pass one of ${Object.keys(eo.knownTypes).join(", ")}`)}return r||(r=Qr.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}},GS=n=>n.map(VS).filter(e=>e instanceof Function),Kp=(n,e)=>{let t=GS(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 Ta=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 ee(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 ee(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 Ct=class extends Ta{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)}};var HS=K(require("react"));function Ca(n){return Fe(e=>n(e.dataSourceState))}function Zn(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||Xr)(l,n);return t.push(s),t},[])}var Ee=class n{constructor(e,t,o){this.selectedRows=null;this.deselectedRows=null;this.defaultSelection=!1;this.selectedMap=new ee;this.deselectedMap=new ee;this.onlyUsePrimaryKeys=!1;this.selectionCache=new ee;this.selectionCountCache=new ee;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?Zn(r,o):[]}getGroupDeepMap(){return this.getConfig().groupDeepMap}getGroupCount(e){if(e.length==0)return this.getConfig().totalCount;let o=this.getGroupDeepMap()?.get(e);return o?o.totalChildrenCount??(o.items.length||0):0}getGroupKeysDirectlyInsideGroup(e){let{groupDeepMap:t}=this.getConfig();return t?.getKeysStartingWith(e,{excludeSelf:!0,depthLimit:1})||[]}getAllPrimaryKeysInsideGroup(e){let{groupDeepMap:t}=this.getConfig();if(!e.length)return(t?.getKeysStartingWith([],{excludeSelf:!0,depthLimit:1})||[]).map(i=>this.getAllPrimaryKeysInsideGroup(i)).flat();let o=t?.get(e);return o?o.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()}getState(){let e=r=>{let i=this.getGroupByLength();return r.map(a=>this.onlyUsePrimaryKeys?a[0]:a.length>i?a.pop():a)},t=e(this.selectedMap.topDownKeys()),o=e(this.deselectedMap.topDownKeys());return{defaultSelection:this.defaultSelection,selectedRows:t,deselectedRows:o}}deselectAll(){this.update({defaultSelection:!1,selectedRows:[],deselectedRows:[]})}selectAll(){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}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)})}deselectGroupRow(e){if(this.onlyUsePrimaryKeys){this.getAllPrimaryKeysInsideGroup(e).forEach(i=>{this.defaultSelection===!1?this.selectedMap.delete([i]):this._deselectedMapSet(i)}),this.xcache();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)})}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(r&&this.onlyUsePrimaryKeys){let c=this.getAllPrimaryKeysInsideGroup(e),u=0,d=0;c.forEach(p=>{if(this.defaultSelection){if(this.deselectedMap.has([p])){d++;return}u++}else{if(this.selectedMap.has([p])){u++;return}d++}});let f={selectedCount:u,deselectedCount:d};return this.selectionCountCache.set(e,f),f}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,f=this.deselectedMap.getKeysStartingWith(e,{excludeSelf:!0,depthLimit:1}).length,p=u-(d+f),m={selectedCount:d+(c?p:0),deselectedCount:f+(c?0:p)};return this.selectionCountCache.set(e,m),m}let a=0,l=0;if(this.getConfig().lazyLoad&&!i.length){let c=this.getConfig().groupDeepMap?.get(e)?.totalChildrenCount||0;t?(a=c,l=this.deselectedMap.getAllChildrenSizeFor(e),l===c&&(a=0)):(l=c,a=this.selectedMap.getAllChildrenSizeFor(e),a===c&&(l=0))}i.forEach(c=>{let u=this.selectedMap.get(c),d=this.deselectedMap.get(c),f=u?!0:d?!1:t,{selectedCount:p,deselectedCount:m}=this.getSelectionCountFor(c,f);a+=p,l+=m});let s={selectedCount:a,deselectedCount:l};return this.selectionCountCache.set(e,s),s}};var KS="*",$e=class{constructor(e){this.wildcard=KS;this.cache=new ee;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[f,p]=d;p===t&&l.push([f,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[f]=d;f===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){Co(`${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 p=this.selectedRowsToColumns.get(e);return p&&p.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}}};var BS=Ue("IT:InfiniteTable"),WS="#dc3545",jS="#eb9316";var Wp="Warn",jp="Error",$S="Info",US="Success",YS="Logs",wa=BS.extend(YS),ZO=wa.extend($S),qS=wa.extend(Wp),XS=wa.extend(jp),QO=wa.extend(US);var ZS=jS,QS=WS;var JS=(n,e)=>{e=e?e.extend?e.extend(Wp):e:qS,e(typeof e.color=="function"?e.color(ZS,n):n)},eT=(n,e)=>{e=e?e.extend?e.extend(jp):e:XS,e(typeof e.color=="function"?e.color(QS,n):n)};var Bp=new ee,$p=(n,...e)=>{Bp.has(e)||(Bp.set(e,!0),n())};var Qn=(n,e=n,t)=>{$p(()=>JS(n,t),e,"warn")},Up=(n,e=n,t)=>{$p(()=>eT(n,t),e,"error")};function Ia(n,e){return new Ee(n,ht(e))}function ht(n){return()=>{let e=typeof n=="function"?n():n;return{lazyLoad:!!e.lazyLoad,toPrimaryKey:e.toPrimaryKey,onlyUsePrimaryKeys:!e.useGroupKeysForMultiRowSelection,groupBy:e.groupBy,groupDeepMap:e.groupDeepMap,indexer:e.indexer,totalCount:e.unfilteredCount}}}function Yp(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 Ee))throw"Invalid row selection";let a=new Ee(r,ht(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 Ee))throw"Invalid row selection";let a=new Ee(r,ht(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 Ee))throw"Invalid row selection";if(!i){let u=s.getDataForPrimaryKey(r);i=u?Zn(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 Ee))throw"Invalid row selection";if(!i){let d=s.getDataForPrimaryKey(r);i=d?Zn(d,c):[]}let u=new Ee(a,ht(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 Ee))throw"Invalid row selection";if(a==="multi-row"){if(!i){let d=s.getDataForPrimaryKey(r);i=d?Zn(d,c):[]}let u=new Ee(l,ht(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 Ee))throw"Invalid row selection";let s=new Ee(a,ht(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 Ee))throw"Invalid row selection";let s=new Ee(a,ht(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 Ee))throw"Invalid row selection";let s=new Ee(a,ht(e));s.toggleGroupRowSelection(r),t.rowSelection=s},getGroupRowSelectionState(r,i){let a=e(),{selectionMode:l,groupBy:s}=a,c=i?new Ee(i,ht(a)):a.rowSelection;if(l!=="multi-row")throw'Selection mode should be "multi-row"';if(!s)throw"No grouping specified";if(!(c instanceof Ee))throw"Invalid row selection";return c.getGroupRowSelectionState(r)},getSelectedPrimaryKeys:r=>{let i=e(),a=r?new Ee(r,ht(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}}}var Ks=new WeakMap,tT=n=>n;function qp(n,e=50,t){Ks.set(n,{lastCallTime:0,lastCallArg:null});let o=t??tT;return r=>{let{lastCallTime:i,lastCallArg:a}=Ks.get(n)||{lastCallTime:0,lastCallArg:null},l=Date.now(),s=l-i,c=yt(o(a),o(r));s<e&&c||(Ks.set(n,{lastCallTime:l,lastCallArg:r}),n(r))}}var Ra=class{constructor(){this.primaryKeyToData=new Map;this.nodePathsToData=new ee;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,f=u.length;d<f;d++){let p=u[d];if(p.type==="insert"){let m=r(p.data);s?this.addNodePath([m],p.data,t):this.add(m,p.data),e.push(p.data)}}o?.removeInfo(void 0)}}else{let u=(d,f)=>{for(let p=0;p<d.length;p++){let m=d[p];c&&s&&Array.isArray(m[l])&&(m=d[p]={...m});let g=!1;if(m!=null){let b=r(m),h=s?[...f,b]:void 0,y=s&&!!h,S=y?o?.getMutationsForNodePath(h):o?.getMutationsForPrimaryKey(b);if(S&&S.length){for(let T=0,C=S.length;T<C;T++){let w=S[T];if(w.type==="delete"&&!g&&(y?this.removeNodePath(h,t):this.remove(b),g=!0,d.splice(p,1),p--),w.type==="update"&&!g&&(m={...m,...w.data},d[p]=m),w.type==="update-children"&&!g){let I=w.children(m[l],m);m={...m},I!==void 0?m[l]=I:delete m[l],d[p]=m}w.type==="insert"&&(w.position==="before"?(d.splice(p,0,w.data),p--):d.splice(p+1,0,w.data))}y?o?.removeNodePathInfo(h):o?.removeInfo(b)}if(!g)if(y){this.addNodePath(h,m);let T=a(m),C=T?null:i(m);!T&&Array.isArray(C)&&(f.push(b),c&&(m[l]=C=C.concat()),u(C,f),f.pop())}else this.add(b,m)}}};u(e,[])}return e}}};var nt=require("react");var Nt=require("react");function gn(n,e){let t=(0,Nt.useRef)({}),o=(0,Nt.useRef)({}),r=o.current,i=(0,Nt.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,Nt.useEffect)(()=>{let s=i.current,c;return Object.keys(s).length!==0&&(c=n(s,r)),i.current={},o.current={},c},l)}function oT(n,e){let t=(0,Nt.useRef)({}),o=(0,Nt.useRef)({}),r=o.current,i=(0,Nt.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,Nt.useLayoutEffect)(()=>{let s=i.current,c;return Object.keys(s).length!==0&&(c=n(s,r)),i.current={},o.current={},c},l)}function nT(n,e){let t=[];for(let o in e)e.hasOwnProperty(o)&&t.push(e[o]);(0,Nt.useEffect)(n,t)}function Bs(...n){return(...t)=>{n.forEach(o=>{typeof o=="function"&&o(...t)})}}function Ws(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 js(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 Xp({deepMap:n,pivotBy:e,pivotTotalColumnPosition:t,pivotGrandTotalColumnPosition:o,reducers:r={},showSeparatePivotColumnForSingleAggregation:i=!1}){let a=e.length,l=Object.keys(r).map(p=>({...r[p],id:p}));l.length||(i=!0,o=!1,t=!1,l.push({id:"__empty-aggregation-reducer__",name:"-",initialValue:null,reducer:()=>null}));let s={},c={},u=pt(function(){l.forEach((p,m)=>{s[`total:${p.id}`]=Ws({header:`${p.name||p.id} total`,pivotBy:e,pivotColumn:!0,pivotTotalColumn:!0,pivotAggregator:p,pivotAggregatorIndex:m,pivotGroupKeys:[],pivotGroupKey:"",pivotIndex:-1,valueFormatter:({rowInfo:g})=>g.isGroupRow?g.reducerResults?.[p.id]:null})})});(!a&&t==="start"||o==="start")&&u();let d=!i&&l.length===1;return n.visitDepthFirst((p,m,g,b)=>{if(m=[...m],t==="end"&&b?.(),m.length===a){let h=e[m.length-1],S=m.slice(0,-1).join("/");if(!d){let T=S;S=m.join("/");let C=m[m.length-1];c[S]=js({header:`${C}`,columnGroup:T,pivotBy:e,pivotGroupKeys:m,pivotByAtIndex:h,pivotIndex:m.length-1,pivotGroupKey:C})}l.forEach((T,C)=>{let w=d?`${m[m.length-1]}`:T.name||T.id,I=Ws({pivotBy:e,pivotColumn:!0,pivotTotalColumn:!1,pivotAggregator:T,pivotAggregatorIndex:C,pivotGroupKeys:m,pivotGroupKey:m[m.length-1],pivotIndex:m.length-1,pivotByAtIndex:h,defaultSortable:!1,columnGroup:S,header:w,valueFormatter:({rowInfo:D})=>D.isGroupRow?D.pivotValuesMap?.get(m)?.reducerResults[T.id]:null}),v=`${T.id}:${m.join("/")}`;s[v]=I})}else{let h=m.join("/"),y=m.slice(0,-1);if(c[h]=js({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 S=e[m.length-1],T=y.length?y.join("/"):void 0;if(!d){let C=T;T=`total:${m.join("/")}`,c[T]=js({header:`${m[m.length-1]} total`,columnGroup:C,pivotBy:e,pivotTotalColumnGroup:!0,pivotGroupKeys:m,pivotIndex:m.length-1,pivotByAtIndex:S,pivotGroupKey:m[m.length-1]})}l.forEach((C,w)=>{let I=d?`${m[m.length-1]} total `:`${C.name||C.id} total`,v=Ws({columnGroup:T,header:I,pivotAggregator:C,pivotAggregatorIndex:w,pivotColumn:!0,pivotTotalColumn:!0,pivotGroupKeys:m,pivotGroupKey:m[m.length-1],pivotByAtIndex:S,pivotIndex:m.length-1,pivotBy:e,defaultSortable:!1,valueFormatter:({rowInfo:D})=>D.isGroupRow?D.pivotValuesMap?.get(m)?.reducerResults[C.id]:null});s[`total:${C.id}:${m.join("/")}`]=v})}}(t==="start"||t===!1)&&b?.()}),(!a&&t==="end"||o==="end")&&u(),{columns:s,columnGroups:c}}var Zp=Symbol("CLEAR"),hn=class n{constructor(e){this.affectedFields=new Set;this.allFieldsAffected=!1;this.primaryKeyToData=new Map;this.nodePathToData=new ee;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=Zp,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(Zp);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=()=>ee.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:ee.clone(e.nodePathToData),o}};function Ko(n,e){return e().dataArray[n]}function va(n){return n().dataArray}var st=class{constructor(e){this.collapsedPathsMap=new ee;this.expandedPathsMap=new ee;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 rT=(n,e)=>n.length-e.length,Qe=class n{constructor(e,t){this.selectedPaths=null;this.deselectedPaths=null;this.defaultSelection=!1;this.selectionMap=new ee;this.cache=new ee;this.strictMode=!1;let o=e instanceof Object.getPrototypeOf(this).constructor,r=o?e.getState():e;this.setConfig(t||(o?e.config:{treePaths:new ee})),this.disableStrictMode(),this.update(r),this.config.strictCheckPaths&&this.enableStrictMode()}getTreePaths(e){return e?Array.isArray(e)?new ee(e.map(t=>[t,!0])):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:Array.isArray(t.treePaths)?new ee(t.treePaths.map(o=>[o,!0])):t.treePaths,strictCheckPaths:t.strictCheckPaths??!0},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(){this.update({defaultSelection:!1,selectedPaths:[],deselectedPaths:[]})}selectAll(){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(rT);if(this.strictMode&&(l=l.filter(d=>this.isPathAvailable(d))),!l.length){if(i!==null){let f=r?i:!1;return this.cacheIt(e,{selected:f,selectedCount:f?r:0,deselectedCount:f?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,f=l.length;d<f;d++){let p=l[d],{selectedCount:m,deselectedCount:g}=this.getSelectionStateForNode(p);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.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 Pa(n,e){return new Qe(n,Jn(e))}function Jn(n){return()=>({treePaths:(typeof n=="function"?n():n).treePaths})}var Da=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 Qe))throw"Invalid tree selection";let a=new Qe(r,Jn(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 st({defaultExpanded:!0,collapsedPaths:[]});this.getState().lastExpandStateInfoRef.current={state:"expanded",nodePath:null},this.actions.treeExpandState=e}collapseAll(){let e=new st({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 st(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 st(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 st(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?Ko(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 Qe))throw"Invalid node selection";let o=new Qe(e,Jn(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 Qe))throw"Invalid node selection";let o=new Qe(e,Jn(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 Qe))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)}};var er=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 wt=class extends er{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)}};var $s=1e3;function Qp(n){return new Us(n)}var Us=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=()=>va(this.getState);this.getRowInfoByIndex=e=>Ko(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?$s:r;return isNaN(a)||(a=$s),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 wt(o):new wt({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 wt({enabledRows:!0,disabledRows:[]});return}let t=new wt(e);t.enableAll(),this.actions.rowDisabledState=t};this.disableAllRows=()=>{let e=this.getState().rowDisabledState;if(!e){this.actions.rowDisabledState=new wt({disabledRows:!0,enabledRows:[]});return}let t=new wt(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 Da({...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?hn.clone(t,{light:!0}):new hn({nodesKey:o?r:void 0});e.forEach(a=>{switch(a.type){case"update":a.array.forEach((u,d)=>{if(a.primaryKeys){let f=a.primaryKeys[d],p=this.getDataByPrimaryKey(f);p&&i.update(a.primaryKeys[d],u,p,a.metadata)}else if(a.nodePaths){let f=this.getDataByNodePath(a.nodePaths[d]);f&&(typeof u=="function"?i.updateChildren(a.nodePaths[d],u,f,a.metadata):i.updateNodePath(a.nodePaths[d],u,f,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??$s,i=o.waitForNodePathPromises.get(e);if(i)return i.promise;let a=Date.now(),l=()=>{},s=new Promise(c=>{let u,d;l=f=>{clearTimeout(d),u=f,o.waitForNodePathPromises.delete(e),c(f)},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 Jp(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:f,isTree:p}=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((b,h)=>b||typeof h!="function"?l.has(h):!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(p&&(l===!0?r=!0:r=l.has(f)),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 xa(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 Ma(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 Aa(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 qs(n,e){return n&&n.filter(t=>{let o=e[t.filter.type];return!(!o||o.emptyValues&&o.emptyValues.includes(t.filter.value))})}var to=(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 Ys(){return!1}function iT(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:Ys,hasSelectedCells:Ys};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 aT=pt(()=>{console.warn(`Your "treeFilterFunction" should NOT MUTATE the data object. You're probably mutating the node children.
2
2
 
3
3
  Your filtering function probably looks like this:
4
4
 
@@ -10,21 +10,21 @@ function treeFilterFunction({ data }) {
10
10
 
11
11
  Make sure you avoid mutations.
12
12
 
13
- `)});function Hp(o){let{dataArray:e,treeFilterFunction:t,toPrimaryKey:n,getNodeChildren:r,isLeafNode:i,nodesKey:a}=o,l=[],s=c=>{let u=r(c);if(i(c)||!Array.isArray(u))return c;let d=Hp({...o,dataArray:u});return d.length===0?!1:(c={...c,[a]:d},c)};for(let c=0,u=e.length;c<u;c++){let d=e[c],f=r(d),p=t({data:d,index:c,dataArray:e,primaryKey:n(d,c),filterTreeNode:s});p&&(p===!0?p=d:typeof p=="object"&&p===d&&f!==r(p)&&KT(),l.push(p))}return l}function zs(o){let{filterTypes:e,marker:t,operatorsByFilterType:n,filterFunction:r,toPrimaryKey:i,treeFilterFunction:a,getNodeChildren:l,nodesKey:s,isLeafNode:c}=o,{dataArray:u}=o;t?.start({details:[{name:"Count before",value:u.length}]}),r&&(u=u.filter((f,p,m)=>r({data:f,index:p,dataArray:m,primaryKey:i(f,p)}))),a&&(u=Hp({...o,treeFilterFunction:a,getNodeChildren:l,nodesKey:s,isLeafNode:c}));let d=ks(o.filterValue,e)||[];if(d&&d.length){let f=u.filter((p,m,g)=>{let b={data:p,index:m,dataArray:g,primaryKey:i(p,m),field:void 0};for(let h=0,y=d.length;h<y;h++){let S=d[h],{disabled:C,field:T,valueGetter:I,filter:{type:w,value:v,operator:R}}=S,x=e[w];if(C||!x)continue;let M=n[w]?.[R];if(!M)continue;let E=I||x.valueGetter||(({data:_,field:D})=>D?_[D]:_);b.field=T;let P=b;if(P.filterValue=v,P.currentValue=E(P),P.emptyValues=x.emptyValues,!M.fn(P))return!1}return!0});return t?.end({details:[{name:"Count after",value:f.length}]}),f}return t?.end({details:[{name:"Count after",value:u.length}]}),u}function Kp(o){let e,{state:t,previousState:n}=o,r=t.debugId,i;r&&(i=Je(r).track.DataSource.label.PrepareData.start());let a=Gp(t),l=t.sortInfo,s=t.sortMode,c=l?.length?s==="local":!1;(t.lazyLoad||t.livePagination)&&(c=!1);let u=Jt(n,t,["refetchKey"]),d=Jt(n,t,["cache","originalDataArray","originalLazyGroupDataChangeDetect"]);Array.isArray(t.data)&&u&&(d=!0),!1&&(t.originalLazyGroupData=new Q,d=!0);let p=t.cache?so.clone(t.cache):void 0;p&&!p.isEmpty()&&(d=!0);let m=t.toPrimaryKey,g=t.nodesKey,b=t.isTree,h=g?U=>U[g]:void 0,y=g?U=>U[g]===void 0:void 0,S,C;d&&(t.indexer.clear(),t.lazyLoad||(S=p?.getMutations(),C=p?.getTreeMutations(),t.originalDataArray=t.indexer.indexArray(t.originalDataArray,{toPrimaryKey:m,cache:p,getNodeChildren:h,isLeafNode:y,nodesKey:g}),b&&t.waitForNodePathPromises.visit(({value:U},te)=>{U&&t.indexer.getDataForNodePath(te)!==void 0&&U.resolve(!0)}))),p&&(p.clear(),t.cache=void 0);let{filterFunction:I,treeFilterFunction:w,filterValue:v,filterTypes:R,operatorsByFilterType:x}=t,M=!!I||!!w||Array.isArray(v)&&v.length,A=M&&t.filterMode==="local",E=Jt(n,t,["filterFunction","treeFilterFunction","filterValue","filterTypes"]),P=d||E,_=Jt(n,t,["sortInfo"]),D=d||E||_,O=t.filterMode==="local"&&(P||!t.lastFilterDataArray),F=c&&(D||!t.lastSortDataArray||a.sortInfo),j=t.groupBy,z=t.pivotBy,L=!b&&(j.length>0||!!z),le=b,ne=Jt(n,t,["rowDisabledState","isRowDisabled"]),W=Jt(n,t,["rowSelection","cellSelection","isRowSelected","originalLazyGroupDataChangeDetect"]),$=Jt(n,t,["treeSelection","cellSelection","isNodeSelected","originalLazyGroupDataChangeDetect"]),re=d||D||Jt(n,t,["generateGroupRows","originalLazyGroupData","originalLazyGroupDataChangeDetect","groupBy","groupRowsState","pivotBy","aggregationReducers","pivotTotalColumnPosition","pivotGrandTotalColumnPosition","showSeparatePivotColumnForSingleAggregation","repeatWrappedGroupRows","rowsPerPage"]),ge=d||D||Jt(n,t,["originalLazyGroupData","originalLazyGroupDataChangeDetect","treeExpandState","isNodeExpanded","isNodeCollapsed","aggregationReducers","repeatWrappedGroupRows","rowsPerPage"]),me=Jt(n,t,["rowInfoReducers"]),ue=L&&(re||!t.lastGroupDataArray||a.groupBy)||W||ne||me,de=le&&(ge||a.tree||!t.lastTreeDataArray)||$||ne||me,he=Date.now(),K=t.originalDataArray;if(le&&de){let U={marker:r?Je(r).track.DataSource.label.TreeUnfilteredTreePaths.start():void 0,isLeafNode:y,getNodeChildren:h,toKey:m};t.unfilteredTreePaths=Ms(U,K).treePaths}if(M||(t.unfilteredCount=K.length),A){t.unfilteredCount=K.length;let U=he;O?(t.devToolsDetected&&(U=Date.now()),K=zs({marker:r?Je(r).track.DataSource.label.Filter.start():void 0,getNodeChildren:h,isLeafNode:y,nodesKey:g,treeFilterFunction:w,dataArray:K,toPrimaryKey:m,filterTypes:R,operatorsByFilterType:x,filterFunction:I,filterValue:v}),t.devToolsDetected&&t.debugTimings.set("filter",Date.now()-U)):K=t.lastFilterDataArray,t.lastFilterDataArray=K,t.filteredAt=he}if(t.filteredCount=K.length,t.postFilterDataArray=K,c){let U=Qt.knownTypes;if(Qt.knownTypes={...U,...t.sortTypes},F){let te=he;if(t.devToolsDetected&&(te=Date.now()),r&&(e=Je(r).track.DataSource.label.Sort.start({details:[{name:"Count",value:K.length}]})),t.sortFunction?(K=t.sortFunction(l,[...K]),e&&(e.end(),e=void 0)):b?K=da(l,K,{marker:e,inplace:!1,isLeafNode:y,getNodeChildren:h,toKey:m,nodesKey:g}):K=Qt(l,[...K],{marker:e}),r&&(e?.end(),e=void 0),t.devToolsDetected){let se=Date.now()-te;t.debugTimings.set("sort",se)}}else K=t.lastSortDataArray;Qt.knownTypes=U,t.lastSortDataArray=K,t.sortedAt=he}t.postSortDataArray=K;let H=t.dataArray,X=t.rowSelection instanceof Ee?t.rowSelection:void 0,B=t.treeExpandState instanceof rt?t.treeExpandState:void 0,ie=t.cellSelection instanceof Be?t.cellSelection:void 0;X?.xcache();let ee=t.selectionMode==="single-row"?U=>U.id===t.rowSelection:t.selectionMode==="multi-row"?U=>{let te=X;return U.isGroupRow?te.getGroupRowSelectionState(U.groupKeys):te.isRowSelected(U.id,U.dataSourceHasGrouping?U.groupKeys:void 0)}:void 0,fe=t.isRowDisabled||Ls;t.isRowSelected&&t.selectionMode==="multi-row"&&(ee=U=>t.isRowSelected(U,X,t.selectionMode));let Ie;t.isNodeExpanded&&(Ie=U=>t.isNodeExpanded(U,B)),t.isNodeCollapsed&&(Ie=U=>!t.isNodeExpanded(U,B)),Ie||(Ie=te=>B.isNodeExpanded(te.nodePath));let N=t.rowInfoReducers;if(L){if(ue){let U=he;t.devToolsDetected&&(U=Date.now());let te=t.aggregationReducers,se=t.lazyLoad?Tp({groupBy:j,pivot:z,mappings:t.pivotMappings,reducers:te,indexer:t.indexer,toPrimaryKey:m,cache:p,marker:r?Je(r).track.DataSource.label.LazyGroup.start():void 0},t.originalLazyGroupData):ua({groupBy:j,pivot:z,reducers:te,marker:r?Je(r).track.DataSource.label.Group.start():void 0},K);t.groupDeepMap=se.deepMap,X&&(X.getConfig=dt(t));let Me=Object.keys(N||{}),Ne=Ta(N),Fe={reducers:N,results:Ne,reducerKeys:Me,rowInfo:{}},be=Ne?tt=>{Fe.rowInfo=tt,Sa(Fe)}:void 0,je=ie?tt=>{tt.isCellSelected=G=>ie.isCellSelected(tt.id,G)}:void 0,$e=be||je?As(be,je):void 0,bt=vp({marker:r?Je(r).track.DataSource.label.FlattenTree.start():void 0,groupResult:se,lazyLoad:!!t.lazyLoad,reducers:te,toPrimaryKey:m,isRowSelected:ee,rowSelectionState:X,withRowInfo:$e,repeatWrappedGroupRows:t.rowsPerPage!=null?t.repeatWrappedGroupRows:!1,rowsPerPage:t.rowsPerPage,groupRowsState:t.groupRowsState,generateGroupRows:t.generateGroupRows});H=bt.data,t.rowInfoReducerResults=Ca({reducers:N,results:Ne,array:H}),t.groupRowsIndexesInDataArray=bt.groupRowsIndexes,t.reducerResults=se.reducerResults;let Nt=z?kp({deepMap:se.topLevelPivotColumns,pivotBy:z,pivotTotalColumnPosition:t.pivotTotalColumnPosition??"end",pivotGrandTotalColumnPosition:t.pivotGrandTotalColumnPosition??!1,reducers:t.aggregationReducers,showSeparatePivotColumnForSingleAggregation:t.showSeparatePivotColumnForSingleAggregation}):void 0;t.pivotColumns=Nt?.columns,t.pivotColumnGroups=Nt?.columnGroups,t.devToolsDetected&&t.debugTimings.set("group-and-pivot",Date.now()-U)}else H=t.lastGroupDataArray;t.lastGroupDataArray=H,t.groupedAt=he}else if(le){if(de){let U=he;t.devToolsDetected&&(U=Date.now());let te=t.aggregationReducers,se={marker:r?Je(r).track.DataSource.label.Tree.start():void 0,isLeafNode:y,getNodeChildren:h,toKey:m,reducers:te},Me=Ms(se,K);t.treeDeepMap=Me.deepMap,t.treePaths=Me.treePaths;let Ne=t.selectionMode==="multi-row"?Bp(t.treeSelection,t.selectionMode,t):void 0;t.treeSelectionState=Ne;let Fe=Object.keys(N||{}),be=Ta(N),je={reducers:N,results:be,reducerKeys:Fe,rowInfo:{}},$e=be?ae=>{je.rowInfo=ae,Sa(je)}:void 0,bt=ie?ae=>{ae.isCellSelected=ye=>ie.isCellSelected(ae.id,ye)}:void 0,Nt=$e||bt?As($e,bt):void 0,tt=t.selectionMode==="single-row"?ae=>ae.id===t.treeSelection:t.selectionMode==="multi-row"?ae=>Ne.isNodeSelected(ae.nodePath):void 0,G=t.rowsPerPage!=null?t.repeatWrappedGroupRows:!1;H=Ip({marker:r?Je(r).track.DataSource.label.FlattenTree.start():void 0,treeResult:Me,treeParams:se,dataArray:K,reducers:te,toPrimaryKey:m,isNodeSelected:tt,isNodeExpanded:Ie,treeSelectionState:Ne,withRowInfo:Nt,repeatWrappedGroupRows:G,rowsPerPage:t.rowsPerPage}).data,t.rowInfoReducerResults=Ca({reducers:N,results:be,array:H}),t.reducerResults=Me.reducerResults,t.totalLeafNodesCount=Me.deepMap.get([])?.totalLeafNodesCount??0,t.treeAt=he,t.devToolsDetected&&t.debugTimings.set("tree",Date.now()-U)}else H=t.lastTreeDataArray;t.lastTreeDataArray=H}else if(t.groupDeepMap=void 0,t.pivotColumns=void 0,t.groupRowsIndexesInDataArray=void 0,n.postSortDataArray!=t.postSortDataArray||re||W||ne||me){let te=Object.keys(N||{}),se=Ta(N),Me={reducers:N,results:se,reducerKeys:te,rowInfo:{}};H=K.map((Ne,Fe)=>{let be=HT(Ne,Ne?m(Ne):Fe,Fe,ee,fe,ie);return se&&(Me.rowInfo=be,Sa(Me)),be}),t.rowInfoReducerResults=Ca({reducers:N,results:se,array:H})}if(t.postGroupDataArray=H,H!==t.dataArray&&(t.updatedAt=he),t.dataArray=H,t.reducedAt=he,t.selectionMode==="multi-row")if(L&&t.lazyLoad){r&&(e=Je(r).track.DataSource.label.ComputeSelectionCountLazy.start());let U=!0,te=!1;t.dataArray.forEach(se=>{if(!se.isTreeNode&&se.isGroupRow&&se.groupKeys.length===1){let{rowSelected:Me}=se;Me!==!0&&(U=!1),(Me===!0||Me===null)&&(te=!0)}}),t.allRowsSelected=U,t.someRowsSelected=te,r&&(e?.end(),e=void 0)}else{r&&(e=Je(r).track.DataSource.label.ComputeSelectionCount.start());let U=t.isTree?t.totalLeafNodesCount:t.filteredCount,te=t.isTree?t.treeSelectionState?t.treeSelectionState.getSelectedCount():0:t.rowSelection.getSelectedCount();t.allRowsSelected=U===te,t.someRowsSelected=te>0,r&&(e?.end(),e=void 0)}return t.originalDataArrayChanged=d,d&&(t.originalDataArrayChangedInfo={timestamp:he,mutations:S?.size?S:void 0,treeMutations:C?.size?C:void 0}),t.rowInfoStore.notifyDataArray(H,{marker:r?Je(r).track.DataSource.label.DiffRowInfoInStore:void 0}),i&&i?.track.DataSource.label.PrepareData.end({details:[O||F||ue||de?{name:"Performed operations",value:[O?"filter":null,F?"sort":null,ue?"group":null,de?"tree":null].filter(yn).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(yn)}),t}function Ht(){let o=xe().performance?.now();return`${Date.now()}:${o}`}function BT(o,e,t){return e=e.replaceAll("$ERR_CODE",o),e=`${e}
13
+ `)});function em(n){let{dataArray:e,treeFilterFunction:t,toPrimaryKey:o,getNodeChildren:r,isLeafNode:i,nodesKey:a}=n,l=[],s=c=>{let u=r(c);if(i(c)||!Array.isArray(u))return c;let d=em({...n,dataArray:u});return d.length===0?!1:(c={...c,[a]:d},c)};for(let c=0,u=e.length;c<u;c++){let d=e[c],f=r(d),p=t({data:d,index:c,dataArray:e,primaryKey:o(d,c),filterTreeNode:s});p&&(p===!0?p=d:typeof p=="object"&&p===d&&f!==r(p)&&aT(),l.push(p))}return l}function Xs(n){let{filterTypes:e,marker:t,operatorsByFilterType:o,filterFunction:r,toPrimaryKey:i,treeFilterFunction:a,getNodeChildren:l,nodesKey:s,isLeafNode:c}=n,{dataArray:u}=n;t?.start({details:[{name:"Count before",value:u.length}]}),r&&(u=u.filter((f,p,m)=>r({data:f,index:p,dataArray:m,primaryKey:i(f,p)}))),a&&(u=em({...n,treeFilterFunction:a,getNodeChildren:l,nodesKey:s,isLeafNode:c}));let d=qs(n.filterValue,e)||[];if(d&&d.length){let f=u.filter((p,m,g)=>{let b={data:p,index:m,dataArray:g,primaryKey:i(p,m),field:void 0};for(let h=0,y=d.length;h<y;h++){let S=d[h],{disabled:T,field:C,valueGetter:w,filter:{type:I,value:v,operator:D}}=S,R=e[I];if(T||!R)continue;let x=o[I]?.[D];if(!x)continue;let M=w||R.valueGetter||(({data:_,field:E})=>E?_[E]:_);b.field=C;let P=b;if(P.filterValue=v,P.currentValue=M(P),P.emptyValues=R.emptyValues,!x.fn(P))return!1}return!0});return t?.end({details:[{name:"Count after",value:f.length}]}),f}return t?.end({details:[{name:"Count after",value:u.length}]}),u}function tm(n){let e,{state:t,previousState:o}=n,r=t.debugId,i;r&&(i=ot(r).track.DataSource.label.PrepareData.start());let a=Jp(t),l=t.sortInfo,s=t.sortMode,c=l?.length?s==="local":!1;(t.lazyLoad||t.livePagination)&&(c=!1);let u=to(o,t,["refetchKey"]),d=to(o,t,["cache","originalDataArray","originalLazyGroupDataChangeDetect"]);Array.isArray(t.data)&&u&&(d=!0),!1&&(t.originalLazyGroupData=new ee,d=!0);let p=t.cache?hn.clone(t.cache):void 0;p&&!p.isEmpty()&&(d=!0);let m=t.toPrimaryKey,g=t.nodesKey,b=t.isTree,h=g?Z=>Z[g]:void 0,y=g?Z=>Z[g]===void 0:void 0,S,T;d&&(t.indexer.clear(),t.lazyLoad||(S=p?.getMutations(),T=p?.getTreeMutations(),t.originalDataArray=t.indexer.indexArray(t.originalDataArray,{toPrimaryKey:m,cache:p,getNodeChildren:h,isLeafNode:y,nodesKey:g}),b&&t.waitForNodePathPromises.visit(({value:Z},ce)=>{Z&&t.indexer.getDataForNodePath(ce)!==void 0&&Z.resolve(!0)}))),p&&(p.clear(),t.cache=void 0);let{filterFunction:w,treeFilterFunction:I,filterValue:v,filterTypes:D,operatorsByFilterType:R}=t,x=!!w||!!I||Array.isArray(v)&&v.length,A=x&&t.filterMode==="local",M=to(o,t,["filterFunction","treeFilterFunction","filterValue","filterTypes"]),P=d||M,_=to(o,t,["sortInfo"]),E=d||M||_,L=t.filterMode==="local"&&(P||!t.lastFilterDataArray),k=c&&(E||!t.lastSortDataArray||a.sortInfo),V=t.groupBy,j=t.pivotBy,O=!b&&(V.length>0||!!j),F=b,te=to(o,t,["rowDisabledState","isRowDisabled"]),$=to(o,t,["rowSelection","cellSelection","isRowSelected","originalLazyGroupDataChangeDetect"]),Y=to(o,t,["treeSelection","cellSelection","isNodeSelected","originalLazyGroupDataChangeDetect"]),ae=d||E||to(o,t,["generateGroupRows","originalLazyGroupData","originalLazyGroupDataChangeDetect","groupBy","groupRowsState","pivotBy","aggregationReducers","pivotTotalColumnPosition","pivotGrandTotalColumnPosition","showSeparatePivotColumnForSingleAggregation","repeatWrappedGroupRows","rowsPerPage"]),ye=d||E||to(o,t,["originalLazyGroupData","originalLazyGroupDataChangeDetect","treeExpandState","isNodeExpanded","isNodeCollapsed","aggregationReducers","repeatWrappedGroupRows","rowsPerPage"]),Ce=to(o,t,["rowInfoReducers"]),ue=O&&(ae||!t.lastGroupDataArray||a.groupBy)||$||te||Ce,pe=F&&(ye||a.tree||!t.lastTreeDataArray)||Y||te||Ce,ge=Date.now(),U=t.originalDataArray;if(F&&pe){let Z={marker:r?ot(r).track.DataSource.label.TreeUnfilteredTreePaths.start():void 0,isLeafNode:y,getNodeChildren:h,toKey:m};t.unfilteredTreePaths=Hs(Z,U).treePaths}if(x||(t.unfilteredCount=U.length),A){t.unfilteredCount=U.length;let Z=ge;L?(t.devToolsDetected&&(Z=Date.now()),U=Xs({marker:r?ot(r).track.DataSource.label.Filter.start():void 0,getNodeChildren:h,isLeafNode:y,nodesKey:g,treeFilterFunction:I,dataArray:U,toPrimaryKey:m,filterTypes:D,operatorsByFilterType:R,filterFunction:w,filterValue:v}),t.devToolsDetected&&t.debugTimings.set("filter",Date.now()-Z)):U=t.lastFilterDataArray,t.lastFilterDataArray=U,t.filteredAt=ge}if(t.filteredCount=U.length,t.postFilterDataArray=U,c){let Z=eo.knownTypes;if(eo.knownTypes={...Z,...t.sortTypes},k){let ce=ge;if(t.devToolsDetected&&(ce=Date.now()),r&&(e=ot(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)):b?U=Sa(l,U,{marker:e,inplace:!1,isLeafNode:y,getNodeChildren:h,toKey:m,nodesKey:g}):U=eo(l,[...U],{marker:e}),r&&(e?.end(),e=void 0),t.devToolsDetected){let de=Date.now()-ce;t.debugTimings.set("sort",de)}}else U=t.lastSortDataArray;eo.knownTypes=Z,t.lastSortDataArray=U,t.sortedAt=ge}t.postSortDataArray=U;let G=t.dataArray,X=t.rowSelection instanceof Ee?t.rowSelection:void 0,W=t.treeExpandState instanceof st?t.treeExpandState:void 0,le=t.cellSelection instanceof $e?t.cellSelection:void 0;X?.xcache();let re=t.selectionMode==="single-row"?Z=>Z.id===t.rowSelection:t.selectionMode==="multi-row"?Z=>{let ce=X;return Z.isGroupRow?ce.getGroupRowSelectionState(Z.groupKeys):ce.isRowSelected(Z.id,Z.dataSourceHasGrouping?Z.groupKeys:void 0)}:void 0,z=t.isRowDisabled||Ys;t.isRowSelected&&t.selectionMode==="multi-row"&&(re=Z=>t.isRowSelected(Z,X,t.selectionMode));let fe;t.isNodeExpanded&&(fe=Z=>t.isNodeExpanded(Z,W)),t.isNodeCollapsed&&(fe=Z=>!t.isNodeExpanded(Z,W)),fe||(fe=ce=>W.isNodeExpanded(ce.nodePath));let N=t.rowInfoReducers;if(O){if(ue){let Z=ge;t.devToolsDetected&&(Z=Date.now());let ce=t.aggregationReducers,de=t.lazyLoad?_p({groupBy:V,pivot:j,mappings:t.pivotMappings,reducers:ce,indexer:t.indexer,toPrimaryKey:m,cache:p,marker:r?ot(r).track.DataSource.label.LazyGroup.start():void 0},t.originalLazyGroupData):ya({groupBy:V,pivot:j,reducers:ce,marker:r?ot(r).track.DataSource.label.Group.start():void 0},U);t.groupDeepMap=de.deepMap,X&&(X.getConfig=ht(t));let Pe=Object.keys(N||{}),xe=xa(N),Ge={reducers:N,results:xe,reducerKeys:Pe,rowInfo:{}},Ne=xe?tt=>{Ge.rowInfo=tt,Ma(Ge)}:void 0,Le=le?tt=>{tt.isCellSelected=B=>le.isCellSelected(tt.id,B)}:void 0,We=Ne||Le?Bs(Ne,Le):void 0,Je=kp({marker:r?ot(r).track.DataSource.label.FlattenTree.start():void 0,groupResult:de,lazyLoad:!!t.lazyLoad,reducers:ce,toPrimaryKey:m,isRowSelected:re,rowSelectionState:X,withRowInfo:We,repeatWrappedGroupRows:t.rowsPerPage!=null?t.repeatWrappedGroupRows:!1,rowsPerPage:t.rowsPerPage,groupRowsState:t.groupRowsState,generateGroupRows:t.generateGroupRows});G=Je.data,t.rowInfoReducerResults=Aa({reducers:N,results:xe,array:G}),t.groupRowsIndexesInDataArray=Je.groupRowsIndexes,t.reducerResults=de.reducerResults;let et=j?Xp({deepMap:de.topLevelPivotColumns,pivotBy:j,pivotTotalColumnPosition:t.pivotTotalColumnPosition??"end",pivotGrandTotalColumnPosition:t.pivotGrandTotalColumnPosition??!1,reducers:t.aggregationReducers,showSeparatePivotColumnForSingleAggregation:t.showSeparatePivotColumnForSingleAggregation}):void 0;t.pivotColumns=et?.columns,t.pivotColumnGroups=et?.columnGroups,t.devToolsDetected&&t.debugTimings.set("group-and-pivot",Date.now()-Z)}else G=t.lastGroupDataArray;t.lastGroupDataArray=G,t.groupedAt=ge}else if(F){if(pe){let Z=ge;t.devToolsDetected&&(Z=Date.now());let ce=t.aggregationReducers,de={marker:r?ot(r).track.DataSource.label.Tree.start():void 0,isLeafNode:y,getNodeChildren:h,toKey:m,reducers:ce},Pe=Hs(de,U);t.treeDeepMap=Pe.deepMap,t.treePaths=Pe.treePaths;let xe=t.selectionMode==="multi-row"?om(t.treeSelection,t.selectionMode,t):void 0;t.treeSelectionState=xe;let Ge=Object.keys(N||{}),Ne=xa(N),Le={reducers:N,results:Ne,reducerKeys:Ge,rowInfo:{}},We=Ne?se=>{Le.rowInfo=se,Ma(Le)}:void 0,Je=le?se=>{se.isCellSelected=be=>le.isCellSelected(se.id,be)}:void 0,et=We||Je?Bs(We,Je):void 0,tt=t.selectionMode==="single-row"?se=>se.id===t.treeSelection:t.selectionMode==="multi-row"?se=>xe.isNodeSelected(se.nodePath):void 0,B=t.rowsPerPage!=null?t.repeatWrappedGroupRows:!1;G=Lp({marker:r?ot(r).track.DataSource.label.FlattenTree.start():void 0,treeResult:Pe,treeParams:de,dataArray:U,reducers:ce,toPrimaryKey:m,isNodeSelected:tt,isNodeExpanded:fe,treeSelectionState:xe,withRowInfo:et,repeatWrappedGroupRows:B,rowsPerPage:t.rowsPerPage}).data,t.rowInfoReducerResults=Aa({reducers:N,results:Ne,array:G}),t.reducerResults=Pe.reducerResults,t.totalLeafNodesCount=Pe.deepMap.get([])?.totalLeafNodesCount??0,t.treeAt=ge,t.devToolsDetected&&t.debugTimings.set("tree",Date.now()-Z)}else G=t.lastTreeDataArray;t.lastTreeDataArray=G}else if(t.groupDeepMap=void 0,t.pivotColumns=void 0,t.groupRowsIndexesInDataArray=void 0,o.postSortDataArray!=t.postSortDataArray||ae||$||te||Ce){let ce=Object.keys(N||{}),de=xa(N),Pe={reducers:N,results:de,reducerKeys:ce,rowInfo:{}};G=U.map((xe,Ge)=>{let Ne=iT(xe,xe?m(xe):Ge,Ge,re,z,le);return de&&(Pe.rowInfo=Ne,Ma(Pe)),Ne}),t.rowInfoReducerResults=Aa({reducers:N,results:de,array:G})}if(t.postGroupDataArray=G,G!==t.dataArray&&(t.updatedAt=ge),t.dataArray=G,t.reducedAt=ge,t.selectionMode==="multi-row")if(O&&t.lazyLoad){r&&(e=ot(r).track.DataSource.label.ComputeSelectionCountLazy.start());let Z=!0,ce=!1;t.dataArray.forEach(de=>{if(!de.isTreeNode&&de.isGroupRow&&de.groupKeys.length===1){let{rowSelected:Pe}=de;Pe!==!0&&(Z=!1),(Pe===!0||Pe===null)&&(ce=!0)}}),t.allRowsSelected=Z,t.someRowsSelected=ce,r&&(e?.end(),e=void 0)}else{r&&(e=ot(r).track.DataSource.label.ComputeSelectionCount.start());let Z=t.isTree?t.totalLeafNodesCount:t.filteredCount,ce=t.isTree?t.treeSelectionState?t.treeSelectionState.getSelectedCount():0:t.rowSelection.getSelectedCount();t.allRowsSelected=Z===ce,t.someRowsSelected=ce>0,r&&(e?.end(),e=void 0)}return t.originalDataArrayChanged=d,d&&(t.originalDataArrayChangedInfo={timestamp:ge,mutations:S?.size?S:void 0,treeMutations:T?.size?T:void 0}),t.rowInfoStore.notifyDataArray(G,{marker:r?ot(r).track.DataSource.label.DiffRowInfoInStore:void 0}),i&&i?.track.DataSource.label.PrepareData.end({details:[L||k||ue||pe?{name:"Performed operations",value:[L?"filter":null,k?"sort":null,ue?"group":null,pe?"tree":null].filter(vo).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(vo)}),t}function Kt(){let n=Ae().performance?.now();return`${Date.now()}:${n}`}function lT(n,e,t){return e=e.replaceAll("$ERR_CODE",n),e=`${e}
14
14
 
15
- ERROR_CODE = ${o}
15
+ ERROR_CODE = ${n}
16
16
 
17
- See http://infinite-table.com/docs/reference/error-codes#${o} for more info.`,{code:o,message:e,type:t??"error"}}function Wp(o){return Object.entries(o).reduce((e,[t,n])=>{let r=t,i=BT(r,typeof n=="string"?n:n.message,typeof n=="string"?void 0:n.type);return e[r]=i,e},{})}function WT(o){return{message:o.join(""),type:"warning"}}function jT(o){return{message:o.join(""),type:"error"}}var $T=Wp({DS001:WT`The "data" prop of your DataSource seems to be updating too frequently.
18
- Make sure you don't pass a new reference on every render.`}),UT=Wp({CSS001_CSS:jT`It appears you have not loaded the CSS file for InfiniteTable.
17
+ See http://infinite-table.com/docs/reference/error-codes#${n} for more info.`,{code:n,message:e,type:t??"error"}}function nm(n){return Object.entries(n).reduce((e,[t,o])=>{let r=t,i=lT(r,typeof o=="string"?o:o.message,typeof o=="string"?void 0:o.type);return e[r]=i,e},{})}function sT(n){return{message:n.join(""),type:"warning"}}function cT(n){return{message:n.join(""),type:"error"}}var uT=nm({DS001:sT`The "data" prop of your DataSource seems to be updating too frequently.
18
+ Make sure you don't pass a new reference on every render.`}),dT=nm({CSS001_CSS:cT`It appears you have not loaded the CSS file for InfiniteTable.
19
19
  In most environments, you should be able to fix this by adding the following line:
20
20
 
21
21
  import '@infinite-table/infinite-react/index.css'
22
- `}),jp={...$T,...UT};var un=new Map,dn=new Map,Ln=new Map,fn=new Map;var Ot=new Map,$p=o=>{Ot.delete(o),Ln.delete(o),un.delete(o),fn.delete(o),dn.delete(o)};function Vs(o,e,t){let n=Ot.get(o);if(!n)return;let r=Ln.get(o);(!r||!Object.hasOwn(r,e))&&Ln.set(o,{...r||{},[e]:n.getState()[e]}),un.set(o,{...un.get(o)||{},[e]:t}),n.actions[e]=t}function wa(o,e,t){let n=Ot.get(o);if(!n)return;let r=fn.get(o);(!r||!Object.hasOwn(r,e))&&fn.set(o,{...r||{},[e]:n.getDataSourceState()[e]}),dn.set(o,{...dn.get(o)||{},[e]:t}),n.dataSourceActions[e]=t}var YT=o=>{let e=o.type==="error"?hn(o.debugId):Dt(o.debugId),t=o.type==="error"?Np:Bo,n=o.debugId?`${o.code}-${o.debugId}`:o.code,r=o.message;o.debugId&&(r=`${r}
22
+ `}),rm={...uT,...dT};var go=new Map,ho=new Map,Bo=new Map,bo=new Map;var Lt=new Map,im=n=>{Lt.delete(n),Bo.delete(n),go.delete(n),bo.delete(n),ho.delete(n)};function Zs(n,e,t){let o=Lt.get(n);if(!o)return;let r=Bo.get(n);(!r||!Object.hasOwn(r,e))&&Bo.set(n,{...r||{},[e]:o.getState()[e]}),go.set(n,{...go.get(n)||{},[e]:t}),o.actions[e]=t}function Ea(n,e,t){let o=Lt.get(n);if(!o)return;let r=bo.get(n);(!r||!Object.hasOwn(r,e))&&bo.set(n,{...r||{},[e]:o.getDataSourceState()[e]}),ho.set(n,{...ho.get(n)||{},[e]:t}),o.dataSourceActions[e]=t}var fT=n=>{let e=n.type==="error"?Co(n.debugId):_t(n.debugId),t=n.type==="error"?Up:Qn,o=n.debugId?`${n.code}-${n.debugId}`:n.code,r=n.message;n.debugId&&(r=`${r}
23
23
 
24
- Component DEBUG_ID = "${o.debugId}"`),t(r,n,e)},Ur=o=>{let{debugId:e,key:t}=o,n=jp[t];if(n&&(YT({...n,debugId:e}),e&&t)){let r=Ot.get(e);r&&r.getState().devToolsDetected&&n&&(r.getState().debugWarnings.set(t,{...n,debugId:e,status:"new"}),Yr(e))}};globalThis.logDevToolsWarning=Ur;var Yr=o=>{let e=window.__INFINITE_TABLE_DEVTOOLS_HOOK__;if(!e)return;let t=Ot.get(o);t&&e(o,t)};var Up=!0,qT=()=>new Promise(o=>{ze(o)}),XT={originalDataArray:!0,changes:!0},ZT={filterValue:(o,e)=>JSON.stringify(o)===JSON.stringify(e),groupRowsState:(o,e)=>JSON.stringify(o)===JSON.stringify(e)};function pn(o,e,t){let n=o.multiSort?o.sortInfo:o.sortInfo?.[0]??null,r={append:!1,originalDataArray:o.originalDataArray,sortInfo:n,refetchKey:o.refetchKey,groupBy:o.groupBy,pivotBy:o.pivotBy,filterValue:o.filterValue,aggregationReducers:o.aggregationReducers};if(t&&(r.masterRowInfo=t.masterRowInfo),r.groupBy&&(r.groupRowsState=o.groupRowsState.getState()),o.livePagination!==void 0&&(r.livePaginationCursor=o.livePaginationCursor,r.__cursorId=o.cursorId),o.lazyLoad&&(o.lazyLoadBatchSize!=null&&o.lazyLoadBatchSize>0&&(r.lazyLoadBatchSize=o.lazyLoadBatchSize,r.lazyLoadStartIndex=0),r.groupKeys=[]),e&&Object.assign(r,e),r.filterValue&&r.filterValue.length){let l=qp(r.filterValue,{filterMode:o.filterMode,filterTypes:o.filterTypes});l&&l.length&&(r.filterValue=l)}let i={},a=o.dataParams||{};for(let l in r)if(r.hasOwnProperty(l)&&!XT[l]){let s=l,c=ZT[s],u=r[s],d=a[s];(c?c(u,d):u===d)||(i[s]=!0)}return r.changes=i,r}function co(o,e,t,n,r){let i=pn(e,n,r),a=i.append;if(e.lazyLoad){let s=e.originalLazyGroupData,c=[Nn,...i.groupKeys||[]],u=s.get(c);if(!u){let d=[...i.groupKeys||[],i.lazyLoadStartIndex];e.lazyLoadCacheOfLoadedBatches.set(d,!0)}if(u&&u.cache&&c.length>1){let d=u.children,f=d.length,p=!0;for(let m=0;m<f;m++)if(d[m]==null){p=!1;break}if(p)return Promise.resolve(!0)}u?u.childrenLoading||(u.childrenLoading=!0):s.set(c,{error:void 0,children:[],childrenLoading:!0,childrenAvailable:!1,cache:Up,totalCount:0,totalCountUnfiltered:0}),t.originalLazyGroupDataChangeDetect=Ht()}typeof o=="function"&&(o=o(i));let l=typeof o=="object"&&typeof o.then=="function";return l&&(!e.lazyLoad||e.lazyLoad&&!a)&&(t.loading=!0),Promise.resolve(o).then(s=>{let c=[],u=!1;if(Array.isArray(s.data)){let f=s;if(c=f.data,f.livePaginationCursor!==void 0&&(t.livePaginationCursor=f.livePaginationCursor),f.mappings&&(t.pivotMappings=f.mappings),f.totalCountUnfiltered&&(t.unfilteredCount=f.totalCountUnfiltered),e.lazyLoad){let m=function(g,b,h){let y=[Nn,...g],S=b.data,C={cache:b.cache??Up,childrenLoading:!1,childrenAvailable:!0,totalCount:b.totalCount??S.length,totalCountUnfiltered:b.totalCount??S.length,children:S,error:b.error},T=[];if(i.lazyLoadBatchSize&&!h){let w=p.get(y),v=!w,R=Ku({children:!0},w||{},C);v&&(R.chidren=[]),R.children.length=R.totalCount;let x=i.lazyLoadStartIndex??0,M=Math.min(b.totalCount??S.length,x+i.lazyLoadBatchSize);for(let A=x;A<M;A++){let E=C.children[A-x];if(!E)throw`lazily loaded item not found at index ${A-x}`;R.children[A]=E,E.dataset&&T.push({keys:E.keys,dataset:E.dataset})}v&&p.set(y,R)}else C.children.forEach(w=>{w&&w.dataset&&T.push({keys:w.keys,dataset:w.dataset})}),C.children.length=C.totalCount,p.set(y,C);let I=!1;if(!g||!g.length){let w=p.get([Nn]);t.originalDataArray=[...w.children],I=!0}if(I||(t.originalLazyGroupDataChangeDetect=Ht()),T.length){let w=g;T.forEach(({keys:v,dataset:R})=>{m(v,R,w)})}};var d=m;let p=e.originalLazyGroupData;u=!0,m(i.groupKeys||[],f)}}else c=s;u||(t.originalDataArray=a?e.originalDataArray.concat(c):c),l&&(!e.lazyLoad||e.lazyLoad&&!a)&&(t.loading=!1)})}function qp(o,{filterTypes:e,filterMode:t}){return t==="local"?o:(ks(o,e)||[]).map(n=>{let r={...n};return delete r.valueGetter,r})}function Yp(o,e){let t=!!o,{stateReadyAsDetails:n}=e(),r=t&&o.shouldRestoreState?n:!0;return{isDetail:t,isDetailReady:r}}function Xp(o){let{getComponentState:e,componentActions:t,componentState:n}=o,{data:r,dataArray:i,notifyScrollbarsChange:a,refetchKey:l,sortInfo:s,shouldReloadData:c,groupBy:u,pivotBy:d,filterValue:f,filterMode:p,livePagination:m,livePaginationCursor:g,filterTypes:b,cursorId:h}=n,[y,S]=(0,et.useState)({vertical:!1,horizontal:!1}),C=(0,et.useRef)(y);(0,et.useEffect)(()=>(a.onChange(x=>{x&&(C.current=x,S(x))}),()=>a.destroy()),[a]),(0,et.useEffect)(()=>{if(!m)return;let x=requestAnimationFrame(()=>{C.current?.vertical||g&&(t.cursorId=g)});return()=>cancelAnimationFrame(x)},[g]),(0,et.useEffect)(()=>{if(!m||g!==void 0)return;let x=requestAnimationFrame(()=>{C.current?.vertical||h!=null&&i.length&&(t.cursorId=i.length)});return()=>cancelAnimationFrame(x)},[i.length,g]),(0,et.useEffect)(()=>{let x=e(),{livePaginationCursor:M,livePagination:A,dataArray:E}=x;!y.vertical&&A&&(M?t.cursorId=M:M===void 0&&E.length&&(t.cursorId=E.length))},[y.vertical]);let T=(0,et.useMemo)(()=>qp(f,{filterTypes:b,filterMode:p}),[f,p,b]),I={sortInfo:c.sortInfo?s:null,groupBy:c.groupBy?u:null,pivotBy:c.pivotBy?d:null,refetchKey:l,filterValue:c.filterValue?T:null,cursorId:m?h:null},w=(0,et.useRef)(!0);QT(o,{sortInfo:s,groupBy:u,pivotBy:d,filterValue:f,refetchKey:l,cursorId:m?h:null});let v=Ae(He()),R=(0,et.useRef)([]);lo(()=>{let x=e(),M=v(),{isDetail:A,isDetailReady:E}=Yp(M,e);if(A&&!E)return;let P=Date.now(),_=R.current;_.length>=10&&_.splice(0,1),_.push(P),P-_[0]<200&&_.length>=10&&Ur({debugId:x.debugId,key:"DS001"}),typeof x.data!="function"&&co(x.data,x,t,void 0,M)},{data:r}),lo(x=>{let M=Object.keys(x),A=!1;if(M.length===1){if(A=!!x.cursorId,x.filterValue&&e().filterMode==="local")return;let O=e().data;if(Array.isArray(O)&&x.refetchKey){t.originalDataArray=O;return}}let E=v(),{isDetail:P,isDetailReady:_}=Yp(E,e);if(P&&!_)return;let D=e();if(typeof D.data=="function"){let O;D.debugId&&(O=Je(D.debugId).track.DataSource.label.RemoteDataLoad.start()),co(D.data,D,t,{append:A},E).then(()=>{O?.end()})}},{...I,data:r}),lo(()=>{let x=e();if(w.current){w.current=!1;let M=pn(x,void 0,v());t.dataParams=M}},I)}function QT(o,e){let{getComponentState:t,componentActions:n,componentState:r}=o;(0,et.useEffect)(()=>{n.lazyLoadCacheOfLoadedBatches=new Q},[r.data,r.dataParams]);let{lazyLoadBatchSize:i,lazyLoad:a,originalLazyGroupDataChangeDetect:l,notifyRenderRangeChange:s,dataArray:c,groupRowsState:u,scrollStopDelayUpdatedByTable:d}=r,f=(0,et.useRef)(null),p=(g,b,h=t().lazyLoadCacheOfLoadedBatches)=>{let y=t();if(g=g||f.current,!g)return;let{renderStartIndex:S,renderEndIndex:C}=g,{lazyLoadBatchSize:T,lazyLoad:I}=y;I&&((!T||T<=0)&&(!y.groupBy||y.groupBy.length===0)||JT({startIndex:S,endIndex:C,lazyLoadBatchSize:T,componentState:y,componentActions:n,dismissLoadedRows:b?.dismissLoadedRows??!1},h))},m=(0,et.useMemo)(()=>Pt(p,{wait:d}),[d]);lo(g=>{if(a)return g.sortInfo||g.filterValue||g.groupBy||g.pivotBy||g.refetchKey||g.cursorId?(t().lazyLoadCacheOfLoadedBatches.clear(),t().originalLazyGroupData.clear(),p(s.get(),{dismissLoadedRows:!0})):(g.originalLazyGroupDataChangeDetect||g.groupRowsState)&&p(s.get()),s.onChange(b=>{f.current=b,p(b)})},{sortInfo:e.sortInfo,filterValue:e.filterValue,groupBy:e.groupBy,pivotBy:e.pivotBy,refetchKey:e.refetchKey,cursorId:e.cursorId,lazyLoadBatchSize:i,lazyLoad:a,originalLazyGroupDataChangeDetect:l,groupRowsState:u}),(0,et.useEffect)(()=>{i&&i>0&&m()},[c])}function JT(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,f=["_______xxx______"];for(let g=t;g<=n;g++){let b=s[g];if(!b)continue;let h=c(g),y=b.dataSourceHasGrouping&&b.groupKeys?[...b.groupKeys]:[];b.isGroupRow&&b.dataSourceHasGrouping&&b.groupKeys&&y.pop();let S=y.length?y:f,C=b.dataSourceHasGrouping?b.indexInGroup:b.indexInAll;if(b.isGroupRow&&!b.collapsed&&!b.childrenAvailable){let T={lazyLoadStartIndex:0,lazyLoadBatchSize:r,groupKeys:b.groupKeys,append:u},I=b.groupKeys,w=d.get(I);if(!w?.[b.id]){let v=!w;w=w||{},w[b.id]||(w[b.id]=T),v&&d.set(I,w)}}if(!h&&r!=null){let T=d.get(S),I=Math.floor(C/r)*r,w=C-I,v=s[b.indexInAll-w].indexInAll,R=c(v),x=s[v].id;if(R||T?.[x])continue;let M=!T;T=T||{};let A={lazyLoadStartIndex:I,lazyLoadBatchSize:r,groupKeys:y,append:u};T[x]||(T[x]=A),M&&d.set(S,T)}}let p=Promise.resolve(!0),m=[];d.topDownValues().forEach(g=>{m.push(...Object.values(g))}),m.reduce((g,b)=>{let h=[...b.groupKeys,b.lazyLoadStartIndex];if(e&&e.has(h))return g;e?.set(h,!0);let y=[i.data,i,a,b];return g.then(()=>qT()).then(()=>co(...y))},p)}var eS=Object.freeze([]),Zp=(o,e)=>{let t=o??eS,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};function Ia(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(!Ia(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)||!Ia(o[r],e[r]))return!1;return!0}return!1}function tS(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 va={id:!0,value:!0,indexInAll:!0,rowSelected:!0,rowDisabled:!0,isCellSelected:!1,hasSelectedCells:!1},Qp={...va,dataSourceHasGrouping:!0,isTreeNode:!0,data:!1,isGroupRow:!0,selfLoaded:!0},nS={indexInGroup:!0,groupKeys:!0,groupBy:!0,rootGroupBy:!0,parents:!1,indexInParentGroups:!0,groupCount:!0,groupNesting:!0,collapsed:!0,selfLoaded:!0},oS={...va,...nS,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},Jp={isTreeNode:!0,isParentNode:!0,indexInParent:!0,nodePath:!0,parentNodes:!1,indexInParentNodes:!0,totalLeafNodesCount:!0,collapsedLeafNodesCount:!0,treeNesting:!0,selfLoaded:!0},rS={...va,...Jp,dataSourceHasGrouping:!0,isTreeNode:!0,isGroupRow:!0,isParentNode:!0,data:!1},iS={...va,...Jp,dataSourceHasGrouping:!0,isParentNode:!0,isGroupRow:!0,nodeExpanded:!0,selfExpanded:!0,data:!1,selectedLeafNodesCount:!0,deepRowInfoArray:!1,deselectedLeafNodesCount:!0,duplicateOf:!1},aS=Object.entries(Qp).map(([o,e])=>e?o:void 0).filter(Boolean),lS=Object.entries(Qp).map(([o,e])=>e?o:void 0),sS=Object.entries(oS).map(([o,e])=>e?o:void 0),cS=Object.entries(rS).map(([o,e])=>e?o:void 0),uS=Object.entries(iS).map(([o,e])=>e?o:void 0);function dS(o,e){if(o===e)return!0;if(!o||!e||!tS(o,e)||o.id!==e.id||o.data!==e.data&&!Ia(o.data,e.data))return!1;let t=[];o.dataSourceHasGrouping?t=o.isGroupRow?sS:lS:o.isTreeNode?t=o.isTreeNode&&o.isParentNode?uS:cS:t=aS;for(let n of t){let r=o[n],i=e[n];if(!(typeof r=="function"||typeof i=="function")&&!Ia(r,i))return!1}return!0}function em(){let o=[],e=new Map,t=(s,c)=>{let u=o,d=c?.marker;d&&d.start({details:[{name:"new dataArray length",value:s.length},{name:"old dataArray length",value:u.length}]});let f=[],p=i();for(let m of p){let g=u[m],b=s[m];if(b===void 0){f.push(m);continue}dS(g,b)||f.push(m)}o=s,f.length>0&&queueMicrotask(()=>{for(let m=0,g=f.length;m<g;m++){let b=f[m],h=e.get(b);if(h)for(let y of h)y()}}),d&&d.end({details:[{name:"updated row infos",value:f.length}]})},n=s=>o[s],r=(s,c)=>{let u=e.get(s);return u||(u=new Set,e.set(s,u)),u.add(c),()=>{let d=e.get(s);d&&(d.delete(c),d.size===0&&e.delete(s))}},i=()=>Array.from(e.keys());return{notifyDataArray:t,getRowInfoAtIndex:n,subscribeToRowIndex:r,getDataArray:()=>o,clear:()=>{o=[],e.clear()}}}var fS=Symbol("cursorId"),tm=o=>o.totalLeafNodesCount===0,pS=o=>o.isParentNode?!tm(o):!0;function nm(o){let e=Date.now(),t=[],n=[],r=new Q;return{logger:Dt(`${o.debugId}:DataSource`),debugTimings:new Map,debugWarnings:new Map,devToolsDetected:!!globalThis.__INFINITE_TABLE_DEVTOOLS_HOOK__,rowInfoStore:em(),indexer:new ga,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:Te(),notifyScrollbarsChange:Te(),notifyScrollStop:Te(),notifyRenderRangeChange:Te(),pivotTotalColumnPosition:"end",pivotGrandTotalColumnPosition:!1,scrollStopDelayUpdatedByTable:100,originalLazyGroupData:r,originalLazyGroupDataChangeDetect:0,originalDataArray:t,cursorId:fS,showSeparatePivotColumnForSingleAggregation:!1,propsCache:new Map([["sortInfo",new WeakMap],["rowDisabledState",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 mS(o){let e={...o};return delete e.originalDataArray,e}var gS=[],om=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()},rm=(o,e)=>({onDataParamsChange:t=>t?Lp(t,100,mS):void 0,lazyLoad:t=>!!t,isNodeReadOnly:t=>t??tm,isNodeSelectable:t=>t??pS,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,filterDelay:t=>t??200,filterTypes:t=>({...In,...t}),sortTypes:t=>({...$r,...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 ht)return t;let n=o.propsCache.get("rowDisabledState")??Kt,r=n.get(t);return r||(r=new ht(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=>Zp(t,o.propsCache.get("sortInfo")),groupBy:t=>t??gS});function hS(o,e){return typeof o=="function"?o({array:e.originalDataArray,length:e.originalDataArray.length,lastItem:e.originalDataArray[e.originalDataArray.length-1]}):o}var Kt=new WeakMap;function bS(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 yS={selectedPaths:[],deselectedPaths:[],defaultSelection:!1};function Bp(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.
24
+ Component DEBUG_ID = "${n.debugId}"`),t(r,o,e)},Jr=n=>{let{debugId:e,key:t}=n,o=rm[t];if(o&&(fT({...o,debugId:e}),e&&t)){let r=Lt.get(e);r&&r.getState().devToolsDetected&&o&&(r.getState().debugWarnings.set(t,{...o,debugId:e,status:"new"}),ei(e))}};globalThis.logDevToolsWarning=Jr;var ei=n=>{let e=window.__INFINITE_TABLE_DEVTOOLS_HOOK__;if(!e)return;let t=Lt.get(n);t&&e(n,t)};var am=!0,pT=()=>new Promise(n=>{Ve(n)}),mT={originalDataArray:!0,changes:!0},gT={filterValue:(n,e)=>JSON.stringify(n)===JSON.stringify(e),groupRowsState:(n,e)=>JSON.stringify(n)===JSON.stringify(e)};function yo(n,e,t){let o=n.multiSort?n.sortInfo:n.sortInfo?.[0]??null,r={append:!1,originalDataArray:n.originalDataArray,sortInfo:o,refetchKey:n.refetchKey,groupBy:n.groupBy,pivotBy:n.pivotBy,filterValue:n.filterValue,aggregationReducers:n.aggregationReducers};if(t&&(r.masterRowInfo=t.masterRowInfo),r.groupBy&&(r.groupRowsState=n.groupRowsState.getState()),n.livePagination!==void 0&&(r.livePaginationCursor=n.livePaginationCursor,r.__cursorId=n.cursorId),n.lazyLoad&&(n.lazyLoadBatchSize!=null&&n.lazyLoadBatchSize>0&&(r.lazyLoadBatchSize=n.lazyLoadBatchSize,r.lazyLoadStartIndex=0),r.groupKeys=[]),e&&Object.assign(r,e),r.filterValue&&r.filterValue.length){let l=sm(r.filterValue,{filterMode:n.filterMode,filterTypes:n.filterTypes});l&&l.length&&(r.filterValue=l)}let i={},a=n.dataParams||{};for(let l in r)if(r.hasOwnProperty(l)&&!mT[l]){let s=l,c=gT[s],u=r[s],d=a[s];(c?c(u,d):u===d)||(i[s]=!0)}return r.changes=i,r}function bn(n,e,t,o,r){let i=yo(e,o,r),a=i.append;if(e.lazyLoad){let s=e.originalLazyGroupData,c=[Ho,...i.groupKeys||[]],u=s.get(c);if(!u){let d=[...i.groupKeys||[],i.lazyLoadStartIndex];e.lazyLoadCacheOfLoadedBatches.set(d,!0)}if(u&&u.cache&&c.length>1){let d=u.children,f=d.length,p=!0;for(let m=0;m<f;m++)if(d[m]==null){p=!1;break}if(p)return Promise.resolve(!0)}u?u.childrenLoading||(u.childrenLoading=!0):s.set(c,{error:void 0,children:[],childrenLoading:!0,childrenAvailable:!1,cache:am,totalCount:0,totalCountUnfiltered:0}),t.originalLazyGroupDataChangeDetect=Kt()}typeof n=="function"&&(n=n(i));let l=typeof n=="object"&&typeof n.then=="function";return l&&(!e.lazyLoad||e.lazyLoad&&!a)&&(t.loading=!0),Promise.resolve(n).then(s=>{let c=[],u=!1;if(Array.isArray(s.data)){let f=s;if(c=f.data,f.livePaginationCursor!==void 0&&(t.livePaginationCursor=f.livePaginationCursor),f.mappings&&(t.pivotMappings=f.mappings),f.totalCountUnfiltered&&(t.unfilteredCount=f.totalCountUnfiltered),e.lazyLoad){let m=function(g,b,h){let y=[Ho,...g],S=b.data,T={cache:b.cache??am,childrenLoading:!1,childrenAvailable:!0,totalCount:b.totalCount??S.length,totalCountUnfiltered:b.totalCount??S.length,children:S,error:b.error},C=[];if(i.lazyLoadBatchSize&&!h){let I=p.get(y),v=!I,D=Qu({children:!0},I||{},T);v&&(D.chidren=[]),D.children.length=D.totalCount;let R=i.lazyLoadStartIndex??0,x=Math.min(b.totalCount??S.length,R+i.lazyLoadBatchSize);for(let A=R;A<x;A++){let M=T.children[A-R];if(!M)throw`lazily loaded item not found at index ${A-R}`;D.children[A]=M,M.dataset&&C.push({keys:M.keys,dataset:M.dataset})}v&&p.set(y,D)}else T.children.forEach(I=>{I&&I.dataset&&C.push({keys:I.keys,dataset:I.dataset})}),T.children.length=T.totalCount,p.set(y,T);let w=!1;if(!g||!g.length){let I=p.get([Ho]);t.originalDataArray=[...I.children],w=!0}if(w||(t.originalLazyGroupDataChangeDetect=Kt()),C.length){let I=g;C.forEach(({keys:v,dataset:D})=>{m(v,D,I)})}};var d=m;let p=e.originalLazyGroupData;u=!0,m(i.groupKeys||[],f)}}else c=s;u||(t.originalDataArray=a?e.originalDataArray.concat(c):c),l&&(!e.lazyLoad||e.lazyLoad&&!a)&&(t.loading=!1)})}function sm(n,{filterTypes:e,filterMode:t}){return t==="local"?n:(qs(n,e)||[]).map(o=>{let r={...o};return delete r.valueGetter,r})}function lm(n,e){let t=!!n,{stateReadyAsDetails:o}=e(),r=t&&n.shouldRestoreState?o:!0;return{isDetail:t,isDetailReady:r}}function cm(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:f,filterMode:p,livePagination:m,livePaginationCursor:g,filterTypes:b,cursorId:h}=o,[y,S]=(0,nt.useState)({vertical:!1,horizontal:!1}),T=(0,nt.useRef)(y);(0,nt.useEffect)(()=>(a.onChange(R=>{R&&(T.current=R,S(R))}),()=>a.destroy()),[a]),(0,nt.useEffect)(()=>{if(!m)return;let R=requestAnimationFrame(()=>{T.current?.vertical||g&&(t.cursorId=g)});return()=>cancelAnimationFrame(R)},[g]),(0,nt.useEffect)(()=>{if(!m||g!==void 0)return;let R=requestAnimationFrame(()=>{T.current?.vertical||h!=null&&i.length&&(t.cursorId=i.length)});return()=>cancelAnimationFrame(R)},[i.length,g]),(0,nt.useEffect)(()=>{let R=e(),{livePaginationCursor:x,livePagination:A,dataArray:M}=R;!y.vertical&&A&&(x?t.cursorId=x:x===void 0&&M.length&&(t.cursorId=M.length))},[y.vertical]);let C=(0,nt.useMemo)(()=>sm(f,{filterTypes:b,filterMode:p}),[f,p,b]),w={sortInfo:c.sortInfo?s:null,groupBy:c.groupBy?u:null,pivotBy:c.pivotBy?d:null,refetchKey:l,filterValue:c.filterValue?C:null,cursorId:m?h:null},I=(0,nt.useRef)(!0);hT(n,{sortInfo:s,groupBy:u,pivotBy:d,filterValue:f,refetchKey:l,cursorId:m?h:null});let v=bi(),D=(0,nt.useRef)([]);gn(()=>{let R=e(),x=v(),{isDetail:A,isDetailReady:M}=lm(x,e);if(A&&!M)return;let P=Date.now(),_=D.current;_.length>=10&&_.splice(0,1),_.push(P),P-_[0]<200&&_.length>=10&&Jr({debugId:R.debugId,key:"DS001"}),typeof R.data!="function"&&bn(R.data,R,t,void 0,x)},{data:r}),gn(R=>{let x=Object.keys(R),A=!1;if(x.length===1){if(A=!!R.cursorId,R.filterValue&&e().filterMode==="local")return;let L=e().data;if(Array.isArray(L)&&R.refetchKey){t.originalDataArray=L;return}}let M=v(),{isDetail:P,isDetailReady:_}=lm(M,e);if(P&&!_)return;let E=e();if(typeof E.data=="function"){let L;E.debugId&&(L=ot(E.debugId).track.DataSource.label.RemoteDataLoad.start()),bn(E.data,E,t,{append:A},M).then(()=>{L?.end()})}},{...w,data:r}),gn(()=>{let R=e();if(I.current){I.current=!1;let x=yo(R,void 0,v());t.dataParams=x}},w)}function hT(n,e){let{getDataSourceState:t,dataSourceActions:o,dataSourceState:r}=n;(0,nt.useEffect)(()=>{o.lazyLoadCacheOfLoadedBatches=new ee},[r.data,r.dataParams]);let{lazyLoadBatchSize:i,lazyLoad:a,originalLazyGroupDataChangeDetect:l,notifyRenderRangeChange:s,dataArray:c,groupRowsState:u,scrollStopDelayUpdatedByTable:d}=r,f=(0,nt.useRef)(null),p=(g,b,h=t().lazyLoadCacheOfLoadedBatches)=>{let y=t();if(g=g||f.current,!g)return;let{renderStartIndex:S,renderEndIndex:T}=g,{lazyLoadBatchSize:C,lazyLoad:w}=y;w&&((!C||C<=0)&&(!y.groupBy||y.groupBy.length===0)||bT({startIndex:S,endIndex:T,lazyLoadBatchSize:C,componentState:y,componentActions:o,dismissLoadedRows:b?.dismissLoadedRows??!1},h))},m=(0,nt.useMemo)(()=>Et(p,{wait:d}),[d]);gn(g=>{if(a)return g.sortInfo||g.filterValue||g.groupBy||g.pivotBy||g.refetchKey||g.cursorId?(t().lazyLoadCacheOfLoadedBatches.clear(),t().originalLazyGroupData.clear(),p(s.get(),{dismissLoadedRows:!0})):(g.originalLazyGroupDataChangeDetect||g.groupRowsState)&&p(s.get()),s.onChange(b=>{f.current=b,p(b)})},{sortInfo:e.sortInfo,filterValue:e.filterValue,groupBy:e.groupBy,pivotBy:e.pivotBy,refetchKey:e.refetchKey,cursorId:e.cursorId,lazyLoadBatchSize:i,lazyLoad:a,originalLazyGroupDataChangeDetect:l,groupRowsState:u}),(0,nt.useEffect)(()=>{i&&i>0&&m()},[c])}function bT(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 ee,f=["_______xxx______"];for(let g=t;g<=o;g++){let b=s[g];if(!b)continue;let h=c(g),y=b.dataSourceHasGrouping&&b.groupKeys?[...b.groupKeys]:[];b.isGroupRow&&b.dataSourceHasGrouping&&b.groupKeys&&y.pop();let S=y.length?y:f,T=b.dataSourceHasGrouping?b.indexInGroup:b.indexInAll;if(b.isGroupRow&&!b.collapsed&&!b.childrenAvailable){let C={lazyLoadStartIndex:0,lazyLoadBatchSize:r,groupKeys:b.groupKeys,append:u},w=b.groupKeys,I=d.get(w);if(!I?.[b.id]){let v=!I;I=I||{},I[b.id]||(I[b.id]=C),v&&d.set(w,I)}}if(!h&&r!=null){let C=d.get(S),w=Math.floor(T/r)*r,I=T-w,v=s[b.indexInAll-I].indexInAll,D=c(v),R=s[v].id;if(D||C?.[R])continue;let x=!C;C=C||{};let A={lazyLoadStartIndex:w,lazyLoadBatchSize:r,groupKeys:y,append:u};C[R]||(C[R]=A),x&&d.set(S,C)}}let p=Promise.resolve(!0),m=[];d.topDownValues().forEach(g=>{m.push(...Object.values(g))}),m.reduce((g,b)=>{let h=[...b.groupKeys,b.lazyLoadStartIndex];if(e&&e.has(h))return g;e?.set(h,!0);let y=[i.data,i,a,b];return g.then(()=>pT()).then(()=>bn(...y))},p)}var yT=Object.freeze([]),um=(n,e)=>{let t=n??yT,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};function _a(n,e){if(n===e)return!0;if(n==null||e==null)return n===e;if(typeof n!=typeof e)return!1;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(!_a(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)||!_a(n[r],e[r]))return!1;return!0}return!1}function ST(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 Oa={id:!0,value:!0,indexInAll:!0,rowSelected:!0,rowDisabled:!0,isCellSelected:!1,hasSelectedCells:!1},dm={...Oa,dataSourceHasGrouping:!0,isTreeNode:!0,data:!1,isGroupRow:!0,selfLoaded:!0},TT={indexInGroup:!0,groupKeys:!0,groupBy:!0,rootGroupBy:!0,parents:!1,indexInParentGroups:!0,groupCount:!0,groupNesting:!0,collapsed:!0,selfLoaded:!0},CT={...Oa,...TT,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},fm={isTreeNode:!0,isParentNode:!0,indexInParent:!0,nodePath:!0,parentNodes:!1,indexInParentNodes:!0,totalLeafNodesCount:!0,collapsedLeafNodesCount:!0,treeNesting:!0,selfLoaded:!0},wT={...Oa,...fm,dataSourceHasGrouping:!0,isTreeNode:!0,isGroupRow:!0,isParentNode:!0,data:!1},IT={...Oa,...fm,dataSourceHasGrouping:!0,isParentNode:!0,isGroupRow:!0,nodeExpanded:!0,selfExpanded:!0,data:!1,selectedLeafNodesCount:!0,deepRowInfoArray:!1,deselectedLeafNodesCount:!0,duplicateOf:!1},RT=Object.entries(dm).map(([n,e])=>e?n:void 0).filter(Boolean),vT=Object.entries(dm).map(([n,e])=>e?n:void 0),DT=Object.entries(CT).map(([n,e])=>e?n:void 0),PT=Object.entries(wT).map(([n,e])=>e?n:void 0),xT=Object.entries(IT).map(([n,e])=>e?n:void 0);function MT(n,e){if(n===e)return!0;if(!n||!e||!ST(n,e)||n.id!==e.id||n.data!==e.data&&!_a(n.data,e.data))return!1;let t=[];n.dataSourceHasGrouping?t=n.isGroupRow?DT:vT:n.isTreeNode?t=n.isTreeNode&&n.isParentNode?xT:PT:t=RT;for(let o of t){let r=n[o],i=e[o];if(!(typeof r=="function"||typeof i=="function")&&!_a(r,i))return!1}return!0}function pm(){let n=[],e=new Map,t=(s,c)=>{let u=n,d=c?.marker;d&&d.start({details:[{name:"new dataArray length",value:s.length},{name:"old dataArray length",value:u.length}]});let f=[],p=i();for(let m of p){let g=u[m],b=s[m];if(b===void 0){f.push(m);continue}MT(g,b)||f.push(m)}n=s,f.length>0&&queueMicrotask(()=>{for(let m=0,g=f.length;m<g;m++){let b=f[m],h=e.get(b);if(h)for(let y of h)y()}}),d&&d.end({details:[{name:"updated row infos",value:f.length}]})},o=s=>n[s],r=(s,c)=>{let u=e.get(s);return u||(u=new Set,e.set(s,u)),u.add(c),()=>{let d=e.get(s);d&&(d.delete(c),d.size===0&&e.delete(s))}},i=()=>Array.from(e.keys());return{notifyDataArray:t,getRowInfoAtIndex:o,subscribeToRowIndex:r,getDataArray:()=>n,clear:()=>{n=[],e.clear()}}}var AT=Symbol("cursorId"),mm=n=>n.totalLeafNodesCount===0,ET=n=>n.isParentNode?!mm(n):!0;function gm(n){let e=Date.now(),t=[],o=[],r=new ee;return{logger:_t(`${n.debugId}:DataSource`),debugTimings:new Map,debugWarnings:new Map,devToolsDetected:!!globalThis.__INFINITE_TABLE_DEVTOOLS_HOOK__,rowInfoStore:pm(),indexer:new Ra,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 ee,waitForNodePathPromises:new ee,getDataSourceMasterContextRef:{current:()=>{}},cache:void 0,detailDataSourcesStateToRestore:new Map,stateReadyAsDetails:!1,originalDataArrayChanged:!1,originalDataArrayChangedInfo:{timestamp:0,mutations:void 0},rowsPerPage:null,lazyLoadCacheOfLoadedBatches:new ee,dataParams:void 0,onCleanup:Se(),notifyScrollbarsChange:Se(),notifyScrollStop:Se(),notifyRenderRangeChange:Se(),pivotTotalColumnPosition:"end",pivotGrandTotalColumnPosition:!1,scrollStopDelayUpdatedByTable:100,originalLazyGroupData:r,originalLazyGroupDataChangeDetect:0,originalDataArray:t,cursorId:AT,showSeparatePivotColumnForSingleAggregation:!1,propsCache:new Map([["sortInfo",new WeakMap],["rowDisabledState",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 _T(n){let e={...n};return delete e.originalDataArray,e}var OT=[],hm=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()},bm=(n,e)=>({onDataParamsChange:t=>t?qp(t,100,_T):void 0,lazyLoad:t=>!!t,isNodeReadOnly:t=>t??mm,isNodeSelectable:t=>t??ET,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,filterDelay:t=>t??200,filterTypes:t=>({...Ao,...t}),sortTypes:t=>({...Qr,...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 wt)return t;let o=n.propsCache.get("rowDisabledState")??Bt,r=o.get(t);return r||(r=new wt(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=>um(t,n.propsCache.get("sortInfo")),groupBy:t=>t??OT});function FT(n,e){return typeof n=="function"?n({array:e.originalDataArray,length:e.originalDataArray.length,lastItem:e.originalDataArray[e.originalDataArray.length-1]}):n}var Bt=new WeakMap;function NT(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 LT={selectedPaths:[],deselectedPaths:[],defaultSelection:!1};function om(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.
25
25
 
26
26
 
27
- `);let n=Wo(t);if(o instanceof Qe)return o.setConfig(n),o;(o==null||typeof o!="object")&&(o=void 0);let r=o??yS,i=Kt.get(r);return i&&i.setConfig(n),i=i??new Qe(r,n),Kt.set(r,i),i}function im(o){let{props:e,state:t,oldState:n}=o,r=!!t.nodesKey,i=yr(e.sortInfo),a=yr(e.filterValue),{filterTypes:l}=t,s=Object.keys(l).reduce((P,_)=>{let D=l[_].operators;P[_]=P[_]||{};let O=P[_];return D.forEach(F=>{O[F.name]=F}),P},{}),c=e,u=e.selectionMode;if(u===void 0)if(e.cellSelection!==void 0||e.defaultCellSelection!==void 0)u="multi-cell";else{let P=e.rowSelection!==void 0?e.rowSelection:e.defaultRowSelection;if(P!==void 0&&(P&&typeof P=="object"?u="multi-row":u="single-row"),!u){let _=c.treeSelection??c.defaultTreeSelection;_!==void 0&&(u=typeof _=="object"?"multi-row":"single-row")}u=u??!1}let d=null,f=null,p=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")&&(p===null?d=u==="single-row"?null:new Ee({selectedRows:[],deselectedRows:[],defaultSelection:!1},dt(t)):u==="single-row"||p instanceof Ee?d=p:d=new Ee(p,dt(t))),u==="single-cell"||u==="multi-cell"))if(m===null)f=u==="single-cell"?null:new Be;else if(m instanceof Be)f=m;else{let P=Kt.get(m)??new Be(m);Kt.set(m,P),f=P}let g=t.primaryKey,b=typeof g=="function"?P=>g(P):P=>P[g],h=c.treeExpandState||t.treeExpandState||c.defaultTreeExpandState;if(h&&!(h instanceof rt)){let P=Kt.get(h)??new rt(h);Kt.set(h,P),h=P}h=h||new rt({defaultExpanded:!0,collapsedPaths:[]});let y=e.groupRowsState||t.groupRowsState||e.defaultGroupRowsState;if(y&&!(y instanceof gt)){let P=Kt.get(y)??new gt(y);Kt.set(y,P),y=P}y=y||new gt(t.lazyLoad?{expandedRows:[],collapsedRows:!0}:{expandedRows:!0,collapsedRows:[]});let S=bS(e.shouldReloadData||{}),C=e.groupMode??(S.groupBy!=null?S.groupBy?"remote":"local":void 0),T=e.sortMode??S.sortInfo!=null?S.sortInfo?"remote":"local":void 0,I=e.filterMode??S.filterValue!=null?S.filterValue?"remote":"local":void 0;e.groupMode&&Bo('"groupMode" prop is deprecated for the <DataSource />, use "shouldReloadData.groupBy: true|false" instead',"groupMode deprecated",t.logger),e.sortMode&&Bo('"sortMode" prop is deprecated for the <DataSource />, use "shouldReloadData.sortInfo: true|false" instead',"sortMode deprecated",t.logger),e.filterMode&&Bo('"filterMode" prop is deprecated for the <DataSource />, use "shouldReloadData.filterValue: true|false" instead',"filterMode deprecated",t.logger);let w=typeof e.data=="function"?C??"local":"local",v=e.sortFunction?"local":T??(i?"remote":"local"),R=typeof e.filterFunction=="function"||typeof e.treeFilterFunction=="function"?"local":I??(typeof e.data=="function"?"remote":"local"),x=S.pivotBy?"remote":"local",M=t.rowDisabledState,A=e.isRowDisabled;if(!A&&M){let P=Kt.get(M);P?A=P:(A=_=>M.isRowDisabled(_.id),Kt.set(M,A))}let E={debugId:t.debugId??e.debugId,isTree:r,selectionMode:u,groupRowsState:y,treeExpandState:h,treeExpandMode:h.mode,shouldReloadData:{filterValue:S?.filterValue??R==="remote",sortInfo:S?.sortInfo??v==="remote",groupBy:S?.groupBy??w==="remote",pivotBy:S?.pivotBy??x==="remote"},isRowDisabled:A,rowSelection:d,cellSelection:f,groupMode:w,sortMode:v,filterMode:R,pivotMode:x,toPrimaryKey:b,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 P=!n||n.originalDataArray!==t.originalDataArray,_=typeof e.livePaginationCursor=="function"?P?hS(e.livePaginationCursor,t):t.livePaginationCursor:e.livePaginationCursor;E.livePaginationCursor=_}if(t.devToolsDetected&&t.debugId){let P=dn.get(t.debugId);P&&(E={...E,...P})}return E}var TS=Dt("DataSource:fullLazyLoad");function am(o,e,t){let{name:n,newValue:r}=o;n==="data"&&typeof r=="function"&&!e.groupRowsState&&(e.lazyLoad&&TS('"data" function prop has changed'),e.collapseGroupRowsOnDataFunctionChange!==!1&&(t.groupRowsState=new gt({collapsedRows:!0,expandedRows:[]})))}function lm(){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 Be?o.getState().selectedCells:null,"single-cell"]}:{callbackParams:[o.getState(),"multi-cell"]}}}function sm(){return{sortInfo:(o,{actions:e,state:t})=>{let n=t.getDataSourceMasterContextRef.current,r=pn(t,{sortInfo:o,livePaginationCursor:null},n());e.dataParams=r,t.livePagination&&ze(()=>{e.livePaginationCursor=null})},groupBy:(o,{actions:e,state:t})=>{let n=t.getDataSourceMasterContextRef.current,r=pn(t,{groupBy:o,livePaginationCursor:null},n());e.dataParams=r,t.livePagination&&ze(()=>{e.livePaginationCursor=null})},pivotBy:(o,{actions:e,state:t})=>{let n=t.getDataSourceMasterContextRef.current,r=pn(t,{pivotBy:o,livePaginationCursor:null},n());e.dataParams=r,t.livePagination&&ze(()=>{e.livePaginationCursor=null})},filterValue:(o,{actions:e,state:t})=>{let n=t.getDataSourceMasterContextRef.current,r=pn(t,{filterValue:o,livePaginationCursor:null},n());e.dataParams=r,t.livePagination&&ze(()=>{e.livePaginationCursor=null})},cursorId:(o,{actions:e,state:t})=>{let n=t.getDataSourceMasterContextRef.current,r=pn(t,{__cursorId:o},n());e.dataParams=r},livePaginationCursor:(o,{actions:e,state:t})=>{let n=t.getDataSourceMasterContextRef.current,r=pn(t,{livePaginationCursor:o},n());e.dataParams=r},dataParams:(o,{state:e})=>At(o,e.dataParams,new Set(["changes","originalDataArray","masterRowInfo"]))?!1:(Dt(An(e.debugId,"DataSource:dataParams"))("onDataParamsChange triggered because the following values have changed",o?.changes),!0)}}function cm(o){return{originalDataArray:o.originalDataArray,groupRowsState:o.groupRowsState,groupBy:o.groupBy,pivotBy:o.pivotBy,sortInfo:o.sortInfo,filterValue:o.filterValue,livePaginationCursor:o.livePaginationCursor}}var Ct=V(require("react"));function $o(o){let e=He(),t=Ae(e),n=!!e,r=n?e.masterRowInfo.id:"master",{contextValue:i,ContextComponent:a}=Gs(o),{componentActions:l,componentState:s,assignState:c}=i;s.getDataSourceMasterContextRef.current=t;let u=Ae(s),[d]=(0,Ct.useState)(()=>Vp({getState:u,actions:l})),f={componentState:s,componentActions:l,getDataSourceMasterContext:t,getState:u,assignState:c,api:d},p=Ae(i),m=Ae(f),g=br(),b=(0,Ct.useCallback)(({children:h})=>(typeof h=="function"&&(h=h(u())),Ct.default.createElement(a.Provider,{key:r,value:p()},Ct.default.createElement(g.Provider,{value:m()},h))),[a,n,r]);return(0,Ct.useLayoutEffect)(()=>{e&&e.registerDetail(f)},[]),(0,Ct.useLayoutEffect)(()=>()=>{let h=u();h.onCleanup(h)},[]),Xp({componentState:s,componentActions:l,getComponentState:u}),(0,Ct.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,Ct.useEffect)(()=>{s.onReady?.(d)},[]),{DataSource:b,state:f.componentState}}var wt=class extends jo{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)}};var xa=class xa{constructor(e,t){this.keysInOrder=[];if(typeof e=="number")this.maxSize=e,this.currentMap=new Map;else if(this.maxSize=t??xa.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}};xa.DEFAULT_SIZE=10;var Ra=xa;var Hs=class{add(e,t){}get(e){}delete(e){}has(e){return!1}},Pa=class{constructor(e){this.storage=new Ra(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)}},Ks=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)}},Uo=class{constructor(e){this.cacheStorage=e===!1?new Hs:e===!0?new Ks:typeof e=="number"?new Pa(e):new Pa(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 um=(e=>(e.INIT="INIT",e))(um||{});var{useManagedComponent:Gs}=Et({debugName:"DataSource",initSetupState:nm,forwardProps:rm,concludeReducer:Kp,mapPropsToState:im,onPropChange:am,cleanup:om,interceptActions:sm(),mappedCallbacks:lm()});function SS(o){let{DataSource:e}=$o(o);return dm.createElement(e,null,o.children??null)}function CS(){let{rowInfoReducerResults:o}=on();return o}function wS(){let o=He();if(o)return o.masterRowInfo}function Bs(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(p,m){let g=l[c+p*m],b=a.get(g);if(b&&b.renderMenuIcon!==!1)return g}let c=l.indexOf(r),u=0,d=-1,f;for(;!f&&u<l.length&&(u++,f=s(u,d),f||(d*=-1,f=s(u,d)),!f););return f&&(n.columnMenuVisibleForColumnId=f),f}function Da(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 Ws(o,e,t){let{rowsPerPage:n}=t;return n?Math.floor(o.rowIndex/n)===Math.floor(e.rowIndex/n):!0}function fm(o,e,t){if(Ws(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),f=Math.floor(c/n),p=l%n,m=c%n,g=Math.min(p,m),b=Math.max(p,m),h=[];for(let y=d;y<=f;y++)for(let S=g;S<=b;S++){let C=y*n+S;if(y===d)for(let T=s;T<r;T++)h.push({rowIndex:C,colIndex:T});else if(y===f)for(let T=0;T<=u;T++)h.push({rowIndex:C,colIndex:T});else for(let T=0;T<r;T++)h.push({rowIndex:C,colIndex:T})}return h}function IS(o,e){let t=new Set(o);return e.map(n=>t.has(n)?n:null).filter(n=>n!=null)}var js=class{constructor(e){this.getCellSelectionPosition=e=>{let t=e.rowId??Fn(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 Be(i);a.debugId=r.debugId??"";let[l,s]=this.getCellSelectionPosition(e),[c,u]=this.getCellSelectionPosition(t),d=this.getComputed().computedVisibleColumnsMap.get(s),f=this.getComputed().computedVisibleColumnsMap.get(u);if(!d||!f)return;let p=d.computedVisibleIndex,m=f.computedVisibleIndex,g=Fn(l,this.getDataSourceState),b=Fn(c,this.getDataSourceState);if(!g||!b)return;let h=g.indexInAll,y=b.indexInAll,[S,C]=Da({rowIndex:h,colIndex:p},{rowIndex:y,colIndex:m});for(let T=S.rowIndex;T<=C.rowIndex;T++)for(let I=S.colIndex;I<=C.colIndex;I++){let w={rowIndex:T,colIndex:I},[v,R]=this.getCellSelectionPosition(w);n?a.selectCell(v,R):a.deselectCell(v,R)}this.dataSourceActions.cellSelection=a};this.getCellSelectionPositionsWithFn=(e,t)=>{let n=ha(this.getDataSourceState),{computedVisibleColumns:r}=this.getComputed(),i=r.map(d=>d.id),a=new Set,l=[],s=new Set;n.filter(d=>{r.forEach(f=>{this.isCellSelected({rowId:d.id,colId:f.id})&&(a.has(f.id)||a.add(f.id),s.has(d.id)||(s.add(d.id),l.push(d)))})});let c=IS(Array.from(a),i),u=l.map(d=>c.map(f=>this.isCellSelected({rowId:d.id,colId:f})?e(d,f):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 Be(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 Be(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 Be:new Be(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 Be(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 Be(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 Be(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 pm(o){return new js(o)}function mm(o){let{dataSourceApi:e,getState:t,actions:n}=o,r={collapseAllDetails(){n.rowDetailState=new wt({collapsedRows:!0,expandedRows:[]})},expandAllDetails(){n.rowDetailState=new wt({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 wt(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 wt(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 kn(o,e,t){return Math.min(Math.max(o,e),t)}function Ma(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 kn(a,r,i)}function vS(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:f}=u;if(f==null)return!1;let{start:[p],end:[m]}=d.getRenderRange(),g=f,b=m-p-1,h=0,y=c-1,S={ArrowDown:()=>{f=Ma(n,f,1)},ArrowUp:()=>{f=Ma(n,f,-1)},ArrowLeft:()=>{let T=s[f];if(d.isHorizontalLayoutBrain){let I=d.rowsPerPage;f-I>=h?f=f-I:S.ArrowUp();return}return T&&T.isGroupRow?i.collapseGroupRow(T.groupKeys):T&&i.rowDetailApi.isRowDetailEnabledForRow(T.id)?i.rowDetailApi.collapseRowDetail(T.id):!1},ArrowRight:()=>{let T=s[f];if(d.isHorizontalLayoutBrain){let I=d.rowsPerPage;f+I<=y?f=f+I:S.ArrowDown();return}return T&&T.isGroupRow?i.expandGroupRow(T.groupKeys):T&&i.rowDetailApi.isRowDetailEnabledForRow(T.id)?i.rowDetailApi.expandRowDetail(T.id):!1},Enter:()=>{let T=s[f];return T&&T.isGroupRow?i.toggleGroupRow(T.groupKeys):T&&T.isTreeNode&&T.isParentNode?a.treeApi.toggleNode(T.nodePath):i.rowDetailApi.isRowDetailEnabledForRow(T.id)?i.rowDetailApi.toggleRowDetail(T.id):!1},PageDown:()=>{f=Math.min(f+b,c-1)},PageUp:()=>{f=Math.max(f-b,h)},End:()=>{f=y},Home:()=>{f=h}},C=S[l];return C?(C(),g!==f?(r.activeRowIndex=f,!0):!1):!1}function $s(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:f}=u;if(!d)return!1;let[p,m]=d,{start:[g,b],end:[h,y]}=f.getRenderRange(),S=h-g-1,C=y-b-1,T=i().dataArray.length-1,I=r().computedVisibleColumns.length-1,w=0,v=0;p=kn(p,0,T),m=kn(m,0,I);let R={ArrowDown:()=>{p=kn(p+1,w,T)},ArrowUp:()=>{p=kn(p-1,w,T)},ArrowLeft:()=>{if(m===v)if(p!==w&&(m=I),f.isHorizontalLayoutBrain){let M=f.rowsPerPage;p-M>=w?p=p-M:R.ArrowUp()}else R.ArrowUp();else m=kn(m-1,v,I)},ArrowRight:()=>{if(m===I)if(p!==T&&(m=v),f.isHorizontalLayoutBrain){let M=f.rowsPerPage;p+M<=T?p=p+M:R.ArrowDown()}else R.ArrowDown();else m=kn(m+1,v,I)},Enter:()=>{let M=c[p];return M&&M.isGroupRow?t.toggleGroupRow(M.groupKeys):M&&M.isTreeNode&&M.isParentNode?a.treeApi.toggleNode(M.nodePath):M&&t.rowDetailApi.isRowDetailEnabledForRow(M.id)?t.rowDetailApi.toggleRowDetail(M.id):!1},PageDown:()=>{s?m=Math.min(m+C,I):p=Math.min(p+S,T)},PageUp:()=>{s?m=Math.max(m-C,v):p=Math.max(p-S,w)},End:()=>{s?m=I:p=T},Home:()=>{s?m=v:p=w}},x=R[l];return x?(x(),[p,m]):!1}function RS(o,e){let t=$s(o,e);return t?(o.actions.activeCellIndex=t,!0):!1}var xS={ArrowUp:!0,ArrowDown:!0,ArrowLeft:!0,ArrowRight:!0,PageUp:!0,PageDown:!0,Home:!0,End:!0,Enter:!0," ":!0};function gm(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||!xS[t]?!1:i!=null&&l==="row"?vS(o,e):a!=null&&l==="cell"?RS(o,e):!1}var Us=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=Ma(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=$s(this.param,{key:n,shiftKey:!1});return r===!1?!1:(this.param.actions.activeCellIndex=r,r)}};function hm(o){return new Us(o)}function bm(o,e){return o.id?o.id===e.id:!!(o.field&&o.field===e.field)}var Ys=class{constructor(e){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(d=>requestAnimationFrame(d));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={...St({rowIndex:t.rowIndex,columnId:t.columnId,...this.context,api:this}),value:i,initialValue:t.initialValue},l=i;n.current=null,r.getValueToPersist&&(l=await r.getValueToPersist(a)),a.value=l,t.value=l;let s=this.getState().persistEdit??(()=>{if(!a.column.field)return i;let d=this.getDataSourceState().primaryKey,f=a.data&&typeof d=="string"?{[d]:a.data[d],[a.column.field]:l}:{...a.data,[a.column.field]:l};return this.context.dataSourceApi.updateData(f)}),c;try{c=await s(a)}catch(d){c=d}let u=c instanceof Error?c:!0;return this.actions.editingCell={...t,active:!1,accepted:!1,waiting:!1,persisted:u},Promise.resolve(u)};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({...St({...this.context,api:this,dataSourceApi:this.context.dataSourceApi,columnId:l,rowIndex:a}),value:i,initialValue:n.initialValue}):!0;return await new Promise(f=>requestAnimationFrame(f)),Promise.resolve(d).then(f=>{if(f===!0)return this.actions.editingCell={...t.editingCell,active:!1,accepted:!0,persisted:!1,waiting:"persist",value:i},!0;throw f}).catch(f=>(f instanceof Error||(f=new Error(`Edit rejected: ${f}`)),this.actions.editingCell={...n,value:i,persisted:!1,active:!1,waiting:!1,accepted:f},{reject:f,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(St({...this.context,api:this,columnId:r,rowIndex:i}));return typeof c=="boolean"?Promise.resolve(c):c};this.getColumnApi=e=>ut(e,{...this.context,api:this});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 f=this,{isRowDetailEnabled:p}=a(),m=!p||typeof p=="function"&&!p(u)?!1:this.rowDetailApi.isRowDetailExpanded(u.id)?"expanded":"collapsed",g=_o({column:c,rowInfo:u,columnsMap:l,context:{...this.context,api:f},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 gt(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 gt(t.groupRowsState);if(n.toggleGroupRow(e),this.dataSourceActions.groupRowsState=n,t.lazyLoad){let r=[Nn,...e],i=t.originalLazyGroupData.get(r);n.isGroupRowExpanded(e)?i?.cache||co(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=Ht())}};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,f=r.brain.scrollTopMax;if(d<0&&f<0)return!0;let p=c.scrollLeft>d+(n.offset||0),m=c.scrollTop>f+(n.offset||0);return p&&m?!1:(c.scrollLeft!==u.scrollLeft&&!p&&(r.scrollerDOMRef.current.scrollLeft=c.scrollLeft),c.scrollTop!==u.scrollTop&&!m&&(r.scrollerDOMRef.current.scrollTop=c.scrollTop),!0)};this.context=e,this.rowSelectionApi=Fp({dataSourceActions:e.dataSourceActions,getDataSourceState:e.getDataSourceState}),this.keyboardNavigationApi=hm({getState:e.getState,getDataSourceState:e.getDataSourceState,actions:e.actions,getComputed:e.getComputed,api:this,dataSourceApi:e.dataSourceApi}),this.rowDetailApi=mm({getState:e.getState,actions:e.actions,dataSourceApi:e.dataSourceApi}),this.cellSelectionApi=pm({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)&&(Bs(t),e?.()),setTimeout(()=>{this.isDestroyed()||(Bs(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],f=i??Zd({column:u,rowInfo:d}),p=f;u.getValueToEdit&&(f=await u.getValueToEdit(St({...this.context,rowIndex:a,columnId:t,api:this}))),this.actions.editingCell={active:!0,accepted:!1,persisted:!1,columnId:t,value:f,initialValue:p,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.groupByForColumn,s=i.field,c=l?Array.isArray(l)?l:[l]:[],u=c.map(p=>p.valueGetter?m=>p.valueGetter({data:m,field:p.field}):p.field?p.field:p.groupField??void 0).filter(yn);u.length&&(s=u);let d=i.computedSortType;c.length&&d===Io&&(d=c.flatMap(m=>{let g=m.field??m.groupField,b=g?r.get(g):null;return b?b.computedSortType:Io}));let f={dir:t,id:i.id,field:s,type:d};i.valueGetter&&(f.valueGetter=p=>i.valueGetter({data:p,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=>!bm(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:bm(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,f=s[u].defaultFilterValue??(c.emptyValues||[])[0]??void 0;return{...a,filter:{...a.filter,operator:u,value:f}}}return a}).filter(yn),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}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){let t=this.getState();t.scrollerDOMRef.current&&(t.scrollerDOMRef.current.scrollLeft=Math.max(e,0))}get scrollTop(){return this.getState().brain.getScrollPosition().scrollTop}set scrollTop(e){let t=this.getState();t.scrollerDOMRef.current&&(t.scrollerDOMRef.current.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&&(n.scrollerDOMRef.current.scrollTop=s.scrollTop),u&&(n.scrollerDOMRef.current.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&&(n.scrollerDOMRef.current.scrollLeft=l.scrollLeft),!0)}};function ym(o){return new Ys(o)}var uo=require("react");var PS=10;function DS(o,e){let{includeHeader:t,columnsToResize:n,columnsToSkip:r}=e,i=`.${Qn} > .${ns}`,a=o.current?.querySelectorAll(i),l={},s={};return a&&a.length&&a.forEach(c=>{let u=c.parentElement,d=u.matches(`.${qn}`);if(t===!1&&d)return;let f=u.getAttribute("data-column-id"),p=c.cloneNode(!0);p.style.visibility="hidden",p.style.pointerEvents="none",p.classList.remove(...Ut.split(" ")),p.style.position="absolute",p.style.width="auto",u.appendChild(p);let m=p.offsetWidth;if(u.removeChild(p),!s[f]){let g=xe().getComputedStyle(u);s[f]=parseInt(g.paddingLeft,10)+parseInt(g.paddingRight,10)+parseInt(g.borderLeftWidth,10)+parseInt(g.borderRightWidth,10)+PS}if(m+=s[f],d){let g=0;u.childNodes.forEach(b=>{if(b!==c){let h=b,y=Math.max(h.offsetWidth,parseInt(h.style.width,10));if(isNaN(y)&&(y=0),g+=y,y>0){let S=xe().getComputedStyle(h);g+=parseInt(S.marginLeft,10)+parseInt(S.marginRight,10)}}}),m+=g}r&&r.has(f)||n&&!n.has(f)||(l[f]=Math.max(m,l[f]||0))}),l}function Tm(){let{getComponentState:o,componentActions:e,componentState:{domRef:t,ready:n,autoSizeColumnsKey:r,brain:i}}=qe(),[a,l]=(0,uo.useState)(0),s=typeof r=="object"?r.key:r,c=Ae(s),u=(0,uo.useRef)(null);(0,uo.useEffect)(()=>{if(c()==null)return;let{current:f}=u,p=()=>{r!==f&&l(a+1)};return i.onRenderRangeChange(p)},[i]),(0,uo.useEffect)(()=>{if(s==null)return;let{autoSizeColumnsKey:d}=o(),f,p,m=!0;typeof d=="object"&&(d.columnsToResize&&(f=new Set(d.columnsToResize)),d.columnsToSkip&&(p=new Set(d.columnsToSkip)),m=d.includeHeader??m),u.current=s;let g=DS(t,{includeHeader:m,columnsToResize:f,columnsToSkip:p}),b=Object.keys(g);if(!b.length)return;let h=o().columnSizing,y={...h},S=!1;b.forEach(C=>{y[C]={width:g[C]},S=S||y[C].width!==h[C]?.width}),S&&(e.columnSizing=y)},[s,n,a])}var qo=require("react");var Ea=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&&!Ws(e,t,r)){fm(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]=Da(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 Sm(o,e){return o<e?[o,e]:[e,o]}var Aa=class{constructor(e){this.multiSelectStartIndex=0;this.getIdForIndex=e.getIdForIndex,this.isRowDisabledAt=e.isRowDisabledAt}set rowSelectionState(e){this._rowSelectionState=e}get rowSelectionState(){return this._rowSelectionState}selectRange(e,t){let[n,r]=Sm(e,t),i=this.rowSelectionState;for(let a=n;a<=r;a++){let l=this.getIdForIndex(a);this.isRowDisabledAt(a)||i.selectRow(l)}}deselectRange(e,t){let[n,r]=Sm(e,t),i=this.rowSelectionState;for(let a=n;a<=r;a++){let l=this.getIdForIndex(a);this.isRowDisabledAt(a)||i.deselectRow(l)}}resetClick(e){this.rowSelectionState.deselectAll();let t=this.getIdForIndex(e);this.rowSelectionState.selectRow(t),this.multiSelectStartIndex=e,this.multiSelectEndIndex=void 0}singleAddClick(e){let t=this.getIdForIndex(e);if(this.rowSelectionState.isRowSelected(t))this.rowSelectionState.deselectRow(t),this.rowSelectionState.isRowSelected(this.getIdForIndex(e+1))&&(this.multiSelectStartIndex=e+1);else{this.rowSelectionState.selectRow(t),this.multiSelectStartIndex=e;let n;for(let r=e-1;r>=0;r--){let i=this.getIdForIndex(r);if(this.rowSelectionState.isRowSelected(i))n=r;else break}this.multiSelectEndIndex=n}}multiSelectClick(e){this.multiSelectEndIndex!=null&&this.deselectRange(this.multiSelectStartIndex,this.multiSelectEndIndex),this.selectRange(this.multiSelectStartIndex,e),this.multiSelectEndIndex=e}};var Cm=require("react");function wm(o){let{getState:e}=Oe();return(0,Cm.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 Im=require("react");var _k=Dt("useColumnSizeFn");function vm(o){return(0,Im.useCallback)(t=>{let n=o[t];return n?n.computedWidth:0},[o])}var Bt=require("react");var zn=require("react");var MS={scrollLeft:0,scrollTop:0},qr=class{constructor(){this.scrollPosition=MS;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)}};function Rm(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 xm=V(require("react"));function Pm(o){return(e,t)=>xm.createElement(o,{key:e.id,rowInfo:e,cache:t})}var Xr=class extends no{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.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+=qi(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,f=u&&s!==this.availableHeight;d&&(this.availableWidth=l,this.availableRenderWidth=l),f&&(this.availableHeight=s,this.availableRenderHeight=s),(d||f)&&this.notifyAvailableSizeChange();let p=typeof n=="number",m=typeof r=="number",g=p&&n!==this.initialRows,b=m&&r!==this.initialCols;p&&g&&(this.initialRows=n,this.rows=n),m&&b&&(this.initialCols=r,this.cols=r);let h=i!=null,y=a!=null,S=h&&i!==this.rowHeight,C=y&&a!==this.initialColWidth;h&&(this.rowHeight=i),y&&(this.initialColWidth=a,this.colWidth=this.getColWidth);let T=g||S||f,I=b||C||d||T;(I||T)&&this.updateRenderCount({horizontal:I,vertical:T})}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=ln){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=>{ze(()=>{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())}getVirtualizedContentSizeFor(t){return t==="vertical"?this.getInitialRowHeight()*this.rowsPerPage:this.pageWidth*this.totalPageCount}};var Dm={};function qs(o){return`.${Xt}[data-row-index${o?`="${o.rowIndex}"`:""}][data-col-index${o?`="${o.colIndex}"`:""}]`}function Xs(o,e){let t=An(o),n=e?new Xr(t,{isHeader:!1}):new no(t),r=`${t}:header`,i=e?new Xr(r,{isHeader:!0,masterBrain:n}):new no(r);n.onScroll(u=>{i.setScrollPosition({scrollLeft:u.scrollLeft,scrollTop:0})});let{renderer:a,onRenderUpdater:l}=zr(n),{renderer:s,onRenderUpdater:c}=zr(i);return n.onAvailableSizeChange(u=>{i.update({width:u.width})}),{brain:n,headerBrain:i,renderer:a,onRenderUpdater:l,headerRenderer:s,headerOnRenderUpdater:c}}function Mm({debugId:o,wrapRowsHorizontally:e}){let t={},{brain:n,headerBrain:r,renderer:i,onRenderUpdater:a,headerRenderer:l,headerOnRenderUpdater:s}=Xs(o,!!e),c=(0,zn.createRef)(),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 f=qs(d);return c.current.querySelector(f)||null},brain:n,headerBrain:r,domRef:c,columnMenuTargetRef:(0,zn.createRef)(),editingValueRef:(0,zn.createRef)(),scrollerDOMRef:(0,zn.createRef)(),portalDOMRef:(0,zn.createRef)(),focusDetectDOMRef:(0,zn.createRef)(),activeCellIndicatorDOMRef:(0,zn.createRef)(),onColumnMenuClick:Te(),cellContextMenu:Te(),contextMenu:Te(),onFilterOperatorMenuClick:Te(),flashingDurationCSSVarValue:null,onFlashingDurationCSSVarChange:Te(),onRowHeightCSSVarChange:Te(),onRowDetailHeightCSSVarChange:Te(),onColumnHeaderHeightCSSVarChange:Te(),cellClick:Te(),cellMouseDown:Te(),keyDown:Te(),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 qr,pinnedEndScrollListener:new qr,columnsWhenInlineGroupRenderStrategy:void 0,editingCell:null,forceBodyRerenderTimestamp:0}}var Em=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,columnPinning:1,editable:1,columnDefaultEditable:1,columnDefaultFilterable:1,columnDefaultGroupable:1,columnDefaultSortable:1,keyboardShortcuts:1,rowStyle:1,cellStyle: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 Uo(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,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:0,rowDetailHeight:e=>typeof e=="number"||typeof e=="function"?e:300,columnHeaderHeight:e=>typeof e=="number"?e:30,columns:1,columnVisibility:e=>e??Dm,columnGroupVisibility:e=>e??Dm,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 ES(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 Am=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 _m(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 _a=new WeakMap;function Om(){return{rowDetailState:(o,e)=>({callbackParams:[o,{expandRow:e.lastRowToExpandRef.current,collapseRow:e.lastRowToCollapseRef.current}]})}}var Nm=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&&t.pivotColumnGroups!=n?.pivotColumnGroups?Rm(i,t.columnGroupVisibility):t.columnGroupsDepthsMap,l=r?.groupBy,s=ES({groupRenderStrategy:e.groupRenderStrategy,groupBy:l,groupColumn:e.groupColumn}),c,u=e.rowDetailRenderer,d=e.components?.RowDetail;if(!u&&d){let b=_a.get(d);b||(b=Pm(d),_a.set(d,b)),u=b}u&&(c=e.rowDetailState||t.rowDetailState||e.defaultRowDetailState,c&&!(c instanceof wt)&&(c=new wt(c)),c=c||new wt({expandedRows:[],collapsedRows:!0}));let f=t.columnsWhenGrouping||t.columnsWhenInlineGroupRenderStrategy||t.columns,p=c?e.isRowDetailExpanded:void 0;!p&&c&&(p=_a.get(c),p||(p=b=>c.isRowDetailsExpanded(b.id),typeof c=="object"&&_a.set(c,p)));let m=u?e.isRowDetailEnabled||!0:!1,g={updatedAt:Date.now(),isTree:r.isTree,rowDetailRenderer:u,rowDetailState:c,isRowDetailExpanded:p,isRowDetailEnabled:m,showColumnFilters:e.showColumnFilters??!!r.filterValue,controlledColumnVisibility:!!e.columnVisibility,groupRenderStrategy:s,groupBy:l,computedColumns:f,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||ce.components.Header.columnHeaderHeight:""};if(t.devToolsDetected&&t.debugId){let b=un.get(t.debugId);b&&(g={...g,...b})}return g};function Fm(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 Lm(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 f=r[d],p=i[f];if(!p.isTreeNode&&p.isGroupRow&&(c=Math.max(c,p.groupNesting-1),c===s-1))break}return Object.keys(n).forEach(d=>{let f=n[d],{groupByForColumn:p}=f;if(Array.isArray(p))return;let m=p.field||p.groupField;if(!m)return;t.get(m).groupIndex>c&&e?l[d]!==!1&&(l[d]=!1):l.hasOwnProperty(d)&&delete l[d]}),l}var km=require("react");function Zs(){let{getState:o,componentActions:e,getDataSourceMasterContext:t}=Oe();return(0,km.useCallback)(r=>{let i=o(),a=new gt(i.groupRowsState);if(a.toggleGroupRow(r),e.groupRowsState=a,i.lazyLoad){let l=[Nn,...r],s=i.originalLazyGroupData.get(l);a.isGroupRowExpanded(r)?s?.cache||co(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=Ht())}},[])}function AS(o){return(0,Bt.useMemo)(()=>_m(o),[o])}function zm(){let{componentState:{groupBy:o},componentActions:e}=Oe(),{componentState:{groupRenderStrategy:t,pivotTotalColumnPosition:n,pivotGrandTotalColumnPosition:r}}=qe();(0,Bt.useEffect)(()=>{e.generateGroupRows=t!=="inline"},[t]),(0,Bt.useEffect)(()=>{e.pivotTotalColumnPosition=n},[n]),(0,Bt.useEffect)(()=>{r!=null&&(e.pivotGrandTotalColumnPosition=r)},[r]);let i=AS(o);_S(i);let{toggleGroupRow:a}=OS();return NS(i),{toggleGroupRow:a}}function _S(o){let e=Zs(),{componentActions:t,componentState:{columns:n,groupRenderStrategy:r,isTree:i}}=qe();function a(l,s,c,u){let d={};if(c==="inline")return Object.keys(l).forEach(f=>{let p=l[f],m={},g=s.get(p.field);if(g&&c==="inline"){let{groupIndex:h}=g;m={groupByForColumn:g.groupBy,field:g.groupBy?.field,valueGetter:g.groupBy?.valueGetter,valueFormatter:({rowInfo:y})=>y.isGroupRow?y.groupKeys?.[h]:y.value,rowspan:({rowInfo:y,dataArray:S})=>{if(y.isTreeNode||!y.isGroupRow)return 1;let C=S[y.indexInAll-1]||{indexInParentGroups:[]};if(!C||!C.dataSourceHasGrouping)return 1;let T=C.indexInParentGroups||[],I=y.indexInParentGroups||[],w=!1;for(let x=0;x<=h;x++){let M=T[x];if(I[x]!==M){w=!0;break}}if(!w)return 1;let v=y.parents[h];return v?v.groupCount-(v.collapsedChildrenCount||0)+(v.collapsedGroupsCount||0):1},renderGroupIcon:Oi({groupIndexForColumn:h,groupRenderStrategy:c,toggleGroupRow:u,initialRenderGroupIcon:p.renderGroupIcon}),render:_i({groupIndexForColumn:h,groupRenderStrategy:c})}}let b={...m,...p};d[f]=b}),Object.keys(d).length===0?void 0:d}(0,Bt.useEffect)(()=>{(()=>{t.columnsWhenInlineGroupRenderStrategy=i?void 0:a(n,o,r,e)})()},[n,o,r,e])}function OS(){let{componentState:{groupBy:o,pivotBy:e,selectionMode:t}}=Oe(),{componentActions:n,componentState:{columns:r,groupColumn:i,hideColumnWhenGrouped:a,groupRenderStrategy:l,pivotColumns:s,pivotColumn:c,pivotTotalColumnPosition:u,pivotGrandTotalColumnPosition:d},getComponentState:f}=qe(),p=Zs();return(0,Bt.useEffect)(()=>{(()=>{let{columns:g,groupColumnIds:b}=FS({columns:r,groupColumn:i,pivotColumn:c,pivotTotalColumnPosition:u,pivotGrandTotalColumnPosition:d,groupRenderStrategy:l==="inline"?"single-column":l,groupBy:o,pivotBy:e,pivotColumns:s,toggleGroupRow:p,selectionMode:t});n.columnsWhenGrouping=g;let h=f().columnOrder;if(b.length&&Array.isArray(h)){let y=new Set(h),S=!1;b.forEach(C=>{y.has(C)||(S=!0,h=[C,...h])}),S&&(n.columnOrder=h)}})()},[r,o,e,t,a,i,l,s,u,c]),{toggleGroupRow:p}}function NS(o){let{componentState:{dataArray:e,groupRowsIndexesInDataArray:t,groupBy:n,groupRowsState:r,originalLazyGroupDataChangeDetect:i},getState:a}=Oe(),{getComponentState:l,componentActions:s,componentState:{columnTypes:c,computedColumns:u,hideColumnWhenGrouped:d,hideEmptyGroupColumns:f,groupRenderStrategy:p}}=qe();(0,Bt.useLayoutEffect)(()=>{if(p!=="multi-column")return;let m=l(),g=Fm(u,o),b=Lm({computedGroupColumns:g,columnVisibility:m.columnVisibility,hideEmptyGroupColumns:f,groupRowsIndexesInDataArray:t,dataArray:e,groupBy:n,groupByMap:o});At(m.columnVisibility,b)||(s.columnVisibility=b)},[a,p,i,n,o,u,f?e:null,f?r:null,f?t:null,f]),(0,Bt.useEffect)(()=>{let m=n.length>0,g=l(),{columnVisibility:b,columnVisibilityForGrouping:h,hideColumnWhenGrouped:y}=g,S={...b},C={...h},T=!1,I=new Set,w=new Set;Object.keys(u).forEach(v=>{let R=u[v];if(R.defaultHiddenWhenGroupedBy||y!=null)if(R.defaultHiddenWhenGroupedBy==="*"&&m||(R.defaultHiddenWhenGroupedBy===!0||y)&&R.field&&o.get(R.field)||typeof R.defaultHiddenWhenGroupedBy=="string"&&o.get(R.defaultHiddenWhenGroupedBy)||typeof R.defaultHiddenWhenGroupedBy=="object"&&Object.keys(R.defaultHiddenWhenGroupedBy).reduce((M,A)=>M||o.has(A),!1)){if(C[v]!==!1){if(b[v]===!1)return;C[v]=!1,T=!0,I.add(v)}}else C[v]===!1&&(delete C[v],T=!0,w.add(v))}),T&&(s.columnVisibilityForGrouping=C,w.forEach(v=>{delete S[v]}),I.forEach(v=>{S[v]=!1}),s.columnVisibility=S)},[u,c,n,o,d])}function FS(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 f={},p=[];if(c==="multi-column")t.forEach((m,g,b)=>{let h=Bd({groupByForColumn:m,groupBy:t,pivotBy:n,groupIndexForColumn:g,groupCount:b.length,groupRenderStrategy:c,selectionMode:r},u,i),y=h.id||`group-by-${m.field||m.groupField}`;p.push(y),f[y]=h});else if(c==="single-column"&&t.length){let m=Wd({groupCount:t.length,groupBy:t,pivotBy:n,groupRenderStrategy:c,selectionMode:r},u,i),g=m.id||"group-by";p.push(g),f[g]=m}if(e){let m={};Object.keys(d).forEach(g=>{let b=d[g];b.field&&(m[b.field]=b)}),Object.keys(e).forEach(g=>{let b=e[g],h=b.pivotTotalColumn&&b.columnGroup,y=b.pivotTotalColumn&&!b.columnGroup;if(h&&a===!1||y&&l===!1)return;let S={...b};s&&(typeof s=="function"?S={...S,...s({column:S,pivotBy:n,groupBy:t})}:S={...S,...s}),S.inheritFromColumn!==!1&&(S={...typeof S.inheritFromColumn=="string"?d[S.inheritFromColumn]:S.pivotAggregator?.field?m[S.pivotAggregator?.field]:void 0,...S}),!S.render&&S.renderValue&&(S.render=C=>S.renderValue(C)),f[g]=S})}else Object.keys(d).forEach(m=>{let g=d[m];f[m]=g});return{columns:Object.keys(f).length?f:void 0,groupColumnIds:p}}var Vm=require("react");var Gm=({columns:o,bodySize:e,columnMinWidth:t,columnMaxWidth:n,columnDefaultWidth:r,columnDefaultFlex:i,sortable:a,columnCssEllipsis:l,columnHeaderCssEllipsis:s,draggableColumns:c,columnDefaultDraggable:u,sortInfo:d,multiSort:f,filterValue:p,filterTypes:m,columnOrder:g,columnPinning:b,editable:h,columnDefaultEditable:y,columnDefaultFilterable:S,columnDefaultGroupable:C,columnDefaultSortable:T,scrollbarWidth:I,columnTypes:w,pinnedEndMaxWidth:v,pinnedStartMaxWidth:R,viewportReservedWidth:x,resizableColumns:M,columnVisibility:A,columnVisibilityAssumeVisible:E,columnSizing:P,groupBy:_})=>{let{computedRemainingSpace:O,computedColumnOrder:F,computedVisibleColumns:j,computedVisibleColumnsMap:z,computedPinnedStartColumns:L,computedPinnedEndColumns:le,computedUnpinnedColumns:ne,computedPinnedStartColumnsWidth:W,computedPinnedEndColumnsWidth:$,computedUnpinnedColumnsWidth:re,computedUnpinnedOffset:ge,computedPinnedEndOffset:me,computedPinnedEndWidth:ue,computedPinnedStartWidth:de,renderSelectionCheckBox:he,computedColumnsMap:K,computedColumnsMapInInitialOrder:H,fieldsToColumn:X}=(0,Vm.useMemo)(()=>Bu({columns:o,scrollbarWidth:I,bodySize:e,columnMinWidth:t,columnMaxWidth:n,columnDefaultWidth:r,columnDefaultFlex:i,columnCssEllipsis:l,columnHeaderCssEllipsis:s,viewportReservedWidth:x,resizableColumns:M,filterValue:p,filterTypes:m,sortable:a,sortInfo:d,multiSort:f,pinnedEndMaxWidth:v,pinnedStartMaxWidth:R,draggableColumns:c,columnDefaultDraggable:u,columnOrder:g,columnPinning:b,columnDefaultEditable:y,columnDefaultFilterable:S,columnDefaultGroupable:C,columnDefaultSortable:T,editable:h,columnSizing:P,columnTypes:w,columnVisibility:A,columnVisibilityAssumeVisible:E??!0,groupBy:_}),[o,e.width,t,n,r,x,I,a,d,f,p,m,g,A,E,u,c,M,v,R,P,w,b,y,S,C,h,_,1]);return{renderSelectionCheckBox:he,columns:o,computedColumnsMap:K,computedPinnedEndWidth:ue,computedPinnedStartWidth:de,computedRemainingSpace:O,computedUnpinnedOffset:ge,computedPinnedEndOffset:me,computedPinnedStartColumnsWidth:W,computedPinnedEndColumnsWidth:$,computedUnpinnedColumnsWidth:re,computedPinnedStartColumns:L,computedPinnedEndColumns:le,computedUnpinnedColumns:ne,computedVisibleColumns:j,computedVisibleColumnsMap:z,computedColumnOrder:F,computedColumnsMapInInitialOrder:H,fieldsToColumn:X}};var Hm=require("react"),Qs=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 LS(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],f=d?n(d):0;return e&&e.rowHeight.set(u,f),f}: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 f=l?n(d):n;if(!!(!i||typeof i=="function"&&i(d)===!1)||!r(d))return e&&(e.rowHeight.set(u,f),e.rowDetailHeight.set(u,0)),f;let m=0;return s?m=t(d):m=t,e&&(e.rowHeight.set(u,f),e.rowDetailHeight.set(u,m)),f+m}}function Km(o){return(0,Hm.useMemo)(()=>{let e=new Qs;return{computedRowHeight:LS(o,e),computedRowSizeCacheForDetails:o.isRowDetailsExpanded?e:void 0}},[o.rowHeight,o.rowDetailHeight,o.isRowDetailsExpanded,o.isRowDetailsEnabled,o.getDataSourceState])}var Yo=require("react");var kS={vertical:!1,horizontal:!1};function Bm(o){let{getComponentState:e}=qe(),{getState:t}=Oe(),[n,r]=(0,Yo.useState)(kS);return(0,Yo.useEffect)(()=>o.onRenderCountChange(()=>{let{scrollTopMax:i,scrollLeftMax:a}=o;r({vertical:i>0,horizontal:a>0})}),[o]),(0,Yo.useLayoutEffect)(()=>{let i=t(),{onScrollbarsChange:a}=e(),{notifyScrollbarsChange:l}=i;a&&i.updatedAt&&i.dataArray.length&&a(n),l(n)},[n]),n}function Wm(){let{componentActions:o,componentState:e}=qe(),{componentActions:t,componentState:n,getState:r,api:i}=Oe(),{columnOrder:a,columnVisibility:l,columnPinning:s,columnSizing:c,editable:u,columnDefaultEditable:d,columnDefaultFilterable:f,columnDefaultGroupable:p,columnTypes:m,rowHeight:g,rowDetailHeight:b,isRowDetailExpanded:h,isRowDetailEnabled:y,brain:S,bodySize:C,showSeparatePivotColumnForSingleAggregation:T}=e;(0,qo.useState)(()=>{e.onRowHeightCSSVarChange.onChange(N=>{N&&(o.rowHeight=N)}),e.onFlashingDurationCSSVarChange.onChange(N=>{let U=N?N*1:null;U!=null&&!isNaN(U)&&(o.flashingDurationCSSVarValue=U)}),e.onRowDetailHeightCSSVarChange.onChange(N=>{N&&(o.rowDetailHeight=N)}),e.onColumnHeaderHeightCSSVarChange.onChange(N=>{N&&(o.columnHeaderHeight=N)})}),(0,qo.useEffect)(()=>{t.showSeparatePivotColumnForSingleAggregation=T},[T]);let{multiSort:I,filterValue:w,filterTypes:v,groupBy:R}=n,{toggleGroupRow:x}=zm(),M=e.computedColumns,{computedColumnOrder:A,computedVisibleColumns:E,computedVisibleColumnsMap:P,computedPinnedStartColumns:_,computedPinnedEndColumns:D,computedUnpinnedColumns:O,computedPinnedStartColumnsWidth:F,computedPinnedEndColumnsWidth:j,computedUnpinnedColumnsWidth:z,computedUnpinnedOffset:L,computedPinnedEndOffset:le,computedRemainingSpace:ne,computedPinnedStartWidth:W,computedPinnedEndWidth:$,renderSelectionCheckBox:re,computedColumnsMap:ge,computedColumnsMapInInitialOrder:me,fieldsToColumn:ue}=Gm({columns:M,scrollbarWidth:void 0,columnCssEllipsis:e.columnCssEllipsis,columnHeaderCssEllipsis:e.columnHeaderCssEllipsis,columnMinWidth:e.columnMinWidth,columnMaxWidth:e.columnMaxWidth,columnDefaultWidth:e.columnDefaultWidth,columnDefaultFlex:e.columnDefaultFlex,columnDefaultSortable:e.columnDefaultSortable,columnDefaultDraggable:e.columnDefaultDraggable,pinnedStartMaxWidth:e.pinnedStartMaxWidth,pinnedEndMaxWidth:e.pinnedEndMaxWidth,bodySize:C,viewportReservedWidth:e.viewportReservedWidth,resizableColumns:e.resizableColumns,sortable:e.sortable,draggableColumns:e.draggableColumns,sortInfo:n.sortInfo??void 0,multiSort:I,groupBy:R,columnOrder:a,columnVisibility:l,columnVisibilityAssumeVisible:!0,columnPinning:s,editable:u,columnDefaultEditable:d,columnDefaultFilterable:f,columnDefaultGroupable:p,filterValue:w,filterTypes:v,columnSizing:c,columnTypes:m}),de=wm(E),he=vm(E),K=Bm(S),H=W?F>W:!1,X=$?j>$:!1,[B]=(0,qo.useState)(()=>new Aa({isRowDisabledAt:U=>r().dataArray[U]?.rowDisabled??!1,getIdForIndex:U=>r().dataArray[U]?.id??-1})),ie=Ae(E),[ee]=(0,qo.useState)(()=>new Ea({getPrimaryKeyByIndex:i.getPrimaryKeyByIndex,getColumnIdByIndex:N=>ie()[N]?.id||""})),{computedRowHeight:fe,computedRowSizeCacheForDetails:Ie}=Km({rowDetailHeight:b,rowHeight:g,isRowDetailsExpanded:h,isRowDetailsEnabled:y,getDataSourceState:r});return{multiRowSelector:B,multiCellSelector:ee,computedRowSizeCacheForDetails:Ie,computedRowHeight:fe,scrollbars:K,columnSize:he,rowspan:de,toggleGroupRow:x,computedColumnsMap:ge,computedColumnsMapInInitialOrder:me,renderSelectionCheckBox:re,computedPinnedStartOverflow:H,computedPinnedEndOverflow:X,computedPinnedStartWidth:W,computedPinnedEndWidth:$,computedVisibleColumns:E,computedColumnOrder:A,computedRemainingSpace:ne,computedVisibleColumnsMap:P,computedPinnedStartColumns:_,computedPinnedEndColumns:D,computedUnpinnedColumns:O,computedPinnedStartColumnsWidth:F,computedPinnedEndColumnsWidth:j,computedUnpinnedColumnsWidth:z,computedUnpinnedOffset:L,computedPinnedEndOffset:le,fieldsToColumn:ue}}var Um=require("react");function zS(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 VS(){return 4294967295}function GS(o,e,t){return e=e>>>8^o[t^e&255],e}function HS(o){return o=~o,o=o<0?4294967295+o+1:o,o}function Js(o,e=3988292384){var t=zS(e),n=0,r;for(n=VS(),r=0;r<o.length;r++)n=GS(t,n,o.charCodeAt(r));return n=HS(n),`${n}`}var KS=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")??""}},jm=(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))},$m=(o="",e,t)=>{let n;try{n=BS(o)}catch{return jm(["You don't have a valid Infinite Table license","Please visit infinite-table.com to purchase a license.","Thank you for playing fair!"],t),!1}let r=new Date(e.publishedAt),i=new Date(n.end);return i<r?(jm([`
27
+ `);let o=Jn(t);if(n instanceof Qe)return n.setConfig(o),n;(n==null||typeof n!="object")&&(n=void 0);let r=n??LT,i=Bt.get(r);return i&&i.setConfig(o),i=i??new Qe(r,o),Bt.set(r,i),i}function ym(n){let{props:e,state:t,oldState:o}=n,r=!!t.nodesKey,i=Rr(e.sortInfo),a=Rr(e.filterValue),{filterTypes:l}=t,s=Object.keys(l).reduce((P,_)=>{let E=l[_].operators;P[_]=P[_]||{};let L=P[_];return E.forEach(k=>{L[k.name]=k}),P},{}),c=e,u=e.selectionMode;if(u===void 0)if(e.cellSelection!==void 0||e.defaultCellSelection!==void 0)u="multi-cell";else{let P=e.rowSelection!==void 0?e.rowSelection:e.defaultRowSelection;if(P!==void 0&&(P&&typeof P=="object"?u="multi-row":u="single-row"),!u){let _=c.treeSelection??c.defaultTreeSelection;_!==void 0&&(u=typeof _=="object"?"multi-row":"single-row")}u=u??!1}let d=null,f=null,p=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")&&(p===null?d=u==="single-row"?null:new Ee({selectedRows:[],deselectedRows:[],defaultSelection:!1},ht(t)):u==="single-row"||p instanceof Ee?d=p:d=new Ee(p,ht(t))),u==="single-cell"||u==="multi-cell"))if(m===null)f=u==="single-cell"?null:new $e;else if(m instanceof $e)f=m;else{let P=Bt.get(m)??new $e(m);Bt.set(m,P),f=P}let g=t.primaryKey,b=typeof g=="function"?P=>g(P):P=>P[g],h=c.treeExpandState||t.treeExpandState||c.defaultTreeExpandState;if(h&&!(h instanceof st)){let P=Bt.get(h)??new st(h);Bt.set(h,P),h=P}h=h||new st({defaultExpanded:!0,collapsedPaths:[]});let y=e.groupRowsState||t.groupRowsState||e.defaultGroupRowsState;if(y&&!(y instanceof Ct)){let P=Bt.get(y)??new Ct(y);Bt.set(y,P),y=P}y=y||new Ct(t.lazyLoad?{expandedRows:[],collapsedRows:!0}:{expandedRows:!0,collapsedRows:[]});let S=NT(e.shouldReloadData||{}),T=e.groupMode??(S.groupBy!=null?S.groupBy?"remote":"local":void 0),C=e.sortMode??S.sortInfo!=null?S.sortInfo?"remote":"local":void 0,w=e.filterMode??S.filterValue!=null?S.filterValue?"remote":"local":void 0;e.groupMode&&Qn('"groupMode" prop is deprecated for the <DataSource />, use "shouldReloadData.groupBy: true|false" instead',"groupMode deprecated",t.logger),e.sortMode&&Qn('"sortMode" prop is deprecated for the <DataSource />, use "shouldReloadData.sortInfo: true|false" instead',"sortMode deprecated",t.logger),e.filterMode&&Qn('"filterMode" prop is deprecated for the <DataSource />, use "shouldReloadData.filterValue: true|false" instead',"filterMode deprecated",t.logger);let I=typeof e.data=="function"?T??"local":"local",v=e.sortFunction?"local":C??(i?"remote":"local"),D=typeof e.filterFunction=="function"||typeof e.treeFilterFunction=="function"?"local":w??(typeof e.data=="function"?"remote":"local"),R=S.pivotBy?"remote":"local",x=t.rowDisabledState,A=e.isRowDisabled;if(!A&&x){let P=Bt.get(x);P?A=P:(A=_=>x.isRowDisabled(_.id),Bt.set(x,A))}let M={debugId:t.debugId??e.debugId,isTree:r,selectionMode:u,groupRowsState:y,treeExpandState:h,treeExpandMode:h.mode,shouldReloadData:{filterValue:S?.filterValue??D==="remote",sortInfo:S?.sortInfo??v==="remote",groupBy:S?.groupBy??I==="remote",pivotBy:S?.pivotBy??R==="remote"},isRowDisabled:A,rowSelection:d,cellSelection:f,groupMode:I,sortMode:v,filterMode:D,pivotMode:R,toPrimaryKey:b,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 P=!o||o.originalDataArray!==t.originalDataArray,_=typeof e.livePaginationCursor=="function"?P?FT(e.livePaginationCursor,t):t.livePaginationCursor:e.livePaginationCursor;M.livePaginationCursor=_}if(t.devToolsDetected&&t.debugId){let P=ho.get(t.debugId);P&&(M={...M,...P})}return M}var kT=_t("DataSource:fullLazyLoad");function Sm(n,e,t){let{name:o,newValue:r}=n;o==="data"&&typeof r=="function"&&!e.groupRowsState&&(e.lazyLoad&&kT('"data" function prop has changed'),e.collapseGroupRowsOnDataFunctionChange!==!1&&(t.groupRowsState=new Ct({collapsedRows:!0,expandedRows:[]})))}function Tm(){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 $e?n.getState().selectedCells:null,"single-cell"]}:{callbackParams:[n.getState(),"multi-cell"]}}}function Cm(){return{sortInfo:(n,{actions:e,state:t})=>{let o=t.getDataSourceMasterContextRef.current,r=yo(t,{sortInfo:n,livePaginationCursor:null},o());e.dataParams=r,t.livePagination&&Ve(()=>{e.livePaginationCursor=null})},groupBy:(n,{actions:e,state:t})=>{let o=t.getDataSourceMasterContextRef.current,r=yo(t,{groupBy:n,livePaginationCursor:null},o());e.dataParams=r,t.livePagination&&Ve(()=>{e.livePaginationCursor=null})},pivotBy:(n,{actions:e,state:t})=>{let o=t.getDataSourceMasterContextRef.current,r=yo(t,{pivotBy:n,livePaginationCursor:null},o());e.dataParams=r,t.livePagination&&Ve(()=>{e.livePaginationCursor=null})},filterValue:(n,{actions:e,state:t})=>{let o=t.getDataSourceMasterContextRef.current,r=yo(t,{filterValue:n,livePaginationCursor:null},o());e.dataParams=r,t.livePagination&&Ve(()=>{e.livePaginationCursor=null})},cursorId:(n,{actions:e,state:t})=>{let o=t.getDataSourceMasterContextRef.current,r=yo(t,{__cursorId:n},o());e.dataParams=r},livePaginationCursor:(n,{actions:e,state:t})=>{let o=t.getDataSourceMasterContextRef.current,r=yo(t,{livePaginationCursor:n},o());e.dataParams=r},dataParams:(n,{state:e})=>yt(n,e.dataParams,new Set(["changes","originalDataArray","masterRowInfo"]))?!1:(_t(zo(e.debugId,"DataSource:dataParams"))("onDataParamsChange triggered because the following values have changed",n?.changes),!0)}}function wm(n){return{originalDataArray:n.originalDataArray,groupRowsState:n.groupRowsState,groupBy:n.groupBy,pivotBy:n.pivotBy,sortInfo:n.sortInfo,filterValue:n.filterValue,livePaginationCursor:n.livePaginationCursor}}var ct=K(require("react"));function Im(){return Io()}function tr(n){let e=Ro(),t=bi(),o=!!e,r=o?e.id:"master",{contextValue:i,ContextComponent:a}=Qs(n),{componentActions:l,componentState:s,assignState:c}=i;s.getDataSourceMasterContextRef.current=t;let u=Oe(s),[d]=(0,ct.useState)(()=>Qp({getState:u,actions:l})),f={dataSourceState:s,dataSourceActions:l,getDataSourceMasterContext:t,getDataSourceState:u,assignState:c,dataSourceApi:d},p=Oe(i),m=Oe(f),g=Ls(),b=(0,ct.useCallback)(({children:h})=>{let y=ga(),[S]=(0,ct.useState)(()=>Im());typeof h=="function"&&(h=h(u()));let T=m();return S.setSnapshot(T),(0,ct.useLayoutEffect)(()=>{S.notify()}),ct.default.createElement(a.Provider,{key:r,value:p()},ct.default.createElement(g.Provider,{value:T},ct.default.createElement(y.Provider,{value:S},h)))},[a,o,r]);return(0,ct.useLayoutEffect)(()=>{let h=t();h&&h.registerDetail(f)},[]),(0,ct.useLayoutEffect)(()=>()=>{let h=u();h.onCleanup(h)},[]),cm({dataSourceState:s,dataSourceActions:l,getDataSourceState:u}),(0,ct.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,ct.useEffect)(()=>{s.onReady?.(d)},[]),{DataSource:b,state:f.dataSourceState}}var Pt=class extends er{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)}};var Na=class Na{constructor(e,t){this.keysInOrder=[];if(typeof e=="number")this.maxSize=e,this.currentMap=new Map;else if(this.maxSize=t??Na.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}};Na.DEFAULT_SIZE=10;var Fa=Na;var Js=class{add(e,t){}get(e){}delete(e){}has(e){return!1}},La=class{constructor(e){this.storage=new Fa(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)}},ec=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)}},or=class{constructor(e){this.cacheStorage=e===!1?new Js:e===!0?new ec:typeof e=="number"?new La(e):new La(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 Rm=(e=>(e.INIT="INIT",e))(Rm||{});var{useManagedComponent:Qs}=Ot({debugName:"DataSource",initSetupState:gm,forwardProps:bm,concludeReducer:tm,mapPropsToState:ym,onPropChange:Sm,cleanup:hm,interceptActions:Cm(),mappedCallbacks:Tm()});function zT(n){let{DataSource:e}=tr(n);return vm.createElement(e,null,n.children??null)}function VT(){let{rowInfoReducerResults:n}=Fe(e=>({rowInfoReducerResults:e.dataSourceState.rowInfoReducerResults}));return n}function tc(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(p,m){let g=l[c+p*m],b=a.get(g);if(b&&b.renderMenuIcon!==!1)return g}let c=l.indexOf(r),u=0,d=-1,f;for(;!f&&u<l.length&&(u++,f=s(u,d),f||(d*=-1,f=s(u,d)),!f););return f&&(o.columnMenuVisibleForColumnId=f),f}function ka(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 oc(n,e,t){let{rowsPerPage:o}=t;return o?Math.floor(n.rowIndex/o)===Math.floor(e.rowIndex/o):!0}function Dm(n,e,t){if(oc(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),f=Math.floor(c/o),p=l%o,m=c%o,g=Math.min(p,m),b=Math.max(p,m),h=[];for(let y=d;y<=f;y++)for(let S=g;S<=b;S++){let T=y*o+S;if(y===d)for(let C=s;C<r;C++)h.push({rowIndex:T,colIndex:C});else if(y===f)for(let C=0;C<=u;C++)h.push({rowIndex:T,colIndex:C});else for(let C=0;C<r;C++)h.push({rowIndex:T,colIndex:C})}return h}function GT(n,e){let t=new Set(n);return e.map(o=>t.has(o)?o:null).filter(o=>o!=null)}var nc=class{constructor(e){this.getCellSelectionPosition=e=>{let t=e.rowId??Ko(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 $e(i);a.debugId=r.debugId??"";let[l,s]=this.getCellSelectionPosition(e),[c,u]=this.getCellSelectionPosition(t),d=this.getComputed().computedVisibleColumnsMap.get(s),f=this.getComputed().computedVisibleColumnsMap.get(u);if(!d||!f)return;let p=d.computedVisibleIndex,m=f.computedVisibleIndex,g=Ko(l,this.getDataSourceState),b=Ko(c,this.getDataSourceState);if(!g||!b)return;let h=g.indexInAll,y=b.indexInAll,[S,T]=ka({rowIndex:h,colIndex:p},{rowIndex:y,colIndex:m});for(let C=S.rowIndex;C<=T.rowIndex;C++)for(let w=S.colIndex;w<=T.colIndex;w++){let I={rowIndex:C,colIndex:w},[v,D]=this.getCellSelectionPosition(I);o?a.selectCell(v,D):a.deselectCell(v,D)}this.dataSourceActions.cellSelection=a};this.getCellSelectionPositionsWithFn=(e,t)=>{let o=va(this.getDataSourceState),{computedVisibleColumns:r}=this.getComputed(),i=r.map(d=>d.id),a=new Set,l=[],s=new Set;o.filter(d=>{r.forEach(f=>{this.isCellSelected({rowId:d.id,colId:f.id})&&(a.has(f.id)||a.add(f.id),s.has(d.id)||(s.add(d.id),l.push(d)))})});let c=GT(Array.from(a),i),u=l.map(d=>c.map(f=>this.isCellSelected({rowId:d.id,colId:f})?e(d,f):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 $e(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 $e(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 $e:new $e(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 $e(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 $e(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 $e(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 Pm(n){return new nc(n)}function xm(n){let{dataSourceApi:e,getState:t,actions:o}=n,r={collapseAllDetails(){o.rowDetailState=new Pt({collapsedRows:!0,expandedRows:[]})},expandAllDetails(){o.rowDetailState=new Pt({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 Pt(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 Pt(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 Wo(n,e,t){return Math.min(Math.max(n,e),t)}function za(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 Wo(a,r,i)}function HT(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:f}=u;if(f==null)return!1;let{start:[p],end:[m]}=d.getRenderRange(),g=f,b=m-p-1,h=0,y=c-1,S={ArrowDown:()=>{f=za(o,f,1)},ArrowUp:()=>{f=za(o,f,-1)},ArrowLeft:()=>{let C=s[f];if(d.isHorizontalLayoutBrain){let w=d.rowsPerPage;f-w>=h?f=f-w:S.ArrowUp();return}return C&&C.isGroupRow?i.collapseGroupRow(C.groupKeys):C&&i.rowDetailApi.isRowDetailEnabledForRow(C.id)?i.rowDetailApi.collapseRowDetail(C.id):!1},ArrowRight:()=>{let C=s[f];if(d.isHorizontalLayoutBrain){let w=d.rowsPerPage;f+w<=y?f=f+w:S.ArrowDown();return}return C&&C.isGroupRow?i.expandGroupRow(C.groupKeys):C&&i.rowDetailApi.isRowDetailEnabledForRow(C.id)?i.rowDetailApi.expandRowDetail(C.id):!1},Enter:()=>{let C=s[f];return C&&C.isGroupRow?i.toggleGroupRow(C.groupKeys):C&&C.isTreeNode&&C.isParentNode?a.treeApi.toggleNode(C.nodePath):i.rowDetailApi.isRowDetailEnabledForRow(C.id)?i.rowDetailApi.toggleRowDetail(C.id):!1},PageDown:()=>{f=Math.min(f+b,c-1)},PageUp:()=>{f=Math.max(f-b,h)},End:()=>{f=y},Home:()=>{f=h}},T=S[l];return T?(T(),g!==f?(r.activeRowIndex=f,!0):!1):!1}function rc(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:f}=u;if(!d)return!1;let[p,m]=d,{start:[g,b],end:[h,y]}=f.getRenderRange(),S=h-g-1,T=y-b-1,C=i().dataArray.length-1,w=r().computedVisibleColumns.length-1,I=0,v=0;p=Wo(p,0,C),m=Wo(m,0,w);let D={ArrowDown:()=>{p=Wo(p+1,I,C)},ArrowUp:()=>{p=Wo(p-1,I,C)},ArrowLeft:()=>{if(m===v)if(p!==I&&(m=w),f.isHorizontalLayoutBrain){let x=f.rowsPerPage;p-x>=I?p=p-x:D.ArrowUp()}else D.ArrowUp();else m=Wo(m-1,v,w)},ArrowRight:()=>{if(m===w)if(p!==C&&(m=v),f.isHorizontalLayoutBrain){let x=f.rowsPerPage;p+x<=C?p=p+x:D.ArrowDown()}else D.ArrowDown();else m=Wo(m+1,v,w)},Enter:()=>{let x=c[p];return x&&x.isGroupRow?t.toggleGroupRow(x.groupKeys):x&&x.isTreeNode&&x.isParentNode?a.treeApi.toggleNode(x.nodePath):x&&t.rowDetailApi.isRowDetailEnabledForRow(x.id)?t.rowDetailApi.toggleRowDetail(x.id):!1},PageDown:()=>{s?m=Math.min(m+T,w):p=Math.min(p+S,C)},PageUp:()=>{s?m=Math.max(m-T,v):p=Math.max(p-S,I)},End:()=>{s?m=w:p=C},Home:()=>{s?m=v:p=I}},R=D[l];return R?(R(),[p,m]):!1}function KT(n,e){let t=rc(n,e);return t?(n.actions.activeCellIndex=t,!0):!1}var BT={ArrowUp:!0,ArrowDown:!0,ArrowLeft:!0,ArrowRight:!0,PageUp:!0,PageDown:!0,Home:!0,End:!0,Enter:!0," ":!0};function Mm(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||!BT[t]?!1:i!=null&&l==="row"?HT(n,e):a!=null&&l==="cell"?KT(n,e):!1}var ic=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=za(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=rc(this.param,{key:o,shiftKey:!1});return r===!1?!1:(this.param.actions.activeCellIndex=r,r)}};function Am(n){return new ic(n)}function Em(n,e){return n.id?n.id===e.id:!!(n.field&&n.field===e.field)}var ac=class{constructor(e){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(d=>requestAnimationFrame(d));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={...Dt({rowIndex:t.rowIndex,columnId:t.columnId,...this.context,api:this}),value:i,initialValue:t.initialValue},l=i;o.current=null,r.getValueToPersist&&(l=await r.getValueToPersist(a)),a.value=l,t.value=l;let s=this.getState().persistEdit??(()=>{if(!a.column.field)return i;let d=this.getDataSourceState().primaryKey,f=a.data&&typeof d=="string"?{[d]:a.data[d],[a.column.field]:l}:{...a.data,[a.column.field]:l};return this.context.dataSourceApi.updateData(f)}),c;try{c=await s(a)}catch(d){c=d}let u=c instanceof Error?c:!0;return this.actions.editingCell={...t,active:!1,accepted:!1,waiting:!1,persisted:u},Promise.resolve(u)};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({...Dt({...this.context,api:this,dataSourceApi:this.context.dataSourceApi,columnId:l,rowIndex:a}),value:i,initialValue:o.initialValue}):!0;return await new Promise(f=>requestAnimationFrame(f)),Promise.resolve(d).then(f=>{if(f===!0)return this.actions.editingCell={...t.editingCell,active:!1,accepted:!0,persisted:!1,waiting:"persist",value:i},!0;throw f}).catch(f=>(f instanceof Error||(f=new Error(`Edit rejected: ${f}`)),this.actions.editingCell={...o,value:i,persisted:!1,active:!1,waiting:!1,accepted:f},{reject:f,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(Dt({...this.context,api:this,columnId:r,rowIndex:i}));return typeof c=="boolean"?Promise.resolve(c):c};this.getColumnApi=e=>gt(e,{...this.context,api:this});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 f=this,{isRowDetailEnabled:p}=a(),m=!p||typeof p=="function"&&!p(u)?!1:this.rowDetailApi.isRowDetailExpanded(u.id)?"expanded":"collapsed",g=Hn({column:c,rowInfo:u,columnsMap:l,context:{...this.context,api:f},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 Ct(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 Ct(t.groupRowsState);if(o.toggleGroupRow(e),this.dataSourceActions.groupRowsState=o,t.lazyLoad){let r=[Ho,...e],i=t.originalLazyGroupData.get(r);o.isGroupRowExpanded(e)?i?.cache||bn(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=ee.clone(t.lazyLoadCacheOfLoadedBatches),t.originalLazyGroupData.delete(r),this.dataSourceActions.originalLazyGroupDataChangeDetect=Kt())}};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,f=r.brain.scrollTopMax;if(d<0&&f<0)return!0;let p=c.scrollLeft>d+(o.offset||0),m=c.scrollTop>f+(o.offset||0);return p&&m?!1:(c.scrollLeft!==u.scrollLeft&&!p&&(r.scrollerDOMRef.current.scrollLeft=c.scrollLeft),c.scrollTop!==u.scrollTop&&!m&&(r.scrollerDOMRef.current.scrollTop=c.scrollTop),!0)};this.context=e,this.rowSelectionApi=Yp({dataSourceActions:e.dataSourceActions,getDataSourceState:e.getDataSourceState}),this.keyboardNavigationApi=Am({getState:e.getState,getDataSourceState:e.getDataSourceState,actions:e.actions,getComputed:e.getComputed,api:this,dataSourceApi:e.dataSourceApi}),this.rowDetailApi=xm({getState:e.getState,actions:e.actions,dataSourceApi:e.dataSourceApi}),this.cellSelectionApi=Pm({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)&&(tc(t),e?.()),setTimeout(()=>{this.isDestroyed()||(tc(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],f=i??uf({column:u,rowInfo:d}),p=f;u.getValueToEdit&&(f=await u.getValueToEdit(Dt({...this.context,rowIndex:a,columnId:t,api:this}))),this.actions.editingCell={active:!0,accepted:!1,persisted:!1,columnId:t,value:f,initialValue:p,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.groupByForColumn,s=i.field,c=l?Array.isArray(l)?l:[l]:[],u=c.map(p=>p.valueGetter?m=>p.valueGetter({data:m,field:p.field}):p.field?p.field:p.groupField??void 0).filter(vo);u.length&&(s=u);let d=i.computedSortType;c.length&&d===_n&&(d=c.flatMap(m=>{let g=m.field??m.groupField,b=g?r.get(g):null;return b?b.computedSortType:_n}));let f={dir:t,id:i.id,field:s,type:d};i.valueGetter&&(f.valueGetter=p=>i.valueGetter({data:p,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=>!Em(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:Em(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,f=s[u].defaultFilterValue??(c.emptyValues||[])[0]??void 0;return{...a,filter:{...a.filter,operator:u,value:f}}}return a}).filter(vo),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}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){let t=this.getState();t.scrollerDOMRef.current&&(t.scrollerDOMRef.current.scrollLeft=Math.max(e,0))}get scrollTop(){return this.getState().brain.getScrollPosition().scrollTop}set scrollTop(e){let t=this.getState();t.scrollerDOMRef.current&&(t.scrollerDOMRef.current.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&&(o.scrollerDOMRef.current.scrollTop=s.scrollTop),u&&(o.scrollerDOMRef.current.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&&(o.scrollerDOMRef.current.scrollLeft=l.scrollLeft),!0)}};function _m(n){return new ac(n)}var yn=require("react");var WT=10;function jT(n,e){let{includeHeader:t,columnsToResize:o,columnsToSkip:r}=e,i=`.${ln} > .${us}`,a=n.current?.querySelectorAll(i),l={},s={};return a&&a.length&&a.forEach(c=>{let u=c.parentElement,d=u.matches(`.${nn}`);if(t===!1&&d)return;let f=u.getAttribute("data-column-id"),p=c.cloneNode(!0);p.style.visibility="hidden",p.style.pointerEvents="none",p.classList.remove(...Yt.split(" ")),p.style.position="absolute",p.style.width="auto",u.appendChild(p);let m=p.offsetWidth;if(u.removeChild(p),!s[f]){let g=Ae().getComputedStyle(u);s[f]=parseInt(g.paddingLeft,10)+parseInt(g.paddingRight,10)+parseInt(g.borderLeftWidth,10)+parseInt(g.borderRightWidth,10)+WT}if(m+=s[f],d){let g=0;u.childNodes.forEach(b=>{if(b!==c){let h=b,y=Math.max(h.offsetWidth,parseInt(h.style.width,10));if(isNaN(y)&&(y=0),g+=y,y>0){let S=Ae().getComputedStyle(h);g+=parseInt(S.marginLeft,10)+parseInt(S.marginRight,10)}}}),m+=g}r&&r.has(f)||o&&!o.has(f)||(l[f]=Math.max(m,l[f]||0))}),l}function Om(){let{getComponentState:n,componentActions:e,componentState:{domRef:t,ready:o,autoSizeColumnsKey:r,brain:i}}=Ft(),[a,l]=(0,yn.useState)(0),s=typeof r=="object"?r.key:r,c=Oe(s),u=(0,yn.useRef)(null);(0,yn.useEffect)(()=>{if(c()==null)return;let{current:f}=u,p=()=>{r!==f&&l(a+1)};return i.onRenderRangeChange(p)},[i]),(0,yn.useEffect)(()=>{if(s==null)return;let{autoSizeColumnsKey:d}=n(),f,p,m=!0;typeof d=="object"&&(d.columnsToResize&&(f=new Set(d.columnsToResize)),d.columnsToSkip&&(p=new Set(d.columnsToSkip)),m=d.includeHeader??m),u.current=s;let g=jT(t,{includeHeader:m,columnsToResize:f,columnsToSkip:p}),b=Object.keys(g);if(!b.length)return;let h=n().columnSizing,y={...h},S=!1;b.forEach(T=>{y[T]={width:g[T]},S=S||y[T].width!==h[T]?.width}),S&&(e.columnSizing=y)},[s,o,a])}var $o=require("react");var Va=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&&!oc(e,t,r)){Dm(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]=ka(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 Fm(n,e){return n<e?[n,e]:[e,n]}var Ga=class{constructor(e){this.multiSelectStartIndex=0;this.getIdForIndex=e.getIdForIndex,this.isRowDisabledAt=e.isRowDisabledAt}set rowSelectionState(e){this._rowSelectionState=e}get rowSelectionState(){return this._rowSelectionState}selectRange(e,t){let[o,r]=Fm(e,t),i=this.rowSelectionState;for(let a=o;a<=r;a++){let l=this.getIdForIndex(a);this.isRowDisabledAt(a)||i.selectRow(l)}}deselectRange(e,t){let[o,r]=Fm(e,t),i=this.rowSelectionState;for(let a=o;a<=r;a++){let l=this.getIdForIndex(a);this.isRowDisabledAt(a)||i.deselectRow(l)}}resetClick(e){this.rowSelectionState.deselectAll();let t=this.getIdForIndex(e);this.rowSelectionState.selectRow(t),this.multiSelectStartIndex=e,this.multiSelectEndIndex=void 0}singleAddClick(e){let t=this.getIdForIndex(e);if(this.rowSelectionState.isRowSelected(t))this.rowSelectionState.deselectRow(t),this.rowSelectionState.isRowSelected(this.getIdForIndex(e+1))&&(this.multiSelectStartIndex=e+1);else{this.rowSelectionState.selectRow(t),this.multiSelectStartIndex=e;let o;for(let r=e-1;r>=0;r--){let i=this.getIdForIndex(r);if(this.rowSelectionState.isRowSelected(i))o=r;else break}this.multiSelectEndIndex=o}}multiSelectClick(e){this.multiSelectEndIndex!=null&&this.deselectRange(this.multiSelectStartIndex,this.multiSelectEndIndex),this.selectRange(this.multiSelectStartIndex,e),this.multiSelectEndIndex=e}};var Nm=require("react");function Lm(n){let{getDataSourceState:e}=Fe(o=>({getDataSourceState:o.getDataSourceState}));return(0,Nm.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 km=require("react");var s0=_t("useColumnSizeFn");function zm(n){return(0,km.useCallback)(t=>{let o=n[t];return o?o.computedWidth:0},[n])}var Wt=require("react");var jo=require("react");var $T={scrollLeft:0,scrollTop:0},ti=class{constructor(){this.scrollPosition=$T;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)}};function Vm(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 Gm=K(require("react"));function Hm(n){return(e,t)=>Gm.createElement(n,{key:e.id,rowInfo:e,cache:t})}var oi=class extends dn{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.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+=oa(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,f=u&&s!==this.availableHeight;d&&(this.availableWidth=l,this.availableRenderWidth=l),f&&(this.availableHeight=s,this.availableRenderHeight=s),(d||f)&&this.notifyAvailableSizeChange();let p=typeof o=="number",m=typeof r=="number",g=p&&o!==this.initialRows,b=m&&r!==this.initialCols;p&&g&&(this.initialRows=o,this.rows=o),m&&b&&(this.initialCols=r,this.cols=r);let h=i!=null,y=a!=null,S=h&&i!==this.rowHeight,T=y&&a!==this.initialColWidth;h&&(this.rowHeight=i),y&&(this.initialColWidth=a,this.colWidth=this.getColWidth);let C=g||S||f,w=b||T||d||C;(w||C)&&this.updateRenderCount({horizontal:w,vertical:C})}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=uo){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=>{Ve(()=>{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())}getVirtualizedContentSizeFor(t){return t==="vertical"?this.getInitialRowHeight()*this.rowsPerPage:this.pageWidth*this.totalPageCount}};var Km={};function lc(n){return`.${Zt}[data-row-index${n?`="${n.rowIndex}"`:""}][data-col-index${n?`="${n.colIndex}"`:""}]`}function sc(n,e){let t=zo(n),o=e?new oi(t,{isHeader:!1}):new dn(t),r=`${t}:header`,i=e?new oi(r,{isHeader:!0,masterBrain:o}):new dn(r);o.onScroll(u=>{i.setScrollPosition({scrollLeft:u.scrollLeft,scrollTop:0})});let{renderer:a,onRenderUpdater:l}=Wr(o),{renderer:s,onRenderUpdater:c}=Wr(i);return o.onAvailableSizeChange(u=>{i.update({width:u.width})}),{brain:o,headerBrain:i,renderer:a,onRenderUpdater:l,headerRenderer:s,headerOnRenderUpdater:c}}function Bm({debugId:n,wrapRowsHorizontally:e}){let t={},{brain:o,headerBrain:r,renderer:i,onRenderUpdater:a,headerRenderer:l,headerOnRenderUpdater:s}=sc(n,!!e),c=(0,jo.createRef)(),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 f=lc(d);return c.current.querySelector(f)||null},brain:o,headerBrain:r,domRef:c,columnMenuTargetRef:(0,jo.createRef)(),editingValueRef:(0,jo.createRef)(),scrollerDOMRef:(0,jo.createRef)(),portalDOMRef:(0,jo.createRef)(),focusDetectDOMRef:(0,jo.createRef)(),activeCellIndicatorDOMRef:(0,jo.createRef)(),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 ti,pinnedEndScrollListener:new ti,columnsWhenInlineGroupRenderStrategy:void 0,editingCell:null,forceBodyRerenderTimestamp:0}}var Wm=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,columnPinning:1,editable:1,columnDefaultEditable:1,columnDefaultFilterable:1,columnDefaultGroupable:1,columnDefaultSortable:1,keyboardShortcuts:1,rowStyle:1,cellStyle: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 or(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,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:0,rowDetailHeight:e=>typeof e=="number"||typeof e=="function"?e:300,columnHeaderHeight:e=>typeof e=="number"?e:30,columns:1,columnVisibility:e=>e??Km,columnGroupVisibility:e=>e??Km,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 UT(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 jm=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 $m(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 Ha=new WeakMap;function Um(){return{rowDetailState:(n,e)=>({callbackParams:[n,{expandRow:e.lastRowToExpandRef.current,collapseRow:e.lastRowToCollapseRef.current}]})}}var Ym=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&&t.pivotColumnGroups!=o?.pivotColumnGroups?Vm(i,t.columnGroupVisibility):t.columnGroupsDepthsMap,l=r?.groupBy,s=UT({groupRenderStrategy:e.groupRenderStrategy,groupBy:l,groupColumn:e.groupColumn}),c,u=e.rowDetailRenderer,d=e.components?.RowDetail;if(!u&&d){let b=Ha.get(d);b||(b=Hm(d),Ha.set(d,b)),u=b}u&&(c=e.rowDetailState||t.rowDetailState||e.defaultRowDetailState,c&&!(c instanceof Pt)&&(c=new Pt(c)),c=c||new Pt({expandedRows:[],collapsedRows:!0}));let f=t.columnsWhenGrouping||t.columnsWhenInlineGroupRenderStrategy||t.columns,p=c?e.isRowDetailExpanded:void 0;!p&&c&&(p=Ha.get(c),p||(p=b=>c.isRowDetailsExpanded(b.id),typeof c=="object"&&Ha.set(c,p)));let m=u?e.isRowDetailEnabled||!0:!1,g={updatedAt:Date.now(),isTree:r.isTree,rowDetailRenderer:u,rowDetailState:c,isRowDetailExpanded:p,isRowDetailEnabled:m,showColumnFilters:e.showColumnFilters??!!r.filterValue,controlledColumnVisibility:!!e.columnVisibility,groupRenderStrategy:s,groupBy:l,computedColumns:f,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||me.components.Header.columnHeaderHeight:""};if(t.devToolsDetected&&t.debugId){let b=go.get(t.debugId);b&&(g={...g,...b})}return g};function qm(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 Xm(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 f=r[d],p=i[f];if(!p.isTreeNode&&p.isGroupRow&&(c=Math.max(c,p.groupNesting-1),c===s-1))break}return Object.keys(o).forEach(d=>{let f=o[d],{groupByForColumn:p}=f;if(Array.isArray(p))return;let m=p.field||p.groupField;if(!m)return;t.get(m).groupIndex>c&&e?l[d]!==!1&&(l[d]=!1):l.hasOwnProperty(d)&&delete l[d]}),l}var Zm=require("react");function cc(){let{getDataSourceState:n,dataSourceActions:e,getDataSourceMasterContext:t}=Fe(r=>({getDataSourceState:r.getDataSourceState,dataSourceActions:r.dataSourceActions,getDataSourceMasterContext:r.getDataSourceMasterContext}));return(0,Zm.useCallback)(r=>{let i=n(),a=new Ct(i.groupRowsState);if(a.toggleGroupRow(r),e.groupRowsState=a,i.lazyLoad){let l=[Ho,...r],s=i.originalLazyGroupData.get(l);a.isGroupRowExpanded(r)?s?.cache||bn(i.data,i,e,{groupKeys:r},t()):s?.cache||(i.lazyLoadCacheOfLoadedBatches.getKeysStartingWith(r).forEach(u=>{i.lazyLoadCacheOfLoadedBatches.delete(u)}),e.lazyLoadCacheOfLoadedBatches=ee.clone(i.lazyLoadCacheOfLoadedBatches),i.originalLazyGroupData.delete(l),e.originalLazyGroupDataChangeDetect=Kt())}},[])}function YT(n){return(0,Wt.useMemo)(()=>$m(n),[n])}function Qm(n,e){let{groupBy:t,dataSourceActions:o}=Fe(c=>({groupBy:c.dataSourceState.groupBy,dataSourceActions:c.dataSourceActions})),{groupRenderStrategy:r,pivotTotalColumnPosition:i,pivotGrandTotalColumnPosition:a}=n;(0,Wt.useEffect)(()=>{o.generateGroupRows=r!=="inline"},[r]),(0,Wt.useEffect)(()=>{o.pivotTotalColumnPosition=i},[i]),(0,Wt.useEffect)(()=>{a!=null&&(o.pivotGrandTotalColumnPosition=a)},[a]);let l=YT(t);qT(l,n,e);let{toggleGroupRow:s}=XT();return ZT(l,n,e),{toggleGroupRow:s}}function qT(n,e,t){let o=cc(),{columns:r,groupRenderStrategy:i,isTree:a}=e,l=t;function s(c,u,d,f){let p={};if(d==="inline")return Object.keys(c).forEach(m=>{let g=c[m],b={},h=u.get(g.field);if(h&&d==="inline"){let{groupIndex:S}=h;b={groupByForColumn:h.groupBy,field:h.groupBy?.field,valueGetter:h.groupBy?.valueGetter,valueFormatter:({rowInfo:T})=>T.isGroupRow?T.groupKeys?.[S]:T.value,rowspan:({rowInfo:T,dataArray:C})=>{if(T.isTreeNode||!T.isGroupRow)return 1;let w=C[T.indexInAll-1]||{indexInParentGroups:[]};if(!w||!w.dataSourceHasGrouping)return 1;let I=w.indexInParentGroups||[],v=T.indexInParentGroups||[],D=!1;for(let A=0;A<=S;A++){let M=I[A];if(v[A]!==M){D=!0;break}}if(!D)return 1;let R=T.parents[S];return R?R.groupCount-(R.collapsedChildrenCount||0)+(R.collapsedGroupsCount||0):1},renderGroupIcon:Gi({groupIndexForColumn:S,groupRenderStrategy:d,toggleGroupRow:f,initialRenderGroupIcon:g.renderGroupIcon}),render:Vi({groupIndexForColumn:S,groupRenderStrategy:d})}}let y={...b,...g};p[m]=y}),Object.keys(p).length===0?void 0:p}(0,Wt.useEffect)(()=>{(()=>{l.columnsWhenInlineGroupRenderStrategy=a?void 0:s(r,n,i,o)})()},[r,n,i,o])}function XT(){let{groupBy:n,pivotBy:e,selectionMode:t}=Fe(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:f}=Ft(),p=cc();return(0,Wt.useEffect)(()=>{(()=>{let{columns:g,groupColumnIds:b}=QT({columns:r,groupColumn:i,pivotColumn:c,pivotTotalColumnPosition:u,pivotGrandTotalColumnPosition:d,groupRenderStrategy:l==="inline"?"single-column":l,groupBy:n,pivotBy:e,pivotColumns:s,toggleGroupRow:p,selectionMode:t});o.columnsWhenGrouping=g;let h=f().columnOrder;if(b.length&&Array.isArray(h)){let y=new Set(h),S=!1;b.forEach(T=>{y.has(T)||(S=!0,h=[T,...h])}),S&&(o.columnOrder=h)}})()},[r,n,e,t,a,i,l,s,u,c]),{toggleGroupRow:p}}function ZT(n,e,t){let{dataArray:o,groupRowsIndexesInDataArray:r,groupBy:i,groupRowsState:a,originalLazyGroupDataChangeDetect:l,getDataSourceState:s}=Fe(b=>({getDataSourceState:b.getDataSourceState,dataArray:b.dataSourceState.dataArray,groupRowsIndexesInDataArray:b.dataSourceState.groupRowsIndexesInDataArray,groupBy:b.dataSourceState.groupBy,groupRowsState:b.dataSourceState.groupRowsState,originalLazyGroupDataChangeDetect:b.dataSourceState.originalLazyGroupDataChangeDetect})),{columnTypes:c,computedColumns:u,hideColumnWhenGrouped:d,hideEmptyGroupColumns:f,groupRenderStrategy:p}=e,m=t,g=Oe(e);(0,Wt.useLayoutEffect)(()=>{if(p!=="multi-column")return;let b=g(),h=qm(u,n),y=Xm({computedGroupColumns:h,columnVisibility:b.columnVisibility,hideEmptyGroupColumns:f,groupRowsIndexesInDataArray:r,dataArray:o,groupBy:i,groupByMap:n});yt(b.columnVisibility,y)||(m.columnVisibility=y)},[s,p,l,i,n,u,f?o:null,f?a:null,f?r:null,f]),(0,Wt.useEffect)(()=>{let b=i.length>0,h=g(),{columnVisibility:y,columnVisibilityForGrouping:S,hideColumnWhenGrouped:T}=h,C={...y},w={...S},I=!1,v=new Set,D=new Set;Object.keys(u).forEach(R=>{let x=u[R];if(x.defaultHiddenWhenGroupedBy||T!=null)if(x.defaultHiddenWhenGroupedBy==="*"&&b||(x.defaultHiddenWhenGroupedBy===!0||T)&&x.field&&n.get(x.field)||typeof x.defaultHiddenWhenGroupedBy=="string"&&n.get(x.defaultHiddenWhenGroupedBy)||typeof x.defaultHiddenWhenGroupedBy=="object"&&Object.keys(x.defaultHiddenWhenGroupedBy).reduce((M,P)=>M||n.has(P),!1)){if(w[R]!==!1){if(y[R]===!1)return;w[R]=!1,I=!0,v.add(R)}}else w[R]===!1&&(delete w[R],I=!0,D.add(R))}),I&&(m.columnVisibilityForGrouping=w,D.forEach(R=>{delete C[R]}),v.forEach(R=>{C[R]=!1}),m.columnVisibility=C)},[u,c,i,n,d])}function QT(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 f={},p=[];if(c==="multi-column")t.forEach((m,g,b)=>{let h=tf({groupByForColumn:m,groupBy:t,pivotBy:o,groupIndexForColumn:g,groupCount:b.length,groupRenderStrategy:c,selectionMode:r},u,i),y=h.id||`group-by-${m.field||m.groupField}`;p.push(y),f[y]=h});else if(c==="single-column"&&t.length){let m=of({groupCount:t.length,groupBy:t,pivotBy:o,groupRenderStrategy:c,selectionMode:r},u,i),g=m.id||"group-by";p.push(g),f[g]=m}if(e){let m={};Object.keys(d).forEach(g=>{let b=d[g];b.field&&(m[b.field]=b)}),Object.keys(e).forEach(g=>{let b=e[g],h=b.pivotTotalColumn&&b.columnGroup,y=b.pivotTotalColumn&&!b.columnGroup;if(h&&a===!1||y&&l===!1)return;let S={...b};s&&(typeof s=="function"?S={...S,...s({column:S,pivotBy:o,groupBy:t})}:S={...S,...s}),S.inheritFromColumn!==!1&&(S={...typeof S.inheritFromColumn=="string"?d[S.inheritFromColumn]:S.pivotAggregator?.field?m[S.pivotAggregator?.field]:void 0,...S}),!S.render&&S.renderValue&&(S.render=T=>S.renderValue(T)),f[g]=S})}else Object.keys(d).forEach(m=>{let g=d[m];f[m]=g});return{columns:Object.keys(f).length?f:void 0,groupColumnIds:p}}var Jm=require("react");var eg=({columns:n,bodySize:e,columnMinWidth:t,columnMaxWidth:o,columnDefaultWidth:r,columnDefaultFlex:i,sortable:a,columnCssEllipsis:l,columnHeaderCssEllipsis:s,draggableColumns:c,columnDefaultDraggable:u,sortInfo:d,multiSort:f,filterValue:p,filterTypes:m,columnOrder:g,columnPinning:b,editable:h,columnDefaultEditable:y,columnDefaultFilterable:S,columnDefaultGroupable:T,columnDefaultSortable:C,scrollbarWidth:w,columnTypes:I,pinnedEndMaxWidth:v,pinnedStartMaxWidth:D,viewportReservedWidth:R,resizableColumns:x,columnVisibility:A,columnVisibilityAssumeVisible:M,columnSizing:P,groupBy:_})=>{let{computedRemainingSpace:L,computedColumnOrder:k,computedVisibleColumns:V,computedVisibleColumnsMap:j,computedPinnedStartColumns:O,computedPinnedEndColumns:F,computedUnpinnedColumns:te,computedPinnedStartColumnsWidth:$,computedPinnedEndColumnsWidth:Y,computedUnpinnedColumnsWidth:ae,computedUnpinnedOffset:ye,computedPinnedEndOffset:Ce,computedPinnedEndWidth:ue,computedPinnedStartWidth:pe,renderSelectionCheckBox:ge,computedColumnsMap:U,computedColumnsMapInInitialOrder:G,fieldsToColumn:X}=(0,Jm.useMemo)(()=>Ju({columns:n,scrollbarWidth:w,bodySize:e,columnMinWidth:t,columnMaxWidth:o,columnDefaultWidth:r,columnDefaultFlex:i,columnCssEllipsis:l,columnHeaderCssEllipsis:s,viewportReservedWidth:R,resizableColumns:x,filterValue:p,filterTypes:m,sortable:a,sortInfo:d,multiSort:f,pinnedEndMaxWidth:v,pinnedStartMaxWidth:D,draggableColumns:c,columnDefaultDraggable:u,columnOrder:g,columnPinning:b,columnDefaultEditable:y,columnDefaultFilterable:S,columnDefaultGroupable:T,columnDefaultSortable:C,editable:h,columnSizing:P,columnTypes:I,columnVisibility:A,columnVisibilityAssumeVisible:M??!0,groupBy:_}),[n,e.width,t,o,r,R,w,a,d,f,p,m,g,A,M,u,c,x,v,D,P,I,b,y,S,T,h,_,1]);return{renderSelectionCheckBox:ge,columns:n,computedColumnsMap:U,computedPinnedEndWidth:ue,computedPinnedStartWidth:pe,computedRemainingSpace:L,computedUnpinnedOffset:ye,computedPinnedEndOffset:Ce,computedPinnedStartColumnsWidth:$,computedPinnedEndColumnsWidth:Y,computedUnpinnedColumnsWidth:ae,computedPinnedStartColumns:O,computedPinnedEndColumns:F,computedUnpinnedColumns:te,computedVisibleColumns:V,computedVisibleColumnsMap:j,computedColumnOrder:k,computedColumnsMapInInitialOrder:G,fieldsToColumn:X}};var tg=require("react"),uc=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 JT(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],f=d?o(d):0;return e&&e.rowHeight.set(u,f),f}: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 f=l?o(d):o;if(!!(!i||typeof i=="function"&&i(d)===!1)||!r(d))return e&&(e.rowHeight.set(u,f),e.rowDetailHeight.set(u,0)),f;let m=0;return s?m=t(d):m=t,e&&(e.rowHeight.set(u,f),e.rowDetailHeight.set(u,m)),f+m}}function og(n){return(0,tg.useMemo)(()=>{let e=new uc;return{computedRowHeight:JT(n,e),computedRowSizeCacheForDetails:n.isRowDetailsExpanded?e:void 0}},[n.rowHeight,n.rowDetailHeight,n.isRowDetailsExpanded,n.isRowDetailsEnabled,n.getDataSourceState])}var nr=require("react");var eC={vertical:!1,horizontal:!1};function ng(n){let e=n().brain,{getDataSourceState:t}=Qt(),[o,r]=(0,nr.useState)(eC);return(0,nr.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,nr.useLayoutEffect)(()=>{let i=t(),{onScrollbarsChange:a}=n(),{notifyScrollbarsChange:l}=i;a&&i.updatedAt&&i.dataArray.length&&a(o),l(o)},[o]),o}function rg(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:f,pinnedStartMaxWidth:p,pinnedEndMaxWidth:m,columnVisibility:g,columnPinning:b,columnSizing:h,editable:y,columnDefaultEditable:S,columnDefaultFilterable:T,columnDefaultGroupable:C,columnTypes:w,rowHeight:I,rowDetailHeight:v,isRowDetailExpanded:D,isRowDetailEnabled:R,bodySize:x,showSeparatePivotColumnForSingleAggregation:A,onRowHeightCSSVarChange:M,onFlashingDurationCSSVarChange:P,onRowDetailHeightCSSVarChange:_,onColumnHeaderHeightCSSVarChange:E,computedColumns:L,viewportReservedWidth:k,resizableColumns:V,sortable:j,draggableColumns:O}=e,F=t,{multiSort:te,filterValue:$,filterTypes:Y,groupBy:ae,sortInfo:ye,dataSourceActions:Ce,getDataSourceState:ue,dataSourceApi:pe}=Fe(we=>({dataSourceActions:we.dataSourceActions,getDataSourceState:we.getDataSourceState,dataSourceApi:we.dataSourceApi,sortInfo:we.dataSourceState.sortInfo,multiSort:we.dataSourceState.multiSort,filterValue:we.dataSourceState.filterValue,filterTypes:we.dataSourceState.filterTypes,groupBy:we.dataSourceState.groupBy}));(0,$o.useState)(()=>{M.onChange(we=>{we&&(F.rowHeight=we)}),P.onChange(we=>{let it=we?we*1:null;it!=null&&!isNaN(it)&&(F.flashingDurationCSSVarValue=it)}),_.onChange(we=>{we&&(F.rowDetailHeight=we)}),E.onChange(we=>{we&&(F.columnHeaderHeight=we)})}),(0,$o.useEffect)(()=>{Ce.showSeparatePivotColumnForSingleAggregation=A},[A]);let{toggleGroupRow:ge}=Qm(e,t),U=L,{computedColumnOrder:G,computedVisibleColumns:X,computedVisibleColumnsMap:W,computedPinnedStartColumns:le,computedPinnedEndColumns:re,computedUnpinnedColumns:z,computedPinnedStartColumnsWidth:fe,computedPinnedEndColumnsWidth:N,computedUnpinnedColumnsWidth:Z,computedUnpinnedOffset:ce,computedPinnedEndOffset:de,computedRemainingSpace:Pe,computedPinnedStartWidth:xe,computedPinnedEndWidth:Ge,renderSelectionCheckBox:Ne,computedColumnsMap:Le,computedColumnsMapInInitialOrder:We,fieldsToColumn:Je}=eg({columns:U,scrollbarWidth:void 0,columnCssEllipsis:i,columnHeaderCssEllipsis:a,columnMinWidth:l,columnMaxWidth:s,columnDefaultWidth:c,columnDefaultFlex:u,columnDefaultSortable:d,columnDefaultDraggable:f,pinnedStartMaxWidth:p,pinnedEndMaxWidth:m,bodySize:x,viewportReservedWidth:k,resizableColumns:V,sortable:j,draggableColumns:O,sortInfo:ye??void 0,multiSort:te,groupBy:ae,columnOrder:r,columnVisibility:g,columnVisibilityAssumeVisible:!0,columnPinning:b,editable:y,columnDefaultEditable:S,columnDefaultFilterable:T,columnDefaultGroupable:C,filterValue:$,filterTypes:Y,columnSizing:h,columnTypes:w}),et=Lm(X),tt=zm(X),B=ng(o),ie=xe?fe>xe:!1,se=Ge?N>Ge:!1,[be]=(0,$o.useState)(()=>new Ga({isRowDisabledAt:it=>ue().dataArray[it]?.rowDisabled??!1,getIdForIndex:it=>ue().dataArray[it]?.id??-1})),Ye=Oe(X),[ne]=(0,$o.useState)(()=>new Va({getPrimaryKeyByIndex:pe.getPrimaryKeyByIndex,getColumnIdByIndex:we=>Ye()[we]?.id||""})),{computedRowHeight:H,computedRowSizeCacheForDetails:rt}=og({rowDetailHeight:v,rowHeight:I,isRowDetailsExpanded:D,isRowDetailsEnabled:R,getDataSourceState:ue});return(0,$o.useMemo)(()=>({multiRowSelector:be,multiCellSelector:ne,computedRowSizeCacheForDetails:rt,computedRowHeight:H,scrollbars:B,columnSize:tt,rowspan:et,toggleGroupRow:ge,computedColumnsMap:Le,computedColumnsMapInInitialOrder:We,renderSelectionCheckBox:Ne,computedPinnedStartOverflow:ie,computedPinnedEndOverflow:se,computedPinnedStartWidth:xe,computedPinnedEndWidth:Ge,computedVisibleColumns:X,computedColumnOrder:G,computedRemainingSpace:Pe,computedVisibleColumnsMap:W,computedPinnedStartColumns:le,computedPinnedEndColumns:re,computedUnpinnedColumns:z,computedPinnedStartColumnsWidth:fe,computedPinnedEndColumnsWidth:N,computedUnpinnedColumnsWidth:Z,computedUnpinnedOffset:ce,computedPinnedEndOffset:de,fieldsToColumn:Je}),[be,ne,rt,H,B,tt,et,ge,Le,We,Ne,ie,se,xe,Ge,X,G,Pe,W,le,re,z,fe,N,Z,ce,de,Je])}var lg=require("react");function tC(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 oC(){return 4294967295}function nC(n,e,t){return e=e>>>8^n[t^e&255],e}function rC(n){return n=~n,n=n<0?4294967295+n+1:n,n}function dc(n,e=3988292384){var t=tC(e),o=0,r;for(o=oC(),r=0;r<n.length;r++)o=nC(t,o,n.charCodeAt(r));return o=rC(o),`${o}`}var iC=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")??""}},ig=(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))},ag=(n="",e,t)=>{let o;try{o=aC(n)}catch{return ig(["You don't have a valid Infinite Table license","Please visit infinite-table.com to purchase a license.","Thank you for playing fair!"],t),!1}let r=new Date(e.publishedAt),i=new Date(o.end);return i<r?(ig([`
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),!1):!0},BS=o=>{let e="",t=o.split("|").map(l=>{let[s,c]=l.split("=");return s==="C"&&(e=c),{name:s,value:c}});if(!e)throw"Invalid license";let n=e.split(",").reverse(),r=n.pop();n.forEach((l,s)=>{let c=t[s];if(Js(c.value)!==l)throw"Invalid license"});let i=[...t];i.pop();let a=i.map(l=>`${l.name}=${l.value}`).join("|");if(Js(a)!==r)throw"Invalid license";return t=t.map(l=>({...l,value:decodeURI(l.value)})),KS(t)};var WS=/(https):\/\/\d+\-\d+\-\d+\-(sandpack\.codesandbox\.io)/g,jS=/(https):\/\/\S+(\.csb\.app)/g,Ym=typeof window<"u"?window.location.origin:"",$S=()=>{let[o,e,t]=Array.from(WS.exec(Ym)||[]);return e==="https"&&t==="sandpack.codesandbox.io"},US=()=>{let[o,e,t]=Array.from(jS.exec(Ym)||[]);return e==="https"&&t===".csb.app"},YS=US()||$S(),qm=(o="")=>{let t=!!He();return(0,Um.useMemo)(()=>{if(t)return!0;let r=$m(o,{publishedAt:1624970570587,version:"7.5.1"});return!o&&!r&&YS?!0:r},[o,t])};var Xo=require("react");var qS=10;function Xm(o,e,t){let n=(0,Xo.useRef)(!1),r=(0,Xo.useRef)(null);(0,Xo.useEffect)(()=>{o!=null&&(n.current=!1,zt(r.current))},[o]),(0,Xo.useEffect)(()=>{if(o!=null&&!n.current){let a=function(l=0){l++,zt(r.current),r.current=ze(()=>{n.current=t.scrollCellIntoView(o[0],o[1],{offset:30}),!n.current&&l<qS&&a(l)})};var i=a;a()}return()=>{zt(r.current)}},[o,e])}var Zo=require("react"),XS=10;function Zm(o,e,t){let n=(0,Zo.useRef)(!1),r=(0,Zo.useRef)(null);(0,Zo.useEffect)(()=>{o!=null&&(n.current=!1,cancelAnimationFrame(r.current))},[o]),(0,Zo.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<XS&&a(l)})};var i=a;a()}return()=>{cancelAnimationFrame(r.current)}},[o,e])}var Qm=o=>`--infinite-${o}`;var Qo=require("react");function Jm(o,e){ec(o,e),QS(o,e),e.detail===2&&ZS(o,e),o.getState().onCellClick?.(o,e)}function ZS(o,e){if(Mi(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 QS(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:f}=r(),{brain:p,debugId:m}=n(),{rowsPerPage:g}=p,b=f.length,h=new Be(u);h.debugId=m??"",d.cellSelectionState=h;let y={rowIndex:i,colIndex:a};if(e.metaKey||e.ctrlKey)d.singleAddClick(y);else if(e.shiftKey){let S=!!n().wrapRowsHorizontally;d.multiSelectClick(y,S?{horizontalLayout:S,rowsPerPage:g,columnsPerSet:b}:{horizontalLayout:S})}else d.resetClick(y);l.cellSelection=h}function ec(o,e){let{rowIndex:t,getDataSourceState:n,getComputed:r,dataSourceActions:i,api:a,cloneRowSelection:l}=o,{multiRowSelector:s,renderSelectionCheckBox:c}=r(),u=n(),{selectionMode:d,groupBy:f,dataArray:p,isTree:m}=u;if(f.length||m||p[t]?.rowDisabled)return!1;if(d==="multi-row"){if(c&&!e.key)return!1;let{rowSelection:b}=u;if(b=l(b),s.rowSelectionState=b,b&&typeof b=="object")return e.shiftKey?s.multiSelectClick(t):e.metaKey||e.ctrlKey?s.singleAddClick(t):s.resetClick(t),i.rowSelection=b,!0}else if(d==="single-row"){let h=p[t].id;e.metaKey||e.ctrlKey?a.rowSelectionApi.toggleRowSelection(h):a.rowSelectionApi.selectRow(h)}return!1}function eg(o,e){e.detail!==2&&void 0}var JS={Enter:!0," ":!0,a:!0};function tg(o,e){let{getState:t,getDataSourceState:n,dataSourceActions:r,api:i,dataSourceApi:a,cloneRowSelection:l,cloneTreeSelection:s}=o,{key:c,ctrlKey:u,metaKey:d}=e;if(!JS[c])return!1;let f=t(),p=n(),{activeRowIndex:m,activeCellIndex:g,keyboardNavigation:b,keyboardSelection:h}=f,{selectionMode:y,groupBy:S,rowSelection:C,treeSelectionState:T,isTree:I}=p;if(h===!1)return!1;let w=b==="row"&&m!=null?m:b==="cell"&&g!=null?g[0]:null,v=w!=null?p.dataArray[w]:null;if(!v||w==null)return!1;if(y==="single-row"&&c===" ")return i.rowSelectionApi.toggleRowSelection(v.id),!0;if(y!=="multi-row")return!1;if(c==="a"&&(u||d)){if(I&&T){let x=s(T);return x.selectAll(),r.treeSelection=x,!0}let R=l(C);return R.selectAll(),r.rowSelection=R,!0}if(c===" "){if(S.length)return v.isGroupRow&&v.groupKeys?i.rowSelectionApi.toggleGroupRowSelection(v.groupKeys):i.rowSelectionApi.toggleRowSelection(v.id),!0;if(I){if(v.isTreeNode&&v.nodePath)return a.treeApi.toggleNodeSelection(v.nodePath),!0}else{let R={...e},{renderSelectionCheckBox:x}=o.getComputed();return x&&(R.metaKey=!1,R.ctrlKey=!0),ec({...o,rowIndex:w},R)}}return!1}var ng=["input","textarea","select","[tabindex]","a[href]","button","object"].join(", "),og=o=>Array.from(o.querySelectorAll(ng)).filter(t=>!!t.offsetParent),Oa=o=>o.querySelector(ng);var ig=V(jn());async function rg(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 eC=10,tC=(o,e)=>o-e;function Na(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(),f=u[o.colIndex];if(!f)return!1;if(l&&l.columnId===f.id&&l.rowIndex===o.rowIndex)return!0;if(!f.contentFocusable)return!1;if(f.contentFocusable===!0)return!0;let p=c[o.rowIndex],m=!s||typeof s=="function"&&!s(p)?!1:i.rowDetailApi.isRowDetailExpanded(p.id)?"expanded":"collapsed",g=ut(f.id,e);return f.contentFocusable({column:f,..._o({column:f,rowInfo:p,columnsMap:d,context:e,rowDetailState:m}).formattedValueContext,columnApi:g,api:i,dataSourceApi:a})}function tc(o,e,t){let n=t.getState().editingCell;return nC(o,e,t,{isCellFocusable:Na,isColumnElligible:i=>n&&n.columnId===i.id?!0:!!i.contentFocusable})}function ag(o,e,t){let n=(0,ig.default)(t,o+e,tC);return n<0&&(n=~n,e>0&&n>=t.length||e<0&&n===0)?null:t[n]??null}globalThis.getNextCol=ag;function nC(o,e,t,n){let{isColumnElligible:r,isCellFocusable:i}=n,a=t.getComputed().computedVisibleColumns.filter(r).reduce((d,f)=>(d.push(f.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]:ag(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 lg(o){let e={rowIndex:o.getDataSourceState().dataArray.length-1,colIndex:o.getComputed().computedVisibleColumns.length-1},t=Na(e,o)?e:tc(e,-1,o);if(t){await nc([t.rowIndex,t.colIndex],o);let n=o.getState().getDOMNodeForCell(t);if(!n)return;Oa(n)?.focus()}}async function nc([o,e],t){let{api:n}=t;return new Promise((r,i)=>{let a=eC,l=null,s=!1;function c(u=0){u++,zt(l),l=ze(async()=>{if(s=n.scrollCellIntoView(o,e,{offset:30}),!s&&u<a&&c(u),s){try{await rg(()=>!!t.getState().getDOMNodeForCell({rowIndex:o,colIndex:e}))}catch(d){i(d);return}r(!0)}})}c()})}var oC=`.${Xt}`;function sg(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:vn(n,oC),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&&Na({colIndex:s,rowIndex:l},o)?{rowIndex:l,colIndex:s}:tc({rowIndex:l,colIndex:s},t,o);if(!c){if(t===-1)r.focus();else{let u=og(document.body),d=o.getState().focusDetectDOMRef.current,f=u.findIndex(m=>m===d);u[f+1]?.focus()}return!0}return nc([c.rowIndex,c.colIndex],o).then(()=>{let u=o.getState().getDOMNodeForCell(c);if(!u)return;Oa(u)?.focus()}),!0}var cg={control:"ctrl"},ug={"control|cmd":"ctrl","cmd|control":"ctrl","ctrl|cmd":"ctrl","cmd|ctrl":"ctrl"},rC={esc:"escape"},fg={cmd:o=>o.metaKey,alt:o=>o.altKey,ctrl:o=>o.ctrlKey,shift:o=>o.shiftKey},pg=Object.keys(fg),oc=new Set(pg),iC=new Set(["shift","alt"]);function Fa(o,e){return Array.isArray(e)?e.some(t=>dg(o,t)):dg(o,e)}function dg(o,e){let t=o.key.toLowerCase(),n=e.split("+").map(f=>f.toLowerCase().trim()),r=n.find(f=>ug[f]),i=n.map(f=>cg[f]||ug[f]||rC[f]||f),a=i.filter(f=>oc.has(f)),l=i.filter(f=>!oc.has(f)),s=pg.reduce((f,p)=>(f[p]=fg[p](o),f),{});r&&s.cmd&&(s.cmd=!1,s.ctrl=!0);let c=Object.keys(s).filter(f=>s[f]);if(!a.every(f=>s[f]===!0))return!1;if(l.includes("*")){if(c.length<a.length||c.filter(p=>!iC.has(p)).length)return!1}else if(a.length!=c.length)return!1;return!l.length||oc.has(t)||t==="meta"||cg[t]?!1:l.reduce((f,p)=>f?p==="*"||t===p:!1,!0)}async function mg(o,e){let t={...o,cloneRowSelection:a=>ma(a,o.getDataSourceState),cloneTreeSelection:a=>ya(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&&tg(t,e)&&e.preventDefault(),(sg(t,e)||!o.getState().focusedWithin&&!r.preventNavigation&&gm(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(!Fa(e,a.key)||a.when&&!await a.when(o))continue;let l=await a.handler(o,e);if(l&&l.stopNext)break}}function aC(){let{getState:o,actions:e,api:t,getComputed:n,getDataSourceMasterContext:r}=J(),{getState:i,componentActions:a,api:l}=Oe();return(0,Qo.useMemo)(()=>({getComputed:n,getDataSourceMasterContext:r,dataSourceApi:l,api:t,getState:o,actions:e,getDataSourceState:i,dataSourceActions:a,cloneTreeSelection:u=>ya(u,i),cloneRowSelection:u=>ma(u,i)}),[o,e,i,a,t,l,n])}function lC(){let o=aC();(0,Qo.useEffect)(()=>{let e=o.getState().keyDown.onChange(a=>{mg(o,a)});function t(a){if(!a)return;let l=a.event,s=o.getComputed().computedVisibleColumns[a.colIndex],c=ut(s.id,o);Jm({...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=ut(u.id,o);eg({...o,rowIndex:s,colIndex:c,column:u,columnApi:d},l)}let i=o.getState().cellMouseDown.onChange(r);return()=>{e(),n(),i()}},[])}function sC(){let{getState:o}=J();return{onKeyDown:(0,Qo.useCallback)(t=>{o().keyDown(t)},[])}}function gg(){return lC(),sC()}var cc=require("react");var Ge=V(require("react")),It=require("react"),Sg=require("react-dom");function rc(o){return!!o.tagName}function yg(o){let{alignTarget:e,alignAnchor:t,constrainTo:n,alignPosition:r}=o,i=ve.from(rc(e)?e.getBoundingClientRect():e),a=ve.from(rc(t)?t.getBoundingClientRect():t),l=n?ve.from(rc(n)?n.getBoundingClientRect():n):null;if(!l)return{...hg({anchorRect:a,targetRect:i,position:r[0]}),index:0};let s=null;for(let c=0,u=r.length;c<u;c++){let d=hg({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 hg(o){let e=ve.from(o.targetRect),t=ve.from(o.anchorRect),n=o.constrainRect?ve.from(o.constrainRect):null,{position:r}=o,[i,a]=r,l=bg(e,i),s=bg(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 bg(o,e){return e==="TopLeft"?Ke.from({top:o.top,left:o.left}):e==="TopCenter"?Ke.from({top:o.top,left:o.left+(o.width>0?Math.round(o.width/2):0)}):e==="TopRight"?Ke.from({top:o.top,left:o.left+o.width}):e==="BottomLeft"?Ke.from({left:o.left,top:o.top+o.height}):e==="BottomCenter"?Ke.from({left:o.left+(o.width>0?Math.round(o.width/2):0),top:o.top+o.height}):e==="BottomRight"?Ke.from({left:o.left+o.width,top:o.top+o.height}):e==="CenterLeft"?Ke.from({left:o.left,top:o.top+(o.height>0?Math.round(o.height/2):0)}):e==="CenterRight"?Ke.from({left:o.left+o.width,top:o.top+(o.height>0?Math.round(o.height/2):0)}):Ke.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)})}var La="__is_infinite_menu_component";function cC(o){return o&&typeof o.then=="function"||o instanceof Promise}function Cg(o){return o==null||typeof o=="string"?!1:typeof o.tagName=="string"}async function Tg(o){return typeof o=="function"&&(o=o()),cC(o)&&(o=await o),typeof o=="string"&&(o=document.querySelector(o)),o&&Cg(o)&&(o=o.getBoundingClientRect()),o?ve.from(o):null}async function uC(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)),Cg(n)&&(r=n),r||null}return t(await e)}function dC(o){return Ge.createElement("div",{style:{position:"fixed",top:0,left:0}},o.children)}function fC(o){let e=Ge.useRef(null);return(0,It.useEffect)(()=>o.realign.onChange(t=>{e.current&&t&&ic(e.current,t)}),[o.realign]),Ge.createElement("div",{style:{position:"absolute",top:0,left:0},ref:(0,It.useCallback)(t=>{t&&ic(t,o),e.current=t},[])},typeof o.children=="function"?o.children():o.children)}async function ic(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 Tg(t)||void 0,a=n?await Tg(n):void 0,l=ve.from(o.getBoundingClientRect());if(!a)return;let{alignedRect:s}=yg({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(),f=d.left,p=d.top,m=s.left-f,g=s.top-p;o.style.transform=`translate3d(${m}px,${g}px, 0px)`}}}function wg(o,e){let[t,n]=(0,It.useState)(null);return(0,It.useLayoutEffect)(()=>{async function r(){let i=e?await uC(e):null;i!=null&&n(i)}e&&r()},[e]),e?t?(0,Sg.createPortal)(o,t):Ge.createElement(Ge.Fragment,null):e===null||e===!1?o:Ge.createElement(dC,null,o)}function pC(o){if(Ge.Children.count(o)===1){let e=Ge.Children.only(o);if(Ge.isValidElement(e))return e.props.id||e.key}return null}function mC(o,e,t){if(Ge.Children.count(o)===1){let n=Ge.Children.only(o);if(Ge.isValidElement(n)&&n.type[La]){let r={};return n.props.portalContainer===void 0&&(r.portalContainer=e),n.props.constrainTo===void 0&&(r.constrainTo=t),Ge.cloneElement(n,r)}}return o}function en(o){let e=o,[t]=(0,It.useState)(()=>new Map),[n,r]=(0,It.useState)(null),[i,a]=(0,It.useState)(0),l=(0,It.useCallback)(()=>{let m=[];for(let[g,b]of t)m.push(Ge.createElement(fC,{...b,key:b.key}));return m},[]),[s,c]=Mt(),u=wg(l(),o.portalContainer),d=(0,It.useCallback)((m,g)=>{let h=`${g.id||pC(m)||Ht()}`,y=t.get(h),S=I=>()=>{let w=typeof I=="function"?I():I;return mC(w,e.portalContainer,g.constrainTo??e.constrainTo)},C=S(m),T=(I,w)=>{if(!y)return;let v=S(I);Object.assign(y,{children:v}),c(),!!!w?.skipRealign&&(r(y.key),a(Date.now()))};return y?(Object.assign(y,g),T(m),T):(y={key:h,children:C,alignPosition:g.alignPosition,alignTo:g.alignTo,constrainTo:g.constrainTo,realign:Te()},t.set(y.key,y),c(),T)},[t,e.portalContainer,c]);Ge.useEffect(()=>{if(n){let m=t.get(n);m&&m.realign(m)}},[n,i]);let f=m=>{m=`${m}`,t.has(m)&&(t.delete(m),c())},p=()=>{t.clear(),c()};return Ge.useEffect(()=>{},[]),{portal:u,hideOverlay:f,clearAll:p,rerenderOverlays:c,showOverlay:d}}var Lg=V(require("react"));var tr=V(require("react"));var Jo=V(require("react"));var Zr=V(require("react"));function ka(o){return null}ka.defaultProps={__is_menu_item:!0};var Ig="db3arf0 _16lm1iw0 _16lm1iw1 _16lm1iw1w _16lm1iw2f _16lm1iw8",vg=pe({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"]]}),Rg="db3arf1",xg="db3arfd";var gC="-";function hC(){return Zr.createElement("hr",{className:xg})}var za=({columns:o,keyboardActiveItemKey:e,activeItemKey:t,menuId:n},r)=>{let i=r&&(r.key!=null||r.label!=null)?r:null,a=i===null?r===gC?Zr.createElement(hC,null):r:null;return i!=null?{type:"item",parentMenuId:n,disabled:!!i.disabled,keyboardActive:i.key===e,active:i.key===t,value:i,span:i.span||1,key:i.key,menu:i.menu||null,style:i.style,className:i.className,originalMenuItem:i}:{type:"decoration",value:a,span:o.length,style:{gridColumnStart:1,gridColumnEnd:o.length+10}}};function Pg(o,e){return Zr.Children.map(e,t=>{if(t&&(t.props.__is_menu_item||t.type===ka)){let n={...t.props};return n.key||(n.key=t.key),n.description||(n.description=t.props.children),n.label||(n.label=n.children),za(o,n)}return za(o,t)})||[]}var Dg="submenu";function Mg(){let o=Jo.createRef();return{keyboardActiveItemKey:null,activeItemKey:null,generatedId:Ht(),focused:!1,destroyed:!1,domRef:o}}var Eg=()=>({parentMenuId:1,parentMenuItemKey:1,onHideIntent:1,constrainTo:1,onAction:1,onShow:1,onHide:1,autoFocus:1,wrapLabels:1}),bC=[{name:"label"}],Ag=o=>{let{props:e,state:t}=o,{activeItemKey:n,keyboardActiveItemKey:r}=t,{items:i,children:a,addSubmenuColumnIfNeeded:l,parentMenuId:s}=e,c=e.id||t.generatedId;s&&(c=`${s}-${c}`);let u=[...e.columns||bC],d={columns:u,keyboardActiveItemKey:r,activeItemKey:n,menuId:c},f=[];i?f=i.map(za.bind(null,d)):!i&&typeof a!="function"&&(f=Pg(d,a)),l&&f.filter(g=>g.type==="item"&&g.menu!=null).length>0&&!u.find(g=>g.name==Dg)&&u.push({name:Dg,render:({domProps:g,item:b})=>b.menu?Jo.createElement("div",{...g},Jo.createElement(Xn,{expanded:!1})):Jo.createElement("div",{...g})});let p=f.filter(m=>m.type==="item"&&!m.disabled);return{runtimeItems:f,runtimeSelectableItems:p,columns:u,menuId:c}};var Wt=V(require("react")),it=require("react");var Qr=class extends Mo{constructor(e){super(e.slice(0,3))}};var yC=250;function TC(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}ze(i)};ze(()=>{i()})})}var SC=xe(),Va=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||yC;this.getPointerMoveTarget=()=>document.documentElement||SC;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 Ke({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 Qr([this.activeItemLeavePoint,this.activeItemMenuRect.getTopLeft(),this.activeItemMenuRect.getBottomLeft()]):new Qr([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,TC(()=>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 Ke({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 Ga=require("react"),ac=(0,Ga.createContext)(null);function lc(){return(0,Ga.useContext)(ac)}var er=require("react");function _g(){let o=(0,er.useRef)(!0);return(0,er.useEffect)(()=>(o.current=!0,()=>{o.current=!1}),[]),(0,er.useCallback)(()=>o.current,[])}function CC(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()),Wt.createElement(jt,{key:c,parentMenuItemKey:o.key,parentMenuId:t,constrainTo:a,...u,autoFocus:!1,onShow:(d,f)=>{u?.onShow?.(d,f),n(f)},onHideIntent:d=>{u?.onHideIntent?.(d),l(d)},onHide:d=>{d.focused&&(r(null),i(o.key),s.focus())}})):null}function wC(o,e){let t=Og(o,e);if(!t.length)return null;let n=ve.from(t[0]?.getBoundingClientRect()),r=ve.from(t[t.length-1].getBoundingClientRect()),i=n;return i.width=r.left+r.width-n.left,i}function Og(o,e){let t=vn(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 IC(o,e){let t=Og(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}function vC({onItemActivate:o}){let{getState:e}=lc(),[{onItemEnter:t,onItemLeave:n}]=(0,it.useState)(()=>new Va({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?ve.from(a.getBoundingClientRect()):void 0}}).getHandlers());return{onItemEnter:(0,it.useCallback)(t,[]),onItemLeave:(0,it.useCallback)(n,[])}}function Ng(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:f,autoFocus:p,parentMenuItemKey:m,domRef:g},componentActions:b,getState:h}=lc(),y=(0,it.useCallback)(W=>{b.keyboardActiveItemKey=W},[]),S=(0,it.useCallback)(W=>{b.activeItemKey=W},[]),C=_g(),[T,I]=(0,it.useState)(null),w=null;(0,it.useLayoutEffect)(()=>{let{runtimeItems:W}=h(),$=W.filter(re=>re.type==="item"&&i===re.key)[0];if(!$||!$.menu){I(null),M();return}if($){let re=wC(r,$.key);re&&R(()=>CC($,{constrainTo:l,setSubmenuApi:I,setActiveItemKey:S,setKeyboardActiveItemKey:y,parentMenuId:r,onHideIntent:z,api:L}),{id:`${r}-submenu`,alignTo:re,alignPosition:[["TopLeft","TopRight"],["TopRight","TopLeft"]],constrainTo:l});return}},[i]);let v=(W,$)=>{y($.key),S($.key),$.originalMenuItem.onClick&&$.originalMenuItem.onClick(W);let re={key:$.key,item:$.originalMenuItem,hideMenu:z};$.originalMenuItem.onAction&&$.originalMenuItem.onAction(re),c&&c(re),$.originalMenuItem.hideMenuOnAction&&z()},{showOverlay:R,portal:x,clearAll:M}=en({portalContainer:!1}),{onItemEnter:A,onItemLeave:E}=vC({onItemActivate:W=>{if(!C())return;let $=W?W.key:null;S($)}});w=n.map((W,$)=>Wt.createElement(RC,{key:W.type==="item"?W.key:$,onItemEnter:(re,ge)=>{A(re.key,ge)},onItemLeave:(re,ge)=>{E(re.key,ge)},columns:t,active:W.type==="item"&&W.key===i,keyboardActive:W.type==="item"&&W.key===a,item:W,index:$,onClick:v}));let P=t.map(W=>W.width||(typeof W.flex=="number"?`${W.flex}fr`:W.flex)||"auto").join(" "),_={...e.style,gridTemplateColumns:P,gridTemplateRows:n.map(()=>"auto").join(" ")};u||(_.whiteSpace="nowrap");function D(W){let{runtimeItems:$,runtimeSelectableItems:re}=h(),ge=$.findIndex(K=>K.type==="item"&&K.key===a),me=a,ue=$[ge],de={ArrowUp:()=>{let K=$.slice(0,ge).filter(H=>H.type==="item"&&!H.disabled).pop();K&&K.type==="item"&&K.key&&(me=K.key)},ArrowDown:()=>{let K=$.slice(ge+1).filter(H=>H.type==="item"&&!H.disabled)[0];K&&K.type==="item"&&K.key&&(me=K.key)},Home:()=>{de.PageUp()},End:()=>{de.PageDown()},PageUp:()=>{me=re[0].key},PageDown:()=>{me=re[re.length-1].key},ArrowLeft:()=>{S(null),h().parentMenuId&&(b.destroyed=!0)},ArrowRight:()=>{ue&&(S(ue.key),ze(()=>{C()&&T&&T.getParentMenuId()===h().menuId&&T.focus()}))},Enter:()=>{if(ue)if(ue.originalMenuItem?.menu){if(ue&&ue.originalMenuItem.menu&&T){de.ArrowLeft();return}ue&&S(ue.key)}else v(W,ue)}," ":()=>{if(!ue)return;ue.originalMenuItem.menu||v(W,ue);let K=IC(r,ue.key);K&&K.click()},Escape:()=>{de.ArrowLeft();let K=h();K.parentMenuId||K.onHideIntent?.(K)}},he=de[W.key];he&&(he(),W.preventDefault()),me!=a&&y(me)}function O(){b.focused=!1}let F=(0,it.useCallback)(function(){b.focused=!0,setTimeout(()=>{j.current&&g.current&&g.current===document.activeElement&&h().keyboardActiveItemKey==null&&y(h().runtimeSelectableItems[0]?.key??null)})},[]),j=(0,it.useRef)(!0),z=(0,it.useCallback)(()=>{let W=h();W.onHideIntent?.(W)},[h]),[L]=(0,it.useState)(()=>({hideMenu:z,focus:()=>{g.current&&(g.current.focus(),setTimeout(()=>{g.current&&g.current!==document.activeElement&&g.current.focus()},10),F())},getMenuId:()=>h().menuId,getParentMenuId:()=>h().parentMenuId})),le=(0,it.useCallback)(W=>{W?(g.current=W,d?.(h(),L),p&&L.focus()):(f?.(h()),g.current=W)},[]),ne=Wt.createElement("div",{className:To.contents},Wt.createElement("div",{...e,"data-menu-id":r,"data-submenu-for":m,tabIndex:0,ref:le,onKeyDown:W=>{e.onKeyDown?.(W),D(W)},onMouseDown:W=>{j.current=!1,e.onMouseDown?.(W)},onMouseUp:W=>{j.current=!0,e.onMouseUp?.(W)},onFocus:F,onBlur:O,className:Z(Ig,e.className,"InfiniteMenu"),style:_},w),x);return s?null:ne}function RC(o){let[e,t]=Wt.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=Wt.createElement("div",{style:r.style},r.value);else{let u=0;c=n.map((d,f)=>{let p=r.value,m=d.field||d.name,g=f+1,b=g+r.span;if(g<u)return null;u=b;let y={style:{...d.style,...r.style,gridColumnStart:g,gridColumnEnd:b},"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:Z(vg({active:a,disabled:!!r.disabled,keyboardActive:l,pressed:e||o.active}),r.className),onPointerEnter:S=>{r.disabled||o.onItemEnter?.(r,S)},onPointerLeave:S=>{r.disabled||o.onItemLeave?.(r,S)},onMouseDown:()=>{r.disabled||t(!0)},onMouseUp:()=>{r.disabled||t(!1)},onClick:S=>{r.disabled||o.onClick(S,r)}};return d.render?Wt.createElement(Er,{key:`${s}-${m}`,render:d.render,renderParam:{item:p,column:d,value:p[m],domProps:y}}):Wt.createElement("div",{key:`${s}-${m}`,...y},p[m])}).filter(Boolean)}return Wt.createElement("div",{className:Rg},c)}var{ManagedComponentContextProvider:xC}=Et({initSetupState:Mg,forwardProps:Eg,mapPropsToState:Ag,layoutEffect:!0});function PC(o){let{componentActions:e,componentState:t}=qe(),n=Ae(t);return tr.createElement(ac.Provider,{value:{componentActions:e,componentState:t,getState:n}},tr.createElement(Ng,{domProps:o.domProps}))}function jt(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:f,parentMenuItemKey:p,autoFocus:m,id:g,onHideIntent:b,__is_infinite_menu_component:h,...y}=o;return tr.createElement(xC,{addSubmenuColumnIfNeeded:i,bubbleActionsFromSubmenus:a,wrapLabels:c,...o},tr.createElement(PC,{domProps:y}))}jt[La]=!0;var sc=V(require("react"));function Fg(o,e){let{columnApi:t,column:n,getComputed:r,api:i,dataSourceApi:a}=e,s=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()}},"-"]:[],...s,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 u=[];return r().computedColumnsMapInInitialOrder.forEach((f,p)=>{let m=Wn(f,e,"column-menu");u.push({key:p,label:m,check:sc.createElement(rn,{key:f.id,disabled:f.computedVisible&&i.getVisibleColumnsCount()===1,checked:f.computedVisible,onChange:g=>{let b=!!g;i.setVisibilityForColumn(f.id,b),requestAnimationFrame(()=>{i.realignColumnContextMenu()})}})})}),{columns:[{name:"check"},{name:"label"}],items:u}}},"-",{key:"group-by",label:"Group by",menu:()=>{let u=[];return r().computedColumnsMapInInitialOrder.forEach((f,p)=>{if(f.groupByForColumn)return;let m=Wn(f,e,"column-menu");u.push({key:p,label:m,check:sc.createElement(rn,{key:f.id,disabled:!f.computedGroupable,checked:f.computedGroupedBy,onChange:()=>{a.toggleGroupByField(f.field)}})})}),{columns:[{name:"check"},{name:"label"}],items:u}}}].filter(u=>!!u)}function kg(o,e,t){if(o==null)return null;let{getComputed:n,getState:r}=e,{components:i,getColumnMenuItems:a}=r(),l=i?.Menu??jt,s=n().computedColumnsMap.get(o);if(!s)return null;let c={column:s,columnApi:ut(s.id,e),...e},u=Fg([],c),d=a?a(u,c):u,f=m=>{m.__insideMenu=!0},p=m=>{m.domRef.current?.parentNode?.removeEventListener("mousedown",f)};return!d||!d.length?null:Lg.createElement(l,{autoFocus:!0,items:d,onShow:m=>{m.domRef.current?.parentNode?.addEventListener("mousedown",f)},onHide:p,onHideIntent:m=>{p(m),t?.()}})}var DC=`[${ls["data-name"]}="${ss["data-name"]}"]`;function MC(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=`[${dp["data-column-id"]}="${e}"] ${DC}`;u=i().domRef.current.querySelector(d)}if(!u){console.warn(`Cannot show column menu for column "${e}"`);return}l.current=null,r(()=>kg(e,t,c),{constrainTo:s.current,id:"column-menu",alignTo:u,alignPosition:[["TopLeft","BottomLeft"],["TopRight","BottomRight"]]})}function zg(){let o=J(),e=He(),{getState:t,actions:n}=o,{showOverlay:r,portal:i,clearAll:a}=en({portalContainer:e?e.getMasterState().portalDOMRef.current:!1});(0,cc.useEffect)(()=>{let{actions:c,getState:u}=o,d=u();return d.onColumnMenuClick.onChange(f=>{f&&(d.columnMenuTargetRef.current=f.target,c.contextMenuVisibleFor=null,c.cellContextMenuVisibleFor=null,c.filterOperatorMenuVisibleForColumnId=null,c.columnMenuVisibleForColumnId=f.column.id)})},[]);let{columnMenuVisibleForColumnId:l,columnMenuVisibleKey:s}=t();return(0,cc.useEffect)(()=>{let{columnMenuVisibleForColumnId:c,columnMenuTargetRef:u}=t();if(c){let f=function(p){p.__insideMenu!==!0&&(a(),n.columnMenuVisibleForColumnId=null)};var d=f;return document.documentElement.addEventListener("mousedown",f),MC({columnId:c,context:o,clearAll:a,showOverlay:r}),()=>{document.documentElement.removeEventListener("mousedown",f)}}else u.current=null,a();return()=>{}},[l,s]),{menuPortal:i}}var Vg=V(require("react")),Gg=require("react");var EC={width:0,height:0,overflow:"hidden",pointerEvents:"none",outline:"none",zIndex:-1};function Hg(){let{getState:o,api:e,actions:t,getComputed:n,dataSourceApi:r,dataSourceActions:i}=J(),{getState:a,getDataSourceMasterContext:l}=Oe(),{focusDetectDOMRef:s}=o(),c=(0,Gg.useCallback)(async()=>{lg({getDataSourceState:a,getDataSourceMasterContext:l,getComputed:n,actions:t,dataSourceActions:i,api:e,getState:o,dataSourceApi:r})},[]);return Vg.createElement("div",{onFocus:c,ref:s,tabIndex:0,style:EC})}var nr=require("react");function AC(){let o=J(),{getState:e}=o,{editingCell:t}=e(),n=t&&!t.active?t.cancelled:void 0;(0,nr.useEffect)(()=>{if(n){let{rowIndex:r,columnId:i,initialValue:a}=e().editingCell,{onEditCancelled:l}=e();l?.({...St({rowIndex:r,columnId:i,...o}),initialValue:a})}},[n])}function _C(){let o=J(),{getState:e,state:{editingCell:t}}=o,n=t&&!t.active&&t.accepted instanceof Error?t.accepted:void 0;(0,nr.useEffect)(()=>{if(n){let{rowIndex:r,columnId:i,value:a,initialValue:l}=e().editingCell,{onEditRejected:s}=e();s?.({...St({rowIndex:r,columnId:i,...o}),value:a,error:n,initialValue:l})}},[n])}function OC(){let o=J(),{state:{editingCell:e}}=o,t=e?.active,n=Cn(t);(0,nr.useEffect)(()=>{!t&&n&&o.api.focus()},[t,n])}function NC(){let o=J(),{state:{editingCell:e},getState:t}=o,n=e&&!e.active&&!e.cancelled&&e.accepted===!0;(0,nr.useEffect)(()=>{if(n){let{editingCell:r}=t(),{value:i,rowIndex:a,columnId:l,initialValue:s}=r,c={...St({rowIndex:a,columnId:l,...o}),value:i,initialValue:s};t().onEditAccepted?.(c),o.api.persistEdit({value:i})}},[n])}function FC(){let o=J(),{state:{editingCell:e},getState:t}=o,n=e?e.persisted:void 0;(0,nr.useEffect)(()=>{if(n){let{editingCell:r,onEditPersistError:i,onEditPersistSuccess:a}=t();if(!r)return;let{rowIndex:l,columnId:s,value:c,initialValue:u}=r,d={...St({rowIndex:l,columnId:s,...o}),value:c,initialValue:u};n instanceof Error?i?.({...d,error:n}):a?.(d)}},[n])}function Kg(){AC(),_C(),NC(),FC(),OC()}var fc=require("react");var Vn=V(require("react"));var uc=V(require("react")),Ha=o=>uc.createElement(ke,{...o},uc.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}));var dc=V(require("react")),Bg=o=>dc.createElement(ke,{...o},dc.createElement("path",{d:"m9.55 19-6.725-6.725L5.25 9.85l4.3 4.325 9.225-9.225 2.425 2.4Z"}));function Wg(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(),f=u?.Menu??jt,p=n().computedColumnsMap.get(o);if(!p)return null;let m=w=>{w.__insideMenu=!0},g=w=>{w.domRef.current?.parentNode?.removeEventListener("mousedown",m)},{filterTypes:b}=i(),h=b[p.computedFilterType];if(!h)return null;let y=h.operators.map(w=>{let v=w.name,R=p.computedFilterValue?p.computedFilterValue.filter.operator===v:v===h.defaultOperator,x=w.components?.Icon??wo;return{key:v,icon:Vn.createElement(x,null),label:Vn.createElement(Vn.Fragment,null,w.label??w.name),onAction:()=>{c.setColumnFilterOperator(o,v)},checked:R?Vn.createElement(Bg,{size:16}):null}}),C=[...[{key:"close",label:"Close Menu",icon:null,onAction:()=>{c.hideFilterOperatorMenu()}},{key:"reset",label:"Reset",icon:Vn.createElement(Ha,null),disabled:!p.computedFiltered,onAction:()=>{c.clearColumnFilter(o)}},"-"],...y],T={column:p,api:c,getState:r,getDataSourceState:i,getComputed:n,actions:a,dataSourceApi:l,dataSourceActions:s,columnFilterValue:p.computedFilterValue,filterTypes:b},I=d?d(C,T):C;return Vn.createElement(f,{autoFocus:!0,columns:[{name:"icon"},{name:"label"},{name:"checked"}],items:I,onShow:w=>{w.domRef.current?.parentNode?.addEventListener("mousedown",m)},onHide:g,onHideIntent:w=>{g(w),t?.()}})}var Ka=10;function jg(){let o=J(),e=He(),{getState:t,actions:n}=o,{showOverlay:r,portal:i,clearAll:a}=en({portalContainer:e?e.getMasterState().portalDOMRef.current:!1});return(0,fc.useEffect)(()=>{let{actions:l,getState:s}=o;return s().onFilterOperatorMenuClick.onChange(u=>{if(!u)return;let{target:d,column:f}=u;function p(){a(),l.filterOperatorMenuVisibleForColumnId=null}let m=d?.parentElement||d,g=ve.from(m.getBoundingClientRect());g.top-=Ka,g.left-=Ka,g.width+=2*Ka,g.height+=2*Ka,r(()=>Wg(f.id,o,p),{constrainTo:s().domRef.current,id:"filter-operator-menu",alignTo:g,alignPosition:[["TopLeft","BottomLeft"],["TopRight","BottomRight"]]}),l.contextMenuVisibleFor=null,l.cellContextMenuVisibleFor=null,l.columnMenuVisibleForColumnId=null,l.filterOperatorMenuVisibleForColumnId=f.id})},[]),(0,fc.useEffect)(()=>{let{filterOperatorMenuVisibleForColumnId:l}=t();if(l){let c=function(u){u.__insideMenu!==!0&&(a(),n.filterOperatorMenuVisibleForColumnId=null)};var s=c;return document.documentElement.addEventListener("mousedown",c),()=>{document.documentElement.removeEventListener("mousedown",c)}}else a();return()=>{}},[t().filterOperatorMenuVisibleForColumnId]),{menuPortal:i}}var Jr=require("react");var hc=V(require("react"));var pc=V(require("react"));function Ba(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 mc(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 gc(o,e,t){if(!o)return null;let n=Te();return o.then(r=>{let{items:i,columns:a}=Ba(r);i&&i.length&&n(pc.createElement(t,{...e,items:i||[],columns:a}))}),pc.createElement(En,{updater:n})}function $g(o,e,t){let{columnId:n,rowIndex:r,event:i}=o,{getComputed:a,getState:l}=e,{components:s,getCellContextMenuItems:c}=l(),u=s?.Menu??jt,{computedColumnsMap:d}=a(),f=d.get(n),p={...St({...e,rowIndex:r,columnId:f.id}),event:i};if(!f||!c)return{cellContext:p,menu:null,preventDefault:!1};let m=mc({onHideIntent:t}),g=c(p,e),b=g instanceof Promise||Array.isArray(g)?!0:!!(g&&Array.isArray(g.items));if(g instanceof Promise)return{cellContext:p,menu:gc(g,m,u),preventDefault:b};let{items:h,columns:y}=Ba(g);return!h||!h.length?{cellContext:p,menu:null,preventDefault:Array.isArray(h)}:{preventDefault:b,menu:hc.createElement(u,{...m,columns:y,items:h}),cellContext:p}}function Ug(o,e,t){let{getState:n,getComputed:r}=e,{components:i,getContextMenuItems:a}=n(),l=i?.Menu??jt,{computedColumnsMap:s}=r(),c=o.columnId?s.get(o.columnId):void 0,u=c?{...o,...St({...e,rowIndex:o.rowIndex,columnId:c.id})}:o;if(!a)return{cellContext:u,menu:null,preventDefault:!1};let d=mc({onHideIntent:t}),f=a(u,e),p=f instanceof Promise||Array.isArray(f)?!0:!!(f&&Array.isArray(f.items));if(f instanceof Promise)return{cellContext:u,menu:gc(f,d,l),preventDefault:p};let{items:m,columns:g}=Ba(f);return!m||!m.length?{cellContext:u,menu:null,preventDefault:Array.isArray(m)}:{preventDefault:p,menu:hc.createElement(l,{...d,columns:g,items:m}),cellContext:u}}var Wa=5,Yg=[["TopLeft","BottomLeft"],["TopRight","BottomRight"],["BottomLeft","BottomLeft"],["BottomRight","BottomRight"],["TopCenter","TopLeft"],["BottomCenter","TopLeft"],["CenterLeft","TopLeft"],["CenterRight","TopLeft"]];function qg(){let o=J(),e=He(),{getState:t,actions:n}=o,{showOverlay:r,portal:i,clearAll:a}=en({portalContainer:e?e.getMasterState().portalDOMRef.current:!1});return(0,Jr.useEffect)(()=>{let{actions:l,getState:s,getDataSourceState:c}=o;return s().cellContextMenu.onChange(d=>{if(!d)return;let{event:f}=d;function p(){a(),l.cellContextMenuVisibleFor=null}let{menu:m,cellContext:g,preventDefault:b}=$g(d,o,p),h=ve.fromPoint({top:f.clientY,left:f.clientX});h.width+=Wa,h.height+=Wa,r(m,{constrainTo:s().domRef.current,id:"cell-context-menu",alignTo:h,alignPosition:Yg}),b&&f.preventDefault(),l.cellContextMenuVisibleFor={columnId:d.columnId,rowId:d.rowId,rowIndex:d.rowIndex,colIndex:d.colIndex};let{onCellContextMenu:y}=s();y&&y({...g,getState:s,getDataSourceState:c},f)})},[]),(0,Jr.useEffect)(()=>{let{cellContextMenuVisibleFor:l}=t();if(l){let c=function(u){u.__insideMenu!==!0&&(a(),n.cellContextMenuVisibleFor=null)};var s=c;return document.documentElement.addEventListener("mousedown",c),()=>{document.documentElement.removeEventListener("mousedown",c)}}else a();return()=>{}},[t().cellContextMenuVisibleFor]),{menuPortal:i}}function Xg(){let o=J(),e=He(),{getState:t,actions:n}=o,{showOverlay:r,portal:i,clearAll:a}=en({portalContainer:e?e.getMasterState().portalDOMRef.current:!1});return(0,Jr.useEffect)(()=>{let{actions:l,getState:s}=o;return s().contextMenu.onChange(u=>{if(!u)return;let{event:d}=u;function f(){a(),l.contextMenuVisibleFor=null}let{menu:p,cellContext:m,preventDefault:g}=Ug(u,o,f),b={top:d.clientY,left:d.clientX},h=ve.fromPoint(b);h.width+=Wa,h.height+=Wa,r(p,{constrainTo:s().domRef.current,id:"table-context-menu",alignTo:h,alignPosition:Yg}),g&&d.preventDefault(),l.contextMenuVisibleFor={point:b,...u};let{onContextMenu:y}=s();y&&y({...o,...m},d)})},[]),(0,Jr.useEffect)(()=>{let{contextMenuVisibleFor:l}=t();if(l){let c=function(u){u.__insideMenu!==!0&&(a(),n.contextMenuVisibleFor=null)};var s=c;return document.documentElement.addEventListener("mousedown",c),()=>{document.documentElement.removeEventListener("mousedown",c)}}else a();return()=>{}},[t().contextMenuVisibleFor]),{menuPortal:i}}var Zg=require("react"),Qg=V(require("react"));var ja=require("react");function $a(o,e){let{state:{brain:t}}=J(),n=(0,ja.useCallback)(o,e);(0,ja.useEffect)(()=>t.onScroll(n),[t,n])}var bc="yzx0vj0";function Jg(o){let{width:e,maxWidth:t,minWidth:n,scrollable:r,...i}=o,a=(0,Zg.useRef)(null);$a(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=ce.runtime.totalVisibleColumnsWidthValue:e==="viewport"&&(l.width=ce.runtime.bodyWidth),n==="column"?l.minWidth=ce.runtime.totalVisibleColumnsWidthValue:n==="viewport"&&(l.minWidth=ce.runtime.bodyWidth),t==="column"?l.maxWidth=ce.runtime.totalVisibleColumnsWidthValue:t==="viewport"&&(l.maxWidth=ce.runtime.bodyWidth),Qg.createElement("div",{ref:a,...i,className:i.className?Z(i.className,bc):bc,style:l},i.children)}var LC=q(Y.columnWidthAtIndex),kC=q(Y.columnOffsetAtIndex);function eh(){return J().computed.computedVisibleColumns.map(e=>({id:e.id,width:e.computedWidth,cssVarForWidth:`var(${LC}-${e.computedVisibleIndex})`,offset:e.computedOffset,cssVarForOffset:`var(${kC}-${e.computedVisibleIndex})`,pinned:e.computedPinned}))}var Ua="InfiniteTable";var th=require("react");function nh(){let{getState:o,actions:e,dataSourceActions:t,getDataSourceState:n}=J(),{groupBy:r,isTree:i}=n(),a=o(),{brain:l,wrapRowsHorizontally:s}=a,c=a.repeatWrappedGroupRows;s||(c=!1),(0,th.useEffect)(()=>{if(!s){n().repeatWrappedGroupRows&&(t.repeatWrappedGroupRows=!1);return}let u=()=>{let{rowsPerPage:p,repeatWrappedGroupRows:m}=n(),g=!1,b=l.rowsPerPage,h=(r&&r.length>0||i)&&b>0?b:null;return p!=h&&(t.rowsPerPage=h,g=!0),m!=c&&(t.repeatWrappedGroupRows=c??!1,g=!0),g};u();let d,f=l.onVerticalRenderRangeChange(()=>{u()&&(d=setTimeout(()=>{e.forceBodyRerenderTimestamp=Date.now()}))});return()=>{d&&clearTimeout(d),f()}},[l,s,r,i,c])}var fo=require("react");var ei=pe({defaultClassName:"_143ofgf0",variantClassNames:{active:{true:"_143ofgf1",false:"_143ofgf2"}},defaultVariants:{},compoundVariants:[]}),oh="_143ofgf5",rh="_143ofgf3";var zC=q(ce.loaded),yc={source:"infinite-table-page",target:"infinite-table-devtools-background"};function ih(o,e){let{type:t,debugId:n}=o;if(t==="unmount")return{...yc,url:Tc(),type:t,payload:{debugId:n}};let r=e,i=r.getComputed(),a=r.getDataSourceState(),l=r.getState();return{...yc,url:Tc(),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)}}}}var Tc=st(function(){let o=new URL(window.location.href);return o.origin+o.pathname});function VC(o){window.postMessage(o)}var GC=st(()=>{console.log("Infinite Table DevTools detected!");let o=(e,t)=>{if(t){Ot.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(ih({type:"update",debugId:e},t))}else $p(e),window.postMessage(ih({type:"unmount",debugId:e},null))};return window.__INFINITE_TABLE_DEVTOOLS_HOOK__=o,We.onLogIntent("IT:*",e=>{VC({...yc,url:Tc(),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 ah(){let{getState:o,getDataSourceState:e,dataSourceActions:t}=J(),n=o(),{domRef:r,debugId:i}=n;return i&&r.current&&getComputedStyle(r.current).getPropertyValue(zC)!==`${Xu}`&&Ur({debugId:i,key:"CSS001_CSS"}),(0,fo.useEffect)(()=>{e().debugId!==i&&(t.debugId=i)},[i]),BC()}var Ya=Te(),HC={revertAll:o=>{let e=Ot.get(o.debugId);if(e){let t=Ln.get(o.debugId);Ln.delete(o.debugId),un.delete(o.debugId),t&&Object.keys(t).forEach(r=>{e.actions[r]=t[r],delete t[r]});let n=fn.get(o.debugId);fn.delete(o.debugId),dn.delete(o.debugId),n&&Object.keys(n).forEach(r=>{e.dataSourceActions[r]=n[r],delete n[r]})}},revertProperty:o=>{let e=Ot.get(o.debugId);if(e){let t=o.property,n=un.get(o.debugId),r=Ln.get(o.debugId),i=dn.get(o.debugId),a=fn.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=fn.get(o.debugId)||{};delete i[s],e.dataSourceActions[s]=c[s],delete c[s]}}},discardWarning:o=>{let e=Ot.get(o.debugId);if(e){let t=o.warning,n=e.getDataSourceState().debugWarnings;if(n.get(t))n.delete(t),Yr(o.debugId);else{let i=o.warning,a=e.getState().debugWarnings;a.get(i)&&(a.delete(i),Yr(o.debugId))}}},discardAllWarnings:o=>{let e=Ot.get(o.debugId);e&&(e.getDataSourceState().debugWarnings.clear(),e.getState().debugWarnings.clear(),Yr(o.debugId))},setColumnVisibility:o=>{Vs(o.debugId,"columnVisibility",o.columnVisibility)},setGroupBy:o=>{wa(o.debugId,"groupBy",o.groupBy)},setGroupRenderStrategy:o=>{Vs(o.debugId,"groupRenderStrategy",o.groupRenderStrategy)},setSortInfo:o=>{wa(o.debugId,"sortInfo",o.sortInfo)},setMultiSort:o=>{wa(o.debugId,"multiSort",o.multiSort)},highlight:o=>{let e=Ot.get(o.debugId);if(e){let t=e.getState().domRef.current;if(t){let n=t.getBoundingClientRect(),r=document.querySelector(`.${ei.classNames.base}`);r||(r=document.createElement("div"),r.classList.add(ei.classNames.base),r.innerHTML=[`<div class="${rh}"></div>`,`<div class="${oh}"></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(ei.classNames.variants.active.true),a.removeEventListener("animationend",l)};a.addEventListener("animationend",l),r.classList.add(ei.classNames.variants.active.true)}}}}};function KC(){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__||(GC(),Ya(window.__INFINITE_TABLE_DEVTOOLS_HOOK__)),typeof o.data.type=="string")){let e=o.data.type,t=HC[e];t&&t(o.data.payload)}})}KC();function BC(){let{getState:o,getComputed:e,getDataSourceState:t,dataSourceActions:n,actions:r,dataSourceApi:i,api:a}=J(),s=o().debugId,c=(0,fo.useRef)(s);return c.current=s,(0,fo.useEffect)(()=>{let u=c.current;if(!u)return;let d=p=>{p(u,{getState:o,getDataSourceState:t,getComputed:e,dataSourceActions:n,actions:r,api:a,dataSourceApi:i})},f=Ya.get();if(f){d(f);return}return Ya.onChange(p=>{p&&d(p)})},[]),(0,fo.useEffect)(()=>{let u=c.current;if(!u)return;let d=Ya.get();d&&d(u,{getState:o,getDataSourceState:t,getComputed:e,dataSourceActions:n,actions:r,api:a,dataSourceApi:i})}),(0,fo.useEffect)(()=>{if(s)return()=>{let u=globalThis.__INFINITE_TABLE_DEVTOOLS_HOOK__;u&&u(s,null)}},[s]),s}function lh(){let o=He(),e=o?o.getMasterState():null,t=J().getState();return(e||t).portalDOMRef.current}var vt=V(require("react")),gh=require("react");var sh="hs68h8j _16lm1iwk _16lm1iwx _16lm1iw2n",ch=pe({defaultClassName:"hs68h8e _16lm1iw12 _16lm1iw1x _16lm1iw2j _16lm1iw1p",variantClassNames:{active:{true:"hs68h8f _16lm1iwn _16lm1iw1h",false:"_16lm1iwo"},draggingInProgress:{true:"hs68h8h",false:"hs68h8i"}},defaultVariants:{},compoundVariants:[]}),uh="hs68h81",dh=pe({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 po=V(require("react"));function fh(o){return po.createElement("div",{...o.domProps})}function ph(o){let{active:e}=o;return po.createElement("div",{className:uh},e?"Drop to group":"Drag columns to group")}function mh(o){let e=t=>{(t.key==="Enter"||t.key===" ")&&(t.preventDefault(),o.onClear?.())};return po.createElement("div",{...o.domProps},o.label,po.createElement("div",{className:hi[1]}),po.createElement("div",{tabIndex:0,role:"button","aria-label":`Clear grouping by ${o.field}`,className:sh,onKeyDown:e,onMouseDown:o.onClear},po.createElement(Ha,{size:20})))}var WC=(o,e)=>t=>{e&&e(t);let n=Date.now(),r=!1,i=()=>{r=!0};xe().addEventListener("mousemove",i,{once:!0}),xe().addEventListener("mouseup",()=>{r||(xe().removeEventListener("mousemove",i),Date.now()-n<200&&requestAnimationFrame(()=>{o()}))},{once:!0})};function jC(o){let{column:e,onClear:t,components:n,field:r,id:i,toggleSorting:a}=o,{dragSourceListId:l,dragItemId:s}=Fr(),c=l===or,u=J(),d=(e?Wn(e.id,u,"grouping-toolbar"):r)??i,f=e?vt.createElement(Hi,{forceSize:!0,size:20,direction:e.computedSortedAsc?1:e.computedSortedDesc?-1:0}):null,p=vt.createElement(vt.Fragment,null,d,f),m=s===i&&l===or,g=Z(ch({draggingInProgress:c,active:m}),o.domProps?.className),b=WC(a,o.domProps?.onMouseDown),h={...o.domProps,className:g,onMouseDown:b},y=n?.ToolbarItem??mh;return vt.createElement(y,{active:m,domProps:h,column:e,field:r,label:p,onClear:t})}var or="grouping-toolbar";function hh(o){let{groupBy:e}=on(),{getComputed:t,dataSourceApi:n,api:r}=J(),{dropTargetListId:i,dragSourceListId:a}=Yn(),{fieldsToColumn:l,computedColumnsMap:s}=t(),c=i===or,u=a===or,d=o.components?.Placeholder??ph,f=o.components?.Host??fh,p=e.length?vt.createElement(vt.Fragment,null,e.map((S,C)=>{let T=S.field?l.get(S.field):void 0,I=`${S.field??`idx-${C}`}`;return vt.createElement(to.DraggableItem,{key:I,id:I},w=>vt.createElement(jC,{id:I,components:o.components,domProps:w,field:S.field,column:T,toggleSorting:()=>{T&&r.toggleSortingForColumn(T.id)},onClear:()=>{let v=e.filter(R=>R!==S).filter(Boolean);n.setGroupBy(v)}}))})):vt.createElement(d,{draggingInProgress:u,active:c,groupBy:e}),m=S=>{let C=S.map(T=>e[T]);n.setGroupBy(C)},g=S=>{let{dragItemId:C}=S,T=C,I=s.get(T);if(!I||!I.field||!I.computedGroupable)return;let w=[...e];w.splice(S.dropIndex,0,{field:I.field}),n.setGroupBy(w)},b=(0,gh.useCallback)(S=>{let{computedColumnsMap:C}=t(),T=S.dragItem.id,I=C.get(T);return!(!I||!I.computedGroupable||e.some(w=>w.field===I.field))},[e]),h=o.orientation??"horizontal",{domProps:y}=o;return vt.createElement(to,{orientation:h,dragListId:or,acceptDropsFrom:["header",or],onDrop:m,onAcceptDrop:g,shouldAcceptDrop:b},(S,{draggingInProgress:C,status:T})=>{let I=Z(dh({active:c,orientation:h,draggingInProgress:C,dropRejected:T==="rejected"}),S.className,y?.className),w={...S,...y,className:I,children:p};return vt.createElement(f,{active:c,rejectDrop:T==="rejected",domProps:w,orientation:h})})}var ir=V(require("react"));var Sc=require("react"),$t=require("react"),qa=V(require("react"));function bh(o){let{dataArray:e,brain:t,computedPinnedEndColumns:n,computedPinnedStartColumns:r,computedVisibleColumns:i,computedRowHeight:a,columnSize:l,rowspan:s}=o;return la(t,{colWidth:l,rowHeight:a,rows:e.length,cols:i.length,rowspan:s},{fixedColsEnd:n.length,fixedColsStart:r.length}),t}var ni=V(require("react"));var yh=pe({defaultClassName:"evqes20",variantClassNames:{},defaultVariants:{},compoundVariants:[]});var ti=require("react");function $C(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 UC(o,e){let{detailState:t,masterState:n,masterActions:r,cacheEntryForRow:i}=e,a=new Map(n.detailDataSourcesStateToRestore),l=cm(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 YC(o,e){let t=(0,ti.useRef)(!1);return{currentRowCache:(0,ti.useMemo)(()=>({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)}),[e,o]),cacheCalledByRowDetailRenderer:t}}function Th(o){let{rowDetailsCache:e,rowInfo:t}=o,{getState:n,componentActions:r}=Oe(),{getState:i}=J(),{currentRowCache:a,cacheCalledByRowDetailRenderer:l}=YC(t.id,e),s=(0,ti.useMemo)(()=>{let c=n().detailDataSourcesStateToRestore.has(t.id)&&a.has();return{registerDetail:st(d=>{if(l.current||a.add({all:!0}),!a.has()){requestAnimationFrame(()=>{d.componentState.destroyedRef.current||(d.componentActions.stateReadyAsDetails=!0)});return}$C(t.id,{masterState:n(),detailContext:d}),requestAnimationFrame(()=>{d.componentState.destroyedRef.current||(d.componentActions.stateReadyAsDetails=!0)}),d.componentState.onCleanup.onChange(()=>{let f=a.get();f&&UC(t.id,{detailState:d.getState(),masterActions:r,masterState:n(),cacheEntryForRow:f})})}),shouldRestoreState:c}},[t.id,a]);return s.masterRowInfo=t,s.getMasterDataSourceState=n,s.getMasterState=i,{masterDetailContextValue:s,currentRowCache:a}}var{rootClassName:qC}=Le,XC=`${qC}RowDetail`;function ZC(o){let e=ui(),{domRef:t,rowDetailRenderer:n,rowDetailHeight:r,rowInfo:i,detailOffset:a,rowDetailsCache:l}=o,{masterDetailContextValue:s,currentRowCache:c}=Th({rowDetailsCache:l,rowInfo:i});return ni.createElement(e.Provider,{value:s},ni.createElement("div",{ref:t,className:Z(XC,yh({})),style:{position:"absolute",top:`${a}px`,left:0,width:`calc(${Y.bodyWidth} - ${Y.scrollbarWidthVertical})`,height:r}},n(i,c)))}var Sh=ni.memo(ZC);var QC=1;function Ch(o){let{computed:e,bodySize:t,imperativeApi:n}=o,{actions:r,state:i,getState:a,getComputed:l,getDataSourceMasterContext:s}=J(),{computedPinnedStartColumns:c,computedPinnedEndColumns:u,computedVisibleColumns:d,computedColumnsMap:f,computedRowHeight:p,computedRowSizeCacheForDetails:m,fieldsToColumn:g,rowspan:b,toggleGroupRow:h,columnSize:y}=e,{componentState:S,getState:C,componentActions:T,api:I}=Oe(),{dataArray:w,rowInfoStore:v,selectionMode:R,cellSelection:x,isNodeReadOnly:M}=S,A=Ae(w),{rowHeight:E,rowDetailHeight:P,onRowMouseEnter:_,onRowMouseLeave:D,groupRenderStrategy:O,brain:F,showZebraRows:j,rowDetailRenderer:z,isRowDetailExpanded:L,isRowDetailEnabled:le,cellClassName:ne,cellStyle:W,rowStyle:$,rowDetailCache:re,rowClassName:ge,onScrollToTop:me,onScrollToBottom:ue,onScrollStop:de,scrollToBottomOffset:he,wrapRowsHorizontally:K,updatedAt:H,ready:X,editingCell:B}=i,ie=S.updatedAt;bh({columnSize:y,brain:F,computedPinnedStartColumns:c,computedPinnedEndColumns:u,computedVisibleColumns:d,computedRowHeight:p,dataArray:w,bodySize:t,rowspan:b});let ee=(0,$t.useRef)(0);(0,$t.useEffect)(()=>F.onRenderCountChange(()=>{ee.current=F.scrollTopMax}),[F]),(0,$t.useEffect)(()=>F.onRenderRangeChange(te=>{a().onRenderRangeChange?.(te)}),[F]),(0,$t.useEffect)(()=>F.onScrollStop(te=>{let{scrollTop:se,scrollLeft:Me}=te;if(se===0&&me?.(),se+(he??QC)>=ee.current){ue?.();let{livePagination:be,livePaginationCursor:je,dataArray:$e}=C();be&&(T.cursorId=je!==void 0?Date.now():$e.length)}if(de){let be=F.getRenderRange();de({scrollTop:se,scrollLeft:Me,renderRange:be,viewportSize:a().bodySize,firstVisibleRowIndex:be.start[0],lastVisibleRowIndex:be.end[0],firstVisibleColIndex:be.start[1],lastVisibleColIndex:be.end[1]})}}),[F,me,ue,de]),(0,$t.useEffect)(()=>{t.height&&(r.ready=!0)},[!!t.height]),(0,$t.useEffect)(()=>{let{onReady:te}=a();te&&te({api:n,dataSourceApi:I})},[X]);let[,fe]=Mt();(0,$t.useEffect)(()=>{fe()},[S]);let Ie=(0,Sc.useMemo)(()=>({isNodeReadOnly:M,selectionMode:R,cellSelection:x}),[M,R,x]),N=(0,$t.useCallback)(te=>{let{rowIndex:se,colIndex:Me,heightWithRowspan:Ne,domRef:Fe,hidden:be,width:je,onMouseLeave:$e,onMouseEnter:bt}=te,tt=A()[se],G=d[Me];if(!tt||!G)return null;let oe=m?m.getRowHeight(se):Ne,ae=!1;!le||typeof le=="function"&&!le(tt)?ae=!1:L&&(ae=L(tt)?"expanded":"collapsed");let ye=K?F.getRowIndexInPage(se):null,Ue=K?F.getPageIndexForRow(se):null,k=n.isEditorVisibleForCell({rowIndex:se,columnId:G.id});return qa.createElement(of,{...{getData:A,virtualized:!0,showZebraRows:j,groupRenderStrategy:O,rowIndexInHorizontalLayoutPage:ye,horizontalLayoutPageIndex:Ue,rowIndex:se,rowInfoStore:v,hidden:be,toggleGroupRow:h,rowHeight:oe,rowDetailState:ae,onMouseEnter:bt,onMouseLeave:$e,onRowMouseEnter:_,onRowMouseLeave:D,domRef:Fe,width:je,column:G,columnsMap:f,fieldsToColumn:g,rowStyle:$,rowClassName:ge,cellStyle:W,cellClassName:ne,inEditMode:k,getDataSourceState:C,dataSourceApi:I,dataSourceActions:T,getState:a,imperativeApi:n,componentActions:r,getComputed:l,getDataSourceMasterContext:s,dataSourceStatePartialForCell:Ie}})},[E,P,_,D,m,p,L,A,d,f,g,O,K,h,j,F,ie,v,$,ge,ne,W,C,I,T,a,n,r,l,s,H,B,Ie]),U=(0,Sc.useMemo)(()=>{if(L)return te=>{let{rowIndex:se,domRef:Me}=te,Fe=A()[se];if(!Fe||!L(Fe)||!m)return qa.createElement("div",{ref:Me,className:Jc.hidden});let{rowDetailHeight:be,rowHeight:je}=m.getSize(se);return qa.createElement(Sh,{rowInfo:Fe,rowDetailsCache:re,rowIndex:se,domRef:Me,detailOffset:je,rowDetailHeight:be,rowDetailRenderer:z})}},[X,N,z,P,L,re]);return{renderCell:N,renderDetailRow:U}}var wh=require("react");function Ih(){let{state:o,getState:e,actions:t}=J(),{wrapRowsHorizontally:n}=o,r=Cn(n);(0,wh.useEffect)(()=>{if(r!==n){let{brain:i,headerBrain:a,renderer:l,onRenderUpdater:s}=e();i.destroy(),a.destroy(),l.destroy(),s.destroy();let c=Xs(Ua,!!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 xh=V(require("react"));var vh="_16lm1iw1 _16lm1iw1c _16lm1iwe";var Rh=Z(vh,es);function Ph(o){return xh.createElement("div",{...o,className:o.className?Z(Rh,o.className):Rh})}var rr=V(require("react"));var Dh={visible:"qy58ya1 qy58ya0 _16lm1iw2 _16lm1iw23 _16lm1iw26 _16lm1iw2c _16lm1iw2a",hidden:"qy58ya2 qy58ya0 _16lm1iw2 _16lm1iw23 _16lm1iw26 _16lm1iw2c _16lm1iw2a"},Mh="qy58ya3 _16lm1iw2 _16lm1iw23 _16lm1iw26 _16lm1iw2c _16lm1iw2a",Eh="qy58ya4";var{rootClassName:JC}=Le,Cc=`${JC}-LoadMask`;function ew(o){let{visible:e,children:t="Loading"}=o;return rr.createElement("div",{className:`${Dh[e?"visible":"hidden"]} ${Cc}`},rr.createElement("div",{className:`${Mh} ${Cc}-Overlay`}),rr.createElement("div",{className:`${Eh} ${Cc}-Text`},t))}var Xa=rr.memo(ew);var Ah=require("react"),tw=[Gd,`${Xt}--hovered`];function nw(o){return Array.isArray(o)&&(o=o.join(" ")),o.split(" ").map(e=>e.trim()).filter(Boolean)}function mo(o){let e=J(),t=He(),{state:n,getComputed:r,api:i}=e,{renderer:a,onRenderUpdater:l,debugId:s,keyboardNavigation:c,activeRowIndex:u,loadingText:d,scrollStopDelay:f,brain:p,scrollerDOMRef:m,components:g,bodySize:b,activeCellIndex:h,rowDetailRenderer:y,showHoverRows:S,wrapRowsHorizontally:C,domProps:T,domRef:I,rowHoverClassName:w}=n,v=g?.LoadMask??Xa,R=r(),{computedRowHeight:x,computedRowSizeCacheForDetails:M}=R,A=M?.getRowHeight||x,{componentState:{loading:E}}=Oe(),P=ir.useCallback(z=>{let L=e.getState(),le=z.target;if(!t&&z._from_row_detail)return;t&&(z._from_row_detail=!0);let ne=qu(le,qs(),L.domRef.current),W,$,re,ge;ne&&($=Number(ne.dataset.colIndex),ge=Number(ne.dataset.rowIndex),W=e.getComputed().computedVisibleColumns[$].id,re=e.dataSourceApi.getRowInfoArray()[ge].id);let me={columnId:W,colIndex:$,rowId:re,rowIndex:ge,event:z,target:ne??z.target};ne&&L.cellContextMenu(me),L.contextMenu(me)},[]),{renderCell:_,renderDetailRow:D}=Ch({imperativeApi:i,getComputed:r,domRef:I,bodySize:b,computed:R}),{autoFocus:O,tabIndex:F}=T??{};Ih();let j=(0,Ah.useMemo)(()=>{if(!S)return;let z=[];return w&&(z=z.concat(w)),o.rowHoverClassName&&(z=z.concat(o.rowHoverClassName)),mo.rowHoverClassName&&(z=z.concat(mo.rowHoverClassName)),nw(z)},[S,w,o.rowHoverClassName,mo.rowHoverClassName]);return ir.createElement(Ph,{onContextMenu:P},ir.createElement(qf,{forceRerenderTimestamp:n.forceBodyRerenderTimestamp,debugId:s,tabIndex:F??0,autoFocus:O??void 0,activeRowIndex:n.ready&&c==="row"?u:null,activeCellIndex:n.ready&&c==="cell"&&!n.columnReorderDragColumnId?h:null,scrollStopDelay:f,renderer:a,wrapRowsHorizontally:C,onRenderUpdater:l,brain:p,activeCellRowHeight:A,renderCell:_,renderDetailRow:y?D:void 0,cellHoverClassNames:j,scrollerDOMRef:m,scrollVarHostRef:I}),ir.createElement(v,{visible:E},d))}mo.rowHoverClassName=tw;var qt=Le.rootClassName,{ManagedComponentContextProvider:ow}=Et({initSetupState:Mm,forwardProps:Em,mapPropsToState:Nm,cleanup:Am,allowedControlledPropOverrides:{rowHeight:!0,columnHeaderHeight:!0},mappedCallbacks:Om(),getParentState:()=>on(),debugName:o=>An(o.debugId,Ua)}),_h=De.memo(function(){let e=J(),t=He(),{state:n,api:r,children:i}=e,{componentState:{dataArray:a},getState:l,componentActions:s}=Oe(),{domRef:c,portalDOMRef:u,onRowHeightCSSVarChange:d,onFlashingDurationCSSVarChange:f,onRowDetailHeightCSSVarChange:p,onColumnHeaderHeightCSSVarChange:m,rowHeightCSSVar:g,rowDetailHeightCSSVar:b,columnHeaderHeightCSSVar:h,scrollStopDelay:y,brain:S,activeRowIndex:C,activeCellIndex:T}=n,{licenseKey:I}=n;!I&&tn.licenseKey&&(I=tn.licenseKey),Zm(C,a.length,r),Xm(T,a.length,r);let{onKeyDown:w}=gg();De.useEffect(()=>{let j=l(),z=Pt(L=>{j.notifyRenderRangeChange({renderStartIndex:L[0],renderEndIndex:L[1]})},{wait:y});return S.onVerticalRenderRangeChange(z)},[S,y]);let v=qm(I),{autoFocus:R,tabIndex:x,...M}=n.domProps??{},A=md(M);De.useEffect(()=>{S.setScrollStopDelay(y),s.scrollStopDelayUpdatedByTable=y},[y]),Tm(),nh(),Kg();let{menuPortal:E}=zg(),{menuPortal:P}=qg(),{menuPortal:_}=Xg(),{menuPortal:D}=jg();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(n.id,n.ready,e.api,e)},[n.ready,e.api]);let O=ah();De.useEffect(()=>{t&&(u.current=t.getMasterState().portalDOMRef.current)},[]);let F=i??De.createElement(De.Fragment,null,De.createElement(Rs,null),De.createElement(mo,null));return De.createElement("div",{"data-debug-id":O,onKeyDown:w,ref:c,...A},F,De.createElement("div",{ref:u,className:Z(`${ct}Portal`,eu[1e7],bi.absolute,Zc[0],Yc[0])},E,P,_,D),g?De.createElement(hr,{key:"row-height",varName:g,onChange:d}):null,De.createElement(hr,{key:"flashing-duration",allowInts:!0,varName:ce.components.Cell.flashingDuration,onChange:f}),b?De.createElement(hr,{key:"row-detail-height",varName:b,onChange:p}):null,h?De.createElement(hr,{key:"column-header-height",varName:h,onChange:m}):null,v?null:De.createElement(hp,null),De.createElement(Hg,null))});function rw({children:o}){let{componentActions:e,componentState:t}=qe(),{scrollerDOMRef:n,scrollTopKey:r}=t,i=Wm(),a=Ae(i),l=Ae(t),s=He(),{getState:c,componentActions:u,getDataSourceMasterContext:d,api:f}=Oe(),[p]=De.useState(()=>ym({getComputed:a,getState:l,getDataSourceState:c,getDataSourceMasterContext:d,dataSourceApi:f,actions:e,dataSourceActions:u})),m={actions:e,state:t,computed:i,dataSourceActions:u,getDataSourceMasterContext:d,getDataSourceState:c,getComputed:a,getState:l,api:p,dataSourceApi:f,children:o};ci(n,b=>{let h={width:b.width,height:b.height};e.bodySize=h},{earlyAttach:!0,debounce:50}),De.useEffect(()=>{n.current&&(n.current.scrollTop=0)},[r,n]);let g=So();return De.createElement(g.Provider,{value:m},De.createElement(_h,null))}var iw=40,aw=Qm(Zu),tn=function(o){return De.createElement(ow,{repeatWrappedGroupRows:!!o.wrapRowsHorizontally,rowHeight:iw,columnHeaderHeight:aw,...o},De.createElement(Jl,null,De.createElement(rw,{children:o.children})))};tn.Header=Rs;tn.Body=mo;tn.HScrollSyncContent=Jg;tn.Footer=()=>De.createElement(nu,null);tn.GroupingToolbar=hh;var Oh=V(require("react"));function lw(o){let{DataSource:e}=$o({nodesKey:"children",...o});return Oh.createElement(e,null,o.children??null)}var Nh=V(require("react"));function Fh(o){return Nh.createElement(tn,{...o})}var Lh=o=>(t,{unfilteredTreePaths:n,treeSelectionState:r,prevTreeSelectionState:i,lastUpdatedNodeInfo:a})=>{let l=new Qe(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)};var Za=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=We(`IT:${e}:DataQuery`)}};function go(o){if(Array.isArray(o))return o.map(go);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]=go(i))}),JSON.stringify(n)}return o instanceof Date?o.toISOString():o}var mn=class mn{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=go(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 Za(`${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=go(e);return this.queryCache.get(t)?.getCurrentSnapshot().done??!1};this.hasQueryForKey=e=>{let t=go(e);return this.queryCache.has(t)};this.discardQueryForKey=e=>{let t=go(e);this.queryCache.delete(t)};if(this.options=e,mn.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)}mn.clients.set(e.name,this),this.name=e.name}static destroy(e){let t=mn.clients.get(e);t&&t.destroy()}static destroyAll(){mn.clients.forEach(e=>{mn.destroy(e.name)})}destroy(){mn.clients.delete(this.options.name)}};mn.clients=new Map;var wc=mn;var sw={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})})}}}},kh={instantEdit:sw};var cw=require("react");function zh(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 Ja=class Ja{constructor(e,t){this.orderRefs=[];if(typeof e=="number")this.maxSize=e,this.currentSet=new Set;else if(this.maxSize=t??Ja.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}};Ja.DEFAULT_SIZE=10;var Qa=Ja;var tl=class tl{constructor(e,t){this.orderRefs=[];if(typeof e=="number")this.maxSize=e,this.currentSet=new Set;else if(this.maxSize=t??tl.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}};tl.DEFAULT_SIZE=10;var el=tl;var ho=require("react"),uw=(o,e)=>o.every((t,n)=>t===e[n]),Vh=(o,e)=>{let t=(0,ho.useRef)(e),n=uw(e,t.current),r=(0,ho.useRef)(!0);t.current=e;let i=(0,ho.useRef)(["same"]),a=n?[Date.now()]:i.current;i.current=a;let l=(0,ho.useRef)(o);l.current=o,(0,ho.useEffect)(()=>{if(r.current){r.current=!1;return}return l.current()},a)};var Gn=require("react"),Gh=(o,e,t)=>o.every((n,r)=>t?t(n,e[r]):n===e[r]),nl=(o,e)=>{let{same:t,different:n,compare:r}=e,i=(0,Gn.useRef)(t),a=(0,Gn.useRef)(n),l=Gh(t,i.current,r),s=!Gh(n,a.current,r),c=(0,Gn.useRef)(!0);i.current=t,a.current=n;let u=(0,Gn.useRef)(["same"]),d=l&&s?[Date.now()]:u.current;u.current=d;let f=(0,Gn.useRef)(o);f.current=o,l&&s&&(c.current=!1),(0,Gn.useEffect)(()=>{if(!c.current)return f.current()},d)};var Rt=V(require("react"));var Hh=q(Y.currentFlashingDuration),dw=({children:o})=>Rt.createElement(Rt.Fragment,null,o),Kh=1e3,Bh={up:Ni({direction:"up"}).split(" "),down:Ni({direction:"down"}).split(" "),neutral:Ni({direction:"neutral"}).split(" ")},Ic=(o={})=>{let{flashDuration:e,flashClassName:t,render:n=dw}=o;return Rt.forwardRef((i,a)=>{let l=Mr(),{state:{flashingDurationCSSVarValue:s}}=J(),c=typeof s=="number"?s??e??Kh:e??Kh,{domRef:u,value:d,column:f,rowInfo:p,htmlElementRef:m}=l,g=p.id,b=f.id,h=Rt.useRef(!0),y=Rt.useRef(d),S=h.current?null:y.current;h.current=!1;let C=Rt.useRef(void 0),T=Rt.useRef(void 0),I=Rt.useRef(void 0);return nl(()=>{if(d===y.current)return;let w=()=>{let M=m.current;if(C.current&&(clearTimeout(C.current),C.current=void 0),I.current&&(clearTimeout(I.current),I.current=void 0),T.current&&M){let A=T.current,E=Bh[A];M.classList.remove(...t?[t,...E]:E),M.style.removeProperty(Hh),T.current=void 0}};y.current=d;let v=m.current;if(!v)return;w();let R=typeof d=="number"?d>S?"up":"down":"neutral",x=Bh[R];return v.style.setProperty(Hh,`${c}`),v.classList.add(...t?[t,...x]:x),T.current=R,C.current=setTimeout(w,c),w},{same:[b,g],different:[d]}),Rt.createElement("div",{ref:u,...i,className:Z(i.className)},n({children:i.children,oldValue:S}))})},Wh=Ic();var Xe=V(require("react")),ar=require("react");var jh=require("react-dom");function $h(o){let[e,t]=Xe.useState(null);return(0,ar.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"?Xe.createElement(Uh.Provider,{value:{getState:e}},Xe.createElement(fw,null)):null}var Uh=Xe.createContext({getState:()=>null});function fw(){let o=Xe.useContext(Uh),{getState:e}=o,[,t]=Mt(),n=e().renderer.cellManager;(0,ar.useEffect)(()=>{let s=Pt(()=>{console.log("rerender"),t()},{wait:500});return n.onCellAttachmentChange(s)},[n,t]);let r=n.getRowsWithCells(),i=n.getColumnsWithCells(),a=(0,ar.useRef)(null),l=(0,ar.useRef)(null);return Xe.createElement("div",{style:{overflow:"auto"}},(0,jh.createPortal)(Xe.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),Xe.createElement("table",{style:{borderCollapse:"collapse"}},Xe.createElement("thead",null,Xe.createElement("tr",null,i.map(s=>Xe.createElement("th",{key:s,"data-col-index":s},s)))),Xe.createElement("tbody",null,r.map(s=>Xe.createElement("tr",{key:s,"data-row-index":s},i.map(c=>Xe.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},Xe.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 pw={CheckBox:rn,LoadMask:Xa,MenuIcon:Ar,StringFilterEditor:Ro,NumberFilterEditor:Ri};0&&(module.exports={CellSelectionState,DataClient,DataSource,DataSourceActionType,DeepMap,FixedSizeSet,FlashingColumnCell,GroupRowsState,INTERNAL_MatrixDebugger,InfiniteTable,InfiniteTableClassName,InfiniteTableComponent,Menu,RowDetailCache,RowDetailState,RowDisabledState,RowSelectionState,TreeDataSource,TreeExpandState,TreeGrid,TreeSelectionState,WeakFixedSizeSet,alignNode,components,createFlashingColumnCellComponent,debounce,debug,defaultFilterTypes,eventMatchesKeyboardShortcut,filterDataArray,filterTypes,flatten,getComponentStateRoot,group,interceptMap,keyboardShortcuts,multisort,multisortNested,queryKeyToCacheKey,toTreeDataArray,useComponentState,useDataSourceInternal,useDataSourceState,useEffectWhen,useEffectWhenSameDeps,useEffectWithChanges,useEffectWithObject,useGridScroll,useInfiniteColumnCell,useInfiniteColumnEditor,useInfiniteColumnFilterEditor,useInfiniteHeaderCell,useInfinitePortalContainer,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),!1):!0},aC=n=>{let e="",t=n.split("|").map(l=>{let[s,c]=l.split("=");return s==="C"&&(e=c),{name:s,value:c}});if(!e)throw"Invalid license";let o=e.split(",").reverse(),r=o.pop();o.forEach((l,s)=>{let c=t[s];if(dc(c.value)!==l)throw"Invalid license"});let i=[...t];i.pop();let a=i.map(l=>`${l.name}=${l.value}`).join("|");if(dc(a)!==r)throw"Invalid license";return t=t.map(l=>({...l,value:decodeURI(l.value)})),iC(t)};var lC=/(https):\/\/\d+\-\d+\-\d+\-(sandpack\.codesandbox\.io)/g,sC=/(https):\/\/\S+(\.csb\.app)/g,sg=typeof window<"u"?window.location.origin:"",cC=()=>{let[n,e,t]=Array.from(lC.exec(sg)||[]);return e==="https"&&t==="sandpack.codesandbox.io"},uC=()=>{let[n,e,t]=Array.from(sC.exec(sg)||[]);return e==="https"&&t===".csb.app"},dC=uC()||cC(),cg=(n="")=>{let t=!!Ro();return(0,lg.useMemo)(()=>{if(t)return!0;let r=ag(n,{publishedAt:1624970570587,version:"8.0.0-canary.0"});return!n&&!r&&dC?!0:r},[n,t])};var rr=require("react");var fC=10;function ug(n,e,t){let o=(0,rr.useRef)(!1),r=(0,rr.useRef)(null);(0,rr.useEffect)(()=>{n!=null&&(o.current=!1,Vt(r.current))},[n]),(0,rr.useEffect)(()=>{if(n!=null&&!o.current){let a=function(l=0){l++,Vt(r.current),r.current=Ve(()=>{o.current=t.scrollCellIntoView(n[0],n[1],{offset:30}),!o.current&&l<fC&&a(l)})};var i=a;a()}return()=>{Vt(r.current)}},[n,e])}var ir=require("react"),pC=10;function dg(n,e,t){let o=(0,ir.useRef)(!1),r=(0,ir.useRef)(null);(0,ir.useEffect)(()=>{n!=null&&(o.current=!1,cancelAnimationFrame(r.current))},[n]),(0,ir.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<pC&&a(l)})};var i=a;a()}return()=>{cancelAnimationFrame(r.current)}},[n,e])}function fg(){return Io()}var pg=n=>`--infinite-${n}`;var ar=require("react");function mg(n,e){fc(n,e),gC(n,e),e.detail===2&&mC(n,e),n.getState().onCellClick?.(n,e)}function mC(n,e){if(Li(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 gC(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:f}=r(),{brain:p,debugId:m}=o(),{rowsPerPage:g}=p,b=f.length,h=new $e(u);h.debugId=m??"",d.cellSelectionState=h;let y={rowIndex:i,colIndex:a};if(e.metaKey||e.ctrlKey)d.singleAddClick(y);else if(e.shiftKey){let S=!!o().wrapRowsHorizontally;d.multiSelectClick(y,S?{horizontalLayout:S,rowsPerPage:g,columnsPerSet:b}:{horizontalLayout:S})}else d.resetClick(y);l.cellSelection=h}function fc(n,e){let{rowIndex:t,getDataSourceState:o,getComputed:r,dataSourceActions:i,api:a,cloneRowSelection:l}=n,{multiRowSelector:s,renderSelectionCheckBox:c}=r(),u=o(),{selectionMode:d,groupBy:f,dataArray:p,isTree:m}=u;if(f.length||m||p[t]?.rowDisabled)return!1;if(d==="multi-row"){if(c&&!e.key)return!1;let{rowSelection:b}=u;if(b=l(b),s.rowSelectionState=b,b&&typeof b=="object")return e.shiftKey?s.multiSelectClick(t):e.metaKey||e.ctrlKey?s.singleAddClick(t):s.resetClick(t),i.rowSelection=b,!0}else if(d==="single-row"){let h=p[t].id;e.metaKey||e.ctrlKey?a.rowSelectionApi.toggleRowSelection(h):a.rowSelectionApi.selectRow(h)}return!1}function gg(n,e){e.detail!==2&&void 0}var hC={Enter:!0," ":!0,a:!0};function hg(n,e){let{getState:t,getDataSourceState:o,dataSourceActions:r,api:i,dataSourceApi:a,cloneRowSelection:l,cloneTreeSelection:s}=n,{key:c,ctrlKey:u,metaKey:d}=e;if(!hC[c])return!1;let f=t(),p=o(),{activeRowIndex:m,activeCellIndex:g,keyboardNavigation:b,keyboardSelection:h}=f,{selectionMode:y,groupBy:S,rowSelection:T,treeSelectionState:C,isTree:w}=p;if(h===!1)return!1;let I=b==="row"&&m!=null?m:b==="cell"&&g!=null?g[0]:null,v=I!=null?p.dataArray[I]:null;if(!v||I==null)return!1;if(y==="single-row"&&c===" ")return i.rowSelectionApi.toggleRowSelection(v.id),!0;if(y!=="multi-row")return!1;if(c==="a"&&(u||d)){if(w&&C){let R=s(C);return R.selectAll(),r.treeSelection=R,!0}let D=l(T);return D.selectAll(),r.rowSelection=D,!0}if(c===" "){if(S.length)return v.isGroupRow&&v.groupKeys?i.rowSelectionApi.toggleGroupRowSelection(v.groupKeys):i.rowSelectionApi.toggleRowSelection(v.id),!0;if(w){if(v.isTreeNode&&v.nodePath)return a.treeApi.toggleNodeSelection(v.nodePath),!0}else{let D={...e},{renderSelectionCheckBox:R}=n.getComputed();return R&&(D.metaKey=!1,D.ctrlKey=!0),fc({...n,rowIndex:I},D)}}return!1}var bg=["input","textarea","select","[tabindex]","a[href]","button","object"].join(", "),yg=n=>Array.from(n.querySelectorAll(bg)).filter(t=>!!t.offsetParent),Ka=n=>n.querySelector(bg);var Tg=K(Jo());async function Sg(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 bC=10,yC=(n,e)=>n-e;function Ba(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(),f=u[n.colIndex];if(!f)return!1;if(l&&l.columnId===f.id&&l.rowIndex===n.rowIndex)return!0;if(!f.contentFocusable)return!1;if(f.contentFocusable===!0)return!0;let p=c[n.rowIndex],m=!s||typeof s=="function"&&!s(p)?!1:i.rowDetailApi.isRowDetailExpanded(p.id)?"expanded":"collapsed",g=gt(f.id,e);return f.contentFocusable({column:f,...Hn({column:f,rowInfo:p,columnsMap:d,context:e,rowDetailState:m}).formattedValueContext,columnApi:g,api:i,dataSourceApi:a})}function pc(n,e,t){let o=t.getState().editingCell;return SC(n,e,t,{isCellFocusable:Ba,isColumnElligible:i=>o&&o.columnId===i.id?!0:!!i.contentFocusable})}function Cg(n,e,t){let o=(0,Tg.default)(t,n+e,yC);return o<0&&(o=~o,e>0&&o>=t.length||e<0&&o===0)?null:t[o]??null}globalThis.getNextCol=Cg;function SC(n,e,t,o){let{isColumnElligible:r,isCellFocusable:i}=o,a=t.getComputed().computedVisibleColumns.filter(r).reduce((d,f)=>(d.push(f.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]:Cg(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 wg(n){let e={rowIndex:n.getDataSourceState().dataArray.length-1,colIndex:n.getComputed().computedVisibleColumns.length-1},t=Ba(e,n)?e:pc(e,-1,n);if(t){await mc([t.rowIndex,t.colIndex],n);let o=n.getState().getDOMNodeForCell(t);if(!o)return;Ka(o)?.focus()}}async function mc([n,e],t){let{api:o}=t;return new Promise((r,i)=>{let a=bC,l=null,s=!1;function c(u=0){u++,Vt(l),l=Ve(async()=>{if(s=o.scrollCellIntoView(n,e,{offset:30}),!s&&u<a&&c(u),s){try{await Sg(()=>!!t.getState().getDOMNodeForCell({rowIndex:n,colIndex:e}))}catch(d){i(d);return}r(!0)}})}c()})}var TC=`.${Zt}`;function Ig(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:Eo(o,TC),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&&Ba({colIndex:s,rowIndex:l},n)?{rowIndex:l,colIndex:s}:pc({rowIndex:l,colIndex:s},t,n);if(!c){if(t===-1)r.focus();else{let u=yg(document.body),d=n.getState().focusDetectDOMRef.current,f=u.findIndex(m=>m===d);u[f+1]?.focus()}return!0}return mc([c.rowIndex,c.colIndex],n).then(()=>{let u=n.getState().getDOMNodeForCell(c);if(!u)return;Ka(u)?.focus()}),!0}var Rg={control:"ctrl"},vg={"control|cmd":"ctrl","cmd|control":"ctrl","ctrl|cmd":"ctrl","cmd|ctrl":"ctrl"},CC={esc:"escape"},Pg={cmd:n=>n.metaKey,alt:n=>n.altKey,ctrl:n=>n.ctrlKey,shift:n=>n.shiftKey},xg=Object.keys(Pg),gc=new Set(xg),wC=new Set(["shift","alt"]);function Wa(n,e){return Array.isArray(e)?e.some(t=>Dg(n,t)):Dg(n,e)}function Dg(n,e){let t=n.key.toLowerCase(),o=e.split("+").map(f=>f.toLowerCase().trim()),r=o.find(f=>vg[f]),i=o.map(f=>Rg[f]||vg[f]||CC[f]||f),a=i.filter(f=>gc.has(f)),l=i.filter(f=>!gc.has(f)),s=xg.reduce((f,p)=>(f[p]=Pg[p](n),f),{});r&&s.cmd&&(s.cmd=!1,s.ctrl=!0);let c=Object.keys(s).filter(f=>s[f]);if(!a.every(f=>s[f]===!0))return!1;if(l.includes("*")){if(c.length<a.length||c.filter(p=>!wC.has(p)).length)return!1}else if(a.length!=c.length)return!1;return!l.length||gc.has(t)||t==="meta"||Rg[t]?!1:l.reduce((f,p)=>f?p==="*"||t===p:!1,!0)}async function Mg(n,e){let t={...n,cloneRowSelection:a=>Ia(a,n.getDataSourceState),cloneTreeSelection:a=>Pa(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&&hg(t,e)&&e.preventDefault(),(Ig(t,e)||!n.getState().focusedWithin&&!r.preventNavigation&&Mm(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(!Wa(e,a.key)||a.when&&!await a.when(n))continue;let l=await a.handler(n,e);if(l&&l.stopNext)break}}function IC(){let{getState:n,actions:e,api:t,getComputed:o,getDataSourceMasterContext:r}=He(),{getDataSourceState:i,dataSourceActions:a,dataSourceApi:l}=Qt();return(0,ar.useMemo)(()=>({getComputed:o,getDataSourceMasterContext:r,dataSourceApi:l,api:t,getState:n,actions:e,getDataSourceState:i,dataSourceActions:a,cloneTreeSelection:u=>Pa(u,i),cloneRowSelection:u=>Ia(u,i)}),[n,e,i,a,t,l,o])}function RC(){let n=IC();(0,ar.useEffect)(()=>{let e=n.getState().keyDown.onChange(a=>{Mg(n,a)});function t(a){if(!a)return;let l=a.event,s=n.getComputed().computedVisibleColumns[a.colIndex],c=gt(s.id,n);mg({...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=gt(u.id,n);gg({...n,rowIndex:s,colIndex:c,column:u,columnApi:d},l)}let i=n.getState().cellMouseDown.onChange(r);return()=>{e(),o(),i()}},[])}function vC(){let{getState:n}=oe(t=>({getState:t.getState}));return{onKeyDown:(0,ar.useCallback)(t=>{n().keyDown(t)},[])}}function Ag(){return RC(),vC()}var Cc=require("react");var Be=K(require("react")),xt=require("react"),Ng=require("react-dom");function hc(n){return!!n.tagName}function Og(n){let{alignTarget:e,alignAnchor:t,constrainTo:o,alignPosition:r}=n,i=ve.from(hc(e)?e.getBoundingClientRect():e),a=ve.from(hc(t)?t.getBoundingClientRect():t),l=o?ve.from(hc(o)?o.getBoundingClientRect():o):null;if(!l)return{...Eg({anchorRect:a,targetRect:i,position:r[0]}),index:0};let s=null;for(let c=0,u=r.length;c<u;c++){let d=Eg({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 Eg(n){let e=ve.from(n.targetRect),t=ve.from(n.anchorRect),o=n.constrainRect?ve.from(n.constrainRect):null,{position:r}=n,[i,a]=r,l=_g(e,i),s=_g(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 _g(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)})}var ja="__is_infinite_menu_component";function DC(n){return n&&typeof n.then=="function"||n instanceof Promise}function Lg(n){return n==null||typeof n=="string"?!1:typeof n.tagName=="string"}async function Fg(n){return typeof n=="function"&&(n=n()),DC(n)&&(n=await n),typeof n=="string"&&(n=document.querySelector(n)),n&&Lg(n)&&(n=n.getBoundingClientRect()),n?ve.from(n):null}async function PC(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)),Lg(o)&&(r=o),r||null}return t(await e)}function xC(n){return Be.createElement("div",{style:{position:"fixed",top:0,left:0}},n.children)}function MC(n){let e=Be.useRef(null);return(0,xt.useEffect)(()=>n.realign.onChange(t=>{e.current&&t&&bc(e.current,t)}),[n.realign]),Be.createElement("div",{style:{position:"absolute",top:0,left:0},ref:(0,xt.useCallback)(t=>{t&&bc(t,n),e.current=t},[])},typeof n.children=="function"?n.children():n.children)}async function bc(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 Fg(t)||void 0,a=o?await Fg(o):void 0,l=ve.from(n.getBoundingClientRect());if(!a)return;let{alignedRect:s}=Og({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(),f=d.left,p=d.top,m=s.left-f,g=s.top-p;n.style.transform=`translate3d(${m}px,${g}px, 0px)`}}}function kg(n,e){let[t,o]=(0,xt.useState)(null);return(0,xt.useLayoutEffect)(()=>{async function r(){let i=e?await PC(e):null;i!=null&&o(i)}e&&r()},[e]),e?t?(0,Ng.createPortal)(n,t):Be.createElement(Be.Fragment,null):e===null||e===!1?n:Be.createElement(xC,null,n)}function AC(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 EC(n,e,t){if(Be.Children.count(n)===1){let o=Be.Children.only(n);if(Be.isValidElement(o)&&o.type[ja]){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 oo(n){let e=n,[t]=(0,xt.useState)(()=>new Map),[o,r]=(0,xt.useState)(null),[i,a]=(0,xt.useState)(0),l=(0,xt.useCallback)(()=>{let m=[];for(let[g,b]of t)m.push(Be.createElement(MC,{...b,key:b.key}));return m},[]),[s,c]=Ut(),u=kg(l(),n.portalContainer),d=(0,xt.useCallback)((m,g)=>{let h=`${g.id||AC(m)||Kt()}`,y=t.get(h),S=w=>()=>{let I=typeof w=="function"?w():w;return EC(I,e.portalContainer,g.constrainTo??e.constrainTo)},T=S(m),C=(w,I)=>{if(!y)return;let v=S(w);Object.assign(y,{children:v}),c(),!!!I?.skipRealign&&(r(y.key),a(Date.now()))};return y?(Object.assign(y,g),C(m),C):(y={key:h,children:T,alignPosition:g.alignPosition,alignTo:g.alignTo,constrainTo:g.constrainTo,realign:Se()},t.set(y.key,y),c(),C)},[t,e.portalContainer,c]);Be.useEffect(()=>{if(o){let m=t.get(o);m&&m.realign(m)}},[o,i]);let f=m=>{m=`${m}`,t.has(m)&&(t.delete(m),c())},p=()=>{t.clear(),c()};return Be.useEffect(()=>{},[]),{portal:u,hideOverlay:f,clearAll:p,rerenderOverlays:c,showOverlay:d}}var Zg=K(require("react"));var cr=K(require("react"));var lr=K(require("react"));var ni=K(require("react"));function $a(n){return null}$a.defaultProps={__is_menu_item:!0};var zg="db3arf0 _16lm1iw0 _16lm1iw1 _16lm1iw1w _16lm1iw2f _16lm1iw8",Vg=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"]]}),Gg="db3arf1",Hg="db3arfd";var _C="-";function OC(){return ni.createElement("hr",{className:Hg})}var Ua=({columns:n,keyboardActiveItemKey:e,activeItemKey:t,menuId:o},r)=>{let i=r&&(r.key!=null||r.label!=null)?r:null,a=i===null?r===_C?ni.createElement(OC,null):r:null;return i!=null?{type:"item",parentMenuId:o,disabled:!!i.disabled,keyboardActive:i.key===e,active:i.key===t,value:i,span:i.span||1,key:i.key,menu:i.menu||null,style:i.style,className:i.className,originalMenuItem:i}:{type:"decoration",value:a,span:n.length,style:{gridColumnStart:1,gridColumnEnd:n.length+10}}};function Kg(n,e){return ni.Children.map(e,t=>{if(t&&(t.props.__is_menu_item||t.type===$a)){let o={...t.props};return o.key||(o.key=t.key),o.description||(o.description=t.props.children),o.label||(o.label=o.children),Ua(n,o)}return Ua(n,t)})||[]}var Bg="submenu";function Wg(){let n=lr.createRef();return{keyboardActiveItemKey:null,activeItemKey:null,generatedId:Kt(),focused:!1,destroyed:!1,domRef:n}}var jg=()=>({parentMenuId:1,parentMenuItemKey:1,onHideIntent:1,constrainTo:1,onAction:1,onShow:1,onHide:1,autoFocus:1,wrapLabels:1}),FC=[{name:"label"}],$g=n=>{let{props:e,state:t}=n,{activeItemKey:o,keyboardActiveItemKey:r}=t,{items:i,children:a,addSubmenuColumnIfNeeded:l,parentMenuId:s}=e,c=e.id||t.generatedId;s&&(c=`${s}-${c}`);let u=[...e.columns||FC],d={columns:u,keyboardActiveItemKey:r,activeItemKey:o,menuId:c},f=[];i?f=i.map(Ua.bind(null,d)):!i&&typeof a!="function"&&(f=Kg(d,a)),l&&f.filter(g=>g.type==="item"&&g.menu!=null).length>0&&!u.find(g=>g.name==Bg)&&u.push({name:Bg,render:({domProps:g,item:b})=>b.menu?lr.createElement("div",{...g},lr.createElement(rn,{expanded:!1})):lr.createElement("div",{...g})});let p=f.filter(m=>m.type==="item"&&!m.disabled);return{runtimeItems:f,runtimeSelectableItems:p,columns:u,menuId:c}};var jt=K(require("react")),ut=require("react");var ri=class extends zn{constructor(e){super(e.slice(0,3))}};var NC=250;function LC(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}Ve(i)};Ve(()=>{i()})})}var kC=Ae(),Ya=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||NC;this.getPointerMoveTarget=()=>document.documentElement||kC;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 ri([this.activeItemLeavePoint,this.activeItemMenuRect.getTopLeft(),this.activeItemMenuRect.getBottomLeft()]):new ri([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,LC(()=>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}};var qa=require("react"),yc=(0,qa.createContext)(null);function Sc(){return(0,qa.useContext)(yc)}var sr=require("react");function Ug(){let n=(0,sr.useRef)(!0);return(0,sr.useEffect)(()=>(n.current=!0,()=>{n.current=!1}),[]),(0,sr.useCallback)(()=>n.current,[])}function zC(n,e){let{parentMenuId:t,setSubmenuApi:o,setActiveItemKey:r,setKeyboardActiveItemKey:i,constrainTo:a,onHideIntent:l,api:s}=e,c=`${t}-submenu`,u=n.menu;return u?(typeof u=="function"&&(u=u()),jt.createElement($t,{key:c,parentMenuItemKey:n.key,parentMenuId:t,constrainTo:a,...u,autoFocus:!1,onShow:(d,f)=>{u?.onShow?.(d,f),o(f)},onHideIntent:d=>{u?.onHideIntent?.(d),l(d)},onHide:d=>{d.focused&&(r(null),i(n.key),s.focus())}})):null}function VC(n,e){let t=Yg(n,e);if(!t.length)return null;let o=ve.from(t[0]?.getBoundingClientRect()),r=ve.from(t[t.length-1].getBoundingClientRect()),i=o;return i.width=r.left+r.width-o.left,i}function Yg(n,e){let t=Eo(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 GC(n,e){let t=Yg(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 HC({onItemActivate:n}){let{getState:e}=Sc(),[{onItemEnter:t,onItemLeave:o}]=(0,ut.useState)(()=>new Ya({parentMenuId:e().parentMenuId,onItemActivate:r=>{if(!r){n(null);return}let i=e().runtimeItems.filter(a=>a.type==="item"&&a.key===r)[0];n(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?ve.from(a.getBoundingClientRect()):void 0}}).getHandlers());return{onItemEnter:(0,ut.useCallback)(t,[]),onItemLeave:(0,ut.useCallback)(o,[])}}function qg(n){let{domProps:e}=n,{componentState:{columns:t,runtimeItems:o,menuId:r,activeItemKey:i,keyboardActiveItemKey:a,constrainTo:l,destroyed:s,onAction:c,wrapLabels:u,onShow:d,onHide:f,autoFocus:p,parentMenuItemKey:m,domRef:g},componentActions:b,getState:h}=Sc(),y=(0,ut.useCallback)($=>{b.keyboardActiveItemKey=$},[]),S=(0,ut.useCallback)($=>{b.activeItemKey=$},[]),T=Ug(),[C,w]=(0,ut.useState)(null),I=null;(0,ut.useLayoutEffect)(()=>{let{runtimeItems:$}=h(),Y=$.filter(ae=>ae.type==="item"&&i===ae.key)[0];if(!Y||!Y.menu){w(null),x();return}if(Y){let ae=VC(r,Y.key);ae&&D(()=>zC(Y,{constrainTo:l,setSubmenuApi:w,setActiveItemKey:S,setKeyboardActiveItemKey:y,parentMenuId:r,onHideIntent:j,api:O}),{id:`${r}-submenu`,alignTo:ae,alignPosition:[["TopLeft","TopRight"],["TopRight","TopLeft"]],constrainTo:l});return}},[i]);let v=($,Y)=>{y(Y.key),S(Y.key),Y.originalMenuItem.onClick&&Y.originalMenuItem.onClick($);let ae={key:Y.key,item:Y.originalMenuItem,hideMenu:j};Y.originalMenuItem.onAction&&Y.originalMenuItem.onAction(ae),c&&c(ae),Y.originalMenuItem.hideMenuOnAction&&j()},{showOverlay:D,portal:R,clearAll:x}=oo({portalContainer:!1}),{onItemEnter:A,onItemLeave:M}=HC({onItemActivate:$=>{if(!T())return;let Y=$?$.key:null;S(Y)}});I=o.map(($,Y)=>jt.createElement(KC,{key:$.type==="item"?$.key:Y,onItemEnter:(ae,ye)=>{A(ae.key,ye)},onItemLeave:(ae,ye)=>{M(ae.key,ye)},columns:t,active:$.type==="item"&&$.key===i,keyboardActive:$.type==="item"&&$.key===a,item:$,index:Y,onClick:v}));let P=t.map($=>$.width||(typeof $.flex=="number"?`${$.flex}fr`:$.flex)||"auto").join(" "),_={...e.style,gridTemplateColumns:P,gridTemplateRows:o.map(()=>"auto").join(" ")};u||(_.whiteSpace="nowrap");function E($){let{runtimeItems:Y,runtimeSelectableItems:ae}=h(),ye=Y.findIndex(U=>U.type==="item"&&U.key===a),Ce=a,ue=Y[ye],pe={ArrowUp:()=>{let U=Y.slice(0,ye).filter(G=>G.type==="item"&&!G.disabled).pop();U&&U.type==="item"&&U.key&&(Ce=U.key)},ArrowDown:()=>{let U=Y.slice(ye+1).filter(G=>G.type==="item"&&!G.disabled)[0];U&&U.type==="item"&&U.key&&(Ce=U.key)},Home:()=>{pe.PageUp()},End:()=>{pe.PageDown()},PageUp:()=>{Ce=ae[0].key},PageDown:()=>{Ce=ae[ae.length-1].key},ArrowLeft:()=>{S(null),h().parentMenuId&&(b.destroyed=!0)},ArrowRight:()=>{ue&&(S(ue.key),Ve(()=>{T()&&C&&C.getParentMenuId()===h().menuId&&C.focus()}))},Enter:()=>{if(ue)if(ue.originalMenuItem?.menu){if(ue&&ue.originalMenuItem.menu&&C){pe.ArrowLeft();return}ue&&S(ue.key)}else v($,ue)}," ":()=>{if(!ue)return;ue.originalMenuItem.menu||v($,ue);let U=GC(r,ue.key);U&&U.click()},Escape:()=>{pe.ArrowLeft();let U=h();U.parentMenuId||U.onHideIntent?.(U)}},ge=pe[$.key];ge&&(ge(),$.preventDefault()),Ce!=a&&y(Ce)}function L(){b.focused=!1}let k=(0,ut.useCallback)(function(){b.focused=!0,setTimeout(()=>{V.current&&g.current&&g.current===document.activeElement&&h().keyboardActiveItemKey==null&&y(h().runtimeSelectableItems[0]?.key??null)})},[]),V=(0,ut.useRef)(!0),j=(0,ut.useCallback)(()=>{let $=h();$.onHideIntent?.($)},[h]),[O]=(0,ut.useState)(()=>({hideMenu:j,focus:()=>{g.current&&(g.current.focus(),setTimeout(()=>{g.current&&g.current!==document.activeElement&&g.current.focus()},10),k())},getMenuId:()=>h().menuId,getParentMenuId:()=>h().parentMenuId})),F=(0,ut.useCallback)($=>{$?(g.current=$,d?.(h(),O),p&&O.focus()):(f?.(h()),g.current=$)},[]),te=jt.createElement("div",{className:Mn.contents},jt.createElement("div",{...e,"data-menu-id":r,"data-submenu-for":m,tabIndex:0,ref:F,onKeyDown:$=>{e.onKeyDown?.($),E($)},onMouseDown:$=>{V.current=!1,e.onMouseDown?.($)},onMouseUp:$=>{V.current=!0,e.onMouseUp?.($)},onFocus:k,onBlur:L,className:J(zg,e.className,"InfiniteMenu"),style:_},I),R);return s?null:te}function KC(n){let[e,t]=jt.useState(!1),{columns:o,item:r,index:i,active:a,keyboardActive:l}=n,s=r.type==="item"?r.value.key:i,c=null;if(r.type==="decoration")c=jt.createElement("div",{style:r.style},r.value);else{let u=0;c=o.map((d,f)=>{let p=r.value,m=d.field||d.name,g=f+1,b=g+r.span;if(g<u)return null;u=b;let y={style:{...d.style,...r.style,gridColumnStart:g,gridColumnEnd:b},"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:J(Vg({active:a,disabled:!!r.disabled,keyboardActive:l,pressed:e||n.active}),r.className),onPointerEnter:S=>{r.disabled||n.onItemEnter?.(r,S)},onPointerLeave:S=>{r.disabled||n.onItemLeave?.(r,S)},onMouseDown:()=>{r.disabled||t(!0)},onMouseUp:()=>{r.disabled||t(!1)},onClick:S=>{r.disabled||n.onClick(S,r)}};return d.render?jt.createElement(Lr,{key:`${s}-${m}`,render:d.render,renderParam:{item:p,column:d,value:p[m],domProps:y}}):jt.createElement("div",{key:`${s}-${m}`,...y},p[m])}).filter(Boolean)}return jt.createElement("div",{className:Gg},c)}var{ManagedComponentContextProvider:BC}=Ot({initSetupState:Wg,forwardProps:jg,mapPropsToState:$g,layoutEffect:!0});function WC(n){let{componentActions:e,componentState:t}=Ft(),o=Oe(t);return cr.createElement(yc.Provider,{value:{componentActions:e,componentState:t,getState:o}},cr.createElement(qg,{domProps:n.domProps}))}function $t(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:f,parentMenuItemKey:p,autoFocus:m,id:g,onHideIntent:b,__is_infinite_menu_component:h,...y}=n;return cr.createElement(BC,{addSubmenuColumnIfNeeded:i,bubbleActionsFromSubmenus:a,wrapLabels:c,...n},cr.createElement(WC,{domProps:y}))}$t[ja]=!0;var Tc=K(require("react"));function Xg(n,e){let{columnApi:t,column:o,getComputed:r,api:i,dataSourceApi:a}=e,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((f,p)=>{let m=Qo(f,e,"column-menu");u.push({key:p,label:m,check:Tc.createElement(so,{key:f.id,disabled:f.computedVisible&&i.getVisibleColumnsCount()===1,checked:f.computedVisible,onChange:g=>{let b=!!g;i.setVisibilityForColumn(f.id,b),requestAnimationFrame(()=>{i.realignColumnContextMenu()})}})})}),{columns:[{name:"check"},{name:"label"}],items:u}}},"-",{key:"group-by",label:"Group by",menu:()=>{let u=[];return r().computedColumnsMapInInitialOrder.forEach((f,p)=>{if(f.groupByForColumn)return;let m=Qo(f,e,"column-menu");u.push({key:p,label:m,check:Tc.createElement(so,{key:f.id,disabled:!f.computedGroupable,checked:f.computedGroupedBy,onChange:()=>{a.toggleGroupByField(f.field)}})})}),{columns:[{name:"check"},{name:"label"}],items:u}}}].filter(u=>!!u)}function Qg(n,e,t){if(n==null)return null;let{getComputed:o,getState:r}=e,{components:i,getColumnMenuItems:a}=r(),l=i?.Menu??$t,s=o().computedColumnsMap.get(n);if(!s)return null;let c={column:s,columnApi:gt(s.id,e),...e},u=Xg([],c),d=a?a(u,c):u,f=m=>{m.__insideMenu=!0},p=m=>{m.domRef.current?.parentNode?.removeEventListener("mousedown",f)};return!d||!d.length?null:Zg.createElement(l,{autoFocus:!0,items:d,onShow:m=>{m.domRef.current?.parentNode?.addEventListener("mousedown",f)},onHide:p,onHideIntent:m=>{p(m),t?.()}})}var jC=`[${gs["data-name"]}="${hs["data-name"]}"]`;function $C(n){let{columnId:e,context:t,clearAll:o,showOverlay: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=`[${Rp["data-column-id"]}="${e}"] ${jC}`;u=i().domRef.current.querySelector(d)}if(!u){console.warn(`Cannot show column menu for column "${e}"`);return}l.current=null,r(()=>Qg(e,t,c),{constrainTo:s.current,id:"column-menu",alignTo:u,alignPosition:[["TopLeft","BottomLeft"],["TopRight","BottomRight"]]})}function Jg(){let n=He(),{getState:e,actions:t,columnMenuVisibleForColumnId:o,columnMenuVisibleKey:r}=oe(c=>({getState:c.getState,actions:c.actions,columnMenuVisibleForColumnId:c.state.columnMenuVisibleForColumnId,columnMenuVisibleKey:c.state.columnMenuVisibleKey})),{portalDOMRef:i}=lo(c=>({portalDOMRef:c.getMasterState().portalDOMRef}))||{},{showOverlay:a,portal:l,clearAll:s}=oo({portalContainer:i?.current??!1});return(0,Cc.useEffect)(()=>{let c=e();return c.onColumnMenuClick.onChange(u=>{u&&(c.columnMenuTargetRef.current=u.target,t.contextMenuVisibleFor=null,t.cellContextMenuVisibleFor=null,t.filterOperatorMenuVisibleForColumnId=null,t.columnMenuVisibleForColumnId=u.column.id)})},[]),(0,Cc.useEffect)(()=>{let{columnMenuVisibleForColumnId:c,columnMenuTargetRef:u}=e();if(c){let f=function(p){p.__insideMenu!==!0&&(s(),t.columnMenuVisibleForColumnId=null)};var d=f;return document.documentElement.addEventListener("mousedown",f),$C({columnId:c,context:n,clearAll:s,showOverlay:a}),()=>{document.documentElement.removeEventListener("mousedown",f)}}else u.current=null,s();return()=>{}},[o,r]),{menuPortal:l}}var eh=K(require("react")),th=require("react");var UC={width:0,height:0,overflow:"hidden",pointerEvents:"none",outline:"none",zIndex:-1};function oh(){let{getState:n,api:e,actions:t,getComputed:o,dataSourceApi:r,dataSourceActions:i}=He(),{getDataSourceState:a,getDataSourceMasterContext:l}=Qt(),{focusDetectDOMRef:s}=n(),c=(0,th.useCallback)(async()=>{wg({getDataSourceState:a,getDataSourceMasterContext:l,getComputed:o,actions:t,dataSourceActions:i,api:e,getState:n,dataSourceApi:r})},[]);return eh.createElement("div",{onFocus:c,ref:s,tabIndex:0,style:UC})}var ur=require("react");function YC(){let n=He(),{getState:e,editingCell:t}=oe(r=>({getState:r.getState,editingCell:r.state.editingCell})),o=t&&!t.active?t.cancelled:void 0;(0,ur.useEffect)(()=>{if(o){let{rowIndex:r,columnId:i,initialValue:a}=e().editingCell,{onEditCancelled:l}=e();l?.({...Dt({rowIndex:r,columnId:i,...n}),initialValue:a})}},[o])}function qC(){let n=He(),{getState:e,editingCell:t}=oe(r=>({getState:r.getState,editingCell:r.state.editingCell})),o=t&&!t.active&&t.accepted instanceof Error?t.accepted:void 0;(0,ur.useEffect)(()=>{if(o){let{rowIndex:r,columnId:i,value:a,initialValue:l}=e().editingCell,{onEditRejected:s}=e();s?.({...Dt({rowIndex:r,columnId:i,...n}),value:a,error:o,initialValue:l})}},[o])}function XC(){let n=He(),{editingCell:e}=oe(r=>({editingCell:r.state.editingCell})),t=e?.active,o=xo(t);(0,ur.useEffect)(()=>{!t&&o&&n.api.focus()},[t,o])}function ZC(){let n=He(),{editingCell:e,getState:t}=oe(r=>({editingCell:r.state.editingCell,getState:r.getState})),o=e&&!e.active&&!e.cancelled&&e.accepted===!0;(0,ur.useEffect)(()=>{if(o){let{editingCell:r}=t(),{value:i,rowIndex:a,columnId:l,initialValue:s}=r,c={...Dt({rowIndex:a,columnId:l,...n}),value:i,initialValue:s};t().onEditAccepted?.(c),n.api.persistEdit({value:i})}},[o])}function QC(){let n=He(),{editingCell:e,getState:t}=oe(r=>({editingCell:r.state.editingCell,getState:r.getState})),o=e?e.persisted:void 0;(0,ur.useEffect)(()=>{if(o){let{editingCell:r,onEditPersistError:i,onEditPersistSuccess:a}=t();if(!r)return;let{rowIndex:l,columnId:s,value:c,initialValue:u}=r,d={...Dt({rowIndex:l,columnId:s,...n}),value:c,initialValue:u};o instanceof Error?i?.({...d,error:o}):a?.(d)}},[o])}function nh(){YC(),qC(),ZC(),QC(),XC()}var Rc=require("react");var Uo=K(require("react"));var wc=K(require("react")),Xa=n=>wc.createElement(ze,{...n},wc.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}));var Ic=K(require("react")),rh=n=>Ic.createElement(ze,{...n},Ic.createElement("path",{d:"m9.55 19-6.725-6.725L5.25 9.85l4.3 4.325 9.225-9.225 2.425 2.4Z"}));function ih(n,e,t){if(n==null)return null;let{getComputed:o,getState:r,getDataSourceState:i,actions:a,dataSourceApi:l,dataSourceActions:s,api:c}=e,{components:u,getFilterOperatorMenuItems:d}=r(),f=u?.Menu??$t,p=o().computedColumnsMap.get(n);if(!p)return null;let m=I=>{I.__insideMenu=!0},g=I=>{I.domRef.current?.parentNode?.removeEventListener("mousedown",m)},{filterTypes:b}=i(),h=b[p.computedFilterType];if(!h)return null;let y=h.operators.map(I=>{let v=I.name,D=p.computedFilterValue?p.computedFilterValue.filter.operator===v:v===h.defaultOperator,R=I.components?.Icon??En;return{key:v,icon:Uo.createElement(R,null),label:Uo.createElement(Uo.Fragment,null,I.label??I.name),onAction:()=>{c.setColumnFilterOperator(n,v)},checked:D?Uo.createElement(rh,{size:16}):null}}),T=[...[{key:"close",label:"Close Menu",icon:null,onAction:()=>{c.hideFilterOperatorMenu()}},{key:"reset",label:"Reset",icon:Uo.createElement(Xa,null),disabled:!p.computedFiltered,onAction:()=>{c.clearColumnFilter(n)}},"-"],...y],C={column:p,api:c,getState:r,getDataSourceState:i,getComputed:o,actions:a,dataSourceApi:l,dataSourceActions:s,columnFilterValue:p.computedFilterValue,filterTypes:b},w=d?d(T,C):T;return Uo.createElement(f,{autoFocus:!0,columns:[{name:"icon"},{name:"label"},{name:"checked"}],items:w,onShow:I=>{I.domRef.current?.parentNode?.addEventListener("mousedown",m)},onHide:g,onHideIntent:I=>{g(I),t?.()}})}var Za=10;function ah(){let{portalDOMRef:n}=lo(l=>({portalDOMRef:l.getMasterState().portalDOMRef}))||{},e=He(),{getState:t,actions:o}=e,{showOverlay:r,portal:i,clearAll:a}=oo({portalContainer:n?.current??!1});return(0,Rc.useEffect)(()=>t().onFilterOperatorMenuClick.onChange(s=>{if(!s)return;let{target:c,column:u}=s;function d(){a(),o.filterOperatorMenuVisibleForColumnId=null}let f=c?.parentElement||c,p=ve.from(f.getBoundingClientRect());p.top-=Za,p.left-=Za,p.width+=2*Za,p.height+=2*Za,r(()=>ih(u.id,e,d),{constrainTo:t().domRef.current,id:"filter-operator-menu",alignTo:p,alignPosition:[["TopLeft","BottomLeft"],["TopRight","BottomRight"]]}),o.contextMenuVisibleFor=null,o.cellContextMenuVisibleFor=null,o.columnMenuVisibleForColumnId=null,o.filterOperatorMenuVisibleForColumnId=u.id}),[]),(0,Rc.useEffect)(()=>{let{filterOperatorMenuVisibleForColumnId:l}=t();if(l){let c=function(u){u.__insideMenu!==!0&&(a(),o.filterOperatorMenuVisibleForColumnId=null)};var s=c;return document.documentElement.addEventListener("mousedown",c),()=>{document.documentElement.removeEventListener("mousedown",c)}}else a();return()=>{}},[t().filterOperatorMenuVisibleForColumnId]),{menuPortal:i}}var ii=require("react");var xc=K(require("react"));var vc=K(require("react"));function Qa(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 Dc(n){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),n.onHideIntent?.()}}}function Pc(n,e,t){if(!n)return null;let o=Se();return n.then(r=>{let{items:i,columns:a}=Qa(r);i&&i.length&&o(vc.createElement(t,{...e,items:i||[],columns:a}))}),vc.createElement(ko,{updater:o})}function lh(n,e,t){let{columnId:o,rowIndex:r,event:i}=n,{getComputed:a,getState:l}=e,{components:s,getCellContextMenuItems:c}=l(),u=s?.Menu??$t,{computedColumnsMap:d}=a(),f=d.get(o),p={...Dt({...e,rowIndex:r,columnId:f.id}),event:i};if(!f||!c)return{cellContext:p,menu:null,preventDefault:!1};let m=Dc({onHideIntent:t}),g=c(p,e),b=g instanceof Promise||Array.isArray(g)?!0:!!(g&&Array.isArray(g.items));if(g instanceof Promise)return{cellContext:p,menu:Pc(g,m,u),preventDefault:b};let{items:h,columns:y}=Qa(g);return!h||!h.length?{cellContext:p,menu:null,preventDefault:Array.isArray(h)}:{preventDefault:b,menu:xc.createElement(u,{...m,columns:y,items:h}),cellContext:p}}function sh(n,e,t){let{getState:o,getComputed:r}=e,{components:i,getContextMenuItems:a}=o(),l=i?.Menu??$t,{computedColumnsMap:s}=r(),c=n.columnId?s.get(n.columnId):void 0,u=c?{...n,...Dt({...e,rowIndex:n.rowIndex,columnId:c.id})}:n;if(!a)return{cellContext:u,menu:null,preventDefault:!1};let d=Dc({onHideIntent:t}),f=a(u,e),p=f instanceof Promise||Array.isArray(f)?!0:!!(f&&Array.isArray(f.items));if(f instanceof Promise)return{cellContext:u,menu:Pc(f,d,l),preventDefault:p};let{items:m,columns:g}=Qa(f);return!m||!m.length?{cellContext:u,menu:null,preventDefault:Array.isArray(m)}:{preventDefault:p,menu:xc.createElement(l,{...d,columns:g,items:m}),cellContext:u}}var Ja=5,ch=[["TopLeft","BottomLeft"],["TopRight","BottomRight"],["BottomLeft","BottomLeft"],["BottomRight","BottomRight"],["TopCenter","TopLeft"],["BottomCenter","TopLeft"],["CenterLeft","TopLeft"],["CenterRight","TopLeft"]];function uh(){let n=He(),{portalDOMRef:e}=lo(l=>({portalDOMRef:l.getMasterState().portalDOMRef}))||{},{getState:t,actions:o}=n,{showOverlay:r,portal:i,clearAll:a}=oo({portalContainer:e?.current??!1});return(0,ii.useEffect)(()=>{let{actions:l,getState:s,getDataSourceState:c}=n;return s().cellContextMenu.onChange(d=>{if(!d)return;let{event:f}=d;function p(){a(),l.cellContextMenuVisibleFor=null}let{menu:m,cellContext:g,preventDefault:b}=lh(d,n,p),h=ve.fromPoint({top:f.clientY,left:f.clientX});h.width+=Ja,h.height+=Ja,r(m,{constrainTo:s().domRef.current,id:"cell-context-menu",alignTo:h,alignPosition:ch}),b&&f.preventDefault(),l.cellContextMenuVisibleFor={columnId:d.columnId,rowId:d.rowId,rowIndex:d.rowIndex,colIndex:d.colIndex};let{onCellContextMenu:y}=s();y&&y({...g,getState:s,getDataSourceState:c},f)})},[]),(0,ii.useEffect)(()=>{let{cellContextMenuVisibleFor:l}=t();if(l){let c=function(u){u.__insideMenu!==!0&&(a(),o.cellContextMenuVisibleFor=null)};var s=c;return document.documentElement.addEventListener("mousedown",c),()=>{document.documentElement.removeEventListener("mousedown",c)}}else a();return()=>{}},[t().cellContextMenuVisibleFor]),{menuPortal:i}}function dh(){let n=He(),{portalDOMRef:e}=lo(l=>({portalDOMRef:l.getMasterState().portalDOMRef}))||{},{getState:t,actions:o}=n,{showOverlay:r,portal:i,clearAll:a}=oo({portalContainer:e?.current??!1});return(0,ii.useEffect)(()=>{let{actions:l,getState:s}=n;return s().contextMenu.onChange(u=>{if(!u)return;let{event:d}=u;function f(){a(),l.contextMenuVisibleFor=null}let{menu:p,cellContext:m,preventDefault:g}=sh(u,n,f),b={top:d.clientY,left:d.clientX},h=ve.fromPoint(b);h.width+=Ja,h.height+=Ja,r(p,{constrainTo:s().domRef.current,id:"table-context-menu",alignTo:h,alignPosition:ch}),g&&d.preventDefault(),l.contextMenuVisibleFor={point:b,...u};let{onContextMenu:y}=s();y&&y({...n,...m},d)})},[]),(0,ii.useEffect)(()=>{let{contextMenuVisibleFor:l}=t();if(l){let c=function(u){u.__insideMenu!==!0&&(a(),o.contextMenuVisibleFor=null)};var s=c;return document.documentElement.addEventListener("mousedown",c),()=>{document.documentElement.removeEventListener("mousedown",c)}}else a();return()=>{}},[t().contextMenuVisibleFor]),{menuPortal:i}}var fh=require("react"),ph=K(require("react"));var el=require("react");function tl(n,e){let{brain:t}=oe(r=>({brain:r.state.brain})),o=(0,el.useCallback)(n,e);(0,el.useEffect)(()=>t.onScroll(o),[t,o])}var Mc="yzx0vj0";function mh(n){let{width:e,maxWidth:t,minWidth:o,scrollable:r,...i}=n,a=(0,fh.useRef)(null);tl(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=me.runtime.totalVisibleColumnsWidthValue:e==="viewport"&&(l.width=me.runtime.bodyWidth),o==="column"?l.minWidth=me.runtime.totalVisibleColumnsWidthValue:o==="viewport"&&(l.minWidth=me.runtime.bodyWidth),t==="column"?l.maxWidth=me.runtime.totalVisibleColumnsWidthValue:t==="viewport"&&(l.maxWidth=me.runtime.bodyWidth),ph.createElement("div",{ref:a,...i,className:i.className?J(i.className,Mc):Mc,style:l},i.children)}var JC=Q(q.columnWidthAtIndex),ew=Q(q.columnOffsetAtIndex);function gh(){let{computedVisibleColumns:n}=oe(e=>({computedVisibleColumns:e.computed.computedVisibleColumns}));return n.map(e=>({id:e.id,width:e.computedWidth,cssVarForWidth:`var(${JC}-${e.computedVisibleIndex})`,offset:e.computedOffset,cssVarForOffset:`var(${ew}-${e.computedVisibleIndex})`,pinned:e.computedPinned}))}var ol="InfiniteTable";var hh=require("react");function bh(){let{getState:n,actions:e,dataSourceActions:t,getDataSourceState:o}=oe(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,hh.useEffect)(()=>{if(!s){o().repeatWrappedGroupRows&&(t.repeatWrappedGroupRows=!1);return}let u=()=>{let{rowsPerPage:p,repeatWrappedGroupRows:m}=o(),g=!1,b=l.rowsPerPage,h=(r&&r.length>0||i)&&b>0?b:null;return p!=h&&(t.rowsPerPage=h,g=!0),m!=c&&(t.repeatWrappedGroupRows=c??!1,g=!0),g};u();let d,f=l.onVerticalRenderRangeChange(()=>{u()&&(d=setTimeout(()=>{e.forceBodyRerenderTimestamp=Date.now()}))});return()=>{d&&clearTimeout(d),f()}},[l,s,r,i,c])}var Sn=require("react");var ai=he({defaultClassName:"_143ofgf0",variantClassNames:{active:{true:"_143ofgf1",false:"_143ofgf2"}},defaultVariants:{},compoundVariants:[]}),yh="_143ofgf5",Sh="_143ofgf3";var tw=Q(me.loaded),Ac={source:"infinite-table-page",target:"infinite-table-devtools-background"};function Th(n,e){let{type:t,debugId:o}=n;if(t==="unmount")return{...Ac,url:Ec(),type:t,payload:{debugId:o}};let r=e,i=r.getComputed(),a=r.getDataSourceState(),l=r.getState();return{...Ac,url:Ec(),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)}}}}var Ec=pt(function(){let n=new URL(window.location.href);return n.origin+n.pathname});function ow(n){window.postMessage(n)}var nw=pt(()=>{console.log("Infinite Table DevTools detected!");let n=(e,t)=>{if(t){Lt.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(Th({type:"update",debugId:e},t))}else im(e),window.postMessage(Th({type:"unmount",debugId:e},null))};return window.__INFINITE_TABLE_DEVTOOLS_HOOK__=n,Ue.onLogIntent("IT:*",e=>{ow({...Ac,url:Ec(),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 Ch(){let{getState:n,getDataSourceState:e,dataSourceActions:t}=oe(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(tw)!==`${sd}`&&Jr({debugId:i,key:"CSS001_CSS"}),(0,Sn.useEffect)(()=>{e().debugId!==i&&(t.debugId=i)},[i]),aw()}var nl=Se(),rw={revertAll:n=>{let e=Lt.get(n.debugId);if(e){let t=Bo.get(n.debugId);Bo.delete(n.debugId),go.delete(n.debugId),t&&Object.keys(t).forEach(r=>{e.actions[r]=t[r],delete t[r]});let o=bo.get(n.debugId);bo.delete(n.debugId),ho.delete(n.debugId),o&&Object.keys(o).forEach(r=>{e.dataSourceActions[r]=o[r],delete o[r]})}},revertProperty:n=>{let e=Lt.get(n.debugId);if(e){let t=n.property,o=go.get(n.debugId),r=Bo.get(n.debugId),i=ho.get(n.debugId),a=bo.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=bo.get(n.debugId)||{};delete i[s],e.dataSourceActions[s]=c[s],delete c[s]}}},discardWarning:n=>{let e=Lt.get(n.debugId);if(e){let t=n.warning,o=e.getDataSourceState().debugWarnings;if(o.get(t))o.delete(t),ei(n.debugId);else{let i=n.warning,a=e.getState().debugWarnings;a.get(i)&&(a.delete(i),ei(n.debugId))}}},discardAllWarnings:n=>{let e=Lt.get(n.debugId);e&&(e.getDataSourceState().debugWarnings.clear(),e.getState().debugWarnings.clear(),ei(n.debugId))},setColumnVisibility:n=>{Zs(n.debugId,"columnVisibility",n.columnVisibility)},setGroupBy:n=>{Ea(n.debugId,"groupBy",n.groupBy)},setGroupRenderStrategy:n=>{Zs(n.debugId,"groupRenderStrategy",n.groupRenderStrategy)},setSortInfo:n=>{Ea(n.debugId,"sortInfo",n.sortInfo)},setMultiSort:n=>{Ea(n.debugId,"multiSort",n.multiSort)},highlight:n=>{let e=Lt.get(n.debugId);if(e){let t=e.getState().domRef.current;if(t){let o=t.getBoundingClientRect(),r=document.querySelector(`.${ai.classNames.base}`);r||(r=document.createElement("div"),r.classList.add(ai.classNames.base),r.innerHTML=[`<div class="${Sh}"></div>`,`<div class="${yh}"></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(ai.classNames.variants.active.true),a.removeEventListener("animationend",l)};a.addEventListener("animationend",l),r.classList.add(ai.classNames.variants.active.true)}}}}};function iw(){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__||(nw(),nl(window.__INFINITE_TABLE_DEVTOOLS_HOOK__)),typeof n.data.type=="string")){let e=n.data.type,t=rw[e];t&&t(n.data.payload)}})}iw();function aw(){let{getState:n,getComputed:e,getDataSourceState:t,dataSourceActions:o,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=n().debugId,c=(0,Sn.useRef)(s);return c.current=s,(0,Sn.useEffect)(()=>{let u=c.current;if(!u)return;let d=p=>{p(u,{getState:n,getDataSourceState:t,getComputed:e,dataSourceActions:o,actions:r,api:a,dataSourceApi:i})},f=nl.get();if(f){d(f);return}return nl.onChange(p=>{p&&d(p)})},[]),(0,Sn.useEffect)(()=>{let u=c.current;if(!u)return;let d=nl.get();d&&d(u,{getState:n,getDataSourceState:t,getComputed:e,dataSourceActions:o,actions:r,api:a,dataSourceApi:i})}),(0,Sn.useEffect)(()=>{if(s)return()=>{let u=globalThis.__INFINITE_TABLE_DEVTOOLS_HOOK__;u&&u(s,null)}},[s]),s}function wh(){let{masterPortalDOMRef:n}=lo(o=>({masterPortalDOMRef:o.getMasterState().portalDOMRef}))??{},e=oe(o=>o.state.portalDOMRef);return n?.current??e?.current}var Mt=K(require("react")),Ah=require("react");var Ih="hs68h8j _16lm1iwk _16lm1iwx _16lm1iw2n",Rh=he({defaultClassName:"hs68h8e _16lm1iw12 _16lm1iw1x _16lm1iw2j _16lm1iw1p",variantClassNames:{active:{true:"hs68h8f _16lm1iwn _16lm1iw1h",false:"_16lm1iwo"},draggingInProgress:{true:"hs68h8h",false:"hs68h8i"}},defaultVariants:{},compoundVariants:[]}),vh="hs68h81",Dh=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 Tn=K(require("react"));function Ph(n){return Tn.createElement("div",{...n.domProps})}function xh(n){let{active:e}=n;return Tn.createElement("div",{className:vh},e?"Drop to group":"Drag columns to group")}function Mh(n){let e=t=>{(t.key==="Enter"||t.key===" ")&&(t.preventDefault(),n.onClear?.())};return Tn.createElement("div",{...n.domProps},n.label,Tn.createElement("div",{className:wi[1]}),Tn.createElement("div",{tabIndex:0,role:"button","aria-label":`Clear grouping by ${n.field}`,className:Ih,onKeyDown:e,onMouseDown:n.onClear},Tn.createElement(Xa,{size:20})))}var lw=(n,e)=>t=>{e&&e(t);let o=Date.now(),r=!1,i=()=>{r=!0};Ae().addEventListener("mousemove",i,{once:!0}),Ae().addEventListener("mouseup",()=>{r||(Ae().removeEventListener("mousemove",i),Date.now()-o<200&&requestAnimationFrame(()=>{n()}))},{once:!0})};function sw(n){let{column:e,onClear:t,components:o,field:r,id:i,toggleSorting:a}=n,{dragSourceListId:l,dragItemId:s}=Hr(),c=l===dr,u=He(),d=(e?Qo(e.id,u,"grouping-toolbar"):r)??i,f=e?Mt.createElement(Yi,{forceSize:!0,size:20,direction:e.computedSortedAsc?1:e.computedSortedDesc?-1:0}):null,p=Mt.createElement(Mt.Fragment,null,d,f),m=s===i&&l===dr,g=J(Rh({draggingInProgress:c,active:m}),n.domProps?.className),b=lw(a,n.domProps?.onMouseDown),h={...n.domProps,className:g,onMouseDown:b},y=o?.ToolbarItem??Mh;return Mt.createElement(y,{active:m,domProps:h,column:e,field:r,label:p,onClear:t})}var dr="grouping-toolbar";function Eh(n){let{groupBy:e}=Fe(S=>({groupBy:S.dataSourceState.groupBy})),{getComputed:t,dataSourceApi:o,api:r}=oe(S=>({getComputed:S.getComputed,dataSourceApi:S.dataSourceApi,api:S.api})),{dropTargetListId:i,dragSourceListId:a}=on(),{fieldsToColumn:l,computedColumnsMap:s}=t(),c=i===dr,u=a===dr,d=n.components?.Placeholder??xh,f=n.components?.Host??Ph,p=e.length?Mt.createElement(Mt.Fragment,null,e.map((S,T)=>{let C=S.field?l.get(S.field):void 0,w=`${S.field??`idx-${T}`}`;return Mt.createElement(un.DraggableItem,{key:w,id:w},I=>Mt.createElement(sw,{id:w,components:n.components,domProps:I,field:S.field,column:C,toggleSorting:()=>{C&&r.toggleSortingForColumn(C.id)},onClear:()=>{let v=e.filter(D=>D!==S).filter(Boolean);o.setGroupBy(v)}}))})):Mt.createElement(d,{draggingInProgress:u,active:c,groupBy:e}),m=S=>{let T=S.map(C=>e[C]);o.setGroupBy(T)},g=S=>{let{dragItemId:T}=S,C=T,w=s.get(C);if(!w||!w.field||!w.computedGroupable)return;let I=[...e];I.splice(S.dropIndex,0,{field:w.field}),o.setGroupBy(I)},b=(0,Ah.useCallback)(S=>{let{computedColumnsMap:T}=t(),C=S.dragItem.id,w=T.get(C);return!(!w||!w.computedGroupable||e.some(I=>I.field===w.field))},[e]),h=n.orientation??"horizontal",{domProps:y}=n;return Mt.createElement(un,{orientation:h,dragListId:dr,acceptDropsFrom:["header",dr],onDrop:m,onAcceptDrop:g,shouldAcceptDrop:b},(S,{draggingInProgress:T,status:C})=>{let w=J(Dh({active:c,orientation:h,draggingInProgress:T,dropRejected:C==="rejected"}),S.className,y?.className),I={...S,...y,className:w,children:p};return Mt.createElement(f,{active:c,rejectDrop:C==="rejected",domProps:I,orientation:h})})}var pr=K(require("react"));var _c=require("react"),no=require("react"),rl=K(require("react"));function _h(n){let{dataArray:e,brain:t,computedPinnedEndColumns:o,computedPinnedStartColumns:r,computedVisibleColumns:i,computedRowHeight:a,columnSize:l,rowspan:s}=n;return ma(t,{colWidth:l,rowHeight:a,rows:e.length,cols:i.length,rowspan:s},{fixedColsEnd:o.length,fixedColsStart:r.length}),t}var So=K(require("react"));var Oh=he({defaultClassName:"evqes20",variantClassNames:{},defaultVariants:{},compoundVariants:[]});var li=require("react");function cw(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 uw(n,e){let{detailState:t,masterState:o,masterActions:r,cacheEntryForRow:i}=e,a=new Map(o.detailDataSourcesStateToRestore),l=wm(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 dw(n,e){let t=(0,li.useRef)(!1);return{currentRowCache:(0,li.useMemo)(()=>({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)}),[e,n]),cacheCalledByRowDetailRenderer:t}}function Fh(n){let{rowDetailsCache:e,rowInfo:t}=n,{getDataSourceState:o,dataSourceActions:r}=Fe(c=>({getDataSourceState:c.getDataSourceState,dataSourceActions:c.dataSourceActions})),{getMasterState:i}=oe(c=>({getMasterState:c.getState})),{currentRowCache:a,cacheCalledByRowDetailRenderer:l}=dw(t.id,e),s=(0,li.useMemo)(()=>{let c=o().detailDataSourcesStateToRestore.has(t.id)&&a.has();return{registerDetail:pt(d=>{if(l.current||a.add({all:!0}),!a.has()){requestAnimationFrame(()=>{d.dataSourceState.destroyedRef.current||(d.dataSourceActions.stateReadyAsDetails=!0)});return}cw(t.id,{masterState:o(),detailContext:d}),requestAnimationFrame(()=>{d.dataSourceState.destroyedRef.current||(d.dataSourceActions.stateReadyAsDetails=!0)}),d.dataSourceState.onCleanup.onChange(()=>{let f=a.get();f&&uw(t.id,{detailState:d.getDataSourceState(),masterActions:r,masterState:o(),cacheEntryForRow:f})})}),shouldRestoreState:c}},[t.id,a]);return s.masterRowInfo=t,s.getMasterDataSourceState=o,s.getMasterState=i,{masterDetailContextValue:s,currentRowCache:a}}function Nh(){return Io()}var{rootClassName:fw}=ke,pw=`${fw}RowDetail`;function mw(n){let{domRef:e,rowDetailRenderer:t,rowDetailHeight:o,rowInfo:r,detailOffset:i,rowDetailsCache:a}=n,{masterDetailContextValue:l,currentRowCache:s}=Fh({rowDetailsCache:a,rowInfo:r}),c=Dn(),[u]=So.useState(()=>Nh());return u.setSnapshot(l),So.useLayoutEffect(()=>{u.notify()},[l]),So.createElement(c.Provider,{value:u},So.createElement("div",{ref:e,className:J(pw,Oh({})),style:{position:"absolute",top:`${i}px`,left:0,width:`calc(${q.bodyWidth} - ${q.scrollbarWidthVertical})`,height:o}},t(r,s)))}var Lh=So.memo(mw);var gw=1;function kh(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:f,brain:p,showZebraRows:m,rowDetailRenderer:g,isRowDetailsExpanded:b,isRowDetailsEnabled:h,cellClassName:y,cellStyle:S,rowStyle:T,rowDetailCache:C,rowClassName:w,onScrollToTop:I,onScrollToBottom:v,onScrollStop:D,scrollToBottomOffset:R,wrapRowsHorizontally:x,updatedAt:A,ready:M,editingCell:P}=oe(z=>({actions:z.actions,getState:z.getState,getComputed:z.getComputed,getDataSourceMasterContext:z.getDataSourceMasterContext,rowHeight:z.state.rowHeight,rowDetailHeight:z.state.rowDetailHeight,onRowMouseEnter:z.state.onRowMouseEnter,onRowMouseLeave:z.state.onRowMouseLeave,groupRenderStrategy:z.state.groupRenderStrategy,brain:z.state.brain,showZebraRows:z.state.showZebraRows,rowDetailRenderer:z.state.rowDetailRenderer,isRowDetailsExpanded:z.state.isRowDetailExpanded,isRowDetailsEnabled:z.state.isRowDetailEnabled,cellClassName:z.state.cellClassName,cellStyle:z.state.cellStyle,rowStyle:z.state.rowStyle,rowDetailCache:z.state.rowDetailCache,rowClassName:z.state.rowClassName,onScrollToTop:z.state.onScrollToTop,onScrollToBottom:z.state.onScrollToBottom,onScrollStop:z.state.onScrollStop,scrollToBottomOffset:z.state.scrollToBottomOffset,wrapRowsHorizontally:z.state.wrapRowsHorizontally,updatedAt:z.state.updatedAt,ready:z.state.ready,editingCell:z.state.editingCell})),{computedPinnedStartColumns:_,computedPinnedEndColumns:E,computedVisibleColumns:L,computedColumnsMap:k,computedRowHeight:V,computedRowSizeCacheForDetails:j,fieldsToColumn:O,rowspan:F,toggleGroupRow:te,columnSize:$}=e,{dataArray:Y,rowInfoStore:ae,selectionMode:ye,cellSelection:Ce,isNodeReadOnly:ue,getDataSourceState:pe,dataSourceApi:ge,dataSourceActions:U}=Fe(z=>({dataSourceApi:z.dataSourceApi,dataSourceActions:z.dataSourceActions,getDataSourceState:z.getDataSourceState,dataArray:z.dataSourceState.dataArray,rowInfoStore:z.dataSourceState.rowInfoStore,selectionMode:z.dataSourceState.selectionMode,cellSelection:z.dataSourceState.cellSelection,isNodeReadOnly:z.dataSourceState.isNodeReadOnly})),G=Oe(Y);_h({columnSize:$,brain:p,computedPinnedStartColumns:_,computedPinnedEndColumns:E,computedVisibleColumns:L,computedRowHeight:V,dataArray:Y,bodySize:t,rowspan:F});let X=(0,no.useRef)(0);(0,no.useEffect)(()=>p.onRenderCountChange(()=>{X.current=p.scrollTopMax}),[p]),(0,no.useEffect)(()=>p.onRenderRangeChange(z=>{i().onRenderRangeChange?.(z)}),[p]),(0,no.useEffect)(()=>p.onScrollStop(z=>{let{scrollTop:fe,scrollLeft:N}=z;if(fe===0&&I?.(),fe+(R??gw)>=X.current){v?.();let{livePagination:de,livePaginationCursor:Pe,dataArray:xe}=pe();de&&(U.cursorId=Pe!==void 0?Date.now():xe.length)}if(D){let de=p.getRenderRange();D({scrollTop:fe,scrollLeft:N,renderRange:de,viewportSize:i().bodySize,firstVisibleRowIndex:de.start[0],lastVisibleRowIndex:de.end[0],firstVisibleColIndex:de.start[1],lastVisibleColIndex:de.end[1]})}}),[p,I,v,D]),(0,no.useEffect)(()=>{t.height&&(r.ready=!0)},[!!t.height]),(0,no.useEffect)(()=>{let{onReady:z}=i();z&&z({api:o,dataSourceApi:ge})},[M]);let W=(0,_c.useMemo)(()=>({isNodeReadOnly:ue,selectionMode:ye,cellSelection:Ce}),[ue,ye,Ce]),le=(0,no.useCallback)(z=>{let{rowIndex:fe,colIndex:N,heightWithRowspan:Z,domRef:ce,hidden:de,width:Pe,onMouseLeave:xe,onMouseEnter:Ge}=z,Le=G()[fe],We=L[N];if(!Le||!We)return null;let Je=j?j.getRowHeight(fe):Z,et=!1;!h||typeof h=="function"&&!h(Le)?et=!1:b&&(et=b(Le)?"expanded":"collapsed");let tt=x?p.getRowIndexInPage(fe):null,B=x?p.getPageIndexForRow(fe):null,ie=o.isEditorVisibleForCell({rowIndex:fe,columnId:We.id});return rl.createElement(hf,{...{getData:G,virtualized:!0,showZebraRows:m,groupRenderStrategy:f,rowIndexInHorizontalLayoutPage:tt,horizontalLayoutPageIndex:B,rowIndex:fe,rowInfoStore:ae,hidden:de,toggleGroupRow:te,rowHeight:Je,rowDetailState:et,onMouseEnter:Ge,onMouseLeave:xe,onRowMouseEnter:u,onRowMouseLeave:d,domRef:ce,width:Pe,column:We,columnsMap:k,fieldsToColumn:O,rowStyle:T,rowClassName:w,cellStyle:S,cellClassName:y,inEditMode:ie,getDataSourceState:pe,dataSourceApi:ge,dataSourceActions:U,getState:i,imperativeApi:o,componentActions:r,getComputed:a,getDataSourceMasterContext:l,dataSourceStatePartialForCell:W}})},[s,c,u,d,j,V,b,G,L,k,O,f,x,te,m,p,ae,T,w,y,S,pe,ge,U,i,o,r,a,l,A,P,W]),re=(0,_c.useMemo)(()=>{if(b)return z=>{let{rowIndex:fe,domRef:N}=z,ce=G()[fe];if(!ce||!b(ce)||!j)return rl.createElement("div",{ref:N,className:pu.hidden});let{rowDetailHeight:de,rowHeight:Pe}=j.getSize(fe);return rl.createElement(Lh,{rowInfo:ce,rowDetailsCache:C,rowIndex:fe,domRef:N,detailOffset:Pe,rowDetailHeight:de,rowDetailRenderer:g})}},[M,le,g,c,b,C]);return{renderCell:le,renderDetailRow:re}}var zh=require("react");function Vh(){let{state:n,getState:e,actions:t}=oe(i=>({state:i.state,getState:i.getState,actions:i.actions})),{wrapRowsHorizontally:o}=n,r=xo(o);(0,zh.useEffect)(()=>{if(r!==o){let{brain:i,headerBrain:a,renderer:l,onRenderUpdater:s}=e();i.destroy(),a.destroy(),l.destroy(),s.destroy();let c=sc(ol,!!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 Kh=K(require("react"));var Gh="_16lm1iw1 _16lm1iw1c _16lm1iwe";var Hh=J(Gh,ss);function Bh(n){return Kh.createElement("div",{...n,className:n.className?J(Hh,n.className):Hh})}var fr=K(require("react"));var Wh={visible:"qy58ya1 qy58ya0 _16lm1iw2 _16lm1iw23 _16lm1iw26 _16lm1iw2c _16lm1iw2a",hidden:"qy58ya2 qy58ya0 _16lm1iw2 _16lm1iw23 _16lm1iw26 _16lm1iw2c _16lm1iw2a"},jh="qy58ya3 _16lm1iw2 _16lm1iw23 _16lm1iw26 _16lm1iw2c _16lm1iw2a",$h="qy58ya4";var{rootClassName:hw}=ke,Oc=`${hw}-LoadMask`;function bw(n){let{visible:e,children:t="Loading"}=n;return fr.createElement("div",{className:`${Wh[e?"visible":"hidden"]} ${Oc}`},fr.createElement("div",{className:`${jh} ${Oc}-Overlay`}),fr.createElement("div",{className:`${$h} ${Oc}-Text`},t))}var il=fr.memo(bw);var Uh=require("react");var yw=[Qd,`${Zt}--hovered`];function Sw(n){return Array.isArray(n)&&(n=n.join(" ")),n.split(" ").map(e=>e.trim()).filter(Boolean)}function Cn(n){let e=He(),t=Ro(),{getComputed:o,api:r}=e,{renderer:i,onRenderUpdater:a,debugId:l,keyboardNavigation:s,activeRowIndex:c,loadingText:u,columnReorderDragColumnId:d,scrollStopDelay:f,brain:p,scrollerDOMRef:m,components:g,bodySize:b,activeCellIndex:h,rowDetailRenderer:y,showHoverRows:S,wrapRowsHorizontally:T,domProps:C,domRef:w,forceBodyRerenderTimestamp:I,rowHoverClassName:v,ready:D}=oe(F=>({ready:F.state.ready,columnReorderDragColumnId:F.state.columnReorderDragColumnId,forceBodyRerenderTimestamp:F.state.forceBodyRerenderTimestamp,renderer:F.state.renderer,onRenderUpdater:F.state.onRenderUpdater,debugId:F.state.debugId,keyboardNavigation:F.state.keyboardNavigation,activeRowIndex:F.state.activeRowIndex,loadingText:F.state.loadingText,scrollStopDelay:F.state.scrollStopDelay,brain:F.state.brain,scrollerDOMRef:F.state.scrollerDOMRef,components:F.state.components,bodySize:F.state.bodySize,activeCellIndex:F.state.activeCellIndex,rowDetailRenderer:F.state.rowDetailRenderer,showHoverRows:F.state.showHoverRows,wrapRowsHorizontally:F.state.wrapRowsHorizontally,domProps:F.state.domProps,domRef:F.state.domRef,rowHoverClassName:F.state.rowHoverClassName})),R=g?.LoadMask??il,x=o(),{computedRowHeight:A,computedRowSizeCacheForDetails:M}=x,P=M?.getRowHeight||A,{loading:_}=Fe(F=>({loading:F.dataSourceState.loading})),E=pr.useCallback(F=>{let te=e.getState(),$=F.target;if(!t&&F._from_row_detail)return;t&&(F._from_row_detail=!0);let Y=ld($,lc(),te.domRef.current),ae,ye,Ce,ue;Y&&(ye=Number(Y.dataset.colIndex),ue=Number(Y.dataset.rowIndex),ae=e.getComputed().computedVisibleColumns[ye].id,Ce=e.dataSourceApi.getRowInfoArray()[ue].id);let pe={columnId:ae,colIndex:ye,rowId:Ce,rowIndex:ue,event:F,target:Y??F.target};Y&&te.cellContextMenu(pe),te.contextMenu(pe)},[]),{renderCell:L,renderDetailRow:k}=kh({imperativeApi:r,getComputed:o,domRef:w,bodySize:b,computed:x}),{autoFocus:V,tabIndex:j}=C??{};Vh();let O=(0,Uh.useMemo)(()=>{if(!S)return;let F=[];return v&&(F=F.concat(v)),n.rowHoverClassName&&(F=F.concat(n.rowHoverClassName)),Cn.rowHoverClassName&&(F=F.concat(Cn.rowHoverClassName)),Sw(F)},[S,v,n.rowHoverClassName,Cn.rowHoverClassName]);return pr.createElement(Bh,{onContextMenu:E},pr.createElement(lp,{forceRerenderTimestamp:I,debugId:l,tabIndex:j??0,autoFocus:V??void 0,activeRowIndex:D&&s==="row"?c:null,activeCellIndex:D&&s==="cell"&&!d?h:null,scrollStopDelay:f,renderer:i,wrapRowsHorizontally:T,onRenderUpdater:a,brain:p,activeCellRowHeight:P,renderCell:L,renderDetailRow:y?k:void 0,cellHoverClassNames:O,scrollerDOMRef:m,scrollVarHostRef:w}),pr.createElement(R,{visible:_},u))}Cn.rowHoverClassName=yw;var Xt=ke.rootClassName,{ManagedComponentContextProvider:Tw}=Ot({initSetupState:Bm,forwardProps:Wm,mapPropsToState:Ym,cleanup:jm,allowedControlledPropOverrides:{rowHeight:!0,columnHeaderHeight:!0},mappedCallbacks:Um(),getParentState:()=>Ca(n=>n),debugName:n=>zo(n.debugId,ol)}),Yh=Re.memo(function(){let e=hi(),{componentState:t,api:o,initialChildren:r}=oe(V=>({componentState:V.state,api:V.api,initialChildren:V.children})),{dataArrayLength:i,getDataSourceState:a,dataSourceActions:l,dataSourceApi:s}=Fe(V=>({dataArrayLength:V.dataSourceState.dataArray.length,getDataSourceState:V.getDataSourceState,dataSourceActions:V.dataSourceActions,dataSourceApi:V.dataSourceApi})),{domRef:c,portalDOMRef:u,onRowHeightCSSVarChange:d,onFlashingDurationCSSVarChange:f,onRowDetailHeightCSSVarChange:p,onColumnHeaderHeightCSSVarChange:m,rowHeightCSSVar:g,rowDetailHeightCSSVar:b,columnHeaderHeightCSSVar:h,scrollStopDelay:y,brain:S,activeRowIndex:T,activeCellIndex:C}=t,{licenseKey:w}=t;!w&&ro.licenseKey&&(w=ro.licenseKey),dg(T,i,o),ug(C,i,o);let{onKeyDown:I}=Ag();Re.useEffect(()=>{let V=a(),j=Et(O=>{V.notifyRenderRangeChange({renderStartIndex:O[0],renderEndIndex:O[1]})},{wait:y});return S.onVerticalRenderRangeChange(j)},[S,y]);let v=cg(w),{autoFocus:D,tabIndex:R,...x}=t.domProps??{},A=Dd(x);Re.useEffect(()=>{S.setScrollStopDelay(y),l.scrollStopDelayUpdatedByTable=y},[y]),Om(),bh(),nh();let{menuPortal:M}=Jg(),{menuPortal:P}=uh(),{menuPortal:_}=dh(),{menuPortal:E}=ah();Re.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 L=Ch();Re.useEffect(()=>{if(e){let V=e.getSnapshot();u.current=V.getMasterState().portalDOMRef.current}},[]);let k=r??Re.createElement(Re.Fragment,null,Re.createElement(ks,null),Re.createElement(Cn,null));return Re.createElement("div",{"data-debug-id":L,onKeyDown:I,ref:c,...A},k,Re.createElement("div",{ref:u,className:J(`${mt}Portal`,mu[1e7],Ii.absolute,du[0],su[0])},M,P,_,E),g?Re.createElement(Ir,{key:"row-height",varName:g,onChange:d}):null,Re.createElement(Ir,{key:"flashing-duration",allowInts:!0,varName:me.components.Cell.flashingDuration,onChange:f}),b?Re.createElement(Ir,{key:"row-detail-height",varName:b,onChange:p}):null,h?Re.createElement(Ir,{key:"column-header-height",varName:h,onChange:m}):null,v?null:Re.createElement(Mp,null),Re.createElement(oh,null))});function Cw({children:n,store:e}){let{componentActions:t,componentState:o}=Ft(),{scrollerDOMRef:r,scrollTopKey:i}=o,a=Oe(o),l=rg({state:o,actions:t,getState:a}),s=Oe(l),c=hi(),{getDataSourceState:u,dataSourceActions:d,getDataSourceMasterContext:f,dataSourceApi:p}=Qt(),[m]=Re.useState(()=>_m({getComputed:s,getState:a,getDataSourceState:u,getDataSourceMasterContext:f,dataSourceApi:p,actions:t,dataSourceActions:d})),g={actions:t,state:o,computed:l,dataSourceActions:d,getDataSourceMasterContext:f,getDataSourceState:u,getComputed:s,getState:a,api:m,dataSourceApi:p,children:n};return e.setSnapshot(g),Re.useLayoutEffect(()=>{e.notify()}),mi(r,b=>{let h={width:b.width,height:b.height};t.bodySize=h},{earlyAttach:!0,debounce:50}),Re.useEffect(()=>{r.current&&(r.current.scrollTop=0)},[i,r]),Re.createElement(Yh,null)}var ww=40,Iw=pg(cd),ro=function(n){let[e]=Re.useState(()=>fg()),t=Ai();return Re.createElement(Tw,{repeatWrappedGroupRows:!!n.wrapRowsHorizontally,rowHeight:ww,columnHeaderHeight:Iw,...n},Re.createElement(ls,null,Re.createElement(t.Provider,{value:e},Re.createElement(Cw,{children:n.children,store:e}))))};ro.Header=ks;ro.Body=Cn;ro.HScrollSyncContent=mh;ro.Footer=()=>Re.createElement(hu,null);ro.GroupingToolbar=Eh;var qh=K(require("react"));function Rw(n){let{DataSource:e}=tr({nodesKey:"children",...n});return qh.createElement(e,null,n.children??null)}var Xh=K(require("react"));function Zh(n){return Xh.createElement(ro,{...n})}var Qh=n=>(t,{unfilteredTreePaths:o,treeSelectionState:r,prevTreeSelectionState:i,lastUpdatedNodeInfo:a})=>{let l=new Qe(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)};var al=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=Ue(`IT:${e}:DataQuery`)}};function wn(n){if(Array.isArray(n))return n.map(wn);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]=wn(i))}),JSON.stringify(o)}return n instanceof Date?n.toISOString():n}var To=class To{constructor(e){this.queryCache=new ee;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=wn(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 al(`${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=wn(e);return this.queryCache.get(t)?.getCurrentSnapshot().done??!1};this.hasQueryForKey=e=>{let t=wn(e);return this.queryCache.has(t)};this.discardQueryForKey=e=>{let t=wn(e);this.queryCache.delete(t)};if(this.options=e,To.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)}To.clients.set(e.name,this),this.name=e.name}static destroy(e){let t=To.clients.get(e);t&&t.destroy()}static destroyAll(){To.clients.forEach(e=>{To.destroy(e.name)})}destroy(){To.clients.delete(this.options.name)}};To.clients=new Map;var Fc=To;var vw={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})})}}}},Jh={instantEdit:vw};var Dw=require("react");function eb(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 sl=class sl{constructor(e,t){this.orderRefs=[];if(typeof e=="number")this.maxSize=e,this.currentSet=new Set;else if(this.maxSize=t??sl.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}};sl.DEFAULT_SIZE=10;var ll=sl;var ul=class ul{constructor(e,t){this.orderRefs=[];if(typeof e=="number")this.maxSize=e,this.currentSet=new Set;else if(this.maxSize=t??ul.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}};ul.DEFAULT_SIZE=10;var cl=ul;var In=require("react"),Pw=(n,e)=>n.every((t,o)=>t===e[o]),tb=(n,e)=>{let t=(0,In.useRef)(e),o=Pw(e,t.current),r=(0,In.useRef)(!0);t.current=e;let i=(0,In.useRef)(["same"]),a=o?[Date.now()]:i.current;i.current=a;let l=(0,In.useRef)(n);l.current=n,(0,In.useEffect)(()=>{if(r.current){r.current=!1;return}return l.current()},a)};var Yo=require("react"),ob=(n,e,t)=>n.every((o,r)=>t?t(o,e[r]):o===e[r]),dl=(n,e)=>{let{same:t,different:o,compare:r}=e,i=(0,Yo.useRef)(t),a=(0,Yo.useRef)(o),l=ob(t,i.current,r),s=!ob(o,a.current,r),c=(0,Yo.useRef)(!0);i.current=t,a.current=o;let u=(0,Yo.useRef)(["same"]),d=l&&s?[Date.now()]:u.current;u.current=d;let f=(0,Yo.useRef)(n);f.current=n,l&&s&&(c.current=!1),(0,Yo.useEffect)(()=>{if(!c.current)return f.current()},d)};var At=K(require("react"));var nb=Q(q.currentFlashingDuration),xw=({children:n})=>At.createElement(At.Fragment,null,n),rb=1e3,ib={up:Hi({direction:"up"}).split(" "),down:Hi({direction:"down"}).split(" "),neutral:Hi({direction:"neutral"}).split(" ")},Nc=(n={})=>{let{flashDuration:e,flashClassName:t,render:o=xw}=n;return At.forwardRef((i,a)=>{let l=Nr(),{flashingDurationCSSVarValue:s}=oe(I=>({flashingDurationCSSVarValue:I.state.flashingDurationCSSVarValue})),c=typeof s=="number"?s??e??rb:e??rb,{domRef:u,value:d,column:f,rowInfo:p,htmlElementRef:m}=l,g=p.id,b=f.id,h=At.useRef(!0),y=At.useRef(d),S=h.current?null:y.current;h.current=!1;let T=At.useRef(void 0),C=At.useRef(void 0),w=At.useRef(void 0);return dl(()=>{if(d===y.current)return;let I=()=>{let x=m.current;if(T.current&&(clearTimeout(T.current),T.current=void 0),w.current&&(clearTimeout(w.current),w.current=void 0),C.current&&x){let A=C.current,M=ib[A];x.classList.remove(...t?[t,...M]:M),x.style.removeProperty(nb),C.current=void 0}};y.current=d;let v=m.current;if(!v)return;I();let D=typeof d=="number"?d>S?"up":"down":"neutral",R=ib[D];return v.style.setProperty(nb,`${c}`),v.classList.add(...t?[t,...R]:R),C.current=D,T.current=setTimeout(I,c),I},{same:[b,g],different:[d]}),At.createElement("div",{ref:u,...i,className:J(i.className)},o({children:i.children,oldValue:S}))})},ab=Nc();var Xe=K(require("react")),mr=require("react");var lb=require("react-dom");function sb(n){let[e,t]=Xe.useState(null);return(0,mr.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"?Xe.createElement(cb.Provider,{value:{getState:e}},Xe.createElement(Mw,null)):null}var cb=Xe.createContext({getState:()=>null});function Mw(){let n=Xe.useContext(cb),{getState:e}=n,[,t]=Ut(),o=e().renderer.cellManager;(0,mr.useEffect)(()=>{let s=Et(()=>{console.log("rerender"),t()},{wait:500});return o.onCellAttachmentChange(s)},[o,t]);let r=o.getRowsWithCells(),i=o.getColumnsWithCells(),a=(0,mr.useRef)(null),l=(0,mr.useRef)(null);return Xe.createElement("div",{style:{overflow:"auto"}},(0,lb.createPortal)(Xe.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),Xe.createElement("table",{style:{borderCollapse:"collapse"}},Xe.createElement("thead",null,Xe.createElement("tr",null,i.map(s=>Xe.createElement("th",{key:s,"data-col-index":s},s)))),Xe.createElement("tbody",null,r.map(s=>Xe.createElement("tr",{key:s,"data-row-index":s},i.map(c=>Xe.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},Xe.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 Aw={CheckBox:so,LoadMask:il,MenuIcon:kr,StringFilterEditor:Fn,NumberFilterEditor:_i};0&&(module.exports={CellSelectionState,DataClient,DataSource,DataSourceActionType,DeepMap,FixedSizeSet,FlashingColumnCell,GroupRowsState,INTERNAL_MatrixDebugger,InfiniteTable,InfiniteTableClassName,InfiniteTableComponent,Menu,RowDetailCache,RowDetailState,RowDisabledState,RowSelectionState,TreeDataSource,TreeExpandState,TreeGrid,TreeSelectionState,WeakFixedSizeSet,alignNode,components,createFlashingColumnCellComponent,debounce,debug,defaultFilterTypes,eventMatchesKeyboardShortcut,filterDataArray,filterTypes,flatten,getComponentStateRoot,group,interceptMap,keyboardShortcuts,multisort,multisortNested,queryKeyToCacheKey,toTreeDataArray,useComponentState,useDataSourceInternal,useDataSourceSelector,useDataSourceState,useEffectWhen,useEffectWhenSameDeps,useEffectWithChanges,useEffectWithObject,useGridScroll,useInfiniteColumnCell,useInfiniteColumnEditor,useInfiniteColumnFilterEditor,useInfiniteHeaderCell,useInfinitePortalContainer,useLayoutEffectWithChanges,useManagedDataSource,useMasterRowInfo,useOverlay,useOverlayPortal,usePrevious,useRowInfoReducers,useVisibleColumnSizes,withSelectedLeafNodesOnly});
30
30
  //!collapsed || lazyLoad;