@infinite-table/infinite-react 11.0.3 → 11.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.mjs CHANGED
@@ -1,7 +1,7 @@
1
- var Qb=Object.create;var qu=Object.defineProperty;var Jb=Object.getOwnPropertyDescriptor;var eT=Object.getOwnPropertyNames;var tT=Object.getPrototypeOf,nT=Object.prototype.hasOwnProperty;var oT=(n,e)=>()=>(e||n((e={exports:{}}).exports,e),e.exports);var rT=(n,e,t,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of eT(e))!nT.call(n,r)&&r!==t&&qu(n,r,{get:()=>e[r],enumerable:!(o=Jb(e,r))||o.enumerable});return n};var oo=(n,e,t)=>(t=n!=null?Qb(tT(n)):{},rT(e||!n||!n.__esModule?qu(t,"default",{value:n,enumerable:!0}):t,n));var zn=oT((P_,op)=>{"use strict";op.exports=function(n,e,t,o,r){var i,a;if(o===void 0)o=0;else if(o=o|0,o<0||o>=n.length)throw new RangeError("invalid lower bound");if(r===void 0)r=n.length-1;else if(r=r|0,r<o||r>=n.length)throw new RangeError("invalid upper bound");for(;o<=r;)if(i=o+(r-o>>>1),a=+t(n[i],e,i,n),a<0)o=i+1;else if(a>0)r=i-1;else return i;return~o}});function Yt(n,{wait:e}){let t=null;return function(...o){let r=this;t!==null&&clearTimeout(t),t=setTimeout(()=>{n.apply(r,o)},e)}}import*as De from"react";var U=(...n)=>n.filter(e=>!!`${e}`).join(" ");import*as On from"react";import{useRef as uc}from"react";import*as iT from"react";import{useMemo as OD,useRef as aT,useEffect as lT,useLayoutEffect as sT,useCallback as FD}from"react";var ro=(n,e,t={debounce:0})=>{let o=t.debounce??0,r=window.ResizeObserver,i=o?Yt(e,{wait:o}):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=n.getBoundingClientRect();c=d.height,u=d.width}i({width:u,height:c})});return a.observe(n),()=>{a.disconnect()}};var Hr=(n,e,t={earlyAttach:!1,debounce:0})=>{let o=aT({width:0,height:0}),r=i=>{let a;return n.current&&(a=ro(n.current,l=>{l={width:Math.round(l.width),height:Math.round(l.height)};let s=o.current;(s.width!==l.width||s.height!==l.height)&&(o.current=l,i(l))},{debounce:t.debounce})),()=>{a&&a()}};lT(()=>t.earlyAttach?()=>{}:r(e),[n.current,e,t.earlyAttach,t.debounce]),sT(()=>t.earlyAttach?r(e):()=>{},[n.current,e,t.earlyAttach])};function ye(n=!1){let e=null,t=[],o=null,r=(i,a)=>{let l=[];if(n)o!=null&&(cancelAnimationFrame(o),o=null),requestAnimationFrame(()=>{e=i,o=null;for(let s=0,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 dt(n){let e=!1,t=null;return(...r)=>(e||(e=!0,t=n(...r)),t)}var Xu=(n,e)=>n-e;var Kr=(n,e)=>Xu(n.revision,e.revision),j=class n{constructor(e){this.map=new Map;this.length=0;this.revision=0;this.mutations=0;this.emptyKey=Symbol("emptyKey");this.visit=e=>{this.map.forEach((t,o)=>this.visitKey(o,this.map,[],e,!1))};this.visitSome=e=>{this.visitWithNext([],e,!0)};this.visitDepthFirst=e=>{this.visitWithNext([],e,!1)};this.visitWithNext=(e,t,o,r=this.map,i,a)=>{if(!r)return;let l=0,s=r.has(this.emptyKey),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 h=g?[]:[...e,p],S=m?()=>this.visitWithNext(h,t,o,m,i!==void 0?i-1:void 0):void 0;if(f.hasOwnProperty("value")){let y=t(f.value,h,l,S,f);if(o&&y===!0)return!0;l++}else S?.()};s&&(c(void 0,this.emptyKey),u=!1,l=0);for(let[d,p]of r){let f=c(p,d);if(o&&f===!0)return f}};this.fill(e)}get version(){return this.mutations}static clone(e){let t=new n;return e.visit((o,r)=>{t.set(r,o.value)}),t}fill(e){e&&e.forEach(t=>{let[o,r]=t;this.set(o,r)})}getValuesStartingWith(e,t){let o=[];return this.getStartingWith(e,(r,i)=>{o.push(i)},t),o}getEntriesStartingWith(e,t){let o=[];return this.getStartingWith(e,(r,i)=>{o.push([r,i])},t),o}getLeafNodesStartingWith(e,t,o){let{respectOrder:r=!1}=o||{},i=[],a=[];return this.getStartingWith(e,(l,s,u)=>{!u.map&&u.hasOwnProperty("value")&&(r?i.push(u):a.push(t(u)))},o),r?i.sort(Kr).map(t):a}getKeysForLeafNodesStartingWith(e,t){return this.getLeafNodesStartingWith(e,o=>o.keys,t)}getKeysAndValuesForLeafNodesStartingWith(e,t){return this.getLeafNodesStartingWith(e,o=>[o.keys,o.value],t)}getKeysOfFirstChildOnEachBranchStartingWith(e,t){let{excludeSelf:o,depthLimit:r,respectOrder:i=!0}=t||{},a=[],l=[],s=p=>{i?a.push(p):l.push(p.keys)},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(!o&&u.has(this.emptyKey))return[[]];return c&&c.value!==void 0&&(o||(s({...c,keys:e}),d=!0)),d?i?a.sort(Kr).map(p=>p.keys):l:(this.visitWithNext(e,(p,f,m,g,h)=>{s({...h,keys:f})},!1,u,r,o),i?a.sort(Kr).map(p=>p.keys):l)}getKeysStartingWith(e,t){let o=[];return this.getStartingWith(e,r=>{o.push(r)},t),o}getStartingWith(e,t,o){let{excludeSelf:r,depthLimit:i}=o||{},a=this.map,l,s=!1;if(e.length)for(let 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,o;if(!e.length)return this.map;for(let r=0,i=e.length;r<i;r++){let a=e[r];if(o=t.get(a),!o||!o.map)return;t=o.map}return t}getAllChildrenSizeFor(e){let t=this.map,o;if(!e.length)return this.length;for(let r=0,i=e.length;r<i;r++){let a=e[r];if(o=t.get(a),!o||!o.map)return 0;t=o.map}return o.length}getDirectChildrenSizeFor(e){let t=this.map;e.length||(e=[this.emptyKey]);for(let o=0,r=e.length;o<r;o++){let i=e[o],a=o===r-1,l=t.get(i);if(!l||!l.map)return 0;if(t=l.map,a)return t?.size??0}return 0}set(e,t){let o=this.map;this.mutations++,e.length||(e=[this.emptyKey]);for(let r=0,i=e.length;r<i;r++){let a=e[r],l=r===i-1,s=o.get(a)||{length:0};l?(s.revision=this.revision++,s.value=t,o.set(a,s),this.length++):(s.map||(s.map=new Map,o.set(a,s)),s.length++,o=s.map)}return this}get(e){let t=this.map;e.length||(e=[this.emptyKey]);for(let o=0,r=e.length;o<r;o++){let i=e[o],a=o===r-1,l=t.get(i);if(a)return l?l.value:void 0;if(!l||!l.map)return;t=l.map}}get size(){return this.length}clear(){let e=t=>{t.forEach((o,r)=>{let{map:i}=o;i&&e(i)}),t.clear()};e(this.map),this.length=0,this.revision=0,this.mutations++}delete(e){let t=this.map;this.mutations++,e.length?e=[...e]:e=[this.emptyKey];let o=[t],r=[],i=!1;for(let a=0,l=e.length;a<l;a++){let s=e[a],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,o.push(t)}}for(;o.length;){let a=o.pop(),l=e.length;if(e.pop(),l>0&&a?.size===0){let s=o[o.length-1],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 o=0,r=e.length;o<r;o++){let i=e[o],a=o===r-1,l=t.get(i);if(a)return l?l.hasOwnProperty("value"):!1;if(!l||!l.map)return!1;t=l.map}return!1}visitKey(e,t,o,r,i){let a=t.get(e);if(!a)return;let{map:l}=a,s=e===this.emptyKey?[]:[...o,e],u=dt(()=>{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((o,r)=>{let i=e({...o,keys:r});r.length===0?t.splice(0,0,i):t.push(i)}),t}rawKeysAt(e){let t=this.getMapAt(e);return t?[...t.keys()]:[]}valuesAt(e){let t=this.getMapAt(e);if(!t)return[];let o=[];return t.forEach(r=>{r.value!==void 0&&o.push(r.value)}),o}values(){return this.sortedIterator(e=>e.value)}keys(){return this.sortedIterator(t=>t.keys)}entries(){return this.sortedIterator(e=>[e.keys,e.value])}topDownEntries(){return this.getArray(e=>[e.keys,e.value])}topDownKeys(){return this.getArray(e=>e.keys)}topDownValues(){return this.getArray(e=>e.value)}sortedIterator(e){let t=[];this.visit((r,i)=>{t.push({...r,keys:i})}),t.sort(Kr);function*o(){for(let r=0,i=t.length;r<i;r++)yield e(t[r])}return o()}};globalThis.DeepMap=j;function _e(){return globalThis}var Wr=["#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"],Zu=Symbol("color"),Br=new WeakMap,Ja=ye();function el(n=Wr){Br.set(n,n.map(e=>0))}el();var uT=(n=Wr)=>{let e=[];Br.has(n)?e=Br.get(n):(e=n.map(o=>0),Br.set(n,e));let t=e.reduce((o,r,i,a)=>r<a[o]?i:o,0);return e[t]!=null&&e[t]++,n[t]??n[0]??Wr[0]},Wo=":",tl="*",Qu="-",cT=",",dT="debug",pT="diffdebug",ec=!1,Bo=new j,jo=new Map;function nl(n,e){let t=n.split(Wo),o=new j;o.set(t,!0);let r=e.split(Wo),i=new Set(r).has(tl),a=r.indexOf(tl),l=i?r.slice(0,a):r;if(o.getKeysStartingWith(l,{excludeSelf:i}).length>0){let s=r.slice(a+1);return s.length?n.endsWith(s.join(Wo)):!0}}function tc(n,e){let t=`channel=${n}_permissions=${e}`;if(jo.has(t))return jo.get(t);let o=e.split(cT);function r(l){return jo.set(t,l),l}let i=[],a=[];o.forEach(l=>{l.includes(tl)?a.push(l):i.push(l)});for(let l=0;l<i.length;l++){let s=i[l],u=s.startsWith(Qu);if(u&&(s=s.substring(Qu.length)),nl(n,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)),nl(n,s))return r(!u)}return r(!1)}var ol=()=>Xe.enable??(_e()&&_e().localStorage?.getItem(dT))??"",fT=()=>Xe.diffenable??(_e()&&_e().localStorage?.getItem(pT))??`${ec}`,rl="",nc=ec;function il(n){nc=`${fT()}`=="true",rl!==n&&(rl=n,jo.clear())}function oc(n){il(ol()),typeof _e()<"u"&&_e().addEventListener&&_e().addEventListener("storage",function(){il(ol())});function e(t,o){let r=o?`${o}${Wo}${t}`:t,i=r.split(Wo),a=Bo.get(i);if(a)return a;let l=Bo.get(i.slice(0,-1)),s=(l?l.logFn:Xe.logFn)??rc,u=s,c,d=0,p=()=>c??tc(r,rl),f=uT(Xe.colors),m=Object.defineProperties((...g)=>{let h=Ja.getListenersCount(),S;if(h>0&&(S=S??Date.now(),Ja({color:f,channel:r,args:g,timestamp:S})),p()){if(S=S??Date.now(),d&&nc){let T=S-d;u(`%c[${r}]`,`color: ${f}`,`+${T}ms:`)}d=S;let y=[],C;if(g.forEach(T=>{if(T[Zu])C===void 0&&(C=!0),y.push(...T);else{if(typeof T!="string"&&typeof T!="number"){C=!1;return}y.push(`${T}%s`)}}),C){let T=[`%c[${r}]%c %s`,`color: ${f}`,"",...y,""];u(...T)}else u(`%c[${r}]%c %s`,`color: ${f}`,"",...g)}},{channel:{value:r},color:{value:(g,...h)=>{let S=[`%c${h.join(" ")}%c%s`,`color: ${g}`,""];return S.toString=()=>h.join(" "),S[Zu]=!0,S}},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:()=>{Bo.delete(i)}}});return Bo.set(i,m),m}return e(n)}var rc=console.log.bind(console),Ju;Object.defineProperty(oc,"enable",{get:()=>Ju,set:n=>{Ju=n,il(ol())}});var Xe=oc;Xe.colors=Wr;Xe.logFn=rc;var mT=(n,e)=>Ja.onChange(t=>{if(!t)return;let{channel:o,args:r,color:i,timestamp:a}=t;nl(o,n)&&e({channel:o,color:i,args:r,timestamp:a})});Xe.onLogIntent=mT;Xe.isChannelEnabled=tc;Xe.destroyAll=()=>{el(),el(Xe.colors),Bo.clear(),jo.clear()};var Dt=n=>{let e=Xe(n?`IT:${n}:TYPE=debug`:"IT:TYPE=debug");return e.logFn=console.log.bind(console),e},pn=n=>{let e=Xe(n?`IT:${n}:TYPE=error`:"IT:TYPE=error");return e.logFn=console.error.bind(console),e},Uo=()=>Uo;Uo.extend=()=>Uo;var yt=class{constructor(e){this.debug=Uo,this.error=Uo}};var ic=pn("CSSVariableWatch"),ac=Dt("CSSVariableWatch"),lc={position:"absolute",pointerEvents:"none",width:"0px",height:"0px",lineHeight:0,fontSize:0,overflow:"hidden"};function sc(n){return n.startsWith("var(")||n.startsWith("calc(")?n:`var(${n})`}var gT=n=>{let e=uc(0),t=On.useCallback(({height:o})=>{o!=null&&o!==e.current&&(e.current=o,n.onChange(o))},[n.onChange]);Hr(n.ref,t,{earlyAttach:!0}),On.useLayoutEffect(()=>{let o=n.ref.current.getBoundingClientRect().height;if(o!=null)return e.current=o,ac(`Variable ${n.varName} found and equals ${o}.`),n.onChange(o);ic(`Specified variable ${n.varName} not found or does not have a numeric value.`)},[])},$o=n=>{let e=uc(null);gT({...n,ref:e});let t=sc(n.varName),{allowInts:o=!1}=n;return On.createElement("div",{"data-name":"css-variable-watcher","data-var":n.varName,style:lc},On.createElement("div",{ref:e,style:{height:o?`calc(1px * ${t})`:t}}))};import{useCallback as ST,useContext as ll}from"react";function fn(){let n=null,e=new Set;return{getSnapshot(){return n},setSnapshot(t){n=t},subscribe(t){return e.add(t),()=>{e.delete(t)}},notify(){for(let t of e)t()}}}import{useCallback as hT,useRef as jr,useSyncExternalStore as yT}from"react";function St(n,e,t){if(n===e)return!0;if(!n||!e)return!1;let o=typeof n;if(o!==typeof e||o!=="object")return!1;var i=Object.keys(n),a=Object.keys(e);t&&(i=i.filter(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))&&(n[u]!==e[u]||!Object.prototype.hasOwnProperty.call(e,u)))return!1}return!0}function cc(n,e,t){let o=jr(e);o.current=e;let r=jr(t);r.current=t;let i=jr(void 0),a=jr(!1),l=hT(()=>{let s=n.getSnapshot(),u=o.current(s);return a.current&&r.current(i.current,u)?i.current:(i.current=u,a.current=!0,u)},[n]);return yT(n.subscribe,l,l)}function Ur(n,e){return cc(n,e,Object.is)}function io(n,e){return cc(n,e,St)}import*as dc from"react";var al;function ao(){return al||(al=dc.createContext(null))}var pc=fn(),fc=()=>{};function $r(){let n=ao();return ll(n)||void 0}function Yr(){let n=$r();return ST(()=>n?.getSnapshot(),[n])}function qr(n){let e=ao(),t=ll(e),o=io(t||pc,t?n:fc);return t?o??void 0:void 0}function Fn(){let n=ao(),e=ll(n),o=Ur(e||pc,e?r=>r.masterRowInfo:fc);return e?o:void 0}import*as lo from"react";import{useReducer as ET,createContext as AT,useMemo as dl,useEffect as _T,useState as Ic,useRef as Rc,useLayoutEffect as OT}from"react";function mn(n){if(n==null)return!1;let e=n;return!0}import{useCallback as CT,useEffect as IT,useRef as sl}from"react";import{useCallback as bT,useState as TT}from"react";var kt=()=>{let[n,e]=TT(0);return[n,bT(()=>{e(t=>t+1)},[e])]};var mc=n=>{let e=CT(n,[]),t=sl(!1),o=sl(!1),r=sl(void 0),[i,a]=kt();t.current&&(o.current=!0),IT(()=>(t.current||(r.current=e,t.current=!0),a(),()=>{o.current&&r.current&&r.current()}),[])};import{useCallback as RT,useRef as wT}from"react";function Ne(n){let e=wT(n);return e.current=n,RT(()=>e.current,[])}import{useRef as vT,useLayoutEffect as PT}from"react";var Nn=(n,e)=>{let t=vT(e===void 0?n:e);return PT(()=>{t.current=n}),t.current};var Yo={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 DT="\u200B",ul=class n{constructor(e){this.debugId=e;this.markerDetails={label:"",track:"",trackGroup:void 0,color:void 0,details:[],tooltip:void 0};this.stopped=!1;this.start=e=>{if(this.markerDetails.startTs)return this;let t=performance.now();return this.markerDetails.details=e?.details??[],this.markerDetails.startTs=t,this};this.end=(e={})=>{if(this.stopped)return this;this.stopped=!0;let t=e.startTs??this.markerDetails.startTs,o=e.endTs??this.markerDetails.endTs??performance.now(),r=e.color||this.markerDetails.color||"primary",i=e.trackGroup||this.markerDetails.trackGroup||`Infinite Table (${this.debugId})`,a=[...this.markerDetails.details||[],...e.details||[]],l=e.tooltip||this.markerDetails.tooltip,s=e.label||this.markerDetails.label||"Unknown",u=e.track||this.markerDetails.track||"Unknown",c=DT+s;return performance.measure(c,{start:t,end:o,detail:{devtools:{dataType:"track-entry",trackGroup:i,track:u,color:r,properties:a.length>0?a.map(d=>[d.name,d.value]):void 0,tooltipText:l}}}),performance.clearMeasures(c),this};this.debugId=e}static create(e){return new n(e)}get startTimestamp(){return this.markerDetails.startTs}get track(){let e=this;return Object.keys(Yo).reduce((t,o)=>{let r={start:e.start,end:i=>e.end({...i,track:Yo[o].track,label:i.label}),get label(){let i=Yo[o];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,o,{get:()=>{let i=Yo[o];return e.markerDetails.track=i.track,r}}),t},{})}};function rt(n){return ul.create(n)}function gc(n,e){let t=new Set;function o(...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 n.apply(this,s)}return{fn:o,propertyReads:t}}var cl=n=>n&&n.substr(0,1).toUpperCase()+n.substr(1);function qo(n){return n!==void 0}function gn(n,e){let t=e[n];return qo(t)}var hc=(n,e,t)=>{let o=n[e];typeof o=="function"&&o(...t)};function xT(n,e,t){let o={};for(let r in n)if(n.hasOwnProperty(r)){let i=n[r],a=gn(r,e)?e[r]:e[`default${cl(r)}`];typeof i=="function"&&(a=i(a,t)),o[r]=a}return o}function yc(n,e,t){let{fn:o,propertyReads:r}=gc(n,{getProxyTargetFromArgs:a=>a.props,putProxyToArgs:(a,l)=>[{...l,props:a}]}),i=o(e);return r.forEach(a=>t.add(a)),i}function Sc(n){let{props:e,initialSetupState:t,propsToForward:o,parentState:r,mapPropsToState:i,propsToStateSet:a}=n,l={};o&&(l=xT(o,e,t));let s={...t,...l};if(i){let u=yc(i,{props:e,state:s,oldState:null,parentState:r},a);return{...s,...u}}return s}function bc(n,e,t){let{getProps:o,getParentState:r,mapPropsToState:i,concludeReducer:a,propsToStateSet:l}=t;if(e.type==="REPLACE_STATE")return e.payload;let s=r?.()??null,u=e.payload.mappedState,c=e.payload.updatedPropsToState,d={...n};if(u&&Object.assign(d,u),i){let f=yc(i,{props:o(),state:d,oldState:n,parentState:s},l);Object.assign(d,f)}return e.type==="ASSIGN_STATE"&&Object.assign(d,e.payload),a?a({previousState:n,state:d,updatedProps:c,parentState:s}):d}function Tc(n){let{dispatch:e,getState:t,getProps:o,propsToForward:r,allowedControlledPropOverrides:i,interceptedActions:a,mappedCallbacks:l,notify:s=hc}=n,u=t();return Object.keys(u).reduce((c,d)=>{let p=d;return Object.defineProperty(c,d,{set:m=>{let g=o(),h=t(),S=!0;if(a&&typeof a[p]=="function"&&a[p](m,{actions:c,state:h})===!1&&(S=!1),S){let T=[m],I=`on${cl(d)}Change`;if(l&&l[p]){let b=l[p](m,h);I=b.callbackName||I,T=b.callbackParams}s(g,I,T)}let y=r[p];typeof y=="function"&&(m=y(m));let C=!!i?.[p];gn(d,g)&&!C||e({payload:{updatedProps:null,mappedState:{[d]:m}}})}}),c},{})}function MT(n){let{currentProps:e,prevProps:t,state:o,propsToForward:r,propsToStateSet:i}=n,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],h=e[m];if(m!=="children"&&g!==h&&(c[m]={newValue:h,oldValue:g},d++,gn(m,e)||gn(m,t)))if(r.hasOwnProperty(f)){let S=h,y=r[f];typeof y=="function"&&(S=y(h)),o[m]!==S&&(a[m]=S,l++)}else i.has(f)&&(s[m]=e[m],u++)}),{newMappedState:a,newMappedStateCount:l,updatedPropsToState:s,updatedPropsToStateCount:u,rawUpdatedProps:c,rawUpdatedPropsCount:d}}function Cc(n){let{currentProps:e,prevProps:t,state:o,propsToForward:r,propsToStateSet:i,dispatch:a,actions:l,onPropChange:s,onPropsChange:u,beforeDispatch:c}=n,d=MT({currentProps:e,prevProps:t,state:o,propsToForward:r,propsToStateSet:i}),{newMappedState:p,newMappedStateCount:f,updatedPropsToState:m,updatedPropsToStateCount:g,rawUpdatedProps:h,rawUpdatedPropsCount:S}=d;if(g===0&&f===0)return!1;if(c?.(d),a({payload:{mappedState:f?p:null,updatedPropsToState:g?m:null}}),s){for(let y in h)if(h.hasOwnProperty(y)){let{newValue:C,oldValue:T}=h[y];s({name:y,newValue:C,oldValue:T},e,l,o)}}return u&&S&&u(h,e,l,o),!0}var pl;function wc(){return pl||(pl=AT(null))}function Et(n){let e=n.getParentState||(()=>null);function t(r){let[i]=Ic(()=>n.initSetupState?n.initSetupState(r):{}),a=Rc(new Set),l=dl(()=>n.forwardProps?n.forwardProps(i,r):{},[i]),s=e(),u=Ne(s);function c(){return Sc({props:r,initialSetupState:i,propsToForward:l,parentState:s,mapPropsToState:n.mapPropsToState,propsToStateSet:a.current})}let[d]=Ic(c),p=Ne(r),f=(w,v)=>bc(w,v,{getProps:p,getParentState:()=>u?.()??null,mapPropsToState:n.mapPropsToState,concludeReducer:n.concludeReducer,propsToStateSet:a.current}),[m,g]=ET(f,d),h=Ne(m),{allowedControlledPropOverrides:S}=n,y=dl(()=>Tc({dispatch:g,getState:h,getProps:p,propsToForward:l,allowedControlledPropOverrides:S,interceptedActions:n.interceptActions,mappedCallbacks:n.mappedCallbacks}),[g,l,S]),C=n.Context??wc(),T=dl(()=>({componentState:m,componentActions:y,getComponentState:h,replaceState:w=>{g({type:"REPLACE_STATE",payload:w})},assignState:w=>{g({type:"ASSIGN_STATE",payload:w})}}),[m,y,h]),I=Nn(r),b=Rc(!1);b.current=!1;let R=n.layoutEffect?OT:_T;return R(()=>{let w=r;Cc({currentProps:w,prevProps:I,state:m,propsToForward:l,propsToStateSet:a.current,dispatch:g,actions:y,onPropChange:n.onPropChange,onPropsChange:n.onPropsChange,beforeDispatch:({newMappedState:P,newMappedStateCount:x,updatedPropsToState:M,updatedPropsToStateCount:D})=>{let E=m.debugId,z=E?rt(E).track.ComponentState.label.PropUpdate.start():void 0,V=n.debugName?typeof n.debugName=="function"?`${n.debugName(w)}:rerender`:`${n.debugName}:rerender`:"rerender";Dt(V)("Triggered by new values for the following props",...Object.keys(P??{}),...Object.keys(M??{})),z&&z.end({label:V,details:[x>0?{name:"Updated properties",value:Object.keys(P).join(", ")}:void 0,D>0?{name:"Updated props",value:Object.keys(M).join(", ")}:void 0,D>0||M?{name:"Details",value:"The time for this marker is not accurate. The marker is only displayed so you can easily identify the props that triggered the rerender."}:void 0].filter(mn)})}})&&(b.current=!0)}),R(()=>{s!=null&&!b.current&&g({type:"PARENT_STATE_CHANGE",payload:{}})},[s]),mc(()=>()=>{n.cleanup?.(h())}),{contextValue:T,ContextComponent:C}}return{ManagedComponentContextProvider:lo.memo(function(i){let{contextValue:a,ContextComponent:l}=t(i);return lo.createElement(l.Provider,{value:a},i.children)}),useManagedComponent:t}}function At(n){return n=n??wc(),lo.useContext(n)}import*as kc from"react";var pt="Infinite",Le={rootClassName:pt};var Xr=()=>Le;var vc="_16lm1iw2 _16lm1iw23 _16lm1iw26 _16lm1iw2c _16lm1iw2a",Pc={center:"_16lm1iw2j",stretch:"_16lm1iw2k",start:"_16lm1iw2l",end:"_16lm1iw2m"};var _t="_16lm1iw3b _16lm1iw3c _16lm1iw35",Dc={pointer:"_16lm1iwk",default:"_16lm1iwl",colResize:"_16lm1iwm",grabbing:"_16lm1iwn",grab:"_16lm1iwo"},so={flex:"_16lm1iw1p",contents:"_16lm1iw1q",none:"_16lm1iw1r",block:"_16lm1iw1s",grid:"_16lm1iw1t",inlineBlock:"_16lm1iw1u",inlineFlex:"_16lm1iw1v",inlineGrid:"_16lm1iw1w"};var Zr={1:"_16lm1iw1c",none:"_16lm1iw1d"},Xo={column:"_16lm1iw2f",columnReverse:"_16lm1iw2g",row:"_16lm1iw2h",rowReverse:"_16lm1iw2i"};var xc={0:"_16lm1iw1y","100%":"_16lm1iw1z","50%":"_16lm1iw20"},Mc={center:"_16lm1iw30",spaceBetween:"_16lm1iw31",spaceAround:"_16lm1iw32",start:"_16lm1iw33",end:"_16lm1iw34"},Ec={0:"_16lm1iw26","100%":"_16lm1iw27","50%":"_16lm1iw28",auto:"_16lm1iw29"};var Ac={none:"_16lm1iwd"},_c={hidden:"_16lm1iw35",auto:"_16lm1iw36",visible:"_16lm1iw37"};var Qr={relative:"_16lm1iw1",absolute:"_16lm1iw2",static:"_16lm1iw3",sticky:"_16lm1iw4",fixed:"_16lm1iw5"};var Oc={0:"_16lm1iw23","100%":"_16lm1iw24","50%":"_16lm1iw25"};var Fc={none:"_16lm1iw1x"};var Nc={visible:"_16lm1iw38",hidden:"_16lm1iw39"};var Lc={1:"_16lm1iw1e",10:"_16lm1iw1f",100:"_16lm1iw1g",1e3:"_16lm1iw1h",1e4:"_16lm1iw1i",1e5:"_16lm1iw1j",1e6:"_16lm1iw1k",1e7:"_16lm1iw1l","1k":"_16lm1iw1m","10k":"_16lm1iw1n","100k":"_16lm1iw1o"};function zc(n){let{rootClassName:e}=Xr();return kc.createElement("div",{...n,className:U(`${e}Footer`,Qr.relative,so.flex,Xo.row,n.className)})}import*as Ee from"react";import{useCallback as Um,useContext as TR,useEffect as CR,useRef as IR}from"react";import{createPortal as RR}from"react-dom";function Jr(n){let e={};return Object.keys(n).forEach(t=>{e[t]=t}),e}function $(n){return n.slice(4,-1)}import*as Hc from"react";var uo={expandCollapse:"_1jm33zv0",loading:"_1jm33zv1",done:"_1jm33zv2",clear:"_1jm33zv3",hidden:"_1jm33zv4",filterOperatorContains:"_1jm33zv5",filterOperatorStartsWith:"_1jm33zv6",filterOperatorEndsWith:"_1jm33zv7",filterOperatorEq:"_1jm33zv8",filterOperatorNeq:"_1jm33zv9",filterOperatorGt:"_1jm33zva",filterOperatorGte:"_1jm33zvb",filterOperatorLt:"_1jm33zvc",filterOperatorLte:"_1jm33zvd"},Vc="_1jm33zvf";var Gc={expandCollapse:"expand-collapse",loading:"loading",done:"done",clear:"clear",hidden:"hidden",filterOperatorContains:"filter-operator-contains",filterOperatorStartsWith:"filter-operator-starts-with",filterOperatorEndsWith:"filter-operator-ends-with",filterOperatorEq:"filter-operator-eq",filterOperatorNeq:"filter-operator-neq",filterOperatorGt:"filter-operator-gt",filterOperatorGte:"filter-operator-gte",filterOperatorLt:"filter-operator-lt",filterOperatorLte:"filter-operator-lte"};var it="InfiniteIcon";var ke=n=>{let{icon:e,...t}=n,o=n.size??"var(--infinite-icon-size)",r={flex:"none",width:o,height:o,fill:"currentColor",...n.style};return Hc.createElement("svg",{viewBox:"0 0 24 24",...t,className:e?U(n.className,uo[e],it,`${it}-${Gc[e]}`):n.className,style:r},n.children)};import*as fl from"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 Kc=n=>fl.createElement(ke,{...n,icon:"filterOperatorContains"},ze.includesOperator.map(e=>fl.createElement("path",{key:e,d:e})));import*as ml from"react";var Bc=n=>ml.createElement(ke,{...n,icon:"filterOperatorEndsWith"},ml.createElement("path",{d:ze.endsWithOperator[0]}));import*as gl from"react";var Wc=n=>gl.createElement(ke,{...n,icon:"filterOperatorEq"},gl.createElement("path",{d:ze.eqOperator[0]}));import*as hl from"react";var jc=n=>hl.createElement(ke,{...n,icon:"filterOperatorGte"},hl.createElement("path",{d:ze.gteOperator[0]}));import*as yl from"react";var Uc=n=>yl.createElement(ke,{...n,icon:"filterOperatorGt"},yl.createElement("path",{d:ze.gtOperator[0]}));import*as Sl from"react";var $c=n=>Sl.createElement(ke,{...n,icon:"filterOperatorLte"},Sl.createElement("path",{d:ze.lteOperator[0]}));import*as bl from"react";var Yc=n=>bl.createElement(ke,{...n,icon:"filterOperatorLt"},bl.createElement("path",{d:ze.ltOperator[0]}));import*as Tl from"react";var qc=n=>Tl.createElement(ke,{...n,icon:"filterOperatorNeq"},Tl.createElement("path",{d:ze.neqOperator[0]}));import*as Cl from"react";var Xc=n=>Cl.createElement(ke,{...n,icon:"filterOperatorStartsWith"},Cl.createElement("path",{d:ze.startsWithOperator[0]}));import*as _l from"react";import*as lt from"react";import{useEffect as _d,useState as Al}from"react";import*as co from"react";import{useEffect as zT,useLayoutEffect as VT,useState as bd}from"react";function FT(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var o=t.call(n,e||"default");if(typeof o!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function NT(n){var e=FT(n,"string");return typeof e=="symbol"?e:String(e)}function LT(n,e,t){return e=NT(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Zc(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);e&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,o)}return t}function Qc(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Zc(Object(t),!0).forEach(function(o){LT(n,o,t[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Zc(Object(t)).forEach(function(o){Object.defineProperty(n,o,Object.getOwnPropertyDescriptor(t,o))})}return n}function Jc(n,e){var t={};for(var o in n)t[o]=e(n[o],o);return t}var kT=(n,e,t)=>{for(var o of Object.keys(n)){var r;if(n[o]!==((r=e[o])!==null&&r!==void 0?r:t[o]))return!1}return!0},ge=n=>{var e=t=>{var o=n.defaultClassName,r=Qc(Qc({},n.defaultVariants),t);for(var i in r){var a,l=(a=r[i])!==null&&a!==void 0?a:n.defaultVariants[i];if(l!=null){var s=l;typeof s=="boolean"&&(s=s===!0?"true":"false");var u=n.variantClassNames[i][s];u&&(o+=" "+u)}}for(var[c,d]of n.compoundVariants)kT(c,r,n.defaultVariants)&&(o+=" "+d);return o};return e.variants=()=>Object.keys(n.variantClassNames),e.classNames={get base(){return n.defaultClassName.split(" ")[0]},get variants(){return Jc(n.variantClassNames,t=>Jc(t,o=>o.split(" ")[0]))}},e};var ed="_1eexc2a6";var td=ge({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:[]}),nd="_12zfob1q _16lm1iw2 _16lm1iw1k _16lm1iw3b _16lm1iw3c _16lm1iw35",od=ge({defaultClassName:"_16lm1iw2 _16lm1iw25 _16lm1iw26 _16lm1iwh _16lm1iwf",variantClassNames:{visible:{true:"_12zfob19",false:"_12zfob1a"}},defaultVariants:{},compoundVariants:[]}),rd=ge({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"]]}),id=ge({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"]]}),ad="_12zfob12u _16lm1iw22 _16lm1iw1z";var ld="_12zfob17",sd="_12zfob12q _16lm1iw1p _16lm1iw2h _16lm1iw2j _16lm1iw1",ud=ge({defaultClassName:"_12zfob12r _16lm1iw1 _16lm1iw23",variantClassNames:{disabled:{true:"_12zfob12s",false:"_12zfob12t"}},defaultVariants:{},compoundVariants:[]}),Il=ge({defaultClassName:"_12zfob12n _16lm1iw1p _16lm1iw2h _16lm1iw2k _16lm1iw1",variantClassNames:{active:{true:"_12zfob12o",false:"_12zfob12p"}},defaultVariants:{},compoundVariants:[]}),cd="_12zfob12m _16lm1iw1p _16lm1iw2h _16lm1iw2j",dd=ge({defaultClassName:"_12zfob127 _16lm1iw1 _16lm1iw39",variantClassNames:{menuVisible:{true:"_12zfob128"},reserveSpaceWhenHidden:{true:"_12zfob129",false:"_12zfob12a"}},defaultVariants:{},compoundVariants:[[{menuVisible:!0,reserveSpaceWhenHidden:!1},"_12zfob12b"]]}),pd="_12zfob1b _16lm1iw2",fd="_16lm1iw1",md="_12zfob16",gd=ge({defaultClassName:"_12zfob12",variantClassNames:{align:{start:"_12zfob13",center:"_12zfob14",end:"_12zfob15"}},defaultVariants:{},compoundVariants:[]}),hd="_12zfob12l _16lm1iw35 _16lm1iw1 _16lm1iw1p _16lm1iw2h";var yd="_1nnkya20 _16lm1iw1p _16lm1iw2f _16lm1iw1 _16lm1iw32 _16lm1iw2j",ei="_1nnkya21";var Sd={transition:"width 0.25s, opacity 0.25s"},OE=Object.keys({size:1,lineWidth:1,lineStyle:1,style:1,className:1,index:1});function po(n){let[e,t]=bd(!0),[o,r]=bd(0),{lineWidth:i=1,style:a,className:l,index:s}=n,u=s!=null&&s>0,c=n.size??16,d=Math.floor(c/4),p=[c-1*d,c-2*d,c-3*d],f={...Sd,borderTop:`${i}px solid currentColor`,...n.lineStyle,opacity:o};if(zT(()=>{if(!e)return;let g=requestAnimationFrame(()=>{r(1)});return()=>{cancelAnimationFrame(g)}},[e]),VT(()=>{t(!0)},[]),!e)return null;let m={};return co.createElement("div",{"data-name":"filter-icon",style:{...a,width:c},className:U(l,it,yd,`${it}-filter`)},u?co.createElement("div",{"data-name":"index",style:m,className:ld},s):null,co.createElement("div",{className:ei,style:{width:p[0],...f}}),co.createElement("div",{className:ei,style:{width:p[1],...f}}),co.createElement("div",{className:ei,style:{width:p[2],...f}}))}var ti=Object.freeze({}),GT={string:ti,number:{}};function fo(n,e){let t=e.default||ti;return n.type===void 0?t:n.type===null?ti:typeof n.type=="string"?e[n.type]||GT[n.type]||ti:n.type.reduce((o,r)=>Object.assign(o,e[r]),{})}var wl=n=>{let{availableSize:e,items:t,minSize:o,maxSize:r}=n;if(e<0)throw"The provided availableSize cannot be negative!";let i=0,a=0,l=0,s=[],u=[];t.forEach((R,w)=>{let v=R.maxSize??r??void 0,P=R.minSize??o??void 0;s.push(P),u.push(v),R.size!=null&&(v!=null&&R.size>v&&(R.size=v),P!=null&&R.size<P&&(R.size=P));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 ${w} doesn't have either of those.`;x!=null&&(l+=1),a+=x??0,i+=R.size??0});let c=n.computeSpecialSpaceDistribution?Math.max(e,0):Math.max(e-i,0),d=c/a,p={},f={},m=0;t.forEach((R,w)=>{if(R.flex!=null){let v=d*R.flex,P=R.maxSize??r??void 0,x=R.minSize??o??void 0,M=!1,D=0;P!=null&&v>P&&(p[w]=!0,M=!0,D=P),x!=null&&v<x&&(f[w]=!0,M=!0,D=x),M&&(m+=1,l-=1,a-=R.flex,c-=D)}}),m&&(d=c/a);let g=[],h=0,S=c,y=a,C=0,T=0,I=[];return{items:t.map((R,w)=>{let v={...R},P=R.maxSize??r??void 0,x=R.minSize??o??void 0,M=0,D=p[w],E=f[w],z=D||E,V=R.size??0;if(R.flex!=null){if(z)E&&(M=x),D&&(M=P);else{h+=1;let N=L=>(P!=null&&L>P&&(L=P),x!=null&&L<x&&(L=x),L);h===l?M=N(S):(M=N(Math.round(R.flex*d)),T+=M,S=c-T,y-=R.flex,d=S/y)}V=M,v.flexSize=M}return g.push(M),I.push(V),v.computedSize=V,C+=V,v}),flexSizes:g,minSizes:s,maxSizes:u,computedSizes:I,remainingSize:Math.round(e-C)}};function ni(n,e,t,o){return e!=null&&n<=e?{value:e,clamped:"min",diff:(n-e)*o}:t!=null&&n>=t?{value:t,clamped:"max",diff:(t-n)*o}:{value:n,clamped:!1,diff:0}}function Cd(n,e,t){let o=!1,r=0;for(let i of n)i.computedFlex&&(o=!0),r+=i.computedWidth;return o&&Math.round(r)>Math.round(e-t)}function Rl(n,e){return n.computedFlex&&!e?"flex":"width"}function Zo(n,e,t){if(e==="width"){let{flex:o,...r}=n??{};return{...r,width:t}}return{...n,flex:t}}var vl=n=>{let{availableSize:e,reservedWidth:t=0}=n,o=Object.keys(n.columnSizing).reduce((x,M)=>(x[M]={...n.columnSizing[M]},x),{});if(e<0)throw"The provided availableSize cannot be negative!";let r=n.dragHandleOffset,i=n.dragHandlePositionAfter,a=n.dragHandlePositionAfter+1,l=n.items[i],s=n.items[a],u=l.id,c=s?.id,d=Cd(n.items,e,t),p=l.computedWidth,f=l.computedMinWidth,m=l.computedMaxWidth,g=Rl(l,d),h=s?.computedWidth,S=s?.computedMinWidth,y=s?.computedMaxWidth,C=s?Rl(s,d):"width",T=!1,I=!1,b=r>0?1:-1,{value:R,clamped:w,diff:v}=ni(Math.round(p+r),f,m,b);if(n.shareSpaceOnResize){if(s==null)return o[u]=Zo(o[u],g,R),I=w==="min",T=w==="max",{adjustedDiff:R-p,reservedWidth:t,columnSizing:o,minReached:I,maxReached:T,constrained:I||T};let{value:x,clamped:M,diff:D}=ni(Math.round(h-r),S,y,b);if(w&&M&&(Math.abs(v)>Math.abs(D)?M=!1:w=!1),!(!w&&!M)){if(w){let E=ni(Math.round(h-r-v),S,y,b);x=E.value,M=E.clamped,D=E.diff}else if(M){let E=ni(Math.round(p+r+D),f,m,b);R=E.value,w=E.clamped,v=E.diff}}o[u]=Zo(o[u],g,R),o[c]=Zo(o[c],C,x),I=w==="min"||M==="min",T=w==="max"||M==="max"}else o[u]=Zo(o[u],g,R),I=w==="min",T=w==="max";let P=R-p;return{adjustedDiff:P,reservedWidth:n.shareSpaceOnResize?t:Math.round(t-P),columnSizing:o,minReached:I,maxReached:T,constrained:I||T}};function Td(n,e){return n+e}function HT(n){return Object.keys(n).reduce((t,o)=>(t[o]={...n[o]},t),{})}var Id=n=>{let{availableSize:e,reservedWidth:t=0}=n,o=Object.keys(n.columnSizing).reduce((y,C)=>(y[C]={...n.columnSizing[C]},y),{});if(e<0)throw"The provided availableSize cannot be negative!";let r=n.dragHandleOffset,i=[...new Array(n.columnGroupSize)].map((y,C)=>n.dragHandlePositionAfter-C).reverse(),a=i.map(y=>n.items[y]),l=a.map(y=>y.computedWidth),s=Cd(n.items,e,t),u=a.map(y=>Rl(y,s)),c=0,{computedSizes:d}=wl({items:a.map(y=>(y.resizable===!1&&(c+=y.computedWidth),{maxSize:y.computedMaxWidth,minSize:y.computedMinWidth,flex:y.resizable?y.computedWidth:null,size:0})),computeSpecialSpaceDistribution:!0,availableSize:Math.max(l.reduce(Td,0)+r-c,0)}),p=a.map((y,C)=>d[C]-y.computedWidth),f=!0,m=!0,g=!0,h=[];p.forEach((y,C)=>{let T=a[C];if(!T.resizable){h.push(0);return}let I=u[C],b=l[C],R=HT(o),{maxReached:w,minReached:v,constrained:P,adjustedDiff:x}=vl({availableSize:n.availableSize,reservedWidth:n.reservedWidth,dragHandleOffset:y,dragHandlePositionAfter:i[C],shareSpaceOnResize:!1,items:n.items,columnSizing:R});o[T.id]=Zo(R[T.id],I,Math.round(b+x)),h.push(x),w||(m=!1),v||(f=!1),P||(g=!1)});let S=h.reduce(Td,0);return{minReached:f,maxReached:m,constrained:g,adjustedDiffs:h,adjustedDiff:S,columnSizing:o,reservedWidth:Math.round(t-S)}};var oi;function zt(){if(oi!=null)return oi;let n=_e().document??null;if(!n)return 0;let e=n.createElement("div");e.style.visibility="hidden",e.style.overflow="scroll",n.body.appendChild(e);let t=n.createElement("div");return e.appendChild(t),oi=e.offsetWidth-t.offsetWidth,e.parentNode?.removeChild(e),oi}var Rd=["start",void 0,"end"],wd=(n,e)=>(e&&Object.keys(e).length>0&&n.sort((t,o)=>{let r=e[t],i=e[o];return r===!0&&(r="start"),i===!0&&(i="start"),r==i?0:Rd.indexOf(r)-Rd.indexOf(i)}),n);function vd(n,e,...t){let o=e;return t.forEach(r=>{for(let i in r)r.hasOwnProperty(i)&&n(r[i],i)&&(o[i]=r[i])}),o}function Pl(n,...e){return vd(t=>t!=null,n,...e)}function Pd(n,e,...t){return vd((o,r)=>!(r in n),e,...t)}var ri=!0,KT=!0,BT=!0,Dd="string",qt="unknown";var WT=pn("getComputedVisibleColumns"),jT=(n,e,t)=>n[t]!==!1,Dl=(n,e)=>{if(!e)return!1;let t=e[n];return t==="start"||t===!0?"start":t==="end"?"end":!1};function Ln(n,e){if(n)return n[e]?n[e]:Object.values(n).find(t=>t.field===e)}function UT(n,e){let t=fo(n,e);return n.sortType?n.sortType:t.sortType?t.sortType:typeof n.type=="string"?n.type:Dd}function $T(n,e,t){let r=(Array.isArray(n)?n:n?[n]:[]).flatMap(i=>{let a=i.field??i.groupField;if(!a)return[qt];let l=Ln(e,a);if(!l)return[qt];let s=UT(l,t);return Array.isArray(s)?s:[s]});return r.every(i=>i===qt)?qt:r.length===1?r[0]:r}function xl(n,e){let{colType:t,sortable:o,columnDefaultSortable:r}=e,i=n.defaultSortable??t.defaultSortable,a=!!n.groupByForColumn;if(i==null&&!a){let l=n.field??t.field,s=n.valueGetter??t.valueGetter;l==null&&s==null&&(i=!1)}return o??i??r??ri}var xd=({columns:n,userColumns:e,bodySize:t,columnMinWidth:o,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:h=kn,viewportReservedWidth:S,resizableColumns:y,draggableColumns:C,columnDefaultDraggable:T,columnOrder:I,columnPinning:b,editable:R,columnDefaultEditable:w,columnDefaultFilterable:v,columnDefaultGroupable:P,columnDefaultSortable:x,columnSizing:M,columnTypes:D,columnVisibility:E,columnVisibilityAssumeVisible:z,groupBy:V})=>{let N=0,L={};V.forEach((G,J)=>{G.field&&(L[G.field]=J)});let F=(p||[]).reduce((G,J)=>{let{id:me,field:be}=J;return be&&(G[be]=J),me&&(G[me]=J),G},{}),K=wd(I===!0?Object.keys(n):I,b),q=K.filter(G=>n[G]?jT(E,z,G):(WT(`Column with id "${G}" specified in columnOrder array cannot be found in the columns map.`),!1)),_=new Map,k=q.map((G,J)=>{let me=n[G];return _.set(G,J),me}),H=(m??[]).reduce((G,J,me)=>(J.id?G[J.id]={sortInfo:J,index:me}:J.field&&(G[J.field]={sortInfo:J,index:me}),G),{});function Z(G){let J=n[G],me=fo(J,D),be={minWidth:me?.minWidth,maxWidth:me?.maxWidth,width:me?.defaultWidth,flex:me?.defaultFlex},at={width:J?.defaultWidth,flex:J?.defaultFlex,minWidth:J?.minWidth,maxWidth:J?.maxWidth},oe=M[G];oe?.width!=null&&oe.flex==null&&delete at.flex,oe?.flex!=null&&oe.width==null&&delete at.width;let W=Pl(at,oe);W.width!=null&&delete be.flex,W.flex!=null&&delete be.width,W=Pl(be,W);let ot=W.flex??void 0,ie=W.minWidth??J?.minWidth??o,Me=W.maxWidth??J?.maxWidth??r,Ye=ot!=null?void 0:W.width??(a?void 0:i);return!Ye&&ot==null&&(a?ot=a:Ye=ie),{size:Ye,flex:ot,minSize:ie,maxSize:Me}}let Ce=wl({availableSize:Math.max(t.width-(S??0)-(l??zt()),0),maxSize:r,minSize:o,items:q.map(Z)}),{computedSizes:le,flexSizes:fe,minSizes:we,maxSizes:ve}=Ce,ue=[],ne=[],se=[],de=[];de.length=q.length;let X=new Map,Q=new Map,B=0,re=0,te=0,ae=null,O=[],A=0,ce=0,he=0;k.forEach((G,J)=>{let me=q[J],be=le[J],at=O[J]=Dl(me,b);at==="start"?A+=be:at==="end"?he+=be:ce+=be});let Re=t.width-he,Se=[],xe=new Map;q.forEach((G,J)=>{let me=k[J];xe.set(G,me)});let Ue=[];Object.keys(n).forEach(G=>{let J=n[G];Ue.push(G),xe.has(G)||xe.set(G,J)});let Ke=new Map;xe.forEach((G,J)=>{let me=_.get(J);me==null&&(me=-1);let be=me!=-1,at=q[me+1],oe=fo(G,D),W=me,ot=H[J]?H[J]:G.field?H[G.field]??null:null,ie=ot?.sortInfo??null,Me=!!ie,Ye=Me&&ie.dir===1,ht=Me&&!Ye,Ku=ot?.index??-1,qa=be?{}:Z(J),Bu=be?le[me]:qa.size||0,kb=be&&fe[me]||null,zb=be?we[me]||0:qa.minSize||0,Vb=be?ve[me]||1e4:qa.maxSize||1e4,It=be?Dl(J,b):!1,Wu=be?me===q.length-1:!1,Vr=W,Gb=be?It==="start"?re:It==="end"?te:N-re:0;It=="start"?Vr=be?W:-1:It==="end"?Vr=be?W-(ue.length+se.length):-1:Vr=be?W-ue.length:-1;let Hb=be?It==="start"||It===!1?N:Re+te:-1,Kb=be?It!==ae:!1,Bb=be?Wu||It!==Dl(at,b):!1,ju=G.cssEllipsis??oe.cssEllipsis??s,Wb=G.headerCssEllipsis??oe.cssEllipsis??G.cssEllipsis??oe.headerCssEllipsis??u??ju,Gr=be&&(F[J]||G.field||G.groupByForColumn)&&(F[J]||F[G.field||G.groupByForColumn])||null,jb=G.defaultFilterable??oe.defaultFilterable??v??!0,Ub=R??G.defaultEditable??oe.defaultEditable??w??!1,Xa=G.dataType||oe.dataType||(Array.isArray(G.type)?G.type[0]:G.type)||Dd,$b=G.sortType||oe.sortType||Xa,Uu=G.filterType||oe.filterType||Xa,$u=!1;if(Gr!=null&&!Gr.disabled){let Qa=h[Uu];Qa&&(!Qa.emptyValues||!Qa.emptyValues.includes(Gr.filter.value))&&($u=!0)}let no=G.field??oe.field,Yb=G.valueGetter??oe.valueGetter,Za=G.defaultGroupable??oe.defaultGroupable??P??!!no;no||(Za=!1),G.groupByForColumn&&(Za=!1);let Yu=no?L[no]!==void 0:!1,qb=Yu?L[no]:void 0,Xb=xl(G,{colType:oe,sortable:f,columnDefaultSortable:x}),Zb=G.resizable??oe.resizable??y??KT,qe={colType:oe,align:oe.align,headerAlign:oe.headerAlign,computedVisible:be,verticalAlign:oe.verticalAlign,defaultHiddenWhenGroupedBy:oe.defaultHiddenWhenGroupedBy,valueGetter:Yb,valueFormatter:oe.valueFormatter,renderValue:oe.renderValue,render:oe.render,style:oe.style,className:oe.className,contentFocusable:oe.contentFocusable,renderMenuIcon:oe.renderMenuIcon,renderSortIcon:oe.renderSortIcon,renderRowDetailIcon:oe.renderRowDetailIcon,renderSelectionCheckBox:oe.renderSelectionCheckBox,renderHeaderSelectionCheckBox:oe.renderHeaderSelectionCheckBox,headerStyle:oe.headerStyle,headerClassName:oe.headerClassName,columnGroup:oe.columnGroup,getValueToEdit:oe.getValueToEdit,getValueToPersist:oe.getValueToPersist,shouldAcceptEdit:oe.shouldAcceptEdit,field:no,...G,components:{...oe.components,...G.components},computedResizable:Zb,computedMinWidth:zb,computedMaxWidth:Vb,computedFlex:kb,computedDataType:Xa,computedEditable:Ub,computedSortType:$b,computedFilterType:Uu,cssEllipsis:ju,headerCssEllipsis:Wb,computedFilterValue:Gr,computedFiltered:$u,computedFilterable:jb,computedGroupable:Za,computedGroupedBy:Yu,computedGroupedByIndex:qb,computedWidth:Bu,computedAbsoluteOffset:Hb,computedPinningOffset:Gb,computedVisibleIndexInCategory:Vr,computedOffset:N,computedSortable:Xb,computedSortInfo:ie,computedSortIndex:Ku,computedMultiSort:g,computedSorted:Me,computedSortedAsc:Ye,computedSortedDesc:ht,computedVisibleIndex:W,computedPinned:It,computedDraggable:C??G.defaultDraggable??T??BT,computedFirstInCategory:Kb,computedLastInCategory:Bb,computedFirst:me===0,computedLast:Wu,id:J,header:G.header??oe.header??G.name??G.field};be&&(N+=Bu,X.set(qe.id,qe),de[me]=qe,It==="start"&&(ue.push(qe),re+=qe.computedWidth),It==="end"&&(ne.push(qe),te+=qe.computedWidth),It||(se.push(qe),B+=qe.computedWidth),ae=It),qe.groupByForColumn&&(qe.computedSortType=G.sortType||oe.sortType||$T(qe.groupByForColumn,e,D),Se.push(qe)),Q.set(qe.id,qe),qe.field&&!qe.groupByForColumn&&!Ke.has(qe.field)&&Ke.set(qe.field,qe)}),Se.forEach(G=>{G.computedSortable=Md(G,{fieldsToColumn:Ke,userColumns:e,columnTypes:D,sortable:f,columnDefaultSortable:x})});let tt=new Map;Ue.forEach(G=>{let J=Q.get(G);J&&tt.set(G,J)}),Q.forEach(G=>{tt.has(G.id)||tt.set(G.id,G)});let nt=c!=null?Math.min(c,re):re,Ze=d!=null?Math.min(d,te):te;return{computedRemainingSpace:t.width-(A+he+ce),computedPinnedStartColumnsWidth:re,computedPinnedEndColumnsWidth:te,computedUnpinnedColumnsWidth:B,computedColumnOrder:K,computedPinnedStartColumns:ue,computedPinnedEndColumns:ne,computedUnpinnedOffset:re,computedPinnedEndOffset:re+B,computedUnpinnedColumns:se,computedVisibleColumns:de,computedColumnsMap:Q,computedColumnsMapInInitialOrder:tt,computedVisibleColumnsMap:X,computedPinnedEndWidth:Ze,computedPinnedStartWidth:nt,renderSelectionCheckBox:de.reduce((G,J)=>G||!!J.renderSelectionCheckBox,!1),fieldsToColumn:Ke}};function Md(n,e){let{sortable:t,fieldsToColumn:o,columnDefaultSortable:r,userColumns:i,columnTypes:a}=e;if(t)return t;let l=n.defaultSortable??n.colType.defaultSortable;if(l!=null)return l;let s=r??ri,u=n.sortType??n.colType.sortType;return u!=null&&u!==qt&&s?!0:d=>{let{column:p,api:f}=d,m=p.groupByForColumn||[];return m!=null&&!Array.isArray(m)&&(m=[m]),(m||[]).reduce((g,h)=>{if(!g)return!1;let S=h.field||h.groupField,y;if(S){let C=o.get(S),T=C?f.getColumnApi(C.id):void 0;if(C&&T)y=T.isSortable();else{let I=Ln(i,S);if(I){let b=xl(I,{colType:fo(I,a??{}),sortable:t,columnDefaultSortable:r});y=typeof b=="boolean"?b:void 0}else y=!1}}return y===void 0&&h.valueGetter&&(y=!0),y??r??ri},!0)}}function ft(n,e){let{getComputed:t,getState:o,actions:r,api:i}=e;typeof n=="number"&&(n=t().computedVisibleColumns[n]);let a=typeof n=="string"?t().computedColumnsMap.get(n):n;if(!a)return null;let l={getCellValuesByPrimaryKey(s){return e.api.getCellValues({columnId:a.id,primaryKey:s})},getCellValueByPrimaryKey(s){return l.getCellValuesByPrimaryKey(s)?.value??null},toggleContextMenu(s){o().columnMenuVisibleForColumnId===a.id?this.hideContextMenu():this.showContextMenu(s)},toggleFilterOperatorMenu(s){o().filterOperatorMenuVisibleForColumnId===a.id?this.hideFilterOperatorMenu():this.showFilterOperatorMenu(s)},showFilterOperatorMenu(s){o().onFilterOperatorMenuClick({target:s,column:a})},hideFilterOperatorMenu(){i.hideFilterOperatorMenu()},showContextMenu(s){o().onColumnMenuClick({target:s,column:a})},hideContextMenu(){r.columnMenuVisibleForColumnId=null},isVisible(){return t().computedVisibleColumnsMap.has(a.id)},setVisible(s){i.setVisibilityForColumn(a.id,s)},toggleSort(s={multiSortBehavior:"replace"}){return i.toggleSortingForColumn(a.id,s)},isSortable(){let{computedColumnsMap:s}=t();return typeof a.computedSortable=="function"?a.computedSortable({api:i,columnApi:l,column:a,columns:s}):a.computedSortable},getSortDir(){return i.getSortingForColumn(a.id)},setFilter(s){return i.setColumnFilter(a.id,s)},clearFilter(){return i.clearColumnFilter(a.id)},getSortInfo(){return i.getSortInfoForColumn(a.id)},setSort(s){s?i.setSortingForColumn(a.id,s):i.setSortInfoForColumn(a.id,null)},clearSort(){this.setSort(null)},getColumnId(){return a.id},getComputedColumn(){return a}};return l}function Ed(n,e,t){let{api:o,getComputed:r,getDataSourceState:i,actions:a,dataSourceActions:l,dataSourceApi:s}=e,u=i(),{allRowsSelected:c,someRowsSelected:d,selectionMode:p}=u,f=r(),m=ft(n.id,{...e,actions:a,dataSourceActions:l,dataSourceApi:s});return{horizontalLayoutPageIndex:null,column:n,columnApi:m,dataSourceApi:s,renderLocation:t,dragging:!1,columnsMap:f.computedColumnsMap,columnSortInfo:n.computedSortInfo,columnFilterValue:n.computedFilterValue,filtered:n.computedFiltered,allRowsSelected:c,someRowsSelected:d,selectionMode:p,api:o,renderBag:{header:n.name||n.id||""}}}function mo(n,e,t,o){let r=typeof n=="string"?e.getComputed().computedColumnsMap.get(n):n,i=r.header;if(typeof i=="function"){let a=Ed(r,e,t),l=i(a)??null;return o?o(l,a):l}return i?o?o(i,Ed(r,e,t)):i:r.name||r.id||""}import*as Ad from"react";var go=`${pt}HeaderCell__filter`,ii=`${pt}HeaderCell__filterOperator`,uA=`${go}__input`;var Ml=Ad.createContext(null);import{useContext as qT}from"react";import{createContext as YT}from"react";var El;function ai(){return El||(El=YT(null))}function ee(n){let e=ai(),t=qT(e);return io(t,n)}function Ge(){return ee(n=>({getState:n.getState,actions:n.actions,getComputed:n.getComputed,getDataSourceState:n.getDataSourceState,dataSourceApi:n.dataSourceApi,dataSourceActions:n.dataSourceActions,api:n.api,getDataSourceMasterContext:n.getDataSourceMasterContext}))}var XT=`${go}__input`,li=n=>n.stopPropagation();function Od(n){let{filterOperatorMenuVisibleForColumnId:e}=ee(c=>({filterOperatorMenuVisibleForColumnId:c.state.filterOperatorMenuVisibleForColumnId})),{column:t}=si(),o=n.filterEditor,r=n.filterOperatorSwitch,[i,a]=Al(!1),l=lt.useCallback(()=>{a(!0)},[]),s=lt.useCallback(()=>{a(!1)},[]),u=e===t.id||i;return lt.createElement("div",{onPointerUp:li,onPointerDown:li,onFocus:l,onBlur:s,className:`${go} ${Il({active:u})}`,style:{height:n.columnHeaderHeight}},lt.createElement(Ml.Provider,{value:n},lt.createElement(r,null),lt.createElement(o,null)))}function Fd(){let{columnApi:n,disabled:e,operator:t}=Qo(),o=t?.components?.Icon??po;return lt.createElement("div",{"data-name":"filter-operator","data-disabled":e,onMouseDown:r=>{r.stopPropagation(),!e&&n.toggleFilterOperatorMenu(r.target)},className:U(ii,sd,e?`${ii}--disabled`:"")},lt.createElement(o,{size:20,className:`${ud({disabled:e})}`}))}function Nd(){return lt.createElement("div",{onPointerUp:li,onPointerDown:li,className:`${go} ${Il({active:!1})} ${xc["50%"]}`})}function Qo(){let n=Ge(),{column:e,columnApi:t}=si(),o=mo(e,n,"column-filter"),r=lt.useContext(Ml),{columnFilterType:i,filterTypes:a,columnFilterValue:l}=r,s=a[i],[u,c]=Al(l?.filter.value??""),[d,p]=Al(0);_d(()=>n.getState().pendingColumnFilters.onCancel(e.id,()=>p(y=>y+1)),[e.id]);let f=lt.useCallback(y=>{c(y),r.onChange(y)},[r.onChange]),m=lt.useCallback(()=>{n.api.clearColumnFilter(e.id)},[e.id]),g=lt.useCallback(()=>{n.api.removeColumnFilter(e.id)},[e.id]);_d(()=>{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,d]);let h=r.operator,S=h?.name;return{api:n.api,column:e,columnFilterValue:l,columnApi:t,operatorName:S,operator:h,value:u,disabled:l?.disabled,filterType:s,filterTypes:a,filterTypeKey:i,filtered:e.computedFiltered,setValue:f,clearValue:m,removeColumnFilter:g,ariaLabel:`Filter for ${o}`,className:`${ad} ${XT}`}}function ho(){let{ariaLabel:n,value:e,setValue:t,className:o,disabled:r}=Qo();return _l.createElement("input",{"data-xxx":!0,"aria-label":n,type:"text",disabled:r,value:e,onChange:i=>{t(i.target.value)},className:o})}function ui(){let{ariaLabel:n,value:e,setValue:t,className:o,disabled:r}=Qo();return _l.createElement("input",{"aria-label":n,type:"number","data-yyy":!0,disabled:r,value:e??"",onChange:i=>{let a=isNaN(i.target.valueAsNumber)?i.target.value:i.target.valueAsNumber;t(a)},className:o})}var Vt=(n,e)=>{let t=n?.[e];return t?{components:{Icon:t}}:{}};function Ld(n={}){let{StringFilterEditor:e,NumberFilterEditor:t,icons:o}=n;return{string:{label:"Text",emptyValues:[""],defaultOperator:"includes",components:e?{FilterEditor:e}:void 0,operators:[{name:"includes",...Vt(o,"includes"),label:"Includes",fn:({currentValue:r,filterValue:i})=>typeof r=="string"&&typeof i=="string"&&r.toLowerCase().includes(i.toLowerCase())},{label:"Equals",...Vt(o,"eq"),name:"eq",fn:({currentValue:r,filterValue:i})=>typeof r=="string"&&r===i},{name:"startsWith",...Vt(o,"startsWith"),label:"Starts With",fn:({currentValue:r,filterValue:i})=>r.startsWith(i)},{name:"endsWith",...Vt(o,"endsWith"),label:"Ends With",fn:({currentValue:r,filterValue:i})=>r.endsWith(i)}]},number:{label:"Number",emptyValues:["",null,void 0],defaultOperator:"eq",components:t?{FilterEditor:t}:void 0,operators:[{label:"Equals",...Vt(o,"eq"),name:"eq",fn:({currentValue:r,filterValue:i})=>r==i},{label:"Not Equals",...Vt(o,"neq"),name:"neq",fn:({currentValue:r,filterValue:i})=>r!=i},{name:"gt",label:"Greater Than",...Vt(o,"gt"),fn:({currentValue:r,filterValue:i,emptyValues:a})=>a.includes(r)?!0:r>i},{name:"gte",...Vt(o,"gte"),label:"Greater Than or Equal",fn:({currentValue:r,filterValue:i,emptyValues:a})=>a.includes(r)?!0:r>=i},{name:"lt",...Vt(o,"lt"),label:"Less Than",fn:({currentValue:r,filterValue:i,emptyValues:a})=>a.includes(r)?!0:r<i},{name:"lte",...Vt(o,"lte"),label:"Less Than or Equal",fn:({currentValue:r,filterValue:i,emptyValues:a})=>a.includes(r)?!0:r<=i}]}}}var kn=Ld({StringFilterEditor:ho,NumberFilterEditor:ui,icons:{includes:Kc,eq:Wc,neq:qc,startsWith:Xc,endsWith:Bc,gt:Uc,gte:jc,lt:Yc,lte:$c}});function ci(n,e,t,o){let r=[...e],i={filtered:n.computedFiltered,first:n.computedFirst,last:n.computedLast,groupByField:!!n.groupByForColumn,firstInCategory:n.computedFirstInCategory,lastInCategory:n.computedLastInCategory,pinned:n.computedPinned||!1,cellSelected:o.cellSelected||!1,rowSelected:o.rowSelected??"null",rowActive:o.rowActive,dragging:o.dragging,insideDisabledDraggingPage:o.insideDisabledDraggingPage,firstRow:o.firstRow??!1,firstRowInHorizontalLayoutPage:o.firstRowInHorizontalLayoutPage??!1,rowDisabled:o.rowDisabled,groupRow:o.groupRow,groupCell:o.groupCell,treeNode:o.treeNode,verticalAlign:o.verticalAlign,align:o.align,zebra:o.zebra},a=t(i);return r.push(a),n.computedFirst&&r.push(...e.map(l=>`${l}--first`)),n.groupByForColumn&&r.push(...e.map(l=>`${l}--group-column`)),n.computedLast&&r.push(...e.map(l=>`${l}--last`)),n.computedFirstInCategory&&r.push(...e.map(l=>`${l}--first-in-category`)),n.computedLastInCategory&&r.push(...e.map(l=>`${l}--last-in-category`)),o.rowSelected===null?r.push(...e.map(l=>`${l}--row-partially-selected`)):o.rowSelected&&r.push(...e.map(l=>`${l}--row-selected`)),o.cellSelected&&r.push(...e.map(l=>`${l}--cell-selected`)),o.firstRow&&r.push(...e.map(l=>`${l}--first-row`)),o.firstRowInHorizontalLayoutPage&&r.push(...e.map(l=>`${l}--first-row-in-horizontal-layout-page`)),o.rowDisabled&&r.push(...e.map(l=>`${l}--disabled`)),o.treeNode&&r.push(...e.map(l=>`${l}--tree-node ${l}-tree-${o.treeNode}-node`)),o.groupRow&&(r.push(...e.map(l=>`${l}--group-row`)),r.push(...e.map(l=>`${l}--${o.rowExpanded?"group-row-expanded":"group-row-collapsed"}`))),n.computedPinned?r.push(...e.map(l=>`${l}--pinned-${n.computedPinned}`)):r.push(...e.map(l=>`${l}--unpinned`)),r.filter(Boolean).join(" ")}import{useCallback as Cp,useState as Ip}from"react";import{flushSync as RC}from"react-dom";function hn(n,e){let t=n;if(!t)return null;if(t&&t.matches(e))return t;for(;t=t.parentElement;)if(t.matches(e))return t;return null}function kd(n,e,t){let o=n;if(!o)return null;if(o&&o.matches(e))return o;for(;o=o.parentElement;){if(o.matches(e))return o;if(o===t)return null}return null}var Y={currentColumnTransformX:"var(--_16hkbkc0)",y:"var(--_16hkbkc1)",currentFlashingBackground:"var(--_16hkbkc2)",currentFlashingDuration:"var(--_16hkbkc3)",activeCellRowOffset:"var(--_16hkbkc4)",activeCellRowOffsetX:"var(--_16hkbkc5)",activeCellRowHeight:"var(--_16hkbkc6)",activeCellOffsetX:"var(--_16hkbkc7)",activeCellOffsetY:"var(--_16hkbkc8)",scrollTopForActiveRow:"var(--_16hkbkc9)",scrollLeftForActiveRowWhenHorizontalLayout:"var(--_16hkbkca)",activeCellColWidth:"var(--_16hkbkcb)",activeCellColOffset:"var(--_16hkbkcc)",columnReorderEffectDurationAtIndex:"var(--_16hkbkcd)",columnWidthAtIndex:"var(--_16hkbkce)",columnOffsetAtIndex:"var(--_16hkbkcf)",columnOffsetAtIndexWhileReordering:"var(--_16hkbkcg)",columnVisibilityAtIndex:"var(--_16hkbkch)",columnZIndexAtIndex:"var(--_16hkbkci)",pinnedStartWidth:"var(--_16hkbkcj)",pinnedEndWidth:"var(--_16hkbkck)",pinnedEndOffset:"var(--_16hkbkcl)",computedVisibleColumnsCount:"var(--_16hkbkcm)",baseZIndexForCells:"var(--_16hkbkcn)",bodyWidth:"var(--_16hkbkco)",bodyHeight:"var(--_16hkbkcp)",scrollbarWidthHorizontal:"var(--_16hkbkcq)",scrollbarWidthVertical:"var(--_16hkbkcr)",scrollLeft:"var(--_16hkbkcs)",scrollTop:"var(--_16hkbkct)"};var di="true",pe={loaded:"var(--infinite-loaded)",themeName:"var(--infinite-theme-name)",themeMode:"var(--infinite-theme-mode)",color:{accent:"var(--infinite-accent-color)",success:"var(--infinite-success-color)",error:"var(--infinite-error-color)",color:"var(--infinite-color)"},spacing:{0:"var(--infinite-space-0)",1:"var(--infinite-space-1)",2:"var(--infinite-space-2)",3:"var(--infinite-space-3)",4:"var(--infinite-space-4)",5:"var(--infinite-space-5)",6:"var(--infinite-space-6)",7:"var(--infinite-space-7)",8:"var(--infinite-space-8)",9:"var(--infinite-space-9)",10:"var(--infinite-space-10)"},fontSize:{0:"var(--infinite-font-size-0)",1:"var(--infinite-font-size-1)",2:"var(--infinite-font-size-2)",3:"var(--infinite-font-size-3)",4:"var(--infinite-font-size-4)",5:"var(--infinite-font-size-5)",6:"var(--infinite-font-size-6)",7:"var(--infinite-font-size-7)"},fontFamily:"var(--infinite-font-family)",baseFontSize:"var(--infinite-font-size)",minHeight:"var(--infinite-min-height)",borderRadius:"var(--infinite-border-radius)",focusOutline:"var(--infinite-focus-outline)",background:"var(--infinite-background)",iconSize:"var(--infinite-icon-size)",rowHeight:"var(--infinite-row-height)",densityScale:"var(--infinite-density-scale)",icons:{expandCollapse:"var(--infinite-icon-expand-collapse)",loading:"var(--infinite-icon-loading)",sortAsc:"var(--infinite-icon-sort-asc)",sortDesc:"var(--infinite-icon-sort-desc)",filter:"var(--infinite-icon-filter)",menu:"var(--infinite-icon-menu)",done:"var(--infinite-icon-done)",clear:"var(--infinite-icon-clear)",hidden:"var(--infinite-icon-hidden)",filterOperatorContains:"var(--infinite-icon-filter-operator-contains)",filterOperatorStartsWith:"var(--infinite-icon-filter-operator-starts-with)",filterOperatorEndsWith:"var(--infinite-icon-filter-operator-ends-with)",filterOperatorEq:"var(--infinite-icon-filter-operator-eq)",filterOperatorNeq:"var(--infinite-icon-filter-operator-neq)",filterOperatorGt:"var(--infinite-icon-filter-operator-gt)",filterOperatorGte:"var(--infinite-icon-filter-operator-gte)",filterOperatorLt:"var(--infinite-icon-filter-operator-lt)",filterOperatorLte:"var(--infinite-icon-filter-operator-lte)"},runtime:{bodyWidth:"var(--infinite-runtime-body-content-width)",totalVisibleColumnsWidthValue:"var(--infinite-runtime-total-visible-columns-width)",totalVisibleColumnsWidthVar:"var(--infinite-runtime-total-visible-columns-width-var)",visibleColumnsCount:"var(--infinite-runtime-visible-columns-count)",browserScrollbarWidth:"var(--infinite-runtime-browser-scrollbar-width)"},components:{GroupingToolbar:{color:"var(--infinite-grouping-toolbar-color)",background:"var(--infinite-grouping-toolbar-background)",rejectBackground:"var(--infinite-grouping-toolbar-reject-background)",activeBackground:"var(--infinite-grouping-toolbar-active-background)",activeBackgroundAlpha:"var(--infinite-grouping-toolbar-active-background-alpha)",padding:"var(--infinite-grouping-toolbar-padding)",border:"var(--infinite-grouping-toolbar-border)",rejectBorder:"var(--infinite-grouping-toolbar-reject-border)",gap:"var(--infinite-grouping-toolbar-gap)"},GroupingToolbarItem:{border:"var(--infinite-grouping-toolbar-item-border)",borderRadius:"var(--infinite-grouping-toolbar-item-border-radius)",activeBorder:"var(--infinite-grouping-toolbar-item-active-border)",background:"var(--infinite-grouping-toolbar-item-background)",activeBackground:"var(--infinite-grouping-toolbar-item-active-background)",activeBackgroundAlpha:"var(--infinite-grouping-toolbar-item-active-background-alpha)"},LoadMask:{padding:"var(--infinite-load-mask-padding)",color:"var(--infinite-load-mask-color)",textBackground:"var(--infinite-load-mask-text-background)",overlayBackground:"var(--infinite-load-mask-overlay-background)",overlayOpacity:"var(--infinite-load-mask-overlay-opacity)",borderRadius:"var(--infinite-load-mask-border-radius)"},Header:{background:"var(--infinite-header-background)",color:"var(--infinite-header-color)",columnHeaderHeight:"var(--infinite-column-header-height)"},HeaderCell:{background:"var(--infinite-header-cell-background)",hoverBackground:"var(--infinite-header-cell-hover-background)",border:"var(--infinite-header-cell-border)",padding:"var(--infinite-header-cell-padding)",paddingX:"var(--infinite-header-cell-padding-x)",paddingY:"var(--infinite-header-cell-padding-y)",iconSize:"var(--infinite-header-cell-icon-size)",menuIconLineWidth:"var(--infinite-header-cell-menu-icon-line-width)",sortIconMargin:"var(--infinite-header-cell-sort-icon-margin)",borderRight:"var(--infinite-header-cell-border-right)",resizeHandleActiveAreaWidth:"var(--infinite-resize-handle-active-area-width)",resizeHandleWidth:"var(--infinite-resize-handle-width)",resizeHandleHoverBackground:"var(--infinite-resize-handle-hover-background)",resizeHandleConstrainedHoverBackground:"var(--infinite-resize-handle-constrained-hover-background)",filterOperatorPaddingX:"var(--infinite-filter-operator-padding-x)",filterEditorPaddingX:"var(--infinite-filter-editor-padding-x)",filterEditorMarginX:"var(--infinite-filter-editor-margin-x)",filterOperatorPaddingY:"var(--infinite-filter-operator-padding-y)",filterEditorPaddingY:"var(--infinite-filter-editor-padding-y)",filterEditorMarginY:"var(--infinite-filter-editor-margin-y)",filterEditorBackground:"var(--infinite-filter-editor-background)",filterEditorBorder:"var(--infinite-filter-editor-border)",filterEditorFocusBorderColor:"var(--infinite-filter-editor-focus-border-color)",filterEditorBorderRadius:"var(--infinite-filter-editor-border-radius)",filterEditorColor:"var(--infinite-filter-editor-color)"},ActiveCellIndicator:{inset:"var(--infinite-active-cell-indicator-inset)"},Cell:{flashingDuration:"var(--infinite-flashing-duration)",flashingAnimationName:"var(--infinite-flashing-animation-name)",flashingOverlayZIndex:"var(--infinite-flashing-overlay-z-index)",flashingBackground:"var(--infinite-flashing-background)",flashingUpBackground:"var(--infinite-flashing-up-background)",flashingDownBackground:"var(--infinite-flashing-down-background)",padding:"var(--infinite-cell-padding)",paddingX:"var(--infinite-cell-padding-x)",paddingY:"var(--infinite-cell-padding-y)",borderWidth:"var(--infinite-cell-border-width)",borderColor:"var(--infinite-cell-border-color)",border:"var(--infinite-cell-border)",borderLeft:"var(--infinite-cell-border-left)",borderRight:"var(--infinite-cell-border-right)",borderTop:"var(--infinite-cell-border-top)",borderInvisible:"var(--infinite-cell-border-invisible)",borderRadius:"var(--infinite-cell-border-radius)",reorderEffectDuration:"var(--infinite-column-reorder-effect-duration)",pinnedBorder:"var(--infinite-pinned-cell-border)",horizontalLayoutColumnReorderDisabledPageOpacity:"var(--infinite-horizontal-layout-column-reorder-disabled-page-opacity)",color:"var(--infinite-cell-color)",selectedBackground:"var(--infinite-selected-cell-background)",selectedBackgroundDefault:"var(--infinite-selected-cell-background-default)",selectedBackgroundAlpha:"var(--infinite-selected-cell-background-alpha)",selectedBackgroundAlphaWhenTableUnfocused:"var(--infinite-selected-cell-background-alpha--table-unfocused)",selectedBorderColor:"var(--infinite-selected-cell-border-color)",selectedBorderWidth:"var(--infinite-selected-cell-border-width)",selectedBorderStyle:"var(--infinite-selected-cell-border-style)",selectedBorder:"var(--infinite-selected-cell-border)",activeBackgroundAlpha:"var(--infinite-active-cell-background-alpha)",activeBackgroundAlphaWhenTableUnfocused:"var(--infinite-active-cell-background-alpha--table-unfocused)",activeBackground:"var(--infinite-active-cell-background)",activeBackgroundDefault:"var(--infinite-active-cell-background-default)",activeBorderColor:"var(--infinite-active-cell-border-color)",activeBorderWidth:"var(--infinite-active-cell-border-width)",activeBorderStyle:"var(--infinite-active-cell-border-style)",activeBorder:"var(--infinite-active-cell-border)"},SelectionCheckBox:{marginInline:"var(--infinite-selection-checkbox-margin-inline)"},ExpandCollapseIcon:{color:"var(--infinite-expand-collapse-icon-color)"},Menu:{background:"var(--infinite-menu-background)",color:"var(--infinite-menu-color)",separatorColor:"var(--infinite-menu-separator-color)",padding:"var(--infinite-menu-padding)",cellPaddingVertical:"var(--infinite-menu-cell-padding-vertical)",cellPaddingHorizontal:"var(--infinite-menu-cell-padding-horizontal)",cellMarginVertical:"var(--infinite-menu-cell-margin-vertical)",itemDisabledBackground:"var(--infinite-menu-item-disabled-background)",itemActiveBackground:"var(--infinite-menu-item-active-background)",itemActiveOpacity:"var(--infinite-menu-item-active-opacity)",itemPressedOpacity:"var(--infinite-menu-item-pressed-opacity)",itemPressedBackground:"var(--infinite-menu-item-pressed-background)",itemDisabledOpacity:"var(--infinite-menu-item-disabled-opacity)",borderRadius:"var(--infinite-menu-border-radius)",shadowColor:"var(--infinite-menu-shadow-color)"},RowDetail:{background:"var(--infinite-rowdetail-background)",padding:"var(--infinite-rowdetail-padding)",gridHeight:"var(--infinite-rowdetail-grid-height)"},Row:{background:"var(--infinite-row-background)",oddBackground:"var(--infinite-row-odd-background)",disabledBackground:"var(--infinite-row-disabled-background)",oddDisabledBackground:"var(--infinite-row-odd-disabled-background)",selectedBackground:"var(--infinite-row-selected-background)",disabledOpacity:"var(--infinite-row-disabled-opacity)",activeBackground:"var(--infinite-active-row-background)",activeBorderColor:"var(--infinite-active-row-border-color)",activeBorderWidth:"var(--infinite-active-row-border-width)",activeBorderStyle:"var(--infinite-active-row-border-style)",activeBorder:"var(--infinite-active-row-border)",activeBackgroundAlpha:"var(--infinite-active-row-background-alpha)",activeBackgroundAlphaWhenTableUnfocused:"var(--infinite-active-row-background-alpha--table-unfocused)",hoverBackground:"var(--infinite-row-hover-background)",selectedHoverBackground:"var(--infinite-row-selected-hover-background)",selectedDisabledBackground:"var(--infinite-row-selected-disabled-background)",groupRowBackground:"var(--infinite-group-row-background)",groupRowColumnNesting:"var(--infinite-group-row-column-nesting)",groupNesting:"var(--infinite-dont-override-group-row-nesting-length)",pointerEventsWhileScrolling:"var(--infinite-row-pointer-events-while-scrolling)"},ColumnCell:{background:"var(--infinite-column-cell-bg-dont-override)"}}},zd="column-header-height";var Vd=`.${Le.rootClassName}`;function Ol(n){return hn(n,Vd)}var Gd=$(Y.scrollLeft),ZT=$(Y.scrollTop),QT=$(Y.columnWidthAtIndex),Fl=$(Y.columnOffsetAtIndex),Hd=$(Y.columnReorderEffectDurationAtIndex),JT=$(Y.columnOffsetAtIndexWhileReordering),eC=$(Y.columnVisibilityAtIndex),tC=$(Y.columnZIndexAtIndex);function Gt(n,e,t){let o=t?Ol(t):document.querySelector(Vd);nC(n,e,o)}function nC(n,e,t){if(t){let o=n,r=Y[o]?$(Y[o]):n;t.style.setProperty(r,`${e}`)}}function yo(n,e){if(e)for(var t in n){let o=Y[t]?$(Y[t]):t,r=`${n[t]}`;e.style.setProperty(o,r)}}function Nl(n,e,t){Gt(`${Fl}-${n.computedVisibleIndex}`,n.computedPinned?`calc( ${n.computedAbsoluteOffset+e}px + var(${Gd}))`:`${n.computedAbsoluteOffset+e}px`,t)}function Ll(n,e,t){Gt(`${tC}-${n}`,`${e}`,t)}function Jo(n,e,t){Gt(`${JT}-${n}`,typeof e=="number"?`calc( var(${Fl}-${n}) + ${e}px )`:e,t)}function er(n,e,t){Gt(`${eC}-${n}`,e,t)}function pi(n,e,t){Gt(`${Hd}-${n}`,t??"",e)}function kl(n,e){let t=`${Hd}-${n}`;Gt(t,pe.components.Cell.reorderEffectDuration,e)}var Ie={columnWidths:{get(n){return`var(${this.getVarName(n)})`},getVarName(n){return this.varName.get(n)},varName:{get(n){return`${QT}-${n}`}},set(n,e,t){e=typeof e=="number"?e+"px":e,Gt(this.varName.get(n),e,t)}},columnOffsets:{get(n){return`var(${this.getVarName(n)})`},getVarName(n){return this.varName.get(n)},varName:{get(n){return`${Fl}-${n}`}},set(n,e,t){e=typeof e=="number"?e+"px":e,Gt(this.varName.get(n),e,t)}}};function Kd(n,e){yo({[Gd]:`${n.scrollLeft}px`,[ZT]:`${n.scrollTop}px`},e)}var Bd="_16lm1iw1",Wd="_1yeub2v0 _16lm1iw1 _16lm1iw1p _16lm1iw2f _16lm1iw0",jd="_1yeub2vs",Ud="_1yeub2vr",$d=ge({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 zl="_1yeub2vp";var l_=ge({defaultClassName:"_1yeub2vl",variantClassNames:{pinned:{start:"_1yeub2vm",end:"_1yeub2vn",false:"_1yeub2vo"}},defaultVariants:{},compoundVariants:[]});import{useMemo as cC}from"react";var tr={bodyWidth:{name:$(pe.runtime.bodyWidth),value:""},totalVisibleColumnsWidthValue:{name:$(pe.runtime.totalVisibleColumnsWidthValue),value:""},totalVisibleColumnsWidthVar:{name:$(pe.runtime.totalVisibleColumnsWidthVar),value:""},visibleColumnsCount:{name:$(pe.runtime.visibleColumnsCount),value:""},browserScrollbarWidth:{name:$(pe.runtime.browserScrollbarWidth),value:""}},oC=$(Y.scrollbarWidthHorizontal),Yd=$(Y.scrollbarWidthVertical),rC=$(Y.columnWidthAtIndex),iC=$(Y.columnZIndexAtIndex),qd=$(Y.scrollLeft),aC=$(Y.activeCellColWidth),Xd=$(Y.activeCellColOffset),ep=$(Y.baseZIndexForCells),lC=$(Y.pinnedStartWidth),Zd=$(Y.bodyWidth),sC=$(Y.bodyHeight),Qd=$(Y.pinnedEndOffset),Jd=$(Y.pinnedEndWidth),uC=$(Y.computedVisibleColumnsCount);function fi(n,e){let t="auto",o=n.computedVisibleIndex;return n.computedPinned?n.computedPinned==="start"?t=e.pinnedStartColsCount-n.computedVisibleIndexInCategory:n.computedPinned==="end"&&(t=e.visibleColsCount+n.computedVisibleIndexInCategory):t=-o*10,typeof t=="number"?`calc( var(${ep}) `+(t<0?"-":"+")+` ${Math.abs(t)} )`:"auto"}function tp(n){let{computedVisibleColumns:e,computedPinnedStartColumns:t,computedPinnedEndColumns:o,computedPinnedStartColumnsWidth:r,computedPinnedEndColumnsWidth:i,computedUnpinnedColumnsWidth:a,bodySize:l,activeCellIndex:s,brain:u,scrollbars:c}=n,d=zt(),p=[],f=e.reduce((m,g)=>{let h=g.computedVisibleIndex;m[Ie.columnWidths.varName.get(h)]=g.computedWidth+"px",m[Ie.columnOffsets.varName.get(h)]=g.computedPinned==="start"?`calc( ${g.computedOffset}px + var(${qd}) )`:g.computedPinned==="end"?`calc( var(${Qd}) ${p.length?"+":""} ${p.map(y=>Ie.columnWidths.get(y.computedVisibleIndex)).join(" + ")} + var(${qd}) )`:`${g.computedOffset}px`;let S=fi(g,{pinnedStartColsCount:t.length,visibleColsCount:e.length});return m[`${iC}-${h}`]=`${S}`,g.computedPinned==="end"&&p.push(g),m},{});if(l.width&&(f[tr.browserScrollbarWidth.name]=`${zt()}px`),f[tr.bodyWidth.name]=`calc(${Y.bodyWidth} - ${Y.scrollbarWidthVertical})`,f[tr.totalVisibleColumnsWidthValue.name]=`${r+i+a}px`,f[tr.totalVisibleColumnsWidthVar.name]=`calc(${e.map((m,g)=>`var(${rC}-${g})`).join(" + ")})`,f[tr.visibleColumnsCount.name]=e.length,s!=null){f[aC]=Ie.columnWidths.get(s[1]);let m=Ie.columnOffsets.get(s[1]);if(u.isHorizontalLayoutBrain){let g=u.getPageIndexForRow(s[0]);f[Xd]=g?`calc( ${pe.runtime.totalVisibleColumnsWidthVar} * ${g} + ${m})`:m}else f[Xd]=m}return f[uC]=e.length,f[oC]=c.horizontal?`${d}px`:"0px",f[Yd]=c.vertical?`${d}px`:"0px",f[lC]="calc( "+t.map(m=>Ie.columnWidths.get(m.computedVisibleIndex)).join(" + ")+")",f[Jd]="calc( "+o.map(m=>Ie.columnWidths.get(m.computedVisibleIndex)).join(" + ")+")",f[ep]=e.length*10,f[Qd]=`calc( var(${Zd}) - var(${Jd}) - var(${Yd}) )`,f[Zd]=`${l.width}px`,f[sC]=`${l.height}px`,f}var Vl=n=>{let e=0;return(...t)=>{e&&cancelAnimationFrame(e),e=requestAnimationFrame(()=>{e=0,n(...t)})}};function np(n){let{actions:e,getState:t,focused:o,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:h,computedPinnedEndColumns:S,computedVisibleColumns:y,computedUnpinnedColumnsWidth:C,scrollbars:T,focusedClassName:I,focusedWithinClassName:b,computedPinnedStartOverflow:R,computedPinnedEndOverflow:w,focusedStyle:v,focusedWithinStyle:P,brain:x}=ee(F=>{let{state:K,computed:q}=F;return{brain:K.brain,actions:F.actions,getState:F.getState,focused:K.focused,focusedWithin:K.focusedWithin,domRef:K.domRef,scrollerDOMRef:K.scrollerDOMRef,onBlurWithin:K.onBlurWithin,onFocusWithin:K.onFocusWithin,onSelfFocus:K.onSelfFocus,onSelfBlur:K.onSelfBlur,bodySize:K.bodySize,activeCellIndex:K.activeCellIndex,wrapRowsHorizontally:K.wrapRowsHorizontally,computedPinnedStartColumnsWidth:q.computedPinnedStartColumnsWidth,computedPinnedEndColumnsWidth:q.computedPinnedEndColumnsWidth,computedPinnedStartColumns:q.computedPinnedStartColumns,computedPinnedEndColumns:q.computedPinnedEndColumns,computedVisibleColumns:q.computedVisibleColumns,computedUnpinnedColumnsWidth:q.computedUnpinnedColumnsWidth,scrollbars:q.scrollbars,focusedClassName:F.state.focusedClassName,focusedWithinClassName:F.state.focusedWithinClassName,computedPinnedStartOverflow:q.computedPinnedStartOverflow,computedPinnedEndOverflow:q.computedPinnedEndOverflow,focusedStyle:F.state.focusedStyle,focusedWithinStyle:F.state.focusedWithinStyle}}),M=cC(()=>tp({computedVisibleColumns:y,computedPinnedStartColumns:h,computedPinnedEndColumns:S,computedPinnedStartColumnsWidth:m,computedPinnedEndColumnsWidth:g,computedUnpinnedColumnsWidth:C,bodySize:d,activeCellIndex:p,brain:x,scrollbars:T}),[y,h,S,m,g,C,d,p,x,T]),D=Vl(F=>{e.focused=F}),E=Vl(F=>{e.focusedWithin=F}),N={...n,onFocus:F=>{if(n?.onFocus?.(F),F.target===i.current||F.target===a.current){if(t().focused)return;D(!0),u?.(F),r&&(E(!1),l?.(F));return}r||(E(!0),s?.(F))},onBlur:F=>{if(n?.onBlur?.(F),F.target===i.current||F.target===a.current){if(!t().focused)return;D(!1),c?.(F),r&&(E(!1),l?.(F));return}i.current?.contains(F.relatedTarget)||(E(!1),l?.(F))}},L=U(Xt,Wd,f?`${Xt}--horizontal-layout`:null,N?.className,m?`${Xt}--has-pinned-start ${Ud}`:null,g?`${Xt}--has-pinned-end ${jd}`:null,o?`${Xt}--focused`:null,r?`${Xt}--focused-within`:null,o&&I?I:null,r&&b?b:null,R?`${Xt}--has-pinned-start-overflow`:null,w?`${Xt}--has-pinned-end-overflow`:null,$d({horizontalLayout:!!f,hasPinnedStart:!!m,hasPinnedEnd:!!g,focused:o,focusedWithin:r}));return N.className=L,N.style={...n?.style,...M},o&&v&&Object.assign(N.style,v),r&&P&&Object.assign(N.style,P),N}var pp=oo(zn());function mi(n){return n.map(e=>e instanceof yn?e:new yn(null,[e]))}var yn=class n{constructor(e,t=[]){this.__operands=[];this.__operation=null;this.__operands=t,this.__operation=e}add(...e){return new n("+",[this,...e])}subtract(...e){return new n("-",[this,...e])}minus(...e){return this.subtract(...e)}multiply(...e){return new n("*",[this,...e])}divide(...e){return new n("/",[this,...e])}__get(e){let{__operation:t,__operands:o}=this,r=o.map(a=>dC(a,this)).join(` ${t} `);return(o.length<=1?!0:e?.__operation==="+"||e?.__operation==="-")?r:`(${r})`}done(){let e=this.__get();return`calc${e.startsWith("(")&&e.endsWith(")")?e:`(${e})`}`}};function dC(n,e){return typeof n=="string"||typeof n=="number"?`${n}`:e?n.__get(e):n.done()}var pC=(...n)=>new yn("+",mi(n)),rp=(...n)=>new yn("-",mi(n)),fC=(...n)=>new yn("*",mi(n)),mC=(...n)=>new yn("/",mi(n)),nr={add:pC,subtract:rp,minus:rp,multiply:fC,divide:mC};var Vn=(n,e,t)=>{if(n=[...n],e===t||n[e]===void 0||n[t]===void 0)return n;let o=n[e];return t<e,n.splice(e,1),n.splice(t,0,o),n};var Ve=_e().requestAnimationFrame||(n=>setTimeout(n,16)),Ot=_e().cancelAnimationFrame||(n=>clearTimeout(n));var ip=n=>{let e=null,t=null;return{stop(){e!==null&&Ot(e),t!=null&&Ot(t)},scroll(o){e!==null&&Ot(e),t!=null&&Ot(t);let r={offset:100,scrollAmountsPerRaf:[1,1,2,4,6,8,11,15],...n,...o},i=this;function a(){let s=r.scrollOffsetStart+r.offset-r.mousePosition.clientX;if(!(s>0&&s<=r.offset))return!1;let 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 o.scrollLeft=o.scrollLeft-p,e=Ve(()=>{i.scroll(o)}),!0}function l(){let s=r.mousePosition.clientX-(r.scrollOffsetEnd-r.offset);if(!(s>0&&s<=r.offset))return!1;let 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 o.scrollLeft=o.scrollLeft+p,t=Ve(()=>{i.scroll(o)}),!0}return!!(a()||l())}}};var Be=class n{constructor(e){this.top=0;this.left=0;this.left=e.left,this.top=e.top}static clone(e){return new n(e)}static from(e){return new n(e)}shift(e){return e.top!=null&&(this.top+=e.top),e.left!=null&&(this.left+=e.left),this}getDistanceToPoint(e){let t=e.top-this.top,o=e.left-this.left;return{top:t,left:o}}};function ap(n,e){let t=Math.atan2(n.top-e.top,n.left-e.left);return t<=0&&(t=2*Math.PI+t),t}function lp(n,e){return Math.sqrt((e.top-n.top)**2+(e.left-n.left)**2)}function gC(n,e,t){let o=ap(n,t),r=ap(e,t);return o===r?lp(t,e)-lp(t,n):o-r}function sp(n){if(n.length<3)return n;let[...e]=n,t={top:0,left:0};return n.forEach(o=>{t.top+=o.top,t.left+=o.left}),t.top/=n.length,t.left/=n.length,e.sort((o,r)=>gC(o,r,t)),e}function hC(n){if(n.length<2)return!1;let e=n[0].left,t=n[0].top,o={left:!1,top:!1};for(let r=1,i=n.length;r<i;r++){if(o.left&&o.top)return!1;n[r].left!==e&&(o.left=!0),n[r].top!==t&&(o.top=!0)}return!(o.left&&o.top)}function yC(n,e){if(n.length<2)return n[0]?n[0].left===e.left&&n[0].top===e.top:!1;n=sp(n);let t=n[0],o=n[n.length-1];return t.left===o.left?e.left===t.left&&e.top>=Math.min(t.top,o.top)&&e.top<=Math.max(t.top,o.top):e.top===t.top&&e.left>=Math.min(t.left,o.left)&&e.left<=Math.max(t.left,o.left)}function up(n,e){if(hC(n))return yC(n,e);n=sp(n);let[t]=n;for(let o=1,r=n.length-1;o<r;o++){let i=n[o],a=n[o+1];if(SC([t,i,a],e))return!0}return!1}function SC(n,e){let[t,o,r]=n,i=e,a=(o.left-t.left)*(r.top-t.top)-(o.top-t.top)*(r.left-t.left);return a*((o.left-t.left)*(i.top-t.top)-(o.top-t.top)*(i.left-t.left))>=0&&a*((r.left-o.left)*(i.top-o.top)-(r.top-o.top)*(i.left-o.left))>=0&&a*((t.left-r.left)*(i.top-r.top)-(t.top-r.top)*(i.left-r.left))>=0}var So=class{containsPoint(e){return up(this.getPoints(),e)}contains(e){let t=e.getPoints();for(let o=0,r=t.length;o<r;o++)if(!this.containsPoint(t[o]))return!1;return!0}intersects(e){return this.privateIntersects(e,!1)}privateIntersects(e,t){let o=e.getPoints();for(let r=0,i=o.length;r<i;r++)if(this.containsPoint(o[r]))return!0;return t?!1:e.privateIntersects(this,!0)}};var bo=class n extends So{static clone(e){return new n(e)}constructor(e){super(),this.points=e.map(Be.clone)}getPoints(){return this.points}shift(e){return this.points.forEach(t=>{t.shift(e)}),this}};function bC(n,e){let t=Math.min(n.left,e.left),o=Math.min(n.top,e.top),r=n.left+n.width,i=e.left+e.width,a=Math.max(r,i),l=n.top+n.height,s=e.top+e.height,u=Math.max(l,s);return new Ae({top:o,left:t,width:a-t,height:u-o})}var Ae=class n extends So{constructor(t){super();this.top=0;this.left=0;this.width=0;this.height=0;this.top=t.top,this.left=t.left,typeof t.width=="number"?(this.width=t.width,this.height=t.height):(this.width=t.right-t.left,this.height=t.bottom-t.top)}static fromDOMRect(t){return new n(t)}static clone(t){return new n(t)}static from(t){return n.clone(t)}static fromPoint(t){return n.from({top:t.top,left:t.left,width:0,height:0})}getMinimumBoundingRectangle(...t){let o=this;for(let r of t)o=bC(o,r);return o}toDOMRect(){return{top:this.top,left:this.left,bottom:this.top+this.height,right:this.left+this.width,height:this.height,width:this.width,x:this.left,y:this.top,toJSON:()=>({top:this.top,left:this.left,bottom:this.top+this.height,right:this.left+this.width,height:this.height,width:this.width,x:this.left,y:this.top})}}containsPoint(t){return new bo(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(Be.from)}shift(t){return t.top!=null&&(this.top+=t.top),t.left!=null&&(this.left+=t.left),this}};var Gl;function TC(){if(typeof document>"u"||!document.body)return 1/0;let n=document.createElement("div");n.style.cssText="position:absolute;top:0;left:0;width:1px;visibility:hidden;pointer-events:none",document.body.appendChild(n);let e=o=>(n.style.height=`${o}px`,Math.abs(n.getBoundingClientRect().height-o)<1),t=1e6;if(!e(t))return n.remove(),1/0;for(;t<64e6&&e(t*2);)t*=2;return n.remove(),t}function gi(){return Gl===void 0&&(Gl=TC()),Gl}function hi(n){return n<=4e6?!1:n>gi()}function Hl(n,e){if(!hi(n))return 1;let t=gi()-e,o=n-e;return t>0&&o>0?o/t:1}function cp(n){let e=null;return{get value(){let t=n.getScrollPosition(),o=n.getScrollRatio();return o>1&&e!==null&&Math.abs(e-t)<=o?e:(e=null,t)},set value(t){e=t,n.setScrollPosition(t)}}}function Kl(n,e,t=Math.floor){return Math.abs(n-e)<=1e6?e:t(n)}var dp=10,CC=$(Y.pinnedStartWidth);function fp(n){let{computedVisibleColumns:e,computedVisibleColumnsMap:t,computedPinnedEndColumns:o,computedPinnedStartColumns:r,dragColumnId:i,infiniteDOMNode:a,brain:l,dragColumnHeaderTargetRect:s,draggableColumnsRestrictTo:u,tableRect:c,acceptDropToReorderRect:d,allowColumnHideOnDrag:p,setProxyPosition:f,setDragColumnOutside:m,getCurrentDragSourceAndTarget:g,groupingToolbarDragListId:h,api:S,horizontalLayoutPageIndex:y,pageWidth:C}=n;function T(X){let Q=X==="start"?F:K;return V===L?Q:L===X?Q+E.computedWidth:V===X?Q-E.computedWidth:Q}function I(X){if(X.columnIndex===z||y!=null)return!0;let Q=e[X.columnIndex];if(Q.computedPinned)return!0;let B=l.getScrollPosition().scrollLeft,re=Q.computedOffset+(y!=null&&C!=null?C*y:0);return re>=B+T("start")&&re+Q.computedWidth<=B+c.width-T("end")}let b=(X,Q)=>{let{restrictToParentGroup:B,dragColumn:re}=Q,te=[];if(X.forEach(O=>{if(O.computedVisibleIndex===z)return;let A={columnId:O.id,columnIndex:O.computedVisibleIndex,offsetX:O.computedOffset+Math.round(O.computedWidth/2)};I(A)&&te.push(A)}),B){let A=function(he,Re,Se){let xe=X[he];xe&&(xe.columnGroup!==re.columnGroup&&Se.add(xe.id),A(he+Re,Re,Se))};var ae=A;let O=re.computedVisibleIndex,ce=new Set;A(O-1,-1,ce),A(O+1,1,ce),te=te.filter(he=>!ce.has(he.columnId))}return te},w=r.length,v={clientX:Math.round(n.initialMousePosition.clientX),clientY:Math.round(n.initialMousePosition.clientY)},P={left:v.clientX-c.left-(v.clientX-s.left)+dp,top:v.clientY-c.top-(v.clientY-s.top)+dp},x=l.getScrollPosition(),M=e.map(X=>X.computedVisibleIndex),D=M,E=t.get(i),z=E.computedVisibleIndex,V=E?.computedPinned,N=z,L=V,F=l.getFixedStartColsWidth(),K=l.getFixedEndColsWidth(),q=v,_={x:0,y:0},k=1,H=0;function Z(X){let Q=Math.round(X.clientX),B=Math.round(X.clientY);if(Q===q.clientX&&B===q.clientY)return Ae.from(s).shift({left:_.x,top:_.y});q={clientX:Q,clientY:B};let te=l.getScrollPosition().scrollLeft-x.scrollLeft;return _.x=q.clientX-v.clientX,_.y=q.clientY-v.clientY,H=_.x+te,k=H<0?-1:1,f({left:P.left+_.x,top:P.top+_.y}),Ae.from(s).shift({left:_.x,top:_.y})}function Ce(X){let Q=0;V?V==="start"&&X.forEach((B,re)=>{Q||e[B]?.computedPinned!=="start"&&(Q=re)}):X.forEach((B,re)=>{e[B]?.computedPinned==="start"&&(Q=re+1)}),w=Q,le("start",X,Q)}function le(X,Q,B){if(X==="start"){let re=0;for(let te=0;te<B;te++){let ae=Q[te],O=e[ae];re+=O.computedWidth}Gt(CC,`${re}px`,a)}}function fe(X){if(X==null||X===N)return;if(N===-1&&X!==-1&&(er(z,"",a),m(!1)),N=X,X===-1){we(z);return}let Q=Vn(M,z,N>z?N-1:N);w=0;let re=new Set;return Q.forEach((te,ae)=>{let O=D[ae];te!==O&&re.add(te),Ce(Q)}),D=Q,ve(re),{newColumnIndexes:Q,indexesWithTransition:re,pinnedStartCount:w}}function we(X){D=D.filter(B=>B!==X),e.forEach(B=>{let re=B.computedVisibleIndex,te=re>X;kl(re,a);let ae="";te&&(ae=nr.minus(Ie.columnOffsets.get(re),Ie.columnWidths.get(X)).done()),Jo(re,ae,a)}),er(X,"hidden",a),m(!0)}function ve(X){e.forEach(Q=>{let B=Q.computedVisibleIndex;X.has(B)?kl(B,a):pi(B,a);let re=B===z,te=k===-1?B<N||B>z:B<z||B>=N,ae="";k===-1?ae=re?Ie.columnOffsets.get(N):te?Ie.columnOffsets.get(B):nr.add(Ie.columnOffsets.get(B),Ie.columnWidths.get(z)).done():ae=te?Ie.columnOffsets.get(B):re?nr.add(Ie.columnOffsets.get(N-1),Ie.columnWidths.get(N-1)).minus(Ie.columnWidths.get(z)).done():nr.minus(Ie.columnOffsets.get(B),Ie.columnWidths.get(z)).done(),Jo(B,ae,a)})}let ue=c.left+T("start"),ne=c.right-T("end"),se=ip({scrollOffsetStart:ue,scrollOffsetEnd:ne}),de=cp({getScrollPosition:()=>l.getScrollPosition().scrollLeft,setScrollPosition:X=>{S.scrollLeft=X},getScrollRatio:()=>l.getScrollRatio("horizontal")});return Z(v),{speedScroller:se,stop(){se.stop()},onMove(X){let Q=Z(X);if(g().dropTargetListId===h||p&&!d.containsPoint(Q.getCenter()))return p&&fe(-1),null;se.scroll({mousePosition:q,get scrollLeft(){return de.value},set scrollLeft(A){de.value=A}});let B=b(e,{dragColumn:E,restrictToParentGroup:u==="group"}),re=k===-1?E.computedOffset+H:E.computedOffset+E.computedWidth+H,te=(0,pp.default)(B,re,({offsetX:A},ce)=>A<ce?-1:A>ce?1:0);te<0&&(te=~te),B.length?te=B[te]?B[te].columnIndex:B[B.length-1].columnIndex+1:(e.length>1&&console.error("No breakpoints available, something is wrong!"),te=0),te===z+1&&(te=z),fe(te);let ae={};o.forEach(A=>{ae[A.id]="end"});for(let A=0;A<w;A++){let ce=D[A],he=e[ce];ae[he.id]="start"}let O=D.map(A=>e[A].id);return{columnPinning:ae,columnOrder:O}}}}function Bl(n){let{newColumnOrder:e,visibleColumnOrder:t,existingColumnOrder:o,dragColumnId:r}=n;if(t.length!==e.length)return console.warn("new column order cannot contain less columns than the visible column order"),e;let i=t.indexOf(r),a=e.indexOf(r);if(i===a)return o;if(a>i){let l=e.indexOf(r),s=e[l-1],u=o.indexOf(s),c=o.indexOf(r);return Vn(o,c,u)}else{let l=e.indexOf(r),s=e[l+1],u=o.indexOf(s),c=o.indexOf(r);return Vn(o,c,u)}return e}import*as Qe from"react";var Gn=class{constructor(e){this.listeners={};e&&Object.keys(e).forEach(t=>{this.on(t,e[t])})}on(e,t){return this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(t),()=>this.off(e,t)}once(e,t){let o=((...r)=>{this.off(e,o),t(...r)});return this.on(e,o)}off(e,t){let o=this.listeners[e];if(!o)return;let r=o.indexOf(t);r!==-1&&o.splice(r,1)}emit(e,...t){let o=this.listeners[e];o&&o.slice().forEach(r=>{try{r(...t)}catch(i){console.error(`Error in event handler for event '${String(e)}':`,i)}})}clear(e){this.listeners[e]&&(this.listeners[e]=[])}clearAll(){Object.keys(this.listeners).forEach(e=>{this.listeners[e]=[]})}};var mp=oo(zn());var gp=(n,e)=>{let{offset:t,activeDragSource:o}=n,{orientation:r,draggableItems:i,listId:a,listRectangle:l}=e.getData(),{dragItem:s,listId:u,dragIndex:c,dragRectangle:d}=o,p=u===a,f=Be.from(d.getCenter());if(!l.containsPoint(f))return null;e.activeDragSourcePosition="inside";let m=p?r==="horizontal"?t.left>0?1:-1:t.top>0?1:-1:1,g=d.toDOMRect(),h=e.breakpoints,S=Math.round(m===1?r==="horizontal"?g.right-(p?0:g.width/2):g.bottom-(p?0:g.height/2):r==="horizontal"?g.left+(p?0:g.width/2):g.top+(p?0:g.height/2)),y=(0,mp.default)(h,S,(R,w)=>R-w);y<0&&(y=~y),m===1&&y===c+1&&p&&y--;let C=Math.min(c,y),T=Math.max(c,y),I=p?i.map((R,w)=>{if(w===c&&p)return t;if(w<C||w>=T)return{left:0,top:0};let v=y<=w?1:-1;return r==="horizontal"?{left:Math.round(v*g.width),top:0}:{left:0,top:Math.round(v*g.height)}}):i.map((R,w)=>{let v=y<=w?1:0;return r==="horizontal"?{left:Math.round(v*g.width),top:0}:{left:0,top:Math.round(v*g.height)}}),b={offset:t,dropIndex:y,dragSourceListId:u,dropTargetListId:a,dragIndex:c,outside:!1,items:i,dragItem:s,offsetsForItems:I,dragRect:g,status:"accepted"};return e.acceptsDrop(b)?{event:b,error:null,success:!0}:(b.status="rejected",{event:b,error:"rejected by interaction target",success:!1})},hp=(n,e)=>{let{offset:t,activeDragSource:o}=n,{orientation:r,listId:i,listRectangle:a,draggableItems:l}=e.getData(),{dragRectangle:s,dragItem:u,listId:c}=o,d=Be.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?o.dragIndex:-1,g=s.toDOMRect(),h={offset:t,dropIndex:-1,dragIndex:m,dragItem:u,outside:!f,items:l,dragSourceListId:c,dropTargetListId:i,offsetsForItems:p?l.map((S,y)=>S.id===u.id?t:f?{left:0,top:0}:y>m&&!e.getData().preserveDragSpace?r==="horizontal"?{left:-u.rect.width,top:0}:{left:0,top:-u.rect.height}:{left:0,top:0}):l.map(S=>({left:0,top:0})),dragRect:g,status:"accepted"};return e.acceptsDrop(h)?{event:h,error:null,success:!0}:(h.status="rejected",{event:h,error:"rejected by interaction target",success:!1})};var Pe=class Pe{static startDrag(e,t){let o=e instanceof To?e:new To(e),r=new Wl({activeDragSource:o,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){let{listId:t}=e,o=Pe.dragInteractionTargetsMap.get(t);if(o&&o!==e){console.warn(`DragInteractionTarget with listId ${t} already registered`);return}return o||(Pe.dragInteractionTargetsMap.set(t,e),Pe.emit("register",e)),()=>{Pe.unregisterDragInteractionTarget(e)}}static unregisterAll(){Pe.dragInteractionTargetsMap.forEach(e=>{Pe.unregisterDragInteractionTarget(e)})}static unregisterDragInteractionTarget(e){if(!e)return;let{listId:t}=e;Pe.dragInteractionTargetsMap.get(t)===e&&(Pe.dragInteractionTargetsMap.delete(t),e.unregister(),Pe.emit("unregister",e))}static onDragStart(e){let{dragItem:t,dragIndex:o}=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?o:-1,dragItem:t,dragSourceListId:r,dropTargetListId:s})}),Pe.emitter.emit("drag-start",{dragSourceListId:r,dropTargetListId:s,dragItem:t,dragIndex:o})}static withDragMove(e,t){let{activeDragSource:o}=e,{listId:r}=o,i=[],a=!0,l=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=gp(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=hp(e,s);u&&t(s,u)}}static onDragMove(e){let{activeDragSource:t}=e,{listId:o,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:o,dropTargetListId:s,items:l?.items??[],dragItem:r,status:l?.status??"accepted",dragIndex:l?.dragIndex??-1,dropIndex:l?.dropIndex??-1})}static onDragDrop(e){let{activeDragSource:t}=e,{listId:o,dragItem:r}=t,i=null,a=[];Pe.withDragMove(e,(s,{event:u})=>{e.cancelled&&(u={...u,dropTargetListId:null,dropIndex:-1,outside:!1}),s.drop(u),a.push(u),u.outside||(i=u)});let l=i??a[0]??null;Pe.emit("drag-drop",{dragSourceListId:o,dropTargetListId:l?.dropTargetListId??null,items:l?.items??[],dragItem:r,status:l?.status??"accepted",dragIndex:l?.dragIndex??-1,dropIndex:l?.dropIndex??-1}),Pe.currentDragOperation=null,Pe.unregisterAll()}};Pe.dragInteractionTargetsMap=new Map,Pe.currentDragOperation=null,Pe.emitter=new Gn;var st=Pe,To=class n{static clone(e){let t=e.getData();return new n(t)}constructor(e){this.setData(e)}get listId(){return this.data.listId}get dragIndex(){return this.data.dragIndex??-1}get dragItem(){return this.data.dragItem}setData(e){St(this.data,e)||(this.data=e,this.dragRectangle=new Ae(this.data.dragItem.rect))}getData(){return this.data}static shift(e,t){let o=n.clone(e),r=Ae.from(o.dragRectangle);return r.shift(t),o.dragRectangle=r,o}},Wl=class extends Gn{constructor(t){super(t.listeners);this.phase="start";this.cancelled=!1;this.currentOffset={top:0,left:0};this.initialDragSource=To.clone(t.activeDragSource),this.activeDragSource=this.initialDragSource,this.startPoint={top:Math.round(t.startPoint.top),left:Math.round(t.startPoint.left)}}get offset(){return this.currentOffset}start(){let{listId:t,dragItem:o}=this.activeDragSource,r={dragSourceListId:t,dragItemId:o.id,startPoint:this.startPoint};return this.emit("start",this,r),r}drop(){this.phase="drop",this.emit("drop",this)}cancel(){this.cancelled=!0,this.drop()}move(t){if(this.phase!=="start"&&this.phase!=="move")return;this.phase="move";let o={top:Math.round(t.top-this.startPoint.top),left:Math.round(t.left-this.startPoint.left)};this.activeDragSource=To.shift(this.initialDragSource,o),this.currentOffset=o,this.emit("move",this)}};globalThis.DragManager=st;import{useEffect as IC}from"react";var yp=Qe.createContext({dragSourceListId:null,dropTargetListId:null,dragItemId:"",status:"accepted",updateDragOperationSourceAndTarget:n=>{},getCurrentDragSourceAndTarget:()=>({dragSourceListId:null,dropTargetListId:null,status:"accepted",dragItemId:""})}),Sn=()=>Qe.useContext(yp),Sp=Qe.createContext(""),Hn=n=>{let e=Qe.useContext(Sp);return e?`${n}-${e}`:n},jl=n=>{let[e,t]=Qe.useState({dragSourceListId:null,dropTargetListId:null,dragItemId:"",status:"accepted"}),o=Qe.useId(),r=Qe.useRef(e);r.current=e;let i=Qe.useCallback(()=>{let l=r.current;return{dragSourceListId:l.dragSourceListId,dropTargetListId:l.dropTargetListId,dragItemId:l.dragItemId,status:l.status}},[]),a=Qe.useMemo(()=>({dragSourceListId:e.dragSourceListId,dropTargetListId:e.dropTargetListId,dragItemId:e.dragItemId,status:e.status,updateDragOperationSourceAndTarget:t,getCurrentDragSourceAndTarget:i}),[e,t]);return IC(()=>{let l=st.on("drag-start",c=>{t({dragSourceListId:c.dragSourceListId,dropTargetListId:c.dropTargetListId,dragItemId:c.dragItem.id,status:"accepted"})}),s=st.on("drag-move",c=>{let d=r.current,p={dragSourceListId:c.dragSourceListId,dropTargetListId:c.dropTargetListId,dragItemId:c.dragItem.id,status:c.status};JSON.stringify(d)!==JSON.stringify(p)&&t(p)}),u=st.on("drag-drop",()=>{t({dragSourceListId:null,dropTargetListId:null,dragItemId:"",status:"accepted"})});return()=>{l(),s(),u()}},[st,t]),Qe.createElement(Sp.Provider,{value:o},Qe.createElement(yp.Provider,{value:a},typeof n.children=="function"?n.children(a):n.children))};var yi="header",Si="grouping-toolbar";var Ul=`${pt}Body`,bp=n=>n.querySelector(`.${Ul}`);var Kn=`${pt}HeaderCell`,$l=`${pt}HeaderWrapper`,Tp=n=>Array.from(n.querySelectorAll(`.${$l}`));function or(n){if(!n)return!1;let e=n.tagName;return e==="INPUT"||e==="BUTTON"}var wC=$(Y.baseZIndexForCells),vC=(n,e)=>{let t=!n||Object.keys(n).length===0,o=!e||Object.keys(e).length===0;return t&&o?!0:!!n!=!!e?!1:St(n,e)},Rp=({columnId:n,domRef:e,horizontalLayoutPageIndex:t,allowColumnHideOnDrag:o})=>{let[r,i]=Ip(null),[a,l]=Ip(!1),{getCurrentDragSourceAndTarget:s}=Sn(),u=Hn(Si),{getComputed:c,getState:d,api:p,computedDraggable:f,rootRef:m,actions:g}=ee(y=>({actions:y.actions,getComputed:y.getComputed,getState:y.getState,api:y.api,computedDraggable:y.computed.computedVisibleColumnsMap.get(n)?.computedDraggable,rootRef:y.state.domRef})),h=Cp(y=>{let C=c().computedVisibleColumnsMap.get(n);if(!C||!C.computedSortable)return;let{multiSortBehavior:T}=d();p.toggleSortingForColumn(n,{multiSortBehavior:T==="replace"&&(y.ctrlKey||y.metaKey)?"append":T})},[]),S=Cp(y=>{if(or(y.target))return;let{brain:C,draggableColumnsRestrictTo:T}=d(),{computedVisibleColumns:I,computedVisibleColumnsMap:b,computedPinnedStartColumns:R,computedUnpinnedColumns:w,computedPinnedEndColumns:v}=c(),P=b.get(n);if(!P.computedDraggable){h(y);return}let x=e.current,M=x.getBoundingClientRect(),D=m.current.getBoundingClientRect(),E=C.getAvailableSize(),z=P.computedVisibleIndex,V=C.getVirtualColIndex(P.computedVisibleIndex,{pageIndex:t||0}),N=C.isHorizontalLayoutBrain?C.getPageWidth():null,L=x.style.cursor??"auto",F=!1,K=m.current,q=Ae.from(bp(K).getBoundingClientRect()),_=Tp(K).map(ue=>Ae.from(ue.getBoundingClientRect())),k=q.getMinimumBoundingRectangle(..._),H=fp({brain:C,horizontalLayoutPageIndex:t,allowColumnHideOnDrag:o,pageWidth:N,draggableColumnsRestrictTo:T,computedPinnedEndColumns:v,computedPinnedStartColumns:R,computedUnpinnedColumns:w,computedVisibleColumns:I,computedVisibleColumnsMap:b,dragColumnHeaderTargetRect:M,dragColumnId:n,getCurrentDragSourceAndTarget:s,groupingToolbarDragListId:u,api:p,infiniteDOMNode:m.current,setProxyPosition:i,setDragColumnOutside:l,tableRect:D,acceptDropToReorderRect:k,initialMousePosition:{clientX:y.clientX,clientY:y.clientY}}),Z=null,Ce,le;function fe(ue){let{columnPinning:ne,columnOrder:se}=ue;vC(d().columnPinning,ne)||(g.columnPinning=ne);let de=c().computedColumnOrder;JSON.stringify(se,de)&&(g.columnOrder=Bl({newColumnOrder:se,visibleColumnOrder:c().computedVisibleColumns.map(X=>X.id),existingColumnOrder:de,dragColumnId:n}))}let we=ue=>{let{headerBrain:ne,brain:se}=d();if(!F){F=!0;let de=se.keepColumnRendered(V),X=ne.keepColumnRendered(V);if(se.isHorizontalLayoutBrain){let B=se.extendRenderRange({start:!0,end:!0,direction:"horizontal"}),re=ne.extendRenderRange({start:!0,end:!0,direction:"horizontal"});le=()=>{B(),re()}}Ce=()=>{de(),X()},g.columnReorderDragColumnId=P.id,t!=null&&(g.columnReorderInPageIndex=t),Ll(z,`calc( var(${wC}) + 10000 )`,m.current),m.current?.classList.add(zl),x.style.cursor="grabbing"}Z=H.onMove(ue)},ve=ue=>{let ne=ue.pointerId;requestAnimationFrame(()=>{let{multiSortBehavior:se}=d(),de=m.current;de?.classList.remove(zl),H.stop(),C.update({...E}),Ce?.(),le?.(),x.style.cursor=L,x.hasPointerCapture?.(ne)&&x.releasePointerCapture(ne),x.removeEventListener("pointermove",we),x.removeEventListener("pointerup",ve),i(null);let X=p.getColumnApi(P.id)?.isSortable()??!1;!F&&X&&p.toggleSortingForColumn(P.id,{multiSortBehavior:se==="replace"&&(ue.ctrlKey||ue.metaKey)?"append":se}),RC(()=>{Z?fe(Z):F&&o&&p.setVisibilityForColumn(P.id,!1),g.columnReorderDragColumnId=!1,t!=null&&(g.columnReorderInPageIndex=null)}),I.forEach(Q=>{pi(Q.computedVisibleIndex,de),er(Q.computedVisibleIndex,"",de),Jo(Q.computedVisibleIndex,"",de)}),Ll(z,fi(P,{pinnedStartColsCount:R.length,visibleColsCount:I.length}),de)})};x.addEventListener("pointermove",we),x.addEventListener("pointerup",ve),x.setPointerCapture(y.pointerId)},[n,t,u]);return{onPointerDown:f?S:h,dragColumnOutside:a,proxyPosition:r}};import*as Po from"react";import*as Te from"react";import{useCallback as ct,useContext as ZC,useEffect as QC,useMemo as JC,useReducer as eI,useSyncExternalStore as tI}from"react";var vp=Symbol("REPAINT_CELLS_KEY_NO_ROW");function Pp(n){return typeof n=="function"}function wp(n,e){let{column:t,rowIndex:o,rowInfoStore:r,getDataSourceState:i}=e,a=r.getRowInfoAtIndex(o);if(!a)return vp;let l=r.getDataSourceStates();return n({rowInfo:a,column:t,dataSourceState:l.dataSourceState??i(),previousDataSourceState:l.previousDataSourceState})}function Dp(n,e,t){let o=wp(n,e);return e.rowInfoStore.subscribeToDataArrayChange(()=>{let r=wp(n,e);r!==vp&&(Object.is(r,o)||(o=r,t()))})}var xp="_1eexc2a7 _1eexc2a6",Mp=ge({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"]]}),Ep=ge({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 Ap="_1eexc2a5",bi=ge({defaultClassName:"_1eexc2aa",variantClassNames:{direction:{up:"_1eexc2ab",down:"_1eexc2ac",neutral:"_1eexc2ad"}},defaultVariants:{},compoundVariants:[]}),Co="_1eexc2a8";import*as Ti from"react";import{useEffect as PC,useRef as DC}from"react";var _p="qz8ht90 _16lm1iwk";function xC(){return{checked:1,disabled:n=>n??!1,domProps:1}}var{ManagedComponentContextProvider:MC}=Et({forwardProps:xC,mappedCallbacks:{checked:n=>({callbackName:"onChange",callbackParams:[n]})},debugName:"InfiniteCheckBox"});function EC(){let{componentState:n,componentActions:e}=At(),{checked:t,domProps:o,disabled:r}=n,i=DC(null);return PC(()=>{i.current.indeterminate=t==null},[t]),Ti.createElement("input",{...o,className:U("InfiniteCheckBox",_p,o?.className),type:"checkbox",ref:i,checked:!!t,disabled:r,onChange:()=>{r||(e.checked=!t)}})}function bn(n){return Ti.createElement(MC,{...n},Ti.createElement(EC,null))}var AC="*",je=class{constructor(e){this.wildcard=AC;this.cache=new j;this.selectedRowsToColumns=new Map;this.selectedColumnsToRows=new Map;this.deselectedRowsToColumns=new Map;this.deselectedColumnsToRows=new Map;this.defaultSelection=!1;this.debugId="";this.deselectAll=()=>{this.update({defaultSelection:!1,selectedCells:[]})};this.selectAll=()=>{this.update({defaultSelection:!0,deselectedCells:[]})};let t=e&&e instanceof Object.getPrototypeOf(this).constructor?e.getState():e;t&&this.update(t)}selectCell(e,t){this.setCellSelected(e,t,!0)}deselectCell(e,t){this.setCellSelected(e,t,!1)}selectColumn(e){this.setCellSelected(this.wildcard,e,!0)}deselectColumn(e){this.setCellSelected(this.wildcard,e,!1)}setCellSelected(e,t,o){let r=e===this.wildcard,i=t===this.wildcard;if(this.isCellSelected_Internal(e,t)===o)return;let l=[];if(r){let 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),o)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,o){if(o){let r=this.deselectedRowsToColumns.get(e)||new Set;r.add(t),this.deselectedRowsToColumns.set(e,r)}else{let r=this.deselectedRowsToColumns.get(e);r&&(r.delete(t),r.size===0&&this.deselectedRowsToColumns.delete(e))}if(o){let r=this.deselectedColumnsToRows.get(t)||new Set;r.add(e),this.deselectedColumnsToRows.set(t,r)}else{let r=this.deselectedColumnsToRows.get(t);r&&(r.delete(e),r.size===0&&this.deselectedColumnsToRows.delete(t))}}setCellInSelection(e,t,o){if(e===this.wildcard&&t===this.wildcard)throw new Error("rowId and colId cannot be used as a wildcard at the same time!");if(o){let r=this.selectedRowsToColumns.get(e)||new Set;r.add(t),this.selectedRowsToColumns.set(e,r)}else{let r=this.selectedRowsToColumns.get(e);r&&(r.delete(t),r.size===0&&this.selectedRowsToColumns.delete(e))}if(o){let r=this.selectedColumnsToRows.get(t)||new Set;r.add(e),this.selectedColumnsToRows.set(t,r)}else{let r=this.selectedColumnsToRows.get(t);r&&(r.delete(e),r.size===0&&this.selectedColumnsToRows.delete(t))}}update(e){let t=e.selectedCells||null,o=e.deselectedCells||null;this.selectedRowsToColumns.clear(),this.selectedColumnsToRows.clear(),this.deselectedRowsToColumns.clear(),this.deselectedColumnsToRows.clear(),this.cache.clear(),t&&t.forEach(([r,i])=>{this.setCellInSelection(r,i,!0)}),o&&o.forEach(([r,i])=>{this.setCellInDeselection(r,i,!0)}),this.defaultSelection=e.defaultSelection}isCellSelectionInRow(e,t){if(this.defaultSelection){let r=this.deselectedRowsToColumns.get(e);if(r){if(r.has(this.wildcard)){let i=this.selectedRowsToColumns.get(e);return i&&i.size>0?t.some(a=>i.has(a)):!1}return t.some(i=>!r.has(i))}return!0}let o=this.selectedRowsToColumns.get(e);if(o){if(o.has(this.wildcard)){let r=this.deselectedRowsToColumns.get(e);return r&&r.size>0?!t.every(a=>r.has(a)):!0}return t?t.some(r=>o.has(r)):!1}return!1}error(e){pn(`${this.debugId}:CellSelectionState`)(e)}isCellSelected(e,t){return e===this.wildcard||t===this.wildcard?(this.error("CellSelectionState.isCellSelected should not be called with wildcard"),!1):this.isCellSelected_Internal(e,t)}isCellSelected_Internal(e,t){let o=[e,t],{cache:r}=this,i=r.get(o);if(i!=null)return i;let a=()=>(r.set(o,!1),!1),l=()=>(r.set(o,!0),!0),s=this.deselectedColumnsToRows.get(this.wildcard),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((o,r)=>{o.forEach(i=>{e.push([r,i])})}),this.selectedRowsToColumns.forEach((o,r)=>{o.forEach(i=>{t.push([r,i])})}),{defaultSelection:this.defaultSelection,deselectedCells:e,selectedCells:t}}};function Tn(n,e){return e().dataArray[n]}function Ci(n){return n().dataArray}var mt=class{constructor(e){this.collapsedPathsMap=new j;this.expandedPathsMap=new j;this.collapsedIdsMap=new Map;this.expandedIdsMap=new Map;this._mode="path";this.defaultExpanded=!1;this.expandAll=()=>{this.update({defaultExpanded:!0,collapsedPaths:[]})};this.collapseAll=()=>{this.update({defaultExpanded:!1,expandedPaths:[]})};let t=e&&e instanceof Object.getPrototypeOf(this).constructor?e.getState():e;t&&this.update(t)}get mode(){return this._mode}reset(){this.collapsedPathsMap.clear(),this.expandedPathsMap.clear(),this.collapsedIdsMap.clear(),this.expandedIdsMap.clear()}destroy(){this.reset()}expandNode(e){this.setNodeExpanded(e,!0)}collapseNode(e){this.setNodeExpanded(e,!1)}setNodeExpanded(e,t){let{collapsedPathsMap:o,collapsedIdsMap:r,expandedPathsMap:i,expandedIdsMap:a,defaultExpanded:l,_mode:s}=this;s==="id"&&Array.isArray(e)&&(e=e[e.length-1]),t===l?t?s==="path"&&Array.isArray(e)?o.delete(e):r.delete(e):s==="path"&&Array.isArray(e)?i.delete(e):a.delete(e):t?s==="path"&&Array.isArray(e)?i.set(e,!0):a.set(e,!0):s==="path"&&Array.isArray(e)?o.set(e,!0):r.set(e,!0)}isNodeExpandedByPath(e){return this.isNodeExpanded(e)}isNodeExpandedById(e){return this.isNodeExpanded(e)}isNodeExpanded(e){if(this._mode==="id"&&Array.isArray(e)&&(e=e[e.length-1]),this._mode==="id"&&Array.isArray(e))throw`You try to check if a node is expanded by id (${e}) but your TreeExpandState is configured to use node paths.`;if(this._mode==="path"&&!Array.isArray(e))throw`You try to check if a node is expanded by path (${e}) but your TreeExpandState is configured to use node ids.`;return this.defaultExpanded?this._mode==="path"&&Array.isArray(e)?!this.collapsedPathsMap.has(e):!this.collapsedIdsMap.has(e):this._mode==="path"&&Array.isArray(e)?this.expandedPathsMap.has(e):this.expandedIdsMap.has(e)}update(e){if(this.defaultExpanded=e.defaultExpanded,this.reset(),e.expandedPaths||e.collapsedPaths){this._mode="path";let r=e.expandedPaths||null,i=e.collapsedPaths||null;if(r)for(let a=0,l=r.length;a<l;a++)this.expandedPathsMap.set(r[a],!0);if(i)for(let a=0,l=i.length;a<l;a++)this.collapsedPathsMap.set(i[a],!0);return}this._mode="id";let t=e.expandedIds||null,o=e.collapsedIds||null;if(t)for(let r=0,i=t.length;r<i;r++)this.expandedIdsMap.set(t[r],!0);if(o)for(let r=0,i=o.length;r<i;r++)this.collapsedIdsMap.set(o[r],!0)}getState(){if(this._mode==="path"){let o=Array.from(this.collapsedPathsMap.keys()),r=Array.from(this.expandedPathsMap.keys());return{defaultExpanded:this.defaultExpanded,collapsedPaths:o,expandedPaths:r}}let e=Array.from(this.collapsedIdsMap.keys()),t=Array.from(this.expandedIdsMap.keys());return{defaultExpanded:this.defaultExpanded,collapsedIds:e,expandedIds:t}}};var Yl=n=>Array.isArray(n)?new j(n.map(e=>[e,!0])):n,_C=(n,e)=>n.length-e.length,Je=class n{constructor(e,t){this.selectedPaths=null;this.deselectedPaths=null;this.defaultSelection=!1;this.selectionMap=new j;this.cache=new j;this.strictMode=!1;let o=e instanceof Object.getPrototypeOf(this).constructor,r=o?e.getState():e;this.setConfig(t||(o?e.config:{treePaths:new j})),this.disableStrictMode(),this.update(r),this.config.strictCheckPaths&&this.enableStrictMode()}getTreePaths(e){return e?Yl(e):this.config.treePaths}withTreePaths(e,t){let o=this.config.treePaths;t=this.getTreePaths(t);let r=t!==o;r&&this.xcache(),this.config.treePaths=t;let i=e(t);return this.config.treePaths=o,r&&this.xcache(),i}getLeafNodePaths(e=[],t){return this.withTreePaths(o=>o.getKeysForLeafNodesStartingWith(e),t)}forEachLeafNodePath(e,t=[],o){let r={selected:!1};this.withTreePaths(i=>{i.getLeafNodesStartingWith(t,a=>{r.selected=this.isNodeSelected(a.keys)===!0,e(a.keys,r)})},o)}getSelectedLeafNodePaths(e=[],t){let o=[];return this.withTreePaths(r=>{r.getLeafNodesStartingWith(e,i=>{this.isNodeSelected(i.keys)&&o.push(i.keys)})},t),o}getDeselectedLeafNodePaths(e=[],t){let o=[];return this.withTreePaths(r=>{r.getLeafNodesStartingWith(e,i=>{this.isNodeSelected(i.keys)||o.push(i.keys)})},t),o}isLeafNode(e){let{treePaths:t}=this.config;return t.has(e)?t.getKeysForLeafNodesStartingWith(e).length===1:null}getLeafNodesCount(e){return this.config.treePaths.getKeysForLeafNodesStartingWith(e).length}static from(e,t){return new n(e,t)}setConfig(e){let t=typeof e=="function"?e():e;this.config={treePaths:Yl(t.treePaths),strictCheckPaths:t.strictCheckPaths??!0,multiRowSelectionTarget:t.multiRowSelectionTarget,unfilteredTreePaths:t.unfilteredTreePaths?Yl(t.unfilteredTreePaths):void 0},this.xcache()}hasFilteredOutLeavesInside(e){let{multiRowSelectionTarget:t,unfilteredTreePaths:o,treePaths:r}=this.config;return t!=="visible"||!o||o===r?!1:o.getAllChildrenSizeFor(e)>r.getAllChildrenSizeFor(e)}setVisibleLeafNodesSelection(e,t){let{unfilteredTreePaths:o,treePaths:r}=this.config;this.xcache(),r.getKeysForLeafNodesStartingWith(e).forEach(i=>{o.getAllChildrenSizeFor(i)>0||(this.selectionMap.delete(i),this.isNodeSelected(i)!==t&&this.setSelectionForPath(i,t))}),this.xcache()}xcache(){this.cache.clear()}update(e){this.selectedPaths=e.selectedPaths||null,this.deselectedPaths=e.deselectedPaths||null;let{selectionMap:t,selectedPaths:o,deselectedPaths:r}=this;t.clear(),o?.forEach(i=>this.setSelectionForPath(i,!0)),r?.forEach(i=>this.setSelectionForPath(i,!1)),this.defaultSelection=e.defaultSelection,this.xcache()}setSelectionForPath(e,t){this.isPathAvailable(e)&&this.selectionMap.set(e,t)}getState(){let e=[],t=[];return this.selectionMap.topDownEntries().forEach(([o,r])=>{r?e.push(o):t.push(o)}),{defaultSelection:this.defaultSelection,selectedPaths:e,deselectedPaths:t}}deselectAll(){if(this.hasFilteredOutLeavesInside([])){this.setVisibleLeafNodesSelection([],!1);return}this.update({defaultSelection:!1,selectedPaths:[],deselectedPaths:[]})}selectAll(){if(this.hasFilteredOutLeavesInside([])){this.setVisibleLeafNodesSelection([],!0);return}this.update({defaultSelection:!0,deselectedPaths:[],selectedPaths:[]})}enableStrictMode(){this.strictMode=!0}disableStrictMode(){this.strictMode=!1}isPathAvailable(e){if(!this.strictMode)return!0;let{treePaths:t}=this.config;return t.has(e)}isNodeSelected(e){return this.isPathSelected(e)}isSelfSelected(e){return this.selectionMap.get(e)??null}cacheIt(e,t){return this.cache.set(e,t),t}getSelectionStateForNode(e,t){let o=this.cache.get(e);if(o)return o;if(this.isLeafNode(e)!==!1){let d=this.isSelfSelected(e);if(d!==null)return this.cacheIt(e,{selected:d,selectedCount:d?1:0,deselectedCount:d?0:1,leafCount:1})}let r=this.getLeafNodesCount(e),i=this.isSelfSelected(e),{selectionMap:a}=this,l=a.getKeysOfFirstChildOnEachBranchStartingWith(e,{excludeSelf:!0}).sort(_C);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:o}=this;if(!e.length)return t;let r=[...e];do{let i=o.get(r);if(i!==void 0)return i;r.pop()}while(r.length);return t}setNodeSelection(e,t){if(!e.length)return;if(this.hasFilteredOutLeavesInside(e)){this.setVisibleLeafNodesSelection(e,t);return}if(this.xcache(),this.selectionMap.getKeysStartingWith(e).forEach(r=>{this.selectionMap.delete(r)}),!(e.length===1&&this.defaultSelection===t)){if(this.setSelectionForPath(e,t),e.length>1){let r=e.slice(0,-1);this.isNodeSelected(r)===t&&this.setNodeSelection(r,t)}}}selectNode(e){this.setNodeSelection(e,!0)}deselectNode(e){this.setNodeSelection(e,!1)}toggleNodeSelection(e){this.setNodeSelection(e,!this.isNodeSelected(e))}getSelectedCount(){return this.getSelectionCountFor([]).selectedCount}getDeselectedCount(){return this.getSelectionCountFor([]).deselectedCount}getSelectionCountFor(e=[]){let{selectedCount:t,deselectedCount:o}=this.getSelectionStateForNode(e);return{selectedCount:t,deselectedCount:o}}destroy(){this.config=void 0,this.xcache(),this.selectionMap.clear()}};function Ro(n,e){return new Je(n,Io(e))}function Io(n){return()=>{let e=typeof n=="function"?n():n,{treePaths:t,unfilteredTreePaths:o,multiRowSelectionTarget:r}=e;return r==="visible"?{treePaths:t,unfilteredTreePaths:o,multiRowSelectionTarget:r}:{treePaths:o??t,multiRowSelectionTarget:r}}}var Ii=class{constructor(e){this.setNodeSelection=(e,t,o)=>{let{treeSelectionState:r,selectionMode:i}=this.getState();if(!this.isNodeSelectable(e)&&!o?.force)return;if(i==="single-row"){this.actions.treeSelection=t?e[e.length-1]:null;return}if(i!=="multi-row")throw"Selection mode is not multi-row or single-row";if(!(r instanceof Je))throw"Invalid tree selection";let a=new Je(r,Io(this.getState));a.setNodeSelection(e,t),this.getState().lastSelectionUpdatedNodePathRef.current={nodePath:e,selected:t},this.actions.treeSelection=a};this.getCallbackParam=e=>({dataSourceApi:this.dataSourceApi});this.getState=e.getState,this.actions=e.actions,this.dataSourceApi=e.dataSourceApi}getSelectedLeafNodePaths(e){let{treePaths:t}=this.getState(),o=e?.treeSelectionState||this.getState().treeSelectionState;return o?o.getSelectedLeafNodePaths(e?.rootNodePath,t):[]}getDeselectedLeafNodePaths(e){let{treePaths:t}=this.getState(),o=e?.treeSelectionState||this.getState().treeSelectionState;return o?o.getDeselectedLeafNodePaths(e?.rootNodePath,t):[]}getSelectedLeafRowInfos(e){let{treePaths:t}=this.getState(),o=e?.treeSelectionState||this.getState().treeSelectionState;if(!t||!o)return[];let r=e?.rootNodePath||[],i=[];return t.getLeafNodesStartingWith(r,a=>{if(o.isNodeSelected(a.keys)){let l=this.getRowInfoByPath(a.keys);l&&i.push(l)}},{excludeSelf:!0}),i}get allRowsSelected(){return this.getState().allRowsSelected}isNodeReadOnly(e){let t=this.getRowInfoByPath(e),o=this.getState().isNodeReadOnly;return t&&t.isTreeNode&&t.isParentNode&&o?o(t):!1}isNodeSelectable(e){let t=this.getRowInfoByPath(e),o=this.getState().isNodeSelectable;return t&&t.isTreeNode?o(t):!1}isNodeExpanded(e){let t=this.getState(),{isNodeExpanded:o,isNodeCollapsed:r,treeExpandState:i}=t,a=this.getRowInfoByPath(e);if(a){if(!a.isTreeNode||!a.isParentNode)return!1;if(r)return!o(a,i);if(o)return o(a,i)}return i.isNodeExpanded(e)}expandAll(){let e=new mt({defaultExpanded:!0,collapsedPaths:[]});this.getState().lastExpandStateInfoRef.current={state:"expanded",nodePath:null},this.actions.treeExpandState=e}collapseAll(){let e=new mt({defaultExpanded:!1,expandedPaths:[]});this.getState().lastExpandStateInfoRef.current={state:"collapsed",nodePath:null},this.actions.treeExpandState=e}expandNode(e,t){if(this.isNodeReadOnly(e)&&!t?.force)return;let o=this.getState(),r=new mt(o.treeExpandState);r.expandNode(e),this.getState().lastExpandStateInfoRef.current={state:"expanded",nodePath:e},this.actions.treeExpandState=r,o.onNodeExpand?.(e,this.getCallbackParam(e))}collapseNode(e,t){if(this.isNodeReadOnly(e)&&!t?.force)return;let o=this.getState(),r=new mt(o.treeExpandState);r.collapseNode(e),this.getState().lastExpandStateInfoRef.current={state:"collapsed",nodePath:e},this.actions.treeExpandState=r,o.onNodeCollapse?.(e,this.getCallbackParam(e))}toggleNode(e,t){let o=this.getState(),r=new mt(o.treeExpandState),i=!this.isNodeExpanded(e);this.isNodeReadOnly(e)&&!t?.force||(r.setNodeExpanded(e,i),this.getState().lastExpandStateInfoRef.current={state:i?"expanded":"collapsed",nodePath:e},this.actions.treeExpandState=r,i?o.onNodeExpand?.(e,this.getCallbackParam(e)):o.onNodeCollapse?.(e,this.getCallbackParam(e)))}getNodeDataByPath(e){if(!e.length)return null;let t=this.getRowInfoByPath(e);return t?t.data:null}getRowInfoByPath(e){let{pathToIndexMap:t}=this.getState(),o=t.get(e);return o!==void 0?Tn(o,this.getState):null}selectAll(){let{treeSelectionState:e,selectionMode:t}=this.getState();if(t!=="multi-row")throw"Selection mode is not multi-row";if(!(e instanceof Je))throw"Invalid node selection";let o=new Je(e,Io(this.getState));o.selectAll(),this.getState().lastSelectionUpdatedNodePathRef.current=null,this.actions.treeSelection=o}deselectAll(){let{treeSelectionState:e,selectionMode:t}=this.getState();if(t!=="multi-row")throw"Selection mode is not multi-row";if(!(e instanceof Je))throw"Invalid node selection";let o=new Je(e,Io(this.getState));o.deselectAll(),this.getState().lastSelectionUpdatedNodePathRef.current=null,this.actions.treeSelection=o}isNodeSelected(e){let{treeSelectionState:t,treeSelection:o,selectionMode:r}=this.getState();if(r==="single-row"){let i=e[e.length-1];return Array.isArray(o)?treeSelection.join(",")===e.join(","):o===i}if(r!=="multi-row")throw"Selection mode is not multi-row or single-row";if(!(t instanceof Je))throw"Invalid tree selection";return t.isNodeSelected(e)}selectNode(e,t){this.setNodeSelection(e,!0,t)}deselectNode(e,t){this.setNodeSelection(e,!1,t)}toggleNodeSelection(e,t){this.isNodeSelected(e)?this.deselectNode(e,t):this.selectNode(e,t)}};function ql(n){return n.map(Ht)}function Ht(n){if(_e().structuredClone)return _e().structuredClone(n);if(n===null||typeof n!="object")return n;if(Array.isArray(n))return ql(n);if(n instanceof Date)return new Date(n);if(n instanceof Set)return new Set(ql(Array.from(n)));if(n instanceof Map)return new Map(ql(Array.from(n)));let e={};for(let t in n)n.hasOwnProperty(t)&&(e[t]=Ht(n[t]));return e}function rr(n){return n}var Ri="____not_loaded_yet____";function Xl(n){return typeof n=="string"&&n.startsWith(Ri)}var Bn=Object.seal({data:null,field:null});var bt="____root____";function Cn(){return!1}function Zl(n){if(!n||!Object.keys(n).length)return{};let e={};for(let t in n)if(n.hasOwnProperty(t)){let o=n[t].initialValue;e[t]=typeof o=="function"?o():o}return e}function wi(n,e,t,o,r){if(!(!t||!Object.keys(t).length)){for(let i in t)if(t.hasOwnProperty(i)){let a=t[i];if(typeof a.reducer!="function")continue;let l=o[i],s=a.getter?a.getter(n)??null:a.field?n[a.field]:null;o[i]=a.reducer(l,s,n,e,r)}}}function Fp(n,e){let{marker:t,reducers:o={},pivot:r,groupBy:i,indexer:a,toPrimaryKey:l,cache:s,mappings:u}=n;t&&t.start();let c=new j;function d(S,y,C,T=0,I=[]){let b=!C.length||T===C.length-1,R=y[u?.values||"values"]||{};for(let w in R)if(R.hasOwnProperty(w)){let v=w;I.push(v),p.set(I,!0),S.set(I,{reducerResults:R[w][u?.totals||"totals"]||{},items:[]}),b||d(S,R[w],C,T+1,I),I.pop()}}let p=r?new j:void 0,f=[],m=Zl(o),g=Ht(m);e.visitDepthFirst((S,y,C,T)=>{let[I,...b]=y,R=S.children,w=c.get(b);if(w&&(w.cache=S.cache,w.childrenLoading=S.childrenLoading,w.childrenAvailable=S.childrenAvailable,w.error=S.error),b.length==i.length&&i.length){if(w){w.items=R;for(let P=0,x=b.length;P<x;P++){let M=b.slice(0,P),D=c.get(M);D&&(D.items=D.items||[],D.items=D.items.concat(R))}R=a.indexArray(R,{toPrimaryKey:l,cache:s,nodesKey:void 0})}return T?.()}for(let v=0,P=R.length;v<P;v++){if(!R[v]){let E={items:[],reducerResults:{},cache:!1,childrenLoading:!1,childrenAvailable:!1,isTree:!1,isGroupBy:!0};c.set([...b,`${Ri}${v}`],E);continue}let x=R[v].data,M=R[v].keys||[];if(M.length){let E=M[M.length-1];b.push(E)}let D={items:[],cache:!1,childrenLoading:!1,childrenAvailable:!1,commonData:x,totalChildrenCount:R[v].totalChildrenCount,totalChildrenCountUnfiltered:R[v].totalChildrenCountUnfiltered,reducerResults:R[v].aggregations||{},isTree:!1,isGroupBy:!0};if(c.set(b,D),r){let E=D.pivotDeepMap=new j,z=R[v].pivot;d(E,z,r,0,f)}M.length&&b.pop()}T?.()});let h={deepMap:c,groupParams:n,initialData:e,reducerResults:g};return r&&(h.topLevelPivotColumns=p,h.pivot=r),t&&t.end({details:[{name:"Group by fields",value:i.map(S=>S.field).join(", ")}]}),h}function Op(n,e,t,o,r,i,a,l,s,u=rr){let{items:c,reducerResults:d,pivotDeepMap:p}=n.get(e);if(c.push(o),a&&wi(o,r,a,d,e),i){for(let f=0,m=i.length;f<m;f++){let{field:g,valueGetter:h,toKey:S}=i[f],y=g?o[g]:null;h&&(Bn.data=o,Bn.field=g,y=h(Bn));let C=(S||u)(y,o);t.push(C),p.has(t)||(l.set(t,!0),p?.set(t,{reducerResults:Ht(s),items:[]}));let{reducerResults:T,items:I}=p.get(t);I.push(o),a&&wi(o,r,a,T,e)}t.length=0}}function Np(n,e,t,o,r,i,a,l){let{isLeafNode:s,getNodeChildren:u,toKey:c}=n,d=c(r),p=[...o,d],f=s(r);if(t.set(p,!0),f){for(let S=0,y=o.length;S<=y;S++){let C=o.slice(0,S),T=e.get(C),{reducerResults:I,items:b}=T;b.push(r),T.leavesAvailableCount++,T.totalLeafNodesCount++,a&&wi(r,i,a,I,C)}return}let m=Ht(l),g=[];e.set(p,{items:g,isTree:!0,isGroupBy:!1,node:r,reducerResults:m,cache:!1,childrenLoading:!1,childrenAvailable:!0,totalLeafNodesCount:0,leavesAvailableCount:0,treeNesting:o.length});let h=u(r);if(!(!h||!Array.isArray(h))){for(let S=0,y=h.length;S<y;S++){let C=h[S];Np(n,e,t,p,C,S,a,l)}a&&ir(a,m,g)}}function Ql(n,e){let{reducers:t,marker:o}=n;if(o){let u=Object.keys(t??{});o.start({details:u.length>0?[{name:"Reducers",value:u.join(", ")}]:void 0})}let r=Zl(t),i=Ht(r),a=new j,l=new j;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++)Np(n,a,l,[],e[u],u,t,r);t&&ir(t,i,e);let s={deepMap:a,treeParams:n,treePaths:l,initialData:e,reducerResults:i};return o&&o.end(),s}function Jl(n,e){let{marker:t,groupBy:o,defaultToKey:r=rr,pivot:i,reducers:a}=n;t&&t.start();let l=o.length,s=i?new j:void 0,u=new j,c=[],d=[],p=Zl(a),f=Ht(p);if(!l){let g={items:[],isTree:!1,isGroupBy:!0,cache:!1,childrenLoading:!1,childrenAvailable:!1,reducerResults:Ht(p)};i&&(g.pivotDeepMap=new j),u.set(c,g)}for(let g=0,h=e.length;g<h;g++){let S=e[g],y={};for(let C=0;C<l;C++){let{field:T,groupField:I,valueGetter:b,toKey:R}=o[C],w=T?S[T]:null;b&&(Bn.data=S,Bn.field=T,w=b(Bn));let v=(R||r)(w,S);if(y[T||I]=v,c.push(v),!u.has(c)){let P={items:[],isTree:!1,isGroupBy:!0,cache:!1,commonData:{...y},childrenLoading:!1,childrenAvailable:!1,reducerResults:Ht(p)};i&&(P.pivotDeepMap=new j),u.set(c,P)}Op(u,c,d,S,g,i,a,s,p,r)}l||Op(u,c,d,S,g,i,a,s,p,r),a&&wi(S,g,a,f,c),c.length=0}a&&(u.visitDepthFirst((g,h,S,y)=>{ir(a,g.reducerResults,g.items),i&&g.pivotDeepMap.visitDepthFirst(({items:C,reducerResults:T},I,b,R)=>{ir(a,T,C),R?.()}),y?.()}),ir(a,f,e));let m={deepMap:u,groupParams:n,initialData:e,reducerResults:f};return i&&(m.topLevelPivotColumns=s,m.pivot=i),t&&t.end({details:[{name:"Group by fields",value:o.map(g=>g.field).join(", ")}]}),m}function OC(n){let{groupParams:e,deepMap:t}=n,o=e.groupBy.length,r=[];return t.topDownKeys().reduce((i,a)=>{if(a.length===o){let l=t.get(a).items;i.push(...l)}return i},r),r}function FC(n,e){let{groupBy:t,groupKeys:o,parents:r,reducers:i,lazyLoad:a}=n,l=o.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 y in i)if(i.hasOwnProperty(y)){let T=i[y].field;T&&(f[T]=u[y]),T&&p[T]==null&&(p[T]=u[y])}}let m=!0,g=o[o.length-1],h=g;if(p!=null){let y=t[o.length-1];y&&y.field&&(h=p[y.field]),y&&y.toKey&&(h=y.toKey(h,p)),h=h??g}return typeof h=="string"&&h.startsWith(Ri)&&(m=!1,h=null),{data:p,reducerData:f,groupCount:s.length,groupData:s,groupKeys:o,isTreeNode:!1,rowSelected:!1,selectedChildredCount:0,deselectedChildredCount:0,id:`${o}`,collapsed:!1,dataSourceHasGrouping:!0,rowDisabled:!1,isCellSelected:Cn,hasSelectedCells:Cn,selfLoaded:m,error:n.error,parents:r,deepRowInfoArray:[],collapsedChildrenCount:0,collapsedGroupsCount:0,totalChildrenCount:n.totalChildrenCount,childrenAvailable:a?n.childrenAvailable:!0,childrenLoading:n.childrenLoading,indexInParentGroups:n.indexInParentGroups,indexInGroup:n.indexInGroup,indexInAll:n.indexInAll,directChildrenCount:n.directChildrenCount,directChildrenLoadedCount:a?n.directChildrenLoadedCount:n.directChildrenCount,value:h,rootGroupBy:t,groupBy:l===t.length?t:t.slice(0,l),isGroupRow:!0,pivotValuesMap:c,groupNesting:l,reducerResults:u}}function vi(n,e,t){return{...n,id:`duplicate_row_on_page_${t}_for__${n.id}`,indexInAll:e,duplicateOf:n.id}}function ir(n,e,t){if(n){for(let o in n)if(n.hasOwnProperty(o)){let r=n[o];r.done&&(e[o]=r.done(e[o],t))}}return e}function Lp(n,e,t,o,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:h,rowsPerPage:S}=r,{deepMap:y}=c,C=n.length,T=t[t.length-1],I=T?T.nodeExpanded:!0;for(let b=0;b<C;b++){let R=n[b],w=u(R,b),v=[...e,w];if(l(R)){let V={id:w,nodePath:v,isGroupRow:!1,data:R,treeNesting:a,totalLeafNodesCount:0,collapsedLeafNodesCount:0,isTreeNode:!0,isParentNode:!1,selfLoaded:!0,rowSelected:!1,rowDisabled:!1,isCellSelected:Cn,hasSelectedCells:Cn,dataSourceHasGrouping:!1,parentNodes:Array.from(t),indexInParentNodes:[...o,b],indexInParent:b,indexInAll:I?i.length:-1};p&&(V.rowSelected=p(V)),d&&(V.rowDisabled=d(V)),f&&f(V);let N=h&&S!=null&&S>0&&V.indexInAll%S===0?V.indexInAll/S:null;for(let L=0,F=t.length;L<F;L++){let K=t[L];if(I||(K.collapsedLeafNodesCount+=1),K.deepRowInfoArray.push(V),N!=null&&I){if(typeof h=="function"&&h(K)!==!0)continue;let q=vi(K,V.indexInAll,N);i[q.indexInAll]=q,V.indexInAll++}}I&&(i[V.indexInAll]=V);continue}let M=y.get(v)?.totalLeafNodesCount??0,D={dataSourceHasGrouping:!1,nodeExpanded:!1,selfExpanded:!1,nodePath:v,id:w,data:R,indexInAll:i.length,indexInParent:b,indexInParentNodes:[...o,b],totalLeafNodesCount:M,treeNesting:a,selfLoaded:!0,isParentNode:!0,isTreeNode:!0,isGroupRow:!1,deepRowInfoArray:[],parentNodes:Array.from(t),collapsedLeafNodesCount:0,rowSelected:!1,rowDisabled:!1,isCellSelected:Cn,hasSelectedCells:Cn,selectedLeafNodesCount:0,deselectedLeafNodesCount:0};if(p&&(D.rowSelected=p(D),g)){let V=g.getSelectionCountFor(D.nodePath);D.selectedLeafNodesCount=V.selectedCount,D.deselectedLeafNodesCount=V.deselectedCount}d&&(D.rowDisabled=d(D)),f&&f(D);let E=!0;if(m&&(D.selfExpanded=E=m(D)),I||(E=!1),D.nodeExpanded=E,I&&h&&S!=null&&S>0){let V=D.indexInAll,N=D.parentNodes;if(N.length>0&&V%S===0){let L=V/S,F=0;N.forEach(K=>{typeof h=="function"&&h(K)!==!0||(i.push(vi(K,V+F,L)),F++,D.indexInAll++)})}}I&&(i[D.indexInAll]=D);let z=s(R);Array.isArray(z)&&Lp(z,v,[...t,D],D.indexInParentNodes,r,i)}return i}function kp(n){let{dataArray:e,marker:t}=n;t&&t.start();let o=[];return Lp(e,[],[],[],n,o),t&&t.end(),{data:o}}function zp(n){let{marker:e,lazyLoad:t,groupResult:o,rowsPerPage:r,repeatWrappedGroupRows:i,withRowInfo:a,toPrimaryKey:l,groupRowsState:s,isRowDisabled:u,isRowSelected:c,rowSelectionState:d,generateGroupRows:p,reducers:f={}}=n,{groupParams:m,deepMap:g,pivot:h}=o,{groupBy:S}=m;e&&e.start({details:[{name:"Group by fields",value:S.map(b=>b.field).join(", ")}]});let y=[],C=[],T=[],I=[];return g.visitDepthFirst((b,R,w,v)=>{let P=b.items,x=R.length,M=s?.isGroupRowCollapsed(R)??!1;I.push(w);let D=FC({lazyLoad:t,groupBy:S,parents:Array.from(T),reducers:f,indexInGroup:w,indexInParentGroups:Array.from(I),indexInAll:y.length,groupKeys:R,error:b.error,totalChildrenCount:b.totalChildrenCount,childrenLoading:(b.childrenLoading||!M&&!b.childrenAvailable)&&t,childrenAvailable:b.childrenAvailable,directChildrenCount:R.length===S.length?b.items.length:g.getDirectChildrenSizeFor(R),directChildrenLoadedCount:0},b);if(c&&(D.rowSelected=c(D),d)){let L=d.getSelectionCountFor(D.groupKeys);D.selectedChildredCount=L.selectedCount,D.deselectedChildredCount=L.deselectedCount}u&&(D.rowDisabled=u(D));let E=T[T.length-1],z=E?.collapsed??!1;z&&(M=!0),D.collapsed=M;let V=p||M;if(z&&(V=!1),V){if(i&&r!=null&&r>0){let L=D.indexInAll,F=D.parents;if(F.length>0&&L%r===0){let K=L/r,q=0;F.forEach(_=>{typeof i=="function"&&i(_)!==!0||(y.push(vi(_,L+q,K)),q++,D.indexInAll++)})}}y.push(D),C.push(y.length-1)}D.collapsedChildrenCount=0,T.forEach(L=>{L.deepRowInfoArray.push(D),L.collapsedGroupsCount+=M?1:0}),E&&D.selfLoaded&&t&&(E.directChildrenLoadedCount+=1),a&&a(D),T.push(D);let N=!0;if(N){if(v)v();else if(!h){let L=y.length;M||(y.length+=P.length);let F=0;for(let K=0,q=P.length;K<q;K++){let _=P[K];if(!M&&i&&r!=null&&r>0){let Ce=L+K+F;if(Ce%r===0){let le=Ce/r;T.forEach(fe=>{if(typeof i=="function"&&i(fe)!==!0)return;let we=L+K+F;y[we]=vi(fe,we,le),F++,y.length++})}}let k=L+K+F,Z={id:_?l(_,k):`${R}-${K}`,data:_,isCellSelected:Cn,hasSelectedCells:Cn,dataSourceHasGrouping:!0,isTreeNode:!1,isGroupRow:!1,selfLoaded:!!_,rowSelected:!1,rowDisabled:!1,rootGroupBy:S,collapsed:M,groupKeys:R,parents:Array.from(T),indexInParentGroups:[...I,K],indexInGroup:K,indexInAll:k,groupBy:S,groupNesting:x+1,groupCount:D.groupCount};c&&(Z.rowSelected=c(Z)),u&&(Z.rowDisabled=u(Z)),a&&a(Z),T.forEach((Ce,le)=>{le===T.length-1&&_&&(Ce.directChildrenLoadedCount+=1),M&&(Ce.collapsedChildrenCount+=1),Ce.deepRowInfoArray.push(Z)}),M||(y[L+K+F]=Z)}}}T.pop(),I.pop()}),e&&e.end(),{data:y,groupRowsIndexes:C}}function In(n,e){return e.reduce((t,o)=>{let{field:r,valueGetter:i,toKey:a}=o,l=r?n[r]:i?.({data:n,field:r}),s=(a||rr)(l,n);return t.push(s),t},[])}var NC=new j,Vp=new WeakMap;function Pi(n){let{originalDataArray:e,groupBy:t,toPrimaryKey:o}=n;if(!e||!t.length)return NC;let r=Vp.get(e);if(r&&r.groupBy===t)return r.groups;let i=new j,a=t.length,l=[];return e.forEach(s=>{let u=In(s,t);l.length=0;for(let c=0;c<u.length;c++){l.push(u[c]);let d=i.get(l);d||(d={count:0},l.length===a&&(d.primaryKeys=[]),i.set(l,d)),d.count++,d.primaryKeys?.push(o(s))}}),Vp.set(e,{groupBy:t,groups:i}),i}function LC(n,e){let t=[];return n.getLeafNodesStartingWith(e,o=>{let r=o.value?.primaryKeys;if(r)for(let i=0;i<r.length;i++)t.push(r[i])}),t}var Oe=class n{constructor(e,t,o){this.selectedRows=null;this.deselectedRows=null;this.defaultSelection=!1;this.selectedMap=new j;this.deselectedMap=new j;this.onlyUsePrimaryKeys=!1;this.selectionCache=new j;this.selectionCountCache=new j;this.lazyEntries=null;this.lazyLoadedRows=null;this.lazyChildrenLoaded=null;this.lazyRowCounts=null;this.mapSet=(e,t)=>{Array.isArray(t)||(this.onlyUsePrimaryKeys?t=[t]:t=[...this.getGroupKeysForPrimaryKey(t),t]),this.xcache(),e==="selected"?this.selectedMap.set(t,!0):this.deselectedMap.set(t,!0)};this._selectedMapSet=e=>{this.mapSet("selected",e)};this._deselectedMapSet=e=>{this.mapSet("deselected",e)};let r=e instanceof Object.getPrototypeOf(this).constructor?e.getState():e;this.getConfig=t,this.onlyUsePrimaryKeys=t().onlyUsePrimaryKeys,o&&Object.assign(this,o),this.update(r)}getGroupKeysForPrimaryKey(e){let{indexer:t,groupBy:o}=this.getConfig(),r=t.getDataForPrimaryKey(e);return r?In(r,o):[]}getGroupDeepMap(){return this.getConfig().groupDeepMap}targetsVisibleRowsOnly(){let{multiRowSelectionTarget:e,someRowsFilteredOut:t}=this.getConfig();return e==="visible"&&!!t}targetsFilteredOutRows(){let{multiRowSelectionTarget:e,someRowsFilteredOut:t}=this.getConfig();return e!=="visible"&&!!t}getVisibleDataInsideGroup(e){let{postFilterDataArray:t,groupDeepMap:o}=this.getConfig();return e.length?o?.get(e)?.items??[]:t??[]}hasFilteredOutRowsInsideGroup(e){let t=this.getConfig();return t.someRowsFilteredOut?(e.length?Pi(t).get(e)?.count??0:t.originalDataArray?.length??0)>this.getVisibleDataInsideGroup(e).length:!1}setVisibleRowsSelection(e,t){let{groupBy:o,toPrimaryKey:r}=this.getConfig(),i=t?this.selectedMap:this.deselectedMap,a=t?this.deselectedMap:this.selectedMap;this.xcache(),this.getVisibleDataInsideGroup(e).forEach(l=>{let s=In(l,o),u=r(l),c=[...s,u];a.delete(c),this.isRowSelected(u,s)!==t&&i.set(c,!0)}),this.xcache()}getLazyUnfilteredCount(e){let t=this.getConfig();if(!(!t.lazyLoad||t.multiRowSelectionTarget==="visible"))return e.length?t.groupDeepMap?.get(e)?.totalChildrenCountUnfiltered:t.lazyUnfilteredCount}getLazyHiddenRowsCount(e){let t=e.length<this.getGroupByLength()?this.getLazyUnfilteredCount(e):void 0;if(t===void 0)return 0;let{groupDeepMap:o}=this.getConfig(),r=0;return this.getGroupKeysDirectlyInsideGroup(e).forEach(i=>{r+=this.getLazyUnfilteredCount(i)??(o?.get(i)?.totalChildrenCount||0)}),Math.max(t-r,0)}getLazyEntries(){let e=`${this.selectedMap.version}:${this.deselectedMap.version}`;if(this.lazyEntries?.version!==e){let t=new j;this.selectedMap.getKeysStartingWith([]).forEach(o=>t.set(o,!0)),this.deselectedMap.getKeysStartingWith([]).forEach(o=>t.set(o,!1)),this.lazyEntries={version:e,entries:t}}return this.lazyEntries.entries}getLazyRowCount(e){this.lazyRowCounts=this.lazyRowCounts??new j;let t=this.lazyRowCounts.get(e);if(t!==void 0)return t??void 0;let o=this.computeLazyRowCount(e);return this.lazyRowCounts.set(e,o??null),o}computeLazyRowCount(e){let t=this.getConfig(),o=this.getGroupByLength(),r=this.getLazyUnfilteredCount(e);if(r!==void 0)return r;if(!e.length&&!o)return t.totalCount;let i=e.length?t.groupDeepMap?.get(e):void 0,a=e.length?i?.totalChildrenCount:t.lazyGroupedRowCount;if(a!=null)return a;if(e.length===o)return i?.childrenAvailable?i.items.length:void 0;let l=t.groupDeepMap?.getKeysStartingWith(e,{excludeSelf:!0,depthLimit:1})??[];if(l.length)return l.reduce((s,u)=>s+(Xl(u[u.length-1])?1:this.getLazyRowCount(u)??1),0)}areLazyChildrenLoaded(e){this.lazyChildrenLoaded=this.lazyChildrenLoaded??new j;let t=this.lazyChildrenLoaded.get(e);if(t!==void 0)return t;let o=this.computeLazyChildrenLoaded(e);return this.lazyChildrenLoaded.set(e,o),o}computeLazyChildrenLoaded(e){let{groupDeepMap:t}=this.getConfig(),o=e.length?t?.get(e):void 0;return e.length&&!o?.childrenAvailable?!1:e.length===this.getGroupByLength()?this.getLazyLoadedRows(e).complete:(t?.getKeysStartingWith(e,{excludeSelf:!0,depthLimit:1})??[]).every(r=>!Xl(r[r.length-1]))}getLazyLoadedRows(e){this.lazyLoadedRows=this.lazyLoadedRows??new j;let t=this.lazyLoadedRows.get(e);if(!t){let{groupDeepMap:o,originalDataArray:r,toPrimaryKey:i,totalCount:a}=this.getConfig(),l=e.length?o?.get(e):void 0,s=l?l.items:r??[],u=l?l.totalChildrenCount:a,c=new Set,d=u==null||s.length>=u;for(let p=0;p<s.length;p++){let f=s[p];f==null?d=!1:c.add(i(f))}t={primaryKeys:c,complete:d},this.lazyLoadedRows.set(e,t)}return t}isLazyEntryFilteredOut(e){let{groupDeepMap:t}=this.getConfig(),o=this.getGroupByLength();for(let r=1;r<=e.length;r++){let i=e.slice(0,r-1);if(!(r>o?this.getLazyLoadedRows(i).primaryKeys.has(e[r-1]):!!t?.get(e.slice(0,r))))return this.areLazyChildrenLoaded(i)}return!1}getLazySelectionCountFor(e,t){let o=this.selectionCountCache.get(e);if(o!=null)return o;let r=this.getLazyEntries(),i=this.getGroupByLength()+1,a=this.getLazyUnfilteredCount([])!==void 0,l=0,s=0;r.getKeysOfFirstChildOnEachBranchStartingWith(e,{excludeSelf:!0,respectOrder:!1}).forEach(p=>{if(!a&&this.isLazyEntryFilteredOut(p))return;let f=r.get(p);if(p.length>=i){f?l++:s++;return}let m=this.getLazySelectionCountFor(p,f);l+=m.selectedCount,s+=m.deselectedCount});let u=this.getLazyRowCount(e),c=u===void 0?1:Math.max(u-l-s,0);t?l+=c:s+=c;let d={selectedCount:l,deselectedCount:s};return this.selectionCountCache.set(e,d),d}getGroupCount(e){if(e.length==0)return this.getLazyUnfilteredCount([])??this.getConfig().totalCount;if(this.targetsFilteredOutRows())return Pi(this.getConfig()).get(e)?.count??0;let o=this.getGroupDeepMap()?.get(e);return o?this.getLazyUnfilteredCount(e)??o.totalChildrenCount??(o.items.length||0):0}getGroupKeysDirectlyInsideGroup(e){let t=this.getConfig(),o={excludeSelf:!0,depthLimit:1};return this.targetsFilteredOutRows()?Pi(t).getKeysStartingWith(e,o):t.groupDeepMap?.getKeysStartingWith(e,o)||[]}getAllPrimaryKeysInsideGroup(e){let t=this.getConfig(),{groupDeepMap:o,toPrimaryKey:r}=t;if(this.targetsFilteredOutRows())return e.length?LC(Pi(t),e):(t.originalDataArray??[]).map(r);if(!t.groupBy.length)return this.getVisibleDataInsideGroup([]).map(r);if(!e.length)return(o?.getKeysStartingWith([],{excludeSelf:!0,depthLimit:1})||[]).map(l=>this.getAllPrimaryKeysInsideGroup(l)).flat();let i=o?.get(e);return i?i.items.map(this.getConfig().toPrimaryKey):[]}getGroupByLength(){return this.getConfig().groupBy.length}static from(e,t,o){return new n(e,t,o)}update(e){this.selectedRows=e.selectedRows||null,this.deselectedRows=e.deselectedRows||null,this.selectedMap.clear(),this.deselectedMap.clear(),this.selectedRows?.forEach(this._selectedMapSet),this.deselectedRows?.forEach(this._deselectedMapSet),this.defaultSelection=e.defaultSelection,this.xcache()}xcache(){this.selectionCache.clear(),this.selectionCountCache.clear(),this.lazyLoadedRows=null,this.lazyChildrenLoaded=null,this.lazyRowCounts=null}getState(){let e=r=>{let i=this.getGroupByLength();return r.map(a=>this.onlyUsePrimaryKeys||i===0&&a.length===1?a[0]:a)},t=e(this.selectedMap.topDownKeys()),o=e(this.deselectedMap.topDownKeys());return{defaultSelection:this.defaultSelection,selectedRows:t,deselectedRows:o}}deselectAll(){if(this.targetsVisibleRowsOnly()){this.onlyUsePrimaryKeys?this.deselectGroupRow([]):this.setVisibleRowsSelection([],!1);return}this.update({defaultSelection:!1,selectedRows:[],deselectedRows:[]})}selectAll(){if(this.targetsVisibleRowsOnly()){this.onlyUsePrimaryKeys?this.selectGroupRow([]):this.setVisibleRowsSelection([],!0);return}this.update({defaultSelection:!0,deselectedRows:[],selectedRows:[]})}isRowDefaultSelected(){return this.defaultSelection===!0}isRowDefaultDeselected(){return this.defaultSelection===!1}isRowSelected(e,t){if(this.onlyUsePrimaryKeys)return this.defaultSelection?!this.deselectedMap.has([e]):this.selectedMap.has([e]);t=t||this.getGroupKeysForPrimaryKey(e);let o=[...t,e],r=this.selectionCache.get(o);if(r!==void 0)return r;let i=this.selectedMap.has(o),a=this.deselectedMap.has(o);if(i)return this.selectionCache.set(o,!0),!0;if(a)return this.selectionCache.set(o,!1),!1;if(this.selectedMap.has(t))return this.selectionCache.set(o,!0),!0;if(this.deselectedMap.has(t))return this.selectionCache.set(o,!1),!1;for(t=[...t];t.length;){t.pop();let l=this.selectedMap.has(t),s=this.deselectedMap.has(t);if(l)return this.selectionCache.set(o,!0),!0;if(s)return this.selectionCache.set(o,!1),!1}return this.selectionCache.set(o,this.defaultSelection),this.defaultSelection}isRowDeselected(e,t){return!this.isRowSelected(e,t)}setRowSelected(e,t,o){t?this.setRowAsSelected(e,o):this.setRowAsDeselected(e,o)}getGroupRowSelectionState(e){let t=this.selectionCache.get(e);if(t!==void 0)return t;let{selectedCount:o,deselectedCount:r}=this.getSelectionCountFor(e,this.onlyUsePrimaryKeys?void 0:this.getGroupRowBooleanSelectionStateFromParent(e)),i=o&&r?null:!!o;return this.selectionCache.set(e,i),i}getGroupRowBooleanSelectionStateFromParent(e){if(!e.length)return this.defaultSelection;let t=[...e],o=this.deselectedMap.has(t),r=this.selectedMap.has(t),i=r&&!o?!0:o&&!r?!1:void 0;if(i===void 0)for(;t.length;){if(t.pop(),this.deselectedMap.has(t)){i=!1;break}if(this.selectedMap.has(t)){i=!0;break}}return i===void 0&&(i=this.defaultSelection),i}isGroupRowPartlySelected(e){return this.getGroupRowSelectionState(e)===null}isGroupRowSelected(e){return this.getGroupRowSelectionState(e)===!0}isGroupRowDeselected(e){return this.getGroupRowSelectionState(e)===!1}selectGroupRow(e){if(this.onlyUsePrimaryKeys){this.getAllPrimaryKeysInsideGroup(e).forEach(i=>{this.defaultSelection===!0?this.deselectedMap.delete([i]):this._selectedMapSet(i)}),this.xcache();return}if(this.targetsVisibleRowsOnly()&&this.hasFilteredOutRowsInsideGroup(e)){this.setVisibleRowsSelection(e,!0);return}this.selectedMap.getKeysStartingWith(e,{excludeSelf:!0}).forEach(r=>{this.selectedMap.delete(r)}),e.length===1&&this.defaultSelection===!0||this._selectedMapSet(e),this.deselectedMap.getKeysStartingWith(e).forEach(r=>{this.deselectedMap.delete(r)}),this.xcache()}deselectGroupRow(e){if(this.onlyUsePrimaryKeys){this.getAllPrimaryKeysInsideGroup(e).forEach(i=>{this.defaultSelection===!1?this.selectedMap.delete([i]):this._deselectedMapSet(i)}),this.xcache();return}if(this.targetsVisibleRowsOnly()&&this.hasFilteredOutRowsInsideGroup(e)){this.setVisibleRowsSelection(e,!1);return}this.deselectedMap.getKeysStartingWith(e,{excludeSelf:!0}).forEach(r=>{this.deselectedMap.delete(r)}),e.length===1&&this.defaultSelection===!1||this._deselectedMapSet(e),this.selectedMap.getKeysStartingWith(e).forEach(r=>{this.selectedMap.delete(r)}),this.xcache()}setRowAsSelected(e,t){if(this.onlyUsePrimaryKeys){this.defaultSelection?this.deselectedMap.delete([e]):this._selectedMapSet(e),this.xcache();return}t=t||this.getGroupKeysForPrimaryKey(e);let o=[...t,e];this.deselectedMap.delete(o),this.xcache(),this.getGroupRowSelectionState(t)!==!0&&(this._selectedMapSet(o),this.getGroupRowSelectionState(t)===!0&&this.selectGroupRow(t))}setRowAsDeselected(e,t){if(this.onlyUsePrimaryKeys){this.defaultSelection?this._deselectedMapSet(e):this.selectedMap.delete([e]),this.xcache();return}t=t||this.getGroupKeysForPrimaryKey(e);let o=[...t,e];this.selectedMap.delete(o),this.xcache(),this.getGroupRowSelectionState(t)!==!1&&(this._deselectedMapSet(o),this.getGroupRowSelectionState(t)===!1&&this.deselectGroupRow(t))}deselectRow(e,t){this.setRowSelected(e,!1,t)}selectRow(e,t){this.setRowSelected(e,!0,t)}toggleGroupRowSelection(e){this.getGroupRowSelectionState(e)===!0?this.deselectGroupRow(e):this.selectGroupRow(e)}toggleRowSelection(e,t){this.isRowSelected(e,t)?this.deselectRow(e,t):this.selectRow(e,t)}getSelectedCount(){return this.getSelectionCountFor([]).selectedCount}getDeselectedCount(){return this.getSelectionCountFor([]).deselectedCount}getSelectionCountFor(e=[],t){let o=this.selectionCountCache.get(e);if(o!=null)return o;let r=this.getGroupByLength();if(e.length>r){let u=this.isRowSelected(e)?{selectedCount:1,deselectedCount:0}:{selectedCount:0,deselectedCount:1};return this.selectionCountCache.set(e,u),u}if(this.getConfig().lazyLoad&&(!this.onlyUsePrimaryKeys||!r))return this.getLazySelectionCountFor(e,t??this.getGroupRowBooleanSelectionStateFromParent(e));if(this.onlyUsePrimaryKeys&&(r||this.targetsVisibleRowsOnly())){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}if(e.length===r&&this.targetsVisibleRowsOnly()){let{toPrimaryKey:u}=this.getConfig(),c=0,d=0;this.getVisibleDataInsideGroup(e).forEach(f=>{this.isRowSelected(u(f),e)?c++: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;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 wo(n,e){return new Oe(n,ut(e))}function ut(n){return()=>{let e=typeof n=="function"?n():n,{originalDataArray:t,postFilterDataArray:o}=e,r=!!e.lazyLoad,i=r?e.originalLazyGroupData.get([bt]):void 0;return{lazyLoad:r,toPrimaryKey:e.toPrimaryKey,onlyUsePrimaryKeys:!e.useGroupKeysForMultiRowSelection,groupBy:e.groupBy,groupDeepMap:e.groupDeepMap,indexer:e.indexer,totalCount:r?t?.length??0:e.unfilteredCount,lazyGroupedRowCount:e.groupBy.length?i?.totalChildrenCount:void 0,lazyUnfilteredCount:e.groupBy.length?i?.totalChildrenCountUnfiltered:i?.totalCountUnfiltered,multiRowSelectionTarget:e.multiRowSelectionTarget,someRowsFilteredOut:!e.lazyLoad&&!!t&&!!o&&o.length<t.length,originalDataArray:t,postFilterDataArray:o}}}function Gp(n){let{getDataSourceState:e,dataSourceActions:t}=n;return{get allRowsSelected(){return e().allRowsSelected},selectAll(){let{rowSelection:r,selectionMode:i}=e();if(i!=="multi-row")throw"Selection mode is not multi-row";if(!(r instanceof Oe))throw"Invalid row selection";let a=new Oe(r,ut(e));a.selectAll(),t.rowSelection=a},deselectAll(){let{rowSelection:r,selectionMode:i}=e();if(i!=="multi-row")throw"Selection mode is not multi-row";if(!(r instanceof Oe))throw"Invalid row selection";let a=new Oe(r,ut(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 Oe))throw"Invalid row selection";if(!i){let c=s.getDataForPrimaryKey(r);i=c?In(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 Oe))throw"Invalid row selection";if(!i){let d=s.getDataForPrimaryKey(r);i=d?In(d,u):[]}let c=new Oe(a,ut(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 Oe))throw"Invalid row selection";if(a==="multi-row"){if(!i){let d=s.getDataForPrimaryKey(r);i=d?In(d,u):[]}let c=new Oe(l,ut(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 Oe))throw"Invalid row selection";let s=new Oe(a,ut(e));s.selectGroupRow(r),t.rowSelection=s},deselectGroupRow(r){let{selectionMode:i,rowSelection:a,groupBy:l}=e();if(i!=="multi-row")throw'Selection mode should be "multi-row"';if(!l)throw"No grouping specified";if(!(a instanceof Oe))throw"Invalid row selection";let s=new Oe(a,ut(e));s.deselectGroupRow(r),t.rowSelection=s},toggleGroupRowSelection(r){let{selectionMode:i,rowSelection:a,groupBy:l}=e();if(i!=="multi-row")throw'Selection mode should be "multi-row"';if(!l)throw"No grouping specified";if(!(a instanceof Oe))throw"Invalid row selection";let s=new Oe(a,ut(e));s.toggleGroupRowSelection(r),t.rowSelection=s},getGroupRowSelectionState(r,i){let a=e(),{selectionMode:l,groupBy:s}=a,u=i?new Oe(i,ut(a)):a.rowSelection;if(l!=="multi-row")throw'Selection mode should be "multi-row"';if(!s)throw"No grouping specified";if(!(u instanceof Oe))throw"Invalid row selection";return u.getGroupRowSelectionState(r)},getSelectedPrimaryKeys:r=>{let i=e(),a=r?new Oe(r,ut(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}}}function Hp(n,e){Di(n,e),zC(n,e),e.detail===2&&kC(n,e),n.getState().onCellClick?.(n,e)}function kC(n,e){if(or(e.target))return;let{onCellDoubleClick:t}=n.getState(),o={preventEdit:!1};if(t){let a=t(n,e);a&&typeof a=="object"&&(o={...o,...a})}if(o.preventEdit)return;let i=n.getComputed().computedVisibleColumns[n.colIndex];n.api.startEdit({rowIndex:n.rowIndex,columnId:i.id})}function zC(n,e){let{getDataSourceState:t,getState:o,getComputed:r,rowIndex:i,colIndex:a,dataSourceActions:l}=n,s=t(),{selectionMode:u,cellSelection:c}=s;if(!c||u!=="multi-cell")return;let{multiCellSelector:d,computedVisibleColumns:p}=r(),{brain:f,debugId:m}=o(),{rowsPerPage:g}=f,h=p.length,S=new je(c);S.debugId=m??"",d.cellSelectionState=S;let y={rowIndex:i,colIndex:a};if(e.metaKey||e.ctrlKey)d.singleAddClick(y);else if(e.shiftKey){let C=!!o().wrapRowsHorizontally;d.multiSelectClick(y,C?{horizontalLayout:C,rowsPerPage:g,columnsPerSet:h}:{horizontalLayout:C})}else d.resetClick(y);l.cellSelection=S}function VC(n){return n.getState().multiRowSelectionWith!=="click"&&n.getComputed().renderSelectionCheckBox?"checkbox":"click"}function GC(n){return n?or(n)?!0:typeof n.closest!="function"?!1:!!n.closest(`.${Co}, [data-name="expand-collapse-icon"]`):!1}function Di(n,e,t=e.key?"keyboard":"click"){let{rowIndex:o,getDataSourceState:r,getComputed:i,dataSourceActions:a,dataSourceApi:l,api:s,cloneRowSelection:u,cloneTreeSelection:c}=n,{multiRowSelector:d}=i(),p=r(),{selectionMode:f,dataArray:m,isTree:g}=p;if(t==="click"&&GC(e.target))return!1;let h=m[o];if(!h||h.rowDisabled)return!1;if(g){if(!h.isTreeNode||!h.nodePath)return!1;let{isNodeSelectable:S}=p;if(S&&!S(h))return!1}if(f==="multi-row"){let S=VC(n);if(t==="click"&&S==="checkbox")return!1;let y=t==="checkbox"||t==="keyboard"&&S==="checkbox",C=()=>{e.shiftKey?d.multiSelectClick(o):y||e.metaKey||e.ctrlKey?d.singleAddClick(o):d.resetClick(o)};if(g){let{treeSelectionState:I}=p;if(!(I instanceof Je))return!1;let b=c(I);d.treeSelectionState=b,C(),d.treeSelectionState=void 0;let R=!e.shiftKey&&(y||e.metaKey||e.ctrlKey);return p.lastSelectionUpdatedNodePathRef&&(p.lastSelectionUpdatedNodePathRef.current=R?{nodePath:h.nodePath,selected:!!b.isNodeSelected(h.nodePath)}:null),a.treeSelection=b,!0}let{rowSelection:T}=p;return!T||typeof T!="object"?!1:(T=u(T),d.rowSelectionState=T,C(),a.rowSelection=T,!0)}else if(f==="single-row"){if(h.isGroupRow)return!1;let S=e.metaKey||e.ctrlKey||t!=="click";if(g){let{treeApi:C}=l;return S?C.toggleNodeSelection(h.nodePath):C.selectNode(h.nodePath),!0}let y=h.id;return S?s.rowSelectionApi.toggleRowSelection(y):s.rowSelectionApi.selectRow(y),!0}return!1}function Kp(n,e){let{getComputed:t,dataSourceActions:o,dataSourceApi:r}=n,i=t().multiRowSelector,a=i.lastPointerDown;i.lastPointerDown=void 0;let l=n.getDataSourceState;return Di({rowIndex:e,api:n,getComputed:t,getState:n.getState,getDataSourceState:l,dataSourceActions:o,dataSourceApi:r,cloneRowSelection:s=>wo(s,l),cloneTreeSelection:s=>Ro(s,l)},{key:"",metaKey:!1,ctrlKey:!1,shiftKey:a?.rowIndex===e&&a.shiftKey,preventDefault:()=>{}},"checkbox")}import*as ar from"react";import{useState as HC}from"react";var Bp="_96uiwi0 _16lm1iw1d _16lm1iwk _16lm1iw9",Wp=ge({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 jp="M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z",nF=Object.keys({size:1,expanded:1,defaultExpanded:1,onChange:1,style:1,disabled:1,className:1,direction:1});var xi=`${it}-expand-collapse`;function Wn(n){let{size:e=24,direction:t="start",disabled:o=!1}=n,[r,i]=HC(n.expanded??n.defaultExpanded),a=()=>{n.onChange?.(!r),gn("expanded",n)||i(!r)};ar.useEffect(()=>{gn("expanded",n)&&i(n.expanded)},[n.expanded]);let l=r?"expanded":"collapsed";return ar.createElement("svg",{"data-name":"expand-collapse-icon","data-state":l,"data-disabled":o,xmlns:"http://www.w3.org/2000/svg",height:`${e}px`,viewBox:"0 0 24 24",width:`${e}px`,style:n.style,onClick:o?void 0:a,className:U(n.className,Bp,uo.expandCollapse,Wp({direction:t||"start",expanded:r,disabled:o}),`${it}`,`${xi}`,`${xi}--${l}`,`${xi}--${t==="end"?"end":"start"}`,o?`${xi}--disabled`:"")},ar.createElement("path",{d:jp}))}function Up(n){return typeof n.field=="string"}function $p(n){let{column:e,rowInfo:t,fieldsToColumn:o}=n,r;if(e.groupByForColumn){if(t.isGroupRow){let i=t.groupBy[t.groupBy.length-1];(Array.isArray(e.groupByForColumn)||e.groupByForColumn===i)&&(r=i?o.get(i.field||i.groupField):void 0)}!r&&e.field&&(r=o.get(e.field))}return r}function Kt(n){let{getComputed:e,getDataSourceState:t,getState:o,rowIndex:r,columnId:i,api:a,dataSourceApi:l}=n,{dataArray:s}=t(),u=s[r],{isGroupRow:c,isTreeNode:d}=u,p=e().computedColumnsMap.get(i),{activeRowIndex:f,keyboardNavigation:m,isRowDetailEnabled:g}=o(),h=r===f&&m==="row",S=!g||typeof g=="function"&&!g(u)?!1:a.rowDetailApi.isRowDetailExpanded(u.id)?"expanded":"collapsed",{formattedValue:y,formattedValueContext:{rawValue:C}}=vo({column:p,rowInfo:u,rowDetailState:S,columnsMap:e().computedColumnsMap,context:n}),T=ft(p.id,n);return c?{api:a,dataSourceApi:l,column:p,columnApi:T,isParentNode:!1,isGroupRow:!0,isTreeNode:!1,nodeExpanded:!1,rowDetailState:!1,data:u.data,rowActive:h,rowInfo:u,rowSelected:u.rowSelected,value:y,rawValue:C}:d?u.isParentNode?{api:a,dataSourceApi:l,columnApi:T,column:p,nodeExpanded:u.nodeExpanded,isTreeNode:!0,isGroupRow:!1,isParentNode:!0,rowDetailState:S,data:u.data,rowActive:h,rowInfo:u,rowSelected:u.rowSelected,value:y,rawValue:C}:{api:a,dataSourceApi:l,columnApi:T,column:p,nodeExpanded:!1,isTreeNode:!0,isGroupRow:!1,isParentNode:!1,rowDetailState:S,data:u.data,rowActive:h,rowInfo:u,rowSelected:u.rowSelected,value:y,rawValue:C}:{api:a,dataSourceApi:l,columnApi:T,column:p,isTreeNode:!1,isParentNode:!1,isGroupRow:!1,nodeExpanded:!1,rowDetailState:S,data:u.data,rowActive:h,rowInfo:u,rowSelected:u.rowSelected,value:y,rawValue:C}}function Yp(n){return Xp(n.column,n.rowInfo)}function qp(n){let{column:e,context:t,rowInfo:o,visibleColumnIds:r}=n,i=$p({rowInfo:o,column:e,fieldsToColumn:n.fieldsToColumn,groupRenderStrategy:t.getState().groupRenderStrategy}),{getState:a}=t,{editingCell:l}=a(),s=vo(n),{formattedValueContext:u}=s,c=t.api.isEditorVisibleForCell({columnId:e.id,rowIndex:o.indexInAll}),d=Object.assign({rowIndexInHorizontalLayoutPage:n.rowIndexInHorizontalLayoutPage,horizontalLayoutPageIndex:n.horizontalLayoutPageIndex,column:n.column,inEdit:c,rowHasSelectedCells:!1},u,{editError:l&&l.primaryKey===o.id&&l.columnId===e.id&&!l.active&&l.accepted instanceof Error?l.accepted:void 0});Object.defineProperty(d,"rowHasSelectedCells",{get(){return o.hasSelectedCells(r)}});let p=typeof e.align=="function"?e.align({isHeader:!1,...d}):e.align??"start",f=typeof e.verticalAlign=="function"?e.verticalAlign({isHeader:!1,...d}):e.verticalAlign??"center";return{inEdit: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:KC({rowIndexInHorizontalLayoutPage:n.rowIndexInHorizontalLayoutPage,horizontalLayoutPageIndex:n.horizontalLayoutPageIndex,column:n.column,rowInfo:n.rowInfo,visibleColumnIds:n.visibleColumnIds,columnsMap:n.columnsMap,fieldsToColumn:n.fieldsToColumn,context:n.context,align:p,verticalAlign:f,formattedValueContext:u}),groupByColumnReference:i}}function KC(n){let{column:e,context:t,rowInfo:o,align:r,verticalAlign:i,visibleColumnIds:a,columnsMap:l,fieldsToColumn:s,formattedValueContext:u}=n,{value:c}=u,{api:d,getDataSourceState:p,getState:f,dataSourceApi:m}=t,{editingCell:g}=f(),{indexInAll:h}=o,S=p(),{selectionMode:y,cellSelection:C}=S,T=$p({rowInfo:o,column:e,fieldsToColumn:s,groupRenderStrategy:t.getState().groupRenderStrategy}),I=d.toggleGroupRow,b=C?.isCellSelected(o.id,e.id)??!1,R={column:e,columnsMap:l,fieldsToColumn:s,align:r,verticalAlign:i,cellSelected:b,rowHasSelectedCells:!1,horizontalLayoutPageIndex:n.horizontalLayoutPageIndex,rowIndexInHorizontalLayoutPage:n.rowIndexInHorizontalLayoutPage,...u,editError:g&&g.primaryKey===o.id&&g.columnId===e.id&&!g.active&&g.accepted instanceof Error?g.accepted:void 0,groupByColumn:T,selectionMode:y,api:d,dataSourceApi:m,toggleCurrentRowDetails:()=>d.rowDetailApi.toggleRowDetail(o.id),toggleRowDetails:d.rowDetailApi.toggleRowDetail,expandRowDetails:d.rowDetailApi.expandRowDetail,collapseRowDetails:d.rowDetailApi.collapseRowDetail,toggleCurrentTreeNode:()=>{m.treeApi.toggleNode(o.nodePath)},toggleTreeNode:m.treeApi.toggleNode,expandTreeNode:m.treeApi.expandNode,collapseTreeNode:m.treeApi.collapseNode,selectTreeNode:m.treeApi.selectNode,deselectTreeNode:m.treeApi.deselectNode,toggleTreeNodeSelection:m.treeApi.toggleNodeSelection,toggleCurrentTreeNodeSelection:()=>{o.isTreeNode&&m.treeApi.toggleNodeSelection(o.nodePath)},selectRow:d.rowSelectionApi.selectRow,deselectRow:d.rowSelectionApi.deselectRow,toggleRowSelection:d.rowSelectionApi.toggleRowSelection,toggleGroupRowSelection:d.rowSelectionApi.toggleGroupRowSelection,selectCell:()=>{d.cellSelectionApi.selectCell({rowId:o.id,colId:e.id})},deselectCell:()=>{d.cellSelectionApi.deselectCell({rowId:o.id,colId:e.id})},renderBag:{all:null,value:typeof c=="boolean"?`${c}`:c,selectionCheckBox:null,groupIcon:null,treeIcon:null},selectCurrentRow:()=>{if(!o.isTreeNode)return d.rowSelectionApi.selectRow(o.id,o.dataSourceHasGrouping?o.groupKeys:void 0)},deselectCurrentRow:()=>{if(!o.isTreeNode)return d.rowSelectionApi.deselectRow(o.id,o.dataSourceHasGrouping?o.groupKeys:void 0)},rowIndex:h,toggleGroupRow:I,toggleCurrentGroupRow:()=>{o.isGroupRow&&I(o.groupKeys)},toggleCurrentRowSelection:()=>{if(!(o.isGroupRow||o.isTreeNode))return d.rowSelectionApi.toggleRowSelection(o.id)},toggleCurrentGroupRowSelection:()=>{if(o.isGroupRow)return d.rowSelectionApi.toggleGroupRowSelection(o.isGroupRow?o.groupKeys:[])},rootGroupBy:S.groupBy,pivotBy:S.pivotBy};return Object.defineProperty(R,"rowHasSelectedCells",{get(){return o.hasSelectedCells(a)}}),R}function BC(n,e){if(!n.isGroupRow)return;let t=n.groupData;if(!t.length)return;let o=t[0][e];for(let r=1,i=t.length;r<i;r++)if(t[r][e]!==o)return;return o}function Xp(n,e){let{data:t,isGroupRow:o,dataSourceHasGrouping:r}=e,i=r?e.groupBy:void 0,a=o&&i&&n.groupByForColumn&&(Array.isArray(n.groupByForColumn)||n.groupByForColumn===i[i.length-1])?e.value:Up(n)?t?.[n.field]:null;return n.field&&e.isGroupRow&&e.reducerData&&e.reducerData[n.field]!=null&&(a=e.reducerData[n.field]),a===void 0&&e.isGroupRow&&n.groupByForColumn&&Up(n)&&(a=BC(e,n.field)),n.valueGetter&&!e.isGroupRow&&e.data&&(a=n.valueGetter({data:e.data,field:n.field})),a}function WC(n,e,t,o,r){let{rowSelected:i,indexInAll:a}=t,{activeRowIndex:l,keyboardNavigation:s}=o.getState(),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:n,rawValue:n,field:e.field}:t.isTreeNode?t.isParentNode?{rowInfo:t,isGroupRow:!1,isTreeNode:!0,isParentNode:!0,nodeExpanded:t.nodeExpanded,data:t.data,rowDetailState:r,rowSelected:i,rowActive:u,value:n,rawValue:n,field:e.field}:{rowInfo:t,isGroupRow:!1,isTreeNode:!0,isParentNode:!1,nodeExpanded:!1,data:t.data,rowDetailState:r,rowSelected:i,rowActive:u,value:n,rawValue:n,field:e.field}:{rowInfo:t,isGroupRow:!1,isTreeNode:!1,isParentNode:!1,nodeExpanded:!1,data:t.data,rowDetailState:r,rowSelected:i,rowActive:u,value:n,rawValue:n,field:e.field}}function vo(n){let{column:e,rowInfo:t,context:o,rowDetailState:r}=n,i=Xp(e,t),a=WC(i,e,t,o,r),l=e.valueFormatter?e.valueFormatter(a):i;return a.value=l,{formattedValue:l,formattedValueContext:a}}var Zp=ge({defaultClassName:"_7pupv01",variantClassNames:{align:{start:"_7pupv02",center:"_7pupv03",end:"_7pupv04"}},defaultVariants:{},compoundVariants:[]}),Qp="_7pupv00",Jp=ge({defaultClassName:"_7pupv05",variantClassNames:{align:{start:"_7pupv06",center:"_7pupv07",end:"_7pupv08"}},defaultVariants:{},compoundVariants:[]});var{rootClassName:ef}=Le,Zt=`${ef}Cell`,lr=`${ef}Cell_content`;var{rootClassName:jC}=Le,Bt=`${jC}ColumnCell`;var UC=$(Y.columnZIndexAtIndex),$C=$(Y.columnVisibilityAtIndex);function tf({rowInfo:n,column:e}){let t=0;if(n.dataSourceHasGrouping)if(n.isGroupRow){let o=e?.groupByForColumn,r=n.groupBy[n.groupBy.length-1],i=!!n.pivotValuesMap,a=i&&!!e?.field&&!!o&&!Array.isArray(o)&&(o.field??o.groupField)!==(r?.field??r?.groupField),l=i&&Array.isArray(o)&&n.groupNesting===n.rootGroupBy.length;t=a||l?n.groupNesting:n.groupNesting-1}else t=n.groupNesting;return{[$(pe.components.Row.groupNesting)]:t}}function nf({rowInfo:n}){return{[$(pe.components.Row.groupNesting)]:n.isTreeNode?n.isParentNode?n.treeNesting:n.treeNesting+1:0}}function es(n,e){return n?typeof n=="function"?n(e):n:void 0}function ts(n,e,t){return typeof e=="function"?{...n,...e(t)}:{...n,...e}}function of(n){let{column:e,rowInfo:t,rowIndex:o,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:h,rowActive:S,rowDisabled:y,rowSelected:C,cellSelected:T,cellSelection:I,getData:b,computedVisibleColumns:R,visibleColumnIds:w,computedColumnOrder:v,columnReorderInPageIndex:P}=n,x=w??R.map(fe=>fe.id),M=v,D,E={...c,visibleColumnIds:x,allColumnIds:M,rowIndex:o,get rowHasSelectedCells(){return D===void 0&&(D=t.hasSelectedCells(x)),D}},z=!!(t.isTreeNode&&(e.renderTreeIcon||e.renderTreeIconForLeafNode||e.renderTreeIconForParentNode)),V=typeof f=="function"?f(E):f,N;d?.className&&(N=es(d.className,u)),g&&(N=U(N,es(g,u))),e.className&&(N=U(N,es(e.className,u))),z&&(N=U(N,Jp({align:l})));let L;t.dataSourceHasGrouping&&e.groupByForColumn&&(L=tf({rowInfo:t,column:e})),z&&(L=nf({rowInfo:t})),p&&(L=typeof p=="function"?{...L,...p(E)}:{...L,...p}),m&&(L=ts(L,m,u)),d?.style&&(L=ts(L,d.style,u)),e.style&&(L=ts(L,e.style,u)),L=L||{},L.height=r,L.zIndex=`var(${UC}-${e.computedVisibleIndex})`,L.visibility=`var(${$C}-${e.computedVisibleIndex}, visible)`;let F=i!=null?i%2===1:(t.indexInAll!=null?t.indexInAll:o)%2===1,K=h?F?"odd":"even":!1,q=!1,_=!1,k=!1,H=!1;if(I&&T){let fe=b(),we=fe[t.indexInAll-1],ve=fe[t.indexInAll+1],ue=R[e.computedVisibleIndex+1],ne=R[e.computedVisibleIndex-1];q=we?!I.isCellSelected(we.id,e.id):!0,e.computedPinned==="end"&&e.computedFirstInCategory?_=!0:_=ne?!I.isCellSelected(t.id,ne.id):!0,e.computedPinned==="start"&&e.computedLastInCategory?k=!0:k=ue?!I.isCellSelected(t.id,ue.id):!0,H=ve?!I.isCellSelected(ve.id,e.id):!0}let Z=I&&T?{top:q,left:_,right:k,bottom:H}:null,Ce=P!=null?a!==P:!1,le=U(Z?Ep(Z):"",ci(e,[Bt,Zt],Mp,{dragging:!1,insideDisabledDraggingPage:Ce,zebra:K,align:l,verticalAlign:s,rowDisabled:y,rowActive:S,cellSelected:T,rowSelected:C,treeNode:t.isTreeNode?t.isParentNode?"parent":"leaf":!1,firstRow:t.indexInAll===0,firstRowInHorizontalLayoutPage:i===0,groupRow:t.isGroupRow,groupCell:t.isGroupRow?!!e.groupByForColumn:!1,rowExpanded:t.isGroupRow?!t.collapsed:!1}),N,V);return{style:L,className:le,cellSelectionBorders:Z,zebra:K,columnIsTree:z}}import*as Qt from"react";var YC=$(Y.columnWidthAtIndex),qC=$(Y.columnReorderEffectDurationAtIndex);function XC(n){let{cssEllipsis:e=!0,virtualized:t=!0,skipColumnShifting:o=!1,contentStyle:r,column:i,domRef:a,width:l,contentClassName:s,rowId:u,afterChildren:c,beforeChildren:d,cellType:p,cssPosition:f,renderChildren:m,horizontalLayoutPageIndex:g,...h}=n,S=typeof m=="function"?m():m,y={width:`var(${YC}-${i.computedVisibleIndex})`,transition:`transform var(${qC}-${i.computedVisibleIndex}, 0s)`,...h.style},C={...h,style:y,"data-column-id":i.id,"data-z-index":y.zIndex,className:U(h.className,Zt,xp),children:Qt.createElement(Qt.Fragment,null,d,Qt.createElement("div",{className:U(lr,e?_t:_c.hidden,s),style:r},S),c)};u!=null&&(C["data-row-id"]=`${u}`);let T=p==="body"?i.components?.ColumnCell:i.components?.HeaderCell;return T?Qt.createElement(T,{...C,ref:a}):Qt.createElement("div",{...C,ref:a})}var Mi=Qt.memo(XC);import*as jn from"react";import{useCallback as ns,useRef as rf}from"react";function af(){let{initialValue:n,setValue:e,confirmEdit:t,cancelEdit:o,readOnly:r}=os(),i=rf(null),a=rf(!1),l=jn.useCallback(c=>{i.current=c,c&&c.focus()},[]),s=ns(c=>{let{key:d}=c;d==="Enter"||d==="Tab"?t():d==="Escape"?(a.current=!0,o()):c.stopPropagation()},[]),u=ns(()=>{a.current||t()},[]);return jn.createElement(jn.Fragment,null,jn.createElement("input",{readOnly:r,ref:l,onKeyDown:s,onBlur:u,className:U(vc,Ac.none),type:"text",defaultValue:n,onChange:ns(c=>{e(c.target.value)},[])}))}function lf(n,e){let t=[];for(let o in n)n.hasOwnProperty(o)&&!e.hasOwnProperty(o)&&t.push(n[o]);return t}var sr=Te.createContext(null),nI=n=>{let{toggleCurrentRowDetails:e,rowDetailState:t}=n;return Te.createElement(Wn,{style:{visibility:t===!1?"hidden":"visible"},expanded:t==="expanded",onChange:e})},oI={display:"inline-block",visibility:"visible"},rs=n=>{let{rowInfo:e,toggleCurrentTreeNode:t,nodeExpanded:o,api:r}=n,i=r.getDataSourceState().isNodeReadOnly;return Te.createElement(Wn,{disabled:e.isTreeNode&&e.isParentNode?i(e):!1,style:oI,expanded:o,onChange:t})},rI=n=>{let{rowInfo:e,rowIndex:t,column:o,api:r}=n;e.isGroupRow&&o.groupByForColumn;let{components:i}=r.getState(),a=r.getDataSourceState().isNodeSelectable,l=i?.CheckBox||bn;return Te.createElement(l,{domProps:{className:Co},disabled:e.isTreeNode?!a(e):!1,onChange:()=>{Kp(r,t)},checked:e.rowSelected})};function iI(n){let{repaintCellsKey:e,column:t,rowIndex:o,rowInfoStore:r,getDataSourceState:i}=n,[,a]=eI(s=>s+1,0),l=Pp(e)?e:void 0;QC(()=>{if(l)return Dp(l,{column:t,rowIndex:o,rowInfoStore:r,getDataSourceState:i},a)},[l,t,o,r,i])}function aI(n){let{dataSourceStatePartialForCell:e,rowInfoStore:t,rowStyle:o,rowClassName:r,rowIndexInHorizontalLayoutPage:i,horizontalLayoutPageIndex:a,getData:l,visibleColumnIds:s,computedColumnOrder:u,cellStyle:c,cellClassName:d,repaintCellsKey:p,rowDetailState:f,width:m,column:g,onMouseLeave:h,onMouseEnter:S,onRowMouseEnter:y,onRowMouseLeave:C,rowIndex:T,rowHeight:I,columnsMap:b,fieldsToColumn:R,domRef:w,hidden:v,showZebraRows:P,getDataSourceState:x,dataSourceApi:M,dataSourceActions:D,getState:E,imperativeApi:z,componentActions:V,getComputed:N,getDataSourceMasterContext:L}=n,F=tI(ct(ie=>t.subscribeToRowIndex(T,ie),[t,T]),ct(()=>t.getRowInfoAtIndex(T),[t,T]));iI({repaintCellsKey:p,column:g,rowIndex:T,rowInfoStore:t,getDataSourceState:x});let K=!F,q=!g,_=Te.useRef(null),k=ct(ie=>{_.current=ie,w&&w(ie)},[w]),H=F??{id:"",indexInAll:T,rowSelected:!1,rowDisabled:!1,isCellSelected:()=>!1,hasSelectedCells:()=>!1,isGroupRow:!1,isTreeNode:!1,isParentNode:!1,treeNesting:0,nodePath:[],collapsed:!1,dataSourceHasGrouping:!1,selfLoaded:!0,data:{}},{rowSelected:Z}=H,Ce=N(),{activeRowIndex:le,keyboardNavigation:fe,columnReorderInPageIndex:we}=E(),ve=T===le&&fe==="row",ue={getState:E,getDataSourceState:x,getDataSourceMasterContext:L,actions:V,dataSourceActions:D,api:z,dataSourceApi:M},ne=H.rowDisabled,se=qp({horizontalLayoutPageIndex:a,rowIndexInHorizontalLayoutPage:i,column:g,rowInfo:H,rowDetailState:f,columnsMap:b,visibleColumnIds:s,fieldsToColumn:R,context:ue}),{stylingParam:de,renderParams:X,formattedValueContext:Q,renderFunctions:B,groupByColumnReference:re,inEdit:te}=se,{align:ae,verticalAlign:O}=X,A=X,ce=Te.useRef(A),he=y&&S?ie=>{let Ye={...Q,rowIndex:T};y(Ye,ie),S(ie)}:S,Re=C&&h?ie=>{let Me={...Q,rowIndex:T,rowInfo:H};C(Me,ie),h(ie)}:h,Se=ct(ie=>{let Me=g.computedVisibleIndex;E().cellClick({rowIndex:T,colIndex:Me,event:ie})},[T,g.computedVisibleIndex,fe]),xe=ct(ie=>{let Me=g.computedVisibleIndex;if(E().cellMouseDown({rowIndex:T,colIndex:Me,event:ie}),fe==="row"){ne||(V.activeRowIndex=T);return}fe==="cell"&&(V.activeCellIndex=[T,Me])},[T,ne,g.computedVisibleIndex,fe]),{selectionMode:Ue,cellSelection:Ke,isNodeReadOnly:tt}=e,nt=A.cellSelected;A.domRef=k,A.htmlElementRef=_,A.toggleCurrentTreeNode=ct(A.toggleCurrentTreeNode,[H]),A.selectCell=ct(A.selectCell,[H]),A.deselectCell=ct(A.deselectCell,[H]),A.selectCurrentRow=ct(A.selectCurrentRow,[H]),A.deselectCurrentRow=ct(A.deselectCurrentRow,[H]),A.toggleCurrentGroupRow=ct(A.toggleCurrentGroupRow,[H]),A.toggleCurrentRowSelection=ct(A.toggleCurrentRowSelection,[H]),A.toggleCurrentGroupRowSelection=ct(A.toggleCurrentGroupRowSelection,[H]),A.toggleCurrentTreeNodeSelection=ct(A.toggleCurrentTreeNodeSelection,[H]);let Ze=g.components?.Editor??af,$e=te?Te.createElement(uf,{contextValue:A},Te.createElement(Ze,null)):null,G=ct(dt(()=>{if(v||te)return null;if(ce.current=A,B.renderGroupIcon&&(A.renderBag.groupIcon=Te.createElement(Tt,{render:B.renderGroupIcon,renderParam:{...A,renderBag:{...A.renderBag}}})),B.renderSelectionCheckBox&&Ue=="multi-row"&&(A.renderBag.selectionCheckBox=Te.createElement(Tt,{render:rI,renderParam:A}),B.renderSelectionCheckBox!==!0&&(A.renderBag.selectionCheckBox=Te.createElement(Tt,{render:B.renderSelectionCheckBox,renderParam:{...A,renderBag:{...A.renderBag}}}))),H.isTreeNode){let{isParentNode:Ye}=H,ht;ht=(Ye?B.renderTreeIconForParentNode:B.renderTreeIconForLeafNode)||typeof B.renderTreeIcon=="function"?B.renderTreeIcon:Ye&&B.renderTreeIcon===!0?rs:void 0,ht===!0?ht=rs:ht&&(A.renderBag.treeIcon=Te.createElement(Tt,{render:rs,renderParam:A})),ht&&(A.renderBag.treeIcon=Te.createElement(Tt,{render:ht,renderParam:{...A,renderBag:{...A.renderBag}}}))}B.renderRowDetailIcon&&(A.renderBag.rowDetailsIcon=Te.createElement(Tt,{render:nI,renderParam:{...A,renderBag:{...A.renderBag}}}),typeof B.renderRowDetailIcon=="function"&&(A.renderBag.rowDetailsIcon=Te.createElement(Tt,{render:B.renderRowDetailIcon,renderParam:{...A,renderBag:{...A.renderBag}}}))),B.renderValue&&(A.renderBag.value=Te.createElement(Tt,{render:B.renderValue,renderParam:{...A,renderBag:{...A.renderBag}}})),H.isGroupRow&&B.renderGroupValue&&(A.renderBag.value=Te.createElement(Tt,{render:B.renderGroupValue,renderParam:{...A,renderBag:{...A.renderBag}}})),!H.isGroupRow&&B.renderLeafValue&&(A.renderBag.value=Te.createElement(Tt,{render:B.renderLeafValue,renderParam:{...A,renderBag:{...A.renderBag}}})),ce.current=A;let ie=A.renderBag.value;ie instanceof Date&&(ie=ie.toLocaleDateString());let Me=Te.createElement(Te.Fragment,null,ae!=="end"?A.renderBag.treeIcon:null,ae!=="end"?A.renderBag.groupIcon:null,ae!=="end"?A.renderBag.rowDetailsIcon:null,ae!=="end"?A.renderBag.selectionCheckBox:null,ie,ae==="end"?A.renderBag.selectionCheckBox:null,ae==="end"?A.renderBag.rowDetailsIcon:null,ae==="end"?A.renderBag.groupIcon:null,ae==="end"?A.renderBag.treeIcon:null);return g.render?Te.createElement(Tt,{render:g.render,renderParam:{...A,renderBag:{...A.renderBag,all:Me}}}):Me}),[g,v,te,f,g.renderTreeIcon||g.renderTreeIconForParentNode?tt:!1,...lf(A,{renderBag:!0,selectCell:!0,deselectCell:!0,selectCurrentRow:!0,deselectCurrentRow:!0,toggleCurrentGroupRow:!0,toggleCurrentRowDetails:!0,toggleCurrentRowSelection:!0,toggleCurrentGroupRowSelection:!0,toggleCurrentTreeNodeSelection:!0,toggleCurrentTreeNode:!0,rowHasSelectedCells:!0})]),{style:J,className:me}=of({column:g,rowInfo:H,rowIndex:T,rowHeight:I,rowIndexInHorizontalLayoutPage:i,horizontalLayoutPageIndex:a,align:ae,verticalAlign:O,stylingParam:de,formattedValueContext:Q,groupByColumnReference:re,rowStyle:o,rowClassName:r,cellStyle:c,cellClassName:d,showZebraRows:P,rowActive:ve,rowDisabled:ne,rowSelected:Z,cellSelected:nt,cellSelection:Ke,getData:l,visibleColumnIds:s,computedVisibleColumns:Ce.computedVisibleColumns,computedColumnOrder:u,columnReorderInPageIndex:we}),be=JC(()=>J,[J?JSON.stringify(J):null]),at=$e,oe=G(),W={domRef:k,cellType:"body",column:g,width:m,rowId:H.id,horizontalLayoutPageIndex:a,style:be,onMouseLeave:Re,onMouseEnter:he,onClick:Se,afterChildren:at,onMouseDown:xe,cssEllipsis:g.cssEllipsis??!0,className:me,renderChildren:ct(()=>oe,[G])},ot=sr.Provider;return q||K?Te.createElement("div",{ref:k,style:{display:"none"}}):Te.createElement(ot,{value:ce.current},Te.createElement(Mi,{...W}))}var sf=Te.memo(aI);function Ei(){return ZC(sr)}function os(){let{api:n,editingValueRef:e,editingCell:t}=ee(f=>({api:f.api,editingCell:f.state.editingCell,editingValueRef:f.state.editingValueRef})),{column:o,rowInfo:r}=Ei(),[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=n.confirmEdit,d=n.cancelEdit,p=n.rejectEdit;return{api:n,initialValue:i,value:a,readOnly:s,column:o,rowInfo:r,setValue:u,confirmEdit:c,cancelEdit:d,rejectEdit:p}}function ur(n){return n.render(n.renderParam)??null}function Tt(n){let e=sr.Provider;return Po.createElement(e,{value:n.renderParam},Po.createElement(ur,{render:n.render,renderParam:n.renderParam}))}function uf(n){let e=sr.Provider;return Po.createElement(e,{value:n.contextValue},n.children)}function Rn(n){let e=Ai.Provider;return Po.createElement(e,{value:n.renderParam},Po.createElement(ur,{render:n.render,renderParam:n.renderParam}))}import*as wn from"react";var cf="yhvuzb1",df="yhvuzb0";var is=Jr({"data-name":""}),as={[is["data-name"]]:"menu-icon"},pf=`[${is["data-name"]}="${as["data-name"]}"]`;var lI={width:"100%",pointerEvents:"none"},ls=U(`${it}-menu`,cf);function cr(n){let{style:e,className:t,domProps:o,reserveSpaceWhenHidden:r,menuVisible:i,children:a}=n,l={...lI,borderTop:`${pe.components.HeaderCell.menuIconLineWidth} solid currentColor`,...n.lineStyle};return wn.createElement("div",{...o,style:e,...as,onPointerDown:s=>s.stopPropagation(),className:U(t,dd({menuVisible:i,reserveSpaceWhenHidden:r}),it,`${it}-menu`,a==null?df:"")},a??wn.createElement(wn.Fragment,null,wn.createElement("div",{className:ls,style:l}),wn.createElement("div",{className:ls,style:l}),wn.createElement("div",{className:ls,style:l})))}import*as Do from"react";import{useEffect as sI,useState as yf}from"react";var ff="_1b8djff1 _16lm1iw1",mf={asc:"_1b8djff2",desc:"_1b8djff3",none:"_1b8djff4"},_i="_1b8djff5",gf="--_1b8djff0";var hf={transition:"width 0.25s, opacity 0.25s"},_N=Object.keys({direction:1,size:1,lineWidth:1,lineStyle:1,style:1,className:1,index:1,forceSize:1});function Oi(n){let[e,t]=yf(!0),[o,r]=yf(0),{direction:i,lineWidth:a=1,style:l,className:s,index:u}=n,c=u!=null&&u>0,d=n.size??16,p=Math.floor(d/4),f=i?[d-3*p,d-2*p,d-p]:[0,0,0];i===-1&&f.reverse();let m={...hf,borderTop:`${a}px solid currentColor`,...n.lineStyle,opacity:o};sI(()=>{let y=i!=0?1:0;if(!e&&y&&t(!0),y!==o){let C=requestAnimationFrame(()=>{r(y)});return()=>{cancelAnimationFrame(C)}}return()=>{}},[i,e]);let g=()=>{let C=!(o===0&&i===0);C!==e&&t(C)};if(!e&&!n.forceSize)return null;let h=i===1?"asc":i===-1?"desc":"none",S={};return i===-1&&(S.top="100%"),Do.createElement("div",{"data-name":"sort-icon",style:{...l,width:d,[gf]:`${a}px`},className:U(s,it,ff,mf[h],`${it}-sort`,`${it}-sort--${h}`)},c?Do.createElement("div",{"data-name":"index",style:S,className:md},u):null,Do.createElement("div",{className:_i,style:{width:f[0],...m},onTransitionEnd:g}),Do.createElement("div",{className:_i,style:{width:f[1],...m}}),Do.createElement("div",{className:_i,style:{width:f[2],...m}}))}import*as wf from"react";import{useCallback as Rf}from"react";function ss(n){return Math.max(n.width-zt(),0)}function Sf(n){let{context:e,column:t,diff:o,shareSpaceOnResize:r}=n,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 vl({shareSpaceOnResize:r,availableSize:ss(s),reservedWidth:l||0,dragHandleOffset:o,dragHandlePositionAfter:t.computedVisibleIndex,columnSizing:p,items:u.map(f=>({id:f.id,computedFlex:f.computedFlex,computedWidth:f.computedWidth,computedMinWidth:f.computedMinWidth,computedMaxWidth:f.computedMaxWidth}))})}import{useRef as Cf,useState as uI}from"react";import*as dr from"react";function bf(n,{columns:e,shareSpaceOnResize:t,domRef:o}){let r=e[n];return{resize(i){Ie.columnWidths.set(n,r.computedWidth+i,o.current);let a=n+1;if(t){let l=e[a];if(!l)return;Ie.columnWidths.set(a,l.computedWidth-i,o.current),l.computedPinned==="start"?Nl(l,i,o.current):Ie.columnOffsets.set(a,l.computedOffset+i,o.current);return}if(r.computedPinned!=="end"){if(r.computedPinned==="start"){for(let l=a,s=e.length;l<s;l++){let u=e[l];if(u.computedPinned==="start"){Nl(u,i,o.current);continue}u.computedPinned!=="end"&&Ie.columnOffsets.set(l,u.computedOffset+i,o.current)}return}for(let l=a,s=e.length;l<s;l++){let u=e[l];u.computedPinned||Ie.columnOffsets.set(l,u.computedOffset+i,o.current)}}}}}function Tf(n,e){let t=n[n.length-1];return{resize(o){let{columns:r,domRef:i}=e,a=r[n[0]],l=a.computedOffset,s=0,u=i.current;if(o.forEach((c,d)=>{s+=c;let p=n[d],f=r[p],m=f.computedWidth+c;Ie.columnWidths.set(p,m,u),f.computedPinned!=="end"&&(l&&Ie.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"&&Ie.columnOffsets.set(c,d.computedOffset+s,u)}}}}var Fi="zneyzh0 _16lm1iw2 _16lm1iw23 _16lm1iw2c _16lm1iw2a _16lm1iwm _16lm1iw35",Ni=ge({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"]]}),Li=ge({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:cI}=Le,dI=`${cI}HeaderCell_ResizeHandle`;function pI(n){let{brain:e,headerBrain:t}=ee(g=>({brain:g.state.brain,headerBrain:g.state.headerBrain})),o=Cf(null),[r,i]=uI(!1),a=Cf(r);a.current=r;let l=n.columns[n.columnIndex],s=n.horizontalLayoutPageIndex;if(!l)return null;let u=l.computedPinned,c=l.computedFirstInCategory,d=l.computedLastInCategory,p=()=>{},f=g=>{g.stopPropagation();let h=!!g.shiftKey,S=g.pointerId,y=g.clientX,C=g.target;if(e.isHorizontalLayoutBrain){let w=e.extendRenderRange({start:!0,end:!0,direction:"horizontal"}),v=t.extendRenderRange({start:!0,end:!0,direction:"horizontal"});p=()=>{w(),v()}}C.setPointerCapture(S);let T=bf(n.columnIndex,{columns:n.columns,shareSpaceOnResize:h,domRef:o}),I=(w,{done:v}={})=>{s&&(w=w/(s+1),v&&(w=Math.round(w))),u==="end"&&(w*=-1);let{adjustedDiff:P,constrained:x}=n.computeResize({diff:w,shareSpaceOnResize:h});return a.current!==x&&i(x),T.resize(P),P},b=w=>{I(Math.round(w.clientX-y))},R=w=>{C.releasePointerCapture(S),C.removeEventListener("pointermove",b),C.removeEventListener("pointerup",R);let v=Math.round(w.clientX-y),P=I(v,{done:!0});p(),T.resize(0),n.onResize({diff:P,shareSpaceOnResize:h})};C.addEventListener("pointermove",b),C.addEventListener("pointerup",R)},m=(u===!1||u==="start")&&d?{right:u==="start"?void 0:0}:u==="end"&&c?{right:void 0}:void 0;return dr.createElement("div",{ref:o,className:`${dI} ${Fi} ${Li({computedPinned:u,computedFirstInCategory:c,computedLastInCategory:d})}`,onPointerDown:f},dr.createElement("div",{style:m,className:Ni({constrained:r,computedPinned:u,computedFirstInCategory:c,computedLastInCategory:d})}))}var If=dr.memo(pI);function vf(n,e){let{computedVisibleColumns:t,getState:o,getComputed:r,actions:i}=ee(u=>({computedVisibleColumns:u.computed.computedVisibleColumns,getState:u.getState,getComputed:u.getComputed,actions:u.actions})),a=Rf(({diff:u,shareSpaceOnResize:c})=>Sf({context:{getState:o,getComputed:r},column:n,diff:u,shareSpaceOnResize:c}),[n,o,r]),l=Rf(({diff:u,shareSpaceOnResize:c})=>{let{columnSizing:d,reservedWidth:p}=a({diff:u,shareSpaceOnResize:c});c||(i.viewportReservedWidth=p),i.columnSizing=d},[a,i]);return n.computedResizable?wf.createElement(If,{horizontalLayoutPageIndex:e.horizontalLayoutPageIndex,columns:t,columnIndex:n.computedVisibleIndex,computeResize:a,onResize:l}):null}function fI(n,e){if(!n||!e)return null;let t=e.field||e.groupByForColumn,o=null,r=null;for(let i of n)(i.id===e.id||i.field===e.id)&&(o=i),t&&(i.id===t||i.field===t)&&(r=i);return o||r}function mI(n,e){return!n||!e?n===e:n.filter.type===e.filter.type&&n.filter.operator===e.filter.operator&&n.filter.value===e.filter.value&&!!n.disabled==!!e.disabled}var ki=class{constructor(){this.pending=new Map;this.applied=new Map;this.cancelListeners=new Map}schedule(e,t,o){let r=o.getFilterValueItem();this.isLastApplied(e,r)&&this.applied.delete(e);let i=this.pending.get(e);i&&clearTimeout(i.timeout);let a=setTimeout(()=>{this.pending.delete(e);let l=o.getFilterValueItem();if(!mI(l,r)&&!this.isLastApplied(e,l)){this.applied.delete(e),this.notifyCancel(e);return}o.apply(t);let s=o.getFilterValueItem();s&&s.filter.value===t?this.applied.delete(e):this.applied.set(e,t)},o.delay);this.pending.set(e,{timeout:a,typedOver:r})}cancel(e){let t=this.pending.get(e);t&&(clearTimeout(t.timeout),this.pending.delete(e),this.notifyCancel(e))}onCancel(e,t){let o=this.cancelListeners.get(e);return o||(o=new Set,this.cancelListeners.set(e,o)),o.add(t),()=>{o.delete(t),!o.size&&this.cancelListeners.get(e)===o&&this.cancelListeners.delete(e)}}isLastApplied(e,t){return!!t&&this.applied.has(e)&&t.filter.value===this.applied.get(e)}notifyCancel(e){this.cancelListeners.get(e)?.forEach(t=>t())}};function Pf(n){let{columnId:e,filterDelay:t,api:o}=n,r=a=>{o.setColumnFilter(e,a)};if(!(t>0))return r;let i=()=>fI(n.getDataSourceState().filterValue,n.getComputed().computedColumnsMap.get(e));return a=>{n.getState().pendingColumnFilters.schedule(e,a,{delay:t,getFilterValueItem:i,apply:r})}}import*as We from"react";import{useCallback as ms,useEffect as zi,useState as RI}from"react";var Df=ge({defaultClassName:"_16lm1iw3a _16lm1iw1",variantClassNames:{dragging:{true:"_16lm1iwn _16lm1iw1x"}},defaultVariants:{},compoundVariants:[]}),xf=ge({defaultClassName:"_16lm1iw3a _16lm1iw1 _16lm1iwo",variantClassNames:{active:{true:"_3dmbka5 _16lm1iw1k _3dmbka2"},draggingInProgress:{true:"_16lm1iw1x"}},defaultVariants:{},compoundVariants:[[{active:!1,draggingInProgress:!0},"_3dmbka3"]]});function Mf(n,e){return St(n,e)}var pr=class extends Gn{constructor(t){super();this.dragIndex=-1;this.breakpoints=[];this.activeDragSourcePosition="outside";this.previousAcceptsDropResult=!0;this.setData(t)}get listId(){return this.data.listId}setData(t){return Mf(this.data,t)?!1:(this.data=t,!0)}getData(){return this.data}isEqual(t){return Mf(this.data,t.getData())}acceptsSelfDrops(){return!this.data.acceptDropsFrom||this.data.acceptDropsFrom.includes(this.data.listId)}acceptsDrop(t){let o=!0;return typeof this.data.shouldAcceptDrop=="function"&&(o=this.data.shouldAcceptDrop(t)),o=!!o,o!==this.previousAcceptsDropResult&&(this.previousAcceptsDropResult=o,o?this.emit("accept-feedback",t):this.emit("reject-feedback",t)),o}adjustForScroll(t){this.breakpoints=this.breakpoints.map(o=>o-t),this.data.orientation==="vertical"?this.data.listRectangle.shift({top:-t,left:0}):this.data.listRectangle.shift({top:0,left:-t})}move(t){this.emit("move",t)}unregister(){this.emit("unregister",this)}start(t){let o=t.dragSourceListId===this.data.listId,{draggableItems:r}=this.data,i=r.length;this.breakpoints=r.map((a,l)=>o||l===i-1?this.data.orientation==="horizontal"?a.rect.left+a.rect.width/2:a.rect.top+a.rect.height/2:this.data.orientation==="horizontal"?a.rect.right:a.rect.bottom),this.activeDragSourcePosition=o?"inside":"outside",this.emit("start",t)}drop(t){let{dropIndex:o,dragIndex:r,items:i,dragSourceListId:a,dropTargetListId:l,dragItem:s,outside:u}=t,c=Array.from({length:i.length},(f,m)=>m),d=[];o===-1?d=c.filter(f=>f!==r):d=Vn(c,r,o>r?o-1:o);let p={dragIndex:r,dropIndex:o,dragItem:s,items:i,dragSourceListId:a,dropTargetListId:l,sortedIndexes:d,outside:u,status:t.status};this.emit("drop",p)}};var gI={startFromPercentage:.25,maxScrollAtPercentage:.05,maxPixelScroll:28,ease:n=>n**2,durationDampening:{stopDampeningAt:1200,accelerateAt:360}};function hI(n,e){let t=getComputedStyle(n),o=e==="vertical"?t.overflowY:t.overflowX;return o!=="auto"&&o!=="scroll"?!1:e==="vertical"?n.scrollHeight>n.clientHeight:n.scrollWidth>n.clientWidth}function yI(n,e){let t=n;for(;t&&!(t===document.documentElement||t===document.body);){if(hI(t,e))return t;t=t.parentElement}return null}function SI(n,e){return{startScrollingFrom:n*e.startFromPercentage,maxScrollValueAt:n*e.maxScrollAtPercentage}}var us=1;function Ef(n,e,t){if(n>e.startScrollingFrom)return 0;if(n<=e.maxScrollValueAt)return t.maxPixelScroll;if(n===e.startScrollingFrom)return us;let r=1-(n-e.maxScrollValueAt)/(e.startScrollingFrom-e.maxScrollValueAt);return Math.ceil(t.maxPixelScroll*t.ease(r))}function bI(n,e,t){let{accelerateAt:o,stopDampeningAt:r}=t.durationDampening,i=Date.now()-e;if(i>=r)return n;if(i<o)return us;let a=(i-o)/(r-o);return Math.max(us,Math.ceil(n*t.ease(a)))}function Af(n,e,t,o,r,i,a){if(n<e||n>t)return 0;let l=SI(o,r),s=n-e,u=t-n,c=u<s,d;return c?d=Ef(u,l,r):d=-Ef(s,l,r),d===0?0:a?(d>0?1:-1)*bI(Math.abs(d),i,r):d}var xo=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={...gI,...e.config}}start(e){this.scrollContainer=yI(e,this.orientation),this.scrollContainer&&(this.maxScrollTop=this.scrollContainer.scrollHeight-this.scrollContainer.clientHeight,this.maxScrollLeft=this.scrollContainer.scrollWidth-this.scrollContainer.clientWidth),this.dragStartTime=Date.now(),this.shouldUseDampening=!0,this.active=!0}getScrollContainer(){return this.scrollContainer}updatePointer(e){this.lastPointer=e,!this.rafId&&this.active&&this.scheduleScroll()}scheduleScroll(){this.rafId=requestAnimationFrame(()=>{if(this.rafId=null,!this.active||!this.scrollContainer)return;let e=this.computeScroll();if(e.top===0&&e.left===0)return;let t={top:this.scrollContainer.scrollTop,left:this.scrollContainer.scrollLeft},o=Math.max(0,Math.min(this.maxScrollTop,t.top+e.top)),r=Math.max(0,Math.min(this.maxScrollLeft,t.left+e.left));this.scrollContainer.scrollTop=o,this.scrollContainer.scrollLeft=r;let i={top:this.scrollContainer.scrollTop-t.top,left:this.scrollContainer.scrollLeft-t.left},a=i.top!==0||i.left!==0;a&&this.onScroll(i),this.active&&a&&this.scheduleScroll()})}computeScroll(){if(!this.scrollContainer)return{top:0,left:0};let e=this.scrollContainer.getBoundingClientRect();if(this.orientation==="vertical"){if(this.lastPointer.left<e.left||this.lastPointer.left>e.right)return{top:0,left:0}}else if(this.lastPointer.top<e.top||this.lastPointer.top>e.bottom)return{top:0,left:0};let t=0,o=0;return this.orientation==="vertical"?t=Af(this.lastPointer.top,e.top,e.bottom,e.height,this.config,this.dragStartTime,this.shouldUseDampening):o=Af(this.lastPointer.left,e.left,e.right,e.width,this.config,this.dragStartTime,this.shouldUseDampening),{top:t,left:o}}stop(){this.active=!1,this.rafId!=null&&(cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollContainer=null}};var cs="data-drag-list-id",Ct="data-drag-item-id",Mo="data-drag-item-list-id",_f=`[${Ct}]`,Of=()=>null,Ff=n=>{let{node:e,offset:t}=n;if(!t){e.style.transform="none";return}e.style.transform=`translate3d(${t.left}px, ${t.top}px, 0px)`},TI=n=>`${n.getAttribute(Ct)}`;function ds(n,e){let t=n.current?.querySelectorAll(_f)??[];return Array.from(t).filter(r=>r.getAttribute(Mo)===`${e}`)}function CI(n,e){let t=ds(n,e);return Array.from(t).map(r=>{let i=TI(r),a=r.getBoundingClientRect();return{id:i,rect:a}})}function II(n){let{domRef:e,orientation:t,dragListId:o}=n,r=CI(e,o),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=Ae.from({top:a,left:l,width:u-l,height:s-a});return{draggableItems:r,orientation:t,listId:o,listRectangle:c,acceptDropsFrom:n.acceptDropsFrom,shouldAcceptDrop:n.shouldAcceptDrop,initial:n.initial,preserveDragSpace:n.preserveDragSpace}}function Nf(n){return new pr(II(n))}function Lf(n,e){let t=document.querySelector(`[${cs}="${e}"]`);t?n.current=t:console.warn(`DragList with id "${e}" not found. You're probably not spreading the domProps to the parent element. Make sure you also include the "className" prop.`)}function kf(n,e){let t=n.current;t&&t!==e&&st.unregisterDragInteractionTarget(t),n.current=e,e&&st.registerDragInteractionTarget(e)}function zf(n){let{getProps:e,domRef:t,setInteractionTarget:o}=n;return st.on("register",r=>{let{dragListId:i,acceptDropsFrom:a,orientation:l,shouldAcceptDrop:s}=e(),u=r.getData();if(u.initial&&u.listId!==i&&a?.includes(u.listId)){let c=Nf({domRef:t,orientation:l,dragListId:i,initial:!1,acceptDropsFrom:a,shouldAcceptDrop:s});r.once("unregister",()=>{o(null)}),o(c)}})}function ps(n,e){let t=n.cloneNode(!0);return t.removeAttribute(Ct),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 fs({proxyElement:n,dx:e,dy:t}){n.style.transform=`translate3d(${e}px, ${t}px, 0)`}function Vf(n){let e=n.current;e&&(e.cleanup?e.cleanup({proxyElement:e.proxyElement}):e.proxyElement.remove(),e.originalNode.style.visibility="",n.current=null)}function Gf(n,e,t){let o=n.current;return(!o||o.length===0)&&(o=ds(e,t),n.current=o),o}function Hf(n,e){let{dragListId:t,orientation:o,domRef:r,proxyStateRef:i,sourceScrollOffsetRef:a,dragItemsRef:l,getDragItems:s,getOnDrop:u,getOnAcceptDrop:c,getOnRemove:d,getUpdatePosition:p,updateDragOperationSourceAndTarget:f,updateDragProxyRenderState:m}=e,g=n.on("start",({dragItem:b,dragSourceListId:R,dropTargetListId:w})=>{f({dragSourceListId:R,dropTargetListId:w,dragItemId:b.id,status:"accepted"})}),h=n.on("move",({offsetsForItems:b,items:R,status:w,dragItem:v})=>{if(w==="rejected")return;let P=s(),x=p(),M=i.current;R.forEach((D,E)=>{let z=b[E],V=P[E];if(V&&!(M&&D.id===M.dragItemId)){if(!M&&D.id===v.id){let N=a.current;z={left:z.left+N.left,top:z.top+N.top}}x({id:D.id,node:V,offset:z})}})}),S=n.on("drop",b=>{let{sortedIndexes:R,dragIndex:w,dropIndex:v,dragItem:P,items:x,dragSourceListId:M,dropTargetListId:D,outside:E,status:z}=b,V=s();l.current=[];let N=c(),L=d(),F=u(),K=p();x.forEach((k,H)=>{let Z=V[H];Z&&K({id:k.id,node:Z,offset:null})}),Vf(i),m(k=>k&&(requestAnimationFrame(()=>m(Of)),{...k,dragItemId:null})),t===D&&M!==t&&N&&z==="accepted"&&N({dragItemId:P.id,dragSourceListId:M,dropTargetListId:D,dragIndex:w,dropIndex:v,dropItemId:x[v]?.id});let _=null;v===-1&&M===t&&D===t&&E&&(_=L),v!==-1&&D===t&&M===t&&(_=F),_&&_?.(R,{dragIndex:w,dropIndex:v,dragItemId:x[w].id,dropItemId:x[v]?.id})}),y=null,C=null,T=null,I=null;if(!n.getData().initial&&r.current){if(y=new xo({orientation:o,onScroll:()=>{}}),y.start(r.current),C=y.getScrollContainer(),C){let b=o==="vertical"?C.scrollTop:C.scrollLeft;T=()=>{let R=o==="vertical"?C.scrollTop:C.scrollLeft,w=R-b;b=R,w!==0&&(n.adjustForScroll(w),st.retriggerMove())},C.addEventListener("scroll",T)}I=b=>{y.updatePointer({left:b.clientX,top:b.clientY})},_e().addEventListener("pointermove",I)}return()=>{g(),h(),S(),y&&y.stop(),C&&T&&C.removeEventListener("scroll",T),I&&_e().removeEventListener("pointermove",I)}}function Kf(n,e,t){let{dragListId:o,orientation:r,acceptDropsFrom:i,preserveDragSpace:a,onDragProxySetup:l}=e,{domRef:s,proxyStateRef:u,sourceScrollOffsetRef:c,dragItemsRef:d,setInteractionTarget:p,updateDragProxyRenderState:f}=t,m=e.dragStrategy??"proxy",g=m==="proxy"&&!e.renderDragProxy,h=m==="proxy"&&!!e.renderDragProxy,S=e.onDragProxyMove??fs,y=n.currentTarget,C=y.getAttribute(Ct);if(C==null){let H=hn(y,_f);H&&(C=H.getAttribute(Ct))}if(C==null){console.warn("Could not find drag item id for element",y,`Make sure you have a parent element with a ${Ct} attribute`);return}C=`${C}`;let T=null,I=ds(s,o);d.current=I;let b=Nf({domRef:s,orientation:r,dragListId:o,acceptDropsFrom:i,initial:!0,preserveDragSpace:a}),R=b.getData().draggableItems,w=R.findIndex(H=>H.id===C);if(w===-1)return;let v=R[w],P=I[w]?.getAttribute(Ct)===`${C}`?I[w]:I.find(H=>H.getAttribute(Ct)===`${C}`);p(b);let x={left:n.clientX,top:n.clientY},M={left:n.clientX,top:n.clientY};c.current={top:0,left:0};let D=new xo({orientation:r,onScroll:()=>{}});s.current&&D.start(s.current);let E=D.getScrollContainer(),z=E?r==="vertical"?E.scrollTop:E.scrollLeft:0;function V(){T&&T.move({left:M.left,top:M.top})}let N=()=>{if(!E)return;let H=r==="vertical"?E.scrollTop:E.scrollLeft,Z=H-z;z=H,Z!==0&&(b.adjustForScroll(Z),r==="vertical"?c.current.top+=Z:c.current.left+=Z),V()};E?.addEventListener("scroll",N);let L=H=>{if(M={left:H.clientX,top:H.clientY},!T){if(T=st.startDrag({listId:o,dragItem:v,dragIndex:w},x),P&&g){let le=P.getBoundingClientRect(),fe=null,we={dragItemNode:P,dragItemId:`${C}`,initialRect:le,initialCoords:x,get proxyElement(){return fe||(fe=ps(P,le)),fe}},ve=l?.(we),ue=ve?.proxyElement??we.proxyElement;P.style.visibility="hidden",u.current={proxyElement:ue,originalNode:P,dragItemId:`${C}`,initialRect:le,cleanup:ve?.cleanup}}if(P&&h){let le=P.getBoundingClientRect();P.style.visibility="hidden",u.current={proxyElement:P,originalNode:P,dragItemId:`${C}`,initialRect:le,cleanup:()=>{}};let fe={dragItemId:`${C}`,initialRect:le,dx:0,dy:0};f(()=>fe)}}let Z=H.clientX-x.left,Ce=H.clientY-x.top;if(h)f(le=>le&&{...le,dx:Z,dy:Ce});else{let le=u.current;le&&S({proxyElement:le.proxyElement,dx:Z,dy:Ce})}D.updatePointer({left:H.clientX,top:H.clientY}),V()},F=H=>{H.preventDefault()},K=H=>{if(D.stop(),E?.removeEventListener("scroll",N),k.removeEventListener("pointermove",L),k.removeEventListener("pointerup",q),k.removeEventListener("pointercancel",_),k.removeEventListener("dragstart",F,!0),h&&(f(Z=>Z&&{...Z,dragItemId:null}),requestAnimationFrame(()=>{f(Of)})),!T){Vf(u),p(null);return}H?T.cancel():T.drop(),T=null},q=()=>K(!1),_=()=>K(!0),k=_e();k.addEventListener("pointermove",L),k.addEventListener("pointerup",q),k.addEventListener("pointercancel",_),k.addEventListener("dragstart",F,!0)}var Bf=We.createContext({dragItemId:null,onDragItemPointerDown:()=>{},draggingInProgress:!1,dragListId:"",status:"accepted",dragSourceListId:null,dropTargetListId:null}),Eo=()=>We.useContext(Bf);function wI(n,e){let t=Ne(e),[o,r]=We.useState(null),i=We.useRef(null),a=ms(s=>{kf(i,s),r(s)},[]),l=Ne(o);return zi(()=>()=>{st.unregisterDragInteractionTarget(i.current),i.current=null},[]),zi(()=>zf({getProps:t,domRef:n,setInteractionTarget:a}),[t]),{interactionTarget:o,setInteractionTarget:a,getInteractionTarget:l}}var Un=n=>{let e=We.useRef(null),t=We.useRef(null),[o,r]=RI(null),i=We.useRef({top:0,left:0}),a=We.useRef(null),l=We.useCallback(P=>{a.current=P},[]),{dropTargetListId:s,dragSourceListId:u}=Sn(),{updateDragOperationSourceAndTarget:c,dragItemId:d,status:p}=Sn(),f=Ne(n.onDrop),m=Ne(n.onAcceptDrop),g=Ne(n.onRemove),h=Ne(n.updatePosition??Ff),{interactionTarget:S,setInteractionTarget:y}=wI(e,n);zi(()=>{Lf(e,n.dragListId)},[n.dragListId]),zi(()=>{if(S)return Hf(S,{dragListId:n.dragListId,orientation:n.orientation,domRef:e,proxyStateRef:t,sourceScrollOffsetRef:i,dragItemsRef:C,getDragItems:T,getOnDrop:f,getOnAcceptDrop:m,getOnRemove:g,getUpdatePosition:h,updateDragOperationSourceAndTarget:c,updateDragProxyRenderState:r})},[S,n.dragListId]);let C=We.useRef([]),T=ms(()=>Gf(C,e,n.dragListId),[n.dragListId]),I=ms(P=>{Kf(P,n,{domRef:e,proxyStateRef:t,sourceScrollOffsetRef:i,dragItemsRef:C,setInteractionTarget:y,updateDragProxyRenderState:r})},[n.orientation,n.dragListId,n.acceptDropsFrom,n.removeOnDropOutside,n.dragStrategy,n.renderDragProxy,n.onDragProxySetup,n.onDragProxyMove]),b=!!d,R=We.useMemo(()=>({dragItemId:d,onDragItemPointerDown:I,dragSourceListId:u,dropTargetListId:s,status:p,dragListId:n.dragListId,draggingInProgress:b}),[d,I,b,u,s,n.dragListId]),w={className:U("DragList",b?"DragList--dragging":"",Df({dragging:b})),[cs]:n.dragListId},v=typeof n.children=="function"?n.children(w,R):n.children;return We.createElement(Bf.Provider,{value:R},v,o&&n.renderDragProxy?n.renderDragProxy({...o,ref:l}):null)},vI=We.createContext({dragItemId:"",dragListId:"",active:!1,draggingInProgress:!1,dragSourceListId:"",dropTargetListId:""}),PI=n=>{let{onDragItemPointerDown:e,draggingInProgress:t,dragListId:o,dragItemId:r,dragSourceListId:i,dropTargetListId:a}=Eo(),l=n.dragListId??o,s=i===l&&r===`${n.id}`,u=We.useMemo(()=>({dragItemId:n.id,active:s,dragListId:l,draggingInProgress:t,dragSourceListId:i,dropTargetListId:a}),[n.id,s,l,t,i,a]),c={[Ct]:`${n.id}`,[Mo]:l,onPointerDown:e,className:U("DraggableItem",s?"DraggableItem--active":"",xf({active:s,draggingInProgress:t}))},d=typeof n.children=="function"?n.children(c,u):n.children;return We.createElement(vI.Provider,{value:u},d)};Un.DraggableItem=PI;import*as gs from"react";var Wf=n=>gs.createElement(ke,{...n,icon:"hidden",viewBox:"0 -960 960 960"},gs.createElement("path",{d:ze.hidden[0]}));import*as br from"react";function jf(){return{}}var Uf=n=>({allowColumnHideWhileDragging:e=>e??!0});import{createContext as DI}from"react";var xI=DI(null);function hs(){return xI}import*as Ft from"react";import*as qn from"react";import{useCallback as Pm,useEffect as Ps,useLayoutEffect as oR,useRef as Dm,useState as rR}from"react";import*as Vi from"react";function MI(n){let{height:e,width:t,count:o}=n;return Vi.createElement("div",{"data-count":o,"data-placeholder-width":void 0,"data-placeholder-height":void 0,"data-name":"SpacePlaceholder",style:{height:e,width:t,zIndex:-1,opacity:0,pointerEvents:"none",contain:"strict"}})}var $f=Vi.memo(MI);var Yf="mlx2t3";import*as Gi from"react";import{useRef as AI}from"react";import{useEffect as EI}from"react";var qf=(n,e)=>{EI(()=>{let t=n?.current,o=i=>{let a=i.target;e?.({scrollTop:a.scrollTop,scrollLeft:a.scrollLeft})},r={passive:!1};return t?.addEventListener("scroll",o,r),()=>{t?.removeEventListener("scroll",o)}},[e,n?.current])};var Xf={true:"_1ueijco2",false:"_1ueijco3",visible:"_1ueijco4",auto:"_1ueijco5",hidden:"_1ueijco6"},Zf={true:"_1ueijco7",false:"_1ueijco8",visible:"_1ueijco9",auto:"_1ueijcoa",hidden:"_1ueijcob"},Qf={true:"_1ueijcoc",false:"_1ueijcod",visible:"_1ueijcoe",auto:"_1ueijcof",hidden:"_1ueijcog"},ys="_1ueijco1",Jf="_1ueijco0 _16lm1iw0";var em=n=>{let e="";return typeof n=="boolean"||typeof n=="string"?e=Xf[`${n}`]:e=U(Zf[`${n.horizontal}`],Qf[`${n.vertical}`]),e};var _I="InfiniteVirtualScrollContainer";var tm=Gi.forwardRef(function(e,t){let{children:o,scrollable:r=!0,onContainerScroll:i,className:a,tabIndex:l,style:s,autoFocus:u}=e,c=t??AI(null);return qf(c,i),Gi.createElement("div",{ref:c,style:s,autoFocus:u,tabIndex:l,className:U(a,_I,Jf,em(r))},o)});import*as Qi from"react";import{useLayoutEffect as Zi,useMemo as HI}from"react";import*as nm from"react";import{useLayoutEffect as OI,useRef as FI,useState as NI}from"react";function LI(n){let[e,t]=NI(n.updater.get),o=FI(null);return OI(()=>{function r(a){n.useraf?(o.current!=null&&cancelAnimationFrame(o.current),o.current=requestAnimationFrame(()=>{t(a)})):t(a)}let i=n.updater.onChange(r);return()=>{o.current!=null&&cancelAnimationFrame(o.current),i()}},[n.updater,n.useraf]),e??null}var vn=nm.memo(LI);var om=oo(zn());var Ss=(n,e)=>n-e,Jt={horizontal:!0,vertical:!0};function Hi(n,e){let t=e.length;if(!t)return 0;let o=-1;for(let r=0;r<t;r++){let i=0,a=0;if(t-r<=o)break;for(let l=r;l<t;l++)if(i+=e[l],a++,i>n){a>o&&(o=a);break}}return o<0?t:Math.min(o,t)}var bs="DebugID=";function Pn(n,e){return e&&e.startsWith(bs)?e:e?`${bs}${n}:${e}`:`${bs}${n}`}var Ki={start:0,end:0},Ts=n=>{n()},Cs=n=>{let{start:e,end:t}=n,[o,r]=e,[i,a]=t,l=i-o,s=a-r;return l*s},rm=n=>{let{start:e,end:t}=n,[o]=e,[r]=t;return r-o},fr=typeof window<"u"?requestAnimationFrame:n=>setTimeout(n,0);function kI(n){return n.horizontalChange||n.verticalChange}var $n=class extends yt{constructor(t){let o=Pn(t,`${t}:MatrixBrain`);super(o);this.scrolling=!1;this.RENDER_COUNT_SAFETY_MARGIN_START=1;this.RENDER_COUNT_SAFETY_MARGIN_END=1;this.availableWidth=0;this.availableRenderWidth=0;this.isHorizontalLayoutBrain=!1;this.name="";this.availableHeight=0;this.availableRenderHeight=0;this.cols=0;this.rows=0;this.alwaysRenderedColumns=new Set;this._rowsPerPage=0;this.rowHeight=0;this.colWidth=0;this.verticalTotalSize=0;this.horizontalTotalSize=0;this.horizontalRenderCount=void 0;this.verticalRenderCount=void 0;this.maxHorizontalRenderCount=0;this.maxVerticalRenderCount=0;this.horizontalExtendRangeBy=Ki;this.verticalExtendRangeBy=Ki;this.horizontalRenderRange={startIndex:0,endIndex:0};this.verticalRenderRange={startIndex:0,endIndex:0};this.extraSpanCells=[];this.scrollPosition={scrollLeft:0,scrollTop:0};this.largeContent={vertical:!1,horizontal:!1};this.scrollRatio={vertical:1,horizontal:1};this.scrollOrigin={scrollLeft:0,scrollTop:0};this.onScrollOriginChangeFns=new Set;this.onScrollFns=[];this.onRenderRangeChangeFns=new Set;this.onVerticalRenderRangeChangeFns=new Set;this.onHorizontalRenderRangeChangeFns=new Set;this.onDestroyFns=[];this.destroyed=!1;this.onRenderCountChangeFns=new Set;this.onAvailableSizeChangeFns=new Set;this.onScrollStartFns=[];this.onScrollStopFns=[];this.scrollTimeoutId=0;this.scrollStopDelay=250;this.fixedColsStart=0;this.fixedColsEnd=0;this.fixedRowsStart=0;this.fixedRowsEnd=0;this.setScrollStopDelay=t=>{this.scrollStopDelay=t};this.getRowCount=()=>this.rows;this.getColCount=()=>this.cols;this.onScrollOriginChange=t=>this.onScrollOriginChangeForBrain(t);this.setScrolling=t=>{let o=this.scrolling;this.scrolling=t,t&&(this.scrollTimeoutId&&clearTimeout(this.scrollTimeoutId),this.scrollTimeoutId=setTimeout(()=>{this.setScrolling(!1),this.scrollTimeoutId=0},this.scrollStopDelay)),t!==o&&(t?this.notifyScrollStart():this.notifyScrollStop())};this.notifyScrollStart=()=>{if(this.destroyed)return;let t=this.onScrollStartFns;for(let o=0,r=t.length;o<r;o++)t[o]()};this.notifyScrollStop=()=>{if(this.destroyed)return;let t=this.onScrollStopFns,o=this.scrollPosition,r=this.getRenderRange();for(let i=0,a=t.length;i<a;i++)t[i](o,r)};this.notifyAvailableSizeChange=()=>{if(this.destroyed)return;let t=this.onAvailableSizeChangeFns,o=this.getAvailableSize();t.forEach(r=>{fr(()=>{this.destroyed||t.has(r)&&r(o)})})};this.notifyVerticalRenderRangeChange=(t=!1)=>{if(this.destroyed)return;let o=this.onVerticalRenderRangeChangeFns,r=this.verticalRenderRange,i=t?Ts:fr;o.forEach(a=>{i(()=>{this.destroyed||o.has(a)&&a([r.startIndex,r.endIndex])})})};this.notifyHorizontalRenderRangeChange=(t=!1)=>{if(this.destroyed)return;let o=this.onHorizontalRenderRangeChangeFns,r=this.horizontalRenderRange,i=t?Ts:fr;o.forEach(a=>{i(()=>{this.destroyed||o.has(a)&&a([r.startIndex,r.endIndex])})})};this.isColFixedEnd=t=>this.fixedColsEnd?t>=this.cols-this.fixedColsEnd:!1;this.isColFixedStart=t=>this.fixedColsStart?t<this.fixedColsStart:!1;this.isRowFixedEnd=t=>this.fixedRowsEnd?t>=this.rows-this.fixedRowsEnd:!1;this.isRowFixedStart=t=>this.fixedRowsStart?t<this.fixedRowsStart:!1;this.isColFixed=t=>this.isColFixedStart(t)||this.isColFixedEnd(t);this.isRowFixed=t=>this.isRowFixedStart(t)||this.isRowFixedEnd(t);this.getFixedEndColsWidth=()=>{if(!this.fixedColsEnd)return 0;let t=0;for(let o=this.cols-this.fixedColsEnd;o<this.cols;o++)t+=this.getColWidth(o);return t};this.getFixedEndColsOffsets=({skipScroll:t}={skipScroll:!1})=>{if(!this.fixedColsEnd)return[];let{scrollLeft:o}=this.scrollPosition,{width:r}=this.getAvailableSize(),i=[],a=[],l=0;for(let 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:o);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:o}=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:o);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 o=0;o<this.fixedColsStart;o++)t+=this.getColWidth(o);return t};this.getFixedEndRowsHeight=()=>{if(!this.fixedRowsEnd)return 0;let t=0;for(let o=this.rows-this.fixedRowsEnd;o<this.rows;o++)t+=this.getRowHeight(o);return t};this.getFixedStartRowsHeight=()=>{if(!this.fixedRowsStart)return 0;let t=0;for(let o=0;o<this.fixedRowsStart;o++)t+=this.getRowHeight(o);return t};this.computeRenderCount=(t=Jt)=>{let o=t.horizontal,r=t.vertical,i=this.horizontalRenderCount||0,a=this.verticalRenderCount||0;return o&&(i=this.computeDirectionalRenderCount("horizontal",this.colWidth,this.cols,this.getAvailableRenderSize())),r&&(a=this.computeDirectionalRenderCount("vertical",this.rowHeight,this.rows,this.getAvailableRenderSize())),{horizontal:i,vertical:a}};this.setRenderCount=({horizontal:t,vertical:o})=>{t===void 0&&(t=this.horizontalRenderCount),o===void 0&&(o=this.verticalRenderCount);let r=t===this.horizontalRenderCount,i=o===this.verticalRenderCount;r&&i||(this.horizontalRenderCount=t,this.verticalRenderCount=o,this.updateRenderRange({horizontal:!r,vertical:!i}),this.notifyRenderCountChange())};this.updateFixedCells=t=>{t.fixedColsStart!=this.fixedColsStart&&(this.fixedColsStart=t.fixedColsStart||0),t.fixedColsEnd!=this.fixedColsEnd&&(this.fixedColsEnd=t.fixedColsEnd||0),t.fixedRowsStart!=this.fixedRowsStart&&(this.fixedRowsStart=t.fixedRowsStart||0),t.fixedRowsEnd!=this.fixedRowsEnd&&(this.fixedRowsEnd=t.fixedRowsEnd||0)};this.getFixedCellInfo=()=>{let{fixedRowsStart:t,fixedColsStart:o,fixedRowsEnd:r,fixedColsEnd:i}=this;return{fixedRowsStart:t,fixedColsStart:o,fixedRowsEnd:r,fixedColsEnd:i}};this.updateRenderRange=(t=Jt)=>{this.setRenderRange(this.computeRenderRange(t))};this.getExtraSpanCellsForRange=({horizontal:t,vertical:o})=>{let{colspan:r,rowspan:i}=this,a=[];if(i){let l=o.startIndex,s=t.startIndex,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=o.startIndex,u=o.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=Jt)=>{let o=t.horizontal?this.computeDirectionalRenderRange("horizontal"):this.horizontalRenderRange,r=t.vertical?this.computeDirectionalRenderRange("vertical"):this.verticalRenderRange;return{horizontal:o,vertical:r,extraCells:this.getExtraSpanCellsForRange({horizontal:o,vertical:r})}};this.computeDirectionalRenderRange=t=>{let o=t==="horizontal"?this.colWidth:this.rowHeight,r=t==="horizontal"?this.horizontalRenderCount:this.verticalRenderCount,i=t==="horizontal"?this.cols:this.rows;if(!r)return{startIndex:0,endIndex:0};let a=(t==="horizontal"?this.fixedColsStart:this.fixedRowsStart)||0,l=t==="horizontal"?this.scrollPosition.scrollLeft:this.scrollPosition.scrollTop;l+=this.getFixedStartSize(t);let s=typeof o!="function",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,o)=>{let r=o==="horizontal"?this.colWidth:this.rowHeight,i=o==="horizontal"?this.cols:this.rows;if(typeof r!="function")return Math.min(Math.max(0,Math.floor(t/r)),i-1);let a=o==="horizontal"?this.colOffsetCache:this.rowOffsetCache,l=o==="horizontal"?this.colWidthCache:this.rowHeightCache,s=a.length-1,u=l.length-1,c=a[s],d;for(;c<t;)if(s>=i||(u+=1,this.computeCacheFor(u,o),d=c,c=a[u],d===c&&d!=0))return i-1;let p=(0,om.default)(a,t,Ss);return p>=0?p:~p-1};this.computeCacheFor=(t,o)=>{let r=o==="horizontal"?this.colWidth:this.rowHeight,i=o==="horizontal"?this.colWidthCache:this.rowHeightCache,a=o==="horizontal"?this.colOffsetCache:this.rowOffsetCache;if(typeof r!="function")return;let l=r(t);if(i[t]=l,t>0){let s=a[t-1],u=i[t-1];s==null&&console.error(`Offset was not available for ${o==="horizontal"?"col":"row"} ${t-1}`),u==null&&console.error(`Size was not available for ${o==="horizontal"?"col":"row"} ${t-1}`);let c=s+u;a[t]=c}};this.computeItemSpanUpTo=(t,o,r)=>{let i=r==="horizontal"?o:t,a=r==="horizontal"?t:o,l=r==="horizontal"?this.cols:this.rows,s=r==="horizontal"?this.colspan:this.rowspan;if(!s)return;let 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:o};for(;f<=m;f++)if(d[f]===void 0){g[r==="horizontal"?"colIndex":"rowIndex"]=f;let h=s(g);d[f]=f,p[f]=h;let S=f;for(;h>1;)S+=1,d[S]=f,p[S]=0,h-=1}}};this.getCellSpan=(t,o,r)=>{let i=r==="horizontal"?this.colspan:this.rowspan,a=r==="horizontal"?o:t,l=r==="horizontal"?t:o;if(!i)return 1;let s=r==="horizontal"?this.colspanValue:this.rowspanValue,u=s.get(l);return(!u||u[a]===void 0)&&this.computeItemSpanUpTo(t,o,r),u||(u=s.get(l)),u[a]||1};this.getRowspan=(t,o)=>this.getCellSpan(t,o,"vertical");this.getColspan=(t,o)=>this.getCellSpan(t,o,"horizontal");this.getRowspanParent=(t,o)=>this.getItemSpanParent(t,o,"vertical");this.getColspanParent=(t,o)=>this.getItemSpanParent(t,o,"horizontal");this.getItemSpanParent=(t,o,r)=>{let i=r=="horizontal"?this.colspan:this.rowspan,a=r==="horizontal"?o:t,l=r==="horizontal"?t:o;if(!i)return a;let s=r==="horizontal"?this.colspanParent:this.rowspanParent,u=s.get(l);return(!u||u[a]===void 0)&&this.computeItemSpanUpTo(t,o,r),u||(u=s.get(l)),u[a]};this.getRowHeightWithSpan=(t,o,r)=>this.getItemSizeWithSpan(t,o,r,"vertical");this.getColWidthWithSpan=(t,o,r)=>this.getItemSizeWithSpan(t,o,r,"horizontal");this.getItemSizeWithSpan=(t,o,r,i)=>{let a=i==="horizontal"?o:t,l=this.getItemSize(a,i);for(;r>1;)a+=1,r-=1,l+=this.getItemSize(a,i);return l};this.getRowHeight=t=>this.getItemSize(t,"vertical");this.getColWidth=t=>this.getItemSize(t,"horizontal");this.getItemSize=(t,o)=>{let r=o==="horizontal"?this.cols:this.rows,i=o==="horizontal"?this.colWidth:this.rowHeight;if(typeof i!="function")return i;let a=this.getItemSizeCacheFor(t,o),l=o==="horizontal"?this.colWidthCache:this.rowHeightCache;if(a===void 0){let s=l.length,u=Math.min(t,r-1);for(;s<=u;s++)this.computeCacheFor(s,o);a=this.getItemSizeCacheFor(t,o)}return a};this.keepColumnRendered=t=>(this.alwaysRenderedColumns.add(t),()=>{this.alwaysRenderedColumns.delete(t)});this.getAlwaysRenderedColumns=()=>Array.from(this.alwaysRenderedColumns);this.setRenderRange=({horizontal:t,vertical:o,extraCells:r})=>{let i=!1;(t.startIndex!==this.horizontalRenderRange.startIndex||t.endIndex!==this.horizontalRenderRange.endIndex)&&(this.horizontalRenderRange=t,i=!0);let a=!1;(o.startIndex!==this.verticalRenderRange.startIndex||o.endIndex!==this.verticalRenderRange.endIndex)&&(this.verticalRenderRange=o,a=!0),this.extraSpanCells=r||[],(i||a)&&this.notifyRenderRangeChange(),a&&this.notifyVerticalRenderRangeChange(),i&&this.notifyHorizontalRenderRangeChange()};this.getRenderRangeCellCount=Cs;this.getMaxCellCount=()=>this.maxHorizontalRenderCount*this.maxVerticalRenderCount;this.getExtraCells=()=>this.extraSpanCells;this.getScrollPosition=()=>this.scrollPosition;this.getRenderRange=()=>({start:[this.verticalRenderRange.startIndex,this.horizontalRenderRange.startIndex],end:[this.verticalRenderRange.endIndex,this.horizontalRenderRange.endIndex]});this.onScroll=t=>(this.onScrollFns.push(t),()=>{this.onScrollFns=this.onScrollFns.filter(o=>o!==t)});this.onScrollStart=t=>(this.onScrollStartFns.push(t),()=>{this.onScrollStartFns=this.onScrollStartFns.filter(o=>o!==t)});this.onScrollStop=t=>(this.onScrollStopFns.push(t),()=>{this.onScrollStopFns=this.onScrollStopFns.filter(o=>o!==t)});this.onRenderRangeChange=t=>(this.onRenderRangeChangeFns.add(t),()=>{this.onRenderRangeChangeFns.delete(t)});this.onVerticalRenderRangeChange=t=>(this.onVerticalRenderRangeChangeFns.add(t),()=>{this.onVerticalRenderRangeChangeFns.delete(t)});this.onHorizontalRenderRangeChange=t=>(this.onHorizontalRenderRangeChangeFns.add(t),()=>{this.onHorizontalRenderRangeChangeFns.delete(t)});this.onRenderCountChange=t=>(this.onRenderCountChangeFns.add(t),()=>{this.onRenderCountChangeFns.delete(t)});this.onAvailableSizeChange=t=>(this.onAvailableSizeChangeFns.add(t),()=>{this.onAvailableSizeChangeFns.delete(t)});this.onDestroy=t=>(this.onDestroyFns.push(t),()=>{this.onDestroyFns=this.onDestroyFns.filter(o=>o!==t)});this.getAvailableSize=()=>({width:this.availableWidth,height:this.availableHeight});this.getAvailableRenderSize=()=>({width:this.availableRenderWidth??this.availableWidth,height:this.availableRenderHeight??this.availableHeight});this.name=o,this.update=this.update.bind(this),this.destroy=this.destroy.bind(this),this.getCellOffset=this.getCellOffset.bind(this),this.reset()}set rowsPerPage(t){t!=this._rowsPerPage&&(this._rowsPerPage=t)}get rowsPerPage(){return this._rowsPerPage}reset(t=Jt){t.vertical&&this.resetVertical(),t.horizontal&&this.resetHorizontal(),this.extraSpanCells=[]}resetVertical(){this.rowspanParent=new Map,this.rowspanValue=new Map,this.rowHeightCache=[],this.rowOffsetCache=[0],this.verticalRenderCount=void 0,this.verticalTotalSize=0,this.verticalRenderRange={startIndex:0,endIndex:0}}resetHorizontal(){this.colspanParent=new Map,this.colspanValue=new Map,this.colWidthCache=[],this.colOffsetCache=[0],this.horizontalRenderCount=void 0,this.horizontalTotalSize=0,this.horizontalRenderRange={startIndex:0,endIndex:0}}getVirtualColIndex(t,o){return t}update(t,o){let{rows:r,cols:i,rowHeight:a,colWidth:l,width:s,height: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",h=m&&r!==this.rows,S=g&&i!==this.cols;m&&(this.rows=r,this.rowsPerPage=r),g&&(this.cols=i);let y=a!=null,C=l!=null,T=y&&a!==this.rowHeight,I=C&&l!==this.colWidth;y&&(this.rowHeight=a),C&&(this.colWidth=l);let b=t.rowspan!=null,R=t.colspan!=null,w=b&&t.rowspan!=this.rowspan,v=R&&t.colspan!=this.colspan;w&&(this.rowspan=t.rowspan),v&&(this.colspan=t.colspan);let P=S||I||p||v,x=h||T||f||w;(o||kI)({horizontalChange:P,verticalChange:x,colsChanged:S,colWidthChanged:I,widthChanged:p,colspanChanged:v,rowsChanged:h,rowHeightChanged:T,heightChanged:f,rowspanChanged:w})&&this.updateRenderCount({horizontal:P,vertical:x})}extendRenderRange(t){let{direction:o}=t,r=o==="horizontal",i=r?this.horizontalRenderCount||this.getInitialCols():this.verticalRenderCount||this.getInitialRows(),a=typeof t.start=="number"?t.start:t.start===!0?i:0,l=typeof t.end=="number"?t.end:t.end===!0?i:0;return r?this.horizontalExtendRangeBy={start:a,end:l}:this.verticalExtendRangeBy={start:a,end:l},this.updateRenderRange({horizontal:r,vertical:!r}),()=>{this.extendRenderRange({start:0,end:0,direction:o})}}updateRenderCount(t=Jt){this.reset(t),this.doUpdateRenderCount(t),this.updateLargeContent()}supportsLargeContent(t){return t==="vertical"}alignScrollOrigin(t,o){return Math.floor(o)}updateLargeContent(){let t=this.getVirtualizedContentSize(),o=this.supportsLargeContent("vertical")&&hi(t.height),r=this.supportsLargeContent("horizontal")&&hi(t.width);this.largeContent={vertical:o,horizontal:r},this.scrollRatio={vertical:o?Hl(t.height,this.availableHeight):1,horizontal:r?Hl(t.width,this.availableWidth):1},this.updateScrollOrigin()}isLargeContent(t){return this.largeContent[t]}getScrollRatio(t){return this.scrollRatio[t]}getNativeScrollSize(){let t=this.getVirtualizedContentSize(),{largeContent:o}=this;if(!o.vertical&&!o.horizontal)return t;let r=gi();return{width:o.horizontal?r:t.width,height:o.vertical?r:t.height}}toContentScrollPosition(t){let{vertical:o,horizontal:r}=this.scrollRatio;return o===1&&r===1?t:{scrollTop:t.scrollTop*o,scrollLeft:t.scrollLeft*r}}toNativeScrollPosition(t){let{vertical:o,horizontal:r}=this.scrollRatio;return o===1&&r===1?t:{scrollTop:t.scrollTop/o,scrollLeft:t.scrollLeft/r}}getScrollOrigin(){return this.scrollOrigin}getDOMScrollPosition(t=this.getScrollPosition()){let o=this.getScrollOrigin();return!o.scrollTop&&!o.scrollLeft?t:{scrollTop:t.scrollTop-o.scrollTop,scrollLeft:t.scrollLeft-o.scrollLeft}}onScrollOriginChangeForBrain(t){return this.onScrollOriginChangeFns.add(t),()=>{this.onScrollOriginChangeFns.delete(t)}}updateScrollOrigin(){let{scrollPosition:t,largeContent:o,scrollOrigin:r}=this,i=u=>this.alignScrollOrigin("vertical",u),a=u=>this.alignScrollOrigin("horizontal",u),l=o.vertical?Kl(t.scrollTop,i(r.scrollTop),i):0,s=o.horizontal?Kl(t.scrollLeft,a(r.scrollLeft),a):0;l===r.scrollTop&&s===r.scrollLeft||(this.scrollOrigin={scrollTop:l,scrollLeft:s},this.notifyScrollOriginChange())}notifyScrollOriginChange(){if(this.destroyed)return;let t=this.getScrollOrigin();this.onScrollOriginChangeFns.forEach(o=>o(t))}doUpdateRenderCount(t=Jt){if(!this.availableWidth||!this.availableHeight){let o={horizontal:void 0,vertical:void 0};this.availableWidth||(o.horizontal=0),this.availableHeight||(o.vertical=0),this.setRenderCount(o)}this.setRenderCount(this.computeRenderCount(t))}get scrollTopMax(){return this.getVirtualizedContentSize().height-this.availableHeight}get scrollLeftMax(){return this.getVirtualizedContentSize().width-this.availableWidth}setScrollPosition(t,o){this.setScrolling(!0);let r=t.scrollLeft!==this.scrollPosition.scrollLeft,i=t.scrollTop!==this.scrollPosition.scrollTop;this.scrollPosition=t,(r||i)&&(this.updateScrollOrigin(),o?.(t),this.updateRenderRange({horizontal:r,vertical:i}),this.notifyScrollChange())}notifyRenderRangeChange(t=!1){if(this.destroyed)return;let o=this.onRenderRangeChangeFns,r=this.getRenderRange(),i=t?Ts:fr;o.forEach(a=>{i(()=>{this.destroyed||o.has(a)&&a(r)})})}notifyScrollChange(){if(this.destroyed)return;let{scrollPosition:t}=this,o=this.onScrollFns;for(let r=0,i=o.length;r<i;r++)o[r](t)}computeDirectionalRenderCount(t,o,r,i){let a=0,l=t==="horizontal"?i.width:i.height;if(l-=this.getFixedSize(t),l<=0)return 0;let s=t==="horizontal"?this.fixedColsStart:this.fixedRowsStart,u=t==="horizontal"?this.fixedColsEnd:this.fixedRowsEnd;if(typeof o=="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=Hi(l,c)}else a=(o?Math.ceil(l/o):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:o}=this,r={horizontal:t,vertical:o},i=this.onRenderCountChangeFns;i.forEach(a=>{fr(()=>{this.destroyed||i.has(a)&&a(r)})})}getCellOffset(t,o){return{x:this.getItemOffsetFor(o,"horizontal"),y:this.getItemOffsetFor(t,"vertical")}}getInitialRowHeight(){return this.rowHeight}getInitialCols(){return this.cols}getInitialRows(){return this.rows}getItemOffsetFor(t,o){let r=o==="horizontal"?this.colWidth:this.rowHeight;if(typeof r!="function")return t*r;let i=o==="horizontal"?this.colOffsetCache:this.rowOffsetCache,a=o==="horizontal"?this.colWidthCache:this.rowHeightCache,l=i[t];if(l==null){let s=a.length-1;for(;s<t;)s+=1,this.computeCacheFor(s,o);l=i[t]}return l}getItemSizeCacheFor(t,o){return(o==="horizontal"?this.colWidthCache:this.rowHeightCache)[t]}getRowIndexInPage(t){return t}getPageIndexForRow(t){return 0}getVirtualizedContentSize(){return{height:this.getVirtualizedContentSizeFor("vertical"),width:this.getVirtualizedContentSizeFor("horizontal")}}getVirtualizedContentSizeFor(t){let o=t==="horizontal"?this.cols:this.rows,r=t==="horizontal"?this.colWidth:this.rowHeight,i=t==="horizontal"?this.horizontalTotalSize:this.verticalTotalSize;if(typeof r!="function")return r*o;if(i!==0&&!isNaN(i))return i;let a=t==="horizontal"?this.colOffsetCache:this.rowOffsetCache,l=o?this.getItemSize(o-1,t):0,s=o?a[o-1]:0,u=l+s;return t==="horizontal"?this.horizontalTotalSize=u:this.verticalTotalSize=u,u}notifyDestroy(){let t=this.onDestroyFns;for(let o=0,r=t.length;o<r;o++)t[o]()}destroy(){this.destroyed||(this.notifyDestroy(),this.reset(),this.rowspanParent.clear(),this.colspanParent.clear(),this.alwaysRenderedColumns.clear(),this.horizontalExtendRangeBy=Ki,this.verticalExtendRangeBy=Ki,this.destroyed=!0,this.onDestroyFns=[],this.onScrollFns=[],this.onScrollStartFns=[],this.onScrollStopFns=[],this.onRenderCountChangeFns.clear(),this.onScrollOriginChangeFns.clear(),this.onRenderRangeChangeFns.clear(),this.onVerticalRenderRangeChangeFns.clear(),this.onHorizontalRenderRangeChangeFns.clear())}};var Is=oo(zn());function im(...n){if(!n.length)return new Set;let[e,...t]=n;return new Set([...e].filter(o=>t.every(r=>r.has(o))))}function am(n,e){let t=new Set;for(let o of n)e(o)&&t.add(o);return t}function mr(n,e){for(let t of n)if(e(t))return t}var Bi=(n,e)=>n-e,Wi=class extends yt{constructor(t,o){super(`${t}:GridCellManager`);this.matrix=new j;this.rowsWithCellsHistory=new Map;this.columnsWithCellsHistory=new Map;this.cellToMatrixPosition=new WeakMap;this.getCellsOutsideRenderRange=t=>{let{start:o,end:r}=t,[i,a]=o,[l,s]=r,u=new Set;return this.matrix.visit(({value:c},d)=>{if(!c)return;let[p,f]=d,m=p<i,g=p>=l,h=f<a,S=f>=s;(m||g||h||S)&&u.add(c)}),u};this.debugId=t,this.pool=o,this.offRemoveCell=this.pool.onRemoveCell(r=>this.onRemoveCell(r))}onRemoveCell(t){let o=this.cellToMatrixPosition.get(t);this.cellToMatrixPosition.delete(t),o&&this.clearCellFromMatrix(t,o,{skipHistory:!1})}set poolSize(t){this.pool.poolSize=t}get poolSize(){return this.pool.poolSize}getDetachedCell(){return this.pool.getDetachedCell()}clearCellFromMatrix(t,o,r){if(this.matrix.delete(o),r.skipHistory)return;let[i,a]=o,l=this.rowsWithCellsHistory.get(i),s=this.columnsWithCellsHistory.get(a);l&&(l.delete(t),l.size===0&&this.rowsWithCellsHistory.delete(i)),s&&(s.delete(t),s.size===0&&this.columnsWithCellsHistory.delete(a))}addCellToMatrix(t,o){let[r,i]=o;this.matrix.set(o,t),this.cellToMatrixPosition.set(t,o);let a=this.rowsWithCellsHistory.get(r),l=this.columnsWithCellsHistory.get(i);a?a.add(t):(a=new Set,a.add(t),this.rowsWithCellsHistory.set(r,a)),l?l.add(t):(l=new Set,l.add(t),this.columnsWithCellsHistory.set(i,l))}setCellPositionInMatrix(t,o){let r=this.cellToMatrixPosition.get(t);if(o==null){r&&this.clearCellFromMatrix(t,r,{skipHistory:!0});return}let[i,a]=o,l=r&&r[0]===i&&r[1]===a;r&&!l&&this.clearCellFromMatrix(t,r,{skipHistory:!1}),this.addCellToMatrix(t,o)}renderNodeAtCell(t,o,r,i){let a=this.getCellAt(r);return a&&a!==o&&this.detachCellAt(r),this.pool.attachCell(o),this.setCellPositionInMatrix(o,r),o.update(t,i),o}getCellPosition(t){let o=this.cellToMatrixPosition.get(t);return!o||this.getCellAt(o)!=t?null:o}getCellAt(t){return this.matrix.get(t)}getCellFor(t,o){let r=this.getCellAt(t);if(r)return r;let[i,a]=t;if(o==="row"){let l=this.rowsWithCellsHistory.get(i);l&&(r=mr(l,s=>!this.isCellAttached(s)))}if(o==="column"){let l=this.columnsWithCellsHistory.get(a);l&&(r=mr(l,s=>!this.isCellAttached(s)))}return r??this.getDetachedCell()}isCellAttached(t){return this.getCellPosition(t)!==null}isCellAttachedAt(t){let o=this.getCellAt(t);return o?this.isCellAttached(o):!1}getMatrix(){let t=this.getRowsWithCells().pop()??-1,o=this.getColumnsWithCells().pop()??-1;return Array.from({length:t+1},(i,a)=>Array.from({length:o+1},(s,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(o=>this.getCellAt(o)).filter(Boolean)}getOneAttachedCell(){return this.pool.getAttachedCells().values().next().value}getRowsWithCells(){return this.matrix.rawKeysAt([]).sort(Bi)}getColumnsWithCells(){let t=this.matrix.getKeysOfFirstChildOnEachBranchStartingWith([],{excludeSelf:!0});return[...new Set(t.map(r=>r[1])).values()].sort(Bi)}isRowAttached(t){return this.getRowsWithCells().includes(t)}isColumnAttached(t){return this.getColumnsWithCells().includes(t)}detachRow(t){this.matrix.getKeysStartingWith([t]).forEach(r=>this.detachCellAt(r))}detachCol(t){this.matrix.visit((o,r)=>{r[1]===t&&this.detachCellAt(r)})}detachCell(t){return t?(this.pool.detachCell(t)&&this.setCellPositionInMatrix(t,null),!0):!1}detachCells(t){t.forEach(o=>this.detachCell(o))}detachRowsStartingWith(t){let o=this.getRowsWithCells().sort(),r=(0,Is.default)(o,t,Bi);r<0&&(r=~r),o.slice(r).forEach(a=>this.detachRow(a))}detachColsStartingWith(t){let o=this.getColumnsWithCells().sort(),r=(0,Is.default)(o,t,Bi);r<0&&(r=~r),o.slice(r).forEach(a=>this.detachCol(a))}detachCellsStartingAt(t){let[o,r]=t;this.matrix.visit((i,a)=>{let[l,s]=a;l>o&&this.detachCellAt(a),l===o&&s>=r&&this.detachCellAt(a)})}detachCellAt(t){let o=this.getCellAt(t);return o?this.detachCell(o):!1}onCellAttachmentChange(t){return this.pool.onCellAttachmentChange(t)}getCellFromListForRow(t,o){return mr(t,r=>this.getCellPosition(r)?.[0]===o)}getCellFromListForColumn(t,o){return mr(t,r=>this.getCellPosition(r)?.[1]===o)}getCellCountInMatrix(){return this.matrix.size}flushPendingAfterCommitWork(){this.pool.flushPendingAfterCommitWork()}destroy(){this.reset()}reset(){this.pool.reset(),this.matrix.clear(),this.rowsWithCellsHistory.clear(),this.columnsWithCellsHistory.clear(),this.offRemoveCell(),this.offRemoveCell=()=>{}}makeDetachedCellsEmpty(){this.pool.getDetachedCells().forEach(t=>{t.update(null)})}withDetachedCells(t){this.pool.getDetachedCells().forEach(t)}};var lm=oo(zn());var ji=class extends yt{constructor(t,o){super(`${t}:ListRowManager`);this.indexToRow=new Map;this.rowToIndex=new WeakMap;this.debugId=t,this.pool=o,this.offRemoveRow=this.pool.onRemoveRow(r=>this.onRemoveRow(r))}onRemoveRow(t){let o=this.rowToIndex.get(t);o!=null&&(this.rowToIndex.delete(t),this.indexToRow.delete(o))}set poolSize(t){this.pool.poolSize=t}get poolSize(){return this.pool.poolSize}getDetachedRow(){return this.pool.getDetachedRow()}getRowFor(t){return this.getRowAt(t)??this.getDetachedRow()}setRowIndexInList(t,o){let r=this.rowToIndex.get(t);r!=null&&this.indexToRow.delete(r),o==null?this.rowToIndex.delete(t):(this.rowToIndex.set(t,o),this.indexToRow.set(o,t))}detachStartingWith(t){let o=this.getAttachedIndexes(),r=(0,lm.default)(o,t,(a,l)=>a-l);r<0&&(r=~r),o.slice(r).forEach(a=>this.detachRowAt(a))}getRowAt(t){return this.indexToRow.get(t)}getRowIndex(t){return this.rowToIndex.get(t)}isRowAttached(t){return this.getRowIndex(t)!=null}isRowAttachedAt(t){return!!this.getRowAt(t)}getList(){let t=Math.max(...this.indexToRow.keys());return Array.from({length:t+1},(r,i)=>{let a=this.indexToRow.get(i);return a?a.getNode():null})}getAttachedCount(){return this.indexToRow.size}forEachAttachedRow(t){this.indexToRow.forEach(t)}getAttachedIndexes(){return Array.from(this.indexToRow.keys()).sort()}getAllRows(){return[...this.pool.getAllRows()]}detachRowAt(t){let o=this.getRowAt(t);o&&(this.setRowIndexInList(o,null),this.pool.detachRow(o))}detachRow(t){let o=this.getRowIndex(t);o!=null&&this.detachRowAt(o)}renderNodeAtRow(t,o,r){let i=this.getRowAt(r);return i&&i!==o&&this.detachRowAt(r),this.pool.attachRow(o),this.setRowIndexInList(o,r),o.update(t),o}makeDetachedRowsEmpty(){this.pool.getDetachedRows().forEach(t=>{t.update(null)})}onRowAttachmentChange(t){return this.pool.onRowAttachmentChange(t)}withDetachedRows(t){this.pool.getDetachedRows().forEach(t)}destroy(){this.reset()}reset(){this.pool.reset(),this.indexToRow.clear(),this.offRemoveRow(),this.offRemoveRow=()=>{}}};var sm=!0,Yn=$(Y.y),um=$(Y.scrollTop),zI=$(Y.scrollLeft),Jk=$(Y.columnOffsetAtIndex),Rs=$(Y.columnOffsetAtIndexWhileReordering),Ao=class extends yt{constructor(t,o,r){o=o||"ReactHeadlessTableRenderer";super(o);this.debugId="";this.destroyed=!1;this.scrolling=!1;this.cellHoverClassNames=[];this.cellDetachedClassNames=[];this.ownsPositionVars=!1;this.lastEnteredRow=-1;this.lastExitedRow=-1;this.hoverRowUpdatesInProgress=new Map;this.infiniteNode=null;this.setDetailTransform=(t,o,{y:r,scrollTop:i,scrollLeft:a})=>{i||(r-=this.brain.getScrollOrigin().scrollTop),t.style.setProperty(Yn,i?`calc( ${r}px + var(${um}) )`:`${r}px`),t.style.transform=`translate3d(${a||0}px, var(${Yn}), 0)`};this.setTransform=(t,o,r,{x:i,y:a,scrollLeft:l,scrollTop:s},u)=>{let c=Ie.columnOffsets.get(r),d=`${Rs}-${r}`,p=s?`calc( ${a}px + var(${um}, 0px) )`:`${a-this.brain.getScrollOrigin().scrollTop}px`;t.__currentTransformY!==p&&(t.__currentTransformY=p,t.style.setProperty(Yn,p));let m=`translate3d(${this.ownsPositionVars?l?`calc( ${i}px + var(${zI}, 0px) )`:`${i-this.brain.getScrollOrigin().scrollLeft}px`:`var(${d}, ${c})`}, var(${Yn}), 0)`;if(t.__transformValue!==m&&(t.__transformValue=m,t.style.transform=m),u!=null&&this.ownsPositionVars){let g=`${u}`;t.__zIndex!==g&&(t.__zIndex=g,t.style.zIndex=g)}};this.onScrollOriginChange=()=>{this.destroyed||(this.cellManager.getAllCells().forEach(t=>{this.updateElementPosition(t,void 0,{immediate:!0})}),this.rowManager.forEachAttachedRow(t=>{this.updateDetailElementPosition(t)}),this.adjustFixedElementsOnScroll())};this.cellsDetachedInRenderPass=null;this.getFullyVisibleRowsRange=()=>{let{start:[t],end:[o]}=this.brain.getRenderRange();for(;!this.isRowFullyVisible(t);)if(t++,t===o)return null;for(;!this.isRowFullyVisible(o);)if(o--,o===t)return null;return{start:t,end:o}};this.getScrollPositionForScrollRowIntoView=(t,o={offset:0})=>{if(this.destroyed)return null;let{brain:r}=this,i=r.getScrollPosition(),a=i.scrollLeft,{scrollAdjustPosition:l,offset:s=0}=o;if(this.isRowFullyVisible(t)&&!l)return i;let 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 h=i.scrollTop;if(l==="center"?h=u-Math.floor((r.getAvailableSize().height-d-p)/2):l==="start"?(s=-s,h+=u-f+s-d):(s+=c,h+=u-g+s+p),this.brain.isHorizontalLayoutBrain){let S=o.colIndex??Math.ceil(this.brain.getInitialCols()/2),y=this.getScrollPositionForScrollColumnIntoView(S,{...o,horizontalLayoutPageIndex:this.brain.getPageIndexForRow(t)});y&&(a=y.scrollLeft)}return{scrollLeft:a,scrollTop:h}};this.getScrollPositionForScrollColumnIntoView=(t,o={offset:0})=>{if(this.destroyed)return null;let{brain:r}=this,i=r.getScrollPosition(),a=o.horizontalLayoutPageIndex!=null?{horizontalLayoutPageIndex:o.horizontalLayoutPageIndex}:void 0,{scrollAdjustPosition:l,offset:s=0}=o;if(this.isColumnFullyVisible(t,void 0,a)&&!l)return i;a&&(t=r.getInitialCols()*a.horizontalLayoutPageIndex+t);let 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 h=i.scrollLeft;return l==="center"?h=u-Math.floor((r.getAvailableSize().width-d-p)/2):l==="start"?(s=-s,h+=u-f+s-d):(s+=c,h+=u-g+s+p),{...i,scrollLeft:h}};this.getScrollPositionForScrollCellIntoView=(t,o,r={offsetLeft:0,offsetTop:0})=>{if(this.destroyed)return null;let i=this.getScrollPositionForScrollColumnIntoView(o,{scrollAdjustPosition:r.colScrollAdjustPosition||r.scrollAdjustPosition,offset:r.offsetLeft}),a=this.getScrollPositionForScrollRowIntoView(t,{scrollAdjustPosition:r.rowScrollAdjustPosition||r.scrollAdjustPosition,offset:r.offsetTop});if(!i||!a)return null;let{scrollLeft:l}=i,{scrollTop:s}=a;return{scrollLeft:l,scrollTop:s}};this.isRowFullyVisible=(t,o=2)=>this.isRowVisible(t,this.brain.getRowHeight(t)-o);this.isRowVisible=(t,o=10)=>{if(!this.isRowRendered(t))return!1;t=this.brain.getPageIndexForRow(t)&&this.brain.rowsPerPage?t%this.brain.rowsPerPage:t;let{brain:i}=this;if(i.isRowFixed(t))return!0;let{start:[a],end:[l]}=this.brain.getRenderRange(),s=Math.floor((a+l)/2);if(t<a||t>=l)return!1;if(t>=s){let u=i.getItemAt(i.getAvailableSize().height+i.getScrollPosition().scrollTop-o,"vertical");return t<=u}if(t<s){let u=i.getItemAt(i.getScrollPosition().scrollTop+o,"vertical");return t>=u}return!0};this.isRowRendered=t=>{if(!this.brain.isHorizontalLayoutBrain)return this.cellManager.isRowAttached(t);let o=t;return t=this.brain.rowsPerPage?t%this.brain.rowsPerPage:t,this.cellManager.getCellsForRow(t).filter(r=>r.getAdditionalInfo()?.renderRowIndex===o).length>0};this.isCellVisible=(t,o)=>this.isRowVisible(t)&&this.isColumnVisible(o);this.isCellFullyVisible=(t,o,r)=>this.isRowFullyVisible(t)&&this.isColumnVisible(o,void 0,r);this.isColumnFullyVisible=(t,o=2,r)=>this.isColumnVisible(t,this.brain.getColWidth(t)-o,r);this.isColumnVisible=(t,o=10,r)=>{if(!this.isColumnRendered(t,r))return!1;let{brain:i}=this;if(i.isColFixed(t))return!0;r&&r.horizontalLayoutPageIndex!=null&&(t=i.getVirtualColIndex(t,{pageIndex:r.horizontalLayoutPageIndex}));let{start:[a,l],end:[s,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-o-i.getFixedEndColsWidth(),"horizontal");return t<=d}if(t<c){let d=i.getItemAt(i.getScrollPosition().scrollLeft+o+i.getFixedStartColsWidth(),"horizontal");return t>=d}return!0};this.isCellRendered=(t,o,r)=>this.isRowRendered(t)&&this.isColumnRendered(o,r);this.isColumnRendered=(t,o)=>{let{start:[r]}=this.brain.getRenderRange();return o?.horizontalLayoutPageIndex!=null&&(t=this.brain.getInitialCols()*o.horizontalLayoutPageIndex+t),this.cellManager.isCellAttachedAt([r,t])};this.getExtraSpanCellsForRange=t=>{let{start:o,end:r}=t,[i,a]=o,[l,s]=r;return this.brain.getExtraSpanCellsForRange({horizontal:{startIndex:a,endIndex:s},vertical:{startIndex:i,endIndex:l}})};this.getFixedRanges=t=>{let{fixedRowsStart:o,fixedRowsEnd:r,fixedColsStart:i,fixedColsEnd:a}=this.brain.getFixedCellInfo();if(!o&&!i&&!r&&!a)return[];let l=this.brain.getColCount(),s=this.brain.getRowCount(),{start:u,end:c}=t,[d,p]=u,[f,m]=c,g=[];if(i&&(o&&g.push({rowFixed:"start",colFixed:"start",start:[0,0],end:[o,i]}),r&&g.push({rowFixed:"end",colFixed:"start",start:[s-r,0],end:[s,i]}),g.push({rowFixed:!1,colFixed:"start",start:[d,0],end:[f,i]})),a&&(o&&g.push({colFixed:"end",rowFixed:"start",start:[0,l-a],end:[o,l]}),r&&g.push({colFixed:"end",rowFixed:"end",start:[s-r,l-a],end:[s,l]}),g.push({colFixed:"end",rowFixed:!1,start:[d,l-a],end:[f,l]})),o){let h={start:[0,p],end:[o,m],rowFixed:"start",colFixed:!1};g.push(h)}if(r){let h={rowFixed:"end",colFixed:!1,start:[s-r,p],end:[s,m]};g.push(h)}return g};this.isCellFixed=(t,o)=>{let{fixedRowsStart:r,fixedRowsEnd:i,fixedColsStart:a,fixedColsEnd:l}=this.brain.getFixedCellInfo(),s=this.brain.getColCount(),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(o<a&&(d=!0,p="start"),l&&!d){let f=s-l;o>=f&&(d=!0,p="end")}return{row:c?p:!1,col:d?p:!1}};this.isCellCovered=(t,o)=>{let r=this.brain.getRowspanParent(t,o),i=this.brain.getColspanParent(t,o),a=r!=t,l=i!=o;return a||l?[r,i]:!1};this.onMouseEnterNotBound=t=>{let o=this.getMatrixRowIndexFromElement(t.currentTarget);this.onMouseEnter(o)};this.onMouseLeaveNotBound=t=>{let o=this.getMatrixRowIndexFromElement(t.currentTarget);this.onMouseLeave(o)};this.onMouseEnter=t=>{this.lastEnteredRow=t,this.lastExitedRow=-1,!this.scrolling&&t!=-1&&this.addHoverClass(t)};this.addHoverClass=t=>{this.cellManager.getCellsForRow(t).forEach(o=>{let r=o.getElement();r&&this.cellHoverClassNames.forEach(i=>{r.classList.add(i)})})};this.onMouseLeave=t=>{this.lastExitedRow=t,this.lastEnteredRow=-1,!this.scrolling&&t!=-1&&this.removeHoverClass(t)};this.removeHoverClass=t=>{this.cellManager.getCellsForRow(t).forEach(o=>{let r=o.getElement();r&&this.cellHoverClassNames.forEach(i=>{r.classList.remove(i)})})};this.updateHoverClassNamesForRow=t=>{if(this.scrolling||this.hoverRowUpdatesInProgress.has(t))return;this.hoverRowUpdatesInProgress.set(t,!0);let o=()=>{!this.scrolling&&this.lastEnteredRow!=-1&&(this.lastEnteredRow===t?this.addHoverClass(t):this.removeHoverClass(t))};Ve(()=>{this.destroyed||(o(),this.hoverRowUpdatesInProgress.delete(t))})};this.updateElementPosition=(t,o,r)=>{if(this.destroyed)return;let i=t.getElement(),a=this.cellManager.getCellPosition(t);if(!a)return;let[l,s]=a,u=this.brain.getCellOffset(l,s);if(u==null)return;let{x:c,y:d}=u;if(i){let p=()=>{this.updateHoverClassNamesForRow(l);let f=this.getCellRealCoordinates(l,s);if(i.dataset.rowIndex=f.rowIndex,i.dataset.colIndex=f.colIndex,sm){let m=this.ownsPositionVars?this.getFixedCellPlacement(l,s,{x:c,y:d}):null;this.setTransform(i,l,s,m??{x:c,y:d},null),i.style.willChange="transform",i.style.backfaceVisibility="hidden";let h=(o?o.hidden:!!this.isCellCovered(l,s))?"-1":m?`${m.zIndex}`:i.dataset.zIndex||"auto";i.__zIndex!==h&&(i.__zIndex=h,i.style.zIndex=h)}else i.style.display="",i.style.left=`${c}px`,i.style.top=`${d}px`};this.scrolling&&this.brain.isHorizontalLayoutBrain&&!r?.immediate?t.setPendingAfterCommitWork(p):p()}};this.updateDetailElementPosition=t=>{if(this.destroyed)return;let o=t.getElement(),r=this.rowManager.getRowIndex(t);if(r==null)return;let i=this.brain.getItemOffsetFor(r,"vertical");if(i==null)return;let a=i;o&&(o.dataset.detailRowIndex=r,sm&&(this.setDetailTransform(o,r,{y:a,scrollLeft:this.brain.getDOMScrollPosition().scrollLeft}),o.style.willChange="transform",o.style.backfaceVisibility="hidden",o.style.zIndex=o.dataset.zIndex||"auto"))};this.onScrollStart=()=>{this.scrolling=!0,this.lastEnteredRow!=-1&&this.removeHoverClass(this.lastEnteredRow)};this.onScrollStop=()=>{this.scrolling=!1,this.flushPendingAfterCommitWork(),this.lastEnteredRow!=-1&&this.addHoverClass(this.lastEnteredRow),this.lastExitedRow!=-1&&this.removeHoverClass(this.lastExitedRow)};this.adjustFixedElementsOnScroll=(t=this.brain.getScrollPosition())=>{let{brain:o,cellManager:r,rowManager:i}=this,a=this.brain.getColCount(),l=this.brain.getRowCount(),{fixedColsStart:s,fixedColsEnd:u,fixedRowsStart:c,fixedRowsEnd:d}=this.brain.getFixedCellInfo();if(i.getAttachedCount()&&i.forEachAttachedRow(I=>{let b=i.getRowIndex(I);if(b!=null){let R=this.brain.getItemOffsetFor(b,"vertical");if(R==null)return;let w=I.getElement();if(!w)return;this.setDetailTransform(w,b,{y:R,scrollLeft:o.getDOMScrollPosition(t).scrollLeft})}}),!s&&!u&&!c&&!d)return;let p=this.cellManager.getOneAttachedCell();p&&Kd(o.getDOMScrollPosition(t),this.ownsPositionVars?p.getElement()?.parentElement??null:this.getInfiniteNode(p.getElement()));let f={cols:this.brain.getFixedEndColsOffsets({skipScroll:!0}),rows:this.brain.getFixedEndRowsOffsets({skipScroll:!0})},{start:m,end:g}=this.brain.getRenderRange(),[h,S]=m,[y,C]=g,T=(I,b)=>{let R=r.getCellAt([I,b])?.getElement(),w=R?o.getCellOffset(I,b):null;if(!R||!w)return;let v=this.getFixedCellPlacement(I,b,w,f);v&&this.setTransform(R,I,b,v,v.zIndex)};if(s||u)for(let I=h;I<y;I++){for(let b=0;b<s;b++)T(I,b);if(u){let b=a-u;for(let R=b;R<a;R++)T(I,R)}}if(c||d)for(let I=S;I<C;I++){for(let b=0;b<c;b++)T(b,I);if(d){let b=l-d;for(let R=b;R<l;R++)T(R,I)}}if(s&&c)for(let I=0;I<c;I++)for(let b=0;b<s;b++)T(I,b);if(s&&d){let I=l-d;for(let b=I;b<l;b++)for(let R=0;R<s;R++)T(b,R)}if(u&&c){let I=a-u;for(let b=0;b<c;b++)for(let R=I;R<a;R++)T(b,R)}if(u&&d){let I=l-d,b=a-u;for(let R=I;R<l;R++)for(let w=b;w<a;w++)T(R,w)}};this.flushPendingAfterCommitWork=()=>{this.destroyed||this.cellManager.flushPendingAfterCommitWork()};this.destroy=()=>{this.destroyed||(this.destroyed=!0,this.reset(),this.onDestroy(),this.hoverRowUpdatesInProgress.clear(),this.hoverRowUpdatesInProgress=null,this.brain=null)};this.brain=t,this.debugId=o,this.cellManager=new Wi(o,r.cellPool),this.cellManager.onCellAttachmentChange((c,d)=>{d?this.onCellAttached(c):this.onCellDetached(c)}),this.rowManager=new ji(o,r.rowPool),this.rowManager.onRowAttachmentChange((c,d)=>{d?this.onRowAttached(c):this.onRowDetached(c)}),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),u=t.onScrollOriginChange(this.onScrollOriginChange);this.onDestroy=()=>{u(),i(),a(),l(),s()}}getInfiniteNode(t){return this.infiniteNode||(this.infiniteNode=Ol(t)),this.infiniteNode}onCellAttached(t){if(!this.cellsDetachedInRenderPass?.delete(t)&&this.cellDetachedClassNames.length){let o=t.getElement();o&&this.cellDetachedClassNames.forEach(r=>{o.classList.remove(r)})}}onCellDetached(t){if(this.cellsDetachedInRenderPass){this.cellsDetachedInRenderPass.add(t);return}this.addDetachedClassNames(t)}addDetachedClassNames(t){if(this.cellDetachedClassNames.length){let o=t.getElement();o&&this.cellDetachedClassNames.forEach(r=>{o.classList.add(r)})}}onRowAttached(t){if(this.cellDetachedClassNames.length){let o=t.getElement();o&&this.cellDetachedClassNames.forEach(r=>{o.classList.remove(r)})}}onRowDetached(t){if(this.cellDetachedClassNames.length){let o=t.getElement();o&&this.cellDetachedClassNames.forEach(r=>{o.classList.add(r)})}}isCellRenderedAndMappedCorrectly(t,o){let r=!!this.cellManager.getCellAt([t,o]);return{rendered:r,mapped:r}}renderRange(t,o){if(this.destroyed)return[];if(this.cellsDetachedInRenderPass)return this.renderRangeInternal(t,o);let r=this.cellsDetachedInRenderPass=new Set;try{return this.renderRangeInternal(t,o)}finally{this.cellsDetachedInRenderPass=null,r.forEach(i=>this.addDetachedClassNames(i))}}renderRangeInternal(t,{renderCell:o,renderDetailRow:r,force:i,onRender:a}){let{start:l,end:s}=t,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 P=t.start[1],x=t.end[1];m.forEach(M=>{P<=M&&M<x||f.push({start:[t.start[0],M],end:[t.end[0],M+1]})})}let g=new Map,h=f.map(this.getExtraSpanCellsForRange).flat();h&&h.forEach(([P,x])=>{g.set(`${P}:${x}`,!0)});let S=f.reduce((P,x)=>P+Cs(x),0),y=r?f.reduce((P,x)=>P+rm(x),0):0,C=this.brain.getRowCount(),T=this.brain.getColCount();d.detachCellsStartingAt([C,T]);let I=Math.min(C*T,S);r&&(c.detachStartingWith(this.brain.getRowCount()),c.poolSize>y&&(c.poolSize=y));let b=im(...f.map(P=>d.getCellsOutsideRenderRange(P)));b=am(b,P=>{let x=d.getCellPosition(P);return!(x&&g.has(`${x[0]}:${x[1]}`))}),d.detachCells(b),d.poolSize=I;let R=new Map,w=new Map;f.forEach(P=>{let{start:x,end:M}=P,[D,E]=x,[z,V]=M;for(let N=D;N<z;N++){for(let F=E;F<V;F++){let K=`${N}:${F}`;if(R.has(K))continue;R.set(K,!0);let{rendered:q,mapped:_}=this.isCellRenderedAndMappedCorrectly(N,F);if(N===D||F===E){let H=this.isCellCovered(N,F);if(H&&g.has(`${H[0]}:${H[1]}`)){let Z=d.getCellAt([N,F]);Z!=null&&d.detachCell(Z);continue}}if(q&&!i&&_)continue;let k;q?k=d.getCellAt([N,F]):k=d.getCellFor([N,F],u?"row":"column"),k==null&&(k=d.getDetachedCell()),this.renderCellAt(N,F,k,o)}!r||w.has(N)||(w.set(N,!0),c.isRowAttachedAt(N)&&!i)||this.renderDetailRowAtElement(N,this.rowManager.getRowFor(N),r)}}),h.forEach(([P,x])=>{let{rendered:M,mapped:D}=this.isCellRenderedAndMappedCorrectly(P,x);if(M){if(i||!D){let z=[P,x],V=d.getCellAt(z);this.renderCellAt(P,x,V,o)}return}let E=d.getCellFor([P,x],u?"row":"column");E!=null&&this.renderCellAt(P,x,E,o)});let v=d.getAllCells().map(P=>P.getNode());return r&&c.getAllRows().forEach(P=>{v.push(P.getNode())}),this.adjustFixedElementsOnScroll(),a&&a(v),v}renderDetailRowAtElement(t,o,r){if(this.destroyed)return;let i=!1,a=this.brain.getRowHeight(t),l=this.brain.isRowFixedStart(t)?"start":this.brain.isRowFixedEnd(t)?"end":!1,u=r({rowIndex:t,height:a,rowFixed:l,hidden:!!i,onMouseEnter:()=>{},onMouseLeave:()=>{},domRef:o.ref});if(o.isMounted()||o.onMount(c=>{let d=c.getElement();d&&(d.style.position="absolute",d.style.left="0px"),this.updateDetailElementPosition(c)}),!u){this.rowManager.detachRow(o);return}this.rowManager.renderNodeAtRow(u,o,t),this.updateDetailElementPosition(o)}getCellRealCoordinates(t,o){return{rowIndex:t,colIndex:o}}getMatrixRowIndexFromElement(t){let o=Number(t.dataset.rowIndex);return this.brain.isHorizontalLayoutBrain?this.brain.getRowIndexInPage(o):o}renderCellAt(t,o,r,i){if(this.destroyed)return;let a=this.isCellCovered(t,o),l=this.brain.getRowHeight(t),s=this.brain.getColWidth(o),u=this.brain.getRowspan(t,o),c=this.brain.getColspan(t,o),d=u===1?l:this.brain.getRowHeightWithSpan(t,o,u),p=c===1?s:this.brain.getColWidthWithSpan(t,o,c),{row:f,col:m}=this.isCellFixed(t,o),g=!!a,{rowIndex:h,colIndex:S}=this.getCellRealCoordinates(t,o),y=i({rowIndex:h,colIndex:S,height:l,width:s,rowspan: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(I=>{let b=I.getElement();b&&(b.style.position="absolute",b.style.left="0px",b.style.top="0px"),this.updateElementPosition(I)});let C=this.brain.isHorizontalLayoutBrain?{renderRowIndex:h,renderColIndex:S}:void 0,T=this.brain.isHorizontalLayoutBrain;if(!y){T?this.cellManager.detachCell(r):this.cellManager.detachCell(r);return}this.cellManager.renderNodeAtCell(y,r,[t,o],C),this.updateElementPosition(r,{hidden:g,rowspan:u,colspan:c})}getFixedCellPlacement(t,o,{x:r,y:i},a){let{fixedRowsStart:l,fixedRowsEnd:s,fixedColsStart:u,fixedColsEnd:c}=this.brain.getFixedCellInfo(),d=this.brain.getColCount(),p=this.brain.getRowCount(),f=o<u,m=!f&&!!c&&o>=d-c,g=t<l,h=!g&&!!s&&t>=p-s,S=f||m,y=g||h;if(!S&&!y)return null;m&&(r=(a?.cols??this.brain.getFixedEndColsOffsets({skipScroll:!0}))[o]),h&&(i=(a?.rows??this.brain.getFixedEndRowsOffsets({skipScroll:!0}))[t]);let C=S&&y?f?g?1e5:2e5:g?3e5:4e5:f?u-o:m?d-o:g?l-t:p-t;return{x:r,y:i,scrollLeft:S,scrollTop:y,zIndex:C}}reset(){this.cellManager.reset(),this.rowManager.reset()}};var Ui=class extends Ao{constructor(t,o,r){super(t,o,r);this.setTransform=(t,o,r,i,a)=>{let l=this.getCellRealCoordinates(o,r),{y:s}=i,u=Math.floor(l.rowIndex/this.brain.rowsPerPage)-this.brain.getScrollOriginPageIndex(),c=pe.runtime.totalVisibleColumnsWidthVar,d=u?`calc(${c} * ${u})`:"0px",p=Ie.columnOffsets.get(l.colIndex),f=`${Rs}-${l.colIndex}`,m=`${s}px`;t.__currentTransformY!==m&&(t.__currentTransformY=m,t.style.setProperty(Yn,m));let g=`calc(var(${f}, ${p}) + ${d})`,h=`var(${Yn})`,S=`translate3d(${g}, ${h}, 0px)`;t.__transformValue!==S&&(t.__transformValue=S,t.style.transform=S)};this.brain=t}getCellRealCoordinates(t,o){return this.brain.getHorizontalLayoutPositionFromMatrixCoordinates({rowIndex:t,colIndex:o})}isCellRenderedAndMappedCorrectly(t,o){let r=this.cellManager.getCellAt([t,o]),i=!!r;if(!i)return{rendered:i,mapped:!1};let a=r.getAdditionalInfo();if(!a)return{rendered:i,mapped:!1};let l=this.getCellRealCoordinates(t,o),s=l.colIndex===a.renderColIndex&&l.rowIndex===a.renderRowIndex;return{rendered:i,mapped:s}}};import*as dm from"react";var _o=class _o extends yt{constructor(t){super(t);this.cellRemoveSubscription=ye();this.cellAttachmentChangeSubscription=ye();this.attachedCells=new Set,this.detachedCells=new Set,this.allCellsOrdered=new Set}destroy(){this.reset()}onRemoveCell(t){return this.cellRemoveSubscription.onChange(r=>{r!=null&&t(r)})}onCellAttachmentChange(t){return this.cellAttachmentChangeSubscription.onChange(r=>{if(r==null)return;let{cell:i,attached:a}=r;t(i,a)})}reset(){this.attachedCells.clear(),this.detachedCells.clear(),this.allCellsOrdered.clear(),this.cellRemoveSubscription.destroy(),this.cellAttachmentChangeSubscription.destroy()}getAttachedCells(){return this.attachedCells}getDetachedCells(){return this.detachedCells}getAllCells(){return this.allCellsOrdered}createCell(){let t=this.createCellInstance();return this.detachedCells.add(t),this.allCellsOrdered.add(t),t}removeCell(t){this.detachedCells.delete(t),this.attachedCells.delete(t),this.allCellsOrdered.delete(t),t.destroy(),this.cellRemoveSubscription(t)}attachCell(t){return t&&this.attachedCells.has(t)||(t||(t=this.getDetachedCell()),this.detachedCells.delete(t),this.attachedCells.add(t),this.cellAttachmentChangeSubscription({cell:t,attached:!0})),t}detachCell(t){return this.detachedCells.has(t)?!1:(this.attachedCells.delete(t),this.detachedCells.add(t),this.cellAttachmentChangeSubscription({cell:t,attached:!1}),!0)}getDetachedCell(){let{detachedCells:t}=this,o=t.values().next().value;return o||(this.poolSize+=_o.POOL_SIZE_INCREMENT,o=t.values().next().value),o||this.error("No cells available in the pool!"),o}get attachedSize(){return this.attachedCells.size}get detachedSize(){return this.detachedCells.size}get poolSize(){return this.allCellsOrdered.size}flushPendingAfterCommitWork(){for(let t of this.attachedCells)t.flushPendingAfterCommitWork()}set poolSize(t){t=Math.ceil(t/_o.POOL_SIZE_INCREMENT)*_o.POOL_SIZE_INCREMENT;let o=this.poolSize;if(t===o)return;let{detachedCells:r}=this,i=o-t;if(i>0){i>r.size&&(i=r.size,this.debug("Trying to destroy more cells than are currently detached!"));let a=r.values();for(;i>0;){let l=a.next().value;this.removeCell(l),i--}}else for(i=-i;i>0;)this.createCell(),i--}};_o.POOL_SIZE_INCREMENT=1;var $i=_o;var cm=new Map,VI=()=>{},ws=class{constructor(e,t){this.element=null;this.mounted=!1;this.pendingAfterCommitWork=null;this.mountSubscription=ye();let o=cm.get(e)??0,r=`${e}:GridCellReact:${o}`;cm.set(e,o+1),this.debugId=r,this.cellInfo=t,this.updater=ye(),this.node=dm.createElement(vn,{key:r,name:r,updater:this.updater}),this.ref=i=>{this.element=i,i?(this.mounted=!0,this.mountSubscription(this)):this.mounted=!1}}setPendingAfterCommitWork(e){this.pendingAfterCommitWork=e}flushPendingAfterCommitWork(){if(this.pendingAfterCommitWork){let e=this.pendingAfterCommitWork;this.pendingAfterCommitWork=null,e()}}isMounted(){return this.mounted}onMount(e){return this.mountSubscription.onChange(o=>{o!=null&&e(o)})}destroy(){this.mountSubscription.destroy(),this.updater.destroy(),this.pendingAfterCommitWork=null,this.ref=VI,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}},Yi=class extends $i{constructor(t){super(`${t}:GridCellPoolForReact`);this.cellDebugId=t}createCellInstance(){return new ws(this.cellDebugId)}};import*as fm from"react";var Oo=class Oo extends yt{constructor(t){super(t);this.rowRemoveSubscription=ye();this.rowAttachmentChangeSubscription=ye();this.attachedRows=new Set,this.detachedRows=new Set,this.allRowsOrdered=new Set}destroy(){this.reset()}onRemoveRow(t){return this.rowRemoveSubscription.onChange(r=>{r!=null&&t(r)})}onRowAttachmentChange(t){return this.rowAttachmentChangeSubscription.onChange(r=>{if(r==null)return;let{row:i,attached:a}=r;t(i,a)})}reset(){this.attachedRows.clear(),this.detachedRows.clear(),this.allRowsOrdered.clear(),this.rowRemoveSubscription.destroy(),this.rowAttachmentChangeSubscription.destroy()}getAttachedRows(){return this.attachedRows}getDetachedRows(){return this.detachedRows}getAllRows(){return this.allRowsOrdered}createRow(){let t=this.createRowInstance();return this.detachedRows.add(t),this.allRowsOrdered.add(t),t}removeRow(t){this.detachedRows.delete(t),this.attachedRows.delete(t),this.allRowsOrdered.delete(t),t.destroy(),this.rowRemoveSubscription(t)}attachRow(t){return t&&this.attachedRows.has(t)||(t||(t=this.getDetachedRow()),this.detachedRows.delete(t),this.attachedRows.add(t),this.rowAttachmentChangeSubscription({row:t,attached:!0})),t}detachRow(t){return this.detachedRows.has(t)?!1:(this.attachedRows.delete(t),this.detachedRows.add(t),this.rowAttachmentChangeSubscription({row:t,attached:!1}),!0)}getDetachedRow(){let{detachedRows:t}=this,o=t.values().next().value;return o||(this.poolSize+=Oo.POOL_SIZE_INCREMENT),o=t.values().next().value,o||this.error("No rows available in the pool!"),o}get attachedSize(){return this.attachedRows.size}get detachedSize(){return this.detachedRows.size}get poolSize(){return this.allRowsOrdered.size}set poolSize(t){t=Math.ceil(t/Oo.POOL_SIZE_INCREMENT)*Oo.POOL_SIZE_INCREMENT;let o=this.poolSize;if(t===o)return;let{detachedRows:r}=this,i=o-t;if(i>0){i>r.size&&(i=r.size,this.debug("Trying to destroy more rows than are currently detached!"));let a=r.values();for(;i>0;){let l=a.next().value;this.removeRow(l),i--}}else for(i=-i;i>0;)this.createRow(),i--}};Oo.POOL_SIZE_INCREMENT=1;var qi=Oo;var pm=new Map,GI=()=>{},vs=class{constructor(e){this.element=null;this.mounted=!1;this.mountSubscription=ye();let t=pm.get(e)??0,o=`${e}:ListRowReact:${t}`;pm.set(e,t+1),this.debugId=o,this.updater=ye(),this.node=fm.createElement(vn,{key:`detail-row-${o}`,name:`detail-row-${o}`,updater:this.updater}),this.ref=r=>{this.element=r,r?(this.mounted=!0,this.mountSubscription(this)):this.mounted=!1}}isMounted(){return this.mounted}onMount(e){return this.mountSubscription.onChange(o=>{o!=null&&e(o)})}destroy(){this.mountSubscription.destroy(),this.updater.destroy(),this.ref=GI,this.element=null,this.node=null}getNode(){return this.node}update(e){this.updater(e)}getElement(){return this.element}},Xi=class extends qi{constructor(t){super(`${t}:ListRowPoolForReact`);this.rowDebugId=t}createRowInstance(){return new vs(this.rowDebugId)}};function mm(n){return{cellPool:new Yi(n),rowPool:new Xi(n)}}function gr(n){let e=n.isHorizontalLayoutBrain?new Ui(n,`${n.name}:HorizontalLayoutTableRenderer`,mm(`${n.name}:HorizontalLayoutTableRenderer`)):new Ao(n,`${n.name}:ReactHeadlessTableRenderer`,mm(`${n.name}:ReactHeadlessTableRenderer`)),t=ye();return n.onDestroy(()=>{e.destroy(),t.destroy()}),{renderer:e,onRenderUpdater:t}}function KI(n){let e=gr(n);return e.renderer.ownsPositionVars=!0,e}function BI(n){let{brain:e,renderCell:t,renderDetailRow:o,forceRerenderTimestamp:r}=n,{renderer:i,onRenderUpdater:a}=HI(()=>n.onRenderUpdater&&n.renderer?{renderer:n.renderer,onRenderUpdater:n.onRenderUpdater}:KI(e),[e,n.onRenderUpdater,n.renderer]);return Zi(()=>{i.cellHoverClassNames=n.cellHoverClassNames||[]},[i,n.cellHoverClassNames]),Zi(()=>{i.cellDetachedClassNames=n.cellDetachedClassNames||[]},[i,n.cellDetachedClassNames]),Zi(()=>{let l=e.getRenderRange();return i.renderRange(l,{onRender:a,force:!0,renderCell:t,renderDetailRow:o}),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:o})})},[i,e,t,o,a,r]),Zi(()=>{i.flushPendingAfterCommitWork()}),Qi.createElement(vn,{updater:a})}var Ji=Qi.memo(BI);import*as hr from"react";import{useEffect as WI,useLayoutEffect as jI,useRef as Cm}from"react";var gm=ge({defaultClassName:"nxbq1c1 _16lm1iwz _16lm1iw2",variantClassNames:{visible:{true:"nxbq1c3",false:"nxbq1c4"}},defaultVariants:{},compoundVariants:[]}),ea="nxbq1c0 _16lm1iwz _16lm1iw4 _16lm1iw26 _16lm1iw23 _16lm1iw1y _16lm1iw1k";var hm=ge({defaultClassName:"j26lrx0 _16lm1iwz _16lm1iw2 _16lm1iw23 _16lm1iw26",variantClassNames:{active:{true:"j26lrx2",false:"j26lrx3"}},defaultVariants:{},compoundVariants:[]});function ym(n,e){let t=e-n.getScrollOriginPageIndex();return t?`calc(${pe.runtime.totalVisibleColumnsWidthVar} * ${t})`:null}function Sm(n,e){let t="0px",o=e;n.isHorizontalLayoutBrain&&n.rowsPerPage&&(t=ym(n,n.getPageIndexForRow(o))??"0px",o=o%n.rowsPerPage);let r=n.getRowHeight(o),i=n.getItemOffsetFor(o,"vertical")-n.getScrollOrigin().scrollTop;return{activeCellRowHeight:`${r}px`,activeCellRowOffset:`${i}px`,activeCellRowOffsetX:t}}function bm(n,e){let{scrollTop:t,scrollLeft:o}=n.getDOMScrollPosition(e);return{scrollTopForActiveRow:`${-t}px`,scrollLeftForActiveRowWhenHorizontalLayout:n.isHorizontalLayoutBrain?`${-o}px`:"0px"}}function Tm(n,e,t){let[o]=e,r=e[1],i;if(n.isHorizontalLayoutBrain&&n.rowsPerPage){let u=Ie.columnOffsets.get(r),c=ym(n,n.getPageIndexForRow(o));i=c?`calc( ${c} + ${u})`:u,o=o%n.rowsPerPage}let a=typeof t=="function"?t(o):t??n.getRowHeight(o),l=n.getItemOffsetFor(o,"vertical")-n.getScrollOrigin().scrollTop,s={activeCellRowHeight:`${a}px`,activeCellRowOffset:`${l}px`};return i!==void 0&&(s.activeCellColOffset=i),s}var{rootClassName:UI}=Le,$I=`${UI}-ActiveRowIndicator`,YI=`calc(${Y.activeCellRowOffsetX} + var(${$(Y.scrollLeftForActiveRowWhenHorizontalLayout)}, 0px))`,qI={[$(Y.activeCellOffsetY)]:Y.activeCellRowOffset,transform:`translate3d(${YI}, calc( ${Y.activeCellOffsetY} + var(${$(Y.scrollTopForActiveRow)}, 0px)), 0px)`,height:Y.activeCellRowHeight,maxWidth:pe.runtime.totalVisibleColumnsWidthVar},XI=n=>{let{brain:e}=n,t=Cm(null),o=n.activeRowIndex!=null&&e.getInitialRows()>n.activeRowIndex,[r,i]=kt(),a=Cm(n.activeRowIndex);a.current=n.activeRowIndex;let l=()=>{let s=a.current;s==null||!t.current||yo(Sm(e,s),t.current)};return jI(l,[n.activeRowIndex,e]),WI(()=>{let s=p=>{yo(bm(e,p),t.current)};s(e.getScrollPosition());let u=e.onScroll(s),c=e.onRenderCountChange(i),d=e.onScrollOriginChange(l);return()=>{d(),c(),u()}},[e]),hr.createElement("div",{className:ea,"data-name":"active-row"},hr.createElement("div",{ref:t,"data-name":"active-row-indicator",className:`${$I} ${hm({active:o})}`,style:o?qI:void 0}))},Im=hr.memo(XI);import*as yr from"react";import{useEffect as ZI,useLayoutEffect as QI,useRef as Rm}from"react";var{rootClassName:JI}=Le,eR=`${JI}-ActiveCellIndicator`,tR=$(Y.columnZIndexAtIndex),wm=(n,e,t,o)=>{e!=null&&yo(Tm(n,e,t),o.current)},nR=n=>{let{brain:e}=n,[t,o]=kt(),r=Rm(null),i=n.activeCellIndex!=null&&e.getInitialRows()>n.activeCellIndex[0];QI(()=>{wm(e,n.activeCellIndex,n.rowHeight,r)},[n.activeCellIndex,n.rowHeight,e]);let a=Rm(n);return a.current=n,ZI(()=>{let l=e.onRenderCountChange(()=>{o()}),s=e.onScrollOriginChange(()=>{let{activeCellIndex:u,rowHeight:c}=a.current;wm(e,u,c,r)});return()=>{l(),s()}},[e]),yr.createElement("div",{className:ea,ref:r,"data-name":"active-cell",style:i?{zIndex:`var(${tR}-${n.activeCellIndex[1]})`}:void 0},yr.createElement("div",{"data-name":"active-cell-indicator",className:`${eR} ${gm({visible:i})}`}))},vm=yr.memo(nR);var ta=[Ap,`${pt}DetachedCell`];function na(n,e,t){t&&(t.fixedColsStart||t.fixedColsEnd||t.fixedRowsStart||t.fixedRowsEnd)&&n.updateFixedCells({fixedColsStart:t.fixedColsStart,fixedColsEnd:t.fixedColsEnd,fixedRowsStart:t.fixedRowsStart,fixedRowsEnd:t.fixedRowsEnd}),n.update({height:e.height,width:e.width,cols:e.cols,rows:e.rows,colWidth:e.colWidth,rowHeight:e.rowHeight,rowspan:e.rowspan,colspan:e.colspan})}var iR=U(Yf,ys);function xm(n){let{brain:e,scrollerDOMRef:t,scrollStopDelay:o,renderCell:r,renderDetailRow:i,activeCellRowHeight:a,cellHoverClassNames:l,renderer:s,activeRowIndex:u,activeCellIndex:c,onRenderUpdater:d,wrapRowsHorizontally:p,forceRerenderTimestamp:f,scrollVarHostRef:m,...g}=n,{autoFocus:h}=g,S=Dm(null),[y,C]=rR({width:0,height:0});Ps(()=>{o!=null&&e.setScrollStopDelay(o)},[o,e]),Ps(()=>{let R=S.current?.parentNode;return R?(h&&document.activeElement!==R&&R.focus(),ro(R,()=>{let P={height:R.clientHeight,width:R.clientWidth};e.update(P)},{debounce:50})):void 0},[p,e]);let T=Pm(R=>{let w=e.getDOMScrollPosition(R);requestAnimationFrame(()=>{S.current&&S.current.style.setProperty("transform",`translate3d(${-w.scrollLeft}px, ${-w.scrollTop}px, 0px)`)})},[e]),I=Pm(R=>{e.setScrollPosition(e.toContentScrollPosition(R),T)},[e,T]);Ps(()=>{let R=e.onRenderCountChange(()=>{C(e.getNativeScrollSize())});return C(e.getNativeScrollSize()),T(e.getScrollPosition()||{scrollLeft:0,scrollTop:0}),R},[e]);let b=Dm({brain:e,vertical:1,horizontal:1});return oR(()=>{let R=b.current,w=e.getScrollRatio("vertical"),v=e.getScrollRatio("horizontal");b.current={brain:e,vertical:w,horizontal:v};let P=S.current?.parentElement;if(!P||R.brain!==e||R.vertical===w&&R.horizontal===v)return;let x=e.toNativeScrollPosition(e.getScrollPosition());R.vertical!==w&&(P.scrollTop=x.scrollTop),R.horizontal!==v&&(P.scrollLeft=x.scrollLeft)},[y,e]),qn.createElement(tm,{onContainerScroll:I,...g,ref:t},qn.createElement("div",{ref:S,className:iR,"data-name":"scroll-transform-target"},qn.createElement(Ji,{forceRerenderTimestamp:f,renderer:s,onRenderUpdater:d,renderCell:r,renderDetailRow:i,brain:e,cellHoverClassNames:l,cellDetachedClassNames:ta}),c!=null?qn.createElement(vm,{brain:e,rowHeight:a,activeCellIndex:c}):null),u!=null?qn.createElement(Im,{brain:e,activeRowIndex:u}):null,qn.createElement($f,{width:y.width,height:y.height}))}function Mm(n,e,t,o){let r=new Map,i=new Map,a=new Map;n.forEach((c,d)=>{let p=c.id,f=n[d-1],m=f?.id??"",g=new Set,h=f?.computedPinned!==c.computedPinned?new Set:a.get(m)??new Set;a.set(p,g);let S={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],S);let y=c.columnGroup,C,T=S;for(;y;){let I=e[y];if(I){g.add(y);let b=[p,...g];C=h.has(y)?i.get(y):void 0,C||(C={id:y,type:"group",ref:I,columnItems:[],children:[],groupOffset:0,uniqueGroupId:[y],computedWidth:0,computedPinned:S.computedPinned,depth:t.get(y)??0},r.set(b,C),i.set(y,C)),C.columnItems.push(S),C.uniqueGroupId.push(S.id),T&&!h.has(T.id)&&C.children.push(T),T=C,y=I.columnGroup}else break}});let l=[],s=new j,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"&&Em(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<=o+1;d++)s.set([d,c.ref.computedVisibleIndex],c)}),r.clear(),i.clear(),{tree:l,pathsToCells:s}}function Em(n,e=0){n.forEach(t=>{let o=t.type==="column"?t.ref.computedWidth:t.columnItems.reduce((r,i)=>r+i.ref.computedWidth,0);t.computedWidth=o,t.groupOffset=e,t.type==="group"&&Em(t.children),e+=o})}import*as Dn from"react";import{useCallback as Vm,useEffect as pR,useMemo as fR,useRef as mR}from"react";import*as Ds from"react";import*as Fm from"react";import{useCallback as Om}from"react";import{useRef as Am,useState as aR}from"react";import*as Sr from"react";var{rootClassName:lR}=Le,sR=`${lR}HeaderCell_ResizeHandle`;function uR(n){let e=Am(null),[t,o]=aR(!1),r=Am(t);r.current=t;let i=n.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,h=Tf(n.groupColumns.map(T=>T.computedVisibleIndex),{columns:n.columns,domRef:e}),S=T=>{a==="end"&&(T*=-1);let{constrained:I,adjustedDiffs:b,adjustedDiff:R}=n.computeResize(T);return r.current!==I&&o(I),h.resize(b),R},y=T=>{if(g){let I=n.groupColumns.reduce((w,v)=>w+v.computedWidth-v.computedMinWidth,0),b=n.brain.getAvailableSize(),R={width:b.width+I,height:b.height};n.brain.update(R),g=!1}S(Math.round(T.clientX-f))},C=T=>{m.releasePointerCapture(p),m.removeEventListener("pointermove",y),m.removeEventListener("pointerup",C);let I=Math.round(T.clientX-f),b=S(I);h.resize(n.groupColumns.map(()=>0)),n.onResize(b)};m.addEventListener("pointermove",y),m.addEventListener("pointerup",C)},c=(a===!1||a==="start")&&s?{right:a==="start"?void 0:pe.components.HeaderCell.resizeHandleWidth}:a==="end"&&l?{right:void 0}:void 0;return Sr.createElement("div",{ref:e,className:`${sR} ${Fi} ${Li({computedPinned:a,computedFirstInCategory:l,computedLastInCategory:s})}`,onPointerDown:u},Sr.createElement("div",{style:{...c,...n.style},className:Ni({constrained:t})}))}var _m=Sr.memo(uR);function Nm(n,e){let{bodyBrain:t,groupHeight:o,columnGroup:r,columnGroupsMaxDepth:i}=e,{computedVisibleColumns:a,getState:l,getComputed:s,actions:u}=ee(g=>({computedVisibleColumns:g.computed.computedVisibleColumns,getState:g.getState,getComputed:g.getComputed,actions:g.actions})),c=n[n.length-1],d=Om(g=>{let h=l(),{columnSizing:S,viewportReservedWidth:y,bodySize:C}=h,T=s().computedVisibleColumns,I=!1,b=T.reduce((v,P)=>(P.computedFlex&&(v[P.id]={...S[P.id],flex:P.computedWidth},I=!0),v),{}),R=I?{...S,...b}:S;return Id({availableSize:ss(C),reservedWidth:y||0,dragHandleOffset:g,dragHandlePositionAfter:c.computedVisibleIndex,columnSizing:R,columnGroupSize:n.length,items:T.map(v=>({id:v.id,resizable:v.computedResizable,computedFlex:v.computedFlex,computedWidth:v.computedWidth,computedMinWidth:v.computedMinWidth,computedMaxWidth:v.computedMaxWidth}))})},[c]),p=Om(g=>{let{columnSizing:h,reservedWidth:S}=d(g);u.viewportReservedWidth=S,u.columnSizing=h},[d]);return n.some(g=>g.computedResizable)?Fm.createElement(_m,{brain:t,style:{height:o*(i-r.depth+2)},columns:a,groupColumns:n,computeResize:d,onResize:p}):null}var Lm=`${pt}HeaderGroup`,km=$(Y.columnWidthAtIndex),cR=$(Y.columnZIndexAtIndex);function zm(n){let{columnGroup:e,height:t,columns:o,bodyBrain:r,columnGroupsMaxDepth:i}=n,{header:a,style:l}=e;a instanceof Function&&(a=a({columnGroup:e,horizontalLayoutPageIndex:n.horizontalLayoutPageIndex}));let s=Nm(o,{bodyBrain:r,groupHeight:t,columnGroup:e,columnGroupsMaxDepth:i}),u=o[0],c=o.length>1?"calc( "+o.map(f=>`var(${km}-${f.computedVisibleIndex})`).join(" + ")+" )":`var(${km}-${u.computedVisibleIndex})`,d=`calc(var(${cR}-${u.computedVisibleIndex}) + ${i-e.depth})`,p=typeof l=="function"?l({columnGroup:e,horizontalLayoutPageIndex:n.horizontalLayoutPageIndex}):l;return p=p&&typeof p=="object"?p:{},p.width=c,p.height=t,Ds.createElement("div",{ref:n.domRef,"data-group-id":e.uniqueGroupId,className:U(cd,Lm),style:p,"data-z-index":d},Ds.createElement("div",{className:U(`${Lm}__header-content`,_t)},a),s)}import{useContext as dR}from"react";import*as Es from"react";var xs;function As(){return xs||(xs=Es.createContext({dataSourceApi:null,getDataSourceState:()=>null,assignState:()=>null,getDataSourceMasterContext:()=>{},dataSourceState:null,dataSourceActions:null}))}var Ms;function oa(){return Ms||(Ms=Es.createContext(null))}function Fe(n){let e=oa(),t=dR(e);return io(t,n)}function Wt(){return Fe(n=>({getDataSourceState:n.getDataSourceState,getDataSourceMasterContext:n.getDataSourceMasterContext,dataSourceActions:n.dataSourceActions,dataSourceApi:n.dataSourceApi,assignState:n.assignState}))}var{rootClassName:gR}=Le,hR=[],Gm=`${gR}Header`,yR=id({overflow:!1}),Hm=()=>{};function SR(n){let{bodyBrain:e,headerBrain:t,columns:o,style:r,className:i,columnHeaderHeight:a,columnAndGroupTreeInfo:l,columnGroupsMaxDepth:s}=n,{getState:u,headerOptions:c,headerRenderer:d,headerOnRenderUpdater:p,showColumnFilters:f,computedColumnsMap:m}=ee(D=>({computedColumnsMap:D.computed.computedColumnsMap,getState:D.getState,headerOptions:D.state.headerOptions,headerRenderer:D.state.headerRenderer,headerOnRenderUpdater:D.state.headerOnRenderUpdater,showColumnFilters:D.state.showColumnFilters})),g=mR(null),h=Vm(D=>{if(g.current){let{scrollLeft:E}=t.getDOMScrollPosition(D);g.current.style.transform=`translate3d(${-E}px, 0px, 0px)`}},[t]);pR(()=>{let D=t.onScroll(h);return h(t.getScrollPosition()||{scrollLeft:0,scrollTop:0}),D},[t]);let S={ref:g,className:U(Gm,`${Gm}--virtualized`,i,yR),style:{...r,height:a}},{getDataSourceState:y,dataSourceApi:C,dataSourceActions:T}=Wt(),{allRowsSelected:I,someRowsSelected:b,selectionMode:R,filterTypes:w,filterDelay:v}=Fe(D=>({allRowsSelected:D.dataSourceState.allRowsSelected,someRowsSelected:D.dataSourceState.someRowsSelected,selectionMode:D.dataSourceState.selectionMode,filterTypes:D.dataSourceState.filterTypes,filterDelay:D.dataSourceState.filterDelay})),P=fR(()=>({allRowsSelected:I,someRowsSelected:b,selectionMode:R}),[I,b,R]),x=Vm(D=>{let{rowIndex:E,colIndex:z,domRef:V,height:N,widthWithColspan:L,heightWithRowspan:F,hidden:K}=D,q=o[z];if(!q||K)return null;let _=t.isHorizontalLayoutBrain?t.getPageIndexForRow(E):null,k=l?l.pathsToCells.get([E,z]):null;if(k&&k.type==="group"){let H=k.columnItems.map(le=>le.ref),Z={...k.ref,id:k.id,uniqueGroupId:k.uniqueGroupId,depth:k.depth,columns:H.map(le=>le.id),computedWidth:k.computedWidth,groupOffset:k.groupOffset};return u().columnGroupVisibility[k.id]!==!1?Dn.createElement(zm,{horizontalLayoutPageIndex:_,bodyBrain:e,columnGroupsMaxDepth:s,domRef:V,columns:H,width:L,height:N,columnGroup:Z}):null}return Dn.createElement(Bm,{domRef:V,column:q,horizontalLayoutPageIndex:_,headerOptions:c,dataSourceStatePartialForHeaderCell:P,filterTypes:w,filterDelay:v,getDataSourceState:y,dataSourceApi:C,dataSourceActions:T,width:L,height:F,columnsMap:m})},[c,o,a,l,s,f,t,y,C,T,w,v,P]),M=Hn(yi);return Dn.createElement(Un,{orientation:"horizontal",dragListId:M,dragStrategy:"inline",onDrop:Hm,updatePosition:Hm},D=>Dn.createElement("div",{...D,...S,className:U(D.className,S.className)},Dn.createElement(Ji,{name:"header",renderCell:x,brain:t,renderer:d,onRenderUpdater:p,cellHoverClassNames:hR,cellDetachedClassNames:ta})))}var Km=Dn.memo(SR);function Wm(n){let{headerBrain:e,bodyBrain:t,scrollbars:o}=n,{computedPinnedStartColumns:r,computedPinnedEndColumns:i,computedVisibleColumns:a,columnSize:l}=ee(b=>({computedPinnedStartColumns:b.computed.computedPinnedStartColumns,computedPinnedEndColumns:b.computed.computedPinnedEndColumns,computedVisibleColumns:b.computed.computedVisibleColumns,columnSize:b.computed.columnSize})),{columnHeaderHeight:s,columnGroupsDepthsMap:u,columnGroupsMaxDepth:c,computedColumnGroups:d,showColumnFilters:p}=ee(b=>({columnHeaderHeight:b.state.columnHeaderHeight,columnGroupsDepthsMap:b.state.columnGroupsDepthsMap,columnGroupsMaxDepth:b.state.columnGroupsMaxDepth,computedColumnGroups:b.state.computedColumnGroups,showColumnFilters:b.state.showColumnFilters})),f=!d||!Object.keys(d).length?1:c+2,m=f*s+(p?s:0),g=Ft.useMemo(()=>{if(!(!d||!Object.keys(d).length))return Mm(a,d,u,c)},[a,d,u]),h=Ft.useCallback(({rowIndex:b,colIndex:R})=>{let w=a[R],v=1,P=1;if(!w||!g)return{rowspan:v,colspan:P};let x=g.pathsToCells.get([b,R]);if(!x)return{rowspan:v,colspan:P};if(x.type==="column")return{colspan:P,rowspan:f-x.depth};let M=x.columnItems.findIndex(D=>D.id===w.id);return{rowspan:v,colspan:M===0?x.columnItems.length:1}},[d,c,a,g,f,u]),S=Ft.useCallback(({rowIndex:b,colIndex:R})=>h({rowIndex:b,colIndex:R}).rowspan,[h]),y=Ft.useCallback(({rowIndex:b,colIndex:R})=>h({rowIndex:b,colIndex:R}).colspan,[h]),C=Ft.useCallback(b=>p?b<f-1?s:2*s:s,[f,p,s]);na(e,{colWidth:l,rowHeight:C,rows:f,cols:a.length,height:m,rowspan:S,colspan:y},{fixedColsEnd:i.length,fixedColsStart:r.length});let T=Ft.createElement(Km,{columns:a,headerBrain:e,bodyBrain:t,columnHeaderHeight:m,columnGroupsMaxDepth:c,columnAndGroupTreeInfo:g}),I=o.vertical&&zt()?Ft.createElement("div",{className:pd,style:{zIndex:1e3,width:zt()}}):null;return Ft.createElement("div",{className:`${$l} ${hd}`,style:{height:m}},T,I)}var{ManagedComponentContextProvider:bR}=Et({initSetupState:jf,forwardProps:Uf,Context:hs()});function _s(n){let{getComputed:e,header:t,brain:o,headerBrain:r,wrapRowsHorizontally:i}=ee(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?br.createElement(bR,{...n},br.createElement(Wm,{wrapRowsHorizontally:!!i,bodyBrain:o,headerBrain:r,scrollbars:a})):null}function jm(){return br.useContext(hs()).componentState}var wR=n=>{let{allRowsSelected:e,someRowsSelected:t,api:o,dataSourceApi:r}=n,i=e?!0:t?null:!1,{components:a,isTree:l}=o.getState(),s=a?.CheckBox||bn;return Ee.createElement(s,{domProps:{className:Co},onChange:u=>{if(l){u?r.treeApi.selectAll():r.treeApi.deselectAll();return}u?o.rowSelectionApi.selectAll():o.rowSelectionApi.deselectAll()},checked:i})},Ai=Ee.createContext(null);var vR=$(Y.columnZIndexAtIndex),PR=$(Y.columnVisibilityAtIndex),Os=Ee.createElement("div",{className:Zr[1]}),gG=Jr({"data-name":"","data-field":"","data-header-align":"","data-column-id":"","data-sort":"","data-sort-index":"",[Ct]:"",[Mo]:""});function DR(n){let e=n.column,{allowColumnHideWhileDragging:t}=jm(),{dataSourceStatePartialForHeaderCell:o,horizontalLayoutPageIndex:r,getDataSourceState:i,dataSourceApi:a,dataSourceActions:l,filterTypes:s,filterDelay:u}=n,{allRowsSelected:c,someRowsSelected:d,selectionMode:p}=o,{onDragItemPointerDown:f,dragListId:m}=Eo(),{api:g,getComputed:h,getState:S,actions:y,getDataSourceMasterContext:C,showColumnFilters:T,components:I,portalDOMRef:b,columnHeaderHeight:R,columnReorderDragColumnId:w,columnMenuVisibleForColumnId:v,columnReorderInPageIndex:P}=ee(W=>({api:W.api,getComputed:W.getComputed,getState:W.getState,actions:W.actions,getDataSourceMasterContext:W.getDataSourceMasterContext,showColumnFilters:W.state.showColumnFilters,components:W.state.components,portalDOMRef:W.state.portalDOMRef,columnHeaderHeight:W.state.columnHeaderHeight,columnReorderDragColumnId:W.state.columnReorderDragColumnId,columnMenuVisibleForColumnId:W.state.columnMenuVisibleForColumnId,columnReorderInPageIndex:W.state.columnReorderInPageIndex})),x=w===e.id,M=P!=null?r!==P:!1,{onResize:D,height:E,width:z,headerOptions:V,columnsMap:N}=n,L=e.computedSortInfo,F=e.header,K=Um(W=>{de.current=W,n.domRef?.(W)},[n.domRef]),q=V.alwaysReserveSpaceForSortIcon,_=e.headerAlign??e.align,k=(typeof _=="function"?_({isHeader:!0,column:e}):_)??"start",H=(typeof e.verticalAlign=="function"?e.verticalAlign({isHeader:!0,column:e}):e.verticalAlign)??"center",Z=ft(e,{actions:y,api:g,dataSourceActions:l,dataSourceApi:a,getComputed:h,getDataSourceState:i,getDataSourceMasterContext:C,getState:S}),Ce=Z.isSortable(),le=Ce&&(e.computedSorted||q)?Ee.createElement(Oi,{index:e.computedMultiSort?e.computedSortIndex+1:void 0,style:{marginInlineStart:pe.spacing[2],marginInlineEnd:pe.spacing[2]},className:`${Kn}__sort-icon ${fd} ${gd({align:k})}`,direction:e.computedSorted?e.computedSortedAsc?1:-1:0}):null,we=e.computedFilterable&&e.computedFiltered?Ee.createElement(po,null):null,ve=e.headerCssEllipsis??e.cssEllipsis??!0,ue={reserveSpaceWhenHidden:k==="center",menuVisible:v===e.id,style:k==="end"?{marginInlineStart:`calc(${pe.components.HeaderCell.resizeHandleActiveAreaWidth} / 2)`,marginInlineEnd:pe.spacing[2]}:{marginInlineEnd:`calc(${pe.components.HeaderCell.resizeHandleActiveAreaWidth} / 2)`,marginInlineStart:pe.spacing[2]},domProps:{onMouseDown:W=>{W.stopPropagation(),Z.toggleContextMenu(W.target)}}},ne=e.components?.MenuIcon||I?.MenuIcon||cr,se=Ee.createElement(ne,{...ue}),de=IR(null),X={horizontalLayoutPageIndex:r,dragging:x,domRef:K,htmlElementRef:de,renderLocation:"column-header",column:e,columnsMap:N,columnSortInfo:L,columnFilterValue:e.computedFilterValue,filtered:e.computedFiltered,someRowsSelected:d,allRowsSelected:c,selectionMode:p,api:g,dataSourceApi:a,columnApi:Z,renderBag:{sortIcon:le,filterIcon:we,menuIcon:se,menuIconProps:ue,selectionCheckBox:null,header:e.header&&typeof e.header!="function"?e.header:e.name}},Q=X,B=Q.renderBag.header,re=()=>{let W={...X,renderBag:{...X.renderBag}};if(e.renderSortIcon&&(W.renderBag.sortIcon=Ee.createElement(Rn,{render:e.renderSortIcon,renderParam:{...W,renderBag:{...W.renderBag}}})),e.renderFilterIcon&&(W.renderBag.filterIcon=Ee.createElement(Rn,{render:e.renderFilterIcon,renderParam:{...W,renderBag:{...W.renderBag}}})),typeof e.renderMenuIcon=="function"&&(W.renderBag.menuIcon=Ee.createElement(Rn,{render:Ye=>{if(typeof e.renderMenuIcon!="function")return null;let ht=e.renderMenuIcon(Ye);return ht?ht.type===ne||ht.type===cr?ht:Ee.createElement(ne,{...ue},ht):null},renderParam:{...W,renderBag:{...W.renderBag}}})),e.renderSelectionCheckBox&&p==="multi-row"){W.renderBag.selectionCheckBox=Ee.createElement(Rn,{render:wR,renderParam:{...W,renderBag:{...W.renderBag}}});let Ye=e.renderHeaderSelectionCheckBox??e.renderSelectionCheckBox;Ye&&Ye!==!0&&(W.renderBag.selectionCheckBox=Ee.createElement(Rn,{render:Ye,renderParam:{...W,renderBag:{...W.renderBag}}}))}F instanceof Function&&(W.renderBag.header=B=Ee.createElement(Rn,{render:F,renderParam:{...W,renderBag:{...W.renderBag}}}));let ot=e.renderMenuIcon===!1?null:W.renderBag.menuIcon,ie=ve?Ee.createElement("div",{className:_t},W.renderBag.header):W.renderBag.header,Me=Ee.createElement(Ee.Fragment,null,k==="center"?Os:null,W.renderBag.selectionCheckBox,ie,W.renderBag.sortIcon,W.renderBag.filterIcon,k==="center"?Os:null,k!=="center"?Os:null,ot);return e.renderHeader?Ee.createElement(Rn,{render:e.renderHeader,renderParam:{...W,renderBag:{...W.renderBag,all:Me}}}):Me};CR(()=>{let W=null,ot=de.current;return D&&ot&&(W=ro(ot,D)),()=>{W?.()}},[de.current,n.onResize]);let te={height:E};e.headerStyle&&(te=typeof e.headerStyle=="function"?{...te,...e.headerStyle(Q)||{}}:{...te,...e.headerStyle});let ae=typeof e.headerClassName=="function"?e.headerClassName(Q):e.headerClassName,{onPointerDown:O,proxyPosition:A,dragColumnOutside:ce}=Rp({columnId:e.id,domRef:de,horizontalLayoutPageIndex:r,allowColumnHideOnDrag:t}),he=null,Re=Ai.Provider,Se={filtered:e.computedFiltered,verticalAlign:H,align:k},xe=Ee.useMemo(()=>Pf({columnId:e.id,filterDelay:u,api:g,getState:S,getComputed:h,getDataSourceState:i}),[u,e.id]),Ue=e.computedFilterType,Ke=s[Ue],tt=e.computedFilterable?e.computedFilterValue?.filter.operator??Ke?.defaultOperator:void 0,nt=e.computedFilterable&&Ke?Ke.operators.find(W=>W.name===tt):void 0,Ze=nt?.components?.FilterEditor||Ke?.components?.FilterEditor||e.components?.FilterEditor||ho,$e=Ke?.components?.FilterOperatorSwitch||e.components?.FilterOperatorSwitch,G=vf(e,{horizontalLayoutPageIndex:r}),J=`var(${vR}-${e.computedVisibleIndex})`;te.zIndex=J,te.visibility=`var(${PR}-${e.computedVisibleIndex}, visible)`;let me={"data-field":`${e.field||""}`,"data-column-id":e.id,[Ct]:e.id,[Mo]:m,"data-header-align":k,"data-name":"HeaderCell","data-sort":e.computedSortedAsc?"asc":e.computedSortedDesc?"desc":"none","data-sort-index":`${e.computedSortIndex??-1}`},be=e.computedFilterable?Ee.createElement(Od,{horizontalLayoutPageIndex:r,filterEditor:Ze,filterOperatorSwitch:$e??Fd,operator:nt,filterTypes:s,onChange:xe,columnFilterType:Ue,columnLabel:e.field||e.name||e.id,columnFilterValue:e.computedFilterValue,columnHeaderHeight:R}):Ee.createElement(Nd,null);Q.renderBag.filterEditor=be;let at=Um(W=>{O(W),f(W)},[O,f]),oe=re();return x&&A&&(he=Ee.createElement("div",{key:e.id,className:`${Kn}Proxy ${nd}`,style:{height:E,width:z,left:A.left??0,top:A.top??0}},Ee.createElement("div",{className:od({visible:ce})},Ee.createElement(Wf,{size:16})),B),he=RR(he,b.current)),Ee.createElement(Re,{value:Q},Ee.createElement(Mi,{domRef:K,horizontalLayoutPageIndex:n.horizontalLayoutPageIndex,cellType:"header",column:e,...me,"data-z-index":J,style:te,width:z,onPointerDown:at,contentClassName:U(td(Se),Mc[k]),contentStyle:T?{height:E/2}:void 0,className:U(Kn,Fc.none,Ce?Dc.pointer:"",ae,ci(e,[Kn,Zt],rd,{dragging:x,insideDisabledDraggingPage:M,align:k,verticalAlign:H,rowSelected:!1,cellSelected:!1,rowDisabled:!1,zebra:!1,rowActive:!1,firstRow:!0,firstRowInHorizontalLayoutPage:!0,treeNode:!1,groupCell:!1,groupRow:!1,rowExpanded:!1}),ed),cssEllipsis:ve,afterChildren:Ee.createElement(Ee.Fragment,null,T?be:null,G),renderChildren:oe}),he)}var Bm=Ee.memo(DR);function si(){return TR(Ai)}import*as en from"react";import{useEffect as _R}from"react";function $m(n,e){let{separator:t}=e??{separator:"-"};return n.replace(/([a-z\d])([A-Z])/g,"$1"+t+"$2").replace(new RegExp("("+t+"[A-Z])([A-Z])","g"),"$1"+t+"$2").toLowerCase()}var qm="https://infinite-table.com",Xm="Invalid Infinite Table license. See console for details.",Zm={padding:pe.spacing[2],textAlign:"end",opacity:"1",visibility:"visible",display:"block",fontSize:"0.85rem"},xR={...Zm,background:"white",color:"black"},MR={...Zm,background:"#fee2e2",color:"#991b1b"},Qm={opacity:"1",visibility:"visible",display:"inline-block",pointerEvents:"all",textDecoration:"underline"},ER={...Qm,color:"black"},AR={...Qm,color:"#991b1b"};function Fs(n){return n?{footer:MR,anchor:AR}:{footer:xR,anchor:ER}}var Ym=(n,e)=>{if(n)for(let[t,o]of Object.entries(e))n.style.setProperty($m(t),o,"important")};function Jm(n,e){let t=Fs(e),o=()=>{setTimeout(()=>{let i=n();Ym(i,t.footer),Ym(i?.querySelector("a")??null,t.anchor)})};o();let r=setInterval(o,1e3);return()=>{clearInterval(r)}}var eg=en.forwardRef(function(e,t){let{invalid:o=!1,...r}=e,{rootClassName:i}=Xr(),a=en.useRef(null),l=en.useCallback(u=>{a.current=u,t&&(typeof t=="function"?t(u):t.current=u)},[]);_R(()=>Jm(()=>a.current,o),[o]);let s=Fs(o);return en.createElement("div",{ref:l,...r,className:U(`${i}-Footer`,o?`${i}-Footer--invalid`:null,Bd,r.className),style:s.footer},o?`${Xm} `:null,"Powered by"," ",en.createElement("a",{href:qm,rel:"noopener noreferrer",role:"link",target:"_blank",style:s.anchor},"Infinite Table"))});var ra=class{constructor(e){let t=e instanceof Object.getPrototypeOf(this).constructor?e.getState():e,o=this.getPositiveFromState(t),r=this.getNegativeFromState(t);this.update({negativeItems:r,positiveItems:o})}getInitialState(){return this.initialState}destroy(){this.positiveMap?.clear(),this.negativeMap?.clear(),delete this.positiveMap,delete this.negativeMap}update(e){let{positiveItems:t,negativeItems:o}=e;if(this.allNegative=o===!0,this.allPositive=t===!0,this.allNegative&&this.allPositive)throw"Cannot have both negativeItems and positiveItems be true!";o!==!0&&(this.negativeMap?(this.negativeMap.clear(),this.negativeMap.fill(o.map(r=>[r,!0]))):this.negativeMap=new j(o.map(r=>[r,!0])),this.positiveMap&&this.positiveMap.clear()),t!==!0&&(this.positiveMap?(this.positiveMap.clear(),this.positiveMap.fill(t.map(r=>[r,!0]))):this.positiveMap=new j(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 Rt=class extends ra{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 xt(){let n=_e().performance?.now();return`${Date.now()}:${n}`}function ia(n,e){return n&&n.filter(t=>{let o=e[t.filter.type];return!(!o||o.emptyValues&&o.emptyValues.includes(t.filter.value))})}var tg=new WeakMap;function aa(n,e){if(!n||!n.length)return[];let t=tg.get(n);t||(t=new WeakMap,tg.set(n,t));let o=t.get(e);if(o)return o;let r=[],i=ia(n,e)||[];for(let a=0,l=i.length;a<l;a++){let s=i[a],u=e[s.filter.type];if(s.disabled||!u)continue;let c;for(let d=0;d<u.operators.length;d++){let p=u.operators[d];p.name===s.filter.operator&&(c=p.fn)}c&&r.push({field:s.field,valueGetter:s.valueGetter||u.valueGetter,fn:c,value:s.filter.value,emptyValues:u.emptyValues})}return t.set(e,r),r}function Ns(n,e){if(!n.length)return!0;let{data:t}=e,o={data:t,index:e.index,dataArray:e.dataArray,primaryKey:e.primaryKey,field:void 0,filterValue:void 0,currentValue:void 0,emptyValues:[]};for(let r=0,i=n.length;r<i;r++){let a=n[r];if(o.field=a.field,o.filterValue=a.value,o.currentValue=a.valueGetter?a.valueGetter(o):a.field?t[a.field]:t,o.emptyValues=a.emptyValues,!a.fn(o))return!1}return!0}var OR=0;function ng(n){return OR++,Ns(aa(n.filterValue,n.filterTypes),n)}function Ls(n){return aa(n.filterValue,n.filterTypes).length?n.isLeafNode?ng(n):n.filterTreeNode(n.data):!0}var FR="group-by",og="group-by-";function rg(n){let e=n.map(t=>t.valueGetter?o=>t.valueGetter({data:o,field:t.field}):t.field??t.groupField).filter(Boolean);if(e.length)return e.length===1&&typeof e[0]!="function"?e[0]:e}function la(n,e){if(!n?.length||!e?.length)return n;let t=!1,o=n.map(r=>{if(r.field!=null||!r.id)return r;if(r.id===FR){let i=rg(e);return i==null?r:(t=!0,{...r,field:i})}if(r.id.startsWith(og)){let i=r.id.slice(og.length),a=e.find(s=>String(s.field)===i||s.groupField===i);if(!a)return r;let l=rg([a]);return l==null?r:(t=!0,{...r,field:l})}return r});return t?o:n}var ig=!0,NR={originalDataArray:!0,changes:!0},LR={filterValue:(n,e)=>JSON.stringify(n)===JSON.stringify(e),groupRowsState:(n,e)=>JSON.stringify(n)===JSON.stringify(e)};function Nt(n,e,t){let o=la(n.sortInfo,n.groupBy),r=n.multiSort?o:o?.[0]??null,i={append:!1,originalDataArray:n.originalDataArray,sortInfo:r,refetchKey:n.refetchKey,groupBy:n.groupBy,pivotBy:n.pivotBy,filterValue:n.filterValue,aggregationReducers:n.aggregationReducers};if(t&&(i.masterRowInfo=t.masterRowInfo),i.groupBy&&(i.groupRowsState=n.groupRowsState.getState()),n.livePagination!==void 0&&(i.livePaginationCursor=n.livePaginationCursor,i.__cursorId=n.cursorId),n.lazyLoad&&(n.lazyLoadBatchSize!=null&&n.lazyLoadBatchSize>0&&(i.lazyLoadBatchSize=n.lazyLoadBatchSize,i.lazyLoadStartIndex=0),i.groupKeys=[],n.selectionMode==="multi-row"&&(i.multiRowSelectionTarget=n.multiRowSelectionTarget)),e&&Object.assign(i,e),i.filterValue&&i.filterValue.length){let s=ks(i.filterValue,{filterMode:n.filterMode,filterTypes:n.filterTypes});s&&s.length&&(i.filterValue=s)}let a={},l=n.dataParams||{};for(let s in i)if(i.hasOwnProperty(s)&&!NR[s]){let u=s,c=LR[u],d=i[u],p=l[u];(c?c(d,p):d===p)||(a[u]=!0)}return i.changes=a,i}function tn(n,e,t,o,r){let i=Nt(e,o,r),a=i.append;if(e.lazyLoad){let c=e.originalLazyGroupData,d=[bt,...i.groupKeys||[]],p=c.get(d);if(!p){let f=[...i.groupKeys||[],i.lazyLoadStartIndex??0];e.lazyLoadCacheOfLoadedBatches.set(f,!0)}if(p&&p.cache&&d.length>1){let f=p.children,m=f.length,g=!0;for(let h=0;h<m;h++)if(f[h]==null){g=!1;break}if(g)return Promise.resolve(!0)}p?p.childrenLoading||(p.childrenLoading=!0):c.set(d,{error:void 0,children:[],childrenLoading:!0,childrenAvailable:!1,cache:ig,totalCount:0}),t.originalLazyGroupDataChangeDetect=xt()}if(typeof n=="function")try{n=n(i)}catch(c){n=Promise.reject(c)}let s=typeof n=="object"&&typeof n.then=="function"&&(!e.lazyLoad||!a&&!i.groupKeys?.length);s&&(t.loading=!0);let u=c=>{if(console.error('The DataSource "data" function failed:',c),e.lazyLoad){let d=i.groupKeys||[],p=e.originalLazyGroupData.get([bt,...d]),f=c instanceof Error?c.message:String(c);if(d.length&&p&&!p.childrenAvailable)p.childrenLoading=!1,p.cache=!1,p.error=f,t.originalLazyGroupDataChangeDetect=xt();else{let m=e.lazyLoadCacheOfLoadedBatches,g=[...d,i.lazyLoadStartIndex??0];m.has(g)&&m.set(g,"failed"),p&&(p.childrenLoading=!1,p.error=f)}}s&&(t.loading=!1)};return Promise.resolve(n).then(c=>{let d=[],p=!1;if(Array.isArray(c.data)){let m=c;if(d=m.data,m.livePaginationCursor!==void 0&&(t.livePaginationCursor=m.livePaginationCursor),m.mappings&&(t.pivotMappings=m.mappings),e.lazyLoad||(t.unfilteredCount=m.totalCountUnfiltered??d.length),e.lazyLoad){let h=function(S,y,C){let T=[bt,...S],I=y.data,b={cache:y.cache??ig,childrenLoading:!1,childrenAvailable:!0,totalCount:y.totalCount??I.length,totalCountUnfiltered:y.totalCountUnfiltered,totalChildrenCount:y.totalChildrenCount,totalChildrenCountUnfiltered:y.totalChildrenCountUnfiltered,children:I,error:y.error},R=[];if(i.lazyLoadBatchSize&&!C){let v=g.get(T),P=!v,x=Pd({children:!0},v||{},b);P&&(x.chidren=[]),x.children.length=x.totalCount;let M=i.lazyLoadStartIndex??0,D=Math.min(y.totalCount??I.length,M+i.lazyLoadBatchSize);for(let E=M;E<D;E++){let z=b.children[E-M];if(!z)throw`lazily loaded item not found at index ${E-M}`;x.children[E]=z,z.dataset&&R.push({keys:z.keys,dataset:z.dataset})}P&&g.set(T,x)}else b.children.forEach(v=>{v&&v.dataset&&R.push({keys:v.keys,dataset:v.dataset})}),b.children.length=b.totalCount,g.set(T,b);let w=!1;if(!S||!S.length){let v=g.get([bt]);t.originalDataArray=[...v.children],w=!0}if(w||(t.originalLazyGroupDataChangeDetect=xt()),R.length){let v=S;R.forEach(({keys:P,dataset:x})=>{h(P,x,v)})}};var f=h;let g=e.originalLazyGroupData;p=!0,h(i.groupKeys||[],m)}}else d=c;p||(t.originalDataArray=a?e.originalDataArray.concat(d):d),s&&(t.loading=!1)}).catch(u)}function ks(n,{filterTypes:e,filterMode:t}){return t==="local"?!n||!n.some(o=>o.valueGetter)?n:n.map(ag):(ia(n,e)||[]).map(ag)}function ag(n){if(!n.valueGetter)return n;let e={...n};return delete e.valueGetter,e}function lg(){let n;return(e,t,o)=>{if(n&&n.filterValue===e&&n.filterTypes===t&&n.filterMode===o)return n.result;let r=ks(e,{filterTypes:t,filterMode:o});return n&&n.filterValue===e&&JSON.stringify(n.result)===JSON.stringify(r)&&(r=n.result),n={filterValue:e,filterTypes:t,filterMode:o,result:r},r}}var kR=()=>new Promise(n=>{Ve(n)});function zs(n,e){let t=!!n,{stateReadyAsDetails:o}=e(),r=t&&n.shouldRestoreState?o:!0;return{isDetail:t,isDetailReady:r}}function sg(n){let{lazyLoad:e,lazyLoadBatchSize:t,lazyLoadCacheOfLoadedBatches:o}=n;if(!e||!t||t<=0)return!1;for(let r of o.keys())if(r.length===1)return!0;return!1}function ug(n){for(let[e,t]of n.entries())t==="failed"&&n.delete(e)}function cg(n,e){let{startIndex:t,endIndex:o,lazyLoadBatchSize:r,componentState:i,componentActions:a,dismissLoadedRows:l}=n,{dataArray:s}=i,u=l?()=>!1:g=>s[g].data!=null,c=!l,d=new j,p=["_______xxx______"];for(let g=t;g<=o;g++){let h=s[g];if(!h)continue;let S=u(g),y=h.dataSourceHasGrouping&&h.groupKeys?[...h.groupKeys]:[];h.isGroupRow&&h.dataSourceHasGrouping&&h.groupKeys&&y.pop();let C=y.length?y:p,T=h.dataSourceHasGrouping?h.indexInGroup:h.indexInAll;if(h.isGroupRow&&!h.collapsed&&!h.childrenAvailable){let I={lazyLoadStartIndex:0,lazyLoadBatchSize:r,groupKeys:h.groupKeys,append:c},b=h.groupKeys,R=d.get(b);if(!R?.[h.id]){let w=!R;R=R||{},R[h.id]||(R[h.id]=I),w&&d.set(b,R)}}if(!S&&r!=null){let I=d.get(C),b=Math.floor(T/r)*r,R=T-b,w=s[h.indexInAll-R].indexInAll,v=u(w),P=s[w].id;if(v||I?.[P])continue;let x=!I;I=I||{};let M={lazyLoadStartIndex:b,lazyLoadBatchSize:r,groupKeys:y,append:c};I[P]||(I[P]=M),x&&d.set(C,I)}}let f=Promise.resolve(!0),m=[];d.topDownValues().forEach(g=>{m.push(...Object.values(g))}),m.reduce((g,h)=>{let S=[...h.groupKeys,h.lazyLoadStartIndex];if(e&&e.has(S))return g;e?.set(S,!0);let y=[i.data,i,a,h];return g.then(()=>kR()).then(()=>tn(...y))},f)}function Vs(n,e){let{rowIndex:t,primaryKey:o}=e,{dataArray:r}=n.getDataSourceState();if(o!==void 0){let i=n.dataSourceApi.getIndexByPrimaryKey(o);if(i!==-1)return i;if(r[t]?.id!==o)return-1}return r[t]?t:-1}function Tr(n,e){let t=Vs(n,e);return t===-1?null:Kt({...n,rowIndex:t,columnId:e.columnId})}function Cr(n,e){console.warn(`Skipping "${n}": the edited row (primaryKey: ${String(e.primaryKey)}, rowIndex: ${e.rowIndex}) is no longer in the data array.`)}function Gs(n){let{getComputed:e,getState:t,actions:o}=n,r=t().columnMenuVisibleForColumnId;if(!r)return;let i=e(),a=i.computedVisibleColumnsMap,l=i.computedColumnOrder;if(a.has(r)){o.columnMenuVisibleKey=Date.now();return}function s(f,m){let g=l[u+f*m],h=a.get(g);if(h&&h.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&&(o.columnMenuVisibleForColumnId=p),p}function sa(n,e){let{rowIndex:t,colIndex:o}=n,{rowIndex:r,colIndex:i}=e,[a,l]=o>i?[i,o]:[o,i],[s,u]=t>r?[r,t]:[t,r];return[{rowIndex:s,colIndex:a},{rowIndex:u,colIndex:l}]}function Hs(n,e,t){let{rowsPerPage:o}=t;return o?Math.floor(n.rowIndex/o)===Math.floor(e.rowIndex/o):!0}function dg(n,e,t){if(Hs(n,e,t))throw"You should not call this when the positions are in the same page";let{rowsPerPage:o,columnsPerSet:r}=t;if(o===0)throw"rowsPerPage cannot be 0";let i=n,a=e;Math.floor(n.rowIndex/o)>Math.floor(e.rowIndex/o)&&(i=e,a=n);let{rowIndex:l,colIndex:s}=i,{rowIndex:u,colIndex:c}=a,d=Math.floor(l/o),p=Math.floor(u/o),f=l%o,m=u%o,g=Math.min(f,m),h=Math.max(f,m),S=[];for(let y=d;y<=p;y++)for(let C=g;C<=h;C++){let T=y*o+C;if(y===d)for(let I=s;I<r;I++)S.push({rowIndex:T,colIndex:I});else if(y===p)for(let I=0;I<=c;I++)S.push({rowIndex:T,colIndex:I});else for(let I=0;I<r;I++)S.push({rowIndex:T,colIndex:I})}return S}function zR(n,e){let t=new Set(n);return e.map(o=>t.has(o)?o:null).filter(o=>o!=null)}var Ks=class{constructor(e){this.getCellSelectionPosition=e=>{let t=e.rowId??Tn(e.rowIndex,this.getDataSourceState)?.id,o=e.colId??this.getComputed().computedVisibleColumns[e.colIndex].id;return[t,o]};this.setRangeSelected=(e,t,o)=>{let r=this.getDataSourceState(),i=r.cellSelection;if(!i)return;let a=new je(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=Tn(l,this.getDataSourceState),h=Tn(u,this.getDataSourceState);if(!g||!h)return;let S=g.indexInAll,y=h.indexInAll,[C,T]=sa({rowIndex:S,colIndex:f},{rowIndex:y,colIndex:m});for(let I=C.rowIndex;I<=T.rowIndex;I++)for(let b=C.colIndex;b<=T.colIndex;b++){let R={rowIndex:I,colIndex:b},[w,v]=this.getCellSelectionPosition(R);o?a.selectCell(w,v):a.deselectCell(w,v)}this.dataSourceActions.cellSelection=a};this.getCellSelectionPositionsWithFn=(e,t)=>{let o=Ci(this.getDataSourceState),{computedVisibleColumns:r}=this.getComputed(),i=r.map(d=>d.id),a=new Set,l=[],s=new Set;o.filter(d=>{r.forEach(p=>{this.isCellSelected({rowId:d.id,colId:p.id})&&(a.has(p.id)||a.add(p.id),s.has(d.id)||(s.add(d.id),l.push(d)))})});let u=zR(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 o=new je(t);o.debugId=e.debugId??"",o.deselectAll(),this.dataSourceActions.cellSelection=o};this.clear=()=>{this.deselectAll()};this.selectAll=()=>{let e=this.getDataSourceState(),t=e.cellSelection;if(!t)return;let o=new je(t);o.debugId=e.debugId??"",o.selectAll(),this.dataSourceActions.cellSelection=o};this.selectRange=(e,t)=>{this.setRangeSelected(e,t,!0)};this.deselectRange=(e,t)=>{this.setRangeSelected(e,t,!1)};this.isCellSelected=e=>{let[t,o]=this.getCellSelectionPosition(e);return this.getDataSourceState().cellSelection?.isCellSelected(t,o)??!1};this.selectCell=e=>{let t=this.getDataSourceState(),o=t.cellSelection;if(!o)return;let[r,i]=this.getCellSelectionPosition(e),a=e.clear?new je:new je(o);a.debugId=t.debugId??"",a.selectCell(r,i),this.dataSourceActions.cellSelection=a};this.deselectCell=e=>{let t=this.getDataSourceState(),o=t.cellSelection;if(!o)return;let[r,i]=this.getCellSelectionPosition(e),a=new je(o);a.debugId=t.debugId??"",a.deselectCell(r,i),this.dataSourceActions.cellSelection=a};this.selectColumn=(e,t)=>{t?.clear&&this.deselectAll();let o=this.getDataSourceState(),r=o.cellSelection;if(!r)return;let i=new je(r);i.debugId=o.debugId??"",i.selectColumn(e),this.dataSourceActions.cellSelection=i};this.deselectColumn=e=>{let t=this.getDataSourceState(),o=t.cellSelection;if(!o)return;let r=new je(o);r.debugId=t.debugId??"",r.deselectColumn(e),this.dataSourceActions.cellSelection=r};this.getComputed=e.getComputed,this.getDataSourceState=e.getDataSourceState,this.dataSourceActions=e.dataSourceActions}};function pg(n){return new Ks(n)}var Fo=class{constructor(e){let t=e instanceof Object.getPrototypeOf(this).constructor?e.getState():e,o=this.getPositiveFromState(t),r=this.getNegativeFromState(t);this.update({negativeItems:r,positiveItems:o})}getInitialState(){return this.initialState}destroy(){this.positiveMap?.clear(),this.negativeMap?.clear(),delete this.positiveMap,delete this.negativeMap}update(e){let{positiveItems:t,negativeItems:o}=e;if(this.allNegative=o===!0,this.allPositive=t===!0,this.allNegative&&this.allPositive)throw"Cannot have both negativeItems and positiveItems be true!";if(o&&o!==!0){this.negativeMap||(this.negativeMap=new Map),this.negativeMap.clear();for(let r of o)this.negativeMap.set(r,!0);this.positiveMap&&this.positiveMap.clear()}if(t&&t!==!0){this.positiveMap||(this.positiveMap=new Map),this.positiveMap.clear();for(let r of t)this.positiveMap.set(r,!0);this.negativeMap&&this.negativeMap.clear()}}isDefaultNegativeSelection(){return this.allNegative}isDefaultPositiveSelection(){return this.allPositive}areAllNegative(){return this.allNegative&&(this.positiveMap?this.positiveMap.size===0:!0)}areAllPositive(){return this.allPositive&&(this.negativeMap?this.negativeMap.size===0:!0)}makeAllNegative(){this.update({negativeItems:!0,positiveItems:[]})}makeAllPositive(){this.update({positiveItems:!0,negativeItems:[]})}isItemPositive(e){if(this.allPositive===!0){if(this.allNegative===!0)throw'Cannot have both positiveItems and negativeItems be "true"';return!this.negativeMap?.has(e)}return!!this.positiveMap?.has(e)}isItemNegative(e){return!this.isItemPositive(e)}setItemValue(e,t){if(t!==this.isItemPositive(e)){if(t){if(this.allNegative===!0){if(!this.positiveMap)throw`No positiveMap found when trying to set item ${e} be positive`;this.positiveMap.set(e,!0)}else if(this.allPositive===!0){if(!this.negativeMap)throw`No negativeMap found when trying to set item ${e} be positive`;this.negativeMap.delete(e)}}else if(this.allPositive===!0){if(!this.negativeMap)throw`No negativeMap found when trying to set item ${e} be negative`;this.negativeMap.set(e,!0)}else if(this.allNegative===!0){if(!this.positiveMap)throw`No positiveMap found when trying to set item ${e} be negative`;this.positiveMap?.delete(e)}}}makeItemNegative(e){this.setItemValue(e,!1)}makeItemPositive(e){this.setItemValue(e,!0)}toggleItem(e){this.setItemValue(e,!this.isItemPositive(e))}};var Mt=class extends Fo{constructor(t){super(t);this.isRowDetailsExpanded=t=>!!this.isItemPositive(t)}getState(){let t=this.allPositive?!0:[...this.positiveMap?.keys()??[]],o=this.allNegative?!0:[...this.negativeMap?.keys()??[]];return{expandedRows:t,collapsedRows:o}}getPositiveFromState(t){return t.expandedRows}getNegativeFromState(t){return t.collapsedRows}areAllCollapsed(){return this.areAllNegative()}areAllExpanded(){return this.areAllPositive()}collapseAll(){this.makeAllNegative()}expandAll(){this.makeAllPositive()}isRowDetailsCollapsed(t){return!this.isRowDetailsExpanded(t)}setRowDetailsExpanded(t,o){return this.setItemValue(t,o)}collapseRowDetails(t){this.setRowDetailsExpanded(t,!1)}expandRowDetails(t){this.setRowDetailsExpanded(t,!0)}toggleRowDetails(t){this.toggleItem(t)}};function fg(n){let{dataSourceApi:e,getState:t,actions:o}=n,r={collapseAllDetails(){o.rowDetailState=new Mt({collapsedRows:!0,expandedRows:[]})},expandAllDetails(){o.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,o.rowDetailState=s},expandRowDetail(i){let a=t(),l=a.rowDetailState;if(!l){console.error("Cannot expand row details via rowDetailState, as no props.rowDetailState is provided.");return}let s=new Mt(l);s.expandRowDetails(i),a.lastRowToCollapseRef.current=null,a.lastRowToExpandRef.current=i,o.rowDetailState=s},toggleRowDetail(i){r.isRowDetailExpanded(i)?r.collapseRowDetail(i):r.expandRowDetail(i)}};return r}function xn(n,e,t){return Math.min(Math.max(n,e),t)}function ua(n,e,t){let o=n().dataArray,r=0,i=o.length-1,a=e;do{a+=t;let l=o[a];if(!l)return a<r?r:i;if(!l.rowDisabled)return a}while(a>=r&&a<=i);return xn(a,r,i)}function VR(n,e){let{getState:t,getDataSourceState:o,actions:r,api:i,dataSourceApi:a}=n,{key:l}=e,s=o().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,h=m-f-1,S=0,y=u-1,C={ArrowDown:()=>{p=ua(o,p,1)},ArrowUp:()=>{p=ua(o,p,-1)},ArrowLeft:()=>{let I=s[p];if(d.isHorizontalLayoutBrain){let b=d.rowsPerPage;p-b>=S?p=p-b:C.ArrowUp();return}return I&&I.isGroupRow?i.collapseGroupRow(I.groupKeys):I&&i.rowDetailApi.isRowDetailEnabledForRow(I.id)?i.rowDetailApi.collapseRowDetail(I.id):!1},ArrowRight:()=>{let I=s[p];if(d.isHorizontalLayoutBrain){let b=d.rowsPerPage;p+b<=y?p=p+b:C.ArrowDown();return}return I&&I.isGroupRow?i.expandGroupRow(I.groupKeys):I&&i.rowDetailApi.isRowDetailEnabledForRow(I.id)?i.rowDetailApi.expandRowDetail(I.id):!1},Enter:()=>{let I=s[p];return I&&I.isGroupRow?i.toggleGroupRow(I.groupKeys):I&&I.isTreeNode&&I.isParentNode?a.treeApi.toggleNode(I.nodePath):i.rowDetailApi.isRowDetailEnabledForRow(I.id)?i.rowDetailApi.toggleRowDetail(I.id):!1},PageDown:()=>{p=Math.min(p+h,u-1)},PageUp:()=>{p=Math.max(p-h,S)},End:()=>{p=y},Home:()=>{p=S}},T=C[l];return T?(T(),g!==p?(r.activeRowIndex=p,!0):!1):!1}function Bs(n,e){let{api:t,getState:o,getComputed:r,getDataSourceState:i,dataSourceApi:a}=n,{key:l,shiftKey:s}=e,u=i().dataArray,c=o(),{activeCellIndex:d,brain:p}=c;if(!d)return!1;let[f,m]=d,{start:[g,h],end:[S,y]}=p.getRenderRange(),C=S-g-1,T=y-h-1,I=i().dataArray.length-1,b=r().computedVisibleColumns.length-1,R=0,w=0;f=xn(f,0,I),m=xn(m,0,b);let v={ArrowDown:()=>{f=xn(f+1,R,I)},ArrowUp:()=>{f=xn(f-1,R,I)},ArrowLeft:()=>{if(m===w)if(f!==R&&(m=b),p.isHorizontalLayoutBrain){let x=p.rowsPerPage;f-x>=R?f=f-x:v.ArrowUp()}else v.ArrowUp();else m=xn(m-1,w,b)},ArrowRight:()=>{if(m===b)if(f!==I&&(m=w),p.isHorizontalLayoutBrain){let x=p.rowsPerPage;f+x<=I?f=f+x:v.ArrowDown()}else v.ArrowDown();else m=xn(m+1,w,b)},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+T,b):f=Math.min(f+C,I)},PageUp:()=>{s?m=Math.max(m-T,w):f=Math.max(f-C,R)},End:()=>{s?m=b:f=I},Home:()=>{s?m=w:f=R}},P=v[l];return P?(P(),[f,m]):!1}function GR(n,e){let t=Bs(n,e);return t?(n.actions.activeCellIndex=t,!0):!1}var HR={ArrowUp:!0,ArrowDown:!0,ArrowLeft:!0,ArrowRight:!0,PageUp:!0,PageDown:!0,Home:!0,End:!0,Enter:!0," ":!0};function mg(n,e){let{key:t}=e,{getState:o}=n,r=o(),{activeRowIndex:i,activeCellIndex:a,keyboardNavigation:l,cellContextMenuVisibleFor:s,contextMenuVisibleFor:u}=r;return s||u||!HR[t]?!1:i!=null&&l==="row"?VR(n,e):a!=null&&l==="cell"?GR(n,e):!1}var Ws=class{constructor(e){this.param=e}setKeyboardNavigation(e){this.param.actions.keyboardNavigation=e}setActiveCellIndex(e){this.param.actions.activeCellIndex=e}setActiveRowIndex(e){this.param.actions.activeRowIndex=e}gotoRowWithDirection(e){let{getDataSourceState:t,getState:o}=this.param,{activeRowIndex:r,keyboardNavigation:i}=o();if(i!=="row")return console.error("Keyboard navigation is not enabled for rows"),!1;if(r==null)return!1;let a=ua(t,r,e);return a!==r?(this.param.actions.activeRowIndex=a,a):!1}gotoRow(e){return this.gotoRowWithDirection(e)}gotoNextRow(){return this.gotoRow(1)}gotoPreviousRow(){return this.gotoRow(-1)}gotoCell(e){let{direction:t}=e,o=t=="top"?"ArrowUp":t=="bottom"?"ArrowDown":t=="left"?"ArrowLeft":"ArrowRight",r=Bs(this.param,{key:o,shiftKey:!1});return r===!1?!1:(this.param.actions.activeCellIndex=r,r)}};function gg(n){return new Ws(n)}function hg(n,e){return n.id?n.id===e.id:!!(n.field&&n.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(o=>t.has(o))};this.persistEdit=async e=>{e=e??{};let{editingCell:t,editingValueRef:o}=this.getState();if(!t)return Promise.resolve(new Error("no edit in progress"));await new Promise(p=>requestAnimationFrame(p));let r=this.getComputed().computedColumnsMap.get(t.columnId),i=e.value??t.value;!t.active&&t.waiting!=="persist"&&(this.actions.editingCell={...t,active:!1,waiting:"persist"});let a=Vs({...this.context,api:this},t);if(a===-1){let p=new Error(`Cannot persist edit: the edited row (primaryKey: ${String(t.primaryKey)}, rowIndex: ${t.rowIndex}) is no longer in the data array.`);return this.actions.editingCell={...t,active:!1,accepted:!1,waiting:!1,persisted:p},Promise.resolve(p)}let l={...Kt({rowIndex:a,columnId:t.columnId,...this.context,api:this}),value:i,initialValue:t.initialValue},s=i;o.current=null,r.getValueToPersist&&(s=await r.getValueToPersist(l)),l.value=s,t.value=s;let u=this.getState().persistEdit??(()=>{if(!l.column.field)return i;let p=this.getDataSourceState().primaryKey,f=l.data&&typeof p=="string"?{[p]:l.data[p],[l.column.field]:s}:{...l.data,[l.column.field]:s};return this.context.dataSourceApi.updateData(f)}),c;try{c=await u(l)}catch(p){c=p}let d=c instanceof Error?c:!0;return this.actions.editingCell={...t,active:!1,accepted:!1,waiting:!1,persisted:d},Promise.resolve(d)};this.clearEditInfo=()=>{this.actions.editingCell=null};this.isEditInProgress=()=>{let{editingCell:e}=this.getState();return e?e.active:!1};this.isEditorVisibleForCell=e=>{let{rowIndex:t,columnId:o}=e,{dataArray:r}=this.getDataSourceState(),{editingCell:i}=this.getState(),a=r[t];return!a||!i?!1:i.columnId===o&&i.primaryKey===a.id&&!!(i.active||i.waiting)};this.confirmEdit=e=>this.stopEdit({value:e});this.stopEdit=async e=>{let t=this.getState(),{editingCell:o,editingValueRef:r}=t;if(!o)return!0;e||(e={});let i=e.value??r.current;if(!e.cancel&&!e.reject){let{rowIndex:a,columnId:l}=o;this.actions.editingCell={...t.editingCell,value:i,active:!1,waiting:"accept"};let{computedColumnsMap:s}=this.getComputed(),u=s.get(l),c=t.shouldAcceptEdit??u.shouldAcceptEdit,d=c?c({...Kt({...this.context,api:this,dataSourceApi:this.context.dataSourceApi,columnId:l,rowIndex:a}),value:i,initialValue:o.initialValue}):!0;return await new Promise(p=>requestAnimationFrame(p)),Promise.resolve(d).then(p=>{if(p===!0)return this.actions.editingCell={...t.editingCell,active:!1,accepted:!0,persisted:!1,waiting:"persist",value:i},!0;throw p}).catch(p=>(p instanceof Error||(p=new Error(`Edit rejected: ${p}`)),this.actions.editingCell={...o,value:i,persisted:!1,active:!1,waiting:!1,accepted:p},{reject:p,value:i}))}return e.cancel&&o?.active?(this.actions.editingCell={...o,active:!1,cancelled:!0,waiting:!1,persisted:!1},{cancel:!0,value:i}):e.reject&&o?.active?(this.actions.editingCell={...o,value:i,active:!1,persisted:!1,waiting:!1,accepted:e.reject},{reject:e.reject,value:i}):!0};this.cancelEdit=()=>this.stopEdit({cancel:!0});this.rejectEdit=e=>this.stopEdit({reject:e});this.getColumnAtIndex=e=>this.getComputed().computedVisibleColumns[e]??null;this.isCellEditable=e=>{let{rowIndex:t,primaryKey:o,columnId:r}=e,i=t??this.context.dataSourceApi.getIndexByPrimaryKey(o),{computedColumnsMap:a}=this.getComputed(),l=a.get(r);if(!l||!l.computedEditable||l.groupByForColumn)return Promise.resolve(!1);let s=this.getDataSourceState().dataArray[i];if(!s||s.isGroupRow)return Promise.resolve(!1);if(l.computedEditable===!0)return Promise.resolve(!0);let u=l.computedEditable(Kt({...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,o=this.columnApiById.get(t);if(o)return o;let r=ft(e,{...this.context,api:this});return r&&this.columnApiById.set(r.getColumnId(),r),r};this.isColumnSortable=e=>this.getColumnApi(e)?.isSortable()??!1;this.getCellValue=e=>this.getCellValues(e)?.value??null;this.getCellValues=e=>{let{rowIndex:t,primaryKey:o,columnId:r}=e,{dataSourceApi:i,getState:a}=this.context,{computedColumnsMap:l}=this.getComputed(),s=t??i.getIndexByPrimaryKey(o),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=vo({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 o={...this.getState().columnGroupVisibility};t?delete o[e]:o[e]=!1,this.actions.columnGroupVisibility=o};this.collapseAllGroupRows=()=>{let e=this.getDataSourceState(),t=new Rt(e.groupRowsState);t.collapseAll(),this.dataSourceActions.groupRowsState=t};this.collapseGroupRow=e=>this.getDataSourceState().groupRowsState.isGroupRowExpanded(e)?(this.toggleGroupRow(e),!0):!1;this.expandGroupRow=e=>this.getDataSourceState().groupRowsState.isGroupRowCollapsed(e)?(this.toggleGroupRow(e),!0):!1;this.toggleGroupRow=e=>{let t=this.getDataSourceState(),o=new Rt(t.groupRowsState);if(o.toggleGroupRow(e),this.dataSourceActions.groupRowsState=o,t.lazyLoad){let r=[bt,...e],i=t.originalLazyGroupData.get(r);o.isGroupRowExpanded(e)?i?.cache||tn(t.data,t,this.dataSourceActions,{groupKeys:e},this.context.getDataSourceMasterContext()):i?.cache||(t.lazyLoadCacheOfLoadedBatches.getKeysStartingWith(e).forEach(l=>{t.lazyLoadCacheOfLoadedBatches.delete(l)}),this.dataSourceActions.lazyLoadCacheOfLoadedBatches=j.clone(t.lazyLoadCacheOfLoadedBatches),t.originalLazyGroupData.delete(r),this.dataSourceActions.originalLazyGroupDataChangeDetect=xt())}};this.toggleSortingForColumn=(e,t)=>{if(!this.getComputed().computedColumnsMap.get(e))return;let r=this.getSortingForColumn(e);r===null?r=1:r=r===1?-1:null,this.setSortingForColumn(e,r,t)};this.getState=()=>this.context.getState();this.getComputed=()=>this.context.getComputed();this.getDataSourceState=()=>this.context.getDataSourceState();this.scrollCellIntoView=(e,t,o={offset:0})=>{let r=this.getState(),i=this.getComputed(),a=t;if(typeof t=="string"){let g=i.computedVisibleColumnsMap.get(t);if(!g)return!1;a=g.computedVisibleIndex}if(r.brain.isHorizontalLayoutBrain){o=o||{};let g=r.brain.getPageIndexForRow(e);o.horizontalLayoutPageIndex=g||0}let l=r.renderer.getScrollPositionForScrollColumnIntoView(a,o),s=r.renderer.getScrollPositionForScrollRowIntoView(e,o);if(!l||!s)return!1;let 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+(o.offset||0),m=u.scrollTop>p+(o.offset||0);return f&&m?!1:(u.scrollLeft!==c.scrollLeft&&!f&&this.setNativeScroll({scrollLeft:u.scrollLeft}),u.scrollTop!==c.scrollTop&&!m&&this.setNativeScroll({scrollTop:u.scrollTop}),!0)};this.context=e,this.rowSelectionApi=Gp({dataSourceActions:e.dataSourceActions,getDataSourceState:e.getDataSourceState}),this.keyboardNavigationApi=gg({getState:e.getState,getDataSourceState:e.getDataSourceState,actions:e.actions,getComputed:e.getComputed,api:this,dataSourceApi:e.dataSourceApi}),this.rowDetailApi=fg({getState:e.getState,actions:e.actions,dataSourceApi:e.dataSourceApi}),this.cellSelectionApi=pg({dataSourceActions:e.dataSourceActions,getDataSourceState:e.getDataSourceState,getComputed:e.getComputed})}get actions(){return this.context.actions}get dataSourceActions(){return this.context.dataSourceActions}get dataSourceApi(){return this.context.dataSourceApi}focus(){this.getState().scrollerDOMRef.current?.focus()}hideContextMenu(){this.actions.contextMenuVisibleFor=null,this.actions.cellContextMenuVisibleFor=null}realignColumnContextMenu(e){let t={actions:this.actions,getState:this.getState,getComputed:this.getComputed},o=this.getState().columnMenuRealignDelay;(!o||o<0)&&(Gs(t),e?.()),setTimeout(()=>{this.isDestroyed()||(Gs(t),e?.())},o)}isDestroyed(){return!this.getState().domRef.current}async startEdit(e){let{columnId:t,rowIndex:o,primaryKey:r,value:i}=e,a=o??this.context.dataSourceApi.getIndexByPrimaryKey(r);return this.isCellEditable({rowIndex:a,columnId:t}).then(async l=>{if(l){let s=this.getDataSourceState().dataArray,c=this.getComputed().computedColumnsMap.get(t),d=s[a],p=i??Yp({column:c,rowInfo:d}),f=p;c.getValueToEdit&&(p=await c.getValueToEdit(Kt({...this.context,rowIndex:a,columnId:t,api:this}))),this.actions.editingCell={active:!0,accepted:!1,persisted:!1,columnId:t,value:p,initialValue:f,rowIndex:a,primaryKey:s[a]?.id}}return l})}setSortingForColumn(e,t,o){let{computedColumnsMap:r}=this.getComputed(),i=r.get(e);if(!i||this.getSortingForColumn(e)===t&&this.getDataSourceState().multiSort===!1)return;if(t===null){this.setSortInfoForColumn(e,null,o);return}let l=!!i.pivotColumn,s=i.groupByForColumn,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(mn);d.length&&(u=d);let p=i.computedSortType;if(c.length&&p===qt){let m=this.getState().initialColumns;p=c.flatMap(h=>{let S=h.field??h.groupField,y=S?r.get(S):null;if(y)return y.computedSortType;let C=S?Ln(m,S):void 0;return C?C.sortType||(typeof C.type=="string"?C.type:"string"):[qt]})}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,o)}setSortInfoForColumn(e,t,o){let r=this.getDataSourceState(),i=this.getComputed().computedColumnsMap.get(e);if(!i)return;if(!r.multiSort){this.dataSourceApi.setSortInfo(t?[t]:null);return}let a=i.field,l={id:e,field:a},s=r.sortInfo?.slice()??[];if(t===null){s=s.filter(d=>!hg(d,l)),this.dataSourceApi.setSortInfo(s);return}let u=!1;if((o?.multiSortBehavior??this.getState().multiSortBehavior)==="replace"){this.dataSourceApi.setSortInfo([t]);return}s=s.map(d=>u?d:hg(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 o={...this.getState().columnPinning};t===!1?delete o[e]:o[e]=t,this.actions.columnPinning=o}setColumnFilter(e,t){this.getState().pendingColumnFilters.cancel(e);let o=this.getComputed().computedColumnsMap.get(e);if(!o)return;let r=this.getDataSourceState(),{filterTypes:i}=r,a;if(o.computedFilterValue)a={...o.computedFilterValue,filter:{...o.computedFilterValue.filter}};else{let l=o.computedFilterType;if(!i[l])return;let s={filter:{type:l,value:t,operator:i[l].defaultOperator},valueGetter:o.valueGetter};(o.field||typeof o.groupByForColumn=="string")&&(s.field=o.field||o.groupByForColumn),a=s}a.id=o.id,a.filter.value=t,this.setFilterValueForColumn(e,a)}setColumnFilterOperator(e,t){this.getState().pendingColumnFilters.cancel(e);let o=this.getComputed().computedColumnsMap.get(e);if(!o)return;let r=this.getDataSourceState(),{filterTypes:i}=r,a=o.computedFilterType,l=i[a].operators,s=l.find(d=>d.name===t)??l.find(d=>d.name===i[a].defaultOperator),u=s.name,c;o.computedFilterValue?(c={...o.computedFilterValue,filter:{...o.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:o.valueGetter},o.field&&(c.field=o.field)),c.id=o.id,this.setFilterValueForColumn(e,c)}setFilterValueForColumn(e,t){this.getState().pendingColumnFilters.cancel(e);let o=this.getComputed().computedColumnsMap.get(e);if(!o)return;let i=this.getDataSourceState().filterValue??[],a=!1;i=i.map(l=>l===o.computedFilterValue?(a=!0,t):l),a||i.push(t),this.dataSourceActions.filterValue=i}removeColumnFilter(e){this.getState().pendingColumnFilters.cancel(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){this.getState().pendingColumnFilters.cancel(e);let t=this.getComputed().computedColumnsMap.get(e);if(!t)return;let o=this.getDataSourceState(),r=o.filterValue??[],i=!1;r=r.map(a=>{if(a===t.computedFilterValue){let l=t.computedFilterValue.filter.type,s=o.operatorsByFilterType[l],u=o.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(mn),i&&(this.dataSourceActions.filterValue=r)}setVisibilityForColumn(e,t){let o={...this.getState().columnVisibility};t?delete o[e]:o[e]=!1,this.actions.columnVisibility=o}getVisibleColumnsCount(){return this.getComputed().computedVisibleColumns.length}setColumnVisibility(e){this.actions.columnVisibility=e}get scrollContainer(){return this.getState().scrollerDOMRef.current}setNativeScroll(e){let t=this.getState(),o=t.scrollerDOMRef.current;if(!o)return;let r=t.brain.toNativeScrollPosition({scrollTop:e.scrollTop??0,scrollLeft:e.scrollLeft??0});e.scrollTop!==void 0&&(o.scrollTop=r.scrollTop),e.scrollLeft!==void 0&&(o.scrollLeft=r.scrollLeft)}get scrollLeftMax(){return this.getState().brain.scrollLeftMax}get scrollTopMax(){return this.getState().brain.scrollTopMax}get scrollLeft(){return this.getState().brain.getScrollPosition().scrollLeft}set scrollLeft(e){this.setNativeScroll({scrollLeft:Math.max(e,0)})}get scrollTop(){return this.getState().brain.getScrollPosition().scrollTop}set scrollTop(e){this.setNativeScroll({scrollTop:Math.max(e,0)})}scrollRowIntoView(e,t={offset:0}){let o=this.getState(),r=this.getComputed(),i=o.brain.getScrollPosition(),a=t.columnId,l;!a&&o.brain.isHorizontalLayoutBrain&&r.computedVisibleColumns.length>0&&(a=r.computedVisibleColumns[Math.ceil(r.computedVisibleColumns.length/2)].id,l=r.computedVisibleColumnsMap.get(a)?.computedVisibleIndex);let s=o.renderer.getScrollPositionForScrollRowIntoView(e,{...t,colIndex:l});if(!s)return!1;let u=o.brain.scrollTopMax,c=s.scrollLeft!==i.scrollLeft,d=s.scrollTop<=u+(t.offset||0);return!d&&!c?!1:(d&&s.scrollTop!==i.scrollTop&&this.setNativeScroll({scrollTop:s.scrollTop}),c&&this.setNativeScroll({scrollLeft:s.scrollLeft}),!0)}scrollColumnIntoView(e,t={offset:0}){let o=this.getState(),i=this.getComputed().computedVisibleColumnsMap.get(e);if(!i)return!1;let a=i.computedVisibleIndex,l=o.renderer.getScrollPositionForScrollColumnIntoView(a,t);if(!l)return!1;let s=o.brain.getScrollPosition(),u=o.brain.scrollLeftMax;return l.scrollLeft>u+(t.offset||0)?!1:(l.scrollLeft!==s.scrollLeft&&this.setNativeScroll({scrollLeft:l.scrollLeft}),!0)}};function yg(n){return new js(n)}import{useEffect as bg,useRef as BR,useState as WR}from"react";var KR=10;function Sg(n,e){let{includeHeader:t,columnsToResize:o,columnsToSkip:r}=e,i=`.${Zt} > .${lr}`,a=n.current?.querySelectorAll(i),l={},s={};return a&&a.length&&a.forEach(u=>{let c=u.parentElement,d=c.matches(`.${Kn}`);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(..._t.split(" ")),f.style.position="absolute",f.style.width="auto",c.appendChild(f);let m=f.offsetWidth;if(c.removeChild(f),!s[p]){let g=_e().getComputedStyle(c);s[p]=parseInt(g.paddingLeft,10)+parseInt(g.paddingRight,10)+parseInt(g.borderLeftWidth,10)+parseInt(g.borderRightWidth,10)+KR}if(m+=s[p],d){let g=0;c.childNodes.forEach(h=>{if(h!==u&&h.nodeType===1){let S=h,y=Math.max(S.offsetWidth,parseInt(S.style.width,10));if(isNaN(y)&&(y=0),g+=y,y>0){let C=_e().getComputedStyle(S);g+=parseInt(C.marginLeft,10)+parseInt(C.marginRight,10)}}}),m+=g}r&&r.has(p)||o&&!o.has(p)||(l[p]=Math.max(m,l[p]||0))}),l}function Tg(){let{getComponentState:n,componentActions:e,componentState:{domRef:t,ready:o,autoSizeColumnsKey:r,brain:i}}=At(),[a,l]=WR(0),s=typeof r=="object"?r.key:r,u=Ne(s),c=BR(null);bg(()=>{if(u()==null)return;let{current:p}=c,f=()=>{r!==p&&l(a+1)};return i.onRenderRangeChange(f)},[i]),bg(()=>{if(s==null)return;let{autoSizeColumnsKey:d}=n(),p,f,m=!0;typeof d=="object"&&(d.columnsToResize&&(p=new Set(d.columnsToResize)),d.columnsToSkip&&(f=new Set(d.columnsToSkip)),m=d.includeHeader??m),c.current=s;let g=Sg(t,{includeHeader:m,columnsToResize:p,columnsToSkip:f}),h=Object.keys(g);if(!h.length)return;let S=n().columnSizing,y={...S},C=!1;h.forEach(T=>{y[T]={width:g[T]},C=C||y[T].width!==S[T]?.width}),C&&(e.columnSizing=y)},[s,o,a])}import{useEffect as wv,useMemo as vv,useState as gu}from"react";var ca=class{constructor(e){this.multiSelectStartPosition={rowIndex:0,colIndex:0};this.getPrimaryKeyByIndex=e.getPrimaryKeyByIndex,this.getColumnIdByIndex=e.getColumnIdByIndex}getCellSelectionPosition(e){let{rowIndex:t,colIndex:o}=e,r=this.getPrimaryKeyByIndex(t),i=this.getColumnIdByIndex(o);if(!(r===void 0||!i))return[r,i]}set cellSelectionState(e){this._cellSelectionState=e}get cellSelectionState(){return this._cellSelectionState}resetClick(e){this.cellSelectionState.deselectAll();let t=this.getCellSelectionPosition(e);t&&(this.cellSelectionState.deselectAll(),this.cellSelectionState.selectCell(...t),this.multiSelectStartPosition=e,this.multiSelectEndPosition=void 0)}singleAddClick(e){let t=this.getCellSelectionPosition(e);if(t)if(this.cellSelectionState.isCellSelected(...t)){this.cellSelectionState.deselectCell(...t);let o={rowIndex:e.rowIndex+1,colIndex:e.colIndex};this.getCellSelectionPosition(o)&&(this.multiSelectStartPosition=o)}else this.cellSelectionState.selectCell(...t),this.multiSelectStartPosition=e,this.multiSelectEndPosition=void 0}multiSelectClick(e,t){!this.multiSelectStartPosition||!this.getCellSelectionPosition(e)||(this.multiSelectEndPosition&&this.deselectRange(this.multiSelectStartPosition,this.multiSelectEndPosition,t),this.selectRange(this.multiSelectStartPosition,e,t),this.multiSelectEndPosition=e)}setRangeSelected(e,t,o,r){if(r.horizontalLayout&&!Hs(e,t,r)){dg(e,t,{rowsPerPage:r.rowsPerPage,columnsPerSet:r.columnsPerSet}).forEach(c=>{let d=this.getCellSelectionPosition({rowIndex:c.rowIndex,colIndex:c.colIndex});d&&(o?this.cellSelectionState.selectCell(...d):this.cellSelectionState.deselectCell(...d))});return}let[i,a]=sa(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&&(o?this.cellSelectionState.selectCell(...d):this.cellSelectionState.deselectCell(...d))}}deselectRange(e,t,o){this.setRangeSelected(e,t,!1,o)}selectRange(e,t,o){this.setRangeSelected(e,t,!0,o)}};function jR(n,e){return n<e?[n,e]:[e,n]}var da=class{constructor(e){this.multiSelectStartIndex=0;this.getRowAt=e.getRowAt,this.isNodeSelectable=e.isNodeSelectable??(()=>!0)}set rowSelectionState(e){this._rowSelectionState=e,this._treeSelectionState=void 0}get rowSelectionState(){return this._rowSelectionState}set treeSelectionState(e){this._treeSelectionState=e}get treeSelectionState(){return this._treeSelectionState}deselectAll(){(this._treeSelectionState??this._rowSelectionState).deselectAll()}isContainerRow(e){return e.isGroupRow||!!e.isParentNode}isExpanded(e){return e.isGroupRow?!e.collapsed:!!e.nodeExpanded}getPath(e){if(e)return this._treeSelectionState?e.nodePath:this.getGroupKeys(e)}getGroupKeys(e){return e.groupKeys&&e.groupKeys.length?e.groupKeys:void 0}setSelectedAt(e,t){let o=this.getRowAt(e);if(!o||o.rowDisabled||o.selfLoaded===!1)return;let r=this._treeSelectionState;if(r){o.nodePath&&this.isNodeSelectable(o)&&r.setNodeSelection(o.nodePath,t);return}let i=this.rowSelectionState,a=this.getGroupKeys(o);if(o.isGroupRow){if(!a)return;t?i.selectGroupRow(a):i.deselectGroupRow(a);return}t?i.selectRow(o.id,a):i.deselectRow(o.id,a)}isSelectedAt(e){let t=this.getRowAt(e);if(!t)return!1;if(this._treeSelectionState)return t.nodePath?this._treeSelectionState.isNodeSelected(t.nodePath):!1;let o=this.getGroupKeys(t);return t.isGroupRow?o?this.rowSelectionState.isGroupRowSelected(o):!1:this.rowSelectionState.isRowSelected(t.id,o)}setRangeSelected(e,t,o){let[r,i]=jR(e,t);for(let a=r;a<=i;a++){let l=this.getRowAt(a);l&&(a!==e&&this.isFollowedByItsChildren(a,l)||this.setSelectedAt(a,o))}}isFollowedByItsChildren(e,t){if(!this.isContainerRow(t)||!this.isExpanded(t))return!1;let o=this.getPath(t),r=this.getPath(this.getRowAt(e+1));return!o||!r||r.length<o.length?!1:o.every((i,a)=>i===r[a])}resetClick(e){this.deselectAll(),this.setSelectedAt(e,!0),this.multiSelectStartIndex=e,this.multiSelectEndIndex=void 0}singleAddClick(e){if(this.isSelectedAt(e))this.setSelectedAt(e,!1),this.isSelectedAt(e+1)&&(this.multiSelectStartIndex=e+1);else{this.setSelectedAt(e,!0),this.multiSelectStartIndex=e;let t;for(let o=e-1;o>=0&&this.isSelectedAt(o);o--)t=o;this.multiSelectEndIndex=t}}multiSelectClick(e){this.multiSelectEndIndex!=null&&this.setRangeSelected(this.multiSelectStartIndex,this.multiSelectEndIndex,!1),this.setRangeSelected(this.multiSelectStartIndex,e,!0),this.multiSelectEndIndex=e}};import{useMemo as rv}from"react";import*as mh from"react";var UR=()=>{};function $R(n,e){let t=new j,o=e.nodesKey??"children",r=e.emptyGroup??{},i=typeof e.pathKey=="function"?e.pathKey:l=>l[e.pathKey];for(let l of n){let s=i(l);for(let 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[o]??[]:[];a(d,f),f.length&&(p||(p=typeof r=="function"?r(d,f):r),p[o]=f),s.push(p)}return s}return a([],[])}function Cg(n,e,t,o){let{isLeafNode:r,getNodeChildren:i,toKey:a}=n,{onParentNode:l,onNode:s,onLeafNode:u}=e,c=a(o),d=[...t,c],p=r(o),f=dt(()=>{let m=i(o);if(!(!m||!Array.isArray(m)))for(let g=0,h=m.length;g<h;g++){let S=m[g];Cg(n,e,d,S)}});p?(u?.(o),s?.(o,UR)):(l?.(o,f,i(o)),s?.(o,f))}function Ig(n,e,t){for(let o=0,r=t.length;o<r;o++)Cg(n,e,[],t[o])}var Rg=new Uint8Array(new Uint32Array([1]).buffer)[0]===1;function wg(n,e,t){let o=n.length,r=new Float64Array(o);for(let p=0;p<o;p++){let f=e(n[p]);if(typeof f!="number"||f!==f)return!1;r[p]=(t<0?-f:f)+0}if(o<2)return!0;let i=new Uint32Array(r.buffer),a=Rg?0:1,l=Rg?1:0,s=new Uint32Array(8*256);for(let p=0;p<o;p++){let f=i[2*p+a],m=i[2*p+l];m&2147483648?(m=~m>>>0,f=~f>>>0,i[2*p+a]=f):m=(m|2147483648)>>>0,i[2*p+l]=m,s[f&255]++,s[256+(f>>>8&255)]++,s[512+(f>>>16&255)]++,s[768+(f>>>24)]++,s[1024+(m&255)]++,s[1280+(m>>>8&255)]++,s[1536+(m>>>16&255)]++,s[1792+(m>>>24)]++}let u=new Uint32Array(o),c=new Uint32Array(o);for(let p=0;p<o;p++)u[p]=p;for(let p=0;p<8;p++){let f=p<4?a:l,m=p%4*8,g=p*256;if(s[g+(i[f]>>>m&255)]===o)continue;let h=0;for(let y=0;y<256;y++){let C=s[g+y];s[g+y]=h,h+=C}for(let y=0;y<o;y++){let C=u[y],T=i[2*C+f]>>>m&255;c[s[g+T]++]=C}let S=u;u=c,c=S}let d=n.slice();for(let p=0;p<o;p++)n[p]=d[u[p]];return!0}var Us=function(n,e){return n-e},YR=new Set(["ca","de","de-AT","en","en-DE","en-GB","en-US","fi","fr","id","id-ID","it","ms","nl","pl","pt","ro","sl","sv","sw","vi"]),pa;function qR(){try{let n=new Intl.Collator;return YR.has(n.resolvedOptions().locale)?null:n}catch{return null}}var XR=function(n,e){return n=`${n}`,e=`${e}`,pa===void 0&&(pa=qR()),pa?pa.compare(n,e):n.localeCompare(e)},ZR=function(n,e){return n-e},QR={number:Us,string:XR,date:ZR},Mn=QR;function vg(n){return n.map(t=>Array.isArray(t.field)?t.field.map((o,r)=>{let i=Array.isArray(t.type)?t.type[r]??t.type[0]:t.type;return typeof o=="function"?{...t,valueGetter:o,field:void 0,type:i}:{...t,type:i,field:o}}):t).flat()}var jt=(n,e,t)=>{let o=typeof t=="function"?t:t?.get,r=t&&typeof t=="object"?t.marker:void 0;r&&r.start();let i=vg(n);return ew(i,e,o)||e.sort(Pg(i,o)),r&&r.end(),e},$s=(n,e,t)=>{let{marker:o}=t;o&&o.start();let r=Pg(vg(n),t.get),i=t.depthFirst??!1,a=t.inplace??!1;i||(a?e.sort(r):e=[...e].sort(r));let{nodesKey:l,toKey:s}=t,u=d=>d[l],c=d=>d[l]===void 0;return Ig({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)),o&&o.end(),e};jt.knownTypes=Mn;function ew(n,e,t){if(n.length!==1||e.length<1e3)return!1;let o=n[0];if(!o||o.fn||!o.type||o.dir!==1&&o.dir!==-1)return!1;let r=Array.isArray(o.type)?o.type[0]:o.type;if(jt.knownTypes[r]!==Us)return!1;let{field:i,valueGetter:a}=o;return wg(e,l=>(t&&(l=t(l)),a?a(l):i?l[i]:l),o.dir)}var tw=n=>{if(!n)return;let e=n.field,t=n.valueGetter,o=n.dir<0?-1:n.dir>0?1:0;if(!o)return;let r=n.fn;if(!r&&n.type){let i=Array.isArray(n.type)?n.type[0]:n.type;r=jt.knownTypes[i],r||console.warn(`Unknown sort type "${n.type}" - please pass one of ${Object.keys(jt.knownTypes).join(", ")}`)}return r||(r=Mn.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:o*u}},nw=n=>n.map(tw).filter(e=>e instanceof Function),Pg=(n,e)=>{let t=nw(n);return(o,r)=>{e&&(o=e(o),r=e(r));let i=0,a=0,l,s=t.length;for(;a<s;a++)if(l=t[a],!!l&&(i=l(o,r),i!==0))return i;return i}};import*as ow from"react";function Ys(n){return Fe(e=>n(e.dataSourceState))}var rw=Xe("IT:InfiniteTable"),iw="#dc3545",aw="#eb9316";var xg="Warn",Mg="Error",lw="Info",sw="Success",uw="Logs",fa=rw.extend(uw),aK=fa.extend(lw),cw=fa.extend(xg),dw=fa.extend(Mg),lK=fa.extend(sw);var pw=aw,fw=iw;var mw=(n,e)=>{e=e?e.extend?e.extend(xg):e:cw,e(typeof e.color=="function"?e.color(pw,n):n)},gw=(n,e)=>{e=e?e.extend?e.extend(Mg):e:dw,e(typeof e.color=="function"?e.color(fw,n):n)};var Dg=new j,Eg=(n,...e)=>{Dg.has(e)||(Dg.set(e,!0),n())};var Ag=(n,e=n,t)=>{Eg(()=>mw(n,t),e,"warn")},_g=(n,e=n,t)=>{Eg(()=>gw(n,t),e,"error")};var qs=new WeakMap,hw=n=>n;function Og(n,e=50,t){qs.set(n,{lastCallTime:0,lastCallArg:null});let o=t??hw;return r=>{let{lastCallTime:i,lastCallArg:a}=qs.get(n)||{lastCallTime:0,lastCallArg:null},l=Date.now(),s=l-i,u=St(o(a),o(r));s<e&&u||(qs.set(n,{lastCallTime:l,lastCallArg:r}),n(r))}}var ma=class{constructor(){this.primaryKeyToData=new Map;this.nodePathsToData=new j;this.removeNodePath=(e,t)=>{if(this.nodePathsToData.delete(e),this.remove(e[e.length-1]),!t)return;let o=this.nodePathsToData.get(e);if(o){let r=t.getNodeChildren?t.getNodeChildren(o):t.nodesKey?o[t.nodesKey]:null;if(r&&Array.isArray(r))for(let i=0,a=r.length;i<a;i++){let l=r[i],s=[...e,t.toPrimaryKey(l)];this.removeNodePath(s,t)}}};this.remove=e=>{this.primaryKeyToData.delete(e)};this.add=(e,t)=>{this.primaryKeyToData.set(e,t)};this.addNodePath=(e,t,o)=>{if(this.nodePathsToData.set(e,t),this.add(e[e.length-1],t),!o)return;let r=o.getNodeChildren?o.getNodeChildren(t):o.nodesKey?t[o.nodesKey]:null;if(r&&Array.isArray(r))for(let i=0,a=r.length;i<a;i++){let l=r[i],s=[...e,o.toPrimaryKey(l)];this.addNodePath(s,l,o)}};this.clear=()=>{this.primaryKeyToData.clear(),this.nodePathsToData.clear()};this.getDataForPrimaryKey=e=>this.primaryKeyToData.get(e);this.getDataForNodePath=e=>this.nodePathsToData.get(e);this.indexArray=(e,t)=>{let{cache:o,toPrimaryKey:r,getNodeChildren:i,isLeafNode:a,nodesKey:l}=t,s=!!i&&!!a;o&&o.shouldResetDataSource()&&(this.clear(),e=[]);let u=o&&!o.isEmpty();if(u&&(e=e.concat()),!e.length&&o){if(!o.isEmpty()){let c=[...o.getMutationsArray(),...o.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)}}o?.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 h=r(m),S=s?[...p,h]:void 0,y=s&&!!S,C=y?o?.getMutationsForNodePath(S):o?.getMutationsForPrimaryKey(h);if(C&&C.length){for(let T=0,I=C.length;T<I;T++){let b=C[T];if(b.type==="delete"&&!g&&(y?this.removeNodePath(S,t):this.remove(h),g=!0,d.splice(f,1),f--),b.type==="update"&&!g&&(m={...m,...b.data},d[f]=m),b.type==="update-children"&&!g){let R=b.children(m[l],m);m={...m},R!==void 0?m[l]=R:delete m[l],d[f]=m}b.type==="insert"&&(b.position==="before"?(d.splice(f,0,b.data),f--):d.splice(f+1,0,b.data))}y?o?.removeNodePathInfo(S):o?.removeInfo(h)}if(!g)if(y){this.addNodePath(S,m);let T=a(m),I=T?null:i(m);!T&&Array.isArray(I)&&(p.push(h),u&&(m[l]=I=I.concat()),c(I,p),p.pop())}else this.add(h,m)}}};c(e,[])}return e}}};var yw=Object.freeze([]),Fg=(n,e)=>{let t=n??yw,o=Array.isArray(t)?t:[t];if(e&&e.has(t)){let r=e.get(t);if(r&&r.length===o.length)return r}return e&&t&&e.set(t,o),o};var wt=class extends Fo{constructor(t){super(t);this.isRowEnabled=t=>!!this.isItemPositive(t)}getState(){let t=this.allPositive?!0:[...this.positiveMap?.keys()??[]],o=this.allNegative?!0:[...this.negativeMap?.keys()??[]];return{enabledRows:t,disabledRows:o}}getPositiveFromState(t){return t.enabledRows}getNegativeFromState(t){return t.disabledRows}areAllDisabled(){return this.areAllNegative()}areAllEnabled(){return this.areAllPositive()}disableAll(){this.makeAllNegative()}enableAll(){this.makeAllPositive()}isRowDisabled(t){return!this.isRowEnabled(t)}setRowEnabled(t,o){return this.setItemValue(t,o)}disableRow(t){this.setRowEnabled(t,!1)}enableRow(t){this.setRowEnabled(t,!0)}toggleRow(t){this.toggleItem(t)}};function ga(n,e){if(n===e)return!0;if(n==null||e==null)return n===e;if(typeof n!=typeof e)return!1;if(n instanceof Date||e instanceof Date)return n instanceof Date&&e instanceof Date&&n.getTime()===e.getTime();if(Array.isArray(n)&&Array.isArray(e)){if(n.length!==e.length)return!1;for(let t=0,o=n.length;t<o;t++)if(!ga(n[t],e[t]))return!1;return!0}if(typeof n=="object"){let t=Object.keys(n),o=Object.keys(e);if(t.length!==o.length)return!1;for(let r of t)if(!Object.prototype.hasOwnProperty.call(e,r)||!ga(n[r],e[r]))return!1;return!0}return!1}function Sw(n,e){return!(n===void 0||e===void 0||n.isGroupRow!==e.isGroupRow||n.dataSourceHasGrouping!==e.dataSourceHasGrouping||n.isTreeNode!==e.isTreeNode||n.isTreeNode&&n.isParentNode!==e.isParentNode)}var ha={id:!0,value:!0,indexInAll:!0,rowSelected:!0,rowDisabled:!0,isCellSelected:!1,hasSelectedCells:!1},Ng={...ha,dataSourceHasGrouping:!0,isTreeNode:!0,data:!1,isGroupRow:!0,selfLoaded:!0},bw={indexInGroup:!0,groupKeys:!0,groupBy:!0,rootGroupBy:!0,parents:!1,indexInParentGroups:!0,groupCount:!0,groupNesting:!0,collapsed:!0,selfLoaded:!0},Tw={...ha,...bw,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},Lg={isTreeNode:!0,isParentNode:!0,indexInParent:!0,nodePath:!0,parentNodes:!1,indexInParentNodes:!0,totalLeafNodesCount:!0,collapsedLeafNodesCount:!0,treeNesting:!0,selfLoaded:!0},Cw={...ha,...Lg,dataSourceHasGrouping:!0,isTreeNode:!0,isGroupRow:!0,isParentNode:!0,data:!1},Iw={...ha,...Lg,dataSourceHasGrouping:!0,isParentNode:!0,isGroupRow:!0,nodeExpanded:!0,selfExpanded:!0,data:!1,selectedLeafNodesCount:!0,deepRowInfoArray:!1,deselectedLeafNodesCount:!0,duplicateOf:!1},Rw=Object.entries(Ng).map(([n,e])=>e?n:void 0).filter(Boolean),ww=Object.entries(Ng).map(([n,e])=>e?n:void 0),vw=Object.entries(Tw).map(([n,e])=>e?n:void 0),Pw=Object.entries(Cw).map(([n,e])=>e?n:void 0),Dw=Object.entries(Iw).map(([n,e])=>e?n:void 0);function xw(n,e){if(n===e)return!0;if(!n||!e||!Sw(n,e)||n.id!==e.id||n.data!==e.data&&!ga(n.data,e.data))return!1;let t=[];n.dataSourceHasGrouping?t=n.isGroupRow?vw:ww:n.isTreeNode?t=n.isTreeNode&&n.isParentNode?Dw:Pw:t=Rw;for(let o of t){let r=n[o],i=e[o];if(!(typeof r=="function"||typeof i=="function")&&!ga(r,i))return!1}return!0}function kg(){let n=[],e=new Map,t=new Set,o={dataSourceState:void 0,previousDataSourceState:void 0},r=(p,f)=>{let m=n,g=f?.marker,S=p!==m&&t.size>0;S&&(o={dataSourceState:f?.dataSourceState,previousDataSourceState:f?.previousDataSourceState}),g&&g.start({details:[{name:"new dataArray length",value:p.length},{name:"old dataArray length",value:m.length}]});let y=[],C=l();for(let T of C){let I=m[T],b=p[T];if(b===void 0){y.push(T);continue}xw(I,b)||y.push(T)}n=p,(y.length>0||S)&&queueMicrotask(()=>{for(let T=0,I=y.length;T<I;T++){let b=y[T],R=e.get(b);if(R)for(let w of R)w()}if(S)for(let T of Array.from(t))T()}),g&&g.end({details:[{name:"updated row infos",value:y.length}]})},i=p=>n[p],a=(p,f)=>{let m=e.get(p);return m||(m=new Set,e.set(p,m)),m.add(f),()=>{let g=e.get(p);g&&(g.delete(f),g.size===0&&e.delete(p))}},l=()=>Array.from(e.keys());return{notifyDataArray:r,getRowInfoAtIndex:i,subscribeToRowIndex:a,subscribeToDataArrayChange:p=>(t.add(p),()=>{t.delete(p),t.size===0&&(o={dataSourceState:void 0,previousDataSourceState:void 0})}),getDataSourceStates:()=>o,getDataArray:()=>n,clear:()=>{n=[],e.clear(),t.clear(),o={dataSourceState:void 0,previousDataSourceState:void 0}}}}var nn=new Map,on=new Map,En=new Map,rn=new Map,Ut=new Map;var Mw=Symbol("cursorId"),zg=n=>n.totalLeafNodesCount===0,Ew=n=>n.isParentNode?!zg(n):!0;function Vg(n){let e=Date.now(),t=[],o=[],r=new j;return{logger:Dt(`${n.debugId}:DataSource`),debugTimings:new Map,debugWarnings:new Map,devToolsDetected:!!globalThis.__INFINITE_TABLE_DEVTOOLS_HOOK__,rowInfoStore:kg(),indexer:new ma,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 j,waitForNodePathPromises:new j,getDataSourceMasterContextRef:{current:()=>{}},cache:void 0,detailDataSourcesStateToRestore:new Map,stateReadyAsDetails:!1,originalDataArrayChanged:!1,originalDataArrayChangedInfo:{timestamp:0,mutations:void 0},rowsPerPage:null,lazyLoadCacheOfLoadedBatches:new j,dataParams:void 0,onCleanup:ye(),notifyScrollbarsChange:ye(),notifyScrollStop:ye(),notifyRenderRangeChange:ye(),pivotTotalColumnPosition:"end",pivotGrandTotalColumnPosition:!1,scrollStopDelayUpdatedByTable:100,originalLazyGroupData:r,originalLazyGroupDataChangeDetect:0,originalDataArray:t,cursorId:Mw,showSeparatePivotColumnForSingleAggregation:!1,propsCache:new Map([["sortInfo",new WeakMap],["rowDisabledState",new WeakMap],["isRowDisabled",new WeakMap],["cellSelection",new WeakMap],["treeSelection",new WeakMap],["treeExpandState",new WeakMap],["groupRowsState",new WeakMap]]),rowInfoReducerResults:void 0,pivotMappings:void 0,pivotColumns:void 0,pivotColumnGroups:void 0,dataArray:o,unfilteredCount:o.length,filteredCount:o.length,updatedAt:e,groupedAt:0,sortedAt:0,treeAt:0,filteredAt:0,reducedAt:e,generateGroupRows:!0,groupDeepMap:void 0,reducerResults:void 0,allRowsSelected:!1,someRowsSelected:!1,postSortDataArray:void 0,postGroupDataArray:void 0,lastSortDataArray:void 0,lastGroupDataArray:void 0,forceRerenderTimestamp:0}}function Aw(n){let e={...n};return delete e.originalDataArray,e}var _w=[],Gg=n=>{n.destroyedRef.current=!0,n.__apiRef.current=null,n.lastSelectionUpdatedNodePathRef.current=null,n.lastExpandStateInfoRef.current={state:"collapsed",nodePath:null},n.treeExpandState?.destroy(),n.treePaths?.clear(),n.unfilteredTreePaths?.clear(),n.waitForNodePathPromises.clear(),n.pathToIndexMap?.clear(),n.rowDisabledState?.destroy(),n.groupRowsState?.destroy(),n.treeSelectionState?.destroy(),n.idToPathMap.clear(),n.idToIndexMap.clear(),n.rowInfoStore.clear()},Hg=(n,e)=>({onDataParamsChange:t=>t?Og(t,100,Aw):void 0,lazyLoad:t=>!!t,isNodeReadOnly:t=>t??zg,isNodeSelectable:t=>t??Ew,data:1,nodesKey:1,isNodeExpanded:1,isNodeCollapsed:1,pivotBy:1,primaryKey:1,livePagination:1,treeSelection:1,refetchKey:t=>t??"",filterFunction:1,treeFilterFunction:1,filterValue:1,useGroupKeysForMultiRowSelection:t=>t??!1,multiRowSelectionTarget:t=>t??"all",filterDelay:t=>t??200,filterTypes:t=>({...kn,...t}),sortTypes:t=>({...Mn,...t}),sortFunction:1,onReady:1,rowInfoReducers:(t,o)=>{let r={initialValue:()=>{o.idToIndexMap.clear()},reducer:(a,l)=>{e.debugId&&!e.nodesKey&&o.idToIndexMap.has(l.id)&&console.warn(`Duplicate id found in data source: ${l.id}`),o.idToIndexMap.set(l.id,l.indexInAll)}},i=t?{...t,__idToIndex:r}:{__idToIndex:r};if(e.nodesKey){let a={initialValue:()=>{o.idToPathMap.clear(),o.pathToIndexMap.clear()},reducer:(l,s)=>{s.isTreeNode&&(o.idToPathMap.set(s.id,s.nodePath),e.debugId&&o.pathToIndexMap.has(s.nodePath)&&console.warn(`Duplicate node path found in data source (debugId: ${e.debugId||"none"}): ${s.nodePath}`),o.pathToIndexMap.set(s.nodePath,s.indexInAll))}};i.__pathToIndex=a}return i},onNodeCollapse:1,onNodeExpand:1,batchOperationDelay:1,isRowSelected:1,isNodeSelected:1,isRowDisabled:1,rowDisabledState:t=>{if(!t)return null;if(t instanceof wt)return t;let o=n.propsCache.get("rowDisabledState"),r=o.get(t);return r||(r=new wt(t),o.set(t,r)),t=r,t??null},onDataArrayChange:1,onDataMutations:1,onTreeDataMutations:1,aggregationReducers:1,collapseGroupRowsOnDataFunctionChange:t=>t??!0,loading:t=>t??!1,sortInfo:t=>Fg(t,n.propsCache.get("sortInfo")),groupBy:t=>t??_w});function Ow(n,e){return typeof n=="function"?n({array:e.originalDataArray,length:e.originalDataArray.length,lastItem:e.originalDataArray[e.originalDataArray.length-1]}):n}function Fw(n){if(typeof n=="boolean")return{filterValue:n,sortInfo:n,groupBy:n,pivotBy:n};let e={};return n.filterValue!=null&&(e.filterValue=n.filterValue),n.sortInfo!=null&&(e.sortInfo=n.sortInfo),n.groupBy!=null&&(e.groupBy=n.groupBy),n.pivotBy!=null&&(e.pivotBy=n.pivotBy),e}var Nw={selectedPaths:[],deselectedPaths:[],defaultSelection:!1};function Kg(n,e,t){if(e!="multi-row")throw new Error(`TreeSelectionState is only supported for multi-row selection. Your current selection mode is "${e}". See https://infinite-table.com/docs/reference/datasource-props#selectionMode for details.
1
+ var DT=Object.create;var cc=Object.defineProperty;var xT=Object.getOwnPropertyDescriptor;var MT=Object.getOwnPropertyNames;var ET=Object.getPrototypeOf,AT=Object.prototype.hasOwnProperty;var _T=(n,e)=>()=>(e||n((e={exports:{}}).exports,e),e.exports);var OT=(n,e,t,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of MT(e))!AT.call(n,r)&&r!==t&&cc(n,r,{get:()=>e[r],enumerable:!(o=xT(e,r))||o.enumerable});return n};var so=(n,e,t)=>(t=n!=null?DT(ET(n)):{},OT(e||!n||!n.__esModule?cc(t,"default",{value:n,enumerable:!0}):t,n));var Bn=_T((p1,Tp)=>{"use strict";Tp.exports=function(n,e,t,o,r){var i,a;if(o===void 0)o=0;else if(o=o|0,o<0||o>=n.length)throw new RangeError("invalid lower bound");if(r===void 0)r=n.length-1;else if(r=r|0,r<o||r>=n.length)throw new RangeError("invalid upper bound");for(;o<=r;)if(i=o+(r-o>>>1),a=+t(n[i],e,i,n),a<0)o=i+1;else if(a>0)r=i-1;else return i;return~o}});function Xt(n,{wait:e}){let t=null;return function(...o){let r=this;t!==null&&clearTimeout(t),t=setTimeout(()=>{n.apply(r,o)},e)}}import*as ve from"react";var U=(...n)=>n.filter(e=>!!`${e}`).join(" ");import*as zn from"react";import{useRef as wc}from"react";import*as FT from"react";import{useMemo as bx,useRef as NT,useEffect as LT,useLayoutEffect as kT,useCallback as Tx}from"react";var uo=(n,e,t={debounce:0})=>{let o=t.debounce??0,r=window.ResizeObserver,i=o?Xt(e,{wait:o}):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=n.getBoundingClientRect();c=d.height,u=d.width}i({width:u,height:c})});return a.observe(n),()=>{a.disconnect()}};var Zr=(n,e,t={earlyAttach:!1,debounce:0})=>{let o=NT({width:0,height:0}),r=i=>{let a;return n.current&&(a=uo(n.current,l=>{l={width:Math.round(l.width),height:Math.round(l.height)};let s=o.current;(s.width!==l.width||s.height!==l.height)&&(o.current=l,i(l))},{debounce:t.debounce})),()=>{a&&a()}};LT(()=>t.earlyAttach?()=>{}:r(e),[n.current,e,t.earlyAttach,t.debounce]),kT(()=>t.earlyAttach?r(e):()=>{},[n.current,e,t.earlyAttach])};function he(n=!1){let e=null,t=[],o=null,r=(i,a)=>{let l=[];if(n)o!=null&&(cancelAnimationFrame(o),o=null),requestAnimationFrame(()=>{e=i,o=null;for(let s=0,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 pt(n){let e=!1,t=null;return(...r)=>(e||(e=!0,t=n(...r)),t)}var dc=(n,e)=>n-e;var Qr=(n,e)=>dc(n.revision,e.revision),W=class n{constructor(e){this.map=new Map;this.length=0;this.revision=0;this.mutations=0;this.emptyKey=Symbol("emptyKey");this.visit=e=>{this.map.forEach((t,o)=>this.visitKey(o,this.map,[],e,!1))};this.visitSome=e=>{this.visitWithNext([],e,!0)};this.visitDepthFirst=e=>{this.visitWithNext([],e,!1)};this.visitWithNext=(e,t,o,r=this.map,i,a)=>{if(!r)return;let l=0,s=r.has(this.emptyKey),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 h=g?[]:[...e,p],S=m?()=>this.visitWithNext(h,t,o,m,i!==void 0?i-1:void 0):void 0;if(f.hasOwnProperty("value")){let y=t(f.value,h,l,S,f);if(o&&y===!0)return!0;l++}else S?.()};s&&(c(void 0,this.emptyKey),u=!1,l=0);for(let[d,p]of r){let f=c(p,d);if(o&&f===!0)return f}};this.fill(e)}get version(){return this.mutations}static clone(e){let t=new n;return e.visit((o,r)=>{t.set(r,o.value)}),t}fill(e){e&&e.forEach(t=>{let[o,r]=t;this.set(o,r)})}getValuesStartingWith(e,t){let o=[];return this.getStartingWith(e,(r,i)=>{o.push(i)},t),o}getEntriesStartingWith(e,t){let o=[];return this.getStartingWith(e,(r,i)=>{o.push([r,i])},t),o}getLeafNodesStartingWith(e,t,o){let{respectOrder:r=!1}=o||{},i=[],a=[];return this.getStartingWith(e,(l,s,u)=>{!u.map&&u.hasOwnProperty("value")&&(r?i.push(u):a.push(t(u)))},o),r?i.sort(Qr).map(t):a}getKeysForLeafNodesStartingWith(e,t){return this.getLeafNodesStartingWith(e,o=>o.keys,t)}getKeysAndValuesForLeafNodesStartingWith(e,t){return this.getLeafNodesStartingWith(e,o=>[o.keys,o.value],t)}getKeysOfFirstChildOnEachBranchStartingWith(e,t){let{excludeSelf:o,depthLimit:r,respectOrder:i=!0}=t||{},a=[],l=[],s=p=>{i?a.push(p):l.push(p.keys)},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(!o&&u.has(this.emptyKey))return[[]];return c&&c.value!==void 0&&(o||(s({...c,keys:e}),d=!0)),d?i?a.sort(Qr).map(p=>p.keys):l:(this.visitWithNext(e,(p,f,m,g,h)=>{s({...h,keys:f})},!1,u,r,o),i?a.sort(Qr).map(p=>p.keys):l)}getKeysStartingWith(e,t){let o=[];return this.getStartingWith(e,r=>{o.push(r)},t),o}getStartingWith(e,t,o){let{excludeSelf:r,depthLimit:i}=o||{},a=this.map,l,s=!1;if(e.length)for(let 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,o;if(!e.length)return this.map;for(let r=0,i=e.length;r<i;r++){let a=e[r];if(o=t.get(a),!o||!o.map)return;t=o.map}return t}getAllChildrenSizeFor(e){let t=this.map,o;if(!e.length)return this.length;for(let r=0,i=e.length;r<i;r++){let a=e[r];if(o=t.get(a),!o||!o.map)return 0;t=o.map}return o.length}getDirectChildrenSizeFor(e){let t=this.map;e.length||(e=[this.emptyKey]);for(let o=0,r=e.length;o<r;o++){let i=e[o],a=o===r-1,l=t.get(i);if(!l||!l.map)return 0;if(t=l.map,a)return t?.size??0}return 0}set(e,t){let o=this.map;this.mutations++,e.length||(e=[this.emptyKey]);for(let r=0,i=e.length;r<i;r++){let a=e[r],l=r===i-1,s=o.get(a)||{length:0};l?(s.revision=this.revision++,s.value=t,o.set(a,s),this.length++):(s.map||(s.map=new Map,o.set(a,s)),s.length++,o=s.map)}return this}get(e){let t=this.map;e.length||(e=[this.emptyKey]);for(let o=0,r=e.length;o<r;o++){let i=e[o],a=o===r-1,l=t.get(i);if(a)return l?l.value:void 0;if(!l||!l.map)return;t=l.map}}get size(){return this.length}clear(){let e=t=>{t.forEach((o,r)=>{let{map:i}=o;i&&e(i)}),t.clear()};e(this.map),this.length=0,this.revision=0,this.mutations++}delete(e){let t=this.map;this.mutations++,e.length?e=[...e]:e=[this.emptyKey];let o=[t],r=[],i=!1;for(let a=0,l=e.length;a<l;a++){let s=e[a],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,o.push(t)}}for(;o.length;){let a=o.pop(),l=e.length;if(e.pop(),l>0&&a?.size===0){let s=o[o.length-1],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 o=0,r=e.length;o<r;o++){let i=e[o],a=o===r-1,l=t.get(i);if(a)return l?l.hasOwnProperty("value"):!1;if(!l||!l.map)return!1;t=l.map}return!1}visitKey(e,t,o,r,i){let a=t.get(e);if(!a)return;let{map:l}=a,s=e===this.emptyKey?[]:[...o,e],u=pt(()=>{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((o,r)=>{let i=e({...o,keys:r});r.length===0?t.splice(0,0,i):t.push(i)}),t}rawKeysAt(e){let t=this.getMapAt(e);return t?[...t.keys()]:[]}valuesAt(e){let t=this.getMapAt(e);if(!t)return[];let o=[];return t.forEach(r=>{r.value!==void 0&&o.push(r.value)}),o}values(){return this.sortedIterator(e=>e.value)}keys(){return this.sortedIterator(t=>t.keys)}entries(){return this.sortedIterator(e=>[e.keys,e.value])}topDownEntries(){return this.getArray(e=>[e.keys,e.value])}topDownKeys(){return this.getArray(e=>e.keys)}topDownValues(){return this.getArray(e=>e.value)}sortedIterator(e){let t=[];this.visit((r,i)=>{t.push({...r,keys:i})}),t.sort(Qr);function*o(){for(let r=0,i=t.length;r<i;r++)yield e(t[r])}return o()}};globalThis.DeepMap=W;function _e(){return globalThis}var ei=["#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"],pc=Symbol("color"),Jr=new WeakMap,pl=he();function fl(n=ei){Jr.set(n,n.map(e=>0))}fl();var zT=(n=ei)=>{let e=[];Jr.has(n)?e=Jr.get(n):(e=n.map(o=>0),Jr.set(n,e));let t=e.reduce((o,r,i,a)=>r<a[o]?i:o,0);return e[t]!=null&&e[t]++,n[t]??n[0]??ei[0]},qo=":",ml="*",fc="-",VT=",",GT="debug",HT="diffdebug",gc=!1,Yo=new W,Xo=new Map;function gl(n,e){let t=n.split(qo),o=new W;o.set(t,!0);let r=e.split(qo),i=new Set(r).has(ml),a=r.indexOf(ml),l=i?r.slice(0,a):r;if(o.getKeysStartingWith(l,{excludeSelf:i}).length>0){let s=r.slice(a+1);return s.length?n.endsWith(s.join(qo)):!0}}function hc(n,e){let t=`channel=${n}_permissions=${e}`;if(Xo.has(t))return Xo.get(t);let o=e.split(VT);function r(l){return Xo.set(t,l),l}let i=[],a=[];o.forEach(l=>{l.includes(ml)?a.push(l):i.push(l)});for(let l=0;l<i.length;l++){let s=i[l],u=s.startsWith(fc);if(u&&(s=s.substring(fc.length)),gl(n,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)),gl(n,s))return r(!u)}return r(!1)}var hl=()=>Xe.enable??(_e()&&_e().localStorage?.getItem(GT))??"",KT=()=>Xe.diffenable??(_e()&&_e().localStorage?.getItem(HT))??`${gc}`,yl="",yc=gc;function Sl(n){yc=`${KT()}`=="true",yl!==n&&(yl=n,Xo.clear())}function Sc(n){Sl(hl()),typeof _e()<"u"&&_e().addEventListener&&_e().addEventListener("storage",function(){Sl(hl())});function e(t,o){let r=o?`${o}${qo}${t}`:t,i=r.split(qo),a=Yo.get(i);if(a)return a;let l=Yo.get(i.slice(0,-1)),s=(l?l.logFn:Xe.logFn)??bc,u=s,c,d=0,p=()=>c??hc(r,yl),f=zT(Xe.colors),m=Object.defineProperties((...g)=>{let h=pl.getListenersCount(),S;if(h>0&&(S=S??Date.now(),pl({color:f,channel:r,args:g,timestamp:S})),p()){if(S=S??Date.now(),d&&yc){let b=S-d;u(`%c[${r}]`,`color: ${f}`,`+${b}ms:`)}d=S;let y=[],C;if(g.forEach(b=>{if(b[pc])C===void 0&&(C=!0),y.push(...b);else{if(typeof b!="string"&&typeof b!="number"){C=!1;return}y.push(`${b}%s`)}}),C){let b=[`%c[${r}]%c %s`,`color: ${f}`,"",...y,""];u(...b)}else u(`%c[${r}]%c %s`,`color: ${f}`,"",...g)}},{channel:{value:r},color:{value:(g,...h)=>{let S=[`%c${h.join(" ")}%c%s`,`color: ${g}`,""];return S.toString=()=>h.join(" "),S[pc]=!0,S}},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:()=>{Yo.delete(i)}}});return Yo.set(i,m),m}return e(n)}var bc=console.log.bind(console),mc;Object.defineProperty(Sc,"enable",{get:()=>mc,set:n=>{mc=n,Sl(hl())}});var Xe=Sc;Xe.colors=ei;Xe.logFn=bc;var BT=(n,e)=>pl.onChange(t=>{if(!t)return;let{channel:o,args:r,color:i,timestamp:a}=t;gl(o,n)&&e({channel:o,color:i,args:r,timestamp:a})});Xe.onLogIntent=BT;Xe.isChannelEnabled=hc;Xe.destroyAll=()=>{fl(),fl(Xe.colors),Yo.clear(),Xo.clear()};var Et=n=>{let e=Xe(n?`IT:${n}:TYPE=debug`:"IT:TYPE=debug");return e.logFn=console.log.bind(console),e},gn=n=>{let e=Xe(n?`IT:${n}:TYPE=error`:"IT:TYPE=error");return e.logFn=console.error.bind(console),e},Zo=()=>Zo;Zo.extend=()=>Zo;var yt=class{constructor(e){this.debug=Zo,this.error=Zo}};var Tc=gn("CSSVariableWatch"),Cc=Et("CSSVariableWatch"),Ic={position:"absolute",pointerEvents:"none",width:"0px",height:"0px",lineHeight:0,fontSize:0,overflow:"hidden"};function Rc(n){return n.startsWith("var(")||n.startsWith("calc(")?n:`var(${n})`}var WT=n=>{let e=wc(0),t=zn.useCallback(({height:o})=>{o!=null&&o!==e.current&&(e.current=o,n.onChange(o))},[n.onChange]);Zr(n.ref,t,{earlyAttach:!0}),zn.useLayoutEffect(()=>{let o=n.ref.current.getBoundingClientRect().height;if(o!=null)return e.current=o,Cc(`Variable ${n.varName} found and equals ${o}.`),n.onChange(o);Tc(`Specified variable ${n.varName} not found or does not have a numeric value.`)},[])},Qo=n=>{let e=wc(null);WT({...n,ref:e});let t=Rc(n.varName),{allowInts:o=!1}=n;return zn.createElement("div",{"data-name":"css-variable-watcher","data-var":n.varName,style:Ic},zn.createElement("div",{ref:e,style:{height:o?`calc(1px * ${t})`:t}}))};import{useCallback as $T,useContext as Tl}from"react";function hn(){let n=null,e=new Set;return{getSnapshot(){return n},setSnapshot(t){n=t},subscribe(t){return e.add(t),()=>{e.delete(t)}},notify(){for(let t of e)t()}}}import{useCallback as jT,useRef as ti,useSyncExternalStore as UT}from"react";function St(n,e,t){if(n===e)return!0;if(!n||!e)return!1;let o=typeof n;if(o!==typeof e||o!=="object")return!1;var i=Object.keys(n),a=Object.keys(e);t&&(i=i.filter(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))&&(n[u]!==e[u]||!Object.prototype.hasOwnProperty.call(e,u)))return!1}return!0}function vc(n,e,t){let o=ti(e);o.current=e;let r=ti(t);r.current=t;let i=ti(void 0),a=ti(!1),l=jT(()=>{let s=n.getSnapshot(),u=o.current(s);return a.current&&r.current(i.current,u)?i.current:(i.current=u,a.current=!0,u)},[n]);return UT(n.subscribe,l,l)}function Jo(n,e){return vc(n,e,Object.is)}function co(n,e){return vc(n,e,St)}import*as Pc from"react";var bl;function po(){return bl||(bl=Pc.createContext(null))}var Dc=hn(),xc=()=>{};function ni(){let n=po();return Tl(n)||void 0}function oi(){let n=ni();return $T(()=>n?.getSnapshot(),[n])}function ri(n){let e=po(),t=Tl(e),o=co(t||Dc,t?n:xc);return t?o??void 0:void 0}function Vn(){let n=po(),e=Tl(n),o=Jo(e||Dc,e?r=>r.masterRowInfo:xc);return e?o:void 0}import*as fo from"react";import{useReducer as iC,createContext as aC,useMemo as wl,useEffect as lC,useState as kc,useRef as zc,useLayoutEffect as sC}from"react";function yn(n){if(n==null)return!1;let e=n;return!0}import{useCallback as XT,useEffect as ZT,useRef as Cl}from"react";import{useCallback as YT,useState as qT}from"react";var Vt=()=>{let[n,e]=qT(0);return[n,YT(()=>{e(t=>t+1)},[e])]};var Mc=n=>{let e=XT(n,[]),t=Cl(!1),o=Cl(!1),r=Cl(void 0),[i,a]=Vt();t.current&&(o.current=!0),ZT(()=>(t.current||(r.current=e,t.current=!0),a(),()=>{o.current&&r.current&&r.current()}),[])};import{useCallback as QT,useRef as JT}from"react";function Ne(n){let e=JT(n);return e.current=n,QT(()=>e.current,[])}import{useRef as eC,useLayoutEffect as tC}from"react";var Gn=(n,e)=>{let t=eC(e===void 0?n:e);return tC(()=>{t.current=n}),t.current};var er={DataSource:{track:"DataSource",labels:{RemoteDataLoad:"Remote data load",TreeUnfilteredTreePaths:"Computing unfiltered tree paths",Filter:"Filter",Sort:"Sort",Group:"Group",LazyGroup:"Lazy group",Tree:"Tree",FlattenTree:"Flatten tree",Flatten:"Flatten groups",PrepareData:"Preparing data",ComputeSelectionCount:"Computing selection count",ComputeSelectionCountLazy:"Computing selection count (lazy)",PrepareRowInfo:"Preparing row info array",DiffRowInfoInStore:"setDataArray diffing in RowInfoStore"}},InfiniteTable:{track:"InfiniteTable",labels:{Render:"Rendering"}},MatrixBrain:{track:"Layout Computations",labels:{ComputeRenderRange:"Computing render range"}},ComponentState:{track:"ComponentState",labels:{PropUpdate:"Prop update"}}};var nC="\u200B",Il=class n{constructor(e){this.debugId=e;this.markerDetails={label:"",track:"",trackGroup:void 0,color:void 0,details:[],tooltip:void 0};this.stopped=!1;this.start=e=>{if(this.markerDetails.startTs)return this;let t=performance.now();return this.markerDetails.details=e?.details??[],this.markerDetails.startTs=t,this};this.end=(e={})=>{if(this.stopped)return this;this.stopped=!0;let t=e.startTs??this.markerDetails.startTs,o=e.endTs??this.markerDetails.endTs??performance.now(),r=e.color||this.markerDetails.color||"primary",i=e.trackGroup||this.markerDetails.trackGroup||`Infinite Table (${this.debugId})`,a=[...this.markerDetails.details||[],...e.details||[]],l=e.tooltip||this.markerDetails.tooltip,s=e.label||this.markerDetails.label||"Unknown",u=e.track||this.markerDetails.track||"Unknown",c=nC+s;return performance.measure(c,{start:t,end:o,detail:{devtools:{dataType:"track-entry",trackGroup:i,track:u,color:r,properties:a.length>0?a.map(d=>[d.name,d.value]):void 0,tooltipText:l}}}),performance.clearMeasures(c),this};this.debugId=e}static create(e){return new n(e)}get startTimestamp(){return this.markerDetails.startTs}get track(){let e=this;return Object.keys(er).reduce((t,o)=>{let r={start:e.start,end:i=>e.end({...i,track:er[o].track,label:i.label}),get label(){let i=er[o];return Object.keys(i.labels).reduce((a,l)=>{let s={start:e.start,end: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,o,{get:()=>{let i=er[o];return e.markerDetails.track=i.track,r}}),t},{})}};function at(n){return Il.create(n)}function Ec(n,e){let t=new Set;function o(...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 n.apply(this,s)}return{fn:o,propertyReads:t}}var Rl=n=>n&&n.substr(0,1).toUpperCase()+n.substr(1);function tr(n){return n!==void 0}function Sn(n,e){let t=e[n];return tr(t)}var Ac=(n,e,t)=>{let o=n[e];typeof o=="function"&&o(...t)};function oC(n,e,t){let o={};for(let r in n)if(n.hasOwnProperty(r)){let i=n[r],a=Sn(r,e)?e[r]:e[`default${Rl(r)}`];typeof i=="function"&&(a=i(a,t)),o[r]=a}return o}function _c(n,e,t){let{fn:o,propertyReads:r}=Ec(n,{getProxyTargetFromArgs:a=>a.props,putProxyToArgs:(a,l)=>[{...l,props:a}]}),i=o(e);return r.forEach(a=>t.add(a)),i}function Oc(n){let{props:e,initialSetupState:t,propsToForward:o,parentState:r,mapPropsToState:i,propsToStateSet:a}=n,l={};o&&(l=oC(o,e,t));let s={...t,...l};if(i){let u=_c(i,{props:e,state:s,oldState:null,parentState:r},a);return{...s,...u}}return s}function Fc(n,e,t){let{getProps:o,getParentState:r,mapPropsToState:i,concludeReducer:a,propsToStateSet:l}=t;if(e.type==="REPLACE_STATE")return e.payload;let s=r?.()??null,u=e.payload.mappedState,c=e.payload.updatedPropsToState,d={...n};if(u&&Object.assign(d,u),i){let f=_c(i,{props:o(),state:d,oldState:n,parentState:s},l);Object.assign(d,f)}return e.type==="ASSIGN_STATE"&&Object.assign(d,e.payload),a?a({previousState:n,state:d,updatedProps:c,parentState:s}):d}function Nc(n){let{dispatch:e,getState:t,getProps:o,propsToForward:r,allowedControlledPropOverrides:i,interceptedActions:a,mappedCallbacks:l,notify:s=Ac}=n,u=t();return Object.keys(u).reduce((c,d)=>{let p=d;return Object.defineProperty(c,d,{set:m=>{let g=o(),h=t(),S=!0;if(a&&typeof a[p]=="function"&&a[p](m,{actions:c,state:h})===!1&&(S=!1),S){let b=[m],I=`on${Rl(d)}Change`;if(l&&l[p]){let T=l[p](m,h);I=T.callbackName||I,b=T.callbackParams}s(g,I,b)}let y=r[p];typeof y=="function"&&(m=y(m));let C=!!i?.[p];Sn(d,g)&&!C||e({payload:{updatedProps:null,mappedState:{[d]:m}}})}}),c},{})}function rC(n){let{currentProps:e,prevProps:t,state:o,propsToForward:r,propsToStateSet:i}=n,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],h=e[m];if(m!=="children"&&g!==h&&(c[m]={newValue:h,oldValue:g},d++,Sn(m,e)||Sn(m,t)))if(r.hasOwnProperty(f)){let S=h,y=r[f];typeof y=="function"&&(S=y(h)),o[m]!==S&&(a[m]=S,l++)}else i.has(f)&&(s[m]=e[m],u++)}),{newMappedState:a,newMappedStateCount:l,updatedPropsToState:s,updatedPropsToStateCount:u,rawUpdatedProps:c,rawUpdatedPropsCount:d}}function Lc(n){let{currentProps:e,prevProps:t,state:o,propsToForward:r,propsToStateSet:i,dispatch:a,actions:l,onPropChange:s,onPropsChange:u,beforeDispatch:c}=n,d=rC({currentProps:e,prevProps:t,state:o,propsToForward:r,propsToStateSet:i}),{newMappedState:p,newMappedStateCount:f,updatedPropsToState:m,updatedPropsToStateCount:g,rawUpdatedProps:h,rawUpdatedPropsCount:S}=d;if(g===0&&f===0)return!1;if(c?.(d),a({payload:{mappedState:f?p:null,updatedPropsToState:g?m:null}}),s){for(let y in h)if(h.hasOwnProperty(y)){let{newValue:C,oldValue:b}=h[y];s({name:y,newValue:C,oldValue:b},e,l,o)}}return u&&S&&u(h,e,l,o),!0}var vl;function Vc(){return vl||(vl=aC(null))}function Ot(n){let e=n.getParentState||(()=>null);function t(r){let[i]=kc(()=>n.initSetupState?n.initSetupState(r):{}),a=zc(new Set),l=wl(()=>n.forwardProps?n.forwardProps(i,r):{},[i]),s=e(),u=Ne(s);function c(){return Oc({props:r,initialSetupState:i,propsToForward:l,parentState:s,mapPropsToState:n.mapPropsToState,propsToStateSet:a.current})}let[d]=kc(c),p=Ne(r),f=(v,w)=>Fc(v,w,{getProps:p,getParentState:()=>u?.()??null,mapPropsToState:n.mapPropsToState,concludeReducer:n.concludeReducer,propsToStateSet:a.current}),[m,g]=iC(f,d),h=Ne(m),{allowedControlledPropOverrides:S}=n,y=wl(()=>Nc({dispatch:g,getState:h,getProps:p,propsToForward:l,allowedControlledPropOverrides:S,interceptedActions:n.interceptActions,mappedCallbacks:n.mappedCallbacks}),[g,l,S]),C=n.Context??Vc(),b=wl(()=>({componentState:m,componentActions:y,getComponentState:h,replaceState:v=>{g({type:"REPLACE_STATE",payload:v})},assignState:v=>{g({type:"ASSIGN_STATE",payload:v})}}),[m,y,h]),I=Gn(r),T=zc(!1);T.current=!1;let R=n.layoutEffect?sC:lC;return R(()=>{let v=r;Lc({currentProps:v,prevProps:I,state:m,propsToForward:l,propsToStateSet:a.current,dispatch:g,actions:y,onPropChange:n.onPropChange,onPropsChange:n.onPropsChange,beforeDispatch:({newMappedState:P,newMappedStateCount:x,updatedPropsToState:M,updatedPropsToStateCount:D})=>{let E=m.debugId,L=E?at(E).track.ComponentState.label.PropUpdate.start():void 0,V=n.debugName?typeof n.debugName=="function"?`${n.debugName(v)}:rerender`:`${n.debugName}:rerender`:"rerender";Et(V)("Triggered by new values for the following props",...Object.keys(P??{}),...Object.keys(M??{})),L&&L.end({label:V,details:[x>0?{name:"Updated properties",value:Object.keys(P).join(", ")}:void 0,D>0?{name:"Updated props",value:Object.keys(M).join(", ")}:void 0,D>0||M?{name:"Details",value:"The time for this marker is not accurate. The marker is only displayed so you can easily identify the props that triggered the rerender."}:void 0].filter(yn)})}})&&(T.current=!0)}),R(()=>{s!=null&&!T.current&&g({type:"PARENT_STATE_CHANGE",payload:{}})},[s]),Mc(()=>()=>{n.cleanup?.(h())}),{contextValue:b,ContextComponent:C}}return{ManagedComponentContextProvider:fo.memo(function(i){let{contextValue:a,ContextComponent:l}=t(i);return fo.createElement(l.Provider,{value:a},i.children)}),useManagedComponent:t}}function Ft(n){return n=n??Vc(),fo.useContext(n)}import*as Qc from"react";var nt="Infinite",ke={rootClassName:nt};var ii=()=>ke;var Gc="_16lm1iw2 _16lm1iw23 _16lm1iw26 _16lm1iw2c _16lm1iw2a",Hc={center:"_16lm1iw2j",stretch:"_16lm1iw2k",start:"_16lm1iw2l",end:"_16lm1iw2m"};var Nt="_16lm1iw3b _16lm1iw3c _16lm1iw35",Kc={pointer:"_16lm1iwk",default:"_16lm1iwl",colResize:"_16lm1iwm",grabbing:"_16lm1iwn",grab:"_16lm1iwo"},mo={flex:"_16lm1iw1p",contents:"_16lm1iw1q",none:"_16lm1iw1r",block:"_16lm1iw1s",grid:"_16lm1iw1t",inlineBlock:"_16lm1iw1u",inlineFlex:"_16lm1iw1v",inlineGrid:"_16lm1iw1w"};var ai={1:"_16lm1iw1c",none:"_16lm1iw1d"},nr={column:"_16lm1iw2f",columnReverse:"_16lm1iw2g",row:"_16lm1iw2h",rowReverse:"_16lm1iw2i"};var Bc={0:"_16lm1iw1y","100%":"_16lm1iw1z","50%":"_16lm1iw20"},Wc={center:"_16lm1iw30",spaceBetween:"_16lm1iw31",spaceAround:"_16lm1iw32",start:"_16lm1iw33",end:"_16lm1iw34"},jc={0:"_16lm1iw26","100%":"_16lm1iw27","50%":"_16lm1iw28",auto:"_16lm1iw29"};var Uc={none:"_16lm1iwd"},$c={hidden:"_16lm1iw35",auto:"_16lm1iw36",visible:"_16lm1iw37"};var li={relative:"_16lm1iw1",absolute:"_16lm1iw2",static:"_16lm1iw3",sticky:"_16lm1iw4",fixed:"_16lm1iw5"};var Yc={0:"_16lm1iw23","100%":"_16lm1iw24","50%":"_16lm1iw25"};var qc={none:"_16lm1iw1x"};var Xc={visible:"_16lm1iw38",hidden:"_16lm1iw39"};var Zc={1:"_16lm1iw1e",10:"_16lm1iw1f",100:"_16lm1iw1g",1e3:"_16lm1iw1h",1e4:"_16lm1iw1i",1e5:"_16lm1iw1j",1e6:"_16lm1iw1k",1e7:"_16lm1iw1l","1k":"_16lm1iw1m","10k":"_16lm1iw1n","100k":"_16lm1iw1o"};function Jc(n){let{rootClassName:e}=ii();return Qc.createElement("div",{...n,className:U(`${e}Footer`,li.relative,mo.flex,nr.row,n.className)})}import*as Me from"react";import{useCallback as Rg,useContext as aw,useEffect as lw,useRef as sw}from"react";import{createPortal as uw}from"react-dom";function si(n){let e={};return Object.keys(n).forEach(t=>{e[t]=t}),e}function Y(n){return n.slice(4,-1)}import*as nd from"react";var go={expandCollapse:"_1jm33zv0",loading:"_1jm33zv1",done:"_1jm33zv2",clear:"_1jm33zv3",hidden:"_1jm33zv4",filterOperatorContains:"_1jm33zv5",filterOperatorStartsWith:"_1jm33zv6",filterOperatorEndsWith:"_1jm33zv7",filterOperatorEq:"_1jm33zv8",filterOperatorNeq:"_1jm33zv9",filterOperatorGt:"_1jm33zva",filterOperatorGte:"_1jm33zvb",filterOperatorLt:"_1jm33zvc",filterOperatorLte:"_1jm33zvd"},ed="_1jm33zvf";var td={expandCollapse:"expand-collapse",loading:"loading",done:"done",clear:"clear",hidden:"hidden",filterOperatorContains:"filter-operator-contains",filterOperatorStartsWith:"filter-operator-starts-with",filterOperatorEndsWith:"filter-operator-ends-with",filterOperatorEq:"filter-operator-eq",filterOperatorNeq:"filter-operator-neq",filterOperatorGt:"filter-operator-gt",filterOperatorGte:"filter-operator-gte",filterOperatorLt:"filter-operator-lt",filterOperatorLte:"filter-operator-lte"};var lt="InfiniteIcon";var ze=n=>{let{icon:e,...t}=n,o=n.size??"var(--infinite-icon-size)",r={flex:"none",width:o,height:o,fill:"currentColor",...n.style};return nd.createElement("svg",{viewBox:"0 0 24 24",...t,className:e?U(n.className,go[e],lt,`${lt}-${td[e]}`):n.className,style:r},n.children)};import*as Pl from"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 od=n=>Pl.createElement(ze,{...n,icon:"filterOperatorContains"},Ve.includesOperator.map(e=>Pl.createElement("path",{key:e,d:e})));import*as Dl from"react";var rd=n=>Dl.createElement(ze,{...n,icon:"filterOperatorEndsWith"},Dl.createElement("path",{d:Ve.endsWithOperator[0]}));import*as xl from"react";var id=n=>xl.createElement(ze,{...n,icon:"filterOperatorEq"},xl.createElement("path",{d:Ve.eqOperator[0]}));import*as Ml from"react";var ad=n=>Ml.createElement(ze,{...n,icon:"filterOperatorGte"},Ml.createElement("path",{d:Ve.gteOperator[0]}));import*as El from"react";var ld=n=>El.createElement(ze,{...n,icon:"filterOperatorGt"},El.createElement("path",{d:Ve.gtOperator[0]}));import*as Al from"react";var sd=n=>Al.createElement(ze,{...n,icon:"filterOperatorLte"},Al.createElement("path",{d:Ve.lteOperator[0]}));import*as _l from"react";var ud=n=>_l.createElement(ze,{...n,icon:"filterOperatorLt"},_l.createElement("path",{d:Ve.ltOperator[0]}));import*as Ol from"react";var cd=n=>Ol.createElement(ze,{...n,icon:"filterOperatorNeq"},Ol.createElement("path",{d:Ve.neqOperator[0]}));import*as Fl from"react";var dd=n=>Fl.createElement(ze,{...n,icon:"filterOperatorStartsWith"},Fl.createElement("path",{d:Ve.startsWithOperator[0]}));import*as jl from"react";import*as st from"react";import{useEffect as qd,useState as Wl}from"react";import*as ho from"react";import{useEffect as fC,useLayoutEffect as mC,useState as Fd}from"react";function uC(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var o=t.call(n,e||"default");if(typeof o!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function cC(n){var e=uC(n,"string");return typeof e=="symbol"?e:String(e)}function dC(n,e,t){return e=cC(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function pd(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);e&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,o)}return t}function fd(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?pd(Object(t),!0).forEach(function(o){dC(n,o,t[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):pd(Object(t)).forEach(function(o){Object.defineProperty(n,o,Object.getOwnPropertyDescriptor(t,o))})}return n}function md(n,e){var t={};for(var o in n)t[o]=e(n[o],o);return t}var pC=(n,e,t)=>{for(var o of Object.keys(n)){var r;if(n[o]!==((r=e[o])!==null&&r!==void 0?r:t[o]))return!1}return!0},me=n=>{var e=t=>{var o=n.defaultClassName,r=fd(fd({},n.defaultVariants),t);for(var i in r){var a,l=(a=r[i])!==null&&a!==void 0?a:n.defaultVariants[i];if(l!=null){var s=l;typeof s=="boolean"&&(s=s===!0?"true":"false");var u=n.variantClassNames[i][s];u&&(o+=" "+u)}}for(var[c,d]of n.compoundVariants)pC(c,r,n.defaultVariants)&&(o+=" "+d);return o};return e.variants=()=>Object.keys(n.variantClassNames),e.classNames={get base(){return n.defaultClassName.split(" ")[0]},get variants(){return md(n.variantClassNames,t=>md(t,o=>o.split(" ")[0]))}},e};var gd="_1eexc2a6";var hd=me({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:[]}),yd="_12zfob1q _16lm1iw2 _16lm1iw1k _16lm1iw3b _16lm1iw3c _16lm1iw35",Sd=me({defaultClassName:"_16lm1iw2 _16lm1iw25 _16lm1iw26 _16lm1iwh _16lm1iwf",variantClassNames:{visible:{true:"_12zfob19",false:"_12zfob1a"}},defaultVariants:{},compoundVariants:[]}),bd=me({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"]]}),Td=me({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"]]}),Cd="_12zfob12u _16lm1iw22 _16lm1iw1z";var Id="_12zfob17",Rd="_12zfob12q _16lm1iw1p _16lm1iw2h _16lm1iw2j _16lm1iw1",wd=me({defaultClassName:"_12zfob12r _16lm1iw1 _16lm1iw23",variantClassNames:{disabled:{true:"_12zfob12s",false:"_12zfob12t"}},defaultVariants:{},compoundVariants:[]}),Nl=me({defaultClassName:"_12zfob12n _16lm1iw1p _16lm1iw2h _16lm1iw2k _16lm1iw1",variantClassNames:{active:{true:"_12zfob12o",false:"_12zfob12p"}},defaultVariants:{},compoundVariants:[]}),vd="_12zfob12m _16lm1iw1p _16lm1iw2h _16lm1iw2j",Pd=me({defaultClassName:"_12zfob127 _16lm1iw1 _16lm1iw39",variantClassNames:{menuVisible:{true:"_12zfob128"},reserveSpaceWhenHidden:{true:"_12zfob129",false:"_12zfob12a"}},defaultVariants:{},compoundVariants:[[{menuVisible:!0,reserveSpaceWhenHidden:!1},"_12zfob12b"]]}),Dd="_12zfob1b _16lm1iw2",xd="_16lm1iw1",Md="_12zfob16",Ed=me({defaultClassName:"_12zfob12",variantClassNames:{align:{start:"_12zfob13",center:"_12zfob14",end:"_12zfob15"}},defaultVariants:{},compoundVariants:[]}),Ad="_12zfob12l _16lm1iw35 _16lm1iw1 _16lm1iw1p _16lm1iw2h";var _d="_1nnkya20 _16lm1iw1p _16lm1iw2f _16lm1iw1 _16lm1iw32 _16lm1iw2j",ui="_1nnkya21";var Od={transition:"width 0.25s, opacity 0.25s"},bA=Object.keys({size:1,lineWidth:1,lineStyle:1,style:1,className:1,index:1});function yo(n){let[e,t]=Fd(!0),[o,r]=Fd(0),{lineWidth:i=1,style:a,className:l,index:s}=n,u=s!=null&&s>0,c=n.size??16,d=Math.floor(c/4),p=[c-1*d,c-2*d,c-3*d],f={...Od,borderTop:`${i}px solid currentColor`,...n.lineStyle,opacity:o};if(fC(()=>{if(!e)return;let g=requestAnimationFrame(()=>{r(1)});return()=>{cancelAnimationFrame(g)}},[e]),mC(()=>{t(!0)},[]),!e)return null;let m={};return ho.createElement("div",{"data-name":"filter-icon",style:{...a,width:c},className:U(l,lt,_d,`${lt}-filter`)},u?ho.createElement("div",{"data-name":"index",style:m,className:Id},s):null,ho.createElement("div",{className:ui,style:{width:p[0],...f}}),ho.createElement("div",{className:ui,style:{width:p[1],...f}}),ho.createElement("div",{className:ui,style:{width:p[2],...f}}))}var ci=Object.freeze({}),gC={string:ci,number:{}};function So(n,e){let t=e.default||ci;return n.type===void 0?t:n.type===null?ci:typeof n.type=="string"?e[n.type]||gC[n.type]||ci:n.type.reduce((o,r)=>Object.assign(o,e[r]),{})}var kl=n=>{let{availableSize:e,items:t,minSize:o,maxSize:r}=n;if(e<0)throw"The provided availableSize cannot be negative!";let i=0,a=0,l=0,s=[],u=[];t.forEach((R,v)=>{let w=R.maxSize??r??void 0,P=R.minSize??o??void 0;s.push(P),u.push(w),R.size!=null&&(w!=null&&R.size>w&&(R.size=w),P!=null&&R.size<P&&(R.size=P));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=n.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 w=d*R.flex,P=R.maxSize??r??void 0,x=R.minSize??o??void 0,M=!1,D=0;P!=null&&w>P&&(p[v]=!0,M=!0,D=P),x!=null&&w<x&&(f[v]=!0,M=!0,D=x),M&&(m+=1,l-=1,a-=R.flex,c-=D)}}),m&&(d=c/a);let g=[],h=0,S=c,y=a,C=0,b=0,I=[];return{items:t.map((R,v)=>{let w={...R},P=R.maxSize??r??void 0,x=R.minSize??o??void 0,M=0,D=p[v],E=f[v],L=D||E,V=R.size??0;if(R.flex!=null){if(L)E&&(M=x),D&&(M=P);else{h+=1;let N=k=>(P!=null&&k>P&&(k=P),x!=null&&k<x&&(k=x),k);h===l?M=N(S):(M=N(Math.round(R.flex*d)),b+=M,S=c-b,y-=R.flex,d=S/y)}V=M,w.flexSize=M}return g.push(M),I.push(V),w.computedSize=V,C+=V,w}),flexSizes:g,minSizes:s,maxSizes:u,computedSizes:I,remainingSize:Math.round(e-C)}};function di(n,e,t,o){return e!=null&&n<=e?{value:e,clamped:"min",diff:(n-e)*o}:t!=null&&n>=t?{value:t,clamped:"max",diff:(t-n)*o}:{value:n,clamped:!1,diff:0}}function Ld(n,e,t){let o=!1,r=0;for(let i of n)i.computedFlex&&(o=!0),r+=i.computedWidth;return o&&Math.round(r)>Math.round(e-t)}function Ll(n,e){return n.computedFlex&&!e?"flex":"width"}function or(n,e,t){if(e==="width"){let{flex:o,...r}=n??{};return{...r,width:t}}return{...n,flex:t}}var zl=n=>{let{availableSize:e,reservedWidth:t=0}=n,o=Object.keys(n.columnSizing).reduce((x,M)=>(x[M]={...n.columnSizing[M]},x),{});if(e<0)throw"The provided availableSize cannot be negative!";let r=n.dragHandleOffset,i=n.dragHandlePositionAfter,a=n.dragHandlePositionAfter+1,l=n.items[i],s=n.items[a],u=l.id,c=s?.id,d=Ld(n.items,e,t),p=l.computedWidth,f=l.computedMinWidth,m=l.computedMaxWidth,g=Ll(l,d),h=s?.computedWidth,S=s?.computedMinWidth,y=s?.computedMaxWidth,C=s?Ll(s,d):"width",b=!1,I=!1,T=r>0?1:-1,{value:R,clamped:v,diff:w}=di(Math.round(p+r),f,m,T);if(n.shareSpaceOnResize){if(s==null)return o[u]=or(o[u],g,R),I=v==="min",b=v==="max",{adjustedDiff:R-p,reservedWidth:t,columnSizing:o,minReached:I,maxReached:b,constrained:I||b};let{value:x,clamped:M,diff:D}=di(Math.round(h-r),S,y,T);if(v&&M&&(Math.abs(w)>Math.abs(D)?M=!1:v=!1),!(!v&&!M)){if(v){let E=di(Math.round(h-r-w),S,y,T);x=E.value,M=E.clamped,D=E.diff}else if(M){let E=di(Math.round(p+r+D),f,m,T);R=E.value,v=E.clamped,w=E.diff}}o[u]=or(o[u],g,R),o[c]=or(o[c],C,x),I=v==="min"||M==="min",b=v==="max"||M==="max"}else o[u]=or(o[u],g,R),I=v==="min",b=v==="max";let P=R-p;return{adjustedDiff:P,reservedWidth:n.shareSpaceOnResize?t:Math.round(t-P),columnSizing:o,minReached:I,maxReached:b,constrained:I||b}};function Nd(n,e){return n+e}function hC(n){return Object.keys(n).reduce((t,o)=>(t[o]={...n[o]},t),{})}var kd=n=>{let{availableSize:e,reservedWidth:t=0}=n,o=Object.keys(n.columnSizing).reduce((y,C)=>(y[C]={...n.columnSizing[C]},y),{});if(e<0)throw"The provided availableSize cannot be negative!";let r=n.dragHandleOffset,i=[...new Array(n.columnGroupSize)].map((y,C)=>n.dragHandlePositionAfter-C).reverse(),a=i.map(y=>n.items[y]),l=a.map(y=>y.computedWidth),s=Ld(n.items,e,t),u=a.map(y=>Ll(y,s)),c=0,{computedSizes:d}=kl({items:a.map(y=>(y.resizable===!1&&(c+=y.computedWidth),{maxSize:y.computedMaxWidth,minSize:y.computedMinWidth,flex:y.resizable?y.computedWidth:null,size:0})),computeSpecialSpaceDistribution:!0,availableSize:Math.max(l.reduce(Nd,0)+r-c,0)}),p=a.map((y,C)=>d[C]-y.computedWidth),f=!0,m=!0,g=!0,h=[];p.forEach((y,C)=>{let b=a[C];if(!b.resizable){h.push(0);return}let I=u[C],T=l[C],R=hC(o),{maxReached:v,minReached:w,constrained:P,adjustedDiff:x}=zl({availableSize:n.availableSize,reservedWidth:n.reservedWidth,dragHandleOffset:y,dragHandlePositionAfter:i[C],shareSpaceOnResize:!1,items:n.items,columnSizing:R});o[b.id]=or(R[b.id],I,Math.round(T+x)),h.push(x),v||(m=!1),w||(f=!1),P||(g=!1)});let S=h.reduce(Nd,0);return{minReached:f,maxReached:m,constrained:g,adjustedDiffs:h,adjustedDiff:S,columnSizing:o,reservedWidth:Math.round(t-S)}};var pi;function Gt(){if(pi!=null)return pi;let n=_e().document??null;if(!n)return 0;let e=n.createElement("div");e.style.visibility="hidden",e.style.overflow="scroll",n.body.appendChild(e);let t=n.createElement("div");return e.appendChild(t),pi=e.offsetWidth-t.offsetWidth,e.parentNode?.removeChild(e),pi}var zd=["start",void 0,"end"],Vd=(n,e)=>(e&&Object.keys(e).length>0&&n.sort((t,o)=>{let r=e[t],i=e[o];return r===!0&&(r="start"),i===!0&&(i="start"),r==i?0:zd.indexOf(r)-zd.indexOf(i)}),n);function Gd(n,e,...t){let o=e;return t.forEach(r=>{for(let i in r)r.hasOwnProperty(i)&&n(r[i],i)&&(o[i]=r[i])}),o}function Vl(n,...e){return Gd(t=>t!=null,n,...e)}function Hd(n,e,...t){return Gd((o,r)=>!(r in n),e,...t)}var fi=!0,yC=!0,SC=!0,Kd="string",Zt="unknown";var bC=gn("getComputedVisibleColumns"),TC=(n,e,t)=>n[t]!==!1,Gl=(n,e)=>{if(!e)return!1;let t=e[n];return t==="start"||t===!0?"start":t==="end"?"end":!1};function Hn(n,e){if(n)return n[e]?n[e]:Object.values(n).find(t=>t.field===e)}function CC(n,e){let t=So(n,e);return n.sortType?n.sortType:t.sortType?t.sortType:typeof n.type=="string"?n.type:Kd}function IC(n,e,t){let r=(Array.isArray(n)?n:n?[n]:[]).flatMap(i=>{let a=i.field??i.groupField;if(!a)return[Zt];let l=Hn(e,a);if(!l)return[Zt];let s=CC(l,t);return Array.isArray(s)?s:[s]});return r.every(i=>i===Zt)?Zt:r.length===1?r[0]:r}function Hl(n,e){let{colType:t,sortable:o,columnDefaultSortable:r}=e,i=n.defaultSortable??t.defaultSortable,a=!!n.groupByForColumn;if(i==null&&!a){let l=n.field??t.field,s=n.valueGetter??t.valueGetter;l==null&&s==null&&(i=!1)}return o??i??r??fi}var Bd=({columns:n,userColumns:e,bodySize:t,columnMinWidth:o,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:h=Kn,viewportReservedWidth:S,resizableColumns:y,draggableColumns:C,columnDefaultDraggable:b,columnOrder:I,columnPinning:T,editable:R,columnDefaultEditable:v,columnDefaultFilterable:w,columnDefaultGroupable:P,columnDefaultSortable:x,columnSizing:M,columnTypes:D,columnVisibility:E,columnVisibilityAssumeVisible:L,groupBy:V})=>{let N=0,k={};V.forEach((G,Q)=>{G.field&&(k[G.field]=Q)});let F=(p||[]).reduce((G,Q)=>{let{id:fe,field:Te}=Q;return Te&&(G[Te]=Q),fe&&(G[fe]=Q),G},{}),B=Vd(I===!0?Object.keys(n):I,T),$=B.filter(G=>n[G]?TC(E,L,G):(bC(`Column with id "${G}" specified in columnOrder array cannot be found in the columns map.`),!1)),_=new Map,H=$.map((G,Q)=>{let fe=n[G];return _.set(G,Q),fe}),z=(m??[]).reduce((G,Q,fe)=>(Q.id?G[Q.id]={sortInfo:Q,index:fe}:Q.field&&(G[Q.field]={sortInfo:Q,index:fe}),G),{});function Z(G){let Q=n[G],fe=So(Q,D),Te={minWidth:fe?.minWidth,maxWidth:fe?.maxWidth,width:fe?.defaultWidth,flex:fe?.defaultFlex},rt={width:Q?.defaultWidth,flex:Q?.defaultFlex,minWidth:Q?.minWidth,maxWidth:Q?.maxWidth},ae=M[G];ae?.width!=null&&ae.flex==null&&delete rt.flex,ae?.flex!=null&&ae.width==null&&delete rt.width;let je=Vl(rt,ae);je.width!=null&&delete Te.flex,je.flex!=null&&delete Te.width,je=Vl(Te,je);let X=je.flex??void 0,re=je.minWidth??Q?.minWidth??o,Ee=je.maxWidth??Q?.maxWidth??r,it=X!=null?void 0:je.width??(a?void 0:i);return!it&&X==null&&(a?X=a:it=re),{size:it,flex:X,minSize:re,maxSize:Ee}}let be=kl({availableSize:Math.max(t.width-(S??0)-(l??Gt()),0),maxSize:r,minSize:o,items:$.map(Z)}),{computedSizes:se,flexSizes:pe,minSizes:Pe,maxSizes:De}=be,ce=[],te=[],le=[],ge=[];ge.length=$.length;let j=new Map,ee=new Map,K=0,ie=0,ne=0,oe=null,O=[],A=0,ue=0,Ie=0;H.forEach((G,Q)=>{let fe=$[Q],Te=se[Q],rt=O[Q]=Gl(fe,T);rt==="start"?A+=Te:rt==="end"?Ie+=Te:ue+=Te});let ye=t.width-Ie,Se=[],xe=new Map;$.forEach((G,Q)=>{let fe=H[Q];xe.set(G,fe)});let Ze=[];Object.keys(n).forEach(G=>{let Q=n[G];Ze.push(G),xe.has(G)||xe.set(G,Q)});let Qe=new Map;xe.forEach((G,Q)=>{let fe=_.get(Q);fe==null&&(fe=-1);let Te=fe!=-1,rt=$[fe+1],ae=So(G,D),je=fe,X=z[Q]?z[Q]:G.field?z[G.field]??null:null,re=X?.sortInfo??null,Ee=!!re,it=Ee&&re.dir===1,ht=Ee&&!it,mn=X?.index??-1,sl=Te?{}:Z(Q),rc=Te?se[fe]:sl.size||0,pT=Te&&pe[fe]||null,fT=Te?Pe[fe]||0:sl.minSize||0,mT=Te?De[fe]||1e4:sl.maxSize||1e4,Rt=Te?Gl(Q,T):!1,ic=Te?fe===$.length-1:!1,qr=je,gT=Te?Rt==="start"?ie:Rt==="end"?ne:N-ie:0;Rt=="start"?qr=Te?je:-1:Rt==="end"?qr=Te?je-(ce.length+le.length):-1:qr=Te?je-ce.length:-1;let hT=Te?Rt==="start"||Rt===!1?N:ye+ne:-1,yT=Te?Rt!==oe:!1,ST=Te?ic||Rt!==Gl(rt,T):!1,ac=G.cssEllipsis??ae.cssEllipsis??s,bT=G.headerCssEllipsis??ae.cssEllipsis??G.cssEllipsis??ae.headerCssEllipsis??u??ac,Xr=Te&&(F[Q]||G.field||G.groupByForColumn)&&(F[Q]||F[G.field||G.groupByForColumn])||null,TT=G.defaultFilterable??ae.defaultFilterable??w??!0,CT=R??G.defaultEditable??ae.defaultEditable??v??!1,ul=G.dataType||ae.dataType||(Array.isArray(G.type)?G.type[0]:G.type)||Kd,IT=G.sortType||ae.sortType||ul,lc=G.filterType||ae.filterType||ul,sc=!1;if(Xr!=null&&!Xr.disabled){let dl=h[lc];dl&&(!dl.emptyValues||!dl.emptyValues.includes(Xr.filter.value))&&(sc=!0)}let lo=G.field??ae.field,RT=G.valueGetter??ae.valueGetter,cl=G.defaultGroupable??ae.defaultGroupable??P??!!lo;lo||(cl=!1),G.groupByForColumn&&(cl=!1);let uc=lo?k[lo]!==void 0:!1,wT=uc?k[lo]:void 0,vT=Hl(G,{colType:ae,sortable:f,columnDefaultSortable:x}),PT=G.resizable??ae.resizable??y??yC,qe={colType:ae,align:ae.align,headerAlign:ae.headerAlign,computedVisible:Te,verticalAlign:ae.verticalAlign,defaultHiddenWhenGroupedBy:ae.defaultHiddenWhenGroupedBy,valueGetter:RT,valueFormatter:ae.valueFormatter,renderValue:ae.renderValue,render:ae.render,style:ae.style,className:ae.className,contentFocusable:ae.contentFocusable,renderMenuIcon:ae.renderMenuIcon,renderSortIcon:ae.renderSortIcon,renderRowDetailIcon:ae.renderRowDetailIcon,renderSelectionCheckBox:ae.renderSelectionCheckBox,renderHeaderSelectionCheckBox:ae.renderHeaderSelectionCheckBox,headerStyle:ae.headerStyle,headerClassName:ae.headerClassName,columnGroup:ae.columnGroup,getValueToEdit:ae.getValueToEdit,getValueToPersist:ae.getValueToPersist,shouldAcceptEdit:ae.shouldAcceptEdit,field:lo,...G,components:{...ae.components,...G.components},computedResizable:PT,computedMinWidth:fT,computedMaxWidth:mT,computedFlex:pT,computedDataType:ul,computedEditable:CT,computedSortType:IT,computedFilterType:lc,cssEllipsis:ac,headerCssEllipsis:bT,computedFilterValue:Xr,computedFiltered:sc,computedFilterable:TT,computedGroupable:cl,computedGroupedBy:uc,computedGroupedByIndex:wT,computedWidth:rc,computedAbsoluteOffset:hT,computedPinningOffset:gT,computedVisibleIndexInCategory:qr,computedOffset:N,computedSortable:vT,computedSortInfo:re,computedSortIndex:mn,computedMultiSort:g,computedSorted:Ee,computedSortedAsc:it,computedSortedDesc:ht,computedVisibleIndex:je,computedPinned:Rt,computedDraggable:C??G.defaultDraggable??b??SC,computedFirstInCategory:yT,computedLastInCategory:ST,computedFirst:fe===0,computedLast:ic,id:Q,header:G.header??ae.header??G.name??G.field};Te&&(N+=rc,j.set(qe.id,qe),ge[fe]=qe,Rt==="start"&&(ce.push(qe),ie+=qe.computedWidth),Rt==="end"&&(te.push(qe),ne+=qe.computedWidth),Rt||(le.push(qe),K+=qe.computedWidth),oe=Rt),qe.groupByForColumn&&(qe.computedSortType=G.sortType||ae.sortType||IC(qe.groupByForColumn,e,D),Se.push(qe)),ee.set(qe.id,qe),qe.field&&!qe.groupByForColumn&&!Qe.has(qe.field)&&Qe.set(qe.field,qe)}),Se.forEach(G=>{G.computedSortable=Wd(G,{fieldsToColumn:Qe,userColumns:e,columnTypes:D,sortable:f,columnDefaultSortable:x})});let Ke=new Map;Ze.forEach(G=>{let Q=ee.get(G);Q&&Ke.set(G,Q)}),ee.forEach(G=>{Ke.has(G.id)||Ke.set(G.id,G)});let ot=c!=null?Math.min(c,ie):ie,$e=d!=null?Math.min(d,ne):ne;return{computedRemainingSpace:t.width-(A+Ie+ue),computedPinnedStartColumnsWidth:ie,computedPinnedEndColumnsWidth:ne,computedUnpinnedColumnsWidth:K,computedColumnOrder:B,computedPinnedStartColumns:ce,computedPinnedEndColumns:te,computedUnpinnedOffset:ie,computedPinnedEndOffset:ie+K,computedUnpinnedColumns:le,computedVisibleColumns:ge,computedColumnsMap:ee,computedColumnsMapInInitialOrder:Ke,computedVisibleColumnsMap:j,computedPinnedEndWidth:$e,computedPinnedStartWidth:ot,renderSelectionCheckBox:ge.reduce((G,Q)=>G||!!Q.renderSelectionCheckBox,!1),fieldsToColumn:Qe}};function Wd(n,e){let{sortable:t,fieldsToColumn:o,columnDefaultSortable:r,userColumns:i,columnTypes:a}=e;if(t)return t;let l=n.defaultSortable??n.colType.defaultSortable;if(l!=null)return l;let s=r??fi,u=n.sortType??n.colType.sortType;return u!=null&&u!==Zt&&s?!0:d=>{let{column:p,api:f}=d,m=p.groupByForColumn||[];return m!=null&&!Array.isArray(m)&&(m=[m]),(m||[]).reduce((g,h)=>{if(!g)return!1;let S=h.field||h.groupField,y;if(S){let C=o.get(S),b=C?f.getColumnApi(C.id):void 0;if(C&&b)y=b.isSortable();else{let I=Hn(i,S);if(I){let T=Hl(I,{colType:So(I,a??{}),sortable:t,columnDefaultSortable:r});y=typeof T=="boolean"?T:void 0}else y=!1}}return y===void 0&&h.valueGetter&&(y=!0),y??r??fi},!0)}}function ft(n,e){let{getComputed:t,getState:o,actions:r,api:i}=e;typeof n=="number"&&(n=t().computedVisibleColumns[n]);let a=typeof n=="string"?t().computedColumnsMap.get(n):n;if(!a)return null;let l={getCellValuesByPrimaryKey(s){return e.api.getCellValues({columnId:a.id,primaryKey:s})},getCellValueByPrimaryKey(s){return l.getCellValuesByPrimaryKey(s)?.value??null},toggleContextMenu(s){o().columnMenuVisibleForColumnId===a.id?this.hideContextMenu():this.showContextMenu(s)},toggleFilterOperatorMenu(s){o().filterOperatorMenuVisibleForColumnId===a.id?this.hideFilterOperatorMenu():this.showFilterOperatorMenu(s)},showFilterOperatorMenu(s){o().onFilterOperatorMenuClick({target:s,column:a})},hideFilterOperatorMenu(){i.hideFilterOperatorMenu()},showContextMenu(s){o().onColumnMenuClick({target:s,column:a})},hideContextMenu(){r.columnMenuVisibleForColumnId=null},isVisible(){return t().computedVisibleColumnsMap.has(a.id)},setVisible(s){i.setVisibilityForColumn(a.id,s)},toggleSort(s={multiSortBehavior:"replace"}){return i.toggleSortingForColumn(a.id,s)},isSortable(){let{computedColumnsMap:s}=t();return typeof a.computedSortable=="function"?a.computedSortable({api:i,columnApi:l,column:a,columns:s}):a.computedSortable},getSortDir(){return i.getSortingForColumn(a.id)},setFilter(s){return i.setColumnFilter(a.id,s)},clearFilter(){return i.clearColumnFilter(a.id)},getSortInfo(){return i.getSortInfoForColumn(a.id)},setSort(s){s?i.setSortingForColumn(a.id,s):i.setSortInfoForColumn(a.id,null)},clearSort(){this.setSort(null)},getColumnId(){return a.id},getComputedColumn(){return a}};return l}function jd(n,e,t){let{api:o,getComputed:r,getDataSourceState:i,actions:a,dataSourceActions:l,dataSourceApi:s}=e,u=i(),{allRowsSelected:c,someRowsSelected:d,selectionMode:p}=u,f=r(),m=ft(n.id,{...e,actions:a,dataSourceActions:l,dataSourceApi:s});return{horizontalLayoutPageIndex:null,column:n,columnApi:m,dataSourceApi:s,renderLocation:t,dragging:!1,columnsMap:f.computedColumnsMap,columnSortInfo:n.computedSortInfo,columnFilterValue:n.computedFilterValue,filtered:n.computedFiltered,allRowsSelected:c,someRowsSelected:d,selectionMode:p,api:o,renderBag:{header:n.name||n.id||""}}}function bo(n,e,t,o){let r=typeof n=="string"?e.getComputed().computedColumnsMap.get(n):n,i=r.header;if(typeof i=="function"){let a=jd(r,e,t),l=i(a)??null;return o?o(l,a):l}return i?o?o(i,jd(r,e,t)):i:r.name||r.id||""}import*as Ud from"react";var bn=`${nt}HeaderCell__filter`,mi=`${nt}HeaderCell__filterOperator`,qA=`${bn}__input`;var Kl=Ud.createContext(null);import{useContext as $d}from"react";import{createContext as RC}from"react";var Bl;function rr(){return Bl||(Bl=RC(null))}function Yd(n){let e=rr(),t=$d(e);return Jo(t,n)}function J(n){let e=rr(),t=$d(e);return co(t,n)}function Le(){return J(n=>({getState:n.getState,actions:n.actions,getComputed:n.getComputed,getDataSourceState:n.getDataSourceState,dataSourceApi:n.dataSourceApi,dataSourceActions:n.dataSourceActions,api:n.api,getDataSourceMasterContext:n.getDataSourceMasterContext}))}var wC=`${bn}__input`,gi=n=>n.stopPropagation();function Xd(n){let{filterOperatorMenuVisibleForColumnId:e}=J(c=>({filterOperatorMenuVisibleForColumnId:c.state.filterOperatorMenuVisibleForColumnId})),{column:t}=hi(),o=n.filterEditor,r=n.filterOperatorSwitch,[i,a]=Wl(!1),l=st.useCallback(()=>{a(!0)},[]),s=st.useCallback(()=>{a(!1)},[]),u=e===t.id||i;return st.createElement("div",{onPointerUp:gi,onPointerDown:gi,onFocus:l,onBlur:s,className:`${bn} ${Nl({active:u})}`,style:{height:n.columnHeaderHeight}},st.createElement(Kl.Provider,{value:n},st.createElement(r,null),st.createElement(o,null)))}function Zd(){let{columnApi:n,disabled:e,operator:t}=ir(),o=t?.components?.Icon??yo;return st.createElement("div",{"data-name":"filter-operator","data-disabled":e,onMouseDown:r=>{r.stopPropagation(),!e&&n.toggleFilterOperatorMenu(r.target)},className:U(mi,Rd,e?`${mi}--disabled`:"")},st.createElement(o,{size:20,className:`${wd({disabled:e})}`}))}function Qd(){return st.createElement("div",{onPointerUp:gi,onPointerDown:gi,className:`${bn} ${Nl({active:!1})} ${Bc["50%"]}`})}function ir(){let n=Le(),{column:e,columnApi:t}=hi(),o=bo(e,n,"column-filter"),r=st.useContext(Kl),{columnFilterType:i,filterTypes:a,columnFilterValue:l}=r,s=a[i],[u,c]=Wl(l?.filter.value??""),[d,p]=Wl(0);qd(()=>n.getState().pendingColumnFilters.onCancel(e.id,()=>p(y=>y+1)),[e.id]);let f=st.useCallback(y=>{c(y),r.onChange(y)},[r.onChange]),m=st.useCallback(()=>{n.api.clearColumnFilter(e.id)},[e.id]),g=st.useCallback(()=>{n.api.removeColumnFilter(e.id)},[e.id]);qd(()=>{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,d]);let h=r.operator,S=h?.name;return{api:n.api,column:e,columnFilterValue:l,columnApi:t,operatorName:S,operator:h,value:u,disabled:l?.disabled,filterType:s,filterTypes:a,filterTypeKey:i,filtered:e.computedFiltered,setValue:f,clearValue:m,removeColumnFilter:g,ariaLabel:`Filter for ${o}`,className:`${Cd} ${wC}`}}function To(){let{ariaLabel:n,value:e,setValue:t,className:o,disabled:r}=ir();return jl.createElement("input",{"data-xxx":!0,"aria-label":n,type:"text",disabled:r,value:e,onChange:i=>{t(i.target.value)},className:o})}function yi(){let{ariaLabel:n,value:e,setValue:t,className:o,disabled:r}=ir();return jl.createElement("input",{"aria-label":n,type:"number","data-yyy":!0,disabled:r,value:e??"",onChange:i=>{let a=isNaN(i.target.valueAsNumber)?i.target.value:i.target.valueAsNumber;t(a)},className:o})}var Ht=(n,e)=>{let t=n?.[e];return t?{components:{Icon:t}}:{}};function Jd(n={}){let{StringFilterEditor:e,NumberFilterEditor:t,icons:o}=n;return{string:{label:"Text",emptyValues:[""],defaultOperator:"includes",components:e?{FilterEditor:e}:void 0,operators:[{name:"includes",...Ht(o,"includes"),label:"Includes",fn:({currentValue:r,filterValue:i})=>typeof r=="string"&&typeof i=="string"&&r.toLowerCase().includes(i.toLowerCase())},{label:"Equals",...Ht(o,"eq"),name:"eq",fn:({currentValue:r,filterValue:i})=>typeof r=="string"&&r===i},{name:"startsWith",...Ht(o,"startsWith"),label:"Starts With",fn:({currentValue:r,filterValue:i})=>r.startsWith(i)},{name:"endsWith",...Ht(o,"endsWith"),label:"Ends With",fn:({currentValue:r,filterValue:i})=>r.endsWith(i)}]},number:{label:"Number",emptyValues:["",null,void 0],defaultOperator:"eq",components:t?{FilterEditor:t}:void 0,operators:[{label:"Equals",...Ht(o,"eq"),name:"eq",fn:({currentValue:r,filterValue:i})=>r==i},{label:"Not Equals",...Ht(o,"neq"),name:"neq",fn:({currentValue:r,filterValue:i})=>r!=i},{name:"gt",label:"Greater Than",...Ht(o,"gt"),fn:({currentValue:r,filterValue:i,emptyValues:a})=>a.includes(r)?!0:r>i},{name:"gte",...Ht(o,"gte"),label:"Greater Than or Equal",fn:({currentValue:r,filterValue:i,emptyValues:a})=>a.includes(r)?!0:r>=i},{name:"lt",...Ht(o,"lt"),label:"Less Than",fn:({currentValue:r,filterValue:i,emptyValues:a})=>a.includes(r)?!0:r<i},{name:"lte",...Ht(o,"lte"),label:"Less Than or Equal",fn:({currentValue:r,filterValue:i,emptyValues:a})=>a.includes(r)?!0:r<=i}]}}}var Kn=Jd({StringFilterEditor:To,NumberFilterEditor:yi,icons:{includes:od,eq:id,neq:cd,startsWith:dd,endsWith:rd,gt:ld,gte:ad,lt:ud,lte:sd}});function Si(n,e,t,o){let r=[...e],i={filtered:n.computedFiltered,first:n.computedFirst,last:n.computedLast,groupByField:!!n.groupByForColumn,firstInCategory:n.computedFirstInCategory,lastInCategory:n.computedLastInCategory,pinned:n.computedPinned||!1,cellSelected:o.cellSelected||!1,rowSelected:o.rowSelected??"null",rowActive:o.rowActive,dragging:o.dragging,insideDisabledDraggingPage:o.insideDisabledDraggingPage,firstRow:o.firstRow??!1,firstRowInHorizontalLayoutPage:o.firstRowInHorizontalLayoutPage??!1,rowDisabled:o.rowDisabled,groupRow:o.groupRow,groupCell:o.groupCell,treeNode:o.treeNode,verticalAlign:o.verticalAlign,align:o.align,zebra:o.zebra},a=t(i);return r.push(a),n.computedFirst&&r.push(...e.map(l=>`${l}--first`)),n.groupByForColumn&&r.push(...e.map(l=>`${l}--group-column`)),n.computedLast&&r.push(...e.map(l=>`${l}--last`)),n.computedFirstInCategory&&r.push(...e.map(l=>`${l}--first-in-category`)),n.computedLastInCategory&&r.push(...e.map(l=>`${l}--last-in-category`)),o.rowSelected===null?r.push(...e.map(l=>`${l}--row-partially-selected`)):o.rowSelected&&r.push(...e.map(l=>`${l}--row-selected`)),o.cellSelected&&r.push(...e.map(l=>`${l}--cell-selected`)),o.firstRow&&r.push(...e.map(l=>`${l}--first-row`)),o.firstRowInHorizontalLayoutPage&&r.push(...e.map(l=>`${l}--first-row-in-horizontal-layout-page`)),o.focused&&r.push(...e.map(l=>`${l}--focused`)),o.rowDisabled&&r.push(...e.map(l=>`${l}--disabled`)),o.treeNode&&r.push(...e.map(l=>`${l}--tree-node ${l}-tree-${o.treeNode}-node`)),o.groupRow&&(r.push(...e.map(l=>`${l}--group-row`)),r.push(...e.map(l=>`${l}--${o.rowExpanded?"group-row-expanded":"group-row-collapsed"}`))),n.computedPinned?r.push(...e.map(l=>`${l}--pinned-${n.computedPinned}`)):r.push(...e.map(l=>`${l}--unpinned`)),r.filter(Boolean).join(" ")}import{useCallback as tf,useState as nf}from"react";import{flushSync as uI}from"react-dom";function Tn(n,e){let t=n;if(!t)return null;if(t&&t.matches(e))return t;for(;t=t.parentElement;)if(t.matches(e))return t;return null}function ep(n,e,t){let o=n;if(!o)return null;if(o&&o.matches(e))return o;for(;o=o.parentElement;){if(o.matches(e))return o;if(o===t)return null}return null}var q={currentColumnTransformX:"var(--_16hkbkc0)",y:"var(--_16hkbkc1)",currentFlashingBackground:"var(--_16hkbkc2)",currentFlashingDuration:"var(--_16hkbkc3)",activeCellRowOffset:"var(--_16hkbkc4)",activeCellRowOffsetX:"var(--_16hkbkc5)",activeCellRowHeight:"var(--_16hkbkc6)",activeCellOffsetX:"var(--_16hkbkc7)",activeCellOffsetY:"var(--_16hkbkc8)",scrollTopForActiveRow:"var(--_16hkbkc9)",scrollLeftForActiveRowWhenHorizontalLayout:"var(--_16hkbkca)",activeCellColWidth:"var(--_16hkbkcb)",activeCellColOffset:"var(--_16hkbkcc)",columnReorderEffectDurationAtIndex:"var(--_16hkbkcd)",columnWidthAtIndex:"var(--_16hkbkce)",columnOffsetAtIndex:"var(--_16hkbkcf)",columnOffsetAtIndexWhileReordering:"var(--_16hkbkcg)",columnVisibilityAtIndex:"var(--_16hkbkch)",columnZIndexAtIndex:"var(--_16hkbkci)",pinnedStartWidth:"var(--_16hkbkcj)",pinnedEndWidth:"var(--_16hkbkck)",pinnedEndOffset:"var(--_16hkbkcl)",computedVisibleColumnsCount:"var(--_16hkbkcm)",baseZIndexForCells:"var(--_16hkbkcn)",bodyWidth:"var(--_16hkbkco)",bodyHeight:"var(--_16hkbkcp)",scrollbarWidthHorizontal:"var(--_16hkbkcq)",scrollbarWidthVertical:"var(--_16hkbkcr)",scrollLeft:"var(--_16hkbkcs)",scrollTop:"var(--_16hkbkct)"};var bi="true",de={loaded:"var(--infinite-loaded)",themeName:"var(--infinite-theme-name)",themeMode:"var(--infinite-theme-mode)",color:{accent:"var(--infinite-accent-color)",success:"var(--infinite-success-color)",error:"var(--infinite-error-color)",color:"var(--infinite-color)"},spacing:{0:"var(--infinite-space-0)",1:"var(--infinite-space-1)",2:"var(--infinite-space-2)",3:"var(--infinite-space-3)",4:"var(--infinite-space-4)",5:"var(--infinite-space-5)",6:"var(--infinite-space-6)",7:"var(--infinite-space-7)",8:"var(--infinite-space-8)",9:"var(--infinite-space-9)",10:"var(--infinite-space-10)"},fontSize:{0:"var(--infinite-font-size-0)",1:"var(--infinite-font-size-1)",2:"var(--infinite-font-size-2)",3:"var(--infinite-font-size-3)",4:"var(--infinite-font-size-4)",5:"var(--infinite-font-size-5)",6:"var(--infinite-font-size-6)",7:"var(--infinite-font-size-7)"},fontFamily:"var(--infinite-font-family)",baseFontSize:"var(--infinite-font-size)",minHeight:"var(--infinite-min-height)",borderRadius:"var(--infinite-border-radius)",focusOutline:"var(--infinite-focus-outline)",background:"var(--infinite-background)",iconSize:"var(--infinite-icon-size)",rowHeight:"var(--infinite-row-height)",densityScale:"var(--infinite-density-scale)",icons:{expandCollapse:"var(--infinite-icon-expand-collapse)",loading:"var(--infinite-icon-loading)",sortAsc:"var(--infinite-icon-sort-asc)",sortDesc:"var(--infinite-icon-sort-desc)",filter:"var(--infinite-icon-filter)",menu:"var(--infinite-icon-menu)",done:"var(--infinite-icon-done)",clear:"var(--infinite-icon-clear)",hidden:"var(--infinite-icon-hidden)",filterOperatorContains:"var(--infinite-icon-filter-operator-contains)",filterOperatorStartsWith:"var(--infinite-icon-filter-operator-starts-with)",filterOperatorEndsWith:"var(--infinite-icon-filter-operator-ends-with)",filterOperatorEq:"var(--infinite-icon-filter-operator-eq)",filterOperatorNeq:"var(--infinite-icon-filter-operator-neq)",filterOperatorGt:"var(--infinite-icon-filter-operator-gt)",filterOperatorGte:"var(--infinite-icon-filter-operator-gte)",filterOperatorLt:"var(--infinite-icon-filter-operator-lt)",filterOperatorLte:"var(--infinite-icon-filter-operator-lte)"},runtime:{bodyWidth:"var(--infinite-runtime-body-content-width)",totalVisibleColumnsWidthValue:"var(--infinite-runtime-total-visible-columns-width)",totalVisibleColumnsWidthVar:"var(--infinite-runtime-total-visible-columns-width-var)",visibleColumnsCount:"var(--infinite-runtime-visible-columns-count)",browserScrollbarWidth:"var(--infinite-runtime-browser-scrollbar-width)"},components:{GroupingToolbar:{color:"var(--infinite-grouping-toolbar-color)",background:"var(--infinite-grouping-toolbar-background)",rejectBackground:"var(--infinite-grouping-toolbar-reject-background)",activeBackground:"var(--infinite-grouping-toolbar-active-background)",activeBackgroundAlpha:"var(--infinite-grouping-toolbar-active-background-alpha)",padding:"var(--infinite-grouping-toolbar-padding)",border:"var(--infinite-grouping-toolbar-border)",rejectBorder:"var(--infinite-grouping-toolbar-reject-border)",gap:"var(--infinite-grouping-toolbar-gap)"},GroupingToolbarItem:{border:"var(--infinite-grouping-toolbar-item-border)",borderRadius:"var(--infinite-grouping-toolbar-item-border-radius)",activeBorder:"var(--infinite-grouping-toolbar-item-active-border)",background:"var(--infinite-grouping-toolbar-item-background)",activeBackground:"var(--infinite-grouping-toolbar-item-active-background)",activeBackgroundAlpha:"var(--infinite-grouping-toolbar-item-active-background-alpha)"},LoadMask:{padding:"var(--infinite-load-mask-padding)",color:"var(--infinite-load-mask-color)",textBackground:"var(--infinite-load-mask-text-background)",overlayBackground:"var(--infinite-load-mask-overlay-background)",overlayOpacity:"var(--infinite-load-mask-overlay-opacity)",borderRadius:"var(--infinite-load-mask-border-radius)"},Header:{background:"var(--infinite-header-background)",color:"var(--infinite-header-color)",columnHeaderHeight:"var(--infinite-column-header-height)"},HeaderCell:{background:"var(--infinite-header-cell-background)",hoverBackground:"var(--infinite-header-cell-hover-background)",border:"var(--infinite-header-cell-border)",padding:"var(--infinite-header-cell-padding)",paddingX:"var(--infinite-header-cell-padding-x)",paddingY:"var(--infinite-header-cell-padding-y)",iconSize:"var(--infinite-header-cell-icon-size)",menuIconLineWidth:"var(--infinite-header-cell-menu-icon-line-width)",sortIconMargin:"var(--infinite-header-cell-sort-icon-margin)",borderRight:"var(--infinite-header-cell-border-right)",resizeHandleActiveAreaWidth:"var(--infinite-resize-handle-active-area-width)",resizeHandleWidth:"var(--infinite-resize-handle-width)",resizeHandleHoverBackground:"var(--infinite-resize-handle-hover-background)",resizeHandleConstrainedHoverBackground:"var(--infinite-resize-handle-constrained-hover-background)",filterOperatorPaddingX:"var(--infinite-filter-operator-padding-x)",filterEditorPaddingX:"var(--infinite-filter-editor-padding-x)",filterEditorMarginX:"var(--infinite-filter-editor-margin-x)",filterOperatorPaddingY:"var(--infinite-filter-operator-padding-y)",filterEditorPaddingY:"var(--infinite-filter-editor-padding-y)",filterEditorMarginY:"var(--infinite-filter-editor-margin-y)",filterEditorBackground:"var(--infinite-filter-editor-background)",filterEditorBorder:"var(--infinite-filter-editor-border)",filterEditorFocusBorderColor:"var(--infinite-filter-editor-focus-border-color)",filterEditorBorderRadius:"var(--infinite-filter-editor-border-radius)",filterEditorColor:"var(--infinite-filter-editor-color)"},ActiveCellIndicator:{inset:"var(--infinite-active-cell-indicator-inset)"},Cell:{flashingDuration:"var(--infinite-flashing-duration)",flashingAnimationName:"var(--infinite-flashing-animation-name)",flashingOverlayZIndex:"var(--infinite-flashing-overlay-z-index)",flashingBackground:"var(--infinite-flashing-background)",flashingUpBackground:"var(--infinite-flashing-up-background)",flashingDownBackground:"var(--infinite-flashing-down-background)",padding:"var(--infinite-cell-padding)",paddingX:"var(--infinite-cell-padding-x)",paddingY:"var(--infinite-cell-padding-y)",borderWidth:"var(--infinite-cell-border-width)",borderColor:"var(--infinite-cell-border-color)",border:"var(--infinite-cell-border)",borderLeft:"var(--infinite-cell-border-left)",borderRight:"var(--infinite-cell-border-right)",borderTop:"var(--infinite-cell-border-top)",borderInvisible:"var(--infinite-cell-border-invisible)",borderRadius:"var(--infinite-cell-border-radius)",reorderEffectDuration:"var(--infinite-column-reorder-effect-duration)",pinnedBorder:"var(--infinite-pinned-cell-border)",horizontalLayoutColumnReorderDisabledPageOpacity:"var(--infinite-horizontal-layout-column-reorder-disabled-page-opacity)",color:"var(--infinite-cell-color)",selectedBackground:"var(--infinite-selected-cell-background)",selectedBackgroundDefault:"var(--infinite-selected-cell-background-default)",selectedBackgroundAlpha:"var(--infinite-selected-cell-background-alpha)",selectedBackgroundAlphaWhenTableUnfocused:"var(--infinite-selected-cell-background-alpha--table-unfocused)",selectedBorderColor:"var(--infinite-selected-cell-border-color)",selectedBorderWidth:"var(--infinite-selected-cell-border-width)",selectedBorderStyle:"var(--infinite-selected-cell-border-style)",selectedBorder:"var(--infinite-selected-cell-border)",activeBackgroundAlpha:"var(--infinite-active-cell-background-alpha)",activeBackgroundAlphaWhenTableUnfocused:"var(--infinite-active-cell-background-alpha--table-unfocused)",activeBackground:"var(--infinite-active-cell-background)",activeBackgroundDefault:"var(--infinite-active-cell-background-default)",activeBorderColor:"var(--infinite-active-cell-border-color)",activeBorderWidth:"var(--infinite-active-cell-border-width)",activeBorderStyle:"var(--infinite-active-cell-border-style)",activeBorder:"var(--infinite-active-cell-border)"},SelectionCheckBox:{marginInline:"var(--infinite-selection-checkbox-margin-inline)"},ExpandCollapseIcon:{color:"var(--infinite-expand-collapse-icon-color)"},Menu:{background:"var(--infinite-menu-background)",color:"var(--infinite-menu-color)",separatorColor:"var(--infinite-menu-separator-color)",padding:"var(--infinite-menu-padding)",cellPaddingVertical:"var(--infinite-menu-cell-padding-vertical)",cellPaddingHorizontal:"var(--infinite-menu-cell-padding-horizontal)",cellMarginVertical:"var(--infinite-menu-cell-margin-vertical)",itemDisabledBackground:"var(--infinite-menu-item-disabled-background)",itemActiveBackground:"var(--infinite-menu-item-active-background)",itemActiveOpacity:"var(--infinite-menu-item-active-opacity)",itemPressedOpacity:"var(--infinite-menu-item-pressed-opacity)",itemPressedBackground:"var(--infinite-menu-item-pressed-background)",itemDisabledOpacity:"var(--infinite-menu-item-disabled-opacity)",borderRadius:"var(--infinite-menu-border-radius)",shadowColor:"var(--infinite-menu-shadow-color)"},RowDetail:{background:"var(--infinite-rowdetail-background)",padding:"var(--infinite-rowdetail-padding)",gridHeight:"var(--infinite-rowdetail-grid-height)"},Row:{background:"var(--infinite-row-background)",oddBackground:"var(--infinite-row-odd-background)",disabledBackground:"var(--infinite-row-disabled-background)",oddDisabledBackground:"var(--infinite-row-odd-disabled-background)",selectedBackground:"var(--infinite-row-selected-background)",disabledOpacity:"var(--infinite-row-disabled-opacity)",activeBackground:"var(--infinite-active-row-background)",activeBorderColor:"var(--infinite-active-row-border-color)",activeBorderWidth:"var(--infinite-active-row-border-width)",activeBorderStyle:"var(--infinite-active-row-border-style)",activeBorder:"var(--infinite-active-row-border)",activeBackgroundAlpha:"var(--infinite-active-row-background-alpha)",activeBackgroundAlphaWhenTableUnfocused:"var(--infinite-active-row-background-alpha--table-unfocused)",hoverBackground:"var(--infinite-row-hover-background)",selectedHoverBackground:"var(--infinite-row-selected-hover-background)",selectedDisabledBackground:"var(--infinite-row-selected-disabled-background)",groupRowBackground:"var(--infinite-group-row-background)",groupRowColumnNesting:"var(--infinite-group-row-column-nesting)",groupNesting:"var(--infinite-dont-override-group-row-nesting-length)",pointerEventsWhileScrolling:"var(--infinite-row-pointer-events-while-scrolling)"},ColumnCell:{background:"var(--infinite-column-cell-bg-dont-override)"}}},tp="column-header-height";var np=`.${ke.rootClassName}`;function Ul(n){return Tn(n,np)}var op=Y(q.scrollLeft),vC=Y(q.scrollTop),PC=Y(q.columnWidthAtIndex),$l=Y(q.columnOffsetAtIndex),rp=Y(q.columnReorderEffectDurationAtIndex),DC=Y(q.columnOffsetAtIndexWhileReordering),xC=Y(q.columnVisibilityAtIndex),MC=Y(q.columnZIndexAtIndex);function Kt(n,e,t){let o=t?Ul(t):document.querySelector(np);EC(n,e,o)}function EC(n,e,t){if(t){let o=n,r=q[o]?Y(q[o]):n;t.style.setProperty(r,`${e}`)}}function Co(n,e){if(e)for(var t in n){let o=q[t]?Y(q[t]):t,r=`${n[t]}`;e.style.setProperty(o,r)}}function Yl(n,e,t){Kt(`${$l}-${n.computedVisibleIndex}`,n.computedPinned?`calc( ${n.computedAbsoluteOffset+e}px + var(${op}))`:`${n.computedAbsoluteOffset+e}px`,t)}function ql(n,e,t){Kt(`${MC}-${n}`,`${e}`,t)}function ar(n,e,t){Kt(`${DC}-${n}`,typeof e=="number"?`calc( var(${$l}-${n}) + ${e}px )`:e,t)}function lr(n,e,t){Kt(`${xC}-${n}`,e,t)}function Ti(n,e,t){Kt(`${rp}-${n}`,t??"",e)}function Xl(n,e){let t=`${rp}-${n}`;Kt(t,de.components.Cell.reorderEffectDuration,e)}var Re={columnWidths:{get(n){return`var(${this.getVarName(n)})`},getVarName(n){return this.varName.get(n)},varName:{get(n){return`${PC}-${n}`}},set(n,e,t){e=typeof e=="number"?e+"px":e,Kt(this.varName.get(n),e,t)}},columnOffsets:{get(n){return`var(${this.getVarName(n)})`},getVarName(n){return this.varName.get(n)},varName:{get(n){return`${$l}-${n}`}},set(n,e,t){e=typeof e=="number"?e+"px":e,Kt(this.varName.get(n),e,t)}}};function ip(n,e){Co({[op]:`${n.scrollLeft}px`,[vC]:`${n.scrollTop}px`},e)}var ap="_16lm1iw1",lp="_1yeub2v0 _16lm1iw1 _16lm1iw1p _16lm1iw2f _16lm1iw0",sp="_1yeub2vs",up="_1yeub2vr",cp=me({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 Zl="_1yeub2vp";var $_=me({defaultClassName:"_1yeub2vl",variantClassNames:{pinned:{start:"_1yeub2vm",end:"_1yeub2vn",false:"_1yeub2vo"}},defaultVariants:{},compoundVariants:[]});import{useMemo as zC}from"react";var sr={bodyWidth:{name:Y(de.runtime.bodyWidth),value:""},totalVisibleColumnsWidthValue:{name:Y(de.runtime.totalVisibleColumnsWidthValue),value:""},totalVisibleColumnsWidthVar:{name:Y(de.runtime.totalVisibleColumnsWidthVar),value:""},visibleColumnsCount:{name:Y(de.runtime.visibleColumnsCount),value:""},browserScrollbarWidth:{name:Y(de.runtime.browserScrollbarWidth),value:""}},AC=Y(q.scrollbarWidthHorizontal),dp=Y(q.scrollbarWidthVertical),_C=Y(q.columnWidthAtIndex),OC=Y(q.columnZIndexAtIndex),pp=Y(q.scrollLeft),FC=Y(q.activeCellColWidth),fp=Y(q.activeCellColOffset),yp=Y(q.baseZIndexForCells),NC=Y(q.pinnedStartWidth),mp=Y(q.bodyWidth),LC=Y(q.bodyHeight),gp=Y(q.pinnedEndOffset),hp=Y(q.pinnedEndWidth),kC=Y(q.computedVisibleColumnsCount);function Ci(n,e){let t="auto",o=n.computedVisibleIndex;return n.computedPinned?n.computedPinned==="start"?t=e.pinnedStartColsCount-n.computedVisibleIndexInCategory:n.computedPinned==="end"&&(t=e.visibleColsCount+n.computedVisibleIndexInCategory):t=-o*10,typeof t=="number"?`calc( var(${yp}) `+(t<0?"-":"+")+` ${Math.abs(t)} )`:"auto"}function Sp(n){let{computedVisibleColumns:e,computedPinnedStartColumns:t,computedPinnedEndColumns:o,computedPinnedStartColumnsWidth:r,computedPinnedEndColumnsWidth:i,computedUnpinnedColumnsWidth:a,bodySize:l,activeCellIndex:s,brain:u,scrollbars:c}=n,d=Gt(),p=[],f=e.reduce((m,g)=>{let h=g.computedVisibleIndex;m[Re.columnWidths.varName.get(h)]=g.computedWidth+"px",m[Re.columnOffsets.varName.get(h)]=g.computedPinned==="start"?`calc( ${g.computedOffset}px + var(${pp}) )`:g.computedPinned==="end"?`calc( var(${gp}) ${p.length?"+":""} ${p.map(y=>Re.columnWidths.get(y.computedVisibleIndex)).join(" + ")} + var(${pp}) )`:`${g.computedOffset}px`;let S=Ci(g,{pinnedStartColsCount:t.length,visibleColsCount:e.length});return m[`${OC}-${h}`]=`${S}`,g.computedPinned==="end"&&p.push(g),m},{});if(l.width&&(f[sr.browserScrollbarWidth.name]=`${Gt()}px`),f[sr.bodyWidth.name]=`calc(${q.bodyWidth} - ${q.scrollbarWidthVertical})`,f[sr.totalVisibleColumnsWidthValue.name]=`${r+i+a}px`,f[sr.totalVisibleColumnsWidthVar.name]=`calc(${e.map((m,g)=>`var(${_C}-${g})`).join(" + ")})`,f[sr.visibleColumnsCount.name]=e.length,s!=null){f[FC]=Re.columnWidths.get(s[1]);let m=Re.columnOffsets.get(s[1]);if(u.isHorizontalLayoutBrain){let g=u.getPageIndexForRow(s[0]);f[fp]=g?`calc( ${de.runtime.totalVisibleColumnsWidthVar} * ${g} + ${m})`:m}else f[fp]=m}return f[kC]=e.length,f[AC]=c.horizontal?`${d}px`:"0px",f[dp]=c.vertical?`${d}px`:"0px",f[NC]="calc( "+t.map(m=>Re.columnWidths.get(m.computedVisibleIndex)).join(" + ")+")",f[hp]="calc( "+o.map(m=>Re.columnWidths.get(m.computedVisibleIndex)).join(" + ")+")",f[yp]=e.length*10,f[gp]=`calc( var(${mp}) - var(${hp}) - var(${dp}) )`,f[mp]=`${l.width}px`,f[LC]=`${l.height}px`,f}var Ql=n=>{let e=0;return(...t)=>{e&&cancelAnimationFrame(e),e=requestAnimationFrame(()=>{e=0,n(...t)})}};function bp(n){let{actions:e,getState:t,focused:o,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:h,computedPinnedEndColumns:S,computedVisibleColumns:y,computedUnpinnedColumnsWidth:C,scrollbars:b,focusedClassName:I,focusedWithinClassName:T,computedPinnedStartOverflow:R,computedPinnedEndOverflow:v,focusedStyle:w,focusedWithinStyle:P,brain:x}=J(F=>{let{state:B,computed:$}=F;return{brain:B.brain,actions:F.actions,getState:F.getState,focused:B.focused,focusedWithin:B.focusedWithin,domRef:B.domRef,scrollerDOMRef:B.scrollerDOMRef,onBlurWithin:B.onBlurWithin,onFocusWithin:B.onFocusWithin,onSelfFocus:B.onSelfFocus,onSelfBlur:B.onSelfBlur,bodySize:B.bodySize,activeCellIndex:B.activeCellIndex,wrapRowsHorizontally:B.wrapRowsHorizontally,computedPinnedStartColumnsWidth:$.computedPinnedStartColumnsWidth,computedPinnedEndColumnsWidth:$.computedPinnedEndColumnsWidth,computedPinnedStartColumns:$.computedPinnedStartColumns,computedPinnedEndColumns:$.computedPinnedEndColumns,computedVisibleColumns:$.computedVisibleColumns,computedUnpinnedColumnsWidth:$.computedUnpinnedColumnsWidth,scrollbars:$.scrollbars,focusedClassName:F.state.focusedClassName,focusedWithinClassName:F.state.focusedWithinClassName,computedPinnedStartOverflow:$.computedPinnedStartOverflow,computedPinnedEndOverflow:$.computedPinnedEndOverflow,focusedStyle:F.state.focusedStyle,focusedWithinStyle:F.state.focusedWithinStyle}}),M=zC(()=>Sp({computedVisibleColumns:y,computedPinnedStartColumns:h,computedPinnedEndColumns:S,computedPinnedStartColumnsWidth:m,computedPinnedEndColumnsWidth:g,computedUnpinnedColumnsWidth:C,bodySize:d,activeCellIndex:p,brain:x,scrollbars:b}),[y,h,S,m,g,C,d,p,x,b]),D=Ql(F=>{e.focused=F}),E=Ql(F=>{e.focusedWithin=F}),N={...n,onFocus:F=>{if(n?.onFocus?.(F),F.target===i.current||F.target===a.current){if(t().focused)return;D(!0),u?.(F),r&&(E(!1),l?.(F));return}r||(E(!0),s?.(F))},onBlur:F=>{if(n?.onBlur?.(F),F.target===i.current||F.target===a.current){if(!t().focused)return;D(!1),c?.(F),r&&(E(!1),l?.(F));return}i.current?.contains(F.relatedTarget)||(E(!1),l?.(F))}},k=U(Qt,lp,f?`${Qt}--horizontal-layout`:null,N?.className,m?`${Qt}--has-pinned-start ${up}`:null,g?`${Qt}--has-pinned-end ${sp}`:null,o?`${Qt}--focused`:null,r?`${Qt}--focused-within`:null,o&&I?I:null,r&&T?T:null,R?`${Qt}--has-pinned-start-overflow`:null,v?`${Qt}--has-pinned-end-overflow`:null,cp({horizontalLayout:!!f,hasPinnedStart:!!m,hasPinnedEnd:!!g,focused:o,focusedWithin:r}));return N.className=k,N.style={...n?.style,...M},o&&w&&Object.assign(N.style,w),r&&P&&Object.assign(N.style,P),N}var Mp=so(Bn());function Ii(n){return n.map(e=>e instanceof Cn?e:new Cn(null,[e]))}var Cn=class n{constructor(e,t=[]){this.__operands=[];this.__operation=null;this.__operands=t,this.__operation=e}add(...e){return new n("+",[this,...e])}subtract(...e){return new n("-",[this,...e])}minus(...e){return this.subtract(...e)}multiply(...e){return new n("*",[this,...e])}divide(...e){return new n("/",[this,...e])}__get(e){let{__operation:t,__operands:o}=this,r=o.map(a=>VC(a,this)).join(` ${t} `);return(o.length<=1?!0:e?.__operation==="+"||e?.__operation==="-")?r:`(${r})`}done(){let e=this.__get();return`calc${e.startsWith("(")&&e.endsWith(")")?e:`(${e})`}`}};function VC(n,e){return typeof n=="string"||typeof n=="number"?`${n}`:e?n.__get(e):n.done()}var GC=(...n)=>new Cn("+",Ii(n)),Cp=(...n)=>new Cn("-",Ii(n)),HC=(...n)=>new Cn("*",Ii(n)),KC=(...n)=>new Cn("/",Ii(n)),ur={add:GC,subtract:Cp,minus:Cp,multiply:HC,divide:KC};var Wn=(n,e,t)=>{if(n=[...n],e===t||n[e]===void 0||n[t]===void 0)return n;let o=n[e];return t<e,n.splice(e,1),n.splice(t,0,o),n};var Ge=_e().requestAnimationFrame||(n=>setTimeout(n,16)),Lt=_e().cancelAnimationFrame||(n=>clearTimeout(n));var Ip=n=>{let e=null,t=null;return{stop(){e!==null&&Lt(e),t!=null&&Lt(t)},scroll(o){e!==null&&Lt(e),t!=null&&Lt(t);let r={offset:100,scrollAmountsPerRaf:[1,1,2,4,6,8,11,15],...n,...o},i=this;function a(){let s=r.scrollOffsetStart+r.offset-r.mousePosition.clientX;if(!(s>0&&s<=r.offset))return!1;let 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 o.scrollLeft=o.scrollLeft-p,e=Ge(()=>{i.scroll(o)}),!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 o.scrollLeft=o.scrollLeft+p,t=Ge(()=>{i.scroll(o)}),!0}return!!(a()||l())}}};var Be=class n{constructor(e){this.top=0;this.left=0;this.left=e.left,this.top=e.top}static clone(e){return new n(e)}static from(e){return new n(e)}shift(e){return e.top!=null&&(this.top+=e.top),e.left!=null&&(this.left+=e.left),this}getDistanceToPoint(e){let t=e.top-this.top,o=e.left-this.left;return{top:t,left:o}}};function Rp(n,e){let t=Math.atan2(n.top-e.top,n.left-e.left);return t<=0&&(t=2*Math.PI+t),t}function wp(n,e){return Math.sqrt((e.top-n.top)**2+(e.left-n.left)**2)}function BC(n,e,t){let o=Rp(n,t),r=Rp(e,t);return o===r?wp(t,e)-wp(t,n):o-r}function vp(n){if(n.length<3)return n;let[...e]=n,t={top:0,left:0};return n.forEach(o=>{t.top+=o.top,t.left+=o.left}),t.top/=n.length,t.left/=n.length,e.sort((o,r)=>BC(o,r,t)),e}function WC(n){if(n.length<2)return!1;let e=n[0].left,t=n[0].top,o={left:!1,top:!1};for(let r=1,i=n.length;r<i;r++){if(o.left&&o.top)return!1;n[r].left!==e&&(o.left=!0),n[r].top!==t&&(o.top=!0)}return!(o.left&&o.top)}function jC(n,e){if(n.length<2)return n[0]?n[0].left===e.left&&n[0].top===e.top:!1;n=vp(n);let t=n[0],o=n[n.length-1];return t.left===o.left?e.left===t.left&&e.top>=Math.min(t.top,o.top)&&e.top<=Math.max(t.top,o.top):e.top===t.top&&e.left>=Math.min(t.left,o.left)&&e.left<=Math.max(t.left,o.left)}function Pp(n,e){if(WC(n))return jC(n,e);n=vp(n);let[t]=n;for(let o=1,r=n.length-1;o<r;o++){let i=n[o],a=n[o+1];if(UC([t,i,a],e))return!0}return!1}function UC(n,e){let[t,o,r]=n,i=e,a=(o.left-t.left)*(r.top-t.top)-(o.top-t.top)*(r.left-t.left);return a*((o.left-t.left)*(i.top-t.top)-(o.top-t.top)*(i.left-t.left))>=0&&a*((r.left-o.left)*(i.top-o.top)-(r.top-o.top)*(i.left-o.left))>=0&&a*((t.left-r.left)*(i.top-r.top)-(t.top-r.top)*(i.left-r.left))>=0}var Io=class{containsPoint(e){return Pp(this.getPoints(),e)}contains(e){let t=e.getPoints();for(let o=0,r=t.length;o<r;o++)if(!this.containsPoint(t[o]))return!1;return!0}intersects(e){return this.privateIntersects(e,!1)}privateIntersects(e,t){let o=e.getPoints();for(let r=0,i=o.length;r<i;r++)if(this.containsPoint(o[r]))return!0;return t?!1:e.privateIntersects(this,!0)}};var Ro=class n extends Io{static clone(e){return new n(e)}constructor(e){super(),this.points=e.map(Be.clone)}getPoints(){return this.points}shift(e){return this.points.forEach(t=>{t.shift(e)}),this}};function $C(n,e){let t=Math.min(n.left,e.left),o=Math.min(n.top,e.top),r=n.left+n.width,i=e.left+e.width,a=Math.max(r,i),l=n.top+n.height,s=e.top+e.height,u=Math.max(l,s);return new Ae({top:o,left:t,width:a-t,height:u-o})}var Ae=class n extends Io{constructor(t){super();this.top=0;this.left=0;this.width=0;this.height=0;this.top=t.top,this.left=t.left,typeof t.width=="number"?(this.width=t.width,this.height=t.height):(this.width=t.right-t.left,this.height=t.bottom-t.top)}static fromDOMRect(t){return new n(t)}static clone(t){return new n(t)}static from(t){return n.clone(t)}static fromPoint(t){return n.from({top:t.top,left:t.left,width:0,height:0})}getMinimumBoundingRectangle(...t){let o=this;for(let r of t)o=$C(o,r);return o}toDOMRect(){return{top:this.top,left:this.left,bottom:this.top+this.height,right:this.left+this.width,height:this.height,width:this.width,x:this.left,y:this.top,toJSON:()=>({top:this.top,left:this.left,bottom:this.top+this.height,right:this.left+this.width,height:this.height,width:this.width,x:this.left,y:this.top})}}containsPoint(t){return new Ro(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(Be.from)}shift(t){return t.top!=null&&(this.top+=t.top),t.left!=null&&(this.left+=t.left),this}};var Jl;function YC(){if(typeof document>"u"||!document.body)return 1/0;let n=document.createElement("div");n.style.cssText="position:absolute;top:0;left:0;width:1px;visibility:hidden;pointer-events:none",document.body.appendChild(n);let e=o=>(n.style.height=`${o}px`,Math.abs(n.getBoundingClientRect().height-o)<1),t=1e6;if(!e(t))return n.remove(),1/0;for(;t<64e6&&e(t*2);)t*=2;return n.remove(),t}function Ri(){return Jl===void 0&&(Jl=YC()),Jl}function wi(n){return n<=4e6?!1:n>Ri()}function es(n,e){if(!wi(n))return 1;let t=Ri()-e,o=n-e;return t>0&&o>0?o/t:1}function Dp(n){let e=null;return{get value(){let t=n.getScrollPosition(),o=n.getScrollRatio();return o>1&&e!==null&&Math.abs(e-t)<=o?e:(e=null,t)},set value(t){e=t,n.setScrollPosition(t)}}}function ts(n,e,t=Math.floor){return Math.abs(n-e)<=1e6?e:t(n)}var xp=10,qC=Y(q.pinnedStartWidth);function Ep(n){let{computedVisibleColumns:e,computedVisibleColumnsMap:t,computedPinnedEndColumns:o,computedPinnedStartColumns:r,dragColumnId:i,infiniteDOMNode:a,brain:l,dragColumnHeaderTargetRect:s,draggableColumnsRestrictTo:u,tableRect:c,acceptDropToReorderRect:d,allowColumnHideOnDrag:p,setProxyPosition:f,setDragColumnOutside:m,getCurrentDragSourceAndTarget:g,groupingToolbarDragListId:h,api:S,horizontalLayoutPageIndex:y,pageWidth:C}=n;function b(j){let ee=j==="start"?F:B;return V===k?ee:k===j?ee+E.computedWidth:V===j?ee-E.computedWidth:ee}function I(j){if(j.columnIndex===L||y!=null)return!0;let ee=e[j.columnIndex];if(ee.computedPinned)return!0;let K=l.getScrollPosition().scrollLeft,ie=ee.computedOffset+(y!=null&&C!=null?C*y:0);return ie>=K+b("start")&&ie+ee.computedWidth<=K+c.width-b("end")}let T=(j,ee)=>{let{restrictToParentGroup:K,dragColumn:ie}=ee,ne=[];if(j.forEach(O=>{if(O.computedVisibleIndex===L)return;let A={columnId:O.id,columnIndex:O.computedVisibleIndex,offsetX:O.computedOffset+Math.round(O.computedWidth/2)};I(A)&&ne.push(A)}),K){let A=function(Ie,ye,Se){let xe=j[Ie];xe&&(xe.columnGroup!==ie.columnGroup&&Se.add(xe.id),A(Ie+ye,ye,Se))};var oe=A;let O=ie.computedVisibleIndex,ue=new Set;A(O-1,-1,ue),A(O+1,1,ue),ne=ne.filter(Ie=>!ue.has(Ie.columnId))}return ne},v=r.length,w={clientX:Math.round(n.initialMousePosition.clientX),clientY:Math.round(n.initialMousePosition.clientY)},P={left:w.clientX-c.left-(w.clientX-s.left)+xp,top:w.clientY-c.top-(w.clientY-s.top)+xp},x=l.getScrollPosition(),M=e.map(j=>j.computedVisibleIndex),D=M,E=t.get(i),L=E.computedVisibleIndex,V=E?.computedPinned,N=L,k=V,F=l.getFixedStartColsWidth(),B=l.getFixedEndColsWidth(),$=w,_={x:0,y:0},H=1,z=0;function Z(j){let ee=Math.round(j.clientX),K=Math.round(j.clientY);if(ee===$.clientX&&K===$.clientY)return Ae.from(s).shift({left:_.x,top:_.y});$={clientX:ee,clientY:K};let ne=l.getScrollPosition().scrollLeft-x.scrollLeft;return _.x=$.clientX-w.clientX,_.y=$.clientY-w.clientY,z=_.x+ne,H=z<0?-1:1,f({left:P.left+_.x,top:P.top+_.y}),Ae.from(s).shift({left:_.x,top:_.y})}function be(j){let ee=0;V?V==="start"&&j.forEach((K,ie)=>{ee||e[K]?.computedPinned!=="start"&&(ee=ie)}):j.forEach((K,ie)=>{e[K]?.computedPinned==="start"&&(ee=ie+1)}),v=ee,se("start",j,ee)}function se(j,ee,K){if(j==="start"){let ie=0;for(let ne=0;ne<K;ne++){let oe=ee[ne],O=e[oe];ie+=O.computedWidth}Kt(qC,`${ie}px`,a)}}function pe(j){if(j==null||j===N)return;if(N===-1&&j!==-1&&(lr(L,"",a),m(!1)),N=j,j===-1){Pe(L);return}let ee=Wn(M,L,N>L?N-1:N);v=0;let ie=new Set;return ee.forEach((ne,oe)=>{let O=D[oe];ne!==O&&ie.add(ne),be(ee)}),D=ee,De(ie),{newColumnIndexes:ee,indexesWithTransition:ie,pinnedStartCount:v}}function Pe(j){D=D.filter(K=>K!==j),e.forEach(K=>{let ie=K.computedVisibleIndex,ne=ie>j;Xl(ie,a);let oe="";ne&&(oe=ur.minus(Re.columnOffsets.get(ie),Re.columnWidths.get(j)).done()),ar(ie,oe,a)}),lr(j,"hidden",a),m(!0)}function De(j){e.forEach(ee=>{let K=ee.computedVisibleIndex;j.has(K)?Xl(K,a):Ti(K,a);let ie=K===L,ne=H===-1?K<N||K>L:K<L||K>=N,oe="";H===-1?oe=ie?Re.columnOffsets.get(N):ne?Re.columnOffsets.get(K):ur.add(Re.columnOffsets.get(K),Re.columnWidths.get(L)).done():oe=ne?Re.columnOffsets.get(K):ie?ur.add(Re.columnOffsets.get(N-1),Re.columnWidths.get(N-1)).minus(Re.columnWidths.get(L)).done():ur.minus(Re.columnOffsets.get(K),Re.columnWidths.get(L)).done(),ar(K,oe,a)})}let ce=c.left+b("start"),te=c.right-b("end"),le=Ip({scrollOffsetStart:ce,scrollOffsetEnd:te}),ge=Dp({getScrollPosition:()=>l.getScrollPosition().scrollLeft,setScrollPosition:j=>{S.scrollLeft=j},getScrollRatio:()=>l.getScrollRatio("horizontal")});return Z(w),{speedScroller:le,stop(){le.stop()},onMove(j){let ee=Z(j);if(g().dropTargetListId===h||p&&!d.containsPoint(ee.getCenter()))return p&&pe(-1),null;le.scroll({mousePosition:$,get scrollLeft(){return ge.value},set scrollLeft(A){ge.value=A}});let K=T(e,{dragColumn:E,restrictToParentGroup:u==="group"}),ie=H===-1?E.computedOffset+z:E.computedOffset+E.computedWidth+z,ne=(0,Mp.default)(K,ie,({offsetX:A},ue)=>A<ue?-1:A>ue?1:0);ne<0&&(ne=~ne),K.length?ne=K[ne]?K[ne].columnIndex:K[K.length-1].columnIndex+1:(e.length>1&&console.error("No breakpoints available, something is wrong!"),ne=0),ne===L+1&&(ne=L),pe(ne);let oe={};o.forEach(A=>{oe[A.id]="end"});for(let A=0;A<v;A++){let ue=D[A],Ie=e[ue];oe[Ie.id]="start"}let O=D.map(A=>e[A].id);return{columnPinning:oe,columnOrder:O}}}}var bt=`${nt}HeaderCell`,cr=`${nt}HeaderWrapper`,Ap=n=>Array.from(n.querySelectorAll(`.${cr}`));function vi(n,e,t,o){let r=new Map,i=new Map,a=new Map;n.forEach((c,d)=>{let p=c.id,f=n[d-1],m=f?.id??"",g=new Set,h=f?.computedPinned!==c.computedPinned?new Set:a.get(m)??new Set;a.set(p,g);let S={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],S);let y=c.columnGroup,C,b=S;for(;y;){let I=e[y];if(I){g.add(y);let T=[p,...g];C=h.has(y)?i.get(y):void 0,C||(C={id:y,type:"group",ref:I,columnItems:[],children:[],groupOffset:0,uniqueGroupId:[y],computedWidth:0,computedPinned:S.computedPinned,depth:t.get(y)??0},r.set(T,C),i.set(y,C)),C.columnItems.push(S),C.uniqueGroupId.push(S.id),b&&!h.has(b.id)&&C.children.push(b),b=C,y=I.columnGroup}else break}});let l=[],s=new W,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"&&_p(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<=o+1;d++)s.set([d,c.ref.computedVisibleIndex],c)}),r.clear(),i.clear(),{tree:l,pathsToCells:s}}function _p(n,e=0){n.forEach(t=>{let o=t.type==="column"?t.ref.computedWidth:t.columnItems.reduce((r,i)=>r+i.ref.computedWidth,0);t.computedWidth=o,t.groupOffset=e,t.type==="group"&&_p(t.children),e+=o})}var Op=["input","textarea","select","[tabindex]","a[href]","button","object"].join(", "),Pi=n=>Array.from(n.querySelectorAll(Op)).filter(t=>!!t.offsetParent),Di=n=>n.querySelector(Op);var Mi=`${nt}HeaderGroup`,Np=`.${bn}`,XC=["input","select","textarea","button","a[href]","[tabindex]"].join(", "),Lp=`.${cr}`,os=`.${nt}`,Ei=new WeakMap;function jn(n){return n.getState().domRef.current}function wo(n){let e=jn(n);return e?Array.from(e.querySelectorAll(Lp)).find(o=>o.closest(os)===e)??null:null}function kp(n,e){if(!(e instanceof Element))return!1;let t=e.closest(Lp);return!!t&&t.closest(os)===jn(n)}function In(n){let e=n.getState(),{computedVisibleColumns:t}=n.getComputed(),o=!!e.computedColumnGroups&&Object.keys(e.computedColumnGroups).length>0,r=o?e.columnGroupsMaxDepth+2:1,i=t.length,a=o?vi(t,e.computedColumnGroups,e.columnGroupsDepthsMap,e.columnGroupsMaxDepth):null,l=u=>{if(u.type==="column"){let d=u.ref.computedVisibleIndex;return{type:"column",key:u.ref.id,columnId:u.ref.id,firstCol:d,lastCol:d}}let c=u.columnItems.map(d=>d.ref.computedVisibleIndex);return{type:"group",key:u.uniqueGroupId.join(","),firstCol:Math.min(...c),lastCol:Math.max(...c)}};return{rowCount:r,colCount:i,itemAt:({row:u,col:c})=>{if(u<0||u>=r||c<0||c>=i)return null;if(!a){let p=t[c];return p?{type:"column",key:p.id,columnId:p.id,firstCol:c,lastCol:c}:null}let d=a.pathsToCells.get([u,c]);return d?l(d):null}}}function Fp(n,e){let t=wo(n);if(!t)return null;let o=e.type==="column"?`.${bt}[data-column-id="${CSS.escape(e.columnId)}"]`:`.${Mi}[data-group-id="${CSS.escape(e.key)}"]`;return Array.from(t.querySelectorAll(o)).find(i=>i.closest(os)===jn(n)&&i.offsetParent!==null)??null}function ZC(n,e,t){let o=jn(n),r=o?Ei.get(o):void 0,i=t.getAttribute("data-column-id"),a=t.classList.contains(Mi)?t.getAttribute("data-group-id"):null,l=a??i;if(l==null)return null;if(r&&e.itemAt(r)?.key===l)return r;if(i!=null&&a==null){let s=n.getComputed().computedVisibleColumnsMap.get(i);return s?{row:e.rowCount-1,col:s.computedVisibleIndex}:null}for(let s=0;s<e.rowCount;s++)for(let u=0;u<e.colCount;u++)if(e.itemAt({row:s,col:u})?.key===l)return{row:s,col:u};return null}function dr(){return new Promise(n=>requestAnimationFrame(()=>n()))}async function wt(n,e,t=In(n)){let o=t.itemAt(e);if(!o)return!1;o.type==="column"&&(e={row:t.rowCount-1,col:o.firstCol});let r=jn(n);r&&Ei.set(r,e);let i=await zp(n,o,Math.min(Math.max(e.col,o.firstCol),o.lastCol));return i?(i.focus({preventScroll:!0}),!0):!1}async function zp(n,e,t){let o=n.getComputed().computedVisibleColumns[t];o&&o.computedPinned===!1&&n.api.scrollColumnIntoView(o.id);let r=document.activeElement,i=Fp(n,e);for(let a=0;a<20&&(!i||!JC(n,i));a++){await dr();let l=document.activeElement;if(l!==r&&l&&l!==document.body)return null;i=Fp(n,e)}return i}function QC(n,e){let t=n.getComputed().computedVisibleColumns[e];return t?{type:"column",key:t.id,columnId:t.id,firstCol:e,lastCol:e}:null}function pr(n,e){let t=n.getComputed().computedVisibleColumns[e];return!!n.getState().showColumnFilters&&!!t?.computedFilterable}function Vp(n){return n?Array.from(n.querySelectorAll(XC)).filter(e=>e.tabIndex>=0&&!e.disabled&&e.offsetParent!==null):[]}async function rs(n,e,t=In(n)){let o=QC(n,e);if(!o)return!1;let r=jn(n);r&&Ei.set(r,{row:t.rowCount-1,col:e});let i=await zp(n,o,e),[a]=Vp(i?.querySelector(Np)??null);return a?(a.focus({preventScroll:!0}),!0):!1}function Gp(n,e,t){let o=n.getComputed().computedVisibleColumns.length;return t===1?e.part==="header"&&pr(n,e.col)?{col:e.col,part:"filter"}:e.col+1<o?{col:e.col+1,part:"header"}:"after":e.part==="filter"?{col:e.col,part:"header"}:e.col<=0?"before":pr(n,e.col-1)?{col:e.col-1,part:"filter"}:{col:e.col-1,part:"header"}}function xi(n,e){if(e==="before")return nI(n);if(e==="after")return n.getState().scrollerDOMRef.current?.focus({preventScroll:!0}),!0;let t=In(n);return e.part==="filter"?rs(n,e.col,t):wt(n,{row:t.rowCount-1,col:e.col},t),!0}function Hp(n){if(!wo(n))return!1;let e=n.getComputed().computedVisibleColumns.length;if(!e)return!1;let t=e-1;return xi(n,{col:t,part:pr(n,t)?"filter":"header"})}function JC(n,e){let t=wo(n);if(!t)return!0;if(getComputedStyle(e).visibility==="hidden")return!1;let o=t.getBoundingClientRect(),r=e.getBoundingClientRect();return r.right>o.left+1&&r.left<o.right-1}function Kp(n,e){let t=jn(n),o=t?Ei.get(t):void 0;return o&&e.itemAt(o)?o:{row:e.rowCount-1,col:0}}function Bp(n,e){if(e.target!==e.currentTarget){jp(n,eI(e.target)),e.currentTarget instanceof HTMLElement&&tI(n,e.currentTarget,e.target);return}let t=In(n);t.colCount&&wt(n,Kp(n,t),t)}function Wp(n,e){let t=e.currentTarget,o=e.relatedTarget;(!(t instanceof Node)||!(o instanceof Node)||!t.contains(o))&&jp(n,null)}function eI(n){if(!(n instanceof HTMLElement))return null;if(n.classList.contains(bt)){let e=n.getAttribute("data-column-id");return e!=null?{type:"column",key:e}:null}if(n.classList.contains(Mi)){let e=n.getAttribute("data-group-id");return e!=null?{type:"group",key:e}:null}return null}function jp(n,e){let t=n.getState().focusedHeaderItem;t?.type===e?.type&&t?.key===e?.key||(n.actions.focusedHeaderItem=e)}function Up(n){let e=n.getState().focusedHeaderItem;if(e?.type!=="column")return()=>{};let t=e.key;return()=>{(async()=>{await dr();let o=document.activeElement,r=wo(n);if(o&&o!==document.body&&!(r&&r.contains(o)))return;let i=n.getComputed().computedVisibleColumnsMap.get(t);if(!i)return;let a=In(n);await wt(n,{row:a.rowCount-1,col:i.computedVisibleIndex},a)})()}}function tI(n,e,t){let r=(t instanceof Element?t.closest(`.${bt}`):null)?.getAttribute("data-column-id"),i=r?n.getComputed().computedVisibleColumnsMap.get(r):null,a=()=>{(e.scrollLeft||e.scrollTop)&&(e.scrollLeft=0,e.scrollTop=0)};a(),i&&i.computedPinned===!1&&n.api.scrollColumnIntoView(i.id),requestAnimationFrame(a)}function $p(n,e){if(!wo(n))return!1;let t=In(n);if(!t.colCount)return!1;let o=e??Kp(n,t).col;return pr(n,o)?(rs(n,o,t).then(r=>{r||wt(n,{row:t.rowCount-1,col:o},t)}),!0):(wt(n,{row:t.rowCount-1,col:o},t),!0)}function ns(n,e){let t=n.getState(),{brain:o,keyboardNavigation:r}=t;if(o.getRowCount()>0){let i=Math.max(0,o.getItemAt(o.getScrollPosition().scrollTop,"vertical"));r==="cell"?n.actions.activeCellIndex=[i,e]:r==="row"&&(n.actions.activeRowIndex=i)}t.scrollerDOMRef.current?.focus({preventScroll:!0})}function nI(n){let e=wo(n);if(!e)return!1;let t=Pi(document.body),o=t.indexOf(e),r=o>0?t[o-1]:null;return r?r.focus():document.activeElement?.blur(),!0}function oI(n){if(!(n instanceof HTMLElement))return!1;let e=n.tagName;return e==="INPUT"||e==="TEXTAREA"||e==="SELECT"||e==="BUTTON"||n.isContentEditable}function Yp(n,e){let t=e.target;if(!(t instanceof HTMLElement))return!1;let o=t.closest(Np);if(o)return rI(n,o,t,e);if(oI(t)||!(t.classList.contains(bt)||t.classList.contains(Mi)))return!1;let i=In(n),a=ZC(n,i,t);if(!a)return!1;let l=i.itemAt(a);if(!l)return!1;if(e.key==="Tab"){let c=e.shiftKey?-1:1;return l.type==="group"&&c===1?xi(n,{col:l.firstCol,part:"header"}):xi(n,Gp(n,{col:l.firstCol,part:"header"},c))}let{computedVisibleColumns:s}=n.getComputed();if(e.key==="Enter")return l.type!=="column"?!1:(lI(n,l.columnId,e),!0);if(e.key==="ArrowDown"&&e.altKey){if(l.type!=="column")return!1;let c=t.querySelector('[data-name="menu-icon"]');return n.api.getColumnApi(l.columnId)?.toggleContextMenu(c??t),aI(n,l.columnId,a),!0}if(e.altKey||e.ctrlKey||e.metaKey)return!1;let u=s.length-1;switch(e.key){case"ArrowRight":return l.lastCol<u&&wt(n,{row:a.row,col:l.lastCol+1},i),!0;case"ArrowLeft":return l.firstCol>0&&wt(n,{row:a.row,col:l.firstCol-1},i),!0;case"Home":return wt(n,{row:a.row,col:0},i),!0;case"End":return wt(n,{row:a.row,col:u},i),!0;case"ArrowUp":{let c=a.row-1;for(;c>=0&&i.itemAt({row:c,col:a.col})?.key===l.key;)c--;return c>=0&&wt(n,{row:c,col:a.col},i),!0}case"ArrowDown":{let c=a.row+1;for(;c<i.rowCount&&i.itemAt({row:c,col:a.col})?.key===l.key;)c++;return c<i.rowCount?wt(n,{row:c,col:a.col},i):pr(n,a.col)?rs(n,a.col,i).then(d=>{d||ns(n,a.col)}):ns(n,a.col),!0}}return!1}function rI(n,e,t,o){if(o.defaultPrevented)return!1;if(o.key==="Tab")return iI(n,e,t,o.shiftKey);if(o.key!=="ArrowUp"&&o.key!=="ArrowDown"||o.shiftKey||o.altKey||o.ctrlKey||o.metaKey)return!1;let r=e.closest(`.${bt}`)?.getAttribute("data-column-id"),i=r?n.getComputed().computedVisibleColumnsMap.get(r):null;if(!i)return!1;let a=i.computedVisibleIndex;if(o.key==="ArrowUp"){let l=In(n);wt(n,{row:l.rowCount-1,col:a},l)}else ns(n,a);return!0}function iI(n,e,t,o){let i=e.closest(`.${bt}`)?.getAttribute("data-column-id"),a=i?n.getComputed().computedVisibleColumnsMap.get(i):null;if(!a)return!1;let l=Vp(e),s=l.findIndex(d=>d===t||d.contains(t)),u=s<=0,c=s===-1||s===l.length-1;return(o?!u:!c)?!1:xi(n,Gp(n,{col:a.computedVisibleIndex,part:"filter"},o?-1:1))}async function aI(n,e,t){let o=()=>n.getState().columnMenuVisibleForColumnId===e;for(let i=0;i<10&&!o();i++)await dr();for(;o();)await dr();await dr();let r=document.activeElement;(!r||r===document.body)&&wt(n,t)}function lI(n,e,t){let o=n.getComputed().computedVisibleColumnsMap.get(e);if(!o||!o.computedSortable)return;let{multiSortBehavior:r}=n.getState();n.api.toggleSortingForColumn(e,{multiSortBehavior:r==="replace"&&(t.ctrlKey||t.metaKey)?"append":r})}function is(n){let{newColumnOrder:e,visibleColumnOrder:t,existingColumnOrder:o,dragColumnId:r}=n;if(t.length!==e.length)return console.warn("new column order cannot contain less columns than the visible column order"),e;let i=t.indexOf(r),a=e.indexOf(r);if(i===a)return o;if(a>i){let l=e.indexOf(r),s=e[l-1],u=o.indexOf(s),c=o.indexOf(r);return Wn(o,c,u)}else{let l=e.indexOf(r),s=e[l+1],u=o.indexOf(s),c=o.indexOf(r);return Wn(o,c,u)}return e}import*as Je from"react";var Un=class{constructor(e){this.listeners={};e&&Object.keys(e).forEach(t=>{this.on(t,e[t])})}on(e,t){return this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(t),()=>this.off(e,t)}once(e,t){let o=((...r)=>{this.off(e,o),t(...r)});return this.on(e,o)}off(e,t){let o=this.listeners[e];if(!o)return;let r=o.indexOf(t);r!==-1&&o.splice(r,1)}emit(e,...t){let o=this.listeners[e];o&&o.slice().forEach(r=>{try{r(...t)}catch(i){console.error(`Error in event handler for event '${String(e)}':`,i)}})}clear(e){this.listeners[e]&&(this.listeners[e]=[])}clearAll(){Object.keys(this.listeners).forEach(e=>{this.listeners[e]=[]})}};var qp=so(Bn());var Xp=(n,e)=>{let{offset:t,activeDragSource:o}=n,{orientation:r,draggableItems:i,listId:a,listRectangle:l}=e.getData(),{dragItem:s,listId:u,dragIndex:c,dragRectangle:d}=o,p=u===a,f=Be.from(d.getCenter());if(!l.containsPoint(f))return null;e.activeDragSourcePosition="inside";let m=p?r==="horizontal"?t.left>0?1:-1:t.top>0?1:-1:1,g=d.toDOMRect(),h=e.breakpoints,S=Math.round(m===1?r==="horizontal"?g.right-(p?0:g.width/2):g.bottom-(p?0:g.height/2):r==="horizontal"?g.left+(p?0:g.width/2):g.top+(p?0:g.height/2)),y=(0,qp.default)(h,S,(R,v)=>R-v);y<0&&(y=~y),m===1&&y===c+1&&p&&y--;let C=Math.min(c,y),b=Math.max(c,y),I=p?i.map((R,v)=>{if(v===c&&p)return t;if(v<C||v>=b)return{left:0,top:0};let w=y<=v?1:-1;return r==="horizontal"?{left:Math.round(w*g.width),top:0}:{left:0,top:Math.round(w*g.height)}}):i.map((R,v)=>{let w=y<=v?1:0;return r==="horizontal"?{left:Math.round(w*g.width),top:0}:{left:0,top:Math.round(w*g.height)}}),T={offset:t,dropIndex:y,dragSourceListId:u,dropTargetListId:a,dragIndex:c,outside:!1,items:i,dragItem:s,offsetsForItems:I,dragRect:g,status:"accepted"};return e.acceptsDrop(T)?{event:T,error:null,success:!0}:(T.status="rejected",{event:T,error:"rejected by interaction target",success:!1})},Zp=(n,e)=>{let{offset:t,activeDragSource:o}=n,{orientation:r,listId:i,listRectangle:a,draggableItems:l}=e.getData(),{dragRectangle:s,dragItem:u,listId:c}=o,d=Be.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?o.dragIndex:-1,g=s.toDOMRect(),h={offset:t,dropIndex:-1,dragIndex:m,dragItem:u,outside:!f,items:l,dragSourceListId:c,dropTargetListId:i,offsetsForItems:p?l.map((S,y)=>S.id===u.id?t:f?{left:0,top:0}:y>m&&!e.getData().preserveDragSpace?r==="horizontal"?{left:-u.rect.width,top:0}:{left:0,top:-u.rect.height}:{left:0,top:0}):l.map(S=>({left:0,top:0})),dragRect:g,status:"accepted"};return e.acceptsDrop(h)?{event:h,error:null,success:!0}:(h.status="rejected",{event:h,error:"rejected by interaction target",success:!1})};var we=class we{static startDrag(e,t){let o=e instanceof vo?e:new vo(e),r=new as({activeDragSource:o,startPoint:t});return we.currentDragOperation=r,r.on("start",we.onDragStart),r.on("move",we.onDragMove),r.on("drop",we.onDragDrop),r.start(),r}static retriggerMove(){let e=we.currentDragOperation;e&&e.phase==="move"&&we.onDragMove(e)}static emit(e,...t){we.emitter.emit(e,...t)}static on(e,t){return we.emitter.on(e,t)}static registerDragInteractionTarget(e){let{listId:t}=e,o=we.dragInteractionTargetsMap.get(t);if(o&&o!==e){console.warn(`DragInteractionTarget with listId ${t} already registered`);return}return o||(we.dragInteractionTargetsMap.set(t,e),we.emit("register",e)),()=>{we.unregisterDragInteractionTarget(e)}}static unregisterAll(){we.dragInteractionTargetsMap.forEach(e=>{we.unregisterDragInteractionTarget(e)})}static unregisterDragInteractionTarget(e){if(!e)return;let{listId:t}=e;we.dragInteractionTargetsMap.get(t)===e&&(we.dragInteractionTargetsMap.delete(t),e.unregister(),we.emit("unregister",e))}static onDragStart(e){let{dragItem:t,dragIndex:o}=e.activeDragSource,r=e.activeDragSource.listId,a=we.dragInteractionTargetsMap.get(r)?.getData().acceptDropsFrom,s=!a||a.includes(r)?r:null;we.dragInteractionTargetsMap.forEach(u=>{let c=u.getData();u.start({dragIndex:c.listId===r?o:-1,dragItem:t,dragSourceListId:r,dropTargetListId:s})}),we.emitter.emit("drag-start",{dragSourceListId:r,dropTargetListId:s,dragItem:t,dragIndex:o})}static withDragMove(e,t){let{activeDragSource:o}=e,{listId:r}=o,i=[],a=!0,l=we.dragInteractionTargetsMap.get(r);l&&(a=l.acceptsSelfDrops(),a&&i.push(we.dragInteractionTargetsMap.get(r))),we.dragInteractionTargetsMap.forEach(s=>{s.listId!==r&&i.push(s)});for(let s of i){let u=Xp(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=Zp(e,s);u&&t(s,u)}}static onDragMove(e){let{activeDragSource:t}=e,{listId:o,dragItem:r}=t,i=null,a=[];we.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;we.emit("drag-move",{dragSourceListId:o,dropTargetListId:s,items:l?.items??[],dragItem:r,status:l?.status??"accepted",dragIndex:l?.dragIndex??-1,dropIndex:l?.dropIndex??-1})}static onDragDrop(e){let{activeDragSource:t}=e,{listId:o,dragItem:r}=t,i=null,a=[];we.withDragMove(e,(s,{event:u})=>{e.cancelled&&(u={...u,dropTargetListId:null,dropIndex:-1,outside:!1}),s.drop(u),a.push(u),u.outside||(i=u)});let l=i??a[0]??null;we.emit("drag-drop",{dragSourceListId:o,dropTargetListId:l?.dropTargetListId??null,items:l?.items??[],dragItem:r,status:l?.status??"accepted",dragIndex:l?.dragIndex??-1,dropIndex:l?.dropIndex??-1}),we.currentDragOperation=null,we.unregisterAll()}};we.dragInteractionTargetsMap=new Map,we.currentDragOperation=null,we.emitter=new Un;var ut=we,vo=class n{static clone(e){let t=e.getData();return new n(t)}constructor(e){this.setData(e)}get listId(){return this.data.listId}get dragIndex(){return this.data.dragIndex??-1}get dragItem(){return this.data.dragItem}setData(e){St(this.data,e)||(this.data=e,this.dragRectangle=new Ae(this.data.dragItem.rect))}getData(){return this.data}static shift(e,t){let o=n.clone(e),r=Ae.from(o.dragRectangle);return r.shift(t),o.dragRectangle=r,o}},as=class extends Un{constructor(t){super(t.listeners);this.phase="start";this.cancelled=!1;this.currentOffset={top:0,left:0};this.initialDragSource=vo.clone(t.activeDragSource),this.activeDragSource=this.initialDragSource,this.startPoint={top:Math.round(t.startPoint.top),left:Math.round(t.startPoint.left)}}get offset(){return this.currentOffset}start(){let{listId:t,dragItem:o}=this.activeDragSource,r={dragSourceListId:t,dragItemId:o.id,startPoint:this.startPoint};return this.emit("start",this,r),r}drop(){this.phase="drop",this.emit("drop",this)}cancel(){this.cancelled=!0,this.drop()}move(t){if(this.phase!=="start"&&this.phase!=="move")return;this.phase="move";let o={top:Math.round(t.top-this.startPoint.top),left:Math.round(t.left-this.startPoint.left)};this.activeDragSource=vo.shift(this.initialDragSource,o),this.currentOffset=o,this.emit("move",this)}};globalThis.DragManager=ut;import{useEffect as sI}from"react";var Qp=Je.createContext({dragSourceListId:null,dropTargetListId:null,dragItemId:"",status:"accepted",updateDragOperationSourceAndTarget:n=>{},getCurrentDragSourceAndTarget:()=>({dragSourceListId:null,dropTargetListId:null,status:"accepted",dragItemId:""})}),Rn=()=>Je.useContext(Qp),Jp=Je.createContext(""),$n=n=>{let e=Je.useContext(Jp);return e?`${n}-${e}`:n},ls=n=>{let[e,t]=Je.useState({dragSourceListId:null,dropTargetListId:null,dragItemId:"",status:"accepted"}),o=Je.useId(),r=Je.useRef(e);r.current=e;let i=Je.useCallback(()=>{let l=r.current;return{dragSourceListId:l.dragSourceListId,dropTargetListId:l.dropTargetListId,dragItemId:l.dragItemId,status:l.status}},[]),a=Je.useMemo(()=>({dragSourceListId:e.dragSourceListId,dropTargetListId:e.dropTargetListId,dragItemId:e.dragItemId,status:e.status,updateDragOperationSourceAndTarget:t,getCurrentDragSourceAndTarget:i}),[e,t]);return sI(()=>{let l=ut.on("drag-start",c=>{t({dragSourceListId:c.dragSourceListId,dropTargetListId:c.dropTargetListId,dragItemId:c.dragItem.id,status:"accepted"})}),s=ut.on("drag-move",c=>{let d=r.current,p={dragSourceListId:c.dragSourceListId,dropTargetListId:c.dropTargetListId,dragItemId:c.dragItem.id,status:c.status};JSON.stringify(d)!==JSON.stringify(p)&&t(p)}),u=ut.on("drag-drop",()=>{t({dragSourceListId:null,dropTargetListId:null,dragItemId:"",status:"accepted"})});return()=>{l(),s(),u()}},[ut,t]),Je.createElement(Jp.Provider,{value:o},Je.createElement(Qp.Provider,{value:a},typeof n.children=="function"?n.children(a):n.children))};var Ai="header",_i="grouping-toolbar";var ss=`${nt}Body`,ef=n=>n.querySelector(`.${ss}`);function fr(n){if(!n)return!1;let e=n.tagName;return e==="INPUT"||e==="BUTTON"}var cI=Y(q.baseZIndexForCells),dI=(n,e)=>{let t=!n||Object.keys(n).length===0,o=!e||Object.keys(e).length===0;return t&&o?!0:!!n!=!!e?!1:St(n,e)},of=({columnId:n,domRef:e,horizontalLayoutPageIndex:t,allowColumnHideOnDrag:o})=>{let[r,i]=nf(null),[a,l]=nf(!1),{getCurrentDragSourceAndTarget:s}=Rn(),u=$n(_i),{getComputed:c,getState:d,api:p,computedDraggable:f,rootRef:m,actions:g}=J(y=>({actions:y.actions,getComputed:y.getComputed,getState:y.getState,api:y.api,computedDraggable:y.computed.computedVisibleColumnsMap.get(n)?.computedDraggable,rootRef:y.state.domRef})),h=tf(y=>{let C=c().computedVisibleColumnsMap.get(n);if(!C||!C.computedSortable)return;let{multiSortBehavior:b}=d();p.toggleSortingForColumn(n,{multiSortBehavior:b==="replace"&&(y.ctrlKey||y.metaKey)?"append":b})},[]),S=tf(y=>{if(fr(y.target))return;let{brain:C,draggableColumnsRestrictTo:b}=d(),{computedVisibleColumns:I,computedVisibleColumnsMap:T,computedPinnedStartColumns:R,computedUnpinnedColumns:v,computedPinnedEndColumns:w}=c(),P=T.get(n);if(!P.computedDraggable){h(y);return}let x=e.current,M=x.getBoundingClientRect(),D=m.current.getBoundingClientRect(),E=C.getAvailableSize(),L=P.computedVisibleIndex,V=C.getVirtualColIndex(P.computedVisibleIndex,{pageIndex:t||0}),N=C.isHorizontalLayoutBrain?C.getPageWidth():null,k=x.style.cursor??"auto",F=!1,B=m.current,$=Ae.from(ef(B).getBoundingClientRect()),_=Ap(B).map(ce=>Ae.from(ce.getBoundingClientRect())),H=$.getMinimumBoundingRectangle(..._),z=Ep({brain:C,horizontalLayoutPageIndex:t,allowColumnHideOnDrag:o,pageWidth:N,draggableColumnsRestrictTo:b,computedPinnedEndColumns:w,computedPinnedStartColumns:R,computedUnpinnedColumns:v,computedVisibleColumns:I,computedVisibleColumnsMap:T,dragColumnHeaderTargetRect:M,dragColumnId:n,getCurrentDragSourceAndTarget:s,groupingToolbarDragListId:u,api:p,infiniteDOMNode:m.current,setProxyPosition:i,setDragColumnOutside:l,tableRect:D,acceptDropToReorderRect:H,initialMousePosition:{clientX:y.clientX,clientY:y.clientY}}),Z=null,be,se;function pe(ce){let{columnPinning:te,columnOrder:le}=ce;dI(d().columnPinning,te)||(g.columnPinning=te);let ge=c().computedColumnOrder;JSON.stringify(le,ge)&&(g.columnOrder=is({newColumnOrder:le,visibleColumnOrder:c().computedVisibleColumns.map(j=>j.id),existingColumnOrder:ge,dragColumnId:n}))}let Pe=ce=>{let{headerBrain:te,brain:le}=d();if(!F){F=!0;let ge=le.keepColumnRendered(V),j=te.keepColumnRendered(V);if(le.isHorizontalLayoutBrain){let K=le.extendRenderRange({start:!0,end:!0,direction:"horizontal"}),ie=te.extendRenderRange({start:!0,end:!0,direction:"horizontal"});se=()=>{K(),ie()}}be=()=>{ge(),j()},g.columnReorderDragColumnId=P.id,t!=null&&(g.columnReorderInPageIndex=t),ql(L,`calc( var(${cI}) + 10000 )`,m.current),m.current?.classList.add(Zl),x.style.cursor="grabbing"}Z=z.onMove(ce)},De=ce=>{let te=ce.pointerId;requestAnimationFrame(()=>{let{multiSortBehavior:le}=d(),ge=m.current;ge?.classList.remove(Zl),z.stop(),C.update({...E}),be?.(),se?.(),x.style.cursor=k,x.hasPointerCapture?.(te)&&x.releasePointerCapture(te),x.removeEventListener("pointermove",Pe),x.removeEventListener("pointerup",De),i(null);let j=p.getColumnApi(P.id)?.isSortable()??!1;!F&&j&&p.toggleSortingForColumn(P.id,{multiSortBehavior:le==="replace"&&(ce.ctrlKey||ce.metaKey)?"append":le});let ee=Z?Up({getState:d,getComputed:c,api:p,actions:g}):null;uI(()=>{Z?pe(Z):F&&o&&p.setVisibilityForColumn(P.id,!1),g.columnReorderDragColumnId=!1,t!=null&&(g.columnReorderInPageIndex=null)}),ee?.(),I.forEach(K=>{Ti(K.computedVisibleIndex,ge),lr(K.computedVisibleIndex,"",ge),ar(K.computedVisibleIndex,"",ge)}),ql(L,Ci(P,{pinnedStartColsCount:R.length,visibleColsCount:I.length}),ge)})};x.addEventListener("pointermove",Pe),x.addEventListener("pointerup",De),x.setPointerCapture(y.pointerId)},[n,t,u]);return{onPointerDown:f?S:h,dragColumnOutside:a,proxyPosition:r}};import*as Ao from"react";import*as Ce from"react";import{useCallback as dt,useContext as kI,useEffect as zI,useMemo as VI,useReducer as GI,useSyncExternalStore as HI}from"react";var af=Symbol("REPAINT_CELLS_KEY_NO_ROW");function lf(n){return typeof n=="function"}function rf(n,e){let{column:t,rowIndex:o,rowInfoStore:r,getDataSourceState:i}=e,a=r.getRowInfoAtIndex(o);if(!a)return af;let l=r.getDataSourceStates();return n({rowInfo:a,column:t,dataSourceState:l.dataSourceState??i(),previousDataSourceState:l.previousDataSourceState})}function sf(n,e,t){let o=rf(n,e);return e.rowInfoStore.subscribeToDataArrayChange(()=>{let r=rf(n,e);r!==af&&(Object.is(r,o)||(o=r,t()))})}var uf="_1eexc2a7 _1eexc2a6",cf=me({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"]]}),df=me({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 pf="_1eexc2a5",Oi=me({defaultClassName:"_1eexc2aa",variantClassNames:{direction:{up:"_1eexc2ab",down:"_1eexc2ac",neutral:"_1eexc2ad"}},defaultVariants:{},compoundVariants:[]}),Po="_1eexc2a8";import*as Fi from"react";import{useEffect as pI,useRef as fI}from"react";var ff="qz8ht90 _16lm1iwk";function mI(){return{checked:1,disabled:n=>n??!1,domProps:1}}var{ManagedComponentContextProvider:gI}=Ot({forwardProps:mI,mappedCallbacks:{checked:n=>({callbackName:"onChange",callbackParams:[n]})},debugName:"InfiniteCheckBox"});function hI(){let{componentState:n,componentActions:e}=Ft(),{checked:t,domProps:o,disabled:r}=n,i=fI(null);return pI(()=>{i.current.indeterminate=t==null},[t]),Fi.createElement("input",{...o,className:U("InfiniteCheckBox",ff,o?.className),type:"checkbox",ref:i,checked:!!t,disabled:r,onChange:()=>{r||(e.checked=!t)}})}function wn(n){return Fi.createElement(gI,{...n},Fi.createElement(hI,null))}var yI="*",Ue=class{constructor(e){this.wildcard=yI;this.cache=new W;this.selectedRowsToColumns=new Map;this.selectedColumnsToRows=new Map;this.deselectedRowsToColumns=new Map;this.deselectedColumnsToRows=new Map;this.defaultSelection=!1;this.debugId="";this.deselectAll=()=>{this.update({defaultSelection:!1,selectedCells:[]})};this.selectAll=()=>{this.update({defaultSelection:!0,deselectedCells:[]})};let t=e&&e instanceof Object.getPrototypeOf(this).constructor?e.getState():e;t&&this.update(t)}selectCell(e,t){this.setCellSelected(e,t,!0)}deselectCell(e,t){this.setCellSelected(e,t,!1)}selectColumn(e){this.setCellSelected(this.wildcard,e,!0)}deselectColumn(e){this.setCellSelected(this.wildcard,e,!1)}setCellSelected(e,t,o){let r=e===this.wildcard,i=t===this.wildcard;if(this.isCellSelected_Internal(e,t)===o)return;let l=[];if(r){let 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),o)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,o){if(o){let r=this.deselectedRowsToColumns.get(e)||new Set;r.add(t),this.deselectedRowsToColumns.set(e,r)}else{let r=this.deselectedRowsToColumns.get(e);r&&(r.delete(t),r.size===0&&this.deselectedRowsToColumns.delete(e))}if(o){let r=this.deselectedColumnsToRows.get(t)||new Set;r.add(e),this.deselectedColumnsToRows.set(t,r)}else{let r=this.deselectedColumnsToRows.get(t);r&&(r.delete(e),r.size===0&&this.deselectedColumnsToRows.delete(t))}}setCellInSelection(e,t,o){if(e===this.wildcard&&t===this.wildcard)throw new Error("rowId and colId cannot be used as a wildcard at the same time!");if(o){let r=this.selectedRowsToColumns.get(e)||new Set;r.add(t),this.selectedRowsToColumns.set(e,r)}else{let r=this.selectedRowsToColumns.get(e);r&&(r.delete(t),r.size===0&&this.selectedRowsToColumns.delete(e))}if(o){let r=this.selectedColumnsToRows.get(t)||new Set;r.add(e),this.selectedColumnsToRows.set(t,r)}else{let r=this.selectedColumnsToRows.get(t);r&&(r.delete(e),r.size===0&&this.selectedColumnsToRows.delete(t))}}update(e){let t=e.selectedCells||null,o=e.deselectedCells||null;this.selectedRowsToColumns.clear(),this.selectedColumnsToRows.clear(),this.deselectedRowsToColumns.clear(),this.deselectedColumnsToRows.clear(),this.cache.clear(),t&&t.forEach(([r,i])=>{this.setCellInSelection(r,i,!0)}),o&&o.forEach(([r,i])=>{this.setCellInDeselection(r,i,!0)}),this.defaultSelection=e.defaultSelection}isCellSelectionInRow(e,t){if(this.defaultSelection){let r=this.deselectedRowsToColumns.get(e);if(r){if(r.has(this.wildcard)){let i=this.selectedRowsToColumns.get(e);return i&&i.size>0?t.some(a=>i.has(a)):!1}return t.some(i=>!r.has(i))}return!0}let o=this.selectedRowsToColumns.get(e);if(o){if(o.has(this.wildcard)){let r=this.deselectedRowsToColumns.get(e);return r&&r.size>0?!t.every(a=>r.has(a)):!0}return t?t.some(r=>o.has(r)):!1}return!1}error(e){gn(`${this.debugId}:CellSelectionState`)(e)}isCellSelected(e,t){return e===this.wildcard||t===this.wildcard?(this.error("CellSelectionState.isCellSelected should not be called with wildcard"),!1):this.isCellSelected_Internal(e,t)}isCellSelected_Internal(e,t){let o=[e,t],{cache:r}=this,i=r.get(o);if(i!=null)return i;let a=()=>(r.set(o,!1),!1),l=()=>(r.set(o,!0),!0),s=this.deselectedColumnsToRows.get(this.wildcard),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((o,r)=>{o.forEach(i=>{e.push([r,i])})}),this.selectedRowsToColumns.forEach((o,r)=>{o.forEach(i=>{t.push([r,i])})}),{defaultSelection:this.defaultSelection,deselectedCells:e,selectedCells:t}}};function vn(n,e){return e().dataArray[n]}function Ni(n){return n().dataArray}var mt=class{constructor(e){this.collapsedPathsMap=new W;this.expandedPathsMap=new W;this.collapsedIdsMap=new Map;this.expandedIdsMap=new Map;this._mode="path";this.defaultExpanded=!1;this.expandAll=()=>{this.update({defaultExpanded:!0,collapsedPaths:[]})};this.collapseAll=()=>{this.update({defaultExpanded:!1,expandedPaths:[]})};let t=e&&e instanceof Object.getPrototypeOf(this).constructor?e.getState():e;t&&this.update(t)}get mode(){return this._mode}reset(){this.collapsedPathsMap.clear(),this.expandedPathsMap.clear(),this.collapsedIdsMap.clear(),this.expandedIdsMap.clear()}destroy(){this.reset()}expandNode(e){this.setNodeExpanded(e,!0)}collapseNode(e){this.setNodeExpanded(e,!1)}setNodeExpanded(e,t){let{collapsedPathsMap:o,collapsedIdsMap:r,expandedPathsMap:i,expandedIdsMap:a,defaultExpanded:l,_mode:s}=this;s==="id"&&Array.isArray(e)&&(e=e[e.length-1]),t===l?t?s==="path"&&Array.isArray(e)?o.delete(e):r.delete(e):s==="path"&&Array.isArray(e)?i.delete(e):a.delete(e):t?s==="path"&&Array.isArray(e)?i.set(e,!0):a.set(e,!0):s==="path"&&Array.isArray(e)?o.set(e,!0):r.set(e,!0)}isNodeExpandedByPath(e){return this.isNodeExpanded(e)}isNodeExpandedById(e){return this.isNodeExpanded(e)}isNodeExpanded(e){if(this._mode==="id"&&Array.isArray(e)&&(e=e[e.length-1]),this._mode==="id"&&Array.isArray(e))throw`You try to check if a node is expanded by id (${e}) but your TreeExpandState is configured to use node paths.`;if(this._mode==="path"&&!Array.isArray(e))throw`You try to check if a node is expanded by path (${e}) but your TreeExpandState is configured to use node ids.`;return this.defaultExpanded?this._mode==="path"&&Array.isArray(e)?!this.collapsedPathsMap.has(e):!this.collapsedIdsMap.has(e):this._mode==="path"&&Array.isArray(e)?this.expandedPathsMap.has(e):this.expandedIdsMap.has(e)}update(e){if(this.defaultExpanded=e.defaultExpanded,this.reset(),e.expandedPaths||e.collapsedPaths){this._mode="path";let r=e.expandedPaths||null,i=e.collapsedPaths||null;if(r)for(let a=0,l=r.length;a<l;a++)this.expandedPathsMap.set(r[a],!0);if(i)for(let a=0,l=i.length;a<l;a++)this.collapsedPathsMap.set(i[a],!0);return}this._mode="id";let t=e.expandedIds||null,o=e.collapsedIds||null;if(t)for(let r=0,i=t.length;r<i;r++)this.expandedIdsMap.set(t[r],!0);if(o)for(let r=0,i=o.length;r<i;r++)this.collapsedIdsMap.set(o[r],!0)}getState(){if(this._mode==="path"){let o=Array.from(this.collapsedPathsMap.keys()),r=Array.from(this.expandedPathsMap.keys());return{defaultExpanded:this.defaultExpanded,collapsedPaths:o,expandedPaths:r}}let e=Array.from(this.collapsedIdsMap.keys()),t=Array.from(this.expandedIdsMap.keys());return{defaultExpanded:this.defaultExpanded,collapsedIds:e,expandedIds:t}}};var us=n=>Array.isArray(n)?new W(n.map(e=>[e,!0])):n,SI=(n,e)=>n.length-e.length,et=class n{constructor(e,t){this.selectedPaths=null;this.deselectedPaths=null;this.defaultSelection=!1;this.selectionMap=new W;this.cache=new W;this.strictMode=!1;let o=e instanceof Object.getPrototypeOf(this).constructor,r=o?e.getState():e;this.setConfig(t||(o?e.config:{treePaths:new W})),this.disableStrictMode(),this.update(r),this.config.strictCheckPaths&&this.enableStrictMode()}getTreePaths(e){return e?us(e):this.config.treePaths}withTreePaths(e,t){let o=this.config.treePaths;t=this.getTreePaths(t);let r=t!==o;r&&this.xcache(),this.config.treePaths=t;let i=e(t);return this.config.treePaths=o,r&&this.xcache(),i}getLeafNodePaths(e=[],t){return this.withTreePaths(o=>o.getKeysForLeafNodesStartingWith(e),t)}forEachLeafNodePath(e,t=[],o){let r={selected:!1};this.withTreePaths(i=>{i.getLeafNodesStartingWith(t,a=>{r.selected=this.isNodeSelected(a.keys)===!0,e(a.keys,r)})},o)}getSelectedLeafNodePaths(e=[],t){let o=[];return this.withTreePaths(r=>{r.getLeafNodesStartingWith(e,i=>{this.isNodeSelected(i.keys)&&o.push(i.keys)})},t),o}getDeselectedLeafNodePaths(e=[],t){let o=[];return this.withTreePaths(r=>{r.getLeafNodesStartingWith(e,i=>{this.isNodeSelected(i.keys)||o.push(i.keys)})},t),o}isLeafNode(e){let{treePaths:t}=this.config;return t.has(e)?t.getKeysForLeafNodesStartingWith(e).length===1:null}getLeafNodesCount(e){return this.config.treePaths.getKeysForLeafNodesStartingWith(e).length}static from(e,t){return new n(e,t)}setConfig(e){let t=typeof e=="function"?e():e;this.config={treePaths:us(t.treePaths),strictCheckPaths:t.strictCheckPaths??!0,multiRowSelectionTarget:t.multiRowSelectionTarget,unfilteredTreePaths:t.unfilteredTreePaths?us(t.unfilteredTreePaths):void 0},this.xcache()}hasFilteredOutLeavesInside(e){let{multiRowSelectionTarget:t,unfilteredTreePaths:o,treePaths:r}=this.config;return t!=="visible"||!o||o===r?!1:o.getAllChildrenSizeFor(e)>r.getAllChildrenSizeFor(e)}setVisibleLeafNodesSelection(e,t){let{unfilteredTreePaths:o,treePaths:r}=this.config;this.xcache(),r.getKeysForLeafNodesStartingWith(e).forEach(i=>{o.getAllChildrenSizeFor(i)>0||(this.selectionMap.delete(i),this.isNodeSelected(i)!==t&&this.setSelectionForPath(i,t))}),this.xcache()}xcache(){this.cache.clear()}update(e){this.selectedPaths=e.selectedPaths||null,this.deselectedPaths=e.deselectedPaths||null;let{selectionMap:t,selectedPaths:o,deselectedPaths:r}=this;t.clear(),o?.forEach(i=>this.setSelectionForPath(i,!0)),r?.forEach(i=>this.setSelectionForPath(i,!1)),this.defaultSelection=e.defaultSelection,this.xcache()}setSelectionForPath(e,t){this.isPathAvailable(e)&&this.selectionMap.set(e,t)}getState(){let e=[],t=[];return this.selectionMap.topDownEntries().forEach(([o,r])=>{r?e.push(o):t.push(o)}),{defaultSelection:this.defaultSelection,selectedPaths:e,deselectedPaths:t}}deselectAll(){if(this.hasFilteredOutLeavesInside([])){this.setVisibleLeafNodesSelection([],!1);return}this.update({defaultSelection:!1,selectedPaths:[],deselectedPaths:[]})}selectAll(){if(this.hasFilteredOutLeavesInside([])){this.setVisibleLeafNodesSelection([],!0);return}this.update({defaultSelection:!0,deselectedPaths:[],selectedPaths:[]})}enableStrictMode(){this.strictMode=!0}disableStrictMode(){this.strictMode=!1}isPathAvailable(e){if(!this.strictMode)return!0;let{treePaths:t}=this.config;return t.has(e)}isNodeSelected(e){return this.isPathSelected(e)}isSelfSelected(e){return this.selectionMap.get(e)??null}cacheIt(e,t){return this.cache.set(e,t),t}getSelectionStateForNode(e,t){let o=this.cache.get(e);if(o)return o;if(this.isLeafNode(e)!==!1){let d=this.isSelfSelected(e);if(d!==null)return this.cacheIt(e,{selected:d,selectedCount:d?1:0,deselectedCount:d?0:1,leafCount:1})}let r=this.getLeafNodesCount(e),i=this.isSelfSelected(e),{selectionMap:a}=this,l=a.getKeysOfFirstChildOnEachBranchStartingWith(e,{excludeSelf:!0}).sort(SI);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:o}=this;if(!e.length)return t;let r=[...e];do{let i=o.get(r);if(i!==void 0)return i;r.pop()}while(r.length);return t}setNodeSelection(e,t){if(!e.length)return;if(this.hasFilteredOutLeavesInside(e)){this.setVisibleLeafNodesSelection(e,t);return}if(this.xcache(),this.selectionMap.getKeysStartingWith(e).forEach(r=>{this.selectionMap.delete(r)}),!(e.length===1&&this.defaultSelection===t)){if(this.setSelectionForPath(e,t),e.length>1){let r=e.slice(0,-1);this.isNodeSelected(r)===t&&this.setNodeSelection(r,t)}}}selectNode(e){this.setNodeSelection(e,!0)}deselectNode(e){this.setNodeSelection(e,!1)}toggleNodeSelection(e){this.setNodeSelection(e,!this.isNodeSelected(e))}getSelectedCount(){return this.getSelectionCountFor([]).selectedCount}getDeselectedCount(){return this.getSelectionCountFor([]).deselectedCount}getSelectionCountFor(e=[]){let{selectedCount:t,deselectedCount:o}=this.getSelectionStateForNode(e);return{selectedCount:t,deselectedCount:o}}destroy(){this.config=void 0,this.xcache(),this.selectionMap.clear()}};function xo(n,e){return new et(n,Do(e))}function Do(n){return()=>{let e=typeof n=="function"?n():n,{treePaths:t,unfilteredTreePaths:o,multiRowSelectionTarget:r}=e;return r==="visible"?{treePaths:t,unfilteredTreePaths:o,multiRowSelectionTarget:r}:{treePaths:o??t,multiRowSelectionTarget:r}}}var Li=class{constructor(e){this.setNodeSelection=(e,t,o)=>{let{treeSelectionState:r,selectionMode:i}=this.getState();if(!this.isNodeSelectable(e)&&!o?.force)return;if(i==="single-row"){this.actions.treeSelection=t?e[e.length-1]:null;return}if(i!=="multi-row")throw"Selection mode is not multi-row or single-row";if(!(r instanceof et))throw"Invalid tree selection";let a=new et(r,Do(this.getState));a.setNodeSelection(e,t),this.getState().lastSelectionUpdatedNodePathRef.current={nodePath:e,selected:t},this.actions.treeSelection=a};this.getCallbackParam=e=>({dataSourceApi:this.dataSourceApi});this.getState=e.getState,this.actions=e.actions,this.dataSourceApi=e.dataSourceApi}getSelectedLeafNodePaths(e){let{treePaths:t}=this.getState(),o=e?.treeSelectionState||this.getState().treeSelectionState;return o?o.getSelectedLeafNodePaths(e?.rootNodePath,t):[]}getDeselectedLeafNodePaths(e){let{treePaths:t}=this.getState(),o=e?.treeSelectionState||this.getState().treeSelectionState;return o?o.getDeselectedLeafNodePaths(e?.rootNodePath,t):[]}getSelectedLeafRowInfos(e){let{treePaths:t}=this.getState(),o=e?.treeSelectionState||this.getState().treeSelectionState;if(!t||!o)return[];let r=e?.rootNodePath||[],i=[];return t.getLeafNodesStartingWith(r,a=>{if(o.isNodeSelected(a.keys)){let l=this.getRowInfoByPath(a.keys);l&&i.push(l)}},{excludeSelf:!0}),i}get allRowsSelected(){return this.getState().allRowsSelected}isNodeReadOnly(e){let t=this.getRowInfoByPath(e),o=this.getState().isNodeReadOnly;return t&&t.isTreeNode&&t.isParentNode&&o?o(t):!1}isNodeSelectable(e){let t=this.getRowInfoByPath(e),o=this.getState().isNodeSelectable;return t&&t.isTreeNode?o(t):!1}isNodeExpanded(e){let t=this.getState(),{isNodeExpanded:o,isNodeCollapsed:r,treeExpandState:i}=t,a=this.getRowInfoByPath(e);if(a){if(!a.isTreeNode||!a.isParentNode)return!1;if(r)return!o(a,i);if(o)return o(a,i)}return i.isNodeExpanded(e)}expandAll(){let e=new mt({defaultExpanded:!0,collapsedPaths:[]});this.getState().lastExpandStateInfoRef.current={state:"expanded",nodePath:null},this.actions.treeExpandState=e}collapseAll(){let e=new mt({defaultExpanded:!1,expandedPaths:[]});this.getState().lastExpandStateInfoRef.current={state:"collapsed",nodePath:null},this.actions.treeExpandState=e}expandNode(e,t){if(this.isNodeReadOnly(e)&&!t?.force)return;let o=this.getState(),r=new mt(o.treeExpandState);r.expandNode(e),this.getState().lastExpandStateInfoRef.current={state:"expanded",nodePath:e},this.actions.treeExpandState=r,o.onNodeExpand?.(e,this.getCallbackParam(e))}collapseNode(e,t){if(this.isNodeReadOnly(e)&&!t?.force)return;let o=this.getState(),r=new mt(o.treeExpandState);r.collapseNode(e),this.getState().lastExpandStateInfoRef.current={state:"collapsed",nodePath:e},this.actions.treeExpandState=r,o.onNodeCollapse?.(e,this.getCallbackParam(e))}toggleNode(e,t){let o=this.getState(),r=new mt(o.treeExpandState),i=!this.isNodeExpanded(e);this.isNodeReadOnly(e)&&!t?.force||(r.setNodeExpanded(e,i),this.getState().lastExpandStateInfoRef.current={state:i?"expanded":"collapsed",nodePath:e},this.actions.treeExpandState=r,i?o.onNodeExpand?.(e,this.getCallbackParam(e)):o.onNodeCollapse?.(e,this.getCallbackParam(e)))}getNodeDataByPath(e){if(!e.length)return null;let t=this.getRowInfoByPath(e);return t?t.data:null}getRowInfoByPath(e){let{pathToIndexMap:t}=this.getState(),o=t.get(e);return o!==void 0?vn(o,this.getState):null}selectAll(){let{treeSelectionState:e,selectionMode:t}=this.getState();if(t!=="multi-row")throw"Selection mode is not multi-row";if(!(e instanceof et))throw"Invalid node selection";let o=new et(e,Do(this.getState));o.selectAll(),this.getState().lastSelectionUpdatedNodePathRef.current=null,this.actions.treeSelection=o}deselectAll(){let{treeSelectionState:e,selectionMode:t}=this.getState();if(t!=="multi-row")throw"Selection mode is not multi-row";if(!(e instanceof et))throw"Invalid node selection";let o=new et(e,Do(this.getState));o.deselectAll(),this.getState().lastSelectionUpdatedNodePathRef.current=null,this.actions.treeSelection=o}isNodeSelected(e){let{treeSelectionState:t,treeSelection:o,selectionMode:r}=this.getState();if(r==="single-row"){let i=e[e.length-1];return Array.isArray(o)?treeSelection.join(",")===e.join(","):o===i}if(r!=="multi-row")throw"Selection mode is not multi-row or single-row";if(!(t instanceof 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)}};function cs(n){return n.map(Bt)}function Bt(n){if(_e().structuredClone)return _e().structuredClone(n);if(n===null||typeof n!="object")return n;if(Array.isArray(n))return cs(n);if(n instanceof Date)return new Date(n);if(n instanceof Set)return new Set(cs(Array.from(n)));if(n instanceof Map)return new Map(cs(Array.from(n)));let e={};for(let t in n)n.hasOwnProperty(t)&&(e[t]=Bt(n[t]));return e}function mr(n){return n}var ki="____not_loaded_yet____";function ds(n){return typeof n=="string"&&n.startsWith(ki)}var Yn=Object.seal({data:null,field:null});var Tt="____root____";function Pn(){return!1}function ps(n){if(!n||!Object.keys(n).length)return{};let e={};for(let t in n)if(n.hasOwnProperty(t)){let o=n[t].initialValue;e[t]=typeof o=="function"?o():o}return e}function zi(n,e,t,o,r){if(!(!t||!Object.keys(t).length)){for(let i in t)if(t.hasOwnProperty(i)){let a=t[i];if(typeof a.reducer!="function")continue;let l=o[i],s=a.getter?a.getter(n)??null:a.field?n[a.field]:null;o[i]=a.reducer(l,s,n,e,r)}}}function gf(n,e){let{marker:t,reducers:o={},pivot:r,groupBy:i,indexer:a,toPrimaryKey:l,cache:s,mappings:u}=n;t&&t.start();let c=new W;function d(S,y,C,b=0,I=[]){let T=!C.length||b===C.length-1,R=y[u?.values||"values"]||{};for(let v in R)if(R.hasOwnProperty(v)){let w=v;I.push(w),p.set(I,!0),S.set(I,{reducerResults:R[v][u?.totals||"totals"]||{},items:[]}),T||d(S,R[v],C,b+1,I),I.pop()}}let p=r?new W:void 0,f=[],m=ps(o),g=Bt(m);e.visitDepthFirst((S,y,C,b)=>{let[I,...T]=y,R=S.children,v=c.get(T);if(v&&(v.cache=S.cache,v.childrenLoading=S.childrenLoading,v.childrenAvailable=S.childrenAvailable,v.error=S.error),T.length==i.length&&i.length){if(v){v.items=R;for(let P=0,x=T.length;P<x;P++){let M=T.slice(0,P),D=c.get(M);D&&(D.items=D.items||[],D.items=D.items.concat(R))}R=a.indexArray(R,{toPrimaryKey:l,cache:s,nodesKey:void 0})}return b?.()}for(let w=0,P=R.length;w<P;w++){if(!R[w]){let E={items:[],reducerResults:{},cache:!1,childrenLoading:!1,childrenAvailable:!1,isTree:!1,isGroupBy:!0};c.set([...T,`${ki}${w}`],E);continue}let x=R[w].data,M=R[w].keys||[];if(M.length){let E=M[M.length-1];T.push(E)}let D={items:[],cache:!1,childrenLoading:!1,childrenAvailable:!1,commonData:x,totalChildrenCount:R[w].totalChildrenCount,totalChildrenCountUnfiltered:R[w].totalChildrenCountUnfiltered,reducerResults:R[w].aggregations||{},isTree:!1,isGroupBy:!0};if(c.set(T,D),r){let E=D.pivotDeepMap=new W,L=R[w].pivot;d(E,L,r,0,f)}M.length&&T.pop()}b?.()});let h={deepMap:c,groupParams:n,initialData:e,reducerResults:g};return r&&(h.topLevelPivotColumns=p,h.pivot=r),t&&t.end({details:[{name:"Group by fields",value:i.map(S=>S.field).join(", ")}]}),h}function mf(n,e,t,o,r,i,a,l,s,u=mr){let{items:c,reducerResults:d,pivotDeepMap:p}=n.get(e);if(c.push(o),a&&zi(o,r,a,d,e),i){for(let f=0,m=i.length;f<m;f++){let{field:g,valueGetter:h,toKey:S}=i[f],y=g?o[g]:null;h&&(Yn.data=o,Yn.field=g,y=h(Yn));let C=(S||u)(y,o);t.push(C),p.has(t)||(l.set(t,!0),p?.set(t,{reducerResults:Bt(s),items:[]}));let{reducerResults:b,items:I}=p.get(t);I.push(o),a&&zi(o,r,a,b,e)}t.length=0}}function hf(n,e,t,o,r,i,a,l){let{isLeafNode:s,getNodeChildren:u,toKey:c}=n,d=c(r),p=[...o,d],f=s(r);if(t.set(p,!0),f){for(let S=0,y=o.length;S<=y;S++){let C=o.slice(0,S),b=e.get(C),{reducerResults:I,items:T}=b;T.push(r),b.leavesAvailableCount++,b.totalLeafNodesCount++,a&&zi(r,i,a,I,C)}return}let m=Bt(l),g=[];e.set(p,{items:g,isTree:!0,isGroupBy:!1,node:r,reducerResults:m,cache:!1,childrenLoading:!1,childrenAvailable:!0,totalLeafNodesCount:0,leavesAvailableCount:0,treeNesting:o.length});let h=u(r);if(!(!h||!Array.isArray(h))){for(let S=0,y=h.length;S<y;S++){let C=h[S];hf(n,e,t,p,C,S,a,l)}a&&gr(a,m,g)}}function fs(n,e){let{reducers:t,marker:o}=n;if(o){let u=Object.keys(t??{});o.start({details:u.length>0?[{name:"Reducers",value:u.join(", ")}]:void 0})}let r=ps(t),i=Bt(r),a=new W,l=new W;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++)hf(n,a,l,[],e[u],u,t,r);t&&gr(t,i,e);let s={deepMap:a,treeParams:n,treePaths:l,initialData:e,reducerResults:i};return o&&o.end(),s}function ms(n,e){let{marker:t,groupBy:o,defaultToKey:r=mr,pivot:i,reducers:a}=n;t&&t.start();let l=o.length,s=i?new W:void 0,u=new W,c=[],d=[],p=ps(a),f=Bt(p);if(!l){let g={items:[],isTree:!1,isGroupBy:!0,cache:!1,childrenLoading:!1,childrenAvailable:!1,reducerResults:Bt(p)};i&&(g.pivotDeepMap=new W),u.set(c,g)}for(let g=0,h=e.length;g<h;g++){let S=e[g],y={};for(let C=0;C<l;C++){let{field:b,groupField:I,valueGetter:T,toKey:R}=o[C],v=b?S[b]:null;T&&(Yn.data=S,Yn.field=b,v=T(Yn));let w=(R||r)(v,S);if(y[b||I]=w,c.push(w),!u.has(c)){let P={items:[],isTree:!1,isGroupBy:!0,cache:!1,commonData:{...y},childrenLoading:!1,childrenAvailable:!1,reducerResults:Bt(p)};i&&(P.pivotDeepMap=new W),u.set(c,P)}mf(u,c,d,S,g,i,a,s,p,r)}l||mf(u,c,d,S,g,i,a,s,p,r),a&&zi(S,g,a,f,c),c.length=0}a&&(u.visitDepthFirst((g,h,S,y)=>{gr(a,g.reducerResults,g.items),i&&g.pivotDeepMap.visitDepthFirst(({items:C,reducerResults:b},I,T,R)=>{gr(a,b,C),R?.()}),y?.()}),gr(a,f,e));let m={deepMap:u,groupParams:n,initialData:e,reducerResults:f};return i&&(m.topLevelPivotColumns=s,m.pivot=i),t&&t.end({details:[{name:"Group by fields",value:o.map(g=>g.field).join(", ")}]}),m}function bI(n){let{groupParams:e,deepMap:t}=n,o=e.groupBy.length,r=[];return t.topDownKeys().reduce((i,a)=>{if(a.length===o){let l=t.get(a).items;i.push(...l)}return i},r),r}function TI(n,e){let{groupBy:t,groupKeys:o,parents:r,reducers:i,lazyLoad:a}=n,l=o.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 y in i)if(i.hasOwnProperty(y)){let b=i[y].field;b&&(f[b]=u[y]),b&&p[b]==null&&(p[b]=u[y])}}let m=!0,g=o[o.length-1],h=g;if(p!=null){let y=t[o.length-1];y&&y.field&&(h=p[y.field]),y&&y.toKey&&(h=y.toKey(h,p)),h=h??g}return typeof h=="string"&&h.startsWith(ki)&&(m=!1,h=null),{data:p,reducerData:f,groupCount:s.length,groupData:s,groupKeys:o,isTreeNode:!1,rowSelected:!1,selectedChildredCount:0,deselectedChildredCount:0,id:`${o}`,collapsed:!1,dataSourceHasGrouping:!0,rowDisabled:!1,isCellSelected:Pn,hasSelectedCells:Pn,selfLoaded:m,error:n.error,parents:r,deepRowInfoArray:[],collapsedChildrenCount:0,collapsedGroupsCount:0,totalChildrenCount:n.totalChildrenCount,childrenAvailable:a?n.childrenAvailable:!0,childrenLoading:n.childrenLoading,indexInParentGroups:n.indexInParentGroups,indexInGroup:n.indexInGroup,indexInAll:n.indexInAll,directChildrenCount:n.directChildrenCount,directChildrenLoadedCount:a?n.directChildrenLoadedCount:n.directChildrenCount,value:h,rootGroupBy:t,groupBy:l===t.length?t:t.slice(0,l),isGroupRow:!0,pivotValuesMap:c,groupNesting:l,reducerResults:u}}function Vi(n,e,t){return{...n,id:`duplicate_row_on_page_${t}_for__${n.id}`,indexInAll:e,duplicateOf:n.id}}function gr(n,e,t){if(n){for(let o in n)if(n.hasOwnProperty(o)){let r=n[o];r.done&&(e[o]=r.done(e[o],t))}}return e}function yf(n,e,t,o,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:h,rowsPerPage:S}=r,{deepMap:y}=c,C=n.length,b=t[t.length-1],I=b?b.nodeExpanded:!0;for(let T=0;T<C;T++){let R=n[T],v=u(R,T),w=[...e,v];if(l(R)){let V={id:v,nodePath:w,isGroupRow:!1,data:R,treeNesting:a,totalLeafNodesCount:0,collapsedLeafNodesCount:0,isTreeNode:!0,isParentNode:!1,selfLoaded:!0,rowSelected:!1,rowDisabled:!1,isCellSelected:Pn,hasSelectedCells:Pn,dataSourceHasGrouping:!1,parentNodes:Array.from(t),indexInParentNodes:[...o,T],indexInParent:T,indexInAll:I?i.length:-1};p&&(V.rowSelected=p(V)),d&&(V.rowDisabled=d(V)),f&&f(V);let N=h&&S!=null&&S>0&&V.indexInAll%S===0?V.indexInAll/S:null;for(let k=0,F=t.length;k<F;k++){let B=t[k];if(I||(B.collapsedLeafNodesCount+=1),B.deepRowInfoArray.push(V),N!=null&&I){if(typeof h=="function"&&h(B)!==!0)continue;let $=Vi(B,V.indexInAll,N);i[$.indexInAll]=$,V.indexInAll++}}I&&(i[V.indexInAll]=V);continue}let M=y.get(w)?.totalLeafNodesCount??0,D={dataSourceHasGrouping:!1,nodeExpanded:!1,selfExpanded:!1,nodePath:w,id:v,data:R,indexInAll:i.length,indexInParent:T,indexInParentNodes:[...o,T],totalLeafNodesCount:M,treeNesting:a,selfLoaded:!0,isParentNode:!0,isTreeNode:!0,isGroupRow:!1,deepRowInfoArray:[],parentNodes:Array.from(t),collapsedLeafNodesCount:0,rowSelected:!1,rowDisabled:!1,isCellSelected:Pn,hasSelectedCells:Pn,selectedLeafNodesCount:0,deselectedLeafNodesCount:0};if(p&&(D.rowSelected=p(D),g)){let V=g.getSelectionCountFor(D.nodePath);D.selectedLeafNodesCount=V.selectedCount,D.deselectedLeafNodesCount=V.deselectedCount}d&&(D.rowDisabled=d(D)),f&&f(D);let E=!0;if(m&&(D.selfExpanded=E=m(D)),I||(E=!1),D.nodeExpanded=E,I&&h&&S!=null&&S>0){let V=D.indexInAll,N=D.parentNodes;if(N.length>0&&V%S===0){let k=V/S,F=0;N.forEach(B=>{typeof h=="function"&&h(B)!==!0||(i.push(Vi(B,V+F,k)),F++,D.indexInAll++)})}}I&&(i[D.indexInAll]=D);let L=s(R);Array.isArray(L)&&yf(L,w,[...t,D],D.indexInParentNodes,r,i)}return i}function Sf(n){let{dataArray:e,marker:t}=n;t&&t.start();let o=[];return yf(e,[],[],[],n,o),t&&t.end(),{data:o}}function bf(n){let{marker:e,lazyLoad:t,groupResult:o,rowsPerPage:r,repeatWrappedGroupRows:i,withRowInfo:a,toPrimaryKey:l,groupRowsState:s,isRowDisabled:u,isRowSelected:c,rowSelectionState:d,generateGroupRows:p,reducers:f={}}=n,{groupParams:m,deepMap:g,pivot:h}=o,{groupBy:S}=m;e&&e.start({details:[{name:"Group by fields",value:S.map(T=>T.field).join(", ")}]});let y=[],C=[],b=[],I=[];return g.visitDepthFirst((T,R,v,w)=>{let P=T.items,x=R.length,M=s?.isGroupRowCollapsed(R)??!1;I.push(v);let D=TI({lazyLoad:t,groupBy:S,parents:Array.from(b),reducers:f,indexInGroup:v,indexInParentGroups:Array.from(I),indexInAll:y.length,groupKeys:R,error:T.error,totalChildrenCount:T.totalChildrenCount,childrenLoading:(T.childrenLoading||!M&&!T.childrenAvailable)&&t,childrenAvailable:T.childrenAvailable,directChildrenCount:R.length===S.length?T.items.length:g.getDirectChildrenSizeFor(R),directChildrenLoadedCount:0},T);if(c&&(D.rowSelected=c(D),d)){let k=d.getSelectionCountFor(D.groupKeys);D.selectedChildredCount=k.selectedCount,D.deselectedChildredCount=k.deselectedCount}u&&(D.rowDisabled=u(D));let E=b[b.length-1],L=E?.collapsed??!1;L&&(M=!0),D.collapsed=M;let V=p||M;if(L&&(V=!1),V){if(i&&r!=null&&r>0){let k=D.indexInAll,F=D.parents;if(F.length>0&&k%r===0){let B=k/r,$=0;F.forEach(_=>{typeof i=="function"&&i(_)!==!0||(y.push(Vi(_,k+$,B)),$++,D.indexInAll++)})}}y.push(D),C.push(y.length-1)}D.collapsedChildrenCount=0,b.forEach(k=>{k.deepRowInfoArray.push(D),k.collapsedGroupsCount+=M?1:0}),E&&D.selfLoaded&&t&&(E.directChildrenLoadedCount+=1),a&&a(D),b.push(D);let N=!0;if(N){if(w)w();else if(!h){let k=y.length;M||(y.length+=P.length);let F=0;for(let B=0,$=P.length;B<$;B++){let _=P[B];if(!M&&i&&r!=null&&r>0){let be=k+B+F;if(be%r===0){let se=be/r;b.forEach(pe=>{if(typeof i=="function"&&i(pe)!==!0)return;let Pe=k+B+F;y[Pe]=Vi(pe,Pe,se),F++,y.length++})}}let H=k+B+F,Z={id:_?l(_,H):`${R}-${B}`,data:_,isCellSelected:Pn,hasSelectedCells:Pn,dataSourceHasGrouping:!0,isTreeNode:!1,isGroupRow:!1,selfLoaded:!!_,rowSelected:!1,rowDisabled:!1,rootGroupBy:S,collapsed:M,groupKeys:R,parents:Array.from(b),indexInParentGroups:[...I,B],indexInGroup:B,indexInAll:H,groupBy:S,groupNesting:x+1,groupCount:D.groupCount};c&&(Z.rowSelected=c(Z)),u&&(Z.rowDisabled=u(Z)),a&&a(Z),b.forEach((be,se)=>{se===b.length-1&&_&&(be.directChildrenLoadedCount+=1),M&&(be.collapsedChildrenCount+=1),be.deepRowInfoArray.push(Z)}),M||(y[k+B+F]=Z)}}}b.pop(),I.pop()}),e&&e.end(),{data:y,groupRowsIndexes:C}}function Dn(n,e){return e.reduce((t,o)=>{let{field:r,valueGetter:i,toKey:a}=o,l=r?n[r]:i?.({data:n,field:r}),s=(a||mr)(l,n);return t.push(s),t},[])}var CI=new W,Tf=new WeakMap;function Gi(n){let{originalDataArray:e,groupBy:t,toPrimaryKey:o}=n;if(!e||!t.length)return CI;let r=Tf.get(e);if(r&&r.groupBy===t)return r.groups;let i=new W,a=t.length,l=[];return e.forEach(s=>{let u=Dn(s,t);l.length=0;for(let c=0;c<u.length;c++){l.push(u[c]);let d=i.get(l);d||(d={count:0},l.length===a&&(d.primaryKeys=[]),i.set(l,d)),d.count++,d.primaryKeys?.push(o(s))}}),Tf.set(e,{groupBy:t,groups:i}),i}function II(n,e){let t=[];return n.getLeafNodesStartingWith(e,o=>{let r=o.value?.primaryKeys;if(r)for(let i=0;i<r.length;i++)t.push(r[i])}),t}var Oe=class n{constructor(e,t,o){this.selectedRows=null;this.deselectedRows=null;this.defaultSelection=!1;this.selectedMap=new W;this.deselectedMap=new W;this.onlyUsePrimaryKeys=!1;this.selectionCache=new W;this.selectionCountCache=new W;this.lazyEntries=null;this.lazyLoadedRows=null;this.lazyChildrenLoaded=null;this.lazyRowCounts=null;this.mapSet=(e,t)=>{Array.isArray(t)||(this.onlyUsePrimaryKeys?t=[t]:t=[...this.getGroupKeysForPrimaryKey(t),t]),this.xcache(),e==="selected"?this.selectedMap.set(t,!0):this.deselectedMap.set(t,!0)};this._selectedMapSet=e=>{this.mapSet("selected",e)};this._deselectedMapSet=e=>{this.mapSet("deselected",e)};let r=e instanceof Object.getPrototypeOf(this).constructor?e.getState():e;this.getConfig=t,this.onlyUsePrimaryKeys=t().onlyUsePrimaryKeys,o&&Object.assign(this,o),this.update(r)}getGroupKeysForPrimaryKey(e){let{indexer:t,groupBy:o}=this.getConfig(),r=t.getDataForPrimaryKey(e);return r?Dn(r,o):[]}getGroupDeepMap(){return this.getConfig().groupDeepMap}targetsVisibleRowsOnly(){let{multiRowSelectionTarget:e,someRowsFilteredOut:t}=this.getConfig();return e==="visible"&&!!t}targetsFilteredOutRows(){let{multiRowSelectionTarget:e,someRowsFilteredOut:t}=this.getConfig();return e!=="visible"&&!!t}getVisibleDataInsideGroup(e){let{postFilterDataArray:t,groupDeepMap:o}=this.getConfig();return e.length?o?.get(e)?.items??[]:t??[]}hasFilteredOutRowsInsideGroup(e){let t=this.getConfig();return t.someRowsFilteredOut?(e.length?Gi(t).get(e)?.count??0:t.originalDataArray?.length??0)>this.getVisibleDataInsideGroup(e).length:!1}setVisibleRowsSelection(e,t){let{groupBy:o,toPrimaryKey:r}=this.getConfig(),i=t?this.selectedMap:this.deselectedMap,a=t?this.deselectedMap:this.selectedMap;this.xcache(),this.getVisibleDataInsideGroup(e).forEach(l=>{let s=Dn(l,o),u=r(l),c=[...s,u];a.delete(c),this.isRowSelected(u,s)!==t&&i.set(c,!0)}),this.xcache()}getLazyUnfilteredCount(e){let t=this.getConfig();if(!(!t.lazyLoad||t.multiRowSelectionTarget==="visible"))return e.length?t.groupDeepMap?.get(e)?.totalChildrenCountUnfiltered:t.lazyUnfilteredCount}getLazyHiddenRowsCount(e){let t=e.length<this.getGroupByLength()?this.getLazyUnfilteredCount(e):void 0;if(t===void 0)return 0;let{groupDeepMap:o}=this.getConfig(),r=0;return this.getGroupKeysDirectlyInsideGroup(e).forEach(i=>{r+=this.getLazyUnfilteredCount(i)??(o?.get(i)?.totalChildrenCount||0)}),Math.max(t-r,0)}getLazyEntries(){let e=`${this.selectedMap.version}:${this.deselectedMap.version}`;if(this.lazyEntries?.version!==e){let t=new W;this.selectedMap.getKeysStartingWith([]).forEach(o=>t.set(o,!0)),this.deselectedMap.getKeysStartingWith([]).forEach(o=>t.set(o,!1)),this.lazyEntries={version:e,entries:t}}return this.lazyEntries.entries}getLazyRowCount(e){this.lazyRowCounts=this.lazyRowCounts??new W;let t=this.lazyRowCounts.get(e);if(t!==void 0)return t??void 0;let o=this.computeLazyRowCount(e);return this.lazyRowCounts.set(e,o??null),o}computeLazyRowCount(e){let t=this.getConfig(),o=this.getGroupByLength(),r=this.getLazyUnfilteredCount(e);if(r!==void 0)return r;if(!e.length&&!o)return t.totalCount;let i=e.length?t.groupDeepMap?.get(e):void 0,a=e.length?i?.totalChildrenCount:t.lazyGroupedRowCount;if(a!=null)return a;if(e.length===o)return i?.childrenAvailable?i.items.length:void 0;let l=t.groupDeepMap?.getKeysStartingWith(e,{excludeSelf:!0,depthLimit:1})??[];if(l.length)return l.reduce((s,u)=>s+(ds(u[u.length-1])?1:this.getLazyRowCount(u)??1),0)}areLazyChildrenLoaded(e){this.lazyChildrenLoaded=this.lazyChildrenLoaded??new W;let t=this.lazyChildrenLoaded.get(e);if(t!==void 0)return t;let o=this.computeLazyChildrenLoaded(e);return this.lazyChildrenLoaded.set(e,o),o}computeLazyChildrenLoaded(e){let{groupDeepMap:t}=this.getConfig(),o=e.length?t?.get(e):void 0;return e.length&&!o?.childrenAvailable?!1:e.length===this.getGroupByLength()?this.getLazyLoadedRows(e).complete:(t?.getKeysStartingWith(e,{excludeSelf:!0,depthLimit:1})??[]).every(r=>!ds(r[r.length-1]))}getLazyLoadedRows(e){this.lazyLoadedRows=this.lazyLoadedRows??new W;let t=this.lazyLoadedRows.get(e);if(!t){let{groupDeepMap:o,originalDataArray:r,toPrimaryKey:i,totalCount:a}=this.getConfig(),l=e.length?o?.get(e):void 0,s=l?l.items:r??[],u=l?l.totalChildrenCount:a,c=new Set,d=u==null||s.length>=u;for(let p=0;p<s.length;p++){let f=s[p];f==null?d=!1:c.add(i(f))}t={primaryKeys:c,complete:d},this.lazyLoadedRows.set(e,t)}return t}isLazyEntryFilteredOut(e){let{groupDeepMap:t}=this.getConfig(),o=this.getGroupByLength();for(let r=1;r<=e.length;r++){let i=e.slice(0,r-1);if(!(r>o?this.getLazyLoadedRows(i).primaryKeys.has(e[r-1]):!!t?.get(e.slice(0,r))))return this.areLazyChildrenLoaded(i)}return!1}getLazySelectionCountFor(e,t){let o=this.selectionCountCache.get(e);if(o!=null)return o;let r=this.getLazyEntries(),i=this.getGroupByLength()+1,a=this.getLazyUnfilteredCount([])!==void 0,l=0,s=0;r.getKeysOfFirstChildOnEachBranchStartingWith(e,{excludeSelf:!0,respectOrder:!1}).forEach(p=>{if(!a&&this.isLazyEntryFilteredOut(p))return;let f=r.get(p);if(p.length>=i){f?l++:s++;return}let m=this.getLazySelectionCountFor(p,f);l+=m.selectedCount,s+=m.deselectedCount});let u=this.getLazyRowCount(e),c=u===void 0?1:Math.max(u-l-s,0);t?l+=c:s+=c;let d={selectedCount:l,deselectedCount:s};return this.selectionCountCache.set(e,d),d}getGroupCount(e){if(e.length==0)return this.getLazyUnfilteredCount([])??this.getConfig().totalCount;if(this.targetsFilteredOutRows())return Gi(this.getConfig()).get(e)?.count??0;let o=this.getGroupDeepMap()?.get(e);return o?this.getLazyUnfilteredCount(e)??o.totalChildrenCount??(o.items.length||0):0}getGroupKeysDirectlyInsideGroup(e){let t=this.getConfig(),o={excludeSelf:!0,depthLimit:1};return this.targetsFilteredOutRows()?Gi(t).getKeysStartingWith(e,o):t.groupDeepMap?.getKeysStartingWith(e,o)||[]}getAllPrimaryKeysInsideGroup(e){let t=this.getConfig(),{groupDeepMap:o,toPrimaryKey:r}=t;if(this.targetsFilteredOutRows())return e.length?II(Gi(t),e):(t.originalDataArray??[]).map(r);if(!t.groupBy.length)return this.getVisibleDataInsideGroup([]).map(r);if(!e.length)return(o?.getKeysStartingWith([],{excludeSelf:!0,depthLimit:1})||[]).map(l=>this.getAllPrimaryKeysInsideGroup(l)).flat();let i=o?.get(e);return i?i.items.map(this.getConfig().toPrimaryKey):[]}getGroupByLength(){return this.getConfig().groupBy.length}static from(e,t,o){return new n(e,t,o)}update(e){this.selectedRows=e.selectedRows||null,this.deselectedRows=e.deselectedRows||null,this.selectedMap.clear(),this.deselectedMap.clear(),this.selectedRows?.forEach(this._selectedMapSet),this.deselectedRows?.forEach(this._deselectedMapSet),this.defaultSelection=e.defaultSelection,this.xcache()}xcache(){this.selectionCache.clear(),this.selectionCountCache.clear(),this.lazyLoadedRows=null,this.lazyChildrenLoaded=null,this.lazyRowCounts=null}getState(){let e=r=>{let i=this.getGroupByLength();return r.map(a=>this.onlyUsePrimaryKeys||i===0&&a.length===1?a[0]:a)},t=e(this.selectedMap.topDownKeys()),o=e(this.deselectedMap.topDownKeys());return{defaultSelection:this.defaultSelection,selectedRows:t,deselectedRows:o}}deselectAll(){if(this.targetsVisibleRowsOnly()){this.onlyUsePrimaryKeys?this.deselectGroupRow([]):this.setVisibleRowsSelection([],!1);return}this.update({defaultSelection:!1,selectedRows:[],deselectedRows:[]})}selectAll(){if(this.targetsVisibleRowsOnly()){this.onlyUsePrimaryKeys?this.selectGroupRow([]):this.setVisibleRowsSelection([],!0);return}this.update({defaultSelection:!0,deselectedRows:[],selectedRows:[]})}isRowDefaultSelected(){return this.defaultSelection===!0}isRowDefaultDeselected(){return this.defaultSelection===!1}isRowSelected(e,t){if(this.onlyUsePrimaryKeys)return this.defaultSelection?!this.deselectedMap.has([e]):this.selectedMap.has([e]);t=t||this.getGroupKeysForPrimaryKey(e);let o=[...t,e],r=this.selectionCache.get(o);if(r!==void 0)return r;let i=this.selectedMap.has(o),a=this.deselectedMap.has(o);if(i)return this.selectionCache.set(o,!0),!0;if(a)return this.selectionCache.set(o,!1),!1;if(this.selectedMap.has(t))return this.selectionCache.set(o,!0),!0;if(this.deselectedMap.has(t))return this.selectionCache.set(o,!1),!1;for(t=[...t];t.length;){t.pop();let l=this.selectedMap.has(t),s=this.deselectedMap.has(t);if(l)return this.selectionCache.set(o,!0),!0;if(s)return this.selectionCache.set(o,!1),!1}return this.selectionCache.set(o,this.defaultSelection),this.defaultSelection}isRowDeselected(e,t){return!this.isRowSelected(e,t)}setRowSelected(e,t,o){t?this.setRowAsSelected(e,o):this.setRowAsDeselected(e,o)}getGroupRowSelectionState(e){let t=this.selectionCache.get(e);if(t!==void 0)return t;let{selectedCount:o,deselectedCount:r}=this.getSelectionCountFor(e,this.onlyUsePrimaryKeys?void 0:this.getGroupRowBooleanSelectionStateFromParent(e)),i=o&&r?null:!!o;return this.selectionCache.set(e,i),i}getGroupRowBooleanSelectionStateFromParent(e){if(!e.length)return this.defaultSelection;let t=[...e],o=this.deselectedMap.has(t),r=this.selectedMap.has(t),i=r&&!o?!0:o&&!r?!1:void 0;if(i===void 0)for(;t.length;){if(t.pop(),this.deselectedMap.has(t)){i=!1;break}if(this.selectedMap.has(t)){i=!0;break}}return i===void 0&&(i=this.defaultSelection),i}isGroupRowPartlySelected(e){return this.getGroupRowSelectionState(e)===null}isGroupRowSelected(e){return this.getGroupRowSelectionState(e)===!0}isGroupRowDeselected(e){return this.getGroupRowSelectionState(e)===!1}selectGroupRow(e){if(this.onlyUsePrimaryKeys){this.getAllPrimaryKeysInsideGroup(e).forEach(i=>{this.defaultSelection===!0?this.deselectedMap.delete([i]):this._selectedMapSet(i)}),this.xcache();return}if(this.targetsVisibleRowsOnly()&&this.hasFilteredOutRowsInsideGroup(e)){this.setVisibleRowsSelection(e,!0);return}this.selectedMap.getKeysStartingWith(e,{excludeSelf:!0}).forEach(r=>{this.selectedMap.delete(r)}),e.length===1&&this.defaultSelection===!0||this._selectedMapSet(e),this.deselectedMap.getKeysStartingWith(e).forEach(r=>{this.deselectedMap.delete(r)}),this.xcache()}deselectGroupRow(e){if(this.onlyUsePrimaryKeys){this.getAllPrimaryKeysInsideGroup(e).forEach(i=>{this.defaultSelection===!1?this.selectedMap.delete([i]):this._deselectedMapSet(i)}),this.xcache();return}if(this.targetsVisibleRowsOnly()&&this.hasFilteredOutRowsInsideGroup(e)){this.setVisibleRowsSelection(e,!1);return}this.deselectedMap.getKeysStartingWith(e,{excludeSelf:!0}).forEach(r=>{this.deselectedMap.delete(r)}),e.length===1&&this.defaultSelection===!1||this._deselectedMapSet(e),this.selectedMap.getKeysStartingWith(e).forEach(r=>{this.selectedMap.delete(r)}),this.xcache()}setRowAsSelected(e,t){if(this.onlyUsePrimaryKeys){this.defaultSelection?this.deselectedMap.delete([e]):this._selectedMapSet(e),this.xcache();return}t=t||this.getGroupKeysForPrimaryKey(e);let o=[...t,e];this.deselectedMap.delete(o),this.xcache(),this.getGroupRowSelectionState(t)!==!0&&(this._selectedMapSet(o),this.getGroupRowSelectionState(t)===!0&&this.selectGroupRow(t))}setRowAsDeselected(e,t){if(this.onlyUsePrimaryKeys){this.defaultSelection?this._deselectedMapSet(e):this.selectedMap.delete([e]),this.xcache();return}t=t||this.getGroupKeysForPrimaryKey(e);let o=[...t,e];this.selectedMap.delete(o),this.xcache(),this.getGroupRowSelectionState(t)!==!1&&(this._deselectedMapSet(o),this.getGroupRowSelectionState(t)===!1&&this.deselectGroupRow(t))}deselectRow(e,t){this.setRowSelected(e,!1,t)}selectRow(e,t){this.setRowSelected(e,!0,t)}toggleGroupRowSelection(e){this.getGroupRowSelectionState(e)===!0?this.deselectGroupRow(e):this.selectGroupRow(e)}toggleRowSelection(e,t){this.isRowSelected(e,t)?this.deselectRow(e,t):this.selectRow(e,t)}getSelectedCount(){return this.getSelectionCountFor([]).selectedCount}getDeselectedCount(){return this.getSelectionCountFor([]).deselectedCount}getSelectionCountFor(e=[],t){let o=this.selectionCountCache.get(e);if(o!=null)return o;let r=this.getGroupByLength();if(e.length>r){let u=this.isRowSelected(e)?{selectedCount:1,deselectedCount:0}:{selectedCount:0,deselectedCount:1};return this.selectionCountCache.set(e,u),u}if(this.getConfig().lazyLoad&&(!this.onlyUsePrimaryKeys||!r))return this.getLazySelectionCountFor(e,t??this.getGroupRowBooleanSelectionStateFromParent(e));if(this.onlyUsePrimaryKeys&&(r||this.targetsVisibleRowsOnly())){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}if(e.length===r&&this.targetsVisibleRowsOnly()){let{toPrimaryKey:u}=this.getConfig(),c=0,d=0;this.getVisibleDataInsideGroup(e).forEach(f=>{this.isRowSelected(u(f),e)?c++: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;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 Mo(n,e){return new Oe(n,ct(e))}function ct(n){return()=>{let e=typeof n=="function"?n():n,{originalDataArray:t,postFilterDataArray:o}=e,r=!!e.lazyLoad,i=r?e.originalLazyGroupData.get([Tt]):void 0;return{lazyLoad:r,toPrimaryKey:e.toPrimaryKey,onlyUsePrimaryKeys:!e.useGroupKeysForMultiRowSelection,groupBy:e.groupBy,groupDeepMap:e.groupDeepMap,indexer:e.indexer,totalCount:r?t?.length??0:e.unfilteredCount,lazyGroupedRowCount:e.groupBy.length?i?.totalChildrenCount:void 0,lazyUnfilteredCount:e.groupBy.length?i?.totalChildrenCountUnfiltered:i?.totalCountUnfiltered,multiRowSelectionTarget:e.multiRowSelectionTarget,someRowsFilteredOut:!e.lazyLoad&&!!t&&!!o&&o.length<t.length,originalDataArray:t,postFilterDataArray:o}}}function Cf(n){let{getDataSourceState:e,dataSourceActions:t}=n;return{get allRowsSelected(){return e().allRowsSelected},selectAll(){let{rowSelection:r,selectionMode:i}=e();if(i!=="multi-row")throw"Selection mode is not multi-row";if(!(r instanceof Oe))throw"Invalid row selection";let a=new Oe(r,ct(e));a.selectAll(),t.rowSelection=a},deselectAll(){let{rowSelection:r,selectionMode:i}=e();if(i!=="multi-row")throw"Selection mode is not multi-row";if(!(r instanceof Oe))throw"Invalid row selection";let a=new Oe(r,ct(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 Oe))throw"Invalid row selection";if(!i){let c=s.getDataForPrimaryKey(r);i=c?Dn(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 Oe))throw"Invalid row selection";if(!i){let d=s.getDataForPrimaryKey(r);i=d?Dn(d,u):[]}let c=new Oe(a,ct(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 Oe))throw"Invalid row selection";if(a==="multi-row"){if(!i){let d=s.getDataForPrimaryKey(r);i=d?Dn(d,u):[]}let c=new Oe(l,ct(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 Oe))throw"Invalid row selection";let s=new Oe(a,ct(e));s.selectGroupRow(r),t.rowSelection=s},deselectGroupRow(r){let{selectionMode:i,rowSelection:a,groupBy:l}=e();if(i!=="multi-row")throw'Selection mode should be "multi-row"';if(!l)throw"No grouping specified";if(!(a instanceof Oe))throw"Invalid row selection";let s=new Oe(a,ct(e));s.deselectGroupRow(r),t.rowSelection=s},toggleGroupRowSelection(r){let{selectionMode:i,rowSelection:a,groupBy:l}=e();if(i!=="multi-row")throw'Selection mode should be "multi-row"';if(!l)throw"No grouping specified";if(!(a instanceof Oe))throw"Invalid row selection";let s=new Oe(a,ct(e));s.toggleGroupRowSelection(r),t.rowSelection=s},getGroupRowSelectionState(r,i){let a=e(),{selectionMode:l,groupBy:s}=a,u=i?new Oe(i,ct(a)):a.rowSelection;if(l!=="multi-row")throw'Selection mode should be "multi-row"';if(!s)throw"No grouping specified";if(!(u instanceof Oe))throw"Invalid row selection";return u.getGroupRowSelectionState(r)},getSelectedPrimaryKeys:r=>{let i=e(),a=r?new Oe(r,ct(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}}}function If(n,e){Hi(n,e),wI(n,e),e.detail===2&&RI(n,e),n.getState().onCellClick?.(n,e)}function RI(n,e){if(fr(e.target))return;let{onCellDoubleClick:t}=n.getState(),o={preventEdit:!1};if(t){let a=t(n,e);a&&typeof a=="object"&&(o={...o,...a})}if(o.preventEdit)return;let i=n.getComputed().computedVisibleColumns[n.colIndex];n.api.startEdit({rowIndex:n.rowIndex,columnId:i.id})}function wI(n,e){let{getDataSourceState:t,getState:o,getComputed:r,rowIndex:i,colIndex:a,dataSourceActions:l}=n,s=t(),{selectionMode:u,cellSelection:c}=s;if(!c||u!=="multi-cell")return;let{multiCellSelector:d,computedVisibleColumns:p}=r(),{brain:f,debugId:m}=o(),{rowsPerPage:g}=f,h=p.length,S=new Ue(c);S.debugId=m??"",d.cellSelectionState=S;let y={rowIndex:i,colIndex:a};if(e.metaKey||e.ctrlKey)d.singleAddClick(y);else if(e.shiftKey){let C=!!o().wrapRowsHorizontally;d.multiSelectClick(y,C?{horizontalLayout:C,rowsPerPage:g,columnsPerSet:h}:{horizontalLayout:C})}else d.resetClick(y);l.cellSelection=S}function vI(n){return n.getState().multiRowSelectionWith!=="click"&&n.getComputed().renderSelectionCheckBox?"checkbox":"click"}function PI(n){return n?fr(n)?!0:typeof n.closest!="function"?!1:!!n.closest(`.${Po}, [data-name="expand-collapse-icon"]`):!1}function Hi(n,e,t=e.key?"keyboard":"click"){let{rowIndex:o,getDataSourceState:r,getComputed:i,dataSourceActions:a,dataSourceApi:l,api:s,cloneRowSelection:u,cloneTreeSelection:c}=n,{multiRowSelector:d}=i(),p=r(),{selectionMode:f,dataArray:m,isTree:g}=p;if(t==="click"&&PI(e.target))return!1;let h=m[o];if(!h||h.rowDisabled)return!1;if(g){if(!h.isTreeNode||!h.nodePath)return!1;let{isNodeSelectable:S}=p;if(S&&!S(h))return!1}if(f==="multi-row"){let S=vI(n);if(t==="click"&&S==="checkbox")return!1;let y=t==="checkbox"||t==="keyboard"&&S==="checkbox",C=()=>{e.shiftKey?d.multiSelectClick(o):y||e.metaKey||e.ctrlKey?d.singleAddClick(o):d.resetClick(o)};if(g){let{treeSelectionState:I}=p;if(!(I instanceof et))return!1;let T=c(I);d.treeSelectionState=T,C(),d.treeSelectionState=void 0;let R=!e.shiftKey&&(y||e.metaKey||e.ctrlKey);return p.lastSelectionUpdatedNodePathRef&&(p.lastSelectionUpdatedNodePathRef.current=R?{nodePath:h.nodePath,selected:!!T.isNodeSelected(h.nodePath)}:null),a.treeSelection=T,!0}let{rowSelection:b}=p;return!b||typeof b!="object"?!1:(b=u(b),d.rowSelectionState=b,C(),a.rowSelection=b,!0)}else if(f==="single-row"){if(h.isGroupRow)return!1;let S=e.metaKey||e.ctrlKey||t!=="click";if(g){let{treeApi:C}=l;return S?C.toggleNodeSelection(h.nodePath):C.selectNode(h.nodePath),!0}let y=h.id;return S?s.rowSelectionApi.toggleRowSelection(y):s.rowSelectionApi.selectRow(y),!0}return!1}function Rf(n,e){let{getComputed:t,dataSourceActions:o,dataSourceApi:r}=n,i=t().multiRowSelector,a=i.lastPointerDown;i.lastPointerDown=void 0;let l=n.getDataSourceState;return Hi({rowIndex:e,api:n,getComputed:t,getState:n.getState,getDataSourceState:l,dataSourceActions:o,dataSourceApi:r,cloneRowSelection:s=>Mo(s,l),cloneTreeSelection:s=>xo(s,l)},{key:"",metaKey:!1,ctrlKey:!1,shiftKey:a?.rowIndex===e&&a.shiftKey,preventDefault:()=>{}},"checkbox")}import*as hr from"react";import{useState as DI}from"react";var wf="_96uiwi0 _16lm1iw1d _16lm1iwk _16lm1iw9",vf=me({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 Pf="M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z",JF=Object.keys({size:1,expanded:1,defaultExpanded:1,onChange:1,style:1,disabled:1,className:1,direction:1});var Ki=`${lt}-expand-collapse`;function qn(n){let{size:e=24,direction:t="start",disabled:o=!1}=n,[r,i]=DI(n.expanded??n.defaultExpanded),a=()=>{n.onChange?.(!r),Sn("expanded",n)||i(!r)};hr.useEffect(()=>{Sn("expanded",n)&&i(n.expanded)},[n.expanded]);let l=r?"expanded":"collapsed";return hr.createElement("svg",{"data-name":"expand-collapse-icon","data-state":l,"data-disabled":o,xmlns:"http://www.w3.org/2000/svg",height:`${e}px`,viewBox:"0 0 24 24",width:`${e}px`,style:n.style,onClick:o?void 0:a,className:U(n.className,wf,go.expandCollapse,vf({direction:t||"start",expanded:r,disabled:o}),`${lt}`,`${Ki}`,`${Ki}--${l}`,`${Ki}--${t==="end"?"end":"start"}`,o?`${Ki}--disabled`:"")},hr.createElement("path",{d:Pf}))}function Df(n){return typeof n.field=="string"}function xf(n){let{column:e,rowInfo:t,fieldsToColumn:o}=n,r;if(e.groupByForColumn){if(t.isGroupRow){let i=t.groupBy[t.groupBy.length-1];(Array.isArray(e.groupByForColumn)||e.groupByForColumn===i)&&(r=i?o.get(i.field||i.groupField):void 0)}!r&&e.field&&(r=o.get(e.field))}return r}function Wt(n){let{getComputed:e,getDataSourceState:t,getState:o,rowIndex:r,columnId:i,api:a,dataSourceApi:l}=n,{dataArray:s}=t(),u=s[r],{isGroupRow:c,isTreeNode:d}=u,p=e().computedColumnsMap.get(i),{activeRowIndex:f,keyboardNavigation:m,isRowDetailEnabled:g}=o(),h=r===f&&m==="row",S=!g||typeof g=="function"&&!g(u)?!1:a.rowDetailApi.isRowDetailExpanded(u.id)?"expanded":"collapsed",{formattedValue:y,formattedValueContext:{rawValue:C}}=Eo({column:p,rowInfo:u,rowDetailState:S,columnsMap:e().computedColumnsMap,context:n}),b=ft(p.id,n);return c?{api:a,dataSourceApi:l,column:p,columnApi:b,isParentNode:!1,isGroupRow:!0,isTreeNode:!1,nodeExpanded:!1,rowDetailState:!1,data:u.data,rowActive:h,rowInfo:u,rowSelected:u.rowSelected,value:y,rawValue:C}:d?u.isParentNode?{api:a,dataSourceApi:l,columnApi:b,column:p,nodeExpanded:u.nodeExpanded,isTreeNode:!0,isGroupRow:!1,isParentNode:!0,rowDetailState:S,data:u.data,rowActive:h,rowInfo:u,rowSelected:u.rowSelected,value:y,rawValue:C}:{api:a,dataSourceApi:l,columnApi:b,column:p,nodeExpanded:!1,isTreeNode:!0,isGroupRow:!1,isParentNode:!1,rowDetailState:S,data:u.data,rowActive:h,rowInfo:u,rowSelected:u.rowSelected,value:y,rawValue:C}:{api:a,dataSourceApi:l,columnApi:b,column:p,isTreeNode:!1,isParentNode:!1,isGroupRow:!1,nodeExpanded:!1,rowDetailState:S,data:u.data,rowActive:h,rowInfo:u,rowSelected:u.rowSelected,value:y,rawValue:C}}function Mf(n){return Af(n.column,n.rowInfo)}function Ef(n){let{column:e,context:t,rowInfo:o,visibleColumnIds:r}=n,i=xf({rowInfo:o,column:e,fieldsToColumn:n.fieldsToColumn,groupRenderStrategy:t.getState().groupRenderStrategy}),{getState:a}=t,{editingCell:l}=a(),s=Eo(n),{formattedValueContext:u}=s,c=t.api.isEditorVisibleForCell({columnId:e.id,rowIndex:o.indexInAll}),d=Object.assign({rowIndexInHorizontalLayoutPage:n.rowIndexInHorizontalLayoutPage,horizontalLayoutPageIndex:n.horizontalLayoutPageIndex,column:n.column,inEdit:c,rowHasSelectedCells:!1},u,{editError:l&&l.primaryKey===o.id&&l.columnId===e.id&&!l.active&&l.accepted instanceof Error?l.accepted:void 0});Object.defineProperty(d,"rowHasSelectedCells",{get(){return o.hasSelectedCells(r)}});let p=typeof e.align=="function"?e.align({isHeader:!1,...d}):e.align??"start",f=typeof e.verticalAlign=="function"?e.verticalAlign({isHeader:!1,...d}):e.verticalAlign??"center";return{inEdit: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:xI({rowIndexInHorizontalLayoutPage:n.rowIndexInHorizontalLayoutPage,horizontalLayoutPageIndex:n.horizontalLayoutPageIndex,column:n.column,rowInfo:n.rowInfo,visibleColumnIds:n.visibleColumnIds,columnsMap:n.columnsMap,fieldsToColumn:n.fieldsToColumn,context:n.context,align:p,verticalAlign:f,formattedValueContext:u}),groupByColumnReference:i}}function xI(n){let{column:e,context:t,rowInfo:o,align:r,verticalAlign:i,visibleColumnIds:a,columnsMap:l,fieldsToColumn:s,formattedValueContext:u}=n,{value:c}=u,{api:d,getDataSourceState:p,getState:f,dataSourceApi:m}=t,{editingCell:g}=f(),{indexInAll:h}=o,S=p(),{selectionMode:y,cellSelection:C}=S,b=xf({rowInfo:o,column:e,fieldsToColumn:s,groupRenderStrategy:t.getState().groupRenderStrategy}),I=d.toggleGroupRow,T=C?.isCellSelected(o.id,e.id)??!1,R={column:e,columnsMap:l,fieldsToColumn:s,align:r,verticalAlign:i,cellSelected:T,rowHasSelectedCells:!1,horizontalLayoutPageIndex:n.horizontalLayoutPageIndex,rowIndexInHorizontalLayoutPage:n.rowIndexInHorizontalLayoutPage,...u,editError:g&&g.primaryKey===o.id&&g.columnId===e.id&&!g.active&&g.accepted instanceof Error?g.accepted:void 0,groupByColumn:b,selectionMode:y,api:d,dataSourceApi:m,toggleCurrentRowDetails:()=>d.rowDetailApi.toggleRowDetail(o.id),toggleRowDetails:d.rowDetailApi.toggleRowDetail,expandRowDetails:d.rowDetailApi.expandRowDetail,collapseRowDetails:d.rowDetailApi.collapseRowDetail,toggleCurrentTreeNode:()=>{m.treeApi.toggleNode(o.nodePath)},toggleTreeNode:m.treeApi.toggleNode,expandTreeNode:m.treeApi.expandNode,collapseTreeNode:m.treeApi.collapseNode,selectTreeNode:m.treeApi.selectNode,deselectTreeNode:m.treeApi.deselectNode,toggleTreeNodeSelection:m.treeApi.toggleNodeSelection,toggleCurrentTreeNodeSelection:()=>{o.isTreeNode&&m.treeApi.toggleNodeSelection(o.nodePath)},selectRow:d.rowSelectionApi.selectRow,deselectRow:d.rowSelectionApi.deselectRow,toggleRowSelection:d.rowSelectionApi.toggleRowSelection,toggleGroupRowSelection:d.rowSelectionApi.toggleGroupRowSelection,selectCell:()=>{d.cellSelectionApi.selectCell({rowId:o.id,colId:e.id})},deselectCell:()=>{d.cellSelectionApi.deselectCell({rowId:o.id,colId:e.id})},renderBag:{all:null,value:typeof c=="boolean"?`${c}`:c,selectionCheckBox:null,groupIcon:null,treeIcon:null},selectCurrentRow:()=>{if(!o.isTreeNode)return d.rowSelectionApi.selectRow(o.id,o.dataSourceHasGrouping?o.groupKeys:void 0)},deselectCurrentRow:()=>{if(!o.isTreeNode)return d.rowSelectionApi.deselectRow(o.id,o.dataSourceHasGrouping?o.groupKeys:void 0)},rowIndex:h,toggleGroupRow:I,toggleCurrentGroupRow:()=>{o.isGroupRow&&I(o.groupKeys)},toggleCurrentRowSelection:()=>{if(!(o.isGroupRow||o.isTreeNode))return d.rowSelectionApi.toggleRowSelection(o.id)},toggleCurrentGroupRowSelection:()=>{if(o.isGroupRow)return d.rowSelectionApi.toggleGroupRowSelection(o.isGroupRow?o.groupKeys:[])},rootGroupBy:S.groupBy,pivotBy:S.pivotBy};return Object.defineProperty(R,"rowHasSelectedCells",{get(){return o.hasSelectedCells(a)}}),R}function MI(n,e){if(!n.isGroupRow)return;let t=n.groupData;if(!t.length)return;let o=t[0][e];for(let r=1,i=t.length;r<i;r++)if(t[r][e]!==o)return;return o}function Af(n,e){let{data:t,isGroupRow:o,dataSourceHasGrouping:r}=e,i=r?e.groupBy:void 0,a=o&&i&&n.groupByForColumn&&(Array.isArray(n.groupByForColumn)||n.groupByForColumn===i[i.length-1])?e.value:Df(n)?t?.[n.field]:null;return n.field&&e.isGroupRow&&e.reducerData&&e.reducerData[n.field]!=null&&(a=e.reducerData[n.field]),a===void 0&&e.isGroupRow&&n.groupByForColumn&&Df(n)&&(a=MI(e,n.field)),n.valueGetter&&!e.isGroupRow&&e.data&&(a=n.valueGetter({data:e.data,field:n.field})),a}function EI(n,e,t,o,r){let{rowSelected:i,indexInAll:a}=t,{activeRowIndex:l,keyboardNavigation:s}=o.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:n,rawValue:n,field:e.field}:t.isTreeNode?t.isParentNode?{rowInfo:t,isGroupRow:!1,isTreeNode:!0,isParentNode:!0,nodeExpanded:t.nodeExpanded,data:t.data,rowDetailState:r,rowSelected:i,rowActive:u,value:n,rawValue:n,field:e.field}:{rowInfo:t,isGroupRow:!1,isTreeNode:!0,isParentNode:!1,nodeExpanded:!1,data:t.data,rowDetailState:r,rowSelected:i,rowActive:u,value:n,rawValue:n,field:e.field}:{rowInfo:t,isGroupRow:!1,isTreeNode:!1,isParentNode:!1,nodeExpanded:!1,data:t.data,rowDetailState:r,rowSelected:i,rowActive:u,value:n,rawValue:n,field:e.field}}function Eo(n){let{column:e,rowInfo:t,context:o,rowDetailState:r}=n,i=Af(e,t),a=EI(i,e,t,o,r),l=e.valueFormatter?e.valueFormatter(a):i;return a.value=l,{formattedValue:l,formattedValueContext:a}}var _f=me({defaultClassName:"_7pupv01",variantClassNames:{align:{start:"_7pupv02",center:"_7pupv03",end:"_7pupv04"}},defaultVariants:{},compoundVariants:[]}),Of="_7pupv00",Ff=me({defaultClassName:"_7pupv05",variantClassNames:{align:{start:"_7pupv06",center:"_7pupv07",end:"_7pupv08"}},defaultVariants:{},compoundVariants:[]});var{rootClassName:Nf}=ke,Jt=`${Nf}Cell`,yr=`${Nf}Cell_content`;var{rootClassName:AI}=ke,jt=`${AI}ColumnCell`;var _I=Y(q.columnZIndexAtIndex),OI=Y(q.columnVisibilityAtIndex);function Lf({rowInfo:n,column:e}){let t=0;if(n.dataSourceHasGrouping)if(n.isGroupRow){let o=e?.groupByForColumn,r=n.groupBy[n.groupBy.length-1],i=!!n.pivotValuesMap,a=i&&!!e?.field&&!!o&&!Array.isArray(o)&&(o.field??o.groupField)!==(r?.field??r?.groupField),l=i&&Array.isArray(o)&&n.groupNesting===n.rootGroupBy.length;t=a||l?n.groupNesting:n.groupNesting-1}else t=n.groupNesting;return{[Y(de.components.Row.groupNesting)]:t}}function kf({rowInfo:n}){return{[Y(de.components.Row.groupNesting)]:n.isTreeNode?n.isParentNode?n.treeNesting:n.treeNesting+1:0}}function gs(n,e){return n?typeof n=="function"?n(e):n:void 0}function hs(n,e,t){return typeof e=="function"?{...n,...e(t)}:{...n,...e}}function zf(n){let{column:e,rowInfo:t,rowIndex:o,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:h,rowActive:S,rowDisabled:y,rowSelected:C,cellSelected:b,cellSelection:I,getData:T,computedVisibleColumns:R,visibleColumnIds:v,computedColumnOrder:w,columnReorderInPageIndex:P}=n,x=v??R.map(pe=>pe.id),M=w,D,E={...c,visibleColumnIds:x,allColumnIds:M,rowIndex:o,get rowHasSelectedCells(){return D===void 0&&(D=t.hasSelectedCells(x)),D}},L=!!(t.isTreeNode&&(e.renderTreeIcon||e.renderTreeIconForLeafNode||e.renderTreeIconForParentNode)),V=typeof f=="function"?f(E):f,N;d?.className&&(N=gs(d.className,u)),g&&(N=U(N,gs(g,u))),e.className&&(N=U(N,gs(e.className,u))),L&&(N=U(N,Ff({align:l})));let k;t.dataSourceHasGrouping&&e.groupByForColumn&&(k=Lf({rowInfo:t,column:e})),L&&(k=kf({rowInfo:t})),p&&(k=typeof p=="function"?{...k,...p(E)}:{...k,...p}),m&&(k=hs(k,m,u)),d?.style&&(k=hs(k,d.style,u)),e.style&&(k=hs(k,e.style,u)),k=k||{},k.height=r,k.zIndex=`var(${_I}-${e.computedVisibleIndex})`,k.visibility=`var(${OI}-${e.computedVisibleIndex}, visible)`;let F=i!=null?i%2===1:(t.indexInAll!=null?t.indexInAll:o)%2===1,B=h?F?"odd":"even":!1,$=!1,_=!1,H=!1,z=!1;if(I&&b){let pe=T(),Pe=pe[t.indexInAll-1],De=pe[t.indexInAll+1],ce=R[e.computedVisibleIndex+1],te=R[e.computedVisibleIndex-1];$=Pe?!I.isCellSelected(Pe.id,e.id):!0,e.computedPinned==="end"&&e.computedFirstInCategory?_=!0:_=te?!I.isCellSelected(t.id,te.id):!0,e.computedPinned==="start"&&e.computedLastInCategory?H=!0:H=ce?!I.isCellSelected(t.id,ce.id):!0,z=De?!I.isCellSelected(De.id,e.id):!0}let Z=I&&b?{top:$,left:_,right:H,bottom:z}:null,be=P!=null?a!==P:!1,se=U(Z?df(Z):"",Si(e,[jt,Jt],cf,{dragging:!1,insideDisabledDraggingPage:be,zebra:B,align:l,verticalAlign:s,rowDisabled:y,rowActive:S,cellSelected:b,rowSelected:C,treeNode:t.isTreeNode?t.isParentNode?"parent":"leaf":!1,firstRow:t.indexInAll===0,firstRowInHorizontalLayoutPage:i===0,groupRow:t.isGroupRow,groupCell:t.isGroupRow?!!e.groupByForColumn:!1,rowExpanded:t.isGroupRow?!t.collapsed:!1}),N,V);return{style:k,className:se,cellSelectionBorders:Z,zebra:B,columnIsTree:L}}import*as en from"react";var FI=Y(q.columnWidthAtIndex),NI=Y(q.columnReorderEffectDurationAtIndex);function LI(n){let{cssEllipsis:e=!0,virtualized:t=!0,skipColumnShifting:o=!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,...h}=n,S=typeof m=="function"?m():m,y={width:`var(${FI}-${i.computedVisibleIndex})`,transition:`transform var(${NI}-${i.computedVisibleIndex}, 0s)`,...h.style},C={...h,style:y,"data-column-id":i.id,"data-z-index":y.zIndex,className:U(h.className,Jt,uf),children:en.createElement(en.Fragment,null,d,en.createElement("div",{className:U(yr,e?Nt:$c.hidden,s),style:r},S),c)};u!=null&&(C["data-row-id"]=`${u}`);let b=p==="body"?i.components?.ColumnCell:i.components?.HeaderCell;return b?en.createElement(b,{...C,ref:a}):en.createElement("div",{...C,ref:a})}var Bi=en.memo(LI);import*as Xn from"react";import{useCallback as ys,useRef as Vf}from"react";function Gf(){let{initialValue:n,setValue:e,confirmEdit:t,cancelEdit:o,readOnly:r}=Ss(),i=Vf(null),a=Vf(!1),l=Xn.useCallback(c=>{i.current=c,c&&c.focus()},[]),s=ys(c=>{let{key:d}=c;d==="Enter"||d==="Tab"?t():d==="Escape"?(a.current=!0,o()):c.stopPropagation()},[]),u=ys(()=>{a.current||t()},[]);return Xn.createElement(Xn.Fragment,null,Xn.createElement("input",{readOnly:r,ref:l,onKeyDown:s,onBlur:u,className:U(Gc,Uc.none),type:"text",defaultValue:n,onChange:ys(c=>{e(c.target.value)},[])}))}function Hf(n,e){let t=[];for(let o in n)n.hasOwnProperty(o)&&!e.hasOwnProperty(o)&&t.push(n[o]);return t}var Sr=Ce.createContext(null),KI=n=>{let{toggleCurrentRowDetails:e,rowDetailState:t}=n;return Ce.createElement(qn,{style:{visibility:t===!1?"hidden":"visible"},expanded:t==="expanded",onChange:e})},BI={display:"inline-block",visibility:"visible"},bs=n=>{let{rowInfo:e,toggleCurrentTreeNode:t,nodeExpanded:o,api:r}=n,i=r.getDataSourceState().isNodeReadOnly;return Ce.createElement(qn,{disabled:e.isTreeNode&&e.isParentNode?i(e):!1,style:BI,expanded:o,onChange:t})},WI=n=>{let{rowInfo:e,rowIndex:t,column:o,api:r}=n;e.isGroupRow&&o.groupByForColumn;let{components:i}=r.getState(),a=r.getDataSourceState().isNodeSelectable,l=i?.CheckBox||wn;return Ce.createElement(l,{domProps:{className:Po},disabled:e.isTreeNode?!a(e):!1,onChange:()=>{Rf(r,t)},checked:e.rowSelected})};function jI(n){let{repaintCellsKey:e,column:t,rowIndex:o,rowInfoStore:r,getDataSourceState:i}=n,[,a]=GI(s=>s+1,0),l=lf(e)?e:void 0;zI(()=>{if(l)return sf(l,{column:t,rowIndex:o,rowInfoStore:r,getDataSourceState:i},a)},[l,t,o,r,i])}function UI(n){let{dataSourceStatePartialForCell:e,rowInfoStore:t,rowStyle:o,rowClassName:r,rowIndexInHorizontalLayoutPage:i,horizontalLayoutPageIndex:a,getData:l,visibleColumnIds:s,computedColumnOrder:u,cellStyle:c,cellClassName:d,repaintCellsKey:p,rowDetailState:f,width:m,column:g,onMouseLeave:h,onMouseEnter:S,onRowMouseEnter:y,onRowMouseLeave:C,rowIndex:b,rowHeight:I,columnsMap:T,fieldsToColumn:R,domRef:v,hidden:w,showZebraRows:P,getDataSourceState:x,dataSourceApi:M,dataSourceActions:D,getState:E,imperativeApi:L,componentActions:V,getComputed:N,getDataSourceMasterContext:k}=n,F=HI(dt(re=>t.subscribeToRowIndex(b,re),[t,b]),dt(()=>t.getRowInfoAtIndex(b),[t,b]));jI({repaintCellsKey:p,column:g,rowIndex:b,rowInfoStore:t,getDataSourceState:x});let B=!F,$=!g,_=Ce.useRef(null),H=dt(re=>{_.current=re,v&&v(re)},[v]),z=F??{id:"",indexInAll:b,rowSelected:!1,rowDisabled:!1,isCellSelected:()=>!1,hasSelectedCells:()=>!1,isGroupRow:!1,isTreeNode:!1,isParentNode:!1,treeNesting:0,nodePath:[],collapsed:!1,dataSourceHasGrouping:!1,selfLoaded:!0,data:{}},{rowSelected:Z}=z,be=N(),{activeRowIndex:se,keyboardNavigation:pe,columnReorderInPageIndex:Pe}=E(),De=b===se&&pe==="row",ce={getState:E,getDataSourceState:x,getDataSourceMasterContext:k,actions:V,dataSourceActions:D,api:L,dataSourceApi:M},te=z.rowDisabled,le=Ef({horizontalLayoutPageIndex:a,rowIndexInHorizontalLayoutPage:i,column:g,rowInfo:z,rowDetailState:f,columnsMap:T,visibleColumnIds:s,fieldsToColumn:R,context:ce}),{stylingParam:ge,renderParams:j,formattedValueContext:ee,renderFunctions:K,groupByColumnReference:ie,inEdit:ne}=le,{align:oe,verticalAlign:O}=j,A=j,ue=Ce.useRef(A),Ie=y&&S?re=>{let it={...ee,rowIndex:b};y(it,re),S(re)}:S,ye=C&&h?re=>{let Ee={...ee,rowIndex:b,rowInfo:z};C(Ee,re),h(re)}:h,Se=dt(re=>{let Ee=g.computedVisibleIndex;E().cellClick({rowIndex:b,colIndex:Ee,event:re})},[b,g.computedVisibleIndex,pe]),xe=dt(re=>{let Ee=g.computedVisibleIndex;if(E().cellMouseDown({rowIndex:b,colIndex:Ee,event:re}),pe==="row"){te||(V.activeRowIndex=b);return}pe==="cell"&&(V.activeCellIndex=[b,Ee])},[b,te,g.computedVisibleIndex,pe]),{selectionMode:Ze,cellSelection:Qe,isNodeReadOnly:Ke}=e,ot=A.cellSelected;A.domRef=H,A.htmlElementRef=_,A.toggleCurrentTreeNode=dt(A.toggleCurrentTreeNode,[z]),A.selectCell=dt(A.selectCell,[z]),A.deselectCell=dt(A.deselectCell,[z]),A.selectCurrentRow=dt(A.selectCurrentRow,[z]),A.deselectCurrentRow=dt(A.deselectCurrentRow,[z]),A.toggleCurrentGroupRow=dt(A.toggleCurrentGroupRow,[z]),A.toggleCurrentRowSelection=dt(A.toggleCurrentRowSelection,[z]),A.toggleCurrentGroupRowSelection=dt(A.toggleCurrentGroupRowSelection,[z]),A.toggleCurrentTreeNodeSelection=dt(A.toggleCurrentTreeNodeSelection,[z]);let $e=g.components?.Editor??Gf,Ye=ne?Ce.createElement(Bf,{contextValue:A},Ce.createElement($e,null)):null,G=dt(pt(()=>{if(w||ne)return null;if(ue.current=A,K.renderGroupIcon&&(A.renderBag.groupIcon=Ce.createElement(Ct,{render:K.renderGroupIcon,renderParam:{...A,renderBag:{...A.renderBag}}})),K.renderSelectionCheckBox&&Ze=="multi-row"&&(A.renderBag.selectionCheckBox=Ce.createElement(Ct,{render:WI,renderParam:A}),K.renderSelectionCheckBox!==!0&&(A.renderBag.selectionCheckBox=Ce.createElement(Ct,{render:K.renderSelectionCheckBox,renderParam:{...A,renderBag:{...A.renderBag}}}))),z.isTreeNode){let{isParentNode:it}=z,ht;ht=(it?K.renderTreeIconForParentNode:K.renderTreeIconForLeafNode)||typeof K.renderTreeIcon=="function"?K.renderTreeIcon:it&&K.renderTreeIcon===!0?bs:void 0,ht===!0?ht=bs:ht&&(A.renderBag.treeIcon=Ce.createElement(Ct,{render:bs,renderParam:A})),ht&&(A.renderBag.treeIcon=Ce.createElement(Ct,{render:ht,renderParam:{...A,renderBag:{...A.renderBag}}}))}K.renderRowDetailIcon&&(A.renderBag.rowDetailsIcon=Ce.createElement(Ct,{render:KI,renderParam:{...A,renderBag:{...A.renderBag}}}),typeof K.renderRowDetailIcon=="function"&&(A.renderBag.rowDetailsIcon=Ce.createElement(Ct,{render:K.renderRowDetailIcon,renderParam:{...A,renderBag:{...A.renderBag}}}))),K.renderValue&&(A.renderBag.value=Ce.createElement(Ct,{render:K.renderValue,renderParam:{...A,renderBag:{...A.renderBag}}})),z.isGroupRow&&K.renderGroupValue&&(A.renderBag.value=Ce.createElement(Ct,{render:K.renderGroupValue,renderParam:{...A,renderBag:{...A.renderBag}}})),!z.isGroupRow&&K.renderLeafValue&&(A.renderBag.value=Ce.createElement(Ct,{render:K.renderLeafValue,renderParam:{...A,renderBag:{...A.renderBag}}})),ue.current=A;let re=A.renderBag.value;re instanceof Date&&(re=re.toLocaleDateString());let Ee=Ce.createElement(Ce.Fragment,null,oe!=="end"?A.renderBag.treeIcon:null,oe!=="end"?A.renderBag.groupIcon:null,oe!=="end"?A.renderBag.rowDetailsIcon:null,oe!=="end"?A.renderBag.selectionCheckBox:null,re,oe==="end"?A.renderBag.selectionCheckBox:null,oe==="end"?A.renderBag.rowDetailsIcon:null,oe==="end"?A.renderBag.groupIcon:null,oe==="end"?A.renderBag.treeIcon:null);return g.render?Ce.createElement(Ct,{render:g.render,renderParam:{...A,renderBag:{...A.renderBag,all:Ee}}}):Ee}),[g,w,ne,f,g.renderTreeIcon||g.renderTreeIconForParentNode?Ke:!1,...Hf(A,{renderBag:!0,selectCell:!0,deselectCell:!0,selectCurrentRow:!0,deselectCurrentRow:!0,toggleCurrentGroupRow:!0,toggleCurrentRowDetails:!0,toggleCurrentRowSelection:!0,toggleCurrentGroupRowSelection:!0,toggleCurrentTreeNodeSelection:!0,toggleCurrentTreeNode:!0,rowHasSelectedCells:!0})]),{style:Q,className:fe}=zf({column:g,rowInfo:z,rowIndex:b,rowHeight:I,rowIndexInHorizontalLayoutPage:i,horizontalLayoutPageIndex:a,align:oe,verticalAlign:O,stylingParam:ge,formattedValueContext:ee,groupByColumnReference:ie,rowStyle:o,rowClassName:r,cellStyle:c,cellClassName:d,showZebraRows:P,rowActive:De,rowDisabled:te,rowSelected:Z,cellSelected:ot,cellSelection:Qe,getData:l,visibleColumnIds:s,computedVisibleColumns:be.computedVisibleColumns,computedColumnOrder:u,columnReorderInPageIndex:Pe}),Te=VI(()=>Q,[Q?JSON.stringify(Q):null]),rt=Ye,ae=G(),je={domRef:H,cellType:"body",column:g,width:m,rowId:z.id,horizontalLayoutPageIndex:a,style:Te,onMouseLeave:ye,onMouseEnter:Ie,onClick:Se,afterChildren:rt,onMouseDown:xe,cssEllipsis:g.cssEllipsis??!0,className:fe,renderChildren:dt(()=>ae,[G])},X=Sr.Provider;return $||B?Ce.createElement("div",{ref:H,style:{display:"none"}}):Ce.createElement(X,{value:ue.current},Ce.createElement(Bi,{...je}))}var Kf=Ce.memo(UI);function Wi(){return kI(Sr)}function Ss(){let{api:n,editingValueRef:e,editingCell:t}=J(f=>({api:f.api,editingCell:f.state.editingCell,editingValueRef:f.state.editingValueRef})),{column:o,rowInfo:r}=Wi(),[i]=Ce.useState(()=>t?.value),[a,l]=Ce.useState(i),s=t?!t.active&&!!t.waiting:!1,u=Ce.useCallback(f=>{e.current=f,l(f)},[]);Ce.useLayoutEffect(()=>{e.current=i},[]);let c=n.confirmEdit,d=n.cancelEdit,p=n.rejectEdit;return{api:n,initialValue:i,value:a,readOnly:s,column:o,rowInfo:r,setValue:u,confirmEdit:c,cancelEdit:d,rejectEdit:p}}function br(n){return n.render(n.renderParam)??null}function Ct(n){let e=Sr.Provider;return Ao.createElement(e,{value:n.renderParam},Ao.createElement(br,{render:n.render,renderParam:n.renderParam}))}function Bf(n){let e=Sr.Provider;return Ao.createElement(e,{value:n.contextValue},n.children)}function xn(n){let e=ji.Provider;return Ao.createElement(e,{value:n.renderParam},Ao.createElement(br,{render:n.render,renderParam:n.renderParam}))}import*as Mn from"react";var Wf="yhvuzb1",jf="yhvuzb0";var Ts=si({"data-name":""}),Cs={[Ts["data-name"]]:"menu-icon"},Uf=`[${Ts["data-name"]}="${Cs["data-name"]}"]`;var $I={width:"100%",pointerEvents:"none"},Is=U(`${lt}-menu`,Wf);function Tr(n){let{style:e,className:t,domProps:o,reserveSpaceWhenHidden:r,menuVisible:i,children:a}=n,l={...$I,borderTop:`${de.components.HeaderCell.menuIconLineWidth} solid currentColor`,...n.lineStyle};return Mn.createElement("div",{...o,style:e,...Cs,onPointerDown:s=>s.stopPropagation(),className:U(t,Pd({menuVisible:i,reserveSpaceWhenHidden:r}),lt,`${lt}-menu`,a==null?jf:"")},a??Mn.createElement(Mn.Fragment,null,Mn.createElement("div",{className:Is,style:l}),Mn.createElement("div",{className:Is,style:l}),Mn.createElement("div",{className:Is,style:l})))}import*as _o from"react";import{useEffect as YI,useState as Zf}from"react";var $f="_1b8djff1 _16lm1iw1",Yf={asc:"_1b8djff2",desc:"_1b8djff3",none:"_1b8djff4"},Ui="_1b8djff5",qf="--_1b8djff0";var Xf={transition:"width 0.25s, opacity 0.25s"},ML=Object.keys({direction:1,size:1,lineWidth:1,lineStyle:1,style:1,className:1,index:1,forceSize:1});function $i(n){let[e,t]=Zf(!0),[o,r]=Zf(0),{direction:i,lineWidth:a=1,style:l,className:s,index:u}=n,c=u!=null&&u>0,d=n.size??16,p=Math.floor(d/4),f=i?[d-3*p,d-2*p,d-p]:[0,0,0];i===-1&&f.reverse();let m={...Xf,borderTop:`${a}px solid currentColor`,...n.lineStyle,opacity:o};YI(()=>{let y=i!=0?1:0;if(!e&&y&&t(!0),y!==o){let C=requestAnimationFrame(()=>{r(y)});return()=>{cancelAnimationFrame(C)}}return()=>{}},[i,e]);let g=()=>{let C=!(o===0&&i===0);C!==e&&t(C)};if(!e&&!n.forceSize)return null;let h=i===1?"asc":i===-1?"desc":"none",S={};return i===-1&&(S.top="100%"),_o.createElement("div",{"data-name":"sort-icon",style:{...l,width:d,[qf]:`${a}px`},className:U(s,lt,$f,Yf[h],`${lt}-sort`,`${lt}-sort--${h}`)},c?_o.createElement("div",{"data-name":"index",style:S,className:Md},u):null,_o.createElement("div",{className:Ui,style:{width:f[0],...m},onTransitionEnd:g}),_o.createElement("div",{className:Ui,style:{width:f[1],...m}}),_o.createElement("div",{className:Ui,style:{width:f[2],...m}}))}import*as rm from"react";import{useCallback as om}from"react";function Rs(n){return Math.max(n.width-Gt(),0)}function Qf(n){let{context:e,column:t,diff:o,shareSpaceOnResize:r}=n,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 zl({shareSpaceOnResize:r,availableSize:Rs(s),reservedWidth:l||0,dragHandleOffset:o,dragHandlePositionAfter:t.computedVisibleIndex,columnSizing:p,items:u.map(f=>({id:f.id,computedFlex:f.computedFlex,computedWidth:f.computedWidth,computedMinWidth:f.computedMinWidth,computedMaxWidth:f.computedMaxWidth}))})}import{useRef as tm,useState as qI}from"react";import*as Cr from"react";function Jf(n,{columns:e,shareSpaceOnResize:t,domRef:o}){let r=e[n];return{resize(i){Re.columnWidths.set(n,r.computedWidth+i,o.current);let a=n+1;if(t){let l=e[a];if(!l)return;Re.columnWidths.set(a,l.computedWidth-i,o.current),l.computedPinned==="start"?Yl(l,i,o.current):Re.columnOffsets.set(a,l.computedOffset+i,o.current);return}if(r.computedPinned!=="end"){if(r.computedPinned==="start"){for(let l=a,s=e.length;l<s;l++){let u=e[l];if(u.computedPinned==="start"){Yl(u,i,o.current);continue}u.computedPinned!=="end"&&Re.columnOffsets.set(l,u.computedOffset+i,o.current)}return}for(let l=a,s=e.length;l<s;l++){let u=e[l];u.computedPinned||Re.columnOffsets.set(l,u.computedOffset+i,o.current)}}}}}function em(n,e){let t=n[n.length-1];return{resize(o){let{columns:r,domRef:i}=e,a=r[n[0]],l=a.computedOffset,s=0,u=i.current;if(o.forEach((c,d)=>{s+=c;let p=n[d],f=r[p],m=f.computedWidth+c;Re.columnWidths.set(p,m,u),f.computedPinned!=="end"&&(l&&Re.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"&&Re.columnOffsets.set(c,d.computedOffset+s,u)}}}}var Yi="zneyzh0 _16lm1iw2 _16lm1iw23 _16lm1iw2c _16lm1iw2a _16lm1iwm _16lm1iw35",qi=me({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=me({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:XI}=ke,ZI=`${XI}HeaderCell_ResizeHandle`;function QI(n){let{brain:e,headerBrain:t}=J(g=>({brain:g.state.brain,headerBrain:g.state.headerBrain})),o=tm(null),[r,i]=qI(!1),a=tm(r);a.current=r;let l=n.columns[n.columnIndex],s=n.horizontalLayoutPageIndex;if(!l)return null;let u=l.computedPinned,c=l.computedFirstInCategory,d=l.computedLastInCategory,p=()=>{},f=g=>{g.stopPropagation();let h=!!g.shiftKey,S=g.pointerId,y=g.clientX,C=g.target;if(e.isHorizontalLayoutBrain){let v=e.extendRenderRange({start:!0,end:!0,direction:"horizontal"}),w=t.extendRenderRange({start:!0,end:!0,direction:"horizontal"});p=()=>{v(),w()}}C.setPointerCapture(S);let b=Jf(n.columnIndex,{columns:n.columns,shareSpaceOnResize:h,domRef:o}),I=(v,{done:w}={})=>{s&&(v=v/(s+1),w&&(v=Math.round(v))),u==="end"&&(v*=-1);let{adjustedDiff:P,constrained:x}=n.computeResize({diff:v,shareSpaceOnResize:h});return a.current!==x&&i(x),b.resize(P),P},T=v=>{I(Math.round(v.clientX-y))},R=v=>{C.releasePointerCapture(S),C.removeEventListener("pointermove",T),C.removeEventListener("pointerup",R);let w=Math.round(v.clientX-y),P=I(w,{done:!0});p(),b.resize(0),n.onResize({diff:P,shareSpaceOnResize:h})};C.addEventListener("pointermove",T),C.addEventListener("pointerup",R)},m=(u===!1||u==="start")&&d?{right:u==="start"?void 0:0}:u==="end"&&c?{right:void 0}:void 0;return Cr.createElement("div",{ref:o,className:`${ZI} ${Yi} ${Xi({computedPinned:u,computedFirstInCategory:c,computedLastInCategory:d})}`,onPointerDown:f},Cr.createElement("div",{style:m,className:qi({constrained:r,computedPinned:u,computedFirstInCategory:c,computedLastInCategory:d})}))}var nm=Cr.memo(QI);function im(n,e){let{computedVisibleColumns:t,getState:o,getComputed:r,actions:i}=J(u=>({computedVisibleColumns:u.computed.computedVisibleColumns,getState:u.getState,getComputed:u.getComputed,actions:u.actions})),a=om(({diff:u,shareSpaceOnResize:c})=>Qf({context:{getState:o,getComputed:r},column:n,diff:u,shareSpaceOnResize:c}),[n,o,r]),l=om(({diff:u,shareSpaceOnResize:c})=>{let{columnSizing:d,reservedWidth:p}=a({diff:u,shareSpaceOnResize:c});c||(i.viewportReservedWidth=p),i.columnSizing=d},[a,i]);return n.computedResizable?rm.createElement(nm,{horizontalLayoutPageIndex:e.horizontalLayoutPageIndex,columns:t,columnIndex:n.computedVisibleIndex,computeResize:a,onResize:l}):null}function JI(n,e){if(!n||!e)return null;let t=e.field||e.groupByForColumn,o=null,r=null;for(let i of n)(i.id===e.id||i.field===e.id)&&(o=i),t&&(i.id===t||i.field===t)&&(r=i);return o||r}function eR(n,e){return!n||!e?n===e:n.filter.type===e.filter.type&&n.filter.operator===e.filter.operator&&n.filter.value===e.filter.value&&!!n.disabled==!!e.disabled}var Zi=class{constructor(){this.pending=new Map;this.applied=new Map;this.cancelListeners=new Map}schedule(e,t,o){let r=o.getFilterValueItem();this.isLastApplied(e,r)&&this.applied.delete(e);let i=this.pending.get(e);i&&clearTimeout(i.timeout);let a=setTimeout(()=>{this.pending.delete(e);let l=o.getFilterValueItem();if(!eR(l,r)&&!this.isLastApplied(e,l)){this.applied.delete(e),this.notifyCancel(e);return}o.apply(t);let s=o.getFilterValueItem();s&&s.filter.value===t?this.applied.delete(e):this.applied.set(e,t)},o.delay);this.pending.set(e,{timeout:a,typedOver:r})}cancel(e){let t=this.pending.get(e);t&&(clearTimeout(t.timeout),this.pending.delete(e),this.notifyCancel(e))}onCancel(e,t){let o=this.cancelListeners.get(e);return o||(o=new Set,this.cancelListeners.set(e,o)),o.add(t),()=>{o.delete(t),!o.size&&this.cancelListeners.get(e)===o&&this.cancelListeners.delete(e)}}isLastApplied(e,t){return!!t&&this.applied.has(e)&&t.filter.value===this.applied.get(e)}notifyCancel(e){this.cancelListeners.get(e)?.forEach(t=>t())}};function am(n){let{columnId:e,filterDelay:t,api:o}=n,r=a=>{o.setColumnFilter(e,a)};if(!(t>0))return r;let i=()=>JI(n.getDataSourceState().filterValue,n.getComputed().computedColumnsMap.get(e));return a=>{n.getState().pendingColumnFilters.schedule(e,a,{delay:t,getFilterValueItem:i,apply:r})}}import*as We from"react";import{useCallback as Ms,useEffect as Qi,useState as uR}from"react";var lm=me({defaultClassName:"_16lm1iw3a _16lm1iw1",variantClassNames:{dragging:{true:"_16lm1iwn _16lm1iw1x"}},defaultVariants:{},compoundVariants:[]}),sm=me({defaultClassName:"_16lm1iw3a _16lm1iw1 _16lm1iwo",variantClassNames:{active:{true:"_3dmbka5 _16lm1iw1k _3dmbka2"},draggingInProgress:{true:"_16lm1iw1x"}},defaultVariants:{},compoundVariants:[[{active:!1,draggingInProgress:!0},"_3dmbka3"]]});function um(n,e){return St(n,e)}var Ir=class extends Un{constructor(t){super();this.dragIndex=-1;this.breakpoints=[];this.activeDragSourcePosition="outside";this.previousAcceptsDropResult=!0;this.setData(t)}get listId(){return this.data.listId}setData(t){return um(this.data,t)?!1:(this.data=t,!0)}getData(){return this.data}isEqual(t){return um(this.data,t.getData())}acceptsSelfDrops(){return!this.data.acceptDropsFrom||this.data.acceptDropsFrom.includes(this.data.listId)}acceptsDrop(t){let o=!0;return typeof this.data.shouldAcceptDrop=="function"&&(o=this.data.shouldAcceptDrop(t)),o=!!o,o!==this.previousAcceptsDropResult&&(this.previousAcceptsDropResult=o,o?this.emit("accept-feedback",t):this.emit("reject-feedback",t)),o}adjustForScroll(t){this.breakpoints=this.breakpoints.map(o=>o-t),this.data.orientation==="vertical"?this.data.listRectangle.shift({top:-t,left:0}):this.data.listRectangle.shift({top:0,left:-t})}move(t){this.emit("move",t)}unregister(){this.emit("unregister",this)}start(t){let o=t.dragSourceListId===this.data.listId,{draggableItems:r}=this.data,i=r.length;this.breakpoints=r.map((a,l)=>o||l===i-1?this.data.orientation==="horizontal"?a.rect.left+a.rect.width/2:a.rect.top+a.rect.height/2:this.data.orientation==="horizontal"?a.rect.right:a.rect.bottom),this.activeDragSourcePosition=o?"inside":"outside",this.emit("start",t)}drop(t){let{dropIndex:o,dragIndex:r,items:i,dragSourceListId:a,dropTargetListId:l,dragItem:s,outside:u}=t,c=Array.from({length:i.length},(f,m)=>m),d=[];o===-1?d=c.filter(f=>f!==r):d=Wn(c,r,o>r?o-1:o);let p={dragIndex:r,dropIndex:o,dragItem:s,items:i,dragSourceListId:a,dropTargetListId:l,sortedIndexes:d,outside:u,status:t.status};this.emit("drop",p)}};var tR={startFromPercentage:.25,maxScrollAtPercentage:.05,maxPixelScroll:28,ease:n=>n**2,durationDampening:{stopDampeningAt:1200,accelerateAt:360}};function nR(n,e){let t=getComputedStyle(n),o=e==="vertical"?t.overflowY:t.overflowX;return o!=="auto"&&o!=="scroll"?!1:e==="vertical"?n.scrollHeight>n.clientHeight:n.scrollWidth>n.clientWidth}function oR(n,e){let t=n;for(;t&&!(t===document.documentElement||t===document.body);){if(nR(t,e))return t;t=t.parentElement}return null}function rR(n,e){return{startScrollingFrom:n*e.startFromPercentage,maxScrollValueAt:n*e.maxScrollAtPercentage}}var ws=1;function cm(n,e,t){if(n>e.startScrollingFrom)return 0;if(n<=e.maxScrollValueAt)return t.maxPixelScroll;if(n===e.startScrollingFrom)return ws;let r=1-(n-e.maxScrollValueAt)/(e.startScrollingFrom-e.maxScrollValueAt);return Math.ceil(t.maxPixelScroll*t.ease(r))}function iR(n,e,t){let{accelerateAt:o,stopDampeningAt:r}=t.durationDampening,i=Date.now()-e;if(i>=r)return n;if(i<o)return ws;let a=(i-o)/(r-o);return Math.max(ws,Math.ceil(n*t.ease(a)))}function dm(n,e,t,o,r,i,a){if(n<e||n>t)return 0;let l=rR(o,r),s=n-e,u=t-n,c=u<s,d;return c?d=cm(u,l,r):d=-cm(s,l,r),d===0?0:a?(d>0?1:-1)*iR(Math.abs(d),i,r):d}var Oo=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={...tR,...e.config}}start(e){this.scrollContainer=oR(e,this.orientation),this.scrollContainer&&(this.maxScrollTop=this.scrollContainer.scrollHeight-this.scrollContainer.clientHeight,this.maxScrollLeft=this.scrollContainer.scrollWidth-this.scrollContainer.clientWidth),this.dragStartTime=Date.now(),this.shouldUseDampening=!0,this.active=!0}getScrollContainer(){return this.scrollContainer}updatePointer(e){this.lastPointer=e,!this.rafId&&this.active&&this.scheduleScroll()}scheduleScroll(){this.rafId=requestAnimationFrame(()=>{if(this.rafId=null,!this.active||!this.scrollContainer)return;let e=this.computeScroll();if(e.top===0&&e.left===0)return;let t={top:this.scrollContainer.scrollTop,left:this.scrollContainer.scrollLeft},o=Math.max(0,Math.min(this.maxScrollTop,t.top+e.top)),r=Math.max(0,Math.min(this.maxScrollLeft,t.left+e.left));this.scrollContainer.scrollTop=o,this.scrollContainer.scrollLeft=r;let i={top:this.scrollContainer.scrollTop-t.top,left:this.scrollContainer.scrollLeft-t.left},a=i.top!==0||i.left!==0;a&&this.onScroll(i),this.active&&a&&this.scheduleScroll()})}computeScroll(){if(!this.scrollContainer)return{top:0,left:0};let e=this.scrollContainer.getBoundingClientRect();if(this.orientation==="vertical"){if(this.lastPointer.left<e.left||this.lastPointer.left>e.right)return{top:0,left:0}}else if(this.lastPointer.top<e.top||this.lastPointer.top>e.bottom)return{top:0,left:0};let t=0,o=0;return this.orientation==="vertical"?t=dm(this.lastPointer.top,e.top,e.bottom,e.height,this.config,this.dragStartTime,this.shouldUseDampening):o=dm(this.lastPointer.left,e.left,e.right,e.width,this.config,this.dragStartTime,this.shouldUseDampening),{top:t,left:o}}stop(){this.active=!1,this.rafId!=null&&(cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollContainer=null}};var vs="data-drag-list-id",It="data-drag-item-id",Fo="data-drag-item-list-id",pm=`[${It}]`,fm=()=>null,mm=n=>{let{node:e,offset:t}=n;if(!t){e.style.transform="none";return}e.style.transform=`translate3d(${t.left}px, ${t.top}px, 0px)`},aR=n=>`${n.getAttribute(It)}`;function Ps(n,e){let t=n.current?.querySelectorAll(pm)??[];return Array.from(t).filter(r=>r.getAttribute(Fo)===`${e}`)}function lR(n,e){let t=Ps(n,e);return Array.from(t).map(r=>{let i=aR(r),a=r.getBoundingClientRect();return{id:i,rect:a}})}function sR(n){let{domRef:e,orientation:t,dragListId:o}=n,r=lR(e,o),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=Ae.from({top:a,left:l,width:u-l,height:s-a});return{draggableItems:r,orientation:t,listId:o,listRectangle:c,acceptDropsFrom:n.acceptDropsFrom,shouldAcceptDrop:n.shouldAcceptDrop,initial:n.initial,preserveDragSpace:n.preserveDragSpace}}function gm(n){return new Ir(sR(n))}function hm(n,e){let t=document.querySelector(`[${vs}="${e}"]`);t?n.current=t:console.warn(`DragList with id "${e}" not found. You're probably not spreading the domProps to the parent element. Make sure you also include the "className" prop.`)}function ym(n,e){let t=n.current;t&&t!==e&&ut.unregisterDragInteractionTarget(t),n.current=e,e&&ut.registerDragInteractionTarget(e)}function Sm(n){let{getProps:e,domRef:t,setInteractionTarget:o}=n;return ut.on("register",r=>{let{dragListId:i,acceptDropsFrom:a,orientation:l,shouldAcceptDrop:s}=e(),u=r.getData();if(u.initial&&u.listId!==i&&a?.includes(u.listId)){let c=gm({domRef:t,orientation:l,dragListId:i,initial:!1,acceptDropsFrom:a,shouldAcceptDrop:s});r.once("unregister",()=>{o(null)}),o(c)}})}function Ds(n,e){let t=n.cloneNode(!0);return t.removeAttribute(It),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 xs({proxyElement:n,dx:e,dy:t}){n.style.transform=`translate3d(${e}px, ${t}px, 0)`}function bm(n){let e=n.current;e&&(e.cleanup?e.cleanup({proxyElement:e.proxyElement}):e.proxyElement.remove(),e.originalNode.style.visibility="",n.current=null)}function Tm(n,e,t){let o=n.current;return(!o||o.length===0)&&(o=Ps(e,t),n.current=o),o}function Cm(n,e){let{dragListId:t,orientation:o,domRef:r,proxyStateRef:i,sourceScrollOffsetRef:a,dragItemsRef:l,getDragItems:s,getOnDrop:u,getOnAcceptDrop:c,getOnRemove:d,getUpdatePosition:p,updateDragOperationSourceAndTarget:f,updateDragProxyRenderState:m}=e,g=n.on("start",({dragItem:T,dragSourceListId:R,dropTargetListId:v})=>{f({dragSourceListId:R,dropTargetListId:v,dragItemId:T.id,status:"accepted"})}),h=n.on("move",({offsetsForItems:T,items:R,status:v,dragItem:w})=>{if(v==="rejected")return;let P=s(),x=p(),M=i.current;R.forEach((D,E)=>{let L=T[E],V=P[E];if(V&&!(M&&D.id===M.dragItemId)){if(!M&&D.id===w.id){let N=a.current;L={left:L.left+N.left,top:L.top+N.top}}x({id:D.id,node:V,offset:L})}})}),S=n.on("drop",T=>{let{sortedIndexes:R,dragIndex:v,dropIndex:w,dragItem:P,items:x,dragSourceListId:M,dropTargetListId:D,outside:E,status:L}=T,V=s();l.current=[];let N=c(),k=d(),F=u(),B=p();x.forEach((H,z)=>{let Z=V[z];Z&&B({id:H.id,node:Z,offset:null})}),bm(i),m(H=>H&&(requestAnimationFrame(()=>m(fm)),{...H,dragItemId:null})),t===D&&M!==t&&N&&L==="accepted"&&N({dragItemId:P.id,dragSourceListId:M,dropTargetListId:D,dragIndex:v,dropIndex:w,dropItemId:x[w]?.id});let _=null;w===-1&&M===t&&D===t&&E&&(_=k),w!==-1&&D===t&&M===t&&(_=F),_&&_?.(R,{dragIndex:v,dropIndex:w,dragItemId:x[v].id,dropItemId:x[w]?.id})}),y=null,C=null,b=null,I=null;if(!n.getData().initial&&r.current){if(y=new Oo({orientation:o,onScroll:()=>{}}),y.start(r.current),C=y.getScrollContainer(),C){let T=o==="vertical"?C.scrollTop:C.scrollLeft;b=()=>{let R=o==="vertical"?C.scrollTop:C.scrollLeft,v=R-T;T=R,v!==0&&(n.adjustForScroll(v),ut.retriggerMove())},C.addEventListener("scroll",b)}I=T=>{y.updatePointer({left:T.clientX,top:T.clientY})},_e().addEventListener("pointermove",I)}return()=>{g(),h(),S(),y&&y.stop(),C&&b&&C.removeEventListener("scroll",b),I&&_e().removeEventListener("pointermove",I)}}function Im(n,e,t){let{dragListId:o,orientation:r,acceptDropsFrom:i,preserveDragSpace:a,onDragProxySetup:l}=e,{domRef:s,proxyStateRef:u,sourceScrollOffsetRef:c,dragItemsRef:d,setInteractionTarget:p,updateDragProxyRenderState:f}=t,m=e.dragStrategy??"proxy",g=m==="proxy"&&!e.renderDragProxy,h=m==="proxy"&&!!e.renderDragProxy,S=e.onDragProxyMove??xs,y=n.currentTarget,C=y.getAttribute(It);if(C==null){let z=Tn(y,pm);z&&(C=z.getAttribute(It))}if(C==null){console.warn("Could not find drag item id for element",y,`Make sure you have a parent element with a ${It} attribute`);return}C=`${C}`;let b=null,I=Ps(s,o);d.current=I;let T=gm({domRef:s,orientation:r,dragListId:o,acceptDropsFrom:i,initial:!0,preserveDragSpace:a}),R=T.getData().draggableItems,v=R.findIndex(z=>z.id===C);if(v===-1)return;let w=R[v],P=I[v]?.getAttribute(It)===`${C}`?I[v]:I.find(z=>z.getAttribute(It)===`${C}`);p(T);let x={left:n.clientX,top:n.clientY},M={left:n.clientX,top:n.clientY};c.current={top:0,left:0};let D=new Oo({orientation:r,onScroll:()=>{}});s.current&&D.start(s.current);let E=D.getScrollContainer(),L=E?r==="vertical"?E.scrollTop:E.scrollLeft:0;function V(){b&&b.move({left:M.left,top:M.top})}let N=()=>{if(!E)return;let z=r==="vertical"?E.scrollTop:E.scrollLeft,Z=z-L;L=z,Z!==0&&(T.adjustForScroll(Z),r==="vertical"?c.current.top+=Z:c.current.left+=Z),V()};E?.addEventListener("scroll",N);let k=z=>{if(M={left:z.clientX,top:z.clientY},!b){if(b=ut.startDrag({listId:o,dragItem:w,dragIndex:v},x),P&&g){let se=P.getBoundingClientRect(),pe=null,Pe={dragItemNode:P,dragItemId:`${C}`,initialRect:se,initialCoords:x,get proxyElement(){return pe||(pe=Ds(P,se)),pe}},De=l?.(Pe),ce=De?.proxyElement??Pe.proxyElement;P.style.visibility="hidden",u.current={proxyElement:ce,originalNode:P,dragItemId:`${C}`,initialRect:se,cleanup:De?.cleanup}}if(P&&h){let se=P.getBoundingClientRect();P.style.visibility="hidden",u.current={proxyElement:P,originalNode:P,dragItemId:`${C}`,initialRect:se,cleanup:()=>{}};let pe={dragItemId:`${C}`,initialRect:se,dx:0,dy:0};f(()=>pe)}}let Z=z.clientX-x.left,be=z.clientY-x.top;if(h)f(se=>se&&{...se,dx:Z,dy:be});else{let se=u.current;se&&S({proxyElement:se.proxyElement,dx:Z,dy:be})}D.updatePointer({left:z.clientX,top:z.clientY}),V()},F=z=>{z.preventDefault()},B=z=>{if(D.stop(),E?.removeEventListener("scroll",N),H.removeEventListener("pointermove",k),H.removeEventListener("pointerup",$),H.removeEventListener("pointercancel",_),H.removeEventListener("dragstart",F,!0),h&&(f(Z=>Z&&{...Z,dragItemId:null}),requestAnimationFrame(()=>{f(fm)})),!b){bm(u),p(null);return}z?b.cancel():b.drop(),b=null},$=()=>B(!1),_=()=>B(!0),H=_e();H.addEventListener("pointermove",k),H.addEventListener("pointerup",$),H.addEventListener("pointercancel",_),H.addEventListener("dragstart",F,!0)}var Rm=We.createContext({dragItemId:null,onDragItemPointerDown:()=>{},draggingInProgress:!1,dragListId:"",status:"accepted",dragSourceListId:null,dropTargetListId:null}),No=()=>We.useContext(Rm);function cR(n,e){let t=Ne(e),[o,r]=We.useState(null),i=We.useRef(null),a=Ms(s=>{ym(i,s),r(s)},[]),l=Ne(o);return Qi(()=>()=>{ut.unregisterDragInteractionTarget(i.current),i.current=null},[]),Qi(()=>Sm({getProps:t,domRef:n,setInteractionTarget:a}),[t]),{interactionTarget:o,setInteractionTarget:a,getInteractionTarget:l}}var Zn=n=>{let e=We.useRef(null),t=We.useRef(null),[o,r]=uR(null),i=We.useRef({top:0,left:0}),a=We.useRef(null),l=We.useCallback(P=>{a.current=P},[]),{dropTargetListId:s,dragSourceListId:u}=Rn(),{updateDragOperationSourceAndTarget:c,dragItemId:d,status:p}=Rn(),f=Ne(n.onDrop),m=Ne(n.onAcceptDrop),g=Ne(n.onRemove),h=Ne(n.updatePosition??mm),{interactionTarget:S,setInteractionTarget:y}=cR(e,n);Qi(()=>{hm(e,n.dragListId)},[n.dragListId]),Qi(()=>{if(S)return Cm(S,{dragListId:n.dragListId,orientation:n.orientation,domRef:e,proxyStateRef:t,sourceScrollOffsetRef:i,dragItemsRef:C,getDragItems:b,getOnDrop:f,getOnAcceptDrop:m,getOnRemove:g,getUpdatePosition:h,updateDragOperationSourceAndTarget:c,updateDragProxyRenderState:r})},[S,n.dragListId]);let C=We.useRef([]),b=Ms(()=>Tm(C,e,n.dragListId),[n.dragListId]),I=Ms(P=>{Im(P,n,{domRef:e,proxyStateRef:t,sourceScrollOffsetRef:i,dragItemsRef:C,setInteractionTarget:y,updateDragProxyRenderState:r})},[n.orientation,n.dragListId,n.acceptDropsFrom,n.removeOnDropOutside,n.dragStrategy,n.renderDragProxy,n.onDragProxySetup,n.onDragProxyMove]),T=!!d,R=We.useMemo(()=>({dragItemId:d,onDragItemPointerDown:I,dragSourceListId:u,dropTargetListId:s,status:p,dragListId:n.dragListId,draggingInProgress:T}),[d,I,T,u,s,n.dragListId]),v={className:U("DragList",T?"DragList--dragging":"",lm({dragging:T})),[vs]:n.dragListId},w=typeof n.children=="function"?n.children(v,R):n.children;return We.createElement(Rm.Provider,{value:R},w,o&&n.renderDragProxy?n.renderDragProxy({...o,ref:l}):null)},dR=We.createContext({dragItemId:"",dragListId:"",active:!1,draggingInProgress:!1,dragSourceListId:"",dropTargetListId:""}),pR=n=>{let{onDragItemPointerDown:e,draggingInProgress:t,dragListId:o,dragItemId:r,dragSourceListId:i,dropTargetListId:a}=No(),l=n.dragListId??o,s=i===l&&r===`${n.id}`,u=We.useMemo(()=>({dragItemId:n.id,active:s,dragListId:l,draggingInProgress:t,dragSourceListId:i,dropTargetListId:a}),[n.id,s,l,t,i,a]),c={[It]:`${n.id}`,[Fo]:l,onPointerDown:e,className:U("DraggableItem",s?"DraggableItem--active":"",sm({active:s,draggingInProgress:t}))},d=typeof n.children=="function"?n.children(c,u):n.children;return We.createElement(dR.Provider,{value:u},d)};Zn.DraggableItem=pR;import*as Es from"react";var wm=n=>Es.createElement(ze,{...n,icon:"hidden",viewBox:"0 -960 960 960"},Es.createElement("path",{d:Ve.hidden[0]}));import*as Mr from"react";function vm(){return{}}var Pm=n=>({allowColumnHideWhileDragging:e=>e??!0});import{createContext as fR}from"react";var mR=fR(null);function As(){return mR}import*as vt from"react";import*as eo from"react";import{useCallback as ag,useEffect as Hs,useLayoutEffect as BR,useRef as lg,useState as WR}from"react";import*as Ji from"react";function gR(n){let{height:e,width:t,count:o}=n;return Ji.createElement("div",{"data-count":o,"data-placeholder-width":void 0,"data-placeholder-height":void 0,"data-name":"SpacePlaceholder",style:{height:e,width:t,zIndex:-1,opacity:0,pointerEvents:"none",contain:"strict"}})}var Dm=Ji.memo(gR);var xm="mlx2t3";import*as ea from"react";import{useRef as yR}from"react";import{useEffect as hR}from"react";var Mm=(n,e)=>{hR(()=>{let t=n?.current,o=i=>{let a=i.target;e?.({scrollTop:a.scrollTop,scrollLeft:a.scrollLeft})},r={passive:!1};return t?.addEventListener("scroll",o,r),()=>{t?.removeEventListener("scroll",o)}},[e,n?.current])};var Em={true:"_1ueijco2",false:"_1ueijco3",visible:"_1ueijco4",auto:"_1ueijco5",hidden:"_1ueijco6"},Am={true:"_1ueijco7",false:"_1ueijco8",visible:"_1ueijco9",auto:"_1ueijcoa",hidden:"_1ueijcob"},_m={true:"_1ueijcoc",false:"_1ueijcod",visible:"_1ueijcoe",auto:"_1ueijcof",hidden:"_1ueijcog"},_s="_1ueijco1",Om="_1ueijco0 _16lm1iw0";var Fm=n=>{let e="";return typeof n=="boolean"||typeof n=="string"?e=Em[`${n}`]:e=U(Am[`${n.horizontal}`],_m[`${n.vertical}`]),e};var SR="InfiniteVirtualScrollContainer";var Nm=ea.forwardRef(function(e,t){let{children:o,scrollable:r=!0,onContainerScroll:i,className:a,tabIndex:l,style:s,autoFocus:u}=e,c=t??yR(null);return Mm(c,i),ea.createElement("div",{ref:c,style:s,autoFocus:u,tabIndex:l,className:U(a,SR,Om,Fm(r))},o)});import*as pa from"react";import{useLayoutEffect as da,useMemo as DR}from"react";import*as Lm from"react";import{useLayoutEffect as bR,useRef as TR,useState as CR}from"react";function IR(n){let[e,t]=CR(n.updater.get),o=TR(null);return bR(()=>{function r(a){n.useraf?(o.current!=null&&cancelAnimationFrame(o.current),o.current=requestAnimationFrame(()=>{t(a)})):t(a)}let i=n.updater.onChange(r);return()=>{o.current!=null&&cancelAnimationFrame(o.current),i()}},[n.updater,n.useraf]),e??null}var En=Lm.memo(IR);var km=so(Bn());var Os=(n,e)=>n-e,tn={horizontal:!0,vertical:!0};function ta(n,e){let t=e.length;if(!t)return 0;let o=-1;for(let r=0;r<t;r++){let i=0,a=0;if(t-r<=o)break;for(let l=r;l<t;l++)if(i+=e[l],a++,i>n){a>o&&(o=a);break}}return o<0?t:Math.min(o,t)}var Fs="DebugID=";function An(n,e){return e&&e.startsWith(Fs)?e:e?`${Fs}${n}:${e}`:`${Fs}${n}`}var na={start:0,end:0},Ns=n=>{n()},Ls=n=>{let{start:e,end:t}=n,[o,r]=e,[i,a]=t,l=i-o,s=a-r;return l*s},zm=n=>{let{start:e,end:t}=n,[o]=e,[r]=t;return r-o},Rr=typeof window<"u"?requestAnimationFrame:n=>setTimeout(n,0);function RR(n){return n.horizontalChange||n.verticalChange}var Qn=class extends yt{constructor(t){let o=An(t,`${t}:MatrixBrain`);super(o);this.scrolling=!1;this.RENDER_COUNT_SAFETY_MARGIN_START=1;this.RENDER_COUNT_SAFETY_MARGIN_END=1;this.availableWidth=0;this.availableRenderWidth=0;this.isHorizontalLayoutBrain=!1;this.name="";this.availableHeight=0;this.availableRenderHeight=0;this.cols=0;this.rows=0;this.alwaysRenderedColumns=new Set;this._rowsPerPage=0;this.rowHeight=0;this.colWidth=0;this.verticalTotalSize=0;this.horizontalTotalSize=0;this.horizontalRenderCount=void 0;this.verticalRenderCount=void 0;this.maxHorizontalRenderCount=0;this.maxVerticalRenderCount=0;this.horizontalExtendRangeBy=na;this.verticalExtendRangeBy=na;this.horizontalRenderRange={startIndex:0,endIndex:0};this.verticalRenderRange={startIndex:0,endIndex:0};this.extraSpanCells=[];this.scrollPosition={scrollLeft:0,scrollTop:0};this.largeContent={vertical:!1,horizontal:!1};this.scrollRatio={vertical:1,horizontal:1};this.scrollOrigin={scrollLeft:0,scrollTop:0};this.onScrollOriginChangeFns=new Set;this.onScrollFns=[];this.onRenderRangeChangeFns=new Set;this.onVerticalRenderRangeChangeFns=new Set;this.onHorizontalRenderRangeChangeFns=new Set;this.onDestroyFns=[];this.destroyed=!1;this.onRenderCountChangeFns=new Set;this.onAvailableSizeChangeFns=new Set;this.onScrollStartFns=[];this.onScrollStopFns=[];this.scrollTimeoutId=0;this.scrollStopDelay=250;this.fixedColsStart=0;this.fixedColsEnd=0;this.fixedRowsStart=0;this.fixedRowsEnd=0;this.setScrollStopDelay=t=>{this.scrollStopDelay=t};this.getRowCount=()=>this.rows;this.getColCount=()=>this.cols;this.onScrollOriginChange=t=>this.onScrollOriginChangeForBrain(t);this.setScrolling=t=>{let o=this.scrolling;this.scrolling=t,t&&(this.scrollTimeoutId&&clearTimeout(this.scrollTimeoutId),this.scrollTimeoutId=setTimeout(()=>{this.setScrolling(!1),this.scrollTimeoutId=0},this.scrollStopDelay)),t!==o&&(t?this.notifyScrollStart():this.notifyScrollStop())};this.notifyScrollStart=()=>{if(this.destroyed)return;let t=this.onScrollStartFns;for(let o=0,r=t.length;o<r;o++)t[o]()};this.notifyScrollStop=()=>{if(this.destroyed)return;let t=this.onScrollStopFns,o=this.scrollPosition,r=this.getRenderRange();for(let i=0,a=t.length;i<a;i++)t[i](o,r)};this.notifyAvailableSizeChange=()=>{if(this.destroyed)return;let t=this.onAvailableSizeChangeFns,o=this.getAvailableSize();t.forEach(r=>{Rr(()=>{this.destroyed||t.has(r)&&r(o)})})};this.notifyVerticalRenderRangeChange=(t=!1)=>{if(this.destroyed)return;let o=this.onVerticalRenderRangeChangeFns,r=this.verticalRenderRange,i=t?Ns:Rr;o.forEach(a=>{i(()=>{this.destroyed||o.has(a)&&a([r.startIndex,r.endIndex])})})};this.notifyHorizontalRenderRangeChange=(t=!1)=>{if(this.destroyed)return;let o=this.onHorizontalRenderRangeChangeFns,r=this.horizontalRenderRange,i=t?Ns:Rr;o.forEach(a=>{i(()=>{this.destroyed||o.has(a)&&a([r.startIndex,r.endIndex])})})};this.isColFixedEnd=t=>this.fixedColsEnd?t>=this.cols-this.fixedColsEnd:!1;this.isColFixedStart=t=>this.fixedColsStart?t<this.fixedColsStart:!1;this.isRowFixedEnd=t=>this.fixedRowsEnd?t>=this.rows-this.fixedRowsEnd:!1;this.isRowFixedStart=t=>this.fixedRowsStart?t<this.fixedRowsStart:!1;this.isColFixed=t=>this.isColFixedStart(t)||this.isColFixedEnd(t);this.isRowFixed=t=>this.isRowFixedStart(t)||this.isRowFixedEnd(t);this.getFixedEndColsWidth=()=>{if(!this.fixedColsEnd)return 0;let t=0;for(let o=this.cols-this.fixedColsEnd;o<this.cols;o++)t+=this.getColWidth(o);return t};this.getFixedEndColsOffsets=({skipScroll:t}={skipScroll:!1})=>{if(!this.fixedColsEnd)return[];let{scrollLeft:o}=this.scrollPosition,{width:r}=this.getAvailableSize(),i=[],a=[],l=0;for(let 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:o);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:o}=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:o);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 o=0;o<this.fixedColsStart;o++)t+=this.getColWidth(o);return t};this.getFixedEndRowsHeight=()=>{if(!this.fixedRowsEnd)return 0;let t=0;for(let o=this.rows-this.fixedRowsEnd;o<this.rows;o++)t+=this.getRowHeight(o);return t};this.getFixedStartRowsHeight=()=>{if(!this.fixedRowsStart)return 0;let t=0;for(let o=0;o<this.fixedRowsStart;o++)t+=this.getRowHeight(o);return t};this.computeRenderCount=(t=tn)=>{let o=t.horizontal,r=t.vertical,i=this.horizontalRenderCount||0,a=this.verticalRenderCount||0;return o&&(i=this.computeDirectionalRenderCount("horizontal",this.colWidth,this.cols,this.getAvailableRenderSize())),r&&(a=this.computeDirectionalRenderCount("vertical",this.rowHeight,this.rows,this.getAvailableRenderSize())),{horizontal:i,vertical:a}};this.setRenderCount=({horizontal:t,vertical:o})=>{t===void 0&&(t=this.horizontalRenderCount),o===void 0&&(o=this.verticalRenderCount);let r=t===this.horizontalRenderCount,i=o===this.verticalRenderCount;r&&i||(this.horizontalRenderCount=t,this.verticalRenderCount=o,this.updateRenderRange({horizontal:!r,vertical:!i}),this.notifyRenderCountChange())};this.updateFixedCells=t=>{t.fixedColsStart!=this.fixedColsStart&&(this.fixedColsStart=t.fixedColsStart||0),t.fixedColsEnd!=this.fixedColsEnd&&(this.fixedColsEnd=t.fixedColsEnd||0),t.fixedRowsStart!=this.fixedRowsStart&&(this.fixedRowsStart=t.fixedRowsStart||0),t.fixedRowsEnd!=this.fixedRowsEnd&&(this.fixedRowsEnd=t.fixedRowsEnd||0)};this.getFixedCellInfo=()=>{let{fixedRowsStart:t,fixedColsStart:o,fixedRowsEnd:r,fixedColsEnd:i}=this;return{fixedRowsStart:t,fixedColsStart:o,fixedRowsEnd:r,fixedColsEnd:i}};this.updateRenderRange=(t=tn)=>{this.setRenderRange(this.computeRenderRange(t))};this.getExtraSpanCellsForRange=({horizontal:t,vertical:o})=>{let{colspan:r,rowspan:i}=this,a=[];if(i){let l=o.startIndex,s=t.startIndex,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=o.startIndex,u=o.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=tn)=>{let o=t.horizontal?this.computeDirectionalRenderRange("horizontal"):this.horizontalRenderRange,r=t.vertical?this.computeDirectionalRenderRange("vertical"):this.verticalRenderRange;return{horizontal:o,vertical:r,extraCells:this.getExtraSpanCellsForRange({horizontal:o,vertical:r})}};this.computeDirectionalRenderRange=t=>{let o=t==="horizontal"?this.colWidth:this.rowHeight,r=t==="horizontal"?this.horizontalRenderCount:this.verticalRenderCount,i=t==="horizontal"?this.cols:this.rows;if(!r)return{startIndex:0,endIndex:0};let a=(t==="horizontal"?this.fixedColsStart:this.fixedRowsStart)||0,l=t==="horizontal"?this.scrollPosition.scrollLeft:this.scrollPosition.scrollTop;l+=this.getFixedStartSize(t);let s=typeof o!="function",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,o)=>{let r=o==="horizontal"?this.colWidth:this.rowHeight,i=o==="horizontal"?this.cols:this.rows;if(typeof r!="function")return Math.min(Math.max(0,Math.floor(t/r)),i-1);let a=o==="horizontal"?this.colOffsetCache:this.rowOffsetCache,l=o==="horizontal"?this.colWidthCache:this.rowHeightCache,s=a.length-1,u=l.length-1,c=a[s],d;for(;c<t;)if(s>=i||(u+=1,this.computeCacheFor(u,o),d=c,c=a[u],d===c&&d!=0))return i-1;let p=(0,km.default)(a,t,Os);return p>=0?p:~p-1};this.computeCacheFor=(t,o)=>{let r=o==="horizontal"?this.colWidth:this.rowHeight,i=o==="horizontal"?this.colWidthCache:this.rowHeightCache,a=o==="horizontal"?this.colOffsetCache:this.rowOffsetCache;if(typeof r!="function")return;let l=r(t);if(i[t]=l,t>0){let s=a[t-1],u=i[t-1];s==null&&console.error(`Offset was not available for ${o==="horizontal"?"col":"row"} ${t-1}`),u==null&&console.error(`Size was not available for ${o==="horizontal"?"col":"row"} ${t-1}`);let c=s+u;a[t]=c}};this.computeItemSpanUpTo=(t,o,r)=>{let i=r==="horizontal"?o:t,a=r==="horizontal"?t:o,l=r==="horizontal"?this.cols:this.rows,s=r==="horizontal"?this.colspan:this.rowspan;if(!s)return;let 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:o};for(;f<=m;f++)if(d[f]===void 0){g[r==="horizontal"?"colIndex":"rowIndex"]=f;let h=s(g);d[f]=f,p[f]=h;let S=f;for(;h>1;)S+=1,d[S]=f,p[S]=0,h-=1}}};this.getCellSpan=(t,o,r)=>{let i=r==="horizontal"?this.colspan:this.rowspan,a=r==="horizontal"?o:t,l=r==="horizontal"?t:o;if(!i)return 1;let s=r==="horizontal"?this.colspanValue:this.rowspanValue,u=s.get(l);return(!u||u[a]===void 0)&&this.computeItemSpanUpTo(t,o,r),u||(u=s.get(l)),u[a]||1};this.getRowspan=(t,o)=>this.getCellSpan(t,o,"vertical");this.getColspan=(t,o)=>this.getCellSpan(t,o,"horizontal");this.getRowspanParent=(t,o)=>this.getItemSpanParent(t,o,"vertical");this.getColspanParent=(t,o)=>this.getItemSpanParent(t,o,"horizontal");this.getItemSpanParent=(t,o,r)=>{let i=r=="horizontal"?this.colspan:this.rowspan,a=r==="horizontal"?o:t,l=r==="horizontal"?t:o;if(!i)return a;let s=r==="horizontal"?this.colspanParent:this.rowspanParent,u=s.get(l);return(!u||u[a]===void 0)&&this.computeItemSpanUpTo(t,o,r),u||(u=s.get(l)),u[a]};this.getRowHeightWithSpan=(t,o,r)=>this.getItemSizeWithSpan(t,o,r,"vertical");this.getColWidthWithSpan=(t,o,r)=>this.getItemSizeWithSpan(t,o,r,"horizontal");this.getItemSizeWithSpan=(t,o,r,i)=>{let a=i==="horizontal"?o:t,l=this.getItemSize(a,i);for(;r>1;)a+=1,r-=1,l+=this.getItemSize(a,i);return l};this.getRowHeight=t=>this.getItemSize(t,"vertical");this.getColWidth=t=>this.getItemSize(t,"horizontal");this.getItemSize=(t,o)=>{let r=o==="horizontal"?this.cols:this.rows,i=o==="horizontal"?this.colWidth:this.rowHeight;if(typeof i!="function")return i;let a=this.getItemSizeCacheFor(t,o),l=o==="horizontal"?this.colWidthCache:this.rowHeightCache;if(a===void 0){let s=l.length,u=Math.min(t,r-1);for(;s<=u;s++)this.computeCacheFor(s,o);a=this.getItemSizeCacheFor(t,o)}return a};this.keepColumnRendered=t=>(this.alwaysRenderedColumns.add(t),()=>{this.alwaysRenderedColumns.delete(t)});this.getAlwaysRenderedColumns=()=>Array.from(this.alwaysRenderedColumns);this.setRenderRange=({horizontal:t,vertical:o,extraCells:r})=>{let i=!1;(t.startIndex!==this.horizontalRenderRange.startIndex||t.endIndex!==this.horizontalRenderRange.endIndex)&&(this.horizontalRenderRange=t,i=!0);let a=!1;(o.startIndex!==this.verticalRenderRange.startIndex||o.endIndex!==this.verticalRenderRange.endIndex)&&(this.verticalRenderRange=o,a=!0),this.extraSpanCells=r||[],(i||a)&&this.notifyRenderRangeChange(),a&&this.notifyVerticalRenderRangeChange(),i&&this.notifyHorizontalRenderRangeChange()};this.getRenderRangeCellCount=Ls;this.getMaxCellCount=()=>this.maxHorizontalRenderCount*this.maxVerticalRenderCount;this.getExtraCells=()=>this.extraSpanCells;this.getScrollPosition=()=>this.scrollPosition;this.getRenderRange=()=>({start:[this.verticalRenderRange.startIndex,this.horizontalRenderRange.startIndex],end:[this.verticalRenderRange.endIndex,this.horizontalRenderRange.endIndex]});this.onScroll=t=>(this.onScrollFns.push(t),()=>{this.onScrollFns=this.onScrollFns.filter(o=>o!==t)});this.onScrollStart=t=>(this.onScrollStartFns.push(t),()=>{this.onScrollStartFns=this.onScrollStartFns.filter(o=>o!==t)});this.onScrollStop=t=>(this.onScrollStopFns.push(t),()=>{this.onScrollStopFns=this.onScrollStopFns.filter(o=>o!==t)});this.onRenderRangeChange=t=>(this.onRenderRangeChangeFns.add(t),()=>{this.onRenderRangeChangeFns.delete(t)});this.onVerticalRenderRangeChange=t=>(this.onVerticalRenderRangeChangeFns.add(t),()=>{this.onVerticalRenderRangeChangeFns.delete(t)});this.onHorizontalRenderRangeChange=t=>(this.onHorizontalRenderRangeChangeFns.add(t),()=>{this.onHorizontalRenderRangeChangeFns.delete(t)});this.onRenderCountChange=t=>(this.onRenderCountChangeFns.add(t),()=>{this.onRenderCountChangeFns.delete(t)});this.onAvailableSizeChange=t=>(this.onAvailableSizeChangeFns.add(t),()=>{this.onAvailableSizeChangeFns.delete(t)});this.onDestroy=t=>(this.onDestroyFns.push(t),()=>{this.onDestroyFns=this.onDestroyFns.filter(o=>o!==t)});this.getAvailableSize=()=>({width:this.availableWidth,height:this.availableHeight});this.getAvailableRenderSize=()=>({width:this.availableRenderWidth??this.availableWidth,height:this.availableRenderHeight??this.availableHeight});this.name=o,this.update=this.update.bind(this),this.destroy=this.destroy.bind(this),this.getCellOffset=this.getCellOffset.bind(this),this.reset()}set rowsPerPage(t){t!=this._rowsPerPage&&(this._rowsPerPage=t)}get rowsPerPage(){return this._rowsPerPage}reset(t=tn){t.vertical&&this.resetVertical(),t.horizontal&&this.resetHorizontal(),this.extraSpanCells=[]}resetVertical(){this.rowspanParent=new Map,this.rowspanValue=new Map,this.rowHeightCache=[],this.rowOffsetCache=[0],this.verticalRenderCount=void 0,this.verticalTotalSize=0,this.verticalRenderRange={startIndex:0,endIndex:0}}resetHorizontal(){this.colspanParent=new Map,this.colspanValue=new Map,this.colWidthCache=[],this.colOffsetCache=[0],this.horizontalRenderCount=void 0,this.horizontalTotalSize=0,this.horizontalRenderRange={startIndex:0,endIndex:0}}getVirtualColIndex(t,o){return t}update(t,o){let{rows:r,cols:i,rowHeight:a,colWidth:l,width:s,height: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",h=m&&r!==this.rows,S=g&&i!==this.cols;m&&(this.rows=r,this.rowsPerPage=r),g&&(this.cols=i);let y=a!=null,C=l!=null,b=y&&a!==this.rowHeight,I=C&&l!==this.colWidth;y&&(this.rowHeight=a),C&&(this.colWidth=l);let T=t.rowspan!=null,R=t.colspan!=null,v=T&&t.rowspan!=this.rowspan,w=R&&t.colspan!=this.colspan;v&&(this.rowspan=t.rowspan),w&&(this.colspan=t.colspan);let P=S||I||p||w,x=h||b||f||v;(o||RR)({horizontalChange:P,verticalChange:x,colsChanged:S,colWidthChanged:I,widthChanged:p,colspanChanged:w,rowsChanged:h,rowHeightChanged:b,heightChanged:f,rowspanChanged:v})&&this.updateRenderCount({horizontal:P,vertical:x})}extendRenderRange(t){let{direction:o}=t,r=o==="horizontal",i=r?this.horizontalRenderCount||this.getInitialCols():this.verticalRenderCount||this.getInitialRows(),a=typeof t.start=="number"?t.start:t.start===!0?i:0,l=typeof t.end=="number"?t.end:t.end===!0?i:0;return r?this.horizontalExtendRangeBy={start:a,end:l}:this.verticalExtendRangeBy={start:a,end:l},this.updateRenderRange({horizontal:r,vertical:!r}),()=>{this.extendRenderRange({start:0,end:0,direction:o})}}updateRenderCount(t=tn){this.reset(t),this.doUpdateRenderCount(t),this.updateLargeContent()}supportsLargeContent(t){return t==="vertical"}alignScrollOrigin(t,o){return Math.floor(o)}updateLargeContent(){let t=this.getVirtualizedContentSize(),o=this.supportsLargeContent("vertical")&&wi(t.height),r=this.supportsLargeContent("horizontal")&&wi(t.width);this.largeContent={vertical:o,horizontal:r},this.scrollRatio={vertical:o?es(t.height,this.availableHeight):1,horizontal:r?es(t.width,this.availableWidth):1},this.updateScrollOrigin()}isLargeContent(t){return this.largeContent[t]}getScrollRatio(t){return this.scrollRatio[t]}getNativeScrollSize(){let t=this.getVirtualizedContentSize(),{largeContent:o}=this;if(!o.vertical&&!o.horizontal)return t;let r=Ri();return{width:o.horizontal?r:t.width,height:o.vertical?r:t.height}}toContentScrollPosition(t){let{vertical:o,horizontal:r}=this.scrollRatio;return o===1&&r===1?t:{scrollTop:t.scrollTop*o,scrollLeft:t.scrollLeft*r}}toNativeScrollPosition(t){let{vertical:o,horizontal:r}=this.scrollRatio;return o===1&&r===1?t:{scrollTop:t.scrollTop/o,scrollLeft:t.scrollLeft/r}}getScrollOrigin(){return this.scrollOrigin}getDOMScrollPosition(t=this.getScrollPosition()){let o=this.getScrollOrigin();return!o.scrollTop&&!o.scrollLeft?t:{scrollTop:t.scrollTop-o.scrollTop,scrollLeft:t.scrollLeft-o.scrollLeft}}onScrollOriginChangeForBrain(t){return this.onScrollOriginChangeFns.add(t),()=>{this.onScrollOriginChangeFns.delete(t)}}updateScrollOrigin(){let{scrollPosition:t,largeContent:o,scrollOrigin:r}=this,i=u=>this.alignScrollOrigin("vertical",u),a=u=>this.alignScrollOrigin("horizontal",u),l=o.vertical?ts(t.scrollTop,i(r.scrollTop),i):0,s=o.horizontal?ts(t.scrollLeft,a(r.scrollLeft),a):0;l===r.scrollTop&&s===r.scrollLeft||(this.scrollOrigin={scrollTop:l,scrollLeft:s},this.notifyScrollOriginChange())}notifyScrollOriginChange(){if(this.destroyed)return;let t=this.getScrollOrigin();this.onScrollOriginChangeFns.forEach(o=>o(t))}doUpdateRenderCount(t=tn){if(!this.availableWidth||!this.availableHeight){let o={horizontal:void 0,vertical:void 0};this.availableWidth||(o.horizontal=0),this.availableHeight||(o.vertical=0),this.setRenderCount(o)}this.setRenderCount(this.computeRenderCount(t))}get scrollTopMax(){return this.getVirtualizedContentSize().height-this.availableHeight}get scrollLeftMax(){return this.getVirtualizedContentSize().width-this.availableWidth}setScrollPosition(t,o){this.setScrolling(!0);let r=t.scrollLeft!==this.scrollPosition.scrollLeft,i=t.scrollTop!==this.scrollPosition.scrollTop;this.scrollPosition=t,(r||i)&&(this.updateScrollOrigin(),o?.(t),this.updateRenderRange({horizontal:r,vertical:i}),this.notifyScrollChange())}notifyRenderRangeChange(t=!1){if(this.destroyed)return;let o=this.onRenderRangeChangeFns,r=this.getRenderRange(),i=t?Ns:Rr;o.forEach(a=>{i(()=>{this.destroyed||o.has(a)&&a(r)})})}notifyScrollChange(){if(this.destroyed)return;let{scrollPosition:t}=this,o=this.onScrollFns;for(let r=0,i=o.length;r<i;r++)o[r](t)}computeDirectionalRenderCount(t,o,r,i){let a=0,l=t==="horizontal"?i.width:i.height;if(l-=this.getFixedSize(t),l<=0)return 0;let s=t==="horizontal"?this.fixedColsStart:this.fixedRowsStart,u=t==="horizontal"?this.fixedColsEnd:this.fixedRowsEnd;if(typeof o=="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=(o?Math.ceil(l/o):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:o}=this,r={horizontal:t,vertical:o},i=this.onRenderCountChangeFns;i.forEach(a=>{Rr(()=>{this.destroyed||i.has(a)&&a(r)})})}getCellOffset(t,o){return{x:this.getItemOffsetFor(o,"horizontal"),y:this.getItemOffsetFor(t,"vertical")}}getInitialRowHeight(){return this.rowHeight}getInitialCols(){return this.cols}getInitialRows(){return this.rows}getItemOffsetFor(t,o){let r=o==="horizontal"?this.colWidth:this.rowHeight;if(typeof r!="function")return t*r;let i=o==="horizontal"?this.colOffsetCache:this.rowOffsetCache,a=o==="horizontal"?this.colWidthCache:this.rowHeightCache,l=i[t];if(l==null){let s=a.length-1;for(;s<t;)s+=1,this.computeCacheFor(s,o);l=i[t]}return l}getItemSizeCacheFor(t,o){return(o==="horizontal"?this.colWidthCache:this.rowHeightCache)[t]}getRowIndexInPage(t){return t}getPageIndexForRow(t){return 0}getVirtualizedContentSize(){return{height:this.getVirtualizedContentSizeFor("vertical"),width:this.getVirtualizedContentSizeFor("horizontal")}}getVirtualizedContentSizeFor(t){let o=t==="horizontal"?this.cols:this.rows,r=t==="horizontal"?this.colWidth:this.rowHeight,i=t==="horizontal"?this.horizontalTotalSize:this.verticalTotalSize;if(typeof r!="function")return r*o;if(i!==0&&!isNaN(i))return i;let a=t==="horizontal"?this.colOffsetCache:this.rowOffsetCache,l=o?this.getItemSize(o-1,t):0,s=o?a[o-1]:0,u=l+s;return t==="horizontal"?this.horizontalTotalSize=u:this.verticalTotalSize=u,u}notifyDestroy(){let t=this.onDestroyFns;for(let o=0,r=t.length;o<r;o++)t[o]()}destroy(){this.destroyed||(this.notifyDestroy(),this.reset(),this.rowspanParent.clear(),this.colspanParent.clear(),this.alwaysRenderedColumns.clear(),this.horizontalExtendRangeBy=na,this.verticalExtendRangeBy=na,this.destroyed=!0,this.onDestroyFns=[],this.onScrollFns=[],this.onScrollStartFns=[],this.onScrollStopFns=[],this.onRenderCountChangeFns.clear(),this.onScrollOriginChangeFns.clear(),this.onRenderRangeChangeFns.clear(),this.onVerticalRenderRangeChangeFns.clear(),this.onHorizontalRenderRangeChangeFns.clear())}};var ks=so(Bn());function Vm(...n){if(!n.length)return new Set;let[e,...t]=n;return new Set([...e].filter(o=>t.every(r=>r.has(o))))}function Gm(n,e){let t=new Set;for(let o of n)e(o)&&t.add(o);return t}function wr(n,e){for(let t of n)if(e(t))return t}var oa=(n,e)=>n-e,ra=class extends yt{constructor(t,o){super(`${t}:GridCellManager`);this.matrix=new W;this.rowsWithCellsHistory=new Map;this.columnsWithCellsHistory=new Map;this.cellToMatrixPosition=new WeakMap;this.getCellsOutsideRenderRange=t=>{let{start:o,end:r}=t,[i,a]=o,[l,s]=r,u=new Set;return this.matrix.visit(({value:c},d)=>{if(!c)return;let[p,f]=d,m=p<i,g=p>=l,h=f<a,S=f>=s;(m||g||h||S)&&u.add(c)}),u};this.debugId=t,this.pool=o,this.offRemoveCell=this.pool.onRemoveCell(r=>this.onRemoveCell(r))}onRemoveCell(t){let o=this.cellToMatrixPosition.get(t);this.cellToMatrixPosition.delete(t),o&&this.clearCellFromMatrix(t,o,{skipHistory:!1})}set poolSize(t){this.pool.poolSize=t}get poolSize(){return this.pool.poolSize}getDetachedCell(){return this.pool.getDetachedCell()}clearCellFromMatrix(t,o,r){if(this.matrix.delete(o),r.skipHistory)return;let[i,a]=o,l=this.rowsWithCellsHistory.get(i),s=this.columnsWithCellsHistory.get(a);l&&(l.delete(t),l.size===0&&this.rowsWithCellsHistory.delete(i)),s&&(s.delete(t),s.size===0&&this.columnsWithCellsHistory.delete(a))}addCellToMatrix(t,o){let[r,i]=o;this.matrix.set(o,t),this.cellToMatrixPosition.set(t,o);let a=this.rowsWithCellsHistory.get(r),l=this.columnsWithCellsHistory.get(i);a?a.add(t):(a=new Set,a.add(t),this.rowsWithCellsHistory.set(r,a)),l?l.add(t):(l=new Set,l.add(t),this.columnsWithCellsHistory.set(i,l))}setCellPositionInMatrix(t,o){let r=this.cellToMatrixPosition.get(t);if(o==null){r&&this.clearCellFromMatrix(t,r,{skipHistory:!0});return}let[i,a]=o,l=r&&r[0]===i&&r[1]===a;r&&!l&&this.clearCellFromMatrix(t,r,{skipHistory:!1}),this.addCellToMatrix(t,o)}renderNodeAtCell(t,o,r,i){let a=this.getCellAt(r);return a&&a!==o&&this.detachCellAt(r),this.pool.attachCell(o),this.setCellPositionInMatrix(o,r),o.update(t,i),o}getCellPosition(t){let o=this.cellToMatrixPosition.get(t);return!o||this.getCellAt(o)!=t?null:o}getCellAt(t){return this.matrix.get(t)}getCellFor(t,o){let r=this.getCellAt(t);if(r)return r;let[i,a]=t;if(o==="row"){let l=this.rowsWithCellsHistory.get(i);l&&(r=wr(l,s=>!this.isCellAttached(s)))}if(o==="column"){let l=this.columnsWithCellsHistory.get(a);l&&(r=wr(l,s=>!this.isCellAttached(s)))}return r??this.getDetachedCell()}isCellAttached(t){return this.getCellPosition(t)!==null}isCellAttachedAt(t){let o=this.getCellAt(t);return o?this.isCellAttached(o):!1}getMatrix(){let t=this.getRowsWithCells().pop()??-1,o=this.getColumnsWithCells().pop()??-1;return Array.from({length:t+1},(i,a)=>Array.from({length:o+1},(s,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(o=>this.getCellAt(o)).filter(Boolean)}getOneAttachedCell(){return this.pool.getAttachedCells().values().next().value}getRowsWithCells(){return this.matrix.rawKeysAt([]).sort(oa)}getColumnsWithCells(){let t=this.matrix.getKeysOfFirstChildOnEachBranchStartingWith([],{excludeSelf:!0});return[...new Set(t.map(r=>r[1])).values()].sort(oa)}isRowAttached(t){return this.getRowsWithCells().includes(t)}isColumnAttached(t){return this.getColumnsWithCells().includes(t)}detachRow(t){this.matrix.getKeysStartingWith([t]).forEach(r=>this.detachCellAt(r))}detachCol(t){this.matrix.visit((o,r)=>{r[1]===t&&this.detachCellAt(r)})}detachCell(t){return t?(this.pool.detachCell(t)&&this.setCellPositionInMatrix(t,null),!0):!1}detachCells(t){t.forEach(o=>this.detachCell(o))}detachRowsStartingWith(t){let o=this.getRowsWithCells().sort(),r=(0,ks.default)(o,t,oa);r<0&&(r=~r),o.slice(r).forEach(a=>this.detachRow(a))}detachColsStartingWith(t){let o=this.getColumnsWithCells().sort(),r=(0,ks.default)(o,t,oa);r<0&&(r=~r),o.slice(r).forEach(a=>this.detachCol(a))}detachCellsStartingAt(t){let[o,r]=t;this.matrix.visit((i,a)=>{let[l,s]=a;l>o&&this.detachCellAt(a),l===o&&s>=r&&this.detachCellAt(a)})}detachCellAt(t){let o=this.getCellAt(t);return o?this.detachCell(o):!1}onCellAttachmentChange(t){return this.pool.onCellAttachmentChange(t)}getCellFromListForRow(t,o){return wr(t,r=>this.getCellPosition(r)?.[0]===o)}getCellFromListForColumn(t,o){return wr(t,r=>this.getCellPosition(r)?.[1]===o)}getCellCountInMatrix(){return this.matrix.size}flushPendingAfterCommitWork(){this.pool.flushPendingAfterCommitWork()}destroy(){this.reset()}reset(){this.pool.reset(),this.matrix.clear(),this.rowsWithCellsHistory.clear(),this.columnsWithCellsHistory.clear(),this.offRemoveCell(),this.offRemoveCell=()=>{}}makeDetachedCellsEmpty(){this.pool.getDetachedCells().forEach(t=>{t.update(null)})}withDetachedCells(t){this.pool.getDetachedCells().forEach(t)}};var Hm=so(Bn());var ia=class extends yt{constructor(t,o){super(`${t}:ListRowManager`);this.indexToRow=new Map;this.rowToIndex=new WeakMap;this.debugId=t,this.pool=o,this.offRemoveRow=this.pool.onRemoveRow(r=>this.onRemoveRow(r))}onRemoveRow(t){let o=this.rowToIndex.get(t);o!=null&&(this.rowToIndex.delete(t),this.indexToRow.delete(o))}set poolSize(t){this.pool.poolSize=t}get poolSize(){return this.pool.poolSize}getDetachedRow(){return this.pool.getDetachedRow()}getRowFor(t){return this.getRowAt(t)??this.getDetachedRow()}setRowIndexInList(t,o){let r=this.rowToIndex.get(t);r!=null&&this.indexToRow.delete(r),o==null?this.rowToIndex.delete(t):(this.rowToIndex.set(t,o),this.indexToRow.set(o,t))}detachStartingWith(t){let o=this.getAttachedIndexes(),r=(0,Hm.default)(o,t,(a,l)=>a-l);r<0&&(r=~r),o.slice(r).forEach(a=>this.detachRowAt(a))}getRowAt(t){return this.indexToRow.get(t)}getRowIndex(t){return this.rowToIndex.get(t)}isRowAttached(t){return this.getRowIndex(t)!=null}isRowAttachedAt(t){return!!this.getRowAt(t)}getList(){let t=Math.max(...this.indexToRow.keys());return Array.from({length:t+1},(r,i)=>{let a=this.indexToRow.get(i);return a?a.getNode():null})}getAttachedCount(){return this.indexToRow.size}forEachAttachedRow(t){this.indexToRow.forEach(t)}getAttachedIndexes(){return Array.from(this.indexToRow.keys()).sort()}getAllRows(){return[...this.pool.getAllRows()]}detachRowAt(t){let o=this.getRowAt(t);o&&(this.setRowIndexInList(o,null),this.pool.detachRow(o))}detachRow(t){let o=this.getRowIndex(t);o!=null&&this.detachRowAt(o)}renderNodeAtRow(t,o,r){let i=this.getRowAt(r);return i&&i!==o&&this.detachRowAt(r),this.pool.attachRow(o),this.setRowIndexInList(o,r),o.update(t),o}makeDetachedRowsEmpty(){this.pool.getDetachedRows().forEach(t=>{t.update(null)})}onRowAttachmentChange(t){return this.pool.onRowAttachmentChange(t)}withDetachedRows(t){this.pool.getDetachedRows().forEach(t)}destroy(){this.reset()}reset(){this.pool.reset(),this.indexToRow.clear(),this.offRemoveRow(),this.offRemoveRow=()=>{}}};var Km=!0,Jn=Y(q.y),Bm=Y(q.scrollTop),wR=Y(q.scrollLeft),X0=Y(q.columnOffsetAtIndex),zs=Y(q.columnOffsetAtIndexWhileReordering),Lo=class extends yt{constructor(t,o,r){o=o||"ReactHeadlessTableRenderer";super(o);this.debugId="";this.destroyed=!1;this.scrolling=!1;this.cellHoverClassNames=[];this.cellDetachedClassNames=[];this.ownsPositionVars=!1;this.lastEnteredRow=-1;this.lastExitedRow=-1;this.hoverRowUpdatesInProgress=new Map;this.infiniteNode=null;this.setDetailTransform=(t,o,{y:r,scrollTop:i,scrollLeft:a})=>{i||(r-=this.brain.getScrollOrigin().scrollTop),t.style.setProperty(Jn,i?`calc( ${r}px + var(${Bm}) )`:`${r}px`),t.style.transform=`translate3d(${a||0}px, var(${Jn}), 0)`};this.setTransform=(t,o,r,{x:i,y:a,scrollLeft:l,scrollTop:s},u)=>{let c=Re.columnOffsets.get(r),d=`${zs}-${r}`,p=s?`calc( ${a}px + var(${Bm}, 0px) )`:`${a-this.brain.getScrollOrigin().scrollTop}px`;t.__currentTransformY!==p&&(t.__currentTransformY=p,t.style.setProperty(Jn,p));let m=`translate3d(${this.ownsPositionVars?l?`calc( ${i}px + var(${wR}, 0px) )`:`${i-this.brain.getScrollOrigin().scrollLeft}px`:`var(${d}, ${c})`}, var(${Jn}), 0)`;if(t.__transformValue!==m&&(t.__transformValue=m,t.style.transform=m),u!=null&&this.ownsPositionVars){let g=`${u}`;t.__zIndex!==g&&(t.__zIndex=g,t.style.zIndex=g)}};this.onScrollOriginChange=()=>{this.destroyed||(this.cellManager.getAllCells().forEach(t=>{this.updateElementPosition(t,void 0,{immediate:!0})}),this.rowManager.forEachAttachedRow(t=>{this.updateDetailElementPosition(t)}),this.adjustFixedElementsOnScroll())};this.cellsDetachedInRenderPass=null;this.getFullyVisibleRowsRange=()=>{let{start:[t],end:[o]}=this.brain.getRenderRange();for(;!this.isRowFullyVisible(t);)if(t++,t===o)return null;for(;!this.isRowFullyVisible(o);)if(o--,o===t)return null;return{start:t,end:o}};this.getScrollPositionForScrollRowIntoView=(t,o={offset:0})=>{if(this.destroyed)return null;let{brain:r}=this,i=r.getScrollPosition(),a=i.scrollLeft,{scrollAdjustPosition:l,offset:s=0}=o;if(this.isRowFullyVisible(t)&&!l)return i;let 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 h=i.scrollTop;if(l==="center"?h=u-Math.floor((r.getAvailableSize().height-d-p)/2):l==="start"?(s=-s,h+=u-f+s-d):(s+=c,h+=u-g+s+p),this.brain.isHorizontalLayoutBrain){let S=o.colIndex??Math.ceil(this.brain.getInitialCols()/2),y=this.getScrollPositionForScrollColumnIntoView(S,{...o,horizontalLayoutPageIndex:this.brain.getPageIndexForRow(t)});y&&(a=y.scrollLeft)}return{scrollLeft:a,scrollTop:h}};this.getScrollPositionForScrollColumnIntoView=(t,o={offset:0})=>{if(this.destroyed)return null;let{brain:r}=this,i=r.getScrollPosition(),a=o.horizontalLayoutPageIndex!=null?{horizontalLayoutPageIndex:o.horizontalLayoutPageIndex}:void 0,{scrollAdjustPosition:l,offset:s=0}=o;if(this.isColumnFullyVisible(t,void 0,a)&&!l)return i;a&&(t=r.getInitialCols()*a.horizontalLayoutPageIndex+t);let 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 h=i.scrollLeft;return l==="center"?h=u-Math.floor((r.getAvailableSize().width-d-p)/2):l==="start"?(s=-s,h+=u-f+s-d):(s+=c,h+=u-g+s+p),{...i,scrollLeft:h}};this.getScrollPositionForScrollCellIntoView=(t,o,r={offsetLeft:0,offsetTop:0})=>{if(this.destroyed)return null;let i=this.getScrollPositionForScrollColumnIntoView(o,{scrollAdjustPosition:r.colScrollAdjustPosition||r.scrollAdjustPosition,offset:r.offsetLeft}),a=this.getScrollPositionForScrollRowIntoView(t,{scrollAdjustPosition:r.rowScrollAdjustPosition||r.scrollAdjustPosition,offset:r.offsetTop});if(!i||!a)return null;let{scrollLeft:l}=i,{scrollTop:s}=a;return{scrollLeft:l,scrollTop:s}};this.isRowFullyVisible=(t,o=2)=>this.isRowVisible(t,this.brain.getRowHeight(t)-o);this.isRowVisible=(t,o=10)=>{if(!this.isRowRendered(t))return!1;t=this.brain.getPageIndexForRow(t)&&this.brain.rowsPerPage?t%this.brain.rowsPerPage:t;let{brain:i}=this;if(i.isRowFixed(t))return!0;let{start:[a],end:[l]}=this.brain.getRenderRange(),s=Math.floor((a+l)/2);if(t<a||t>=l)return!1;if(t>=s){let u=i.getItemAt(i.getAvailableSize().height+i.getScrollPosition().scrollTop-o,"vertical");return t<=u}if(t<s){let u=i.getItemAt(i.getScrollPosition().scrollTop+o,"vertical");return t>=u}return!0};this.isRowRendered=t=>{if(!this.brain.isHorizontalLayoutBrain)return this.cellManager.isRowAttached(t);let o=t;return t=this.brain.rowsPerPage?t%this.brain.rowsPerPage:t,this.cellManager.getCellsForRow(t).filter(r=>r.getAdditionalInfo()?.renderRowIndex===o).length>0};this.isCellVisible=(t,o)=>this.isRowVisible(t)&&this.isColumnVisible(o);this.isCellFullyVisible=(t,o,r)=>this.isRowFullyVisible(t)&&this.isColumnVisible(o,void 0,r);this.isColumnFullyVisible=(t,o=2,r)=>this.isColumnVisible(t,this.brain.getColWidth(t)-o,r);this.isColumnVisible=(t,o=10,r)=>{if(!this.isColumnRendered(t,r))return!1;let{brain:i}=this;if(i.isColFixed(t))return!0;r&&r.horizontalLayoutPageIndex!=null&&(t=i.getVirtualColIndex(t,{pageIndex:r.horizontalLayoutPageIndex}));let{start:[a,l],end:[s,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-o-i.getFixedEndColsWidth(),"horizontal");return t<=d}if(t<c){let d=i.getItemAt(i.getScrollPosition().scrollLeft+o+i.getFixedStartColsWidth(),"horizontal");return t>=d}return!0};this.isCellRendered=(t,o,r)=>this.isRowRendered(t)&&this.isColumnRendered(o,r);this.isColumnRendered=(t,o)=>{let{start:[r]}=this.brain.getRenderRange();return o?.horizontalLayoutPageIndex!=null&&(t=this.brain.getInitialCols()*o.horizontalLayoutPageIndex+t),this.cellManager.isCellAttachedAt([r,t])};this.getExtraSpanCellsForRange=t=>{let{start:o,end:r}=t,[i,a]=o,[l,s]=r;return this.brain.getExtraSpanCellsForRange({horizontal:{startIndex:a,endIndex:s},vertical:{startIndex:i,endIndex:l}})};this.getFixedRanges=t=>{let{fixedRowsStart:o,fixedRowsEnd:r,fixedColsStart:i,fixedColsEnd:a}=this.brain.getFixedCellInfo();if(!o&&!i&&!r&&!a)return[];let l=this.brain.getColCount(),s=this.brain.getRowCount(),{start:u,end:c}=t,[d,p]=u,[f,m]=c,g=[];if(i&&(o&&g.push({rowFixed:"start",colFixed:"start",start:[0,0],end:[o,i]}),r&&g.push({rowFixed:"end",colFixed:"start",start:[s-r,0],end:[s,i]}),g.push({rowFixed:!1,colFixed:"start",start:[d,0],end:[f,i]})),a&&(o&&g.push({colFixed:"end",rowFixed:"start",start:[0,l-a],end:[o,l]}),r&&g.push({colFixed:"end",rowFixed:"end",start:[s-r,l-a],end:[s,l]}),g.push({colFixed:"end",rowFixed:!1,start:[d,l-a],end:[f,l]})),o){let h={start:[0,p],end:[o,m],rowFixed:"start",colFixed:!1};g.push(h)}if(r){let h={rowFixed:"end",colFixed:!1,start:[s-r,p],end:[s,m]};g.push(h)}return g};this.isCellFixed=(t,o)=>{let{fixedRowsStart:r,fixedRowsEnd:i,fixedColsStart:a,fixedColsEnd:l}=this.brain.getFixedCellInfo(),s=this.brain.getColCount(),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(o<a&&(d=!0,p="start"),l&&!d){let f=s-l;o>=f&&(d=!0,p="end")}return{row:c?p:!1,col:d?p:!1}};this.isCellCovered=(t,o)=>{let r=this.brain.getRowspanParent(t,o),i=this.brain.getColspanParent(t,o),a=r!=t,l=i!=o;return a||l?[r,i]:!1};this.onMouseEnterNotBound=t=>{let o=this.getMatrixRowIndexFromElement(t.currentTarget);this.onMouseEnter(o)};this.onMouseLeaveNotBound=t=>{let o=this.getMatrixRowIndexFromElement(t.currentTarget);this.onMouseLeave(o)};this.onMouseEnter=t=>{this.lastEnteredRow=t,this.lastExitedRow=-1,!this.scrolling&&t!=-1&&this.addHoverClass(t)};this.addHoverClass=t=>{this.cellManager.getCellsForRow(t).forEach(o=>{let r=o.getElement();r&&this.cellHoverClassNames.forEach(i=>{r.classList.add(i)})})};this.onMouseLeave=t=>{this.lastExitedRow=t,this.lastEnteredRow=-1,!this.scrolling&&t!=-1&&this.removeHoverClass(t)};this.removeHoverClass=t=>{this.cellManager.getCellsForRow(t).forEach(o=>{let r=o.getElement();r&&this.cellHoverClassNames.forEach(i=>{r.classList.remove(i)})})};this.updateHoverClassNamesForRow=t=>{if(this.scrolling||this.hoverRowUpdatesInProgress.has(t))return;this.hoverRowUpdatesInProgress.set(t,!0);let o=()=>{!this.scrolling&&this.lastEnteredRow!=-1&&(this.lastEnteredRow===t?this.addHoverClass(t):this.removeHoverClass(t))};Ge(()=>{this.destroyed||(o(),this.hoverRowUpdatesInProgress.delete(t))})};this.updateElementPosition=(t,o,r)=>{if(this.destroyed)return;let i=t.getElement(),a=this.cellManager.getCellPosition(t);if(!a)return;let[l,s]=a,u=this.brain.getCellOffset(l,s);if(u==null)return;let{x:c,y:d}=u;if(i){let p=()=>{this.updateHoverClassNamesForRow(l);let f=this.getCellRealCoordinates(l,s);if(i.dataset.rowIndex=f.rowIndex,i.dataset.colIndex=f.colIndex,Km){let m=this.ownsPositionVars?this.getFixedCellPlacement(l,s,{x:c,y:d}):null;this.setTransform(i,l,s,m??{x:c,y:d},null),i.style.willChange="transform",i.style.backfaceVisibility="hidden";let h=(o?o.hidden:!!this.isCellCovered(l,s))?"-1":m?`${m.zIndex}`:i.dataset.zIndex||"auto";i.__zIndex!==h&&(i.__zIndex=h,i.style.zIndex=h)}else i.style.display="",i.style.left=`${c}px`,i.style.top=`${d}px`};this.scrolling&&this.brain.isHorizontalLayoutBrain&&!r?.immediate?t.setPendingAfterCommitWork(p):p()}};this.updateDetailElementPosition=t=>{if(this.destroyed)return;let o=t.getElement(),r=this.rowManager.getRowIndex(t);if(r==null)return;let i=this.brain.getItemOffsetFor(r,"vertical");if(i==null)return;let a=i;o&&(o.dataset.detailRowIndex=r,Km&&(this.setDetailTransform(o,r,{y:a,scrollLeft:this.brain.getDOMScrollPosition().scrollLeft}),o.style.willChange="transform",o.style.backfaceVisibility="hidden",o.style.zIndex=o.dataset.zIndex||"auto"))};this.onScrollStart=()=>{this.scrolling=!0,this.lastEnteredRow!=-1&&this.removeHoverClass(this.lastEnteredRow)};this.onScrollStop=()=>{this.scrolling=!1,this.flushPendingAfterCommitWork(),this.lastEnteredRow!=-1&&this.addHoverClass(this.lastEnteredRow),this.lastExitedRow!=-1&&this.removeHoverClass(this.lastExitedRow)};this.adjustFixedElementsOnScroll=(t=this.brain.getScrollPosition())=>{let{brain:o,cellManager:r,rowManager:i}=this,a=this.brain.getColCount(),l=this.brain.getRowCount(),{fixedColsStart:s,fixedColsEnd:u,fixedRowsStart:c,fixedRowsEnd:d}=this.brain.getFixedCellInfo();if(i.getAttachedCount()&&i.forEachAttachedRow(I=>{let T=i.getRowIndex(I);if(T!=null){let R=this.brain.getItemOffsetFor(T,"vertical");if(R==null)return;let v=I.getElement();if(!v)return;this.setDetailTransform(v,T,{y:R,scrollLeft:o.getDOMScrollPosition(t).scrollLeft})}}),!s&&!u&&!c&&!d)return;let p=this.cellManager.getOneAttachedCell();p&&ip(o.getDOMScrollPosition(t),this.ownsPositionVars?p.getElement()?.parentElement??null:this.getInfiniteNode(p.getElement()));let f={cols:this.brain.getFixedEndColsOffsets({skipScroll:!0}),rows:this.brain.getFixedEndRowsOffsets({skipScroll:!0})},{start:m,end:g}=this.brain.getRenderRange(),[h,S]=m,[y,C]=g,b=(I,T)=>{let R=r.getCellAt([I,T])?.getElement(),v=R?o.getCellOffset(I,T):null;if(!R||!v)return;let w=this.getFixedCellPlacement(I,T,v,f);w&&this.setTransform(R,I,T,w,w.zIndex)};if(s||u)for(let I=h;I<y;I++){for(let T=0;T<s;T++)b(I,T);if(u){let T=a-u;for(let R=T;R<a;R++)b(I,R)}}if(c||d)for(let I=S;I<C;I++){for(let T=0;T<c;T++)b(T,I);if(d){let T=l-d;for(let R=T;R<l;R++)b(R,I)}}if(s&&c)for(let I=0;I<c;I++)for(let T=0;T<s;T++)b(I,T);if(s&&d){let I=l-d;for(let T=I;T<l;T++)for(let R=0;R<s;R++)b(T,R)}if(u&&c){let I=a-u;for(let T=0;T<c;T++)for(let R=I;R<a;R++)b(T,R)}if(u&&d){let I=l-d,T=a-u;for(let R=I;R<l;R++)for(let v=T;v<a;v++)b(R,v)}};this.flushPendingAfterCommitWork=()=>{this.destroyed||this.cellManager.flushPendingAfterCommitWork()};this.destroy=()=>{this.destroyed||(this.destroyed=!0,this.reset(),this.onDestroy(),this.hoverRowUpdatesInProgress.clear(),this.hoverRowUpdatesInProgress=null,this.brain=null)};this.brain=t,this.debugId=o,this.cellManager=new ra(o,r.cellPool),this.cellManager.onCellAttachmentChange((c,d)=>{d?this.onCellAttached(c):this.onCellDetached(c)}),this.rowManager=new ia(o,r.rowPool),this.rowManager.onRowAttachmentChange((c,d)=>{d?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),u=t.onScrollOriginChange(this.onScrollOriginChange);this.onDestroy=()=>{u(),i(),a(),l(),s()}}getInfiniteNode(t){return this.infiniteNode||(this.infiniteNode=Ul(t)),this.infiniteNode}onCellAttached(t){if(!this.cellsDetachedInRenderPass?.delete(t)&&this.cellDetachedClassNames.length){let o=t.getElement();o&&this.cellDetachedClassNames.forEach(r=>{o.classList.remove(r)})}}onCellDetached(t){if(this.cellsDetachedInRenderPass){this.cellsDetachedInRenderPass.add(t);return}this.addDetachedClassNames(t)}addDetachedClassNames(t){if(this.cellDetachedClassNames.length){let o=t.getElement();o&&this.cellDetachedClassNames.forEach(r=>{o.classList.add(r)})}}onRowAttached(t){if(this.cellDetachedClassNames.length){let o=t.getElement();o&&this.cellDetachedClassNames.forEach(r=>{o.classList.remove(r)})}}onRowDetached(t){if(this.cellDetachedClassNames.length){let o=t.getElement();o&&this.cellDetachedClassNames.forEach(r=>{o.classList.add(r)})}}isCellRenderedAndMappedCorrectly(t,o){let r=!!this.cellManager.getCellAt([t,o]);return{rendered:r,mapped:r}}renderRange(t,o){if(this.destroyed)return[];if(this.cellsDetachedInRenderPass)return this.renderRangeInternal(t,o);let r=this.cellsDetachedInRenderPass=new Set;try{return this.renderRangeInternal(t,o)}finally{this.cellsDetachedInRenderPass=null,r.forEach(i=>this.addDetachedClassNames(i))}}renderRangeInternal(t,{renderCell:o,renderDetailRow:r,force:i,onRender:a}){let{start:l,end:s}=t,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 P=t.start[1],x=t.end[1];m.forEach(M=>{P<=M&&M<x||f.push({start:[t.start[0],M],end:[t.end[0],M+1]})})}let g=new Map,h=f.map(this.getExtraSpanCellsForRange).flat();h&&h.forEach(([P,x])=>{g.set(`${P}:${x}`,!0)});let S=f.reduce((P,x)=>P+Ls(x),0),y=r?f.reduce((P,x)=>P+zm(x),0):0,C=this.brain.getRowCount(),b=this.brain.getColCount();d.detachCellsStartingAt([C,b]);let I=Math.min(C*b,S);r&&(c.detachStartingWith(this.brain.getRowCount()),c.poolSize>y&&(c.poolSize=y));let T=Vm(...f.map(P=>d.getCellsOutsideRenderRange(P)));T=Gm(T,P=>{let x=d.getCellPosition(P);return!(x&&g.has(`${x[0]}:${x[1]}`))}),d.detachCells(T),d.poolSize=I;let R=new Map,v=new Map;f.forEach(P=>{let{start:x,end:M}=P,[D,E]=x,[L,V]=M;for(let N=D;N<L;N++){for(let F=E;F<V;F++){let B=`${N}:${F}`;if(R.has(B))continue;R.set(B,!0);let{rendered:$,mapped:_}=this.isCellRenderedAndMappedCorrectly(N,F);if(N===D||F===E){let z=this.isCellCovered(N,F);if(z&&g.has(`${z[0]}:${z[1]}`)){let Z=d.getCellAt([N,F]);Z!=null&&d.detachCell(Z);continue}}if($&&!i&&_)continue;let H;$?H=d.getCellAt([N,F]):H=d.getCellFor([N,F],u?"row":"column"),H==null&&(H=d.getDetachedCell()),this.renderCellAt(N,F,H,o)}!r||v.has(N)||(v.set(N,!0),c.isRowAttachedAt(N)&&!i)||this.renderDetailRowAtElement(N,this.rowManager.getRowFor(N),r)}}),h.forEach(([P,x])=>{let{rendered:M,mapped:D}=this.isCellRenderedAndMappedCorrectly(P,x);if(M){if(i||!D){let L=[P,x],V=d.getCellAt(L);this.renderCellAt(P,x,V,o)}return}let E=d.getCellFor([P,x],u?"row":"column");E!=null&&this.renderCellAt(P,x,E,o)});let w=d.getAllCells().map(P=>P.getNode());return r&&c.getAllRows().forEach(P=>{w.push(P.getNode())}),this.adjustFixedElementsOnScroll(),a&&a(w),w}renderDetailRowAtElement(t,o,r){if(this.destroyed)return;let i=!1,a=this.brain.getRowHeight(t),l=this.brain.isRowFixedStart(t)?"start":this.brain.isRowFixedEnd(t)?"end":!1,u=r({rowIndex:t,height:a,rowFixed:l,hidden:!!i,onMouseEnter:()=>{},onMouseLeave:()=>{},domRef:o.ref});if(o.isMounted()||o.onMount(c=>{let d=c.getElement();d&&(d.style.position="absolute",d.style.left="0px"),this.updateDetailElementPosition(c)}),!u){this.rowManager.detachRow(o);return}this.rowManager.renderNodeAtRow(u,o,t),this.updateDetailElementPosition(o)}getCellRealCoordinates(t,o){return{rowIndex:t,colIndex:o}}getMatrixRowIndexFromElement(t){let o=Number(t.dataset.rowIndex);return this.brain.isHorizontalLayoutBrain?this.brain.getRowIndexInPage(o):o}renderCellAt(t,o,r,i){if(this.destroyed)return;let a=this.isCellCovered(t,o),l=this.brain.getRowHeight(t),s=this.brain.getColWidth(o),u=this.brain.getRowspan(t,o),c=this.brain.getColspan(t,o),d=u===1?l:this.brain.getRowHeightWithSpan(t,o,u),p=c===1?s:this.brain.getColWidthWithSpan(t,o,c),{row:f,col:m}=this.isCellFixed(t,o),g=!!a,{rowIndex:h,colIndex:S}=this.getCellRealCoordinates(t,o),y=i({rowIndex:h,colIndex:S,height:l,width:s,rowspan: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(I=>{let T=I.getElement();T&&(T.style.position="absolute",T.style.left="0px",T.style.top="0px"),this.updateElementPosition(I)});let C=this.brain.isHorizontalLayoutBrain?{renderRowIndex:h,renderColIndex:S}:void 0,b=this.brain.isHorizontalLayoutBrain;if(!y){b?this.cellManager.detachCell(r):this.cellManager.detachCell(r);return}this.cellManager.renderNodeAtCell(y,r,[t,o],C),this.updateElementPosition(r,{hidden:g,rowspan:u,colspan:c})}getFixedCellPlacement(t,o,{x:r,y:i},a){let{fixedRowsStart:l,fixedRowsEnd:s,fixedColsStart:u,fixedColsEnd:c}=this.brain.getFixedCellInfo(),d=this.brain.getColCount(),p=this.brain.getRowCount(),f=o<u,m=!f&&!!c&&o>=d-c,g=t<l,h=!g&&!!s&&t>=p-s,S=f||m,y=g||h;if(!S&&!y)return null;m&&(r=(a?.cols??this.brain.getFixedEndColsOffsets({skipScroll:!0}))[o]),h&&(i=(a?.rows??this.brain.getFixedEndRowsOffsets({skipScroll:!0}))[t]);let C=S&&y?f?g?1e5:2e5:g?3e5:4e5:f?u-o:m?d-o:g?l-t:p-t;return{x:r,y:i,scrollLeft:S,scrollTop:y,zIndex:C}}reset(){this.cellManager.reset(),this.rowManager.reset()}};var aa=class extends Lo{constructor(t,o,r){super(t,o,r);this.setTransform=(t,o,r,i,a)=>{let l=this.getCellRealCoordinates(o,r),{y:s}=i,u=Math.floor(l.rowIndex/this.brain.rowsPerPage)-this.brain.getScrollOriginPageIndex(),c=de.runtime.totalVisibleColumnsWidthVar,d=u?`calc(${c} * ${u})`:"0px",p=Re.columnOffsets.get(l.colIndex),f=`${zs}-${l.colIndex}`,m=`${s}px`;t.__currentTransformY!==m&&(t.__currentTransformY=m,t.style.setProperty(Jn,m));let g=`calc(var(${f}, ${p}) + ${d})`,h=`var(${Jn})`,S=`translate3d(${g}, ${h}, 0px)`;t.__transformValue!==S&&(t.__transformValue=S,t.style.transform=S)};this.brain=t}getCellRealCoordinates(t,o){return this.brain.getHorizontalLayoutPositionFromMatrixCoordinates({rowIndex:t,colIndex:o})}isCellRenderedAndMappedCorrectly(t,o){let r=this.cellManager.getCellAt([t,o]),i=!!r;if(!i)return{rendered:i,mapped:!1};let a=r.getAdditionalInfo();if(!a)return{rendered:i,mapped:!1};let l=this.getCellRealCoordinates(t,o),s=l.colIndex===a.renderColIndex&&l.rowIndex===a.renderRowIndex;return{rendered:i,mapped:s}}};import*as jm from"react";var ko=class ko extends yt{constructor(t){super(t);this.cellRemoveSubscription=he();this.cellAttachmentChangeSubscription=he();this.attachedCells=new Set,this.detachedCells=new Set,this.allCellsOrdered=new Set}destroy(){this.reset()}onRemoveCell(t){return this.cellRemoveSubscription.onChange(r=>{r!=null&&t(r)})}onCellAttachmentChange(t){return this.cellAttachmentChangeSubscription.onChange(r=>{if(r==null)return;let{cell:i,attached:a}=r;t(i,a)})}reset(){this.attachedCells.clear(),this.detachedCells.clear(),this.allCellsOrdered.clear(),this.cellRemoveSubscription.destroy(),this.cellAttachmentChangeSubscription.destroy()}getAttachedCells(){return this.attachedCells}getDetachedCells(){return this.detachedCells}getAllCells(){return this.allCellsOrdered}createCell(){let t=this.createCellInstance();return this.detachedCells.add(t),this.allCellsOrdered.add(t),t}removeCell(t){this.detachedCells.delete(t),this.attachedCells.delete(t),this.allCellsOrdered.delete(t),t.destroy(),this.cellRemoveSubscription(t)}attachCell(t){return t&&this.attachedCells.has(t)||(t||(t=this.getDetachedCell()),this.detachedCells.delete(t),this.attachedCells.add(t),this.cellAttachmentChangeSubscription({cell:t,attached:!0})),t}detachCell(t){return this.detachedCells.has(t)?!1:(this.attachedCells.delete(t),this.detachedCells.add(t),this.cellAttachmentChangeSubscription({cell:t,attached:!1}),!0)}getDetachedCell(){let{detachedCells:t}=this,o=t.values().next().value;return o||(this.poolSize+=ko.POOL_SIZE_INCREMENT,o=t.values().next().value),o||this.error("No cells available in the pool!"),o}get attachedSize(){return this.attachedCells.size}get detachedSize(){return this.detachedCells.size}get poolSize(){return this.allCellsOrdered.size}flushPendingAfterCommitWork(){for(let t of this.attachedCells)t.flushPendingAfterCommitWork()}set poolSize(t){t=Math.ceil(t/ko.POOL_SIZE_INCREMENT)*ko.POOL_SIZE_INCREMENT;let o=this.poolSize;if(t===o)return;let{detachedCells:r}=this,i=o-t;if(i>0){i>r.size&&(i=r.size,this.debug("Trying to destroy more cells than are currently detached!"));let a=r.values();for(;i>0;){let l=a.next().value;this.removeCell(l),i--}}else for(i=-i;i>0;)this.createCell(),i--}};ko.POOL_SIZE_INCREMENT=1;var la=ko;var Wm=new Map,vR=()=>{},Vs=class{constructor(e,t){this.element=null;this.mounted=!1;this.pendingAfterCommitWork=null;this.mountSubscription=he();let o=Wm.get(e)??0,r=`${e}:GridCellReact:${o}`;Wm.set(e,o+1),this.debugId=r,this.cellInfo=t,this.updater=he(),this.node=jm.createElement(En,{key:r,name:r,updater:this.updater}),this.ref=i=>{this.element=i,i?(this.mounted=!0,this.mountSubscription(this)):this.mounted=!1}}setPendingAfterCommitWork(e){this.pendingAfterCommitWork=e}flushPendingAfterCommitWork(){if(this.pendingAfterCommitWork){let e=this.pendingAfterCommitWork;this.pendingAfterCommitWork=null,e()}}isMounted(){return this.mounted}onMount(e){return this.mountSubscription.onChange(o=>{o!=null&&e(o)})}destroy(){this.mountSubscription.destroy(),this.updater.destroy(),this.pendingAfterCommitWork=null,this.ref=vR,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 Vs(this.cellDebugId)}};import*as $m from"react";var zo=class zo extends yt{constructor(t){super(t);this.rowRemoveSubscription=he();this.rowAttachmentChangeSubscription=he();this.attachedRows=new Set,this.detachedRows=new Set,this.allRowsOrdered=new Set}destroy(){this.reset()}onRemoveRow(t){return this.rowRemoveSubscription.onChange(r=>{r!=null&&t(r)})}onRowAttachmentChange(t){return this.rowAttachmentChangeSubscription.onChange(r=>{if(r==null)return;let{row:i,attached:a}=r;t(i,a)})}reset(){this.attachedRows.clear(),this.detachedRows.clear(),this.allRowsOrdered.clear(),this.rowRemoveSubscription.destroy(),this.rowAttachmentChangeSubscription.destroy()}getAttachedRows(){return this.attachedRows}getDetachedRows(){return this.detachedRows}getAllRows(){return this.allRowsOrdered}createRow(){let t=this.createRowInstance();return this.detachedRows.add(t),this.allRowsOrdered.add(t),t}removeRow(t){this.detachedRows.delete(t),this.attachedRows.delete(t),this.allRowsOrdered.delete(t),t.destroy(),this.rowRemoveSubscription(t)}attachRow(t){return t&&this.attachedRows.has(t)||(t||(t=this.getDetachedRow()),this.detachedRows.delete(t),this.attachedRows.add(t),this.rowAttachmentChangeSubscription({row:t,attached:!0})),t}detachRow(t){return this.detachedRows.has(t)?!1:(this.attachedRows.delete(t),this.detachedRows.add(t),this.rowAttachmentChangeSubscription({row:t,attached:!1}),!0)}getDetachedRow(){let{detachedRows:t}=this,o=t.values().next().value;return o||(this.poolSize+=zo.POOL_SIZE_INCREMENT),o=t.values().next().value,o||this.error("No rows available in the pool!"),o}get attachedSize(){return this.attachedRows.size}get detachedSize(){return this.detachedRows.size}get poolSize(){return this.allRowsOrdered.size}set poolSize(t){t=Math.ceil(t/zo.POOL_SIZE_INCREMENT)*zo.POOL_SIZE_INCREMENT;let o=this.poolSize;if(t===o)return;let{detachedRows:r}=this,i=o-t;if(i>0){i>r.size&&(i=r.size,this.debug("Trying to destroy more rows than are currently detached!"));let a=r.values();for(;i>0;){let l=a.next().value;this.removeRow(l),i--}}else for(i=-i;i>0;)this.createRow(),i--}};zo.POOL_SIZE_INCREMENT=1;var ua=zo;var Um=new Map,PR=()=>{},Gs=class{constructor(e){this.element=null;this.mounted=!1;this.mountSubscription=he();let t=Um.get(e)??0,o=`${e}:ListRowReact:${t}`;Um.set(e,t+1),this.debugId=o,this.updater=he(),this.node=$m.createElement(En,{key:`detail-row-${o}`,name:`detail-row-${o}`,updater:this.updater}),this.ref=r=>{this.element=r,r?(this.mounted=!0,this.mountSubscription(this)):this.mounted=!1}}isMounted(){return this.mounted}onMount(e){return this.mountSubscription.onChange(o=>{o!=null&&e(o)})}destroy(){this.mountSubscription.destroy(),this.updater.destroy(),this.ref=PR,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 Gs(this.rowDebugId)}};function Ym(n){return{cellPool:new sa(n),rowPool:new ca(n)}}function vr(n){let e=n.isHorizontalLayoutBrain?new aa(n,`${n.name}:HorizontalLayoutTableRenderer`,Ym(`${n.name}:HorizontalLayoutTableRenderer`)):new Lo(n,`${n.name}:ReactHeadlessTableRenderer`,Ym(`${n.name}:ReactHeadlessTableRenderer`)),t=he();return n.onDestroy(()=>{e.destroy(),t.destroy()}),{renderer:e,onRenderUpdater:t}}function xR(n){let e=vr(n);return e.renderer.ownsPositionVars=!0,e}function MR(n){let{brain:e,renderCell:t,renderDetailRow:o,forceRerenderTimestamp:r}=n,{renderer:i,onRenderUpdater:a}=DR(()=>n.onRenderUpdater&&n.renderer?{renderer:n.renderer,onRenderUpdater:n.onRenderUpdater}:xR(e),[e,n.onRenderUpdater,n.renderer]);return da(()=>{i.cellHoverClassNames=n.cellHoverClassNames||[]},[i,n.cellHoverClassNames]),da(()=>{i.cellDetachedClassNames=n.cellDetachedClassNames||[]},[i,n.cellDetachedClassNames]),da(()=>{let l=e.getRenderRange();return i.renderRange(l,{onRender:a,force:!0,renderCell:t,renderDetailRow:o}),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:o})})},[i,e,t,o,a,r]),da(()=>{i.flushPendingAfterCommitWork()}),pa.createElement(En,{updater:a})}var fa=pa.memo(MR);import*as Pr from"react";import{useEffect as ER,useLayoutEffect as AR,useRef as tg}from"react";var qm=me({defaultClassName:"nxbq1c1 _16lm1iwz _16lm1iw2",variantClassNames:{visible:{true:"nxbq1c3",false:"nxbq1c4"}},defaultVariants:{},compoundVariants:[]}),ma="nxbq1c0 _16lm1iwz _16lm1iw4 _16lm1iw26 _16lm1iw23 _16lm1iw1y _16lm1iw1k";var Xm=me({defaultClassName:"j26lrx0 _16lm1iwz _16lm1iw2 _16lm1iw23 _16lm1iw26",variantClassNames:{active:{true:"j26lrx2",false:"j26lrx3"}},defaultVariants:{},compoundVariants:[]});function Zm(n,e){let t=e-n.getScrollOriginPageIndex();return t?`calc(${de.runtime.totalVisibleColumnsWidthVar} * ${t})`:null}function Qm(n,e){let t="0px",o=e;n.isHorizontalLayoutBrain&&n.rowsPerPage&&(t=Zm(n,n.getPageIndexForRow(o))??"0px",o=o%n.rowsPerPage);let r=n.getRowHeight(o),i=n.getItemOffsetFor(o,"vertical")-n.getScrollOrigin().scrollTop;return{activeCellRowHeight:`${r}px`,activeCellRowOffset:`${i}px`,activeCellRowOffsetX:t}}function Jm(n,e){let{scrollTop:t,scrollLeft:o}=n.getDOMScrollPosition(e);return{scrollTopForActiveRow:`${-t}px`,scrollLeftForActiveRowWhenHorizontalLayout:n.isHorizontalLayoutBrain?`${-o}px`:"0px"}}function eg(n,e,t){let[o]=e,r=e[1],i;if(n.isHorizontalLayoutBrain&&n.rowsPerPage){let u=Re.columnOffsets.get(r),c=Zm(n,n.getPageIndexForRow(o));i=c?`calc( ${c} + ${u})`:u,o=o%n.rowsPerPage}let a=typeof t=="function"?t(o):t??n.getRowHeight(o),l=n.getItemOffsetFor(o,"vertical")-n.getScrollOrigin().scrollTop,s={activeCellRowHeight:`${a}px`,activeCellRowOffset:`${l}px`};return i!==void 0&&(s.activeCellColOffset=i),s}var{rootClassName:_R}=ke,OR=`${_R}-ActiveRowIndicator`,FR=`calc(${q.activeCellRowOffsetX} + var(${Y(q.scrollLeftForActiveRowWhenHorizontalLayout)}, 0px))`,NR={[Y(q.activeCellOffsetY)]:q.activeCellRowOffset,transform:`translate3d(${FR}, calc( ${q.activeCellOffsetY} + var(${Y(q.scrollTopForActiveRow)}, 0px)), 0px)`,height:q.activeCellRowHeight,maxWidth:de.runtime.totalVisibleColumnsWidthVar},LR=n=>{let{brain:e}=n,t=tg(null),o=n.activeRowIndex!=null&&e.getInitialRows()>n.activeRowIndex,[r,i]=Vt(),a=tg(n.activeRowIndex);a.current=n.activeRowIndex;let l=()=>{let s=a.current;s==null||!t.current||Co(Qm(e,s),t.current)};return AR(l,[n.activeRowIndex,e]),ER(()=>{let s=p=>{Co(Jm(e,p),t.current)};s(e.getScrollPosition());let u=e.onScroll(s),c=e.onRenderCountChange(i),d=e.onScrollOriginChange(l);return()=>{d(),c(),u()}},[e]),Pr.createElement("div",{className:ma,"data-name":"active-row"},Pr.createElement("div",{ref:t,"data-name":"active-row-indicator",className:`${OR} ${Xm({active:o})}`,style:o?NR:void 0}))},ng=Pr.memo(LR);import*as Dr from"react";import{useEffect as kR,useLayoutEffect as zR,useRef as og}from"react";var{rootClassName:VR}=ke,GR=`${VR}-ActiveCellIndicator`,HR=Y(q.columnZIndexAtIndex),rg=(n,e,t,o)=>{e!=null&&Co(eg(n,e,t),o.current)},KR=n=>{let{brain:e}=n,[t,o]=Vt(),r=og(null),i=n.activeCellIndex!=null&&e.getInitialRows()>n.activeCellIndex[0];zR(()=>{rg(e,n.activeCellIndex,n.rowHeight,r)},[n.activeCellIndex,n.rowHeight,e]);let a=og(n);return a.current=n,kR(()=>{let l=e.onRenderCountChange(()=>{o()}),s=e.onScrollOriginChange(()=>{let{activeCellIndex:u,rowHeight:c}=a.current;rg(e,u,c,r)});return()=>{l(),s()}},[e]),Dr.createElement("div",{className:ma,ref:r,"data-name":"active-cell",style:i?{zIndex:`var(${HR}-${n.activeCellIndex[1]})`}:void 0},Dr.createElement("div",{"data-name":"active-cell-indicator",className:`${GR} ${qm({visible:i})}`}))},ig=Dr.memo(KR);var ga=[pf,`${nt}DetachedCell`];function ha(n,e,t){t&&(t.fixedColsStart||t.fixedColsEnd||t.fixedRowsStart||t.fixedRowsEnd)&&n.updateFixedCells({fixedColsStart:t.fixedColsStart,fixedColsEnd:t.fixedColsEnd,fixedRowsStart:t.fixedRowsStart,fixedRowsEnd:t.fixedRowsEnd}),n.update({height:e.height,width:e.width,cols:e.cols,rows:e.rows,colWidth:e.colWidth,rowHeight:e.rowHeight,rowspan:e.rowspan,colspan:e.colspan})}var jR=U(xm,_s);function sg(n){let{brain:e,scrollerDOMRef:t,scrollStopDelay:o,renderCell:r,renderDetailRow:i,activeCellRowHeight:a,cellHoverClassNames:l,renderer:s,activeRowIndex:u,activeCellIndex:c,onRenderUpdater:d,wrapRowsHorizontally:p,forceRerenderTimestamp:f,scrollVarHostRef:m,...g}=n,{autoFocus:h}=g,S=lg(null),[y,C]=WR({width:0,height:0});Hs(()=>{o!=null&&e.setScrollStopDelay(o)},[o,e]),Hs(()=>{let R=S.current?.parentNode;return R?(h&&document.activeElement!==R&&R.focus(),uo(R,()=>{let P={height:R.clientHeight,width:R.clientWidth};e.update(P)},{debounce:50})):void 0},[p,e]);let b=ag(R=>{let v=e.getDOMScrollPosition(R);requestAnimationFrame(()=>{S.current&&S.current.style.setProperty("transform",`translate3d(${-v.scrollLeft}px, ${-v.scrollTop}px, 0px)`)})},[e]),I=ag(R=>{e.setScrollPosition(e.toContentScrollPosition(R),b)},[e,b]);Hs(()=>{let R=e.onRenderCountChange(()=>{C(e.getNativeScrollSize())});return C(e.getNativeScrollSize()),b(e.getScrollPosition()||{scrollLeft:0,scrollTop:0}),R},[e]);let T=lg({brain:e,vertical:1,horizontal:1});return BR(()=>{let R=T.current,v=e.getScrollRatio("vertical"),w=e.getScrollRatio("horizontal");T.current={brain:e,vertical:v,horizontal:w};let P=S.current?.parentElement;if(!P||R.brain!==e||R.vertical===v&&R.horizontal===w)return;let x=e.toNativeScrollPosition(e.getScrollPosition());R.vertical!==v&&(P.scrollTop=x.scrollTop),R.horizontal!==w&&(P.scrollLeft=x.scrollLeft)},[y,e]),eo.createElement(Nm,{onContainerScroll:I,...g,ref:t},eo.createElement("div",{ref:S,className:jR,"data-name":"scroll-transform-target"},eo.createElement(fa,{forceRerenderTimestamp:f,renderer:s,onRenderUpdater:d,renderCell:r,renderDetailRow:i,brain:e,cellHoverClassNames:l,cellDetachedClassNames:ga}),c!=null?eo.createElement(ig,{brain:e,rowHeight:a,activeCellIndex:c}):null),u!=null?eo.createElement(ng,{brain:e,activeRowIndex:u}):null,eo.createElement(Dm,{width:y.width,height:y.height}))}import*as _n from"react";import{useCallback as hg,useEffect as QR,useMemo as JR,useRef as ew}from"react";import*as Bs from"react";import*as pg from"react";import{useCallback as dg}from"react";import{useRef as ug,useState as UR}from"react";import*as xr from"react";var{rootClassName:$R}=ke,YR=`${$R}HeaderCell_ResizeHandle`;function qR(n){let e=ug(null),[t,o]=UR(!1),r=ug(t);r.current=t;let i=n.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,h=em(n.groupColumns.map(b=>b.computedVisibleIndex),{columns:n.columns,domRef:e}),S=b=>{a==="end"&&(b*=-1);let{constrained:I,adjustedDiffs:T,adjustedDiff:R}=n.computeResize(b);return r.current!==I&&o(I),h.resize(T),R},y=b=>{if(g){let I=n.groupColumns.reduce((v,w)=>v+w.computedWidth-w.computedMinWidth,0),T=n.brain.getAvailableSize(),R={width:T.width+I,height:T.height};n.brain.update(R),g=!1}S(Math.round(b.clientX-f))},C=b=>{m.releasePointerCapture(p),m.removeEventListener("pointermove",y),m.removeEventListener("pointerup",C);let I=Math.round(b.clientX-f),T=S(I);h.resize(n.groupColumns.map(()=>0)),n.onResize(T)};m.addEventListener("pointermove",y),m.addEventListener("pointerup",C)},c=(a===!1||a==="start")&&s?{right:a==="start"?void 0:de.components.HeaderCell.resizeHandleWidth}:a==="end"&&l?{right:void 0}:void 0;return xr.createElement("div",{ref:e,className:`${YR} ${Yi} ${Xi({computedPinned:a,computedFirstInCategory:l,computedLastInCategory:s})}`,onPointerDown:u},xr.createElement("div",{style:{...c,...n.style},className:qi({constrained:t})}))}var cg=xr.memo(qR);function fg(n,e){let{bodyBrain:t,groupHeight:o,columnGroup:r,columnGroupsMaxDepth:i}=e,{computedVisibleColumns:a,getState:l,getComputed:s,actions:u}=J(g=>({computedVisibleColumns:g.computed.computedVisibleColumns,getState:g.getState,getComputed:g.getComputed,actions:g.actions})),c=n[n.length-1],d=dg(g=>{let h=l(),{columnSizing:S,viewportReservedWidth:y,bodySize:C}=h,b=s().computedVisibleColumns,I=!1,T=b.reduce((w,P)=>(P.computedFlex&&(w[P.id]={...S[P.id],flex:P.computedWidth},I=!0),w),{}),R=I?{...S,...T}:S;return kd({availableSize:Rs(C),reservedWidth:y||0,dragHandleOffset:g,dragHandlePositionAfter:c.computedVisibleIndex,columnSizing:R,columnGroupSize:n.length,items:b.map(w=>({id:w.id,resizable:w.computedResizable,computedFlex:w.computedFlex,computedWidth:w.computedWidth,computedMinWidth:w.computedMinWidth,computedMaxWidth:w.computedMaxWidth}))})},[c]),p=dg(g=>{let{columnSizing:h,reservedWidth:S}=d(g);u.viewportReservedWidth=S,u.columnSizing=h},[d]);return n.some(g=>g.computedResizable)?pg.createElement(cg,{brain:t,style:{height:o*(i-r.depth+2)},columns:a,groupColumns:n,computeResize:d,onResize:p}):null}var Ks=`${nt}HeaderGroup`,mg=Y(q.columnWidthAtIndex),XR=Y(q.columnZIndexAtIndex);function gg(n){let{columnGroup:e,height:t,columns:o,bodyBrain:r,columnGroupsMaxDepth:i}=n,{header:a,style:l}=e;a instanceof Function&&(a=a({columnGroup:e,horizontalLayoutPageIndex:n.horizontalLayoutPageIndex}));let s=e.uniqueGroupId.join(","),u=Yd(g=>g.state.focusedHeaderItem?.type==="group"&&g.state.focusedHeaderItem.key===s),c=fg(o,{bodyBrain:r,groupHeight:t,columnGroup:e,columnGroupsMaxDepth:i}),d=o[0],p=o.length>1?"calc( "+o.map(g=>`var(${mg}-${g.computedVisibleIndex})`).join(" + ")+" )":`var(${mg}-${d.computedVisibleIndex})`,f=`calc(var(${XR}-${d.computedVisibleIndex}) + ${i-e.depth})`,m=typeof l=="function"?l({columnGroup:e,horizontalLayoutPageIndex:n.horizontalLayoutPageIndex}):l;return m=m&&typeof m=="object"?m:{},m.width=p,m.height=t,Bs.createElement("div",{ref:n.domRef,"data-group-id":e.uniqueGroupId,tabIndex:-1,className:U(vd,Ks,u?`${Ks}--focused`:""),style:m,"data-z-index":f},Bs.createElement("div",{className:U(`${Ks}__header-content`,Nt)},a),c)}import{useContext as ZR}from"react";import*as Us from"react";var Ws;function $s(){return Ws||(Ws=Us.createContext({dataSourceApi:null,getDataSourceState:()=>null,assignState:()=>null,getDataSourceMasterContext:()=>{},dataSourceState:null,dataSourceActions:null}))}var js;function ya(){return js||(js=Us.createContext(null))}function Fe(n){let e=ya(),t=ZR(e);return co(t,n)}function Ut(){return Fe(n=>({getDataSourceState:n.getDataSourceState,getDataSourceMasterContext:n.getDataSourceMasterContext,dataSourceActions:n.dataSourceActions,dataSourceApi:n.dataSourceApi,assignState:n.assignState}))}var{rootClassName:tw}=ke,nw=[],yg=`${tw}Header`,ow=Td({overflow:!1}),Sg=()=>{};function rw(n){let{bodyBrain:e,headerBrain:t,columns:o,style:r,className:i,columnHeaderHeight:a,columnAndGroupTreeInfo:l,columnGroupsMaxDepth:s}=n,{getState:u,headerOptions:c,headerRenderer:d,headerOnRenderUpdater:p,showColumnFilters:f,computedColumnsMap:m}=J(D=>({computedColumnsMap:D.computed.computedColumnsMap,getState:D.getState,headerOptions:D.state.headerOptions,headerRenderer:D.state.headerRenderer,headerOnRenderUpdater:D.state.headerOnRenderUpdater,showColumnFilters:D.state.showColumnFilters})),g=ew(null),h=hg(D=>{if(g.current){let{scrollLeft:E}=t.getDOMScrollPosition(D);g.current.style.transform=`translate3d(${-E}px, 0px, 0px)`}},[t]);QR(()=>{let D=t.onScroll(h);return h(t.getScrollPosition()||{scrollLeft:0,scrollTop:0}),D},[t]);let S={ref:g,className:U(yg,`${yg}--virtualized`,i,ow),style:{...r,height:a}},{getDataSourceState:y,dataSourceApi:C,dataSourceActions:b}=Ut(),{allRowsSelected:I,someRowsSelected:T,selectionMode:R,filterTypes:v,filterDelay:w}=Fe(D=>({allRowsSelected:D.dataSourceState.allRowsSelected,someRowsSelected:D.dataSourceState.someRowsSelected,selectionMode:D.dataSourceState.selectionMode,filterTypes:D.dataSourceState.filterTypes,filterDelay:D.dataSourceState.filterDelay})),P=JR(()=>({allRowsSelected:I,someRowsSelected:T,selectionMode:R}),[I,T,R]),x=hg(D=>{let{rowIndex:E,colIndex:L,domRef:V,height:N,widthWithColspan:k,heightWithRowspan:F,hidden:B}=D,$=o[L];if(!$||B)return null;let _=t.isHorizontalLayoutBrain?t.getPageIndexForRow(E):null,H=l?l.pathsToCells.get([E,L]):null;if(H&&H.type==="group"){let z=H.columnItems.map(se=>se.ref),Z={...H.ref,id:H.id,uniqueGroupId:H.uniqueGroupId,depth:H.depth,columns:z.map(se=>se.id),computedWidth:H.computedWidth,groupOffset:H.groupOffset};return u().columnGroupVisibility[H.id]!==!1?_n.createElement(gg,{horizontalLayoutPageIndex:_,bodyBrain:e,columnGroupsMaxDepth:s,domRef:V,columns:z,width:k,height:N,columnGroup:Z}):null}return _n.createElement(Tg,{domRef:V,column:$,horizontalLayoutPageIndex:_,headerOptions:c,dataSourceStatePartialForHeaderCell:P,filterTypes:v,filterDelay:w,getDataSourceState:y,dataSourceApi:C,dataSourceActions:b,width:k,height:F,columnsMap:m})},[c,o,a,l,s,f,t,y,C,b,v,w,P]),M=$n(Ai);return _n.createElement(Zn,{orientation:"horizontal",dragListId:M,dragStrategy:"inline",onDrop:Sg,updatePosition:Sg},D=>_n.createElement("div",{...D,...S,className:U(D.className,S.className)},_n.createElement(fa,{name:"header",renderCell:x,brain:t,renderer:d,onRenderUpdater:p,cellHoverClassNames:nw,cellDetachedClassNames:ga})))}var bg=_n.memo(rw);function Cg(n){let{headerBrain:e,bodyBrain:t,scrollbars:o}=n,{computedPinnedStartColumns:r,computedPinnedEndColumns:i,computedVisibleColumns:a,columnSize:l}=J(w=>({computedPinnedStartColumns:w.computed.computedPinnedStartColumns,computedPinnedEndColumns:w.computed.computedPinnedEndColumns,computedVisibleColumns:w.computed.computedVisibleColumns,columnSize:w.computed.columnSize})),{columnHeaderHeight:s,columnGroupsDepthsMap:u,columnGroupsMaxDepth:c,computedColumnGroups:d,showColumnFilters:p}=J(w=>({columnHeaderHeight:w.state.columnHeaderHeight,columnGroupsDepthsMap:w.state.columnGroupsDepthsMap,columnGroupsMaxDepth:w.state.columnGroupsMaxDepth,computedColumnGroups:w.state.computedColumnGroups,showColumnFilters:w.state.showColumnFilters})),f=!d||!Object.keys(d).length?1:c+2,m=f*s+(p?s:0),g=vt.useMemo(()=>{if(!(!d||!Object.keys(d).length))return vi(a,d,u,c)},[a,d,u]),h=vt.useCallback(({rowIndex:w,colIndex:P})=>{let x=a[P],M=1,D=1;if(!x||!g)return{rowspan:M,colspan:D};let E=g.pathsToCells.get([w,P]);if(!E)return{rowspan:M,colspan:D};if(E.type==="column")return{colspan:D,rowspan:f-E.depth};let L=E.columnItems.findIndex(V=>V.id===x.id);return{rowspan:M,colspan:L===0?E.columnItems.length:1}},[d,c,a,g,f,u]),S=vt.useCallback(({rowIndex:w,colIndex:P})=>h({rowIndex:w,colIndex:P}).rowspan,[h]),y=vt.useCallback(({rowIndex:w,colIndex:P})=>h({rowIndex:w,colIndex:P}).colspan,[h]),C=vt.useCallback(w=>p?w<f-1?s:2*s:s,[f,p,s]);ha(e,{colWidth:l,rowHeight:C,rows:f,cols:a.length,height:m,rowspan:S,colspan:y},{fixedColsEnd:i.length,fixedColsStart:r.length});let b=vt.createElement(bg,{columns:a,headerBrain:e,bodyBrain:t,columnHeaderHeight:m,columnGroupsMaxDepth:c,columnAndGroupTreeInfo:g}),I=o.vertical&&Gt()?vt.createElement("div",{className:Dd,style:{zIndex:1e3,width:Gt()}}):null,T=Le(),R=vt.useCallback(w=>{Bp(T,w)},[]),v=vt.useCallback(w=>{Wp(T,w)},[]);return vt.createElement("div",{className:`${cr} ${Ad}`,style:{height:m},tabIndex:0,onFocus:R,onBlur:v},b,I)}var{ManagedComponentContextProvider:iw}=Ot({initSetupState:vm,forwardProps:Pm,Context:As()});function Ys(n){let{getComputed:e,header:t,brain:o,headerBrain:r,wrapRowsHorizontally:i}=J(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?Mr.createElement(iw,{...n},Mr.createElement(Cg,{wrapRowsHorizontally:!!i,bodyBrain:o,headerBrain:r,scrollbars:a})):null}function Ig(){return Mr.useContext(As()).componentState}var cw=n=>{let{allRowsSelected:e,someRowsSelected:t,api:o,dataSourceApi:r}=n,i=e?!0:t?null:!1,{components:a,isTree:l}=o.getState(),s=a?.CheckBox||wn;return Me.createElement(s,{domProps:{className:Po},onChange:u=>{if(l){u?r.treeApi.selectAll():r.treeApi.deselectAll();return}u?o.rowSelectionApi.selectAll():o.rowSelectionApi.deselectAll()},checked:i})},ji=Me.createContext(null);var dw=Y(q.columnZIndexAtIndex),pw=Y(q.columnVisibilityAtIndex),qs=Me.createElement("div",{className:ai[1]}),pH=si({"data-name":"","data-field":"","data-header-align":"","data-column-id":"","data-sort":"","data-sort-index":"",[It]:"",[Fo]:""});function fw(n){let e=n.column,{allowColumnHideWhileDragging:t}=Ig(),{dataSourceStatePartialForHeaderCell:o,horizontalLayoutPageIndex:r,getDataSourceState:i,dataSourceApi:a,dataSourceActions:l,filterTypes:s,filterDelay:u}=n,{allRowsSelected:c,someRowsSelected:d,selectionMode:p}=o,{onDragItemPointerDown:f,dragListId:m}=No(),{api:g,getComputed:h,getState:S,actions:y,getDataSourceMasterContext:C,showColumnFilters:b,components:I,portalDOMRef:T,columnHeaderHeight:R,columnReorderDragColumnId:v,columnMenuVisibleForColumnId:w,columnReorderInPageIndex:P,headerFocused:x}=J(X=>({api:X.api,getComputed:X.getComputed,getState:X.getState,actions:X.actions,getDataSourceMasterContext:X.getDataSourceMasterContext,showColumnFilters:X.state.showColumnFilters,components:X.state.components,portalDOMRef:X.state.portalDOMRef,columnHeaderHeight:X.state.columnHeaderHeight,columnReorderDragColumnId:X.state.columnReorderDragColumnId,columnMenuVisibleForColumnId:X.state.columnMenuVisibleForColumnId,columnReorderInPageIndex:X.state.columnReorderInPageIndex,headerFocused:X.state.focusedHeaderItem?.type==="column"&&X.state.focusedHeaderItem.key===n.column.id})),M=v===e.id,D=P!=null?r!==P:!1,{onResize:E,height:L,width:V,headerOptions:N,columnsMap:k}=n,F=e.computedSortInfo,B=e.header,$=Rg(X=>{j.current=X,n.domRef?.(X)},[n.domRef]),_=N.alwaysReserveSpaceForSortIcon,H=e.headerAlign??e.align,z=(typeof H=="function"?H({isHeader:!0,column:e}):H)??"start",Z=(typeof e.verticalAlign=="function"?e.verticalAlign({isHeader:!0,column:e}):e.verticalAlign)??"center",be=ft(e,{actions:y,api:g,dataSourceActions:l,dataSourceApi:a,getComputed:h,getDataSourceState:i,getDataSourceMasterContext:C,getState:S}),se=be.isSortable(),pe=se&&(e.computedSorted||_)?Me.createElement($i,{index:e.computedMultiSort?e.computedSortIndex+1:void 0,style:{marginInlineStart:de.spacing[2],marginInlineEnd:de.spacing[2]},className:`${bt}__sort-icon ${xd} ${Ed({align:z})}`,direction:e.computedSorted?e.computedSortedAsc?1:-1:0}):null,De=e.computedFilterable&&e.computedFiltered?Me.createElement(yo,null):null,ce=e.headerCssEllipsis??e.cssEllipsis??!0,te={reserveSpaceWhenHidden:z==="center",menuVisible:w===e.id,style:z==="end"?{marginInlineStart:`calc(${de.components.HeaderCell.resizeHandleActiveAreaWidth} / 2)`,marginInlineEnd:de.spacing[2]}:{marginInlineEnd:`calc(${de.components.HeaderCell.resizeHandleActiveAreaWidth} / 2)`,marginInlineStart:de.spacing[2]},domProps:{onMouseDown:X=>{X.stopPropagation(),be.toggleContextMenu(X.target)}}},le=e.components?.MenuIcon||I?.MenuIcon||Tr,ge=Me.createElement(le,{...te}),j=sw(null),ee={horizontalLayoutPageIndex:r,dragging:M,domRef:$,htmlElementRef:j,renderLocation:"column-header",column:e,columnsMap:k,columnSortInfo:F,columnFilterValue:e.computedFilterValue,filtered:e.computedFiltered,someRowsSelected:d,allRowsSelected:c,selectionMode:p,api:g,dataSourceApi:a,columnApi:be,renderBag:{sortIcon:pe,filterIcon:De,menuIcon:ge,menuIconProps:te,selectionCheckBox:null,header:e.header&&typeof e.header!="function"?e.header:e.name}},K=ee,ie=K.renderBag.header,ne=()=>{let X={...ee,renderBag:{...ee.renderBag}};if(e.renderSortIcon&&(X.renderBag.sortIcon=Me.createElement(xn,{render:e.renderSortIcon,renderParam:{...X,renderBag:{...X.renderBag}}})),e.renderFilterIcon&&(X.renderBag.filterIcon=Me.createElement(xn,{render:e.renderFilterIcon,renderParam:{...X,renderBag:{...X.renderBag}}})),typeof e.renderMenuIcon=="function"&&(X.renderBag.menuIcon=Me.createElement(xn,{render:ht=>{if(typeof e.renderMenuIcon!="function")return null;let mn=e.renderMenuIcon(ht);return mn?mn.type===le||mn.type===Tr?mn:Me.createElement(le,{...te},mn):null},renderParam:{...X,renderBag:{...X.renderBag}}})),e.renderSelectionCheckBox&&p==="multi-row"){X.renderBag.selectionCheckBox=Me.createElement(xn,{render:cw,renderParam:{...X,renderBag:{...X.renderBag}}});let ht=e.renderHeaderSelectionCheckBox??e.renderSelectionCheckBox;ht&&ht!==!0&&(X.renderBag.selectionCheckBox=Me.createElement(xn,{render:ht,renderParam:{...X,renderBag:{...X.renderBag}}}))}B instanceof Function&&(X.renderBag.header=ie=Me.createElement(xn,{render:B,renderParam:{...X,renderBag:{...X.renderBag}}}));let re=e.renderMenuIcon===!1?null:X.renderBag.menuIcon,Ee=ce?Me.createElement("div",{className:Nt},X.renderBag.header):X.renderBag.header,it=Me.createElement(Me.Fragment,null,z==="center"?qs:null,X.renderBag.selectionCheckBox,Ee,X.renderBag.sortIcon,X.renderBag.filterIcon,z==="center"?qs:null,z!=="center"?qs:null,re);return e.renderHeader?Me.createElement(xn,{render:e.renderHeader,renderParam:{...X,renderBag:{...X.renderBag,all:it}}}):it};lw(()=>{let X=null,re=j.current;return E&&re&&(X=uo(re,E)),()=>{X?.()}},[j.current,n.onResize]);let oe={height:L};e.headerStyle&&(oe=typeof e.headerStyle=="function"?{...oe,...e.headerStyle(K)||{}}:{...oe,...e.headerStyle});let O=typeof e.headerClassName=="function"?e.headerClassName(K):e.headerClassName,{onPointerDown:A,proxyPosition:ue,dragColumnOutside:Ie}=of({columnId:e.id,domRef:j,horizontalLayoutPageIndex:r,allowColumnHideOnDrag:t}),ye=null,Se=ji.Provider,xe={filtered:e.computedFiltered,verticalAlign:Z,align:z},Ze=Me.useMemo(()=>am({columnId:e.id,filterDelay:u,api:g,getState:S,getComputed:h,getDataSourceState:i}),[u,e.id]),Qe=e.computedFilterType,Ke=s[Qe],ot=e.computedFilterable?e.computedFilterValue?.filter.operator??Ke?.defaultOperator:void 0,$e=e.computedFilterable&&Ke?Ke.operators.find(X=>X.name===ot):void 0,Ye=$e?.components?.FilterEditor||Ke?.components?.FilterEditor||e.components?.FilterEditor||To,G=Ke?.components?.FilterOperatorSwitch||e.components?.FilterOperatorSwitch,Q=im(e,{horizontalLayoutPageIndex:r}),fe=`var(${dw}-${e.computedVisibleIndex})`;oe.zIndex=fe,oe.visibility=`var(${pw}-${e.computedVisibleIndex}, visible)`;let Te={"data-field":`${e.field||""}`,"data-column-id":e.id,[It]:e.id,[Fo]:m,"data-header-align":z,"data-name":"HeaderCell","data-sort":e.computedSortedAsc?"asc":e.computedSortedDesc?"desc":"none","data-sort-index":`${e.computedSortIndex??-1}`},rt=e.computedFilterable?Me.createElement(Xd,{horizontalLayoutPageIndex:r,filterEditor:Ye,filterOperatorSwitch:G??Zd,operator:$e,filterTypes:s,onChange:Ze,columnFilterType:Qe,columnLabel:e.field||e.name||e.id,columnFilterValue:e.computedFilterValue,columnHeaderHeight:R}):Me.createElement(Qd,null);K.renderBag.filterEditor=rt;let ae=Rg(X=>{A(X),f(X)},[A,f]),je=ne();return M&&ue&&(ye=Me.createElement("div",{key:e.id,className:`${bt}Proxy ${yd}`,style:{height:L,width:V,left:ue.left??0,top:ue.top??0}},Me.createElement("div",{className:Sd({visible:Ie})},Me.createElement(wm,{size:16})),ie),ye=uw(ye,T.current)),Me.createElement(Se,{value:K},Me.createElement(Bi,{domRef:$,horizontalLayoutPageIndex:n.horizontalLayoutPageIndex,cellType:"header",tabIndex:-1,column:e,...Te,"data-z-index":fe,style:oe,width:V,onPointerDown:ae,contentClassName:U(hd(xe),Wc[z]),contentStyle:b?{height:L/2}:void 0,className:U(bt,qc.none,se?Kc.pointer:"",O,Si(e,[bt,Jt],bd,{dragging:M,insideDisabledDraggingPage:D,align:z,verticalAlign:Z,rowSelected:!1,cellSelected:!1,rowDisabled:!1,zebra:!1,rowActive:!1,firstRow:!0,firstRowInHorizontalLayoutPage:!0,treeNode:!1,groupCell:!1,groupRow:!1,rowExpanded:!1,focused:x}),gd),cssEllipsis:ce,afterChildren:Me.createElement(Me.Fragment,null,b?rt:null,Q),renderChildren:je}),ye)}var Tg=Me.memo(fw);function hi(){return aw(ji)}import*as nn from"react";import{useEffect as Sw}from"react";function wg(n,e){let{separator:t}=e??{separator:"-"};return n.replace(/([a-z\d])([A-Z])/g,"$1"+t+"$2").replace(new RegExp("("+t+"[A-Z])([A-Z])","g"),"$1"+t+"$2").toLowerCase()}var Pg="https://infinite-table.com",Dg="Invalid Infinite Table license. See console for details.",xg={padding:de.spacing[2],textAlign:"end",opacity:"1",visibility:"visible",display:"block",fontSize:"0.85rem"},mw={...xg,background:"white",color:"black"},gw={...xg,background:"#fee2e2",color:"#991b1b"},Mg={opacity:"1",visibility:"visible",display:"inline-block",pointerEvents:"all",textDecoration:"underline"},hw={...Mg,color:"black"},yw={...Mg,color:"#991b1b"};function Xs(n){return n?{footer:gw,anchor:yw}:{footer:mw,anchor:hw}}var vg=(n,e)=>{if(n)for(let[t,o]of Object.entries(e))n.style.setProperty(wg(t),o,"important")};function Eg(n,e){let t=Xs(e),o=()=>{setTimeout(()=>{let i=n();vg(i,t.footer),vg(i?.querySelector("a")??null,t.anchor)})};o();let r=setInterval(o,1e3);return()=>{clearInterval(r)}}var Ag=nn.forwardRef(function(e,t){let{invalid:o=!1,...r}=e,{rootClassName:i}=ii(),a=nn.useRef(null),l=nn.useCallback(u=>{a.current=u,t&&(typeof t=="function"?t(u):t.current=u)},[]);Sw(()=>Eg(()=>a.current,o),[o]);let s=Xs(o);return nn.createElement("div",{ref:l,...r,className:U(`${i}-Footer`,o?`${i}-Footer--invalid`:null,ap,r.className),style:s.footer},o?`${Dg} `:null,"Powered by"," ",nn.createElement("a",{href:Pg,rel:"noopener noreferrer",role:"link",target:"_blank",style:s.anchor},"Infinite Table"))});var Sa=class{constructor(e){let t=e instanceof Object.getPrototypeOf(this).constructor?e.getState():e,o=this.getPositiveFromState(t),r=this.getNegativeFromState(t);this.update({negativeItems:r,positiveItems:o})}getInitialState(){return this.initialState}destroy(){this.positiveMap?.clear(),this.negativeMap?.clear(),delete this.positiveMap,delete this.negativeMap}update(e){let{positiveItems:t,negativeItems:o}=e;if(this.allNegative=o===!0,this.allPositive=t===!0,this.allNegative&&this.allPositive)throw"Cannot have both negativeItems and positiveItems be true!";o!==!0&&(this.negativeMap?(this.negativeMap.clear(),this.negativeMap.fill(o.map(r=>[r,!0]))):this.negativeMap=new W(o.map(r=>[r,!0])),this.positiveMap&&this.positiveMap.clear()),t!==!0&&(this.positiveMap?(this.positiveMap.clear(),this.positiveMap.fill(t.map(r=>[r,!0]))):this.positiveMap=new W(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 Pt=class extends Sa{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 At(){let n=_e().performance?.now();return`${Date.now()}:${n}`}function ba(n,e){return n&&n.filter(t=>{let o=e[t.filter.type];return!(!o||o.emptyValues&&o.emptyValues.includes(t.filter.value))})}var _g=new WeakMap;function Ta(n,e){if(!n||!n.length)return[];let t=_g.get(n);t||(t=new WeakMap,_g.set(n,t));let o=t.get(e);if(o)return o;let r=[],i=ba(n,e)||[];for(let a=0,l=i.length;a<l;a++){let s=i[a],u=e[s.filter.type];if(s.disabled||!u)continue;let c;for(let d=0;d<u.operators.length;d++){let p=u.operators[d];p.name===s.filter.operator&&(c=p.fn)}c&&r.push({field:s.field,valueGetter:s.valueGetter||u.valueGetter,fn:c,value:s.filter.value,emptyValues:u.emptyValues})}return t.set(e,r),r}function Zs(n,e){if(!n.length)return!0;let{data:t}=e,o={data:t,index:e.index,dataArray:e.dataArray,primaryKey:e.primaryKey,field:void 0,filterValue:void 0,currentValue:void 0,emptyValues:[]};for(let r=0,i=n.length;r<i;r++){let a=n[r];if(o.field=a.field,o.filterValue=a.value,o.currentValue=a.valueGetter?a.valueGetter(o):a.field?t[a.field]:t,o.emptyValues=a.emptyValues,!a.fn(o))return!1}return!0}var bw=0;function Og(n){return bw++,Zs(Ta(n.filterValue,n.filterTypes),n)}function Qs(n){return Ta(n.filterValue,n.filterTypes).length?n.isLeafNode?Og(n):n.filterTreeNode(n.data):!0}var Tw="group-by",Fg="group-by-";function Ng(n){let e=n.map(t=>t.valueGetter?o=>t.valueGetter({data:o,field:t.field}):t.field??t.groupField).filter(Boolean);if(e.length)return e.length===1&&typeof e[0]!="function"?e[0]:e}function Ca(n,e){if(!n?.length||!e?.length)return n;let t=!1,o=n.map(r=>{if(r.field!=null||!r.id)return r;if(r.id===Tw){let i=Ng(e);return i==null?r:(t=!0,{...r,field:i})}if(r.id.startsWith(Fg)){let i=r.id.slice(Fg.length),a=e.find(s=>String(s.field)===i||s.groupField===i);if(!a)return r;let l=Ng([a]);return l==null?r:(t=!0,{...r,field:l})}return r});return t?o:n}var Lg=!0,Cw={originalDataArray:!0,changes:!0},Iw={filterValue:(n,e)=>JSON.stringify(n)===JSON.stringify(e),groupRowsState:(n,e)=>JSON.stringify(n)===JSON.stringify(e)};function kt(n,e,t){let o=Ca(n.sortInfo,n.groupBy),r=n.multiSort?o:o?.[0]??null,i={append:!1,originalDataArray:n.originalDataArray,sortInfo:r,refetchKey:n.refetchKey,groupBy:n.groupBy,pivotBy:n.pivotBy,filterValue:n.filterValue,aggregationReducers:n.aggregationReducers};if(t&&(i.masterRowInfo=t.masterRowInfo),i.groupBy&&(i.groupRowsState=n.groupRowsState.getState()),n.livePagination!==void 0&&(i.livePaginationCursor=n.livePaginationCursor,i.__cursorId=n.cursorId),n.lazyLoad&&(n.lazyLoadBatchSize!=null&&n.lazyLoadBatchSize>0&&(i.lazyLoadBatchSize=n.lazyLoadBatchSize,i.lazyLoadStartIndex=0),i.groupKeys=[],n.selectionMode==="multi-row"&&(i.multiRowSelectionTarget=n.multiRowSelectionTarget)),e&&Object.assign(i,e),i.filterValue&&i.filterValue.length){let s=Js(i.filterValue,{filterMode:n.filterMode,filterTypes:n.filterTypes});s&&s.length&&(i.filterValue=s)}let a={},l=n.dataParams||{};for(let s in i)if(i.hasOwnProperty(s)&&!Cw[s]){let u=s,c=Iw[u],d=i[u],p=l[u];(c?c(d,p):d===p)||(a[u]=!0)}return i.changes=a,i}function on(n,e,t,o,r){let i=kt(e,o,r),a=i.append;if(e.lazyLoad){let c=e.originalLazyGroupData,d=[Tt,...i.groupKeys||[]],p=c.get(d);if(!p){let f=[...i.groupKeys||[],i.lazyLoadStartIndex??0];e.lazyLoadCacheOfLoadedBatches.set(f,!0)}if(p&&p.cache&&d.length>1){let f=p.children,m=f.length,g=!0;for(let h=0;h<m;h++)if(f[h]==null){g=!1;break}if(g)return Promise.resolve(!0)}p?p.childrenLoading||(p.childrenLoading=!0):c.set(d,{error:void 0,children:[],childrenLoading:!0,childrenAvailable:!1,cache:Lg,totalCount:0}),t.originalLazyGroupDataChangeDetect=At()}if(typeof n=="function")try{n=n(i)}catch(c){n=Promise.reject(c)}let s=typeof n=="object"&&typeof n.then=="function"&&(!e.lazyLoad||!a&&!i.groupKeys?.length);s&&(t.loading=!0);let u=c=>{if(console.error('The DataSource "data" function failed:',c),e.lazyLoad){let d=i.groupKeys||[],p=e.originalLazyGroupData.get([Tt,...d]),f=c instanceof Error?c.message:String(c);if(d.length&&p&&!p.childrenAvailable)p.childrenLoading=!1,p.cache=!1,p.error=f,t.originalLazyGroupDataChangeDetect=At();else{let m=e.lazyLoadCacheOfLoadedBatches,g=[...d,i.lazyLoadStartIndex??0];m.has(g)&&m.set(g,"failed"),p&&(p.childrenLoading=!1,p.error=f)}}s&&(t.loading=!1)};return Promise.resolve(n).then(c=>{let d=[],p=!1;if(Array.isArray(c.data)){let m=c;if(d=m.data,m.livePaginationCursor!==void 0&&(t.livePaginationCursor=m.livePaginationCursor),m.mappings&&(t.pivotMappings=m.mappings),e.lazyLoad||(t.unfilteredCount=m.totalCountUnfiltered??d.length),e.lazyLoad){let h=function(S,y,C){let b=[Tt,...S],I=y.data,T={cache:y.cache??Lg,childrenLoading:!1,childrenAvailable:!0,totalCount:y.totalCount??I.length,totalCountUnfiltered:y.totalCountUnfiltered,totalChildrenCount:y.totalChildrenCount,totalChildrenCountUnfiltered:y.totalChildrenCountUnfiltered,children:I,error:y.error},R=[];if(i.lazyLoadBatchSize&&!C){let w=g.get(b),P=!w,x=Hd({children:!0},w||{},T);P&&(x.chidren=[]),x.children.length=x.totalCount;let M=i.lazyLoadStartIndex??0,D=Math.min(y.totalCount??I.length,M+i.lazyLoadBatchSize);for(let E=M;E<D;E++){let L=T.children[E-M];if(!L)throw`lazily loaded item not found at index ${E-M}`;x.children[E]=L,L.dataset&&R.push({keys:L.keys,dataset:L.dataset})}P&&g.set(b,x)}else T.children.forEach(w=>{w&&w.dataset&&R.push({keys:w.keys,dataset:w.dataset})}),T.children.length=T.totalCount,g.set(b,T);let v=!1;if(!S||!S.length){let w=g.get([Tt]);t.originalDataArray=[...w.children],v=!0}if(v||(t.originalLazyGroupDataChangeDetect=At()),R.length){let w=S;R.forEach(({keys:P,dataset:x})=>{h(P,x,w)})}};var f=h;let g=e.originalLazyGroupData;p=!0,h(i.groupKeys||[],m)}}else d=c;p||(t.originalDataArray=a?e.originalDataArray.concat(d):d),s&&(t.loading=!1)}).catch(u)}function Js(n,{filterTypes:e,filterMode:t}){return t==="local"?!n||!n.some(o=>o.valueGetter)?n:n.map(kg):(ba(n,e)||[]).map(kg)}function kg(n){if(!n.valueGetter)return n;let e={...n};return delete e.valueGetter,e}function zg(){let n;return(e,t,o)=>{if(n&&n.filterValue===e&&n.filterTypes===t&&n.filterMode===o)return n.result;let r=Js(e,{filterTypes:t,filterMode:o});return n&&n.filterValue===e&&JSON.stringify(n.result)===JSON.stringify(r)&&(r=n.result),n={filterValue:e,filterTypes:t,filterMode:o,result:r},r}}var Rw=()=>new Promise(n=>{Ge(n)});function eu(n,e){let t=!!n,{stateReadyAsDetails:o}=e(),r=t&&n.shouldRestoreState?o:!0;return{isDetail:t,isDetailReady:r}}function Vg(n){let{lazyLoad:e,lazyLoadBatchSize:t,lazyLoadCacheOfLoadedBatches:o}=n;if(!e||!t||t<=0)return!1;for(let r of o.keys())if(r.length===1)return!0;return!1}function Gg(n){for(let[e,t]of n.entries())t==="failed"&&n.delete(e)}function Hg(n,e){let{startIndex:t,endIndex:o,lazyLoadBatchSize:r,componentState:i,componentActions:a,dismissLoadedRows:l}=n,{dataArray:s}=i,u=l?()=>!1:g=>s[g].data!=null,c=!l,d=new W,p=["_______xxx______"];for(let g=t;g<=o;g++){let h=s[g];if(!h)continue;let S=u(g),y=h.dataSourceHasGrouping&&h.groupKeys?[...h.groupKeys]:[];h.isGroupRow&&h.dataSourceHasGrouping&&h.groupKeys&&y.pop();let C=y.length?y:p,b=h.dataSourceHasGrouping?h.indexInGroup:h.indexInAll;if(h.isGroupRow&&!h.collapsed&&!h.childrenAvailable){let I={lazyLoadStartIndex:0,lazyLoadBatchSize:r,groupKeys:h.groupKeys,append:c},T=h.groupKeys,R=d.get(T);if(!R?.[h.id]){let v=!R;R=R||{},R[h.id]||(R[h.id]=I),v&&d.set(T,R)}}if(!S&&r!=null){let I=d.get(C),T=Math.floor(b/r)*r,R=b-T,v=s[h.indexInAll-R].indexInAll,w=u(v),P=s[v].id;if(w||I?.[P])continue;let x=!I;I=I||{};let M={lazyLoadStartIndex:T,lazyLoadBatchSize:r,groupKeys:y,append:c};I[P]||(I[P]=M),x&&d.set(C,I)}}let f=Promise.resolve(!0),m=[];d.topDownValues().forEach(g=>{m.push(...Object.values(g))}),m.reduce((g,h)=>{let S=[...h.groupKeys,h.lazyLoadStartIndex];if(e&&e.has(S))return g;e?.set(S,!0);let y=[i.data,i,a,h];return g.then(()=>Rw()).then(()=>on(...y))},f)}function tu(n,e){let{rowIndex:t,primaryKey:o}=e,{dataArray:r}=n.getDataSourceState();if(o!==void 0){let i=n.dataSourceApi.getIndexByPrimaryKey(o);if(i!==-1)return i;if(r[t]?.id!==o)return-1}return r[t]?t:-1}function Er(n,e){let t=tu(n,e);return t===-1?null:Wt({...n,rowIndex:t,columnId:e.columnId})}function Ar(n,e){console.warn(`Skipping "${n}": the edited row (primaryKey: ${String(e.primaryKey)}, rowIndex: ${e.rowIndex}) is no longer in the data array.`)}function nu(n){let{getComputed:e,getState:t,actions:o}=n,r=t().columnMenuVisibleForColumnId;if(!r)return;let i=e(),a=i.computedVisibleColumnsMap,l=i.computedColumnOrder;if(a.has(r)){o.columnMenuVisibleKey=Date.now();return}function s(f,m){let g=l[u+f*m],h=a.get(g);if(h&&h.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&&(o.columnMenuVisibleForColumnId=p),p}function Ia(n,e){let{rowIndex:t,colIndex:o}=n,{rowIndex:r,colIndex:i}=e,[a,l]=o>i?[i,o]:[o,i],[s,u]=t>r?[r,t]:[t,r];return[{rowIndex:s,colIndex:a},{rowIndex:u,colIndex:l}]}function ou(n,e,t){let{rowsPerPage:o}=t;return o?Math.floor(n.rowIndex/o)===Math.floor(e.rowIndex/o):!0}function Kg(n,e,t){if(ou(n,e,t))throw"You should not call this when the positions are in the same page";let{rowsPerPage:o,columnsPerSet:r}=t;if(o===0)throw"rowsPerPage cannot be 0";let i=n,a=e;Math.floor(n.rowIndex/o)>Math.floor(e.rowIndex/o)&&(i=e,a=n);let{rowIndex:l,colIndex:s}=i,{rowIndex:u,colIndex:c}=a,d=Math.floor(l/o),p=Math.floor(u/o),f=l%o,m=u%o,g=Math.min(f,m),h=Math.max(f,m),S=[];for(let y=d;y<=p;y++)for(let C=g;C<=h;C++){let b=y*o+C;if(y===d)for(let I=s;I<r;I++)S.push({rowIndex:b,colIndex:I});else if(y===p)for(let I=0;I<=c;I++)S.push({rowIndex:b,colIndex:I});else for(let I=0;I<r;I++)S.push({rowIndex:b,colIndex:I})}return S}function ww(n,e){let t=new Set(n);return e.map(o=>t.has(o)?o:null).filter(o=>o!=null)}var ru=class{constructor(e){this.getCellSelectionPosition=e=>{let t=e.rowId??vn(e.rowIndex,this.getDataSourceState)?.id,o=e.colId??this.getComputed().computedVisibleColumns[e.colIndex].id;return[t,o]};this.setRangeSelected=(e,t,o)=>{let r=this.getDataSourceState(),i=r.cellSelection;if(!i)return;let a=new Ue(i);a.debugId=r.debugId??"";let[l,s]=this.getCellSelectionPosition(e),[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=vn(l,this.getDataSourceState),h=vn(u,this.getDataSourceState);if(!g||!h)return;let S=g.indexInAll,y=h.indexInAll,[C,b]=Ia({rowIndex:S,colIndex:f},{rowIndex:y,colIndex:m});for(let I=C.rowIndex;I<=b.rowIndex;I++)for(let T=C.colIndex;T<=b.colIndex;T++){let R={rowIndex:I,colIndex:T},[v,w]=this.getCellSelectionPosition(R);o?a.selectCell(v,w):a.deselectCell(v,w)}this.dataSourceActions.cellSelection=a};this.getCellSelectionPositionsWithFn=(e,t)=>{let o=Ni(this.getDataSourceState),{computedVisibleColumns:r}=this.getComputed(),i=r.map(d=>d.id),a=new Set,l=[],s=new Set;o.filter(d=>{r.forEach(p=>{this.isCellSelected({rowId:d.id,colId:p.id})&&(a.has(p.id)||a.add(p.id),s.has(d.id)||(s.add(d.id),l.push(d)))})});let u=ww(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 o=new Ue(t);o.debugId=e.debugId??"",o.deselectAll(),this.dataSourceActions.cellSelection=o};this.clear=()=>{this.deselectAll()};this.selectAll=()=>{let e=this.getDataSourceState(),t=e.cellSelection;if(!t)return;let o=new Ue(t);o.debugId=e.debugId??"",o.selectAll(),this.dataSourceActions.cellSelection=o};this.selectRange=(e,t)=>{this.setRangeSelected(e,t,!0)};this.deselectRange=(e,t)=>{this.setRangeSelected(e,t,!1)};this.isCellSelected=e=>{let[t,o]=this.getCellSelectionPosition(e);return this.getDataSourceState().cellSelection?.isCellSelected(t,o)??!1};this.selectCell=e=>{let t=this.getDataSourceState(),o=t.cellSelection;if(!o)return;let[r,i]=this.getCellSelectionPosition(e),a=e.clear?new Ue:new Ue(o);a.debugId=t.debugId??"",a.selectCell(r,i),this.dataSourceActions.cellSelection=a};this.deselectCell=e=>{let t=this.getDataSourceState(),o=t.cellSelection;if(!o)return;let[r,i]=this.getCellSelectionPosition(e),a=new Ue(o);a.debugId=t.debugId??"",a.deselectCell(r,i),this.dataSourceActions.cellSelection=a};this.selectColumn=(e,t)=>{t?.clear&&this.deselectAll();let o=this.getDataSourceState(),r=o.cellSelection;if(!r)return;let i=new Ue(r);i.debugId=o.debugId??"",i.selectColumn(e),this.dataSourceActions.cellSelection=i};this.deselectColumn=e=>{let t=this.getDataSourceState(),o=t.cellSelection;if(!o)return;let r=new Ue(o);r.debugId=t.debugId??"",r.deselectColumn(e),this.dataSourceActions.cellSelection=r};this.getComputed=e.getComputed,this.getDataSourceState=e.getDataSourceState,this.dataSourceActions=e.dataSourceActions}};function Bg(n){return new ru(n)}var Vo=class{constructor(e){let t=e instanceof Object.getPrototypeOf(this).constructor?e.getState():e,o=this.getPositiveFromState(t),r=this.getNegativeFromState(t);this.update({negativeItems:r,positiveItems:o})}getInitialState(){return this.initialState}destroy(){this.positiveMap?.clear(),this.negativeMap?.clear(),delete this.positiveMap,delete this.negativeMap}update(e){let{positiveItems:t,negativeItems:o}=e;if(this.allNegative=o===!0,this.allPositive=t===!0,this.allNegative&&this.allPositive)throw"Cannot have both negativeItems and positiveItems be true!";if(o&&o!==!0){this.negativeMap||(this.negativeMap=new Map),this.negativeMap.clear();for(let r of o)this.negativeMap.set(r,!0);this.positiveMap&&this.positiveMap.clear()}if(t&&t!==!0){this.positiveMap||(this.positiveMap=new Map),this.positiveMap.clear();for(let r of t)this.positiveMap.set(r,!0);this.negativeMap&&this.negativeMap.clear()}}isDefaultNegativeSelection(){return this.allNegative}isDefaultPositiveSelection(){return this.allPositive}areAllNegative(){return this.allNegative&&(this.positiveMap?this.positiveMap.size===0:!0)}areAllPositive(){return this.allPositive&&(this.negativeMap?this.negativeMap.size===0:!0)}makeAllNegative(){this.update({negativeItems:!0,positiveItems:[]})}makeAllPositive(){this.update({positiveItems:!0,negativeItems:[]})}isItemPositive(e){if(this.allPositive===!0){if(this.allNegative===!0)throw'Cannot have both positiveItems and negativeItems be "true"';return!this.negativeMap?.has(e)}return!!this.positiveMap?.has(e)}isItemNegative(e){return!this.isItemPositive(e)}setItemValue(e,t){if(t!==this.isItemPositive(e)){if(t){if(this.allNegative===!0){if(!this.positiveMap)throw`No positiveMap found when trying to set item ${e} be positive`;this.positiveMap.set(e,!0)}else if(this.allPositive===!0){if(!this.negativeMap)throw`No negativeMap found when trying to set item ${e} be positive`;this.negativeMap.delete(e)}}else if(this.allPositive===!0){if(!this.negativeMap)throw`No negativeMap found when trying to set item ${e} be negative`;this.negativeMap.set(e,!0)}else if(this.allNegative===!0){if(!this.positiveMap)throw`No positiveMap found when trying to set item ${e} be negative`;this.positiveMap?.delete(e)}}}makeItemNegative(e){this.setItemValue(e,!1)}makeItemPositive(e){this.setItemValue(e,!0)}toggleItem(e){this.setItemValue(e,!this.isItemPositive(e))}};var _t=class extends Vo{constructor(t){super(t);this.isRowDetailsExpanded=t=>!!this.isItemPositive(t)}getState(){let t=this.allPositive?!0:[...this.positiveMap?.keys()??[]],o=this.allNegative?!0:[...this.negativeMap?.keys()??[]];return{expandedRows:t,collapsedRows:o}}getPositiveFromState(t){return t.expandedRows}getNegativeFromState(t){return t.collapsedRows}areAllCollapsed(){return this.areAllNegative()}areAllExpanded(){return this.areAllPositive()}collapseAll(){this.makeAllNegative()}expandAll(){this.makeAllPositive()}isRowDetailsCollapsed(t){return!this.isRowDetailsExpanded(t)}setRowDetailsExpanded(t,o){return this.setItemValue(t,o)}collapseRowDetails(t){this.setRowDetailsExpanded(t,!1)}expandRowDetails(t){this.setRowDetailsExpanded(t,!0)}toggleRowDetails(t){this.toggleItem(t)}};function Wg(n){let{dataSourceApi:e,getState:t,actions:o}=n,r={collapseAllDetails(){o.rowDetailState=new _t({collapsedRows:!0,expandedRows:[]})},expandAllDetails(){o.rowDetailState=new _t({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 _t(l);s.collapseRowDetails(i),a.lastRowToExpandRef.current=null,a.lastRowToCollapseRef.current=i,o.rowDetailState=s},expandRowDetail(i){let a=t(),l=a.rowDetailState;if(!l){console.error("Cannot expand row details via rowDetailState, as no props.rowDetailState is provided.");return}let s=new _t(l);s.expandRowDetails(i),a.lastRowToCollapseRef.current=null,a.lastRowToExpandRef.current=i,o.rowDetailState=s},toggleRowDetail(i){r.isRowDetailExpanded(i)?r.collapseRowDetail(i):r.expandRowDetail(i)}};return r}function On(n,e,t){return Math.min(Math.max(n,e),t)}function Ra(n,e,t){let o=n().dataArray,r=0,i=o.length-1,a=e;do{a+=t;let l=o[a];if(!l)return a<r?r:i;if(!l.rowDisabled)return a}while(a>=r&&a<=i);return On(a,r,i)}function vw(n,e){let{getState:t,getDataSourceState:o,actions:r,api:i,dataSourceApi:a}=n,{key:l}=e,s=o().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,h=m-f-1,S=0,y=u-1,C={ArrowDown:()=>{p=Ra(o,p,1)},ArrowUp:()=>{p=Ra(o,p,-1)},ArrowLeft:()=>{let I=s[p];if(d.isHorizontalLayoutBrain){let T=d.rowsPerPage;p-T>=S?p=p-T:C.ArrowUp();return}return I&&I.isGroupRow?i.collapseGroupRow(I.groupKeys):I&&i.rowDetailApi.isRowDetailEnabledForRow(I.id)?i.rowDetailApi.collapseRowDetail(I.id):!1},ArrowRight:()=>{let I=s[p];if(d.isHorizontalLayoutBrain){let T=d.rowsPerPage;p+T<=y?p=p+T:C.ArrowDown();return}return I&&I.isGroupRow?i.expandGroupRow(I.groupKeys):I&&i.rowDetailApi.isRowDetailEnabledForRow(I.id)?i.rowDetailApi.expandRowDetail(I.id):!1},Enter:()=>{let I=s[p];return I&&I.isGroupRow?i.toggleGroupRow(I.groupKeys):I&&I.isTreeNode&&I.isParentNode?a.treeApi.toggleNode(I.nodePath):i.rowDetailApi.isRowDetailEnabledForRow(I.id)?i.rowDetailApi.toggleRowDetail(I.id):!1},PageDown:()=>{p=Math.min(p+h,u-1)},PageUp:()=>{p=Math.max(p-h,S)},End:()=>{p=y},Home:()=>{p=S}},b=C[l];return b?(b(),g!==p?(r.activeRowIndex=p,!0):!1):!1}function iu(n,e){let{api:t,getState:o,getComputed:r,getDataSourceState:i,dataSourceApi:a}=n,{key:l,shiftKey:s}=e,u=i().dataArray,c=o(),{activeCellIndex:d,brain:p}=c;if(!d)return!1;let[f,m]=d,{start:[g,h],end:[S,y]}=p.getRenderRange(),C=S-g-1,b=y-h-1,I=i().dataArray.length-1,T=r().computedVisibleColumns.length-1,R=0,v=0;f=On(f,0,I),m=On(m,0,T);let w={ArrowDown:()=>{f=On(f+1,R,I)},ArrowUp:()=>{f=On(f-1,R,I)},ArrowLeft:()=>{if(m===v)if(f!==R&&(m=T),p.isHorizontalLayoutBrain){let x=p.rowsPerPage;f-x>=R?f=f-x:w.ArrowUp()}else w.ArrowUp();else m=On(m-1,v,T)},ArrowRight:()=>{if(m===T)if(f!==I&&(m=v),p.isHorizontalLayoutBrain){let x=p.rowsPerPage;f+x<=I?f=f+x:w.ArrowDown()}else w.ArrowDown();else m=On(m+1,v,T)},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+b,T):f=Math.min(f+C,I)},PageUp:()=>{s?m=Math.max(m-b,v):f=Math.max(f-C,R)},End:()=>{s?m=T:f=I},Home:()=>{s?m=v:f=R}},P=w[l];return P?(P(),[f,m]):!1}function Pw(n,e){let t=iu(n,e);return t?(n.actions.activeCellIndex=t,!0):!1}var Dw={ArrowUp:!0,ArrowDown:!0,ArrowLeft:!0,ArrowRight:!0,PageUp:!0,PageDown:!0,Home:!0,End:!0,Enter:!0," ":!0};function jg(n,e){let{key:t}=e,{getState:o}=n,r=o(),{activeRowIndex:i,activeCellIndex:a,keyboardNavigation:l,cellContextMenuVisibleFor:s,contextMenuVisibleFor:u}=r;return s||u||!Dw[t]?!1:t==="ArrowUp"&&!e.shiftKey&&(l==="row"?i===0:l==="cell"?a?.[0]===0:!1)&&$p(n,l==="cell"?a[1]:null)?!0:i!=null&&l==="row"?vw(n,e):a!=null&&l==="cell"?Pw(n,e):!1}var au=class{constructor(e){this.param=e}setKeyboardNavigation(e){this.param.actions.keyboardNavigation=e}setActiveCellIndex(e){this.param.actions.activeCellIndex=e}setActiveRowIndex(e){this.param.actions.activeRowIndex=e}gotoRowWithDirection(e){let{getDataSourceState:t,getState:o}=this.param,{activeRowIndex:r,keyboardNavigation:i}=o();if(i!=="row")return console.error("Keyboard navigation is not enabled for rows"),!1;if(r==null)return!1;let a=Ra(t,r,e);return a!==r?(this.param.actions.activeRowIndex=a,a):!1}gotoRow(e){return this.gotoRowWithDirection(e)}gotoNextRow(){return this.gotoRow(1)}gotoPreviousRow(){return this.gotoRow(-1)}gotoCell(e){let{direction:t}=e,o=t=="top"?"ArrowUp":t=="bottom"?"ArrowDown":t=="left"?"ArrowLeft":"ArrowRight",r=iu(this.param,{key:o,shiftKey:!1});return r===!1?!1:(this.param.actions.activeCellIndex=r,r)}};function Ug(n){return new au(n)}function $g(n,e){return n.id?n.id===e.id:!!(n.field&&n.field===e.field)}var lu=class{constructor(e){this.columnApiById=new Map;this.getVisibleRenderRange=()=>this.getState().brain.getRenderRange();this.hideFilterOperatorMenu=()=>{this.actions.filterOperatorMenuVisibleForColumnId=null};this.setGroupRenderStrategy=e=>{this.actions.groupRenderStrategy=e};this.getColumnOrder=()=>this.getComputed().computedColumnOrder;this.getComputedColumnById=e=>this.getComputed().computedColumnsMap.get(e);this.getVisibleColumnOrder=()=>{let e=this.getColumnOrder(),t=this.getComputed().computedVisibleColumnsMap;return e.filter(o=>t.has(o))};this.persistEdit=async e=>{e=e??{};let{editingCell:t,editingValueRef:o}=this.getState();if(!t)return Promise.resolve(new Error("no edit in progress"));await new Promise(p=>requestAnimationFrame(p));let r=this.getComputed().computedColumnsMap.get(t.columnId),i=e.value??t.value;!t.active&&t.waiting!=="persist"&&(this.actions.editingCell={...t,active:!1,waiting:"persist"});let a=tu({...this.context,api:this},t);if(a===-1){let p=new Error(`Cannot persist edit: the edited row (primaryKey: ${String(t.primaryKey)}, rowIndex: ${t.rowIndex}) is no longer in the data array.`);return this.actions.editingCell={...t,active:!1,accepted:!1,waiting:!1,persisted:p},Promise.resolve(p)}let l={...Wt({rowIndex:a,columnId:t.columnId,...this.context,api:this}),value:i,initialValue:t.initialValue},s=i;o.current=null,r.getValueToPersist&&(s=await r.getValueToPersist(l)),l.value=s,t.value=s;let u=this.getState().persistEdit??(()=>{if(!l.column.field)return i;let p=this.getDataSourceState().primaryKey,f=l.data&&typeof p=="string"?{[p]:l.data[p],[l.column.field]:s}:{...l.data,[l.column.field]:s};return this.context.dataSourceApi.updateData(f)}),c;try{c=await u(l)}catch(p){c=p}let d=c instanceof Error?c:!0;return this.actions.editingCell={...t,active:!1,accepted:!1,waiting:!1,persisted:d},Promise.resolve(d)};this.clearEditInfo=()=>{this.actions.editingCell=null};this.isEditInProgress=()=>{let{editingCell:e}=this.getState();return e?e.active:!1};this.isEditorVisibleForCell=e=>{let{rowIndex:t,columnId:o}=e,{dataArray:r}=this.getDataSourceState(),{editingCell:i}=this.getState(),a=r[t];return!a||!i?!1:i.columnId===o&&i.primaryKey===a.id&&!!(i.active||i.waiting)};this.confirmEdit=e=>this.stopEdit({value:e});this.stopEdit=async e=>{let t=this.getState(),{editingCell:o,editingValueRef:r}=t;if(!o)return!0;e||(e={});let i=e.value??r.current;if(!e.cancel&&!e.reject){let{rowIndex:a,columnId:l}=o;this.actions.editingCell={...t.editingCell,value:i,active:!1,waiting:"accept"};let{computedColumnsMap:s}=this.getComputed(),u=s.get(l),c=t.shouldAcceptEdit??u.shouldAcceptEdit,d=c?c({...Wt({...this.context,api:this,dataSourceApi:this.context.dataSourceApi,columnId:l,rowIndex:a}),value:i,initialValue:o.initialValue}):!0;return await new Promise(p=>requestAnimationFrame(p)),Promise.resolve(d).then(p=>{if(p===!0)return this.actions.editingCell={...t.editingCell,active:!1,accepted:!0,persisted:!1,waiting:"persist",value:i},!0;throw p}).catch(p=>(p instanceof Error||(p=new Error(`Edit rejected: ${p}`)),this.actions.editingCell={...o,value:i,persisted:!1,active:!1,waiting:!1,accepted:p},{reject:p,value:i}))}return e.cancel&&o?.active?(this.actions.editingCell={...o,active:!1,cancelled:!0,waiting:!1,persisted:!1},{cancel:!0,value:i}):e.reject&&o?.active?(this.actions.editingCell={...o,value:i,active:!1,persisted:!1,waiting:!1,accepted:e.reject},{reject:e.reject,value:i}):!0};this.cancelEdit=()=>this.stopEdit({cancel:!0});this.rejectEdit=e=>this.stopEdit({reject:e});this.getColumnAtIndex=e=>this.getComputed().computedVisibleColumns[e]??null;this.isCellEditable=e=>{let{rowIndex:t,primaryKey:o,columnId:r}=e,i=t??this.context.dataSourceApi.getIndexByPrimaryKey(o),{computedColumnsMap:a}=this.getComputed(),l=a.get(r);if(!l||!l.computedEditable||l.groupByForColumn)return Promise.resolve(!1);let s=this.getDataSourceState().dataArray[i];if(!s||s.isGroupRow)return Promise.resolve(!1);if(l.computedEditable===!0)return Promise.resolve(!0);let u=l.computedEditable(Wt({...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,o=this.columnApiById.get(t);if(o)return o;let r=ft(e,{...this.context,api:this});return r&&this.columnApiById.set(r.getColumnId(),r),r};this.isColumnSortable=e=>this.getColumnApi(e)?.isSortable()??!1;this.getCellValue=e=>this.getCellValues(e)?.value??null;this.getCellValues=e=>{let{rowIndex:t,primaryKey:o,columnId:r}=e,{dataSourceApi:i,getState:a}=this.context,{computedColumnsMap:l}=this.getComputed(),s=t??i.getIndexByPrimaryKey(o),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=Eo({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 o={...this.getState().columnGroupVisibility};t?delete o[e]:o[e]=!1,this.actions.columnGroupVisibility=o};this.collapseAllGroupRows=()=>{let e=this.getDataSourceState(),t=new Pt(e.groupRowsState);t.collapseAll(),this.dataSourceActions.groupRowsState=t};this.collapseGroupRow=e=>this.getDataSourceState().groupRowsState.isGroupRowExpanded(e)?(this.toggleGroupRow(e),!0):!1;this.expandGroupRow=e=>this.getDataSourceState().groupRowsState.isGroupRowCollapsed(e)?(this.toggleGroupRow(e),!0):!1;this.toggleGroupRow=e=>{let t=this.getDataSourceState(),o=new Pt(t.groupRowsState);if(o.toggleGroupRow(e),this.dataSourceActions.groupRowsState=o,t.lazyLoad){let r=[Tt,...e],i=t.originalLazyGroupData.get(r);o.isGroupRowExpanded(e)?i?.cache||on(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=W.clone(t.lazyLoadCacheOfLoadedBatches),t.originalLazyGroupData.delete(r),this.dataSourceActions.originalLazyGroupDataChangeDetect=At())}};this.toggleSortingForColumn=(e,t)=>{if(!this.getComputed().computedColumnsMap.get(e))return;let r=this.getSortingForColumn(e);r===null?r=1:r=r===1?-1:null,this.setSortingForColumn(e,r,t)};this.getState=()=>this.context.getState();this.getComputed=()=>this.context.getComputed();this.getDataSourceState=()=>this.context.getDataSourceState();this.scrollCellIntoView=(e,t,o={offset:0})=>{let r=this.getState(),i=this.getComputed(),a=t;if(typeof t=="string"){let g=i.computedVisibleColumnsMap.get(t);if(!g)return!1;a=g.computedVisibleIndex}if(r.brain.isHorizontalLayoutBrain){o=o||{};let g=r.brain.getPageIndexForRow(e);o.horizontalLayoutPageIndex=g||0}let l=r.renderer.getScrollPositionForScrollColumnIntoView(a,o),s=r.renderer.getScrollPositionForScrollRowIntoView(e,o);if(!l||!s)return!1;let 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+(o.offset||0),m=u.scrollTop>p+(o.offset||0);return f&&m?!1:(u.scrollLeft!==c.scrollLeft&&!f&&this.setNativeScroll({scrollLeft:u.scrollLeft}),u.scrollTop!==c.scrollTop&&!m&&this.setNativeScroll({scrollTop:u.scrollTop}),!0)};this.context=e,this.rowSelectionApi=Cf({dataSourceActions:e.dataSourceActions,getDataSourceState:e.getDataSourceState}),this.keyboardNavigationApi=Ug({getState:e.getState,getDataSourceState:e.getDataSourceState,actions:e.actions,getComputed:e.getComputed,api:this,dataSourceApi:e.dataSourceApi}),this.rowDetailApi=Wg({getState:e.getState,actions:e.actions,dataSourceApi:e.dataSourceApi}),this.cellSelectionApi=Bg({dataSourceActions:e.dataSourceActions,getDataSourceState:e.getDataSourceState,getComputed:e.getComputed})}get actions(){return this.context.actions}get dataSourceActions(){return this.context.dataSourceActions}get dataSourceApi(){return this.context.dataSourceApi}focus(){this.getState().scrollerDOMRef.current?.focus()}hideContextMenu(){this.actions.contextMenuVisibleFor=null,this.actions.cellContextMenuVisibleFor=null}realignColumnContextMenu(e){let t={actions:this.actions,getState:this.getState,getComputed:this.getComputed},o=this.getState().columnMenuRealignDelay;(!o||o<0)&&(nu(t),e?.()),setTimeout(()=>{this.isDestroyed()||(nu(t),e?.())},o)}isDestroyed(){return!this.getState().domRef.current}async startEdit(e){let{columnId:t,rowIndex:o,primaryKey:r,value:i}=e,a=o??this.context.dataSourceApi.getIndexByPrimaryKey(r);return this.isCellEditable({rowIndex:a,columnId:t}).then(async l=>{if(l){let s=this.getDataSourceState().dataArray,c=this.getComputed().computedColumnsMap.get(t),d=s[a],p=i??Mf({column:c,rowInfo:d}),f=p;c.getValueToEdit&&(p=await c.getValueToEdit(Wt({...this.context,rowIndex:a,columnId:t,api:this}))),this.actions.editingCell={active:!0,accepted:!1,persisted:!1,columnId:t,value:p,initialValue:f,rowIndex:a,primaryKey:s[a]?.id}}return l})}setSortingForColumn(e,t,o){let{computedColumnsMap:r}=this.getComputed(),i=r.get(e);if(!i||this.getSortingForColumn(e)===t&&this.getDataSourceState().multiSort===!1)return;if(t===null){this.setSortInfoForColumn(e,null,o);return}let l=!!i.pivotColumn,s=i.groupByForColumn,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(yn);d.length&&(u=d);let p=i.computedSortType;if(c.length&&p===Zt){let m=this.getState().initialColumns;p=c.flatMap(h=>{let S=h.field??h.groupField,y=S?r.get(S):null;if(y)return y.computedSortType;let C=S?Hn(m,S):void 0;return C?C.sortType||(typeof C.type=="string"?C.type:"string"):[Zt]})}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,o)}setSortInfoForColumn(e,t,o){let r=this.getDataSourceState(),i=this.getComputed().computedColumnsMap.get(e);if(!i)return;if(!r.multiSort){this.dataSourceApi.setSortInfo(t?[t]:null);return}let a=i.field,l={id:e,field:a},s=r.sortInfo?.slice()??[];if(t===null){s=s.filter(d=>!$g(d,l)),this.dataSourceApi.setSortInfo(s);return}let u=!1;if((o?.multiSortBehavior??this.getState().multiSortBehavior)==="replace"){this.dataSourceApi.setSortInfo([t]);return}s=s.map(d=>u?d:$g(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 o={...this.getState().columnPinning};t===!1?delete o[e]:o[e]=t,this.actions.columnPinning=o}setColumnFilter(e,t){this.getState().pendingColumnFilters.cancel(e);let o=this.getComputed().computedColumnsMap.get(e);if(!o)return;let r=this.getDataSourceState(),{filterTypes:i}=r,a;if(o.computedFilterValue)a={...o.computedFilterValue,filter:{...o.computedFilterValue.filter}};else{let l=o.computedFilterType;if(!i[l])return;let s={filter:{type:l,value:t,operator:i[l].defaultOperator},valueGetter:o.valueGetter};(o.field||typeof o.groupByForColumn=="string")&&(s.field=o.field||o.groupByForColumn),a=s}a.id=o.id,a.filter.value=t,this.setFilterValueForColumn(e,a)}setColumnFilterOperator(e,t){this.getState().pendingColumnFilters.cancel(e);let o=this.getComputed().computedColumnsMap.get(e);if(!o)return;let r=this.getDataSourceState(),{filterTypes:i}=r,a=o.computedFilterType,l=i[a].operators,s=l.find(d=>d.name===t)??l.find(d=>d.name===i[a].defaultOperator),u=s.name,c;o.computedFilterValue?(c={...o.computedFilterValue,filter:{...o.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:o.valueGetter},o.field&&(c.field=o.field)),c.id=o.id,this.setFilterValueForColumn(e,c)}setFilterValueForColumn(e,t){this.getState().pendingColumnFilters.cancel(e);let o=this.getComputed().computedColumnsMap.get(e);if(!o)return;let i=this.getDataSourceState().filterValue??[],a=!1;i=i.map(l=>l===o.computedFilterValue?(a=!0,t):l),a||i.push(t),this.dataSourceActions.filterValue=i}removeColumnFilter(e){this.getState().pendingColumnFilters.cancel(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){this.getState().pendingColumnFilters.cancel(e);let t=this.getComputed().computedColumnsMap.get(e);if(!t)return;let o=this.getDataSourceState(),r=o.filterValue??[],i=!1;r=r.map(a=>{if(a===t.computedFilterValue){let l=t.computedFilterValue.filter.type,s=o.operatorsByFilterType[l],u=o.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(yn),i&&(this.dataSourceActions.filterValue=r)}setVisibilityForColumn(e,t){let o={...this.getState().columnVisibility};t?delete o[e]:o[e]=!1,this.actions.columnVisibility=o}getVisibleColumnsCount(){return this.getComputed().computedVisibleColumns.length}setColumnVisibility(e){this.actions.columnVisibility=e}get scrollContainer(){return this.getState().scrollerDOMRef.current}setNativeScroll(e){let t=this.getState(),o=t.scrollerDOMRef.current;if(!o)return;let r=t.brain.toNativeScrollPosition({scrollTop:e.scrollTop??0,scrollLeft:e.scrollLeft??0});e.scrollTop!==void 0&&(o.scrollTop=r.scrollTop),e.scrollLeft!==void 0&&(o.scrollLeft=r.scrollLeft)}get scrollLeftMax(){return this.getState().brain.scrollLeftMax}get scrollTopMax(){return this.getState().brain.scrollTopMax}get scrollLeft(){return this.getState().brain.getScrollPosition().scrollLeft}set scrollLeft(e){this.setNativeScroll({scrollLeft:Math.max(e,0)})}get scrollTop(){return this.getState().brain.getScrollPosition().scrollTop}set scrollTop(e){this.setNativeScroll({scrollTop:Math.max(e,0)})}scrollRowIntoView(e,t={offset:0}){let o=this.getState(),r=this.getComputed(),i=o.brain.getScrollPosition(),a=t.columnId,l;!a&&o.brain.isHorizontalLayoutBrain&&r.computedVisibleColumns.length>0&&(a=r.computedVisibleColumns[Math.ceil(r.computedVisibleColumns.length/2)].id,l=r.computedVisibleColumnsMap.get(a)?.computedVisibleIndex);let s=o.renderer.getScrollPositionForScrollRowIntoView(e,{...t,colIndex:l});if(!s)return!1;let u=o.brain.scrollTopMax,c=s.scrollLeft!==i.scrollLeft,d=s.scrollTop<=u+(t.offset||0);return!d&&!c?!1:(d&&s.scrollTop!==i.scrollTop&&this.setNativeScroll({scrollTop:s.scrollTop}),c&&this.setNativeScroll({scrollLeft:s.scrollLeft}),!0)}scrollColumnIntoView(e,t={offset:0}){let o=this.getState(),i=this.getComputed().computedVisibleColumnsMap.get(e);if(!i)return!1;let a=i.computedVisibleIndex,l=o.renderer.getScrollPositionForScrollColumnIntoView(a,t);if(!l)return!1;let s=o.brain.getScrollPosition(),u=o.brain.scrollLeftMax;return l.scrollLeft>u+(t.offset||0)?!1:(l.scrollLeft!==s.scrollLeft&&this.setNativeScroll({scrollLeft:l.scrollLeft}),!0)}};function Yg(n){return new lu(n)}import{useEffect as Xg,useRef as Mw,useState as Ew}from"react";var xw=10;function qg(n,e){let{includeHeader:t,columnsToResize:o,columnsToSkip:r}=e,i=`.${Jt} > .${yr}`,a=n.current?.querySelectorAll(i),l={},s={};return a&&a.length&&a.forEach(u=>{let c=u.parentElement,d=c.matches(`.${bt}`);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(...Nt.split(" ")),f.style.position="absolute",f.style.width="auto",c.appendChild(f);let m=f.offsetWidth;if(c.removeChild(f),!s[p]){let g=_e().getComputedStyle(c);s[p]=parseInt(g.paddingLeft,10)+parseInt(g.paddingRight,10)+parseInt(g.borderLeftWidth,10)+parseInt(g.borderRightWidth,10)+xw}if(m+=s[p],d){let g=0;c.childNodes.forEach(h=>{if(h!==u&&h.nodeType===1){let S=h,y=Math.max(S.offsetWidth,parseInt(S.style.width,10));if(isNaN(y)&&(y=0),g+=y,y>0){let C=_e().getComputedStyle(S);g+=parseInt(C.marginLeft,10)+parseInt(C.marginRight,10)}}}),m+=g}r&&r.has(p)||o&&!o.has(p)||(l[p]=Math.max(m,l[p]||0))}),l}function Zg(){let{getComponentState:n,componentActions:e,componentState:{domRef:t,ready:o,autoSizeColumnsKey:r,brain:i}}=Ft(),[a,l]=Ew(0),s=typeof r=="object"?r.key:r,u=Ne(s),c=Mw(null);Xg(()=>{if(u()==null)return;let{current:p}=c,f=()=>{r!==p&&l(a+1)};return i.onRenderRangeChange(f)},[i]),Xg(()=>{if(s==null)return;let{autoSizeColumnsKey:d}=n(),p,f,m=!0;typeof d=="object"&&(d.columnsToResize&&(p=new Set(d.columnsToResize)),d.columnsToSkip&&(f=new Set(d.columnsToSkip)),m=d.includeHeader??m),c.current=s;let g=qg(t,{includeHeader:m,columnsToResize:p,columnsToSkip:f}),h=Object.keys(g);if(!h.length)return;let S=n().columnSizing,y={...S},C=!1;h.forEach(b=>{y[b]={width:g[b]},C=C||y[b].width!==S[b]?.width}),C&&(e.columnSizing=y)},[s,o,a])}import{useEffect as cP,useMemo as dP,useState as Au}from"react";var wa=class{constructor(e){this.multiSelectStartPosition={rowIndex:0,colIndex:0};this.getPrimaryKeyByIndex=e.getPrimaryKeyByIndex,this.getColumnIdByIndex=e.getColumnIdByIndex}getCellSelectionPosition(e){let{rowIndex:t,colIndex:o}=e,r=this.getPrimaryKeyByIndex(t),i=this.getColumnIdByIndex(o);if(!(r===void 0||!i))return[r,i]}set cellSelectionState(e){this._cellSelectionState=e}get cellSelectionState(){return this._cellSelectionState}resetClick(e){this.cellSelectionState.deselectAll();let t=this.getCellSelectionPosition(e);t&&(this.cellSelectionState.deselectAll(),this.cellSelectionState.selectCell(...t),this.multiSelectStartPosition=e,this.multiSelectEndPosition=void 0)}singleAddClick(e){let t=this.getCellSelectionPosition(e);if(t)if(this.cellSelectionState.isCellSelected(...t)){this.cellSelectionState.deselectCell(...t);let o={rowIndex:e.rowIndex+1,colIndex:e.colIndex};this.getCellSelectionPosition(o)&&(this.multiSelectStartPosition=o)}else this.cellSelectionState.selectCell(...t),this.multiSelectStartPosition=e,this.multiSelectEndPosition=void 0}multiSelectClick(e,t){!this.multiSelectStartPosition||!this.getCellSelectionPosition(e)||(this.multiSelectEndPosition&&this.deselectRange(this.multiSelectStartPosition,this.multiSelectEndPosition,t),this.selectRange(this.multiSelectStartPosition,e,t),this.multiSelectEndPosition=e)}setRangeSelected(e,t,o,r){if(r.horizontalLayout&&!ou(e,t,r)){Kg(e,t,{rowsPerPage:r.rowsPerPage,columnsPerSet:r.columnsPerSet}).forEach(c=>{let d=this.getCellSelectionPosition({rowIndex:c.rowIndex,colIndex:c.colIndex});d&&(o?this.cellSelectionState.selectCell(...d):this.cellSelectionState.deselectCell(...d))});return}let[i,a]=Ia(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&&(o?this.cellSelectionState.selectCell(...d):this.cellSelectionState.deselectCell(...d))}}deselectRange(e,t,o){this.setRangeSelected(e,t,!1,o)}selectRange(e,t,o){this.setRangeSelected(e,t,!0,o)}};function Aw(n,e){return n<e?[n,e]:[e,n]}var va=class{constructor(e){this.multiSelectStartIndex=0;this.getRowAt=e.getRowAt,this.isNodeSelectable=e.isNodeSelectable??(()=>!0)}set rowSelectionState(e){this._rowSelectionState=e,this._treeSelectionState=void 0}get rowSelectionState(){return this._rowSelectionState}set treeSelectionState(e){this._treeSelectionState=e}get treeSelectionState(){return this._treeSelectionState}deselectAll(){(this._treeSelectionState??this._rowSelectionState).deselectAll()}isContainerRow(e){return e.isGroupRow||!!e.isParentNode}isExpanded(e){return e.isGroupRow?!e.collapsed:!!e.nodeExpanded}getPath(e){if(e)return this._treeSelectionState?e.nodePath:this.getGroupKeys(e)}getGroupKeys(e){return e.groupKeys&&e.groupKeys.length?e.groupKeys:void 0}setSelectedAt(e,t){let o=this.getRowAt(e);if(!o||o.rowDisabled||o.selfLoaded===!1)return;let r=this._treeSelectionState;if(r){o.nodePath&&this.isNodeSelectable(o)&&r.setNodeSelection(o.nodePath,t);return}let i=this.rowSelectionState,a=this.getGroupKeys(o);if(o.isGroupRow){if(!a)return;t?i.selectGroupRow(a):i.deselectGroupRow(a);return}t?i.selectRow(o.id,a):i.deselectRow(o.id,a)}isSelectedAt(e){let t=this.getRowAt(e);if(!t)return!1;if(this._treeSelectionState)return t.nodePath?this._treeSelectionState.isNodeSelected(t.nodePath):!1;let o=this.getGroupKeys(t);return t.isGroupRow?o?this.rowSelectionState.isGroupRowSelected(o):!1:this.rowSelectionState.isRowSelected(t.id,o)}setRangeSelected(e,t,o){let[r,i]=Aw(e,t);for(let a=r;a<=i;a++){let l=this.getRowAt(a);l&&(a!==e&&this.isFollowedByItsChildren(a,l)||this.setSelectedAt(a,o))}}isFollowedByItsChildren(e,t){if(!this.isContainerRow(t)||!this.isExpanded(t))return!1;let o=this.getPath(t),r=this.getPath(this.getRowAt(e+1));return!o||!r||r.length<o.length?!1:o.every((i,a)=>i===r[a])}resetClick(e){this.deselectAll(),this.setSelectedAt(e,!0),this.multiSelectStartIndex=e,this.multiSelectEndIndex=void 0}singleAddClick(e){if(this.isSelectedAt(e))this.setSelectedAt(e,!1),this.isSelectedAt(e+1)&&(this.multiSelectStartIndex=e+1);else{this.setSelectedAt(e,!0),this.multiSelectStartIndex=e;let t;for(let o=e-1;o>=0&&this.isSelectedAt(o);o--)t=o;this.multiSelectEndIndex=t}}multiSelectClick(e){this.multiSelectEndIndex!=null&&this.setRangeSelected(this.multiSelectStartIndex,this.multiSelectEndIndex,!1),this.setRangeSelected(this.multiSelectStartIndex,e,!0),this.multiSelectEndIndex=e}};import{useMemo as Wv}from"react";import*as jh from"react";var _w=()=>{};function Ow(n,e){let t=new W,o=e.nodesKey??"children",r=e.emptyGroup??{},i=typeof e.pathKey=="function"?e.pathKey:l=>l[e.pathKey];for(let l of n){let s=i(l);for(let 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[o]??[]:[];a(d,f),f.length&&(p||(p=typeof r=="function"?r(d,f):r),p[o]=f),s.push(p)}return s}return a([],[])}function Qg(n,e,t,o){let{isLeafNode:r,getNodeChildren:i,toKey:a}=n,{onParentNode:l,onNode:s,onLeafNode:u}=e,c=a(o),d=[...t,c],p=r(o),f=pt(()=>{let m=i(o);if(!(!m||!Array.isArray(m)))for(let g=0,h=m.length;g<h;g++){let S=m[g];Qg(n,e,d,S)}});p?(u?.(o),s?.(o,_w)):(l?.(o,f,i(o)),s?.(o,f))}function Jg(n,e,t){for(let o=0,r=t.length;o<r;o++)Qg(n,e,[],t[o])}var eh=new Uint8Array(new Uint32Array([1]).buffer)[0]===1;function th(n,e,t){let o=n.length,r=new Float64Array(o);for(let p=0;p<o;p++){let f=e(n[p]);if(typeof f!="number"||f!==f)return!1;r[p]=(t<0?-f:f)+0}if(o<2)return!0;let i=new Uint32Array(r.buffer),a=eh?0:1,l=eh?1:0,s=new Uint32Array(8*256);for(let p=0;p<o;p++){let f=i[2*p+a],m=i[2*p+l];m&2147483648?(m=~m>>>0,f=~f>>>0,i[2*p+a]=f):m=(m|2147483648)>>>0,i[2*p+l]=m,s[f&255]++,s[256+(f>>>8&255)]++,s[512+(f>>>16&255)]++,s[768+(f>>>24)]++,s[1024+(m&255)]++,s[1280+(m>>>8&255)]++,s[1536+(m>>>16&255)]++,s[1792+(m>>>24)]++}let u=new Uint32Array(o),c=new Uint32Array(o);for(let p=0;p<o;p++)u[p]=p;for(let p=0;p<8;p++){let f=p<4?a:l,m=p%4*8,g=p*256;if(s[g+(i[f]>>>m&255)]===o)continue;let h=0;for(let y=0;y<256;y++){let C=s[g+y];s[g+y]=h,h+=C}for(let y=0;y<o;y++){let C=u[y],b=i[2*C+f]>>>m&255;c[s[g+b]++]=C}let S=u;u=c,c=S}let d=n.slice();for(let p=0;p<o;p++)n[p]=d[u[p]];return!0}var su=function(n,e){return n-e},Fw=new Set(["ca","de","de-AT","en","en-DE","en-GB","en-US","fi","fr","id","id-ID","it","ms","nl","pl","pt","ro","sl","sv","sw","vi"]),Pa;function Nw(){try{let n=new Intl.Collator;return Fw.has(n.resolvedOptions().locale)?null:n}catch{return null}}var Lw=function(n,e){return n=`${n}`,e=`${e}`,Pa===void 0&&(Pa=Nw()),Pa?Pa.compare(n,e):n.localeCompare(e)},kw=function(n,e){return n-e},zw={number:su,string:Lw,date:kw},Fn=zw;function nh(n){return n.map(t=>Array.isArray(t.field)?t.field.map((o,r)=>{let i=Array.isArray(t.type)?t.type[r]??t.type[0]:t.type;return typeof o=="function"?{...t,valueGetter:o,field:void 0,type:i}:{...t,type:i,field:o}}):t).flat()}var $t=(n,e,t)=>{let o=typeof t=="function"?t:t?.get,r=t&&typeof t=="object"?t.marker:void 0;r&&r.start();let i=nh(n);return Gw(i,e,o)||e.sort(oh(i,o)),r&&r.end(),e},uu=(n,e,t)=>{let{marker:o}=t;o&&o.start();let r=oh(nh(n),t.get),i=t.depthFirst??!1,a=t.inplace??!1;i||(a?e.sort(r):e=[...e].sort(r));let{nodesKey:l,toKey:s}=t,u=d=>d[l],c=d=>d[l]===void 0;return Jg({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)),o&&o.end(),e};$t.knownTypes=Fn;function Gw(n,e,t){if(n.length!==1||e.length<1e3)return!1;let o=n[0];if(!o||o.fn||!o.type||o.dir!==1&&o.dir!==-1)return!1;let r=Array.isArray(o.type)?o.type[0]:o.type;if($t.knownTypes[r]!==su)return!1;let{field:i,valueGetter:a}=o;return th(e,l=>(t&&(l=t(l)),a?a(l):i?l[i]:l),o.dir)}var Hw=n=>{if(!n)return;let e=n.field,t=n.valueGetter,o=n.dir<0?-1:n.dir>0?1:0;if(!o)return;let r=n.fn;if(!r&&n.type){let i=Array.isArray(n.type)?n.type[0]:n.type;r=$t.knownTypes[i],r||console.warn(`Unknown sort type "${n.type}" - please pass one of ${Object.keys($t.knownTypes).join(", ")}`)}return r||(r=Fn.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:o*u}},Kw=n=>n.map(Hw).filter(e=>e instanceof Function),oh=(n,e)=>{let t=Kw(n);return(o,r)=>{e&&(o=e(o),r=e(r));let i=0,a=0,l,s=t.length;for(;a<s;a++)if(l=t[a],!!l&&(i=l(o,r),i!==0))return i;return i}};import*as Bw from"react";function cu(n){return Fe(e=>n(e.dataSourceState))}var Ww=Xe("IT:InfiniteTable"),jw="#dc3545",Uw="#eb9316";var ih="Warn",ah="Error",$w="Info",Yw="Success",qw="Logs",Da=Ww.extend(qw),rB=Da.extend($w),Xw=Da.extend(ih),Zw=Da.extend(ah),iB=Da.extend(Yw);var Qw=Uw,Jw=jw;var ev=(n,e)=>{e=e?e.extend?e.extend(ih):e:Xw,e(typeof e.color=="function"?e.color(Qw,n):n)},tv=(n,e)=>{e=e?e.extend?e.extend(ah):e:Zw,e(typeof e.color=="function"?e.color(Jw,n):n)};var rh=new W,lh=(n,...e)=>{rh.has(e)||(rh.set(e,!0),n())};var sh=(n,e=n,t)=>{lh(()=>ev(n,t),e,"warn")},uh=(n,e=n,t)=>{lh(()=>tv(n,t),e,"error")};var du=new WeakMap,nv=n=>n;function ch(n,e=50,t){du.set(n,{lastCallTime:0,lastCallArg:null});let o=t??nv;return r=>{let{lastCallTime:i,lastCallArg:a}=du.get(n)||{lastCallTime:0,lastCallArg:null},l=Date.now(),s=l-i,u=St(o(a),o(r));s<e&&u||(du.set(n,{lastCallTime:l,lastCallArg:r}),n(r))}}var xa=class{constructor(){this.primaryKeyToData=new Map;this.nodePathsToData=new W;this.removeNodePath=(e,t)=>{if(this.nodePathsToData.delete(e),this.remove(e[e.length-1]),!t)return;let o=this.nodePathsToData.get(e);if(o){let r=t.getNodeChildren?t.getNodeChildren(o):t.nodesKey?o[t.nodesKey]:null;if(r&&Array.isArray(r))for(let i=0,a=r.length;i<a;i++){let l=r[i],s=[...e,t.toPrimaryKey(l)];this.removeNodePath(s,t)}}};this.remove=e=>{this.primaryKeyToData.delete(e)};this.add=(e,t)=>{this.primaryKeyToData.set(e,t)};this.addNodePath=(e,t,o)=>{if(this.nodePathsToData.set(e,t),this.add(e[e.length-1],t),!o)return;let r=o.getNodeChildren?o.getNodeChildren(t):o.nodesKey?t[o.nodesKey]:null;if(r&&Array.isArray(r))for(let i=0,a=r.length;i<a;i++){let l=r[i],s=[...e,o.toPrimaryKey(l)];this.addNodePath(s,l,o)}};this.clear=()=>{this.primaryKeyToData.clear(),this.nodePathsToData.clear()};this.getDataForPrimaryKey=e=>this.primaryKeyToData.get(e);this.getDataForNodePath=e=>this.nodePathsToData.get(e);this.indexArray=(e,t)=>{let{cache:o,toPrimaryKey:r,getNodeChildren:i,isLeafNode:a,nodesKey:l}=t,s=!!i&&!!a;o&&o.shouldResetDataSource()&&(this.clear(),e=[]);let u=o&&!o.isEmpty();if(u&&(e=e.concat()),!e.length&&o){if(!o.isEmpty()){let c=[...o.getMutationsArray(),...o.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)}}o?.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 h=r(m),S=s?[...p,h]:void 0,y=s&&!!S,C=y?o?.getMutationsForNodePath(S):o?.getMutationsForPrimaryKey(h);if(C&&C.length){for(let b=0,I=C.length;b<I;b++){let T=C[b];if(T.type==="delete"&&!g&&(y?this.removeNodePath(S,t):this.remove(h),g=!0,d.splice(f,1),f--),T.type==="update"&&!g&&(m={...m,...T.data},d[f]=m),T.type==="update-children"&&!g){let R=T.children(m[l],m);m={...m},R!==void 0?m[l]=R:delete m[l],d[f]=m}T.type==="insert"&&(T.position==="before"?(d.splice(f,0,T.data),f--):d.splice(f+1,0,T.data))}y?o?.removeNodePathInfo(S):o?.removeInfo(h)}if(!g)if(y){this.addNodePath(S,m);let b=a(m),I=b?null:i(m);!b&&Array.isArray(I)&&(p.push(h),u&&(m[l]=I=I.concat()),c(I,p),p.pop())}else this.add(h,m)}}};c(e,[])}return e}}};var ov=Object.freeze([]),dh=(n,e)=>{let t=n??ov,o=Array.isArray(t)?t:[t];if(e&&e.has(t)){let r=e.get(t);if(r&&r.length===o.length)return r}return e&&t&&e.set(t,o),o};var Dt=class extends Vo{constructor(t){super(t);this.isRowEnabled=t=>!!this.isItemPositive(t)}getState(){let t=this.allPositive?!0:[...this.positiveMap?.keys()??[]],o=this.allNegative?!0:[...this.negativeMap?.keys()??[]];return{enabledRows:t,disabledRows:o}}getPositiveFromState(t){return t.enabledRows}getNegativeFromState(t){return t.disabledRows}areAllDisabled(){return this.areAllNegative()}areAllEnabled(){return this.areAllPositive()}disableAll(){this.makeAllNegative()}enableAll(){this.makeAllPositive()}isRowDisabled(t){return!this.isRowEnabled(t)}setRowEnabled(t,o){return this.setItemValue(t,o)}disableRow(t){this.setRowEnabled(t,!1)}enableRow(t){this.setRowEnabled(t,!0)}toggleRow(t){this.toggleItem(t)}};function Ma(n,e){if(n===e)return!0;if(n==null||e==null)return n===e;if(typeof n!=typeof e)return!1;if(n instanceof Date||e instanceof Date)return n instanceof Date&&e instanceof Date&&n.getTime()===e.getTime();if(Array.isArray(n)&&Array.isArray(e)){if(n.length!==e.length)return!1;for(let t=0,o=n.length;t<o;t++)if(!Ma(n[t],e[t]))return!1;return!0}if(typeof n=="object"){let t=Object.keys(n),o=Object.keys(e);if(t.length!==o.length)return!1;for(let r of t)if(!Object.prototype.hasOwnProperty.call(e,r)||!Ma(n[r],e[r]))return!1;return!0}return!1}function rv(n,e){return!(n===void 0||e===void 0||n.isGroupRow!==e.isGroupRow||n.dataSourceHasGrouping!==e.dataSourceHasGrouping||n.isTreeNode!==e.isTreeNode||n.isTreeNode&&n.isParentNode!==e.isParentNode)}var Ea={id:!0,value:!0,indexInAll:!0,rowSelected:!0,rowDisabled:!0,isCellSelected:!1,hasSelectedCells:!1},ph={...Ea,dataSourceHasGrouping:!0,isTreeNode:!0,data:!1,isGroupRow:!0,selfLoaded:!0},iv={indexInGroup:!0,groupKeys:!0,groupBy:!0,rootGroupBy:!0,parents:!1,indexInParentGroups:!0,groupCount:!0,groupNesting:!0,collapsed:!0,selfLoaded:!0},av={...Ea,...iv,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},fh={isTreeNode:!0,isParentNode:!0,indexInParent:!0,nodePath:!0,parentNodes:!1,indexInParentNodes:!0,totalLeafNodesCount:!0,collapsedLeafNodesCount:!0,treeNesting:!0,selfLoaded:!0},lv={...Ea,...fh,dataSourceHasGrouping:!0,isTreeNode:!0,isGroupRow:!0,isParentNode:!0,data:!1},sv={...Ea,...fh,dataSourceHasGrouping:!0,isParentNode:!0,isGroupRow:!0,nodeExpanded:!0,selfExpanded:!0,data:!1,selectedLeafNodesCount:!0,deepRowInfoArray:!1,deselectedLeafNodesCount:!0,duplicateOf:!1},uv=Object.entries(ph).map(([n,e])=>e?n:void 0).filter(Boolean),cv=Object.entries(ph).map(([n,e])=>e?n:void 0),dv=Object.entries(av).map(([n,e])=>e?n:void 0),pv=Object.entries(lv).map(([n,e])=>e?n:void 0),fv=Object.entries(sv).map(([n,e])=>e?n:void 0);function mv(n,e){if(n===e)return!0;if(!n||!e||!rv(n,e)||n.id!==e.id||n.data!==e.data&&!Ma(n.data,e.data))return!1;let t=[];n.dataSourceHasGrouping?t=n.isGroupRow?dv:cv:n.isTreeNode?t=n.isTreeNode&&n.isParentNode?fv:pv:t=uv;for(let o of t){let r=n[o],i=e[o];if(!(typeof r=="function"||typeof i=="function")&&!Ma(r,i))return!1}return!0}function mh(){let n=[],e=new Map,t=new Set,o={dataSourceState:void 0,previousDataSourceState:void 0},r=(p,f)=>{let m=n,g=f?.marker,S=p!==m&&t.size>0;S&&(o={dataSourceState:f?.dataSourceState,previousDataSourceState:f?.previousDataSourceState}),g&&g.start({details:[{name:"new dataArray length",value:p.length},{name:"old dataArray length",value:m.length}]});let y=[],C=l();for(let b of C){let I=m[b],T=p[b];if(T===void 0){y.push(b);continue}mv(I,T)||y.push(b)}n=p,(y.length>0||S)&&queueMicrotask(()=>{for(let b=0,I=y.length;b<I;b++){let T=y[b],R=e.get(T);if(R)for(let v of R)v()}if(S)for(let b of Array.from(t))b()}),g&&g.end({details:[{name:"updated row infos",value:y.length}]})},i=p=>n[p],a=(p,f)=>{let m=e.get(p);return m||(m=new Set,e.set(p,m)),m.add(f),()=>{let g=e.get(p);g&&(g.delete(f),g.size===0&&e.delete(p))}},l=()=>Array.from(e.keys());return{notifyDataArray:r,getRowInfoAtIndex:i,subscribeToRowIndex:a,subscribeToDataArrayChange:p=>(t.add(p),()=>{t.delete(p),t.size===0&&(o={dataSourceState:void 0,previousDataSourceState:void 0})}),getDataSourceStates:()=>o,getDataArray:()=>n,clear:()=>{n=[],e.clear(),t.clear(),o={dataSourceState:void 0,previousDataSourceState:void 0}}}}var rn=new Map,an=new Map,Nn=new Map,ln=new Map,Yt=new Map;var gv=Symbol("cursorId"),gh=n=>n.totalLeafNodesCount===0,hv=n=>n.isParentNode?!gh(n):!0;function hh(n){let e=Date.now(),t=[],o=[],r=new W;return{logger:Et(`${n.debugId}:DataSource`),debugTimings:new Map,debugWarnings:new Map,devToolsDetected:!!globalThis.__INFINITE_TABLE_DEVTOOLS_HOOK__,rowInfoStore:mh(),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 W,waitForNodePathPromises:new W,getDataSourceMasterContextRef:{current:()=>{}},cache:void 0,detailDataSourcesStateToRestore:new Map,stateReadyAsDetails:!1,originalDataArrayChanged:!1,originalDataArrayChangedInfo:{timestamp:0,mutations:void 0},rowsPerPage:null,lazyLoadCacheOfLoadedBatches:new W,dataParams:void 0,onCleanup:he(),notifyScrollbarsChange:he(),notifyScrollStop:he(),notifyRenderRangeChange:he(),pivotTotalColumnPosition:"end",pivotGrandTotalColumnPosition:!1,scrollStopDelayUpdatedByTable:100,originalLazyGroupData:r,originalLazyGroupDataChangeDetect:0,originalDataArray:t,cursorId:gv,showSeparatePivotColumnForSingleAggregation:!1,propsCache:new Map([["sortInfo",new WeakMap],["rowDisabledState",new WeakMap],["isRowDisabled",new WeakMap],["cellSelection",new WeakMap],["treeSelection",new WeakMap],["treeExpandState",new WeakMap],["groupRowsState",new WeakMap]]),rowInfoReducerResults:void 0,pivotMappings:void 0,pivotColumns:void 0,pivotColumnGroups:void 0,dataArray:o,unfilteredCount:o.length,filteredCount:o.length,updatedAt:e,groupedAt:0,sortedAt:0,treeAt:0,filteredAt:0,reducedAt:e,generateGroupRows:!0,groupDeepMap:void 0,reducerResults:void 0,allRowsSelected:!1,someRowsSelected:!1,postSortDataArray:void 0,postGroupDataArray:void 0,lastSortDataArray:void 0,lastGroupDataArray:void 0,forceRerenderTimestamp:0}}function yv(n){let e={...n};return delete e.originalDataArray,e}var Sv=[],yh=n=>{n.destroyedRef.current=!0,n.__apiRef.current=null,n.lastSelectionUpdatedNodePathRef.current=null,n.lastExpandStateInfoRef.current={state:"collapsed",nodePath:null},n.treeExpandState?.destroy(),n.treePaths?.clear(),n.unfilteredTreePaths?.clear(),n.waitForNodePathPromises.clear(),n.pathToIndexMap?.clear(),n.rowDisabledState?.destroy(),n.groupRowsState?.destroy(),n.treeSelectionState?.destroy(),n.idToPathMap.clear(),n.idToIndexMap.clear(),n.rowInfoStore.clear()},Sh=(n,e)=>({onDataParamsChange:t=>t?ch(t,100,yv):void 0,lazyLoad:t=>!!t,isNodeReadOnly:t=>t??gh,isNodeSelectable:t=>t??hv,data:1,nodesKey:1,isNodeExpanded:1,isNodeCollapsed:1,pivotBy:1,primaryKey:1,livePagination:1,treeSelection:1,refetchKey:t=>t??"",filterFunction:1,treeFilterFunction:1,filterValue:1,useGroupKeysForMultiRowSelection:t=>t??!1,multiRowSelectionTarget:t=>t??"all",filterDelay:t=>t??200,filterTypes:t=>({...Kn,...t}),sortTypes:t=>({...Fn,...t}),sortFunction:1,onReady:1,rowInfoReducers:(t,o)=>{let r={initialValue:()=>{o.idToIndexMap.clear()},reducer:(a,l)=>{e.debugId&&!e.nodesKey&&o.idToIndexMap.has(l.id)&&console.warn(`Duplicate id found in data source: ${l.id}`),o.idToIndexMap.set(l.id,l.indexInAll)}},i=t?{...t,__idToIndex:r}:{__idToIndex:r};if(e.nodesKey){let a={initialValue:()=>{o.idToPathMap.clear(),o.pathToIndexMap.clear()},reducer:(l,s)=>{s.isTreeNode&&(o.idToPathMap.set(s.id,s.nodePath),e.debugId&&o.pathToIndexMap.has(s.nodePath)&&console.warn(`Duplicate node path found in data source (debugId: ${e.debugId||"none"}): ${s.nodePath}`),o.pathToIndexMap.set(s.nodePath,s.indexInAll))}};i.__pathToIndex=a}return i},onNodeCollapse:1,onNodeExpand:1,batchOperationDelay:1,isRowSelected:1,isNodeSelected:1,isRowDisabled:1,rowDisabledState:t=>{if(!t)return null;if(t instanceof Dt)return t;let o=n.propsCache.get("rowDisabledState"),r=o.get(t);return r||(r=new Dt(t),o.set(t,r)),t=r,t??null},onDataArrayChange:1,onDataMutations:1,onTreeDataMutations:1,aggregationReducers:1,collapseGroupRowsOnDataFunctionChange:t=>t??!0,loading:t=>t??!1,sortInfo:t=>dh(t,n.propsCache.get("sortInfo")),groupBy:t=>t??Sv});function bv(n,e){return typeof n=="function"?n({array:e.originalDataArray,length:e.originalDataArray.length,lastItem:e.originalDataArray[e.originalDataArray.length-1]}):n}function Tv(n){if(typeof n=="boolean")return{filterValue:n,sortInfo:n,groupBy:n,pivotBy:n};let e={};return n.filterValue!=null&&(e.filterValue=n.filterValue),n.sortInfo!=null&&(e.sortInfo=n.sortInfo),n.groupBy!=null&&(e.groupBy=n.groupBy),n.pivotBy!=null&&(e.pivotBy=n.pivotBy),e}var Cv={selectedPaths:[],deselectedPaths:[],defaultSelection:!1};function bh(n,e,t){if(e!="multi-row")throw new Error(`TreeSelectionState is only supported for multi-row selection. Your current selection mode is "${e}". See https://infinite-table.com/docs/reference/datasource-props#selectionMode for details.
2
2
 
3
3
 
4
- `);let o=Io(t);if(n instanceof Je)return n.setConfig(o),n;(n==null||typeof n!="object")&&(n=void 0);let r=n??Nw,i=t.propsCache.get("treeSelection"),a=i.get(r);return a&&a.setConfig(o),a=a??new Je(r,o),i.set(r,a),a}function Bg(n){let{props:e,state:t,oldState:o}=n,r=!!t.nodesKey,i=qo(e.sortInfo),a=qo(e.filterValue),{filterTypes:l}=t,s=Object.keys(l).reduce((D,E)=>{let z=l[E].operators;D[E]=D[E]||{};let V=D[E];return z.forEach(N=>{V[N.name]=N}),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 E=u.treeSelection??u.defaultTreeSelection;E!==void 0&&(c=typeof E=="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 Oe({selectedRows:[],deselectedRows:[],defaultSelection:!1},ut(t)):c==="single-row"||f instanceof Oe?d=f:d=new Oe(f,ut(t))),c==="single-cell"||c==="multi-cell"))if(m===null)p=c==="single-cell"?null:new je;else if(m instanceof je)p=m;else{let D=t.propsCache.get("cellSelection"),E=D.get(m)??new je(m);D.set(m,E),p=E}let g=t.primaryKey,h=typeof g=="function"?D=>g(D):D=>D[g],S=u.treeExpandState||t.treeExpandState||u.defaultTreeExpandState;if(S&&!(S instanceof mt)){let D=t.propsCache.get("treeExpandState"),E=D.get(S)??new mt(S);D.set(S,E),S=E}S=S||new mt({defaultExpanded:!0,collapsedPaths:[]});let y=e.groupRowsState||t.groupRowsState||e.defaultGroupRowsState;if(y&&!(y instanceof Rt)){let D=t.propsCache.get("groupRowsState"),E=D.get(y)??new Rt(y);D.set(y,E),y=E}y=y||new Rt(t.lazyLoad?{expandedRows:[],collapsedRows:!0}:{expandedRows:!0,collapsedRows:[]});let C=Fw(e.shouldReloadData||{}),T=typeof e.data=="function"&&!!e.lazyLoad,I=!!e.livePagination,b={sortInfo:C.sortInfo??(T||I),filterValue:C.filterValue??(T||I),groupBy:C.groupBy??T,pivotBy:C.pivotBy??T},R=e.sortFunction?"local":b.sortInfo?"remote":"local",v=(typeof e.filterFunction=="function"||typeof e.treeFilterFunction=="function")&&!e.lazyLoad?"local":b.filterValue||e.lazyLoad?"remote":"local",P=t.rowDisabledState,x=e.isRowDisabled;if(!x&&P){let D=t.propsCache.get("isRowDisabled"),E=D.get(P);E?x=E:(x=z=>P.isRowDisabled(z.id),D.set(P,x))}let M={debugId:t.debugId??e.debugId,isTree:r,selectionMode:c,groupRowsState:y,treeExpandState:S,treeExpandMode:S.mode,shouldReloadData:b,isRowDisabled:x,rowSelection:d,cellSelection:p,sortMode:R,filterMode:v,toPrimaryKey:h,operatorsByFilterType:s,controlledSort:i,controlledFilter:a,multiSort:Array.isArray(i?e.sortInfo:e.defaultSortInfo),lazyLoadBatchSize:typeof e.lazyLoad=="object"?e.lazyLoad.batchSize:void 0};if(e.livePagination){let D=!o||o.originalDataArray!==t.originalDataArray,E=typeof e.livePaginationCursor=="function"?D?Ow(e.livePaginationCursor,t):t.livePaginationCursor:e.livePaginationCursor;M.livePaginationCursor=E}if(t.devToolsDetected&&t.debugId){let D=on.get(t.debugId);D&&(M={...M,...D})}return M}var Lw=Dt("DataSource:fullLazyLoad");function Wg(n,e,t){let{name:o,newValue:r}=n;o==="data"&&typeof r=="function"&&!e.groupRowsState&&(e.lazyLoad&&Lw('"data" function prop has changed'),e.collapseGroupRowsOnDataFunctionChange!==!1&&(t.groupRowsState=new Rt({collapsedRows:!0,expandedRows:[]})))}function jg(){return{rowSelection:(n,e)=>e.selectionMode==="single-row"?{callbackParams:[n,"single-row"]}:{callbackParams:[n.getState(),"multi-row"]},treeSelection:(n,e)=>{if(e.selectionMode==="single-row")return{callbackParams:[n,{selectionMode:"single-row"}]};let t=e.__apiRef.current,o=t.treeApi;return{callbackParams:[n.getState(),{treeSelectionState:n,prevTreeSelectionState:e.treeSelectionState,selectionMode:"multi-row",lastUpdatedNodeInfo:e.lastSelectionUpdatedNodePathRef.current,unfilteredTreePaths:e.unfilteredTreePaths,dataSourceApi:t,treeApi:o}]}},treeExpandState:(n,e)=>({callbackParams:[n.getState(),{nodeState:e.lastExpandStateInfoRef.current.state,nodePath:e.lastExpandStateInfoRef.current.nodePath,dataSourceApi:e.__apiRef.current}]}),cellSelection:(n,e)=>e.selectionMode==="single-cell"?{callbackParams:[n instanceof je?n.getState().selectedCells:null,"single-cell"]}:{callbackParams:[n.getState(),"multi-cell"]}}}function Ug(){return{sortInfo:(n,{actions:e,state:t})=>{let o=t.getDataSourceMasterContextRef.current,r=Nt(t,{sortInfo:n,livePaginationCursor:null},o());e.dataParams=r,t.livePagination&&Ve(()=>{e.livePaginationCursor=null})},groupBy:(n,{actions:e,state:t})=>{let o=t.getDataSourceMasterContextRef.current,r=Nt(t,{groupBy:n,livePaginationCursor:null},o());e.dataParams=r,t.livePagination&&Ve(()=>{e.livePaginationCursor=null})},pivotBy:(n,{actions:e,state:t})=>{let o=t.getDataSourceMasterContextRef.current,r=Nt(t,{pivotBy:n,livePaginationCursor:null},o());e.dataParams=r,t.livePagination&&Ve(()=>{e.livePaginationCursor=null})},filterValue:(n,{actions:e,state:t})=>{let o=t.getDataSourceMasterContextRef.current,r=Nt(t,{filterValue:n,livePaginationCursor:null},o());e.dataParams=r,t.livePagination&&Ve(()=>{e.livePaginationCursor=null})},cursorId:(n,{actions:e,state:t})=>{let o=t.getDataSourceMasterContextRef.current,r=Nt(t,{__cursorId:n},o());e.dataParams=r},livePaginationCursor:(n,{actions:e,state:t})=>{let o=t.getDataSourceMasterContextRef.current,r=Nt(t,{livePaginationCursor:n},o());e.dataParams=r},dataParams:(n,{state:e})=>St(n,e.dataParams,new Set(["changes","originalDataArray","masterRowInfo"]))?!1:(Dt(Pn(e.debugId,"DataSource:dataParams"))("onDataParamsChange triggered because the following values have changed",n?.changes),!0)}}function $g(n){return{originalDataArray:n.originalDataArray,groupRowsState:n.groupRowsState,groupBy:n.groupBy,pivotBy:n.pivotBy,sortInfo:n.sortInfo,filterValue:n.filterValue,livePaginationCursor:n.livePaginationCursor}}function Xs(...n){return(...t)=>{n.forEach(o=>{typeof o=="function"&&o(...t)})}}function Zs(n){let{pivotByAtIndex:e,pivotAggregator:t}=n;return e?.column&&(typeof e.column=="function"?Object.assign(n,e.column({column:n})):Object.assign(n,e.column)),t?.pivotColumn&&(typeof t.pivotColumn=="function"?Object.assign(n,t.pivotColumn({column:n})):Object.assign(n,t.pivotColumn)),n}function Qs(n){let{pivotByAtIndex:e}=n;return e?.columnGroup&&(typeof e.columnGroup=="function"?Object.assign(n,e.columnGroup({columnGroup:n})):Object.assign(n,e.columnGroup)),n}function Yg({deepMap:n,pivotBy:e,pivotTotalColumnPosition:t,pivotGrandTotalColumnPosition:o,reducers:r={},showSeparatePivotColumnForSingleAggregation:i=!1}){let a=e.length,l=Object.keys(r).map(f=>({...r[f],id:f}));l.length||(i=!0,o=!1,t=!1,l.push({id:"__empty-aggregation-reducer__",name:"-",initialValue:null,reducer:()=>null}));let s={},u={},c=dt(function(){l.forEach((f,m)=>{s[`total:${f.id}`]=Zs({header:`${f.name||f.id} total`,pivotBy:e,pivotColumn:!0,pivotTotalColumn:!0,pivotAggregator:f,pivotAggregatorIndex:m,pivotGroupKeys:[],pivotGroupKey:"",pivotIndex:-1,valueFormatter:({rowInfo:g})=>g.isGroupRow?g.reducerResults?.[f.id]:null})})});(!a&&t==="start"||o==="start")&&c();let d=!i&&l.length===1;return n.visitDepthFirst((f,m,g,h)=>{if(m=[...m],t==="end"&&h?.(),m.length===a){let S=e[m.length-1],C=m.slice(0,-1).join("/");if(!d){let T=C;C=m.join("/");let I=m[m.length-1];u[C]=Qs({header:`${I}`,columnGroup:T,pivotBy:e,pivotGroupKeys:m,pivotByAtIndex:S,pivotIndex:m.length-1,pivotGroupKey:I})}l.forEach((T,I)=>{let b=d?`${m[m.length-1]}`:T.name||T.id,R=Zs({pivotBy:e,pivotColumn:!0,pivotTotalColumn:!1,pivotAggregator:T,pivotAggregatorIndex:I,pivotGroupKeys:m,pivotGroupKey:m[m.length-1],pivotIndex:m.length-1,pivotByAtIndex:S,columnGroup:C,header:b,valueFormatter:({rowInfo:v})=>v.isGroupRow?v.pivotValuesMap?.get(m)?.reducerResults[T.id]:null}),w=`${T.id}:${m.join("/")}`;s[w]=R})}else{let S=m.join("/"),y=m.slice(0,-1);if(u[S]=Qs({columnGroup:y.length?y.join("/"):void 0,header:`${m[m.length-1]}`,pivotBy:e,pivotGroupKeys:m,pivotIndex:m.length-1,pivotByAtIndex:e[m.length-1],pivotGroupKey:m[m.length-1]}),t!==!1){let C=e[m.length-1],T=y.length?y.join("/"):void 0;if(!d){let I=T;T=`total:${m.join("/")}`,u[T]=Qs({header:`${m[m.length-1]} total`,columnGroup:I,pivotBy:e,pivotTotalColumnGroup:!0,pivotGroupKeys:m,pivotIndex:m.length-1,pivotByAtIndex:C,pivotGroupKey:m[m.length-1]})}l.forEach((I,b)=>{let R=d?`${m[m.length-1]} total `:`${I.name||I.id} total`,w=Zs({columnGroup:T,header:R,pivotAggregator:I,pivotAggregatorIndex:b,pivotColumn:!0,pivotTotalColumn:!0,pivotGroupKeys:m,pivotGroupKey:m[m.length-1],pivotByAtIndex:C,pivotIndex:m.length-1,pivotBy:e,valueFormatter:({rowInfo:v})=>v.isGroupRow?v.pivotValuesMap?.get(m)?.reducerResults[I.id]:null});s[`total:${I.id}:${m.join("/")}`]=w})}}(t==="start"||t===!1)&&h?.()}),(!a&&t==="end"||o==="end")&&c(),{columns:s,columnGroups:u}}var qg=Symbol("CLEAR"),Xn=class n{constructor(e){this.affectedFields=new Set;this.allFieldsAffected=!1;this.primaryKeyToData=new Map;this.nodePathToData=new j;this.getAffectedFields=()=>this.allFieldsAffected?!0:this.affectedFields;this.delete=(e,t,o)=>{this.allFieldsAffected=!0;let r=e,i=this.primaryKeyToData.get(r)||[];i.push({type:"delete",primaryKey:e,originalData:t,metadata:o}),this.primaryKeyToData.set(r,i)};this.deleteNodePath=(e,t,o)=>{this.allFieldsAffected=!0;let r=this.nodePathToData.get(e)||[];r.push({type:"delete",nodePath:e,originalData:t,metadata:o}),this.nodePathToData.set(e,r)};this.insert=(e,t,o,r)=>{let i=e,a=this.primaryKeyToData.get(i)||[];this.allFieldsAffected=!0,a.push({type:"insert",primaryKey:e,data:t,position:o,originalData:null,metadata:r}),this.primaryKeyToData.set(i,a)};this.insertNodePath=(e,t,o,r)=>{let i=this.nodePathToData.get(e)||[];this.allFieldsAffected=!0,i.push({type:"insert",nodePath:e,data:t,position:o,originalData:null,metadata:r}),this.nodePathToData.set(e,i)};this.update=(e,t,o,r)=>{this.allFieldsAffected||(this.nodesKey&&Array.isArray(t[this.nodesKey])?this.allFieldsAffected=!0:Object.keys(t).forEach(s=>this.affectedFields.add(s)));let i=e,a=this.primaryKeyToData.get(i)||[];a.push({type:"update",primaryKey:e,data:t,originalData:o,metadata:r}),this.primaryKeyToData.set(e,a)};this.updateNodePath=(e,t,o,r)=>{this.allFieldsAffected||(this.nodesKey&&Array.isArray(t[this.nodesKey])?this.allFieldsAffected=!0:Object.keys(t).forEach(l=>this.affectedFields.add(l)));let i=this.nodePathToData.get(e)||[];i.push({type:"update",nodePath:e,data:t,originalData:o,metadata:r}),this.nodePathToData.set(e,i)};this.updateChildren=(e,t,o,r)=>{this.allFieldsAffected=!0;let i=this.nodePathToData.get(e)||[];i.push({type:"update-children",nodePath:e,children:t,originalData:o,metadata:r}),this.nodePathToData.set(e,i)};this.resetDataSource=e=>{this.clear(),this.allFieldsAffected=!0;let t=qg,o=this.primaryKeyToData.get(t)||[];o.push({type:"clear-all",primaryKey:void 0,metadata:e}),this.primaryKeyToData.set(t,o)};this.shouldResetDataSource=()=>this.primaryKeyToData.has(qg);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=()=>j.clone(this.nodePathToData);this.getMutationsArray=()=>Array.from(this.primaryKeyToData.values()).flat();this.getTreeMutationsArray=()=>Array.from(this.nodePathToData.values()).flat();this.nodesKey=e.nodesKey}static clone(e,{light:t=!1}={}){let o=new n({nodesKey:e.nodesKey});return o.allFieldsAffected=e.allFieldsAffected,o.affectedFields=new Set(e.affectedFields),o.primaryKeyToData=t?e.primaryKeyToData:new Map(e.primaryKeyToData),o.nodePathToData=t?e.nodePathToData:j.clone(e.nodePathToData),o}};var Js=1e3;function Xg(n){return new eu(n)}var eu=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=()=>Ci(this.getState);this.getRowInfoByIndex=e=>Tn(e,this.getState)??null;this.getRowInfoByPrimaryKey=e=>{let t=this.getIndexByPrimaryKey(e);return this.getRowInfoByIndex(t)};this.getRowInfoByNodePath=e=>{let t=this.getIndexByNodePath(e);return this.getRowInfoByIndex(t)};this.getIndexByPrimaryKey=e=>this.getState().idToIndexMap.get(e)??-1;this.getIndexByNodePath=e=>this.getState().pathToIndexMap.get(e)??-1;this.getNodePathById=e=>this.getState().idToPathMap.get(e)??null;this.getNodePathByIndex=e=>{let t=this.getRowInfoByIndex(e);return t&&t.isTreeNode?t.nodePath:null};this.getPrimaryKeyByIndex=e=>{let t=this.getRowInfoByIndex(e);return t?t.id:void 0};this.getOriginalDataArray=()=>this.getState().originalDataArray;this.getDataByIndex=e=>{let t=this.getRowInfoByIndex(e);return t?t.data:null};this.getDataByPrimaryKey=e=>{let{indexer:t}=this.getState();return t.getDataForPrimaryKey(e)??null};this.isNodePathAvailable=e=>this.getState().indexer.getDataForNodePath(e)!==void 0;this.getDataByNodePath=e=>{let{indexer:t}=this.getState(),o=t.getDataForNodePath(e);return o||null};this.replaceAllData=(e,t)=>(this.batchOperation({type:"replace-all",array:e,metadata:t?.metadata}),this.addDataArray(e,t));this.clearAllData=e=>this.replaceAllData([],e);this.updateData=(e,t)=>this.updateDataArray([e],t);this.updateDataArray=(e,t)=>{let o=this.getState().isTree,r=o?void 0:e.map(l=>this.toPrimaryKey(l)),i=o?e.map(l=>this.getNodePathById(this.toPrimaryKey(l))||[]):null,a=r?this.batchOperation({type:"update",array:e,primaryKeys:e.map(l=>this.toPrimaryKey(l)),metadata:t?.metadata}):this.batchOperation({type:"update",array:e,nodePaths:i||[],metadata:t?.metadata});return t?.flush&&this.commit(),a};this.withWaitForNode=(e,t,o)=>{let r=o?.waitForNode??!0;if(r===!0||typeof r=="number"){let a=r===!0?Js:r;return isNaN(a)||(a=Js),this.waitForNodePath(e,{timeout:a}).then(l=>{if(!l){let s=`Cannot find node path "${e.join("/")}" (we waited for it ${a}ms)`;return console.error(s),t({error:s,resolved:!1})}return t({resolved:!0})})}let i=t({resolved:void 0});return i instanceof Promise?i:Promise.resolve(i)};this.updateChildrenByNodePath=(e,t,o)=>this.withWaitForNode(t,({error:r})=>r?!1:this.updateChildrenByNodePath_Internal(e,t,o),o);this.updateChildrenByNodePath_Internal=(e,t,o)=>{let r=typeof e=="function"?e:()=>e;return this.updateDataArrayByNodePath_Internal([{nodePath:t,children:r}],o)};this.updateDataByNodePath=(e,t,o)=>this.isNodePathAvailable(t)?this.updateDataArrayByNodePath_Internal([{data:e,nodePath:t}],o):this.withWaitForNode(t,({error:r})=>r?!1:this.updateDataArrayByNodePath_Internal([{data:e,nodePath:t}],o),o);this.updateDataArrayByNodePath=(e,t)=>{if(t&&typeof t.waitForNode<"u"&&!t.waitForNode)return this.updateDataArrayByNodePath_Internal(e,t);let o=e.map(i=>i.nodePath);return Promise.allSettled(o.map(i=>this.withWaitForNode(i,({error:a})=>!a,t))).then(i=>i.every(Boolean)?this.updateDataArrayByNodePath_Internal(e,t):!1)};this.updateDataArrayByNodePath_Internal=(e,t)=>{let o=[],r=[];e.forEach(a=>{a.data?o.push(a.data):a.children&&o.push(a.children),r.push(a.nodePath)});let i=this.batchOperation({type:"update",array:o,nodePaths:r,metadata:t?.metadata});return t?.flush&&this.commit(),i};this.removeDataByPrimaryKey=(e,t)=>{if(this.getState().isTree)return this.removeDataByNodePath(this.getNodePathById(e)||[],t);let r=this.batchOperation({type:"delete",primaryKeys:[e],metadata:t?.metadata});return t?.flush&&this.commit(),r};this.removeDataByNodePath=(e,t)=>this.batchDeleteNodePaths([e],t);this.removeData=(e,t)=>{if(this.getState().isTree){let r=this.getNodePathById(this.toPrimaryKey(e));return this.removeDataByNodePath(r,t)}return this.batchDeletePrimaryKeys([this.toPrimaryKey(e)],t)};this.removeDataArrayByPrimaryKeys=(e,t)=>{if(this.getState().isTree){let r=e.map(i=>this.getNodePathById(i)||[]);return this.batchDeleteNodePaths(r,t)}return this.batchDeletePrimaryKeys(e,t)};this.batchDeleteNodePaths=(e,t)=>{let o=this.batchOperation({type:"delete",nodePaths:e||[],metadata:t?.metadata});return t?.flush&&this.commit(),o};this.batchDeletePrimaryKeys=(e,t)=>{let o=this.batchOperation({type:"delete",primaryKeys:e,metadata:t?.metadata});return t?.flush&&this.commit(),o};this.removeDataArray=(e,t)=>{if(this.getState().isTree){let i=e.map(a=>this.getNodePathById(this.toPrimaryKey(a))||[]);return this.batchDeleteNodePaths(i,t)}let r=e.map(this.toPrimaryKey);return this.batchDeletePrimaryKeys(r,t)};this.addData=(e,t)=>this.addDataArray([e],t);this.addDataArray=(e,t)=>this.insertDataArray(e,{...t,position:"end"});this.insertData=(e,t)=>this.insertDataArray([e],t);this.insertDataArray=(e,t)=>{let o=this.getState().isTree,r="before",i,a=t.nodePath;if(o&&a?.length)return this.withWaitForNode(a,({error:s})=>{if(s)return!1;if(t.position==="before"||t.position==="after")return this.batchTreeInsert(e,t.position,a,t);let 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=o?this.batchOperation({type:"insert",array:e,position:r,metadata:t?.metadata,nodePath:this.getNodePathById(i)||[]}):this.batchOperation({type:"insert",array:e,position:r,metadata:t?.metadata,primaryKey:i,nodePath:a});return t?.flush&&this.commit(),l};this.batchTreeInsert=(e,t,o,r)=>{if(o.length&&!this.isNodePathAvailable(o))return this.withWaitForNode(o,({error:a})=>{if(a)return!1;let l=this.batchOperation({type:"insert",array:e,position:t,metadata:r?.metadata,nodePath:o});return r?.flush&&this.commit(),l},r);let i=this.batchOperation({type:"insert",array:e,position:t,metadata:r?.metadata,nodePath:o});return r?.flush&&this.commit(),i};this.setSortInfo=e=>{let t=this.getState().multiSort;if(Array.isArray(e)){this.actions.sortInfo=e.length?t?e:e[0]:null;return}this.actions.sortInfo=e};this.setGroupBy=e=>{this.actions.groupBy=e};this.toggleGroupByField=e=>{let t=this.getState().groupBy;t.findIndex(r=>r.field===e)===-1?this.actions.groupBy=[...t,{field:e}]:this.actions.groupBy=t.filter(r=>r.field!==e)};this.isRowDisabledAt=e=>this.getRowInfoByIndex(e)?.rowDisabled??!1;this.isRowDisabled=e=>this.getRowInfoByPrimaryKey(e)?.rowDisabled??!1;this.setRowEnabledAt=(e,t)=>{let o=this.getState().rowDisabledState,r=o?new wt(o):new wt({enabledRows:!0,disabledRows:[]}),i=this.getRowInfoByIndex(e);i&&(r.setRowEnabled(i.id,t),this.actions.rowDisabledState=r)};this.setRowEnabled=(e,t)=>{let o=this.getRowInfoByPrimaryKey(e);o&&this.setRowEnabledAt(o.indexInAll,t)};this.enableAllRows=()=>{let e=this.getState().rowDisabledState;if(!e){this.actions.rowDisabledState=new wt({enabledRows:!0,disabledRows:[]});return}let t=new wt(e);t.enableAll(),this.actions.rowDisabledState=t};this.disableAllRows=()=>{let e=this.getState().rowDisabledState;if(!e){this.actions.rowDisabledState=new wt({disabledRows:!0,enabledRows:[]});return}let t=new wt(e);t.disableAll(),this.actions.rowDisabledState=t};this.areAllRowsEnabled=()=>{let e=this.getState().rowDisabledState;return e?e.areAllEnabled():!0};this.areAllRowsDisabled=()=>{let e=this.getState().rowDisabledState;return e?e.areAllDisabled():!1};this.getState=e.getState,this.getState().__apiRef.current=this,this.actions=e.actions,this.treeApi=new Ii({...e,dataSourceApi:this})}getPendingOperationPromise(){return this.pendingPromise}batchOperation(e){if(!this.pendingPromise){this.pendingPromise=new Promise(o=>{this.resolvePendingPromise=o});let t=Math.max(0,this.getState().batchOperationDelay??0);t===0?this.batchOperationRafId=setTimeout(()=>{this.commit()}):this.batchOperationTimeoutId=setTimeout(()=>{this.batchOperationRafId=setTimeout(()=>{this.commit()})},t)}return e.type==="replace-all"&&(this.pendingOperations.length=0),this.pendingOperations.push(e),this.pendingPromise}commitOperations(e){if(!e.length)return;let t=this.getState().cache,{isTree:o,nodesKey:r}=this.getState(),i=t?Xn.clone(t,{light:!0}):new Xn({nodesKey:o?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 o=this.getState();if(this.isNodePathAvailable(e))return Promise.resolve(!0);let r=t?.timeout??Js,i=o.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,o.waitForNodePathPromises.delete(e),u(p)},d=setTimeout(()=>{c===void 0&&l(!1)},r)});return o.waitForNodePathPromises.set(e,{timestamp:a,promise:s,resolve:l}),s}commit(){this.commitOperations(this.pendingOperations),this.pendingOperations.length=0;let e=this.pendingPromise;if(e&&this.resolvePendingPromise){let t=this.resolvePendingPromise;requestAnimationFrame(()=>{t(!0)}),this.pendingPromise=null,this.resolvePendingPromise=null}return e||Promise.resolve(!0)}};function Zg(n){let e=n.cache;if(!e)return{sortInfo:!1,groupBy:!1,tree:!1,filterValue:!1,aggregationReducers:!1};let t=!1,o=!1,r=!1,i=!1,a=!1,l=e.getAffectedFields(),{sortInfo:s,groupBy:u,filterValue:c,aggregationReducers:d,nodesKey:p,isTree:f}=n;if(s&&s.length)if(l===!0)t=!0;else for(let m of s){let g=m.field;if(g&&(g=Array.isArray(g)?g:[g],t=g.reduce((h,S)=>h||typeof S!="function"?l.has(S):!1,!1),t))break}if(u&&u.length){if(l===!0)o=!0;else for(let m of u)if(m.field&&l.has(m.field)){o=!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:o,filterValue:i,aggregationReducers:a,tree:r}}function ya(n){if(!n)return;let e=Object.keys(n);if(!e.length)return;let t={};for(let o=0,r=e.length;o<r;o++){let i=e[o],a=n[i].initialValue;a!==void 0&&(t[i]=typeof a=="function"?a():a)}return t}function Sa(n){let e=n.reducerKeys,t=n.reducers,o=n.results;for(let r=0,i=e.length;r<i;r++){let a=e[r],l=t[a].reducer;o[a]=l(o[a],n.rowInfo)}}function ba(n){let e=Object.keys(n.reducers||{});if(!e.length||!n.results)return n.results;let t=n.reducers,o=n.results;for(let r=0,i=e.length;r<i;r++){let a=e[r],l=t[a].done;typeof l=="function"&&(o[a]=l(o[a],n.array))}return o}function Qg(n){return"groupNesting"in n?n.groupNesting??0:0}function Jg(n,e){if(!(!n.isGroupRow||!e.reducerId))return e.pivotTotalColumn&&(!e.pivotGroupKeys||e.pivotGroupKeys.length===0)?n.reducerResults?.[e.reducerId]:n.pivotValuesMap?.get(e.pivotGroupKeys)?.reducerResults?.[e.reducerId]}function kw(n,e,t,o){if(n==null&&e==null)return 0;if(n==null)return 1;if(e==null)return-1;let r=Array.isArray(t.type)?t.type[0]:t.type,a=(t.fn||r&&o[r]||o.string||Mn.string)(n,e);return a===0?0:t.dir*a}function zw(n,e){if(!n?.length||!e)return[];let t=[];for(let o of n){let r=o.id?e[o.id]:void 0;!r?.pivotColumn||!r.pivotAggregator||t.push({dir:o.dir,type:o.type,fn:o.fn,pivotGroupKeys:r.pivotGroupKeys??[],reducerId:r.pivotAggregator.id,pivotTotalColumn:!!r.pivotTotalColumn})}return t}function Vw(n){let e=[],t=[];for(let o of n){let r={row:o,children:[]},i=Qg(o);for(;t.length&&Qg(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 Gw(n){let e=[],t=(o,r)=>{o.forEach((i,a)=>{let l=[...r,a],s=i.row;s.indexInGroup=a,s.indexInParentGroups=l,s.indexInAll=e.length,e.push(s),t(i.children,l)})};return t(n,[]),e}function eh(n,e,t,o){let r=zw(e,t);if(!r.length||!n.length)return n;let i={...Mn,...o},a=Vw(n),l=(u,c)=>{for(let d of r){let p=kw(Jg(u.row,d),Jg(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),Gw(a)}var $t=(n,e,t)=>{for(let o=0,r=t.length;o<r;o++){let i=t[o],a=n[i],l=e[i];if(a!==l)return!0}return!1};function Hw(n){let e=n.get([bt]);if(!e)return;if(e.totalChildrenCount!=null)return e.totalChildrenCount;let t=0;for(let o=0;o<e.children.length;o++){let r=e.children[o]?.totalChildrenCount;if(r==null)return;t+=r}return t}function Kw(n,e){let t=n.get([bt]);if(t)return e?t.totalChildrenCountUnfiltered:t.totalCountUnfiltered}function tu(){return!1}function Bw(n,e,t,o,r,i){let a={dataSourceHasGrouping:!1,isTreeNode:!1,data:n,id:e,indexInAll:t,isGroupRow:!1,selfLoaded:!0,rowSelected:!1,rowDisabled:!1,isCellSelected:tu,hasSelectedCells:tu};return o&&(a.rowSelected=o(a)),r&&(a.rowDisabled=r(a)),i&&(a.isCellSelected=l=>i.isCellSelected(a.id,l),a.hasSelectedCells=l=>i.isCellSelectionInRow(a.id,l)),a}var Ww=dt(()=>{console.warn(`Your "treeFilterFunction" should NOT MUTATE the data object. You're probably mutating the node children.
4
+ `);let o=Do(t);if(n instanceof et)return n.setConfig(o),n;(n==null||typeof n!="object")&&(n=void 0);let r=n??Cv,i=t.propsCache.get("treeSelection"),a=i.get(r);return a&&a.setConfig(o),a=a??new et(r,o),i.set(r,a),a}function Th(n){let{props:e,state:t,oldState:o}=n,r=!!t.nodesKey,i=tr(e.sortInfo),a=tr(e.filterValue),{filterTypes:l}=t,s=Object.keys(l).reduce((D,E)=>{let L=l[E].operators;D[E]=D[E]||{};let V=D[E];return L.forEach(N=>{V[N.name]=N}),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 E=u.treeSelection??u.defaultTreeSelection;E!==void 0&&(c=typeof E=="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 Oe({selectedRows:[],deselectedRows:[],defaultSelection:!1},ct(t)):c==="single-row"||f instanceof Oe?d=f:d=new Oe(f,ct(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=t.propsCache.get("cellSelection"),E=D.get(m)??new Ue(m);D.set(m,E),p=E}let g=t.primaryKey,h=typeof g=="function"?D=>g(D):D=>D[g],S=u.treeExpandState||t.treeExpandState||u.defaultTreeExpandState;if(S&&!(S instanceof mt)){let D=t.propsCache.get("treeExpandState"),E=D.get(S)??new mt(S);D.set(S,E),S=E}S=S||new mt({defaultExpanded:!0,collapsedPaths:[]});let y=e.groupRowsState||t.groupRowsState||e.defaultGroupRowsState;if(y&&!(y instanceof Pt)){let D=t.propsCache.get("groupRowsState"),E=D.get(y)??new Pt(y);D.set(y,E),y=E}y=y||new Pt(t.lazyLoad?{expandedRows:[],collapsedRows:!0}:{expandedRows:!0,collapsedRows:[]});let C=Tv(e.shouldReloadData||{}),b=typeof e.data=="function"&&!!e.lazyLoad,I=!!e.livePagination,T={sortInfo:C.sortInfo??(b||I),filterValue:C.filterValue??(b||I),groupBy:C.groupBy??b,pivotBy:C.pivotBy??b},R=e.sortFunction?"local":T.sortInfo?"remote":"local",w=(typeof e.filterFunction=="function"||typeof e.treeFilterFunction=="function")&&!e.lazyLoad?"local":T.filterValue||e.lazyLoad?"remote":"local",P=t.rowDisabledState,x=e.isRowDisabled;if(!x&&P){let D=t.propsCache.get("isRowDisabled"),E=D.get(P);E?x=E:(x=L=>P.isRowDisabled(L.id),D.set(P,x))}let M={debugId:t.debugId??e.debugId,isTree:r,selectionMode:c,groupRowsState:y,treeExpandState:S,treeExpandMode:S.mode,shouldReloadData:T,isRowDisabled:x,rowSelection:d,cellSelection:p,sortMode:R,filterMode:w,toPrimaryKey:h,operatorsByFilterType:s,controlledSort:i,controlledFilter:a,multiSort:Array.isArray(i?e.sortInfo:e.defaultSortInfo),lazyLoadBatchSize:typeof e.lazyLoad=="object"?e.lazyLoad.batchSize:void 0};if(e.livePagination){let D=!o||o.originalDataArray!==t.originalDataArray,E=typeof e.livePaginationCursor=="function"?D?bv(e.livePaginationCursor,t):t.livePaginationCursor:e.livePaginationCursor;M.livePaginationCursor=E}if(t.devToolsDetected&&t.debugId){let D=an.get(t.debugId);D&&(M={...M,...D})}return M}var Iv=Et("DataSource:fullLazyLoad");function Ch(n,e,t){let{name:o,newValue:r}=n;o==="data"&&typeof r=="function"&&!e.groupRowsState&&(e.lazyLoad&&Iv('"data" function prop has changed'),e.collapseGroupRowsOnDataFunctionChange!==!1&&(t.groupRowsState=new Pt({collapsedRows:!0,expandedRows:[]})))}function Ih(){return{rowSelection:(n,e)=>e.selectionMode==="single-row"?{callbackParams:[n,"single-row"]}:{callbackParams:[n.getState(),"multi-row"]},treeSelection:(n,e)=>{if(e.selectionMode==="single-row")return{callbackParams:[n,{selectionMode:"single-row"}]};let t=e.__apiRef.current,o=t.treeApi;return{callbackParams:[n.getState(),{treeSelectionState:n,prevTreeSelectionState:e.treeSelectionState,selectionMode:"multi-row",lastUpdatedNodeInfo:e.lastSelectionUpdatedNodePathRef.current,unfilteredTreePaths:e.unfilteredTreePaths,dataSourceApi:t,treeApi:o}]}},treeExpandState:(n,e)=>({callbackParams:[n.getState(),{nodeState:e.lastExpandStateInfoRef.current.state,nodePath:e.lastExpandStateInfoRef.current.nodePath,dataSourceApi:e.__apiRef.current}]}),cellSelection:(n,e)=>e.selectionMode==="single-cell"?{callbackParams:[n instanceof Ue?n.getState().selectedCells:null,"single-cell"]}:{callbackParams:[n.getState(),"multi-cell"]}}}function Rh(){return{sortInfo:(n,{actions:e,state:t})=>{let o=t.getDataSourceMasterContextRef.current,r=kt(t,{sortInfo:n,livePaginationCursor:null},o());e.dataParams=r,t.livePagination&&Ge(()=>{e.livePaginationCursor=null})},groupBy:(n,{actions:e,state:t})=>{let o=t.getDataSourceMasterContextRef.current,r=kt(t,{groupBy:n,livePaginationCursor:null},o());e.dataParams=r,t.livePagination&&Ge(()=>{e.livePaginationCursor=null})},pivotBy:(n,{actions:e,state:t})=>{let o=t.getDataSourceMasterContextRef.current,r=kt(t,{pivotBy:n,livePaginationCursor:null},o());e.dataParams=r,t.livePagination&&Ge(()=>{e.livePaginationCursor=null})},filterValue:(n,{actions:e,state:t})=>{let o=t.getDataSourceMasterContextRef.current,r=kt(t,{filterValue:n,livePaginationCursor:null},o());e.dataParams=r,t.livePagination&&Ge(()=>{e.livePaginationCursor=null})},cursorId:(n,{actions:e,state:t})=>{let o=t.getDataSourceMasterContextRef.current,r=kt(t,{__cursorId:n},o());e.dataParams=r},livePaginationCursor:(n,{actions:e,state:t})=>{let o=t.getDataSourceMasterContextRef.current,r=kt(t,{livePaginationCursor:n},o());e.dataParams=r},dataParams:(n,{state:e})=>St(n,e.dataParams,new Set(["changes","originalDataArray","masterRowInfo"]))?!1:(Et(An(e.debugId,"DataSource:dataParams"))("onDataParamsChange triggered because the following values have changed",n?.changes),!0)}}function wh(n){return{originalDataArray:n.originalDataArray,groupRowsState:n.groupRowsState,groupBy:n.groupBy,pivotBy:n.pivotBy,sortInfo:n.sortInfo,filterValue:n.filterValue,livePaginationCursor:n.livePaginationCursor}}function pu(...n){return(...t)=>{n.forEach(o=>{typeof o=="function"&&o(...t)})}}function fu(n){let{pivotByAtIndex:e,pivotAggregator:t}=n;return e?.column&&(typeof e.column=="function"?Object.assign(n,e.column({column:n})):Object.assign(n,e.column)),t?.pivotColumn&&(typeof t.pivotColumn=="function"?Object.assign(n,t.pivotColumn({column:n})):Object.assign(n,t.pivotColumn)),n}function mu(n){let{pivotByAtIndex:e}=n;return e?.columnGroup&&(typeof e.columnGroup=="function"?Object.assign(n,e.columnGroup({columnGroup:n})):Object.assign(n,e.columnGroup)),n}function vh({deepMap:n,pivotBy:e,pivotTotalColumnPosition:t,pivotGrandTotalColumnPosition:o,reducers:r={},showSeparatePivotColumnForSingleAggregation:i=!1}){let a=e.length,l=Object.keys(r).map(f=>({...r[f],id:f}));l.length||(i=!0,o=!1,t=!1,l.push({id:"__empty-aggregation-reducer__",name:"-",initialValue:null,reducer:()=>null}));let s={},u={},c=pt(function(){l.forEach((f,m)=>{s[`total:${f.id}`]=fu({header:`${f.name||f.id} total`,pivotBy:e,pivotColumn:!0,pivotTotalColumn:!0,pivotAggregator:f,pivotAggregatorIndex:m,pivotGroupKeys:[],pivotGroupKey:"",pivotIndex:-1,valueFormatter:({rowInfo:g})=>g.isGroupRow?g.reducerResults?.[f.id]:null})})});(!a&&t==="start"||o==="start")&&c();let d=!i&&l.length===1;return n.visitDepthFirst((f,m,g,h)=>{if(m=[...m],t==="end"&&h?.(),m.length===a){let S=e[m.length-1],C=m.slice(0,-1).join("/");if(!d){let b=C;C=m.join("/");let I=m[m.length-1];u[C]=mu({header:`${I}`,columnGroup:b,pivotBy:e,pivotGroupKeys:m,pivotByAtIndex:S,pivotIndex:m.length-1,pivotGroupKey:I})}l.forEach((b,I)=>{let T=d?`${m[m.length-1]}`:b.name||b.id,R=fu({pivotBy:e,pivotColumn:!0,pivotTotalColumn:!1,pivotAggregator:b,pivotAggregatorIndex:I,pivotGroupKeys:m,pivotGroupKey:m[m.length-1],pivotIndex:m.length-1,pivotByAtIndex:S,columnGroup:C,header:T,valueFormatter:({rowInfo:w})=>w.isGroupRow?w.pivotValuesMap?.get(m)?.reducerResults[b.id]:null}),v=`${b.id}:${m.join("/")}`;s[v]=R})}else{let S=m.join("/"),y=m.slice(0,-1);if(u[S]=mu({columnGroup:y.length?y.join("/"):void 0,header:`${m[m.length-1]}`,pivotBy:e,pivotGroupKeys:m,pivotIndex:m.length-1,pivotByAtIndex:e[m.length-1],pivotGroupKey:m[m.length-1]}),t!==!1){let C=e[m.length-1],b=y.length?y.join("/"):void 0;if(!d){let I=b;b=`total:${m.join("/")}`,u[b]=mu({header:`${m[m.length-1]} total`,columnGroup:I,pivotBy:e,pivotTotalColumnGroup:!0,pivotGroupKeys:m,pivotIndex:m.length-1,pivotByAtIndex:C,pivotGroupKey:m[m.length-1]})}l.forEach((I,T)=>{let R=d?`${m[m.length-1]} total `:`${I.name||I.id} total`,v=fu({columnGroup:b,header:R,pivotAggregator:I,pivotAggregatorIndex:T,pivotColumn:!0,pivotTotalColumn:!0,pivotGroupKeys:m,pivotGroupKey:m[m.length-1],pivotByAtIndex:C,pivotIndex:m.length-1,pivotBy:e,valueFormatter:({rowInfo:w})=>w.isGroupRow?w.pivotValuesMap?.get(m)?.reducerResults[I.id]:null});s[`total:${I.id}:${m.join("/")}`]=v})}}(t==="start"||t===!1)&&h?.()}),(!a&&t==="end"||o==="end")&&c(),{columns:s,columnGroups:u}}var Ph=Symbol("CLEAR"),to=class n{constructor(e){this.affectedFields=new Set;this.allFieldsAffected=!1;this.primaryKeyToData=new Map;this.nodePathToData=new W;this.getAffectedFields=()=>this.allFieldsAffected?!0:this.affectedFields;this.delete=(e,t,o)=>{this.allFieldsAffected=!0;let r=e,i=this.primaryKeyToData.get(r)||[];i.push({type:"delete",primaryKey:e,originalData:t,metadata:o}),this.primaryKeyToData.set(r,i)};this.deleteNodePath=(e,t,o)=>{this.allFieldsAffected=!0;let r=this.nodePathToData.get(e)||[];r.push({type:"delete",nodePath:e,originalData:t,metadata:o}),this.nodePathToData.set(e,r)};this.insert=(e,t,o,r)=>{let i=e,a=this.primaryKeyToData.get(i)||[];this.allFieldsAffected=!0,a.push({type:"insert",primaryKey:e,data:t,position:o,originalData:null,metadata:r}),this.primaryKeyToData.set(i,a)};this.insertNodePath=(e,t,o,r)=>{let i=this.nodePathToData.get(e)||[];this.allFieldsAffected=!0,i.push({type:"insert",nodePath:e,data:t,position:o,originalData:null,metadata:r}),this.nodePathToData.set(e,i)};this.update=(e,t,o,r)=>{this.allFieldsAffected||(this.nodesKey&&Array.isArray(t[this.nodesKey])?this.allFieldsAffected=!0:Object.keys(t).forEach(s=>this.affectedFields.add(s)));let i=e,a=this.primaryKeyToData.get(i)||[];a.push({type:"update",primaryKey:e,data:t,originalData:o,metadata:r}),this.primaryKeyToData.set(e,a)};this.updateNodePath=(e,t,o,r)=>{this.allFieldsAffected||(this.nodesKey&&Array.isArray(t[this.nodesKey])?this.allFieldsAffected=!0:Object.keys(t).forEach(l=>this.affectedFields.add(l)));let i=this.nodePathToData.get(e)||[];i.push({type:"update",nodePath:e,data:t,originalData:o,metadata:r}),this.nodePathToData.set(e,i)};this.updateChildren=(e,t,o,r)=>{this.allFieldsAffected=!0;let i=this.nodePathToData.get(e)||[];i.push({type:"update-children",nodePath:e,children:t,originalData:o,metadata:r}),this.nodePathToData.set(e,i)};this.resetDataSource=e=>{this.clear(),this.allFieldsAffected=!0;let t=Ph,o=this.primaryKeyToData.get(t)||[];o.push({type:"clear-all",primaryKey:void 0,metadata:e}),this.primaryKeyToData.set(t,o)};this.shouldResetDataSource=()=>this.primaryKeyToData.has(Ph);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=()=>W.clone(this.nodePathToData);this.getMutationsArray=()=>Array.from(this.primaryKeyToData.values()).flat();this.getTreeMutationsArray=()=>Array.from(this.nodePathToData.values()).flat();this.nodesKey=e.nodesKey}static clone(e,{light:t=!1}={}){let o=new n({nodesKey:e.nodesKey});return o.allFieldsAffected=e.allFieldsAffected,o.affectedFields=new Set(e.affectedFields),o.primaryKeyToData=t?e.primaryKeyToData:new Map(e.primaryKeyToData),o.nodePathToData=t?e.nodePathToData:W.clone(e.nodePathToData),o}};var gu=1e3;function Dh(n){return new hu(n)}var hu=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=()=>Ni(this.getState);this.getRowInfoByIndex=e=>vn(e,this.getState)??null;this.getRowInfoByPrimaryKey=e=>{let t=this.getIndexByPrimaryKey(e);return this.getRowInfoByIndex(t)};this.getRowInfoByNodePath=e=>{let t=this.getIndexByNodePath(e);return this.getRowInfoByIndex(t)};this.getIndexByPrimaryKey=e=>this.getState().idToIndexMap.get(e)??-1;this.getIndexByNodePath=e=>this.getState().pathToIndexMap.get(e)??-1;this.getNodePathById=e=>this.getState().idToPathMap.get(e)??null;this.getNodePathByIndex=e=>{let t=this.getRowInfoByIndex(e);return t&&t.isTreeNode?t.nodePath:null};this.getPrimaryKeyByIndex=e=>{let t=this.getRowInfoByIndex(e);return t?t.id:void 0};this.getOriginalDataArray=()=>this.getState().originalDataArray;this.getDataByIndex=e=>{let t=this.getRowInfoByIndex(e);return t?t.data:null};this.getDataByPrimaryKey=e=>{let{indexer:t}=this.getState();return t.getDataForPrimaryKey(e)??null};this.isNodePathAvailable=e=>this.getState().indexer.getDataForNodePath(e)!==void 0;this.getDataByNodePath=e=>{let{indexer:t}=this.getState(),o=t.getDataForNodePath(e);return o||null};this.replaceAllData=(e,t)=>(this.batchOperation({type:"replace-all",array:e,metadata:t?.metadata}),this.addDataArray(e,t));this.clearAllData=e=>this.replaceAllData([],e);this.updateData=(e,t)=>this.updateDataArray([e],t);this.updateDataArray=(e,t)=>{let o=this.getState().isTree,r=o?void 0:e.map(l=>this.toPrimaryKey(l)),i=o?e.map(l=>this.getNodePathById(this.toPrimaryKey(l))||[]):null,a=r?this.batchOperation({type:"update",array:e,primaryKeys:e.map(l=>this.toPrimaryKey(l)),metadata:t?.metadata}):this.batchOperation({type:"update",array:e,nodePaths:i||[],metadata:t?.metadata});return t?.flush&&this.commit(),a};this.withWaitForNode=(e,t,o)=>{let r=o?.waitForNode??!0;if(r===!0||typeof r=="number"){let a=r===!0?gu:r;return isNaN(a)||(a=gu),this.waitForNodePath(e,{timeout:a}).then(l=>{if(!l){let s=`Cannot find node path "${e.join("/")}" (we waited for it ${a}ms)`;return console.error(s),t({error:s,resolved:!1})}return t({resolved:!0})})}let i=t({resolved:void 0});return i instanceof Promise?i:Promise.resolve(i)};this.updateChildrenByNodePath=(e,t,o)=>this.withWaitForNode(t,({error:r})=>r?!1:this.updateChildrenByNodePath_Internal(e,t,o),o);this.updateChildrenByNodePath_Internal=(e,t,o)=>{let r=typeof e=="function"?e:()=>e;return this.updateDataArrayByNodePath_Internal([{nodePath:t,children:r}],o)};this.updateDataByNodePath=(e,t,o)=>this.isNodePathAvailable(t)?this.updateDataArrayByNodePath_Internal([{data:e,nodePath:t}],o):this.withWaitForNode(t,({error:r})=>r?!1:this.updateDataArrayByNodePath_Internal([{data:e,nodePath:t}],o),o);this.updateDataArrayByNodePath=(e,t)=>{if(t&&typeof t.waitForNode<"u"&&!t.waitForNode)return this.updateDataArrayByNodePath_Internal(e,t);let o=e.map(i=>i.nodePath);return Promise.allSettled(o.map(i=>this.withWaitForNode(i,({error:a})=>!a,t))).then(i=>i.every(Boolean)?this.updateDataArrayByNodePath_Internal(e,t):!1)};this.updateDataArrayByNodePath_Internal=(e,t)=>{let o=[],r=[];e.forEach(a=>{a.data?o.push(a.data):a.children&&o.push(a.children),r.push(a.nodePath)});let i=this.batchOperation({type:"update",array:o,nodePaths:r,metadata:t?.metadata});return t?.flush&&this.commit(),i};this.removeDataByPrimaryKey=(e,t)=>{if(this.getState().isTree)return this.removeDataByNodePath(this.getNodePathById(e)||[],t);let r=this.batchOperation({type:"delete",primaryKeys:[e],metadata:t?.metadata});return t?.flush&&this.commit(),r};this.removeDataByNodePath=(e,t)=>this.batchDeleteNodePaths([e],t);this.removeData=(e,t)=>{if(this.getState().isTree){let r=this.getNodePathById(this.toPrimaryKey(e));return this.removeDataByNodePath(r,t)}return this.batchDeletePrimaryKeys([this.toPrimaryKey(e)],t)};this.removeDataArrayByPrimaryKeys=(e,t)=>{if(this.getState().isTree){let r=e.map(i=>this.getNodePathById(i)||[]);return this.batchDeleteNodePaths(r,t)}return this.batchDeletePrimaryKeys(e,t)};this.batchDeleteNodePaths=(e,t)=>{let o=this.batchOperation({type:"delete",nodePaths:e||[],metadata:t?.metadata});return t?.flush&&this.commit(),o};this.batchDeletePrimaryKeys=(e,t)=>{let o=this.batchOperation({type:"delete",primaryKeys:e,metadata:t?.metadata});return t?.flush&&this.commit(),o};this.removeDataArray=(e,t)=>{if(this.getState().isTree){let i=e.map(a=>this.getNodePathById(this.toPrimaryKey(a))||[]);return this.batchDeleteNodePaths(i,t)}let r=e.map(this.toPrimaryKey);return this.batchDeletePrimaryKeys(r,t)};this.addData=(e,t)=>this.addDataArray([e],t);this.addDataArray=(e,t)=>this.insertDataArray(e,{...t,position:"end"});this.insertData=(e,t)=>this.insertDataArray([e],t);this.insertDataArray=(e,t)=>{let o=this.getState().isTree,r="before",i,a=t.nodePath;if(o&&a?.length)return this.withWaitForNode(a,({error:s})=>{if(s)return!1;if(t.position==="before"||t.position==="after")return this.batchTreeInsert(e,t.position,a,t);let 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=o?this.batchOperation({type:"insert",array:e,position:r,metadata:t?.metadata,nodePath:this.getNodePathById(i)||[]}):this.batchOperation({type:"insert",array:e,position:r,metadata:t?.metadata,primaryKey:i,nodePath:a});return t?.flush&&this.commit(),l};this.batchTreeInsert=(e,t,o,r)=>{if(o.length&&!this.isNodePathAvailable(o))return this.withWaitForNode(o,({error:a})=>{if(a)return!1;let l=this.batchOperation({type:"insert",array:e,position:t,metadata:r?.metadata,nodePath:o});return r?.flush&&this.commit(),l},r);let i=this.batchOperation({type:"insert",array:e,position:t,metadata:r?.metadata,nodePath:o});return r?.flush&&this.commit(),i};this.setSortInfo=e=>{let t=this.getState().multiSort;if(Array.isArray(e)){this.actions.sortInfo=e.length?t?e:e[0]:null;return}this.actions.sortInfo=e};this.setGroupBy=e=>{this.actions.groupBy=e};this.toggleGroupByField=e=>{let t=this.getState().groupBy;t.findIndex(r=>r.field===e)===-1?this.actions.groupBy=[...t,{field:e}]:this.actions.groupBy=t.filter(r=>r.field!==e)};this.isRowDisabledAt=e=>this.getRowInfoByIndex(e)?.rowDisabled??!1;this.isRowDisabled=e=>this.getRowInfoByPrimaryKey(e)?.rowDisabled??!1;this.setRowEnabledAt=(e,t)=>{let o=this.getState().rowDisabledState,r=o?new Dt(o):new Dt({enabledRows:!0,disabledRows:[]}),i=this.getRowInfoByIndex(e);i&&(r.setRowEnabled(i.id,t),this.actions.rowDisabledState=r)};this.setRowEnabled=(e,t)=>{let o=this.getRowInfoByPrimaryKey(e);o&&this.setRowEnabledAt(o.indexInAll,t)};this.enableAllRows=()=>{let e=this.getState().rowDisabledState;if(!e){this.actions.rowDisabledState=new Dt({enabledRows:!0,disabledRows:[]});return}let t=new Dt(e);t.enableAll(),this.actions.rowDisabledState=t};this.disableAllRows=()=>{let e=this.getState().rowDisabledState;if(!e){this.actions.rowDisabledState=new Dt({disabledRows:!0,enabledRows:[]});return}let t=new Dt(e);t.disableAll(),this.actions.rowDisabledState=t};this.areAllRowsEnabled=()=>{let e=this.getState().rowDisabledState;return e?e.areAllEnabled():!0};this.areAllRowsDisabled=()=>{let e=this.getState().rowDisabledState;return e?e.areAllDisabled():!1};this.getState=e.getState,this.getState().__apiRef.current=this,this.actions=e.actions,this.treeApi=new Li({...e,dataSourceApi:this})}getPendingOperationPromise(){return this.pendingPromise}batchOperation(e){if(!this.pendingPromise){this.pendingPromise=new Promise(o=>{this.resolvePendingPromise=o});let t=Math.max(0,this.getState().batchOperationDelay??0);t===0?this.batchOperationRafId=setTimeout(()=>{this.commit()}):this.batchOperationTimeoutId=setTimeout(()=>{this.batchOperationRafId=setTimeout(()=>{this.commit()})},t)}return e.type==="replace-all"&&(this.pendingOperations.length=0),this.pendingOperations.push(e),this.pendingPromise}commitOperations(e){if(!e.length)return;let t=this.getState().cache,{isTree:o,nodesKey:r}=this.getState(),i=t?to.clone(t,{light:!0}):new to({nodesKey:o?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 o=this.getState();if(this.isNodePathAvailable(e))return Promise.resolve(!0);let r=t?.timeout??gu,i=o.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,o.waitForNodePathPromises.delete(e),u(p)},d=setTimeout(()=>{c===void 0&&l(!1)},r)});return o.waitForNodePathPromises.set(e,{timestamp:a,promise:s,resolve:l}),s}commit(){this.commitOperations(this.pendingOperations),this.pendingOperations.length=0;let e=this.pendingPromise;if(e&&this.resolvePendingPromise){let t=this.resolvePendingPromise;requestAnimationFrame(()=>{t(!0)}),this.pendingPromise=null,this.resolvePendingPromise=null}return e||Promise.resolve(!0)}};function xh(n){let e=n.cache;if(!e)return{sortInfo:!1,groupBy:!1,tree:!1,filterValue:!1,aggregationReducers:!1};let t=!1,o=!1,r=!1,i=!1,a=!1,l=e.getAffectedFields(),{sortInfo:s,groupBy:u,filterValue:c,aggregationReducers:d,nodesKey:p,isTree:f}=n;if(s&&s.length)if(l===!0)t=!0;else for(let m of s){let g=m.field;if(g&&(g=Array.isArray(g)?g:[g],t=g.reduce((h,S)=>h||typeof S!="function"?l.has(S):!1,!1),t))break}if(u&&u.length){if(l===!0)o=!0;else for(let m of u)if(m.field&&l.has(m.field)){o=!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:o,filterValue:i,aggregationReducers:a,tree:r}}function Aa(n){if(!n)return;let e=Object.keys(n);if(!e.length)return;let t={};for(let o=0,r=e.length;o<r;o++){let i=e[o],a=n[i].initialValue;a!==void 0&&(t[i]=typeof a=="function"?a():a)}return t}function _a(n){let e=n.reducerKeys,t=n.reducers,o=n.results;for(let r=0,i=e.length;r<i;r++){let a=e[r],l=t[a].reducer;o[a]=l(o[a],n.rowInfo)}}function Oa(n){let e=Object.keys(n.reducers||{});if(!e.length||!n.results)return n.results;let t=n.reducers,o=n.results;for(let r=0,i=e.length;r<i;r++){let a=e[r],l=t[a].done;typeof l=="function"&&(o[a]=l(o[a],n.array))}return o}function Mh(n){return"groupNesting"in n?n.groupNesting??0:0}function Eh(n,e){if(!(!n.isGroupRow||!e.reducerId))return e.pivotTotalColumn&&(!e.pivotGroupKeys||e.pivotGroupKeys.length===0)?n.reducerResults?.[e.reducerId]:n.pivotValuesMap?.get(e.pivotGroupKeys)?.reducerResults?.[e.reducerId]}function Rv(n,e,t,o){if(n==null&&e==null)return 0;if(n==null)return 1;if(e==null)return-1;let r=Array.isArray(t.type)?t.type[0]:t.type,a=(t.fn||r&&o[r]||o.string||Fn.string)(n,e);return a===0?0:t.dir*a}function wv(n,e){if(!n?.length||!e)return[];let t=[];for(let o of n){let r=o.id?e[o.id]:void 0;!r?.pivotColumn||!r.pivotAggregator||t.push({dir:o.dir,type:o.type,fn:o.fn,pivotGroupKeys:r.pivotGroupKeys??[],reducerId:r.pivotAggregator.id,pivotTotalColumn:!!r.pivotTotalColumn})}return t}function vv(n){let e=[],t=[];for(let o of n){let r={row:o,children:[]},i=Mh(o);for(;t.length&&Mh(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 Pv(n){let e=[],t=(o,r)=>{o.forEach((i,a)=>{let l=[...r,a],s=i.row;s.indexInGroup=a,s.indexInParentGroups=l,s.indexInAll=e.length,e.push(s),t(i.children,l)})};return t(n,[]),e}function Ah(n,e,t,o){let r=wv(e,t);if(!r.length||!n.length)return n;let i={...Fn,...o},a=vv(n),l=(u,c)=>{for(let d of r){let p=Rv(Eh(u.row,d),Eh(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),Pv(a)}var qt=(n,e,t)=>{for(let o=0,r=t.length;o<r;o++){let i=t[o],a=n[i],l=e[i];if(a!==l)return!0}return!1};function Dv(n){let e=n.get([Tt]);if(!e)return;if(e.totalChildrenCount!=null)return e.totalChildrenCount;let t=0;for(let o=0;o<e.children.length;o++){let r=e.children[o]?.totalChildrenCount;if(r==null)return;t+=r}return t}function xv(n,e){let t=n.get([Tt]);if(t)return e?t.totalChildrenCountUnfiltered:t.totalCountUnfiltered}function yu(){return!1}function Mv(n,e,t,o,r,i){let a={dataSourceHasGrouping:!1,isTreeNode:!1,data:n,id:e,indexInAll:t,isGroupRow:!1,selfLoaded:!0,rowSelected:!1,rowDisabled:!1,isCellSelected:yu,hasSelectedCells:yu};return o&&(a.rowSelected=o(a)),r&&(a.rowDisabled=r(a)),i&&(a.isCellSelected=l=>i.isCellSelected(a.id,l),a.hasSelectedCells=l=>i.isCellSelectionInRow(a.id,l)),a}var Ev=pt(()=>{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,20 +13,20 @@ function treeFilterFunction({ data }) {
13
13
 
14
14
  Make sure you avoid mutations.
15
15
 
16
- `)});function th(n){let{dataArray:e,treeFilterFunction:t,toPrimaryKey:o,getNodeChildren:r,isLeafNode:i,nodesKey:a,filterValue:l,filterTypes:s}=n,u=[],c=p=>i(p)||!Array.isArray(r(p)),d=p=>{if(c(p))return p;let f=th({...n,dataArray:r(p)});return f.length===0?!1:(p={...p,[a]:f},p)};for(let p=0,f=e.length;p<f;p++){let m=e[p],g=r(m),h=t({data:m,index:p,dataArray:e,primaryKey:o(m,p),filterValue:l,filterTypes:s,filterTreeNode:d,isLeafNode:c(m)});h&&(h===!0?h=m:typeof h=="object"&&h===m&&g!==r(h)&&Ww(),u.push(h))}return u}var jw=[];function nh(n){let{filterTypes:e,marker:t,filterFunction:o,toPrimaryKey:r,treeFilterFunction:i,getNodeChildren:a,nodesKey:l,isLeafNode:s}=n,u=n.filterValue||jw,{dataArray:c}=n;t?.start({details:[{name:"Count before",value:c.length}]});let d=!!l&&!!a&&!!s,p=0;if(d){let f=o;c=th({dataArray:c,treeFilterFunction:i||(f?g=>g.isLeafNode?f(g):g.filterTreeNode(g.data):Ls),toPrimaryKey:r,getNodeChildren:a,nodesKey:l,isLeafNode:s,filterValue:u,filterTypes:e})}else if(o)c=c.filter((f,m,g)=>o({data:f,index:m,dataArray:g,primaryKey:r(f,m),filterValue:u,filterTypes:e}));else{let f=aa(u,e);f.length&&(c=c.filter((m,g,h)=>Ns(f,{data:m,index:g,dataArray:h,primaryKey:r(m,g)})))}return t?.end({details:[{name:"Count after",value:c.length}]}),c}function oh(n){let e,{state:t,previousState:o}=n,r=t.debugId,i;r&&(i=rt(r).track.DataSource.label.PrepareData.start());let a=Zg(t),l=la(t.sortInfo,t.groupBy),s=t.sortMode,u=l?.length?s==="local":!1;(t.lazyLoad||t.livePagination)&&(u=!1);let c=$t(o,t,["refetchKey"]),d=$t(o,t,["cache","originalDataArray","originalLazyGroupDataChangeDetect"]);Array.isArray(t.data)&&c&&(d=!0),!1&&(t.originalLazyGroupData=new j,d=!0);let f=t.cache?Xn.clone(t.cache):void 0;f&&!f.isEmpty()&&(d=!0);let m=t.toPrimaryKey,g=t.nodesKey,h=t.isTree,S=g?O=>O[g]:void 0,y=g?O=>O[g]===void 0:void 0,C,T;d&&(t.indexer.clear(),t.lazyLoad||(C=f?.getMutations(),T=f?.getTreeMutations(),t.originalDataArray=t.indexer.indexArray(t.originalDataArray,{toPrimaryKey:m,cache:f,getNodeChildren:S,isLeafNode:y,nodesKey:g}),h&&t.waitForNodePathPromises.visit(({value:O},A)=>{O&&t.indexer.getDataForNodePath(A)!==void 0&&O.resolve(!0)}))),f&&(f.clear(),t.cache=void 0);let{filterFunction:b,treeFilterFunction:R,filterValue:w,filterTypes:v}=t,P=!!b||!!R||Array.isArray(w)&&w.length,x=t.filterMode==="local"&&!t.lazyLoad,M=P&&x,D=$t(o,t,["filterFunction","treeFilterFunction","filterValue","filterTypes"]),E=d||D,z=$t(o,t,["sortInfo"]),V=d||D||z,N=x&&(E||!t.lastFilterDataArray),L=u&&(V||!t.lastSortDataArray||a.sortInfo),F=t.groupBy,K=t.pivotBy,q=!h&&(F.length>0||!!K),_=h,k=$t(o,t,["rowDisabledState","isRowDisabled"]),H=$t(o,t,["rowSelection","cellSelection","isRowSelected","multiRowSelectionTarget","originalLazyGroupDataChangeDetect"]),Z=$t(o,t,["treeSelection","cellSelection","isNodeSelected","multiRowSelectionTarget","originalLazyGroupDataChangeDetect"]),Ce=d||V||$t(o,t,["generateGroupRows","originalLazyGroupData","originalLazyGroupDataChangeDetect","groupBy","groupRowsState","pivotBy","aggregationReducers","pivotTotalColumnPosition","pivotGrandTotalColumnPosition","showSeparatePivotColumnForSingleAggregation","repeatWrappedGroupRows","rowsPerPage"]),le=d||V||$t(o,t,["originalLazyGroupData","originalLazyGroupDataChangeDetect","treeExpandState","isNodeExpanded","isNodeCollapsed","aggregationReducers","repeatWrappedGroupRows","rowsPerPage"]),fe=$t(o,t,["rowInfoReducers"]),we=q&&(Ce||!t.lastGroupDataArray||a.groupBy)||H||k||fe,ve=_&&(le||a.tree||!t.lastTreeDataArray)||Z||k||fe,ue=Date.now(),ne=t.originalDataArray;if(_&&ve){let O={marker:r?rt(r).track.DataSource.label.TreeUnfilteredTreePaths.start():void 0,isLeafNode:y,getNodeChildren:S,toKey:m};t.unfilteredTreePaths=Ql(O,ne).treePaths}if(P||(t.unfilteredCount=ne.length),M){t.unfilteredCount=ne.length;let O=ue;N?(t.devToolsDetected&&(O=Date.now()),ne=nh({marker:r?rt(r).track.DataSource.label.Filter.start():void 0,getNodeChildren:S,isLeafNode:y,nodesKey:g,treeFilterFunction:R,dataArray:ne,toPrimaryKey:m,filterTypes:v,filterFunction:b,filterValue:w}),t.devToolsDetected&&t.debugTimings.set("filter",Date.now()-O)):ne=t.lastFilterDataArray,t.lastFilterDataArray=ne,t.filteredAt=ue}if(t.filteredCount=(t.lazyLoad&&F.length?Hw(t.originalLazyGroupData):void 0)??ne.length,t.lazyLoad&&(t.unfilteredCount=Kw(t.originalLazyGroupData,F.length>0)??t.filteredCount),t.postFilterDataArray=ne,u){let O=jt.knownTypes;if(jt.knownTypes={...O,...t.sortTypes},L){let A=ue;if(t.devToolsDetected&&(A=Date.now()),r&&(e=rt(r).track.DataSource.label.Sort.start({details:[{name:"Count",value:ne.length}]})),t.sortFunction?(ne=t.sortFunction(l,[...ne]),e&&(e.end(),e=void 0)):h?ne=$s(l,ne,{marker:e,inplace:!1,isLeafNode:y,getNodeChildren:S,toKey:m,nodesKey:g}):ne=jt(l,[...ne],{marker:e}),r&&(e?.end(),e=void 0),t.devToolsDetected){let ce=Date.now()-A;t.debugTimings.set("sort",ce)}}else ne=t.lastSortDataArray;jt.knownTypes=O,t.lastSortDataArray=ne,t.sortedAt=ue}t.postSortDataArray=ne;let se=t.dataArray,de=t.rowSelection instanceof Oe?t.rowSelection:void 0,X=t.treeExpandState instanceof mt?t.treeExpandState:void 0,Q=t.cellSelection instanceof je?t.cellSelection:void 0;de&&(de.getConfig=ut(t)),de?.xcache();let B=t.selectionMode==="single-row"?O=>O.id===t.rowSelection:t.selectionMode==="multi-row"?O=>{let A=de;return O.isGroupRow?A.getGroupRowSelectionState(O.groupKeys):A.isRowSelected(O.id,O.dataSourceHasGrouping?O.groupKeys:void 0)}:void 0,re=t.isRowDisabled||tu;t.isRowSelected&&t.selectionMode==="multi-row"&&(B=O=>t.isRowSelected(O,de,t.selectionMode));let te;t.isNodeExpanded&&(te=O=>t.isNodeExpanded(O,X)),t.isNodeCollapsed&&(te=O=>!t.isNodeExpanded(O,X)),te||(te=A=>X.isNodeExpanded(A.nodePath));let ae=t.rowInfoReducers;if(q){if(we){let O=ue;t.devToolsDetected&&(O=Date.now());let A=t.aggregationReducers,ce=t.lazyLoad?Fp({groupBy:F,pivot:K,mappings:t.pivotMappings,reducers:A,indexer:t.indexer,toPrimaryKey:m,cache:f,marker:r?rt(r).track.DataSource.label.LazyGroup.start():void 0},t.originalLazyGroupData):Jl({groupBy:F,pivot:K,reducers:A,marker:r?rt(r).track.DataSource.label.Group.start():void 0},ne);t.groupDeepMap=ce.deepMap,de&&(de.getConfig=ut(t));let he=Object.keys(ae||{}),Re=ya(ae),Se={reducers:ae,results:Re,reducerKeys:he,rowInfo:{}},xe=Re?$e=>{Se.rowInfo=$e,Sa(Se)}:void 0,Ue=Q?$e=>{$e.isCellSelected=G=>Q.isCellSelected($e.id,G)}:void 0,Ke=xe||Ue?Xs(xe,Ue):void 0,tt=zp({marker:r?rt(r).track.DataSource.label.FlattenTree.start():void 0,groupResult:ce,lazyLoad:!!t.lazyLoad,reducers:A,toPrimaryKey:m,isRowSelected:B,rowSelectionState:de,withRowInfo:Ke,repeatWrappedGroupRows:t.rowsPerPage!=null?t.repeatWrappedGroupRows:!1,rowsPerPage:t.rowsPerPage,groupRowsState:t.groupRowsState,generateGroupRows:t.generateGroupRows});se=tt.data,t.rowInfoReducerResults=ba({reducers:ae,results:Re,array:se}),t.groupRowsIndexesInDataArray=tt.groupRowsIndexes,t.reducerResults=ce.reducerResults;let nt=K?Yg({deepMap:ce.topLevelPivotColumns,pivotBy:K,pivotTotalColumnPosition:t.pivotTotalColumnPosition??"end",pivotGrandTotalColumnPosition:t.pivotGrandTotalColumnPosition??!1,reducers:t.aggregationReducers,showSeparatePivotColumnForSingleAggregation:t.showSeparatePivotColumnForSingleAggregation}):void 0;t.pivotColumns=nt?.columns,t.pivotColumnGroups=nt?.columnGroups;let Ze=eh(se,l,t.pivotColumns,t.sortTypes);Ze!==se&&(se=Ze,t.groupRowsIndexesInDataArray=se.map(($e,G)=>$e.isGroupRow?G:-1).filter($e=>$e>=0)),t.devToolsDetected&&t.debugTimings.set("group-and-pivot",Date.now()-O)}else se=t.lastGroupDataArray;t.lastGroupDataArray=se,t.groupedAt=ue}else if(_){if(ve){let O=ue;t.devToolsDetected&&(O=Date.now());let A=t.aggregationReducers,ce={marker:r?rt(r).track.DataSource.label.Tree.start():void 0,isLeafNode:y,getNodeChildren:S,toKey:m,reducers:A},he=Ql(ce,ne);t.treeDeepMap=he.deepMap,t.treePaths=he.treePaths;let Re=t.selectionMode==="multi-row"?Kg(t.treeSelection,t.selectionMode,t):void 0;t.treeSelectionState=Re;let Se=Object.keys(ae||{}),xe=ya(ae),Ue={reducers:ae,results:xe,reducerKeys:Se,rowInfo:{}},Ke=xe?J=>{Ue.rowInfo=J,Sa(Ue)}:void 0,tt=Q?J=>{J.isCellSelected=me=>Q.isCellSelected(J.id,me)}:void 0,nt=Ke||tt?Xs(Ke,tt):void 0,Ze=t.selectionMode==="single-row"?J=>J.id===t.treeSelection:t.selectionMode==="multi-row"?J=>Re.isNodeSelected(J.nodePath):void 0,$e=t.rowsPerPage!=null?t.repeatWrappedGroupRows:!1;se=kp({marker:r?rt(r).track.DataSource.label.FlattenTree.start():void 0,treeResult:he,treeParams:ce,dataArray:ne,reducers:A,toPrimaryKey:m,isNodeSelected:Ze,isNodeExpanded:te,treeSelectionState:Re,withRowInfo:nt,repeatWrappedGroupRows:$e,rowsPerPage:t.rowsPerPage}).data,t.rowInfoReducerResults=ba({reducers:ae,results:xe,array:se}),t.reducerResults=he.reducerResults,t.totalLeafNodesCount=he.deepMap.get([])?.totalLeafNodesCount??0,t.treeAt=ue,t.devToolsDetected&&t.debugTimings.set("tree",Date.now()-O)}else se=t.lastTreeDataArray;t.lastTreeDataArray=se}else if(t.groupDeepMap=void 0,t.pivotColumns=void 0,t.pivotColumnGroups=void 0,t.groupRowsIndexesInDataArray=void 0,o.postSortDataArray!=t.postSortDataArray||Ce||H||k||fe){let A=Object.keys(ae||{}),ce=ya(ae),he={reducers:ae,results:ce,reducerKeys:A,rowInfo:{}};se=ne.map((Re,Se)=>{let xe=Bw(Re,Re?m(Re):Se,Se,B,re,Q);return ce&&(he.rowInfo=xe,Sa(he)),xe}),t.rowInfoReducerResults=ba({reducers:ae,results:ce,array:se})}if(t.postGroupDataArray=se,se!==t.dataArray&&(t.updatedAt=ue),t.dataArray=se,t.reducedAt=ue,t.selectionMode==="multi-row"){let O=t.rowSelection instanceof Oe&&!t.rowSelection.onlyUsePrimaryKeys;if(q&&t.lazyLoad&&!O){r&&(e=rt(r).track.DataSource.label.ComputeSelectionCountLazy.start());let A=!0,ce=!1;t.dataArray.forEach(Re=>{if(!Re.isTreeNode&&Re.isGroupRow&&Re.groupKeys.length===1){let{rowSelected:Se}=Re;Se!==!0&&(A=!1),(Se===!0||Se===null)&&(ce=!0)}});let{rowSelection:he}=t;he instanceof Oe&&he.getLazyHiddenRowsCount([])&&(he.defaultSelection?ce=!0:A=!1),t.allRowsSelected=A,t.someRowsSelected=ce,r&&(e?.end(),e=void 0)}else{r&&(e=rt(r).track.DataSource.label.ComputeSelectionCount.start());let A=t.isTree?t.treeSelectionState?.getSelectionCountFor([]):t.rowSelection.getSelectionCountFor([]);A?(t.allRowsSelected=A.deselectedCount===0,t.someRowsSelected=A.selectedCount>0):(t.allRowsSelected=t.totalLeafNodesCount===0,t.someRowsSelected=!1),r&&(e?.end(),e=void 0)}}return t.originalDataArrayChanged=d,d&&(t.originalDataArrayChangedInfo={timestamp:ue,mutations:C?.size?C:void 0,treeMutations:T?.size?T:void 0}),t.rowInfoStore.notifyDataArray(se,{marker:r?rt(r).track.DataSource.label.DiffRowInfoInStore:void 0,dataSourceState:t,previousDataSourceState:o}),i&&i?.track.DataSource.label.PrepareData.end({details:[N||L||we||ve?{name:"Performed operations",value:[N?"filter":null,L?"sort":null,we?"group":null,ve?"tree":null].filter(mn).join(", ")}:null,c?{name:"Refetch key",value:`Old ${o.refetchKey} -> New ${t.refetchKey}`}:null,d?{name:"Original data array changed",value:""}:null,{name:"Unfiltered data length",value:t.originalDataArray.length}].filter(mn)}),t}import ou,{useCallback as tv,useEffect as dh,useLayoutEffect as ru,useState as ph}from"react";function rh(){return fn()}import{useEffect as Zn,useMemo as uh,useRef as Rr,useState as Jw}from"react";import{useEffect as ih,useLayoutEffect as Uw,useRef as No}from"react";function Lo(n,e){let t=No({}),o=No({}),r=o.current,i=No({}),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,ih(()=>{let s=i.current,u;return Object.keys(s).length!==0&&(u=n(s,r)),i.current={},o.current={},u},l)}function KB(n,e){let t=No({}),o=No({}),r=o.current,i=No({}),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,Uw(()=>{let s=i.current,u;return Object.keys(s).length!==0&&(u=n(s,r)),i.current={},o.current={},u},l)}function BB(n,e){let t=[];for(let o in e)e.hasOwnProperty(o)&&t.push(e[o]);ih(n,t)}function $w(n,e,t){return e=e.replaceAll("$ERR_CODE",n),e=`${e}
16
+ `)});function _h(n){let{dataArray:e,treeFilterFunction:t,toPrimaryKey:o,getNodeChildren:r,isLeafNode:i,nodesKey:a,filterValue:l,filterTypes:s}=n,u=[],c=p=>i(p)||!Array.isArray(r(p)),d=p=>{if(c(p))return p;let f=_h({...n,dataArray:r(p)});return f.length===0?!1:(p={...p,[a]:f},p)};for(let p=0,f=e.length;p<f;p++){let m=e[p],g=r(m),h=t({data:m,index:p,dataArray:e,primaryKey:o(m,p),filterValue:l,filterTypes:s,filterTreeNode:d,isLeafNode:c(m)});h&&(h===!0?h=m:typeof h=="object"&&h===m&&g!==r(h)&&Ev(),u.push(h))}return u}var Av=[];function Oh(n){let{filterTypes:e,marker:t,filterFunction:o,toPrimaryKey:r,treeFilterFunction:i,getNodeChildren:a,nodesKey:l,isLeafNode:s}=n,u=n.filterValue||Av,{dataArray:c}=n;t?.start({details:[{name:"Count before",value:c.length}]});let d=!!l&&!!a&&!!s,p=0;if(d){let f=o;c=_h({dataArray:c,treeFilterFunction:i||(f?g=>g.isLeafNode?f(g):g.filterTreeNode(g.data):Qs),toPrimaryKey:r,getNodeChildren:a,nodesKey:l,isLeafNode:s,filterValue:u,filterTypes:e})}else if(o)c=c.filter((f,m,g)=>o({data:f,index:m,dataArray:g,primaryKey:r(f,m),filterValue:u,filterTypes:e}));else{let f=Ta(u,e);f.length&&(c=c.filter((m,g,h)=>Zs(f,{data:m,index:g,dataArray:h,primaryKey:r(m,g)})))}return t?.end({details:[{name:"Count after",value:c.length}]}),c}function Fh(n){let e,{state:t,previousState:o}=n,r=t.debugId,i;r&&(i=at(r).track.DataSource.label.PrepareData.start());let a=xh(t),l=Ca(t.sortInfo,t.groupBy),s=t.sortMode,u=l?.length?s==="local":!1;(t.lazyLoad||t.livePagination)&&(u=!1);let c=qt(o,t,["refetchKey"]),d=qt(o,t,["cache","originalDataArray","originalLazyGroupDataChangeDetect"]);Array.isArray(t.data)&&c&&(d=!0),!1&&(t.originalLazyGroupData=new W,d=!0);let f=t.cache?to.clone(t.cache):void 0;f&&!f.isEmpty()&&(d=!0);let m=t.toPrimaryKey,g=t.nodesKey,h=t.isTree,S=g?O=>O[g]:void 0,y=g?O=>O[g]===void 0:void 0,C,b;d&&(t.indexer.clear(),t.lazyLoad||(C=f?.getMutations(),b=f?.getTreeMutations(),t.originalDataArray=t.indexer.indexArray(t.originalDataArray,{toPrimaryKey:m,cache:f,getNodeChildren:S,isLeafNode:y,nodesKey:g}),h&&t.waitForNodePathPromises.visit(({value:O},A)=>{O&&t.indexer.getDataForNodePath(A)!==void 0&&O.resolve(!0)}))),f&&(f.clear(),t.cache=void 0);let{filterFunction:T,treeFilterFunction:R,filterValue:v,filterTypes:w}=t,P=!!T||!!R||Array.isArray(v)&&v.length,x=t.filterMode==="local"&&!t.lazyLoad,M=P&&x,D=qt(o,t,["filterFunction","treeFilterFunction","filterValue","filterTypes"]),E=d||D,L=qt(o,t,["sortInfo"]),V=d||D||L,N=x&&(E||!t.lastFilterDataArray),k=u&&(V||!t.lastSortDataArray||a.sortInfo),F=t.groupBy,B=t.pivotBy,$=!h&&(F.length>0||!!B),_=h,H=qt(o,t,["rowDisabledState","isRowDisabled"]),z=qt(o,t,["rowSelection","cellSelection","isRowSelected","multiRowSelectionTarget","originalLazyGroupDataChangeDetect"]),Z=qt(o,t,["treeSelection","cellSelection","isNodeSelected","multiRowSelectionTarget","originalLazyGroupDataChangeDetect"]),be=d||V||qt(o,t,["generateGroupRows","originalLazyGroupData","originalLazyGroupDataChangeDetect","groupBy","groupRowsState","pivotBy","aggregationReducers","pivotTotalColumnPosition","pivotGrandTotalColumnPosition","showSeparatePivotColumnForSingleAggregation","repeatWrappedGroupRows","rowsPerPage"]),se=d||V||qt(o,t,["originalLazyGroupData","originalLazyGroupDataChangeDetect","treeExpandState","isNodeExpanded","isNodeCollapsed","aggregationReducers","repeatWrappedGroupRows","rowsPerPage"]),pe=qt(o,t,["rowInfoReducers"]),Pe=$&&(be||!t.lastGroupDataArray||a.groupBy)||z||H||pe,De=_&&(se||a.tree||!t.lastTreeDataArray)||Z||H||pe,ce=Date.now(),te=t.originalDataArray;if(_&&De){let O={marker:r?at(r).track.DataSource.label.TreeUnfilteredTreePaths.start():void 0,isLeafNode:y,getNodeChildren:S,toKey:m};t.unfilteredTreePaths=fs(O,te).treePaths}if(P||(t.unfilteredCount=te.length),M){t.unfilteredCount=te.length;let O=ce;N?(t.devToolsDetected&&(O=Date.now()),te=Oh({marker:r?at(r).track.DataSource.label.Filter.start():void 0,getNodeChildren:S,isLeafNode:y,nodesKey:g,treeFilterFunction:R,dataArray:te,toPrimaryKey:m,filterTypes:w,filterFunction:T,filterValue:v}),t.devToolsDetected&&t.debugTimings.set("filter",Date.now()-O)):te=t.lastFilterDataArray,t.lastFilterDataArray=te,t.filteredAt=ce}if(t.filteredCount=(t.lazyLoad&&F.length?Dv(t.originalLazyGroupData):void 0)??te.length,t.lazyLoad&&(t.unfilteredCount=xv(t.originalLazyGroupData,F.length>0)??t.filteredCount),t.postFilterDataArray=te,u){let O=$t.knownTypes;if($t.knownTypes={...O,...t.sortTypes},k){let A=ce;if(t.devToolsDetected&&(A=Date.now()),r&&(e=at(r).track.DataSource.label.Sort.start({details:[{name:"Count",value:te.length}]})),t.sortFunction?(te=t.sortFunction(l,[...te]),e&&(e.end(),e=void 0)):h?te=uu(l,te,{marker:e,inplace:!1,isLeafNode:y,getNodeChildren:S,toKey:m,nodesKey:g}):te=$t(l,[...te],{marker:e}),r&&(e?.end(),e=void 0),t.devToolsDetected){let ue=Date.now()-A;t.debugTimings.set("sort",ue)}}else te=t.lastSortDataArray;$t.knownTypes=O,t.lastSortDataArray=te,t.sortedAt=ce}t.postSortDataArray=te;let le=t.dataArray,ge=t.rowSelection instanceof Oe?t.rowSelection:void 0,j=t.treeExpandState instanceof mt?t.treeExpandState:void 0,ee=t.cellSelection instanceof Ue?t.cellSelection:void 0;ge&&(ge.getConfig=ct(t)),ge?.xcache();let K=t.selectionMode==="single-row"?O=>O.id===t.rowSelection:t.selectionMode==="multi-row"?O=>{let A=ge;return O.isGroupRow?A.getGroupRowSelectionState(O.groupKeys):A.isRowSelected(O.id,O.dataSourceHasGrouping?O.groupKeys:void 0)}:void 0,ie=t.isRowDisabled||yu;t.isRowSelected&&t.selectionMode==="multi-row"&&(K=O=>t.isRowSelected(O,ge,t.selectionMode));let ne;t.isNodeExpanded&&(ne=O=>t.isNodeExpanded(O,j)),t.isNodeCollapsed&&(ne=O=>!t.isNodeExpanded(O,j)),ne||(ne=A=>j.isNodeExpanded(A.nodePath));let oe=t.rowInfoReducers;if($){if(Pe){let O=ce;t.devToolsDetected&&(O=Date.now());let A=t.aggregationReducers,ue=t.lazyLoad?gf({groupBy:F,pivot:B,mappings:t.pivotMappings,reducers:A,indexer:t.indexer,toPrimaryKey:m,cache:f,marker:r?at(r).track.DataSource.label.LazyGroup.start():void 0},t.originalLazyGroupData):ms({groupBy:F,pivot:B,reducers:A,marker:r?at(r).track.DataSource.label.Group.start():void 0},te);t.groupDeepMap=ue.deepMap,ge&&(ge.getConfig=ct(t));let Ie=Object.keys(oe||{}),ye=Aa(oe),Se={reducers:oe,results:ye,reducerKeys:Ie,rowInfo:{}},xe=ye?Ye=>{Se.rowInfo=Ye,_a(Se)}:void 0,Ze=ee?Ye=>{Ye.isCellSelected=G=>ee.isCellSelected(Ye.id,G)}:void 0,Qe=xe||Ze?pu(xe,Ze):void 0,Ke=bf({marker:r?at(r).track.DataSource.label.FlattenTree.start():void 0,groupResult:ue,lazyLoad:!!t.lazyLoad,reducers:A,toPrimaryKey:m,isRowSelected:K,rowSelectionState:ge,withRowInfo:Qe,repeatWrappedGroupRows:t.rowsPerPage!=null?t.repeatWrappedGroupRows:!1,rowsPerPage:t.rowsPerPage,groupRowsState:t.groupRowsState,generateGroupRows:t.generateGroupRows});le=Ke.data,t.rowInfoReducerResults=Oa({reducers:oe,results:ye,array:le}),t.groupRowsIndexesInDataArray=Ke.groupRowsIndexes,t.reducerResults=ue.reducerResults;let ot=B?vh({deepMap:ue.topLevelPivotColumns,pivotBy:B,pivotTotalColumnPosition:t.pivotTotalColumnPosition??"end",pivotGrandTotalColumnPosition:t.pivotGrandTotalColumnPosition??!1,reducers:t.aggregationReducers,showSeparatePivotColumnForSingleAggregation:t.showSeparatePivotColumnForSingleAggregation}):void 0;t.pivotColumns=ot?.columns,t.pivotColumnGroups=ot?.columnGroups;let $e=Ah(le,l,t.pivotColumns,t.sortTypes);$e!==le&&(le=$e,t.groupRowsIndexesInDataArray=le.map((Ye,G)=>Ye.isGroupRow?G:-1).filter(Ye=>Ye>=0)),t.devToolsDetected&&t.debugTimings.set("group-and-pivot",Date.now()-O)}else le=t.lastGroupDataArray;t.lastGroupDataArray=le,t.groupedAt=ce}else if(_){if(De){let O=ce;t.devToolsDetected&&(O=Date.now());let A=t.aggregationReducers,ue={marker:r?at(r).track.DataSource.label.Tree.start():void 0,isLeafNode:y,getNodeChildren:S,toKey:m,reducers:A},Ie=fs(ue,te);t.treeDeepMap=Ie.deepMap,t.treePaths=Ie.treePaths;let ye=t.selectionMode==="multi-row"?bh(t.treeSelection,t.selectionMode,t):void 0;t.treeSelectionState=ye;let Se=Object.keys(oe||{}),xe=Aa(oe),Ze={reducers:oe,results:xe,reducerKeys:Se,rowInfo:{}},Qe=xe?Q=>{Ze.rowInfo=Q,_a(Ze)}:void 0,Ke=ee?Q=>{Q.isCellSelected=fe=>ee.isCellSelected(Q.id,fe)}:void 0,ot=Qe||Ke?pu(Qe,Ke):void 0,$e=t.selectionMode==="single-row"?Q=>Q.id===t.treeSelection:t.selectionMode==="multi-row"?Q=>ye.isNodeSelected(Q.nodePath):void 0,Ye=t.rowsPerPage!=null?t.repeatWrappedGroupRows:!1;le=Sf({marker:r?at(r).track.DataSource.label.FlattenTree.start():void 0,treeResult:Ie,treeParams:ue,dataArray:te,reducers:A,toPrimaryKey:m,isNodeSelected:$e,isNodeExpanded:ne,treeSelectionState:ye,withRowInfo:ot,repeatWrappedGroupRows:Ye,rowsPerPage:t.rowsPerPage}).data,t.rowInfoReducerResults=Oa({reducers:oe,results:xe,array:le}),t.reducerResults=Ie.reducerResults,t.totalLeafNodesCount=Ie.deepMap.get([])?.totalLeafNodesCount??0,t.treeAt=ce,t.devToolsDetected&&t.debugTimings.set("tree",Date.now()-O)}else le=t.lastTreeDataArray;t.lastTreeDataArray=le}else if(t.groupDeepMap=void 0,t.pivotColumns=void 0,t.pivotColumnGroups=void 0,t.groupRowsIndexesInDataArray=void 0,o.postSortDataArray!=t.postSortDataArray||be||z||H||pe){let A=Object.keys(oe||{}),ue=Aa(oe),Ie={reducers:oe,results:ue,reducerKeys:A,rowInfo:{}};le=te.map((ye,Se)=>{let xe=Mv(ye,ye?m(ye):Se,Se,K,ie,ee);return ue&&(Ie.rowInfo=xe,_a(Ie)),xe}),t.rowInfoReducerResults=Oa({reducers:oe,results:ue,array:le})}if(t.postGroupDataArray=le,le!==t.dataArray&&(t.updatedAt=ce),t.dataArray=le,t.reducedAt=ce,t.selectionMode==="multi-row"){let O=t.rowSelection instanceof Oe&&!t.rowSelection.onlyUsePrimaryKeys;if($&&t.lazyLoad&&!O){r&&(e=at(r).track.DataSource.label.ComputeSelectionCountLazy.start());let A=!0,ue=!1;t.dataArray.forEach(ye=>{if(!ye.isTreeNode&&ye.isGroupRow&&ye.groupKeys.length===1){let{rowSelected:Se}=ye;Se!==!0&&(A=!1),(Se===!0||Se===null)&&(ue=!0)}});let{rowSelection:Ie}=t;Ie instanceof Oe&&Ie.getLazyHiddenRowsCount([])&&(Ie.defaultSelection?ue=!0:A=!1),t.allRowsSelected=A,t.someRowsSelected=ue,r&&(e?.end(),e=void 0)}else{r&&(e=at(r).track.DataSource.label.ComputeSelectionCount.start());let A=t.isTree?t.treeSelectionState?.getSelectionCountFor([]):t.rowSelection.getSelectionCountFor([]);A?(t.allRowsSelected=A.deselectedCount===0,t.someRowsSelected=A.selectedCount>0):(t.allRowsSelected=t.totalLeafNodesCount===0,t.someRowsSelected=!1),r&&(e?.end(),e=void 0)}}return t.originalDataArrayChanged=d,d&&(t.originalDataArrayChangedInfo={timestamp:ce,mutations:C?.size?C:void 0,treeMutations:b?.size?b:void 0}),t.rowInfoStore.notifyDataArray(le,{marker:r?at(r).track.DataSource.label.DiffRowInfoInStore:void 0,dataSourceState:t,previousDataSourceState:o}),i&&i?.track.DataSource.label.PrepareData.end({details:[N||k||Pe||De?{name:"Performed operations",value:[N?"filter":null,k?"sort":null,Pe?"group":null,De?"tree":null].filter(yn).join(", ")}:null,c?{name:"Refetch key",value:`Old ${o.refetchKey} -> New ${t.refetchKey}`}:null,d?{name:"Original data array changed",value:""}:null,{name:"Unfiltered data length",value:t.originalDataArray.length}].filter(yn)}),t}import bu,{useCallback as Hv,useEffect as Kh,useLayoutEffect as Tu,useState as Bh}from"react";function Nh(){return hn()}import{useEffect as no,useMemo as Gh,useRef as Or,useState as Vv}from"react";import{useEffect as Lh,useLayoutEffect as _v,useRef as Go}from"react";function Ho(n,e){let t=Go({}),o=Go({}),r=o.current,i=Go({}),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,Lh(()=>{let s=i.current,u;return Object.keys(s).length!==0&&(u=n(s,r)),i.current={},o.current={},u},l)}function G2(n,e){let t=Go({}),o=Go({}),r=o.current,i=Go({}),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,_v(()=>{let s=i.current,u;return Object.keys(s).length!==0&&(u=n(s,r)),i.current={},o.current={},u},l)}function H2(n,e){let t=[];for(let o in e)e.hasOwnProperty(o)&&t.push(e[o]);Lh(n,t)}function Ov(n,e,t){return e=e.replaceAll("$ERR_CODE",n),e=`${e}
17
17
 
18
18
  ERROR_CODE = ${n}
19
19
 
20
- See http://infinite-table.com/docs/reference/error-codes#${n} for more info.`,{code:n,message:e,type:t??"error"}}function ah(n){return Object.entries(n).reduce((e,[t,o])=>{let r=t,i=$w(r,typeof o=="string"?o:o.message,typeof o=="string"?void 0:o.type);return e[r]=i,e},{})}function Yw(n){return{message:n.join(""),type:"warning"}}function qw(n){return{message:n.join(""),type:"error"}}var Xw=ah({DS001:Yw`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.`}),Zw=ah({CSS001_CSS:qw`It appears you have not loaded the CSS file for InfiniteTable.
20
+ See http://infinite-table.com/docs/reference/error-codes#${n} for more info.`,{code:n,message:e,type:t??"error"}}function kh(n){return Object.entries(n).reduce((e,[t,o])=>{let r=t,i=Ov(r,typeof o=="string"?o:o.message,typeof o=="string"?void 0:o.type);return e[r]=i,e},{})}function Fv(n){return{message:n.join(""),type:"warning"}}function Nv(n){return{message:n.join(""),type:"error"}}var Lv=kh({DS001:Fv`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.`}),kv=kh({CSS001_CSS:Nv`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
- `}),lh={...Xw,...Zw};var gt=new Map,sh=n=>{gt.delete(n),En.delete(n),nn.delete(n),rn.delete(n),on.delete(n),Ut.delete(n)};function nu(n,e,t){let o=gt.get(n);if(!o)return;let r=En.get(n);(!r||!Object.hasOwn(r,e))&&En.set(n,{...r||{},[e]:o.getState()[e]}),nn.set(n,{...nn.get(n)||{},[e]:t}),o.actions[e]=t}function Ta(n,e,t){let o=gt.get(n);if(!o)return;let r=rn.get(n);(!r||!Object.hasOwn(r,e))&&rn.set(n,{...r||{},[e]:o.getDataSourceState()[e]}),on.set(n,{...on.get(n)||{},[e]:t}),o.dataSourceActions[e]=t}var Qw=n=>{let e=n.type==="error"?pn(n.debugId):Dt(n.debugId),t=n.type==="error"?_g:Ag,o=n.debugId?`${n.code}-${n.debugId}`:n.code,r=n.message;n.debugId&&(r=`${r}
25
+ `}),zh={...Lv,...kv};var gt=new Map,Vh=n=>{gt.delete(n),Nn.delete(n),rn.delete(n),ln.delete(n),an.delete(n),Yt.delete(n)};function Su(n,e,t){let o=gt.get(n);if(!o)return;let r=Nn.get(n);(!r||!Object.hasOwn(r,e))&&Nn.set(n,{...r||{},[e]:o.getState()[e]}),rn.set(n,{...rn.get(n)||{},[e]:t}),o.actions[e]=t}function Fa(n,e,t){let o=gt.get(n);if(!o)return;let r=ln.get(n);(!r||!Object.hasOwn(r,e))&&ln.set(n,{...r||{},[e]:o.getDataSourceState()[e]}),an.set(n,{...an.get(n)||{},[e]:t}),o.dataSourceActions[e]=t}var zv=n=>{let e=n.type==="error"?gn(n.debugId):Et(n.debugId),t=n.type==="error"?uh:sh,o=n.debugId?`${n.code}-${n.debugId}`:n.code,r=n.message;n.debugId&&(r=`${r}
26
26
 
27
- Component DEBUG_ID = "${n.debugId}"`),t(r,o,e)},Ir=n=>{let{debugId:e,key:t}=n,o=lh[t];if(o&&(Qw({...o,debugId:e}),e&&t)){let r=gt.get(e);r&&r.getState().devToolsDetected&&o&&(r.getState().debugWarnings.set(t,{...o,debugId:e,status:"new"}),An(e))}};globalThis.logDevToolsWarning=Ir;var An=n=>{let e=window.__INFINITE_TABLE_DEVTOOLS_HOOK__;if(!e)return;let t=gt.get(n);t&&e(n,t)};function ch(n){let{getDataSourceState:e,dataSourceActions:t,dataSourceState:o}=n,{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:h,cursorId:S}=o,[y,C]=Jw({vertical:!1,horizontal:!1}),T=Rr(y);Zn(()=>(a.onChange(M=>{M&&(T.current=M,C(M))}),()=>a.destroy()),[a]),Zn(()=>{if(!m)return;let M=requestAnimationFrame(()=>{T.current?.vertical||g&&(t.cursorId=g)});return()=>cancelAnimationFrame(M)},[g]),Zn(()=>{if(!m||g!==void 0)return;let M=requestAnimationFrame(()=>{T.current?.vertical||S!=null&&i.length&&(t.cursorId=i.length)});return()=>cancelAnimationFrame(M)},[i.length,g]),Zn(()=>{let M=e(),{livePaginationCursor:D,livePagination:E,dataArray:z}=M;!y.vertical&&E&&(D?t.cursorId=D:D===void 0&&z.length&&(t.cursorId=z.length))},[y.vertical]);let b=uh(()=>lg(),[])(p,h,f),R={sortInfo:u.sortInfo?s:null,groupBy:u.groupBy?c:null,pivotBy:u.pivotBy?d:null,refetchKey:l,filterValue:u.filterValue?b:null,cursorId:m?S:null},w=Rr(!0),v=Rr(!1);ev(n,{sortInfo:s,groupBy:c,pivotBy:d,filterValue:p,refetchKey:l,cursorId:m?S:null},v);let P=Yr(),x=Rr([]);Lo(()=>{let M=e(),D=P(),{isDetail:E,isDetailReady:z}=zs(D,e);if(E&&!z)return;let V=Date.now(),N=x.current;N.length>=10&&N.splice(0,1),N.push(V),V-N[0]<200&&N.length>=10&&Ir({debugId:M.debugId,key:"DS001"}),typeof M.data!="function"&&tn(M.data,M,t,void 0,D)},{data:r}),Lo(M=>{let D=Object.keys(M),E=!1;if(D.length===1){E=!!M.cursorId;let F=e().data;if(Array.isArray(F)&&M.refetchKey){t.originalDataArray=F;return}}let z=P(),{isDetail:V,isDetailReady:N}=zs(z,e);if(V&&!N)return;let L=e();if(typeof L.data=="function"){if(v.current&&!E&&sg(L))return;let F;L.debugId&&(F=rt(L.debugId).track.DataSource.label.RemoteDataLoad.start()),tn(L.data,L,t,{append:E},z).then(()=>{F?.end()})}},{...R,data:r}),Zn(()=>{v.current=!1}),Lo(()=>{let M=e();if(w.current){w.current=!1;let D=Nt(M,void 0,P());t.dataParams=D}},R)}function ev(n,e,t){let{getDataSourceState:o,dataSourceActions:r,dataSourceState:i}=n;Zn(()=>{r.lazyLoadCacheOfLoadedBatches=new j},[i.data,i.dataParams]);let{lazyLoadBatchSize:a,lazyLoad:l,originalLazyGroupDataChangeDetect:s,notifyRenderRangeChange:u,dataArray:c,groupRowsState:d,scrollStopDelayUpdatedByTable:p}=i,f=Rr(null),m=(h,S,y=o().lazyLoadCacheOfLoadedBatches)=>{let C=o();if(h=h||f.current,!h)return;let{renderStartIndex:T,renderEndIndex:I}=h,{lazyLoadBatchSize:b,lazyLoad:R}=C;R&&((!b||b<=0)&&(!C.groupBy||C.groupBy.length===0)||cg({startIndex:T,endIndex:I,lazyLoadBatchSize:b,componentState:C,componentActions:r,dismissLoadedRows:S?.dismissLoadedRows??!1},y))},g=uh(()=>Yt(m,{wait:p}),[p]);Lo(h=>{if(l)return h.sortInfo||h.filterValue||h.groupBy||h.pivotBy||h.refetchKey||h.cursorId?(o().lazyLoadCacheOfLoadedBatches.clear(),o().originalLazyGroupData.clear(),m(u.get(),{dismissLoadedRows:!0}),t.current=!0):(h.originalLazyGroupDataChangeDetect||h.groupRowsState)&&m(u.get()),u.onChange(S=>{f.current=S,ug(o().lazyLoadCacheOfLoadedBatches),m(S)})},{sortInfo:e.sortInfo,filterValue:e.filterValue,groupBy:e.groupBy,pivotBy:e.pivotBy,refetchKey:e.refetchKey,cursorId:e.cursorId,lazyLoadBatchSize:a,lazyLoad:l,originalLazyGroupDataChangeDetect:s,groupRowsState:d}),Zn(()=>{a&&a>0&&g()},[c])}function wr(n){let e=Fn(),t=Yr(),o=!!e,r=o?e.id:"master",{contextValue:i,ContextComponent:a}=fh(n),{componentActions:l,componentState:s,assignState:u}=i;s.getDataSourceMasterContextRef.current=t;let c=Ne(s),[d]=ph(()=>Xg({getState:c,actions:l})),p={dataSourceState:s,dataSourceActions:l,getDataSourceMasterContext:t,getDataSourceState:c,assignState:u,dataSourceApi:d},f=Ne(i),m=Ne(p),g=As(),h=tv(({children:S})=>{let y=oa(),[C]=ph(()=>rh());typeof S=="function"&&(S=S(c()));let T=m();return C.setSnapshot(T),ru(()=>{C.notify()}),ou.createElement(a.Provider,{key:r,value:f()},ou.createElement(g.Provider,{value:T},ou.createElement(y.Provider,{value:C},S)))},[a,o,r]);return ru(()=>{let S=t();S&&S.registerDetail(p)},[]),ru(()=>()=>{let S=c();S.onCleanup(S)},[]),ch({dataSourceState:s,dataSourceActions:l,getDataSourceState:c}),dh(()=>{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]),dh(()=>{s.onReady?.(d)},[]),{DataSource:h,state:p.dataSourceState}}function nv(){return Fe(n=>n.dataSourceApi)}var Ia=class Ia{constructor(e,t){this.keysInOrder=[];if(typeof e=="number")this.maxSize=e,this.currentMap=new Map;else if(this.maxSize=t??Ia.DEFAULT_SIZE,e){let o=Array.from(e);this.maxSize<o.length&&o.slice(o.length-this.maxSize),this.currentMap=new Map,o.forEach(([r,i])=>{this.set(r,i)})}else this.currentMap=new Map}values(){return this.currentMap.values()}get size(){return this.currentMap.size}delete(e){return this.currentMap.has(e)?(this.currentMap.delete(e),this.keysInOrder=this.keysInOrder.filter(t=>t!==e),!0):!1}has(e){return this.currentMap.has(e)}get(e){return this.currentMap.get(e)}set(e,t){if(this.has(e)&&this.delete(e),this.maxSize-this.currentMap.size<=0){let[r]=this.keysInOrder.splice(0,1);r!=null&&this.currentMap.delete(r)}return this.keysInOrder.push(e),this.currentMap.set(e,t),this}};Ia.DEFAULT_SIZE=10;var Ca=Ia;var iu=class{add(e,t){}get(e){}delete(e){}has(e){return!1}},Ra=class{constructor(e){this.storage=new Ca(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)}},au=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)}},vr=class{constructor(e){this.cacheStorage=e===!1?new iu:e===!0?new au:typeof e=="number"?new Ra(e):new Ra(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 ov=(e=>(e.INIT="INIT",e))(ov||{});var{useManagedComponent:fh}=Et({debugName:"DataSource",initSetupState:Vg,forwardProps:Hg,concludeReducer:oh,mapPropsToState:Bg,onPropChange:Wg,cleanup:Gg,interceptActions:Ug(),mappedCallbacks:jg()});function q2(n){let{DataSource:e}=wr(n);return mh.createElement(e,null,n.children??null)}function X2(){let{rowInfoReducerResults:n}=Fe(e=>({rowInfoReducerResults:e.dataSourceState.rowInfoReducerResults}));return n}function gh(n){let{getDataSourceState:e}=Fe(o=>({getDataSourceState:o.getDataSourceState}));return rv(()=>n.filter(r=>typeof r.rowspan=="function").length?({rowIndex:r,colIndex:i})=>{let a=e().dataArray,l=a[r];if(!l)return 1;let s=l.data,u=n[i];return!u||!u.rowspan?1:u.rowspan({column:u,data:s,dataArray:a,rowInfo:l,rowIndex:r})}:void 0,[n])}import{useCallback as iv}from"react";var iW=Dt("useColumnSizeFn");function hh(n){return iv(t=>{let o=n[t];return o?o.computedWidth:0},[n])}import{useEffect as ko,useLayoutEffect as dv,useMemo as pv}from"react";var av={scrollLeft:0,scrollTop:0},Pr=class{constructor(){this.scrollPosition=av;this.onScrollFns=[];this.getScrollPosition=()=>this.scrollPosition;this.onScroll=e=>(this.onScrollFns.push(e),()=>{this.onScrollFns=this.onScrollFns.filter(t=>t!==e)});this.setScrollPosition=e=>{this.scrollPosition=e,this.notifyScrollChange()};this.destroy=()=>{this.onScrollFns=[]}}notifyScrollChange(){let{scrollPosition:e}=this,t=this.onScrollFns;for(let o=0,r=t.length;o<r;o++)t[o](e)}};var Dr=n=>`--infinite-${n}`;var lu=40,xr=Dr(zd),yh=`var(${Dr("density-scale")}, 1)`,Mr=`calc(var(${Dr("row-height")}, ${lu}px) * ${yh})`,su=`calc(var(${xr}) * ${yh})`;function Sh(n,e){if(!n)return null;if(e.rowHeightCSSVar!==Mr)return n;if(!sv())return null;let t=Math.round(n);return t===e.rowHeight?null:t}var lv=Dr("loaded");function sv(){return typeof document>"u"||typeof getComputedStyle!="function"?!1:getComputedStyle(document.documentElement).getPropertyValue(lv).trim()===di}function bh(n,e){return n?e.columnHeaderHeightCSSVar===su?Math.round(n):n:null}function Th(n,e){let t=new Map;function o(r){return e[r]!==!1}return Object.keys(n).forEach(r=>{let a=n[r].columnGroup,l=0;for(o(r)||(l=-1);a;){let s=n[a];if(!s)break;o(a)&&l++,a=s.columnGroup}t.set(r,l)}),t}import*as Ch from"react";function Ih(n){return(e,t)=>Ch.createElement(n,{key:e.id,rowInfo:e,cache:t})}var Er=class extends $n{constructor(t,o){super(`${t}:HorizontalLayout`);this.visiblePageCount=0;this.isHorizontalLayoutBrain=!0;this._totalPageCount=0;this.pageWidth=0;this.initialCols=0;this.initialRows=0;this.initialColWidth=0;this.colWidth=()=>10;this.getColWidth=t=>typeof this.initialColWidth=="number"?this.initialColWidth:this.initialColWidth(t%this.initialCols);this.onTotalPageCountChangeFns=new Set;this.onTotalPageCountChange=t=>(this.onTotalPageCountChangeFns.add(t),()=>{this.onTotalPageCountChangeFns.delete(t)});this.onScrollOriginChange=t=>this.options?.masterBrain?this.options.masterBrain.onScrollOriginChange(t):super.onScrollOriginChangeForBrain(t);this.options=o,this.options.masterBrain&&this.options.masterBrain.onTotalPageCountChange(()=>{this.updateRenderCount({horizontal:!0,vertical:!0})})}computeDirectionalRenderCount(t,o,r,i){if(t==="vertical"||typeof o=="number")return super.computeDirectionalRenderCount(t,o,r,i);let a=0,l=i.width,s=Math.floor(l/this.pageWidth);a+=s*this.initialCols;let u=l-s*this.pageWidth,c=[];for(let d=0;d<this.initialCols;d++)c.push(this.getItemSize(d,t));return a+=Hi(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 o=t.rowIndex,r=t.colIndex;return t.rowIndex>=this.rowsPerPage&&this.rowsPerPage>0&&(o=t.rowIndex%this.rowsPerPage,r=Math.floor(t.rowIndex/this.rowsPerPage)*this.initialCols+r),{rowIndex:o,colIndex:r}}getHorizontalLayoutPositionFromMatrixCoordinates(t){let o=t.rowIndex,r=t.colIndex;if(t.colIndex>=this.initialCols&&this.initialCols>0){let i=Math.floor(t.colIndex/this.initialCols);r=t.colIndex-i*this.initialCols,o=this.rowsPerPage*i+t.rowIndex}return{colIndex:Math.min(r,this.initialCols),rowIndex:this.options.isHeader?o:Math.min(o,this.initialRows)}}update(t){let{rows:o,cols:r,rowHeight:i,colWidth:a,width:l,height:s}=t,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 o=="number",m=typeof r=="number",g=f&&o!==this.initialRows,h=m&&r!==this.initialCols;f&&g&&(this.initialRows=o,this.rows=o),m&&h&&(this.initialCols=r,this.cols=r);let S=i!=null,y=a!=null,C=S&&i!==this.rowHeight,T=y&&a!==this.initialColWidth;S&&(this.rowHeight=i),y&&(this.initialColWidth=a,this.colWidth=this.getColWidth);let I=g||C||p,b=h||T||d||I;(b||I)&&this.updateRenderCount({horizontal:b,vertical:I})}getInitialRowHeight(){return typeof this.rowHeight!="number"?this.getRowHeight(0):this.rowHeight}get totalPageCount(){return this.options.masterBrain?this.options.masterBrain.totalPageCount:this._totalPageCount}set totalPageCount(t){this.options.masterBrain||(this._totalPageCount=t)}getPageWidth(){return this.pageWidth}doUpdateRenderCount(t=Jt){let o=this.getInitialRowHeight(),r=0;for(let a=0;a<this.initialCols;a++)r+=this.getColWidth(a);this.pageWidth=r,this.rowsPerPage=Math.floor(this.availableHeight/o);let i=!1;if(!this.options.masterBrain){let a=this.totalPageCount;this.totalPageCount=this.rowsPerPage?Math.ceil(this.initialRows/this.rowsPerPage):0,a!=this.totalPageCount&&(i=!0)}this.visiblePageCount=this.totalPageCount&&this.pageWidth?Math.max(Math.ceil(this.availableWidth/this.pageWidth),1):1,this.availableRenderHeight=this.visiblePageCount*this.rowsPerPage*o,this.cols=Math.max(this.totalPageCount*this.initialCols,this.initialCols),this.rows=this.rowsPerPage,super.doUpdateRenderCount(t),i&&this.notifyTotalPageCountChange()}notifyTotalPageCountChange(){if(this.destroyed)return;let t=this.onTotalPageCountChangeFns;t.forEach(o=>{Ve(()=>{this.destroyed||t.has(o)&&o(this.totalPageCount)})})}getVirtualColIndex(t,o){return this.initialCols*(o?.pageIndex??0)+t}destroy(){this.destroyed||(super.destroy(),this.options.masterBrain=void 0,this.onTotalPageCountChangeFns.clear())}supportsLargeContent(t){return t==="horizontal"}alignScrollOrigin(t,o){return t==="vertical"||!this.pageWidth?Math.floor(o):Math.floor(o/this.pageWidth)*this.pageWidth}getScrollOriginPageIndex(){let t=this.getPageWidth();return t?Math.round(this.getScrollOrigin().scrollLeft/t):0}getScrollOrigin(){return this.options?.masterBrain?this.options.masterBrain.getScrollOrigin():super.getScrollOrigin()}updateScrollOrigin(){this.options?.masterBrain||super.updateScrollOrigin()}getVirtualizedContentSizeFor(t){return t==="vertical"?this.getInitialRowHeight()*this.rowsPerPage:this.pageWidth*this.totalPageCount}};function Qn(){return{current:null}}var uu={};function cu(n){return`.${Bt}[data-row-index${n?`="${n.rowIndex}"`:""}][data-col-index${n?`="${n.colIndex}"`:""}]`}function du(n,e){let t=Pn(n),o=e?new Er(t,{isHeader:!1}):new $n(t),r=`${t}:header`,i=e?new Er(r,{isHeader:!0,masterBrain:o}):new $n(r);o.onScroll(c=>{i.setScrollPosition({scrollLeft:c.scrollLeft,scrollTop:0})});let{renderer:a,onRenderUpdater:l}=gr(o),{renderer:s,onRenderUpdater:u}=gr(i);return o.onAvailableSizeChange(c=>{i.update({width:c.width})}),{brain:o,headerBrain:i,renderer:a,onRenderUpdater:l,headerRenderer:s,headerOnRenderUpdater:u}}function Rh({debugId:n,wrapRowsHorizontally:e}){let t={},{brain:o,headerBrain:r,renderer:i,onRenderUpdater:a,headerRenderer:l,headerOnRenderUpdater:s}=du(n,!!e),u=Qn(),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=cu(d);return u.current.querySelector(p)||null},brain:o,headerBrain:r,domRef:u,columnMenuTargetRef:Qn(),editingValueRef:Qn(),scrollerDOMRef:Qn(),portalDOMRef:Qn(),focusDetectDOMRef:Qn(),activeCellIndicatorDOMRef:Qn(),onColumnMenuClick:ye(),cellContextMenu:ye(),contextMenu:ye(),onFilterOperatorMenuClick:ye(),pendingColumnFilters:new ki,flashingDurationCSSVarValue:null,onFlashingDurationCSSVarChange:ye(),onRowHeightCSSVarChange:ye(),onRowDetailHeightCSSVarChange:ye(),onColumnHeaderHeightCSSVarChange:ye(),cellClick:ye(),cellMouseDown:ye(),keyDown:ye(),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 Pr,pinnedEndScrollListener:new Pr,columnsWhenInlineGroupRenderStrategy:void 0,editingCell:null,forceBodyRerenderTimestamp:0}}var wh=n=>({debugId:1,scrollTopKey:1,components:1,id:1,loadingText:1,pivotColumns:1,groupColumn:1,onReady:1,domProps:1,onKeyDown:1,onCellClick:1,onCellDoubleClick:1,focusedClassName:1,focusedWithinClassName:1,focusedStyle:1,focusedWithinStyle:1,onSelfFocus:1,onFocusWithin:1,onSelfBlur:1,onBlurWithin:1,onContextMenu:1,onCellContextMenu:1,onRenderRangeChange:1,onRowMouseEnter:1,onRowMouseLeave:1,onScrollToTop:1,onScrollToBottom:1,onScrollStop:1,scrollToBottomOffset:1,getColumnMenuItems:1,getCellContextMenuItems:1,getContextMenuItems:1,menuPortalContainer:1,menuConstrainTo:1,columnPinning:1,editable:1,columnDefaultEditable:1,columnDefaultFilterable:1,columnDefaultGroupable:1,columnDefaultSortable:1,keyboardShortcuts:1,rowStyle:1,cellStyle:1,repaintCellsKey:1,rowProps:1,rowClassName:1,rowHoverClassName:1,cellClassName:1,repeatWrappedGroupRows:1,pinnedStartMaxWidth:1,pinnedEndMaxWidth:1,pivotColumn:1,pivotColumnGroups:1,getFilterOperatorMenuItems:1,onScrollbarsChange:1,autoSizeColumnsKey:1,wrapRowsHorizontally:1,columnDefaultFlex:1,draggableColumnsRestrictTo:e=>e??!1,columnMenuRealignDelay:e=>e??50,scrollStopDelay:e=>e??250,viewportReservedWidth:e=>e??0,resizableColumns:e=>e??!0,rowDetailCache:e=>new vr(e),hideColumnWhenGrouped:e=>e??!1,columnMinWidth:e=>e??30,columnMaxWidth:e=>e??5e3,columnDefaultWidth:e=>e??200,columnCssEllipsis:e=>e??!0,draggableColumns:1,columnDefaultDraggable:1,headerOptions:e=>({alwaysReserveSpaceForSortIcon:!0,...e}),showSeparatePivotColumnForSingleAggregation:e=>e??!1,sortable:1,hideEmptyGroupColumns:e=>e??!1,pivotTotalColumnPosition:e=>e??"end",pivotGrandTotalColumnPosition:1,licenseKey:e=>e,keyboardSelection:e=>e??!0,multiRowSelectionWith:e=>e??"checkbox",activeRowIndex:1,activeCellIndex:1,columnOrder:e=>e??!0,header:e=>e??!0,showZebraRows:e=>e??!0,showHoverRows:e=>e??!0,virtualizeColumns:e=>e??!0,rowHeight:e=>typeof e=="number"||typeof e=="function"?e:e===Mr?lu:0,rowDetailHeight:e=>typeof e=="number"||typeof e=="function"?e:300,columnHeaderHeight:e=>typeof e=="number"?e:30,columns:1,columnVisibility:e=>e??uu,columnGroupVisibility:e=>e??uu,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 uv(n){let{groupBy:e,groupColumn:t,groupRenderStrategy:o}=n;return o||(t!=null&&typeof t=="object"?"single-column":(e.filter(i=>i.column).length,"multi-column"))}var vh=n=>{n.brain.destroy(),n.headerBrain.destroy(),n.renderer.destroy(),n.headerRenderer.destroy(),n.onRenderUpdater.destroy(),n.headerOnRenderUpdater.destroy(),n.onFlashingDurationCSSVarChange.destroy(),n.onRowHeightCSSVarChange.destroy(),n.onColumnHeaderHeightCSSVarChange.destroy(),n.onColumnMenuClick.destroy(),n.onFilterOperatorMenuClick.destroy(),n.domRef.current=null,n.columnMenuTargetRef.current=null,n.scrollerDOMRef.current=null,n.portalDOMRef.current=null,n.onRowDetailHeightCSSVarChange.destroy(),n.pinnedEndScrollListener.destroy(),n.pinnedStartScrollListener.destroy()};function Ph(n){return n.reduce((e,t,o)=>{let r={groupBy:t,groupIndex:o};return t.field?e.set(t.field,r):t.groupField&&e.set(t.groupField,r),e},new Map)}var wa=new WeakMap;function Dh(){return{rowDetailState:(n,e)=>({callbackParams:[n,{expandRow:e.lastRowToExpandRef.current,collapseRow:e.lastRowToCollapseRef.current}]})}}var xh=n=>{let{props:e,state:t,oldState:o,parentState:r}=n,i=t.pivotColumnGroups||t.columnGroups,a=t.columnGroups&&t.columnGroups!=o?.columnGroups||t.columnGroups&&t.columnGroupVisibility!=o?.columnGroupVisibility||t.pivotColumnGroups!=o?.pivotColumnGroups?Th(i??uu,t.columnGroupVisibility):t.columnGroupsDepthsMap,l=r?.groupBy,s=uv({groupRenderStrategy:e.groupRenderStrategy,groupBy:l,groupColumn:e.groupColumn}),u,c=e.rowDetailRenderer,d=e.components?.RowDetail;if(!c&&d){let h=wa.get(d);h||(h=Ih(d),wa.set(d,h)),c=h}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=h=>u.isRowDetailsExpanded(h.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||e.columnHeaderHeight===xr?su:e.columnHeaderHeight:""};if(t.devToolsDetected&&t.debugId){let h=nn.get(t.debugId);h&&(g={...g,...h})}return g};function Mh(n,e){let t={};return Object.keys(n).forEach(o=>{let r=n[o],i=r;if(!i.groupByForColumn||Array.isArray(i.groupByForColumn))return;let{groupByForColumn:a}=i,l=a.field||a.groupField;l&&e.get(l)&&(t[o]=r)}),t}function Eh(n){let{hideEmptyGroupColumns:e,groupByMap:t,computedGroupColumns:o,groupRowsIndexesInDataArray:r,dataArray:i,groupBy:a}=n,l={...n.columnVisibility};if(!e)return Object.keys(o).forEach(d=>{l[d]===!1&&delete l[d]}),l;if(!r||!r.length)return l;let s=a.length,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(o).forEach(d=>{let p=o[d],{groupByForColumn:f}=p;if(Array.isArray(f))return;let m=f.field||f.groupField;if(!m)return;t.get(m).groupIndex>u&&e?l[d]!==!1&&(l[d]=!1):l.hasOwnProperty(d)&&delete l[d]}),l}import*as an from"react";var Ah=n=>n.dataSourceHasGrouping&&n.isGroupRow&&n.childrenLoading||!n.selfLoaded;import*as va from"react";var _h="_16lm1iwb _16lm1iw1d _16lm1iwk";var Oh="164.93361431346415 56.97787143782138",Fh={margin:"auto",display:"block",shapeRendering:"auto"},KW=Object.keys({size:1,style:1,className:1,viewBox:1});var Nh=n=>va.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",style:{...Fh,...n.style},width:"24px",height:"24px",viewBox:n.viewBox??"0 0 100 100",preserveAspectRatio:"xMidYMid",className:U(n.className,_h,uo.loading,Vc,"InfiniteIcon","InfiniteIcon-loading")},va.createElement("circle",{cx:"50",cy:"50",fill:"none",strokeWidth:"10",r:"35",strokeDasharray:Oh},va.createElement("animateTransform",{attributeName:"transform",type:"rotate",repeatCount:"indefinite",dur:"1s",values:"0 50 50;360 50 50",keyTimes:"0;1"})));function Lh(n,e,t,o){let{groupByForColumn:r,groupIndexForColumn:i,groupRenderStrategy:a}=n,l=r.column?{...r.column}:{},s=typeof t=="function"?t(n,e):t;return{header:`Group by ${r.field||r.groupField}`,groupByForColumn:r,render:o.getGroupColumnRender({groupIndexForColumn:i,groupRenderStrategy:a}),...l,...s,renderGroupIcon:o.getGroupColumnRenderGroupIcon({initialRenderGroupIcon:s?.renderGroupIcon??l.renderGroupIcon,groupIndexForColumn:i,toggleGroupRow:e,groupRenderStrategy:a})}}function kh(n,e,t,o){let r=typeof t=="function"?t(n,e):t,i={};return n.sortable!=null&&(i.sortable=n.sortable),{...i,header:"Group",groupByForColumn:n.groupBy,renderSelectionCheckBox:n.selectionMode==="multi-row",render:o.getGroupColumnRender({groupIndexForColumn:0,groupRenderStrategy:"single-column"}),...r,renderGroupIcon:o.getGroupColumnRenderGroupIcon({initialRenderGroupIcon:r?.renderGroupIcon,groupIndexForColumn:0,toggleGroupRow:e,groupRenderStrategy:"single-column"})}}function pu({groupIndexForColumn:n,groupRenderStrategy:e}){return t=>{let{rowInfo:o,renderBag:r,column:i,align:a}=t,{value:l,groupIcon:s,selectionCheckBox:u}=r,c=o,d=e==="multi-column"&&c.isGroupRow&&n+1!==c.groupNesting,p=U(so.flex,i.align==="end"?Xo.rowReverse:Xo.row,Pc.center,`${Bt}Expander`,e==="single-column"||e==="multi-column"&&(!o.isGroupRow||u||d&&i.field)?Zp({align:a}):null);return d?i.field?an.createElement("div",{className:p},u,an.createElement("div",{className:_t},l??null)):u?an.createElement("div",{className:p},u):null:(e==="single-column"&&c.isGroupRow,an.createElement("div",{className:p},s,u,an.createElement("div",{className:_t},l??null)))}}function fu({groupIndexForColumn:n,groupRenderStrategy:e,toggleGroupRow:t,initialRenderGroupIcon:o}){return r=>{let{rowInfo:i,value:a,rootGroupBy:l,pivotBy:s,column:u}=r,c=e!=="inline"?i:i.isGroupRow&&i.parents?.[n]||i;if(!c)return null;let d=c.collapsed;if(e==="inline"){if(c.groupCount===1)return a;if(c.groupNesting===n&&d)return null}else if(!c.isGroupRow||e==="multi-column"&&n+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 Ah(c)?f=an.createElement(Nh,null):m&&(f=an.createElement(Wn,{expanded:!d,direction:u.align==="end"?"end":"start",onChange:()=>{t(p)}})),o&&(r.renderBag.groupIcon=f,f=an.createElement(Tt,{render:o,renderParam:r})),f}}function zh(){return{getGroupColumnRender:pu,getGroupColumnRenderGroupIcon:fu}}function Vh(n,e,t){return Lh(n,e,t,zh())}function Gh(n,e,t){return kh(n,e,t,zh())}function Hh(n){let{pivotColumns:e,groupBy:t,pivotBy:o,selectionMode:r,groupColumn:i,pivotTotalColumnPosition:a,pivotGrandTotalColumnPosition:l,pivotColumn:s,groupRenderStrategy:u,toggleGroupRow:c,columns:d}=n;if(u==="inline")return{columns:void 0,groupColumnIds:[]};let p={},f=[];if(u==="multi-column")t.forEach((m,g,h)=>{let S=Vh({groupByForColumn:m,groupBy:t,pivotBy:o,groupIndexForColumn:g,groupCount:h.length,groupRenderStrategy:u,selectionMode:r},c,i),y=S.id||`group-by-${m.field||m.groupField}`;f.push(y),p[y]=S});else if(u==="single-column"&&t.length){let m=Gh({groupCount:t.length,groupBy:t,pivotBy:o,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],h=g.pivotTotalColumn&&g.columnGroup,S=g.pivotTotalColumn&&!g.columnGroup;if(h&&a===!1||S&&l===!1)return;let y={...g};s&&(typeof s=="function"?y={...y,...s({column:y,pivotBy:o,groupBy:t})}:y={...y,...s}),y.inheritFromColumn!==!1&&(y={...typeof y.inheritFromColumn=="string"?d[y.inheritFromColumn]:y.pivotAggregator?.field?Ln(d,y.pivotAggregator.field):void 0,...y}),!y.render&&y.renderValue&&(y.render=C=>y.renderValue(C)),p[m]=y}):Object.keys(d).forEach(m=>{let g=d[m];p[m]=g}),{columns:Object.keys(p).length?p:void 0,groupColumnIds:f}}import{useCallback as cv}from"react";function mu(){let{getDataSourceState:n,dataSourceActions:e,getDataSourceMasterContext:t}=Fe(r=>({getDataSourceState:r.getDataSourceState,dataSourceActions:r.dataSourceActions,getDataSourceMasterContext:r.getDataSourceMasterContext}));return cv(r=>{let i=n(),a=new Rt(i.groupRowsState);if(a.toggleGroupRow(r),e.groupRowsState=a,i.lazyLoad){let l=[bt,...r],s=i.originalLazyGroupData.get(l);a.isGroupRowExpanded(r)?s?.cache||tn(i.data,i,e,{groupKeys:r},t()):s?.cache||(i.lazyLoadCacheOfLoadedBatches.getKeysStartingWith(r).forEach(c=>{i.lazyLoadCacheOfLoadedBatches.delete(c)}),e.lazyLoadCacheOfLoadedBatches=j.clone(i.lazyLoadCacheOfLoadedBatches),i.originalLazyGroupData.delete(l),e.originalLazyGroupDataChangeDetect=xt())}},[])}function fv(n){return pv(()=>Ph(n),[n])}function Kh(n,e){let{groupBy:t,dataSourceActions:o}=Fe(u=>({groupBy:u.dataSourceState.groupBy,dataSourceActions:u.dataSourceActions})),{groupRenderStrategy:r,pivotTotalColumnPosition:i,pivotGrandTotalColumnPosition:a}=n;ko(()=>{o.generateGroupRows=r!=="inline"},[r]),ko(()=>{o.pivotTotalColumnPosition=i},[i]),ko(()=>{a!=null&&(o.pivotGrandTotalColumnPosition=a)},[a]);let l=fv(t);mv(l,n,e);let{toggleGroupRow:s}=gv();return hv(l,n,e),{toggleGroupRow:s}}function mv(n,e,t){let o=mu(),{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],h={},S=c.get(g.field);if(S&&d==="inline"){let{groupIndex:C}=S;h={groupByForColumn:S.groupBy,field:S.groupBy?.field,valueGetter:S.groupBy?.valueGetter,valueFormatter:({rowInfo:T})=>T.isGroupRow?T.groupKeys?.[C]:T.value,rowspan:({rowInfo:T,dataArray:I})=>{if(T.isTreeNode||!T.isGroupRow)return 1;let b=I[T.indexInAll-1]||{indexInParentGroups:[]};if(!b||!b.dataSourceHasGrouping)return 1;let R=b.indexInParentGroups||[],w=T.indexInParentGroups||[],v=!1;for(let M=0;M<=C;M++){let D=R[M];if(w[M]!==D){v=!0;break}}if(!v)return 1;let P=T.parents[C];return P?P.groupCount-(P.collapsedChildrenCount||0)+(P.collapsedGroupsCount||0):1},renderGroupIcon:fu({groupIndexForColumn:C,groupRenderStrategy:d,toggleGroupRow:p,initialRenderGroupIcon:g.renderGroupIcon}),render:pu({groupIndexForColumn:C,groupRenderStrategy:d})}}let y={...h,...g};f[m]=y}),Object.keys(f).length===0?void 0:f}ko(()=>{(()=>{l.columnsWhenInlineGroupRenderStrategy=a?void 0:s(r,n,i,o)})()},[r,n,i,o])}function gv(){let{groupBy:n,pivotBy:e,selectionMode:t}=Fe(m=>({groupBy:m.dataSourceState.groupBy,pivotBy:m.dataSourceState.pivotBy,selectionMode:m.dataSourceState.selectionMode})),{componentActions:o,componentState:{columns:r,groupColumn:i,hideColumnWhenGrouped:a,groupRenderStrategy:l,pivotColumns:s,pivotColumn:u,pivotTotalColumnPosition:c,pivotGrandTotalColumnPosition:d},getComponentState:p}=At(),f=mu();return ko(()=>{(()=>{let{columns:g,groupColumnIds:h}=Hh({columns:r,groupColumn:i,pivotColumn:u,pivotTotalColumnPosition:c,pivotGrandTotalColumnPosition:d,groupRenderStrategy:l==="inline"?"single-column":l,groupBy:n,pivotBy:e,pivotColumns:s,toggleGroupRow:f,selectionMode:t});o.columnsWhenGrouping=g;let S=p().columnOrder;if(h.length&&Array.isArray(S)){let y=new Set(S),C=!1;h.forEach(T=>{y.has(T)||(C=!0,S=[T,...S])}),C&&(o.columnOrder=S)}})()},[r,n,e,t,a,i,l,s,c,u]),{toggleGroupRow:f}}function hv(n,e,t){let{dataArray:o,groupRowsIndexesInDataArray:r,groupBy:i,groupRowsState:a,originalLazyGroupDataChangeDetect:l,getDataSourceState:s}=Fe(h=>({getDataSourceState:h.getDataSourceState,dataArray:h.dataSourceState.dataArray,groupRowsIndexesInDataArray:h.dataSourceState.groupRowsIndexesInDataArray,groupBy:h.dataSourceState.groupBy,groupRowsState:h.dataSourceState.groupRowsState,originalLazyGroupDataChangeDetect:h.dataSourceState.originalLazyGroupDataChangeDetect})),{columnTypes:u,computedColumns:c,hideColumnWhenGrouped:d,hideEmptyGroupColumns:p,groupRenderStrategy:f}=e,m=t,g=Ne(e);dv(()=>{if(f!=="multi-column")return;let h=g(),S=Mh(c,n),y=Eh({computedGroupColumns:S,columnVisibility:h.columnVisibility,hideEmptyGroupColumns:p,groupRowsIndexesInDataArray:r,dataArray:o,groupBy:i,groupByMap:n});St(h.columnVisibility,y)||(m.columnVisibility=y)},[s,f,l,i,n,c,p?o:null,p?a:null,p?r:null,p]),ko(()=>{let h=i.length>0,S=g(),{columnVisibility:y,columnVisibilityForGrouping:C,hideColumnWhenGrouped:T}=S,I={...y},b={...C},R=!1,w=new Set,v=new Set;Object.keys(c).forEach(P=>{let x=c[P];if(x.defaultHiddenWhenGroupedBy||T!=null)if(x.defaultHiddenWhenGroupedBy==="*"&&h||(x.defaultHiddenWhenGroupedBy===!0||T)&&x.field&&n.get(x.field)||typeof x.defaultHiddenWhenGroupedBy=="string"&&n.get(x.defaultHiddenWhenGroupedBy)||typeof x.defaultHiddenWhenGroupedBy=="object"&&Object.keys(x.defaultHiddenWhenGroupedBy).reduce((D,E)=>D||n.has(E),!1)){if(b[P]!==!1){if(y[P]===!1)return;b[P]=!1,R=!0,w.add(P)}}else b[P]===!1&&(delete b[P],R=!0,v.add(P))}),R&&(m.columnVisibilityForGrouping=b,v.forEach(P=>{delete I[P]}),w.forEach(P=>{I[P]=!1}),m.columnVisibility=I)},[c,u,i,n,d])}import{useMemo as yv}from"react";var Bh=({columns:n,userColumns:e,bodySize:t,columnMinWidth:o,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:h,columnPinning:S,editable:y,columnDefaultEditable:C,columnDefaultFilterable:T,columnDefaultGroupable:I,columnDefaultSortable:b,scrollbarWidth:R,columnTypes:w,pinnedEndMaxWidth:v,pinnedStartMaxWidth:P,viewportReservedWidth:x,resizableColumns:M,columnVisibility:D,columnVisibilityAssumeVisible:E,columnSizing:z,groupBy:V})=>{let{computedRemainingSpace:L,computedColumnOrder:F,computedVisibleColumns:K,computedVisibleColumnsMap:q,computedPinnedStartColumns:_,computedPinnedEndColumns:k,computedUnpinnedColumns:H,computedPinnedStartColumnsWidth:Z,computedPinnedEndColumnsWidth:Ce,computedUnpinnedColumnsWidth:le,computedUnpinnedOffset:fe,computedPinnedEndOffset:we,computedPinnedEndWidth:ve,computedPinnedStartWidth:ue,renderSelectionCheckBox:ne,computedColumnsMap:se,computedColumnsMapInInitialOrder:de,fieldsToColumn:X}=yv(()=>xd({columns:n,userColumns:e,scrollbarWidth:R,bodySize:t,columnMinWidth:o,columnMaxWidth:r,columnDefaultWidth:i,columnDefaultFlex:a,columnCssEllipsis:s,columnHeaderCssEllipsis:u,viewportReservedWidth:x,resizableColumns:M,filterValue:m,filterTypes:g,sortable:l,sortInfo:p,multiSort:f,pinnedEndMaxWidth:v,pinnedStartMaxWidth:P,draggableColumns:c,columnDefaultDraggable:d,columnOrder:h,columnPinning:S,columnDefaultEditable:C,columnDefaultFilterable:T,columnDefaultGroupable:I,columnDefaultSortable:b,editable:y,columnSizing:z,columnTypes:w,columnVisibility:D,columnVisibilityAssumeVisible:E??!0,groupBy:V}),[n,e,t.width,o,r,i,x,R,l,p,f,m,g,h,D,E,d,c,M,v,P,z,w,S,C,T,I,y,V,1]);return{renderSelectionCheckBox:ne,columns:n,computedColumnsMap:se,computedPinnedEndWidth:ve,computedPinnedStartWidth:ue,computedRemainingSpace:L,computedUnpinnedOffset:fe,computedPinnedEndOffset:we,computedPinnedStartColumnsWidth:Z,computedPinnedEndColumnsWidth:Ce,computedUnpinnedColumnsWidth:le,computedPinnedStartColumns:_,computedPinnedEndColumns:k,computedUnpinnedColumns:H,computedVisibleColumns:K,computedVisibleColumnsMap:q,computedColumnOrder:F,computedColumnsMapInInitialOrder:de,fieldsToColumn:X}};import{useMemo as bv}from"react";var Pa=class{constructor(){this.rowHeight=new Map;this.rowDetailHeight=new Map;this.getRowHeight=e=>this.rowHeight.get(e)??0;this.getRowDetailHeight=e=>this.rowDetailHeight.get(e)??0}getTotalRowHeight(e){return this.getRowHeight(e)+this.getRowDetailHeight(e)}getSize(e){let t=this.getRowHeight(e),o=this.getRowDetailHeight(e);return{rowHeight:t,rowDetailHeight:o,totalRowHeight:t+o}}};function Sv(n,e){let t=n.rowDetailHeight,o=n.rowHeight,{isRowDetailsExpanded:r,isRowDetailsEnabled:i,getDataSourceState:a}=n;if(!r)return typeof o=="function"?c=>{if(e&&e.rowHeight.has(c))return e.rowHeight.get(c);let d=a().dataArray[c],p=d?o(d):0;return e&&e.rowHeight.set(c,p),p}:o;let l=typeof o=="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?o(d):o;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 Wh(n){let e=new Pa;return{computedRowHeight:Sv(n,e),computedRowSizeCacheForDetails:n.isRowDetailsExpanded?e:void 0}}function jh(n){return bv(()=>Wh(n),[n.rowHeight,n.rowDetailHeight,n.isRowDetailsExpanded,n.isRowDetailsEnabled,n.getDataSourceState])}import{useState as Tv,useEffect as Cv,useLayoutEffect as Iv}from"react";var Rv={vertical:!1,horizontal:!1};function Uh(n){let e=n().brain,{getDataSourceState:t}=Wt(),[o,r]=Tv(Rv);return Cv(()=>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]),Iv(()=>{let i=t(),{onScrollbarsChange:a}=n(),{notifyScrollbarsChange:l}=i;a&&i.updatedAt&&i.dataArray.length&&a(o),l(o)},[o]),o}function $h(n){let{state:e,actions:t,getState:o}=n,{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:h,columnSizing:S,editable:y,columnDefaultEditable:C,columnDefaultFilterable:T,columnDefaultGroupable:I,columnTypes:b,rowHeight:R,rowDetailHeight:w,isRowDetailExpanded:v,isRowDetailEnabled:P,bodySize:x,showSeparatePivotColumnForSingleAggregation:M,onRowHeightCSSVarChange:D,onFlashingDurationCSSVarChange:E,onRowDetailHeightCSSVarChange:z,onColumnHeaderHeightCSSVarChange:V,computedColumns:N,initialColumns:L,viewportReservedWidth:F,resizableColumns:K,sortable:q,draggableColumns:_}=e,k=t,{multiSort:H,filterValue:Z,filterTypes:Ce,groupBy:le,sortInfo:fe,dataSourceActions:we,getDataSourceState:ve,dataSourceApi:ue}=Fe(ie=>({dataSourceActions:ie.dataSourceActions,getDataSourceState:ie.getDataSourceState,dataSourceApi:ie.dataSourceApi,sortInfo:ie.dataSourceState.sortInfo,multiSort:ie.dataSourceState.multiSort,filterValue:ie.dataSourceState.filterValue,filterTypes:ie.dataSourceState.filterTypes,groupBy:ie.dataSourceState.groupBy}));gu(()=>{D.onChange(ie=>{let Me=Sh(ie,o());Me!=null&&(k.rowHeight=Me)}),E.onChange(ie=>{let Me=ie?ie*1:null;Me!=null&&!isNaN(Me)&&(k.flashingDurationCSSVarValue=Me)}),z.onChange(ie=>{ie&&(k.rowDetailHeight=ie)}),V.onChange(ie=>{let Me=bh(ie,o());Me!=null&&(k.columnHeaderHeight=Me)})}),wv(()=>{we.showSeparatePivotColumnForSingleAggregation=M},[M]);let{toggleGroupRow:ne}=Kh(e,t),se=N,{computedColumnOrder:de,computedVisibleColumns:X,computedVisibleColumnsMap:Q,computedPinnedStartColumns:B,computedPinnedEndColumns:re,computedUnpinnedColumns:te,computedPinnedStartColumnsWidth:ae,computedPinnedEndColumnsWidth:O,computedUnpinnedColumnsWidth:A,computedUnpinnedOffset:ce,computedPinnedEndOffset:he,computedRemainingSpace:Re,computedPinnedStartWidth:Se,computedPinnedEndWidth:xe,renderSelectionCheckBox:Ue,computedColumnsMap:Ke,computedColumnsMapInInitialOrder:tt,fieldsToColumn:nt}=Bh({columns:se,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:K,sortable:q,draggableColumns:_,sortInfo:fe??void 0,multiSort:H,groupBy:le,columnOrder:r,columnVisibility:g,columnVisibilityAssumeVisible:!0,columnPinning:h,editable:y,columnDefaultEditable:C,columnDefaultFilterable:T,columnDefaultGroupable:I,filterValue:Z,filterTypes:Ce,columnSizing:S,columnTypes:b}),Ze=gh(X),$e=hh(X),G=Uh(o),J=Se?ae>Se:!1,me=xe?O>xe:!1,[be]=gu(()=>new da({getRowAt:Me=>ve().dataArray[Me],isNodeSelectable:Me=>{let{isNodeSelectable:Ye}=ve();return Ye?Ye(Me):!0}})),at=Ne(X),[oe]=gu(()=>new ca({getPrimaryKeyByIndex:ue.getPrimaryKeyByIndex,getColumnIdByIndex:ie=>at()[ie]?.id||""})),{computedRowHeight:W,computedRowSizeCacheForDetails:ot}=jh({rowDetailHeight:w,rowHeight:R,isRowDetailsExpanded:v,isRowDetailsEnabled:P,getDataSourceState:ve});return vv(()=>({multiRowSelector:be,multiCellSelector:oe,computedRowSizeCacheForDetails:ot,computedRowHeight:W,scrollbars:G,columnSize:$e,rowspan:Ze,toggleGroupRow:ne,computedColumnsMap:Ke,computedColumnsMapInInitialOrder:tt,renderSelectionCheckBox:Ue,computedPinnedStartOverflow:J,computedPinnedEndOverflow:me,computedPinnedStartWidth:Se,computedPinnedEndWidth:xe,computedVisibleColumns:X,computedColumnOrder:de,computedRemainingSpace:Re,computedVisibleColumnsMap:Q,computedPinnedStartColumns:B,computedPinnedEndColumns:re,computedUnpinnedColumns:te,computedPinnedStartColumnsWidth:ae,computedPinnedEndColumnsWidth:O,computedUnpinnedColumnsWidth:A,computedUnpinnedOffset:ce,computedPinnedEndOffset:he,fieldsToColumn:nt}),[be,oe,ot,W,G,$e,Ze,ne,Ke,tt,Ue,J,me,Se,xe,X,de,Re,Q,B,re,te,ae,O,A,ce,he,nt])}import{useMemo as _v}from"react";function Pv(n=3988292384){var e=new Array,t,o,r;for(t=0;t<256;t++){for(r=t,o=8;o>0;o--)(r&1)==1?r=r>>>1^n:r=r>>>1;e[t]=r}return e}function Dv(){return 4294967295}function xv(n,e,t){return e=e>>>8^n[t^e&255],e}function Mv(n){return n=~n,n=n<0?4294967295+n+1:n,n}function hu(n,e=3988292384){var t=Pv(e),o=0,r;for(o=Dv(),r=0;r<n.length;r++)o=xv(t,o,n.charCodeAt(r));return o=Mv(o),`${o}`}var Ev=n=>{let e=n.reduce((o,r)=>(o.set(r.name,r.value),o),new Map);return{distribution:e.get("Type")==="distribution",count:e.get("DevCount")?Number(e.get("DevCount")):0,start:new Date(e.get("StartDate")),end:new Date(e.get("EndDate")),owner:e.get("Owner"),type:e.get("Type"),timestamp:e.get("TS")?Number(e.get("TS")):0,trial:e.get("Trial")==="true",ref:e.get("Ref")??""}},Yh=`Thank you for using the Infinite Table free version! Make sure the "Powered by Infinite Table" footer link is visible in your app.
27
+ Component DEBUG_ID = "${n.debugId}"`),t(r,o,e)},_r=n=>{let{debugId:e,key:t}=n,o=zh[t];if(o&&(zv({...o,debugId:e}),e&&t)){let r=gt.get(e);r&&r.getState().devToolsDetected&&o&&(r.getState().debugWarnings.set(t,{...o,debugId:e,status:"new"}),Ln(e))}};globalThis.logDevToolsWarning=_r;var Ln=n=>{let e=window.__INFINITE_TABLE_DEVTOOLS_HOOK__;if(!e)return;let t=gt.get(n);t&&e(n,t)};function Hh(n){let{getDataSourceState:e,dataSourceActions:t,dataSourceState:o}=n,{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:h,cursorId:S}=o,[y,C]=Vv({vertical:!1,horizontal:!1}),b=Or(y);no(()=>(a.onChange(M=>{M&&(b.current=M,C(M))}),()=>a.destroy()),[a]),no(()=>{if(!m)return;let M=requestAnimationFrame(()=>{b.current?.vertical||g&&(t.cursorId=g)});return()=>cancelAnimationFrame(M)},[g]),no(()=>{if(!m||g!==void 0)return;let M=requestAnimationFrame(()=>{b.current?.vertical||S!=null&&i.length&&(t.cursorId=i.length)});return()=>cancelAnimationFrame(M)},[i.length,g]),no(()=>{let M=e(),{livePaginationCursor:D,livePagination:E,dataArray:L}=M;!y.vertical&&E&&(D?t.cursorId=D:D===void 0&&L.length&&(t.cursorId=L.length))},[y.vertical]);let T=Gh(()=>zg(),[])(p,h,f),R={sortInfo:u.sortInfo?s:null,groupBy:u.groupBy?c:null,pivotBy:u.pivotBy?d:null,refetchKey:l,filterValue:u.filterValue?T:null,cursorId:m?S:null},v=Or(!0),w=Or(!1);Gv(n,{sortInfo:s,groupBy:c,pivotBy:d,filterValue:p,refetchKey:l,cursorId:m?S:null},w);let P=oi(),x=Or([]);Ho(()=>{let M=e(),D=P(),{isDetail:E,isDetailReady:L}=eu(D,e);if(E&&!L)return;let V=Date.now(),N=x.current;N.length>=10&&N.splice(0,1),N.push(V),V-N[0]<200&&N.length>=10&&_r({debugId:M.debugId,key:"DS001"}),typeof M.data!="function"&&on(M.data,M,t,void 0,D)},{data:r}),Ho(M=>{let D=Object.keys(M),E=!1;if(D.length===1){E=!!M.cursorId;let F=e().data;if(Array.isArray(F)&&M.refetchKey){t.originalDataArray=F;return}}let L=P(),{isDetail:V,isDetailReady:N}=eu(L,e);if(V&&!N)return;let k=e();if(typeof k.data=="function"){if(w.current&&!E&&Vg(k))return;let F;k.debugId&&(F=at(k.debugId).track.DataSource.label.RemoteDataLoad.start()),on(k.data,k,t,{append:E},L).then(()=>{F?.end()})}},{...R,data:r}),no(()=>{w.current=!1}),Ho(()=>{let M=e();if(v.current){v.current=!1;let D=kt(M,void 0,P());t.dataParams=D}},R)}function Gv(n,e,t){let{getDataSourceState:o,dataSourceActions:r,dataSourceState:i}=n;no(()=>{r.lazyLoadCacheOfLoadedBatches=new W},[i.data,i.dataParams]);let{lazyLoadBatchSize:a,lazyLoad:l,originalLazyGroupDataChangeDetect:s,notifyRenderRangeChange:u,dataArray:c,groupRowsState:d,scrollStopDelayUpdatedByTable:p}=i,f=Or(null),m=(h,S,y=o().lazyLoadCacheOfLoadedBatches)=>{let C=o();if(h=h||f.current,!h)return;let{renderStartIndex:b,renderEndIndex:I}=h,{lazyLoadBatchSize:T,lazyLoad:R}=C;R&&((!T||T<=0)&&(!C.groupBy||C.groupBy.length===0)||Hg({startIndex:b,endIndex:I,lazyLoadBatchSize:T,componentState:C,componentActions:r,dismissLoadedRows:S?.dismissLoadedRows??!1},y))},g=Gh(()=>Xt(m,{wait:p}),[p]);Ho(h=>{if(l)return h.sortInfo||h.filterValue||h.groupBy||h.pivotBy||h.refetchKey||h.cursorId?(o().lazyLoadCacheOfLoadedBatches.clear(),o().originalLazyGroupData.clear(),m(u.get(),{dismissLoadedRows:!0}),t.current=!0):(h.originalLazyGroupDataChangeDetect||h.groupRowsState)&&m(u.get()),u.onChange(S=>{f.current=S,Gg(o().lazyLoadCacheOfLoadedBatches),m(S)})},{sortInfo:e.sortInfo,filterValue:e.filterValue,groupBy:e.groupBy,pivotBy:e.pivotBy,refetchKey:e.refetchKey,cursorId:e.cursorId,lazyLoadBatchSize:a,lazyLoad:l,originalLazyGroupDataChangeDetect:s,groupRowsState:d}),no(()=>{a&&a>0&&g()},[c])}function Fr(n){let e=Vn(),t=oi(),o=!!e,r=o?e.id:"master",{contextValue:i,ContextComponent:a}=Wh(n),{componentActions:l,componentState:s,assignState:u}=i;s.getDataSourceMasterContextRef.current=t;let c=Ne(s),[d]=Bh(()=>Dh({getState:c,actions:l})),p={dataSourceState:s,dataSourceActions:l,getDataSourceMasterContext:t,getDataSourceState:c,assignState:u,dataSourceApi:d},f=Ne(i),m=Ne(p),g=$s(),h=Hv(({children:S})=>{let y=ya(),[C]=Bh(()=>Nh());typeof S=="function"&&(S=S(c()));let b=m();return C.setSnapshot(b),Tu(()=>{C.notify()}),bu.createElement(a.Provider,{key:r,value:f()},bu.createElement(g.Provider,{value:b},bu.createElement(y.Provider,{value:C},S)))},[a,o,r]);return Tu(()=>{let S=t();S&&S.registerDetail(p)},[]),Tu(()=>()=>{let S=c();S.onCleanup(S)},[]),Hh({dataSourceState:s,dataSourceActions:l,getDataSourceState:c}),Kh(()=>{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]),Kh(()=>{s.onReady?.(d)},[]),{DataSource:h,state:p.dataSourceState}}function Kv(){return Fe(n=>n.dataSourceApi)}var La=class La{constructor(e,t){this.keysInOrder=[];if(typeof e=="number")this.maxSize=e,this.currentMap=new Map;else if(this.maxSize=t??La.DEFAULT_SIZE,e){let o=Array.from(e);this.maxSize<o.length&&o.slice(o.length-this.maxSize),this.currentMap=new Map,o.forEach(([r,i])=>{this.set(r,i)})}else this.currentMap=new Map}values(){return this.currentMap.values()}get size(){return this.currentMap.size}delete(e){return this.currentMap.has(e)?(this.currentMap.delete(e),this.keysInOrder=this.keysInOrder.filter(t=>t!==e),!0):!1}has(e){return this.currentMap.has(e)}get(e){return this.currentMap.get(e)}set(e,t){if(this.has(e)&&this.delete(e),this.maxSize-this.currentMap.size<=0){let[r]=this.keysInOrder.splice(0,1);r!=null&&this.currentMap.delete(r)}return this.keysInOrder.push(e),this.currentMap.set(e,t),this}};La.DEFAULT_SIZE=10;var Na=La;var Cu=class{add(e,t){}get(e){}delete(e){}has(e){return!1}},ka=class{constructor(e){this.storage=new Na(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)}},Nr=class{constructor(e){this.cacheStorage=e===!1?new Cu:e===!0?new Iu:typeof e=="number"?new ka(e):new ka(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 Bv=(e=>(e.INIT="INIT",e))(Bv||{});var{useManagedComponent:Wh}=Ot({debugName:"DataSource",initSetupState:hh,forwardProps:Sh,concludeReducer:Fh,mapPropsToState:Th,onPropChange:Ch,cleanup:yh,interceptActions:Rh(),mappedCallbacks:Ih()});function $W(n){let{DataSource:e}=Fr(n);return jh.createElement(e,null,n.children??null)}function YW(){let{rowInfoReducerResults:n}=Fe(e=>({rowInfoReducerResults:e.dataSourceState.rowInfoReducerResults}));return n}function Uh(n){let{getDataSourceState:e}=Fe(o=>({getDataSourceState:o.getDataSourceState}));return Wv(()=>n.filter(r=>typeof r.rowspan=="function").length?({rowIndex:r,colIndex:i})=>{let a=e().dataArray,l=a[r];if(!l)return 1;let s=l.data,u=n[i];return!u||!u.rowspan?1:u.rowspan({column:u,data:s,dataArray:a,rowInfo:l,rowIndex:r})}:void 0,[n])}import{useCallback as jv}from"react";var o6=Et("useColumnSizeFn");function $h(n){return jv(t=>{let o=n[t];return o?o.computedWidth:0},[n])}import{useEffect as Ko,useLayoutEffect as Zv,useMemo as Qv}from"react";var Uv={scrollLeft:0,scrollTop:0},Lr=class{constructor(){this.scrollPosition=Uv;this.onScrollFns=[];this.getScrollPosition=()=>this.scrollPosition;this.onScroll=e=>(this.onScrollFns.push(e),()=>{this.onScrollFns=this.onScrollFns.filter(t=>t!==e)});this.setScrollPosition=e=>{this.scrollPosition=e,this.notifyScrollChange()};this.destroy=()=>{this.onScrollFns=[]}}notifyScrollChange(){let{scrollPosition:e}=this,t=this.onScrollFns;for(let o=0,r=t.length;o<r;o++)t[o](e)}};var kr=n=>`--infinite-${n}`;var Ru=40,zr=kr(tp),Yh=`var(${kr("density-scale")}, 1)`,Vr=`calc(var(${kr("row-height")}, ${Ru}px) * ${Yh})`,wu=`calc(var(${zr}) * ${Yh})`;function qh(n,e){if(!n)return null;if(e.rowHeightCSSVar!==Vr)return n;if(!Yv())return null;let t=Math.round(n);return t===e.rowHeight?null:t}var $v=kr("loaded");function Yv(){return typeof document>"u"||typeof getComputedStyle!="function"?!1:getComputedStyle(document.documentElement).getPropertyValue($v).trim()===bi}function Xh(n,e){return n?e.columnHeaderHeightCSSVar===wu?Math.round(n):n:null}function Zh(n,e){let t=new Map;function o(r){return e[r]!==!1}return Object.keys(n).forEach(r=>{let a=n[r].columnGroup,l=0;for(o(r)||(l=-1);a;){let s=n[a];if(!s)break;o(a)&&l++,a=s.columnGroup}t.set(r,l)}),t}import*as Qh from"react";function Jh(n){return(e,t)=>Qh.createElement(n,{key:e.id,rowInfo:e,cache:t})}var Gr=class extends Qn{constructor(t,o){super(`${t}:HorizontalLayout`);this.visiblePageCount=0;this.isHorizontalLayoutBrain=!0;this._totalPageCount=0;this.pageWidth=0;this.initialCols=0;this.initialRows=0;this.initialColWidth=0;this.colWidth=()=>10;this.getColWidth=t=>typeof this.initialColWidth=="number"?this.initialColWidth:this.initialColWidth(t%this.initialCols);this.onTotalPageCountChangeFns=new Set;this.onTotalPageCountChange=t=>(this.onTotalPageCountChangeFns.add(t),()=>{this.onTotalPageCountChangeFns.delete(t)});this.onScrollOriginChange=t=>this.options?.masterBrain?this.options.masterBrain.onScrollOriginChange(t):super.onScrollOriginChangeForBrain(t);this.options=o,this.options.masterBrain&&this.options.masterBrain.onTotalPageCountChange(()=>{this.updateRenderCount({horizontal:!0,vertical:!0})})}computeDirectionalRenderCount(t,o,r,i){if(t==="vertical"||typeof o=="number")return super.computeDirectionalRenderCount(t,o,r,i);let a=0,l=i.width,s=Math.floor(l/this.pageWidth);a+=s*this.initialCols;let 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 o=t.rowIndex,r=t.colIndex;return t.rowIndex>=this.rowsPerPage&&this.rowsPerPage>0&&(o=t.rowIndex%this.rowsPerPage,r=Math.floor(t.rowIndex/this.rowsPerPage)*this.initialCols+r),{rowIndex:o,colIndex:r}}getHorizontalLayoutPositionFromMatrixCoordinates(t){let o=t.rowIndex,r=t.colIndex;if(t.colIndex>=this.initialCols&&this.initialCols>0){let i=Math.floor(t.colIndex/this.initialCols);r=t.colIndex-i*this.initialCols,o=this.rowsPerPage*i+t.rowIndex}return{colIndex:Math.min(r,this.initialCols),rowIndex:this.options.isHeader?o:Math.min(o,this.initialRows)}}update(t){let{rows:o,cols:r,rowHeight:i,colWidth:a,width:l,height:s}=t,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 o=="number",m=typeof r=="number",g=f&&o!==this.initialRows,h=m&&r!==this.initialCols;f&&g&&(this.initialRows=o,this.rows=o),m&&h&&(this.initialCols=r,this.cols=r);let S=i!=null,y=a!=null,C=S&&i!==this.rowHeight,b=y&&a!==this.initialColWidth;S&&(this.rowHeight=i),y&&(this.initialColWidth=a,this.colWidth=this.getColWidth);let I=g||C||p,T=h||b||d||I;(T||I)&&this.updateRenderCount({horizontal:T,vertical:I})}getInitialRowHeight(){return typeof this.rowHeight!="number"?this.getRowHeight(0):this.rowHeight}get totalPageCount(){return this.options.masterBrain?this.options.masterBrain.totalPageCount:this._totalPageCount}set totalPageCount(t){this.options.masterBrain||(this._totalPageCount=t)}getPageWidth(){return this.pageWidth}doUpdateRenderCount(t=tn){let o=this.getInitialRowHeight(),r=0;for(let a=0;a<this.initialCols;a++)r+=this.getColWidth(a);this.pageWidth=r,this.rowsPerPage=Math.floor(this.availableHeight/o);let i=!1;if(!this.options.masterBrain){let a=this.totalPageCount;this.totalPageCount=this.rowsPerPage?Math.ceil(this.initialRows/this.rowsPerPage):0,a!=this.totalPageCount&&(i=!0)}this.visiblePageCount=this.totalPageCount&&this.pageWidth?Math.max(Math.ceil(this.availableWidth/this.pageWidth),1):1,this.availableRenderHeight=this.visiblePageCount*this.rowsPerPage*o,this.cols=Math.max(this.totalPageCount*this.initialCols,this.initialCols),this.rows=this.rowsPerPage,super.doUpdateRenderCount(t),i&&this.notifyTotalPageCountChange()}notifyTotalPageCountChange(){if(this.destroyed)return;let t=this.onTotalPageCountChangeFns;t.forEach(o=>{Ge(()=>{this.destroyed||t.has(o)&&o(this.totalPageCount)})})}getVirtualColIndex(t,o){return this.initialCols*(o?.pageIndex??0)+t}destroy(){this.destroyed||(super.destroy(),this.options.masterBrain=void 0,this.onTotalPageCountChangeFns.clear())}supportsLargeContent(t){return t==="horizontal"}alignScrollOrigin(t,o){return t==="vertical"||!this.pageWidth?Math.floor(o):Math.floor(o/this.pageWidth)*this.pageWidth}getScrollOriginPageIndex(){let t=this.getPageWidth();return t?Math.round(this.getScrollOrigin().scrollLeft/t):0}getScrollOrigin(){return this.options?.masterBrain?this.options.masterBrain.getScrollOrigin():super.getScrollOrigin()}updateScrollOrigin(){this.options?.masterBrain||super.updateScrollOrigin()}getVirtualizedContentSizeFor(t){return t==="vertical"?this.getInitialRowHeight()*this.rowsPerPage:this.pageWidth*this.totalPageCount}};function oo(){return{current:null}}var vu={};function Pu(n){return`.${jt}[data-row-index${n?`="${n.rowIndex}"`:""}][data-col-index${n?`="${n.colIndex}"`:""}]`}function Du(n,e){let t=An(n),o=e?new Gr(t,{isHeader:!1}):new Qn(t),r=`${t}:header`,i=e?new Gr(r,{isHeader:!0,masterBrain:o}):new Qn(r);o.onScroll(c=>{i.setScrollPosition({scrollLeft:c.scrollLeft,scrollTop:0})});let{renderer:a,onRenderUpdater:l}=vr(o),{renderer:s,onRenderUpdater:u}=vr(i);return o.onAvailableSizeChange(c=>{i.update({width:c.width})}),{brain:o,headerBrain:i,renderer:a,onRenderUpdater:l,headerRenderer:s,headerOnRenderUpdater:u}}function ey({debugId:n,wrapRowsHorizontally:e}){let t={},{brain:o,headerBrain:r,renderer:i,onRenderUpdater:a,headerRenderer:l,headerOnRenderUpdater:s}=Du(n,!!e),u=oo(),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,focusedHeaderItem:null,columnMenuVisibleKey:0,filterOperatorMenuVisibleForColumnId:null,getDOMNodeForCell:d=>{if(!u.current)return null;let p=Pu(d);return u.current.querySelector(p)||null},brain:o,headerBrain:r,domRef:u,columnMenuTargetRef:oo(),editingValueRef:oo(),scrollerDOMRef:oo(),portalDOMRef:oo(),focusDetectDOMRef:oo(),activeCellIndicatorDOMRef:oo(),onColumnMenuClick:he(),cellContextMenu:he(),contextMenu:he(),onFilterOperatorMenuClick:he(),pendingColumnFilters:new Zi,flashingDurationCSSVarValue:null,onFlashingDurationCSSVarChange:he(),onRowHeightCSSVarChange:he(),onRowDetailHeightCSSVarChange:he(),onColumnHeaderHeightCSSVarChange:he(),cellClick:he(),cellMouseDown:he(),keyDown:he(),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 Lr,pinnedEndScrollListener:new Lr,columnsWhenInlineGroupRenderStrategy:void 0,editingCell:null,forceBodyRerenderTimestamp:0}}var ty=n=>({debugId:1,scrollTopKey:1,components:1,id:1,loadingText:1,pivotColumns:1,groupColumn:1,onReady:1,domProps:1,onKeyDown:1,onCellClick:1,onCellDoubleClick:1,focusedClassName:1,focusedWithinClassName:1,focusedStyle:1,focusedWithinStyle:1,onSelfFocus:1,onFocusWithin:1,onSelfBlur:1,onBlurWithin:1,onContextMenu:1,onCellContextMenu:1,onRenderRangeChange:1,onRowMouseEnter:1,onRowMouseLeave:1,onScrollToTop:1,onScrollToBottom:1,onScrollStop:1,scrollToBottomOffset:1,getColumnMenuItems:1,getCellContextMenuItems:1,getContextMenuItems:1,menuPortalContainer:1,menuConstrainTo:1,columnPinning:1,editable:1,columnDefaultEditable:1,columnDefaultFilterable:1,columnDefaultGroupable:1,columnDefaultSortable:1,keyboardShortcuts:1,rowStyle:1,cellStyle:1,repaintCellsKey:1,rowProps:1,rowClassName:1,rowHoverClassName:1,cellClassName:1,repeatWrappedGroupRows:1,pinnedStartMaxWidth:1,pinnedEndMaxWidth:1,pivotColumn:1,pivotColumnGroups:1,getFilterOperatorMenuItems:1,onScrollbarsChange:1,autoSizeColumnsKey:1,wrapRowsHorizontally:1,columnDefaultFlex:1,draggableColumnsRestrictTo:e=>e??!1,columnMenuRealignDelay:e=>e??50,scrollStopDelay:e=>e??250,viewportReservedWidth:e=>e??0,resizableColumns:e=>e??!0,rowDetailCache:e=>new Nr(e),hideColumnWhenGrouped:e=>e??!1,columnMinWidth:e=>e??30,columnMaxWidth:e=>e??5e3,columnDefaultWidth:e=>e??200,columnCssEllipsis:e=>e??!0,draggableColumns:1,columnDefaultDraggable:1,headerOptions:e=>({alwaysReserveSpaceForSortIcon:!0,...e}),showSeparatePivotColumnForSingleAggregation:e=>e??!1,sortable:1,hideEmptyGroupColumns:e=>e??!1,pivotTotalColumnPosition:e=>e??"end",pivotGrandTotalColumnPosition:1,licenseKey:e=>e,keyboardSelection:e=>e??!0,multiRowSelectionWith:e=>e??"checkbox",activeRowIndex:1,activeCellIndex:1,columnOrder:e=>e??!0,header:e=>e??!0,showZebraRows:e=>e??!0,showHoverRows:e=>e??!0,virtualizeColumns:e=>e??!0,rowHeight:e=>typeof e=="number"||typeof e=="function"?e:e===Vr?Ru:0,rowDetailHeight:e=>typeof e=="number"||typeof e=="function"?e:300,columnHeaderHeight:e=>typeof e=="number"?e:30,columns:1,columnVisibility:e=>e??vu,columnGroupVisibility:e=>e??vu,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 qv(n){let{groupBy:e,groupColumn:t,groupRenderStrategy:o}=n;return o||(t!=null&&typeof t=="object"?"single-column":(e.filter(i=>i.column).length,"multi-column"))}var ny=n=>{n.brain.destroy(),n.headerBrain.destroy(),n.renderer.destroy(),n.headerRenderer.destroy(),n.onRenderUpdater.destroy(),n.headerOnRenderUpdater.destroy(),n.onFlashingDurationCSSVarChange.destroy(),n.onRowHeightCSSVarChange.destroy(),n.onColumnHeaderHeightCSSVarChange.destroy(),n.onColumnMenuClick.destroy(),n.onFilterOperatorMenuClick.destroy(),n.domRef.current=null,n.columnMenuTargetRef.current=null,n.scrollerDOMRef.current=null,n.portalDOMRef.current=null,n.onRowDetailHeightCSSVarChange.destroy(),n.pinnedEndScrollListener.destroy(),n.pinnedStartScrollListener.destroy()};function oy(n){return n.reduce((e,t,o)=>{let r={groupBy:t,groupIndex:o};return t.field?e.set(t.field,r):t.groupField&&e.set(t.groupField,r),e},new Map)}var za=new WeakMap;function ry(){return{rowDetailState:(n,e)=>({callbackParams:[n,{expandRow:e.lastRowToExpandRef.current,collapseRow:e.lastRowToCollapseRef.current}]})}}var iy=n=>{let{props:e,state:t,oldState:o,parentState:r}=n,i=t.pivotColumnGroups||t.columnGroups,a=t.columnGroups&&t.columnGroups!=o?.columnGroups||t.columnGroups&&t.columnGroupVisibility!=o?.columnGroupVisibility||t.pivotColumnGroups!=o?.pivotColumnGroups?Zh(i??vu,t.columnGroupVisibility):t.columnGroupsDepthsMap,l=r?.groupBy,s=qv({groupRenderStrategy:e.groupRenderStrategy,groupBy:l,groupColumn:e.groupColumn}),u,c=e.rowDetailRenderer,d=e.components?.RowDetail;if(!c&&d){let h=za.get(d);h||(h=Jh(d),za.set(d,h)),c=h}c&&(u=e.rowDetailState||t.rowDetailState||e.defaultRowDetailState,u&&!(u instanceof _t)&&(u=new _t(u)),u=u||new _t({expandedRows:[],collapsedRows:!0}));let p=t.columnsWhenGrouping||t.columnsWhenInlineGroupRenderStrategy||t.columns,f=u?e.isRowDetailExpanded:void 0;!f&&u&&(f=za.get(u),f||(f=h=>u.isRowDetailsExpanded(h.id),typeof u=="object"&&za.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||e.columnHeaderHeight===zr?wu:e.columnHeaderHeight:""};if(t.devToolsDetected&&t.debugId){let h=rn.get(t.debugId);h&&(g={...g,...h})}return g};function ay(n,e){let t={};return Object.keys(n).forEach(o=>{let r=n[o],i=r;if(!i.groupByForColumn||Array.isArray(i.groupByForColumn))return;let{groupByForColumn:a}=i,l=a.field||a.groupField;l&&e.get(l)&&(t[o]=r)}),t}function ly(n){let{hideEmptyGroupColumns:e,groupByMap:t,computedGroupColumns:o,groupRowsIndexesInDataArray:r,dataArray:i,groupBy:a}=n,l={...n.columnVisibility};if(!e)return Object.keys(o).forEach(d=>{l[d]===!1&&delete l[d]}),l;if(!r||!r.length)return l;let s=a.length,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(o).forEach(d=>{let p=o[d],{groupByForColumn:f}=p;if(Array.isArray(f))return;let m=f.field||f.groupField;if(!m)return;t.get(m).groupIndex>u&&e?l[d]!==!1&&(l[d]=!1):l.hasOwnProperty(d)&&delete l[d]}),l}import*as sn from"react";var sy=n=>n.dataSourceHasGrouping&&n.isGroupRow&&n.childrenLoading||!n.selfLoaded;import*as Va from"react";var uy="_16lm1iwb _16lm1iw1d _16lm1iwk";var cy="164.93361431346415 56.97787143782138",dy={margin:"auto",display:"block",shapeRendering:"auto"},G6=Object.keys({size:1,style:1,className:1,viewBox:1});var py=n=>Va.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",style:{...dy,...n.style},width:"24px",height:"24px",viewBox:n.viewBox??"0 0 100 100",preserveAspectRatio:"xMidYMid",className:U(n.className,uy,go.loading,ed,"InfiniteIcon","InfiniteIcon-loading")},Va.createElement("circle",{cx:"50",cy:"50",fill:"none",strokeWidth:"10",r:"35",strokeDasharray:cy},Va.createElement("animateTransform",{attributeName:"transform",type:"rotate",repeatCount:"indefinite",dur:"1s",values:"0 50 50;360 50 50",keyTimes:"0;1"})));function fy(n,e,t,o){let{groupByForColumn:r,groupIndexForColumn:i,groupRenderStrategy:a}=n,l=r.column?{...r.column}:{},s=typeof t=="function"?t(n,e):t;return{header:`Group by ${r.field||r.groupField}`,groupByForColumn:r,render:o.getGroupColumnRender({groupIndexForColumn:i,groupRenderStrategy:a}),...l,...s,renderGroupIcon:o.getGroupColumnRenderGroupIcon({initialRenderGroupIcon:s?.renderGroupIcon??l.renderGroupIcon,groupIndexForColumn:i,toggleGroupRow:e,groupRenderStrategy:a})}}function my(n,e,t,o){let r=typeof t=="function"?t(n,e):t,i={};return n.sortable!=null&&(i.sortable=n.sortable),{...i,header:"Group",groupByForColumn:n.groupBy,renderSelectionCheckBox:n.selectionMode==="multi-row",render:o.getGroupColumnRender({groupIndexForColumn:0,groupRenderStrategy:"single-column"}),...r,renderGroupIcon:o.getGroupColumnRenderGroupIcon({initialRenderGroupIcon:r?.renderGroupIcon,groupIndexForColumn:0,toggleGroupRow:e,groupRenderStrategy:"single-column"})}}function xu({groupIndexForColumn:n,groupRenderStrategy:e}){return t=>{let{rowInfo:o,renderBag:r,column:i,align:a}=t,{value:l,groupIcon:s,selectionCheckBox:u}=r,c=o,d=e==="multi-column"&&c.isGroupRow&&n+1!==c.groupNesting,p=U(mo.flex,i.align==="end"?nr.rowReverse:nr.row,Hc.center,`${jt}Expander`,e==="single-column"||e==="multi-column"&&(!o.isGroupRow||u||d&&i.field)?_f({align:a}):null);return d?i.field?sn.createElement("div",{className:p},u,sn.createElement("div",{className:Nt},l??null)):u?sn.createElement("div",{className:p},u):null:(e==="single-column"&&c.isGroupRow,sn.createElement("div",{className:p},s,u,sn.createElement("div",{className:Nt},l??null)))}}function Mu({groupIndexForColumn:n,groupRenderStrategy:e,toggleGroupRow:t,initialRenderGroupIcon:o}){return r=>{let{rowInfo:i,value:a,rootGroupBy:l,pivotBy:s,column:u}=r,c=e!=="inline"?i:i.isGroupRow&&i.parents?.[n]||i;if(!c)return null;let d=c.collapsed;if(e==="inline"){if(c.groupCount===1)return a;if(c.groupNesting===n&&d)return null}else if(!c.isGroupRow||e==="multi-column"&&n+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 sy(c)?f=sn.createElement(py,null):m&&(f=sn.createElement(qn,{expanded:!d,direction:u.align==="end"?"end":"start",onChange:()=>{t(p)}})),o&&(r.renderBag.groupIcon=f,f=sn.createElement(Ct,{render:o,renderParam:r})),f}}function gy(){return{getGroupColumnRender:xu,getGroupColumnRenderGroupIcon:Mu}}function hy(n,e,t){return fy(n,e,t,gy())}function yy(n,e,t){return my(n,e,t,gy())}function Sy(n){let{pivotColumns:e,groupBy:t,pivotBy:o,selectionMode:r,groupColumn:i,pivotTotalColumnPosition:a,pivotGrandTotalColumnPosition:l,pivotColumn:s,groupRenderStrategy:u,toggleGroupRow:c,columns:d}=n;if(u==="inline")return{columns:void 0,groupColumnIds:[]};let p={},f=[];if(u==="multi-column")t.forEach((m,g,h)=>{let S=hy({groupByForColumn:m,groupBy:t,pivotBy:o,groupIndexForColumn:g,groupCount:h.length,groupRenderStrategy:u,selectionMode:r},c,i),y=S.id||`group-by-${m.field||m.groupField}`;f.push(y),p[y]=S});else if(u==="single-column"&&t.length){let m=yy({groupCount:t.length,groupBy:t,pivotBy:o,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],h=g.pivotTotalColumn&&g.columnGroup,S=g.pivotTotalColumn&&!g.columnGroup;if(h&&a===!1||S&&l===!1)return;let y={...g};s&&(typeof s=="function"?y={...y,...s({column:y,pivotBy:o,groupBy:t})}:y={...y,...s}),y.inheritFromColumn!==!1&&(y={...typeof y.inheritFromColumn=="string"?d[y.inheritFromColumn]:y.pivotAggregator?.field?Hn(d,y.pivotAggregator.field):void 0,...y}),!y.render&&y.renderValue&&(y.render=C=>y.renderValue(C)),p[m]=y}):Object.keys(d).forEach(m=>{let g=d[m];p[m]=g}),{columns:Object.keys(p).length?p:void 0,groupColumnIds:f}}import{useCallback as Xv}from"react";function Eu(){let{getDataSourceState:n,dataSourceActions:e,getDataSourceMasterContext:t}=Fe(r=>({getDataSourceState:r.getDataSourceState,dataSourceActions:r.dataSourceActions,getDataSourceMasterContext:r.getDataSourceMasterContext}));return Xv(r=>{let i=n(),a=new Pt(i.groupRowsState);if(a.toggleGroupRow(r),e.groupRowsState=a,i.lazyLoad){let l=[Tt,...r],s=i.originalLazyGroupData.get(l);a.isGroupRowExpanded(r)?s?.cache||on(i.data,i,e,{groupKeys:r},t()):s?.cache||(i.lazyLoadCacheOfLoadedBatches.getKeysStartingWith(r).forEach(c=>{i.lazyLoadCacheOfLoadedBatches.delete(c)}),e.lazyLoadCacheOfLoadedBatches=W.clone(i.lazyLoadCacheOfLoadedBatches),i.originalLazyGroupData.delete(l),e.originalLazyGroupDataChangeDetect=At())}},[])}function Jv(n){return Qv(()=>oy(n),[n])}function by(n,e){let{groupBy:t,dataSourceActions:o}=Fe(u=>({groupBy:u.dataSourceState.groupBy,dataSourceActions:u.dataSourceActions})),{groupRenderStrategy:r,pivotTotalColumnPosition:i,pivotGrandTotalColumnPosition:a}=n;Ko(()=>{o.generateGroupRows=r!=="inline"},[r]),Ko(()=>{o.pivotTotalColumnPosition=i},[i]),Ko(()=>{a!=null&&(o.pivotGrandTotalColumnPosition=a)},[a]);let l=Jv(t);eP(l,n,e);let{toggleGroupRow:s}=tP();return nP(l,n,e),{toggleGroupRow:s}}function eP(n,e,t){let o=Eu(),{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],h={},S=c.get(g.field);if(S&&d==="inline"){let{groupIndex:C}=S;h={groupByForColumn:S.groupBy,field:S.groupBy?.field,valueGetter:S.groupBy?.valueGetter,valueFormatter:({rowInfo:b})=>b.isGroupRow?b.groupKeys?.[C]:b.value,rowspan:({rowInfo:b,dataArray:I})=>{if(b.isTreeNode||!b.isGroupRow)return 1;let T=I[b.indexInAll-1]||{indexInParentGroups:[]};if(!T||!T.dataSourceHasGrouping)return 1;let R=T.indexInParentGroups||[],v=b.indexInParentGroups||[],w=!1;for(let M=0;M<=C;M++){let D=R[M];if(v[M]!==D){w=!0;break}}if(!w)return 1;let P=b.parents[C];return P?P.groupCount-(P.collapsedChildrenCount||0)+(P.collapsedGroupsCount||0):1},renderGroupIcon:Mu({groupIndexForColumn:C,groupRenderStrategy:d,toggleGroupRow:p,initialRenderGroupIcon:g.renderGroupIcon}),render:xu({groupIndexForColumn:C,groupRenderStrategy:d})}}let y={...h,...g};f[m]=y}),Object.keys(f).length===0?void 0:f}Ko(()=>{(()=>{l.columnsWhenInlineGroupRenderStrategy=a?void 0:s(r,n,i,o)})()},[r,n,i,o])}function tP(){let{groupBy:n,pivotBy:e,selectionMode:t}=Fe(m=>({groupBy:m.dataSourceState.groupBy,pivotBy:m.dataSourceState.pivotBy,selectionMode:m.dataSourceState.selectionMode})),{componentActions:o,componentState:{columns:r,groupColumn:i,hideColumnWhenGrouped:a,groupRenderStrategy:l,pivotColumns:s,pivotColumn:u,pivotTotalColumnPosition:c,pivotGrandTotalColumnPosition:d},getComponentState:p}=Ft(),f=Eu();return Ko(()=>{(()=>{let{columns:g,groupColumnIds:h}=Sy({columns:r,groupColumn:i,pivotColumn:u,pivotTotalColumnPosition:c,pivotGrandTotalColumnPosition:d,groupRenderStrategy:l==="inline"?"single-column":l,groupBy:n,pivotBy:e,pivotColumns:s,toggleGroupRow:f,selectionMode:t});o.columnsWhenGrouping=g;let S=p().columnOrder;if(h.length&&Array.isArray(S)){let y=new Set(S),C=!1;h.forEach(b=>{y.has(b)||(C=!0,S=[b,...S])}),C&&(o.columnOrder=S)}})()},[r,n,e,t,a,i,l,s,c,u]),{toggleGroupRow:f}}function nP(n,e,t){let{dataArray:o,groupRowsIndexesInDataArray:r,groupBy:i,groupRowsState:a,originalLazyGroupDataChangeDetect:l,getDataSourceState:s}=Fe(h=>({getDataSourceState:h.getDataSourceState,dataArray:h.dataSourceState.dataArray,groupRowsIndexesInDataArray:h.dataSourceState.groupRowsIndexesInDataArray,groupBy:h.dataSourceState.groupBy,groupRowsState:h.dataSourceState.groupRowsState,originalLazyGroupDataChangeDetect:h.dataSourceState.originalLazyGroupDataChangeDetect})),{columnTypes:u,computedColumns:c,hideColumnWhenGrouped:d,hideEmptyGroupColumns:p,groupRenderStrategy:f}=e,m=t,g=Ne(e);Zv(()=>{if(f!=="multi-column")return;let h=g(),S=ay(c,n),y=ly({computedGroupColumns:S,columnVisibility:h.columnVisibility,hideEmptyGroupColumns:p,groupRowsIndexesInDataArray:r,dataArray:o,groupBy:i,groupByMap:n});St(h.columnVisibility,y)||(m.columnVisibility=y)},[s,f,l,i,n,c,p?o:null,p?a:null,p?r:null,p]),Ko(()=>{let h=i.length>0,S=g(),{columnVisibility:y,columnVisibilityForGrouping:C,hideColumnWhenGrouped:b}=S,I={...y},T={...C},R=!1,v=new Set,w=new Set;Object.keys(c).forEach(P=>{let x=c[P];if(x.defaultHiddenWhenGroupedBy||b!=null)if(x.defaultHiddenWhenGroupedBy==="*"&&h||(x.defaultHiddenWhenGroupedBy===!0||b)&&x.field&&n.get(x.field)||typeof x.defaultHiddenWhenGroupedBy=="string"&&n.get(x.defaultHiddenWhenGroupedBy)||typeof x.defaultHiddenWhenGroupedBy=="object"&&Object.keys(x.defaultHiddenWhenGroupedBy).reduce((D,E)=>D||n.has(E),!1)){if(T[P]!==!1){if(y[P]===!1)return;T[P]=!1,R=!0,v.add(P)}}else T[P]===!1&&(delete T[P],R=!0,w.add(P))}),R&&(m.columnVisibilityForGrouping=T,w.forEach(P=>{delete I[P]}),v.forEach(P=>{I[P]=!1}),m.columnVisibility=I)},[c,u,i,n,d])}import{useMemo as oP}from"react";var Ty=({columns:n,userColumns:e,bodySize:t,columnMinWidth:o,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:h,columnPinning:S,editable:y,columnDefaultEditable:C,columnDefaultFilterable:b,columnDefaultGroupable:I,columnDefaultSortable:T,scrollbarWidth:R,columnTypes:v,pinnedEndMaxWidth:w,pinnedStartMaxWidth:P,viewportReservedWidth:x,resizableColumns:M,columnVisibility:D,columnVisibilityAssumeVisible:E,columnSizing:L,groupBy:V})=>{let{computedRemainingSpace:k,computedColumnOrder:F,computedVisibleColumns:B,computedVisibleColumnsMap:$,computedPinnedStartColumns:_,computedPinnedEndColumns:H,computedUnpinnedColumns:z,computedPinnedStartColumnsWidth:Z,computedPinnedEndColumnsWidth:be,computedUnpinnedColumnsWidth:se,computedUnpinnedOffset:pe,computedPinnedEndOffset:Pe,computedPinnedEndWidth:De,computedPinnedStartWidth:ce,renderSelectionCheckBox:te,computedColumnsMap:le,computedColumnsMapInInitialOrder:ge,fieldsToColumn:j}=oP(()=>Bd({columns:n,userColumns:e,scrollbarWidth:R,bodySize:t,columnMinWidth:o,columnMaxWidth:r,columnDefaultWidth:i,columnDefaultFlex:a,columnCssEllipsis:s,columnHeaderCssEllipsis:u,viewportReservedWidth:x,resizableColumns:M,filterValue:m,filterTypes:g,sortable:l,sortInfo:p,multiSort:f,pinnedEndMaxWidth:w,pinnedStartMaxWidth:P,draggableColumns:c,columnDefaultDraggable:d,columnOrder:h,columnPinning:S,columnDefaultEditable:C,columnDefaultFilterable:b,columnDefaultGroupable:I,columnDefaultSortable:T,editable:y,columnSizing:L,columnTypes:v,columnVisibility:D,columnVisibilityAssumeVisible:E??!0,groupBy:V}),[n,e,t.width,o,r,i,x,R,l,p,f,m,g,h,D,E,d,c,M,w,P,L,v,S,C,b,I,y,V,1]);return{renderSelectionCheckBox:te,columns:n,computedColumnsMap:le,computedPinnedEndWidth:De,computedPinnedStartWidth:ce,computedRemainingSpace:k,computedUnpinnedOffset:pe,computedPinnedEndOffset:Pe,computedPinnedStartColumnsWidth:Z,computedPinnedEndColumnsWidth:be,computedUnpinnedColumnsWidth:se,computedPinnedStartColumns:_,computedPinnedEndColumns:H,computedUnpinnedColumns:z,computedVisibleColumns:B,computedVisibleColumnsMap:$,computedColumnOrder:F,computedColumnsMapInInitialOrder:ge,fieldsToColumn:j}};import{useMemo as iP}from"react";var Ga=class{constructor(){this.rowHeight=new Map;this.rowDetailHeight=new Map;this.getRowHeight=e=>this.rowHeight.get(e)??0;this.getRowDetailHeight=e=>this.rowDetailHeight.get(e)??0}getTotalRowHeight(e){return this.getRowHeight(e)+this.getRowDetailHeight(e)}getSize(e){let t=this.getRowHeight(e),o=this.getRowDetailHeight(e);return{rowHeight:t,rowDetailHeight:o,totalRowHeight:t+o}}};function rP(n,e){let t=n.rowDetailHeight,o=n.rowHeight,{isRowDetailsExpanded:r,isRowDetailsEnabled:i,getDataSourceState:a}=n;if(!r)return typeof o=="function"?c=>{if(e&&e.rowHeight.has(c))return e.rowHeight.get(c);let d=a().dataArray[c],p=d?o(d):0;return e&&e.rowHeight.set(c,p),p}:o;let l=typeof o=="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?o(d):o;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 Cy(n){let e=new Ga;return{computedRowHeight:rP(n,e),computedRowSizeCacheForDetails:n.isRowDetailsExpanded?e:void 0}}function Iy(n){return iP(()=>Cy(n),[n.rowHeight,n.rowDetailHeight,n.isRowDetailsExpanded,n.isRowDetailsEnabled,n.getDataSourceState])}import{useState as aP,useEffect as lP,useLayoutEffect as sP}from"react";var uP={vertical:!1,horizontal:!1};function Ry(n){let e=n().brain,{getDataSourceState:t}=Ut(),[o,r]=aP(uP);return lP(()=>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]),sP(()=>{let i=t(),{onScrollbarsChange:a}=n(),{notifyScrollbarsChange:l}=i;a&&i.updatedAt&&i.dataArray.length&&a(o),l(o)},[o]),o}function wy(n){let{state:e,actions:t,getState:o}=n,{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:h,columnSizing:S,editable:y,columnDefaultEditable:C,columnDefaultFilterable:b,columnDefaultGroupable:I,columnTypes:T,rowHeight:R,rowDetailHeight:v,isRowDetailExpanded:w,isRowDetailEnabled:P,bodySize:x,showSeparatePivotColumnForSingleAggregation:M,onRowHeightCSSVarChange:D,onFlashingDurationCSSVarChange:E,onRowDetailHeightCSSVarChange:L,onColumnHeaderHeightCSSVarChange:V,computedColumns:N,initialColumns:k,viewportReservedWidth:F,resizableColumns:B,sortable:$,draggableColumns:_}=e,H=t,{multiSort:z,filterValue:Z,filterTypes:be,groupBy:se,sortInfo:pe,dataSourceActions:Pe,getDataSourceState:De,dataSourceApi:ce}=Fe(re=>({dataSourceActions:re.dataSourceActions,getDataSourceState:re.getDataSourceState,dataSourceApi:re.dataSourceApi,sortInfo:re.dataSourceState.sortInfo,multiSort:re.dataSourceState.multiSort,filterValue:re.dataSourceState.filterValue,filterTypes:re.dataSourceState.filterTypes,groupBy:re.dataSourceState.groupBy}));Au(()=>{D.onChange(re=>{let Ee=qh(re,o());Ee!=null&&(H.rowHeight=Ee)}),E.onChange(re=>{let Ee=re?re*1:null;Ee!=null&&!isNaN(Ee)&&(H.flashingDurationCSSVarValue=Ee)}),L.onChange(re=>{re&&(H.rowDetailHeight=re)}),V.onChange(re=>{let Ee=Xh(re,o());Ee!=null&&(H.columnHeaderHeight=Ee)})}),cP(()=>{Pe.showSeparatePivotColumnForSingleAggregation=M},[M]);let{toggleGroupRow:te}=by(e,t),le=N,{computedColumnOrder:ge,computedVisibleColumns:j,computedVisibleColumnsMap:ee,computedPinnedStartColumns:K,computedPinnedEndColumns:ie,computedUnpinnedColumns:ne,computedPinnedStartColumnsWidth:oe,computedPinnedEndColumnsWidth:O,computedUnpinnedColumnsWidth:A,computedUnpinnedOffset:ue,computedPinnedEndOffset:Ie,computedRemainingSpace:ye,computedPinnedStartWidth:Se,computedPinnedEndWidth:xe,renderSelectionCheckBox:Ze,computedColumnsMap:Qe,computedColumnsMapInInitialOrder:Ke,fieldsToColumn:ot}=Ty({columns:le,userColumns:k,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:B,sortable:$,draggableColumns:_,sortInfo:pe??void 0,multiSort:z,groupBy:se,columnOrder:r,columnVisibility:g,columnVisibilityAssumeVisible:!0,columnPinning:h,editable:y,columnDefaultEditable:C,columnDefaultFilterable:b,columnDefaultGroupable:I,filterValue:Z,filterTypes:be,columnSizing:S,columnTypes:T}),$e=Uh(j),Ye=$h(j),G=Ry(o),Q=Se?oe>Se:!1,fe=xe?O>xe:!1,[Te]=Au(()=>new va({getRowAt:Ee=>De().dataArray[Ee],isNodeSelectable:Ee=>{let{isNodeSelectable:it}=De();return it?it(Ee):!0}})),rt=Ne(j),[ae]=Au(()=>new wa({getPrimaryKeyByIndex:ce.getPrimaryKeyByIndex,getColumnIdByIndex:re=>rt()[re]?.id||""})),{computedRowHeight:je,computedRowSizeCacheForDetails:X}=Iy({rowDetailHeight:v,rowHeight:R,isRowDetailsExpanded:w,isRowDetailsEnabled:P,getDataSourceState:De});return dP(()=>({multiRowSelector:Te,multiCellSelector:ae,computedRowSizeCacheForDetails:X,computedRowHeight:je,scrollbars:G,columnSize:Ye,rowspan:$e,toggleGroupRow:te,computedColumnsMap:Qe,computedColumnsMapInInitialOrder:Ke,renderSelectionCheckBox:Ze,computedPinnedStartOverflow:Q,computedPinnedEndOverflow:fe,computedPinnedStartWidth:Se,computedPinnedEndWidth:xe,computedVisibleColumns:j,computedColumnOrder:ge,computedRemainingSpace:ye,computedVisibleColumnsMap:ee,computedPinnedStartColumns:K,computedPinnedEndColumns:ie,computedUnpinnedColumns:ne,computedPinnedStartColumnsWidth:oe,computedPinnedEndColumnsWidth:O,computedUnpinnedColumnsWidth:A,computedUnpinnedOffset:ue,computedPinnedEndOffset:Ie,fieldsToColumn:ot}),[Te,ae,X,je,G,Ye,$e,te,Qe,Ke,Ze,Q,fe,Se,xe,j,ge,ye,ee,K,ie,ne,oe,O,A,ue,Ie,ot])}import{useMemo as SP}from"react";function pP(n=3988292384){var e=new Array,t,o,r;for(t=0;t<256;t++){for(r=t,o=8;o>0;o--)(r&1)==1?r=r>>>1^n:r=r>>>1;e[t]=r}return e}function fP(){return 4294967295}function mP(n,e,t){return e=e>>>8^n[t^e&255],e}function gP(n){return n=~n,n=n<0?4294967295+n+1:n,n}function _u(n,e=3988292384){var t=pP(e),o=0,r;for(o=fP(),r=0;r<n.length;r++)o=mP(t,o,n.charCodeAt(r));return o=gP(o),`${o}`}var hP=n=>{let e=n.reduce((o,r)=>(o.set(r.name,r.value),o),new Map);return{distribution:e.get("Type")==="distribution",count:e.get("DevCount")?Number(e.get("DevCount")):0,start:new Date(e.get("StartDate")),end:new Date(e.get("EndDate")),owner:e.get("Owner"),type:e.get("Type"),timestamp:e.get("TS")?Number(e.get("TS")):0,trial:e.get("Trial")==="true",ref:e.get("Ref")??""}},vy=`Thank you for using the Infinite Table free version! Make sure the "Powered by Infinite Table" footer link is visible in your app.
28
28
 
29
- If you want to remove the footer link, please visit infinite-table.com to purchase a license.`,qh=!1,Xh=(n,e=console.error.bind(console))=>{n=["* * * infinite-table.com * * *",...n];let t=Math.max(Math.max(...n.map(o=>o.length))+8,60);n.forEach(o=>{let r=(t-o.length)/2-1,i=0;r!==Math.round(r)&&(i=-1,r=Math.round(r));let a=r+i,l=r;e("*".repeat(a)+" "+o+" "+"*".repeat(l))}),e("*".repeat(t))},Zh=(n="",e,t)=>{let o;try{o=Av(n)}catch{return n?(Xh(["You don't have a valid Infinite Table license","Please visit infinite-table.com to purchase a license.","Thank you for playing fair!"],t),"invalid"):(t?t(Yh):qh||(qh=!0,console.info(Yh)),"invalid")}let r=new Date(e.publishedAt),i=new Date(o.end);return i<r?(Xh([`
29
+ If you want to remove the footer link, please visit infinite-table.com to purchase a license.`,Py=!1,Dy=(n,e=console.error.bind(console))=>{n=["* * * infinite-table.com * * *",...n];let t=Math.max(Math.max(...n.map(o=>o.length))+8,60);n.forEach(o=>{let r=(t-o.length)/2-1,i=0;r!==Math.round(r)&&(i=-1,r=Math.round(r));let a=r+i,l=r;e("*".repeat(a)+" "+o+" "+"*".repeat(l))}),e("*".repeat(t))},xy=(n="",e,t)=>{let o;try{o=yP(n)}catch{return n?(Dy(["You don't have a valid Infinite Table license","Please visit infinite-table.com to purchase a license.","Thank you for playing fair!"],t),"invalid"):(t?t(vy):Py||(Py=!0,console.info(vy)),"invalid")}let r=new Date(e.publishedAt),i=new Date(o.end);return i<r?(Dy([`
30
30
  Your Infinite Table license has expired on ${i.toDateString()}.
31
- `,`You are using version "${e.version}" of Infinite Table, which was published on ${r.toDateString()}.`,"Please visit infinite-table.com to renew your license.","Thank you for playing fair!"],t),"expired"):"valid"};var Av=n=>{let e="",t=n.split("|").map(l=>{let s=l.indexOf("="),u=s===-1?l:l.slice(0,s),c=s===-1?"":l.slice(s+1);return u==="C"&&(e=c),{name:u,value:c}});if(!e)throw"Invalid license";let o=e.split(",").reverse(),r=o.pop();o.forEach((l,s)=>{let u=t[s];if(hu(u.value)!==l)throw"Invalid license"});let i=[...t];i.pop();let a=i.map(l=>`${l.name}=${l.value}`).join("|");if(hu(a)!==r)throw"Invalid license";return t=t.map(l=>({...l,value:decodeURI(l.value)})),Ev(t)};function Qh(n="",e){if(e.isDetail)return"valid";let t=Zh(n,{publishedAt:1796157963892,version:"11.0.3"});return t==="invalid"&&!n?"missing":t}var Jh=(n="")=>{let t=!!Fn();return _v(()=>Qh(n,{isDetail:t}),[n,t])};import{useRef as ey,useEffect as ty}from"react";var Ov=10;function ny(n,e,t){let o=ey(!1),r=ey(null);ty(()=>{n!=null&&(o.current=!1,Ot(r.current))},[n]),ty(()=>{if(n!=null&&!o.current){let a=function(l=0){l++,Ot(r.current),r.current=Ve(()=>{o.current=t.scrollCellIntoView(n[0],n[1],{offset:30}),!o.current&&l<Ov&&a(l)})};var i=a;a()}return()=>{Ot(r.current)}},[n,e])}import{useRef as oy,useEffect as ry}from"react";var Fv=10;function iy(n,e,t){let o=oy(!1),r=oy(null);ry(()=>{n!=null&&(o.current=!1,cancelAnimationFrame(r.current))},[n]),ry(()=>{if(n!=null&&!o.current){let a=function(l=0){l++,r.current=requestAnimationFrame(()=>{o.current=t.scrollRowIntoView(n,{offset:0}),!o.current&&l<Fv&&a(l)})};var i=a;a()}return()=>{cancelAnimationFrame(r.current)}},[n,e])}function ay(){return fn()}import{useCallback as Kv,useMemo as Bv,useEffect as Wv}from"react";function ly(n,e){n.getComputed().multiRowSelector.lastPointerDown={rowIndex:n.rowIndex,shiftKey:!!e.shiftKey},e.detail!==2&&void 0}var Nv={Enter:!0," ":!0,a:!0};function sy(n,e){let{getState:t,getDataSourceState:o,dataSourceActions:r,cloneRowSelection:i,cloneTreeSelection:a}=n,{key:l,ctrlKey:s,metaKey:u}=e;if(!Nv[l])return!1;let c=t(),d=o(),{activeRowIndex:p,activeCellIndex:f,keyboardNavigation:m,keyboardSelection:g}=c,{selectionMode:h,rowSelection:S,treeSelectionState:y,isTree:C}=d;if(g===!1)return!1;let T=m==="row"&&p!=null?p:m==="cell"&&f!=null?f[0]:null;if(!(T!=null?d.dataArray[T]:null)||T==null)return!1;if(l===" "&&(h==="single-row"||h==="multi-row")){let b={key:e.key,metaKey:e.metaKey,ctrlKey:e.ctrlKey,shiftKey:e.shiftKey,preventDefault:()=>e.preventDefault()};return Di({...n,rowIndex:T},b,"keyboard")}if(h!=="multi-row")return!1;if(l==="a"&&(s||u)){if(C&&y){let R=a(y);return R.selectAll(),r.treeSelection=R,!0}let b=i(S);return b.selectAll(),r.rowSelection=b,!0}return!1}var uy=["input","textarea","select","[tabindex]","a[href]","button","object"].join(", "),cy=n=>Array.from(n.querySelectorAll(uy)).filter(t=>!!t.offsetParent),Da=n=>n.querySelector(uy);var py=oo(zn());async function dy(n,e=10,t=300){return new Promise((o,r)=>{let i=Date.now();function a(){if(Date.now()-i>t)return r(!1);if(!n()){setTimeout(a,e);return}o(!0)}a()})}var Lv=10,kv=(n,e)=>n-e;function xa(n,e){let{getComputed:t,getDataSourceState:o,getState:r,api:i,dataSourceApi:a}=e,{editingCell:l,isRowDetailEnabled:s}=r(),{dataArray:u}=o(),{computedVisibleColumns:c,computedColumnsMap:d}=t(),p=c[n.colIndex];if(!p)return!1;if(l&&l.columnId===p.id&&l.rowIndex===n.rowIndex)return!0;if(!p.contentFocusable)return!1;if(p.contentFocusable===!0)return!0;let f=u[n.rowIndex],m=!s||typeof s=="function"&&!s(f)?!1:i.rowDetailApi.isRowDetailExpanded(f.id)?"expanded":"collapsed",g=ft(p.id,e);return p.contentFocusable({column:p,...vo({column:p,rowInfo:f,columnsMap:d,context:e,rowDetailState:m}).formattedValueContext,columnApi:g,api:i,dataSourceApi:a})}function yu(n,e,t){let o=t.getState().editingCell;return zv(n,e,t,{isCellFocusable:xa,isColumnElligible:i=>o&&o.columnId===i.id?!0:!!i.contentFocusable})}function fy(n,e,t){let o=(0,py.default)(t,n+e,kv);return o<0&&(o=~o,e>0&&o>=t.length||e<0&&o===0)?null:t[o]??null}globalThis.getNextCol=fy;function zv(n,e,t,o){let{isColumnElligible:r,isCellFocusable:i}=o,a=t.getComputed().computedVisibleColumns.filter(r).reduce((d,p)=>(d.push(p.computedVisibleIndex),d),[]);if(!a.length)return null;let{getDataSourceState:l}=t,{dataArray:s}=l(),u=n.rowIndex,c=n.colIndex;for(;u!=null||c!=null;){if(c=c===null?a[e===-1?a.length-1:0]:fy(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 my(n){let e={rowIndex:n.getDataSourceState().dataArray.length-1,colIndex:n.getComputed().computedVisibleColumns.length-1},t=xa(e,n)?e:yu(e,-1,n);if(t){await Su([t.rowIndex,t.colIndex],n);let o=n.getState().getDOMNodeForCell(t);if(!o)return;Da(o)?.focus()}}async function Su([n,e],t){let{api:o}=t;return new Promise((r,i)=>{let a=Lv,l=null,s=!1;function u(c=0){c++,Ot(l),l=Ve(async()=>{if(s=o.scrollCellIntoView(n,e,{offset:30}),!s&&c<a&&u(c),s){try{await dy(()=>!!t.getState().getDOMNodeForCell({rowIndex:n,colIndex:e}))}catch(d){i(d);return}r(!0)}})}u()})}var Vv=`.${Bt}`;function gy(n,e){if(e.key!=="Tab")return!1;let t=e.shiftKey?-1:1,o=e.target,r=n.getState().scrollerDOMRef.current,i=document.activeElement===r||o===r;if(!r||i&&t===-1)return!1;let a=i?null:hn(o,Vv),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}=n.getState();[l,s]=c||[0,0]}if(l==null||s==null||isNaN(l)||isNaN(s))return!1;let u=i&&xa({colIndex:s,rowIndex:l},n)?{rowIndex:l,colIndex:s}:yu({rowIndex:l,colIndex:s},t,n);if(!u){if(t===-1)r.focus();else{let c=cy(document.body),d=n.getState().focusDetectDOMRef.current,p=c.findIndex(m=>m===d);c[p+1]?.focus()}return!0}return Su([u.rowIndex,u.colIndex],n).then(()=>{let c=n.getState().getDOMNodeForCell(u);if(!c)return;Da(c)?.focus()}),!0}var hy={control:"ctrl"},yy={"control|cmd":"ctrl","cmd|control":"ctrl","ctrl|cmd":"ctrl","cmd|ctrl":"ctrl"},Gv={esc:"escape"},by={cmd:n=>n.metaKey,alt:n=>n.altKey,ctrl:n=>n.ctrlKey,shift:n=>n.shiftKey},Ty=Object.keys(by),bu=new Set(Ty),Hv=new Set(["shift","alt"]);function Tu(n,e){return Array.isArray(e)?e.some(t=>Sy(n,t)):Sy(n,e)}function Sy(n,e){let t=n.key.toLowerCase(),o=e.split("+").map(p=>p.toLowerCase().trim()),r=o.find(p=>yy[p]),i=o.map(p=>hy[p]||yy[p]||Gv[p]||p),a=i.filter(p=>bu.has(p)),l=i.filter(p=>!bu.has(p)),s=Ty.reduce((p,f)=>(p[f]=by[f](n),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=>!Hv.has(f)).length)return!1}else if(a.length!=u.length)return!1;return!l.length||bu.has(t)||t==="meta"||hy[t]?!1:l.reduce((p,f)=>p?f==="*"||t===f:!1,!0)}async function Cy(n,e){let t={...n,cloneRowSelection:a=>wo(a,n.getDataSourceState),cloneTreeSelection:a=>Ro(a,n.getDataSourceState)},{onKeyDown:o}=n.getState(),r={preventEdit:!1,preventEditStop:!1,preventDefaultForTabKeyWhenEditing:!0,preventSelection:!1,preventNavigation:!1};if(o){let a=o(n,e);a&&typeof a=="object"&&(r={...r,...a})}if(!r.preventSelection&&sy(t,e)&&e.preventDefault(),(gy(t,e)||!n.getState().focusedWithin&&!r.preventNavigation&&mg(t,e))&&e.preventDefault(),!r.preventEdit&&e.key==="Enter"&&!n.api.isEditInProgress()){let{activeCellIndex:a}=n.getState();if(a){let[l,s]=a,u=n.getComputed().computedVisibleColumns[s];u.computedEditable&&n.api.startEdit({rowIndex:l,columnId:u.id})}}n.api.isEditInProgress()&&(e.key==="Escape"&&!r.preventEditStop&&n.api.stopEdit({cancel:!0}),e.key==="Tab"&&r.preventDefaultForTabKeyWhenEditing&&e.preventDefault());let{keyboardShortcuts:i}=n.getState();if(i)for await(let a of i){if(!Tu(e,a.key)||a.when&&!await a.when(n))continue;let l=await a.handler(n,e);if(l&&l.stopNext)break}}function jv(){let{getState:n,actions:e,api:t,getComputed:o,getDataSourceMasterContext:r}=Ge(),{getDataSourceState:i,dataSourceActions:a,dataSourceApi:l}=Wt();return Bv(()=>({getComputed:o,getDataSourceMasterContext:r,dataSourceApi:l,api:t,getState:n,actions:e,getDataSourceState:i,dataSourceActions:a,cloneTreeSelection:c=>Ro(c,i),cloneRowSelection:c=>wo(c,i)}),[n,e,i,a,t,l,o])}function Uv(){let n=jv();Wv(()=>{let e=n.getState().keyDown.onChange(a=>{Cy(n,a)});function t(a){if(!a)return;let l=a.event,s=n.getComputed().computedVisibleColumns[a.colIndex],u=ft(s.id,n);Hp({...n,rowIndex:a.rowIndex,colIndex:a.colIndex,column:s,columnApi:u},{...l,key:""})}let o=n.getState().cellClick.onChange(t);function r(a){if(!a)return;let{event:l,rowIndex:s,colIndex:u}=a,c=n.getComputed().computedVisibleColumns[u],d=ft(c.id,n);ly({...n,rowIndex:s,colIndex:u,column:c,columnApi:d},l)}let i=n.getState().cellMouseDown.onChange(r);return()=>{e(),o(),i()}},[])}function $v(){let{getState:n}=ee(t=>({getState:t.getState}));return{onKeyDown:Kv(t=>{n().keyDown(t)},[])}}function Iy(){return Uv(),$v()}import{useEffect as DS}from"react";import*as He from"react";import{useCallback as Ru,useEffect as qv,useLayoutEffect as Xv,useState as Aa}from"react";import{createPortal as Zv}from"react-dom";var Ma="__is_infinite_menu_component";function Cu(n){return!!n.tagName}function vy(n){let{alignTarget:e,alignAnchor:t,constrainTo:o,alignPosition:r}=n,i=Ae.from(Cu(e)?e.getBoundingClientRect():e),a=Ae.from(Cu(t)?t.getBoundingClientRect():t),l=o?Ae.from(Cu(o)?o.getBoundingClientRect():o):null;if(!l)return{...Ry({anchorRect:a,targetRect:i,position:r[0]}),index:0};let s=null;for(let u=0,c=r.length;u<c;u++){let d=Ry({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 Ry(n){let e=Ae.from(n.targetRect),t=Ae.from(n.anchorRect),o=n.constrainRect?Ae.from(n.constrainRect):null,{position:r}=n,[i,a]=r,l=wy(e,i),s=wy(t,a),u=l.getDistanceToPoint(s);e.shift(u);let c=o?o.contains(e):!0;return{alignPosition:r,alignedRect:e,valid:c,distance:u}}function wy(n,e){return e==="TopLeft"?Be.from({top:n.top,left:n.left}):e==="TopCenter"?Be.from({top:n.top,left:n.left+(n.width>0?Math.round(n.width/2):0)}):e==="TopRight"?Be.from({top:n.top,left:n.left+n.width}):e==="BottomLeft"?Be.from({left:n.left,top:n.top+n.height}):e==="BottomCenter"?Be.from({left:n.left+(n.width>0?Math.round(n.width/2):0),top:n.top+n.height}):e==="BottomRight"?Be.from({left:n.left+n.width,top:n.top+n.height}):e==="CenterLeft"?Be.from({left:n.left,top:n.top+(n.height>0?Math.round(n.height/2):0)}):e==="CenterRight"?Be.from({left:n.left+n.width,top:n.top+(n.height>0?Math.round(n.height/2):0)}):Be.from({left:n.left+(n.width>0?Math.round(n.width/2):0),top:n.top+(n.height>0?Math.round(n.height/2):0)})}function Yv(n){return n&&typeof n.then=="function"||n instanceof Promise}function Ea(n){return n==null||typeof n=="string"?!1:typeof n.tagName=="string"}async function Py(n){return typeof n=="function"&&(n=n()),Yv(n)&&(n=await n),typeof n=="string"&&(n=document.querySelector(n)),n&&Ea(n)&&(n=n.getBoundingClientRect()),n?Ae.from(n):null}async function Dy(n){let e=null;typeof n=="function"?e=n():e=n;function t(o){let r=null;return typeof o=="string"&&(r=document.querySelector(o)),Ea(o)&&(r=o),r||null}return t(await e)}async function Iu(n,e){let{constrainTo:t,alignTo:o,alignPosition:r}=e;Object.keys(o).length===2&&o.top!==void 0&&o.left!==void 0&&(o={...o,width:0,height:0}),typeof t=="boolean"&&(t=t?document.documentElement.getBoundingClientRect():void 0);let i=t&&await Py(t)||void 0,a=o?await Py(o):void 0,l=Ae.from(n.getBoundingClientRect());if(!a)return;let{alignedRect:s}=vy({constrainTo:i,alignAnchor:a,alignTarget:l,alignPosition:r});n.style.transform=`translate3d(${s.left}px,${s.top}px, 0px)`;let u=n.getBoundingClientRect();if(u.left!==s.left||u.top!==s.top){let c=n.offsetParent;if(c){let d=c.getBoundingClientRect(),p=d.left,f=d.top,m=s.left-p,g=s.top-f;n.style.transform=`translate3d(${m}px,${g}px, 0px)`}}}function Qv(n){return He.createElement("div",{style:{position:"fixed",top:0,left:0}},n.children)}function Jv(n){let e=He.useRef(null);return qv(()=>n.realign.onChange(t=>{e.current&&t&&Iu(e.current,t)}),[n.realign]),He.createElement("div",{style:{position:"absolute",top:0,left:0},ref:Ru(t=>{t&&Iu(t,n),e.current=t},[])},typeof n.children=="function"?n.children():n.children)}function eP(n,e){let[t,o]=Aa(null);Xv(()=>{async function a(){let l=e?await Dy(e):null;l!=null&&o(l)}e&&a()},[e]);let r=typeof e=="function"?e():null,i=Ea(r)?r:t;return e?i?Zv(n,i):He.createElement(He.Fragment,null):e===null||e===!1?n:He.createElement(Qv,null,n)}function tP(n){if(He.Children.count(n)===1){let e=He.Children.only(n);if(He.isValidElement(e))return e.props.id||e.key}return null}function nP(n,e,t){if(He.Children.count(n)===1){let o=He.Children.only(n);if(He.isValidElement(o)&&o.type[Ma]){let r={};return o.props.portalContainer===void 0&&(r.portalContainer=e),o.props.constrainTo===void 0&&(r.constrainTo=t),He.cloneElement(o,r)}}return n}function ln(n){let e=n,[t]=Aa(()=>new Map),[o,r]=Aa(null),[i,a]=Aa(0),l=Ru(()=>{let m=[];for(let[g,h]of t)m.push(He.createElement(Jv,{...h,key:h.key}));return m},[]),[s,u]=kt(),c=eP(l(),n.portalContainer),d=Ru((m,g)=>{let S=`${g.id||tP(m)||xt()}`,y=t.get(S),C=b=>()=>{let R=typeof b=="function"?b():b;return nP(R,e.portalContainer,g.constrainTo??e.constrainTo)},T=C(m),I=(b,R)=>{if(!y)return;let w=C(b);Object.assign(y,{children:w}),u(),!!!R?.skipRealign&&(r(y.key),a(Date.now()))};return y?(Object.assign(y,g),I(m),I):(y={key:S,children:T,alignPosition:g.alignPosition,alignTo:g.alignTo,constrainTo:g.constrainTo,realign:ye()},t.set(y.key,y),u(),I)},[t,e.portalContainer,u]);He.useEffect(()=>{if(o){let m=t.get(o);m&&m.realign(m)}},[o,i]);let p=m=>{m=`${m}`,t.has(m)&&(t.delete(m),u())},f=()=>{t.clear(),u()};return He.useEffect(()=>{},[]),{portal:c,hideOverlay:p,clearAll:f,rerenderOverlays:u,showOverlay:d}}import*as mS from"react";import*as Vo from"react";import*as Gy from"react";import*as zy from"react";function _a(n){return null}_a.defaultProps={__is_menu_item:!0};var xy="submenu",oP="-";function My(){return{keyboardActiveItemKey:null,activeItemKey:null,generatedId:xt(),focused:!1,destroyed:!1,domRef:{current:null}}}function Ey(){return{parentMenuId:1,parentMenuItemKey:1,onHideIntent:1,constrainTo:1,onAction:1,onShow:1,onHide:1,autoFocus:1,wrapLabels:1}}var wu=({columns:n,keyboardActiveItemKey:e,activeItemKey:t,menuId:o},r,i)=>{let a=r&&(r.key!=null||r.label!=null)?r:null,l=a===null?r===oP?i.renderSeparator():r:null;return a!=null?{type:"item",parentMenuId:o,disabled:!!a.disabled,keyboardActive:a.key===e,active:a.key===t,value:a,span:a.span||1,key:a.key,menu:a.menu||null,style:a.style,className:a.className,originalMenuItem:a}:{type:"decoration",value:l,span:n.length,style:{gridColumnStart:1,gridColumnEnd:n.length+10}}},rP=[{name:"label"}],Ay=(n,e)=>{let{props:t,state:o}=n,{activeItemKey:r,keyboardActiveItemKey:i}=o,{items:a,children:l,addSubmenuColumnIfNeeded:s,parentMenuId:u}=t,c=t.id||o.generatedId;u&&(c=`${u}-${c}`);let d=[...t.columns||rP],p={columns:d,keyboardActiveItemKey:i??null,activeItemKey:r??null,menuId:c},f=[];a?f=a.map(g=>wu(p,g,e)):!a&&typeof l!="function"&&(f=e.childrenToRuntimeItems?e.childrenToRuntimeItems(p,l):[]),s&&f.filter(h=>h.type==="item"&&h.menu!=null).length>0&&!d.find(h=>h.name==xy)&&d.push({name:xy,render:e.renderSubmenuColumn});let m=f.filter(g=>g.type==="item"&&!g.disabled);return{runtimeItems:f,runtimeSelectableItems:m,columns:d,menuId:c}};import*as zo from"react";var _y="db3arf0 _16lm1iw0 _16lm1iw1 _16lm1iw1w _16lm1iw2f _16lm1iw8",Oy=ge({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"]]}),Fy="db3arf1",Ny="db3arfd";function Ly(){return zo.createElement("hr",{className:Ny})}var Oa={renderSeparator:()=>zo.createElement(Ly,null),renderSubmenuColumn:({domProps:n,item:e})=>e.menu?zo.createElement("div",{...n},zo.createElement(Wn,{expanded:!1})):zo.createElement("div",{...n})};var ky=(n,e)=>wu(n,e,Oa);function Vy(n,e){return zy.Children.map(e,t=>{if(t&&(t.props.__is_menu_item||t.type===_a)){let o={...t.props};return o.key||(o.key=t.key),o.description||(o.description=t.props.children),o.label||(o.label=o.children),ky(n,o)}return ky(n,t)})||[]}function Hy(){return{...My(),domRef:Gy.createRef()}}var Ky=()=>Ey(),By=n=>Ay(n,{...Oa,childrenToRuntimeItems:Vy});import*as Lt from"react";import{useCallback as _r,useLayoutEffect as fP,useRef as mP,useState as Du}from"react";import{createContext as iP,useContext as aP}from"react";var vu=iP(null);function Pu(){return aP(vu)}function Wy(n,e){let t=jy(n,e);if(!t.length)return null;let o=Ae.from(t[0]?.getBoundingClientRect()),r=Ae.from(t[t.length-1].getBoundingClientRect()),i=o;return i.width=r.left+r.width-o.left,i}function jy(n,e){let t=hn(document.querySelector(`[data-menu-id="${n}"] [data-menu-item-key="${e}"]`),`[data-menu-id="${n}"]`);if(!t)return[];let o=t.querySelectorAll(`[data-menu-item-key="${e}"]`);return Array.from(o)}function Uy(n,e){let t=jy(n,e);if(!t.length)return null;for(let o of t){let r=o.querySelector('input[type="checkbox"]');if(r)return r}return null}function $y(n){let e=n();e.onHideIntent?.(e)}function Yy(n,e,t){let{getState:o,setActiveItemKey:r,setKeyboardActiveItemKey:i,hideAll:a}=t;i(e.key),r(e.key),e.originalMenuItem.onClick&&e.originalMenuItem.onClick(n);let l={key:e.key,item:e.originalMenuItem,hideMenu:a};e.originalMenuItem.onAction&&e.originalMenuItem.onAction(l);let{onAction:s}=o();s&&s(l),e.originalMenuItem.hideMenuOnAction&&a()}function qy(n,e){let{getState:t,setActiveItemKey:o,setKeyboardActiveItemKey:r,destroy:i,getSubmenuApi:a,isMounted:l,onItemClick:s}=e,{runtimeItems:u,runtimeSelectableItems:c,keyboardActiveItemKey:d}=t(),p=u.findIndex(S=>S.type==="item"&&S.key===d),f=d,m=u[p],g={ArrowUp:()=>{let S=u.slice(0,p).filter(y=>y.type==="item"&&!y.disabled).pop();S&&S.type==="item"&&S.key&&(f=S.key)},ArrowDown:()=>{let S=u.slice(p+1).filter(y=>y.type==="item"&&!y.disabled)[0];S&&S.type==="item"&&S.key&&(f=S.key)},Home:()=>{g.PageUp()},End:()=>{g.PageDown()},PageUp:()=>{f=c[0].key},PageDown:()=>{f=c[c.length-1].key},ArrowLeft:()=>{o(null),t().parentMenuId&&i()},ArrowRight:()=>{m&&(o(m.key),Ve(()=>{let S=a();l()&&S&&S.getParentMenuId()===t().menuId&&S.focus()}))},Enter:()=>{if(m)if(m.originalMenuItem?.menu){if(a()){g.ArrowLeft();return}o(m.key)}else s(n,m)}," ":()=>{if(!m)return;m.originalMenuItem.menu||s(n,m);let S=Uy(t().menuId,m.key);S&&S.click()},Escape:()=>{g.ArrowLeft();let S=t();S.parentMenuId||S.onHideIntent?.(S)}},h=g[n.key];h&&(h(),n.preventDefault()),f!=d&&r(f)}function Xy(n){let{getState:e,setFocused:t,setKeyboardActiveItemKey:o,shouldSelectFirstItemOnFocus:r,hideAll:i}=n,a=()=>{t(!0),setTimeout(()=>{let s=e().domRef.current;r()&&s&&s===document.activeElement&&e().keyboardActiveItemKey==null&&o(e().runtimeSelectableItems[0]?.key??null)})};return{api:{hideMenu:i,focus:()=>{let s=e().domRef.current;s&&(s.focus(),setTimeout(()=>{let u=e().domRef.current;u&&u!==document.activeElement&&u.focus()},10),a())},getMenuId:()=>e().menuId,getParentMenuId:()=>e().parentMenuId},onMenuFocus:a}}var Ar=class extends bo{constructor(e){super(e.slice(0,3))}};var lP=250;function sP(n,e=100){let t=Date.now();return new Promise(o=>{let r,i=()=>{if(r=n(),r!==void 0){o(r);return}if(Date.now()-t>e){o(void 0);return}Ve(i)};Ve(()=>{i()})})}var uP=_e(),Fa=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||lP;this.getPointerMoveTarget=()=>document.documentElement||uP;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 Be({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 Ar([this.activeItemLeavePoint,this.activeItemMenuRect.getTopLeft(),this.activeItemMenuRect.getBottomLeft()]):new Ar([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,sP(()=>this.activeItem!=e?!1:this.params.getMenuRectFor(e)).then(o=>{this.activeItem==e&&o&&(this.activeItemMenuRect=o)})}};this.onItemChange=(e,t,o)=>{if(clearTimeout(this.menuLeaveTimeoutId),clearTimeout(this.mouseMoveTimeoutId),!e){this.removePointerMoveListener(),t===this.activeItem&&(this.activeItemLeavePoint=new Be({left:o.clientX,top:o.clientY})),this.setupMenuLeaveTracking();return}if(this.currentHoveredItem=t,!this.activeItem||!this.params.itemHasSubMenu(this.activeItem)){this.setActiveItem(t,o.target);return}this.onPointerMoveWhileActiveItem(),this.getPointerMoveTarget().addEventListener("pointermove",this.onPointerMoveWhileActiveItem)};this.getHandlers=()=>({onItemEnter:(e,t)=>{this.onItemChange(!0,e,t)},onItemLeave:(e,t)=>{this.onItemChange(!1,e,t)}});this.params=e}};function Zy(n,e){let t=n.filter(o=>o.type==="item"&&e===o.key)[0];return t&&t.menu?t:null}function Qy(n,e,t){let o=Wy(n,e.key);return o?{id:`${n}-submenu`,alignTo:o,alignPosition:[["TopLeft","TopRight"],["TopRight","TopLeft"]],constrainTo:t}:null}function Jy(n,e){let{parentMenuId:t,constrainTo:o,api:r,hideAll:i,setSubmenuApi:a,setActiveItemKey:l,setKeyboardActiveItemKey:s}=e,u=n.menu;if(!u)return null;typeof u=="function"&&(u=u());let c=u;return{parentMenuItemKey:n.key,parentMenuId:t,constrainTo:o,...c,autoFocus:!1,onShow:(d,p)=>{c?.onShow?.(d,p),a(p)},onHideIntent:d=>{c?.onHideIntent?.(d),i()},onHide:d=>{d.focused&&(l(null),s(n.key),r.focus())}}}function eS(n,e){return new Fa({parentMenuId:n().parentMenuId,onItemActivate:e,itemHasSubMenu:t=>!!n().runtimeItems.filter(r=>r.type==="item"&&r.key===t&&r.menu)[0],getMenuRectFor:t=>{let o=`[data-submenu-for="${t}"]`,r=document.querySelector(o);if(r)return Ae.from(r.getBoundingClientRect())}}).getHandlers()}function tS(n,e,t=o=>o){let{columns:o,runtimeItems:r,wrapLabels:i}=n,a=o.map(s=>t(s.width||(typeof s.flex=="number"?`${s.flex}fr`:s.flex)||"auto")).join(" "),l={...e,gridTemplateColumns:a,gridTemplateRows:r.map(()=>"auto").join(" ")};return i||(l.whiteSpace="nowrap"),l}function nS(n,e,t,o){let{active:r,keyboardActive:i,pressed:a}=o,l=n.value.key,s=U(Oy({active:r,disabled:!!n.disabled,keyboardActive:i,pressed:a||r}),n.className),u=[],c=0;return e.forEach((d,p)=>{let f=n.value,m=d.field||d.name,g=p+1,h=g+n.span;g<c||(c=h,u.push({key:`${l}-${m}`,column:d,value:f[m],style:{...d.style,...n.style,gridColumnStart:g,gridColumnEnd:h},className:s,dataAttributes:{"data-menu-column-id":`${n.parentMenuId}-col-${d.name}`,"data-menu-col-name":`${d.name}`,"data-menu-row-id":`${n.parentMenuId}-row-${t}`,"data-menu-row-index":`${t}`,"data-menu-item-key":`${n.key}`}}))}),u}import{useCallback as cP,useEffect as dP,useRef as pP}from"react";function oS(){let n=pP(!0);return dP(()=>(n.current=!0,()=>{n.current=!1}),[]),cP(()=>n.current,[])}function gP(n,e){let t=`${e.parentMenuId}-submenu`,o=Jy(n,e);return o?Lt.createElement(sn,{key:t,...o}):null}function hP({onItemActivate:n}){let{getState:e}=Pu(),[{onItemEnter:t,onItemLeave:o}]=Du(()=>eS(e,r=>{if(!r){n(null);return}let i=e().runtimeItems.filter(a=>a.type==="item"&&a.key===r)[0];n(i)}));return{onItemEnter:_r(t,[]),onItemLeave:_r(o,[])}}function rS(n){let{domProps:e}=n,{componentState:t,componentState:{columns:o,runtimeItems:r,menuId:i,activeItemKey:a,keyboardActiveItemKey:l,constrainTo:s,destroyed:u,onShow:c,onHide:d,autoFocus:p,parentMenuItemKey:f,domRef:m},componentActions:g,getState:h}=Pu(),S=_r(_=>{g.keyboardActiveItemKey=_},[]),y=_r(_=>{g.activeItemKey=_},[]),C=oS(),[T,I]=Du(null),b=mP(!0),[{api:R,onMenuFocus:w,hideAll:v}]=Du(()=>{let _=()=>$y(h);return{hideAll:_,...Xy({getState:h,setFocused:k=>{g.focused=k},setKeyboardActiveItemKey:S,shouldSelectFirstItemOnFocus:()=>b.current,hideAll:_})}}),P=null;fP(()=>{let{runtimeItems:_}=h(),k=Zy(_,a);if(!k){I(null),E();return}let H=Qy(i,k,s);H&&M(()=>gP(k,{constrainTo:s,setSubmenuApi:I,setActiveItemKey:y,setKeyboardActiveItemKey:S,parentMenuId:i,hideAll:v,api:R}),H)},[a]);let x=(_,k)=>{Yy(_,k,{getState:h,setActiveItemKey:y,setKeyboardActiveItemKey:S,hideAll:v})},{showOverlay:M,portal:D,clearAll:E}=ln({portalContainer:!1}),{onItemEnter:z,onItemLeave:V}=hP({onItemActivate:_=>{if(!C())return;let k=_?_.key:null;y(k)}});P=r.map((_,k)=>Lt.createElement(yP,{key:_.type==="item"?_.key:k,onItemEnter:(H,Z)=>{z(H.key,Z)},onItemLeave:(H,Z)=>{V(H.key,Z)},columns:o,active:_.type==="item"&&_.key===a,keyboardActive:_.type==="item"&&_.key===l,item:_,index:k,onClick:x}));let N=tS(t,e.style);function L(_){qy(_,{getState:h,setActiveItemKey:y,setKeyboardActiveItemKey:S,destroy:()=>{g.destroyed=!0},getSubmenuApi:()=>T,isMounted:C,onItemClick:x})}function F(){g.focused=!1}let K=_r(_=>{_?(m.current=_,c?.(h(),R),p&&R.focus()):(d?.(h()),m.current=_)},[]),q=Lt.createElement("div",{className:so.contents},Lt.createElement("div",{...e,"data-menu-id":i,"data-submenu-for":f,tabIndex:0,ref:K,onKeyDown:_=>{e.onKeyDown?.(_),L(_)},onMouseDown:_=>{b.current=!1,e.onMouseDown?.(_)},onMouseUp:_=>{b.current=!0,e.onMouseUp?.(_)},onFocus:w,onBlur:F,className:U(_y,e.className,"InfiniteMenu"),style:N},P),D);return u?null:q}function yP(n){let[e,t]=Lt.useState(!1),{columns:o,item:r,index:i,active:a,keyboardActive:l}=n,s=null;return r.type==="decoration"?s=Lt.createElement("div",{style:r.style},r.value):s=nS(r,o,i,{active:a,keyboardActive:l,pressed:e}).map(u=>{let c=u.column,d={style:u.style,...u.dataAttributes,className:u.className,onPointerEnter:p=>{r.disabled||n.onItemEnter?.(r,p)},onPointerLeave:p=>{r.disabled||n.onItemLeave?.(r,p)},onMouseDown:()=>{r.disabled||t(!0)},onMouseUp:()=>{r.disabled||t(!1)},onClick:p=>{r.disabled||n.onClick(p,r)}};return c.render?Lt.createElement(ur,{key:u.key,render:c.render,renderParam:{item:r.value,column:c,value:u.value,domProps:d}}):Lt.createElement("div",{key:u.key,...d},u.value)}),Lt.createElement("div",{className:Fy},s)}var{ManagedComponentContextProvider:SP}=Et({initSetupState:Hy,forwardProps:Ky,mapPropsToState:By,layoutEffect:!0});function bP(n){let{componentActions:e,componentState:t}=At(),o=Ne(t);return Vo.createElement(vu.Provider,{value:{componentActions:e,componentState:t,getState:o}},Vo.createElement(rS,{domProps:n.domProps}))}function sn(n){let{children:e,portalContainer:t,items:o,parentMenuId:r,addSubmenuColumnIfNeeded:i=!0,bubbleActionsFromSubmenus:a=!0,onShow:l,onHide:s,wrapLabels:u=!1,onAction:c,constrainTo:d,columns:p,parentMenuItemKey:f,autoFocus:m,id:g,onHideIntent:h,__is_infinite_menu_component:S,...y}=n;return Vo.createElement(SP,{addSubmenuColumnIfNeeded:i,bubbleActionsFromSubmenus:a,wrapLabels:u,...n},Vo.createElement(bP,{domProps:y}))}sn[Ma]=!0;import*as pS from"react";function Na(n){let e=n?Array.isArray(n)?n:n.items:null,t=n&&!Array.isArray(n)?n.columns:void 0;return{items:e,columns:t}}function La(n){let e=o=>{o.__insideMenu=!0},t=o=>{o.domRef.current?.parentNode?.removeEventListener("mousedown",e)};return{onShow:o=>{o.domRef.current?.parentNode?.addEventListener("mousedown",e)},onHide:t,onHideIntent:o=>{t(o),n?.()}}}function ka(n){return{columns:[],items:[],autoFocus:!0,...La(n.onHideIntent)}}function iS(n,e){let{items:t,columns:o}=Na(n);return t&&t.length?{...e,items:t||[],columns:o}:null}function aS(n,e){let{columnApi:t,column:o,getComputed:r,api:i,dataSourceApi:a}=n,s=t.isSortable()?[{key:"sort-asc",label:"Sort Ascending",disabled:o.computedSortedAsc,onAction:()=>{i.setSortingForColumn(o.id,1)}},{key:"sort-desc",label:"Sort Descending",disabled:o.computedSortedDesc,onAction:()=>{i.setSortingForColumn(o.id,-1)}},{key:"sort-none",label:"Unsort",disabled:!o.computedSorted,onAction:()=>{i.setSortingForColumn(o.id,null)}},"-"]:[];return[...o.groupByForColumn?[{key:"collapse-all",label:"Collapse All",onAction:()=>{i.collapseAllGroupRows()}},"-"]:[],...s,o.computedFilterable?{key:"clear-filter",label:"Clear Filter",disabled:!o.computedFiltered,onAction:()=>{i.clearColumnFilter(o.id)}}:null,o.computedFilterable?"-":null,{key:"pin-start",label:"Pin to start",disabled:o.computedPinned==="start",onAction:()=>{i.setPinningForColumn(o.id,"start")}},{key:"unpin",label:"Unpin",disabled:!o.computedPinned,onAction:()=>{i.setPinningForColumn(o.id,!1)}},"-",{key:"columns",label:"Columns",menu:()=>{let c=[];return r().computedColumnsMapInInitialOrder.forEach((p,f)=>{let m=e.getColumnLabel(p);c.push({key:f,label:m,check:e.renderCheckBox({key:p.id,disabled:p.computedVisible&&i.getVisibleColumnsCount()===1,checked:p.computedVisible,onChange:g=>{let h=!!g;i.setVisibilityForColumn(p.id,h),requestAnimationFrame(()=>{i.realignColumnContextMenu()})}})})}),{columns:[{name:"check"},{name:"label"}],items:c}}},"-",{key:"group-by",label:"Group by",menu:()=>{let c=[];return r().computedColumnsMapInInitialOrder.forEach((p,f)=>{if(p.groupByForColumn)return;let m=e.getColumnLabel(p);c.push({key:f,label:m,check:e.renderCheckBox({key:p.id,disabled:!p.computedGroupable,checked:p.computedGroupedBy,onChange:()=>{a.toggleGroupByField(p.field)}})})}),{columns:[{name:"check"},{name:"label"}],items:c}}}].filter(c=>!!c)}function lS(n,e,t,o){if(n==null)return null;let{getComputed:r,getState:i}=e,{getColumnMenuItems:a}=i(),l=r().computedColumnsMap.get(n);if(!l)return null;let s={column:l,columnApi:ft(l.id,e),...e},u=o(s),c=a?a(u,s):u;return!c||!c.length?null:{autoFocus:!0,items:c,...La(t)}}function sS(n,e,t,o){if(n==null)return null;let{getComputed:r,getState:i,getDataSourceState:a,actions:l,dataSourceApi:s,dataSourceActions:u,api:c}=e,{getFilterOperatorMenuItems:d}=i(),p=r().computedColumnsMap.get(n);if(!p)return null;let{filterTypes:f}=a(),m=f[p.computedFilterType];if(!m)return null;let g=m.operators.map(T=>{let I=T.name,b=p.computedFilterValue?p.computedFilterValue.filter.operator===I:I===m.defaultOperator;return{key:I,icon:o.renderOperatorIcon(T),label:o.renderOperatorLabel(T.label??T.name),onAction:()=>{c.setColumnFilterOperator(n,I)},checked:b?o.renderDoneIcon():null}}),S=[...[{key:"close",label:"Close Menu",icon:null,onAction:()=>{c.hideFilterOperatorMenu()}},{key:"reset",label:"Reset",icon:o.renderClearIcon(),disabled:!p.computedFiltered,onAction:()=>{c.clearColumnFilter(n)}},"-"],...g],y={column:p,api:c,getState:i,getDataSourceState:a,getComputed:r,actions:l,dataSourceApi:s,dataSourceActions:u,columnFilterValue:p.computedFilterValue,filterTypes:f},C=d?d(S,y):S;return{autoFocus:!0,columns:[{name:"icon"},{name:"label"},{name:"checked"}],items:C,...La(t)}}function uS(n,e,t){let o=n instanceof Promise||Array.isArray(n)?!0:!!(n&&Array.isArray(n.items));if(n instanceof Promise)return{menu:t.renderLazyMenu(n,e),preventDefault:o};let{items:r,columns:i}=Na(n);return!r||!r.length?{menu:null,preventDefault:Array.isArray(r)}:{preventDefault:o,menu:t.renderMenu({...e,columns:i,items:r})}}function cS(n,e,t,o){let{columnId:r,rowIndex:i,event:a}=n,{getComputed:l,getState:s}=e,{getCellContextMenuItems:u}=s(),{computedColumnsMap:c}=l(),d=c.get(r),p={...Kt({...e,rowIndex:i,columnId:d.id}),event:a};if(!d||!u)return{cellContext:p,menu:null,preventDefault:!1};let f=ka({onHideIntent:t}),m=u(p,e);return{cellContext:p,...uS(m,f,o)}}function dS(n,e,t,o){let{getState:r,getComputed:i}=e,{getContextMenuItems:a}=r(),{computedColumnsMap:l}=i(),s=n.columnId?l.get(n.columnId):void 0,u=s?{...n,...Kt({...e,rowIndex:n.rowIndex,columnId:s.id})}:n;if(!a)return{cellContext:u,menu:null,preventDefault:!1};let c=ka({onHideIntent:t}),d=a(u,e);return{cellContext:u,...uS(d,c,o)}}function fS(n,e){let t=e.getState().components?.CheckBox||bn;return aS(e,{renderCheckBox:({key:o,...r})=>pS.createElement(t,{key:o,...r}),getColumnLabel:o=>mo(o,e,"column-menu")})}function gS(n,e,t){let o=e.getState().components?.Menu??sn,r=lS(n,e,t,i=>fS([],i));return r?mS.createElement(o,{...r}):null}function hS(n){return typeof n=="function"?n():n}function Or(n){return hS(n.menuConstrainTo)??n.domRef.current}function yS(n,e,t){return e?()=>hS(e)??(t||n().portalDOMRef.current):t||!1}var SS=5,bS=[["TopLeft","BottomLeft"],["TopRight","BottomRight"],["BottomLeft","BottomLeft"],["BottomRight","BottomRight"],["TopCenter","TopLeft"],["BottomCenter","TopLeft"],["CenterLeft","TopLeft"],["CenterRight","TopLeft"]],za=10;function TS(n){function e(t){t.__insideMenu!==!0&&n()}return document.documentElement.addEventListener("mousedown",e),()=>{document.documentElement.removeEventListener("mousedown",e)}}function Fr(n,e,t){if(n)return TS(()=>{e(),t()});e()}function CS(n){let{getState:e,actions:t}=n;return o=>{o&&(e().columnMenuTargetRef.current=o.target,t.contextMenuVisibleFor=null,t.cellContextMenuVisibleFor=null,t.filterOperatorMenuVisibleForColumnId=null,t.columnMenuVisibleForColumnId=o.column.id)}}function TP(n){let{columnId:e,context:t,clearAll:o,show:r}=n,{getState:i,actions:a}=t,{columnMenuTargetRef:l,domRef:s}=i();function u(){o(),a.columnMenuVisibleForColumnId=null}let c=n.target;if(c||(c=l.current??void 0,c&&!s.current.contains(c)&&(c=void 0)),!c){let d=`[data-column-id="${e}"] ${pf}`;c=i().domRef.current.querySelector(d)}if(!c){console.warn(`Cannot show column menu for column "${e}"`);return}l.current=null,r(u,{constrainTo:Or(i()),id:"column-menu",alignTo:c,alignPosition:[["TopLeft","BottomLeft"],["TopRight","BottomRight"]]})}function IS(n,e){let{getState:t,actions:o}=n,{clearAll:r}=e,{columnMenuVisibleForColumnId:i,columnMenuTargetRef:a}=t();if(i){let l=TS(()=>{r(),o.columnMenuVisibleForColumnId=null});return TP({columnId:i,context:n,clearAll:r,show:(s,u)=>e.show(i,s,u)}),l}a.current=null,r()}function RS(n){let e={top:n.clientY,left:n.clientX},t=Ae.fromPoint(e);return t.width+=SS,t.height+=SS,{point:e,rect:t}}function wS(n,e){let{actions:t,getState:o,getDataSourceState:r}=n,{clearAll:i}=e;return a=>{if(!a)return;let{event:l}=a;function s(){i(),t.cellContextMenuVisibleFor=null}let u=e.getContent(a,s),{cellContext:c,preventDefault:d}=u,{rect:p}=RS(l);e.show(u,{constrainTo:Or(o()),id:"cell-context-menu",alignTo:p,alignPosition:bS}),d&&l.preventDefault(),t.cellContextMenuVisibleFor={columnId:a.columnId,rowId:a.rowId,rowIndex:a.rowIndex,colIndex:a.colIndex};let{onCellContextMenu:f}=o();f&&f({...c,getState:o,getDataSourceState:r},l)}}function vS(n,e){let{actions:t,getState:o}=n,{clearAll:r}=e;return i=>{if(!i)return;let{event:a}=i;function l(){r(),t.contextMenuVisibleFor=null}let s=e.getContent(i,l),{cellContext:u,preventDefault:c}=s,{point:d,rect:p}=RS(a);e.show(s,{constrainTo:Or(o()),id:"table-context-menu",alignTo:p,alignPosition:bS}),c&&a.preventDefault(),t.contextMenuVisibleFor={point:d,...i};let{onContextMenu:f}=o();f&&f({...n,...u},a)}}function PS(n,e){let{getState:t,actions:o}=n,{clearAll:r}=e;return i=>{if(!i)return;let{target:a,column:l}=i;function s(){r(),o.filterOperatorMenuVisibleForColumnId=null}let u=a?.parentElement||a,c=Ae.from(u.getBoundingClientRect());c.top-=za,c.left-=za,c.width+=2*za,c.height+=2*za,e.show(l.id,s,{constrainTo:Or(t()),id:"filter-operator-menu",alignTo:c,alignPosition:[["TopLeft","BottomLeft"],["TopRight","BottomRight"]]}),o.contextMenuVisibleFor=null,o.cellContextMenuVisibleFor=null,o.columnMenuVisibleForColumnId=null,o.filterOperatorMenuVisibleForColumnId=l.id}}import{useMemo as CP}from"react";function Jn(){let{getState:n,menuPortalContainer:e}=ee(r=>({getState:r.getState,menuPortalContainer:r.state.menuPortalContainer})),{portalDOMRef:t}=qr(r=>({portalDOMRef:r.getMasterState().portalDOMRef}))||{},o=t?.current;return CP(()=>yS(n,e,o),[n,e,o])}function xS(){let n=Ge(),{columnMenuVisibleForColumnId:e,columnMenuVisibleKey:t}=ee(a=>({columnMenuVisibleForColumnId:a.state.columnMenuVisibleForColumnId,columnMenuVisibleKey:a.state.columnMenuVisibleKey})),{showOverlay:o,portal:r,clearAll:i}=ln({portalContainer:Jn()});return DS(()=>n.getState().onColumnMenuClick.onChange(CS(n)),[]),DS(()=>IS(n,{clearAll:i,show:(a,l,s)=>o(()=>gS(a,n,l),s)}),[e,t]),{menuPortal:r}}import*as MS from"react";import{useCallback as IP}from"react";var RP={width:0,height:0,overflow:"hidden",pointerEvents:"none",outline:"none",zIndex:-1};function ES(){let{getState:n,api:e,actions:t,getComputed:o,dataSourceApi:r,dataSourceActions:i}=Ge(),{getDataSourceState:a,getDataSourceMasterContext:l}=Wt(),{focusDetectDOMRef:s}=n(),u=IP(async()=>{my({getDataSourceState:a,getDataSourceMasterContext:l,getComputed:o,actions:t,dataSourceActions:i,api:e,getState:n,dataSourceApi:r})},[]);return MS.createElement("div",{onFocus:u,ref:s,tabIndex:0,style:RP})}import{useEffect as Nr}from"react";function wP(){let n=Ge(),{getState:e,editingCell:t}=ee(r=>({getState:r.getState,editingCell:r.state.editingCell})),o=t&&!t.active?t.cancelled:void 0;Nr(()=>{if(o){let{onEditCancelled:r}=e(),i=e().editingCell;if(!r)return;let a=Tr(n,i);if(!a){Cr("onEditCancelled",i);return}r({...a,initialValue:i.initialValue})}},[o])}function vP(){let n=Ge(),{getState:e,editingCell:t}=ee(r=>({getState:r.getState,editingCell:r.state.editingCell})),o=t&&!t.active&&t.accepted instanceof Error?t.accepted:void 0;Nr(()=>{if(o){let{onEditRejected:r}=e(),i=e().editingCell;if(!r)return;let a=Tr(n,i);if(!a){Cr("onEditRejected",i);return}r({...a,value:i.value,error:o,initialValue:i.initialValue})}},[o])}function PP(){let n=Ge(),{editingCell:e}=ee(r=>({editingCell:r.state.editingCell})),t=e?.active,o=Nn(t);Nr(()=>{!t&&o&&n.api.focus()},[t,o])}function DP(){let n=Ge(),{editingCell:e,getState:t}=ee(r=>({editingCell:r.state.editingCell,getState:r.getState})),o=e&&!e.active&&!e.cancelled&&e.accepted===!0;Nr(()=>{if(o){let{onEditAccepted:r}=t(),i=t().editingCell,{value:a,initialValue:l}=i;if(r){let s=Tr(n,i);s?r({...s,value:a,initialValue:l}):Cr("onEditAccepted",i)}n.api.persistEdit({value:a})}},[o])}function xP(){let n=Ge(),{editingCell:e,getState:t}=ee(r=>({editingCell:r.state.editingCell,getState:r.getState})),o=e?e.persisted:void 0;Nr(()=>{if(o){let{editingCell:r,onEditPersistError:i,onEditPersistSuccess:a}=t();if(!r)return;let l=o instanceof Error?"onEditPersistError":"onEditPersistSuccess";if(!t()[l])return;let s=Tr(n,r);if(!s){Cr(l,r);return}let u={...s,value:r.value,initialValue:r.initialValue};o instanceof Error?i?.({...u,error:o}):a?.(u)}},[o])}function AS(){wP(),vP(),DP(),xP(),PP()}import{useEffect as FS}from"react";import*as _n from"react";import*as xu from"react";var Va=n=>xu.createElement(ke,{...n,icon:"clear"},xu.createElement("path",{d:ze.clear[0]}));import*as Mu from"react";var _S=n=>Mu.createElement(ke,{...n,icon:"done"},Mu.createElement("path",{d:ze.done[0]}));function OS(n,e,t){let o=e.getState().components?.Menu??sn,r=sS(n,e,t,{renderOperatorIcon:i=>{let a=i.components?.Icon??po;return _n.createElement(a,null)},renderOperatorLabel:i=>_n.createElement(_n.Fragment,null,i),renderClearIcon:()=>_n.createElement(Va,null),renderDoneIcon:()=>_n.createElement(_S,{size:16})});return r?_n.createElement(o,{...r}):null}function NS(){let n=Ge(),{getState:e,actions:t}=n,{showOverlay:o,portal:r,clearAll:i}=ln({portalContainer:Jn()});return FS(()=>e().onFilterOperatorMenuClick.onChange(PS(n,{clearAll:i,show:(a,l,s)=>o(()=>OS(a,n,l),s)})),[]),FS(()=>Fr(e().filterOperatorMenuVisibleForColumnId,i,()=>{t.filterOperatorMenuVisibleForColumnId=null}),[e().filterOperatorMenuVisibleForColumnId]),{menuPortal:r}}import{useEffect as Ga}from"react";import*as kS from"react";import*as Eu from"react";function LS(n,e,t){if(!n)return null;let o=ye();return n.then(r=>{let i=iS(r,e);i&&o(Eu.createElement(t,{...i}))}),Eu.createElement(vn,{updater:o})}function zS(n){let e=n.getState().components?.Menu??sn;return{renderMenu:t=>kS.createElement(e,{...t}),renderLazyMenu:(t,o)=>LS(t,o,e)}}function VS(n,e,t){return cS(n,e,t,zS(e))}function GS(n,e,t){return dS(n,e,t,zS(e))}function HS(){let n=Ge(),{getState:e,actions:t}=n,{showOverlay:o,portal:r,clearAll:i}=ln({portalContainer:Jn()});return Ga(()=>e().cellContextMenu.onChange(wS(n,{clearAll:i,getContent:(a,l)=>VS(a,n,l),show:({menu:a},l)=>o(a,l)})),[]),Ga(()=>Fr(e().cellContextMenuVisibleFor,i,()=>{t.cellContextMenuVisibleFor=null}),[e().cellContextMenuVisibleFor]),{menuPortal:r}}function KS(){let n=Ge(),{getState:e,actions:t}=n,{showOverlay:o,portal:r,clearAll:i}=ln({portalContainer:Jn()});return Ga(()=>e().contextMenu.onChange(vS(n,{clearAll:i,getContent:(a,l)=>GS(a,n,l),show:({menu:a},l)=>o(a,l)})),[]),Ga(()=>Fr(e().contextMenuVisibleFor,i,()=>{t.contextMenuVisibleFor=null}),[e().contextMenuVisibleFor]),{menuPortal:r}}import{useRef as AP}from"react";import*as BS from"react";import{useCallback as MP,useEffect as EP}from"react";function Au(n,e){let{brain:t}=ee(r=>({brain:r.state.brain})),o=MP(n,e);EP(()=>t.onScroll(o),[t,o])}var _u="yzx0vj0";function WS(n){let{width:e,maxWidth:t,minWidth:o,scrollable:r,...i}=n,a=AP(null);Au(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=pe.runtime.totalVisibleColumnsWidthValue:e==="viewport"&&(l.width=pe.runtime.bodyWidth),o==="column"?l.minWidth=pe.runtime.totalVisibleColumnsWidthValue:o==="viewport"&&(l.minWidth=pe.runtime.bodyWidth),t==="column"?l.maxWidth=pe.runtime.totalVisibleColumnsWidthValue:t==="viewport"&&(l.maxWidth=pe.runtime.bodyWidth),BS.createElement("div",{ref:a,...i,className:i.className?U(i.className,_u):_u,style:l},i.children)}var _P=$(Y.columnWidthAtIndex),OP=$(Y.columnOffsetAtIndex);function FP(){let{computedVisibleColumns:n}=ee(e=>({computedVisibleColumns:e.computed.computedVisibleColumns}));return n.map(e=>({id:e.id,width:e.computedWidth,cssVarForWidth:`var(${_P}-${e.computedVisibleIndex})`,offset:e.computedOffset,cssVarForOffset:`var(${OP}-${e.computedVisibleIndex})`,pinned:e.computedPinned}))}var Ha="InfiniteTable";import{useEffect as NP}from"react";function jS(){let{getState:n,actions:e,dataSourceActions:t,getDataSourceState:o}=ee(c=>({getState:c.getState,actions:c.actions,dataSourceActions:c.dataSourceActions,getDataSourceState:c.getDataSourceState})),{groupBy:r,isTree:i}=o(),a=n(),{brain:l,wrapRowsHorizontally:s}=a,u=a.repeatWrappedGroupRows;s||(u=!1),NP(()=>{if(!s){o().repeatWrappedGroupRows&&(t.repeatWrappedGroupRows=!1);return}let c=()=>{let{rowsPerPage:f,repeatWrappedGroupRows:m}=o(),g=!1,h=l.rowsPerPage,S=(r&&r.length>0||i)&&h>0?h:null;return f!=S&&(t.rowsPerPage=S,g=!0),m!=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])}import{useEffect as Ka,useRef as KP}from"react";function LP(){let n=[],e=t=>{Object.keys(t).forEach(o=>{let r=t[o];if(typeof r=="string"){let i=$(r);if(i.includes("dont-override"))return;n.push(i)}else r&&typeof r=="object"&&e(r)})};return e({...pe,loaded:void 0,runtime:void 0}),n}function US(n){if(!n)return{};let e=LP(),t=getComputedStyle(n),o={};return e.forEach(r=>{o[r]=t.getPropertyValue(r).trim()}),o}var Lr=ge({defaultClassName:"_143ofgf0",variantClassNames:{active:{true:"_143ofgf1",false:"_143ofgf2"}},defaultVariants:{},compoundVariants:[]}),$S="_143ofgf5",YS="_143ofgf3";var kP=$(pe.loaded),Ou={source:"infinite-table-page",target:"infinite-table-devtools-background"};function qS(n,e){let{type:t,debugId:o}=n;if(t==="unmount")return{...Ou,url:Fu(),type:t,payload:{debugId:o}};let r=e,i=r.getComputed(),a=r.getDataSourceState(),l=r.getState();return{...Ou,url:Fu(),type:t,payload:{debugId:o,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:US(l.domRef.current),themeVarOverrides:{...Ut.get(o)||{}}}}}var Fu=dt(function(){let n=new URL(window.location.href);return n.origin+n.pathname});function zP(n){window.postMessage(n)}var VP=dt(()=>{console.log("Infinite Table DevTools detected!");let n=(e,t)=>{if(t){gt.set(e,t);let{devToolsDetected:o}=t.getState();o||(t.actions.devToolsDetected=!0);let r=t.getDataSourceState();r.debugId!==e&&(t.dataSourceActions.debugId=e),r.devToolsDetected||(t.dataSourceActions.devToolsDetected=!0),window.postMessage(qS({type:"update",debugId:e},t))}else sh(e),window.postMessage(qS({type:"unmount",debugId:e},null))};return window.__INFINITE_TABLE_DEVTOOLS_HOOK__=n,Xe.onLogIntent("IT:*",e=>{zP({...Ou,url:Fu(),type:"log",payload:{debugId:void 0,channel:e.channel,color:e.color,args:e.args.map(t=>{if(typeof t=="object"&&t!==null){let o="";try{o=JSON.stringify(t)}catch{console.error("Cannot stringify arg in global log interceptor",t)}return o}return String(t)}),timestamp:e.timestamp}})}),n}),Nu=ye(),GP={revertAll:n=>{let e=gt.get(n.debugId);if(e){let t=En.get(n.debugId);En.delete(n.debugId),nn.delete(n.debugId),t&&Object.keys(t).forEach(r=>{e.actions[r]=t[r],delete t[r]});let o=rn.get(n.debugId);rn.delete(n.debugId),on.delete(n.debugId),o&&Object.keys(o).forEach(r=>{e.dataSourceActions[r]=o[r],delete o[r]})}},revertProperty:n=>{let e=gt.get(n.debugId);if(e){let t=n.property,o=nn.get(n.debugId),r=En.get(n.debugId),i=on.get(n.debugId),a=rn.get(n.debugId),l=t;r&&o&&o[l]!==void 0&&(delete o[l],e.actions[l]=r[l],delete r[l]);let s=t;if(a&&i&&i[s]!==void 0){let u=rn.get(n.debugId)||{};delete i[s],e.dataSourceActions[s]=u[s],delete u[s]}}},discardWarning:n=>{let e=gt.get(n.debugId);if(e){let t=n.warning,o=e.getDataSourceState().debugWarnings;if(o.get(t))o.delete(t),An(n.debugId);else{let i=n.warning,a=e.getState().debugWarnings;a.get(i)&&(a.delete(i),An(n.debugId))}}},discardAllWarnings:n=>{let e=gt.get(n.debugId);e&&(e.getDataSourceState().debugWarnings.clear(),e.getState().debugWarnings.clear(),An(n.debugId))},setColumnVisibility:n=>{nu(n.debugId,"columnVisibility",n.columnVisibility)},setGroupBy:n=>{Ta(n.debugId,"groupBy",n.groupBy)},setGroupRenderStrategy:n=>{nu(n.debugId,"groupRenderStrategy",n.groupRenderStrategy)},setSortInfo:n=>{Ta(n.debugId,"sortInfo",n.sortInfo)},setMultiSort:n=>{Ta(n.debugId,"multiSort",n.multiSort)},setCssVar:n=>{let e=gt.get(n.debugId),t=e?.getState().domRef.current;!e||!t||!n.name?.startsWith("--infinite-")||(t.style.setProperty(n.name,n.value),Ut.set(n.debugId,{...Ut.get(n.debugId)||{},[n.name]:n.value}),An(n.debugId))},revertCssVar:n=>{let e=gt.get(n.debugId),t=e?.getState().domRef.current;if(!e||!t)return;t.style.removeProperty(n.name);let o={...Ut.get(n.debugId)||{}};delete o[n.name],Ut.set(n.debugId,o),An(n.debugId)},revertAllCssVars:n=>{let e=gt.get(n.debugId),t=e?.getState().domRef.current;if(!e||!t)return;let o=Ut.get(n.debugId)||{};Object.keys(o).forEach(r=>{t.style.removeProperty(r)}),Ut.delete(n.debugId),An(n.debugId)},highlight:n=>{let e=gt.get(n.debugId);if(e){let t=e.getState().domRef.current;if(t){let o=t.getBoundingClientRect(),r=document.querySelector(`.${Lr.classNames.base}`);r||(r=document.createElement("div"),r.classList.add(Lr.classNames.base),r.innerHTML=[`<div class="${YS}"></div>`,`<div class="${$S}"></div>`].join(""),document.body.appendChild(r));let i=r.firstElementChild;if(r){r.style.left=`${o.left}px`,r.style.top=`${o.top}px`,r.style.width=`${o.width}px`,r.style.height=`${o.height}px`,i.innerHTML=n.debugId;let a=r.lastElementChild,l=()=>{r.classList.remove(Lr.classNames.variants.active.true),a.removeEventListener("animationend",l)};a.addEventListener("animationend",l),r.classList.add(Lr.classNames.variants.active.true)}}}}};function HP(){typeof window<"u"&&window.addEventListener("message",n=>{if(n&&n.data&&typeof n.data.source=="string"&&typeof n.data.target=="string"&&n.data.target==="infinite-table-page"&&n.data.source.startsWith("infinite-table-devtools-contentscript")&&(window.__INFINITE_TABLE_DEVTOOLS_HOOK__||(VP(),Nu(window.__INFINITE_TABLE_DEVTOOLS_HOOK__)),typeof n.data.type=="string")){let e=n.data.type,t=GP[e];t&&t(n.data.payload)}})}HP();function XS(n,e){if(!e)return;getComputedStyle(e).getPropertyValue(kP)!==`${di}`&&Ir({debugId:n,key:"CSS001_CSS"})}function Lu(){return Nu.get()}function ZS(n){return Nu.onChange(e=>{e&&n(e)})}function QS(n){let e=globalThis.__INFINITE_TABLE_DEVTOOLS_HOOK__;e&&e(n,null)}function JS(){let{getState:n,getDataSourceState:e,dataSourceActions:t}=ee(a=>({getState:a.getState,getDataSourceState:a.getDataSourceState,dataSourceActions:a.dataSourceActions})),o=n(),{domRef:r,debugId:i}=o;return i&&XS(i,r.current),Ka(()=>{e().debugId!==i&&(t.debugId=i)},[i]),BP()}function BP(){let{getState:n,getComputed:e,getDataSourceState:t,dataSourceActions:o,actions:r,dataSourceApi:i,api:a}=ee(c=>({getState:c.getState,getComputed:c.getComputed,getDataSourceState:c.getDataSourceState,dataSourceActions:c.dataSourceActions,actions:c.actions,dataSourceApi:c.dataSourceApi,api:c.api})),s=n().debugId,u=KP(s);return u.current=s,Ka(()=>{let c=u.current;if(!c)return;let d=f=>{f(c,{getState:n,getDataSourceState:t,getComputed:e,dataSourceActions:o,actions:r,api:a,dataSourceApi:i})},p=Lu();if(p){d(p);return}return ZS(d)},[]),Ka(()=>{let c=u.current;if(!c)return;let d=Lu();d&&d(c,{getState:n,getDataSourceState:t,getComputed:e,dataSourceActions:o,actions:r,api:a,dataSourceApi:i})}),Ka(()=>{if(s)return()=>{QS(s)}},[s]),s}function WP(){let{masterPortalDOMRef:n}=qr(o=>({masterPortalDOMRef:o.getMasterState().portalDOMRef}))??{},e=ee(o=>o.state.portalDOMRef);return n?.current??e?.current}import*as vt from"react";import{useCallback as jP,useMemo as UP}from"react";var eb="hs68h8j _16lm1iwk _16lm1iwx _16lm1iw2n",tb=ge({defaultClassName:"hs68h8e _16lm1iw1x _16lm1iw2j _16lm1iw1p",variantClassNames:{active:{true:"hs68h8f _16lm1iwn _16lm1iw1h",false:"_16lm1iwo"},draggingInProgress:{true:"hs68h8h",false:"hs68h8i"}},defaultVariants:{},compoundVariants:[]}),nb="hs68h81",ob=ge({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"]]});import*as eo from"react";function rb(n){return eo.createElement("div",{...n.domProps})}function ib(n){let{active:e}=n;return eo.createElement("div",{className:nb},e?"Drop to group":"Drag columns to group")}function ab(n){let e=t=>{(t.key==="Enter"||t.key===" ")&&(t.preventDefault(),n.onClear?.())};return eo.createElement("div",{...n.domProps},n.label,eo.createElement("div",{className:Zr[1]}),eo.createElement("div",{tabIndex:0,role:"button","aria-label":`Clear grouping by ${n.field}`,className:eb,onKeyDown:e,onMouseDown:n.onClear},eo.createElement(Va,{size:20})))}var $P=(n,e)=>t=>{e&&e(t);let o=Date.now(),r=!1,i=()=>{r=!0};_e().addEventListener("mousemove",i,{once:!0}),_e().addEventListener("mouseup",()=>{r||(_e().removeEventListener("mousemove",i),Date.now()-o<200&&requestAnimationFrame(()=>{n()}))},{once:!0})};function YP(n){let{column:e,onClear:t,components:o,field:r,id:i,toggleSorting:a}=n,{dragSourceListId:l,dragItemId:s,dragListId:u}=Eo(),c=l===u,d=Ge(),p=(e?mo(e.id,d,"grouping-toolbar"):r)??i,f=e?vt.createElement(Oi,{forceSize:!0,size:20,direction:e.computedSortedAsc?1:e.computedSortedDesc?-1:0}):null,m=vt.createElement(vt.Fragment,null,p,f),g=s===i&&l===u,h=U(tb({draggingInProgress:c,active:g}),n.domProps?.className),S=$P(a,n.domProps?.onMouseDown),y={...n.domProps,className:h,onMouseDown:S},C=o?.ToolbarItem??ab;return vt.createElement(C,{active:g,domProps:y,column:e,field:r,label:m,onClear:t})}function lb(n){let{groupBy:e}=Fe(b=>({groupBy:b.dataSourceState.groupBy})),{getComputed:t,dataSourceApi:o,api:r}=ee(b=>({getComputed:b.getComputed,dataSourceApi:b.dataSourceApi,api:b.api})),{dropTargetListId:i,dragSourceListId:a}=Sn(),{fieldsToColumn:l,computedColumnsMap:s}=t(),u=Hn(Si),c=Hn(yi),d=UP(()=>[c,u],[c,u]),p=i===u,f=a===u,m=n.components?.Placeholder??ib,g=n.components?.Host??rb,h=e.length?vt.createElement(vt.Fragment,null,e.map((b,R)=>{let w=b.field?l.get(b.field):void 0,v=`${b.field??`idx-${R}`}`;return vt.createElement(Un.DraggableItem,{key:v,id:v},P=>vt.createElement(YP,{id:v,components:n.components,domProps:P,field:b.field,column:w,toggleSorting:()=>{w&&r.toggleSortingForColumn(w.id)},onClear:()=>{let x=e.filter(M=>M!==b).filter(Boolean);o.setGroupBy(x)}}))})):vt.createElement(m,{draggingInProgress:f,active:p,groupBy:e}),S=b=>{let R=b.map(w=>e[w]);o.setGroupBy(R)},y=b=>{let{dragItemId:R}=b,w=R,v=s.get(w);if(!v||!v.field||!v.computedGroupable)return;let P=[...e];P.splice(b.dropIndex,0,{field:v.field}),o.setGroupBy(P)},C=jP(b=>{let{computedColumnsMap:R}=t(),w=b.dragItem.id,v=R.get(w);return!(!v||!v.computedGroupable||e.some(P=>P.field===v.field))},[e]),T=n.orientation??"horizontal",{domProps:I}=n;return vt.createElement(Un,{orientation:T,dragListId:u,acceptDropsFrom:d,onDrop:S,dragStrategy:"inline",onAcceptDrop:y,shouldAcceptDrop:C},(b,{draggingInProgress:R,status:w})=>{let v=U(ob({active:p,orientation:T,draggingInProgress:R,dropRejected:w==="rejected"}),b.className,I?.className),P={...b,...I,className:v,children:h};return vt.createElement(g,{active:p,rejectDrop:w==="rejected",domProps:P,orientation:T})})}import*as Ho from"react";import{useMemo as ku}from"react";import{useCallback as eD,useEffect as kr,useRef as tD}from"react";import*as Ba from"react";function sb(n){let{dataArray:e,brain:t,computedPinnedEndColumns:o,computedPinnedStartColumns:r,computedVisibleColumns:i,computedRowHeight:a,columnSize:l,rowspan:s}=n;return na(t,{colWidth:l,rowHeight:a,rows:e.length,cols:i.length,rowspan:s},{fixedColsEnd:o.length,fixedColsStart:r.length}),t}import*as un from"react";var ub=ge({defaultClassName:"evqes20",variantClassNames:{},defaultVariants:{},compoundVariants:[]});import{useMemo as pb}from"react";function qP(n,e){let{masterState:t,detailContext:o}=e,r=t.detailDataSourcesStateToRestore;if(r.has(n)){let i=r.get(n);return o.assignState(i),!0}return!1}function XP(n,e){let{detailState:t,masterState:o,masterActions:r,cacheEntryForRow:i}=e,a=new Map(o.detailDataSourcesStateToRestore),l=$g(t);i.all||(i.groupBy||delete l.groupBy,i.sortInfo||delete l.sortInfo,i.filterValue||delete l.filterValue,i.data||delete l.originalDataArray),a.set(n,l),r.detailDataSourcesStateToRestore=a}function cb(n,e){let t={current:!1};return{currentRowCache:{getRowId:()=>n,add:r=>{t.current=!0,e.add(n,r)},get:()=>e.get(n),delete:()=>(t.current=!0,e.delete(n)),has:()=>e.has(n)},cacheCalledByRowDetailRenderer:t}}function db(n){let{rowInfo:e,currentRowCache:t,cacheCalledByRowDetailRenderer:o,getMasterDataSourceState:r,masterActions:i,getMasterState:a}=n,l=r().detailDataSourcesStateToRestore.has(e.id)&&t.has(),u={registerDetail:dt(c=>{if(o.current||t.add({all:!0}),!t.has()){requestAnimationFrame(()=>{c.dataSourceState.destroyedRef.current||(c.dataSourceActions.stateReadyAsDetails=!0)});return}qP(e.id,{masterState:r(),detailContext:c}),requestAnimationFrame(()=>{c.dataSourceState.destroyedRef.current||(c.dataSourceActions.stateReadyAsDetails=!0)}),c.dataSourceState.onCleanup.onChange(()=>{let d=t.get();d&&XP(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 fb(n){let{rowDetailsCache:e,rowInfo:t}=n,{getDataSourceState:o,dataSourceActions:r}=Fe(u=>({getDataSourceState:u.getDataSourceState,dataSourceActions:u.dataSourceActions})),{getMasterState:i}=ee(u=>({getMasterState:u.getState})),{currentRowCache:a,cacheCalledByRowDetailRenderer:l}=pb(()=>cb(t.id,e),[e,t.id]),s=pb(()=>db({rowInfo:t,currentRowCache:a,cacheCalledByRowDetailRenderer:l,getMasterDataSourceState:o,masterActions:r,getMasterState:i}),[t.id,a]);return s.masterRowInfo=t,s.getMasterDataSourceState=o,s.getMasterState=i,{masterDetailContextValue:s,currentRowCache:a}}function mb(){return fn()}var{rootClassName:ZP}=Le,QP=`${ZP}RowDetail`;function JP(n){let{domRef:e,rowDetailRenderer:t,rowDetailHeight:o,rowInfo:r,detailOffset:i,rowDetailsCache:a}=n,{masterDetailContextValue:l,currentRowCache:s}=fb({rowDetailsCache:a,rowInfo:r}),u=ao(),[c]=un.useState(()=>mb());return c.setSnapshot(l),un.useLayoutEffect(()=>{c.notify()},[l]),un.createElement(u.Provider,{value:c},un.createElement("div",{ref:e,className:U(QP,ub({})),style:{position:"absolute",top:`${i}px`,left:0,width:`calc(${Y.bodyWidth} - ${Y.scrollbarWidthVertical})`,height:o}},t(r,s)))}var gb=un.memo(JP);var nD=1;function hb(n){let{computed:e,bodySize:t,imperativeApi:o}=n,{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:h,isRowDetailsEnabled:S,cellClassName:y,cellStyle:C,repaintCellsKey:T,rowStyle:I,rowDetailCache:b,rowClassName:R,onScrollToTop:w,onScrollToBottom:v,onScrollStop:P,scrollToBottomOffset:x,wrapRowsHorizontally:M,updatedAt:D,ready:E,editingCell:z}=ee(O=>({actions:O.actions,getState:O.getState,getComputed:O.getComputed,getDataSourceMasterContext:O.getDataSourceMasterContext,rowHeight:O.state.rowHeight,rowDetailHeight:O.state.rowDetailHeight,onRowMouseEnter:O.state.onRowMouseEnter,onRowMouseLeave:O.state.onRowMouseLeave,groupRenderStrategy:O.state.groupRenderStrategy,brain:O.state.brain,showZebraRows:O.state.showZebraRows,rowDetailRenderer:O.state.rowDetailRenderer,isRowDetailsExpanded:O.state.isRowDetailExpanded,isRowDetailsEnabled:O.state.isRowDetailEnabled,cellClassName:O.state.cellClassName,cellStyle:O.state.cellStyle,repaintCellsKey:O.state.repaintCellsKey,rowStyle:O.state.rowStyle,rowDetailCache:O.state.rowDetailCache,rowClassName:O.state.rowClassName,onScrollToTop:O.state.onScrollToTop,onScrollToBottom:O.state.onScrollToBottom,onScrollStop:O.state.onScrollStop,scrollToBottomOffset:O.state.scrollToBottomOffset,wrapRowsHorizontally:O.state.wrapRowsHorizontally,updatedAt:O.state.updatedAt,ready:O.state.ready,editingCell:O.state.editingCell})),{computedPinnedStartColumns:V,computedPinnedEndColumns:N,computedVisibleColumns:L,computedColumnsMap:F,computedColumnOrder:K,computedRowHeight:q,computedRowSizeCacheForDetails:_,fieldsToColumn:k,rowspan:H,toggleGroupRow:Z,columnSize:Ce}=e,le=ku(()=>L.map(O=>O.id),[L]),{dataArray:fe,rowInfoStore:we,selectionMode:ve,cellSelection:ue,isNodeReadOnly:ne,getDataSourceState:se,dataSourceApi:de,dataSourceActions:X}=Fe(O=>({dataSourceApi:O.dataSourceApi,dataSourceActions:O.dataSourceActions,getDataSourceState:O.getDataSourceState,dataArray:O.dataSourceState.dataArray,rowInfoStore:O.dataSourceState.rowInfoStore,selectionMode:O.dataSourceState.selectionMode,cellSelection:O.dataSourceState.cellSelection,isNodeReadOnly:O.dataSourceState.isNodeReadOnly})),Q=Ne(fe);sb({columnSize:Ce,brain:f,computedPinnedStartColumns:V,computedPinnedEndColumns:N,computedVisibleColumns:L,computedRowHeight:q,dataArray:fe,bodySize:t,rowspan:H});let B=tD(0);kr(()=>f.onRenderCountChange(()=>{B.current=f.scrollTopMax}),[f]),kr(()=>f.onRenderRangeChange(O=>{i().onRenderRangeChange?.(O)}),[f]),kr(()=>f.onScrollStop(O=>{let{scrollTop:A,scrollLeft:ce}=O;if(A===0&&w?.(),A+(x??nD)>=B.current){v?.();let{livePagination:Se,livePaginationCursor:xe,dataArray:Ue}=se();Se&&(X.cursorId=xe!==void 0?Date.now():Ue.length)}if(P){let Se=f.getRenderRange();P({scrollTop:A,scrollLeft:ce,renderRange:Se,viewportSize:i().bodySize,firstVisibleRowIndex:Se.start[0],lastVisibleRowIndex:Se.end[0],firstVisibleColIndex:Se.start[1],lastVisibleColIndex:Se.end[1]})}}),[f,w,v,P]),kr(()=>{t.height&&(r.ready=!0)},[!!t.height]),kr(()=>{let{onReady:O}=i();O&&O({api:o,dataSourceApi:de})},[E]);let re=ku(()=>({isNodeReadOnly:ne,selectionMode:ve,cellSelection:ue}),[ne,ve,ue]),te=eD(O=>{let{rowIndex:A,colIndex:ce,heightWithRowspan:he,domRef:Re,hidden:Se,width:xe,onMouseLeave:Ue,onMouseEnter:Ke}=O,nt=Q()[A],Ze=L[ce];if(!nt||!Ze)return null;let $e=_?_.getRowHeight(A):he,G=!1;!S||typeof S=="function"&&!S(nt)?G=!1:h&&(G=h(nt)?"expanded":"collapsed");let J=M?f.getRowIndexInPage(A):null,me=M?f.getPageIndexForRow(A):null,be=o.isEditorVisibleForCell({rowIndex:A,columnId:Ze.id}),at={getData:Q,virtualized:!0,showZebraRows:m,groupRenderStrategy:p,rowIndexInHorizontalLayoutPage:J,horizontalLayoutPageIndex:me,rowIndex:A,rowInfoStore:we,hidden:Se,toggleGroupRow:Z,rowHeight:$e,rowDetailState:G,onMouseEnter:Ke,onMouseLeave:Ue,onRowMouseEnter:c,onRowMouseLeave:d,domRef:Re,width:xe,column:Ze,columnsMap:F,fieldsToColumn:k,rowStyle:I,rowClassName:R,cellStyle:C,cellClassName:y,repaintCellsKey:Ze.repaintCellsKey!==void 0?Ze.repaintCellsKey:T,visibleColumnIds:le,computedColumnOrder:K,inEditMode:be,getDataSourceState:se,dataSourceApi:de,dataSourceActions:X,getState:i,imperativeApi:o,componentActions:r,getComputed:a,getDataSourceMasterContext:l,dataSourceStatePartialForCell:re};return Ba.createElement(sf,{...at})},[s,u,c,d,_,q,h,Q,L,F,k,p,M,Z,m,f,we,I,R,y,C,T,se,de,X,i,o,r,a,l,le,K,D,z,re]),ae=ku(()=>{if(h)return O=>{let{rowIndex:A,domRef:ce}=O,Re=Q()[A];if(!Re||!h(Re)||!_)return Ba.createElement("div",{ref:ce,className:Nc.hidden});let{rowDetailHeight:Se,rowHeight:xe}=_.getSize(A);return Ba.createElement(gb,{rowInfo:Re,rowDetailsCache:b,rowIndex:A,domRef:ce,detailOffset:xe,rowDetailHeight:Se,rowDetailRenderer:g})}},[E,te,g,u,h,b]);return{renderCell:te,renderDetailRow:ae}}import{useEffect as oD}from"react";function yb(){let{state:n,getState:e,actions:t}=ee(i=>({state:i.state,getState:i.getState,actions:i.actions})),{wrapRowsHorizontally:o}=n,r=Nn(o);oD(()=>{if(r!==o){let{brain:i,headerBrain:a,renderer:l,onRenderUpdater:s}=e();i.destroy(),a.destroy(),l.destroy(),s.destroy();let u=du(Ha,!!o);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,o])}import*as Tb from"react";var Sb="_16lm1iw1 _16lm1iw1c _16lm1iwe";var bb=U(Sb,Ul);function Cb(n){return Tb.createElement("div",{...n,className:n.className?U(bb,n.className):bb})}import*as Go from"react";var Ib={visible:"qy58ya1 qy58ya0 _16lm1iw2 _16lm1iw23 _16lm1iw26 _16lm1iw2c _16lm1iw2a",hidden:"qy58ya2 qy58ya0 _16lm1iw2 _16lm1iw23 _16lm1iw26 _16lm1iw2c _16lm1iw2a"},Rb="qy58ya3 _16lm1iw2 _16lm1iw23 _16lm1iw26 _16lm1iw2c _16lm1iw2a",wb="qy58ya4";var{rootClassName:rD}=Le,zu=`${rD}-LoadMask`;function iD(n){let{visible:e,children:t="Loading"}=n;return Go.createElement("div",{className:`${Ib[e?"visible":"hidden"]} ${zu}`},Go.createElement("div",{className:`${Rb} ${zu}-Overlay`}),Go.createElement("div",{className:`${wb} ${zu}-Text`},t))}var Wa=Go.memo(iD);import{useMemo as aD}from"react";var lD=[Qp,`${Bt}--hovered`];function sD(n){return Array.isArray(n)&&(n=n.join(" ")),n.split(" ").map(e=>e.trim()).filter(Boolean)}function to(n){let e=Ge(),t=Fn(),{getComputed:o,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:h,activeCellIndex:S,rowDetailRenderer:y,showHoverRows:C,wrapRowsHorizontally:T,domProps:I,domRef:b,forceBodyRerenderTimestamp:R,rowHoverClassName:w,ready:v}=ee(_=>({ready:_.state.ready,columnReorderDragColumnId:_.state.columnReorderDragColumnId,forceBodyRerenderTimestamp:_.state.forceBodyRerenderTimestamp,renderer:_.state.renderer,onRenderUpdater:_.state.onRenderUpdater,debugId:_.state.debugId,keyboardNavigation:_.state.keyboardNavigation,activeRowIndex:_.state.activeRowIndex,loadingText:_.state.loadingText,scrollStopDelay:_.state.scrollStopDelay,brain:_.state.brain,scrollerDOMRef:_.state.scrollerDOMRef,components:_.state.components,bodySize:_.state.bodySize,activeCellIndex:_.state.activeCellIndex,rowDetailRenderer:_.state.rowDetailRenderer,showHoverRows:_.state.showHoverRows,wrapRowsHorizontally:_.state.wrapRowsHorizontally,domProps:_.state.domProps,domRef:_.state.domRef,rowHoverClassName:_.state.rowHoverClassName})),P=g?.LoadMask??Wa,x=o(),{computedRowHeight:M,computedRowSizeCacheForDetails:D}=x,E=D?.getRowHeight||M,{loading:z}=Fe(_=>({loading:_.dataSourceState.loading})),V=Ho.useCallback(_=>{let k=e.getState(),H=_.target;if(!t&&_._from_row_detail)return;t&&(_._from_row_detail=!0);let Z=kd(H,cu(),k.domRef.current),Ce,le,fe,we;Z&&(le=Number(Z.dataset.colIndex),we=Number(Z.dataset.rowIndex),Ce=e.getComputed().computedVisibleColumns[le].id,fe=e.dataSourceApi.getRowInfoArray()[we].id);let ve={columnId:Ce,colIndex:le,rowId:fe,rowIndex:we,event:_,target:Z??_.target};Z&&k.cellContextMenu(ve),k.contextMenu(ve)},[]),{renderCell:N,renderDetailRow:L}=hb({imperativeApi:r,getComputed:o,domRef:b,bodySize:h,computed:x}),{autoFocus:F,tabIndex:K}=I??{};yb();let q=aD(()=>{if(!C)return;let _=[];return w&&(_=_.concat(w)),n.rowHoverClassName&&(_=_.concat(n.rowHoverClassName)),to.rowHoverClassName&&(_=_.concat(to.rowHoverClassName)),sD(_)},[C,w,n.rowHoverClassName,to.rowHoverClassName]);return Ho.createElement(Cb,{onContextMenu:V},Ho.createElement(xm,{forceRerenderTimestamp:R,debugId:l,tabIndex:K??0,autoFocus:F??void 0,activeRowIndex:v&&s==="row"?u:null,activeCellIndex:v&&s==="cell"&&!d?S:null,scrollStopDelay:p,renderer:i,wrapRowsHorizontally:T,onRenderUpdater:a,brain:f,activeCellRowHeight:E,renderCell:N,renderDetailRow:y?L:void 0,cellHoverClassNames:q,scrollerDOMRef:m,scrollVarHostRef:b}),Ho.createElement(P,{visible:z},c))}to.rowHoverClassName=lD;function uD(){return ee(n=>n.api)}function cD(n){return ee(e=>e.api.getColumnApi(n))}var Xt=Le.rootClassName,{ManagedComponentContextProvider:dD}=Et({initSetupState:Rh,forwardProps:wh,mapPropsToState:xh,cleanup:vh,allowedControlledPropOverrides:{rowHeight:!0,columnHeaderHeight:!0},mappedCallbacks:Dh(),getParentState:()=>Ys(n=>n),debugName:n=>Pn(n.debugId,Ha)}),pD=De.memo(function(){let e=$r(),{componentState:t,api:o,initialChildren:r}=ee(F=>({componentState:F.state,api:F.api,initialChildren:F.children})),{dataArrayLength:i,getDataSourceState:a,dataSourceActions:l,dataSourceApi:s}=Fe(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:h,columnHeaderHeightCSSVar:S,scrollStopDelay:y,brain:C,activeRowIndex:T,activeCellIndex:I}=t,{licenseKey:b}=t;b===void 0&&cn.licenseKey&&(b=cn.licenseKey),iy(T,i,o),ny(I,i,o);let{onKeyDown:R}=Iy();De.useEffect(()=>{let F=a(),K=Yt(q=>{F.notifyRenderRangeChange({renderStartIndex:q[0],renderEndIndex:q[1]})},{wait:y});return C.onVerticalRenderRangeChange(K)},[C,y]);let w=Jh(b),{autoFocus:v,tabIndex:P,...x}=t.domProps??{},M=np(x);De.useEffect(()=>{C.setScrollStopDelay(y),l.scrollStopDelayUpdatedByTable=y},[y]),Tg(),jS(),AS();let{menuPortal:D}=xS(),{menuPortal:E}=HS(),{menuPortal:z}=KS(),{menuPortal:V}=NS();De.useEffect(()=>{typeof globalThis.__DO_NOT_USE_UNLESS_YOU_KNOW_WHAT_YOURE_DOING_IS_READY=="function"&&globalThis.__DO_NOT_USE_UNLESS_YOU_KNOW_WHAT_YOURE_DOING_IS_READY(t.id,t.ready,o,{dataSourceApi:s})},[t.ready,o,s]);let N=JS();De.useEffect(()=>{if(e){let F=e.getSnapshot();c.current=F.getMasterState().portalDOMRef.current}},[]);let L=r??De.createElement(De.Fragment,null,De.createElement(_s,null),De.createElement(to,null));return De.createElement("div",{"data-debug-id":N,onKeyDown:R,ref:u,...M},L,De.createElement("div",{ref:c,className:U(`${pt}Portal`,Lc[1e7],Qr.absolute,Oc[0],Ec[0])},D,E,z,V),g?De.createElement($o,{key:"row-height",varName:g,onChange:d}):null,De.createElement($o,{key:"flashing-duration",allowInts:!0,varName:pe.components.Cell.flashingDuration,onChange:p}),h?De.createElement($o,{key:"row-detail-height",varName:h,onChange:f}):null,S?De.createElement($o,{key:"column-header-height",varName:S,onChange:m}):null,w==="valid"?null:De.createElement(eg,{invalid:w==="invalid"}),De.createElement(ES,null))});function fD({children:n,store:e}){let{componentActions:t,componentState:o}=At(),{scrollerDOMRef:r,scrollTopKey:i}=o,a=Ne(o),l=$h({state:o,actions:t,getState:a}),s=Ne(l),u=$r(),{getDataSourceState:c,dataSourceActions:d,getDataSourceMasterContext:p,dataSourceApi:f}=Wt(),[m]=De.useState(()=>yg({getComputed:s,getState:a,getDataSourceState:c,getDataSourceMasterContext:p,dataSourceApi:f,actions:t,dataSourceActions:d})),g={actions:t,state:o,computed:l,dataSourceActions:d,getDataSourceMasterContext:p,getDataSourceState:c,getComputed:s,getState:a,api:m,dataSourceApi:f,children:n};return e.setSnapshot(g),De.useLayoutEffect(()=>{e.notify()}),Hr(r,h=>{let S={width:h.width,height:h.height};t.bodySize=S},{earlyAttach:!0,debounce:50}),De.useEffect(()=>{r.current&&(r.current.scrollTop=0)},[i,r]),De.createElement(pD,null)}var cn=function(n){let[e]=De.useState(()=>ay()),t=ai();return De.createElement(dD,{repeatWrappedGroupRows:!!n.wrapRowsHorizontally,rowHeight:Mr,columnHeaderHeight:xr,...n},De.createElement(jl,null,De.createElement(t.Provider,{value:e},De.createElement(fD,{children:n.children,store:e}))))};cn.Header=_s;cn.Body=to;cn.HScrollSyncContent=WS;cn.Footer=()=>De.createElement(zc,null);cn.GroupingToolbar=lb;import*as vb from"react";function $8(n){let{DataSource:e}=wr({nodesKey:"children",...n});return vb.createElement(e,null,n.children??null)}import*as Db from"react";var Pb=n=>(t,{unfilteredTreePaths:o,treeSelectionState:r,prevTreeSelectionState:i,lastUpdatedNodeInfo:a})=>{let l=new Je(i,{treePaths:o});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()};n(u)};function mD(n){return Db.createElement(cn,{...n})}var ja=class{constructor(e){this.state="idle";this.result=void 0;this.error=void 0;this.doneAt=0;this.pendingPromise=void 0;this.debugName="";this.fetch=async(e,...t)=>{this.state="loading";let o=()=>{};try{this.logger(`Fetching query ${this.debugName}...`),this.pendingPromise=new Promise(r=>{o=r}),this.result=await e(...t),this.state="success"}catch(r){this.result=void 0,this.error=r,this.state="error"}return this.doneAt=Date.now(),this.pendingPromise=void 0,o(this),this.logger(`Fetched query ${this.debugName}. State: ${this.state}.`),this.getDoneSnapshot()};this.getCurrentSnapshot=()=>{let e={state:this.state,result:this.result,doneAt:this.doneAt,error:this.error,done:this.isDone()};return e.done||(e.promise=this.pendingPromise),e};this.getDoneSnapshot=async()=>{if(this.state==="idle")throw new Error("DataQuery is still idle");return this.pendingPromise&&await this.pendingPromise,{state:this.state,result:this.result,error:this.error,done:this.isDone(),doneAt:this.doneAt}};this.getResult=()=>{if(!this.isDone())throw new Error("DataQuery is not done yet");return this.result};this.isDone=()=>this.state==="success"||this.state==="error";this.isSuccess=()=>this.state==="success";this.debugName=e||"",this.logger=Xe(`IT:${e}:DataQuery`)}};function Ko(n){if(Array.isArray(n))return n.map(Ko);if(typeof n=="object"){if(n===null)return n;let e=n,t=Object.keys(e).sort((r,i)=>r.localeCompare(i)),o={};return t.forEach(r=>{let i=e[r];i!==void 0&&(o[r]=Ko(i))}),JSON.stringify(o)}return n instanceof Date?n.toISOString():n}var dn=class dn{constructor(e){this.queryCache=new j;this.removeQueryIfErrored=(e,t)=>{if(e.getCurrentSnapshot().state!=="success"){let o=this.queryCache.get(t);if(e===o)return this.queryCache.delete(t),!0}return!1};this.fireQuery=e=>{let t=Ko(e.key),o=this.options.cache?this.queryCache.get(t):null;if(o!=null){let i=o.getCurrentSnapshot();if(i.state==="success")return{query:o,fromCache:!0};if(i.state==="loading")return{query:o,fromCache:!0};i.state==="error"&&this.removeQueryIfErrored(o,t)}let r=new ja(`${this.name}:${e.name}`);return this.queryCache.set(t,r),r.fetch(e.fn,e.key),r.getCurrentSnapshot().promise?.then(()=>{this.removeQueryIfErrored(r,t)}),{query:r,fromCache:!1}};this.query=e=>this.fireQuery(e).query.getCurrentSnapshot();this.awaitQuery=async e=>{let{query:t,fromCache:o}=this.fireQuery(e),r=t.getCurrentSnapshot();return r.promise&&(r=await t.getDoneSnapshot(),r.state==="error"&&o)?await this.fireQuery(e).query.getDoneSnapshot():r};this.isQueryInProgress=e=>{let t=Ko(e);return this.queryCache.get(t)?.getCurrentSnapshot().done??!1};this.hasQueryForKey=e=>{let t=Ko(e);return this.queryCache.has(t)};this.discardQueryForKey=e=>{let t=Ko(e);this.queryCache.delete(t)};if(this.options=e,dn.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)}dn.clients.set(e.name,this),this.name=e.name}static destroy(e){let t=dn.clients.get(e);t&&t.destroy()}static destroyAll(){dn.clients.forEach(e=>{dn.destroy(e.name)})}destroy(){dn.clients.delete(this.options.name)}};dn.clients=new Map;var xb=dn;var gD={key:"*",when:n=>{let{activeCellIndex:e}=n.getState();if(e){let[t,o]=e,r=n.api.getColumnAtIndex(o);return r?n.api.isCellEditable({rowIndex:t,columnId:r.id}):!1}return!1},handler:(n,e)=>{let{key:t}=e;if(t!="Escape"&&t.length===1){let{activeCellIndex:o}=n.getState();if(o){let[r,i]=o,a=n.api.getColumnAtIndex(i);if(!a)return;requestAnimationFrame(()=>{n.api.startEdit({rowIndex:r,value:t,columnId:a.id})})}}}},hD={instantEdit:gD};import{useEffect as Sq}from"react";function yD(n,e){let{set:t,delete:o,clear:r}=n;return e.set&&(n.set=(i,a)=>(t.call(n,i,a),e.set(i,a),n)),e.delete&&(n.delete=i=>{let a=o.call(n,i);return e.delete(i),a}),(e.clear||e.beforeClear)&&(n.clear=()=>{e.beforeClear&&e.beforeClear(n);let i=r.call(n);return e.clear&&e.clear(),i}),()=>{t&&(n.set=t),o&&(n.delete=o),r&&(n.clear=r)}}var Ua=class Ua{constructor(e,t){this.orderRefs=[];if(typeof e=="number")this.maxSize=e,this.currentSet=new Set;else if(this.maxSize=t??Ua.DEFAULT_SIZE,e){let o=Array.from(e);this.maxSize<o.length&&o.slice(o.length-this.maxSize),this.currentSet=new Set,o.forEach(r=>{this.add(r)})}else this.currentSet=new Set}values(){return this.currentSet.values()}get size(){return this.currentSet.size}delete(e){return this.currentSet.has(e)?(this.currentSet.delete(e),this.orderRefs=this.orderRefs.filter(t=>t!==e),!0):!1}has(e){return this.currentSet.has(e)}add(e){if(this.currentSet.has(e))return this;if(this.maxSize-this.currentSet.size<=0){let[o]=this.orderRefs.splice(0,1);o&&this.currentSet.delete(o)}return this.orderRefs.push(e),this.currentSet.add(e),this}};Ua.DEFAULT_SIZE=10;var Vu=Ua;var $a=class $a{constructor(e,t){this.orderRefs=[];if(typeof e=="number")this.maxSize=e,this.currentSet=new Set;else if(this.maxSize=t??$a.DEFAULT_SIZE,e){let o=Array.from(e);this.maxSize<o.length&&o.slice(o.length-this.maxSize),this.currentSet=new Set,o.forEach(r=>{this.add(r)})}else this.currentSet=new Set}values(){return this.currentSet.values()}get size(){return this.currentSet.size}delete(e){return this.currentSet.has(e)?(this.currentSet.delete(e),this.orderRefs=this.orderRefs.filter(t=>t.deref()!==e),!0):!1}has(e){return this.currentSet.has(e)}add(e){if(this.currentSet.has(e))return this;if(this.maxSize-this.currentSet.size<=0){let[o]=this.orderRefs.splice(0,1),r=o.deref();r&&this.currentSet.delete(r)}return this.orderRefs.push(new WeakRef(e)),this.currentSet.add(e),this}};$a.DEFAULT_SIZE=10;var Gu=$a;import{useEffect as SD,useRef as Ya}from"react";var bD=(n,e)=>n.every((t,o)=>t===e[o]),TD=(n,e)=>{let t=Ya(e),o=bD(e,t.current),r=Ya(!0);t.current=e;let i=Ya(["same"]),a=o?[Date.now()]:i.current;i.current=a;let l=Ya(n);l.current=n,SD(()=>{if(r.current){r.current=!1;return}return l.current()},a)};import{useEffect as CD,useRef as zr}from"react";var Mb=(n,e,t)=>n.every((o,r)=>t?t(o,e[r]):o===e[r]),Hu=(n,e)=>{let{same:t,different:o,compare:r}=e,i=zr(t),a=zr(o),l=Mb(t,i.current,r),s=!Mb(o,a.current,r),u=zr(!0);i.current=t,a.current=o;let c=zr(["same"]),d=l&&s?[Date.now()]:c.current;c.current=d;let p=zr(n);p.current=n,l&&s&&(u.current=!1),CD(()=>{if(!u.current)return p.current()},d)};import*as Pt from"react";var Eb=$(Y.currentFlashingDuration),ID=({children:n})=>Pt.createElement(Pt.Fragment,null,n),Ab=1e3,_b={up:bi({direction:"up"}).split(" "),down:bi({direction:"down"}).split(" "),neutral:bi({direction:"neutral"}).split(" ")},Ob=(n={})=>{let{flashDuration:e,flashClassName:t,render:o=ID}=n;return Pt.forwardRef((i,a)=>{let l=Ei(),{flashingDurationCSSVarValue:s}=ee(R=>({flashingDurationCSSVarValue:R.state.flashingDurationCSSVarValue})),u=typeof s=="number"?s??e??Ab:e??Ab,{domRef:c,value:d,column:p,rowInfo:f,htmlElementRef:m}=l,g=f.id,h=p.id,S=Pt.useRef(!0),y=Pt.useRef(d),C=S.current?null:y.current;S.current=!1;let T=Pt.useRef(void 0),I=Pt.useRef(void 0),b=Pt.useRef(void 0);return Hu(()=>{if(d===y.current)return;let R=()=>{let x=m.current;if(T.current&&(clearTimeout(T.current),T.current=void 0),b.current&&(clearTimeout(b.current),b.current=void 0),I.current&&x){let M=I.current,D=_b[M];x.classList.remove(...t?[t,...D]:D),x.style.removeProperty(Eb),I.current=void 0}};y.current=d;let w=m.current;if(!w)return;R();let v=typeof d=="number"?d>C?"up":"down":"neutral",P=_b[v];return w.style.setProperty(Eb,`${u}`),w.classList.add(...t?[t,...P]:P),I.current=v,T.current=setTimeout(R,u),R},{same:[h,g],different:[d]}),Pt.createElement("div",{ref:c,...i,className:U(i.className)},o({children:i.children,oldValue:C}))})},RD=Ob();import*as et from"react";import{useEffect as Nb,useRef as Fb}from"react";import{createPortal as wD}from"react-dom";function vD(n){let[e,t]=et.useState(null);return Nb(()=>{let{debugTarget:o}=n,r=setInterval(()=>{if(globalThis.INFINITE&&globalThis.INFINITE[o]){let i=globalThis.INFINITE[o].getState;clearInterval(r),t(()=>i)}},100);return()=>{clearInterval(r)}},[n.debugTarget]),typeof e=="function"?et.createElement(Lb.Provider,{value:{getState:e}},et.createElement(PD,null)):null}var Lb=et.createContext({getState:()=>null});function PD(){let n=et.useContext(Lb),{getState:e}=n,[,t]=kt(),o=e().renderer.cellManager;Nb(()=>{let s=Yt(()=>{console.log("rerender"),t()},{wait:500});return o.onCellAttachmentChange(s)},[o,t]);let r=o.getRowsWithCells(),i=o.getColumnsWithCells(),a=Fb(null),l=Fb(null);return et.createElement("div",{style:{overflow:"auto"}},wD(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:o.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=o.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 $q={CheckBox:bn,LoadMask:Wa,MenuIcon:cr,StringFilterEditor:ho,NumberFilterEditor:ui};export{xo as AutoScroller,je as CellSelectionState,Ct as DRAG_ITEM_ATTRIBUTE,xb as DataClient,q2 as DataSource,ov as DataSourceActionType,j as DeepMap,jl as DragDropProvider,pr as DragInteractionTarget,Un as DragList,Vu as FixedSizeSet,RD as FlashingColumnCell,Rt as GroupRowsState,vD as INTERNAL_MatrixDebugger,cn as InfiniteTable,Xt as InfiniteTableClassName,pD as InfiniteTableComponent,sn as Menu,vr as RowDetailCache,Mt as RowDetailState,wt as RowDisabledState,Oe as RowSelectionState,$8 as TreeDataSource,mt as TreeExpandState,mD as TreeGrid,Je as TreeSelectionState,Gu as WeakFixedSizeSet,Iu as alignNode,$q as components,ps as createDefaultProxy,Ob as createFlashingColumnCellComponent,Yt as debounce,Xe as debug,fs as defaultDragProxyMove,ng as defaultFilterFunction,kn as defaultFilterTypes,Ls as defaultTreeFilterFunction,Tu as eventMatchesKeyboardShortcut,nh as filterDataArray,kn as filterTypes,OC as flatten,Et as getComponentStateRoot,Jl as group,yD as interceptMap,hD as keyboardShortcuts,jt as multisort,$s as multisortNested,Ko as queryKeyToCacheKey,$R as toTreeDataArray,At as useComponentState,nv as useDataSourceApi,wr as useDataSourceInternal,Fe as useDataSourceSelector,Ys as useDataSourceState,Sn as useDragDropProvider,Eo as useDragListContext,Hu as useEffectWhen,TD as useEffectWhenSameDeps,Lo as useEffectWithChanges,BB as useEffectWithObject,Au as useGridScroll,cD as useInfiniteColumnApi,Ei as useInfiniteColumnCell,os as useInfiniteColumnEditor,Qo as useInfiniteColumnFilterEditor,si as useInfiniteHeaderCell,WP as useInfinitePortalContainer,uD as useInfiniteTableApi,KB as useLayoutEffectWithChanges,fh as useManagedDataSource,Fn as useMasterRowInfo,ln as useOverlay,eP as useOverlayPortal,Nn as usePrevious,X2 as useRowInfoReducers,FP as useVisibleColumnSizes,Pb as withSelectedLeafNodesOnly};
31
+ `,`You are using version "${e.version}" of Infinite Table, which was published on ${r.toDateString()}.`,"Please visit infinite-table.com to renew your license.","Thank you for playing fair!"],t),"expired"):"valid"};var yP=n=>{let e="",t=n.split("|").map(l=>{let s=l.indexOf("="),u=s===-1?l:l.slice(0,s),c=s===-1?"":l.slice(s+1);return u==="C"&&(e=c),{name:u,value:c}});if(!e)throw"Invalid license";let o=e.split(",").reverse(),r=o.pop();o.forEach((l,s)=>{let u=t[s];if(_u(u.value)!==l)throw"Invalid license"});let i=[...t];i.pop();let a=i.map(l=>`${l.name}=${l.value}`).join("|");if(_u(a)!==r)throw"Invalid license";return t=t.map(l=>({...l,value:decodeURI(l.value)})),hP(t)};function My(n="",e){if(e.isDetail)return"valid";let t=xy(n,{publishedAt:1796226104414,version:"11.1.0"});return t==="invalid"&&!n?"missing":t}var Ey=(n="")=>{let t=!!Vn();return SP(()=>My(n,{isDetail:t}),[n,t])};import{useRef as Ay,useEffect as _y}from"react";var bP=10;function Oy(n,e,t){let o=Ay(!1),r=Ay(null);_y(()=>{n!=null&&(o.current=!1,Lt(r.current))},[n]),_y(()=>{if(n!=null&&!o.current){let a=function(l=0){l++,Lt(r.current),r.current=Ge(()=>{o.current=t.scrollCellIntoView(n[0],n[1],{offset:30}),!o.current&&l<bP&&a(l)})};var i=a;a()}return()=>{Lt(r.current)}},[n,e])}import{useRef as Fy,useEffect as Ny}from"react";var TP=10;function Ly(n,e,t){let o=Fy(!1),r=Fy(null);Ny(()=>{n!=null&&(o.current=!1,cancelAnimationFrame(r.current))},[n]),Ny(()=>{if(n!=null&&!o.current){let a=function(l=0){l++,r.current=requestAnimationFrame(()=>{o.current=t.scrollRowIntoView(n,{offset:0}),!o.current&&l<TP&&a(l)})};var i=a;a()}return()=>{cancelAnimationFrame(r.current)}},[n,e])}function ky(){return hn()}import{useCallback as xP,useMemo as MP,useEffect as EP}from"react";function zy(n,e){n.getComputed().multiRowSelector.lastPointerDown={rowIndex:n.rowIndex,shiftKey:!!e.shiftKey},e.detail!==2&&void 0}var CP={Enter:!0," ":!0,a:!0};function Vy(n,e){let{getState:t,getDataSourceState:o,dataSourceActions:r,cloneRowSelection:i,cloneTreeSelection:a}=n,{key:l,ctrlKey:s,metaKey:u}=e;if(!CP[l])return!1;let c=t(),d=o(),{activeRowIndex:p,activeCellIndex:f,keyboardNavigation:m,keyboardSelection:g}=c,{selectionMode:h,rowSelection:S,treeSelectionState:y,isTree:C}=d;if(g===!1)return!1;let b=m==="row"&&p!=null?p:m==="cell"&&f!=null?f[0]:null;if(!(b!=null?d.dataArray[b]:null)||b==null)return!1;if(l===" "&&(h==="single-row"||h==="multi-row")){let T={key:e.key,metaKey:e.metaKey,ctrlKey:e.ctrlKey,shiftKey:e.shiftKey,preventDefault:()=>e.preventDefault()};return Hi({...n,rowIndex:b},T,"keyboard")}if(h!=="multi-row")return!1;if(l==="a"&&(s||u)){if(C&&y){let R=a(y);return R.selectAll(),r.treeSelection=R,!0}let T=i(S);return T.selectAll(),r.rowSelection=T,!0}return!1}var Hy=so(Bn());async function Gy(n,e=10,t=300){return new Promise((o,r)=>{let i=Date.now();function a(){if(Date.now()-i>t)return r(!1);if(!n()){setTimeout(a,e);return}o(!0)}a()})}var IP=10,RP=(n,e)=>n-e;function Ha(n,e){let{getComputed:t,getDataSourceState:o,getState:r,api:i,dataSourceApi:a}=e,{editingCell:l,isRowDetailEnabled:s}=r(),{dataArray:u}=o(),{computedVisibleColumns:c,computedColumnsMap:d}=t(),p=c[n.colIndex];if(!p)return!1;if(l&&l.columnId===p.id&&l.rowIndex===n.rowIndex)return!0;if(!p.contentFocusable)return!1;if(p.contentFocusable===!0)return!0;let f=u[n.rowIndex],m=!s||typeof s=="function"&&!s(f)?!1:i.rowDetailApi.isRowDetailExpanded(f.id)?"expanded":"collapsed",g=ft(p.id,e);return p.contentFocusable({column:p,...Eo({column:p,rowInfo:f,columnsMap:d,context:e,rowDetailState:m}).formattedValueContext,columnApi:g,api:i,dataSourceApi:a})}function Ou(n,e,t){let o=t.getState().editingCell;return wP(n,e,t,{isCellFocusable:Ha,isColumnElligible:i=>o&&o.columnId===i.id?!0:!!i.contentFocusable})}function Ky(n,e,t){let o=(0,Hy.default)(t,n+e,RP);return o<0&&(o=~o,e>0&&o>=t.length||e<0&&o===0)?null:t[o]??null}globalThis.getNextCol=Ky;function wP(n,e,t,o){let{isColumnElligible:r,isCellFocusable:i}=o,a=t.getComputed().computedVisibleColumns.filter(r).reduce((d,p)=>(d.push(p.computedVisibleIndex),d),[]);if(!a.length)return null;let{getDataSourceState:l}=t,{dataArray:s}=l(),u=n.rowIndex,c=n.colIndex;for(;u!=null||c!=null;){if(c=c===null?a[e===-1?a.length-1:0]:Ky(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 By(n){let e={rowIndex:n.getDataSourceState().dataArray.length-1,colIndex:n.getComputed().computedVisibleColumns.length-1},t=Ha(e,n)?e:Ou(e,-1,n);if(t){await Fu([t.rowIndex,t.colIndex],n);let o=n.getState().getDOMNodeForCell(t);if(!o)return;Di(o)?.focus();return}n.getState().scrollerDOMRef.current?.focus({preventScroll:!0})}async function Fu([n,e],t){let{api:o}=t;return new Promise((r,i)=>{let a=IP,l=null,s=!1;function u(c=0){c++,Lt(l),l=Ge(async()=>{if(s=o.scrollCellIntoView(n,e,{offset:30}),!s&&c<a&&u(c),s){try{await Gy(()=>!!t.getState().getDOMNodeForCell({rowIndex:n,colIndex:e}))}catch(d){i(d);return}r(!0)}})}u()})}var vP=`.${jt}`;function Wy(n,e){if(e.key!=="Tab")return!1;let t=e.shiftKey?-1:1,o=e.target,r=n.getState().scrollerDOMRef.current,i=document.activeElement===r||o===r;if(!r)return!1;if(i&&t===-1)return Hp(n);let a=i?null:Tn(o,vP),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}=n.getState();[l,s]=c||[0,0]}if(l==null||s==null||isNaN(l)||isNaN(s))return!1;let u=i&&Ha({colIndex:s,rowIndex:l},n)?{rowIndex:l,colIndex:s}:Ou({rowIndex:l,colIndex:s},t,n);if(!u){if(t===-1)r.focus();else{let c=Pi(document.body),d=n.getState().focusDetectDOMRef.current,p=c.findIndex(m=>m===d);c[p+1]?.focus()}return!0}return Fu([u.rowIndex,u.colIndex],n).then(()=>{let c=n.getState().getDOMNodeForCell(u);if(!c)return;Di(c)?.focus()}),!0}var jy={control:"ctrl"},Uy={"control|cmd":"ctrl","cmd|control":"ctrl","ctrl|cmd":"ctrl","cmd|ctrl":"ctrl"},PP={esc:"escape"},Yy={cmd:n=>n.metaKey,alt:n=>n.altKey,ctrl:n=>n.ctrlKey,shift:n=>n.shiftKey},qy=Object.keys(Yy),Nu=new Set(qy),DP=new Set(["shift","alt"]);function Lu(n,e){return Array.isArray(e)?e.some(t=>$y(n,t)):$y(n,e)}function $y(n,e){let t=n.key.toLowerCase(),o=e.split("+").map(p=>p.toLowerCase().trim()),r=o.find(p=>Uy[p]),i=o.map(p=>jy[p]||Uy[p]||PP[p]||p),a=i.filter(p=>Nu.has(p)),l=i.filter(p=>!Nu.has(p)),s=qy.reduce((p,f)=>(p[f]=Yy[f](n),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=>!DP.has(f)).length)return!1}else if(a.length!=u.length)return!1;return!l.length||Nu.has(t)||t==="meta"||jy[t]?!1:l.reduce((p,f)=>p?f==="*"||t===f:!1,!0)}async function Xy(n,e){let t={...n,cloneRowSelection:a=>Mo(a,n.getDataSourceState),cloneTreeSelection:a=>xo(a,n.getDataSourceState)},{onKeyDown:o}=n.getState(),r={preventEdit:!1,preventEditStop:!1,preventDefaultForTabKeyWhenEditing:!0,preventSelection:!1,preventNavigation:!1};if(o){let a=o(n,e);a&&typeof a=="object"&&(r={...r,...a})}if(kp(n,e.target)){!r.preventNavigation&&Yp(n,e)&&e.preventDefault();return}if(!r.preventSelection&&Vy(t,e)&&e.preventDefault(),(Wy(t,e)||!n.getState().focusedWithin&&!r.preventNavigation&&jg(t,e))&&e.preventDefault(),!r.preventEdit&&e.key==="Enter"&&!n.api.isEditInProgress()){let{activeCellIndex:a}=n.getState();if(a){let[l,s]=a,u=n.getComputed().computedVisibleColumns[s];u.computedEditable&&n.api.startEdit({rowIndex:l,columnId:u.id})}}n.api.isEditInProgress()&&(e.key==="Escape"&&!r.preventEditStop&&n.api.stopEdit({cancel:!0}),e.key==="Tab"&&r.preventDefaultForTabKeyWhenEditing&&e.preventDefault());let{keyboardShortcuts:i}=n.getState();if(i)for await(let a of i){if(!Lu(e,a.key)||a.when&&!await a.when(n))continue;let l=await a.handler(n,e);if(l&&l.stopNext)break}}function AP(){let{getState:n,actions:e,api:t,getComputed:o,getDataSourceMasterContext:r}=Le(),{getDataSourceState:i,dataSourceActions:a,dataSourceApi:l}=Ut();return MP(()=>({getComputed:o,getDataSourceMasterContext:r,dataSourceApi:l,api:t,getState:n,actions:e,getDataSourceState:i,dataSourceActions:a,cloneTreeSelection:c=>xo(c,i),cloneRowSelection:c=>Mo(c,i)}),[n,e,i,a,t,l,o])}function _P(){let n=AP();EP(()=>{let e=n.getState().keyDown.onChange(a=>{Xy(n,a)});function t(a){if(!a)return;let l=a.event,s=n.getComputed().computedVisibleColumns[a.colIndex],u=ft(s.id,n);If({...n,rowIndex:a.rowIndex,colIndex:a.colIndex,column:s,columnApi:u},{...l,key:""})}let o=n.getState().cellClick.onChange(t);function r(a){if(!a)return;let{event:l,rowIndex:s,colIndex:u}=a,c=n.getComputed().computedVisibleColumns[u],d=ft(c.id,n);zy({...n,rowIndex:s,colIndex:u,column:c,columnApi:d},l)}let i=n.getState().cellMouseDown.onChange(r);return()=>{e(),o(),i()}},[])}function OP(){let{getState:n}=J(t=>({getState:t.getState}));return{onKeyDown:xP(t=>{n().keyDown(t)},[])}}function Zy(){return _P(),OP()}import{useEffect as nb}from"react";import*as He from"react";import{useCallback as Vu,useEffect as NP,useLayoutEffect as LP,useState as Wa}from"react";import{createPortal as kP}from"react-dom";var Ka="__is_infinite_menu_component";function ku(n){return!!n.tagName}function eS(n){let{alignTarget:e,alignAnchor:t,constrainTo:o,alignPosition:r}=n,i=Ae.from(ku(e)?e.getBoundingClientRect():e),a=Ae.from(ku(t)?t.getBoundingClientRect():t),l=o?Ae.from(ku(o)?o.getBoundingClientRect():o):null;if(!l)return{...Qy({anchorRect:a,targetRect:i,position:r[0]}),index:0};let s=null;for(let u=0,c=r.length;u<c;u++){let d=Qy({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 Qy(n){let e=Ae.from(n.targetRect),t=Ae.from(n.anchorRect),o=n.constrainRect?Ae.from(n.constrainRect):null,{position:r}=n,[i,a]=r,l=Jy(e,i),s=Jy(t,a),u=l.getDistanceToPoint(s);e.shift(u);let c=o?o.contains(e):!0;return{alignPosition:r,alignedRect:e,valid:c,distance:u}}function Jy(n,e){return e==="TopLeft"?Be.from({top:n.top,left:n.left}):e==="TopCenter"?Be.from({top:n.top,left:n.left+(n.width>0?Math.round(n.width/2):0)}):e==="TopRight"?Be.from({top:n.top,left:n.left+n.width}):e==="BottomLeft"?Be.from({left:n.left,top:n.top+n.height}):e==="BottomCenter"?Be.from({left:n.left+(n.width>0?Math.round(n.width/2):0),top:n.top+n.height}):e==="BottomRight"?Be.from({left:n.left+n.width,top:n.top+n.height}):e==="CenterLeft"?Be.from({left:n.left,top:n.top+(n.height>0?Math.round(n.height/2):0)}):e==="CenterRight"?Be.from({left:n.left+n.width,top:n.top+(n.height>0?Math.round(n.height/2):0)}):Be.from({left:n.left+(n.width>0?Math.round(n.width/2):0),top:n.top+(n.height>0?Math.round(n.height/2):0)})}function FP(n){return n&&typeof n.then=="function"||n instanceof Promise}function Ba(n){return n==null||typeof n=="string"?!1:typeof n.tagName=="string"}async function tS(n){return typeof n=="function"&&(n=n()),FP(n)&&(n=await n),typeof n=="string"&&(n=document.querySelector(n)),n&&Ba(n)&&(n=n.getBoundingClientRect()),n?Ae.from(n):null}async function nS(n){let e=null;typeof n=="function"?e=n():e=n;function t(o){let r=null;return typeof o=="string"&&(r=document.querySelector(o)),Ba(o)&&(r=o),r||null}return t(await e)}async function zu(n,e){let{constrainTo:t,alignTo:o,alignPosition:r}=e;Object.keys(o).length===2&&o.top!==void 0&&o.left!==void 0&&(o={...o,width:0,height:0}),typeof t=="boolean"&&(t=t?document.documentElement.getBoundingClientRect():void 0);let i=t&&await tS(t)||void 0,a=o?await tS(o):void 0,l=Ae.from(n.getBoundingClientRect());if(!a)return;let{alignedRect:s}=eS({constrainTo:i,alignAnchor:a,alignTarget:l,alignPosition:r});n.style.transform=`translate3d(${s.left}px,${s.top}px, 0px)`;let u=n.getBoundingClientRect();if(u.left!==s.left||u.top!==s.top){let c=n.offsetParent;if(c){let d=c.getBoundingClientRect(),p=d.left,f=d.top,m=s.left-p,g=s.top-f;n.style.transform=`translate3d(${m}px,${g}px, 0px)`}}}function zP(n){return He.createElement("div",{style:{position:"fixed",top:0,left:0}},n.children)}function VP(n){let e=He.useRef(null);return NP(()=>n.realign.onChange(t=>{e.current&&t&&zu(e.current,t)}),[n.realign]),He.createElement("div",{style:{position:"absolute",top:0,left:0},ref:Vu(t=>{t&&zu(t,n),e.current=t},[])},typeof n.children=="function"?n.children():n.children)}function GP(n,e){let[t,o]=Wa(null);LP(()=>{async function a(){let l=e?await nS(e):null;l!=null&&o(l)}e&&a()},[e]);let r=typeof e=="function"?e():null,i=Ba(r)?r:t;return e?i?kP(n,i):He.createElement(He.Fragment,null):e===null||e===!1?n:He.createElement(zP,null,n)}function HP(n){if(He.Children.count(n)===1){let e=He.Children.only(n);if(He.isValidElement(e))return e.props.id||e.key}return null}function KP(n,e,t){if(He.Children.count(n)===1){let o=He.Children.only(n);if(He.isValidElement(o)&&o.type[Ka]){let r={};return o.props.portalContainer===void 0&&(r.portalContainer=e),o.props.constrainTo===void 0&&(r.constrainTo=t),He.cloneElement(o,r)}}return n}function un(n){let e=n,[t]=Wa(()=>new Map),[o,r]=Wa(null),[i,a]=Wa(0),l=Vu(()=>{let m=[];for(let[g,h]of t)m.push(He.createElement(VP,{...h,key:h.key}));return m},[]),[s,u]=Vt(),c=GP(l(),n.portalContainer),d=Vu((m,g)=>{let S=`${g.id||HP(m)||At()}`,y=t.get(S),C=T=>()=>{let R=typeof T=="function"?T():T;return KP(R,e.portalContainer,g.constrainTo??e.constrainTo)},b=C(m),I=(T,R)=>{if(!y)return;let v=C(T);Object.assign(y,{children:v}),u(),!!!R?.skipRealign&&(r(y.key),a(Date.now()))};return y?(Object.assign(y,g),I(m),I):(y={key:S,children:b,alignPosition:g.alignPosition,alignTo:g.alignTo,constrainTo:g.constrainTo,realign:he()},t.set(y.key,y),u(),I)},[t,e.portalContainer,u]);He.useEffect(()=>{if(o){let m=t.get(o);m&&m.realign(m)}},[o,i]);let p=m=>{m=`${m}`,t.has(m)&&(t.delete(m),u())},f=()=>{t.clear(),u()};return He.useEffect(()=>{},[]),{portal:c,hideOverlay:p,clearAll:f,rerenderOverlays:u,showOverlay:d}}import*as BS from"react";import*as Wo from"react";import*as gS from"react";import*as fS from"react";function ja(n){return null}ja.defaultProps={__is_menu_item:!0};var oS="submenu",BP="-";function rS(){return{keyboardActiveItemKey:null,activeItemKey:null,generatedId:At(),focused:!1,destroyed:!1,domRef:{current:null}}}function iS(){return{parentMenuId:1,parentMenuItemKey:1,onHideIntent:1,constrainTo:1,onAction:1,onShow:1,onHide:1,autoFocus:1,wrapLabels:1}}var Gu=({columns:n,keyboardActiveItemKey:e,activeItemKey:t,menuId:o},r,i)=>{let a=r&&(r.key!=null||r.label!=null)?r:null,l=a===null?r===BP?i.renderSeparator():r:null;return a!=null?{type:"item",parentMenuId:o,disabled:!!a.disabled,keyboardActive:a.key===e,active:a.key===t,value:a,span:a.span||1,key:a.key,menu:a.menu||null,style:a.style,className:a.className,originalMenuItem:a}:{type:"decoration",value:l,span:n.length,style:{gridColumnStart:1,gridColumnEnd:n.length+10}}},WP=[{name:"label"}],aS=(n,e)=>{let{props:t,state:o}=n,{activeItemKey:r,keyboardActiveItemKey:i}=o,{items:a,children:l,addSubmenuColumnIfNeeded:s,parentMenuId:u}=t,c=t.id||o.generatedId;u&&(c=`${u}-${c}`);let d=[...t.columns||WP],p={columns:d,keyboardActiveItemKey:i??null,activeItemKey:r??null,menuId:c},f=[];a?f=a.map(g=>Gu(p,g,e)):!a&&typeof l!="function"&&(f=e.childrenToRuntimeItems?e.childrenToRuntimeItems(p,l):[]),s&&f.filter(h=>h.type==="item"&&h.menu!=null).length>0&&!d.find(h=>h.name==oS)&&d.push({name:oS,render:e.renderSubmenuColumn});let m=f.filter(g=>g.type==="item"&&!g.disabled);return{runtimeItems:f,runtimeSelectableItems:m,columns:d,menuId:c}};import*as Bo from"react";var lS="db3arf0 _16lm1iw0 _16lm1iw1 _16lm1iw1w _16lm1iw2f _16lm1iw8",sS=me({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"]]}),uS="db3arf1",cS="db3arfd";function dS(){return Bo.createElement("hr",{className:cS})}var Ua={renderSeparator:()=>Bo.createElement(dS,null),renderSubmenuColumn:({domProps:n,item:e})=>e.menu?Bo.createElement("div",{...n},Bo.createElement(qn,{expanded:!1})):Bo.createElement("div",{...n})};var pS=(n,e)=>Gu(n,e,Ua);function mS(n,e){return fS.Children.map(e,t=>{if(t&&(t.props.__is_menu_item||t.type===ja)){let o={...t.props};return o.key||(o.key=t.key),o.description||(o.description=t.props.children),o.label||(o.label=o.children),pS(n,o)}return pS(n,t)})||[]}function hS(){return{...rS(),domRef:gS.createRef()}}var yS=()=>iS(),SS=n=>aS(n,{...Ua,childrenToRuntimeItems:mS});import*as zt from"react";import{useCallback as Kr,useLayoutEffect as JP,useRef as eD,useState as Bu}from"react";import{createContext as jP,useContext as UP}from"react";var Hu=jP(null);function Ku(){return UP(Hu)}function bS(n,e){let t=TS(n,e);if(!t.length)return null;let o=Ae.from(t[0]?.getBoundingClientRect()),r=Ae.from(t[t.length-1].getBoundingClientRect()),i=o;return i.width=r.left+r.width-o.left,i}function TS(n,e){let t=Tn(document.querySelector(`[data-menu-id="${n}"] [data-menu-item-key="${e}"]`),`[data-menu-id="${n}"]`);if(!t)return[];let o=t.querySelectorAll(`[data-menu-item-key="${e}"]`);return Array.from(o)}function CS(n,e){let t=TS(n,e);if(!t.length)return null;for(let o of t){let r=o.querySelector('input[type="checkbox"]');if(r)return r}return null}function IS(n){let e=n();e.onHideIntent?.(e)}function RS(n,e,t){let{getState:o,setActiveItemKey:r,setKeyboardActiveItemKey:i,hideAll:a}=t;i(e.key),r(e.key),e.originalMenuItem.onClick&&e.originalMenuItem.onClick(n);let l={key:e.key,item:e.originalMenuItem,hideMenu:a};e.originalMenuItem.onAction&&e.originalMenuItem.onAction(l);let{onAction:s}=o();s&&s(l),e.originalMenuItem.hideMenuOnAction&&a()}function wS(n,e){let{getState:t,setActiveItemKey:o,setKeyboardActiveItemKey:r,destroy:i,getSubmenuApi:a,isMounted:l,onItemClick:s}=e,{runtimeItems:u,runtimeSelectableItems:c,keyboardActiveItemKey:d}=t(),p=u.findIndex(S=>S.type==="item"&&S.key===d),f=d,m=u[p],g={ArrowUp:()=>{let S=u.slice(0,p).filter(y=>y.type==="item"&&!y.disabled).pop();S&&S.type==="item"&&S.key&&(f=S.key)},ArrowDown:()=>{let S=u.slice(p+1).filter(y=>y.type==="item"&&!y.disabled)[0];S&&S.type==="item"&&S.key&&(f=S.key)},Home:()=>{g.PageUp()},End:()=>{g.PageDown()},PageUp:()=>{f=c[0].key},PageDown:()=>{f=c[c.length-1].key},ArrowLeft:()=>{o(null),t().parentMenuId&&i()},ArrowRight:()=>{m&&(o(m.key),Ge(()=>{let S=a();l()&&S&&S.getParentMenuId()===t().menuId&&S.focus()}))},Enter:()=>{if(m)if(m.originalMenuItem?.menu){if(a()){g.ArrowLeft();return}o(m.key)}else s(n,m)}," ":()=>{if(!m)return;m.originalMenuItem.menu||s(n,m);let S=CS(t().menuId,m.key);S&&S.click()},Escape:()=>{g.ArrowLeft();let S=t();S.parentMenuId||S.onHideIntent?.(S)}},h=g[n.key];h&&(h(),n.preventDefault()),f!=d&&r(f)}function vS(n){let{getState:e,setFocused:t,setKeyboardActiveItemKey:o,shouldSelectFirstItemOnFocus:r,hideAll:i}=n,a=()=>{t(!0),setTimeout(()=>{let s=e().domRef.current;r()&&s&&s===document.activeElement&&e().keyboardActiveItemKey==null&&o(e().runtimeSelectableItems[0]?.key??null)})};return{api:{hideMenu:i,focus:()=>{let s=e().domRef.current;s&&(s.focus(),setTimeout(()=>{let u=e().domRef.current;u&&u!==document.activeElement&&u.focus()},10),a())},getMenuId:()=>e().menuId,getParentMenuId:()=>e().parentMenuId},onMenuFocus:a}}var Hr=class extends Ro{constructor(e){super(e.slice(0,3))}};var $P=250;function YP(n,e=100){let t=Date.now();return new Promise(o=>{let r,i=()=>{if(r=n(),r!==void 0){o(r);return}if(Date.now()-t>e){o(void 0);return}Ge(i)};Ge(()=>{i()})})}var qP=_e(),$a=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||$P;this.getPointerMoveTarget=()=>document.documentElement||qP;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 Be({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 Hr([this.activeItemLeavePoint,this.activeItemMenuRect.getTopLeft(),this.activeItemMenuRect.getBottomLeft()]):new Hr([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,YP(()=>this.activeItem!=e?!1:this.params.getMenuRectFor(e)).then(o=>{this.activeItem==e&&o&&(this.activeItemMenuRect=o)})}};this.onItemChange=(e,t,o)=>{if(clearTimeout(this.menuLeaveTimeoutId),clearTimeout(this.mouseMoveTimeoutId),!e){this.removePointerMoveListener(),t===this.activeItem&&(this.activeItemLeavePoint=new Be({left:o.clientX,top:o.clientY})),this.setupMenuLeaveTracking();return}if(this.currentHoveredItem=t,!this.activeItem||!this.params.itemHasSubMenu(this.activeItem)){this.setActiveItem(t,o.target);return}this.onPointerMoveWhileActiveItem(),this.getPointerMoveTarget().addEventListener("pointermove",this.onPointerMoveWhileActiveItem)};this.getHandlers=()=>({onItemEnter:(e,t)=>{this.onItemChange(!0,e,t)},onItemLeave:(e,t)=>{this.onItemChange(!1,e,t)}});this.params=e}};function PS(n,e){let t=n.filter(o=>o.type==="item"&&e===o.key)[0];return t&&t.menu?t:null}function DS(n,e,t){let o=bS(n,e.key);return o?{id:`${n}-submenu`,alignTo:o,alignPosition:[["TopLeft","TopRight"],["TopRight","TopLeft"]],constrainTo:t}:null}function xS(n,e){let{parentMenuId:t,constrainTo:o,api:r,hideAll:i,setSubmenuApi:a,setActiveItemKey:l,setKeyboardActiveItemKey:s}=e,u=n.menu;if(!u)return null;typeof u=="function"&&(u=u());let c=u;return{parentMenuItemKey:n.key,parentMenuId:t,constrainTo:o,...c,autoFocus:!1,onShow:(d,p)=>{c?.onShow?.(d,p),a(p)},onHideIntent:d=>{c?.onHideIntent?.(d),i()},onHide:d=>{d.focused&&(l(null),s(n.key),r.focus())}}}function MS(n,e){return new $a({parentMenuId:n().parentMenuId,onItemActivate:e,itemHasSubMenu:t=>!!n().runtimeItems.filter(r=>r.type==="item"&&r.key===t&&r.menu)[0],getMenuRectFor:t=>{let o=`[data-submenu-for="${t}"]`,r=document.querySelector(o);if(r)return Ae.from(r.getBoundingClientRect())}}).getHandlers()}function ES(n,e,t=o=>o){let{columns:o,runtimeItems:r,wrapLabels:i}=n,a=o.map(s=>t(s.width||(typeof s.flex=="number"?`${s.flex}fr`:s.flex)||"auto")).join(" "),l={...e,gridTemplateColumns:a,gridTemplateRows:r.map(()=>"auto").join(" ")};return i||(l.whiteSpace="nowrap"),l}function AS(n,e,t,o){let{active:r,keyboardActive:i,pressed:a}=o,l=n.value.key,s=U(sS({active:r,disabled:!!n.disabled,keyboardActive:i,pressed:a||r}),n.className),u=[],c=0;return e.forEach((d,p)=>{let f=n.value,m=d.field||d.name,g=p+1,h=g+n.span;g<c||(c=h,u.push({key:`${l}-${m}`,column:d,value:f[m],style:{...d.style,...n.style,gridColumnStart:g,gridColumnEnd:h},className:s,dataAttributes:{"data-menu-column-id":`${n.parentMenuId}-col-${d.name}`,"data-menu-col-name":`${d.name}`,"data-menu-row-id":`${n.parentMenuId}-row-${t}`,"data-menu-row-index":`${t}`,"data-menu-item-key":`${n.key}`}}))}),u}import{useCallback as XP,useEffect as ZP,useRef as QP}from"react";function _S(){let n=QP(!0);return ZP(()=>(n.current=!0,()=>{n.current=!1}),[]),XP(()=>n.current,[])}function tD(n,e){let t=`${e.parentMenuId}-submenu`,o=xS(n,e);return o?zt.createElement(cn,{key:t,...o}):null}function nD({onItemActivate:n}){let{getState:e}=Ku(),[{onItemEnter:t,onItemLeave:o}]=Bu(()=>MS(e,r=>{if(!r){n(null);return}let i=e().runtimeItems.filter(a=>a.type==="item"&&a.key===r)[0];n(i)}));return{onItemEnter:Kr(t,[]),onItemLeave:Kr(o,[])}}function OS(n){let{domProps:e}=n,{componentState:t,componentState:{columns:o,runtimeItems:r,menuId:i,activeItemKey:a,keyboardActiveItemKey:l,constrainTo:s,destroyed:u,onShow:c,onHide:d,autoFocus:p,parentMenuItemKey:f,domRef:m},componentActions:g,getState:h}=Ku(),S=Kr(_=>{g.keyboardActiveItemKey=_},[]),y=Kr(_=>{g.activeItemKey=_},[]),C=_S(),[b,I]=Bu(null),T=eD(!0),[{api:R,onMenuFocus:v,hideAll:w}]=Bu(()=>{let _=()=>IS(h);return{hideAll:_,...vS({getState:h,setFocused:H=>{g.focused=H},setKeyboardActiveItemKey:S,shouldSelectFirstItemOnFocus:()=>T.current,hideAll:_})}}),P=null;JP(()=>{let{runtimeItems:_}=h(),H=PS(_,a);if(!H){I(null),E();return}let z=DS(i,H,s);z&&M(()=>tD(H,{constrainTo:s,setSubmenuApi:I,setActiveItemKey:y,setKeyboardActiveItemKey:S,parentMenuId:i,hideAll:w,api:R}),z)},[a]);let x=(_,H)=>{RS(_,H,{getState:h,setActiveItemKey:y,setKeyboardActiveItemKey:S,hideAll:w})},{showOverlay:M,portal:D,clearAll:E}=un({portalContainer:!1}),{onItemEnter:L,onItemLeave:V}=nD({onItemActivate:_=>{if(!C())return;let H=_?_.key:null;y(H)}});P=r.map((_,H)=>zt.createElement(oD,{key:_.type==="item"?_.key:H,onItemEnter:(z,Z)=>{L(z.key,Z)},onItemLeave:(z,Z)=>{V(z.key,Z)},columns:o,active:_.type==="item"&&_.key===a,keyboardActive:_.type==="item"&&_.key===l,item:_,index:H,onClick:x}));let N=ES(t,e.style);function k(_){wS(_,{getState:h,setActiveItemKey:y,setKeyboardActiveItemKey:S,destroy:()=>{g.destroyed=!0},getSubmenuApi:()=>b,isMounted:C,onItemClick:x})}function F(){g.focused=!1}let B=Kr(_=>{_?(m.current=_,c?.(h(),R),p&&R.focus()):(d?.(h()),m.current=_)},[]),$=zt.createElement("div",{className:mo.contents},zt.createElement("div",{...e,"data-menu-id":i,"data-submenu-for":f,tabIndex:0,ref:B,onKeyDown:_=>{e.onKeyDown?.(_),k(_)},onMouseDown:_=>{T.current=!1,e.onMouseDown?.(_)},onMouseUp:_=>{T.current=!0,e.onMouseUp?.(_)},onFocus:v,onBlur:F,className:U(lS,e.className,"InfiniteMenu"),style:N},P),D);return u?null:$}function oD(n){let[e,t]=zt.useState(!1),{columns:o,item:r,index:i,active:a,keyboardActive:l}=n,s=null;return r.type==="decoration"?s=zt.createElement("div",{style:r.style},r.value):s=AS(r,o,i,{active:a,keyboardActive:l,pressed:e}).map(u=>{let c=u.column,d={style:u.style,...u.dataAttributes,className:u.className,onPointerEnter:p=>{r.disabled||n.onItemEnter?.(r,p)},onPointerLeave:p=>{r.disabled||n.onItemLeave?.(r,p)},onMouseDown:()=>{r.disabled||t(!0)},onMouseUp:()=>{r.disabled||t(!1)},onClick:p=>{r.disabled||n.onClick(p,r)}};return c.render?zt.createElement(br,{key:u.key,render:c.render,renderParam:{item:r.value,column:c,value:u.value,domProps:d}}):zt.createElement("div",{key:u.key,...d},u.value)}),zt.createElement("div",{className:uS},s)}var{ManagedComponentContextProvider:rD}=Ot({initSetupState:hS,forwardProps:yS,mapPropsToState:SS,layoutEffect:!0});function iD(n){let{componentActions:e,componentState:t}=Ft(),o=Ne(t);return Wo.createElement(Hu.Provider,{value:{componentActions:e,componentState:t,getState:o}},Wo.createElement(OS,{domProps:n.domProps}))}function cn(n){let{children:e,portalContainer:t,items:o,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:h,__is_infinite_menu_component:S,...y}=n;return Wo.createElement(rD,{addSubmenuColumnIfNeeded:i,bubbleActionsFromSubmenus:a,wrapLabels:u,...n},Wo.createElement(iD,{domProps:y}))}cn[Ka]=!0;import*as HS from"react";function Ya(n){let e=n?Array.isArray(n)?n:n.items:null,t=n&&!Array.isArray(n)?n.columns:void 0;return{items:e,columns:t}}function qa(n){let e=o=>{o.__insideMenu=!0},t=o=>{o.domRef.current?.parentNode?.removeEventListener("mousedown",e)};return{onShow:o=>{o.domRef.current?.parentNode?.addEventListener("mousedown",e)},onHide:t,onHideIntent:o=>{t(o),n?.()}}}function Xa(n){return{columns:[],items:[],autoFocus:!0,...qa(n.onHideIntent)}}function FS(n,e){let{items:t,columns:o}=Ya(n);return t&&t.length?{...e,items:t||[],columns:o}:null}function NS(n,e){let{columnApi:t,column:o,getComputed:r,api:i,dataSourceApi:a}=n,s=t.isSortable()?[{key:"sort-asc",label:"Sort Ascending",disabled:o.computedSortedAsc,onAction:()=>{i.setSortingForColumn(o.id,1)}},{key:"sort-desc",label:"Sort Descending",disabled:o.computedSortedDesc,onAction:()=>{i.setSortingForColumn(o.id,-1)}},{key:"sort-none",label:"Unsort",disabled:!o.computedSorted,onAction:()=>{i.setSortingForColumn(o.id,null)}},"-"]:[];return[...o.groupByForColumn?[{key:"collapse-all",label:"Collapse All",onAction:()=>{i.collapseAllGroupRows()}},"-"]:[],...s,o.computedFilterable?{key:"clear-filter",label:"Clear Filter",disabled:!o.computedFiltered,onAction:()=>{i.clearColumnFilter(o.id)}}:null,o.computedFilterable?"-":null,{key:"pin-start",label:"Pin to start",disabled:o.computedPinned==="start",onAction:()=>{i.setPinningForColumn(o.id,"start")}},{key:"unpin",label:"Unpin",disabled:!o.computedPinned,onAction:()=>{i.setPinningForColumn(o.id,!1)}},"-",{key:"columns",label:"Columns",menu:()=>{let c=[];return r().computedColumnsMapInInitialOrder.forEach((p,f)=>{let m=e.getColumnLabel(p);c.push({key:f,label:m,check:e.renderCheckBox({key:p.id,disabled:p.computedVisible&&i.getVisibleColumnsCount()===1,checked:p.computedVisible,onChange:g=>{let h=!!g;i.setVisibilityForColumn(p.id,h),requestAnimationFrame(()=>{i.realignColumnContextMenu()})}})})}),{columns:[{name:"check"},{name:"label"}],items:c}}},"-",{key:"group-by",label:"Group by",menu:()=>{let c=[];return r().computedColumnsMapInInitialOrder.forEach((p,f)=>{if(p.groupByForColumn)return;let m=e.getColumnLabel(p);c.push({key:f,label:m,check:e.renderCheckBox({key:p.id,disabled:!p.computedGroupable,checked:p.computedGroupedBy,onChange:()=>{a.toggleGroupByField(p.field)}})})}),{columns:[{name:"check"},{name:"label"}],items:c}}}].filter(c=>!!c)}function LS(n,e,t,o){if(n==null)return null;let{getComputed:r,getState:i}=e,{getColumnMenuItems:a}=i(),l=r().computedColumnsMap.get(n);if(!l)return null;let s={column:l,columnApi:ft(l.id,e),...e},u=o(s),c=a?a(u,s):u;return!c||!c.length?null:{autoFocus:!0,items:c,...qa(t)}}function kS(n,e,t,o){if(n==null)return null;let{getComputed:r,getState:i,getDataSourceState:a,actions:l,dataSourceApi:s,dataSourceActions:u,api:c}=e,{getFilterOperatorMenuItems:d}=i(),p=r().computedColumnsMap.get(n);if(!p)return null;let{filterTypes:f}=a(),m=f[p.computedFilterType];if(!m)return null;let g=m.operators.map(b=>{let I=b.name,T=p.computedFilterValue?p.computedFilterValue.filter.operator===I:I===m.defaultOperator;return{key:I,icon:o.renderOperatorIcon(b),label:o.renderOperatorLabel(b.label??b.name),onAction:()=>{c.setColumnFilterOperator(n,I)},checked:T?o.renderDoneIcon():null}}),S=[...[{key:"close",label:"Close Menu",icon:null,onAction:()=>{c.hideFilterOperatorMenu()}},{key:"reset",label:"Reset",icon:o.renderClearIcon(),disabled:!p.computedFiltered,onAction:()=>{c.clearColumnFilter(n)}},"-"],...g],y={column:p,api:c,getState:i,getDataSourceState:a,getComputed:r,actions:l,dataSourceApi:s,dataSourceActions:u,columnFilterValue:p.computedFilterValue,filterTypes:f},C=d?d(S,y):S;return{autoFocus:!0,columns:[{name:"icon"},{name:"label"},{name:"checked"}],items:C,...qa(t)}}function zS(n,e,t){let o=n instanceof Promise||Array.isArray(n)?!0:!!(n&&Array.isArray(n.items));if(n instanceof Promise)return{menu:t.renderLazyMenu(n,e),preventDefault:o};let{items:r,columns:i}=Ya(n);return!r||!r.length?{menu:null,preventDefault:Array.isArray(r)}:{preventDefault:o,menu:t.renderMenu({...e,columns:i,items:r})}}function VS(n,e,t,o){let{columnId:r,rowIndex:i,event:a}=n,{getComputed:l,getState:s}=e,{getCellContextMenuItems:u}=s(),{computedColumnsMap:c}=l(),d=c.get(r),p={...Wt({...e,rowIndex:i,columnId:d.id}),event:a};if(!d||!u)return{cellContext:p,menu:null,preventDefault:!1};let f=Xa({onHideIntent:t}),m=u(p,e);return{cellContext:p,...zS(m,f,o)}}function GS(n,e,t,o){let{getState:r,getComputed:i}=e,{getContextMenuItems:a}=r(),{computedColumnsMap:l}=i(),s=n.columnId?l.get(n.columnId):void 0,u=s?{...n,...Wt({...e,rowIndex:n.rowIndex,columnId:s.id})}:n;if(!a)return{cellContext:u,menu:null,preventDefault:!1};let c=Xa({onHideIntent:t}),d=a(u,e);return{cellContext:u,...zS(d,c,o)}}function KS(n,e){let t=e.getState().components?.CheckBox||wn;return NS(e,{renderCheckBox:({key:o,...r})=>HS.createElement(t,{key:o,...r}),getColumnLabel:o=>bo(o,e,"column-menu")})}function WS(n,e,t){let o=e.getState().components?.Menu??cn,r=LS(n,e,t,i=>KS([],i));return r?BS.createElement(o,{...r}):null}function jS(n){return typeof n=="function"?n():n}function Br(n){return jS(n.menuConstrainTo)??n.domRef.current}function US(n,e,t){return e?()=>jS(e)??(t||n().portalDOMRef.current):t||!1}var $S=5,YS=[["TopLeft","BottomLeft"],["TopRight","BottomRight"],["BottomLeft","BottomLeft"],["BottomRight","BottomRight"],["TopCenter","TopLeft"],["BottomCenter","TopLeft"],["CenterLeft","TopLeft"],["CenterRight","TopLeft"]],Za=10;function qS(n){function e(t){t.__insideMenu!==!0&&n()}return document.documentElement.addEventListener("mousedown",e),()=>{document.documentElement.removeEventListener("mousedown",e)}}function Wr(n,e,t){if(n)return qS(()=>{e(),t()});e()}function XS(n){let{getState:e,actions:t}=n;return o=>{o&&(e().columnMenuTargetRef.current=o.target,t.contextMenuVisibleFor=null,t.cellContextMenuVisibleFor=null,t.filterOperatorMenuVisibleForColumnId=null,t.columnMenuVisibleForColumnId=o.column.id)}}function aD(n){let{columnId:e,context:t,clearAll:o,show:r}=n,{getState:i,actions:a}=t,{columnMenuTargetRef:l,domRef:s}=i();function u(){o(),a.columnMenuVisibleForColumnId=null}let c=n.target;if(c||(c=l.current??void 0,c&&!s.current.contains(c)&&(c=void 0)),!c){let d=`[data-column-id="${e}"] ${Uf}`;c=i().domRef.current.querySelector(d)}if(!c){console.warn(`Cannot show column menu for column "${e}"`);return}l.current=null,r(u,{constrainTo:Br(i()),id:"column-menu",alignTo:c,alignPosition:[["TopLeft","BottomLeft"],["TopRight","BottomRight"]]})}function ZS(n,e){let{getState:t,actions:o}=n,{clearAll:r}=e,{columnMenuVisibleForColumnId:i,columnMenuTargetRef:a}=t();if(i){let l=qS(()=>{r(),o.columnMenuVisibleForColumnId=null});return aD({columnId:i,context:n,clearAll:r,show:(s,u)=>e.show(i,s,u)}),l}a.current=null,r()}function QS(n){let e={top:n.clientY,left:n.clientX},t=Ae.fromPoint(e);return t.width+=$S,t.height+=$S,{point:e,rect:t}}function JS(n,e){let{actions:t,getState:o,getDataSourceState:r}=n,{clearAll:i}=e;return a=>{if(!a)return;let{event:l}=a;function s(){i(),t.cellContextMenuVisibleFor=null}let u=e.getContent(a,s),{cellContext:c,preventDefault:d}=u,{rect:p}=QS(l);e.show(u,{constrainTo:Br(o()),id:"cell-context-menu",alignTo:p,alignPosition:YS}),d&&l.preventDefault(),t.cellContextMenuVisibleFor={columnId:a.columnId,rowId:a.rowId,rowIndex:a.rowIndex,colIndex:a.colIndex};let{onCellContextMenu:f}=o();f&&f({...c,getState:o,getDataSourceState:r},l)}}function eb(n,e){let{actions:t,getState:o}=n,{clearAll:r}=e;return i=>{if(!i)return;let{event:a}=i;function l(){r(),t.contextMenuVisibleFor=null}let s=e.getContent(i,l),{cellContext:u,preventDefault:c}=s,{point:d,rect:p}=QS(a);e.show(s,{constrainTo:Br(o()),id:"table-context-menu",alignTo:p,alignPosition:YS}),c&&a.preventDefault(),t.contextMenuVisibleFor={point:d,...i};let{onContextMenu:f}=o();f&&f({...n,...u},a)}}function tb(n,e){let{getState:t,actions:o}=n,{clearAll:r}=e;return i=>{if(!i)return;let{target:a,column:l}=i;function s(){r(),o.filterOperatorMenuVisibleForColumnId=null}let u=a?.parentElement||a,c=Ae.from(u.getBoundingClientRect());c.top-=Za,c.left-=Za,c.width+=2*Za,c.height+=2*Za,e.show(l.id,s,{constrainTo:Br(t()),id:"filter-operator-menu",alignTo:c,alignPosition:[["TopLeft","BottomLeft"],["TopRight","BottomRight"]]}),o.contextMenuVisibleFor=null,o.cellContextMenuVisibleFor=null,o.columnMenuVisibleForColumnId=null,o.filterOperatorMenuVisibleForColumnId=l.id}}import{useMemo as lD}from"react";function ro(){let{getState:n,menuPortalContainer:e}=J(r=>({getState:r.getState,menuPortalContainer:r.state.menuPortalContainer})),{portalDOMRef:t}=ri(r=>({portalDOMRef:r.getMasterState().portalDOMRef}))||{},o=t?.current;return lD(()=>US(n,e,o),[n,e,o])}function ob(){let n=Le(),{columnMenuVisibleForColumnId:e,columnMenuVisibleKey:t}=J(a=>({columnMenuVisibleForColumnId:a.state.columnMenuVisibleForColumnId,columnMenuVisibleKey:a.state.columnMenuVisibleKey})),{showOverlay:o,portal:r,clearAll:i}=un({portalContainer:ro()});return nb(()=>n.getState().onColumnMenuClick.onChange(XS(n)),[]),nb(()=>ZS(n,{clearAll:i,show:(a,l,s)=>o(()=>WS(a,n,l),s)}),[e,t]),{menuPortal:r}}import*as rb from"react";import{useCallback as sD}from"react";var uD={width:0,height:0,overflow:"hidden",pointerEvents:"none",outline:"none",zIndex:-1};function ib(){let{getState:n,api:e,actions:t,getComputed:o,dataSourceApi:r,dataSourceActions:i}=Le(),{getDataSourceState:a,getDataSourceMasterContext:l}=Ut(),{focusDetectDOMRef:s}=n(),u=sD(async()=>{By({getDataSourceState:a,getDataSourceMasterContext:l,getComputed:o,actions:t,dataSourceActions:i,api:e,getState:n,dataSourceApi:r})},[]);return rb.createElement("div",{onFocus:u,ref:s,tabIndex:0,style:uD})}import{useEffect as jr}from"react";function cD(){let n=Le(),{getState:e,editingCell:t}=J(r=>({getState:r.getState,editingCell:r.state.editingCell})),o=t&&!t.active?t.cancelled:void 0;jr(()=>{if(o){let{onEditCancelled:r}=e(),i=e().editingCell;if(!r)return;let a=Er(n,i);if(!a){Ar("onEditCancelled",i);return}r({...a,initialValue:i.initialValue})}},[o])}function dD(){let n=Le(),{getState:e,editingCell:t}=J(r=>({getState:r.getState,editingCell:r.state.editingCell})),o=t&&!t.active&&t.accepted instanceof Error?t.accepted:void 0;jr(()=>{if(o){let{onEditRejected:r}=e(),i=e().editingCell;if(!r)return;let a=Er(n,i);if(!a){Ar("onEditRejected",i);return}r({...a,value:i.value,error:o,initialValue:i.initialValue})}},[o])}function pD(){let n=Le(),{editingCell:e}=J(r=>({editingCell:r.state.editingCell})),t=e?.active,o=Gn(t);jr(()=>{!t&&o&&n.api.focus()},[t,o])}function fD(){let n=Le(),{editingCell:e,getState:t}=J(r=>({editingCell:r.state.editingCell,getState:r.getState})),o=e&&!e.active&&!e.cancelled&&e.accepted===!0;jr(()=>{if(o){let{onEditAccepted:r}=t(),i=t().editingCell,{value:a,initialValue:l}=i;if(r){let s=Er(n,i);s?r({...s,value:a,initialValue:l}):Ar("onEditAccepted",i)}n.api.persistEdit({value:a})}},[o])}function mD(){let n=Le(),{editingCell:e,getState:t}=J(r=>({editingCell:r.state.editingCell,getState:r.getState})),o=e?e.persisted:void 0;jr(()=>{if(o){let{editingCell:r,onEditPersistError:i,onEditPersistSuccess:a}=t();if(!r)return;let l=o instanceof Error?"onEditPersistError":"onEditPersistSuccess";if(!t()[l])return;let s=Er(n,r);if(!s){Ar(l,r);return}let u={...s,value:r.value,initialValue:r.initialValue};o instanceof Error?i?.({...u,error:o}):a?.(u)}},[o])}function ab(){cD(),dD(),fD(),mD(),pD()}import{useEffect as ub}from"react";import*as kn from"react";import*as Wu from"react";var Qa=n=>Wu.createElement(ze,{...n,icon:"clear"},Wu.createElement("path",{d:Ve.clear[0]}));import*as ju from"react";var lb=n=>ju.createElement(ze,{...n,icon:"done"},ju.createElement("path",{d:Ve.done[0]}));function sb(n,e,t){let o=e.getState().components?.Menu??cn,r=kS(n,e,t,{renderOperatorIcon:i=>{let a=i.components?.Icon??yo;return kn.createElement(a,null)},renderOperatorLabel:i=>kn.createElement(kn.Fragment,null,i),renderClearIcon:()=>kn.createElement(Qa,null),renderDoneIcon:()=>kn.createElement(lb,{size:16})});return r?kn.createElement(o,{...r}):null}function cb(){let n=Le(),{getState:e,actions:t}=n,{showOverlay:o,portal:r,clearAll:i}=un({portalContainer:ro()});return ub(()=>e().onFilterOperatorMenuClick.onChange(tb(n,{clearAll:i,show:(a,l,s)=>o(()=>sb(a,n,l),s)})),[]),ub(()=>Wr(e().filterOperatorMenuVisibleForColumnId,i,()=>{t.filterOperatorMenuVisibleForColumnId=null}),[e().filterOperatorMenuVisibleForColumnId]),{menuPortal:r}}import{useEffect as Ja}from"react";import*as pb from"react";import*as Uu from"react";function db(n,e,t){if(!n)return null;let o=he();return n.then(r=>{let i=FS(r,e);i&&o(Uu.createElement(t,{...i}))}),Uu.createElement(En,{updater:o})}function fb(n){let e=n.getState().components?.Menu??cn;return{renderMenu:t=>pb.createElement(e,{...t}),renderLazyMenu:(t,o)=>db(t,o,e)}}function mb(n,e,t){return VS(n,e,t,fb(e))}function gb(n,e,t){return GS(n,e,t,fb(e))}function hb(){let n=Le(),{getState:e,actions:t}=n,{showOverlay:o,portal:r,clearAll:i}=un({portalContainer:ro()});return Ja(()=>e().cellContextMenu.onChange(JS(n,{clearAll:i,getContent:(a,l)=>mb(a,n,l),show:({menu:a},l)=>o(a,l)})),[]),Ja(()=>Wr(e().cellContextMenuVisibleFor,i,()=>{t.cellContextMenuVisibleFor=null}),[e().cellContextMenuVisibleFor]),{menuPortal:r}}function yb(){let n=Le(),{getState:e,actions:t}=n,{showOverlay:o,portal:r,clearAll:i}=un({portalContainer:ro()});return Ja(()=>e().contextMenu.onChange(eb(n,{clearAll:i,getContent:(a,l)=>gb(a,n,l),show:({menu:a},l)=>o(a,l)})),[]),Ja(()=>Wr(e().contextMenuVisibleFor,i,()=>{t.contextMenuVisibleFor=null}),[e().contextMenuVisibleFor]),{menuPortal:r}}import{useRef as yD}from"react";import*as Sb from"react";import{useCallback as gD,useEffect as hD}from"react";function $u(n,e){let{brain:t}=J(r=>({brain:r.state.brain})),o=gD(n,e);hD(()=>t.onScroll(o),[t,o])}var Yu="yzx0vj0";function bb(n){let{width:e,maxWidth:t,minWidth:o,scrollable:r,...i}=n,a=yD(null);$u(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=de.runtime.totalVisibleColumnsWidthValue:e==="viewport"&&(l.width=de.runtime.bodyWidth),o==="column"?l.minWidth=de.runtime.totalVisibleColumnsWidthValue:o==="viewport"&&(l.minWidth=de.runtime.bodyWidth),t==="column"?l.maxWidth=de.runtime.totalVisibleColumnsWidthValue:t==="viewport"&&(l.maxWidth=de.runtime.bodyWidth),Sb.createElement("div",{ref:a,...i,className:i.className?U(i.className,Yu):Yu,style:l},i.children)}var SD=Y(q.columnWidthAtIndex),bD=Y(q.columnOffsetAtIndex);function TD(){let{computedVisibleColumns:n}=J(e=>({computedVisibleColumns:e.computed.computedVisibleColumns}));return n.map(e=>({id:e.id,width:e.computedWidth,cssVarForWidth:`var(${SD}-${e.computedVisibleIndex})`,offset:e.computedOffset,cssVarForOffset:`var(${bD}-${e.computedVisibleIndex})`,pinned:e.computedPinned}))}var el="InfiniteTable";import{useEffect as CD}from"react";function Tb(){let{getState:n,actions:e,dataSourceActions:t,getDataSourceState:o}=J(c=>({getState:c.getState,actions:c.actions,dataSourceActions:c.dataSourceActions,getDataSourceState:c.getDataSourceState})),{groupBy:r,isTree:i}=o(),a=n(),{brain:l,wrapRowsHorizontally:s}=a,u=a.repeatWrappedGroupRows;s||(u=!1),CD(()=>{if(!s){o().repeatWrappedGroupRows&&(t.repeatWrappedGroupRows=!1);return}let c=()=>{let{rowsPerPage:f,repeatWrappedGroupRows:m}=o(),g=!1,h=l.rowsPerPage,S=(r&&r.length>0||i)&&h>0?h:null;return f!=S&&(t.rowsPerPage=S,g=!0),m!=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])}import{useEffect as tl,useRef as xD}from"react";function ID(){let n=[],e=t=>{Object.keys(t).forEach(o=>{let r=t[o];if(typeof r=="string"){let i=Y(r);if(i.includes("dont-override"))return;n.push(i)}else r&&typeof r=="object"&&e(r)})};return e({...de,loaded:void 0,runtime:void 0}),n}function Cb(n){if(!n)return{};let e=ID(),t=getComputedStyle(n),o={};return e.forEach(r=>{o[r]=t.getPropertyValue(r).trim()}),o}var Ur=me({defaultClassName:"_143ofgf0",variantClassNames:{active:{true:"_143ofgf1",false:"_143ofgf2"}},defaultVariants:{},compoundVariants:[]}),Ib="_143ofgf5",Rb="_143ofgf3";var RD=Y(de.loaded),qu={source:"infinite-table-page",target:"infinite-table-devtools-background"};function wb(n,e){let{type:t,debugId:o}=n;if(t==="unmount")return{...qu,url:Xu(),type:t,payload:{debugId:o}};let r=e,i=r.getComputed(),a=r.getDataSourceState(),l=r.getState();return{...qu,url:Xu(),type:t,payload:{debugId:o,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:Cb(l.domRef.current),themeVarOverrides:{...Yt.get(o)||{}}}}}var Xu=pt(function(){let n=new URL(window.location.href);return n.origin+n.pathname});function wD(n){window.postMessage(n)}var vD=pt(()=>{console.log("Infinite Table DevTools detected!");let n=(e,t)=>{if(t){gt.set(e,t);let{devToolsDetected:o}=t.getState();o||(t.actions.devToolsDetected=!0);let r=t.getDataSourceState();r.debugId!==e&&(t.dataSourceActions.debugId=e),r.devToolsDetected||(t.dataSourceActions.devToolsDetected=!0),window.postMessage(wb({type:"update",debugId:e},t))}else Vh(e),window.postMessage(wb({type:"unmount",debugId:e},null))};return window.__INFINITE_TABLE_DEVTOOLS_HOOK__=n,Xe.onLogIntent("IT:*",e=>{wD({...qu,url:Xu(),type:"log",payload:{debugId:void 0,channel:e.channel,color:e.color,args:e.args.map(t=>{if(typeof t=="object"&&t!==null){let o="";try{o=JSON.stringify(t)}catch{console.error("Cannot stringify arg in global log interceptor",t)}return o}return String(t)}),timestamp:e.timestamp}})}),n}),Zu=he(),PD={revertAll:n=>{let e=gt.get(n.debugId);if(e){let t=Nn.get(n.debugId);Nn.delete(n.debugId),rn.delete(n.debugId),t&&Object.keys(t).forEach(r=>{e.actions[r]=t[r],delete t[r]});let o=ln.get(n.debugId);ln.delete(n.debugId),an.delete(n.debugId),o&&Object.keys(o).forEach(r=>{e.dataSourceActions[r]=o[r],delete o[r]})}},revertProperty:n=>{let e=gt.get(n.debugId);if(e){let t=n.property,o=rn.get(n.debugId),r=Nn.get(n.debugId),i=an.get(n.debugId),a=ln.get(n.debugId),l=t;r&&o&&o[l]!==void 0&&(delete o[l],e.actions[l]=r[l],delete r[l]);let s=t;if(a&&i&&i[s]!==void 0){let u=ln.get(n.debugId)||{};delete i[s],e.dataSourceActions[s]=u[s],delete u[s]}}},discardWarning:n=>{let e=gt.get(n.debugId);if(e){let t=n.warning,o=e.getDataSourceState().debugWarnings;if(o.get(t))o.delete(t),Ln(n.debugId);else{let i=n.warning,a=e.getState().debugWarnings;a.get(i)&&(a.delete(i),Ln(n.debugId))}}},discardAllWarnings:n=>{let e=gt.get(n.debugId);e&&(e.getDataSourceState().debugWarnings.clear(),e.getState().debugWarnings.clear(),Ln(n.debugId))},setColumnVisibility:n=>{Su(n.debugId,"columnVisibility",n.columnVisibility)},setGroupBy:n=>{Fa(n.debugId,"groupBy",n.groupBy)},setGroupRenderStrategy:n=>{Su(n.debugId,"groupRenderStrategy",n.groupRenderStrategy)},setSortInfo:n=>{Fa(n.debugId,"sortInfo",n.sortInfo)},setMultiSort:n=>{Fa(n.debugId,"multiSort",n.multiSort)},setCssVar:n=>{let e=gt.get(n.debugId),t=e?.getState().domRef.current;!e||!t||!n.name?.startsWith("--infinite-")||(t.style.setProperty(n.name,n.value),Yt.set(n.debugId,{...Yt.get(n.debugId)||{},[n.name]:n.value}),Ln(n.debugId))},revertCssVar:n=>{let e=gt.get(n.debugId),t=e?.getState().domRef.current;if(!e||!t)return;t.style.removeProperty(n.name);let o={...Yt.get(n.debugId)||{}};delete o[n.name],Yt.set(n.debugId,o),Ln(n.debugId)},revertAllCssVars:n=>{let e=gt.get(n.debugId),t=e?.getState().domRef.current;if(!e||!t)return;let o=Yt.get(n.debugId)||{};Object.keys(o).forEach(r=>{t.style.removeProperty(r)}),Yt.delete(n.debugId),Ln(n.debugId)},highlight:n=>{let e=gt.get(n.debugId);if(e){let t=e.getState().domRef.current;if(t){let o=t.getBoundingClientRect(),r=document.querySelector(`.${Ur.classNames.base}`);r||(r=document.createElement("div"),r.classList.add(Ur.classNames.base),r.innerHTML=[`<div class="${Rb}"></div>`,`<div class="${Ib}"></div>`].join(""),document.body.appendChild(r));let i=r.firstElementChild;if(r){r.style.left=`${o.left}px`,r.style.top=`${o.top}px`,r.style.width=`${o.width}px`,r.style.height=`${o.height}px`,i.innerHTML=n.debugId;let a=r.lastElementChild,l=()=>{r.classList.remove(Ur.classNames.variants.active.true),a.removeEventListener("animationend",l)};a.addEventListener("animationend",l),r.classList.add(Ur.classNames.variants.active.true)}}}}};function DD(){typeof window<"u"&&window.addEventListener("message",n=>{if(n&&n.data&&typeof n.data.source=="string"&&typeof n.data.target=="string"&&n.data.target==="infinite-table-page"&&n.data.source.startsWith("infinite-table-devtools-contentscript")&&(window.__INFINITE_TABLE_DEVTOOLS_HOOK__||(vD(),Zu(window.__INFINITE_TABLE_DEVTOOLS_HOOK__)),typeof n.data.type=="string")){let e=n.data.type,t=PD[e];t&&t(n.data.payload)}})}DD();function vb(n,e){if(!e)return;getComputedStyle(e).getPropertyValue(RD)!==`${bi}`&&_r({debugId:n,key:"CSS001_CSS"})}function Qu(){return Zu.get()}function Pb(n){return Zu.onChange(e=>{e&&n(e)})}function Db(n){let e=globalThis.__INFINITE_TABLE_DEVTOOLS_HOOK__;e&&e(n,null)}function xb(){let{getState:n,getDataSourceState:e,dataSourceActions:t}=J(a=>({getState:a.getState,getDataSourceState:a.getDataSourceState,dataSourceActions:a.dataSourceActions})),o=n(),{domRef:r,debugId:i}=o;return i&&vb(i,r.current),tl(()=>{e().debugId!==i&&(t.debugId=i)},[i]),MD()}function MD(){let{getState:n,getComputed:e,getDataSourceState:t,dataSourceActions:o,actions:r,dataSourceApi:i,api:a}=J(c=>({getState:c.getState,getComputed:c.getComputed,getDataSourceState:c.getDataSourceState,dataSourceActions:c.dataSourceActions,actions:c.actions,dataSourceApi:c.dataSourceApi,api:c.api})),s=n().debugId,u=xD(s);return u.current=s,tl(()=>{let c=u.current;if(!c)return;let d=f=>{f(c,{getState:n,getDataSourceState:t,getComputed:e,dataSourceActions:o,actions:r,api:a,dataSourceApi:i})},p=Qu();if(p){d(p);return}return Pb(d)},[]),tl(()=>{let c=u.current;if(!c)return;let d=Qu();d&&d(c,{getState:n,getDataSourceState:t,getComputed:e,dataSourceActions:o,actions:r,api:a,dataSourceApi:i})}),tl(()=>{if(s)return()=>{Db(s)}},[s]),s}function ED(){let{masterPortalDOMRef:n}=ri(o=>({masterPortalDOMRef:o.getMasterState().portalDOMRef}))??{},e=J(o=>o.state.portalDOMRef);return n?.current??e?.current}import*as xt from"react";import{useCallback as AD,useMemo as _D}from"react";var Mb="hs68h8j _16lm1iwk _16lm1iwx _16lm1iw2n",Eb=me({defaultClassName:"hs68h8e _16lm1iw1x _16lm1iw2j _16lm1iw1p",variantClassNames:{active:{true:"hs68h8f _16lm1iwn _16lm1iw1h",false:"_16lm1iwo"},draggingInProgress:{true:"hs68h8h",false:"hs68h8i"}},defaultVariants:{},compoundVariants:[]}),Ab="hs68h81",_b=me({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"]]});import*as io from"react";function Ob(n){return io.createElement("div",{...n.domProps})}function Fb(n){let{active:e}=n;return io.createElement("div",{className:Ab},e?"Drop to group":"Drag columns to group")}function Nb(n){let e=t=>{(t.key==="Enter"||t.key===" ")&&(t.preventDefault(),n.onClear?.())};return io.createElement("div",{...n.domProps},n.label,io.createElement("div",{className:ai[1]}),io.createElement("div",{tabIndex:0,role:"button","aria-label":`Clear grouping by ${n.field}`,className:Mb,onKeyDown:e,onMouseDown:n.onClear},io.createElement(Qa,{size:20})))}var OD=(n,e)=>t=>{e&&e(t);let o=Date.now(),r=!1,i=()=>{r=!0};_e().addEventListener("mousemove",i,{once:!0}),_e().addEventListener("mouseup",()=>{r||(_e().removeEventListener("mousemove",i),Date.now()-o<200&&requestAnimationFrame(()=>{n()}))},{once:!0})};function FD(n){let{column:e,onClear:t,components:o,field:r,id:i,toggleSorting:a}=n,{dragSourceListId:l,dragItemId:s,dragListId:u}=No(),c=l===u,d=Le(),p=(e?bo(e.id,d,"grouping-toolbar"):r)??i,f=e?xt.createElement($i,{forceSize:!0,size:20,direction:e.computedSortedAsc?1:e.computedSortedDesc?-1:0}):null,m=xt.createElement(xt.Fragment,null,p,f),g=s===i&&l===u,h=U(Eb({draggingInProgress:c,active:g}),n.domProps?.className),S=OD(a,n.domProps?.onMouseDown),y={...n.domProps,className:h,onMouseDown:S},C=o?.ToolbarItem??Nb;return xt.createElement(C,{active:g,domProps:y,column:e,field:r,label:m,onClear:t})}function Lb(n){let{groupBy:e}=Fe(T=>({groupBy:T.dataSourceState.groupBy})),{getComputed:t,dataSourceApi:o,api:r}=J(T=>({getComputed:T.getComputed,dataSourceApi:T.dataSourceApi,api:T.api})),{dropTargetListId:i,dragSourceListId:a}=Rn(),{fieldsToColumn:l,computedColumnsMap:s}=t(),u=$n(_i),c=$n(Ai),d=_D(()=>[c,u],[c,u]),p=i===u,f=a===u,m=n.components?.Placeholder??Fb,g=n.components?.Host??Ob,h=e.length?xt.createElement(xt.Fragment,null,e.map((T,R)=>{let v=T.field?l.get(T.field):void 0,w=`${T.field??`idx-${R}`}`;return xt.createElement(Zn.DraggableItem,{key:w,id:w},P=>xt.createElement(FD,{id:w,components:n.components,domProps:P,field:T.field,column:v,toggleSorting:()=>{v&&r.toggleSortingForColumn(v.id)},onClear:()=>{let x=e.filter(M=>M!==T).filter(Boolean);o.setGroupBy(x)}}))})):xt.createElement(m,{draggingInProgress:f,active:p,groupBy:e}),S=T=>{let R=T.map(v=>e[v]);o.setGroupBy(R)},y=T=>{let{dragItemId:R}=T,v=R,w=s.get(v);if(!w||!w.field||!w.computedGroupable)return;let P=[...e];P.splice(T.dropIndex,0,{field:w.field}),o.setGroupBy(P)},C=AD(T=>{let{computedColumnsMap:R}=t(),v=T.dragItem.id,w=R.get(v);return!(!w||!w.computedGroupable||e.some(P=>P.field===w.field))},[e]),b=n.orientation??"horizontal",{domProps:I}=n;return xt.createElement(Zn,{orientation:b,dragListId:u,acceptDropsFrom:d,onDrop:S,dragStrategy:"inline",onAcceptDrop:y,shouldAcceptDrop:C},(T,{draggingInProgress:R,status:v})=>{let w=U(_b({active:p,orientation:b,draggingInProgress:R,dropRejected:v==="rejected"}),T.className,I?.className),P={...T,...I,className:w,children:h};return xt.createElement(g,{active:p,rejectDrop:v==="rejected",domProps:P,orientation:b})})}import*as Uo from"react";import{useMemo as Ju}from"react";import{useCallback as GD,useEffect as $r,useRef as HD}from"react";import*as nl from"react";function kb(n){let{dataArray:e,brain:t,computedPinnedEndColumns:o,computedPinnedStartColumns:r,computedVisibleColumns:i,computedRowHeight:a,columnSize:l,rowspan:s}=n;return ha(t,{colWidth:l,rowHeight:a,rows:e.length,cols:i.length,rowspan:s},{fixedColsEnd:o.length,fixedColsStart:r.length}),t}import*as dn from"react";var zb=me({defaultClassName:"evqes20",variantClassNames:{},defaultVariants:{},compoundVariants:[]});import{useMemo as Hb}from"react";function ND(n,e){let{masterState:t,detailContext:o}=e,r=t.detailDataSourcesStateToRestore;if(r.has(n)){let i=r.get(n);return o.assignState(i),!0}return!1}function LD(n,e){let{detailState:t,masterState:o,masterActions:r,cacheEntryForRow:i}=e,a=new Map(o.detailDataSourcesStateToRestore),l=wh(t);i.all||(i.groupBy||delete l.groupBy,i.sortInfo||delete l.sortInfo,i.filterValue||delete l.filterValue,i.data||delete l.originalDataArray),a.set(n,l),r.detailDataSourcesStateToRestore=a}function Vb(n,e){let t={current:!1};return{currentRowCache:{getRowId:()=>n,add:r=>{t.current=!0,e.add(n,r)},get:()=>e.get(n),delete:()=>(t.current=!0,e.delete(n)),has:()=>e.has(n)},cacheCalledByRowDetailRenderer:t}}function Gb(n){let{rowInfo:e,currentRowCache:t,cacheCalledByRowDetailRenderer:o,getMasterDataSourceState:r,masterActions:i,getMasterState:a}=n,l=r().detailDataSourcesStateToRestore.has(e.id)&&t.has(),u={registerDetail:pt(c=>{if(o.current||t.add({all:!0}),!t.has()){requestAnimationFrame(()=>{c.dataSourceState.destroyedRef.current||(c.dataSourceActions.stateReadyAsDetails=!0)});return}ND(e.id,{masterState:r(),detailContext:c}),requestAnimationFrame(()=>{c.dataSourceState.destroyedRef.current||(c.dataSourceActions.stateReadyAsDetails=!0)}),c.dataSourceState.onCleanup.onChange(()=>{let d=t.get();d&&LD(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 Kb(n){let{rowDetailsCache:e,rowInfo:t}=n,{getDataSourceState:o,dataSourceActions:r}=Fe(u=>({getDataSourceState:u.getDataSourceState,dataSourceActions:u.dataSourceActions})),{getMasterState:i}=J(u=>({getMasterState:u.getState})),{currentRowCache:a,cacheCalledByRowDetailRenderer:l}=Hb(()=>Vb(t.id,e),[e,t.id]),s=Hb(()=>Gb({rowInfo:t,currentRowCache:a,cacheCalledByRowDetailRenderer:l,getMasterDataSourceState:o,masterActions:r,getMasterState:i}),[t.id,a]);return s.masterRowInfo=t,s.getMasterDataSourceState=o,s.getMasterState=i,{masterDetailContextValue:s,currentRowCache:a}}function Bb(){return hn()}var{rootClassName:kD}=ke,zD=`${kD}RowDetail`;function VD(n){let{domRef:e,rowDetailRenderer:t,rowDetailHeight:o,rowInfo:r,detailOffset:i,rowDetailsCache:a}=n,{masterDetailContextValue:l,currentRowCache:s}=Kb({rowDetailsCache:a,rowInfo:r}),u=po(),[c]=dn.useState(()=>Bb());return c.setSnapshot(l),dn.useLayoutEffect(()=>{c.notify()},[l]),dn.createElement(u.Provider,{value:c},dn.createElement("div",{ref:e,className:U(zD,zb({})),style:{position:"absolute",top:`${i}px`,left:0,width:`calc(${q.bodyWidth} - ${q.scrollbarWidthVertical})`,height:o}},t(r,s)))}var Wb=dn.memo(VD);var KD=1;function jb(n){let{computed:e,bodySize:t,imperativeApi:o}=n,{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:h,isRowDetailsEnabled:S,cellClassName:y,cellStyle:C,repaintCellsKey:b,rowStyle:I,rowDetailCache:T,rowClassName:R,onScrollToTop:v,onScrollToBottom:w,onScrollStop:P,scrollToBottomOffset:x,wrapRowsHorizontally:M,updatedAt:D,ready:E,editingCell:L}=J(O=>({actions:O.actions,getState:O.getState,getComputed:O.getComputed,getDataSourceMasterContext:O.getDataSourceMasterContext,rowHeight:O.state.rowHeight,rowDetailHeight:O.state.rowDetailHeight,onRowMouseEnter:O.state.onRowMouseEnter,onRowMouseLeave:O.state.onRowMouseLeave,groupRenderStrategy:O.state.groupRenderStrategy,brain:O.state.brain,showZebraRows:O.state.showZebraRows,rowDetailRenderer:O.state.rowDetailRenderer,isRowDetailsExpanded:O.state.isRowDetailExpanded,isRowDetailsEnabled:O.state.isRowDetailEnabled,cellClassName:O.state.cellClassName,cellStyle:O.state.cellStyle,repaintCellsKey:O.state.repaintCellsKey,rowStyle:O.state.rowStyle,rowDetailCache:O.state.rowDetailCache,rowClassName:O.state.rowClassName,onScrollToTop:O.state.onScrollToTop,onScrollToBottom:O.state.onScrollToBottom,onScrollStop:O.state.onScrollStop,scrollToBottomOffset:O.state.scrollToBottomOffset,wrapRowsHorizontally:O.state.wrapRowsHorizontally,updatedAt:O.state.updatedAt,ready:O.state.ready,editingCell:O.state.editingCell})),{computedPinnedStartColumns:V,computedPinnedEndColumns:N,computedVisibleColumns:k,computedColumnsMap:F,computedColumnOrder:B,computedRowHeight:$,computedRowSizeCacheForDetails:_,fieldsToColumn:H,rowspan:z,toggleGroupRow:Z,columnSize:be}=e,se=Ju(()=>k.map(O=>O.id),[k]),{dataArray:pe,rowInfoStore:Pe,selectionMode:De,cellSelection:ce,isNodeReadOnly:te,getDataSourceState:le,dataSourceApi:ge,dataSourceActions:j}=Fe(O=>({dataSourceApi:O.dataSourceApi,dataSourceActions:O.dataSourceActions,getDataSourceState:O.getDataSourceState,dataArray:O.dataSourceState.dataArray,rowInfoStore:O.dataSourceState.rowInfoStore,selectionMode:O.dataSourceState.selectionMode,cellSelection:O.dataSourceState.cellSelection,isNodeReadOnly:O.dataSourceState.isNodeReadOnly})),ee=Ne(pe);kb({columnSize:be,brain:f,computedPinnedStartColumns:V,computedPinnedEndColumns:N,computedVisibleColumns:k,computedRowHeight:$,dataArray:pe,bodySize:t,rowspan:z});let K=HD(0);$r(()=>f.onRenderCountChange(()=>{K.current=f.scrollTopMax}),[f]),$r(()=>f.onRenderRangeChange(O=>{i().onRenderRangeChange?.(O)}),[f]),$r(()=>f.onScrollStop(O=>{let{scrollTop:A,scrollLeft:ue}=O;if(A===0&&v?.(),A+(x??KD)>=K.current){w?.();let{livePagination:Se,livePaginationCursor:xe,dataArray:Ze}=le();Se&&(j.cursorId=xe!==void 0?Date.now():Ze.length)}if(P){let Se=f.getRenderRange();P({scrollTop:A,scrollLeft:ue,renderRange:Se,viewportSize:i().bodySize,firstVisibleRowIndex:Se.start[0],lastVisibleRowIndex:Se.end[0],firstVisibleColIndex:Se.start[1],lastVisibleColIndex:Se.end[1]})}}),[f,v,w,P]),$r(()=>{t.height&&(r.ready=!0)},[!!t.height]),$r(()=>{let{onReady:O}=i();O&&O({api:o,dataSourceApi:ge})},[E]);let ie=Ju(()=>({isNodeReadOnly:te,selectionMode:De,cellSelection:ce}),[te,De,ce]),ne=GD(O=>{let{rowIndex:A,colIndex:ue,heightWithRowspan:Ie,domRef:ye,hidden:Se,width:xe,onMouseLeave:Ze,onMouseEnter:Qe}=O,ot=ee()[A],$e=k[ue];if(!ot||!$e)return null;let Ye=_?_.getRowHeight(A):Ie,G=!1;!S||typeof S=="function"&&!S(ot)?G=!1:h&&(G=h(ot)?"expanded":"collapsed");let Q=M?f.getRowIndexInPage(A):null,fe=M?f.getPageIndexForRow(A):null,Te=o.isEditorVisibleForCell({rowIndex:A,columnId:$e.id}),rt={getData:ee,virtualized:!0,showZebraRows:m,groupRenderStrategy:p,rowIndexInHorizontalLayoutPage:Q,horizontalLayoutPageIndex:fe,rowIndex:A,rowInfoStore:Pe,hidden:Se,toggleGroupRow:Z,rowHeight:Ye,rowDetailState:G,onMouseEnter:Qe,onMouseLeave:Ze,onRowMouseEnter:c,onRowMouseLeave:d,domRef:ye,width:xe,column:$e,columnsMap:F,fieldsToColumn:H,rowStyle:I,rowClassName:R,cellStyle:C,cellClassName:y,repaintCellsKey:$e.repaintCellsKey!==void 0?$e.repaintCellsKey:b,visibleColumnIds:se,computedColumnOrder:B,inEditMode:Te,getDataSourceState:le,dataSourceApi:ge,dataSourceActions:j,getState:i,imperativeApi:o,componentActions:r,getComputed:a,getDataSourceMasterContext:l,dataSourceStatePartialForCell:ie};return nl.createElement(Kf,{...rt})},[s,u,c,d,_,$,h,ee,k,F,H,p,M,Z,m,f,Pe,I,R,y,C,b,le,ge,j,i,o,r,a,l,se,B,D,L,ie]),oe=Ju(()=>{if(h)return O=>{let{rowIndex:A,domRef:ue}=O,ye=ee()[A];if(!ye||!h(ye)||!_)return nl.createElement("div",{ref:ue,className:Xc.hidden});let{rowDetailHeight:Se,rowHeight:xe}=_.getSize(A);return nl.createElement(Wb,{rowInfo:ye,rowDetailsCache:T,rowIndex:A,domRef:ue,detailOffset:xe,rowDetailHeight:Se,rowDetailRenderer:g})}},[E,ne,g,u,h,T]);return{renderCell:ne,renderDetailRow:oe}}import{useEffect as BD}from"react";function Ub(){let{state:n,getState:e,actions:t}=J(i=>({state:i.state,getState:i.getState,actions:i.actions})),{wrapRowsHorizontally:o}=n,r=Gn(o);BD(()=>{if(r!==o){let{brain:i,headerBrain:a,renderer:l,onRenderUpdater:s}=e();i.destroy(),a.destroy(),l.destroy(),s.destroy();let u=Du(el,!!o);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,o])}import*as qb from"react";var $b="_16lm1iw1 _16lm1iw1c _16lm1iwe";var Yb=U($b,ss);function Xb(n){return qb.createElement("div",{...n,className:n.className?U(Yb,n.className):Yb})}import*as jo from"react";var Zb={visible:"qy58ya1 qy58ya0 _16lm1iw2 _16lm1iw23 _16lm1iw26 _16lm1iw2c _16lm1iw2a",hidden:"qy58ya2 qy58ya0 _16lm1iw2 _16lm1iw23 _16lm1iw26 _16lm1iw2c _16lm1iw2a"},Qb="qy58ya3 _16lm1iw2 _16lm1iw23 _16lm1iw26 _16lm1iw2c _16lm1iw2a",Jb="qy58ya4";var{rootClassName:WD}=ke,ec=`${WD}-LoadMask`;function jD(n){let{visible:e,children:t="Loading"}=n;return jo.createElement("div",{className:`${Zb[e?"visible":"hidden"]} ${ec}`},jo.createElement("div",{className:`${Qb} ${ec}-Overlay`}),jo.createElement("div",{className:`${Jb} ${ec}-Text`},t))}var ol=jo.memo(jD);import{useMemo as UD}from"react";var $D=[Of,`${jt}--hovered`];function YD(n){return Array.isArray(n)&&(n=n.join(" ")),n.split(" ").map(e=>e.trim()).filter(Boolean)}function ao(n){let e=Le(),t=Vn(),{getComputed:o,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:h,activeCellIndex:S,rowDetailRenderer:y,showHoverRows:C,wrapRowsHorizontally:b,domProps:I,domRef:T,forceBodyRerenderTimestamp:R,rowHoverClassName:v,ready:w}=J(_=>({ready:_.state.ready,columnReorderDragColumnId:_.state.columnReorderDragColumnId,forceBodyRerenderTimestamp:_.state.forceBodyRerenderTimestamp,renderer:_.state.renderer,onRenderUpdater:_.state.onRenderUpdater,debugId:_.state.debugId,keyboardNavigation:_.state.keyboardNavigation,activeRowIndex:_.state.activeRowIndex,loadingText:_.state.loadingText,scrollStopDelay:_.state.scrollStopDelay,brain:_.state.brain,scrollerDOMRef:_.state.scrollerDOMRef,components:_.state.components,bodySize:_.state.bodySize,activeCellIndex:_.state.activeCellIndex,rowDetailRenderer:_.state.rowDetailRenderer,showHoverRows:_.state.showHoverRows,wrapRowsHorizontally:_.state.wrapRowsHorizontally,domProps:_.state.domProps,domRef:_.state.domRef,rowHoverClassName:_.state.rowHoverClassName})),P=g?.LoadMask??ol,x=o(),{computedRowHeight:M,computedRowSizeCacheForDetails:D}=x,E=D?.getRowHeight||M,{loading:L}=Fe(_=>({loading:_.dataSourceState.loading})),V=Uo.useCallback(_=>{let H=e.getState(),z=_.target;if(!t&&_._from_row_detail)return;t&&(_._from_row_detail=!0);let Z=ep(z,Pu(),H.domRef.current),be,se,pe,Pe;Z&&(se=Number(Z.dataset.colIndex),Pe=Number(Z.dataset.rowIndex),be=e.getComputed().computedVisibleColumns[se].id,pe=e.dataSourceApi.getRowInfoArray()[Pe].id);let De={columnId:be,colIndex:se,rowId:pe,rowIndex:Pe,event:_,target:Z??_.target};Z&&H.cellContextMenu(De),H.contextMenu(De)},[]),{renderCell:N,renderDetailRow:k}=jb({imperativeApi:r,getComputed:o,domRef:T,bodySize:h,computed:x}),{autoFocus:F,tabIndex:B}=I??{};Ub();let $=UD(()=>{if(!C)return;let _=[];return v&&(_=_.concat(v)),n.rowHoverClassName&&(_=_.concat(n.rowHoverClassName)),ao.rowHoverClassName&&(_=_.concat(ao.rowHoverClassName)),YD(_)},[C,v,n.rowHoverClassName,ao.rowHoverClassName]);return Uo.createElement(Xb,{onContextMenu:V},Uo.createElement(sg,{forceRerenderTimestamp:R,debugId:l,tabIndex:B??0,autoFocus:F??void 0,activeRowIndex:w&&s==="row"?u:null,activeCellIndex:w&&s==="cell"&&!d?S:null,scrollStopDelay:p,renderer:i,wrapRowsHorizontally:b,onRenderUpdater:a,brain:f,activeCellRowHeight:E,renderCell:N,renderDetailRow:y?k:void 0,cellHoverClassNames:$,scrollerDOMRef:m,scrollVarHostRef:T}),Uo.createElement(P,{visible:L},c))}ao.rowHoverClassName=$D;function qD(){return J(n=>n.api)}function XD(n){return J(e=>e.api.getColumnApi(n))}var Qt=ke.rootClassName,{ManagedComponentContextProvider:ZD}=Ot({initSetupState:ey,forwardProps:ty,mapPropsToState:iy,cleanup:ny,allowedControlledPropOverrides:{rowHeight:!0,columnHeaderHeight:!0},mappedCallbacks:ry(),getParentState:()=>cu(n=>n),debugName:n=>An(n.debugId,el)}),QD=ve.memo(function(){let e=ni(),{componentState:t,api:o,initialChildren:r}=J(F=>({componentState:F.state,api:F.api,initialChildren:F.children})),{dataArrayLength:i,getDataSourceState:a,dataSourceActions:l,dataSourceApi:s}=Fe(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:h,columnHeaderHeightCSSVar:S,scrollStopDelay:y,brain:C,activeRowIndex:b,activeCellIndex:I}=t,{licenseKey:T}=t;T===void 0&&pn.licenseKey&&(T=pn.licenseKey),Ly(b,i,o),Oy(I,i,o);let{onKeyDown:R}=Zy();ve.useEffect(()=>{let F=a(),B=Xt($=>{F.notifyRenderRangeChange({renderStartIndex:$[0],renderEndIndex:$[1]})},{wait:y});return C.onVerticalRenderRangeChange(B)},[C,y]);let v=Ey(T),{autoFocus:w,tabIndex:P,...x}=t.domProps??{},M=bp(x);ve.useEffect(()=>{C.setScrollStopDelay(y),l.scrollStopDelayUpdatedByTable=y},[y]),Zg(),Tb(),ab();let{menuPortal:D}=ob(),{menuPortal:E}=hb(),{menuPortal:L}=yb(),{menuPortal:V}=cb();ve.useEffect(()=>{typeof globalThis.__DO_NOT_USE_UNLESS_YOU_KNOW_WHAT_YOURE_DOING_IS_READY=="function"&&globalThis.__DO_NOT_USE_UNLESS_YOU_KNOW_WHAT_YOURE_DOING_IS_READY(t.id,t.ready,o,{dataSourceApi:s})},[t.ready,o,s]);let N=xb();ve.useEffect(()=>{if(e){let F=e.getSnapshot();c.current=F.getMasterState().portalDOMRef.current}},[]);let k=r??ve.createElement(ve.Fragment,null,ve.createElement(Ys,null),ve.createElement(ao,null));return ve.createElement("div",{"data-debug-id":N,onKeyDown:R,ref:u,...M},k,ve.createElement("div",{ref:c,className:U(`${nt}Portal`,Zc[1e7],li.absolute,Yc[0],jc[0])},D,E,L,V),g?ve.createElement(Qo,{key:"row-height",varName:g,onChange:d}):null,ve.createElement(Qo,{key:"flashing-duration",allowInts:!0,varName:de.components.Cell.flashingDuration,onChange:p}),h?ve.createElement(Qo,{key:"row-detail-height",varName:h,onChange:f}):null,S?ve.createElement(Qo,{key:"column-header-height",varName:S,onChange:m}):null,v==="valid"?null:ve.createElement(Ag,{invalid:v==="invalid"}),ve.createElement(ib,null))});function JD({children:n,store:e}){let{componentActions:t,componentState:o}=Ft(),{scrollerDOMRef:r,scrollTopKey:i}=o,a=Ne(o),l=wy({state:o,actions:t,getState:a}),s=Ne(l),u=ni(),{getDataSourceState:c,dataSourceActions:d,getDataSourceMasterContext:p,dataSourceApi:f}=Ut(),[m]=ve.useState(()=>Yg({getComputed:s,getState:a,getDataSourceState:c,getDataSourceMasterContext:p,dataSourceApi:f,actions:t,dataSourceActions:d})),g={actions:t,state:o,computed:l,dataSourceActions:d,getDataSourceMasterContext:p,getDataSourceState:c,getComputed:s,getState:a,api:m,dataSourceApi:f,children:n};return e.setSnapshot(g),ve.useLayoutEffect(()=>{e.notify()}),Zr(r,h=>{let S={width:h.width,height:h.height};t.bodySize=S},{earlyAttach:!0,debounce:50}),ve.useEffect(()=>{r.current&&(r.current.scrollTop=0)},[i,r]),ve.createElement(QD,null)}var pn=function(n){let[e]=ve.useState(()=>ky()),t=rr();return ve.createElement(ZD,{repeatWrappedGroupRows:!!n.wrapRowsHorizontally,rowHeight:Vr,columnHeaderHeight:zr,...n},ve.createElement(ls,null,ve.createElement(t.Provider,{value:e},ve.createElement(JD,{children:n.children,store:e}))))};pn.Header=Ys;pn.Body=ao;pn.HScrollSyncContent=bb;pn.Footer=()=>ve.createElement(Jc,null);pn.GroupingToolbar=Lb;import*as eT from"react";function Uq(n){let{DataSource:e}=Fr({nodesKey:"children",...n});return eT.createElement(e,null,n.children??null)}import*as nT from"react";var tT=n=>(t,{unfilteredTreePaths:o,treeSelectionState:r,prevTreeSelectionState:i,lastUpdatedNodeInfo:a})=>{let l=new et(i,{treePaths:o});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()};n(u)};function ex(n){return nT.createElement(pn,{...n})}var rl=class{constructor(e){this.state="idle";this.result=void 0;this.error=void 0;this.doneAt=0;this.pendingPromise=void 0;this.debugName="";this.fetch=async(e,...t)=>{this.state="loading";let o=()=>{};try{this.logger(`Fetching query ${this.debugName}...`),this.pendingPromise=new Promise(r=>{o=r}),this.result=await e(...t),this.state="success"}catch(r){this.result=void 0,this.error=r,this.state="error"}return this.doneAt=Date.now(),this.pendingPromise=void 0,o(this),this.logger(`Fetched query ${this.debugName}. State: ${this.state}.`),this.getDoneSnapshot()};this.getCurrentSnapshot=()=>{let e={state:this.state,result:this.result,doneAt:this.doneAt,error:this.error,done:this.isDone()};return e.done||(e.promise=this.pendingPromise),e};this.getDoneSnapshot=async()=>{if(this.state==="idle")throw new Error("DataQuery is still idle");return this.pendingPromise&&await this.pendingPromise,{state:this.state,result:this.result,error:this.error,done:this.isDone(),doneAt:this.doneAt}};this.getResult=()=>{if(!this.isDone())throw new Error("DataQuery is not done yet");return this.result};this.isDone=()=>this.state==="success"||this.state==="error";this.isSuccess=()=>this.state==="success";this.debugName=e||"",this.logger=Xe(`IT:${e}:DataQuery`)}};function $o(n){if(Array.isArray(n))return n.map($o);if(typeof n=="object"){if(n===null)return n;let e=n,t=Object.keys(e).sort((r,i)=>r.localeCompare(i)),o={};return t.forEach(r=>{let i=e[r];i!==void 0&&(o[r]=$o(i))}),JSON.stringify(o)}return n instanceof Date?n.toISOString():n}var fn=class fn{constructor(e){this.queryCache=new W;this.removeQueryIfErrored=(e,t)=>{if(e.getCurrentSnapshot().state!=="success"){let o=this.queryCache.get(t);if(e===o)return this.queryCache.delete(t),!0}return!1};this.fireQuery=e=>{let t=$o(e.key),o=this.options.cache?this.queryCache.get(t):null;if(o!=null){let i=o.getCurrentSnapshot();if(i.state==="success")return{query:o,fromCache:!0};if(i.state==="loading")return{query:o,fromCache:!0};i.state==="error"&&this.removeQueryIfErrored(o,t)}let r=new rl(`${this.name}:${e.name}`);return this.queryCache.set(t,r),r.fetch(e.fn,e.key),r.getCurrentSnapshot().promise?.then(()=>{this.removeQueryIfErrored(r,t)}),{query:r,fromCache:!1}};this.query=e=>this.fireQuery(e).query.getCurrentSnapshot();this.awaitQuery=async e=>{let{query:t,fromCache:o}=this.fireQuery(e),r=t.getCurrentSnapshot();return r.promise&&(r=await t.getDoneSnapshot(),r.state==="error"&&o)?await this.fireQuery(e).query.getDoneSnapshot():r};this.isQueryInProgress=e=>{let t=$o(e);return this.queryCache.get(t)?.getCurrentSnapshot().done??!1};this.hasQueryForKey=e=>{let t=$o(e);return this.queryCache.has(t)};this.discardQueryForKey=e=>{let t=$o(e);this.queryCache.delete(t)};if(this.options=e,fn.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)}fn.clients.set(e.name,this),this.name=e.name}static destroy(e){let t=fn.clients.get(e);t&&t.destroy()}static destroyAll(){fn.clients.forEach(e=>{fn.destroy(e.name)})}destroy(){fn.clients.delete(this.options.name)}};fn.clients=new Map;var oT=fn;var tx={key:"*",when:n=>{let{activeCellIndex:e}=n.getState();if(e){let[t,o]=e,r=n.api.getColumnAtIndex(o);return r?n.api.isCellEditable({rowIndex:t,columnId:r.id}):!1}return!1},handler:(n,e)=>{let{key:t}=e;if(t!="Escape"&&t.length===1){let{activeCellIndex:o}=n.getState();if(o){let[r,i]=o,a=n.api.getColumnAtIndex(i);if(!a)return;requestAnimationFrame(()=>{n.api.startEdit({rowIndex:r,value:t,columnId:a.id})})}}}},nx={instantEdit:tx};import{useEffect as y9}from"react";function ox(n,e){let{set:t,delete:o,clear:r}=n;return e.set&&(n.set=(i,a)=>(t.call(n,i,a),e.set(i,a),n)),e.delete&&(n.delete=i=>{let a=o.call(n,i);return e.delete(i),a}),(e.clear||e.beforeClear)&&(n.clear=()=>{e.beforeClear&&e.beforeClear(n);let i=r.call(n);return e.clear&&e.clear(),i}),()=>{t&&(n.set=t),o&&(n.delete=o),r&&(n.clear=r)}}var il=class il{constructor(e,t){this.orderRefs=[];if(typeof e=="number")this.maxSize=e,this.currentSet=new Set;else if(this.maxSize=t??il.DEFAULT_SIZE,e){let o=Array.from(e);this.maxSize<o.length&&o.slice(o.length-this.maxSize),this.currentSet=new Set,o.forEach(r=>{this.add(r)})}else this.currentSet=new Set}values(){return this.currentSet.values()}get size(){return this.currentSet.size}delete(e){return this.currentSet.has(e)?(this.currentSet.delete(e),this.orderRefs=this.orderRefs.filter(t=>t!==e),!0):!1}has(e){return this.currentSet.has(e)}add(e){if(this.currentSet.has(e))return this;if(this.maxSize-this.currentSet.size<=0){let[o]=this.orderRefs.splice(0,1);o&&this.currentSet.delete(o)}return this.orderRefs.push(e),this.currentSet.add(e),this}};il.DEFAULT_SIZE=10;var tc=il;var al=class al{constructor(e,t){this.orderRefs=[];if(typeof e=="number")this.maxSize=e,this.currentSet=new Set;else if(this.maxSize=t??al.DEFAULT_SIZE,e){let o=Array.from(e);this.maxSize<o.length&&o.slice(o.length-this.maxSize),this.currentSet=new Set,o.forEach(r=>{this.add(r)})}else this.currentSet=new Set}values(){return this.currentSet.values()}get size(){return this.currentSet.size}delete(e){return this.currentSet.has(e)?(this.currentSet.delete(e),this.orderRefs=this.orderRefs.filter(t=>t.deref()!==e),!0):!1}has(e){return this.currentSet.has(e)}add(e){if(this.currentSet.has(e))return this;if(this.maxSize-this.currentSet.size<=0){let[o]=this.orderRefs.splice(0,1),r=o.deref();r&&this.currentSet.delete(r)}return this.orderRefs.push(new WeakRef(e)),this.currentSet.add(e),this}};al.DEFAULT_SIZE=10;var nc=al;import{useEffect as rx,useRef as ll}from"react";var ix=(n,e)=>n.every((t,o)=>t===e[o]),ax=(n,e)=>{let t=ll(e),o=ix(e,t.current),r=ll(!0);t.current=e;let i=ll(["same"]),a=o?[Date.now()]:i.current;i.current=a;let l=ll(n);l.current=n,rx(()=>{if(r.current){r.current=!1;return}return l.current()},a)};import{useEffect as lx,useRef as Yr}from"react";var rT=(n,e,t)=>n.every((o,r)=>t?t(o,e[r]):o===e[r]),oc=(n,e)=>{let{same:t,different:o,compare:r}=e,i=Yr(t),a=Yr(o),l=rT(t,i.current,r),s=!rT(o,a.current,r),u=Yr(!0);i.current=t,a.current=o;let c=Yr(["same"]),d=l&&s?[Date.now()]:c.current;c.current=d;let p=Yr(n);p.current=n,l&&s&&(u.current=!1),lx(()=>{if(!u.current)return p.current()},d)};import*as Mt from"react";var iT=Y(q.currentFlashingDuration),sx=({children:n})=>Mt.createElement(Mt.Fragment,null,n),aT=1e3,lT={up:Oi({direction:"up"}).split(" "),down:Oi({direction:"down"}).split(" "),neutral:Oi({direction:"neutral"}).split(" ")},sT=(n={})=>{let{flashDuration:e,flashClassName:t,render:o=sx}=n;return Mt.forwardRef((i,a)=>{let l=Wi(),{flashingDurationCSSVarValue:s}=J(R=>({flashingDurationCSSVarValue:R.state.flashingDurationCSSVarValue})),u=typeof s=="number"?s??e??aT:e??aT,{domRef:c,value:d,column:p,rowInfo:f,htmlElementRef:m}=l,g=f.id,h=p.id,S=Mt.useRef(!0),y=Mt.useRef(d),C=S.current?null:y.current;S.current=!1;let b=Mt.useRef(void 0),I=Mt.useRef(void 0),T=Mt.useRef(void 0);return oc(()=>{if(d===y.current)return;let R=()=>{let x=m.current;if(b.current&&(clearTimeout(b.current),b.current=void 0),T.current&&(clearTimeout(T.current),T.current=void 0),I.current&&x){let M=I.current,D=lT[M];x.classList.remove(...t?[t,...D]:D),x.style.removeProperty(iT),I.current=void 0}};y.current=d;let v=m.current;if(!v)return;R();let w=typeof d=="number"?d>C?"up":"down":"neutral",P=lT[w];return v.style.setProperty(iT,`${u}`),v.classList.add(...t?[t,...P]:P),I.current=w,b.current=setTimeout(R,u),R},{same:[h,g],different:[d]}),Mt.createElement("div",{ref:c,...i,className:U(i.className)},o({children:i.children,oldValue:C}))})},ux=sT();import*as tt from"react";import{useEffect as cT,useRef as uT}from"react";import{createPortal as cx}from"react-dom";function dx(n){let[e,t]=tt.useState(null);return cT(()=>{let{debugTarget:o}=n,r=setInterval(()=>{if(globalThis.INFINITE&&globalThis.INFINITE[o]){let i=globalThis.INFINITE[o].getState;clearInterval(r),t(()=>i)}},100);return()=>{clearInterval(r)}},[n.debugTarget]),typeof e=="function"?tt.createElement(dT.Provider,{value:{getState:e}},tt.createElement(px,null)):null}var dT=tt.createContext({getState:()=>null});function px(){let n=tt.useContext(dT),{getState:e}=n,[,t]=Vt(),o=e().renderer.cellManager;cT(()=>{let s=Xt(()=>{console.log("rerender"),t()},{wait:500});return o.onCellAttachmentChange(s)},[o,t]);let r=o.getRowsWithCells(),i=o.getColumnsWithCells(),a=uT(null),l=uT(null);return tt.createElement("div",{style:{overflow:"auto"}},cx(tt.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),tt.createElement("table",{style:{borderCollapse:"collapse"}},tt.createElement("thead",null,tt.createElement("tr",null,i.map(s=>tt.createElement("th",{key:s,"data-col-index":s},s)))),tt.createElement("tbody",null,r.map(s=>tt.createElement("tr",{key:s,"data-row-index":s},i.map(u=>tt.createElement("td",{key:u,style:{padding:5,border:"1px solid gray",background:o.getCellAt([s,u])?.getNode()?"rgba(0, 255, 0, 0.3)":"rgba(255, 0, 0, 0.3)"},"data-col-index":u},tt.createElement("button",{onClick:()=>{let c=o.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 U9={CheckBox:wn,LoadMask:ol,MenuIcon:Tr,StringFilterEditor:To,NumberFilterEditor:yi};export{Oo as AutoScroller,Ue as CellSelectionState,It as DRAG_ITEM_ATTRIBUTE,oT as DataClient,$W as DataSource,Bv as DataSourceActionType,W as DeepMap,ls as DragDropProvider,Ir as DragInteractionTarget,Zn as DragList,tc as FixedSizeSet,ux as FlashingColumnCell,Pt as GroupRowsState,dx as INTERNAL_MatrixDebugger,pn as InfiniteTable,Qt as InfiniteTableClassName,QD as InfiniteTableComponent,cn as Menu,Nr as RowDetailCache,_t as RowDetailState,Dt as RowDisabledState,Oe as RowSelectionState,Uq as TreeDataSource,mt as TreeExpandState,ex as TreeGrid,et as TreeSelectionState,nc as WeakFixedSizeSet,zu as alignNode,U9 as components,Ds as createDefaultProxy,sT as createFlashingColumnCellComponent,Xt as debounce,Xe as debug,xs as defaultDragProxyMove,Og as defaultFilterFunction,Kn as defaultFilterTypes,Qs as defaultTreeFilterFunction,Lu as eventMatchesKeyboardShortcut,Oh as filterDataArray,Kn as filterTypes,bI as flatten,Ot as getComponentStateRoot,ms as group,ox as interceptMap,nx as keyboardShortcuts,$t as multisort,uu as multisortNested,$o as queryKeyToCacheKey,Ow as toTreeDataArray,Ft as useComponentState,Kv as useDataSourceApi,Fr as useDataSourceInternal,Fe as useDataSourceSelector,cu as useDataSourceState,Rn as useDragDropProvider,No as useDragListContext,oc as useEffectWhen,ax as useEffectWhenSameDeps,Ho as useEffectWithChanges,H2 as useEffectWithObject,$u as useGridScroll,XD as useInfiniteColumnApi,Wi as useInfiniteColumnCell,Ss as useInfiniteColumnEditor,ir as useInfiniteColumnFilterEditor,hi as useInfiniteHeaderCell,ED as useInfinitePortalContainer,qD as useInfiniteTableApi,G2 as useLayoutEffectWithChanges,Wh as useManagedDataSource,Vn as useMasterRowInfo,un as useOverlay,GP as useOverlayPortal,Gn as usePrevious,YW as useRowInfoReducers,TD as useVisibleColumnSizes,tT as withSelectedLeafNodesOnly};
32
32
  //!collapsed || lazyLoad;