@infinite-table/infinite-react 9.0.0-canary.0 → 9.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -0
- package/index.dev.js +324 -56
- package/index.dev.mjs +324 -56
- package/index.js +8 -8
- package/index.mjs +8 -8
- package/package.json +2 -2
package/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
"use strict";var Iy=Object.create;var ui=Object.defineProperty;var Ry=Object.getOwnPropertyDescriptor;var wy=Object.getOwnPropertyNames;var vy=Object.getPrototypeOf,Py=Object.prototype.hasOwnProperty;var Dy=(o,e)=>()=>(e||o((e={exports:{}}).exports,e),e.exports),xy=(o,e)=>{for(var t in e)ui(o,t,{get:e[t],enumerable:!0})},Kc=(o,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of wy(e))!Py.call(o,r)&&r!==t&&ui(o,r,{get:()=>e[r],enumerable:!(n=Ry(e,r))||n.enumerable});return o};var B=(o,e,t)=>(t=o!=null?Iy(vy(o)):{},Kc(e||!o||!o.__esModule?ui(t,"default",{value:o,enumerable:!0}):t,o)),My=o=>Kc(ui({},"__esModule",{value:!0}),o);var on=Dy((WD,Bd)=>{"use strict";Bd.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 IR={};xy(IR,{AutoScroller:()=>un,CellSelectionState:()=>$e,DRAG_ITEM_ATTRIBUTE:()=>Rt,DataClient:()=>_c,DataSource:()=>KC,DataSourceActionType:()=>ng,DeepMap:()=>ee,DragDropProvider:()=>ki,DragInteractionTarget:()=>Un,DragList:()=>Vo,FixedSizeSet:()=>dl,FlashingColumnCell:()=>ry,GroupRowsState:()=>wt,INTERNAL_MatrixDebugger:()=>ay,InfiniteTable:()=>lo,InfiniteTableClassName:()=>Zt,InfiniteTableComponent:()=>Ub,Menu:()=>$t,RowDetailCache:()=>ir,RowDetailState:()=>Mt,RowDisabledState:()=>vt,RowSelectionState:()=>_e,TreeDataSource:()=>gR,TreeExpandState:()=>st,TreeGrid:()=>Xb,TreeSelectionState:()=>et,WeakFixedSizeSet:()=>fl,alignNode:()=>Ya,components:()=>CR,createDefaultProxy:()=>ms,createFlashingColumnCellComponent:()=>Oc,debounce:()=>Ot,debug:()=>Ue,defaultDragProxyMove:()=>gs,defaultFilterTypes:()=>No,eventMatchesKeyboardShortcut:()=>$a,filterDataArray:()=>$s,filterTypes:()=>No,flatten:()=>nm,getComponentStateRoot:()=>Ft,group:()=>ba,interceptMap:()=>Qb,keyboardShortcuts:()=>Zb,multisort:()=>oo,multisortNested:()=>Sa,queryKeyToCacheKey:()=>vn,toTreeDataArray:()=>sm,useComponentState:()=>Lt,useDataSourceApi:()=>og,useDataSourceInternal:()=>rr,useDataSourceSelector:()=>Ae,useDataSourceState:()=>La,useDragDropProvider:()=>uo,useDragListContext:()=>dn,useEffectWhen:()=>gl,useEffectWhenSameDeps:()=>Jb,useEffectWithChanges:()=>Sn,useEffectWithObject:()=>NC,useGridScroll:()=>rl,useInfiniteColumnApi:()=>Bb,useInfiniteColumnCell:()=>Fr,useInfiniteColumnEditor:()=>ji,useInfiniteColumnFilterEditor:()=>kn,useInfiniteHeaderCell:()=>Dr,useInfinitePortalContainer:()=>mb,useInfiniteTableApi:()=>Kb,useLayoutEffectWithChanges:()=>OC,useManagedDataSource:()=>tc,useMasterRowInfo:()=>xo,useOverlay:()=>io,useOverlayPortal:()=>Sh,usePrevious:()=>Ao,useRowInfoReducers:()=>BC,useVisibleColumnSizes:()=>ab,withSelectedLeafNodesOnly:()=>Ac});module.exports=My(IR);function Ot(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=B(require("react"));var te=(...o)=>o.filter(e=>!!`${e}`).join(" ");var Jo=B(require("react")),xl=require("react");var Ey=B(require("react")),vo=require("react");var Dn=(o,e,t={debounce:0})=>{let n=t.debounce??0,r=window.ResizeObserver,i=n?Ot(e,{wait:n}):e,a=new r(l=>{let s=l[0],{width:c,height:u}=s.contentRect;if(s.borderBoxSize?.[0])u=s.borderBoxSize[0].blockSize,c=s.borderBoxSize[0].inlineSize;else{let d=o.getBoundingClientRect();u=d.height,c=d.width}i({width:c,height:u})});return a.observe(o),()=>{a.disconnect()}};var di=(o,e,t={earlyAttach:!1,debounce:0})=>{let n=(0,vo.useRef)({width:0,height:0}),r=i=>{let a;return o.current&&(a=Dn(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,vo.useEffect)(()=>t.earlyAttach?()=>{}:r(e),[o.current,e,t.earlyAttach,t.debounce]),(0,vo.useLayoutEffect)(()=>t.earlyAttach?r(e):()=>{},[o.current,e,t.earlyAttach])};function Ie(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 pt(o){let e=!1,t=null;return(...r)=>(e||(e=!0,t=o(...r)),t)}var Bc=(o,e)=>o-e;var pi=(o,e)=>Bc(o.revision,e.revision),ee=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,p)=>{let f=r.get(p);if(!f)return;let{map:m}=f,g=p===this.emptyKey;if(g&&!c)return;let b=g?[]:[...e,p],h=m?()=>this.visitWithNext(b,t,n,m,i!==void 0?i-1:void 0):void 0;if(f.hasOwnProperty("value")){let y=t(f.value,b,l,h,f);if(n&&y===!0)return!0;l++}else h?.()};s&&(u(void 0,this.emptyKey),c=!1,l=0);for(let[d,p]of r){let f=u(p,d);if(n&&f===!0)return f}};this.fill(e)}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(pi).map(t):a}getKeysForLeafNodesStartingWith(e,t){return this.getLeafNodesStartingWith(e,n=>n.keys,t)}getKeysAndValuesForLeafNodesStartingWith(e,t){return this.getLeafNodesStartingWith(e,n=>[n.keys,n.value],t)}getKeysOfFirstChildOnEachBranchStartingWith(e,t){let{excludeSelf:n,depthLimit:r,respectOrder:i=!0}=t||{},a=[],l=[],s=p=>{i?a.push(p):l.push(p.keys)},c=this.map,u,d=!1;if(e.length)for(let p=0,f=e.length;p<f;p++){let m=e[p];if(u=c.get(m),!u||!u.map)if(d=!0,p===f-1){d=!0;break}else return[];c=u.map}else if(!n&&c.has(this.emptyKey))return[[]];return u&&u.value!==void 0&&(n||(s({...u,keys:e}),d=!0)),d?i?a.sort(pi).map(p=>p.keys):l:(this.visitWithNext(e,(p,f,m,g,b)=>{s({...b,keys:f})},!1,c,r,n),i?a.sort(pi).map(p=>p.keys):l)}getKeysStartingWith(e,t){let n=[];return this.getStartingWith(e,r=>{n.push(r)},t),n}getStartingWith(e,t,n){let{excludeSelf:r,depthLimit:i}=n||{},a=this.map,l,s=!1;if(e.length)for(let c=0,u=e.length;c<u;c++){let d=e[c];if(l=a.get(d),!l||!l.map)if(s=!0,c===u-1){s=!0;break}else return;a=l.map}l&&l.value!==void 0&&(r||t(e,l.value,{...l,keys:e})),!s&&this.visitWithNext(e,(c,u,d,p,f)=>{t(u,c,{...f,keys:u}),p?.()},!1,a,i,r)}getMapAt(e){let t=this.map,n;if(!e.length)return this.map;for(let r=0,i=e.length;r<i;r++){let a=e[r];if(n=t.get(a),!n||!n.map)return;t=n.map}return t}getAllChildrenSizeFor(e){let t=this.map,n;if(!e.length)return this.length;for(let r=0,i=e.length;r<i;r++){let a=e[r];if(n=t.get(a),!n||!n.map)return 0;t=n.map}return n.length}getDirectChildrenSizeFor(e){let t=this.map;e.length||(e=[this.emptyKey]);for(let n=0,r=e.length;n<r;n++){let i=e[n],a=n===r-1,l=t.get(i);if(!l||!l.map)return 0;if(t=l.map,a)return t?.size??0}return 0}set(e,t){let n=this.map;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=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((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(pi);function*n(){for(let r=0,i=t.length;r<i;r++)yield e(t[r])}return n()}};globalThis.DeepMap=ee;function Me(){return globalThis}var mi=["#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"],Wc=Symbol("color"),fi=new WeakMap,Cl=Ie();function Il(o=mi){fi.set(o,o.map(e=>0))}Il();var Ay=(o=mi)=>{let e=[];fi.has(o)?e=fi.get(o):(e=o.map(n=>0),fi.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]??mi[0]},Sr=":",Rl="*",jc="-",_y=",",Oy="debug",Ny="diffdebug",Uc=!1,yr=new ee,Tr=new Map;function wl(o,e){let t=o.split(Sr),n=new ee;n.set(t,!0);let r=e.split(Sr),i=new Set(r).has(Rl),a=r.indexOf(Rl),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(Sr)):!0}}function Yc(o,e){let t=`channel=${o}_permissions=${e}`;if(Tr.has(t))return Tr.get(t);let n=e.split(_y);function r(l){return Tr.set(t,l),l}let i=[],a=[];n.forEach(l=>{l.includes(Rl)?a.push(l):i.push(l)});for(let l=0;l<i.length;l++){let s=i[l],c=s.startsWith(jc);if(c&&(s=s.substring(jc.length)),wl(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)),wl(o,s))return r(!c)}return r(!1)}var vl=()=>Ue.enable??(Me()&&Me().localStorage?.getItem(Oy))??"",Fy=()=>Ue.diffenable??(Me()&&Me().localStorage?.getItem(Ny))??`${Uc}`,Pl="",qc=Uc;function Dl(o){qc=`${Fy()}`=="true",Pl!==o&&(Pl=o,Tr.clear())}function Xc(o){Dl(vl()),typeof Me()<"u"&&Me().addEventListener&&Me().addEventListener("storage",function(){Dl(vl())});function e(t,n){let r=n?`${n}${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)??Zc,c=s,u,d=0,p=()=>u??Yc(r,Pl),f=Ay(Ue.colors),m=Object.defineProperties((...g)=>{let b=Cl.getListenersCount(),h;if(b>0&&(h=h??Date.now(),Cl({color:f,channel:r,args:g,timestamp:h})),p()){if(h=h??Date.now(),d&&qc){let T=h-d;c(`%c[${r}]`,`color: ${f}`,`+${T}ms:`)}d=h;let y=[],S;if(g.forEach(T=>{if(T[Wc])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: ${f}`,"",...y,""];c(...T)}else c(`%c[${r}]%c %s`,`color: ${f}`,"",...g)}},{channel:{value:r},color:{value:(g,...b)=>{let h=[`%c${b.join(" ")}%c%s`,`color: ${g}`,""];return h.toString=()=>b.join(" "),h[Wc]=!0,h}},extend:{value:g=>e(g,r)},enabled:{get:()=>p(),set:g=>{u=g}},logFn:{configurable:!1,get:()=>c,set:g=>{c=g??s}},destroy:{value:()=>{yr.delete(i)}}});return yr.set(i,m),m}return e(o)}var Zc=console.log.bind(console),$c;Object.defineProperty(Xc,"enable",{get:()=>$c,set:o=>{$c=o,Dl(vl())}});var Ue=Xc;Ue.colors=mi;Ue.logFn=Zc;var Ly=(o,e)=>Cl.onChange(t=>{if(!t)return;let{channel:n,args:r,color:i,timestamp:a}=t;wl(n,o)&&e({channel:n,color:i,args:r,timestamp:a})});Ue.onLogIntent=Ly;Ue.isChannelEnabled=Yc;Ue.destroyAll=()=>{Il(),Il(Ue.colors),yr.clear(),Tr.clear()};var Nt=o=>{let e=Ue(o?`IT:${o}:TYPE=debug`:"IT:TYPE=debug");return e.logFn=console.log.bind(console),e},Po=o=>{let e=Ue(o?`IT:${o}:TYPE=error`:"IT:TYPE=error");return e.logFn=console.error.bind(console),e},Cr=()=>Cr;Cr.extend=()=>Cr;var yt=class{constructor(e){this.debug=Cr,this.error=Cr}};var Qc=Po("CSSVariableWatch"),Jc=Nt("CSSVariableWatch"),eu={position:"absolute",pointerEvents:"none",width:"0px",height:"0px",lineHeight:0,fontSize:0,overflow:"hidden"};var ky=o=>{let e=(0,xl.useRef)(0),t=Jo.useCallback(({height:n})=>{n!=null&&n!==e.current&&(e.current=n,o.onChange(n))},[o.onChange]);di(o.ref,t,{earlyAttach:!0}),Jo.useLayoutEffect(()=>{let n=o.ref.current.getBoundingClientRect().height;if(n!=null)return e.current=n,Jc(`Variable ${o.varName} found and equals ${n}.`),o.onChange(n);Qc(`Specified variable ${o.varName} not found or does not have a numeric value.`)},[])},Ir=o=>{let e=(0,xl.useRef)(null);ky({...o,ref:e});let t=o.varName.startsWith("var(")?o.varName:`var(${o.varName})`,{allowInts:n=!1}=o;return Jo.createElement("div",{"data-name":"css-variable-watcher","data-var":o.varName,style:eu},Jo.createElement("div",{ref:e,style:{height:n?`calc(1px * ${t})`:t}}))};var En=require("react");function Do(){let o=null,e=new Set;return{getSnapshot(){return o},setSnapshot(t){o=t},subscribe(t){return e.add(t),()=>{e.delete(t)}},notify(){for(let t of e)t()}}}var so=require("react");function St(o,e,t){if(o===e)return!0;if(!o||!e)return!1;let n=typeof o;if(n!==typeof e||n!=="object")return!1;var i=Object.keys(o),a=Object.keys(e);t&&(i=i.filter(u=>!t.has(u)),a=a.filter(u=>!t.has(u)));var l=i.length;if(a.length!==l)return!1;for(var s=0;s<l;s++){var c=i[s];if(!(t&&t.has(c))&&(o[c]!==e[c]||!Object.prototype.hasOwnProperty.call(e,c)))return!1}return!0}function tu(o,e,t){let n=(0,so.useRef)(e);n.current=e;let r=(0,so.useRef)(t);r.current=t;let i=(0,so.useRef)(void 0),a=(0,so.useRef)(!1),l=(0,so.useCallback)(()=>{let s=o.getSnapshot(),c=n.current(s);return a.current&&r.current(i.current,c)?i.current:(i.current=c,a.current=!0,c)},[o]);return(0,so.useSyncExternalStore)(o.subscribe,l,l)}function gi(o,e){return tu(o,e,Object.is)}function xn(o,e){return tu(o,e,St)}var ou=B(require("react")),Ml;function Mn(){return Ml||(Ml=ou.createContext(null))}var nu=Do(),ru=()=>{};function hi(){let o=Mn();return(0,En.useContext)(o)||void 0}function bi(){let o=hi();return(0,En.useCallback)(()=>o?.getSnapshot(),[o])}function co(o){let e=Mn(),t=(0,En.useContext)(e),n=xn(t||nu,t?o:ru);return t?n??void 0:void 0}function xo(){let o=Mn(),e=(0,En.useContext)(o),n=gi(e||nu,e?r=>r.masterRowInfo:ru);return e?n:void 0}var An=B(require("react")),Je=require("react");function Mo(o){if(o==null)return!1;let e=o;return!0}var Eo=require("react");var yi=require("react"),Ut=()=>{let[o,e]=(0,yi.useState)(0);return[o,(0,yi.useCallback)(()=>{e(t=>t+1)},[e])]};var iu=o=>{let e=(0,Eo.useCallback)(o,[]),t=(0,Eo.useRef)(!1),n=(0,Eo.useRef)(!1),r=(0,Eo.useRef)(void 0),[i,a]=Ut();t.current&&(n.current=!0),(0,Eo.useEffect)(()=>(t.current||(r.current=e,t.current=!0),a(),()=>{n.current&&r.current&&r.current()}),[])};var Si=require("react");function Oe(o){let e=(0,Si.useRef)(o);return e.current=o,(0,Si.useCallback)(()=>e.current,[])}var Ti=require("react"),Ao=(o,e)=>{let t=(0,Ti.useRef)(e===void 0?o:e);return(0,Ti.useLayoutEffect)(()=>{t.current=o}),t.current};var Rr={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 El=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(Rr).reduce((t,n)=>{let r={start:e.start,end:i=>e.end({...i,track:Rr[n].track,label:i.label}),get label(){let i=Rr[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=Rr[n];return e.markerDetails.track=i.track,r}}),t},{})}};function nt(o){return El.create(o)}function au(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 Al=o=>o&&o.substr(0,1).toUpperCase()+o.substr(1);function wr(o){return o!==void 0}function _o(o,e){let t=e[o];return wr(t)}var lu=(o,e,t)=>{let n=o[e];typeof n=="function"&&n(...t)};function zy(o,e,t){let n={};for(let r in o)if(o.hasOwnProperty(r)){let i=o[r],a=_o(r,e)?e[r]:e[`default${Al(r)}`];typeof i=="function"&&(a=i(a,t)),n[r]=a}return n}function su(o,e,t){let{fn:n,propertyReads:r}=au(o,{getProxyTargetFromArgs:a=>a.props,putProxyToArgs:(a,l)=>[{...l,props:a}]}),i=n(e);return r.forEach(a=>t.add(a)),i}function cu(o){let{props:e,initialSetupState:t,propsToForward:n,parentState:r,mapPropsToState:i,propsToStateSet:a}=o,l={};n&&(l=zy(n,e,t));let s={...t,...l};if(i){let c=su(i,{props:e,state:s,oldState:null,parentState:r},a);return{...s,...c}}return s}function uu(o,e,t){let{getProps:n,getParentState:r,mapPropsToState:i,concludeReducer:a,propsToStateSet:l}=t;if(e.type==="REPLACE_STATE")return e.payload;let s=r?.()??null,c=e.payload.mappedState,u=e.payload.updatedPropsToState,d={...o};if(c&&Object.assign(d,c),i){let f=su(i,{props:n(),state:d,oldState:o,parentState:s},l);Object.assign(d,f)}return e.type==="ASSIGN_STATE"&&Object.assign(d,e.payload),a?a({previousState:o,state:d,updatedProps:u,parentState:s}):d}function du(o){let{dispatch:e,getState:t,getProps:n,propsToForward:r,allowedControlledPropOverrides:i,interceptedActions:a,mappedCallbacks:l,notify:s=lu}=o,c=t();return Object.keys(c).reduce((u,d)=>{let p=d;return Object.defineProperty(u,d,{set:m=>{let g=n(),b=t(),h=!0;if(a&&typeof a[p]=="function"&&a[p](m,{actions:u,state:b})===!1&&(h=!1),h){let T=[m],C=`on${Al(d)}Change`;if(l&&l[p]){let I=l[p](m,b);C=I.callbackName||C,T=I.callbackParams}s(g,C,T)}let y=r[p];typeof y=="function"&&(m=y(m));let S=!!i?.[p];_o(d,g)&&!S||e({payload:{updatedProps:null,mappedState:{[d]:m}}})}}),u},{})}function pu(o){let{currentProps:e,prevProps:t,state:n,propsToForward:r,propsToStateSet:i}=o,a={},l=0,s={},c=0,u={},d=0;return new Set([...Object.keys(e),...Object.keys(t)]).forEach(f=>{let m=f,g=t[m],b=e[m];if(m!=="children"&&g!==b&&(u[m]={newValue:b,oldValue:g},d++,_o(m,e)||_o(m,t)))if(r.hasOwnProperty(f)){let h=b,y=r[f];typeof y=="function"&&(h=y(b)),n[m]!==h&&(a[m]=h,l++)}else i.has(f)&&(s[m]=e[m],c++)}),{newMappedState:a,newMappedStateCount:l,updatedPropsToState:s,updatedPropsToStateCount:c,rawUpdatedProps:u,rawUpdatedPropsCount:d}}var _l;function fu(){return _l||(_l=(0,Je.createContext)(null))}function Ft(o){let e=o.getParentState||(()=>null);function t(r){let[i]=(0,Je.useState)(()=>o.initSetupState?o.initSetupState(r):{}),a=(0,Je.useRef)(new Set),l=(0,Je.useMemo)(()=>o.forwardProps?o.forwardProps(i,r):{},[i]),s=e(),c=Oe(s);function u(){return cu({props:r,initialSetupState:i,propsToForward:l,parentState:s,mapPropsToState:o.mapPropsToState,propsToStateSet:a.current})}let[d]=(0,Je.useState)(u),p=Oe(r),f=(v,P)=>uu(v,P,{getProps:p,getParentState:()=>c?.()??null,mapPropsToState:o.mapPropsToState,concludeReducer:o.concludeReducer,propsToStateSet:a.current}),[m,g]=(0,Je.useReducer)(f,d),b=Oe(m),{allowedControlledPropOverrides:h}=o,y=(0,Je.useMemo)(()=>du({dispatch:g,getState:b,getProps:p,propsToForward:l,allowedControlledPropOverrides:h,interceptedActions:o.interceptActions,mappedCallbacks:o.mappedCallbacks}),[g,l,h]),S=o.Context??fu(),T=(0,Je.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=Ao(r),I=(0,Je.useRef)(!1);I.current=!1;let R=o.layoutEffect?Je.useLayoutEffect:Je.useEffect;return R(()=>{let v=r,{newMappedState:P,newMappedStateCount:w,updatedPropsToState:x,updatedPropsToStateCount:E,rawUpdatedProps:M,rawUpdatedPropsCount:D}=pu({currentProps:v,prevProps:C,state:m,propsToForward:l,propsToStateSet:a.current});if(E>0||w>0){let O=m.debugId,N=O?nt(O).track.ComponentState.label.PropUpdate.start():void 0,k=o.debugName?typeof o.debugName=="function"?`${o.debugName(v)}:rerender`:`${o.debugName}:rerender`:"rerender";Nt(k)("Triggered by new values for the following props",...Object.keys(P??{}),...Object.keys(x??{})),N&&N.end({label:k,details:[w>0?{name:"Updated properties",value:Object.keys(P).join(", ")}:void 0,E>0?{name:"Updated props",value:Object.keys(x).join(", ")}:void 0,E>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(Mo)});let V={payload:{mappedState:w?P:null,updatedPropsToState:E?x:null}};if(I.current=!0,g(V),o.onPropChange){for(var A in M)if(M.hasOwnProperty(A)){let{newValue:j,oldValue:L}=M[A];o.onPropChange({name:A,newValue:j,oldValue:L},r,y,m)}}o.onPropsChange&&D&&o.onPropsChange(M,r,y,m)}}),R(()=>{s!=null&&!I.current&&g({type:"PARENT_STATE_CHANGE",payload:{}})},[s]),iu(()=>()=>{o.cleanup?.(b())}),{contextValue:T,ContextComponent:S}}return{ManagedComponentContextProvider:An.memo(function(i){let{contextValue:a,ContextComponent:l}=t(i);return An.createElement(l.Provider,{value:a},i.children)}),useManagedComponent:t}}function Lt(o){return o=o??fu(),An.useContext(o)}var Pu=B(require("react"));var ft="Infinite",ke={rootClassName:ft};var Ci=()=>ke;var mu="_16lm1iw2 _16lm1iw23 _16lm1iw26 _16lm1iw2c _16lm1iw2a",gu={center:"_16lm1iw2j",stretch:"_16lm1iw2k",start:"_16lm1iw2l",end:"_16lm1iw2m"};var Yt="_16lm1iw3b _16lm1iw3c _16lm1iw35",hu={pointer:"_16lm1iwk",default:"_16lm1iwl",colResize:"_16lm1iwm",grabbing:"_16lm1iwn",grab:"_16lm1iwo"},_n={flex:"_16lm1iw1p",contents:"_16lm1iw1q",none:"_16lm1iw1r",block:"_16lm1iw1s",grid:"_16lm1iw1t",inlineBlock:"_16lm1iw1u",inlineFlex:"_16lm1iw1v",inlineGrid:"_16lm1iw1w"};var Ii={1:"_16lm1iw1c",none:"_16lm1iw1d"},vr={column:"_16lm1iw2f",columnReverse:"_16lm1iw2g",row:"_16lm1iw2h",rowReverse:"_16lm1iw2i"};var bu={0:"_16lm1iw1y","100%":"_16lm1iw1z","50%":"_16lm1iw20"},yu={center:"_16lm1iw30",spaceBetween:"_16lm1iw31",spaceAround:"_16lm1iw32",start:"_16lm1iw33",end:"_16lm1iw34"},Su={0:"_16lm1iw26","100%":"_16lm1iw27","50%":"_16lm1iw28",auto:"_16lm1iw29"};var Tu={none:"_16lm1iwd"},Cu={hidden:"_16lm1iw35",auto:"_16lm1iw36",visible:"_16lm1iw37"};var Ri={relative:"_16lm1iw1",absolute:"_16lm1iw2",static:"_16lm1iw3",sticky:"_16lm1iw4",fixed:"_16lm1iw5"};var Iu={0:"_16lm1iw23","100%":"_16lm1iw24","50%":"_16lm1iw25"};var Ru={none:"_16lm1iw1x"};var wu={visible:"_16lm1iw38",hidden:"_16lm1iw39"};var vu={1:"_16lm1iw1e",10:"_16lm1iw1f",100:"_16lm1iw1g",1e3:"_16lm1iw1h",1e4:"_16lm1iw1i",1e5:"_16lm1iw1j",1e6:"_16lm1iw1k",1e7:"_16lm1iw1l","1k":"_16lm1iw1m","10k":"_16lm1iw1n","100k":"_16lm1iw1o"};function Du(o){let{rootClassName:e}=Ci();return Pu.createElement("div",{...o,className:te(`${e}Footer`,Ri.relative,_n.flex,vr.row,o.className)})}var Ee=B(require("react")),bo=require("react"),$f=require("react-dom");function wi(o){let e={};return Object.keys(o).forEach(t=>{e[t]=t}),e}function Q(o){return o.slice(4,-1)}var xu=B(require("react")),ze=o=>{let e=o.size??"var(--infinite-icon-size)",t={flex:"none",width:e,height:e,fill:"currentColor",...o.style};return xu.createElement("svg",{viewBox:"0 0 24 24",...o,style:t},o.children)};var Ol=B(require("react"));var Ve={includesOperator:["M11.14 4L6.43 16H8.36L9.32 13.43H14.67L15.64 16H17.57L12.86 4H11.14M12 6.29L14.03 11.71H9.96L12 6.29","M4 18V15H2V20H22V18Z","M20 14V18H2V20H22V14Z"],startsWithOperator:["M11.14 4L6.43 16H8.36L9.32 13.43H14.67L15.64 16H17.57L12.86 4M12 6.29L14.03 11.71H9.96M4 18V15H2V20H22V18Z"],endsWithOperator:["M11.14 4L6.43 16H8.36L9.32 13.43H14.67L15.64 16H17.57L12.86 4M12 6.29L14.03 11.71H9.96M20 14V18H2V20H22V14Z"],eqOperator:["M19,10H5V8H19V10M19,16H5V14H19V16Z"],neqOperator:["M21,10H9V8H21V10M21,16H9V14H21V16M4,5H6V16H4V5M6,18V20H4V18H6Z"],gtOperator:["M5.5,4.14L4.5,5.86L15,12L4.5,18.14L5.5,19.86L19,12L5.5,4.14Z"],gteOperator:["M6.5,2.27L20,10.14L6.5,18L5.5,16.27L16.03,10.14L5.5,4L6.5,2.27M20,20V22H5V20H20Z"],ltOperator:["M18.5,4.14L19.5,5.86L8.97,12L19.5,18.14L18.5,19.86L5,12L18.5,4.14Z"],lteOperator:["M18.5,2.27L5,10.14L18.5,18L19.5,16.27L8.97,10.14L19.5,4L18.5,2.27M5,20V22H20V20H5Z"],done:["m9.55 19-6.725-6.725L5.25 9.85l4.3 4.325 9.225-9.225 2.425 2.4Z"],hidden:["m644-428-58-58q9-47-27-88t-93-32l-58-58q17-8 34.5-12t37.5-4q75 0 127.5 52.5T660-500q0 20-4 37.5T644-428Zm128 126-58-56q38-29 67.5-63.5T832-500q-50-101-143.5-160.5T480-720q-29 0-57 4t-55 12l-62-62q41-17 84-25.5t90-8.5q151 0 269 83.5T920-500q-23 59-60.5 109.5T772-302Zm20 246L624-222q-35 11-70.5 16.5T480-200q-151 0-269-83.5T40-500q21-53 53-98.5t73-81.5L56-792l56-56 736 736-56 56ZM222-624q-29 26-53 57t-41 67q50 101 143.5 160.5T480-280q20 0 39-2.5t39-5.5l-36-38q-11 3-21 4.5t-21 1.5q-75 0-127.5-52.5T300-500q0-11 1.5-21t4.5-21l-84-82Zm319 93Zm-151 75Z"],clear:["M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"]};var Mu=o=>Ol.createElement(ze,{...o},Ve.includesOperator.map(e=>Ol.createElement("path",{key:e,d:e})));var Nl=B(require("react"));var Eu=o=>Nl.createElement(ze,{...o},Nl.createElement("path",{d:Ve.endsWithOperator[0]}));var Fl=B(require("react"));var Au=o=>Fl.createElement(ze,{...o},Fl.createElement("path",{d:Ve.eqOperator[0]}));var Ll=B(require("react"));var _u=o=>Ll.createElement(ze,{...o},Ll.createElement("path",{d:Ve.gteOperator[0]}));var kl=B(require("react"));var Ou=o=>kl.createElement(ze,{...o},kl.createElement("path",{d:Ve.gtOperator[0]}));var zl=B(require("react"));var Nu=o=>zl.createElement(ze,{...o},zl.createElement("path",{d:Ve.lteOperator[0]}));var Vl=B(require("react"));var Fu=o=>Vl.createElement(ze,{...o},Vl.createElement("path",{d:Ve.ltOperator[0]}));var Gl=B(require("react"));var Lu=o=>Gl.createElement(ze,{...o},Gl.createElement("path",{d:Ve.neqOperator[0]}));var Hl=B(require("react"));var ku=o=>Hl.createElement(ze,{...o},Hl.createElement("path",{d:Ve.startsWithOperator[0]}));var Xl=B(require("react"));var lt=B(require("react")),Pr=require("react");var On=B(require("react")),en=require("react");function Vy(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 Gy(o){var e=Vy(o,"string");return typeof e=="symbol"?e:String(e)}function Hy(o,e,t){return e=Gy(e),e in o?Object.defineProperty(o,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):o[e]=t,o}function zu(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 Vu(o){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?zu(Object(t),!0).forEach(function(n){Hy(o,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(t)):zu(Object(t)).forEach(function(n){Object.defineProperty(o,n,Object.getOwnPropertyDescriptor(t,n))})}return o}function Gu(o,e){var t={};for(var n in o)t[n]=e(o[n],n);return t}var Ky=(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},ye=o=>{var e=t=>{var n=o.defaultClassName,r=Vu(Vu({},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)Ky(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 Gu(o.variantClassNames,t=>Gu(t,n=>n.split(" ")[0]))}},e};var Hu="_1eexc2a6";var Ku=ye({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:[]}),Bu="_12zfob1q _16lm1iw2 _16lm1iw1k _16lm1iw3b _16lm1iw3c _16lm1iw35",Wu=ye({defaultClassName:"_16lm1iw2 _16lm1iw25 _16lm1iw26 _16lm1iwh _16lm1iwf",variantClassNames:{visible:{true:"_12zfob19",false:"_12zfob1a"}},defaultVariants:{},compoundVariants:[]}),ju=ye({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"]]}),$u=ye({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"]]}),Uu="_12zfob12u _16lm1iw22 _16lm1iw1z";var Yu="_12zfob17",qu="_12zfob12q _16lm1iw1p _16lm1iw2h _16lm1iw2j _16lm1iw1",Xu=ye({defaultClassName:"_12zfob12r _16lm1iw1 _16lm1iw23",variantClassNames:{disabled:{true:"_12zfob12s",false:"_12zfob12t"}},defaultVariants:{},compoundVariants:[]}),Kl=ye({defaultClassName:"_12zfob12n _16lm1iw1p _16lm1iw2h _16lm1iw2k _16lm1iw1",variantClassNames:{active:{true:"_12zfob12o",false:"_12zfob12p"}},defaultVariants:{},compoundVariants:[]}),Zu="_12zfob12m _16lm1iw1p _16lm1iw2h _16lm1iw2j",Qu=ye({defaultClassName:"_12zfob127 _16lm1iw1 _16lm1iw1p _16lm1iw2f _16lm1iw32 _16lm1iw39",variantClassNames:{menuVisible:{true:"_12zfob128"},reserveSpaceWhenHidden:{true:"_12zfob129",false:"_12zfob12a"}},defaultVariants:{},compoundVariants:[[{menuVisible:!0,reserveSpaceWhenHidden:!1},"_12zfob12b"]]}),Ju="_12zfob1b _16lm1iw2",ed="_16lm1iw1",td="_12zfob16",od=ye({defaultClassName:"_12zfob12",variantClassNames:{align:{start:"_12zfob13",center:"_12zfob14",end:"_12zfob15"}},defaultVariants:{},compoundVariants:[]}),nd="_12zfob12l _16lm1iw35 _16lm1iw1 _16lm1iw1p _16lm1iw2h";var Dt="InfiniteIcon";var rd="_1nnkya20 _16lm1iw1p _16lm1iw2f _16lm1iw1 _16lm1iw32 _16lm1iw2j";var id={transition:"width 0.25s, opacity 0.25s"},rP=Object.keys({size:1,lineWidth:1,lineStyle:1,style:1,className:1,index:1});function Nn(o){let[e,t]=(0,en.useState)(!0),[n,r]=(0,en.useState)(0),{lineWidth:i=1,style:a,className:l,index:s}=o,c=s!=null&&s>0,u=o.size??16,d=Math.floor(u/4),p=[u-1*d,u-2*d,u-3*d],f={...id,borderTop:`${i}px solid currentColor`,...o.lineStyle,opacity:n};if((0,en.useEffect)(()=>{if(!e)return;let g=requestAnimationFrame(()=>{r(1)});return()=>{cancelAnimationFrame(g)}},[e]),(0,en.useLayoutEffect)(()=>{t(!0)},[]),!e)return null;let m={};return On.createElement("div",{"data-name":"filter-icon",style:{...a,width:u},className:te(l,Dt,rd,`${Dt}-filter`)},c?On.createElement("div",{"data-name":"index",style:m,className:Yu},s):null,On.createElement("div",{style:{width:p[0],...f}}),On.createElement("div",{style:{width:p[1],...f}}),On.createElement("div",{style:{width:p[2],...f}}))}var Bl=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((R,v)=>{let P=R.maxSize??r??void 0,w=R.minSize??n??void 0;s.push(w),c.push(P),R.size!=null&&(P!=null&&R.size>P&&(R.size=P),w!=null&&R.size<w&&(R.size=w));let x=R.flex==0?null:R.flex;if(R.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+=R.size??0});let u=o.computeSpecialSpaceDistribution?Math.max(e,0):Math.max(e-i,0),d=u/a,p={},f={},m=0;t.forEach((R,v)=>{if(R.flex!=null){let P=d*R.flex,w=R.maxSize??r??void 0,x=R.minSize??n??void 0,E=!1,M=0;w!=null&&P>w&&(p[v]=!0,E=!0,M=w),x!=null&&P<x&&(f[v]=!0,E=!0,M=x),E&&(m+=1,l-=1,a-=R.flex,u-=M)}}),m&&(d=u/a);let g=[],b=0,h=u,y=a,S=0,T=0,C=[];return{items:t.map((R,v)=>{let P={...R},w=R.maxSize??r??void 0,x=R.minSize??n??void 0,E=0,M=p[v],D=f[v],A=M||D,O=R.size??0;if(R.flex!=null){if(A)D&&(E=x),M&&(E=w);else{b+=1;let N=k=>(w!=null&&k>w&&(k=w),x!=null&&k<x&&(k=x),k);b===l?E=N(h):(E=N(Math.round(R.flex*d)),T+=E,h=u-T,y-=R.flex,d=h/y)}O=E,P.flexSize=E}return g.push(E),C.push(O),P.computedSize=O,S+=O,P}),flexSizes:g,minSizes:s,maxSizes:c,computedSizes:C,remainingSize:Math.round(e-S)}};function vi(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 Wl=o=>{let{availableSize:e,reservedWidth:t=0}=o,n=Object.keys(o.columnSizing).reduce((w,x)=>(w[x]={...o.columnSizing[x]},w),{});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,p=l.computedMinWidth,f=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:I,clamped:R,diff:v}=vi(d+r,p,f,C);if(o.shareSpaceOnResize){if(s==null)return n[c]={...n[c],[m]:I},T=R==="min",S=R==="max",{adjustedDiff:I-d,reservedWidth:t,columnSizing:n,minReached:T,maxReached:S,constrained:T||S};let{value:w,clamped:x,diff:E}=vi(g-r,b,h,C);if(R&&x&&(Math.abs(v)>Math.abs(E)?x=!1:R=!1),!(!R&&!x)){if(R){let M=vi(g-r-v,b,h,C);w=M.value,x=M.clamped,E=M.diff}else if(x){let M=vi(d+r+E,p,f,C);I=M.value,R=M.clamped,v=M.diff}}n[c]={...n[c],[m]:I},n[u]={...n[u],[y]:w},T=R==="min"||x==="min",S=R==="max"||x==="max"}else n[c]={...n[c],[m]:I},T=R==="min",S=R==="max";let P=I-d;return{adjustedDiff:P,reservedWidth:o.shareSpaceOnResize?t:t-P,columnSizing:n,minReached:T,maxReached:S,constrained:T||S}};function ad(o,e){return o+e}function By(o){return Object.keys(o).reduce((t,n)=>(t[n]={...o[n]},t),{})}var ld=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}=Bl({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(ad,0)+r-c,0)}),d=a.map((h,y)=>u[y]-h.computedWidth),p=!0,f=!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],I=By(n),{maxReached:R,minReached:v,constrained:P,adjustedDiff:w}=Wl({availableSize:o.availableSize,reservedWidth:o.reservedWidth,dragHandleOffset:h,dragHandlePositionAfter:i[y],shareSpaceOnResize:!1,items:o.items,columnSizing:I});n[S.id]={...I[S.id],[T]:C+w},g.push(w),R||(f=!1),v||(p=!1),P||(m=!1)});let b=g.reduce(ad,0);return{minReached:p,maxReached:f,constrained:m,adjustedDiffs:g,adjustedDiff:b,columnSizing:n,reservedWidth:t-b}};var Pi;function Oo(){if(Pi!=null)return Pi;let o=Me().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),Pi=e.offsetWidth-t.offsetWidth,e.parentNode?.removeChild(e),Pi}var sd=["start",void 0,"end"],cd=(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:sd.indexOf(r)-sd.indexOf(i)}),o);function ud(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 jl(o,...e){return ud(t=>t!=null,o,...e)}function dd(o,e,...t){return ud((n,r)=>!(r in o),e,...t)}var Di=Object.freeze({}),Wy={string:Di,number:{}};function $l(o,e){let t=e.default||Di;return o.type===void 0?t:o.type===null?Di:typeof o.type=="string"?e[o.type]||Wy[o.type]||Di:o.type.reduce((n,r)=>Object.assign(n,e[r]),{})}var xi=!0,jy=!0,$y=!0,Uy="string",Fn="unknown",Yy=Po("getComputedVisibleColumns"),qy=(o,e,t)=>o[t]!==!1,Ul=(o,e)=>{if(!e)return!1;let t=e[o];return t==="start"||t===!0?"start":t==="end"?"end":!1},pd=({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:p,sortInfo:f,multiSort:m,filterTypes:g=No,viewportReservedWidth:b,resizableColumns:h,draggableColumns:y,columnDefaultDraggable:S,columnOrder:T,columnPinning:C,editable:I,columnDefaultEditable:R,columnDefaultFilterable:v,columnDefaultGroupable:P,columnDefaultSortable:w,columnSizing:x,columnTypes:E,columnVisibility:M,columnVisibilityAssumeVisible:D,groupBy:A})=>{let O=0,N={};A.forEach((K,ae)=>{K.field&&(N[K.field]=ae)});let k=(d||[]).reduce((K,ae)=>{let{id:fe,field:Se}=ae;return Se&&(K[Se]=ae),fe&&(K[fe]=ae),K},{}),F=cd(T===!0?Object.keys(o):T,C),V=F.filter(K=>o[K]?qy(M,D,K):(Yy(`Column with id "${K}" specified in columnOrder array cannot be found in the columns map.`),!1)),j=new Map,L=V.map((K,ae)=>{let fe=o[K];return j.set(K,ae),fe}),U=(f??[]).reduce((K,ae,fe)=>(ae.id?K[ae.id]={sortInfo:ae,index:fe}:ae.field&&(K[ae.field]={sortInfo:ae,index:fe}),K),{});function H(K){let ae=o[K],fe=$l(ae,E),Se={minWidth:fe?.minWidth,maxWidth:fe?.maxWidth,width:fe?.defaultWidth,flex:fe?.defaultFlex},qe=jl({width:ae?.defaultWidth,flex:ae?.defaultFlex,minWidth:ae?.minWidth,maxWidth:ae?.maxWidth},x[K]);qe.width!=null&&delete Se.flex,qe.flex!=null&&delete Se.width,qe=jl(Se,qe);let pe=qe.flex??void 0,Z=qe.minWidth??ae?.minWidth??t,at=qe.maxWidth??ae?.maxWidth??n,le=pe!=null?void 0:qe.width??(i?void 0:r);return!le&&pe==null&&(i?pe=i:le=Z),{size:le,flex:pe,minSize:Z,maxSize:at}}let q=Bl({availableSize:Math.max(e.width-(b??0)-(a??Oo()),0),maxSize:n,minSize:t,items:V.map(H)}),{computedSizes:ne,flexSizes:se,minSizes:me,maxSizes:ie}=q,ue=[],ce=[],Y=[],z=[];z.length=V.length;let $=new Map,X=new Map,W=0,re=0,he=0,be=null,G=[],_=0,de=0,Te=0;L.forEach((K,ae)=>{let fe=V[ae],Se=ne[ae],qe=G[ae]=Ul(fe,C);qe==="start"?_+=Se:qe==="end"?Te+=Se:de+=Se});let xe=e.width-Te,Ce=[],Ne=new Map;V.forEach((K,ae)=>{let fe=L[ae];Ne.set(K,fe)});let Le=[];Object.keys(o).forEach(K=>{let ae=o[K];Le.push(K),Ne.has(K)||Ne.set(K,ae)});let He=new Map;Ne.forEach((K,ae)=>{let fe=j.get(ae);fe==null&&(fe=-1);let Se=fe!=-1,qe=V[fe+1],pe=$l(K,E),Z=fe,at=U[ae]?U[ae]:K.field?U[K.field]??null:null,le=at?.sortInfo??null,Fe=!!le,dt=Fe&&le.dir===1,bt=Fe&&!dt,Nc=at?.index??-1,hl=Se?{}:H(ae),Fc=Se?ne[fe]:hl.size||0,sy=Se&&se[fe]||null,cy=Se?me[fe]||0:hl.minSize||0,uy=Se?ie[fe]||1e4:hl.maxSize||1e4,Pt=Se?Ul(ae,C):!1,Lc=Se?fe===V.length-1:!1,si=Z,dy=Se?Pt==="start"?re:Pt==="end"?he:O-re:0;Pt=="start"?si=Se?Z:-1:Pt==="end"?si=Se?Z-(ue.length+Y.length):-1:si=Se?Z-ue.length:-1;let py=Se?Pt==="start"||Pt===!1?O:xe+he:-1,fy=Se?Pt!==be:!1,my=Se?Lc||Pt!==Ul(qe,C):!1,kc=K.cssEllipsis??pe.cssEllipsis??l,gy=K.headerCssEllipsis??pe.cssEllipsis??K.cssEllipsis??pe.headerCssEllipsis??s??kc,ci=Se&&(k[ae]||K.field||K.groupByForColumn)&&(k[ae]||k[K.field||K.groupByForColumn])||null,hy=K.defaultFilterable??pe.defaultFilterable??v??!0,by=I??K.defaultEditable??pe.defaultEditable??R??!1,bl=K.dataType||pe.dataType||(Array.isArray(K.type)?K.type[0]:K.type)||Uy,yy=K.sortType||pe.sortType||bl,zc=K.filterType||pe.filterType||bl,Vc=!1;if(ci!=null&&!ci.disabled){let Tl=g[zc];Tl&&(!Tl.emptyValues||!Tl.emptyValues.includes(ci.filter.value))&&(Vc=!0)}let Qo=K.field??pe.field,Gc=K.valueGetter??pe.valueGetter,yl=K.defaultGroupable??pe.defaultGroupable??P??!!Qo;Qo||(yl=!1),K.groupByForColumn&&(yl=!1);let Sl=K.defaultSortable??pe.defaultSortable;Sl==null&&!K.groupByForColumn&&Qo==null&&Gc==null&&(Sl=!1);let Hc=Qo?N[Qo]!==void 0:!1,Sy=Hc?N[Qo]:void 0,Ty=p??Sl??w??xi,Cy=K.resizable??pe.resizable??h??jy,Ze={colType:pe,align:pe.align,headerAlign:pe.headerAlign,computedVisible:Se,verticalAlign:pe.verticalAlign,defaultHiddenWhenGroupedBy:pe.defaultHiddenWhenGroupedBy,valueGetter:Gc,valueFormatter:pe.valueFormatter,renderValue:pe.renderValue,render:pe.render,style:pe.style,className:pe.className,contentFocusable:pe.contentFocusable,renderMenuIcon:pe.renderMenuIcon,renderSortIcon:pe.renderSortIcon,renderRowDetailIcon:pe.renderRowDetailIcon,renderSelectionCheckBox:pe.renderSelectionCheckBox,renderHeaderSelectionCheckBox:pe.renderHeaderSelectionCheckBox,headerStyle:pe.headerStyle,headerClassName:pe.headerClassName,columnGroup:pe.columnGroup,getValueToEdit:pe.getValueToEdit,getValueToPersist:pe.getValueToPersist,shouldAcceptEdit:pe.shouldAcceptEdit,field:Qo,...K,components:{...pe.components,...K.components},computedResizable:Cy,computedMinWidth:cy,computedMaxWidth:uy,computedFlex:sy,computedDataType:bl,computedEditable:by,computedSortType:yy,computedFilterType:zc,cssEllipsis:kc,headerCssEllipsis:gy,computedFilterValue:ci,computedFiltered:Vc,computedFilterable:hy,computedGroupable:yl,computedGroupedBy:Hc,computedGroupedByIndex:Sy,computedWidth:Fc,computedAbsoluteOffset:py,computedPinningOffset:dy,computedVisibleIndexInCategory:si,computedOffset:O,computedSortable:Ty,computedSortInfo:le,computedSortIndex:Nc,computedMultiSort:m,computedSorted:Fe,computedSortedAsc:dt,computedSortedDesc:bt,computedVisibleIndex:Z,computedPinned:Pt,computedDraggable:y??K.defaultDraggable??S??$y,computedFirstInCategory:fy,computedLastInCategory:my,computedFirst:fe===0,computedLast:Lc,id:ae,header:K.header??pe.header??K.name??K.field};Se&&(O+=Fc,$.set(Ze.id,Ze),z[fe]=Ze,Pt==="start"&&(ue.push(Ze),re+=Ze.computedWidth),Pt==="end"&&(ce.push(Ze),he+=Ze.computedWidth),Pt||(Y.push(Ze),W+=Ze.computedWidth),be=Pt),Ze.groupByForColumn&&(Ze.computedSortType=K.sortType||pe.sortType||Fn,Ce.push(Ze)),X.set(Ze.id,Ze),Ze.field&&!Ze.groupByForColumn&&!He.has(Ze.field)&&He.set(Ze.field,Ze)}),Ce.forEach(K=>{K.computedSortable=fd(K,{fieldsToColumn:He,sortable:p,columnDefaultSortable:w})});let tt=new Map;Le.forEach(K=>{let ae=X.get(K);ae&&tt.set(K,ae)}),X.forEach(K=>{tt.has(K.id)||tt.set(K.id,K)});let Xe=c!=null?Math.min(c,re):re,ot=u!=null?Math.min(u,he):he;return{computedRemainingSpace:e.width-(_+Te+de),computedPinnedStartColumnsWidth:re,computedPinnedEndColumnsWidth:he,computedUnpinnedColumnsWidth:W,computedColumnOrder:F,computedPinnedStartColumns:ue,computedPinnedEndColumns:ce,computedUnpinnedOffset:re,computedPinnedEndOffset:re+W,computedUnpinnedColumns:Y,computedVisibleColumns:z,computedColumnsMap:X,computedColumnsMapInInitialOrder:tt,computedVisibleColumnsMap:$,computedPinnedEndWidth:ot,computedPinnedStartWidth:Xe,renderSelectionCheckBox:z.reduce((K,ae)=>K||!!ae.renderSelectionCheckBox,!1),fieldsToColumn:He}};function fd(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??xi;return o.computedSortType!==Fn&&a?!0:s=>{let{column:c,api:u}=s,d=c.groupByForColumn||[];return d!=null&&!Array.isArray(d)&&(d=[d]),(d||[]).reduce((p,f)=>{if(!p)return!1;let m=f.field||f.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&&f.valueGetter&&(g=!0),g??r??xi},!0)}}function mt(o,e){let{getComputed:t,getState:n,actions:r,api:i}=e;typeof o=="number"&&(o=t().computedVisibleColumns[o]);let a=typeof o=="string"?t().computedColumnsMap.get(o):o;if(!a)return null;let l={getCellValuesByPrimaryKey(s){return e.api.getCellValues({columnId:a.id,primaryKey:s})},getCellValueByPrimaryKey(s){return l.getCellValuesByPrimaryKey(s)?.value??null},toggleContextMenu(s){n().columnMenuVisibleForColumnId===a.id?this.hideContextMenu():this.showContextMenu(s)},toggleFilterOperatorMenu(s){n().filterOperatorMenuVisibleForColumnId===a.id?this.hideFilterOperatorMenu():this.showFilterOperatorMenu(s)},showFilterOperatorMenu(s){n().onFilterOperatorMenuClick({target:s,column:a})},hideFilterOperatorMenu(){i.hideFilterOperatorMenu()},showContextMenu(s){n().onColumnMenuClick({target:s,column:a})},hideContextMenu(){r.columnMenuVisibleForColumnId=null},isVisible(){return t().computedVisibleColumnsMap.has(a.id)},setVisible(s){i.setVisibilityForColumn(a.id,s)},toggleSort(s={multiSortBehavior:"replace"}){return i.toggleSortingForColumn(a.id,s)},isSortable(){let{computedColumnsMap:s}=t();return typeof a.computedSortable=="function"?a.computedSortable({api:i,columnApi:l,column:a,columns:s}):a.computedSortable},getSortDir(){return i.getSortingForColumn(a.id)},setFilter(s){return i.setColumnFilter(a.id,s)},clearFilter(){return i.clearColumnFilter(a.id)},getSortInfo(){return i.getSortInfoForColumn(a.id)},setSort(s){s?i.setSortingForColumn(a.id,s):i.setSortInfoForColumn(a.id,null)},clearSort(){this.setSort(null)},getColumnId(){return a.id},getComputedColumn(){return a}};return l}function tn(o,e,t){let n=typeof o=="string"?e.getComputed().computedColumnsMap.get(o):o,{api:r,getComputed:i,getDataSourceState:a,actions:l,dataSourceActions:s,dataSourceApi:c}=e,u=a(),{allRowsSelected:d,someRowsSelected:p,selectionMode:f}=u,m=i(),g=n.header&&typeof n.header!="function"?n.header:n.name||n.id||"";if(typeof n.header=="function"){let b=mt(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:p,selectionMode:f,api:r,renderBag:{header:g}})??null}return g}var md=B(require("react"));var Ln=`${ft}HeaderCell__filter`,Mi=`${ft}HeaderCell__filterOperator`,_P=`${Ln}__input`;var Yl=md.createContext(null);var hd=require("react");var gd=require("react"),ql;function Ei(){return ql||(ql=(0,gd.createContext)(null))}function oe(o){let e=Ei(),t=(0,hd.useContext)(e);return xn(t,o)}function Ke(){return oe(o=>({getState:o.getState,actions:o.actions,getComputed:o.getComputed,getDataSourceState:o.getDataSourceState,dataSourceApi:o.dataSourceApi,dataSourceActions:o.dataSourceActions,api:o.api,getDataSourceMasterContext:o.getDataSourceMasterContext}))}var Xy=`${Ln}__input`,Ai=o=>o.stopPropagation();function bd(o){let{filterOperatorMenuVisibleForColumnId:e}=oe(u=>({filterOperatorMenuVisibleForColumnId:u.state.filterOperatorMenuVisibleForColumnId})),{column:t}=Dr(),n=o.filterEditor,r=o.filterOperatorSwitch,[i,a]=(0,Pr.useState)(!1),l=lt.useCallback(()=>{a(!0)},[]),s=lt.useCallback(()=>{a(!1)},[]),c=e===t.id||i;return lt.createElement("div",{onPointerUp:Ai,onPointerDown:Ai,onFocus:l,onBlur:s,className:`${Ln} ${Kl({active:c})}`,style:{height:o.columnHeaderHeight}},lt.createElement(Yl.Provider,{value:o},lt.createElement(r,null),lt.createElement(n,null)))}function yd(){let{columnApi:o,disabled:e,operator:t}=kn(),n=t?.components?.Icon??Nn;return lt.createElement("div",{"data-name":"filter-operator","data-disabled":e,onMouseDown:r=>{r.stopPropagation(),!e&&o.toggleFilterOperatorMenu(r.target)},className:te(Mi,qu,e?`${Mi}--disabled`:"")},lt.createElement(n,{size:20,className:`${Xu({disabled:e})}`}))}function Sd(){return lt.createElement("div",{onPointerUp:Ai,onPointerDown:Ai,className:`${Ln} ${Kl({active:!1})} ${bu["50%"]}`})}function kn(){let o=Ke(),{column:e,columnApi:t}=Dr(),n=tn(e,o,"column-filter"),r=lt.useContext(Yl),{columnFilterType:i,filterTypes:a,columnFilterValue:l}=r,s=a[i],[c,u]=(0,Pr.useState)(l?.filter.value??""),d=lt.useCallback(b=>{u(b),r.onChange(b)},[r.onChange]),p=lt.useCallback(()=>{o.api.clearColumnFilter(e.id)},[e.id]),f=lt.useCallback(()=>{o.api.removeColumnFilter(e.id)},[e.id]);(0,Pr.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:p,removeColumnFilter:f,ariaLabel:`Filter for ${n}`,className:`${Uu} ${Xy}`}}function zn(){let{ariaLabel:o,value:e,setValue:t,className:n,disabled:r}=kn();return Xl.createElement("input",{"data-xxx":!0,"aria-label":o,type:"text",disabled:r,value:e,onChange:i=>{t(i.target.value)},className:n})}function _i(){let{ariaLabel:o,value:e,setValue:t,className:n,disabled:r}=kn();return Xl.createElement("input",{"aria-label":o,type:"number","data-yyy":!0,disabled:r,value:e??"",onChange:i=>{let a=isNaN(i.target.valueAsNumber)?i.target.value:i.target.valueAsNumber;t(a)},className:n})}var qt=(o,e)=>{let t=o?.[e];return t?{components:{Icon:t}}:{}};function Td(o={}){let{StringFilterEditor:e,NumberFilterEditor:t,icons:n}=o;return{string:{label:"Text",emptyValues:[""],defaultOperator:"includes",components:e?{FilterEditor:e}:void 0,operators:[{name:"includes",...qt(n,"includes"),label:"Includes",fn:({currentValue:r,filterValue:i})=>typeof r=="string"&&typeof i=="string"&&r.toLowerCase().includes(i.toLowerCase())},{label:"Equals",...qt(n,"eq"),name:"eq",fn:({currentValue:r,filterValue:i})=>typeof r=="string"&&r===i},{name:"startsWith",...qt(n,"startsWith"),label:"Starts With",fn:({currentValue:r,filterValue:i})=>r.startsWith(i)},{name:"endsWith",...qt(n,"endsWith"),label:"Ends With",fn:({currentValue:r,filterValue:i})=>r.endsWith(i)}]},number:{label:"Number",emptyValues:["",null,void 0],defaultOperator:"eq",components:t?{FilterEditor:t}:void 0,operators:[{label:"Equals",...qt(n,"eq"),name:"eq",fn:({currentValue:r,filterValue:i})=>r==i},{label:"Not Equals",...qt(n,"neq"),name:"neq",fn:({currentValue:r,filterValue:i})=>r!=i},{name:"gt",label:"Greater Than",...qt(n,"gt"),fn:({currentValue:r,filterValue:i,emptyValues:a})=>a.includes(r)?!0:r>i},{name:"gte",...qt(n,"gte"),label:"Greater Than or Equal",fn:({currentValue:r,filterValue:i,emptyValues:a})=>a.includes(r)?!0:r>=i},{name:"lt",...qt(n,"lt"),label:"Less Than",fn:({currentValue:r,filterValue:i,emptyValues:a})=>a.includes(r)?!0:r<i},{name:"lte",...qt(n,"lte"),label:"Less Than or Equal",fn:({currentValue:r,filterValue:i,emptyValues:a})=>a.includes(r)?!0:r<=i}]}}}var No=Td({StringFilterEditor:zn,NumberFilterEditor:_i,icons:{includes:Mu,eq:Au,neq:Lu,startsWith:ku,endsWith:Eu,gt:Ou,gte:_u,lt:Fu,lte:Nu}});function Oi(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 Bn=require("react"),ap=require("react-dom");function Fo(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 Cd(o,e,t){let n=o;if(!n)return null;if(n&&n.matches(e))return n;for(;n=n.parentElement;){if(n.matches(e))return n;if(n===t)return null}return null}var J={currentColumnTransformX:"var(--_16hkbkc0)",y:"var(--_16hkbkc1)",currentFlashingBackground:"var(--_16hkbkc2)",currentFlashingDuration:"var(--_16hkbkc3)",activeCellRowOffset:"var(--_16hkbkc4)",activeCellRowOffsetX:"var(--_16hkbkc5)",activeCellRowHeight:"var(--_16hkbkc6)",activeCellOffsetX:"var(--_16hkbkc7)",activeCellOffsetY:"var(--_16hkbkc8)",scrollTopForActiveRow:"var(--_16hkbkc9)",scrollLeftForActiveRowWhenHorizontalLayout:"var(--_16hkbkca)",activeCellColWidth:"var(--_16hkbkcb)",activeCellColOffset:"var(--_16hkbkcc)",columnReorderEffectDurationAtIndex:"var(--_16hkbkcd)",columnWidthAtIndex:"var(--_16hkbkce)",columnOffsetAtIndex:"var(--_16hkbkcf)",columnOffsetAtIndexWhileReordering:"var(--_16hkbkcg)",columnVisibilityAtIndex:"var(--_16hkbkch)",columnZIndexAtIndex:"var(--_16hkbkci)",pinnedStartWidth:"var(--_16hkbkcj)",pinnedEndWidth:"var(--_16hkbkck)",pinnedEndOffset:"var(--_16hkbkcl)",computedVisibleColumnsCount:"var(--_16hkbkcm)",baseZIndexForCells:"var(--_16hkbkcn)",bodyWidth:"var(--_16hkbkco)",bodyHeight:"var(--_16hkbkcp)",scrollbarWidthHorizontal:"var(--_16hkbkcq)",scrollbarWidthVertical:"var(--_16hkbkcr)",scrollLeft:"var(--_16hkbkcs)",scrollTop:"var(--_16hkbkct)"};var Id="true",ge={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)"}}},Rd="column-header-height";var wd=`.${ke.rootClassName}`;function Zl(o){return Fo(o,wd)}var vd=Q(J.scrollLeft),Zy=Q(J.scrollTop),Qy=Q(J.columnWidthAtIndex),Ql=Q(J.columnOffsetAtIndex),Pd=Q(J.columnReorderEffectDurationAtIndex),Jy=Q(J.columnOffsetAtIndexWhileReordering),eS=Q(J.columnVisibilityAtIndex),tS=Q(J.columnZIndexAtIndex);function Xt(o,e,t){let n=t?Zl(t):document.querySelector(wd);oS(o,e,n)}function oS(o,e,t){if(t){let n=o,r=J[n]?Q(J[n]):o;t.style.setProperty(r,`${e}`)}}function Vn(o,e){if(e)for(var t in o){let n=J[t]?Q(J[t]):t,r=`${o[t]}`;e.style.setProperty(n,r)}}function Jl(o,e,t){Xt(`${Ql}-${o.computedVisibleIndex}`,o.computedPinned?`calc( ${o.computedAbsoluteOffset+e}px + var(${vd}))`:`${o.computedAbsoluteOffset+e}px`,t)}function es(o,e,t){Xt(`${tS}-${o}`,`${e}`,t)}function xr(o,e,t){Xt(`${Jy}-${o}`,typeof e=="number"?`calc( var(${Ql}-${o}) + ${e}px )`:e,t)}function Mr(o,e,t){Xt(`${eS}-${o}`,e,t)}function Ni(o,e,t){Xt(`${Pd}-${o}`,t??"",e)}function ts(o,e){let t=`${Pd}-${o}`;Xt(t,ge.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`${Qy}-${o}`}},set(o,e,t){e=typeof e=="number"?e+"px":e,Xt(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`${Ql}-${o}`}},set(o,e,t){e=typeof e=="number"?e+"px":e,Xt(this.varName.get(o),e,t)}}};function Dd(o,e){Vn({[vd]:`${o.scrollLeft}px`,[Zy]:`${o.scrollTop}px`},e)}var xd="_16lm1iw1",Md="_1yeub2v0 _16lm1iw1 _16lm1iw1p _16lm1iw2f _16lm1iw0",Ed="_1yeub2vs",Ad="_1yeub2vr",_d=ye({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 PD=ye({defaultClassName:"_1yeub2vl",variantClassNames:{pinned:{start:"_1yeub2vm",end:"_1yeub2vn",false:"_1yeub2vo"}},defaultVariants:{},compoundVariants:[]});var Hd=require("react");var Er={bodyWidth:{name:Q(ge.runtime.bodyWidth),value:""},totalVisibleColumnsWidthValue:{name:Q(ge.runtime.totalVisibleColumnsWidthValue),value:""},totalVisibleColumnsWidthVar:{name:Q(ge.runtime.totalVisibleColumnsWidthVar),value:""},visibleColumnsCount:{name:Q(ge.runtime.visibleColumnsCount),value:""},browserScrollbarWidth:{name:Q(ge.runtime.browserScrollbarWidth),value:""}},nS=Q(J.scrollbarWidthHorizontal),Od=Q(J.scrollbarWidthVertical),rS=Q(J.columnWidthAtIndex),iS=Q(J.columnZIndexAtIndex),Nd=Q(J.scrollLeft),aS=Q(J.activeCellColWidth),Fd=Q(J.activeCellColOffset),Vd=Q(J.baseZIndexForCells),lS=Q(J.pinnedStartWidth),Ld=Q(J.bodyWidth),sS=Q(J.bodyHeight),kd=Q(J.pinnedEndOffset),zd=Q(J.pinnedEndWidth),cS=Q(J.computedVisibleColumnsCount);function Fi(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(${Vd}) `+(t<0?"-":"+")+` ${Math.abs(t)} )`:"auto"}function Gd(o){let{computedVisibleColumns:e,computedPinnedStartColumns:t,computedPinnedEndColumns:n,computedPinnedStartColumnsWidth:r,computedPinnedEndColumnsWidth:i,computedUnpinnedColumnsWidth:a,bodySize:l,activeCellIndex:s,brain:c,scrollbars:u}=o,d=Oo(),p=[],f=e.reduce((m,g)=>{let b=g.computedVisibleIndex;m[we.columnWidths.varName.get(b)]=g.computedWidth+"px",m[we.columnOffsets.varName.get(b)]=g.computedPinned==="start"?`calc( ${g.computedOffset}px + var(${Nd}) )`:g.computedPinned==="end"?`calc( var(${kd}) ${p.length?"+":""} ${p.map(y=>we.columnWidths.get(y.computedVisibleIndex)).join(" + ")} + var(${Nd}) )`:`${g.computedOffset}px`;let h=Fi(g,{pinnedStartColsCount:t.length,visibleColsCount:e.length});return m[`${iS}-${b}`]=`${h}`,g.computedPinned==="end"&&p.push(g),m},{});if(l.width&&(f[Er.browserScrollbarWidth.name]=`${Oo()}px`),f[Er.bodyWidth.name]=`calc(${J.bodyWidth} - ${J.scrollbarWidthVertical})`,f[Er.totalVisibleColumnsWidthValue.name]=`${r+i+a}px`,f[Er.totalVisibleColumnsWidthVar.name]=`calc(${e.map((m,g)=>`var(${rS}-${g})`).join(" + ")})`,f[Er.visibleColumnsCount.name]=e.length,s!=null){f[aS]=we.columnWidths.get(s[1]);let m=we.columnOffsets.get(s[1]);if(c.isHorizontalLayoutBrain){let g=c.getPageIndexForRow(s[0]);f[Fd]=g?`calc( ${ge.runtime.totalVisibleColumnsWidthVar} * ${g} + ${m})`:m}else f[Fd]=m}return f[cS]=e.length,f[nS]=u.horizontal?`${d}px`:"0px",f[Od]=u.vertical?`${d}px`:"0px",f[lS]="calc( "+t.map(m=>we.columnWidths.get(m.computedVisibleIndex)).join(" + ")+")",f[zd]="calc( "+n.map(m=>we.columnWidths.get(m.computedVisibleIndex)).join(" + ")+")",f[Vd]=e.length*10,f[kd]=`calc( var(${Ld}) - var(${zd}) - var(${Od}) )`,f[Ld]=`${l.width}px`,f[sS]=`${l.height}px`,f}var ns=o=>{let e=0;return(...t)=>{e&&cancelAnimationFrame(e),e=requestAnimationFrame(()=>{e=0,o(...t)})}};function Kd(o){let{actions:e,getState:t,focused:n,focusedWithin:r,domRef:i,scrollerDOMRef:a,onBlurWithin:l,onFocusWithin:s,onSelfFocus:c,onSelfBlur:u,bodySize:d,activeCellIndex:p,wrapRowsHorizontally:f,computedPinnedStartColumnsWidth:m,computedPinnedEndColumnsWidth:g,computedPinnedStartColumns:b,computedPinnedEndColumns:h,computedVisibleColumns:y,computedUnpinnedColumnsWidth:S,scrollbars:T,focusedClassName:C,focusedWithinClassName:I,computedPinnedStartOverflow:R,computedPinnedEndOverflow:v,focusedStyle:P,focusedWithinStyle:w,brain:x}=oe(F=>{let{state:V,computed:j}=F;return{brain:V.brain,actions:F.actions,getState:F.getState,focused:V.focused,focusedWithin:V.focusedWithin,domRef:V.domRef,scrollerDOMRef:V.scrollerDOMRef,onBlurWithin:V.onBlurWithin,onFocusWithin:V.onFocusWithin,onSelfFocus:V.onSelfFocus,onSelfBlur:V.onSelfBlur,bodySize:V.bodySize,activeCellIndex:V.activeCellIndex,wrapRowsHorizontally:V.wrapRowsHorizontally,computedPinnedStartColumnsWidth:j.computedPinnedStartColumnsWidth,computedPinnedEndColumnsWidth:j.computedPinnedEndColumnsWidth,computedPinnedStartColumns:j.computedPinnedStartColumns,computedPinnedEndColumns:j.computedPinnedEndColumns,computedVisibleColumns:j.computedVisibleColumns,computedUnpinnedColumnsWidth:j.computedUnpinnedColumnsWidth,scrollbars:j.scrollbars,focusedClassName:F.state.focusedClassName,focusedWithinClassName:F.state.focusedWithinClassName,computedPinnedStartOverflow:j.computedPinnedStartOverflow,computedPinnedEndOverflow:j.computedPinnedEndOverflow,focusedStyle:F.state.focusedStyle,focusedWithinStyle:F.state.focusedWithinStyle}}),E=(0,Hd.useMemo)(()=>Gd({computedVisibleColumns:y,computedPinnedStartColumns:b,computedPinnedEndColumns:h,computedPinnedStartColumnsWidth:m,computedPinnedEndColumnsWidth:g,computedUnpinnedColumnsWidth:S,bodySize:d,activeCellIndex:p,brain:x,scrollbars:T}),[y,b,h,m,g,S,d,p,x,T]),M=ns(F=>{e.focused=F}),D=ns(F=>{e.focusedWithin=F}),N={...o,onFocus:F=>{if(o?.onFocus?.(F),F.target===i.current||F.target===a.current){if(t().focused)return;M(!0),c?.(F),r&&(D(!1),l?.(F));return}r||(D(!0),s?.(F))},onBlur:F=>{if(o?.onBlur?.(F),F.target===i.current||F.target===a.current){if(!t().focused)return;M(!1),u?.(F),r&&(D(!1),l?.(F));return}i.current?.contains(F.relatedTarget)||(D(!1),l?.(F))}},k=te(Zt,Md,f?`${Zt}--horizontal-layout`:null,N?.className,m?`${Zt}--has-pinned-start ${Ad}`:null,g?`${Zt}--has-pinned-end ${Ed}`:null,n?`${Zt}--focused`:null,r?`${Zt}--focused-within`:null,n&&C?C:null,r&&I?I:null,R?`${Zt}--has-pinned-start-overflow`:null,v?`${Zt}--has-pinned-end-overflow`:null,_d({horizontalLayout:!!f,hasPinnedStart:!!m,hasPinnedEnd:!!g,focused:n,focusedWithin:r}));return N.className=k,N.style={...o?.style,...E},n&&P&&Object.assign(N.style,P),r&&w&&Object.assign(N.style,w),N}var Zd=B(on());function Li(o){return o.map(e=>e instanceof Lo?e:new Lo(null,[e]))}var Lo=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=>uS(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 uS(o,e){return typeof o=="string"||typeof o=="number"?`${o}`:e?o.__get(e):o.done()}var dS=(...o)=>new Lo("+",Li(o)),Wd=(...o)=>new Lo("-",Li(o)),pS=(...o)=>new Lo("*",Li(o)),fS=(...o)=>new Lo("/",Li(o)),Ar={add:dS,subtract:Wd,minus:Wd,multiply:pS,divide:fS};var nn=(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 Ge=Me().requestAnimationFrame||(o=>setTimeout(o,16)),zt=Me().cancelAnimationFrame||(o=>clearTimeout(o));var jd=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),p=0;for(let f=0;f<u;f++)s>(f+1)*d&&(p=r.scrollAmountsPerRaf[f]);return n.scrollLeft=n.scrollLeft-p,e=Ge(()=>{i.scroll(n)}),!0}function l(){let s=r.mousePosition.clientX-(r.scrollOffsetEnd-r.offset);if(!(s>0&&s<=r.offset))return!1;let u=r.scrollAmountsPerRaf.length,d=Math.round(r.offset/u),p=0;for(let f=0;f<u;f++)s>(f+1)*d&&(p=r.scrollAmountsPerRaf[f]);return n.scrollLeft=n.scrollLeft+p,t=Ge(()=>{i.scroll(n)}),!0}return!!(a()||l())}}};var je=class o{constructor(e){this.top=0;this.left=0;this.left=e.left,this.top=e.top}static clone(e){return new o(e)}static from(e){return new o(e)}shift(e){return e.top!=null&&(this.top+=e.top),e.left!=null&&(this.left+=e.left),this}getDistanceToPoint(e){let t=e.top-this.top,n=e.left-this.left;return{top:t,left:n}}};function $d(o,e){let t=Math.atan2(o.top-e.top,o.left-e.left);return t<=0&&(t=2*Math.PI+t),t}function Ud(o,e){return Math.sqrt((e.top-o.top)**2+(e.left-o.left)**2)}function mS(o,e,t){let n=$d(o,t),r=$d(e,t);return n===r?Ud(t,e)-Ud(t,o):n-r}function Yd(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)=>mS(n,r,t)),e}function gS(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 hS(o,e){if(o.length<2)return o[0]?o[0].left===e.left&&o[0].top===e.top:!1;o=Yd(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 qd(o,e){if(gS(o))return hS(o,e);o=Yd(o);let[t]=o;for(let n=1,r=o.length-1;n<r;n++){let i=o[n],a=o[n+1];if(bS([t,i,a],e))return!0}return!1}function bS(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 Gn=class{containsPoint(e){return qd(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 Hn=class o extends Gn{static clone(e){return new o(e)}constructor(e){super(),this.points=e.map(je.clone)}getPoints(){return this.points}shift(e){return this.points.forEach(t=>{t.shift(e)}),this}};function yS(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 Gn{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=yS(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 Hn(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 Xd=10,SS=Q(J.pinnedStartWidth);function Qd(o){let{computedVisibleColumns:e,computedVisibleColumnsMap:t,computedPinnedEndColumns:n,computedPinnedStartColumns:r,dragColumnId:i,infiniteDOMNode:a,brain:l,dragColumnHeaderTargetRect:s,draggableColumnsRestrictTo:c,tableRect:u,acceptDropToReorderRect:d,allowColumnHideOnDrag:p,setProxyPosition:f,setDragColumnOutside:m,getCurrentDragSourceAndTarget:g,api:b,horizontalLayoutPageIndex:h,pageWidth:y}=o;function S(z){let $=z==="start"?k:F;return A===N?$:N===z?$+M.computedWidth:A===z?$-M.computedWidth:$}function T(z){if(z.columnIndex===D||h!=null)return!0;let $=e[z.columnIndex];if($.computedPinned)return!0;let X=l.getScrollPosition().scrollLeft,W=$.computedOffset+(h!=null&&y!=null?y*h:0);return W>=X+S("start")&&W+$.computedWidth<=X+u.width-S("end")}let C=(z,$)=>{let{restrictToParentGroup:X,dragColumn:W}=$,re=[];if(z.forEach(be=>{if(be.computedVisibleIndex===D)return;let G={columnId:be.id,columnIndex:be.computedVisibleIndex,offsetX:be.computedOffset+Math.round(be.computedWidth/2)};T(G)&&re.push(G)}),X){let G=function(de,Te,xe){let Ce=z[de];Ce&&(Ce.columnGroup!==W.columnGroup&&xe.add(Ce.id),G(de+Te,Te,xe))};var he=G;let be=W.computedVisibleIndex,_=new Set;G(be-1,-1,_),G(be+1,1,_),re=re.filter(de=>!_.has(de.columnId))}return re},R=r.length,v={clientX:Math.round(o.initialMousePosition.clientX),clientY:Math.round(o.initialMousePosition.clientY)},P={left:v.clientX-u.left-(v.clientX-s.left)+Xd,top:v.clientY-u.top-(v.clientY-s.top)+Xd},w=l.getScrollPosition(),x=e.map(z=>z.computedVisibleIndex),E=x,M=t.get(i),D=M.computedVisibleIndex,A=M?.computedPinned,O=D,N=A,k=l.getFixedStartColsWidth(),F=l.getFixedEndColsWidth(),V=v,j={x:0,y:0},L=1,U=0;function H(z){let $=Math.round(z.clientX),X=Math.round(z.clientY);if($===V.clientX&&X===V.clientY)return ve.from(s).shift({left:j.x,top:j.y});V={clientX:$,clientY:X};let re=l.getScrollPosition().scrollLeft-w.scrollLeft;return j.x=V.clientX-v.clientX,j.y=V.clientY-v.clientY,U=j.x+re,L=U<0?-1:1,f({left:P.left+j.x,top:P.top+j.y}),ve.from(s).shift({left:j.x,top:j.y})}function q(z){let $=0;A?A==="start"&&z.forEach((X,W)=>{$||e[X]?.computedPinned!=="start"&&($=W)}):z.forEach((X,W)=>{e[X]?.computedPinned==="start"&&($=W+1)}),R=$,ne("start",z,$)}function ne(z,$,X){if(z==="start"){let W=0;for(let re=0;re<X;re++){let he=$[re],be=e[he];W+=be.computedWidth}Xt(SS,`${W}px`,a)}}function se(z){if(z==null||z===O)return;if(O===-1&&z!==-1&&(Mr(D,"",a),m(!1)),O=z,z===-1){me(D);return}let $=nn(x,D,O>D?O-1:O);R=0;let W=new Set;return $.forEach((re,he)=>{let be=E[he];re!==be&&W.add(re),q($)}),E=$,ie(W),{newColumnIndexes:$,indexesWithTransition:W,pinnedStartCount:R}}function me(z){E=E.filter(X=>X!==z),e.forEach(X=>{let W=X.computedVisibleIndex,re=W>z;ts(W,a);let he="";re&&(he=Ar.minus(we.columnOffsets.get(W),we.columnWidths.get(z)).done()),xr(W,he,a)}),Mr(z,"hidden",a),m(!0)}function ie(z){e.forEach($=>{let X=$.computedVisibleIndex;z.has(X)?ts(X,a):Ni(X,a);let W=X===D,re=L===-1?X<O||X>D:X<D||X>=O,he="";L===-1?he=W?we.columnOffsets.get(O):re?we.columnOffsets.get(X):Ar.add(we.columnOffsets.get(X),we.columnWidths.get(D)).done():he=re?we.columnOffsets.get(X):W?Ar.add(we.columnOffsets.get(O-1),we.columnWidths.get(O-1)).minus(we.columnWidths.get(D)).done():Ar.minus(we.columnOffsets.get(X),we.columnWidths.get(D)).done(),xr(X,he,a)})}let ue=u.left+S("start"),ce=u.right-S("end"),Y=jd({scrollOffsetStart:ue,scrollOffsetEnd:ce});return H(v),{speedScroller:Y,stop(){Y.stop()},onMove(z){let $=H(z);if(g().dropTargetListId==="grouping-toolbar"||p&&!d.containsPoint($.getCenter()))return p&&se(-1),null;Y.scroll({mousePosition:V,get scrollLeft(){return l.getScrollPosition().scrollLeft},set scrollLeft(G){b.scrollLeft=G}});let X=C(e,{dragColumn:M,restrictToParentGroup:c==="group"}),W=L===-1?M.computedOffset+U:M.computedOffset+M.computedWidth+U,re=(0,Zd.default)(X,W,({offsetX:G},_)=>G<_?-1:G>_?1:0);re<0&&(re=~re),X.length?re=X[re]?X[re].columnIndex:X[X.length-1].columnIndex+1:(e.length>1&&console.error("No breakpoints available, something is wrong!"),re=0),re===D+1&&(re=D),se(re);let he={};n.forEach(G=>{he[G.id]="end"});for(let G=0;G<R;G++){let _=E[G],de=e[_];he[de.id]="start"}let be=E.map(G=>e[G].id);return{columnPinning:he,columnOrder:be}}}}function rs(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 nn(n,u,c)}else{let l=e.indexOf(r),s=e[l+1],c=n.indexOf(s),u=n.indexOf(r);return nn(n,u,c)}return e}var Ct=B(require("react"));var rn=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 Jd=B(on());var ep=(o,e)=>{let{offset:t,activeDragSource:n}=o,{orientation:r,draggableItems:i,listId:a,listRectangle:l}=e.getData(),{dragItem:s,listId:c,dragIndex:u,dragRectangle:d}=n,p=c===a,f=je.from(d.getCenter());if(!l.containsPoint(f))return null;e.activeDragSourcePosition="inside";let m=p?r==="horizontal"?t.left>0?1:-1:t.top>0?1:-1:1,g=d.toDOMRect(),b=e.breakpoints,h=Math.round(m===1?r==="horizontal"?g.right-(p?0:g.width/2):g.bottom-(p?0:g.height/2):r==="horizontal"?g.left+(p?0:g.width/2):g.top+(p?0:g.height/2)),y=(0,Jd.default)(b,h,(R,v)=>R-v);y<0&&(y=~y),m===1&&y===u+1&&p&&y--;let S=Math.min(u,y),T=Math.max(u,y),C=p?i.map((R,v)=>{if(v===u&&p)return t;if(v<S||v>=T)return{left:0,top:0};let P=y<=v?1:-1;return r==="horizontal"?{left:Math.round(P*g.width),top:0}:{left:0,top:Math.round(P*g.height)}}):i.map((R,v)=>{let P=y<=v?1:0;return r==="horizontal"?{left:Math.round(P*g.width),top:0}:{left:0,top:Math.round(P*g.height)}}),I={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(I)?{event:I,error:null,success:!0}:(I.status="rejected",{event:I,error:"rejected by interaction target",success:!1})},tp=(o,e)=>{let{offset:t,activeDragSource:n}=o,{orientation:r,listId:i,listRectangle:a,draggableItems:l}=e.getData(),{dragRectangle:s,dragItem:c,listId:u}=n,d=je.from(s.getCenter()),p=u===i,f=a.containsPoint(d);if(f&&!(p&&!e.acceptsSelfDrops())||e.activeDragSourcePosition==="outside"&&!p)return null;e.activeDragSourcePosition="outside";let m=p?n.dragIndex:-1,g=s.toDOMRect(),b={offset:t,dropIndex:-1,dragIndex:m,dragItem:c,outside:!f,items:l,dragSourceListId:u,dropTargetListId:i,offsetsForItems:p?l.map((h,y)=>h.id===c.id?t:f?{left:0,top:0}:y>m&&!e.getData().preserveDragSpace?r==="horizontal"?{left:-c.rect.width,top:0}:{left:0,top:-c.rect.height}:{left:0,top:0}):l.map(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 Pe=class Pe{static startDrag(e,t){let n=e instanceof Kn?e:new Kn(e),r=new is({activeDragSource:n,startPoint:t});return Pe.currentDragOperation=r,r.on("start",Pe.onDragStart),r.on("move",Pe.onDragMove),r.on("drop",Pe.onDragDrop),r.start(),r}static retriggerMove(){let e=Pe.currentDragOperation;e&&e.phase==="move"&&Pe.onDragMove(e)}static emit(e,...t){Pe.emitter.emit(e,...t)}static on(e,t){return Pe.emitter.on(e,t)}static registerDragInteractionTarget(e){if(Pe.dragInteractionTargetsMap.has(e.listId)){console.warn(`DragInteractionTarget with listId ${e.listId} already registered`);return}return Pe.dragInteractionTargetsMap.set(e.listId,e),Pe.emit("register",e),()=>{Pe.unregisterDragInteractionTarget(e)}}static unregisterAll(){Pe.dragInteractionTargetsMap.forEach(e=>{Pe.unregisterDragInteractionTarget(e)})}static unregisterDragInteractionTarget(e){if(e){if(!Pe.dragInteractionTargetsMap.has(e.listId)){console.warn(`DragInteractionTarget with listId ${e.listId} not found`);return}Pe.dragInteractionTargetsMap.delete(e.listId),e.unregister(),Pe.emit("unregister",e)}}static onDragStart(e){let{dragItem:t,dragIndex:n}=e.activeDragSource,r=e.activeDragSource.listId,a=Pe.dragInteractionTargetsMap.get(r)?.getData().acceptDropsFrom,s=!a||a.includes(r)?r:null;Pe.dragInteractionTargetsMap.forEach(c=>{let u=c.getData();c.start({dragIndex:u.listId===r?n:-1,dragItem:t,dragSourceListId:r,dropTargetListId:s})}),Pe.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=Pe.dragInteractionTargetsMap.get(r);l&&(a=l.acceptsSelfDrops(),a&&i.push(Pe.dragInteractionTargetsMap.get(r))),Pe.dragInteractionTargetsMap.forEach(s=>{s.listId!==r&&i.push(s)});for(let s of i){let c=ep(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=tp(e,s);c&&t(s,c)}}static onDragMove(e){let{activeDragSource:t}=e,{listId:n,dragItem:r}=t,i=null,a=[];Pe.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;Pe.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=[];Pe.withDragMove(e,(s,{event:c})=>{s.drop(c),a.push(c),c.outside||(i=c)});let l=i??a[0]??null;Pe.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}),Pe.currentDragOperation=null,Pe.unregisterAll()}};Pe.dragInteractionTargetsMap=new Map,Pe.currentDragOperation=null,Pe.emitter=new rn;var Tt=Pe,Kn=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){St(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}},is=class extends rn{constructor(t){super(t.listeners);this.phase="start";this.currentOffset={top:0,left:0};this.initialDragSource=Kn.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=Kn.shift(this.initialDragSource,n),this.currentOffset=n,this.emit("move",this)}};globalThis.DragManager=Tt;var op=require("react"),np=Ct.createContext({dragSourceListId:null,dropTargetListId:null,dragItemId:"",status:"accepted",updateDragOperationSourceAndTarget:o=>{},getCurrentDragSourceAndTarget:()=>({dragSourceListId:null,dropTargetListId:null,status:"accepted",dragItemId:""})}),uo=()=>Ct.useContext(np),ki=o=>{let[e,t]=Ct.useState({dragSourceListId:null,dropTargetListId:null,dragItemId:"",status:"accepted"}),n=Ct.useRef(e);n.current=e;let r=Ct.useCallback(()=>{let a=n.current;return{dragSourceListId:a.dragSourceListId,dropTargetListId:a.dropTargetListId,dragItemId:a.dragItemId,status:a.status}},[]),i=Ct.useMemo(()=>({dragSourceListId:e.dragSourceListId,dropTargetListId:e.dropTargetListId,dragItemId:e.dragItemId,status:e.status,updateDragOperationSourceAndTarget:t,getCurrentDragSourceAndTarget:r}),[e,t]);return(0,op.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]),Ct.createElement(np.Provider,{value:i},typeof o.children=="function"?o.children(i):o.children)};var as=`${ft}Body`,rp=o=>o.querySelector(`.${as}`);var an=`${ft}HeaderCell`,ls=`${ft}HeaderWrapper`,ip=o=>Array.from(o.querySelectorAll(`.${ls}`));function zi(o){if(!o)return!1;let e=o.tagName;return e==="INPUT"||e==="BUTTON"}var TS=Q(J.baseZIndexForCells),CS=(o,e)=>{let t=!o||Object.keys(o).length===0,n=!e||Object.keys(e).length===0;return t&&n?!0:!!o!=!!e?!1:St(o,e)},lp=({columnId:o,domRef:e,horizontalLayoutPageIndex:t,allowColumnHideOnDrag:n})=>{let[r,i]=(0,Bn.useState)(null),[a,l]=(0,Bn.useState)(!1),{getCurrentDragSourceAndTarget:s}=uo(),{getComputed:c,getState:u,api:d,computedDraggable:p,rootRef:f,actions:m}=oe(h=>({actions:h.actions,getComputed:h.getComputed,getState:h.getState,api:h.api,computedDraggable:h.computed.computedVisibleColumnsMap.get(o)?.computedDraggable,rootRef:h.state.domRef})),g=(0,Bn.useCallback)(h=>{let y=c().computedVisibleColumnsMap.get(o);if(!y||!y.computedSortable)return;let{multiSortBehavior:S}=u();d.toggleSortingForColumn(o,{multiSortBehavior:S==="replace"&&(h.ctrlKey||h.metaKey)?"append":S})},[]),b=(0,Bn.useCallback)(h=>{if(zi(h.target))return;let{brain:y,draggableColumnsRestrictTo:S}=u(),{computedVisibleColumns:T,computedVisibleColumnsMap:C,computedPinnedStartColumns:I,computedUnpinnedColumns:R,computedPinnedEndColumns:v}=c(),P=C.get(o);if(!P.computedDraggable){g(h);return}let w=e.current,x=w.getBoundingClientRect(),E=f.current.getBoundingClientRect(),M=y.getAvailableSize(),D=P.computedVisibleIndex,A=y.getVirtualColIndex(P.computedVisibleIndex,{pageIndex:t||0}),O=y.isHorizontalLayoutBrain?y.getPageWidth():null,N=w.style.cursor??"auto",k=!1,F=f.current,V=ve.from(rp(F).getBoundingClientRect()),j=ip(F).map(ue=>ve.from(ue.getBoundingClientRect())),L=V.getMinimumBoundingRectangle(...j),U=Qd({brain:y,horizontalLayoutPageIndex:t,allowColumnHideOnDrag:n,pageWidth:O,draggableColumnsRestrictTo:S,computedPinnedEndColumns:v,computedPinnedStartColumns:I,computedUnpinnedColumns:R,computedVisibleColumns:T,computedVisibleColumnsMap:C,dragColumnHeaderTargetRect:x,dragColumnId:o,getCurrentDragSourceAndTarget:s,api:d,infiniteDOMNode:f.current,setProxyPosition:i,setDragColumnOutside:l,tableRect:E,acceptDropToReorderRect:L,initialMousePosition:{clientX:h.clientX,clientY:h.clientY}}),H=null,q,ne;function se(ue){let{columnPinning:ce,columnOrder:Y}=ue;CS(u().columnPinning,ce)||(m.columnPinning=ce);let z=c().computedColumnOrder;JSON.stringify(Y,z)&&(m.columnOrder=rs({newColumnOrder:Y,visibleColumnOrder:c().computedVisibleColumns.map($=>$.id),existingColumnOrder:z,dragColumnId:o}))}let me=ue=>{let{headerBrain:ce,brain:Y}=u();if(!k){k=!0;let z=Y.keepColumnRendered(A),$=ce.keepColumnRendered(A);if(Y.isHorizontalLayoutBrain){let W=Y.extendRenderRange({start:!0,end:!0,direction:"horizontal"}),re=ce.extendRenderRange({start:!0,end:!0,direction:"horizontal"});ne=()=>{W(),re()}}q=()=>{z(),$()},m.columnReorderDragColumnId=P.id,t!=null&&(m.columnReorderInPageIndex=t),es(D,`calc( var(${TS}) + 10000 )`,f.current),f.current?.classList.add(os),w.style.cursor="grabbing"}H=U.onMove(ue)},ie=ue=>{let ce=ue.pointerId;requestAnimationFrame(()=>{let{multiSortBehavior:Y}=u(),z=e.current,$=f.current;$?.classList.remove(os),U.stop(),y.update({...M}),q?.(),ne?.(),z.style.cursor=N,z.releasePointerCapture(ce),z.removeEventListener("pointermove",me),z.removeEventListener("pointerup",ie),i(null);let X=d.getColumnApi(P.id)?.isSortable()??!1;!k&&X&&d.toggleSortingForColumn(P.id,{multiSortBehavior:Y==="replace"&&(ue.ctrlKey||ue.metaKey)?"append":Y}),(0,ap.flushSync)(()=>{H?se(H):k&&n&&d.setVisibilityForColumn(P.id,!1),m.columnReorderDragColumnId=!1,t!=null&&(m.columnReorderInPageIndex=null)}),T.forEach(W=>{Ni(W.computedVisibleIndex,$),Mr(W.computedVisibleIndex,"",$),xr(W.computedVisibleIndex,"",$)}),es(D,Fi(P,{pinnedStartColsCount:I.length,visibleColsCount:T.length}),$)})};w.addEventListener("pointermove",me),w.addEventListener("pointerup",ie),w.setPointerCapture(h.pointerId)},[o,t]);return{onPointerDown:p?b:g,dragColumnOutside:a,proxyPosition:r}};var jn=B(require("react"));var Re=B(require("react")),Be=require("react");var sp="_1eexc2a7 _1eexc2a6",cp=ye({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"]]}),up=ye({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 dp="_1eexc2a5",Vi=ye({defaultClassName:"_1eexc2aa",variantClassNames:{direction:{up:"_1eexc2ab",down:"_1eexc2ac",neutral:"_1eexc2ad"}},defaultVariants:{},compoundVariants:[]}),Gi="_1eexc2a8";var Hi=B(require("react")),Ki=require("react");var pp="qz8ht90 _16lm1iwk";function IS(){return{checked:1,disabled:o=>o??!1,domProps:1}}var{ManagedComponentContextProvider:RS}=Ft({forwardProps:IS,mappedCallbacks:{checked:o=>({callbackName:"onChange",callbackParams:[o]})},debugName:"InfiniteCheckBox"});function wS(){let{componentState:o,componentActions:e}=Lt(),{checked:t,domProps:n,disabled:r}=o,i=(0,Ki.useRef)(null);return(0,Ki.useEffect)(()=>{i.current.indeterminate=t==null},[t]),Hi.createElement("input",{...n,className:te("InfiniteCheckBox",pp,n?.className),type:"checkbox",ref:i,checked:!!t,disabled:r,onChange:()=>{r||(e.checked=!t)}})}function po(o){return Hi.createElement(RS,{...o},Hi.createElement(wS,null))}var _r=B(require("react")),hp=require("react");var fp="_96uiwi0 _16lm1iw1d _16lm1iwk _16lm1iw9",mp=ye({defaultClassName:"_96uiwi1",variantClassNames:{expanded:{true:"_16lm1iwi",false:"_96uiwi3"},direction:{end:"_96uiwi4",start:"_96uiwi5"},disabled:{true:"_96uiwi6",false:"_96uiwi7"}},defaultVariants:{},compoundVariants:[[{expanded:!1,direction:"end"},"_16lm1iwj"]]});var gp="M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z",TM=Object.keys({size:1,expanded:1,defaultExpanded:1,onChange:1,style:1,disabled:1,className:1,direction:1});var Bi=`${Dt}-expand-collapse`;function ln(o){let{size:e=24,direction:t="start",disabled:n=!1}=o,[r,i]=(0,hp.useState)(o.expanded??o.defaultExpanded),a=()=>{o.onChange?.(!r),_o("expanded",o)||i(!r)};_r.useEffect(()=>{_o("expanded",o)&&i(o.expanded)},[o.expanded]);let l=r?"expanded":"collapsed";return _r.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:te(o.className,fp,mp({direction:t||"start",expanded:r,disabled:n}),`${Dt}`,`${Bi}`,`${Bi}--${l}`,`${Bi}--${t==="end"?"end":"start"}`,n?`${Bi}--disabled`:"")},_r.createElement("path",{d:gp}))}function vS(o){return typeof o.field=="string"}function bp(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 xt(o){let{getComputed:e,getDataSourceState:t,getState:n,rowIndex:r,columnId:i,api:a,dataSourceApi:l}=o,{dataArray:s}=t(),c=s[r],{isGroupRow:u,isTreeNode:d}=c,p=e().computedColumnsMap.get(i),{activeRowIndex:f,keyboardNavigation:m,isRowDetailEnabled:g}=n(),b=r===f&&m==="row",h=!g||typeof g=="function"&&!g(c)?!1:a.rowDetailApi.isRowDetailExpanded(c.id)?"expanded":"collapsed",{formattedValue:y,formattedValueContext:{rawValue:S}}=Wn({column:p,rowInfo:c,rowDetailState:h,columnsMap:e().computedColumnsMap,context:o}),T=mt(p.id,o);return u?{api:a,dataSourceApi:l,column:p,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:p,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:p,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:p,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 yp(o){return Tp(o.column,o.rowInfo)}function Sp(o){let{column:e,context:t,rowInfo:n,visibleColumnIds:r}=o,i=bp({rowInfo:n,column:e,fieldsToColumn:o.fieldsToColumn,groupRenderStrategy:t.getState().groupRenderStrategy}),{getState:a}=t,{editingCell:l}=a(),s=Wn(o),{formattedValueContext:c}=s,u=t.api.isEditorVisibleForCell({columnId:e.id,rowIndex:n.indexInAll}),d=Object.assign({rowIndexInHorizontalLayoutPage:o.rowIndexInHorizontalLayoutPage,horizontalLayoutPageIndex:o.horizontalLayoutPageIndex,column:o.column,inEdit:u,rowHasSelectedCells:!1},c,{editError:l&&l.primaryKey===n.id&&l.columnId===e.id&&!l.active&&l.accepted instanceof Error?l.accepted:void 0});Object.defineProperty(d,"rowHasSelectedCells",{get(){return n.hasSelectedCells(r)}});let p=typeof e.align=="function"?e.align({isHeader:!1,...d}):e.align??"start",f=typeof e.verticalAlign=="function"?e.verticalAlign({isHeader:!1,...d}):e.verticalAlign??"center";return{inEdit:u,stylingParam:d,formattedValueContext:c,renderFunctions:{renderGroupIcon:e.renderGroupIcon||i?.renderGroupIcon,renderSelectionCheckBox:e.renderSelectionCheckBox,renderRowDetailIcon:e.renderRowDetailIcon,renderTreeIcon:e.renderTreeIcon,renderTreeIconForParentNode:e.renderTreeIconForParentNode,renderTreeIconForLeafNode:e.renderTreeIconForLeafNode,renderValue:e.renderValue||i?.renderValue,renderGroupValue:e.renderGroupValue||i?.renderGroupValue,renderLeafValue:e.renderLeafValue||i?.renderLeafValue},renderParams:PS({rowIndexInHorizontalLayoutPage:o.rowIndexInHorizontalLayoutPage,horizontalLayoutPageIndex:o.horizontalLayoutPageIndex,column:o.column,rowInfo:o.rowInfo,visibleColumnIds:o.visibleColumnIds,columnsMap:o.columnsMap,fieldsToColumn:o.fieldsToColumn,context:o.context,align:p,verticalAlign:f,formattedValueContext:c}),groupByColumnReference:i}}function PS(o){let{column:e,context:t,rowInfo:n,align:r,verticalAlign:i,visibleColumnIds:a,columnsMap:l,fieldsToColumn:s,formattedValueContext:c}=o,{value:u}=c,{api:d,getDataSourceState:p,getState:f,dataSourceApi:m}=t,{editingCell:g}=f(),{indexInAll:b}=n,h=p(),{selectionMode:y,cellSelection:S}=h,T=bp({rowInfo:n,column:e,fieldsToColumn:s,groupRenderStrategy:t.getState().groupRenderStrategy}),C=d.toggleGroupRow,I=S?.isCellSelected(n.id,e.id)??!1,R={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:T,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:C,toggleCurrentGroupRow:()=>{n.isGroupRow&&C(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(R,"rowHasSelectedCells",{get(){return n.hasSelectedCells(a)}}),R}function Tp(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:vS(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 DS(o,e,t,n,r){let{rowSelected:i,indexInAll:a}=t,{activeRowIndex:l,keyboardNavigation:s}=n.getState(),c=a===l&&s==="row";return t.isGroupRow?{rowInfo:t,isGroupRow:!0,isTreeNode:!1,isParentNode:!1,nodeExpanded:!1,data:t.data,rowDetailState:!1,rowSelected:i,rowActive:c,value:o,rawValue:o,field:e.field}:t.isTreeNode?t.isParentNode?{rowInfo:t,isGroupRow:!1,isTreeNode:!0,isParentNode:!0,nodeExpanded:t.nodeExpanded,data:t.data,rowDetailState:r,rowSelected:i,rowActive:c,value:o,rawValue:o,field:e.field}:{rowInfo:t,isGroupRow:!1,isTreeNode:!0,isParentNode:!1,nodeExpanded:!1,data:t.data,rowDetailState:r,rowSelected:i,rowActive:c,value:o,rawValue:o,field:e.field}:{rowInfo:t,isGroupRow:!1,isTreeNode:!1,isParentNode:!1,nodeExpanded:!1,data:t.data,rowDetailState:r,rowSelected:i,rowActive:c,value:o,rawValue:o,field:e.field}}function Wn(o){let{column:e,rowInfo:t,context:n,rowDetailState:r}=o,i=Tp(e,t),a=DS(i,e,t,n,r),l=e.valueFormatter?e.valueFormatter(a):i;return a.value=l,{formattedValue:l,formattedValueContext:a}}var Cp=ye({defaultClassName:"_7pupv01",variantClassNames:{align:{start:"_7pupv02",center:"_7pupv03",end:"_7pupv04"}},defaultVariants:{},compoundVariants:[]}),Ip="_7pupv00",Rp=ye({defaultClassName:"_7pupv05",variantClassNames:{align:{start:"_7pupv06",center:"_7pupv07",end:"_7pupv08"}},defaultVariants:{},compoundVariants:[]});var{rootClassName:wp}=ke,fo=`${wp}Cell`,Or=`${wp}Cell_content`;var{rootClassName:xS}=ke,Qt=`${xS}ColumnCell`;var MS=Q(J.columnZIndexAtIndex),ES=Q(J.columnVisibilityAtIndex);function vp({rowInfo:o}){return{[Q(ge.components.Row.groupNesting)]:o.dataSourceHasGrouping?o.isGroupRow?o.groupNesting-1:o.groupNesting:0}}function Pp({rowInfo:o}){return{[Q(ge.components.Row.groupNesting)]:o.isTreeNode?o.isParentNode?o.treeNesting:o.treeNesting+1:0}}function ss(o,e){return o?typeof o=="function"?o(e):o:void 0}function cs(o,e,t){return typeof e=="function"?{...o,...e(t)}:{...o,...e}}function Dp(o){let{column:e,rowInfo:t,rowIndex:n,rowHeight:r,rowIndexInHorizontalLayoutPage:i,horizontalLayoutPageIndex:a,align:l,verticalAlign:s,stylingParam:c,formattedValueContext:u,groupByColumnReference:d,rowStyle:p,rowClassName:f,cellStyle:m,cellClassName:g,showZebraRows:b,rowActive:h,rowDisabled:y,rowSelected:S,cellSelected:T,cellSelection:C,getData:I,computedVisibleColumns:R,visibleColumnIds:v,computedColumnOrder:P,columnReorderInPageIndex:w}=o,x=v??R.map(me=>me.id),E=P,M,D={...u,visibleColumnIds:x,allColumnIds:E,rowIndex:n,get rowHasSelectedCells(){return M===void 0&&(M=t.hasSelectedCells(x)),M}},A=!!(t.isTreeNode&&(e.renderTreeIcon||e.renderTreeIconForLeafNode||e.renderTreeIconForParentNode)),O=typeof f=="function"?f(D):f,N;d?.className&&(N=ss(d.className,c)),g&&(N=te(N,ss(g,c))),e.className&&(N=te(N,ss(e.className,c))),A&&(N=te(N,Rp({align:l})));let k;t.dataSourceHasGrouping&&e.groupByForColumn&&(k=vp({rowInfo:t})),A&&(k=Pp({rowInfo:t})),p&&(k=typeof p=="function"?{...k,...p(D)}:{...k,...p}),m&&(k=cs(k,m,c)),d?.style&&(k=cs(k,d.style,c)),e.style&&(k=cs(k,e.style,c)),k=k||{},k.height=r,k.zIndex=`var(${MS}-${e.computedVisibleIndex})`,k.visibility=`var(${ES}-${e.computedVisibleIndex}, visible)`;let F=i!=null?i%2===1:(t.indexInAll!=null?t.indexInAll:n)%2===1,V=b?F?"odd":"even":!1,j=!1,L=!1,U=!1,H=!1;if(C&&T){let me=I(),ie=me[t.indexInAll-1],ue=me[t.indexInAll+1],ce=R[e.computedVisibleIndex+1],Y=R[e.computedVisibleIndex-1];j=ie?!C.isCellSelected(ie.id,e.id):!0,e.computedPinned==="end"&&e.computedFirstInCategory?L=!0:L=Y?!C.isCellSelected(t.id,Y.id):!0,e.computedPinned==="start"&&e.computedLastInCategory?U=!0:U=ce?!C.isCellSelected(t.id,ce.id):!0,H=ue?!C.isCellSelected(ue.id,e.id):!0}let q=C&&T?{top:j,left:L,right:U,bottom:H}:null,ne=w!=null?a!==w:!1,se=te(q?up(q):"",Oi(e,[Qt,fo],cp,{dragging:!1,insideDisabledDraggingPage:ne,zebra:V,align:l,verticalAlign:s,rowDisabled:y,rowActive:h,cellSelected:T,rowSelected:S,treeNode:t.isTreeNode?t.isParentNode?"parent":"leaf":!1,firstRow:t.indexInAll===0,firstRowInHorizontalLayoutPage:i===0,groupRow:t.isGroupRow,groupCell:t.isGroupRow?!!e.groupByForColumn:!1,rowExpanded:t.isGroupRow?!t.collapsed:!1}),N,O);return{style:k,className:se,cellSelectionBorders:q,zebra:V,columnIsTree:A}}var mo=B(require("react"));var AS=Q(J.columnWidthAtIndex),_S=Q(J.columnReorderEffectDurationAtIndex);function OS(o){let{cssEllipsis:e=!0,virtualized:t=!0,skipColumnShifting:n=!1,contentStyle:r,column:i,domRef:a,width:l,contentClassName:s,rowId:c,afterChildren:u,beforeChildren:d,cellType:p,cssPosition:f,renderChildren:m,horizontalLayoutPageIndex:g,...b}=o,h=typeof m=="function"?m():m,y={width:`var(${AS}-${i.computedVisibleIndex})`,transition:`transform var(${_S}-${i.computedVisibleIndex}, 0s)`,...b.style},S={...b,style:y,"data-column-id":i.id,"data-z-index":y.zIndex,className:te(b.className,fo,sp),children:mo.createElement(mo.Fragment,null,d,mo.createElement("div",{className:te(Or,e?Yt:Cu.hidden,s),style:r},h),u)};c!=null&&(S["data-row-id"]=`${c}`);let T=p==="body"?i.components?.ColumnCell:i.components?.HeaderCell;return T?mo.createElement(T,{...S,ref:a}):mo.createElement("div",{...S,ref:a})}var Wi=mo.memo(OS);var cn=B(require("react")),sn=require("react");function xp(){let{initialValue:o,setValue:e,confirmEdit:t,cancelEdit:n,readOnly:r}=ji(),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,n()):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:te(mu,Tu.none),type:"text",defaultValue:o,onChange:(0,sn.useCallback)(u=>{e(u.target.value)},[])}))}function Mp(o,e){let t=[];for(let n in o)o.hasOwnProperty(n)&&!e.hasOwnProperty(n)&&t.push(o[n]);return t}var Nr=Re.createContext(null),NS=o=>{let{toggleCurrentRowDetails:e,rowDetailState:t}=o;return Re.createElement(ln,{style:{visibility:t===!1?"hidden":"visible"},expanded:t==="expanded",onChange:e})},FS={display:"inline-block",visibility:"visible"},us=o=>{let{rowInfo:e,toggleCurrentTreeNode:t,nodeExpanded:n,api:r}=o,i=r.getDataSourceState().isNodeReadOnly;return Re.createElement(ln,{disabled:e.isTreeNode&&e.isParentNode?i(e):!1,style:FS,expanded:n,onChange:t})},LS=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||po;return Re.createElement(u,{domProps:{className:Gi},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 kS(o){let{dataSourceStatePartialForCell:e,rowInfoStore:t,rowStyle:n,rowClassName:r,rowIndexInHorizontalLayoutPage:i,horizontalLayoutPageIndex:a,getData:l,visibleColumnIds:s,computedColumnOrder:c,cellStyle:u,cellClassName:d,rowDetailState:p,width:f,column:m,onMouseLeave:g,onMouseEnter:b,onRowMouseEnter:h,onRowMouseLeave:y,rowIndex:S,rowHeight:T,columnsMap:C,fieldsToColumn:I,domRef:R,hidden:v,showZebraRows:P,getDataSourceState:w,dataSourceApi:x,dataSourceActions:E,getState:M,imperativeApi:D,componentActions:A,getComputed:O,getDataSourceMasterContext:N}=o,k=(0,Be.useSyncExternalStore)((0,Be.useCallback)(le=>t.subscribeToRowIndex(S,le),[t,S]),(0,Be.useCallback)(()=>t.getRowInfoAtIndex(S),[t,S])),F=!k,V=!m,j=Re.useRef(null),L=(0,Be.useCallback)(le=>{j.current=le,R&&R(le)},[R]),U=k??{id:"",indexInAll:S,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:H}=U,q=O(),{activeRowIndex:ne,keyboardNavigation:se,columnReorderInPageIndex:me}=M(),ie=S===ne&&se==="row",ue={getState:M,getDataSourceState:w,getDataSourceMasterContext:N,actions:A,dataSourceActions:E,api:D,dataSourceApi:x},ce=U.rowDisabled,Y=Sp({horizontalLayoutPageIndex:a,rowIndexInHorizontalLayoutPage:i,column:m,rowInfo:U,rowDetailState:p,columnsMap:C,visibleColumnIds:s,fieldsToColumn:I,context:ue}),{stylingParam:z,renderParams:$,formattedValueContext:X,renderFunctions:W,groupByColumnReference:re,inEdit:he}=Y,{align:be,verticalAlign:G}=$,_=$,de=Re.useRef(_),Te=h&&b?le=>{let dt={...X,rowIndex:S};h(dt,le),b(le)}:b,xe=y&&g?le=>{let Fe={...X,rowIndex:S,rowInfo:U};y(Fe,le),g(le)}:g,Ce=(0,Be.useCallback)(le=>{let Fe=m.computedVisibleIndex;M().cellClick({rowIndex:S,colIndex:Fe,event:le})},[S,m.computedVisibleIndex,se]),Ne=(0,Be.useCallback)(le=>{let Fe=m.computedVisibleIndex;if(M().cellMouseDown({rowIndex:S,colIndex:Fe,event:le}),se==="row"){ce||(A.activeRowIndex=S);return}se==="cell"&&(A.activeCellIndex=[S,Fe])},[S,ce,m.computedVisibleIndex,se]),{selectionMode:Le,cellSelection:He,isNodeReadOnly:tt}=e,Xe=_.cellSelected;_.domRef=L,_.htmlElementRef=j,_.toggleCurrentTreeNode=(0,Be.useCallback)(_.toggleCurrentTreeNode,[U]),_.selectCell=(0,Be.useCallback)(_.selectCell,[U]),_.deselectCell=(0,Be.useCallback)(_.deselectCell,[U]),_.selectCurrentRow=(0,Be.useCallback)(_.selectCurrentRow,[U]),_.deselectCurrentRow=(0,Be.useCallback)(_.deselectCurrentRow,[U]),_.toggleCurrentGroupRow=(0,Be.useCallback)(_.toggleCurrentGroupRow,[U]),_.toggleCurrentRowSelection=(0,Be.useCallback)(_.toggleCurrentRowSelection,[U]),_.toggleCurrentGroupRowSelection=(0,Be.useCallback)(_.toggleCurrentGroupRowSelection,[U]),_.toggleCurrentTreeNodeSelection=(0,Be.useCallback)(_.toggleCurrentTreeNodeSelection,[U]);let ot=m.components?.Editor??xp,it=he?Re.createElement(Ap,{contextValue:_},Re.createElement(ot,null)):null,K=(0,Be.useCallback)(pt(()=>{if(v||he)return null;if(de.current=_,W.renderGroupIcon&&(_.renderBag.groupIcon=Re.createElement(It,{render:W.renderGroupIcon,renderParam:{..._,renderBag:{..._.renderBag}}})),W.renderSelectionCheckBox&&Le=="multi-row"&&(_.renderBag.selectionCheckBox=Re.createElement(It,{render:LS,renderParam:_}),W.renderSelectionCheckBox!==!0&&(_.renderBag.selectionCheckBox=Re.createElement(It,{render:W.renderSelectionCheckBox,renderParam:{..._,renderBag:{..._.renderBag}}}))),U.isTreeNode){let{isParentNode:dt}=U,bt;bt=(dt?W.renderTreeIconForParentNode:W.renderTreeIconForLeafNode)||typeof W.renderTreeIcon=="function"?W.renderTreeIcon:dt&&W.renderTreeIcon===!0?us:void 0,bt===!0?bt=us:bt&&(_.renderBag.treeIcon=Re.createElement(It,{render:us,renderParam:_})),bt&&(_.renderBag.treeIcon=Re.createElement(It,{render:bt,renderParam:{..._,renderBag:{..._.renderBag}}}))}W.renderRowDetailIcon&&(_.renderBag.rowDetailsIcon=Re.createElement(It,{render:NS,renderParam:{..._,renderBag:{..._.renderBag}}}),typeof W.renderRowDetailIcon=="function"&&(_.renderBag.rowDetailsIcon=Re.createElement(It,{render:W.renderRowDetailIcon,renderParam:{..._,renderBag:{..._.renderBag}}}))),W.renderValue&&(_.renderBag.value=Re.createElement(It,{render:W.renderValue,renderParam:{..._,renderBag:{..._.renderBag}}})),U.isGroupRow&&W.renderGroupValue&&(_.renderBag.value=Re.createElement(It,{render:W.renderGroupValue,renderParam:{..._,renderBag:{..._.renderBag}}})),!U.isGroupRow&&W.renderLeafValue&&(_.renderBag.value=Re.createElement(It,{render:W.renderLeafValue,renderParam:{..._,renderBag:{..._.renderBag}}})),de.current=_;let le=_.renderBag.value;le instanceof Date&&(le=le.toLocaleDateString());let Fe=Re.createElement(Re.Fragment,null,be!=="end"?_.renderBag.treeIcon:null,be!=="end"?_.renderBag.groupIcon:null,be!=="end"?_.renderBag.rowDetailsIcon:null,be!=="end"?_.renderBag.selectionCheckBox:null,le,be==="end"?_.renderBag.selectionCheckBox:null,be==="end"?_.renderBag.rowDetailsIcon:null,be==="end"?_.renderBag.groupIcon:null,be==="end"?_.renderBag.treeIcon:null);return m.render?Re.createElement(It,{render:m.render,renderParam:{..._,renderBag:{..._.renderBag,all:Fe}}}):Fe}),[m,v,he,p,m.renderTreeIcon||m.renderTreeIconForParentNode?tt:!1,...Mp(_,{renderBag:!0,selectCell:!0,deselectCell:!0,selectCurrentRow:!0,deselectCurrentRow:!0,toggleCurrentGroupRow:!0,toggleCurrentRowDetails:!0,toggleCurrentRowSelection:!0,toggleCurrentGroupRowSelection:!0,toggleCurrentTreeNodeSelection:!0,toggleCurrentTreeNode:!0,rowHasSelectedCells:!0})]),{style:ae,className:fe}=Dp({column:m,rowInfo:U,rowIndex:S,rowHeight:T,rowIndexInHorizontalLayoutPage:i,horizontalLayoutPageIndex:a,align:be,verticalAlign:G,stylingParam:z,formattedValueContext:X,groupByColumnReference:re,rowStyle:n,rowClassName:r,cellStyle:u,cellClassName:d,showZebraRows:P,rowActive:ie,rowDisabled:ce,rowSelected:H,cellSelected:Xe,cellSelection:He,getData:l,visibleColumnIds:s,computedVisibleColumns:q.computedVisibleColumns,computedColumnOrder:c,columnReorderInPageIndex:me}),Se=(0,Be.useMemo)(()=>ae,[ae?JSON.stringify(ae):null]),qe=it,pe=K(),Z={domRef:L,cellType:"body",column:m,width:f,rowId:U.id,horizontalLayoutPageIndex:a,style:Se,onMouseLeave:xe,onMouseEnter:Te,onClick:Ce,afterChildren:qe,onMouseDown:Ne,cssEllipsis:m.cssEllipsis??!0,className:fe,renderChildren:(0,Be.useCallback)(()=>pe,[K])},at=Nr.Provider;return V||F?Re.createElement("div",{ref:L,style:{display:"none"}}):Re.createElement(at,{value:de.current},Re.createElement(Wi,{...Z}))}var Ep=Re.memo(kS);function Fr(){return(0,Be.useContext)(Nr)}function ji(){let{api:o,editingValueRef:e,editingCell:t}=oe(f=>({api:f.api,editingCell:f.state.editingCell,editingValueRef:f.state.editingValueRef})),{column:n,rowInfo:r}=Fr(),[i]=Re.useState(()=>t?.value),[a,l]=Re.useState(i),s=t?!t.active&&!!t.waiting:!1,c=Re.useCallback(f=>{e.current=f,l(f)},[]);Re.useLayoutEffect(()=>{e.current=i},[]);let u=o.confirmEdit,d=o.cancelEdit,p=o.rejectEdit;return{api:o,initialValue:i,value:a,readOnly:s,column:n,rowInfo:r,setValue:c,confirmEdit:u,cancelEdit:d,rejectEdit:p}}function Lr(o){return o.render(o.renderParam)??null}function It(o){let e=Nr.Provider;return jn.createElement(e,{value:o.renderParam},jn.createElement(Lr,{render:o.render,renderParam:o.renderParam}))}function Ap(o){let e=Nr.Provider;return jn.createElement(e,{value:o.contextValue},o.children)}function ko(o){let e=$i.Provider;return jn.createElement(e,{value:o.renderParam},jn.createElement(Lr,{render:o.render,renderParam:o.renderParam}))}var zo=B(require("react"));var kr=wi({"data-name":""}),zr={[kr["data-name"]]:"menu-icon"},DE=`[${kr["data-name"]}="${zr["data-name"]}"]`;var zS={width:"100%",pointerEvents:"none"},ds=`${Dt}-menu`;function Vr(o){let{style:e,className:t,domProps:n,reserveSpaceWhenHidden:r,menuVisible:i,children:a}=o,l={...zS,borderTop:`${ge.components.HeaderCell.menuIconLineWidth} solid currentColor`,...o.lineStyle};return zo.createElement("div",{...n,style:e,...zr,onPointerDown:s=>s.stopPropagation(),className:te(t,Qu({menuVisible:i,reserveSpaceWhenHidden:r}),Dt,`${Dt}-menu`)},a??zo.createElement(zo.Fragment,null,zo.createElement("div",{className:ds,style:l}),zo.createElement("div",{className:ds,style:l}),zo.createElement("div",{className:ds,style:l})))}var $n=B(require("react")),Gr=require("react");var _p="_1b8djff0 _16lm1iw1p _16lm1iw2f _16lm1iw1 _16lm1iw32";var Op={transition:"width 0.25s, opacity 0.25s"},GE=Object.keys({direction:1,size:1,lineWidth:1,lineStyle:1,style:1,className:1,index:1,forceSize:1});function Ui(o){let[e,t]=(0,Gr.useState)(!0),[n,r]=(0,Gr.useState)(0),{direction:i,lineWidth:a=1,style:l,className:s,index:c}=o,u=c!=null&&c>0,d=o.size??16,p=Math.floor(d/4),f=i?[d-3*p,d-2*p,d-p]:[0,0,0];i===-1&&f.reverse();let m={...Op,borderTop:`${a}px solid currentColor`,...o.lineStyle,opacity:n};(0,Gr.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%"),$n.createElement("div",{"data-name":"sort-icon",style:{...l,width:d},className:te(s,Dt,_p,`${Dt}-sort`)},u?$n.createElement("div",{"data-name":"index",style:b,className:td},c):null,$n.createElement("div",{style:{width:f[0],...m},onTransitionEnd:g}),$n.createElement("div",{style:{width:f[1],...m}}),$n.createElement("div",{style:{width:f[2],...m}}))}var zp=B(require("react")),ps=require("react");function Np(o){let{context:e,column:t,diff:n,shareSpaceOnResize:r}=o,i=e.getState(),{columnSizing:a,viewportReservedWidth:l,bodySize:s}=i,c=e.getComputed().computedVisibleColumns,u=!1,d=c.reduce((f,m)=>(m.computedFlex&&(f[m.id]={...a[m.id],flex:m.computedWidth},u=!0),f),{}),p=u?{...a,...d}:a;return Wl({shareSpaceOnResize:r,availableSize:s.width,reservedWidth:l||0,dragHandleOffset:n,dragHandlePositionAfter:t.computedVisibleIndex,columnSizing:p,items:c.map(f=>({id:f.id,computedFlex:f.computedFlex,computedWidth:f.computedWidth,computedMinWidth:f.computedMinWidth,computedMaxWidth:f.computedMaxWidth}))})}var Hr=require("react"),Kr=B(require("react"));function Fp(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 Lp(o,e){let t=o[o.length-1];return{resize(n){let{columns:r,domRef:i}=e,a=r[o[0]],l=a.computedOffset,s=0,c=i.current;if(n.forEach((u,d)=>{s+=u;let p=o[d],f=r[p],m=f.computedWidth+u;we.columnWidths.set(p,m,c),f.computedPinned!=="end"&&(l&&we.columnOffsets.set(p,l,c),l+=m)}),a.computedPinned!=="end")for(let u=t+1;u<r.length;u++){let d=r[u];d.computedPinned!=="end"&&we.columnOffsets.set(u,d.computedOffset+s,c)}}}}var Yi="zneyzh0 _16lm1iw2 _16lm1iw23 _16lm1iw2c _16lm1iw2a _16lm1iwm _16lm1iw35",qi=ye({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"]]}),Xi=ye({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:VS}=ke,GS=`${VS}HeaderCell_ResizeHandle`;function HS(o){let{brain:e,headerBrain:t}=oe(g=>({brain:g.state.brain,headerBrain:g.state.headerBrain})),n=(0,Hr.useRef)(null),[r,i]=(0,Hr.useState)(!1),a=(0,Hr.useRef)(r);a.current=r;let l=o.columns[o.columnIndex],s=o.horizontalLayoutPageIndex;if(!l)return null;let c=l.computedPinned,u=l.computedFirstInCategory,d=l.computedLastInCategory,p=()=>{},f=g=>{g.stopPropagation();let 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"}),P=t.extendRenderRange({start:!0,end:!0,direction:"horizontal"});p=()=>{v(),P()}}S.setPointerCapture(h);let T=Fp(o.columnIndex,{columns:o.columns,shareSpaceOnResize:b,domRef:n}),C=(v,{done:P}={})=>{s&&(v=v/(s+1),P&&(v=Math.round(v))),c==="end"&&(v*=-1);let{adjustedDiff:w,constrained:x}=o.computeResize({diff:v,shareSpaceOnResize:b});return a.current!==x&&i(x),T.resize(w),w},I=v=>{C(Math.round(v.clientX-y))},R=v=>{S.releasePointerCapture(h),S.removeEventListener("pointermove",I),S.removeEventListener("pointerup",R);let P=Math.round(v.clientX-y),w=C(P,{done:!0});p(),o.onResize({diff:w,shareSpaceOnResize:b})};S.addEventListener("pointermove",I),S.addEventListener("pointerup",R)},m=(c===!1||c==="start")&&d?{right:c==="start"?void 0:0}:c==="end"&&u?{right:void 0}:void 0;return Kr.createElement("div",{ref:n,className:`${GS} ${Yi} ${Xi({computedPinned:c,computedFirstInCategory:u,computedLastInCategory:d})}`,onPointerDown:f},Kr.createElement("div",{style:m,className:qi({constrained:r,computedPinned:c,computedFirstInCategory:u,computedLastInCategory:d})}))}var kp=Kr.memo(HS);function Vp(o,e){let{computedVisibleColumns:t,getState:n,getComputed:r,actions:i}=oe(c=>({computedVisibleColumns:c.computed.computedVisibleColumns,getState:c.getState,getComputed:c.getComputed,actions:c.actions})),a=(0,ps.useCallback)(({diff:c,shareSpaceOnResize:u})=>Np({context:{getState:n,getComputed:r},column:o,diff:c,shareSpaceOnResize:u}),[o,n,r]),l=(0,ps.useCallback)(({diff:c,shareSpaceOnResize:u})=>{let{columnSizing:d,reservedWidth:p}=a({diff:c,shareSpaceOnResize:u});u||(i.viewportReservedWidth=p),i.columnSizing=d},[a,i]);return o.computedResizable?zp.createElement(kp,{horizontalLayoutPageIndex:e.horizontalLayoutPageIndex,columns:t,columnIndex:o.computedVisibleIndex,computeResize:a,onResize:l}):null}var Ye=B(require("react"));var Jt=require("react");var Gp=ye({defaultClassName:"_16lm1iw3a _16lm1iw1",variantClassNames:{dragging:{true:"_16lm1iwn _16lm1iw1x"}},defaultVariants:{},compoundVariants:[]}),Hp=ye({defaultClassName:"_16lm1iw3a _16lm1iw1 _16lm1iwo",variantClassNames:{active:{true:"_3dmbka5 _16lm1iw1k _3dmbka2"},draggingInProgress:{true:"_16lm1iw1x"}},defaultVariants:{},compoundVariants:[[{active:!1,draggingInProgress:!0},"_3dmbka3"]]});function Kp(o,e){return St(o,e)}var Un=class extends rn{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 Kp(this.data,t)?!1:(this.data=t,!0)}getData(){return this.data}isEqual(t){return Kp(this.data,t.getData())}acceptsSelfDrops(){return!this.data.acceptDropsFrom||this.data.acceptDropsFrom.includes(this.data.listId)}acceptsDrop(t){let n=!0;return typeof this.data.shouldAcceptDrop=="function"&&(n=this.data.shouldAcceptDrop(t)),n=!!n,n!==this.previousAcceptsDropResult&&(this.previousAcceptsDropResult=n,n?this.emit("accept-feedback",t):this.emit("reject-feedback",t)),n}adjustForScroll(t){this.breakpoints=this.breakpoints.map(n=>n-t),this.data.orientation==="vertical"?this.data.listRectangle.shift({top:-t,left:0}):this.data.listRectangle.shift({top:0,left:-t})}move(t){this.emit("move",t)}unregister(){this.emit("unregister",this)}start(t){let n=t.dragSourceListId===this.data.listId,{draggableItems:r}=this.data,i=r.length;this.breakpoints=r.map((a,l)=>n||l===i-1?this.data.orientation==="horizontal"?a.rect.left+a.rect.width/2:a.rect.top+a.rect.height/2:this.data.orientation==="horizontal"?a.rect.right:a.rect.bottom),this.activeDragSourcePosition=n?"inside":"outside",this.emit("start",t)}drop(t){let{dropIndex:n,dragIndex:r,items:i,dragSourceListId:a,dropTargetListId:l,dragItem:s,outside:c}=t,u=Array.from({length:i.length},(f,m)=>m),d=[];n===-1?d=u.filter(f=>f!==r):d=nn(u,r,n>r?n-1:n);let p={dragIndex:r,dropIndex:n,dragItem:s,items:i,dragSourceListId:a,dropTargetListId:l,sortedIndexes:d,outside:c,status:t.status};this.emit("drop",p)}};var KS={startFromPercentage:.25,maxScrollAtPercentage:.05,maxPixelScroll:28,ease:o=>o**2,durationDampening:{stopDampeningAt:1200,accelerateAt:360}};function BS(o,e){let t=getComputedStyle(o),n=e==="vertical"?t.overflowY:t.overflowX;return n!=="auto"&&n!=="scroll"?!1:e==="vertical"?o.scrollHeight>o.clientHeight:o.scrollWidth>o.clientWidth}function WS(o,e){let t=o;for(;t&&!(t===document.documentElement||t===document.body);){if(BS(t,e))return t;t=t.parentElement}return null}function jS(o,e){return{startScrollingFrom:o*e.startFromPercentage,maxScrollValueAt:o*e.maxScrollAtPercentage}}var jp=1;function Bp(o,e,t){if(o>e.startScrollingFrom)return 0;if(o<=e.maxScrollValueAt)return t.maxPixelScroll;if(o===e.startScrollingFrom)return jp;let r=1-(o-e.maxScrollValueAt)/(e.startScrollingFrom-e.maxScrollValueAt);return Math.ceil(t.maxPixelScroll*t.ease(r))}function $S(o,e,t){let{accelerateAt:n,stopDampeningAt:r}=t.durationDampening,i=Date.now()-e;if(i>=r)return o;if(i<n)return jp;let a=(i-n)/(r-n);return Math.ceil(o*t.ease(a))}function Wp(o,e,t,n,r,i,a){if(o<e||o>t)return 0;let l=jS(n,r),s=o-e,c=t-o,u=c<s,d;return u?d=Bp(c,l,r):d=-Bp(s,l,r),d===0?0:a?(d>0?1:-1)*$S(Math.abs(d),i,r):d}var un=class{constructor(e){this.scrollContainer=null;this.rafId=null;this.lastPointer={left:0,top:0};this.dragStartTime=0;this.shouldUseDampening=!1;this.active=!1;this.maxScrollTop=0;this.maxScrollLeft=0;this.orientation=e.orientation,this.onScroll=e.onScroll,this.config={...KS,...e.config}}start(e){this.scrollContainer=WS(e,this.orientation),this.scrollContainer&&(this.maxScrollTop=this.scrollContainer.scrollHeight-this.scrollContainer.clientHeight,this.maxScrollLeft=this.scrollContainer.scrollWidth-this.scrollContainer.clientWidth),this.dragStartTime=Date.now(),this.shouldUseDampening=!0,this.active=!0}getScrollContainer(){return this.scrollContainer}updatePointer(e){this.lastPointer=e,!this.rafId&&this.active&&this.scheduleScroll()}scheduleScroll(){this.rafId=requestAnimationFrame(()=>{if(this.rafId=null,!this.active||!this.scrollContainer)return;let e=this.computeScroll();if(e.top===0&&e.left===0)return;let t={top:this.scrollContainer.scrollTop,left:this.scrollContainer.scrollLeft},n=Math.max(0,Math.min(this.maxScrollTop,t.top+e.top)),r=Math.max(0,Math.min(this.maxScrollLeft,t.left+e.left));this.scrollContainer.scrollTop=n,this.scrollContainer.scrollLeft=r;let i={top:this.scrollContainer.scrollTop-t.top,left:this.scrollContainer.scrollLeft-t.left},a=i.top!==0||i.left!==0;a&&this.onScroll(i),this.active&&a&&this.scheduleScroll()})}computeScroll(){if(!this.scrollContainer)return{top:0,left:0};let e=this.scrollContainer.getBoundingClientRect();if(this.orientation==="vertical"){if(this.lastPointer.left<e.left||this.lastPointer.left>e.right)return{top:0,left:0}}else if(this.lastPointer.top<e.top||this.lastPointer.top>e.bottom)return{top:0,left:0};let t=0,n=0;return this.orientation==="vertical"?t=Wp(this.lastPointer.top,e.top,e.bottom,e.height,this.config,this.dragStartTime,this.shouldUseDampening):n=Wp(this.lastPointer.left,e.left,e.right,e.width,this.config,this.dragStartTime,this.shouldUseDampening),{top:t,left:n}}stop(){this.active=!1,this.rafId!=null&&(cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollContainer=null}};var Yp=Ye.createContext({dragItemId:null,onDragItemPointerDown:()=>{},draggingInProgress:!1,dragListId:"",status:"accepted",dragSourceListId:null,dropTargetListId:null}),dn=()=>Ye.useContext(Yp),US=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)`},YS=o=>`${o.getAttribute(Rt)}`;function fs(o,e){let t=o.current?.querySelectorAll(Xp)??[];return Array.from(t).filter(r=>r.getAttribute(Br)===`${e}`)}function qS(o,e){let t=fs(o,e);return!t||t.length,Array.from(t).map(r=>{let i=YS(r),a=r.getBoundingClientRect();return{id:i,rect:a}})}function XS(o){let{domRef:e,orientation:t,dragListId:n}=o,r=qS(e,n),i=e.current.getBoundingClientRect(),a=i.top,l=i.left,s=i.bottom,c=i.right;for(let p of r){let f=p.rect;f.top<a&&(a=f.top),f.left<l&&(l=f.left),f.bottom>s&&(s=f.bottom),f.right>c&&(c=f.right)}let u=ve.from({top:a,left:l,width:c-l,height:s-a});return{draggableItems:r,orientation:t,listId:n,listRectangle:u,acceptDropsFrom:o.acceptDropsFrom,shouldAcceptDrop:o.shouldAcceptDrop,initial:o.initial,preserveDragSpace:o.preserveDragSpace}}function qp(o){return new Un(XS(o))}function ZS(o,e){let t=Oe(e),[n,r]=Ye.useState(null),i=(0,Jt.useCallback)(l=>{if(l)Tt.registerDragInteractionTarget(l);else{let s=a();s&&Tt.unregisterDragInteractionTarget(s)}r(l)},[]),a=Oe(n);return(0,Jt.useEffect)(()=>Tt.on("register",l=>{let{dragListId:s,acceptDropsFrom:c,orientation:u,shouldAcceptDrop:d}=t(),p=l.getData();if(p.initial&&p.listId!==s&&c?.includes(p.listId)){let f=qp({domRef:o,orientation:u,dragListId:s,initial:!1,acceptDropsFrom:c,shouldAcceptDrop:d});l.once("unregister",()=>{i(null)}),i(f)}}),[t]),{interactionTarget:n,setInteractionTarget:i,getInteractionTarget:a}}function ms(o,e){let t=o.cloneNode(!0);return t.removeAttribute(Rt),t.style.position="fixed",t.style.top=`${e.top}px`,t.style.left=`${e.left}px`,t.style.width=`${e.width}px`,t.style.height=`${e.height}px`,t.style.zIndex="999999",t.style.pointerEvents="none",t.style.margin="0",t.style.boxSizing="border-box",t.style.transform="none",document.body.appendChild(t),t}function gs({proxyElement:o,dx:e,dy:t}){o.style.transform=`translate3d(${e}px, ${t}px, 0)`}function $p(o){let e=o.current;e&&(e.cleanup?e.cleanup({proxyElement:e.proxyElement}):e.proxyElement.remove(),e.originalNode.style.visibility="",o.current=null)}var Vo=o=>{let e=Ye.useRef(null),t=Ye.useRef(null),[n,r]=(0,Jt.useState)(null),i=Ye.useRef({top:0,left:0}),a=Ye.useRef(null),l=Ye.useCallback(w=>{a.current=w},[]),{dropTargetListId:s,dragSourceListId:c}=uo(),{updateDragOperationSourceAndTarget:u,dragItemId:d,status:p}=uo(),f=Oe(o.onDrop),m=Oe(o.onAcceptDrop),g=Oe(o.onRemove),b=Oe(o.updatePosition??US),{interactionTarget:h,setInteractionTarget:y}=ZS(e,o);(0,Jt.useEffect)(()=>{let w=document.querySelector(`[${Up}="${o.dragListId}"]`);w?e.current=w: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,Jt.useEffect)(()=>{if(h){let w=o.dragListId,x=h.on("start",({dragItem:k,dragSourceListId:F,dropTargetListId:V})=>{u({dragSourceListId:F,dropTargetListId:V,dragItemId:k.id,status:"accepted"})}),E=h.on("move",({offsetsForItems:k,items:F,status:V,dragItem:j})=>{if(V==="rejected")return;let L=T(),U=b(),H=t.current;F.forEach((q,ne)=>{let se=k[ne],me=L[ne];if(me&&!(H&&q.id===H.dragItemId)){if(!H&&q.id===j.id){let ie=i.current;se={left:se.left+ie.left,top:se.top+ie.top}}U({id:q.id,node:me,offset:se})}})}),M=h.on("drop",k=>{let{sortedIndexes:F,dragIndex:V,dropIndex:j,dragItem:L,items:U,dragSourceListId:H,dropTargetListId:q,outside:ne,status:se}=k,me=T();S.current=[];let ie=m(),ue=g(),ce=f(),Y=b();U.forEach((X,W)=>{let re=me[W];re&&Y({id:X.id,node:re,offset:null})}),$p(t),r(X=>X&&(requestAnimationFrame(()=>r(null)),{...X,dragItemId:null})),w===q&&H!==w&&ie&&se==="accepted"&&ie({dragItemId:L.id,dragSourceListId:H,dropTargetListId:q,dragIndex:V,dropIndex:j,dropItemId:U[j]?.id});let $=null;j===-1&&H===w&&q===w&&ne&&($=ue),j!==-1&&q===w&&H===w&&($=ce),$&&$?.(F,{dragIndex:V,dropIndex:j,dragItemId:U[V].id,dropItemId:U[j]?.id})}),D=null,A=null,O=null,N=null;if(!h.getData().initial&&e.current){if(D=new un({orientation:o.orientation,onScroll:()=>{}}),D.start(e.current),A=D.getScrollContainer(),A){let k=o.orientation==="vertical"?A.scrollTop:A.scrollLeft;O=()=>{let F=o.orientation==="vertical"?A.scrollTop:A.scrollLeft,V=F-k;k=F,V!==0&&(h.adjustForScroll(V),Tt.retriggerMove())},A.addEventListener("scroll",O)}N=k=>{D.updatePointer({left:k.clientX,top:k.clientY})},Me().addEventListener("pointermove",N)}return()=>{x(),E(),M(),D&&D.stop(),A&&O&&A.removeEventListener("scroll",O),N&&Me().removeEventListener("pointermove",N)}}},[h,o.dragListId]);let S=Ye.useRef([]),T=(0,Jt.useCallback)(()=>{let w=S.current;return(!w||w.length===0)&&(w=fs(e,o.dragListId),S.current=w),w},[o.dragListId]),C=(0,Jt.useCallback)(w=>{let x=w.currentTarget,E=x.getAttribute(Rt);if(E==null){let z=Fo(x,Xp);z&&(E=z.getAttribute(Rt))}if(E==null){console.warn("Could not find drag item id for element",x,`Make sure you have a parent element with a ${Rt} attribute`);return}E=`${E}`;let M=null,D=fs(e,o.dragListId);S.current=D;let A=qp({domRef:e,orientation:o.orientation,dragListId:o.dragListId,acceptDropsFrom:o.acceptDropsFrom,initial:!0,preserveDragSpace:o.preserveDragSpace}),O=A.getData().draggableItems,N=O.findIndex(z=>z.id===E);if(N===-1)return;let k=O[N],F=D[N]?.getAttribute(Rt)===`${E}`?D[N]:D.find(z=>z.getAttribute(Rt)===`${E}`);y(A);let V={left:w.clientX,top:w.clientY},j={left:w.clientX,top:w.clientY};i.current={top:0,left:0};let L=new un({orientation:o.orientation,onScroll:()=>{}});e.current&&L.start(e.current);let U=L.getScrollContainer(),H=U?o.orientation==="vertical"?U.scrollTop:U.scrollLeft:0;function q(){M&&M.move({left:j.left,top:j.top})}let ne=()=>{if(!U)return;let z=o.orientation==="vertical"?U.scrollTop:U.scrollLeft,$=z-H;H=z,$!==0&&(A.adjustForScroll($),o.orientation==="vertical"?i.current.top+=$:i.current.left+=$),q()};U?.addEventListener("scroll",ne);let se=o.dragStrategy??"proxy",me=se==="proxy"&&!o.renderDragProxy,ie=se==="proxy"&&!!o.renderDragProxy,ue=o.onDragProxyMove??gs,ce=z=>{if(j={left:z.clientX,top:z.clientY},!M){if(M=Tt.startDrag({listId:o.dragListId,dragItem:k,dragIndex:N},V),F&&me){let W=F.getBoundingClientRect(),re=null,he={dragItemNode:F,dragItemId:`${E}`,initialRect:W,initialCoords:V,get proxyElement(){return re||(re=ms(F,W)),re}},be=o.onDragProxySetup?.(he),G=be?.proxyElement??he.proxyElement;F.style.visibility="hidden",t.current={proxyElement:G,originalNode:F,dragItemId:`${E}`,initialRect:W,cleanup:be?.cleanup}}if(F&&ie){let W=F.getBoundingClientRect();F.style.visibility="hidden",t.current={proxyElement:F,originalNode:F,dragItemId:`${E}`,initialRect:W,cleanup:()=>{}},r({dragItemId:`${E}`,initialRect:W,dx:0,dy:0})}}let $=z.clientX-V.left,X=z.clientY-V.top;if(ie)r(W=>W&&{...W,dx:$,dy:X});else{let W=t.current;W&&ue({proxyElement:W.proxyElement,dx:$,dy:X})}L.updatePointer({left:z.clientX,top:z.clientY}),q()},Y=()=>{if(L.stop(),U?.removeEventListener("scroll",ne),Me().removeEventListener("pointermove",ce),ie&&(r(z=>z&&{...z,dragItemId:null}),requestAnimationFrame(()=>{r(null)})),!M){$p(t),y(null);return}M.drop(),M=null};Me().addEventListener("pointermove",ce),Me().addEventListener("pointerup",Y,{once:!0})},[o.orientation,o.dragListId,o.acceptDropsFrom,o.removeOnDropOutside,o.dragStrategy,o.renderDragProxy,o.onDragProxySetup,o.onDragProxyMove]),I=!!d,R=Ye.useMemo(()=>({dragItemId:d,onDragItemPointerDown:C,dragSourceListId:c,dropTargetListId:s,status:p,dragListId:o.dragListId,draggingInProgress:I}),[d,C,I,c,s,o.dragListId]),v={className:te("DragList",I?"DragList--dragging":"",Gp({dragging:I})),[Up]:o.dragListId},P=typeof o.children=="function"?o.children(v,R):o.children;return Ye.createElement(Yp.Provider,{value:R},P,n&&o.renderDragProxy?o.renderDragProxy({...n,ref:l}):null)},Up="data-drag-list-id",Rt="data-drag-item-id",Br="data-drag-item-list-id",Xp=`[${Rt}]`,QS=Ye.createContext({dragItemId:"",dragListId:"",active:!1,draggingInProgress:!1,dragSourceListId:"",dropTargetListId:""}),JS=o=>{let{onDragItemPointerDown:e,draggingInProgress:t,dragListId:n,dragItemId:r,dragSourceListId:i,dropTargetListId:a}=dn(),l=o.dragListId??n,s=i===l&&r===`${o.id}`,c=Ye.useMemo(()=>({dragItemId:o.id,active:s,dragListId:l,draggingInProgress:t,dragSourceListId:i,dropTargetListId:a}),[o.id,s,l,t,i,a]),u={[Rt]:`${o.id}`,[Br]:l,onPointerDown:e,className:te("DraggableItem",s?"DraggableItem--active":"",Hp({active:s,draggingInProgress:t}))},d=typeof o.children=="function"?o.children(u,c):o.children;return Ye.createElement(QS.Provider,{value:c},d)};Vo.DraggableItem=JS;var hs=B(require("react"));var Zp=o=>hs.createElement(ze,{...o,viewBox:"0 -960 960 960"},hs.createElement("path",{d:Ve.hidden[0]}));var Zr=B(require("react"));function Qp(){return{}}var Jp=o=>({allowColumnHideWhileDragging:e=>e??!0});var ef=require("react"),eT=(0,ef.createContext)(null);function bs(){return eT}var Gt=B(require("react"));var gn=B(require("react")),Vt=require("react");var Zi=B(require("react"));function tT(o){let{height:e,width:t,count:n}=o;return Zi.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 tf=Zi.memo(tT);var of="mlx2t3";var Qi=B(require("react")),df=require("react");var nf=require("react"),rf=(o,e)=>{(0,nf.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 af={true:"_1ueijco2",false:"_1ueijco3",visible:"_1ueijco4",auto:"_1ueijco5",hidden:"_1ueijco6"},lf={true:"_1ueijco7",false:"_1ueijco8",visible:"_1ueijco9",auto:"_1ueijcoa",hidden:"_1ueijcob"},sf={true:"_1ueijcoc",false:"_1ueijcod",visible:"_1ueijcoe",auto:"_1ueijcof",hidden:"_1ueijcog"},ys="_1ueijco1",cf="_1ueijco0 _16lm1iw0";var uf=o=>{let e="";return typeof o=="boolean"||typeof o=="string"?e=af[`${o}`]:e=te(lf[`${o.horizontal}`],sf[`${o.vertical}`]),e};var oT="InfiniteVirtualScrollContainer";var pf=Qi.forwardRef(function(e,t){let{children:n,scrollable:r=!0,onContainerScroll:i,className:a,tabIndex:l,style:s,autoFocus:c}=e,u=t??(0,df.useRef)(null);return rf(u,i),Qi.createElement("div",{ref:u,style:s,autoFocus:c,tabIndex:l,className:te(a,oT,cf,uf(r))},n)});var ca=B(require("react")),mn=require("react");var ff=B(require("react")),Yn=require("react");function nT(o){let[e,t]=(0,Yn.useState)(o.updater.get),n=(0,Yn.useRef)(null);return(0,Yn.useLayoutEffect)(()=>{function r(a){o.useraf?(n.current!=null&&cancelAnimationFrame(n.current),n.current=requestAnimationFrame(()=>{t(a)})):t(a)}let i=o.updater.onChange(r);return()=>{n.current!=null&&cancelAnimationFrame(n.current),i()}},[o.updater,o.useraf]),e??null}var Go=ff.memo(nT);var mf=B(on());var Ss=(o,e)=>o-e,go={horizontal:!0,vertical:!0};function Ji(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 Ts="DebugID=";function Ho(o,e){return e&&e.startsWith(Ts)?e:e?`${Ts}${o}:${e}`:`${Ts}${o}`}var ea={start:0,end:0},Cs=o=>{o()},Is=o=>{let{start:e,end:t}=o,[n,r]=e,[i,a]=t,l=i-n,s=a-r;return l*s},gf=o=>{let{start:e,end:t}=o,[n]=e,[r]=t;return r-n},Wr=typeof window<"u"?requestAnimationFrame:o=>setTimeout(o,0);function rT(o){return o.horizontalChange||o.verticalChange}var pn=class extends yt{constructor(t){let n=Ho(t,`${t}:MatrixBrain`);super(n);this.scrolling=!1;this.RENDER_COUNT_SAFETY_MARGIN_START=1;this.RENDER_COUNT_SAFETY_MARGIN_END=1;this.availableWidth=0;this.availableRenderWidth=0;this.isHorizontalLayoutBrain=!1;this.name="";this.availableHeight=0;this.availableRenderHeight=0;this.cols=0;this.rows=0;this.alwaysRenderedColumns=new Set;this._rowsPerPage=0;this.rowHeight=0;this.colWidth=0;this.verticalTotalSize=0;this.horizontalTotalSize=0;this.horizontalRenderCount=void 0;this.verticalRenderCount=void 0;this.maxHorizontalRenderCount=0;this.maxVerticalRenderCount=0;this.horizontalExtendRangeBy=ea;this.verticalExtendRangeBy=ea;this.horizontalRenderRange={startIndex:0,endIndex:0};this.verticalRenderRange={startIndex:0,endIndex:0};this.extraSpanCells=[];this.scrollPosition={scrollLeft:0,scrollTop:0};this.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=>{Wr(()=>{this.destroyed||t.has(r)&&r(n)})})};this.notifyVerticalRenderRangeChange=(t=!1)=>{if(this.destroyed)return;let n=this.onVerticalRenderRangeChangeFns,r=this.verticalRenderRange,i=t?Cs:Wr;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?Cs:Wr;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=go)=>{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=go)=>{this.setRenderRange(this.computeRenderRange(t))};this.getExtraSpanCellsForRange=({horizontal:t,vertical:n})=>{let{colspan:r,rowspan:i}=this,a=[];if(i){let l=n.startIndex,s=t.startIndex,c=t.endIndex;for(let u=s;u<c;u++){this.computeItemSpanUpTo(l,u,"vertical");let d=this.rowspanParent.get(u);if(d[l]!=l){let p=l;for(;d[p]!=p;)p--;a.push([p,u])}}}if(r){let l=t.startIndex,s=n.startIndex,c=n.endIndex;for(let u=s;u<c;u++){this.computeItemSpanUpTo(u,l,"horizontal");let d=this.colspanParent.get(u);if(d[l]!=l){let p=l;for(;d[p]!=p;)p--;a.push([u,p])}}}return a};this.computeRenderRange=(t=go)=>{let n=t.horizontal?this.computeDirectionalRenderRange("horizontal"):this.horizontalRenderRange,r=t.vertical?this.computeDirectionalRenderRange("vertical"):this.verticalRenderRange;return{horizontal:n,vertical:r,extraCells:this.getExtraSpanCellsForRange({horizontal:n,vertical:r})}};this.computeDirectionalRenderRange=t=>{let n=t==="horizontal"?this.colWidth:this.rowHeight,r=t==="horizontal"?this.horizontalRenderCount:this.verticalRenderCount,i=t==="horizontal"?this.cols:this.rows;if(!r)return{startIndex:0,endIndex:0};let a=(t==="horizontal"?this.fixedColsStart:this.fixedRowsStart)||0,l=t==="horizontal"?this.scrollPosition.scrollLeft:this.scrollPosition.scrollTop;l+=this.getFixedStartSize(t);let s=typeof n!="function",c=t==="horizontal"?this.horizontalExtendRangeBy:this.verticalExtendRangeBy,u=this.getItemAt(l,t),d=c.start||0,p=c.end||0;s||(d+=this.RENDER_COUNT_SAFETY_MARGIN_START,p+=this.RENDER_COUNT_SAFETY_MARGIN_END),d&&(u=Math.max(0,u-d),r+=d),p&&(r+=p);let f=u+r,m=Math.max(a,i-(t==="horizontal"?this.fixedColsEnd:this.fixedRowsEnd));return f>m&&(f=m,u=Math.max(a,f-r)),{startIndex:u,endIndex:f}};this.getItemAt=(t,n)=>{let r=n==="horizontal"?this.colWidth:this.rowHeight,i=n==="horizontal"?this.cols:this.rows;if(typeof r!="function")return Math.min(Math.max(0,Math.floor(t/r)),i-1);let a=n==="horizontal"?this.colOffsetCache:this.rowOffsetCache,l=n==="horizontal"?this.colWidthCache:this.rowHeightCache,s=a.length-1,c=l.length-1,u=a[s],d;for(;u<t;)if(s>=i||(c+=1,this.computeCacheFor(c,n),d=u,u=a[c],d===u&&d!=0))return i-1;let p=(0,mf.default)(a,t,Ss);return p>=0?p:~p-1};this.computeCacheFor=(t,n)=>{let r=n==="horizontal"?this.colWidth:this.rowHeight,i=n==="horizontal"?this.colWidthCache:this.rowHeightCache,a=n==="horizontal"?this.colOffsetCache:this.rowOffsetCache;if(typeof r!="function")return;let l=r(t);if(i[t]=l,t>0){let s=a[t-1],c=i[t-1];s==null&&console.error(`Offset was not available for ${n==="horizontal"?"col":"row"} ${t-1}`),c==null&&console.error(`Size was not available for ${n==="horizontal"?"col":"row"} ${t-1}`);let u=s+c;a[t]=u}};this.computeItemSpanUpTo=(t,n,r)=>{let i=r==="horizontal"?n:t,a=r==="horizontal"?t:n,l=r==="horizontal"?this.cols:this.rows,s=r==="horizontal"?this.colspan:this.rowspan;if(!s)return;let c=r==="horizontal"?this.colspanParent:this.rowspanParent;c.has(a)||c.set(a,[]);let u=r==="horizontal"?this.colspanValue:this.rowspanValue;u.has(a)||u.set(a,[]);let d=c.get(a),p=u.get(a);if(d[i]===void 0){let f=d.length,m=l?Math.min(i,l-1):0,g={rowIndex:t,colIndex:n};for(;f<=m;f++)if(d[f]===void 0){g[r==="horizontal"?"colIndex":"rowIndex"]=f;let b=s(g);d[f]=f,p[f]=b;let h=f;for(;b>1;)h+=1,d[h]=f,p[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=Is;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=go){t.vertical&&this.resetVertical(),t.horizontal&&this.resetHorizontal(),this.extraSpanCells=[]}resetVertical(){this.rowspanParent=new Map,this.rowspanValue=new Map,this.rowHeightCache=[],this.rowOffsetCache=[0],this.verticalRenderCount=void 0,this.verticalTotalSize=0,this.verticalRenderRange={startIndex:0,endIndex:0}}resetHorizontal(){this.colspanParent=new Map,this.colspanValue=new Map,this.colWidthCache=[],this.colOffsetCache=[0],this.horizontalRenderCount=void 0,this.horizontalTotalSize=0,this.horizontalRenderRange={startIndex:0,endIndex:0}}getVirtualColIndex(t,n){return t}update(t,n){let{rows:r,cols:i,rowHeight:a,colWidth:l,width:s,height:c}=t,u=typeof s=="number",d=typeof c=="number",p=u&&s!==this.availableWidth,f=d&&c!==this.availableHeight;p&&(this.availableWidth=s,this.availableRenderWidth=s),f&&(this.availableHeight=c,this.availableRenderHeight=c),(p||f)&&this.notifyAvailableSizeChange();let m=typeof r=="number",g=typeof i=="number",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 I=t.rowspan!=null,R=t.colspan!=null,v=I&&t.rowspan!=this.rowspan,P=R&&t.colspan!=this.colspan;v&&(this.rowspan=t.rowspan),P&&(this.colspan=t.colspan);let w=h||C||p||P,x=b||T||f||v;(n||rT)({horizontalChange:w,verticalChange:x,colsChanged:h,colWidthChanged:C,widthChanged:p,colspanChanged:P,rowsChanged:b,rowHeightChanged:T,heightChanged:f,rowspanChanged:v})&&this.updateRenderCount({horizontal:w,vertical:x})}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=go){this.reset(t),this.doUpdateRenderCount(t)}doUpdateRenderCount(t=go){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?Cs:Wr;n.forEach(a=>{i(()=>{this.destroyed||n.has(a)&&a(r)})})}notifyScrollChange(){if(this.destroyed)return;let{scrollPosition:t}=this,n=this.onScrollFns;for(let r=0,i=n.length;r<i;r++)n[r](t)}computeDirectionalRenderCount(t,n,r,i){let a=0,l=t==="horizontal"?i.width:i.height;if(l-=this.getFixedSize(t),l<=0)return 0;let s=t==="horizontal"?this.fixedColsStart:this.fixedRowsStart,c=t==="horizontal"?this.fixedColsEnd:this.fixedRowsEnd;if(typeof n=="function"){let u=[],d=0,p=r;d+=s,p-=c;for(let f=d;f<p;f++)u.push(this.getItemSize(f,t));a=Ji(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=>{Wr(()=>{this.destroyed||i.has(a)&&a(r)})})}getCellOffset(t,n){return{x:this.getItemOffsetFor(n,"horizontal"),y:this.getItemOffsetFor(t,"vertical")}}getInitialRowHeight(){return this.rowHeight}getInitialCols(){return this.cols}getInitialRows(){return this.rows}getItemOffsetFor(t,n){let r=n==="horizontal"?this.colWidth:this.rowHeight;if(typeof r!="function")return t*r;let i=n==="horizontal"?this.colOffsetCache:this.rowOffsetCache,a=n==="horizontal"?this.colWidthCache:this.rowHeightCache,l=i[t];if(l==null){let s=a.length-1;for(;s<t;)s+=1,this.computeCacheFor(s,n);l=i[t]}return l}getItemSizeCacheFor(t,n){return(n==="horizontal"?this.colWidthCache:this.rowHeightCache)[t]}getRowIndexInPage(t){return t}getPageIndexForRow(t){return 0}getVirtualizedContentSize(){return{height:this.getVirtualizedContentSizeFor("vertical"),width:this.getVirtualizedContentSizeFor("horizontal")}}getVirtualizedContentSizeFor(t){let n=t==="horizontal"?this.cols:this.rows,r=t==="horizontal"?this.colWidth:this.rowHeight,i=t==="horizontal"?this.horizontalTotalSize:this.verticalTotalSize;if(typeof r!="function")return r*n;if(i!==0&&!isNaN(i))return i;let a=t==="horizontal"?this.colOffsetCache:this.rowOffsetCache,l=n?this.getItemSize(n-1,t):0,s=n?a[n-1]:0,c=l+s;return t==="horizontal"?this.horizontalTotalSize=c:this.verticalTotalSize=c,c}notifyDestroy(){let t=this.onDestroyFns;for(let n=0,r=t.length;n<r;n++)t[n]()}destroy(){this.destroyed||(this.notifyDestroy(),this.reset(),this.rowspanParent.clear(),this.colspanParent.clear(),this.alwaysRenderedColumns.clear(),this.horizontalExtendRangeBy=ea,this.verticalExtendRangeBy=ea,this.destroyed=!0,this.onDestroyFns=[],this.onScrollFns=[],this.onScrollStartFns=[],this.onScrollStopFns=[],this.onRenderCountChangeFns.clear(),this.onRenderRangeChangeFns.clear(),this.onVerticalRenderRangeChangeFns.clear(),this.onHorizontalRenderRangeChangeFns.clear())}};var Rs=B(on());function hf(...o){if(!o.length)return new Set;let[e,...t]=o;return new Set([...e].filter(n=>t.every(r=>r.has(n))))}function bf(o,e){let t=new Set;for(let n of o)e(n)&&t.add(n);return t}function jr(o,e){for(let t of o)if(e(t))return t}var ta=(o,e)=>o-e,oa=class extends yt{constructor(t,n){super(`${t}:GridCellManager`);this.matrix=new ee;this.rowsWithCellsHistory=new Map;this.columnsWithCellsHistory=new Map;this.cellToMatrixPosition=new WeakMap;this.getCellsOutsideRenderRange=t=>{let{start:n,end:r}=t,[i,a]=n,[l,s]=r,c=new Set;return this.matrix.visit(({value:u},d)=>{if(!u)return;let[p,f]=d,m=p<i,g=p>=l,b=f<a,h=f>=s;(m||g||b||h)&&c.add(u)}),c};this.debugId=t,this.pool=n,this.offRemoveCell=this.pool.onRemoveCell(r=>this.onRemoveCell(r))}onRemoveCell(t){let n=this.cellToMatrixPosition.get(t);this.cellToMatrixPosition.delete(t),n&&this.clearCellFromMatrix(t,n,{skipHistory:!1})}set poolSize(t){this.pool.poolSize=t}get poolSize(){return this.pool.poolSize}getDetachedCell(){return this.pool.getDetachedCell()}clearCellFromMatrix(t,n,r){if(this.matrix.delete(n),r.skipHistory)return;let[i,a]=n,l=this.rowsWithCellsHistory.get(i),s=this.columnsWithCellsHistory.get(a);l&&(l.delete(t),l.size===0&&this.rowsWithCellsHistory.delete(i)),s&&(s.delete(t),s.size===0&&this.columnsWithCellsHistory.delete(a))}addCellToMatrix(t,n){let[r,i]=n;this.matrix.set(n,t),this.cellToMatrixPosition.set(t,n);let a=this.rowsWithCellsHistory.get(r),l=this.columnsWithCellsHistory.get(i);a?a.add(t):(a=new Set,a.add(t),this.rowsWithCellsHistory.set(r,a)),l?l.add(t):(l=new Set,l.add(t),this.columnsWithCellsHistory.set(i,l))}setCellPositionInMatrix(t,n){let r=this.cellToMatrixPosition.get(t);if(n==null){r&&this.clearCellFromMatrix(t,r,{skipHistory:!0});return}let[i,a]=n,l=r&&r[0]===i&&r[1]===a;r&&!l&&this.clearCellFromMatrix(t,r,{skipHistory:!1}),this.addCellToMatrix(t,n)}renderNodeAtCell(t,n,r,i){let a=this.getCellAt(r);return a&&a!==n&&this.detachCellAt(r),this.pool.attachCell(n),this.setCellPositionInMatrix(n,r),n.update(t,i),n}getCellPosition(t){let n=this.cellToMatrixPosition.get(t);return!n||this.getCellAt(n)!=t?null:n}getCellAt(t){return this.matrix.get(t)}getCellFor(t,n){let r=this.getCellAt(t);if(r)return r;let[i,a]=t;if(n==="row"){let l=this.rowsWithCellsHistory.get(i);l&&(r=jr(l,s=>!this.isCellAttached(s)))}if(n==="column"){let l=this.columnsWithCellsHistory.get(a);l&&(r=jr(l,s=>!this.isCellAttached(s)))}return r??this.getDetachedCell()}isCellAttached(t){return this.getCellPosition(t)!==null}isCellAttachedAt(t){let 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(ta)}getColumnsWithCells(){let t=this.matrix.getKeysOfFirstChildOnEachBranchStartingWith([],{excludeSelf:!0});return[...new Set(t.map(r=>r[1])).values()].sort(ta)}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,Rs.default)(n,t,ta);r<0&&(r=~r),n.slice(r).forEach(a=>this.detachRow(a))}detachColsStartingWith(t){let n=this.getColumnsWithCells().sort(),r=(0,Rs.default)(n,t,ta);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 jr(t,r=>this.getCellPosition(r)?.[0]===n)}getCellFromListForColumn(t,n){return jr(t,r=>this.getCellPosition(r)?.[1]===n)}getCellCountInMatrix(){return this.matrix.size}flushPendingAfterCommitWork(){this.pool.flushPendingAfterCommitWork()}destroy(){this.reset()}reset(){this.pool.reset(),this.matrix.clear(),this.rowsWithCellsHistory.clear(),this.columnsWithCellsHistory.clear(),this.offRemoveCell(),this.offRemoveCell=()=>{}}makeDetachedCellsEmpty(){this.pool.getDetachedCells().forEach(t=>{t.update(null)})}withDetachedCells(t){this.pool.getDetachedCells().forEach(t)}};var yf=B(on());var na=class extends yt{constructor(t,n){super(`${t}:ListRowManager`);this.indexToRow=new Map;this.rowToIndex=new WeakMap;this.debugId=t,this.pool=n,this.offRemoveRow=this.pool.onRemoveRow(r=>this.onRemoveRow(r))}onRemoveRow(t){let n=this.rowToIndex.get(t);n!=null&&(this.rowToIndex.delete(t),this.indexToRow.delete(n))}set poolSize(t){this.pool.poolSize=t}get poolSize(){return this.pool.poolSize}getDetachedRow(){return this.pool.getDetachedRow()}getRowFor(t){return this.getRowAt(t)??this.getDetachedRow()}setRowIndexInList(t,n){let r=this.rowToIndex.get(t);r!=null&&this.indexToRow.delete(r),n==null?this.rowToIndex.delete(t):(this.rowToIndex.set(t,n),this.indexToRow.set(n,t))}detachStartingWith(t){let n=this.getAttachedIndexes(),r=(0,yf.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 Sf=!0,fn=Q(J.y),Tf=Q(J.scrollTop),Y1=Q(J.columnOffsetAtIndex),ws=Q(J.columnOffsetAtIndexWhileReordering),qn=class extends yt{constructor(t,n,r){n=n||"ReactHeadlessTableRenderer";super(n);this.debugId="";this.destroyed=!1;this.scrolling=!1;this.cellHoverClassNames=[];this.cellDetachedClassNames=[];this.lastEnteredRow=-1;this.lastExitedRow=-1;this.hoverRowUpdatesInProgress=new Map;this.infiniteNode=null;this.setDetailTransform=(t,n,{y:r,scrollTop:i,scrollLeft:a})=>{t.style.setProperty(fn,i?`calc( ${r}px + var(${Tf}) )`:`${r}px`),t.style.transform=`translate3d(${a||0}px, var(${fn}), 0)`};this.setTransform=(t,n,r,{x:i,y:a,scrollLeft:l,scrollTop:s},c)=>{let u=we.columnOffsets.get(r),d=`${ws}-${r}`,p=s?`calc( ${a}px + var(${Tf}) )`:`${a}px`;t.__currentTransformY!==p&&(t.__currentTransformY=p,t.style.setProperty(fn,p));let f=`translate3d(var(${d}, ${u}), var(${fn}), 0)`;t.__transformValue!==f&&(t.__transformValue=f,t.style.transform=f),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(),p=r.getFixedEndRowsHeight(),f=i.scrollTop,m=r.getAvailableSize();if(!m.height)return null;let g=f+m.height;l||(l=c>g-p?"end":c<f+d?"start":"end");let b=i.scrollTop;if(l==="center"?b=c-Math.floor((r.getAvailableSize().height-d-p)/2):l==="start"?(s=-s,b+=c-f+s-d):(s+=u,b+=c-g+s+p),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(),p=r.getFixedStartColsWidth(),f=i.scrollLeft,m=r.getAvailableSize();if(!m.width)return null;let g=f+m.width;l||(l=c>g-p?"end":c<f+d?"start":"end");let b=i.scrollLeft;return l==="center"?b=c-Math.floor((r.getAvailableSize().width-d-p)/2):l==="start"?(s=-s,b+=c-f+s-d):(s+=u,b+=c-g+s+p),{...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,p]=c,[f,m]=u,g=[];if(i&&(n&&g.push({rowFixed:"start",colFixed:"start",start:[0,0],end:[n,i]}),r&&g.push({rowFixed:"end",colFixed:"start",start:[s-r,0],end:[s,i]}),g.push({rowFixed:!1,colFixed:"start",start:[d,0],end:[f,i]})),a&&(n&&g.push({colFixed:"end",rowFixed:"start",start:[0,l-a],end:[n,l]}),r&&g.push({colFixed:"end",rowFixed:"end",start:[s-r,l-a],end:[s,l]}),g.push({colFixed:"end",rowFixed:!1,start:[d,l-a],end:[f,l]})),n){let b={start:[0,p],end:[n,m],rowFixed:"start",colFixed:!1};g.push(b)}if(r){let b={rowFixed:"end",colFixed:!1,start:[s-r,p],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,p=!1;if(t<r&&(u=!0,p="start"),i&&!u){let f=c-i;t>=f&&(u=!0,p="end")}if(n<a&&(d=!0,p="start"),l&&!d){let f=s-l;n>=f&&(d=!0,p="end")}return{row:u?p:!1,col:d?p:!1}};this.isCellCovered=(t,n)=>{let r=this.brain.getRowspanParent(t,n),i=this.brain.getColspanParent(t,n),a=r!=t,l=i!=n;return a||l?[r,i]:!1};this.onMouseEnterNotBound=t=>{let n=this.getMatrixRowIndexFromElement(t.currentTarget);this.onMouseEnter(n)};this.onMouseLeaveNotBound=t=>{let n=this.getMatrixRowIndexFromElement(t.currentTarget);this.onMouseLeave(n)};this.onMouseEnter=t=>{this.lastEnteredRow=t,this.lastExitedRow=-1,!this.scrolling&&t!=-1&&this.addHoverClass(t)};this.addHoverClass=t=>{this.cellManager.getCellsForRow(t).forEach(n=>{let r=n.getElement();r&&this.cellHoverClassNames.forEach(i=>{r.classList.add(i)})})};this.onMouseLeave=t=>{this.lastExitedRow=t,this.lastEnteredRow=-1,!this.scrolling&&t!=-1&&this.removeHoverClass(t)};this.removeHoverClass=t=>{this.cellManager.getCellsForRow(t).forEach(n=>{let r=n.getElement();r&&this.cellHoverClassNames.forEach(i=>{r.classList.remove(i)})})};this.updateHoverClassNamesForRow=t=>{if(this.scrolling||this.hoverRowUpdatesInProgress.has(t))return;this.hoverRowUpdatesInProgress.set(t,!0);let n=()=>{!this.scrolling&&this.lastEnteredRow!=-1&&(this.lastEnteredRow===t?this.addHoverClass(t):this.removeHoverClass(t))};Ge(()=>{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){let d=()=>{this.updateHoverClassNamesForRow(a);let p=this.getCellRealCoordinates(a,l);if(r.dataset.rowIndex=p.rowIndex,r.dataset.colIndex=p.colIndex,Sf){this.setTransform(r,a,l,{x:c,y:u},null),r.style.willChange="transform",r.style.backfaceVisibility="hidden";let m=(n?n.hidden:!!this.isCellCovered(a,l))?"-1":r.dataset.zIndex||"auto";r.__zIndex!==m&&(r.__zIndex=m,r.style.zIndex=m)}else r.style.display="",r.style.left=`${c}px`,r.style.top=`${u}px`};this.scrolling&&this.brain.isHorizontalLayoutBrain?t.setPendingAfterCommitWork(d):d()}};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,Sf&&(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(D=>{let A=i.getRowIndex(D);if(A!=null){let O=this.brain.getItemOffsetFor(A,"vertical");if(O==null)return;let N=D.getElement();if(!N)return;this.setDetailTransform(N,A,{y:O,scrollLeft:t.scrollLeft})}}),!s&&!c&&!u&&!d)return;let p=this.cellManager.getOneAttachedCell();p&&Dd(t,this.getInfiniteNode(p.getElement()));let f=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(D,A,O){let N=r.getCellAt([D,A]);if(N==null)return;let k=n.getCellOffset(D,A),F=N.getElement();F&&k&&O(D,A,F,k)}let I=(D,A,O,{x:N,y:k})=>{this.setTransform(O,D,A,{x:N,y:k,scrollLeft:!0},s-A)},R=(D,A,O,N)=>{this.setTransform(O,D,A,{x:N.x,y:N.y,scrollTop:!0},u-D)},v=(D,A,O,{y:N})=>{let k=f[A];this.setTransform(O,D,A,{x:k,y:N,scrollLeft:!0},a-A)},P=(D,A,O,N)=>{this.setTransform(O,D,A,{x:N.x,y:m[D],scrollTop:!0},l-D)},w=(D,A,O,{x:N,y:k})=>{this.setTransform(O,D,A,{x:N,scrollLeft:!0,y:k,scrollTop:!0},1e5)},x=(D,A,O,{x:N})=>{this.setTransform(O,D,A,{x:N,scrollLeft:!0,y:m[D],scrollTop:!0},2e5)},E=(D,A,O,N)=>{this.setTransform(O,D,A,{x:f[A],y:N.y,scrollLeft:!0,scrollTop:!0},3e5)},M=(D,A,O)=>{this.setTransform(O,D,A,{x:f[A],y:m[D],scrollLeft:!0,scrollTop:!0},4e5)};if(s||c)for(let D=h;D<S;D++){for(let A=0;A<s;A++)C(D,A,I);if(c){let A=a-c;for(let O=A;O<a;O++)C(D,O,v)}}if(u||d)for(let D=y;D<T;D++){for(let A=0;A<u;A++)C(A,D,R);if(d){let A=l-d;for(let O=A;O<l;O++)C(O,D,P)}}if(s&&u)for(let D=0;D<u;D++)for(let A=0;A<s;A++)C(D,A,w);if(s&&d){let D=l-d;for(let A=D;A<l;A++)for(let O=0;O<s;O++)C(A,O,x)}if(c&&u){let D=a-c;for(let A=0;A<u;A++)for(let O=D;O<a;O++)C(A,O,E)}if(c&&d){let D=l-d,A=a-c;for(let O=D;O<l;O++)for(let N=A;N<a;N++)C(O,N,M)}};this.flushPendingAfterCommitWork=()=>{this.destroyed||this.cellManager.flushPendingAfterCommitWork()};this.destroy=()=>{this.destroyed||(this.destroyed=!0,this.reset(),this.onDestroy(),this.hoverRowUpdatesInProgress.clear(),this.hoverRowUpdatesInProgress=null,this.brain=null)};this.brain=t,this.debugId=n,this.cellManager=new oa(n,r.cellPool),this.cellManager.onCellAttachmentChange((c,u)=>{u?this.onCellAttached(c):this.onCellDetached(c)}),this.rowManager=new na(n,r.rowPool),this.rowManager.onRowAttachmentChange((c,u)=>{u?this.onRowAttached(c):this.onRowDetached(c)}),this.renderRange=this.renderRange.bind(this);let i=t.onScroll(this.adjustFixedElementsOnScroll),a=t.onAvailableSizeChange(()=>{this.adjustFixedElementsOnScroll(),Ge(()=>{this.destroyed||this.adjustFixedElementsOnScroll()})}),l=t.onScrollStart(this.onScrollStart),s=t.onScrollStop(this.onScrollStop);this.onDestroy=()=>{i(),a(),l(),s()}}getInfiniteNode(t){return this.infiniteNode||(this.infiniteNode=Zl(t)),this.infiniteNode}onCellAttached(t){if(this.cellDetachedClassNames.length){let n=t.getElement();n&&this.cellDetachedClassNames.forEach(r=>{n.classList.remove(r)})}}onCellDetached(t){if(this.cellDetachedClassNames.length){let n=t.getElement();n&&this.cellDetachedClassNames.forEach(r=>{n.classList.add(r)})}}onRowAttached(t){if(this.cellDetachedClassNames.length){let n=t.getElement();n&&this.cellDetachedClassNames.forEach(r=>{n.classList.remove(r)})}}onRowDetached(t){if(this.cellDetachedClassNames.length){let n=t.getElement();n&&this.cellDetachedClassNames.forEach(r=>{n.classList.add(r)})}}isCellRenderedAndMappedCorrectly(t,n){let r=!!this.cellManager.getCellAt([t,n]);return{rendered:r,mapped:r}}renderRange(t,{renderCell:n,renderDetailRow:r,force:i,onRender:a}){if(this.destroyed)return[];let{start:l,end:s}=t,c=this.brain.isHorizontalLayoutBrain,{rowManager:u,cellManager:d}=this,p=this.getFixedRanges(t),f=[t,...p],m=this.brain.getAlwaysRenderedColumns();if(m.length>0){let w=t.start[1],x=t.end[1];m.forEach(E=>{w<=E&&E<x||f.push({start:[t.start[0],E],end:[t.end[0],E+1]})})}let g=new Map,b=f.map(this.getExtraSpanCellsForRange).flat();b&&b.forEach(([w,x])=>{g.set(`${w}:${x}`,!0)});let h=f.reduce((w,x)=>w+Is(x),0),y=r?f.reduce((w,x)=>w+gf(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 I=hf(...f.map(w=>d.getCellsOutsideRenderRange(w)));I=bf(I,w=>{let x=d.getCellPosition(w);return!(x&&g.has(`${x[0]}:${x[1]}`))}),d.detachCells(I),d.poolSize=C;let R=new Map,v=new Map;f.forEach(w=>{let{start:x,end:E}=w,[M,D]=x,[A,O]=E;for(let N=M;N<A;N++){for(let F=D;F<O;F++){let V=`${N}:${F}`;if(R.has(V))continue;R.set(V,!0);let{rendered:j,mapped:L}=this.isCellRenderedAndMappedCorrectly(N,F);if(N===M||F===D){let H=this.isCellCovered(N,F);if(H&&g.has(`${H[0]}:${H[1]}`)){let q=d.getCellAt([N,F]);q!=null&&d.detachCell(q);continue}}if(j&&!i&&L)continue;let U;j?U=d.getCellAt([N,F]):U=d.getCellFor([N,F],c?"row":"column"),U==null&&(U=d.getDetachedCell()),this.renderCellAt(N,F,U,n)}!r||v.has(N)||(v.set(N,!0),u.isRowAttachedAt(N)&&!i)||this.renderDetailRowAtElement(N,this.rowManager.getRowFor(N),r)}}),b.forEach(([w,x])=>{let{rendered:E,mapped:M}=this.isCellRenderedAndMappedCorrectly(w,x);if(E){if(i||!M){let A=[w,x],O=d.getCellAt(A);this.renderCellAt(w,x,O,n)}return}let D=d.getCellFor([w,x],c?"row":"column");D!=null&&this.renderCellAt(w,x,D,n)});let P=d.getAllCells().map(w=>w.getNode());return r&&u.getAllRows().forEach(w=>{P.push(w.getNode())}),this.adjustFixedElementsOnScroll(),a&&a(P),P}renderDetailRowAtElement(t,n,r){if(this.destroyed)return;let i=!1,a=this.brain.getRowHeight(t),l=this.brain.isRowFixedStart(t)?"start":this.brain.isRowFixedEnd(t)?"end":!1,c=r({rowIndex:t,height:a,rowFixed:l,hidden:!!i,onMouseEnter:()=>{},onMouseLeave:()=>{},domRef:n.ref});if(n.isMounted()||n.onMount(u=>{let d=u.getElement();d&&(d.style.position="absolute",d.style.left="0px"),this.updateDetailElementPosition(u)}),!c){this.rowManager.detachRow(n);return}this.rowManager.renderNodeAtRow(c,n,t),this.updateDetailElementPosition(n)}getCellRealCoordinates(t,n){return{rowIndex:t,colIndex:n}}getMatrixRowIndexFromElement(t){let n=Number(t.dataset.rowIndex);return this.brain.isHorizontalLayoutBrain?this.brain.getRowIndexInPage(n):n}renderCellAt(t,n,r,i){if(this.destroyed)return;let a=this.isCellCovered(t,n),l=this.brain.getRowHeight(t),s=this.brain.getColWidth(n),c=this.brain.getRowspan(t,n),u=this.brain.getColspan(t,n),d=c===1?l:this.brain.getRowHeightWithSpan(t,n,c),p=u===1?s:this.brain.getColWidthWithSpan(t,n,u),{row:f,col:m}=this.isCellFixed(t,n),g=!!a,{rowIndex:b,colIndex:h}=this.getCellRealCoordinates(t,n),y=i({rowIndex:b,colIndex:h,height:l,width:s,rowspan:c,colspan:u,rowFixed:f,colFixed:m,hidden:g,heightWithRowspan:d,widthWithColspan:p,onMouseEnter:this.onMouseEnterNotBound,onMouseLeave:this.onMouseLeaveNotBound,domRef:r.ref});r.isMounted()||r.onMount(C=>{let I=C.getElement();I&&(I.style.position="absolute",I.style.left="0px",I.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}this.cellManager.renderNodeAtCell(y,r,[t,n],S),this.updateElementPosition(r,{hidden:g,rowspan:c,colspan:u})}reset(){this.cellManager.reset(),this.rowManager.reset()}};var ra=class extends qn{constructor(t,n,r){super(t,n,r);this.setTransform=(t,n,r,i,a)=>{let l=this.getCellRealCoordinates(n,r),{y:s}=i,c=Math.floor(l.rowIndex/this.brain.rowsPerPage),u=ge.runtime.totalVisibleColumnsWidthVar,d=c?`calc(${u} * ${c})`:"0px",p=we.columnOffsets.get(l.colIndex),f=`${ws}-${l.colIndex}`,m=`${s}px`;t.__currentTransformY!==m&&(t.__currentTransformY=m,t.style.setProperty(fn,m));let g=`calc(var(${f}, ${p}) + ${d})`,b=`var(${fn})`,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}}};var If=B(require("react"));var Xn=class Xn extends yt{constructor(t){super(t);this.cellRemoveSubscription=Ie();this.cellAttachmentChangeSubscription=Ie();this.attachedCells=new Set,this.detachedCells=new Set,this.allCellsOrdered=new Set}destroy(){this.reset()}onRemoveCell(t){return this.cellRemoveSubscription.onChange(r=>{r!=null&&t(r)})}onCellAttachmentChange(t){return this.cellAttachmentChangeSubscription.onChange(r=>{if(r==null)return;let{cell:i,attached:a}=r;t(i,a)})}reset(){this.attachedCells.clear(),this.detachedCells.clear(),this.allCellsOrdered.clear(),this.cellRemoveSubscription.destroy(),this.cellAttachmentChangeSubscription.destroy()}getAttachedCells(){return this.attachedCells}getDetachedCells(){return this.detachedCells}getAllCells(){return this.allCellsOrdered}createCell(){let t=this.createCellInstance();return this.detachedCells.add(t),this.allCellsOrdered.add(t),t}removeCell(t){this.detachedCells.delete(t),this.attachedCells.delete(t),this.allCellsOrdered.delete(t),t.destroy(),this.cellRemoveSubscription(t)}attachCell(t){return t&&this.attachedCells.has(t)||(t||(t=this.getDetachedCell()),this.detachedCells.delete(t),this.attachedCells.add(t),this.cellAttachmentChangeSubscription({cell:t,attached:!0})),t}detachCell(t){return this.detachedCells.has(t)?!1:(this.attachedCells.delete(t),this.detachedCells.add(t),this.cellAttachmentChangeSubscription({cell:t,attached:!1}),!0)}getDetachedCell(){let{detachedCells:t}=this,n=t.values().next().value;return n||(this.poolSize+=Xn.POOL_SIZE_INCREMENT,n=t.values().next().value),n||this.error("No cells available in the pool!"),n}get attachedSize(){return this.attachedCells.size}get detachedSize(){return this.detachedCells.size}get poolSize(){return this.allCellsOrdered.size}flushPendingAfterCommitWork(){for(let t of this.attachedCells)t.flushPendingAfterCommitWork()}set poolSize(t){t=Math.ceil(t/Xn.POOL_SIZE_INCREMENT)*Xn.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--}};Xn.POOL_SIZE_INCREMENT=1;var ia=Xn;var Cf=new Map,iT=()=>{},vs=class{constructor(e,t){this.element=null;this.mounted=!1;this.pendingAfterCommitWork=null;this.mountSubscription=Ie();let n=Cf.get(e)??0,r=`${e}:GridCellReact:${n}`;Cf.set(e,n+1),this.debugId=r,this.cellInfo=t,this.updater=Ie(),this.node=If.createElement(Go,{key:r,name:r,updater:this.updater}),this.ref=i=>{this.element=i,i?(this.mounted=!0,this.mountSubscription(this)):this.mounted=!1}}setPendingAfterCommitWork(e){this.pendingAfterCommitWork=e}flushPendingAfterCommitWork(){if(this.pendingAfterCommitWork){let e=this.pendingAfterCommitWork;this.pendingAfterCommitWork=null,e()}}isMounted(){return this.mounted}onMount(e){return this.mountSubscription.onChange(n=>{n!=null&&e(n)})}destroy(){this.mountSubscription.destroy(),this.updater.destroy(),this.pendingAfterCommitWork=null,this.ref=iT,this.element=null,this.node=null}getNode(){return this.node}update(e,t){this.updater(e),this.cellInfo=t}getAdditionalInfo(){return this.cellInfo}getElement(){return this.element}},aa=class extends ia{constructor(t){super(`${t}:GridCellPoolForReact`);this.cellDebugId=t}createCellInstance(){return new vs(this.cellDebugId)}};var wf=B(require("react"));var Zn=class Zn extends yt{constructor(t){super(t);this.rowRemoveSubscription=Ie();this.rowAttachmentChangeSubscription=Ie();this.attachedRows=new Set,this.detachedRows=new Set,this.allRowsOrdered=new Set}destroy(){this.reset()}onRemoveRow(t){return this.rowRemoveSubscription.onChange(r=>{r!=null&&t(r)})}onRowAttachmentChange(t){return this.rowAttachmentChangeSubscription.onChange(r=>{if(r==null)return;let{row:i,attached:a}=r;t(i,a)})}reset(){this.attachedRows.clear(),this.detachedRows.clear(),this.allRowsOrdered.clear(),this.rowRemoveSubscription.destroy(),this.rowAttachmentChangeSubscription.destroy()}getAttachedRows(){return this.attachedRows}getDetachedRows(){return this.detachedRows}getAllRows(){return this.allRowsOrdered}createRow(){let t=this.createRowInstance();return this.detachedRows.add(t),this.allRowsOrdered.add(t),t}removeRow(t){this.detachedRows.delete(t),this.attachedRows.delete(t),this.allRowsOrdered.delete(t),t.destroy(),this.rowRemoveSubscription(t)}attachRow(t){return t&&this.attachedRows.has(t)||(t||(t=this.getDetachedRow()),this.detachedRows.delete(t),this.attachedRows.add(t),this.rowAttachmentChangeSubscription({row:t,attached:!0})),t}detachRow(t){return this.detachedRows.has(t)?!1:(this.attachedRows.delete(t),this.detachedRows.add(t),this.rowAttachmentChangeSubscription({row:t,attached:!1}),!0)}getDetachedRow(){let{detachedRows:t}=this,n=t.values().next().value;return n||(this.poolSize+=Zn.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/Zn.POOL_SIZE_INCREMENT)*Zn.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--}};Zn.POOL_SIZE_INCREMENT=1;var la=Zn;var Rf=new Map,aT=()=>{},Ps=class{constructor(e){this.element=null;this.mounted=!1;this.mountSubscription=Ie();let t=Rf.get(e)??0,n=`${e}:ListRowReact:${t}`;Rf.set(e,t+1),this.debugId=n,this.updater=Ie(),this.node=wf.createElement(Go,{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=aT,this.element=null,this.node=null}getNode(){return this.node}update(e){this.updater(e)}getElement(){return this.element}},sa=class extends la{constructor(t){super(`${t}:ListRowPoolForReact`);this.rowDebugId=t}createRowInstance(){return new Ps(this.rowDebugId)}};function vf(o){return{cellPool:new aa(o),rowPool:new sa(o)}}function $r(o){let e=o.isHorizontalLayoutBrain?new ra(o,`${o.name}:HorizontalLayoutTableRenderer`,vf(`${o.name}:HorizontalLayoutTableRenderer`)):new qn(o,`${o.name}:ReactHeadlessTableRenderer`,vf(`${o.name}:ReactHeadlessTableRenderer`)),t=Ie();return o.onDestroy(()=>{e.destroy(),t.destroy()}),{renderer:e,onRenderUpdater:t}}function lT(o){let{brain:e,renderCell:t,renderDetailRow:n,forceRerenderTimestamp:r}=o,{renderer:i,onRenderUpdater:a}=(0,mn.useMemo)(()=>o.onRenderUpdater&&o.renderer?{renderer:o.renderer,onRenderUpdater:o.onRenderUpdater}:$r(e),[e,o.onRenderUpdater,o.renderer]);return(0,mn.useLayoutEffect)(()=>{i.cellHoverClassNames=o.cellHoverClassNames||[]},[i,o.cellHoverClassNames]),(0,mn.useLayoutEffect)(()=>{i.cellDetachedClassNames=o.cellDetachedClassNames||[]},[i,o.cellDetachedClassNames]),(0,mn.useLayoutEffect)(()=>{let l=e.getRenderRange();return i.renderRange(l,{onRender:a,force:!0,renderCell:t,renderDetailRow:n}),e.onRenderRangeChange(c=>{i.renderRange(c,{force:!1,onRender:u=>{let d=a.get();d&&u&&d.length===u.length||a(u)},renderCell:t,renderDetailRow:n})})},[i,e,t,n,a,r]),(0,mn.useLayoutEffect)(()=>{i.flushPendingAfterCommitWork()}),ca.createElement(Go,{updater:a})}var ua=ca.memo(lT);var Ur=B(require("react")),Qn=require("react");var Pf=ye({defaultClassName:"nxbq1c1 _16lm1iwz _16lm1iw2",variantClassNames:{visible:{true:"nxbq1c3",false:"nxbq1c4"}},defaultVariants:{},compoundVariants:[]}),da="nxbq1c0 _16lm1iwz _16lm1iw4 _16lm1iw26 _16lm1iw23 _16lm1iw1y _16lm1iw1k";var Df=ye({defaultClassName:"j26lrx0 _16lm1iwz _16lm1iw2 _16lm1iw23 _16lm1iw26",variantClassNames:{active:{true:"j26lrx2",false:"j26lrx3"}},defaultVariants:{},compoundVariants:[]});var{rootClassName:sT}=ke,cT=`${sT}-ActiveRowIndicator`,uT=`calc(${J.activeCellRowOffsetX} + var(${Q(J.scrollLeftForActiveRowWhenHorizontalLayout)}, 0px))`,dT={[Q(J.activeCellOffsetY)]:J.activeCellRowOffset,transform:`translate3d(${uT}, calc( ${J.activeCellOffsetY} + var(${Q(J.scrollTopForActiveRow)}, 0px)), 0px)`,height:J.activeCellRowHeight,maxWidth:ge.runtime.totalVisibleColumnsWidthVar},pT=o=>{let{brain:e}=o,t=(0,Qn.useRef)(null),n=o.activeRowIndex!=null&&e.getInitialRows()>o.activeRowIndex,[r,i]=Ut();return(0,Qn.useLayoutEffect)(()=>{if(o.activeRowIndex==null)return;let a="0px",l=o.activeRowIndex;if(e.isHorizontalLayoutBrain&&e.rowsPerPage){let p=e.getPageIndexForRow(l);p>0&&(a=`calc(${ge.runtime.totalVisibleColumnsWidthVar} * ${p})`),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};Vn(d,u)},[o.activeRowIndex,e]),(0,Qn.useEffect)(()=>{let a=c=>{Vn({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]),Ur.createElement("div",{className:da,"data-name":"active-row"},Ur.createElement("div",{ref:t,"data-name":"active-row-indicator",className:`${cT} ${Df({active:n})}`,style:n?dT:void 0}))},xf=Ur.memo(pT);var Yr=B(require("react")),Jn=require("react");var{rootClassName:fT}=ke,mT=`${fT}-ActiveCellIndicator`,gT=Q(J.columnZIndexAtIndex),hT=(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;Vn({activeCellRowHeight:`${i}px`,activeCellRowOffset:`${a}px`},l)},bT=o=>{let{brain:e}=o,[t,n]=Ut(),r=(0,Jn.useRef)(null),i=o.activeCellIndex!=null&&e.getInitialRows()>o.activeCellIndex[0];return(0,Jn.useLayoutEffect)(()=>{hT(e,o.activeCellIndex,o.rowHeight,r)},[o.activeCellIndex,o.rowHeight,e]),(0,Jn.useEffect)(()=>{let a=e.onRenderCountChange(()=>{n()});return()=>{a()}},[e]),Yr.createElement("div",{className:da,ref:r,"data-name":"active-cell",style:i?{zIndex:`var(${gT}-${o.activeCellIndex[1]})`}:void 0},Yr.createElement("div",{"data-name":"active-cell-indicator",className:`${mT} ${Pf({visible:i})}`}))},Mf=Yr.memo(bT);var pa=[dp,`${ft}DetachedCell`];function fa(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 yT=te(of,ys);function Ef(o){let{brain:e,scrollerDOMRef:t,scrollStopDelay:n,renderCell:r,renderDetailRow:i,activeCellRowHeight:a,cellHoverClassNames:l,renderer:s,activeRowIndex:c,activeCellIndex:u,onRenderUpdater:d,wrapRowsHorizontally:p,forceRerenderTimestamp:f,scrollVarHostRef:m,...g}=o,{autoFocus: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(),Dn(I,()=>{let P={height:I.clientHeight,width:I.clientWidth};e.update(P)},{debounce:50})):void 0},[p,e]);let T=(0,Vt.useCallback)(I=>{requestAnimationFrame(()=>{h.current&&h.current.style.setProperty("transform",`translate3d(${-I.scrollLeft}px, ${-I.scrollTop}px, 0px)`)})},[]),C=(0,Vt.useCallback)(I=>{e.setScrollPosition(I,T)},[e,T]);return(0,Vt.useEffect)(()=>{let I=e.onRenderCountChange(()=>{S(e.getVirtualizedContentSize())});return S(e.getVirtualizedContentSize()),T(e.getScrollPosition()||{scrollLeft:0,scrollTop:0}),I},[e]),gn.createElement(pf,{onContainerScroll:C,...g,ref:t},gn.createElement("div",{ref:h,className:yT,"data-name":"scroll-transform-target"},gn.createElement(ua,{forceRerenderTimestamp:f,renderer:s,onRenderUpdater:d,renderCell:r,renderDetailRow:i,brain:e,cellHoverClassNames:l,cellDetachedClassNames:pa}),u!=null?gn.createElement(Mf,{brain:e,rowHeight:a,activeCellIndex:u}):null),c!=null?gn.createElement(xf,{brain:e,activeRowIndex:c}):null,gn.createElement(tf,{width:y.width,height:y.height}))}function Af(o,e,t,n){let r=new Map,i=new Map,a=new Map;o.forEach((u,d)=>{let p=u.id,f=o[d-1],m=f?.id??"",g=new Set,b=f?.computedPinned!==u.computedPinned?new Set:a.get(m)??new Set;a.set(p,g);let h={type:"column",id:p,ref:u,groupOffset:0,computedPinned:u.computedPinned,computedWidth:u.computedWidth,depth:u.columnGroup?(t.get(u.columnGroup)??0)+1:0};r.set([p],h);let y=u.columnGroup,S,T=h;for(;y;){let C=e[y];if(C){g.add(y);let I=[p,...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(I,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((p,f)=>p+f.ref.computedWidth,0);u.groupOffset=c,u.computedWidth=d,u.type==="group"&&_f(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 _f(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"&&_f(t.children),e+=n})}var Ko=B(require("react")),ho=require("react");var xs=B(require("react"));var Nf=B(require("react")),Ds=require("react");var qr=require("react"),Xr=B(require("react"));var{rootClassName:ST}=ke,TT=`${ST}HeaderCell_ResizeHandle`;function CT(o){let e=(0,qr.useRef)(null),[t,n]=(0,qr.useState)(!1),r=(0,qr.useRef)(t);r.current=t;let i=o.groupColumns[0];if(!i)return null;let a=i.computedPinned,l=i.computedFirstInCategory,s=i.computedLastInCategory,c=d=>{d.stopPropagation();let p=d.pointerId,f=d.clientX,m=d.target;m.setPointerCapture(p);let g=!0,b=Lp(o.groupColumns.map(T=>T.computedVisibleIndex),{columns:o.columns,domRef:e}),h=T=>{a==="end"&&(T*=-1);let{constrained:C,adjustedDiffs:I,adjustedDiff:R}=o.computeResize(T);return r.current!==C&&n(C),b.resize(I),R},y=T=>{if(g){let C=o.groupColumns.reduce((v,P)=>v+P.computedWidth-P.computedMinWidth,0),I=o.brain.getAvailableSize(),R={width:I.width+C,height:I.height};o.brain.update(R),g=!1}h(Math.round(T.clientX-f))},S=T=>{m.releasePointerCapture(p),m.removeEventListener("pointermove",y),m.removeEventListener("pointerup",S);let C=Math.round(T.clientX-f),I=h(C);o.onResize(I)};m.addEventListener("pointermove",y),m.addEventListener("pointerup",S)},u=(a===!1||a==="start")&&s?{right:a==="start"?void 0:ge.components.HeaderCell.resizeHandleWidth}:a==="end"&&l?{right:void 0}:void 0;return Xr.createElement("div",{ref:e,className:`${TT} ${Yi} ${Xi({computedPinned:a,computedFirstInCategory:l,computedLastInCategory:s})}`,onPointerDown:c},Xr.createElement("div",{style:{...u,...o.style},className:qi({constrained:t})}))}var Of=Xr.memo(CT);function Ff(o,e){let{bodyBrain:t,groupHeight:n,columnGroup:r,columnGroupsMaxDepth:i}=e,{computedVisibleColumns:a,getState:l,getComputed:s,actions:c}=oe(g=>({computedVisibleColumns:g.computed.computedVisibleColumns,getState:g.getState,getComputed:g.getComputed,actions:g.actions})),u=o[o.length-1],d=(0,Ds.useCallback)(g=>{let b=l(),{columnSizing:h,viewportReservedWidth:y,bodySize:S}=b,T=s().computedVisibleColumns,C=!1,I=T.reduce((P,w)=>(w.computedFlex&&(P[w.id]={...h[w.id],flex:w.computedWidth},C=!0),P),{}),R=C?{...h,...I}:h;return ld({availableSize:S.width,reservedWidth:y||0,dragHandleOffset:g,dragHandlePositionAfter:u.computedVisibleIndex,columnSizing:R,columnGroupSize:o.length,items:T.map(P=>({id:P.id,resizable:P.computedResizable,computedFlex:P.computedFlex,computedWidth:P.computedWidth,computedMinWidth:P.computedMinWidth,computedMaxWidth:P.computedMaxWidth}))})},[u]),p=(0,Ds.useCallback)(g=>{let{columnSizing:b,reservedWidth:h}=d(g);c.viewportReservedWidth=h,c.columnSizing=b},[d]);return o.some(g=>g.computedResizable)?Nf.createElement(Of,{brain:t,style:{height:n*(i-r.depth+2)},columns:a,groupColumns:o,computeResize:d,onResize:p}):null}var Lf=`${ft}HeaderGroup`,kf=Q(J.columnWidthAtIndex),IT=Q(J.columnZIndexAtIndex);function zf(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=Ff(n,{bodyBrain:r,groupHeight:t,columnGroup:e,columnGroupsMaxDepth:i}),c=n[0],u=n.length>1?"calc( "+n.map(f=>`var(${kf}-${f.computedVisibleIndex})`).join(" + ")+" )":`var(${kf}-${c.computedVisibleIndex})`,d=`calc(var(${IT}-${c.computedVisibleIndex}) + ${i-e.depth})`,p=typeof l=="function"?l({columnGroup:e,horizontalLayoutPageIndex:o.horizontalLayoutPageIndex}):l;return p=p&&typeof p=="object"?p:{},p.width=u,p.height=t,xs.createElement("div",{ref:o.domRef,"data-group-id":e.uniqueGroupId,className:te(Zu,Lf),style:p,"data-z-index":d},xs.createElement("div",{className:te(`${Lf}__header-content`,Yt)},a),s)}var Vf=require("react");var As=B(require("react")),Ms;function _s(){return Ms||(Ms=As.createContext({dataSourceApi:null,getDataSourceState:()=>null,assignState:()=>null,getDataSourceMasterContext:()=>{},dataSourceState:null,dataSourceActions:null}))}var Es;function ma(){return Es||(Es=As.createContext(null))}function Ae(o){let e=ma(),t=(0,Vf.useContext)(e);return xn(t,o)}function eo(){return Ae(o=>({getDataSourceState:o.getDataSourceState,getDataSourceMasterContext:o.getDataSourceMasterContext,dataSourceActions:o.dataSourceActions,dataSourceApi:o.dataSourceApi,assignState:o.assignState}))}var{rootClassName:RT}=ke,wT=[],Gf=`${RT}Header`,vT=$u({overflow:!1}),Hf=()=>{};function PT(o){let{bodyBrain:e,headerBrain:t,columns:n,style:r,className:i,columnHeaderHeight:a,columnAndGroupTreeInfo:l,columnGroupsMaxDepth:s}=o,{getState:c,headerOptions:u,headerRenderer:d,headerOnRenderUpdater:p,showColumnFilters:f,computedColumnsMap:m}=oe(E=>({computedColumnsMap:E.computed.computedColumnsMap,getState:E.getState,headerOptions:E.state.headerOptions,headerRenderer:E.state.headerRenderer,headerOnRenderUpdater:E.state.headerOnRenderUpdater,showColumnFilters:E.state.showColumnFilters})),g=(0,ho.useRef)(null),b=(0,ho.useCallback)(E=>{g.current&&(g.current.style.transform=`translate3d(-${E.scrollLeft}px, 0px, 0px)`)},[]);(0,ho.useEffect)(()=>{let E=t.onScroll(b);return b(t.getScrollPosition()||{scrollLeft:0,scrollTop:0}),E},[t]);let h={ref:g,className:te(Gf,`${Gf}--virtualized`,i,vT),style:{...r,height:a}},{getDataSourceState:y,dataSourceApi:S,dataSourceActions:T}=eo(),{allRowsSelected:C,someRowsSelected:I,selectionMode:R,filterTypes:v,filterDelay:P}=Ae(E=>({allRowsSelected:E.dataSourceState.allRowsSelected,someRowsSelected:E.dataSourceState.someRowsSelected,selectionMode:E.dataSourceState.selectionMode,filterTypes:E.dataSourceState.filterTypes,filterDelay:E.dataSourceState.filterDelay})),w=(0,ho.useMemo)(()=>({allRowsSelected:C,someRowsSelected:I,selectionMode:R}),[C,I,R]),x=(0,ho.useCallback)(E=>{let{rowIndex:M,colIndex:D,domRef:A,height:O,widthWithColspan:N,heightWithRowspan:k,hidden:F}=E,V=n[D];if(!V||F)return null;let j=t.isHorizontalLayoutBrain?t.getPageIndexForRow(M):null,L=l?l.pathsToCells.get([M,D]):null;if(L&&L.type==="group"){let U=L.columnItems.map(ne=>ne.ref),H={...L.ref,id:L.id,uniqueGroupId:L.uniqueGroupId,depth:L.depth,columns:U.map(ne=>ne.id),computedWidth:L.computedWidth,groupOffset:L.groupOffset};return c().columnGroupVisibility[L.id]!==!1?Ko.createElement(zf,{horizontalLayoutPageIndex:j,bodyBrain:e,columnGroupsMaxDepth:s,domRef:A,columns:U,width:N,height:O,columnGroup:H}):null}return Ko.createElement(Bf,{domRef:A,column:V,horizontalLayoutPageIndex:j,headerOptions:u,dataSourceStatePartialForHeaderCell:w,filterTypes:v,filterDelay:P,getDataSourceState:y,dataSourceApi:S,dataSourceActions:T,width:N,height:k,columnsMap:m})},[u,n,a,l,s,f,t,y,S,T,v,P,w]);return Ko.createElement(Vo,{orientation:"horizontal",dragListId:"header",dragStrategy:"inline",onDrop:Hf,updatePosition:Hf},E=>Ko.createElement("div",{...E,...h,className:te(E.className,h.className)},Ko.createElement(ua,{name:"header",renderCell:x,brain:t,renderer:d,onRenderUpdater:p,cellHoverClassNames:wT,cellDetachedClassNames:pa})))}var Kf=Ko.memo(PT);function Wf(o){let{headerBrain:e,bodyBrain:t,scrollbars:n}=o,{computedPinnedStartColumns:r,computedPinnedEndColumns:i,computedVisibleColumns:a,columnSize:l}=oe(I=>({computedPinnedStartColumns:I.computed.computedPinnedStartColumns,computedPinnedEndColumns:I.computed.computedPinnedEndColumns,computedVisibleColumns:I.computed.computedVisibleColumns,columnSize:I.computed.columnSize})),{columnHeaderHeight:s,columnGroupsDepthsMap:c,columnGroupsMaxDepth:u,computedColumnGroups:d,showColumnFilters:p}=oe(I=>({columnHeaderHeight:I.state.columnHeaderHeight,columnGroupsDepthsMap:I.state.columnGroupsDepthsMap,columnGroupsMaxDepth:I.state.columnGroupsMaxDepth,computedColumnGroups:I.state.computedColumnGroups,showColumnFilters:I.state.showColumnFilters})),f=!d||!Object.keys(d).length?1:u+2,m=f*s+(p?s:0),g=Gt.useMemo(()=>{if(!(!d||!Object.keys(d).length))return Af(a,d,c,u)},[a,d,c]),b=Gt.useCallback(({rowIndex:I,colIndex:R})=>{let v=a[R],P=1,w=1;if(!v||!g)return{rowspan:P,colspan:w};let x=g.pathsToCells.get([I,R]);if(!x)return{rowspan:P,colspan:w};if(x.type==="column")return{colspan:w,rowspan:f-x.depth};let E=x.columnItems.findIndex(M=>M.id===v.id);return{rowspan:P,colspan:E===0?x.columnItems.length:1}},[d,u,a,g,f,c]),h=Gt.useCallback(({rowIndex:I,colIndex:R})=>b({rowIndex:I,colIndex:R}).rowspan,[b]),y=Gt.useCallback(({rowIndex:I,colIndex:R})=>b({rowIndex:I,colIndex:R}).colspan,[b]),S=Gt.useCallback(I=>p?I<f-1?s:2*s:s,[f,p,s]);fa(e,{colWidth:l,rowHeight:S,rows:f,cols:a.length,height:m,rowspan:h,colspan:y},{fixedColsEnd:i.length,fixedColsStart:r.length});let T=Gt.createElement(Kf,{columns:a,headerBrain:e,bodyBrain:t,columnHeaderHeight:m,columnGroupsMaxDepth:u,columnAndGroupTreeInfo:g}),C=n.vertical&&Oo()?Gt.createElement("div",{className:Ju,style:{zIndex:1e3,width:Oo()}}):null;return Gt.createElement("div",{className:`${ls} ${nd}`,style:{height:m}},T,C)}var{ManagedComponentContextProvider:DT}=Ft({initSetupState:Qp,forwardProps:Jp,Context:bs()});function Os(o){let{getComputed:e,header:t,brain:n,headerBrain:r,wrapRowsHorizontally:i}=oe(l=>({getComputed:l.getComputed,header:l.state.header,brain:l.state.brain,headerBrain:l.state.headerBrain,wrapRowsHorizontally:l.state.wrapRowsHorizontally})),{scrollbars:a}=e();return t?Zr.createElement(DT,{...o},Zr.createElement(Wf,{wrapRowsHorizontally:!!i,bodyBrain:n,headerBrain:r,scrollbars:a})):null}function jf(){return Zr.useContext(bs()).componentState}var xT=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||po;return Ee.createElement(s,{domProps:{className:Gi},onChange:c=>{if(l){c?r.treeApi.selectAll():r.treeApi.deselectAll();return}c?n.rowSelectionApi.selectAll():n.rowSelectionApi.deselectAll()},checked:i})},$i=Ee.createContext(null);var MT=Q(J.columnZIndexAtIndex),ET=Q(J.columnVisibilityAtIndex),Ns=Ee.createElement("div",{className:Ii[1]}),Uf=wi({"data-name":"","data-field":"","data-header-align":"","data-column-id":"","data-sort":"","data-sort-index":"",[Rt]:"",[Br]:""});function AT(o){let e=o.column,{allowColumnHideWhileDragging:t}=jf(),{dataSourceStatePartialForHeaderCell:n,horizontalLayoutPageIndex:r,getDataSourceState:i,dataSourceApi:a,dataSourceActions:l,filterTypes:s,filterDelay:c}=o,{allRowsSelected:u,someRowsSelected:d,selectionMode:p}=n,{onDragItemPointerDown:f}=dn(),{api:m,getComputed:g,getState:b,actions:h,getDataSourceMasterContext:y,showColumnFilters:S,components:T,portalDOMRef:C,columnHeaderHeight:I,columnReorderDragColumnId:R,columnMenuVisibleForColumnId:v,columnReorderInPageIndex:P}=oe(Z=>({api:Z.api,getComputed:Z.getComputed,getState:Z.getState,actions:Z.actions,getDataSourceMasterContext:Z.getDataSourceMasterContext,showColumnFilters:Z.state.showColumnFilters,components:Z.state.components,portalDOMRef:Z.state.portalDOMRef,columnHeaderHeight:Z.state.columnHeaderHeight,columnReorderDragColumnId:Z.state.columnReorderDragColumnId,columnMenuVisibleForColumnId:Z.state.columnMenuVisibleForColumnId,columnReorderInPageIndex:Z.state.columnReorderInPageIndex})),w=R===e.id,x=P!=null?r!==P:!1,{onResize:E,height:M,width:D,headerOptions:A,columnsMap:O}=o,N=e.computedSortInfo,k=e.header,F=(0,bo.useCallback)(Z=>{z.current=Z,o.domRef?.(Z)},[o.domRef]),V=A.alwaysReserveSpaceForSortIcon,j=e.headerAlign??e.align,L=(typeof j=="function"?j({isHeader:!0,column:e}):j)??"start",U=(typeof e.verticalAlign=="function"?e.verticalAlign({isHeader:!0,column:e}):e.verticalAlign)??"center",H=mt(e,{actions:h,api:m,dataSourceActions:l,dataSourceApi:a,getComputed:g,getDataSourceState:i,getDataSourceMasterContext:y,getState:b}),q=H.isSortable(),ne=q&&(e.computedSorted||V)?Ee.createElement(Ui,{index:e.computedMultiSort?e.computedSortIndex+1:void 0,style:{marginInlineStart:ge.spacing[2],marginInlineEnd:ge.spacing[2]},className:`${an}__sort-icon ${ed} ${od({align:L})}`,direction:e.computedSorted?e.computedSortedAsc?1:-1:0}):null,me=e.computedFilterable&&e.computedFiltered?Ee.createElement(Nn,null):null,ie=e.headerCssEllipsis??e.cssEllipsis??!0,ue={reserveSpaceWhenHidden:L==="center",menuVisible:v===e.id,style:L==="end"?{marginInlineStart:`calc(${ge.components.HeaderCell.resizeHandleActiveAreaWidth} / 2)`,marginInlineEnd:ge.spacing[2]}:{marginInlineEnd:`calc(${ge.components.HeaderCell.resizeHandleActiveAreaWidth} / 2)`,marginInlineStart:ge.spacing[2]},domProps:{onMouseDown:Z=>{Z.stopPropagation(),H.toggleContextMenu(Z.target)}}},ce=e.components?.MenuIcon||T?.MenuIcon||Vr,Y=Ee.createElement(ce,{...ue}),z=(0,bo.useRef)(null),$={horizontalLayoutPageIndex:r,dragging:w,domRef:F,htmlElementRef:z,renderLocation:"column-header",column:e,columnsMap:O,columnSortInfo:N,columnFilterValue:e.computedFilterValue,filtered:e.computedFiltered,someRowsSelected:d,allRowsSelected:u,selectionMode:p,api:m,dataSourceApi:a,columnApi:H,renderBag:{sortIcon:ne,filterIcon:me,menuIcon:Y,menuIconProps:ue,selectionCheckBox:null,header:e.header&&typeof e.header!="function"?e.header:e.name}},X=$,W=X.renderBag.header,re=()=>{let Z={...$,renderBag:{...$.renderBag}};if(e.renderSortIcon&&(Z.renderBag.sortIcon=Ee.createElement(ko,{render:e.renderSortIcon,renderParam:{...Z,renderBag:{...Z.renderBag}}})),e.renderFilterIcon&&(Z.renderBag.filterIcon=Ee.createElement(ko,{render:e.renderFilterIcon,renderParam:{...Z,renderBag:{...Z.renderBag}}})),typeof e.renderMenuIcon=="function"&&(Z.renderBag.menuIcon=Ee.createElement(ko,{render:dt=>{if(typeof e.renderMenuIcon!="function")return null;let bt=e.renderMenuIcon(dt);return bt?bt.type===ce||bt.type===Vr?bt:Ee.createElement(ce,{...ue},bt):null},renderParam:{...Z,renderBag:{...Z.renderBag}}})),e.renderSelectionCheckBox&&p==="multi-row"){Z.renderBag.selectionCheckBox=Ee.createElement(ko,{render:xT,renderParam:{...Z,renderBag:{...Z.renderBag}}});let dt=e.renderHeaderSelectionCheckBox??e.renderSelectionCheckBox;dt&&dt!==!0&&(Z.renderBag.selectionCheckBox=Ee.createElement(ko,{render:dt,renderParam:{...Z,renderBag:{...Z.renderBag}}}))}k instanceof Function&&(Z.renderBag.header=W=Ee.createElement(ko,{render:k,renderParam:{...Z,renderBag:{...Z.renderBag}}}));let at=e.renderMenuIcon===!1?null:Z.renderBag.menuIcon,le=ie?Ee.createElement("div",{className:Yt},Z.renderBag.header):Z.renderBag.header,Fe=Ee.createElement(Ee.Fragment,null,L==="center"?Ns:null,Z.renderBag.selectionCheckBox,le,Z.renderBag.sortIcon,Z.renderBag.filterIcon,L==="center"?Ns:null,L!=="center"?Ns:null,at);return e.renderHeader?Ee.createElement(ko,{render:e.renderHeader,renderParam:{...Z,renderBag:{...Z.renderBag,all:Fe}}}):Fe};(0,bo.useEffect)(()=>{let Z=null,at=z.current;return E&&at&&(Z=Dn(at,E)),()=>{Z?.()}},[z.current,o.onResize]);let he={height:M};e.headerStyle&&(he=typeof e.headerStyle=="function"?{...he,...e.headerStyle(X)||{}}:{...he,...e.headerStyle});let be=typeof e.headerClassName=="function"?e.headerClassName(X):e.headerClassName,{onPointerDown:G,proxyPosition:_,dragColumnOutside:de}=lp({columnId:e.id,domRef:z,horizontalLayoutPageIndex:r,allowColumnHideOnDrag:t}),Te=null,xe=$i.Provider,Ce={filtered:e.computedFiltered,verticalAlign:U,align:L},Ne=Ee.useMemo(()=>{let Z=at=>{m.setColumnFilter(e.id,at)};return c>0?Ot(Z,{wait:c}):Z},[c,e.id]),Le=e.computedFilterType,He=s[Le],tt=e.computedFilterable?e.computedFilterValue?.filter.operator??He?.defaultOperator:void 0,Xe=e.computedFilterable&&He?He.operators.find(Z=>Z.name===tt):void 0,ot=Xe?.components?.FilterEditor||He?.components?.FilterEditor||e.components?.FilterEditor||zn,it=He?.components?.FilterOperatorSwitch||e.components?.FilterOperatorSwitch,K=Vp(e,{horizontalLayoutPageIndex:r}),ae=`var(${MT}-${e.computedVisibleIndex})`;he.zIndex=ae,he.visibility=`var(${ET}-${e.computedVisibleIndex}, visible)`;let fe={"data-field":`${e.field||""}`,"data-column-id":e.id,[Rt]:e.id,[Br]:"header","data-header-align":L,"data-name":"HeaderCell","data-sort":e.computedSortedAsc?"asc":e.computedSortedDesc?"desc":"none","data-sort-index":`${e.computedSortIndex??-1}`},Se=e.computedFilterable?Ee.createElement(bd,{horizontalLayoutPageIndex:r,filterEditor:ot,filterOperatorSwitch:it??yd,operator:Xe,filterTypes:s,onChange:Ne,columnFilterType:Le,columnLabel:e.field||e.name||e.id,columnFilterValue:e.computedFilterValue,columnHeaderHeight:I}):Ee.createElement(Sd,null);X.renderBag.filterEditor=Se;let qe=(0,bo.useCallback)(Z=>{G(Z),f(Z)},[G,f]),pe=re();return w&&_&&(Te=Ee.createElement("div",{key:e.id,className:`${an}Proxy ${Bu}`,style:{height:M,width:D,left:_.left??0,top:_.top??0}},Ee.createElement("div",{className:Wu({visible:de})},Ee.createElement(Zp,{size:16})),W),Te=(0,$f.createPortal)(Te,C.current)),Ee.createElement(xe,{value:X},Ee.createElement(Wi,{domRef:F,horizontalLayoutPageIndex:o.horizontalLayoutPageIndex,cellType:"header",column:e,...fe,"data-z-index":ae,style:he,width:D,onPointerDown:qe,contentClassName:te(Ku(Ce),yu[L]),contentStyle:S?{height:M/2}:void 0,className:te(an,Ru.none,q?hu.pointer:"",be,Oi(e,[an,fo],ju,{dragging:w,insideDisabledDraggingPage:x,align:L,verticalAlign:U,rowSelected:!1,cellSelected:!1,rowDisabled:!1,zebra:!1,rowActive:!1,firstRow:!0,firstRowInHorizontalLayoutPage:!0,treeNode:!1,groupCell:!1,groupRow:!1,rowExpanded:!1}),Hu),cssEllipsis:ie,afterChildren:Ee.createElement(Ee.Fragment,null,S?Se:null,K),renderChildren:pe}),Te)}var Bf=Ee.memo(AT);function Dr(){return(0,bo.useContext)($i)}var yo=B(require("react")),Zf=require("react");function Yf(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 qf={padding:ge.spacing[2],textAlign:"end",opacity:"1",visibility:"visible",display:"block",fontSize:"0.85rem",background:"white",color:"black"},_T={opacity:1,visibility:"visible",display:"inline-block",pointerEvents:"all",color:"black",textDecoration:"underline"},Xf=(o,e)=>{if(o)for(let[t,n]of Object.entries(e))o.style.setProperty(Yf(t),n,"important")},Qf=yo.forwardRef(function(e,t){let{rootClassName:n}=Ci(),r=yo.useRef(null),i=yo.useCallback(a=>{r.current=a,t&&(typeof t=="function"?t(a):t.current=a)},[]);return(0,Zf.useEffect)(()=>{let a=()=>{setTimeout(()=>{Xf(r.current,qf),Xf(r.current?.firstElementChild,_T)})};a();let l=setInterval(a,1e3);return()=>{clearInterval(l)}},[]),yo.createElement("div",{ref:i,...e,className:te(`${n}-Footer`,xd,e.className),style:qf},"Powered by"," ",yo.createElement("a",{href:"https://infinite-table.com",rel:"noopener noreferrer",role:"link",target:"_blank"},"Infinite Table"))});function Fs(o){return o.map(to)}function to(o){if(Me().structuredClone)return Me().structuredClone(o);if(o===null||typeof o!="object")return o;if(Array.isArray(o))return Fs(o);if(o instanceof Date)return new Date(o);if(o instanceof Set)return new Set(Fs(Array.from(o)));if(o instanceof Map)return new Map(Fs(Array.from(o)));let e={};for(let t in o)o.hasOwnProperty(t)&&(e[t]=to(o[t]));return e}function Qr(o){return o}var hn=Object.seal({data:null,field:null});var Wo="____root____",em="____not_loaded_yet____";function Bo(){return!1}function Ls(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 ga(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 tm(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 ee;function d(h,y,S,T=0,C=[]){let I=!S.length||T===S.length-1,R=y[c?.values||"values"]||{};for(let v in R)if(R.hasOwnProperty(v)){let P=v;C.push(P),p.set(C,!0),h.set(C,{reducerResults:R[v][c?.totals||"totals"]||{},items:[]}),I||d(h,R[v],S,T+1,C),C.pop()}}let p=r?new ee:void 0,f=[],m=Ls(n),g=to(m);e.visitDepthFirst((h,y,S,T)=>{let[C,...I]=y,R=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=R;for(let w=0,x=I.length;w<x;w++){let E=I.slice(0,w),M=u.get(E);M&&(M.items=M.items||[],M.items=M.items.concat(R))}R=a.indexArray(R,{toPrimaryKey:l,cache:s,nodesKey:void 0})}return T?.()}for(let P=0,w=R.length;P<w;P++){if(!R[P]){let D={items:[],reducerResults:{},cache:!1,childrenLoading:!1,childrenAvailable:!1,isTree:!1,isGroupBy:!0};u.set([...I,`${em}${P}`],D);continue}let x=R[P].data,E=R[P].keys||[];if(E.length){let D=E[E.length-1];I.push(D)}let M={items:[],cache:!1,childrenLoading:!1,childrenAvailable:!1,commonData:x,totalChildrenCount:R[P].totalChildrenCount,reducerResults:R[P].aggregations||{},isTree:!1,isGroupBy:!0};if(u.set(I,M),r){let D=M.pivotDeepMap=new ee,A=R[P].pivot;d(D,A,r,0,f)}E.length&&I.pop()}T?.()});let b={deepMap:u,groupParams:o,initialData:e,reducerResults:g};return r&&(b.topLevelPivotColumns=p,b.pivot=r),t&&t.end({details:[{name:"Group by fields",value:i.map(h=>h.field).join(", ")}]}),b}function Jf(o,e,t,n,r,i,a,l,s,c=Qr){let{items:u,reducerResults:d,pivotDeepMap:p}=o.get(e);if(u.push(n),a&&ga(n,r,a,d,e),i){for(let f=0,m=i.length;f<m;f++){let{field:g,valueGetter:b,toKey:h}=i[f],y=g?n[g]:null;b&&(hn.data=n,hn.field=g,y=b(hn));let S=(h||c)(y,n);t.push(S),p.has(t)||(l.set(t,!0),p?.set(t,{reducerResults:to(s),items:[]}));let{reducerResults:T,items:C}=p.get(t);C.push(n),a&&ga(n,r,a,T,e)}t.length=0}}function om(o,e,t,n,r,i,a,l){let{isLeafNode:s,getNodeChildren:c,toKey:u}=o,d=u(r),p=[...n,d],f=s(r);if(t.set(p,!0),f){for(let h=0,y=n.length;h<=y;h++){let S=n.slice(0,h),T=e.get(S),{reducerResults:C,items:I}=T;I.push(r),T.leavesAvailableCount++,T.totalLeafNodesCount++,a&&ga(r,i,a,C,S)}return}let m=to(l),g=[];e.set(p,{items:g,isTree:!0,isGroupBy:!1,node:r,reducerResults:m,cache:!1,childrenLoading:!1,childrenAvailable:!0,totalLeafNodesCount:0,leavesAvailableCount:0,treeNesting:n.length});let b=c(r);if(!(!b||!Array.isArray(b))){for(let h=0,y=b.length;h<y;h++){let S=b[h];om(o,e,t,p,S,h,a,l)}a&&Jr(a,m,g)}}function ks(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=Ls(t),i=to(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++)om(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 ba(o,e){let{marker:t,groupBy:n,defaultToKey:r=Qr,pivot:i,reducers:a}=o;t&&t.start();let l=n.length,s=i?new ee:void 0,c=new ee,u=[],d=[],p=Ls(a),f=to(p);if(!l){let g={items:[],isTree:!1,isGroupBy:!0,cache:!1,childrenLoading:!1,childrenAvailable:!1,reducerResults:to(p)};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:I,toKey:R}=n[S],v=T?h[T]:null;I&&(hn.data=h,hn.field=T,v=I(hn));let P=(R||r)(v,h);if(y[T||C]=P,u.push(P),!c.has(u)){let w={items:[],isTree:!1,isGroupBy:!0,cache:!1,commonData:{...y},childrenLoading:!1,childrenAvailable:!1,reducerResults:to(p)};i&&(w.pivotDeepMap=new ee),c.set(u,w)}Jf(c,u,d,h,g,i,a,s,p,r)}l||Jf(c,u,d,h,g,i,a,s,p,r),a&&ga(h,g,a,f,u),u.length=0}a&&(c.visitDepthFirst((g,b,h,y)=>{Jr(a,g.reducerResults,g.items),i&&g.pivotDeepMap.visitDepthFirst(({items:S,reducerResults:T},C,I,R)=>{Jr(a,T,S),R?.()}),y?.()}),Jr(a,f,e));let m={deepMap:c,groupParams:o,initialData:e,reducerResults:f};return i&&(m.topLevelPivotColumns=s,m.pivot=i),t&&t.end({details:[{name:"Group by fields",value:n.map(g=>g.field).join(", ")}]}),m}function nm(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 OT(o,e){let{groupBy:t,groupKeys:n,parents:r,reducers:i,lazyLoad:a}=o,l=n.length,{items:s,reducerResults:c,pivotDeepMap:u,commonData:d}=e,p=d??null,f;if(Object.keys(c).length>0){p={...d},f={};for(let y in i)if(i.hasOwnProperty(y)){let T=i[y].field;T&&(f[T]=c[y]),T&&p[T]==null&&(p[T]=c[y])}}let m=!0,g=n[n.length-1],b=g;if(p!=null){let y=t[n.length-1];y&&y.field&&(b=p[y.field]),y&&y.toKey&&(b=y.toKey(b,p)),b=b??g}return typeof b=="string"&&b.startsWith(em)&&(m=!1,b=null),{data:p,reducerData:f,groupCount:s.length,groupData:s,groupKeys:n,isTreeNode:!1,rowSelected:!1,selectedChildredCount:0,deselectedChildredCount:0,id:`${n}`,collapsed:!1,dataSourceHasGrouping:!0,rowDisabled:!1,isCellSelected:Bo,hasSelectedCells:Bo,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 ha(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 rm(o,e,t,n,r,i){let a=e.length,{isLeafNode:l,getNodeChildren:s}=r.treeParams,{toPrimaryKey:c,treeResult:u,isRowDisabled:d,isNodeSelected:p,withRowInfo:f,isNodeExpanded:m,treeSelectionState:g,repeatWrappedGroupRows:b,rowsPerPage:h}=r,{deepMap:y}=u,S=o.length,T=t[t.length-1],C=T?T.nodeExpanded:!0;for(let I=0;I<S;I++){let R=o[I],v=c(R,I),P=[...e,v];if(l(R)){let O={id:v,nodePath:P,isGroupRow:!1,data:R,treeNesting:a,totalLeafNodesCount:0,collapsedLeafNodesCount:0,isTreeNode:!0,isParentNode:!1,selfLoaded:!0,rowSelected:!1,rowDisabled:!1,isCellSelected:Bo,hasSelectedCells:Bo,dataSourceHasGrouping:!1,parentNodes:Array.from(t),indexInParentNodes:[...n,I],indexInParent:I,indexInAll:C?i.length:-1};p&&(O.rowSelected=p(O)),d&&(O.rowDisabled=d(O)),f&&f(O);let N=b&&h!=null&&h>0&&O.indexInAll%h===0?O.indexInAll/h:null;for(let k=0,F=t.length;k<F;k++){let V=t[k];if(C||(V.collapsedLeafNodesCount+=1),V.deepRowInfoArray.push(O),N!=null&&C){if(typeof b=="function"&&b(V)!==!0)continue;let j=ha(V,O.indexInAll,N);i[j.indexInAll]=j,O.indexInAll++}}C&&(i[O.indexInAll]=O);continue}let E=y.get(P)?.totalLeafNodesCount??0,M={dataSourceHasGrouping:!1,nodeExpanded:!1,selfExpanded:!1,nodePath:P,id:v,data:R,indexInAll:i.length,indexInParent:I,indexInParentNodes:[...n,I],totalLeafNodesCount:E,treeNesting:a,selfLoaded:!0,isParentNode:!0,isTreeNode:!0,isGroupRow:!1,deepRowInfoArray:[],parentNodes:Array.from(t),collapsedLeafNodesCount:0,rowSelected:!1,rowDisabled:!1,isCellSelected:Bo,hasSelectedCells:Bo,selectedLeafNodesCount:0,deselectedLeafNodesCount:0};if(p&&(M.rowSelected=p(M),g)){let O=g.getSelectionCountFor(M.nodePath);M.selectedLeafNodesCount=O.selectedCount,M.deselectedLeafNodesCount=O.deselectedCount}d&&(M.rowDisabled=d(M)),f&&f(M);let D=!0;if(m&&(M.selfExpanded=D=m(M)),C||(D=!1),M.nodeExpanded=D,C&&b&&h!=null&&h>0){let O=M.indexInAll,N=M.parentNodes;if(N.length>0&&O%h===0){let k=O/h,F=0;N.forEach(V=>{typeof b=="function"&&b(V)!==!0||(i.push(ha(V,O+F,k)),F++,M.indexInAll++)})}}C&&(i[M.indexInAll]=M);let A=s(R);Array.isArray(A)&&rm(A,P,[...t,M],M.indexInParentNodes,r,i)}return i}function im(o){let{dataArray:e,marker:t}=o;t&&t.start();let n=[];return rm(e,[],[],[],o,n),t&&t.end(),{data:n}}function am(o){let{marker:e,lazyLoad:t,groupResult:n,rowsPerPage:r,repeatWrappedGroupRows:i,withRowInfo:a,toPrimaryKey:l,groupRowsState:s,isRowDisabled:c,isRowSelected:u,rowSelectionState:d,generateGroupRows:p,reducers:f={}}=o,{groupParams:m,deepMap:g,pivot:b}=n,{groupBy:h}=m;e&&e.start({details:[{name:"Group by fields",value:h.map(I=>I.field).join(", ")}]});let y=[],S=[],T=[],C=[];return g.visitDepthFirst((I,R,v,P)=>{let w=I.items,x=R.length,E=s?.isGroupRowCollapsed(R)??!1;C.push(v);let M=OT({lazyLoad:t,groupBy:h,parents:Array.from(T),reducers:f,indexInGroup:v,indexInParentGroups:Array.from(C),indexInAll:y.length,groupKeys:R,error:I.error,totalChildrenCount:I.totalChildrenCount,childrenLoading:(I.childrenLoading||!E&&!I.childrenAvailable)&&t,childrenAvailable:I.childrenAvailable,directChildrenCount:R.length===h.length?I.items.length:g.getDirectChildrenSizeFor(R),directChildrenLoadedCount:0},I);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 D=T[T.length-1],A=D?.collapsed??!1;A&&(E=!0),M.collapsed=E;let O=p||E;if(A&&(O=!1),O){if(i&&r!=null&&r>0){let k=M.indexInAll,F=M.parents;if(F.length>0&&k%r===0){let V=k/r,j=0;F.forEach(L=>{typeof i=="function"&&i(L)!==!0||(y.push(ha(L,k+j,V)),j++,M.indexInAll++)})}}y.push(M),S.push(y.length-1)}M.collapsedChildrenCount=0,T.forEach(k=>{k.deepRowInfoArray.push(M),k.collapsedGroupsCount+=E?1:0}),D&&M.selfLoaded&&t&&(D.directChildrenLoadedCount+=1),a&&a(M),T.push(M);let N=!0;if(N){if(P)P();else if(!b){let k=y.length;E||(y.length+=w.length);let F=0;for(let V=0,j=w.length;V<j;V++){let L=w[V];if(!E&&i&&r!=null&&r>0){let ne=k+V+F;if(ne%r===0){let se=ne/r;T.forEach(me=>{if(typeof i=="function"&&i(me)!==!0)return;let ie=k+V+F;y[ie]=ha(me,ie,se),F++,y.length++})}}let U=k+V+F,q={id:L?l(L,U):`${R}-${V}`,data:L,isCellSelected:Bo,hasSelectedCells:Bo,dataSourceHasGrouping:!0,isTreeNode:!1,isGroupRow:!1,selfLoaded:!!L,rowSelected:!1,rowDisabled:!1,rootGroupBy:h,collapsed:E,groupKeys:R,parents:Array.from(T),indexInParentGroups:[...C,V],indexInGroup:V,indexInAll:U,groupBy:h,groupNesting:x+1,groupCount:M.groupCount};u&&(q.rowSelected=u(q)),c&&(q.rowDisabled=c(q)),a&&a(q),T.forEach((ne,se)=>{se===T.length-1&&L&&(ne.directChildrenLoadedCount+=1),E&&(ne.collapsedChildrenCount+=1),ne.deepRowInfoArray.push(q)}),E||(y[k+V+F]=q)}}}T.pop(),C.pop()}),e&&e.end(),{data:y,groupRowsIndexes:S}}var ya=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 ee(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 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 wt=class extends ya{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 Ht(){let o=Me().performance?.now();return`${Date.now()}:${o}`}function zs(...o){return(...t)=>{o.forEach(n=>{typeof n=="function"&&n(...t)})}}function Vs(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 Gs(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 lm({deepMap:o,pivotBy:e,pivotTotalColumnPosition:t,pivotGrandTotalColumnPosition:n,reducers:r={},showSeparatePivotColumnForSingleAggregation:i=!1}){let a=e.length,l=Object.keys(r).map(f=>({...r[f],id:f}));l.length||(i=!0,n=!1,t=!1,l.push({id:"__empty-aggregation-reducer__",name:"-",initialValue:null,reducer:()=>null}));let s={},c={},u=pt(function(){l.forEach((f,m)=>{s[`total:${f.id}`]=Vs({header:`${f.name||f.id} total`,pivotBy:e,pivotColumn:!0,pivotTotalColumn:!0,pivotAggregator:f,pivotAggregatorIndex:m,pivotGroupKeys:[],pivotGroupKey:"",pivotIndex:-1,valueFormatter:({rowInfo:g})=>g.isGroupRow?g.reducerResults?.[f.id]:null})})});(!a&&t==="start"||n==="start")&&u();let d=!i&&l.length===1;return o.visitDepthFirst((f,m,g,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]=Gs({header:`${C}`,columnGroup:T,pivotBy:e,pivotGroupKeys:m,pivotByAtIndex:h,pivotIndex:m.length-1,pivotGroupKey:C})}l.forEach((T,C)=>{let I=d?`${m[m.length-1]}`:T.name||T.id,R=Vs({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:I,valueFormatter:({rowInfo:P})=>P.isGroupRow?P.pivotValuesMap?.get(m)?.reducerResults[T.id]:null}),v=`${T.id}:${m.join("/")}`;s[v]=R})}else{let h=m.join("/"),y=m.slice(0,-1);if(c[h]=Gs({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]=Gs({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,I)=>{let R=d?`${m[m.length-1]} total `:`${C.name||C.id} total`,v=Vs({columnGroup:T,header:R,pivotAggregator:C,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:P})=>P.isGroupRow?P.pivotValuesMap?.get(m)?.reducerResults[C.id]:null});s[`total:${C.id}:${m.join("/")}`]=v})}}(t==="start"||t===!1)&&b?.()}),(!a&&t==="end"||n==="end")&&u(),{columns:s,columnGroups:c}}var NT=()=>{};function sm(o,e){let t=new ee,n=e.nodesKey??"children",r=e.emptyGroup??{},i=typeof e.pathKey=="function"?e.pathKey:l=>l[e.pathKey];for(let l of o){let s=i(l);for(let c=0;c<s.length;c++){let u=s.slice(0,c);t.has(u)||t.set(u,void 0)}t.set(s,l)}function a(l,s){let c=t.getKeysStartingWith(l,{excludeSelf:!0,depthLimit:1});for(let u of c){let d=[...l,u[u.length-1]],p=t.get(d),f=p?p[n]??[]:[];a(d,f),f.length&&(p||(p=typeof r=="function"?r(d,f):r),p[n]=f),s.push(p)}return s}return a([],[])}function cm(o,e,t,n){let{isLeafNode:r,getNodeChildren:i,toKey:a}=o,{onParentNode:l,onNode:s,onLeafNode:c}=e,u=a(n),d=[...t,u],p=r(n),f=pt(()=>{let m=i(n);if(!(!m||!Array.isArray(m)))for(let g=0,b=m.length;g<b;g++){let h=m[g];cm(o,e,d,h)}});p?(c?.(n),s?.(n,NT)):(l?.(n,f,i(n)),s?.(n,f))}function um(o,e,t){for(let n=0,r=t.length;n<r;n++)cm(o,e,[],t[n])}var FT=function(o,e){return o-e},LT=function(o,e){return o=`${o}`,e=`${e}`,o.localeCompare(e)},kT=function(o,e){return o-e},zT={number:FT,string:LT,date:kT},ei=zT;function dm(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 oo=(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(pm(dm(o),n)),r&&r.end(),e},Sa=(o,e,t)=>{let{marker:n}=t;n&&n.start();let r=pm(dm(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 um({isLeafNode:t.isLeafNode??u,getNodeChildren:t.getNodeChildren??c,toKey:s},{onParentNode:(d,p,f)=>{if(i&&p(),Array.isArray(f)){let m=a?f.sort(r):[...f].sort(r);d[l]=m}i||p()}},e),i&&(a?e.sort(r):e=[...e].sort(r)),n&&n.end(),e};oo.knownTypes=ei;var VT=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=oo.knownTypes[i],r||console.warn(`Unknown sort type "${o.type}" - please pass one of ${Object.keys(oo.knownTypes).join(", ")}`)}return r||(r=ei.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}},GT=o=>o.map(VT).filter(e=>e instanceof Function),pm=(o,e)=>{let t=GT(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}};function er(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||Qr)(l,o);return t.push(s),t},[])}var _e=class o{constructor(e,t,n){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,n&&Object.assign(this,n),this.update(r)}getGroupKeysForPrimaryKey(e){let{indexer:t,groupBy:n}=this.getConfig(),r=t.getDataForPrimaryKey(e);return r?er(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(f=>{if(this.defaultSelection){if(this.deselectedMap.has([f])){d++;return}u++}else{if(this.selectedMap.has([f])){u++;return}d++}});let p={selectedCount:u,deselectedCount:d};return this.selectionCountCache.set(e,p),p}t=t??this.getGroupRowBooleanSelectionStateFromParent(e);let i=this.getGroupKeysDirectlyInsideGroup(e);if(e.length===this.getGroupByLength()){let c=this.selectedMap.has(e)?!0:this.deselectedMap.has(e)?!1:t,u=this.getGroupCount(e),d=this.selectedMap.getKeysStartingWith(e,{excludeSelf:!0,depthLimit:1}).length,p=this.deselectedMap.getKeysStartingWith(e,{excludeSelf:!0,depthLimit:1}).length,f=u-(d+p),m={selectedCount:d+(c?f:0),deselectedCount:p+(c?0:f)};return this.selectionCountCache.set(e,m),m}let a=0,l=0;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),p=u?!0:d?!1:t,{selectedCount:f,deselectedCount:m}=this.getSelectionCountFor(c,p);a+=f,l+=m});let s={selectedCount:a,deselectedCount:l};return this.selectionCountCache.set(e,s),s}};function Ta(o,e){return new _e(o,gt(e))}function gt(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 fm(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 _e))throw"Invalid row selection";let a=new _e(r,gt(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 _e))throw"Invalid row selection";let a=new _e(r,gt(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 _e))throw"Invalid row selection";if(!i){let u=s.getDataForPrimaryKey(r);i=u?er(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 _e))throw"Invalid row selection";if(!i){let d=s.getDataForPrimaryKey(r);i=d?er(d,c):[]}let u=new _e(a,gt(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 _e))throw"Invalid row selection";if(a==="multi-row"){if(!i){let d=s.getDataForPrimaryKey(r);i=d?er(d,c):[]}let u=new _e(l,gt(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 _e))throw"Invalid row selection";let s=new _e(a,gt(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 _e))throw"Invalid row selection";let s=new _e(a,gt(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 _e))throw"Invalid row selection";let s=new _e(a,gt(e));s.toggleGroupRowSelection(r),t.rowSelection=s},getGroupRowSelectionState(r,i){let a=e(),{selectionMode:l,groupBy:s}=a,c=i?new _e(i,gt(a)):a.rowSelection;if(l!=="multi-row")throw'Selection mode should be "multi-row"';if(!s)throw"No grouping specified";if(!(c instanceof _e))throw"Invalid row selection";return c.getGroupRowSelectionState(r)},getSelectedPrimaryKeys:r=>{let i=e(),a=r?new _e(r,gt(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 HT="*",$e=class{constructor(e){this.wildcard=HT;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,n){let r=e===this.wildcard,i=t===this.wildcard;if(this.isCellSelected_Internal(e,t)===n)return;let l=[];if(r){let c=this.deselectedColumnsToRows.get(t),u=this.selectedColumnsToRows.get(t);c?.forEach(d=>{d!==this.wildcard&&this.setCellInDeselection(d,t,!1)}),u?.forEach(d=>{d!==this.wildcard&&this.setCellInSelection(d,t,!1)}),[...this.cache.keys()].forEach(d=>{let[p,f]=d;f===t&&l.push([p,t])})}if(i){let c=this.deselectedRowsToColumns.get(t),u=this.selectedRowsToColumns.get(t);c?.forEach(d=>{d!==this.wildcard&&this.setCellInDeselection(e,d,!1)}),u?.forEach(d=>{d!==this.wildcard&&this.setCellInSelection(e,d,!1)}),[...this.cache.keys()].forEach(d=>{let[p]=d;p===e&&l.push([e,t])})}let s=[e,t];if(l.forEach(c=>{this.cache.delete(c)}),this.cache.delete(s),n)if(this.defaultSelection){let c=this.deselectedRowsToColumns.get(e);c&&c.has(t)&&this.setCellInDeselection(e,t,!1);let u=this.deselectedRowsToColumns.get(this.wildcard),d=this.deselectedColumnsToRows.get(this.wildcard);(u?.has(t)||d?.has(e))&&this.setCellInSelection(e,t,!0)}else{let c=this.deselectedRowsToColumns.get(e);c&&c.has(t)&&this.setCellInDeselection(e,t,!1),this.setCellInSelection(e,t,!0)}else if(this.defaultSelection)this.selectedRowsToColumns.get(e)?.has(t)&&this.setCellInSelection(e,t,!1),this.setCellInDeselection(e,t,!0);else{this.selectedRowsToColumns.get(e)?.has(t)&&this.setCellInSelection(e,t,!1);let u=this.selectedRowsToColumns.get(this.wildcard),d=this.selectedColumnsToRows.get(this.wildcard);if(u?.has(t)||d?.has(e)){this.setCellInDeselection(e,t,!0);return}}}setCellInDeselection(e,t,n){if(n){let r=this.deselectedRowsToColumns.get(e)||new Set;r.add(t),this.deselectedRowsToColumns.set(e,r)}else{let r=this.deselectedRowsToColumns.get(e);r&&(r.delete(t),r.size===0&&this.deselectedRowsToColumns.delete(e))}if(n){let r=this.deselectedColumnsToRows.get(t)||new Set;r.add(e),this.deselectedColumnsToRows.set(t,r)}else{let r=this.deselectedColumnsToRows.get(t);r&&(r.delete(e),r.size===0&&this.deselectedColumnsToRows.delete(t))}}setCellInSelection(e,t,n){if(e===this.wildcard&&t===this.wildcard)throw new Error("rowId and colId cannot be used as a wildcard at the same time!");if(n){let r=this.selectedRowsToColumns.get(e)||new Set;r.add(t),this.selectedRowsToColumns.set(e,r)}else{let r=this.selectedRowsToColumns.get(e);r&&(r.delete(t),r.size===0&&this.selectedRowsToColumns.delete(e))}if(n){let r=this.selectedColumnsToRows.get(t)||new Set;r.add(e),this.selectedColumnsToRows.set(t,r)}else{let r=this.selectedColumnsToRows.get(t);r&&(r.delete(e),r.size===0&&this.selectedColumnsToRows.delete(t))}}update(e){let t=e.selectedCells||null,n=e.deselectedCells||null;this.selectedRowsToColumns.clear(),this.selectedColumnsToRows.clear(),this.deselectedRowsToColumns.clear(),this.deselectedColumnsToRows.clear(),this.cache.clear(),t&&t.forEach(([r,i])=>{this.setCellInSelection(r,i,!0)}),n&&n.forEach(([r,i])=>{this.setCellInDeselection(r,i,!0)}),this.defaultSelection=e.defaultSelection}isCellSelectionInRow(e,t){if(this.defaultSelection){let r=this.deselectedRowsToColumns.get(e);if(r){if(r.has(this.wildcard)){let i=this.selectedRowsToColumns.get(e);return i&&i.size>0?t.some(a=>i.has(a)):!1}return t.some(i=>!r.has(i))}return!0}let n=this.selectedRowsToColumns.get(e);if(n){if(n.has(this.wildcard)){let r=this.deselectedRowsToColumns.get(e);return r&&r.size>0?!t.every(a=>r.has(a)):!0}return t?t.some(r=>n.has(r)):!1}return!1}error(e){Po(`${this.debugId}:CellSelectionState`)(e)}isCellSelected(e,t){return e===this.wildcard||t===this.wildcard?(this.error("CellSelectionState.isCellSelected should not be called with wildcard"),!1):this.isCellSelected_Internal(e,t)}isCellSelected_Internal(e,t){let n=[e,t],{cache:r}=this,i=r.get(n);if(i!=null)return i;let a=()=>(r.set(n,!1),!1),l=()=>(r.set(n,!0),!0),s=this.deselectedColumnsToRows.get(this.wildcard),c=this.deselectedRowsToColumns.get(this.wildcard),u=this.selectedColumnsToRows.get(this.wildcard),d=this.selectedRowsToColumns.get(this.wildcard);if(this.defaultSelection){let m=this.deselectedRowsToColumns.get(e);return m&&m.has(t)?a():s?.has(e)||c?.has(t)?this.selectedRowsToColumns.get(e)?.has(t)?l():a():l()}let f=this.selectedRowsToColumns.get(e);return f&&f.has(t)?l():u?.has(e)||d?.has(t)?this.deselectedRowsToColumns.get(e)?.has(t)?a():l():a()}getState(){let e=[],t=[];return this.deselectedRowsToColumns.forEach((n,r)=>{n.forEach(i=>{e.push([r,i])})}),this.selectedRowsToColumns.forEach((n,r)=>{n.forEach(i=>{t.push([r,i])})}),{defaultSelection:this.defaultSelection,deselectedCells:e,selectedCells:t}}};var mm=Symbol("CLEAR"),bn=class o{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,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=mm,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(mm);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 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:ee.clone(e.nodePathToData),n}};function jo(o,e){return e().dataArray[o]}function Ca(o){return o().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: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 KT=(o,e)=>o.length-e.length,et=class o{constructor(e,t){this.selectedPaths=null;this.deselectedPaths=null;this.defaultSelection=!1;this.selectionMap=new ee;this.cache=new ee;this.strictMode=!1;let n=e instanceof Object.getPrototypeOf(this).constructor,r=n?e.getState():e;this.setConfig(t||(n?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 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 ee(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(KT);if(this.strictMode&&(l=l.filter(d=>this.isPathAvailable(d))),!l.length){if(i!==null){let p=r?i:!1;return this.cacheIt(e,{selected:p,selectedCount:p?r:0,deselectedCount:p?0:r,leafCount:r})}let d=this.getNodeBooleanSelectionStateFromParent(e);return this.cacheIt(e,{selected:d,selectedCount:d?r:0,deselectedCount:d?0:r,leafCount:r})}let s=0,c=0,u=this.getNodeBooleanSelectionStateFromParent(e);u?s+=r:c+=r;for(let d=0,p=l.length;d<p;d++){let f=l[d],{selectedCount:m,deselectedCount:g}=this.getSelectionStateForNode(f);if(u?(s-=g,c+=g):(c-=m,s+=m),t&&m>0&&g>0)return this.cacheIt(e,{selected:null,leafCount:r,selectedCount:s,deselectedCount:c})}if(!s&&!c)return this.cacheIt(e,{selected:u,selectedCount:u?r:0,deselectedCount:u?0:r,leafCount:r});if(s){let d=s===r?!0:null;return this.cacheIt(e,{selected:d,selectedCount:s,deselectedCount:c,leafCount:r})}return this.cacheIt(e,{selected:!1,selectedCount:0,deselectedCount:r,leafCount:r})}isPathSelected(e){return this.isPathAvailable(e)?this.getSelectionStateForNode(e,!0).selected:!1}getNodeBooleanSelectionStateFromParent(e){let{defaultSelection:t,selectionMap:n}=this;if(!e.length)return t;let r=[...e];do{let i=n.get(r);if(i!==void 0)return i;r.pop()}while(r.length);return t}setNodeSelection(e,t){if(!e.length)return;if(this.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 Ra(o,e){return new et(o,tr(e))}function tr(o){return()=>({treePaths:(typeof o=="function"?o():o).treePaths})}var Ia=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 et))throw"Invalid tree selection";let a=new et(r,tr(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 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 n=this.getState(),r=new st(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 st(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 st(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?jo(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 et))throw"Invalid node selection";let n=new et(e,tr(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 et))throw"Invalid node selection";let n=new et(e,tr(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 et))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 or=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 vt=class extends or{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 Hs=1e3;function gm(o){return new Ks(o)}var Ks=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=()=>Ca(this.getState);this.getRowInfoByIndex=e=>jo(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?Hs:r;return isNaN(a)||(a=Hs),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 vt(n):new vt({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 vt({enabledRows:!0,disabledRows:[]});return}let t=new vt(e);t.enableAll(),this.actions.rowDisabledState=t};this.disableAllRows=()=>{let e=this.getState().rowDisabledState;if(!e){this.actions.rowDisabledState=new vt({disabledRows:!0,enabledRows:[]});return}let t=new vt(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 Ia({...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?bn.clone(t,{light:!0}):new bn({nodesKey:n?r:void 0});e.forEach(a=>{switch(a.type){case"update":a.array.forEach((u,d)=>{if(a.primaryKeys){let p=a.primaryKeys[d],f=this.getDataByPrimaryKey(p);f&&i.update(a.primaryKeys[d],u,f,a.metadata)}else if(a.nodePaths){let p=this.getDataByNodePath(a.nodePaths[d]);p&&(typeof u=="function"?i.updateChildren(a.nodePaths[d],u,p,a.metadata):i.updateNodePath(a.nodePaths[d],u,p,a.metadata))}});break;case"delete":a.primaryKeys?a.primaryKeys.forEach(u=>{let d=this.getDataByPrimaryKey(u);d&&i.delete(u,d,a.metadata)}):a.nodePaths&&a.nodePaths.forEach(u=>{let d=this.getDataByNodePath(u);d&&i.deleteNodePath(u,d,a.metadata)});break;case"insert":let l=a.primaryKey,s=a.position,c=a.nodePath;c?a.array.forEach(u=>{i.insertNodePath([...c],u,s,a.metadata),l=this.toPrimaryKey(u),c.pop(),c.push(l),s="after"}):a.array.forEach(u=>{i.insert(l,u,s,a.metadata),l=this.toPrimaryKey(u),s="after"});break;case"replace-all":i.resetDataSource(a.metadata);break}}),this.actions.cache=i}flush(){return this.commit()}waitForNodePath(e,t){let n=this.getState();if(this.isNodePathAvailable(e))return Promise.resolve(!0);let r=t?.timeout??Hs,i=n.waitForNodePathPromises.get(e);if(i)return i.promise;let a=Date.now(),l=()=>{},s=new Promise(c=>{let u,d;l=p=>{clearTimeout(d),u=p,n.waitForNodePathPromises.delete(e),c(p)},d=setTimeout(()=>{u===void 0&&l(!1)},r)});return n.waitForNodePathPromises.set(e,{timestamp:a,promise:s,resolve:l}),s}commit(){this.commitOperations(this.pendingOperations),this.pendingOperations.length=0;let e=this.pendingPromise;if(e&&this.resolvePendingPromise){let t=this.resolvePendingPromise;requestAnimationFrame(()=>{t(!0)}),this.pendingPromise=null,this.resolvePendingPromise=null}return e||Promise.resolve(!0)}};function hm(o){let e=o.cache;if(!e)return{sortInfo:!1,groupBy:!1,tree:!1,filterValue:!1,aggregationReducers:!1};let t=!1,n=!1,r=!1,i=!1,a=!1,l=e.getAffectedFields(),{sortInfo:s,groupBy:c,filterValue:u,aggregationReducers:d,nodesKey:p,isTree:f}=o;if(s&&s.length)if(l===!0)t=!0;else for(let m of s){let g=m.field;if(g&&(g=Array.isArray(g)?g:[g],t=g.reduce((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(f&&(l===!0?r=!0:r=l.has(p)),u&&u.length)if(l===!0)i=!0;else for(let m of u){if(m.id){i=!0;break}if(m.field&&l.has(m.field)){i=!0;break}}if(d&&Object.keys(d).length){if(l===!0)a=!0;else for(let m in d)if(d.hasOwnProperty(m)){let g=d[m];if(g.field){if(l.has(g.field)){a=!0;break}}else{a=!0;break}}}return{sortInfo:t,groupBy:n,filterValue:i,aggregationReducers:a,tree:r}}function wa(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 va(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 Pa(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}var BT=Ue("IT:InfiniteTable"),WT="#dc3545",jT="#eb9316";var ym="Warn",Sm="Error",$T="Info",UT="Success",YT="Logs",Da=BT.extend(YT),uL=Da.extend($T),qT=Da.extend(ym),XT=Da.extend(Sm),dL=Da.extend(UT);var ZT=jT,QT=WT;var JT=(o,e)=>{e=e?e.extend?e.extend(ym):e:qT,e(typeof e.color=="function"?e.color(ZT,o):o)},eC=(o,e)=>{e=e?e.extend?e.extend(Sm):e:XT,e(typeof e.color=="function"?e.color(QT,o):o)};var bm=new ee,Tm=(o,...e)=>{bm.has(e)||(bm.set(e,!0),o())};var nr=(o,e=o,t)=>{Tm(()=>JT(o,t),e,"warn")},Cm=(o,e=o,t)=>{Tm(()=>eC(o,t),e,"error")};var Bs=new WeakMap,tC=o=>o;function Im(o,e=50,t){Bs.set(o,{lastCallTime:0,lastCallArg:null});let n=t??tC;return r=>{let{lastCallTime:i,lastCallArg:a}=Bs.get(o)||{lastCallTime:0,lastCallArg:null},l=Date.now(),s=l-i,c=St(n(a),n(r));s<e&&c||(Bs.set(o,{lastCallTime:l,lastCallArg:r}),o(r))}}var xa=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 n=this.nodePathsToData.get(e);if(n){let r=t.getNodeChildren?t.getNodeChildren(n):t.nodesKey?n[t.nodesKey]:null;if(r&&Array.isArray(r))for(let i=0,a=r.length;i<a;i++){let l=r[i],s=[...e,t.toPrimaryKey(l)];this.removeNodePath(s,t)}}};this.remove=e=>{this.primaryKeyToData.delete(e)};this.add=(e,t)=>{this.primaryKeyToData.set(e,t)};this.addNodePath=(e,t,n)=>{if(this.nodePathsToData.set(e,t),this.add(e[e.length-1],t),!n)return;let r=n.getNodeChildren?n.getNodeChildren(t):n.nodesKey?t[n.nodesKey]:null;if(r&&Array.isArray(r))for(let i=0,a=r.length;i<a;i++){let l=r[i],s=[...e,n.toPrimaryKey(l)];this.addNodePath(s,l,n)}};this.clear=()=>{this.primaryKeyToData.clear(),this.nodePathsToData.clear()};this.getDataForPrimaryKey=e=>this.primaryKeyToData.get(e);this.getDataForNodePath=e=>this.nodePathsToData.get(e);this.indexArray=(e,t)=>{let{cache:n,toPrimaryKey:r,getNodeChildren:i,isLeafNode:a,nodesKey:l}=t,s=!!i&&!!a;n&&n.shouldResetDataSource()&&(this.clear(),e=[]);let c=n&&!n.isEmpty();if(c&&(e=e.concat()),!e.length&&n){if(!n.isEmpty()){let u=[...n.getMutationsArray(),...n.getTreeMutationsArray()];for(let d=0,p=u.length;d<p;d++){let f=u[d];if(f.type==="insert"){let m=r(f.data);s?this.addNodePath([m],f.data,t):this.add(m,f.data),e.push(f.data)}}n?.removeInfo(void 0)}}else{let u=(d,p)=>{for(let f=0;f<d.length;f++){let m=d[f];c&&s&&Array.isArray(m[l])&&(m=d[f]={...m});let g=!1;if(m!=null){let b=r(m),h=s?[...p,b]:void 0,y=s&&!!h,S=y?n?.getMutationsForNodePath(h):n?.getMutationsForPrimaryKey(b);if(S&&S.length){for(let T=0,C=S.length;T<C;T++){let I=S[T];if(I.type==="delete"&&!g&&(y?this.removeNodePath(h,t):this.remove(b),g=!0,d.splice(f,1),f--),I.type==="update"&&!g&&(m={...m,...I.data},d[f]=m),I.type==="update-children"&&!g){let R=I.children(m[l],m);m={...m},R!==void 0?m[l]=R:delete m[l],d[f]=m}I.type==="insert"&&(I.position==="before"?(d.splice(f,0,I.data),f--):d.splice(f+1,0,I.data))}y?n?.removeNodePathInfo(h):n?.removeInfo(b)}if(!g)if(y){this.addNodePath(h,m);let T=a(m),C=T?null:i(m);!T&&Array.isArray(C)&&(p.push(b),c&&(m[l]=C=C.concat()),u(C,p),p.pop())}else this.add(b,m)}}};u(e,[])}return e}}};var oC=Object.freeze([]),Rm=(o,e)=>{let t=o??oC,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 Ma(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(!Ma(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)||!Ma(o[r],e[r]))return!1;return!0}return!1}function nC(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 Ea={id:!0,value:!0,indexInAll:!0,rowSelected:!0,rowDisabled:!0,isCellSelected:!1,hasSelectedCells:!1},wm={...Ea,dataSourceHasGrouping:!0,isTreeNode:!0,data:!1,isGroupRow:!0,selfLoaded:!0},rC={indexInGroup:!0,groupKeys:!0,groupBy:!0,rootGroupBy:!0,parents:!1,indexInParentGroups:!0,groupCount:!0,groupNesting:!0,collapsed:!0,selfLoaded:!0},iC={...Ea,...rC,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},vm={isTreeNode:!0,isParentNode:!0,indexInParent:!0,nodePath:!0,parentNodes:!1,indexInParentNodes:!0,totalLeafNodesCount:!0,collapsedLeafNodesCount:!0,treeNesting:!0,selfLoaded:!0},aC={...Ea,...vm,dataSourceHasGrouping:!0,isTreeNode:!0,isGroupRow:!0,isParentNode:!0,data:!1},lC={...Ea,...vm,dataSourceHasGrouping:!0,isParentNode:!0,isGroupRow:!0,nodeExpanded:!0,selfExpanded:!0,data:!1,selectedLeafNodesCount:!0,deepRowInfoArray:!1,deselectedLeafNodesCount:!0,duplicateOf:!1},sC=Object.entries(wm).map(([o,e])=>e?o:void 0).filter(Boolean),cC=Object.entries(wm).map(([o,e])=>e?o:void 0),uC=Object.entries(iC).map(([o,e])=>e?o:void 0),dC=Object.entries(aC).map(([o,e])=>e?o:void 0),pC=Object.entries(lC).map(([o,e])=>e?o:void 0);function fC(o,e){if(o===e)return!0;if(!o||!e||!nC(o,e)||o.id!==e.id||o.data!==e.data&&!Ma(o.data,e.data))return!1;let t=[];o.dataSourceHasGrouping?t=o.isGroupRow?uC:cC:o.isTreeNode?t=o.isTreeNode&&o.isParentNode?pC:dC:t=sC;for(let n of t){let r=o[n],i=e[n];if(!(typeof r=="function"||typeof i=="function")&&!Ma(r,i))return!1}return!0}function Pm(){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 p=[],f=i();for(let m of f){let g=u[m],b=s[m];if(b===void 0){p.push(m);continue}fC(g,b)||p.push(m)}o=s,p.length>0&&queueMicrotask(()=>{for(let m=0,g=p.length;m<g;m++){let b=p[m],h=e.get(b);if(h)for(let y of h)y()}}),d&&d.end({details:[{name:"updated row infos",value:p.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 So=new Map,To=new Map,$o=new Map,Co=new Map,no=new Map;var mC=Symbol("cursorId"),Dm=o=>o.totalLeafNodesCount===0,gC=o=>o.isParentNode?!Dm(o):!0;function xm(o){let e=Date.now(),t=[],n=[],r=new ee;return{logger:Nt(`${o.debugId}:DataSource`),debugTimings:new Map,debugWarnings:new Map,devToolsDetected:!!globalThis.__INFINITE_TABLE_DEVTOOLS_HOOK__,rowInfoStore:Pm(),indexer:new xa,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:Ie(),notifyScrollbarsChange:Ie(),notifyScrollStop:Ie(),notifyRenderRangeChange:Ie(),pivotTotalColumnPosition:"end",pivotGrandTotalColumnPosition:!1,scrollStopDelayUpdatedByTable:100,originalLazyGroupData:r,originalLazyGroupDataChangeDetect:0,originalDataArray:t,cursorId:mC,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 hC(o){let e={...o};return delete e.originalDataArray,e}var bC=[],Mm=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()},Em=(o,e)=>({onDataParamsChange:t=>t?Im(t,100,hC):void 0,lazyLoad:t=>!!t,isNodeReadOnly:t=>t??Dm,isNodeSelectable:t=>t??gC,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=>({...No,...t}),sortTypes:t=>({...ei,...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 vt)return t;let n=o.propsCache.get("rowDisabledState")??Kt,r=n.get(t);return r||(r=new vt(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=>Rm(t,o.propsCache.get("sortInfo")),groupBy:t=>t??bC});function yC(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 SC(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 TC={selectedPaths:[],deselectedPaths:[],defaultSelection:!1};function Am(o,e,t){if(e!="multi-row")throw new Error(`TreeSelectionState is only supported for multi-row selection. Your current selection mode is "${e}". See https://infinite-table.com/docs/reference/datasource-props#selectionMode for details.
|
|
1
|
+
"use strict";var Ab=Object.create;var pi=Object.defineProperty;var _b=Object.getOwnPropertyDescriptor;var Ob=Object.getOwnPropertyNames;var Nb=Object.getPrototypeOf,Fb=Object.prototype.hasOwnProperty;var Lb=(o,e)=>()=>(e||o((e={exports:{}}).exports,e),e.exports),kb=(o,e)=>{for(var t in e)pi(o,t,{get:e[t],enumerable:!0})},Bu=(o,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Ob(e))!Fb.call(o,r)&&r!==t&&pi(o,r,{get:()=>e[r],enumerable:!(n=_b(e,r))||n.enumerable});return o};var j=(o,e,t)=>(t=o!=null?Ab(Nb(o)):{},Bu(e||!o||!o.__esModule?pi(t,"default",{value:o,enumerable:!0}):t,o)),zb=o=>Bu(pi({},"__esModule",{value:!0}),o);var rn=Lb((ax,jd)=>{"use strict";jd.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 kR={};kb(kR,{AutoScroller:()=>pn,CellSelectionState:()=>Ue,DRAG_ITEM_ATTRIBUTE:()=>Rt,DataClient:()=>Nu,DataSource:()=>nI,DataSourceActionType:()=>cg,DeepMap:()=>ee,DragDropProvider:()=>Vi,DragInteractionTarget:()=>Xn,DragList:()=>Go,FixedSizeSet:()=>ml,FlashingColumnCell:()=>db,GroupRowsState:()=>wt,INTERNAL_MatrixDebugger:()=>fb,InfiniteTable:()=>lo,InfiniteTableClassName:()=>Zt,InfiniteTableComponent:()=>eb,Menu:()=>$t,RowDetailCache:()=>sr,RowDetailState:()=>Mt,RowDisabledState:()=>vt,RowSelectionState:()=>Ae,TreeDataSource:()=>ER,TreeExpandState:()=>ut,TreeGrid:()=>nb,TreeSelectionState:()=>ot,WeakFixedSizeSet:()=>hl,alignNode:()=>Za,components:()=>LR,createDefaultProxy:()=>hs,createFlashingColumnCellComponent:()=>Fu,debounce:()=>Ot,debug:()=>qe,defaultDragProxyMove:()=>ys,defaultFilterTypes:()=>Fo,eventMatchesKeyboardShortcut:()=>qa,filterDataArray:()=>Ys,filterTypes:()=>Fo,flatten:()=>im,getComponentStateRoot:()=>Ft,group:()=>Sa,interceptMap:()=>ib,keyboardShortcuts:()=>rb,multisort:()=>oo,multisortNested:()=>Ca,queryKeyToCacheKey:()=>Dn,toTreeDataArray:()=>cm,useComponentState:()=>Lt,useDataSourceApi:()=>ug,useDataSourceInternal:()=>lr,useDataSourceSelector:()=>Ee,useDataSourceState:()=>Va,useDragDropProvider:()=>po,useDragListContext:()=>fn,useEffectWhen:()=>bl,useEffectWhenSameDeps:()=>ab,useEffectWithChanges:()=>Cn,useEffectWithObject:()=>qC,useGridScroll:()=>ll,useInfiniteColumnApi:()=>Xy,useInfiniteColumnCell:()=>zr,useInfiniteColumnEditor:()=>Ui,useInfiniteColumnFilterEditor:()=>Gn,useInfiniteHeaderCell:()=>Er,useInfinitePortalContainer:()=>Cy,useInfiniteTableApi:()=>qy,useLayoutEffectWithChanges:()=>YC,useManagedDataSource:()=>nu,useMasterRowInfo:()=>Mo,useOverlay:()=>io,useOverlayPortal:()=>Ph,usePrevious:()=>_o,useRowInfoReducers:()=>rI,useVisibleColumnSizes:()=>fy,withSelectedLeafNodesOnly:()=>Ou});module.exports=zb(kR);function Ot(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=j(require("react"));var te=(...o)=>o.filter(e=>!!`${e}`).join(" ");var en=j(require("react")),El=require("react");var Vb=j(require("react")),Po=require("react");var En=(o,e,t={debounce:0})=>{let n=t.debounce??0,r=window.ResizeObserver,i=n?Ot(e,{wait:n}):e,a=new r(l=>{let s=l[0],{width:u,height:c}=s.contentRect;if(s.borderBoxSize?.[0])c=s.borderBoxSize[0].blockSize,u=s.borderBoxSize[0].inlineSize;else{let d=o.getBoundingClientRect();c=d.height,u=d.width}i({width:u,height:c})});return a.observe(o),()=>{a.disconnect()}};var fi=(o,e,t={earlyAttach:!1,debounce:0})=>{let n=(0,Po.useRef)({width:0,height:0}),r=i=>{let a;return o.current&&(a=En(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,Po.useEffect)(()=>t.earlyAttach?()=>{}:r(e),[o.current,e,t.earlyAttach,t.debounce]),(0,Po.useLayoutEffect)(()=>t.earlyAttach?r(e):()=>{},[o.current,e,t.earlyAttach])};function be(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,u=t.length;s<u;s++)l.push(t[s](i));a?.(l)});else{e=i;for(let s=0,u=t.length;s<u;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 ft(o){let e=!1,t=null;return(...r)=>(e||(e=!0,t=o(...r)),t)}var Wu=(o,e)=>o-e;var mi=(o,e)=>Wu(o.revision,e.revision),ee=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),u=!a;if(i!==void 0){if(i<0)return;i--}let c=(d,p)=>{let f=r.get(p);if(!f)return;let{map:m}=f,g=p===this.emptyKey;if(g&&!u)return;let y=g?[]:[...e,p],h=m?()=>this.visitWithNext(y,t,n,m,i!==void 0?i-1:void 0):void 0;if(f.hasOwnProperty("value")){let b=t(f.value,y,l,h,f);if(n&&b===!0)return!0;l++}else h?.()};s&&(c(void 0,this.emptyKey),u=!1,l=0);for(let[d,p]of r){let f=c(p,d);if(n&&f===!0)return f}};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,u)=>{!u.map&&u.hasOwnProperty("value")&&(r?i.push(u):a.push(t(u)))},n),r?i.sort(mi).map(t):a}getKeysForLeafNodesStartingWith(e,t){return this.getLeafNodesStartingWith(e,n=>n.keys,t)}getKeysAndValuesForLeafNodesStartingWith(e,t){return this.getLeafNodesStartingWith(e,n=>[n.keys,n.value],t)}getKeysOfFirstChildOnEachBranchStartingWith(e,t){let{excludeSelf:n,depthLimit:r,respectOrder:i=!0}=t||{},a=[],l=[],s=p=>{i?a.push(p):l.push(p.keys)},u=this.map,c,d=!1;if(e.length)for(let p=0,f=e.length;p<f;p++){let m=e[p];if(c=u.get(m),!c||!c.map)if(d=!0,p===f-1){d=!0;break}else return[];u=c.map}else if(!n&&u.has(this.emptyKey))return[[]];return c&&c.value!==void 0&&(n||(s({...c,keys:e}),d=!0)),d?i?a.sort(mi).map(p=>p.keys):l:(this.visitWithNext(e,(p,f,m,g,y)=>{s({...y,keys:f})},!1,u,r,n),i?a.sort(mi).map(p=>p.keys):l)}getKeysStartingWith(e,t){let n=[];return this.getStartingWith(e,r=>{n.push(r)},t),n}getStartingWith(e,t,n){let{excludeSelf:r,depthLimit:i}=n||{},a=this.map,l,s=!1;if(e.length)for(let u=0,c=e.length;u<c;u++){let d=e[u];if(l=a.get(d),!l||!l.map)if(s=!0,u===c-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,(u,c,d,p,f)=>{t(c,u,{...f,keys:c}),p?.()},!1,a,i,r)}getMapAt(e){let t=this.map,n;if(!e.length)return this.map;for(let r=0,i=e.length;r<i;r++){let a=e[r];if(n=t.get(a),!n||!n.map)return;t=n.map}return t}getAllChildrenSizeFor(e){let t=this.map,n;if(!e.length)return this.length;for(let r=0,i=e.length;r<i;r++){let a=e[r];if(n=t.get(a),!n||!n.map)return 0;t=n.map}return n.length}getDirectChildrenSizeFor(e){let t=this.map;e.length||(e=[this.emptyKey]);for(let n=0,r=e.length;n<r;n++){let i=e[n],a=n===r-1,l=t.get(i);if(!l||!l.map)return 0;if(t=l.map,a)return t?.size??0}return 0}set(e,t){let n=this.map;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],u=a===l-1,c=t.get(s);if(u){c&&(c.hasOwnProperty("value")&&(delete c.value,delete c.revision,i=!0,r.forEach(d=>{d.length--}),this.length--),c.map&&c.map.size===0&&delete c.map,c.map||t.delete(s));break}else{if(!c||!c.map){i=!1;break}r.push(c),t=c.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],u=e[e.length-1],c=s?.get(u);c&&(delete c.map,c.hasOwnProperty("value")||s.delete(u))}}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],u=ft(()=>{if(l)for(let[c]of l){let d=this.visitKey(c,l,s,r,i);if(i&&d===!0)return!0}return!1});if(a.hasOwnProperty("value")){let c=r(a,s,u);if(i&&c===!0)return!0}u()}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(mi);function*n(){for(let r=0,i=t.length;r<i;r++)yield e(t[r])}return n()}};globalThis.DeepMap=ee;function xe(){return globalThis}var hi=["#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"],ju=Symbol("color"),gi=new WeakMap,Rl=be();function wl(o=hi){gi.set(o,o.map(e=>0))}wl();var Gb=(o=hi)=>{let e=[];gi.has(o)?e=gi.get(o):(e=o.map(n=>0),gi.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]??hi[0]},Ir=":",vl="*",$u="-",Hb=",",Kb="debug",Bb="diffdebug",Yu=!1,Cr=new ee,Rr=new Map;function Pl(o,e){let t=o.split(Ir),n=new ee;n.set(t,!0);let r=e.split(Ir),i=new Set(r).has(vl),a=r.indexOf(vl),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(Ir)):!0}}function qu(o,e){let t=`channel=${o}_permissions=${e}`;if(Rr.has(t))return Rr.get(t);let n=e.split(Hb);function r(l){return Rr.set(t,l),l}let i=[],a=[];n.forEach(l=>{l.includes(vl)?a.push(l):i.push(l)});for(let l=0;l<i.length;l++){let s=i[l],u=s.startsWith($u);if(u&&(s=s.substring($u.length)),Pl(o,s))return r(!u)}for(let l=0;l<a.length;l++){let s=a[l],u=s.startsWith("-");if(u&&(s=s.substring(1)),Pl(o,s))return r(!u)}return r(!1)}var Dl=()=>qe.enable??(xe()&&xe().localStorage?.getItem(Kb))??"",Wb=()=>qe.diffenable??(xe()&&xe().localStorage?.getItem(Bb))??`${Yu}`,xl="",Xu=Yu;function Ml(o){Xu=`${Wb()}`=="true",xl!==o&&(xl=o,Rr.clear())}function Zu(o){Ml(Dl()),typeof xe()<"u"&&xe().addEventListener&&xe().addEventListener("storage",function(){Ml(Dl())});function e(t,n){let r=n?`${n}${Ir}${t}`:t,i=r.split(Ir),a=Cr.get(i);if(a)return a;let l=Cr.get(i.slice(0,-1)),s=(l?l.logFn:qe.logFn)??Qu,u=s,c,d=0,p=()=>c??qu(r,xl),f=Gb(qe.colors),m=Object.defineProperties((...g)=>{let y=Rl.getListenersCount(),h;if(y>0&&(h=h??Date.now(),Rl({color:f,channel:r,args:g,timestamp:h})),p()){if(h=h??Date.now(),d&&Xu){let I=h-d;u(`%c[${r}]`,`color: ${f}`,`+${I}ms:`)}d=h;let b=[],S;if(g.forEach(I=>{if(I[ju])S===void 0&&(S=!0),b.push(...I);else{if(typeof I!="string"&&typeof I!="number"){S=!1;return}b.push(`${I}%s`)}}),S){let I=[`%c[${r}]%c %s`,`color: ${f}`,"",...b,""];u(...I)}else u(`%c[${r}]%c %s`,`color: ${f}`,"",...g)}},{channel:{value:r},color:{value:(g,...y)=>{let h=[`%c${y.join(" ")}%c%s`,`color: ${g}`,""];return h.toString=()=>y.join(" "),h[ju]=!0,h}},extend:{value:g=>e(g,r)},enabled:{get:()=>p(),set:g=>{c=g}},logFn:{configurable:!1,get:()=>u,set:g=>{u=g??s}},destroy:{value:()=>{Cr.delete(i)}}});return Cr.set(i,m),m}return e(o)}var Qu=console.log.bind(console),Uu;Object.defineProperty(Zu,"enable",{get:()=>Uu,set:o=>{Uu=o,Ml(Dl())}});var qe=Zu;qe.colors=hi;qe.logFn=Qu;var jb=(o,e)=>Rl.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})});qe.onLogIntent=jb;qe.isChannelEnabled=qu;qe.destroyAll=()=>{wl(),wl(qe.colors),Cr.clear(),Rr.clear()};var Nt=o=>{let e=qe(o?`IT:${o}:TYPE=debug`:"IT:TYPE=debug");return e.logFn=console.log.bind(console),e},Do=o=>{let e=qe(o?`IT:${o}:TYPE=error`:"IT:TYPE=error");return e.logFn=console.error.bind(console),e},wr=()=>wr;wr.extend=()=>wr;var bt=class{constructor(e){this.debug=wr,this.error=wr}};var Ju=Do("CSSVariableWatch"),ec=Nt("CSSVariableWatch"),tc={position:"absolute",pointerEvents:"none",width:"0px",height:"0px",lineHeight:0,fontSize:0,overflow:"hidden"};var $b=o=>{let e=(0,El.useRef)(0),t=en.useCallback(({height:n})=>{n!=null&&n!==e.current&&(e.current=n,o.onChange(n))},[o.onChange]);fi(o.ref,t,{earlyAttach:!0}),en.useLayoutEffect(()=>{let n=o.ref.current.getBoundingClientRect().height;if(n!=null)return e.current=n,ec(`Variable ${o.varName} found and equals ${n}.`),o.onChange(n);Ju(`Specified variable ${o.varName} not found or does not have a numeric value.`)},[])},vr=o=>{let e=(0,El.useRef)(null);$b({...o,ref:e});let t=o.varName.startsWith("var(")?o.varName:`var(${o.varName})`,{allowInts:n=!1}=o;return en.createElement("div",{"data-name":"css-variable-watcher","data-var":o.varName,style:tc},en.createElement("div",{ref:e,style:{height:n?`calc(1px * ${t})`:t}}))};var On=require("react");function xo(){let o=null,e=new Set;return{getSnapshot(){return o},setSnapshot(t){o=t},subscribe(t){return e.add(t),()=>{e.delete(t)}},notify(){for(let t of e)t()}}}var so=require("react");function St(o,e,t){if(o===e)return!0;if(!o||!e)return!1;let n=typeof o;if(n!==typeof e||n!=="object")return!1;var i=Object.keys(o),a=Object.keys(e);t&&(i=i.filter(c=>!t.has(c)),a=a.filter(c=>!t.has(c)));var l=i.length;if(a.length!==l)return!1;for(var s=0;s<l;s++){var u=i[s];if(!(t&&t.has(u))&&(o[u]!==e[u]||!Object.prototype.hasOwnProperty.call(e,u)))return!1}return!0}function oc(o,e,t){let n=(0,so.useRef)(e);n.current=e;let r=(0,so.useRef)(t);r.current=t;let i=(0,so.useRef)(void 0),a=(0,so.useRef)(!1),l=(0,so.useCallback)(()=>{let s=o.getSnapshot(),u=n.current(s);return a.current&&r.current(i.current,u)?i.current:(i.current=u,a.current=!0,u)},[o]);return(0,so.useSyncExternalStore)(o.subscribe,l,l)}function yi(o,e){return oc(o,e,Object.is)}function An(o,e){return oc(o,e,St)}var nc=j(require("react")),Al;function _n(){return Al||(Al=nc.createContext(null))}var rc=xo(),ic=()=>{};function bi(){let o=_n();return(0,On.useContext)(o)||void 0}function Si(){let o=bi();return(0,On.useCallback)(()=>o?.getSnapshot(),[o])}function uo(o){let e=_n(),t=(0,On.useContext)(e),n=An(t||rc,t?o:ic);return t?n??void 0:void 0}function Mo(){let o=_n(),e=(0,On.useContext)(o),n=yi(e||rc,e?r=>r.masterRowInfo:ic);return e?n:void 0}var Nn=j(require("react")),tt=require("react");function Eo(o){if(o==null)return!1;let e=o;return!0}var Ao=require("react");var Ti=require("react"),Ut=()=>{let[o,e]=(0,Ti.useState)(0);return[o,(0,Ti.useCallback)(()=>{e(t=>t+1)},[e])]};var ac=o=>{let e=(0,Ao.useCallback)(o,[]),t=(0,Ao.useRef)(!1),n=(0,Ao.useRef)(!1),r=(0,Ao.useRef)(void 0),[i,a]=Ut();t.current&&(n.current=!0),(0,Ao.useEffect)(()=>(t.current||(r.current=e,t.current=!0),a(),()=>{n.current&&r.current&&r.current()}),[])};var Ci=require("react");function Ne(o){let e=(0,Ci.useRef)(o);return e.current=o,(0,Ci.useCallback)(()=>e.current,[])}var Ii=require("react"),_o=(o,e)=>{let t=(0,Ii.useRef)(e===void 0?o:e);return(0,Ii.useLayoutEffect)(()=>{t.current=o}),t.current};var Pr={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 _l=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",u=e.track||this.markerDetails.track||"Unknown";return performance.measure(s,{start:t,end:n,detail:{devtools:{dataType:"track-entry",trackGroup:i,track:u,color:r,properties:a.length>0?a.map(c=>[c.name,c.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(Pr).reduce((t,n)=>{let r={start:e.start,end:i=>e.end({...i,track:Pr[n].track,label:i.label}),get label(){let i=Pr[n];return Object.keys(i.labels).reduce((a,l)=>{let s={start:e.start,end:u=>e.end({...u,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=Pr[n];return e.markerDetails.track=i.track,r}}),t},{})}};function at(o){return _l.create(o)}function lc(o,e){let t=new Set;function n(...r){let i=e?e.getProxyTargetFromArgs(...r):r[0];t.clear();let a={get:function(u,c){return t.add(c),u[c]}},l=new Proxy(i,a),s=e?e.putProxyToArgs(l,...r):[l];return o.apply(this,s)}return{fn:n,propertyReads:t}}var Ol=o=>o&&o.substr(0,1).toUpperCase()+o.substr(1);function Dr(o){return o!==void 0}function Oo(o,e){let t=e[o];return Dr(t)}var sc=(o,e,t)=>{let n=o[e];typeof n=="function"&&n(...t)};function Ub(o,e,t){let n={};for(let r in o)if(o.hasOwnProperty(r)){let i=o[r],a=Oo(r,e)?e[r]:e[`default${Ol(r)}`];typeof i=="function"&&(a=i(a,t)),n[r]=a}return n}function uc(o,e,t){let{fn:n,propertyReads:r}=lc(o,{getProxyTargetFromArgs:a=>a.props,putProxyToArgs:(a,l)=>[{...l,props:a}]}),i=n(e);return r.forEach(a=>t.add(a)),i}function cc(o){let{props:e,initialSetupState:t,propsToForward:n,parentState:r,mapPropsToState:i,propsToStateSet:a}=o,l={};n&&(l=Ub(n,e,t));let s={...t,...l};if(i){let u=uc(i,{props:e,state:s,oldState:null,parentState:r},a);return{...s,...u}}return s}function dc(o,e,t){let{getProps:n,getParentState:r,mapPropsToState:i,concludeReducer:a,propsToStateSet:l}=t;if(e.type==="REPLACE_STATE")return e.payload;let s=r?.()??null,u=e.payload.mappedState,c=e.payload.updatedPropsToState,d={...o};if(u&&Object.assign(d,u),i){let f=uc(i,{props:n(),state:d,oldState:o,parentState:s},l);Object.assign(d,f)}return e.type==="ASSIGN_STATE"&&Object.assign(d,e.payload),a?a({previousState:o,state:d,updatedProps:c,parentState:s}):d}function pc(o){let{dispatch:e,getState:t,getProps:n,propsToForward:r,allowedControlledPropOverrides:i,interceptedActions:a,mappedCallbacks:l,notify:s=sc}=o,u=t();return Object.keys(u).reduce((c,d)=>{let p=d;return Object.defineProperty(c,d,{set:m=>{let g=n(),y=t(),h=!0;if(a&&typeof a[p]=="function"&&a[p](m,{actions:c,state:y})===!1&&(h=!1),h){let I=[m],T=`on${Ol(d)}Change`;if(l&&l[p]){let C=l[p](m,y);T=C.callbackName||T,I=C.callbackParams}s(g,T,I)}let b=r[p];typeof b=="function"&&(m=b(m));let S=!!i?.[p];Oo(d,g)&&!S||e({payload:{updatedProps:null,mappedState:{[d]:m}}})}}),c},{})}function fc(o){let{currentProps:e,prevProps:t,state:n,propsToForward:r,propsToStateSet:i}=o,a={},l=0,s={},u=0,c={},d=0;return new Set([...Object.keys(e),...Object.keys(t)]).forEach(f=>{let m=f,g=t[m],y=e[m];if(m!=="children"&&g!==y&&(c[m]={newValue:y,oldValue:g},d++,Oo(m,e)||Oo(m,t)))if(r.hasOwnProperty(f)){let h=y,b=r[f];typeof b=="function"&&(h=b(y)),n[m]!==h&&(a[m]=h,l++)}else i.has(f)&&(s[m]=e[m],u++)}),{newMappedState:a,newMappedStateCount:l,updatedPropsToState:s,updatedPropsToStateCount:u,rawUpdatedProps:c,rawUpdatedPropsCount:d}}var Nl;function mc(){return Nl||(Nl=(0,tt.createContext)(null))}function Ft(o){let e=o.getParentState||(()=>null);function t(r){let[i]=(0,tt.useState)(()=>o.initSetupState?o.initSetupState(r):{}),a=(0,tt.useRef)(new Set),l=(0,tt.useMemo)(()=>o.forwardProps?o.forwardProps(i,r):{},[i]),s=e(),u=Ne(s);function c(){return cc({props:r,initialSetupState:i,propsToForward:l,parentState:s,mapPropsToState:o.mapPropsToState,propsToStateSet:a.current})}let[d]=(0,tt.useState)(c),p=Ne(r),f=(v,P)=>dc(v,P,{getProps:p,getParentState:()=>u?.()??null,mapPropsToState:o.mapPropsToState,concludeReducer:o.concludeReducer,propsToStateSet:a.current}),[m,g]=(0,tt.useReducer)(f,d),y=Ne(m),{allowedControlledPropOverrides:h}=o,b=(0,tt.useMemo)(()=>pc({dispatch:g,getState:y,getProps:p,propsToForward:l,allowedControlledPropOverrides:h,interceptedActions:o.interceptActions,mappedCallbacks:o.mappedCallbacks}),[g,l,h]),S=o.Context??mc(),I=(0,tt.useMemo)(()=>({componentState:m,componentActions:b,getComponentState:y,replaceState:v=>{g({type:"REPLACE_STATE",payload:v})},assignState:v=>{g({type:"ASSIGN_STATE",payload:v})}}),[m,b,y]),T=_o(r),C=(0,tt.useRef)(!1);C.current=!1;let R=o.layoutEffect?tt.useLayoutEffect:tt.useEffect;return R(()=>{let v=r,{newMappedState:P,newMappedStateCount:w,updatedPropsToState:x,updatedPropsToStateCount:E,rawUpdatedProps:M,rawUpdatedPropsCount:D}=fc({currentProps:v,prevProps:T,state:m,propsToForward:l,propsToStateSet:a.current});if(E>0||w>0){let O=m.debugId,N=O?at(O).track.ComponentState.label.PropUpdate.start():void 0,L=o.debugName?typeof o.debugName=="function"?`${o.debugName(v)}:rerender`:`${o.debugName}:rerender`:"rerender";Nt(L)("Triggered by new values for the following props",...Object.keys(P??{}),...Object.keys(x??{})),N&&N.end({label:L,details:[w>0?{name:"Updated properties",value:Object.keys(P).join(", ")}:void 0,E>0?{name:"Updated props",value:Object.keys(x).join(", ")}:void 0,E>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(Eo)});let G={payload:{mappedState:w?P:null,updatedPropsToState:E?x:null}};if(C.current=!0,g(G),o.onPropChange){for(var A in M)if(M.hasOwnProperty(A)){let{newValue:B,oldValue:z}=M[A];o.onPropChange({name:A,newValue:B,oldValue:z},r,b,m)}}o.onPropsChange&&D&&o.onPropsChange(M,r,b,m)}}),R(()=>{s!=null&&!C.current&&g({type:"PARENT_STATE_CHANGE",payload:{}})},[s]),ac(()=>()=>{o.cleanup?.(y())}),{contextValue:I,ContextComponent:S}}return{ManagedComponentContextProvider:Nn.memo(function(i){let{contextValue:a,ContextComponent:l}=t(i);return Nn.createElement(l.Provider,{value:a},i.children)}),useManagedComponent:t}}function Lt(o){return o=o??mc(),Nn.useContext(o)}var Dc=j(require("react"));var mt="Infinite",Le={rootClassName:mt};var Ri=()=>Le;var gc="_16lm1iw2 _16lm1iw23 _16lm1iw26 _16lm1iw2c _16lm1iw2a",hc={center:"_16lm1iw2j",stretch:"_16lm1iw2k",start:"_16lm1iw2l",end:"_16lm1iw2m"};var Yt="_16lm1iw3b _16lm1iw3c _16lm1iw35",yc={pointer:"_16lm1iwk",default:"_16lm1iwl",colResize:"_16lm1iwm",grabbing:"_16lm1iwn",grab:"_16lm1iwo"},Fn={flex:"_16lm1iw1p",contents:"_16lm1iw1q",none:"_16lm1iw1r",block:"_16lm1iw1s",grid:"_16lm1iw1t",inlineBlock:"_16lm1iw1u",inlineFlex:"_16lm1iw1v",inlineGrid:"_16lm1iw1w"};var wi={1:"_16lm1iw1c",none:"_16lm1iw1d"},xr={column:"_16lm1iw2f",columnReverse:"_16lm1iw2g",row:"_16lm1iw2h",rowReverse:"_16lm1iw2i"};var bc={0:"_16lm1iw1y","100%":"_16lm1iw1z","50%":"_16lm1iw20"},Sc={center:"_16lm1iw30",spaceBetween:"_16lm1iw31",spaceAround:"_16lm1iw32",start:"_16lm1iw33",end:"_16lm1iw34"},Tc={0:"_16lm1iw26","100%":"_16lm1iw27","50%":"_16lm1iw28",auto:"_16lm1iw29"};var Cc={none:"_16lm1iwd"},Ic={hidden:"_16lm1iw35",auto:"_16lm1iw36",visible:"_16lm1iw37"};var vi={relative:"_16lm1iw1",absolute:"_16lm1iw2",static:"_16lm1iw3",sticky:"_16lm1iw4",fixed:"_16lm1iw5"};var Rc={0:"_16lm1iw23","100%":"_16lm1iw24","50%":"_16lm1iw25"};var wc={none:"_16lm1iw1x"};var vc={visible:"_16lm1iw38",hidden:"_16lm1iw39"};var Pc={1:"_16lm1iw1e",10:"_16lm1iw1f",100:"_16lm1iw1g",1e3:"_16lm1iw1h",1e4:"_16lm1iw1i",1e5:"_16lm1iw1j",1e6:"_16lm1iw1k",1e7:"_16lm1iw1l","1k":"_16lm1iw1m","10k":"_16lm1iw1n","100k":"_16lm1iw1o"};function xc(o){let{rootClassName:e}=Ri();return Dc.createElement("div",{...o,className:te(`${e}Footer`,vi.relative,Fn.flex,xr.row,o.className)})}var Me=j(require("react")),bo=require("react"),Yf=require("react-dom");function Pi(o){let e={};return Object.keys(o).forEach(t=>{e[t]=t}),e}function Q(o){return o.slice(4,-1)}var Mc=j(require("react")),ke=o=>{let e=o.size??"var(--infinite-icon-size)",t={flex:"none",width:e,height:e,fill:"currentColor",...o.style};return Mc.createElement("svg",{viewBox:"0 0 24 24",...o,style:t},o.children)};var Fl=j(require("react"));var ze={includesOperator:["M11.14 4L6.43 16H8.36L9.32 13.43H14.67L15.64 16H17.57L12.86 4H11.14M12 6.29L14.03 11.71H9.96L12 6.29","M4 18V15H2V20H22V18Z","M20 14V18H2V20H22V14Z"],startsWithOperator:["M11.14 4L6.43 16H8.36L9.32 13.43H14.67L15.64 16H17.57L12.86 4M12 6.29L14.03 11.71H9.96M4 18V15H2V20H22V18Z"],endsWithOperator:["M11.14 4L6.43 16H8.36L9.32 13.43H14.67L15.64 16H17.57L12.86 4M12 6.29L14.03 11.71H9.96M20 14V18H2V20H22V14Z"],eqOperator:["M19,10H5V8H19V10M19,16H5V14H19V16Z"],neqOperator:["M21,10H9V8H21V10M21,16H9V14H21V16M4,5H6V16H4V5M6,18V20H4V18H6Z"],gtOperator:["M5.5,4.14L4.5,5.86L15,12L4.5,18.14L5.5,19.86L19,12L5.5,4.14Z"],gteOperator:["M6.5,2.27L20,10.14L6.5,18L5.5,16.27L16.03,10.14L5.5,4L6.5,2.27M20,20V22H5V20H20Z"],ltOperator:["M18.5,4.14L19.5,5.86L8.97,12L19.5,18.14L18.5,19.86L5,12L18.5,4.14Z"],lteOperator:["M18.5,2.27L5,10.14L18.5,18L19.5,16.27L8.97,10.14L19.5,4L18.5,2.27M5,20V22H20V20H5Z"],done:["m9.55 19-6.725-6.725L5.25 9.85l4.3 4.325 9.225-9.225 2.425 2.4Z"],hidden:["m644-428-58-58q9-47-27-88t-93-32l-58-58q17-8 34.5-12t37.5-4q75 0 127.5 52.5T660-500q0 20-4 37.5T644-428Zm128 126-58-56q38-29 67.5-63.5T832-500q-50-101-143.5-160.5T480-720q-29 0-57 4t-55 12l-62-62q41-17 84-25.5t90-8.5q151 0 269 83.5T920-500q-23 59-60.5 109.5T772-302Zm20 246L624-222q-35 11-70.5 16.5T480-200q-151 0-269-83.5T40-500q21-53 53-98.5t73-81.5L56-792l56-56 736 736-56 56ZM222-624q-29 26-53 57t-41 67q50 101 143.5 160.5T480-280q20 0 39-2.5t39-5.5l-36-38q-11 3-21 4.5t-21 1.5q-75 0-127.5-52.5T300-500q0-11 1.5-21t4.5-21l-84-82Zm319 93Zm-151 75Z"],clear:["M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"]};var Ec=o=>Fl.createElement(ke,{...o},ze.includesOperator.map(e=>Fl.createElement("path",{key:e,d:e})));var Ll=j(require("react"));var Ac=o=>Ll.createElement(ke,{...o},Ll.createElement("path",{d:ze.endsWithOperator[0]}));var kl=j(require("react"));var _c=o=>kl.createElement(ke,{...o},kl.createElement("path",{d:ze.eqOperator[0]}));var zl=j(require("react"));var Oc=o=>zl.createElement(ke,{...o},zl.createElement("path",{d:ze.gteOperator[0]}));var Vl=j(require("react"));var Nc=o=>Vl.createElement(ke,{...o},Vl.createElement("path",{d:ze.gtOperator[0]}));var Gl=j(require("react"));var Fc=o=>Gl.createElement(ke,{...o},Gl.createElement("path",{d:ze.lteOperator[0]}));var Hl=j(require("react"));var Lc=o=>Hl.createElement(ke,{...o},Hl.createElement("path",{d:ze.ltOperator[0]}));var Kl=j(require("react"));var kc=o=>Kl.createElement(ke,{...o},Kl.createElement("path",{d:ze.neqOperator[0]}));var Bl=j(require("react"));var zc=o=>Bl.createElement(ke,{...o},Bl.createElement("path",{d:ze.startsWithOperator[0]}));var Ql=j(require("react"));var st=j(require("react")),Mr=require("react");var Ln=j(require("react")),tn=require("react");function Yb(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 qb(o){var e=Yb(o,"string");return typeof e=="symbol"?e:String(e)}function Xb(o,e,t){return e=qb(e),e in o?Object.defineProperty(o,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):o[e]=t,o}function Vc(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 Gc(o){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Vc(Object(t),!0).forEach(function(n){Xb(o,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(t)):Vc(Object(t)).forEach(function(n){Object.defineProperty(o,n,Object.getOwnPropertyDescriptor(t,n))})}return o}function Hc(o,e){var t={};for(var n in o)t[n]=e(o[n],n);return t}var Zb=(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},ye=o=>{var e=t=>{var n=o.defaultClassName,r=Gc(Gc({},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 u=o.variantClassNames[i][s];u&&(n+=" "+u)}}for(var[c,d]of o.compoundVariants)Zb(c,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 Hc(o.variantClassNames,t=>Hc(t,n=>n.split(" ")[0]))}},e};var Kc="_1eexc2a6";var Bc=ye({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:[]}),Wc="_12zfob1q _16lm1iw2 _16lm1iw1k _16lm1iw3b _16lm1iw3c _16lm1iw35",jc=ye({defaultClassName:"_16lm1iw2 _16lm1iw25 _16lm1iw26 _16lm1iwh _16lm1iwf",variantClassNames:{visible:{true:"_12zfob19",false:"_12zfob1a"}},defaultVariants:{},compoundVariants:[]}),$c=ye({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"]]}),Uc=ye({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"]]}),Yc="_12zfob12u _16lm1iw22 _16lm1iw1z";var qc="_12zfob17",Xc="_12zfob12q _16lm1iw1p _16lm1iw2h _16lm1iw2j _16lm1iw1",Zc=ye({defaultClassName:"_12zfob12r _16lm1iw1 _16lm1iw23",variantClassNames:{disabled:{true:"_12zfob12s",false:"_12zfob12t"}},defaultVariants:{},compoundVariants:[]}),Wl=ye({defaultClassName:"_12zfob12n _16lm1iw1p _16lm1iw2h _16lm1iw2k _16lm1iw1",variantClassNames:{active:{true:"_12zfob12o",false:"_12zfob12p"}},defaultVariants:{},compoundVariants:[]}),Qc="_12zfob12m _16lm1iw1p _16lm1iw2h _16lm1iw2j",Jc=ye({defaultClassName:"_12zfob127 _16lm1iw1 _16lm1iw1p _16lm1iw2f _16lm1iw32 _16lm1iw39",variantClassNames:{menuVisible:{true:"_12zfob128"},reserveSpaceWhenHidden:{true:"_12zfob129",false:"_12zfob12a"}},defaultVariants:{},compoundVariants:[[{menuVisible:!0,reserveSpaceWhenHidden:!1},"_12zfob12b"]]}),ed="_12zfob1b _16lm1iw2",td="_16lm1iw1",od="_12zfob16",nd=ye({defaultClassName:"_12zfob12",variantClassNames:{align:{start:"_12zfob13",center:"_12zfob14",end:"_12zfob15"}},defaultVariants:{},compoundVariants:[]}),rd="_12zfob12l _16lm1iw35 _16lm1iw1 _16lm1iw1p _16lm1iw2h";var Dt="InfiniteIcon";var id="_1nnkya20 _16lm1iw1p _16lm1iw2f _16lm1iw1 _16lm1iw32 _16lm1iw2j";var ad={transition:"width 0.25s, opacity 0.25s"},SP=Object.keys({size:1,lineWidth:1,lineStyle:1,style:1,className:1,index:1});function kn(o){let[e,t]=(0,tn.useState)(!0),[n,r]=(0,tn.useState)(0),{lineWidth:i=1,style:a,className:l,index:s}=o,u=s!=null&&s>0,c=o.size??16,d=Math.floor(c/4),p=[c-1*d,c-2*d,c-3*d],f={...ad,borderTop:`${i}px solid currentColor`,...o.lineStyle,opacity:n};if((0,tn.useEffect)(()=>{if(!e)return;let g=requestAnimationFrame(()=>{r(1)});return()=>{cancelAnimationFrame(g)}},[e]),(0,tn.useLayoutEffect)(()=>{t(!0)},[]),!e)return null;let m={};return Ln.createElement("div",{"data-name":"filter-icon",style:{...a,width:c},className:te(l,Dt,id,`${Dt}-filter`)},u?Ln.createElement("div",{"data-name":"index",style:m,className:qc},s):null,Ln.createElement("div",{style:{width:p[0],...f}}),Ln.createElement("div",{style:{width:p[1],...f}}),Ln.createElement("div",{style:{width:p[2],...f}}))}var Di=Object.freeze({}),Qb={string:Di,number:{}};function zn(o,e){let t=e.default||Di;return o.type===void 0?t:o.type===null?Di:typeof o.type=="string"?e[o.type]||Qb[o.type]||Di:o.type.reduce((n,r)=>Object.assign(n,e[r]),{})}var jl=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=[],u=[];t.forEach((R,v)=>{let P=R.maxSize??r??void 0,w=R.minSize??n??void 0;s.push(w),u.push(P),R.size!=null&&(P!=null&&R.size>P&&(R.size=P),w!=null&&R.size<w&&(R.size=w));let x=R.flex==0?null:R.flex;if(R.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+=R.size??0});let c=o.computeSpecialSpaceDistribution?Math.max(e,0):Math.max(e-i,0),d=c/a,p={},f={},m=0;t.forEach((R,v)=>{if(R.flex!=null){let P=d*R.flex,w=R.maxSize??r??void 0,x=R.minSize??n??void 0,E=!1,M=0;w!=null&&P>w&&(p[v]=!0,E=!0,M=w),x!=null&&P<x&&(f[v]=!0,E=!0,M=x),E&&(m+=1,l-=1,a-=R.flex,c-=M)}}),m&&(d=c/a);let g=[],y=0,h=c,b=a,S=0,I=0,T=[];return{items:t.map((R,v)=>{let P={...R},w=R.maxSize??r??void 0,x=R.minSize??n??void 0,E=0,M=p[v],D=f[v],A=M||D,O=R.size??0;if(R.flex!=null){if(A)D&&(E=x),M&&(E=w);else{y+=1;let N=L=>(w!=null&&L>w&&(L=w),x!=null&&L<x&&(L=x),L);y===l?E=N(h):(E=N(Math.round(R.flex*d)),I+=E,h=c-I,b-=R.flex,d=h/b)}O=E,P.flexSize=E}return g.push(E),T.push(O),P.computedSize=O,S+=O,P}),flexSizes:g,minSizes:s,maxSizes:u,computedSizes:T,remainingSize:Math.round(e-S)}};function xi(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 $l=o=>{let{availableSize:e,reservedWidth:t=0}=o,n=Object.keys(o.columnSizing).reduce((w,x)=>(w[x]={...o.columnSizing[x]},w),{});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],u=l.id,c=s?.id,d=l.computedWidth,p=l.computedMinWidth,f=l.computedMaxWidth,m=l.computedFlex?"flex":"width",g=s?.computedWidth,y=s?.computedMinWidth,h=s?.computedMaxWidth,b=s?.computedFlex?"flex":"width",S=!1,I=!1,T=r>0?1:-1,{value:C,clamped:R,diff:v}=xi(d+r,p,f,T);if(o.shareSpaceOnResize){if(s==null)return n[u]={...n[u],[m]:C},I=R==="min",S=R==="max",{adjustedDiff:C-d,reservedWidth:t,columnSizing:n,minReached:I,maxReached:S,constrained:I||S};let{value:w,clamped:x,diff:E}=xi(g-r,y,h,T);if(R&&x&&(Math.abs(v)>Math.abs(E)?x=!1:R=!1),!(!R&&!x)){if(R){let M=xi(g-r-v,y,h,T);w=M.value,x=M.clamped,E=M.diff}else if(x){let M=xi(d+r+E,p,f,T);C=M.value,R=M.clamped,v=M.diff}}n[u]={...n[u],[m]:C},n[c]={...n[c],[b]:w},I=R==="min"||x==="min",S=R==="max"||x==="max"}else n[u]={...n[u],[m]:C},I=R==="min",S=R==="max";let P=C-d;return{adjustedDiff:P,reservedWidth:o.shareSpaceOnResize?t:t-P,columnSizing:n,minReached:I,maxReached:S,constrained:I||S}};function ld(o,e){return o+e}function Jb(o){return Object.keys(o).reduce((t,n)=>(t[n]={...o[n]},t),{})}var sd=o=>{let{availableSize:e,reservedWidth:t=0}=o,n=Object.keys(o.columnSizing).reduce((h,b)=>(h[b]={...o.columnSizing[b]},h),{});if(e<0)throw"The provided availableSize cannot be negative!";let r=o.dragHandleOffset,i=[...new Array(o.columnGroupSize)].map((h,b)=>o.dragHandlePositionAfter-b).reverse(),a=i.map(h=>o.items[h]),l=a.map(h=>h.computedWidth),s=a.map(h=>h.computedFlex?"flex":"width"),u=0,{computedSizes:c}=jl({items:a.map(h=>(h.resizable===!1&&(u+=h.computedWidth),{maxSize:h.computedMaxWidth,minSize:h.computedMinWidth,flex:h.resizable?h.computedWidth:null,size:0})),computeSpecialSpaceDistribution:!0,availableSize:Math.max(l.reduce(ld,0)+r-u,0)}),d=a.map((h,b)=>c[b]-h.computedWidth),p=!0,f=!0,m=!0,g=[];d.forEach((h,b)=>{let S=a[b];if(!S.resizable){g.push(0);return}let I=s[b],T=l[b],C=Jb(n),{maxReached:R,minReached:v,constrained:P,adjustedDiff:w}=$l({availableSize:o.availableSize,reservedWidth:o.reservedWidth,dragHandleOffset:h,dragHandlePositionAfter:i[b],shareSpaceOnResize:!1,items:o.items,columnSizing:C});n[S.id]={...C[S.id],[I]:T+w},g.push(w),R||(f=!1),v||(p=!1),P||(m=!1)});let y=g.reduce(ld,0);return{minReached:p,maxReached:f,constrained:m,adjustedDiffs:g,adjustedDiff:y,columnSizing:n,reservedWidth:t-y}};var Mi;function No(){if(Mi!=null)return Mi;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),Mi=e.offsetWidth-t.offsetWidth,e.parentNode?.removeChild(e),Mi}var ud=["start",void 0,"end"],cd=(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:ud.indexOf(r)-ud.indexOf(i)}),o);function dd(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 Ul(o,...e){return dd(t=>t!=null,o,...e)}function pd(o,e,...t){return dd((n,r)=>!(r in o),e,...t)}var Ei=!0,eS=!0,tS=!0,fd="string",co="unknown";var oS=Do("getComputedVisibleColumns"),nS=(o,e,t)=>o[t]!==!1,Yl=(o,e)=>{if(!e)return!1;let t=e[o];return t==="start"||t===!0?"start":t==="end"?"end":!1};function on(o,e){if(o)return o[e]?o[e]:Object.values(o).find(t=>t.field===e)}function rS(o,e){let t=zn(o,e);return o.sortType?o.sortType:t.sortType?t.sortType:typeof o.type=="string"?o.type:fd}function iS(o,e,t){let r=(Array.isArray(o)?o:o?[o]:[]).flatMap(i=>{let a=i.field??i.groupField;if(!a)return[co];let l=on(e,a);if(!l)return[co];let s=rS(l,t);return Array.isArray(s)?s:[s]});return r.every(i=>i===co)?co:r.length===1?r[0]:r}function ql(o,e){let{colType:t,sortable:n,columnDefaultSortable:r}=e,i=o.defaultSortable??t.defaultSortable,a=!!o.groupByForColumn;if(i==null&&!a){let l=o.field??t.field,s=o.valueGetter??t.valueGetter;l==null&&s==null&&(i=!1)}return n??i??r??Ei}var md=({columns:o,userColumns:e,bodySize:t,columnMinWidth:n,columnMaxWidth:r,columnDefaultWidth:i,columnDefaultFlex:a,scrollbarWidth:l,columnCssEllipsis:s,columnHeaderCssEllipsis:u,pinnedStartMaxWidth:c,pinnedEndMaxWidth:d,filterValue:p,sortable:f,sortInfo:m,multiSort:g,filterTypes:y=Fo,viewportReservedWidth:h,resizableColumns:b,draggableColumns:S,columnDefaultDraggable:I,columnOrder:T,columnPinning:C,editable:R,columnDefaultEditable:v,columnDefaultFilterable:P,columnDefaultGroupable:w,columnDefaultSortable:x,columnSizing:E,columnTypes:M,columnVisibility:D,columnVisibilityAssumeVisible:A,groupBy:O})=>{let N=0,L={};O.forEach((W,oe)=>{W.field&&(L[W.field]=oe)});let F=(p||[]).reduce((W,oe)=>{let{id:he,field:Ie}=oe;return Ie&&(W[Ie]=oe),he&&(W[he]=oe),W},{}),G=cd(T===!0?Object.keys(o):T,C),B=G.filter(W=>o[W]?nS(D,A,W):(oS(`Column with id "${W}" specified in columnOrder array cannot be found in the columns map.`),!1)),z=new Map,U=B.map((W,oe)=>{let he=o[W];return z.set(W,oe),he}),K=(m??[]).reduce((W,oe,he)=>(oe.id?W[oe.id]={sortInfo:oe,index:he}:oe.field&&(W[oe.field]={sortInfo:oe,index:he}),W),{});function q(W){let oe=o[W],he=zn(oe,M),Ie={minWidth:he?.minWidth,maxWidth:he?.maxWidth,width:he?.defaultWidth,flex:he?.defaultFlex},Je=Ul({width:oe?.defaultWidth,flex:oe?.defaultFlex,minWidth:oe?.minWidth,maxWidth:oe?.maxWidth},E[W]);Je.width!=null&&delete Ie.flex,Je.flex!=null&&delete Ie.width,Je=Ul(Ie,Je);let V=Je.flex??void 0,Ze=Je.minWidth??oe?.minWidth??n,_e=Je.maxWidth??oe?.maxWidth??r,me=V!=null?void 0:Je.width??(a?void 0:i);return!me&&V==null&&(a?V=a:me=Ze),{size:me,flex:V,minSize:Ze,maxSize:_e}}let re=jl({availableSize:Math.max(t.width-(h??0)-(l??No()),0),maxSize:r,minSize:n,items:B.map(q)}),{computedSizes:se,flexSizes:de,minSizes:ae,maxSizes:ce}=re,le=[],X=[],k=[],Z=[];Z.length=B.length;let Y=new Map,$=new Map,ie=0,fe=0,pe=0,H=null,_=[],ue=0,Se=0,Re=0;U.forEach((W,oe)=>{let he=B[oe],Ie=se[oe],Je=_[oe]=Yl(he,C);Je==="start"?ue+=Ie:Je==="end"?Re+=Ie:Se+=Ie});let Ce=t.width-Re,Fe=[],Oe=new Map;B.forEach((W,oe)=>{let he=U[oe];Oe.set(W,he)});let Ye=[];Object.keys(o).forEach(W=>{let oe=o[W];Ye.push(W),Oe.has(W)||Oe.set(W,oe)});let nt=new Map;Oe.forEach((W,oe)=>{let he=z.get(oe);he==null&&(he=-1);let Ie=he!=-1,Je=B[he+1],V=zn(W,M),Ze=he,_e=K[oe]?K[oe]:W.field?K[W.field]??null:null,me=_e?.sortInfo??null,je=!!me,it=je&&me.dir===1,Lu=je&&!it,gb=_e?.index??-1,Sl=Ie?{}:q(oe),ku=Ie?se[he]:Sl.size||0,hb=Ie&&de[he]||null,yb=Ie?ae[he]||0:Sl.minSize||0,bb=Ie?ce[he]||1e4:Sl.maxSize||1e4,Pt=Ie?Yl(oe,C):!1,zu=Ie?he===B.length-1:!1,ci=Ze,Sb=Ie?Pt==="start"?fe:Pt==="end"?pe:N-fe:0;Pt=="start"?ci=Ie?Ze:-1:Pt==="end"?ci=Ie?Ze-(le.length+k.length):-1:ci=Ie?Ze-le.length:-1;let Tb=Ie?Pt==="start"||Pt===!1?N:Ce+pe:-1,Cb=Ie?Pt!==H:!1,Ib=Ie?zu||Pt!==Yl(Je,C):!1,Vu=W.cssEllipsis??V.cssEllipsis??s,Rb=W.headerCssEllipsis??V.cssEllipsis??W.cssEllipsis??V.headerCssEllipsis??u??Vu,di=Ie&&(F[oe]||W.field||W.groupByForColumn)&&(F[oe]||F[W.field||W.groupByForColumn])||null,wb=W.defaultFilterable??V.defaultFilterable??P??!0,vb=R??W.defaultEditable??V.defaultEditable??v??!1,Tl=W.dataType||V.dataType||(Array.isArray(W.type)?W.type[0]:W.type)||fd,Pb=W.sortType||V.sortType||Tl,Gu=W.filterType||V.filterType||Tl,Hu=!1;if(di!=null&&!di.disabled){let Il=y[Gu];Il&&(!Il.emptyValues||!Il.emptyValues.includes(di.filter.value))&&(Hu=!0)}let Mn=W.field??V.field,Db=W.valueGetter??V.valueGetter,Cl=W.defaultGroupable??V.defaultGroupable??w??!!Mn;Mn||(Cl=!1),W.groupByForColumn&&(Cl=!1);let Ku=Mn?L[Mn]!==void 0:!1,xb=Ku?L[Mn]:void 0,Mb=ql(W,{colType:V,sortable:f,columnDefaultSortable:x}),Eb=W.resizable??V.resizable??b??eS,Qe={colType:V,align:V.align,headerAlign:V.headerAlign,computedVisible:Ie,verticalAlign:V.verticalAlign,defaultHiddenWhenGroupedBy:V.defaultHiddenWhenGroupedBy,valueGetter:Db,valueFormatter:V.valueFormatter,renderValue:V.renderValue,render:V.render,style:V.style,className:V.className,contentFocusable:V.contentFocusable,renderMenuIcon:V.renderMenuIcon,renderSortIcon:V.renderSortIcon,renderRowDetailIcon:V.renderRowDetailIcon,renderSelectionCheckBox:V.renderSelectionCheckBox,renderHeaderSelectionCheckBox:V.renderHeaderSelectionCheckBox,headerStyle:V.headerStyle,headerClassName:V.headerClassName,columnGroup:V.columnGroup,getValueToEdit:V.getValueToEdit,getValueToPersist:V.getValueToPersist,shouldAcceptEdit:V.shouldAcceptEdit,field:Mn,...W,components:{...V.components,...W.components},computedResizable:Eb,computedMinWidth:yb,computedMaxWidth:bb,computedFlex:hb,computedDataType:Tl,computedEditable:vb,computedSortType:Pb,computedFilterType:Gu,cssEllipsis:Vu,headerCssEllipsis:Rb,computedFilterValue:di,computedFiltered:Hu,computedFilterable:wb,computedGroupable:Cl,computedGroupedBy:Ku,computedGroupedByIndex:xb,computedWidth:ku,computedAbsoluteOffset:Tb,computedPinningOffset:Sb,computedVisibleIndexInCategory:ci,computedOffset:N,computedSortable:Mb,computedSortInfo:me,computedSortIndex:gb,computedMultiSort:g,computedSorted:je,computedSortedAsc:it,computedSortedDesc:Lu,computedVisibleIndex:Ze,computedPinned:Pt,computedDraggable:S??W.defaultDraggable??I??tS,computedFirstInCategory:Cb,computedLastInCategory:Ib,computedFirst:he===0,computedLast:zu,id:oe,header:W.header??V.header??W.name??W.field};Ie&&(N+=ku,Y.set(Qe.id,Qe),Z[he]=Qe,Pt==="start"&&(le.push(Qe),fe+=Qe.computedWidth),Pt==="end"&&(X.push(Qe),pe+=Qe.computedWidth),Pt||(k.push(Qe),ie+=Qe.computedWidth),H=Pt),Qe.groupByForColumn&&(Qe.computedSortType=W.sortType||V.sortType||iS(Qe.groupByForColumn,e,M),Fe.push(Qe)),$.set(Qe.id,Qe),Qe.field&&!Qe.groupByForColumn&&!nt.has(Qe.field)&&nt.set(Qe.field,Qe)}),Fe.forEach(W=>{W.computedSortable=gd(W,{fieldsToColumn:nt,userColumns:e,columnTypes:M,sortable:f,columnDefaultSortable:x})});let We=new Map;Ye.forEach(W=>{let oe=$.get(W);oe&&We.set(W,oe)}),$.forEach(W=>{We.has(W.id)||We.set(W.id,W)});let rt=c!=null?Math.min(c,fe):fe,pt=d!=null?Math.min(d,pe):pe;return{computedRemainingSpace:t.width-(ue+Re+Se),computedPinnedStartColumnsWidth:fe,computedPinnedEndColumnsWidth:pe,computedUnpinnedColumnsWidth:ie,computedColumnOrder:G,computedPinnedStartColumns:le,computedPinnedEndColumns:X,computedUnpinnedOffset:fe,computedPinnedEndOffset:fe+ie,computedUnpinnedColumns:k,computedVisibleColumns:Z,computedColumnsMap:$,computedColumnsMapInInitialOrder:We,computedVisibleColumnsMap:Y,computedPinnedEndWidth:pt,computedPinnedStartWidth:rt,renderSelectionCheckBox:Z.reduce((W,oe)=>W||!!oe.renderSelectionCheckBox,!1),fieldsToColumn:nt}};function gd(o,e){let{sortable:t,fieldsToColumn:n,columnDefaultSortable:r,userColumns:i,columnTypes:a}=e;if(t)return t;let l=o.defaultSortable??o.colType.defaultSortable;if(l!=null)return l;let s=r??Ei,u=o.sortType??o.colType.sortType;return u!=null&&u!==co&&s?!0:d=>{let{column:p,api:f}=d,m=p.groupByForColumn||[];return m!=null&&!Array.isArray(m)&&(m=[m]),(m||[]).reduce((g,y)=>{if(!g)return!1;let h=y.field||y.groupField,b;if(h){let S=n.get(h),I=S?f.getColumnApi(S.id):void 0;if(S&&I)b=I.isSortable();else{let T=on(i,h);if(T){let C=ql(T,{colType:zn(T,a??{}),sortable:t,columnDefaultSortable:r});b=typeof C=="boolean"?C:void 0}else b=!1}}return b===void 0&&y.valueGetter&&(b=!0),b??r??Ei},!0)}}function gt(o,e){let{getComputed:t,getState:n,actions:r,api:i}=e;typeof o=="number"&&(o=t().computedVisibleColumns[o]);let a=typeof o=="string"?t().computedColumnsMap.get(o):o;if(!a)return null;let l={getCellValuesByPrimaryKey(s){return e.api.getCellValues({columnId:a.id,primaryKey:s})},getCellValueByPrimaryKey(s){return l.getCellValuesByPrimaryKey(s)?.value??null},toggleContextMenu(s){n().columnMenuVisibleForColumnId===a.id?this.hideContextMenu():this.showContextMenu(s)},toggleFilterOperatorMenu(s){n().filterOperatorMenuVisibleForColumnId===a.id?this.hideFilterOperatorMenu():this.showFilterOperatorMenu(s)},showFilterOperatorMenu(s){n().onFilterOperatorMenuClick({target:s,column:a})},hideFilterOperatorMenu(){i.hideFilterOperatorMenu()},showContextMenu(s){n().onColumnMenuClick({target:s,column:a})},hideContextMenu(){r.columnMenuVisibleForColumnId=null},isVisible(){return t().computedVisibleColumnsMap.has(a.id)},setVisible(s){i.setVisibilityForColumn(a.id,s)},toggleSort(s={multiSortBehavior:"replace"}){return i.toggleSortingForColumn(a.id,s)},isSortable(){let{computedColumnsMap:s}=t();return typeof a.computedSortable=="function"?a.computedSortable({api:i,columnApi:l,column:a,columns:s}):a.computedSortable},getSortDir(){return i.getSortingForColumn(a.id)},setFilter(s){return i.setColumnFilter(a.id,s)},clearFilter(){return i.clearColumnFilter(a.id)},getSortInfo(){return i.getSortInfoForColumn(a.id)},setSort(s){s?i.setSortingForColumn(a.id,s):i.setSortInfoForColumn(a.id,null)},clearSort(){this.setSort(null)},getColumnId(){return a.id},getComputedColumn(){return a}};return l}function nn(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:u}=e,c=a(),{allRowsSelected:d,someRowsSelected:p,selectionMode:f}=c,m=i(),g=n.header&&typeof n.header!="function"?n.header:n.name||n.id||"";if(typeof n.header=="function"){let y=gt(n.id,{...e,actions:l,dataSourceActions:s,dataSourceApi:u});g=n.header({horizontalLayoutPageIndex:null,column:n,columnApi:y,dataSourceApi:u,renderLocation:t,dragging:!1,columnsMap:m.computedColumnsMap,columnSortInfo:n.computedSortInfo,columnFilterValue:n.computedFilterValue,filtered:n.computedFiltered,allRowsSelected:d,someRowsSelected:p,selectionMode:f,api:r,renderBag:{header:g}})??null}return g}var hd=j(require("react"));var Vn=`${mt}HeaderCell__filter`,Ai=`${mt}HeaderCell__filterOperator`,YP=`${Vn}__input`;var Xl=hd.createContext(null);var bd=require("react");var yd=require("react"),Zl;function _i(){return Zl||(Zl=(0,yd.createContext)(null))}function ne(o){let e=_i(),t=(0,bd.useContext)(e);return An(t,o)}function He(){return ne(o=>({getState:o.getState,actions:o.actions,getComputed:o.getComputed,getDataSourceState:o.getDataSourceState,dataSourceApi:o.dataSourceApi,dataSourceActions:o.dataSourceActions,api:o.api,getDataSourceMasterContext:o.getDataSourceMasterContext}))}var aS=`${Vn}__input`,Oi=o=>o.stopPropagation();function Sd(o){let{filterOperatorMenuVisibleForColumnId:e}=ne(c=>({filterOperatorMenuVisibleForColumnId:c.state.filterOperatorMenuVisibleForColumnId})),{column:t}=Er(),n=o.filterEditor,r=o.filterOperatorSwitch,[i,a]=(0,Mr.useState)(!1),l=st.useCallback(()=>{a(!0)},[]),s=st.useCallback(()=>{a(!1)},[]),u=e===t.id||i;return st.createElement("div",{onPointerUp:Oi,onPointerDown:Oi,onFocus:l,onBlur:s,className:`${Vn} ${Wl({active:u})}`,style:{height:o.columnHeaderHeight}},st.createElement(Xl.Provider,{value:o},st.createElement(r,null),st.createElement(n,null)))}function Td(){let{columnApi:o,disabled:e,operator:t}=Gn(),n=t?.components?.Icon??kn;return st.createElement("div",{"data-name":"filter-operator","data-disabled":e,onMouseDown:r=>{r.stopPropagation(),!e&&o.toggleFilterOperatorMenu(r.target)},className:te(Ai,Xc,e?`${Ai}--disabled`:"")},st.createElement(n,{size:20,className:`${Zc({disabled:e})}`}))}function Cd(){return st.createElement("div",{onPointerUp:Oi,onPointerDown:Oi,className:`${Vn} ${Wl({active:!1})} ${bc["50%"]}`})}function Gn(){let o=He(),{column:e,columnApi:t}=Er(),n=nn(e,o,"column-filter"),r=st.useContext(Xl),{columnFilterType:i,filterTypes:a,columnFilterValue:l}=r,s=a[i],[u,c]=(0,Mr.useState)(l?.filter.value??""),d=st.useCallback(y=>{c(y),r.onChange(y)},[r.onChange]),p=st.useCallback(()=>{o.api.clearColumnFilter(e.id)},[e.id]),f=st.useCallback(()=>{o.api.removeColumnFilter(e.id)},[e.id]);(0,Mr.useEffect)(()=>{if(l)u!==l.filter.value&&c(l.filter.value);else if(s){let y=[...s.emptyValues][0];y!==u&&c(y)}},[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:u,disabled:l?.disabled,filterType:s,filterTypes:a,filterTypeKey:i,filtered:e.computedFiltered,setValue:d,clearValue:p,removeColumnFilter:f,ariaLabel:`Filter for ${n}`,className:`${Yc} ${aS}`}}function Hn(){let{ariaLabel:o,value:e,setValue:t,className:n,disabled:r}=Gn();return Ql.createElement("input",{"data-xxx":!0,"aria-label":o,type:"text",disabled:r,value:e,onChange:i=>{t(i.target.value)},className:n})}function Ni(){let{ariaLabel:o,value:e,setValue:t,className:n,disabled:r}=Gn();return Ql.createElement("input",{"aria-label":o,type:"number","data-yyy":!0,disabled:r,value:e??"",onChange:i=>{let a=isNaN(i.target.valueAsNumber)?i.target.value:i.target.valueAsNumber;t(a)},className:n})}var qt=(o,e)=>{let t=o?.[e];return t?{components:{Icon:t}}:{}};function Id(o={}){let{StringFilterEditor:e,NumberFilterEditor:t,icons:n}=o;return{string:{label:"Text",emptyValues:[""],defaultOperator:"includes",components:e?{FilterEditor:e}:void 0,operators:[{name:"includes",...qt(n,"includes"),label:"Includes",fn:({currentValue:r,filterValue:i})=>typeof r=="string"&&typeof i=="string"&&r.toLowerCase().includes(i.toLowerCase())},{label:"Equals",...qt(n,"eq"),name:"eq",fn:({currentValue:r,filterValue:i})=>typeof r=="string"&&r===i},{name:"startsWith",...qt(n,"startsWith"),label:"Starts With",fn:({currentValue:r,filterValue:i})=>r.startsWith(i)},{name:"endsWith",...qt(n,"endsWith"),label:"Ends With",fn:({currentValue:r,filterValue:i})=>r.endsWith(i)}]},number:{label:"Number",emptyValues:["",null,void 0],defaultOperator:"eq",components:t?{FilterEditor:t}:void 0,operators:[{label:"Equals",...qt(n,"eq"),name:"eq",fn:({currentValue:r,filterValue:i})=>r==i},{label:"Not Equals",...qt(n,"neq"),name:"neq",fn:({currentValue:r,filterValue:i})=>r!=i},{name:"gt",label:"Greater Than",...qt(n,"gt"),fn:({currentValue:r,filterValue:i,emptyValues:a})=>a.includes(r)?!0:r>i},{name:"gte",...qt(n,"gte"),label:"Greater Than or Equal",fn:({currentValue:r,filterValue:i,emptyValues:a})=>a.includes(r)?!0:r>=i},{name:"lt",...qt(n,"lt"),label:"Less Than",fn:({currentValue:r,filterValue:i,emptyValues:a})=>a.includes(r)?!0:r<i},{name:"lte",...qt(n,"lte"),label:"Less Than or Equal",fn:({currentValue:r,filterValue:i,emptyValues:a})=>a.includes(r)?!0:r<=i}]}}}var Fo=Id({StringFilterEditor:Hn,NumberFilterEditor:Ni,icons:{includes:Ec,eq:_c,neq:kc,startsWith:zc,endsWith:Ac,gt:Nc,gte:Oc,lt:Lc,lte:Fc}});function Fi(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 $n=require("react"),sp=require("react-dom");function Lo(o,e){let t=o;if(!t)return null;if(t&&t.matches(e))return t;for(;t=t.parentElement;)if(t.matches(e))return t;return null}function Rd(o,e,t){let n=o;if(!n)return null;if(n&&n.matches(e))return n;for(;n=n.parentElement;){if(n.matches(e))return n;if(n===t)return null}return null}var J={currentColumnTransformX:"var(--_16hkbkc0)",y:"var(--_16hkbkc1)",currentFlashingBackground:"var(--_16hkbkc2)",currentFlashingDuration:"var(--_16hkbkc3)",activeCellRowOffset:"var(--_16hkbkc4)",activeCellRowOffsetX:"var(--_16hkbkc5)",activeCellRowHeight:"var(--_16hkbkc6)",activeCellOffsetX:"var(--_16hkbkc7)",activeCellOffsetY:"var(--_16hkbkc8)",scrollTopForActiveRow:"var(--_16hkbkc9)",scrollLeftForActiveRowWhenHorizontalLayout:"var(--_16hkbkca)",activeCellColWidth:"var(--_16hkbkcb)",activeCellColOffset:"var(--_16hkbkcc)",columnReorderEffectDurationAtIndex:"var(--_16hkbkcd)",columnWidthAtIndex:"var(--_16hkbkce)",columnOffsetAtIndex:"var(--_16hkbkcf)",columnOffsetAtIndexWhileReordering:"var(--_16hkbkcg)",columnVisibilityAtIndex:"var(--_16hkbkch)",columnZIndexAtIndex:"var(--_16hkbkci)",pinnedStartWidth:"var(--_16hkbkcj)",pinnedEndWidth:"var(--_16hkbkck)",pinnedEndOffset:"var(--_16hkbkcl)",computedVisibleColumnsCount:"var(--_16hkbkcm)",baseZIndexForCells:"var(--_16hkbkcn)",bodyWidth:"var(--_16hkbkco)",bodyHeight:"var(--_16hkbkcp)",scrollbarWidthHorizontal:"var(--_16hkbkcq)",scrollbarWidthVertical:"var(--_16hkbkcr)",scrollLeft:"var(--_16hkbkcs)",scrollTop:"var(--_16hkbkct)"};var wd="true",ge={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)"}}},vd="column-header-height";var Pd=`.${Le.rootClassName}`;function Jl(o){return Lo(o,Pd)}var Dd=Q(J.scrollLeft),lS=Q(J.scrollTop),sS=Q(J.columnWidthAtIndex),es=Q(J.columnOffsetAtIndex),xd=Q(J.columnReorderEffectDurationAtIndex),uS=Q(J.columnOffsetAtIndexWhileReordering),cS=Q(J.columnVisibilityAtIndex),dS=Q(J.columnZIndexAtIndex);function Xt(o,e,t){let n=t?Jl(t):document.querySelector(Pd);pS(o,e,n)}function pS(o,e,t){if(t){let n=o,r=J[n]?Q(J[n]):o;t.style.setProperty(r,`${e}`)}}function Kn(o,e){if(e)for(var t in o){let n=J[t]?Q(J[t]):t,r=`${o[t]}`;e.style.setProperty(n,r)}}function ts(o,e,t){Xt(`${es}-${o.computedVisibleIndex}`,o.computedPinned?`calc( ${o.computedAbsoluteOffset+e}px + var(${Dd}))`:`${o.computedAbsoluteOffset+e}px`,t)}function os(o,e,t){Xt(`${dS}-${o}`,`${e}`,t)}function Ar(o,e,t){Xt(`${uS}-${o}`,typeof e=="number"?`calc( var(${es}-${o}) + ${e}px )`:e,t)}function _r(o,e,t){Xt(`${cS}-${o}`,e,t)}function Li(o,e,t){Xt(`${xd}-${o}`,t??"",e)}function ns(o,e){let t=`${xd}-${o}`;Xt(t,ge.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`${sS}-${o}`}},set(o,e,t){e=typeof e=="number"?e+"px":e,Xt(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`${es}-${o}`}},set(o,e,t){e=typeof e=="number"?e+"px":e,Xt(this.varName.get(o),e,t)}}};function Md(o,e){Kn({[Dd]:`${o.scrollLeft}px`,[lS]:`${o.scrollTop}px`},e)}var Ed="_16lm1iw1",Ad="_1yeub2v0 _16lm1iw1 _16lm1iw1p _16lm1iw2f _16lm1iw0",_d="_1yeub2vs",Od="_1yeub2vr",Nd=ye({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 rs="_1yeub2vp";var KD=ye({defaultClassName:"_1yeub2vl",variantClassNames:{pinned:{start:"_1yeub2vm",end:"_1yeub2vn",false:"_1yeub2vo"}},defaultVariants:{},compoundVariants:[]});var Bd=require("react");var Or={bodyWidth:{name:Q(ge.runtime.bodyWidth),value:""},totalVisibleColumnsWidthValue:{name:Q(ge.runtime.totalVisibleColumnsWidthValue),value:""},totalVisibleColumnsWidthVar:{name:Q(ge.runtime.totalVisibleColumnsWidthVar),value:""},visibleColumnsCount:{name:Q(ge.runtime.visibleColumnsCount),value:""},browserScrollbarWidth:{name:Q(ge.runtime.browserScrollbarWidth),value:""}},fS=Q(J.scrollbarWidthHorizontal),Fd=Q(J.scrollbarWidthVertical),mS=Q(J.columnWidthAtIndex),gS=Q(J.columnZIndexAtIndex),Ld=Q(J.scrollLeft),hS=Q(J.activeCellColWidth),kd=Q(J.activeCellColOffset),Hd=Q(J.baseZIndexForCells),yS=Q(J.pinnedStartWidth),zd=Q(J.bodyWidth),bS=Q(J.bodyHeight),Vd=Q(J.pinnedEndOffset),Gd=Q(J.pinnedEndWidth),SS=Q(J.computedVisibleColumnsCount);function ki(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(${Hd}) `+(t<0?"-":"+")+` ${Math.abs(t)} )`:"auto"}function Kd(o){let{computedVisibleColumns:e,computedPinnedStartColumns:t,computedPinnedEndColumns:n,computedPinnedStartColumnsWidth:r,computedPinnedEndColumnsWidth:i,computedUnpinnedColumnsWidth:a,bodySize:l,activeCellIndex:s,brain:u,scrollbars:c}=o,d=No(),p=[],f=e.reduce((m,g)=>{let y=g.computedVisibleIndex;m[we.columnWidths.varName.get(y)]=g.computedWidth+"px",m[we.columnOffsets.varName.get(y)]=g.computedPinned==="start"?`calc( ${g.computedOffset}px + var(${Ld}) )`:g.computedPinned==="end"?`calc( var(${Vd}) ${p.length?"+":""} ${p.map(b=>we.columnWidths.get(b.computedVisibleIndex)).join(" + ")} + var(${Ld}) )`:`${g.computedOffset}px`;let h=ki(g,{pinnedStartColsCount:t.length,visibleColsCount:e.length});return m[`${gS}-${y}`]=`${h}`,g.computedPinned==="end"&&p.push(g),m},{});if(l.width&&(f[Or.browserScrollbarWidth.name]=`${No()}px`),f[Or.bodyWidth.name]=`calc(${J.bodyWidth} - ${J.scrollbarWidthVertical})`,f[Or.totalVisibleColumnsWidthValue.name]=`${r+i+a}px`,f[Or.totalVisibleColumnsWidthVar.name]=`calc(${e.map((m,g)=>`var(${mS}-${g})`).join(" + ")})`,f[Or.visibleColumnsCount.name]=e.length,s!=null){f[hS]=we.columnWidths.get(s[1]);let m=we.columnOffsets.get(s[1]);if(u.isHorizontalLayoutBrain){let g=u.getPageIndexForRow(s[0]);f[kd]=g?`calc( ${ge.runtime.totalVisibleColumnsWidthVar} * ${g} + ${m})`:m}else f[kd]=m}return f[SS]=e.length,f[fS]=c.horizontal?`${d}px`:"0px",f[Fd]=c.vertical?`${d}px`:"0px",f[yS]="calc( "+t.map(m=>we.columnWidths.get(m.computedVisibleIndex)).join(" + ")+")",f[Gd]="calc( "+n.map(m=>we.columnWidths.get(m.computedVisibleIndex)).join(" + ")+")",f[Hd]=e.length*10,f[Vd]=`calc( var(${zd}) - var(${Gd}) - var(${Fd}) )`,f[zd]=`${l.width}px`,f[bS]=`${l.height}px`,f}var is=o=>{let e=0;return(...t)=>{e&&cancelAnimationFrame(e),e=requestAnimationFrame(()=>{e=0,o(...t)})}};function Wd(o){let{actions:e,getState:t,focused:n,focusedWithin:r,domRef:i,scrollerDOMRef:a,onBlurWithin:l,onFocusWithin:s,onSelfFocus:u,onSelfBlur:c,bodySize:d,activeCellIndex:p,wrapRowsHorizontally:f,computedPinnedStartColumnsWidth:m,computedPinnedEndColumnsWidth:g,computedPinnedStartColumns:y,computedPinnedEndColumns:h,computedVisibleColumns:b,computedUnpinnedColumnsWidth:S,scrollbars:I,focusedClassName:T,focusedWithinClassName:C,computedPinnedStartOverflow:R,computedPinnedEndOverflow:v,focusedStyle:P,focusedWithinStyle:w,brain:x}=ne(F=>{let{state:G,computed:B}=F;return{brain:G.brain,actions:F.actions,getState:F.getState,focused:G.focused,focusedWithin:G.focusedWithin,domRef:G.domRef,scrollerDOMRef:G.scrollerDOMRef,onBlurWithin:G.onBlurWithin,onFocusWithin:G.onFocusWithin,onSelfFocus:G.onSelfFocus,onSelfBlur:G.onSelfBlur,bodySize:G.bodySize,activeCellIndex:G.activeCellIndex,wrapRowsHorizontally:G.wrapRowsHorizontally,computedPinnedStartColumnsWidth:B.computedPinnedStartColumnsWidth,computedPinnedEndColumnsWidth:B.computedPinnedEndColumnsWidth,computedPinnedStartColumns:B.computedPinnedStartColumns,computedPinnedEndColumns:B.computedPinnedEndColumns,computedVisibleColumns:B.computedVisibleColumns,computedUnpinnedColumnsWidth:B.computedUnpinnedColumnsWidth,scrollbars:B.scrollbars,focusedClassName:F.state.focusedClassName,focusedWithinClassName:F.state.focusedWithinClassName,computedPinnedStartOverflow:B.computedPinnedStartOverflow,computedPinnedEndOverflow:B.computedPinnedEndOverflow,focusedStyle:F.state.focusedStyle,focusedWithinStyle:F.state.focusedWithinStyle}}),E=(0,Bd.useMemo)(()=>Kd({computedVisibleColumns:b,computedPinnedStartColumns:y,computedPinnedEndColumns:h,computedPinnedStartColumnsWidth:m,computedPinnedEndColumnsWidth:g,computedUnpinnedColumnsWidth:S,bodySize:d,activeCellIndex:p,brain:x,scrollbars:I}),[b,y,h,m,g,S,d,p,x,I]),M=is(F=>{e.focused=F}),D=is(F=>{e.focusedWithin=F}),N={...o,onFocus:F=>{if(o?.onFocus?.(F),F.target===i.current||F.target===a.current){if(t().focused)return;M(!0),u?.(F),r&&(D(!1),l?.(F));return}r||(D(!0),s?.(F))},onBlur:F=>{if(o?.onBlur?.(F),F.target===i.current||F.target===a.current){if(!t().focused)return;M(!1),c?.(F),r&&(D(!1),l?.(F));return}i.current?.contains(F.relatedTarget)||(D(!1),l?.(F))}},L=te(Zt,Ad,f?`${Zt}--horizontal-layout`:null,N?.className,m?`${Zt}--has-pinned-start ${Od}`:null,g?`${Zt}--has-pinned-end ${_d}`:null,n?`${Zt}--focused`:null,r?`${Zt}--focused-within`:null,n&&T?T:null,r&&C?C:null,R?`${Zt}--has-pinned-start-overflow`:null,v?`${Zt}--has-pinned-end-overflow`:null,Nd({horizontalLayout:!!f,hasPinnedStart:!!m,hasPinnedEnd:!!g,focused:n,focusedWithin:r}));return N.className=L,N.style={...o?.style,...E},n&&P&&Object.assign(N.style,P),r&&w&&Object.assign(N.style,w),N}var Jd=j(rn());function zi(o){return o.map(e=>e instanceof ko?e:new ko(null,[e]))}var ko=class o{constructor(e,t=[]){this.__operands=[];this.__operation=null;this.__operands=t,this.__operation=e}add(...e){return new o("+",[this,...e])}subtract(...e){return new o("-",[this,...e])}minus(...e){return this.subtract(...e)}multiply(...e){return new o("*",[this,...e])}divide(...e){return new o("/",[this,...e])}__get(e){let{__operation:t,__operands:n}=this,r=n.map(a=>TS(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 TS(o,e){return typeof o=="string"||typeof o=="number"?`${o}`:e?o.__get(e):o.done()}var CS=(...o)=>new ko("+",zi(o)),$d=(...o)=>new ko("-",zi(o)),IS=(...o)=>new ko("*",zi(o)),RS=(...o)=>new ko("/",zi(o)),Nr={add:CS,subtract:$d,minus:$d,multiply:IS,divide:RS};var an=(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 Ve=xe().requestAnimationFrame||(o=>setTimeout(o,16)),zt=xe().cancelAnimationFrame||(o=>clearTimeout(o));var Ud=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 c=r.scrollAmountsPerRaf.length,d=Math.round(r.offset/c),p=0;for(let f=0;f<c;f++)s>(f+1)*d&&(p=r.scrollAmountsPerRaf[f]);return n.scrollLeft=n.scrollLeft-p,e=Ve(()=>{i.scroll(n)}),!0}function l(){let s=r.mousePosition.clientX-(r.scrollOffsetEnd-r.offset);if(!(s>0&&s<=r.offset))return!1;let c=r.scrollAmountsPerRaf.length,d=Math.round(r.offset/c),p=0;for(let f=0;f<c;f++)s>(f+1)*d&&(p=r.scrollAmountsPerRaf[f]);return n.scrollLeft=n.scrollLeft+p,t=Ve(()=>{i.scroll(n)}),!0}return!!(a()||l())}}};var $e=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 qd(o,e){return Math.sqrt((e.top-o.top)**2+(e.left-o.left)**2)}function wS(o,e,t){let n=Yd(o,t),r=Yd(e,t);return n===r?qd(t,e)-qd(t,o):n-r}function Xd(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)=>wS(n,r,t)),e}function vS(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 PS(o,e){if(o.length<2)return o[0]?o[0].left===e.left&&o[0].top===e.top:!1;o=Xd(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 Zd(o,e){if(vS(o))return PS(o,e);o=Xd(o);let[t]=o;for(let n=1,r=o.length-1;n<r;n++){let i=o[n],a=o[n+1];if(DS([t,i,a],e))return!0}return!1}function DS(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 Bn=class{containsPoint(e){return Zd(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 Wn=class o extends Bn{static clone(e){return new o(e)}constructor(e){super(),this.points=e.map($e.clone)}getPoints(){return this.points}shift(e){return this.points.forEach(t=>{t.shift(e)}),this}};function xS(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,u=Math.max(l,s);return new ve({top:n,left:t,width:a-t,height:u-n})}var ve=class o extends Bn{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=xS(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 Wn(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($e.from)}shift(t){return t.top!=null&&(this.top+=t.top),t.left!=null&&(this.left+=t.left),this}};var Qd=10,MS=Q(J.pinnedStartWidth);function ep(o){let{computedVisibleColumns:e,computedVisibleColumnsMap:t,computedPinnedEndColumns:n,computedPinnedStartColumns:r,dragColumnId:i,infiniteDOMNode:a,brain:l,dragColumnHeaderTargetRect:s,draggableColumnsRestrictTo:u,tableRect:c,acceptDropToReorderRect:d,allowColumnHideOnDrag:p,setProxyPosition:f,setDragColumnOutside:m,getCurrentDragSourceAndTarget:g,api:y,horizontalLayoutPageIndex:h,pageWidth:b}=o;function S(k){let Z=k==="start"?L:F;return A===N?Z:N===k?Z+M.computedWidth:A===k?Z-M.computedWidth:Z}function I(k){if(k.columnIndex===D||h!=null)return!0;let Z=e[k.columnIndex];if(Z.computedPinned)return!0;let Y=l.getScrollPosition().scrollLeft,$=Z.computedOffset+(h!=null&&b!=null?b*h:0);return $>=Y+S("start")&&$+Z.computedWidth<=Y+c.width-S("end")}let T=(k,Z)=>{let{restrictToParentGroup:Y,dragColumn:$}=Z,ie=[];if(k.forEach(pe=>{if(pe.computedVisibleIndex===D)return;let H={columnId:pe.id,columnIndex:pe.computedVisibleIndex,offsetX:pe.computedOffset+Math.round(pe.computedWidth/2)};I(H)&&ie.push(H)}),Y){let H=function(ue,Se,Re){let Ce=k[ue];Ce&&(Ce.columnGroup!==$.columnGroup&&Re.add(Ce.id),H(ue+Se,Se,Re))};var fe=H;let pe=$.computedVisibleIndex,_=new Set;H(pe-1,-1,_),H(pe+1,1,_),ie=ie.filter(ue=>!_.has(ue.columnId))}return ie},R=r.length,v={clientX:Math.round(o.initialMousePosition.clientX),clientY:Math.round(o.initialMousePosition.clientY)},P={left:v.clientX-c.left-(v.clientX-s.left)+Qd,top:v.clientY-c.top-(v.clientY-s.top)+Qd},w=l.getScrollPosition(),x=e.map(k=>k.computedVisibleIndex),E=x,M=t.get(i),D=M.computedVisibleIndex,A=M?.computedPinned,O=D,N=A,L=l.getFixedStartColsWidth(),F=l.getFixedEndColsWidth(),G=v,B={x:0,y:0},z=1,U=0;function K(k){let Z=Math.round(k.clientX),Y=Math.round(k.clientY);if(Z===G.clientX&&Y===G.clientY)return ve.from(s).shift({left:B.x,top:B.y});G={clientX:Z,clientY:Y};let ie=l.getScrollPosition().scrollLeft-w.scrollLeft;return B.x=G.clientX-v.clientX,B.y=G.clientY-v.clientY,U=B.x+ie,z=U<0?-1:1,f({left:P.left+B.x,top:P.top+B.y}),ve.from(s).shift({left:B.x,top:B.y})}function q(k){let Z=0;A?A==="start"&&k.forEach((Y,$)=>{Z||e[Y]?.computedPinned!=="start"&&(Z=$)}):k.forEach((Y,$)=>{e[Y]?.computedPinned==="start"&&(Z=$+1)}),R=Z,re("start",k,Z)}function re(k,Z,Y){if(k==="start"){let $=0;for(let ie=0;ie<Y;ie++){let fe=Z[ie],pe=e[fe];$+=pe.computedWidth}Xt(MS,`${$}px`,a)}}function se(k){if(k==null||k===O)return;if(O===-1&&k!==-1&&(_r(D,"",a),m(!1)),O=k,k===-1){de(D);return}let Z=an(x,D,O>D?O-1:O);R=0;let $=new Set;return Z.forEach((ie,fe)=>{let pe=E[fe];ie!==pe&&$.add(ie),q(Z)}),E=Z,ae($),{newColumnIndexes:Z,indexesWithTransition:$,pinnedStartCount:R}}function de(k){E=E.filter(Y=>Y!==k),e.forEach(Y=>{let $=Y.computedVisibleIndex,ie=$>k;ns($,a);let fe="";ie&&(fe=Nr.minus(we.columnOffsets.get($),we.columnWidths.get(k)).done()),Ar($,fe,a)}),_r(k,"hidden",a),m(!0)}function ae(k){e.forEach(Z=>{let Y=Z.computedVisibleIndex;k.has(Y)?ns(Y,a):Li(Y,a);let $=Y===D,ie=z===-1?Y<O||Y>D:Y<D||Y>=O,fe="";z===-1?fe=$?we.columnOffsets.get(O):ie?we.columnOffsets.get(Y):Nr.add(we.columnOffsets.get(Y),we.columnWidths.get(D)).done():fe=ie?we.columnOffsets.get(Y):$?Nr.add(we.columnOffsets.get(O-1),we.columnWidths.get(O-1)).minus(we.columnWidths.get(D)).done():Nr.minus(we.columnOffsets.get(Y),we.columnWidths.get(D)).done(),Ar(Y,fe,a)})}let ce=c.left+S("start"),le=c.right-S("end"),X=Ud({scrollOffsetStart:ce,scrollOffsetEnd:le});return K(v),{speedScroller:X,stop(){X.stop()},onMove(k){let Z=K(k);if(g().dropTargetListId==="grouping-toolbar"||p&&!d.containsPoint(Z.getCenter()))return p&&se(-1),null;X.scroll({mousePosition:G,get scrollLeft(){return l.getScrollPosition().scrollLeft},set scrollLeft(H){y.scrollLeft=H}});let Y=T(e,{dragColumn:M,restrictToParentGroup:u==="group"}),$=z===-1?M.computedOffset+U:M.computedOffset+M.computedWidth+U,ie=(0,Jd.default)(Y,$,({offsetX:H},_)=>H<_?-1:H>_?1:0);ie<0&&(ie=~ie),Y.length?ie=Y[ie]?Y[ie].columnIndex:Y[Y.length-1].columnIndex+1:(e.length>1&&console.error("No breakpoints available, something is wrong!"),ie=0),ie===D+1&&(ie=D),se(ie);let fe={};n.forEach(H=>{fe[H.id]="end"});for(let H=0;H<R;H++){let _=E[H],ue=e[_];fe[ue.id]="start"}let pe=E.map(H=>e[H].id);return{columnPinning:fe,columnOrder:pe}}}}function as(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],u=n.indexOf(s),c=n.indexOf(r);return an(n,c,u)}else{let l=e.indexOf(r),s=e[l+1],u=n.indexOf(s),c=n.indexOf(r);return an(n,c,u)}return e}var Ct=j(require("react"));var ln=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 tp=j(rn());var op=(o,e)=>{let{offset:t,activeDragSource:n}=o,{orientation:r,draggableItems:i,listId:a,listRectangle:l}=e.getData(),{dragItem:s,listId:u,dragIndex:c,dragRectangle:d}=n,p=u===a,f=$e.from(d.getCenter());if(!l.containsPoint(f))return null;e.activeDragSourcePosition="inside";let m=p?r==="horizontal"?t.left>0?1:-1:t.top>0?1:-1:1,g=d.toDOMRect(),y=e.breakpoints,h=Math.round(m===1?r==="horizontal"?g.right-(p?0:g.width/2):g.bottom-(p?0:g.height/2):r==="horizontal"?g.left+(p?0:g.width/2):g.top+(p?0:g.height/2)),b=(0,tp.default)(y,h,(R,v)=>R-v);b<0&&(b=~b),m===1&&b===c+1&&p&&b--;let S=Math.min(c,b),I=Math.max(c,b),T=p?i.map((R,v)=>{if(v===c&&p)return t;if(v<S||v>=I)return{left:0,top:0};let P=b<=v?1:-1;return r==="horizontal"?{left:Math.round(P*g.width),top:0}:{left:0,top:Math.round(P*g.height)}}):i.map((R,v)=>{let P=b<=v?1:0;return r==="horizontal"?{left:Math.round(P*g.width),top:0}:{left:0,top:Math.round(P*g.height)}}),C={offset:t,dropIndex:b,dragSourceListId:u,dropTargetListId:a,dragIndex:c,outside:!1,items:i,dragItem:s,offsetsForItems:T,dragRect:g,status:"accepted"};return e.acceptsDrop(C)?{event:C,error:null,success:!0}:(C.status="rejected",{event:C,error:"rejected by interaction target",success:!1})},np=(o,e)=>{let{offset:t,activeDragSource:n}=o,{orientation:r,listId:i,listRectangle:a,draggableItems:l}=e.getData(),{dragRectangle:s,dragItem:u,listId:c}=n,d=$e.from(s.getCenter()),p=c===i,f=a.containsPoint(d);if(f&&!(p&&!e.acceptsSelfDrops())||e.activeDragSourcePosition==="outside"&&!p)return null;e.activeDragSourcePosition="outside";let m=p?n.dragIndex:-1,g=s.toDOMRect(),y={offset:t,dropIndex:-1,dragIndex:m,dragItem:u,outside:!f,items:l,dragSourceListId:c,dropTargetListId:i,offsetsForItems:p?l.map((h,b)=>h.id===u.id?t:f?{left:0,top:0}:b>m&&!e.getData().preserveDragSpace?r==="horizontal"?{left:-u.rect.width,top:0}:{left:0,top:-u.rect.height}:{left:0,top:0}):l.map(h=>({left:0,top:0})),dragRect:g,status:"accepted"};return e.acceptsDrop(y)?{event:y,error:null,success:!0}:(y.status="rejected",{event:y,error:"rejected by interaction target",success:!1})};var Pe=class Pe{static startDrag(e,t){let n=e instanceof jn?e:new jn(e),r=new ls({activeDragSource:n,startPoint:t});return Pe.currentDragOperation=r,r.on("start",Pe.onDragStart),r.on("move",Pe.onDragMove),r.on("drop",Pe.onDragDrop),r.start(),r}static retriggerMove(){let e=Pe.currentDragOperation;e&&e.phase==="move"&&Pe.onDragMove(e)}static emit(e,...t){Pe.emitter.emit(e,...t)}static on(e,t){return Pe.emitter.on(e,t)}static registerDragInteractionTarget(e){if(Pe.dragInteractionTargetsMap.has(e.listId)){console.warn(`DragInteractionTarget with listId ${e.listId} already registered`);return}return Pe.dragInteractionTargetsMap.set(e.listId,e),Pe.emit("register",e),()=>{Pe.unregisterDragInteractionTarget(e)}}static unregisterAll(){Pe.dragInteractionTargetsMap.forEach(e=>{Pe.unregisterDragInteractionTarget(e)})}static unregisterDragInteractionTarget(e){if(e){if(!Pe.dragInteractionTargetsMap.has(e.listId)){console.warn(`DragInteractionTarget with listId ${e.listId} not found`);return}Pe.dragInteractionTargetsMap.delete(e.listId),e.unregister(),Pe.emit("unregister",e)}}static onDragStart(e){let{dragItem:t,dragIndex:n}=e.activeDragSource,r=e.activeDragSource.listId,a=Pe.dragInteractionTargetsMap.get(r)?.getData().acceptDropsFrom,s=!a||a.includes(r)?r:null;Pe.dragInteractionTargetsMap.forEach(u=>{let c=u.getData();u.start({dragIndex:c.listId===r?n:-1,dragItem:t,dragSourceListId:r,dropTargetListId:s})}),Pe.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=Pe.dragInteractionTargetsMap.get(r);l&&(a=l.acceptsSelfDrops(),a&&i.push(Pe.dragInteractionTargetsMap.get(r))),Pe.dragInteractionTargetsMap.forEach(s=>{s.listId!==r&&i.push(s)});for(let s of i){let u=op(e,s);if(u){t(s,u),i.splice(i.indexOf(s),1);break}}a||i.unshift(l);for(let s of i){let u=np(e,s);u&&t(s,u)}}static onDragMove(e){let{activeDragSource:t}=e,{listId:n,dragItem:r}=t,i=null,a=[];Pe.withDragMove(e,(u,{event:c})=>{u.move(c),a.push(c),c.outside||(i=c)});let l=i??a[0]??null,s=l?.dropTargetListId??null;Pe.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=[];Pe.withDragMove(e,(s,{event:u})=>{s.drop(u),a.push(u),u.outside||(i=u)});let l=i??a[0]??null;Pe.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}),Pe.currentDragOperation=null,Pe.unregisterAll()}};Pe.dragInteractionTargetsMap=new Map,Pe.currentDragOperation=null,Pe.emitter=new ln;var Tt=Pe,jn=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){St(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}},ls=class extends ln{constructor(t){super(t.listeners);this.phase="start";this.currentOffset={top:0,left:0};this.initialDragSource=jn.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=jn.shift(this.initialDragSource,n),this.currentOffset=n,this.emit("move",this)}};globalThis.DragManager=Tt;var rp=require("react"),ip=Ct.createContext({dragSourceListId:null,dropTargetListId:null,dragItemId:"",status:"accepted",updateDragOperationSourceAndTarget:o=>{},getCurrentDragSourceAndTarget:()=>({dragSourceListId:null,dropTargetListId:null,status:"accepted",dragItemId:""})}),po=()=>Ct.useContext(ip),Vi=o=>{let[e,t]=Ct.useState({dragSourceListId:null,dropTargetListId:null,dragItemId:"",status:"accepted"}),n=Ct.useRef(e);n.current=e;let r=Ct.useCallback(()=>{let a=n.current;return{dragSourceListId:a.dragSourceListId,dropTargetListId:a.dropTargetListId,dragItemId:a.dragItemId,status:a.status}},[]),i=Ct.useMemo(()=>({dragSourceListId:e.dragSourceListId,dropTargetListId:e.dropTargetListId,dragItemId:e.dragItemId,status:e.status,updateDragOperationSourceAndTarget:t,getCurrentDragSourceAndTarget:r}),[e,t]);return(0,rp.useEffect)(()=>{let a=Tt.on("drag-start",u=>{t({dragSourceListId:u.dragSourceListId,dropTargetListId:u.dropTargetListId,dragItemId:u.dragItem.id,status:"accepted"})}),l=Tt.on("drag-move",u=>{let c=n.current,d={dragSourceListId:u.dragSourceListId,dropTargetListId:u.dropTargetListId,dragItemId:u.dragItem.id,status:u.status};JSON.stringify(c)!==JSON.stringify(d)&&t(d)}),s=Tt.on("drag-drop",()=>{t({dragSourceListId:null,dropTargetListId:null,dragItemId:"",status:"accepted"})});return()=>{a(),l(),s()}},[Tt,t]),Ct.createElement(ip.Provider,{value:i},typeof o.children=="function"?o.children(i):o.children)};var ss=`${mt}Body`,ap=o=>o.querySelector(`.${ss}`);var sn=`${mt}HeaderCell`,us=`${mt}HeaderWrapper`,lp=o=>Array.from(o.querySelectorAll(`.${us}`));function Gi(o){if(!o)return!1;let e=o.tagName;return e==="INPUT"||e==="BUTTON"}var ES=Q(J.baseZIndexForCells),AS=(o,e)=>{let t=!o||Object.keys(o).length===0,n=!e||Object.keys(e).length===0;return t&&n?!0:!!o!=!!e?!1:St(o,e)},up=({columnId:o,domRef:e,horizontalLayoutPageIndex:t,allowColumnHideOnDrag:n})=>{let[r,i]=(0,$n.useState)(null),[a,l]=(0,$n.useState)(!1),{getCurrentDragSourceAndTarget:s}=po(),{getComputed:u,getState:c,api:d,computedDraggable:p,rootRef:f,actions:m}=ne(h=>({actions:h.actions,getComputed:h.getComputed,getState:h.getState,api:h.api,computedDraggable:h.computed.computedVisibleColumnsMap.get(o)?.computedDraggable,rootRef:h.state.domRef})),g=(0,$n.useCallback)(h=>{let b=u().computedVisibleColumnsMap.get(o);if(!b||!b.computedSortable)return;let{multiSortBehavior:S}=c();d.toggleSortingForColumn(o,{multiSortBehavior:S==="replace"&&(h.ctrlKey||h.metaKey)?"append":S})},[]),y=(0,$n.useCallback)(h=>{if(Gi(h.target))return;let{brain:b,draggableColumnsRestrictTo:S}=c(),{computedVisibleColumns:I,computedVisibleColumnsMap:T,computedPinnedStartColumns:C,computedUnpinnedColumns:R,computedPinnedEndColumns:v}=u(),P=T.get(o);if(!P.computedDraggable){g(h);return}let w=e.current,x=w.getBoundingClientRect(),E=f.current.getBoundingClientRect(),M=b.getAvailableSize(),D=P.computedVisibleIndex,A=b.getVirtualColIndex(P.computedVisibleIndex,{pageIndex:t||0}),O=b.isHorizontalLayoutBrain?b.getPageWidth():null,N=w.style.cursor??"auto",L=!1,F=f.current,G=ve.from(ap(F).getBoundingClientRect()),B=lp(F).map(ce=>ve.from(ce.getBoundingClientRect())),z=G.getMinimumBoundingRectangle(...B),U=ep({brain:b,horizontalLayoutPageIndex:t,allowColumnHideOnDrag:n,pageWidth:O,draggableColumnsRestrictTo:S,computedPinnedEndColumns:v,computedPinnedStartColumns:C,computedUnpinnedColumns:R,computedVisibleColumns:I,computedVisibleColumnsMap:T,dragColumnHeaderTargetRect:x,dragColumnId:o,getCurrentDragSourceAndTarget:s,api:d,infiniteDOMNode:f.current,setProxyPosition:i,setDragColumnOutside:l,tableRect:E,acceptDropToReorderRect:z,initialMousePosition:{clientX:h.clientX,clientY:h.clientY}}),K=null,q,re;function se(ce){let{columnPinning:le,columnOrder:X}=ce;AS(c().columnPinning,le)||(m.columnPinning=le);let k=u().computedColumnOrder;JSON.stringify(X,k)&&(m.columnOrder=as({newColumnOrder:X,visibleColumnOrder:u().computedVisibleColumns.map(Z=>Z.id),existingColumnOrder:k,dragColumnId:o}))}let de=ce=>{let{headerBrain:le,brain:X}=c();if(!L){L=!0;let k=X.keepColumnRendered(A),Z=le.keepColumnRendered(A);if(X.isHorizontalLayoutBrain){let $=X.extendRenderRange({start:!0,end:!0,direction:"horizontal"}),ie=le.extendRenderRange({start:!0,end:!0,direction:"horizontal"});re=()=>{$(),ie()}}q=()=>{k(),Z()},m.columnReorderDragColumnId=P.id,t!=null&&(m.columnReorderInPageIndex=t),os(D,`calc( var(${ES}) + 10000 )`,f.current),f.current?.classList.add(rs),w.style.cursor="grabbing"}K=U.onMove(ce)},ae=ce=>{let le=ce.pointerId;requestAnimationFrame(()=>{let{multiSortBehavior:X}=c(),k=f.current;k?.classList.remove(rs),U.stop(),b.update({...M}),q?.(),re?.(),w.style.cursor=N,w.hasPointerCapture?.(le)&&w.releasePointerCapture(le),w.removeEventListener("pointermove",de),w.removeEventListener("pointerup",ae),i(null);let Z=d.getColumnApi(P.id)?.isSortable()??!1;!L&&Z&&d.toggleSortingForColumn(P.id,{multiSortBehavior:X==="replace"&&(ce.ctrlKey||ce.metaKey)?"append":X}),(0,sp.flushSync)(()=>{K?se(K):L&&n&&d.setVisibilityForColumn(P.id,!1),m.columnReorderDragColumnId=!1,t!=null&&(m.columnReorderInPageIndex=null)}),I.forEach(Y=>{Li(Y.computedVisibleIndex,k),_r(Y.computedVisibleIndex,"",k),Ar(Y.computedVisibleIndex,"",k)}),os(D,ki(P,{pinnedStartColsCount:C.length,visibleColsCount:I.length}),k)})};w.addEventListener("pointermove",de),w.addEventListener("pointerup",ae),w.setPointerCapture(h.pointerId)},[o,t]);return{onPointerDown:p?y:g,dragColumnOutside:a,proxyPosition:r}};var Yn=j(require("react"));var Te=j(require("react")),Ke=require("react");var cp="_1eexc2a7 _1eexc2a6",dp=ye({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"]]}),pp=ye({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 fp="_1eexc2a5",Hi=ye({defaultClassName:"_1eexc2aa",variantClassNames:{direction:{up:"_1eexc2ab",down:"_1eexc2ac",neutral:"_1eexc2ad"}},defaultVariants:{},compoundVariants:[]}),Ki="_1eexc2a8";var Bi=j(require("react")),Wi=require("react");var mp="qz8ht90 _16lm1iwk";function _S(){return{checked:1,disabled:o=>o??!1,domProps:1}}var{ManagedComponentContextProvider:OS}=Ft({forwardProps:_S,mappedCallbacks:{checked:o=>({callbackName:"onChange",callbackParams:[o]})},debugName:"InfiniteCheckBox"});function NS(){let{componentState:o,componentActions:e}=Lt(),{checked:t,domProps:n,disabled:r}=o,i=(0,Wi.useRef)(null);return(0,Wi.useEffect)(()=>{i.current.indeterminate=t==null},[t]),Bi.createElement("input",{...n,className:te("InfiniteCheckBox",mp,n?.className),type:"checkbox",ref:i,checked:!!t,disabled:r,onChange:()=>{r||(e.checked=!t)}})}function fo(o){return Bi.createElement(OS,{...o},Bi.createElement(NS,null))}var Fr=j(require("react")),bp=require("react");var gp="_96uiwi0 _16lm1iw1d _16lm1iwk _16lm1iw9",hp=ye({defaultClassName:"_96uiwi1",variantClassNames:{expanded:{true:"_16lm1iwi",false:"_96uiwi3"},direction:{end:"_96uiwi4",start:"_96uiwi5"},disabled:{true:"_96uiwi6",false:"_96uiwi7"}},defaultVariants:{},compoundVariants:[[{expanded:!1,direction:"end"},"_16lm1iwj"]]});var yp="M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z",LM=Object.keys({size:1,expanded:1,defaultExpanded:1,onChange:1,style:1,disabled:1,className:1,direction:1});var ji=`${Dt}-expand-collapse`;function un(o){let{size:e=24,direction:t="start",disabled:n=!1}=o,[r,i]=(0,bp.useState)(o.expanded??o.defaultExpanded),a=()=>{o.onChange?.(!r),Oo("expanded",o)||i(!r)};Fr.useEffect(()=>{Oo("expanded",o)&&i(o.expanded)},[o.expanded]);let l=r?"expanded":"collapsed";return Fr.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:te(o.className,gp,hp({direction:t||"start",expanded:r,disabled:n}),`${Dt}`,`${ji}`,`${ji}--${l}`,`${ji}--${t==="end"?"end":"start"}`,n?`${ji}--disabled`:"")},Fr.createElement("path",{d:yp}))}function FS(o){return typeof o.field=="string"}function Sp(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 xt(o){let{getComputed:e,getDataSourceState:t,getState:n,rowIndex:r,columnId:i,api:a,dataSourceApi:l}=o,{dataArray:s}=t(),u=s[r],{isGroupRow:c,isTreeNode:d}=u,p=e().computedColumnsMap.get(i),{activeRowIndex:f,keyboardNavigation:m,isRowDetailEnabled:g}=n(),y=r===f&&m==="row",h=!g||typeof g=="function"&&!g(u)?!1:a.rowDetailApi.isRowDetailExpanded(u.id)?"expanded":"collapsed",{formattedValue:b,formattedValueContext:{rawValue:S}}=Un({column:p,rowInfo:u,rowDetailState:h,columnsMap:e().computedColumnsMap,context:o}),I=gt(p.id,o);return c?{api:a,dataSourceApi:l,column:p,columnApi:I,isParentNode:!1,isGroupRow:!0,isTreeNode:!1,nodeExpanded:!1,rowDetailState:!1,data:u.data,rowActive:y,rowInfo:u,rowSelected:u.rowSelected,value:b,rawValue:S}:d?u.isParentNode?{api:a,dataSourceApi:l,columnApi:I,column:p,nodeExpanded:u.nodeExpanded,isTreeNode:!0,isGroupRow:!1,isParentNode:!0,rowDetailState:h,data:u.data,rowActive:y,rowInfo:u,rowSelected:u.rowSelected,value:b,rawValue:S}:{api:a,dataSourceApi:l,columnApi:I,column:p,nodeExpanded:!1,isTreeNode:!0,isGroupRow:!1,isParentNode:!1,rowDetailState:h,data:u.data,rowActive:y,rowInfo:u,rowSelected:u.rowSelected,value:b,rawValue:S}:{api:a,dataSourceApi:l,columnApi:I,column:p,isTreeNode:!1,isParentNode:!1,isGroupRow:!1,nodeExpanded:!1,rowDetailState:h,data:u.data,rowActive:y,rowInfo:u,rowSelected:u.rowSelected,value:b,rawValue:S}}function Tp(o){return Ip(o.column,o.rowInfo)}function Cp(o){let{column:e,context:t,rowInfo:n,visibleColumnIds:r}=o,i=Sp({rowInfo:n,column:e,fieldsToColumn:o.fieldsToColumn,groupRenderStrategy:t.getState().groupRenderStrategy}),{getState:a}=t,{editingCell:l}=a(),s=Un(o),{formattedValueContext:u}=s,c=t.api.isEditorVisibleForCell({columnId:e.id,rowIndex:n.indexInAll}),d=Object.assign({rowIndexInHorizontalLayoutPage:o.rowIndexInHorizontalLayoutPage,horizontalLayoutPageIndex:o.horizontalLayoutPageIndex,column:o.column,inEdit:c,rowHasSelectedCells:!1},u,{editError:l&&l.primaryKey===n.id&&l.columnId===e.id&&!l.active&&l.accepted instanceof Error?l.accepted:void 0});Object.defineProperty(d,"rowHasSelectedCells",{get(){return n.hasSelectedCells(r)}});let p=typeof e.align=="function"?e.align({isHeader:!1,...d}):e.align??"start",f=typeof e.verticalAlign=="function"?e.verticalAlign({isHeader:!1,...d}):e.verticalAlign??"center";return{inEdit:c,stylingParam:d,formattedValueContext:u,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:LS({rowIndexInHorizontalLayoutPage:o.rowIndexInHorizontalLayoutPage,horizontalLayoutPageIndex:o.horizontalLayoutPageIndex,column:o.column,rowInfo:o.rowInfo,visibleColumnIds:o.visibleColumnIds,columnsMap:o.columnsMap,fieldsToColumn:o.fieldsToColumn,context:o.context,align:p,verticalAlign:f,formattedValueContext:u}),groupByColumnReference:i}}function LS(o){let{column:e,context:t,rowInfo:n,align:r,verticalAlign:i,visibleColumnIds:a,columnsMap:l,fieldsToColumn:s,formattedValueContext:u}=o,{value:c}=u,{api:d,getDataSourceState:p,getState:f,dataSourceApi:m}=t,{editingCell:g}=f(),{indexInAll:y}=n,h=p(),{selectionMode:b,cellSelection:S}=h,I=Sp({rowInfo:n,column:e,fieldsToColumn:s,groupRenderStrategy:t.getState().groupRenderStrategy}),T=d.toggleGroupRow,C=S?.isCellSelected(n.id,e.id)??!1,R={column:e,columnsMap:l,fieldsToColumn:s,align:r,verticalAlign:i,cellSelected:C,rowHasSelectedCells:!1,horizontalLayoutPageIndex:o.horizontalLayoutPageIndex,rowIndexInHorizontalLayoutPage:o.rowIndexInHorizontalLayoutPage,...u,editError:g&&g.primaryKey===n.id&&g.columnId===e.id&&!g.active&&g.accepted instanceof Error?g.accepted:void 0,groupByColumn:I,selectionMode:b,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 c=="boolean"?`${c}`:c,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:y,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(R,"rowHasSelectedCells",{get(){return n.hasSelectedCells(a)}}),R}function Ip(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:FS(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 kS(o,e,t,n,r){let{rowSelected:i,indexInAll:a}=t,{activeRowIndex:l,keyboardNavigation:s}=n.getState(),u=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:u,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:u,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:u,value:o,rawValue:o,field:e.field}:{rowInfo:t,isGroupRow:!1,isTreeNode:!1,isParentNode:!1,nodeExpanded:!1,data:t.data,rowDetailState:r,rowSelected:i,rowActive:u,value:o,rawValue:o,field:e.field}}function Un(o){let{column:e,rowInfo:t,context:n,rowDetailState:r}=o,i=Ip(e,t),a=kS(i,e,t,n,r),l=e.valueFormatter?e.valueFormatter(a):i;return a.value=l,{formattedValue:l,formattedValueContext:a}}var Rp=ye({defaultClassName:"_7pupv01",variantClassNames:{align:{start:"_7pupv02",center:"_7pupv03",end:"_7pupv04"}},defaultVariants:{},compoundVariants:[]}),wp="_7pupv00",vp=ye({defaultClassName:"_7pupv05",variantClassNames:{align:{start:"_7pupv06",center:"_7pupv07",end:"_7pupv08"}},defaultVariants:{},compoundVariants:[]});var{rootClassName:Pp}=Le,mo=`${Pp}Cell`,Lr=`${Pp}Cell_content`;var{rootClassName:zS}=Le,Qt=`${zS}ColumnCell`;var VS=Q(J.columnZIndexAtIndex),GS=Q(J.columnVisibilityAtIndex);function Dp({rowInfo:o}){return{[Q(ge.components.Row.groupNesting)]:o.dataSourceHasGrouping?o.isGroupRow?o.groupNesting-1:o.groupNesting:0}}function xp({rowInfo:o}){return{[Q(ge.components.Row.groupNesting)]:o.isTreeNode?o.isParentNode?o.treeNesting:o.treeNesting+1:0}}function cs(o,e){return o?typeof o=="function"?o(e):o:void 0}function ds(o,e,t){return typeof e=="function"?{...o,...e(t)}:{...o,...e}}function Mp(o){let{column:e,rowInfo:t,rowIndex:n,rowHeight:r,rowIndexInHorizontalLayoutPage:i,horizontalLayoutPageIndex:a,align:l,verticalAlign:s,stylingParam:u,formattedValueContext:c,groupByColumnReference:d,rowStyle:p,rowClassName:f,cellStyle:m,cellClassName:g,showZebraRows:y,rowActive:h,rowDisabled:b,rowSelected:S,cellSelected:I,cellSelection:T,getData:C,computedVisibleColumns:R,visibleColumnIds:v,computedColumnOrder:P,columnReorderInPageIndex:w}=o,x=v??R.map(de=>de.id),E=P,M,D={...c,visibleColumnIds:x,allColumnIds:E,rowIndex:n,get rowHasSelectedCells(){return M===void 0&&(M=t.hasSelectedCells(x)),M}},A=!!(t.isTreeNode&&(e.renderTreeIcon||e.renderTreeIconForLeafNode||e.renderTreeIconForParentNode)),O=typeof f=="function"?f(D):f,N;d?.className&&(N=cs(d.className,u)),g&&(N=te(N,cs(g,u))),e.className&&(N=te(N,cs(e.className,u))),A&&(N=te(N,vp({align:l})));let L;t.dataSourceHasGrouping&&e.groupByForColumn&&(L=Dp({rowInfo:t})),A&&(L=xp({rowInfo:t})),p&&(L=typeof p=="function"?{...L,...p(D)}:{...L,...p}),m&&(L=ds(L,m,u)),d?.style&&(L=ds(L,d.style,u)),e.style&&(L=ds(L,e.style,u)),L=L||{},L.height=r,L.zIndex=`var(${VS}-${e.computedVisibleIndex})`,L.visibility=`var(${GS}-${e.computedVisibleIndex}, visible)`;let F=i!=null?i%2===1:(t.indexInAll!=null?t.indexInAll:n)%2===1,G=y?F?"odd":"even":!1,B=!1,z=!1,U=!1,K=!1;if(T&&I){let de=C(),ae=de[t.indexInAll-1],ce=de[t.indexInAll+1],le=R[e.computedVisibleIndex+1],X=R[e.computedVisibleIndex-1];B=ae?!T.isCellSelected(ae.id,e.id):!0,e.computedPinned==="end"&&e.computedFirstInCategory?z=!0:z=X?!T.isCellSelected(t.id,X.id):!0,e.computedPinned==="start"&&e.computedLastInCategory?U=!0:U=le?!T.isCellSelected(t.id,le.id):!0,K=ce?!T.isCellSelected(ce.id,e.id):!0}let q=T&&I?{top:B,left:z,right:U,bottom:K}:null,re=w!=null?a!==w:!1,se=te(q?pp(q):"",Fi(e,[Qt,mo],dp,{dragging:!1,insideDisabledDraggingPage:re,zebra:G,align:l,verticalAlign:s,rowDisabled:b,rowActive:h,cellSelected:I,rowSelected:S,treeNode:t.isTreeNode?t.isParentNode?"parent":"leaf":!1,firstRow:t.indexInAll===0,firstRowInHorizontalLayoutPage:i===0,groupRow:t.isGroupRow,groupCell:t.isGroupRow?!!e.groupByForColumn:!1,rowExpanded:t.isGroupRow?!t.collapsed:!1}),N,O);return{style:L,className:se,cellSelectionBorders:q,zebra:G,columnIsTree:A}}var go=j(require("react"));var HS=Q(J.columnWidthAtIndex),KS=Q(J.columnReorderEffectDurationAtIndex);function BS(o){let{cssEllipsis:e=!0,virtualized:t=!0,skipColumnShifting:n=!1,contentStyle:r,column:i,domRef:a,width:l,contentClassName:s,rowId:u,afterChildren:c,beforeChildren:d,cellType:p,cssPosition:f,renderChildren:m,horizontalLayoutPageIndex:g,...y}=o,h=typeof m=="function"?m():m,b={width:`var(${HS}-${i.computedVisibleIndex})`,transition:`transform var(${KS}-${i.computedVisibleIndex}, 0s)`,...y.style},S={...y,style:b,"data-column-id":i.id,"data-z-index":b.zIndex,className:te(y.className,mo,cp),children:go.createElement(go.Fragment,null,d,go.createElement("div",{className:te(Lr,e?Yt:Ic.hidden,s),style:r},h),c)};u!=null&&(S["data-row-id"]=`${u}`);let I=p==="body"?i.components?.ColumnCell:i.components?.HeaderCell;return I?go.createElement(I,{...S,ref:a}):go.createElement("div",{...S,ref:a})}var $i=go.memo(BS);var dn=j(require("react")),cn=require("react");function Ep(){let{initialValue:o,setValue:e,confirmEdit:t,cancelEdit:n,readOnly:r}=Ui(),i=(0,cn.useRef)(null),a=(0,cn.useRef)(!1),l=dn.useCallback(c=>{i.current=c,c&&c.focus()},[]),s=(0,cn.useCallback)(c=>{let{key:d}=c;d==="Enter"||d==="Tab"?t():d==="Escape"?(a.current=!0,n()):c.stopPropagation()},[]),u=(0,cn.useCallback)(()=>{a.current||t()},[]);return dn.createElement(dn.Fragment,null,dn.createElement("input",{readOnly:r,ref:l,onKeyDown:s,onBlur:u,className:te(gc,Cc.none),type:"text",defaultValue:o,onChange:(0,cn.useCallback)(c=>{e(c.target.value)},[])}))}function Ap(o,e){let t=[];for(let n in o)o.hasOwnProperty(n)&&!e.hasOwnProperty(n)&&t.push(o[n]);return t}var kr=Te.createContext(null),WS=o=>{let{toggleCurrentRowDetails:e,rowDetailState:t}=o;return Te.createElement(un,{style:{visibility:t===!1?"hidden":"visible"},expanded:t==="expanded",onChange:e})},jS={display:"inline-block",visibility:"visible"},ps=o=>{let{rowInfo:e,toggleCurrentTreeNode:t,nodeExpanded:n,api:r}=o,i=r.getDataSourceState().isNodeReadOnly;return Te.createElement(un,{disabled:e.isTreeNode&&e.isParentNode?i(e):!1,style:jS,expanded:n,onChange:t})},$S=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(),u=l.getDataSourceState().isNodeSelectable,c=s?.CheckBox||fo;return Te.createElement(c,{domProps:{className:Ki},disabled:e.isTreeNode?!u(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 US(o){let{dataSourceStatePartialForCell:e,rowInfoStore:t,rowStyle:n,rowClassName:r,rowIndexInHorizontalLayoutPage:i,horizontalLayoutPageIndex:a,getData:l,visibleColumnIds:s,computedColumnOrder:u,cellStyle:c,cellClassName:d,rowDetailState:p,width:f,column:m,onMouseLeave:g,onMouseEnter:y,onRowMouseEnter:h,onRowMouseLeave:b,rowIndex:S,rowHeight:I,columnsMap:T,fieldsToColumn:C,domRef:R,hidden:v,showZebraRows:P,getDataSourceState:w,dataSourceApi:x,dataSourceActions:E,getState:M,imperativeApi:D,componentActions:A,getComputed:O,getDataSourceMasterContext:N}=o,L=(0,Ke.useSyncExternalStore)((0,Ke.useCallback)(_e=>t.subscribeToRowIndex(S,_e),[t,S]),(0,Ke.useCallback)(()=>t.getRowInfoAtIndex(S),[t,S])),F=!L,G=!m,B=Te.useRef(null),z=(0,Ke.useCallback)(_e=>{B.current=_e,R&&R(_e)},[R]),U=L??{id:"",indexInAll:S,rowSelected:!1,rowDisabled:!1,isCellSelected:()=>!1,hasSelectedCells:()=>!1,isGroupRow:!1,isTreeNode:!1,isParentNode:!1,treeNesting:0,nodePath:[],collapsed:!1,dataSourceHasGrouping:!1,selfLoaded:!0,data:{}},{rowSelected:K}=U,q=O(),{activeRowIndex:re,keyboardNavigation:se,columnReorderInPageIndex:de}=M(),ae=S===re&&se==="row",ce={getState:M,getDataSourceState:w,getDataSourceMasterContext:N,actions:A,dataSourceActions:E,api:D,dataSourceApi:x},le=U.rowDisabled,X=Cp({horizontalLayoutPageIndex:a,rowIndexInHorizontalLayoutPage:i,column:m,rowInfo:U,rowDetailState:p,columnsMap:T,visibleColumnIds:s,fieldsToColumn:C,context:ce}),{stylingParam:k,renderParams:Z,formattedValueContext:Y,renderFunctions:$,groupByColumnReference:ie,inEdit:fe}=X,{align:pe,verticalAlign:H}=Z,_=Z,ue=Te.useRef(_),Se=h&&y?_e=>{let je={...Y,rowIndex:S};h(je,_e),y(_e)}:y,Re=b&&g?_e=>{let me={...Y,rowIndex:S,rowInfo:U};b(me,_e),g(_e)}:g,Ce=(0,Ke.useCallback)(_e=>{let me=m.computedVisibleIndex;M().cellClick({rowIndex:S,colIndex:me,event:_e})},[S,m.computedVisibleIndex,se]),Fe=(0,Ke.useCallback)(_e=>{let me=m.computedVisibleIndex;if(M().cellMouseDown({rowIndex:S,colIndex:me,event:_e}),se==="row"){le||(A.activeRowIndex=S);return}se==="cell"&&(A.activeCellIndex=[S,me])},[S,le,m.computedVisibleIndex,se]),{selectionMode:Oe,cellSelection:Ye,isNodeReadOnly:nt}=e,We=_.cellSelected;_.domRef=z,_.htmlElementRef=B,_.toggleCurrentTreeNode=(0,Ke.useCallback)(_.toggleCurrentTreeNode,[U]),_.selectCell=(0,Ke.useCallback)(_.selectCell,[U]),_.deselectCell=(0,Ke.useCallback)(_.deselectCell,[U]),_.selectCurrentRow=(0,Ke.useCallback)(_.selectCurrentRow,[U]),_.deselectCurrentRow=(0,Ke.useCallback)(_.deselectCurrentRow,[U]),_.toggleCurrentGroupRow=(0,Ke.useCallback)(_.toggleCurrentGroupRow,[U]),_.toggleCurrentRowSelection=(0,Ke.useCallback)(_.toggleCurrentRowSelection,[U]),_.toggleCurrentGroupRowSelection=(0,Ke.useCallback)(_.toggleCurrentGroupRowSelection,[U]),_.toggleCurrentTreeNodeSelection=(0,Ke.useCallback)(_.toggleCurrentTreeNodeSelection,[U]);let rt=m.components?.Editor??Ep,pt=fe?Te.createElement(Op,{contextValue:_},Te.createElement(rt,null)):null,Ge=(0,Ke.useCallback)(ft(()=>{if(v||fe)return null;if(ue.current=_,$.renderGroupIcon&&(_.renderBag.groupIcon=Te.createElement(It,{render:$.renderGroupIcon,renderParam:{..._,renderBag:{..._.renderBag}}})),$.renderSelectionCheckBox&&Oe=="multi-row"&&(_.renderBag.selectionCheckBox=Te.createElement(It,{render:$S,renderParam:_}),$.renderSelectionCheckBox!==!0&&(_.renderBag.selectionCheckBox=Te.createElement(It,{render:$.renderSelectionCheckBox,renderParam:{..._,renderBag:{..._.renderBag}}}))),U.isTreeNode){let{isParentNode:je}=U,it;it=(je?$.renderTreeIconForParentNode:$.renderTreeIconForLeafNode)||typeof $.renderTreeIcon=="function"?$.renderTreeIcon:je&&$.renderTreeIcon===!0?ps:void 0,it===!0?it=ps:it&&(_.renderBag.treeIcon=Te.createElement(It,{render:ps,renderParam:_})),it&&(_.renderBag.treeIcon=Te.createElement(It,{render:it,renderParam:{..._,renderBag:{..._.renderBag}}}))}$.renderRowDetailIcon&&(_.renderBag.rowDetailsIcon=Te.createElement(It,{render:WS,renderParam:{..._,renderBag:{..._.renderBag}}}),typeof $.renderRowDetailIcon=="function"&&(_.renderBag.rowDetailsIcon=Te.createElement(It,{render:$.renderRowDetailIcon,renderParam:{..._,renderBag:{..._.renderBag}}}))),$.renderValue&&(_.renderBag.value=Te.createElement(It,{render:$.renderValue,renderParam:{..._,renderBag:{..._.renderBag}}})),U.isGroupRow&&$.renderGroupValue&&(_.renderBag.value=Te.createElement(It,{render:$.renderGroupValue,renderParam:{..._,renderBag:{..._.renderBag}}})),!U.isGroupRow&&$.renderLeafValue&&(_.renderBag.value=Te.createElement(It,{render:$.renderLeafValue,renderParam:{..._,renderBag:{..._.renderBag}}})),ue.current=_;let _e=_.renderBag.value;_e instanceof Date&&(_e=_e.toLocaleDateString());let me=Te.createElement(Te.Fragment,null,pe!=="end"?_.renderBag.treeIcon:null,pe!=="end"?_.renderBag.groupIcon:null,pe!=="end"?_.renderBag.rowDetailsIcon:null,pe!=="end"?_.renderBag.selectionCheckBox:null,_e,pe==="end"?_.renderBag.selectionCheckBox:null,pe==="end"?_.renderBag.rowDetailsIcon:null,pe==="end"?_.renderBag.groupIcon:null,pe==="end"?_.renderBag.treeIcon:null);return m.render?Te.createElement(It,{render:m.render,renderParam:{..._,renderBag:{..._.renderBag,all:me}}}):me}),[m,v,fe,p,m.renderTreeIcon||m.renderTreeIconForParentNode?nt:!1,...Ap(_,{renderBag:!0,selectCell:!0,deselectCell:!0,selectCurrentRow:!0,deselectCurrentRow:!0,toggleCurrentGroupRow:!0,toggleCurrentRowDetails:!0,toggleCurrentRowSelection:!0,toggleCurrentGroupRowSelection:!0,toggleCurrentTreeNodeSelection:!0,toggleCurrentTreeNode:!0,rowHasSelectedCells:!0})]),{style:W,className:oe}=Mp({column:m,rowInfo:U,rowIndex:S,rowHeight:I,rowIndexInHorizontalLayoutPage:i,horizontalLayoutPageIndex:a,align:pe,verticalAlign:H,stylingParam:k,formattedValueContext:Y,groupByColumnReference:ie,rowStyle:n,rowClassName:r,cellStyle:c,cellClassName:d,showZebraRows:P,rowActive:ae,rowDisabled:le,rowSelected:K,cellSelected:We,cellSelection:Ye,getData:l,visibleColumnIds:s,computedVisibleColumns:q.computedVisibleColumns,computedColumnOrder:u,columnReorderInPageIndex:de}),he=(0,Ke.useMemo)(()=>W,[W?JSON.stringify(W):null]),Ie=pt,Je=Ge(),V={domRef:z,cellType:"body",column:m,width:f,rowId:U.id,horizontalLayoutPageIndex:a,style:he,onMouseLeave:Re,onMouseEnter:Se,onClick:Ce,afterChildren:Ie,onMouseDown:Fe,cssEllipsis:m.cssEllipsis??!0,className:oe,renderChildren:(0,Ke.useCallback)(()=>Je,[Ge])},Ze=kr.Provider;return G||F?Te.createElement("div",{ref:z,style:{display:"none"}}):Te.createElement(Ze,{value:ue.current},Te.createElement($i,{...V}))}var _p=Te.memo(US);function zr(){return(0,Ke.useContext)(kr)}function Ui(){let{api:o,editingValueRef:e,editingCell:t}=ne(f=>({api:f.api,editingCell:f.state.editingCell,editingValueRef:f.state.editingValueRef})),{column:n,rowInfo:r}=zr(),[i]=Te.useState(()=>t?.value),[a,l]=Te.useState(i),s=t?!t.active&&!!t.waiting:!1,u=Te.useCallback(f=>{e.current=f,l(f)},[]);Te.useLayoutEffect(()=>{e.current=i},[]);let c=o.confirmEdit,d=o.cancelEdit,p=o.rejectEdit;return{api:o,initialValue:i,value:a,readOnly:s,column:n,rowInfo:r,setValue:u,confirmEdit:c,cancelEdit:d,rejectEdit:p}}function Vr(o){return o.render(o.renderParam)??null}function It(o){let e=kr.Provider;return Yn.createElement(e,{value:o.renderParam},Yn.createElement(Vr,{render:o.render,renderParam:o.renderParam}))}function Op(o){let e=kr.Provider;return Yn.createElement(e,{value:o.contextValue},o.children)}function zo(o){let e=Yi.Provider;return Yn.createElement(e,{value:o.renderParam},Yn.createElement(Vr,{render:o.render,renderParam:o.renderParam}))}var Vo=j(require("react"));var Gr=Pi({"data-name":""}),Hr={[Gr["data-name"]]:"menu-icon"},BE=`[${Gr["data-name"]}="${Hr["data-name"]}"]`;var YS={width:"100%",pointerEvents:"none"},fs=`${Dt}-menu`;function Kr(o){let{style:e,className:t,domProps:n,reserveSpaceWhenHidden:r,menuVisible:i,children:a}=o,l={...YS,borderTop:`${ge.components.HeaderCell.menuIconLineWidth} solid currentColor`,...o.lineStyle};return Vo.createElement("div",{...n,style:e,...Hr,onPointerDown:s=>s.stopPropagation(),className:te(t,Jc({menuVisible:i,reserveSpaceWhenHidden:r}),Dt,`${Dt}-menu`)},a??Vo.createElement(Vo.Fragment,null,Vo.createElement("div",{className:fs,style:l}),Vo.createElement("div",{className:fs,style:l}),Vo.createElement("div",{className:fs,style:l})))}var qn=j(require("react")),Br=require("react");var Np="_1b8djff0 _16lm1iw1p _16lm1iw2f _16lm1iw1 _16lm1iw32";var Fp={transition:"width 0.25s, opacity 0.25s"},oA=Object.keys({direction:1,size:1,lineWidth:1,lineStyle:1,style:1,className:1,index:1,forceSize:1});function qi(o){let[e,t]=(0,Br.useState)(!0),[n,r]=(0,Br.useState)(0),{direction:i,lineWidth:a=1,style:l,className:s,index:u}=o,c=u!=null&&u>0,d=o.size??16,p=Math.floor(d/4),f=i?[d-3*p,d-2*p,d-p]:[0,0,0];i===-1&&f.reverse();let m={...Fp,borderTop:`${a}px solid currentColor`,...o.lineStyle,opacity:n};(0,Br.useEffect)(()=>{let h=i!=0?1:0;if(!e&&h&&t(!0),h!==n){let b=requestAnimationFrame(()=>{r(h)});return()=>{cancelAnimationFrame(b)}}return()=>{}},[i,e]);let g=()=>{let b=!(n===0&&i===0);b!==e&&t(b)};if(!e&&!o.forceSize)return null;let y={};return i===-1&&(y.top="100%"),qn.createElement("div",{"data-name":"sort-icon",style:{...l,width:d},className:te(s,Dt,Np,`${Dt}-sort`)},c?qn.createElement("div",{"data-name":"index",style:y,className:od},u):null,qn.createElement("div",{style:{width:f[0],...m},onTransitionEnd:g}),qn.createElement("div",{style:{width:f[1],...m}}),qn.createElement("div",{style:{width:f[2],...m}}))}var Gp=j(require("react")),ms=require("react");function Lp(o){let{context:e,column:t,diff:n,shareSpaceOnResize:r}=o,i=e.getState(),{columnSizing:a,viewportReservedWidth:l,bodySize:s}=i,u=e.getComputed().computedVisibleColumns,c=!1,d=u.reduce((f,m)=>(m.computedFlex&&(f[m.id]={...a[m.id],flex:m.computedWidth},c=!0),f),{}),p=c?{...a,...d}:a;return $l({shareSpaceOnResize:r,availableSize:s.width,reservedWidth:l||0,dragHandleOffset:n,dragHandlePositionAfter:t.computedVisibleIndex,columnSizing:p,items:u.map(f=>({id:f.id,computedFlex:f.computedFlex,computedWidth:f.computedWidth,computedMinWidth:f.computedMinWidth,computedMaxWidth:f.computedMaxWidth}))})}var Wr=require("react"),jr=j(require("react"));function kp(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"?ts(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 u=e[l];if(u.computedPinned==="start"){ts(u,i,n.current);continue}u.computedPinned!=="end"&&we.columnOffsets.set(l,u.computedOffset+i,n.current)}return}for(let l=a,s=e.length;l<s;l++){let u=e[l];u.computedPinned||we.columnOffsets.set(l,u.computedOffset+i,n.current)}}}}}function zp(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,u=i.current;if(n.forEach((c,d)=>{s+=c;let p=o[d],f=r[p],m=f.computedWidth+c;we.columnWidths.set(p,m,u),f.computedPinned!=="end"&&(l&&we.columnOffsets.set(p,l,u),l+=m)}),a.computedPinned!=="end")for(let c=t+1;c<r.length;c++){let d=r[c];d.computedPinned!=="end"&&we.columnOffsets.set(c,d.computedOffset+s,u)}}}}var Xi="zneyzh0 _16lm1iw2 _16lm1iw23 _16lm1iw2c _16lm1iw2a _16lm1iwm _16lm1iw35",Zi=ye({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"]]}),Qi=ye({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:qS}=Le,XS=`${qS}HeaderCell_ResizeHandle`;function ZS(o){let{brain:e,headerBrain:t}=ne(g=>({brain:g.state.brain,headerBrain:g.state.headerBrain})),n=(0,Wr.useRef)(null),[r,i]=(0,Wr.useState)(!1),a=(0,Wr.useRef)(r);a.current=r;let l=o.columns[o.columnIndex],s=o.horizontalLayoutPageIndex;if(!l)return null;let u=l.computedPinned,c=l.computedFirstInCategory,d=l.computedLastInCategory,p=()=>{},f=g=>{g.stopPropagation();let y=!!g.shiftKey,h=g.pointerId,b=g.clientX,S=g.target;if(e.isHorizontalLayoutBrain){let v=e.extendRenderRange({start:!0,end:!0,direction:"horizontal"}),P=t.extendRenderRange({start:!0,end:!0,direction:"horizontal"});p=()=>{v(),P()}}S.setPointerCapture(h);let I=kp(o.columnIndex,{columns:o.columns,shareSpaceOnResize:y,domRef:n}),T=(v,{done:P}={})=>{s&&(v=v/(s+1),P&&(v=Math.round(v))),u==="end"&&(v*=-1);let{adjustedDiff:w,constrained:x}=o.computeResize({diff:v,shareSpaceOnResize:y});return a.current!==x&&i(x),I.resize(w),w},C=v=>{T(Math.round(v.clientX-b))},R=v=>{S.releasePointerCapture(h),S.removeEventListener("pointermove",C),S.removeEventListener("pointerup",R);let P=Math.round(v.clientX-b),w=T(P,{done:!0});p(),o.onResize({diff:w,shareSpaceOnResize:y})};S.addEventListener("pointermove",C),S.addEventListener("pointerup",R)},m=(u===!1||u==="start")&&d?{right:u==="start"?void 0:0}:u==="end"&&c?{right:void 0}:void 0;return jr.createElement("div",{ref:n,className:`${XS} ${Xi} ${Qi({computedPinned:u,computedFirstInCategory:c,computedLastInCategory:d})}`,onPointerDown:f},jr.createElement("div",{style:m,className:Zi({constrained:r,computedPinned:u,computedFirstInCategory:c,computedLastInCategory:d})}))}var Vp=jr.memo(ZS);function Hp(o,e){let{computedVisibleColumns:t,getState:n,getComputed:r,actions:i}=ne(u=>({computedVisibleColumns:u.computed.computedVisibleColumns,getState:u.getState,getComputed:u.getComputed,actions:u.actions})),a=(0,ms.useCallback)(({diff:u,shareSpaceOnResize:c})=>Lp({context:{getState:n,getComputed:r},column:o,diff:u,shareSpaceOnResize:c}),[o,n,r]),l=(0,ms.useCallback)(({diff:u,shareSpaceOnResize:c})=>{let{columnSizing:d,reservedWidth:p}=a({diff:u,shareSpaceOnResize:c});c||(i.viewportReservedWidth=p),i.columnSizing=d},[a,i]);return o.computedResizable?Gp.createElement(Vp,{horizontalLayoutPageIndex:e.horizontalLayoutPageIndex,columns:t,columnIndex:o.computedVisibleIndex,computeResize:a,onResize:l}):null}var Xe=j(require("react"));var Jt=require("react");var Kp=ye({defaultClassName:"_16lm1iw3a _16lm1iw1",variantClassNames:{dragging:{true:"_16lm1iwn _16lm1iw1x"}},defaultVariants:{},compoundVariants:[]}),Bp=ye({defaultClassName:"_16lm1iw3a _16lm1iw1 _16lm1iwo",variantClassNames:{active:{true:"_3dmbka5 _16lm1iw1k _3dmbka2"},draggingInProgress:{true:"_16lm1iw1x"}},defaultVariants:{},compoundVariants:[[{active:!1,draggingInProgress:!0},"_3dmbka3"]]});function Wp(o,e){return St(o,e)}var Xn=class extends ln{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 Wp(this.data,t)?!1:(this.data=t,!0)}getData(){return this.data}isEqual(t){return Wp(this.data,t.getData())}acceptsSelfDrops(){return!this.data.acceptDropsFrom||this.data.acceptDropsFrom.includes(this.data.listId)}acceptsDrop(t){let n=!0;return typeof this.data.shouldAcceptDrop=="function"&&(n=this.data.shouldAcceptDrop(t)),n=!!n,n!==this.previousAcceptsDropResult&&(this.previousAcceptsDropResult=n,n?this.emit("accept-feedback",t):this.emit("reject-feedback",t)),n}adjustForScroll(t){this.breakpoints=this.breakpoints.map(n=>n-t),this.data.orientation==="vertical"?this.data.listRectangle.shift({top:-t,left:0}):this.data.listRectangle.shift({top:0,left:-t})}move(t){this.emit("move",t)}unregister(){this.emit("unregister",this)}start(t){let n=t.dragSourceListId===this.data.listId,{draggableItems:r}=this.data,i=r.length;this.breakpoints=r.map((a,l)=>n||l===i-1?this.data.orientation==="horizontal"?a.rect.left+a.rect.width/2:a.rect.top+a.rect.height/2:this.data.orientation==="horizontal"?a.rect.right:a.rect.bottom),this.activeDragSourcePosition=n?"inside":"outside",this.emit("start",t)}drop(t){let{dropIndex:n,dragIndex:r,items:i,dragSourceListId:a,dropTargetListId:l,dragItem:s,outside:u}=t,c=Array.from({length:i.length},(f,m)=>m),d=[];n===-1?d=c.filter(f=>f!==r):d=an(c,r,n>r?n-1:n);let p={dragIndex:r,dropIndex:n,dragItem:s,items:i,dragSourceListId:a,dropTargetListId:l,sortedIndexes:d,outside:u,status:t.status};this.emit("drop",p)}};var QS={startFromPercentage:.25,maxScrollAtPercentage:.05,maxPixelScroll:28,ease:o=>o**2,durationDampening:{stopDampeningAt:1200,accelerateAt:360}};function JS(o,e){let t=getComputedStyle(o),n=e==="vertical"?t.overflowY:t.overflowX;return n!=="auto"&&n!=="scroll"?!1:e==="vertical"?o.scrollHeight>o.clientHeight:o.scrollWidth>o.clientWidth}function eT(o,e){let t=o;for(;t&&!(t===document.documentElement||t===document.body);){if(JS(t,e))return t;t=t.parentElement}return null}function tT(o,e){return{startScrollingFrom:o*e.startFromPercentage,maxScrollValueAt:o*e.maxScrollAtPercentage}}var Up=1;function jp(o,e,t){if(o>e.startScrollingFrom)return 0;if(o<=e.maxScrollValueAt)return t.maxPixelScroll;if(o===e.startScrollingFrom)return Up;let r=1-(o-e.maxScrollValueAt)/(e.startScrollingFrom-e.maxScrollValueAt);return Math.ceil(t.maxPixelScroll*t.ease(r))}function oT(o,e,t){let{accelerateAt:n,stopDampeningAt:r}=t.durationDampening,i=Date.now()-e;if(i>=r)return o;if(i<n)return Up;let a=(i-n)/(r-n);return Math.ceil(o*t.ease(a))}function $p(o,e,t,n,r,i,a){if(o<e||o>t)return 0;let l=tT(n,r),s=o-e,u=t-o,c=u<s,d;return c?d=jp(u,l,r):d=-jp(s,l,r),d===0?0:a?(d>0?1:-1)*oT(Math.abs(d),i,r):d}var pn=class{constructor(e){this.scrollContainer=null;this.rafId=null;this.lastPointer={left:0,top:0};this.dragStartTime=0;this.shouldUseDampening=!1;this.active=!1;this.maxScrollTop=0;this.maxScrollLeft=0;this.orientation=e.orientation,this.onScroll=e.onScroll,this.config={...QS,...e.config}}start(e){this.scrollContainer=eT(e,this.orientation),this.scrollContainer&&(this.maxScrollTop=this.scrollContainer.scrollHeight-this.scrollContainer.clientHeight,this.maxScrollLeft=this.scrollContainer.scrollWidth-this.scrollContainer.clientWidth),this.dragStartTime=Date.now(),this.shouldUseDampening=!0,this.active=!0}getScrollContainer(){return this.scrollContainer}updatePointer(e){this.lastPointer=e,!this.rafId&&this.active&&this.scheduleScroll()}scheduleScroll(){this.rafId=requestAnimationFrame(()=>{if(this.rafId=null,!this.active||!this.scrollContainer)return;let e=this.computeScroll();if(e.top===0&&e.left===0)return;let t={top:this.scrollContainer.scrollTop,left:this.scrollContainer.scrollLeft},n=Math.max(0,Math.min(this.maxScrollTop,t.top+e.top)),r=Math.max(0,Math.min(this.maxScrollLeft,t.left+e.left));this.scrollContainer.scrollTop=n,this.scrollContainer.scrollLeft=r;let i={top:this.scrollContainer.scrollTop-t.top,left:this.scrollContainer.scrollLeft-t.left},a=i.top!==0||i.left!==0;a&&this.onScroll(i),this.active&&a&&this.scheduleScroll()})}computeScroll(){if(!this.scrollContainer)return{top:0,left:0};let e=this.scrollContainer.getBoundingClientRect();if(this.orientation==="vertical"){if(this.lastPointer.left<e.left||this.lastPointer.left>e.right)return{top:0,left:0}}else if(this.lastPointer.top<e.top||this.lastPointer.top>e.bottom)return{top:0,left:0};let t=0,n=0;return this.orientation==="vertical"?t=$p(this.lastPointer.top,e.top,e.bottom,e.height,this.config,this.dragStartTime,this.shouldUseDampening):n=$p(this.lastPointer.left,e.left,e.right,e.width,this.config,this.dragStartTime,this.shouldUseDampening),{top:t,left:n}}stop(){this.active=!1,this.rafId!=null&&(cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollContainer=null}};var Xp=Xe.createContext({dragItemId:null,onDragItemPointerDown:()=>{},draggingInProgress:!1,dragListId:"",status:"accepted",dragSourceListId:null,dropTargetListId:null}),fn=()=>Xe.useContext(Xp),nT=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)`},rT=o=>`${o.getAttribute(Rt)}`;function gs(o,e){let t=o.current?.querySelectorAll(Qp)??[];return Array.from(t).filter(r=>r.getAttribute($r)===`${e}`)}function iT(o,e){let t=gs(o,e);return!t||t.length,Array.from(t).map(r=>{let i=rT(r),a=r.getBoundingClientRect();return{id:i,rect:a}})}function aT(o){let{domRef:e,orientation:t,dragListId:n}=o,r=iT(e,n),i=e.current.getBoundingClientRect(),a=i.top,l=i.left,s=i.bottom,u=i.right;for(let p of r){let f=p.rect;f.top<a&&(a=f.top),f.left<l&&(l=f.left),f.bottom>s&&(s=f.bottom),f.right>u&&(u=f.right)}let c=ve.from({top:a,left:l,width:u-l,height:s-a});return{draggableItems:r,orientation:t,listId:n,listRectangle:c,acceptDropsFrom:o.acceptDropsFrom,shouldAcceptDrop:o.shouldAcceptDrop,initial:o.initial,preserveDragSpace:o.preserveDragSpace}}function Zp(o){return new Xn(aT(o))}function lT(o,e){let t=Ne(e),[n,r]=Xe.useState(null),i=(0,Jt.useCallback)(l=>{if(l)Tt.registerDragInteractionTarget(l);else{let s=a();s&&Tt.unregisterDragInteractionTarget(s)}r(l)},[]),a=Ne(n);return(0,Jt.useEffect)(()=>Tt.on("register",l=>{let{dragListId:s,acceptDropsFrom:u,orientation:c,shouldAcceptDrop:d}=t(),p=l.getData();if(p.initial&&p.listId!==s&&u?.includes(p.listId)){let f=Zp({domRef:o,orientation:c,dragListId:s,initial:!1,acceptDropsFrom:u,shouldAcceptDrop:d});l.once("unregister",()=>{i(null)}),i(f)}}),[t]),{interactionTarget:n,setInteractionTarget:i,getInteractionTarget:a}}function hs(o,e){let t=o.cloneNode(!0);return t.removeAttribute(Rt),t.style.position="fixed",t.style.top=`${e.top}px`,t.style.left=`${e.left}px`,t.style.width=`${e.width}px`,t.style.height=`${e.height}px`,t.style.zIndex="999999",t.style.pointerEvents="none",t.style.margin="0",t.style.boxSizing="border-box",t.style.transform="none",document.body.appendChild(t),t}function ys({proxyElement:o,dx:e,dy:t}){o.style.transform=`translate3d(${e}px, ${t}px, 0)`}function Yp(o){let e=o.current;e&&(e.cleanup?e.cleanup({proxyElement:e.proxyElement}):e.proxyElement.remove(),e.originalNode.style.visibility="",o.current=null)}var Go=o=>{let e=Xe.useRef(null),t=Xe.useRef(null),[n,r]=(0,Jt.useState)(null),i=Xe.useRef({top:0,left:0}),a=Xe.useRef(null),l=Xe.useCallback(w=>{a.current=w},[]),{dropTargetListId:s,dragSourceListId:u}=po(),{updateDragOperationSourceAndTarget:c,dragItemId:d,status:p}=po(),f=Ne(o.onDrop),m=Ne(o.onAcceptDrop),g=Ne(o.onRemove),y=Ne(o.updatePosition??nT),{interactionTarget:h,setInteractionTarget:b}=lT(e,o);(0,Jt.useEffect)(()=>{let w=document.querySelector(`[${qp}="${o.dragListId}"]`);w?e.current=w: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,Jt.useEffect)(()=>{if(h){let w=o.dragListId,x=h.on("start",({dragItem:L,dragSourceListId:F,dropTargetListId:G})=>{c({dragSourceListId:F,dropTargetListId:G,dragItemId:L.id,status:"accepted"})}),E=h.on("move",({offsetsForItems:L,items:F,status:G,dragItem:B})=>{if(G==="rejected")return;let z=I(),U=y(),K=t.current;F.forEach((q,re)=>{let se=L[re],de=z[re];if(de&&!(K&&q.id===K.dragItemId)){if(!K&&q.id===B.id){let ae=i.current;se={left:se.left+ae.left,top:se.top+ae.top}}U({id:q.id,node:de,offset:se})}})}),M=h.on("drop",L=>{let{sortedIndexes:F,dragIndex:G,dropIndex:B,dragItem:z,items:U,dragSourceListId:K,dropTargetListId:q,outside:re,status:se}=L,de=I();S.current=[];let ae=m(),ce=g(),le=f(),X=y();U.forEach((Y,$)=>{let ie=de[$];ie&&X({id:Y.id,node:ie,offset:null})}),Yp(t),r(Y=>Y&&(requestAnimationFrame(()=>r(null)),{...Y,dragItemId:null})),w===q&&K!==w&&ae&&se==="accepted"&&ae({dragItemId:z.id,dragSourceListId:K,dropTargetListId:q,dragIndex:G,dropIndex:B,dropItemId:U[B]?.id});let Z=null;B===-1&&K===w&&q===w&&re&&(Z=ce),B!==-1&&q===w&&K===w&&(Z=le),Z&&Z?.(F,{dragIndex:G,dropIndex:B,dragItemId:U[G].id,dropItemId:U[B]?.id})}),D=null,A=null,O=null,N=null;if(!h.getData().initial&&e.current){if(D=new pn({orientation:o.orientation,onScroll:()=>{}}),D.start(e.current),A=D.getScrollContainer(),A){let L=o.orientation==="vertical"?A.scrollTop:A.scrollLeft;O=()=>{let F=o.orientation==="vertical"?A.scrollTop:A.scrollLeft,G=F-L;L=F,G!==0&&(h.adjustForScroll(G),Tt.retriggerMove())},A.addEventListener("scroll",O)}N=L=>{D.updatePointer({left:L.clientX,top:L.clientY})},xe().addEventListener("pointermove",N)}return()=>{x(),E(),M(),D&&D.stop(),A&&O&&A.removeEventListener("scroll",O),N&&xe().removeEventListener("pointermove",N)}}},[h,o.dragListId]);let S=Xe.useRef([]),I=(0,Jt.useCallback)(()=>{let w=S.current;return(!w||w.length===0)&&(w=gs(e,o.dragListId),S.current=w),w},[o.dragListId]),T=(0,Jt.useCallback)(w=>{let x=w.currentTarget,E=x.getAttribute(Rt);if(E==null){let k=Lo(x,Qp);k&&(E=k.getAttribute(Rt))}if(E==null){console.warn("Could not find drag item id for element",x,`Make sure you have a parent element with a ${Rt} attribute`);return}E=`${E}`;let M=null,D=gs(e,o.dragListId);S.current=D;let A=Zp({domRef:e,orientation:o.orientation,dragListId:o.dragListId,acceptDropsFrom:o.acceptDropsFrom,initial:!0,preserveDragSpace:o.preserveDragSpace}),O=A.getData().draggableItems,N=O.findIndex(k=>k.id===E);if(N===-1)return;let L=O[N],F=D[N]?.getAttribute(Rt)===`${E}`?D[N]:D.find(k=>k.getAttribute(Rt)===`${E}`);b(A);let G={left:w.clientX,top:w.clientY},B={left:w.clientX,top:w.clientY};i.current={top:0,left:0};let z=new pn({orientation:o.orientation,onScroll:()=>{}});e.current&&z.start(e.current);let U=z.getScrollContainer(),K=U?o.orientation==="vertical"?U.scrollTop:U.scrollLeft:0;function q(){M&&M.move({left:B.left,top:B.top})}let re=()=>{if(!U)return;let k=o.orientation==="vertical"?U.scrollTop:U.scrollLeft,Z=k-K;K=k,Z!==0&&(A.adjustForScroll(Z),o.orientation==="vertical"?i.current.top+=Z:i.current.left+=Z),q()};U?.addEventListener("scroll",re);let se=o.dragStrategy??"proxy",de=se==="proxy"&&!o.renderDragProxy,ae=se==="proxy"&&!!o.renderDragProxy,ce=o.onDragProxyMove??ys,le=k=>{if(B={left:k.clientX,top:k.clientY},!M){if(M=Tt.startDrag({listId:o.dragListId,dragItem:L,dragIndex:N},G),F&&de){let $=F.getBoundingClientRect(),ie=null,fe={dragItemNode:F,dragItemId:`${E}`,initialRect:$,initialCoords:G,get proxyElement(){return ie||(ie=hs(F,$)),ie}},pe=o.onDragProxySetup?.(fe),H=pe?.proxyElement??fe.proxyElement;F.style.visibility="hidden",t.current={proxyElement:H,originalNode:F,dragItemId:`${E}`,initialRect:$,cleanup:pe?.cleanup}}if(F&&ae){let $=F.getBoundingClientRect();F.style.visibility="hidden",t.current={proxyElement:F,originalNode:F,dragItemId:`${E}`,initialRect:$,cleanup:()=>{}},r({dragItemId:`${E}`,initialRect:$,dx:0,dy:0})}}let Z=k.clientX-G.left,Y=k.clientY-G.top;if(ae)r($=>$&&{...$,dx:Z,dy:Y});else{let $=t.current;$&&ce({proxyElement:$.proxyElement,dx:Z,dy:Y})}z.updatePointer({left:k.clientX,top:k.clientY}),q()},X=()=>{if(z.stop(),U?.removeEventListener("scroll",re),xe().removeEventListener("pointermove",le),ae&&(r(k=>k&&{...k,dragItemId:null}),requestAnimationFrame(()=>{r(null)})),!M){Yp(t),b(null);return}M.drop(),M=null};xe().addEventListener("pointermove",le),xe().addEventListener("pointerup",X,{once:!0})},[o.orientation,o.dragListId,o.acceptDropsFrom,o.removeOnDropOutside,o.dragStrategy,o.renderDragProxy,o.onDragProxySetup,o.onDragProxyMove]),C=!!d,R=Xe.useMemo(()=>({dragItemId:d,onDragItemPointerDown:T,dragSourceListId:u,dropTargetListId:s,status:p,dragListId:o.dragListId,draggingInProgress:C}),[d,T,C,u,s,o.dragListId]),v={className:te("DragList",C?"DragList--dragging":"",Kp({dragging:C})),[qp]:o.dragListId},P=typeof o.children=="function"?o.children(v,R):o.children;return Xe.createElement(Xp.Provider,{value:R},P,n&&o.renderDragProxy?o.renderDragProxy({...n,ref:l}):null)},qp="data-drag-list-id",Rt="data-drag-item-id",$r="data-drag-item-list-id",Qp=`[${Rt}]`,sT=Xe.createContext({dragItemId:"",dragListId:"",active:!1,draggingInProgress:!1,dragSourceListId:"",dropTargetListId:""}),uT=o=>{let{onDragItemPointerDown:e,draggingInProgress:t,dragListId:n,dragItemId:r,dragSourceListId:i,dropTargetListId:a}=fn(),l=o.dragListId??n,s=i===l&&r===`${o.id}`,u=Xe.useMemo(()=>({dragItemId:o.id,active:s,dragListId:l,draggingInProgress:t,dragSourceListId:i,dropTargetListId:a}),[o.id,s,l,t,i,a]),c={[Rt]:`${o.id}`,[$r]:l,onPointerDown:e,className:te("DraggableItem",s?"DraggableItem--active":"",Bp({active:s,draggingInProgress:t}))},d=typeof o.children=="function"?o.children(c,u):o.children;return Xe.createElement(sT.Provider,{value:u},d)};Go.DraggableItem=uT;var bs=j(require("react"));var Jp=o=>bs.createElement(ke,{...o,viewBox:"0 -960 960 960"},bs.createElement("path",{d:ze.hidden[0]}));var ei=j(require("react"));function ef(){return{}}var tf=o=>({allowColumnHideWhileDragging:e=>e??!0});var of=require("react"),cT=(0,of.createContext)(null);function Ss(){return cT}var Gt=j(require("react"));var yn=j(require("react")),Vt=require("react");var Ji=j(require("react"));function dT(o){let{height:e,width:t,count:n}=o;return Ji.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 nf=Ji.memo(dT);var rf="mlx2t3";var ea=j(require("react")),ff=require("react");var af=require("react"),lf=(o,e)=>{(0,af.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 sf={true:"_1ueijco2",false:"_1ueijco3",visible:"_1ueijco4",auto:"_1ueijco5",hidden:"_1ueijco6"},uf={true:"_1ueijco7",false:"_1ueijco8",visible:"_1ueijco9",auto:"_1ueijcoa",hidden:"_1ueijcob"},cf={true:"_1ueijcoc",false:"_1ueijcod",visible:"_1ueijcoe",auto:"_1ueijcof",hidden:"_1ueijcog"},Ts="_1ueijco1",df="_1ueijco0 _16lm1iw0";var pf=o=>{let e="";return typeof o=="boolean"||typeof o=="string"?e=sf[`${o}`]:e=te(uf[`${o.horizontal}`],cf[`${o.vertical}`]),e};var pT="InfiniteVirtualScrollContainer";var mf=ea.forwardRef(function(e,t){let{children:n,scrollable:r=!0,onContainerScroll:i,className:a,tabIndex:l,style:s,autoFocus:u}=e,c=t??(0,ff.useRef)(null);return lf(c,i),ea.createElement("div",{ref:c,style:s,autoFocus:u,tabIndex:l,className:te(a,pT,df,pf(r))},n)});var da=j(require("react")),hn=require("react");var gf=j(require("react")),Zn=require("react");function fT(o){let[e,t]=(0,Zn.useState)(o.updater.get),n=(0,Zn.useRef)(null);return(0,Zn.useLayoutEffect)(()=>{function r(a){o.useraf?(n.current!=null&&cancelAnimationFrame(n.current),n.current=requestAnimationFrame(()=>{t(a)})):t(a)}let i=o.updater.onChange(r);return()=>{n.current!=null&&cancelAnimationFrame(n.current),i()}},[o.updater,o.useraf]),e??null}var Ho=gf.memo(fT);var hf=j(rn());var Cs=(o,e)=>o-e,ho={horizontal:!0,vertical:!0};function ta(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 Is="DebugID=";function Ko(o,e){return e&&e.startsWith(Is)?e:e?`${Is}${o}:${e}`:`${Is}${o}`}var oa={start:0,end:0},Rs=o=>{o()},ws=o=>{let{start:e,end:t}=o,[n,r]=e,[i,a]=t,l=i-n,s=a-r;return l*s},yf=o=>{let{start:e,end:t}=o,[n]=e,[r]=t;return r-n},Ur=typeof window<"u"?requestAnimationFrame:o=>setTimeout(o,0);function mT(o){return o.horizontalChange||o.verticalChange}var mn=class extends bt{constructor(t){let n=Ko(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=oa;this.verticalExtendRangeBy=oa;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=>{Ur(()=>{this.destroyed||t.has(r)&&r(n)})})};this.notifyVerticalRenderRangeChange=(t=!1)=>{if(this.destroyed)return;let n=this.onVerticalRenderRangeChangeFns,r=this.verticalRenderRange,i=t?Rs:Ur;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?Rs:Ur;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 c=this.cols-this.fixedColsEnd;c<this.cols;c++){let d=this.getColWidth(c);a.push(d),l+=d}let s=r-l+(t?0:n);l=0;let u=0;for(let c=this.cols-this.fixedColsEnd;c<this.cols;c++){let d=s+l;i[c]=d,l+=a[u],u++}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 c=this.rows-this.fixedRowsEnd;c<this.rows;c++){let d=this.getRowHeight(c);a.push(d),l+=d}let s=r-l+(t?0:n);l=0;let u=0;for(let c=this.rows-this.fixedRowsEnd;c<this.rows;c++){let d=s+l;i[c]=d,l+=a[u],u++}return i};this.getFixedStartColsWidth=()=>{if(!this.fixedColsStart)return 0;let t=0;for(let n=0;n<this.fixedColsStart;n++)t+=this.getColWidth(n);return t};this.getFixedEndRowsHeight=()=>{if(!this.fixedRowsEnd)return 0;let t=0;for(let n=this.rows-this.fixedRowsEnd;n<this.rows;n++)t+=this.getRowHeight(n);return t};this.getFixedStartRowsHeight=()=>{if(!this.fixedRowsStart)return 0;let t=0;for(let n=0;n<this.fixedRowsStart;n++)t+=this.getRowHeight(n);return t};this.computeRenderCount=(t=ho)=>{let n=t.horizontal,r=t.vertical,i=this.horizontalRenderCount||0,a=this.verticalRenderCount||0;return n&&(i=this.computeDirectionalRenderCount("horizontal",this.colWidth,this.cols,this.getAvailableRenderSize())),r&&(a=this.computeDirectionalRenderCount("vertical",this.rowHeight,this.rows,this.getAvailableRenderSize())),{horizontal:i,vertical:a}};this.setRenderCount=({horizontal:t,vertical:n})=>{t===void 0&&(t=this.horizontalRenderCount),n===void 0&&(n=this.verticalRenderCount);let r=t===this.horizontalRenderCount,i=n===this.verticalRenderCount;r&&i||(this.horizontalRenderCount=t,this.verticalRenderCount=n,this.updateRenderRange({horizontal:!r,vertical:!i}),this.notifyRenderCountChange())};this.updateFixedCells=t=>{t.fixedColsStart!=this.fixedColsStart&&(this.fixedColsStart=t.fixedColsStart||0),t.fixedColsEnd!=this.fixedColsEnd&&(this.fixedColsEnd=t.fixedColsEnd||0),t.fixedRowsStart!=this.fixedRowsStart&&(this.fixedRowsStart=t.fixedRowsStart||0),t.fixedRowsEnd!=this.fixedRowsEnd&&(this.fixedRowsEnd=t.fixedRowsEnd||0)};this.getFixedCellInfo=()=>{let{fixedRowsStart:t,fixedColsStart:n,fixedRowsEnd:r,fixedColsEnd:i}=this;return{fixedRowsStart:t,fixedColsStart:n,fixedRowsEnd:r,fixedColsEnd:i}};this.updateRenderRange=(t=ho)=>{this.setRenderRange(this.computeRenderRange(t))};this.getExtraSpanCellsForRange=({horizontal:t,vertical:n})=>{let{colspan:r,rowspan:i}=this,a=[];if(i){let l=n.startIndex,s=t.startIndex,u=t.endIndex;for(let c=s;c<u;c++){this.computeItemSpanUpTo(l,c,"vertical");let d=this.rowspanParent.get(c);if(d[l]!=l){let p=l;for(;d[p]!=p;)p--;a.push([p,c])}}}if(r){let l=t.startIndex,s=n.startIndex,u=n.endIndex;for(let c=s;c<u;c++){this.computeItemSpanUpTo(c,l,"horizontal");let d=this.colspanParent.get(c);if(d[l]!=l){let p=l;for(;d[p]!=p;)p--;a.push([c,p])}}}return a};this.computeRenderRange=(t=ho)=>{let n=t.horizontal?this.computeDirectionalRenderRange("horizontal"):this.horizontalRenderRange,r=t.vertical?this.computeDirectionalRenderRange("vertical"):this.verticalRenderRange;return{horizontal:n,vertical:r,extraCells:this.getExtraSpanCellsForRange({horizontal:n,vertical:r})}};this.computeDirectionalRenderRange=t=>{let n=t==="horizontal"?this.colWidth:this.rowHeight,r=t==="horizontal"?this.horizontalRenderCount:this.verticalRenderCount,i=t==="horizontal"?this.cols:this.rows;if(!r)return{startIndex:0,endIndex:0};let a=(t==="horizontal"?this.fixedColsStart:this.fixedRowsStart)||0,l=t==="horizontal"?this.scrollPosition.scrollLeft:this.scrollPosition.scrollTop;l+=this.getFixedStartSize(t);let s=typeof n!="function",u=t==="horizontal"?this.horizontalExtendRangeBy:this.verticalExtendRangeBy,c=this.getItemAt(l,t),d=u.start||0,p=u.end||0;s||(d+=this.RENDER_COUNT_SAFETY_MARGIN_START,p+=this.RENDER_COUNT_SAFETY_MARGIN_END),d&&(c=Math.max(0,c-d),r+=d),p&&(r+=p);let f=c+r,m=Math.max(a,i-(t==="horizontal"?this.fixedColsEnd:this.fixedRowsEnd));return f>m&&(f=m,c=Math.max(a,f-r)),{startIndex:c,endIndex:f}};this.getItemAt=(t,n)=>{let r=n==="horizontal"?this.colWidth:this.rowHeight,i=n==="horizontal"?this.cols:this.rows;if(typeof r!="function")return Math.min(Math.max(0,Math.floor(t/r)),i-1);let a=n==="horizontal"?this.colOffsetCache:this.rowOffsetCache,l=n==="horizontal"?this.colWidthCache:this.rowHeightCache,s=a.length-1,u=l.length-1,c=a[s],d;for(;c<t;)if(s>=i||(u+=1,this.computeCacheFor(u,n),d=c,c=a[u],d===c&&d!=0))return i-1;let p=(0,hf.default)(a,t,Cs);return p>=0?p:~p-1};this.computeCacheFor=(t,n)=>{let r=n==="horizontal"?this.colWidth:this.rowHeight,i=n==="horizontal"?this.colWidthCache:this.rowHeightCache,a=n==="horizontal"?this.colOffsetCache:this.rowOffsetCache;if(typeof r!="function")return;let l=r(t);if(i[t]=l,t>0){let s=a[t-1],u=i[t-1];s==null&&console.error(`Offset was not available for ${n==="horizontal"?"col":"row"} ${t-1}`),u==null&&console.error(`Size was not available for ${n==="horizontal"?"col":"row"} ${t-1}`);let c=s+u;a[t]=c}};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 u=r==="horizontal"?this.colspanParent:this.rowspanParent;u.has(a)||u.set(a,[]);let c=r==="horizontal"?this.colspanValue:this.rowspanValue;c.has(a)||c.set(a,[]);let d=u.get(a),p=c.get(a);if(d[i]===void 0){let f=d.length,m=l?Math.min(i,l-1):0,g={rowIndex:t,colIndex:n};for(;f<=m;f++)if(d[f]===void 0){g[r==="horizontal"?"colIndex":"rowIndex"]=f;let y=s(g);d[f]=f,p[f]=y;let h=f;for(;y>1;)h+=1,d[h]=f,p[h]=0,y-=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,u=s.get(l);return(!u||u[a]===void 0)&&this.computeItemSpanUpTo(t,n,r),u||(u=s.get(l)),u[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,u=s.get(l);return(!u||u[a]===void 0)&&this.computeItemSpanUpTo(t,n,r),u||(u=s.get(l)),u[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,u=Math.min(t,r-1);for(;s<=u;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=ws;this.getMaxCellCount=()=>this.maxHorizontalRenderCount*this.maxVerticalRenderCount;this.getExtraCells=()=>this.extraSpanCells;this.getScrollPosition=()=>this.scrollPosition;this.getRenderRange=()=>({start:[this.verticalRenderRange.startIndex,this.horizontalRenderRange.startIndex],end:[this.verticalRenderRange.endIndex,this.horizontalRenderRange.endIndex]});this.onScroll=t=>(this.onScrollFns.push(t),()=>{this.onScrollFns=this.onScrollFns.filter(n=>n!==t)});this.onScrollStart=t=>(this.onScrollStartFns.push(t),()=>{this.onScrollStartFns=this.onScrollStartFns.filter(n=>n!==t)});this.onScrollStop=t=>(this.onScrollStopFns.push(t),()=>{this.onScrollStopFns=this.onScrollStopFns.filter(n=>n!==t)});this.onRenderRangeChange=t=>(this.onRenderRangeChangeFns.add(t),()=>{this.onRenderRangeChangeFns.delete(t)});this.onVerticalRenderRangeChange=t=>(this.onVerticalRenderRangeChangeFns.add(t),()=>{this.onVerticalRenderRangeChangeFns.delete(t)});this.onHorizontalRenderRangeChange=t=>(this.onHorizontalRenderRangeChangeFns.add(t),()=>{this.onHorizontalRenderRangeChangeFns.delete(t)});this.onRenderCountChange=t=>(this.onRenderCountChangeFns.add(t),()=>{this.onRenderCountChangeFns.delete(t)});this.onAvailableSizeChange=t=>(this.onAvailableSizeChangeFns.add(t),()=>{this.onAvailableSizeChangeFns.delete(t)});this.onDestroy=t=>(this.onDestroyFns.push(t),()=>{this.onDestroyFns=this.onDestroyFns.filter(n=>n!==t)});this.getAvailableSize=()=>({width:this.availableWidth,height:this.availableHeight});this.getAvailableRenderSize=()=>({width:this.availableRenderWidth??this.availableWidth,height:this.availableRenderHeight??this.availableHeight});this.name=n,this.update=this.update.bind(this),this.destroy=this.destroy.bind(this),this.getCellOffset=this.getCellOffset.bind(this),this.reset()}set rowsPerPage(t){t!=this._rowsPerPage&&(this._rowsPerPage=t)}get rowsPerPage(){return this._rowsPerPage}reset(t=ho){t.vertical&&this.resetVertical(),t.horizontal&&this.resetHorizontal(),this.extraSpanCells=[]}resetVertical(){this.rowspanParent=new Map,this.rowspanValue=new Map,this.rowHeightCache=[],this.rowOffsetCache=[0],this.verticalRenderCount=void 0,this.verticalTotalSize=0,this.verticalRenderRange={startIndex:0,endIndex:0}}resetHorizontal(){this.colspanParent=new Map,this.colspanValue=new Map,this.colWidthCache=[],this.colOffsetCache=[0],this.horizontalRenderCount=void 0,this.horizontalTotalSize=0,this.horizontalRenderRange={startIndex:0,endIndex:0}}getVirtualColIndex(t,n){return t}update(t,n){let{rows:r,cols:i,rowHeight:a,colWidth:l,width:s,height:u}=t,c=typeof s=="number",d=typeof u=="number",p=c&&s!==this.availableWidth,f=d&&u!==this.availableHeight;p&&(this.availableWidth=s,this.availableRenderWidth=s),f&&(this.availableHeight=u,this.availableRenderHeight=u),(p||f)&&this.notifyAvailableSizeChange();let m=typeof r=="number",g=typeof i=="number",y=m&&r!==this.rows,h=g&&i!==this.cols;m&&(this.rows=r,this.rowsPerPage=r),g&&(this.cols=i);let b=a!=null,S=l!=null,I=b&&a!==this.rowHeight,T=S&&l!==this.colWidth;b&&(this.rowHeight=a),S&&(this.colWidth=l);let C=t.rowspan!=null,R=t.colspan!=null,v=C&&t.rowspan!=this.rowspan,P=R&&t.colspan!=this.colspan;v&&(this.rowspan=t.rowspan),P&&(this.colspan=t.colspan);let w=h||T||p||P,x=y||I||f||v;(n||mT)({horizontalChange:w,verticalChange:x,colsChanged:h,colWidthChanged:T,widthChanged:p,colspanChanged:P,rowsChanged:y,rowHeightChanged:I,heightChanged:f,rowspanChanged:v})&&this.updateRenderCount({horizontal:w,vertical:x})}extendRenderRange(t){let{direction:n}=t,r=n==="horizontal",i=r?this.horizontalRenderCount||this.getInitialCols():this.verticalRenderCount||this.getInitialRows(),a=typeof t.start=="number"?t.start:t.start===!0?i:0,l=typeof t.end=="number"?t.end:t.end===!0?i:0;return r?this.horizontalExtendRangeBy={start:a,end:l}:this.verticalExtendRangeBy={start:a,end:l},this.updateRenderRange({horizontal:r,vertical:!r}),()=>{this.extendRenderRange({start:0,end:0,direction:n})}}updateRenderCount(t=ho){this.reset(t),this.doUpdateRenderCount(t)}doUpdateRenderCount(t=ho){if(!this.availableWidth||!this.availableHeight){let n={horizontal:void 0,vertical:void 0};this.availableWidth||(n.horizontal=0),this.availableHeight||(n.vertical=0),this.setRenderCount(n)}this.setRenderCount(this.computeRenderCount(t))}get scrollTopMax(){return this.getVirtualizedContentSize().height-this.availableHeight}get scrollLeftMax(){return this.getVirtualizedContentSize().width-this.availableWidth}setScrollPosition(t,n){this.setScrolling(!0);let r=t.scrollLeft!==this.scrollPosition.scrollLeft,i=t.scrollTop!==this.scrollPosition.scrollTop;this.scrollPosition=t,(r||i)&&(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?Rs:Ur;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,u=t==="horizontal"?this.fixedColsEnd:this.fixedRowsEnd;if(typeof n=="function"){let c=[],d=0,p=r;d+=s,p-=u;for(let f=d;f<p;f++)c.push(this.getItemSize(f,t));a=ta(l,c)}else a=(n?Math.ceil(l/n):0)+1;return a+=s+u,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=>{Ur(()=>{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,u=l+s;return t==="horizontal"?this.horizontalTotalSize=u:this.verticalTotalSize=u,u}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=oa,this.verticalExtendRangeBy=oa,this.destroyed=!0,this.onDestroyFns=[],this.onScrollFns=[],this.onScrollStartFns=[],this.onScrollStopFns=[],this.onRenderCountChangeFns.clear(),this.onRenderRangeChangeFns.clear(),this.onVerticalRenderRangeChangeFns.clear(),this.onHorizontalRenderRangeChangeFns.clear())}};var vs=j(rn());function bf(...o){if(!o.length)return new Set;let[e,...t]=o;return new Set([...e].filter(n=>t.every(r=>r.has(n))))}function Sf(o,e){let t=new Set;for(let n of o)e(n)&&t.add(n);return t}function Yr(o,e){for(let t of o)if(e(t))return t}var na=(o,e)=>o-e,ra=class extends bt{constructor(t,n){super(`${t}:GridCellManager`);this.matrix=new ee;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,u=new Set;return this.matrix.visit(({value:c},d)=>{if(!c)return;let[p,f]=d,m=p<i,g=p>=l,y=f<a,h=f>=s;(m||g||y||h)&&u.add(c)}),u};this.debugId=t,this.pool=n,this.offRemoveCell=this.pool.onRemoveCell(r=>this.onRemoveCell(r))}onRemoveCell(t){let n=this.cellToMatrixPosition.get(t);this.cellToMatrixPosition.delete(t),n&&this.clearCellFromMatrix(t,n,{skipHistory:!1})}set poolSize(t){this.pool.poolSize=t}get poolSize(){return this.pool.poolSize}getDetachedCell(){return this.pool.getDetachedCell()}clearCellFromMatrix(t,n,r){if(this.matrix.delete(n),r.skipHistory)return;let[i,a]=n,l=this.rowsWithCellsHistory.get(i),s=this.columnsWithCellsHistory.get(a);l&&(l.delete(t),l.size===0&&this.rowsWithCellsHistory.delete(i)),s&&(s.delete(t),s.size===0&&this.columnsWithCellsHistory.delete(a))}addCellToMatrix(t,n){let[r,i]=n;this.matrix.set(n,t),this.cellToMatrixPosition.set(t,n);let a=this.rowsWithCellsHistory.get(r),l=this.columnsWithCellsHistory.get(i);a?a.add(t):(a=new Set,a.add(t),this.rowsWithCellsHistory.set(r,a)),l?l.add(t):(l=new Set,l.add(t),this.columnsWithCellsHistory.set(i,l))}setCellPositionInMatrix(t,n){let r=this.cellToMatrixPosition.get(t);if(n==null){r&&this.clearCellFromMatrix(t,r,{skipHistory:!0});return}let[i,a]=n,l=r&&r[0]===i&&r[1]===a;r&&!l&&this.clearCellFromMatrix(t,r,{skipHistory:!1}),this.addCellToMatrix(t,n)}renderNodeAtCell(t,n,r,i){let a=this.getCellAt(r);return a&&a!==n&&this.detachCellAt(r),this.pool.attachCell(n),this.setCellPositionInMatrix(n,r),n.update(t,i),n}getCellPosition(t){let n=this.cellToMatrixPosition.get(t);return!n||this.getCellAt(n)!=t?null:n}getCellAt(t){return this.matrix.get(t)}getCellFor(t,n){let r=this.getCellAt(t);if(r)return r;let[i,a]=t;if(n==="row"){let l=this.rowsWithCellsHistory.get(i);l&&(r=Yr(l,s=>!this.isCellAttached(s)))}if(n==="column"){let l=this.columnsWithCellsHistory.get(a);l&&(r=Yr(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,u)=>{let c=[a,u],d=this.getCellAt(c);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(na)}getColumnsWithCells(){let t=this.matrix.getKeysOfFirstChildOnEachBranchStartingWith([],{excludeSelf:!0});return[...new Set(t.map(r=>r[1])).values()].sort(na)}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,vs.default)(n,t,na);r<0&&(r=~r),n.slice(r).forEach(a=>this.detachRow(a))}detachColsStartingWith(t){let n=this.getColumnsWithCells().sort(),r=(0,vs.default)(n,t,na);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 Yr(t,r=>this.getCellPosition(r)?.[0]===n)}getCellFromListForColumn(t,n){return Yr(t,r=>this.getCellPosition(r)?.[1]===n)}getCellCountInMatrix(){return this.matrix.size}flushPendingAfterCommitWork(){this.pool.flushPendingAfterCommitWork()}destroy(){this.reset()}reset(){this.pool.reset(),this.matrix.clear(),this.rowsWithCellsHistory.clear(),this.columnsWithCellsHistory.clear(),this.offRemoveCell(),this.offRemoveCell=()=>{}}makeDetachedCellsEmpty(){this.pool.getDetachedCells().forEach(t=>{t.update(null)})}withDetachedCells(t){this.pool.getDetachedCells().forEach(t)}};var Tf=j(rn());var ia=class extends bt{constructor(t,n){super(`${t}:ListRowManager`);this.indexToRow=new Map;this.rowToIndex=new WeakMap;this.debugId=t,this.pool=n,this.offRemoveRow=this.pool.onRemoveRow(r=>this.onRemoveRow(r))}onRemoveRow(t){let n=this.rowToIndex.get(t);n!=null&&(this.rowToIndex.delete(t),this.indexToRow.delete(n))}set poolSize(t){this.pool.poolSize=t}get poolSize(){return this.pool.poolSize}getDetachedRow(){return this.pool.getDetachedRow()}getRowFor(t){return this.getRowAt(t)??this.getDetachedRow()}setRowIndexInList(t,n){let r=this.rowToIndex.get(t);r!=null&&this.indexToRow.delete(r),n==null?this.rowToIndex.delete(t):(this.rowToIndex.set(t,n),this.indexToRow.set(n,t))}detachStartingWith(t){let n=this.getAttachedIndexes(),r=(0,Tf.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 Cf=!0,gn=Q(J.y),If=Q(J.scrollTop),c_=Q(J.columnOffsetAtIndex),Ps=Q(J.columnOffsetAtIndexWhileReordering),Qn=class extends bt{constructor(t,n,r){n=n||"ReactHeadlessTableRenderer";super(n);this.debugId="";this.destroyed=!1;this.scrolling=!1;this.cellHoverClassNames=[];this.cellDetachedClassNames=[];this.lastEnteredRow=-1;this.lastExitedRow=-1;this.hoverRowUpdatesInProgress=new Map;this.infiniteNode=null;this.setDetailTransform=(t,n,{y:r,scrollTop:i,scrollLeft:a})=>{t.style.setProperty(gn,i?`calc( ${r}px + var(${If}) )`:`${r}px`),t.style.transform=`translate3d(${a||0}px, var(${gn}), 0)`};this.setTransform=(t,n,r,{x:i,y:a,scrollLeft:l,scrollTop:s},u)=>{let c=we.columnOffsets.get(r),d=`${Ps}-${r}`,p=s?`calc( ${a}px + var(${If}) )`:`${a}px`;t.__currentTransformY!==p&&(t.__currentTransformY=p,t.style.setProperty(gn,p));let f=`translate3d(var(${d}, ${c}), var(${gn}), 0)`;t.__transformValue!==f&&(t.__transformValue=f,t.style.transform=f),u!=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 u=r.getItemOffsetFor(t,"vertical"),c=r.getItemSize(t,"vertical"),d=r.getFixedStartRowsHeight(),p=r.getFixedEndRowsHeight(),f=i.scrollTop,m=r.getAvailableSize();if(!m.height)return null;let g=f+m.height;l||(l=u>g-p?"end":u<f+d?"start":"end");let y=i.scrollTop;if(l==="center"?y=u-Math.floor((r.getAvailableSize().height-d-p)/2):l==="start"?(s=-s,y+=u-f+s-d):(s+=c,y+=u-g+s+p),this.brain.isHorizontalLayoutBrain){let h=n.colIndex??Math.ceil(this.brain.getInitialCols()/2),b=this.getScrollPositionForScrollColumnIntoView(h,{...n,horizontalLayoutPageIndex:this.brain.getPageIndexForRow(t)});b&&(a=b.scrollLeft)}return{scrollLeft:a,scrollTop:y}};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 u=r.getItemOffsetFor(t,"horizontal"),c=r.getItemSize(t,"horizontal"),d=r.getFixedStartColsWidth(),p=r.getFixedStartColsWidth(),f=i.scrollLeft,m=r.getAvailableSize();if(!m.width)return null;let g=f+m.width;l||(l=u>g-p?"end":u<f+d?"start":"end");let y=i.scrollLeft;return l==="center"?y=u-Math.floor((r.getAvailableSize().width-d-p)/2):l==="start"?(s=-s,y+=u-f+s-d):(s+=c,y+=u-g+s+p),{...i,scrollLeft:y}};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 u=i.getItemAt(i.getAvailableSize().height+i.getScrollPosition().scrollTop-n,"vertical");return t<=u}if(t<s){let u=i.getItemAt(i.getScrollPosition().scrollTop+n,"vertical");return t>=u}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,u]}=i.getRenderRange();if(t<l||t>=u)return!1;let c=Math.floor((l+u)/2);if(t>=c){let d=i.getItemAt(i.getAvailableSize().width+i.getScrollPosition().scrollLeft-n-i.getFixedEndColsWidth(),"horizontal");return t<=d}if(t<c){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:u,end:c}=t,[d,p]=u,[f,m]=c,g=[];if(i&&(n&&g.push({rowFixed:"start",colFixed:"start",start:[0,0],end:[n,i]}),r&&g.push({rowFixed:"end",colFixed:"start",start:[s-r,0],end:[s,i]}),g.push({rowFixed:!1,colFixed:"start",start:[d,0],end:[f,i]})),a&&(n&&g.push({colFixed:"end",rowFixed:"start",start:[0,l-a],end:[n,l]}),r&&g.push({colFixed:"end",rowFixed:"end",start:[s-r,l-a],end:[s,l]}),g.push({colFixed:"end",rowFixed:!1,start:[d,l-a],end:[f,l]})),n){let y={start:[0,p],end:[n,m],rowFixed:"start",colFixed:!1};g.push(y)}if(r){let y={rowFixed:"end",colFixed:!1,start:[s-r,p],end:[s,m]};g.push(y)}return g};this.isCellFixed=(t,n)=>{let{fixedRowsStart:r,fixedRowsEnd:i,fixedColsStart:a,fixedColsEnd:l}=this.brain.getFixedCellInfo(),s=this.brain.getColCount(),u=this.brain.getRowCount(),c=!1,d=!1,p=!1;if(t<r&&(c=!0,p="start"),i&&!c){let f=u-i;t>=f&&(c=!0,p="end")}if(n<a&&(d=!0,p="start"),l&&!d){let f=s-l;n>=f&&(d=!0,p="end")}return{row:c?p:!1,col:d?p:!1}};this.isCellCovered=(t,n)=>{let r=this.brain.getRowspanParent(t,n),i=this.brain.getColspanParent(t,n),a=r!=t,l=i!=n;return a||l?[r,i]:!1};this.onMouseEnterNotBound=t=>{let n=this.getMatrixRowIndexFromElement(t.currentTarget);this.onMouseEnter(n)};this.onMouseLeaveNotBound=t=>{let n=this.getMatrixRowIndexFromElement(t.currentTarget);this.onMouseLeave(n)};this.onMouseEnter=t=>{this.lastEnteredRow=t,this.lastExitedRow=-1,!this.scrolling&&t!=-1&&this.addHoverClass(t)};this.addHoverClass=t=>{this.cellManager.getCellsForRow(t).forEach(n=>{let r=n.getElement();r&&this.cellHoverClassNames.forEach(i=>{r.classList.add(i)})})};this.onMouseLeave=t=>{this.lastExitedRow=t,this.lastEnteredRow=-1,!this.scrolling&&t!=-1&&this.removeHoverClass(t)};this.removeHoverClass=t=>{this.cellManager.getCellsForRow(t).forEach(n=>{let r=n.getElement();r&&this.cellHoverClassNames.forEach(i=>{r.classList.remove(i)})})};this.updateHoverClassNamesForRow=t=>{if(this.scrolling||this.hoverRowUpdatesInProgress.has(t))return;this.hoverRowUpdatesInProgress.set(t,!0);let n=()=>{!this.scrolling&&this.lastEnteredRow!=-1&&(this.lastEnteredRow===t?this.addHoverClass(t):this.removeHoverClass(t))};Ve(()=>{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:u,y:c}=s;if(r){let d=()=>{this.updateHoverClassNamesForRow(a);let p=this.getCellRealCoordinates(a,l);if(r.dataset.rowIndex=p.rowIndex,r.dataset.colIndex=p.colIndex,Cf){this.setTransform(r,a,l,{x:u,y:c},null),r.style.willChange="transform",r.style.backfaceVisibility="hidden";let m=(n?n.hidden:!!this.isCellCovered(a,l))?"-1":r.dataset.zIndex||"auto";r.__zIndex!==m&&(r.__zIndex=m,r.style.zIndex=m)}else r.style.display="",r.style.left=`${u}px`,r.style.top=`${c}px`};this.scrolling&&this.brain.isHorizontalLayoutBrain?t.setPendingAfterCommitWork(d):d()}};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,Cf&&(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:u,fixedRowsStart:c,fixedRowsEnd:d}=this.brain.getFixedCellInfo();if(i.getAttachedCount()&&i.forEachAttachedRow(D=>{let A=i.getRowIndex(D);if(A!=null){let O=this.brain.getItemOffsetFor(A,"vertical");if(O==null)return;let N=D.getElement();if(!N)return;this.setDetailTransform(N,A,{y:O,scrollLeft:t.scrollLeft})}}),!s&&!u&&!c&&!d)return;let p=this.cellManager.getOneAttachedCell();p&&Md(t,this.getInfiniteNode(p.getElement()));let f=this.brain.getFixedEndColsOffsets({skipScroll:!0}),m=this.brain.getFixedEndRowsOffsets({skipScroll:!0}),{start:g,end:y}=this.brain.getRenderRange(),[h,b]=g,[S,I]=y;function T(D,A,O){let N=r.getCellAt([D,A]);if(N==null)return;let L=n.getCellOffset(D,A),F=N.getElement();F&&L&&O(D,A,F,L)}let C=(D,A,O,{x:N,y:L})=>{this.setTransform(O,D,A,{x:N,y:L,scrollLeft:!0},s-A)},R=(D,A,O,N)=>{this.setTransform(O,D,A,{x:N.x,y:N.y,scrollTop:!0},c-D)},v=(D,A,O,{y:N})=>{let L=f[A];this.setTransform(O,D,A,{x:L,y:N,scrollLeft:!0},a-A)},P=(D,A,O,N)=>{this.setTransform(O,D,A,{x:N.x,y:m[D],scrollTop:!0},l-D)},w=(D,A,O,{x:N,y:L})=>{this.setTransform(O,D,A,{x:N,scrollLeft:!0,y:L,scrollTop:!0},1e5)},x=(D,A,O,{x:N})=>{this.setTransform(O,D,A,{x:N,scrollLeft:!0,y:m[D],scrollTop:!0},2e5)},E=(D,A,O,N)=>{this.setTransform(O,D,A,{x:f[A],y:N.y,scrollLeft:!0,scrollTop:!0},3e5)},M=(D,A,O)=>{this.setTransform(O,D,A,{x:f[A],y:m[D],scrollLeft:!0,scrollTop:!0},4e5)};if(s||u)for(let D=h;D<S;D++){for(let A=0;A<s;A++)T(D,A,C);if(u){let A=a-u;for(let O=A;O<a;O++)T(D,O,v)}}if(c||d)for(let D=b;D<I;D++){for(let A=0;A<c;A++)T(A,D,R);if(d){let A=l-d;for(let O=A;O<l;O++)T(O,D,P)}}if(s&&c)for(let D=0;D<c;D++)for(let A=0;A<s;A++)T(D,A,w);if(s&&d){let D=l-d;for(let A=D;A<l;A++)for(let O=0;O<s;O++)T(A,O,x)}if(u&&c){let D=a-u;for(let A=0;A<c;A++)for(let O=D;O<a;O++)T(A,O,E)}if(u&&d){let D=l-d,A=a-u;for(let O=D;O<l;O++)for(let N=A;N<a;N++)T(O,N,M)}};this.flushPendingAfterCommitWork=()=>{this.destroyed||this.cellManager.flushPendingAfterCommitWork()};this.destroy=()=>{this.destroyed||(this.destroyed=!0,this.reset(),this.onDestroy(),this.hoverRowUpdatesInProgress.clear(),this.hoverRowUpdatesInProgress=null,this.brain=null)};this.brain=t,this.debugId=n,this.cellManager=new ra(n,r.cellPool),this.cellManager.onCellAttachmentChange((u,c)=>{c?this.onCellAttached(u):this.onCellDetached(u)}),this.rowManager=new ia(n,r.rowPool),this.rowManager.onRowAttachmentChange((u,c)=>{c?this.onRowAttached(u):this.onRowDetached(u)}),this.renderRange=this.renderRange.bind(this);let i=t.onScroll(this.adjustFixedElementsOnScroll),a=t.onAvailableSizeChange(()=>{this.adjustFixedElementsOnScroll(),Ve(()=>{this.destroyed||this.adjustFixedElementsOnScroll()})}),l=t.onScrollStart(this.onScrollStart),s=t.onScrollStop(this.onScrollStop);this.onDestroy=()=>{i(),a(),l(),s()}}getInfiniteNode(t){return this.infiniteNode||(this.infiniteNode=Jl(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,u=this.brain.isHorizontalLayoutBrain,{rowManager:c,cellManager:d}=this,p=this.getFixedRanges(t),f=[t,...p],m=this.brain.getAlwaysRenderedColumns();if(m.length>0){let w=t.start[1],x=t.end[1];m.forEach(E=>{w<=E&&E<x||f.push({start:[t.start[0],E],end:[t.end[0],E+1]})})}let g=new Map,y=f.map(this.getExtraSpanCellsForRange).flat();y&&y.forEach(([w,x])=>{g.set(`${w}:${x}`,!0)});let h=f.reduce((w,x)=>w+ws(x),0),b=r?f.reduce((w,x)=>w+yf(x),0):0,S=this.brain.getRowCount(),I=this.brain.getColCount();d.detachCellsStartingAt([S,I]);let T=Math.min(S*I,h);r&&(c.detachStartingWith(this.brain.getRowCount()),c.poolSize>b&&(c.poolSize=b));let C=bf(...f.map(w=>d.getCellsOutsideRenderRange(w)));C=Sf(C,w=>{let x=d.getCellPosition(w);return!(x&&g.has(`${x[0]}:${x[1]}`))}),d.detachCells(C),d.poolSize=T;let R=new Map,v=new Map;f.forEach(w=>{let{start:x,end:E}=w,[M,D]=x,[A,O]=E;for(let N=M;N<A;N++){for(let F=D;F<O;F++){let G=`${N}:${F}`;if(R.has(G))continue;R.set(G,!0);let{rendered:B,mapped:z}=this.isCellRenderedAndMappedCorrectly(N,F);if(N===M||F===D){let K=this.isCellCovered(N,F);if(K&&g.has(`${K[0]}:${K[1]}`)){let q=d.getCellAt([N,F]);q!=null&&d.detachCell(q);continue}}if(B&&!i&&z)continue;let U;B?U=d.getCellAt([N,F]):U=d.getCellFor([N,F],u?"row":"column"),U==null&&(U=d.getDetachedCell()),this.renderCellAt(N,F,U,n)}!r||v.has(N)||(v.set(N,!0),c.isRowAttachedAt(N)&&!i)||this.renderDetailRowAtElement(N,this.rowManager.getRowFor(N),r)}}),y.forEach(([w,x])=>{let{rendered:E,mapped:M}=this.isCellRenderedAndMappedCorrectly(w,x);if(E){if(i||!M){let A=[w,x],O=d.getCellAt(A);this.renderCellAt(w,x,O,n)}return}let D=d.getCellFor([w,x],u?"row":"column");D!=null&&this.renderCellAt(w,x,D,n)});let P=d.getAllCells().map(w=>w.getNode());return r&&c.getAllRows().forEach(w=>{P.push(w.getNode())}),this.adjustFixedElementsOnScroll(),a&&a(P),P}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,u=r({rowIndex:t,height:a,rowFixed:l,hidden:!!i,onMouseEnter:()=>{},onMouseLeave:()=>{},domRef:n.ref});if(n.isMounted()||n.onMount(c=>{let d=c.getElement();d&&(d.style.position="absolute",d.style.left="0px"),this.updateDetailElementPosition(c)}),!u){this.rowManager.detachRow(n);return}this.rowManager.renderNodeAtRow(u,n,t),this.updateDetailElementPosition(n)}getCellRealCoordinates(t,n){return{rowIndex:t,colIndex:n}}getMatrixRowIndexFromElement(t){let n=Number(t.dataset.rowIndex);return this.brain.isHorizontalLayoutBrain?this.brain.getRowIndexInPage(n):n}renderCellAt(t,n,r,i){if(this.destroyed)return;let a=this.isCellCovered(t,n),l=this.brain.getRowHeight(t),s=this.brain.getColWidth(n),u=this.brain.getRowspan(t,n),c=this.brain.getColspan(t,n),d=u===1?l:this.brain.getRowHeightWithSpan(t,n,u),p=c===1?s:this.brain.getColWidthWithSpan(t,n,c),{row:f,col:m}=this.isCellFixed(t,n),g=!!a,{rowIndex:y,colIndex:h}=this.getCellRealCoordinates(t,n),b=i({rowIndex:y,colIndex:h,height:l,width:s,rowspan:u,colspan:c,rowFixed:f,colFixed:m,hidden:g,heightWithRowspan:d,widthWithColspan:p,onMouseEnter:this.onMouseEnterNotBound,onMouseLeave:this.onMouseLeaveNotBound,domRef:r.ref});r.isMounted()||r.onMount(T=>{let C=T.getElement();C&&(C.style.position="absolute",C.style.left="0px",C.style.top="0px"),this.updateElementPosition(T)});let S=this.brain.isHorizontalLayoutBrain?{renderRowIndex:y,renderColIndex:h}:void 0,I=this.brain.isHorizontalLayoutBrain;if(!b){I?this.cellManager.detachCell(r):this.cellManager.detachCell(r);return}this.cellManager.renderNodeAtCell(b,r,[t,n],S),this.updateElementPosition(r,{hidden:g,rowspan:u,colspan:c})}reset(){this.cellManager.reset(),this.rowManager.reset()}};var aa=class extends Qn{constructor(t,n,r){super(t,n,r);this.setTransform=(t,n,r,i,a)=>{let l=this.getCellRealCoordinates(n,r),{y:s}=i,u=Math.floor(l.rowIndex/this.brain.rowsPerPage),c=ge.runtime.totalVisibleColumnsWidthVar,d=u?`calc(${c} * ${u})`:"0px",p=we.columnOffsets.get(l.colIndex),f=`${Ps}-${l.colIndex}`,m=`${s}px`;t.__currentTransformY!==m&&(t.__currentTransformY=m,t.style.setProperty(gn,m));let g=`calc(var(${f}, ${p}) + ${d})`,y=`var(${gn})`,h=`translate3d(${g}, ${y}, 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}}};var wf=j(require("react"));var Jn=class Jn extends bt{constructor(t){super(t);this.cellRemoveSubscription=be();this.cellAttachmentChangeSubscription=be();this.attachedCells=new Set,this.detachedCells=new Set,this.allCellsOrdered=new Set}destroy(){this.reset()}onRemoveCell(t){return this.cellRemoveSubscription.onChange(r=>{r!=null&&t(r)})}onCellAttachmentChange(t){return this.cellAttachmentChangeSubscription.onChange(r=>{if(r==null)return;let{cell:i,attached:a}=r;t(i,a)})}reset(){this.attachedCells.clear(),this.detachedCells.clear(),this.allCellsOrdered.clear(),this.cellRemoveSubscription.destroy(),this.cellAttachmentChangeSubscription.destroy()}getAttachedCells(){return this.attachedCells}getDetachedCells(){return this.detachedCells}getAllCells(){return this.allCellsOrdered}createCell(){let t=this.createCellInstance();return this.detachedCells.add(t),this.allCellsOrdered.add(t),t}removeCell(t){this.detachedCells.delete(t),this.attachedCells.delete(t),this.allCellsOrdered.delete(t),t.destroy(),this.cellRemoveSubscription(t)}attachCell(t){return t&&this.attachedCells.has(t)||(t||(t=this.getDetachedCell()),this.detachedCells.delete(t),this.attachedCells.add(t),this.cellAttachmentChangeSubscription({cell:t,attached:!0})),t}detachCell(t){return this.detachedCells.has(t)?!1:(this.attachedCells.delete(t),this.detachedCells.add(t),this.cellAttachmentChangeSubscription({cell:t,attached:!1}),!0)}getDetachedCell(){let{detachedCells:t}=this,n=t.values().next().value;return n||(this.poolSize+=Jn.POOL_SIZE_INCREMENT,n=t.values().next().value),n||this.error("No cells available in the pool!"),n}get attachedSize(){return this.attachedCells.size}get detachedSize(){return this.detachedCells.size}get poolSize(){return this.allCellsOrdered.size}flushPendingAfterCommitWork(){for(let t of this.attachedCells)t.flushPendingAfterCommitWork()}set poolSize(t){t=Math.ceil(t/Jn.POOL_SIZE_INCREMENT)*Jn.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--}};Jn.POOL_SIZE_INCREMENT=1;var la=Jn;var Rf=new Map,gT=()=>{},Ds=class{constructor(e,t){this.element=null;this.mounted=!1;this.pendingAfterCommitWork=null;this.mountSubscription=be();let n=Rf.get(e)??0,r=`${e}:GridCellReact:${n}`;Rf.set(e,n+1),this.debugId=r,this.cellInfo=t,this.updater=be(),this.node=wf.createElement(Ho,{key:r,name:r,updater:this.updater}),this.ref=i=>{this.element=i,i?(this.mounted=!0,this.mountSubscription(this)):this.mounted=!1}}setPendingAfterCommitWork(e){this.pendingAfterCommitWork=e}flushPendingAfterCommitWork(){if(this.pendingAfterCommitWork){let e=this.pendingAfterCommitWork;this.pendingAfterCommitWork=null,e()}}isMounted(){return this.mounted}onMount(e){return this.mountSubscription.onChange(n=>{n!=null&&e(n)})}destroy(){this.mountSubscription.destroy(),this.updater.destroy(),this.pendingAfterCommitWork=null,this.ref=gT,this.element=null,this.node=null}getNode(){return this.node}update(e,t){this.updater(e),this.cellInfo=t}getAdditionalInfo(){return this.cellInfo}getElement(){return this.element}},sa=class extends la{constructor(t){super(`${t}:GridCellPoolForReact`);this.cellDebugId=t}createCellInstance(){return new Ds(this.cellDebugId)}};var Pf=j(require("react"));var er=class er extends bt{constructor(t){super(t);this.rowRemoveSubscription=be();this.rowAttachmentChangeSubscription=be();this.attachedRows=new Set,this.detachedRows=new Set,this.allRowsOrdered=new Set}destroy(){this.reset()}onRemoveRow(t){return this.rowRemoveSubscription.onChange(r=>{r!=null&&t(r)})}onRowAttachmentChange(t){return this.rowAttachmentChangeSubscription.onChange(r=>{if(r==null)return;let{row:i,attached:a}=r;t(i,a)})}reset(){this.attachedRows.clear(),this.detachedRows.clear(),this.allRowsOrdered.clear(),this.rowRemoveSubscription.destroy(),this.rowAttachmentChangeSubscription.destroy()}getAttachedRows(){return this.attachedRows}getDetachedRows(){return this.detachedRows}getAllRows(){return this.allRowsOrdered}createRow(){let t=this.createRowInstance();return this.detachedRows.add(t),this.allRowsOrdered.add(t),t}removeRow(t){this.detachedRows.delete(t),this.attachedRows.delete(t),this.allRowsOrdered.delete(t),t.destroy(),this.rowRemoveSubscription(t)}attachRow(t){return t&&this.attachedRows.has(t)||(t||(t=this.getDetachedRow()),this.detachedRows.delete(t),this.attachedRows.add(t),this.rowAttachmentChangeSubscription({row:t,attached:!0})),t}detachRow(t){return this.detachedRows.has(t)?!1:(this.attachedRows.delete(t),this.detachedRows.add(t),this.rowAttachmentChangeSubscription({row:t,attached:!1}),!0)}getDetachedRow(){let{detachedRows:t}=this,n=t.values().next().value;return n||(this.poolSize+=er.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/er.POOL_SIZE_INCREMENT)*er.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--}};er.POOL_SIZE_INCREMENT=1;var ua=er;var vf=new Map,hT=()=>{},xs=class{constructor(e){this.element=null;this.mounted=!1;this.mountSubscription=be();let t=vf.get(e)??0,n=`${e}:ListRowReact:${t}`;vf.set(e,t+1),this.debugId=n,this.updater=be(),this.node=Pf.createElement(Ho,{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=hT,this.element=null,this.node=null}getNode(){return this.node}update(e){this.updater(e)}getElement(){return this.element}},ca=class extends ua{constructor(t){super(`${t}:ListRowPoolForReact`);this.rowDebugId=t}createRowInstance(){return new xs(this.rowDebugId)}};function Df(o){return{cellPool:new sa(o),rowPool:new ca(o)}}function qr(o){let e=o.isHorizontalLayoutBrain?new aa(o,`${o.name}:HorizontalLayoutTableRenderer`,Df(`${o.name}:HorizontalLayoutTableRenderer`)):new Qn(o,`${o.name}:ReactHeadlessTableRenderer`,Df(`${o.name}:ReactHeadlessTableRenderer`)),t=be();return o.onDestroy(()=>{e.destroy(),t.destroy()}),{renderer:e,onRenderUpdater:t}}function yT(o){let{brain:e,renderCell:t,renderDetailRow:n,forceRerenderTimestamp:r}=o,{renderer:i,onRenderUpdater:a}=(0,hn.useMemo)(()=>o.onRenderUpdater&&o.renderer?{renderer:o.renderer,onRenderUpdater:o.onRenderUpdater}:qr(e),[e,o.onRenderUpdater,o.renderer]);return(0,hn.useLayoutEffect)(()=>{i.cellHoverClassNames=o.cellHoverClassNames||[]},[i,o.cellHoverClassNames]),(0,hn.useLayoutEffect)(()=>{i.cellDetachedClassNames=o.cellDetachedClassNames||[]},[i,o.cellDetachedClassNames]),(0,hn.useLayoutEffect)(()=>{let l=e.getRenderRange();return i.renderRange(l,{onRender:a,force:!0,renderCell:t,renderDetailRow:n}),e.onRenderRangeChange(u=>{i.renderRange(u,{force:!1,onRender:c=>{let d=a.get();d&&c&&d.length===c.length||a(c)},renderCell:t,renderDetailRow:n})})},[i,e,t,n,a,r]),(0,hn.useLayoutEffect)(()=>{i.flushPendingAfterCommitWork()}),da.createElement(Ho,{updater:a})}var pa=da.memo(yT);var Xr=j(require("react")),tr=require("react");var xf=ye({defaultClassName:"nxbq1c1 _16lm1iwz _16lm1iw2",variantClassNames:{visible:{true:"nxbq1c3",false:"nxbq1c4"}},defaultVariants:{},compoundVariants:[]}),fa="nxbq1c0 _16lm1iwz _16lm1iw4 _16lm1iw26 _16lm1iw23 _16lm1iw1y _16lm1iw1k";var Mf=ye({defaultClassName:"j26lrx0 _16lm1iwz _16lm1iw2 _16lm1iw23 _16lm1iw26",variantClassNames:{active:{true:"j26lrx2",false:"j26lrx3"}},defaultVariants:{},compoundVariants:[]});var{rootClassName:bT}=Le,ST=`${bT}-ActiveRowIndicator`,TT=`calc(${J.activeCellRowOffsetX} + var(${Q(J.scrollLeftForActiveRowWhenHorizontalLayout)}, 0px))`,CT={[Q(J.activeCellOffsetY)]:J.activeCellRowOffset,transform:`translate3d(${TT}, calc( ${J.activeCellOffsetY} + var(${Q(J.scrollTopForActiveRow)}, 0px)), 0px)`,height:J.activeCellRowHeight,maxWidth:ge.runtime.totalVisibleColumnsWidthVar},IT=o=>{let{brain:e}=o,t=(0,tr.useRef)(null),n=o.activeRowIndex!=null&&e.getInitialRows()>o.activeRowIndex,[r,i]=Ut();return(0,tr.useLayoutEffect)(()=>{if(o.activeRowIndex==null)return;let a="0px",l=o.activeRowIndex;if(e.isHorizontalLayoutBrain&&e.rowsPerPage){let p=e.getPageIndexForRow(l);p>0&&(a=`calc(${ge.runtime.totalVisibleColumnsWidthVar} * ${p})`),l=l%e.rowsPerPage}let s=e.getRowHeight(l),u=e.getItemOffsetFor(l,"vertical"),c=t.current,d={activeCellRowHeight:`${s}px`,activeCellRowOffset:`${u}px`,activeCellRowOffsetX:a};Kn(d,c)},[o.activeRowIndex,e]),(0,tr.useEffect)(()=>{let a=u=>{Kn({scrollTopForActiveRow:`${-u.scrollTop}px`,scrollLeftForActiveRowWhenHorizontalLayout:e.isHorizontalLayoutBrain?`${-u.scrollLeft}px`:"0px"},t.current)};a(e.getScrollPosition());let l=e.onScroll(a),s=e.onRenderCountChange(i);return()=>{s(),l()}},[e]),Xr.createElement("div",{className:fa,"data-name":"active-row"},Xr.createElement("div",{ref:t,"data-name":"active-row-indicator",className:`${ST} ${Mf({active:n})}`,style:n?CT:void 0}))},Ef=Xr.memo(IT);var Zr=j(require("react")),or=require("react");var{rootClassName:RT}=Le,wT=`${RT}-ActiveCellIndicator`,vT=Q(J.columnZIndexAtIndex),PT=(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;Kn({activeCellRowHeight:`${i}px`,activeCellRowOffset:`${a}px`},l)},DT=o=>{let{brain:e}=o,[t,n]=Ut(),r=(0,or.useRef)(null),i=o.activeCellIndex!=null&&e.getInitialRows()>o.activeCellIndex[0];return(0,or.useLayoutEffect)(()=>{PT(e,o.activeCellIndex,o.rowHeight,r)},[o.activeCellIndex,o.rowHeight,e]),(0,or.useEffect)(()=>{let a=e.onRenderCountChange(()=>{n()});return()=>{a()}},[e]),Zr.createElement("div",{className:fa,ref:r,"data-name":"active-cell",style:i?{zIndex:`var(${vT}-${o.activeCellIndex[1]})`}:void 0},Zr.createElement("div",{"data-name":"active-cell-indicator",className:`${wT} ${xf({visible:i})}`}))},Af=Zr.memo(DT);var ma=[fp,`${mt}DetachedCell`];function ga(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 xT=te(rf,Ts);function _f(o){let{brain:e,scrollerDOMRef:t,scrollStopDelay:n,renderCell:r,renderDetailRow:i,activeCellRowHeight:a,cellHoverClassNames:l,renderer:s,activeRowIndex:u,activeCellIndex:c,onRenderUpdater:d,wrapRowsHorizontally:p,forceRerenderTimestamp:f,scrollVarHostRef:m,...g}=o,{autoFocus:y}=g,h=(0,Vt.useRef)(null),[b,S]=(0,Vt.useState)({width:0,height:0});(0,Vt.useEffect)(()=>{n!=null&&e.setScrollStopDelay(n)},[n,e]),(0,Vt.useEffect)(()=>{let C=h.current?.parentNode;return C?(y&&document.activeElement!==C&&C.focus(),En(C,()=>{let P={height:C.clientHeight,width:C.clientWidth};e.update(P)},{debounce:50})):void 0},[p,e]);let I=(0,Vt.useCallback)(C=>{requestAnimationFrame(()=>{h.current&&h.current.style.setProperty("transform",`translate3d(${-C.scrollLeft}px, ${-C.scrollTop}px, 0px)`)})},[]),T=(0,Vt.useCallback)(C=>{e.setScrollPosition(C,I)},[e,I]);return(0,Vt.useEffect)(()=>{let C=e.onRenderCountChange(()=>{S(e.getVirtualizedContentSize())});return S(e.getVirtualizedContentSize()),I(e.getScrollPosition()||{scrollLeft:0,scrollTop:0}),C},[e]),yn.createElement(mf,{onContainerScroll:T,...g,ref:t},yn.createElement("div",{ref:h,className:xT,"data-name":"scroll-transform-target"},yn.createElement(pa,{forceRerenderTimestamp:f,renderer:s,onRenderUpdater:d,renderCell:r,renderDetailRow:i,brain:e,cellHoverClassNames:l,cellDetachedClassNames:ma}),c!=null?yn.createElement(Af,{brain:e,rowHeight:a,activeCellIndex:c}):null),u!=null?yn.createElement(Ef,{brain:e,activeRowIndex:u}):null,yn.createElement(nf,{width:b.width,height:b.height}))}function Of(o,e,t,n){let r=new Map,i=new Map,a=new Map;o.forEach((c,d)=>{let p=c.id,f=o[d-1],m=f?.id??"",g=new Set,y=f?.computedPinned!==c.computedPinned?new Set:a.get(m)??new Set;a.set(p,g);let h={type:"column",id:p,ref:c,groupOffset:0,computedPinned:c.computedPinned,computedWidth:c.computedWidth,depth:c.columnGroup?(t.get(c.columnGroup)??0)+1:0};r.set([p],h);let b=c.columnGroup,S,I=h;for(;b;){let T=e[b];if(T){g.add(b);let C=[p,...g];S=y.has(b)?i.get(b):void 0,S||(S={id:b,type:"group",ref:T,columnItems:[],children:[],groupOffset:0,uniqueGroupId:[b],computedWidth:0,computedPinned:h.computedPinned,depth:t.get(b)??0},r.set(C,S),i.set(b,S)),S.columnItems.push(h),S.uniqueGroupId.push(h.id),I&&!y.has(I.id)&&S.children.push(I),I=S,b=T.columnGroup}else break}});let l=[],s=new ee,u=0;return r.forEach(c=>{if(!c.ref.columnGroup){let d=c.type==="column"?c.ref.computedWidth:c.columnItems.reduce((p,f)=>p+f.ref.computedWidth,0);c.groupOffset=u,c.computedWidth=d,c.type==="group"&&Nf(c.children),l.push(c),u+=d}if(c.type==="group")c.columnItems.forEach(d=>{s.set([c.depth,d.ref.computedVisibleIndex],c)});else for(let d=c.depth;d<=n+1;d++)s.set([d,c.ref.computedVisibleIndex],c)}),r.clear(),i.clear(),{tree:l,pathsToCells:s}}function Nf(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"&&Nf(t.children),e+=n})}var Bo=j(require("react")),yo=require("react");var Es=j(require("react"));var Lf=j(require("react")),Ms=require("react");var Qr=require("react"),Jr=j(require("react"));var{rootClassName:MT}=Le,ET=`${MT}HeaderCell_ResizeHandle`;function AT(o){let e=(0,Qr.useRef)(null),[t,n]=(0,Qr.useState)(!1),r=(0,Qr.useRef)(t);r.current=t;let i=o.groupColumns[0];if(!i)return null;let a=i.computedPinned,l=i.computedFirstInCategory,s=i.computedLastInCategory,u=d=>{d.stopPropagation();let p=d.pointerId,f=d.clientX,m=d.target;m.setPointerCapture(p);let g=!0,y=zp(o.groupColumns.map(I=>I.computedVisibleIndex),{columns:o.columns,domRef:e}),h=I=>{a==="end"&&(I*=-1);let{constrained:T,adjustedDiffs:C,adjustedDiff:R}=o.computeResize(I);return r.current!==T&&n(T),y.resize(C),R},b=I=>{if(g){let T=o.groupColumns.reduce((v,P)=>v+P.computedWidth-P.computedMinWidth,0),C=o.brain.getAvailableSize(),R={width:C.width+T,height:C.height};o.brain.update(R),g=!1}h(Math.round(I.clientX-f))},S=I=>{m.releasePointerCapture(p),m.removeEventListener("pointermove",b),m.removeEventListener("pointerup",S);let T=Math.round(I.clientX-f),C=h(T);o.onResize(C)};m.addEventListener("pointermove",b),m.addEventListener("pointerup",S)},c=(a===!1||a==="start")&&s?{right:a==="start"?void 0:ge.components.HeaderCell.resizeHandleWidth}:a==="end"&&l?{right:void 0}:void 0;return Jr.createElement("div",{ref:e,className:`${ET} ${Xi} ${Qi({computedPinned:a,computedFirstInCategory:l,computedLastInCategory:s})}`,onPointerDown:u},Jr.createElement("div",{style:{...c,...o.style},className:Zi({constrained:t})}))}var Ff=Jr.memo(AT);function kf(o,e){let{bodyBrain:t,groupHeight:n,columnGroup:r,columnGroupsMaxDepth:i}=e,{computedVisibleColumns:a,getState:l,getComputed:s,actions:u}=ne(g=>({computedVisibleColumns:g.computed.computedVisibleColumns,getState:g.getState,getComputed:g.getComputed,actions:g.actions})),c=o[o.length-1],d=(0,Ms.useCallback)(g=>{let y=l(),{columnSizing:h,viewportReservedWidth:b,bodySize:S}=y,I=s().computedVisibleColumns,T=!1,C=I.reduce((P,w)=>(w.computedFlex&&(P[w.id]={...h[w.id],flex:w.computedWidth},T=!0),P),{}),R=T?{...h,...C}:h;return sd({availableSize:S.width,reservedWidth:b||0,dragHandleOffset:g,dragHandlePositionAfter:c.computedVisibleIndex,columnSizing:R,columnGroupSize:o.length,items:I.map(P=>({id:P.id,resizable:P.computedResizable,computedFlex:P.computedFlex,computedWidth:P.computedWidth,computedMinWidth:P.computedMinWidth,computedMaxWidth:P.computedMaxWidth}))})},[c]),p=(0,Ms.useCallback)(g=>{let{columnSizing:y,reservedWidth:h}=d(g);u.viewportReservedWidth=h,u.columnSizing=y},[d]);return o.some(g=>g.computedResizable)?Lf.createElement(Ff,{brain:t,style:{height:n*(i-r.depth+2)},columns:a,groupColumns:o,computeResize:d,onResize:p}):null}var zf=`${mt}HeaderGroup`,Vf=Q(J.columnWidthAtIndex),_T=Q(J.columnZIndexAtIndex);function Gf(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=kf(n,{bodyBrain:r,groupHeight:t,columnGroup:e,columnGroupsMaxDepth:i}),u=n[0],c=n.length>1?"calc( "+n.map(f=>`var(${Vf}-${f.computedVisibleIndex})`).join(" + ")+" )":`var(${Vf}-${u.computedVisibleIndex})`,d=`calc(var(${_T}-${u.computedVisibleIndex}) + ${i-e.depth})`,p=typeof l=="function"?l({columnGroup:e,horizontalLayoutPageIndex:o.horizontalLayoutPageIndex}):l;return p=p&&typeof p=="object"?p:{},p.width=c,p.height=t,Es.createElement("div",{ref:o.domRef,"data-group-id":e.uniqueGroupId,className:te(Qc,zf),style:p,"data-z-index":d},Es.createElement("div",{className:te(`${zf}__header-content`,Yt)},a),s)}var Hf=require("react");var Os=j(require("react")),As;function Ns(){return As||(As=Os.createContext({dataSourceApi:null,getDataSourceState:()=>null,assignState:()=>null,getDataSourceMasterContext:()=>{},dataSourceState:null,dataSourceActions:null}))}var _s;function ha(){return _s||(_s=Os.createContext(null))}function Ee(o){let e=ha(),t=(0,Hf.useContext)(e);return An(t,o)}function eo(){return Ee(o=>({getDataSourceState:o.getDataSourceState,getDataSourceMasterContext:o.getDataSourceMasterContext,dataSourceActions:o.dataSourceActions,dataSourceApi:o.dataSourceApi,assignState:o.assignState}))}var{rootClassName:OT}=Le,NT=[],Kf=`${OT}Header`,FT=Uc({overflow:!1}),Bf=()=>{};function LT(o){let{bodyBrain:e,headerBrain:t,columns:n,style:r,className:i,columnHeaderHeight:a,columnAndGroupTreeInfo:l,columnGroupsMaxDepth:s}=o,{getState:u,headerOptions:c,headerRenderer:d,headerOnRenderUpdater:p,showColumnFilters:f,computedColumnsMap:m}=ne(E=>({computedColumnsMap:E.computed.computedColumnsMap,getState:E.getState,headerOptions:E.state.headerOptions,headerRenderer:E.state.headerRenderer,headerOnRenderUpdater:E.state.headerOnRenderUpdater,showColumnFilters:E.state.showColumnFilters})),g=(0,yo.useRef)(null),y=(0,yo.useCallback)(E=>{g.current&&(g.current.style.transform=`translate3d(-${E.scrollLeft}px, 0px, 0px)`)},[]);(0,yo.useEffect)(()=>{let E=t.onScroll(y);return y(t.getScrollPosition()||{scrollLeft:0,scrollTop:0}),E},[t]);let h={ref:g,className:te(Kf,`${Kf}--virtualized`,i,FT),style:{...r,height:a}},{getDataSourceState:b,dataSourceApi:S,dataSourceActions:I}=eo(),{allRowsSelected:T,someRowsSelected:C,selectionMode:R,filterTypes:v,filterDelay:P}=Ee(E=>({allRowsSelected:E.dataSourceState.allRowsSelected,someRowsSelected:E.dataSourceState.someRowsSelected,selectionMode:E.dataSourceState.selectionMode,filterTypes:E.dataSourceState.filterTypes,filterDelay:E.dataSourceState.filterDelay})),w=(0,yo.useMemo)(()=>({allRowsSelected:T,someRowsSelected:C,selectionMode:R}),[T,C,R]),x=(0,yo.useCallback)(E=>{let{rowIndex:M,colIndex:D,domRef:A,height:O,widthWithColspan:N,heightWithRowspan:L,hidden:F}=E,G=n[D];if(!G||F)return null;let B=t.isHorizontalLayoutBrain?t.getPageIndexForRow(M):null,z=l?l.pathsToCells.get([M,D]):null;if(z&&z.type==="group"){let U=z.columnItems.map(re=>re.ref),K={...z.ref,id:z.id,uniqueGroupId:z.uniqueGroupId,depth:z.depth,columns:U.map(re=>re.id),computedWidth:z.computedWidth,groupOffset:z.groupOffset};return u().columnGroupVisibility[z.id]!==!1?Bo.createElement(Gf,{horizontalLayoutPageIndex:B,bodyBrain:e,columnGroupsMaxDepth:s,domRef:A,columns:U,width:N,height:O,columnGroup:K}):null}return Bo.createElement(jf,{domRef:A,column:G,horizontalLayoutPageIndex:B,headerOptions:c,dataSourceStatePartialForHeaderCell:w,filterTypes:v,filterDelay:P,getDataSourceState:b,dataSourceApi:S,dataSourceActions:I,width:N,height:L,columnsMap:m})},[c,n,a,l,s,f,t,b,S,I,v,P,w]);return Bo.createElement(Go,{orientation:"horizontal",dragListId:"header",dragStrategy:"inline",onDrop:Bf,updatePosition:Bf},E=>Bo.createElement("div",{...E,...h,className:te(E.className,h.className)},Bo.createElement(pa,{name:"header",renderCell:x,brain:t,renderer:d,onRenderUpdater:p,cellHoverClassNames:NT,cellDetachedClassNames:ma})))}var Wf=Bo.memo(LT);function $f(o){let{headerBrain:e,bodyBrain:t,scrollbars:n}=o,{computedPinnedStartColumns:r,computedPinnedEndColumns:i,computedVisibleColumns:a,columnSize:l}=ne(C=>({computedPinnedStartColumns:C.computed.computedPinnedStartColumns,computedPinnedEndColumns:C.computed.computedPinnedEndColumns,computedVisibleColumns:C.computed.computedVisibleColumns,columnSize:C.computed.columnSize})),{columnHeaderHeight:s,columnGroupsDepthsMap:u,columnGroupsMaxDepth:c,computedColumnGroups:d,showColumnFilters:p}=ne(C=>({columnHeaderHeight:C.state.columnHeaderHeight,columnGroupsDepthsMap:C.state.columnGroupsDepthsMap,columnGroupsMaxDepth:C.state.columnGroupsMaxDepth,computedColumnGroups:C.state.computedColumnGroups,showColumnFilters:C.state.showColumnFilters})),f=!d||!Object.keys(d).length?1:c+2,m=f*s+(p?s:0),g=Gt.useMemo(()=>{if(!(!d||!Object.keys(d).length))return Of(a,d,u,c)},[a,d,u]),y=Gt.useCallback(({rowIndex:C,colIndex:R})=>{let v=a[R],P=1,w=1;if(!v||!g)return{rowspan:P,colspan:w};let x=g.pathsToCells.get([C,R]);if(!x)return{rowspan:P,colspan:w};if(x.type==="column")return{colspan:w,rowspan:f-x.depth};let E=x.columnItems.findIndex(M=>M.id===v.id);return{rowspan:P,colspan:E===0?x.columnItems.length:1}},[d,c,a,g,f,u]),h=Gt.useCallback(({rowIndex:C,colIndex:R})=>y({rowIndex:C,colIndex:R}).rowspan,[y]),b=Gt.useCallback(({rowIndex:C,colIndex:R})=>y({rowIndex:C,colIndex:R}).colspan,[y]),S=Gt.useCallback(C=>p?C<f-1?s:2*s:s,[f,p,s]);ga(e,{colWidth:l,rowHeight:S,rows:f,cols:a.length,height:m,rowspan:h,colspan:b},{fixedColsEnd:i.length,fixedColsStart:r.length});let I=Gt.createElement(Wf,{columns:a,headerBrain:e,bodyBrain:t,columnHeaderHeight:m,columnGroupsMaxDepth:c,columnAndGroupTreeInfo:g}),T=n.vertical&&No()?Gt.createElement("div",{className:ed,style:{zIndex:1e3,width:No()}}):null;return Gt.createElement("div",{className:`${us} ${rd}`,style:{height:m}},I,T)}var{ManagedComponentContextProvider:kT}=Ft({initSetupState:ef,forwardProps:tf,Context:Ss()});function Fs(o){let{getComputed:e,header:t,brain:n,headerBrain:r,wrapRowsHorizontally:i}=ne(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?ei.createElement(kT,{...o},ei.createElement($f,{wrapRowsHorizontally:!!i,bodyBrain:n,headerBrain:r,scrollbars:a})):null}function Uf(){return ei.useContext(Ss()).componentState}var zT=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||fo;return Me.createElement(s,{domProps:{className:Ki},onChange:u=>{if(l){u?r.treeApi.selectAll():r.treeApi.deselectAll();return}u?n.rowSelectionApi.selectAll():n.rowSelectionApi.deselectAll()},checked:i})},Yi=Me.createContext(null);var VT=Q(J.columnZIndexAtIndex),GT=Q(J.columnVisibilityAtIndex),Ls=Me.createElement("div",{className:wi[1]}),qf=Pi({"data-name":"","data-field":"","data-header-align":"","data-column-id":"","data-sort":"","data-sort-index":"",[Rt]:"",[$r]:""});function HT(o){let e=o.column,{allowColumnHideWhileDragging:t}=Uf(),{dataSourceStatePartialForHeaderCell:n,horizontalLayoutPageIndex:r,getDataSourceState:i,dataSourceApi:a,dataSourceActions:l,filterTypes:s,filterDelay:u}=o,{allRowsSelected:c,someRowsSelected:d,selectionMode:p}=n,{onDragItemPointerDown:f}=fn(),{api:m,getComputed:g,getState:y,actions:h,getDataSourceMasterContext:b,showColumnFilters:S,components:I,portalDOMRef:T,columnHeaderHeight:C,columnReorderDragColumnId:R,columnMenuVisibleForColumnId:v,columnReorderInPageIndex:P}=ne(V=>({api:V.api,getComputed:V.getComputed,getState:V.getState,actions:V.actions,getDataSourceMasterContext:V.getDataSourceMasterContext,showColumnFilters:V.state.showColumnFilters,components:V.state.components,portalDOMRef:V.state.portalDOMRef,columnHeaderHeight:V.state.columnHeaderHeight,columnReorderDragColumnId:V.state.columnReorderDragColumnId,columnMenuVisibleForColumnId:V.state.columnMenuVisibleForColumnId,columnReorderInPageIndex:V.state.columnReorderInPageIndex})),w=R===e.id,x=P!=null?r!==P:!1,{onResize:E,height:M,width:D,headerOptions:A,columnsMap:O}=o,N=e.computedSortInfo,L=e.header,F=(0,bo.useCallback)(V=>{k.current=V,o.domRef?.(V)},[o.domRef]),G=A.alwaysReserveSpaceForSortIcon,B=e.headerAlign??e.align,z=(typeof B=="function"?B({isHeader:!0,column:e}):B)??"start",U=(typeof e.verticalAlign=="function"?e.verticalAlign({isHeader:!0,column:e}):e.verticalAlign)??"center",K=gt(e,{actions:h,api:m,dataSourceActions:l,dataSourceApi:a,getComputed:g,getDataSourceState:i,getDataSourceMasterContext:b,getState:y}),q=K.isSortable(),re=q&&(e.computedSorted||G)?Me.createElement(qi,{index:e.computedMultiSort?e.computedSortIndex+1:void 0,style:{marginInlineStart:ge.spacing[2],marginInlineEnd:ge.spacing[2]},className:`${sn}__sort-icon ${td} ${nd({align:z})}`,direction:e.computedSorted?e.computedSortedAsc?1:-1:0}):null,de=e.computedFilterable&&e.computedFiltered?Me.createElement(kn,null):null,ae=e.headerCssEllipsis??e.cssEllipsis??!0,ce={reserveSpaceWhenHidden:z==="center",menuVisible:v===e.id,style:z==="end"?{marginInlineStart:`calc(${ge.components.HeaderCell.resizeHandleActiveAreaWidth} / 2)`,marginInlineEnd:ge.spacing[2]}:{marginInlineEnd:`calc(${ge.components.HeaderCell.resizeHandleActiveAreaWidth} / 2)`,marginInlineStart:ge.spacing[2]},domProps:{onMouseDown:V=>{V.stopPropagation(),K.toggleContextMenu(V.target)}}},le=e.components?.MenuIcon||I?.MenuIcon||Kr,X=Me.createElement(le,{...ce}),k=(0,bo.useRef)(null),Z={horizontalLayoutPageIndex:r,dragging:w,domRef:F,htmlElementRef:k,renderLocation:"column-header",column:e,columnsMap:O,columnSortInfo:N,columnFilterValue:e.computedFilterValue,filtered:e.computedFiltered,someRowsSelected:d,allRowsSelected:c,selectionMode:p,api:m,dataSourceApi:a,columnApi:K,renderBag:{sortIcon:re,filterIcon:de,menuIcon:X,menuIconProps:ce,selectionCheckBox:null,header:e.header&&typeof e.header!="function"?e.header:e.name}},Y=Z,$=Y.renderBag.header,ie=()=>{let V={...Z,renderBag:{...Z.renderBag}};if(e.renderSortIcon&&(V.renderBag.sortIcon=Me.createElement(zo,{render:e.renderSortIcon,renderParam:{...V,renderBag:{...V.renderBag}}})),e.renderFilterIcon&&(V.renderBag.filterIcon=Me.createElement(zo,{render:e.renderFilterIcon,renderParam:{...V,renderBag:{...V.renderBag}}})),typeof e.renderMenuIcon=="function"&&(V.renderBag.menuIcon=Me.createElement(zo,{render:je=>{if(typeof e.renderMenuIcon!="function")return null;let it=e.renderMenuIcon(je);return it?it.type===le||it.type===Kr?it:Me.createElement(le,{...ce},it):null},renderParam:{...V,renderBag:{...V.renderBag}}})),e.renderSelectionCheckBox&&p==="multi-row"){V.renderBag.selectionCheckBox=Me.createElement(zo,{render:zT,renderParam:{...V,renderBag:{...V.renderBag}}});let je=e.renderHeaderSelectionCheckBox??e.renderSelectionCheckBox;je&&je!==!0&&(V.renderBag.selectionCheckBox=Me.createElement(zo,{render:je,renderParam:{...V,renderBag:{...V.renderBag}}}))}L instanceof Function&&(V.renderBag.header=$=Me.createElement(zo,{render:L,renderParam:{...V,renderBag:{...V.renderBag}}}));let Ze=e.renderMenuIcon===!1?null:V.renderBag.menuIcon,_e=ae?Me.createElement("div",{className:Yt},V.renderBag.header):V.renderBag.header,me=Me.createElement(Me.Fragment,null,z==="center"?Ls:null,V.renderBag.selectionCheckBox,_e,V.renderBag.sortIcon,V.renderBag.filterIcon,z==="center"?Ls:null,z!=="center"?Ls:null,Ze);return e.renderHeader?Me.createElement(zo,{render:e.renderHeader,renderParam:{...V,renderBag:{...V.renderBag,all:me}}}):me};(0,bo.useEffect)(()=>{let V=null,Ze=k.current;return E&&Ze&&(V=En(Ze,E)),()=>{V?.()}},[k.current,o.onResize]);let fe={height:M};e.headerStyle&&(fe=typeof e.headerStyle=="function"?{...fe,...e.headerStyle(Y)||{}}:{...fe,...e.headerStyle});let pe=typeof e.headerClassName=="function"?e.headerClassName(Y):e.headerClassName,{onPointerDown:H,proxyPosition:_,dragColumnOutside:ue}=up({columnId:e.id,domRef:k,horizontalLayoutPageIndex:r,allowColumnHideOnDrag:t}),Se=null,Re=Yi.Provider,Ce={filtered:e.computedFiltered,verticalAlign:U,align:z},Fe=Me.useMemo(()=>{let V=Ze=>{m.setColumnFilter(e.id,Ze)};return u>0?Ot(V,{wait:u}):V},[u,e.id]),Oe=e.computedFilterType,Ye=s[Oe],nt=e.computedFilterable?e.computedFilterValue?.filter.operator??Ye?.defaultOperator:void 0,We=e.computedFilterable&&Ye?Ye.operators.find(V=>V.name===nt):void 0,rt=We?.components?.FilterEditor||Ye?.components?.FilterEditor||e.components?.FilterEditor||Hn,pt=Ye?.components?.FilterOperatorSwitch||e.components?.FilterOperatorSwitch,Ge=Hp(e,{horizontalLayoutPageIndex:r}),W=`var(${VT}-${e.computedVisibleIndex})`;fe.zIndex=W,fe.visibility=`var(${GT}-${e.computedVisibleIndex}, visible)`;let oe={"data-field":`${e.field||""}`,"data-column-id":e.id,[Rt]:e.id,[$r]:"header","data-header-align":z,"data-name":"HeaderCell","data-sort":e.computedSortedAsc?"asc":e.computedSortedDesc?"desc":"none","data-sort-index":`${e.computedSortIndex??-1}`},he=e.computedFilterable?Me.createElement(Sd,{horizontalLayoutPageIndex:r,filterEditor:rt,filterOperatorSwitch:pt??Td,operator:We,filterTypes:s,onChange:Fe,columnFilterType:Oe,columnLabel:e.field||e.name||e.id,columnFilterValue:e.computedFilterValue,columnHeaderHeight:C}):Me.createElement(Cd,null);Y.renderBag.filterEditor=he;let Ie=(0,bo.useCallback)(V=>{H(V),f(V)},[H,f]),Je=ie();return w&&_&&(Se=Me.createElement("div",{key:e.id,className:`${sn}Proxy ${Wc}`,style:{height:M,width:D,left:_.left??0,top:_.top??0}},Me.createElement("div",{className:jc({visible:ue})},Me.createElement(Jp,{size:16})),$),Se=(0,Yf.createPortal)(Se,T.current)),Me.createElement(Re,{value:Y},Me.createElement($i,{domRef:F,horizontalLayoutPageIndex:o.horizontalLayoutPageIndex,cellType:"header",column:e,...oe,"data-z-index":W,style:fe,width:D,onPointerDown:Ie,contentClassName:te(Bc(Ce),Sc[z]),contentStyle:S?{height:M/2}:void 0,className:te(sn,wc.none,q?yc.pointer:"",pe,Fi(e,[sn,mo],$c,{dragging:w,insideDisabledDraggingPage:x,align:z,verticalAlign:U,rowSelected:!1,cellSelected:!1,rowDisabled:!1,zebra:!1,rowActive:!1,firstRow:!0,firstRowInHorizontalLayoutPage:!0,treeNode:!1,groupCell:!1,groupRow:!1,rowExpanded:!1}),Kc),cssEllipsis:ae,afterChildren:Me.createElement(Me.Fragment,null,S?he:null,Ge),renderChildren:Je}),Se)}var jf=Me.memo(HT);function Er(){return(0,bo.useContext)(Yi)}var So=j(require("react")),Jf=require("react");function Xf(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 Zf={padding:ge.spacing[2],textAlign:"end",opacity:"1",visibility:"visible",display:"block",fontSize:"0.85rem",background:"white",color:"black"},KT={opacity:1,visibility:"visible",display:"inline-block",pointerEvents:"all",color:"black",textDecoration:"underline"},Qf=(o,e)=>{if(o)for(let[t,n]of Object.entries(e))o.style.setProperty(Xf(t),n,"important")},em=So.forwardRef(function(e,t){let{rootClassName:n}=Ri(),r=So.useRef(null),i=So.useCallback(a=>{r.current=a,t&&(typeof t=="function"?t(a):t.current=a)},[]);return(0,Jf.useEffect)(()=>{let a=()=>{setTimeout(()=>{Qf(r.current,Zf),Qf(r.current?.firstElementChild,KT)})};a();let l=setInterval(a,1e3);return()=>{clearInterval(l)}},[]),So.createElement("div",{ref:i,...e,className:te(`${n}-Footer`,Ed,e.className),style:Zf},"Powered by"," ",So.createElement("a",{href:"https://infinite-table.com",rel:"noopener noreferrer",role:"link",target:"_blank"},"Infinite Table"))});function ks(o){return o.map(to)}function to(o){if(xe().structuredClone)return xe().structuredClone(o);if(o===null||typeof o!="object")return o;if(Array.isArray(o))return ks(o);if(o instanceof Date)return new Date(o);if(o instanceof Set)return new Set(ks(Array.from(o)));if(o instanceof Map)return new Map(ks(Array.from(o)));let e={};for(let t in o)o.hasOwnProperty(t)&&(e[t]=to(o[t]));return e}function ti(o){return o}var bn=Object.seal({data:null,field:null});var jo="____root____",om="____not_loaded_yet____";function Wo(){return!1}function zs(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 ya(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 nm(o,e){let{marker:t,reducers:n={},pivot:r,groupBy:i,indexer:a,toPrimaryKey:l,cache:s,mappings:u}=o;t&&t.start();let c=new ee;function d(h,b,S,I=0,T=[]){let C=!S.length||I===S.length-1,R=b[u?.values||"values"]||{};for(let v in R)if(R.hasOwnProperty(v)){let P=v;T.push(P),p.set(T,!0),h.set(T,{reducerResults:R[v][u?.totals||"totals"]||{},items:[]}),C||d(h,R[v],S,I+1,T),T.pop()}}let p=r?new ee:void 0,f=[],m=zs(n),g=to(m);e.visitDepthFirst((h,b,S,I)=>{let[T,...C]=b,R=h.children,v=c.get(C);if(v&&(v.cache=h.cache,v.childrenLoading=h.childrenLoading,v.childrenAvailable=h.childrenAvailable,v.error=h.error),C.length==i.length&&i.length){if(v){v.items=R;for(let w=0,x=C.length;w<x;w++){let E=C.slice(0,w),M=c.get(E);M&&(M.items=M.items||[],M.items=M.items.concat(R))}R=a.indexArray(R,{toPrimaryKey:l,cache:s,nodesKey:void 0})}return I?.()}for(let P=0,w=R.length;P<w;P++){if(!R[P]){let D={items:[],reducerResults:{},cache:!1,childrenLoading:!1,childrenAvailable:!1,isTree:!1,isGroupBy:!0};c.set([...C,`${om}${P}`],D);continue}let x=R[P].data,E=R[P].keys||[];if(E.length){let D=E[E.length-1];C.push(D)}let M={items:[],cache:!1,childrenLoading:!1,childrenAvailable:!1,commonData:x,totalChildrenCount:R[P].totalChildrenCount,reducerResults:R[P].aggregations||{},isTree:!1,isGroupBy:!0};if(c.set(C,M),r){let D=M.pivotDeepMap=new ee,A=R[P].pivot;d(D,A,r,0,f)}E.length&&C.pop()}I?.()});let y={deepMap:c,groupParams:o,initialData:e,reducerResults:g};return r&&(y.topLevelPivotColumns=p,y.pivot=r),t&&t.end({details:[{name:"Group by fields",value:i.map(h=>h.field).join(", ")}]}),y}function tm(o,e,t,n,r,i,a,l,s,u=ti){let{items:c,reducerResults:d,pivotDeepMap:p}=o.get(e);if(c.push(n),a&&ya(n,r,a,d,e),i){for(let f=0,m=i.length;f<m;f++){let{field:g,valueGetter:y,toKey:h}=i[f],b=g?n[g]:null;y&&(bn.data=n,bn.field=g,b=y(bn));let S=(h||u)(b,n);t.push(S),p.has(t)||(l.set(t,!0),p?.set(t,{reducerResults:to(s),items:[]}));let{reducerResults:I,items:T}=p.get(t);T.push(n),a&&ya(n,r,a,I,e)}t.length=0}}function rm(o,e,t,n,r,i,a,l){let{isLeafNode:s,getNodeChildren:u,toKey:c}=o,d=c(r),p=[...n,d],f=s(r);if(t.set(p,!0),f){for(let h=0,b=n.length;h<=b;h++){let S=n.slice(0,h),I=e.get(S),{reducerResults:T,items:C}=I;C.push(r),I.leavesAvailableCount++,I.totalLeafNodesCount++,a&&ya(r,i,a,T,S)}return}let m=to(l),g=[];e.set(p,{items:g,isTree:!0,isGroupBy:!1,node:r,reducerResults:m,cache:!1,childrenLoading:!1,childrenAvailable:!0,totalLeafNodesCount:0,leavesAvailableCount:0,treeNesting:n.length});let y=u(r);if(!(!y||!Array.isArray(y))){for(let h=0,b=y.length;h<b;h++){let S=y[h];rm(o,e,t,p,S,h,a,l)}a&&oi(a,m,g)}}function Vs(o,e){let{reducers:t,marker:n}=o;if(n){let u=Object.keys(t??{});n.start({details:u.length>0?[{name:"Reducers",value:u.join(", ")}]:void 0})}let r=zs(t),i=to(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 u=0,c=e.length;u<c;u++)rm(o,a,l,[],e[u],u,t,r);t&&oi(t,i,e);let s={deepMap:a,treeParams:o,treePaths:l,initialData:e,reducerResults:i};return n&&n.end(),s}function Sa(o,e){let{marker:t,groupBy:n,defaultToKey:r=ti,pivot:i,reducers:a}=o;t&&t.start();let l=n.length,s=i?new ee:void 0,u=new ee,c=[],d=[],p=zs(a),f=to(p);if(!l){let g={items:[],isTree:!1,isGroupBy:!0,cache:!1,childrenLoading:!1,childrenAvailable:!1,reducerResults:to(p)};i&&(g.pivotDeepMap=new ee),u.set(c,g)}for(let g=0,y=e.length;g<y;g++){let h=e[g],b={};for(let S=0;S<l;S++){let{field:I,groupField:T,valueGetter:C,toKey:R}=n[S],v=I?h[I]:null;C&&(bn.data=h,bn.field=I,v=C(bn));let P=(R||r)(v,h);if(b[I||T]=P,c.push(P),!u.has(c)){let w={items:[],isTree:!1,isGroupBy:!0,cache:!1,commonData:{...b},childrenLoading:!1,childrenAvailable:!1,reducerResults:to(p)};i&&(w.pivotDeepMap=new ee),u.set(c,w)}tm(u,c,d,h,g,i,a,s,p,r)}l||tm(u,c,d,h,g,i,a,s,p,r),a&&ya(h,g,a,f,c),c.length=0}a&&(u.visitDepthFirst((g,y,h,b)=>{oi(a,g.reducerResults,g.items),i&&g.pivotDeepMap.visitDepthFirst(({items:S,reducerResults:I},T,C,R)=>{oi(a,I,S),R?.()}),b?.()}),oi(a,f,e));let m={deepMap:u,groupParams:o,initialData:e,reducerResults:f};return i&&(m.topLevelPivotColumns=s,m.pivot=i),t&&t.end({details:[{name:"Group by fields",value:n.map(g=>g.field).join(", ")}]}),m}function im(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 BT(o,e){let{groupBy:t,groupKeys:n,parents:r,reducers:i,lazyLoad:a}=o,l=n.length,{items:s,reducerResults:u,pivotDeepMap:c,commonData:d}=e,p=d??null,f;if(Object.keys(u).length>0){p={...d},f={};for(let b in i)if(i.hasOwnProperty(b)){let I=i[b].field;I&&(f[I]=u[b]),I&&p[I]==null&&(p[I]=u[b])}}let m=!0,g=n[n.length-1],y=g;if(p!=null){let b=t[n.length-1];b&&b.field&&(y=p[b.field]),b&&b.toKey&&(y=b.toKey(y,p)),y=y??g}return typeof y=="string"&&y.startsWith(om)&&(m=!1,y=null),{data:p,reducerData:f,groupCount:s.length,groupData:s,groupKeys:n,isTreeNode:!1,rowSelected:!1,selectedChildredCount:0,deselectedChildredCount:0,id:`${n}`,collapsed:!1,dataSourceHasGrouping:!0,rowDisabled:!1,isCellSelected:Wo,hasSelectedCells:Wo,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:y,rootGroupBy:t,groupBy:l===t.length?t:t.slice(0,l),isGroupRow:!0,pivotValuesMap:c,groupNesting:l,reducerResults:u}}function ba(o,e,t){return{...o,id:`duplicate_row_on_page_${t}_for__${o.id}`,indexInAll:e,duplicateOf:o.id}}function oi(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 am(o,e,t,n,r,i){let a=e.length,{isLeafNode:l,getNodeChildren:s}=r.treeParams,{toPrimaryKey:u,treeResult:c,isRowDisabled:d,isNodeSelected:p,withRowInfo:f,isNodeExpanded:m,treeSelectionState:g,repeatWrappedGroupRows:y,rowsPerPage:h}=r,{deepMap:b}=c,S=o.length,I=t[t.length-1],T=I?I.nodeExpanded:!0;for(let C=0;C<S;C++){let R=o[C],v=u(R,C),P=[...e,v];if(l(R)){let O={id:v,nodePath:P,isGroupRow:!1,data:R,treeNesting:a,totalLeafNodesCount:0,collapsedLeafNodesCount:0,isTreeNode:!0,isParentNode:!1,selfLoaded:!0,rowSelected:!1,rowDisabled:!1,isCellSelected:Wo,hasSelectedCells:Wo,dataSourceHasGrouping:!1,parentNodes:Array.from(t),indexInParentNodes:[...n,C],indexInParent:C,indexInAll:T?i.length:-1};p&&(O.rowSelected=p(O)),d&&(O.rowDisabled=d(O)),f&&f(O);let N=y&&h!=null&&h>0&&O.indexInAll%h===0?O.indexInAll/h:null;for(let L=0,F=t.length;L<F;L++){let G=t[L];if(T||(G.collapsedLeafNodesCount+=1),G.deepRowInfoArray.push(O),N!=null&&T){if(typeof y=="function"&&y(G)!==!0)continue;let B=ba(G,O.indexInAll,N);i[B.indexInAll]=B,O.indexInAll++}}T&&(i[O.indexInAll]=O);continue}let E=b.get(P)?.totalLeafNodesCount??0,M={dataSourceHasGrouping:!1,nodeExpanded:!1,selfExpanded:!1,nodePath:P,id:v,data:R,indexInAll:i.length,indexInParent:C,indexInParentNodes:[...n,C],totalLeafNodesCount:E,treeNesting:a,selfLoaded:!0,isParentNode:!0,isTreeNode:!0,isGroupRow:!1,deepRowInfoArray:[],parentNodes:Array.from(t),collapsedLeafNodesCount:0,rowSelected:!1,rowDisabled:!1,isCellSelected:Wo,hasSelectedCells:Wo,selectedLeafNodesCount:0,deselectedLeafNodesCount:0};if(p&&(M.rowSelected=p(M),g)){let O=g.getSelectionCountFor(M.nodePath);M.selectedLeafNodesCount=O.selectedCount,M.deselectedLeafNodesCount=O.deselectedCount}d&&(M.rowDisabled=d(M)),f&&f(M);let D=!0;if(m&&(M.selfExpanded=D=m(M)),T||(D=!1),M.nodeExpanded=D,T&&y&&h!=null&&h>0){let O=M.indexInAll,N=M.parentNodes;if(N.length>0&&O%h===0){let L=O/h,F=0;N.forEach(G=>{typeof y=="function"&&y(G)!==!0||(i.push(ba(G,O+F,L)),F++,M.indexInAll++)})}}T&&(i[M.indexInAll]=M);let A=s(R);Array.isArray(A)&&am(A,P,[...t,M],M.indexInParentNodes,r,i)}return i}function lm(o){let{dataArray:e,marker:t}=o;t&&t.start();let n=[];return am(e,[],[],[],o,n),t&&t.end(),{data:n}}function sm(o){let{marker:e,lazyLoad:t,groupResult:n,rowsPerPage:r,repeatWrappedGroupRows:i,withRowInfo:a,toPrimaryKey:l,groupRowsState:s,isRowDisabled:u,isRowSelected:c,rowSelectionState:d,generateGroupRows:p,reducers:f={}}=o,{groupParams:m,deepMap:g,pivot:y}=n,{groupBy:h}=m;e&&e.start({details:[{name:"Group by fields",value:h.map(C=>C.field).join(", ")}]});let b=[],S=[],I=[],T=[];return g.visitDepthFirst((C,R,v,P)=>{let w=C.items,x=R.length,E=s?.isGroupRowCollapsed(R)??!1;T.push(v);let M=BT({lazyLoad:t,groupBy:h,parents:Array.from(I),reducers:f,indexInGroup:v,indexInParentGroups:Array.from(T),indexInAll:b.length,groupKeys:R,error:C.error,totalChildrenCount:C.totalChildrenCount,childrenLoading:(C.childrenLoading||!E&&!C.childrenAvailable)&&t,childrenAvailable:C.childrenAvailable,directChildrenCount:R.length===h.length?C.items.length:g.getDirectChildrenSizeFor(R),directChildrenLoadedCount:0},C);if(c&&(M.rowSelected=c(M),d)){let L=d.getSelectionCountFor(M.groupKeys);M.selectedChildredCount=L.selectedCount,M.deselectedChildredCount=L.deselectedCount}u&&(M.rowDisabled=u(M));let D=I[I.length-1],A=D?.collapsed??!1;A&&(E=!0),M.collapsed=E;let O=p||E;if(A&&(O=!1),O){if(i&&r!=null&&r>0){let L=M.indexInAll,F=M.parents;if(F.length>0&&L%r===0){let G=L/r,B=0;F.forEach(z=>{typeof i=="function"&&i(z)!==!0||(b.push(ba(z,L+B,G)),B++,M.indexInAll++)})}}b.push(M),S.push(b.length-1)}M.collapsedChildrenCount=0,I.forEach(L=>{L.deepRowInfoArray.push(M),L.collapsedGroupsCount+=E?1:0}),D&&M.selfLoaded&&t&&(D.directChildrenLoadedCount+=1),a&&a(M),I.push(M);let N=!0;if(N){if(P)P();else if(!y){let L=b.length;E||(b.length+=w.length);let F=0;for(let G=0,B=w.length;G<B;G++){let z=w[G];if(!E&&i&&r!=null&&r>0){let re=L+G+F;if(re%r===0){let se=re/r;I.forEach(de=>{if(typeof i=="function"&&i(de)!==!0)return;let ae=L+G+F;b[ae]=ba(de,ae,se),F++,b.length++})}}let U=L+G+F,q={id:z?l(z,U):`${R}-${G}`,data:z,isCellSelected:Wo,hasSelectedCells:Wo,dataSourceHasGrouping:!0,isTreeNode:!1,isGroupRow:!1,selfLoaded:!!z,rowSelected:!1,rowDisabled:!1,rootGroupBy:h,collapsed:E,groupKeys:R,parents:Array.from(I),indexInParentGroups:[...T,G],indexInGroup:G,indexInAll:U,groupBy:h,groupNesting:x+1,groupCount:M.groupCount};c&&(q.rowSelected=c(q)),u&&(q.rowDisabled=u(q)),a&&a(q),I.forEach((re,se)=>{se===I.length-1&&z&&(re.directChildrenLoadedCount+=1),E&&(re.collapsedChildrenCount+=1),re.deepRowInfoArray.push(q)}),E||(b[L+G+F]=q)}}}I.pop(),T.pop()}),e&&e.end(),{data:b,groupRowsIndexes:S}}var Ta=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 ee(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 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 wt=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)}};function Ht(){let o=xe().performance?.now();return`${Date.now()}:${o}`}function Gs(...o){return(...t)=>{o.forEach(n=>{typeof n=="function"&&n(...t)})}}function Hs(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 Ks(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 um({deepMap:o,pivotBy:e,pivotTotalColumnPosition:t,pivotGrandTotalColumnPosition:n,reducers:r={},showSeparatePivotColumnForSingleAggregation:i=!1}){let a=e.length,l=Object.keys(r).map(f=>({...r[f],id:f}));l.length||(i=!0,n=!1,t=!1,l.push({id:"__empty-aggregation-reducer__",name:"-",initialValue:null,reducer:()=>null}));let s={},u={},c=ft(function(){l.forEach((f,m)=>{s[`total:${f.id}`]=Hs({header:`${f.name||f.id} total`,pivotBy:e,pivotColumn:!0,pivotTotalColumn:!0,pivotAggregator:f,pivotAggregatorIndex:m,pivotGroupKeys:[],pivotGroupKey:"",pivotIndex:-1,valueFormatter:({rowInfo:g})=>g.isGroupRow?g.reducerResults?.[f.id]:null})})});(!a&&t==="start"||n==="start")&&c();let d=!i&&l.length===1;return o.visitDepthFirst((f,m,g,y)=>{if(m=[...m],t==="end"&&y?.(),m.length===a){let h=e[m.length-1],S=m.slice(0,-1).join("/");if(!d){let I=S;S=m.join("/");let T=m[m.length-1];u[S]=Ks({header:`${T}`,columnGroup:I,pivotBy:e,pivotGroupKeys:m,pivotByAtIndex:h,pivotIndex:m.length-1,pivotGroupKey:T})}l.forEach((I,T)=>{let C=d?`${m[m.length-1]}`:I.name||I.id,R=Hs({pivotBy:e,pivotColumn:!0,pivotTotalColumn:!1,pivotAggregator:I,pivotAggregatorIndex:T,pivotGroupKeys:m,pivotGroupKey:m[m.length-1],pivotIndex:m.length-1,pivotByAtIndex:h,defaultSortable:!1,columnGroup:S,header:C,valueFormatter:({rowInfo:P})=>P.isGroupRow?P.pivotValuesMap?.get(m)?.reducerResults[I.id]:null}),v=`${I.id}:${m.join("/")}`;s[v]=R})}else{let h=m.join("/"),b=m.slice(0,-1);if(u[h]=Ks({columnGroup:b.length?b.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],I=b.length?b.join("/"):void 0;if(!d){let T=I;I=`total:${m.join("/")}`,u[I]=Ks({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,C)=>{let R=d?`${m[m.length-1]} total `:`${T.name||T.id} total`,v=Hs({columnGroup:I,header:R,pivotAggregator:T,pivotAggregatorIndex:C,pivotColumn:!0,pivotTotalColumn:!0,pivotGroupKeys:m,pivotGroupKey:m[m.length-1],pivotByAtIndex:S,pivotIndex:m.length-1,pivotBy:e,defaultSortable:!1,valueFormatter:({rowInfo:P})=>P.isGroupRow?P.pivotValuesMap?.get(m)?.reducerResults[T.id]:null});s[`total:${T.id}:${m.join("/")}`]=v})}}(t==="start"||t===!1)&&y?.()}),(!a&&t==="end"||n==="end")&&c(),{columns:s,columnGroups:u}}var WT=()=>{};function cm(o,e){let t=new ee,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 u=0;u<s.length;u++){let c=s.slice(0,u);t.has(c)||t.set(c,void 0)}t.set(s,l)}function a(l,s){let u=t.getKeysStartingWith(l,{excludeSelf:!0,depthLimit:1});for(let c of u){let d=[...l,c[c.length-1]],p=t.get(d),f=p?p[n]??[]:[];a(d,f),f.length&&(p||(p=typeof r=="function"?r(d,f):r),p[n]=f),s.push(p)}return s}return a([],[])}function dm(o,e,t,n){let{isLeafNode:r,getNodeChildren:i,toKey:a}=o,{onParentNode:l,onNode:s,onLeafNode:u}=e,c=a(n),d=[...t,c],p=r(n),f=ft(()=>{let m=i(n);if(!(!m||!Array.isArray(m)))for(let g=0,y=m.length;g<y;g++){let h=m[g];dm(o,e,d,h)}});p?(u?.(n),s?.(n,WT)):(l?.(n,f,i(n)),s?.(n,f))}function pm(o,e,t){for(let n=0,r=t.length;n<r;n++)dm(o,e,[],t[n])}var jT=function(o,e){return o-e},$T=function(o,e){return o=`${o}`,e=`${e}`,o.localeCompare(e)},UT=function(o,e){return o-e},YT={number:jT,string:$T,date:UT},$o=YT;function fm(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 oo=(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(mm(fm(o),n)),r&&r.end(),e},Ca=(o,e,t)=>{let{marker:n}=t;n&&n.start();let r=mm(fm(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,u=d=>d[l],c=d=>d[l]===void 0;return pm({isLeafNode:t.isLeafNode??c,getNodeChildren:t.getNodeChildren??u,toKey:s},{onParentNode:(d,p,f)=>{if(i&&p(),Array.isArray(f)){let m=a?f.sort(r):[...f].sort(r);d[l]=m}i||p()}},e),i&&(a?e.sort(r):e=[...e].sort(r)),n&&n.end(),e};oo.knownTypes=$o;var qT=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=oo.knownTypes[i],r||console.warn(`Unknown sort type "${o.type}" - please pass one of ${Object.keys(oo.knownTypes).join(", ")}`)}return r||(r=$o.string),(i,a)=>{let l=t?t(i):e?i[e]:i,s=t?t(a):e?a[e]:a,u=r(l,s);return u===0?u:n*u}},XT=o=>o.map(qT).filter(e=>e instanceof Function),mm=(o,e)=>{let t=XT(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}};function nr(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||ti)(l,o);return t.push(s),t},[])}var Ae=class o{constructor(e,t,n){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,n&&Object.assign(this,n),this.update(r)}getGroupKeysForPrimaryKey(e){let{indexer:t,groupBy:n}=this.getConfig(),r=t.getDataForPrimaryKey(e);return r?nr(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 u=this.isRowSelected(e)?{selectedCount:1,deselectedCount:0}:{selectedCount:0,deselectedCount:1};return this.selectionCountCache.set(e,u),u}if(r&&this.onlyUsePrimaryKeys){let u=this.getAllPrimaryKeysInsideGroup(e),c=0,d=0;u.forEach(f=>{if(this.defaultSelection){if(this.deselectedMap.has([f])){d++;return}c++}else{if(this.selectedMap.has([f])){c++;return}d++}});let p={selectedCount:c,deselectedCount:d};return this.selectionCountCache.set(e,p),p}t=t??this.getGroupRowBooleanSelectionStateFromParent(e);let i=this.getGroupKeysDirectlyInsideGroup(e);if(e.length===this.getGroupByLength()){let u=this.selectedMap.has(e)?!0:this.deselectedMap.has(e)?!1:t,c=this.getGroupCount(e),d=this.selectedMap.getKeysStartingWith(e,{excludeSelf:!0,depthLimit:1}).length,p=this.deselectedMap.getKeysStartingWith(e,{excludeSelf:!0,depthLimit:1}).length,f=c-(d+p),m={selectedCount:d+(u?f:0),deselectedCount:p+(u?0:f)};return this.selectionCountCache.set(e,m),m}let a=0,l=0;if(this.getConfig().lazyLoad&&!i.length){let u=this.getConfig().groupDeepMap?.get(e)?.totalChildrenCount||0;t?(a=u,l=this.deselectedMap.getAllChildrenSizeFor(e),l===u&&(a=0)):(l=u,a=this.selectedMap.getAllChildrenSizeFor(e),a===u&&(l=0))}i.forEach(u=>{let c=this.selectedMap.get(u),d=this.deselectedMap.get(u),p=c?!0:d?!1:t,{selectedCount:f,deselectedCount:m}=this.getSelectionCountFor(u,p);a+=f,l+=m});let s={selectedCount:a,deselectedCount:l};return this.selectionCountCache.set(e,s),s}};function Ia(o,e){return new Ae(o,ht(e))}function ht(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 gm(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 Ae))throw"Invalid row selection";let a=new Ae(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 Ae))throw"Invalid row selection";let a=new Ae(r,ht(e));a.deselectAll(),t.rowSelection=a},isRowSelected(r,i){let{rowSelection:a,selectionMode:l,indexer:s,groupBy:u}=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 Ae))throw"Invalid row selection";if(!i){let c=s.getDataForPrimaryKey(r);i=c?nr(c,u):[]}return a.isRowSelected(r,i)},isRowDeselected(r,i){return!this.isRowSelected(r,i)},selectRow(r,i){let{rowSelection:a,selectionMode:l,indexer:s,groupBy:u}=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 Ae))throw"Invalid row selection";if(!i){let d=s.getDataForPrimaryKey(r);i=d?nr(d,u):[]}let c=new Ae(a,ht(e));c.selectRow(r,i),t.rowSelection=c},deselectRow(r,i){let{selectionMode:a,rowSelection:l,indexer:s,groupBy:u}=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 Ae))throw"Invalid row selection";if(a==="multi-row"){if(!i){let d=s.getDataForPrimaryKey(r);i=d?nr(d,u):[]}let c=new Ae(l,ht(e));c.deselectRow(r,i),t.rowSelection=c}},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 Ae))throw"Invalid row selection";let s=new Ae(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 Ae))throw"Invalid row selection";let s=new Ae(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 Ae))throw"Invalid row selection";let s=new Ae(a,ht(e));s.toggleGroupRowSelection(r),t.rowSelection=s},getGroupRowSelectionState(r,i){let a=e(),{selectionMode:l,groupBy:s}=a,u=i?new Ae(i,ht(a)):a.rowSelection;if(l!=="multi-row")throw'Selection mode should be "multi-row"';if(!s)throw"No grouping specified";if(!(u instanceof Ae))throw"Invalid row selection";return u.getGroupRowSelectionState(r)},getSelectedPrimaryKeys:r=>{let i=e(),a=r?new Ae(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 u=i.toPrimaryKey(s);a.isRowSelected(u)&&l.push(u)}),l}}}var ZT="*",Ue=class{constructor(e){this.wildcard=ZT;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,n){let r=e===this.wildcard,i=t===this.wildcard;if(this.isCellSelected_Internal(e,t)===n)return;let l=[];if(r){let u=this.deselectedColumnsToRows.get(t),c=this.selectedColumnsToRows.get(t);u?.forEach(d=>{d!==this.wildcard&&this.setCellInDeselection(d,t,!1)}),c?.forEach(d=>{d!==this.wildcard&&this.setCellInSelection(d,t,!1)}),[...this.cache.keys()].forEach(d=>{let[p,f]=d;f===t&&l.push([p,t])})}if(i){let u=this.deselectedRowsToColumns.get(t),c=this.selectedRowsToColumns.get(t);u?.forEach(d=>{d!==this.wildcard&&this.setCellInDeselection(e,d,!1)}),c?.forEach(d=>{d!==this.wildcard&&this.setCellInSelection(e,d,!1)}),[...this.cache.keys()].forEach(d=>{let[p]=d;p===e&&l.push([e,t])})}let s=[e,t];if(l.forEach(u=>{this.cache.delete(u)}),this.cache.delete(s),n)if(this.defaultSelection){let u=this.deselectedRowsToColumns.get(e);u&&u.has(t)&&this.setCellInDeselection(e,t,!1);let c=this.deselectedRowsToColumns.get(this.wildcard),d=this.deselectedColumnsToRows.get(this.wildcard);(c?.has(t)||d?.has(e))&&this.setCellInSelection(e,t,!0)}else{let u=this.deselectedRowsToColumns.get(e);u&&u.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 c=this.selectedRowsToColumns.get(this.wildcard),d=this.selectedColumnsToRows.get(this.wildcard);if(c?.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){Do(`${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),u=this.deselectedRowsToColumns.get(this.wildcard),c=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)||u?.has(t)?this.selectedRowsToColumns.get(e)?.has(t)?l():a():l()}let f=this.selectedRowsToColumns.get(e);return f&&f.has(t)?l():c?.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 hm=Symbol("CLEAR"),Sn=class o{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,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=hm,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(hm);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 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:ee.clone(e.nodePathToData),n}};function Uo(o,e){return e().dataArray[o]}function Ra(o){return o().dataArray}var ut=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: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 QT=(o,e)=>o.length-e.length,ot=class o{constructor(e,t){this.selectedPaths=null;this.deselectedPaths=null;this.defaultSelection=!1;this.selectionMap=new ee;this.cache=new ee;this.strictMode=!1;let n=e instanceof Object.getPrototypeOf(this).constructor,r=n?e.getState():e;this.setConfig(t||(n?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 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 ee(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(QT);if(this.strictMode&&(l=l.filter(d=>this.isPathAvailable(d))),!l.length){if(i!==null){let p=r?i:!1;return this.cacheIt(e,{selected:p,selectedCount:p?r:0,deselectedCount:p?0:r,leafCount:r})}let d=this.getNodeBooleanSelectionStateFromParent(e);return this.cacheIt(e,{selected:d,selectedCount:d?r:0,deselectedCount:d?0:r,leafCount:r})}let s=0,u=0,c=this.getNodeBooleanSelectionStateFromParent(e);c?s+=r:u+=r;for(let d=0,p=l.length;d<p;d++){let f=l[d],{selectedCount:m,deselectedCount:g}=this.getSelectionStateForNode(f);if(c?(s-=g,u+=g):(u-=m,s+=m),t&&m>0&&g>0)return this.cacheIt(e,{selected:null,leafCount:r,selectedCount:s,deselectedCount:u})}if(!s&&!u)return this.cacheIt(e,{selected:c,selectedCount:c?r:0,deselectedCount:c?0:r,leafCount:r});if(s){let d=s===r?!0:null;return this.cacheIt(e,{selected:d,selectedCount:s,deselectedCount:u,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 va(o,e){return new ot(o,rr(e))}function rr(o){return()=>({treePaths:(typeof o=="function"?o():o).treePaths})}var wa=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 ot))throw"Invalid tree selection";let a=new ot(r,rr(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 ut({defaultExpanded:!0,collapsedPaths:[]});this.getState().lastExpandStateInfoRef.current={state:"expanded",nodePath:null},this.actions.treeExpandState=e}collapseAll(){let e=new ut({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 ut(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 ut(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 ut(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?Uo(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 ot))throw"Invalid node selection";let n=new ot(e,rr(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 ot))throw"Invalid node selection";let n=new ot(e,rr(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 ot))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 ir=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 vt=class extends ir{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 Bs=1e3;function ym(o){return new Ws(o)}var Ws=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=()=>Ra(this.getState);this.getRowInfoByIndex=e=>Uo(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?Bs:r;return isNaN(a)||(a=Bs),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 u=c=>t.position==="start"?[...e,...c||[]]:[...c||[],...e];return this.updateChildrenByNodePath(u,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 vt(n):new vt({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 vt({enabledRows:!0,disabledRows:[]});return}let t=new vt(e);t.enableAll(),this.actions.rowDisabledState=t};this.disableAllRows=()=>{let e=this.getState().rowDisabledState;if(!e){this.actions.rowDisabledState=new vt({disabledRows:!0,enabledRows:[]});return}let t=new vt(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 wa({...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?Sn.clone(t,{light:!0}):new Sn({nodesKey:n?r:void 0});e.forEach(a=>{switch(a.type){case"update":a.array.forEach((c,d)=>{if(a.primaryKeys){let p=a.primaryKeys[d],f=this.getDataByPrimaryKey(p);f&&i.update(a.primaryKeys[d],c,f,a.metadata)}else if(a.nodePaths){let p=this.getDataByNodePath(a.nodePaths[d]);p&&(typeof c=="function"?i.updateChildren(a.nodePaths[d],c,p,a.metadata):i.updateNodePath(a.nodePaths[d],c,p,a.metadata))}});break;case"delete":a.primaryKeys?a.primaryKeys.forEach(c=>{let d=this.getDataByPrimaryKey(c);d&&i.delete(c,d,a.metadata)}):a.nodePaths&&a.nodePaths.forEach(c=>{let d=this.getDataByNodePath(c);d&&i.deleteNodePath(c,d,a.metadata)});break;case"insert":let l=a.primaryKey,s=a.position,u=a.nodePath;u?a.array.forEach(c=>{i.insertNodePath([...u],c,s,a.metadata),l=this.toPrimaryKey(c),u.pop(),u.push(l),s="after"}):a.array.forEach(c=>{i.insert(l,c,s,a.metadata),l=this.toPrimaryKey(c),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??Bs,i=n.waitForNodePathPromises.get(e);if(i)return i.promise;let a=Date.now(),l=()=>{},s=new Promise(u=>{let c,d;l=p=>{clearTimeout(d),c=p,n.waitForNodePathPromises.delete(e),u(p)},d=setTimeout(()=>{c===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 bm(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:u,filterValue:c,aggregationReducers:d,nodesKey:p,isTree:f}=o;if(s&&s.length)if(l===!0)t=!0;else for(let m of s){let g=m.field;if(g&&(g=Array.isArray(g)?g:[g],t=g.reduce((y,h)=>y||typeof h!="function"?l.has(h):!1,!1),t))break}if(u&&u.length){if(l===!0)n=!0;else for(let m of u)if(m.field&&l.has(m.field)){n=!0;break}}if(f&&(l===!0?r=!0:r=l.has(p)),c&&c.length)if(l===!0)i=!0;else for(let m of c){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 Pa(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 Da(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 xa(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}var JT=qe("IT:InfiniteTable"),eC="#dc3545",tC="#eb9316";var Tm="Warn",Cm="Error",oC="Info",nC="Success",rC="Logs",Ma=JT.extend(rC),PL=Ma.extend(oC),iC=Ma.extend(Tm),aC=Ma.extend(Cm),DL=Ma.extend(nC);var lC=tC,sC=eC;var uC=(o,e)=>{e=e?e.extend?e.extend(Tm):e:iC,e(typeof e.color=="function"?e.color(lC,o):o)},cC=(o,e)=>{e=e?e.extend?e.extend(Cm):e:aC,e(typeof e.color=="function"?e.color(sC,o):o)};var Sm=new ee,Im=(o,...e)=>{Sm.has(e)||(Sm.set(e,!0),o())};var ar=(o,e=o,t)=>{Im(()=>uC(o,t),e,"warn")},Rm=(o,e=o,t)=>{Im(()=>cC(o,t),e,"error")};var js=new WeakMap,dC=o=>o;function wm(o,e=50,t){js.set(o,{lastCallTime:0,lastCallArg:null});let n=t??dC;return r=>{let{lastCallTime:i,lastCallArg:a}=js.get(o)||{lastCallTime:0,lastCallArg:null},l=Date.now(),s=l-i,u=St(n(a),n(r));s<e&&u||(js.set(o,{lastCallTime:l,lastCallArg:r}),o(r))}}var Ea=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 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 u=n&&!n.isEmpty();if(u&&(e=e.concat()),!e.length&&n){if(!n.isEmpty()){let c=[...n.getMutationsArray(),...n.getTreeMutationsArray()];for(let d=0,p=c.length;d<p;d++){let f=c[d];if(f.type==="insert"){let m=r(f.data);s?this.addNodePath([m],f.data,t):this.add(m,f.data),e.push(f.data)}}n?.removeInfo(void 0)}}else{let c=(d,p)=>{for(let f=0;f<d.length;f++){let m=d[f];u&&s&&Array.isArray(m[l])&&(m=d[f]={...m});let g=!1;if(m!=null){let y=r(m),h=s?[...p,y]:void 0,b=s&&!!h,S=b?n?.getMutationsForNodePath(h):n?.getMutationsForPrimaryKey(y);if(S&&S.length){for(let I=0,T=S.length;I<T;I++){let C=S[I];if(C.type==="delete"&&!g&&(b?this.removeNodePath(h,t):this.remove(y),g=!0,d.splice(f,1),f--),C.type==="update"&&!g&&(m={...m,...C.data},d[f]=m),C.type==="update-children"&&!g){let R=C.children(m[l],m);m={...m},R!==void 0?m[l]=R:delete m[l],d[f]=m}C.type==="insert"&&(C.position==="before"?(d.splice(f,0,C.data),f--):d.splice(f+1,0,C.data))}b?n?.removeNodePathInfo(h):n?.removeInfo(y)}if(!g)if(b){this.addNodePath(h,m);let I=a(m),T=I?null:i(m);!I&&Array.isArray(T)&&(p.push(y),u&&(m[l]=T=T.concat()),c(T,p),p.pop())}else this.add(y,m)}}};c(e,[])}return e}}};var pC=Object.freeze([]),vm=(o,e)=>{let t=o??pC,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 Aa(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(!Aa(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)||!Aa(o[r],e[r]))return!1;return!0}return!1}function fC(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 _a={id:!0,value:!0,indexInAll:!0,rowSelected:!0,rowDisabled:!0,isCellSelected:!1,hasSelectedCells:!1},Pm={..._a,dataSourceHasGrouping:!0,isTreeNode:!0,data:!1,isGroupRow:!0,selfLoaded:!0},mC={indexInGroup:!0,groupKeys:!0,groupBy:!0,rootGroupBy:!0,parents:!1,indexInParentGroups:!0,groupCount:!0,groupNesting:!0,collapsed:!0,selfLoaded:!0},gC={..._a,...mC,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},Dm={isTreeNode:!0,isParentNode:!0,indexInParent:!0,nodePath:!0,parentNodes:!1,indexInParentNodes:!0,totalLeafNodesCount:!0,collapsedLeafNodesCount:!0,treeNesting:!0,selfLoaded:!0},hC={..._a,...Dm,dataSourceHasGrouping:!0,isTreeNode:!0,isGroupRow:!0,isParentNode:!0,data:!1},yC={..._a,...Dm,dataSourceHasGrouping:!0,isParentNode:!0,isGroupRow:!0,nodeExpanded:!0,selfExpanded:!0,data:!1,selectedLeafNodesCount:!0,deepRowInfoArray:!1,deselectedLeafNodesCount:!0,duplicateOf:!1},bC=Object.entries(Pm).map(([o,e])=>e?o:void 0).filter(Boolean),SC=Object.entries(Pm).map(([o,e])=>e?o:void 0),TC=Object.entries(gC).map(([o,e])=>e?o:void 0),CC=Object.entries(hC).map(([o,e])=>e?o:void 0),IC=Object.entries(yC).map(([o,e])=>e?o:void 0);function RC(o,e){if(o===e)return!0;if(!o||!e||!fC(o,e)||o.id!==e.id||o.data!==e.data&&!Aa(o.data,e.data))return!1;let t=[];o.dataSourceHasGrouping?t=o.isGroupRow?TC:SC:o.isTreeNode?t=o.isTreeNode&&o.isParentNode?IC:CC:t=bC;for(let n of t){let r=o[n],i=e[n];if(!(typeof r=="function"||typeof i=="function")&&!Aa(r,i))return!1}return!0}function xm(){let o=[],e=new Map,t=(s,u)=>{let c=o,d=u?.marker;d&&d.start({details:[{name:"new dataArray length",value:s.length},{name:"old dataArray length",value:c.length}]});let p=[],f=i();for(let m of f){let g=c[m],y=s[m];if(y===void 0){p.push(m);continue}RC(g,y)||p.push(m)}o=s,p.length>0&&queueMicrotask(()=>{for(let m=0,g=p.length;m<g;m++){let y=p[m],h=e.get(y);if(h)for(let b of h)b()}}),d&&d.end({details:[{name:"updated row infos",value:p.length}]})},n=s=>o[s],r=(s,u)=>{let c=e.get(s);return c||(c=new Set,e.set(s,c)),c.add(u),()=>{let d=e.get(s);d&&(d.delete(u),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 To=new Map,Co=new Map,Yo=new Map,Io=new Map,no=new Map;var wC=Symbol("cursorId"),Mm=o=>o.totalLeafNodesCount===0,vC=o=>o.isParentNode?!Mm(o):!0;function Em(o){let e=Date.now(),t=[],n=[],r=new ee;return{logger:Nt(`${o.debugId}:DataSource`),debugTimings:new Map,debugWarnings:new Map,devToolsDetected:!!globalThis.__INFINITE_TABLE_DEVTOOLS_HOOK__,rowInfoStore:xm(),indexer:new Ea,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:be(),notifyScrollbarsChange:be(),notifyScrollStop:be(),notifyRenderRangeChange:be(),pivotTotalColumnPosition:"end",pivotGrandTotalColumnPosition:!1,scrollStopDelayUpdatedByTable:100,originalLazyGroupData:r,originalLazyGroupDataChangeDetect:0,originalDataArray:t,cursorId:wC,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 PC(o){let e={...o};return delete e.originalDataArray,e}var DC=[],Am=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()},_m=(o,e)=>({onDataParamsChange:t=>t?wm(t,100,PC):void 0,lazyLoad:t=>!!t,isNodeReadOnly:t=>t??Mm,isNodeSelectable:t=>t??vC,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=>({...Fo,...t}),sortTypes:t=>({...$o,...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 vt)return t;let n=o.propsCache.get("rowDisabledState")??Kt,r=n.get(t);return r||(r=new vt(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=>vm(t,o.propsCache.get("sortInfo")),groupBy:t=>t??DC});function xC(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 MC(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 EC={selectedPaths:[],deselectedPaths:[],defaultSelection:!1};function Om(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.
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
`);let n=
|
|
4
|
+
`);let n=rr(t);if(o instanceof ot)return o.setConfig(n),o;(o==null||typeof o!="object")&&(o=void 0);let r=o??EC,i=Kt.get(r);return i&&i.setConfig(n),i=i??new ot(r,n),Kt.set(r,i),i}function Nm(o){let{props:e,state:t,oldState:n}=o,r=!!t.nodesKey,i=Dr(e.sortInfo),a=Dr(e.filterValue),{filterTypes:l}=t,s=Object.keys(l).reduce((D,A)=>{let O=l[A].operators;D[A]=D[A]||{};let N=D[A];return O.forEach(L=>{N[L.name]=L}),D},{}),u=e,c=e.selectionMode;if(c===void 0)if(e.cellSelection!==void 0||e.defaultCellSelection!==void 0)c="multi-cell";else{let D=e.rowSelection!==void 0?e.rowSelection:e.defaultRowSelection;if(D!==void 0&&(D&&typeof D=="object"?c="multi-row":c="single-row"),!c){let A=u.treeSelection??u.defaultTreeSelection;A!==void 0&&(c=typeof A=="object"?"multi-row":"single-row")}c=c??!1}let d=null,p=null,f=e.rowSelection!==void 0?e.rowSelection:t.rowSelection===void 0?e.defaultRowSelection!==void 0?e.defaultRowSelection:null:t.rowSelection,m=e.cellSelection!==void 0?e.cellSelection:t.cellSelection===void 0?e.defaultCellSelection!==void 0?e.defaultCellSelection:null:t.cellSelection||null;if(!r&&(c!==!1&&(c==="single-row"||c==="multi-row")&&(f===null?d=c==="single-row"?null:new Ae({selectedRows:[],deselectedRows:[],defaultSelection:!1},ht(t)):c==="single-row"||f instanceof Ae?d=f:d=new Ae(f,ht(t))),c==="single-cell"||c==="multi-cell"))if(m===null)p=c==="single-cell"?null:new Ue;else if(m instanceof Ue)p=m;else{let D=Kt.get(m)??new Ue(m);Kt.set(m,D),p=D}let g=t.primaryKey,y=typeof g=="function"?D=>g(D):D=>D[g],h=u.treeExpandState||t.treeExpandState||u.defaultTreeExpandState;if(h&&!(h instanceof ut)){let D=Kt.get(h)??new ut(h);Kt.set(h,D),h=D}h=h||new ut({defaultExpanded:!0,collapsedPaths:[]});let b=e.groupRowsState||t.groupRowsState||e.defaultGroupRowsState;if(b&&!(b instanceof wt)){let D=Kt.get(b)??new wt(b);Kt.set(b,D),b=D}b=b||new wt(t.lazyLoad?{expandedRows:[],collapsedRows:!0}:{expandedRows:!0,collapsedRows:[]});let S=MC(e.shouldReloadData||{}),I=e.groupMode??(S.groupBy!=null?S.groupBy?"remote":"local":void 0),T=e.sortMode??S.sortInfo!=null?S.sortInfo?"remote":"local":void 0,C=e.filterMode??S.filterValue!=null?S.filterValue?"remote":"local":void 0;e.groupMode&&ar('"groupMode" prop is deprecated for the <DataSource />, use "shouldReloadData.groupBy: true|false" instead',"groupMode deprecated",t.logger),e.sortMode&&ar('"sortMode" prop is deprecated for the <DataSource />, use "shouldReloadData.sortInfo: true|false" instead',"sortMode deprecated",t.logger),e.filterMode&&ar('"filterMode" prop is deprecated for the <DataSource />, use "shouldReloadData.filterValue: true|false" instead',"filterMode deprecated",t.logger);let R=typeof e.data=="function"?I??"local":"local",v=e.sortFunction?"local":T??(i?"remote":"local"),P=typeof e.filterFunction=="function"||typeof e.treeFilterFunction=="function"?"local":C??(typeof e.data=="function"?"remote":"local"),w=S.pivotBy?"remote":"local",x=t.rowDisabledState,E=e.isRowDisabled;if(!E&&x){let D=Kt.get(x);D?E=D:(E=A=>x.isRowDisabled(A.id),Kt.set(x,E))}let M={debugId:t.debugId??e.debugId,isTree:r,selectionMode:c,groupRowsState:b,treeExpandState:h,treeExpandMode:h.mode,shouldReloadData:{filterValue:S?.filterValue??P==="remote",sortInfo:S?.sortInfo??v==="remote",groupBy:S?.groupBy??R==="remote",pivotBy:S?.pivotBy??w==="remote"},isRowDisabled:E,rowSelection:d,cellSelection:p,groupMode:R,sortMode:v,filterMode:P,pivotMode:w,toPrimaryKey:y,operatorsByFilterType:s,controlledSort:i,controlledFilter:a,multiSort:Array.isArray(i?e.sortInfo:e.defaultSortInfo),lazyLoadBatchSize:typeof e.lazyLoad=="object"?e.lazyLoad.batchSize:void 0};if(e.livePagination){let D=!n||n.originalDataArray!==t.originalDataArray,A=typeof e.livePaginationCursor=="function"?D?xC(e.livePaginationCursor,t):t.livePaginationCursor:e.livePaginationCursor;M.livePaginationCursor=A}if(t.devToolsDetected&&t.debugId){let D=Co.get(t.debugId);D&&(M={...M,...D})}return M}var AC=Nt("DataSource:fullLazyLoad");function Fm(o,e,t){let{name:n,newValue:r}=o;n==="data"&&typeof r=="function"&&!e.groupRowsState&&(e.lazyLoad&&AC('"data" function prop has changed'),e.collapseGroupRowsOnDataFunctionChange!==!1&&(t.groupRowsState=new wt({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 Ue?o.getState().selectedCells:null,"single-cell"]}:{callbackParams:[o.getState(),"multi-cell"]}}}function km(){return{sortInfo:(o,{actions:e,state:t})=>{let n=t.getDataSourceMasterContextRef.current,r=Bt(t,{sortInfo:o,livePaginationCursor:null},n());e.dataParams=r,t.livePagination&&Ve(()=>{e.livePaginationCursor=null})},groupBy:(o,{actions:e,state:t})=>{let n=t.getDataSourceMasterContextRef.current,r=Bt(t,{groupBy:o,livePaginationCursor:null},n());e.dataParams=r,t.livePagination&&Ve(()=>{e.livePaginationCursor=null})},pivotBy:(o,{actions:e,state:t})=>{let n=t.getDataSourceMasterContextRef.current,r=Bt(t,{pivotBy:o,livePaginationCursor:null},n());e.dataParams=r,t.livePagination&&Ve(()=>{e.livePaginationCursor=null})},filterValue:(o,{actions:e,state:t})=>{let n=t.getDataSourceMasterContextRef.current,r=Bt(t,{filterValue:o,livePaginationCursor:null},n());e.dataParams=r,t.livePagination&&Ve(()=>{e.livePaginationCursor=null})},cursorId:(o,{actions:e,state:t})=>{let n=t.getDataSourceMasterContextRef.current,r=Bt(t,{__cursorId:o},n());e.dataParams=r},livePaginationCursor:(o,{actions:e,state:t})=>{let n=t.getDataSourceMasterContextRef.current,r=Bt(t,{livePaginationCursor:o},n());e.dataParams=r},dataParams:(o,{state:e})=>St(o,e.dataParams,new Set(["changes","originalDataArray","masterRowInfo"]))?!1:(Nt(Ko(e.debugId,"DataSource:dataParams"))("onDataParamsChange triggered because the following values have changed",o?.changes),!0)}}function zm(o){return{originalDataArray:o.originalDataArray,groupRowsState:o.groupRowsState,groupBy:o.groupBy,pivotBy:o.pivotBy,sortInfo:o.sortInfo,filterValue:o.filterValue,livePaginationCursor:o.livePaginationCursor}}var _C="group-by",Vm="group-by-";function Gm(o){let e=o.map(t=>t.valueGetter?n=>t.valueGetter({data:n,field:t.field}):t.field??t.groupField).filter(Boolean);if(e.length)return e.length===1&&typeof e[0]!="function"?e[0]:e}function Oa(o,e){if(!o?.length||!e?.length)return o;let t=!1,n=o.map(r=>{if(r.field!=null||!r.id)return r;if(r.id===_C){let i=Gm(e);return i==null?r:(t=!0,{...r,field:i})}if(r.id.startsWith(Vm)){let i=r.id.slice(Vm.length),a=e.find(s=>String(s.field)===i||s.groupField===i);if(!a)return r;let l=Gm([a]);return l==null?r:(t=!0,{...r,field:l})}return r});return t?n:o}function Hm(o){return"groupNesting"in o?o.groupNesting??0:0}function Km(o,e){if(!(!o.isGroupRow||!e.reducerId))return e.pivotTotalColumn&&(!e.pivotGroupKeys||e.pivotGroupKeys.length===0)?o.reducerResults?.[e.reducerId]:o.pivotValuesMap?.get(e.pivotGroupKeys)?.reducerResults?.[e.reducerId]}function OC(o,e,t,n){if(o==null&&e==null)return 0;if(o==null)return 1;if(e==null)return-1;let r=Array.isArray(t.type)?t.type[0]:t.type,a=(t.fn||r&&n[r]||n.string||$o.string)(o,e);return a===0?0:t.dir*a}function NC(o,e){if(!o?.length||!e)return[];let t=[];for(let n of o){let r=n.id?e[n.id]:void 0;!r?.pivotColumn||!r.pivotAggregator||t.push({dir:n.dir,type:n.type,fn:n.fn,pivotGroupKeys:r.pivotGroupKeys??[],reducerId:r.pivotAggregator.id,pivotTotalColumn:!!r.pivotTotalColumn})}return t}function FC(o){let e=[],t=[];for(let n of o){let r={row:n,children:[]},i=Hm(n);for(;t.length&&Hm(t[t.length-1].row)>=i;)t.pop();t.length?t[t.length-1].children.push(r):e.push(r),t.push(r)}return e}function LC(o){let e=[],t=(n,r)=>{n.forEach((i,a)=>{let l=[...r,a],s=i.row;s.indexInGroup=a,s.indexInParentGroups=l,s.indexInAll=e.length,e.push(s),t(i.children,l)})};return t(o,[]),e}function Bm(o,e,t,n){let r=NC(e,t);if(!r.length||!o.length)return o;let i={...$o,...n},a=FC(o),l=(u,c)=>{for(let d of r){let p=OC(Km(u.row,d),Km(c.row,d),d,i);if(p!==0)return p}return 0},s=u=>{u.sort(l);for(let c of u)s(c.children)};return s(a),LC(a)}function Us(o,e){return o&&o.filter(t=>{let n=e[t.filter.type];return!(!n||n.emptyValues&&n.emptyValues.includes(t.filter.value))})}var ro=(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 $s(){return!1}function kC(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:$s,hasSelectedCells:$s};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 zC=ft(()=>{console.warn(`Your "treeFilterFunction" should NOT MUTATE the data object. You're probably mutating the node children.
|
|
5
5
|
|
|
6
6
|
Your filtering function probably looks like this:
|
|
7
7
|
|
|
@@ -13,18 +13,18 @@ function treeFilterFunction({ data }) {
|
|
|
13
13
|
|
|
14
14
|
Make sure you avoid mutations.
|
|
15
15
|
|
|
16
|
-
`)});function km(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=km({...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],p=r(d),f=t({data:d,index:c,dataArray:e,primaryKey:n(d,c),filterTreeNode:s});f&&(f===!0?f=d:typeof f=="object"&&f===d&&p!==r(f)&&RC(),l.push(f))}return l}function $s(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((p,f,m)=>r({data:p,index:f,dataArray:m,primaryKey:i(p,f)}))),a&&(u=km({...o,treeFilterFunction:a,getNodeChildren:l,nodesKey:s,isLeafNode:c}));let d=js(o.filterValue,e)||[];if(d&&d.length){let p=u.filter((f,m,g)=>{let b={data:f,index:m,dataArray:g,primaryKey:i(f,m),field:void 0};for(let h=0,y=d.length;h<y;h++){let S=d[h],{disabled:T,field:C,valueGetter:I,filter:{type:R,value:v,operator:P}}=S,w=e[R];if(T||!w)continue;let x=n[R]?.[P];if(!x)continue;let M=I||w.valueGetter||(({data:A,field:O})=>O?A[O]:A);b.field=C;let D=b;if(D.filterValue=v,D.currentValue=M(D),D.emptyValues=w.emptyValues,!x.fn(D))return!1}return!0});return t?.end({details:[{name:"Count after",value:p.length}]}),p}return t?.end({details:[{name:"Count after",value:u.length}]}),u}function zm(o){let e,{state:t,previousState:n}=o,r=t.debugId,i;r&&(i=nt(r).track.DataSource.label.PrepareData.start());let a=hm(t),l=t.sortInfo,s=t.sortMode,c=l?.length?s==="local":!1;(t.lazyLoad||t.livePagination)&&(c=!1);let u=ro(n,t,["refetchKey"]),d=ro(n,t,["cache","originalDataArray","originalLazyGroupDataChangeDetect"]);Array.isArray(t.data)&&u&&(d=!0),!1&&(t.originalLazyGroupData=new ee,d=!0);let f=t.cache?bn.clone(t.cache):void 0;f&&!f.isEmpty()&&(d=!0);let m=t.toPrimaryKey,g=t.nodesKey,b=t.isTree,h=g?_=>_[g]:void 0,y=g?_=>_[g]===void 0:void 0,S,T;d&&(t.indexer.clear(),t.lazyLoad||(S=f?.getMutations(),T=f?.getTreeMutations(),t.originalDataArray=t.indexer.indexArray(t.originalDataArray,{toPrimaryKey:m,cache:f,getNodeChildren:h,isLeafNode:y,nodesKey:g}),b&&t.waitForNodePathPromises.visit(({value:_},de)=>{_&&t.indexer.getDataForNodePath(de)!==void 0&&_.resolve(!0)}))),f&&(f.clear(),t.cache=void 0);let{filterFunction:I,treeFilterFunction:R,filterValue:v,filterTypes:P,operatorsByFilterType:w}=t,x=!!I||!!R||Array.isArray(v)&&v.length,E=x&&t.filterMode==="local",M=ro(n,t,["filterFunction","treeFilterFunction","filterValue","filterTypes"]),D=d||M,A=ro(n,t,["sortInfo"]),O=d||M||A,N=t.filterMode==="local"&&(D||!t.lastFilterDataArray),k=c&&(O||!t.lastSortDataArray||a.sortInfo),F=t.groupBy,V=t.pivotBy,j=!b&&(F.length>0||!!V),L=b,U=ro(n,t,["rowDisabledState","isRowDisabled"]),H=ro(n,t,["rowSelection","cellSelection","isRowSelected","originalLazyGroupDataChangeDetect"]),q=ro(n,t,["treeSelection","cellSelection","isNodeSelected","originalLazyGroupDataChangeDetect"]),ne=d||O||ro(n,t,["generateGroupRows","originalLazyGroupData","originalLazyGroupDataChangeDetect","groupBy","groupRowsState","pivotBy","aggregationReducers","pivotTotalColumnPosition","pivotGrandTotalColumnPosition","showSeparatePivotColumnForSingleAggregation","repeatWrappedGroupRows","rowsPerPage"]),se=d||O||ro(n,t,["originalLazyGroupData","originalLazyGroupDataChangeDetect","treeExpandState","isNodeExpanded","isNodeCollapsed","aggregationReducers","repeatWrappedGroupRows","rowsPerPage"]),me=ro(n,t,["rowInfoReducers"]),ie=j&&(ne||!t.lastGroupDataArray||a.groupBy)||H||U||me,ue=L&&(se||a.tree||!t.lastTreeDataArray)||q||U||me,ce=Date.now(),Y=t.originalDataArray;if(L&&ue){let _={marker:r?nt(r).track.DataSource.label.TreeUnfilteredTreePaths.start():void 0,isLeafNode:y,getNodeChildren:h,toKey:m};t.unfilteredTreePaths=ks(_,Y).treePaths}if(x||(t.unfilteredCount=Y.length),E){t.unfilteredCount=Y.length;let _=ce;N?(t.devToolsDetected&&(_=Date.now()),Y=$s({marker:r?nt(r).track.DataSource.label.Filter.start():void 0,getNodeChildren:h,isLeafNode:y,nodesKey:g,treeFilterFunction:R,dataArray:Y,toPrimaryKey:m,filterTypes:P,operatorsByFilterType:w,filterFunction:I,filterValue:v}),t.devToolsDetected&&t.debugTimings.set("filter",Date.now()-_)):Y=t.lastFilterDataArray,t.lastFilterDataArray=Y,t.filteredAt=ce}if(t.filteredCount=Y.length,t.postFilterDataArray=Y,c){let _=oo.knownTypes;if(oo.knownTypes={..._,...t.sortTypes},k){let de=ce;if(t.devToolsDetected&&(de=Date.now()),r&&(e=nt(r).track.DataSource.label.Sort.start({details:[{name:"Count",value:Y.length}]})),t.sortFunction?(Y=t.sortFunction(l,[...Y]),e&&(e.end(),e=void 0)):b?Y=Sa(l,Y,{marker:e,inplace:!1,isLeafNode:y,getNodeChildren:h,toKey:m,nodesKey:g}):Y=oo(l,[...Y],{marker:e}),r&&(e?.end(),e=void 0),t.devToolsDetected){let Te=Date.now()-de;t.debugTimings.set("sort",Te)}}else Y=t.lastSortDataArray;oo.knownTypes=_,t.lastSortDataArray=Y,t.sortedAt=ce}t.postSortDataArray=Y;let z=t.dataArray,$=t.rowSelection instanceof _e?t.rowSelection:void 0,X=t.treeExpandState instanceof st?t.treeExpandState:void 0,W=t.cellSelection instanceof $e?t.cellSelection:void 0;$?.xcache();let re=t.selectionMode==="single-row"?_=>_.id===t.rowSelection:t.selectionMode==="multi-row"?_=>{let de=$;return _.isGroupRow?de.getGroupRowSelectionState(_.groupKeys):de.isRowSelected(_.id,_.dataSourceHasGrouping?_.groupKeys:void 0)}:void 0,he=t.isRowDisabled||Ws;t.isRowSelected&&t.selectionMode==="multi-row"&&(re=_=>t.isRowSelected(_,$,t.selectionMode));let be;t.isNodeExpanded&&(be=_=>t.isNodeExpanded(_,X)),t.isNodeCollapsed&&(be=_=>!t.isNodeExpanded(_,X)),be||(be=de=>X.isNodeExpanded(de.nodePath));let G=t.rowInfoReducers;if(j){if(ie){let _=ce;t.devToolsDetected&&(_=Date.now());let de=t.aggregationReducers,Te=t.lazyLoad?tm({groupBy:F,pivot:V,mappings:t.pivotMappings,reducers:de,indexer:t.indexer,toPrimaryKey:m,cache:f,marker:r?nt(r).track.DataSource.label.LazyGroup.start():void 0},t.originalLazyGroupData):ba({groupBy:F,pivot:V,reducers:de,marker:r?nt(r).track.DataSource.label.Group.start():void 0},Y);t.groupDeepMap=Te.deepMap,$&&($.getConfig=gt(t));let xe=Object.keys(G||{}),Ce=wa(G),Ne={reducers:G,results:Ce,reducerKeys:xe,rowInfo:{}},Le=Ce?it=>{Ne.rowInfo=it,va(Ne)}:void 0,He=W?it=>{it.isCellSelected=K=>W.isCellSelected(it.id,K)}:void 0,tt=Le||He?zs(Le,He):void 0,Xe=am({marker:r?nt(r).track.DataSource.label.FlattenTree.start():void 0,groupResult:Te,lazyLoad:!!t.lazyLoad,reducers:de,toPrimaryKey:m,isRowSelected:re,rowSelectionState:$,withRowInfo:tt,repeatWrappedGroupRows:t.rowsPerPage!=null?t.repeatWrappedGroupRows:!1,rowsPerPage:t.rowsPerPage,groupRowsState:t.groupRowsState,generateGroupRows:t.generateGroupRows});z=Xe.data,t.rowInfoReducerResults=Pa({reducers:G,results:Ce,array:z}),t.groupRowsIndexesInDataArray=Xe.groupRowsIndexes,t.reducerResults=Te.reducerResults;let ot=V?lm({deepMap:Te.topLevelPivotColumns,pivotBy:V,pivotTotalColumnPosition:t.pivotTotalColumnPosition??"end",pivotGrandTotalColumnPosition:t.pivotGrandTotalColumnPosition??!1,reducers:t.aggregationReducers,showSeparatePivotColumnForSingleAggregation:t.showSeparatePivotColumnForSingleAggregation}):void 0;t.pivotColumns=ot?.columns,t.pivotColumnGroups=ot?.columnGroups,t.devToolsDetected&&t.debugTimings.set("group-and-pivot",Date.now()-_)}else z=t.lastGroupDataArray;t.lastGroupDataArray=z,t.groupedAt=ce}else if(L){if(ue){let _=ce;t.devToolsDetected&&(_=Date.now());let de=t.aggregationReducers,Te={marker:r?nt(r).track.DataSource.label.Tree.start():void 0,isLeafNode:y,getNodeChildren:h,toKey:m,reducers:de},xe=ks(Te,Y);t.treeDeepMap=xe.deepMap,t.treePaths=xe.treePaths;let Ce=t.selectionMode==="multi-row"?Am(t.treeSelection,t.selectionMode,t):void 0;t.treeSelectionState=Ce;let Ne=Object.keys(G||{}),Le=wa(G),He={reducers:G,results:Le,reducerKeys:Ne,rowInfo:{}},tt=Le?fe=>{He.rowInfo=fe,va(He)}:void 0,Xe=W?fe=>{fe.isCellSelected=Se=>W.isCellSelected(fe.id,Se)}:void 0,ot=tt||Xe?zs(tt,Xe):void 0,it=t.selectionMode==="single-row"?fe=>fe.id===t.treeSelection:t.selectionMode==="multi-row"?fe=>Ce.isNodeSelected(fe.nodePath):void 0,K=t.rowsPerPage!=null?t.repeatWrappedGroupRows:!1;z=im({marker:r?nt(r).track.DataSource.label.FlattenTree.start():void 0,treeResult:xe,treeParams:Te,dataArray:Y,reducers:de,toPrimaryKey:m,isNodeSelected:it,isNodeExpanded:be,treeSelectionState:Ce,withRowInfo:ot,repeatWrappedGroupRows:K,rowsPerPage:t.rowsPerPage}).data,t.rowInfoReducerResults=Pa({reducers:G,results:Le,array:z}),t.reducerResults=xe.reducerResults,t.totalLeafNodesCount=xe.deepMap.get([])?.totalLeafNodesCount??0,t.treeAt=ce,t.devToolsDetected&&t.debugTimings.set("tree",Date.now()-_)}else z=t.lastTreeDataArray;t.lastTreeDataArray=z}else if(t.groupDeepMap=void 0,t.pivotColumns=void 0,t.groupRowsIndexesInDataArray=void 0,n.postSortDataArray!=t.postSortDataArray||ne||H||U||me){let de=Object.keys(G||{}),Te=wa(G),xe={reducers:G,results:Te,reducerKeys:de,rowInfo:{}};z=Y.map((Ce,Ne)=>{let Le=IC(Ce,Ce?m(Ce):Ne,Ne,re,he,W);return Te&&(xe.rowInfo=Le,va(xe)),Le}),t.rowInfoReducerResults=Pa({reducers:G,results:Te,array:z})}if(t.postGroupDataArray=z,z!==t.dataArray&&(t.updatedAt=ce),t.dataArray=z,t.reducedAt=ce,t.selectionMode==="multi-row")if(j&&t.lazyLoad){r&&(e=nt(r).track.DataSource.label.ComputeSelectionCountLazy.start());let _=!0,de=!1;t.dataArray.forEach(Te=>{if(!Te.isTreeNode&&Te.isGroupRow&&Te.groupKeys.length===1){let{rowSelected:xe}=Te;xe!==!0&&(_=!1),(xe===!0||xe===null)&&(de=!0)}}),t.allRowsSelected=_,t.someRowsSelected=de,r&&(e?.end(),e=void 0)}else{r&&(e=nt(r).track.DataSource.label.ComputeSelectionCount.start());let _=t.isTree?t.totalLeafNodesCount:t.filteredCount,de=t.isTree?t.treeSelectionState?t.treeSelectionState.getSelectedCount():0:t.rowSelection.getSelectedCount();t.allRowsSelected=_===de,t.someRowsSelected=de>0,r&&(e?.end(),e=void 0)}return t.originalDataArrayChanged=d,d&&(t.originalDataArrayChangedInfo={timestamp:ce,mutations:S?.size?S:void 0,treeMutations:T?.size?T:void 0}),t.rowInfoStore.notifyDataArray(z,{marker:r?nt(r).track.DataSource.label.DiffRowInfoInStore:void 0}),i&&i?.track.DataSource.label.PrepareData.end({details:[N||k||ie||ue?{name:"Performed operations",value:[N?"filter":null,k?"sort":null,ie?"group":null,ue?"tree":null].filter(Mo).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(Mo)}),t}var Vm=!0,wC={originalDataArray:!0,changes:!0},vC={filterValue:(o,e)=>JSON.stringify(o)===JSON.stringify(e),groupRowsState:(o,e)=>JSON.stringify(o)===JSON.stringify(e)};function Bt(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=Aa(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)&&!wC[l]){let s=l,c=vC[s],u=r[s],d=a[s];(c?c(u,d):u===d)||(i[s]=!0)}return r.changes=i,r}function Io(o,e,t,n,r){let i=Bt(e,n,r),a=i.append;if(e.lazyLoad){let s=e.originalLazyGroupData,c=[Wo,...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,p=d.length,f=!0;for(let m=0;m<p;m++)if(d[m]==null){f=!1;break}if(f)return Promise.resolve(!0)}u?u.childrenLoading||(u.childrenLoading=!0):s.set(c,{error:void 0,children:[],childrenLoading:!0,childrenAvailable:!1,cache:Vm,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 p=s;if(c=p.data,p.livePaginationCursor!==void 0&&(t.livePaginationCursor=p.livePaginationCursor),p.mappings&&(t.pivotMappings=p.mappings),p.totalCountUnfiltered&&(t.unfilteredCount=p.totalCountUnfiltered),e.lazyLoad){let m=function(g,b,h){let y=[Wo,...g],S=b.data,T={cache:b.cache??Vm,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 R=f.get(y),v=!R,P=dd({children:!0},R||{},T);v&&(P.chidren=[]),P.children.length=P.totalCount;let w=i.lazyLoadStartIndex??0,x=Math.min(b.totalCount??S.length,w+i.lazyLoadBatchSize);for(let E=w;E<x;E++){let M=T.children[E-w];if(!M)throw`lazily loaded item not found at index ${E-w}`;P.children[E]=M,M.dataset&&C.push({keys:M.keys,dataset:M.dataset})}v&&f.set(y,P)}else T.children.forEach(R=>{R&&R.dataset&&C.push({keys:R.keys,dataset:R.dataset})}),T.children.length=T.totalCount,f.set(y,T);let I=!1;if(!g||!g.length){let R=f.get([Wo]);t.originalDataArray=[...R.children],I=!0}if(I||(t.originalLazyGroupDataChangeDetect=Ht()),C.length){let R=g;C.forEach(({keys:v,dataset:P})=>{m(v,P,R)})}};var d=m;let f=e.originalLazyGroupData;u=!0,m(i.groupKeys||[],p)}}else c=s;u||(t.originalDataArray=a?e.originalDataArray.concat(c):c),l&&(!e.lazyLoad||e.lazyLoad&&!a)&&(t.loading=!1)})}function Aa(o,{filterTypes:e,filterMode:t}){return t==="local"?o:(js(o,e)||[]).map(n=>{let r={...n};return delete r.valueGetter,r})}var PC=()=>new Promise(o=>{Ge(o)});function Us(o,e){let t=!!o,{stateReadyAsDetails:n}=e(),r=t&&o.shouldRestoreState?n:!0;return{isDetail:t,isDetailReady:r}}function Gm(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 ee,p=["_______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:p,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},I=b.groupKeys,R=d.get(I);if(!R?.[b.id]){let v=!R;R=R||{},R[b.id]||(R[b.id]=C),v&&d.set(I,R)}}if(!h&&r!=null){let C=d.get(S),I=Math.floor(T/r)*r,R=T-I,v=s[b.indexInAll-R].indexInAll,P=c(v),w=s[v].id;if(P||C?.[w])continue;let x=!C;C=C||{};let E={lazyLoadStartIndex:I,lazyLoadBatchSize:r,groupKeys:y,append:u};C[w]||(C[w]=E),x&&d.set(S,C)}}let f=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(()=>PC()).then(()=>Io(...y))},f)}function Ys(o){let{getComputed:e,getState:t,actions:n}=o,r=t().columnMenuVisibleForColumnId;if(!r)return;let i=e(),a=i.computedVisibleColumnsMap,l=i.computedColumnOrder;if(a.has(r)){n.columnMenuVisibleKey=Date.now();return}function s(f,m){let g=l[c+f*m],b=a.get(g);if(b&&b.renderMenuIcon!==!1)return g}let c=l.indexOf(r),u=0,d=-1,p;for(;!p&&u<l.length&&(u++,p=s(u,d),p||(d*=-1,p=s(u,d)),!p););return p&&(n.columnMenuVisibleForColumnId=p),p}function _a(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 qs(o,e,t){let{rowsPerPage:n}=t;return n?Math.floor(o.rowIndex/n)===Math.floor(e.rowIndex/n):!0}function Hm(o,e,t){if(qs(o,e,t))throw"You should not call this when the positions are in the same page";let{rowsPerPage:n,columnsPerSet:r}=t;if(n===0)throw"rowsPerPage cannot be 0";let i=o,a=e;Math.floor(o.rowIndex/n)>Math.floor(e.rowIndex/n)&&(i=e,a=o);let{rowIndex:l,colIndex:s}=i,{rowIndex:c,colIndex:u}=a,d=Math.floor(l/n),p=Math.floor(c/n),f=l%n,m=c%n,g=Math.min(f,m),b=Math.max(f,m),h=[];for(let y=d;y<=p;y++)for(let S=g;S<=b;S++){let T=y*n+S;if(y===d)for(let C=s;C<r;C++)h.push({rowIndex:T,colIndex:C});else if(y===p)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 DC(o,e){let t=new Set(o);return e.map(n=>t.has(n)?n:null).filter(n=>n!=null)}var Xs=class{constructor(e){this.getCellSelectionPosition=e=>{let t=e.rowId??jo(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 $e(i);a.debugId=r.debugId??"";let[l,s]=this.getCellSelectionPosition(e),[c,u]=this.getCellSelectionPosition(t),d=this.getComputed().computedVisibleColumnsMap.get(s),p=this.getComputed().computedVisibleColumnsMap.get(u);if(!d||!p)return;let f=d.computedVisibleIndex,m=p.computedVisibleIndex,g=jo(l,this.getDataSourceState),b=jo(c,this.getDataSourceState);if(!g||!b)return;let h=g.indexInAll,y=b.indexInAll,[S,T]=_a({rowIndex:h,colIndex:f},{rowIndex:y,colIndex:m});for(let C=S.rowIndex;C<=T.rowIndex;C++)for(let I=S.colIndex;I<=T.colIndex;I++){let R={rowIndex:C,colIndex:I},[v,P]=this.getCellSelectionPosition(R);n?a.selectCell(v,P):a.deselectCell(v,P)}this.dataSourceActions.cellSelection=a};this.getCellSelectionPositionsWithFn=(e,t)=>{let n=Ca(this.getDataSourceState),{computedVisibleColumns:r}=this.getComputed(),i=r.map(d=>d.id),a=new Set,l=[],s=new Set;n.filter(d=>{r.forEach(p=>{this.isCellSelected({rowId:d.id,colId:p.id})&&(a.has(p.id)||a.add(p.id),s.has(d.id)||(s.add(d.id),l.push(d)))})});let c=DC(Array.from(a),i),u=l.map(d=>c.map(p=>this.isCellSelected({rowId:d.id,colId:p})?e(d,p):t));return{columnIds:c,positions:u}};this.getAllCellSelectionPositions=()=>this.getCellSelectionPositionsWithFn((e,t)=>[e.id,t],null);this.mapCellSelectionPositions=(e,t)=>this.getCellSelectionPositionsWithFn(e,t);this.deselectAll=()=>{let e=this.getDataSourceState(),t=e.cellSelection;if(!t)return;let n=new $e(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 $e(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 $e:new $e(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 $e(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 $e(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 $e(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 Km(o){return new Xs(o)}var Mt=class extends or{constructor(t){super(t);this.isRowDetailsExpanded=t=>!!this.isItemPositive(t)}getState(){let t=this.allPositive?!0:[...this.positiveMap?.keys()??[]],n=this.allNegative?!0:[...this.negativeMap?.keys()??[]];return{expandedRows:t,collapsedRows:n}}getPositiveFromState(t){return t.expandedRows}getNegativeFromState(t){return t.collapsedRows}areAllCollapsed(){return this.areAllNegative()}areAllExpanded(){return this.areAllPositive()}collapseAll(){this.makeAllNegative()}expandAll(){this.makeAllPositive()}isRowDetailsCollapsed(t){return!this.isRowDetailsExpanded(t)}setRowDetailsExpanded(t,n){return this.setItemValue(t,n)}collapseRowDetails(t){this.setRowDetailsExpanded(t,!1)}expandRowDetails(t){this.setRowDetailsExpanded(t,!0)}toggleRowDetails(t){this.toggleItem(t)}};function Bm(o){let{dataSourceApi:e,getState:t,actions:n}=o,r={collapseAllDetails(){n.rowDetailState=new Mt({collapsedRows:!0,expandedRows:[]})},expandAllDetails(){n.rowDetailState=new Mt({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 Mt(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 Mt(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 Uo(o,e,t){return Math.min(Math.max(o,e),t)}function Oa(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 Uo(a,r,i)}function xC(o,e){let{getState:t,getDataSourceState:n,actions:r,api:i,dataSourceApi:a}=o,{key:l}=e,s=n().dataArray,c=s.length,u=t(),{brain:d}=u,{activeRowIndex:p}=u;if(p==null)return!1;let{start:[f],end:[m]}=d.getRenderRange(),g=p,b=m-f-1,h=0,y=c-1,S={ArrowDown:()=>{p=Oa(n,p,1)},ArrowUp:()=>{p=Oa(n,p,-1)},ArrowLeft:()=>{let C=s[p];if(d.isHorizontalLayoutBrain){let I=d.rowsPerPage;p-I>=h?p=p-I: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[p];if(d.isHorizontalLayoutBrain){let I=d.rowsPerPage;p+I<=y?p=p+I: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[p];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:()=>{p=Math.min(p+b,c-1)},PageUp:()=>{p=Math.max(p-b,h)},End:()=>{p=y},Home:()=>{p=h}},T=S[l];return T?(T(),g!==p?(r.activeRowIndex=p,!0):!1):!1}function Zs(o,e){let{api:t,getState:n,getComputed:r,getDataSourceState:i,dataSourceApi:a}=o,{key:l,shiftKey:s}=e,c=i().dataArray,u=n(),{activeCellIndex:d,brain:p}=u;if(!d)return!1;let[f,m]=d,{start:[g,b],end:[h,y]}=p.getRenderRange(),S=h-g-1,T=y-b-1,C=i().dataArray.length-1,I=r().computedVisibleColumns.length-1,R=0,v=0;f=Uo(f,0,C),m=Uo(m,0,I);let P={ArrowDown:()=>{f=Uo(f+1,R,C)},ArrowUp:()=>{f=Uo(f-1,R,C)},ArrowLeft:()=>{if(m===v)if(f!==R&&(m=I),p.isHorizontalLayoutBrain){let x=p.rowsPerPage;f-x>=R?f=f-x:P.ArrowUp()}else P.ArrowUp();else m=Uo(m-1,v,I)},ArrowRight:()=>{if(m===I)if(f!==C&&(m=v),p.isHorizontalLayoutBrain){let x=p.rowsPerPage;f+x<=C?f=f+x:P.ArrowDown()}else P.ArrowDown();else m=Uo(m+1,v,I)},Enter:()=>{let x=c[f];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,I):f=Math.min(f+S,C)},PageUp:()=>{s?m=Math.max(m-T,v):f=Math.max(f-S,R)},End:()=>{s?m=I:f=C},Home:()=>{s?m=v:f=R}},w=P[l];return w?(w(),[f,m]):!1}function MC(o,e){let t=Zs(o,e);return t?(o.actions.activeCellIndex=t,!0):!1}var EC={ArrowUp:!0,ArrowDown:!0,ArrowLeft:!0,ArrowRight:!0,PageUp:!0,PageDown:!0,Home:!0,End:!0,Enter:!0," ":!0};function Wm(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||!EC[t]?!1:i!=null&&l==="row"?xC(o,e):a!=null&&l==="cell"?MC(o,e):!1}var Qs=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=Oa(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=Zs(this.param,{key:n,shiftKey:!1});return r===!1?!1:(this.param.actions.activeCellIndex=r,r)}};function jm(o){return new Qs(o)}function $m(o,e){return o.id?o.id===e.id:!!(o.field&&o.field===e.field)}var Js=class{constructor(e){this.columnApiById=new Map;this.getVisibleRenderRange=()=>this.getState().brain.getRenderRange();this.hideFilterOperatorMenu=()=>{this.actions.filterOperatorMenuVisibleForColumnId=null};this.setGroupRenderStrategy=e=>{this.actions.groupRenderStrategy=e};this.getColumnOrder=()=>this.getComputed().computedColumnOrder;this.getComputedColumnById=e=>this.getComputed().computedColumnsMap.get(e);this.getVisibleColumnOrder=()=>{let e=this.getColumnOrder(),t=this.getComputed().computedVisibleColumnsMap;return e.filter(n=>t.has(n))};this.persistEdit=async e=>{e=e??{};let{editingCell:t,editingValueRef:n}=this.getState();if(!t)return Promise.resolve(new Error("no edit in progress"));await new Promise(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={...xt({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,p=a.data&&typeof d=="string"?{[d]:a.data[d],[a.column.field]:l}:{...a.data,[a.column.field]:l};return this.context.dataSourceApi.updateData(p)}),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({...xt({...this.context,api:this,dataSourceApi:this.context.dataSourceApi,columnId:l,rowIndex:a}),value:i,initialValue:n.initialValue}):!0;return await new Promise(p=>requestAnimationFrame(p)),Promise.resolve(d).then(p=>{if(p===!0)return this.actions.editingCell={...t.editingCell,active:!1,accepted:!0,persisted:!1,waiting:"persist",value:i},!0;throw p}).catch(p=>(p instanceof Error||(p=new Error(`Edit rejected: ${p}`)),this.actions.editingCell={...n,value:i,persisted:!1,active:!1,waiting:!1,accepted:p},{reject:p,value:i}))}return e.cancel&&n?.active?(this.actions.editingCell={...n,active:!1,cancelled:!0,waiting:!1,persisted:!1},{cancel:!0,value:i}):e.reject&&n?.active?(this.actions.editingCell={...n,value:i,active:!1,persisted:!1,waiting:!1,accepted:e.reject},{reject:e.reject,value:i}):!0};this.cancelEdit=()=>this.stopEdit({cancel:!0});this.rejectEdit=e=>this.stopEdit({reject:e});this.getColumnAtIndex=e=>this.getComputed().computedVisibleColumns[e]??null;this.isCellEditable=e=>{let{rowIndex:t,primaryKey:n,columnId:r}=e,i=t??this.context.dataSourceApi.getIndexByPrimaryKey(n),{computedColumnsMap:a}=this.getComputed(),l=a.get(r);if(!l||!l.computedEditable||l.groupByForColumn)return Promise.resolve(!1);let s=this.getDataSourceState().dataArray[i];if(!s||s.isGroupRow)return Promise.resolve(!1);if(l.computedEditable===!0)return Promise.resolve(!0);let c=l.computedEditable(xt({...this.context,api:this,columnId:r,rowIndex:i}));return typeof c=="boolean"?Promise.resolve(c):c};this.getColumnApi=e=>{let t=typeof e=="string"?e:this.getComputed().computedVisibleColumns[e]?.id,n=this.columnApiById.get(t);if(n)return n;let r=mt(e,{...this.context,api:this});return r&&this.columnApiById.set(r.getColumnId(),r),r};this.isColumnSortable=e=>this.getColumnApi(e)?.isSortable()??!1;this.getCellValue=e=>this.getCellValues(e)?.value??null;this.getCellValues=e=>{let{rowIndex:t,primaryKey:n,columnId:r}=e,{dataSourceApi:i,getState:a}=this.context,{computedColumnsMap:l}=this.getComputed(),s=t??i.getIndexByPrimaryKey(n),c=l.get(r),u=i.getRowInfoByIndex(s),d=u?.id;if(!u||!c)return c||console.warn(`No column found with id: "${r}"`),u||console.warn(`No row found with index: "${s}" or primary key: "${d}"`),null;let p=this,{isRowDetailEnabled:f}=a(),m=!f||typeof f=="function"&&!f(u)?!1:this.rowDetailApi.isRowDetailExpanded(u.id)?"expanded":"collapsed",g=Wn({column:c,rowInfo:u,columnsMap:l,context:{...this.context,api:p},rowDetailState:m});return{value:g.formattedValueContext.value,formattedValue:g.formattedValue,rawValue:g.formattedValueContext.rawValue}};this.getVerticalRenderRange=()=>{let e=this.getState().brain.getRenderRange();return{renderStartIndex:e.start[0],renderEndIndex:e.end[0]}};this.setColumnOrder=e=>{this.actions.columnOrder=e};this.setVisibilityForColumnGroup=(e,t)=>{let n={...this.getState().columnGroupVisibility};t?delete n[e]:n[e]=!1,this.actions.columnGroupVisibility=n};this.collapseAllGroupRows=()=>{let e=this.getDataSourceState(),t=new wt(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 wt(t.groupRowsState);if(n.toggleGroupRow(e),this.dataSourceActions.groupRowsState=n,t.lazyLoad){let r=[Wo,...e],i=t.originalLazyGroupData.get(r);n.isGroupRowExpanded(e)?i?.cache||Io(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=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,p=r.brain.scrollTopMax;if(d<0&&p<0)return!0;let f=c.scrollLeft>d+(n.offset||0),m=c.scrollTop>p+(n.offset||0);return f&&m?!1:(c.scrollLeft!==u.scrollLeft&&!f&&(r.scrollerDOMRef.current.scrollLeft=c.scrollLeft),c.scrollTop!==u.scrollTop&&!m&&(r.scrollerDOMRef.current.scrollTop=c.scrollTop),!0)};this.context=e,this.rowSelectionApi=fm({dataSourceActions:e.dataSourceActions,getDataSourceState:e.getDataSourceState}),this.keyboardNavigationApi=jm({getState:e.getState,getDataSourceState:e.getDataSourceState,actions:e.actions,getComputed:e.getComputed,api:this,dataSourceApi:e.dataSourceApi}),this.rowDetailApi=Bm({getState:e.getState,actions:e.actions,dataSourceApi:e.dataSourceApi}),this.cellSelectionApi=Km({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)&&(Ys(t),e?.()),setTimeout(()=>{this.isDestroyed()||(Ys(t),e?.())},n)}isDestroyed(){return!this.getState().domRef.current}async startEdit(e){let{columnId:t,rowIndex:n,primaryKey:r,value:i}=e,a=n??this.context.dataSourceApi.getIndexByPrimaryKey(r);return this.isCellEditable({rowIndex:a,columnId:t}).then(async l=>{if(l){let s=this.getDataSourceState().dataArray,u=this.getComputed().computedColumnsMap.get(t),d=s[a],p=i??yp({column:u,rowInfo:d}),f=p;u.getValueToEdit&&(p=await u.getValueToEdit(xt({...this.context,rowIndex:a,columnId:t,api:this}))),this.actions.editingCell={active:!0,accepted:!1,persisted:!1,columnId:t,value:p,initialValue:f,rowIndex:a,primaryKey:s[a]?.id}}return l})}setSortingForColumn(e,t,n){let{computedColumnsMap:r}=this.getComputed(),i=r.get(e);if(!i||this.getSortingForColumn(e)===t&&this.getDataSourceState().multiSort===!1)return;if(t===null){this.setSortInfoForColumn(e,null,n);return}let l=i.groupByForColumn,s=i.field,c=l?Array.isArray(l)?l:[l]:[],u=c.map(f=>f.valueGetter?m=>f.valueGetter({data:m,field:f.field}):f.field?f.field:f.groupField??void 0).filter(Mo);u.length&&(s=u);let d=i.computedSortType;c.length&&d===Fn&&(d=c.flatMap(m=>{let g=m.field??m.groupField,b=g?r.get(g):null;return b?b.computedSortType:Fn}));let p={dir:t,id:i.id,field:s,type:d};i.valueGetter&&(p.valueGetter=f=>i.valueGetter({data:f,field:i.field})),this.setSortInfoForColumn(e,p,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=>!$m(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:$m(d,l)?(c=!0,t):d),c||s.push(t),this.dataSourceApi.setSortInfo(s)}getSortTypeForColumn(e){let t=this.getComputed().computedColumnsMap.get(e);return t?t.computedSortType:null}getSortInfoForColumn(e){let t=this.getComputed().computedColumnsMap.get(e);return t?t.computedSortInfo:null}getSortingForColumn(e){let t=this.getSortInfoForColumn(e);return t?t.dir:null}setPinningForColumn(e,t){let n={...this.getState().columnPinning};t===!1?delete n[e]:n[e]=t,this.actions.columnPinning=n}setColumnFilter(e,t){let n=this.getComputed().computedColumnsMap.get(e);if(!n)return;let r=this.getDataSourceState(),{filterTypes:i}=r,a;if(n.computedFilterValue)a={...n.computedFilterValue,filter:{...n.computedFilterValue.filter}};else{let l=n.computedFilterType;if(!i[l])return;let s={filter:{type:l,value:t,operator:i[l].defaultOperator},valueGetter:n.valueGetter};(n.field||typeof n.groupByForColumn=="string")&&(s.field=n.field||n.groupByForColumn),a=s}a.id=n.id,a.filter.value=t,this.setFilterValueForColumn(e,a)}setColumnFilterOperator(e,t){let n=this.getComputed().computedColumnsMap.get(e);if(!n)return;let r=this.getDataSourceState(),{filterTypes:i}=r,a=n.computedFilterType,l=i[a].operators,s=l.find(d=>d.name===t)??l.find(d=>d.name===i[a].defaultOperator),c=s.name,u;n.computedFilterValue?(u={...n.computedFilterValue,filter:{...n.computedFilterValue.filter,operator:c}},s.defaultFilterValue!==void 0&&(u.filter.value=s.defaultFilterValue)):(u={filter:{operator:c,type:a,value:s.defaultFilterValue!==void 0?s.defaultFilterValue:[...i[a].emptyValues.values()][0]},valueGetter:n.valueGetter},n.field&&(u.field=n.field)),u.id=n.id,this.setFilterValueForColumn(e,u)}setFilterValueForColumn(e,t){let n=this.getComputed().computedColumnsMap.get(e);if(!n)return;let i=this.getDataSourceState().filterValue??[],a=!1;i=i.map(l=>l===n.computedFilterValue?(a=!0,t):l),a||i.push(t),this.dataSourceActions.filterValue=i}removeColumnFilter(e){let t=this.getComputed().computedColumnsMap.get(e);if(!t)return;let r=this.getDataSourceState().filterValue??[],i=!1;r=r.filter(a=>a===t.computedFilterValue?(i=!0,!1):!0),i&&(this.dataSourceActions.filterValue=r)}clearColumnFilter(e){let t=this.getComputed().computedColumnsMap.get(e);if(!t)return;let n=this.getDataSourceState(),r=n.filterValue??[],i=!1;r=r.map(a=>{if(a===t.computedFilterValue){let l=t.computedFilterValue.filter.type,s=n.operatorsByFilterType[l],c=n.filterTypes[l];if(i=!0,!c)return null;let u=a.filter.operator??c?.defaultOperator,p=s[u].defaultFilterValue??(c.emptyValues||[])[0]??void 0;return{...a,filter:{...a.filter,operator:u,value:p}}}return a}).filter(Mo),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 Um(o){return new Js(o)}var yn=require("react");var AC=10;function Ym(o,e){let{includeHeader:t,columnsToResize:n,columnsToSkip:r}=e,i=`.${fo} > .${Or}`,a=o.current?.querySelectorAll(i),l={},s={};return a&&a.length&&a.forEach(c=>{let u=c.parentElement,d=u.matches(`.${an}`);if(t===!1&&d)return;let p=u.getAttribute("data-column-id"),f=c.cloneNode(!0);f.style.visibility="hidden",f.style.pointerEvents="none",f.classList.remove(...Yt.split(" ")),f.style.position="absolute",f.style.width="auto",u.appendChild(f);let m=f.offsetWidth;if(u.removeChild(f),!s[p]){let g=Me().getComputedStyle(u);s[p]=parseInt(g.paddingLeft,10)+parseInt(g.paddingRight,10)+parseInt(g.borderLeftWidth,10)+parseInt(g.borderRightWidth,10)+AC}if(m+=s[p],d){let g=0;u.childNodes.forEach(b=>{if(b!==c&&b.nodeType===1){let h=b,y=Math.max(h.offsetWidth,parseInt(h.style.width,10));if(isNaN(y)&&(y=0),g+=y,y>0){let S=Me().getComputedStyle(h);g+=parseInt(S.marginLeft,10)+parseInt(S.marginRight,10)}}}),m+=g}r&&r.has(p)||n&&!n.has(p)||(l[p]=Math.max(m,l[p]||0))}),l}function qm(){let{getComponentState:o,componentActions:e,componentState:{domRef:t,ready:n,autoSizeColumnsKey:r,brain:i}}=Lt(),[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:p}=u,f=()=>{r!==p&&l(a+1)};return i.onRenderRangeChange(f)},[i]),(0,yn.useEffect)(()=>{if(s==null)return;let{autoSizeColumnsKey:d}=o(),p,f,m=!0;typeof d=="object"&&(d.columnsToResize&&(p=new Set(d.columnsToResize)),d.columnsToSkip&&(f=new Set(d.columnsToSkip)),m=d.includeHeader??m),u.current=s;let g=Ym(t,{includeHeader:m,columnsToResize:p,columnsToSkip:f}),b=Object.keys(g);if(!b.length)return;let h=o().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,n,a])}var qo=require("react");var Na=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&&!qs(e,t,r)){Hm(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]=_a(e,t),l=this.getCellSelectionPosition(i),s=this.getCellSelectionPosition(a);if(!(!l||!s))for(let c=i.rowIndex;c<=a.rowIndex;c++)for(let u=i.colIndex;u<=a.colIndex;u++){let d=this.getCellSelectionPosition({rowIndex:c,colIndex:u});d&&(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 Xm(o,e){return o<e?[o,e]:[e,o]}var Fa=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]=Xm(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]=Xm(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 ig=require("react");var rg=B(require("react"));var _C=B(require("react"));function La(o){return Ae(e=>o(e.dataSourceState))}var ct=B(require("react"));function Zm(){return Do()}var rt=require("react");var kt=require("react");function Sn(o,e){let t=(0,kt.useRef)({}),n=(0,kt.useRef)({}),r=n.current,i=(0,kt.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,kt.useEffect)(()=>{let s=i.current,c;return Object.keys(s).length!==0&&(c=o(s,r)),i.current={},n.current={},c},l)}function OC(o,e){let t=(0,kt.useRef)({}),n=(0,kt.useRef)({}),r=n.current,i=(0,kt.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,kt.useLayoutEffect)(()=>{let s=i.current,c;return Object.keys(s).length!==0&&(c=o(s,r)),i.current={},n.current={},c},l)}function NC(o,e){let t=[];for(let n in e)e.hasOwnProperty(n)&&t.push(e[n]);(0,kt.useEffect)(o,t)}function FC(o,e,t){return e=e.replaceAll("$ERR_CODE",o),e=`${e}
|
|
16
|
+
`)});function Wm(o){let{dataArray:e,treeFilterFunction:t,toPrimaryKey:n,getNodeChildren:r,isLeafNode:i,nodesKey:a}=o,l=[],s=u=>{let c=r(u);if(i(u)||!Array.isArray(c))return u;let d=Wm({...o,dataArray:c});return d.length===0?!1:(u={...u,[a]:d},u)};for(let u=0,c=e.length;u<c;u++){let d=e[u],p=r(d),f=t({data:d,index:u,dataArray:e,primaryKey:n(d,u),filterTreeNode:s});f&&(f===!0?f=d:typeof f=="object"&&f===d&&p!==r(f)&&zC(),l.push(f))}return l}function Ys(o){let{filterTypes:e,marker:t,operatorsByFilterType:n,filterFunction:r,toPrimaryKey:i,treeFilterFunction:a,getNodeChildren:l,nodesKey:s,isLeafNode:u}=o,{dataArray:c}=o;t?.start({details:[{name:"Count before",value:c.length}]}),r&&(c=c.filter((p,f,m)=>r({data:p,index:f,dataArray:m,primaryKey:i(p,f)}))),a&&(c=Wm({...o,treeFilterFunction:a,getNodeChildren:l,nodesKey:s,isLeafNode:u}));let d=Us(o.filterValue,e)||[];if(d&&d.length){let p=c.filter((f,m,g)=>{let y={data:f,index:m,dataArray:g,primaryKey:i(f,m),field:void 0};for(let h=0,b=d.length;h<b;h++){let S=d[h],{disabled:I,field:T,valueGetter:C,filter:{type:R,value:v,operator:P}}=S,w=e[R];if(I||!w)continue;let x=n[R]?.[P];if(!x)continue;let M=C||w.valueGetter||(({data:A,field:O})=>O?A[O]:A);y.field=T;let D=y;if(D.filterValue=v,D.currentValue=M(D),D.emptyValues=w.emptyValues,!x.fn(D))return!1}return!0});return t?.end({details:[{name:"Count after",value:p.length}]}),p}return t?.end({details:[{name:"Count after",value:c.length}]}),c}function jm(o){let e,{state:t,previousState:n}=o,r=t.debugId,i;r&&(i=at(r).track.DataSource.label.PrepareData.start());let a=bm(t),l=Oa(t.sortInfo,t.groupBy),s=t.sortMode,u=l?.length?s==="local":!1;(t.lazyLoad||t.livePagination)&&(u=!1);let c=ro(n,t,["refetchKey"]),d=ro(n,t,["cache","originalDataArray","originalLazyGroupDataChangeDetect"]);Array.isArray(t.data)&&c&&(d=!0),!1&&(t.originalLazyGroupData=new ee,d=!0);let f=t.cache?Sn.clone(t.cache):void 0;f&&!f.isEmpty()&&(d=!0);let m=t.toPrimaryKey,g=t.nodesKey,y=t.isTree,h=g?_=>_[g]:void 0,b=g?_=>_[g]===void 0:void 0,S,I;d&&(t.indexer.clear(),t.lazyLoad||(S=f?.getMutations(),I=f?.getTreeMutations(),t.originalDataArray=t.indexer.indexArray(t.originalDataArray,{toPrimaryKey:m,cache:f,getNodeChildren:h,isLeafNode:b,nodesKey:g}),y&&t.waitForNodePathPromises.visit(({value:_},ue)=>{_&&t.indexer.getDataForNodePath(ue)!==void 0&&_.resolve(!0)}))),f&&(f.clear(),t.cache=void 0);let{filterFunction:C,treeFilterFunction:R,filterValue:v,filterTypes:P,operatorsByFilterType:w}=t,x=!!C||!!R||Array.isArray(v)&&v.length,E=x&&t.filterMode==="local",M=ro(n,t,["filterFunction","treeFilterFunction","filterValue","filterTypes"]),D=d||M,A=ro(n,t,["sortInfo"]),O=d||M||A,N=t.filterMode==="local"&&(D||!t.lastFilterDataArray),L=u&&(O||!t.lastSortDataArray||a.sortInfo),F=t.groupBy,G=t.pivotBy,B=!y&&(F.length>0||!!G),z=y,U=ro(n,t,["rowDisabledState","isRowDisabled"]),K=ro(n,t,["rowSelection","cellSelection","isRowSelected","originalLazyGroupDataChangeDetect"]),q=ro(n,t,["treeSelection","cellSelection","isNodeSelected","originalLazyGroupDataChangeDetect"]),re=d||O||ro(n,t,["generateGroupRows","originalLazyGroupData","originalLazyGroupDataChangeDetect","groupBy","groupRowsState","pivotBy","aggregationReducers","pivotTotalColumnPosition","pivotGrandTotalColumnPosition","showSeparatePivotColumnForSingleAggregation","repeatWrappedGroupRows","rowsPerPage"]),se=d||O||ro(n,t,["originalLazyGroupData","originalLazyGroupDataChangeDetect","treeExpandState","isNodeExpanded","isNodeCollapsed","aggregationReducers","repeatWrappedGroupRows","rowsPerPage"]),de=ro(n,t,["rowInfoReducers"]),ae=B&&(re||!t.lastGroupDataArray||a.groupBy)||K||U||de,ce=z&&(se||a.tree||!t.lastTreeDataArray)||q||U||de,le=Date.now(),X=t.originalDataArray;if(z&&ce){let _={marker:r?at(r).track.DataSource.label.TreeUnfilteredTreePaths.start():void 0,isLeafNode:b,getNodeChildren:h,toKey:m};t.unfilteredTreePaths=Vs(_,X).treePaths}if(x||(t.unfilteredCount=X.length),E){t.unfilteredCount=X.length;let _=le;N?(t.devToolsDetected&&(_=Date.now()),X=Ys({marker:r?at(r).track.DataSource.label.Filter.start():void 0,getNodeChildren:h,isLeafNode:b,nodesKey:g,treeFilterFunction:R,dataArray:X,toPrimaryKey:m,filterTypes:P,operatorsByFilterType:w,filterFunction:C,filterValue:v}),t.devToolsDetected&&t.debugTimings.set("filter",Date.now()-_)):X=t.lastFilterDataArray,t.lastFilterDataArray=X,t.filteredAt=le}if(t.filteredCount=X.length,t.postFilterDataArray=X,u){let _=oo.knownTypes;if(oo.knownTypes={..._,...t.sortTypes},L){let ue=le;if(t.devToolsDetected&&(ue=Date.now()),r&&(e=at(r).track.DataSource.label.Sort.start({details:[{name:"Count",value:X.length}]})),t.sortFunction?(X=t.sortFunction(l,[...X]),e&&(e.end(),e=void 0)):y?X=Ca(l,X,{marker:e,inplace:!1,isLeafNode:b,getNodeChildren:h,toKey:m,nodesKey:g}):X=oo(l,[...X],{marker:e}),r&&(e?.end(),e=void 0),t.devToolsDetected){let Se=Date.now()-ue;t.debugTimings.set("sort",Se)}}else X=t.lastSortDataArray;oo.knownTypes=_,t.lastSortDataArray=X,t.sortedAt=le}t.postSortDataArray=X;let k=t.dataArray,Z=t.rowSelection instanceof Ae?t.rowSelection:void 0,Y=t.treeExpandState instanceof ut?t.treeExpandState:void 0,$=t.cellSelection instanceof Ue?t.cellSelection:void 0;Z?.xcache();let ie=t.selectionMode==="single-row"?_=>_.id===t.rowSelection:t.selectionMode==="multi-row"?_=>{let ue=Z;return _.isGroupRow?ue.getGroupRowSelectionState(_.groupKeys):ue.isRowSelected(_.id,_.dataSourceHasGrouping?_.groupKeys:void 0)}:void 0,fe=t.isRowDisabled||$s;t.isRowSelected&&t.selectionMode==="multi-row"&&(ie=_=>t.isRowSelected(_,Z,t.selectionMode));let pe;t.isNodeExpanded&&(pe=_=>t.isNodeExpanded(_,Y)),t.isNodeCollapsed&&(pe=_=>!t.isNodeExpanded(_,Y)),pe||(pe=ue=>Y.isNodeExpanded(ue.nodePath));let H=t.rowInfoReducers;if(B){if(ae){let _=le;t.devToolsDetected&&(_=Date.now());let ue=t.aggregationReducers,Se=t.lazyLoad?nm({groupBy:F,pivot:G,mappings:t.pivotMappings,reducers:ue,indexer:t.indexer,toPrimaryKey:m,cache:f,marker:r?at(r).track.DataSource.label.LazyGroup.start():void 0},t.originalLazyGroupData):Sa({groupBy:F,pivot:G,reducers:ue,marker:r?at(r).track.DataSource.label.Group.start():void 0},X);t.groupDeepMap=Se.deepMap,Z&&(Z.getConfig=ht(t));let Re=Object.keys(H||{}),Ce=Pa(H),Fe={reducers:H,results:Ce,reducerKeys:Re,rowInfo:{}},Oe=Ce?Ge=>{Fe.rowInfo=Ge,Da(Fe)}:void 0,Ye=$?Ge=>{Ge.isCellSelected=W=>$.isCellSelected(Ge.id,W)}:void 0,nt=Oe||Ye?Gs(Oe,Ye):void 0,We=sm({marker:r?at(r).track.DataSource.label.FlattenTree.start():void 0,groupResult:Se,lazyLoad:!!t.lazyLoad,reducers:ue,toPrimaryKey:m,isRowSelected:ie,rowSelectionState:Z,withRowInfo:nt,repeatWrappedGroupRows:t.rowsPerPage!=null?t.repeatWrappedGroupRows:!1,rowsPerPage:t.rowsPerPage,groupRowsState:t.groupRowsState,generateGroupRows:t.generateGroupRows});k=We.data,t.rowInfoReducerResults=xa({reducers:H,results:Ce,array:k}),t.groupRowsIndexesInDataArray=We.groupRowsIndexes,t.reducerResults=Se.reducerResults;let rt=G?um({deepMap:Se.topLevelPivotColumns,pivotBy:G,pivotTotalColumnPosition:t.pivotTotalColumnPosition??"end",pivotGrandTotalColumnPosition:t.pivotGrandTotalColumnPosition??!1,reducers:t.aggregationReducers,showSeparatePivotColumnForSingleAggregation:t.showSeparatePivotColumnForSingleAggregation}):void 0;t.pivotColumns=rt?.columns,t.pivotColumnGroups=rt?.columnGroups;let pt=Bm(k,l,t.pivotColumns,t.sortTypes);pt!==k&&(k=pt,t.groupRowsIndexesInDataArray=k.map((Ge,W)=>Ge.isGroupRow?W:-1).filter(Ge=>Ge>=0)),t.devToolsDetected&&t.debugTimings.set("group-and-pivot",Date.now()-_)}else k=t.lastGroupDataArray;t.lastGroupDataArray=k,t.groupedAt=le}else if(z){if(ce){let _=le;t.devToolsDetected&&(_=Date.now());let ue=t.aggregationReducers,Se={marker:r?at(r).track.DataSource.label.Tree.start():void 0,isLeafNode:b,getNodeChildren:h,toKey:m,reducers:ue},Re=Vs(Se,X);t.treeDeepMap=Re.deepMap,t.treePaths=Re.treePaths;let Ce=t.selectionMode==="multi-row"?Om(t.treeSelection,t.selectionMode,t):void 0;t.treeSelectionState=Ce;let Fe=Object.keys(H||{}),Oe=Pa(H),Ye={reducers:H,results:Oe,reducerKeys:Fe,rowInfo:{}},nt=Oe?oe=>{Ye.rowInfo=oe,Da(Ye)}:void 0,We=$?oe=>{oe.isCellSelected=he=>$.isCellSelected(oe.id,he)}:void 0,rt=nt||We?Gs(nt,We):void 0,pt=t.selectionMode==="single-row"?oe=>oe.id===t.treeSelection:t.selectionMode==="multi-row"?oe=>Ce.isNodeSelected(oe.nodePath):void 0,Ge=t.rowsPerPage!=null?t.repeatWrappedGroupRows:!1;k=lm({marker:r?at(r).track.DataSource.label.FlattenTree.start():void 0,treeResult:Re,treeParams:Se,dataArray:X,reducers:ue,toPrimaryKey:m,isNodeSelected:pt,isNodeExpanded:pe,treeSelectionState:Ce,withRowInfo:rt,repeatWrappedGroupRows:Ge,rowsPerPage:t.rowsPerPage}).data,t.rowInfoReducerResults=xa({reducers:H,results:Oe,array:k}),t.reducerResults=Re.reducerResults,t.totalLeafNodesCount=Re.deepMap.get([])?.totalLeafNodesCount??0,t.treeAt=le,t.devToolsDetected&&t.debugTimings.set("tree",Date.now()-_)}else k=t.lastTreeDataArray;t.lastTreeDataArray=k}else if(t.groupDeepMap=void 0,t.pivotColumns=void 0,t.groupRowsIndexesInDataArray=void 0,n.postSortDataArray!=t.postSortDataArray||re||K||U||de){let ue=Object.keys(H||{}),Se=Pa(H),Re={reducers:H,results:Se,reducerKeys:ue,rowInfo:{}};k=X.map((Ce,Fe)=>{let Oe=kC(Ce,Ce?m(Ce):Fe,Fe,ie,fe,$);return Se&&(Re.rowInfo=Oe,Da(Re)),Oe}),t.rowInfoReducerResults=xa({reducers:H,results:Se,array:k})}if(t.postGroupDataArray=k,k!==t.dataArray&&(t.updatedAt=le),t.dataArray=k,t.reducedAt=le,t.selectionMode==="multi-row")if(B&&t.lazyLoad){r&&(e=at(r).track.DataSource.label.ComputeSelectionCountLazy.start());let _=!0,ue=!1;t.dataArray.forEach(Se=>{if(!Se.isTreeNode&&Se.isGroupRow&&Se.groupKeys.length===1){let{rowSelected:Re}=Se;Re!==!0&&(_=!1),(Re===!0||Re===null)&&(ue=!0)}}),t.allRowsSelected=_,t.someRowsSelected=ue,r&&(e?.end(),e=void 0)}else{r&&(e=at(r).track.DataSource.label.ComputeSelectionCount.start());let _=t.isTree?t.totalLeafNodesCount:t.filteredCount,ue=t.isTree?t.treeSelectionState?t.treeSelectionState.getSelectedCount():0:t.rowSelection.getSelectedCount();t.allRowsSelected=_===ue,t.someRowsSelected=ue>0,r&&(e?.end(),e=void 0)}return t.originalDataArrayChanged=d,d&&(t.originalDataArrayChangedInfo={timestamp:le,mutations:S?.size?S:void 0,treeMutations:I?.size?I:void 0}),t.rowInfoStore.notifyDataArray(k,{marker:r?at(r).track.DataSource.label.DiffRowInfoInStore:void 0}),i&&i?.track.DataSource.label.PrepareData.end({details:[N||L||ae||ce?{name:"Performed operations",value:[N?"filter":null,L?"sort":null,ae?"group":null,ce?"tree":null].filter(Eo).join(", ")}:null,c?{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(Eo)}),t}var $m=!0,VC={originalDataArray:!0,changes:!0},GC={filterValue:(o,e)=>JSON.stringify(o)===JSON.stringify(e),groupRowsState:(o,e)=>JSON.stringify(o)===JSON.stringify(e)};function Bt(o,e,t){let n=Oa(o.sortInfo,o.groupBy),r=o.multiSort?n:n?.[0]??null,i={append:!1,originalDataArray:o.originalDataArray,sortInfo:r,refetchKey:o.refetchKey,groupBy:o.groupBy,pivotBy:o.pivotBy,filterValue:o.filterValue,aggregationReducers:o.aggregationReducers};if(t&&(i.masterRowInfo=t.masterRowInfo),i.groupBy&&(i.groupRowsState=o.groupRowsState.getState()),o.livePagination!==void 0&&(i.livePaginationCursor=o.livePaginationCursor,i.__cursorId=o.cursorId),o.lazyLoad&&(o.lazyLoadBatchSize!=null&&o.lazyLoadBatchSize>0&&(i.lazyLoadBatchSize=o.lazyLoadBatchSize,i.lazyLoadStartIndex=0),i.groupKeys=[]),e&&Object.assign(i,e),i.filterValue&&i.filterValue.length){let s=Na(i.filterValue,{filterMode:o.filterMode,filterTypes:o.filterTypes});s&&s.length&&(i.filterValue=s)}let a={},l=o.dataParams||{};for(let s in i)if(i.hasOwnProperty(s)&&!VC[s]){let u=s,c=GC[u],d=i[u],p=l[u];(c?c(d,p):d===p)||(a[u]=!0)}return i.changes=a,i}function Ro(o,e,t,n,r){let i=Bt(e,n,r),a=i.append;if(e.lazyLoad){let s=e.originalLazyGroupData,u=[jo,...i.groupKeys||[]],c=s.get(u);if(!c){let d=[...i.groupKeys||[],i.lazyLoadStartIndex];e.lazyLoadCacheOfLoadedBatches.set(d,!0)}if(c&&c.cache&&u.length>1){let d=c.children,p=d.length,f=!0;for(let m=0;m<p;m++)if(d[m]==null){f=!1;break}if(f)return Promise.resolve(!0)}c?c.childrenLoading||(c.childrenLoading=!0):s.set(u,{error:void 0,children:[],childrenLoading:!0,childrenAvailable:!1,cache:$m,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 u=[],c=!1;if(Array.isArray(s.data)){let p=s;if(u=p.data,p.livePaginationCursor!==void 0&&(t.livePaginationCursor=p.livePaginationCursor),p.mappings&&(t.pivotMappings=p.mappings),p.totalCountUnfiltered&&(t.unfilteredCount=p.totalCountUnfiltered),e.lazyLoad){let m=function(g,y,h){let b=[jo,...g],S=y.data,I={cache:y.cache??$m,childrenLoading:!1,childrenAvailable:!0,totalCount:y.totalCount??S.length,totalCountUnfiltered:y.totalCount??S.length,children:S,error:y.error},T=[];if(i.lazyLoadBatchSize&&!h){let R=f.get(b),v=!R,P=pd({children:!0},R||{},I);v&&(P.chidren=[]),P.children.length=P.totalCount;let w=i.lazyLoadStartIndex??0,x=Math.min(y.totalCount??S.length,w+i.lazyLoadBatchSize);for(let E=w;E<x;E++){let M=I.children[E-w];if(!M)throw`lazily loaded item not found at index ${E-w}`;P.children[E]=M,M.dataset&&T.push({keys:M.keys,dataset:M.dataset})}v&&f.set(b,P)}else I.children.forEach(R=>{R&&R.dataset&&T.push({keys:R.keys,dataset:R.dataset})}),I.children.length=I.totalCount,f.set(b,I);let C=!1;if(!g||!g.length){let R=f.get([jo]);t.originalDataArray=[...R.children],C=!0}if(C||(t.originalLazyGroupDataChangeDetect=Ht()),T.length){let R=g;T.forEach(({keys:v,dataset:P})=>{m(v,P,R)})}};var d=m;let f=e.originalLazyGroupData;c=!0,m(i.groupKeys||[],p)}}else u=s;c||(t.originalDataArray=a?e.originalDataArray.concat(u):u),l&&(!e.lazyLoad||e.lazyLoad&&!a)&&(t.loading=!1)})}function Na(o,{filterTypes:e,filterMode:t}){return t==="local"?o:(Us(o,e)||[]).map(n=>{let r={...n};return delete r.valueGetter,r})}var HC=()=>new Promise(o=>{Ve(o)});function qs(o,e){let t=!!o,{stateReadyAsDetails:n}=e(),r=t&&o.shouldRestoreState?n:!0;return{isDetail:t,isDetailReady:r}}function Um(o,e){let{startIndex:t,endIndex:n,lazyLoadBatchSize:r,componentState:i,componentActions:a,dismissLoadedRows:l}=o,{dataArray:s}=i,u=l?()=>!1:g=>s[g].data!=null,c=!l,d=new ee,p=["_______xxx______"];for(let g=t;g<=n;g++){let y=s[g];if(!y)continue;let h=u(g),b=y.dataSourceHasGrouping&&y.groupKeys?[...y.groupKeys]:[];y.isGroupRow&&y.dataSourceHasGrouping&&y.groupKeys&&b.pop();let S=b.length?b:p,I=y.dataSourceHasGrouping?y.indexInGroup:y.indexInAll;if(y.isGroupRow&&!y.collapsed&&!y.childrenAvailable){let T={lazyLoadStartIndex:0,lazyLoadBatchSize:r,groupKeys:y.groupKeys,append:c},C=y.groupKeys,R=d.get(C);if(!R?.[y.id]){let v=!R;R=R||{},R[y.id]||(R[y.id]=T),v&&d.set(C,R)}}if(!h&&r!=null){let T=d.get(S),C=Math.floor(I/r)*r,R=I-C,v=s[y.indexInAll-R].indexInAll,P=u(v),w=s[v].id;if(P||T?.[w])continue;let x=!T;T=T||{};let E={lazyLoadStartIndex:C,lazyLoadBatchSize:r,groupKeys:b,append:c};T[w]||(T[w]=E),x&&d.set(S,T)}}let f=Promise.resolve(!0),m=[];d.topDownValues().forEach(g=>{m.push(...Object.values(g))}),m.reduce((g,y)=>{let h=[...y.groupKeys,y.lazyLoadStartIndex];if(e&&e.has(h))return g;e?.set(h,!0);let b=[i.data,i,a,y];return g.then(()=>HC()).then(()=>Ro(...b))},f)}function Xs(o){let{getComputed:e,getState:t,actions:n}=o,r=t().columnMenuVisibleForColumnId;if(!r)return;let i=e(),a=i.computedVisibleColumnsMap,l=i.computedColumnOrder;if(a.has(r)){n.columnMenuVisibleKey=Date.now();return}function s(f,m){let g=l[u+f*m],y=a.get(g);if(y&&y.renderMenuIcon!==!1)return g}let u=l.indexOf(r),c=0,d=-1,p;for(;!p&&c<l.length&&(c++,p=s(c,d),p||(d*=-1,p=s(c,d)),!p););return p&&(n.columnMenuVisibleForColumnId=p),p}function Fa(o,e){let{rowIndex:t,colIndex:n}=o,{rowIndex:r,colIndex:i}=e,[a,l]=n>i?[i,n]:[n,i],[s,u]=t>r?[r,t]:[t,r];return[{rowIndex:s,colIndex:a},{rowIndex:u,colIndex:l}]}function Zs(o,e,t){let{rowsPerPage:n}=t;return n?Math.floor(o.rowIndex/n)===Math.floor(e.rowIndex/n):!0}function Ym(o,e,t){if(Zs(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:u,colIndex:c}=a,d=Math.floor(l/n),p=Math.floor(u/n),f=l%n,m=u%n,g=Math.min(f,m),y=Math.max(f,m),h=[];for(let b=d;b<=p;b++)for(let S=g;S<=y;S++){let I=b*n+S;if(b===d)for(let T=s;T<r;T++)h.push({rowIndex:I,colIndex:T});else if(b===p)for(let T=0;T<=c;T++)h.push({rowIndex:I,colIndex:T});else for(let T=0;T<r;T++)h.push({rowIndex:I,colIndex:T})}return h}function KC(o,e){let t=new Set(o);return e.map(n=>t.has(n)?n:null).filter(n=>n!=null)}var Qs=class{constructor(e){this.getCellSelectionPosition=e=>{let t=e.rowId??Uo(e.rowIndex,this.getDataSourceState)?.id,n=e.colId??this.getComputed().computedVisibleColumns[e.colIndex].id;return[t,n]};this.setRangeSelected=(e,t,n)=>{let r=this.getDataSourceState(),i=r.cellSelection;if(!i)return;let a=new Ue(i);a.debugId=r.debugId??"";let[l,s]=this.getCellSelectionPosition(e),[u,c]=this.getCellSelectionPosition(t),d=this.getComputed().computedVisibleColumnsMap.get(s),p=this.getComputed().computedVisibleColumnsMap.get(c);if(!d||!p)return;let f=d.computedVisibleIndex,m=p.computedVisibleIndex,g=Uo(l,this.getDataSourceState),y=Uo(u,this.getDataSourceState);if(!g||!y)return;let h=g.indexInAll,b=y.indexInAll,[S,I]=Fa({rowIndex:h,colIndex:f},{rowIndex:b,colIndex:m});for(let T=S.rowIndex;T<=I.rowIndex;T++)for(let C=S.colIndex;C<=I.colIndex;C++){let R={rowIndex:T,colIndex:C},[v,P]=this.getCellSelectionPosition(R);n?a.selectCell(v,P):a.deselectCell(v,P)}this.dataSourceActions.cellSelection=a};this.getCellSelectionPositionsWithFn=(e,t)=>{let n=Ra(this.getDataSourceState),{computedVisibleColumns:r}=this.getComputed(),i=r.map(d=>d.id),a=new Set,l=[],s=new Set;n.filter(d=>{r.forEach(p=>{this.isCellSelected({rowId:d.id,colId:p.id})&&(a.has(p.id)||a.add(p.id),s.has(d.id)||(s.add(d.id),l.push(d)))})});let u=KC(Array.from(a),i),c=l.map(d=>u.map(p=>this.isCellSelected({rowId:d.id,colId:p})?e(d,p):t));return{columnIds:u,positions:c}};this.getAllCellSelectionPositions=()=>this.getCellSelectionPositionsWithFn((e,t)=>[e.id,t],null);this.mapCellSelectionPositions=(e,t)=>this.getCellSelectionPositionsWithFn(e,t);this.deselectAll=()=>{let e=this.getDataSourceState(),t=e.cellSelection;if(!t)return;let n=new Ue(t);n.debugId=e.debugId??"",n.deselectAll(),this.dataSourceActions.cellSelection=n};this.clear=()=>{this.deselectAll()};this.selectAll=()=>{let e=this.getDataSourceState(),t=e.cellSelection;if(!t)return;let n=new Ue(t);n.debugId=e.debugId??"",n.selectAll(),this.dataSourceActions.cellSelection=n};this.selectRange=(e,t)=>{this.setRangeSelected(e,t,!0)};this.deselectRange=(e,t)=>{this.setRangeSelected(e,t,!1)};this.isCellSelected=e=>{let[t,n]=this.getCellSelectionPosition(e);return this.getDataSourceState().cellSelection?.isCellSelected(t,n)??!1};this.selectCell=e=>{let t=this.getDataSourceState(),n=t.cellSelection;if(!n)return;let[r,i]=this.getCellSelectionPosition(e),a=e.clear?new Ue:new Ue(n);a.debugId=t.debugId??"",a.selectCell(r,i),this.dataSourceActions.cellSelection=a};this.deselectCell=e=>{let t=this.getDataSourceState(),n=t.cellSelection;if(!n)return;let[r,i]=this.getCellSelectionPosition(e),a=new Ue(n);a.debugId=t.debugId??"",a.deselectCell(r,i),this.dataSourceActions.cellSelection=a};this.selectColumn=(e,t)=>{t?.clear&&this.deselectAll();let n=this.getDataSourceState(),r=n.cellSelection;if(!r)return;let i=new Ue(r);i.debugId=n.debugId??"",i.selectColumn(e),this.dataSourceActions.cellSelection=i};this.deselectColumn=e=>{let t=this.getDataSourceState(),n=t.cellSelection;if(!n)return;let r=new Ue(n);r.debugId=t.debugId??"",r.deselectColumn(e),this.dataSourceActions.cellSelection=r};this.getComputed=e.getComputed,this.getDataSourceState=e.getDataSourceState,this.dataSourceActions=e.dataSourceActions}};function qm(o){return new Qs(o)}var Mt=class extends ir{constructor(t){super(t);this.isRowDetailsExpanded=t=>!!this.isItemPositive(t)}getState(){let t=this.allPositive?!0:[...this.positiveMap?.keys()??[]],n=this.allNegative?!0:[...this.negativeMap?.keys()??[]];return{expandedRows:t,collapsedRows:n}}getPositiveFromState(t){return t.expandedRows}getNegativeFromState(t){return t.collapsedRows}areAllCollapsed(){return this.areAllNegative()}areAllExpanded(){return this.areAllPositive()}collapseAll(){this.makeAllNegative()}expandAll(){this.makeAllPositive()}isRowDetailsCollapsed(t){return!this.isRowDetailsExpanded(t)}setRowDetailsExpanded(t,n){return this.setItemValue(t,n)}collapseRowDetails(t){this.setRowDetailsExpanded(t,!1)}expandRowDetails(t){this.setRowDetailsExpanded(t,!0)}toggleRowDetails(t){this.toggleItem(t)}};function Xm(o){let{dataSourceApi:e,getState:t,actions:n}=o,r={collapseAllDetails(){n.rowDetailState=new Mt({collapsedRows:!0,expandedRows:[]})},expandAllDetails(){n.rowDetailState=new Mt({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 Mt(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 Mt(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 qo(o,e,t){return Math.min(Math.max(o,e),t)}function La(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 qo(a,r,i)}function BC(o,e){let{getState:t,getDataSourceState:n,actions:r,api:i,dataSourceApi:a}=o,{key:l}=e,s=n().dataArray,u=s.length,c=t(),{brain:d}=c,{activeRowIndex:p}=c;if(p==null)return!1;let{start:[f],end:[m]}=d.getRenderRange(),g=p,y=m-f-1,h=0,b=u-1,S={ArrowDown:()=>{p=La(n,p,1)},ArrowUp:()=>{p=La(n,p,-1)},ArrowLeft:()=>{let T=s[p];if(d.isHorizontalLayoutBrain){let C=d.rowsPerPage;p-C>=h?p=p-C: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[p];if(d.isHorizontalLayoutBrain){let C=d.rowsPerPage;p+C<=b?p=p+C: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[p];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:()=>{p=Math.min(p+y,u-1)},PageUp:()=>{p=Math.max(p-y,h)},End:()=>{p=b},Home:()=>{p=h}},I=S[l];return I?(I(),g!==p?(r.activeRowIndex=p,!0):!1):!1}function Js(o,e){let{api:t,getState:n,getComputed:r,getDataSourceState:i,dataSourceApi:a}=o,{key:l,shiftKey:s}=e,u=i().dataArray,c=n(),{activeCellIndex:d,brain:p}=c;if(!d)return!1;let[f,m]=d,{start:[g,y],end:[h,b]}=p.getRenderRange(),S=h-g-1,I=b-y-1,T=i().dataArray.length-1,C=r().computedVisibleColumns.length-1,R=0,v=0;f=qo(f,0,T),m=qo(m,0,C);let P={ArrowDown:()=>{f=qo(f+1,R,T)},ArrowUp:()=>{f=qo(f-1,R,T)},ArrowLeft:()=>{if(m===v)if(f!==R&&(m=C),p.isHorizontalLayoutBrain){let x=p.rowsPerPage;f-x>=R?f=f-x:P.ArrowUp()}else P.ArrowUp();else m=qo(m-1,v,C)},ArrowRight:()=>{if(m===C)if(f!==T&&(m=v),p.isHorizontalLayoutBrain){let x=p.rowsPerPage;f+x<=T?f=f+x:P.ArrowDown()}else P.ArrowDown();else m=qo(m+1,v,C)},Enter:()=>{let x=u[f];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+I,C):f=Math.min(f+S,T)},PageUp:()=>{s?m=Math.max(m-I,v):f=Math.max(f-S,R)},End:()=>{s?m=C:f=T},Home:()=>{s?m=v:f=R}},w=P[l];return w?(w(),[f,m]):!1}function WC(o,e){let t=Js(o,e);return t?(o.actions.activeCellIndex=t,!0):!1}var jC={ArrowUp:!0,ArrowDown:!0,ArrowLeft:!0,ArrowRight:!0,PageUp:!0,PageDown:!0,Home:!0,End:!0,Enter:!0," ":!0};function Zm(o,e){let{key:t}=e,{getState:n}=o,r=n(),{activeRowIndex:i,activeCellIndex:a,keyboardNavigation:l,cellContextMenuVisibleFor:s,contextMenuVisibleFor:u}=r;return s||u||!jC[t]?!1:i!=null&&l==="row"?BC(o,e):a!=null&&l==="cell"?WC(o,e):!1}var eu=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=La(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=Js(this.param,{key:n,shiftKey:!1});return r===!1?!1:(this.param.actions.activeCellIndex=r,r)}};function Qm(o){return new eu(o)}function Jm(o,e){return o.id?o.id===e.id:!!(o.field&&o.field===e.field)}var tu=class{constructor(e){this.columnApiById=new Map;this.getVisibleRenderRange=()=>this.getState().brain.getRenderRange();this.hideFilterOperatorMenu=()=>{this.actions.filterOperatorMenuVisibleForColumnId=null};this.setGroupRenderStrategy=e=>{this.actions.groupRenderStrategy=e};this.getColumnOrder=()=>this.getComputed().computedColumnOrder;this.getComputedColumnById=e=>this.getComputed().computedColumnsMap.get(e);this.getVisibleColumnOrder=()=>{let e=this.getColumnOrder(),t=this.getComputed().computedVisibleColumnsMap;return e.filter(n=>t.has(n))};this.persistEdit=async e=>{e=e??{};let{editingCell:t,editingValueRef:n}=this.getState();if(!t)return Promise.resolve(new Error("no edit in progress"));await new Promise(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={...xt({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,p=a.data&&typeof d=="string"?{[d]:a.data[d],[a.column.field]:l}:{...a.data,[a.column.field]:l};return this.context.dataSourceApi.updateData(p)}),u;try{u=await s(a)}catch(d){u=d}let c=u instanceof Error?u:!0;return this.actions.editingCell={...t,active:!1,accepted:!1,waiting:!1,persisted:c},Promise.resolve(c)};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(),u=s.get(l),c=t.shouldAcceptEdit??u.shouldAcceptEdit,d=c?c({...xt({...this.context,api:this,dataSourceApi:this.context.dataSourceApi,columnId:l,rowIndex:a}),value:i,initialValue:n.initialValue}):!0;return await new Promise(p=>requestAnimationFrame(p)),Promise.resolve(d).then(p=>{if(p===!0)return this.actions.editingCell={...t.editingCell,active:!1,accepted:!0,persisted:!1,waiting:"persist",value:i},!0;throw p}).catch(p=>(p instanceof Error||(p=new Error(`Edit rejected: ${p}`)),this.actions.editingCell={...n,value:i,persisted:!1,active:!1,waiting:!1,accepted:p},{reject:p,value:i}))}return e.cancel&&n?.active?(this.actions.editingCell={...n,active:!1,cancelled:!0,waiting:!1,persisted:!1},{cancel:!0,value:i}):e.reject&&n?.active?(this.actions.editingCell={...n,value:i,active:!1,persisted:!1,waiting:!1,accepted:e.reject},{reject:e.reject,value:i}):!0};this.cancelEdit=()=>this.stopEdit({cancel:!0});this.rejectEdit=e=>this.stopEdit({reject:e});this.getColumnAtIndex=e=>this.getComputed().computedVisibleColumns[e]??null;this.isCellEditable=e=>{let{rowIndex:t,primaryKey:n,columnId:r}=e,i=t??this.context.dataSourceApi.getIndexByPrimaryKey(n),{computedColumnsMap:a}=this.getComputed(),l=a.get(r);if(!l||!l.computedEditable||l.groupByForColumn)return Promise.resolve(!1);let s=this.getDataSourceState().dataArray[i];if(!s||s.isGroupRow)return Promise.resolve(!1);if(l.computedEditable===!0)return Promise.resolve(!0);let u=l.computedEditable(xt({...this.context,api:this,columnId:r,rowIndex:i}));return typeof u=="boolean"?Promise.resolve(u):u};this.getColumnApi=e=>{let t=typeof e=="string"?e:this.getComputed().computedVisibleColumns[e]?.id,n=this.columnApiById.get(t);if(n)return n;let r=gt(e,{...this.context,api:this});return r&&this.columnApiById.set(r.getColumnId(),r),r};this.isColumnSortable=e=>this.getColumnApi(e)?.isSortable()??!1;this.getCellValue=e=>this.getCellValues(e)?.value??null;this.getCellValues=e=>{let{rowIndex:t,primaryKey:n,columnId:r}=e,{dataSourceApi:i,getState:a}=this.context,{computedColumnsMap:l}=this.getComputed(),s=t??i.getIndexByPrimaryKey(n),u=l.get(r),c=i.getRowInfoByIndex(s),d=c?.id;if(!c||!u)return u||console.warn(`No column found with id: "${r}"`),c||console.warn(`No row found with index: "${s}" or primary key: "${d}"`),null;let p=this,{isRowDetailEnabled:f}=a(),m=!f||typeof f=="function"&&!f(c)?!1:this.rowDetailApi.isRowDetailExpanded(c.id)?"expanded":"collapsed",g=Un({column:u,rowInfo:c,columnsMap:l,context:{...this.context,api:p},rowDetailState:m});return{value:g.formattedValueContext.value,formattedValue:g.formattedValue,rawValue:g.formattedValueContext.rawValue}};this.getVerticalRenderRange=()=>{let e=this.getState().brain.getRenderRange();return{renderStartIndex:e.start[0],renderEndIndex:e.end[0]}};this.setColumnOrder=e=>{this.actions.columnOrder=e};this.setVisibilityForColumnGroup=(e,t)=>{let n={...this.getState().columnGroupVisibility};t?delete n[e]:n[e]=!1,this.actions.columnGroupVisibility=n};this.collapseAllGroupRows=()=>{let e=this.getDataSourceState(),t=new wt(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 wt(t.groupRowsState);if(n.toggleGroupRow(e),this.dataSourceActions.groupRowsState=n,t.lazyLoad){let r=[jo,...e],i=t.originalLazyGroupData.get(r);n.isGroupRowExpanded(e)?i?.cache||Ro(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=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 u={scrollLeft:l.scrollLeft,scrollTop:s.scrollTop},c=r.brain.getScrollPosition(),d=r.brain.scrollLeftMax,p=r.brain.scrollTopMax;if(d<0&&p<0)return!0;let f=u.scrollLeft>d+(n.offset||0),m=u.scrollTop>p+(n.offset||0);return f&&m?!1:(u.scrollLeft!==c.scrollLeft&&!f&&(r.scrollerDOMRef.current.scrollLeft=u.scrollLeft),u.scrollTop!==c.scrollTop&&!m&&(r.scrollerDOMRef.current.scrollTop=u.scrollTop),!0)};this.context=e,this.rowSelectionApi=gm({dataSourceActions:e.dataSourceActions,getDataSourceState:e.getDataSourceState}),this.keyboardNavigationApi=Qm({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=qm({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)&&(Xs(t),e?.()),setTimeout(()=>{this.isDestroyed()||(Xs(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,c=this.getComputed().computedColumnsMap.get(t),d=s[a],p=i??Tp({column:c,rowInfo:d}),f=p;c.getValueToEdit&&(p=await c.getValueToEdit(xt({...this.context,rowIndex:a,columnId:t,api:this}))),this.actions.editingCell={active:!0,accepted:!1,persisted:!1,columnId:t,value:p,initialValue:f,rowIndex:a,primaryKey:s[a]?.id}}return l})}setSortingForColumn(e,t,n){let{computedColumnsMap:r}=this.getComputed(),i=r.get(e);if(!i||this.getSortingForColumn(e)===t&&this.getDataSourceState().multiSort===!1)return;if(t===null){this.setSortInfoForColumn(e,null,n);return}let l=!!i.pivotColumn,s=i.groupByForColumn,u=l?void 0:i.field,c=s?Array.isArray(s)?s:[s]:[],d=c.map(m=>m.valueGetter?g=>m.valueGetter({data:g,field:m.field}):m.field?m.field:m.groupField??void 0).filter(Eo);d.length&&(u=d);let p=i.computedSortType;if(c.length&&p===co){let m=this.getState().initialColumns;p=c.flatMap(y=>{let h=y.field??y.groupField,b=h?r.get(h):null;if(b)return b.computedSortType;let S=h?on(m,h):void 0;return S?S.sortType||(typeof S.type=="string"?S.type:"string"):[co]})}c.length&&!Array.isArray(p)&&(p=[p]);let f={dir:t,id:i.id,field:u,type:p};!l&&i.valueGetter&&(f.valueGetter=m=>i.valueGetter({data:m,field:i.field})),this.setSortInfoForColumn(e,f,n)}setSortInfoForColumn(e,t,n){let r=this.getDataSourceState(),i=this.getComputed().computedColumnsMap.get(e);if(!i)return;if(!r.multiSort){this.dataSourceApi.setSortInfo(t?[t]:null);return}let a=i.field,l={id:e,field:a},s=r.sortInfo?.slice()??[];if(t===null){s=s.filter(d=>!Jm(d,l)),this.dataSourceApi.setSortInfo(s);return}let u=!1;if((n?.multiSortBehavior??this.getState().multiSortBehavior)==="replace"){this.dataSourceApi.setSortInfo([t]);return}s=s.map(d=>u?d:Jm(d,l)?(u=!0,t):d),u||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),u=s.name,c;n.computedFilterValue?(c={...n.computedFilterValue,filter:{...n.computedFilterValue.filter,operator:u}},s.defaultFilterValue!==void 0&&(c.filter.value=s.defaultFilterValue)):(c={filter:{operator:u,type:a,value:s.defaultFilterValue!==void 0?s.defaultFilterValue:[...i[a].emptyValues.values()][0]},valueGetter:n.valueGetter},n.field&&(c.field=n.field)),c.id=n.id,this.setFilterValueForColumn(e,c)}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],u=n.filterTypes[l];if(i=!0,!u)return null;let c=a.filter.operator??u?.defaultOperator,p=s[c].defaultFilterValue??(u.emptyValues||[])[0]??void 0;return{...a,filter:{...a.filter,operator:c,value:p}}}return a}).filter(Eo),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 u=n.brain.scrollTopMax,c=s.scrollLeft!==i.scrollLeft,d=s.scrollTop<=u+(t.offset||0);return!d&&!c?!1:(d&&s.scrollTop!==i.scrollTop&&(n.scrollerDOMRef.current.scrollTop=s.scrollTop),c&&(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(),u=n.brain.scrollLeftMax;return l.scrollLeft>u+(t.offset||0)?!1:(l.scrollLeft!==s.scrollLeft&&(n.scrollerDOMRef.current.scrollLeft=l.scrollLeft),!0)}};function eg(o){return new tu(o)}var Tn=require("react");var $C=10;function tg(o,e){let{includeHeader:t,columnsToResize:n,columnsToSkip:r}=e,i=`.${mo} > .${Lr}`,a=o.current?.querySelectorAll(i),l={},s={};return a&&a.length&&a.forEach(u=>{let c=u.parentElement,d=c.matches(`.${sn}`);if(t===!1&&d)return;let p=c.getAttribute("data-column-id"),f=u.cloneNode(!0);f.style.visibility="hidden",f.style.pointerEvents="none",f.classList.remove(...Yt.split(" ")),f.style.position="absolute",f.style.width="auto",c.appendChild(f);let m=f.offsetWidth;if(c.removeChild(f),!s[p]){let g=xe().getComputedStyle(c);s[p]=parseInt(g.paddingLeft,10)+parseInt(g.paddingRight,10)+parseInt(g.borderLeftWidth,10)+parseInt(g.borderRightWidth,10)+$C}if(m+=s[p],d){let g=0;c.childNodes.forEach(y=>{if(y!==u&&y.nodeType===1){let h=y,b=Math.max(h.offsetWidth,parseInt(h.style.width,10));if(isNaN(b)&&(b=0),g+=b,b>0){let S=xe().getComputedStyle(h);g+=parseInt(S.marginLeft,10)+parseInt(S.marginRight,10)}}}),m+=g}r&&r.has(p)||n&&!n.has(p)||(l[p]=Math.max(m,l[p]||0))}),l}function og(){let{getComponentState:o,componentActions:e,componentState:{domRef:t,ready:n,autoSizeColumnsKey:r,brain:i}}=Lt(),[a,l]=(0,Tn.useState)(0),s=typeof r=="object"?r.key:r,u=Ne(s),c=(0,Tn.useRef)(null);(0,Tn.useEffect)(()=>{if(u()==null)return;let{current:p}=c,f=()=>{r!==p&&l(a+1)};return i.onRenderRangeChange(f)},[i]),(0,Tn.useEffect)(()=>{if(s==null)return;let{autoSizeColumnsKey:d}=o(),p,f,m=!0;typeof d=="object"&&(d.columnsToResize&&(p=new Set(d.columnsToResize)),d.columnsToSkip&&(f=new Set(d.columnsToSkip)),m=d.includeHeader??m),c.current=s;let g=tg(t,{includeHeader:m,columnsToResize:p,columnsToSkip:f}),y=Object.keys(g);if(!y.length)return;let h=o().columnSizing,b={...h},S=!1;y.forEach(I=>{b[I]={width:g[I]},S=S||b[I].width!==h[I]?.width}),S&&(e.columnSizing=b)},[s,n,a])}var Zo=require("react");var ka=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&&!Zs(e,t,r)){Ym(e,t,{rowsPerPage:r.rowsPerPage,columnsPerSet:r.columnsPerSet}).forEach(c=>{let d=this.getCellSelectionPosition({rowIndex:c.rowIndex,colIndex:c.colIndex});d&&(n?this.cellSelectionState.selectCell(...d):this.cellSelectionState.deselectCell(...d))});return}let[i,a]=Fa(e,t),l=this.getCellSelectionPosition(i),s=this.getCellSelectionPosition(a);if(!(!l||!s))for(let u=i.rowIndex;u<=a.rowIndex;u++)for(let c=i.colIndex;c<=a.colIndex;c++){let d=this.getCellSelectionPosition({rowIndex:u,colIndex:c});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 ng(o,e){return o<e?[o,e]:[e,o]}var za=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]=ng(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]=ng(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 pg=require("react");var dg=j(require("react"));var UC=j(require("react"));function Va(o){return Ee(e=>o(e.dataSourceState))}var ct=j(require("react"));function rg(){return xo()}var lt=require("react");var kt=require("react");function Cn(o,e){let t=(0,kt.useRef)({}),n=(0,kt.useRef)({}),r=n.current,i=(0,kt.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,kt.useEffect)(()=>{let s=i.current,u;return Object.keys(s).length!==0&&(u=o(s,r)),i.current={},n.current={},u},l)}function YC(o,e){let t=(0,kt.useRef)({}),n=(0,kt.useRef)({}),r=n.current,i=(0,kt.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,kt.useLayoutEffect)(()=>{let s=i.current,u;return Object.keys(s).length!==0&&(u=o(s,r)),i.current={},n.current={},u},l)}function qC(o,e){let t=[];for(let n in e)e.hasOwnProperty(n)&&t.push(e[n]);(0,kt.useEffect)(o,t)}function XC(o,e,t){return e=e.replaceAll("$ERR_CODE",o),e=`${e}
|
|
17
17
|
|
|
18
18
|
ERROR_CODE = ${o}
|
|
19
19
|
|
|
20
|
-
See http://infinite-table.com/docs/reference/error-codes#${o} for more info.`,{code:o,message:e,type:t??"error"}}function
|
|
21
|
-
Make sure you don't pass a new reference on every render.`}),
|
|
20
|
+
See http://infinite-table.com/docs/reference/error-codes#${o} for more info.`,{code:o,message:e,type:t??"error"}}function ig(o){return Object.entries(o).reduce((e,[t,n])=>{let r=t,i=XC(r,typeof n=="string"?n:n.message,typeof n=="string"?void 0:n.type);return e[r]=i,e},{})}function ZC(o){return{message:o.join(""),type:"warning"}}function QC(o){return{message:o.join(""),type:"error"}}var JC=ig({DS001:ZC`The "data" prop of your DataSource seems to be updating too frequently.
|
|
21
|
+
Make sure you don't pass a new reference on every render.`}),eI=ig({CSS001_CSS:QC`It appears you have not loaded the CSS file for InfiniteTable.
|
|
22
22
|
In most environments, you should be able to fix this by adding the following line:
|
|
23
23
|
|
|
24
24
|
import '@infinite-table/infinite-react/index.css'
|
|
25
|
-
`}),
|
|
25
|
+
`}),ag={...JC,...eI};var yt=new Map,lg=o=>{yt.delete(o),Yo.delete(o),To.delete(o),Io.delete(o),Co.delete(o),no.delete(o)};function ou(o,e,t){let n=yt.get(o);if(!n)return;let r=Yo.get(o);(!r||!Object.hasOwn(r,e))&&Yo.set(o,{...r||{},[e]:n.getState()[e]}),To.set(o,{...To.get(o)||{},[e]:t}),n.actions[e]=t}function Ga(o,e,t){let n=yt.get(o);if(!n)return;let r=Io.get(o);(!r||!Object.hasOwn(r,e))&&Io.set(o,{...r||{},[e]:n.getDataSourceState()[e]}),Co.set(o,{...Co.get(o)||{},[e]:t}),n.dataSourceActions[e]=t}var tI=o=>{let e=o.type==="error"?Do(o.debugId):Nt(o.debugId),t=o.type==="error"?Rm:ar,n=o.debugId?`${o.code}-${o.debugId}`:o.code,r=o.message;o.debugId&&(r=`${r}
|
|
26
26
|
|
|
27
|
-
Component DEBUG_ID = "${o.debugId}"`),t(r,n,e)},ti=o=>{let{debugId:e,key:t}=o,n=Jm[t];if(n&&(GC({...n,debugId:e}),e&&t)){let r=ht.get(e);r&&r.getState().devToolsDetected&&n&&(r.getState().debugWarnings.set(t,{...n,debugId:e,status:"new"}),Yo(e))}};globalThis.logDevToolsWarning=ti;var Yo=o=>{let e=window.__INFINITE_TABLE_DEVTOOLS_HOOK__;if(!e)return;let t=ht.get(o);t&&e(o,t)};function tg(o){let{getDataSourceState:e,dataSourceActions:t,dataSourceState:n}=o,{data:r,dataArray:i,notifyScrollbarsChange:a,refetchKey:l,sortInfo:s,shouldReloadData:c,groupBy:u,pivotBy:d,filterValue:p,filterMode:f,livePagination:m,livePaginationCursor:g,filterTypes:b,cursorId:h}=n,[y,S]=(0,rt.useState)({vertical:!1,horizontal:!1}),T=(0,rt.useRef)(y);(0,rt.useEffect)(()=>(a.onChange(w=>{w&&(T.current=w,S(w))}),()=>a.destroy()),[a]),(0,rt.useEffect)(()=>{if(!m)return;let w=requestAnimationFrame(()=>{T.current?.vertical||g&&(t.cursorId=g)});return()=>cancelAnimationFrame(w)},[g]),(0,rt.useEffect)(()=>{if(!m||g!==void 0)return;let w=requestAnimationFrame(()=>{T.current?.vertical||h!=null&&i.length&&(t.cursorId=i.length)});return()=>cancelAnimationFrame(w)},[i.length,g]),(0,rt.useEffect)(()=>{let w=e(),{livePaginationCursor:x,livePagination:E,dataArray:M}=w;!y.vertical&&E&&(x?t.cursorId=x:x===void 0&&M.length&&(t.cursorId=M.length))},[y.vertical]);let C=(0,rt.useMemo)(()=>Aa(p,{filterTypes:b,filterMode:f}),[p,f,b]),I={sortInfo:c.sortInfo?s:null,groupBy:c.groupBy?u:null,pivotBy:c.pivotBy?d:null,refetchKey:l,filterValue:c.filterValue?C:null,cursorId:m?h:null},R=(0,rt.useRef)(!0);HC(o,{sortInfo:s,groupBy:u,pivotBy:d,filterValue:p,refetchKey:l,cursorId:m?h:null});let v=bi(),P=(0,rt.useRef)([]);Sn(()=>{let w=e(),x=v(),{isDetail:E,isDetailReady:M}=Us(x,e);if(E&&!M)return;let D=Date.now(),A=P.current;A.length>=10&&A.splice(0,1),A.push(D),D-A[0]<200&&A.length>=10&&ti({debugId:w.debugId,key:"DS001"}),typeof w.data!="function"&&Io(w.data,w,t,void 0,x)},{data:r}),Sn(w=>{let x=Object.keys(w),E=!1;if(x.length===1){if(E=!!w.cursorId,w.filterValue&&e().filterMode==="local")return;let N=e().data;if(Array.isArray(N)&&w.refetchKey){t.originalDataArray=N;return}}let M=v(),{isDetail:D,isDetailReady:A}=Us(M,e);if(D&&!A)return;let O=e();if(typeof O.data=="function"){let N;O.debugId&&(N=nt(O.debugId).track.DataSource.label.RemoteDataLoad.start()),Io(O.data,O,t,{append:E},M).then(()=>{N?.end()})}},{...I,data:r}),Sn(()=>{let w=e();if(R.current){R.current=!1;let x=Bt(w,void 0,v());t.dataParams=x}},I)}function HC(o,e){let{getDataSourceState:t,dataSourceActions:n,dataSourceState:r}=o;(0,rt.useEffect)(()=>{n.lazyLoadCacheOfLoadedBatches=new ee},[r.data,r.dataParams]);let{lazyLoadBatchSize:i,lazyLoad:a,originalLazyGroupDataChangeDetect:l,notifyRenderRangeChange:s,dataArray:c,groupRowsState:u,scrollStopDelayUpdatedByTable:d}=r,p=(0,rt.useRef)(null),f=(g,b,h=t().lazyLoadCacheOfLoadedBatches)=>{let y=t();if(g=g||p.current,!g)return;let{renderStartIndex:S,renderEndIndex:T}=g,{lazyLoadBatchSize:C,lazyLoad:I}=y;I&&((!C||C<=0)&&(!y.groupBy||y.groupBy.length===0)||Gm({startIndex:S,endIndex:T,lazyLoadBatchSize:C,componentState:y,componentActions:n,dismissLoadedRows:b?.dismissLoadedRows??!1},h))},m=(0,rt.useMemo)(()=>Ot(f,{wait:d}),[d]);Sn(g=>{if(a)return g.sortInfo||g.filterValue||g.groupBy||g.pivotBy||g.refetchKey||g.cursorId?(t().lazyLoadCacheOfLoadedBatches.clear(),t().originalLazyGroupData.clear(),f(s.get(),{dismissLoadedRows:!0})):(g.originalLazyGroupDataChangeDetect||g.groupRowsState)&&f(s.get()),s.onChange(b=>{p.current=b,f(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,rt.useEffect)(()=>{i&&i>0&&m()},[c])}function rr(o){let e=xo(),t=bi(),n=!!e,r=n?e.id:"master",{contextValue:i,ContextComponent:a}=tc(o),{componentActions:l,componentState:s,assignState:c}=i;s.getDataSourceMasterContextRef.current=t;let u=Oe(s),[d]=(0,ct.useState)(()=>gm({getState:u,actions:l})),p={dataSourceState:s,dataSourceActions:l,getDataSourceMasterContext:t,getDataSourceState:u,assignState:c,dataSourceApi:d},f=Oe(i),m=Oe(p),g=_s(),b=(0,ct.useCallback)(({children:h})=>{let y=ma(),[S]=(0,ct.useState)(()=>Zm());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:f()},ct.default.createElement(g.Provider,{value:T},ct.default.createElement(y.Provider,{value:S},h)))},[a,n,r]);return(0,ct.useLayoutEffect)(()=>{let h=t();h&&h.registerDetail(p)},[]),(0,ct.useLayoutEffect)(()=>()=>{let h=u();h.onCleanup(h)},[]),tg({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:p.dataSourceState}}function og(){return Ae(o=>o.dataSourceApi)}var Va=class Va{constructor(e,t){this.keysInOrder=[];if(typeof e=="number")this.maxSize=e,this.currentMap=new Map;else if(this.maxSize=t??Va.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}};Va.DEFAULT_SIZE=10;var za=Va;var oc=class{add(e,t){}get(e){}delete(e){}has(e){return!1}},Ga=class{constructor(e){this.storage=new za(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)}},nc=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)}},ir=class{constructor(e){this.cacheStorage=e===!1?new oc:e===!0?new nc:typeof e=="number"?new Ga(e):new Ga(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 ng=(e=>(e.INIT="INIT",e))(ng||{});var{useManagedComponent:tc}=Ft({debugName:"DataSource",initSetupState:xm,forwardProps:Em,concludeReducer:zm,mapPropsToState:_m,onPropChange:Om,cleanup:Mm,interceptActions:Fm(),mappedCallbacks:Nm()});function KC(o){let{DataSource:e}=rr(o);return rg.createElement(e,null,o.children??null)}function BC(){let{rowInfoReducerResults:o}=Ae(e=>({rowInfoReducerResults:e.dataSourceState.rowInfoReducerResults}));return o}function ag(o){let{getDataSourceState:e}=Ae(n=>({getDataSourceState:n.getDataSourceState}));return(0,ig.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 lg=require("react");var Lz=Nt("useColumnSizeFn");function sg(o){return(0,lg.useCallback)(t=>{let n=o[t];return n?n.computedWidth:0},[o])}var Wt=require("react");var WC={scrollLeft:0,scrollTop:0},oi=class{constructor(){this.scrollPosition=WC;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 cg(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 ug=B(require("react"));function dg(o){return(e,t)=>ug.createElement(o,{key:e.id,rowInfo:e,cache:t})}var ni=class extends pn{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+=Ji(c,u.concat(u)),t==="horizontal"?this.maxHorizontalRenderCount=a:this.maxVerticalRenderCount=a,a=Math.min(r,a),a}getRowIndexInPage(t){return this.rowsPerPage?t%this.rowsPerPage:t}getInitialCols(){return this.initialCols}getInitialRows(){return this.initialRows}getPageIndexForRow(t){return Math.floor(t/this.rowsPerPage)}getMatrixCoordinatesForHorizontalLayoutPosition(t){let n=t.rowIndex,r=t.colIndex;return t.rowIndex>=this.rowsPerPage&&this.rowsPerPage>0&&(n=t.rowIndex%this.rowsPerPage,r=Math.floor(t.rowIndex/this.rowsPerPage)*this.initialCols+r),{rowIndex:n,colIndex:r}}getHorizontalLayoutPositionFromMatrixCoordinates(t){let n=t.rowIndex,r=t.colIndex;if(t.colIndex>=this.initialCols&&this.initialCols>0){let i=Math.floor(t.colIndex/this.initialCols);r=t.colIndex-i*this.initialCols,n=this.rowsPerPage*i+t.rowIndex}return{colIndex:Math.min(r,this.initialCols),rowIndex:this.options.isHeader?n:Math.min(n,this.initialRows)}}update(t){let{rows:n,cols:r,rowHeight:i,colWidth:a,width:l,height:s}=t,c=typeof l=="number",u=typeof s=="number",d=c&&l!==this.availableWidth,p=u&&s!==this.availableHeight;d&&(this.availableWidth=l,this.availableRenderWidth=l),p&&(this.availableHeight=s,this.availableRenderHeight=s),(d||p)&&this.notifyAvailableSizeChange();let f=typeof n=="number",m=typeof r=="number",g=f&&n!==this.initialRows,b=m&&r!==this.initialCols;f&&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,T=y&&a!==this.initialColWidth;h&&(this.rowHeight=i),y&&(this.initialColWidth=a,this.colWidth=this.getColWidth);let C=g||S||p,I=b||T||d||C;(I||C)&&this.updateRenderCount({horizontal:I,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=go){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=>{Ge(()=>{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}};function Tn(){return{current:null}}var pg={};function rc(o){return`.${Qt}[data-row-index${o?`="${o.rowIndex}"`:""}][data-col-index${o?`="${o.colIndex}"`:""}]`}function ic(o,e){let t=Ho(o),n=e?new ni(t,{isHeader:!1}):new pn(t),r=`${t}:header`,i=e?new ni(r,{isHeader:!0,masterBrain:n}):new pn(r);n.onScroll(u=>{i.setScrollPosition({scrollLeft:u.scrollLeft,scrollTop:0})});let{renderer:a,onRenderUpdater:l}=$r(n),{renderer:s,onRenderUpdater:c}=$r(i);return n.onAvailableSizeChange(u=>{i.update({width:u.width})}),{brain:n,headerBrain:i,renderer:a,onRenderUpdater:l,headerRenderer:s,headerOnRenderUpdater:c}}function fg({debugId:o,wrapRowsHorizontally:e}){let t={},{brain:n,headerBrain:r,renderer:i,onRenderUpdater:a,headerRenderer:l,headerOnRenderUpdater:s}=ic(o,!!e),c=Tn(),u=Date.now();return{debugWarnings:new Map,renderer:i,onRenderUpdater:a,headerRenderer:l,headerOnRenderUpdater:s,updatedAt:u,devToolsDetected:!!globalThis.__INFINITE_TABLE_DEVTOOLS_HOOK__,propsCache:new Map([]),lastRowToCollapseRef:{current:null},lastRowToExpandRef:{current:null},cellContextMenuVisibleFor:null,contextMenuVisibleFor:null,columnMenuVisibleForColumnId:null,columnMenuVisibleKey:0,filterOperatorMenuVisibleForColumnId:null,getDOMNodeForCell:d=>{if(!c.current)return null;let p=rc(d);return c.current.querySelector(p)||null},brain:n,headerBrain:r,domRef:c,columnMenuTargetRef:Tn(),editingValueRef:Tn(),scrollerDOMRef:Tn(),portalDOMRef:Tn(),focusDetectDOMRef:Tn(),activeCellIndicatorDOMRef:Tn(),onColumnMenuClick:Ie(),cellContextMenu:Ie(),contextMenu:Ie(),onFilterOperatorMenuClick:Ie(),flashingDurationCSSVarValue:null,onFlashingDurationCSSVarChange:Ie(),onRowHeightCSSVarChange:Ie(),onRowDetailHeightCSSVarChange:Ie(),onColumnHeaderHeightCSSVarChange:Ie(),cellClick:Ie(),cellMouseDown:Ie(),keyDown:Ie(),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 oi,pinnedEndScrollListener:new oi,columnsWhenInlineGroupRenderStrategy:void 0,editingCell:null,forceBodyRerenderTimestamp:0}}var mg=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 ir(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??pg,columnGroupVisibility:e=>e??pg,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 jC(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 gg=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 hg(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 Ha=new WeakMap;function bg(){return{rowDetailState:(o,e)=>({callbackParams:[o,{expandRow:e.lastRowToExpandRef.current,collapseRow:e.lastRowToCollapseRef.current}]})}}var yg=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?cg(i,t.columnGroupVisibility):t.columnGroupsDepthsMap,l=r?.groupBy,s=jC({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=dg(d),Ha.set(d,b)),u=b}u&&(c=e.rowDetailState||t.rowDetailState||e.defaultRowDetailState,c&&!(c instanceof Mt)&&(c=new Mt(c)),c=c||new Mt({expandedRows:[],collapsedRows:!0}));let p=t.columnsWhenGrouping||t.columnsWhenInlineGroupRenderStrategy||t.columns,f=c?e.isRowDetailExpanded:void 0;!f&&c&&(f=Ha.get(c),f||(f=b=>c.isRowDetailsExpanded(b.id),typeof c=="object"&&Ha.set(c,f)));let m=u?e.isRowDetailEnabled||!0:!1,g={updatedAt:Date.now(),isTree:r.isTree,rowDetailRenderer:u,rowDetailState:c,isRowDetailExpanded:f,isRowDetailEnabled:m,showColumnFilters:e.showColumnFilters??!!r.filterValue,controlledColumnVisibility:!!e.columnVisibility,groupRenderStrategy:s,groupBy:l,computedColumns:p,initialColumns:e.columns,keyboardNavigation:e.keyboardNavigation??(t.activeCellIndex!=null?"cell":t.activeRowIndex!=null?"row":"cell"),columnHeaderCssEllipsis:e.columnHeaderCssEllipsis??e.columnCssEllipsis??!0,columnGroupsDepthsMap:a,columnGroupsMaxDepth:a!=t.columnGroupsDepthsMap?Math.max(...a.values(),-1):t.columnGroupsMaxDepth,computedColumnGroups:i,rowHeightCSSVar:typeof e.rowHeight=="string"?e.rowHeight:"",rowDetailHeightCSSVar:typeof e.rowDetailHeight=="string"?e.rowDetailHeight:"",columnHeaderHeightCSSVar:typeof e.columnHeaderHeight=="string"?e.columnHeaderHeight||ge.components.Header.columnHeaderHeight:""};if(t.devToolsDetected&&t.debugId){let b=So.get(t.debugId);b&&(g={...g,...b})}return g};function Sg(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 Tg(o){let{hideEmptyGroupColumns:e,groupByMap:t,computedGroupColumns:n,groupRowsIndexesInDataArray:r,dataArray:i,groupBy:a}=o,l={...o.columnVisibility};if(!e)return Object.keys(n).forEach(d=>{l[d]===!1&&delete l[d]}),l;if(!r||!r.length)return l;let s=a.length,c=0,u=r.length;for(let d=0;d<u;d++){let p=r[d],f=i[p];if(!f.isTreeNode&&f.isGroupRow&&(c=Math.max(c,f.groupNesting-1),c===s-1))break}return Object.keys(n).forEach(d=>{let p=n[d],{groupByForColumn:f}=p;if(Array.isArray(f))return;let m=f.field||f.groupField;if(!m)return;t.get(m).groupIndex>c&&e?l[d]!==!1&&(l[d]=!1):l.hasOwnProperty(d)&&delete l[d]}),l}var Cn=B(require("react"));var Cg=o=>o.dataSourceHasGrouping&&o.isGroupRow&&o.childrenLoading||!o.selfLoaded;var Ka=B(require("react"));var Ig="_16lm1iwb _16lm1iw1d _16lm1iwk";var Rg="164.93361431346415 56.97787143782138",wg={margin:"auto",display:"block",shapeRendering:"auto"},mV=Object.keys({size:1,style:1,className:1,viewBox:1});var vg=o=>Ka.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",style:{...wg,...o.style},width:"24px",height:"24px",viewBox:o.viewBox??"0 0 100 100",preserveAspectRatio:"xMidYMid",className:te(o.className,Ig,"InfiniteIcon","InfiniteIcon-loading")},Ka.createElement("circle",{cx:"50",cy:"50",fill:"none",strokeWidth:"10",r:"35",strokeDasharray:Rg},Ka.createElement("animateTransform",{attributeName:"transform",type:"rotate",repeatCount:"indefinite",dur:"1s",values:"0 50 50;360 50 50",keyTimes:"0;1"})));function Pg(o,e,t,n){let{groupByForColumn:r,groupIndexForColumn:i,groupRenderStrategy:a}=o,l=r.column?{...r.column}:{},s={header:`Group by ${r.field||r.groupField}`,groupByForColumn:r,render:n.getGroupColumnRender({groupIndexForColumn:i,groupRenderStrategy:a}),...l,renderGroupIcon:n.getGroupColumnRenderGroupIcon({initialRenderGroupIcon:l?.renderGroupIcon,groupIndexForColumn:i,toggleGroupRow:e,groupRenderStrategy:a})};return t&&(typeof t=="function"?s={...s,...t(o,e)}:s={...s,...t}),s}function Dg(o,e,t,n){let r=typeof t=="function"?t(o,e):t,i={};return o.sortable!=null&&(i.sortable=o.sortable),{...i,header:"Group",groupByForColumn:o.groupBy,renderSelectionCheckBox:o.selectionMode==="multi-row",render:n.getGroupColumnRender({groupIndexForColumn:0,groupRenderStrategy:"single-column"}),...r,renderGroupIcon:n.getGroupColumnRenderGroupIcon({initialRenderGroupIcon:r?.renderGroupIcon,groupIndexForColumn:0,toggleGroupRow:e,groupRenderStrategy:"single-column"})}}function ac({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=te(_n.flex,i.align==="end"?vr.rowReverse:vr.row,gu.center,`${Qt}Expander`,e==="single-column"||e==="multi-column"&&(!n.isGroupRow||c)?Cp({align:a}):null);if(e==="multi-column"){if(o+1!==u.groupNesting&&u.isGroupRow)return c?Cn.createElement("div",{className:d},c):null}else e==="single-column"&&u.isGroupRow;return Cn.createElement("div",{className:d},s,c,Cn.createElement("div",{className:Yt},l??null))}}function lc({groupIndexForColumn:o,groupRenderStrategy:e,toggleGroupRow:t,initialRenderGroupIcon:n}){return r=>{let{rowInfo:i,value:a,rootGroupBy:l,pivotBy:s,column:c}=r,u=e!=="inline"?i:i.isGroupRow&&i.parents?.[o]||i;if(!u)return null;let d=u.collapsed;if(e==="inline"){if(u.groupCount===1)return a;if(u.groupNesting===o&&d)return null}else if(!u.isGroupRow||e==="multi-column"&&o+1!==u.groupNesting)return null;let p=u.groupKeys,f=null,m=s?(u.groupKeys?.length||0)<l?.length:(u.groupKeys?.length||0)<=l?.length;return Cg(u)?f=Cn.createElement(vg,null):m&&(f=Cn.createElement(ln,{expanded:!d,direction:c.align==="end"?"end":"start",onChange:()=>{t(p)}})),n&&(r.renderBag.groupIcon=f,f=Cn.createElement(It,{render:n,renderParam:r})),f}}function xg(){return{getGroupColumnRender:ac,getGroupColumnRenderGroupIcon:lc}}function Mg(o,e,t){return Pg(o,e,t,xg())}function Eg(o,e,t){return Dg(o,e,t,xg())}function Ag(o){let{pivotColumns:e,groupBy:t,pivotBy:n,selectionMode:r,groupColumn:i,pivotTotalColumnPosition:a,pivotGrandTotalColumnPosition:l,pivotColumn:s,groupRenderStrategy:c,toggleGroupRow:u,columns:d}=o;if(c==="inline")return{columns:void 0,groupColumnIds:[]};let p={},f=[];if(c==="multi-column")t.forEach((m,g,b)=>{let h=Mg({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}`;f.push(y),p[y]=h});else if(c==="single-column"&&t.length){let m=Eg({groupCount:t.length,groupBy:t,pivotBy:n,groupRenderStrategy:c,selectionMode:r},u,i),g=m.id||"group-by";f.push(g),p[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=T=>S.renderValue(T)),p[g]=S})}else Object.keys(d).forEach(m=>{let g=d[m];p[m]=g});return{columns:Object.keys(p).length?p:void 0,groupColumnIds:f}}var _g=require("react");function sc(){let{getDataSourceState:o,dataSourceActions:e,getDataSourceMasterContext:t}=Ae(r=>({getDataSourceState:r.getDataSourceState,dataSourceActions:r.dataSourceActions,getDataSourceMasterContext:r.getDataSourceMasterContext}));return(0,_g.useCallback)(r=>{let i=o(),a=new wt(i.groupRowsState);if(a.toggleGroupRow(r),e.groupRowsState=a,i.lazyLoad){let l=[Wo,...r],s=i.originalLazyGroupData.get(l);a.isGroupRowExpanded(r)?s?.cache||Io(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=Ht())}},[])}function $C(o){return(0,Wt.useMemo)(()=>hg(o),[o])}function Og(o,e){let{groupBy:t,dataSourceActions:n}=Ae(c=>({groupBy:c.dataSourceState.groupBy,dataSourceActions:c.dataSourceActions})),{groupRenderStrategy:r,pivotTotalColumnPosition:i,pivotGrandTotalColumnPosition:a}=o;(0,Wt.useEffect)(()=>{n.generateGroupRows=r!=="inline"},[r]),(0,Wt.useEffect)(()=>{n.pivotTotalColumnPosition=i},[i]),(0,Wt.useEffect)(()=>{a!=null&&(n.pivotGrandTotalColumnPosition=a)},[a]);let l=$C(t);UC(l,o,e);let{toggleGroupRow:s}=YC();return qC(l,o,e),{toggleGroupRow:s}}function UC(o,e,t){let n=sc(),{columns:r,groupRenderStrategy:i,isTree:a}=e,l=t;function s(c,u,d,p){let f={};if(d==="inline")return Object.keys(c).forEach(m=>{let g=c[m],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 I=C[T.indexInAll-1]||{indexInParentGroups:[]};if(!I||!I.dataSourceHasGrouping)return 1;let R=I.indexInParentGroups||[],v=T.indexInParentGroups||[],P=!1;for(let E=0;E<=S;E++){let M=R[E];if(v[E]!==M){P=!0;break}}if(!P)return 1;let w=T.parents[S];return w?w.groupCount-(w.collapsedChildrenCount||0)+(w.collapsedGroupsCount||0):1},renderGroupIcon:lc({groupIndexForColumn:S,groupRenderStrategy:d,toggleGroupRow:p,initialRenderGroupIcon:g.renderGroupIcon}),render:ac({groupIndexForColumn:S,groupRenderStrategy:d})}}let y={...b,...g};f[m]=y}),Object.keys(f).length===0?void 0:f}(0,Wt.useEffect)(()=>{(()=>{l.columnsWhenInlineGroupRenderStrategy=a?void 0:s(r,o,i,n)})()},[r,o,i,n])}function YC(){let{groupBy:o,pivotBy:e,selectionMode:t}=Ae(m=>({groupBy:m.dataSourceState.groupBy,pivotBy:m.dataSourceState.pivotBy,selectionMode:m.dataSourceState.selectionMode})),{componentActions:n,componentState:{columns:r,groupColumn:i,hideColumnWhenGrouped:a,groupRenderStrategy:l,pivotColumns:s,pivotColumn:c,pivotTotalColumnPosition:u,pivotGrandTotalColumnPosition:d},getComponentState:p}=Lt(),f=sc();return(0,Wt.useEffect)(()=>{(()=>{let{columns:g,groupColumnIds:b}=Ag({columns:r,groupColumn:i,pivotColumn:c,pivotTotalColumnPosition:u,pivotGrandTotalColumnPosition:d,groupRenderStrategy:l==="inline"?"single-column":l,groupBy:o,pivotBy:e,pivotColumns:s,toggleGroupRow:f,selectionMode:t});n.columnsWhenGrouping=g;let h=p().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&&(n.columnOrder=h)}})()},[r,o,e,t,a,i,l,s,u,c]),{toggleGroupRow:f}}function qC(o,e,t){let{dataArray:n,groupRowsIndexesInDataArray:r,groupBy:i,groupRowsState:a,originalLazyGroupDataChangeDetect:l,getDataSourceState:s}=Ae(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:p,groupRenderStrategy:f}=e,m=t,g=Oe(e);(0,Wt.useLayoutEffect)(()=>{if(f!=="multi-column")return;let b=g(),h=Sg(u,o),y=Tg({computedGroupColumns:h,columnVisibility:b.columnVisibility,hideEmptyGroupColumns:p,groupRowsIndexesInDataArray:r,dataArray:n,groupBy:i,groupByMap:o});St(b.columnVisibility,y)||(m.columnVisibility=y)},[s,f,l,i,o,u,p?n:null,p?a:null,p?r:null,p]),(0,Wt.useEffect)(()=>{let b=i.length>0,h=g(),{columnVisibility:y,columnVisibilityForGrouping:S,hideColumnWhenGrouped:T}=h,C={...y},I={...S},R=!1,v=new Set,P=new Set;Object.keys(u).forEach(w=>{let x=u[w];if(x.defaultHiddenWhenGroupedBy||T!=null)if(x.defaultHiddenWhenGroupedBy==="*"&&b||(x.defaultHiddenWhenGroupedBy===!0||T)&&x.field&&o.get(x.field)||typeof x.defaultHiddenWhenGroupedBy=="string"&&o.get(x.defaultHiddenWhenGroupedBy)||typeof x.defaultHiddenWhenGroupedBy=="object"&&Object.keys(x.defaultHiddenWhenGroupedBy).reduce((M,D)=>M||o.has(D),!1)){if(I[w]!==!1){if(y[w]===!1)return;I[w]=!1,R=!0,v.add(w)}}else I[w]===!1&&(delete I[w],R=!0,P.add(w))}),R&&(m.columnVisibilityForGrouping=I,P.forEach(w=>{delete C[w]}),v.forEach(w=>{C[w]=!1}),m.columnVisibility=C)},[u,c,i,o,d])}var Ng=require("react");var Fg=({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:p,filterValue:f,filterTypes:m,columnOrder:g,columnPinning:b,editable:h,columnDefaultEditable:y,columnDefaultFilterable:S,columnDefaultGroupable:T,columnDefaultSortable:C,scrollbarWidth:I,columnTypes:R,pinnedEndMaxWidth:v,pinnedStartMaxWidth:P,viewportReservedWidth:w,resizableColumns:x,columnVisibility:E,columnVisibilityAssumeVisible:M,columnSizing:D,groupBy:A})=>{let{computedRemainingSpace:N,computedColumnOrder:k,computedVisibleColumns:F,computedVisibleColumnsMap:V,computedPinnedStartColumns:j,computedPinnedEndColumns:L,computedUnpinnedColumns:U,computedPinnedStartColumnsWidth:H,computedPinnedEndColumnsWidth:q,computedUnpinnedColumnsWidth:ne,computedUnpinnedOffset:se,computedPinnedEndOffset:me,computedPinnedEndWidth:ie,computedPinnedStartWidth:ue,renderSelectionCheckBox:ce,computedColumnsMap:Y,computedColumnsMapInInitialOrder:z,fieldsToColumn:$}=(0,Ng.useMemo)(()=>pd({columns:o,scrollbarWidth:I,bodySize:e,columnMinWidth:t,columnMaxWidth:n,columnDefaultWidth:r,columnDefaultFlex:i,columnCssEllipsis:l,columnHeaderCssEllipsis:s,viewportReservedWidth:w,resizableColumns:x,filterValue:f,filterTypes:m,sortable:a,sortInfo:d,multiSort:p,pinnedEndMaxWidth:v,pinnedStartMaxWidth:P,draggableColumns:c,columnDefaultDraggable:u,columnOrder:g,columnPinning:b,columnDefaultEditable:y,columnDefaultFilterable:S,columnDefaultGroupable:T,columnDefaultSortable:C,editable:h,columnSizing:D,columnTypes:R,columnVisibility:E,columnVisibilityAssumeVisible:M??!0,groupBy:A}),[o,e.width,t,n,r,w,I,a,d,p,f,m,g,E,M,u,c,x,v,P,D,R,b,y,S,T,h,A,1]);return{renderSelectionCheckBox:ce,columns:o,computedColumnsMap:Y,computedPinnedEndWidth:ie,computedPinnedStartWidth:ue,computedRemainingSpace:N,computedUnpinnedOffset:se,computedPinnedEndOffset:me,computedPinnedStartColumnsWidth:H,computedPinnedEndColumnsWidth:q,computedUnpinnedColumnsWidth:ne,computedPinnedStartColumns:j,computedPinnedEndColumns:L,computedUnpinnedColumns:U,computedVisibleColumns:F,computedVisibleColumnsMap:V,computedColumnOrder:k,computedColumnsMapInInitialOrder:z,fieldsToColumn:$}};var kg=require("react");var Ba=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 XC(o,e){let t=o.rowDetailHeight,n=o.rowHeight,{isRowDetailsExpanded:r,isRowDetailsEnabled:i,getDataSourceState:a}=o;if(!r)return typeof n=="function"?u=>{if(e&&e.rowHeight.has(u))return e.rowHeight.get(u);let d=a().dataArray[u],p=d?n(d):0;return e&&e.rowHeight.set(u,p),p}:n;let l=typeof n=="function",s=typeof t=="function";return u=>{if(e&&e.rowHeight.has(u)&&e.rowDetailHeight.has(u))return e.rowHeight.get(u)+e.rowDetailHeight.get(u);let d=a().dataArray[u];if(!d)return e&&(e.rowHeight.set(u,0),e.rowDetailHeight.set(u,0)),0;let p=l?n(d):n;if(!!(!i||typeof i=="function"&&i(d)===!1)||!r(d))return e&&(e.rowHeight.set(u,p),e.rowDetailHeight.set(u,0)),p;let m=0;return s?m=t(d):m=t,e&&(e.rowHeight.set(u,p),e.rowDetailHeight.set(u,m)),p+m}}function Lg(o){let e=new Ba;return{computedRowHeight:XC(o,e),computedRowSizeCacheForDetails:o.isRowDetailsExpanded?e:void 0}}function zg(o){return(0,kg.useMemo)(()=>Lg(o),[o.rowHeight,o.rowDetailHeight,o.isRowDetailsExpanded,o.isRowDetailsEnabled,o.getDataSourceState])}var ar=require("react");var ZC={vertical:!1,horizontal:!1};function Vg(o){let e=o().brain,{getDataSourceState:t}=eo(),[n,r]=(0,ar.useState)(ZC);return(0,ar.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,ar.useLayoutEffect)(()=>{let i=t(),{onScrollbarsChange:a}=o(),{notifyScrollbarsChange:l}=i;a&&i.updatedAt&&i.dataArray.length&&a(n),l(n)},[n]),n}function Gg(o){let{state:e,actions:t,getState:n}=o,{columnOrder:r,columnCssEllipsis:i,columnHeaderCssEllipsis:a,columnMinWidth:l,columnMaxWidth:s,columnDefaultWidth:c,columnDefaultFlex:u,columnDefaultSortable:d,columnDefaultDraggable:p,pinnedStartMaxWidth:f,pinnedEndMaxWidth:m,columnVisibility:g,columnPinning:b,columnSizing:h,editable:y,columnDefaultEditable:S,columnDefaultFilterable:T,columnDefaultGroupable:C,columnTypes:I,rowHeight:R,rowDetailHeight:v,isRowDetailExpanded:P,isRowDetailEnabled:w,bodySize:x,showSeparatePivotColumnForSingleAggregation:E,onRowHeightCSSVarChange:M,onFlashingDurationCSSVarChange:D,onRowDetailHeightCSSVarChange:A,onColumnHeaderHeightCSSVarChange:O,computedColumns:N,viewportReservedWidth:k,resizableColumns:F,sortable:V,draggableColumns:j}=e,L=t,{multiSort:U,filterValue:H,filterTypes:q,groupBy:ne,sortInfo:se,dataSourceActions:me,getDataSourceState:ie,dataSourceApi:ue}=Ae(le=>({dataSourceActions:le.dataSourceActions,getDataSourceState:le.getDataSourceState,dataSourceApi:le.dataSourceApi,sortInfo:le.dataSourceState.sortInfo,multiSort:le.dataSourceState.multiSort,filterValue:le.dataSourceState.filterValue,filterTypes:le.dataSourceState.filterTypes,groupBy:le.dataSourceState.groupBy}));(0,qo.useState)(()=>{M.onChange(le=>{le&&(L.rowHeight=le)}),D.onChange(le=>{let Fe=le?le*1:null;Fe!=null&&!isNaN(Fe)&&(L.flashingDurationCSSVarValue=Fe)}),A.onChange(le=>{le&&(L.rowDetailHeight=le)}),O.onChange(le=>{le&&(L.columnHeaderHeight=le)})}),(0,qo.useEffect)(()=>{me.showSeparatePivotColumnForSingleAggregation=E},[E]);let{toggleGroupRow:ce}=Og(e,t),Y=N,{computedColumnOrder:z,computedVisibleColumns:$,computedVisibleColumnsMap:X,computedPinnedStartColumns:W,computedPinnedEndColumns:re,computedUnpinnedColumns:he,computedPinnedStartColumnsWidth:be,computedPinnedEndColumnsWidth:G,computedUnpinnedColumnsWidth:_,computedUnpinnedOffset:de,computedPinnedEndOffset:Te,computedRemainingSpace:xe,computedPinnedStartWidth:Ce,computedPinnedEndWidth:Ne,renderSelectionCheckBox:Le,computedColumnsMap:He,computedColumnsMapInInitialOrder:tt,fieldsToColumn:Xe}=Fg({columns:Y,scrollbarWidth:void 0,columnCssEllipsis:i,columnHeaderCssEllipsis:a,columnMinWidth:l,columnMaxWidth:s,columnDefaultWidth:c,columnDefaultFlex:u,columnDefaultSortable:d,columnDefaultDraggable:p,pinnedStartMaxWidth:f,pinnedEndMaxWidth:m,bodySize:x,viewportReservedWidth:k,resizableColumns:F,sortable:V,draggableColumns:j,sortInfo:se??void 0,multiSort:U,groupBy:ne,columnOrder:r,columnVisibility:g,columnVisibilityAssumeVisible:!0,columnPinning:b,editable:y,columnDefaultEditable:S,columnDefaultFilterable:T,columnDefaultGroupable:C,filterValue:H,filterTypes:q,columnSizing:h,columnTypes:I}),ot=ag($),it=sg($),K=Vg(n),ae=Ce?be>Ce:!1,fe=Ne?G>Ne:!1,[Se]=(0,qo.useState)(()=>new Fa({isRowDisabledAt:Fe=>ie().dataArray[Fe]?.rowDisabled??!1,getIdForIndex:Fe=>ie().dataArray[Fe]?.id??-1})),qe=Oe($),[pe]=(0,qo.useState)(()=>new Na({getPrimaryKeyByIndex:ue.getPrimaryKeyByIndex,getColumnIdByIndex:le=>qe()[le]?.id||""})),{computedRowHeight:Z,computedRowSizeCacheForDetails:at}=zg({rowDetailHeight:v,rowHeight:R,isRowDetailsExpanded:P,isRowDetailsEnabled:w,getDataSourceState:ie});return(0,qo.useMemo)(()=>({multiRowSelector:Se,multiCellSelector:pe,computedRowSizeCacheForDetails:at,computedRowHeight:Z,scrollbars:K,columnSize:it,rowspan:ot,toggleGroupRow:ce,computedColumnsMap:He,computedColumnsMapInInitialOrder:tt,renderSelectionCheckBox:Le,computedPinnedStartOverflow:ae,computedPinnedEndOverflow:fe,computedPinnedStartWidth:Ce,computedPinnedEndWidth:Ne,computedVisibleColumns:$,computedColumnOrder:z,computedRemainingSpace:xe,computedVisibleColumnsMap:X,computedPinnedStartColumns:W,computedPinnedEndColumns:re,computedUnpinnedColumns:he,computedPinnedStartColumnsWidth:be,computedPinnedEndColumnsWidth:G,computedUnpinnedColumnsWidth:_,computedUnpinnedOffset:de,computedPinnedEndOffset:Te,fieldsToColumn:Xe}),[Se,pe,at,Z,K,it,ot,ce,He,tt,Le,ae,fe,Ce,Ne,$,z,xe,X,W,re,he,be,G,_,de,Te,Xe])}var Bg=require("react");function QC(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 JC(){return 4294967295}function eI(o,e,t){return e=e>>>8^o[t^e&255],e}function tI(o){return o=~o,o=o<0?4294967295+o+1:o,o}function cc(o,e=3988292384){var t=QC(e),n=0,r;for(n=JC(),r=0;r<o.length;r++)n=eI(t,n,o.charCodeAt(r));return n=tI(n),`${n}`}var oI=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")??""}},Hg=(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))},Kg=(o="",e,t)=>{let n;try{n=nI(o)}catch{return Hg(["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?(Hg([`
|
|
27
|
+
Component DEBUG_ID = "${o.debugId}"`),t(r,n,e)},ni=o=>{let{debugId:e,key:t}=o,n=ag[t];if(n&&(tI({...n,debugId:e}),e&&t)){let r=yt.get(e);r&&r.getState().devToolsDetected&&n&&(r.getState().debugWarnings.set(t,{...n,debugId:e,status:"new"}),Xo(e))}};globalThis.logDevToolsWarning=ni;var Xo=o=>{let e=window.__INFINITE_TABLE_DEVTOOLS_HOOK__;if(!e)return;let t=yt.get(o);t&&e(o,t)};function sg(o){let{getDataSourceState:e,dataSourceActions:t,dataSourceState:n}=o,{data:r,dataArray:i,notifyScrollbarsChange:a,refetchKey:l,sortInfo:s,shouldReloadData:u,groupBy:c,pivotBy:d,filterValue:p,filterMode:f,livePagination:m,livePaginationCursor:g,filterTypes:y,cursorId:h}=n,[b,S]=(0,lt.useState)({vertical:!1,horizontal:!1}),I=(0,lt.useRef)(b);(0,lt.useEffect)(()=>(a.onChange(w=>{w&&(I.current=w,S(w))}),()=>a.destroy()),[a]),(0,lt.useEffect)(()=>{if(!m)return;let w=requestAnimationFrame(()=>{I.current?.vertical||g&&(t.cursorId=g)});return()=>cancelAnimationFrame(w)},[g]),(0,lt.useEffect)(()=>{if(!m||g!==void 0)return;let w=requestAnimationFrame(()=>{I.current?.vertical||h!=null&&i.length&&(t.cursorId=i.length)});return()=>cancelAnimationFrame(w)},[i.length,g]),(0,lt.useEffect)(()=>{let w=e(),{livePaginationCursor:x,livePagination:E,dataArray:M}=w;!b.vertical&&E&&(x?t.cursorId=x:x===void 0&&M.length&&(t.cursorId=M.length))},[b.vertical]);let T=(0,lt.useMemo)(()=>Na(p,{filterTypes:y,filterMode:f}),[p,f,y]),C={sortInfo:u.sortInfo?s:null,groupBy:u.groupBy?c:null,pivotBy:u.pivotBy?d:null,refetchKey:l,filterValue:u.filterValue?T:null,cursorId:m?h:null},R=(0,lt.useRef)(!0);oI(o,{sortInfo:s,groupBy:c,pivotBy:d,filterValue:p,refetchKey:l,cursorId:m?h:null});let v=Si(),P=(0,lt.useRef)([]);Cn(()=>{let w=e(),x=v(),{isDetail:E,isDetailReady:M}=qs(x,e);if(E&&!M)return;let D=Date.now(),A=P.current;A.length>=10&&A.splice(0,1),A.push(D),D-A[0]<200&&A.length>=10&&ni({debugId:w.debugId,key:"DS001"}),typeof w.data!="function"&&Ro(w.data,w,t,void 0,x)},{data:r}),Cn(w=>{let x=Object.keys(w),E=!1;if(x.length===1){if(E=!!w.cursorId,w.filterValue&&e().filterMode==="local")return;let N=e().data;if(Array.isArray(N)&&w.refetchKey){t.originalDataArray=N;return}}let M=v(),{isDetail:D,isDetailReady:A}=qs(M,e);if(D&&!A)return;let O=e();if(typeof O.data=="function"){let N;O.debugId&&(N=at(O.debugId).track.DataSource.label.RemoteDataLoad.start()),Ro(O.data,O,t,{append:E},M).then(()=>{N?.end()})}},{...C,data:r}),Cn(()=>{let w=e();if(R.current){R.current=!1;let x=Bt(w,void 0,v());t.dataParams=x}},C)}function oI(o,e){let{getDataSourceState:t,dataSourceActions:n,dataSourceState:r}=o;(0,lt.useEffect)(()=>{n.lazyLoadCacheOfLoadedBatches=new ee},[r.data,r.dataParams]);let{lazyLoadBatchSize:i,lazyLoad:a,originalLazyGroupDataChangeDetect:l,notifyRenderRangeChange:s,dataArray:u,groupRowsState:c,scrollStopDelayUpdatedByTable:d}=r,p=(0,lt.useRef)(null),f=(g,y,h=t().lazyLoadCacheOfLoadedBatches)=>{let b=t();if(g=g||p.current,!g)return;let{renderStartIndex:S,renderEndIndex:I}=g,{lazyLoadBatchSize:T,lazyLoad:C}=b;C&&((!T||T<=0)&&(!b.groupBy||b.groupBy.length===0)||Um({startIndex:S,endIndex:I,lazyLoadBatchSize:T,componentState:b,componentActions:n,dismissLoadedRows:y?.dismissLoadedRows??!1},h))},m=(0,lt.useMemo)(()=>Ot(f,{wait:d}),[d]);Cn(g=>{if(a)return g.sortInfo||g.filterValue||g.groupBy||g.pivotBy||g.refetchKey||g.cursorId?(t().lazyLoadCacheOfLoadedBatches.clear(),t().originalLazyGroupData.clear(),f(s.get(),{dismissLoadedRows:!0})):(g.originalLazyGroupDataChangeDetect||g.groupRowsState)&&f(s.get()),s.onChange(y=>{p.current=y,f(y)})},{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:c}),(0,lt.useEffect)(()=>{i&&i>0&&m()},[u])}function lr(o){let e=Mo(),t=Si(),n=!!e,r=n?e.id:"master",{contextValue:i,ContextComponent:a}=nu(o),{componentActions:l,componentState:s,assignState:u}=i;s.getDataSourceMasterContextRef.current=t;let c=Ne(s),[d]=(0,ct.useState)(()=>ym({getState:c,actions:l})),p={dataSourceState:s,dataSourceActions:l,getDataSourceMasterContext:t,getDataSourceState:c,assignState:u,dataSourceApi:d},f=Ne(i),m=Ne(p),g=Ns(),y=(0,ct.useCallback)(({children:h})=>{let b=ha(),[S]=(0,ct.useState)(()=>rg());typeof h=="function"&&(h=h(c()));let I=m();return S.setSnapshot(I),(0,ct.useLayoutEffect)(()=>{S.notify()}),ct.default.createElement(a.Provider,{key:r,value:f()},ct.default.createElement(g.Provider,{value:I},ct.default.createElement(b.Provider,{value:S},h)))},[a,n,r]);return(0,ct.useLayoutEffect)(()=>{let h=t();h&&h.registerDetail(p)},[]),(0,ct.useLayoutEffect)(()=>()=>{let h=c();h.onCleanup(h)},[]),sg({dataSourceState:s,dataSourceActions:l,getDataSourceState:c}),(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:y,state:p.dataSourceState}}function ug(){return Ee(o=>o.dataSourceApi)}var Ka=class Ka{constructor(e,t){this.keysInOrder=[];if(typeof e=="number")this.maxSize=e,this.currentMap=new Map;else if(this.maxSize=t??Ka.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}};Ka.DEFAULT_SIZE=10;var Ha=Ka;var ru=class{add(e,t){}get(e){}delete(e){}has(e){return!1}},Ba=class{constructor(e){this.storage=new Ha(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)}},iu=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)}},sr=class{constructor(e){this.cacheStorage=e===!1?new ru:e===!0?new iu:typeof e=="number"?new Ba(e):new Ba(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 cg=(e=>(e.INIT="INIT",e))(cg||{});var{useManagedComponent:nu}=Ft({debugName:"DataSource",initSetupState:Em,forwardProps:_m,concludeReducer:jm,mapPropsToState:Nm,onPropChange:Fm,cleanup:Am,interceptActions:km(),mappedCallbacks:Lm()});function nI(o){let{DataSource:e}=lr(o);return dg.createElement(e,null,o.children??null)}function rI(){let{rowInfoReducerResults:o}=Ee(e=>({rowInfoReducerResults:e.dataSourceState.rowInfoReducerResults}));return o}function fg(o){let{getDataSourceState:e}=Ee(n=>({getDataSourceState:n.getDataSourceState}));return(0,pg.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,u=o[i];return!u||!u.rowspan?1:u.rowspan({column:u,data:s,dataArray:a,rowInfo:l,rowIndex:r})}:void 0,[o])}var mg=require("react");var rV=Nt("useColumnSizeFn");function gg(o){return(0,mg.useCallback)(t=>{let n=o[t];return n?n.computedWidth:0},[o])}var Wt=require("react");var iI={scrollLeft:0,scrollTop:0},ri=class{constructor(){this.scrollPosition=iI;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 hg(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 yg=j(require("react"));function bg(o){return(e,t)=>yg.createElement(o,{key:e.id,rowInfo:e,cache:t})}var ii=class extends mn{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 u=l-s*this.pageWidth,c=[];for(let d=0;d<this.initialCols;d++)c.push(this.getItemSize(d,t));return a+=ta(u,c.concat(c)),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,u=typeof l=="number",c=typeof s=="number",d=u&&l!==this.availableWidth,p=c&&s!==this.availableHeight;d&&(this.availableWidth=l,this.availableRenderWidth=l),p&&(this.availableHeight=s,this.availableRenderHeight=s),(d||p)&&this.notifyAvailableSizeChange();let f=typeof n=="number",m=typeof r=="number",g=f&&n!==this.initialRows,y=m&&r!==this.initialCols;f&&g&&(this.initialRows=n,this.rows=n),m&&y&&(this.initialCols=r,this.cols=r);let h=i!=null,b=a!=null,S=h&&i!==this.rowHeight,I=b&&a!==this.initialColWidth;h&&(this.rowHeight=i),b&&(this.initialColWidth=a,this.colWidth=this.getColWidth);let T=g||S||p,C=y||I||d||T;(C||T)&&this.updateRenderCount({horizontal:C,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=ho){let n=this.getInitialRowHeight(),r=0;for(let a=0;a<this.initialCols;a++)r+=this.getColWidth(a);this.pageWidth=r,this.rowsPerPage=Math.floor(this.availableHeight/n);let i=!1;if(!this.options.masterBrain){let a=this.totalPageCount;this.totalPageCount=this.rowsPerPage?Math.ceil(this.initialRows/this.rowsPerPage):0,a!=this.totalPageCount&&(i=!0)}this.visiblePageCount=this.totalPageCount&&this.pageWidth?Math.max(Math.ceil(this.availableWidth/this.pageWidth),1):1,this.availableRenderHeight=this.visiblePageCount*this.rowsPerPage*n,this.cols=Math.max(this.totalPageCount*this.initialCols,this.initialCols),this.rows=this.rowsPerPage,super.doUpdateRenderCount(t),i&&this.notifyTotalPageCountChange()}notifyTotalPageCountChange(){if(this.destroyed)return;let t=this.onTotalPageCountChangeFns;t.forEach(n=>{Ve(()=>{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}};function In(){return{current:null}}var Sg={};function au(o){return`.${Qt}[data-row-index${o?`="${o.rowIndex}"`:""}][data-col-index${o?`="${o.colIndex}"`:""}]`}function lu(o,e){let t=Ko(o),n=e?new ii(t,{isHeader:!1}):new mn(t),r=`${t}:header`,i=e?new ii(r,{isHeader:!0,masterBrain:n}):new mn(r);n.onScroll(c=>{i.setScrollPosition({scrollLeft:c.scrollLeft,scrollTop:0})});let{renderer:a,onRenderUpdater:l}=qr(n),{renderer:s,onRenderUpdater:u}=qr(i);return n.onAvailableSizeChange(c=>{i.update({width:c.width})}),{brain:n,headerBrain:i,renderer:a,onRenderUpdater:l,headerRenderer:s,headerOnRenderUpdater:u}}function Tg({debugId:o,wrapRowsHorizontally:e}){let t={},{brain:n,headerBrain:r,renderer:i,onRenderUpdater:a,headerRenderer:l,headerOnRenderUpdater:s}=lu(o,!!e),u=In(),c=Date.now();return{debugWarnings:new Map,renderer:i,onRenderUpdater:a,headerRenderer:l,headerOnRenderUpdater:s,updatedAt:c,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(!u.current)return null;let p=au(d);return u.current.querySelector(p)||null},brain:n,headerBrain:r,domRef:u,columnMenuTargetRef:In(),editingValueRef:In(),scrollerDOMRef:In(),portalDOMRef:In(),focusDetectDOMRef:In(),activeCellIndicatorDOMRef:In(),onColumnMenuClick:be(),cellContextMenu:be(),contextMenu:be(),onFilterOperatorMenuClick:be(),flashingDurationCSSVarValue:null,onFlashingDurationCSSVarChange:be(),onRowHeightCSSVarChange:be(),onRowDetailHeightCSSVarChange:be(),onColumnHeaderHeightCSSVarChange:be(),cellClick:be(),cellMouseDown:be(),keyDown:be(),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 ri,pinnedEndScrollListener:new ri,columnsWhenInlineGroupRenderStrategy:void 0,editingCell:null,forceBodyRerenderTimestamp:0}}var Cg=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 sr(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??Sg,columnGroupVisibility:e=>e??Sg,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 aI(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 Ig=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 Rg(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 Wa=new WeakMap;function wg(){return{rowDetailState:(o,e)=>({callbackParams:[o,{expandRow:e.lastRowToExpandRef.current,collapseRow:e.lastRowToCollapseRef.current}]})}}var vg=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?hg(i,t.columnGroupVisibility):t.columnGroupsDepthsMap,l=r?.groupBy,s=aI({groupRenderStrategy:e.groupRenderStrategy,groupBy:l,groupColumn:e.groupColumn}),u,c=e.rowDetailRenderer,d=e.components?.RowDetail;if(!c&&d){let y=Wa.get(d);y||(y=bg(d),Wa.set(d,y)),c=y}c&&(u=e.rowDetailState||t.rowDetailState||e.defaultRowDetailState,u&&!(u instanceof Mt)&&(u=new Mt(u)),u=u||new Mt({expandedRows:[],collapsedRows:!0}));let p=t.columnsWhenGrouping||t.columnsWhenInlineGroupRenderStrategy||t.columns,f=u?e.isRowDetailExpanded:void 0;!f&&u&&(f=Wa.get(u),f||(f=y=>u.isRowDetailsExpanded(y.id),typeof u=="object"&&Wa.set(u,f)));let m=c?e.isRowDetailEnabled||!0:!1,g={updatedAt:Date.now(),isTree:r.isTree,rowDetailRenderer:c,rowDetailState:u,isRowDetailExpanded:f,isRowDetailEnabled:m,showColumnFilters:e.showColumnFilters??!!r.filterValue,controlledColumnVisibility:!!e.columnVisibility,groupRenderStrategy:s,groupBy:l,computedColumns:p,initialColumns:e.columns,keyboardNavigation:e.keyboardNavigation??(t.activeCellIndex!=null?"cell":t.activeRowIndex!=null?"row":"cell"),columnHeaderCssEllipsis:e.columnHeaderCssEllipsis??e.columnCssEllipsis??!0,columnGroupsDepthsMap:a,columnGroupsMaxDepth:a!=t.columnGroupsDepthsMap?Math.max(...a.values(),-1):t.columnGroupsMaxDepth,computedColumnGroups:i,rowHeightCSSVar:typeof e.rowHeight=="string"?e.rowHeight:"",rowDetailHeightCSSVar:typeof e.rowDetailHeight=="string"?e.rowDetailHeight:"",columnHeaderHeightCSSVar:typeof e.columnHeaderHeight=="string"?e.columnHeaderHeight||ge.components.Header.columnHeaderHeight:""};if(t.devToolsDetected&&t.debugId){let y=To.get(t.debugId);y&&(g={...g,...y})}return g};function Pg(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 Dg(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,u=0,c=r.length;for(let d=0;d<c;d++){let p=r[d],f=i[p];if(!f.isTreeNode&&f.isGroupRow&&(u=Math.max(u,f.groupNesting-1),u===s-1))break}return Object.keys(n).forEach(d=>{let p=n[d],{groupByForColumn:f}=p;if(Array.isArray(f))return;let m=f.field||f.groupField;if(!m)return;t.get(m).groupIndex>u&&e?l[d]!==!1&&(l[d]=!1):l.hasOwnProperty(d)&&delete l[d]}),l}var Rn=j(require("react"));var xg=o=>o.dataSourceHasGrouping&&o.isGroupRow&&o.childrenLoading||!o.selfLoaded;var ja=j(require("react"));var Mg="_16lm1iwb _16lm1iw1d _16lm1iwk";var Eg="164.93361431346415 56.97787143782138",Ag={margin:"auto",display:"block",shapeRendering:"auto"},LV=Object.keys({size:1,style:1,className:1,viewBox:1});var _g=o=>ja.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",style:{...Ag,...o.style},width:"24px",height:"24px",viewBox:o.viewBox??"0 0 100 100",preserveAspectRatio:"xMidYMid",className:te(o.className,Mg,"InfiniteIcon","InfiniteIcon-loading")},ja.createElement("circle",{cx:"50",cy:"50",fill:"none",strokeWidth:"10",r:"35",strokeDasharray:Eg},ja.createElement("animateTransform",{attributeName:"transform",type:"rotate",repeatCount:"indefinite",dur:"1s",values:"0 50 50;360 50 50",keyTimes:"0;1"})));function Og(o,e,t,n){let{groupByForColumn:r,groupIndexForColumn:i,groupRenderStrategy:a}=o,l=r.column?{...r.column}:{},s={header:`Group by ${r.field||r.groupField}`,groupByForColumn:r,render:n.getGroupColumnRender({groupIndexForColumn:i,groupRenderStrategy:a}),...l,renderGroupIcon:n.getGroupColumnRenderGroupIcon({initialRenderGroupIcon:l?.renderGroupIcon,groupIndexForColumn:i,toggleGroupRow:e,groupRenderStrategy:a})};return t&&(typeof t=="function"?s={...s,...t(o,e)}:s={...s,...t}),s}function Ng(o,e,t,n){let r=typeof t=="function"?t(o,e):t,i={};return o.sortable!=null&&(i.sortable=o.sortable),{...i,header:"Group",groupByForColumn:o.groupBy,renderSelectionCheckBox:o.selectionMode==="multi-row",render:n.getGroupColumnRender({groupIndexForColumn:0,groupRenderStrategy:"single-column"}),...r,renderGroupIcon:n.getGroupColumnRenderGroupIcon({initialRenderGroupIcon:r?.renderGroupIcon,groupIndexForColumn:0,toggleGroupRow:e,groupRenderStrategy:"single-column"})}}function su({groupIndexForColumn:o,groupRenderStrategy:e}){return t=>{let{rowInfo:n,renderBag:r,column:i,align:a}=t,{value:l,groupIcon:s,selectionCheckBox:u}=r,c=n,d=te(Fn.flex,i.align==="end"?xr.rowReverse:xr.row,hc.center,`${Qt}Expander`,e==="single-column"||e==="multi-column"&&(!n.isGroupRow||u)?Rp({align:a}):null);if(e==="multi-column"){if(o+1!==c.groupNesting&&c.isGroupRow)return u?Rn.createElement("div",{className:d},u):null}else e==="single-column"&&c.isGroupRow;return Rn.createElement("div",{className:d},s,u,Rn.createElement("div",{className:Yt},l??null))}}function uu({groupIndexForColumn:o,groupRenderStrategy:e,toggleGroupRow:t,initialRenderGroupIcon:n}){return r=>{let{rowInfo:i,value:a,rootGroupBy:l,pivotBy:s,column:u}=r,c=e!=="inline"?i:i.isGroupRow&&i.parents?.[o]||i;if(!c)return null;let d=c.collapsed;if(e==="inline"){if(c.groupCount===1)return a;if(c.groupNesting===o&&d)return null}else if(!c.isGroupRow||e==="multi-column"&&o+1!==c.groupNesting)return null;let p=c.groupKeys,f=null,m=s?(c.groupKeys?.length||0)<l?.length:(c.groupKeys?.length||0)<=l?.length;return xg(c)?f=Rn.createElement(_g,null):m&&(f=Rn.createElement(un,{expanded:!d,direction:u.align==="end"?"end":"start",onChange:()=>{t(p)}})),n&&(r.renderBag.groupIcon=f,f=Rn.createElement(It,{render:n,renderParam:r})),f}}function Fg(){return{getGroupColumnRender:su,getGroupColumnRenderGroupIcon:uu}}function Lg(o,e,t){return Og(o,e,t,Fg())}function kg(o,e,t){return Ng(o,e,t,Fg())}function zg(o){let{pivotColumns:e,groupBy:t,pivotBy:n,selectionMode:r,groupColumn:i,pivotTotalColumnPosition:a,pivotGrandTotalColumnPosition:l,pivotColumn:s,groupRenderStrategy:u,toggleGroupRow:c,columns:d}=o;if(u==="inline")return{columns:void 0,groupColumnIds:[]};let p={},f=[];if(u==="multi-column")t.forEach((m,g,y)=>{let h=Lg({groupByForColumn:m,groupBy:t,pivotBy:n,groupIndexForColumn:g,groupCount:y.length,groupRenderStrategy:u,selectionMode:r},c,i),b=h.id||`group-by-${m.field||m.groupField}`;f.push(b),p[b]=h});else if(u==="single-column"&&t.length){let m=kg({groupCount:t.length,groupBy:t,pivotBy:n,groupRenderStrategy:u,selectionMode:r},c,i),g=m.id||"group-by";f.push(g),p[g]=m}return e?Object.keys(e).forEach(m=>{let g=e[m],y=g.pivotTotalColumn&&g.columnGroup,h=g.pivotTotalColumn&&!g.columnGroup;if(y&&a===!1||h&&l===!1)return;let b={...g};s&&(typeof s=="function"?b={...b,...s({column:b,pivotBy:n,groupBy:t})}:b={...b,...s}),b.inheritFromColumn!==!1&&(b={...typeof b.inheritFromColumn=="string"?d[b.inheritFromColumn]:b.pivotAggregator?.field?on(d,b.pivotAggregator.field):void 0,...b}),!b.render&&b.renderValue&&(b.render=S=>b.renderValue(S)),p[m]=b}):Object.keys(d).forEach(m=>{let g=d[m];p[m]=g}),{columns:Object.keys(p).length?p:void 0,groupColumnIds:f}}var Vg=require("react");function cu(){let{getDataSourceState:o,dataSourceActions:e,getDataSourceMasterContext:t}=Ee(r=>({getDataSourceState:r.getDataSourceState,dataSourceActions:r.dataSourceActions,getDataSourceMasterContext:r.getDataSourceMasterContext}));return(0,Vg.useCallback)(r=>{let i=o(),a=new wt(i.groupRowsState);if(a.toggleGroupRow(r),e.groupRowsState=a,i.lazyLoad){let l=[jo,...r],s=i.originalLazyGroupData.get(l);a.isGroupRowExpanded(r)?s?.cache||Ro(i.data,i,e,{groupKeys:r},t()):s?.cache||(i.lazyLoadCacheOfLoadedBatches.getKeysStartingWith(r).forEach(c=>{i.lazyLoadCacheOfLoadedBatches.delete(c)}),e.lazyLoadCacheOfLoadedBatches=ee.clone(i.lazyLoadCacheOfLoadedBatches),i.originalLazyGroupData.delete(l),e.originalLazyGroupDataChangeDetect=Ht())}},[])}function lI(o){return(0,Wt.useMemo)(()=>Rg(o),[o])}function Gg(o,e){let{groupBy:t,dataSourceActions:n}=Ee(u=>({groupBy:u.dataSourceState.groupBy,dataSourceActions:u.dataSourceActions})),{groupRenderStrategy:r,pivotTotalColumnPosition:i,pivotGrandTotalColumnPosition:a}=o;(0,Wt.useEffect)(()=>{n.generateGroupRows=r!=="inline"},[r]),(0,Wt.useEffect)(()=>{n.pivotTotalColumnPosition=i},[i]),(0,Wt.useEffect)(()=>{a!=null&&(n.pivotGrandTotalColumnPosition=a)},[a]);let l=lI(t);sI(l,o,e);let{toggleGroupRow:s}=uI();return cI(l,o,e),{toggleGroupRow:s}}function sI(o,e,t){let n=cu(),{columns:r,groupRenderStrategy:i,isTree:a}=e,l=t;function s(u,c,d,p){let f={};if(d==="inline")return Object.keys(u).forEach(m=>{let g=u[m],y={},h=c.get(g.field);if(h&&d==="inline"){let{groupIndex:S}=h;y={groupByForColumn:h.groupBy,field:h.groupBy?.field,valueGetter:h.groupBy?.valueGetter,valueFormatter:({rowInfo:I})=>I.isGroupRow?I.groupKeys?.[S]:I.value,rowspan:({rowInfo:I,dataArray:T})=>{if(I.isTreeNode||!I.isGroupRow)return 1;let C=T[I.indexInAll-1]||{indexInParentGroups:[]};if(!C||!C.dataSourceHasGrouping)return 1;let R=C.indexInParentGroups||[],v=I.indexInParentGroups||[],P=!1;for(let E=0;E<=S;E++){let M=R[E];if(v[E]!==M){P=!0;break}}if(!P)return 1;let w=I.parents[S];return w?w.groupCount-(w.collapsedChildrenCount||0)+(w.collapsedGroupsCount||0):1},renderGroupIcon:uu({groupIndexForColumn:S,groupRenderStrategy:d,toggleGroupRow:p,initialRenderGroupIcon:g.renderGroupIcon}),render:su({groupIndexForColumn:S,groupRenderStrategy:d})}}let b={...y,...g};f[m]=b}),Object.keys(f).length===0?void 0:f}(0,Wt.useEffect)(()=>{(()=>{l.columnsWhenInlineGroupRenderStrategy=a?void 0:s(r,o,i,n)})()},[r,o,i,n])}function uI(){let{groupBy:o,pivotBy:e,selectionMode:t}=Ee(m=>({groupBy:m.dataSourceState.groupBy,pivotBy:m.dataSourceState.pivotBy,selectionMode:m.dataSourceState.selectionMode})),{componentActions:n,componentState:{columns:r,groupColumn:i,hideColumnWhenGrouped:a,groupRenderStrategy:l,pivotColumns:s,pivotColumn:u,pivotTotalColumnPosition:c,pivotGrandTotalColumnPosition:d},getComponentState:p}=Lt(),f=cu();return(0,Wt.useEffect)(()=>{(()=>{let{columns:g,groupColumnIds:y}=zg({columns:r,groupColumn:i,pivotColumn:u,pivotTotalColumnPosition:c,pivotGrandTotalColumnPosition:d,groupRenderStrategy:l==="inline"?"single-column":l,groupBy:o,pivotBy:e,pivotColumns:s,toggleGroupRow:f,selectionMode:t});n.columnsWhenGrouping=g;let h=p().columnOrder;if(y.length&&Array.isArray(h)){let b=new Set(h),S=!1;y.forEach(I=>{b.has(I)||(S=!0,h=[I,...h])}),S&&(n.columnOrder=h)}})()},[r,o,e,t,a,i,l,s,c,u]),{toggleGroupRow:f}}function cI(o,e,t){let{dataArray:n,groupRowsIndexesInDataArray:r,groupBy:i,groupRowsState:a,originalLazyGroupDataChangeDetect:l,getDataSourceState:s}=Ee(y=>({getDataSourceState:y.getDataSourceState,dataArray:y.dataSourceState.dataArray,groupRowsIndexesInDataArray:y.dataSourceState.groupRowsIndexesInDataArray,groupBy:y.dataSourceState.groupBy,groupRowsState:y.dataSourceState.groupRowsState,originalLazyGroupDataChangeDetect:y.dataSourceState.originalLazyGroupDataChangeDetect})),{columnTypes:u,computedColumns:c,hideColumnWhenGrouped:d,hideEmptyGroupColumns:p,groupRenderStrategy:f}=e,m=t,g=Ne(e);(0,Wt.useLayoutEffect)(()=>{if(f!=="multi-column")return;let y=g(),h=Pg(c,o),b=Dg({computedGroupColumns:h,columnVisibility:y.columnVisibility,hideEmptyGroupColumns:p,groupRowsIndexesInDataArray:r,dataArray:n,groupBy:i,groupByMap:o});St(y.columnVisibility,b)||(m.columnVisibility=b)},[s,f,l,i,o,c,p?n:null,p?a:null,p?r:null,p]),(0,Wt.useEffect)(()=>{let y=i.length>0,h=g(),{columnVisibility:b,columnVisibilityForGrouping:S,hideColumnWhenGrouped:I}=h,T={...b},C={...S},R=!1,v=new Set,P=new Set;Object.keys(c).forEach(w=>{let x=c[w];if(x.defaultHiddenWhenGroupedBy||I!=null)if(x.defaultHiddenWhenGroupedBy==="*"&&y||(x.defaultHiddenWhenGroupedBy===!0||I)&&x.field&&o.get(x.field)||typeof x.defaultHiddenWhenGroupedBy=="string"&&o.get(x.defaultHiddenWhenGroupedBy)||typeof x.defaultHiddenWhenGroupedBy=="object"&&Object.keys(x.defaultHiddenWhenGroupedBy).reduce((M,D)=>M||o.has(D),!1)){if(C[w]!==!1){if(b[w]===!1)return;C[w]=!1,R=!0,v.add(w)}}else C[w]===!1&&(delete C[w],R=!0,P.add(w))}),R&&(m.columnVisibilityForGrouping=C,P.forEach(w=>{delete T[w]}),v.forEach(w=>{T[w]=!1}),m.columnVisibility=T)},[c,u,i,o,d])}var Hg=require("react");var Kg=({columns:o,userColumns:e,bodySize:t,columnMinWidth:n,columnMaxWidth:r,columnDefaultWidth:i,columnDefaultFlex:a,sortable:l,columnCssEllipsis:s,columnHeaderCssEllipsis:u,draggableColumns:c,columnDefaultDraggable:d,sortInfo:p,multiSort:f,filterValue:m,filterTypes:g,columnOrder:y,columnPinning:h,editable:b,columnDefaultEditable:S,columnDefaultFilterable:I,columnDefaultGroupable:T,columnDefaultSortable:C,scrollbarWidth:R,columnTypes:v,pinnedEndMaxWidth:P,pinnedStartMaxWidth:w,viewportReservedWidth:x,resizableColumns:E,columnVisibility:M,columnVisibilityAssumeVisible:D,columnSizing:A,groupBy:O})=>{let{computedRemainingSpace:L,computedColumnOrder:F,computedVisibleColumns:G,computedVisibleColumnsMap:B,computedPinnedStartColumns:z,computedPinnedEndColumns:U,computedUnpinnedColumns:K,computedPinnedStartColumnsWidth:q,computedPinnedEndColumnsWidth:re,computedUnpinnedColumnsWidth:se,computedUnpinnedOffset:de,computedPinnedEndOffset:ae,computedPinnedEndWidth:ce,computedPinnedStartWidth:le,renderSelectionCheckBox:X,computedColumnsMap:k,computedColumnsMapInInitialOrder:Z,fieldsToColumn:Y}=(0,Hg.useMemo)(()=>md({columns:o,userColumns:e,scrollbarWidth:R,bodySize:t,columnMinWidth:n,columnMaxWidth:r,columnDefaultWidth:i,columnDefaultFlex:a,columnCssEllipsis:s,columnHeaderCssEllipsis:u,viewportReservedWidth:x,resizableColumns:E,filterValue:m,filterTypes:g,sortable:l,sortInfo:p,multiSort:f,pinnedEndMaxWidth:P,pinnedStartMaxWidth:w,draggableColumns:c,columnDefaultDraggable:d,columnOrder:y,columnPinning:h,columnDefaultEditable:S,columnDefaultFilterable:I,columnDefaultGroupable:T,columnDefaultSortable:C,editable:b,columnSizing:A,columnTypes:v,columnVisibility:M,columnVisibilityAssumeVisible:D??!0,groupBy:O}),[o,e,t.width,n,r,i,x,R,l,p,f,m,g,y,M,D,d,c,E,P,w,A,v,h,S,I,T,b,O,1]);return{renderSelectionCheckBox:X,columns:o,computedColumnsMap:k,computedPinnedEndWidth:ce,computedPinnedStartWidth:le,computedRemainingSpace:L,computedUnpinnedOffset:de,computedPinnedEndOffset:ae,computedPinnedStartColumnsWidth:q,computedPinnedEndColumnsWidth:re,computedUnpinnedColumnsWidth:se,computedPinnedStartColumns:z,computedPinnedEndColumns:U,computedUnpinnedColumns:K,computedVisibleColumns:G,computedVisibleColumnsMap:B,computedColumnOrder:F,computedColumnsMapInInitialOrder:Z,fieldsToColumn:Y}};var Wg=require("react");var $a=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 dI(o,e){let t=o.rowDetailHeight,n=o.rowHeight,{isRowDetailsExpanded:r,isRowDetailsEnabled:i,getDataSourceState:a}=o;if(!r)return typeof n=="function"?c=>{if(e&&e.rowHeight.has(c))return e.rowHeight.get(c);let d=a().dataArray[c],p=d?n(d):0;return e&&e.rowHeight.set(c,p),p}:n;let l=typeof n=="function",s=typeof t=="function";return c=>{if(e&&e.rowHeight.has(c)&&e.rowDetailHeight.has(c))return e.rowHeight.get(c)+e.rowDetailHeight.get(c);let d=a().dataArray[c];if(!d)return e&&(e.rowHeight.set(c,0),e.rowDetailHeight.set(c,0)),0;let p=l?n(d):n;if(!!(!i||typeof i=="function"&&i(d)===!1)||!r(d))return e&&(e.rowHeight.set(c,p),e.rowDetailHeight.set(c,0)),p;let m=0;return s?m=t(d):m=t,e&&(e.rowHeight.set(c,p),e.rowDetailHeight.set(c,m)),p+m}}function Bg(o){let e=new $a;return{computedRowHeight:dI(o,e),computedRowSizeCacheForDetails:o.isRowDetailsExpanded?e:void 0}}function jg(o){return(0,Wg.useMemo)(()=>Bg(o),[o.rowHeight,o.rowDetailHeight,o.isRowDetailsExpanded,o.isRowDetailsEnabled,o.getDataSourceState])}var ur=require("react");var pI={vertical:!1,horizontal:!1};function $g(o){let e=o().brain,{getDataSourceState:t}=eo(),[n,r]=(0,ur.useState)(pI);return(0,ur.useEffect)(()=>e.onRenderCountChange(()=>{let{scrollTopMax:i,scrollLeftMax:a}=e,l=i>0,s=a>0;r(u=>u.vertical===l&&u.horizontal===s?u:{vertical:l,horizontal:s})}),[e]),(0,ur.useLayoutEffect)(()=>{let i=t(),{onScrollbarsChange:a}=o(),{notifyScrollbarsChange:l}=i;a&&i.updatedAt&&i.dataArray.length&&a(n),l(n)},[n]),n}function Ug(o){let{state:e,actions:t,getState:n}=o,{columnOrder:r,columnCssEllipsis:i,columnHeaderCssEllipsis:a,columnMinWidth:l,columnMaxWidth:s,columnDefaultWidth:u,columnDefaultFlex:c,columnDefaultSortable:d,columnDefaultDraggable:p,pinnedStartMaxWidth:f,pinnedEndMaxWidth:m,columnVisibility:g,columnPinning:y,columnSizing:h,editable:b,columnDefaultEditable:S,columnDefaultFilterable:I,columnDefaultGroupable:T,columnTypes:C,rowHeight:R,rowDetailHeight:v,isRowDetailExpanded:P,isRowDetailEnabled:w,bodySize:x,showSeparatePivotColumnForSingleAggregation:E,onRowHeightCSSVarChange:M,onFlashingDurationCSSVarChange:D,onRowDetailHeightCSSVarChange:A,onColumnHeaderHeightCSSVarChange:O,computedColumns:N,initialColumns:L,viewportReservedWidth:F,resizableColumns:G,sortable:B,draggableColumns:z}=e,U=t,{multiSort:K,filterValue:q,filterTypes:re,groupBy:se,sortInfo:de,dataSourceActions:ae,getDataSourceState:ce,dataSourceApi:le}=Ee(me=>({dataSourceActions:me.dataSourceActions,getDataSourceState:me.getDataSourceState,dataSourceApi:me.dataSourceApi,sortInfo:me.dataSourceState.sortInfo,multiSort:me.dataSourceState.multiSort,filterValue:me.dataSourceState.filterValue,filterTypes:me.dataSourceState.filterTypes,groupBy:me.dataSourceState.groupBy}));(0,Zo.useState)(()=>{M.onChange(me=>{me&&(U.rowHeight=me)}),D.onChange(me=>{let je=me?me*1:null;je!=null&&!isNaN(je)&&(U.flashingDurationCSSVarValue=je)}),A.onChange(me=>{me&&(U.rowDetailHeight=me)}),O.onChange(me=>{me&&(U.columnHeaderHeight=me)})}),(0,Zo.useEffect)(()=>{ae.showSeparatePivotColumnForSingleAggregation=E},[E]);let{toggleGroupRow:X}=Gg(e,t),k=N,{computedColumnOrder:Z,computedVisibleColumns:Y,computedVisibleColumnsMap:$,computedPinnedStartColumns:ie,computedPinnedEndColumns:fe,computedUnpinnedColumns:pe,computedPinnedStartColumnsWidth:H,computedPinnedEndColumnsWidth:_,computedUnpinnedColumnsWidth:ue,computedUnpinnedOffset:Se,computedPinnedEndOffset:Re,computedRemainingSpace:Ce,computedPinnedStartWidth:Fe,computedPinnedEndWidth:Oe,renderSelectionCheckBox:Ye,computedColumnsMap:nt,computedColumnsMapInInitialOrder:We,fieldsToColumn:rt}=Kg({columns:k,userColumns:L,scrollbarWidth:void 0,columnCssEllipsis:i,columnHeaderCssEllipsis:a,columnMinWidth:l,columnMaxWidth:s,columnDefaultWidth:u,columnDefaultFlex:c,columnDefaultSortable:d,columnDefaultDraggable:p,pinnedStartMaxWidth:f,pinnedEndMaxWidth:m,bodySize:x,viewportReservedWidth:F,resizableColumns:G,sortable:B,draggableColumns:z,sortInfo:de??void 0,multiSort:K,groupBy:se,columnOrder:r,columnVisibility:g,columnVisibilityAssumeVisible:!0,columnPinning:y,editable:b,columnDefaultEditable:S,columnDefaultFilterable:I,columnDefaultGroupable:T,filterValue:q,filterTypes:re,columnSizing:h,columnTypes:C}),pt=fg(Y),Ge=gg(Y),W=$g(n),oe=Fe?H>Fe:!1,he=Oe?_>Oe:!1,[Ie]=(0,Zo.useState)(()=>new za({isRowDisabledAt:je=>ce().dataArray[je]?.rowDisabled??!1,getIdForIndex:je=>ce().dataArray[je]?.id??-1})),Je=Ne(Y),[V]=(0,Zo.useState)(()=>new ka({getPrimaryKeyByIndex:le.getPrimaryKeyByIndex,getColumnIdByIndex:me=>Je()[me]?.id||""})),{computedRowHeight:Ze,computedRowSizeCacheForDetails:_e}=jg({rowDetailHeight:v,rowHeight:R,isRowDetailsExpanded:P,isRowDetailsEnabled:w,getDataSourceState:ce});return(0,Zo.useMemo)(()=>({multiRowSelector:Ie,multiCellSelector:V,computedRowSizeCacheForDetails:_e,computedRowHeight:Ze,scrollbars:W,columnSize:Ge,rowspan:pt,toggleGroupRow:X,computedColumnsMap:nt,computedColumnsMapInInitialOrder:We,renderSelectionCheckBox:Ye,computedPinnedStartOverflow:oe,computedPinnedEndOverflow:he,computedPinnedStartWidth:Fe,computedPinnedEndWidth:Oe,computedVisibleColumns:Y,computedColumnOrder:Z,computedRemainingSpace:Ce,computedVisibleColumnsMap:$,computedPinnedStartColumns:ie,computedPinnedEndColumns:fe,computedUnpinnedColumns:pe,computedPinnedStartColumnsWidth:H,computedPinnedEndColumnsWidth:_,computedUnpinnedColumnsWidth:ue,computedUnpinnedOffset:Se,computedPinnedEndOffset:Re,fieldsToColumn:rt}),[Ie,V,_e,Ze,W,Ge,pt,X,nt,We,Ye,oe,he,Fe,Oe,Y,Z,Ce,$,ie,fe,pe,H,_,ue,Se,Re,rt])}var Xg=require("react");function fI(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 mI(){return 4294967295}function gI(o,e,t){return e=e>>>8^o[t^e&255],e}function hI(o){return o=~o,o=o<0?4294967295+o+1:o,o}function du(o,e=3988292384){var t=fI(e),n=0,r;for(n=mI(),r=0;r<o.length;r++)n=gI(t,n,o.charCodeAt(r));return n=hI(n),`${n}`}var yI=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")??""}},Yg=(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))},qg=(o="",e,t)=>{let n;try{n=bI(o)}catch{return Yg(["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?(Yg([`
|
|
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},nI=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(cc(c.value)!==l)throw"Invalid license"});let i=[...t];i.pop();let a=i.map(l=>`${l.name}=${l.value}`).join("|");if(cc(a)!==r)throw"Invalid license";return t=t.map(l=>({...l,value:decodeURI(l.value)})),oI(t)};var rI=/(https):\/\/\d+\-\d+\-\d+\-(sandpack\.codesandbox\.io)/g,iI=/(https):\/\/\S+(\.csb\.app)/g,Wg=typeof window<"u"?window.location.origin:"",aI=()=>{let[o,e,t]=Array.from(rI.exec(Wg)||[]);return e==="https"&&t==="sandpack.codesandbox.io"},lI=()=>{let[o,e,t]=Array.from(iI.exec(Wg)||[]);return e==="https"&&t===".csb.app"},sI=lI()||aI(),jg=(o="")=>{let t=!!xo();return(0,Bg.useMemo)(()=>{if(t)return!0;let r=Kg(o,{publishedAt:1624970570587,version:"9.0.0-canary.0"});return!o&&!r&&sI?!0:r},[o,t])};var lr=require("react");var cI=10;function $g(o,e,t){let n=(0,lr.useRef)(!1),r=(0,lr.useRef)(null);(0,lr.useEffect)(()=>{o!=null&&(n.current=!1,zt(r.current))},[o]),(0,lr.useEffect)(()=>{if(o!=null&&!n.current){let a=function(l=0){l++,zt(r.current),r.current=Ge(()=>{n.current=t.scrollCellIntoView(o[0],o[1],{offset:30}),!n.current&&l<cI&&a(l)})};var i=a;a()}return()=>{zt(r.current)}},[o,e])}var sr=require("react"),uI=10;function Ug(o,e,t){let n=(0,sr.useRef)(!1),r=(0,sr.useRef)(null);(0,sr.useEffect)(()=>{o!=null&&(n.current=!1,cancelAnimationFrame(r.current))},[o]),(0,sr.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<uI&&a(l)})};var i=a;a()}return()=>{cancelAnimationFrame(r.current)}},[o,e])}function Yg(){return Do()}var cr=require("react");function qg(o,e){uc(o,e),pI(o,e),e.detail===2&&dI(o,e),o.getState().onCellClick?.(o,e)}function dI(o,e){if(zi(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 pI(o,e){let{getDataSourceState:t,getState:n,getComputed:r,rowIndex:i,colIndex:a,dataSourceActions:l}=o,s=t(),{selectionMode:c,cellSelection:u}=s;if(!u||c!=="multi-cell")return;let{multiCellSelector:d,computedVisibleColumns:p}=r(),{brain:f,debugId:m}=n(),{rowsPerPage:g}=f,b=p.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=!!n().wrapRowsHorizontally;d.multiSelectClick(y,S?{horizontalLayout:S,rowsPerPage:g,columnsPerSet:b}:{horizontalLayout:S})}else d.resetClick(y);l.cellSelection=h}function uc(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:p,dataArray:f,isTree:m}=u;if(p.length||m||f[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=f[t].id;e.metaKey||e.ctrlKey?a.rowSelectionApi.toggleRowSelection(h):a.rowSelectionApi.selectRow(h)}return!1}function Xg(o,e){e.detail!==2&&void 0}var fI={Enter:!0," ":!0,a:!0};function Zg(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(!fI[c])return!1;let p=t(),f=n(),{activeRowIndex:m,activeCellIndex:g,keyboardNavigation:b,keyboardSelection:h}=p,{selectionMode:y,groupBy:S,rowSelection:T,treeSelectionState:C,isTree:I}=f;if(h===!1)return!1;let R=b==="row"&&m!=null?m:b==="cell"&&g!=null?g[0]:null,v=R!=null?f.dataArray[R]:null;if(!v||R==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&&C){let w=s(C);return w.selectAll(),r.treeSelection=w,!0}let P=l(T);return P.selectAll(),r.rowSelection=P,!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 P={key:e.key,metaKey:e.metaKey,ctrlKey:e.ctrlKey,shiftKey:e.shiftKey,preventDefault:()=>e.preventDefault()},{renderSelectionCheckBox:w}=o.getComputed();return w&&(P.metaKey=!1,P.ctrlKey=!0),uc({...o,rowIndex:R},P)}}return!1}var Qg=["input","textarea","select","[tabindex]","a[href]","button","object"].join(", "),Jg=o=>Array.from(o.querySelectorAll(Qg)).filter(t=>!!t.offsetParent),Wa=o=>o.querySelector(Qg);var th=B(on());async function eh(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 mI=10,gI=(o,e)=>o-e;function ja(o,e){let{getComputed:t,getDataSourceState:n,getState:r,api:i,dataSourceApi:a}=e,{editingCell:l,isRowDetailEnabled:s}=r(),{dataArray:c}=n(),{computedVisibleColumns:u,computedColumnsMap:d}=t(),p=u[o.colIndex];if(!p)return!1;if(l&&l.columnId===p.id&&l.rowIndex===o.rowIndex)return!0;if(!p.contentFocusable)return!1;if(p.contentFocusable===!0)return!0;let f=c[o.rowIndex],m=!s||typeof s=="function"&&!s(f)?!1:i.rowDetailApi.isRowDetailExpanded(f.id)?"expanded":"collapsed",g=mt(p.id,e);return p.contentFocusable({column:p,...Wn({column:p,rowInfo:f,columnsMap:d,context:e,rowDetailState:m}).formattedValueContext,columnApi:g,api:i,dataSourceApi:a})}function dc(o,e,t){let n=t.getState().editingCell;return hI(o,e,t,{isCellFocusable:ja,isColumnElligible:i=>n&&n.columnId===i.id?!0:!!i.contentFocusable})}function oh(o,e,t){let n=(0,th.default)(t,o+e,gI);return n<0&&(n=~n,e>0&&n>=t.length||e<0&&n===0)?null:t[n]??null}globalThis.getNextCol=oh;function hI(o,e,t,n){let{isColumnElligible:r,isCellFocusable:i}=n,a=t.getComputed().computedVisibleColumns.filter(r).reduce((d,p)=>(d.push(p.computedVisibleIndex),d),[]);if(!a.length)return null;let{getDataSourceState:l}=t,{dataArray:s}=l(),c=o.rowIndex,u=o.colIndex;for(;c!=null||u!=null;){if(u=u===null?a[e===-1?a.length-1:0]:oh(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 nh(o){let e={rowIndex:o.getDataSourceState().dataArray.length-1,colIndex:o.getComputed().computedVisibleColumns.length-1},t=ja(e,o)?e:dc(e,-1,o);if(t){await pc([t.rowIndex,t.colIndex],o);let n=o.getState().getDOMNodeForCell(t);if(!n)return;Wa(n)?.focus()}}async function pc([o,e],t){let{api:n}=t;return new Promise((r,i)=>{let a=mI,l=null,s=!1;function c(u=0){u++,zt(l),l=Ge(async()=>{if(s=n.scrollCellIntoView(o,e,{offset:30}),!s&&u<a&&c(u),s){try{await eh(()=>!!t.getState().getDOMNodeForCell({rowIndex:o,colIndex:e}))}catch(d){i(d);return}r(!0)}})}c()})}var bI=`.${Qt}`;function rh(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:Fo(n,bI),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&&ja({colIndex:s,rowIndex:l},o)?{rowIndex:l,colIndex:s}:dc({rowIndex:l,colIndex:s},t,o);if(!c){if(t===-1)r.focus();else{let u=Jg(document.body),d=o.getState().focusDetectDOMRef.current,p=u.findIndex(m=>m===d);u[p+1]?.focus()}return!0}return pc([c.rowIndex,c.colIndex],o).then(()=>{let u=o.getState().getDOMNodeForCell(c);if(!u)return;Wa(u)?.focus()}),!0}var ih={control:"ctrl"},ah={"control|cmd":"ctrl","cmd|control":"ctrl","ctrl|cmd":"ctrl","cmd|ctrl":"ctrl"},yI={esc:"escape"},sh={cmd:o=>o.metaKey,alt:o=>o.altKey,ctrl:o=>o.ctrlKey,shift:o=>o.shiftKey},ch=Object.keys(sh),fc=new Set(ch),SI=new Set(["shift","alt"]);function $a(o,e){return Array.isArray(e)?e.some(t=>lh(o,t)):lh(o,e)}function lh(o,e){let t=o.key.toLowerCase(),n=e.split("+").map(p=>p.toLowerCase().trim()),r=n.find(p=>ah[p]),i=n.map(p=>ih[p]||ah[p]||yI[p]||p),a=i.filter(p=>fc.has(p)),l=i.filter(p=>!fc.has(p)),s=ch.reduce((p,f)=>(p[f]=sh[f](o),p),{});r&&s.cmd&&(s.cmd=!1,s.ctrl=!0);let c=Object.keys(s).filter(p=>s[p]);if(!a.every(p=>s[p]===!0))return!1;if(l.includes("*")){if(c.length<a.length||c.filter(f=>!SI.has(f)).length)return!1}else if(a.length!=c.length)return!1;return!l.length||fc.has(t)||t==="meta"||ih[t]?!1:l.reduce((p,f)=>p?f==="*"||t===f:!1,!0)}async function uh(o,e){let t={...o,cloneRowSelection:a=>Ta(a,o.getDataSourceState),cloneTreeSelection:a=>Ra(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&&Zg(t,e)&&e.preventDefault(),(rh(t,e)||!o.getState().focusedWithin&&!r.preventNavigation&&Wm(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(!$a(e,a.key)||a.when&&!await a.when(o))continue;let l=await a.handler(o,e);if(l&&l.stopNext)break}}function TI(){let{getState:o,actions:e,api:t,getComputed:n,getDataSourceMasterContext:r}=Ke(),{getDataSourceState:i,dataSourceActions:a,dataSourceApi:l}=eo();return(0,cr.useMemo)(()=>({getComputed:n,getDataSourceMasterContext:r,dataSourceApi:l,api:t,getState:o,actions:e,getDataSourceState:i,dataSourceActions:a,cloneTreeSelection:u=>Ra(u,i),cloneRowSelection:u=>Ta(u,i)}),[o,e,i,a,t,l,n])}function CI(){let o=TI();(0,cr.useEffect)(()=>{let e=o.getState().keyDown.onChange(a=>{uh(o,a)});function t(a){if(!a)return;let l=a.event,s=o.getComputed().computedVisibleColumns[a.colIndex],c=mt(s.id,o);qg({...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=mt(u.id,o);Xg({...o,rowIndex:s,colIndex:c,column:u,columnApi:d},l)}let i=o.getState().cellMouseDown.onChange(r);return()=>{e(),n(),i()}},[])}function II(){let{getState:o}=oe(t=>({getState:t.getState}));return{onKeyDown:(0,cr.useCallback)(t=>{o().keyDown(t)},[])}}function dh(){return CI(),II()}var Sc=require("react");var We=B(require("react")),Et=require("react"),yh=require("react-dom");var Ua="__is_infinite_menu_component";function mc(o){return!!o.tagName}function mh(o){let{alignTarget:e,alignAnchor:t,constrainTo:n,alignPosition:r}=o,i=ve.from(mc(e)?e.getBoundingClientRect():e),a=ve.from(mc(t)?t.getBoundingClientRect():t),l=n?ve.from(mc(n)?n.getBoundingClientRect():n):null;if(!l)return{...ph({anchorRect:a,targetRect:i,position:r[0]}),index:0};let s=null;for(let c=0,u=r.length;c<u;c++){let d=ph({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 ph(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=fh(e,i),s=fh(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 fh(o,e){return e==="TopLeft"?je.from({top:o.top,left:o.left}):e==="TopCenter"?je.from({top:o.top,left:o.left+(o.width>0?Math.round(o.width/2):0)}):e==="TopRight"?je.from({top:o.top,left:o.left+o.width}):e==="BottomLeft"?je.from({left:o.left,top:o.top+o.height}):e==="BottomCenter"?je.from({left:o.left+(o.width>0?Math.round(o.width/2):0),top:o.top+o.height}):e==="BottomRight"?je.from({left:o.left+o.width,top:o.top+o.height}):e==="CenterLeft"?je.from({left:o.left,top:o.top+(o.height>0?Math.round(o.height/2):0)}):e==="CenterRight"?je.from({left:o.left+o.width,top:o.top+(o.height>0?Math.round(o.height/2):0)}):je.from({left:o.left+(o.width>0?Math.round(o.width/2):0),top:o.top+(o.height>0?Math.round(o.height/2):0)})}function RI(o){return o&&typeof o.then=="function"||o instanceof Promise}function hh(o){return o==null||typeof o=="string"?!1:typeof o.tagName=="string"}async function gh(o){return typeof o=="function"&&(o=o()),RI(o)&&(o=await o),typeof o=="string"&&(o=document.querySelector(o)),o&&hh(o)&&(o=o.getBoundingClientRect()),o?ve.from(o):null}async function bh(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)),hh(n)&&(r=n),r||null}return t(await e)}async function Ya(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 gh(t)||void 0,a=n?await gh(n):void 0,l=ve.from(o.getBoundingClientRect());if(!a)return;let{alignedRect:s}=mh({constrainTo:i,alignAnchor:a,alignTarget:l,alignPosition:r});o.style.transform=`translate3d(${s.left}px,${s.top}px, 0px)`;let c=o.getBoundingClientRect();if(c.left!==s.left||c.top!==s.top){let u=o.offsetParent;if(u){let d=u.getBoundingClientRect(),p=d.left,f=d.top,m=s.left-p,g=s.top-f;o.style.transform=`translate3d(${m}px,${g}px, 0px)`}}}function wI(o){return We.createElement("div",{style:{position:"fixed",top:0,left:0}},o.children)}function vI(o){let e=We.useRef(null);return(0,Et.useEffect)(()=>o.realign.onChange(t=>{e.current&&t&&Ya(e.current,t)}),[o.realign]),We.createElement("div",{style:{position:"absolute",top:0,left:0},ref:(0,Et.useCallback)(t=>{t&&Ya(t,o),e.current=t},[])},typeof o.children=="function"?o.children():o.children)}function Sh(o,e){let[t,n]=(0,Et.useState)(null);return(0,Et.useLayoutEffect)(()=>{async function r(){let i=e?await bh(e):null;i!=null&&n(i)}e&&r()},[e]),e?t?(0,yh.createPortal)(o,t):We.createElement(We.Fragment,null):e===null||e===!1?o:We.createElement(wI,null,o)}function PI(o){if(We.Children.count(o)===1){let e=We.Children.only(o);if(We.isValidElement(e))return e.props.id||e.key}return null}function DI(o,e,t){if(We.Children.count(o)===1){let n=We.Children.only(o);if(We.isValidElement(n)&&n.type[Ua]){let r={};return n.props.portalContainer===void 0&&(r.portalContainer=e),n.props.constrainTo===void 0&&(r.constrainTo=t),We.cloneElement(n,r)}}return o}function io(o){let e=o,[t]=(0,Et.useState)(()=>new Map),[n,r]=(0,Et.useState)(null),[i,a]=(0,Et.useState)(0),l=(0,Et.useCallback)(()=>{let m=[];for(let[g,b]of t)m.push(We.createElement(vI,{...b,key:b.key}));return m},[]),[s,c]=Ut(),u=Sh(l(),o.portalContainer),d=(0,Et.useCallback)((m,g)=>{let h=`${g.id||PI(m)||Ht()}`,y=t.get(h),S=I=>()=>{let R=typeof I=="function"?I():I;return DI(R,e.portalContainer,g.constrainTo??e.constrainTo)},T=S(m),C=(I,R)=>{if(!y)return;let v=S(I);Object.assign(y,{children:v}),c(),!!!R?.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:Ie()},t.set(y.key,y),c(),C)},[t,e.portalContainer,c]);We.useEffect(()=>{if(n){let m=t.get(n);m&&m.realign(m)}},[n,i]);let p=m=>{m=`${m}`,t.has(m)&&(t.delete(m),c())},f=()=>{t.clear(),c()};return We.useEffect(()=>{},[]),{portal:u,hideOverlay:p,clearAll:f,rerenderOverlays:c,showOverlay:d}}var Kh=B(require("react"));var pr=B(require("react"));var _h=B(require("react"));var Eh=B(require("react"));function qa(o){return null}qa.defaultProps={__is_menu_item:!0};var Th="submenu",xI="-";function Ch(){return{keyboardActiveItemKey:null,activeItemKey:null,generatedId:Ht(),focused:!1,destroyed:!1,domRef:{current:null}}}function Ih(){return{parentMenuId:1,parentMenuItemKey:1,onHideIntent:1,constrainTo:1,onAction:1,onShow:1,onHide:1,autoFocus:1,wrapLabels:1}}var gc=({columns:o,keyboardActiveItemKey:e,activeItemKey:t,menuId:n},r,i)=>{let a=r&&(r.key!=null||r.label!=null)?r:null,l=a===null?r===xI?i.renderSeparator():r:null;return a!=null?{type:"item",parentMenuId:n,disabled:!!a.disabled,keyboardActive:a.key===e,active:a.key===t,value:a,span:a.span||1,key:a.key,menu:a.menu||null,style:a.style,className:a.className,originalMenuItem:a}:{type:"decoration",value:l,span:o.length,style:{gridColumnStart:1,gridColumnEnd:o.length+10}}},MI=[{name:"label"}],Rh=(o,e)=>{let{props:t,state:n}=o,{activeItemKey:r,keyboardActiveItemKey:i}=n,{items:a,children:l,addSubmenuColumnIfNeeded:s,parentMenuId:c}=t,u=t.id||n.generatedId;c&&(u=`${c}-${u}`);let d=[...t.columns||MI],p={columns:d,keyboardActiveItemKey:i??null,activeItemKey:r??null,menuId:u},f=[];a?f=a.map(g=>gc(p,g,e)):!a&&typeof l!="function"&&(f=e.childrenToRuntimeItems?e.childrenToRuntimeItems(p,l):[]),s&&f.filter(b=>b.type==="item"&&b.menu!=null).length>0&&!d.find(b=>b.name==Th)&&d.push({name:Th,render:e.renderSubmenuColumn});let m=f.filter(g=>g.type==="item"&&!g.disabled);return{runtimeItems:f,runtimeSelectableItems:m,columns:d,menuId:u}};var ur=B(require("react"));var wh="db3arf0 _16lm1iw0 _16lm1iw1 _16lm1iw1w _16lm1iw2f _16lm1iw8",vh=ye({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"]]}),Ph="db3arf1",Dh="db3arfd";function xh(){return ur.createElement("hr",{className:Dh})}var Xa={renderSeparator:()=>ur.createElement(xh,null),renderSubmenuColumn:({domProps:o,item:e})=>e.menu?ur.createElement("div",{...o},ur.createElement(ln,{expanded:!1})):ur.createElement("div",{...o})};var Mh=(o,e)=>gc(o,e,Xa);function Ah(o,e){return Eh.Children.map(e,t=>{if(t&&(t.props.__is_menu_item||t.type===qa)){let n={...t.props};return n.key||(n.key=t.key),n.description||(n.description=t.props.children),n.label||(n.label=n.children),Mh(o,n)}return Mh(o,t)})||[]}function Oh(){return{...Ch(),domRef:_h.createRef()}}var Nh=()=>Ih(),Fh=o=>Rh(o,{...Xa,childrenToRuntimeItems:Ah});var jt=B(require("react")),ut=require("react");function Lh(o,e){let t=kh(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 kh(o,e){let t=Fo(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 zh(o,e){let t=kh(o,e);if(!t.length)return null;for(let n of t){let r=n.querySelector('input[type="checkbox"]');if(r)return r}return null}var ri=class extends Hn{constructor(e){super(e.slice(0,3))}};var EI=250;function AI(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}Ge(i)};Ge(()=>{i()})})}var _I=Me(),Za=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||EI;this.getPointerMoveTarget=()=>document.documentElement||_I;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,AI(()=>this.activeItem!=e?!1:this.params.getMenuRectFor(e)).then(n=>{this.activeItem==e&&n&&(this.activeItemMenuRect=n)})}};this.onItemChange=(e,t,n)=>{if(clearTimeout(this.menuLeaveTimeoutId),clearTimeout(this.mouseMoveTimeoutId),!e){this.removePointerMoveListener(),t===this.activeItem&&(this.activeItemLeavePoint=new je({left:n.clientX,top:n.clientY})),this.setupMenuLeaveTracking();return}if(this.currentHoveredItem=t,!this.activeItem||!this.params.itemHasSubMenu(this.activeItem)){this.setActiveItem(t,n.target);return}this.onPointerMoveWhileActiveItem(),this.getPointerMoveTarget().addEventListener("pointermove",this.onPointerMoveWhileActiveItem)};this.getHandlers=()=>({onItemEnter:(e,t)=>{this.onItemChange(!0,e,t)},onItemLeave:(e,t)=>{this.onItemChange(!1,e,t)}});this.params=e}};var Qa=require("react"),hc=(0,Qa.createContext)(null);function bc(){return(0,Qa.useContext)(hc)}var dr=require("react");function Vh(){let o=(0,dr.useRef)(!0);return(0,dr.useEffect)(()=>(o.current=!0,()=>{o.current=!1}),[]),(0,dr.useCallback)(()=>o.current,[])}function OI(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()),jt.createElement($t,{key:c,parentMenuItemKey:o.key,parentMenuId:t,constrainTo:a,...u,autoFocus:!1,onShow:(d,p)=>{u?.onShow?.(d,p),n(p)},onHideIntent:d=>{u?.onHideIntent?.(d),l(d)},onHide:d=>{d.focused&&(r(null),i(o.key),s.focus())}})):null}function NI({onItemActivate:o}){let{getState:e}=bc(),[{onItemEnter:t,onItemLeave:n}]=(0,ut.useState)(()=>new Za({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,ut.useCallback)(t,[]),onItemLeave:(0,ut.useCallback)(n,[])}}function Gh(o){let{domProps:e}=o,{componentState:{columns:t,runtimeItems:n,menuId:r,activeItemKey:i,keyboardActiveItemKey:a,constrainTo:l,destroyed:s,onAction:c,wrapLabels:u,onShow:d,onHide:p,autoFocus:f,parentMenuItemKey:m,domRef:g},componentActions:b,getState:h}=bc(),y=(0,ut.useCallback)(H=>{b.keyboardActiveItemKey=H},[]),S=(0,ut.useCallback)(H=>{b.activeItemKey=H},[]),T=Vh(),[C,I]=(0,ut.useState)(null),R=null;(0,ut.useLayoutEffect)(()=>{let{runtimeItems:H}=h(),q=H.filter(ne=>ne.type==="item"&&i===ne.key)[0];if(!q||!q.menu){I(null),x();return}if(q){let ne=Lh(r,q.key);ne&&P(()=>OI(q,{constrainTo:l,setSubmenuApi:I,setActiveItemKey:S,setKeyboardActiveItemKey:y,parentMenuId:r,onHideIntent:V,api:j}),{id:`${r}-submenu`,alignTo:ne,alignPosition:[["TopLeft","TopRight"],["TopRight","TopLeft"]],constrainTo:l});return}},[i]);let v=(H,q)=>{y(q.key),S(q.key),q.originalMenuItem.onClick&&q.originalMenuItem.onClick(H);let ne={key:q.key,item:q.originalMenuItem,hideMenu:V};q.originalMenuItem.onAction&&q.originalMenuItem.onAction(ne),c&&c(ne),q.originalMenuItem.hideMenuOnAction&&V()},{showOverlay:P,portal:w,clearAll:x}=io({portalContainer:!1}),{onItemEnter:E,onItemLeave:M}=NI({onItemActivate:H=>{if(!T())return;let q=H?H.key:null;S(q)}});R=n.map((H,q)=>jt.createElement(FI,{key:H.type==="item"?H.key:q,onItemEnter:(ne,se)=>{E(ne.key,se)},onItemLeave:(ne,se)=>{M(ne.key,se)},columns:t,active:H.type==="item"&&H.key===i,keyboardActive:H.type==="item"&&H.key===a,item:H,index:q,onClick:v}));let D=t.map(H=>H.width||(typeof H.flex=="number"?`${H.flex}fr`:H.flex)||"auto").join(" "),A={...e.style,gridTemplateColumns:D,gridTemplateRows:n.map(()=>"auto").join(" ")};u||(A.whiteSpace="nowrap");function O(H){let{runtimeItems:q,runtimeSelectableItems:ne}=h(),se=q.findIndex(Y=>Y.type==="item"&&Y.key===a),me=a,ie=q[se],ue={ArrowUp:()=>{let Y=q.slice(0,se).filter(z=>z.type==="item"&&!z.disabled).pop();Y&&Y.type==="item"&&Y.key&&(me=Y.key)},ArrowDown:()=>{let Y=q.slice(se+1).filter(z=>z.type==="item"&&!z.disabled)[0];Y&&Y.type==="item"&&Y.key&&(me=Y.key)},Home:()=>{ue.PageUp()},End:()=>{ue.PageDown()},PageUp:()=>{me=ne[0].key},PageDown:()=>{me=ne[ne.length-1].key},ArrowLeft:()=>{S(null),h().parentMenuId&&(b.destroyed=!0)},ArrowRight:()=>{ie&&(S(ie.key),Ge(()=>{T()&&C&&C.getParentMenuId()===h().menuId&&C.focus()}))},Enter:()=>{if(ie)if(ie.originalMenuItem?.menu){if(ie&&ie.originalMenuItem.menu&&C){ue.ArrowLeft();return}ie&&S(ie.key)}else v(H,ie)}," ":()=>{if(!ie)return;ie.originalMenuItem.menu||v(H,ie);let Y=zh(r,ie.key);Y&&Y.click()},Escape:()=>{ue.ArrowLeft();let Y=h();Y.parentMenuId||Y.onHideIntent?.(Y)}},ce=ue[H.key];ce&&(ce(),H.preventDefault()),me!=a&&y(me)}function N(){b.focused=!1}let k=(0,ut.useCallback)(function(){b.focused=!0,setTimeout(()=>{F.current&&g.current&&g.current===document.activeElement&&h().keyboardActiveItemKey==null&&y(h().runtimeSelectableItems[0]?.key??null)})},[]),F=(0,ut.useRef)(!0),V=(0,ut.useCallback)(()=>{let H=h();H.onHideIntent?.(H)},[h]),[j]=(0,ut.useState)(()=>({hideMenu:V,focus:()=>{g.current&&(g.current.focus(),setTimeout(()=>{g.current&&g.current!==document.activeElement&&g.current.focus()},10),k())},getMenuId:()=>h().menuId,getParentMenuId:()=>h().parentMenuId})),L=(0,ut.useCallback)(H=>{H?(g.current=H,d?.(h(),j),f&&j.focus()):(p?.(h()),g.current=H)},[]),U=jt.createElement("div",{className:_n.contents},jt.createElement("div",{...e,"data-menu-id":r,"data-submenu-for":m,tabIndex:0,ref:L,onKeyDown:H=>{e.onKeyDown?.(H),O(H)},onMouseDown:H=>{F.current=!1,e.onMouseDown?.(H)},onMouseUp:H=>{F.current=!0,e.onMouseUp?.(H)},onFocus:k,onBlur:N,className:te(wh,e.className,"InfiniteMenu"),style:A},R),w);return s?null:U}function FI(o){let[e,t]=jt.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=jt.createElement("div",{style:r.style},r.value);else{let u=0;c=n.map((d,p)=>{let f=r.value,m=d.field||d.name,g=p+1,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:te(vh({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?jt.createElement(Lr,{key:`${s}-${m}`,render:d.render,renderParam:{item:f,column:d,value:f[m],domProps:y}}):jt.createElement("div",{key:`${s}-${m}`,...y},f[m])}).filter(Boolean)}return jt.createElement("div",{className:Ph},c)}var{ManagedComponentContextProvider:LI}=Ft({initSetupState:Oh,forwardProps:Nh,mapPropsToState:Fh,layoutEffect:!0});function kI(o){let{componentActions:e,componentState:t}=Lt(),n=Oe(t);return pr.createElement(hc.Provider,{value:{componentActions:e,componentState:t,getState:n}},pr.createElement(Gh,{domProps:o.domProps}))}function $t(o){let{children:e,portalContainer:t,items:n,parentMenuId:r,addSubmenuColumnIfNeeded:i=!0,bubbleActionsFromSubmenus:a=!0,onShow:l,onHide:s,wrapLabels:c=!1,onAction:u,constrainTo:d,columns:p,parentMenuItemKey:f,autoFocus:m,id:g,onHideIntent:b,__is_infinite_menu_component:h,...y}=o;return pr.createElement(LI,{addSubmenuColumnIfNeeded:i,bubbleActionsFromSubmenus:a,wrapLabels:c,...o},pr.createElement(kI,{domProps:y}))}$t[Ua]=!0;var yc=B(require("react"));function Hh(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((p,f)=>{let m=tn(p,e,"column-menu");u.push({key:f,label:m,check:yc.createElement(po,{key:p.id,disabled:p.computedVisible&&i.getVisibleColumnsCount()===1,checked:p.computedVisible,onChange:g=>{let b=!!g;i.setVisibilityForColumn(p.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((p,f)=>{if(p.groupByForColumn)return;let m=tn(p,e,"column-menu");u.push({key:f,label:m,check:yc.createElement(po,{key:p.id,disabled:!p.computedGroupable,checked:p.computedGroupedBy,onChange:()=>{a.toggleGroupByField(p.field)}})})}),{columns:[{name:"check"},{name:"label"}],items:u}}}].filter(u=>!!u)}function Bh(o,e,t){if(o==null)return null;let{getComputed:n,getState:r}=e,{components:i,getColumnMenuItems:a}=r(),l=i?.Menu??$t,s=n().computedColumnsMap.get(o);if(!s)return null;let c={column:s,columnApi:mt(s.id,e),...e},u=Hh([],c),d=a?a(u,c):u,p=m=>{m.__insideMenu=!0},f=m=>{m.domRef.current?.parentNode?.removeEventListener("mousedown",p)};return!d||!d.length?null:Kh.createElement(l,{autoFocus:!0,items:d,onShow:m=>{m.domRef.current?.parentNode?.addEventListener("mousedown",p)},onHide:f,onHideIntent:m=>{f(m),t?.()}})}var zI=`[${kr["data-name"]}="${zr["data-name"]}"]`;function VI(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=`[${Uf["data-column-id"]}="${e}"] ${zI}`;u=i().domRef.current.querySelector(d)}if(!u){console.warn(`Cannot show column menu for column "${e}"`);return}l.current=null,r(()=>Bh(e,t,c),{constrainTo:s.current,id:"column-menu",alignTo:u,alignPosition:[["TopLeft","BottomLeft"],["TopRight","BottomRight"]]})}function Wh(){let o=Ke(),{getState:e,actions:t,columnMenuVisibleForColumnId:n,columnMenuVisibleKey:r}=oe(c=>({getState:c.getState,actions:c.actions,columnMenuVisibleForColumnId:c.state.columnMenuVisibleForColumnId,columnMenuVisibleKey:c.state.columnMenuVisibleKey})),{portalDOMRef:i}=co(c=>({portalDOMRef:c.getMasterState().portalDOMRef}))||{},{showOverlay:a,portal:l,clearAll:s}=io({portalContainer:i?.current??!1});return(0,Sc.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,Sc.useEffect)(()=>{let{columnMenuVisibleForColumnId:c,columnMenuTargetRef:u}=e();if(c){let p=function(f){f.__insideMenu!==!0&&(s(),t.columnMenuVisibleForColumnId=null)};var d=p;return document.documentElement.addEventListener("mousedown",p),VI({columnId:c,context:o,clearAll:s,showOverlay:a}),()=>{document.documentElement.removeEventListener("mousedown",p)}}else u.current=null,s();return()=>{}},[n,r]),{menuPortal:l}}var jh=B(require("react")),$h=require("react");var GI={width:0,height:0,overflow:"hidden",pointerEvents:"none",outline:"none",zIndex:-1};function Uh(){let{getState:o,api:e,actions:t,getComputed:n,dataSourceApi:r,dataSourceActions:i}=Ke(),{getDataSourceState:a,getDataSourceMasterContext:l}=eo(),{focusDetectDOMRef:s}=o(),c=(0,$h.useCallback)(async()=>{nh({getDataSourceState:a,getDataSourceMasterContext:l,getComputed:n,actions:t,dataSourceActions:i,api:e,getState:o,dataSourceApi:r})},[]);return jh.createElement("div",{onFocus:c,ref:s,tabIndex:0,style:GI})}var fr=require("react");function HI(){let o=Ke(),{getState:e,editingCell:t}=oe(r=>({getState:r.getState,editingCell:r.state.editingCell})),n=t&&!t.active?t.cancelled:void 0;(0,fr.useEffect)(()=>{if(n){let{rowIndex:r,columnId:i,initialValue:a}=e().editingCell,{onEditCancelled:l}=e();l?.({...xt({rowIndex:r,columnId:i,...o}),initialValue:a})}},[n])}function KI(){let o=Ke(),{getState:e,editingCell:t}=oe(r=>({getState:r.getState,editingCell:r.state.editingCell})),n=t&&!t.active&&t.accepted instanceof Error?t.accepted:void 0;(0,fr.useEffect)(()=>{if(n){let{rowIndex:r,columnId:i,value:a,initialValue:l}=e().editingCell,{onEditRejected:s}=e();s?.({...xt({rowIndex:r,columnId:i,...o}),value:a,error:n,initialValue:l})}},[n])}function BI(){let o=Ke(),{editingCell:e}=oe(r=>({editingCell:r.state.editingCell})),t=e?.active,n=Ao(t);(0,fr.useEffect)(()=>{!t&&n&&o.api.focus()},[t,n])}function WI(){let o=Ke(),{editingCell:e,getState:t}=oe(r=>({editingCell:r.state.editingCell,getState:r.getState})),n=e&&!e.active&&!e.cancelled&&e.accepted===!0;(0,fr.useEffect)(()=>{if(n){let{editingCell:r}=t(),{value:i,rowIndex:a,columnId:l,initialValue:s}=r,c={...xt({rowIndex:a,columnId:l,...o}),value:i,initialValue:s};t().onEditAccepted?.(c),o.api.persistEdit({value:i})}},[n])}function jI(){let o=Ke(),{editingCell:e,getState:t}=oe(r=>({editingCell:r.state.editingCell,getState:r.getState})),n=e?e.persisted:void 0;(0,fr.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={...xt({rowIndex:l,columnId:s,...o}),value:c,initialValue:u};n instanceof Error?i?.({...d,error:n}):a?.(d)}},[n])}function Yh(){HI(),KI(),WI(),jI(),BI()}var Ic=require("react");var Xo=B(require("react"));var Tc=B(require("react"));var Ja=o=>Tc.createElement(ze,{...o},Tc.createElement("path",{d:Ve.clear[0]}));var Cc=B(require("react"));var qh=o=>Cc.createElement(ze,{...o},Cc.createElement("path",{d:Ve.done[0]}));function Xh(o,e,t){if(o==null)return null;let{getComputed:n,getState:r,getDataSourceState:i,actions:a,dataSourceApi:l,dataSourceActions:s,api:c}=e,{components:u,getFilterOperatorMenuItems:d}=r(),p=u?.Menu??$t,f=n().computedColumnsMap.get(o);if(!f)return null;let m=R=>{R.__insideMenu=!0},g=R=>{R.domRef.current?.parentNode?.removeEventListener("mousedown",m)},{filterTypes:b}=i(),h=b[f.computedFilterType];if(!h)return null;let y=h.operators.map(R=>{let v=R.name,P=f.computedFilterValue?f.computedFilterValue.filter.operator===v:v===h.defaultOperator,w=R.components?.Icon??Nn;return{key:v,icon:Xo.createElement(w,null),label:Xo.createElement(Xo.Fragment,null,R.label??R.name),onAction:()=>{c.setColumnFilterOperator(o,v)},checked:P?Xo.createElement(qh,{size:16}):null}}),T=[...[{key:"close",label:"Close Menu",icon:null,onAction:()=>{c.hideFilterOperatorMenu()}},{key:"reset",label:"Reset",icon:Xo.createElement(Ja,null),disabled:!f.computedFiltered,onAction:()=>{c.clearColumnFilter(o)}},"-"],...y],C={column:f,api:c,getState:r,getDataSourceState:i,getComputed:n,actions:a,dataSourceApi:l,dataSourceActions:s,columnFilterValue:f.computedFilterValue,filterTypes:b},I=d?d(T,C):T;return Xo.createElement(p,{autoFocus:!0,columns:[{name:"icon"},{name:"label"},{name:"checked"}],items:I,onShow:R=>{R.domRef.current?.parentNode?.addEventListener("mousedown",m)},onHide:g,onHideIntent:R=>{g(R),t?.()}})}var el=10;function Zh(){let{portalDOMRef:o}=co(l=>({portalDOMRef:l.getMasterState().portalDOMRef}))||{},e=Ke(),{getState:t,actions:n}=e,{showOverlay:r,portal:i,clearAll:a}=io({portalContainer:o?.current??!1});return(0,Ic.useEffect)(()=>t().onFilterOperatorMenuClick.onChange(s=>{if(!s)return;let{target:c,column:u}=s;function d(){a(),n.filterOperatorMenuVisibleForColumnId=null}let p=c?.parentElement||c,f=ve.from(p.getBoundingClientRect());f.top-=el,f.left-=el,f.width+=2*el,f.height+=2*el,r(()=>Xh(u.id,e,d),{constrainTo:t().domRef.current,id:"filter-operator-menu",alignTo:f,alignPosition:[["TopLeft","BottomLeft"],["TopRight","BottomRight"]]}),n.contextMenuVisibleFor=null,n.cellContextMenuVisibleFor=null,n.columnMenuVisibleForColumnId=null,n.filterOperatorMenuVisibleForColumnId=u.id}),[]),(0,Ic.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 ai=require("react");var vc=B(require("react"));var Rc=B(require("react"));function ii(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 tl(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 wc(o,e,t){if(!o)return null;let n=Ie();return o.then(r=>{let{items:i,columns:a}=ii(r);i&&i.length&&n(Rc.createElement(t,{...e,items:i||[],columns:a}))}),Rc.createElement(Go,{updater:n})}function Qh(o,e,t){let{columnId:n,rowIndex:r,event:i}=o,{getComputed:a,getState:l}=e,{components:s,getCellContextMenuItems:c}=l(),u=s?.Menu??$t,{computedColumnsMap:d}=a(),p=d.get(n),f={...xt({...e,rowIndex:r,columnId:p.id}),event:i};if(!p||!c)return{cellContext:f,menu:null,preventDefault:!1};let m=tl({onHideIntent:t}),g=c(f,e),b=g instanceof Promise||Array.isArray(g)?!0:!!(g&&Array.isArray(g.items));if(g instanceof Promise)return{cellContext:f,menu:wc(g,m,u),preventDefault:b};let{items:h,columns:y}=ii(g);return!h||!h.length?{cellContext:f,menu:null,preventDefault:Array.isArray(h)}:{preventDefault:b,menu:vc.createElement(u,{...m,columns:y,items:h}),cellContext:f}}function Jh(o,e,t){let{getState:n,getComputed:r}=e,{components:i,getContextMenuItems:a}=n(),l=i?.Menu??$t,{computedColumnsMap:s}=r(),c=o.columnId?s.get(o.columnId):void 0,u=c?{...o,...xt({...e,rowIndex:o.rowIndex,columnId:c.id})}:o;if(!a)return{cellContext:u,menu:null,preventDefault:!1};let d=tl({onHideIntent:t}),p=a(u,e),f=p instanceof Promise||Array.isArray(p)?!0:!!(p&&Array.isArray(p.items));if(p instanceof Promise)return{cellContext:u,menu:wc(p,d,l),preventDefault:f};let{items:m,columns:g}=ii(p);return!m||!m.length?{cellContext:u,menu:null,preventDefault:Array.isArray(m)}:{preventDefault:f,menu:vc.createElement(l,{...d,columns:g,items:m}),cellContext:u}}var ol=5,eb=[["TopLeft","BottomLeft"],["TopRight","BottomRight"],["BottomLeft","BottomLeft"],["BottomRight","BottomRight"],["TopCenter","TopLeft"],["BottomCenter","TopLeft"],["CenterLeft","TopLeft"],["CenterRight","TopLeft"]];function tb(){let o=Ke(),{portalDOMRef:e}=co(l=>({portalDOMRef:l.getMasterState().portalDOMRef}))||{},{getState:t,actions:n}=o,{showOverlay:r,portal:i,clearAll:a}=io({portalContainer:e?.current??!1});return(0,ai.useEffect)(()=>{let{actions:l,getState:s,getDataSourceState:c}=o;return s().cellContextMenu.onChange(d=>{if(!d)return;let{event:p}=d;function f(){a(),l.cellContextMenuVisibleFor=null}let{menu:m,cellContext:g,preventDefault:b}=Qh(d,o,f),h=ve.fromPoint({top:p.clientY,left:p.clientX});h.width+=ol,h.height+=ol,r(m,{constrainTo:s().domRef.current,id:"cell-context-menu",alignTo:h,alignPosition:eb}),b&&p.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},p)})},[]),(0,ai.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 ob(){let o=Ke(),{portalDOMRef:e}=co(l=>({portalDOMRef:l.getMasterState().portalDOMRef}))||{},{getState:t,actions:n}=o,{showOverlay:r,portal:i,clearAll:a}=io({portalContainer:e?.current??!1});return(0,ai.useEffect)(()=>{let{actions:l,getState:s}=o;return s().contextMenu.onChange(u=>{if(!u)return;let{event:d}=u;function p(){a(),l.contextMenuVisibleFor=null}let{menu:f,cellContext:m,preventDefault:g}=Jh(u,o,p),b={top:d.clientY,left:d.clientX},h=ve.fromPoint(b);h.width+=ol,h.height+=ol,r(f,{constrainTo:s().domRef.current,id:"table-context-menu",alignTo:h,alignPosition:eb}),g&&d.preventDefault(),l.contextMenuVisibleFor={point:b,...u};let{onContextMenu:y}=s();y&&y({...o,...m},d)})},[]),(0,ai.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 nb=require("react"),rb=B(require("react"));var nl=require("react");function rl(o,e){let{brain:t}=oe(r=>({brain:r.state.brain})),n=(0,nl.useCallback)(o,e);(0,nl.useEffect)(()=>t.onScroll(n),[t,n])}var Pc="yzx0vj0";function ib(o){let{width:e,maxWidth:t,minWidth:n,scrollable:r,...i}=o,a=(0,nb.useRef)(null);rl(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=ge.runtime.totalVisibleColumnsWidthValue:e==="viewport"&&(l.width=ge.runtime.bodyWidth),n==="column"?l.minWidth=ge.runtime.totalVisibleColumnsWidthValue:n==="viewport"&&(l.minWidth=ge.runtime.bodyWidth),t==="column"?l.maxWidth=ge.runtime.totalVisibleColumnsWidthValue:t==="viewport"&&(l.maxWidth=ge.runtime.bodyWidth),rb.createElement("div",{ref:a,...i,className:i.className?te(i.className,Pc):Pc,style:l},i.children)}var $I=Q(J.columnWidthAtIndex),UI=Q(J.columnOffsetAtIndex);function ab(){let{computedVisibleColumns:o}=oe(e=>({computedVisibleColumns:e.computed.computedVisibleColumns}));return o.map(e=>({id:e.id,width:e.computedWidth,cssVarForWidth:`var(${$I}-${e.computedVisibleIndex})`,offset:e.computedOffset,cssVarForOffset:`var(${UI}-${e.computedVisibleIndex})`,pinned:e.computedPinned}))}var il="InfiniteTable";var lb=require("react");function sb(){let{getState:o,actions:e,dataSourceActions:t,getDataSourceState:n}=oe(u=>({getState:u.getState,actions:u.actions,dataSourceActions:u.dataSourceActions,getDataSourceState:u.getDataSourceState})),{groupBy:r,isTree:i}=n(),a=o(),{brain:l,wrapRowsHorizontally:s}=a,c=a.repeatWrappedGroupRows;s||(c=!1),(0,lb.useEffect)(()=>{if(!s){n().repeatWrappedGroupRows&&(t.repeatWrappedGroupRows=!1);return}let u=()=>{let{rowsPerPage:f,repeatWrappedGroupRows:m}=n(),g=!1,b=l.rowsPerPage,h=(r&&r.length>0||i)&&b>0?b:null;return f!=h&&(t.rowsPerPage=h,g=!0),m!=c&&(t.repeatWrappedGroupRows=c??!1,g=!0),g};u();let d,p=l.onVerticalRenderRangeChange(()=>{u()&&(d=setTimeout(()=>{e.forceBodyRerenderTimestamp=Date.now()}))});return()=>{d&&clearTimeout(d),p()}},[l,s,r,i,c])}var In=require("react");function YI(){let o=[],e=t=>{Object.keys(t).forEach(n=>{let r=t[n];if(typeof r=="string"){let i=Q(r);if(i.includes("dont-override"))return;o.push(i)}else r&&typeof r=="object"&&e(r)})};return e({...ge,loaded:void 0,runtime:void 0}),o}function cb(o){if(!o)return{};let e=YI(),t=getComputedStyle(o),n={};return e.forEach(r=>{n[r]=t.getPropertyValue(r).trim()}),n}var li=ye({defaultClassName:"_143ofgf0",variantClassNames:{active:{true:"_143ofgf1",false:"_143ofgf2"}},defaultVariants:{},compoundVariants:[]}),ub="_143ofgf5",db="_143ofgf3";var qI=Q(ge.loaded),Dc={source:"infinite-table-page",target:"infinite-table-devtools-background"};function pb(o,e){let{type:t,debugId:n}=o;if(t==="unmount")return{...Dc,url:xc(),type:t,payload:{debugId:n}};let r=e,i=r.getComputed(),a=r.getDataSourceState(),l=r.getState();return{...Dc,url:xc(),type:t,payload:{debugId:n,columnVisibility:l.columnVisibility,columnOrder:i.computedColumnOrder,visibleColumnIds:i.computedVisibleColumns.map(c=>c.id),selectionMode:a.selectionMode,columns:Object.fromEntries(i.computedVisibleColumns.map(c=>[c.id,{field:c.field,dataType:c.computedDataType,sortType:c.computedSortType,filtered:c.computedFiltered,sorted:c.computedSorted,width:c.computedWidth}])),groupRenderStrategy:l.groupRenderStrategy,groupBy:a.groupBy.map(c=>c.field?`${c.field}`:"<fn>"),sortInfo:(a.sortInfo||[]).filter(c=>typeof c.field=="string").map(c=>({field:`${c.field}`,dir:c.dir,type:Array.isArray(c.type)?c.type[0]:c.type??"string"})),multiSort:a.multiSort,devToolsDetected:l.devToolsDetected,debugTimings:Object.fromEntries(a.debugTimings),debugWarnings:{...Object.fromEntries(a.debugWarnings),...Object.fromEntries(l.debugWarnings)},themeVars:cb(l.domRef.current),themeVarOverrides:{...no.get(n)||{}}}}}var xc=pt(function(){let o=new URL(window.location.href);return o.origin+o.pathname});function XI(o){window.postMessage(o)}var ZI=pt(()=>{console.log("Infinite Table DevTools detected!");let o=(e,t)=>{if(t){ht.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(pb({type:"update",debugId:e},t))}else eg(e),window.postMessage(pb({type:"unmount",debugId:e},null))};return window.__INFINITE_TABLE_DEVTOOLS_HOOK__=o,Ue.onLogIntent("IT:*",e=>{XI({...Dc,url:xc(),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 fb(){let{getState:o,getDataSourceState:e,dataSourceActions:t}=oe(a=>({getState:a.getState,getDataSourceState:a.getDataSourceState,dataSourceActions:a.dataSourceActions})),n=o(),{domRef:r,debugId:i}=n;return i&&r.current&&getComputedStyle(r.current).getPropertyValue(qI)!==`${Id}`&&ti({debugId:i,key:"CSS001_CSS"}),(0,In.useEffect)(()=>{e().debugId!==i&&(t.debugId=i)},[i]),eR()}var al=Ie(),QI={revertAll:o=>{let e=ht.get(o.debugId);if(e){let t=$o.get(o.debugId);$o.delete(o.debugId),So.delete(o.debugId),t&&Object.keys(t).forEach(r=>{e.actions[r]=t[r],delete t[r]});let n=Co.get(o.debugId);Co.delete(o.debugId),To.delete(o.debugId),n&&Object.keys(n).forEach(r=>{e.dataSourceActions[r]=n[r],delete n[r]})}},revertProperty:o=>{let e=ht.get(o.debugId);if(e){let t=o.property,n=So.get(o.debugId),r=$o.get(o.debugId),i=To.get(o.debugId),a=Co.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=Co.get(o.debugId)||{};delete i[s],e.dataSourceActions[s]=c[s],delete c[s]}}},discardWarning:o=>{let e=ht.get(o.debugId);if(e){let t=o.warning,n=e.getDataSourceState().debugWarnings;if(n.get(t))n.delete(t),Yo(o.debugId);else{let i=o.warning,a=e.getState().debugWarnings;a.get(i)&&(a.delete(i),Yo(o.debugId))}}},discardAllWarnings:o=>{let e=ht.get(o.debugId);e&&(e.getDataSourceState().debugWarnings.clear(),e.getState().debugWarnings.clear(),Yo(o.debugId))},setColumnVisibility:o=>{ec(o.debugId,"columnVisibility",o.columnVisibility)},setGroupBy:o=>{ka(o.debugId,"groupBy",o.groupBy)},setGroupRenderStrategy:o=>{ec(o.debugId,"groupRenderStrategy",o.groupRenderStrategy)},setSortInfo:o=>{ka(o.debugId,"sortInfo",o.sortInfo)},setMultiSort:o=>{ka(o.debugId,"multiSort",o.multiSort)},setCssVar:o=>{let e=ht.get(o.debugId),t=e?.getState().domRef.current;!e||!t||!o.name?.startsWith("--infinite-")||(t.style.setProperty(o.name,o.value),no.set(o.debugId,{...no.get(o.debugId)||{},[o.name]:o.value}),Yo(o.debugId))},revertCssVar:o=>{let e=ht.get(o.debugId),t=e?.getState().domRef.current;if(!e||!t)return;t.style.removeProperty(o.name);let n={...no.get(o.debugId)||{}};delete n[o.name],no.set(o.debugId,n),Yo(o.debugId)},revertAllCssVars:o=>{let e=ht.get(o.debugId),t=e?.getState().domRef.current;if(!e||!t)return;let n=no.get(o.debugId)||{};Object.keys(n).forEach(r=>{t.style.removeProperty(r)}),no.delete(o.debugId),Yo(o.debugId)},highlight:o=>{let e=ht.get(o.debugId);if(e){let t=e.getState().domRef.current;if(t){let n=t.getBoundingClientRect(),r=document.querySelector(`.${li.classNames.base}`);r||(r=document.createElement("div"),r.classList.add(li.classNames.base),r.innerHTML=[`<div class="${db}"></div>`,`<div class="${ub}"></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(li.classNames.variants.active.true),a.removeEventListener("animationend",l)};a.addEventListener("animationend",l),r.classList.add(li.classNames.variants.active.true)}}}}};function JI(){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__||(ZI(),al(window.__INFINITE_TABLE_DEVTOOLS_HOOK__)),typeof o.data.type=="string")){let e=o.data.type,t=QI[e];t&&t(o.data.payload)}})}JI();function eR(){let{getState:o,getComputed:e,getDataSourceState:t,dataSourceActions:n,actions:r,dataSourceApi:i,api:a}=oe(u=>({getState:u.getState,getComputed:u.getComputed,getDataSourceState:u.getDataSourceState,dataSourceActions:u.dataSourceActions,actions:u.actions,dataSourceApi:u.dataSourceApi,api:u.api})),s=o().debugId,c=(0,In.useRef)(s);return c.current=s,(0,In.useEffect)(()=>{let u=c.current;if(!u)return;let d=f=>{f(u,{getState:o,getDataSourceState:t,getComputed:e,dataSourceActions:n,actions:r,api:a,dataSourceApi:i})},p=al.get();if(p){d(p);return}return al.onChange(f=>{f&&d(f)})},[]),(0,In.useEffect)(()=>{let u=c.current;if(!u)return;let d=al.get();d&&d(u,{getState:o,getDataSourceState:t,getComputed:e,dataSourceActions:n,actions:r,api:a,dataSourceApi:i})}),(0,In.useEffect)(()=>{if(s)return()=>{let u=globalThis.__INFINITE_TABLE_DEVTOOLS_HOOK__;u&&u(s,null)}},[s]),s}function mb(){let{masterPortalDOMRef:o}=co(n=>({masterPortalDOMRef:n.getMasterState().portalDOMRef}))??{},e=oe(n=>n.state.portalDOMRef);return o?.current??e?.current}var At=B(require("react")),Ib=require("react");var gb="hs68h8j _16lm1iwk _16lm1iwx _16lm1iw2n",hb=ye({defaultClassName:"hs68h8e _16lm1iw12 _16lm1iw1x _16lm1iw2j _16lm1iw1p",variantClassNames:{active:{true:"hs68h8f _16lm1iwn _16lm1iw1h",false:"_16lm1iwo"},draggingInProgress:{true:"hs68h8h",false:"hs68h8i"}},defaultVariants:{},compoundVariants:[]}),bb="hs68h81",yb=ye({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 Rn=B(require("react"));function Sb(o){return Rn.createElement("div",{...o.domProps})}function Tb(o){let{active:e}=o;return Rn.createElement("div",{className:bb},e?"Drop to group":"Drag columns to group")}function Cb(o){let e=t=>{(t.key==="Enter"||t.key===" ")&&(t.preventDefault(),o.onClear?.())};return Rn.createElement("div",{...o.domProps},o.label,Rn.createElement("div",{className:Ii[1]}),Rn.createElement("div",{tabIndex:0,role:"button","aria-label":`Clear grouping by ${o.field}`,className:gb,onKeyDown:e,onMouseDown:o.onClear},Rn.createElement(Ja,{size:20})))}var tR=(o,e)=>t=>{e&&e(t);let n=Date.now(),r=!1,i=()=>{r=!0};Me().addEventListener("mousemove",i,{once:!0}),Me().addEventListener("mouseup",()=>{r||(Me().removeEventListener("mousemove",i),Date.now()-n<200&&requestAnimationFrame(()=>{o()}))},{once:!0})};function oR(o){let{column:e,onClear:t,components:n,field:r,id:i,toggleSorting:a}=o,{dragSourceListId:l,dragItemId:s}=dn(),c=l===mr,u=Ke(),d=(e?tn(e.id,u,"grouping-toolbar"):r)??i,p=e?At.createElement(Ui,{forceSize:!0,size:20,direction:e.computedSortedAsc?1:e.computedSortedDesc?-1:0}):null,f=At.createElement(At.Fragment,null,d,p),m=s===i&&l===mr,g=te(hb({draggingInProgress:c,active:m}),o.domProps?.className),b=tR(a,o.domProps?.onMouseDown),h={...o.domProps,className:g,onMouseDown:b},y=n?.ToolbarItem??Cb;return At.createElement(y,{active:m,domProps:h,column:e,field:r,label:f,onClear:t})}var mr="grouping-toolbar";function Rb(o){let{groupBy:e}=Ae(S=>({groupBy:S.dataSourceState.groupBy})),{getComputed:t,dataSourceApi:n,api:r}=oe(S=>({getComputed:S.getComputed,dataSourceApi:S.dataSourceApi,api:S.api})),{dropTargetListId:i,dragSourceListId:a}=uo(),{fieldsToColumn:l,computedColumnsMap:s}=t(),c=i===mr,u=a===mr,d=o.components?.Placeholder??Tb,p=o.components?.Host??Sb,f=e.length?At.createElement(At.Fragment,null,e.map((S,T)=>{let C=S.field?l.get(S.field):void 0,I=`${S.field??`idx-${T}`}`;return At.createElement(Vo.DraggableItem,{key:I,id:I},R=>At.createElement(oR,{id:I,components:o.components,domProps:R,field:S.field,column:C,toggleSorting:()=>{C&&r.toggleSortingForColumn(C.id)},onClear:()=>{let v=e.filter(P=>P!==S).filter(Boolean);n.setGroupBy(v)}}))})):At.createElement(d,{draggingInProgress:u,active:c,groupBy:e}),m=S=>{let T=S.map(C=>e[C]);n.setGroupBy(T)},g=S=>{let{dragItemId:T}=S,C=T,I=s.get(C);if(!I||!I.field||!I.computedGroupable)return;let R=[...e];R.splice(S.dropIndex,0,{field:I.field}),n.setGroupBy(R)},b=(0,Ib.useCallback)(S=>{let{computedColumnsMap:T}=t(),C=S.dragItem.id,I=T.get(C);return!(!I||!I.computedGroupable||e.some(R=>R.field===I.field))},[e]),h=o.orientation??"horizontal",{domProps:y}=o;return At.createElement(Vo,{orientation:h,dragListId:mr,acceptDropsFrom:["header",mr],onDrop:m,dragStrategy:"inline",onAcceptDrop:g,shouldAcceptDrop:b},(S,{draggingInProgress:T,status:C})=>{let I=te(yb({active:c,orientation:h,draggingInProgress:T,dropRejected:C==="rejected"}),S.className,y?.className),R={...S,...y,className:I,children:f};return At.createElement(p,{active:c,rejectDrop:C==="rejected",domProps:R,orientation:h})})}var hr=B(require("react"));var ll=require("react"),ao=require("react"),sl=B(require("react"));function wb(o){let{dataArray:e,brain:t,computedPinnedEndColumns:n,computedPinnedStartColumns:r,computedVisibleColumns:i,computedRowHeight:a,columnSize:l,rowspan:s}=o;return fa(t,{colWidth:l,rowHeight:a,rows:e.length,cols:i.length,rowspan:s},{fixedColsEnd:n.length,fixedColsStart:r.length}),t}var Ro=B(require("react"));var vb=ye({defaultClassName:"evqes20",variantClassNames:{},defaultVariants:{},compoundVariants:[]});var Mc=require("react");function nR(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 rR(o,e){let{detailState:t,masterState:n,masterActions:r,cacheEntryForRow:i}=e,a=new Map(n.detailDataSourcesStateToRestore),l=Lm(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 Pb(o,e){let t={current:!1};return{currentRowCache:{getRowId:()=>o,add:r=>{t.current=!0,e.add(o,r)},get:()=>e.get(o),delete:()=>(t.current=!0,e.delete(o)),has:()=>e.has(o)},cacheCalledByRowDetailRenderer:t}}function Db(o){let{rowInfo:e,currentRowCache:t,cacheCalledByRowDetailRenderer:n,getMasterDataSourceState:r,masterActions:i,getMasterState:a}=o,l=r().detailDataSourcesStateToRestore.has(e.id)&&t.has(),c={registerDetail:pt(u=>{if(n.current||t.add({all:!0}),!t.has()){requestAnimationFrame(()=>{u.dataSourceState.destroyedRef.current||(u.dataSourceActions.stateReadyAsDetails=!0)});return}nR(e.id,{masterState:r(),detailContext:u}),requestAnimationFrame(()=>{u.dataSourceState.destroyedRef.current||(u.dataSourceActions.stateReadyAsDetails=!0)}),u.dataSourceState.onCleanup.onChange(()=>{let d=t.get();d&&rR(e.id,{detailState:u.getDataSourceState(),masterActions:i,masterState:r(),cacheEntryForRow:d})})}),shouldRestoreState:l};return c.masterRowInfo=e,c.getMasterDataSourceState=r,c.getMasterState=a,c}function xb(o){let{rowDetailsCache:e,rowInfo:t}=o,{getDataSourceState:n,dataSourceActions:r}=Ae(c=>({getDataSourceState:c.getDataSourceState,dataSourceActions:c.dataSourceActions})),{getMasterState:i}=oe(c=>({getMasterState:c.getState})),{currentRowCache:a,cacheCalledByRowDetailRenderer:l}=(0,Mc.useMemo)(()=>Pb(t.id,e),[e,t.id]),s=(0,Mc.useMemo)(()=>Db({rowInfo:t,currentRowCache:a,cacheCalledByRowDetailRenderer:l,getMasterDataSourceState:n,masterActions:r,getMasterState:i}),[t.id,a]);return s.masterRowInfo=t,s.getMasterDataSourceState=n,s.getMasterState=i,{masterDetailContextValue:s,currentRowCache:a}}function Mb(){return Do()}var{rootClassName:iR}=ke,aR=`${iR}RowDetail`;function lR(o){let{domRef:e,rowDetailRenderer:t,rowDetailHeight:n,rowInfo:r,detailOffset:i,rowDetailsCache:a}=o,{masterDetailContextValue:l,currentRowCache:s}=xb({rowDetailsCache:a,rowInfo:r}),c=Mn(),[u]=Ro.useState(()=>Mb());return u.setSnapshot(l),Ro.useLayoutEffect(()=>{u.notify()},[l]),Ro.createElement(c.Provider,{value:u},Ro.createElement("div",{ref:e,className:te(aR,vb({})),style:{position:"absolute",top:`${i}px`,left:0,width:`calc(${J.bodyWidth} - ${J.scrollbarWidthVertical})`,height:n}},t(r,s)))}var Eb=Ro.memo(lR);var sR=1;function Ab(o){let{computed:e,bodySize:t,imperativeApi:n}=o,{actions:r,getState:i,getComputed:a,getDataSourceMasterContext:l,rowHeight:s,rowDetailHeight:c,onRowMouseEnter:u,onRowMouseLeave:d,groupRenderStrategy:p,brain:f,showZebraRows:m,rowDetailRenderer:g,isRowDetailsExpanded:b,isRowDetailsEnabled:h,cellClassName:y,cellStyle:S,rowStyle:T,rowDetailCache:C,rowClassName:I,onScrollToTop:R,onScrollToBottom:v,onScrollStop:P,scrollToBottomOffset:w,wrapRowsHorizontally:x,updatedAt:E,ready:M,editingCell:D}=oe(G=>({actions:G.actions,getState:G.getState,getComputed:G.getComputed,getDataSourceMasterContext:G.getDataSourceMasterContext,rowHeight:G.state.rowHeight,rowDetailHeight:G.state.rowDetailHeight,onRowMouseEnter:G.state.onRowMouseEnter,onRowMouseLeave:G.state.onRowMouseLeave,groupRenderStrategy:G.state.groupRenderStrategy,brain:G.state.brain,showZebraRows:G.state.showZebraRows,rowDetailRenderer:G.state.rowDetailRenderer,isRowDetailsExpanded:G.state.isRowDetailExpanded,isRowDetailsEnabled:G.state.isRowDetailEnabled,cellClassName:G.state.cellClassName,cellStyle:G.state.cellStyle,rowStyle:G.state.rowStyle,rowDetailCache:G.state.rowDetailCache,rowClassName:G.state.rowClassName,onScrollToTop:G.state.onScrollToTop,onScrollToBottom:G.state.onScrollToBottom,onScrollStop:G.state.onScrollStop,scrollToBottomOffset:G.state.scrollToBottomOffset,wrapRowsHorizontally:G.state.wrapRowsHorizontally,updatedAt:G.state.updatedAt,ready:G.state.ready,editingCell:G.state.editingCell})),{computedPinnedStartColumns:A,computedPinnedEndColumns:O,computedVisibleColumns:N,computedColumnsMap:k,computedColumnOrder:F,computedRowHeight:V,computedRowSizeCacheForDetails:j,fieldsToColumn:L,rowspan:U,toggleGroupRow:H,columnSize:q}=e,ne=(0,ll.useMemo)(()=>N.map(G=>G.id),[N]),{dataArray:se,rowInfoStore:me,selectionMode:ie,cellSelection:ue,isNodeReadOnly:ce,getDataSourceState:Y,dataSourceApi:z,dataSourceActions:$}=Ae(G=>({dataSourceApi:G.dataSourceApi,dataSourceActions:G.dataSourceActions,getDataSourceState:G.getDataSourceState,dataArray:G.dataSourceState.dataArray,rowInfoStore:G.dataSourceState.rowInfoStore,selectionMode:G.dataSourceState.selectionMode,cellSelection:G.dataSourceState.cellSelection,isNodeReadOnly:G.dataSourceState.isNodeReadOnly})),X=Oe(se);wb({columnSize:q,brain:f,computedPinnedStartColumns:A,computedPinnedEndColumns:O,computedVisibleColumns:N,computedRowHeight:V,dataArray:se,bodySize:t,rowspan:U});let W=(0,ao.useRef)(0);(0,ao.useEffect)(()=>f.onRenderCountChange(()=>{W.current=f.scrollTopMax}),[f]),(0,ao.useEffect)(()=>f.onRenderRangeChange(G=>{i().onRenderRangeChange?.(G)}),[f]),(0,ao.useEffect)(()=>f.onScrollStop(G=>{let{scrollTop:_,scrollLeft:de}=G;if(_===0&&R?.(),_+(w??sR)>=W.current){v?.();let{livePagination:Ce,livePaginationCursor:Ne,dataArray:Le}=Y();Ce&&($.cursorId=Ne!==void 0?Date.now():Le.length)}if(P){let Ce=f.getRenderRange();P({scrollTop:_,scrollLeft:de,renderRange:Ce,viewportSize:i().bodySize,firstVisibleRowIndex:Ce.start[0],lastVisibleRowIndex:Ce.end[0],firstVisibleColIndex:Ce.start[1],lastVisibleColIndex:Ce.end[1]})}}),[f,R,v,P]),(0,ao.useEffect)(()=>{t.height&&(r.ready=!0)},[!!t.height]),(0,ao.useEffect)(()=>{let{onReady:G}=i();G&&G({api:n,dataSourceApi:z})},[M]);let re=(0,ll.useMemo)(()=>({isNodeReadOnly:ce,selectionMode:ie,cellSelection:ue}),[ce,ie,ue]),he=(0,ao.useCallback)(G=>{let{rowIndex:_,colIndex:de,heightWithRowspan:Te,domRef:xe,hidden:Ce,width:Ne,onMouseLeave:Le,onMouseEnter:He}=G,Xe=X()[_],ot=N[de];if(!Xe||!ot)return null;let it=j?j.getRowHeight(_):Te,K=!1;!h||typeof h=="function"&&!h(Xe)?K=!1:b&&(K=b(Xe)?"expanded":"collapsed");let ae=x?f.getRowIndexInPage(_):null,fe=x?f.getPageIndexForRow(_):null,Se=n.isEditorVisibleForCell({rowIndex:_,columnId:ot.id});return sl.createElement(Ep,{...{getData:X,virtualized:!0,showZebraRows:m,groupRenderStrategy:p,rowIndexInHorizontalLayoutPage:ae,horizontalLayoutPageIndex:fe,rowIndex:_,rowInfoStore:me,hidden:Ce,toggleGroupRow:H,rowHeight:it,rowDetailState:K,onMouseEnter:He,onMouseLeave:Le,onRowMouseEnter:u,onRowMouseLeave:d,domRef:xe,width:Ne,column:ot,columnsMap:k,fieldsToColumn:L,rowStyle:T,rowClassName:I,cellStyle:S,cellClassName:y,visibleColumnIds:ne,computedColumnOrder:F,inEditMode:Se,getDataSourceState:Y,dataSourceApi:z,dataSourceActions:$,getState:i,imperativeApi:n,componentActions:r,getComputed:a,getDataSourceMasterContext:l,dataSourceStatePartialForCell:re}})},[s,c,u,d,j,V,b,X,N,k,L,p,x,H,m,f,me,T,I,y,S,Y,z,$,i,n,r,a,l,ne,F,E,D,re]),be=(0,ll.useMemo)(()=>{if(b)return G=>{let{rowIndex:_,domRef:de}=G,xe=X()[_];if(!xe||!b(xe)||!j)return sl.createElement("div",{ref:de,className:wu.hidden});let{rowDetailHeight:Ce,rowHeight:Ne}=j.getSize(_);return sl.createElement(Eb,{rowInfo:xe,rowDetailsCache:C,rowIndex:_,domRef:de,detailOffset:Ne,rowDetailHeight:Ce,rowDetailRenderer:g})}},[M,he,g,c,b,C]);return{renderCell:he,renderDetailRow:be}}var _b=require("react");function Ob(){let{state:o,getState:e,actions:t}=oe(i=>({state:i.state,getState:i.getState,actions:i.actions})),{wrapRowsHorizontally:n}=o,r=Ao(n);(0,_b.useEffect)(()=>{if(r!==n){let{brain:i,headerBrain:a,renderer:l,onRenderUpdater:s}=e();i.destroy(),a.destroy(),l.destroy(),s.destroy();let c=ic(il,!!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 Lb=B(require("react"));var Nb="_16lm1iw1 _16lm1iw1c _16lm1iwe";var Fb=te(Nb,as);function kb(o){return Lb.createElement("div",{...o,className:o.className?te(Fb,o.className):Fb})}var gr=B(require("react"));var zb={visible:"qy58ya1 qy58ya0 _16lm1iw2 _16lm1iw23 _16lm1iw26 _16lm1iw2c _16lm1iw2a",hidden:"qy58ya2 qy58ya0 _16lm1iw2 _16lm1iw23 _16lm1iw26 _16lm1iw2c _16lm1iw2a"},Vb="qy58ya3 _16lm1iw2 _16lm1iw23 _16lm1iw26 _16lm1iw2c _16lm1iw2a",Gb="qy58ya4";var{rootClassName:cR}=ke,Ec=`${cR}-LoadMask`;function uR(o){let{visible:e,children:t="Loading"}=o;return gr.createElement("div",{className:`${zb[e?"visible":"hidden"]} ${Ec}`},gr.createElement("div",{className:`${Vb} ${Ec}-Overlay`}),gr.createElement("div",{className:`${Gb} ${Ec}-Text`},t))}var cl=gr.memo(uR);var Hb=require("react");var dR=[Ip,`${Qt}--hovered`];function pR(o){return Array.isArray(o)&&(o=o.join(" ")),o.split(" ").map(e=>e.trim()).filter(Boolean)}function wn(o){let e=Ke(),t=xo(),{getComputed:n,api:r}=e,{renderer:i,onRenderUpdater:a,debugId:l,keyboardNavigation:s,activeRowIndex:c,loadingText:u,columnReorderDragColumnId:d,scrollStopDelay:p,brain:f,scrollerDOMRef:m,components:g,bodySize:b,activeCellIndex:h,rowDetailRenderer:y,showHoverRows:S,wrapRowsHorizontally:T,domProps:C,domRef:I,forceBodyRerenderTimestamp:R,rowHoverClassName:v,ready:P}=oe(L=>({ready:L.state.ready,columnReorderDragColumnId:L.state.columnReorderDragColumnId,forceBodyRerenderTimestamp:L.state.forceBodyRerenderTimestamp,renderer:L.state.renderer,onRenderUpdater:L.state.onRenderUpdater,debugId:L.state.debugId,keyboardNavigation:L.state.keyboardNavigation,activeRowIndex:L.state.activeRowIndex,loadingText:L.state.loadingText,scrollStopDelay:L.state.scrollStopDelay,brain:L.state.brain,scrollerDOMRef:L.state.scrollerDOMRef,components:L.state.components,bodySize:L.state.bodySize,activeCellIndex:L.state.activeCellIndex,rowDetailRenderer:L.state.rowDetailRenderer,showHoverRows:L.state.showHoverRows,wrapRowsHorizontally:L.state.wrapRowsHorizontally,domProps:L.state.domProps,domRef:L.state.domRef,rowHoverClassName:L.state.rowHoverClassName})),w=g?.LoadMask??cl,x=n(),{computedRowHeight:E,computedRowSizeCacheForDetails:M}=x,D=M?.getRowHeight||E,{loading:A}=Ae(L=>({loading:L.dataSourceState.loading})),O=hr.useCallback(L=>{let U=e.getState(),H=L.target;if(!t&&L._from_row_detail)return;t&&(L._from_row_detail=!0);let q=Cd(H,rc(),U.domRef.current),ne,se,me,ie;q&&(se=Number(q.dataset.colIndex),ie=Number(q.dataset.rowIndex),ne=e.getComputed().computedVisibleColumns[se].id,me=e.dataSourceApi.getRowInfoArray()[ie].id);let ue={columnId:ne,colIndex:se,rowId:me,rowIndex:ie,event:L,target:q??L.target};q&&U.cellContextMenu(ue),U.contextMenu(ue)},[]),{renderCell:N,renderDetailRow:k}=Ab({imperativeApi:r,getComputed:n,domRef:I,bodySize:b,computed:x}),{autoFocus:F,tabIndex:V}=C??{};Ob();let j=(0,Hb.useMemo)(()=>{if(!S)return;let L=[];return v&&(L=L.concat(v)),o.rowHoverClassName&&(L=L.concat(o.rowHoverClassName)),wn.rowHoverClassName&&(L=L.concat(wn.rowHoverClassName)),pR(L)},[S,v,o.rowHoverClassName,wn.rowHoverClassName]);return hr.createElement(kb,{onContextMenu:O},hr.createElement(Ef,{forceRerenderTimestamp:R,debugId:l,tabIndex:V??0,autoFocus:F??void 0,activeRowIndex:P&&s==="row"?c:null,activeCellIndex:P&&s==="cell"&&!d?h:null,scrollStopDelay:p,renderer:i,wrapRowsHorizontally:T,onRenderUpdater:a,brain:f,activeCellRowHeight:D,renderCell:N,renderDetailRow:y?k:void 0,cellHoverClassNames:j,scrollerDOMRef:m,scrollVarHostRef:I}),hr.createElement(w,{visible:A},u))}wn.rowHoverClassName=dR;function Kb(){return oe(o=>o.api)}function Bb(o){return oe(e=>e.api.getColumnApi(o))}var Wb=o=>`--infinite-${o}`;var jb=40,$b=Wb(Rd);var Zt=ke.rootClassName,{ManagedComponentContextProvider:fR}=Ft({initSetupState:fg,forwardProps:mg,mapPropsToState:yg,cleanup:gg,allowedControlledPropOverrides:{rowHeight:!0,columnHeaderHeight:!0},mappedCallbacks:bg(),getParentState:()=>La(o=>o),debugName:o=>Ho(o.debugId,il)}),Ub=De.memo(function(){let e=hi(),{componentState:t,api:n,initialChildren:r}=oe(F=>({componentState:F.state,api:F.api,initialChildren:F.children})),{dataArrayLength:i,getDataSourceState:a,dataSourceActions:l,dataSourceApi:s}=Ae(F=>({dataArrayLength:F.dataSourceState.dataArray.length,getDataSourceState:F.getDataSourceState,dataSourceActions:F.dataSourceActions,dataSourceApi:F.dataSourceApi})),{domRef:c,portalDOMRef:u,onRowHeightCSSVarChange:d,onFlashingDurationCSSVarChange:p,onRowDetailHeightCSSVarChange:f,onColumnHeaderHeightCSSVarChange:m,rowHeightCSSVar:g,rowDetailHeightCSSVar:b,columnHeaderHeightCSSVar:h,scrollStopDelay:y,brain:S,activeRowIndex:T,activeCellIndex:C}=t,{licenseKey:I}=t;!I&&lo.licenseKey&&(I=lo.licenseKey),Ug(T,i,n),$g(C,i,n);let{onKeyDown:R}=dh();De.useEffect(()=>{let F=a(),V=Ot(j=>{F.notifyRenderRangeChange({renderStartIndex:j[0],renderEndIndex:j[1]})},{wait:y});return S.onVerticalRenderRangeChange(V)},[S,y]);let v=jg(I),{autoFocus:P,tabIndex:w,...x}=t.domProps??{},E=Kd(x);De.useEffect(()=>{S.setScrollStopDelay(y),l.scrollStopDelayUpdatedByTable=y},[y]),qm(),sb(),Yh();let{menuPortal:M}=Wh(),{menuPortal:D}=tb(),{menuPortal:A}=ob(),{menuPortal:O}=Zh();De.useEffect(()=>{typeof globalThis.__DO_NOT_USE_UNLESS_YOU_KNOW_WHAT_YOURE_DOING_IS_READY=="function"&&globalThis.__DO_NOT_USE_UNLESS_YOU_KNOW_WHAT_YOURE_DOING_IS_READY(t.id,t.ready,n,{dataSourceApi:s})},[t.ready,n,s]);let N=fb();De.useEffect(()=>{if(e){let F=e.getSnapshot();u.current=F.getMasterState().portalDOMRef.current}},[]);let k=r??De.createElement(De.Fragment,null,De.createElement(Os,null),De.createElement(wn,null));return De.createElement("div",{"data-debug-id":N,onKeyDown:R,ref:c,...E},k,De.createElement("div",{ref:u,className:te(`${ft}Portal`,vu[1e7],Ri.absolute,Iu[0],Su[0])},M,D,A,O),g?De.createElement(Ir,{key:"row-height",varName:g,onChange:d}):null,De.createElement(Ir,{key:"flashing-duration",allowInts:!0,varName:ge.components.Cell.flashingDuration,onChange:p}),b?De.createElement(Ir,{key:"row-detail-height",varName:b,onChange:f}):null,h?De.createElement(Ir,{key:"column-header-height",varName:h,onChange:m}):null,v?null:De.createElement(Qf,null),De.createElement(Uh,null))});function mR({children:o,store:e}){let{componentActions:t,componentState:n}=Lt(),{scrollerDOMRef:r,scrollTopKey:i}=n,a=Oe(n),l=Gg({state:n,actions:t,getState:a}),s=Oe(l),c=hi(),{getDataSourceState:u,dataSourceActions:d,getDataSourceMasterContext:p,dataSourceApi:f}=eo(),[m]=De.useState(()=>Um({getComputed:s,getState:a,getDataSourceState:u,getDataSourceMasterContext:p,dataSourceApi:f,actions:t,dataSourceActions:d})),g={actions:t,state:n,computed:l,dataSourceActions:d,getDataSourceMasterContext:p,getDataSourceState:u,getComputed:s,getState:a,api:m,dataSourceApi:f,children:o};return e.setSnapshot(g),De.useLayoutEffect(()=>{e.notify()}),di(r,b=>{let h={width:b.width,height:b.height};t.bodySize=h},{earlyAttach:!0,debounce:50}),De.useEffect(()=>{r.current&&(r.current.scrollTop=0)},[i,r]),De.createElement(Ub,null)}var lo=function(o){let[e]=De.useState(()=>Yg()),t=Ei();return De.createElement(fR,{repeatWrappedGroupRows:!!o.wrapRowsHorizontally,rowHeight:jb,columnHeaderHeight:$b,...o},De.createElement(ki,null,De.createElement(t.Provider,{value:e},De.createElement(mR,{children:o.children,store:e}))))};lo.Header=Os;lo.Body=wn;lo.HScrollSyncContent=ib;lo.Footer=()=>De.createElement(Du,null);lo.GroupingToolbar=Rb;var Yb=B(require("react"));function gR(o){let{DataSource:e}=rr({nodesKey:"children",...o});return Yb.createElement(e,null,o.children??null)}var qb=B(require("react"));var Ac=o=>(t,{unfilteredTreePaths:n,treeSelectionState:r,prevTreeSelectionState:i,lastUpdatedNodeInfo:a})=>{let l=new et(i,{treePaths:n});r.forEachLeafNodePath((u,{selected:d})=>{l.setNodeSelection(u,d)}),a&&r.forEachLeafNodePath(u=>{l.setNodeSelection(u,a.selected)},a.nodePath);let c={defaultSelection:!1,selectedPaths:l.getSelectedLeafNodePaths()};o(c)};function Xb(o){return qb.createElement(lo,{...o})}var ul=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=Ue(`IT:${e}:DataQuery`)}};function vn(o){if(Array.isArray(o))return o.map(vn);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]=vn(i))}),JSON.stringify(n)}return o instanceof Date?o.toISOString():o}var wo=class wo{constructor(e){this.queryCache=new ee;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=vn(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 ul(`${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=vn(e);return this.queryCache.get(t)?.getCurrentSnapshot().done??!1};this.hasQueryForKey=e=>{let t=vn(e);return this.queryCache.has(t)};this.discardQueryForKey=e=>{let t=vn(e);this.queryCache.delete(t)};if(this.options=e,wo.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)}wo.clients.set(e.name,this),this.name=e.name}static destroy(e){let t=wo.clients.get(e);t&&t.destroy()}static destroyAll(){wo.clients.forEach(e=>{wo.destroy(e.name)})}destroy(){wo.clients.delete(this.options.name)}};wo.clients=new Map;var _c=wo;var hR={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})})}}}},Zb={instantEdit:hR};var bR=require("react");function Qb(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 pl=class pl{constructor(e,t){this.orderRefs=[];if(typeof e=="number")this.maxSize=e,this.currentSet=new Set;else if(this.maxSize=t??pl.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}};pl.DEFAULT_SIZE=10;var dl=pl;var ml=class ml{constructor(e,t){this.orderRefs=[];if(typeof e=="number")this.maxSize=e,this.currentSet=new Set;else if(this.maxSize=t??ml.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}};ml.DEFAULT_SIZE=10;var fl=ml;var Pn=require("react"),yR=(o,e)=>o.every((t,n)=>t===e[n]),Jb=(o,e)=>{let t=(0,Pn.useRef)(e),n=yR(e,t.current),r=(0,Pn.useRef)(!0);t.current=e;let i=(0,Pn.useRef)(["same"]),a=n?[Date.now()]:i.current;i.current=a;let l=(0,Pn.useRef)(o);l.current=o,(0,Pn.useEffect)(()=>{if(r.current){r.current=!1;return}return l.current()},a)};var Zo=require("react"),ey=(o,e,t)=>o.every((n,r)=>t?t(n,e[r]):n===e[r]),gl=(o,e)=>{let{same:t,different:n,compare:r}=e,i=(0,Zo.useRef)(t),a=(0,Zo.useRef)(n),l=ey(t,i.current,r),s=!ey(n,a.current,r),c=(0,Zo.useRef)(!0);i.current=t,a.current=n;let u=(0,Zo.useRef)(["same"]),d=l&&s?[Date.now()]:u.current;u.current=d;let p=(0,Zo.useRef)(o);p.current=o,l&&s&&(c.current=!1),(0,Zo.useEffect)(()=>{if(!c.current)return p.current()},d)};var _t=B(require("react"));var ty=Q(J.currentFlashingDuration),SR=({children:o})=>_t.createElement(_t.Fragment,null,o),oy=1e3,ny={up:Vi({direction:"up"}).split(" "),down:Vi({direction:"down"}).split(" "),neutral:Vi({direction:"neutral"}).split(" ")},Oc=(o={})=>{let{flashDuration:e,flashClassName:t,render:n=SR}=o;return _t.forwardRef((i,a)=>{let l=Fr(),{flashingDurationCSSVarValue:s}=oe(R=>({flashingDurationCSSVarValue:R.state.flashingDurationCSSVarValue})),c=typeof s=="number"?s??e??oy:e??oy,{domRef:u,value:d,column:p,rowInfo:f,htmlElementRef:m}=l,g=f.id,b=p.id,h=_t.useRef(!0),y=_t.useRef(d),S=h.current?null:y.current;h.current=!1;let T=_t.useRef(void 0),C=_t.useRef(void 0),I=_t.useRef(void 0);return gl(()=>{if(d===y.current)return;let R=()=>{let x=m.current;if(T.current&&(clearTimeout(T.current),T.current=void 0),I.current&&(clearTimeout(I.current),I.current=void 0),C.current&&x){let E=C.current,M=ny[E];x.classList.remove(...t?[t,...M]:M),x.style.removeProperty(ty),C.current=void 0}};y.current=d;let v=m.current;if(!v)return;R();let P=typeof d=="number"?d>S?"up":"down":"neutral",w=ny[P];return v.style.setProperty(ty,`${c}`),v.classList.add(...t?[t,...w]:w),C.current=P,T.current=setTimeout(R,c),R},{same:[b,g],different:[d]}),_t.createElement("div",{ref:u,...i,className:te(i.className)},n({children:i.children,oldValue:S}))})},ry=Oc();var Qe=B(require("react")),br=require("react");var iy=require("react-dom");function ay(o){let[e,t]=Qe.useState(null);return(0,br.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"?Qe.createElement(ly.Provider,{value:{getState:e}},Qe.createElement(TR,null)):null}var ly=Qe.createContext({getState:()=>null});function TR(){let o=Qe.useContext(ly),{getState:e}=o,[,t]=Ut(),n=e().renderer.cellManager;(0,br.useEffect)(()=>{let s=Ot(()=>{console.log("rerender"),t()},{wait:500});return n.onCellAttachmentChange(s)},[n,t]);let r=n.getRowsWithCells(),i=n.getColumnsWithCells(),a=(0,br.useRef)(null),l=(0,br.useRef)(null);return Qe.createElement("div",{style:{overflow:"auto"}},(0,iy.createPortal)(Qe.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),Qe.createElement("table",{style:{borderCollapse:"collapse"}},Qe.createElement("thead",null,Qe.createElement("tr",null,i.map(s=>Qe.createElement("th",{key:s,"data-col-index":s},s)))),Qe.createElement("tbody",null,r.map(s=>Qe.createElement("tr",{key:s,"data-row-index":s},i.map(c=>Qe.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},Qe.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 CR={CheckBox:po,LoadMask:cl,MenuIcon:Vr,StringFilterEditor:zn,NumberFilterEditor:_i};0&&(module.exports={AutoScroller,CellSelectionState,DRAG_ITEM_ATTRIBUTE,DataClient,DataSource,DataSourceActionType,DeepMap,DragDropProvider,DragInteractionTarget,DragList,FixedSizeSet,FlashingColumnCell,GroupRowsState,INTERNAL_MatrixDebugger,InfiniteTable,InfiniteTableClassName,InfiniteTableComponent,Menu,RowDetailCache,RowDetailState,RowDisabledState,RowSelectionState,TreeDataSource,TreeExpandState,TreeGrid,TreeSelectionState,WeakFixedSizeSet,alignNode,components,createDefaultProxy,createFlashingColumnCellComponent,debounce,debug,defaultDragProxyMove,defaultFilterTypes,eventMatchesKeyboardShortcut,filterDataArray,filterTypes,flatten,getComponentStateRoot,group,interceptMap,keyboardShortcuts,multisort,multisortNested,queryKeyToCacheKey,toTreeDataArray,useComponentState,useDataSourceApi,useDataSourceInternal,useDataSourceSelector,useDataSourceState,useDragDropProvider,useDragListContext,useEffectWhen,useEffectWhenSameDeps,useEffectWithChanges,useEffectWithObject,useGridScroll,useInfiniteColumnApi,useInfiniteColumnCell,useInfiniteColumnEditor,useInfiniteColumnFilterEditor,useInfiniteHeaderCell,useInfinitePortalContainer,useInfiniteTableApi,useLayoutEffectWithChanges,useManagedDataSource,useMasterRowInfo,useOverlay,useOverlayPortal,usePrevious,useRowInfoReducers,useVisibleColumnSizes,withSelectedLeafNodesOnly});
|
|
29
|
+
`,`You are using version "${e.version}" of Infinite Table, which was published on ${r.toDateString()}.`,"Please visit infinite-table.com to renew your license.","Thank you for playing fair!"],t),!1):!0},bI=o=>{let e="",t=o.split("|").map(l=>{let[s,u]=l.split("=");return s==="C"&&(e=u),{name:s,value:u}});if(!e)throw"Invalid license";let n=e.split(",").reverse(),r=n.pop();n.forEach((l,s)=>{let u=t[s];if(du(u.value)!==l)throw"Invalid license"});let i=[...t];i.pop();let a=i.map(l=>`${l.name}=${l.value}`).join("|");if(du(a)!==r)throw"Invalid license";return t=t.map(l=>({...l,value:decodeURI(l.value)})),yI(t)};var SI=/(https):\/\/\d+\-\d+\-\d+\-(sandpack\.codesandbox\.io)/g,TI=/(https):\/\/\S+(\.csb\.app)/g,Zg=typeof window<"u"?window.location.origin:"",CI=()=>{let[o,e,t]=Array.from(SI.exec(Zg)||[]);return e==="https"&&t==="sandpack.codesandbox.io"},II=()=>{let[o,e,t]=Array.from(TI.exec(Zg)||[]);return e==="https"&&t===".csb.app"},RI=II()||CI(),Qg=(o="")=>{let t=!!Mo();return(0,Xg.useMemo)(()=>{if(t)return!0;let r=qg(o,{publishedAt:1624970570587,version:"9.0.0"});return!o&&!r&&RI?!0:r},[o,t])};var cr=require("react");var wI=10;function Jg(o,e,t){let n=(0,cr.useRef)(!1),r=(0,cr.useRef)(null);(0,cr.useEffect)(()=>{o!=null&&(n.current=!1,zt(r.current))},[o]),(0,cr.useEffect)(()=>{if(o!=null&&!n.current){let a=function(l=0){l++,zt(r.current),r.current=Ve(()=>{n.current=t.scrollCellIntoView(o[0],o[1],{offset:30}),!n.current&&l<wI&&a(l)})};var i=a;a()}return()=>{zt(r.current)}},[o,e])}var dr=require("react"),vI=10;function eh(o,e,t){let n=(0,dr.useRef)(!1),r=(0,dr.useRef)(null);(0,dr.useEffect)(()=>{o!=null&&(n.current=!1,cancelAnimationFrame(r.current))},[o]),(0,dr.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<vI&&a(l)})};var i=a;a()}return()=>{cancelAnimationFrame(r.current)}},[o,e])}function th(){return xo()}var pr=require("react");function oh(o,e){pu(o,e),DI(o,e),e.detail===2&&PI(o,e),o.getState().onCellClick?.(o,e)}function PI(o,e){if(Gi(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 DI(o,e){let{getDataSourceState:t,getState:n,getComputed:r,rowIndex:i,colIndex:a,dataSourceActions:l}=o,s=t(),{selectionMode:u,cellSelection:c}=s;if(!c||u!=="multi-cell")return;let{multiCellSelector:d,computedVisibleColumns:p}=r(),{brain:f,debugId:m}=n(),{rowsPerPage:g}=f,y=p.length,h=new Ue(c);h.debugId=m??"",d.cellSelectionState=h;let b={rowIndex:i,colIndex:a};if(e.metaKey||e.ctrlKey)d.singleAddClick(b);else if(e.shiftKey){let S=!!n().wrapRowsHorizontally;d.multiSelectClick(b,S?{horizontalLayout:S,rowsPerPage:g,columnsPerSet:y}:{horizontalLayout:S})}else d.resetClick(b);l.cellSelection=h}function pu(o,e){let{rowIndex:t,getDataSourceState:n,getComputed:r,dataSourceActions:i,api:a,cloneRowSelection:l}=o,{multiRowSelector:s,renderSelectionCheckBox:u}=r(),c=n(),{selectionMode:d,groupBy:p,dataArray:f,isTree:m}=c;if(p.length||m||f[t]?.rowDisabled)return!1;if(d==="multi-row"){if(u&&!e.key)return!1;let{rowSelection:y}=c;if(y=l(y),s.rowSelectionState=y,y&&typeof y=="object")return e.shiftKey?s.multiSelectClick(t):e.metaKey||e.ctrlKey?s.singleAddClick(t):s.resetClick(t),i.rowSelection=y,!0}else if(d==="single-row"){let h=f[t].id;e.metaKey||e.ctrlKey?a.rowSelectionApi.toggleRowSelection(h):a.rowSelectionApi.selectRow(h)}return!1}function nh(o,e){e.detail!==2&&void 0}var xI={Enter:!0," ":!0,a:!0};function rh(o,e){let{getState:t,getDataSourceState:n,dataSourceActions:r,api:i,dataSourceApi:a,cloneRowSelection:l,cloneTreeSelection:s}=o,{key:u,ctrlKey:c,metaKey:d}=e;if(!xI[u])return!1;let p=t(),f=n(),{activeRowIndex:m,activeCellIndex:g,keyboardNavigation:y,keyboardSelection:h}=p,{selectionMode:b,groupBy:S,rowSelection:I,treeSelectionState:T,isTree:C}=f;if(h===!1)return!1;let R=y==="row"&&m!=null?m:y==="cell"&&g!=null?g[0]:null,v=R!=null?f.dataArray[R]:null;if(!v||R==null)return!1;if(b==="single-row"&&u===" ")return i.rowSelectionApi.toggleRowSelection(v.id),!0;if(b!=="multi-row")return!1;if(u==="a"&&(c||d)){if(C&&T){let w=s(T);return w.selectAll(),r.treeSelection=w,!0}let P=l(I);return P.selectAll(),r.rowSelection=P,!0}if(u===" "){if(S.length)return v.isGroupRow&&v.groupKeys?i.rowSelectionApi.toggleGroupRowSelection(v.groupKeys):i.rowSelectionApi.toggleRowSelection(v.id),!0;if(C){if(v.isTreeNode&&v.nodePath)return a.treeApi.toggleNodeSelection(v.nodePath),!0}else{let P={key:e.key,metaKey:e.metaKey,ctrlKey:e.ctrlKey,shiftKey:e.shiftKey,preventDefault:()=>e.preventDefault()},{renderSelectionCheckBox:w}=o.getComputed();return w&&(P.metaKey=!1,P.ctrlKey=!0),pu({...o,rowIndex:R},P)}}return!1}var ih=["input","textarea","select","[tabindex]","a[href]","button","object"].join(", "),ah=o=>Array.from(o.querySelectorAll(ih)).filter(t=>!!t.offsetParent),Ua=o=>o.querySelector(ih);var sh=j(rn());async function lh(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 MI=10,EI=(o,e)=>o-e;function Ya(o,e){let{getComputed:t,getDataSourceState:n,getState:r,api:i,dataSourceApi:a}=e,{editingCell:l,isRowDetailEnabled:s}=r(),{dataArray:u}=n(),{computedVisibleColumns:c,computedColumnsMap:d}=t(),p=c[o.colIndex];if(!p)return!1;if(l&&l.columnId===p.id&&l.rowIndex===o.rowIndex)return!0;if(!p.contentFocusable)return!1;if(p.contentFocusable===!0)return!0;let f=u[o.rowIndex],m=!s||typeof s=="function"&&!s(f)?!1:i.rowDetailApi.isRowDetailExpanded(f.id)?"expanded":"collapsed",g=gt(p.id,e);return p.contentFocusable({column:p,...Un({column:p,rowInfo:f,columnsMap:d,context:e,rowDetailState:m}).formattedValueContext,columnApi:g,api:i,dataSourceApi:a})}function fu(o,e,t){let n=t.getState().editingCell;return AI(o,e,t,{isCellFocusable:Ya,isColumnElligible:i=>n&&n.columnId===i.id?!0:!!i.contentFocusable})}function uh(o,e,t){let n=(0,sh.default)(t,o+e,EI);return n<0&&(n=~n,e>0&&n>=t.length||e<0&&n===0)?null:t[n]??null}globalThis.getNextCol=uh;function AI(o,e,t,n){let{isColumnElligible:r,isCellFocusable:i}=n,a=t.getComputed().computedVisibleColumns.filter(r).reduce((d,p)=>(d.push(p.computedVisibleIndex),d),[]);if(!a.length)return null;let{getDataSourceState:l}=t,{dataArray:s}=l(),u=o.rowIndex,c=o.colIndex;for(;u!=null||c!=null;){if(c=c===null?a[e===-1?a.length-1:0]:uh(c,e,a),c===null){if(u+=e,u<0||u>=s.length)return null;continue}if(i({colIndex:c,rowIndex:u},t))return{colIndex:c,rowIndex:u}}return null}async function ch(o){let e={rowIndex:o.getDataSourceState().dataArray.length-1,colIndex:o.getComputed().computedVisibleColumns.length-1},t=Ya(e,o)?e:fu(e,-1,o);if(t){await mu([t.rowIndex,t.colIndex],o);let n=o.getState().getDOMNodeForCell(t);if(!n)return;Ua(n)?.focus()}}async function mu([o,e],t){let{api:n}=t;return new Promise((r,i)=>{let a=MI,l=null,s=!1;function u(c=0){c++,zt(l),l=Ve(async()=>{if(s=n.scrollCellIntoView(o,e,{offset:30}),!s&&c<a&&u(c),s){try{await lh(()=>!!t.getState().getDOMNodeForCell({rowIndex:o,colIndex:e}))}catch(d){i(d);return}r(!0)}})}u()})}var _I=`.${Qt}`;function dh(o,e){if(e.key!=="Tab")return!1;let t=e.shiftKey?-1:1,n=e.target,r=o.getState().scrollerDOMRef.current,i=document.activeElement===r||n===r;if(!r||i&&t===-1)return!1;let a=i?null:Lo(n,_I),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:c}=o.getState();[l,s]=c||[0,0]}if(l==null||s==null||isNaN(l)||isNaN(s))return!1;let u=i&&Ya({colIndex:s,rowIndex:l},o)?{rowIndex:l,colIndex:s}:fu({rowIndex:l,colIndex:s},t,o);if(!u){if(t===-1)r.focus();else{let c=ah(document.body),d=o.getState().focusDetectDOMRef.current,p=c.findIndex(m=>m===d);c[p+1]?.focus()}return!0}return mu([u.rowIndex,u.colIndex],o).then(()=>{let c=o.getState().getDOMNodeForCell(u);if(!c)return;Ua(c)?.focus()}),!0}var ph={control:"ctrl"},fh={"control|cmd":"ctrl","cmd|control":"ctrl","ctrl|cmd":"ctrl","cmd|ctrl":"ctrl"},OI={esc:"escape"},gh={cmd:o=>o.metaKey,alt:o=>o.altKey,ctrl:o=>o.ctrlKey,shift:o=>o.shiftKey},hh=Object.keys(gh),gu=new Set(hh),NI=new Set(["shift","alt"]);function qa(o,e){return Array.isArray(e)?e.some(t=>mh(o,t)):mh(o,e)}function mh(o,e){let t=o.key.toLowerCase(),n=e.split("+").map(p=>p.toLowerCase().trim()),r=n.find(p=>fh[p]),i=n.map(p=>ph[p]||fh[p]||OI[p]||p),a=i.filter(p=>gu.has(p)),l=i.filter(p=>!gu.has(p)),s=hh.reduce((p,f)=>(p[f]=gh[f](o),p),{});r&&s.cmd&&(s.cmd=!1,s.ctrl=!0);let u=Object.keys(s).filter(p=>s[p]);if(!a.every(p=>s[p]===!0))return!1;if(l.includes("*")){if(u.length<a.length||u.filter(f=>!NI.has(f)).length)return!1}else if(a.length!=u.length)return!1;return!l.length||gu.has(t)||t==="meta"||ph[t]?!1:l.reduce((p,f)=>p?f==="*"||t===f:!1,!0)}async function yh(o,e){let t={...o,cloneRowSelection:a=>Ia(a,o.getDataSourceState),cloneTreeSelection:a=>va(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&&rh(t,e)&&e.preventDefault(),(dh(t,e)||!o.getState().focusedWithin&&!r.preventNavigation&&Zm(t,e))&&e.preventDefault(),!r.preventEdit&&e.key==="Enter"&&!o.api.isEditInProgress()){let{activeCellIndex:a}=o.getState();if(a){let[l,s]=a,u=o.getComputed().computedVisibleColumns[s];u.computedEditable&&o.api.startEdit({rowIndex:l,columnId:u.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(!qa(e,a.key)||a.when&&!await a.when(o))continue;let l=await a.handler(o,e);if(l&&l.stopNext)break}}function FI(){let{getState:o,actions:e,api:t,getComputed:n,getDataSourceMasterContext:r}=He(),{getDataSourceState:i,dataSourceActions:a,dataSourceApi:l}=eo();return(0,pr.useMemo)(()=>({getComputed:n,getDataSourceMasterContext:r,dataSourceApi:l,api:t,getState:o,actions:e,getDataSourceState:i,dataSourceActions:a,cloneTreeSelection:c=>va(c,i),cloneRowSelection:c=>Ia(c,i)}),[o,e,i,a,t,l,n])}function LI(){let o=FI();(0,pr.useEffect)(()=>{let e=o.getState().keyDown.onChange(a=>{yh(o,a)});function t(a){if(!a)return;let l=a.event,s=o.getComputed().computedVisibleColumns[a.colIndex],u=gt(s.id,o);oh({...o,rowIndex:a.rowIndex,colIndex:a.colIndex,column:s,columnApi:u},{...l,key:""})}let n=o.getState().cellClick.onChange(t);function r(a){if(!a)return;let{event:l,rowIndex:s,colIndex:u}=a,c=o.getComputed().computedVisibleColumns[u],d=gt(c.id,o);nh({...o,rowIndex:s,colIndex:u,column:c,columnApi:d},l)}let i=o.getState().cellMouseDown.onChange(r);return()=>{e(),n(),i()}},[])}function kI(){let{getState:o}=ne(t=>({getState:t.getState}));return{onKeyDown:(0,pr.useCallback)(t=>{o().keyDown(t)},[])}}function bh(){return LI(),kI()}var Cu=require("react");var Be=j(require("react")),Et=require("react"),vh=require("react-dom");var Xa="__is_infinite_menu_component";function hu(o){return!!o.tagName}function Ch(o){let{alignTarget:e,alignAnchor:t,constrainTo:n,alignPosition:r}=o,i=ve.from(hu(e)?e.getBoundingClientRect():e),a=ve.from(hu(t)?t.getBoundingClientRect():t),l=n?ve.from(hu(n)?n.getBoundingClientRect():n):null;if(!l)return{...Sh({anchorRect:a,targetRect:i,position:r[0]}),index:0};let s=null;for(let u=0,c=r.length;u<c;u++){let d=Sh({anchorRect:a,targetRect:i,position:r[u],constrainRect:l});if(u===0&&(s={...d,index:0}),d.valid)return{...d,index:u}}return s}function Sh(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=Th(e,i),s=Th(t,a),u=l.getDistanceToPoint(s);e.shift(u);let c=n?n.contains(e):!0;return{alignPosition:r,alignedRect:e,valid:c,distance:u}}function Th(o,e){return e==="TopLeft"?$e.from({top:o.top,left:o.left}):e==="TopCenter"?$e.from({top:o.top,left:o.left+(o.width>0?Math.round(o.width/2):0)}):e==="TopRight"?$e.from({top:o.top,left:o.left+o.width}):e==="BottomLeft"?$e.from({left:o.left,top:o.top+o.height}):e==="BottomCenter"?$e.from({left:o.left+(o.width>0?Math.round(o.width/2):0),top:o.top+o.height}):e==="BottomRight"?$e.from({left:o.left+o.width,top:o.top+o.height}):e==="CenterLeft"?$e.from({left:o.left,top:o.top+(o.height>0?Math.round(o.height/2):0)}):e==="CenterRight"?$e.from({left:o.left+o.width,top:o.top+(o.height>0?Math.round(o.height/2):0)}):$e.from({left:o.left+(o.width>0?Math.round(o.width/2):0),top:o.top+(o.height>0?Math.round(o.height/2):0)})}function zI(o){return o&&typeof o.then=="function"||o instanceof Promise}function Rh(o){return o==null||typeof o=="string"?!1:typeof o.tagName=="string"}async function Ih(o){return typeof o=="function"&&(o=o()),zI(o)&&(o=await o),typeof o=="string"&&(o=document.querySelector(o)),o&&Rh(o)&&(o=o.getBoundingClientRect()),o?ve.from(o):null}async function wh(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)),Rh(n)&&(r=n),r||null}return t(await e)}async function Za(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 Ih(t)||void 0,a=n?await Ih(n):void 0,l=ve.from(o.getBoundingClientRect());if(!a)return;let{alignedRect:s}=Ch({constrainTo:i,alignAnchor:a,alignTarget:l,alignPosition:r});o.style.transform=`translate3d(${s.left}px,${s.top}px, 0px)`;let u=o.getBoundingClientRect();if(u.left!==s.left||u.top!==s.top){let c=o.offsetParent;if(c){let d=c.getBoundingClientRect(),p=d.left,f=d.top,m=s.left-p,g=s.top-f;o.style.transform=`translate3d(${m}px,${g}px, 0px)`}}}function VI(o){return Be.createElement("div",{style:{position:"fixed",top:0,left:0}},o.children)}function GI(o){let e=Be.useRef(null);return(0,Et.useEffect)(()=>o.realign.onChange(t=>{e.current&&t&&Za(e.current,t)}),[o.realign]),Be.createElement("div",{style:{position:"absolute",top:0,left:0},ref:(0,Et.useCallback)(t=>{t&&Za(t,o),e.current=t},[])},typeof o.children=="function"?o.children():o.children)}function Ph(o,e){let[t,n]=(0,Et.useState)(null);return(0,Et.useLayoutEffect)(()=>{async function r(){let i=e?await wh(e):null;i!=null&&n(i)}e&&r()},[e]),e?t?(0,vh.createPortal)(o,t):Be.createElement(Be.Fragment,null):e===null||e===!1?o:Be.createElement(VI,null,o)}function HI(o){if(Be.Children.count(o)===1){let e=Be.Children.only(o);if(Be.isValidElement(e))return e.props.id||e.key}return null}function KI(o,e,t){if(Be.Children.count(o)===1){let n=Be.Children.only(o);if(Be.isValidElement(n)&&n.type[Xa]){let r={};return n.props.portalContainer===void 0&&(r.portalContainer=e),n.props.constrainTo===void 0&&(r.constrainTo=t),Be.cloneElement(n,r)}}return o}function io(o){let e=o,[t]=(0,Et.useState)(()=>new Map),[n,r]=(0,Et.useState)(null),[i,a]=(0,Et.useState)(0),l=(0,Et.useCallback)(()=>{let m=[];for(let[g,y]of t)m.push(Be.createElement(GI,{...y,key:y.key}));return m},[]),[s,u]=Ut(),c=Ph(l(),o.portalContainer),d=(0,Et.useCallback)((m,g)=>{let h=`${g.id||HI(m)||Ht()}`,b=t.get(h),S=C=>()=>{let R=typeof C=="function"?C():C;return KI(R,e.portalContainer,g.constrainTo??e.constrainTo)},I=S(m),T=(C,R)=>{if(!b)return;let v=S(C);Object.assign(b,{children:v}),u(),!!!R?.skipRealign&&(r(b.key),a(Date.now()))};return b?(Object.assign(b,g),T(m),T):(b={key:h,children:I,alignPosition:g.alignPosition,alignTo:g.alignTo,constrainTo:g.constrainTo,realign:be()},t.set(b.key,b),u(),T)},[t,e.portalContainer,u]);Be.useEffect(()=>{if(n){let m=t.get(n);m&&m.realign(m)}},[n,i]);let p=m=>{m=`${m}`,t.has(m)&&(t.delete(m),u())},f=()=>{t.clear(),u()};return Be.useEffect(()=>{},[]),{portal:c,hideOverlay:p,clearAll:f,rerenderOverlays:u,showOverlay:d}}var qh=j(require("react"));var gr=j(require("react"));var Vh=j(require("react"));var kh=j(require("react"));function Qa(o){return null}Qa.defaultProps={__is_menu_item:!0};var Dh="submenu",BI="-";function xh(){return{keyboardActiveItemKey:null,activeItemKey:null,generatedId:Ht(),focused:!1,destroyed:!1,domRef:{current:null}}}function Mh(){return{parentMenuId:1,parentMenuItemKey:1,onHideIntent:1,constrainTo:1,onAction:1,onShow:1,onHide:1,autoFocus:1,wrapLabels:1}}var yu=({columns:o,keyboardActiveItemKey:e,activeItemKey:t,menuId:n},r,i)=>{let a=r&&(r.key!=null||r.label!=null)?r:null,l=a===null?r===BI?i.renderSeparator():r:null;return a!=null?{type:"item",parentMenuId:n,disabled:!!a.disabled,keyboardActive:a.key===e,active:a.key===t,value:a,span:a.span||1,key:a.key,menu:a.menu||null,style:a.style,className:a.className,originalMenuItem:a}:{type:"decoration",value:l,span:o.length,style:{gridColumnStart:1,gridColumnEnd:o.length+10}}},WI=[{name:"label"}],Eh=(o,e)=>{let{props:t,state:n}=o,{activeItemKey:r,keyboardActiveItemKey:i}=n,{items:a,children:l,addSubmenuColumnIfNeeded:s,parentMenuId:u}=t,c=t.id||n.generatedId;u&&(c=`${u}-${c}`);let d=[...t.columns||WI],p={columns:d,keyboardActiveItemKey:i??null,activeItemKey:r??null,menuId:c},f=[];a?f=a.map(g=>yu(p,g,e)):!a&&typeof l!="function"&&(f=e.childrenToRuntimeItems?e.childrenToRuntimeItems(p,l):[]),s&&f.filter(y=>y.type==="item"&&y.menu!=null).length>0&&!d.find(y=>y.name==Dh)&&d.push({name:Dh,render:e.renderSubmenuColumn});let m=f.filter(g=>g.type==="item"&&!g.disabled);return{runtimeItems:f,runtimeSelectableItems:m,columns:d,menuId:c}};var fr=j(require("react"));var Ah="db3arf0 _16lm1iw0 _16lm1iw1 _16lm1iw1w _16lm1iw2f _16lm1iw8",_h=ye({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"]]}),Oh="db3arf1",Nh="db3arfd";function Fh(){return fr.createElement("hr",{className:Nh})}var Ja={renderSeparator:()=>fr.createElement(Fh,null),renderSubmenuColumn:({domProps:o,item:e})=>e.menu?fr.createElement("div",{...o},fr.createElement(un,{expanded:!1})):fr.createElement("div",{...o})};var Lh=(o,e)=>yu(o,e,Ja);function zh(o,e){return kh.Children.map(e,t=>{if(t&&(t.props.__is_menu_item||t.type===Qa)){let n={...t.props};return n.key||(n.key=t.key),n.description||(n.description=t.props.children),n.label||(n.label=n.children),Lh(o,n)}return Lh(o,t)})||[]}function Gh(){return{...xh(),domRef:Vh.createRef()}}var Hh=()=>Mh(),Kh=o=>Eh(o,{...Ja,childrenToRuntimeItems:zh});var jt=j(require("react")),dt=require("react");function Bh(o,e){let t=Wh(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 Wh(o,e){let t=Lo(document.querySelector(`[data-menu-id="${o}"] [data-menu-item-key="${e}"]`),`[data-menu-id="${o}"]`);if(!t)return[];let n=t.querySelectorAll(`[data-menu-item-key="${e}"]`);return Array.from(n)}function jh(o,e){let t=Wh(o,e);if(!t.length)return null;for(let n of t){let r=n.querySelector('input[type="checkbox"]');if(r)return r}return null}var ai=class extends Wn{constructor(e){super(e.slice(0,3))}};var jI=250;function $I(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}Ve(i)};Ve(()=>{i()})})}var UI=xe(),el=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||jI;this.getPointerMoveTarget=()=>document.documentElement||UI;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 $e({left:e.clientX,top:e.clientY});if(!this.activeItemMenuRect||!this.activeItemLeavePoint)return;let s=this.activeItemLeavePoint.left<this.activeItemMenuRect.left,c=(s?1:-1)*(l.left-this.activeItemLeavePoint.left);if(c-this.lastHorizontalDiff<0){this.lastHorizontalDiff=0,i();return}this.lastHorizontalDiff=c,(s?new ai([this.activeItemLeavePoint,this.activeItemMenuRect.getTopLeft(),this.activeItemMenuRect.getBottomLeft()]):new ai([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,$I(()=>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 $e({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 tl=require("react"),bu=(0,tl.createContext)(null);function Su(){return(0,tl.useContext)(bu)}var mr=require("react");function $h(){let o=(0,mr.useRef)(!0);return(0,mr.useEffect)(()=>(o.current=!0,()=>{o.current=!1}),[]),(0,mr.useCallback)(()=>o.current,[])}function YI(o,e){let{parentMenuId:t,setSubmenuApi:n,setActiveItemKey:r,setKeyboardActiveItemKey:i,constrainTo:a,onHideIntent:l,api:s}=e,u=`${t}-submenu`,c=o.menu;return c?(typeof c=="function"&&(c=c()),jt.createElement($t,{key:u,parentMenuItemKey:o.key,parentMenuId:t,constrainTo:a,...c,autoFocus:!1,onShow:(d,p)=>{c?.onShow?.(d,p),n(p)},onHideIntent:d=>{c?.onHideIntent?.(d),l(d)},onHide:d=>{d.focused&&(r(null),i(o.key),s.focus())}})):null}function qI({onItemActivate:o}){let{getState:e}=Su(),[{onItemEnter:t,onItemLeave:n}]=(0,dt.useState)(()=>new el({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,dt.useCallback)(t,[]),onItemLeave:(0,dt.useCallback)(n,[])}}function Uh(o){let{domProps:e}=o,{componentState:{columns:t,runtimeItems:n,menuId:r,activeItemKey:i,keyboardActiveItemKey:a,constrainTo:l,destroyed:s,onAction:u,wrapLabels:c,onShow:d,onHide:p,autoFocus:f,parentMenuItemKey:m,domRef:g},componentActions:y,getState:h}=Su(),b=(0,dt.useCallback)(K=>{y.keyboardActiveItemKey=K},[]),S=(0,dt.useCallback)(K=>{y.activeItemKey=K},[]),I=$h(),[T,C]=(0,dt.useState)(null),R=null;(0,dt.useLayoutEffect)(()=>{let{runtimeItems:K}=h(),q=K.filter(re=>re.type==="item"&&i===re.key)[0];if(!q||!q.menu){C(null),x();return}if(q){let re=Bh(r,q.key);re&&P(()=>YI(q,{constrainTo:l,setSubmenuApi:C,setActiveItemKey:S,setKeyboardActiveItemKey:b,parentMenuId:r,onHideIntent:G,api:B}),{id:`${r}-submenu`,alignTo:re,alignPosition:[["TopLeft","TopRight"],["TopRight","TopLeft"]],constrainTo:l});return}},[i]);let v=(K,q)=>{b(q.key),S(q.key),q.originalMenuItem.onClick&&q.originalMenuItem.onClick(K);let re={key:q.key,item:q.originalMenuItem,hideMenu:G};q.originalMenuItem.onAction&&q.originalMenuItem.onAction(re),u&&u(re),q.originalMenuItem.hideMenuOnAction&&G()},{showOverlay:P,portal:w,clearAll:x}=io({portalContainer:!1}),{onItemEnter:E,onItemLeave:M}=qI({onItemActivate:K=>{if(!I())return;let q=K?K.key:null;S(q)}});R=n.map((K,q)=>jt.createElement(XI,{key:K.type==="item"?K.key:q,onItemEnter:(re,se)=>{E(re.key,se)},onItemLeave:(re,se)=>{M(re.key,se)},columns:t,active:K.type==="item"&&K.key===i,keyboardActive:K.type==="item"&&K.key===a,item:K,index:q,onClick:v}));let D=t.map(K=>K.width||(typeof K.flex=="number"?`${K.flex}fr`:K.flex)||"auto").join(" "),A={...e.style,gridTemplateColumns:D,gridTemplateRows:n.map(()=>"auto").join(" ")};c||(A.whiteSpace="nowrap");function O(K){let{runtimeItems:q,runtimeSelectableItems:re}=h(),se=q.findIndex(X=>X.type==="item"&&X.key===a),de=a,ae=q[se],ce={ArrowUp:()=>{let X=q.slice(0,se).filter(k=>k.type==="item"&&!k.disabled).pop();X&&X.type==="item"&&X.key&&(de=X.key)},ArrowDown:()=>{let X=q.slice(se+1).filter(k=>k.type==="item"&&!k.disabled)[0];X&&X.type==="item"&&X.key&&(de=X.key)},Home:()=>{ce.PageUp()},End:()=>{ce.PageDown()},PageUp:()=>{de=re[0].key},PageDown:()=>{de=re[re.length-1].key},ArrowLeft:()=>{S(null),h().parentMenuId&&(y.destroyed=!0)},ArrowRight:()=>{ae&&(S(ae.key),Ve(()=>{I()&&T&&T.getParentMenuId()===h().menuId&&T.focus()}))},Enter:()=>{if(ae)if(ae.originalMenuItem?.menu){if(ae&&ae.originalMenuItem.menu&&T){ce.ArrowLeft();return}ae&&S(ae.key)}else v(K,ae)}," ":()=>{if(!ae)return;ae.originalMenuItem.menu||v(K,ae);let X=jh(r,ae.key);X&&X.click()},Escape:()=>{ce.ArrowLeft();let X=h();X.parentMenuId||X.onHideIntent?.(X)}},le=ce[K.key];le&&(le(),K.preventDefault()),de!=a&&b(de)}function N(){y.focused=!1}let L=(0,dt.useCallback)(function(){y.focused=!0,setTimeout(()=>{F.current&&g.current&&g.current===document.activeElement&&h().keyboardActiveItemKey==null&&b(h().runtimeSelectableItems[0]?.key??null)})},[]),F=(0,dt.useRef)(!0),G=(0,dt.useCallback)(()=>{let K=h();K.onHideIntent?.(K)},[h]),[B]=(0,dt.useState)(()=>({hideMenu:G,focus:()=>{g.current&&(g.current.focus(),setTimeout(()=>{g.current&&g.current!==document.activeElement&&g.current.focus()},10),L())},getMenuId:()=>h().menuId,getParentMenuId:()=>h().parentMenuId})),z=(0,dt.useCallback)(K=>{K?(g.current=K,d?.(h(),B),f&&B.focus()):(p?.(h()),g.current=K)},[]),U=jt.createElement("div",{className:Fn.contents},jt.createElement("div",{...e,"data-menu-id":r,"data-submenu-for":m,tabIndex:0,ref:z,onKeyDown:K=>{e.onKeyDown?.(K),O(K)},onMouseDown:K=>{F.current=!1,e.onMouseDown?.(K)},onMouseUp:K=>{F.current=!0,e.onMouseUp?.(K)},onFocus:L,onBlur:N,className:te(Ah,e.className,"InfiniteMenu"),style:A},R),w);return s?null:U}function XI(o){let[e,t]=jt.useState(!1),{columns:n,item:r,index:i,active:a,keyboardActive:l}=o,s=r.type==="item"?r.value.key:i,u=null;if(r.type==="decoration")u=jt.createElement("div",{style:r.style},r.value);else{let c=0;u=n.map((d,p)=>{let f=r.value,m=d.field||d.name,g=p+1,y=g+r.span;if(g<c)return null;c=y;let b={style:{...d.style,...r.style,gridColumnStart:g,gridColumnEnd:y},"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:te(_h({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?jt.createElement(Vr,{key:`${s}-${m}`,render:d.render,renderParam:{item:f,column:d,value:f[m],domProps:b}}):jt.createElement("div",{key:`${s}-${m}`,...b},f[m])}).filter(Boolean)}return jt.createElement("div",{className:Oh},u)}var{ManagedComponentContextProvider:ZI}=Ft({initSetupState:Gh,forwardProps:Hh,mapPropsToState:Kh,layoutEffect:!0});function QI(o){let{componentActions:e,componentState:t}=Lt(),n=Ne(t);return gr.createElement(bu.Provider,{value:{componentActions:e,componentState:t,getState:n}},gr.createElement(Uh,{domProps:o.domProps}))}function $t(o){let{children:e,portalContainer:t,items:n,parentMenuId:r,addSubmenuColumnIfNeeded:i=!0,bubbleActionsFromSubmenus:a=!0,onShow:l,onHide:s,wrapLabels:u=!1,onAction:c,constrainTo:d,columns:p,parentMenuItemKey:f,autoFocus:m,id:g,onHideIntent:y,__is_infinite_menu_component:h,...b}=o;return gr.createElement(ZI,{addSubmenuColumnIfNeeded:i,bubbleActionsFromSubmenus:a,wrapLabels:u,...o},gr.createElement(QI,{domProps:b}))}$t[Xa]=!0;var Tu=j(require("react"));function Yh(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 c=[];return r().computedColumnsMapInInitialOrder.forEach((p,f)=>{let m=nn(p,e,"column-menu");c.push({key:f,label:m,check:Tu.createElement(fo,{key:p.id,disabled:p.computedVisible&&i.getVisibleColumnsCount()===1,checked:p.computedVisible,onChange:g=>{let y=!!g;i.setVisibilityForColumn(p.id,y),requestAnimationFrame(()=>{i.realignColumnContextMenu()})}})})}),{columns:[{name:"check"},{name:"label"}],items:c}}},"-",{key:"group-by",label:"Group by",menu:()=>{let c=[];return r().computedColumnsMapInInitialOrder.forEach((p,f)=>{if(p.groupByForColumn)return;let m=nn(p,e,"column-menu");c.push({key:f,label:m,check:Tu.createElement(fo,{key:p.id,disabled:!p.computedGroupable,checked:p.computedGroupedBy,onChange:()=>{a.toggleGroupByField(p.field)}})})}),{columns:[{name:"check"},{name:"label"}],items:c}}}].filter(c=>!!c)}function Xh(o,e,t){if(o==null)return null;let{getComputed:n,getState:r}=e,{components:i,getColumnMenuItems:a}=r(),l=i?.Menu??$t,s=n().computedColumnsMap.get(o);if(!s)return null;let u={column:s,columnApi:gt(s.id,e),...e},c=Yh([],u),d=a?a(c,u):c,p=m=>{m.__insideMenu=!0},f=m=>{m.domRef.current?.parentNode?.removeEventListener("mousedown",p)};return!d||!d.length?null:qh.createElement(l,{autoFocus:!0,items:d,onShow:m=>{m.domRef.current?.parentNode?.addEventListener("mousedown",p)},onHide:f,onHideIntent:m=>{f(m),t?.()}})}var JI=`[${Gr["data-name"]}="${Hr["data-name"]}"]`;function eR(o){let{columnId:e,context:t,clearAll:n,showOverlay:r}=o,{getState:i,actions:a}=t,{columnMenuTargetRef:l,domRef:s}=i();function u(){n(),a.columnMenuVisibleForColumnId=null}let c=o.target;if(c||(c=l.current??void 0,c&&!s.current.contains(c)&&(c=void 0)),!c){let d=`[${qf["data-column-id"]}="${e}"] ${JI}`;c=i().domRef.current.querySelector(d)}if(!c){console.warn(`Cannot show column menu for column "${e}"`);return}l.current=null,r(()=>Xh(e,t,u),{constrainTo:s.current,id:"column-menu",alignTo:c,alignPosition:[["TopLeft","BottomLeft"],["TopRight","BottomRight"]]})}function Zh(){let o=He(),{getState:e,actions:t,columnMenuVisibleForColumnId:n,columnMenuVisibleKey:r}=ne(u=>({getState:u.getState,actions:u.actions,columnMenuVisibleForColumnId:u.state.columnMenuVisibleForColumnId,columnMenuVisibleKey:u.state.columnMenuVisibleKey})),{portalDOMRef:i}=uo(u=>({portalDOMRef:u.getMasterState().portalDOMRef}))||{},{showOverlay:a,portal:l,clearAll:s}=io({portalContainer:i?.current??!1});return(0,Cu.useEffect)(()=>{let u=e();return u.onColumnMenuClick.onChange(c=>{c&&(u.columnMenuTargetRef.current=c.target,t.contextMenuVisibleFor=null,t.cellContextMenuVisibleFor=null,t.filterOperatorMenuVisibleForColumnId=null,t.columnMenuVisibleForColumnId=c.column.id)})},[]),(0,Cu.useEffect)(()=>{let{columnMenuVisibleForColumnId:u,columnMenuTargetRef:c}=e();if(u){let p=function(f){f.__insideMenu!==!0&&(s(),t.columnMenuVisibleForColumnId=null)};var d=p;return document.documentElement.addEventListener("mousedown",p),eR({columnId:u,context:o,clearAll:s,showOverlay:a}),()=>{document.documentElement.removeEventListener("mousedown",p)}}else c.current=null,s();return()=>{}},[n,r]),{menuPortal:l}}var Qh=j(require("react")),Jh=require("react");var tR={width:0,height:0,overflow:"hidden",pointerEvents:"none",outline:"none",zIndex:-1};function ey(){let{getState:o,api:e,actions:t,getComputed:n,dataSourceApi:r,dataSourceActions:i}=He(),{getDataSourceState:a,getDataSourceMasterContext:l}=eo(),{focusDetectDOMRef:s}=o(),u=(0,Jh.useCallback)(async()=>{ch({getDataSourceState:a,getDataSourceMasterContext:l,getComputed:n,actions:t,dataSourceActions:i,api:e,getState:o,dataSourceApi:r})},[]);return Qh.createElement("div",{onFocus:u,ref:s,tabIndex:0,style:tR})}var hr=require("react");function oR(){let o=He(),{getState:e,editingCell:t}=ne(r=>({getState:r.getState,editingCell:r.state.editingCell})),n=t&&!t.active?t.cancelled:void 0;(0,hr.useEffect)(()=>{if(n){let{rowIndex:r,columnId:i,initialValue:a}=e().editingCell,{onEditCancelled:l}=e();l?.({...xt({rowIndex:r,columnId:i,...o}),initialValue:a})}},[n])}function nR(){let o=He(),{getState:e,editingCell:t}=ne(r=>({getState:r.getState,editingCell:r.state.editingCell})),n=t&&!t.active&&t.accepted instanceof Error?t.accepted:void 0;(0,hr.useEffect)(()=>{if(n){let{rowIndex:r,columnId:i,value:a,initialValue:l}=e().editingCell,{onEditRejected:s}=e();s?.({...xt({rowIndex:r,columnId:i,...o}),value:a,error:n,initialValue:l})}},[n])}function rR(){let o=He(),{editingCell:e}=ne(r=>({editingCell:r.state.editingCell})),t=e?.active,n=_o(t);(0,hr.useEffect)(()=>{!t&&n&&o.api.focus()},[t,n])}function iR(){let o=He(),{editingCell:e,getState:t}=ne(r=>({editingCell:r.state.editingCell,getState:r.getState})),n=e&&!e.active&&!e.cancelled&&e.accepted===!0;(0,hr.useEffect)(()=>{if(n){let{editingCell:r}=t(),{value:i,rowIndex:a,columnId:l,initialValue:s}=r,u={...xt({rowIndex:a,columnId:l,...o}),value:i,initialValue:s};t().onEditAccepted?.(u),o.api.persistEdit({value:i})}},[n])}function aR(){let o=He(),{editingCell:e,getState:t}=ne(r=>({editingCell:r.state.editingCell,getState:r.getState})),n=e?e.persisted:void 0;(0,hr.useEffect)(()=>{if(n){let{editingCell:r,onEditPersistError:i,onEditPersistSuccess:a}=t();if(!r)return;let{rowIndex:l,columnId:s,value:u,initialValue:c}=r,d={...xt({rowIndex:l,columnId:s,...o}),value:u,initialValue:c};n instanceof Error?i?.({...d,error:n}):a?.(d)}},[n])}function ty(){oR(),nR(),iR(),aR(),rR()}var wu=require("react");var Qo=j(require("react"));var Iu=j(require("react"));var ol=o=>Iu.createElement(ke,{...o},Iu.createElement("path",{d:ze.clear[0]}));var Ru=j(require("react"));var oy=o=>Ru.createElement(ke,{...o},Ru.createElement("path",{d:ze.done[0]}));function ny(o,e,t){if(o==null)return null;let{getComputed:n,getState:r,getDataSourceState:i,actions:a,dataSourceApi:l,dataSourceActions:s,api:u}=e,{components:c,getFilterOperatorMenuItems:d}=r(),p=c?.Menu??$t,f=n().computedColumnsMap.get(o);if(!f)return null;let m=R=>{R.__insideMenu=!0},g=R=>{R.domRef.current?.parentNode?.removeEventListener("mousedown",m)},{filterTypes:y}=i(),h=y[f.computedFilterType];if(!h)return null;let b=h.operators.map(R=>{let v=R.name,P=f.computedFilterValue?f.computedFilterValue.filter.operator===v:v===h.defaultOperator,w=R.components?.Icon??kn;return{key:v,icon:Qo.createElement(w,null),label:Qo.createElement(Qo.Fragment,null,R.label??R.name),onAction:()=>{u.setColumnFilterOperator(o,v)},checked:P?Qo.createElement(oy,{size:16}):null}}),I=[...[{key:"close",label:"Close Menu",icon:null,onAction:()=>{u.hideFilterOperatorMenu()}},{key:"reset",label:"Reset",icon:Qo.createElement(ol,null),disabled:!f.computedFiltered,onAction:()=>{u.clearColumnFilter(o)}},"-"],...b],T={column:f,api:u,getState:r,getDataSourceState:i,getComputed:n,actions:a,dataSourceApi:l,dataSourceActions:s,columnFilterValue:f.computedFilterValue,filterTypes:y},C=d?d(I,T):I;return Qo.createElement(p,{autoFocus:!0,columns:[{name:"icon"},{name:"label"},{name:"checked"}],items:C,onShow:R=>{R.domRef.current?.parentNode?.addEventListener("mousedown",m)},onHide:g,onHideIntent:R=>{g(R),t?.()}})}var nl=10;function ry(){let{portalDOMRef:o}=uo(l=>({portalDOMRef:l.getMasterState().portalDOMRef}))||{},e=He(),{getState:t,actions:n}=e,{showOverlay:r,portal:i,clearAll:a}=io({portalContainer:o?.current??!1});return(0,wu.useEffect)(()=>t().onFilterOperatorMenuClick.onChange(s=>{if(!s)return;let{target:u,column:c}=s;function d(){a(),n.filterOperatorMenuVisibleForColumnId=null}let p=u?.parentElement||u,f=ve.from(p.getBoundingClientRect());f.top-=nl,f.left-=nl,f.width+=2*nl,f.height+=2*nl,r(()=>ny(c.id,e,d),{constrainTo:t().domRef.current,id:"filter-operator-menu",alignTo:f,alignPosition:[["TopLeft","BottomLeft"],["TopRight","BottomRight"]]}),n.contextMenuVisibleFor=null,n.cellContextMenuVisibleFor=null,n.columnMenuVisibleForColumnId=null,n.filterOperatorMenuVisibleForColumnId=c.id}),[]),(0,wu.useEffect)(()=>{let{filterOperatorMenuVisibleForColumnId:l}=t();if(l){let u=function(c){c.__insideMenu!==!0&&(a(),n.filterOperatorMenuVisibleForColumnId=null)};var s=u;return document.documentElement.addEventListener("mousedown",u),()=>{document.documentElement.removeEventListener("mousedown",u)}}else a();return()=>{}},[t().filterOperatorMenuVisibleForColumnId]),{menuPortal:i}}var si=require("react");var Du=j(require("react"));var vu=j(require("react"));function li(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 rl(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 Pu(o,e,t){if(!o)return null;let n=be();return o.then(r=>{let{items:i,columns:a}=li(r);i&&i.length&&n(vu.createElement(t,{...e,items:i||[],columns:a}))}),vu.createElement(Ho,{updater:n})}function iy(o,e,t){let{columnId:n,rowIndex:r,event:i}=o,{getComputed:a,getState:l}=e,{components:s,getCellContextMenuItems:u}=l(),c=s?.Menu??$t,{computedColumnsMap:d}=a(),p=d.get(n),f={...xt({...e,rowIndex:r,columnId:p.id}),event:i};if(!p||!u)return{cellContext:f,menu:null,preventDefault:!1};let m=rl({onHideIntent:t}),g=u(f,e),y=g instanceof Promise||Array.isArray(g)?!0:!!(g&&Array.isArray(g.items));if(g instanceof Promise)return{cellContext:f,menu:Pu(g,m,c),preventDefault:y};let{items:h,columns:b}=li(g);return!h||!h.length?{cellContext:f,menu:null,preventDefault:Array.isArray(h)}:{preventDefault:y,menu:Du.createElement(c,{...m,columns:b,items:h}),cellContext:f}}function ay(o,e,t){let{getState:n,getComputed:r}=e,{components:i,getContextMenuItems:a}=n(),l=i?.Menu??$t,{computedColumnsMap:s}=r(),u=o.columnId?s.get(o.columnId):void 0,c=u?{...o,...xt({...e,rowIndex:o.rowIndex,columnId:u.id})}:o;if(!a)return{cellContext:c,menu:null,preventDefault:!1};let d=rl({onHideIntent:t}),p=a(c,e),f=p instanceof Promise||Array.isArray(p)?!0:!!(p&&Array.isArray(p.items));if(p instanceof Promise)return{cellContext:c,menu:Pu(p,d,l),preventDefault:f};let{items:m,columns:g}=li(p);return!m||!m.length?{cellContext:c,menu:null,preventDefault:Array.isArray(m)}:{preventDefault:f,menu:Du.createElement(l,{...d,columns:g,items:m}),cellContext:c}}var il=5,ly=[["TopLeft","BottomLeft"],["TopRight","BottomRight"],["BottomLeft","BottomLeft"],["BottomRight","BottomRight"],["TopCenter","TopLeft"],["BottomCenter","TopLeft"],["CenterLeft","TopLeft"],["CenterRight","TopLeft"]];function sy(){let o=He(),{portalDOMRef:e}=uo(l=>({portalDOMRef:l.getMasterState().portalDOMRef}))||{},{getState:t,actions:n}=o,{showOverlay:r,portal:i,clearAll:a}=io({portalContainer:e?.current??!1});return(0,si.useEffect)(()=>{let{actions:l,getState:s,getDataSourceState:u}=o;return s().cellContextMenu.onChange(d=>{if(!d)return;let{event:p}=d;function f(){a(),l.cellContextMenuVisibleFor=null}let{menu:m,cellContext:g,preventDefault:y}=iy(d,o,f),h=ve.fromPoint({top:p.clientY,left:p.clientX});h.width+=il,h.height+=il,r(m,{constrainTo:s().domRef.current,id:"cell-context-menu",alignTo:h,alignPosition:ly}),y&&p.preventDefault(),l.cellContextMenuVisibleFor={columnId:d.columnId,rowId:d.rowId,rowIndex:d.rowIndex,colIndex:d.colIndex};let{onCellContextMenu:b}=s();b&&b({...g,getState:s,getDataSourceState:u},p)})},[]),(0,si.useEffect)(()=>{let{cellContextMenuVisibleFor:l}=t();if(l){let u=function(c){c.__insideMenu!==!0&&(a(),n.cellContextMenuVisibleFor=null)};var s=u;return document.documentElement.addEventListener("mousedown",u),()=>{document.documentElement.removeEventListener("mousedown",u)}}else a();return()=>{}},[t().cellContextMenuVisibleFor]),{menuPortal:i}}function uy(){let o=He(),{portalDOMRef:e}=uo(l=>({portalDOMRef:l.getMasterState().portalDOMRef}))||{},{getState:t,actions:n}=o,{showOverlay:r,portal:i,clearAll:a}=io({portalContainer:e?.current??!1});return(0,si.useEffect)(()=>{let{actions:l,getState:s}=o;return s().contextMenu.onChange(c=>{if(!c)return;let{event:d}=c;function p(){a(),l.contextMenuVisibleFor=null}let{menu:f,cellContext:m,preventDefault:g}=ay(c,o,p),y={top:d.clientY,left:d.clientX},h=ve.fromPoint(y);h.width+=il,h.height+=il,r(f,{constrainTo:s().domRef.current,id:"table-context-menu",alignTo:h,alignPosition:ly}),g&&d.preventDefault(),l.contextMenuVisibleFor={point:y,...c};let{onContextMenu:b}=s();b&&b({...o,...m},d)})},[]),(0,si.useEffect)(()=>{let{contextMenuVisibleFor:l}=t();if(l){let u=function(c){c.__insideMenu!==!0&&(a(),n.contextMenuVisibleFor=null)};var s=u;return document.documentElement.addEventListener("mousedown",u),()=>{document.documentElement.removeEventListener("mousedown",u)}}else a();return()=>{}},[t().contextMenuVisibleFor]),{menuPortal:i}}var cy=require("react"),dy=j(require("react"));var al=require("react");function ll(o,e){let{brain:t}=ne(r=>({brain:r.state.brain})),n=(0,al.useCallback)(o,e);(0,al.useEffect)(()=>t.onScroll(n),[t,n])}var xu="yzx0vj0";function py(o){let{width:e,maxWidth:t,minWidth:n,scrollable:r,...i}=o,a=(0,cy.useRef)(null);ll(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=ge.runtime.totalVisibleColumnsWidthValue:e==="viewport"&&(l.width=ge.runtime.bodyWidth),n==="column"?l.minWidth=ge.runtime.totalVisibleColumnsWidthValue:n==="viewport"&&(l.minWidth=ge.runtime.bodyWidth),t==="column"?l.maxWidth=ge.runtime.totalVisibleColumnsWidthValue:t==="viewport"&&(l.maxWidth=ge.runtime.bodyWidth),dy.createElement("div",{ref:a,...i,className:i.className?te(i.className,xu):xu,style:l},i.children)}var lR=Q(J.columnWidthAtIndex),sR=Q(J.columnOffsetAtIndex);function fy(){let{computedVisibleColumns:o}=ne(e=>({computedVisibleColumns:e.computed.computedVisibleColumns}));return o.map(e=>({id:e.id,width:e.computedWidth,cssVarForWidth:`var(${lR}-${e.computedVisibleIndex})`,offset:e.computedOffset,cssVarForOffset:`var(${sR}-${e.computedVisibleIndex})`,pinned:e.computedPinned}))}var sl="InfiniteTable";var my=require("react");function gy(){let{getState:o,actions:e,dataSourceActions:t,getDataSourceState:n}=ne(c=>({getState:c.getState,actions:c.actions,dataSourceActions:c.dataSourceActions,getDataSourceState:c.getDataSourceState})),{groupBy:r,isTree:i}=n(),a=o(),{brain:l,wrapRowsHorizontally:s}=a,u=a.repeatWrappedGroupRows;s||(u=!1),(0,my.useEffect)(()=>{if(!s){n().repeatWrappedGroupRows&&(t.repeatWrappedGroupRows=!1);return}let c=()=>{let{rowsPerPage:f,repeatWrappedGroupRows:m}=n(),g=!1,y=l.rowsPerPage,h=(r&&r.length>0||i)&&y>0?y:null;return f!=h&&(t.rowsPerPage=h,g=!0),m!=u&&(t.repeatWrappedGroupRows=u??!1,g=!0),g};c();let d,p=l.onVerticalRenderRangeChange(()=>{c()&&(d=setTimeout(()=>{e.forceBodyRerenderTimestamp=Date.now()}))});return()=>{d&&clearTimeout(d),p()}},[l,s,r,i,u])}var wn=require("react");function uR(){let o=[],e=t=>{Object.keys(t).forEach(n=>{let r=t[n];if(typeof r=="string"){let i=Q(r);if(i.includes("dont-override"))return;o.push(i)}else r&&typeof r=="object"&&e(r)})};return e({...ge,loaded:void 0,runtime:void 0}),o}function hy(o){if(!o)return{};let e=uR(),t=getComputedStyle(o),n={};return e.forEach(r=>{n[r]=t.getPropertyValue(r).trim()}),n}var ui=ye({defaultClassName:"_143ofgf0",variantClassNames:{active:{true:"_143ofgf1",false:"_143ofgf2"}},defaultVariants:{},compoundVariants:[]}),yy="_143ofgf5",by="_143ofgf3";var cR=Q(ge.loaded),Mu={source:"infinite-table-page",target:"infinite-table-devtools-background"};function Sy(o,e){let{type:t,debugId:n}=o;if(t==="unmount")return{...Mu,url:Eu(),type:t,payload:{debugId:n}};let r=e,i=r.getComputed(),a=r.getDataSourceState(),l=r.getState();return{...Mu,url:Eu(),type:t,payload:{debugId:n,columnVisibility:l.columnVisibility,columnOrder:i.computedColumnOrder,visibleColumnIds:i.computedVisibleColumns.map(u=>u.id),selectionMode:a.selectionMode,columns:Object.fromEntries(i.computedVisibleColumns.map(u=>[u.id,{field:u.field,dataType:u.computedDataType,sortType:u.computedSortType,filtered:u.computedFiltered,sorted:u.computedSorted,width:u.computedWidth}])),groupRenderStrategy:l.groupRenderStrategy,groupBy:a.groupBy.map(u=>u.field?`${u.field}`:"<fn>"),sortInfo:(a.sortInfo||[]).filter(u=>typeof u.field=="string").map(u=>({field:`${u.field}`,dir:u.dir,type:Array.isArray(u.type)?u.type[0]:u.type??"string"})),multiSort:a.multiSort,devToolsDetected:l.devToolsDetected,debugTimings:Object.fromEntries(a.debugTimings),debugWarnings:{...Object.fromEntries(a.debugWarnings),...Object.fromEntries(l.debugWarnings)},themeVars:hy(l.domRef.current),themeVarOverrides:{...no.get(n)||{}}}}}var Eu=ft(function(){let o=new URL(window.location.href);return o.origin+o.pathname});function dR(o){window.postMessage(o)}var pR=ft(()=>{console.log("Infinite Table DevTools detected!");let o=(e,t)=>{if(t){yt.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(Sy({type:"update",debugId:e},t))}else lg(e),window.postMessage(Sy({type:"unmount",debugId:e},null))};return window.__INFINITE_TABLE_DEVTOOLS_HOOK__=o,qe.onLogIntent("IT:*",e=>{dR({...Mu,url:Eu(),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 Ty(){let{getState:o,getDataSourceState:e,dataSourceActions:t}=ne(a=>({getState:a.getState,getDataSourceState:a.getDataSourceState,dataSourceActions:a.dataSourceActions})),n=o(),{domRef:r,debugId:i}=n;return i&&r.current&&getComputedStyle(r.current).getPropertyValue(cR)!==`${wd}`&&ni({debugId:i,key:"CSS001_CSS"}),(0,wn.useEffect)(()=>{e().debugId!==i&&(t.debugId=i)},[i]),gR()}var ul=be(),fR={revertAll:o=>{let e=yt.get(o.debugId);if(e){let t=Yo.get(o.debugId);Yo.delete(o.debugId),To.delete(o.debugId),t&&Object.keys(t).forEach(r=>{e.actions[r]=t[r],delete t[r]});let n=Io.get(o.debugId);Io.delete(o.debugId),Co.delete(o.debugId),n&&Object.keys(n).forEach(r=>{e.dataSourceActions[r]=n[r],delete n[r]})}},revertProperty:o=>{let e=yt.get(o.debugId);if(e){let t=o.property,n=To.get(o.debugId),r=Yo.get(o.debugId),i=Co.get(o.debugId),a=Io.get(o.debugId),l=t;r&&n&&n[l]!==void 0&&(delete n[l],e.actions[l]=r[l],delete r[l]);let s=t;if(a&&i&&i[s]!==void 0){let u=Io.get(o.debugId)||{};delete i[s],e.dataSourceActions[s]=u[s],delete u[s]}}},discardWarning:o=>{let e=yt.get(o.debugId);if(e){let t=o.warning,n=e.getDataSourceState().debugWarnings;if(n.get(t))n.delete(t),Xo(o.debugId);else{let i=o.warning,a=e.getState().debugWarnings;a.get(i)&&(a.delete(i),Xo(o.debugId))}}},discardAllWarnings:o=>{let e=yt.get(o.debugId);e&&(e.getDataSourceState().debugWarnings.clear(),e.getState().debugWarnings.clear(),Xo(o.debugId))},setColumnVisibility:o=>{ou(o.debugId,"columnVisibility",o.columnVisibility)},setGroupBy:o=>{Ga(o.debugId,"groupBy",o.groupBy)},setGroupRenderStrategy:o=>{ou(o.debugId,"groupRenderStrategy",o.groupRenderStrategy)},setSortInfo:o=>{Ga(o.debugId,"sortInfo",o.sortInfo)},setMultiSort:o=>{Ga(o.debugId,"multiSort",o.multiSort)},setCssVar:o=>{let e=yt.get(o.debugId),t=e?.getState().domRef.current;!e||!t||!o.name?.startsWith("--infinite-")||(t.style.setProperty(o.name,o.value),no.set(o.debugId,{...no.get(o.debugId)||{},[o.name]:o.value}),Xo(o.debugId))},revertCssVar:o=>{let e=yt.get(o.debugId),t=e?.getState().domRef.current;if(!e||!t)return;t.style.removeProperty(o.name);let n={...no.get(o.debugId)||{}};delete n[o.name],no.set(o.debugId,n),Xo(o.debugId)},revertAllCssVars:o=>{let e=yt.get(o.debugId),t=e?.getState().domRef.current;if(!e||!t)return;let n=no.get(o.debugId)||{};Object.keys(n).forEach(r=>{t.style.removeProperty(r)}),no.delete(o.debugId),Xo(o.debugId)},highlight:o=>{let e=yt.get(o.debugId);if(e){let t=e.getState().domRef.current;if(t){let n=t.getBoundingClientRect(),r=document.querySelector(`.${ui.classNames.base}`);r||(r=document.createElement("div"),r.classList.add(ui.classNames.base),r.innerHTML=[`<div class="${by}"></div>`,`<div class="${yy}"></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(ui.classNames.variants.active.true),a.removeEventListener("animationend",l)};a.addEventListener("animationend",l),r.classList.add(ui.classNames.variants.active.true)}}}}};function mR(){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__||(pR(),ul(window.__INFINITE_TABLE_DEVTOOLS_HOOK__)),typeof o.data.type=="string")){let e=o.data.type,t=fR[e];t&&t(o.data.payload)}})}mR();function gR(){let{getState:o,getComputed:e,getDataSourceState:t,dataSourceActions:n,actions:r,dataSourceApi:i,api:a}=ne(c=>({getState:c.getState,getComputed:c.getComputed,getDataSourceState:c.getDataSourceState,dataSourceActions:c.dataSourceActions,actions:c.actions,dataSourceApi:c.dataSourceApi,api:c.api})),s=o().debugId,u=(0,wn.useRef)(s);return u.current=s,(0,wn.useEffect)(()=>{let c=u.current;if(!c)return;let d=f=>{f(c,{getState:o,getDataSourceState:t,getComputed:e,dataSourceActions:n,actions:r,api:a,dataSourceApi:i})},p=ul.get();if(p){d(p);return}return ul.onChange(f=>{f&&d(f)})},[]),(0,wn.useEffect)(()=>{let c=u.current;if(!c)return;let d=ul.get();d&&d(c,{getState:o,getDataSourceState:t,getComputed:e,dataSourceActions:n,actions:r,api:a,dataSourceApi:i})}),(0,wn.useEffect)(()=>{if(s)return()=>{let c=globalThis.__INFINITE_TABLE_DEVTOOLS_HOOK__;c&&c(s,null)}},[s]),s}function Cy(){let{masterPortalDOMRef:o}=uo(n=>({masterPortalDOMRef:n.getMasterState().portalDOMRef}))??{},e=ne(n=>n.state.portalDOMRef);return o?.current??e?.current}var At=j(require("react")),My=require("react");var Iy="hs68h8j _16lm1iwk _16lm1iwx _16lm1iw2n",Ry=ye({defaultClassName:"hs68h8e _16lm1iw12 _16lm1iw1x _16lm1iw2j _16lm1iw1p",variantClassNames:{active:{true:"hs68h8f _16lm1iwn _16lm1iw1h",false:"_16lm1iwo"},draggingInProgress:{true:"hs68h8h",false:"hs68h8i"}},defaultVariants:{},compoundVariants:[]}),wy="hs68h81",vy=ye({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 vn=j(require("react"));function Py(o){return vn.createElement("div",{...o.domProps})}function Dy(o){let{active:e}=o;return vn.createElement("div",{className:wy},e?"Drop to group":"Drag columns to group")}function xy(o){let e=t=>{(t.key==="Enter"||t.key===" ")&&(t.preventDefault(),o.onClear?.())};return vn.createElement("div",{...o.domProps},o.label,vn.createElement("div",{className:wi[1]}),vn.createElement("div",{tabIndex:0,role:"button","aria-label":`Clear grouping by ${o.field}`,className:Iy,onKeyDown:e,onMouseDown:o.onClear},vn.createElement(ol,{size:20})))}var hR=(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 yR(o){let{column:e,onClear:t,components:n,field:r,id:i,toggleSorting:a}=o,{dragSourceListId:l,dragItemId:s}=fn(),u=l===yr,c=He(),d=(e?nn(e.id,c,"grouping-toolbar"):r)??i,p=e?At.createElement(qi,{forceSize:!0,size:20,direction:e.computedSortedAsc?1:e.computedSortedDesc?-1:0}):null,f=At.createElement(At.Fragment,null,d,p),m=s===i&&l===yr,g=te(Ry({draggingInProgress:u,active:m}),o.domProps?.className),y=hR(a,o.domProps?.onMouseDown),h={...o.domProps,className:g,onMouseDown:y},b=n?.ToolbarItem??xy;return At.createElement(b,{active:m,domProps:h,column:e,field:r,label:f,onClear:t})}var yr="grouping-toolbar";function Ey(o){let{groupBy:e}=Ee(S=>({groupBy:S.dataSourceState.groupBy})),{getComputed:t,dataSourceApi:n,api:r}=ne(S=>({getComputed:S.getComputed,dataSourceApi:S.dataSourceApi,api:S.api})),{dropTargetListId:i,dragSourceListId:a}=po(),{fieldsToColumn:l,computedColumnsMap:s}=t(),u=i===yr,c=a===yr,d=o.components?.Placeholder??Dy,p=o.components?.Host??Py,f=e.length?At.createElement(At.Fragment,null,e.map((S,I)=>{let T=S.field?l.get(S.field):void 0,C=`${S.field??`idx-${I}`}`;return At.createElement(Go.DraggableItem,{key:C,id:C},R=>At.createElement(yR,{id:C,components:o.components,domProps:R,field:S.field,column:T,toggleSorting:()=>{T&&r.toggleSortingForColumn(T.id)},onClear:()=>{let v=e.filter(P=>P!==S).filter(Boolean);n.setGroupBy(v)}}))})):At.createElement(d,{draggingInProgress:c,active:u,groupBy:e}),m=S=>{let I=S.map(T=>e[T]);n.setGroupBy(I)},g=S=>{let{dragItemId:I}=S,T=I,C=s.get(T);if(!C||!C.field||!C.computedGroupable)return;let R=[...e];R.splice(S.dropIndex,0,{field:C.field}),n.setGroupBy(R)},y=(0,My.useCallback)(S=>{let{computedColumnsMap:I}=t(),T=S.dragItem.id,C=I.get(T);return!(!C||!C.computedGroupable||e.some(R=>R.field===C.field))},[e]),h=o.orientation??"horizontal",{domProps:b}=o;return At.createElement(Go,{orientation:h,dragListId:yr,acceptDropsFrom:["header",yr],onDrop:m,dragStrategy:"inline",onAcceptDrop:g,shouldAcceptDrop:y},(S,{draggingInProgress:I,status:T})=>{let C=te(vy({active:u,orientation:h,draggingInProgress:I,dropRejected:T==="rejected"}),S.className,b?.className),R={...S,...b,className:C,children:f};return At.createElement(p,{active:u,rejectDrop:T==="rejected",domProps:R,orientation:h})})}var Sr=j(require("react"));var cl=require("react"),ao=require("react"),dl=j(require("react"));function Ay(o){let{dataArray:e,brain:t,computedPinnedEndColumns:n,computedPinnedStartColumns:r,computedVisibleColumns:i,computedRowHeight:a,columnSize:l,rowspan:s}=o;return ga(t,{colWidth:l,rowHeight:a,rows:e.length,cols:i.length,rowspan:s},{fixedColsEnd:n.length,fixedColsStart:r.length}),t}var wo=j(require("react"));var _y=ye({defaultClassName:"evqes20",variantClassNames:{},defaultVariants:{},compoundVariants:[]});var Au=require("react");function bR(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 SR(o,e){let{detailState:t,masterState:n,masterActions:r,cacheEntryForRow:i}=e,a=new Map(n.detailDataSourcesStateToRestore),l=zm(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 Oy(o,e){let t={current:!1};return{currentRowCache:{getRowId:()=>o,add:r=>{t.current=!0,e.add(o,r)},get:()=>e.get(o),delete:()=>(t.current=!0,e.delete(o)),has:()=>e.has(o)},cacheCalledByRowDetailRenderer:t}}function Ny(o){let{rowInfo:e,currentRowCache:t,cacheCalledByRowDetailRenderer:n,getMasterDataSourceState:r,masterActions:i,getMasterState:a}=o,l=r().detailDataSourcesStateToRestore.has(e.id)&&t.has(),u={registerDetail:ft(c=>{if(n.current||t.add({all:!0}),!t.has()){requestAnimationFrame(()=>{c.dataSourceState.destroyedRef.current||(c.dataSourceActions.stateReadyAsDetails=!0)});return}bR(e.id,{masterState:r(),detailContext:c}),requestAnimationFrame(()=>{c.dataSourceState.destroyedRef.current||(c.dataSourceActions.stateReadyAsDetails=!0)}),c.dataSourceState.onCleanup.onChange(()=>{let d=t.get();d&&SR(e.id,{detailState:c.getDataSourceState(),masterActions:i,masterState:r(),cacheEntryForRow:d})})}),shouldRestoreState:l};return u.masterRowInfo=e,u.getMasterDataSourceState=r,u.getMasterState=a,u}function Fy(o){let{rowDetailsCache:e,rowInfo:t}=o,{getDataSourceState:n,dataSourceActions:r}=Ee(u=>({getDataSourceState:u.getDataSourceState,dataSourceActions:u.dataSourceActions})),{getMasterState:i}=ne(u=>({getMasterState:u.getState})),{currentRowCache:a,cacheCalledByRowDetailRenderer:l}=(0,Au.useMemo)(()=>Oy(t.id,e),[e,t.id]),s=(0,Au.useMemo)(()=>Ny({rowInfo:t,currentRowCache:a,cacheCalledByRowDetailRenderer:l,getMasterDataSourceState:n,masterActions:r,getMasterState:i}),[t.id,a]);return s.masterRowInfo=t,s.getMasterDataSourceState=n,s.getMasterState=i,{masterDetailContextValue:s,currentRowCache:a}}function Ly(){return xo()}var{rootClassName:TR}=Le,CR=`${TR}RowDetail`;function IR(o){let{domRef:e,rowDetailRenderer:t,rowDetailHeight:n,rowInfo:r,detailOffset:i,rowDetailsCache:a}=o,{masterDetailContextValue:l,currentRowCache:s}=Fy({rowDetailsCache:a,rowInfo:r}),u=_n(),[c]=wo.useState(()=>Ly());return c.setSnapshot(l),wo.useLayoutEffect(()=>{c.notify()},[l]),wo.createElement(u.Provider,{value:c},wo.createElement("div",{ref:e,className:te(CR,_y({})),style:{position:"absolute",top:`${i}px`,left:0,width:`calc(${J.bodyWidth} - ${J.scrollbarWidthVertical})`,height:n}},t(r,s)))}var ky=wo.memo(IR);var RR=1;function zy(o){let{computed:e,bodySize:t,imperativeApi:n}=o,{actions:r,getState:i,getComputed:a,getDataSourceMasterContext:l,rowHeight:s,rowDetailHeight:u,onRowMouseEnter:c,onRowMouseLeave:d,groupRenderStrategy:p,brain:f,showZebraRows:m,rowDetailRenderer:g,isRowDetailsExpanded:y,isRowDetailsEnabled:h,cellClassName:b,cellStyle:S,rowStyle:I,rowDetailCache:T,rowClassName:C,onScrollToTop:R,onScrollToBottom:v,onScrollStop:P,scrollToBottomOffset:w,wrapRowsHorizontally:x,updatedAt:E,ready:M,editingCell:D}=ne(H=>({actions:H.actions,getState:H.getState,getComputed:H.getComputed,getDataSourceMasterContext:H.getDataSourceMasterContext,rowHeight:H.state.rowHeight,rowDetailHeight:H.state.rowDetailHeight,onRowMouseEnter:H.state.onRowMouseEnter,onRowMouseLeave:H.state.onRowMouseLeave,groupRenderStrategy:H.state.groupRenderStrategy,brain:H.state.brain,showZebraRows:H.state.showZebraRows,rowDetailRenderer:H.state.rowDetailRenderer,isRowDetailsExpanded:H.state.isRowDetailExpanded,isRowDetailsEnabled:H.state.isRowDetailEnabled,cellClassName:H.state.cellClassName,cellStyle:H.state.cellStyle,rowStyle:H.state.rowStyle,rowDetailCache:H.state.rowDetailCache,rowClassName:H.state.rowClassName,onScrollToTop:H.state.onScrollToTop,onScrollToBottom:H.state.onScrollToBottom,onScrollStop:H.state.onScrollStop,scrollToBottomOffset:H.state.scrollToBottomOffset,wrapRowsHorizontally:H.state.wrapRowsHorizontally,updatedAt:H.state.updatedAt,ready:H.state.ready,editingCell:H.state.editingCell})),{computedPinnedStartColumns:A,computedPinnedEndColumns:O,computedVisibleColumns:N,computedColumnsMap:L,computedColumnOrder:F,computedRowHeight:G,computedRowSizeCacheForDetails:B,fieldsToColumn:z,rowspan:U,toggleGroupRow:K,columnSize:q}=e,re=(0,cl.useMemo)(()=>N.map(H=>H.id),[N]),{dataArray:se,rowInfoStore:de,selectionMode:ae,cellSelection:ce,isNodeReadOnly:le,getDataSourceState:X,dataSourceApi:k,dataSourceActions:Z}=Ee(H=>({dataSourceApi:H.dataSourceApi,dataSourceActions:H.dataSourceActions,getDataSourceState:H.getDataSourceState,dataArray:H.dataSourceState.dataArray,rowInfoStore:H.dataSourceState.rowInfoStore,selectionMode:H.dataSourceState.selectionMode,cellSelection:H.dataSourceState.cellSelection,isNodeReadOnly:H.dataSourceState.isNodeReadOnly})),Y=Ne(se);Ay({columnSize:q,brain:f,computedPinnedStartColumns:A,computedPinnedEndColumns:O,computedVisibleColumns:N,computedRowHeight:G,dataArray:se,bodySize:t,rowspan:U});let $=(0,ao.useRef)(0);(0,ao.useEffect)(()=>f.onRenderCountChange(()=>{$.current=f.scrollTopMax}),[f]),(0,ao.useEffect)(()=>f.onRenderRangeChange(H=>{i().onRenderRangeChange?.(H)}),[f]),(0,ao.useEffect)(()=>f.onScrollStop(H=>{let{scrollTop:_,scrollLeft:ue}=H;if(_===0&&R?.(),_+(w??RR)>=$.current){v?.();let{livePagination:Ce,livePaginationCursor:Fe,dataArray:Oe}=X();Ce&&(Z.cursorId=Fe!==void 0?Date.now():Oe.length)}if(P){let Ce=f.getRenderRange();P({scrollTop:_,scrollLeft:ue,renderRange:Ce,viewportSize:i().bodySize,firstVisibleRowIndex:Ce.start[0],lastVisibleRowIndex:Ce.end[0],firstVisibleColIndex:Ce.start[1],lastVisibleColIndex:Ce.end[1]})}}),[f,R,v,P]),(0,ao.useEffect)(()=>{t.height&&(r.ready=!0)},[!!t.height]),(0,ao.useEffect)(()=>{let{onReady:H}=i();H&&H({api:n,dataSourceApi:k})},[M]);let ie=(0,cl.useMemo)(()=>({isNodeReadOnly:le,selectionMode:ae,cellSelection:ce}),[le,ae,ce]),fe=(0,ao.useCallback)(H=>{let{rowIndex:_,colIndex:ue,heightWithRowspan:Se,domRef:Re,hidden:Ce,width:Fe,onMouseLeave:Oe,onMouseEnter:Ye}=H,We=Y()[_],rt=N[ue];if(!We||!rt)return null;let pt=B?B.getRowHeight(_):Se,Ge=!1;!h||typeof h=="function"&&!h(We)?Ge=!1:y&&(Ge=y(We)?"expanded":"collapsed");let W=x?f.getRowIndexInPage(_):null,oe=x?f.getPageIndexForRow(_):null,he=n.isEditorVisibleForCell({rowIndex:_,columnId:rt.id});return dl.createElement(_p,{...{getData:Y,virtualized:!0,showZebraRows:m,groupRenderStrategy:p,rowIndexInHorizontalLayoutPage:W,horizontalLayoutPageIndex:oe,rowIndex:_,rowInfoStore:de,hidden:Ce,toggleGroupRow:K,rowHeight:pt,rowDetailState:Ge,onMouseEnter:Ye,onMouseLeave:Oe,onRowMouseEnter:c,onRowMouseLeave:d,domRef:Re,width:Fe,column:rt,columnsMap:L,fieldsToColumn:z,rowStyle:I,rowClassName:C,cellStyle:S,cellClassName:b,visibleColumnIds:re,computedColumnOrder:F,inEditMode:he,getDataSourceState:X,dataSourceApi:k,dataSourceActions:Z,getState:i,imperativeApi:n,componentActions:r,getComputed:a,getDataSourceMasterContext:l,dataSourceStatePartialForCell:ie}})},[s,u,c,d,B,G,y,Y,N,L,z,p,x,K,m,f,de,I,C,b,S,X,k,Z,i,n,r,a,l,re,F,E,D,ie]),pe=(0,cl.useMemo)(()=>{if(y)return H=>{let{rowIndex:_,domRef:ue}=H,Re=Y()[_];if(!Re||!y(Re)||!B)return dl.createElement("div",{ref:ue,className:vc.hidden});let{rowDetailHeight:Ce,rowHeight:Fe}=B.getSize(_);return dl.createElement(ky,{rowInfo:Re,rowDetailsCache:T,rowIndex:_,domRef:ue,detailOffset:Fe,rowDetailHeight:Ce,rowDetailRenderer:g})}},[M,fe,g,u,y,T]);return{renderCell:fe,renderDetailRow:pe}}var Vy=require("react");function Gy(){let{state:o,getState:e,actions:t}=ne(i=>({state:i.state,getState:i.getState,actions:i.actions})),{wrapRowsHorizontally:n}=o,r=_o(n);(0,Vy.useEffect)(()=>{if(r!==n){let{brain:i,headerBrain:a,renderer:l,onRenderUpdater:s}=e();i.destroy(),a.destroy(),l.destroy(),s.destroy();let u=lu(sl,!!n);t.brain=u.brain,t.headerBrain=u.headerBrain,t.renderer=u.renderer,t.onRenderUpdater=u.onRenderUpdater,t.headerRenderer=u.headerRenderer,t.headerOnRenderUpdater=u.headerOnRenderUpdater}},[r,n])}var By=j(require("react"));var Hy="_16lm1iw1 _16lm1iw1c _16lm1iwe";var Ky=te(Hy,ss);function Wy(o){return By.createElement("div",{...o,className:o.className?te(Ky,o.className):Ky})}var br=j(require("react"));var jy={visible:"qy58ya1 qy58ya0 _16lm1iw2 _16lm1iw23 _16lm1iw26 _16lm1iw2c _16lm1iw2a",hidden:"qy58ya2 qy58ya0 _16lm1iw2 _16lm1iw23 _16lm1iw26 _16lm1iw2c _16lm1iw2a"},$y="qy58ya3 _16lm1iw2 _16lm1iw23 _16lm1iw26 _16lm1iw2c _16lm1iw2a",Uy="qy58ya4";var{rootClassName:wR}=Le,_u=`${wR}-LoadMask`;function vR(o){let{visible:e,children:t="Loading"}=o;return br.createElement("div",{className:`${jy[e?"visible":"hidden"]} ${_u}`},br.createElement("div",{className:`${$y} ${_u}-Overlay`}),br.createElement("div",{className:`${Uy} ${_u}-Text`},t))}var pl=br.memo(vR);var Yy=require("react");var PR=[wp,`${Qt}--hovered`];function DR(o){return Array.isArray(o)&&(o=o.join(" ")),o.split(" ").map(e=>e.trim()).filter(Boolean)}function Pn(o){let e=He(),t=Mo(),{getComputed:n,api:r}=e,{renderer:i,onRenderUpdater:a,debugId:l,keyboardNavigation:s,activeRowIndex:u,loadingText:c,columnReorderDragColumnId:d,scrollStopDelay:p,brain:f,scrollerDOMRef:m,components:g,bodySize:y,activeCellIndex:h,rowDetailRenderer:b,showHoverRows:S,wrapRowsHorizontally:I,domProps:T,domRef:C,forceBodyRerenderTimestamp:R,rowHoverClassName:v,ready:P}=ne(z=>({ready:z.state.ready,columnReorderDragColumnId:z.state.columnReorderDragColumnId,forceBodyRerenderTimestamp:z.state.forceBodyRerenderTimestamp,renderer:z.state.renderer,onRenderUpdater:z.state.onRenderUpdater,debugId:z.state.debugId,keyboardNavigation:z.state.keyboardNavigation,activeRowIndex:z.state.activeRowIndex,loadingText:z.state.loadingText,scrollStopDelay:z.state.scrollStopDelay,brain:z.state.brain,scrollerDOMRef:z.state.scrollerDOMRef,components:z.state.components,bodySize:z.state.bodySize,activeCellIndex:z.state.activeCellIndex,rowDetailRenderer:z.state.rowDetailRenderer,showHoverRows:z.state.showHoverRows,wrapRowsHorizontally:z.state.wrapRowsHorizontally,domProps:z.state.domProps,domRef:z.state.domRef,rowHoverClassName:z.state.rowHoverClassName})),w=g?.LoadMask??pl,x=n(),{computedRowHeight:E,computedRowSizeCacheForDetails:M}=x,D=M?.getRowHeight||E,{loading:A}=Ee(z=>({loading:z.dataSourceState.loading})),O=Sr.useCallback(z=>{let U=e.getState(),K=z.target;if(!t&&z._from_row_detail)return;t&&(z._from_row_detail=!0);let q=Rd(K,au(),U.domRef.current),re,se,de,ae;q&&(se=Number(q.dataset.colIndex),ae=Number(q.dataset.rowIndex),re=e.getComputed().computedVisibleColumns[se].id,de=e.dataSourceApi.getRowInfoArray()[ae].id);let ce={columnId:re,colIndex:se,rowId:de,rowIndex:ae,event:z,target:q??z.target};q&&U.cellContextMenu(ce),U.contextMenu(ce)},[]),{renderCell:N,renderDetailRow:L}=zy({imperativeApi:r,getComputed:n,domRef:C,bodySize:y,computed:x}),{autoFocus:F,tabIndex:G}=T??{};Gy();let B=(0,Yy.useMemo)(()=>{if(!S)return;let z=[];return v&&(z=z.concat(v)),o.rowHoverClassName&&(z=z.concat(o.rowHoverClassName)),Pn.rowHoverClassName&&(z=z.concat(Pn.rowHoverClassName)),DR(z)},[S,v,o.rowHoverClassName,Pn.rowHoverClassName]);return Sr.createElement(Wy,{onContextMenu:O},Sr.createElement(_f,{forceRerenderTimestamp:R,debugId:l,tabIndex:G??0,autoFocus:F??void 0,activeRowIndex:P&&s==="row"?u:null,activeCellIndex:P&&s==="cell"&&!d?h:null,scrollStopDelay:p,renderer:i,wrapRowsHorizontally:I,onRenderUpdater:a,brain:f,activeCellRowHeight:D,renderCell:N,renderDetailRow:b?L:void 0,cellHoverClassNames:B,scrollerDOMRef:m,scrollVarHostRef:C}),Sr.createElement(w,{visible:A},c))}Pn.rowHoverClassName=PR;function qy(){return ne(o=>o.api)}function Xy(o){return ne(e=>e.api.getColumnApi(o))}var Zy=o=>`--infinite-${o}`;var Qy=40,Jy=Zy(vd);var Zt=Le.rootClassName,{ManagedComponentContextProvider:xR}=Ft({initSetupState:Tg,forwardProps:Cg,mapPropsToState:vg,cleanup:Ig,allowedControlledPropOverrides:{rowHeight:!0,columnHeaderHeight:!0},mappedCallbacks:wg(),getParentState:()=>Va(o=>o),debugName:o=>Ko(o.debugId,sl)}),eb=De.memo(function(){let e=bi(),{componentState:t,api:n,initialChildren:r}=ne(F=>({componentState:F.state,api:F.api,initialChildren:F.children})),{dataArrayLength:i,getDataSourceState:a,dataSourceActions:l,dataSourceApi:s}=Ee(F=>({dataArrayLength:F.dataSourceState.dataArray.length,getDataSourceState:F.getDataSourceState,dataSourceActions:F.dataSourceActions,dataSourceApi:F.dataSourceApi})),{domRef:u,portalDOMRef:c,onRowHeightCSSVarChange:d,onFlashingDurationCSSVarChange:p,onRowDetailHeightCSSVarChange:f,onColumnHeaderHeightCSSVarChange:m,rowHeightCSSVar:g,rowDetailHeightCSSVar:y,columnHeaderHeightCSSVar:h,scrollStopDelay:b,brain:S,activeRowIndex:I,activeCellIndex:T}=t,{licenseKey:C}=t;!C&&lo.licenseKey&&(C=lo.licenseKey),eh(I,i,n),Jg(T,i,n);let{onKeyDown:R}=bh();De.useEffect(()=>{let F=a(),G=Ot(B=>{F.notifyRenderRangeChange({renderStartIndex:B[0],renderEndIndex:B[1]})},{wait:b});return S.onVerticalRenderRangeChange(G)},[S,b]);let v=Qg(C),{autoFocus:P,tabIndex:w,...x}=t.domProps??{},E=Wd(x);De.useEffect(()=>{S.setScrollStopDelay(b),l.scrollStopDelayUpdatedByTable=b},[b]),og(),gy(),ty();let{menuPortal:M}=Zh(),{menuPortal:D}=sy(),{menuPortal:A}=uy(),{menuPortal:O}=ry();De.useEffect(()=>{typeof globalThis.__DO_NOT_USE_UNLESS_YOU_KNOW_WHAT_YOURE_DOING_IS_READY=="function"&&globalThis.__DO_NOT_USE_UNLESS_YOU_KNOW_WHAT_YOURE_DOING_IS_READY(t.id,t.ready,n,{dataSourceApi:s})},[t.ready,n,s]);let N=Ty();De.useEffect(()=>{if(e){let F=e.getSnapshot();c.current=F.getMasterState().portalDOMRef.current}},[]);let L=r??De.createElement(De.Fragment,null,De.createElement(Fs,null),De.createElement(Pn,null));return De.createElement("div",{"data-debug-id":N,onKeyDown:R,ref:u,...E},L,De.createElement("div",{ref:c,className:te(`${mt}Portal`,Pc[1e7],vi.absolute,Rc[0],Tc[0])},M,D,A,O),g?De.createElement(vr,{key:"row-height",varName:g,onChange:d}):null,De.createElement(vr,{key:"flashing-duration",allowInts:!0,varName:ge.components.Cell.flashingDuration,onChange:p}),y?De.createElement(vr,{key:"row-detail-height",varName:y,onChange:f}):null,h?De.createElement(vr,{key:"column-header-height",varName:h,onChange:m}):null,v?null:De.createElement(em,null),De.createElement(ey,null))});function MR({children:o,store:e}){let{componentActions:t,componentState:n}=Lt(),{scrollerDOMRef:r,scrollTopKey:i}=n,a=Ne(n),l=Ug({state:n,actions:t,getState:a}),s=Ne(l),u=bi(),{getDataSourceState:c,dataSourceActions:d,getDataSourceMasterContext:p,dataSourceApi:f}=eo(),[m]=De.useState(()=>eg({getComputed:s,getState:a,getDataSourceState:c,getDataSourceMasterContext:p,dataSourceApi:f,actions:t,dataSourceActions:d})),g={actions:t,state:n,computed:l,dataSourceActions:d,getDataSourceMasterContext:p,getDataSourceState:c,getComputed:s,getState:a,api:m,dataSourceApi:f,children:o};return e.setSnapshot(g),De.useLayoutEffect(()=>{e.notify()}),fi(r,y=>{let h={width:y.width,height:y.height};t.bodySize=h},{earlyAttach:!0,debounce:50}),De.useEffect(()=>{r.current&&(r.current.scrollTop=0)},[i,r]),De.createElement(eb,null)}var lo=function(o){let[e]=De.useState(()=>th()),t=_i();return De.createElement(xR,{repeatWrappedGroupRows:!!o.wrapRowsHorizontally,rowHeight:Qy,columnHeaderHeight:Jy,...o},De.createElement(Vi,null,De.createElement(t.Provider,{value:e},De.createElement(MR,{children:o.children,store:e}))))};lo.Header=Fs;lo.Body=Pn;lo.HScrollSyncContent=py;lo.Footer=()=>De.createElement(xc,null);lo.GroupingToolbar=Ey;var tb=j(require("react"));function ER(o){let{DataSource:e}=lr({nodesKey:"children",...o});return tb.createElement(e,null,o.children??null)}var ob=j(require("react"));var Ou=o=>(t,{unfilteredTreePaths:n,treeSelectionState:r,prevTreeSelectionState:i,lastUpdatedNodeInfo:a})=>{let l=new ot(i,{treePaths:n});r.forEachLeafNodePath((c,{selected:d})=>{l.setNodeSelection(c,d)}),a&&r.forEachLeafNodePath(c=>{l.setNodeSelection(c,a.selected)},a.nodePath);let u={defaultSelection:!1,selectedPaths:l.getSelectedLeafNodePaths()};o(u)};function nb(o){return ob.createElement(lo,{...o})}var fl=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=qe(`IT:${e}:DataQuery`)}};function Dn(o){if(Array.isArray(o))return o.map(Dn);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]=Dn(i))}),JSON.stringify(n)}return o instanceof Date?o.toISOString():o}var vo=class vo{constructor(e){this.queryCache=new ee;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=Dn(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 fl(`${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=Dn(e);return this.queryCache.get(t)?.getCurrentSnapshot().done??!1};this.hasQueryForKey=e=>{let t=Dn(e);return this.queryCache.has(t)};this.discardQueryForKey=e=>{let t=Dn(e);this.queryCache.delete(t)};if(this.options=e,vo.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)}vo.clients.set(e.name,this),this.name=e.name}static destroy(e){let t=vo.clients.get(e);t&&t.destroy()}static destroyAll(){vo.clients.forEach(e=>{vo.destroy(e.name)})}destroy(){vo.clients.delete(this.options.name)}};vo.clients=new Map;var Nu=vo;var AR={key:"*",when:o=>{let{activeCellIndex:e}=o.getState();if(e){let[t,n]=e,r=o.api.getColumnAtIndex(n);return r?o.api.isCellEditable({rowIndex:t,columnId:r.id}):!1}return!1},handler:(o,e)=>{let{key:t}=e;if(t!="Escape"&&t.length===1){let{activeCellIndex:n}=o.getState();if(n){let[r,i]=n,a=o.api.getColumnAtIndex(i);if(!a)return;requestAnimationFrame(()=>{o.api.startEdit({rowIndex:r,value:t,columnId:a.id})})}}}},rb={instantEdit:AR};var _R=require("react");function ib(o,e){let{set:t,delete:n,clear:r}=o;return e.set&&(o.set=(i,a)=>(t.call(o,i,a),e.set(i,a),o)),e.delete&&(o.delete=i=>{let a=n.call(o,i);return e.delete(i),a}),(e.clear||e.beforeClear)&&(o.clear=()=>{e.beforeClear&&e.beforeClear(o);let i=r.call(o);return e.clear&&e.clear(),i}),()=>{t&&(o.set=t),n&&(o.delete=n),r&&(o.clear=r)}}var gl=class gl{constructor(e,t){this.orderRefs=[];if(typeof e=="number")this.maxSize=e,this.currentSet=new Set;else if(this.maxSize=t??gl.DEFAULT_SIZE,e){let n=Array.from(e);this.maxSize<n.length&&n.slice(n.length-this.maxSize),this.currentSet=new Set,n.forEach(r=>{this.add(r)})}else this.currentSet=new Set}values(){return this.currentSet.values()}get size(){return this.currentSet.size}delete(e){return this.currentSet.has(e)?(this.currentSet.delete(e),this.orderRefs=this.orderRefs.filter(t=>t!==e),!0):!1}has(e){return this.currentSet.has(e)}add(e){if(this.currentSet.has(e))return this;if(this.maxSize-this.currentSet.size<=0){let[n]=this.orderRefs.splice(0,1);n&&this.currentSet.delete(n)}return this.orderRefs.push(e),this.currentSet.add(e),this}};gl.DEFAULT_SIZE=10;var ml=gl;var yl=class yl{constructor(e,t){this.orderRefs=[];if(typeof e=="number")this.maxSize=e,this.currentSet=new Set;else if(this.maxSize=t??yl.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}};yl.DEFAULT_SIZE=10;var hl=yl;var xn=require("react"),OR=(o,e)=>o.every((t,n)=>t===e[n]),ab=(o,e)=>{let t=(0,xn.useRef)(e),n=OR(e,t.current),r=(0,xn.useRef)(!0);t.current=e;let i=(0,xn.useRef)(["same"]),a=n?[Date.now()]:i.current;i.current=a;let l=(0,xn.useRef)(o);l.current=o,(0,xn.useEffect)(()=>{if(r.current){r.current=!1;return}return l.current()},a)};var Jo=require("react"),lb=(o,e,t)=>o.every((n,r)=>t?t(n,e[r]):n===e[r]),bl=(o,e)=>{let{same:t,different:n,compare:r}=e,i=(0,Jo.useRef)(t),a=(0,Jo.useRef)(n),l=lb(t,i.current,r),s=!lb(n,a.current,r),u=(0,Jo.useRef)(!0);i.current=t,a.current=n;let c=(0,Jo.useRef)(["same"]),d=l&&s?[Date.now()]:c.current;c.current=d;let p=(0,Jo.useRef)(o);p.current=o,l&&s&&(u.current=!1),(0,Jo.useEffect)(()=>{if(!u.current)return p.current()},d)};var _t=j(require("react"));var sb=Q(J.currentFlashingDuration),NR=({children:o})=>_t.createElement(_t.Fragment,null,o),ub=1e3,cb={up:Hi({direction:"up"}).split(" "),down:Hi({direction:"down"}).split(" "),neutral:Hi({direction:"neutral"}).split(" ")},Fu=(o={})=>{let{flashDuration:e,flashClassName:t,render:n=NR}=o;return _t.forwardRef((i,a)=>{let l=zr(),{flashingDurationCSSVarValue:s}=ne(R=>({flashingDurationCSSVarValue:R.state.flashingDurationCSSVarValue})),u=typeof s=="number"?s??e??ub:e??ub,{domRef:c,value:d,column:p,rowInfo:f,htmlElementRef:m}=l,g=f.id,y=p.id,h=_t.useRef(!0),b=_t.useRef(d),S=h.current?null:b.current;h.current=!1;let I=_t.useRef(void 0),T=_t.useRef(void 0),C=_t.useRef(void 0);return bl(()=>{if(d===b.current)return;let R=()=>{let x=m.current;if(I.current&&(clearTimeout(I.current),I.current=void 0),C.current&&(clearTimeout(C.current),C.current=void 0),T.current&&x){let E=T.current,M=cb[E];x.classList.remove(...t?[t,...M]:M),x.style.removeProperty(sb),T.current=void 0}};b.current=d;let v=m.current;if(!v)return;R();let P=typeof d=="number"?d>S?"up":"down":"neutral",w=cb[P];return v.style.setProperty(sb,`${u}`),v.classList.add(...t?[t,...w]:w),T.current=P,I.current=setTimeout(R,u),R},{same:[y,g],different:[d]}),_t.createElement("div",{ref:c,...i,className:te(i.className)},n({children:i.children,oldValue:S}))})},db=Fu();var et=j(require("react")),Tr=require("react");var pb=require("react-dom");function fb(o){let[e,t]=et.useState(null);return(0,Tr.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"?et.createElement(mb.Provider,{value:{getState:e}},et.createElement(FR,null)):null}var mb=et.createContext({getState:()=>null});function FR(){let o=et.useContext(mb),{getState:e}=o,[,t]=Ut(),n=e().renderer.cellManager;(0,Tr.useEffect)(()=>{let s=Ot(()=>{console.log("rerender"),t()},{wait:500});return n.onCellAttachmentChange(s)},[n,t]);let r=n.getRowsWithCells(),i=n.getColumnsWithCells(),a=(0,Tr.useRef)(null),l=(0,Tr.useRef)(null);return et.createElement("div",{style:{overflow:"auto"}},(0,pb.createPortal)(et.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),et.createElement("table",{style:{borderCollapse:"collapse"}},et.createElement("thead",null,et.createElement("tr",null,i.map(s=>et.createElement("th",{key:s,"data-col-index":s},s)))),et.createElement("tbody",null,r.map(s=>et.createElement("tr",{key:s,"data-row-index":s},i.map(u=>et.createElement("td",{key:u,style:{padding:5,border:"1px solid gray",background:n.getCellAt([s,u])?.getNode()?"rgba(0, 255, 0, 0.3)":"rgba(255, 0, 0, 0.3)"},"data-col-index":u},et.createElement("button",{onClick:()=>{let c=n.getCellAt([s,u])?.getElement();if(!c)return;let d=c.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(c)},style:{cursor:"pointer"}},"(",s,",",u,")"))))))))}var LR={CheckBox:fo,LoadMask:pl,MenuIcon:Kr,StringFilterEditor:Hn,NumberFilterEditor:Ni};0&&(module.exports={AutoScroller,CellSelectionState,DRAG_ITEM_ATTRIBUTE,DataClient,DataSource,DataSourceActionType,DeepMap,DragDropProvider,DragInteractionTarget,DragList,FixedSizeSet,FlashingColumnCell,GroupRowsState,INTERNAL_MatrixDebugger,InfiniteTable,InfiniteTableClassName,InfiniteTableComponent,Menu,RowDetailCache,RowDetailState,RowDisabledState,RowSelectionState,TreeDataSource,TreeExpandState,TreeGrid,TreeSelectionState,WeakFixedSizeSet,alignNode,components,createDefaultProxy,createFlashingColumnCellComponent,debounce,debug,defaultDragProxyMove,defaultFilterTypes,eventMatchesKeyboardShortcut,filterDataArray,filterTypes,flatten,getComponentStateRoot,group,interceptMap,keyboardShortcuts,multisort,multisortNested,queryKeyToCacheKey,toTreeDataArray,useComponentState,useDataSourceApi,useDataSourceInternal,useDataSourceSelector,useDataSourceState,useDragDropProvider,useDragListContext,useEffectWhen,useEffectWhenSameDeps,useEffectWithChanges,useEffectWithObject,useGridScroll,useInfiniteColumnApi,useInfiniteColumnCell,useInfiniteColumnEditor,useInfiniteColumnFilterEditor,useInfiniteHeaderCell,useInfinitePortalContainer,useInfiniteTableApi,useLayoutEffectWithChanges,useManagedDataSource,useMasterRowInfo,useOverlay,useOverlayPortal,usePrevious,useRowInfoReducers,useVisibleColumnSizes,withSelectedLeafNodesOnly});
|
|
30
30
|
//!collapsed || lazyLoad;
|