@infinite-table/infinite-vue 0.0.1 → 9.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -0
- package/index.d.ts +70 -4
- package/index.js +7 -7
- package/index.mjs +7 -7
- package/package.json +3 -3
- package/theme/balsam.css +1 -1
- package/theme/default.css +1 -1
- package/theme/minimalist.css +1 -1
- package/theme/ocean.css +1 -1
- package/theme/shadcn.css +1 -1
package/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var hp=Object.create;var Go=Object.defineProperty;var gp=Object.getOwnPropertyDescriptor;var yp=Object.getOwnPropertyNames;var bp=Object.getPrototypeOf,Cp=Object.prototype.hasOwnProperty;var Tp=(o,t)=>()=>(t||o((t={exports:{}}).exports,t),t.exports),Sp=(o,t)=>{for(var e in t)Go(o,e,{get:t[e],enumerable:!0})},Xa=(o,t,e,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of yp(t))!Cp.call(o,i)&&i!==e&&Go(o,i,{get:()=>t[i],enumerable:!(n=gp(t,i))||n.enumerable});return o};var uo=(o,t,e)=>(e=o!=null?hp(bp(o)):{},Xa(t||!o||!o.__esModule?Go(e,"default",{value:o,enumerable:!0}):e,o)),wp=o=>Xa(Go({},"__esModule",{value:!0}),o);var kn=Tp(($C,Os)=>{"use strict";Os.exports=function(o,t,e,n,i){var r,a;if(n===void 0)n=0;else if(n=n|0,n<0||n>=o.length)throw new RangeError("invalid lower bound");if(i===void 0)i=o.length-1;else if(i=i|0,i<n||i>=o.length)throw new RangeError("invalid upper bound");for(;n<=i;)if(r=n+(i-n>>>1),a=+e(o[r],t,r,o),a<0)n=r+1;else if(a>0)i=r-1;else return r;return~n}});var Yg={};Sp(Yg,{CellSelectionState:()=>He,DataSource:()=>Pi,DataSourceInjectionKeyForVue:()=>Un,DeepMap:()=>$,FlashingColumnCell:()=>op,GroupRowsState:()=>Ct,InfiniteTable:()=>sr,InfiniteTableClassName:()=>Qf,InfiniteTableDetailRow:()=>ar,InfiniteTableInjectionKeyForVue:()=>Ln,Menu:()=>_t,NumberFilterEditor:()=>di,RowDetailState:()=>yt,RowSelectionState:()=>Ae,StringFilterEditor:()=>zn,TreeDataSource:()=>rp,TreeExpandState:()=>nt,TreeGrid:()=>ip,TreeSelectionState:()=>Qe,components:()=>qg,createFlashingColumnCellComponent:()=>Wa,debounce:()=>Jt,defaultFilterTypes:()=>Mn,flatten:()=>Au,group:()=>hi,keyboardShortcuts:()=>ap,toTreeDataArray:()=>Xr,useDataSourceContext:()=>qn,useGetMasterDetailContextForVue:()=>Ri,useInfiniteColumnCell:()=>oo,useInfiniteColumnEditor:()=>za,useInfiniteColumnFilterEditor:()=>Vn,useInfiniteHeaderCell:()=>Po,useInfiniteTableContext:()=>$e,useOverlay:()=>At,withSelectedLeafNodesOnly:()=>ja});module.exports=wp(Yg);function Jt(o,{wait:t}){let e=null;return function(...n){let i=this;e!==null&&clearTimeout(e),e=setTimeout(()=>{o.apply(i,n)},t)}}var ke=require("vue");var tt=require("vue");function Ja(o,t){let e=new Set;function n(...i){let r=t?t.getProxyTargetFromArgs(...i):i[0];e.clear();let a={get:function(s,d){return e.add(d),s[d]}},l=new Proxy(r,a),u=t?t.putProxyToArgs(l,...i):[l];return o.apply(this,u)}return{fn:n,propertyReads:e}}var pr=o=>o&&o.substr(0,1).toUpperCase()+o.substr(1);function co(o){return o!==void 0}function fo(o,t){let e=t[o];return co(e)}var mr=(o,t,e)=>{let n=o[t];typeof n=="function"&&n(...e)};function vp(o,t,e){let n={};for(let i in o)if(o.hasOwnProperty(i)){let r=o[i],a=fo(i,t)?t[i]:t[`default${pr(i)}`];typeof r=="function"&&(a=r(a,e)),n[i]=a}return n}function Qa(o,t,e){let{fn:n,propertyReads:i}=Ja(o,{getProxyTargetFromArgs:a=>a.props,putProxyToArgs:(a,l)=>[{...l,props:a}]}),r=n(t);return i.forEach(a=>e.add(a)),r}function el(o){let{props:t,initialSetupState:e,propsToForward:n,parentState:i,mapPropsToState:r,propsToStateSet:a}=o,l={};n&&(l=vp(n,t,e));let u={...e,...l};if(r){let s=Qa(r,{props:t,state:u,oldState:null,parentState:i},a);return{...u,...s}}return u}function tl(o,t,e){let{getProps:n,getParentState:i,mapPropsToState:r,concludeReducer:a,propsToStateSet:l}=e;if(t.type==="REPLACE_STATE")return t.payload;let u=i?.()??null,s=t.payload.mappedState,d=t.payload.updatedPropsToState,c={...o};if(s&&Object.assign(c,s),r){let m=Qa(r,{props:n(),state:c,oldState:o,parentState:u},l);Object.assign(c,m)}return t.type==="ASSIGN_STATE"&&Object.assign(c,t.payload),a?a({previousState:o,state:c,updatedProps:d,parentState:u}):c}function nl(o){let{dispatch:t,getState:e,getProps:n,propsToForward:i,allowedControlledPropOverrides:r,interceptedActions:a,mappedCallbacks:l,notify:u=mr}=o,s=e();return Object.keys(s).reduce((d,c)=>{let f=c;return Object.defineProperty(d,c,{set:p=>{let h=n(),g=e(),b=!0;if(a&&typeof a[f]=="function"&&a[f](p,{actions:d,state:g})===!1&&(b=!1),b){let v=[p],S=`on${pr(c)}Change`;if(l&&l[f]){let D=l[f](p,g);S=D.callbackName||S,v=D.callbackParams}u(h,S,v)}let C=i[f];typeof C=="function"&&(p=C(p));let T=!!r?.[f];fo(c,h)&&!T||t({payload:{updatedProps:null,mappedState:{[c]:p}}})}}),d},{})}function ol(o){let{currentProps:t,prevProps:e,state:n,propsToForward:i,propsToStateSet:r}=o,a={},l=0,u={},s=0,d={},c=0;return new Set([...Object.keys(t),...Object.keys(e)]).forEach(m=>{let p=m,h=e[p],g=t[p];if(p!=="children"&&h!==g&&(d[p]={newValue:g,oldValue:h},c++,fo(p,t)||fo(p,e)))if(i.hasOwnProperty(m)){let b=g,C=i[m];typeof C=="function"&&(b=C(g)),n[p]!==b&&(a[p]=b,l++)}else r.has(m)&&(u[p]=t[p],s++)}),{newMappedState:a,newMappedStateCount:l,updatedPropsToState:u,updatedPropsToStateCount:s,rawUpdatedProps:d,rawUpdatedPropsCount:c}}function Ip(o){return(t,e,n)=>{if(mr(t,e,n),o){let i=/^on([A-Z].*)Change$/.exec(e);if(i){let r=i[1].charAt(0).toLowerCase()+i[1].slice(1);o(`update:${r}`,n[0])}}}}function xn(o){let t=o.injectionKey??Symbol("managed-component-state");function e(r){let a=(0,tt.getCurrentInstance)(),l=()=>({...r}),u=o.initSetupState?o.initSetupState(l()):{},s=new Set,d=o.forwardProps?o.forwardProps(u,l()):{},c=o.getParentState?o.getParentState():null,f=()=>c==null?null:(0,tt.isRef)(c)?(0,tt.unref)(c)??null:typeof c=="function"?c()??null:c,m=el({props:l(),initialSetupState:u,propsToForward:d,parentState:f(),mapPropsToState:o.mapPropsToState,propsToStateSet:s}),p=(0,tt.shallowRef)(m),h=()=>m,g=l,b=S=>{m=tl(m,S,{getProps:g,getParentState:f,mapPropsToState:o.mapPropsToState,concludeReducer:o.concludeReducer,propsToStateSet:s}),p.value=m},C=Ip(a?(S,...D)=>a.emit(S,...D):void 0),T=nl({dispatch:b,getState:h,getProps:g,propsToForward:d,allowedControlledPropOverrides:o.allowedControlledPropOverrides,interceptedActions:o.interceptActions,mappedCallbacks:o.mappedCallbacks,notify:C});return(0,tt.watch)(()=>({props:l(),parentState:f()}),(S,D)=>{let R=S.props,E=D.props,N=S.parentState!==D.parentState,{newMappedState:w,newMappedStateCount:P,updatedPropsToState:_,updatedPropsToStateCount:A,rawUpdatedProps:I,rawUpdatedPropsCount:M}=ol({currentProps:R,prevProps:E,state:p.value,propsToForward:d,propsToStateSet:s}),F=!1;if(A>0||P>0){let O={payload:{mappedState:P?w:null,updatedPropsToState:A?_:null}},z=p.value;if(b(O),F=!0,o.onPropChange){for(let k in I)if(I.hasOwnProperty(k)){let{newValue:H,oldValue:oe}=I[k];o.onPropChange({name:k,newValue:H,oldValue:oe},R,T,z)}}o.onPropsChange&&M&&o.onPropsChange(I,R,T,z)}N&&S.parentState!=null&&!F&&b({type:"PARENT_STATE_CHANGE",payload:{}})},{flush:"post"}),(0,tt.onBeforeUnmount)(()=>{o.cleanup?.(h())}),{contextValue:{state:p,componentActions:T,getComponentState:h,replaceState:S=>{b({type:"REPLACE_STATE",payload:S})},assignState:S=>{b({type:"ASSIGN_STATE",payload:S})},get componentState(){return p.value}},injectionKey:t}}function n(r){let a=e(r);return(0,tt.provide)(t,a.contextValue),a}function i(){return(0,tt.inject)(t)}return{useManagedComponent:e,provideManagedComponent:n,useManagedComponentState:i,injectionKey:t}}function me(o=!1){let t=null,e=[],n=null,i=(r,a)=>{let l=[];if(o)n!=null&&(cancelAnimationFrame(n),n=null),requestAnimationFrame(()=>{t=r,n=null;for(let u=0,s=e.length;u<s;u++)l.push(e[u](r));a?.(l)});else{t=r;for(let u=0,s=e.length;u<s;u++)l.push(e[u](r));a?.(l)}};return i.get=()=>t,i.onChange=r=>(e.push(r),()=>{e=e.filter(a=>a!==r)}),i.destroy=()=>{i(null),e.length=0},i.getListenersCount=()=>e.length,i}function Ft(o){let t=!1,e=null;return(...i)=>(t||(t=!0,e=o(...i)),e)}var il=(o,t)=>o-t;var Ko=(o,t)=>il(o.revision,t.revision),$=class o{constructor(t){this.map=new Map;this.length=0;this.revision=0;this.emptyKey=Symbol("emptyKey");this.visit=t=>{this.map.forEach((e,n)=>this.visitKey(n,this.map,[],t,!1))};this.visitSome=t=>{this.visitWithNext([],t,!0)};this.visitDepthFirst=t=>{this.visitWithNext([],t,!1)};this.visitWithNext=(t,e,n,i=this.map,r,a)=>{if(!i)return;let l=0,u=i.has(this.emptyKey),s=!a;if(r!==void 0){if(r<0)return;r--}let d=(c,f)=>{let m=i.get(f);if(!m)return;let{map:p}=m,h=f===this.emptyKey;if(h&&!s)return;let g=h?[]:[...t,f],b=p?()=>this.visitWithNext(g,e,n,p,r!==void 0?r-1:void 0):void 0;if(m.hasOwnProperty("value")){let C=e(m.value,g,l,b,m);if(n&&C===!0)return!0;l++}else b?.()};u&&(d(void 0,this.emptyKey),s=!1,l=0);for(let[c,f]of i){let m=d(f,c);if(n&&m===!0)return m}};this.fill(t)}static clone(t){let e=new o;return t.visit((n,i)=>{e.set(i,n.value)}),e}fill(t){t&&t.forEach(e=>{let[n,i]=e;this.set(n,i)})}getValuesStartingWith(t,e){let n=[];return this.getStartingWith(t,(i,r)=>{n.push(r)},e),n}getEntriesStartingWith(t,e){let n=[];return this.getStartingWith(t,(i,r)=>{n.push([i,r])},e),n}getLeafNodesStartingWith(t,e,n){let{respectOrder:i=!1}=n||{},r=[],a=[];return this.getStartingWith(t,(l,u,s)=>{!s.map&&s.hasOwnProperty("value")&&(i?r.push(s):a.push(e(s)))},n),i?r.sort(Ko).map(e):a}getKeysForLeafNodesStartingWith(t,e){return this.getLeafNodesStartingWith(t,n=>n.keys,e)}getKeysAndValuesForLeafNodesStartingWith(t,e){return this.getLeafNodesStartingWith(t,n=>[n.keys,n.value],e)}getKeysOfFirstChildOnEachBranchStartingWith(t,e){let{excludeSelf:n,depthLimit:i,respectOrder:r=!0}=e||{},a=[],l=[],u=f=>{r?a.push(f):l.push(f.keys)},s=this.map,d,c=!1;if(t.length)for(let f=0,m=t.length;f<m;f++){let p=t[f];if(d=s.get(p),!d||!d.map)if(c=!0,f===m-1){c=!0;break}else return[];s=d.map}else if(!n&&s.has(this.emptyKey))return[[]];return d&&d.value!==void 0&&(n||(u({...d,keys:t}),c=!0)),c?r?a.sort(Ko).map(f=>f.keys):l:(this.visitWithNext(t,(f,m,p,h,g)=>{u({...g,keys:m})},!1,s,i,n),r?a.sort(Ko).map(f=>f.keys):l)}getKeysStartingWith(t,e){let n=[];return this.getStartingWith(t,i=>{n.push(i)},e),n}getStartingWith(t,e,n){let{excludeSelf:i,depthLimit:r}=n||{},a=this.map,l,u=!1;if(t.length)for(let s=0,d=t.length;s<d;s++){let c=t[s];if(l=a.get(c),!l||!l.map)if(u=!0,s===d-1){u=!0;break}else return;a=l.map}l&&l.value!==void 0&&(i||e(t,l.value,{...l,keys:t})),!u&&this.visitWithNext(t,(s,d,c,f,m)=>{e(d,s,{...m,keys:d}),f?.()},!1,a,r,i)}getMapAt(t){let e=this.map,n;if(!t.length)return this.map;for(let i=0,r=t.length;i<r;i++){let a=t[i];if(n=e.get(a),!n||!n.map)return;e=n.map}return e}getAllChildrenSizeFor(t){let e=this.map,n;if(!t.length)return this.length;for(let i=0,r=t.length;i<r;i++){let a=t[i];if(n=e.get(a),!n||!n.map)return 0;e=n.map}return n.length}getDirectChildrenSizeFor(t){let e=this.map;t.length||(t=[this.emptyKey]);for(let n=0,i=t.length;n<i;n++){let r=t[n],a=n===i-1,l=e.get(r);if(!l||!l.map)return 0;if(e=l.map,a)return e?.size??0}return 0}set(t,e){let n=this.map;t.length||(t=[this.emptyKey]);for(let i=0,r=t.length;i<r;i++){let a=t[i],l=i===r-1,u=n.get(a)||{length:0};l?(u.revision=this.revision++,u.value=e,n.set(a,u),this.length++):(u.map||(u.map=new Map,n.set(a,u)),u.length++,n=u.map)}return this}get(t){let e=this.map;t.length||(t=[this.emptyKey]);for(let n=0,i=t.length;n<i;n++){let r=t[n],a=n===i-1,l=e.get(r);if(a)return l?l.value:void 0;if(!l||!l.map)return;e=l.map}}get size(){return this.length}clear(){let t=e=>{e.forEach((n,i)=>{let{map:r}=n;r&&t(r)}),e.clear()};t(this.map),this.length=0,this.revision=0}delete(t){let e=this.map;t.length?t=[...t]:t=[this.emptyKey];let n=[e],i=[],r=!1;for(let a=0,l=t.length;a<l;a++){let u=t[a],s=a===l-1,d=e.get(u);if(s){d&&(d.hasOwnProperty("value")&&(delete d.value,delete d.revision,r=!0,i.forEach(c=>{c.length--}),this.length--),d.map&&d.map.size===0&&delete d.map,d.map||e.delete(u));break}else{if(!d||!d.map){r=!1;break}i.push(d),e=d.map,n.push(e)}}for(;n.length;){let a=n.pop(),l=t.length;if(t.pop(),l>0&&a?.size===0){let u=n[n.length-1],s=t[t.length-1],d=u?.get(s);d&&(delete d.map,d.hasOwnProperty("value")||u.delete(s))}}return r}has(t){let e=this.map;t.length||(t=[this.emptyKey]);for(let n=0,i=t.length;n<i;n++){let r=t[n],a=n===i-1,l=e.get(r);if(a)return l?l.hasOwnProperty("value"):!1;if(!l||!l.map)return!1;e=l.map}return!1}visitKey(t,e,n,i,r){let a=e.get(t);if(!a)return;let{map:l}=a,u=t===this.emptyKey?[]:[...n,t],s=Ft(()=>{if(l)for(let[d]of l){let c=this.visitKey(d,l,u,i,r);if(r&&c===!0)return!0}return!1});if(a.hasOwnProperty("value")){let d=i(a,u,s);if(r&&d===!0)return!0}s()}getArray(t){let e=[];return this.visit((n,i)=>{let r=t({...n,keys:i});i.length===0?e.splice(0,0,r):e.push(r)}),e}rawKeysAt(t){let e=this.getMapAt(t);return e?[...e.keys()]:[]}valuesAt(t){let e=this.getMapAt(t);if(!e)return[];let n=[];return e.forEach(i=>{i.value!==void 0&&n.push(i.value)}),n}values(){return this.sortedIterator(t=>t.value)}keys(){return this.sortedIterator(e=>e.keys)}entries(){return this.sortedIterator(t=>[t.keys,t.value])}topDownEntries(){return this.getArray(t=>[t.keys,t.value])}topDownKeys(){return this.getArray(t=>t.keys)}topDownValues(){return this.getArray(t=>t.value)}sortedIterator(t){let e=[];this.visit((i,r)=>{e.push({...i,keys:r})}),e.sort(Ko);function*n(){for(let i=0,r=e.length;i<r;i++)yield t(e[i])}return n()}};globalThis.DeepMap=$;function Ve(){return globalThis}var Bo=["#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"],rl=Symbol("color"),Ho=new WeakMap,hr=me();function gr(o=Bo){Ho.set(o,o.map(t=>0))}gr();var Rp=(o=Bo)=>{let t=[];Ho.has(o)?t=Ho.get(o):(t=o.map(n=>0),Ho.set(o,t));let e=t.reduce((n,i,r,a)=>i<a[n]?r:n,0);return t[e]!=null&&t[e]++,o[e]??o[0]??Bo[0]},mo=":",yr="*",al="-",xp=",",Pp="debug",Dp="diffdebug",sl=!1,po=new $,ho=new Map;function br(o,t){let e=o.split(mo),n=new $;n.set(e,!0);let i=t.split(mo),r=new Set(i).has(yr),a=i.indexOf(yr),l=r?i.slice(0,a):i;if(n.getKeysStartingWith(l,{excludeSelf:r}).length>0){let u=i.slice(a+1);return u.length?o.endsWith(u.join(mo)):!0}}function ul(o,t){let e=`channel=${o}_permissions=${t}`;if(ho.has(e))return ho.get(e);let n=t.split(xp);function i(l){return ho.set(e,l),l}let r=[],a=[];n.forEach(l=>{l.includes(yr)?a.push(l):r.push(l)});for(let l=0;l<r.length;l++){let u=r[l],s=u.startsWith(al);if(s&&(u=u.substring(al.length)),br(o,u))return i(!s)}for(let l=0;l<a.length;l++){let u=a[l],s=u.startsWith("-");if(s&&(u=u.substring(1)),br(o,u))return i(!s)}return i(!1)}var Cr=()=>it.enable??(Ve()&&Ve().localStorage?.getItem(Pp))??"",Ap=()=>it.diffenable??(Ve()&&Ve().localStorage?.getItem(Dp))??`${sl}`,Tr="",dl=sl;function Sr(o){dl=`${Ap()}`=="true",Tr!==o&&(Tr=o,ho.clear())}function cl(o){Sr(Cr()),typeof Ve()<"u"&&Ve().addEventListener&&Ve().addEventListener("storage",function(){Sr(Cr())});function t(e,n){let i=n?`${n}${mo}${e}`:e,r=i.split(mo),a=po.get(r);if(a)return a;let l=po.get(r.slice(0,-1)),u=(l?l.logFn:it.logFn)??fl,s=u,d,c=0,f=()=>d??ul(i,Tr),m=Rp(it.colors),p=Object.defineProperties((...h)=>{let g=hr.getListenersCount(),b;if(g>0&&(b=b??Date.now(),hr({color:m,channel:i,args:h,timestamp:b})),f()){if(b=b??Date.now(),c&&dl){let v=b-c;s(`%c[${i}]`,`color: ${m}`,`+${v}ms:`)}c=b;let C=[],T;if(h.forEach(v=>{if(v[rl])T===void 0&&(T=!0),C.push(...v);else{if(typeof v!="string"&&typeof v!="number"){T=!1;return}C.push(`${v}%s`)}}),T){let v=[`%c[${i}]%c %s`,`color: ${m}`,"",...C,""];s(...v)}else s(`%c[${i}]%c %s`,`color: ${m}`,"",...h)}},{channel:{value:i},color:{value:(h,...g)=>{let b=[`%c${g.join(" ")}%c%s`,`color: ${h}`,""];return b.toString=()=>g.join(" "),b[rl]=!0,b}},extend:{value:h=>t(h,i)},enabled:{get:()=>f(),set:h=>{d=h}},logFn:{configurable:!1,get:()=>s,set:h=>{s=h??u}},destroy:{value:()=>{po.delete(r)}}});return po.set(r,p),p}return t(o)}var fl=console.log.bind(console),ll;Object.defineProperty(cl,"enable",{get:()=>ll,set:o=>{ll=o,Sr(Cr())}});var it=cl;it.colors=Bo;it.logFn=fl;var _p=(o,t)=>hr.onChange(e=>{if(!e)return;let{channel:n,args:i,color:r,timestamp:a}=e;br(n,o)&&t({channel:n,color:r,args:i,timestamp:a})});it.onLogIntent=_p;it.isChannelEnabled=ul;it.destroyAll=()=>{gr(),gr(it.colors),po.clear(),ho.clear()};var Mp=it("IT:InfiniteTable"),Ep="#dc3545",Fp="#eb9316";var ml="Warn",hl="Error",Np="Info",Op="Success",kp="Logs",Wo=Mp.extend(kp),Ry=Wo.extend(Np),Lp=Wo.extend(ml),zp=Wo.extend(hl),xy=Wo.extend(Op);var Vp=Fp,Gp=Ep;var Kp=(o,t)=>{t=t?t.extend?t.extend(ml):t:Lp,t(typeof t.color=="function"?t.color(Vp,o):o)},Hp=(o,t)=>{t=t?t.extend?t.extend(hl):t:zp,t(typeof t.color=="function"?t.color(Gp,o):o)};var pl=new $,gl=(o,...t)=>{pl.has(t)||(pl.set(t,!0),o())};var Pn=(o,t=o,e)=>{gl(()=>Kp(o,e),t,"warn")},yl=(o,t=o,e)=>{gl(()=>Hp(o,e),t,"error")};function go(o){return o}function Dn(o,t){return t.reduce((e,n)=>{let{field:i,valueGetter:r,toKey:a}=n,l=i?o[i]:r?.({data:o,field:i}),u=(a||go)(l,o);return e.push(u),e},[])}var Ae=class o{constructor(t,e,n){this.selectedRows=null;this.deselectedRows=null;this.defaultSelection=!1;this.selectedMap=new $;this.deselectedMap=new $;this.onlyUsePrimaryKeys=!1;this.selectionCache=new $;this.selectionCountCache=new $;this.mapSet=(t,e)=>{Array.isArray(e)||(this.onlyUsePrimaryKeys?e=[e]:e=[...this.getGroupKeysForPrimaryKey(e),e]),this.xcache(),t==="selected"?this.selectedMap.set(e,!0):this.deselectedMap.set(e,!0)};this._selectedMapSet=t=>{this.mapSet("selected",t)};this._deselectedMapSet=t=>{this.mapSet("deselected",t)};let i=t instanceof Object.getPrototypeOf(this).constructor?t.getState():t;this.getConfig=e,this.onlyUsePrimaryKeys=e().onlyUsePrimaryKeys,n&&Object.assign(this,n),this.update(i)}getGroupKeysForPrimaryKey(t){let{indexer:e,groupBy:n}=this.getConfig(),i=e.getDataForPrimaryKey(t);return i?Dn(i,n):[]}getGroupDeepMap(){return this.getConfig().groupDeepMap}getGroupCount(t){if(t.length==0)return this.getConfig().totalCount;let n=this.getGroupDeepMap()?.get(t);return n?n.totalChildrenCount??(n.items.length||0):0}getGroupKeysDirectlyInsideGroup(t){let{groupDeepMap:e}=this.getConfig();return e?.getKeysStartingWith(t,{excludeSelf:!0,depthLimit:1})||[]}getAllPrimaryKeysInsideGroup(t){let{groupDeepMap:e}=this.getConfig();if(!t.length)return(e?.getKeysStartingWith([],{excludeSelf:!0,depthLimit:1})||[]).map(r=>this.getAllPrimaryKeysInsideGroup(r)).flat();let n=e?.get(t);return n?n.items.map(this.getConfig().toPrimaryKey):[]}getGroupByLength(){return this.getConfig().groupBy.length}static from(t,e,n){return new o(t,e,n)}update(t){this.selectedRows=t.selectedRows||null,this.deselectedRows=t.deselectedRows||null,this.selectedMap.clear(),this.deselectedMap.clear(),this.selectedRows?.forEach(this._selectedMapSet),this.deselectedRows?.forEach(this._deselectedMapSet),this.defaultSelection=t.defaultSelection,this.xcache()}xcache(){this.selectionCache.clear(),this.selectionCountCache.clear()}getState(){let t=i=>{let r=this.getGroupByLength();return i.map(a=>this.onlyUsePrimaryKeys?a[0]:a.length>r?a.pop():a)},e=t(this.selectedMap.topDownKeys()),n=t(this.deselectedMap.topDownKeys());return{defaultSelection:this.defaultSelection,selectedRows:e,deselectedRows:n}}deselectAll(){this.update({defaultSelection:!1,selectedRows:[],deselectedRows:[]})}selectAll(){this.update({defaultSelection:!0,deselectedRows:[],selectedRows:[]})}isRowDefaultSelected(){return this.defaultSelection===!0}isRowDefaultDeselected(){return this.defaultSelection===!1}isRowSelected(t,e){if(this.onlyUsePrimaryKeys)return this.defaultSelection?!this.deselectedMap.has([t]):this.selectedMap.has([t]);e=e||this.getGroupKeysForPrimaryKey(t);let n=[...e,t],i=this.selectionCache.get(n);if(i!==void 0)return i;let r=this.selectedMap.has(n),a=this.deselectedMap.has(n);if(r)return this.selectionCache.set(n,!0),!0;if(a)return this.selectionCache.set(n,!1),!1;if(this.selectedMap.has(e))return this.selectionCache.set(n,!0),!0;if(this.deselectedMap.has(e))return this.selectionCache.set(n,!1),!1;for(e=[...e];e.length;){e.pop();let l=this.selectedMap.has(e),u=this.deselectedMap.has(e);if(l)return this.selectionCache.set(n,!0),!0;if(u)return this.selectionCache.set(n,!1),!1}return this.selectionCache.set(n,this.defaultSelection),this.defaultSelection}isRowDeselected(t,e){return!this.isRowSelected(t,e)}setRowSelected(t,e,n){e?this.setRowAsSelected(t,n):this.setRowAsDeselected(t,n)}getGroupRowSelectionState(t){let e=this.selectionCache.get(t);if(e!==void 0)return e;let{selectedCount:n,deselectedCount:i}=this.getSelectionCountFor(t,this.onlyUsePrimaryKeys?void 0:this.getGroupRowBooleanSelectionStateFromParent(t)),r=n&&i?null:!!n;return this.selectionCache.set(t,r),r}getGroupRowBooleanSelectionStateFromParent(t){if(!t.length)return this.defaultSelection;let e=[...t],n=this.deselectedMap.has(e),i=this.selectedMap.has(e),r=i&&!n?!0:n&&!i?!1:void 0;if(r===void 0)for(;e.length;){if(e.pop(),this.deselectedMap.has(e)){r=!1;break}if(this.selectedMap.has(e)){r=!0;break}}return r===void 0&&(r=this.defaultSelection),r}isGroupRowPartlySelected(t){return this.getGroupRowSelectionState(t)===null}isGroupRowSelected(t){return this.getGroupRowSelectionState(t)===!0}isGroupRowDeselected(t){return this.getGroupRowSelectionState(t)===!1}selectGroupRow(t){if(this.onlyUsePrimaryKeys){this.getAllPrimaryKeysInsideGroup(t).forEach(r=>{this.defaultSelection===!0?this.deselectedMap.delete([r]):this._selectedMapSet(r)}),this.xcache();return}this.selectedMap.getKeysStartingWith(t,{excludeSelf:!0}).forEach(i=>{this.selectedMap.delete(i)}),t.length===1&&this.defaultSelection===!0||this._selectedMapSet(t),this.deselectedMap.getKeysStartingWith(t).forEach(i=>{this.deselectedMap.delete(i)})}deselectGroupRow(t){if(this.onlyUsePrimaryKeys){this.getAllPrimaryKeysInsideGroup(t).forEach(r=>{this.defaultSelection===!1?this.selectedMap.delete([r]):this._deselectedMapSet(r)}),this.xcache();return}this.deselectedMap.getKeysStartingWith(t,{excludeSelf:!0}).forEach(i=>{this.deselectedMap.delete(i)}),t.length===1&&this.defaultSelection===!1||this._deselectedMapSet(t),this.selectedMap.getKeysStartingWith(t).forEach(i=>{this.selectedMap.delete(i)})}setRowAsSelected(t,e){if(this.onlyUsePrimaryKeys){this.defaultSelection?this.deselectedMap.delete([t]):this._selectedMapSet(t),this.xcache();return}e=e||this.getGroupKeysForPrimaryKey(t);let n=[...e,t];this.deselectedMap.delete(n),this.xcache(),this.getGroupRowSelectionState(e)!==!0&&(this._selectedMapSet(n),this.getGroupRowSelectionState(e)===!0&&this.selectGroupRow(e))}setRowAsDeselected(t,e){if(this.onlyUsePrimaryKeys){this.defaultSelection?this._deselectedMapSet(t):this.selectedMap.delete([t]),this.xcache();return}e=e||this.getGroupKeysForPrimaryKey(t);let n=[...e,t];this.selectedMap.delete(n),this.xcache(),this.getGroupRowSelectionState(e)!==!1&&(this._deselectedMapSet(n),this.getGroupRowSelectionState(e)===!1&&this.deselectGroupRow(e))}deselectRow(t,e){this.setRowSelected(t,!1,e)}selectRow(t,e){this.setRowSelected(t,!0,e)}toggleGroupRowSelection(t){this.getGroupRowSelectionState(t)===!0?this.deselectGroupRow(t):this.selectGroupRow(t)}toggleRowSelection(t,e){this.isRowSelected(t,e)?this.deselectRow(t,e):this.selectRow(t,e)}getSelectedCount(){return this.getSelectionCountFor([]).selectedCount}getDeselectedCount(){return this.getSelectionCountFor([]).deselectedCount}getSelectionCountFor(t=[],e){let n=this.selectionCountCache.get(t);if(n!=null)return n;let i=this.getGroupByLength();if(t.length>i){let s=this.isRowSelected(t)?{selectedCount:1,deselectedCount:0}:{selectedCount:0,deselectedCount:1};return this.selectionCountCache.set(t,s),s}if(i&&this.onlyUsePrimaryKeys){let s=this.getAllPrimaryKeysInsideGroup(t),d=0,c=0;s.forEach(m=>{if(this.defaultSelection){if(this.deselectedMap.has([m])){c++;return}d++}else{if(this.selectedMap.has([m])){d++;return}c++}});let f={selectedCount:d,deselectedCount:c};return this.selectionCountCache.set(t,f),f}e=e??this.getGroupRowBooleanSelectionStateFromParent(t);let r=this.getGroupKeysDirectlyInsideGroup(t);if(t.length===this.getGroupByLength()){let s=this.selectedMap.has(t)?!0:this.deselectedMap.has(t)?!1:e,d=this.getGroupCount(t),c=this.selectedMap.getKeysStartingWith(t,{excludeSelf:!0,depthLimit:1}).length,f=this.deselectedMap.getKeysStartingWith(t,{excludeSelf:!0,depthLimit:1}).length,m=d-(c+f),p={selectedCount:c+(s?m:0),deselectedCount:f+(s?0:m)};return this.selectionCountCache.set(t,p),p}let a=0,l=0;if(this.getConfig().lazyLoad&&!r.length){let s=this.getConfig().groupDeepMap?.get(t)?.totalChildrenCount||0;e?(a=s,l=this.deselectedMap.getAllChildrenSizeFor(t),l===s&&(a=0)):(l=s,a=this.selectedMap.getAllChildrenSizeFor(t),a===s&&(l=0))}r.forEach(s=>{let d=this.selectedMap.get(s),c=this.deselectedMap.get(s),f=d?!0:c?!1:e,{selectedCount:m,deselectedCount:p}=this.getSelectionCountFor(s,f);a+=m,l+=p});let u={selectedCount:a,deselectedCount:l};return this.selectionCountCache.set(t,u),u}};var Qt=o=>{let t=it(o?`IT:${o}:TYPE=debug`:"IT:TYPE=debug");return t.logFn=console.log.bind(console),t},en=o=>{let t=it(o?`IT:${o}:TYPE=error`:"IT:TYPE=error");return t.logFn=console.error.bind(console),t},yo=()=>yo;yo.extend=()=>yo;var ct=class{constructor(t){this.debug=yo,this.error=yo}};var Bp=function(o,t){return o-t},Wp=function(o,t){return o=`${o}`,t=`${t}`,o.localeCompare(t)},jp=function(o,t){return o-t},$p={number:Bp,string:Wp,date:jp},bo=$p;var Ke=Ve().requestAnimationFrame||(o=>setTimeout(o,16)),fn=Ve().cancelAnimationFrame||(o=>clearTimeout(o));function tn(o,t,e){if(o===t)return!0;if(!o||!t)return!1;let n=typeof o;if(n!==typeof t||n!=="object")return!1;var r=Object.keys(o),a=Object.keys(t);e&&(r=r.filter(d=>!e.has(d)),a=a.filter(d=>!e.has(d)));var l=r.length;if(a.length!==l)return!1;for(var u=0;u<l;u++){var s=r[u];if(!(e&&e.has(s))&&(o[s]!==t[s]||!Object.prototype.hasOwnProperty.call(t,s)))return!1}return!0}function jo(o,t){return new Ae(o,rt(t))}function rt(o){return()=>{let t=typeof o=="function"?o():o;return{lazyLoad:!!t.lazyLoad,toPrimaryKey:t.toPrimaryKey,onlyUsePrimaryKeys:!t.useGroupKeysForMultiRowSelection,groupBy:t.groupBy,groupDeepMap:t.groupDeepMap,indexer:t.indexer,totalCount:t.unfilteredCount}}}function bl(o){let{getDataSourceState:t,dataSourceActions:e}=o;return{get allRowsSelected(){return t().allRowsSelected},selectAll(){let{rowSelection:i,selectionMode:r}=t();if(r!=="multi-row")throw"Selection mode is not multi-row";if(!(i instanceof Ae))throw"Invalid row selection";let a=new Ae(i,rt(t));a.selectAll(),e.rowSelection=a},deselectAll(){let{rowSelection:i,selectionMode:r}=t();if(r!=="multi-row")throw"Selection mode is not multi-row";if(!(i instanceof Ae))throw"Invalid row selection";let a=new Ae(i,rt(t));a.deselectAll(),e.rowSelection=a},isRowSelected(i,r){let{rowSelection:a,selectionMode:l,indexer:u,groupBy:s}=t();if(l==="single-row")return a===i;if(l!=="multi-row")throw"Selection mode is not multi-row or single-row";if(!(a instanceof Ae))throw"Invalid row selection";if(!r){let d=u.getDataForPrimaryKey(i);r=d?Dn(d,s):[]}return a.isRowSelected(i,r)},isRowDeselected(i,r){return!this.isRowSelected(i,r)},selectRow(i,r){let{rowSelection:a,selectionMode:l,indexer:u,groupBy:s}=t();if(l==="single-row"){e.rowSelection=i;return}if(l!=="multi-row")throw"Selection mode is not multi-row or single-row";if(!(a instanceof Ae))throw"Invalid row selection";if(!r){let c=u.getDataForPrimaryKey(i);r=c?Dn(c,s):[]}let d=new Ae(a,rt(t));d.selectRow(i,r),e.rowSelection=d},deselectRow(i,r){let{selectionMode:a,rowSelection:l,indexer:u,groupBy:s}=t();if(a==="single-row"){e.rowSelection=null;return}if(a!=="multi-row")throw"Selection mode is not multi-row or single-row";if(!(l instanceof Ae))throw"Invalid row selection";if(a==="multi-row"){if(!r){let c=u.getDataForPrimaryKey(i);r=c?Dn(c,s):[]}let d=new Ae(l,rt(t));d.deselectRow(i,r),e.rowSelection=d}},toggleRowSelection(i,r){this.isRowSelected(i,r)?this.deselectRow(i,r):this.selectRow(i,r)},selectGroupRow(i){let{selectionMode:r,rowSelection:a,groupBy:l}=t();if(r!=="multi-row")throw'Selection mode should be "multi-row"';if(!l)throw"No grouping specified";if(!(a instanceof Ae))throw"Invalid row selection";let u=new Ae(a,rt(t));u.selectGroupRow(i),e.rowSelection=u},deselectGroupRow(i){let{selectionMode:r,rowSelection:a,groupBy:l}=t();if(r!=="multi-row")throw'Selection mode should be "multi-row"';if(!l)throw"No grouping specified";if(!(a instanceof Ae))throw"Invalid row selection";let u=new Ae(a,rt(t));u.deselectGroupRow(i),e.rowSelection=u},toggleGroupRowSelection(i){let{selectionMode:r,rowSelection:a,groupBy:l}=t();if(r!=="multi-row")throw'Selection mode should be "multi-row"';if(!l)throw"No grouping specified";if(!(a instanceof Ae))throw"Invalid row selection";let u=new Ae(a,rt(t));u.toggleGroupRowSelection(i),e.rowSelection=u},getGroupRowSelectionState(i,r){let a=t(),{selectionMode:l,groupBy:u}=a,s=r?new Ae(r,rt(a)):a.rowSelection;if(l!=="multi-row")throw'Selection mode should be "multi-row"';if(!u)throw"No grouping specified";if(!(s instanceof Ae))throw"Invalid row selection";return s.getGroupRowSelectionState(i)},getSelectedPrimaryKeys:i=>{let r=t(),a=i?new Ae(i,rt(r)):r.rowSelection,l=[];return r.lazyLoad&&console.error("getSelectedPrimaryKeys should not be called for lazy-loaded datasources as it wont return reliable results"),r.originalDataArray.forEach(u=>{let s=r.toPrimaryKey(u);a.isRowSelected(s)&&l.push(s)}),l}}}var wr=new WeakMap,Up=o=>o;function Cl(o,t=50,e){wr.set(o,{lastCallTime:0,lastCallArg:null});let n=e??Up;return i=>{let{lastCallTime:r,lastCallArg:a}=wr.get(o)||{lastCallTime:0,lastCallArg:null},l=Date.now(),u=l-r,s=tn(n(a),n(i));u<t&&s||(wr.set(o,{lastCallTime:l,lastCallArg:i}),o(i))}}var qp="*",He=class{constructor(t){this.wildcard=qp;this.cache=new $;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 e=t&&t instanceof Object.getPrototypeOf(this).constructor?t.getState():t;e&&this.update(e)}selectCell(t,e){this.setCellSelected(t,e,!0)}deselectCell(t,e){this.setCellSelected(t,e,!1)}selectColumn(t){this.setCellSelected(this.wildcard,t,!0)}deselectColumn(t){this.setCellSelected(this.wildcard,t,!1)}setCellSelected(t,e,n){let i=t===this.wildcard,r=e===this.wildcard;if(this.isCellSelected_Internal(t,e)===n)return;let l=[];if(i){let s=this.deselectedColumnsToRows.get(e),d=this.selectedColumnsToRows.get(e);s?.forEach(c=>{c!==this.wildcard&&this.setCellInDeselection(c,e,!1)}),d?.forEach(c=>{c!==this.wildcard&&this.setCellInSelection(c,e,!1)}),[...this.cache.keys()].forEach(c=>{let[f,m]=c;m===e&&l.push([f,e])})}if(r){let s=this.deselectedRowsToColumns.get(e),d=this.selectedRowsToColumns.get(e);s?.forEach(c=>{c!==this.wildcard&&this.setCellInDeselection(t,c,!1)}),d?.forEach(c=>{c!==this.wildcard&&this.setCellInSelection(t,c,!1)}),[...this.cache.keys()].forEach(c=>{let[f]=c;f===t&&l.push([t,e])})}let u=[t,e];if(l.forEach(s=>{this.cache.delete(s)}),this.cache.delete(u),n)if(this.defaultSelection){let s=this.deselectedRowsToColumns.get(t);s&&s.has(e)&&this.setCellInDeselection(t,e,!1);let d=this.deselectedRowsToColumns.get(this.wildcard),c=this.deselectedColumnsToRows.get(this.wildcard);(d?.has(e)||c?.has(t))&&this.setCellInSelection(t,e,!0)}else{let s=this.deselectedRowsToColumns.get(t);s&&s.has(e)&&this.setCellInDeselection(t,e,!1),this.setCellInSelection(t,e,!0)}else if(this.defaultSelection)this.selectedRowsToColumns.get(t)?.has(e)&&this.setCellInSelection(t,e,!1),this.setCellInDeselection(t,e,!0);else{this.selectedRowsToColumns.get(t)?.has(e)&&this.setCellInSelection(t,e,!1);let d=this.selectedRowsToColumns.get(this.wildcard),c=this.selectedColumnsToRows.get(this.wildcard);if(d?.has(e)||c?.has(t)){this.setCellInDeselection(t,e,!0);return}}}setCellInDeselection(t,e,n){if(n){let i=this.deselectedRowsToColumns.get(t)||new Set;i.add(e),this.deselectedRowsToColumns.set(t,i)}else{let i=this.deselectedRowsToColumns.get(t);i&&(i.delete(e),i.size===0&&this.deselectedRowsToColumns.delete(t))}if(n){let i=this.deselectedColumnsToRows.get(e)||new Set;i.add(t),this.deselectedColumnsToRows.set(e,i)}else{let i=this.deselectedColumnsToRows.get(e);i&&(i.delete(t),i.size===0&&this.deselectedColumnsToRows.delete(e))}}setCellInSelection(t,e,n){if(t===this.wildcard&&e===this.wildcard)throw new Error("rowId and colId cannot be used as a wildcard at the same time!");if(n){let i=this.selectedRowsToColumns.get(t)||new Set;i.add(e),this.selectedRowsToColumns.set(t,i)}else{let i=this.selectedRowsToColumns.get(t);i&&(i.delete(e),i.size===0&&this.selectedRowsToColumns.delete(t))}if(n){let i=this.selectedColumnsToRows.get(e)||new Set;i.add(t),this.selectedColumnsToRows.set(e,i)}else{let i=this.selectedColumnsToRows.get(e);i&&(i.delete(t),i.size===0&&this.selectedColumnsToRows.delete(e))}}update(t){let e=t.selectedCells||null,n=t.deselectedCells||null;this.selectedRowsToColumns.clear(),this.selectedColumnsToRows.clear(),this.deselectedRowsToColumns.clear(),this.deselectedColumnsToRows.clear(),this.cache.clear(),e&&e.forEach(([i,r])=>{this.setCellInSelection(i,r,!0)}),n&&n.forEach(([i,r])=>{this.setCellInDeselection(i,r,!0)}),this.defaultSelection=t.defaultSelection}isCellSelectionInRow(t,e){if(this.defaultSelection){let i=this.deselectedRowsToColumns.get(t);if(i){if(i.has(this.wildcard)){let r=this.selectedRowsToColumns.get(t);return r&&r.size>0?e.some(a=>r.has(a)):!1}return e.some(r=>!i.has(r))}return!0}let n=this.selectedRowsToColumns.get(t);if(n){if(n.has(this.wildcard)){let i=this.deselectedRowsToColumns.get(t);return i&&i.size>0?!e.every(a=>i.has(a)):!0}return e?e.some(i=>n.has(i)):!1}return!1}error(t){en(`${this.debugId}:CellSelectionState`)(t)}isCellSelected(t,e){return t===this.wildcard||e===this.wildcard?(this.error("CellSelectionState.isCellSelected should not be called with wildcard"),!1):this.isCellSelected_Internal(t,e)}isCellSelected_Internal(t,e){let n=[t,e],{cache:i}=this,r=i.get(n);if(r!=null)return r;let a=()=>(i.set(n,!1),!1),l=()=>(i.set(n,!0),!0),u=this.deselectedColumnsToRows.get(this.wildcard),s=this.deselectedRowsToColumns.get(this.wildcard),d=this.selectedColumnsToRows.get(this.wildcard),c=this.selectedRowsToColumns.get(this.wildcard);if(this.defaultSelection){let p=this.deselectedRowsToColumns.get(t);return p&&p.has(e)?a():u?.has(t)||s?.has(e)?this.selectedRowsToColumns.get(t)?.has(e)?l():a():l()}let m=this.selectedRowsToColumns.get(t);return m&&m.has(e)?l():d?.has(t)||c?.has(e)?this.deselectedRowsToColumns.get(t)?.has(e)?a():l():a()}getState(){let t=[],e=[];return this.deselectedRowsToColumns.forEach((n,i)=>{n.forEach(r=>{t.push([i,r])})}),this.selectedRowsToColumns.forEach((n,i)=>{n.forEach(r=>{e.push([i,r])})}),{defaultSelection:this.defaultSelection,deselectedCells:t,selectedCells:e}}};var Gn=require("vue");var Ie=require("vue");var ne=(...o)=>o.filter(t=>!!`${t}`).join(" ");var Tl="_16lm1iw2 _16lm1iw23 _16lm1iw26 _16lm1iw2c _16lm1iw2a",Sl={center:"_16lm1iw2j",stretch:"_16lm1iw2k",start:"_16lm1iw2l",end:"_16lm1iw2m"};var It="_16lm1iw3b _16lm1iw3c _16lm1iw35",wl={pointer:"_16lm1iwk",default:"_16lm1iwl",colResize:"_16lm1iwm",grabbing:"_16lm1iwn",grab:"_16lm1iwo"},$o={flex:"_16lm1iw1p",contents:"_16lm1iw1q",none:"_16lm1iw1r",block:"_16lm1iw1s",grid:"_16lm1iw1t",inlineBlock:"_16lm1iw1u",inlineFlex:"_16lm1iw1v",inlineGrid:"_16lm1iw1w"};var vl={1:"_16lm1iw1c",none:"_16lm1iw1d"},vr={column:"_16lm1iw2f",columnReverse:"_16lm1iw2g",row:"_16lm1iw2h",rowReverse:"_16lm1iw2i"};var Il={0:"_16lm1iw1y","100%":"_16lm1iw1z","50%":"_16lm1iw20"},Rl={center:"_16lm1iw30",spaceBetween:"_16lm1iw31",spaceAround:"_16lm1iw32",start:"_16lm1iw33",end:"_16lm1iw34"},xl={0:"_16lm1iw26","100%":"_16lm1iw27","50%":"_16lm1iw28",auto:"_16lm1iw29"};var Pl={none:"_16lm1iwd"},Uo={hidden:"_16lm1iw35",auto:"_16lm1iw36",visible:"_16lm1iw37"};var Dl={relative:"_16lm1iw1",absolute:"_16lm1iw2",static:"_16lm1iw3",sticky:"_16lm1iw4",fixed:"_16lm1iw5"};var Al={0:"_16lm1iw23","100%":"_16lm1iw24","50%":"_16lm1iw25"};var _l={none:"_16lm1iw1x"};var Ml={visible:"_16lm1iw38",hidden:"_16lm1iw39"};var El={1:"_16lm1iw1e",10:"_16lm1iw1f",100:"_16lm1iw1g",1e3:"_16lm1iw1h",1e4:"_16lm1iw1i",1e5:"_16lm1iw1j",1e6:"_16lm1iw1k",1e7:"_16lm1iw1l","1k":"_16lm1iw1m","10k":"_16lm1iw1n","100k":"_16lm1iw1o"};var ft=require("vue");function Yp(o,t){if(typeof o!="object"||!o)return o;var e=o[Symbol.toPrimitive];if(e!==void 0){var n=e.call(o,t||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(o)}function Zp(o){var t=Yp(o,"string");return typeof t=="symbol"?t:String(t)}function Xp(o,t,e){return t=Zp(t),t in o?Object.defineProperty(o,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):o[t]=e,o}function Fl(o,t){var e=Object.keys(o);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(o);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(o,i).enumerable})),e.push.apply(e,n)}return e}function Nl(o){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?arguments[t]:{};t%2?Fl(Object(e),!0).forEach(function(n){Xp(o,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(e)):Fl(Object(e)).forEach(function(n){Object.defineProperty(o,n,Object.getOwnPropertyDescriptor(e,n))})}return o}function Ol(o,t){var e={};for(var n in o)e[n]=t(o[n],n);return e}var Jp=(o,t,e)=>{for(var n of Object.keys(o)){var i;if(o[n]!==((i=t[n])!==null&&i!==void 0?i:e[n]))return!1}return!0},ve=o=>{var t=e=>{var n=o.defaultClassName,i=Nl(Nl({},o.defaultVariants),e);for(var r in i){var a,l=(a=i[r])!==null&&a!==void 0?a:o.defaultVariants[r];if(l!=null){var u=l;typeof u=="boolean"&&(u=u===!0?"true":"false");var s=o.variantClassNames[r][u];s&&(n+=" "+s)}}for(var[d,c]of o.compoundVariants)Jp(d,i,o.defaultVariants)&&(n+=" "+c);return n};return t.variants=()=>Object.keys(o.variantClassNames),t.classNames={get base(){return o.defaultClassName.split(" ")[0]},get variants(){return Ol(o.variantClassNames,e=>Ol(e,n=>n.split(" ")[0]))}},t};var kl="_1eexc2a6";var Ll=ve({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:[]}),zl="_12zfob1q _16lm1iw2 _16lm1iw1k _16lm1iw3b _16lm1iw3c _16lm1iw35",Vl=ve({defaultClassName:"_16lm1iw2 _16lm1iw25 _16lm1iw26 _16lm1iwh _16lm1iwf",variantClassNames:{visible:{true:"_12zfob19",false:"_12zfob1a"}},defaultVariants:{},compoundVariants:[]}),Gl=ve({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"]]}),Kl=ve({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"]]}),Hl="_12zfob12u _16lm1iw22 _16lm1iw1z";var Bl="_12zfob17",Wl="_12zfob12q _16lm1iw1p _16lm1iw2h _16lm1iw2j _16lm1iw1",jl=ve({defaultClassName:"_12zfob12r _16lm1iw1 _16lm1iw23",variantClassNames:{disabled:{true:"_12zfob12s",false:"_12zfob12t"}},defaultVariants:{},compoundVariants:[]}),Ir=ve({defaultClassName:"_12zfob12n _16lm1iw1p _16lm1iw2h _16lm1iw2k _16lm1iw1",variantClassNames:{active:{true:"_12zfob12o",false:"_12zfob12p"}},defaultVariants:{},compoundVariants:[]}),$l="_12zfob12m _16lm1iw1p _16lm1iw2h _16lm1iw2j",Ul=ve({defaultClassName:"_12zfob127 _16lm1iw1 _16lm1iw1p _16lm1iw2f _16lm1iw32 _16lm1iw39",variantClassNames:{menuVisible:{true:"_12zfob128"},reserveSpaceWhenHidden:{true:"_12zfob129",false:"_12zfob12a"}},defaultVariants:{},compoundVariants:[[{menuVisible:!0,reserveSpaceWhenHidden:!1},"_12zfob12b"]]}),ql="_12zfob1b _16lm1iw2",Yl="_16lm1iw1",Zl="_12zfob16",Xl=ve({defaultClassName:"_12zfob12",variantClassNames:{align:{start:"_12zfob13",center:"_12zfob14",end:"_12zfob15"}},defaultVariants:{},compoundVariants:[]}),Jl="_12zfob12l _16lm1iw35 _16lm1iw1 _16lm1iw1p _16lm1iw2h";var mt="InfiniteIcon";var Ql="_1nnkya20 _16lm1iw1p _16lm1iw2f _16lm1iw1 _16lm1iw32 _16lm1iw2j";var es={transition:"width 0.25s, opacity 0.25s"},ts=Object.keys({size:1,lineWidth:1,lineStyle:1,style:1,className:1,index:1});var An=(0,ft.defineComponent)(o=>{let t=(0,ft.ref)(0),e=null;return(0,ft.onMounted)(()=>{e=requestAnimationFrame(()=>{e=null,t.value=1})}),(0,ft.onBeforeUnmount)(()=>{e!=null&&cancelAnimationFrame(e)}),()=>{let{lineWidth:n=1,className:i,index:r}=o,a=r!=null&&r>0,l=o.size??16,u=Math.floor(l/4),s=[l-1*u,l-2*u,l-3*u],d={...es,borderTop:`${n}px solid currentColor`,...o.lineStyle,opacity:t.value};return(0,ft.h)("div",{"data-name":"filter-icon",style:{...o.style,width:`${l}px`},class:ne(i,mt,Ql,`${mt}-filter`)},[a?(0,ft.h)("div",{"data-name":"index",class:Bl},`${r}`):null,(0,ft.h)("div",{style:{width:`${s[0]}px`,...d}}),(0,ft.h)("div",{style:{width:`${s[1]}px`,...d}}),(0,ft.h)("div",{style:{width:`${s[2]}px`,...d}})])}},{name:"FilterIcon",props:[...ts]});var Rr=o=>{let{availableSize:t,items:e,minSize:n,maxSize:i}=o;if(t<0)throw"The provided availableSize cannot be negative!";let r=0,a=0,l=0,u=[],s=[];e.forEach((R,E)=>{let N=R.maxSize??i??void 0,w=R.minSize??n??void 0;u.push(w),s.push(N),R.size!=null&&(N!=null&&R.size>N&&(R.size=N),w!=null&&R.size<w&&(R.size=w));let P=R.flex==0?null:R.flex;if(R.size==null&&P==null)throw`Items must specify either a size or a flex property. Item at index ${E} doesn't have either of those.`;P!=null&&(l+=1),a+=P??0,r+=R.size??0});let d=o.computeSpecialSpaceDistribution?Math.max(t,0):Math.max(t-r,0),c=d/a,f={},m={},p=0;e.forEach((R,E)=>{if(R.flex!=null){let N=c*R.flex,w=R.maxSize??i??void 0,P=R.minSize??n??void 0,_=!1,A=0;w!=null&&N>w&&(f[E]=!0,_=!0,A=w),P!=null&&N<P&&(m[E]=!0,_=!0,A=P),_&&(p+=1,l-=1,a-=R.flex,d-=A)}}),p&&(c=d/a);let h=[],g=0,b=d,C=a,T=0,v=0,S=[];return{items:e.map((R,E)=>{let N={...R},w=R.maxSize??i??void 0,P=R.minSize??n??void 0,_=0,A=f[E],I=m[E],M=A||I,F=R.size??0;if(R.flex!=null){if(M)I&&(_=P),A&&(_=w);else{g+=1;let O=z=>(w!=null&&z>w&&(z=w),P!=null&&z<P&&(z=P),z);g===l?_=O(b):(_=O(Math.round(R.flex*c)),v+=_,b=d-v,C-=R.flex,c=b/C)}F=_,N.flexSize=_}return h.push(_),S.push(F),N.computedSize=F,T+=F,N}),flexSizes:h,minSizes:u,maxSizes:s,computedSizes:S,remainingSize:Math.round(t-T)}};function qo(o,t,e,n){return t!=null&&o<=t?{value:t,clamped:"min",diff:(o-t)*n}:e!=null&&o>=e?{value:e,clamped:"max",diff:(e-o)*n}:{value:o,clamped:!1,diff:0}}var xr=o=>{let{availableSize:t,reservedWidth:e=0}=o,n=Object.keys(o.columnSizing).reduce((w,P)=>(w[P]={...o.columnSizing[P]},w),{});if(t<0)throw"The provided availableSize cannot be negative!";let i=o.dragHandleOffset,r=o.dragHandlePositionAfter,a=o.dragHandlePositionAfter+1,l=o.items[r],u=o.items[a],s=l.id,d=u?.id,c=l.computedWidth,f=l.computedMinWidth,m=l.computedMaxWidth,p=l.computedFlex?"flex":"width",h=u?.computedWidth,g=u?.computedMinWidth,b=u?.computedMaxWidth,C=u?.computedFlex?"flex":"width",T=!1,v=!1,S=i>0?1:-1,{value:D,clamped:R,diff:E}=qo(c+i,f,m,S);if(o.shareSpaceOnResize){if(u==null)return n[s]={...n[s],[p]:D},v=R==="min",T=R==="max",{adjustedDiff:D-c,reservedWidth:e,columnSizing:n,minReached:v,maxReached:T,constrained:v||T};let{value:w,clamped:P,diff:_}=qo(h-i,g,b,S);if(R&&P&&(Math.abs(E)>Math.abs(_)?P=!1:R=!1),!(!R&&!P)){if(R){let A=qo(h-i-E,g,b,S);w=A.value,P=A.clamped,_=A.diff}else if(P){let A=qo(c+i+_,f,m,S);D=A.value,R=A.clamped,E=A.diff}}n[s]={...n[s],[p]:D},n[d]={...n[d],[C]:w},v=R==="min"||P==="min",T=R==="max"||P==="max"}else n[s]={...n[s],[p]:D},v=R==="min",T=R==="max";let N=D-c;return{adjustedDiff:N,reservedWidth:o.shareSpaceOnResize?e:e-N,columnSizing:n,minReached:v,maxReached:T,constrained:v||T}};function ns(o,t){return o+t}function Qp(o){return Object.keys(o).reduce((e,n)=>(e[n]={...o[n]},e),{})}var os=o=>{let{availableSize:t,reservedWidth:e=0}=o,n=Object.keys(o.columnSizing).reduce((b,C)=>(b[C]={...o.columnSizing[C]},b),{});if(t<0)throw"The provided availableSize cannot be negative!";let i=o.dragHandleOffset,r=[...new Array(o.columnGroupSize)].map((b,C)=>o.dragHandlePositionAfter-C).reverse(),a=r.map(b=>o.items[b]),l=a.map(b=>b.computedWidth),u=a.map(b=>b.computedFlex?"flex":"width"),s=0,{computedSizes:d}=Rr({items:a.map(b=>(b.resizable===!1&&(s+=b.computedWidth),{maxSize:b.computedMaxWidth,minSize:b.computedMinWidth,flex:b.resizable?b.computedWidth:null,size:0})),computeSpecialSpaceDistribution:!0,availableSize:Math.max(l.reduce(ns,0)+i-s,0)}),c=a.map((b,C)=>d[C]-b.computedWidth),f=!0,m=!0,p=!0,h=[];c.forEach((b,C)=>{let T=a[C];if(!T.resizable){h.push(0);return}let v=u[C],S=l[C],D=Qp(n),{maxReached:R,minReached:E,constrained:N,adjustedDiff:w}=xr({availableSize:o.availableSize,reservedWidth:o.reservedWidth,dragHandleOffset:b,dragHandlePositionAfter:r[C],shareSpaceOnResize:!1,items:o.items,columnSizing:D});n[T.id]={...D[T.id],[v]:S+w},h.push(w),R||(m=!1),E||(f=!1),N||(p=!1)});let g=h.reduce(ns,0);return{minReached:f,maxReached:m,constrained:p,adjustedDiffs:h,adjustedDiff:g,columnSizing:n,reservedWidth:e-g}};var Yo;function nn(){if(Yo!=null)return Yo;let o=Ve().document??null;if(!o)return 0;let t=o.createElement("div");t.style.visibility="hidden",t.style.overflow="scroll",o.body.appendChild(t);let e=o.createElement("div");return t.appendChild(e),Yo=t.offsetWidth-e.offsetWidth,t.parentNode?.removeChild(t),Yo}var is=["start",void 0,"end"],rs=(o,t)=>(t&&Object.keys(t).length>0&&o.sort((e,n)=>{let i=t[e],r=t[n];return i===!0&&(i="start"),r===!0&&(r="start"),i==r?0:is.indexOf(i)-is.indexOf(r)}),o);function as(o,t,...e){let n=t;return e.forEach(i=>{for(let r in i)i.hasOwnProperty(r)&&o(i[r],r)&&(n[r]=i[r])}),n}function Pr(o,...t){return as(e=>e!=null,o,...t)}function ls(o,t,...e){return as((n,i)=>!(i in o),t,...e)}var Zo=Object.freeze({}),em={string:Zo,number:{}};function Dr(o,t){let e=t.default||Zo;return o.type===void 0?e:o.type===null?Zo:typeof o.type=="string"?t[o.type]||em[o.type]||Zo:o.type.reduce((n,i)=>Object.assign(n,t[i]),{})}var Xo=!0,tm=!0,nm=!0,om="string",_n="unknown",im=en("getComputedVisibleColumns"),rm=(o,t,e)=>o[e]!==!1,Ar=(o,t)=>{if(!t)return!1;let e=t[o];return e==="start"||e===!0?"start":e==="end"?"end":!1},ss=({columns:o,bodySize:t,columnMinWidth:e,columnMaxWidth:n,columnDefaultWidth:i,columnDefaultFlex:r,scrollbarWidth:a,columnCssEllipsis:l,columnHeaderCssEllipsis:u,pinnedStartMaxWidth:s,pinnedEndMaxWidth:d,filterValue:c,sortable:f,sortInfo:m,multiSort:p,filterTypes:h=Mn,viewportReservedWidth:g,resizableColumns:b,draggableColumns:C,columnDefaultDraggable:T,columnOrder:v,columnPinning:S,editable:D,columnDefaultEditable:R,columnDefaultFilterable:E,columnDefaultGroupable:N,columnDefaultSortable:w,columnSizing:P,columnTypes:_,columnVisibility:A,columnVisibilityAssumeVisible:I,groupBy:M})=>{let F=0,O={};M.forEach((K,y)=>{K.field&&(O[K.field]=y)});let z=(c||[]).reduce((K,y)=>{let{id:x,field:G}=y;return G&&(K[G]=y),x&&(K[x]=y),K},{}),k=rs(v===!0?Object.keys(o):v,S),H=k.filter(K=>o[K]?rm(A,I,K):(im(`Column with id "${K}" specified in columnOrder array cannot be found in the columns map.`),!1)),oe=new Map,le=H.map((K,y)=>{let x=o[K];return oe.set(K,y),x}),q=(m??[]).reduce((K,y,x)=>(y.id?K[y.id]={sortInfo:y,index:x}:y.field&&(K[y.field]={sortInfo:y,index:x}),K),{});function Re(K){let y=o[K],x=Dr(y,_),G={minWidth:x?.minWidth,maxWidth:x?.maxWidth,width:x?.defaultWidth,flex:x?.defaultFlex},V=Pr({width:y?.defaultWidth,flex:y?.defaultFlex,minWidth:y?.minWidth,maxWidth:y?.maxWidth},P[K]);V.width!=null&&delete G.flex,V.flex!=null&&delete G.width,V=Pr(G,V);let L=V.flex??void 0,J=V.minWidth??y?.minWidth??e,re=V.maxWidth??y?.maxWidth??n,pe=L!=null?void 0:V.width??(r?void 0:i);return!pe&&L==null&&(r?L=r:pe=J),{size:pe,flex:L,minSize:J,maxSize:re}}let ye=Rr({availableSize:Math.max(t.width-(g??0)-(a??nn()),0),maxSize:n,minSize:e,items:H.map(Re)}),{computedSizes:Pe,flexSizes:je,minSizes:Fe,maxSizes:be}=ye,De=[],ge=[],te=[],B=[];B.length=H.length;let X=new Map,j=new Map,ie=0,Q=0,Ce=0,se=null,ee=[],Y=0,ae=0,ce=0;le.forEach((K,y)=>{let x=H[y],G=Pe[y],V=ee[y]=Ar(x,S);V==="start"?Y+=G:V==="end"?ce+=G:ae+=G});let Ne=t.width-ce,ze=[],qe=new Map;H.forEach((K,y)=>{let x=le[y];qe.set(K,x)});let Ze=[];Object.keys(o).forEach(K=>{let y=o[K];Ze.push(K),qe.has(K)||qe.set(K,y)});let ue=new Map;qe.forEach((K,y)=>{let x=oe.get(y);x==null&&(x=-1);let G=x!=-1,V=H[x+1],L=Dr(K,_),J=x,re=q[y]?q[y]:K.field?q[K.field]??null:null,pe=re?.sortInfo??null,he=!!pe,Te=he&&pe.dir===1,we=he&&!Te,_e=re?.index??-1,Oe=G?{}:Re(y),de=G?Pe[x]:Oe.size||0,Zt=G&&je[x]||null,Ht=G?Fe[x]||0:Oe.minSize||0,Bt=G?be[x]||1e4:Oe.maxSize||1e4,Ye=G?Ar(y,S):!1,Et=G?x===H.length-1:!1,vt=J,Rn=G?Ye==="start"?Q:Ye==="end"?Ce:F-Q:0;Ye=="start"?vt=G?J:-1:Ye==="end"?vt=G?J-(De.length+te.length):-1:vt=G?J-De.length:-1;let so=G?Ye==="start"||Ye===!1?F:Ne+Ce:-1,Xt=G?Ye!==se:!1,lp=G?Et||Ye!==Ar(V,S):!1,$a=K.cssEllipsis??L.cssEllipsis??l,sp=K.headerCssEllipsis??L.cssEllipsis??K.cssEllipsis??L.headerCssEllipsis??u??$a,Vo=G&&(z[y]||K.field||K.groupByForColumn)&&(z[y]||z[K.field||K.groupByForColumn])||null,up=K.defaultFilterable??L.defaultFilterable??E??!0,dp=D??K.defaultEditable??L.defaultEditable??R??!1,ur=K.dataType||L.dataType||(Array.isArray(K.type)?K.type[0]:K.type)||om,cp=K.sortType||L.sortType||ur,Ua=K.filterType||L.filterType||ur,qa=!1;if(Vo!=null&&!Vo.disabled){let fr=h[Ua];fr&&(!fr.emptyValues||!fr.emptyValues.includes(Vo.filter.value))&&(qa=!0)}let cn=K.field??L.field,Ya=K.valueGetter??L.valueGetter,dr=K.defaultGroupable??L.defaultGroupable??N??!!cn;cn||(dr=!1),K.groupByForColumn&&(dr=!1);let cr=K.defaultSortable??L.defaultSortable;cr==null&&!K.groupByForColumn&&cn==null&&Ya==null&&(cr=!1);let Za=cn?O[cn]!==void 0:!1,fp=Za?O[cn]:void 0,pp=f??cr??w??Xo,mp=K.resizable??L.resizable??b??tm,Xe={colType:L,align:L.align,headerAlign:L.headerAlign,computedVisible:G,verticalAlign:L.verticalAlign,defaultHiddenWhenGroupedBy:L.defaultHiddenWhenGroupedBy,valueGetter:Ya,valueFormatter:L.valueFormatter,renderValue:L.renderValue,render:L.render,style:L.style,className:L.className,contentFocusable:L.contentFocusable,renderMenuIcon:L.renderMenuIcon,renderSortIcon:L.renderSortIcon,renderRowDetailIcon:L.renderRowDetailIcon,renderSelectionCheckBox:L.renderSelectionCheckBox,renderHeaderSelectionCheckBox:L.renderHeaderSelectionCheckBox,headerStyle:L.headerStyle,headerClassName:L.headerClassName,columnGroup:L.columnGroup,getValueToEdit:L.getValueToEdit,getValueToPersist:L.getValueToPersist,shouldAcceptEdit:L.shouldAcceptEdit,field:cn,...K,components:{...L.components,...K.components},computedResizable:mp,computedMinWidth:Ht,computedMaxWidth:Bt,computedFlex:Zt,computedDataType:ur,computedEditable:dp,computedSortType:cp,computedFilterType:Ua,cssEllipsis:$a,headerCssEllipsis:sp,computedFilterValue:Vo,computedFiltered:qa,computedFilterable:up,computedGroupable:dr,computedGroupedBy:Za,computedGroupedByIndex:fp,computedWidth:de,computedAbsoluteOffset:so,computedPinningOffset:Rn,computedVisibleIndexInCategory:vt,computedOffset:F,computedSortable:pp,computedSortInfo:pe,computedSortIndex:_e,computedMultiSort:p,computedSorted:he,computedSortedAsc:Te,computedSortedDesc:we,computedVisibleIndex:J,computedPinned:Ye,computedDraggable:C??K.defaultDraggable??T??nm,computedFirstInCategory:Xt,computedLastInCategory:lp,computedFirst:x===0,computedLast:Et,id:y,header:K.header??L.header??K.name??K.field};G&&(F+=de,X.set(Xe.id,Xe),B[x]=Xe,Ye==="start"&&(De.push(Xe),Q+=Xe.computedWidth),Ye==="end"&&(ge.push(Xe),Ce+=Xe.computedWidth),Ye||(te.push(Xe),ie+=Xe.computedWidth),se=Ye),Xe.groupByForColumn&&(Xe.computedSortType=K.sortType||L.sortType||_n,ze.push(Xe)),j.set(Xe.id,Xe),Xe.field&&!Xe.groupByForColumn&&!ue.has(Xe.field)&&ue.set(Xe.field,Xe)}),ze.forEach(K=>{K.computedSortable=us(K,{fieldsToColumn:ue,sortable:f,columnDefaultSortable:w})});let pt=new Map;Ze.forEach(K=>{let y=j.get(K);y&&pt.set(K,y)}),j.forEach(K=>{pt.has(K.id)||pt.set(K.id,K)});let bt=s!=null?Math.min(s,Q):Q,St=d!=null?Math.min(d,Ce):Ce;return{computedRemainingSpace:t.width-(Y+ce+ae),computedPinnedStartColumnsWidth:Q,computedPinnedEndColumnsWidth:Ce,computedUnpinnedColumnsWidth:ie,computedColumnOrder:k,computedPinnedStartColumns:De,computedPinnedEndColumns:ge,computedUnpinnedOffset:Q,computedPinnedEndOffset:Q+ie,computedUnpinnedColumns:te,computedVisibleColumns:B,computedColumnsMap:j,computedColumnsMapInInitialOrder:pt,computedVisibleColumnsMap:X,computedPinnedEndWidth:St,computedPinnedStartWidth:bt,renderSelectionCheckBox:B.reduce((K,y)=>K||!!y.renderSelectionCheckBox,!1),fieldsToColumn:ue}};function us(o,t){let{sortable:e,fieldsToColumn:n,columnDefaultSortable:i}=t;if(e)return e;let r=o.defaultSortable??o.colType.defaultSortable;if(r!=null)return r;let a=i??Xo;return o.computedSortType!==_n&&a?!0:u=>{let{column:s,api:d}=u,c=s.groupByForColumn||[];return c!=null&&!Array.isArray(c)&&(c=[c]),(c||[]).reduce((f,m)=>{if(!f)return!1;let p=m.field||m.groupField,h;if(p){let g=n.get(p),b=g?d.getColumnApi(g.id):void 0;g&&b?h=b.isSortable():h=!1}return h===void 0&&m.valueGetter&&(h=!0),h??i??Xo},!0)}}function at(o,t){let{getComputed:e,getState:n,actions:i,api:r}=t;typeof o=="number"&&(o=e().computedVisibleColumns[o]);let a=typeof o=="string"?e().computedColumnsMap.get(o):o;if(!a)return null;let l={getCellValuesByPrimaryKey(u){return t.api.getCellValues({columnId:a.id,primaryKey:u})},getCellValueByPrimaryKey(u){return l.getCellValuesByPrimaryKey(u)?.value??null},toggleContextMenu(u){n().columnMenuVisibleForColumnId===a.id?this.hideContextMenu():this.showContextMenu(u)},toggleFilterOperatorMenu(u){n().filterOperatorMenuVisibleForColumnId===a.id?this.hideFilterOperatorMenu():this.showFilterOperatorMenu(u)},showFilterOperatorMenu(u){n().onFilterOperatorMenuClick({target:u,column:a})},hideFilterOperatorMenu(){r.hideFilterOperatorMenu()},showContextMenu(u){n().onColumnMenuClick({target:u,column:a})},hideContextMenu(){i.columnMenuVisibleForColumnId=null},isVisible(){return e().computedVisibleColumnsMap.has(a.id)},setVisible(u){r.setVisibilityForColumn(a.id,u)},toggleSort(u={multiSortBehavior:"replace"}){return r.toggleSortingForColumn(a.id,u)},isSortable(){let{computedColumnsMap:u}=e();return typeof a.computedSortable=="function"?a.computedSortable({api:r,columnApi:l,column:a,columns:u}):a.computedSortable},getSortDir(){return r.getSortingForColumn(a.id)},setFilter(u){return r.setColumnFilter(a.id,u)},clearFilter(){return r.clearColumnFilter(a.id)},getSortInfo(){return r.getSortInfoForColumn(a.id)},setSort(u){u?r.setSortingForColumn(a.id,u):r.setSortInfoForColumn(a.id,null)},clearSort(){this.setSort(null)},getColumnId(){return a.id},getComputedColumn(){return a}};return l}function Co(o,t,e){let n=typeof o=="string"?t.getComputed().computedColumnsMap.get(o):o,{api:i,getComputed:r,getDataSourceState:a,actions:l,dataSourceActions:u,dataSourceApi:s}=t,d=a(),{allRowsSelected:c,someRowsSelected:f,selectionMode:m}=d,p=r(),h=n.header&&typeof n.header!="function"?n.header:n.name||n.id||"";if(typeof n.header=="function"){let g=at(n.id,{...t,actions:l,dataSourceActions:u,dataSourceApi:s});h=n.header({horizontalLayoutPageIndex:null,column:n,columnApi:g,dataSourceApi:s,renderLocation:e,dragging:!1,columnsMap:p.computedColumnsMap,columnSortInfo:n.computedSortInfo,columnFilterValue:n.computedFilterValue,filtered:n.computedFiltered,allRowsSelected:c,someRowsSelected:f,selectionMode:m,api:i,renderBag:{header:h}})??null}return h}var Ge="Infinite",Be={rootClassName:Ge};var Jo=`${Ge}HeaderCell__filter`,_r=`${Ge}HeaderCell__filterOperator`,ds=`${Jo}__input`;var fe=require("vue");function U(o){return o.slice(4,-1)}function Qo(o,t,e,n){let i=[...t],r={filtered:o.computedFiltered,first:o.computedFirst,last:o.computedLast,groupByField:!!o.groupByForColumn,firstInCategory:o.computedFirstInCategory,lastInCategory:o.computedLastInCategory,pinned:o.computedPinned||!1,cellSelected:n.cellSelected||!1,rowSelected:n.rowSelected??"null",rowActive:n.rowActive,dragging:n.dragging,insideDisabledDraggingPage:n.insideDisabledDraggingPage,firstRow:n.firstRow??!1,firstRowInHorizontalLayoutPage:n.firstRowInHorizontalLayoutPage??!1,rowDisabled:n.rowDisabled,groupRow:n.groupRow,groupCell:n.groupCell,treeNode:n.treeNode,verticalAlign:n.verticalAlign,align:n.align,zebra:n.zebra},a=e(r);return i.push(a),o.computedFirst&&i.push(...t.map(l=>`${l}--first`)),o.groupByForColumn&&i.push(...t.map(l=>`${l}--group-column`)),o.computedLast&&i.push(...t.map(l=>`${l}--last`)),o.computedFirstInCategory&&i.push(...t.map(l=>`${l}--first-in-category`)),o.computedLastInCategory&&i.push(...t.map(l=>`${l}--last-in-category`)),n.rowSelected&&i.push(...t.map(l=>`${l}--row-selected`)),n.cellSelected&&i.push(...t.map(l=>`${l}--cell-selected`)),n.firstRow&&i.push(...t.map(l=>`${l}--first-row`)),n.firstRowInHorizontalLayoutPage&&i.push(...t.map(l=>`${l}--first-row-in-horizontal-layout-page`)),n.rowDisabled&&i.push(...t.map(l=>`${l}--disabled`)),n.treeNode&&i.push(...t.map(l=>`${l}--tree-node ${l}-tree-${n.treeNode}-node`)),n.groupRow&&(i.push(...t.map(l=>`${l}--group-row`)),i.push(...t.map(l=>`${l}--${n.rowExpanded?"group-row-expanded":"group-row-collapsed"}`))),o.computedPinned?i.push(...t.map(l=>`${l}--pinned-${o.computedPinned}`)):i.push(...t.map(l=>`${l}--unpinned`)),i.filter(Boolean).join(" ")}var Ks=require("vue");var Je=class o{constructor(t){this.top=0;this.left=0;this.left=t.left,this.top=t.top}static clone(t){return new o(t)}static from(t){return new o(t)}shift(t){return t.top!=null&&(this.top+=t.top),t.left!=null&&(this.left+=t.left),this}getDistanceToPoint(t){let e=t.top-this.top,n=t.left-this.left;return{top:e,left:n}}};function cs(o,t){let e=Math.atan2(o.top-t.top,o.left-t.left);return e<=0&&(e=2*Math.PI+e),e}function fs(o,t){return Math.sqrt((t.top-o.top)**2+(t.left-o.left)**2)}function am(o,t,e){let n=cs(o,e),i=cs(t,e);return n===i?fs(e,t)-fs(e,o):n-i}function ps(o){if(o.length<3)return o;let[...t]=o,e={top:0,left:0};return o.forEach(n=>{e.top+=n.top,e.left+=n.left}),e.top/=o.length,e.left/=o.length,t.sort((n,i)=>am(n,i,e)),t}function lm(o){if(o.length<2)return!1;let t=o[0].left,e=o[0].top,n={left:!1,top:!1};for(let i=1,r=o.length;i<r;i++){if(n.left&&n.top)return!1;o[i].left!==t&&(n.left=!0),o[i].top!==e&&(n.top=!0)}return!(n.left&&n.top)}function sm(o,t){if(o.length<2)return o[0]?o[0].left===t.left&&o[0].top===t.top:!1;o=ps(o);let e=o[0],n=o[o.length-1];return e.left===n.left?t.left===e.left&&t.top>=Math.min(e.top,n.top)&&t.top<=Math.max(e.top,n.top):t.top===e.top&&t.left>=Math.min(e.left,n.left)&&t.left<=Math.max(e.left,n.left)}function ms(o,t){if(lm(o))return sm(o,t);o=ps(o);let[e]=o;for(let n=1,i=o.length-1;n<i;n++){let r=o[n],a=o[n+1];if(um([e,r,a],t))return!0}return!1}function um(o,t){let[e,n,i]=o,r=t,a=(n.left-e.left)*(i.top-e.top)-(n.top-e.top)*(i.left-e.left);return a*((n.left-e.left)*(r.top-e.top)-(n.top-e.top)*(r.left-e.left))>=0&&a*((i.left-n.left)*(r.top-n.top)-(i.top-n.top)*(r.left-n.left))>=0&&a*((e.left-i.left)*(r.top-i.top)-(e.top-i.top)*(r.left-i.left))>=0}var En=class{containsPoint(t){return ms(this.getPoints(),t)}contains(t){let e=t.getPoints();for(let n=0,i=e.length;n<i;n++)if(!this.containsPoint(e[n]))return!1;return!0}intersects(t){return this.privateIntersects(t,!1)}privateIntersects(t,e){let n=t.getPoints();for(let i=0,r=n.length;i<r;i++)if(this.containsPoint(n[i]))return!0;return e?!1:t.privateIntersects(this,!0)}};var Fn=class o extends En{static clone(t){return new o(t)}constructor(t){super(),this.points=t.map(Je.clone)}getPoints(){return this.points}shift(t){return this.points.forEach(e=>{e.shift(t)}),this}};function dm(o,t){let e=Math.min(o.left,t.left),n=Math.min(o.top,t.top),i=o.left+o.width,r=t.left+t.width,a=Math.max(i,r),l=o.top+o.height,u=t.top+t.height,s=Math.max(l,u);return new Me({top:n,left:e,width:a-e,height:s-n})}var Me=class o extends En{constructor(e){super();this.top=0;this.left=0;this.width=0;this.height=0;this.top=e.top,this.left=e.left,typeof e.width=="number"?(this.width=e.width,this.height=e.height):(this.width=e.right-e.left,this.height=e.bottom-e.top)}static fromDOMRect(e){return new o(e)}static clone(e){return new o(e)}static from(e){return o.clone(e)}static fromPoint(e){return o.from({top:e.top,left:e.left,width:0,height:0})}getMinimumBoundingRectangle(...e){let n=this;for(let i of e)n=dm(n,i);return n}toDOMRect(){return{top:this.top,left:this.left,bottom:this.top+this.height,right:this.left+this.width,height:this.height,width:this.width,x:this.left,y:this.top,toJSON:()=>({top:this.top,left:this.left,bottom:this.top+this.height,right:this.left+this.width,height:this.height,width:this.width,x:this.left,y:this.top})}}containsPoint(e){return new Fn(this.getPoints()).containsPoint(e)}getTopLeft(){return{left:this.left,top:this.top}}getTopRight(){return{left:this.left+this.width,top:this.top}}getBottomLeft(){return{left:this.left,top:this.top+this.height}}getBottomRight(){return{left:this.left+this.width,top:this.top+this.height}}getCenter(){return{left:this.left+this.width/2,top:this.top+this.height/2}}getPoints(){return[this.getTopLeft(),this.getTopRight(),this.getBottomLeft(),this.getBottomRight()].map(Je.from)}shift(e){return e.top!=null&&(this.top+=e.top),e.left!=null&&(this.left+=e.left),this}};function To(o){if(!o)return!1;let t=o.tagName;return t==="INPUT"||t==="BUTTON"}var hs="_1yeub2v0 _16lm1iw1 _16lm1iw1p _16lm1iw2f _16lm1iw0",gs="_1yeub2vs",ys="_1yeub2vr",bs=ve({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 Mr="_1yeub2vp";var wC=ve({defaultClassName:"_1yeub2vl",variantClassNames:{pinned:{start:"_1yeub2vm",end:"_1yeub2vn",false:"_1yeub2vo"}},defaultVariants:{},compoundVariants:[]});var W={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 Er=`${Ge}Body`,Cs=o=>o.querySelector(`.${Er}`);var pn=`${Ge}HeaderCell`,Fr=`${Ge}HeaderWrapper`,Ts=o=>Array.from(o.querySelectorAll(`.${Fr}`));function Nn(o,t){let e=o;if(!e)return null;if(e&&e.matches(t))return e;for(;e=e.parentElement;)if(e.matches(t))return e;return null}function Ss(o,t,e){let n=o;if(!n)return null;if(n&&n.matches(t))return n;for(;n=n.parentElement;){if(n.matches(t))return n;if(n===e)return null}return null}var xe={loaded:"var(--infinite-loaded)",themeName:"var(--infinite-theme-name)",themeMode:"var(--infinite-theme-mode)",color:{accent:"var(--infinite-accent-color)",success:"var(--infinite-success-color)",error:"var(--infinite-error-color)",color:"var(--infinite-color)"},spacing:{0:"var(--infinite-space-0)",1:"var(--infinite-space-1)",2:"var(--infinite-space-2)",3:"var(--infinite-space-3)",4:"var(--infinite-space-4)",5:"var(--infinite-space-5)",6:"var(--infinite-space-6)",7:"var(--infinite-space-7)",8:"var(--infinite-space-8)",9:"var(--infinite-space-9)",10:"var(--infinite-space-10)"},fontSize:{0:"var(--infinite-font-size-0)",1:"var(--infinite-font-size-1)",2:"var(--infinite-font-size-2)",3:"var(--infinite-font-size-3)",4:"var(--infinite-font-size-4)",5:"var(--infinite-font-size-5)",6:"var(--infinite-font-size-6)",7:"var(--infinite-font-size-7)"},fontFamily:"var(--infinite-font-family)",minHeight:"var(--infinite-min-height)",borderRadius:"var(--infinite-border-radius)",focusOutline:"var(--infinite-focus-outline)",background:"var(--infinite-background)",iconSize:"var(--infinite-icon-size)",runtime:{bodyWidth:"var(--infinite-runtime-body-content-width)",totalVisibleColumnsWidthValue:"var(--infinite-runtime-total-visible-columns-width)",totalVisibleColumnsWidthVar:"var(--infinite-runtime-total-visible-columns-width-var)",visibleColumnsCount:"var(--infinite-runtime-visible-columns-count)",browserScrollbarWidth:"var(--infinite-runtime-browser-scrollbar-width)"},components:{GroupingToolbar:{color:"var(--infinite-grouping-toolbar-color)",background:"var(--infinite-grouping-toolbar-background)",rejectBackground:"var(--infinite-grouping-toolbar-reject-background)",activeBackground:"var(--infinite-grouping-toolbar-active-background)",activeBackgroundAlpha:"var(--infinite-grouping-toolbar-active-background-alpha)",padding:"var(--infinite-grouping-toolbar-padding)",border:"var(--infinite-grouping-toolbar-border)",rejectBorder:"var(--infinite-grouping-toolbar-reject-border)",gap:"var(--infinite-grouping-toolbar-gap)"},GroupingToolbarItem:{border:"var(--infinite-grouping-toolbar-item-border)",borderRadius:"var(--infinite-grouping-toolbar-item-border-radius)",activeBorder:"var(--infinite-grouping-toolbar-item-active-border)",background:"var(--infinite-grouping-toolbar-item-background)",activeBackground:"var(--infinite-grouping-toolbar-item-active-background)",activeBackgroundAlpha:"var(--infinite-grouping-toolbar-item-active-background-alpha)"},LoadMask:{padding:"var(--infinite-load-mask-padding)",color:"var(--infinite-load-mask-color)",textBackground:"var(--infinite-load-mask-text-background)",overlayBackground:"var(--infinite-load-mask-overlay-background)",overlayOpacity:"var(--infinite-load-mask-overlay-opacity)",borderRadius:"var(--infinite-load-mask-border-radius)"},Header:{background:"var(--infinite-header-background)",color:"var(--infinite-header-color)",columnHeaderHeight:"var(--infinite-column-header-height)"},HeaderCell:{background:"var(--infinite-header-cell-background)",hoverBackground:"var(--infinite-header-cell-hover-background)",border:"var(--infinite-header-cell-border)",padding:"var(--infinite-header-cell-padding)",paddingX:"var(--infinite-header-cell-padding-x)",paddingY:"var(--infinite-header-cell-padding-y)",iconSize:"var(--infinite-header-cell-icon-size)",menuIconLineWidth:"var(--infinite-header-cell-menu-icon-line-width)",sortIconMargin:"var(--infinite-header-cell-sort-icon-margin)",borderRight:"var(--infinite-header-cell-border-right)",resizeHandleActiveAreaWidth:"var(--infinite-resize-handle-active-area-width)",resizeHandleWidth:"var(--infinite-resize-handle-width)",resizeHandleHoverBackground:"var(--infinite-resize-handle-hover-background)",resizeHandleConstrainedHoverBackground:"var(--infinite-resize-handle-constrained-hover-background)",filterOperatorPaddingX:"var(--infinite-filter-operator-padding-x)",filterEditorPaddingX:"var(--infinite-filter-editor-padding-x)",filterEditorMarginX:"var(--infinite-filter-editor-margin-x)",filterOperatorPaddingY:"var(--infinite-filter-operator-padding-y)",filterEditorPaddingY:"var(--infinite-filter-editor-padding-y)",filterEditorMarginY:"var(--infinite-filter-editor-margin-y)",filterEditorBackground:"var(--infinite-filter-editor-background)",filterEditorBorder:"var(--infinite-filter-editor-border)",filterEditorFocusBorderColor:"var(--infinite-filter-editor-focus-border-color)",filterEditorBorderRadius:"var(--infinite-filter-editor-border-radius)",filterEditorColor:"var(--infinite-filter-editor-color)"},ActiveCellIndicator:{inset:"var(--infinite-active-cell-indicator-inset)"},Cell:{flashingDuration:"var(--infinite-flashing-duration)",flashingAnimationName:"var(--infinite-flashing-animation-name)",flashingOverlayZIndex:"var(--infinite-flashing-overlay-z-index)",flashingBackground:"var(--infinite-flashing-background)",flashingUpBackground:"var(--infinite-flashing-up-background)",flashingDownBackground:"var(--infinite-flashing-down-background)",padding:"var(--infinite-cell-padding)",borderWidth:"var(--infinite-cell-border-width)",borderColor:"var(--infinite-cell-border-color)",border:"var(--infinite-cell-border)",borderLeft:"var(--infinite-cell-border-left)",borderRight:"var(--infinite-cell-border-right)",borderTop:"var(--infinite-cell-border-top)",borderInvisible:"var(--infinite-cell-border-invisible)",borderRadius:"var(--infinite-cell-border-radius)",reorderEffectDuration:"var(--infinite-column-reorder-effect-duration)",pinnedBorder:"var(--infinite-pinned-cell-border)",horizontalLayoutColumnReorderDisabledPageOpacity:"var(--infinite-horizontal-layout-column-reorder-disabled-page-opacity)",color:"var(--infinite-cell-color)",selectedBackground:"var(--infinite-selected-cell-background)",selectedBackgroundDefault:"var(--infinite-selected-cell-background-default)",selectedBackgroundAlpha:"var(--infinite-selected-cell-background-alpha)",selectedBackgroundAlphaWhenTableUnfocused:"var(--infinite-selected-cell-background-alpha--table-unfocused)",selectedBorderColor:"var(--infinite-selected-cell-border-color)",selectedBorderWidth:"var(--infinite-selected-cell-border-width)",selectedBorderStyle:"var(--infinite-selected-cell-border-style)",selectedBorder:"var(--infinite-selected-cell-border)",activeBackgroundAlpha:"var(--infinite-active-cell-background-alpha)",activeBackgroundAlphaWhenTableUnfocused:"var(--infinite-active-cell-background-alpha--table-unfocused)",activeBackground:"var(--infinite-active-cell-background)",activeBackgroundDefault:"var(--infinite-active-cell-background-default)",activeBorderColor:"var(--infinite-active-cell-border-color)",activeBorderWidth:"var(--infinite-active-cell-border-width)",activeBorderStyle:"var(--infinite-active-cell-border-style)",activeBorder:"var(--infinite-active-cell-border)"},SelectionCheckBox:{marginInline:"var(--infinite-selection-checkbox-margin-inline)"},ExpandCollapseIcon:{color:"var(--infinite-expand-collapse-icon-color)"},Menu:{background:"var(--infinite-menu-background)",color:"var(--infinite-menu-color)",separatorColor:"var(--infinite-menu-separator-color)",padding:"var(--infinite-menu-padding)",cellPaddingVertical:"var(--infinite-menu-cell-padding-vertical)",cellPaddingHorizontal:"var(--infinite-menu-cell-padding-horizontal)",cellMarginVertical:"var(--infinite-menu-cell-margin-vertical)",itemDisabledBackground:"var(--infinite-menu-item-disabled-background)",itemActiveBackground:"var(--infinite-menu-item-active-background)",itemActiveOpacity:"var(--infinite-menu-item-active-opacity)",itemPressedOpacity:"var(--infinite-menu-item-pressed-opacity)",itemPressedBackground:"var(--infinite-menu-item-pressed-background)",itemDisabledOpacity:"var(--infinite-menu-item-disabled-opacity)",borderRadius:"var(--infinite-menu-border-radius)",shadowColor:"var(--infinite-menu-shadow-color)"},RowDetail:{background:"var(--infinite-rowdetail-background)",padding:"var(--infinite-rowdetail-padding)",gridHeight:"var(--infinite-rowdetail-grid-height)"},Row:{background:"var(--infinite-row-background)",oddBackground:"var(--infinite-row-odd-background)",disabledBackground:"var(--infinite-row-disabled-background)",oddDisabledBackground:"var(--infinite-row-odd-disabled-background)",selectedBackground:"var(--infinite-row-selected-background)",disabledOpacity:"var(--infinite-row-disabled-opacity)",activeBackground:"var(--infinite-active-row-background)",activeBorderColor:"var(--infinite-active-row-border-color)",activeBorderWidth:"var(--infinite-active-row-border-width)",activeBorderStyle:"var(--infinite-active-row-border-style)",activeBorder:"var(--infinite-active-row-border)",activeBackgroundAlpha:"var(--infinite-active-row-background-alpha)",activeBackgroundAlphaWhenTableUnfocused:"var(--infinite-active-row-background-alpha--table-unfocused)",hoverBackground:"var(--infinite-row-hover-background)",selectedHoverBackground:"var(--infinite-row-selected-hover-background)",selectedDisabledBackground:"var(--infinite-row-selected-disabled-background)",groupRowBackground:"var(--infinite-group-row-background)",groupRowColumnNesting:"var(--infinite-group-row-column-nesting)",groupNesting:"var(--infinite-dont-override-group-row-nesting-length)",pointerEventsWhileScrolling:"var(--infinite-row-pointer-events-while-scrolling)"},ColumnCell:{background:"var(--infinite-column-cell-bg-dont-override)"}}},ws="column-header-height";var vs=`.${Be.rootClassName}`;function Nr(o){return Nn(o,vs)}var Is=U(W.scrollLeft),cm=U(W.scrollTop),fm=U(W.columnWidthAtIndex),Or=U(W.columnOffsetAtIndex),Rs=U(W.columnReorderEffectDurationAtIndex),pm=U(W.columnOffsetAtIndexWhileReordering),mm=U(W.columnVisibilityAtIndex),hm=U(W.columnZIndexAtIndex);function Nt(o,t,e){let n=e?Nr(e):document.querySelector(vs);gm(o,t,n)}function gm(o,t,e){if(e){let n=o,i=W[n]?U(W[n]):o;e.style.setProperty(i,`${t}`)}}function On(o,t){if(t)for(var e in o){let n=W[e]?U(W[e]):e,i=`${o[e]}`;t.style.setProperty(n,i)}}function kr(o,t,e){Nt(`${Or}-${o.computedVisibleIndex}`,o.computedPinned?`calc( ${o.computedAbsoluteOffset+t}px + var(${Is}))`:`${o.computedAbsoluteOffset+t}px`,e)}function Lr(o,t,e){Nt(`${hm}-${o}`,`${t}`,e)}function So(o,t,e){Nt(`${pm}-${o}`,typeof t=="number"?`calc( var(${Or}-${o}) + ${t}px )`:t,e)}function wo(o,t,e){Nt(`${mm}-${o}`,t,e)}function ei(o,t,e){Nt(`${Rs}-${o}`,e??"",t)}function zr(o,t){let e=`${Rs}-${o}`;Nt(e,xe.components.Cell.reorderEffectDuration,t)}var Se={columnWidths:{get(o){return`var(${this.getVarName(o)})`},getVarName(o){return this.varName.get(o)},varName:{get(o){return`${fm}-${o}`}},set(o,t,e){t=typeof t=="number"?t+"px":t,Nt(this.varName.get(o),t,e)}},columnOffsets:{get(o){return`var(${this.getVarName(o)})`},getVarName(o){return this.varName.get(o)},varName:{get(o){return`${Or}-${o}`}},set(o,t,e){t=typeof t=="number"?t+"px":t,Nt(this.varName.get(o),t,e)}}};function xs(o,t){On({[Is]:`${o.scrollLeft}px`,[cm]:`${o.scrollTop}px`},t)}var vo={bodyWidth:{name:U(xe.runtime.bodyWidth),value:""},totalVisibleColumnsWidthValue:{name:U(xe.runtime.totalVisibleColumnsWidthValue),value:""},totalVisibleColumnsWidthVar:{name:U(xe.runtime.totalVisibleColumnsWidthVar),value:""},visibleColumnsCount:{name:U(xe.runtime.visibleColumnsCount),value:""},browserScrollbarWidth:{name:U(xe.runtime.browserScrollbarWidth),value:""}},ym=U(W.scrollbarWidthHorizontal),Ps=U(W.scrollbarWidthVertical),bm=U(W.columnWidthAtIndex),Cm=U(W.columnZIndexAtIndex),Ds=U(W.scrollLeft),Tm=U(W.activeCellColWidth),As=U(W.activeCellColOffset),Fs=U(W.baseZIndexForCells),Sm=U(W.pinnedStartWidth),_s=U(W.bodyWidth),wm=U(W.bodyHeight),Ms=U(W.pinnedEndOffset),Es=U(W.pinnedEndWidth),vm=U(W.computedVisibleColumnsCount);function Vr(o,t){let e="auto",n=o.computedVisibleIndex;return o.computedPinned?o.computedPinned==="start"?e=t.pinnedStartColsCount-o.computedVisibleIndexInCategory:o.computedPinned==="end"&&(e=t.visibleColsCount+o.computedVisibleIndexInCategory):e=-n*10,typeof e=="number"?`calc( var(${Fs}) `+(e<0?"-":"+")+` ${Math.abs(e)} )`:"auto"}function Ns(o){let{computedVisibleColumns:t,computedPinnedStartColumns:e,computedPinnedEndColumns:n,computedPinnedStartColumnsWidth:i,computedPinnedEndColumnsWidth:r,computedUnpinnedColumnsWidth:a,bodySize:l,activeCellIndex:u,brain:s,scrollbars:d}=o,c=nn(),f=[],m=t.reduce((p,h)=>{let g=h.computedVisibleIndex;p[Se.columnWidths.varName.get(g)]=h.computedWidth+"px",p[Se.columnOffsets.varName.get(g)]=h.computedPinned==="start"?`calc( ${h.computedOffset}px + var(${Ds}) )`:h.computedPinned==="end"?`calc( var(${Ms}) ${f.length?"+":""} ${f.map(C=>Se.columnWidths.get(C.computedVisibleIndex)).join(" + ")} + var(${Ds}) )`:`${h.computedOffset}px`;let b=Vr(h,{pinnedStartColsCount:e.length,visibleColsCount:t.length});return p[`${Cm}-${g}`]=`${b}`,h.computedPinned==="end"&&f.push(h),p},{});if(l.width&&(m[vo.browserScrollbarWidth.name]=`${nn()}px`),m[vo.bodyWidth.name]=`calc(${W.bodyWidth} - ${W.scrollbarWidthVertical})`,m[vo.totalVisibleColumnsWidthValue.name]=`${i+r+a}px`,m[vo.totalVisibleColumnsWidthVar.name]=`calc(${t.map((p,h)=>`var(${bm}-${h})`).join(" + ")})`,m[vo.visibleColumnsCount.name]=t.length,u!=null){m[Tm]=Se.columnWidths.get(u[1]);let p=Se.columnOffsets.get(u[1]);if(s.isHorizontalLayoutBrain){let h=s.getPageIndexForRow(u[0]);m[As]=h?`calc( ${xe.runtime.totalVisibleColumnsWidthVar} * ${h} + ${p})`:p}else m[As]=p}return m[vm]=t.length,m[ym]=d.horizontal?`${c}px`:"0px",m[Ps]=d.vertical?`${c}px`:"0px",m[Sm]="calc( "+e.map(p=>Se.columnWidths.get(p.computedVisibleIndex)).join(" + ")+")",m[Es]="calc( "+n.map(p=>Se.columnWidths.get(p.computedVisibleIndex)).join(" + ")+")",m[Fs]=t.length*10,m[Ms]=`calc( var(${_s}) - var(${Es}) - var(${Ps}) )`,m[_s]=`${l.width}px`,m[wm]=`${l.height}px`,m}var Io=(o,t,e)=>{if(o=[...o],t===e||o[t]===void 0||o[e]===void 0)return o;let n=o[t];return e<t,o.splice(t,1),o.splice(e,0,n),o};function Gr(o){let{newColumnOrder:t,visibleColumnOrder:e,existingColumnOrder:n,dragColumnId:i}=o;if(e.length!==t.length)return console.warn("new column order cannot contain less columns than the visible column order"),t;let r=e.indexOf(i),a=t.indexOf(i);if(r===a)return n;if(a>r){let l=t.indexOf(i),u=t[l-1],s=n.indexOf(u),d=n.indexOf(i);return Io(n,d,s)}else{let l=t.indexOf(i),u=t[l+1],s=n.indexOf(u),d=n.indexOf(i);return Io(n,d,s)}return t}var Vs=uo(kn());function ti(o){return o.map(t=>t instanceof on?t:new on(null,[t]))}var on=class o{constructor(t,e=[]){this.__operands=[];this.__operation=null;this.__operands=e,this.__operation=t}add(...t){return new o("+",[this,...t])}subtract(...t){return new o("-",[this,...t])}minus(...t){return this.subtract(...t)}multiply(...t){return new o("*",[this,...t])}divide(...t){return new o("/",[this,...t])}__get(t){let{__operation:e,__operands:n}=this,i=n.map(a=>Im(a,this)).join(` ${e} `);return(n.length<=1?!0:t?.__operation==="+"||t?.__operation==="-")?i:`(${i})`}done(){let t=this.__get();return`calc${t.startsWith("(")&&t.endsWith(")")?t:`(${t})`}`}};function Im(o,t){return typeof o=="string"||typeof o=="number"?`${o}`:t?o.__get(t):o.done()}var Rm=(...o)=>new on("+",ti(o)),ks=(...o)=>new on("-",ti(o)),xm=(...o)=>new on("*",ti(o)),Pm=(...o)=>new on("/",ti(o)),Ro={add:Rm,subtract:ks,minus:ks,multiply:xm,divide:Pm};var Ls=o=>{let t=null,e=null;return{stop(){t!==null&&fn(t),e!=null&&fn(e)},scroll(n){t!==null&&fn(t),e!=null&&fn(e);let i={offset:100,scrollAmountsPerRaf:[1,1,2,4,6,8,11,15],...o,...n},r=this;function a(){let u=i.scrollOffsetStart+i.offset-i.mousePosition.clientX;if(!(u>0&&u<=i.offset))return!1;let d=i.scrollAmountsPerRaf.length,c=Math.round(i.offset/d),f=0;for(let m=0;m<d;m++)u>(m+1)*c&&(f=i.scrollAmountsPerRaf[m]);return n.scrollLeft=n.scrollLeft-f,t=Ke(()=>{r.scroll(n)}),!0}function l(){let u=i.mousePosition.clientX-(i.scrollOffsetEnd-i.offset);if(!(u>0&&u<=i.offset))return!1;let d=i.scrollAmountsPerRaf.length,c=Math.round(i.offset/d),f=0;for(let m=0;m<d;m++)u>(m+1)*c&&(f=i.scrollAmountsPerRaf[m]);return n.scrollLeft=n.scrollLeft+f,e=Ke(()=>{r.scroll(n)}),!0}return!!(a()||l())}}};var zs=10,Dm=U(W.pinnedStartWidth);function Gs(o){let{computedVisibleColumns:t,computedVisibleColumnsMap:e,computedPinnedEndColumns:n,computedPinnedStartColumns:i,dragColumnId:r,infiniteDOMNode:a,brain:l,dragColumnHeaderTargetRect:u,draggableColumnsRestrictTo:s,tableRect:d,acceptDropToReorderRect:c,allowColumnHideOnDrag:f,setProxyPosition:m,setDragColumnOutside:p,getCurrentDragSourceAndTarget:h,api:g,horizontalLayoutPageIndex:b,pageWidth:C}=o;function T(B){let X=B==="start"?z:k;return M===O?X:O===B?X+A.computedWidth:M===B?X-A.computedWidth:X}function v(B){if(B.columnIndex===I||b!=null)return!0;let X=t[B.columnIndex];if(X.computedPinned)return!0;let j=l.getScrollPosition().scrollLeft,ie=X.computedOffset+(b!=null&&C!=null?C*b:0);return ie>=j+T("start")&&ie+X.computedWidth<=j+d.width-T("end")}let S=(B,X)=>{let{restrictToParentGroup:j,dragColumn:ie}=X,Q=[];if(B.forEach(se=>{if(se.computedVisibleIndex===I)return;let ee={columnId:se.id,columnIndex:se.computedVisibleIndex,offsetX:se.computedOffset+Math.round(se.computedWidth/2)};v(ee)&&Q.push(ee)}),j){let ee=function(ae,ce,Ne){let ze=B[ae];ze&&(ze.columnGroup!==ie.columnGroup&&Ne.add(ze.id),ee(ae+ce,ce,Ne))};var Ce=ee;let se=ie.computedVisibleIndex,Y=new Set;ee(se-1,-1,Y),ee(se+1,1,Y),Q=Q.filter(ae=>!Y.has(ae.columnId))}return Q},R=i.length,E={clientX:Math.round(o.initialMousePosition.clientX),clientY:Math.round(o.initialMousePosition.clientY)},N={left:E.clientX-d.left-(E.clientX-u.left)+zs,top:E.clientY-d.top-(E.clientY-u.top)+zs},w=l.getScrollPosition(),P=t.map(B=>B.computedVisibleIndex),_=P,A=e.get(r),I=A.computedVisibleIndex,M=A?.computedPinned,F=I,O=M,z=l.getFixedStartColsWidth(),k=l.getFixedEndColsWidth(),H=E,oe={x:0,y:0},le=1,q=0;function Re(B){let X=Math.round(B.clientX),j=Math.round(B.clientY);if(X===H.clientX&&j===H.clientY)return Me.from(u).shift({left:oe.x,top:oe.y});H={clientX:X,clientY:j};let Q=l.getScrollPosition().scrollLeft-w.scrollLeft;return oe.x=H.clientX-E.clientX,oe.y=H.clientY-E.clientY,q=oe.x+Q,le=q<0?-1:1,m({left:N.left+oe.x,top:N.top+oe.y}),Me.from(u).shift({left:oe.x,top:oe.y})}function ye(B){let X=0;M?M==="start"&&B.forEach((j,ie)=>{X||t[j]?.computedPinned!=="start"&&(X=ie)}):B.forEach((j,ie)=>{t[j]?.computedPinned==="start"&&(X=ie+1)}),R=X,Pe("start",B,X)}function Pe(B,X,j){if(B==="start"){let ie=0;for(let Q=0;Q<j;Q++){let Ce=X[Q],se=t[Ce];ie+=se.computedWidth}Nt(Dm,`${ie}px`,a)}}function je(B){if(B==null||B===F)return;if(F===-1&&B!==-1&&(wo(I,"",a),p(!1)),F=B,B===-1){Fe(I);return}let X=Io(P,I,F>I?F-1:F);R=0;let ie=new Set;return X.forEach((Q,Ce)=>{let se=_[Ce];Q!==se&&ie.add(Q),ye(X)}),_=X,be(ie),{newColumnIndexes:X,indexesWithTransition:ie,pinnedStartCount:R}}function Fe(B){_=_.filter(j=>j!==B),t.forEach(j=>{let ie=j.computedVisibleIndex,Q=ie>B;zr(ie,a);let Ce="";Q&&(Ce=Ro.minus(Se.columnOffsets.get(ie),Se.columnWidths.get(B)).done()),So(ie,Ce,a)}),wo(B,"hidden",a),p(!0)}function be(B){t.forEach(X=>{let j=X.computedVisibleIndex;B.has(j)?zr(j,a):ei(j,a);let ie=j===I,Q=le===-1?j<F||j>I:j<I||j>=F,Ce="";le===-1?Ce=ie?Se.columnOffsets.get(F):Q?Se.columnOffsets.get(j):Ro.add(Se.columnOffsets.get(j),Se.columnWidths.get(I)).done():Ce=Q?Se.columnOffsets.get(j):ie?Ro.add(Se.columnOffsets.get(F-1),Se.columnWidths.get(F-1)).minus(Se.columnWidths.get(I)).done():Ro.minus(Se.columnOffsets.get(j),Se.columnWidths.get(I)).done(),So(j,Ce,a)})}let De=d.left+T("start"),ge=d.right-T("end"),te=Ls({scrollOffsetStart:De,scrollOffsetEnd:ge});return Re(E),{speedScroller:te,stop(){te.stop()},onMove(B){let X=Re(B);if(h().dropTargetListId==="grouping-toolbar"||f&&!c.containsPoint(X.getCenter()))return f&&je(-1),null;te.scroll({mousePosition:H,get scrollLeft(){return l.getScrollPosition().scrollLeft},set scrollLeft(ee){g.scrollLeft=ee}});let j=S(t,{dragColumn:A,restrictToParentGroup:s==="group"}),ie=le===-1?A.computedOffset+q:A.computedOffset+A.computedWidth+q,Q=(0,Vs.default)(j,ie,({offsetX:ee},Y)=>ee<Y?-1:ee>Y?1:0);Q<0&&(Q=~Q),j.length?Q=j[Q]?j[Q].columnIndex:j[j.length-1].columnIndex+1:(t.length>1&&console.error("No breakpoints available, something is wrong!"),Q=0),Q===I+1&&(Q=I),je(Q);let Ce={};n.forEach(ee=>{Ce[ee.id]="end"});for(let ee=0;ee<R;ee++){let Y=_[ee],ae=t[Y];Ce[ae.id]="start"}let se=_.map(ee=>t[ee].id);return{columnPinning:Ce,columnOrder:se}}}}var Am=U(W.baseZIndexForCells),_m=(o,t)=>{let e=!o||Object.keys(o).length===0,n=!t||Object.keys(t).length===0;return e&&n?!0:!!o!=!!t?!1:tn(o,t)},Mm=()=>({dragSourceListId:null,dropTargetListId:null,dragItemId:"",status:"accepted"});function Hs(o){let{columnId:t,context:e,domRef:n,getHorizontalLayoutPageIndex:i,allowColumnHideOnDrag:r,proxyPosition:a,dragColumnOutside:l}=o,{getState:u,getComputed:s,actions:d,api:c}=e,f=p=>{let h=s().computedVisibleColumnsMap.get(t);if(!h||!h.computedSortable)return;let{multiSortBehavior:g}=u();c.toggleSortingForColumn(t,{multiSortBehavior:g==="replace"&&(p.ctrlKey||p.metaKey)?"append":g})},m=p=>{if(p.target&&To(p.target))return;let h=i(),g=u().domRef,{brain:b,draggableColumnsRestrictTo:C}=u(),{computedVisibleColumns:T,computedVisibleColumnsMap:v,computedPinnedStartColumns:S,computedUnpinnedColumns:D,computedPinnedEndColumns:R}=s(),E=v.get(t);if(!E||!E.computedDraggable){f(p);return}let N=n.current,w=N.getBoundingClientRect(),P=g.current.getBoundingClientRect(),_=b.getAvailableSize(),A=E.computedVisibleIndex,I=b.getVirtualColIndex(E.computedVisibleIndex,{pageIndex:h||0}),M=b.isHorizontalLayoutBrain?b.getPageWidth():null,F=N.style.cursor??"auto",O=!1,z=g.current,k=Me.from(Cs(z).getBoundingClientRect()),H=Ts(z).map(be=>Me.from(be.getBoundingClientRect())),oe=k.getMinimumBoundingRectangle(...H),le=Gs({brain:b,horizontalLayoutPageIndex:h,allowColumnHideOnDrag:r,pageWidth:M,draggableColumnsRestrictTo:C,computedPinnedEndColumns:R,computedPinnedStartColumns:S,computedUnpinnedColumns:D,computedVisibleColumns:T,computedVisibleColumnsMap:v,dragColumnHeaderTargetRect:w,dragColumnId:t,getCurrentDragSourceAndTarget:Mm,api:c,infiniteDOMNode:g.current,setProxyPosition:be=>{a.value=be},setDragColumnOutside:be=>{l.value=be},tableRect:P,acceptDropToReorderRect:oe,initialMousePosition:{clientX:p.clientX,clientY:p.clientY}}),q=null,Re,ye;function Pe(be){let{columnPinning:De,columnOrder:ge}=be;_m(u().columnPinning,De)||(d.columnPinning=De);let te=s().computedColumnOrder;d.columnOrder=Gr({newColumnOrder:ge,visibleColumnOrder:s().computedVisibleColumns.map(B=>B.id),existingColumnOrder:te,dragColumnId:t})}let je=be=>{let{headerBrain:De,brain:ge}=u();if(!O){O=!0;let te=ge.keepColumnRendered(I),B=De.keepColumnRendered(I);if(ge.isHorizontalLayoutBrain){let j=ge.extendRenderRange({start:!0,end:!0,direction:"horizontal"}),ie=De.extendRenderRange({start:!0,end:!0,direction:"horizontal"});ye=()=>{j(),ie()}}Re=()=>{te(),B()},d.columnReorderDragColumnId=E.id,h!=null&&(d.columnReorderInPageIndex=h),Lr(A,`calc( var(${Am}) + 10000 )`,g.current),g.current?.classList.add(Mr),N.style.cursor="grabbing"}q=le.onMove(be)},Fe=be=>{let De=be.pointerId;requestAnimationFrame(async()=>{let{multiSortBehavior:ge}=u(),te=n.current,B=g.current;B?.classList.remove(Mr),le.stop(),b.update({..._}),Re?.(),ye?.(),te.style.cursor=F,te.releasePointerCapture(De),te.removeEventListener("pointermove",je),te.removeEventListener("pointerup",Fe),a.value=null;let X=c.getColumnApi(E.id)?.isSortable()??!1;!O&&X&&c.toggleSortingForColumn(E.id,{multiSortBehavior:ge==="replace"&&(be.ctrlKey||be.metaKey)?"append":ge}),q?Pe(q):O&&r&&c.setVisibilityForColumn(E.id,!1),d.columnReorderDragColumnId=!1,h!=null&&(d.columnReorderInPageIndex=null),await(0,Ks.nextTick)(),T.forEach(j=>{ei(j.computedVisibleIndex,B),wo(j.computedVisibleIndex,"",B),So(j.computedVisibleIndex,"",B)}),Lr(A,Vr(E,{pinnedStartColsCount:S.length,visibleColsCount:T.length}),B)})};N.addEventListener("pointermove",je),N.addEventListener("pointerup",Fe),N.setPointerCapture(p.pointerId)};return{onPointerDown:p=>{s().computedVisibleColumnsMap.get(t)?.computedDraggable?m(p):p.target&&To(p.target)||f(p)}}}var mn=require("vue");var ht={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 Bs=(0,mn.defineComponent)({name:"InfiniteIcon",props:{size:{type:Number,default:void 0},style:{type:Object,default:void 0},className:{type:String,default:void 0},viewBox:{type:String,default:"0 0 24 24"},paths:{type:Array,required:!0}},setup(o){return()=>{let t=o.size??"var(--infinite-icon-size)",e={flex:"none",width:typeof t=="number"?`${t}px`:t,height:typeof t=="number"?`${t}px`:t,fill:"currentColor",...o.style};return(0,mn.h)("svg",{viewBox:o.viewBox,class:o.className,style:e},o.paths.map(n=>(0,mn.h)("path",{d:n})))}}});function Rt(o,t){let e=n=>(0,mn.h)(Bs,{...n,paths:t});return e.displayName=o,e}var Ws=Rt("IncludesOperatorIcon",ht.includesOperator),js=Rt("StartsWithOperatorIcon",ht.startsWithOperator),$s=Rt("EndsWithOperatorIcon",ht.endsWithOperator),Us=Rt("EqualOperatorIcon",ht.eqOperator),qs=Rt("NotEqualOperatorIcon",ht.neqOperator),Ys=Rt("GTOperatorIcon",ht.gtOperator),Zs=Rt("GTEOperatorIcon",ht.gteOperator),Xs=Rt("LTOperatorIcon",ht.ltOperator),Js=Rt("LTEOperatorIcon",ht.lteOperator),Qs=Rt("DoneIcon",ht.done),eu=Rt("ClearIcon",ht.clear),Kr=o=>(0,mn.h)(Bs,{...o,viewBox:"0 -960 960 960",paths:ht.hidden});Kr.displayName="HiddenIcon";var ni="_1eexc2a7 _1eexc2a6",tu=ve({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"]]}),nu=ve({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 ou="_1eexc2a5",oi=ve({defaultClassName:"_1eexc2aa",variantClassNames:{direction:{up:"_1eexc2ab",down:"_1eexc2ac",neutral:"_1eexc2ad"}},defaultVariants:{},compoundVariants:[]}),ii="_1eexc2a8";var xt=require("vue");var iu="qz8ht90 _16lm1iwk";var Wt=(0,xt.defineComponent)({name:"InfiniteCheckBox",props:{disabled:{type:Boolean,default:!1},checked:{type:[Boolean,Object],default:void 0},defaultChecked:{type:[Boolean,Object],default:void 0},onChange:{type:Function,default:void 0},domProps:{type:Object,default:void 0}},setup(o){let t=()=>o.checked!==void 0,e=t()?o.checked:o.defaultChecked,n=(0,xt.ref)(e===void 0?!1:e),i=(0,xt.ref)(null),r=()=>{i.value&&(i.value.indeterminate=n.value==null)};(0,xt.onMounted)(r),(0,xt.watch)(()=>o.checked,l=>{t()&&(n.value=l===void 0?!1:l,r())});let a=()=>{if(o.disabled)return;let l=!n.value;t()||(n.value=l,r()),o.onChange?.(l)};return()=>{let l=o.domProps||{};return(0,xt.h)("input",{...l,class:ne("InfiniteCheckBox",iu,l.class),type:"checkbox",ref:i,checked:!!n.value,disabled:o.disabled,onChange:a})}}});var hn=require("vue");function ru(o){let t={};return Object.keys(o).forEach(e=>{t[e]=e}),t}var au=ru({"data-name":""}),Hr={[au["data-name"]]:"menu-icon"},lu=`[${au["data-name"]}="${Hr["data-name"]}"]`;var Em={width:"100%",pointerEvents:"none"},Br=`${mt}-menu`,xo=(0,hn.defineComponent)({name:"MenuIcon",props:{lineWidth:{type:Number,required:!1},lineStyle:{type:Object,required:!1},style:{type:Object,required:!1},className:{type:String,required:!1},domProps:{type:Object,required:!1},reserveSpaceWhenHidden:{type:Boolean,required:!1},menuVisible:{type:Boolean,required:!1}},setup(o,{slots:t}){return()=>{let e={...Em,borderTop:`${xe.components.HeaderCell.menuIconLineWidth} solid currentColor`,...o.lineStyle},n=t.default?t.default():[(0,hn.h)("div",{class:Br,style:e}),(0,hn.h)("div",{class:Br,style:e}),(0,hn.h)("div",{class:Br,style:e})];return(0,hn.h)("div",{...o.domProps,style:o.style,...Hr,onPointerdown:i=>{i.stopPropagation(),o.domProps?.onPointerdown?.(i)},class:ne(o.className,Ul({menuVisible:o.menuVisible,reserveSpaceWhenHidden:o.reserveSpaceWhenHidden}),mt,`${mt}-menu`)},n)}}});var lt=require("vue");var su="_1b8djff0 _16lm1iw1p _16lm1iw2f _16lm1iw1 _16lm1iw32";var uu={transition:"width 0.25s, opacity 0.25s"},du=Object.keys({direction:1,size:1,lineWidth:1,lineStyle:1,style:1,className:1,index:1,forceSize:1});var cu=(0,lt.defineComponent)(o=>{let t=(0,lt.ref)(!0),e=(0,lt.ref)(0),n=null;(0,lt.watch)(()=>o.direction,r=>{let a=r!=0?1:0;!t.value&&a&&(t.value=!0),a!==e.value&&(n!=null&&cancelAnimationFrame(n),n=requestAnimationFrame(()=>{n=null,e.value=a}))},{immediate:!0}),(0,lt.onBeforeUnmount)(()=>{n!=null&&cancelAnimationFrame(n)});let i=()=>{let a=!(e.value===0&&o.direction===0);a!==t.value&&(t.value=a)};return()=>{let{direction:r,lineWidth:a=1,className:l,index:u}=o;if(!t.value&&!o.forceSize)return null;let s=u!=null&&u>0,d=o.size??16,c=Math.floor(d/4),f=r?[d-3*c,d-2*c,d-c]:[0,0,0];r===-1&&f.reverse();let m={...uu,borderTop:`${a}px solid currentColor`,...o.lineStyle,opacity:e.value},p={};return r===-1&&(p.top="100%"),(0,lt.h)("div",{"data-name":"sort-icon",style:{...o.style,width:`${d}px`},class:ne(l,mt,su,`${mt}-sort`)},[s?(0,lt.h)("div",{"data-name":"index",style:p,class:Zl},`${u}`):null,(0,lt.h)("div",{style:{width:`${f[0]}px`,...m},onTransitionend:i}),(0,lt.h)("div",{style:{width:`${f[1]}px`,...m}}),(0,lt.h)("div",{style:{width:`${f[2]}px`,...m}})])}},{name:"SortIcon",props:[...du]});var{rootClassName:fu}=Be,Ot=`${fu}Cell`,ri=`${fu}Cell_content`;function pu(o){let{context:t,column:e,diff:n,shareSpaceOnResize:i}=o,r=t.getState(),{columnSizing:a,viewportReservedWidth:l,bodySize:u}=r,s=t.getComputed().computedVisibleColumns,d=!1,c=s.reduce((m,p)=>(p.computedFlex&&(m[p.id]={...a[p.id],flex:p.computedWidth},d=!0),m),{}),f=d?{...a,...c}:a;return xr({shareSpaceOnResize:i,availableSize:u.width,reservedWidth:l||0,dragHandleOffset:n,dragHandlePositionAfter:e.computedVisibleIndex,columnSizing:f,items:s.map(m=>({id:m.id,computedFlex:m.computedFlex,computedWidth:m.computedWidth,computedMinWidth:m.computedMinWidth,computedMaxWidth:m.computedMaxWidth}))})}var gn=require("vue");function mu(o,{columns:t,shareSpaceOnResize:e,domRef:n}){let i=t[o];return{resize(r){Se.columnWidths.set(o,i.computedWidth+r,n.current);let a=o+1;if(e){let l=t[a];if(!l)return;Se.columnWidths.set(a,l.computedWidth-r,n.current),l.computedPinned==="start"?kr(l,r,n.current):Se.columnOffsets.set(a,l.computedOffset+r,n.current);return}if(i.computedPinned!=="end"){if(i.computedPinned==="start"){for(let l=a,u=t.length;l<u;l++){let s=t[l];if(s.computedPinned==="start"){kr(s,r,n.current);continue}s.computedPinned!=="end"&&Se.columnOffsets.set(l,s.computedOffset+r,n.current)}return}for(let l=a,u=t.length;l<u;l++){let s=t[l];s.computedPinned||Se.columnOffsets.set(l,s.computedOffset+r,n.current)}}}}}function hu(o,t){let e=o[o.length-1];return{resize(n){let{columns:i,domRef:r}=t,a=i[o[0]],l=a.computedOffset,u=0,s=r.current;if(n.forEach((d,c)=>{u+=d;let f=o[c],m=i[f],p=m.computedWidth+d;Se.columnWidths.set(f,p,s),m.computedPinned!=="end"&&(l&&Se.columnOffsets.set(f,l,s),l+=p)}),a.computedPinned!=="end")for(let d=e+1;d<i.length;d++){let c=i[d];c.computedPinned!=="end"&&Se.columnOffsets.set(d,c.computedOffset+u,s)}}}}var ai="zneyzh0 _16lm1iw2 _16lm1iw23 _16lm1iw2c _16lm1iw2a _16lm1iwm _16lm1iw35",li=ve({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"]]}),si=ve({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 gu=require("vue"),Ln=Symbol("InfiniteTable");function $e(){return(0,gu.inject)(Ln)}var{rootClassName:Fm}=Be,Nm=`${Fm}HeaderCell_ResizeHandle`,yu=(0,gn.defineComponent)({name:"ResizeHandle",props:{horizontalLayoutPageIndex:{type:Number,default:null},columnIndex:{type:Number,required:!0},columns:{type:Array,required:!0},computeResize:{type:Function,required:!0},onResize:{type:Function,required:!0}},setup(o){let t=$e(),{getState:e}=t,n={current:null},i=(0,gn.ref)(!1),r=a=>{a.stopPropagation();let l=o.columns[o.columnIndex];if(!l)return;let u=l.computedPinned,s=o.horizontalLayoutPageIndex,{brain:d,headerBrain:c}=e(),f=!!a.shiftKey,m=a.pointerId,p=a.clientX,h=a.target,g=()=>{};if(d.isHorizontalLayoutBrain){let S=d.extendRenderRange({start:!0,end:!0,direction:"horizontal"}),D=c.extendRenderRange({start:!0,end:!0,direction:"horizontal"});g=()=>{S(),D()}}h.setPointerCapture(m);let b=mu(o.columnIndex,{columns:o.columns,shareSpaceOnResize:f,domRef:n}),C=(S,{done:D}={})=>{s&&(S=S/(s+1),D&&(S=Math.round(S))),u==="end"&&(S*=-1);let{adjustedDiff:R,constrained:E}=o.computeResize({diff:S,shareSpaceOnResize:f});return i.value!==E&&(i.value=E),b.resize(R),R},T=S=>{C(Math.round(S.clientX-p))},v=S=>{h.releasePointerCapture(m),h.removeEventListener("pointermove",T),h.removeEventListener("pointerup",v);let D=Math.round(S.clientX-p),R=C(D,{done:!0});g(),o.onResize({diff:R,shareSpaceOnResize:f})};h.addEventListener("pointermove",T),h.addEventListener("pointerup",v)};return()=>{let a=o.columns[o.columnIndex];if(!a)return null;let l=a.computedPinned,u=a.computedFirstInCategory,s=a.computedLastInCategory,d=(l===!1||l==="start")&&s?{right:l==="start"?void 0:0}:l==="end"&&u?{right:void 0}:void 0;return(0,gn.h)("div",{ref:c=>{n.current=c??null},class:`${Nm} ${ai} ${si({computedPinned:l,computedFirstInCategory:u,computedLastInCategory:s})}`,onPointerdown:r},[(0,gn.h)("div",{style:d,class:li({constrained:i.value,computedPinned:l,computedFirstInCategory:u,computedLastInCategory:s})})])}}});var Om=U(W.columnWidthAtIndex),km=U(W.columnReorderEffectDurationAtIndex),Lm=U(W.columnZIndexAtIndex),zm=U(W.columnVisibilityAtIndex),bu=Symbol("InfiniteHeaderCell");function Po(){return(0,fe.inject)(bu)}var Vm=o=>{let{allRowsSelected:t,someRowsSelected:e,api:n,dataSourceApi:i}=o,r=t?!0:e?null:!1,{components:a,isTree:l}=n.getState(),u=a?.CheckBox||Wt;return(0,fe.h)(u,{domProps:{class:ii},onChange:s=>{if(l){s?i.treeApi.selectAll():i.treeApi.deselectAll();return}s?n.rowSelectionApi.selectAll():n.rowSelectionApi.deselectAll()},checked:r})};function yn(o,t){return o(t)}var Wr=()=>(0,fe.h)("div",{class:vl[1]}),Cu=(0,fe.defineComponent)({name:"InfiniteTableHeaderCell",props:{column:{type:Object,required:!0},columnsMap:{type:Object,required:!0},width:{type:Number,required:!0},height:{type:Number,required:!0},headerOptions:{type:Object,required:!0},horizontalLayoutPageIndex:{type:Number,default:null},domRef:{type:Function,required:!0},allRowsSelected:{type:Boolean,required:!0},someRowsSelected:{type:Boolean,required:!0},selectionMode:{type:[String,Boolean],required:!0}},setup(o){let t=$e(),{api:e,actions:n,getState:i,getComputed:r,dataSourceContext:a}=t,{getDataSourceState:l,dataSourceApi:u,dataSourceActions:s}=a,d={current:null},c=w=>{let P=w&&w.$el!==void 0?w.$el:w;d.current=P??null,o.domRef(d.current)},f=(0,fe.shallowRef)(null);(0,fe.provide)(bu,f);let m=()=>at(o.column,{actions:n,api:e,dataSourceActions:s,dataSourceApi:u,getComputed:r,getDataSourceState:l,getDataSourceMasterContext:()=>l().getDataSourceMasterContextRef?.current?.()??void 0,getState:i}),p=null,h=()=>{let w=o.column.id,P=l().filterDelay,_=`${w}:${P}`;if(!p||p.key!==_){let A=I=>{e.setColumnFilter(w,I)};p={key:_,fn:P>0?Jt(A,{wait:P}):A}}return p.fn},g=(0,fe.ref)(null),b=(0,fe.ref)(!1),{onPointerDown:C}=Hs({columnId:o.column.id,context:{getState:i,getComputed:r,actions:n,api:e},domRef:d,getHorizontalLayoutPageIndex:()=>o.horizontalLayoutPageIndex,allowColumnHideOnDrag:!0,proxyPosition:g,dragColumnOutside:b}),T=(0,fe.computed)(()=>t.state.value.columnMenuVisibleForColumnId),v=(0,fe.computed)(()=>t.state.value.columnReorderDragColumnId),S=(0,fe.computed)(()=>t.state.value.columnReorderInPageIndex),D=(0,fe.computed)(()=>t.state.value.showColumnFilters),R=(0,fe.computed)(()=>t.state.value.columnHeaderHeight),E=(0,fe.computed)(()=>t.state.value.components),N=(0,fe.computed)(()=>a.state.value.filterTypes);return()=>{let{column:w,columnsMap:P,horizontalLayoutPageIndex:_,headerOptions:A}=o,{allRowsSelected:I,someRowsSelected:M,selectionMode:F}=o,O=w.computedSortInfo,z=w.header,k=m(),H=k.isSortable(),oe=A.alwaysReserveSpaceForSortIcon,le=w.headerAlign??w.align,q=(typeof le=="function"?le({isHeader:!0,column:w}):le)??"start",Re=(typeof w.verticalAlign=="function"?w.verticalAlign({isHeader:!0,column:w}):w.verticalAlign)??"center",ye=H&&(w.computedSorted||oe)?(0,fe.h)(cu,{index:w.computedMultiSort?w.computedSortIndex+1:void 0,style:{marginInlineStart:xe.spacing[2],marginInlineEnd:xe.spacing[2]},className:`${pn}__sort-icon ${Yl} ${Xl({align:q})}`,direction:w.computedSorted?w.computedSortedAsc?1:-1:0}):null,je=w.computedFilterable&&w.computedFiltered?(0,fe.h)(An):null,Fe=w.headerCssEllipsis??w.cssEllipsis??!0,be=T.value,De=v.value,ge=S.value,te=De===w.id,B=ge!=null?_!==ge:!1,X={reserveSpaceWhenHidden:q==="center",menuVisible:be===w.id,style:q==="end"?{marginInlineStart:`calc(${xe.components.HeaderCell.resizeHandleActiveAreaWidth} / 2)`,marginInlineEnd:xe.spacing[2]}:{marginInlineEnd:`calc(${xe.components.HeaderCell.resizeHandleActiveAreaWidth} / 2)`,marginInlineStart:xe.spacing[2]},domProps:{onMousedown:de=>{de.stopPropagation(),k.toggleContextMenu(de.target)}}},j=w.components?.MenuIcon||E.value?.MenuIcon||xo,ie=(0,fe.h)(j,X),Q=D.value,Ce=N.value,se=w.computedFilterType,ee=Ce[se],Y=w.computedFilterable?w.computedFilterValue?.filter.operator??ee?.defaultOperator:void 0,ae=w.computedFilterable&&ee?ee.operators.find(de=>de.name===Y):void 0,ce=ae?.components?.FilterEditor||ee?.components?.FilterEditor||w.components?.FilterEditor||zn,Ne=ee?.components?.FilterOperatorSwitch||w.components?.FilterOperatorSwitch||Su,ze=w.computedFilterable?(0,fe.h)(Tu,{filterProps:{horizontalLayoutPageIndex:_,filterEditor:ce,filterOperatorSwitch:Ne,operator:ae,filterTypes:Ce,onChange:h(),columnFilterType:se,columnLabel:w.field||w.name||w.id,columnFilterValue:w.computedFilterValue,columnHeaderHeight:R.value}}):(0,fe.h)(wu),qe={horizontalLayoutPageIndex:_,dragging:te,domRef:c,htmlElementRef:d,renderLocation:"column-header",column:w,columnsMap:P,columnSortInfo:O,columnFilterValue:w.computedFilterValue,filtered:w.computedFiltered,someRowsSelected:M,allRowsSelected:I,selectionMode:F,api:e,dataSourceApi:u,columnApi:k,renderBag:{sortIcon:ye,filterIcon:je,menuIcon:ie,menuIconProps:X,selectionCheckBox:null,header:w.header&&typeof w.header!="function"?w.header:w.name}},Ze=qe;Ze.renderBag.filterEditor=ze,f.value=Ze;let ue={...qe,renderBag:{...qe.renderBag}};if(w.renderSortIcon&&(ue.renderBag.sortIcon=yn(w.renderSortIcon,{...ue,renderBag:{...ue.renderBag}})),w.renderFilterIcon&&(ue.renderBag.filterIcon=yn(w.renderFilterIcon,{...ue,renderBag:{...ue.renderBag}})),typeof w.renderMenuIcon=="function"){let de=yn(w.renderMenuIcon,{...ue,renderBag:{...ue.renderBag}});ue.renderBag.menuIcon=de?de.type===j||de.type===xo?de:(0,fe.h)(j,X,()=>de):null}if(w.renderSelectionCheckBox&&F==="multi-row"){ue.renderBag.selectionCheckBox=yn(Vm,{...ue,renderBag:{...ue.renderBag}});let de=w.renderHeaderSelectionCheckBox??w.renderSelectionCheckBox;de&&de!==!0&&(ue.renderBag.selectionCheckBox=yn(de,{...ue,renderBag:{...ue.renderBag}}))}z instanceof Function&&(ue.renderBag.header=yn(z,{...ue,renderBag:{...ue.renderBag}}));let pt=Fe?(0,fe.h)("div",{class:It},[ue.renderBag.header]):ue.renderBag.header,bt=w.renderMenuIcon===!1?null:ue.renderBag.menuIcon,St=[q==="center"?Wr():null,ue.renderBag.selectionCheckBox,pt,ue.renderBag.sortIcon,ue.renderBag.filterIcon,q==="center"?Wr():null,q!=="center"?Wr():null,bt],wt=w.renderHeader?yn(w.renderHeader,{...ue,renderBag:{...ue.renderBag,all:St}}):St,K={height:`${o.height}px`};w.headerStyle&&(K=typeof w.headerStyle=="function"?{...K,...w.headerStyle(Ze)||{}}:{...K,...w.headerStyle});let y=typeof w.headerClassName=="function"?w.headerClassName(Ze):w.headerClassName,x=`var(${Lm}-${w.computedVisibleIndex})`;K.zIndex=x,K.visibility=`var(${zm}-${w.computedVisibleIndex}, visible)`,K.width=`var(${Om}-${w.computedVisibleIndex})`,K.transition=`transform var(${km}-${w.computedVisibleIndex}, 0s)`;let G={filtered:w.computedFiltered,verticalAlign:Re,align:q},V={"data-field":`${w.field||""}`,"data-column-id":w.id,"data-header-align":q,"data-name":"HeaderCell","data-sort":w.computedSortedAsc?"asc":w.computedSortedDesc?"desc":"none","data-sort-index":`${w.computedSortIndex??-1}`},L=ne(pn,_l.none,H?wl.pointer:"",y,Qo(w,[pn,Ot],Gl,{dragging:te,insideDisabledDraggingPage:B,align:q,verticalAlign:Re,rowSelected:!1,cellSelected:!1,rowDisabled:!1,zebra:!1,rowActive:!1,firstRow:!0,firstRowInHorizontalLayoutPage:!0,treeNode:!1,groupCell:!1,groupRow:!1,rowExpanded:!1}),kl,Ot,ni),J=(0,fe.h)("div",{class:ne(ri,Fe?It:Uo.hidden,Ll(G),Rl[q]),style:Q?{height:`${o.height/2}px`}:void 0},[wt]),re=de=>pu({context:{getState:i,getComputed:r},column:w,diff:de.diff,shareSpaceOnResize:de.shareSpaceOnResize}),pe=w.computedResizable?(0,fe.h)(yu,{horizontalLayoutPageIndex:_,columns:r().computedVisibleColumns,columnIndex:w.computedVisibleIndex,computeResize:re,onResize:de=>{let{columnSizing:Zt,reservedWidth:Ht}=re(de);de.shareSpaceOnResize||(n.viewportReservedWidth=Ht),n.columnSizing=Zt}}):null,he=[Q?ze:null,pe],Te={ref:c,...V,"data-z-index":x,style:K,class:L,onPointerdown:C},we=null,_e=i().portalDOMRef.current;te&&g.value&&_e&&(we=(0,fe.h)(fe.Teleport,{to:_e},[(0,fe.h)("div",{key:w.id,class:`${pn}Proxy ${zl}`,style:{height:`${o.height}px`,width:`${o.width}px`,left:`${g.value.left??0}px`,top:`${g.value.top??0}px`}},[(0,fe.h)("div",{class:Vl({visible:b.value})},[(0,fe.h)(Kr,{size:16})]),ue.renderBag.header])]));let Oe=w.components?.HeaderCell;return Oe?[(0,fe.h)(Oe,Te,{default:()=>[J,he]}),we]:[(0,fe.h)("div",Te,[J,he]),we]}}});var vu=Symbol("InfiniteColumnHeaderFilter"),ui=o=>o.stopPropagation(),Tu=(0,Ie.defineComponent)({name:"InfiniteTableColumnHeaderFilter",props:{filterProps:{type:Object,required:!0}},setup(o){let t=$e(),e=Po(),n=(0,Ie.shallowRef)(o.filterProps);(0,Ie.provide)(vu,n);let i=(0,Ie.ref)(!1),r=()=>{i.value=!0},a=()=>{i.value=!1};return()=>{n.value=o.filterProps;let l=e.value.column,s=t.state.value.filterOperatorMenuVisibleForColumnId===l.id||i.value,d=o.filterProps.filterEditor,c=o.filterProps.filterOperatorSwitch;return(0,Ie.h)("div",{onPointerup:ui,onPointerdown:ui,onFocusin:r,onFocusout:a,class:`${Jo} ${Ir({active:s})}`,style:{height:`${o.filterProps.columnHeaderHeight}px`}},[(0,Ie.h)(c),(0,Ie.h)(d)])}}}),Su=(0,Ie.defineComponent)({name:"InfiniteTableFilterOperatorSwitch",setup(){let o=Vn();return()=>{let t=o.disabled.value,n=o.operator.value?.components?.Icon??An;return(0,Ie.h)("div",{"data-name":"filter-operator","data-disabled":t,onMousedown:i=>{i.stopPropagation(),!t&&o.columnApi.toggleFilterOperatorMenu(i.target)},class:ne(_r,Wl,t?`${_r}--disabled`:"")},[(0,Ie.h)(n,{size:20,className:`${jl({disabled:!!t})}`})])}}}),wu=(0,Ie.defineComponent)({name:"InfiniteTableColumnHeaderFilterEmpty",setup(){return()=>(0,Ie.h)("div",{onPointerup:ui,onPointerdown:ui,class:`${Jo} ${Ir({active:!1})} ${Il["50%"]}`})}});function Vn(){let o=$e(),t=Po(),e=(0,Ie.inject)(vu),{api:n,getComputed:i,getState:r,actions:a,dataSourceContext:l}=o,{getDataSourceState:u,dataSourceApi:s,dataSourceActions:d}=l,c=(0,Ie.computed)(()=>t.value.column),f=(0,Ie.computed)(()=>{let{columnFilterType:T,filterTypes:v}=e.value;return v[T]}),m=(0,Ie.ref)(e.value.columnFilterValue?.filter.value??"");(0,Ie.watch)(()=>e.value.columnFilterValue?.filter.value,T=>{if(e.value.columnFilterValue)m.value!==T&&(m.value=T);else{let v=f.value;if(v){let S=[...v.emptyValues][0];S!==m.value&&(m.value=S)}}});let p=T=>{m.value=T,e.value.onChange(T)},h=()=>{n.clearColumnFilter(c.value.id)},g=()=>{n.removeColumnFilter(c.value.id)},b={api:n,getState:r,getComputed:i,getDataSourceState:u,actions:a,dataSourceActions:d,dataSourceApi:s},C=(0,Ie.computed)(()=>`Filter for ${Co(c.value,b,"column-filter")}`);return{api:n,column:c,columnFilterValue:(0,Ie.computed)(()=>e.value.columnFilterValue),columnApi:t.value.columnApi,operator:(0,Ie.computed)(()=>e.value.operator),operatorName:(0,Ie.computed)(()=>e.value.operator?.name),value:m,disabled:(0,Ie.computed)(()=>e.value.columnFilterValue?.disabled),filterType:f,filterTypes:(0,Ie.computed)(()=>e.value.filterTypes),filterTypeKey:(0,Ie.computed)(()=>e.value.columnFilterType),filtered:(0,Ie.computed)(()=>c.value.computedFiltered),setValue:p,clearValue:h,removeColumnFilter:g,ariaLabel:C,className:`${Hl} ${ds}`}}var zn=(0,Gn.defineComponent)({name:"StringFilterEditor",setup(){let o=Vn();return()=>(0,Gn.h)("input",{"aria-label":o.ariaLabel.value,type:"text",disabled:o.disabled.value,value:o.value.value??"",onInput:t=>{o.setValue(t.target.value)},class:o.className})}}),di=(0,Gn.defineComponent)({name:"NumberFilterEditor",setup(){let o=Vn();return()=>(0,Gn.h)("input",{"aria-label":o.ariaLabel.value,type:"number",disabled:o.disabled.value,value:o.value.value??"",onInput:t=>{let e=t.target,n=isNaN(e.valueAsNumber)?e.value:e.valueAsNumber;o.setValue(n)},class:o.className})}});var kt=(o,t)=>{let e=o?.[t];return e?{components:{Icon:e}}:{}};function Iu(o={}){let{StringFilterEditor:t,NumberFilterEditor:e,icons:n}=o;return{string:{label:"Text",emptyValues:[""],defaultOperator:"includes",components:t?{FilterEditor:t}:void 0,operators:[{name:"includes",...kt(n,"includes"),label:"Includes",fn:({currentValue:i,filterValue:r})=>typeof i=="string"&&typeof r=="string"&&i.toLowerCase().includes(r.toLowerCase())},{label:"Equals",...kt(n,"eq"),name:"eq",fn:({currentValue:i,filterValue:r})=>typeof i=="string"&&i===r},{name:"startsWith",...kt(n,"startsWith"),label:"Starts With",fn:({currentValue:i,filterValue:r})=>i.startsWith(r)},{name:"endsWith",...kt(n,"endsWith"),label:"Ends With",fn:({currentValue:i,filterValue:r})=>i.endsWith(r)}]},number:{label:"Number",emptyValues:["",null,void 0],defaultOperator:"eq",components:e?{FilterEditor:e}:void 0,operators:[{label:"Equals",...kt(n,"eq"),name:"eq",fn:({currentValue:i,filterValue:r})=>i==r},{label:"Not Equals",...kt(n,"neq"),name:"neq",fn:({currentValue:i,filterValue:r})=>i!=r},{name:"gt",label:"Greater Than",...kt(n,"gt"),fn:({currentValue:i,filterValue:r,emptyValues:a})=>a.includes(i)?!0:i>r},{name:"gte",...kt(n,"gte"),label:"Greater Than or Equal",fn:({currentValue:i,filterValue:r,emptyValues:a})=>a.includes(i)?!0:i>=r},{name:"lt",...kt(n,"lt"),label:"Less Than",fn:({currentValue:i,filterValue:r,emptyValues:a})=>a.includes(i)?!0:i<r},{name:"lte",...kt(n,"lte"),label:"Less Than or Equal",fn:({currentValue:i,filterValue:r,emptyValues:a})=>a.includes(i)?!0:i<=r}]}}}var Mn=Iu({StringFilterEditor:zn,NumberFilterEditor:di,icons:{includes:Ws,eq:Us,neq:qs,startsWith:js,endsWith:$s,gt:Ys,gte:Zs,lt:Xs,lte:Js}});var ci=class{constructor(t){let e=t instanceof Object.getPrototypeOf(this).constructor?t.getState():t,n=this.getPositiveFromState(e),i=this.getNegativeFromState(e);this.update({negativeItems:i,positiveItems:n})}getInitialState(){return this.initialState}destroy(){this.positiveMap?.clear(),this.negativeMap?.clear(),delete this.positiveMap,delete this.negativeMap}update(t){let{positiveItems:e,negativeItems:n}=t;if(this.allNegative=n===!0,this.allPositive=e===!0,this.allNegative&&this.allPositive)throw"Cannot have both negativeItems and positiveItems be true!";n!==!0&&(this.negativeMap?(this.negativeMap.clear(),this.negativeMap.fill(n.map(i=>[i,!0]))):this.negativeMap=new $(n.map(i=>[i,!0])),this.positiveMap&&this.positiveMap.clear()),e!==!0&&(this.positiveMap?(this.positiveMap.clear(),this.positiveMap.fill(e.map(i=>[i,!0]))):this.positiveMap=new $(e.map(i=>[i,!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(t){if(this.allPositive===!0){if(this.allNegative===!0)throw'Cannot have both positiveItems and negativeItems be "true"';return!this.negativeMap?.has(t)}return this.positiveMap?.has(t)}isItemNegative(t){return!this.isItemPositive(t)}setItemValue(t,e){if(e!==this.isItemPositive(t)){if(e){if(this.allNegative===!0){if(!this.positiveMap)throw`No positiveMap found when trying to set item ${t.join(",")} be positive`;this.positiveMap.set(t,!0)}else if(this.allPositive===!0){if(!this.negativeMap)throw`No negativeMap found when trying to set item ${t.join(",")} be positive`;this.negativeMap.delete(t)}}else if(this.allPositive===!0){if(!this.negativeMap)throw`No negativeMap found when trying to set item ${t.join(",")} be negative`;this.negativeMap.set(t,!0)}else if(this.allNegative===!0){if(!this.positiveMap)throw`No positiveMap found when trying to set item ${t.join(",")} be negative`;this.positiveMap?.delete(t)}}}makeItemNegative(t){this.setItemValue(t,!1)}makeItemPositive(t){this.setItemValue(t,!0)}toggleItem(t){this.setItemValue(t,!this.isItemPositive(t))}};var Ct=class extends ci{constructor(t){super(t)}getState(){return{expandedRows:this.allPositive?!0:this.positiveMap?.topDownKeys()??[],collapsedRows:this.allNegative?!0:this.negativeMap?.topDownKeys()??[]}}getPositiveFromState(t){return t.expandedRows}getNegativeFromState(t){return t.collapsedRows}areAllCollapsed(){return this.areAllNegative()}areAllExpanded(){return this.areAllPositive()}collapseAll(){this.makeAllNegative()}expandAll(){this.makeAllPositive()}isGroupRowExpanded(t){return this.isItemPositive(t)}isGroupRowCollapsed(t){return!this.isGroupRowExpanded(t)}setGroupRowExpanded(t,e){return this.setItemValue(t,e)}collapseGroupRow(t){this.setGroupRowExpanded(t,!1)}expandGroupRow(t){this.setGroupRowExpanded(t,!0)}toggleGroupRow(t){this.toggleItem(t)}};var fi=class{constructor(){this.primaryKeyToData=new Map;this.nodePathsToData=new $;this.removeNodePath=(t,e)=>{if(this.nodePathsToData.delete(t),this.remove(t[t.length-1]),!e)return;let n=this.nodePathsToData.get(t);if(n){let i=e.getNodeChildren?e.getNodeChildren(n):e.nodesKey?n[e.nodesKey]:null;if(i&&Array.isArray(i))for(let r=0,a=i.length;r<a;r++){let l=i[r],u=[...t,e.toPrimaryKey(l)];this.removeNodePath(u,e)}}};this.remove=t=>{this.primaryKeyToData.delete(t)};this.add=(t,e)=>{this.primaryKeyToData.set(t,e)};this.addNodePath=(t,e,n)=>{if(this.nodePathsToData.set(t,e),this.add(t[t.length-1],e),!n)return;let i=n.getNodeChildren?n.getNodeChildren(e):n.nodesKey?e[n.nodesKey]:null;if(i&&Array.isArray(i))for(let r=0,a=i.length;r<a;r++){let l=i[r],u=[...t,n.toPrimaryKey(l)];this.addNodePath(u,l,n)}};this.clear=()=>{this.primaryKeyToData.clear(),this.nodePathsToData.clear()};this.getDataForPrimaryKey=t=>this.primaryKeyToData.get(t);this.getDataForNodePath=t=>this.nodePathsToData.get(t);this.indexArray=(t,e)=>{let{cache:n,toPrimaryKey:i,getNodeChildren:r,isLeafNode:a,nodesKey:l}=e,u=!!r&&!!a;n&&n.shouldResetDataSource()&&(this.clear(),t=[]);let s=n&&!n.isEmpty();if(s&&(t=t.concat()),!t.length&&n){if(!n.isEmpty()){let d=[...n.getMutationsArray(),...n.getTreeMutationsArray()];for(let c=0,f=d.length;c<f;c++){let m=d[c];if(m.type==="insert"){let p=i(m.data);u?this.addNodePath([p],m.data,e):this.add(p,m.data),t.push(m.data)}}n?.removeInfo(void 0)}}else{let d=(c,f)=>{for(let m=0;m<c.length;m++){let p=c[m];s&&u&&Array.isArray(p[l])&&(p=c[m]={...p});let h=!1;if(p!=null){let g=i(p),b=u?[...f,g]:void 0,C=u&&!!b,T=C?n?.getMutationsForNodePath(b):n?.getMutationsForPrimaryKey(g);if(T&&T.length){for(let v=0,S=T.length;v<S;v++){let D=T[v];if(D.type==="delete"&&!h&&(C?this.removeNodePath(b,e):this.remove(g),h=!0,c.splice(m,1),m--),D.type==="update"&&!h&&(p={...p,...D.data},c[m]=p),D.type==="update-children"&&!h){let R=D.children(p[l],p);p={...p},R!==void 0?p[l]=R:delete p[l],c[m]=p}D.type==="insert"&&(D.position==="before"?(c.splice(m,0,D.data),m--):c.splice(m+1,0,D.data))}C?n?.removeNodePathInfo(b):n?.removeInfo(g)}if(!h)if(C){this.addNodePath(b,p);let v=a(p),S=v?null:r(p);!v&&Array.isArray(S)&&(f.push(g),s&&(p[l]=S=S.concat()),d(S,f),f.pop())}else this.add(g,p)}}};d(t,[])}return t}}};function jr(o){return o.map(Lt)}function Lt(o){if(Ve().structuredClone)return Ve().structuredClone(o);if(o===null||typeof o!="object")return o;if(Array.isArray(o))return jr(o);if(o instanceof Date)return new Date(o);if(o instanceof Set)return new Set(jr(Array.from(o)));if(o instanceof Map)return new Map(jr(Array.from(o)));let t={};for(let e in o)o.hasOwnProperty(e)&&(t[e]=Lt(o[e]));return t}var bn=Object.seal({data:null,field:null});var Kn="____root____",xu="____not_loaded_yet____";function rn(){return!1}function $r(o){if(!o||!Object.keys(o).length)return{};let t={};for(let e in o)if(o.hasOwnProperty(e)){let n=o[e].initialValue;t[e]=typeof n=="function"?n():n}return t}function pi(o,t,e,n,i){if(!(!e||!Object.keys(e).length)){for(let r in e)if(e.hasOwnProperty(r)){let a=e[r];if(typeof a.reducer!="function")continue;let l=n[r],u=a.getter?a.getter(o)??null:a.field?o[a.field]:null;n[r]=a.reducer(l,u,o,t,i)}}}function Pu(o,t){let{marker:e,reducers:n={},pivot:i,groupBy:r,indexer:a,toPrimaryKey:l,cache:u,mappings:s}=o;e&&e.start();let d=new $;function c(b,C,T,v=0,S=[]){let D=!T.length||v===T.length-1,R=C[s?.values||"values"]||{};for(let E in R)if(R.hasOwnProperty(E)){let N=E;S.push(N),f.set(S,!0),b.set(S,{reducerResults:R[E][s?.totals||"totals"]||{},items:[]}),D||c(b,R[E],T,v+1,S),S.pop()}}let f=i?new $:void 0,m=[],p=$r(n),h=Lt(p);t.visitDepthFirst((b,C,T,v)=>{let[S,...D]=C,R=b.children,E=d.get(D);if(E&&(E.cache=b.cache,E.childrenLoading=b.childrenLoading,E.childrenAvailable=b.childrenAvailable,E.error=b.error),D.length==r.length&&r.length){if(E){E.items=R;for(let w=0,P=D.length;w<P;w++){let _=D.slice(0,w),A=d.get(_);A&&(A.items=A.items||[],A.items=A.items.concat(R))}R=a.indexArray(R,{toPrimaryKey:l,cache:u,nodesKey:void 0})}return v?.()}for(let N=0,w=R.length;N<w;N++){if(!R[N]){let I={items:[],reducerResults:{},cache:!1,childrenLoading:!1,childrenAvailable:!1,isTree:!1,isGroupBy:!0};d.set([...D,`${xu}${N}`],I);continue}let P=R[N].data,_=R[N].keys||[];if(_.length){let I=_[_.length-1];D.push(I)}let A={items:[],cache:!1,childrenLoading:!1,childrenAvailable:!1,commonData:P,totalChildrenCount:R[N].totalChildrenCount,reducerResults:R[N].aggregations||{},isTree:!1,isGroupBy:!0};if(d.set(D,A),i){let I=A.pivotDeepMap=new $,M=R[N].pivot;c(I,M,i,0,m)}_.length&&D.pop()}v?.()});let g={deepMap:d,groupParams:o,initialData:t,reducerResults:h};return i&&(g.topLevelPivotColumns=f,g.pivot=i),e&&e.end({details:[{name:"Group by fields",value:r.map(b=>b.field).join(", ")}]}),g}function Ru(o,t,e,n,i,r,a,l,u,s=go){let{items:d,reducerResults:c,pivotDeepMap:f}=o.get(t);if(d.push(n),a&&pi(n,i,a,c,t),r){for(let m=0,p=r.length;m<p;m++){let{field:h,valueGetter:g,toKey:b}=r[m],C=h?n[h]:null;g&&(bn.data=n,bn.field=h,C=g(bn));let T=(b||s)(C,n);e.push(T),f.has(e)||(l.set(e,!0),f?.set(e,{reducerResults:Lt(u),items:[]}));let{reducerResults:v,items:S}=f.get(e);S.push(n),a&&pi(n,i,a,v,t)}e.length=0}}function Du(o,t,e,n,i,r,a,l){let{isLeafNode:u,getNodeChildren:s,toKey:d}=o,c=d(i),f=[...n,c],m=u(i);if(e.set(f,!0),m){for(let b=0,C=n.length;b<=C;b++){let T=n.slice(0,b),v=t.get(T),{reducerResults:S,items:D}=v;D.push(i),v.leavesAvailableCount++,v.totalLeafNodesCount++,a&&pi(i,r,a,S,T)}return}let p=Lt(l),h=[];t.set(f,{items:h,isTree:!0,isGroupBy:!1,node:i,reducerResults:p,cache:!1,childrenLoading:!1,childrenAvailable:!0,totalLeafNodesCount:0,leavesAvailableCount:0,treeNesting:n.length});let g=s(i);if(!(!g||!Array.isArray(g))){for(let b=0,C=g.length;b<C;b++){let T=g[b];Du(o,t,e,f,T,b,a,l)}a&&Do(a,p,h)}}function Ur(o,t){let{reducers:e,marker:n}=o;if(n){let s=Object.keys(e??{});n.start({details:s.length>0?[{name:"Reducers",value:s.join(", ")}]:void 0})}let i=$r(e),r=Lt(i),a=new $,l=new $;a.set([],{items:[],isTree:!0,isGroupBy:!1,reducerResults:r,cache:!1,childrenLoading:!1,childrenAvailable:!0,totalLeafNodesCount:0,leavesAvailableCount:0,node:null,treeNesting:-1});for(let s=0,d=t.length;s<d;s++)Du(o,a,l,[],t[s],s,e,i);e&&Do(e,r,t);let u={deepMap:a,treeParams:o,treePaths:l,initialData:t,reducerResults:r};return n&&n.end(),u}function hi(o,t){let{marker:e,groupBy:n,defaultToKey:i=go,pivot:r,reducers:a}=o;e&&e.start();let l=n.length,u=r?new $:void 0,s=new $,d=[],c=[],f=$r(a),m=Lt(f);if(!l){let h={items:[],isTree:!1,isGroupBy:!0,cache:!1,childrenLoading:!1,childrenAvailable:!1,reducerResults:Lt(f)};r&&(h.pivotDeepMap=new $),s.set(d,h)}for(let h=0,g=t.length;h<g;h++){let b=t[h],C={};for(let T=0;T<l;T++){let{field:v,groupField:S,valueGetter:D,toKey:R}=n[T],E=v?b[v]:null;D&&(bn.data=b,bn.field=v,E=D(bn));let N=(R||i)(E,b);if(C[v||S]=N,d.push(N),!s.has(d)){let w={items:[],isTree:!1,isGroupBy:!0,cache:!1,commonData:{...C},childrenLoading:!1,childrenAvailable:!1,reducerResults:Lt(f)};r&&(w.pivotDeepMap=new $),s.set(d,w)}Ru(s,d,c,b,h,r,a,u,f,i)}l||Ru(s,d,c,b,h,r,a,u,f,i),a&&pi(b,h,a,m,d),d.length=0}a&&(s.visitDepthFirst((h,g,b,C)=>{Do(a,h.reducerResults,h.items),r&&h.pivotDeepMap.visitDepthFirst(({items:T,reducerResults:v},S,D,R)=>{Do(a,v,T),R?.()}),C?.()}),Do(a,m,t));let p={deepMap:s,groupParams:o,initialData:t,reducerResults:m};return r&&(p.topLevelPivotColumns=u,p.pivot=r),e&&e.end({details:[{name:"Group by fields",value:n.map(h=>h.field).join(", ")}]}),p}function Au(o){let{groupParams:t,deepMap:e}=o,n=t.groupBy.length,i=[];return e.topDownKeys().reduce((r,a)=>{if(a.length===n){let l=e.get(a).items;r.push(...l)}return r},i),i}function Gm(o,t){let{groupBy:e,groupKeys:n,parents:i,reducers:r,lazyLoad:a}=o,l=n.length,{items:u,reducerResults:s,pivotDeepMap:d,commonData:c}=t,f=c??null,m;if(Object.keys(s).length>0){f={...c},m={};for(let C in r)if(r.hasOwnProperty(C)){let v=r[C].field;v&&(m[v]=s[C]),v&&f[v]==null&&(f[v]=s[C])}}let p=!0,h=n[n.length-1],g=h;if(f!=null){let C=e[n.length-1];C&&C.field&&(g=f[C.field]),C&&C.toKey&&(g=C.toKey(g,f)),g=g??h}return typeof g=="string"&&g.startsWith(xu)&&(p=!1,g=null),{data:f,reducerData:m,groupCount:u.length,groupData:u,groupKeys:n,isTreeNode:!1,rowSelected:!1,selectedChildredCount:0,deselectedChildredCount:0,id:`${n}`,collapsed:!1,dataSourceHasGrouping:!0,rowDisabled:!1,isCellSelected:rn,hasSelectedCells:rn,selfLoaded:p,error:o.error,parents:i,deepRowInfoArray:[],collapsedChildrenCount:0,collapsedGroupsCount:0,totalChildrenCount:o.totalChildrenCount,childrenAvailable:a?o.childrenAvailable:!0,childrenLoading:o.childrenLoading,indexInParentGroups:o.indexInParentGroups,indexInGroup:o.indexInGroup,indexInAll:o.indexInAll,directChildrenCount:o.directChildrenCount,directChildrenLoadedCount:a?o.directChildrenLoadedCount:o.directChildrenCount,value:g,rootGroupBy:e,groupBy:l===e.length?e:e.slice(0,l),isGroupRow:!0,pivotValuesMap:d,groupNesting:l,reducerResults:s}}function mi(o,t,e){return{...o,id:`duplicate_row_on_page_${e}_for__${o.id}`,indexInAll:t,duplicateOf:o.id}}function Do(o,t,e){if(o){for(let n in o)if(o.hasOwnProperty(n)){let i=o[n];i.done&&(t[n]=i.done(t[n],e))}}return t}function _u(o,t,e,n,i,r){let a=t.length,{isLeafNode:l,getNodeChildren:u}=i.treeParams,{toPrimaryKey:s,treeResult:d,isRowDisabled:c,isNodeSelected:f,withRowInfo:m,isNodeExpanded:p,treeSelectionState:h,repeatWrappedGroupRows:g,rowsPerPage:b}=i,{deepMap:C}=d,T=o.length,v=e[e.length-1],S=v?v.nodeExpanded:!0;for(let D=0;D<T;D++){let R=o[D],E=s(R,D),N=[...t,E];if(l(R)){let F={id:E,nodePath:N,isGroupRow:!1,data:R,treeNesting:a,totalLeafNodesCount:0,collapsedLeafNodesCount:0,isTreeNode:!0,isParentNode:!1,selfLoaded:!0,rowSelected:!1,rowDisabled:!1,isCellSelected:rn,hasSelectedCells:rn,dataSourceHasGrouping:!1,parentNodes:Array.from(e),indexInParentNodes:[...n,D],indexInParent:D,indexInAll:S?r.length:-1};f&&(F.rowSelected=f(F)),c&&(F.rowDisabled=c(F)),m&&m(F);let O=g&&b!=null&&b>0&&F.indexInAll%b===0?F.indexInAll/b:null;for(let z=0,k=e.length;z<k;z++){let H=e[z];if(S||(H.collapsedLeafNodesCount+=1),H.deepRowInfoArray.push(F),O!=null&&S){if(typeof g=="function"&&g(H)!==!0)continue;let oe=mi(H,F.indexInAll,O);r[oe.indexInAll]=oe,F.indexInAll++}}S&&(r[F.indexInAll]=F);continue}let _=C.get(N)?.totalLeafNodesCount??0,A={dataSourceHasGrouping:!1,nodeExpanded:!1,selfExpanded:!1,nodePath:N,id:E,data:R,indexInAll:r.length,indexInParent:D,indexInParentNodes:[...n,D],totalLeafNodesCount:_,treeNesting:a,selfLoaded:!0,isParentNode:!0,isTreeNode:!0,isGroupRow:!1,deepRowInfoArray:[],parentNodes:Array.from(e),collapsedLeafNodesCount:0,rowSelected:!1,rowDisabled:!1,isCellSelected:rn,hasSelectedCells:rn,selectedLeafNodesCount:0,deselectedLeafNodesCount:0};if(f&&(A.rowSelected=f(A),h)){let F=h.getSelectionCountFor(A.nodePath);A.selectedLeafNodesCount=F.selectedCount,A.deselectedLeafNodesCount=F.deselectedCount}c&&(A.rowDisabled=c(A)),m&&m(A);let I=!0;if(p&&(A.selfExpanded=I=p(A)),S||(I=!1),A.nodeExpanded=I,S&&g&&b!=null&&b>0){let F=A.indexInAll,O=A.parentNodes;if(O.length>0&&F%b===0){let z=F/b,k=0;O.forEach(H=>{typeof g=="function"&&g(H)!==!0||(r.push(mi(H,F+k,z)),k++,A.indexInAll++)})}}S&&(r[A.indexInAll]=A);let M=u(R);Array.isArray(M)&&_u(M,N,[...e,A],A.indexInParentNodes,i,r)}return r}function Mu(o){let{dataArray:t,marker:e}=o;e&&e.start();let n=[];return _u(t,[],[],[],o,n),e&&e.end(),{data:n}}function Eu(o){let{marker:t,lazyLoad:e,groupResult:n,rowsPerPage:i,repeatWrappedGroupRows:r,withRowInfo:a,toPrimaryKey:l,groupRowsState:u,isRowDisabled:s,isRowSelected:d,rowSelectionState:c,generateGroupRows:f,reducers:m={}}=o,{groupParams:p,deepMap:h,pivot:g}=n,{groupBy:b}=p;t&&t.start({details:[{name:"Group by fields",value:b.map(D=>D.field).join(", ")}]});let C=[],T=[],v=[],S=[];return h.visitDepthFirst((D,R,E,N)=>{let w=D.items,P=R.length,_=u?.isGroupRowCollapsed(R)??!1;S.push(E);let A=Gm({lazyLoad:e,groupBy:b,parents:Array.from(v),reducers:m,indexInGroup:E,indexInParentGroups:Array.from(S),indexInAll:C.length,groupKeys:R,error:D.error,totalChildrenCount:D.totalChildrenCount,childrenLoading:(D.childrenLoading||!_&&!D.childrenAvailable)&&e,childrenAvailable:D.childrenAvailable,directChildrenCount:R.length===b.length?D.items.length:h.getDirectChildrenSizeFor(R),directChildrenLoadedCount:0},D);if(d&&(A.rowSelected=d(A),c)){let z=c.getSelectionCountFor(A.groupKeys);A.selectedChildredCount=z.selectedCount,A.deselectedChildredCount=z.deselectedCount}s&&(A.rowDisabled=s(A));let I=v[v.length-1],M=I?.collapsed??!1;M&&(_=!0),A.collapsed=_;let F=f||_;if(M&&(F=!1),F){if(r&&i!=null&&i>0){let z=A.indexInAll,k=A.parents;if(k.length>0&&z%i===0){let H=z/i,oe=0;k.forEach(le=>{typeof r=="function"&&r(le)!==!0||(C.push(mi(le,z+oe,H)),oe++,A.indexInAll++)})}}C.push(A),T.push(C.length-1)}A.collapsedChildrenCount=0,v.forEach(z=>{z.deepRowInfoArray.push(A),z.collapsedGroupsCount+=_?1:0}),I&&A.selfLoaded&&e&&(I.directChildrenLoadedCount+=1),a&&a(A),v.push(A);let O=!0;if(O){if(N)N();else if(!g){let z=C.length;_||(C.length+=w.length);let k=0;for(let H=0,oe=w.length;H<oe;H++){let le=w[H];if(!_&&r&&i!=null&&i>0){let Pe=z+H+k;if(Pe%i===0){let je=Pe/i;v.forEach(Fe=>{if(typeof r=="function"&&r(Fe)!==!0)return;let be=z+H+k;C[be]=mi(Fe,be,je),k++,C.length++})}}let q=z+H+k,ye={id:le?l(le,q):`${R}-${H}`,data:le,isCellSelected:rn,hasSelectedCells:rn,dataSourceHasGrouping:!0,isTreeNode:!1,isGroupRow:!1,selfLoaded:!!le,rowSelected:!1,rowDisabled:!1,rootGroupBy:b,collapsed:_,groupKeys:R,parents:Array.from(v),indexInParentGroups:[...S,H],indexInGroup:H,indexInAll:q,groupBy:b,groupNesting:P+1,groupCount:A.groupCount};d&&(ye.rowSelected=d(ye)),s&&(ye.rowDisabled=s(ye)),a&&a(ye),v.forEach((Pe,je)=>{je===v.length-1&&le&&(Pe.directChildrenLoadedCount+=1),_&&(Pe.collapsedChildrenCount+=1),Pe.deepRowInfoArray.push(ye)}),_||(C[z+H+k]=ye)}}}v.pop(),S.pop()}),t&&t.end(),{data:C,groupRowsIndexes:T}}function qr(...o){return(...e)=>{o.forEach(n=>{typeof n=="function"&&n(...e)})}}function Yr(o){let{pivotByAtIndex:t,pivotAggregator:e}=o;return t?.column&&(typeof t.column=="function"?Object.assign(o,t.column({column:o})):Object.assign(o,t.column)),e?.pivotColumn&&(typeof e.pivotColumn=="function"?Object.assign(o,e.pivotColumn({column:o})):Object.assign(o,e.pivotColumn)),o}function Zr(o){let{pivotByAtIndex:t}=o;return t?.columnGroup&&(typeof t.columnGroup=="function"?Object.assign(o,t.columnGroup({columnGroup:o})):Object.assign(o,t.columnGroup)),o}function Fu({deepMap:o,pivotBy:t,pivotTotalColumnPosition:e,pivotGrandTotalColumnPosition:n,reducers:i={},showSeparatePivotColumnForSingleAggregation:r=!1}){let a=t.length,l=Object.keys(i).map(m=>({...i[m],id:m}));l.length||(r=!0,n=!1,e=!1,l.push({id:"__empty-aggregation-reducer__",name:"-",initialValue:null,reducer:()=>null}));let u={},s={},d=Ft(function(){l.forEach((m,p)=>{u[`total:${m.id}`]=Yr({header:`${m.name||m.id} total`,pivotBy:t,pivotColumn:!0,pivotTotalColumn:!0,pivotAggregator:m,pivotAggregatorIndex:p,pivotGroupKeys:[],pivotGroupKey:"",pivotIndex:-1,valueFormatter:({rowInfo:h})=>h.isGroupRow?h.reducerResults?.[m.id]:null})})});(!a&&e==="start"||n==="start")&&d();let c=!r&&l.length===1;return o.visitDepthFirst((m,p,h,g)=>{if(p=[...p],e==="end"&&g?.(),p.length===a){let b=t[p.length-1],T=p.slice(0,-1).join("/");if(!c){let v=T;T=p.join("/");let S=p[p.length-1];s[T]=Zr({header:`${S}`,columnGroup:v,pivotBy:t,pivotGroupKeys:p,pivotByAtIndex:b,pivotIndex:p.length-1,pivotGroupKey:S})}l.forEach((v,S)=>{let D=c?`${p[p.length-1]}`:v.name||v.id,R=Yr({pivotBy:t,pivotColumn:!0,pivotTotalColumn:!1,pivotAggregator:v,pivotAggregatorIndex:S,pivotGroupKeys:p,pivotGroupKey:p[p.length-1],pivotIndex:p.length-1,pivotByAtIndex:b,defaultSortable:!1,columnGroup:T,header:D,valueFormatter:({rowInfo:N})=>N.isGroupRow?N.pivotValuesMap?.get(p)?.reducerResults[v.id]:null}),E=`${v.id}:${p.join("/")}`;u[E]=R})}else{let b=p.join("/"),C=p.slice(0,-1);if(s[b]=Zr({columnGroup:C.length?C.join("/"):void 0,header:`${p[p.length-1]}`,pivotBy:t,pivotGroupKeys:p,pivotIndex:p.length-1,pivotByAtIndex:t[p.length-1],pivotGroupKey:p[p.length-1]}),e!==!1){let T=t[p.length-1],v=C.length?C.join("/"):void 0;if(!c){let S=v;v=`total:${p.join("/")}`,s[v]=Zr({header:`${p[p.length-1]} total`,columnGroup:S,pivotBy:t,pivotTotalColumnGroup:!0,pivotGroupKeys:p,pivotIndex:p.length-1,pivotByAtIndex:T,pivotGroupKey:p[p.length-1]})}l.forEach((S,D)=>{let R=c?`${p[p.length-1]} total `:`${S.name||S.id} total`,E=Yr({columnGroup:v,header:R,pivotAggregator:S,pivotAggregatorIndex:D,pivotColumn:!0,pivotTotalColumn:!0,pivotGroupKeys:p,pivotGroupKey:p[p.length-1],pivotByAtIndex:T,pivotIndex:p.length-1,pivotBy:t,defaultSortable:!1,valueFormatter:({rowInfo:N})=>N.isGroupRow?N.pivotValuesMap?.get(p)?.reducerResults[S.id]:null});u[`total:${S.id}:${p.join("/")}`]=E})}}(e==="start"||e===!1)&&g?.()}),(!a&&e==="end"||n==="end")&&d(),{columns:u,columnGroups:s}}var Km=()=>{};function Xr(o,t){let e=new $,n=t.nodesKey??"children",i=t.emptyGroup??{},r=typeof t.pathKey=="function"?t.pathKey:l=>l[t.pathKey];for(let l of o){let u=r(l);for(let s=0;s<u.length;s++){let d=u.slice(0,s);e.has(d)||e.set(d,void 0)}e.set(u,l)}function a(l,u){let s=e.getKeysStartingWith(l,{excludeSelf:!0,depthLimit:1});for(let d of s){let c=[...l,d[d.length-1]],f=e.get(c),m=f?f[n]??[]:[];a(c,m),m.length&&(f||(f=typeof i=="function"?i(c,m):i),f[n]=m),u.push(f)}return u}return a([],[])}function Nu(o,t,e,n){let{isLeafNode:i,getNodeChildren:r,toKey:a}=o,{onParentNode:l,onNode:u,onLeafNode:s}=t,d=a(n),c=[...e,d],f=i(n),m=Ft(()=>{let p=r(n);if(!(!p||!Array.isArray(p)))for(let h=0,g=p.length;h<g;h++){let b=p[h];Nu(o,t,c,b)}});f?(s?.(n),u?.(n,Km)):(l?.(n,m,r(n)),u?.(n,m))}function Ou(o,t,e){for(let n=0,i=e.length;n<i;n++)Nu(o,t,[],e[n])}function ku(o){return o.map(e=>Array.isArray(e.field)?e.field.map((n,i)=>{let r=Array.isArray(e.type)?e.type[i]??e.type[0]:e.type;return typeof n=="function"?{...e,valueGetter:n,field:void 0,type:r}:{...e,type:r,field:n}}):e).flat()}var an=(o,t,e)=>{let n=typeof e=="function"?e:e?.get,i=e&&typeof e=="object"?e.marker:void 0;return i&&i.start(),t.sort(zu(ku(o),n)),i&&i.end(),t},Lu=(o,t,e)=>{let{marker:n}=e;n&&n.start();let i=zu(ku(o),e.get),r=e.depthFirst??!1,a=e.inplace??!1;r||(a?t.sort(i):t=[...t].sort(i));let{nodesKey:l,toKey:u}=e,s=c=>c[l],d=c=>c[l]===void 0;return Ou({isLeafNode:e.isLeafNode??d,getNodeChildren:e.getNodeChildren??s,toKey:u},{onParentNode:(c,f,m)=>{if(r&&f(),Array.isArray(m)){let p=a?m.sort(i):[...m].sort(i);c[l]=p}r||f()}},t),r&&(a?t.sort(i):t=[...t].sort(i)),n&&n.end(),t};an.knownTypes=bo;var Hm=o=>{if(!o)return;let t=o.field,e=o.valueGetter,n=o.dir<0?-1:o.dir>0?1:0;if(!n)return;let i=o.fn;if(!i&&o.type){let r=Array.isArray(o.type)?o.type[0]:o.type;i=an.knownTypes[r],i||console.warn(`Unknown sort type "${o.type}" - please pass one of ${Object.keys(an.knownTypes).join(", ")}`)}return i||(i=bo.string),(r,a)=>{let l=e?e(r):t?r[t]:r,u=e?e(a):t?a[t]:a,s=i(l,u);return s===0?s:n*s}},Bm=o=>o.map(Hm).filter(t=>t instanceof Function),zu=(o,t)=>{let e=Bm(o);return(n,i)=>{t&&(n=t(n),i=t(i));let r=0,a=0,l,u=e.length;for(;a<u;a++)if(l=e[a],!!l&&(r=l(n,i),r!==0))return r;return r}};var Vu=Symbol("CLEAR"),Cn=class o{constructor(t){this.affectedFields=new Set;this.allFieldsAffected=!1;this.primaryKeyToData=new Map;this.nodePathToData=new $;this.getAffectedFields=()=>this.allFieldsAffected?!0:this.affectedFields;this.delete=(t,e,n)=>{this.allFieldsAffected=!0;let i=t,r=this.primaryKeyToData.get(i)||[];r.push({type:"delete",primaryKey:t,originalData:e,metadata:n}),this.primaryKeyToData.set(i,r)};this.deleteNodePath=(t,e,n)=>{this.allFieldsAffected=!0;let i=this.nodePathToData.get(t)||[];i.push({type:"delete",nodePath:t,originalData:e,metadata:n}),this.nodePathToData.set(t,i)};this.insert=(t,e,n,i)=>{let r=t,a=this.primaryKeyToData.get(r)||[];this.allFieldsAffected=!0,a.push({type:"insert",primaryKey:t,data:e,position:n,originalData:null,metadata:i}),this.primaryKeyToData.set(r,a)};this.insertNodePath=(t,e,n,i)=>{let r=this.nodePathToData.get(t)||[];this.allFieldsAffected=!0,r.push({type:"insert",nodePath:t,data:e,position:n,originalData:null,metadata:i}),this.nodePathToData.set(t,r)};this.update=(t,e,n,i)=>{this.allFieldsAffected||(this.nodesKey&&Array.isArray(e[this.nodesKey])?this.allFieldsAffected=!0:Object.keys(e).forEach(u=>this.affectedFields.add(u)));let r=t,a=this.primaryKeyToData.get(r)||[];a.push({type:"update",primaryKey:t,data:e,originalData:n,metadata:i}),this.primaryKeyToData.set(t,a)};this.updateNodePath=(t,e,n,i)=>{this.allFieldsAffected||(this.nodesKey&&Array.isArray(e[this.nodesKey])?this.allFieldsAffected=!0:Object.keys(e).forEach(l=>this.affectedFields.add(l)));let r=this.nodePathToData.get(t)||[];r.push({type:"update",nodePath:t,data:e,originalData:n,metadata:i}),this.nodePathToData.set(t,r)};this.updateChildren=(t,e,n,i)=>{this.allFieldsAffected=!0;let r=this.nodePathToData.get(t)||[];r.push({type:"update-children",nodePath:t,children:e,originalData:n,metadata:i}),this.nodePathToData.set(t,r)};this.resetDataSource=t=>{this.clear(),this.allFieldsAffected=!0;let e=Vu,n=this.primaryKeyToData.get(e)||[];n.push({type:"clear-all",primaryKey:void 0,metadata:t}),this.primaryKeyToData.set(e,n)};this.shouldResetDataSource=()=>this.primaryKeyToData.has(Vu);this.clear=()=>{this.allFieldsAffected=!1,this.affectedFields.clear(),this.primaryKeyToData.clear()};this.isEmpty=()=>this.primaryKeyToData.size===0&&this.nodePathToData.size===0;this.removeInfo=t=>{this.primaryKeyToData.delete(t)};this.removeNodePathInfo=t=>{this.nodePathToData.delete(t)};this.getMutationsForPrimaryKey=t=>this.primaryKeyToData.get(t);this.getMutationsForNodePath=t=>this.nodePathToData.get(t);this.getMutationsCount=()=>this.primaryKeyToData.size;this.getMutations=()=>new Map(this.primaryKeyToData);this.getTreeMutations=()=>$.clone(this.nodePathToData);this.getMutationsArray=()=>Array.from(this.primaryKeyToData.values()).flat();this.getTreeMutationsArray=()=>Array.from(this.nodePathToData.values()).flat();this.nodesKey=t.nodesKey}static clone(t,{light:e=!1}={}){let n=new o({nodesKey:t.nodesKey});return n.allFieldsAffected=t.allFieldsAffected,n.affectedFields=new Set(t.affectedFields),n.primaryKeyToData=e?t.primaryKeyToData:new Map(t.primaryKeyToData),n.nodePathToData=e?t.nodePathToData:$.clone(t.nodePathToData),n}};function ln(o,t){return t().dataArray[o]}function gi(o){return o().dataArray}var nt=class{constructor(t){this.collapsedPathsMap=new $;this.expandedPathsMap=new $;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 e=t&&t instanceof Object.getPrototypeOf(this).constructor?t.getState():t;e&&this.update(e)}get mode(){return this._mode}reset(){this.collapsedPathsMap.clear(),this.expandedPathsMap.clear(),this.collapsedIdsMap.clear(),this.expandedIdsMap.clear()}destroy(){this.reset()}expandNode(t){this.setNodeExpanded(t,!0)}collapseNode(t){this.setNodeExpanded(t,!1)}setNodeExpanded(t,e){let{collapsedPathsMap:n,collapsedIdsMap:i,expandedPathsMap:r,expandedIdsMap:a,defaultExpanded:l,_mode:u}=this;u==="id"&&Array.isArray(t)&&(t=t[t.length-1]),e===l?e?u==="path"&&Array.isArray(t)?n.delete(t):i.delete(t):u==="path"&&Array.isArray(t)?r.delete(t):a.delete(t):e?u==="path"&&Array.isArray(t)?r.set(t,!0):a.set(t,!0):u==="path"&&Array.isArray(t)?n.set(t,!0):i.set(t,!0)}isNodeExpandedByPath(t){return this.isNodeExpanded(t)}isNodeExpandedById(t){return this.isNodeExpanded(t)}isNodeExpanded(t){if(this._mode==="id"&&Array.isArray(t)&&(t=t[t.length-1]),this._mode==="id"&&Array.isArray(t))throw`You try to check if a node is expanded by id (${t}) but your TreeExpandState is configured to use node paths.`;if(this._mode==="path"&&!Array.isArray(t))throw`You try to check if a node is expanded by path (${t}) but your TreeExpandState is configured to use node ids.`;return this.defaultExpanded?this._mode==="path"&&Array.isArray(t)?!this.collapsedPathsMap.has(t):!this.collapsedIdsMap.has(t):this._mode==="path"&&Array.isArray(t)?this.expandedPathsMap.has(t):this.expandedIdsMap.has(t)}update(t){if(this.defaultExpanded=t.defaultExpanded,this.reset(),t.expandedPaths||t.collapsedPaths){this._mode="path";let i=t.expandedPaths||null,r=t.collapsedPaths||null;if(i)for(let a=0,l=i.length;a<l;a++)this.expandedPathsMap.set(i[a],!0);if(r)for(let a=0,l=r.length;a<l;a++)this.collapsedPathsMap.set(r[a],!0);return}this._mode="id";let e=t.expandedIds||null,n=t.collapsedIds||null;if(e)for(let i=0,r=e.length;i<r;i++)this.expandedIdsMap.set(e[i],!0);if(n)for(let i=0,r=n.length;i<r;i++)this.collapsedIdsMap.set(n[i],!0)}getState(){if(this._mode==="path"){let n=Array.from(this.collapsedPathsMap.keys()),i=Array.from(this.expandedPathsMap.keys());return{defaultExpanded:this.defaultExpanded,collapsedPaths:n,expandedPaths:i}}let t=Array.from(this.collapsedIdsMap.keys()),e=Array.from(this.expandedIdsMap.keys());return{defaultExpanded:this.defaultExpanded,collapsedIds:t,expandedIds:e}}};var Wm=(o,t)=>o.length-t.length,Qe=class o{constructor(t,e){this.selectedPaths=null;this.deselectedPaths=null;this.defaultSelection=!1;this.selectionMap=new $;this.cache=new $;this.strictMode=!1;let n=t instanceof Object.getPrototypeOf(this).constructor,i=n?t.getState():t;this.setConfig(e||(n?t.config:{treePaths:new $})),this.disableStrictMode(),this.update(i),this.config.strictCheckPaths&&this.enableStrictMode()}getTreePaths(t){return t?Array.isArray(t)?new $(t.map(e=>[e,!0])):t:this.config.treePaths}withTreePaths(t,e){let n=this.config.treePaths;e=this.getTreePaths(e);let i=e!==n;i&&this.xcache(),this.config.treePaths=e;let r=t(e);return this.config.treePaths=n,i&&this.xcache(),r}getLeafNodePaths(t=[],e){return this.withTreePaths(n=>n.getKeysForLeafNodesStartingWith(t),e)}forEachLeafNodePath(t,e=[],n){let i={selected:!1};this.withTreePaths(r=>{r.getLeafNodesStartingWith(e,a=>{i.selected=this.isNodeSelected(a.keys)===!0,t(a.keys,i)})},n)}getSelectedLeafNodePaths(t=[],e){let n=[];return this.withTreePaths(i=>{i.getLeafNodesStartingWith(t,r=>{this.isNodeSelected(r.keys)&&n.push(r.keys)})},e),n}getDeselectedLeafNodePaths(t=[],e){let n=[];return this.withTreePaths(i=>{i.getLeafNodesStartingWith(t,r=>{this.isNodeSelected(r.keys)||n.push(r.keys)})},e),n}isLeafNode(t){let{treePaths:e}=this.config;return e.has(t)?e.getKeysForLeafNodesStartingWith(t).length===1:null}getLeafNodesCount(t){return this.config.treePaths.getKeysForLeafNodesStartingWith(t).length}static from(t,e){return new o(t,e)}setConfig(t){let e=typeof t=="function"?t():t;this.config={treePaths:Array.isArray(e.treePaths)?new $(e.treePaths.map(n=>[n,!0])):e.treePaths,strictCheckPaths:e.strictCheckPaths??!0},this.xcache()}xcache(){this.cache.clear()}update(t){this.selectedPaths=t.selectedPaths||null,this.deselectedPaths=t.deselectedPaths||null;let{selectionMap:e,selectedPaths:n,deselectedPaths:i}=this;e.clear(),n?.forEach(r=>this.setSelectionForPath(r,!0)),i?.forEach(r=>this.setSelectionForPath(r,!1)),this.defaultSelection=t.defaultSelection,this.xcache()}setSelectionForPath(t,e){this.isPathAvailable(t)&&this.selectionMap.set(t,e)}getState(){let t=[],e=[];return this.selectionMap.topDownEntries().forEach(([n,i])=>{i?t.push(n):e.push(n)}),{defaultSelection:this.defaultSelection,selectedPaths:t,deselectedPaths:e}}deselectAll(){this.update({defaultSelection:!1,selectedPaths:[],deselectedPaths:[]})}selectAll(){this.update({defaultSelection:!0,deselectedPaths:[],selectedPaths:[]})}enableStrictMode(){this.strictMode=!0}disableStrictMode(){this.strictMode=!1}isPathAvailable(t){if(!this.strictMode)return!0;let{treePaths:e}=this.config;return e.has(t)}isNodeSelected(t){return this.isPathSelected(t)}isSelfSelected(t){return this.selectionMap.get(t)??null}cacheIt(t,e){return this.cache.set(t,e),e}getSelectionStateForNode(t,e){let n=this.cache.get(t);if(n)return n;if(this.isLeafNode(t)!==!1){let c=this.isSelfSelected(t);if(c!==null)return this.cacheIt(t,{selected:c,selectedCount:c?1:0,deselectedCount:c?0:1,leafCount:1})}let i=this.getLeafNodesCount(t),r=this.isSelfSelected(t),{selectionMap:a}=this,l=a.getKeysOfFirstChildOnEachBranchStartingWith(t,{excludeSelf:!0}).sort(Wm);if(this.strictMode&&(l=l.filter(c=>this.isPathAvailable(c))),!l.length){if(r!==null){let f=i?r:!1;return this.cacheIt(t,{selected:f,selectedCount:f?i:0,deselectedCount:f?0:i,leafCount:i})}let c=this.getNodeBooleanSelectionStateFromParent(t);return this.cacheIt(t,{selected:c,selectedCount:c?i:0,deselectedCount:c?0:i,leafCount:i})}let u=0,s=0,d=this.getNodeBooleanSelectionStateFromParent(t);d?u+=i:s+=i;for(let c=0,f=l.length;c<f;c++){let m=l[c],{selectedCount:p,deselectedCount:h}=this.getSelectionStateForNode(m);if(d?(u-=h,s+=h):(s-=p,u+=p),e&&p>0&&h>0)return this.cacheIt(t,{selected:null,leafCount:i,selectedCount:u,deselectedCount:s})}if(!u&&!s)return this.cacheIt(t,{selected:d,selectedCount:d?i:0,deselectedCount:d?0:i,leafCount:i});if(u){let c=u===i?!0:null;return this.cacheIt(t,{selected:c,selectedCount:u,deselectedCount:s,leafCount:i})}return this.cacheIt(t,{selected:!1,selectedCount:0,deselectedCount:i,leafCount:i})}isPathSelected(t){return this.isPathAvailable(t)?this.getSelectionStateForNode(t,!0).selected:!1}getNodeBooleanSelectionStateFromParent(t){let{defaultSelection:e,selectionMap:n}=this;if(!t.length)return e;let i=[...t];do{let r=n.get(i);if(r!==void 0)return r;i.pop()}while(i.length);return e}setNodeSelection(t,e){if(!t.length)return;if(this.xcache(),this.selectionMap.getKeysStartingWith(t).forEach(i=>{this.selectionMap.delete(i)}),!(t.length===1&&this.defaultSelection===e)){if(this.setSelectionForPath(t,e),t.length>1){let i=t.slice(0,-1);this.isNodeSelected(i)===e&&this.setNodeSelection(i,e)}}}selectNode(t){this.setNodeSelection(t,!0)}deselectNode(t){this.setNodeSelection(t,!1)}toggleNodeSelection(t){this.setNodeSelection(t,!this.isNodeSelected(t))}getSelectedCount(){return this.getSelectionCountFor([]).selectedCount}getDeselectedCount(){return this.getSelectionCountFor([]).deselectedCount}getSelectionCountFor(t=[]){let{selectedCount:e,deselectedCount:n}=this.getSelectionStateForNode(t);return{selectedCount:e,deselectedCount:n}}destroy(){this.config=void 0,this.xcache(),this.selectionMap.clear()}};function bi(o,t){return new Qe(o,Hn(t))}function Hn(o){return()=>({treePaths:(typeof o=="function"?o():o).treePaths})}var yi=class{constructor(t){this.setNodeSelection=(t,e,n)=>{let{treeSelectionState:i,selectionMode:r}=this.getState();if(!this.isNodeSelectable(t)&&!n?.force)return;if(r==="single-row"){this.actions.treeSelection=e?t[t.length-1]:null;return}if(r!=="multi-row")throw"Selection mode is not multi-row or single-row";if(!(i instanceof Qe))throw"Invalid tree selection";let a=new Qe(i,Hn(this.getState));a.setNodeSelection(t,e),this.getState().lastSelectionUpdatedNodePathRef.current={nodePath:t,selected:e},this.actions.treeSelection=a};this.getCallbackParam=t=>({dataSourceApi:this.dataSourceApi});this.getState=t.getState,this.actions=t.actions,this.dataSourceApi=t.dataSourceApi}getSelectedLeafNodePaths(t){let{treePaths:e}=this.getState(),n=t?.treeSelectionState||this.getState().treeSelectionState;return n?n.getSelectedLeafNodePaths(t?.rootNodePath,e):[]}getDeselectedLeafNodePaths(t){let{treePaths:e}=this.getState(),n=t?.treeSelectionState||this.getState().treeSelectionState;return n?n.getDeselectedLeafNodePaths(t?.rootNodePath,e):[]}getSelectedLeafRowInfos(t){let{treePaths:e}=this.getState(),n=t?.treeSelectionState||this.getState().treeSelectionState;if(!e||!n)return[];let i=t?.rootNodePath||[],r=[];return e.getLeafNodesStartingWith(i,a=>{if(n.isNodeSelected(a.keys)){let l=this.getRowInfoByPath(a.keys);l&&r.push(l)}},{excludeSelf:!0}),r}get allRowsSelected(){return this.getState().allRowsSelected}isNodeReadOnly(t){let e=this.getRowInfoByPath(t),n=this.getState().isNodeReadOnly;return e&&e.isTreeNode&&e.isParentNode&&n?n(e):!1}isNodeSelectable(t){let e=this.getRowInfoByPath(t),n=this.getState().isNodeSelectable;return e&&e.isTreeNode?n(e):!1}isNodeExpanded(t){let e=this.getState(),{isNodeExpanded:n,isNodeCollapsed:i,treeExpandState:r}=e,a=this.getRowInfoByPath(t);if(a){if(!a.isTreeNode||!a.isParentNode)return!1;if(i)return!n(a,r);if(n)return n(a,r)}return r.isNodeExpanded(t)}expandAll(){let t=new nt({defaultExpanded:!0,collapsedPaths:[]});this.getState().lastExpandStateInfoRef.current={state:"expanded",nodePath:null},this.actions.treeExpandState=t}collapseAll(){let t=new nt({defaultExpanded:!1,expandedPaths:[]});this.getState().lastExpandStateInfoRef.current={state:"collapsed",nodePath:null},this.actions.treeExpandState=t}expandNode(t,e){if(this.isNodeReadOnly(t)&&!e?.force)return;let n=this.getState(),i=new nt(n.treeExpandState);i.expandNode(t),this.getState().lastExpandStateInfoRef.current={state:"expanded",nodePath:t},this.actions.treeExpandState=i,n.onNodeExpand?.(t,this.getCallbackParam(t))}collapseNode(t,e){if(this.isNodeReadOnly(t)&&!e?.force)return;let n=this.getState(),i=new nt(n.treeExpandState);i.collapseNode(t),this.getState().lastExpandStateInfoRef.current={state:"collapsed",nodePath:t},this.actions.treeExpandState=i,n.onNodeCollapse?.(t,this.getCallbackParam(t))}toggleNode(t,e){let n=this.getState(),i=new nt(n.treeExpandState),r=!this.isNodeExpanded(t);this.isNodeReadOnly(t)&&!e?.force||(i.setNodeExpanded(t,r),this.getState().lastExpandStateInfoRef.current={state:r?"expanded":"collapsed",nodePath:t},this.actions.treeExpandState=i,r?n.onNodeExpand?.(t,this.getCallbackParam(t)):n.onNodeCollapse?.(t,this.getCallbackParam(t)))}getNodeDataByPath(t){if(!t.length)return null;let e=this.getRowInfoByPath(t);return e?e.data:null}getRowInfoByPath(t){let{pathToIndexMap:e}=this.getState(),n=e.get(t);return n!==void 0?ln(n,this.getState):null}selectAll(){let{treeSelectionState:t,selectionMode:e}=this.getState();if(e!=="multi-row")throw"Selection mode is not multi-row";if(!(t instanceof Qe))throw"Invalid node selection";let n=new Qe(t,Hn(this.getState));n.selectAll(),this.getState().lastSelectionUpdatedNodePathRef.current=null,this.actions.treeSelection=n}deselectAll(){let{treeSelectionState:t,selectionMode:e}=this.getState();if(e!=="multi-row")throw"Selection mode is not multi-row";if(!(t instanceof Qe))throw"Invalid node selection";let n=new Qe(t,Hn(this.getState));n.deselectAll(),this.getState().lastSelectionUpdatedNodePathRef.current=null,this.actions.treeSelection=n}isNodeSelected(t){let{treeSelectionState:e,treeSelection:n,selectionMode:i}=this.getState();if(i==="single-row"){let r=t[t.length-1];return Array.isArray(n)?treeSelection.join(",")===t.join(","):n===r}if(i!=="multi-row")throw"Selection mode is not multi-row or single-row";if(!(e instanceof Qe))throw"Invalid tree selection";return e.isNodeSelected(t)}selectNode(t,e){this.setNodeSelection(t,!0,e)}deselectNode(t,e){this.setNodeSelection(t,!1,e)}toggleNodeSelection(t,e){this.isNodeSelected(t)?this.deselectNode(t,e):this.selectNode(t,e)}};var Bn=class{constructor(t){let e=t instanceof Object.getPrototypeOf(this).constructor?t.getState():t,n=this.getPositiveFromState(e),i=this.getNegativeFromState(e);this.update({negativeItems:i,positiveItems:n})}getInitialState(){return this.initialState}destroy(){this.positiveMap?.clear(),this.negativeMap?.clear(),delete this.positiveMap,delete this.negativeMap}update(t){let{positiveItems:e,negativeItems:n}=t;if(this.allNegative=n===!0,this.allPositive=e===!0,this.allNegative&&this.allPositive)throw"Cannot have both negativeItems and positiveItems be true!";if(n&&n!==!0){this.negativeMap||(this.negativeMap=new Map),this.negativeMap.clear();for(let i of n)this.negativeMap.set(i,!0);this.positiveMap&&this.positiveMap.clear()}if(e&&e!==!0){this.positiveMap||(this.positiveMap=new Map),this.positiveMap.clear();for(let i of e)this.positiveMap.set(i,!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(t){if(this.allPositive===!0){if(this.allNegative===!0)throw'Cannot have both positiveItems and negativeItems be "true"';return!this.negativeMap?.has(t)}return!!this.positiveMap?.has(t)}isItemNegative(t){return!this.isItemPositive(t)}setItemValue(t,e){if(e!==this.isItemPositive(t)){if(e){if(this.allNegative===!0){if(!this.positiveMap)throw`No positiveMap found when trying to set item ${t} be positive`;this.positiveMap.set(t,!0)}else if(this.allPositive===!0){if(!this.negativeMap)throw`No negativeMap found when trying to set item ${t} be positive`;this.negativeMap.delete(t)}}else if(this.allPositive===!0){if(!this.negativeMap)throw`No negativeMap found when trying to set item ${t} be negative`;this.negativeMap.set(t,!0)}else if(this.allNegative===!0){if(!this.positiveMap)throw`No positiveMap found when trying to set item ${t} be negative`;this.positiveMap?.delete(t)}}}makeItemNegative(t){this.setItemValue(t,!1)}makeItemPositive(t){this.setItemValue(t,!0)}toggleItem(t){this.setItemValue(t,!this.isItemPositive(t))}};var Tt=class extends Bn{constructor(e){super(e);this.isRowEnabled=e=>!!this.isItemPositive(e)}getState(){let e=this.allPositive?!0:[...this.positiveMap?.keys()??[]],n=this.allNegative?!0:[...this.negativeMap?.keys()??[]];return{enabledRows:e,disabledRows:n}}getPositiveFromState(e){return e.enabledRows}getNegativeFromState(e){return e.disabledRows}areAllDisabled(){return this.areAllNegative()}areAllEnabled(){return this.areAllPositive()}disableAll(){this.makeAllNegative()}enableAll(){this.makeAllPositive()}isRowDisabled(e){return!this.isRowEnabled(e)}setRowEnabled(e,n){return this.setItemValue(e,n)}disableRow(e){this.setRowEnabled(e,!1)}enableRow(e){this.setRowEnabled(e,!0)}toggleRow(e){this.toggleItem(e)}};var Jr=1e3;function Gu(o){return new Qr(o)}var Qr=class{constructor(t){this.pendingOperations=[];this.batchOperationRafId=0;this.batchOperationTimeoutId=0;this.pendingPromise=null;this.resolvePendingPromise=null;this.toPrimaryKey=t=>this.getState().toPrimaryKey(t);this.getRowInfoArray=()=>gi(this.getState);this.getRowInfoByIndex=t=>ln(t,this.getState)??null;this.getRowInfoByPrimaryKey=t=>{let e=this.getIndexByPrimaryKey(t);return this.getRowInfoByIndex(e)};this.getRowInfoByNodePath=t=>{let e=this.getIndexByNodePath(t);return this.getRowInfoByIndex(e)};this.getIndexByPrimaryKey=t=>this.getState().idToIndexMap.get(t)??-1;this.getIndexByNodePath=t=>this.getState().pathToIndexMap.get(t)??-1;this.getNodePathById=t=>this.getState().idToPathMap.get(t)??null;this.getNodePathByIndex=t=>{let e=this.getRowInfoByIndex(t);return e&&e.isTreeNode?e.nodePath:null};this.getPrimaryKeyByIndex=t=>{let e=this.getRowInfoByIndex(t);return e?e.id:void 0};this.getOriginalDataArray=()=>this.getState().originalDataArray;this.getDataByIndex=t=>{let e=this.getRowInfoByIndex(t);return e?e.data:null};this.getDataByPrimaryKey=t=>{let{indexer:e}=this.getState();return e.getDataForPrimaryKey(t)??null};this.isNodePathAvailable=t=>this.getState().indexer.getDataForNodePath(t)!==void 0;this.getDataByNodePath=t=>{let{indexer:e}=this.getState(),n=e.getDataForNodePath(t);return n||null};this.replaceAllData=(t,e)=>(this.batchOperation({type:"replace-all",array:t,metadata:e?.metadata}),this.addDataArray(t,e));this.clearAllData=t=>this.replaceAllData([],t);this.updateData=(t,e)=>this.updateDataArray([t],e);this.updateDataArray=(t,e)=>{let n=this.getState().isTree,i=n?void 0:t.map(l=>this.toPrimaryKey(l)),r=n?t.map(l=>this.getNodePathById(this.toPrimaryKey(l))||[]):null,a=i?this.batchOperation({type:"update",array:t,primaryKeys:t.map(l=>this.toPrimaryKey(l)),metadata:e?.metadata}):this.batchOperation({type:"update",array:t,nodePaths:r||[],metadata:e?.metadata});return e?.flush&&this.commit(),a};this.withWaitForNode=(t,e,n)=>{let i=n?.waitForNode??!0;if(i===!0||typeof i=="number"){let a=i===!0?Jr:i;return isNaN(a)||(a=Jr),this.waitForNodePath(t,{timeout:a}).then(l=>{if(!l){let u=`Cannot find node path "${t.join("/")}" (we waited for it ${a}ms)`;return console.error(u),e({error:u,resolved:!1})}return e({resolved:!0})})}let r=e({resolved:void 0});return r instanceof Promise?r:Promise.resolve(r)};this.updateChildrenByNodePath=(t,e,n)=>this.withWaitForNode(e,({error:i})=>i?!1:this.updateChildrenByNodePath_Internal(t,e,n),n);this.updateChildrenByNodePath_Internal=(t,e,n)=>{let i=typeof t=="function"?t:()=>t;return this.updateDataArrayByNodePath_Internal([{nodePath:e,children:i}],n)};this.updateDataByNodePath=(t,e,n)=>this.isNodePathAvailable(e)?this.updateDataArrayByNodePath_Internal([{data:t,nodePath:e}],n):this.withWaitForNode(e,({error:i})=>i?!1:this.updateDataArrayByNodePath_Internal([{data:t,nodePath:e}],n),n);this.updateDataArrayByNodePath=(t,e)=>{if(e&&typeof e.waitForNode<"u"&&!e.waitForNode)return this.updateDataArrayByNodePath_Internal(t,e);let n=t.map(r=>r.nodePath);return Promise.allSettled(n.map(r=>this.withWaitForNode(r,({error:a})=>!a,e))).then(r=>r.every(Boolean)?this.updateDataArrayByNodePath_Internal(t,e):!1)};this.updateDataArrayByNodePath_Internal=(t,e)=>{let n=[],i=[];t.forEach(a=>{a.data?n.push(a.data):a.children&&n.push(a.children),i.push(a.nodePath)});let r=this.batchOperation({type:"update",array:n,nodePaths:i,metadata:e?.metadata});return e?.flush&&this.commit(),r};this.removeDataByPrimaryKey=(t,e)=>{if(this.getState().isTree)return this.removeDataByNodePath(this.getNodePathById(t)||[],e);let i=this.batchOperation({type:"delete",primaryKeys:[t],metadata:e?.metadata});return e?.flush&&this.commit(),i};this.removeDataByNodePath=(t,e)=>this.batchDeleteNodePaths([t],e);this.removeData=(t,e)=>{if(this.getState().isTree){let i=this.getNodePathById(this.toPrimaryKey(t));return this.removeDataByNodePath(i,e)}return this.batchDeletePrimaryKeys([this.toPrimaryKey(t)],e)};this.removeDataArrayByPrimaryKeys=(t,e)=>{if(this.getState().isTree){let i=t.map(r=>this.getNodePathById(r)||[]);return this.batchDeleteNodePaths(i,e)}return this.batchDeletePrimaryKeys(t,e)};this.batchDeleteNodePaths=(t,e)=>{let n=this.batchOperation({type:"delete",nodePaths:t||[],metadata:e?.metadata});return e?.flush&&this.commit(),n};this.batchDeletePrimaryKeys=(t,e)=>{let n=this.batchOperation({type:"delete",primaryKeys:t,metadata:e?.metadata});return e?.flush&&this.commit(),n};this.removeDataArray=(t,e)=>{if(this.getState().isTree){let r=t.map(a=>this.getNodePathById(this.toPrimaryKey(a))||[]);return this.batchDeleteNodePaths(r,e)}let i=t.map(this.toPrimaryKey);return this.batchDeletePrimaryKeys(i,e)};this.addData=(t,e)=>this.addDataArray([t],e);this.addDataArray=(t,e)=>this.insertDataArray(t,{...e,position:"end"});this.insertData=(t,e)=>this.insertDataArray([t],e);this.insertDataArray=(t,e)=>{let n=this.getState().isTree,i="before",r,a=e.nodePath;if(n&&a?.length)return this.withWaitForNode(a,({error:u})=>{if(u)return!1;if(e.position==="before"||e.position==="after")return this.batchTreeInsert(t,e.position,a,e);let s=d=>e.position==="start"?[...t,...d||[]]:[...d||[],...t];return this.updateChildrenByNodePath(s,a,e)},e);if(e.position==="before"||e.position==="after")i=e.position,r=e.primaryKey;else{let u=this.getOriginalDataArray();e.position==="start"?(i="before",u.length?r=this.toPrimaryKey(u[0]):r=void 0):(i="after",u.length?r=this.toPrimaryKey(u[u.length-1]):r=void 0)}let l=n?this.batchOperation({type:"insert",array:t,position:i,metadata:e?.metadata,nodePath:this.getNodePathById(r)||[]}):this.batchOperation({type:"insert",array:t,position:i,metadata:e?.metadata,primaryKey:r,nodePath:a});return e?.flush&&this.commit(),l};this.batchTreeInsert=(t,e,n,i)=>{if(n.length&&!this.isNodePathAvailable(n))return this.withWaitForNode(n,({error:a})=>{if(a)return!1;let l=this.batchOperation({type:"insert",array:t,position:e,metadata:i?.metadata,nodePath:n});return i?.flush&&this.commit(),l},i);let r=this.batchOperation({type:"insert",array:t,position:e,metadata:i?.metadata,nodePath:n});return i?.flush&&this.commit(),r};this.setSortInfo=t=>{let e=this.getState().multiSort;if(Array.isArray(t)){this.actions.sortInfo=t.length?e?t:t[0]:null;return}this.actions.sortInfo=t};this.setGroupBy=t=>{this.actions.groupBy=t};this.toggleGroupByField=t=>{let e=this.getState().groupBy;e.findIndex(i=>i.field===t)===-1?this.actions.groupBy=[...e,{field:t}]:this.actions.groupBy=e.filter(i=>i.field!==t)};this.isRowDisabledAt=t=>this.getRowInfoByIndex(t)?.rowDisabled??!1;this.isRowDisabled=t=>this.getRowInfoByPrimaryKey(t)?.rowDisabled??!1;this.setRowEnabledAt=(t,e)=>{let n=this.getState().rowDisabledState,i=n?new Tt(n):new Tt({enabledRows:!0,disabledRows:[]}),r=this.getRowInfoByIndex(t);r&&(i.setRowEnabled(r.id,e),this.actions.rowDisabledState=i)};this.setRowEnabled=(t,e)=>{let n=this.getRowInfoByPrimaryKey(t);n&&this.setRowEnabledAt(n.indexInAll,e)};this.enableAllRows=()=>{let t=this.getState().rowDisabledState;if(!t){this.actions.rowDisabledState=new Tt({enabledRows:!0,disabledRows:[]});return}let e=new Tt(t);e.enableAll(),this.actions.rowDisabledState=e};this.disableAllRows=()=>{let t=this.getState().rowDisabledState;if(!t){this.actions.rowDisabledState=new Tt({disabledRows:!0,enabledRows:[]});return}let e=new Tt(t);e.disableAll(),this.actions.rowDisabledState=e};this.areAllRowsEnabled=()=>{let t=this.getState().rowDisabledState;return t?t.areAllEnabled():!0};this.areAllRowsDisabled=()=>{let t=this.getState().rowDisabledState;return t?t.areAllDisabled():!1};this.getState=t.getState,this.getState().__apiRef.current=this,this.actions=t.actions,this.treeApi=new yi({...t,dataSourceApi:this})}getPendingOperationPromise(){return this.pendingPromise}batchOperation(t){if(!this.pendingPromise){this.pendingPromise=new Promise(n=>{this.resolvePendingPromise=n});let e=Math.max(0,this.getState().batchOperationDelay??0);e===0?this.batchOperationRafId=setTimeout(()=>{this.commit()}):this.batchOperationTimeoutId=setTimeout(()=>{this.batchOperationRafId=setTimeout(()=>{this.commit()})},e)}return t.type==="replace-all"&&(this.pendingOperations.length=0),this.pendingOperations.push(t),this.pendingPromise}commitOperations(t){if(!t.length)return;let e=this.getState().cache,{isTree:n,nodesKey:i}=this.getState(),r=e?Cn.clone(e,{light:!0}):new Cn({nodesKey:n?i:void 0});t.forEach(a=>{switch(a.type){case"update":a.array.forEach((d,c)=>{if(a.primaryKeys){let f=a.primaryKeys[c],m=this.getDataByPrimaryKey(f);m&&r.update(a.primaryKeys[c],d,m,a.metadata)}else if(a.nodePaths){let f=this.getDataByNodePath(a.nodePaths[c]);f&&(typeof d=="function"?r.updateChildren(a.nodePaths[c],d,f,a.metadata):r.updateNodePath(a.nodePaths[c],d,f,a.metadata))}});break;case"delete":a.primaryKeys?a.primaryKeys.forEach(d=>{let c=this.getDataByPrimaryKey(d);c&&r.delete(d,c,a.metadata)}):a.nodePaths&&a.nodePaths.forEach(d=>{let c=this.getDataByNodePath(d);c&&r.deleteNodePath(d,c,a.metadata)});break;case"insert":let l=a.primaryKey,u=a.position,s=a.nodePath;s?a.array.forEach(d=>{r.insertNodePath([...s],d,u,a.metadata),l=this.toPrimaryKey(d),s.pop(),s.push(l),u="after"}):a.array.forEach(d=>{r.insert(l,d,u,a.metadata),l=this.toPrimaryKey(d),u="after"});break;case"replace-all":r.resetDataSource(a.metadata);break}}),this.actions.cache=r}flush(){return this.commit()}waitForNodePath(t,e){let n=this.getState();if(this.isNodePathAvailable(t))return Promise.resolve(!0);let i=e?.timeout??Jr,r=n.waitForNodePathPromises.get(t);if(r)return r.promise;let a=Date.now(),l=()=>{},u=new Promise(s=>{let d,c;l=f=>{clearTimeout(c),d=f,n.waitForNodePathPromises.delete(t),s(f)},c=setTimeout(()=>{d===void 0&&l(!1)},i)});return n.waitForNodePathPromises.set(t,{timestamp:a,promise:u,resolve:l}),u}commit(){this.commitOperations(this.pendingOperations),this.pendingOperations.length=0;let t=this.pendingPromise;if(t&&this.resolvePendingPromise){let e=this.resolvePendingPromise;requestAnimationFrame(()=>{e(!0)}),this.pendingPromise=null,this.resolvePendingPromise=null}return t||Promise.resolve(!0)}};function Ku(o){let t=o.cache;if(!t)return{sortInfo:!1,groupBy:!1,tree:!1,filterValue:!1,aggregationReducers:!1};let e=!1,n=!1,i=!1,r=!1,a=!1,l=t.getAffectedFields(),{sortInfo:u,groupBy:s,filterValue:d,aggregationReducers:c,nodesKey:f,isTree:m}=o;if(u&&u.length)if(l===!0)e=!0;else for(let p of u){let h=p.field;if(h&&(h=Array.isArray(h)?h:[h],e=h.reduce((g,b)=>g||typeof b!="function"?l.has(b):!1,!1),e))break}if(s&&s.length){if(l===!0)n=!0;else for(let p of s)if(p.field&&l.has(p.field)){n=!0;break}}if(m&&(l===!0?i=!0:i=l.has(f)),d&&d.length)if(l===!0)r=!0;else for(let p of d){if(p.id){r=!0;break}if(p.field&&l.has(p.field)){r=!0;break}}if(c&&Object.keys(c).length){if(l===!0)a=!0;else for(let p in c)if(c.hasOwnProperty(p)){let h=c[p];if(h.field){if(l.has(h.field)){a=!0;break}}else{a=!0;break}}}return{sortInfo:e,groupBy:n,filterValue:r,aggregationReducers:a,tree:i}}function Ci(o){if(!o)return;let t=Object.keys(o);if(!t.length)return;let e={};for(let n=0,i=t.length;n<i;n++){let r=t[n],a=o[r].initialValue;a!==void 0&&(e[r]=typeof a=="function"?a():a)}return e}function Ti(o){let t=o.reducerKeys,e=o.reducers,n=o.results;for(let i=0,r=t.length;i<r;i++){let a=t[i],l=e[a].reducer;n[a]=l(n[a],o.rowInfo)}}function Si(o){let t=Object.keys(o.reducers||{});if(!t.length||!o.results)return o.results;let e=o.reducers,n=o.results;for(let i=0,r=t.length;i<r;i++){let a=t[i],l=e[a].done;typeof l=="function"&&(n[a]=l(n[a],o.array))}return n}var Ao={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 ea=class o{constructor(t){this.debugId=t;this.markerDetails={label:"",track:"",trackGroup:void 0,color:void 0,details:[],tooltip:void 0};this.stopped=!1;this.start=t=>{if(this.markerDetails.startTs)return this;let e=performance.now();return this.markerDetails.details=t?.details??[],this.markerDetails.startTs=e,this};this.end=(t={})=>{if(this.stopped)return this;this.stopped=!0;let e=t.startTs??this.markerDetails.startTs,n=t.endTs??this.markerDetails.endTs??performance.now(),i=t.color||this.markerDetails.color||"primary",r=t.trackGroup||this.markerDetails.trackGroup||`Infinite Table (${this.debugId})`,a=[...this.markerDetails.details||[],...t.details||[]],l=t.tooltip||this.markerDetails.tooltip,u=t.label||this.markerDetails.label||"Unknown",s=t.track||this.markerDetails.track||"Unknown";return performance.measure(u,{start:e,end:n,detail:{devtools:{dataType:"track-entry",trackGroup:r,track:s,color:i,properties:a.length>0?a.map(d=>[d.name,d.value]):void 0,tooltipText:l}}}),this};this.debugId=t}static create(t){return new o(t)}get startTimestamp(){return this.markerDetails.startTs}get track(){let t=this;return Object.keys(Ao).reduce((e,n)=>{let i={start:t.start,end:r=>t.end({...r,track:Ao[n].track,label:r.label}),get label(){let r=Ao[n];return Object.keys(r.labels).reduce((a,l)=>{let u={start:t.start,end:s=>t.end({...s,track:r.track,label:r.labels[l]})};return Object.defineProperty(a,l,{get:()=>(t.markerDetails.label=r.labels[l],u)}),a},{})}};return Object.defineProperty(e,n,{get:()=>{let r=Ao[n];return t.markerDetails.track=r.track,i}}),e},{})}};function gt(o){return ea.create(o)}function Wn(o){if(o==null)return!1;let t=o;return!0}function na(o,t){return o&&o.filter(e=>{let n=t[e.filter.type];return!(!n||n.emptyValues&&n.emptyValues.includes(e.filter.value))})}var zt=(o,t,e)=>{for(let n=0,i=e.length;n<i;n++){let r=e[n],a=o[r],l=t[r];if(a!==l)return!0}return!1};function ta(){return!1}function jm(o,t,e,n,i,r){let a={dataSourceHasGrouping:!1,isTreeNode:!1,data:o,id:t,indexInAll:e,isGroupRow:!1,selfLoaded:!0,rowSelected:!1,rowDisabled:!1,isCellSelected:ta,hasSelectedCells:ta};return n&&(a.rowSelected=n(a)),i&&(a.rowDisabled=i(a)),r&&(a.isCellSelected=l=>r.isCellSelected(a.id,l),a.hasSelectedCells=l=>r.isCellSelectionInRow(a.id,l)),a}var $m=Ft(()=>{console.warn(`Your "treeFilterFunction" should NOT MUTATE the data object. You're probably mutating the node children.
|
|
1
|
+
"use strict";var zp=Object.create;var Wo=Object.defineProperty;var Vp=Object.getOwnPropertyDescriptor;var Gp=Object.getOwnPropertyNames;var Kp=Object.getPrototypeOf,Bp=Object.prototype.hasOwnProperty;var Hp=(o,t)=>()=>(t||o((t={exports:{}}).exports,t),t.exports),Wp=(o,t)=>{for(var e in t)Wo(o,e,{get:t[e],enumerable:!0})},nl=(o,t,e,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Gp(t))!Bp.call(o,i)&&i!==e&&Wo(o,i,{get:()=>t[i],enumerable:!(n=Vp(t,i))||n.enumerable});return o};var po=(o,t,e)=>(e=o!=null?zp(Kp(o)):{},nl(t||!o||!o.__esModule?Wo(e,"default",{value:o,enumerable:!0}):e,o)),jp=o=>nl(Wo({},"__esModule",{value:!0}),o);var Gn=Hp((wT,Bs)=>{"use strict";Bs.exports=function(o,t,e,n,i){var r,a;if(n===void 0)n=0;else if(n=n|0,n<0||n>=o.length)throw new RangeError("invalid lower bound");if(i===void 0)i=o.length-1;else if(i=i|0,i<n||i>=o.length)throw new RangeError("invalid upper bound");for(;n<=i;)if(r=n+(i-n>>>1),a=+e(o[r],t,r,o),a<0)n=r+1;else if(a>0)i=r-1;else return r;return~n}});var Iy={};Wp(Iy,{CellSelectionState:()=>Be,DataSource:()=>Ei,DataSourceInjectionKeyForVue:()=>Zn,DeepMap:()=>$,FlashingColumnCell:()=>Ip,GroupRowsState:()=>St,InfiniteTable:()=>pr,InfiniteTableClassName:()=>Tp,InfiniteTableDetailRow:()=>cr,InfiniteTableInjectionKeyForVue:()=>Kn,Menu:()=>At,NumberFilterEditor:()=>mi,RowDetailState:()=>bt,RowSelectionState:()=>_e,StringFilterEditor:()=>Bn,TreeDataSource:()=>xp,TreeExpandState:()=>nt,TreeGrid:()=>Rp,TreeSelectionState:()=>Qe,components:()=>vy,createFlashingColumnCellComponent:()=>Xa,debounce:()=>en,defaultFilterTypes:()=>On,flatten:()=>ku,group:()=>Ci,keyboardShortcuts:()=>Pp,toTreeDataArray:()=>oa,useDataSourceContext:()=>Jn,useGetMasterDetailContextForVue:()=>_i,useInfiniteColumnCell:()=>ao,useInfiniteColumnEditor:()=>Wa,useInfiniteColumnFilterEditor:()=>Hn,useInfiniteHeaderCell:()=>_o,useInfiniteTableContext:()=>qe,useOverlay:()=>Dt,withSelectedLeafNodesOnly:()=>Za});module.exports=jp(Iy);function en(o,{wait:t}){let e=null;return function(...n){let i=this;e!==null&&clearTimeout(e),e=setTimeout(()=>{o.apply(i,n)},t)}}var Le=require("vue");var tt=require("vue");function ol(o,t){let e=new Set;function n(...i){let r=t?t.getProxyTargetFromArgs(...i):i[0];e.clear();let a={get:function(d,s){return e.add(s),d[s]}},l=new Proxy(r,a),u=t?t.putProxyToArgs(l,...i):[l];return o.apply(this,u)}return{fn:n,propertyReads:e}}var yr=o=>o&&o.substr(0,1).toUpperCase()+o.substr(1);function mo(o){return o!==void 0}function ho(o,t){let e=t[o];return mo(e)}var br=(o,t,e)=>{let n=o[t];typeof n=="function"&&n(...e)};function $p(o,t,e){let n={};for(let i in o)if(o.hasOwnProperty(i)){let r=o[i],a=ho(i,t)?t[i]:t[`default${yr(i)}`];typeof r=="function"&&(a=r(a,e)),n[i]=a}return n}function il(o,t,e){let{fn:n,propertyReads:i}=ol(o,{getProxyTargetFromArgs:a=>a.props,putProxyToArgs:(a,l)=>[{...l,props:a}]}),r=n(t);return i.forEach(a=>e.add(a)),r}function rl(o){let{props:t,initialSetupState:e,propsToForward:n,parentState:i,mapPropsToState:r,propsToStateSet:a}=o,l={};n&&(l=$p(n,t,e));let u={...e,...l};if(r){let d=il(r,{props:t,state:u,oldState:null,parentState:i},a);return{...u,...d}}return u}function al(o,t,e){let{getProps:n,getParentState:i,mapPropsToState:r,concludeReducer:a,propsToStateSet:l}=e;if(t.type==="REPLACE_STATE")return t.payload;let u=i?.()??null,d=t.payload.mappedState,s=t.payload.updatedPropsToState,c={...o};if(d&&Object.assign(c,d),r){let m=il(r,{props:n(),state:c,oldState:o,parentState:u},l);Object.assign(c,m)}return t.type==="ASSIGN_STATE"&&Object.assign(c,t.payload),a?a({previousState:o,state:c,updatedProps:s,parentState:u}):c}function ll(o){let{dispatch:t,getState:e,getProps:n,propsToForward:i,allowedControlledPropOverrides:r,interceptedActions:a,mappedCallbacks:l,notify:u=br}=o,d=e();return Object.keys(d).reduce((s,c)=>{let f=c;return Object.defineProperty(s,c,{set:p=>{let h=n(),y=e(),C=!0;if(a&&typeof a[f]=="function"&&a[f](p,{actions:s,state:y})===!1&&(C=!1),C){let w=[p],T=`on${yr(c)}Change`;if(l&&l[f]){let P=l[f](p,y);T=P.callbackName||T,w=P.callbackParams}u(h,T,w)}let b=i[f];typeof b=="function"&&(p=b(p));let S=!!r?.[f];ho(c,h)&&!S||t({payload:{updatedProps:null,mappedState:{[c]:p}}})}}),s},{})}function sl(o){let{currentProps:t,prevProps:e,state:n,propsToForward:i,propsToStateSet:r}=o,a={},l=0,u={},d=0,s={},c=0;return new Set([...Object.keys(t),...Object.keys(e)]).forEach(m=>{let p=m,h=e[p],y=t[p];if(p!=="children"&&h!==y&&(s[p]={newValue:y,oldValue:h},c++,ho(p,t)||ho(p,e)))if(i.hasOwnProperty(m)){let C=y,b=i[m];typeof b=="function"&&(C=b(y)),n[p]!==C&&(a[p]=C,l++)}else r.has(m)&&(u[p]=t[p],d++)}),{newMappedState:a,newMappedStateCount:l,updatedPropsToState:u,updatedPropsToStateCount:d,rawUpdatedProps:s,rawUpdatedPropsCount:c}}function Up(o){return(t,e,n)=>{if(br(t,e,n),o){let i=/^on([A-Z].*)Change$/.exec(e);if(i){let r=i[1].charAt(0).toLowerCase()+i[1].slice(1);o(`update:${r}`,n[0])}}}}function _n(o){let t=o.injectionKey??Symbol("managed-component-state");function e(r){let a=(0,tt.getCurrentInstance)(),l=()=>({...r}),u=o.initSetupState?o.initSetupState(l()):{},d=new Set,s=o.forwardProps?o.forwardProps(u,l()):{},c=o.getParentState?o.getParentState():null,f=()=>c==null?null:(0,tt.isRef)(c)?(0,tt.unref)(c)??null:typeof c=="function"?c()??null:c,m=rl({props:l(),initialSetupState:u,propsToForward:s,parentState:f(),mapPropsToState:o.mapPropsToState,propsToStateSet:d}),p=(0,tt.shallowRef)(m),h=()=>m,y=l,C=T=>{m=al(m,T,{getProps:y,getParentState:f,mapPropsToState:o.mapPropsToState,concludeReducer:o.concludeReducer,propsToStateSet:d}),p.value=m},b=Up(a?(T,...P)=>a.emit(T,...P):void 0),S=ll({dispatch:C,getState:h,getProps:y,propsToForward:s,allowedControlledPropOverrides:o.allowedControlledPropOverrides,interceptedActions:o.interceptActions,mappedCallbacks:o.mappedCallbacks,notify:b});return(0,tt.watch)(()=>({props:l(),parentState:f()}),(T,P)=>{let R=T.props,E=P.props,N=T.parentState!==P.parentState,{newMappedState:v,newMappedStateCount:D,updatedPropsToState:M,updatedPropsToStateCount:A,rawUpdatedProps:x,rawUpdatedPropsCount:F}=sl({currentProps:R,prevProps:E,state:p.value,propsToForward:s,propsToStateSet:d}),_=!1;if(A>0||D>0){let O={payload:{mappedState:D?v:null,updatedPropsToState:A?M:null}},L=p.value;if(C(O),_=!0,o.onPropChange){for(let K in x)if(x.hasOwnProperty(K)){let{newValue:B,oldValue:G}=x[K];o.onPropChange({name:K,newValue:B,oldValue:G},R,S,L)}}o.onPropsChange&&F&&o.onPropsChange(x,R,S,L)}N&&T.parentState!=null&&!_&&C({type:"PARENT_STATE_CHANGE",payload:{}})},{flush:"post"}),(0,tt.onBeforeUnmount)(()=>{o.cleanup?.(h())}),{contextValue:{state:p,componentActions:S,getComponentState:h,replaceState:T=>{C({type:"REPLACE_STATE",payload:T})},assignState:T=>{C({type:"ASSIGN_STATE",payload:T})},get componentState(){return p.value}},injectionKey:t}}function n(r){let a=e(r);return(0,tt.provide)(t,a.contextValue),a}function i(){return(0,tt.inject)(t)}return{useManagedComponent:e,provideManagedComponent:n,useManagedComponentState:i,injectionKey:t}}function he(o=!1){let t=null,e=[],n=null,i=(r,a)=>{let l=[];if(o)n!=null&&(cancelAnimationFrame(n),n=null),requestAnimationFrame(()=>{t=r,n=null;for(let u=0,d=e.length;u<d;u++)l.push(e[u](r));a?.(l)});else{t=r;for(let u=0,d=e.length;u<d;u++)l.push(e[u](r));a?.(l)}};return i.get=()=>t,i.onChange=r=>(e.push(r),()=>{e=e.filter(a=>a!==r)}),i.destroy=()=>{i(null),e.length=0},i.getListenersCount=()=>e.length,i}function Ft(o){let t=!1,e=null;return(...i)=>(t||(t=!0,e=o(...i)),e)}var ul=(o,t)=>o-t;var jo=(o,t)=>ul(o.revision,t.revision),$=class o{constructor(t){this.map=new Map;this.length=0;this.revision=0;this.emptyKey=Symbol("emptyKey");this.visit=t=>{this.map.forEach((e,n)=>this.visitKey(n,this.map,[],t,!1))};this.visitSome=t=>{this.visitWithNext([],t,!0)};this.visitDepthFirst=t=>{this.visitWithNext([],t,!1)};this.visitWithNext=(t,e,n,i=this.map,r,a)=>{if(!i)return;let l=0,u=i.has(this.emptyKey),d=!a;if(r!==void 0){if(r<0)return;r--}let s=(c,f)=>{let m=i.get(f);if(!m)return;let{map:p}=m,h=f===this.emptyKey;if(h&&!d)return;let y=h?[]:[...t,f],C=p?()=>this.visitWithNext(y,e,n,p,r!==void 0?r-1:void 0):void 0;if(m.hasOwnProperty("value")){let b=e(m.value,y,l,C,m);if(n&&b===!0)return!0;l++}else C?.()};u&&(s(void 0,this.emptyKey),d=!1,l=0);for(let[c,f]of i){let m=s(f,c);if(n&&m===!0)return m}};this.fill(t)}static clone(t){let e=new o;return t.visit((n,i)=>{e.set(i,n.value)}),e}fill(t){t&&t.forEach(e=>{let[n,i]=e;this.set(n,i)})}getValuesStartingWith(t,e){let n=[];return this.getStartingWith(t,(i,r)=>{n.push(r)},e),n}getEntriesStartingWith(t,e){let n=[];return this.getStartingWith(t,(i,r)=>{n.push([i,r])},e),n}getLeafNodesStartingWith(t,e,n){let{respectOrder:i=!1}=n||{},r=[],a=[];return this.getStartingWith(t,(l,u,d)=>{!d.map&&d.hasOwnProperty("value")&&(i?r.push(d):a.push(e(d)))},n),i?r.sort(jo).map(e):a}getKeysForLeafNodesStartingWith(t,e){return this.getLeafNodesStartingWith(t,n=>n.keys,e)}getKeysAndValuesForLeafNodesStartingWith(t,e){return this.getLeafNodesStartingWith(t,n=>[n.keys,n.value],e)}getKeysOfFirstChildOnEachBranchStartingWith(t,e){let{excludeSelf:n,depthLimit:i,respectOrder:r=!0}=e||{},a=[],l=[],u=f=>{r?a.push(f):l.push(f.keys)},d=this.map,s,c=!1;if(t.length)for(let f=0,m=t.length;f<m;f++){let p=t[f];if(s=d.get(p),!s||!s.map)if(c=!0,f===m-1){c=!0;break}else return[];d=s.map}else if(!n&&d.has(this.emptyKey))return[[]];return s&&s.value!==void 0&&(n||(u({...s,keys:t}),c=!0)),c?r?a.sort(jo).map(f=>f.keys):l:(this.visitWithNext(t,(f,m,p,h,y)=>{u({...y,keys:m})},!1,d,i,n),r?a.sort(jo).map(f=>f.keys):l)}getKeysStartingWith(t,e){let n=[];return this.getStartingWith(t,i=>{n.push(i)},e),n}getStartingWith(t,e,n){let{excludeSelf:i,depthLimit:r}=n||{},a=this.map,l,u=!1;if(t.length)for(let d=0,s=t.length;d<s;d++){let c=t[d];if(l=a.get(c),!l||!l.map)if(u=!0,d===s-1){u=!0;break}else return;a=l.map}l&&l.value!==void 0&&(i||e(t,l.value,{...l,keys:t})),!u&&this.visitWithNext(t,(d,s,c,f,m)=>{e(s,d,{...m,keys:s}),f?.()},!1,a,r,i)}getMapAt(t){let e=this.map,n;if(!t.length)return this.map;for(let i=0,r=t.length;i<r;i++){let a=t[i];if(n=e.get(a),!n||!n.map)return;e=n.map}return e}getAllChildrenSizeFor(t){let e=this.map,n;if(!t.length)return this.length;for(let i=0,r=t.length;i<r;i++){let a=t[i];if(n=e.get(a),!n||!n.map)return 0;e=n.map}return n.length}getDirectChildrenSizeFor(t){let e=this.map;t.length||(t=[this.emptyKey]);for(let n=0,i=t.length;n<i;n++){let r=t[n],a=n===i-1,l=e.get(r);if(!l||!l.map)return 0;if(e=l.map,a)return e?.size??0}return 0}set(t,e){let n=this.map;t.length||(t=[this.emptyKey]);for(let i=0,r=t.length;i<r;i++){let a=t[i],l=i===r-1,u=n.get(a)||{length:0};l?(u.revision=this.revision++,u.value=e,n.set(a,u),this.length++):(u.map||(u.map=new Map,n.set(a,u)),u.length++,n=u.map)}return this}get(t){let e=this.map;t.length||(t=[this.emptyKey]);for(let n=0,i=t.length;n<i;n++){let r=t[n],a=n===i-1,l=e.get(r);if(a)return l?l.value:void 0;if(!l||!l.map)return;e=l.map}}get size(){return this.length}clear(){let t=e=>{e.forEach((n,i)=>{let{map:r}=n;r&&t(r)}),e.clear()};t(this.map),this.length=0,this.revision=0}delete(t){let e=this.map;t.length?t=[...t]:t=[this.emptyKey];let n=[e],i=[],r=!1;for(let a=0,l=t.length;a<l;a++){let u=t[a],d=a===l-1,s=e.get(u);if(d){s&&(s.hasOwnProperty("value")&&(delete s.value,delete s.revision,r=!0,i.forEach(c=>{c.length--}),this.length--),s.map&&s.map.size===0&&delete s.map,s.map||e.delete(u));break}else{if(!s||!s.map){r=!1;break}i.push(s),e=s.map,n.push(e)}}for(;n.length;){let a=n.pop(),l=t.length;if(t.pop(),l>0&&a?.size===0){let u=n[n.length-1],d=t[t.length-1],s=u?.get(d);s&&(delete s.map,s.hasOwnProperty("value")||u.delete(d))}}return r}has(t){let e=this.map;t.length||(t=[this.emptyKey]);for(let n=0,i=t.length;n<i;n++){let r=t[n],a=n===i-1,l=e.get(r);if(a)return l?l.hasOwnProperty("value"):!1;if(!l||!l.map)return!1;e=l.map}return!1}visitKey(t,e,n,i,r){let a=e.get(t);if(!a)return;let{map:l}=a,u=t===this.emptyKey?[]:[...n,t],d=Ft(()=>{if(l)for(let[s]of l){let c=this.visitKey(s,l,u,i,r);if(r&&c===!0)return!0}return!1});if(a.hasOwnProperty("value")){let s=i(a,u,d);if(r&&s===!0)return!0}d()}getArray(t){let e=[];return this.visit((n,i)=>{let r=t({...n,keys:i});i.length===0?e.splice(0,0,r):e.push(r)}),e}rawKeysAt(t){let e=this.getMapAt(t);return e?[...e.keys()]:[]}valuesAt(t){let e=this.getMapAt(t);if(!e)return[];let n=[];return e.forEach(i=>{i.value!==void 0&&n.push(i.value)}),n}values(){return this.sortedIterator(t=>t.value)}keys(){return this.sortedIterator(e=>e.keys)}entries(){return this.sortedIterator(t=>[t.keys,t.value])}topDownEntries(){return this.getArray(t=>[t.keys,t.value])}topDownKeys(){return this.getArray(t=>t.keys)}topDownValues(){return this.getArray(t=>t.value)}sortedIterator(t){let e=[];this.visit((i,r)=>{e.push({...i,keys:r})}),e.sort(jo);function*n(){for(let i=0,r=e.length;i<r;i++)yield t(e[i])}return n()}};globalThis.DeepMap=$;function ze(){return globalThis}var Uo=["#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"],dl=Symbol("color"),$o=new WeakMap,Cr=he();function Tr(o=Uo){$o.set(o,o.map(t=>0))}Tr();var qp=(o=Uo)=>{let t=[];$o.has(o)?t=$o.get(o):(t=o.map(n=>0),$o.set(o,t));let e=t.reduce((n,i,r,a)=>i<a[n]?r:n,0);return t[e]!=null&&t[e]++,o[e]??o[0]??Uo[0]},yo=":",Sr="*",cl="-",Yp=",",Xp="debug",Zp="diffdebug",pl=!1,go=new $,bo=new Map;function wr(o,t){let e=o.split(yo),n=new $;n.set(e,!0);let i=t.split(yo),r=new Set(i).has(Sr),a=i.indexOf(Sr),l=r?i.slice(0,a):i;if(n.getKeysStartingWith(l,{excludeSelf:r}).length>0){let u=i.slice(a+1);return u.length?o.endsWith(u.join(yo)):!0}}function ml(o,t){let e=`channel=${o}_permissions=${t}`;if(bo.has(e))return bo.get(e);let n=t.split(Yp);function i(l){return bo.set(e,l),l}let r=[],a=[];n.forEach(l=>{l.includes(Sr)?a.push(l):r.push(l)});for(let l=0;l<r.length;l++){let u=r[l],d=u.startsWith(cl);if(d&&(u=u.substring(cl.length)),wr(o,u))return i(!d)}for(let l=0;l<a.length;l++){let u=a[l],d=u.startsWith("-");if(d&&(u=u.substring(1)),wr(o,u))return i(!d)}return i(!1)}var vr=()=>rt.enable??(ze()&&ze().localStorage?.getItem(Xp))??"",Jp=()=>rt.diffenable??(ze()&&ze().localStorage?.getItem(Zp))??`${pl}`,Ir="",hl=pl;function Rr(o){hl=`${Jp()}`=="true",Ir!==o&&(Ir=o,bo.clear())}function gl(o){Rr(vr()),typeof ze()<"u"&&ze().addEventListener&&ze().addEventListener("storage",function(){Rr(vr())});function t(e,n){let i=n?`${n}${yo}${e}`:e,r=i.split(yo),a=go.get(r);if(a)return a;let l=go.get(r.slice(0,-1)),u=(l?l.logFn:rt.logFn)??yl,d=u,s,c=0,f=()=>s??ml(i,Ir),m=qp(rt.colors),p=Object.defineProperties((...h)=>{let y=Cr.getListenersCount(),C;if(y>0&&(C=C??Date.now(),Cr({color:m,channel:i,args:h,timestamp:C})),f()){if(C=C??Date.now(),c&&hl){let w=C-c;d(`%c[${i}]`,`color: ${m}`,`+${w}ms:`)}c=C;let b=[],S;if(h.forEach(w=>{if(w[dl])S===void 0&&(S=!0),b.push(...w);else{if(typeof w!="string"&&typeof w!="number"){S=!1;return}b.push(`${w}%s`)}}),S){let w=[`%c[${i}]%c %s`,`color: ${m}`,"",...b,""];d(...w)}else d(`%c[${i}]%c %s`,`color: ${m}`,"",...h)}},{channel:{value:i},color:{value:(h,...y)=>{let C=[`%c${y.join(" ")}%c%s`,`color: ${h}`,""];return C.toString=()=>y.join(" "),C[dl]=!0,C}},extend:{value:h=>t(h,i)},enabled:{get:()=>f(),set:h=>{s=h}},logFn:{configurable:!1,get:()=>d,set:h=>{d=h??u}},destroy:{value:()=>{go.delete(r)}}});return go.set(r,p),p}return t(o)}var yl=console.log.bind(console),fl;Object.defineProperty(gl,"enable",{get:()=>fl,set:o=>{fl=o,Rr(vr())}});var rt=gl;rt.colors=Uo;rt.logFn=yl;var Qp=(o,t)=>Cr.onChange(e=>{if(!e)return;let{channel:n,args:i,color:r,timestamp:a}=e;wr(n,o)&&t({channel:n,color:r,args:i,timestamp:a})});rt.onLogIntent=Qp;rt.isChannelEnabled=ml;rt.destroyAll=()=>{Tr(),Tr(rt.colors),go.clear(),bo.clear()};var em=rt("IT:InfiniteTable"),tm="#dc3545",nm="#eb9316";var Cl="Warn",Tl="Error",om="Info",im="Success",rm="Logs",qo=em.extend(rm),eb=qo.extend(om),am=qo.extend(Cl),lm=qo.extend(Tl),tb=qo.extend(im);var sm=nm,um=tm;var dm=(o,t)=>{t=t?t.extend?t.extend(Cl):t:am,t(typeof t.color=="function"?t.color(sm,o):o)},cm=(o,t)=>{t=t?t.extend?t.extend(Tl):t:lm,t(typeof t.color=="function"?t.color(um,o):o)};var bl=new $,Sl=(o,...t)=>{bl.has(t)||(bl.set(t,!0),o())};var Mn=(o,t=o,e)=>{Sl(()=>dm(o,e),t,"warn")},wl=(o,t=o,e)=>{Sl(()=>cm(o,e),t,"error")};function Co(o){return o}function En(o,t){return t.reduce((e,n)=>{let{field:i,valueGetter:r,toKey:a}=n,l=i?o[i]:r?.({data:o,field:i}),u=(a||Co)(l,o);return e.push(u),e},[])}var _e=class o{constructor(t,e,n){this.selectedRows=null;this.deselectedRows=null;this.defaultSelection=!1;this.selectedMap=new $;this.deselectedMap=new $;this.onlyUsePrimaryKeys=!1;this.selectionCache=new $;this.selectionCountCache=new $;this.mapSet=(t,e)=>{Array.isArray(e)||(this.onlyUsePrimaryKeys?e=[e]:e=[...this.getGroupKeysForPrimaryKey(e),e]),this.xcache(),t==="selected"?this.selectedMap.set(e,!0):this.deselectedMap.set(e,!0)};this._selectedMapSet=t=>{this.mapSet("selected",t)};this._deselectedMapSet=t=>{this.mapSet("deselected",t)};let i=t instanceof Object.getPrototypeOf(this).constructor?t.getState():t;this.getConfig=e,this.onlyUsePrimaryKeys=e().onlyUsePrimaryKeys,n&&Object.assign(this,n),this.update(i)}getGroupKeysForPrimaryKey(t){let{indexer:e,groupBy:n}=this.getConfig(),i=e.getDataForPrimaryKey(t);return i?En(i,n):[]}getGroupDeepMap(){return this.getConfig().groupDeepMap}getGroupCount(t){if(t.length==0)return this.getConfig().totalCount;let n=this.getGroupDeepMap()?.get(t);return n?n.totalChildrenCount??(n.items.length||0):0}getGroupKeysDirectlyInsideGroup(t){let{groupDeepMap:e}=this.getConfig();return e?.getKeysStartingWith(t,{excludeSelf:!0,depthLimit:1})||[]}getAllPrimaryKeysInsideGroup(t){let{groupDeepMap:e}=this.getConfig();if(!t.length)return(e?.getKeysStartingWith([],{excludeSelf:!0,depthLimit:1})||[]).map(r=>this.getAllPrimaryKeysInsideGroup(r)).flat();let n=e?.get(t);return n?n.items.map(this.getConfig().toPrimaryKey):[]}getGroupByLength(){return this.getConfig().groupBy.length}static from(t,e,n){return new o(t,e,n)}update(t){this.selectedRows=t.selectedRows||null,this.deselectedRows=t.deselectedRows||null,this.selectedMap.clear(),this.deselectedMap.clear(),this.selectedRows?.forEach(this._selectedMapSet),this.deselectedRows?.forEach(this._deselectedMapSet),this.defaultSelection=t.defaultSelection,this.xcache()}xcache(){this.selectionCache.clear(),this.selectionCountCache.clear()}getState(){let t=i=>{let r=this.getGroupByLength();return i.map(a=>this.onlyUsePrimaryKeys?a[0]:a.length>r?a.pop():a)},e=t(this.selectedMap.topDownKeys()),n=t(this.deselectedMap.topDownKeys());return{defaultSelection:this.defaultSelection,selectedRows:e,deselectedRows:n}}deselectAll(){this.update({defaultSelection:!1,selectedRows:[],deselectedRows:[]})}selectAll(){this.update({defaultSelection:!0,deselectedRows:[],selectedRows:[]})}isRowDefaultSelected(){return this.defaultSelection===!0}isRowDefaultDeselected(){return this.defaultSelection===!1}isRowSelected(t,e){if(this.onlyUsePrimaryKeys)return this.defaultSelection?!this.deselectedMap.has([t]):this.selectedMap.has([t]);e=e||this.getGroupKeysForPrimaryKey(t);let n=[...e,t],i=this.selectionCache.get(n);if(i!==void 0)return i;let r=this.selectedMap.has(n),a=this.deselectedMap.has(n);if(r)return this.selectionCache.set(n,!0),!0;if(a)return this.selectionCache.set(n,!1),!1;if(this.selectedMap.has(e))return this.selectionCache.set(n,!0),!0;if(this.deselectedMap.has(e))return this.selectionCache.set(n,!1),!1;for(e=[...e];e.length;){e.pop();let l=this.selectedMap.has(e),u=this.deselectedMap.has(e);if(l)return this.selectionCache.set(n,!0),!0;if(u)return this.selectionCache.set(n,!1),!1}return this.selectionCache.set(n,this.defaultSelection),this.defaultSelection}isRowDeselected(t,e){return!this.isRowSelected(t,e)}setRowSelected(t,e,n){e?this.setRowAsSelected(t,n):this.setRowAsDeselected(t,n)}getGroupRowSelectionState(t){let e=this.selectionCache.get(t);if(e!==void 0)return e;let{selectedCount:n,deselectedCount:i}=this.getSelectionCountFor(t,this.onlyUsePrimaryKeys?void 0:this.getGroupRowBooleanSelectionStateFromParent(t)),r=n&&i?null:!!n;return this.selectionCache.set(t,r),r}getGroupRowBooleanSelectionStateFromParent(t){if(!t.length)return this.defaultSelection;let e=[...t],n=this.deselectedMap.has(e),i=this.selectedMap.has(e),r=i&&!n?!0:n&&!i?!1:void 0;if(r===void 0)for(;e.length;){if(e.pop(),this.deselectedMap.has(e)){r=!1;break}if(this.selectedMap.has(e)){r=!0;break}}return r===void 0&&(r=this.defaultSelection),r}isGroupRowPartlySelected(t){return this.getGroupRowSelectionState(t)===null}isGroupRowSelected(t){return this.getGroupRowSelectionState(t)===!0}isGroupRowDeselected(t){return this.getGroupRowSelectionState(t)===!1}selectGroupRow(t){if(this.onlyUsePrimaryKeys){this.getAllPrimaryKeysInsideGroup(t).forEach(r=>{this.defaultSelection===!0?this.deselectedMap.delete([r]):this._selectedMapSet(r)}),this.xcache();return}this.selectedMap.getKeysStartingWith(t,{excludeSelf:!0}).forEach(i=>{this.selectedMap.delete(i)}),t.length===1&&this.defaultSelection===!0||this._selectedMapSet(t),this.deselectedMap.getKeysStartingWith(t).forEach(i=>{this.deselectedMap.delete(i)})}deselectGroupRow(t){if(this.onlyUsePrimaryKeys){this.getAllPrimaryKeysInsideGroup(t).forEach(r=>{this.defaultSelection===!1?this.selectedMap.delete([r]):this._deselectedMapSet(r)}),this.xcache();return}this.deselectedMap.getKeysStartingWith(t,{excludeSelf:!0}).forEach(i=>{this.deselectedMap.delete(i)}),t.length===1&&this.defaultSelection===!1||this._deselectedMapSet(t),this.selectedMap.getKeysStartingWith(t).forEach(i=>{this.selectedMap.delete(i)})}setRowAsSelected(t,e){if(this.onlyUsePrimaryKeys){this.defaultSelection?this.deselectedMap.delete([t]):this._selectedMapSet(t),this.xcache();return}e=e||this.getGroupKeysForPrimaryKey(t);let n=[...e,t];this.deselectedMap.delete(n),this.xcache(),this.getGroupRowSelectionState(e)!==!0&&(this._selectedMapSet(n),this.getGroupRowSelectionState(e)===!0&&this.selectGroupRow(e))}setRowAsDeselected(t,e){if(this.onlyUsePrimaryKeys){this.defaultSelection?this._deselectedMapSet(t):this.selectedMap.delete([t]),this.xcache();return}e=e||this.getGroupKeysForPrimaryKey(t);let n=[...e,t];this.selectedMap.delete(n),this.xcache(),this.getGroupRowSelectionState(e)!==!1&&(this._deselectedMapSet(n),this.getGroupRowSelectionState(e)===!1&&this.deselectGroupRow(e))}deselectRow(t,e){this.setRowSelected(t,!1,e)}selectRow(t,e){this.setRowSelected(t,!0,e)}toggleGroupRowSelection(t){this.getGroupRowSelectionState(t)===!0?this.deselectGroupRow(t):this.selectGroupRow(t)}toggleRowSelection(t,e){this.isRowSelected(t,e)?this.deselectRow(t,e):this.selectRow(t,e)}getSelectedCount(){return this.getSelectionCountFor([]).selectedCount}getDeselectedCount(){return this.getSelectionCountFor([]).deselectedCount}getSelectionCountFor(t=[],e){let n=this.selectionCountCache.get(t);if(n!=null)return n;let i=this.getGroupByLength();if(t.length>i){let d=this.isRowSelected(t)?{selectedCount:1,deselectedCount:0}:{selectedCount:0,deselectedCount:1};return this.selectionCountCache.set(t,d),d}if(i&&this.onlyUsePrimaryKeys){let d=this.getAllPrimaryKeysInsideGroup(t),s=0,c=0;d.forEach(m=>{if(this.defaultSelection){if(this.deselectedMap.has([m])){c++;return}s++}else{if(this.selectedMap.has([m])){s++;return}c++}});let f={selectedCount:s,deselectedCount:c};return this.selectionCountCache.set(t,f),f}e=e??this.getGroupRowBooleanSelectionStateFromParent(t);let r=this.getGroupKeysDirectlyInsideGroup(t);if(t.length===this.getGroupByLength()){let d=this.selectedMap.has(t)?!0:this.deselectedMap.has(t)?!1:e,s=this.getGroupCount(t),c=this.selectedMap.getKeysStartingWith(t,{excludeSelf:!0,depthLimit:1}).length,f=this.deselectedMap.getKeysStartingWith(t,{excludeSelf:!0,depthLimit:1}).length,m=s-(c+f),p={selectedCount:c+(d?m:0),deselectedCount:f+(d?0:m)};return this.selectionCountCache.set(t,p),p}let a=0,l=0;if(this.getConfig().lazyLoad&&!r.length){let d=this.getConfig().groupDeepMap?.get(t)?.totalChildrenCount||0;e?(a=d,l=this.deselectedMap.getAllChildrenSizeFor(t),l===d&&(a=0)):(l=d,a=this.selectedMap.getAllChildrenSizeFor(t),a===d&&(l=0))}r.forEach(d=>{let s=this.selectedMap.get(d),c=this.deselectedMap.get(d),f=s?!0:c?!1:e,{selectedCount:m,deselectedCount:p}=this.getSelectionCountFor(d,f);a+=m,l+=p});let u={selectedCount:a,deselectedCount:l};return this.selectionCountCache.set(t,u),u}};var tn=o=>{let t=rt(o?`IT:${o}:TYPE=debug`:"IT:TYPE=debug");return t.logFn=console.log.bind(console),t},nn=o=>{let t=rt(o?`IT:${o}:TYPE=error`:"IT:TYPE=error");return t.logFn=console.error.bind(console),t},To=()=>To;To.extend=()=>To;var ft=class{constructor(t){this.debug=To,this.error=To}};var fm=function(o,t){return o-t},pm=function(o,t){return o=`${o}`,t=`${t}`,o.localeCompare(t)},mm=function(o,t){return o-t},hm={number:fm,string:pm,date:mm},on=hm;var Ke=ze().requestAnimationFrame||(o=>setTimeout(o,16)),hn=ze().cancelAnimationFrame||(o=>clearTimeout(o));function rn(o,t,e){if(o===t)return!0;if(!o||!t)return!1;let n=typeof o;if(n!==typeof t||n!=="object")return!1;var r=Object.keys(o),a=Object.keys(t);e&&(r=r.filter(s=>!e.has(s)),a=a.filter(s=>!e.has(s)));var l=r.length;if(a.length!==l)return!1;for(var u=0;u<l;u++){var d=r[u];if(!(e&&e.has(d))&&(o[d]!==t[d]||!Object.prototype.hasOwnProperty.call(t,d)))return!1}return!0}function Yo(o,t){return new _e(o,at(t))}function at(o){return()=>{let t=typeof o=="function"?o():o;return{lazyLoad:!!t.lazyLoad,toPrimaryKey:t.toPrimaryKey,onlyUsePrimaryKeys:!t.useGroupKeysForMultiRowSelection,groupBy:t.groupBy,groupDeepMap:t.groupDeepMap,indexer:t.indexer,totalCount:t.unfilteredCount}}}function vl(o){let{getDataSourceState:t,dataSourceActions:e}=o;return{get allRowsSelected(){return t().allRowsSelected},selectAll(){let{rowSelection:i,selectionMode:r}=t();if(r!=="multi-row")throw"Selection mode is not multi-row";if(!(i instanceof _e))throw"Invalid row selection";let a=new _e(i,at(t));a.selectAll(),e.rowSelection=a},deselectAll(){let{rowSelection:i,selectionMode:r}=t();if(r!=="multi-row")throw"Selection mode is not multi-row";if(!(i instanceof _e))throw"Invalid row selection";let a=new _e(i,at(t));a.deselectAll(),e.rowSelection=a},isRowSelected(i,r){let{rowSelection:a,selectionMode:l,indexer:u,groupBy:d}=t();if(l==="single-row")return a===i;if(l!=="multi-row")throw"Selection mode is not multi-row or single-row";if(!(a instanceof _e))throw"Invalid row selection";if(!r){let s=u.getDataForPrimaryKey(i);r=s?En(s,d):[]}return a.isRowSelected(i,r)},isRowDeselected(i,r){return!this.isRowSelected(i,r)},selectRow(i,r){let{rowSelection:a,selectionMode:l,indexer:u,groupBy:d}=t();if(l==="single-row"){e.rowSelection=i;return}if(l!=="multi-row")throw"Selection mode is not multi-row or single-row";if(!(a instanceof _e))throw"Invalid row selection";if(!r){let c=u.getDataForPrimaryKey(i);r=c?En(c,d):[]}let s=new _e(a,at(t));s.selectRow(i,r),e.rowSelection=s},deselectRow(i,r){let{selectionMode:a,rowSelection:l,indexer:u,groupBy:d}=t();if(a==="single-row"){e.rowSelection=null;return}if(a!=="multi-row")throw"Selection mode is not multi-row or single-row";if(!(l instanceof _e))throw"Invalid row selection";if(a==="multi-row"){if(!r){let c=u.getDataForPrimaryKey(i);r=c?En(c,d):[]}let s=new _e(l,at(t));s.deselectRow(i,r),e.rowSelection=s}},toggleRowSelection(i,r){this.isRowSelected(i,r)?this.deselectRow(i,r):this.selectRow(i,r)},selectGroupRow(i){let{selectionMode:r,rowSelection:a,groupBy:l}=t();if(r!=="multi-row")throw'Selection mode should be "multi-row"';if(!l)throw"No grouping specified";if(!(a instanceof _e))throw"Invalid row selection";let u=new _e(a,at(t));u.selectGroupRow(i),e.rowSelection=u},deselectGroupRow(i){let{selectionMode:r,rowSelection:a,groupBy:l}=t();if(r!=="multi-row")throw'Selection mode should be "multi-row"';if(!l)throw"No grouping specified";if(!(a instanceof _e))throw"Invalid row selection";let u=new _e(a,at(t));u.deselectGroupRow(i),e.rowSelection=u},toggleGroupRowSelection(i){let{selectionMode:r,rowSelection:a,groupBy:l}=t();if(r!=="multi-row")throw'Selection mode should be "multi-row"';if(!l)throw"No grouping specified";if(!(a instanceof _e))throw"Invalid row selection";let u=new _e(a,at(t));u.toggleGroupRowSelection(i),e.rowSelection=u},getGroupRowSelectionState(i,r){let a=t(),{selectionMode:l,groupBy:u}=a,d=r?new _e(r,at(a)):a.rowSelection;if(l!=="multi-row")throw'Selection mode should be "multi-row"';if(!u)throw"No grouping specified";if(!(d instanceof _e))throw"Invalid row selection";return d.getGroupRowSelectionState(i)},getSelectedPrimaryKeys:i=>{let r=t(),a=i?new _e(i,at(r)):r.rowSelection,l=[];return r.lazyLoad&&console.error("getSelectedPrimaryKeys should not be called for lazy-loaded datasources as it wont return reliable results"),r.originalDataArray.forEach(u=>{let d=r.toPrimaryKey(u);a.isRowSelected(d)&&l.push(d)}),l}}}var xr=new WeakMap,gm=o=>o;function Il(o,t=50,e){xr.set(o,{lastCallTime:0,lastCallArg:null});let n=e??gm;return i=>{let{lastCallTime:r,lastCallArg:a}=xr.get(o)||{lastCallTime:0,lastCallArg:null},l=Date.now(),u=l-r,d=rn(n(a),n(i));u<t&&d||(xr.set(o,{lastCallTime:l,lastCallArg:i}),o(i))}}var ym="*",Be=class{constructor(t){this.wildcard=ym;this.cache=new $;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 e=t&&t instanceof Object.getPrototypeOf(this).constructor?t.getState():t;e&&this.update(e)}selectCell(t,e){this.setCellSelected(t,e,!0)}deselectCell(t,e){this.setCellSelected(t,e,!1)}selectColumn(t){this.setCellSelected(this.wildcard,t,!0)}deselectColumn(t){this.setCellSelected(this.wildcard,t,!1)}setCellSelected(t,e,n){let i=t===this.wildcard,r=e===this.wildcard;if(this.isCellSelected_Internal(t,e)===n)return;let l=[];if(i){let d=this.deselectedColumnsToRows.get(e),s=this.selectedColumnsToRows.get(e);d?.forEach(c=>{c!==this.wildcard&&this.setCellInDeselection(c,e,!1)}),s?.forEach(c=>{c!==this.wildcard&&this.setCellInSelection(c,e,!1)}),[...this.cache.keys()].forEach(c=>{let[f,m]=c;m===e&&l.push([f,e])})}if(r){let d=this.deselectedRowsToColumns.get(e),s=this.selectedRowsToColumns.get(e);d?.forEach(c=>{c!==this.wildcard&&this.setCellInDeselection(t,c,!1)}),s?.forEach(c=>{c!==this.wildcard&&this.setCellInSelection(t,c,!1)}),[...this.cache.keys()].forEach(c=>{let[f]=c;f===t&&l.push([t,e])})}let u=[t,e];if(l.forEach(d=>{this.cache.delete(d)}),this.cache.delete(u),n)if(this.defaultSelection){let d=this.deselectedRowsToColumns.get(t);d&&d.has(e)&&this.setCellInDeselection(t,e,!1);let s=this.deselectedRowsToColumns.get(this.wildcard),c=this.deselectedColumnsToRows.get(this.wildcard);(s?.has(e)||c?.has(t))&&this.setCellInSelection(t,e,!0)}else{let d=this.deselectedRowsToColumns.get(t);d&&d.has(e)&&this.setCellInDeselection(t,e,!1),this.setCellInSelection(t,e,!0)}else if(this.defaultSelection)this.selectedRowsToColumns.get(t)?.has(e)&&this.setCellInSelection(t,e,!1),this.setCellInDeselection(t,e,!0);else{this.selectedRowsToColumns.get(t)?.has(e)&&this.setCellInSelection(t,e,!1);let s=this.selectedRowsToColumns.get(this.wildcard),c=this.selectedColumnsToRows.get(this.wildcard);if(s?.has(e)||c?.has(t)){this.setCellInDeselection(t,e,!0);return}}}setCellInDeselection(t,e,n){if(n){let i=this.deselectedRowsToColumns.get(t)||new Set;i.add(e),this.deselectedRowsToColumns.set(t,i)}else{let i=this.deselectedRowsToColumns.get(t);i&&(i.delete(e),i.size===0&&this.deselectedRowsToColumns.delete(t))}if(n){let i=this.deselectedColumnsToRows.get(e)||new Set;i.add(t),this.deselectedColumnsToRows.set(e,i)}else{let i=this.deselectedColumnsToRows.get(e);i&&(i.delete(t),i.size===0&&this.deselectedColumnsToRows.delete(e))}}setCellInSelection(t,e,n){if(t===this.wildcard&&e===this.wildcard)throw new Error("rowId and colId cannot be used as a wildcard at the same time!");if(n){let i=this.selectedRowsToColumns.get(t)||new Set;i.add(e),this.selectedRowsToColumns.set(t,i)}else{let i=this.selectedRowsToColumns.get(t);i&&(i.delete(e),i.size===0&&this.selectedRowsToColumns.delete(t))}if(n){let i=this.selectedColumnsToRows.get(e)||new Set;i.add(t),this.selectedColumnsToRows.set(e,i)}else{let i=this.selectedColumnsToRows.get(e);i&&(i.delete(t),i.size===0&&this.selectedColumnsToRows.delete(e))}}update(t){let e=t.selectedCells||null,n=t.deselectedCells||null;this.selectedRowsToColumns.clear(),this.selectedColumnsToRows.clear(),this.deselectedRowsToColumns.clear(),this.deselectedColumnsToRows.clear(),this.cache.clear(),e&&e.forEach(([i,r])=>{this.setCellInSelection(i,r,!0)}),n&&n.forEach(([i,r])=>{this.setCellInDeselection(i,r,!0)}),this.defaultSelection=t.defaultSelection}isCellSelectionInRow(t,e){if(this.defaultSelection){let i=this.deselectedRowsToColumns.get(t);if(i){if(i.has(this.wildcard)){let r=this.selectedRowsToColumns.get(t);return r&&r.size>0?e.some(a=>r.has(a)):!1}return e.some(r=>!i.has(r))}return!0}let n=this.selectedRowsToColumns.get(t);if(n){if(n.has(this.wildcard)){let i=this.deselectedRowsToColumns.get(t);return i&&i.size>0?!e.every(a=>i.has(a)):!0}return e?e.some(i=>n.has(i)):!1}return!1}error(t){nn(`${this.debugId}:CellSelectionState`)(t)}isCellSelected(t,e){return t===this.wildcard||e===this.wildcard?(this.error("CellSelectionState.isCellSelected should not be called with wildcard"),!1):this.isCellSelected_Internal(t,e)}isCellSelected_Internal(t,e){let n=[t,e],{cache:i}=this,r=i.get(n);if(r!=null)return r;let a=()=>(i.set(n,!1),!1),l=()=>(i.set(n,!0),!0),u=this.deselectedColumnsToRows.get(this.wildcard),d=this.deselectedRowsToColumns.get(this.wildcard),s=this.selectedColumnsToRows.get(this.wildcard),c=this.selectedRowsToColumns.get(this.wildcard);if(this.defaultSelection){let p=this.deselectedRowsToColumns.get(t);return p&&p.has(e)?a():u?.has(t)||d?.has(e)?this.selectedRowsToColumns.get(t)?.has(e)?l():a():l()}let m=this.selectedRowsToColumns.get(t);return m&&m.has(e)?l():s?.has(t)||c?.has(e)?this.deselectedRowsToColumns.get(t)?.has(e)?a():l():a()}getState(){let t=[],e=[];return this.deselectedRowsToColumns.forEach((n,i)=>{n.forEach(r=>{t.push([i,r])})}),this.selectedRowsToColumns.forEach((n,i)=>{n.forEach(r=>{e.push([i,r])})}),{defaultSelection:this.defaultSelection,deselectedCells:t,selectedCells:e}}};var Wn=require("vue");var Ie=require("vue");var te=(...o)=>o.filter(t=>!!`${t}`).join(" ");var Rl="_16lm1iw2 _16lm1iw23 _16lm1iw26 _16lm1iw2c _16lm1iw2a",xl={center:"_16lm1iw2j",stretch:"_16lm1iw2k",start:"_16lm1iw2l",end:"_16lm1iw2m"};var Tt="_16lm1iw3b _16lm1iw3c _16lm1iw35",Pl={pointer:"_16lm1iwk",default:"_16lm1iwl",colResize:"_16lm1iwm",grabbing:"_16lm1iwn",grab:"_16lm1iwo"},Xo={flex:"_16lm1iw1p",contents:"_16lm1iw1q",none:"_16lm1iw1r",block:"_16lm1iw1s",grid:"_16lm1iw1t",inlineBlock:"_16lm1iw1u",inlineFlex:"_16lm1iw1v",inlineGrid:"_16lm1iw1w"};var Dl={1:"_16lm1iw1c",none:"_16lm1iw1d"},Pr={column:"_16lm1iw2f",columnReverse:"_16lm1iw2g",row:"_16lm1iw2h",rowReverse:"_16lm1iw2i"};var Al={0:"_16lm1iw1y","100%":"_16lm1iw1z","50%":"_16lm1iw20"},_l={center:"_16lm1iw30",spaceBetween:"_16lm1iw31",spaceAround:"_16lm1iw32",start:"_16lm1iw33",end:"_16lm1iw34"},Ml={0:"_16lm1iw26","100%":"_16lm1iw27","50%":"_16lm1iw28",auto:"_16lm1iw29"};var El={none:"_16lm1iwd"},Zo={hidden:"_16lm1iw35",auto:"_16lm1iw36",visible:"_16lm1iw37"};var Fl={relative:"_16lm1iw1",absolute:"_16lm1iw2",static:"_16lm1iw3",sticky:"_16lm1iw4",fixed:"_16lm1iw5"};var Nl={0:"_16lm1iw23","100%":"_16lm1iw24","50%":"_16lm1iw25"};var Ol={none:"_16lm1iw1x"};var kl={visible:"_16lm1iw38",hidden:"_16lm1iw39"};var Ll={1:"_16lm1iw1e",10:"_16lm1iw1f",100:"_16lm1iw1g",1e3:"_16lm1iw1h",1e4:"_16lm1iw1i",1e5:"_16lm1iw1j",1e6:"_16lm1iw1k",1e7:"_16lm1iw1l","1k":"_16lm1iw1m","10k":"_16lm1iw1n","100k":"_16lm1iw1o"};var pt=require("vue");function bm(o,t){if(typeof o!="object"||!o)return o;var e=o[Symbol.toPrimitive];if(e!==void 0){var n=e.call(o,t||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(o)}function Cm(o){var t=bm(o,"string");return typeof t=="symbol"?t:String(t)}function Tm(o,t,e){return t=Cm(t),t in o?Object.defineProperty(o,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):o[t]=e,o}function zl(o,t){var e=Object.keys(o);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(o);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(o,i).enumerable})),e.push.apply(e,n)}return e}function Vl(o){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?arguments[t]:{};t%2?zl(Object(e),!0).forEach(function(n){Tm(o,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(e)):zl(Object(e)).forEach(function(n){Object.defineProperty(o,n,Object.getOwnPropertyDescriptor(e,n))})}return o}function Gl(o,t){var e={};for(var n in o)e[n]=t(o[n],n);return e}var Sm=(o,t,e)=>{for(var n of Object.keys(o)){var i;if(o[n]!==((i=t[n])!==null&&i!==void 0?i:e[n]))return!1}return!0},ve=o=>{var t=e=>{var n=o.defaultClassName,i=Vl(Vl({},o.defaultVariants),e);for(var r in i){var a,l=(a=i[r])!==null&&a!==void 0?a:o.defaultVariants[r];if(l!=null){var u=l;typeof u=="boolean"&&(u=u===!0?"true":"false");var d=o.variantClassNames[r][u];d&&(n+=" "+d)}}for(var[s,c]of o.compoundVariants)Sm(s,i,o.defaultVariants)&&(n+=" "+c);return n};return t.variants=()=>Object.keys(o.variantClassNames),t.classNames={get base(){return o.defaultClassName.split(" ")[0]},get variants(){return Gl(o.variantClassNames,e=>Gl(e,n=>n.split(" ")[0]))}},t};var Kl="_1eexc2a6";var Bl=ve({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:[]}),Hl="_12zfob1q _16lm1iw2 _16lm1iw1k _16lm1iw3b _16lm1iw3c _16lm1iw35",Wl=ve({defaultClassName:"_16lm1iw2 _16lm1iw25 _16lm1iw26 _16lm1iwh _16lm1iwf",variantClassNames:{visible:{true:"_12zfob19",false:"_12zfob1a"}},defaultVariants:{},compoundVariants:[]}),jl=ve({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"]]}),$l=ve({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"]]}),Ul="_12zfob12u _16lm1iw22 _16lm1iw1z";var ql="_12zfob17",Yl="_12zfob12q _16lm1iw1p _16lm1iw2h _16lm1iw2j _16lm1iw1",Xl=ve({defaultClassName:"_12zfob12r _16lm1iw1 _16lm1iw23",variantClassNames:{disabled:{true:"_12zfob12s",false:"_12zfob12t"}},defaultVariants:{},compoundVariants:[]}),Dr=ve({defaultClassName:"_12zfob12n _16lm1iw1p _16lm1iw2h _16lm1iw2k _16lm1iw1",variantClassNames:{active:{true:"_12zfob12o",false:"_12zfob12p"}},defaultVariants:{},compoundVariants:[]}),Zl="_12zfob12m _16lm1iw1p _16lm1iw2h _16lm1iw2j",Jl=ve({defaultClassName:"_12zfob127 _16lm1iw1 _16lm1iw1p _16lm1iw2f _16lm1iw32 _16lm1iw39",variantClassNames:{menuVisible:{true:"_12zfob128"},reserveSpaceWhenHidden:{true:"_12zfob129",false:"_12zfob12a"}},defaultVariants:{},compoundVariants:[[{menuVisible:!0,reserveSpaceWhenHidden:!1},"_12zfob12b"]]}),Ql="_12zfob1b _16lm1iw2",es="_16lm1iw1",ts="_12zfob16",ns=ve({defaultClassName:"_12zfob12",variantClassNames:{align:{start:"_12zfob13",center:"_12zfob14",end:"_12zfob15"}},defaultVariants:{},compoundVariants:[]}),os="_12zfob12l _16lm1iw35 _16lm1iw1 _16lm1iw1p _16lm1iw2h";var ht="InfiniteIcon";var is="_1nnkya20 _16lm1iw1p _16lm1iw2f _16lm1iw1 _16lm1iw32 _16lm1iw2j";var rs={transition:"width 0.25s, opacity 0.25s"},as=Object.keys({size:1,lineWidth:1,lineStyle:1,style:1,className:1,index:1});var Fn=(0,pt.defineComponent)(o=>{let t=(0,pt.ref)(0),e=null;return(0,pt.onMounted)(()=>{e=requestAnimationFrame(()=>{e=null,t.value=1})}),(0,pt.onBeforeUnmount)(()=>{e!=null&&cancelAnimationFrame(e)}),()=>{let{lineWidth:n=1,className:i,index:r}=o,a=r!=null&&r>0,l=o.size??16,u=Math.floor(l/4),d=[l-1*u,l-2*u,l-3*u],s={...rs,borderTop:`${n}px solid currentColor`,...o.lineStyle,opacity:t.value};return(0,pt.h)("div",{"data-name":"filter-icon",style:{...o.style,width:`${l}px`},class:te(i,ht,is,`${ht}-filter`)},[a?(0,pt.h)("div",{"data-name":"index",class:ql},`${r}`):null,(0,pt.h)("div",{style:{width:`${d[0]}px`,...s}}),(0,pt.h)("div",{style:{width:`${d[1]}px`,...s}}),(0,pt.h)("div",{style:{width:`${d[2]}px`,...s}})])}},{name:"FilterIcon",props:[...as]});var Jo=Object.freeze({}),wm={string:Jo,number:{}};function Nn(o,t){let e=t.default||Jo;return o.type===void 0?e:o.type===null?Jo:typeof o.type=="string"?t[o.type]||wm[o.type]||Jo:o.type.reduce((n,i)=>Object.assign(n,t[i]),{})}var _r=o=>{let{availableSize:t,items:e,minSize:n,maxSize:i}=o;if(t<0)throw"The provided availableSize cannot be negative!";let r=0,a=0,l=0,u=[],d=[];e.forEach((R,E)=>{let N=R.maxSize??i??void 0,v=R.minSize??n??void 0;u.push(v),d.push(N),R.size!=null&&(N!=null&&R.size>N&&(R.size=N),v!=null&&R.size<v&&(R.size=v));let D=R.flex==0?null:R.flex;if(R.size==null&&D==null)throw`Items must specify either a size or a flex property. Item at index ${E} doesn't have either of those.`;D!=null&&(l+=1),a+=D??0,r+=R.size??0});let s=o.computeSpecialSpaceDistribution?Math.max(t,0):Math.max(t-r,0),c=s/a,f={},m={},p=0;e.forEach((R,E)=>{if(R.flex!=null){let N=c*R.flex,v=R.maxSize??i??void 0,D=R.minSize??n??void 0,M=!1,A=0;v!=null&&N>v&&(f[E]=!0,M=!0,A=v),D!=null&&N<D&&(m[E]=!0,M=!0,A=D),M&&(p+=1,l-=1,a-=R.flex,s-=A)}}),p&&(c=s/a);let h=[],y=0,C=s,b=a,S=0,w=0,T=[];return{items:e.map((R,E)=>{let N={...R},v=R.maxSize??i??void 0,D=R.minSize??n??void 0,M=0,A=f[E],x=m[E],F=A||x,_=R.size??0;if(R.flex!=null){if(F)x&&(M=D),A&&(M=v);else{y+=1;let O=L=>(v!=null&&L>v&&(L=v),D!=null&&L<D&&(L=D),L);y===l?M=O(C):(M=O(Math.round(R.flex*c)),w+=M,C=s-w,b-=R.flex,c=C/b)}_=M,N.flexSize=M}return h.push(M),T.push(_),N.computedSize=_,S+=_,N}),flexSizes:h,minSizes:u,maxSizes:d,computedSizes:T,remainingSize:Math.round(t-S)}};function Qo(o,t,e,n){return t!=null&&o<=t?{value:t,clamped:"min",diff:(o-t)*n}:e!=null&&o>=e?{value:e,clamped:"max",diff:(e-o)*n}:{value:o,clamped:!1,diff:0}}function ss(o,t,e){let n=!1,i=0;for(let r of o)r.computedFlex&&(n=!0),i+=r.computedWidth;return n&&Math.round(i)>Math.round(t-e)}function Ar(o,t){return o.computedFlex&&!t?"flex":"width"}function So(o,t,e){if(t==="width"){let{flex:n,...i}=o??{};return{...i,width:e}}return{...o,flex:e}}var Mr=o=>{let{availableSize:t,reservedWidth:e=0}=o,n=Object.keys(o.columnSizing).reduce((D,M)=>(D[M]={...o.columnSizing[M]},D),{});if(t<0)throw"The provided availableSize cannot be negative!";let i=o.dragHandleOffset,r=o.dragHandlePositionAfter,a=o.dragHandlePositionAfter+1,l=o.items[r],u=o.items[a],d=l.id,s=u?.id,c=ss(o.items,t,e),f=l.computedWidth,m=l.computedMinWidth,p=l.computedMaxWidth,h=Ar(l,c),y=u?.computedWidth,C=u?.computedMinWidth,b=u?.computedMaxWidth,S=u?Ar(u,c):"width",w=!1,T=!1,P=i>0?1:-1,{value:R,clamped:E,diff:N}=Qo(Math.round(f+i),m,p,P);if(o.shareSpaceOnResize){if(u==null)return n[d]=So(n[d],h,R),T=E==="min",w=E==="max",{adjustedDiff:R-f,reservedWidth:e,columnSizing:n,minReached:T,maxReached:w,constrained:T||w};let{value:D,clamped:M,diff:A}=Qo(Math.round(y-i),C,b,P);if(E&&M&&(Math.abs(N)>Math.abs(A)?M=!1:E=!1),!(!E&&!M)){if(E){let x=Qo(Math.round(y-i-N),C,b,P);D=x.value,M=x.clamped,A=x.diff}else if(M){let x=Qo(Math.round(f+i+A),m,p,P);R=x.value,E=x.clamped,N=x.diff}}n[d]=So(n[d],h,R),n[s]=So(n[s],S,D),T=E==="min"||M==="min",w=E==="max"||M==="max"}else n[d]=So(n[d],h,R),T=E==="min",w=E==="max";let v=R-f;return{adjustedDiff:v,reservedWidth:o.shareSpaceOnResize?e:Math.round(e-v),columnSizing:n,minReached:T,maxReached:w,constrained:T||w}};function ls(o,t){return o+t}function vm(o){return Object.keys(o).reduce((e,n)=>(e[n]={...o[n]},e),{})}var us=o=>{let{availableSize:t,reservedWidth:e=0}=o,n=Object.keys(o.columnSizing).reduce((b,S)=>(b[S]={...o.columnSizing[S]},b),{});if(t<0)throw"The provided availableSize cannot be negative!";let i=o.dragHandleOffset,r=[...new Array(o.columnGroupSize)].map((b,S)=>o.dragHandlePositionAfter-S).reverse(),a=r.map(b=>o.items[b]),l=a.map(b=>b.computedWidth),u=ss(o.items,t,e),d=a.map(b=>Ar(b,u)),s=0,{computedSizes:c}=_r({items:a.map(b=>(b.resizable===!1&&(s+=b.computedWidth),{maxSize:b.computedMaxWidth,minSize:b.computedMinWidth,flex:b.resizable?b.computedWidth:null,size:0})),computeSpecialSpaceDistribution:!0,availableSize:Math.max(l.reduce(ls,0)+i-s,0)}),f=a.map((b,S)=>c[S]-b.computedWidth),m=!0,p=!0,h=!0,y=[];f.forEach((b,S)=>{let w=a[S];if(!w.resizable){y.push(0);return}let T=d[S],P=l[S],R=vm(n),{maxReached:E,minReached:N,constrained:v,adjustedDiff:D}=Mr({availableSize:o.availableSize,reservedWidth:o.reservedWidth,dragHandleOffset:b,dragHandlePositionAfter:r[S],shareSpaceOnResize:!1,items:o.items,columnSizing:R});n[w.id]=So(R[w.id],T,Math.round(P+D)),y.push(D),E||(p=!1),N||(m=!1),v||(h=!1)});let C=y.reduce(ls,0);return{minReached:m,maxReached:p,constrained:h,adjustedDiffs:y,adjustedDiff:C,columnSizing:n,reservedWidth:Math.round(e-C)}};var ei;function Nt(){if(ei!=null)return ei;let o=ze().document??null;if(!o)return 0;let t=o.createElement("div");t.style.visibility="hidden",t.style.overflow="scroll",o.body.appendChild(t);let e=o.createElement("div");return t.appendChild(e),ei=t.offsetWidth-e.offsetWidth,t.parentNode?.removeChild(t),ei}var ds=["start",void 0,"end"],cs=(o,t)=>(t&&Object.keys(t).length>0&&o.sort((e,n)=>{let i=t[e],r=t[n];return i===!0&&(i="start"),r===!0&&(r="start"),i==r?0:ds.indexOf(i)-ds.indexOf(r)}),o);function fs(o,t,...e){let n=t;return e.forEach(i=>{for(let r in i)i.hasOwnProperty(r)&&o(i[r],r)&&(n[r]=i[r])}),n}function Er(o,...t){return fs(e=>e!=null,o,...t)}function ps(o,t,...e){return fs((n,i)=>!(i in o),t,...e)}var ti=!0,Im=!0,Rm=!0,ms="string",Ut="unknown";var xm=nn("getComputedVisibleColumns"),Pm=(o,t,e)=>o[e]!==!1,Fr=(o,t)=>{if(!t)return!1;let e=t[o];return e==="start"||e===!0?"start":e==="end"?"end":!1};function gn(o,t){if(o)return o[t]?o[t]:Object.values(o).find(e=>e.field===t)}function Dm(o,t){let e=Nn(o,t);return o.sortType?o.sortType:e.sortType?e.sortType:typeof o.type=="string"?o.type:ms}function Am(o,t,e){let i=(Array.isArray(o)?o:o?[o]:[]).flatMap(r=>{let a=r.field??r.groupField;if(!a)return[Ut];let l=gn(t,a);if(!l)return[Ut];let u=Dm(l,e);return Array.isArray(u)?u:[u]});return i.every(r=>r===Ut)?Ut:i.length===1?i[0]:i}function Nr(o,t){let{colType:e,sortable:n,columnDefaultSortable:i}=t,r=o.defaultSortable??e.defaultSortable,a=!!o.groupByForColumn;if(r==null&&!a){let l=o.field??e.field,u=o.valueGetter??e.valueGetter;l==null&&u==null&&(r=!1)}return n??r??i??ti}var hs=({columns:o,userColumns:t,bodySize:e,columnMinWidth:n,columnMaxWidth:i,columnDefaultWidth:r,columnDefaultFlex:a,scrollbarWidth:l,columnCssEllipsis:u,columnHeaderCssEllipsis:d,pinnedStartMaxWidth:s,pinnedEndMaxWidth:c,filterValue:f,sortable:m,sortInfo:p,multiSort:h,filterTypes:y=On,viewportReservedWidth:C,resizableColumns:b,draggableColumns:S,columnDefaultDraggable:w,columnOrder:T,columnPinning:P,editable:R,columnDefaultEditable:E,columnDefaultFilterable:N,columnDefaultGroupable:v,columnDefaultSortable:D,columnSizing:M,columnTypes:A,columnVisibility:x,columnVisibilityAssumeVisible:F,groupBy:_})=>{let O=0,L={};_.forEach((g,I)=>{g.field&&(L[g.field]=I)});let K=(f||[]).reduce((g,I)=>{let{id:z,field:k}=I;return k&&(g[k]=I),z&&(g[z]=I),g},{}),B=cs(T===!0?Object.keys(o):T,P),G=B.filter(g=>o[g]?Pm(x,F,g):(xm(`Column with id "${g}" specified in columnOrder array cannot be found in the columns map.`),!1)),se=new Map,Y=G.map((g,I)=>{let z=o[g];return se.set(g,I),z}),Ae=(p??[]).reduce((g,I,z)=>(I.id?g[I.id]={sortInfo:I,index:z}:I.field&&(g[I.field]={sortInfo:I,index:z}),g),{});function ge(g){let I=o[g],z=Nn(I,A),k={minWidth:z?.minWidth,maxWidth:z?.maxWidth,width:z?.defaultWidth,flex:z?.defaultFlex},q={width:I?.defaultWidth,flex:I?.defaultFlex,minWidth:I?.minWidth,maxWidth:I?.maxWidth},V=M[g];V?.width!=null&&V.flex==null&&delete q.flex,V?.flex!=null&&V.width==null&&delete q.width;let Q=Er(q,V);Q.width!=null&&delete k.flex,Q.flex!=null&&delete k.width,Q=Er(k,Q);let pe=Q.flex??void 0,ue=Q.minWidth??I?.minWidth??n,me=Q.maxWidth??I?.maxWidth??i,le=pe!=null?void 0:Q.width??(a?void 0:r);return!le&&pe==null&&(a?pe=a:le=ue),{size:le,flex:pe,minSize:ue,maxSize:me}}let Re=_r({availableSize:Math.max(e.width-(C??0)-(l??Nt()),0),maxSize:i,minSize:n,items:G.map(ge)}),{computedSizes:Ge,flexSizes:Oe,minSizes:we,maxSizes:Fe}=Re,ce=[],ee=[],H=[],Z=[];Z.length=G.length;let J=new Map,oe=new Map,re=0,ye=0,be=0,ie=null,W=[],ne=0,Te=0,De=0;Y.forEach((g,I)=>{let z=G[I],k=Ge[I],q=W[I]=Fr(z,P);q==="start"?ne+=k:q==="end"?De+=k:Te+=k});let Me=e.width-De,Ze=[],je=new Map;G.forEach((g,I)=>{let z=Y[I];je.set(g,z)});let fe=[];Object.keys(o).forEach(g=>{let I=o[g];fe.push(g),je.has(g)||je.set(g,I)});let mt=new Map;je.forEach((g,I)=>{let z=se.get(I);z==null&&(z=-1);let k=z!=-1,q=G[z+1],V=Nn(g,A),Q=z,pe=Ae[I]?Ae[I]:g.field?Ae[g.field]??null:null,ue=pe?.sortInfo??null,me=!!ue,le=me&&ue.dir===1,Ce=me&&!le,xe=pe?.index??-1,ae=k?{}:ge(I),Ct=k?Ge[z]:ae.size||0,Ht=k&&Oe[z]||null,Wt=k?we[z]||0:ae.minSize||0,Et=k?Fe[z]||1e4:ae.maxSize||1e4,Ue=k?Fr(I,P):!1,jt=k?z===G.length-1:!1,$t=Q,fo=k?Ue==="start"?ye:Ue==="end"?be:O-ye:0;Ue=="start"?$t=k?Q:-1:Ue==="end"?$t=k?Q-(ce.length+H.length):-1:$t=k?Q-ce.length:-1;let Qt=k?Ue==="start"||Ue===!1?O:Me+be:-1,Dp=k?Ue!==ie:!1,Ap=k?jt||Ue!==Fr(q,P):!1,Ja=g.cssEllipsis??V.cssEllipsis??u,_p=g.headerCssEllipsis??V.cssEllipsis??g.cssEllipsis??V.headerCssEllipsis??d??Ja,Ho=k&&(K[I]||g.field||g.groupByForColumn)&&(K[I]||K[g.field||g.groupByForColumn])||null,Mp=g.defaultFilterable??V.defaultFilterable??N??!0,Ep=R??g.defaultEditable??V.defaultEditable??E??!1,mr=g.dataType||V.dataType||(Array.isArray(g.type)?g.type[0]:g.type)||ms,Fp=g.sortType||V.sortType||mr,Qa=g.filterType||V.filterType||mr,el=!1;if(Ho!=null&&!Ho.disabled){let gr=y[Qa];gr&&(!gr.emptyValues||!gr.emptyValues.includes(Ho.filter.value))&&(el=!0)}let An=g.field??V.field,Np=g.valueGetter??V.valueGetter,hr=g.defaultGroupable??V.defaultGroupable??v??!!An;An||(hr=!1),g.groupByForColumn&&(hr=!1);let tl=An?L[An]!==void 0:!1,Op=tl?L[An]:void 0,kp=Nr(g,{colType:V,sortable:m,columnDefaultSortable:D}),Lp=g.resizable??V.resizable??b??Im,Xe={colType:V,align:V.align,headerAlign:V.headerAlign,computedVisible:k,verticalAlign:V.verticalAlign,defaultHiddenWhenGroupedBy:V.defaultHiddenWhenGroupedBy,valueGetter:Np,valueFormatter:V.valueFormatter,renderValue:V.renderValue,render:V.render,style:V.style,className:V.className,contentFocusable:V.contentFocusable,renderMenuIcon:V.renderMenuIcon,renderSortIcon:V.renderSortIcon,renderRowDetailIcon:V.renderRowDetailIcon,renderSelectionCheckBox:V.renderSelectionCheckBox,renderHeaderSelectionCheckBox:V.renderHeaderSelectionCheckBox,headerStyle:V.headerStyle,headerClassName:V.headerClassName,columnGroup:V.columnGroup,getValueToEdit:V.getValueToEdit,getValueToPersist:V.getValueToPersist,shouldAcceptEdit:V.shouldAcceptEdit,field:An,...g,components:{...V.components,...g.components},computedResizable:Lp,computedMinWidth:Wt,computedMaxWidth:Et,computedFlex:Ht,computedDataType:mr,computedEditable:Ep,computedSortType:Fp,computedFilterType:Qa,cssEllipsis:Ja,headerCssEllipsis:_p,computedFilterValue:Ho,computedFiltered:el,computedFilterable:Mp,computedGroupable:hr,computedGroupedBy:tl,computedGroupedByIndex:Op,computedWidth:Ct,computedAbsoluteOffset:Qt,computedPinningOffset:fo,computedVisibleIndexInCategory:$t,computedOffset:O,computedSortable:kp,computedSortInfo:ue,computedSortIndex:xe,computedMultiSort:h,computedSorted:me,computedSortedAsc:le,computedSortedDesc:Ce,computedVisibleIndex:Q,computedPinned:Ue,computedDraggable:S??g.defaultDraggable??w??Rm,computedFirstInCategory:Dp,computedLastInCategory:Ap,computedFirst:z===0,computedLast:jt,id:I,header:g.header??V.header??g.name??g.field};k&&(O+=Ct,J.set(Xe.id,Xe),Z[z]=Xe,Ue==="start"&&(ce.push(Xe),ye+=Xe.computedWidth),Ue==="end"&&(ee.push(Xe),be+=Xe.computedWidth),Ue||(H.push(Xe),re+=Xe.computedWidth),ie=Ue),Xe.groupByForColumn&&(Xe.computedSortType=g.sortType||V.sortType||Am(Xe.groupByForColumn,t,A),Ze.push(Xe)),oe.set(Xe.id,Xe),Xe.field&&!Xe.groupByForColumn&&!mt.has(Xe.field)&&mt.set(Xe.field,Xe)}),Ze.forEach(g=>{g.computedSortable=gs(g,{fieldsToColumn:mt,userColumns:t,columnTypes:A,sortable:m,columnDefaultSortable:D})});let it=new Map;fe.forEach(g=>{let I=oe.get(g);I&&it.set(g,I)}),oe.forEach(g=>{it.has(g.id)||it.set(g.id,g)});let vt=s!=null?Math.min(s,ye):ye,Mt=c!=null?Math.min(c,be):be;return{computedRemainingSpace:e.width-(ne+De+Te),computedPinnedStartColumnsWidth:ye,computedPinnedEndColumnsWidth:be,computedUnpinnedColumnsWidth:re,computedColumnOrder:B,computedPinnedStartColumns:ce,computedPinnedEndColumns:ee,computedUnpinnedOffset:ye,computedPinnedEndOffset:ye+re,computedUnpinnedColumns:H,computedVisibleColumns:Z,computedColumnsMap:oe,computedColumnsMapInInitialOrder:it,computedVisibleColumnsMap:J,computedPinnedEndWidth:Mt,computedPinnedStartWidth:vt,renderSelectionCheckBox:Z.reduce((g,I)=>g||!!I.renderSelectionCheckBox,!1),fieldsToColumn:mt}};function gs(o,t){let{sortable:e,fieldsToColumn:n,columnDefaultSortable:i,userColumns:r,columnTypes:a}=t;if(e)return e;let l=o.defaultSortable??o.colType.defaultSortable;if(l!=null)return l;let u=i??ti,d=o.sortType??o.colType.sortType;return d!=null&&d!==Ut&&u?!0:c=>{let{column:f,api:m}=c,p=f.groupByForColumn||[];return p!=null&&!Array.isArray(p)&&(p=[p]),(p||[]).reduce((h,y)=>{if(!h)return!1;let C=y.field||y.groupField,b;if(C){let S=n.get(C),w=S?m.getColumnApi(S.id):void 0;if(S&&w)b=w.isSortable();else{let T=gn(r,C);if(T){let P=Nr(T,{colType:Nn(T,a??{}),sortable:e,columnDefaultSortable:i});b=typeof P=="boolean"?P:void 0}else b=!1}}return b===void 0&&y.valueGetter&&(b=!0),b??i??ti},!0)}}function lt(o,t){let{getComputed:e,getState:n,actions:i,api:r}=t;typeof o=="number"&&(o=e().computedVisibleColumns[o]);let a=typeof o=="string"?e().computedColumnsMap.get(o):o;if(!a)return null;let l={getCellValuesByPrimaryKey(u){return t.api.getCellValues({columnId:a.id,primaryKey:u})},getCellValueByPrimaryKey(u){return l.getCellValuesByPrimaryKey(u)?.value??null},toggleContextMenu(u){n().columnMenuVisibleForColumnId===a.id?this.hideContextMenu():this.showContextMenu(u)},toggleFilterOperatorMenu(u){n().filterOperatorMenuVisibleForColumnId===a.id?this.hideFilterOperatorMenu():this.showFilterOperatorMenu(u)},showFilterOperatorMenu(u){n().onFilterOperatorMenuClick({target:u,column:a})},hideFilterOperatorMenu(){r.hideFilterOperatorMenu()},showContextMenu(u){n().onColumnMenuClick({target:u,column:a})},hideContextMenu(){i.columnMenuVisibleForColumnId=null},isVisible(){return e().computedVisibleColumnsMap.has(a.id)},setVisible(u){r.setVisibilityForColumn(a.id,u)},toggleSort(u={multiSortBehavior:"replace"}){return r.toggleSortingForColumn(a.id,u)},isSortable(){let{computedColumnsMap:u}=e();return typeof a.computedSortable=="function"?a.computedSortable({api:r,columnApi:l,column:a,columns:u}):a.computedSortable},getSortDir(){return r.getSortingForColumn(a.id)},setFilter(u){return r.setColumnFilter(a.id,u)},clearFilter(){return r.clearColumnFilter(a.id)},getSortInfo(){return r.getSortInfoForColumn(a.id)},setSort(u){u?r.setSortingForColumn(a.id,u):r.setSortInfoForColumn(a.id,null)},clearSort(){this.setSort(null)},getColumnId(){return a.id},getComputedColumn(){return a}};return l}function wo(o,t,e){let n=typeof o=="string"?t.getComputed().computedColumnsMap.get(o):o,{api:i,getComputed:r,getDataSourceState:a,actions:l,dataSourceActions:u,dataSourceApi:d}=t,s=a(),{allRowsSelected:c,someRowsSelected:f,selectionMode:m}=s,p=r(),h=n.header&&typeof n.header!="function"?n.header:n.name||n.id||"";if(typeof n.header=="function"){let y=lt(n.id,{...t,actions:l,dataSourceActions:u,dataSourceApi:d});h=n.header({horizontalLayoutPageIndex:null,column:n,columnApi:y,dataSourceApi:d,renderLocation:e,dragging:!1,columnsMap:p.computedColumnsMap,columnSortInfo:n.computedSortInfo,columnFilterValue:n.computedFilterValue,filtered:n.computedFiltered,allRowsSelected:c,someRowsSelected:f,selectionMode:m,api:i,renderBag:{header:h}})??null}return h}var Ve="Infinite",He={rootClassName:Ve};var ni=`${Ve}HeaderCell__filter`,Or=`${Ve}HeaderCell__filterOperator`,ys=`${ni}__input`;var de=require("vue");function U(o){return o.slice(4,-1)}function oi(o,t,e,n){let i=[...t],r={filtered:o.computedFiltered,first:o.computedFirst,last:o.computedLast,groupByField:!!o.groupByForColumn,firstInCategory:o.computedFirstInCategory,lastInCategory:o.computedLastInCategory,pinned:o.computedPinned||!1,cellSelected:n.cellSelected||!1,rowSelected:n.rowSelected??"null",rowActive:n.rowActive,dragging:n.dragging,insideDisabledDraggingPage:n.insideDisabledDraggingPage,firstRow:n.firstRow??!1,firstRowInHorizontalLayoutPage:n.firstRowInHorizontalLayoutPage??!1,rowDisabled:n.rowDisabled,groupRow:n.groupRow,groupCell:n.groupCell,treeNode:n.treeNode,verticalAlign:n.verticalAlign,align:n.align,zebra:n.zebra},a=e(r);return i.push(a),o.computedFirst&&i.push(...t.map(l=>`${l}--first`)),o.groupByForColumn&&i.push(...t.map(l=>`${l}--group-column`)),o.computedLast&&i.push(...t.map(l=>`${l}--last`)),o.computedFirstInCategory&&i.push(...t.map(l=>`${l}--first-in-category`)),o.computedLastInCategory&&i.push(...t.map(l=>`${l}--last-in-category`)),n.rowSelected&&i.push(...t.map(l=>`${l}--row-selected`)),n.cellSelected&&i.push(...t.map(l=>`${l}--cell-selected`)),n.firstRow&&i.push(...t.map(l=>`${l}--first-row`)),n.firstRowInHorizontalLayoutPage&&i.push(...t.map(l=>`${l}--first-row-in-horizontal-layout-page`)),n.rowDisabled&&i.push(...t.map(l=>`${l}--disabled`)),n.treeNode&&i.push(...t.map(l=>`${l}--tree-node ${l}-tree-${n.treeNode}-node`)),n.groupRow&&(i.push(...t.map(l=>`${l}--group-row`)),i.push(...t.map(l=>`${l}--${n.rowExpanded?"group-row-expanded":"group-row-collapsed"}`))),o.computedPinned?i.push(...t.map(l=>`${l}--pinned-${o.computedPinned}`)):i.push(...t.map(l=>`${l}--unpinned`)),i.filter(Boolean).join(" ")}var qs=require("vue");var Je=class o{constructor(t){this.top=0;this.left=0;this.left=t.left,this.top=t.top}static clone(t){return new o(t)}static from(t){return new o(t)}shift(t){return t.top!=null&&(this.top+=t.top),t.left!=null&&(this.left+=t.left),this}getDistanceToPoint(t){let e=t.top-this.top,n=t.left-this.left;return{top:e,left:n}}};function bs(o,t){let e=Math.atan2(o.top-t.top,o.left-t.left);return e<=0&&(e=2*Math.PI+e),e}function Cs(o,t){return Math.sqrt((t.top-o.top)**2+(t.left-o.left)**2)}function _m(o,t,e){let n=bs(o,e),i=bs(t,e);return n===i?Cs(e,t)-Cs(e,o):n-i}function Ts(o){if(o.length<3)return o;let[...t]=o,e={top:0,left:0};return o.forEach(n=>{e.top+=n.top,e.left+=n.left}),e.top/=o.length,e.left/=o.length,t.sort((n,i)=>_m(n,i,e)),t}function Mm(o){if(o.length<2)return!1;let t=o[0].left,e=o[0].top,n={left:!1,top:!1};for(let i=1,r=o.length;i<r;i++){if(n.left&&n.top)return!1;o[i].left!==t&&(n.left=!0),o[i].top!==e&&(n.top=!0)}return!(n.left&&n.top)}function Em(o,t){if(o.length<2)return o[0]?o[0].left===t.left&&o[0].top===t.top:!1;o=Ts(o);let e=o[0],n=o[o.length-1];return e.left===n.left?t.left===e.left&&t.top>=Math.min(e.top,n.top)&&t.top<=Math.max(e.top,n.top):t.top===e.top&&t.left>=Math.min(e.left,n.left)&&t.left<=Math.max(e.left,n.left)}function Ss(o,t){if(Mm(o))return Em(o,t);o=Ts(o);let[e]=o;for(let n=1,i=o.length-1;n<i;n++){let r=o[n],a=o[n+1];if(Fm([e,r,a],t))return!0}return!1}function Fm(o,t){let[e,n,i]=o,r=t,a=(n.left-e.left)*(i.top-e.top)-(n.top-e.top)*(i.left-e.left);return a*((n.left-e.left)*(r.top-e.top)-(n.top-e.top)*(r.left-e.left))>=0&&a*((i.left-n.left)*(r.top-n.top)-(i.top-n.top)*(r.left-n.left))>=0&&a*((e.left-i.left)*(r.top-i.top)-(e.top-i.top)*(r.left-i.left))>=0}var kn=class{containsPoint(t){return Ss(this.getPoints(),t)}contains(t){let e=t.getPoints();for(let n=0,i=e.length;n<i;n++)if(!this.containsPoint(e[n]))return!1;return!0}intersects(t){return this.privateIntersects(t,!1)}privateIntersects(t,e){let n=t.getPoints();for(let i=0,r=n.length;i<r;i++)if(this.containsPoint(n[i]))return!0;return e?!1:t.privateIntersects(this,!0)}};var Ln=class o extends kn{static clone(t){return new o(t)}constructor(t){super(),this.points=t.map(Je.clone)}getPoints(){return this.points}shift(t){return this.points.forEach(e=>{e.shift(t)}),this}};function Nm(o,t){let e=Math.min(o.left,t.left),n=Math.min(o.top,t.top),i=o.left+o.width,r=t.left+t.width,a=Math.max(i,r),l=o.top+o.height,u=t.top+t.height,d=Math.max(l,u);return new Ee({top:n,left:e,width:a-e,height:d-n})}var Ee=class o extends kn{constructor(e){super();this.top=0;this.left=0;this.width=0;this.height=0;this.top=e.top,this.left=e.left,typeof e.width=="number"?(this.width=e.width,this.height=e.height):(this.width=e.right-e.left,this.height=e.bottom-e.top)}static fromDOMRect(e){return new o(e)}static clone(e){return new o(e)}static from(e){return o.clone(e)}static fromPoint(e){return o.from({top:e.top,left:e.left,width:0,height:0})}getMinimumBoundingRectangle(...e){let n=this;for(let i of e)n=Nm(n,i);return n}toDOMRect(){return{top:this.top,left:this.left,bottom:this.top+this.height,right:this.left+this.width,height:this.height,width:this.width,x:this.left,y:this.top,toJSON:()=>({top:this.top,left:this.left,bottom:this.top+this.height,right:this.left+this.width,height:this.height,width:this.width,x:this.left,y:this.top})}}containsPoint(e){return new Ln(this.getPoints()).containsPoint(e)}getTopLeft(){return{left:this.left,top:this.top}}getTopRight(){return{left:this.left+this.width,top:this.top}}getBottomLeft(){return{left:this.left,top:this.top+this.height}}getBottomRight(){return{left:this.left+this.width,top:this.top+this.height}}getCenter(){return{left:this.left+this.width/2,top:this.top+this.height/2}}getPoints(){return[this.getTopLeft(),this.getTopRight(),this.getBottomLeft(),this.getBottomRight()].map(Je.from)}shift(e){return e.top!=null&&(this.top+=e.top),e.left!=null&&(this.left+=e.left),this}};function vo(o){if(!o)return!1;let t=o.tagName;return t==="INPUT"||t==="BUTTON"}var ws="_1yeub2v0 _16lm1iw1 _16lm1iw1p _16lm1iw2f _16lm1iw0",vs="_1yeub2vs",Is="_1yeub2vr",Rs=ve({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 kr="_1yeub2vp";var JC=ve({defaultClassName:"_1yeub2vl",variantClassNames:{pinned:{start:"_1yeub2vm",end:"_1yeub2vn",false:"_1yeub2vo"}},defaultVariants:{},compoundVariants:[]});var j={currentColumnTransformX:"var(--_16hkbkc0)",y:"var(--_16hkbkc1)",currentFlashingBackground:"var(--_16hkbkc2)",currentFlashingDuration:"var(--_16hkbkc3)",activeCellRowOffset:"var(--_16hkbkc4)",activeCellRowOffsetX:"var(--_16hkbkc5)",activeCellRowHeight:"var(--_16hkbkc6)",activeCellOffsetX:"var(--_16hkbkc7)",activeCellOffsetY:"var(--_16hkbkc8)",scrollTopForActiveRow:"var(--_16hkbkc9)",scrollLeftForActiveRowWhenHorizontalLayout:"var(--_16hkbkca)",activeCellColWidth:"var(--_16hkbkcb)",activeCellColOffset:"var(--_16hkbkcc)",columnReorderEffectDurationAtIndex:"var(--_16hkbkcd)",columnWidthAtIndex:"var(--_16hkbkce)",columnOffsetAtIndex:"var(--_16hkbkcf)",columnOffsetAtIndexWhileReordering:"var(--_16hkbkcg)",columnVisibilityAtIndex:"var(--_16hkbkch)",columnZIndexAtIndex:"var(--_16hkbkci)",pinnedStartWidth:"var(--_16hkbkcj)",pinnedEndWidth:"var(--_16hkbkck)",pinnedEndOffset:"var(--_16hkbkcl)",computedVisibleColumnsCount:"var(--_16hkbkcm)",baseZIndexForCells:"var(--_16hkbkcn)",bodyWidth:"var(--_16hkbkco)",bodyHeight:"var(--_16hkbkcp)",scrollbarWidthHorizontal:"var(--_16hkbkcq)",scrollbarWidthVertical:"var(--_16hkbkcr)",scrollLeft:"var(--_16hkbkcs)",scrollTop:"var(--_16hkbkct)"};var Lr=`${Ve}Body`,xs=o=>o.querySelector(`.${Lr}`);var yn=`${Ve}HeaderCell`,zr=`${Ve}HeaderWrapper`,Ps=o=>Array.from(o.querySelectorAll(`.${zr}`));function zn(o,t){let e=o;if(!e)return null;if(e&&e.matches(t))return e;for(;e=e.parentElement;)if(e.matches(t))return e;return null}function Ds(o,t,e){let n=o;if(!n)return null;if(n&&n.matches(t))return n;for(;n=n.parentElement;){if(n.matches(t))return n;if(n===e)return null}return null}var 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)",minHeight:"var(--infinite-min-height)",borderRadius:"var(--infinite-border-radius)",focusOutline:"var(--infinite-focus-outline)",background:"var(--infinite-background)",iconSize:"var(--infinite-icon-size)",runtime:{bodyWidth:"var(--infinite-runtime-body-content-width)",totalVisibleColumnsWidthValue:"var(--infinite-runtime-total-visible-columns-width)",totalVisibleColumnsWidthVar:"var(--infinite-runtime-total-visible-columns-width-var)",visibleColumnsCount:"var(--infinite-runtime-visible-columns-count)",browserScrollbarWidth:"var(--infinite-runtime-browser-scrollbar-width)"},components:{GroupingToolbar:{color:"var(--infinite-grouping-toolbar-color)",background:"var(--infinite-grouping-toolbar-background)",rejectBackground:"var(--infinite-grouping-toolbar-reject-background)",activeBackground:"var(--infinite-grouping-toolbar-active-background)",activeBackgroundAlpha:"var(--infinite-grouping-toolbar-active-background-alpha)",padding:"var(--infinite-grouping-toolbar-padding)",border:"var(--infinite-grouping-toolbar-border)",rejectBorder:"var(--infinite-grouping-toolbar-reject-border)",gap:"var(--infinite-grouping-toolbar-gap)"},GroupingToolbarItem:{border:"var(--infinite-grouping-toolbar-item-border)",borderRadius:"var(--infinite-grouping-toolbar-item-border-radius)",activeBorder:"var(--infinite-grouping-toolbar-item-active-border)",background:"var(--infinite-grouping-toolbar-item-background)",activeBackground:"var(--infinite-grouping-toolbar-item-active-background)",activeBackgroundAlpha:"var(--infinite-grouping-toolbar-item-active-background-alpha)"},LoadMask:{padding:"var(--infinite-load-mask-padding)",color:"var(--infinite-load-mask-color)",textBackground:"var(--infinite-load-mask-text-background)",overlayBackground:"var(--infinite-load-mask-overlay-background)",overlayOpacity:"var(--infinite-load-mask-overlay-opacity)",borderRadius:"var(--infinite-load-mask-border-radius)"},Header:{background:"var(--infinite-header-background)",color:"var(--infinite-header-color)",columnHeaderHeight:"var(--infinite-column-header-height)"},HeaderCell:{background:"var(--infinite-header-cell-background)",hoverBackground:"var(--infinite-header-cell-hover-background)",border:"var(--infinite-header-cell-border)",padding:"var(--infinite-header-cell-padding)",paddingX:"var(--infinite-header-cell-padding-x)",paddingY:"var(--infinite-header-cell-padding-y)",iconSize:"var(--infinite-header-cell-icon-size)",menuIconLineWidth:"var(--infinite-header-cell-menu-icon-line-width)",sortIconMargin:"var(--infinite-header-cell-sort-icon-margin)",borderRight:"var(--infinite-header-cell-border-right)",resizeHandleActiveAreaWidth:"var(--infinite-resize-handle-active-area-width)",resizeHandleWidth:"var(--infinite-resize-handle-width)",resizeHandleHoverBackground:"var(--infinite-resize-handle-hover-background)",resizeHandleConstrainedHoverBackground:"var(--infinite-resize-handle-constrained-hover-background)",filterOperatorPaddingX:"var(--infinite-filter-operator-padding-x)",filterEditorPaddingX:"var(--infinite-filter-editor-padding-x)",filterEditorMarginX:"var(--infinite-filter-editor-margin-x)",filterOperatorPaddingY:"var(--infinite-filter-operator-padding-y)",filterEditorPaddingY:"var(--infinite-filter-editor-padding-y)",filterEditorMarginY:"var(--infinite-filter-editor-margin-y)",filterEditorBackground:"var(--infinite-filter-editor-background)",filterEditorBorder:"var(--infinite-filter-editor-border)",filterEditorFocusBorderColor:"var(--infinite-filter-editor-focus-border-color)",filterEditorBorderRadius:"var(--infinite-filter-editor-border-radius)",filterEditorColor:"var(--infinite-filter-editor-color)"},ActiveCellIndicator:{inset:"var(--infinite-active-cell-indicator-inset)"},Cell:{flashingDuration:"var(--infinite-flashing-duration)",flashingAnimationName:"var(--infinite-flashing-animation-name)",flashingOverlayZIndex:"var(--infinite-flashing-overlay-z-index)",flashingBackground:"var(--infinite-flashing-background)",flashingUpBackground:"var(--infinite-flashing-up-background)",flashingDownBackground:"var(--infinite-flashing-down-background)",padding:"var(--infinite-cell-padding)",borderWidth:"var(--infinite-cell-border-width)",borderColor:"var(--infinite-cell-border-color)",border:"var(--infinite-cell-border)",borderLeft:"var(--infinite-cell-border-left)",borderRight:"var(--infinite-cell-border-right)",borderTop:"var(--infinite-cell-border-top)",borderInvisible:"var(--infinite-cell-border-invisible)",borderRadius:"var(--infinite-cell-border-radius)",reorderEffectDuration:"var(--infinite-column-reorder-effect-duration)",pinnedBorder:"var(--infinite-pinned-cell-border)",horizontalLayoutColumnReorderDisabledPageOpacity:"var(--infinite-horizontal-layout-column-reorder-disabled-page-opacity)",color:"var(--infinite-cell-color)",selectedBackground:"var(--infinite-selected-cell-background)",selectedBackgroundDefault:"var(--infinite-selected-cell-background-default)",selectedBackgroundAlpha:"var(--infinite-selected-cell-background-alpha)",selectedBackgroundAlphaWhenTableUnfocused:"var(--infinite-selected-cell-background-alpha--table-unfocused)",selectedBorderColor:"var(--infinite-selected-cell-border-color)",selectedBorderWidth:"var(--infinite-selected-cell-border-width)",selectedBorderStyle:"var(--infinite-selected-cell-border-style)",selectedBorder:"var(--infinite-selected-cell-border)",activeBackgroundAlpha:"var(--infinite-active-cell-background-alpha)",activeBackgroundAlphaWhenTableUnfocused:"var(--infinite-active-cell-background-alpha--table-unfocused)",activeBackground:"var(--infinite-active-cell-background)",activeBackgroundDefault:"var(--infinite-active-cell-background-default)",activeBorderColor:"var(--infinite-active-cell-border-color)",activeBorderWidth:"var(--infinite-active-cell-border-width)",activeBorderStyle:"var(--infinite-active-cell-border-style)",activeBorder:"var(--infinite-active-cell-border)"},SelectionCheckBox:{marginInline:"var(--infinite-selection-checkbox-margin-inline)"},ExpandCollapseIcon:{color:"var(--infinite-expand-collapse-icon-color)"},Menu:{background:"var(--infinite-menu-background)",color:"var(--infinite-menu-color)",separatorColor:"var(--infinite-menu-separator-color)",padding:"var(--infinite-menu-padding)",cellPaddingVertical:"var(--infinite-menu-cell-padding-vertical)",cellPaddingHorizontal:"var(--infinite-menu-cell-padding-horizontal)",cellMarginVertical:"var(--infinite-menu-cell-margin-vertical)",itemDisabledBackground:"var(--infinite-menu-item-disabled-background)",itemActiveBackground:"var(--infinite-menu-item-active-background)",itemActiveOpacity:"var(--infinite-menu-item-active-opacity)",itemPressedOpacity:"var(--infinite-menu-item-pressed-opacity)",itemPressedBackground:"var(--infinite-menu-item-pressed-background)",itemDisabledOpacity:"var(--infinite-menu-item-disabled-opacity)",borderRadius:"var(--infinite-menu-border-radius)",shadowColor:"var(--infinite-menu-shadow-color)"},RowDetail:{background:"var(--infinite-rowdetail-background)",padding:"var(--infinite-rowdetail-padding)",gridHeight:"var(--infinite-rowdetail-grid-height)"},Row:{background:"var(--infinite-row-background)",oddBackground:"var(--infinite-row-odd-background)",disabledBackground:"var(--infinite-row-disabled-background)",oddDisabledBackground:"var(--infinite-row-odd-disabled-background)",selectedBackground:"var(--infinite-row-selected-background)",disabledOpacity:"var(--infinite-row-disabled-opacity)",activeBackground:"var(--infinite-active-row-background)",activeBorderColor:"var(--infinite-active-row-border-color)",activeBorderWidth:"var(--infinite-active-row-border-width)",activeBorderStyle:"var(--infinite-active-row-border-style)",activeBorder:"var(--infinite-active-row-border)",activeBackgroundAlpha:"var(--infinite-active-row-background-alpha)",activeBackgroundAlphaWhenTableUnfocused:"var(--infinite-active-row-background-alpha--table-unfocused)",hoverBackground:"var(--infinite-row-hover-background)",selectedHoverBackground:"var(--infinite-row-selected-hover-background)",selectedDisabledBackground:"var(--infinite-row-selected-disabled-background)",groupRowBackground:"var(--infinite-group-row-background)",groupRowColumnNesting:"var(--infinite-group-row-column-nesting)",groupNesting:"var(--infinite-dont-override-group-row-nesting-length)",pointerEventsWhileScrolling:"var(--infinite-row-pointer-events-while-scrolling)"},ColumnCell:{background:"var(--infinite-column-cell-bg-dont-override)"}}},As="column-header-height";var _s=`.${He.rootClassName}`;function Vr(o){return zn(o,_s)}var Ms=U(j.scrollLeft),Om=U(j.scrollTop),km=U(j.columnWidthAtIndex),Gr=U(j.columnOffsetAtIndex),Es=U(j.columnReorderEffectDurationAtIndex),Lm=U(j.columnOffsetAtIndexWhileReordering),zm=U(j.columnVisibilityAtIndex),Vm=U(j.columnZIndexAtIndex);function Ot(o,t,e){let n=e?Vr(e):document.querySelector(_s);Gm(o,t,n)}function Gm(o,t,e){if(e){let n=o,i=j[n]?U(j[n]):o;e.style.setProperty(i,`${t}`)}}function Vn(o,t){if(t)for(var e in o){let n=j[e]?U(j[e]):e,i=`${o[e]}`;t.style.setProperty(n,i)}}function Kr(o,t,e){Ot(`${Gr}-${o.computedVisibleIndex}`,o.computedPinned?`calc( ${o.computedAbsoluteOffset+t}px + var(${Ms}))`:`${o.computedAbsoluteOffset+t}px`,e)}function Br(o,t,e){Ot(`${Vm}-${o}`,`${t}`,e)}function Io(o,t,e){Ot(`${Lm}-${o}`,typeof t=="number"?`calc( var(${Gr}-${o}) + ${t}px )`:t,e)}function Ro(o,t,e){Ot(`${zm}-${o}`,t,e)}function ii(o,t,e){Ot(`${Es}-${o}`,e??"",t)}function Hr(o,t){let e=`${Es}-${o}`;Ot(e,Pe.components.Cell.reorderEffectDuration,t)}var Se={columnWidths:{get(o){return`var(${this.getVarName(o)})`},getVarName(o){return this.varName.get(o)},varName:{get(o){return`${km}-${o}`}},set(o,t,e){t=typeof t=="number"?t+"px":t,Ot(this.varName.get(o),t,e)}},columnOffsets:{get(o){return`var(${this.getVarName(o)})`},getVarName(o){return this.varName.get(o)},varName:{get(o){return`${Gr}-${o}`}},set(o,t,e){t=typeof t=="number"?t+"px":t,Ot(this.varName.get(o),t,e)}}};function Fs(o,t){Vn({[Ms]:`${o.scrollLeft}px`,[Om]:`${o.scrollTop}px`},t)}var xo={bodyWidth:{name:U(Pe.runtime.bodyWidth),value:""},totalVisibleColumnsWidthValue:{name:U(Pe.runtime.totalVisibleColumnsWidthValue),value:""},totalVisibleColumnsWidthVar:{name:U(Pe.runtime.totalVisibleColumnsWidthVar),value:""},visibleColumnsCount:{name:U(Pe.runtime.visibleColumnsCount),value:""},browserScrollbarWidth:{name:U(Pe.runtime.browserScrollbarWidth),value:""}},Km=U(j.scrollbarWidthHorizontal),Ns=U(j.scrollbarWidthVertical),Bm=U(j.columnWidthAtIndex),Hm=U(j.columnZIndexAtIndex),Os=U(j.scrollLeft),Wm=U(j.activeCellColWidth),ks=U(j.activeCellColOffset),Gs=U(j.baseZIndexForCells),jm=U(j.pinnedStartWidth),Ls=U(j.bodyWidth),$m=U(j.bodyHeight),zs=U(j.pinnedEndOffset),Vs=U(j.pinnedEndWidth),Um=U(j.computedVisibleColumnsCount);function Wr(o,t){let e="auto",n=o.computedVisibleIndex;return o.computedPinned?o.computedPinned==="start"?e=t.pinnedStartColsCount-o.computedVisibleIndexInCategory:o.computedPinned==="end"&&(e=t.visibleColsCount+o.computedVisibleIndexInCategory):e=-n*10,typeof e=="number"?`calc( var(${Gs}) `+(e<0?"-":"+")+` ${Math.abs(e)} )`:"auto"}function Ks(o){let{computedVisibleColumns:t,computedPinnedStartColumns:e,computedPinnedEndColumns:n,computedPinnedStartColumnsWidth:i,computedPinnedEndColumnsWidth:r,computedUnpinnedColumnsWidth:a,bodySize:l,activeCellIndex:u,brain:d,scrollbars:s}=o,c=Nt(),f=[],m=t.reduce((p,h)=>{let y=h.computedVisibleIndex;p[Se.columnWidths.varName.get(y)]=h.computedWidth+"px",p[Se.columnOffsets.varName.get(y)]=h.computedPinned==="start"?`calc( ${h.computedOffset}px + var(${Os}) )`:h.computedPinned==="end"?`calc( var(${zs}) ${f.length?"+":""} ${f.map(b=>Se.columnWidths.get(b.computedVisibleIndex)).join(" + ")} + var(${Os}) )`:`${h.computedOffset}px`;let C=Wr(h,{pinnedStartColsCount:e.length,visibleColsCount:t.length});return p[`${Hm}-${y}`]=`${C}`,h.computedPinned==="end"&&f.push(h),p},{});if(l.width&&(m[xo.browserScrollbarWidth.name]=`${Nt()}px`),m[xo.bodyWidth.name]=`calc(${j.bodyWidth} - ${j.scrollbarWidthVertical})`,m[xo.totalVisibleColumnsWidthValue.name]=`${i+r+a}px`,m[xo.totalVisibleColumnsWidthVar.name]=`calc(${t.map((p,h)=>`var(${Bm}-${h})`).join(" + ")})`,m[xo.visibleColumnsCount.name]=t.length,u!=null){m[Wm]=Se.columnWidths.get(u[1]);let p=Se.columnOffsets.get(u[1]);if(d.isHorizontalLayoutBrain){let h=d.getPageIndexForRow(u[0]);m[ks]=h?`calc( ${Pe.runtime.totalVisibleColumnsWidthVar} * ${h} + ${p})`:p}else m[ks]=p}return m[Um]=t.length,m[Km]=s.horizontal?`${c}px`:"0px",m[Ns]=s.vertical?`${c}px`:"0px",m[jm]="calc( "+e.map(p=>Se.columnWidths.get(p.computedVisibleIndex)).join(" + ")+")",m[Vs]="calc( "+n.map(p=>Se.columnWidths.get(p.computedVisibleIndex)).join(" + ")+")",m[Gs]=t.length*10,m[zs]=`calc( var(${Ls}) - var(${Vs}) - var(${Ns}) )`,m[Ls]=`${l.width}px`,m[$m]=`${l.height}px`,m}var Po=(o,t,e)=>{if(o=[...o],t===e||o[t]===void 0||o[e]===void 0)return o;let n=o[t];return e<t,o.splice(t,1),o.splice(e,0,n),o};function jr(o){let{newColumnOrder:t,visibleColumnOrder:e,existingColumnOrder:n,dragColumnId:i}=o;if(e.length!==t.length)return console.warn("new column order cannot contain less columns than the visible column order"),t;let r=e.indexOf(i),a=t.indexOf(i);if(r===a)return n;if(a>r){let l=t.indexOf(i),u=t[l-1],d=n.indexOf(u),s=n.indexOf(i);return Po(n,s,d)}else{let l=t.indexOf(i),u=t[l+1],d=n.indexOf(u),s=n.indexOf(i);return Po(n,s,d)}return t}var $s=po(Gn());function ri(o){return o.map(t=>t instanceof an?t:new an(null,[t]))}var an=class o{constructor(t,e=[]){this.__operands=[];this.__operation=null;this.__operands=e,this.__operation=t}add(...t){return new o("+",[this,...t])}subtract(...t){return new o("-",[this,...t])}minus(...t){return this.subtract(...t)}multiply(...t){return new o("*",[this,...t])}divide(...t){return new o("/",[this,...t])}__get(t){let{__operation:e,__operands:n}=this,i=n.map(a=>qm(a,this)).join(` ${e} `);return(n.length<=1?!0:t?.__operation==="+"||t?.__operation==="-")?i:`(${i})`}done(){let t=this.__get();return`calc${t.startsWith("(")&&t.endsWith(")")?t:`(${t})`}`}};function qm(o,t){return typeof o=="string"||typeof o=="number"?`${o}`:t?o.__get(t):o.done()}var Ym=(...o)=>new an("+",ri(o)),Hs=(...o)=>new an("-",ri(o)),Xm=(...o)=>new an("*",ri(o)),Zm=(...o)=>new an("/",ri(o)),Do={add:Ym,subtract:Hs,minus:Hs,multiply:Xm,divide:Zm};var Ws=o=>{let t=null,e=null;return{stop(){t!==null&&hn(t),e!=null&&hn(e)},scroll(n){t!==null&&hn(t),e!=null&&hn(e);let i={offset:100,scrollAmountsPerRaf:[1,1,2,4,6,8,11,15],...o,...n},r=this;function a(){let u=i.scrollOffsetStart+i.offset-i.mousePosition.clientX;if(!(u>0&&u<=i.offset))return!1;let s=i.scrollAmountsPerRaf.length,c=Math.round(i.offset/s),f=0;for(let m=0;m<s;m++)u>(m+1)*c&&(f=i.scrollAmountsPerRaf[m]);return n.scrollLeft=n.scrollLeft-f,t=Ke(()=>{r.scroll(n)}),!0}function l(){let u=i.mousePosition.clientX-(i.scrollOffsetEnd-i.offset);if(!(u>0&&u<=i.offset))return!1;let s=i.scrollAmountsPerRaf.length,c=Math.round(i.offset/s),f=0;for(let m=0;m<s;m++)u>(m+1)*c&&(f=i.scrollAmountsPerRaf[m]);return n.scrollLeft=n.scrollLeft+f,e=Ke(()=>{r.scroll(n)}),!0}return!!(a()||l())}}};var js=10,Jm=U(j.pinnedStartWidth);function Us(o){let{computedVisibleColumns:t,computedVisibleColumnsMap:e,computedPinnedEndColumns:n,computedPinnedStartColumns:i,dragColumnId:r,infiniteDOMNode:a,brain:l,dragColumnHeaderTargetRect:u,draggableColumnsRestrictTo:d,tableRect:s,acceptDropToReorderRect:c,allowColumnHideOnDrag:f,setProxyPosition:m,setDragColumnOutside:p,getCurrentDragSourceAndTarget:h,api:y,horizontalLayoutPageIndex:C,pageWidth:b}=o;function S(H){let Z=H==="start"?L:K;return F===O?Z:O===H?Z+A.computedWidth:F===H?Z-A.computedWidth:Z}function w(H){if(H.columnIndex===x||C!=null)return!0;let Z=t[H.columnIndex];if(Z.computedPinned)return!0;let J=l.getScrollPosition().scrollLeft,oe=Z.computedOffset+(C!=null&&b!=null?b*C:0);return oe>=J+S("start")&&oe+Z.computedWidth<=J+s.width-S("end")}let T=(H,Z)=>{let{restrictToParentGroup:J,dragColumn:oe}=Z,re=[];if(H.forEach(be=>{if(be.computedVisibleIndex===x)return;let ie={columnId:be.id,columnIndex:be.computedVisibleIndex,offsetX:be.computedOffset+Math.round(be.computedWidth/2)};w(ie)&&re.push(ie)}),J){let ie=function(ne,Te,De){let Me=H[ne];Me&&(Me.columnGroup!==oe.columnGroup&&De.add(Me.id),ie(ne+Te,Te,De))};var ye=ie;let be=oe.computedVisibleIndex,W=new Set;ie(be-1,-1,W),ie(be+1,1,W),re=re.filter(ne=>!W.has(ne.columnId))}return re},R=i.length,E={clientX:Math.round(o.initialMousePosition.clientX),clientY:Math.round(o.initialMousePosition.clientY)},N={left:E.clientX-s.left-(E.clientX-u.left)+js,top:E.clientY-s.top-(E.clientY-u.top)+js},v=l.getScrollPosition(),D=t.map(H=>H.computedVisibleIndex),M=D,A=e.get(r),x=A.computedVisibleIndex,F=A?.computedPinned,_=x,O=F,L=l.getFixedStartColsWidth(),K=l.getFixedEndColsWidth(),B=E,G={x:0,y:0},se=1,Y=0;function Ae(H){let Z=Math.round(H.clientX),J=Math.round(H.clientY);if(Z===B.clientX&&J===B.clientY)return Ee.from(u).shift({left:G.x,top:G.y});B={clientX:Z,clientY:J};let re=l.getScrollPosition().scrollLeft-v.scrollLeft;return G.x=B.clientX-E.clientX,G.y=B.clientY-E.clientY,Y=G.x+re,se=Y<0?-1:1,m({left:N.left+G.x,top:N.top+G.y}),Ee.from(u).shift({left:G.x,top:G.y})}function ge(H){let Z=0;F?F==="start"&&H.forEach((J,oe)=>{Z||t[J]?.computedPinned!=="start"&&(Z=oe)}):H.forEach((J,oe)=>{t[J]?.computedPinned==="start"&&(Z=oe+1)}),R=Z,Re("start",H,Z)}function Re(H,Z,J){if(H==="start"){let oe=0;for(let re=0;re<J;re++){let ye=Z[re],be=t[ye];oe+=be.computedWidth}Ot(Jm,`${oe}px`,a)}}function Ge(H){if(H==null||H===_)return;if(_===-1&&H!==-1&&(Ro(x,"",a),p(!1)),_=H,H===-1){Oe(x);return}let Z=Po(D,x,_>x?_-1:_);R=0;let oe=new Set;return Z.forEach((re,ye)=>{let be=M[ye];re!==be&&oe.add(re),ge(Z)}),M=Z,we(oe),{newColumnIndexes:Z,indexesWithTransition:oe,pinnedStartCount:R}}function Oe(H){M=M.filter(J=>J!==H),t.forEach(J=>{let oe=J.computedVisibleIndex,re=oe>H;Hr(oe,a);let ye="";re&&(ye=Do.minus(Se.columnOffsets.get(oe),Se.columnWidths.get(H)).done()),Io(oe,ye,a)}),Ro(H,"hidden",a),p(!0)}function we(H){t.forEach(Z=>{let J=Z.computedVisibleIndex;H.has(J)?Hr(J,a):ii(J,a);let oe=J===x,re=se===-1?J<_||J>x:J<x||J>=_,ye="";se===-1?ye=oe?Se.columnOffsets.get(_):re?Se.columnOffsets.get(J):Do.add(Se.columnOffsets.get(J),Se.columnWidths.get(x)).done():ye=re?Se.columnOffsets.get(J):oe?Do.add(Se.columnOffsets.get(_-1),Se.columnWidths.get(_-1)).minus(Se.columnWidths.get(x)).done():Do.minus(Se.columnOffsets.get(J),Se.columnWidths.get(x)).done(),Io(J,ye,a)})}let Fe=s.left+S("start"),ce=s.right-S("end"),ee=Ws({scrollOffsetStart:Fe,scrollOffsetEnd:ce});return Ae(E),{speedScroller:ee,stop(){ee.stop()},onMove(H){let Z=Ae(H);if(h().dropTargetListId==="grouping-toolbar"||f&&!c.containsPoint(Z.getCenter()))return f&&Ge(-1),null;ee.scroll({mousePosition:B,get scrollLeft(){return l.getScrollPosition().scrollLeft},set scrollLeft(ie){y.scrollLeft=ie}});let J=T(t,{dragColumn:A,restrictToParentGroup:d==="group"}),oe=se===-1?A.computedOffset+Y:A.computedOffset+A.computedWidth+Y,re=(0,$s.default)(J,oe,({offsetX:ie},W)=>ie<W?-1:ie>W?1:0);re<0&&(re=~re),J.length?re=J[re]?J[re].columnIndex:J[J.length-1].columnIndex+1:(t.length>1&&console.error("No breakpoints available, something is wrong!"),re=0),re===x+1&&(re=x),Ge(re);let ye={};n.forEach(ie=>{ye[ie.id]="end"});for(let ie=0;ie<R;ie++){let W=M[ie],ne=t[W];ye[ne.id]="start"}let be=M.map(ie=>t[ie].id);return{columnPinning:ye,columnOrder:be}}}}var Qm=U(j.baseZIndexForCells),eh=(o,t)=>{let e=!o||Object.keys(o).length===0,n=!t||Object.keys(t).length===0;return e&&n?!0:!!o!=!!t?!1:rn(o,t)},th=()=>({dragSourceListId:null,dropTargetListId:null,dragItemId:"",status:"accepted"});function Ys(o){let{columnId:t,context:e,domRef:n,getHorizontalLayoutPageIndex:i,allowColumnHideOnDrag:r,proxyPosition:a,dragColumnOutside:l}=o,{getState:u,getComputed:d,actions:s,api:c}=e,f=p=>{let h=d().computedVisibleColumnsMap.get(t);if(!h||!h.computedSortable)return;let{multiSortBehavior:y}=u();c.toggleSortingForColumn(t,{multiSortBehavior:y==="replace"&&(p.ctrlKey||p.metaKey)?"append":y})},m=p=>{if(p.target&&vo(p.target))return;let h=i(),y=u().domRef,{brain:C,draggableColumnsRestrictTo:b}=u(),{computedVisibleColumns:S,computedVisibleColumnsMap:w,computedPinnedStartColumns:T,computedUnpinnedColumns:P,computedPinnedEndColumns:R}=d(),E=w.get(t);if(!E||!E.computedDraggable){f(p);return}let N=n.current,v=N.getBoundingClientRect(),D=y.current.getBoundingClientRect(),M=C.getAvailableSize(),A=E.computedVisibleIndex,x=C.getVirtualColIndex(E.computedVisibleIndex,{pageIndex:h||0}),F=C.isHorizontalLayoutBrain?C.getPageWidth():null,_=N.style.cursor??"auto",O=!1,L=y.current,K=Ee.from(xs(L).getBoundingClientRect()),B=Ps(L).map(we=>Ee.from(we.getBoundingClientRect())),G=K.getMinimumBoundingRectangle(...B),se=Us({brain:C,horizontalLayoutPageIndex:h,allowColumnHideOnDrag:r,pageWidth:F,draggableColumnsRestrictTo:b,computedPinnedEndColumns:R,computedPinnedStartColumns:T,computedUnpinnedColumns:P,computedVisibleColumns:S,computedVisibleColumnsMap:w,dragColumnHeaderTargetRect:v,dragColumnId:t,getCurrentDragSourceAndTarget:th,api:c,infiniteDOMNode:y.current,setProxyPosition:we=>{a.value=we},setDragColumnOutside:we=>{l.value=we},tableRect:D,acceptDropToReorderRect:G,initialMousePosition:{clientX:p.clientX,clientY:p.clientY}}),Y=null,Ae,ge;function Re(we){let{columnPinning:Fe,columnOrder:ce}=we;eh(u().columnPinning,Fe)||(s.columnPinning=Fe);let ee=d().computedColumnOrder;s.columnOrder=jr({newColumnOrder:ce,visibleColumnOrder:d().computedVisibleColumns.map(H=>H.id),existingColumnOrder:ee,dragColumnId:t})}let Ge=we=>{let{headerBrain:Fe,brain:ce}=u();if(!O){O=!0;let ee=ce.keepColumnRendered(x),H=Fe.keepColumnRendered(x);if(ce.isHorizontalLayoutBrain){let J=ce.extendRenderRange({start:!0,end:!0,direction:"horizontal"}),oe=Fe.extendRenderRange({start:!0,end:!0,direction:"horizontal"});ge=()=>{J(),oe()}}Ae=()=>{ee(),H()},s.columnReorderDragColumnId=E.id,h!=null&&(s.columnReorderInPageIndex=h),Br(A,`calc( var(${Qm}) + 10000 )`,y.current),y.current?.classList.add(kr),N.style.cursor="grabbing"}Y=se.onMove(we)},Oe=we=>{let Fe=we.pointerId;requestAnimationFrame(async()=>{let{multiSortBehavior:ce}=u(),ee=y.current;ee?.classList.remove(kr),se.stop(),C.update({...M}),Ae?.(),ge?.(),N.style.cursor=_,N.hasPointerCapture?.(Fe)&&N.releasePointerCapture(Fe),N.removeEventListener("pointermove",Ge),N.removeEventListener("pointerup",Oe),a.value=null;let H=c.getColumnApi(E.id)?.isSortable()??!1;!O&&H&&c.toggleSortingForColumn(E.id,{multiSortBehavior:ce==="replace"&&(we.ctrlKey||we.metaKey)?"append":ce}),Y?Re(Y):O&&r&&c.setVisibilityForColumn(E.id,!1),s.columnReorderDragColumnId=!1,h!=null&&(s.columnReorderInPageIndex=null),await(0,qs.nextTick)(),S.forEach(Z=>{ii(Z.computedVisibleIndex,ee),Ro(Z.computedVisibleIndex,"",ee),Io(Z.computedVisibleIndex,"",ee)}),Br(A,Wr(E,{pinnedStartColsCount:T.length,visibleColsCount:S.length}),ee)})};N.addEventListener("pointermove",Ge),N.addEventListener("pointerup",Oe),N.setPointerCapture(p.pointerId)};return{onPointerDown:p=>{d().computedVisibleColumnsMap.get(t)?.computedDraggable?m(p):p.target&&vo(p.target)||f(p)}}}var bn=require("vue");var gt={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 Xs=(0,bn.defineComponent)({name:"InfiniteIcon",props:{size:{type:Number,default:void 0},style:{type:Object,default:void 0},className:{type:String,default:void 0},viewBox:{type:String,default:"0 0 24 24"},paths:{type:Array,required:!0}},setup(o){return()=>{let t=o.size??"var(--infinite-icon-size)",e={flex:"none",width:typeof t=="number"?`${t}px`:t,height:typeof t=="number"?`${t}px`:t,fill:"currentColor",...o.style};return(0,bn.h)("svg",{viewBox:o.viewBox,class:o.className,style:e},o.paths.map(n=>(0,bn.h)("path",{d:n})))}}});function It(o,t){let e=n=>(0,bn.h)(Xs,{...n,paths:t});return e.displayName=o,e}var Zs=It("IncludesOperatorIcon",gt.includesOperator),Js=It("StartsWithOperatorIcon",gt.startsWithOperator),Qs=It("EndsWithOperatorIcon",gt.endsWithOperator),eu=It("EqualOperatorIcon",gt.eqOperator),tu=It("NotEqualOperatorIcon",gt.neqOperator),nu=It("GTOperatorIcon",gt.gtOperator),ou=It("GTEOperatorIcon",gt.gteOperator),iu=It("LTOperatorIcon",gt.ltOperator),ru=It("LTEOperatorIcon",gt.lteOperator),au=It("DoneIcon",gt.done),lu=It("ClearIcon",gt.clear),$r=o=>(0,bn.h)(Xs,{...o,viewBox:"0 -960 960 960",paths:gt.hidden});$r.displayName="HiddenIcon";var ai="_1eexc2a7 _1eexc2a6",su=ve({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"]]}),uu=ve({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 du="_1eexc2a5",li=ve({defaultClassName:"_1eexc2aa",variantClassNames:{direction:{up:"_1eexc2ab",down:"_1eexc2ac",neutral:"_1eexc2ad"}},defaultVariants:{},compoundVariants:[]}),si="_1eexc2a8";var Rt=require("vue");var cu="qz8ht90 _16lm1iwk";var ln=(0,Rt.defineComponent)({name:"InfiniteCheckBox",props:{disabled:{type:Boolean,default:!1},checked:{type:[Boolean,Object],default:void 0},defaultChecked:{type:[Boolean,Object],default:void 0},onChange:{type:Function,default:void 0},domProps:{type:Object,default:void 0}},setup(o){let t=()=>o.checked!==void 0,e=t()?o.checked:o.defaultChecked,n=(0,Rt.ref)(e===void 0?!1:e),i=(0,Rt.ref)(null),r=()=>{i.value&&(i.value.indeterminate=n.value==null)};(0,Rt.onMounted)(r),(0,Rt.watch)(()=>o.checked,l=>{t()&&(n.value=l===void 0?!1:l,r())});let a=()=>{if(o.disabled)return;let l=!n.value;t()||(n.value=l,r()),o.onChange?.(l)};return()=>{let l=o.domProps||{};return(0,Rt.h)("input",{...l,class:te("InfiniteCheckBox",cu,l.class),type:"checkbox",ref:i,checked:!!n.value,disabled:o.disabled,onChange:a})}}});var Cn=require("vue");function fu(o){let t={};return Object.keys(o).forEach(e=>{t[e]=e}),t}var pu=fu({"data-name":""}),Ur={[pu["data-name"]]:"menu-icon"},mu=`[${pu["data-name"]}="${Ur["data-name"]}"]`;var nh={width:"100%",pointerEvents:"none"},qr=`${ht}-menu`,Ao=(0,Cn.defineComponent)({name:"MenuIcon",props:{lineWidth:{type:Number,required:!1},lineStyle:{type:Object,required:!1},style:{type:Object,required:!1},className:{type:String,required:!1},domProps:{type:Object,required:!1},reserveSpaceWhenHidden:{type:Boolean,required:!1},menuVisible:{type:Boolean,required:!1}},setup(o,{slots:t}){return()=>{let e={...nh,borderTop:`${Pe.components.HeaderCell.menuIconLineWidth} solid currentColor`,...o.lineStyle},n=t.default?t.default():[(0,Cn.h)("div",{class:qr,style:e}),(0,Cn.h)("div",{class:qr,style:e}),(0,Cn.h)("div",{class:qr,style:e})];return(0,Cn.h)("div",{...o.domProps,style:o.style,...Ur,onPointerdown:i=>{i.stopPropagation(),o.domProps?.onPointerdown?.(i)},class:te(o.className,Jl({menuVisible:o.menuVisible,reserveSpaceWhenHidden:o.reserveSpaceWhenHidden}),ht,`${ht}-menu`)},n)}}});var st=require("vue");var hu="_1b8djff0 _16lm1iw1p _16lm1iw2f _16lm1iw1 _16lm1iw32";var gu={transition:"width 0.25s, opacity 0.25s"},yu=Object.keys({direction:1,size:1,lineWidth:1,lineStyle:1,style:1,className:1,index:1,forceSize:1});var bu=(0,st.defineComponent)(o=>{let t=(0,st.ref)(!0),e=(0,st.ref)(0),n=null;(0,st.watch)(()=>o.direction,r=>{let a=r!=0?1:0;!t.value&&a&&(t.value=!0),a!==e.value&&(n!=null&&cancelAnimationFrame(n),n=requestAnimationFrame(()=>{n=null,e.value=a}))},{immediate:!0}),(0,st.onBeforeUnmount)(()=>{n!=null&&cancelAnimationFrame(n)});let i=()=>{let a=!(e.value===0&&o.direction===0);a!==t.value&&(t.value=a)};return()=>{let{direction:r,lineWidth:a=1,className:l,index:u}=o;if(!t.value&&!o.forceSize)return null;let d=u!=null&&u>0,s=o.size??16,c=Math.floor(s/4),f=r?[s-3*c,s-2*c,s-c]:[0,0,0];r===-1&&f.reverse();let m={...gu,borderTop:`${a}px solid currentColor`,...o.lineStyle,opacity:e.value},p={};return r===-1&&(p.top="100%"),(0,st.h)("div",{"data-name":"sort-icon",style:{...o.style,width:`${s}px`},class:te(l,ht,hu,`${ht}-sort`)},[d?(0,st.h)("div",{"data-name":"index",style:p,class:ts},`${u}`):null,(0,st.h)("div",{style:{width:`${f[0]}px`,...m},onTransitionend:i}),(0,st.h)("div",{style:{width:`${f[1]}px`,...m}}),(0,st.h)("div",{style:{width:`${f[2]}px`,...m}})])}},{name:"SortIcon",props:[...yu]});var{rootClassName:Cu}=He,kt=`${Cu}Cell`,ui=`${Cu}Cell_content`;function Yr(o){return Math.max(o.width-Nt(),0)}function Tu(o){let{context:t,column:e,diff:n,shareSpaceOnResize:i}=o,r=t.getState(),{columnSizing:a,viewportReservedWidth:l,bodySize:u}=r,d=t.getComputed().computedVisibleColumns,s=!1,c=d.reduce((m,p)=>(p.computedFlex&&(m[p.id]={...a[p.id],flex:p.computedWidth},s=!0),m),{}),f=s?{...a,...c}:a;return Mr({shareSpaceOnResize:i,availableSize:Yr(u),reservedWidth:l||0,dragHandleOffset:n,dragHandlePositionAfter:e.computedVisibleIndex,columnSizing:f,items:d.map(m=>({id:m.id,computedFlex:m.computedFlex,computedWidth:m.computedWidth,computedMinWidth:m.computedMinWidth,computedMaxWidth:m.computedMaxWidth}))})}var Tn=require("vue");function Su(o,{columns:t,shareSpaceOnResize:e,domRef:n}){let i=t[o];return{resize(r){Se.columnWidths.set(o,i.computedWidth+r,n.current);let a=o+1;if(e){let l=t[a];if(!l)return;Se.columnWidths.set(a,l.computedWidth-r,n.current),l.computedPinned==="start"?Kr(l,r,n.current):Se.columnOffsets.set(a,l.computedOffset+r,n.current);return}if(i.computedPinned!=="end"){if(i.computedPinned==="start"){for(let l=a,u=t.length;l<u;l++){let d=t[l];if(d.computedPinned==="start"){Kr(d,r,n.current);continue}d.computedPinned!=="end"&&Se.columnOffsets.set(l,d.computedOffset+r,n.current)}return}for(let l=a,u=t.length;l<u;l++){let d=t[l];d.computedPinned||Se.columnOffsets.set(l,d.computedOffset+r,n.current)}}}}}function wu(o,t){let e=o[o.length-1];return{resize(n){let{columns:i,domRef:r}=t,a=i[o[0]],l=a.computedOffset,u=0,d=r.current;if(n.forEach((s,c)=>{u+=s;let f=o[c],m=i[f],p=m.computedWidth+s;Se.columnWidths.set(f,p,d),m.computedPinned!=="end"&&(l&&Se.columnOffsets.set(f,l,d),l+=p)}),a.computedPinned!=="end")for(let s=e+1;s<i.length;s++){let c=i[s];c.computedPinned!=="end"&&Se.columnOffsets.set(s,c.computedOffset+u,d)}}}}var di="zneyzh0 _16lm1iw2 _16lm1iw23 _16lm1iw2c _16lm1iw2a _16lm1iwm _16lm1iw35",ci=ve({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"]]}),fi=ve({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 vu=require("vue"),Kn=Symbol("InfiniteTable");function qe(){return(0,vu.inject)(Kn)}var{rootClassName:oh}=He,ih=`${oh}HeaderCell_ResizeHandle`,Iu=(0,Tn.defineComponent)({name:"ResizeHandle",props:{horizontalLayoutPageIndex:{type:Number,default:null},columnIndex:{type:Number,required:!0},columns:{type:Array,required:!0},computeResize:{type:Function,required:!0},onResize:{type:Function,required:!0}},setup(o){let t=qe(),{getState:e}=t,n={current:null},i=(0,Tn.ref)(!1),r=a=>{a.stopPropagation();let l=o.columns[o.columnIndex];if(!l)return;let u=l.computedPinned,d=o.horizontalLayoutPageIndex,{brain:s,headerBrain:c}=e(),f=!!a.shiftKey,m=a.pointerId,p=a.clientX,h=a.target,y=()=>{};if(s.isHorizontalLayoutBrain){let T=s.extendRenderRange({start:!0,end:!0,direction:"horizontal"}),P=c.extendRenderRange({start:!0,end:!0,direction:"horizontal"});y=()=>{T(),P()}}h.setPointerCapture(m);let C=Su(o.columnIndex,{columns:o.columns,shareSpaceOnResize:f,domRef:n}),b=(T,{done:P}={})=>{d&&(T=T/(d+1),P&&(T=Math.round(T))),u==="end"&&(T*=-1);let{adjustedDiff:R,constrained:E}=o.computeResize({diff:T,shareSpaceOnResize:f});return i.value!==E&&(i.value=E),C.resize(R),R},S=T=>{b(Math.round(T.clientX-p))},w=T=>{h.releasePointerCapture(m),h.removeEventListener("pointermove",S),h.removeEventListener("pointerup",w);let P=Math.round(T.clientX-p),R=b(P,{done:!0});y(),C.resize(0),o.onResize({diff:R,shareSpaceOnResize:f})};h.addEventListener("pointermove",S),h.addEventListener("pointerup",w)};return()=>{let a=o.columns[o.columnIndex];if(!a)return null;let l=a.computedPinned,u=a.computedFirstInCategory,d=a.computedLastInCategory,s=(l===!1||l==="start")&&d?{right:l==="start"?void 0:0}:l==="end"&&u?{right:void 0}:void 0;return(0,Tn.h)("div",{ref:c=>{n.current=c??null},class:`${ih} ${di} ${fi({computedPinned:l,computedFirstInCategory:u,computedLastInCategory:d})}`,onPointerdown:r},[(0,Tn.h)("div",{style:s,class:ci({constrained:i.value,computedPinned:l,computedFirstInCategory:u,computedLastInCategory:d})})])}}});var rh=U(j.columnWidthAtIndex),ah=U(j.columnReorderEffectDurationAtIndex),lh=U(j.columnZIndexAtIndex),sh=U(j.columnVisibilityAtIndex),Ru=Symbol("InfiniteHeaderCell");function _o(){return(0,de.inject)(Ru)}var uh=o=>{let{allRowsSelected:t,someRowsSelected:e,api:n,dataSourceApi:i}=o,r=t?!0:e?null:!1,{components:a,isTree:l}=n.getState(),u=a?.CheckBox||ln;return(0,de.h)(u,{domProps:{class:si},onChange:d=>{if(l){d?i.treeApi.selectAll():i.treeApi.deselectAll();return}d?n.rowSelectionApi.selectAll():n.rowSelectionApi.deselectAll()},checked:r})};function Sn(o,t){return o(t)}var Xr=()=>(0,de.h)("div",{class:Dl[1]}),xu=(0,de.defineComponent)({name:"InfiniteTableHeaderCell",props:{column:{type:Object,required:!0},columnsMap:{type:Object,required:!0},width:{type:Number,required:!0},height:{type:Number,required:!0},headerOptions:{type:Object,required:!0},horizontalLayoutPageIndex:{type:Number,default:null},domRef:{type:Function,required:!0},allRowsSelected:{type:Boolean,required:!0},someRowsSelected:{type:Boolean,required:!0},selectionMode:{type:[String,Boolean],required:!0}},setup(o){let t=qe(),{api:e,actions:n,getState:i,getComputed:r,dataSourceContext:a}=t,{getDataSourceState:l,dataSourceApi:u,dataSourceActions:d}=a,s={current:null},c=v=>{let D=v&&v.$el!==void 0?v.$el:v;s.current=D??null,o.domRef(s.current)},f=(0,de.shallowRef)(null);(0,de.provide)(Ru,f);let m=()=>lt(o.column,{actions:n,api:e,dataSourceActions:d,dataSourceApi:u,getComputed:r,getDataSourceState:l,getDataSourceMasterContext:()=>l().getDataSourceMasterContextRef?.current?.()??void 0,getState:i}),p=null,h=()=>{let v=o.column.id,D=l().filterDelay,M=`${v}:${D}`;if(!p||p.key!==M){let A=x=>{e.setColumnFilter(v,x)};p={key:M,fn:D>0?en(A,{wait:D}):A}}return p.fn},y=(0,de.ref)(null),C=(0,de.ref)(!1),{onPointerDown:b}=Ys({columnId:o.column.id,context:{getState:i,getComputed:r,actions:n,api:e},domRef:s,getHorizontalLayoutPageIndex:()=>o.horizontalLayoutPageIndex,allowColumnHideOnDrag:!0,proxyPosition:y,dragColumnOutside:C}),S=(0,de.computed)(()=>t.state.value.columnMenuVisibleForColumnId),w=(0,de.computed)(()=>t.state.value.columnReorderDragColumnId),T=(0,de.computed)(()=>t.state.value.columnReorderInPageIndex),P=(0,de.computed)(()=>t.state.value.showColumnFilters),R=(0,de.computed)(()=>t.state.value.columnHeaderHeight),E=(0,de.computed)(()=>t.state.value.components),N=(0,de.computed)(()=>a.state.value.filterTypes);return()=>{let{column:v,columnsMap:D,horizontalLayoutPageIndex:M,headerOptions:A}=o,{allRowsSelected:x,someRowsSelected:F,selectionMode:_}=o,O=v.computedSortInfo,L=v.header,K=m(),B=K.isSortable(),G=A.alwaysReserveSpaceForSortIcon,se=v.headerAlign??v.align,Y=(typeof se=="function"?se({isHeader:!0,column:v}):se)??"start",Ae=(typeof v.verticalAlign=="function"?v.verticalAlign({isHeader:!0,column:v}):v.verticalAlign)??"center",ge=B&&(v.computedSorted||G)?(0,de.h)(bu,{index:v.computedMultiSort?v.computedSortIndex+1:void 0,style:{marginInlineStart:Pe.spacing[2],marginInlineEnd:Pe.spacing[2]},className:`${yn}__sort-icon ${es} ${ns({align:Y})}`,direction:v.computedSorted?v.computedSortedAsc?1:-1:0}):null,Ge=v.computedFilterable&&v.computedFiltered?(0,de.h)(Fn):null,Oe=v.headerCssEllipsis??v.cssEllipsis??!0,we=S.value,Fe=w.value,ce=T.value,ee=Fe===v.id,H=ce!=null?M!==ce:!1,Z={reserveSpaceWhenHidden:Y==="center",menuVisible:we===v.id,style:Y==="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:ae=>{ae.stopPropagation(),K.toggleContextMenu(ae.target)}}},J=v.components?.MenuIcon||E.value?.MenuIcon||Ao,oe=(0,de.h)(J,Z),re=P.value,ye=N.value,be=v.computedFilterType,ie=ye[be],W=v.computedFilterable?v.computedFilterValue?.filter.operator??ie?.defaultOperator:void 0,ne=v.computedFilterable&&ie?ie.operators.find(ae=>ae.name===W):void 0,Te=ne?.components?.FilterEditor||ie?.components?.FilterEditor||v.components?.FilterEditor||Bn,De=ie?.components?.FilterOperatorSwitch||v.components?.FilterOperatorSwitch||Du,Me=v.computedFilterable?(0,de.h)(Pu,{filterProps:{horizontalLayoutPageIndex:M,filterEditor:Te,filterOperatorSwitch:De,operator:ne,filterTypes:ye,onChange:h(),columnFilterType:be,columnLabel:v.field||v.name||v.id,columnFilterValue:v.computedFilterValue,columnHeaderHeight:R.value}}):(0,de.h)(Au),Ze={horizontalLayoutPageIndex:M,dragging:ee,domRef:c,htmlElementRef:s,renderLocation:"column-header",column:v,columnsMap:D,columnSortInfo:O,columnFilterValue:v.computedFilterValue,filtered:v.computedFiltered,someRowsSelected:F,allRowsSelected:x,selectionMode:_,api:e,dataSourceApi:u,columnApi:K,renderBag:{sortIcon:ge,filterIcon:Ge,menuIcon:oe,menuIconProps:Z,selectionCheckBox:null,header:v.header&&typeof v.header!="function"?v.header:v.name}},je=Ze;je.renderBag.filterEditor=Me,f.value=je;let fe={...Ze,renderBag:{...Ze.renderBag}};if(v.renderSortIcon&&(fe.renderBag.sortIcon=Sn(v.renderSortIcon,{...fe,renderBag:{...fe.renderBag}})),v.renderFilterIcon&&(fe.renderBag.filterIcon=Sn(v.renderFilterIcon,{...fe,renderBag:{...fe.renderBag}})),typeof v.renderMenuIcon=="function"){let ae=Sn(v.renderMenuIcon,{...fe,renderBag:{...fe.renderBag}});fe.renderBag.menuIcon=ae?ae.type===J||ae.type===Ao?ae:(0,de.h)(J,Z,()=>ae):null}if(v.renderSelectionCheckBox&&_==="multi-row"){fe.renderBag.selectionCheckBox=Sn(uh,{...fe,renderBag:{...fe.renderBag}});let ae=v.renderHeaderSelectionCheckBox??v.renderSelectionCheckBox;ae&&ae!==!0&&(fe.renderBag.selectionCheckBox=Sn(ae,{...fe,renderBag:{...fe.renderBag}}))}L instanceof Function&&(fe.renderBag.header=Sn(L,{...fe,renderBag:{...fe.renderBag}}));let mt=Oe?(0,de.h)("div",{class:Tt},[fe.renderBag.header]):fe.renderBag.header,it=v.renderMenuIcon===!1?null:fe.renderBag.menuIcon,vt=[Y==="center"?Xr():null,fe.renderBag.selectionCheckBox,mt,fe.renderBag.sortIcon,fe.renderBag.filterIcon,Y==="center"?Xr():null,Y!=="center"?Xr():null,it],Mt=v.renderHeader?Sn(v.renderHeader,{...fe,renderBag:{...fe.renderBag,all:vt}}):vt,$e={height:`${o.height}px`};v.headerStyle&&($e=typeof v.headerStyle=="function"?{...$e,...v.headerStyle(je)||{}}:{...$e,...v.headerStyle});let g=typeof v.headerClassName=="function"?v.headerClassName(je):v.headerClassName,I=`var(${lh}-${v.computedVisibleIndex})`;$e.zIndex=I,$e.visibility=`var(${sh}-${v.computedVisibleIndex}, visible)`,$e.width=`var(${rh}-${v.computedVisibleIndex})`,$e.transition=`transform var(${ah}-${v.computedVisibleIndex}, 0s)`;let z={filtered:v.computedFiltered,verticalAlign:Ae,align:Y},k={"data-field":`${v.field||""}`,"data-column-id":v.id,"data-header-align":Y,"data-name":"HeaderCell","data-sort":v.computedSortedAsc?"asc":v.computedSortedDesc?"desc":"none","data-sort-index":`${v.computedSortIndex??-1}`},q=te(yn,Ol.none,B?Pl.pointer:"",g,oi(v,[yn,kt],jl,{dragging:ee,insideDisabledDraggingPage:H,align:Y,verticalAlign:Ae,rowSelected:!1,cellSelected:!1,rowDisabled:!1,zebra:!1,rowActive:!1,firstRow:!0,firstRowInHorizontalLayoutPage:!0,treeNode:!1,groupCell:!1,groupRow:!1,rowExpanded:!1}),Kl,kt,ai),V=(0,de.h)("div",{class:te(ui,Oe?Tt:Zo.hidden,Bl(z),_l[Y]),style:re?{height:`${o.height/2}px`}:void 0},[Mt]),Q=ae=>Tu({context:{getState:i,getComputed:r},column:v,diff:ae.diff,shareSpaceOnResize:ae.shareSpaceOnResize}),pe=v.computedResizable?(0,de.h)(Iu,{horizontalLayoutPageIndex:M,columns:r().computedVisibleColumns,columnIndex:v.computedVisibleIndex,computeResize:Q,onResize:ae=>{let{columnSizing:Ct,reservedWidth:Ht}=Q(ae);ae.shareSpaceOnResize||(n.viewportReservedWidth=Ht),n.columnSizing=Ct}}):null,ue=[re?Me:null,pe],me={ref:c,...k,"data-z-index":I,style:$e,class:q,onPointerdown:b},le=null,Ce=i().portalDOMRef.current;ee&&y.value&&Ce&&(le=(0,de.h)(de.Teleport,{to:Ce},[(0,de.h)("div",{key:v.id,class:`${yn}Proxy ${Hl}`,style:{height:`${o.height}px`,width:`${o.width}px`,left:`${y.value.left??0}px`,top:`${y.value.top??0}px`}},[(0,de.h)("div",{class:Wl({visible:C.value})},[(0,de.h)($r,{size:16})]),fe.renderBag.header])]));let xe=v.components?.HeaderCell;return xe?[(0,de.h)(xe,me,{default:()=>[V,ue]}),le]:[(0,de.h)("div",me,[V,ue]),le]}}});var _u=Symbol("InfiniteColumnHeaderFilter"),pi=o=>o.stopPropagation(),Pu=(0,Ie.defineComponent)({name:"InfiniteTableColumnHeaderFilter",props:{filterProps:{type:Object,required:!0}},setup(o){let t=qe(),e=_o(),n=(0,Ie.shallowRef)(o.filterProps);(0,Ie.provide)(_u,n);let i=(0,Ie.ref)(!1),r=()=>{i.value=!0},a=()=>{i.value=!1};return()=>{n.value=o.filterProps;let l=e.value.column,d=t.state.value.filterOperatorMenuVisibleForColumnId===l.id||i.value,s=o.filterProps.filterEditor,c=o.filterProps.filterOperatorSwitch;return(0,Ie.h)("div",{onPointerup:pi,onPointerdown:pi,onFocusin:r,onFocusout:a,class:`${ni} ${Dr({active:d})}`,style:{height:`${o.filterProps.columnHeaderHeight}px`}},[(0,Ie.h)(c),(0,Ie.h)(s)])}}}),Du=(0,Ie.defineComponent)({name:"InfiniteTableFilterOperatorSwitch",setup(){let o=Hn();return()=>{let t=o.disabled.value,n=o.operator.value?.components?.Icon??Fn;return(0,Ie.h)("div",{"data-name":"filter-operator","data-disabled":t,onMousedown:i=>{i.stopPropagation(),!t&&o.columnApi.toggleFilterOperatorMenu(i.target)},class:te(Or,Yl,t?`${Or}--disabled`:"")},[(0,Ie.h)(n,{size:20,className:`${Xl({disabled:!!t})}`})])}}}),Au=(0,Ie.defineComponent)({name:"InfiniteTableColumnHeaderFilterEmpty",setup(){return()=>(0,Ie.h)("div",{onPointerup:pi,onPointerdown:pi,class:`${ni} ${Dr({active:!1})} ${Al["50%"]}`})}});function Hn(){let o=qe(),t=_o(),e=(0,Ie.inject)(_u),{api:n,getComputed:i,getState:r,actions:a,dataSourceContext:l}=o,{getDataSourceState:u,dataSourceApi:d,dataSourceActions:s}=l,c=(0,Ie.computed)(()=>t.value.column),f=(0,Ie.computed)(()=>{let{columnFilterType:S,filterTypes:w}=e.value;return w[S]}),m=(0,Ie.ref)(e.value.columnFilterValue?.filter.value??"");(0,Ie.watch)(()=>e.value.columnFilterValue?.filter.value,S=>{if(e.value.columnFilterValue)m.value!==S&&(m.value=S);else{let w=f.value;if(w){let T=[...w.emptyValues][0];T!==m.value&&(m.value=T)}}});let p=S=>{m.value=S,e.value.onChange(S)},h=()=>{n.clearColumnFilter(c.value.id)},y=()=>{n.removeColumnFilter(c.value.id)},C={api:n,getState:r,getComputed:i,getDataSourceState:u,actions:a,dataSourceActions:s,dataSourceApi:d},b=(0,Ie.computed)(()=>`Filter for ${wo(c.value,C,"column-filter")}`);return{api:n,column:c,columnFilterValue:(0,Ie.computed)(()=>e.value.columnFilterValue),columnApi:t.value.columnApi,operator:(0,Ie.computed)(()=>e.value.operator),operatorName:(0,Ie.computed)(()=>e.value.operator?.name),value:m,disabled:(0,Ie.computed)(()=>e.value.columnFilterValue?.disabled),filterType:f,filterTypes:(0,Ie.computed)(()=>e.value.filterTypes),filterTypeKey:(0,Ie.computed)(()=>e.value.columnFilterType),filtered:(0,Ie.computed)(()=>c.value.computedFiltered),setValue:p,clearValue:h,removeColumnFilter:y,ariaLabel:b,className:`${Ul} ${ys}`}}var Bn=(0,Wn.defineComponent)({name:"StringFilterEditor",setup(){let o=Hn();return()=>(0,Wn.h)("input",{"aria-label":o.ariaLabel.value,type:"text",disabled:o.disabled.value,value:o.value.value??"",onInput:t=>{o.setValue(t.target.value)},class:o.className})}}),mi=(0,Wn.defineComponent)({name:"NumberFilterEditor",setup(){let o=Hn();return()=>(0,Wn.h)("input",{"aria-label":o.ariaLabel.value,type:"number",disabled:o.disabled.value,value:o.value.value??"",onInput:t=>{let e=t.target,n=isNaN(e.valueAsNumber)?e.value:e.valueAsNumber;o.setValue(n)},class:o.className})}});var Lt=(o,t)=>{let e=o?.[t];return e?{components:{Icon:e}}:{}};function Mu(o={}){let{StringFilterEditor:t,NumberFilterEditor:e,icons:n}=o;return{string:{label:"Text",emptyValues:[""],defaultOperator:"includes",components:t?{FilterEditor:t}:void 0,operators:[{name:"includes",...Lt(n,"includes"),label:"Includes",fn:({currentValue:i,filterValue:r})=>typeof i=="string"&&typeof r=="string"&&i.toLowerCase().includes(r.toLowerCase())},{label:"Equals",...Lt(n,"eq"),name:"eq",fn:({currentValue:i,filterValue:r})=>typeof i=="string"&&i===r},{name:"startsWith",...Lt(n,"startsWith"),label:"Starts With",fn:({currentValue:i,filterValue:r})=>i.startsWith(r)},{name:"endsWith",...Lt(n,"endsWith"),label:"Ends With",fn:({currentValue:i,filterValue:r})=>i.endsWith(r)}]},number:{label:"Number",emptyValues:["",null,void 0],defaultOperator:"eq",components:e?{FilterEditor:e}:void 0,operators:[{label:"Equals",...Lt(n,"eq"),name:"eq",fn:({currentValue:i,filterValue:r})=>i==r},{label:"Not Equals",...Lt(n,"neq"),name:"neq",fn:({currentValue:i,filterValue:r})=>i!=r},{name:"gt",label:"Greater Than",...Lt(n,"gt"),fn:({currentValue:i,filterValue:r,emptyValues:a})=>a.includes(i)?!0:i>r},{name:"gte",...Lt(n,"gte"),label:"Greater Than or Equal",fn:({currentValue:i,filterValue:r,emptyValues:a})=>a.includes(i)?!0:i>=r},{name:"lt",...Lt(n,"lt"),label:"Less Than",fn:({currentValue:i,filterValue:r,emptyValues:a})=>a.includes(i)?!0:i<r},{name:"lte",...Lt(n,"lte"),label:"Less Than or Equal",fn:({currentValue:i,filterValue:r,emptyValues:a})=>a.includes(i)?!0:i<=r}]}}}var On=Mu({StringFilterEditor:Bn,NumberFilterEditor:mi,icons:{includes:Zs,eq:eu,neq:tu,startsWith:Js,endsWith:Qs,gt:nu,gte:ou,lt:iu,lte:ru}});var hi=class{constructor(t){let e=t instanceof Object.getPrototypeOf(this).constructor?t.getState():t,n=this.getPositiveFromState(e),i=this.getNegativeFromState(e);this.update({negativeItems:i,positiveItems:n})}getInitialState(){return this.initialState}destroy(){this.positiveMap?.clear(),this.negativeMap?.clear(),delete this.positiveMap,delete this.negativeMap}update(t){let{positiveItems:e,negativeItems:n}=t;if(this.allNegative=n===!0,this.allPositive=e===!0,this.allNegative&&this.allPositive)throw"Cannot have both negativeItems and positiveItems be true!";n!==!0&&(this.negativeMap?(this.negativeMap.clear(),this.negativeMap.fill(n.map(i=>[i,!0]))):this.negativeMap=new $(n.map(i=>[i,!0])),this.positiveMap&&this.positiveMap.clear()),e!==!0&&(this.positiveMap?(this.positiveMap.clear(),this.positiveMap.fill(e.map(i=>[i,!0]))):this.positiveMap=new $(e.map(i=>[i,!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(t){if(this.allPositive===!0){if(this.allNegative===!0)throw'Cannot have both positiveItems and negativeItems be "true"';return!this.negativeMap?.has(t)}return this.positiveMap?.has(t)}isItemNegative(t){return!this.isItemPositive(t)}setItemValue(t,e){if(e!==this.isItemPositive(t)){if(e){if(this.allNegative===!0){if(!this.positiveMap)throw`No positiveMap found when trying to set item ${t.join(",")} be positive`;this.positiveMap.set(t,!0)}else if(this.allPositive===!0){if(!this.negativeMap)throw`No negativeMap found when trying to set item ${t.join(",")} be positive`;this.negativeMap.delete(t)}}else if(this.allPositive===!0){if(!this.negativeMap)throw`No negativeMap found when trying to set item ${t.join(",")} be negative`;this.negativeMap.set(t,!0)}else if(this.allNegative===!0){if(!this.positiveMap)throw`No positiveMap found when trying to set item ${t.join(",")} be negative`;this.positiveMap?.delete(t)}}}makeItemNegative(t){this.setItemValue(t,!1)}makeItemPositive(t){this.setItemValue(t,!0)}toggleItem(t){this.setItemValue(t,!this.isItemPositive(t))}};var St=class extends hi{constructor(t){super(t)}getState(){return{expandedRows:this.allPositive?!0:this.positiveMap?.topDownKeys()??[],collapsedRows:this.allNegative?!0:this.negativeMap?.topDownKeys()??[]}}getPositiveFromState(t){return t.expandedRows}getNegativeFromState(t){return t.collapsedRows}areAllCollapsed(){return this.areAllNegative()}areAllExpanded(){return this.areAllPositive()}collapseAll(){this.makeAllNegative()}expandAll(){this.makeAllPositive()}isGroupRowExpanded(t){return this.isItemPositive(t)}isGroupRowCollapsed(t){return!this.isGroupRowExpanded(t)}setGroupRowExpanded(t,e){return this.setItemValue(t,e)}collapseGroupRow(t){this.setGroupRowExpanded(t,!1)}expandGroupRow(t){this.setGroupRowExpanded(t,!0)}toggleGroupRow(t){this.toggleItem(t)}};var gi=class{constructor(){this.primaryKeyToData=new Map;this.nodePathsToData=new $;this.removeNodePath=(t,e)=>{if(this.nodePathsToData.delete(t),this.remove(t[t.length-1]),!e)return;let n=this.nodePathsToData.get(t);if(n){let i=e.getNodeChildren?e.getNodeChildren(n):e.nodesKey?n[e.nodesKey]:null;if(i&&Array.isArray(i))for(let r=0,a=i.length;r<a;r++){let l=i[r],u=[...t,e.toPrimaryKey(l)];this.removeNodePath(u,e)}}};this.remove=t=>{this.primaryKeyToData.delete(t)};this.add=(t,e)=>{this.primaryKeyToData.set(t,e)};this.addNodePath=(t,e,n)=>{if(this.nodePathsToData.set(t,e),this.add(t[t.length-1],e),!n)return;let i=n.getNodeChildren?n.getNodeChildren(e):n.nodesKey?e[n.nodesKey]:null;if(i&&Array.isArray(i))for(let r=0,a=i.length;r<a;r++){let l=i[r],u=[...t,n.toPrimaryKey(l)];this.addNodePath(u,l,n)}};this.clear=()=>{this.primaryKeyToData.clear(),this.nodePathsToData.clear()};this.getDataForPrimaryKey=t=>this.primaryKeyToData.get(t);this.getDataForNodePath=t=>this.nodePathsToData.get(t);this.indexArray=(t,e)=>{let{cache:n,toPrimaryKey:i,getNodeChildren:r,isLeafNode:a,nodesKey:l}=e,u=!!r&&!!a;n&&n.shouldResetDataSource()&&(this.clear(),t=[]);let d=n&&!n.isEmpty();if(d&&(t=t.concat()),!t.length&&n){if(!n.isEmpty()){let s=[...n.getMutationsArray(),...n.getTreeMutationsArray()];for(let c=0,f=s.length;c<f;c++){let m=s[c];if(m.type==="insert"){let p=i(m.data);u?this.addNodePath([p],m.data,e):this.add(p,m.data),t.push(m.data)}}n?.removeInfo(void 0)}}else{let s=(c,f)=>{for(let m=0;m<c.length;m++){let p=c[m];d&&u&&Array.isArray(p[l])&&(p=c[m]={...p});let h=!1;if(p!=null){let y=i(p),C=u?[...f,y]:void 0,b=u&&!!C,S=b?n?.getMutationsForNodePath(C):n?.getMutationsForPrimaryKey(y);if(S&&S.length){for(let w=0,T=S.length;w<T;w++){let P=S[w];if(P.type==="delete"&&!h&&(b?this.removeNodePath(C,e):this.remove(y),h=!0,c.splice(m,1),m--),P.type==="update"&&!h&&(p={...p,...P.data},c[m]=p),P.type==="update-children"&&!h){let R=P.children(p[l],p);p={...p},R!==void 0?p[l]=R:delete p[l],c[m]=p}P.type==="insert"&&(P.position==="before"?(c.splice(m,0,P.data),m--):c.splice(m+1,0,P.data))}b?n?.removeNodePathInfo(C):n?.removeInfo(y)}if(!h)if(b){this.addNodePath(C,p);let w=a(p),T=w?null:r(p);!w&&Array.isArray(T)&&(f.push(y),d&&(p[l]=T=T.concat()),s(T,f),f.pop())}else this.add(y,p)}}};s(t,[])}return t}}};function Zr(o){return o.map(zt)}function zt(o){if(ze().structuredClone)return ze().structuredClone(o);if(o===null||typeof o!="object")return o;if(Array.isArray(o))return Zr(o);if(o instanceof Date)return new Date(o);if(o instanceof Set)return new Set(Zr(Array.from(o)));if(o instanceof Map)return new Map(Zr(Array.from(o)));let t={};for(let e in o)o.hasOwnProperty(e)&&(t[e]=zt(o[e]));return t}var wn=Object.seal({data:null,field:null});var jn="____root____",Fu="____not_loaded_yet____";function sn(){return!1}function Jr(o){if(!o||!Object.keys(o).length)return{};let t={};for(let e in o)if(o.hasOwnProperty(e)){let n=o[e].initialValue;t[e]=typeof n=="function"?n():n}return t}function yi(o,t,e,n,i){if(!(!e||!Object.keys(e).length)){for(let r in e)if(e.hasOwnProperty(r)){let a=e[r];if(typeof a.reducer!="function")continue;let l=n[r],u=a.getter?a.getter(o)??null:a.field?o[a.field]:null;n[r]=a.reducer(l,u,o,t,i)}}}function Nu(o,t){let{marker:e,reducers:n={},pivot:i,groupBy:r,indexer:a,toPrimaryKey:l,cache:u,mappings:d}=o;e&&e.start();let s=new $;function c(C,b,S,w=0,T=[]){let P=!S.length||w===S.length-1,R=b[d?.values||"values"]||{};for(let E in R)if(R.hasOwnProperty(E)){let N=E;T.push(N),f.set(T,!0),C.set(T,{reducerResults:R[E][d?.totals||"totals"]||{},items:[]}),P||c(C,R[E],S,w+1,T),T.pop()}}let f=i?new $:void 0,m=[],p=Jr(n),h=zt(p);t.visitDepthFirst((C,b,S,w)=>{let[T,...P]=b,R=C.children,E=s.get(P);if(E&&(E.cache=C.cache,E.childrenLoading=C.childrenLoading,E.childrenAvailable=C.childrenAvailable,E.error=C.error),P.length==r.length&&r.length){if(E){E.items=R;for(let v=0,D=P.length;v<D;v++){let M=P.slice(0,v),A=s.get(M);A&&(A.items=A.items||[],A.items=A.items.concat(R))}R=a.indexArray(R,{toPrimaryKey:l,cache:u,nodesKey:void 0})}return w?.()}for(let N=0,v=R.length;N<v;N++){if(!R[N]){let x={items:[],reducerResults:{},cache:!1,childrenLoading:!1,childrenAvailable:!1,isTree:!1,isGroupBy:!0};s.set([...P,`${Fu}${N}`],x);continue}let D=R[N].data,M=R[N].keys||[];if(M.length){let x=M[M.length-1];P.push(x)}let A={items:[],cache:!1,childrenLoading:!1,childrenAvailable:!1,commonData:D,totalChildrenCount:R[N].totalChildrenCount,reducerResults:R[N].aggregations||{},isTree:!1,isGroupBy:!0};if(s.set(P,A),i){let x=A.pivotDeepMap=new $,F=R[N].pivot;c(x,F,i,0,m)}M.length&&P.pop()}w?.()});let y={deepMap:s,groupParams:o,initialData:t,reducerResults:h};return i&&(y.topLevelPivotColumns=f,y.pivot=i),e&&e.end({details:[{name:"Group by fields",value:r.map(C=>C.field).join(", ")}]}),y}function Eu(o,t,e,n,i,r,a,l,u,d=Co){let{items:s,reducerResults:c,pivotDeepMap:f}=o.get(t);if(s.push(n),a&&yi(n,i,a,c,t),r){for(let m=0,p=r.length;m<p;m++){let{field:h,valueGetter:y,toKey:C}=r[m],b=h?n[h]:null;y&&(wn.data=n,wn.field=h,b=y(wn));let S=(C||d)(b,n);e.push(S),f.has(e)||(l.set(e,!0),f?.set(e,{reducerResults:zt(u),items:[]}));let{reducerResults:w,items:T}=f.get(e);T.push(n),a&&yi(n,i,a,w,t)}e.length=0}}function Ou(o,t,e,n,i,r,a,l){let{isLeafNode:u,getNodeChildren:d,toKey:s}=o,c=s(i),f=[...n,c],m=u(i);if(e.set(f,!0),m){for(let C=0,b=n.length;C<=b;C++){let S=n.slice(0,C),w=t.get(S),{reducerResults:T,items:P}=w;P.push(i),w.leavesAvailableCount++,w.totalLeafNodesCount++,a&&yi(i,r,a,T,S)}return}let p=zt(l),h=[];t.set(f,{items:h,isTree:!0,isGroupBy:!1,node:i,reducerResults:p,cache:!1,childrenLoading:!1,childrenAvailable:!0,totalLeafNodesCount:0,leavesAvailableCount:0,treeNesting:n.length});let y=d(i);if(!(!y||!Array.isArray(y))){for(let C=0,b=y.length;C<b;C++){let S=y[C];Ou(o,t,e,f,S,C,a,l)}a&&Mo(a,p,h)}}function Qr(o,t){let{reducers:e,marker:n}=o;if(n){let d=Object.keys(e??{});n.start({details:d.length>0?[{name:"Reducers",value:d.join(", ")}]:void 0})}let i=Jr(e),r=zt(i),a=new $,l=new $;a.set([],{items:[],isTree:!0,isGroupBy:!1,reducerResults:r,cache:!1,childrenLoading:!1,childrenAvailable:!0,totalLeafNodesCount:0,leavesAvailableCount:0,node:null,treeNesting:-1});for(let d=0,s=t.length;d<s;d++)Ou(o,a,l,[],t[d],d,e,i);e&&Mo(e,r,t);let u={deepMap:a,treeParams:o,treePaths:l,initialData:t,reducerResults:r};return n&&n.end(),u}function Ci(o,t){let{marker:e,groupBy:n,defaultToKey:i=Co,pivot:r,reducers:a}=o;e&&e.start();let l=n.length,u=r?new $:void 0,d=new $,s=[],c=[],f=Jr(a),m=zt(f);if(!l){let h={items:[],isTree:!1,isGroupBy:!0,cache:!1,childrenLoading:!1,childrenAvailable:!1,reducerResults:zt(f)};r&&(h.pivotDeepMap=new $),d.set(s,h)}for(let h=0,y=t.length;h<y;h++){let C=t[h],b={};for(let S=0;S<l;S++){let{field:w,groupField:T,valueGetter:P,toKey:R}=n[S],E=w?C[w]:null;P&&(wn.data=C,wn.field=w,E=P(wn));let N=(R||i)(E,C);if(b[w||T]=N,s.push(N),!d.has(s)){let v={items:[],isTree:!1,isGroupBy:!0,cache:!1,commonData:{...b},childrenLoading:!1,childrenAvailable:!1,reducerResults:zt(f)};r&&(v.pivotDeepMap=new $),d.set(s,v)}Eu(d,s,c,C,h,r,a,u,f,i)}l||Eu(d,s,c,C,h,r,a,u,f,i),a&&yi(C,h,a,m,s),s.length=0}a&&(d.visitDepthFirst((h,y,C,b)=>{Mo(a,h.reducerResults,h.items),r&&h.pivotDeepMap.visitDepthFirst(({items:S,reducerResults:w},T,P,R)=>{Mo(a,w,S),R?.()}),b?.()}),Mo(a,m,t));let p={deepMap:d,groupParams:o,initialData:t,reducerResults:m};return r&&(p.topLevelPivotColumns=u,p.pivot=r),e&&e.end({details:[{name:"Group by fields",value:n.map(h=>h.field).join(", ")}]}),p}function ku(o){let{groupParams:t,deepMap:e}=o,n=t.groupBy.length,i=[];return e.topDownKeys().reduce((r,a)=>{if(a.length===n){let l=e.get(a).items;r.push(...l)}return r},i),i}function dh(o,t){let{groupBy:e,groupKeys:n,parents:i,reducers:r,lazyLoad:a}=o,l=n.length,{items:u,reducerResults:d,pivotDeepMap:s,commonData:c}=t,f=c??null,m;if(Object.keys(d).length>0){f={...c},m={};for(let b in r)if(r.hasOwnProperty(b)){let w=r[b].field;w&&(m[w]=d[b]),w&&f[w]==null&&(f[w]=d[b])}}let p=!0,h=n[n.length-1],y=h;if(f!=null){let b=e[n.length-1];b&&b.field&&(y=f[b.field]),b&&b.toKey&&(y=b.toKey(y,f)),y=y??h}return typeof y=="string"&&y.startsWith(Fu)&&(p=!1,y=null),{data:f,reducerData:m,groupCount:u.length,groupData:u,groupKeys:n,isTreeNode:!1,rowSelected:!1,selectedChildredCount:0,deselectedChildredCount:0,id:`${n}`,collapsed:!1,dataSourceHasGrouping:!0,rowDisabled:!1,isCellSelected:sn,hasSelectedCells:sn,selfLoaded:p,error:o.error,parents:i,deepRowInfoArray:[],collapsedChildrenCount:0,collapsedGroupsCount:0,totalChildrenCount:o.totalChildrenCount,childrenAvailable:a?o.childrenAvailable:!0,childrenLoading:o.childrenLoading,indexInParentGroups:o.indexInParentGroups,indexInGroup:o.indexInGroup,indexInAll:o.indexInAll,directChildrenCount:o.directChildrenCount,directChildrenLoadedCount:a?o.directChildrenLoadedCount:o.directChildrenCount,value:y,rootGroupBy:e,groupBy:l===e.length?e:e.slice(0,l),isGroupRow:!0,pivotValuesMap:s,groupNesting:l,reducerResults:d}}function bi(o,t,e){return{...o,id:`duplicate_row_on_page_${e}_for__${o.id}`,indexInAll:t,duplicateOf:o.id}}function Mo(o,t,e){if(o){for(let n in o)if(o.hasOwnProperty(n)){let i=o[n];i.done&&(t[n]=i.done(t[n],e))}}return t}function Lu(o,t,e,n,i,r){let a=t.length,{isLeafNode:l,getNodeChildren:u}=i.treeParams,{toPrimaryKey:d,treeResult:s,isRowDisabled:c,isNodeSelected:f,withRowInfo:m,isNodeExpanded:p,treeSelectionState:h,repeatWrappedGroupRows:y,rowsPerPage:C}=i,{deepMap:b}=s,S=o.length,w=e[e.length-1],T=w?w.nodeExpanded:!0;for(let P=0;P<S;P++){let R=o[P],E=d(R,P),N=[...t,E];if(l(R)){let _={id:E,nodePath:N,isGroupRow:!1,data:R,treeNesting:a,totalLeafNodesCount:0,collapsedLeafNodesCount:0,isTreeNode:!0,isParentNode:!1,selfLoaded:!0,rowSelected:!1,rowDisabled:!1,isCellSelected:sn,hasSelectedCells:sn,dataSourceHasGrouping:!1,parentNodes:Array.from(e),indexInParentNodes:[...n,P],indexInParent:P,indexInAll:T?r.length:-1};f&&(_.rowSelected=f(_)),c&&(_.rowDisabled=c(_)),m&&m(_);let O=y&&C!=null&&C>0&&_.indexInAll%C===0?_.indexInAll/C:null;for(let L=0,K=e.length;L<K;L++){let B=e[L];if(T||(B.collapsedLeafNodesCount+=1),B.deepRowInfoArray.push(_),O!=null&&T){if(typeof y=="function"&&y(B)!==!0)continue;let G=bi(B,_.indexInAll,O);r[G.indexInAll]=G,_.indexInAll++}}T&&(r[_.indexInAll]=_);continue}let M=b.get(N)?.totalLeafNodesCount??0,A={dataSourceHasGrouping:!1,nodeExpanded:!1,selfExpanded:!1,nodePath:N,id:E,data:R,indexInAll:r.length,indexInParent:P,indexInParentNodes:[...n,P],totalLeafNodesCount:M,treeNesting:a,selfLoaded:!0,isParentNode:!0,isTreeNode:!0,isGroupRow:!1,deepRowInfoArray:[],parentNodes:Array.from(e),collapsedLeafNodesCount:0,rowSelected:!1,rowDisabled:!1,isCellSelected:sn,hasSelectedCells:sn,selectedLeafNodesCount:0,deselectedLeafNodesCount:0};if(f&&(A.rowSelected=f(A),h)){let _=h.getSelectionCountFor(A.nodePath);A.selectedLeafNodesCount=_.selectedCount,A.deselectedLeafNodesCount=_.deselectedCount}c&&(A.rowDisabled=c(A)),m&&m(A);let x=!0;if(p&&(A.selfExpanded=x=p(A)),T||(x=!1),A.nodeExpanded=x,T&&y&&C!=null&&C>0){let _=A.indexInAll,O=A.parentNodes;if(O.length>0&&_%C===0){let L=_/C,K=0;O.forEach(B=>{typeof y=="function"&&y(B)!==!0||(r.push(bi(B,_+K,L)),K++,A.indexInAll++)})}}T&&(r[A.indexInAll]=A);let F=u(R);Array.isArray(F)&&Lu(F,N,[...e,A],A.indexInParentNodes,i,r)}return r}function zu(o){let{dataArray:t,marker:e}=o;e&&e.start();let n=[];return Lu(t,[],[],[],o,n),e&&e.end(),{data:n}}function Vu(o){let{marker:t,lazyLoad:e,groupResult:n,rowsPerPage:i,repeatWrappedGroupRows:r,withRowInfo:a,toPrimaryKey:l,groupRowsState:u,isRowDisabled:d,isRowSelected:s,rowSelectionState:c,generateGroupRows:f,reducers:m={}}=o,{groupParams:p,deepMap:h,pivot:y}=n,{groupBy:C}=p;t&&t.start({details:[{name:"Group by fields",value:C.map(P=>P.field).join(", ")}]});let b=[],S=[],w=[],T=[];return h.visitDepthFirst((P,R,E,N)=>{let v=P.items,D=R.length,M=u?.isGroupRowCollapsed(R)??!1;T.push(E);let A=dh({lazyLoad:e,groupBy:C,parents:Array.from(w),reducers:m,indexInGroup:E,indexInParentGroups:Array.from(T),indexInAll:b.length,groupKeys:R,error:P.error,totalChildrenCount:P.totalChildrenCount,childrenLoading:(P.childrenLoading||!M&&!P.childrenAvailable)&&e,childrenAvailable:P.childrenAvailable,directChildrenCount:R.length===C.length?P.items.length:h.getDirectChildrenSizeFor(R),directChildrenLoadedCount:0},P);if(s&&(A.rowSelected=s(A),c)){let L=c.getSelectionCountFor(A.groupKeys);A.selectedChildredCount=L.selectedCount,A.deselectedChildredCount=L.deselectedCount}d&&(A.rowDisabled=d(A));let x=w[w.length-1],F=x?.collapsed??!1;F&&(M=!0),A.collapsed=M;let _=f||M;if(F&&(_=!1),_){if(r&&i!=null&&i>0){let L=A.indexInAll,K=A.parents;if(K.length>0&&L%i===0){let B=L/i,G=0;K.forEach(se=>{typeof r=="function"&&r(se)!==!0||(b.push(bi(se,L+G,B)),G++,A.indexInAll++)})}}b.push(A),S.push(b.length-1)}A.collapsedChildrenCount=0,w.forEach(L=>{L.deepRowInfoArray.push(A),L.collapsedGroupsCount+=M?1:0}),x&&A.selfLoaded&&e&&(x.directChildrenLoadedCount+=1),a&&a(A),w.push(A);let O=!0;if(O){if(N)N();else if(!y){let L=b.length;M||(b.length+=v.length);let K=0;for(let B=0,G=v.length;B<G;B++){let se=v[B];if(!M&&r&&i!=null&&i>0){let Re=L+B+K;if(Re%i===0){let Ge=Re/i;w.forEach(Oe=>{if(typeof r=="function"&&r(Oe)!==!0)return;let we=L+B+K;b[we]=bi(Oe,we,Ge),K++,b.length++})}}let Y=L+B+K,ge={id:se?l(se,Y):`${R}-${B}`,data:se,isCellSelected:sn,hasSelectedCells:sn,dataSourceHasGrouping:!0,isTreeNode:!1,isGroupRow:!1,selfLoaded:!!se,rowSelected:!1,rowDisabled:!1,rootGroupBy:C,collapsed:M,groupKeys:R,parents:Array.from(w),indexInParentGroups:[...T,B],indexInGroup:B,indexInAll:Y,groupBy:C,groupNesting:D+1,groupCount:A.groupCount};s&&(ge.rowSelected=s(ge)),d&&(ge.rowDisabled=d(ge)),a&&a(ge),w.forEach((Re,Ge)=>{Ge===w.length-1&&se&&(Re.directChildrenLoadedCount+=1),M&&(Re.collapsedChildrenCount+=1),Re.deepRowInfoArray.push(ge)}),M||(b[L+B+K]=ge)}}}w.pop(),T.pop()}),t&&t.end(),{data:b,groupRowsIndexes:S}}function ea(...o){return(...e)=>{o.forEach(n=>{typeof n=="function"&&n(...e)})}}function ta(o){let{pivotByAtIndex:t,pivotAggregator:e}=o;return t?.column&&(typeof t.column=="function"?Object.assign(o,t.column({column:o})):Object.assign(o,t.column)),e?.pivotColumn&&(typeof e.pivotColumn=="function"?Object.assign(o,e.pivotColumn({column:o})):Object.assign(o,e.pivotColumn)),o}function na(o){let{pivotByAtIndex:t}=o;return t?.columnGroup&&(typeof t.columnGroup=="function"?Object.assign(o,t.columnGroup({columnGroup:o})):Object.assign(o,t.columnGroup)),o}function Gu({deepMap:o,pivotBy:t,pivotTotalColumnPosition:e,pivotGrandTotalColumnPosition:n,reducers:i={},showSeparatePivotColumnForSingleAggregation:r=!1}){let a=t.length,l=Object.keys(i).map(m=>({...i[m],id:m}));l.length||(r=!0,n=!1,e=!1,l.push({id:"__empty-aggregation-reducer__",name:"-",initialValue:null,reducer:()=>null}));let u={},d={},s=Ft(function(){l.forEach((m,p)=>{u[`total:${m.id}`]=ta({header:`${m.name||m.id} total`,pivotBy:t,pivotColumn:!0,pivotTotalColumn:!0,pivotAggregator:m,pivotAggregatorIndex:p,pivotGroupKeys:[],pivotGroupKey:"",pivotIndex:-1,valueFormatter:({rowInfo:h})=>h.isGroupRow?h.reducerResults?.[m.id]:null})})});(!a&&e==="start"||n==="start")&&s();let c=!r&&l.length===1;return o.visitDepthFirst((m,p,h,y)=>{if(p=[...p],e==="end"&&y?.(),p.length===a){let C=t[p.length-1],S=p.slice(0,-1).join("/");if(!c){let w=S;S=p.join("/");let T=p[p.length-1];d[S]=na({header:`${T}`,columnGroup:w,pivotBy:t,pivotGroupKeys:p,pivotByAtIndex:C,pivotIndex:p.length-1,pivotGroupKey:T})}l.forEach((w,T)=>{let P=c?`${p[p.length-1]}`:w.name||w.id,R=ta({pivotBy:t,pivotColumn:!0,pivotTotalColumn:!1,pivotAggregator:w,pivotAggregatorIndex:T,pivotGroupKeys:p,pivotGroupKey:p[p.length-1],pivotIndex:p.length-1,pivotByAtIndex:C,columnGroup:S,header:P,valueFormatter:({rowInfo:N})=>N.isGroupRow?N.pivotValuesMap?.get(p)?.reducerResults[w.id]:null}),E=`${w.id}:${p.join("/")}`;u[E]=R})}else{let C=p.join("/"),b=p.slice(0,-1);if(d[C]=na({columnGroup:b.length?b.join("/"):void 0,header:`${p[p.length-1]}`,pivotBy:t,pivotGroupKeys:p,pivotIndex:p.length-1,pivotByAtIndex:t[p.length-1],pivotGroupKey:p[p.length-1]}),e!==!1){let S=t[p.length-1],w=b.length?b.join("/"):void 0;if(!c){let T=w;w=`total:${p.join("/")}`,d[w]=na({header:`${p[p.length-1]} total`,columnGroup:T,pivotBy:t,pivotTotalColumnGroup:!0,pivotGroupKeys:p,pivotIndex:p.length-1,pivotByAtIndex:S,pivotGroupKey:p[p.length-1]})}l.forEach((T,P)=>{let R=c?`${p[p.length-1]} total `:`${T.name||T.id} total`,E=ta({columnGroup:w,header:R,pivotAggregator:T,pivotAggregatorIndex:P,pivotColumn:!0,pivotTotalColumn:!0,pivotGroupKeys:p,pivotGroupKey:p[p.length-1],pivotByAtIndex:S,pivotIndex:p.length-1,pivotBy:t,valueFormatter:({rowInfo:N})=>N.isGroupRow?N.pivotValuesMap?.get(p)?.reducerResults[T.id]:null});u[`total:${T.id}:${p.join("/")}`]=E})}}(e==="start"||e===!1)&&y?.()}),(!a&&e==="end"||n==="end")&&s(),{columns:u,columnGroups:d}}var ch=()=>{};function oa(o,t){let e=new $,n=t.nodesKey??"children",i=t.emptyGroup??{},r=typeof t.pathKey=="function"?t.pathKey:l=>l[t.pathKey];for(let l of o){let u=r(l);for(let d=0;d<u.length;d++){let s=u.slice(0,d);e.has(s)||e.set(s,void 0)}e.set(u,l)}function a(l,u){let d=e.getKeysStartingWith(l,{excludeSelf:!0,depthLimit:1});for(let s of d){let c=[...l,s[s.length-1]],f=e.get(c),m=f?f[n]??[]:[];a(c,m),m.length&&(f||(f=typeof i=="function"?i(c,m):i),f[n]=m),u.push(f)}return u}return a([],[])}function Ku(o,t,e,n){let{isLeafNode:i,getNodeChildren:r,toKey:a}=o,{onParentNode:l,onNode:u,onLeafNode:d}=t,s=a(n),c=[...e,s],f=i(n),m=Ft(()=>{let p=r(n);if(!(!p||!Array.isArray(p)))for(let h=0,y=p.length;h<y;h++){let C=p[h];Ku(o,t,c,C)}});f?(d?.(n),u?.(n,ch)):(l?.(n,m,r(n)),u?.(n,m))}function Bu(o,t,e){for(let n=0,i=e.length;n<i;n++)Ku(o,t,[],e[n])}function Hu(o){return o.map(e=>Array.isArray(e.field)?e.field.map((n,i)=>{let r=Array.isArray(e.type)?e.type[i]??e.type[0]:e.type;return typeof n=="function"?{...e,valueGetter:n,field:void 0,type:r}:{...e,type:r,field:n}}):e).flat()}var un=(o,t,e)=>{let n=typeof e=="function"?e:e?.get,i=e&&typeof e=="object"?e.marker:void 0;return i&&i.start(),t.sort(ju(Hu(o),n)),i&&i.end(),t},Wu=(o,t,e)=>{let{marker:n}=e;n&&n.start();let i=ju(Hu(o),e.get),r=e.depthFirst??!1,a=e.inplace??!1;r||(a?t.sort(i):t=[...t].sort(i));let{nodesKey:l,toKey:u}=e,d=c=>c[l],s=c=>c[l]===void 0;return Bu({isLeafNode:e.isLeafNode??s,getNodeChildren:e.getNodeChildren??d,toKey:u},{onParentNode:(c,f,m)=>{if(r&&f(),Array.isArray(m)){let p=a?m.sort(i):[...m].sort(i);c[l]=p}r||f()}},t),r&&(a?t.sort(i):t=[...t].sort(i)),n&&n.end(),t};un.knownTypes=on;var fh=o=>{if(!o)return;let t=o.field,e=o.valueGetter,n=o.dir<0?-1:o.dir>0?1:0;if(!n)return;let i=o.fn;if(!i&&o.type){let r=Array.isArray(o.type)?o.type[0]:o.type;i=un.knownTypes[r],i||console.warn(`Unknown sort type "${o.type}" - please pass one of ${Object.keys(un.knownTypes).join(", ")}`)}return i||(i=on.string),(r,a)=>{let l=e?e(r):t?r[t]:r,u=e?e(a):t?a[t]:a,d=i(l,u);return d===0?d:n*d}},ph=o=>o.map(fh).filter(t=>t instanceof Function),ju=(o,t)=>{let e=ph(o);return(n,i)=>{t&&(n=t(n),i=t(i));let r=0,a=0,l,u=e.length;for(;a<u;a++)if(l=e[a],!!l&&(r=l(n,i),r!==0))return r;return r}};var $u=Symbol("CLEAR"),vn=class o{constructor(t){this.affectedFields=new Set;this.allFieldsAffected=!1;this.primaryKeyToData=new Map;this.nodePathToData=new $;this.getAffectedFields=()=>this.allFieldsAffected?!0:this.affectedFields;this.delete=(t,e,n)=>{this.allFieldsAffected=!0;let i=t,r=this.primaryKeyToData.get(i)||[];r.push({type:"delete",primaryKey:t,originalData:e,metadata:n}),this.primaryKeyToData.set(i,r)};this.deleteNodePath=(t,e,n)=>{this.allFieldsAffected=!0;let i=this.nodePathToData.get(t)||[];i.push({type:"delete",nodePath:t,originalData:e,metadata:n}),this.nodePathToData.set(t,i)};this.insert=(t,e,n,i)=>{let r=t,a=this.primaryKeyToData.get(r)||[];this.allFieldsAffected=!0,a.push({type:"insert",primaryKey:t,data:e,position:n,originalData:null,metadata:i}),this.primaryKeyToData.set(r,a)};this.insertNodePath=(t,e,n,i)=>{let r=this.nodePathToData.get(t)||[];this.allFieldsAffected=!0,r.push({type:"insert",nodePath:t,data:e,position:n,originalData:null,metadata:i}),this.nodePathToData.set(t,r)};this.update=(t,e,n,i)=>{this.allFieldsAffected||(this.nodesKey&&Array.isArray(e[this.nodesKey])?this.allFieldsAffected=!0:Object.keys(e).forEach(u=>this.affectedFields.add(u)));let r=t,a=this.primaryKeyToData.get(r)||[];a.push({type:"update",primaryKey:t,data:e,originalData:n,metadata:i}),this.primaryKeyToData.set(t,a)};this.updateNodePath=(t,e,n,i)=>{this.allFieldsAffected||(this.nodesKey&&Array.isArray(e[this.nodesKey])?this.allFieldsAffected=!0:Object.keys(e).forEach(l=>this.affectedFields.add(l)));let r=this.nodePathToData.get(t)||[];r.push({type:"update",nodePath:t,data:e,originalData:n,metadata:i}),this.nodePathToData.set(t,r)};this.updateChildren=(t,e,n,i)=>{this.allFieldsAffected=!0;let r=this.nodePathToData.get(t)||[];r.push({type:"update-children",nodePath:t,children:e,originalData:n,metadata:i}),this.nodePathToData.set(t,r)};this.resetDataSource=t=>{this.clear(),this.allFieldsAffected=!0;let e=$u,n=this.primaryKeyToData.get(e)||[];n.push({type:"clear-all",primaryKey:void 0,metadata:t}),this.primaryKeyToData.set(e,n)};this.shouldResetDataSource=()=>this.primaryKeyToData.has($u);this.clear=()=>{this.allFieldsAffected=!1,this.affectedFields.clear(),this.primaryKeyToData.clear()};this.isEmpty=()=>this.primaryKeyToData.size===0&&this.nodePathToData.size===0;this.removeInfo=t=>{this.primaryKeyToData.delete(t)};this.removeNodePathInfo=t=>{this.nodePathToData.delete(t)};this.getMutationsForPrimaryKey=t=>this.primaryKeyToData.get(t);this.getMutationsForNodePath=t=>this.nodePathToData.get(t);this.getMutationsCount=()=>this.primaryKeyToData.size;this.getMutations=()=>new Map(this.primaryKeyToData);this.getTreeMutations=()=>$.clone(this.nodePathToData);this.getMutationsArray=()=>Array.from(this.primaryKeyToData.values()).flat();this.getTreeMutationsArray=()=>Array.from(this.nodePathToData.values()).flat();this.nodesKey=t.nodesKey}static clone(t,{light:e=!1}={}){let n=new o({nodesKey:t.nodesKey});return n.allFieldsAffected=t.allFieldsAffected,n.affectedFields=new Set(t.affectedFields),n.primaryKeyToData=e?t.primaryKeyToData:new Map(t.primaryKeyToData),n.nodePathToData=e?t.nodePathToData:$.clone(t.nodePathToData),n}};function dn(o,t){return t().dataArray[o]}function Ti(o){return o().dataArray}var nt=class{constructor(t){this.collapsedPathsMap=new $;this.expandedPathsMap=new $;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 e=t&&t instanceof Object.getPrototypeOf(this).constructor?t.getState():t;e&&this.update(e)}get mode(){return this._mode}reset(){this.collapsedPathsMap.clear(),this.expandedPathsMap.clear(),this.collapsedIdsMap.clear(),this.expandedIdsMap.clear()}destroy(){this.reset()}expandNode(t){this.setNodeExpanded(t,!0)}collapseNode(t){this.setNodeExpanded(t,!1)}setNodeExpanded(t,e){let{collapsedPathsMap:n,collapsedIdsMap:i,expandedPathsMap:r,expandedIdsMap:a,defaultExpanded:l,_mode:u}=this;u==="id"&&Array.isArray(t)&&(t=t[t.length-1]),e===l?e?u==="path"&&Array.isArray(t)?n.delete(t):i.delete(t):u==="path"&&Array.isArray(t)?r.delete(t):a.delete(t):e?u==="path"&&Array.isArray(t)?r.set(t,!0):a.set(t,!0):u==="path"&&Array.isArray(t)?n.set(t,!0):i.set(t,!0)}isNodeExpandedByPath(t){return this.isNodeExpanded(t)}isNodeExpandedById(t){return this.isNodeExpanded(t)}isNodeExpanded(t){if(this._mode==="id"&&Array.isArray(t)&&(t=t[t.length-1]),this._mode==="id"&&Array.isArray(t))throw`You try to check if a node is expanded by id (${t}) but your TreeExpandState is configured to use node paths.`;if(this._mode==="path"&&!Array.isArray(t))throw`You try to check if a node is expanded by path (${t}) but your TreeExpandState is configured to use node ids.`;return this.defaultExpanded?this._mode==="path"&&Array.isArray(t)?!this.collapsedPathsMap.has(t):!this.collapsedIdsMap.has(t):this._mode==="path"&&Array.isArray(t)?this.expandedPathsMap.has(t):this.expandedIdsMap.has(t)}update(t){if(this.defaultExpanded=t.defaultExpanded,this.reset(),t.expandedPaths||t.collapsedPaths){this._mode="path";let i=t.expandedPaths||null,r=t.collapsedPaths||null;if(i)for(let a=0,l=i.length;a<l;a++)this.expandedPathsMap.set(i[a],!0);if(r)for(let a=0,l=r.length;a<l;a++)this.collapsedPathsMap.set(r[a],!0);return}this._mode="id";let e=t.expandedIds||null,n=t.collapsedIds||null;if(e)for(let i=0,r=e.length;i<r;i++)this.expandedIdsMap.set(e[i],!0);if(n)for(let i=0,r=n.length;i<r;i++)this.collapsedIdsMap.set(n[i],!0)}getState(){if(this._mode==="path"){let n=Array.from(this.collapsedPathsMap.keys()),i=Array.from(this.expandedPathsMap.keys());return{defaultExpanded:this.defaultExpanded,collapsedPaths:n,expandedPaths:i}}let t=Array.from(this.collapsedIdsMap.keys()),e=Array.from(this.expandedIdsMap.keys());return{defaultExpanded:this.defaultExpanded,collapsedIds:t,expandedIds:e}}};var mh=(o,t)=>o.length-t.length,Qe=class o{constructor(t,e){this.selectedPaths=null;this.deselectedPaths=null;this.defaultSelection=!1;this.selectionMap=new $;this.cache=new $;this.strictMode=!1;let n=t instanceof Object.getPrototypeOf(this).constructor,i=n?t.getState():t;this.setConfig(e||(n?t.config:{treePaths:new $})),this.disableStrictMode(),this.update(i),this.config.strictCheckPaths&&this.enableStrictMode()}getTreePaths(t){return t?Array.isArray(t)?new $(t.map(e=>[e,!0])):t:this.config.treePaths}withTreePaths(t,e){let n=this.config.treePaths;e=this.getTreePaths(e);let i=e!==n;i&&this.xcache(),this.config.treePaths=e;let r=t(e);return this.config.treePaths=n,i&&this.xcache(),r}getLeafNodePaths(t=[],e){return this.withTreePaths(n=>n.getKeysForLeafNodesStartingWith(t),e)}forEachLeafNodePath(t,e=[],n){let i={selected:!1};this.withTreePaths(r=>{r.getLeafNodesStartingWith(e,a=>{i.selected=this.isNodeSelected(a.keys)===!0,t(a.keys,i)})},n)}getSelectedLeafNodePaths(t=[],e){let n=[];return this.withTreePaths(i=>{i.getLeafNodesStartingWith(t,r=>{this.isNodeSelected(r.keys)&&n.push(r.keys)})},e),n}getDeselectedLeafNodePaths(t=[],e){let n=[];return this.withTreePaths(i=>{i.getLeafNodesStartingWith(t,r=>{this.isNodeSelected(r.keys)||n.push(r.keys)})},e),n}isLeafNode(t){let{treePaths:e}=this.config;return e.has(t)?e.getKeysForLeafNodesStartingWith(t).length===1:null}getLeafNodesCount(t){return this.config.treePaths.getKeysForLeafNodesStartingWith(t).length}static from(t,e){return new o(t,e)}setConfig(t){let e=typeof t=="function"?t():t;this.config={treePaths:Array.isArray(e.treePaths)?new $(e.treePaths.map(n=>[n,!0])):e.treePaths,strictCheckPaths:e.strictCheckPaths??!0},this.xcache()}xcache(){this.cache.clear()}update(t){this.selectedPaths=t.selectedPaths||null,this.deselectedPaths=t.deselectedPaths||null;let{selectionMap:e,selectedPaths:n,deselectedPaths:i}=this;e.clear(),n?.forEach(r=>this.setSelectionForPath(r,!0)),i?.forEach(r=>this.setSelectionForPath(r,!1)),this.defaultSelection=t.defaultSelection,this.xcache()}setSelectionForPath(t,e){this.isPathAvailable(t)&&this.selectionMap.set(t,e)}getState(){let t=[],e=[];return this.selectionMap.topDownEntries().forEach(([n,i])=>{i?t.push(n):e.push(n)}),{defaultSelection:this.defaultSelection,selectedPaths:t,deselectedPaths:e}}deselectAll(){this.update({defaultSelection:!1,selectedPaths:[],deselectedPaths:[]})}selectAll(){this.update({defaultSelection:!0,deselectedPaths:[],selectedPaths:[]})}enableStrictMode(){this.strictMode=!0}disableStrictMode(){this.strictMode=!1}isPathAvailable(t){if(!this.strictMode)return!0;let{treePaths:e}=this.config;return e.has(t)}isNodeSelected(t){return this.isPathSelected(t)}isSelfSelected(t){return this.selectionMap.get(t)??null}cacheIt(t,e){return this.cache.set(t,e),e}getSelectionStateForNode(t,e){let n=this.cache.get(t);if(n)return n;if(this.isLeafNode(t)!==!1){let c=this.isSelfSelected(t);if(c!==null)return this.cacheIt(t,{selected:c,selectedCount:c?1:0,deselectedCount:c?0:1,leafCount:1})}let i=this.getLeafNodesCount(t),r=this.isSelfSelected(t),{selectionMap:a}=this,l=a.getKeysOfFirstChildOnEachBranchStartingWith(t,{excludeSelf:!0}).sort(mh);if(this.strictMode&&(l=l.filter(c=>this.isPathAvailable(c))),!l.length){if(r!==null){let f=i?r:!1;return this.cacheIt(t,{selected:f,selectedCount:f?i:0,deselectedCount:f?0:i,leafCount:i})}let c=this.getNodeBooleanSelectionStateFromParent(t);return this.cacheIt(t,{selected:c,selectedCount:c?i:0,deselectedCount:c?0:i,leafCount:i})}let u=0,d=0,s=this.getNodeBooleanSelectionStateFromParent(t);s?u+=i:d+=i;for(let c=0,f=l.length;c<f;c++){let m=l[c],{selectedCount:p,deselectedCount:h}=this.getSelectionStateForNode(m);if(s?(u-=h,d+=h):(d-=p,u+=p),e&&p>0&&h>0)return this.cacheIt(t,{selected:null,leafCount:i,selectedCount:u,deselectedCount:d})}if(!u&&!d)return this.cacheIt(t,{selected:s,selectedCount:s?i:0,deselectedCount:s?0:i,leafCount:i});if(u){let c=u===i?!0:null;return this.cacheIt(t,{selected:c,selectedCount:u,deselectedCount:d,leafCount:i})}return this.cacheIt(t,{selected:!1,selectedCount:0,deselectedCount:i,leafCount:i})}isPathSelected(t){return this.isPathAvailable(t)?this.getSelectionStateForNode(t,!0).selected:!1}getNodeBooleanSelectionStateFromParent(t){let{defaultSelection:e,selectionMap:n}=this;if(!t.length)return e;let i=[...t];do{let r=n.get(i);if(r!==void 0)return r;i.pop()}while(i.length);return e}setNodeSelection(t,e){if(!t.length)return;if(this.xcache(),this.selectionMap.getKeysStartingWith(t).forEach(i=>{this.selectionMap.delete(i)}),!(t.length===1&&this.defaultSelection===e)){if(this.setSelectionForPath(t,e),t.length>1){let i=t.slice(0,-1);this.isNodeSelected(i)===e&&this.setNodeSelection(i,e)}}}selectNode(t){this.setNodeSelection(t,!0)}deselectNode(t){this.setNodeSelection(t,!1)}toggleNodeSelection(t){this.setNodeSelection(t,!this.isNodeSelected(t))}getSelectedCount(){return this.getSelectionCountFor([]).selectedCount}getDeselectedCount(){return this.getSelectionCountFor([]).deselectedCount}getSelectionCountFor(t=[]){let{selectedCount:e,deselectedCount:n}=this.getSelectionStateForNode(t);return{selectedCount:e,deselectedCount:n}}destroy(){this.config=void 0,this.xcache(),this.selectionMap.clear()}};function wi(o,t){return new Qe(o,$n(t))}function $n(o){return()=>({treePaths:(typeof o=="function"?o():o).treePaths})}var Si=class{constructor(t){this.setNodeSelection=(t,e,n)=>{let{treeSelectionState:i,selectionMode:r}=this.getState();if(!this.isNodeSelectable(t)&&!n?.force)return;if(r==="single-row"){this.actions.treeSelection=e?t[t.length-1]:null;return}if(r!=="multi-row")throw"Selection mode is not multi-row or single-row";if(!(i instanceof Qe))throw"Invalid tree selection";let a=new Qe(i,$n(this.getState));a.setNodeSelection(t,e),this.getState().lastSelectionUpdatedNodePathRef.current={nodePath:t,selected:e},this.actions.treeSelection=a};this.getCallbackParam=t=>({dataSourceApi:this.dataSourceApi});this.getState=t.getState,this.actions=t.actions,this.dataSourceApi=t.dataSourceApi}getSelectedLeafNodePaths(t){let{treePaths:e}=this.getState(),n=t?.treeSelectionState||this.getState().treeSelectionState;return n?n.getSelectedLeafNodePaths(t?.rootNodePath,e):[]}getDeselectedLeafNodePaths(t){let{treePaths:e}=this.getState(),n=t?.treeSelectionState||this.getState().treeSelectionState;return n?n.getDeselectedLeafNodePaths(t?.rootNodePath,e):[]}getSelectedLeafRowInfos(t){let{treePaths:e}=this.getState(),n=t?.treeSelectionState||this.getState().treeSelectionState;if(!e||!n)return[];let i=t?.rootNodePath||[],r=[];return e.getLeafNodesStartingWith(i,a=>{if(n.isNodeSelected(a.keys)){let l=this.getRowInfoByPath(a.keys);l&&r.push(l)}},{excludeSelf:!0}),r}get allRowsSelected(){return this.getState().allRowsSelected}isNodeReadOnly(t){let e=this.getRowInfoByPath(t),n=this.getState().isNodeReadOnly;return e&&e.isTreeNode&&e.isParentNode&&n?n(e):!1}isNodeSelectable(t){let e=this.getRowInfoByPath(t),n=this.getState().isNodeSelectable;return e&&e.isTreeNode?n(e):!1}isNodeExpanded(t){let e=this.getState(),{isNodeExpanded:n,isNodeCollapsed:i,treeExpandState:r}=e,a=this.getRowInfoByPath(t);if(a){if(!a.isTreeNode||!a.isParentNode)return!1;if(i)return!n(a,r);if(n)return n(a,r)}return r.isNodeExpanded(t)}expandAll(){let t=new nt({defaultExpanded:!0,collapsedPaths:[]});this.getState().lastExpandStateInfoRef.current={state:"expanded",nodePath:null},this.actions.treeExpandState=t}collapseAll(){let t=new nt({defaultExpanded:!1,expandedPaths:[]});this.getState().lastExpandStateInfoRef.current={state:"collapsed",nodePath:null},this.actions.treeExpandState=t}expandNode(t,e){if(this.isNodeReadOnly(t)&&!e?.force)return;let n=this.getState(),i=new nt(n.treeExpandState);i.expandNode(t),this.getState().lastExpandStateInfoRef.current={state:"expanded",nodePath:t},this.actions.treeExpandState=i,n.onNodeExpand?.(t,this.getCallbackParam(t))}collapseNode(t,e){if(this.isNodeReadOnly(t)&&!e?.force)return;let n=this.getState(),i=new nt(n.treeExpandState);i.collapseNode(t),this.getState().lastExpandStateInfoRef.current={state:"collapsed",nodePath:t},this.actions.treeExpandState=i,n.onNodeCollapse?.(t,this.getCallbackParam(t))}toggleNode(t,e){let n=this.getState(),i=new nt(n.treeExpandState),r=!this.isNodeExpanded(t);this.isNodeReadOnly(t)&&!e?.force||(i.setNodeExpanded(t,r),this.getState().lastExpandStateInfoRef.current={state:r?"expanded":"collapsed",nodePath:t},this.actions.treeExpandState=i,r?n.onNodeExpand?.(t,this.getCallbackParam(t)):n.onNodeCollapse?.(t,this.getCallbackParam(t)))}getNodeDataByPath(t){if(!t.length)return null;let e=this.getRowInfoByPath(t);return e?e.data:null}getRowInfoByPath(t){let{pathToIndexMap:e}=this.getState(),n=e.get(t);return n!==void 0?dn(n,this.getState):null}selectAll(){let{treeSelectionState:t,selectionMode:e}=this.getState();if(e!=="multi-row")throw"Selection mode is not multi-row";if(!(t instanceof Qe))throw"Invalid node selection";let n=new Qe(t,$n(this.getState));n.selectAll(),this.getState().lastSelectionUpdatedNodePathRef.current=null,this.actions.treeSelection=n}deselectAll(){let{treeSelectionState:t,selectionMode:e}=this.getState();if(e!=="multi-row")throw"Selection mode is not multi-row";if(!(t instanceof Qe))throw"Invalid node selection";let n=new Qe(t,$n(this.getState));n.deselectAll(),this.getState().lastSelectionUpdatedNodePathRef.current=null,this.actions.treeSelection=n}isNodeSelected(t){let{treeSelectionState:e,treeSelection:n,selectionMode:i}=this.getState();if(i==="single-row"){let r=t[t.length-1];return Array.isArray(n)?treeSelection.join(",")===t.join(","):n===r}if(i!=="multi-row")throw"Selection mode is not multi-row or single-row";if(!(e instanceof Qe))throw"Invalid tree selection";return e.isNodeSelected(t)}selectNode(t,e){this.setNodeSelection(t,!0,e)}deselectNode(t,e){this.setNodeSelection(t,!1,e)}toggleNodeSelection(t,e){this.isNodeSelected(t)?this.deselectNode(t,e):this.selectNode(t,e)}};var Un=class{constructor(t){let e=t instanceof Object.getPrototypeOf(this).constructor?t.getState():t,n=this.getPositiveFromState(e),i=this.getNegativeFromState(e);this.update({negativeItems:i,positiveItems:n})}getInitialState(){return this.initialState}destroy(){this.positiveMap?.clear(),this.negativeMap?.clear(),delete this.positiveMap,delete this.negativeMap}update(t){let{positiveItems:e,negativeItems:n}=t;if(this.allNegative=n===!0,this.allPositive=e===!0,this.allNegative&&this.allPositive)throw"Cannot have both negativeItems and positiveItems be true!";if(n&&n!==!0){this.negativeMap||(this.negativeMap=new Map),this.negativeMap.clear();for(let i of n)this.negativeMap.set(i,!0);this.positiveMap&&this.positiveMap.clear()}if(e&&e!==!0){this.positiveMap||(this.positiveMap=new Map),this.positiveMap.clear();for(let i of e)this.positiveMap.set(i,!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(t){if(this.allPositive===!0){if(this.allNegative===!0)throw'Cannot have both positiveItems and negativeItems be "true"';return!this.negativeMap?.has(t)}return!!this.positiveMap?.has(t)}isItemNegative(t){return!this.isItemPositive(t)}setItemValue(t,e){if(e!==this.isItemPositive(t)){if(e){if(this.allNegative===!0){if(!this.positiveMap)throw`No positiveMap found when trying to set item ${t} be positive`;this.positiveMap.set(t,!0)}else if(this.allPositive===!0){if(!this.negativeMap)throw`No negativeMap found when trying to set item ${t} be positive`;this.negativeMap.delete(t)}}else if(this.allPositive===!0){if(!this.negativeMap)throw`No negativeMap found when trying to set item ${t} be negative`;this.negativeMap.set(t,!0)}else if(this.allNegative===!0){if(!this.positiveMap)throw`No positiveMap found when trying to set item ${t} be negative`;this.positiveMap?.delete(t)}}}makeItemNegative(t){this.setItemValue(t,!1)}makeItemPositive(t){this.setItemValue(t,!0)}toggleItem(t){this.setItemValue(t,!this.isItemPositive(t))}};var wt=class extends Un{constructor(e){super(e);this.isRowEnabled=e=>!!this.isItemPositive(e)}getState(){let e=this.allPositive?!0:[...this.positiveMap?.keys()??[]],n=this.allNegative?!0:[...this.negativeMap?.keys()??[]];return{enabledRows:e,disabledRows:n}}getPositiveFromState(e){return e.enabledRows}getNegativeFromState(e){return e.disabledRows}areAllDisabled(){return this.areAllNegative()}areAllEnabled(){return this.areAllPositive()}disableAll(){this.makeAllNegative()}enableAll(){this.makeAllPositive()}isRowDisabled(e){return!this.isRowEnabled(e)}setRowEnabled(e,n){return this.setItemValue(e,n)}disableRow(e){this.setRowEnabled(e,!1)}enableRow(e){this.setRowEnabled(e,!0)}toggleRow(e){this.toggleItem(e)}};var ia=1e3;function Uu(o){return new ra(o)}var ra=class{constructor(t){this.pendingOperations=[];this.batchOperationRafId=0;this.batchOperationTimeoutId=0;this.pendingPromise=null;this.resolvePendingPromise=null;this.toPrimaryKey=t=>this.getState().toPrimaryKey(t);this.getRowInfoArray=()=>Ti(this.getState);this.getRowInfoByIndex=t=>dn(t,this.getState)??null;this.getRowInfoByPrimaryKey=t=>{let e=this.getIndexByPrimaryKey(t);return this.getRowInfoByIndex(e)};this.getRowInfoByNodePath=t=>{let e=this.getIndexByNodePath(t);return this.getRowInfoByIndex(e)};this.getIndexByPrimaryKey=t=>this.getState().idToIndexMap.get(t)??-1;this.getIndexByNodePath=t=>this.getState().pathToIndexMap.get(t)??-1;this.getNodePathById=t=>this.getState().idToPathMap.get(t)??null;this.getNodePathByIndex=t=>{let e=this.getRowInfoByIndex(t);return e&&e.isTreeNode?e.nodePath:null};this.getPrimaryKeyByIndex=t=>{let e=this.getRowInfoByIndex(t);return e?e.id:void 0};this.getOriginalDataArray=()=>this.getState().originalDataArray;this.getDataByIndex=t=>{let e=this.getRowInfoByIndex(t);return e?e.data:null};this.getDataByPrimaryKey=t=>{let{indexer:e}=this.getState();return e.getDataForPrimaryKey(t)??null};this.isNodePathAvailable=t=>this.getState().indexer.getDataForNodePath(t)!==void 0;this.getDataByNodePath=t=>{let{indexer:e}=this.getState(),n=e.getDataForNodePath(t);return n||null};this.replaceAllData=(t,e)=>(this.batchOperation({type:"replace-all",array:t,metadata:e?.metadata}),this.addDataArray(t,e));this.clearAllData=t=>this.replaceAllData([],t);this.updateData=(t,e)=>this.updateDataArray([t],e);this.updateDataArray=(t,e)=>{let n=this.getState().isTree,i=n?void 0:t.map(l=>this.toPrimaryKey(l)),r=n?t.map(l=>this.getNodePathById(this.toPrimaryKey(l))||[]):null,a=i?this.batchOperation({type:"update",array:t,primaryKeys:t.map(l=>this.toPrimaryKey(l)),metadata:e?.metadata}):this.batchOperation({type:"update",array:t,nodePaths:r||[],metadata:e?.metadata});return e?.flush&&this.commit(),a};this.withWaitForNode=(t,e,n)=>{let i=n?.waitForNode??!0;if(i===!0||typeof i=="number"){let a=i===!0?ia:i;return isNaN(a)||(a=ia),this.waitForNodePath(t,{timeout:a}).then(l=>{if(!l){let u=`Cannot find node path "${t.join("/")}" (we waited for it ${a}ms)`;return console.error(u),e({error:u,resolved:!1})}return e({resolved:!0})})}let r=e({resolved:void 0});return r instanceof Promise?r:Promise.resolve(r)};this.updateChildrenByNodePath=(t,e,n)=>this.withWaitForNode(e,({error:i})=>i?!1:this.updateChildrenByNodePath_Internal(t,e,n),n);this.updateChildrenByNodePath_Internal=(t,e,n)=>{let i=typeof t=="function"?t:()=>t;return this.updateDataArrayByNodePath_Internal([{nodePath:e,children:i}],n)};this.updateDataByNodePath=(t,e,n)=>this.isNodePathAvailable(e)?this.updateDataArrayByNodePath_Internal([{data:t,nodePath:e}],n):this.withWaitForNode(e,({error:i})=>i?!1:this.updateDataArrayByNodePath_Internal([{data:t,nodePath:e}],n),n);this.updateDataArrayByNodePath=(t,e)=>{if(e&&typeof e.waitForNode<"u"&&!e.waitForNode)return this.updateDataArrayByNodePath_Internal(t,e);let n=t.map(r=>r.nodePath);return Promise.allSettled(n.map(r=>this.withWaitForNode(r,({error:a})=>!a,e))).then(r=>r.every(Boolean)?this.updateDataArrayByNodePath_Internal(t,e):!1)};this.updateDataArrayByNodePath_Internal=(t,e)=>{let n=[],i=[];t.forEach(a=>{a.data?n.push(a.data):a.children&&n.push(a.children),i.push(a.nodePath)});let r=this.batchOperation({type:"update",array:n,nodePaths:i,metadata:e?.metadata});return e?.flush&&this.commit(),r};this.removeDataByPrimaryKey=(t,e)=>{if(this.getState().isTree)return this.removeDataByNodePath(this.getNodePathById(t)||[],e);let i=this.batchOperation({type:"delete",primaryKeys:[t],metadata:e?.metadata});return e?.flush&&this.commit(),i};this.removeDataByNodePath=(t,e)=>this.batchDeleteNodePaths([t],e);this.removeData=(t,e)=>{if(this.getState().isTree){let i=this.getNodePathById(this.toPrimaryKey(t));return this.removeDataByNodePath(i,e)}return this.batchDeletePrimaryKeys([this.toPrimaryKey(t)],e)};this.removeDataArrayByPrimaryKeys=(t,e)=>{if(this.getState().isTree){let i=t.map(r=>this.getNodePathById(r)||[]);return this.batchDeleteNodePaths(i,e)}return this.batchDeletePrimaryKeys(t,e)};this.batchDeleteNodePaths=(t,e)=>{let n=this.batchOperation({type:"delete",nodePaths:t||[],metadata:e?.metadata});return e?.flush&&this.commit(),n};this.batchDeletePrimaryKeys=(t,e)=>{let n=this.batchOperation({type:"delete",primaryKeys:t,metadata:e?.metadata});return e?.flush&&this.commit(),n};this.removeDataArray=(t,e)=>{if(this.getState().isTree){let r=t.map(a=>this.getNodePathById(this.toPrimaryKey(a))||[]);return this.batchDeleteNodePaths(r,e)}let i=t.map(this.toPrimaryKey);return this.batchDeletePrimaryKeys(i,e)};this.addData=(t,e)=>this.addDataArray([t],e);this.addDataArray=(t,e)=>this.insertDataArray(t,{...e,position:"end"});this.insertData=(t,e)=>this.insertDataArray([t],e);this.insertDataArray=(t,e)=>{let n=this.getState().isTree,i="before",r,a=e.nodePath;if(n&&a?.length)return this.withWaitForNode(a,({error:u})=>{if(u)return!1;if(e.position==="before"||e.position==="after")return this.batchTreeInsert(t,e.position,a,e);let d=s=>e.position==="start"?[...t,...s||[]]:[...s||[],...t];return this.updateChildrenByNodePath(d,a,e)},e);if(e.position==="before"||e.position==="after")i=e.position,r=e.primaryKey;else{let u=this.getOriginalDataArray();e.position==="start"?(i="before",u.length?r=this.toPrimaryKey(u[0]):r=void 0):(i="after",u.length?r=this.toPrimaryKey(u[u.length-1]):r=void 0)}let l=n?this.batchOperation({type:"insert",array:t,position:i,metadata:e?.metadata,nodePath:this.getNodePathById(r)||[]}):this.batchOperation({type:"insert",array:t,position:i,metadata:e?.metadata,primaryKey:r,nodePath:a});return e?.flush&&this.commit(),l};this.batchTreeInsert=(t,e,n,i)=>{if(n.length&&!this.isNodePathAvailable(n))return this.withWaitForNode(n,({error:a})=>{if(a)return!1;let l=this.batchOperation({type:"insert",array:t,position:e,metadata:i?.metadata,nodePath:n});return i?.flush&&this.commit(),l},i);let r=this.batchOperation({type:"insert",array:t,position:e,metadata:i?.metadata,nodePath:n});return i?.flush&&this.commit(),r};this.setSortInfo=t=>{let e=this.getState().multiSort;if(Array.isArray(t)){this.actions.sortInfo=t.length?e?t:t[0]:null;return}this.actions.sortInfo=t};this.setGroupBy=t=>{this.actions.groupBy=t};this.toggleGroupByField=t=>{let e=this.getState().groupBy;e.findIndex(i=>i.field===t)===-1?this.actions.groupBy=[...e,{field:t}]:this.actions.groupBy=e.filter(i=>i.field!==t)};this.isRowDisabledAt=t=>this.getRowInfoByIndex(t)?.rowDisabled??!1;this.isRowDisabled=t=>this.getRowInfoByPrimaryKey(t)?.rowDisabled??!1;this.setRowEnabledAt=(t,e)=>{let n=this.getState().rowDisabledState,i=n?new wt(n):new wt({enabledRows:!0,disabledRows:[]}),r=this.getRowInfoByIndex(t);r&&(i.setRowEnabled(r.id,e),this.actions.rowDisabledState=i)};this.setRowEnabled=(t,e)=>{let n=this.getRowInfoByPrimaryKey(t);n&&this.setRowEnabledAt(n.indexInAll,e)};this.enableAllRows=()=>{let t=this.getState().rowDisabledState;if(!t){this.actions.rowDisabledState=new wt({enabledRows:!0,disabledRows:[]});return}let e=new wt(t);e.enableAll(),this.actions.rowDisabledState=e};this.disableAllRows=()=>{let t=this.getState().rowDisabledState;if(!t){this.actions.rowDisabledState=new wt({disabledRows:!0,enabledRows:[]});return}let e=new wt(t);e.disableAll(),this.actions.rowDisabledState=e};this.areAllRowsEnabled=()=>{let t=this.getState().rowDisabledState;return t?t.areAllEnabled():!0};this.areAllRowsDisabled=()=>{let t=this.getState().rowDisabledState;return t?t.areAllDisabled():!1};this.getState=t.getState,this.getState().__apiRef.current=this,this.actions=t.actions,this.treeApi=new Si({...t,dataSourceApi:this})}getPendingOperationPromise(){return this.pendingPromise}batchOperation(t){if(!this.pendingPromise){this.pendingPromise=new Promise(n=>{this.resolvePendingPromise=n});let e=Math.max(0,this.getState().batchOperationDelay??0);e===0?this.batchOperationRafId=setTimeout(()=>{this.commit()}):this.batchOperationTimeoutId=setTimeout(()=>{this.batchOperationRafId=setTimeout(()=>{this.commit()})},e)}return t.type==="replace-all"&&(this.pendingOperations.length=0),this.pendingOperations.push(t),this.pendingPromise}commitOperations(t){if(!t.length)return;let e=this.getState().cache,{isTree:n,nodesKey:i}=this.getState(),r=e?vn.clone(e,{light:!0}):new vn({nodesKey:n?i:void 0});t.forEach(a=>{switch(a.type){case"update":a.array.forEach((s,c)=>{if(a.primaryKeys){let f=a.primaryKeys[c],m=this.getDataByPrimaryKey(f);m&&r.update(a.primaryKeys[c],s,m,a.metadata)}else if(a.nodePaths){let f=this.getDataByNodePath(a.nodePaths[c]);f&&(typeof s=="function"?r.updateChildren(a.nodePaths[c],s,f,a.metadata):r.updateNodePath(a.nodePaths[c],s,f,a.metadata))}});break;case"delete":a.primaryKeys?a.primaryKeys.forEach(s=>{let c=this.getDataByPrimaryKey(s);c&&r.delete(s,c,a.metadata)}):a.nodePaths&&a.nodePaths.forEach(s=>{let c=this.getDataByNodePath(s);c&&r.deleteNodePath(s,c,a.metadata)});break;case"insert":let l=a.primaryKey,u=a.position,d=a.nodePath;d?a.array.forEach(s=>{r.insertNodePath([...d],s,u,a.metadata),l=this.toPrimaryKey(s),d.pop(),d.push(l),u="after"}):a.array.forEach(s=>{r.insert(l,s,u,a.metadata),l=this.toPrimaryKey(s),u="after"});break;case"replace-all":r.resetDataSource(a.metadata);break}}),this.actions.cache=r}flush(){return this.commit()}waitForNodePath(t,e){let n=this.getState();if(this.isNodePathAvailable(t))return Promise.resolve(!0);let i=e?.timeout??ia,r=n.waitForNodePathPromises.get(t);if(r)return r.promise;let a=Date.now(),l=()=>{},u=new Promise(d=>{let s,c;l=f=>{clearTimeout(c),s=f,n.waitForNodePathPromises.delete(t),d(f)},c=setTimeout(()=>{s===void 0&&l(!1)},i)});return n.waitForNodePathPromises.set(t,{timestamp:a,promise:u,resolve:l}),u}commit(){this.commitOperations(this.pendingOperations),this.pendingOperations.length=0;let t=this.pendingPromise;if(t&&this.resolvePendingPromise){let e=this.resolvePendingPromise;requestAnimationFrame(()=>{e(!0)}),this.pendingPromise=null,this.resolvePendingPromise=null}return t||Promise.resolve(!0)}};function qu(o){let t=o.cache;if(!t)return{sortInfo:!1,groupBy:!1,tree:!1,filterValue:!1,aggregationReducers:!1};let e=!1,n=!1,i=!1,r=!1,a=!1,l=t.getAffectedFields(),{sortInfo:u,groupBy:d,filterValue:s,aggregationReducers:c,nodesKey:f,isTree:m}=o;if(u&&u.length)if(l===!0)e=!0;else for(let p of u){let h=p.field;if(h&&(h=Array.isArray(h)?h:[h],e=h.reduce((y,C)=>y||typeof C!="function"?l.has(C):!1,!1),e))break}if(d&&d.length){if(l===!0)n=!0;else for(let p of d)if(p.field&&l.has(p.field)){n=!0;break}}if(m&&(l===!0?i=!0:i=l.has(f)),s&&s.length)if(l===!0)r=!0;else for(let p of s){if(p.id){r=!0;break}if(p.field&&l.has(p.field)){r=!0;break}}if(c&&Object.keys(c).length){if(l===!0)a=!0;else for(let p in c)if(c.hasOwnProperty(p)){let h=c[p];if(h.field){if(l.has(h.field)){a=!0;break}}else{a=!0;break}}}return{sortInfo:e,groupBy:n,filterValue:r,aggregationReducers:a,tree:i}}function vi(o){if(!o)return;let t=Object.keys(o);if(!t.length)return;let e={};for(let n=0,i=t.length;n<i;n++){let r=t[n],a=o[r].initialValue;a!==void 0&&(e[r]=typeof a=="function"?a():a)}return e}function Ii(o){let t=o.reducerKeys,e=o.reducers,n=o.results;for(let i=0,r=t.length;i<r;i++){let a=t[i],l=e[a].reducer;n[a]=l(n[a],o.rowInfo)}}function Ri(o){let t=Object.keys(o.reducers||{});if(!t.length||!o.results)return o.results;let e=o.reducers,n=o.results;for(let i=0,r=t.length;i<r;i++){let a=t[i],l=e[a].done;typeof l=="function"&&(n[a]=l(n[a],o.array))}return n}var hh="group-by",Yu="group-by-";function Xu(o){let t=o.map(e=>e.valueGetter?n=>e.valueGetter({data:n,field:e.field}):e.field??e.groupField).filter(Boolean);if(t.length)return t.length===1&&typeof t[0]!="function"?t[0]:t}function xi(o,t){if(!o?.length||!t?.length)return o;let e=!1,n=o.map(i=>{if(i.field!=null||!i.id)return i;if(i.id===hh){let r=Xu(t);return r==null?i:(e=!0,{...i,field:r})}if(i.id.startsWith(Yu)){let r=i.id.slice(Yu.length),a=t.find(u=>String(u.field)===r||u.groupField===r);if(!a)return i;let l=Xu([a]);return l==null?i:(e=!0,{...i,field:l})}return i});return e?n:o}function Zu(o){return"groupNesting"in o?o.groupNesting??0:0}function Ju(o,t){if(!(!o.isGroupRow||!t.reducerId))return t.pivotTotalColumn&&(!t.pivotGroupKeys||t.pivotGroupKeys.length===0)?o.reducerResults?.[t.reducerId]:o.pivotValuesMap?.get(t.pivotGroupKeys)?.reducerResults?.[t.reducerId]}function gh(o,t,e,n){if(o==null&&t==null)return 0;if(o==null)return 1;if(t==null)return-1;let i=Array.isArray(e.type)?e.type[0]:e.type,a=(e.fn||i&&n[i]||n.string||on.string)(o,t);return a===0?0:e.dir*a}function yh(o,t){if(!o?.length||!t)return[];let e=[];for(let n of o){let i=n.id?t[n.id]:void 0;!i?.pivotColumn||!i.pivotAggregator||e.push({dir:n.dir,type:n.type,fn:n.fn,pivotGroupKeys:i.pivotGroupKeys??[],reducerId:i.pivotAggregator.id,pivotTotalColumn:!!i.pivotTotalColumn})}return e}function bh(o){let t=[],e=[];for(let n of o){let i={row:n,children:[]},r=Zu(n);for(;e.length&&Zu(e[e.length-1].row)>=r;)e.pop();e.length?e[e.length-1].children.push(i):t.push(i),e.push(i)}return t}function Ch(o){let t=[],e=(n,i)=>{n.forEach((r,a)=>{let l=[...i,a],u=r.row;u.indexInGroup=a,u.indexInParentGroups=l,u.indexInAll=t.length,t.push(u),e(r.children,l)})};return e(o,[]),t}function Qu(o,t,e,n){let i=yh(t,e);if(!i.length||!o.length)return o;let r={...on,...n},a=bh(o),l=(d,s)=>{for(let c of i){let f=gh(Ju(d.row,c),Ju(s.row,c),c,r);if(f!==0)return f}return 0},u=d=>{d.sort(l);for(let s of d)u(s.children)};return u(a),Ch(a)}var Eo={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 aa=class o{constructor(t){this.debugId=t;this.markerDetails={label:"",track:"",trackGroup:void 0,color:void 0,details:[],tooltip:void 0};this.stopped=!1;this.start=t=>{if(this.markerDetails.startTs)return this;let e=performance.now();return this.markerDetails.details=t?.details??[],this.markerDetails.startTs=e,this};this.end=(t={})=>{if(this.stopped)return this;this.stopped=!0;let e=t.startTs??this.markerDetails.startTs,n=t.endTs??this.markerDetails.endTs??performance.now(),i=t.color||this.markerDetails.color||"primary",r=t.trackGroup||this.markerDetails.trackGroup||`Infinite Table (${this.debugId})`,a=[...this.markerDetails.details||[],...t.details||[]],l=t.tooltip||this.markerDetails.tooltip,u=t.label||this.markerDetails.label||"Unknown",d=t.track||this.markerDetails.track||"Unknown";return performance.measure(u,{start:e,end:n,detail:{devtools:{dataType:"track-entry",trackGroup:r,track:d,color:i,properties:a.length>0?a.map(s=>[s.name,s.value]):void 0,tooltipText:l}}}),this};this.debugId=t}static create(t){return new o(t)}get startTimestamp(){return this.markerDetails.startTs}get track(){let t=this;return Object.keys(Eo).reduce((e,n)=>{let i={start:t.start,end:r=>t.end({...r,track:Eo[n].track,label:r.label}),get label(){let r=Eo[n];return Object.keys(r.labels).reduce((a,l)=>{let u={start:t.start,end:d=>t.end({...d,track:r.track,label:r.labels[l]})};return Object.defineProperty(a,l,{get:()=>(t.markerDetails.label=r.labels[l],u)}),a},{})}};return Object.defineProperty(e,n,{get:()=>{let r=Eo[n];return t.markerDetails.track=r.track,i}}),e},{})}};function yt(o){return aa.create(o)}function qn(o){if(o==null)return!1;let t=o;return!0}function sa(o,t){return o&&o.filter(e=>{let n=t[e.filter.type];return!(!n||n.emptyValues&&n.emptyValues.includes(e.filter.value))})}var Vt=(o,t,e)=>{for(let n=0,i=e.length;n<i;n++){let r=e[n],a=o[r],l=t[r];if(a!==l)return!0}return!1};function la(){return!1}function Th(o,t,e,n,i,r){let a={dataSourceHasGrouping:!1,isTreeNode:!1,data:o,id:t,indexInAll:e,isGroupRow:!1,selfLoaded:!0,rowSelected:!1,rowDisabled:!1,isCellSelected:la,hasSelectedCells:la};return n&&(a.rowSelected=n(a)),i&&(a.rowDisabled=i(a)),r&&(a.isCellSelected=l=>r.isCellSelected(a.id,l),a.hasSelectedCells=l=>r.isCellSelectionInRow(a.id,l)),a}var Sh=Ft(()=>{console.warn(`Your "treeFilterFunction" should NOT MUTATE the data object. You're probably mutating the node children.
|
|
2
2
|
|
|
3
3
|
Your filtering function probably looks like this:
|
|
4
4
|
|
|
@@ -10,19 +10,19 @@ function treeFilterFunction({ data }) {
|
|
|
10
10
|
|
|
11
11
|
Make sure you avoid mutations.
|
|
12
12
|
|
|
13
|
-
`)});function Hu(o){let{dataArray:t,treeFilterFunction:e,toPrimaryKey:n,getNodeChildren:i,isLeafNode:r,nodesKey:a}=o,l=[],u=s=>{let d=i(s);if(r(s)||!Array.isArray(d))return s;let c=Hu({...o,dataArray:d});return c.length===0?!1:(s={...s,[a]:c},s)};for(let s=0,d=t.length;s<d;s++){let c=t[s],f=i(c),m=e({data:c,index:s,dataArray:t,primaryKey:n(c,s),filterTreeNode:u});m&&(m===!0?m=c:typeof m=="object"&&m===c&&f!==i(m)&&$m(),l.push(m))}return l}function Um(o){let{filterTypes:t,marker:e,operatorsByFilterType:n,filterFunction:i,toPrimaryKey:r,treeFilterFunction:a,getNodeChildren:l,nodesKey:u,isLeafNode:s}=o,{dataArray:d}=o;e?.start({details:[{name:"Count before",value:d.length}]}),i&&(d=d.filter((f,m,p)=>i({data:f,index:m,dataArray:p,primaryKey:r(f,m)}))),a&&(d=Hu({...o,treeFilterFunction:a,getNodeChildren:l,nodesKey:u,isLeafNode:s}));let c=na(o.filterValue,t)||[];if(c&&c.length){let f=d.filter((m,p,h)=>{let g={data:m,index:p,dataArray:h,primaryKey:r(m,p),field:void 0};for(let b=0,C=c.length;b<C;b++){let T=c[b],{disabled:v,field:S,valueGetter:D,filter:{type:R,value:E,operator:N}}=T,w=t[R];if(v||!w)continue;let P=n[R]?.[N];if(!P)continue;let A=D||w.valueGetter||(({data:M,field:F})=>F?M[F]:M);g.field=S;let I=g;if(I.filterValue=E,I.currentValue=A(I),I.emptyValues=w.emptyValues,!P.fn(I))return!1}return!0});return e?.end({details:[{name:"Count after",value:f.length}]}),f}return e?.end({details:[{name:"Count after",value:d.length}]}),d}function Bu(o){let t,{state:e,previousState:n}=o,i=e.debugId,r;i&&(r=gt(i).track.DataSource.label.PrepareData.start());let a=Ku(e),l=e.sortInfo,u=e.sortMode,s=l?.length?u==="local":!1;(e.lazyLoad||e.livePagination)&&(s=!1);let d=zt(n,e,["refetchKey"]),c=zt(n,e,["cache","originalDataArray","originalLazyGroupDataChangeDetect"]);Array.isArray(e.data)&&d&&(c=!0),!1&&(e.originalLazyGroupData=new $,c=!0);let m=e.cache?Cn.clone(e.cache):void 0;m&&!m.isEmpty()&&(c=!0);let p=e.toPrimaryKey,h=e.nodesKey,g=e.isTree,b=h?Y=>Y[h]:void 0,C=h?Y=>Y[h]===void 0:void 0,T,v;c&&(e.indexer.clear(),e.lazyLoad||(T=m?.getMutations(),v=m?.getTreeMutations(),e.originalDataArray=e.indexer.indexArray(e.originalDataArray,{toPrimaryKey:p,cache:m,getNodeChildren:b,isLeafNode:C,nodesKey:h}),g&&e.waitForNodePathPromises.visit(({value:Y},ae)=>{Y&&e.indexer.getDataForNodePath(ae)!==void 0&&Y.resolve(!0)}))),m&&(m.clear(),e.cache=void 0);let{filterFunction:D,treeFilterFunction:R,filterValue:E,filterTypes:N,operatorsByFilterType:w}=e,P=!!D||!!R||Array.isArray(E)&&E.length,_=P&&e.filterMode==="local",A=zt(n,e,["filterFunction","treeFilterFunction","filterValue","filterTypes"]),I=c||A,M=zt(n,e,["sortInfo"]),F=c||A||M,O=e.filterMode==="local"&&(I||!e.lastFilterDataArray),z=s&&(F||!e.lastSortDataArray||a.sortInfo),k=e.groupBy,H=e.pivotBy,oe=!g&&(k.length>0||!!H),le=g,q=zt(n,e,["rowDisabledState","isRowDisabled"]),Re=zt(n,e,["rowSelection","cellSelection","isRowSelected","originalLazyGroupDataChangeDetect"]),ye=zt(n,e,["treeSelection","cellSelection","isNodeSelected","originalLazyGroupDataChangeDetect"]),Pe=c||F||zt(n,e,["generateGroupRows","originalLazyGroupData","originalLazyGroupDataChangeDetect","groupBy","groupRowsState","pivotBy","aggregationReducers","pivotTotalColumnPosition","pivotGrandTotalColumnPosition","showSeparatePivotColumnForSingleAggregation","repeatWrappedGroupRows","rowsPerPage"]),je=c||F||zt(n,e,["originalLazyGroupData","originalLazyGroupDataChangeDetect","treeExpandState","isNodeExpanded","isNodeCollapsed","aggregationReducers","repeatWrappedGroupRows","rowsPerPage"]),Fe=zt(n,e,["rowInfoReducers"]),be=oe&&(Pe||!e.lastGroupDataArray||a.groupBy)||Re||q||Fe,De=le&&(je||a.tree||!e.lastTreeDataArray)||ye||q||Fe,ge=Date.now(),te=e.originalDataArray;if(le&&De){let Y={marker:i?gt(i).track.DataSource.label.TreeUnfilteredTreePaths.start():void 0,isLeafNode:C,getNodeChildren:b,toKey:p};e.unfilteredTreePaths=Ur(Y,te).treePaths}if(P||(e.unfilteredCount=te.length),_){e.unfilteredCount=te.length;let Y=ge;O?(e.devToolsDetected&&(Y=Date.now()),te=Um({marker:i?gt(i).track.DataSource.label.Filter.start():void 0,getNodeChildren:b,isLeafNode:C,nodesKey:h,treeFilterFunction:R,dataArray:te,toPrimaryKey:p,filterTypes:N,operatorsByFilterType:w,filterFunction:D,filterValue:E}),e.devToolsDetected&&e.debugTimings.set("filter",Date.now()-Y)):te=e.lastFilterDataArray,e.lastFilterDataArray=te,e.filteredAt=ge}if(e.filteredCount=te.length,e.postFilterDataArray=te,s){let Y=an.knownTypes;if(an.knownTypes={...Y,...e.sortTypes},z){let ae=ge;if(e.devToolsDetected&&(ae=Date.now()),i&&(t=gt(i).track.DataSource.label.Sort.start({details:[{name:"Count",value:te.length}]})),e.sortFunction?(te=e.sortFunction(l,[...te]),t&&(t.end(),t=void 0)):g?te=Lu(l,te,{marker:t,inplace:!1,isLeafNode:C,getNodeChildren:b,toKey:p,nodesKey:h}):te=an(l,[...te],{marker:t}),i&&(t?.end(),t=void 0),e.devToolsDetected){let ce=Date.now()-ae;e.debugTimings.set("sort",ce)}}else te=e.lastSortDataArray;an.knownTypes=Y,e.lastSortDataArray=te,e.sortedAt=ge}e.postSortDataArray=te;let B=e.dataArray,X=e.rowSelection instanceof Ae?e.rowSelection:void 0,j=e.treeExpandState instanceof nt?e.treeExpandState:void 0,ie=e.cellSelection instanceof He?e.cellSelection:void 0;X?.xcache();let Q=e.selectionMode==="single-row"?Y=>Y.id===e.rowSelection:e.selectionMode==="multi-row"?Y=>{let ae=X;return Y.isGroupRow?ae.getGroupRowSelectionState(Y.groupKeys):ae.isRowSelected(Y.id,Y.dataSourceHasGrouping?Y.groupKeys:void 0)}:void 0,Ce=e.isRowDisabled||ta;e.isRowSelected&&e.selectionMode==="multi-row"&&(Q=Y=>e.isRowSelected(Y,X,e.selectionMode));let se;e.isNodeExpanded&&(se=Y=>e.isNodeExpanded(Y,j)),e.isNodeCollapsed&&(se=Y=>!e.isNodeExpanded(Y,j)),se||(se=ae=>j.isNodeExpanded(ae.nodePath));let ee=e.rowInfoReducers;if(oe){if(be){let Y=ge;e.devToolsDetected&&(Y=Date.now());let ae=e.aggregationReducers,ce=e.lazyLoad?Pu({groupBy:k,pivot:H,mappings:e.pivotMappings,reducers:ae,indexer:e.indexer,toPrimaryKey:p,cache:m,marker:i?gt(i).track.DataSource.label.LazyGroup.start():void 0},e.originalLazyGroupData):hi({groupBy:k,pivot:H,reducers:ae,marker:i?gt(i).track.DataSource.label.Group.start():void 0},te);e.groupDeepMap=ce.deepMap,X&&(X.getConfig=rt(e));let Ne=Object.keys(ee||{}),ze=Ci(ee),qe={reducers:ee,results:ze,reducerKeys:Ne,rowInfo:{}},Ze=ze?wt=>{qe.rowInfo=wt,Ti(qe)}:void 0,ue=ie?wt=>{wt.isCellSelected=K=>ie.isCellSelected(wt.id,K)}:void 0,pt=Ze||ue?qr(Ze,ue):void 0,bt=Eu({marker:i?gt(i).track.DataSource.label.FlattenTree.start():void 0,groupResult:ce,lazyLoad:!!e.lazyLoad,reducers:ae,toPrimaryKey:p,isRowSelected:Q,rowSelectionState:X,withRowInfo:pt,repeatWrappedGroupRows:e.rowsPerPage!=null?e.repeatWrappedGroupRows:!1,rowsPerPage:e.rowsPerPage,groupRowsState:e.groupRowsState,generateGroupRows:e.generateGroupRows});B=bt.data,e.rowInfoReducerResults=Si({reducers:ee,results:ze,array:B}),e.groupRowsIndexesInDataArray=bt.groupRowsIndexes,e.reducerResults=ce.reducerResults;let St=H?Fu({deepMap:ce.topLevelPivotColumns,pivotBy:H,pivotTotalColumnPosition:e.pivotTotalColumnPosition??"end",pivotGrandTotalColumnPosition:e.pivotGrandTotalColumnPosition??!1,reducers:e.aggregationReducers,showSeparatePivotColumnForSingleAggregation:e.showSeparatePivotColumnForSingleAggregation}):void 0;e.pivotColumns=St?.columns,e.pivotColumnGroups=St?.columnGroups,e.devToolsDetected&&e.debugTimings.set("group-and-pivot",Date.now()-Y)}else B=e.lastGroupDataArray;e.lastGroupDataArray=B,e.groupedAt=ge}else if(le){if(De){let Y=ge;e.devToolsDetected&&(Y=Date.now());let ae=e.aggregationReducers,ce={marker:i?gt(i).track.DataSource.label.Tree.start():void 0,isLeafNode:C,getNodeChildren:b,toKey:p,reducers:ae},Ne=Ur(ce,te);e.treeDeepMap=Ne.deepMap,e.treePaths=Ne.treePaths;let ze=e.selectionMode==="multi-row"?Wu(e.treeSelection,e.selectionMode,e):void 0;e.treeSelectionState=ze;let qe=Object.keys(ee||{}),Ze=Ci(ee),ue={reducers:ee,results:Ze,reducerKeys:qe,rowInfo:{}},pt=Ze?x=>{ue.rowInfo=x,Ti(ue)}:void 0,bt=ie?x=>{x.isCellSelected=G=>ie.isCellSelected(x.id,G)}:void 0,St=pt||bt?qr(pt,bt):void 0,wt=e.selectionMode==="single-row"?x=>x.id===e.treeSelection:e.selectionMode==="multi-row"?x=>ze.isNodeSelected(x.nodePath):void 0,K=e.rowsPerPage!=null?e.repeatWrappedGroupRows:!1;B=Mu({marker:i?gt(i).track.DataSource.label.FlattenTree.start():void 0,treeResult:Ne,treeParams:ce,dataArray:te,reducers:ae,toPrimaryKey:p,isNodeSelected:wt,isNodeExpanded:se,treeSelectionState:ze,withRowInfo:St,repeatWrappedGroupRows:K,rowsPerPage:e.rowsPerPage}).data,e.rowInfoReducerResults=Si({reducers:ee,results:Ze,array:B}),e.reducerResults=Ne.reducerResults,e.totalLeafNodesCount=Ne.deepMap.get([])?.totalLeafNodesCount??0,e.treeAt=ge,e.devToolsDetected&&e.debugTimings.set("tree",Date.now()-Y)}else B=e.lastTreeDataArray;e.lastTreeDataArray=B}else if(e.groupDeepMap=void 0,e.pivotColumns=void 0,e.groupRowsIndexesInDataArray=void 0,n.postSortDataArray!=e.postSortDataArray||Pe||Re||q||Fe){let ae=Object.keys(ee||{}),ce=Ci(ee),Ne={reducers:ee,results:ce,reducerKeys:ae,rowInfo:{}};B=te.map((ze,qe)=>{let Ze=jm(ze,ze?p(ze):qe,qe,Q,Ce,ie);return ce&&(Ne.rowInfo=Ze,Ti(Ne)),Ze}),e.rowInfoReducerResults=Si({reducers:ee,results:ce,array:B})}if(e.postGroupDataArray=B,B!==e.dataArray&&(e.updatedAt=ge),e.dataArray=B,e.reducedAt=ge,e.selectionMode==="multi-row")if(oe&&e.lazyLoad){i&&(t=gt(i).track.DataSource.label.ComputeSelectionCountLazy.start());let Y=!0,ae=!1;e.dataArray.forEach(ce=>{if(!ce.isTreeNode&&ce.isGroupRow&&ce.groupKeys.length===1){let{rowSelected:Ne}=ce;Ne!==!0&&(Y=!1),(Ne===!0||Ne===null)&&(ae=!0)}}),e.allRowsSelected=Y,e.someRowsSelected=ae,i&&(t?.end(),t=void 0)}else{i&&(t=gt(i).track.DataSource.label.ComputeSelectionCount.start());let Y=e.isTree?e.totalLeafNodesCount:e.filteredCount,ae=e.isTree?e.treeSelectionState?e.treeSelectionState.getSelectedCount():0:e.rowSelection.getSelectedCount();e.allRowsSelected=Y===ae,e.someRowsSelected=ae>0,i&&(t?.end(),t=void 0)}return e.originalDataArrayChanged=c,c&&(e.originalDataArrayChangedInfo={timestamp:ge,mutations:T?.size?T:void 0,treeMutations:v?.size?v:void 0}),e.rowInfoStore.notifyDataArray(B,{marker:i?gt(i).track.DataSource.label.DiffRowInfoInStore:void 0}),r&&r?.track.DataSource.label.PrepareData.end({details:[O||z||be||De?{name:"Performed operations",value:[O?"filter":null,z?"sort":null,be?"group":null,De?"tree":null].filter(Wn).join(", ")}:null,d?{name:"Refetch key",value:`Old ${n.refetchKey} -> New ${e.refetchKey}`}:null,c?{name:"Original data array changed",value:""}:null,{name:"Unfiltered data length",value:e.originalDataArray.length}].filter(Wn)}),e}function jt(){let o=Ve().performance?.now();return`${Date.now()}:${o}`}var ju=!0,qm={originalDataArray:!0,changes:!0},Ym={filterValue:(o,t)=>JSON.stringify(o)===JSON.stringify(t),groupRowsState:(o,t)=>JSON.stringify(o)===JSON.stringify(t)};function Vt(o,t,e){let n=o.multiSort?o.sortInfo:o.sortInfo?.[0]??null,i={append:!1,originalDataArray:o.originalDataArray,sortInfo:n,refetchKey:o.refetchKey,groupBy:o.groupBy,pivotBy:o.pivotBy,filterValue:o.filterValue,aggregationReducers:o.aggregationReducers};if(e&&(i.masterRowInfo=e.masterRowInfo),i.groupBy&&(i.groupRowsState=o.groupRowsState.getState()),o.livePagination!==void 0&&(i.livePaginationCursor=o.livePaginationCursor,i.__cursorId=o.cursorId),o.lazyLoad&&(o.lazyLoadBatchSize!=null&&o.lazyLoadBatchSize>0&&(i.lazyLoadBatchSize=o.lazyLoadBatchSize,i.lazyLoadStartIndex=0),i.groupKeys=[]),t&&Object.assign(i,t),i.filterValue&&i.filterValue.length){let l=oa(i.filterValue,{filterMode:o.filterMode,filterTypes:o.filterTypes});l&&l.length&&(i.filterValue=l)}let r={},a=o.dataParams||{};for(let l in i)if(i.hasOwnProperty(l)&&!qm[l]){let u=l,s=Ym[u],d=i[u],c=a[u];(s?s(d,c):d===c)||(r[u]=!0)}return i.changes=r,i}function jn(o,t,e,n,i){let r=Vt(t,n,i),a=r.append;if(t.lazyLoad){let u=t.originalLazyGroupData,s=[Kn,...r.groupKeys||[]],d=u.get(s);if(!d){let c=[...r.groupKeys||[],r.lazyLoadStartIndex];t.lazyLoadCacheOfLoadedBatches.set(c,!0)}if(d&&d.cache&&s.length>1){let c=d.children,f=c.length,m=!0;for(let p=0;p<f;p++)if(c[p]==null){m=!1;break}if(m)return Promise.resolve(!0)}d?d.childrenLoading||(d.childrenLoading=!0):u.set(s,{error:void 0,children:[],childrenLoading:!0,childrenAvailable:!1,cache:ju,totalCount:0,totalCountUnfiltered:0}),e.originalLazyGroupDataChangeDetect=jt()}typeof o=="function"&&(o=o(r));let l=typeof o=="object"&&typeof o.then=="function";return l&&(!t.lazyLoad||t.lazyLoad&&!a)&&(e.loading=!0),Promise.resolve(o).then(u=>{let s=[],d=!1;if(Array.isArray(u.data)){let f=u;if(s=f.data,f.livePaginationCursor!==void 0&&(e.livePaginationCursor=f.livePaginationCursor),f.mappings&&(e.pivotMappings=f.mappings),f.totalCountUnfiltered&&(e.unfilteredCount=f.totalCountUnfiltered),t.lazyLoad){let p=function(h,g,b){let C=[Kn,...h],T=g.data,v={cache:g.cache??ju,childrenLoading:!1,childrenAvailable:!0,totalCount:g.totalCount??T.length,totalCountUnfiltered:g.totalCount??T.length,children:T,error:g.error},S=[];if(r.lazyLoadBatchSize&&!b){let R=m.get(C),E=!R,N=ls({children:!0},R||{},v);E&&(N.chidren=[]),N.children.length=N.totalCount;let w=r.lazyLoadStartIndex??0,P=Math.min(g.totalCount??T.length,w+r.lazyLoadBatchSize);for(let _=w;_<P;_++){let A=v.children[_-w];if(!A)throw`lazily loaded item not found at index ${_-w}`;N.children[_]=A,A.dataset&&S.push({keys:A.keys,dataset:A.dataset})}E&&m.set(C,N)}else v.children.forEach(R=>{R&&R.dataset&&S.push({keys:R.keys,dataset:R.dataset})}),v.children.length=v.totalCount,m.set(C,v);let D=!1;if(!h||!h.length){let R=m.get([Kn]);e.originalDataArray=[...R.children],D=!0}if(D||(e.originalLazyGroupDataChangeDetect=jt()),S.length){let R=h;S.forEach(({keys:E,dataset:N})=>{p(E,N,R)})}};var c=p;let m=t.originalLazyGroupData;d=!0,p(r.groupKeys||[],f)}}else s=u;d||(e.originalDataArray=a?t.originalDataArray.concat(s):s),l&&(!t.lazyLoad||t.lazyLoad&&!a)&&(e.loading=!1)})}function oa(o,{filterTypes:t,filterMode:e}){return e==="local"?o:(na(o,t)||[]).map(n=>{let i={...n};return delete i.valueGetter,i})}var Zm=()=>new Promise(o=>{Ke(o)});function ia(o,t){let e=!!o,{stateReadyAsDetails:n}=t(),i=e&&o.shouldRestoreState?n:!0;return{isDetail:e,isDetailReady:i}}function $u(o,t){let{startIndex:e,endIndex:n,lazyLoadBatchSize:i,componentState:r,componentActions:a,dismissLoadedRows:l}=o,{dataArray:u}=r,s=l?()=>!1:h=>u[h].data!=null,d=!l,c=new $,f=["_______xxx______"];for(let h=e;h<=n;h++){let g=u[h];if(!g)continue;let b=s(h),C=g.dataSourceHasGrouping&&g.groupKeys?[...g.groupKeys]:[];g.isGroupRow&&g.dataSourceHasGrouping&&g.groupKeys&&C.pop();let T=C.length?C:f,v=g.dataSourceHasGrouping?g.indexInGroup:g.indexInAll;if(g.isGroupRow&&!g.collapsed&&!g.childrenAvailable){let S={lazyLoadStartIndex:0,lazyLoadBatchSize:i,groupKeys:g.groupKeys,append:d},D=g.groupKeys,R=c.get(D);if(!R?.[g.id]){let E=!R;R=R||{},R[g.id]||(R[g.id]=S),E&&c.set(D,R)}}if(!b&&i!=null){let S=c.get(T),D=Math.floor(v/i)*i,R=v-D,E=u[g.indexInAll-R].indexInAll,N=s(E),w=u[E].id;if(N||S?.[w])continue;let P=!S;S=S||{};let _={lazyLoadStartIndex:D,lazyLoadBatchSize:i,groupKeys:C,append:d};S[w]||(S[w]=_),P&&c.set(T,S)}}let m=Promise.resolve(!0),p=[];c.topDownValues().forEach(h=>{p.push(...Object.values(h))}),p.reduce((h,g)=>{let b=[...g.groupKeys,g.lazyLoadStartIndex];if(t&&t.has(b))return h;t?.set(b,!0);let C=[r.data,r,a,g];return h.then(()=>Zm()).then(()=>jn(...C))},m)}var Xm=Object.freeze([]),Uu=(o,t)=>{let e=o??Xm,n=Array.isArray(e)?e:[e];if(t&&t.has(e)){let i=t.get(e);if(i&&i.length===n.length)return i}return t&&e&&t.set(e,n),n};function wi(o,t){if(o===t)return!0;if(o==null||t==null)return o===t;if(typeof o!=typeof t)return!1;if(Array.isArray(o)&&Array.isArray(t)){if(o.length!==t.length)return!1;for(let e=0,n=o.length;e<n;e++)if(!wi(o[e],t[e]))return!1;return!0}if(typeof o=="object"){let e=Object.keys(o),n=Object.keys(t);if(e.length!==n.length)return!1;for(let i of e)if(!Object.prototype.hasOwnProperty.call(t,i)||!wi(o[i],t[i]))return!1;return!0}return!1}function Jm(o,t){return!(o===void 0||t===void 0||o.isGroupRow!==t.isGroupRow||o.dataSourceHasGrouping!==t.dataSourceHasGrouping||o.isTreeNode!==t.isTreeNode||o.isTreeNode&&o.isParentNode!==t.isParentNode)}var vi={id:!0,value:!0,indexInAll:!0,rowSelected:!0,rowDisabled:!0,isCellSelected:!1,hasSelectedCells:!1},qu={...vi,dataSourceHasGrouping:!0,isTreeNode:!0,data:!1,isGroupRow:!0,selfLoaded:!0},Qm={indexInGroup:!0,groupKeys:!0,groupBy:!0,rootGroupBy:!0,parents:!1,indexInParentGroups:!0,groupCount:!0,groupNesting:!0,collapsed:!0,selfLoaded:!0},eh={...vi,...Qm,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},Yu={isTreeNode:!0,isParentNode:!0,indexInParent:!0,nodePath:!0,parentNodes:!1,indexInParentNodes:!0,totalLeafNodesCount:!0,collapsedLeafNodesCount:!0,treeNesting:!0,selfLoaded:!0},th={...vi,...Yu,dataSourceHasGrouping:!0,isTreeNode:!0,isGroupRow:!0,isParentNode:!0,data:!1},nh={...vi,...Yu,dataSourceHasGrouping:!0,isParentNode:!0,isGroupRow:!0,nodeExpanded:!0,selfExpanded:!0,data:!1,selectedLeafNodesCount:!0,deepRowInfoArray:!1,deselectedLeafNodesCount:!0,duplicateOf:!1},oh=Object.entries(qu).map(([o,t])=>t?o:void 0).filter(Boolean),ih=Object.entries(qu).map(([o,t])=>t?o:void 0),rh=Object.entries(eh).map(([o,t])=>t?o:void 0),ah=Object.entries(th).map(([o,t])=>t?o:void 0),lh=Object.entries(nh).map(([o,t])=>t?o:void 0);function sh(o,t){if(o===t)return!0;if(!o||!t||!Jm(o,t)||o.id!==t.id||o.data!==t.data&&!wi(o.data,t.data))return!1;let e=[];o.dataSourceHasGrouping?e=o.isGroupRow?rh:ih:o.isTreeNode?e=o.isTreeNode&&o.isParentNode?lh:ah:e=oh;for(let n of e){let i=o[n],r=t[n];if(!(typeof i=="function"||typeof r=="function")&&!wi(i,r))return!1}return!0}function Zu(){let o=[],t=new Map,e=(u,s)=>{let d=o,c=s?.marker;c&&c.start({details:[{name:"new dataArray length",value:u.length},{name:"old dataArray length",value:d.length}]});let f=[],m=r();for(let p of m){let h=d[p],g=u[p];if(g===void 0){f.push(p);continue}sh(h,g)||f.push(p)}o=u,f.length>0&&queueMicrotask(()=>{for(let p=0,h=f.length;p<h;p++){let g=f[p],b=t.get(g);if(b)for(let C of b)C()}}),c&&c.end({details:[{name:"updated row infos",value:f.length}]})},n=u=>o[u],i=(u,s)=>{let d=t.get(u);return d||(d=new Set,t.set(u,d)),d.add(s),()=>{let c=t.get(u);c&&(c.delete(s),c.size===0&&t.delete(u))}},r=()=>Array.from(t.keys());return{notifyDataArray:e,getRowInfoAtIndex:n,subscribeToRowIndex:i,getDataArray:()=>o,clear:()=>{o=[],t.clear()}}}var ra=new Map,aa=new Map;var la="DebugID=";function $n(o,t){return t&&t.startsWith(la)?t:t?`${la}${o}:${t}`:`${la}${o}`}var uh=Symbol("cursorId"),Xu=o=>o.totalLeafNodesCount===0,dh=o=>o.isParentNode?!Xu(o):!0;function Ju(o){let t=Date.now(),e=[],n=[],i=new $;return{logger:Qt(`${o.debugId}:DataSource`),debugTimings:new Map,debugWarnings:new Map,devToolsDetected:!!globalThis.__INFINITE_TABLE_DEVTOOLS_HOOK__,rowInfoStore:Zu(),indexer:new fi,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 $,waitForNodePathPromises:new $,getDataSourceMasterContextRef:{current:()=>{}},cache:void 0,detailDataSourcesStateToRestore:new Map,stateReadyAsDetails:!1,originalDataArrayChanged:!1,originalDataArrayChangedInfo:{timestamp:0,mutations:void 0},rowsPerPage:null,lazyLoadCacheOfLoadedBatches:new $,dataParams:void 0,onCleanup:me(),notifyScrollbarsChange:me(),notifyScrollStop:me(),notifyRenderRangeChange:me(),pivotTotalColumnPosition:"end",pivotGrandTotalColumnPosition:!1,scrollStopDelayUpdatedByTable:100,originalLazyGroupData:i,originalLazyGroupDataChangeDetect:0,originalDataArray:e,cursorId:uh,showSeparatePivotColumnForSingleAggregation:!1,propsCache:new Map([["sortInfo",new WeakMap],["rowDisabledState",new WeakMap]]),rowInfoReducerResults:void 0,pivotMappings:void 0,pivotColumns:void 0,pivotColumnGroups:void 0,dataArray:n,unfilteredCount:n.length,filteredCount:n.length,updatedAt:t,groupedAt:0,sortedAt:0,treeAt:0,filteredAt:0,reducedAt:t,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 ch(o){let t={...o};return delete t.originalDataArray,t}var fh=[],Qu=o=>{o.destroyedRef.current=!0,o.__apiRef.current=null,o.lastSelectionUpdatedNodePathRef.current=null,o.lastExpandStateInfoRef.current={state:"collapsed",nodePath:null},o.treeExpandState?.destroy(),o.treePaths?.clear(),o.unfilteredTreePaths?.clear(),o.waitForNodePathPromises.clear(),o.pathToIndexMap?.clear(),o.rowDisabledState?.destroy(),o.groupRowsState?.destroy(),o.treeSelectionState?.destroy(),o.idToPathMap.clear(),o.idToIndexMap.clear(),o.rowInfoStore.clear()},ed=(o,t)=>({onDataParamsChange:e=>e?Cl(e,100,ch):void 0,lazyLoad:e=>!!e,isNodeReadOnly:e=>e??Xu,isNodeSelectable:e=>e??dh,data:1,nodesKey:1,isNodeExpanded:1,isNodeCollapsed:1,pivotBy:1,primaryKey:1,livePagination:1,treeSelection:1,refetchKey:e=>e??"",filterFunction:1,treeFilterFunction:1,filterValue:1,useGroupKeysForMultiRowSelection:e=>e??!1,filterDelay:e=>e??200,filterTypes:e=>({...Mn,...e}),sortTypes:e=>({...bo,...e}),sortFunction:1,onReady:1,rowInfoReducers:(e,n)=>{let i={initialValue:()=>{n.idToIndexMap.clear()},reducer:(a,l)=>{t.debugId&&!t.nodesKey&&n.idToIndexMap.has(l.id)&&console.warn(`Duplicate id found in data source: ${l.id}`),n.idToIndexMap.set(l.id,l.indexInAll)}},r=e?{...e,__idToIndex:i}:{__idToIndex:i};if(t.nodesKey){let a={initialValue:()=>{n.idToPathMap.clear(),n.pathToIndexMap.clear()},reducer:(l,u)=>{u.isTreeNode&&(n.idToPathMap.set(u.id,u.nodePath),t.debugId&&n.pathToIndexMap.has(u.nodePath)&&console.warn(`Duplicate node path found in data source (debugId: ${t.debugId||"none"}): ${u.nodePath}`),n.pathToIndexMap.set(u.nodePath,u.indexInAll))}};r.__pathToIndex=a}return r},onNodeCollapse:1,onNodeExpand:1,batchOperationDelay:1,isRowSelected:1,isNodeSelected:1,isRowDisabled:1,rowDisabledState:e=>{if(!e)return null;if(e instanceof Tt)return e;let n=o.propsCache.get("rowDisabledState")??Pt,i=n.get(e);return i||(i=new Tt(e),n.set(e,i)),e=i,e??null},onDataArrayChange:1,onDataMutations:1,onTreeDataMutations:1,aggregationReducers:1,collapseGroupRowsOnDataFunctionChange:e=>e??!0,loading:e=>e??!1,sortInfo:e=>Uu(e,o.propsCache.get("sortInfo")),groupBy:e=>e??fh});function ph(o,t){return typeof o=="function"?o({array:t.originalDataArray,length:t.originalDataArray.length,lastItem:t.originalDataArray[t.originalDataArray.length-1]}):o}var Pt=new WeakMap;function mh(o){if(typeof o=="boolean")return{filterValue:o,sortInfo:o,groupBy:o,pivotBy:o};let t={};return o.filterValue!=null&&(t.filterValue=o.filterValue),o.sortInfo!=null&&(t.sortInfo=o.sortInfo),o.groupBy!=null&&(t.groupBy=o.groupBy),o.pivotBy!=null&&(t.pivotBy=o.pivotBy),t}var hh={selectedPaths:[],deselectedPaths:[],defaultSelection:!1};function Wu(o,t,e){if(t!="multi-row")throw new Error(`TreeSelectionState is only supported for multi-row selection. Your current selection mode is "${t}". See https://infinite-table.com/docs/reference/datasource-props#selectionMode for details.
|
|
13
|
+
`)});function ed(o){let{dataArray:t,treeFilterFunction:e,toPrimaryKey:n,getNodeChildren:i,isLeafNode:r,nodesKey:a}=o,l=[],u=d=>{let s=i(d);if(r(d)||!Array.isArray(s))return d;let c=ed({...o,dataArray:s});return c.length===0?!1:(d={...d,[a]:c},d)};for(let d=0,s=t.length;d<s;d++){let c=t[d],f=i(c),m=e({data:c,index:d,dataArray:t,primaryKey:n(c,d),filterTreeNode:u});m&&(m===!0?m=c:typeof m=="object"&&m===c&&f!==i(m)&&Sh(),l.push(m))}return l}function wh(o){let{filterTypes:t,marker:e,operatorsByFilterType:n,filterFunction:i,toPrimaryKey:r,treeFilterFunction:a,getNodeChildren:l,nodesKey:u,isLeafNode:d}=o,{dataArray:s}=o;e?.start({details:[{name:"Count before",value:s.length}]}),i&&(s=s.filter((f,m,p)=>i({data:f,index:m,dataArray:p,primaryKey:r(f,m)}))),a&&(s=ed({...o,treeFilterFunction:a,getNodeChildren:l,nodesKey:u,isLeafNode:d}));let c=sa(o.filterValue,t)||[];if(c&&c.length){let f=s.filter((m,p,h)=>{let y={data:m,index:p,dataArray:h,primaryKey:r(m,p),field:void 0};for(let C=0,b=c.length;C<b;C++){let S=c[C],{disabled:w,field:T,valueGetter:P,filter:{type:R,value:E,operator:N}}=S,v=t[R];if(w||!v)continue;let D=n[R]?.[N];if(!D)continue;let A=P||v.valueGetter||(({data:F,field:_})=>_?F[_]:F);y.field=T;let x=y;if(x.filterValue=E,x.currentValue=A(x),x.emptyValues=v.emptyValues,!D.fn(x))return!1}return!0});return e?.end({details:[{name:"Count after",value:f.length}]}),f}return e?.end({details:[{name:"Count after",value:s.length}]}),s}function td(o){let t,{state:e,previousState:n}=o,i=e.debugId,r;i&&(r=yt(i).track.DataSource.label.PrepareData.start());let a=qu(e),l=xi(e.sortInfo,e.groupBy),u=e.sortMode,d=l?.length?u==="local":!1;(e.lazyLoad||e.livePagination)&&(d=!1);let s=Vt(n,e,["refetchKey"]),c=Vt(n,e,["cache","originalDataArray","originalLazyGroupDataChangeDetect"]);Array.isArray(e.data)&&s&&(c=!0),!1&&(e.originalLazyGroupData=new $,c=!0);let m=e.cache?vn.clone(e.cache):void 0;m&&!m.isEmpty()&&(c=!0);let p=e.toPrimaryKey,h=e.nodesKey,y=e.isTree,C=h?W=>W[h]:void 0,b=h?W=>W[h]===void 0:void 0,S,w;c&&(e.indexer.clear(),e.lazyLoad||(S=m?.getMutations(),w=m?.getTreeMutations(),e.originalDataArray=e.indexer.indexArray(e.originalDataArray,{toPrimaryKey:p,cache:m,getNodeChildren:C,isLeafNode:b,nodesKey:h}),y&&e.waitForNodePathPromises.visit(({value:W},ne)=>{W&&e.indexer.getDataForNodePath(ne)!==void 0&&W.resolve(!0)}))),m&&(m.clear(),e.cache=void 0);let{filterFunction:P,treeFilterFunction:R,filterValue:E,filterTypes:N,operatorsByFilterType:v}=e,D=!!P||!!R||Array.isArray(E)&&E.length,M=D&&e.filterMode==="local",A=Vt(n,e,["filterFunction","treeFilterFunction","filterValue","filterTypes"]),x=c||A,F=Vt(n,e,["sortInfo"]),_=c||A||F,O=e.filterMode==="local"&&(x||!e.lastFilterDataArray),L=d&&(_||!e.lastSortDataArray||a.sortInfo),K=e.groupBy,B=e.pivotBy,G=!y&&(K.length>0||!!B),se=y,Y=Vt(n,e,["rowDisabledState","isRowDisabled"]),Ae=Vt(n,e,["rowSelection","cellSelection","isRowSelected","originalLazyGroupDataChangeDetect"]),ge=Vt(n,e,["treeSelection","cellSelection","isNodeSelected","originalLazyGroupDataChangeDetect"]),Re=c||_||Vt(n,e,["generateGroupRows","originalLazyGroupData","originalLazyGroupDataChangeDetect","groupBy","groupRowsState","pivotBy","aggregationReducers","pivotTotalColumnPosition","pivotGrandTotalColumnPosition","showSeparatePivotColumnForSingleAggregation","repeatWrappedGroupRows","rowsPerPage"]),Ge=c||_||Vt(n,e,["originalLazyGroupData","originalLazyGroupDataChangeDetect","treeExpandState","isNodeExpanded","isNodeCollapsed","aggregationReducers","repeatWrappedGroupRows","rowsPerPage"]),Oe=Vt(n,e,["rowInfoReducers"]),we=G&&(Re||!e.lastGroupDataArray||a.groupBy)||Ae||Y||Oe,Fe=se&&(Ge||a.tree||!e.lastTreeDataArray)||ge||Y||Oe,ce=Date.now(),ee=e.originalDataArray;if(se&&Fe){let W={marker:i?yt(i).track.DataSource.label.TreeUnfilteredTreePaths.start():void 0,isLeafNode:b,getNodeChildren:C,toKey:p};e.unfilteredTreePaths=Qr(W,ee).treePaths}if(D||(e.unfilteredCount=ee.length),M){e.unfilteredCount=ee.length;let W=ce;O?(e.devToolsDetected&&(W=Date.now()),ee=wh({marker:i?yt(i).track.DataSource.label.Filter.start():void 0,getNodeChildren:C,isLeafNode:b,nodesKey:h,treeFilterFunction:R,dataArray:ee,toPrimaryKey:p,filterTypes:N,operatorsByFilterType:v,filterFunction:P,filterValue:E}),e.devToolsDetected&&e.debugTimings.set("filter",Date.now()-W)):ee=e.lastFilterDataArray,e.lastFilterDataArray=ee,e.filteredAt=ce}if(e.filteredCount=ee.length,e.postFilterDataArray=ee,d){let W=un.knownTypes;if(un.knownTypes={...W,...e.sortTypes},L){let ne=ce;if(e.devToolsDetected&&(ne=Date.now()),i&&(t=yt(i).track.DataSource.label.Sort.start({details:[{name:"Count",value:ee.length}]})),e.sortFunction?(ee=e.sortFunction(l,[...ee]),t&&(t.end(),t=void 0)):y?ee=Wu(l,ee,{marker:t,inplace:!1,isLeafNode:b,getNodeChildren:C,toKey:p,nodesKey:h}):ee=un(l,[...ee],{marker:t}),i&&(t?.end(),t=void 0),e.devToolsDetected){let Te=Date.now()-ne;e.debugTimings.set("sort",Te)}}else ee=e.lastSortDataArray;un.knownTypes=W,e.lastSortDataArray=ee,e.sortedAt=ce}e.postSortDataArray=ee;let H=e.dataArray,Z=e.rowSelection instanceof _e?e.rowSelection:void 0,J=e.treeExpandState instanceof nt?e.treeExpandState:void 0,oe=e.cellSelection instanceof Be?e.cellSelection:void 0;Z?.xcache();let re=e.selectionMode==="single-row"?W=>W.id===e.rowSelection:e.selectionMode==="multi-row"?W=>{let ne=Z;return W.isGroupRow?ne.getGroupRowSelectionState(W.groupKeys):ne.isRowSelected(W.id,W.dataSourceHasGrouping?W.groupKeys:void 0)}:void 0,ye=e.isRowDisabled||la;e.isRowSelected&&e.selectionMode==="multi-row"&&(re=W=>e.isRowSelected(W,Z,e.selectionMode));let be;e.isNodeExpanded&&(be=W=>e.isNodeExpanded(W,J)),e.isNodeCollapsed&&(be=W=>!e.isNodeExpanded(W,J)),be||(be=ne=>J.isNodeExpanded(ne.nodePath));let ie=e.rowInfoReducers;if(G){if(we){let W=ce;e.devToolsDetected&&(W=Date.now());let ne=e.aggregationReducers,Te=e.lazyLoad?Nu({groupBy:K,pivot:B,mappings:e.pivotMappings,reducers:ne,indexer:e.indexer,toPrimaryKey:p,cache:m,marker:i?yt(i).track.DataSource.label.LazyGroup.start():void 0},e.originalLazyGroupData):Ci({groupBy:K,pivot:B,reducers:ne,marker:i?yt(i).track.DataSource.label.Group.start():void 0},ee);e.groupDeepMap=Te.deepMap,Z&&(Z.getConfig=at(e));let De=Object.keys(ie||{}),Me=vi(ie),Ze={reducers:ie,results:Me,reducerKeys:De,rowInfo:{}},je=Me?$e=>{Ze.rowInfo=$e,Ii(Ze)}:void 0,fe=oe?$e=>{$e.isCellSelected=g=>oe.isCellSelected($e.id,g)}:void 0,mt=je||fe?ea(je,fe):void 0,it=Vu({marker:i?yt(i).track.DataSource.label.FlattenTree.start():void 0,groupResult:Te,lazyLoad:!!e.lazyLoad,reducers:ne,toPrimaryKey:p,isRowSelected:re,rowSelectionState:Z,withRowInfo:mt,repeatWrappedGroupRows:e.rowsPerPage!=null?e.repeatWrappedGroupRows:!1,rowsPerPage:e.rowsPerPage,groupRowsState:e.groupRowsState,generateGroupRows:e.generateGroupRows});H=it.data,e.rowInfoReducerResults=Ri({reducers:ie,results:Me,array:H}),e.groupRowsIndexesInDataArray=it.groupRowsIndexes,e.reducerResults=Te.reducerResults;let vt=B?Gu({deepMap:Te.topLevelPivotColumns,pivotBy:B,pivotTotalColumnPosition:e.pivotTotalColumnPosition??"end",pivotGrandTotalColumnPosition:e.pivotGrandTotalColumnPosition??!1,reducers:e.aggregationReducers,showSeparatePivotColumnForSingleAggregation:e.showSeparatePivotColumnForSingleAggregation}):void 0;e.pivotColumns=vt?.columns,e.pivotColumnGroups=vt?.columnGroups;let Mt=Qu(H,l,e.pivotColumns,e.sortTypes);Mt!==H&&(H=Mt,e.groupRowsIndexesInDataArray=H.map(($e,g)=>$e.isGroupRow?g:-1).filter($e=>$e>=0)),e.devToolsDetected&&e.debugTimings.set("group-and-pivot",Date.now()-W)}else H=e.lastGroupDataArray;e.lastGroupDataArray=H,e.groupedAt=ce}else if(se){if(Fe){let W=ce;e.devToolsDetected&&(W=Date.now());let ne=e.aggregationReducers,Te={marker:i?yt(i).track.DataSource.label.Tree.start():void 0,isLeafNode:b,getNodeChildren:C,toKey:p,reducers:ne},De=Qr(Te,ee);e.treeDeepMap=De.deepMap,e.treePaths=De.treePaths;let Me=e.selectionMode==="multi-row"?nd(e.treeSelection,e.selectionMode,e):void 0;e.treeSelectionState=Me;let Ze=Object.keys(ie||{}),je=vi(ie),fe={reducers:ie,results:je,reducerKeys:Ze,rowInfo:{}},mt=je?I=>{fe.rowInfo=I,Ii(fe)}:void 0,it=oe?I=>{I.isCellSelected=z=>oe.isCellSelected(I.id,z)}:void 0,vt=mt||it?ea(mt,it):void 0,Mt=e.selectionMode==="single-row"?I=>I.id===e.treeSelection:e.selectionMode==="multi-row"?I=>Me.isNodeSelected(I.nodePath):void 0,$e=e.rowsPerPage!=null?e.repeatWrappedGroupRows:!1;H=zu({marker:i?yt(i).track.DataSource.label.FlattenTree.start():void 0,treeResult:De,treeParams:Te,dataArray:ee,reducers:ne,toPrimaryKey:p,isNodeSelected:Mt,isNodeExpanded:be,treeSelectionState:Me,withRowInfo:vt,repeatWrappedGroupRows:$e,rowsPerPage:e.rowsPerPage}).data,e.rowInfoReducerResults=Ri({reducers:ie,results:je,array:H}),e.reducerResults=De.reducerResults,e.totalLeafNodesCount=De.deepMap.get([])?.totalLeafNodesCount??0,e.treeAt=ce,e.devToolsDetected&&e.debugTimings.set("tree",Date.now()-W)}else H=e.lastTreeDataArray;e.lastTreeDataArray=H}else if(e.groupDeepMap=void 0,e.pivotColumns=void 0,e.groupRowsIndexesInDataArray=void 0,n.postSortDataArray!=e.postSortDataArray||Re||Ae||Y||Oe){let ne=Object.keys(ie||{}),Te=vi(ie),De={reducers:ie,results:Te,reducerKeys:ne,rowInfo:{}};H=ee.map((Me,Ze)=>{let je=Th(Me,Me?p(Me):Ze,Ze,re,ye,oe);return Te&&(De.rowInfo=je,Ii(De)),je}),e.rowInfoReducerResults=Ri({reducers:ie,results:Te,array:H})}if(e.postGroupDataArray=H,H!==e.dataArray&&(e.updatedAt=ce),e.dataArray=H,e.reducedAt=ce,e.selectionMode==="multi-row")if(G&&e.lazyLoad){i&&(t=yt(i).track.DataSource.label.ComputeSelectionCountLazy.start());let W=!0,ne=!1;e.dataArray.forEach(Te=>{if(!Te.isTreeNode&&Te.isGroupRow&&Te.groupKeys.length===1){let{rowSelected:De}=Te;De!==!0&&(W=!1),(De===!0||De===null)&&(ne=!0)}}),e.allRowsSelected=W,e.someRowsSelected=ne,i&&(t?.end(),t=void 0)}else{i&&(t=yt(i).track.DataSource.label.ComputeSelectionCount.start());let W=e.isTree?e.totalLeafNodesCount:e.filteredCount,ne=e.isTree?e.treeSelectionState?e.treeSelectionState.getSelectedCount():0:e.rowSelection.getSelectedCount();e.allRowsSelected=W===ne,e.someRowsSelected=ne>0,i&&(t?.end(),t=void 0)}return e.originalDataArrayChanged=c,c&&(e.originalDataArrayChangedInfo={timestamp:ce,mutations:S?.size?S:void 0,treeMutations:w?.size?w:void 0}),e.rowInfoStore.notifyDataArray(H,{marker:i?yt(i).track.DataSource.label.DiffRowInfoInStore:void 0,dataSourceState:e,previousDataSourceState:n}),r&&r?.track.DataSource.label.PrepareData.end({details:[O||L||we||Fe?{name:"Performed operations",value:[O?"filter":null,L?"sort":null,we?"group":null,Fe?"tree":null].filter(qn).join(", ")}:null,s?{name:"Refetch key",value:`Old ${n.refetchKey} -> New ${e.refetchKey}`}:null,c?{name:"Original data array changed",value:""}:null,{name:"Unfiltered data length",value:e.originalDataArray.length}].filter(qn)}),e}function qt(){let o=ze().performance?.now();return`${Date.now()}:${o}`}var od=!0,vh={originalDataArray:!0,changes:!0},Ih={filterValue:(o,t)=>JSON.stringify(o)===JSON.stringify(t),groupRowsState:(o,t)=>JSON.stringify(o)===JSON.stringify(t)};function Gt(o,t,e){let n=xi(o.sortInfo,o.groupBy),i=o.multiSort?n:n?.[0]??null,r={append:!1,originalDataArray:o.originalDataArray,sortInfo:i,refetchKey:o.refetchKey,groupBy:o.groupBy,pivotBy:o.pivotBy,filterValue:o.filterValue,aggregationReducers:o.aggregationReducers};if(e&&(r.masterRowInfo=e.masterRowInfo),r.groupBy&&(r.groupRowsState=o.groupRowsState.getState()),o.livePagination!==void 0&&(r.livePaginationCursor=o.livePaginationCursor,r.__cursorId=o.cursorId),o.lazyLoad&&(o.lazyLoadBatchSize!=null&&o.lazyLoadBatchSize>0&&(r.lazyLoadBatchSize=o.lazyLoadBatchSize,r.lazyLoadStartIndex=0),r.groupKeys=[]),t&&Object.assign(r,t),r.filterValue&&r.filterValue.length){let u=id(r.filterValue,{filterMode:o.filterMode,filterTypes:o.filterTypes});u&&u.length&&(r.filterValue=u)}let a={},l=o.dataParams||{};for(let u in r)if(r.hasOwnProperty(u)&&!vh[u]){let d=u,s=Ih[d],c=r[d],f=l[d];(s?s(c,f):c===f)||(a[d]=!0)}return r.changes=a,r}function Yn(o,t,e,n,i){let r=Gt(t,n,i),a=r.append;if(t.lazyLoad){let u=t.originalLazyGroupData,d=[jn,...r.groupKeys||[]],s=u.get(d);if(!s){let c=[...r.groupKeys||[],r.lazyLoadStartIndex];t.lazyLoadCacheOfLoadedBatches.set(c,!0)}if(s&&s.cache&&d.length>1){let c=s.children,f=c.length,m=!0;for(let p=0;p<f;p++)if(c[p]==null){m=!1;break}if(m)return Promise.resolve(!0)}s?s.childrenLoading||(s.childrenLoading=!0):u.set(d,{error:void 0,children:[],childrenLoading:!0,childrenAvailable:!1,cache:od,totalCount:0,totalCountUnfiltered:0}),e.originalLazyGroupDataChangeDetect=qt()}typeof o=="function"&&(o=o(r));let l=typeof o=="object"&&typeof o.then=="function";return l&&(!t.lazyLoad||t.lazyLoad&&!a)&&(e.loading=!0),Promise.resolve(o).then(u=>{let d=[],s=!1;if(Array.isArray(u.data)){let f=u;if(d=f.data,f.livePaginationCursor!==void 0&&(e.livePaginationCursor=f.livePaginationCursor),f.mappings&&(e.pivotMappings=f.mappings),f.totalCountUnfiltered&&(e.unfilteredCount=f.totalCountUnfiltered),t.lazyLoad){let p=function(h,y,C){let b=[jn,...h],S=y.data,w={cache:y.cache??od,childrenLoading:!1,childrenAvailable:!0,totalCount:y.totalCount??S.length,totalCountUnfiltered:y.totalCount??S.length,children:S,error:y.error},T=[];if(r.lazyLoadBatchSize&&!C){let R=m.get(b),E=!R,N=ps({children:!0},R||{},w);E&&(N.chidren=[]),N.children.length=N.totalCount;let v=r.lazyLoadStartIndex??0,D=Math.min(y.totalCount??S.length,v+r.lazyLoadBatchSize);for(let M=v;M<D;M++){let A=w.children[M-v];if(!A)throw`lazily loaded item not found at index ${M-v}`;N.children[M]=A,A.dataset&&T.push({keys:A.keys,dataset:A.dataset})}E&&m.set(b,N)}else w.children.forEach(R=>{R&&R.dataset&&T.push({keys:R.keys,dataset:R.dataset})}),w.children.length=w.totalCount,m.set(b,w);let P=!1;if(!h||!h.length){let R=m.get([jn]);e.originalDataArray=[...R.children],P=!0}if(P||(e.originalLazyGroupDataChangeDetect=qt()),T.length){let R=h;T.forEach(({keys:E,dataset:N})=>{p(E,N,R)})}};var c=p;let m=t.originalLazyGroupData;s=!0,p(r.groupKeys||[],f)}}else d=u;s||(e.originalDataArray=a?t.originalDataArray.concat(d):d),l&&(!t.lazyLoad||t.lazyLoad&&!a)&&(e.loading=!1)})}function id(o,{filterTypes:t,filterMode:e}){return e==="local"?o:(sa(o,t)||[]).map(n=>{let i={...n};return delete i.valueGetter,i})}function rd(){let o;return(t,e,n)=>{if(o&&o.filterValue===t&&o.filterTypes===e&&o.filterMode===n)return o.result;let i=id(t,{filterTypes:e,filterMode:n});return o&&o.filterValue===t&&JSON.stringify(o.result)===JSON.stringify(i)&&(i=o.result),o={filterValue:t,filterTypes:e,filterMode:n,result:i},i}}var Rh=()=>new Promise(o=>{Ke(o)});function ua(o,t){let e=!!o,{stateReadyAsDetails:n}=t(),i=e&&o.shouldRestoreState?n:!0;return{isDetail:e,isDetailReady:i}}function ad(o){let{lazyLoad:t,lazyLoadBatchSize:e,lazyLoadCacheOfLoadedBatches:n}=o;return!!t&&!!e&&e>0&&n.has([0])}function ld(o,t){let{startIndex:e,endIndex:n,lazyLoadBatchSize:i,componentState:r,componentActions:a,dismissLoadedRows:l}=o,{dataArray:u}=r,d=l?()=>!1:h=>u[h].data!=null,s=!l,c=new $,f=["_______xxx______"];for(let h=e;h<=n;h++){let y=u[h];if(!y)continue;let C=d(h),b=y.dataSourceHasGrouping&&y.groupKeys?[...y.groupKeys]:[];y.isGroupRow&&y.dataSourceHasGrouping&&y.groupKeys&&b.pop();let S=b.length?b:f,w=y.dataSourceHasGrouping?y.indexInGroup:y.indexInAll;if(y.isGroupRow&&!y.collapsed&&!y.childrenAvailable){let T={lazyLoadStartIndex:0,lazyLoadBatchSize:i,groupKeys:y.groupKeys,append:s},P=y.groupKeys,R=c.get(P);if(!R?.[y.id]){let E=!R;R=R||{},R[y.id]||(R[y.id]=T),E&&c.set(P,R)}}if(!C&&i!=null){let T=c.get(S),P=Math.floor(w/i)*i,R=w-P,E=u[y.indexInAll-R].indexInAll,N=d(E),v=u[E].id;if(N||T?.[v])continue;let D=!T;T=T||{};let M={lazyLoadStartIndex:P,lazyLoadBatchSize:i,groupKeys:b,append:s};T[v]||(T[v]=M),D&&c.set(S,T)}}let m=Promise.resolve(!0),p=[];c.topDownValues().forEach(h=>{p.push(...Object.values(h))}),p.reduce((h,y)=>{let C=[...y.groupKeys,y.lazyLoadStartIndex];if(t&&t.has(C))return h;t?.set(C,!0);let b=[r.data,r,a,y];return h.then(()=>Rh()).then(()=>Yn(...b))},m)}var xh=Object.freeze([]),sd=(o,t)=>{let e=o??xh,n=Array.isArray(e)?e:[e];if(t&&t.has(e)){let i=t.get(e);if(i&&i.length===n.length)return i}return t&&e&&t.set(e,n),n};function Pi(o,t){if(o===t)return!0;if(o==null||t==null)return o===t;if(typeof o!=typeof t)return!1;if(Array.isArray(o)&&Array.isArray(t)){if(o.length!==t.length)return!1;for(let e=0,n=o.length;e<n;e++)if(!Pi(o[e],t[e]))return!1;return!0}if(typeof o=="object"){let e=Object.keys(o),n=Object.keys(t);if(e.length!==n.length)return!1;for(let i of e)if(!Object.prototype.hasOwnProperty.call(t,i)||!Pi(o[i],t[i]))return!1;return!0}return!1}function Ph(o,t){return!(o===void 0||t===void 0||o.isGroupRow!==t.isGroupRow||o.dataSourceHasGrouping!==t.dataSourceHasGrouping||o.isTreeNode!==t.isTreeNode||o.isTreeNode&&o.isParentNode!==t.isParentNode)}var Di={id:!0,value:!0,indexInAll:!0,rowSelected:!0,rowDisabled:!0,isCellSelected:!1,hasSelectedCells:!1},ud={...Di,dataSourceHasGrouping:!0,isTreeNode:!0,data:!1,isGroupRow:!0,selfLoaded:!0},Dh={indexInGroup:!0,groupKeys:!0,groupBy:!0,rootGroupBy:!0,parents:!1,indexInParentGroups:!0,groupCount:!0,groupNesting:!0,collapsed:!0,selfLoaded:!0},Ah={...Di,...Dh,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},dd={isTreeNode:!0,isParentNode:!0,indexInParent:!0,nodePath:!0,parentNodes:!1,indexInParentNodes:!0,totalLeafNodesCount:!0,collapsedLeafNodesCount:!0,treeNesting:!0,selfLoaded:!0},_h={...Di,...dd,dataSourceHasGrouping:!0,isTreeNode:!0,isGroupRow:!0,isParentNode:!0,data:!1},Mh={...Di,...dd,dataSourceHasGrouping:!0,isParentNode:!0,isGroupRow:!0,nodeExpanded:!0,selfExpanded:!0,data:!1,selectedLeafNodesCount:!0,deepRowInfoArray:!1,deselectedLeafNodesCount:!0,duplicateOf:!1},Eh=Object.entries(ud).map(([o,t])=>t?o:void 0).filter(Boolean),Fh=Object.entries(ud).map(([o,t])=>t?o:void 0),Nh=Object.entries(Ah).map(([o,t])=>t?o:void 0),Oh=Object.entries(_h).map(([o,t])=>t?o:void 0),kh=Object.entries(Mh).map(([o,t])=>t?o:void 0);function Lh(o,t){if(o===t)return!0;if(!o||!t||!Ph(o,t)||o.id!==t.id||o.data!==t.data&&!Pi(o.data,t.data))return!1;let e=[];o.dataSourceHasGrouping?e=o.isGroupRow?Nh:Fh:o.isTreeNode?e=o.isTreeNode&&o.isParentNode?kh:Oh:e=Eh;for(let n of e){let i=o[n],r=t[n];if(!(typeof i=="function"||typeof r=="function")&&!Pi(i,r))return!1}return!0}function cd(){let o=[],t=new Map,e=new Set,n={dataSourceState:void 0,previousDataSourceState:void 0},i=(f,m)=>{let p=o,h=m?.marker,C=f!==p&&e.size>0;C&&(n={dataSourceState:m?.dataSourceState,previousDataSourceState:m?.previousDataSourceState}),h&&h.start({details:[{name:"new dataArray length",value:f.length},{name:"old dataArray length",value:p.length}]});let b=[],S=l();for(let w of S){let T=p[w],P=f[w];if(P===void 0){b.push(w);continue}Lh(T,P)||b.push(w)}o=f,(b.length>0||C)&&queueMicrotask(()=>{for(let w=0,T=b.length;w<T;w++){let P=b[w],R=t.get(P);if(R)for(let E of R)E()}if(C)for(let w of Array.from(e))w()}),h&&h.end({details:[{name:"updated row infos",value:b.length}]})},r=f=>o[f],a=(f,m)=>{let p=t.get(f);return p||(p=new Set,t.set(f,p)),p.add(m),()=>{let h=t.get(f);h&&(h.delete(m),h.size===0&&t.delete(f))}},l=()=>Array.from(t.keys());return{notifyDataArray:i,getRowInfoAtIndex:r,subscribeToRowIndex:a,subscribeToDataArrayChange:f=>(e.add(f),()=>{e.delete(f),e.size===0&&(n={dataSourceState:void 0,previousDataSourceState:void 0})}),getDataSourceStates:()=>n,getDataArray:()=>o,clear:()=>{o=[],t.clear(),e.clear(),n={dataSourceState:void 0,previousDataSourceState:void 0}}}}var da=new Map,ca=new Map;var fa="DebugID=";function Xn(o,t){return t&&t.startsWith(fa)?t:t?`${fa}${o}:${t}`:`${fa}${o}`}var zh=Symbol("cursorId"),fd=o=>o.totalLeafNodesCount===0,Vh=o=>o.isParentNode?!fd(o):!0;function pd(o){let t=Date.now(),e=[],n=[],i=new $;return{logger:tn(`${o.debugId}:DataSource`),debugTimings:new Map,debugWarnings:new Map,devToolsDetected:!!globalThis.__INFINITE_TABLE_DEVTOOLS_HOOK__,rowInfoStore:cd(),indexer:new gi,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 $,waitForNodePathPromises:new $,getDataSourceMasterContextRef:{current:()=>{}},cache:void 0,detailDataSourcesStateToRestore:new Map,stateReadyAsDetails:!1,originalDataArrayChanged:!1,originalDataArrayChangedInfo:{timestamp:0,mutations:void 0},rowsPerPage:null,lazyLoadCacheOfLoadedBatches:new $,dataParams:void 0,onCleanup:he(),notifyScrollbarsChange:he(),notifyScrollStop:he(),notifyRenderRangeChange:he(),pivotTotalColumnPosition:"end",pivotGrandTotalColumnPosition:!1,scrollStopDelayUpdatedByTable:100,originalLazyGroupData:i,originalLazyGroupDataChangeDetect:0,originalDataArray:e,cursorId:zh,showSeparatePivotColumnForSingleAggregation:!1,propsCache:new Map([["sortInfo",new WeakMap],["rowDisabledState",new WeakMap]]),rowInfoReducerResults:void 0,pivotMappings:void 0,pivotColumns:void 0,pivotColumnGroups:void 0,dataArray:n,unfilteredCount:n.length,filteredCount:n.length,updatedAt:t,groupedAt:0,sortedAt:0,treeAt:0,filteredAt:0,reducedAt:t,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 Gh(o){let t={...o};return delete t.originalDataArray,t}var Kh=[],md=o=>{o.destroyedRef.current=!0,o.__apiRef.current=null,o.lastSelectionUpdatedNodePathRef.current=null,o.lastExpandStateInfoRef.current={state:"collapsed",nodePath:null},o.treeExpandState?.destroy(),o.treePaths?.clear(),o.unfilteredTreePaths?.clear(),o.waitForNodePathPromises.clear(),o.pathToIndexMap?.clear(),o.rowDisabledState?.destroy(),o.groupRowsState?.destroy(),o.treeSelectionState?.destroy(),o.idToPathMap.clear(),o.idToIndexMap.clear(),o.rowInfoStore.clear()},hd=(o,t)=>({onDataParamsChange:e=>e?Il(e,100,Gh):void 0,lazyLoad:e=>!!e,isNodeReadOnly:e=>e??fd,isNodeSelectable:e=>e??Vh,data:1,nodesKey:1,isNodeExpanded:1,isNodeCollapsed:1,pivotBy:1,primaryKey:1,livePagination:1,treeSelection:1,refetchKey:e=>e??"",filterFunction:1,treeFilterFunction:1,filterValue:1,useGroupKeysForMultiRowSelection:e=>e??!1,filterDelay:e=>e??200,filterTypes:e=>({...On,...e}),sortTypes:e=>({...on,...e}),sortFunction:1,onReady:1,rowInfoReducers:(e,n)=>{let i={initialValue:()=>{n.idToIndexMap.clear()},reducer:(a,l)=>{t.debugId&&!t.nodesKey&&n.idToIndexMap.has(l.id)&&console.warn(`Duplicate id found in data source: ${l.id}`),n.idToIndexMap.set(l.id,l.indexInAll)}},r=e?{...e,__idToIndex:i}:{__idToIndex:i};if(t.nodesKey){let a={initialValue:()=>{n.idToPathMap.clear(),n.pathToIndexMap.clear()},reducer:(l,u)=>{u.isTreeNode&&(n.idToPathMap.set(u.id,u.nodePath),t.debugId&&n.pathToIndexMap.has(u.nodePath)&&console.warn(`Duplicate node path found in data source (debugId: ${t.debugId||"none"}): ${u.nodePath}`),n.pathToIndexMap.set(u.nodePath,u.indexInAll))}};r.__pathToIndex=a}return r},onNodeCollapse:1,onNodeExpand:1,batchOperationDelay:1,isRowSelected:1,isNodeSelected:1,isRowDisabled:1,rowDisabledState:e=>{if(!e)return null;if(e instanceof wt)return e;let n=o.propsCache.get("rowDisabledState")??xt,i=n.get(e);return i||(i=new wt(e),n.set(e,i)),e=i,e??null},onDataArrayChange:1,onDataMutations:1,onTreeDataMutations:1,aggregationReducers:1,collapseGroupRowsOnDataFunctionChange:e=>e??!0,loading:e=>e??!1,sortInfo:e=>sd(e,o.propsCache.get("sortInfo")),groupBy:e=>e??Kh});function Bh(o,t){return typeof o=="function"?o({array:t.originalDataArray,length:t.originalDataArray.length,lastItem:t.originalDataArray[t.originalDataArray.length-1]}):o}var xt=new WeakMap;function Hh(o){if(typeof o=="boolean")return{filterValue:o,sortInfo:o,groupBy:o,pivotBy:o};let t={};return o.filterValue!=null&&(t.filterValue=o.filterValue),o.sortInfo!=null&&(t.sortInfo=o.sortInfo),o.groupBy!=null&&(t.groupBy=o.groupBy),o.pivotBy!=null&&(t.pivotBy=o.pivotBy),t}var Wh={selectedPaths:[],deselectedPaths:[],defaultSelection:!1};function nd(o,t,e){if(t!="multi-row")throw new Error(`TreeSelectionState is only supported for multi-row selection. Your current selection mode is "${t}". See https://infinite-table.com/docs/reference/datasource-props#selectionMode for details.
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
`);let n
|
|
16
|
+
`);let n=$n(e);if(o instanceof Qe)return o.setConfig(n),o;(o==null||typeof o!="object")&&(o=void 0);let i=o??Wh,r=xt.get(i);return r&&r.setConfig(n),r=r??new Qe(i,n),xt.set(i,r),r}function gd(o){let{props:t,state:e,oldState:n}=o,i=!!e.nodesKey,r=mo(t.sortInfo),a=mo(t.filterValue),{filterTypes:l}=e,u=Object.keys(l).reduce((x,F)=>{let _=l[F].operators;x[F]=x[F]||{};let O=x[F];return _.forEach(L=>{O[L.name]=L}),x},{}),d=t,s=t.selectionMode;if(s===void 0)if(t.cellSelection!==void 0||t.defaultCellSelection!==void 0)s="multi-cell";else{let x=t.rowSelection!==void 0?t.rowSelection:t.defaultRowSelection;if(x!==void 0&&(x&&typeof x=="object"?s="multi-row":s="single-row"),!s){let F=d.treeSelection??d.defaultTreeSelection;F!==void 0&&(s=typeof F=="object"?"multi-row":"single-row")}s=s??!1}let c=null,f=null,m=t.rowSelection!==void 0?t.rowSelection:e.rowSelection===void 0?t.defaultRowSelection!==void 0?t.defaultRowSelection:null:e.rowSelection,p=t.cellSelection!==void 0?t.cellSelection:e.cellSelection===void 0?t.defaultCellSelection!==void 0?t.defaultCellSelection:null:e.cellSelection||null;if(!i&&(s!==!1&&(s==="single-row"||s==="multi-row")&&(m===null?c=s==="single-row"?null:new _e({selectedRows:[],deselectedRows:[],defaultSelection:!1},at(e)):s==="single-row"||m instanceof _e?c=m:c=new _e(m,at(e))),s==="single-cell"||s==="multi-cell"))if(p===null)f=s==="single-cell"?null:new Be;else if(p instanceof Be)f=p;else{let x=xt.get(p)??new Be(p);xt.set(p,x),f=x}let h=e.primaryKey,y=typeof h=="function"?x=>h(x):x=>x[h],C=d.treeExpandState||e.treeExpandState||d.defaultTreeExpandState;if(C&&!(C instanceof nt)){let x=xt.get(C)??new nt(C);xt.set(C,x),C=x}C=C||new nt({defaultExpanded:!0,collapsedPaths:[]});let b=t.groupRowsState||e.groupRowsState||t.defaultGroupRowsState;if(b&&!(b instanceof St)){let x=xt.get(b)??new St(b);xt.set(b,x),b=x}b=b||new St(e.lazyLoad?{expandedRows:[],collapsedRows:!0}:{expandedRows:!0,collapsedRows:[]});let S=Hh(t.shouldReloadData||{}),w=t.groupMode??(S.groupBy!=null?S.groupBy?"remote":"local":void 0),T=t.sortMode??S.sortInfo!=null?S.sortInfo?"remote":"local":void 0,P=t.filterMode??S.filterValue!=null?S.filterValue?"remote":"local":void 0;t.groupMode&&Mn('"groupMode" prop is deprecated for the <DataSource />, use "shouldReloadData.groupBy: true|false" instead',"groupMode deprecated",e.logger),t.sortMode&&Mn('"sortMode" prop is deprecated for the <DataSource />, use "shouldReloadData.sortInfo: true|false" instead',"sortMode deprecated",e.logger),t.filterMode&&Mn('"filterMode" prop is deprecated for the <DataSource />, use "shouldReloadData.filterValue: true|false" instead',"filterMode deprecated",e.logger);let R=typeof t.data=="function"?w??"local":"local",E=t.sortFunction?"local":T??(r?"remote":"local"),N=typeof t.filterFunction=="function"||typeof t.treeFilterFunction=="function"?"local":P??(typeof t.data=="function"?"remote":"local"),v=S.pivotBy?"remote":"local",D=e.rowDisabledState,M=t.isRowDisabled;if(!M&&D){let x=xt.get(D);x?M=x:(M=F=>D.isRowDisabled(F.id),xt.set(D,M))}let A={debugId:e.debugId??t.debugId,isTree:i,selectionMode:s,groupRowsState:b,treeExpandState:C,treeExpandMode:C.mode,shouldReloadData:{filterValue:S?.filterValue??N==="remote",sortInfo:S?.sortInfo??E==="remote",groupBy:S?.groupBy??R==="remote",pivotBy:S?.pivotBy??v==="remote"},isRowDisabled:M,rowSelection:c,cellSelection:f,groupMode:R,sortMode:E,filterMode:N,pivotMode:v,toPrimaryKey:y,operatorsByFilterType:u,controlledSort:r,controlledFilter:a,multiSort:Array.isArray(r?t.sortInfo:t.defaultSortInfo),lazyLoadBatchSize:typeof t.lazyLoad=="object"?t.lazyLoad.batchSize:void 0};if(t.livePagination){let x=!n||n.originalDataArray!==e.originalDataArray,F=typeof t.livePaginationCursor=="function"?x?Bh(t.livePaginationCursor,e):e.livePaginationCursor:t.livePaginationCursor;A.livePaginationCursor=F}if(e.devToolsDetected&&e.debugId){let x=ca.get(e.debugId);x&&(A={...A,...x})}return A}var jh=tn("DataSource:fullLazyLoad");function yd(o,t,e){let{name:n,newValue:i}=o;n==="data"&&typeof i=="function"&&!t.groupRowsState&&(t.lazyLoad&&jh('"data" function prop has changed'),t.collapseGroupRowsOnDataFunctionChange!==!1&&(e.groupRowsState=new St({collapsedRows:!0,expandedRows:[]})))}function bd(){return{rowSelection:(o,t)=>t.selectionMode==="single-row"?{callbackParams:[o,"single-row"]}:{callbackParams:[o.getState(),"multi-row"]},treeSelection:(o,t)=>{if(t.selectionMode==="single-row")return{callbackParams:[o,{selectionMode:"single-row"}]};let e=t.__apiRef.current,n=e.treeApi;return{callbackParams:[o.getState(),{treeSelectionState:o,prevTreeSelectionState:t.treeSelectionState,selectionMode:"multi-row",lastUpdatedNodeInfo:t.lastSelectionUpdatedNodePathRef.current,unfilteredTreePaths:t.unfilteredTreePaths,dataSourceApi:e,treeApi:n}]}},treeExpandState:(o,t)=>({callbackParams:[o.getState(),{nodeState:t.lastExpandStateInfoRef.current.state,nodePath:t.lastExpandStateInfoRef.current.nodePath,dataSourceApi:t.__apiRef.current}]}),cellSelection:(o,t)=>t.selectionMode==="single-cell"?{callbackParams:[o instanceof Be?o.getState().selectedCells:null,"single-cell"]}:{callbackParams:[o.getState(),"multi-cell"]}}}function Cd(){return{sortInfo:(o,{actions:t,state:e})=>{let n=e.getDataSourceMasterContextRef.current,i=Gt(e,{sortInfo:o,livePaginationCursor:null},n());t.dataParams=i,e.livePagination&&Ke(()=>{t.livePaginationCursor=null})},groupBy:(o,{actions:t,state:e})=>{let n=e.getDataSourceMasterContextRef.current,i=Gt(e,{groupBy:o,livePaginationCursor:null},n());t.dataParams=i,e.livePagination&&Ke(()=>{t.livePaginationCursor=null})},pivotBy:(o,{actions:t,state:e})=>{let n=e.getDataSourceMasterContextRef.current,i=Gt(e,{pivotBy:o,livePaginationCursor:null},n());t.dataParams=i,e.livePagination&&Ke(()=>{t.livePaginationCursor=null})},filterValue:(o,{actions:t,state:e})=>{let n=e.getDataSourceMasterContextRef.current,i=Gt(e,{filterValue:o,livePaginationCursor:null},n());t.dataParams=i,e.livePagination&&Ke(()=>{t.livePaginationCursor=null})},cursorId:(o,{actions:t,state:e})=>{let n=e.getDataSourceMasterContextRef.current,i=Gt(e,{__cursorId:o},n());t.dataParams=i},livePaginationCursor:(o,{actions:t,state:e})=>{let n=e.getDataSourceMasterContextRef.current,i=Gt(e,{livePaginationCursor:o},n());t.dataParams=i},dataParams:(o,{state:t})=>rn(o,t.dataParams,new Set(["changes","originalDataArray","masterRowInfo"]))?!1:(tn(Xn(t.debugId,"DataSource:dataParams"))("onDataParamsChange triggered because the following values have changed",o?.changes),!0)}}function Td(o){return{originalDataArray:o.originalDataArray,groupRowsState:o.groupRowsState,groupBy:o.groupBy,pivotBy:o.pivotBy,sortInfo:o.sortInfo,filterValue:o.filterValue,livePaginationCursor:o.livePaginationCursor}}function $h(o,t,e){return t=t.replaceAll("$ERR_CODE",o),t=`${t}
|
|
17
17
|
|
|
18
18
|
ERROR_CODE = ${o}
|
|
19
19
|
|
|
20
|
-
See http://infinite-table.com/docs/reference/error-codes#${o} for more info.`,{code:o,message:t,type:e??"error"}}function
|
|
21
|
-
Make sure you don't pass a new reference on every render.`}),
|
|
20
|
+
See http://infinite-table.com/docs/reference/error-codes#${o} for more info.`,{code:o,message:t,type:e??"error"}}function Sd(o){return Object.entries(o).reduce((t,[e,n])=>{let i=e,r=$h(i,typeof n=="string"?n:n.message,typeof n=="string"?void 0:n.type);return t[i]=r,t},{})}function Uh(o){return{message:o.join(""),type:"warning"}}function qh(o){return{message:o.join(""),type:"error"}}var Yh=Sd({DS001:Uh`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.`}),Xh=Sd({CSS001_CSS:qh`It appears you have not loaded the CSS file for InfiniteTable.
|
|
22
22
|
In most environments, you should be able to fix this by adding the following line:
|
|
23
23
|
|
|
24
24
|
import '@infinite-table/infinite-react/index.css'
|
|
25
|
-
`}),
|
|
25
|
+
`}),wd={...Yh,...Xh};var vd=new Map;var Zh=o=>{let t=o.type==="error"?nn(o.debugId):tn(o.debugId),e=o.type==="error"?wl:Mn,n=o.debugId?`${o.code}-${o.debugId}`:o.code,i=o.message;o.debugId&&(i=`${i}
|
|
26
26
|
|
|
27
|
-
Component DEBUG_ID = "${o.debugId}"`),e(i,n,t)},sa=o=>{let{debugId:t,key:e}=o,n=ld[e];if(n&&(wh({...n,debugId:t}),t&&e)){let i=sd.get(t);i&&i.getState().devToolsDetected&&n&&(i.getState().debugWarnings.set(e,{...n,debugId:t,status:"new"}),vh(t))}};globalThis.logDevToolsWarning=sa;var vh=o=>{let t=window.__INFINITE_TABLE_DEVTOOLS_HOOK__;if(!t)return;let e=sd.get(o);e&&t(o,e)};var Ii=require("vue"),ud=Symbol("DataSourceMasterDetail");function dd(o){(0,Ii.provide)(ud,o)}var Ih=()=>{};function Ri(){return(0,Ii.inject)(ud,Ih)}var ua=["debugId","primaryKey","fields","refetchKey","batchOperationDelay","rowInfoReducers","data","selectionMode","useGroupKeysForMultiRowSelection","rowSelection","defaultRowSelection","onRowSelectionChange","cellSelection","defaultCellSelection","onCellSelectionChange","rowDisabledState","defaultRowDisabledState","onRowDisabledStateChange","isRowDisabled","isRowSelected","lazyLoad","loading","defaultLoading","onLoadingChange","onReady","pivotBy","defaultPivotBy","onPivotByChange","aggregationReducers","defaultAggregationReducers","groupBy","defaultGroupBy","onGroupByChange","groupRowsState","defaultGroupRowsState","onGroupRowsStateChange","collapseGroupRowsOnDataFunctionChange","sortFunction","sortInfo","defaultSortInfo","onSortInfoChange","onDataParamsChange","onDataArrayChange","onDataMutations","livePagination","livePaginationCursor","onLivePaginationCursorChange","filterFunction","treeFilterFunction","sortMode","filterMode","groupMode","shouldReloadData","filterValue","defaultFilterValue","onFilterValueChange","filterDelay","filterTypes","sortTypes","multiSort","nodesKey","isNodeExpanded","isNodeCollapsed","isNodeReadOnly","isNodeSelectable","isNodeSelected","treeSelection","defaultTreeSelection","onTreeSelectionChange","onTreeDataMutations","onNodeCollapse","onNodeExpand","treeExpandState","defaultTreeExpandState","onTreeExpandStateChange"],Un=Symbol("DataSource");function qn(){return(0,ke.inject)(Un)}var{useManagedComponent:Rh}=xn({debugName:"DataSource",initSetupState:Ju,forwardProps:ed,concludeReducer:Bu,mapPropsToState:td,onPropChange:nd,cleanup:Qu,interceptActions:id(),mappedCallbacks:od()});function xi(o,t){let e={},n=!0,i=r=>{let a={},l={};for(let u in r)r.hasOwnProperty(u)&&(n||r[u]!==e[u])&&(a[u]=r[u],l[u]=e[u]);e=r,n=!1,Object.keys(a).length!==0&&t(a,l)};(0,ke.onMounted)(()=>i(o())),(0,ke.watch)(o,i,{flush:"post"})}function xh(o){let{state:t,getDataSourceState:e,dataSourceActions:n}=o;xi(()=>({data:t.value.data,dataParams:t.value.dataParams}),()=>{n.lazyLoadCacheOfLoadedBatches=new $});let i=null,r=(s,d,c=e().lazyLoadCacheOfLoadedBatches)=>{let f=e();if(s=s||i,!s)return;let{renderStartIndex:m,renderEndIndex:p}=s,{lazyLoadBatchSize:h,lazyLoad:g}=f;g&&((!h||h<=0)&&(!f.groupBy||f.groupBy.length===0)||$u({startIndex:m,endIndex:p,lazyLoadBatchSize:h,componentState:f,componentActions:n,dismissLoadedRows:d?.dismissLoadedRows??!1},c))},a=null,l=()=>{let s=e().scrollStopDelayUpdatedByTable;return(!a||a.wait!==s)&&(a={wait:s,fn:Jt(r,{wait:s})}),a.fn},u=null;xi(()=>{let s=t.value;return{sortInfo:s.sortInfo,filterValue:s.filterValue,groupBy:s.groupBy,pivotBy:s.pivotBy,refetchKey:s.refetchKey,cursorId:s.livePagination?s.cursorId:null,lazyLoadBatchSize:s.lazyLoadBatchSize,lazyLoad:s.lazyLoad,originalLazyGroupDataChangeDetect:s.originalLazyGroupDataChangeDetect,groupRowsState:s.groupRowsState}},s=>{u?.(),u=null;let{lazyLoad:d,notifyRenderRangeChange:c}=e();d&&(s.sortInfo||s.filterValue||s.groupBy||s.pivotBy||s.refetchKey||s.cursorId?(e().lazyLoadCacheOfLoadedBatches.clear(),e().originalLazyGroupData.clear(),r(c.get(),{dismissLoadedRows:!0})):(s.originalLazyGroupDataChangeDetect||s.groupRowsState)&&r(c.get()),u=c.onChange(f=>{i=f,r(f)}))}),(0,ke.watch)(()=>t.value.dataArray,()=>{let{lazyLoadBatchSize:s}=e();s&&s>0&&l()()},{flush:"post"}),(0,ke.onBeforeUnmount)(()=>{u?.(),u=null})}function Ph(o){let{state:t,getDataSourceState:e,dataSourceActions:n}=o,i=()=>t.value.getDataSourceMasterContextRef.current?.()??void 0,r=(0,ke.shallowRef)({vertical:!1,horizontal:!1}),a=t.value.notifyScrollbarsChange.onChange(p=>{p&&(r.value=p)});(0,ke.onBeforeUnmount)(()=>{a()});let l=null;(0,ke.watch)(()=>t.value.livePaginationCursor,p=>{t.value.livePagination&&(l!=null&&cancelAnimationFrame(l),l=requestAnimationFrame(()=>{l=null,r.value?.vertical||p&&(n.cursorId=p)}))},{flush:"post"});let u=null;(0,ke.watch)(()=>[t.value.dataArray.length,t.value.livePaginationCursor],()=>{let{livePagination:p,livePaginationCursor:h,cursorId:g,dataArray:b}=t.value;!p||h!==void 0||(u!=null&&cancelAnimationFrame(u),u=requestAnimationFrame(()=>{u=null,r.value?.vertical||g!=null&&b.length&&(n.cursorId=b.length)}))},{flush:"post"}),(0,ke.watch)(()=>r.value.vertical,p=>{let{livePaginationCursor:h,livePagination:g,dataArray:b}=e();!p&&g&&(h?n.cursorId=h:h===void 0&&b.length&&(n.cursorId=b.length))},{flush:"post"}),(0,ke.onBeforeUnmount)(()=>{l!=null&&cancelAnimationFrame(l),u!=null&&cancelAnimationFrame(u)});let s=[],d=null,c=()=>{let{filterValue:p,filterMode:h,filterTypes:g}=t.value,b=[p,h,g];return(b.length!==s.length||b.some((C,T)=>C!==s[T]))&&(s=b,d=oa(p,{filterTypes:g,filterMode:h})),d},f=()=>{let{shouldReloadData:p,sortInfo:h,groupBy:g,pivotBy:b,refetchKey:C,livePagination:T,cursorId:v}=t.value;return{sortInfo:p.sortInfo?h:null,groupBy:p.groupBy?g:null,pivotBy:p.pivotBy?b:null,refetchKey:C,filterValue:p.filterValue?c():null,cursorId:T?v:null}};xh({state:t,getDataSourceState:e,dataSourceActions:n});let m=[];xi(()=>({data:t.value.data}),()=>{let p=e(),h=i(),{isDetail:g,isDetailReady:b}=ia(h,e);if(g&&!b)return;let C=Date.now();m.length>=10&&m.splice(0,1),m.push(C),C-m[0]<200&&m.length>=10&&sa({debugId:p.debugId,key:"DS001"}),typeof p.data!="function"&&jn(p.data,p,n,void 0,h)}),xi(()=>({...f(),data:t.value.data}),p=>{let h=Object.keys(p),g=!1;if(h.length===1){if(g=!!p.cursorId,p.filterValue&&e().filterMode==="local")return;let S=e().data;if(Array.isArray(S)&&p.refetchKey){n.originalDataArray=S;return}}let b=i(),{isDetail:C,isDetailReady:T}=ia(b,e);if(C&&!T)return;let v=e();typeof v.data=="function"&&jn(v.data,v,n,{append:g},b)}),(0,ke.onMounted)(()=>{let p=e(),h=Vt(p,void 0,i());n.dataParams=h})}function Dh(o){let t=Ri(),e=!!t(),{contextValue:n}=Rh(o),i=n.state,r=n.componentActions,a=n.getComponentState;i.value.getDataSourceMasterContextRef.current=t;let l=Gu({getState:a,actions:r}),u={state:i,getDataSourceState:a,dataSourceActions:r,dataSourceApi:l,assignState:n.assignState};return(0,ke.provide)(Un,u),(0,ke.onMounted)(()=>{let s=t();if(s){let d={dataSourceState:i.value,dataSourceActions:r,getDataSourceMasterContext:t,getDataSourceState:a,assignState:u.assignState,dataSourceApi:l};s.registerDetail(d)}}),Ph({state:i,getDataSourceState:a,dataSourceActions:r}),(0,ke.watch)(()=>i.value.originalDataArrayChangedInfo,()=>{let s=i.value;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})},{flush:"post"}),(0,ke.onMounted)(()=>{i.value.onReady?.(l)}),(0,ke.onBeforeUnmount)(()=>{let s=a();s.onCleanup(s)}),u}var Pi=(0,ke.defineComponent)({name:"DataSource",props:[...ua],setup(o,{slots:t}){let e=Dh(o);return()=>t.default?.(e.state.value)??null}});var Z=require("vue");var cd=require("vue");function $t(o,t,e){let n=null,i;return(0,cd.computed)(()=>{let r=o();return(n===null||r.length!==n.length||r.some((a,l)=>!Object.is(a,n[l])))&&(i=t()),n=r,i})}var Yn=(o,t,e={debounce:0})=>{let n=e.debounce??0,i=window.ResizeObserver,r=n?Jt(t,{wait:n}):t,a=new i(l=>{let u=l[0],{width:s,height:d}=u.contentRect;if(u.borderBoxSize?.[0])d=u.borderBoxSize[0].blockSize,s=u.borderBoxSize[0].inlineSize;else{let c=o.getBoundingClientRect();d=c.height,s=c.width}r({width:s,height:d})});return a.observe(o),()=>{a.disconnect()}};var Ai=class Ai{constructor(t,e){this.keysInOrder=[];if(typeof t=="number")this.maxSize=t,this.currentMap=new Map;else if(this.maxSize=e??Ai.DEFAULT_SIZE,t){let n=Array.from(t);this.maxSize<n.length&&n.slice(n.length-this.maxSize),this.currentMap=new Map,n.forEach(([i,r])=>{this.set(i,r)})}else this.currentMap=new Map}values(){return this.currentMap.values()}get size(){return this.currentMap.size}delete(t){return this.currentMap.has(t)?(this.currentMap.delete(t),this.keysInOrder=this.keysInOrder.filter(e=>e!==t),!0):!1}has(t){return this.currentMap.has(t)}get(t){return this.currentMap.get(t)}set(t,e){if(this.has(t)&&this.delete(t),this.maxSize-this.currentMap.size<=0){let[i]=this.keysInOrder.splice(0,1);i!=null&&this.currentMap.delete(i)}return this.keysInOrder.push(t),this.currentMap.set(t,e),this}};Ai.DEFAULT_SIZE=10;var Di=Ai;var da=class{add(t,e){}get(t){}delete(t){}has(t){return!1}},_i=class{constructor(t){this.storage=new Di(t)}add(t,e){this.storage.set(t,e)}get(t){return this.storage.get(t)}delete(t){this.storage.delete(t)}has(t){return this.storage.has(t)}},ca=class{constructor(){this.storage=new Map}add(t,e){this.storage.set(t,e)}get(t){return this.storage.get(t)}delete(t){this.storage.delete(t)}has(t){return this.storage.has(t)}},Mi=class{constructor(t){this.cacheStorage=t===!1?new da:t===!0?new ca:typeof t=="number"?new _i(t):new _i(5)}add(t,e){this.cacheStorage.add(t,e)}get(t){return this.cacheStorage.get(t)}delete(t){this.cacheStorage.delete(t)}has(t){return this.cacheStorage.has(t)}};var yt=class extends Bn{constructor(e){super(e);this.isRowDetailsExpanded=e=>!!this.isItemPositive(e)}getState(){let e=this.allPositive?!0:[...this.positiveMap?.keys()??[]],n=this.allNegative?!0:[...this.negativeMap?.keys()??[]];return{expandedRows:e,collapsedRows:n}}getPositiveFromState(e){return e.expandedRows}getNegativeFromState(e){return e.collapsedRows}areAllCollapsed(){return this.areAllNegative()}areAllExpanded(){return this.areAllPositive()}collapseAll(){this.makeAllNegative()}expandAll(){this.makeAllPositive()}isRowDetailsCollapsed(e){return!this.isRowDetailsExpanded(e)}setRowDetailsExpanded(e,n){return this.setItemValue(e,n)}collapseRowDetails(e){this.setRowDetailsExpanded(e,!1)}expandRowDetails(e){this.setRowDetailsExpanded(e,!0)}toggleRowDetails(e){this.toggleItem(e)}};var fd=uo(kn());var fa=(o,t)=>o-t,Ut={horizontal:!0,vertical:!0};function Ei(o,t){let e=t.length;if(!e)return 0;let n=-1;for(let i=0;i<e;i++){let r=0,a=0;if(e-i<=n)break;for(let l=i;l<e;l++)if(r+=t[l],a++,r>o){a>n&&(n=a);break}}return n<0?e:Math.min(n,e)}var Fi={start:0,end:0},pa=o=>{o()},ma=o=>{let{start:t,end:e}=o,[n,i]=t,[r,a]=e,l=r-n,u=a-i;return l*u},pd=o=>{let{start:t,end:e}=o,[n]=t,[i]=e;return i-n},_o=typeof window<"u"?requestAnimationFrame:o=>setTimeout(o,0);function Ah(o){return o.horizontalChange||o.verticalChange}var Tn=class extends ct{constructor(e){let n=$n(e,`${e}:MatrixBrain`);super(n);this.scrolling=!1;this.RENDER_COUNT_SAFETY_MARGIN_START=1;this.RENDER_COUNT_SAFETY_MARGIN_END=1;this.availableWidth=0;this.availableRenderWidth=0;this.isHorizontalLayoutBrain=!1;this.name="";this.availableHeight=0;this.availableRenderHeight=0;this.cols=0;this.rows=0;this.alwaysRenderedColumns=new Set;this._rowsPerPage=0;this.rowHeight=0;this.colWidth=0;this.verticalTotalSize=0;this.horizontalTotalSize=0;this.horizontalRenderCount=void 0;this.verticalRenderCount=void 0;this.maxHorizontalRenderCount=0;this.maxVerticalRenderCount=0;this.horizontalExtendRangeBy=Fi;this.verticalExtendRangeBy=Fi;this.horizontalRenderRange={startIndex:0,endIndex:0};this.verticalRenderRange={startIndex:0,endIndex:0};this.extraSpanCells=[];this.scrollPosition={scrollLeft:0,scrollTop:0};this.onScrollFns=[];this.onRenderRangeChangeFns=new Set;this.onVerticalRenderRangeChangeFns=new Set;this.onHorizontalRenderRangeChangeFns=new Set;this.onDestroyFns=[];this.destroyed=!1;this.onRenderCountChangeFns=new Set;this.onAvailableSizeChangeFns=new Set;this.onScrollStartFns=[];this.onScrollStopFns=[];this.scrollTimeoutId=0;this.scrollStopDelay=250;this.fixedColsStart=0;this.fixedColsEnd=0;this.fixedRowsStart=0;this.fixedRowsEnd=0;this.setScrollStopDelay=e=>{this.scrollStopDelay=e};this.getRowCount=()=>this.rows;this.getColCount=()=>this.cols;this.setScrolling=e=>{let n=this.scrolling;this.scrolling=e,e&&(this.scrollTimeoutId&&clearTimeout(this.scrollTimeoutId),this.scrollTimeoutId=setTimeout(()=>{this.setScrolling(!1),this.scrollTimeoutId=0},this.scrollStopDelay)),e!==n&&(e?this.notifyScrollStart():this.notifyScrollStop())};this.notifyScrollStart=()=>{if(this.destroyed)return;let e=this.onScrollStartFns;for(let n=0,i=e.length;n<i;n++)e[n]()};this.notifyScrollStop=()=>{if(this.destroyed)return;let e=this.onScrollStopFns,n=this.scrollPosition,i=this.getRenderRange();for(let r=0,a=e.length;r<a;r++)e[r](n,i)};this.notifyAvailableSizeChange=()=>{if(this.destroyed)return;let e=this.onAvailableSizeChangeFns,n=this.getAvailableSize();e.forEach(i=>{_o(()=>{this.destroyed||e.has(i)&&i(n)})})};this.notifyVerticalRenderRangeChange=(e=!1)=>{if(this.destroyed)return;let n=this.onVerticalRenderRangeChangeFns,i=this.verticalRenderRange,r=e?pa:_o;n.forEach(a=>{r(()=>{this.destroyed||n.has(a)&&a([i.startIndex,i.endIndex])})})};this.notifyHorizontalRenderRangeChange=(e=!1)=>{if(this.destroyed)return;let n=this.onHorizontalRenderRangeChangeFns,i=this.horizontalRenderRange,r=e?pa:_o;n.forEach(a=>{r(()=>{this.destroyed||n.has(a)&&a([i.startIndex,i.endIndex])})})};this.isColFixedEnd=e=>this.fixedColsEnd?e>=this.cols-this.fixedColsEnd:!1;this.isColFixedStart=e=>this.fixedColsStart?e<this.fixedColsStart:!1;this.isRowFixedEnd=e=>this.fixedRowsEnd?e>=this.rows-this.fixedRowsEnd:!1;this.isRowFixedStart=e=>this.fixedRowsStart?e<this.fixedRowsStart:!1;this.isColFixed=e=>this.isColFixedStart(e)||this.isColFixedEnd(e);this.isRowFixed=e=>this.isRowFixedStart(e)||this.isRowFixedEnd(e);this.getFixedEndColsWidth=()=>{if(!this.fixedColsEnd)return 0;let e=0;for(let n=this.cols-this.fixedColsEnd;n<this.cols;n++)e+=this.getColWidth(n);return e};this.getFixedEndColsOffsets=({skipScroll:e}={skipScroll:!1})=>{if(!this.fixedColsEnd)return[];let{scrollLeft:n}=this.scrollPosition,{width:i}=this.getAvailableSize(),r=[],a=[],l=0;for(let d=this.cols-this.fixedColsEnd;d<this.cols;d++){let c=this.getColWidth(d);a.push(c),l+=c}let u=i-l+(e?0:n);l=0;let s=0;for(let d=this.cols-this.fixedColsEnd;d<this.cols;d++){let c=u+l;r[d]=c,l+=a[s],s++}return r};this.getFixedEndRowsOffsets=({skipScroll:e}={skipScroll:!1})=>{if(!this.fixedRowsEnd)return[];let{scrollTop:n}=this.scrollPosition,{height:i}=this.getAvailableSize(),r=[],a=[],l=0;for(let d=this.rows-this.fixedRowsEnd;d<this.rows;d++){let c=this.getRowHeight(d);a.push(c),l+=c}let u=i-l+(e?0:n);l=0;let s=0;for(let d=this.rows-this.fixedRowsEnd;d<this.rows;d++){let c=u+l;r[d]=c,l+=a[s],s++}return r};this.getFixedStartColsWidth=()=>{if(!this.fixedColsStart)return 0;let e=0;for(let n=0;n<this.fixedColsStart;n++)e+=this.getColWidth(n);return e};this.getFixedEndRowsHeight=()=>{if(!this.fixedRowsEnd)return 0;let e=0;for(let n=this.rows-this.fixedRowsEnd;n<this.rows;n++)e+=this.getRowHeight(n);return e};this.getFixedStartRowsHeight=()=>{if(!this.fixedRowsStart)return 0;let e=0;for(let n=0;n<this.fixedRowsStart;n++)e+=this.getRowHeight(n);return e};this.computeRenderCount=(e=Ut)=>{let n=e.horizontal,i=e.vertical,r=this.horizontalRenderCount||0,a=this.verticalRenderCount||0;return n&&(r=this.computeDirectionalRenderCount("horizontal",this.colWidth,this.cols,this.getAvailableRenderSize())),i&&(a=this.computeDirectionalRenderCount("vertical",this.rowHeight,this.rows,this.getAvailableRenderSize())),{horizontal:r,vertical:a}};this.setRenderCount=({horizontal:e,vertical:n})=>{e===void 0&&(e=this.horizontalRenderCount),n===void 0&&(n=this.verticalRenderCount);let i=e===this.horizontalRenderCount,r=n===this.verticalRenderCount;i&&r||(this.horizontalRenderCount=e,this.verticalRenderCount=n,this.updateRenderRange({horizontal:!i,vertical:!r}),this.notifyRenderCountChange())};this.updateFixedCells=e=>{e.fixedColsStart!=this.fixedColsStart&&(this.fixedColsStart=e.fixedColsStart||0),e.fixedColsEnd!=this.fixedColsEnd&&(this.fixedColsEnd=e.fixedColsEnd||0),e.fixedRowsStart!=this.fixedRowsStart&&(this.fixedRowsStart=e.fixedRowsStart||0),e.fixedRowsEnd!=this.fixedRowsEnd&&(this.fixedRowsEnd=e.fixedRowsEnd||0)};this.getFixedCellInfo=()=>{let{fixedRowsStart:e,fixedColsStart:n,fixedRowsEnd:i,fixedColsEnd:r}=this;return{fixedRowsStart:e,fixedColsStart:n,fixedRowsEnd:i,fixedColsEnd:r}};this.updateRenderRange=(e=Ut)=>{this.setRenderRange(this.computeRenderRange(e))};this.getExtraSpanCellsForRange=({horizontal:e,vertical:n})=>{let{colspan:i,rowspan:r}=this,a=[];if(r){let l=n.startIndex,u=e.startIndex,s=e.endIndex;for(let d=u;d<s;d++){this.computeItemSpanUpTo(l,d,"vertical");let c=this.rowspanParent.get(d);if(c[l]!=l){let f=l;for(;c[f]!=f;)f--;a.push([f,d])}}}if(i){let l=e.startIndex,u=n.startIndex,s=n.endIndex;for(let d=u;d<s;d++){this.computeItemSpanUpTo(d,l,"horizontal");let c=this.colspanParent.get(d);if(c[l]!=l){let f=l;for(;c[f]!=f;)f--;a.push([d,f])}}}return a};this.computeRenderRange=(e=Ut)=>{let n=e.horizontal?this.computeDirectionalRenderRange("horizontal"):this.horizontalRenderRange,i=e.vertical?this.computeDirectionalRenderRange("vertical"):this.verticalRenderRange;return{horizontal:n,vertical:i,extraCells:this.getExtraSpanCellsForRange({horizontal:n,vertical:i})}};this.computeDirectionalRenderRange=e=>{let n=e==="horizontal"?this.colWidth:this.rowHeight,i=e==="horizontal"?this.horizontalRenderCount:this.verticalRenderCount,r=e==="horizontal"?this.cols:this.rows;if(!i)return{startIndex:0,endIndex:0};let a=(e==="horizontal"?this.fixedColsStart:this.fixedRowsStart)||0,l=e==="horizontal"?this.scrollPosition.scrollLeft:this.scrollPosition.scrollTop;l+=this.getFixedStartSize(e);let u=typeof n!="function",s=e==="horizontal"?this.horizontalExtendRangeBy:this.verticalExtendRangeBy,d=this.getItemAt(l,e),c=s.start||0,f=s.end||0;u||(c+=this.RENDER_COUNT_SAFETY_MARGIN_START,f+=this.RENDER_COUNT_SAFETY_MARGIN_END),c&&(d=Math.max(0,d-c),i+=c),f&&(i+=f);let m=d+i,p=Math.max(a,r-(e==="horizontal"?this.fixedColsEnd:this.fixedRowsEnd));return m>p&&(m=p,d=Math.max(a,m-i)),{startIndex:d,endIndex:m}};this.getItemAt=(e,n)=>{let i=n==="horizontal"?this.colWidth:this.rowHeight,r=n==="horizontal"?this.cols:this.rows;if(typeof i!="function")return Math.min(Math.max(0,Math.floor(e/i)),r-1);let a=n==="horizontal"?this.colOffsetCache:this.rowOffsetCache,l=n==="horizontal"?this.colWidthCache:this.rowHeightCache,u=a.length-1,s=l.length-1,d=a[u],c;for(;d<e;)if(u>=r||(s+=1,this.computeCacheFor(s,n),c=d,d=a[s],c===d&&c!=0))return r-1;let f=(0,fd.default)(a,e,fa);return f>=0?f:~f-1};this.computeCacheFor=(e,n)=>{let i=n==="horizontal"?this.colWidth:this.rowHeight,r=n==="horizontal"?this.colWidthCache:this.rowHeightCache,a=n==="horizontal"?this.colOffsetCache:this.rowOffsetCache;if(typeof i!="function")return;let l=i(e);if(r[e]=l,e>0){let u=a[e-1],s=r[e-1];u==null&&console.error(`Offset was not available for ${n==="horizontal"?"col":"row"} ${e-1}`),s==null&&console.error(`Size was not available for ${n==="horizontal"?"col":"row"} ${e-1}`);let d=u+s;a[e]=d}};this.computeItemSpanUpTo=(e,n,i)=>{let r=i==="horizontal"?n:e,a=i==="horizontal"?e:n,l=i==="horizontal"?this.cols:this.rows,u=i==="horizontal"?this.colspan:this.rowspan;if(!u)return;let s=i==="horizontal"?this.colspanParent:this.rowspanParent;s.has(a)||s.set(a,[]);let d=i==="horizontal"?this.colspanValue:this.rowspanValue;d.has(a)||d.set(a,[]);let c=s.get(a),f=d.get(a);if(c[r]===void 0){let m=c.length,p=l?Math.min(r,l-1):0,h={rowIndex:e,colIndex:n};for(;m<=p;m++)if(c[m]===void 0){h[i==="horizontal"?"colIndex":"rowIndex"]=m;let g=u(h);c[m]=m,f[m]=g;let b=m;for(;g>1;)b+=1,c[b]=m,f[b]=0,g-=1}}};this.getCellSpan=(e,n,i)=>{let r=i==="horizontal"?this.colspan:this.rowspan,a=i==="horizontal"?n:e,l=i==="horizontal"?e:n;if(!r)return 1;let u=i==="horizontal"?this.colspanValue:this.rowspanValue,s=u.get(l);return(!s||s[a]===void 0)&&this.computeItemSpanUpTo(e,n,i),s||(s=u.get(l)),s[a]||1};this.getRowspan=(e,n)=>this.getCellSpan(e,n,"vertical");this.getColspan=(e,n)=>this.getCellSpan(e,n,"horizontal");this.getRowspanParent=(e,n)=>this.getItemSpanParent(e,n,"vertical");this.getColspanParent=(e,n)=>this.getItemSpanParent(e,n,"horizontal");this.getItemSpanParent=(e,n,i)=>{let r=i=="horizontal"?this.colspan:this.rowspan,a=i==="horizontal"?n:e,l=i==="horizontal"?e:n;if(!r)return a;let u=i==="horizontal"?this.colspanParent:this.rowspanParent,s=u.get(l);return(!s||s[a]===void 0)&&this.computeItemSpanUpTo(e,n,i),s||(s=u.get(l)),s[a]};this.getRowHeightWithSpan=(e,n,i)=>this.getItemSizeWithSpan(e,n,i,"vertical");this.getColWidthWithSpan=(e,n,i)=>this.getItemSizeWithSpan(e,n,i,"horizontal");this.getItemSizeWithSpan=(e,n,i,r)=>{let a=r==="horizontal"?n:e,l=this.getItemSize(a,r);for(;i>1;)a+=1,i-=1,l+=this.getItemSize(a,r);return l};this.getRowHeight=e=>this.getItemSize(e,"vertical");this.getColWidth=e=>this.getItemSize(e,"horizontal");this.getItemSize=(e,n)=>{let i=n==="horizontal"?this.cols:this.rows,r=n==="horizontal"?this.colWidth:this.rowHeight;if(typeof r!="function")return r;let a=this.getItemSizeCacheFor(e,n),l=n==="horizontal"?this.colWidthCache:this.rowHeightCache;if(a===void 0){let u=l.length,s=Math.min(e,i-1);for(;u<=s;u++)this.computeCacheFor(u,n);a=this.getItemSizeCacheFor(e,n)}return a};this.keepColumnRendered=e=>(this.alwaysRenderedColumns.add(e),()=>{this.alwaysRenderedColumns.delete(e)});this.getAlwaysRenderedColumns=()=>Array.from(this.alwaysRenderedColumns);this.setRenderRange=({horizontal:e,vertical:n,extraCells:i})=>{let r=!1;(e.startIndex!==this.horizontalRenderRange.startIndex||e.endIndex!==this.horizontalRenderRange.endIndex)&&(this.horizontalRenderRange=e,r=!0);let a=!1;(n.startIndex!==this.verticalRenderRange.startIndex||n.endIndex!==this.verticalRenderRange.endIndex)&&(this.verticalRenderRange=n,a=!0),this.extraSpanCells=i||[],(r||a)&&this.notifyRenderRangeChange(),a&&this.notifyVerticalRenderRangeChange(),r&&this.notifyHorizontalRenderRangeChange()};this.getRenderRangeCellCount=ma;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=e=>(this.onScrollFns.push(e),()=>{this.onScrollFns=this.onScrollFns.filter(n=>n!==e)});this.onScrollStart=e=>(this.onScrollStartFns.push(e),()=>{this.onScrollStartFns=this.onScrollStartFns.filter(n=>n!==e)});this.onScrollStop=e=>(this.onScrollStopFns.push(e),()=>{this.onScrollStopFns=this.onScrollStopFns.filter(n=>n!==e)});this.onRenderRangeChange=e=>(this.onRenderRangeChangeFns.add(e),()=>{this.onRenderRangeChangeFns.delete(e)});this.onVerticalRenderRangeChange=e=>(this.onVerticalRenderRangeChangeFns.add(e),()=>{this.onVerticalRenderRangeChangeFns.delete(e)});this.onHorizontalRenderRangeChange=e=>(this.onHorizontalRenderRangeChangeFns.add(e),()=>{this.onHorizontalRenderRangeChangeFns.delete(e)});this.onRenderCountChange=e=>(this.onRenderCountChangeFns.add(e),()=>{this.onRenderCountChangeFns.delete(e)});this.onAvailableSizeChange=e=>(this.onAvailableSizeChangeFns.add(e),()=>{this.onAvailableSizeChangeFns.delete(e)});this.onDestroy=e=>(this.onDestroyFns.push(e),()=>{this.onDestroyFns=this.onDestroyFns.filter(n=>n!==e)});this.getAvailableSize=()=>({width:this.availableWidth,height:this.availableHeight});this.getAvailableRenderSize=()=>({width:this.availableRenderWidth??this.availableWidth,height:this.availableRenderHeight??this.availableHeight});this.name=n,this.update=this.update.bind(this),this.destroy=this.destroy.bind(this),this.getCellOffset=this.getCellOffset.bind(this),this.reset()}set rowsPerPage(e){e!=this._rowsPerPage&&(this._rowsPerPage=e)}get rowsPerPage(){return this._rowsPerPage}reset(e=Ut){e.vertical&&this.resetVertical(),e.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(e,n){return e}update(e,n){let{rows:i,cols:r,rowHeight:a,colWidth:l,width:u,height:s}=e,d=typeof u=="number",c=typeof s=="number",f=d&&u!==this.availableWidth,m=c&&s!==this.availableHeight;f&&(this.availableWidth=u,this.availableRenderWidth=u),m&&(this.availableHeight=s,this.availableRenderHeight=s),(f||m)&&this.notifyAvailableSizeChange();let p=typeof i=="number",h=typeof r=="number",g=p&&i!==this.rows,b=h&&r!==this.cols;p&&(this.rows=i,this.rowsPerPage=i),h&&(this.cols=r);let C=a!=null,T=l!=null,v=C&&a!==this.rowHeight,S=T&&l!==this.colWidth;C&&(this.rowHeight=a),T&&(this.colWidth=l);let D=e.rowspan!=null,R=e.colspan!=null,E=D&&e.rowspan!=this.rowspan,N=R&&e.colspan!=this.colspan;E&&(this.rowspan=e.rowspan),N&&(this.colspan=e.colspan);let w=b||S||f||N,P=g||v||m||E;(n||Ah)({horizontalChange:w,verticalChange:P,colsChanged:b,colWidthChanged:S,widthChanged:f,colspanChanged:N,rowsChanged:g,rowHeightChanged:v,heightChanged:m,rowspanChanged:E})&&this.updateRenderCount({horizontal:w,vertical:P})}extendRenderRange(e){let{direction:n}=e,i=n==="horizontal",r=i?this.horizontalRenderCount||this.getInitialCols():this.verticalRenderCount||this.getInitialRows(),a=typeof e.start=="number"?e.start:e.start===!0?r:0,l=typeof e.end=="number"?e.end:e.end===!0?r:0;return i?this.horizontalExtendRangeBy={start:a,end:l}:this.verticalExtendRangeBy={start:a,end:l},this.updateRenderRange({horizontal:i,vertical:!i}),()=>{this.extendRenderRange({start:0,end:0,direction:n})}}updateRenderCount(e=Ut){this.reset(e),this.doUpdateRenderCount(e)}doUpdateRenderCount(e=Ut){if(!this.availableWidth||!this.availableHeight){let n={horizontal:void 0,vertical:void 0};this.availableWidth||(n.horizontal=0),this.availableHeight||(n.vertical=0),this.setRenderCount(n)}this.setRenderCount(this.computeRenderCount(e))}get scrollTopMax(){return this.getVirtualizedContentSize().height-this.availableHeight}get scrollLeftMax(){return this.getVirtualizedContentSize().width-this.availableWidth}setScrollPosition(e,n){this.setScrolling(!0);let i=e.scrollLeft!==this.scrollPosition.scrollLeft,r=e.scrollTop!==this.scrollPosition.scrollTop;this.scrollPosition=e,(i||r)&&(n?.(e),this.updateRenderRange({horizontal:i,vertical:r}),this.notifyScrollChange())}notifyRenderRangeChange(e=!1){if(this.destroyed)return;let n=this.onRenderRangeChangeFns,i=this.getRenderRange(),r=e?pa:_o;n.forEach(a=>{r(()=>{this.destroyed||n.has(a)&&a(i)})})}notifyScrollChange(){if(this.destroyed)return;let{scrollPosition:e}=this,n=this.onScrollFns;for(let i=0,r=n.length;i<r;i++)n[i](e)}computeDirectionalRenderCount(e,n,i,r){let a=0,l=e==="horizontal"?r.width:r.height;if(l-=this.getFixedSize(e),l<=0)return 0;let u=e==="horizontal"?this.fixedColsStart:this.fixedRowsStart,s=e==="horizontal"?this.fixedColsEnd:this.fixedRowsEnd;if(typeof n=="function"){let d=[],c=0,f=i;c+=u,f-=s;for(let m=c;m<f;m++)d.push(this.getItemSize(m,e));a=Ei(l,d)}else a=(n?Math.ceil(l/n):0)+1;return a+=u+s,e==="horizontal"?this.maxHorizontalRenderCount=a:this.maxVerticalRenderCount=a,a=Math.min(i,a),a}getFixedSize(e){return e==="horizontal"?this.getFixedStartColsWidth()+this.getFixedEndColsWidth():this.getFixedStartRowsHeight()+this.getFixedEndRowsHeight()}getFixedStartSize(e){return e==="horizontal"?this.getFixedStartColsWidth():this.getFixedStartRowsHeight()}getFixedEndSize(e){return e==="horizontal"?this.getFixedEndColsWidth():this.getFixedEndRowsHeight()}notifyRenderCountChange(){if(this.destroyed)return;let{horizontalRenderCount:e,verticalRenderCount:n}=this,i={horizontal:e,vertical:n},r=this.onRenderCountChangeFns;r.forEach(a=>{_o(()=>{this.destroyed||r.has(a)&&a(i)})})}getCellOffset(e,n){return{x:this.getItemOffsetFor(n,"horizontal"),y:this.getItemOffsetFor(e,"vertical")}}getInitialRowHeight(){return this.rowHeight}getInitialCols(){return this.cols}getInitialRows(){return this.rows}getItemOffsetFor(e,n){let i=n==="horizontal"?this.colWidth:this.rowHeight;if(typeof i!="function")return e*i;let r=n==="horizontal"?this.colOffsetCache:this.rowOffsetCache,a=n==="horizontal"?this.colWidthCache:this.rowHeightCache,l=r[e];if(l==null){let u=a.length-1;for(;u<e;)u+=1,this.computeCacheFor(u,n);l=r[e]}return l}getItemSizeCacheFor(e,n){return(n==="horizontal"?this.colWidthCache:this.rowHeightCache)[e]}getRowIndexInPage(e){return e}getPageIndexForRow(e){return 0}getVirtualizedContentSize(){return{height:this.getVirtualizedContentSizeFor("vertical"),width:this.getVirtualizedContentSizeFor("horizontal")}}getVirtualizedContentSizeFor(e){let n=e==="horizontal"?this.cols:this.rows,i=e==="horizontal"?this.colWidth:this.rowHeight,r=e==="horizontal"?this.horizontalTotalSize:this.verticalTotalSize;if(typeof i!="function")return i*n;if(r!==0&&!isNaN(r))return r;let a=e==="horizontal"?this.colOffsetCache:this.rowOffsetCache,l=n?this.getItemSize(n-1,e):0,u=n?a[n-1]:0,s=l+u;return e==="horizontal"?this.horizontalTotalSize=s:this.verticalTotalSize=s,s}notifyDestroy(){let e=this.onDestroyFns;for(let n=0,i=e.length;n<i;n++)e[n]()}destroy(){this.destroyed||(this.notifyDestroy(),this.reset(),this.rowspanParent.clear(),this.colspanParent.clear(),this.alwaysRenderedColumns.clear(),this.horizontalExtendRangeBy=Fi,this.verticalExtendRangeBy=Fi,this.destroyed=!0,this.onDestroyFns=[],this.onScrollFns=[],this.onScrollStartFns=[],this.onScrollStopFns=[],this.onRenderCountChangeFns.clear(),this.onRenderRangeChangeFns.clear(),this.onVerticalRenderRangeChangeFns.clear(),this.onHorizontalRenderRangeChangeFns.clear())}};var _h={scrollLeft:0,scrollTop:0},Mo=class{constructor(){this.scrollPosition=_h;this.onScrollFns=[];this.getScrollPosition=()=>this.scrollPosition;this.onScroll=t=>(this.onScrollFns.push(t),()=>{this.onScrollFns=this.onScrollFns.filter(e=>e!==t)});this.setScrollPosition=t=>{this.scrollPosition=t,this.notifyScrollChange()};this.destroy=()=>{this.onScrollFns=[]}}notifyScrollChange(){let{scrollPosition:t}=this,e=this.onScrollFns;for(let n=0,i=e.length;n<i;n++)e[n](t)}};var{rootClassName:Mh}=Be,Dt=`${Mh}ColumnCell`;function md(o,t){let e=new Map;function n(i){return t[i]!==!1}return Object.keys(o).forEach(i=>{let a=o[i].columnGroup,l=0;for(n(i)||(l=-1);a;){let u=o[a];if(!u)break;n(a)&&l++,a=u.columnGroup}e.set(i,l)}),e}var hd=require("vue");function gd(o){return(t,e)=>(0,hd.h)(o,{key:t.id,rowInfo:t,cache:e})}var Eo=class extends Tn{constructor(e,n){super(`${e}: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=e=>typeof this.initialColWidth=="number"?this.initialColWidth:this.initialColWidth(e%this.initialCols);this.onTotalPageCountChangeFns=new Set;this.onTotalPageCountChange=e=>(this.onTotalPageCountChangeFns.add(e),()=>{this.onTotalPageCountChangeFns.delete(e)});this.options=n,this.options.masterBrain&&this.options.masterBrain.onTotalPageCountChange(()=>{this.updateRenderCount({horizontal:!0,vertical:!0})})}computeDirectionalRenderCount(e,n,i,r){if(e==="vertical"||typeof n=="number")return super.computeDirectionalRenderCount(e,n,i,r);let a=0,l=r.width,u=Math.floor(l/this.pageWidth);a+=u*this.initialCols;let s=l-u*this.pageWidth,d=[];for(let c=0;c<this.initialCols;c++)d.push(this.getItemSize(c,e));return a+=Ei(s,d.concat(d)),e==="horizontal"?this.maxHorizontalRenderCount=a:this.maxVerticalRenderCount=a,a=Math.min(i,a),a}getRowIndexInPage(e){return this.rowsPerPage?e%this.rowsPerPage:e}getInitialCols(){return this.initialCols}getInitialRows(){return this.initialRows}getPageIndexForRow(e){return Math.floor(e/this.rowsPerPage)}getMatrixCoordinatesForHorizontalLayoutPosition(e){let n=e.rowIndex,i=e.colIndex;return e.rowIndex>=this.rowsPerPage&&this.rowsPerPage>0&&(n=e.rowIndex%this.rowsPerPage,i=Math.floor(e.rowIndex/this.rowsPerPage)*this.initialCols+i),{rowIndex:n,colIndex:i}}getHorizontalLayoutPositionFromMatrixCoordinates(e){let n=e.rowIndex,i=e.colIndex;if(e.colIndex>=this.initialCols&&this.initialCols>0){let r=Math.floor(e.colIndex/this.initialCols);i=e.colIndex-r*this.initialCols,n=this.rowsPerPage*r+e.rowIndex}return{colIndex:Math.min(i,this.initialCols),rowIndex:this.options.isHeader?n:Math.min(n,this.initialRows)}}update(e){let{rows:n,cols:i,rowHeight:r,colWidth:a,width:l,height:u}=e,s=typeof l=="number",d=typeof u=="number",c=s&&l!==this.availableWidth,f=d&&u!==this.availableHeight;c&&(this.availableWidth=l,this.availableRenderWidth=l),f&&(this.availableHeight=u,this.availableRenderHeight=u),(c||f)&&this.notifyAvailableSizeChange();let m=typeof n=="number",p=typeof i=="number",h=m&&n!==this.initialRows,g=p&&i!==this.initialCols;m&&h&&(this.initialRows=n,this.rows=n),p&&g&&(this.initialCols=i,this.cols=i);let b=r!=null,C=a!=null,T=b&&r!==this.rowHeight,v=C&&a!==this.initialColWidth;b&&(this.rowHeight=r),C&&(this.initialColWidth=a,this.colWidth=this.getColWidth);let S=h||T||f,D=g||v||c||S;(D||S)&&this.updateRenderCount({horizontal:D,vertical:S})}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(e){this.options.masterBrain||(this._totalPageCount=e)}getPageWidth(){return this.pageWidth}doUpdateRenderCount(e=Ut){let n=this.getInitialRowHeight(),i=0;for(let a=0;a<this.initialCols;a++)i+=this.getColWidth(a);this.pageWidth=i,this.rowsPerPage=Math.floor(this.availableHeight/n);let r=!1;if(!this.options.masterBrain){let a=this.totalPageCount;this.totalPageCount=this.rowsPerPage?Math.ceil(this.initialRows/this.rowsPerPage):0,a!=this.totalPageCount&&(r=!0)}this.visiblePageCount=this.totalPageCount&&this.pageWidth?Math.max(Math.ceil(this.availableWidth/this.pageWidth),1):1,this.availableRenderHeight=this.visiblePageCount*this.rowsPerPage*n,this.cols=Math.max(this.totalPageCount*this.initialCols,this.initialCols),this.rows=this.rowsPerPage,super.doUpdateRenderCount(e),r&&this.notifyTotalPageCountChange()}notifyTotalPageCountChange(){if(this.destroyed)return;let e=this.onTotalPageCountChangeFns;e.forEach(n=>{Ke(()=>{this.destroyed||e.has(n)&&n(this.totalPageCount)})})}getVirtualColIndex(e,n){return this.initialCols*(n?.pageIndex??0)+e}destroy(){this.destroyed||(super.destroy(),this.options.masterBrain=void 0,this.onTotalPageCountChangeFns.clear())}getVirtualizedContentSizeFor(e){return e==="vertical"?this.getInitialRowHeight()*this.rowsPerPage:this.pageWidth*this.totalPageCount}};var ha=uo(kn());function yd(...o){if(!o.length)return new Set;let[t,...e]=o;return new Set([...t].filter(n=>e.every(i=>i.has(n))))}function bd(o,t){let e=new Set;for(let n of o)t(n)&&e.add(n);return e}function Fo(o,t){for(let e of o)if(t(e))return e}var Ni=(o,t)=>o-t,Oi=class extends ct{constructor(e,n){super(`${e}:GridCellManager`);this.matrix=new $;this.rowsWithCellsHistory=new Map;this.columnsWithCellsHistory=new Map;this.cellToMatrixPosition=new WeakMap;this.getCellsOutsideRenderRange=e=>{let{start:n,end:i}=e,[r,a]=n,[l,u]=i,s=new Set;return this.matrix.visit(({value:d},c)=>{if(!d)return;let[f,m]=c,p=f<r,h=f>=l,g=m<a,b=m>=u;(p||h||g||b)&&s.add(d)}),s};this.debugId=e,this.pool=n,this.offRemoveCell=this.pool.onRemoveCell(i=>this.onRemoveCell(i))}onRemoveCell(e){let n=this.cellToMatrixPosition.get(e);this.cellToMatrixPosition.delete(e),n&&this.clearCellFromMatrix(e,n,{skipHistory:!1})}set poolSize(e){this.pool.poolSize=e}get poolSize(){return this.pool.poolSize}getDetachedCell(){return this.pool.getDetachedCell()}clearCellFromMatrix(e,n,i){if(this.matrix.delete(n),i.skipHistory)return;let[r,a]=n,l=this.rowsWithCellsHistory.get(r),u=this.columnsWithCellsHistory.get(a);l&&(l.delete(e),l.size===0&&this.rowsWithCellsHistory.delete(r)),u&&(u.delete(e),u.size===0&&this.columnsWithCellsHistory.delete(a))}addCellToMatrix(e,n){let[i,r]=n;this.matrix.set(n,e),this.cellToMatrixPosition.set(e,n);let a=this.rowsWithCellsHistory.get(i),l=this.columnsWithCellsHistory.get(r);a?a.add(e):(a=new Set,a.add(e),this.rowsWithCellsHistory.set(i,a)),l?l.add(e):(l=new Set,l.add(e),this.columnsWithCellsHistory.set(r,l))}setCellPositionInMatrix(e,n){let i=this.cellToMatrixPosition.get(e);if(n==null){i&&this.clearCellFromMatrix(e,i,{skipHistory:!0});return}let[r,a]=n,l=i&&i[0]===r&&i[1]===a;i&&!l&&this.clearCellFromMatrix(e,i,{skipHistory:!1}),this.addCellToMatrix(e,n)}renderNodeAtCell(e,n,i,r){let a=this.getCellAt(i);return a&&a!==n&&this.detachCellAt(i),this.pool.attachCell(n),this.setCellPositionInMatrix(n,i),n.update(e,r),n}getCellPosition(e){let n=this.cellToMatrixPosition.get(e);return!n||this.getCellAt(n)!=e?null:n}getCellAt(e){return this.matrix.get(e)}getCellFor(e,n){let i=this.getCellAt(e);if(i)return i;let[r,a]=e;if(n==="row"){let l=this.rowsWithCellsHistory.get(r);l&&(i=Fo(l,u=>!this.isCellAttached(u)))}if(n==="column"){let l=this.columnsWithCellsHistory.get(a);l&&(i=Fo(l,u=>!this.isCellAttached(u)))}return i??this.getDetachedCell()}isCellAttached(e){return this.getCellPosition(e)!==null}isCellAttachedAt(e){let n=this.getCellAt(e);return n?this.isCellAttached(n):!1}getMatrix(){let e=this.getRowsWithCells().pop()??-1,n=this.getColumnsWithCells().pop()??-1;return Array.from({length:e+1},(r,a)=>Array.from({length:n+1},(u,s)=>{let d=[a,s],c=this.getCellAt(d);return c?c.getNode():null}))}getAllCells(){return[...this.pool.getAllCells()]}getCellsForRow(e){return this.matrix.getKeysStartingWith([e]).map(n=>this.getCellAt(n)).filter(Boolean)}getOneAttachedCell(){return this.pool.getAttachedCells().values().next().value}getRowsWithCells(){return this.matrix.rawKeysAt([]).sort(Ni)}getColumnsWithCells(){let e=this.matrix.getKeysOfFirstChildOnEachBranchStartingWith([],{excludeSelf:!0});return[...new Set(e.map(i=>i[1])).values()].sort(Ni)}isRowAttached(e){return this.getRowsWithCells().includes(e)}isColumnAttached(e){return this.getColumnsWithCells().includes(e)}detachRow(e){this.matrix.getKeysStartingWith([e]).forEach(i=>this.detachCellAt(i))}detachCol(e){this.matrix.visit((n,i)=>{i[1]===e&&this.detachCellAt(i)})}detachCell(e){return e?(this.pool.detachCell(e)&&this.setCellPositionInMatrix(e,null),!0):!1}detachCells(e){e.forEach(n=>this.detachCell(n))}detachRowsStartingWith(e){let n=this.getRowsWithCells().sort(),i=(0,ha.default)(n,e,Ni);i<0&&(i=~i),n.slice(i).forEach(a=>this.detachRow(a))}detachColsStartingWith(e){let n=this.getColumnsWithCells().sort(),i=(0,ha.default)(n,e,Ni);i<0&&(i=~i),n.slice(i).forEach(a=>this.detachCol(a))}detachCellsStartingAt(e){let[n,i]=e;this.matrix.visit((r,a)=>{let[l,u]=a;l>n&&this.detachCellAt(a),l===n&&u>=i&&this.detachCellAt(a)})}detachCellAt(e){let n=this.getCellAt(e);return n?this.detachCell(n):!1}onCellAttachmentChange(e){return this.pool.onCellAttachmentChange(e)}getCellFromListForRow(e,n){return Fo(e,i=>this.getCellPosition(i)?.[0]===n)}getCellFromListForColumn(e,n){return Fo(e,i=>this.getCellPosition(i)?.[1]===n)}getCellCountInMatrix(){return this.matrix.size}flushPendingAfterCommitWork(){this.pool.flushPendingAfterCommitWork()}destroy(){this.reset()}reset(){this.pool.reset(),this.matrix.clear(),this.rowsWithCellsHistory.clear(),this.columnsWithCellsHistory.clear(),this.offRemoveCell(),this.offRemoveCell=()=>{}}makeDetachedCellsEmpty(){this.pool.getDetachedCells().forEach(e=>{e.update(null)})}withDetachedCells(e){this.pool.getDetachedCells().forEach(e)}};var Cd=uo(kn());var ki=class extends ct{constructor(e,n){super(`${e}:ListRowManager`);this.indexToRow=new Map;this.rowToIndex=new WeakMap;this.debugId=e,this.pool=n,this.offRemoveRow=this.pool.onRemoveRow(i=>this.onRemoveRow(i))}onRemoveRow(e){let n=this.rowToIndex.get(e);n!=null&&(this.rowToIndex.delete(e),this.indexToRow.delete(n))}set poolSize(e){this.pool.poolSize=e}get poolSize(){return this.pool.poolSize}getDetachedRow(){return this.pool.getDetachedRow()}getRowFor(e){return this.getRowAt(e)??this.getDetachedRow()}setRowIndexInList(e,n){let i=this.rowToIndex.get(e);i!=null&&this.indexToRow.delete(i),n==null?this.rowToIndex.delete(e):(this.rowToIndex.set(e,n),this.indexToRow.set(n,e))}detachStartingWith(e){let n=this.getAttachedIndexes(),i=(0,Cd.default)(n,e,(a,l)=>a-l);i<0&&(i=~i),n.slice(i).forEach(a=>this.detachRowAt(a))}getRowAt(e){return this.indexToRow.get(e)}getRowIndex(e){return this.rowToIndex.get(e)}isRowAttached(e){return this.getRowIndex(e)!=null}isRowAttachedAt(e){return!!this.getRowAt(e)}getList(){let e=Math.max(...this.indexToRow.keys());return Array.from({length:e+1},(i,r)=>{let a=this.indexToRow.get(r);return a?a.getNode():null})}getAttachedCount(){return this.indexToRow.size}forEachAttachedRow(e){this.indexToRow.forEach(e)}getAttachedIndexes(){return Array.from(this.indexToRow.keys()).sort()}getAllRows(){return[...this.pool.getAllRows()]}detachRowAt(e){let n=this.getRowAt(e);n&&(this.setRowIndexInList(n,null),this.pool.detachRow(n))}detachRow(e){let n=this.getRowIndex(e);n!=null&&this.detachRowAt(n)}renderNodeAtRow(e,n,i){let r=this.getRowAt(i);return r&&r!==n&&this.detachRowAt(i),this.pool.attachRow(n),this.setRowIndexInList(n,i),n.update(e),n}makeDetachedRowsEmpty(){this.pool.getDetachedRows().forEach(e=>{e.update(null)})}onRowAttachmentChange(e){return this.pool.onRowAttachmentChange(e)}withDetachedRows(e){this.pool.getDetachedRows().forEach(e)}destroy(){this.reset()}reset(){this.pool.reset(),this.indexToRow.clear(),this.offRemoveRow(),this.offRemoveRow=()=>{}}};var Td=!0,Sn=U(W.y),Sd=U(W.scrollTop),kR=U(W.columnOffsetAtIndex),ga=U(W.columnOffsetAtIndexWhileReordering),Zn=class extends ct{constructor(e,n,i){n=n||"ReactHeadlessTableRenderer";super(n);this.debugId="";this.destroyed=!1;this.scrolling=!1;this.cellHoverClassNames=[];this.cellDetachedClassNames=[];this.lastEnteredRow=-1;this.lastExitedRow=-1;this.hoverRowUpdatesInProgress=new Map;this.infiniteNode=null;this.setDetailTransform=(e,n,{y:i,scrollTop:r,scrollLeft:a})=>{e.style.setProperty(Sn,r?`calc( ${i}px + var(${Sd}) )`:`${i}px`),e.style.transform=`translate3d(${a||0}px, var(${Sn}), 0)`};this.setTransform=(e,n,i,{x:r,y:a,scrollLeft:l,scrollTop:u},s)=>{let d=Se.columnOffsets.get(i),c=`${ga}-${i}`,f=u?`calc( ${a}px + var(${Sd}) )`:`${a}px`;e.__currentTransformY!==f&&(e.__currentTransformY=f,e.style.setProperty(Sn,f));let m=`translate3d(var(${c}, ${d}), var(${Sn}), 0)`;e.__transformValue!==m&&(e.__transformValue=m,e.style.transform=m),s!=null};this.getFullyVisibleRowsRange=()=>{let{start:[e],end:[n]}=this.brain.getRenderRange();for(;!this.isRowFullyVisible(e);)if(e++,e===n)return null;for(;!this.isRowFullyVisible(n);)if(n--,n===e)return null;return{start:e,end:n}};this.getScrollPositionForScrollRowIntoView=(e,n={offset:0})=>{if(this.destroyed)return null;let{brain:i}=this,r=i.getScrollPosition(),a=r.scrollLeft,{scrollAdjustPosition:l,offset:u=0}=n;if(this.isRowFullyVisible(e)&&!l)return r;let s=i.getItemOffsetFor(e,"vertical"),d=i.getItemSize(e,"vertical"),c=i.getFixedStartRowsHeight(),f=i.getFixedEndRowsHeight(),m=r.scrollTop,p=i.getAvailableSize();if(!p.height)return null;let h=m+p.height;l||(l=s>h-f?"end":s<m+c?"start":"end");let g=r.scrollTop;if(l==="center"?g=s-Math.floor((i.getAvailableSize().height-c-f)/2):l==="start"?(u=-u,g+=s-m+u-c):(u+=d,g+=s-h+u+f),this.brain.isHorizontalLayoutBrain){let b=n.colIndex??Math.ceil(this.brain.getInitialCols()/2),C=this.getScrollPositionForScrollColumnIntoView(b,{...n,horizontalLayoutPageIndex:this.brain.getPageIndexForRow(e)});C&&(a=C.scrollLeft)}return{scrollLeft:a,scrollTop:g}};this.getScrollPositionForScrollColumnIntoView=(e,n={offset:0})=>{if(this.destroyed)return null;let{brain:i}=this,r=i.getScrollPosition(),a=n.horizontalLayoutPageIndex!=null?{horizontalLayoutPageIndex:n.horizontalLayoutPageIndex}:void 0,{scrollAdjustPosition:l,offset:u=0}=n;if(this.isColumnFullyVisible(e,void 0,a)&&!l)return r;a&&(e=i.getInitialCols()*a.horizontalLayoutPageIndex+e);let s=i.getItemOffsetFor(e,"horizontal"),d=i.getItemSize(e,"horizontal"),c=i.getFixedStartColsWidth(),f=i.getFixedStartColsWidth(),m=r.scrollLeft,p=i.getAvailableSize();if(!p.width)return null;let h=m+p.width;l||(l=s>h-f?"end":s<m+c?"start":"end");let g=r.scrollLeft;return l==="center"?g=s-Math.floor((i.getAvailableSize().width-c-f)/2):l==="start"?(u=-u,g+=s-m+u-c):(u+=d,g+=s-h+u+f),{...r,scrollLeft:g}};this.getScrollPositionForScrollCellIntoView=(e,n,i={offsetLeft:0,offsetTop:0})=>{if(this.destroyed)return null;let r=this.getScrollPositionForScrollColumnIntoView(n,{scrollAdjustPosition:i.colScrollAdjustPosition||i.scrollAdjustPosition,offset:i.offsetLeft}),a=this.getScrollPositionForScrollRowIntoView(e,{scrollAdjustPosition:i.rowScrollAdjustPosition||i.scrollAdjustPosition,offset:i.offsetTop});if(!r||!a)return null;let{scrollLeft:l}=r,{scrollTop:u}=a;return{scrollLeft:l,scrollTop:u}};this.isRowFullyVisible=(e,n=2)=>this.isRowVisible(e,this.brain.getRowHeight(e)-n);this.isRowVisible=(e,n=10)=>{if(!this.isRowRendered(e))return!1;e=this.brain.getPageIndexForRow(e)&&this.brain.rowsPerPage?e%this.brain.rowsPerPage:e;let{brain:r}=this;if(r.isRowFixed(e))return!0;let{start:[a],end:[l]}=this.brain.getRenderRange(),u=Math.floor((a+l)/2);if(e<a||e>=l)return!1;if(e>=u){let s=r.getItemAt(r.getAvailableSize().height+r.getScrollPosition().scrollTop-n,"vertical");return e<=s}if(e<u){let s=r.getItemAt(r.getScrollPosition().scrollTop+n,"vertical");return e>=s}return!0};this.isRowRendered=e=>{if(!this.brain.isHorizontalLayoutBrain)return this.cellManager.isRowAttached(e);let n=e;return e=this.brain.rowsPerPage?e%this.brain.rowsPerPage:e,this.cellManager.getCellsForRow(e).filter(i=>i.getAdditionalInfo()?.renderRowIndex===n).length>0};this.isCellVisible=(e,n)=>this.isRowVisible(e)&&this.isColumnVisible(n);this.isCellFullyVisible=(e,n,i)=>this.isRowFullyVisible(e)&&this.isColumnVisible(n,void 0,i);this.isColumnFullyVisible=(e,n=2,i)=>this.isColumnVisible(e,this.brain.getColWidth(e)-n,i);this.isColumnVisible=(e,n=10,i)=>{if(!this.isColumnRendered(e,i))return!1;let{brain:r}=this;if(r.isColFixed(e))return!0;i&&i.horizontalLayoutPageIndex!=null&&(e=r.getVirtualColIndex(e,{pageIndex:i.horizontalLayoutPageIndex}));let{start:[a,l],end:[u,s]}=r.getRenderRange();if(e<l||e>=s)return!1;let d=Math.floor((l+s)/2);if(e>=d){let c=r.getItemAt(r.getAvailableSize().width+r.getScrollPosition().scrollLeft-n-r.getFixedEndColsWidth(),"horizontal");return e<=c}if(e<d){let c=r.getItemAt(r.getScrollPosition().scrollLeft+n+r.getFixedStartColsWidth(),"horizontal");return e>=c}return!0};this.isCellRendered=(e,n,i)=>this.isRowRendered(e)&&this.isColumnRendered(n,i);this.isColumnRendered=(e,n)=>{let{start:[i]}=this.brain.getRenderRange();return n?.horizontalLayoutPageIndex!=null&&(e=this.brain.getInitialCols()*n.horizontalLayoutPageIndex+e),this.cellManager.isCellAttachedAt([i,e])};this.getExtraSpanCellsForRange=e=>{let{start:n,end:i}=e,[r,a]=n,[l,u]=i;return this.brain.getExtraSpanCellsForRange({horizontal:{startIndex:a,endIndex:u},vertical:{startIndex:r,endIndex:l}})};this.getFixedRanges=e=>{let{fixedRowsStart:n,fixedRowsEnd:i,fixedColsStart:r,fixedColsEnd:a}=this.brain.getFixedCellInfo();if(!n&&!r&&!i&&!a)return[];let l=this.brain.getColCount(),u=this.brain.getRowCount(),{start:s,end:d}=e,[c,f]=s,[m,p]=d,h=[];if(r&&(n&&h.push({rowFixed:"start",colFixed:"start",start:[0,0],end:[n,r]}),i&&h.push({rowFixed:"end",colFixed:"start",start:[u-i,0],end:[u,r]}),h.push({rowFixed:!1,colFixed:"start",start:[c,0],end:[m,r]})),a&&(n&&h.push({colFixed:"end",rowFixed:"start",start:[0,l-a],end:[n,l]}),i&&h.push({colFixed:"end",rowFixed:"end",start:[u-i,l-a],end:[u,l]}),h.push({colFixed:"end",rowFixed:!1,start:[c,l-a],end:[m,l]})),n){let g={start:[0,f],end:[n,p],rowFixed:"start",colFixed:!1};h.push(g)}if(i){let g={rowFixed:"end",colFixed:!1,start:[u-i,f],end:[u,p]};h.push(g)}return h};this.isCellFixed=(e,n)=>{let{fixedRowsStart:i,fixedRowsEnd:r,fixedColsStart:a,fixedColsEnd:l}=this.brain.getFixedCellInfo(),u=this.brain.getColCount(),s=this.brain.getRowCount(),d=!1,c=!1,f=!1;if(e<i&&(d=!0,f="start"),r&&!d){let m=s-r;e>=m&&(d=!0,f="end")}if(n<a&&(c=!0,f="start"),l&&!c){let m=u-l;n>=m&&(c=!0,f="end")}return{row:d?f:!1,col:c?f:!1}};this.isCellCovered=(e,n)=>{let i=this.brain.getRowspanParent(e,n),r=this.brain.getColspanParent(e,n),a=i!=e,l=r!=n;return a||l?[i,r]:!1};this.onMouseEnterNotBound=e=>{let n=this.getMatrixRowIndexFromElement(e.currentTarget);this.onMouseEnter(n)};this.onMouseLeaveNotBound=e=>{let n=this.getMatrixRowIndexFromElement(e.currentTarget);this.onMouseLeave(n)};this.onMouseEnter=e=>{this.lastEnteredRow=e,this.lastExitedRow=-1,!this.scrolling&&e!=-1&&this.addHoverClass(e)};this.addHoverClass=e=>{this.cellManager.getCellsForRow(e).forEach(n=>{let i=n.getElement();i&&this.cellHoverClassNames.forEach(r=>{i.classList.add(r)})})};this.onMouseLeave=e=>{this.lastExitedRow=e,this.lastEnteredRow=-1,!this.scrolling&&e!=-1&&this.removeHoverClass(e)};this.removeHoverClass=e=>{this.cellManager.getCellsForRow(e).forEach(n=>{let i=n.getElement();i&&this.cellHoverClassNames.forEach(r=>{i.classList.remove(r)})})};this.updateHoverClassNamesForRow=e=>{if(this.scrolling||this.hoverRowUpdatesInProgress.has(e))return;this.hoverRowUpdatesInProgress.set(e,!0);let n=()=>{!this.scrolling&&this.lastEnteredRow!=-1&&(this.lastEnteredRow===e?this.addHoverClass(e):this.removeHoverClass(e))};Ke(()=>{this.destroyed||(n(),this.hoverRowUpdatesInProgress.delete(e))})};this.updateElementPosition=(e,n)=>{if(this.destroyed)return;let i=e.getElement(),r=this.cellManager.getCellPosition(e);if(!r)return;let[a,l]=r,u=this.brain.getCellOffset(a,l);if(u==null)return;let{x:s,y:d}=u;if(i){let c=()=>{this.updateHoverClassNamesForRow(a);let f=this.getCellRealCoordinates(a,l);if(i.dataset.rowIndex=f.rowIndex,i.dataset.colIndex=f.colIndex,Td){this.setTransform(i,a,l,{x:s,y:d},null),i.style.willChange="transform",i.style.backfaceVisibility="hidden";let p=(n?n.hidden:!!this.isCellCovered(a,l))?"-1":i.dataset.zIndex||"auto";i.__zIndex!==p&&(i.__zIndex=p,i.style.zIndex=p)}else i.style.display="",i.style.left=`${s}px`,i.style.top=`${d}px`};this.scrolling&&this.brain.isHorizontalLayoutBrain?e.setPendingAfterCommitWork(c):c()}};this.updateDetailElementPosition=e=>{if(this.destroyed)return;let n=e.getElement(),i=this.rowManager.getRowIndex(e);if(i==null)return;let r=this.brain.getItemOffsetFor(i,"vertical");if(r==null)return;let a=r;n&&(n.dataset.detailRowIndex=i,Td&&(this.setDetailTransform(n,i,{y:a,scrollLeft:this.brain.getScrollPosition().scrollLeft}),n.style.willChange="transform",n.style.backfaceVisibility="hidden",n.style.zIndex=n.dataset.zIndex||"auto"))};this.onScrollStart=()=>{this.scrolling=!0,this.lastEnteredRow!=-1&&this.removeHoverClass(this.lastEnteredRow)};this.onScrollStop=()=>{this.scrolling=!1,this.lastEnteredRow!=-1&&this.addHoverClass(this.lastEnteredRow),this.lastExitedRow!=-1&&this.removeHoverClass(this.lastExitedRow)};this.adjustFixedElementsOnScroll=(e=this.brain.getScrollPosition())=>{let{brain:n,cellManager:i,rowManager:r}=this,a=this.brain.getColCount(),l=this.brain.getRowCount(),{fixedColsStart:u,fixedColsEnd:s,fixedRowsStart:d,fixedRowsEnd:c}=this.brain.getFixedCellInfo();if(r.getAttachedCount()&&r.forEachAttachedRow(I=>{let M=r.getRowIndex(I);if(M!=null){let F=this.brain.getItemOffsetFor(M,"vertical");if(F==null)return;let O=I.getElement();if(!O)return;this.setDetailTransform(O,M,{y:F,scrollLeft:e.scrollLeft})}}),!u&&!s&&!d&&!c)return;let f=this.cellManager.getOneAttachedCell();f&&xs(e,this.getInfiniteNode(f.getElement()));let m=this.brain.getFixedEndColsOffsets({skipScroll:!0}),p=this.brain.getFixedEndRowsOffsets({skipScroll:!0}),{start:h,end:g}=this.brain.getRenderRange(),[b,C]=h,[T,v]=g;function S(I,M,F){let O=i.getCellAt([I,M]);if(O==null)return;let z=n.getCellOffset(I,M),k=O.getElement();k&&z&&F(I,M,k,z)}let D=(I,M,F,{x:O,y:z})=>{this.setTransform(F,I,M,{x:O,y:z,scrollLeft:!0},u-M)},R=(I,M,F,O)=>{this.setTransform(F,I,M,{x:O.x,y:O.y,scrollTop:!0},d-I)},E=(I,M,F,{y:O})=>{let z=m[M];this.setTransform(F,I,M,{x:z,y:O,scrollLeft:!0},a-M)},N=(I,M,F,O)=>{this.setTransform(F,I,M,{x:O.x,y:p[I],scrollTop:!0},l-I)},w=(I,M,F,{x:O,y:z})=>{this.setTransform(F,I,M,{x:O,scrollLeft:!0,y:z,scrollTop:!0},1e5)},P=(I,M,F,{x:O})=>{this.setTransform(F,I,M,{x:O,scrollLeft:!0,y:p[I],scrollTop:!0},2e5)},_=(I,M,F,O)=>{this.setTransform(F,I,M,{x:m[M],y:O.y,scrollLeft:!0,scrollTop:!0},3e5)},A=(I,M,F)=>{this.setTransform(F,I,M,{x:m[M],y:p[I],scrollLeft:!0,scrollTop:!0},4e5)};if(u||s)for(let I=b;I<T;I++){for(let M=0;M<u;M++)S(I,M,D);if(s){let M=a-s;for(let F=M;F<a;F++)S(I,F,E)}}if(d||c)for(let I=C;I<v;I++){for(let M=0;M<d;M++)S(M,I,R);if(c){let M=l-c;for(let F=M;F<l;F++)S(F,I,N)}}if(u&&d)for(let I=0;I<d;I++)for(let M=0;M<u;M++)S(I,M,w);if(u&&c){let I=l-c;for(let M=I;M<l;M++)for(let F=0;F<u;F++)S(M,F,P)}if(s&&d){let I=a-s;for(let M=0;M<d;M++)for(let F=I;F<a;F++)S(M,F,_)}if(s&&c){let I=l-c,M=a-s;for(let F=I;F<l;F++)for(let O=M;O<a;O++)S(F,O,A)}};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=e,this.debugId=n,this.cellManager=new Oi(n,i.cellPool),this.cellManager.onCellAttachmentChange((s,d)=>{d?this.onCellAttached(s):this.onCellDetached(s)}),this.rowManager=new ki(n,i.rowPool),this.rowManager.onRowAttachmentChange((s,d)=>{d?this.onRowAttached(s):this.onRowDetached(s)}),this.renderRange=this.renderRange.bind(this);let r=e.onScroll(this.adjustFixedElementsOnScroll),a=e.onAvailableSizeChange(()=>{this.adjustFixedElementsOnScroll(),Ke(()=>{this.destroyed||this.adjustFixedElementsOnScroll()})}),l=e.onScrollStart(this.onScrollStart),u=e.onScrollStop(this.onScrollStop);this.onDestroy=()=>{r(),a(),l(),u()}}getInfiniteNode(e){return this.infiniteNode||(this.infiniteNode=Nr(e)),this.infiniteNode}onCellAttached(e){if(this.cellDetachedClassNames.length){let n=e.getElement();n&&this.cellDetachedClassNames.forEach(i=>{n.classList.remove(i)})}}onCellDetached(e){if(this.cellDetachedClassNames.length){let n=e.getElement();n&&this.cellDetachedClassNames.forEach(i=>{n.classList.add(i)})}}onRowAttached(e){if(this.cellDetachedClassNames.length){let n=e.getElement();n&&this.cellDetachedClassNames.forEach(i=>{n.classList.remove(i)})}}onRowDetached(e){if(this.cellDetachedClassNames.length){let n=e.getElement();n&&this.cellDetachedClassNames.forEach(i=>{n.classList.add(i)})}}isCellRenderedAndMappedCorrectly(e,n){let i=!!this.cellManager.getCellAt([e,n]);return{rendered:i,mapped:i}}renderRange(e,{renderCell:n,renderDetailRow:i,force:r,onRender:a}){if(this.destroyed)return[];let{start:l,end:u}=e,s=this.brain.isHorizontalLayoutBrain,{rowManager:d,cellManager:c}=this,f=this.getFixedRanges(e),m=[e,...f],p=this.brain.getAlwaysRenderedColumns();if(p.length>0){let w=e.start[1],P=e.end[1];p.forEach(_=>{w<=_&&_<P||m.push({start:[e.start[0],_],end:[e.end[0],_+1]})})}let h=new Map,g=m.map(this.getExtraSpanCellsForRange).flat();g&&g.forEach(([w,P])=>{h.set(`${w}:${P}`,!0)});let b=m.reduce((w,P)=>w+ma(P),0),C=i?m.reduce((w,P)=>w+pd(P),0):0,T=this.brain.getRowCount(),v=this.brain.getColCount();c.detachCellsStartingAt([T,v]);let S=Math.min(T*v,b);i&&(d.detachStartingWith(this.brain.getRowCount()),d.poolSize>C&&(d.poolSize=C));let D=yd(...m.map(w=>c.getCellsOutsideRenderRange(w)));D=bd(D,w=>{let P=c.getCellPosition(w);return!(P&&h.has(`${P[0]}:${P[1]}`))}),c.detachCells(D),c.poolSize=S;let R=new Map,E=new Map;m.forEach(w=>{let{start:P,end:_}=w,[A,I]=P,[M,F]=_;for(let O=A;O<M;O++){for(let k=I;k<F;k++){let H=`${O}:${k}`;if(R.has(H))continue;R.set(H,!0);let{rendered:oe,mapped:le}=this.isCellRenderedAndMappedCorrectly(O,k);if(O===A||k===I){let Re=this.isCellCovered(O,k);if(Re&&h.has(`${Re[0]}:${Re[1]}`)){let ye=c.getCellAt([O,k]);ye!=null&&c.detachCell(ye);continue}}if(oe&&!r&&le)continue;let q;oe?q=c.getCellAt([O,k]):q=c.getCellFor([O,k],s?"row":"column"),q==null&&(q=c.getDetachedCell()),this.renderCellAt(O,k,q,n)}!i||E.has(O)||(E.set(O,!0),d.isRowAttachedAt(O)&&!r)||this.renderDetailRowAtElement(O,this.rowManager.getRowFor(O),i)}}),g.forEach(([w,P])=>{let{rendered:_,mapped:A}=this.isCellRenderedAndMappedCorrectly(w,P);if(_){if(r||!A){let M=[w,P],F=c.getCellAt(M);this.renderCellAt(w,P,F,n)}return}let I=c.getCellFor([w,P],s?"row":"column");I!=null&&this.renderCellAt(w,P,I,n)});let N=c.getAllCells().map(w=>w.getNode());return i&&d.getAllRows().forEach(w=>{N.push(w.getNode())}),this.adjustFixedElementsOnScroll(),a&&a(N),N}renderDetailRowAtElement(e,n,i){if(this.destroyed)return;let r=!1,a=this.brain.getRowHeight(e),l=this.brain.isRowFixedStart(e)?"start":this.brain.isRowFixedEnd(e)?"end":!1,s=i({rowIndex:e,height:a,rowFixed:l,hidden:!!r,onMouseEnter:()=>{},onMouseLeave:()=>{},domRef:n.ref});if(n.isMounted()||n.onMount(d=>{let c=d.getElement();c&&(c.style.position="absolute",c.style.left="0px"),this.updateDetailElementPosition(d)}),!s){this.rowManager.detachRow(n);return}this.rowManager.renderNodeAtRow(s,n,e),this.updateDetailElementPosition(n)}getCellRealCoordinates(e,n){return{rowIndex:e,colIndex:n}}getMatrixRowIndexFromElement(e){let n=Number(e.dataset.rowIndex);return this.brain.isHorizontalLayoutBrain?this.brain.getRowIndexInPage(n):n}renderCellAt(e,n,i,r){if(this.destroyed)return;let a=this.isCellCovered(e,n),l=this.brain.getRowHeight(e),u=this.brain.getColWidth(n),s=this.brain.getRowspan(e,n),d=this.brain.getColspan(e,n),c=s===1?l:this.brain.getRowHeightWithSpan(e,n,s),f=d===1?u:this.brain.getColWidthWithSpan(e,n,d),{row:m,col:p}=this.isCellFixed(e,n),h=!!a,{rowIndex:g,colIndex:b}=this.getCellRealCoordinates(e,n),C=r({rowIndex:g,colIndex:b,height:l,width:u,rowspan:s,colspan:d,rowFixed:m,colFixed:p,hidden:h,heightWithRowspan:c,widthWithColspan:f,onMouseEnter:this.onMouseEnterNotBound,onMouseLeave:this.onMouseLeaveNotBound,domRef:i.ref});i.isMounted()||i.onMount(S=>{let D=S.getElement();D&&(D.style.position="absolute",D.style.left="0px",D.style.top="0px"),this.updateElementPosition(S)});let T=this.brain.isHorizontalLayoutBrain?{renderRowIndex:g,renderColIndex:b}:void 0,v=this.brain.isHorizontalLayoutBrain;if(!C){v?this.cellManager.detachCell(i):this.cellManager.detachCell(i);return}this.cellManager.renderNodeAtCell(C,i,[e,n],T),this.updateElementPosition(i,{hidden:h,rowspan:s,colspan:d})}reset(){this.cellManager.reset(),this.rowManager.reset()}};var Li=class extends Zn{constructor(e,n,i){super(e,n,i);this.setTransform=(e,n,i,r,a)=>{let l=this.getCellRealCoordinates(n,i),{y:u}=r,s=Math.floor(l.rowIndex/this.brain.rowsPerPage),d=xe.runtime.totalVisibleColumnsWidthVar,c=s?`calc(${d} * ${s})`:"0px",f=Se.columnOffsets.get(l.colIndex),m=`${ga}-${l.colIndex}`,p=`${u}px`;e.__currentTransformY!==p&&(e.__currentTransformY=p,e.style.setProperty(Sn,p));let h=`calc(var(${m}, ${f}) + ${c})`,g=`var(${Sn})`,b=`translate3d(${h}, ${g}, 0px)`;e.__transformValue!==b&&(e.__transformValue=b,e.style.transform=b)};this.brain=e}getCellRealCoordinates(e,n){return this.brain.getHorizontalLayoutPositionFromMatrixCoordinates({rowIndex:e,colIndex:n})}isCellRenderedAndMappedCorrectly(e,n){let i=this.cellManager.getCellAt([e,n]),r=!!i;if(!r)return{rendered:r,mapped:!1};let a=i.getAdditionalInfo();if(!a)return{rendered:r,mapped:!1};let l=this.getCellRealCoordinates(e,n),u=l.colIndex===a.renderColIndex&&l.rowIndex===a.renderRowIndex;return{rendered:r,mapped:u}}};var Id=require("vue");var ot=require("vue");function wd(o,t){if(!(!t||!o)){if(Array.isArray(o)){for(let e of o)wd(e,t);return}if((0,ot.isVNode)(o)){let e=o.ref;e&&e.i==null&&(e.i=t)}}}var sn=(0,ot.defineComponent)({name:"RenderSlot",props:{name:{type:String,required:!1},useraf:{type:Boolean,required:!1,default:!1},updater:{type:Function,required:!0},afterCommit:{type:Function,required:!1}},setup(o){let t=(0,ot.shallowRef)(o.updater.get()??null),e=null;(0,ot.watch)(()=>[o.updater,o.useraf],([i,r],a,l)=>{t.value=i.get()??null;let u=i.onChange(s=>{r?(e!=null&&cancelAnimationFrame(e),e=requestAnimationFrame(()=>{t.value=s})):t.value=s});l(u)},{immediate:!0,flush:"sync"}),(0,ot.onBeforeUnmount)(()=>{e!=null&&cancelAnimationFrame(e)}),(0,ot.onMounted)(()=>o.afterCommit?.()),(0,ot.onUpdated)(()=>o.afterCommit?.());let n=(0,ot.getCurrentInstance)();return()=>{let i=t.value;return wd(i,n),i??null}}});var Xn=class Xn extends ct{constructor(e){super(e);this.cellRemoveSubscription=me();this.cellAttachmentChangeSubscription=me();this.attachedCells=new Set,this.detachedCells=new Set,this.allCellsOrdered=new Set}destroy(){this.reset()}onRemoveCell(e){return this.cellRemoveSubscription.onChange(i=>{i!=null&&e(i)})}onCellAttachmentChange(e){return this.cellAttachmentChangeSubscription.onChange(i=>{if(i==null)return;let{cell:r,attached:a}=i;e(r,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 e=this.createCellInstance();return this.detachedCells.add(e),this.allCellsOrdered.add(e),e}removeCell(e){this.detachedCells.delete(e),this.attachedCells.delete(e),this.allCellsOrdered.delete(e),e.destroy(),this.cellRemoveSubscription(e)}attachCell(e){return e&&this.attachedCells.has(e)||(e||(e=this.getDetachedCell()),this.detachedCells.delete(e),this.attachedCells.add(e),this.cellAttachmentChangeSubscription({cell:e,attached:!0})),e}detachCell(e){return this.detachedCells.has(e)?!1:(this.attachedCells.delete(e),this.detachedCells.add(e),this.cellAttachmentChangeSubscription({cell:e,attached:!1}),!0)}getDetachedCell(){let{detachedCells:e}=this,n=e.values().next().value;return n||(this.poolSize+=Xn.POOL_SIZE_INCREMENT,n=e.values().next().value),n||this.error("No cells available in the pool!"),n}get attachedSize(){return this.attachedCells.size}get detachedSize(){return this.detachedCells.size}get poolSize(){return this.allCellsOrdered.size}flushPendingAfterCommitWork(){for(let e of this.attachedCells)e.flushPendingAfterCommitWork()}set poolSize(e){e=Math.ceil(e/Xn.POOL_SIZE_INCREMENT)*Xn.POOL_SIZE_INCREMENT;let n=this.poolSize;if(e===n)return;let{detachedCells:i}=this,r=n-e;if(r>0){r>i.size&&(r=i.size,this.debug("Trying to destroy more cells than are currently detached!"));let a=i.values();for(;r>0;){let l=a.next().value;this.removeCell(l),r--}}else for(r=-r;r>0;)this.createCell(),r--}};Xn.POOL_SIZE_INCREMENT=1;var zi=Xn;var vd=new Map,Eh=()=>{},ya=class{constructor(t,e){this.element=null;this.mounted=!1;this.pendingAfterCommitWork=null;this.mountSubscription=me();this.afterCommit=()=>{this.flushPendingAfterCommitWork()};let n=vd.get(t)??0,i=`${t}:GridCellVue:${n}`;vd.set(t,n+1),this.debugId=i,this.cellInfo=e,this.updater=me(),this.node=(0,Id.h)(sn,{key:i,name:i,updater:this.updater,afterCommit:this.afterCommit}),this.ref=r=>{this.element=r,r?(this.mounted=!0,this.mountSubscription(this)):this.mounted=!1}}setPendingAfterCommitWork(t){this.pendingAfterCommitWork=t}flushPendingAfterCommitWork(){if(this.pendingAfterCommitWork){let t=this.pendingAfterCommitWork;this.pendingAfterCommitWork=null,t()}}isMounted(){return this.mounted}onMount(t){return this.mountSubscription.onChange(n=>{n!=null&&t(n)})}destroy(){this.mountSubscription.destroy(),this.updater.destroy(),this.pendingAfterCommitWork=null,this.ref=Eh,this.element=null,this.node=null}getNode(){return this.node}update(t,e){this.updater(t),this.cellInfo=e}getAdditionalInfo(){return this.cellInfo}getElement(){return this.element}},Vi=class extends zi{constructor(e){super(`${e}:GridCellPoolForVue`);this.cellDebugId=e}createCellInstance(){return new ya(this.cellDebugId)}};var xd=require("vue");var Jn=class Jn extends ct{constructor(e){super(e);this.rowRemoveSubscription=me();this.rowAttachmentChangeSubscription=me();this.attachedRows=new Set,this.detachedRows=new Set,this.allRowsOrdered=new Set}destroy(){this.reset()}onRemoveRow(e){return this.rowRemoveSubscription.onChange(i=>{i!=null&&e(i)})}onRowAttachmentChange(e){return this.rowAttachmentChangeSubscription.onChange(i=>{if(i==null)return;let{row:r,attached:a}=i;e(r,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 e=this.createRowInstance();return this.detachedRows.add(e),this.allRowsOrdered.add(e),e}removeRow(e){this.detachedRows.delete(e),this.attachedRows.delete(e),this.allRowsOrdered.delete(e),e.destroy(),this.rowRemoveSubscription(e)}attachRow(e){return e&&this.attachedRows.has(e)||(e||(e=this.getDetachedRow()),this.detachedRows.delete(e),this.attachedRows.add(e),this.rowAttachmentChangeSubscription({row:e,attached:!0})),e}detachRow(e){return this.detachedRows.has(e)?!1:(this.attachedRows.delete(e),this.detachedRows.add(e),this.rowAttachmentChangeSubscription({row:e,attached:!1}),!0)}getDetachedRow(){let{detachedRows:e}=this,n=e.values().next().value;return n||(this.poolSize+=Jn.POOL_SIZE_INCREMENT),n=e.values().next().value,n||this.error("No rows available in the pool!"),n}get attachedSize(){return this.attachedRows.size}get detachedSize(){return this.detachedRows.size}get poolSize(){return this.allRowsOrdered.size}set poolSize(e){e=Math.ceil(e/Jn.POOL_SIZE_INCREMENT)*Jn.POOL_SIZE_INCREMENT;let n=this.poolSize;if(e===n)return;let{detachedRows:i}=this,r=n-e;if(r>0){r>i.size&&(r=i.size,this.debug("Trying to destroy more rows than are currently detached!"));let a=i.values();for(;r>0;){let l=a.next().value;this.removeRow(l),r--}}else for(r=-r;r>0;)this.createRow(),r--}};Jn.POOL_SIZE_INCREMENT=1;var Gi=Jn;var Rd=new Map,Fh=()=>{},ba=class{constructor(t){this.element=null;this.mounted=!1;this.mountSubscription=me();let e=Rd.get(t)??0,n=`${t}:ListRowVue:${e}`;Rd.set(t,e+1),this.debugId=n,this.updater=me(),this.node=(0,xd.h)(sn,{key:`detail-row-${n}`,name:`detail-row-${n}`,updater:this.updater}),this.ref=i=>{this.element=i,i?(this.mounted=!0,this.mountSubscription(this)):this.mounted=!1}}isMounted(){return this.mounted}onMount(t){return this.mountSubscription.onChange(n=>{n!=null&&t(n)})}destroy(){this.mountSubscription.destroy(),this.updater.destroy(),this.ref=Fh,this.element=null,this.node=null}getNode(){return this.node}update(t){this.updater(t)}getElement(){return this.element}},Ki=class extends Gi{constructor(e){super(`${e}:ListRowPoolForVue`);this.rowDebugId=e}createRowInstance(){return new ba(this.rowDebugId)}};function Pd(o){return{cellPool:new Vi(o),rowPool:new Ki(o)}}function No(o){let t=o.isHorizontalLayoutBrain?new Li(o,`${o.name}:VueHorizontalLayoutTableRenderer`,Pd(`${o.name}:VueHorizontalLayoutTableRenderer`)):new Zn(o,`${o.name}:VueHeadlessTableRenderer`,Pd(`${o.name}:VueHeadlessTableRenderer`)),e=me();return o.onDestroy(()=>{t.destroy(),e.destroy()}),{renderer:t,onRenderUpdater:e}}function wn(){return{current:null}}var Dd={};function Ca(o){return`.${Dt}[data-row-index${o?`="${o.rowIndex}"`:""}][data-col-index${o?`="${o.colIndex}"`:""}]`}function Ta(o,t){let e=$n(o),n=t?new Eo(e,{isHeader:!1}):new Tn(e),i=`${e}:header`,r=t?new Eo(i,{isHeader:!0,masterBrain:n}):new Tn(i);n.onScroll(d=>{r.setScrollPosition({scrollLeft:d.scrollLeft,scrollTop:0})});let{renderer:a,onRenderUpdater:l}=No(n),{renderer:u,onRenderUpdater:s}=No(r);return n.onAvailableSizeChange(d=>{r.update({width:d.width})}),{brain:n,headerBrain:r,renderer:a,onRenderUpdater:l,headerRenderer:u,headerOnRenderUpdater:s}}function Ad({debugId:o,wrapRowsHorizontally:t}){let e={},{brain:n,headerBrain:i,renderer:r,onRenderUpdater:a,headerRenderer:l,headerOnRenderUpdater:u}=Ta(o,!!t),s=wn(),d=Date.now();return{debugWarnings:new Map,renderer:r,onRenderUpdater:a,headerRenderer:l,headerOnRenderUpdater:u,updatedAt:d,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:c=>{if(!s.current)return null;let f=Ca(c);return s.current.querySelector(f)||null},brain:n,headerBrain:i,domRef:s,columnMenuTargetRef:wn(),editingValueRef:wn(),scrollerDOMRef:wn(),portalDOMRef:wn(),focusDetectDOMRef:wn(),activeCellIndicatorDOMRef:wn(),onColumnMenuClick:me(),cellContextMenu:me(),contextMenu:me(),onFilterOperatorMenuClick:me(),flashingDurationCSSVarValue:null,onFlashingDurationCSSVarChange:me(),onRowHeightCSSVarChange:me(),onRowDetailHeightCSSVarChange:me(),onColumnHeaderHeightCSSVarChange:me(),cellClick:me(),cellMouseDown:me(),keyDown:me(),bodySize:{width:0,height:0},scrollPosition:{scrollTop:0,scrollLeft:0},columnReorderDragColumnId:!1,columnReorderInPageIndex:null,ready:!1,focused:!1,focusedWithin:!1,columnsWhenGrouping:e,columnVisibilityForGrouping:{},pinnedStartScrollListener:new Mo,pinnedEndScrollListener:new Mo,columnsWhenInlineGroupRenderStrategy:void 0,editingCell:null,forceBodyRerenderTimestamp:0}}var _d=o=>({debugId:1,scrollTopKey:1,components:1,id:1,loadingText:1,pivotColumns:1,groupColumn:1,onReady:1,domProps:1,onKeyDown:1,onCellClick:1,onCellDoubleClick:1,focusedClassName:1,focusedWithinClassName:1,focusedStyle:1,focusedWithinStyle:1,onSelfFocus:1,onFocusWithin:1,onSelfBlur:1,onBlurWithin:1,onContextMenu:1,onCellContextMenu:1,onRenderRangeChange:1,onRowMouseEnter:1,onRowMouseLeave:1,onScrollToTop:1,onScrollToBottom:1,onScrollStop:1,scrollToBottomOffset:1,getColumnMenuItems:1,getCellContextMenuItems:1,getContextMenuItems:1,columnPinning:1,editable:1,columnDefaultEditable:1,columnDefaultFilterable:1,columnDefaultGroupable:1,columnDefaultSortable:1,keyboardShortcuts:1,rowStyle:1,cellStyle:1,rowProps:1,rowClassName:1,rowHoverClassName:1,cellClassName:1,repeatWrappedGroupRows:1,pinnedStartMaxWidth:1,pinnedEndMaxWidth:1,pivotColumn:1,pivotColumnGroups:1,getFilterOperatorMenuItems:1,onScrollbarsChange:1,autoSizeColumnsKey:1,wrapRowsHorizontally:1,columnDefaultFlex:1,draggableColumnsRestrictTo:t=>t??!1,columnMenuRealignDelay:t=>t??50,scrollStopDelay:t=>t??250,viewportReservedWidth:t=>t??0,resizableColumns:t=>t??!0,rowDetailCache:t=>new Mi(t),hideColumnWhenGrouped:t=>t??!1,columnMinWidth:t=>t??30,columnMaxWidth:t=>t??5e3,columnDefaultWidth:t=>t??200,columnCssEllipsis:t=>t??!0,draggableColumns:1,columnDefaultDraggable:1,headerOptions:t=>({alwaysReserveSpaceForSortIcon:!0,...t}),showSeparatePivotColumnForSingleAggregation:t=>t??!1,sortable:1,hideEmptyGroupColumns:t=>t??!1,pivotTotalColumnPosition:t=>t??"end",pivotGrandTotalColumnPosition:1,licenseKey:t=>t||"",keyboardSelection:t=>t??!0,activeRowIndex:1,activeCellIndex:1,columnOrder:t=>t??!0,header:t=>t??!0,showZebraRows:t=>t??!0,showHoverRows:t=>t??!0,virtualizeColumns:t=>t??!0,rowHeight:t=>typeof t=="number"||typeof t=="function"?t:0,rowDetailHeight:t=>typeof t=="number"||typeof t=="function"?t:300,columnHeaderHeight:t=>typeof t=="number"?t:30,columns:1,columnVisibility:t=>t??Dd,columnGroupVisibility:t=>t??Dd,columnSizing:t=>t||{},columnTypes:t=>t||{},onEditCancelled:1,onEditRejected:1,onEditAccepted:1,persistEdit:1,shouldAcceptEdit:1,onEditPersistError:1,onEditPersistSuccess:1,multiSortBehavior:t=>t??"replace",collapsedColumnGroups:t=>t??new Map,columnGroups:1});function Nh(o){let{groupBy:t,groupColumn:e,groupRenderStrategy:n}=o;return n||(e!=null&&typeof e=="object"?"single-column":(t.filter(r=>r.column).length,"multi-column"))}var Md=o=>{o.brain.destroy(),o.headerBrain.destroy(),o.renderer.destroy(),o.headerRenderer.destroy(),o.onRenderUpdater.destroy(),o.headerOnRenderUpdater.destroy(),o.onFlashingDurationCSSVarChange.destroy(),o.onRowHeightCSSVarChange.destroy(),o.onColumnHeaderHeightCSSVarChange.destroy(),o.onColumnMenuClick.destroy(),o.onFilterOperatorMenuClick.destroy(),o.domRef.current=null,o.columnMenuTargetRef.current=null,o.scrollerDOMRef.current=null,o.portalDOMRef.current=null,o.onRowDetailHeightCSSVarChange.destroy(),o.pinnedEndScrollListener.destroy(),o.pinnedStartScrollListener.destroy()};function Ed(o){return o.reduce((t,e,n)=>{let i={groupBy:e,groupIndex:n};return e.field?t.set(e.field,i):e.groupField&&t.set(e.groupField,i),t},new Map)}var Hi=new WeakMap;function Fd(){return{rowDetailState:(o,t)=>({callbackParams:[o,{expandRow:t.lastRowToExpandRef.current,collapseRow:t.lastRowToCollapseRef.current}]})}}var Nd=o=>{let{props:t,state:e,oldState:n,parentState:i}=o,r=e.pivotColumnGroups||e.columnGroups,a=e.columnGroups&&e.columnGroups!=n?.columnGroups||e.columnGroups&&e.columnGroupVisibility!=n?.columnGroupVisibility||e.pivotColumnGroups&&e.pivotColumnGroups!=n?.pivotColumnGroups?md(r,e.columnGroupVisibility):e.columnGroupsDepthsMap,l=i?.groupBy,u=Nh({groupRenderStrategy:t.groupRenderStrategy,groupBy:l,groupColumn:t.groupColumn}),s,d=t.rowDetailRenderer,c=t.components?.RowDetail;if(!d&&c){let g=Hi.get(c);g||(g=gd(c),Hi.set(c,g)),d=g}d&&(s=t.rowDetailState||e.rowDetailState||t.defaultRowDetailState,s&&!(s instanceof yt)&&(s=new yt(s)),s=s||new yt({expandedRows:[],collapsedRows:!0}));let f=e.columnsWhenGrouping||e.columnsWhenInlineGroupRenderStrategy||e.columns,m=s?t.isRowDetailExpanded:void 0;!m&&s&&(m=Hi.get(s),m||(m=g=>s.isRowDetailsExpanded(g.id),typeof s=="object"&&Hi.set(s,m)));let p=d?t.isRowDetailEnabled||!0:!1,h={updatedAt:Date.now(),isTree:i.isTree,rowDetailRenderer:d,rowDetailState:s,isRowDetailExpanded:m,isRowDetailEnabled:p,showColumnFilters:t.showColumnFilters??!!i.filterValue,controlledColumnVisibility:!!t.columnVisibility,groupRenderStrategy:u,groupBy:l,computedColumns:f,initialColumns:t.columns,keyboardNavigation:t.keyboardNavigation??(e.activeCellIndex!=null?"cell":e.activeRowIndex!=null?"row":"cell"),columnHeaderCssEllipsis:t.columnHeaderCssEllipsis??t.columnCssEllipsis??!0,columnGroupsDepthsMap:a,columnGroupsMaxDepth:a!=e.columnGroupsDepthsMap?Math.max(...a.values(),-1):e.columnGroupsMaxDepth,computedColumnGroups:r,rowHeightCSSVar:typeof t.rowHeight=="string"?t.rowHeight:"",rowDetailHeightCSSVar:typeof t.rowDetailHeight=="string"?t.rowDetailHeight:"",columnHeaderHeightCSSVar:typeof t.columnHeaderHeight=="string"?t.columnHeaderHeight||xe.components.Header.columnHeaderHeight:""};if(e.devToolsDetected&&e.debugId){let g=ra.get(e.debugId);g&&(h={...h,...g})}return h};function Od(o,t){let e={};return Object.keys(o).forEach(n=>{let i=o[n],r=i;if(!r.groupByForColumn||Array.isArray(r.groupByForColumn))return;let{groupByForColumn:a}=r,l=a.field||a.groupField;l&&t.get(l)&&(e[n]=i)}),e}function kd(o){let{hideEmptyGroupColumns:t,groupByMap:e,computedGroupColumns:n,groupRowsIndexesInDataArray:i,dataArray:r,groupBy:a}=o,l={...o.columnVisibility};if(!t)return Object.keys(n).forEach(c=>{l[c]===!1&&delete l[c]}),l;if(!i||!i.length)return l;let u=a.length,s=0,d=i.length;for(let c=0;c<d;c++){let f=i[c],m=r[f];if(!m.isTreeNode&&m.isGroupRow&&(s=Math.max(s,m.groupNesting-1),s===u-1))break}return Object.keys(n).forEach(c=>{let f=n[c],{groupByForColumn:m}=f;if(Array.isArray(m))return;let p=m.field||m.groupField;if(!p)return;e.get(p).groupIndex>s&&t?l[c]!==!1&&(l[c]=!1):l.hasOwnProperty(c)&&delete l[c]}),l}var Oh=10;function Ld(o,t){let{includeHeader:e,columnsToResize:n,columnsToSkip:i}=t,r=`.${Ot} > .${ri}`,a=o.current?.querySelectorAll(r),l={},u={};return a&&a.length&&a.forEach(s=>{let d=s.parentElement,c=d.matches(`.${pn}`);if(e===!1&&c)return;let f=d.getAttribute("data-column-id"),m=s.cloneNode(!0);m.style.visibility="hidden",m.style.pointerEvents="none",m.classList.remove(...It.split(" ")),m.style.position="absolute",m.style.width="auto",d.appendChild(m);let p=m.offsetWidth;if(d.removeChild(m),!u[f]){let h=Ve().getComputedStyle(d);u[f]=parseInt(h.paddingLeft,10)+parseInt(h.paddingRight,10)+parseInt(h.borderLeftWidth,10)+parseInt(h.borderRightWidth,10)+Oh}if(p+=u[f],c){let h=0;d.childNodes.forEach(g=>{if(g!==s&&g.nodeType===1){let b=g,C=Math.max(b.offsetWidth,parseInt(b.style.width,10));if(isNaN(C)&&(C=0),h+=C,C>0){let T=Ve().getComputedStyle(b);h+=parseInt(T.marginLeft,10)+parseInt(T.marginRight,10)}}}),p+=h}i&&i.has(f)||n&&!n.has(f)||(l[f]=Math.max(p,l[f]||0))}),l}var zd="InfiniteTable";var eo=require("vue");var Vd=o=>o.dataSourceHasGrouping&&o.isGroupRow&&o.childrenLoading||!o.selfLoaded;var qt=require("vue");var Gd="_96uiwi0 _16lm1iw1d _16lm1iwk _16lm1iw9",Kd=ve({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 Hd="M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z",Bd=Object.keys({size:1,expanded:1,defaultExpanded:1,onChange:1,style:1,disabled:1,className:1,direction:1});var Bi=`${mt}-expand-collapse`,vn=(0,qt.defineComponent)(o=>{let t=()=>o.expanded!==void 0,e=(0,qt.ref)(o.expanded??o.defaultExpanded??!1);(0,qt.watch)(()=>o.expanded,i=>{t()&&(e.value=!!i)});let n=()=>{o.onChange?.(!e.value),t()||(e.value=!e.value)};return()=>{let i=e.value?"expanded":"collapsed",{size:r=24,direction:a="start",disabled:l=!1}=o;return(0,qt.h)("svg",{"data-name":"expand-collapse-icon","data-state":i,"data-disabled":l,xmlns:"http://www.w3.org/2000/svg",height:`${r}px`,viewBox:"0 0 24 24",width:`${r}px`,style:o.style,onClick:l?void 0:n,class:ne(o.className,Gd,Kd({direction:a||"start",expanded:e.value,disabled:l}),`${mt}`,`${Bi}`,`${Bi}--${i}`,`${Bi}--${a==="end"?"end":"start"}`,l?`${Bi}--disabled`:"")},[(0,qt.h)("path",{d:Hd})])}},{name:"ExpandCollapseIcon",props:[...Bd]});var Qn=require("vue");var Wd="_16lm1iwb _16lm1iw1d _16lm1iwk";var jd="164.93361431346415 56.97787143782138",$d={margin:"auto",display:"block",shapeRendering:"auto"},Ud=Object.keys({size:1,style:1,className:1,viewBox:1});var qd=(0,Qn.defineComponent)(o=>()=>(0,Qn.h)("svg",{xmlns:"http://www.w3.org/2000/svg",style:{...$d,...o.style},width:"24px",height:"24px",viewBox:o.viewBox??"0 0 100 100",preserveAspectRatio:"xMidYMid",class:ne(o.className,Wd,"InfiniteIcon","InfiniteIcon-loading")},[(0,Qn.h)("circle",{cx:"50",cy:"50",fill:"none","stroke-width":"10",r:"35","stroke-dasharray":jd},[(0,Qn.h)("animateTransform",{attributeName:"transform",type:"rotate",repeatCount:"indefinite",dur:"1s",values:"0 50 50;360 50 50",keyTimes:"0;1"})])]),{name:"LoadingIcon",props:[...Ud]});var Yd=ve({defaultClassName:"_7pupv01",variantClassNames:{align:{start:"_7pupv02",center:"_7pupv03",end:"_7pupv04"}},defaultVariants:{},compoundVariants:[]}),Zd="_7pupv00",Xd=ve({defaultClassName:"_7pupv05",variantClassNames:{align:{start:"_7pupv06",center:"_7pupv07",end:"_7pupv08"}},defaultVariants:{},compoundVariants:[]});function Jd(o,t,e,n){let{groupByForColumn:i,groupIndexForColumn:r,groupRenderStrategy:a}=o,l=i.column?{...i.column}:{},u={header:`Group by ${i.field||i.groupField}`,groupByForColumn:i,render:n.getGroupColumnRender({groupIndexForColumn:r,groupRenderStrategy:a}),...l,renderGroupIcon:n.getGroupColumnRenderGroupIcon({initialRenderGroupIcon:l?.renderGroupIcon,groupIndexForColumn:r,toggleGroupRow:t,groupRenderStrategy:a})};return e&&(typeof e=="function"?u={...u,...e(o,t)}:u={...u,...e}),u}function Qd(o,t,e,n){let i=typeof e=="function"?e(o,t):e,r={};return o.sortable!=null&&(r.sortable=o.sortable),{...r,header:"Group",groupByForColumn:o.groupBy,renderSelectionCheckBox:o.selectionMode==="multi-row",render:n.getGroupColumnRender({groupIndexForColumn:0,groupRenderStrategy:"single-column"}),...i,renderGroupIcon:n.getGroupColumnRenderGroupIcon({initialRenderGroupIcon:i?.renderGroupIcon,groupIndexForColumn:0,toggleGroupRow:t,groupRenderStrategy:"single-column"})}}var kh=U(W.columnZIndexAtIndex),Lh=U(W.columnVisibilityAtIndex);function ec({rowInfo:o}){return{[U(xe.components.Row.groupNesting)]:o.dataSourceHasGrouping?o.isGroupRow?o.groupNesting-1:o.groupNesting:0}}function zh({rowInfo:o}){return{[U(xe.components.Row.groupNesting)]:o.isTreeNode?o.isParentNode?o.treeNesting:o.treeNesting+1:0}}function Sa(o,t){return o?typeof o=="function"?o(t):o:void 0}function wa(o,t,e){return typeof t=="function"?{...o,...t(e)}:{...o,...t}}function tc(o){let{column:t,rowInfo:e,rowIndex:n,rowHeight:i,rowIndexInHorizontalLayoutPage:r,horizontalLayoutPageIndex:a,align:l,verticalAlign:u,stylingParam:s,formattedValueContext:d,groupByColumnReference:c,rowStyle:f,rowClassName:m,cellStyle:p,cellClassName:h,showZebraRows:g,rowActive:b,rowDisabled:C,rowSelected:T,cellSelected:v,cellSelection:S,getData:D,computedVisibleColumns:R,visibleColumnIds:E,computedColumnOrder:N,columnReorderInPageIndex:w}=o,P=E??R.map(Fe=>Fe.id),_=N,A,I={...d,visibleColumnIds:P,allColumnIds:_,rowIndex:n,get rowHasSelectedCells(){return A===void 0&&(A=e.hasSelectedCells(P)),A}},M=!!(e.isTreeNode&&(t.renderTreeIcon||t.renderTreeIconForLeafNode||t.renderTreeIconForParentNode)),F=typeof m=="function"?m(I):m,O;c?.className&&(O=Sa(c.className,s)),h&&(O=ne(O,Sa(h,s))),t.className&&(O=ne(O,Sa(t.className,s))),M&&(O=ne(O,Xd({align:l})));let z;e.dataSourceHasGrouping&&t.groupByForColumn&&(z=ec({rowInfo:e})),M&&(z=zh({rowInfo:e})),f&&(z=typeof f=="function"?{...z,...f(I)}:{...z,...f}),p&&(z=wa(z,p,s)),c?.style&&(z=wa(z,c.style,s)),t.style&&(z=wa(z,t.style,s)),z=z||{},z.height=i,z.zIndex=`var(${kh}-${t.computedVisibleIndex})`,z.visibility=`var(${Lh}-${t.computedVisibleIndex}, visible)`;let k=r!=null?r%2===1:(e.indexInAll!=null?e.indexInAll:n)%2===1,H=g?k?"odd":"even":!1,oe=!1,le=!1,q=!1,Re=!1;if(S&&v){let Fe=D(),be=Fe[e.indexInAll-1],De=Fe[e.indexInAll+1],ge=R[t.computedVisibleIndex+1],te=R[t.computedVisibleIndex-1];oe=be?!S.isCellSelected(be.id,t.id):!0,t.computedPinned==="end"&&t.computedFirstInCategory?le=!0:le=te?!S.isCellSelected(e.id,te.id):!0,t.computedPinned==="start"&&t.computedLastInCategory?q=!0:q=ge?!S.isCellSelected(e.id,ge.id):!0,Re=De?!S.isCellSelected(De.id,t.id):!0}let ye=S&&v?{top:oe,left:le,right:q,bottom:Re}:null,Pe=w!=null?a!==w:!1,je=ne(ye?nu(ye):"",Qo(t,[Dt,Ot],tu,{dragging:!1,insideDisabledDraggingPage:Pe,zebra:H,align:l,verticalAlign:u,rowDisabled:C,rowActive:b,cellSelected:v,rowSelected:T,treeNode:e.isTreeNode?e.isParentNode?"parent":"leaf":!1,firstRow:e.indexInAll===0,firstRowInHorizontalLayoutPage:r===0,groupRow:e.isGroupRow,groupCell:e.isGroupRow?!!t.groupByForColumn:!1,rowExpanded:e.isGroupRow?!e.collapsed:!1}),O,F);return{style:z,className:je,cellSelectionBorders:ye,zebra:H,columnIsTree:M}}function Vh({groupIndexForColumn:o,groupRenderStrategy:t}){return e=>{let{rowInfo:n,renderBag:i,column:r,align:a}=e,{value:l,groupIcon:u,selectionCheckBox:s}=i,d=n,c=ne($o.flex,r.align==="end"?vr.rowReverse:vr.row,Sl.center,`${Dt}Expander`,t==="single-column"||t==="multi-column"&&(!n.isGroupRow||s)?Yd({align:a}):null);return t==="multi-column"&&o+1!==d.groupNesting&&d.isGroupRow?s?(0,eo.h)("div",{class:c},[s]):null:(0,eo.h)("div",{class:c},[u,s,(0,eo.h)("div",{class:It},[l??null])])}}function Gh({groupIndexForColumn:o,groupRenderStrategy:t,toggleGroupRow:e,initialRenderGroupIcon:n}){return i=>{let{rowInfo:r,value:a,rootGroupBy:l,pivotBy:u,column:s}=i,d=t!=="inline"?r:r.isGroupRow&&r.parents?.[o]||r;if(!d)return null;let c=d.collapsed;if(t==="inline"){if(d.groupCount===1)return a;if(d.groupNesting===o&&c)return null}else if(!d.isGroupRow||t==="multi-column"&&o+1!==d.groupNesting)return null;let f=d.groupKeys,m=null,p=u?(d.groupKeys?.length||0)<l?.length:(d.groupKeys?.length||0)<=l?.length;return Vd(d)?m=(0,eo.h)(qd):p&&(m=(0,eo.h)(vn,{expanded:!c,direction:s.align==="end"?"end":"start",onChange:()=>{e(f)}})),n&&(i.renderBag.groupIcon=m,m=n(i)),m}}function nc(){return{getGroupColumnRender:Vh,getGroupColumnRenderGroupIcon:Gh}}function oc(o,t,e){return Jd(o,t,e,nc())}function ic(o,t,e){return Qd(o,t,e,nc())}function rc(o){let{pivotColumns:t,groupBy:e,pivotBy:n,selectionMode:i,groupColumn:r,pivotTotalColumnPosition:a,pivotGrandTotalColumnPosition:l,pivotColumn:u,groupRenderStrategy:s,toggleGroupRow:d,columns:c}=o;if(s==="inline")return{columns:void 0,groupColumnIds:[]};let f={},m=[];if(s==="multi-column")e.forEach((p,h,g)=>{let b=oc({groupByForColumn:p,groupBy:e,pivotBy:n,groupIndexForColumn:h,groupCount:g.length,groupRenderStrategy:s,selectionMode:i},d,r),C=b.id||`group-by-${p.field||p.groupField}`;m.push(C),f[C]=b});else if(s==="single-column"&&e.length){let p=ic({groupCount:e.length,groupBy:e,pivotBy:n,groupRenderStrategy:s,selectionMode:i},d,r),h=p.id||"group-by";m.push(h),f[h]=p}if(t){let p={};Object.keys(c).forEach(h=>{let g=c[h];g.field&&(p[g.field]=g)}),Object.keys(t).forEach(h=>{let g=t[h],b=g.pivotTotalColumn&&g.columnGroup,C=g.pivotTotalColumn&&!g.columnGroup;if(b&&a===!1||C&&l===!1)return;let T={...g};u&&(typeof u=="function"?T={...T,...u({column:T,pivotBy:n,groupBy:e})}:T={...T,...u}),T.inheritFromColumn!==!1&&(T={...typeof T.inheritFromColumn=="string"?c[T.inheritFromColumn]:T.pivotAggregator?.field?p[T.pivotAggregator?.field]:void 0,...T}),!T.render&&T.renderValue&&(T.render=v=>T.renderValue(v)),f[h]=T})}else Object.keys(c).forEach(p=>{let h=c[p];f[p]=h});return{columns:Object.keys(f).length?f:void 0,groupColumnIds:m}}function Kh(o){return typeof o.field=="string"}function ac(o){let{column:t,rowInfo:e,fieldsToColumn:n}=o,i;if(t.groupByForColumn){if(e.isGroupRow){let r=e.groupBy[e.groupBy.length-1];i=r?n.get(r.field||r.groupField):void 0}!i&&t.field&&(i=n.get(t.field))}return i}function Gt(o){let{getComputed:t,getDataSourceState:e,getState:n,rowIndex:i,columnId:r,api:a,dataSourceApi:l}=o,{dataArray:u}=e(),s=u[i],{isGroupRow:d,isTreeNode:c}=s,f=t().computedColumnsMap.get(r),{activeRowIndex:m,keyboardNavigation:p,isRowDetailEnabled:h}=n(),g=i===m&&p==="row",b=!h||typeof h=="function"&&!h(s)?!1:a.rowDetailApi.isRowDetailExpanded(s.id)?"expanded":"collapsed",{formattedValue:C,formattedValueContext:{rawValue:T}}=to({column:f,rowInfo:s,rowDetailState:b,columnsMap:t().computedColumnsMap,context:o}),v=at(f.id,o);return d?{api:a,dataSourceApi:l,column:f,columnApi:v,isParentNode:!1,isGroupRow:!0,isTreeNode:!1,nodeExpanded:!1,rowDetailState:!1,data:s.data,rowActive:g,rowInfo:s,rowSelected:s.rowSelected,value:C,rawValue:T}:c?s.isParentNode?{api:a,dataSourceApi:l,columnApi:v,column:f,nodeExpanded:s.nodeExpanded,isTreeNode:!0,isGroupRow:!1,isParentNode:!0,rowDetailState:b,data:s.data,rowActive:g,rowInfo:s,rowSelected:s.rowSelected,value:C,rawValue:T}:{api:a,dataSourceApi:l,columnApi:v,column:f,nodeExpanded:!1,isTreeNode:!0,isGroupRow:!1,isParentNode:!1,rowDetailState:b,data:s.data,rowActive:g,rowInfo:s,rowSelected:s.rowSelected,value:C,rawValue:T}:{api:a,dataSourceApi:l,columnApi:v,column:f,isTreeNode:!1,isParentNode:!1,isGroupRow:!1,nodeExpanded:!1,rowDetailState:b,data:s.data,rowActive:g,rowInfo:s,rowSelected:s.rowSelected,value:C,rawValue:T}}function lc(o){return uc(o.column,o.rowInfo)}function sc(o){let{column:t,context:e,rowInfo:n,visibleColumnIds:i}=o,r=ac({rowInfo:n,column:t,fieldsToColumn:o.fieldsToColumn,groupRenderStrategy:e.getState().groupRenderStrategy}),{getState:a}=e,{editingCell:l}=a(),u=to(o),{formattedValueContext:s}=u,d=e.api.isEditorVisibleForCell({columnId:t.id,rowIndex:n.indexInAll}),c=Object.assign({rowIndexInHorizontalLayoutPage:o.rowIndexInHorizontalLayoutPage,horizontalLayoutPageIndex:o.horizontalLayoutPageIndex,column:o.column,inEdit:d,rowHasSelectedCells:!1},s,{editError:l&&l.primaryKey===n.id&&l.columnId===t.id&&!l.active&&l.accepted instanceof Error?l.accepted:void 0});Object.defineProperty(c,"rowHasSelectedCells",{get(){return n.hasSelectedCells(i)}});let f=typeof t.align=="function"?t.align({isHeader:!1,...c}):t.align??"start",m=typeof t.verticalAlign=="function"?t.verticalAlign({isHeader:!1,...c}):t.verticalAlign??"center";return{inEdit:d,stylingParam:c,formattedValueContext:s,renderFunctions:{renderGroupIcon:t.renderGroupIcon||r?.renderGroupIcon,renderSelectionCheckBox:t.renderSelectionCheckBox,renderRowDetailIcon:t.renderRowDetailIcon,renderTreeIcon:t.renderTreeIcon,renderTreeIconForParentNode:t.renderTreeIconForParentNode,renderTreeIconForLeafNode:t.renderTreeIconForLeafNode,renderValue:t.renderValue||r?.renderValue,renderGroupValue:t.renderGroupValue||r?.renderGroupValue,renderLeafValue:t.renderLeafValue||r?.renderLeafValue},renderParams:Hh({rowIndexInHorizontalLayoutPage:o.rowIndexInHorizontalLayoutPage,horizontalLayoutPageIndex:o.horizontalLayoutPageIndex,column:o.column,rowInfo:o.rowInfo,visibleColumnIds:o.visibleColumnIds,columnsMap:o.columnsMap,fieldsToColumn:o.fieldsToColumn,context:o.context,align:f,verticalAlign:m,formattedValueContext:s}),groupByColumnReference:r}}function Hh(o){let{column:t,context:e,rowInfo:n,align:i,verticalAlign:r,visibleColumnIds:a,columnsMap:l,fieldsToColumn:u,formattedValueContext:s}=o,{value:d}=s,{api:c,getDataSourceState:f,getState:m,dataSourceApi:p}=e,{editingCell:h}=m(),{indexInAll:g}=n,b=f(),{selectionMode:C,cellSelection:T}=b,v=ac({rowInfo:n,column:t,fieldsToColumn:u,groupRenderStrategy:e.getState().groupRenderStrategy}),S=c.toggleGroupRow,D=T?.isCellSelected(n.id,t.id)??!1,R={column:t,columnsMap:l,fieldsToColumn:u,align:i,verticalAlign:r,cellSelected:D,rowHasSelectedCells:!1,horizontalLayoutPageIndex:o.horizontalLayoutPageIndex,rowIndexInHorizontalLayoutPage:o.rowIndexInHorizontalLayoutPage,...s,editError:h&&h.primaryKey===n.id&&h.columnId===t.id&&!h.active&&h.accepted instanceof Error?h.accepted:void 0,groupByColumn:v,selectionMode:C,api:c,dataSourceApi:p,toggleCurrentRowDetails:()=>c.rowDetailApi.toggleRowDetail(n.id),toggleRowDetails:c.rowDetailApi.toggleRowDetail,expandRowDetails:c.rowDetailApi.expandRowDetail,collapseRowDetails:c.rowDetailApi.collapseRowDetail,toggleCurrentTreeNode:()=>{p.treeApi.toggleNode(n.nodePath)},toggleTreeNode:p.treeApi.toggleNode,expandTreeNode:p.treeApi.expandNode,collapseTreeNode:p.treeApi.collapseNode,selectTreeNode:p.treeApi.selectNode,deselectTreeNode:p.treeApi.deselectNode,toggleTreeNodeSelection:p.treeApi.toggleNodeSelection,toggleCurrentTreeNodeSelection:()=>{n.isTreeNode&&p.treeApi.toggleNodeSelection(n.nodePath)},selectRow:c.rowSelectionApi.selectRow,deselectRow:c.rowSelectionApi.deselectRow,toggleRowSelection:c.rowSelectionApi.toggleRowSelection,toggleGroupRowSelection:c.rowSelectionApi.toggleGroupRowSelection,selectCell:()=>{c.cellSelectionApi.selectCell({rowId:n.id,colId:t.id})},deselectCell:()=>{c.cellSelectionApi.deselectCell({rowId:n.id,colId:t.id})},renderBag:{all:null,value:typeof d=="boolean"?`${d}`:d,selectionCheckBox:null,groupIcon:null,treeIcon:null},selectCurrentRow:()=>{if(!n.isTreeNode)return c.rowSelectionApi.selectRow(n.id,n.dataSourceHasGrouping?n.groupKeys:void 0)},deselectCurrentRow:()=>{if(!n.isTreeNode)return c.rowSelectionApi.deselectRow(n.id,n.dataSourceHasGrouping?n.groupKeys:void 0)},rowIndex:g,toggleGroupRow:S,toggleCurrentGroupRow:()=>{n.isGroupRow&&S(n.groupKeys)},toggleCurrentRowSelection:()=>{if(!(n.isGroupRow||n.isTreeNode))return c.rowSelectionApi.toggleRowSelection(n.id)},toggleCurrentGroupRowSelection:()=>{if(n.isGroupRow)return c.rowSelectionApi.toggleGroupRowSelection(n.isGroupRow?n.groupKeys:[])},rootGroupBy:b.groupBy,pivotBy:b.pivotBy};return Object.defineProperty(R,"rowHasSelectedCells",{get(){return n.hasSelectedCells(a)}}),R}function uc(o,t){let{data:e,isGroupRow:n,dataSourceHasGrouping:i}=t,r=i?t.groupBy:void 0,a=n&&r&&o.groupByForColumn&&(Array.isArray(o.groupByForColumn)||o.groupByForColumn===r[r.length-1])?t.value:Kh(o)?e?.[o.field]:null;return o.field&&t.isGroupRow&&t.reducerData&&t.reducerData[o.field]!=null&&(a=t.reducerData[o.field]),o.valueGetter&&!t.isGroupRow&&t.data&&(a=o.valueGetter({data:t.data,field:o.field})),a}function Bh(o,t,e,n,i){let{rowSelected:r,indexInAll:a}=e,{activeRowIndex:l,keyboardNavigation:u}=n.getState(),s=a===l&&u==="row";return e.isGroupRow?{rowInfo:e,isGroupRow:!0,isTreeNode:!1,isParentNode:!1,nodeExpanded:!1,data:e.data,rowDetailState:!1,rowSelected:r,rowActive:s,value:o,rawValue:o,field:t.field}:e.isTreeNode?e.isParentNode?{rowInfo:e,isGroupRow:!1,isTreeNode:!0,isParentNode:!0,nodeExpanded:e.nodeExpanded,data:e.data,rowDetailState:i,rowSelected:r,rowActive:s,value:o,rawValue:o,field:t.field}:{rowInfo:e,isGroupRow:!1,isTreeNode:!0,isParentNode:!1,nodeExpanded:!1,data:e.data,rowDetailState:i,rowSelected:r,rowActive:s,value:o,rawValue:o,field:t.field}:{rowInfo:e,isGroupRow:!1,isTreeNode:!1,isParentNode:!1,nodeExpanded:!1,data:e.data,rowDetailState:i,rowSelected:r,rowActive:s,value:o,rawValue:o,field:t.field}}function to(o){let{column:t,rowInfo:e,context:n,rowDetailState:i}=o,r=uc(t,e),a=Bh(r,t,e,n,i),l=t.valueFormatter?t.valueFormatter(a):r;return a.value=l,{formattedValue:l,formattedValueContext:a}}function va(o){let{getComputed:t,getState:e,actions:n}=o,i=e().columnMenuVisibleForColumnId;if(!i)return;let r=t(),a=r.computedVisibleColumnsMap,l=r.computedColumnOrder;if(a.has(i)){n.columnMenuVisibleKey=Date.now();return}function u(m,p){let h=l[s+m*p],g=a.get(h);if(g&&g.renderMenuIcon!==!1)return h}let s=l.indexOf(i),d=0,c=-1,f;for(;!f&&d<l.length&&(d++,f=u(d,c),f||(c*=-1,f=u(d,c)),!f););return f&&(n.columnMenuVisibleForColumnId=f),f}function Wi(o,t){let{rowIndex:e,colIndex:n}=o,{rowIndex:i,colIndex:r}=t,[a,l]=n>r?[r,n]:[n,r],[u,s]=e>i?[i,e]:[e,i];return[{rowIndex:u,colIndex:a},{rowIndex:s,colIndex:l}]}function Ia(o,t,e){let{rowsPerPage:n}=e;return n?Math.floor(o.rowIndex/n)===Math.floor(t.rowIndex/n):!0}function dc(o,t,e){if(Ia(o,t,e))throw"You should not call this when the positions are in the same page";let{rowsPerPage:n,columnsPerSet:i}=e;if(n===0)throw"rowsPerPage cannot be 0";let r=o,a=t;Math.floor(o.rowIndex/n)>Math.floor(t.rowIndex/n)&&(r=t,a=o);let{rowIndex:l,colIndex:u}=r,{rowIndex:s,colIndex:d}=a,c=Math.floor(l/n),f=Math.floor(s/n),m=l%n,p=s%n,h=Math.min(m,p),g=Math.max(m,p),b=[];for(let C=c;C<=f;C++)for(let T=h;T<=g;T++){let v=C*n+T;if(C===c)for(let S=u;S<i;S++)b.push({rowIndex:v,colIndex:S});else if(C===f)for(let S=0;S<=d;S++)b.push({rowIndex:v,colIndex:S});else for(let S=0;S<i;S++)b.push({rowIndex:v,colIndex:S})}return b}function Wh(o,t){let e=new Set(o);return t.map(n=>e.has(n)?n:null).filter(n=>n!=null)}var Ra=class{constructor(t){this.getCellSelectionPosition=t=>{let e=t.rowId??ln(t.rowIndex,this.getDataSourceState)?.id,n=t.colId??this.getComputed().computedVisibleColumns[t.colIndex].id;return[e,n]};this.setRangeSelected=(t,e,n)=>{let i=this.getDataSourceState(),r=i.cellSelection;if(!r)return;let a=new He(r);a.debugId=i.debugId??"";let[l,u]=this.getCellSelectionPosition(t),[s,d]=this.getCellSelectionPosition(e),c=this.getComputed().computedVisibleColumnsMap.get(u),f=this.getComputed().computedVisibleColumnsMap.get(d);if(!c||!f)return;let m=c.computedVisibleIndex,p=f.computedVisibleIndex,h=ln(l,this.getDataSourceState),g=ln(s,this.getDataSourceState);if(!h||!g)return;let b=h.indexInAll,C=g.indexInAll,[T,v]=Wi({rowIndex:b,colIndex:m},{rowIndex:C,colIndex:p});for(let S=T.rowIndex;S<=v.rowIndex;S++)for(let D=T.colIndex;D<=v.colIndex;D++){let R={rowIndex:S,colIndex:D},[E,N]=this.getCellSelectionPosition(R);n?a.selectCell(E,N):a.deselectCell(E,N)}this.dataSourceActions.cellSelection=a};this.getCellSelectionPositionsWithFn=(t,e)=>{let n=gi(this.getDataSourceState),{computedVisibleColumns:i}=this.getComputed(),r=i.map(c=>c.id),a=new Set,l=[],u=new Set;n.filter(c=>{i.forEach(f=>{this.isCellSelected({rowId:c.id,colId:f.id})&&(a.has(f.id)||a.add(f.id),u.has(c.id)||(u.add(c.id),l.push(c)))})});let s=Wh(Array.from(a),r),d=l.map(c=>s.map(f=>this.isCellSelected({rowId:c.id,colId:f})?t(c,f):e));return{columnIds:s,positions:d}};this.getAllCellSelectionPositions=()=>this.getCellSelectionPositionsWithFn((t,e)=>[t.id,e],null);this.mapCellSelectionPositions=(t,e)=>this.getCellSelectionPositionsWithFn(t,e);this.deselectAll=()=>{let t=this.getDataSourceState(),e=t.cellSelection;if(!e)return;let n=new He(e);n.debugId=t.debugId??"",n.deselectAll(),this.dataSourceActions.cellSelection=n};this.clear=()=>{this.deselectAll()};this.selectAll=()=>{let t=this.getDataSourceState(),e=t.cellSelection;if(!e)return;let n=new He(e);n.debugId=t.debugId??"",n.selectAll(),this.dataSourceActions.cellSelection=n};this.selectRange=(t,e)=>{this.setRangeSelected(t,e,!0)};this.deselectRange=(t,e)=>{this.setRangeSelected(t,e,!1)};this.isCellSelected=t=>{let[e,n]=this.getCellSelectionPosition(t);return this.getDataSourceState().cellSelection?.isCellSelected(e,n)??!1};this.selectCell=t=>{let e=this.getDataSourceState(),n=e.cellSelection;if(!n)return;let[i,r]=this.getCellSelectionPosition(t),a=t.clear?new He:new He(n);a.debugId=e.debugId??"",a.selectCell(i,r),this.dataSourceActions.cellSelection=a};this.deselectCell=t=>{let e=this.getDataSourceState(),n=e.cellSelection;if(!n)return;let[i,r]=this.getCellSelectionPosition(t),a=new He(n);a.debugId=e.debugId??"",a.deselectCell(i,r),this.dataSourceActions.cellSelection=a};this.selectColumn=(t,e)=>{e?.clear&&this.deselectAll();let n=this.getDataSourceState(),i=n.cellSelection;if(!i)return;let r=new He(i);r.debugId=n.debugId??"",r.selectColumn(t),this.dataSourceActions.cellSelection=r};this.deselectColumn=t=>{let e=this.getDataSourceState(),n=e.cellSelection;if(!n)return;let i=new He(n);i.debugId=e.debugId??"",i.deselectColumn(t),this.dataSourceActions.cellSelection=i};this.getComputed=t.getComputed,this.getDataSourceState=t.getDataSourceState,this.dataSourceActions=t.dataSourceActions}};function cc(o){return new Ra(o)}function fc(o){let{dataSourceApi:t,getState:e,actions:n}=o,i={collapseAllDetails(){n.rowDetailState=new yt({collapsedRows:!0,expandedRows:[]})},expandAllDetails(){n.rowDetailState=new yt({expandedRows:!0,collapsedRows:[]})},isRowDetailCollapsed(r){let a=e().isRowDetailExpanded;if(!a)return!0;let l=t.getRowInfoByPrimaryKey(r);return l?!a(l):!0},isRowDetailEnabledForRow(r){let{isRowDetailEnabled:a}=e();if(!a)return!1;if(typeof a=="function"){let l=t.getRowInfoByPrimaryKey(r);return l?a(l):!1}return!0},isRowDetailExpanded(r){return!i.isRowDetailCollapsed(r)},collapseRowDetail(r){let a=e(),l=a.rowDetailState;if(!l){console.error("Cannot collapse row details via rowDetailState, as no props.rowDetailState is provided.");return}let u=new yt(l);u.collapseRowDetails(r),a.lastRowToExpandRef.current=null,a.lastRowToCollapseRef.current=r,n.rowDetailState=u},expandRowDetail(r){let a=e(),l=a.rowDetailState;if(!l){console.error("Cannot expand row details via rowDetailState, as no props.rowDetailState is provided.");return}let u=new yt(l);u.expandRowDetails(r),a.lastRowToCollapseRef.current=null,a.lastRowToExpandRef.current=r,n.rowDetailState=u},toggleRowDetail(r){i.isRowDetailExpanded(r)?i.collapseRowDetail(r):i.expandRowDetail(r)}};return i}function un(o,t,e){return Math.min(Math.max(o,t),e)}function ji(o,t,e){let n=o().dataArray,i=0,r=n.length-1,a=t;do{a+=e;let l=n[a];if(!l)return a<i?i:r;if(!l.rowDisabled)return a}while(a>=i&&a<=r);return un(a,i,r)}function jh(o,t){let{getState:e,getDataSourceState:n,actions:i,api:r,dataSourceApi:a}=o,{key:l}=t,u=n().dataArray,s=u.length,d=e(),{brain:c}=d,{activeRowIndex:f}=d;if(f==null)return!1;let{start:[m],end:[p]}=c.getRenderRange(),h=f,g=p-m-1,b=0,C=s-1,T={ArrowDown:()=>{f=ji(n,f,1)},ArrowUp:()=>{f=ji(n,f,-1)},ArrowLeft:()=>{let S=u[f];if(c.isHorizontalLayoutBrain){let D=c.rowsPerPage;f-D>=b?f=f-D:T.ArrowUp();return}return S&&S.isGroupRow?r.collapseGroupRow(S.groupKeys):S&&r.rowDetailApi.isRowDetailEnabledForRow(S.id)?r.rowDetailApi.collapseRowDetail(S.id):!1},ArrowRight:()=>{let S=u[f];if(c.isHorizontalLayoutBrain){let D=c.rowsPerPage;f+D<=C?f=f+D:T.ArrowDown();return}return S&&S.isGroupRow?r.expandGroupRow(S.groupKeys):S&&r.rowDetailApi.isRowDetailEnabledForRow(S.id)?r.rowDetailApi.expandRowDetail(S.id):!1},Enter:()=>{let S=u[f];return S&&S.isGroupRow?r.toggleGroupRow(S.groupKeys):S&&S.isTreeNode&&S.isParentNode?a.treeApi.toggleNode(S.nodePath):r.rowDetailApi.isRowDetailEnabledForRow(S.id)?r.rowDetailApi.toggleRowDetail(S.id):!1},PageDown:()=>{f=Math.min(f+g,s-1)},PageUp:()=>{f=Math.max(f-g,b)},End:()=>{f=C},Home:()=>{f=b}},v=T[l];return v?(v(),h!==f?(i.activeRowIndex=f,!0):!1):!1}function xa(o,t){let{api:e,getState:n,getComputed:i,getDataSourceState:r,dataSourceApi:a}=o,{key:l,shiftKey:u}=t,s=r().dataArray,d=n(),{activeCellIndex:c,brain:f}=d;if(!c)return!1;let[m,p]=c,{start:[h,g],end:[b,C]}=f.getRenderRange(),T=b-h-1,v=C-g-1,S=r().dataArray.length-1,D=i().computedVisibleColumns.length-1,R=0,E=0;m=un(m,0,S),p=un(p,0,D);let N={ArrowDown:()=>{m=un(m+1,R,S)},ArrowUp:()=>{m=un(m-1,R,S)},ArrowLeft:()=>{if(p===E)if(m!==R&&(p=D),f.isHorizontalLayoutBrain){let P=f.rowsPerPage;m-P>=R?m=m-P:N.ArrowUp()}else N.ArrowUp();else p=un(p-1,E,D)},ArrowRight:()=>{if(p===D)if(m!==S&&(p=E),f.isHorizontalLayoutBrain){let P=f.rowsPerPage;m+P<=S?m=m+P:N.ArrowDown()}else N.ArrowDown();else p=un(p+1,E,D)},Enter:()=>{let P=s[m];return P&&P.isGroupRow?e.toggleGroupRow(P.groupKeys):P&&P.isTreeNode&&P.isParentNode?a.treeApi.toggleNode(P.nodePath):P&&e.rowDetailApi.isRowDetailEnabledForRow(P.id)?e.rowDetailApi.toggleRowDetail(P.id):!1},PageDown:()=>{u?p=Math.min(p+v,D):m=Math.min(m+T,S)},PageUp:()=>{u?p=Math.max(p-v,E):m=Math.max(m-T,R)},End:()=>{u?p=D:m=S},Home:()=>{u?p=E:m=R}},w=N[l];return w?(w(),[m,p]):!1}function $h(o,t){let e=xa(o,t);return e?(o.actions.activeCellIndex=e,!0):!1}var Uh={ArrowUp:!0,ArrowDown:!0,ArrowLeft:!0,ArrowRight:!0,PageUp:!0,PageDown:!0,Home:!0,End:!0,Enter:!0," ":!0};function pc(o,t){let{key:e}=t,{getState:n}=o,i=n(),{activeRowIndex:r,activeCellIndex:a,keyboardNavigation:l,cellContextMenuVisibleFor:u,contextMenuVisibleFor:s}=i;return u||s||!Uh[e]?!1:r!=null&&l==="row"?jh(o,t):a!=null&&l==="cell"?$h(o,t):!1}var Pa=class{constructor(t){this.param=t}setKeyboardNavigation(t){this.param.actions.keyboardNavigation=t}setActiveCellIndex(t){this.param.actions.activeCellIndex=t}setActiveRowIndex(t){this.param.actions.activeRowIndex=t}gotoRowWithDirection(t){let{getDataSourceState:e,getState:n}=this.param,{activeRowIndex:i,keyboardNavigation:r}=n();if(r!=="row")return console.error("Keyboard navigation is not enabled for rows"),!1;if(i==null)return!1;let a=ji(e,i,t);return a!==i?(this.param.actions.activeRowIndex=a,a):!1}gotoRow(t){return this.gotoRowWithDirection(t)}gotoNextRow(){return this.gotoRow(1)}gotoPreviousRow(){return this.gotoRow(-1)}gotoCell(t){let{direction:e}=t,n=e=="top"?"ArrowUp":e=="bottom"?"ArrowDown":e=="left"?"ArrowLeft":"ArrowRight",i=xa(this.param,{key:n,shiftKey:!1});return i===!1?!1:(this.param.actions.activeCellIndex=i,i)}};function mc(o){return new Pa(o)}function hc(o,t){return o.id?o.id===t.id:!!(o.field&&o.field===t.field)}var Da=class{constructor(t){this.columnApiById=new Map;this.getVisibleRenderRange=()=>this.getState().brain.getRenderRange();this.hideFilterOperatorMenu=()=>{this.actions.filterOperatorMenuVisibleForColumnId=null};this.setGroupRenderStrategy=t=>{this.actions.groupRenderStrategy=t};this.getColumnOrder=()=>this.getComputed().computedColumnOrder;this.getComputedColumnById=t=>this.getComputed().computedColumnsMap.get(t);this.getVisibleColumnOrder=()=>{let t=this.getColumnOrder(),e=this.getComputed().computedVisibleColumnsMap;return t.filter(n=>e.has(n))};this.persistEdit=async t=>{t=t??{};let{editingCell:e,editingValueRef:n}=this.getState();if(!e)return Promise.resolve(new Error("no edit in progress"));await new Promise(c=>requestAnimationFrame(c));let i=this.getComputed().computedColumnsMap.get(e.columnId),r=t.value??e.value;!e.active&&e.waiting!=="persist"&&(this.actions.editingCell={...e,active:!1,waiting:"persist"});let a={...Gt({rowIndex:e.rowIndex,columnId:e.columnId,...this.context,api:this}),value:r,initialValue:e.initialValue},l=r;n.current=null,i.getValueToPersist&&(l=await i.getValueToPersist(a)),a.value=l,e.value=l;let u=this.getState().persistEdit??(()=>{if(!a.column.field)return r;let c=this.getDataSourceState().primaryKey,f=a.data&&typeof c=="string"?{[c]:a.data[c],[a.column.field]:l}:{...a.data,[a.column.field]:l};return this.context.dataSourceApi.updateData(f)}),s;try{s=await u(a)}catch(c){s=c}let d=s instanceof Error?s:!0;return this.actions.editingCell={...e,active:!1,accepted:!1,waiting:!1,persisted:d},Promise.resolve(d)};this.clearEditInfo=()=>{this.actions.editingCell=null};this.isEditInProgress=()=>{let{editingCell:t}=this.getState();return t?t.active:!1};this.isEditorVisibleForCell=t=>{let{rowIndex:e,columnId:n}=t,{dataArray:i}=this.getDataSourceState(),{editingCell:r}=this.getState(),a=i[e];return!a||!r?!1:r.columnId===n&&r.primaryKey===a.id&&!!(r.active||r.waiting)};this.confirmEdit=t=>this.stopEdit({value:t});this.stopEdit=async t=>{let e=this.getState(),{editingCell:n,editingValueRef:i}=e;if(!n)return!0;t||(t={});let r=t.value??i.current;if(!t.cancel&&!t.reject){let{rowIndex:a,columnId:l}=n;this.actions.editingCell={...e.editingCell,value:r,active:!1,waiting:"accept"};let{computedColumnsMap:u}=this.getComputed(),s=u.get(l),d=e.shouldAcceptEdit??s.shouldAcceptEdit,c=d?d({...Gt({...this.context,api:this,dataSourceApi:this.context.dataSourceApi,columnId:l,rowIndex:a}),value:r,initialValue:n.initialValue}):!0;return await new Promise(f=>requestAnimationFrame(f)),Promise.resolve(c).then(f=>{if(f===!0)return this.actions.editingCell={...e.editingCell,active:!1,accepted:!0,persisted:!1,waiting:"persist",value:r},!0;throw f}).catch(f=>(f instanceof Error||(f=new Error(`Edit rejected: ${f}`)),this.actions.editingCell={...n,value:r,persisted:!1,active:!1,waiting:!1,accepted:f},{reject:f,value:r}))}return t.cancel&&n?.active?(this.actions.editingCell={...n,active:!1,cancelled:!0,waiting:!1,persisted:!1},{cancel:!0,value:r}):t.reject&&n?.active?(this.actions.editingCell={...n,value:r,active:!1,persisted:!1,waiting:!1,accepted:t.reject},{reject:t.reject,value:r}):!0};this.cancelEdit=()=>this.stopEdit({cancel:!0});this.rejectEdit=t=>this.stopEdit({reject:t});this.getColumnAtIndex=t=>this.getComputed().computedVisibleColumns[t]??null;this.isCellEditable=t=>{let{rowIndex:e,primaryKey:n,columnId:i}=t,r=e??this.context.dataSourceApi.getIndexByPrimaryKey(n),{computedColumnsMap:a}=this.getComputed(),l=a.get(i);if(!l||!l.computedEditable||l.groupByForColumn)return Promise.resolve(!1);let u=this.getDataSourceState().dataArray[r];if(!u||u.isGroupRow)return Promise.resolve(!1);if(l.computedEditable===!0)return Promise.resolve(!0);let s=l.computedEditable(Gt({...this.context,api:this,columnId:i,rowIndex:r}));return typeof s=="boolean"?Promise.resolve(s):s};this.getColumnApi=t=>{let e=typeof t=="string"?t:this.getComputed().computedVisibleColumns[t]?.id,n=this.columnApiById.get(e);if(n)return n;let i=at(t,{...this.context,api:this});return i&&this.columnApiById.set(i.getColumnId(),i),i};this.isColumnSortable=t=>this.getColumnApi(t)?.isSortable()??!1;this.getCellValue=t=>this.getCellValues(t)?.value??null;this.getCellValues=t=>{let{rowIndex:e,primaryKey:n,columnId:i}=t,{dataSourceApi:r,getState:a}=this.context,{computedColumnsMap:l}=this.getComputed(),u=e??r.getIndexByPrimaryKey(n),s=l.get(i),d=r.getRowInfoByIndex(u),c=d?.id;if(!d||!s)return s||console.warn(`No column found with id: "${i}"`),d||console.warn(`No row found with index: "${u}" or primary key: "${c}"`),null;let f=this,{isRowDetailEnabled:m}=a(),p=!m||typeof m=="function"&&!m(d)?!1:this.rowDetailApi.isRowDetailExpanded(d.id)?"expanded":"collapsed",h=to({column:s,rowInfo:d,columnsMap:l,context:{...this.context,api:f},rowDetailState:p});return{value:h.formattedValueContext.value,formattedValue:h.formattedValue,rawValue:h.formattedValueContext.rawValue}};this.getVerticalRenderRange=()=>{let t=this.getState().brain.getRenderRange();return{renderStartIndex:t.start[0],renderEndIndex:t.end[0]}};this.setColumnOrder=t=>{this.actions.columnOrder=t};this.setVisibilityForColumnGroup=(t,e)=>{let n={...this.getState().columnGroupVisibility};e?delete n[t]:n[t]=!1,this.actions.columnGroupVisibility=n};this.collapseAllGroupRows=()=>{let t=this.getDataSourceState(),e=new Ct(t.groupRowsState);e.collapseAll(),this.dataSourceActions.groupRowsState=e};this.collapseGroupRow=t=>this.getDataSourceState().groupRowsState.isGroupRowExpanded(t)?(this.toggleGroupRow(t),!0):!1;this.expandGroupRow=t=>this.getDataSourceState().groupRowsState.isGroupRowCollapsed(t)?(this.toggleGroupRow(t),!0):!1;this.toggleGroupRow=t=>{let e=this.getDataSourceState(),n=new Ct(e.groupRowsState);if(n.toggleGroupRow(t),this.dataSourceActions.groupRowsState=n,e.lazyLoad){let i=[Kn,...t],r=e.originalLazyGroupData.get(i);n.isGroupRowExpanded(t)?r?.cache||jn(e.data,e,this.dataSourceActions,{groupKeys:t},this.context.getDataSourceMasterContext()):r?.cache||(e.lazyLoadCacheOfLoadedBatches.getKeysStartingWith(t).forEach(l=>{e.lazyLoadCacheOfLoadedBatches.delete(l)}),this.dataSourceActions.lazyLoadCacheOfLoadedBatches=$.clone(e.lazyLoadCacheOfLoadedBatches),e.originalLazyGroupData.delete(i),this.dataSourceActions.originalLazyGroupDataChangeDetect=jt())}};this.toggleSortingForColumn=(t,e)=>{if(!this.getComputed().computedColumnsMap.get(t))return;let i=this.getSortingForColumn(t);i===null?i=1:i=i===1?-1:null,this.setSortingForColumn(t,i,e)};this.getState=()=>this.context.getState();this.getComputed=()=>this.context.getComputed();this.getDataSourceState=()=>this.context.getDataSourceState();this.scrollCellIntoView=(t,e,n={offset:0})=>{let i=this.getState(),r=this.getComputed(),a=e;if(typeof e=="string"){let h=r.computedVisibleColumnsMap.get(e);if(!h)return!1;a=h.computedVisibleIndex}if(i.brain.isHorizontalLayoutBrain){n=n||{};let h=i.brain.getPageIndexForRow(t);n.horizontalLayoutPageIndex=h||0}let l=i.renderer.getScrollPositionForScrollColumnIntoView(a,n),u=i.renderer.getScrollPositionForScrollRowIntoView(t,n);if(!l||!u)return!1;let s={scrollLeft:l.scrollLeft,scrollTop:u.scrollTop},d=i.brain.getScrollPosition(),c=i.brain.scrollLeftMax,f=i.brain.scrollTopMax;if(c<0&&f<0)return!0;let m=s.scrollLeft>c+(n.offset||0),p=s.scrollTop>f+(n.offset||0);return m&&p?!1:(s.scrollLeft!==d.scrollLeft&&!m&&(i.scrollerDOMRef.current.scrollLeft=s.scrollLeft),s.scrollTop!==d.scrollTop&&!p&&(i.scrollerDOMRef.current.scrollTop=s.scrollTop),!0)};this.context=t,this.rowSelectionApi=bl({dataSourceActions:t.dataSourceActions,getDataSourceState:t.getDataSourceState}),this.keyboardNavigationApi=mc({getState:t.getState,getDataSourceState:t.getDataSourceState,actions:t.actions,getComputed:t.getComputed,api:this,dataSourceApi:t.dataSourceApi}),this.rowDetailApi=fc({getState:t.getState,actions:t.actions,dataSourceApi:t.dataSourceApi}),this.cellSelectionApi=cc({dataSourceActions:t.dataSourceActions,getDataSourceState:t.getDataSourceState,getComputed:t.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(t){let e={actions:this.actions,getState:this.getState,getComputed:this.getComputed},n=this.getState().columnMenuRealignDelay;(!n||n<0)&&(va(e),t?.()),setTimeout(()=>{this.isDestroyed()||(va(e),t?.())},n)}isDestroyed(){return!this.getState().domRef.current}async startEdit(t){let{columnId:e,rowIndex:n,primaryKey:i,value:r}=t,a=n??this.context.dataSourceApi.getIndexByPrimaryKey(i);return this.isCellEditable({rowIndex:a,columnId:e}).then(async l=>{if(l){let u=this.getDataSourceState().dataArray,d=this.getComputed().computedColumnsMap.get(e),c=u[a],f=r??lc({column:d,rowInfo:c}),m=f;d.getValueToEdit&&(f=await d.getValueToEdit(Gt({...this.context,rowIndex:a,columnId:e,api:this}))),this.actions.editingCell={active:!0,accepted:!1,persisted:!1,columnId:e,value:f,initialValue:m,rowIndex:a,primaryKey:u[a]?.id}}return l})}setSortingForColumn(t,e,n){let{computedColumnsMap:i}=this.getComputed(),r=i.get(t);if(!r||this.getSortingForColumn(t)===e&&this.getDataSourceState().multiSort===!1)return;if(e===null){this.setSortInfoForColumn(t,null,n);return}let l=r.groupByForColumn,u=r.field,s=l?Array.isArray(l)?l:[l]:[],d=s.map(m=>m.valueGetter?p=>m.valueGetter({data:p,field:m.field}):m.field?m.field:m.groupField??void 0).filter(Wn);d.length&&(u=d);let c=r.computedSortType;s.length&&c===_n&&(c=s.flatMap(p=>{let h=p.field??p.groupField,g=h?i.get(h):null;return g?g.computedSortType:_n}));let f={dir:e,id:r.id,field:u,type:c};r.valueGetter&&(f.valueGetter=m=>r.valueGetter({data:m,field:r.field})),this.setSortInfoForColumn(t,f,n)}setSortInfoForColumn(t,e,n){let i=this.getDataSourceState(),r=this.getComputed().computedColumnsMap.get(t);if(!r)return;if(!i.multiSort){this.dataSourceApi.setSortInfo(e?[e]:null);return}let a=r.field,l={id:t,field:a},u=i.sortInfo?.slice()??[];if(e===null){u=u.filter(c=>!hc(c,l)),this.dataSourceApi.setSortInfo(u);return}let s=!1;if((n?.multiSortBehavior??this.getState().multiSortBehavior)==="replace"){this.dataSourceApi.setSortInfo([e]);return}u=u.map(c=>s?c:hc(c,l)?(s=!0,e):c),s||u.push(e),this.dataSourceApi.setSortInfo(u)}getSortTypeForColumn(t){let e=this.getComputed().computedColumnsMap.get(t);return e?e.computedSortType:null}getSortInfoForColumn(t){let e=this.getComputed().computedColumnsMap.get(t);return e?e.computedSortInfo:null}getSortingForColumn(t){let e=this.getSortInfoForColumn(t);return e?e.dir:null}setPinningForColumn(t,e){let n={...this.getState().columnPinning};e===!1?delete n[t]:n[t]=e,this.actions.columnPinning=n}setColumnFilter(t,e){let n=this.getComputed().computedColumnsMap.get(t);if(!n)return;let i=this.getDataSourceState(),{filterTypes:r}=i,a;if(n.computedFilterValue)a={...n.computedFilterValue,filter:{...n.computedFilterValue.filter}};else{let l=n.computedFilterType;if(!r[l])return;let u={filter:{type:l,value:e,operator:r[l].defaultOperator},valueGetter:n.valueGetter};(n.field||typeof n.groupByForColumn=="string")&&(u.field=n.field||n.groupByForColumn),a=u}a.id=n.id,a.filter.value=e,this.setFilterValueForColumn(t,a)}setColumnFilterOperator(t,e){let n=this.getComputed().computedColumnsMap.get(t);if(!n)return;let i=this.getDataSourceState(),{filterTypes:r}=i,a=n.computedFilterType,l=r[a].operators,u=l.find(c=>c.name===e)??l.find(c=>c.name===r[a].defaultOperator),s=u.name,d;n.computedFilterValue?(d={...n.computedFilterValue,filter:{...n.computedFilterValue.filter,operator:s}},u.defaultFilterValue!==void 0&&(d.filter.value=u.defaultFilterValue)):(d={filter:{operator:s,type:a,value:u.defaultFilterValue!==void 0?u.defaultFilterValue:[...r[a].emptyValues.values()][0]},valueGetter:n.valueGetter},n.field&&(d.field=n.field)),d.id=n.id,this.setFilterValueForColumn(t,d)}setFilterValueForColumn(t,e){let n=this.getComputed().computedColumnsMap.get(t);if(!n)return;let r=this.getDataSourceState().filterValue??[],a=!1;r=r.map(l=>l===n.computedFilterValue?(a=!0,e):l),a||r.push(e),this.dataSourceActions.filterValue=r}removeColumnFilter(t){let e=this.getComputed().computedColumnsMap.get(t);if(!e)return;let i=this.getDataSourceState().filterValue??[],r=!1;i=i.filter(a=>a===e.computedFilterValue?(r=!0,!1):!0),r&&(this.dataSourceActions.filterValue=i)}clearColumnFilter(t){let e=this.getComputed().computedColumnsMap.get(t);if(!e)return;let n=this.getDataSourceState(),i=n.filterValue??[],r=!1;i=i.map(a=>{if(a===e.computedFilterValue){let l=e.computedFilterValue.filter.type,u=n.operatorsByFilterType[l],s=n.filterTypes[l];if(r=!0,!s)return null;let d=a.filter.operator??s?.defaultOperator,f=u[d].defaultFilterValue??(s.emptyValues||[])[0]??void 0;return{...a,filter:{...a.filter,operator:d,value:f}}}return a}).filter(Wn),r&&(this.dataSourceActions.filterValue=i)}setVisibilityForColumn(t,e){let n={...this.getState().columnVisibility};e?delete n[t]:n[t]=!1,this.actions.columnVisibility=n}getVisibleColumnsCount(){return this.getComputed().computedVisibleColumns.length}setColumnVisibility(t){this.actions.columnVisibility=t}get scrollContainer(){return this.getState().scrollerDOMRef.current}get scrollLeftMax(){return this.getState().brain.scrollLeftMax}get scrollTopMax(){return this.getState().brain.scrollTopMax}get scrollLeft(){return this.getState().brain.getScrollPosition().scrollLeft}set scrollLeft(t){let e=this.getState();e.scrollerDOMRef.current&&(e.scrollerDOMRef.current.scrollLeft=Math.max(t,0))}get scrollTop(){return this.getState().brain.getScrollPosition().scrollTop}set scrollTop(t){let e=this.getState();e.scrollerDOMRef.current&&(e.scrollerDOMRef.current.scrollTop=Math.max(t,0))}scrollRowIntoView(t,e={offset:0}){let n=this.getState(),i=this.getComputed(),r=n.brain.getScrollPosition(),a=e.columnId,l;!a&&n.brain.isHorizontalLayoutBrain&&i.computedVisibleColumns.length>0&&(a=i.computedVisibleColumns[Math.ceil(i.computedVisibleColumns.length/2)].id,l=i.computedVisibleColumnsMap.get(a)?.computedVisibleIndex);let u=n.renderer.getScrollPositionForScrollRowIntoView(t,{...e,colIndex:l});if(!u)return!1;let s=n.brain.scrollTopMax,d=u.scrollLeft!==r.scrollLeft,c=u.scrollTop<=s+(e.offset||0);return!c&&!d?!1:(c&&u.scrollTop!==r.scrollTop&&(n.scrollerDOMRef.current.scrollTop=u.scrollTop),d&&(n.scrollerDOMRef.current.scrollLeft=u.scrollLeft),!0)}scrollColumnIntoView(t,e={offset:0}){let n=this.getState(),r=this.getComputed().computedVisibleColumnsMap.get(t);if(!r)return!1;let a=r.computedVisibleIndex,l=n.renderer.getScrollPositionForScrollColumnIntoView(a,e);if(!l)return!1;let u=n.brain.getScrollPosition(),s=n.brain.scrollLeftMax;return l.scrollLeft>s+(e.offset||0)?!1:(l.scrollLeft!==u.scrollLeft&&(n.scrollerDOMRef.current.scrollLeft=l.scrollLeft),!0)}};function gc(o){return new Da(o)}function yc(o,t){return o<t?[o,t]:[t,o]}var $i=class{constructor(t){this.multiSelectStartIndex=0;this.getIdForIndex=t.getIdForIndex,this.isRowDisabledAt=t.isRowDisabledAt}set rowSelectionState(t){this._rowSelectionState=t}get rowSelectionState(){return this._rowSelectionState}selectRange(t,e){let[n,i]=yc(t,e),r=this.rowSelectionState;for(let a=n;a<=i;a++){let l=this.getIdForIndex(a);this.isRowDisabledAt(a)||r.selectRow(l)}}deselectRange(t,e){let[n,i]=yc(t,e),r=this.rowSelectionState;for(let a=n;a<=i;a++){let l=this.getIdForIndex(a);this.isRowDisabledAt(a)||r.deselectRow(l)}}resetClick(t){this.rowSelectionState.deselectAll();let e=this.getIdForIndex(t);this.rowSelectionState.selectRow(e),this.multiSelectStartIndex=t,this.multiSelectEndIndex=void 0}singleAddClick(t){let e=this.getIdForIndex(t);if(this.rowSelectionState.isRowSelected(e))this.rowSelectionState.deselectRow(e),this.rowSelectionState.isRowSelected(this.getIdForIndex(t+1))&&(this.multiSelectStartIndex=t+1);else{this.rowSelectionState.selectRow(e),this.multiSelectStartIndex=t;let n;for(let i=t-1;i>=0;i--){let r=this.getIdForIndex(i);if(this.rowSelectionState.isRowSelected(r))n=i;else break}this.multiSelectEndIndex=n}}multiSelectClick(t){this.multiSelectEndIndex!=null&&this.deselectRange(this.multiSelectStartIndex,this.multiSelectEndIndex),this.selectRange(this.multiSelectStartIndex,t),this.multiSelectEndIndex=t}};var Ui=class{constructor(t){this.multiSelectStartPosition={rowIndex:0,colIndex:0};this.getPrimaryKeyByIndex=t.getPrimaryKeyByIndex,this.getColumnIdByIndex=t.getColumnIdByIndex}getCellSelectionPosition(t){let{rowIndex:e,colIndex:n}=t,i=this.getPrimaryKeyByIndex(e),r=this.getColumnIdByIndex(n);if(!(i===void 0||!r))return[i,r]}set cellSelectionState(t){this._cellSelectionState=t}get cellSelectionState(){return this._cellSelectionState}resetClick(t){this.cellSelectionState.deselectAll();let e=this.getCellSelectionPosition(t);e&&(this.cellSelectionState.deselectAll(),this.cellSelectionState.selectCell(...e),this.multiSelectStartPosition=t,this.multiSelectEndPosition=void 0)}singleAddClick(t){let e=this.getCellSelectionPosition(t);if(e)if(this.cellSelectionState.isCellSelected(...e)){this.cellSelectionState.deselectCell(...e);let n={rowIndex:t.rowIndex+1,colIndex:t.colIndex};this.getCellSelectionPosition(n)&&(this.multiSelectStartPosition=n)}else this.cellSelectionState.selectCell(...e),this.multiSelectStartPosition=t,this.multiSelectEndPosition=void 0}multiSelectClick(t,e){!this.multiSelectStartPosition||!this.getCellSelectionPosition(t)||(this.multiSelectEndPosition&&this.deselectRange(this.multiSelectStartPosition,this.multiSelectEndPosition,e),this.selectRange(this.multiSelectStartPosition,t,e),this.multiSelectEndPosition=t)}setRangeSelected(t,e,n,i){if(i.horizontalLayout&&!Ia(t,e,i)){dc(t,e,{rowsPerPage:i.rowsPerPage,columnsPerSet:i.columnsPerSet}).forEach(d=>{let c=this.getCellSelectionPosition({rowIndex:d.rowIndex,colIndex:d.colIndex});c&&(n?this.cellSelectionState.selectCell(...c):this.cellSelectionState.deselectCell(...c))});return}let[r,a]=Wi(t,e),l=this.getCellSelectionPosition(r),u=this.getCellSelectionPosition(a);if(!(!l||!u))for(let s=r.rowIndex;s<=a.rowIndex;s++)for(let d=r.colIndex;d<=a.colIndex;d++){let c=this.getCellSelectionPosition({rowIndex:s,colIndex:d});c&&(n?this.cellSelectionState.selectCell(...c):this.cellSelectionState.deselectCell(...c))}}deselectRange(t,e,n){this.setRangeSelected(t,e,!1,n)}selectRange(t,e,n){this.setRangeSelected(t,e,!0,n)}};var Yt=require("vue");var bc=en("CSSVariableWatch"),Cc=Qt("CSSVariableWatch"),Tc={position:"absolute",pointerEvents:"none",width:"0px",height:"0px",lineHeight:0,fontSize:0,overflow:"hidden"};var Oo=(0,Yt.defineComponent)({name:"CSSNumericVariableWatch",props:{varName:{type:String,required:!0},allowInts:{type:Boolean,default:!1},onChange:{type:Function,required:!0}},setup(o){let t={current:null},e=0,n=null;return(0,Yt.onMounted)(()=>{let i=t.current;if(!i)return;let r=i.getBoundingClientRect().height;r!=null?(e=r,Cc(`Variable ${o.varName} found and equals ${r}.`),o.onChange(r)):bc(`Specified variable ${o.varName} not found or does not have a numeric value.`),n=Yn(i,({height:a})=>{a!=null&&a!==e&&(e=a,o.onChange(a))})}),(0,Yt.onBeforeUnmount)(()=>{n?.(),n=null}),()=>{let i=o.varName.startsWith("var(")?o.varName:`var(${o.varName})`;return(0,Yt.h)("div",{"data-name":"css-variable-watcher","data-var":o.varName,style:Tc},[(0,Yt.h)("div",{ref:r=>{t.current=r??null},style:{height:o.allowInts?`calc(1px * ${i})`:i}})])}}});var Aa=o=>{let t=0;return(...e)=>{t&&cancelAnimationFrame(t),t=requestAnimationFrame(()=>{t=0,o(...e)})}};function Sc(o,t){_a(o,t),Yh(o,t),t.detail===2&&qh(o,t),o.getState().onCellClick?.(o,t)}function qh(o,t){if(To(t.target))return;let{onCellDoubleClick:e}=o.getState(),n={preventEdit:!1};if(e){let a=e(o,t);a&&typeof a=="object"&&(n={...n,...a})}if(n.preventEdit)return;let r=o.getComputed().computedVisibleColumns[o.colIndex];o.api.startEdit({rowIndex:o.rowIndex,columnId:r.id})}function Yh(o,t){let{getDataSourceState:e,getState:n,getComputed:i,rowIndex:r,colIndex:a,dataSourceActions:l}=o,u=e(),{selectionMode:s,cellSelection:d}=u;if(!d||s!=="multi-cell")return;let{multiCellSelector:c,computedVisibleColumns:f}=i(),{brain:m,debugId:p}=n(),{rowsPerPage:h}=m,g=f.length,b=new He(d);b.debugId=p??"",c.cellSelectionState=b;let C={rowIndex:r,colIndex:a};if(t.metaKey||t.ctrlKey)c.singleAddClick(C);else if(t.shiftKey){let T=!!n().wrapRowsHorizontally;c.multiSelectClick(C,T?{horizontalLayout:T,rowsPerPage:h,columnsPerSet:g}:{horizontalLayout:T})}else c.resetClick(C);l.cellSelection=b}function _a(o,t){let{rowIndex:e,getDataSourceState:n,getComputed:i,dataSourceActions:r,api:a,cloneRowSelection:l}=o,{multiRowSelector:u,renderSelectionCheckBox:s}=i(),d=n(),{selectionMode:c,groupBy:f,dataArray:m,isTree:p}=d;if(f.length||p||m[e]?.rowDisabled)return!1;if(c==="multi-row"){if(s&&!t.key)return!1;let{rowSelection:g}=d;if(g=l(g),u.rowSelectionState=g,g&&typeof g=="object")return t.shiftKey?u.multiSelectClick(e):t.metaKey||t.ctrlKey?u.singleAddClick(e):u.resetClick(e),r.rowSelection=g,!0}else if(c==="single-row"){let b=m[e].id;t.metaKey||t.ctrlKey?a.rowSelectionApi.toggleRowSelection(b):a.rowSelectionApi.selectRow(b)}return!1}function wc(o,t){t.detail!==2&&void 0}var Zh={Enter:!0," ":!0,a:!0};function vc(o,t){let{getState:e,getDataSourceState:n,dataSourceActions:i,api:r,dataSourceApi:a,cloneRowSelection:l,cloneTreeSelection:u}=o,{key:s,ctrlKey:d,metaKey:c}=t;if(!Zh[s])return!1;let f=e(),m=n(),{activeRowIndex:p,activeCellIndex:h,keyboardNavigation:g,keyboardSelection:b}=f,{selectionMode:C,groupBy:T,rowSelection:v,treeSelectionState:S,isTree:D}=m;if(b===!1)return!1;let R=g==="row"&&p!=null?p:g==="cell"&&h!=null?h[0]:null,E=R!=null?m.dataArray[R]:null;if(!E||R==null)return!1;if(C==="single-row"&&s===" ")return r.rowSelectionApi.toggleRowSelection(E.id),!0;if(C!=="multi-row")return!1;if(s==="a"&&(d||c)){if(D&&S){let w=u(S);return w.selectAll(),i.treeSelection=w,!0}let N=l(v);return N.selectAll(),i.rowSelection=N,!0}if(s===" "){if(T.length)return E.isGroupRow&&E.groupKeys?r.rowSelectionApi.toggleGroupRowSelection(E.groupKeys):r.rowSelectionApi.toggleRowSelection(E.id),!0;if(D){if(E.isTreeNode&&E.nodePath)return a.treeApi.toggleNodeSelection(E.nodePath),!0}else{let N={key:t.key,metaKey:t.metaKey,ctrlKey:t.ctrlKey,shiftKey:t.shiftKey,preventDefault:()=>t.preventDefault()},{renderSelectionCheckBox:w}=o.getComputed();return w&&(N.metaKey=!1,N.ctrlKey=!0),_a({...o,rowIndex:R},N)}}return!1}var Ic=["input","textarea","select","[tabindex]","a[href]","button","object"].join(", "),Rc=o=>Array.from(o.querySelectorAll(Ic)).filter(e=>!!e.offsetParent),Ma=o=>o.querySelector(Ic);var Pc=uo(kn());async function xc(o,t=10,e=300){return new Promise((n,i)=>{let r=Date.now();function a(){if(Date.now()-r>e)return i(!1);if(!o()){setTimeout(a,t);return}n(!0)}a()})}var Xh=10,Jh=(o,t)=>o-t;function Ea(o,t){let{getComputed:e,getDataSourceState:n,getState:i,api:r,dataSourceApi:a}=t,{editingCell:l,isRowDetailEnabled:u}=i(),{dataArray:s}=n(),{computedVisibleColumns:d,computedColumnsMap:c}=e(),f=d[o.colIndex];if(!f)return!1;if(l&&l.columnId===f.id&&l.rowIndex===o.rowIndex)return!0;if(!f.contentFocusable)return!1;if(f.contentFocusable===!0)return!0;let m=s[o.rowIndex],p=!u||typeof u=="function"&&!u(m)?!1:r.rowDetailApi.isRowDetailExpanded(m.id)?"expanded":"collapsed",h=at(f.id,t);return f.contentFocusable({column:f,...to({column:f,rowInfo:m,columnsMap:c,context:t,rowDetailState:p}).formattedValueContext,columnApi:h,api:r,dataSourceApi:a})}function Dc(o,t,e){let n=e.getState().editingCell;return Qh(o,t,e,{isCellFocusable:Ea,isColumnElligible:r=>n&&n.columnId===r.id?!0:!!r.contentFocusable})}function Ac(o,t,e){let n=(0,Pc.default)(e,o+t,Jh);return n<0&&(n=~n,t>0&&n>=e.length||t<0&&n===0)?null:e[n]??null}globalThis.getNextCol=Ac;function Qh(o,t,e,n){let{isColumnElligible:i,isCellFocusable:r}=n,a=e.getComputed().computedVisibleColumns.filter(i).reduce((c,f)=>(c.push(f.computedVisibleIndex),c),[]);if(!a.length)return null;let{getDataSourceState:l}=e,{dataArray:u}=l(),s=o.rowIndex,d=o.colIndex;for(;s!=null||d!=null;){if(d=d===null?a[t===-1?a.length-1:0]:Ac(d,t,a),d===null){if(s+=t,s<0||s>=u.length)return null;continue}if(r({colIndex:d,rowIndex:s},e))return{colIndex:d,rowIndex:s}}return null}async function _c([o,t],e){let{api:n}=e;return new Promise((i,r)=>{let a=Xh,l=null,u=!1;function s(d=0){d++,fn(l),l=Ke(async()=>{if(u=n.scrollCellIntoView(o,t,{offset:30}),!u&&d<a&&s(d),u){try{await xc(()=>!!e.getState().getDOMNodeForCell({rowIndex:o,colIndex:t}))}catch(c){r(c);return}i(!0)}})}s()})}var eg=`.${Dt}`;function Mc(o,t){if(t.key!=="Tab")return!1;let e=t.shiftKey?-1:1,n=t.target,i=o.getState().scrollerDOMRef.current,r=document.activeElement===i||n===i;if(!i||r&&e===-1)return!1;let a=r?null:Nn(n,eg),l=null,u=null;if(a)l=Number(a.getAttribute("data-row-index")),u=Number(a.getAttribute("data-col-index"));else if(r){let{activeCellIndex:d}=o.getState();[l,u]=d||[0,0]}if(l==null||u==null||isNaN(l)||isNaN(u))return!1;let s=r&&Ea({colIndex:u,rowIndex:l},o)?{rowIndex:l,colIndex:u}:Dc({rowIndex:l,colIndex:u},e,o);if(!s){if(e===-1)i.focus();else{let d=Rc(document.body),c=o.getState().focusDetectDOMRef.current,f=d.findIndex(p=>p===c);d[f+1]?.focus()}return!0}return _c([s.rowIndex,s.colIndex],o).then(()=>{let d=o.getState().getDOMNodeForCell(s);if(!d)return;Ma(d)?.focus()}),!0}var Ec={control:"ctrl"},Fc={"control|cmd":"ctrl","cmd|control":"ctrl","ctrl|cmd":"ctrl","cmd|ctrl":"ctrl"},tg={esc:"escape"},Oc={cmd:o=>o.metaKey,alt:o=>o.altKey,ctrl:o=>o.ctrlKey,shift:o=>o.shiftKey},kc=Object.keys(Oc),Fa=new Set(kc),ng=new Set(["shift","alt"]);function Lc(o,t){return Array.isArray(t)?t.some(e=>Nc(o,e)):Nc(o,t)}function Nc(o,t){let e=o.key.toLowerCase(),n=t.split("+").map(f=>f.toLowerCase().trim()),i=n.find(f=>Fc[f]),r=n.map(f=>Ec[f]||Fc[f]||tg[f]||f),a=r.filter(f=>Fa.has(f)),l=r.filter(f=>!Fa.has(f)),u=kc.reduce((f,m)=>(f[m]=Oc[m](o),f),{});i&&u.cmd&&(u.cmd=!1,u.ctrl=!0);let s=Object.keys(u).filter(f=>u[f]);if(!a.every(f=>u[f]===!0))return!1;if(l.includes("*")){if(s.length<a.length||s.filter(m=>!ng.has(m)).length)return!1}else if(a.length!=s.length)return!1;return!l.length||Fa.has(e)||e==="meta"||Ec[e]?!1:l.reduce((f,m)=>f?m==="*"||e===m:!1,!0)}async function zc(o,t){let e={...o,cloneRowSelection:a=>jo(a,o.getDataSourceState),cloneTreeSelection:a=>bi(a,o.getDataSourceState)},{onKeyDown:n}=o.getState(),i={preventEdit:!1,preventEditStop:!1,preventDefaultForTabKeyWhenEditing:!0,preventSelection:!1,preventNavigation:!1};if(n){let a=n(o,t);a&&typeof a=="object"&&(i={...i,...a})}if(!i.preventSelection&&vc(e,t)&&t.preventDefault(),(Mc(e,t)||!o.getState().focusedWithin&&!i.preventNavigation&&pc(e,t))&&t.preventDefault(),!i.preventEdit&&t.key==="Enter"&&!o.api.isEditInProgress()){let{activeCellIndex:a}=o.getState();if(a){let[l,u]=a,s=o.getComputed().computedVisibleColumns[u];s.computedEditable&&o.api.startEdit({rowIndex:l,columnId:s.id})}}o.api.isEditInProgress()&&(t.key==="Escape"&&!i.preventEditStop&&o.api.stopEdit({cancel:!0}),t.key==="Tab"&&i.preventDefaultForTabKeyWhenEditing&&t.preventDefault());let{keyboardShortcuts:r}=o.getState();if(r)for await(let a of r){if(!Lc(t,a.key)||a.when&&!await a.when(o))continue;let l=await a.handler(o,t);if(l&&l.stopNext)break}}var Zi=require("vue");var Ee=require("vue");var qi="__is_infinite_menu_component";function Na(o){return!!o.tagName}function Kc(o){let{alignTarget:t,alignAnchor:e,constrainTo:n,alignPosition:i}=o,r=Me.from(Na(t)?t.getBoundingClientRect():t),a=Me.from(Na(e)?e.getBoundingClientRect():e),l=n?Me.from(Na(n)?n.getBoundingClientRect():n):null;if(!l)return{...Vc({anchorRect:a,targetRect:r,position:i[0]}),index:0};let u=null;for(let s=0,d=i.length;s<d;s++){let c=Vc({anchorRect:a,targetRect:r,position:i[s],constrainRect:l});if(s===0&&(u={...c,index:0}),c.valid)return{...c,index:s}}return u}function Vc(o){let t=Me.from(o.targetRect),e=Me.from(o.anchorRect),n=o.constrainRect?Me.from(o.constrainRect):null,{position:i}=o,[r,a]=i,l=Gc(t,r),u=Gc(e,a),s=l.getDistanceToPoint(u);t.shift(s);let d=n?n.contains(t):!0;return{alignPosition:i,alignedRect:t,valid:d,distance:s}}function Gc(o,t){return t==="TopLeft"?Je.from({top:o.top,left:o.left}):t==="TopCenter"?Je.from({top:o.top,left:o.left+(o.width>0?Math.round(o.width/2):0)}):t==="TopRight"?Je.from({top:o.top,left:o.left+o.width}):t==="BottomLeft"?Je.from({left:o.left,top:o.top+o.height}):t==="BottomCenter"?Je.from({left:o.left+(o.width>0?Math.round(o.width/2):0),top:o.top+o.height}):t==="BottomRight"?Je.from({left:o.left+o.width,top:o.top+o.height}):t==="CenterLeft"?Je.from({left:o.left,top:o.top+(o.height>0?Math.round(o.height/2):0)}):t==="CenterRight"?Je.from({left:o.left+o.width,top:o.top+(o.height>0?Math.round(o.height/2):0)}):Je.from({left:o.left+(o.width>0?Math.round(o.width/2):0),top:o.top+(o.height>0?Math.round(o.height/2):0)})}function og(o){return o&&typeof o.then=="function"||o instanceof Promise}function Bc(o){return o==null||typeof o=="string"?!1:typeof o.tagName=="string"}async function Hc(o){return typeof o=="function"&&(o=o()),og(o)&&(o=await o),typeof o=="string"&&(o=document.querySelector(o)),o&&Bc(o)&&(o=o.getBoundingClientRect()),o?Me.from(o):null}async function Wc(o){let t=null;typeof o=="function"?t=o():t=o;function e(n){let i=null;return typeof n=="string"&&(i=document.querySelector(n)),Bc(n)&&(i=n),i||null}return e(await t)}async function Oa(o,t){let{constrainTo:e,alignTo:n,alignPosition:i}=t;Object.keys(n).length===2&&n.top!==void 0&&n.left!==void 0&&(n={...n,width:0,height:0}),typeof e=="boolean"&&(e=e?document.documentElement.getBoundingClientRect():void 0);let r=e&&await Hc(e)||void 0,a=n?await Hc(n):void 0,l=Me.from(o.getBoundingClientRect());if(!a)return;let{alignedRect:u}=Kc({constrainTo:r,alignAnchor:a,alignTarget:l,alignPosition:i});o.style.transform=`translate3d(${u.left}px,${u.top}px, 0px)`;let s=o.getBoundingClientRect();if(s.left!==u.left||s.top!==u.top){let d=o.offsetParent;if(d){let c=d.getBoundingClientRect(),f=c.left,m=c.top,p=u.left-f,h=u.top-m;o.style.transform=`translate3d(${p}px,${h}px, 0px)`}}}var ig=(0,Ee.defineComponent)({name:"OverlayContent",props:{handle:{type:Object,required:!0}},setup(o){let t=null,e=r=>{r&&r!==t&&Oa(r,o.handle),t=r??null},n=null,i=r=>{n?.(),n=r.realign.onChange(a=>{t&&a&&Oa(t,a)})};return(0,Ee.onMounted)(()=>i(o.handle)),(0,Ee.watch)(()=>o.handle,i),(0,Ee.onBeforeUnmount)(()=>{n?.()}),()=>(0,Ee.h)("div",{style:{position:"absolute",top:"0px",left:"0px"},ref:e},[o.handle.children()])}});function rg(o){return(0,Ee.isVNode)(o)?o.props?.id||o.key:null}function ag(o,t,e){if((0,Ee.isVNode)(o)&&o.type?.[qi]){let n={};return o.props?.portalContainer===void 0&&(n.portalContainer=t),o.props?.constrainTo===void 0&&(n.constrainTo=e),(0,Ee.cloneVNode)(o,n)}return o}function At(o){let t=o,e=new Map,n=(0,Ee.shallowRef)(e),i=()=>(0,Ee.triggerRef)(n),r=(s,d)=>{let f=`${d.id||rg(s)||jt()}`,m=e.get(f),p=b=>()=>{let C=typeof b=="function"?b():b;return ag(C,t.portalContainer,d.constrainTo??t.constrainTo)},h=p(s),g=(b,C)=>{if(!m)return;let T=p(b);Object.assign(m,{children:T}),i(),!!C?.skipRealign||(0,Ee.nextTick)(()=>{m&&e.get(m.key)===m&&m.realign(m)})};return m?(Object.assign(m,d),g(s),g):(m={key:f,children:h,alignPosition:d.alignPosition,alignTo:d.alignTo,constrainTo:d.constrainTo,realign:me()},e.set(m.key,m),i(),g)},a=s=>{s=`${s}`,e.has(s)&&(e.delete(s),i())},l=()=>{e.clear(),i()};return{portal:(0,Ee.defineComponent)({name:"OverlayPortal",setup(){let s=(0,Ee.shallowRef)(null),{portalContainer:d}=t;return d&&(async()=>{let c=await Wc(d);c!=null&&(s.value=c)})(),()=>{let c=[];for(let[f,m]of n.value)c.push((0,Ee.h)(ig,{handle:m,key:m.key}));return d?s.value?(0,Ee.h)(Ee.Teleport,{to:s.value},c):null:d===null||d===!1?c:(0,Ee.h)("div",{style:{position:"fixed",top:"0px",left:"0px"}},c)}}}),hideOverlay:a,clearAll:l,rerenderOverlays:i,showOverlay:r}}var of=require("vue");var We=require("vue");var jc="db3arf0 _16lm1iw0 _16lm1iw1 _16lm1iw1w _16lm1iw2f _16lm1iw8",$c=ve({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"]]}),Uc="db3arf1",qc="db3arfd";var Yc="submenu",lg="-";function Zc(){return{keyboardActiveItemKey:null,activeItemKey:null,generatedId:jt(),focused:!1,destroyed:!1,domRef:{current:null}}}function Xc(){return{parentMenuId:1,parentMenuItemKey:1,onHideIntent:1,constrainTo:1,onAction:1,onShow:1,onHide:1,autoFocus:1,wrapLabels:1}}var sg=({columns:o,keyboardActiveItemKey:t,activeItemKey:e,menuId:n},i,r)=>{let a=i&&(i.key!=null||i.label!=null)?i:null,l=a===null?i===lg?r.renderSeparator():i:null;return a!=null?{type:"item",parentMenuId:n,disabled:!!a.disabled,keyboardActive:a.key===t,active:a.key===e,value:a,span:a.span||1,key:a.key,menu:a.menu||null,style:a.style,className:a.className,originalMenuItem:a}:{type:"decoration",value:l,span:o.length,style:{gridColumnStart:1,gridColumnEnd:o.length+10}}},ug=[{name:"label"}],Jc=(o,t)=>{let{props:e,state:n}=o,{activeItemKey:i,keyboardActiveItemKey:r}=n,{items:a,children:l,addSubmenuColumnIfNeeded:u,parentMenuId:s}=e,d=e.id||n.generatedId;s&&(d=`${s}-${d}`);let c=[...e.columns||ug],f={columns:c,keyboardActiveItemKey:r??null,activeItemKey:i??null,menuId:d},m=[];a?m=a.map(h=>sg(f,h,t)):!a&&typeof l!="function"&&(m=t.childrenToRuntimeItems?t.childrenToRuntimeItems(f,l):[]),u&&m.filter(g=>g.type==="item"&&g.menu!=null).length>0&&!c.find(g=>g.name==Yc)&&c.push({name:Yc,render:t.renderSubmenuColumn});let p=m.filter(h=>h.type==="item"&&!h.disabled);return{runtimeItems:m,runtimeSelectableItems:p,columns:c,menuId:d}};function Qc(o,t){let e=ef(o,t);if(!e.length)return null;let n=Me.from(e[0]?.getBoundingClientRect()),i=Me.from(e[e.length-1].getBoundingClientRect()),r=n;return r.width=i.left+i.width-n.left,r}function ef(o,t){let e=Nn(document.querySelector(`[data-menu-id="${o}"] [data-menu-item-key="${t}"]`),`[data-menu-id="${o}"]`);if(!e)return[];let n=e.querySelectorAll(`[data-menu-item-key="${t}"]`);return Array.from(n)}function tf(o,t){let e=ef(o,t);if(!e.length)return null;for(let n of e){let i=n.querySelector('input[type="checkbox"]');if(i)return i}return null}var ko=class extends Fn{constructor(t){super(t.slice(0,3))}};var dg=250;function cg(o,t=100){let e=Date.now();return new Promise(n=>{let i,r=()=>{if(i=o(),i!==void 0){n(i);return}if(Date.now()-e>t){n(void 0);return}Ke(r)};Ke(()=>{r()})})}var fg=Ve(),Yi=class{constructor(t){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||dg;this.getPointerMoveTarget=()=>document.documentElement||fg;this.removePointerMoveListener=()=>{this.getPointerMoveTarget().removeEventListener("pointermove",this.onPointerMoveWhileActiveItem)};this.onPointerMoveWhileActiveItem=t=>{if(clearTimeout(this.mouseMoveTimeoutId),!t){this.lastPointerMoveTimestamp=Date.now();return}if(!this.currentHoveredItem||this.currentHoveredItem===this.activeItem)return;let e=Date.now();this.lastPointerMoveTimestamp||(this.lastPointerMoveTimestamp=e);let i=e-this.lastPointerMoveTimestamp>this.getTimeout();this.lastPointerMoveTimestamp=e;let r=()=>{this.setActiveItem(null,null),this.onItemChange(!0,this.currentHoveredItem,t)};if(i){r();return}let a=this.currentHoveredItem;this.mouseMoveTimeoutId=setTimeout(()=>{if(a!==this.currentHoveredItem)return;Date.now()-this.lastPointerMoveTimestamp>this.getTimeout()&&r()},this.getTimeout());let l=new Je({left:t.clientX,top:t.clientY});if(!this.activeItemMenuRect||!this.activeItemLeavePoint)return;let u=this.activeItemLeavePoint.left<this.activeItemMenuRect.left,d=(u?1:-1)*(l.left-this.activeItemLeavePoint.left);if(d-this.lastHorizontalDiff<0){this.lastHorizontalDiff=0,r();return}this.lastHorizontalDiff=d,(u?new ko([this.activeItemLeavePoint,this.activeItemMenuRect.getTopLeft(),this.activeItemMenuRect.getBottomLeft()]):new ko([this.activeItemLeavePoint,this.activeItemMenuRect.getTopRight(),this.activeItemMenuRect.getBottomRight()])).containsPoint(l)||(this.setActiveItem(null,null),this.onItemChange(!0,this.currentHoveredItem,t))};this.setupMenuLeaveTracking=()=>{this.menuLeaveTimeoutId=setTimeout(()=>{this.activeItem&&this.params.itemHasSubMenu(this.activeItem)||this.setActiveItem(null,null)},this.getTimeout())};this.setActiveItem=(t,e)=>{if(t!==this.activeItem){if(t==null){this.removePointerMoveListener(),this.params.onItemActivate(null,null),this.activeItem=null,this.activeItemMenuRect=null;return}this.activeItem=t,this.params.onItemActivate(t,e),this.activeItemMenuRect=null,cg(()=>this.activeItem!=t?!1:this.params.getMenuRectFor(t)).then(n=>{this.activeItem==t&&n&&(this.activeItemMenuRect=n)})}};this.onItemChange=(t,e,n)=>{if(clearTimeout(this.menuLeaveTimeoutId),clearTimeout(this.mouseMoveTimeoutId),!t){this.removePointerMoveListener(),e===this.activeItem&&(this.activeItemLeavePoint=new Je({left:n.clientX,top:n.clientY})),this.setupMenuLeaveTracking();return}if(this.currentHoveredItem=e,!this.activeItem||!this.params.itemHasSubMenu(this.activeItem)){this.setActiveItem(e,n.target);return}this.onPointerMoveWhileActiveItem(),this.getPointerMoveTarget().addEventListener("pointermove",this.onPointerMoveWhileActiveItem)};this.getHandlers=()=>({onItemEnter:(t,e)=>{this.onItemChange(!0,t,e)},onItemLeave:(t,e)=>{this.onItemChange(!1,t,e)}});this.params=t}};var pg={renderSeparator:()=>(0,We.h)("hr",{class:qc}),renderSubmenuColumn:(({domProps:o,item:t})=>t.menu?(0,We.h)("div",o,[(0,We.h)(vn,{expanded:!1})]):(0,We.h)("div",o))},{useManagedComponent:mg}=xn({initSetupState:Zc,forwardProps:()=>Xc(),mapPropsToState:o=>Jc(o,pg),debugName:"Menu"}),hg=(0,We.defineComponent)({name:"MenuRuntimeItem",props:{columns:{type:Array,required:!0},item:{type:Object,required:!0},index:{type:Number,required:!0},active:{type:Boolean,required:!0},keyboardActive:{type:Boolean,required:!0},onItemEnter:{type:Function,required:!1},onItemLeave:{type:Function,required:!1},onItemClick:{type:Function,required:!0}},setup(o){let t=(0,We.ref)(!1);return()=>{let{columns:e,item:n,index:i,active:r,keyboardActive:a}=o,l=n.type==="item"?n.value.key:i,u=null;if(n.type==="decoration")u=(0,We.h)("div",{style:n.style},[n.value]);else{let s=0;u=e.map((d,c)=>{let f=n.value,m=d.field||d.name,p=c+1,h=p+n.span;if(p<s)return null;s=h;let b={style:{...d.style,...n.style,gridColumnStart:p,gridColumnEnd:h},"data-menu-column-id":`${n.parentMenuId}-col-${d.name}`,"data-menu-col-name":`${d.name}`,"data-menu-row-id":`${n.parentMenuId}-row-${i}`,"data-menu-row-index":`${i}`,"data-menu-item-key":`${n.key}`,class:ne($c({active:r,disabled:!!n.disabled,keyboardActive:a,pressed:t.value||r}),n.className),onPointerenter:C=>{n.disabled||o.onItemEnter?.(n,C)},onPointerleave:C=>{n.disabled||o.onItemLeave?.(n,C)},onMousedown:()=>{n.disabled||(t.value=!0)},onMouseup:()=>{n.disabled||(t.value=!1)},onClick:C=>{n.disabled||o.onItemClick(C,n)}};return d.render?d.render({item:f,column:d,value:f[m],domProps:b}):(0,We.h)("div",{key:`${l}-${m}`,...b},[f[m]])}).filter(Boolean)}return(0,We.h)("div",{class:Uc},[u])}}}),_t=(0,We.defineComponent)({name:"InfiniteMenu",inheritAttrs:!1,props:{id:{type:String,required:!1},items:{type:Array,required:!1},columns:{type:Array,required:!1,default:void 0},portalContainer:{type:[String,Object,Function,Boolean],required:!1,default:void 0},constrainTo:{type:[String,Object,Function,Boolean],required:!1,default:void 0},wrapLabels:{type:Boolean,required:!1,default:!1},autoFocus:{type:Boolean,required:!1,default:void 0},addSubmenuColumnIfNeeded:{type:Boolean,required:!1,default:!0},bubbleActionsFromSubmenus:{type:Boolean,required:!1,default:!0},parentMenuId:{type:String,required:!1},parentMenuItemKey:{type:String,required:!1},onShow:{type:Function,required:!1},onHide:{type:Function,required:!1},onHideIntent:{type:Function,required:!1},onAction:{type:Function,required:!1}},setup(o,{attrs:t}){let{contextValue:e}=mg(o),n=e.state,i=e.componentActions,r=()=>n.value,a=P=>{i.keyboardActiveItemKey=P},l=P=>{i.activeItemKey=P},u=!1,s=()=>u,d=null,c=P=>{d=P},{showOverlay:f,portal:m,clearAll:p}=At({portalContainer:!1}),h=()=>{let P=r();P.onHideIntent?.(P)},g=()=>{i.focused=!0,setTimeout(()=>{let P=r().domRef.current;C&&P&&P===document.activeElement&&r().keyboardActiveItemKey==null&&a(r().runtimeSelectableItems[0]?.key??null)})},b=()=>{i.focused=!1},C=!0,T={hideMenu:h,focus:()=>{let P=r().domRef.current;P&&(P.focus(),setTimeout(()=>{let _=r().domRef.current;_&&_!==document.activeElement&&_.focus()},10),g())},getMenuId:()=>r().menuId,getParentMenuId:()=>r().parentMenuId},v=(P,_)=>{a(_.key),l(_.key),_.originalMenuItem.onClick&&_.originalMenuItem.onClick(P);let A={key:_.key,item:_.originalMenuItem,hideMenu:h};_.originalMenuItem.onAction&&_.originalMenuItem.onAction(A);let{onAction:I}=r();I&&I(A),_.originalMenuItem.hideMenuOnAction&&h()},{onItemEnter:S,onItemLeave:D}=new Yi({parentMenuId:r().parentMenuId,onItemActivate:P=>{s()&&l(P)},itemHasSubMenu:P=>!!r().runtimeItems.filter(A=>A.type==="item"&&A.key===P&&A.menu)[0],getMenuRectFor:P=>{let _=`[data-submenu-for="${P}"]`,A=document.querySelector(_);if(A)return Me.from(A.getBoundingClientRect())}}).getHandlers(),R=P=>{let _=r().menuId,A=`${_}-submenu`,I=P.menu;return I?(typeof I=="function"&&(I=I()),(0,We.h)(_t,{key:A,parentMenuItemKey:P.key,parentMenuId:_,constrainTo:r().constrainTo,...I,autoFocus:!1,onShow:(M,F)=>{I?.onShow?.(M,F),c(F)},onHideIntent:M=>{I?.onHideIntent?.(M),h()},onHide:M=>{M.focused&&(l(null),a(P.key),T.focus())}})):null};(0,We.watch)(()=>n.value.activeItemKey,P=>{let{runtimeItems:_,menuId:A,constrainTo:I}=r(),M=_.filter(O=>O.type==="item"&&P===O.key)[0];if(!M||!M.menu){c(null),p();return}let F=Qc(A,M.key);F&&f(()=>R(M),{id:`${A}-submenu`,alignTo:F,alignPosition:[["TopLeft","TopRight"],["TopRight","TopLeft"]],constrainTo:I})},{flush:"post"});function E(P){let{runtimeItems:_,runtimeSelectableItems:A,keyboardActiveItemKey:I}=r(),M=_.findIndex(H=>H.type==="item"&&H.key===I),F=I,O=_[M],z={ArrowUp:()=>{let H=_.slice(0,M).filter(oe=>oe.type==="item"&&!oe.disabled).pop();H&&H.type==="item"&&H.key&&(F=H.key)},ArrowDown:()=>{let H=_.slice(M+1).filter(oe=>oe.type==="item"&&!oe.disabled)[0];H&&H.type==="item"&&H.key&&(F=H.key)},Home:()=>{z.PageUp()},End:()=>{z.PageDown()},PageUp:()=>{F=A[0].key},PageDown:()=>{F=A[A.length-1].key},ArrowLeft:()=>{l(null),r().parentMenuId&&(i.destroyed=!0)},ArrowRight:()=>{O&&(l(O.key),Ke(()=>{s()&&d&&d.getParentMenuId()===r().menuId&&d.focus()}))},Enter:()=>{if(O)if(O.originalMenuItem?.menu){if(d){z.ArrowLeft();return}l(O.key)}else v(P,O)}," ":()=>{if(!O)return;O.originalMenuItem.menu||v(P,O);let H=tf(r().menuId,O.key);H&&H.click()},Escape:()=>{z.ArrowLeft();let H=r();H.parentMenuId||H.onHideIntent?.(H)}},k=z[P.key];k&&(k(),P.preventDefault()),F!=I&&a(F)}let N=!1,w=P=>{let _=P??null;_&&!N?(N=!0,r().domRef.current=_,u=!0,r().onShow?.(r(),T),r().autoFocus&&T.focus()):!_&&N?(N=!1,r().onHide?.(r()),r().domRef.current=null):_&&(r().domRef.current=_)};return(0,We.onBeforeUnmount)(()=>{u=!1,N&&(N=!1,r().onHide?.(r())),r().domRef.current=null}),()=>{let P=r(),{columns:_,runtimeItems:A,menuId:I,activeItemKey:M,keyboardActiveItemKey:F,destroyed:O,wrapLabels:z,parentMenuItemKey:k}=P;if(O)return null;let H=A.map((q,Re)=>(0,We.h)(hg,{key:q.type==="item"?q.key:Re,columns:_,item:q,index:Re,active:q.type==="item"&&q.key===M,keyboardActive:q.type==="item"&&q.key===F,onItemEnter:(ye,Pe)=>S(ye.key,Pe),onItemLeave:(ye,Pe)=>D(ye.key,Pe),onItemClick:v})),oe=_.map(q=>q.width||(typeof q.flex=="number"?`${q.flex}fr`:q.flex)||"auto").join(" "),le={...t.style,gridTemplateColumns:oe,gridTemplateRows:A.map(()=>"auto").join(" ")};return z||(le.whiteSpace="nowrap"),(0,We.h)("div",{class:$o.contents},[(0,We.h)("div",{...t,"data-menu-id":I,"data-submenu-for":k,tabindex:0,ref:w,onKeydown:E,onMousedown:()=>{C=!1},onMouseup:()=>{C=!0},onFocus:g,onBlur:b,class:ne(jc,t.class,"InfiniteMenu"),style:le},H),(0,We.h)(m)])}}});_t[qi]=!0;var ka=require("vue");function nf(o,t){let{columnApi:e,column:n,getComputed:i,api:r,dataSourceApi:a}=t,u=e.isSortable()?[{key:"sort-asc",label:"Sort Ascending",disabled:n.computedSortedAsc,onAction:()=>{r.setSortingForColumn(n.id,1)}},{key:"sort-desc",label:"Sort Descending",disabled:n.computedSortedDesc,onAction:()=>{r.setSortingForColumn(n.id,-1)}},{key:"sort-none",label:"Unsort",disabled:!n.computedSorted,onAction:()=>{r.setSortingForColumn(n.id,null)}},"-"]:[];return[...n.groupByForColumn?[{key:"collapse-all",label:"Collapse All",onAction:()=>{r.collapseAllGroupRows()}},"-"]:[],...u,n.computedFilterable?{key:"clear-filter",label:"Clear Filter",disabled:!n.computedFiltered,onAction:()=>{r.clearColumnFilter(n.id)}}:null,n.computedFilterable?"-":null,{key:"pin-start",label:"Pin to start",disabled:n.computedPinned==="start",onAction:()=>{r.setPinningForColumn(n.id,"start")}},{key:"unpin",label:"Unpin",disabled:!n.computedPinned,onAction:()=>{r.setPinningForColumn(n.id,!1)}},"-",{key:"columns",label:"Columns",menu:()=>{let d=[];return i().computedColumnsMapInInitialOrder.forEach((f,m)=>{let p=Co(f,t,"column-menu");d.push({key:m,label:p,check:(0,ka.h)(Wt,{key:f.id,disabled:f.computedVisible&&r.getVisibleColumnsCount()===1,checked:f.computedVisible,onChange:h=>{let g=!!h;r.setVisibilityForColumn(f.id,g),requestAnimationFrame(()=>{r.realignColumnContextMenu()})}})})}),{columns:[{name:"check"},{name:"label"}],items:d}}},"-",{key:"group-by",label:"Group by",menu:()=>{let d=[];return i().computedColumnsMapInInitialOrder.forEach((f,m)=>{if(f.groupByForColumn)return;let p=Co(f,t,"column-menu");d.push({key:m,label:p,check:(0,ka.h)(Wt,{key:f.id,disabled:!f.computedGroupable,checked:f.computedGroupedBy,onChange:()=>{a.toggleGroupByField(f.field)}})})}),{columns:[{name:"check"},{name:"label"}],items:d}}}].filter(d=>!!d)}function rf(o,t,e){if(o==null)return null;let{getComputed:n,getState:i}=t,{components:r,getColumnMenuItems:a}=i(),l=r?.Menu??_t,u=n().computedColumnsMap.get(o);if(!u)return null;let s={column:u,columnApi:at(u.id,t),...t},d=nf([],s),c=a?a(d,s):d,f=p=>{p.__insideMenu=!0},m=p=>{p.domRef.current?.parentNode?.removeEventListener("mousedown",f)};return!c||!c.length?null:(0,of.h)(l,{autoFocus:!0,items:c,onShow:p=>{p.domRef.current?.parentNode?.addEventListener("mousedown",f)},onHide:m,onHideIntent:p=>{m(p),e?.()}})}function gg(o){let{columnId:t,context:e,clearAll:n,showOverlay:i}=o,{getState:r,actions:a}=e,{columnMenuTargetRef:l,domRef:u}=r();function s(){n(),a.columnMenuVisibleForColumnId=null}let d=o.target;if(d||(d=l.current??void 0,d&&!u.current.contains(d)&&(d=void 0)),!d){let c=`[data-column-id="${t}"] ${lu}`;d=r().domRef.current.querySelector(c)}if(!d){console.warn(`Cannot show column menu for column "${t}"`);return}l.current=null,i(()=>rf(t,e,s),{constrainTo:u.current,id:"column-menu",alignTo:d,alignPosition:[["TopLeft","BottomLeft"],["TopRight","BottomRight"]]})}function af(o){let{context:t,state:e}=o,{getState:n,actions:i}=t,{showOverlay:r,portal:a,clearAll:l}=At({portalContainer:!1}),u=n().onColumnMenuClick.onChange(s=>{s&&(n().columnMenuTargetRef.current=s.target,i.contextMenuVisibleFor=null,i.cellContextMenuVisibleFor=null,i.filterOperatorMenuVisibleForColumnId=null,i.columnMenuVisibleForColumnId=s.column.id)});return(0,Zi.watch)([()=>e.value.columnMenuVisibleForColumnId,()=>e.value.columnMenuVisibleKey],(s,d,c)=>{let{columnMenuVisibleForColumnId:f,columnMenuTargetRef:m}=n();if(f){let h=function(g){g.__insideMenu!==!0&&(l(),i.columnMenuVisibleForColumnId=null)};var p=h;document.documentElement.addEventListener("mousedown",h),gg({columnId:f,context:t,clearAll:l,showOverlay:r}),c(()=>{document.documentElement.removeEventListener("mousedown",h)})}else m.current=null,l()},{flush:"post"}),(0,Zi.onBeforeUnmount)(()=>{u()}),{MenuPortal:a}}var Ji=require("vue");var Lo=require("vue");function lf(o,t,e){if(o==null)return null;let{getComputed:n,getState:i,getDataSourceState:r,actions:a,dataSourceApi:l,dataSourceActions:u,api:s}=t,{components:d,getFilterOperatorMenuItems:c}=i(),f=d?.Menu??_t,m=n().computedColumnsMap.get(o);if(!m)return null;let p=R=>{R.__insideMenu=!0},h=R=>{R.domRef.current?.parentNode?.removeEventListener("mousedown",p)},{filterTypes:g}=r(),b=g[m.computedFilterType];if(!b)return null;let C=b.operators.map(R=>{let E=R.name,N=m.computedFilterValue?m.computedFilterValue.filter.operator===E:E===b.defaultOperator,w=R.components?.Icon??An;return{key:E,icon:(0,Lo.h)(w),label:R.label??R.name,onAction:()=>{s.setColumnFilterOperator(o,E)},checked:N?(0,Lo.h)(Qs,{size:16}):null}}),v=[...[{key:"close",label:"Close Menu",icon:null,onAction:()=>{s.hideFilterOperatorMenu()}},{key:"reset",label:"Reset",icon:(0,Lo.h)(eu),disabled:!m.computedFiltered,onAction:()=>{s.clearColumnFilter(o)}},"-"],...C],S={column:m,api:s,getState:i,getDataSourceState:r,getComputed:n,actions:a,dataSourceApi:l,dataSourceActions:u,columnFilterValue:m.computedFilterValue,filterTypes:g},D=c?c(v,S):v;return(0,Lo.h)(f,{autoFocus:!0,columns:[{name:"icon"},{name:"label"},{name:"checked"}],items:D,onShow:R=>{R.domRef.current?.parentNode?.addEventListener("mousedown",p)},onHide:h,onHideIntent:R=>{h(R),e?.()}})}var Xi=10;function sf(o){let{context:t,state:e}=o,{getState:n,actions:i}=t,{showOverlay:r,portal:a,clearAll:l}=At({portalContainer:!1}),u=n().onFilterOperatorMenuClick.onChange(s=>{if(!s)return;let{target:d,column:c}=s;function f(){l(),i.filterOperatorMenuVisibleForColumnId=null}let m=d?.parentElement||d,p=Me.from(m.getBoundingClientRect());p.top-=Xi,p.left-=Xi,p.width+=2*Xi,p.height+=2*Xi,r(()=>lf(c.id,t,f),{constrainTo:n().domRef.current,id:"filter-operator-menu",alignTo:p,alignPosition:[["TopLeft","BottomLeft"],["TopRight","BottomRight"]]}),i.contextMenuVisibleFor=null,i.cellContextMenuVisibleFor=null,i.columnMenuVisibleForColumnId=null,i.filterOperatorMenuVisibleForColumnId=c.id});return(0,Ji.watch)(()=>e.value.filterOperatorMenuVisibleForColumnId,(s,d,c)=>{if(s){let m=function(p){p.__insideMenu!==!0&&(l(),i.filterOperatorMenuVisibleForColumnId=null)};var f=m;document.documentElement.addEventListener("mousedown",m),c(()=>{document.documentElement.removeEventListener("mousedown",m)})}else l()},{flush:"post"}),(0,Ji.onBeforeUnmount)(()=>{u()}),{MenuPortal:a}}var no=require("vue");var zo=require("vue");function Qi(o){let t=o?Array.isArray(o)?o:o.items:null,e=o&&!Array.isArray(o)?o.columns:void 0;return{items:t,columns:e}}function La(o){let t=i=>{i.__insideMenu=!0},e=i=>{i.domRef.current?.parentNode?.removeEventListener("mousedown",t)};return{columns:[],items:[],autoFocus:!0,onShow:i=>{i.domRef.current?.parentNode?.addEventListener("mousedown",t)},onHide:e,onHideIntent:i=>{e(i),o.onHideIntent?.()}}}function uf(o,t,e){if(!o)return null;let n=me();return o.then(i=>{let{items:r,columns:a}=Qi(i);r&&r.length&&n((0,zo.h)(e,{...t,items:r||[],columns:a}))}),(0,zo.h)(sn,{updater:n})}function df(o,t,e){let{columnId:n,rowIndex:i,event:r}=o,{getComputed:a,getState:l}=t,{components:u,getCellContextMenuItems:s}=l(),d=u?.Menu??_t,{computedColumnsMap:c}=a(),f=c.get(n),m={...Gt({...t,rowIndex:i,columnId:f.id}),event:r};if(!f||!s)return{cellContext:m,menu:null,preventDefault:!1};let p=La({onHideIntent:e}),h=s(m,t),g=h instanceof Promise||Array.isArray(h)?!0:!!(h&&Array.isArray(h.items));if(h instanceof Promise)return{cellContext:m,menu:uf(h,p,d),preventDefault:g};let{items:b,columns:C}=Qi(h);return!b||!b.length?{cellContext:m,menu:null,preventDefault:Array.isArray(b)}:{preventDefault:g,menu:(0,zo.h)(d,{...p,columns:C,items:b}),cellContext:m}}function cf(o,t,e){let{getState:n,getComputed:i}=t,{components:r,getContextMenuItems:a}=n(),l=r?.Menu??_t,{computedColumnsMap:u}=i(),s=o.columnId?u.get(o.columnId):void 0,d=s?{...o,...Gt({...t,rowIndex:o.rowIndex,columnId:s.id})}:o;if(!a)return{cellContext:d,menu:null,preventDefault:!1};let c=La({onHideIntent:e}),f=a(d,t),m=f instanceof Promise||Array.isArray(f)?!0:!!(f&&Array.isArray(f.items));if(f instanceof Promise)return{cellContext:d,menu:uf(f,c,l),preventDefault:m};let{items:p,columns:h}=Qi(f);return!p||!p.length?{cellContext:d,menu:null,preventDefault:Array.isArray(p)}:{preventDefault:m,menu:(0,zo.h)(l,{...c,columns:h,items:p}),cellContext:d}}var er=5,ff=[["TopLeft","BottomLeft"],["TopRight","BottomRight"],["BottomLeft","BottomLeft"],["BottomRight","BottomRight"],["TopCenter","TopLeft"],["BottomCenter","TopLeft"],["CenterLeft","TopLeft"],["CenterRight","TopLeft"]];function pf(o){let{context:t,state:e}=o,{getState:n,actions:i,getDataSourceState:r}=t,{showOverlay:a,portal:l,clearAll:u}=At({portalContainer:!1}),s=n().cellContextMenu.onChange(d=>{if(!d)return;let{event:c}=d;function f(){u(),i.cellContextMenuVisibleFor=null}let{menu:m,cellContext:p,preventDefault:h}=df(d,t,f),g=Me.fromPoint({top:c.clientY,left:c.clientX});g.width+=er,g.height+=er,a(()=>m,{constrainTo:n().domRef.current,id:"cell-context-menu",alignTo:g,alignPosition:ff}),h&&c.preventDefault(),i.cellContextMenuVisibleFor={columnId:d.columnId,rowId:d.rowId,rowIndex:d.rowIndex,colIndex:d.colIndex};let{onCellContextMenu:b}=n();b&&b({...p,getState:n,getDataSourceState:r},c)});return(0,no.watch)(()=>e.value.cellContextMenuVisibleFor,(d,c,f)=>{if(d){let p=function(h){h.__insideMenu!==!0&&(u(),i.cellContextMenuVisibleFor=null)};var m=p;document.documentElement.addEventListener("mousedown",p),f(()=>{document.documentElement.removeEventListener("mousedown",p)})}else u()},{flush:"post"}),(0,no.onBeforeUnmount)(()=>{s()}),{MenuPortal:l}}function mf(o){let{context:t,state:e}=o,{getState:n,actions:i}=t,{showOverlay:r,portal:a,clearAll:l}=At({portalContainer:!1}),u=n().contextMenu.onChange(s=>{if(!s)return;let{event:d}=s;function c(){l(),i.contextMenuVisibleFor=null}let{menu:f,cellContext:m,preventDefault:p}=cf(s,t,c),h={top:d.clientY,left:d.clientX},g=Me.fromPoint(h);g.width+=er,g.height+=er,r(()=>f,{constrainTo:n().domRef.current,id:"table-context-menu",alignTo:g,alignPosition:ff}),p&&d.preventDefault(),i.contextMenuVisibleFor={point:h,...s};let{onContextMenu:b}=n();b&&b({...t,...m},d)});return(0,no.watch)(()=>e.value.contextMenuVisibleFor,(s,d,c)=>{if(s){let m=function(p){p.__insideMenu!==!0&&(l(),i.contextMenuVisibleFor=null)};var f=m;document.documentElement.addEventListener("mousedown",m),c(()=>{document.documentElement.removeEventListener("mousedown",m)})}else l()},{flush:"post"}),(0,no.onBeforeUnmount)(()=>{u()}),{MenuPortal:a}}var Ue=require("vue");var hf="mlx2t3";var tr=require("vue"),gf=(0,tr.defineComponent)({name:"SpacePlaceholder",props:{width:{type:Number,required:!0},height:{type:Number,required:!0},count:{type:Number,required:!1}},setup(o){return()=>(0,tr.h)("div",{"data-count":o.count,"data-placeholder-width":void 0,"data-placeholder-height":void 0,"data-name":"SpacePlaceholder",style:{height:`${o.height}px`,width:`${o.width}px`,zIndex:-1,opacity:0,pointerEvents:"none",contain:"strict"}})}});var yf={true:"_1ueijco2",false:"_1ueijco3",visible:"_1ueijco4",auto:"_1ueijco5",hidden:"_1ueijco6"},bf={true:"_1ueijco7",false:"_1ueijco8",visible:"_1ueijco9",auto:"_1ueijcoa",hidden:"_1ueijcob"},Cf={true:"_1ueijcoc",false:"_1ueijcod",visible:"_1ueijcoe",auto:"_1ueijcof",hidden:"_1ueijcog"},Tf="_1ueijco1",Sf="_1ueijco0 _16lm1iw0";var Kt=require("vue");var wf=o=>{let t="";return typeof o=="boolean"||typeof o=="string"?t=yf[`${o}`]:t=ne(bf[`${o.horizontal}`],Cf[`${o.vertical}`]),t};var yg="InfiniteVirtualScrollContainer",vf=(0,Kt.defineComponent)({name:"VirtualScrollContainer",props:{scrollable:{type:[Boolean,String,Object],required:!1,default:!0},tabIndex:{type:Number,required:!1},autoFocus:{type:Boolean,required:!1},onContainerScroll:{type:Function,required:!1},scrollerRef:{type:Function,required:!1}},setup(o,{slots:t,attrs:e}){let n=(0,Kt.ref)(null),i=r=>{let a=r.target;o.onContainerScroll?.({scrollTop:a.scrollTop,scrollLeft:a.scrollLeft})};return(0,Kt.onMounted)(()=>{let r=n.value;r&&(o.scrollerRef?.(r),r.addEventListener("scroll",i,{passive:!1}),o.autoFocus&&document.activeElement!==r&&r.focus())}),(0,Kt.onBeforeUnmount)(()=>{n.value?.removeEventListener("scroll",i),o.scrollerRef?.(null)}),()=>(0,Kt.h)("div",{...e,ref:n,tabindex:o.tabIndex,class:ne(e.class,yg,Sf,wf(o.scrollable))},t.default?.())}});var st=require("vue");var nr=(0,st.defineComponent)({name:"RawTable",props:{name:{type:String,required:!1},brain:{type:Object,required:!0},renderCell:{type:Function,required:!0},renderDetailRow:{type:Function,required:!1},cellHoverClassNames:{type:Array,required:!1},cellDetachedClassNames:{type:Array,required:!1,default:()=>[]},renderer:{type:Object,required:!1},onRenderUpdater:{type:Function,required:!1},forceRerenderTimestamp:{type:Number,required:!1}},setup(o){let t=(0,st.computed)(()=>o.onRenderUpdater&&o.renderer?{renderer:o.renderer,onRenderUpdater:o.onRenderUpdater}:No(o.brain));(0,st.watchEffect)(()=>{t.value.renderer.cellHoverClassNames=o.cellHoverClassNames||[]}),(0,st.watchEffect)(()=>{t.value.renderer.cellDetachedClassNames=o.cellDetachedClassNames||[]});let e=null,n=()=>{e?.();let{renderer:i,onRenderUpdater:r}=t.value,{brain:a,renderCell:l,renderDetailRow:u}=o,s=a.getRenderRange();i.renderRange(s,{onRender:r,force:!0,renderCell:l,renderDetailRow:u}),e=a.onRenderRangeChange(d=>{i.renderRange(d,{force:!1,onRender:c=>{let f=r.get();f&&c&&f.length===c.length||r(c)},renderCell:l,renderDetailRow:u})})};return(0,st.onMounted)(n),(0,st.watch)(()=>[t.value,o.brain,o.renderCell,o.renderDetailRow,o.forceRerenderTimestamp],n,{flush:"post"}),(0,st.onBeforeUnmount)(()=>{e?.(),e=null}),()=>(0,st.h)(sn,{name:o.name,updater:t.value.onRenderUpdater})}});var or=[ou,`${Ge}DetachedCell`];var ut=require("vue");var If=ve({defaultClassName:"nxbq1c1 _16lm1iwz _16lm1iw2",variantClassNames:{visible:{true:"nxbq1c3",false:"nxbq1c4"}},defaultVariants:{},compoundVariants:[]}),ir="nxbq1c0 _16lm1iwz _16lm1iw4 _16lm1iw26 _16lm1iw23 _16lm1iw1y _16lm1iw1k";var{rootClassName:bg}=Be,Cg=`${bg}-ActiveCellIndicator`,Tg=U(W.columnZIndexAtIndex),Rf=(0,ut.defineComponent)({name:"ActiveCellIndicator",props:{activeCellIndex:{type:Array,required:!1,default:null},brain:{type:Object,required:!0},rowHeight:{type:[Number,Function],required:!1}},setup(o){let t=(0,ut.ref)(null),e=(0,ut.ref)(0),n=()=>{let{activeCellIndex:a,brain:l,rowHeight:u}=o;if(a==null)return;let[s]=a;l.isHorizontalLayoutBrain&&l.rowsPerPage&&(s=s%l.rowsPerPage);let d=typeof u=="function"?u(s):u??l.getRowHeight(s),c=l.getItemOffsetFor(s,"vertical");On({activeCellRowHeight:`${d}px`,activeCellRowOffset:`${c}px`},t.value)},i=null,r=a=>{i?.(),i=a.onRenderCountChange(()=>{e.value++})};return(0,ut.onMounted)(()=>{r(o.brain),n()}),(0,ut.watch)(()=>o.brain,r),(0,ut.watch)([()=>o.activeCellIndex,()=>o.rowHeight,()=>o.brain],()=>n(),{flush:"post"}),(0,ut.onBeforeUnmount)(()=>{i?.()}),()=>{e.value;let a=o.activeCellIndex!=null&&o.brain.getInitialRows()>o.activeCellIndex[0];return(0,ut.h)("div",{class:ir,ref:t,"data-name":"active-cell",style:a?{zIndex:`var(${Tg}-${o.activeCellIndex[1]})`}:void 0},[(0,ut.h)("div",{"data-name":"active-cell-indicator",class:`${Cg} ${If({visible:a})}`})])}}});var dt=require("vue");var xf=ve({defaultClassName:"j26lrx0 _16lm1iwz _16lm1iw2 _16lm1iw23 _16lm1iw26",variantClassNames:{active:{true:"j26lrx2",false:"j26lrx3"}},defaultVariants:{},compoundVariants:[]});var{rootClassName:Sg}=Be,wg=`${Sg}-ActiveRowIndicator`,vg=`calc(${W.activeCellRowOffsetX} + var(${U(W.scrollLeftForActiveRowWhenHorizontalLayout)}, 0px))`,Ig={[U(W.activeCellOffsetY)]:W.activeCellRowOffset,transform:`translate3d(${vg}, calc( ${W.activeCellOffsetY} + var(${U(W.scrollTopForActiveRow)}, 0px)), 0px)`,height:W.activeCellRowHeight,maxWidth:xe.runtime.totalVisibleColumnsWidthVar},Pf=(0,dt.defineComponent)({name:"ActiveRowIndicator",props:{activeRowIndex:{type:Number,required:!1,default:null},brain:{type:Object,required:!0}},setup(o){let t=(0,dt.ref)(null),e=(0,dt.ref)(0),n=()=>{let{brain:u}=o;if(o.activeRowIndex==null)return;let s="0px",d=o.activeRowIndex;if(u.isHorizontalLayoutBrain&&u.rowsPerPage){let m=u.getPageIndexForRow(d);m>0&&(s=`calc(${xe.runtime.totalVisibleColumnsWidthVar} * ${m})`),d=d%u.rowsPerPage}let c=u.getRowHeight(d),f=u.getItemOffsetFor(d,"vertical");On({activeCellRowHeight:`${c}px`,activeCellRowOffset:`${f}px`,activeCellRowOffsetX:s},t.value)},i=u=>{On({scrollTopForActiveRow:`${-u.scrollTop}px`,scrollLeftForActiveRowWhenHorizontalLayout:o.brain.isHorizontalLayoutBrain?`${-u.scrollLeft}px`:"0px"},t.value)},r=null,a=null,l=u=>{r?.(),a?.(),i(u.getScrollPosition()),r=u.onScroll(i),a=u.onRenderCountChange(()=>{e.value++})};return(0,dt.onMounted)(()=>{l(o.brain),n()}),(0,dt.watch)(()=>o.brain,l),(0,dt.watch)([()=>o.activeRowIndex,()=>o.brain],()=>n(),{flush:"post"}),(0,dt.onBeforeUnmount)(()=>{r?.(),a?.()}),()=>{e.value;let u=o.activeRowIndex!=null&&o.brain.getInitialRows()>o.activeRowIndex;return(0,dt.h)("div",{class:ir,"data-name":"active-row"},[(0,dt.h)("div",{ref:t,"data-name":"active-row-indicator",class:`${wg} ${xf({active:u})}`,style:u?Ig:void 0})])}}});var Rg=ne(hf,Tf),Df=(0,Ue.defineComponent)({name:"HeadlessTable",props:{brain:{type:Object,required:!0},renderCell:{type:Function,required:!0},renderDetailRow:{type:Function,required:!1},cellHoverClassNames:{type:Array,required:!1},renderer:{type:Object,required:!1},onRenderUpdater:{type:Function,required:!1},forceRerenderTimestamp:{type:Number,required:!1},scrollStopDelay:{type:Number,required:!1},wrapRowsHorizontally:{type:Boolean,required:!1},autoFocus:{type:Boolean,required:!1},tabIndex:{type:Number,required:!1},activeRowIndex:{type:Number,required:!1,default:null},activeCellIndex:{type:Array,required:!1,default:null},activeCellRowHeight:{type:[Number,Function],required:!1},scrollerRef:{type:Function,required:!1}},setup(o,{attrs:t}){let e=(0,Ue.ref)(null),n=(0,Ue.shallowRef)({width:0,height:0});(0,Ue.watch)(()=>o.scrollStopDelay,d=>{d!=null&&o.brain.setScrollStopDelay(d)},{immediate:!0});let i=d=>{requestAnimationFrame(()=>{e.value&&e.value.style.setProperty("transform",`translate3d(${-d.scrollLeft}px, ${-d.scrollTop}px, 0px)`)})},r=d=>{o.brain.setScrollPosition(d,i)},a=null,l=null,u=d=>{l?.(),l=d.onRenderCountChange(()=>{n.value=d.getVirtualizedContentSize()}),n.value=d.getVirtualizedContentSize(),i(d.getScrollPosition()||{scrollLeft:0,scrollTop:0})},s=()=>{a?.(),a=null;let d=e.value?.parentNode;if(!d)return;a=Yn(d,()=>{let f={height:d.clientHeight,width:d.clientWidth};o.brain.update(f)},{debounce:50})};return(0,Ue.onMounted)(()=>{u(o.brain),s()}),(0,Ue.watch)(()=>o.brain,d=>{u(d),s()}),(0,Ue.watch)(()=>o.wrapRowsHorizontally,()=>{s()}),(0,Ue.onBeforeUnmount)(()=>{a?.(),l?.()}),()=>(0,Ue.h)(vf,{...t,autoFocus:o.autoFocus,tabIndex:o.tabIndex,onContainerScroll:r,scrollerRef:o.scrollerRef},{default:()=>[(0,Ue.h)("div",{ref:e,class:Rg,"data-name":"scroll-transform-target"},[(0,Ue.h)(nr,{forceRerenderTimestamp:o.forceRerenderTimestamp,renderer:o.renderer,onRenderUpdater:o.onRenderUpdater,renderCell:o.renderCell,renderDetailRow:o.renderDetailRow,brain:o.brain,cellHoverClassNames:o.cellHoverClassNames,cellDetachedClassNames:or}),o.activeCellIndex!=null?(0,Ue.h)(Rf,{brain:o.brain,rowHeight:o.activeCellRowHeight,activeCellIndex:o.activeCellIndex}):null]),o.activeRowIndex!=null?(0,Ue.h)(Pf,{brain:o.brain,activeRowIndex:o.activeRowIndex}):null,(0,Ue.h)(gf,{width:n.value.width,height:n.value.height})]})}});var Af="_16lm1iw1 _16lm1iw1c _16lm1iwe";var Le=require("vue"),Mf=require("vue");var rr=require("vue");function za(){let{api:o,getState:t}=$e(),e=oo(),{editingCell:n,editingValueRef:i}=t(),r=n?.value,a=r;i.current=r;let l=d=>{i.current=d,a=d},{column:u,rowInfo:s}=e.value;return{api:o,initialValue:r,get value(){return a},get readOnly(){let{editingCell:d}=t();return d?!d.active&&!!d.waiting:!1},column:u,rowInfo:s,setValue:l,confirmEdit:o.confirmEdit,cancelEdit:o.cancelEdit,rejectEdit:o.rejectEdit}}var _f=(0,rr.defineComponent)({name:"InfiniteTableColumnEditor",setup(){let{state:o}=$e(),t=za(),{initialValue:e,setValue:n,confirmEdit:i,cancelEdit:r}=t,a=!1,l=!1,u=f=>{f&&!l&&(l=!0,f.value=e??"",f.focus())},s=f=>{let{key:m}=f;m==="Enter"||m==="Tab"?(i(),f.stopPropagation(),m==="Tab"&&f.preventDefault()):m==="Escape"?(a=!0,r()):f.stopPropagation()},d=()=>{!a&&o.value.editingCell?.active&&i()},c=f=>{n(f.target.value)};return()=>(o.value.editingCell,(0,rr.h)("input",{readonly:t.readOnly||void 0,ref:u,onKeydown:s,onBlur:d,onInput:c,class:ne(Tl,Pl.none),type:"text"}))}});var xg=U(W.columnWidthAtIndex),Pg=U(W.columnReorderEffectDurationAtIndex),Ga=Symbol("InfiniteColumnCell");function oo(){return(0,Mf.inject)(Ga)}var Dg=o=>{let{toggleCurrentRowDetails:t,rowDetailState:e}=o;return(0,Le.h)(vn,{style:{visibility:e===!1?"hidden":"visible"},expanded:e==="expanded",onChange:t})},Ag={display:"inline-block",visibility:"visible"},Va=o=>{let{rowInfo:t,toggleCurrentTreeNode:e,nodeExpanded:n,api:i}=o,r=i.getDataSourceState().isNodeReadOnly;return(0,Le.h)(vn,{disabled:t.isTreeNode&&t.isParentNode?r(t):!1,style:Ag,expanded:n,onChange:e})},_g=o=>{let{rowInfo:t,selectCurrentRow:e,deselectCurrentRow:n,toggleCurrentGroupRowSelection:i,dataSourceApi:r,api:a}=o,{components:l}=a.getState(),u=a.getDataSourceState().isNodeSelectable,s=l?.CheckBox||Wt;return(0,Le.h)(s,{domProps:{class:ii},disabled:t.isTreeNode?!u(t):!1,onChange:d=>{if(t.isTreeNode){r.treeApi.setNodeSelection(t.nodePath,d??!1);return}if(t.isGroupRow){i();return}d?e():n()},checked:t.rowSelected})},Mg=(0,Le.defineComponent)({name:"RenderCellHook",props:{renderParam:{type:Object,required:!0},content:{type:null,default:null}},setup(o){return(0,Le.provide)(Ga,(0,Le.computed)(()=>o.renderParam)),()=>o.content}});function Mt(o,t){let e=o(t);return e==null?e:(0,Le.h)(Mg,{renderParam:t,content:e})}var Ef=(0,Le.defineComponent)({name:"InfiniteTableColumnCell",props:{rowIndex:{type:Number,required:!0},rowHeight:{type:Number,required:!0},width:{type:Number,required:!0},hidden:{type:Boolean,default:!1},domRef:{type:Function,required:!0},column:{type:Object,required:!0},columnsMap:{type:Object,required:!0},fieldsToColumn:{type:Object,required:!0},showZebraRows:{type:Boolean,default:!0},rowDetailState:{type:[Boolean,String],default:!1},inEditMode:{type:Boolean,default:!1},rowIndexInHorizontalLayoutPage:{type:Number,default:null},horizontalLayoutPageIndex:{type:Number,default:null},rowStyle:{type:[Object,Function],default:void 0},rowClassName:{type:[String,Function],default:void 0},cellStyle:{type:[Object,Function],default:void 0},cellClassName:{type:[String,Function],default:void 0},getData:{type:Function,required:!0},rowInfoStore:{type:Object,required:!0},renderingContext:{type:Object,required:!0},getComputedVisibleColumns:{type:Function,required:!0},getComputedColumnOrder:{type:Function,required:!0},dataSourceStatePartial:{type:Object,default:void 0},onMouseEnter:{type:Function,default:void 0},onMouseLeave:{type:Function,default:void 0}},setup(o){let t={current:null},e=u=>{let s=u&&u.$el!==void 0?u.$el:u;t.current=s??null,o.domRef(t.current)},n=(0,Le.shallowRef)(o.rowInfoStore.getRowInfoAtIndex(o.rowIndex)),i=null;(0,Le.watch)([()=>o.rowInfoStore,()=>o.rowIndex],([u,s])=>{i?.(),n.value=u.getRowInfoAtIndex(s),i=u.subscribeToRowIndex(s,()=>{n.value=u.getRowInfoAtIndex(s)})},{immediate:!0}),(0,Le.onBeforeUnmount)(()=>{i?.(),i=null});let r=(0,Le.shallowRef)(null);(0,Le.provide)(Ga,r);let a=u=>{let{renderingContext:s,column:d,rowIndex:c}=o;s.getState().cellClick({rowIndex:c,colIndex:d.computedVisibleIndex,event:u})},l=u=>{let{renderingContext:s,column:d,rowIndex:c}=o,{getState:f,actions:m}=s,p=d.computedVisibleIndex;f().cellMouseDown({rowIndex:c,colIndex:p,event:u});let{keyboardNavigation:h}=f(),g=n.value?.rowDisabled??!1;if(h==="row"){g||(m.activeRowIndex=c);return}h==="cell"&&(m.activeCellIndex=[c,p])};return()=>{let{column:u,rowIndex:s,rowHeight:d,hidden:c,rowDetailState:f,renderingContext:m,rowIndexInHorizontalLayoutPage:p,horizontalLayoutPageIndex:h}=o,g=n.value;if(!u||!g)return(0,Le.h)("div",{ref:e,style:{display:"none"}});let{getState:b,getDataSourceState:C}=m,{activeRowIndex:T,keyboardNavigation:v,columnReorderInPageIndex:S}=b(),D=s===T&&v==="row",R=g.rowDisabled,{rowSelected:E}=g,N=o.getComputedVisibleColumns().map(se=>se.id),w=sc({horizontalLayoutPageIndex:h,rowIndexInHorizontalLayoutPage:p,column:u,rowInfo:g,rowDetailState:f,columnsMap:o.columnsMap,visibleColumnIds:N,fieldsToColumn:o.fieldsToColumn,context:m}),{stylingParam:P,renderParams:_,formattedValueContext:A,renderFunctions:I,groupByColumnReference:M,inEdit:F}=w,{align:O,verticalAlign:z}=_,k=_;k.domRef=e,k.htmlElementRef=t,r.value=k;let{selectionMode:H}=C(),oe=k.cellSelected,le=C().cellSelection??null,q=null;if(!c&&!F){if(I.renderGroupIcon&&(k.renderBag.groupIcon=Mt(I.renderGroupIcon,{...k,renderBag:{...k.renderBag}})),I.renderSelectionCheckBox&&H=="multi-row"&&(k.renderBag.selectionCheckBox=Mt(_g,k),I.renderSelectionCheckBox!==!0&&(k.renderBag.selectionCheckBox=Mt(I.renderSelectionCheckBox,{...k,renderBag:{...k.renderBag}}))),g.isTreeNode){let{isParentNode:ae}=g,ce;ce=(ae?I.renderTreeIconForParentNode:I.renderTreeIconForLeafNode)||typeof I.renderTreeIcon=="function"?I.renderTreeIcon:ae&&I.renderTreeIcon===!0?Va:void 0,ce===!0?ce=Va:ce&&(k.renderBag.treeIcon=Mt(Va,k)),ce&&(k.renderBag.treeIcon=Mt(ce,{...k,renderBag:{...k.renderBag}}))}I.renderRowDetailIcon&&(k.renderBag.rowDetailsIcon=Mt(Dg,{...k,renderBag:{...k.renderBag}}),typeof I.renderRowDetailIcon=="function"&&(k.renderBag.rowDetailsIcon=Mt(I.renderRowDetailIcon,{...k,renderBag:{...k.renderBag}}))),I.renderValue&&(k.renderBag.value=Mt(I.renderValue,{...k,renderBag:{...k.renderBag}})),g.isGroupRow&&I.renderGroupValue&&(k.renderBag.value=Mt(I.renderGroupValue,{...k,renderBag:{...k.renderBag}})),!g.isGroupRow&&I.renderLeafValue&&(k.renderBag.value=Mt(I.renderLeafValue,{...k,renderBag:{...k.renderBag}}));let se=k.renderBag.value;se instanceof Date&&(se=se.toLocaleDateString());let ee=k.renderBag,Y=[O!=="end"?ee.treeIcon:null,O!=="end"?ee.groupIcon:null,O!=="end"?ee.rowDetailsIcon:null,O!=="end"?ee.selectionCheckBox:null,se,O==="end"?ee.selectionCheckBox:null,O==="end"?ee.rowDetailsIcon:null,O==="end"?ee.groupIcon:null,O==="end"?ee.treeIcon:null];q=u.render?Mt(u.render,{...k,renderBag:{...k.renderBag,all:Y}}):Y}let{style:Re,className:ye}=tc({column:u,rowInfo:g,rowIndex:s,rowHeight:d,rowIndexInHorizontalLayoutPage:p,horizontalLayoutPageIndex:h,align:O,verticalAlign:z,stylingParam:P,formattedValueContext:A,groupByColumnReference:M,rowStyle:o.rowStyle,rowClassName:o.rowClassName,cellStyle:o.cellStyle,cellClassName:o.cellClassName,showZebraRows:o.showZebraRows,rowActive:D,rowDisabled:R,rowSelected:E,cellSelected:oe,cellSelection:le,getData:o.getData,computedVisibleColumns:o.getComputedVisibleColumns(),computedColumnOrder:o.getComputedColumnOrder(),columnReorderInPageIndex:S}),Pe=u.computedVisibleIndex,je=u.cssEllipsis??!0,Fe={width:`var(${xg}-${Pe})`,transition:`transform var(${Pg}-${Pe}, 0s)`,...Re,height:typeof Re.height=="number"?`${Re.height}px`:Re.height},{onRowMouseEnter:be,onRowMouseLeave:De}=o.renderingContext.getState(),ge=be||o.onMouseEnter?se=>{be?.({...A,rowIndex:s},se),o.onMouseEnter?.(se)}:void 0,te=De||o.onMouseLeave?se=>{De?.({...A,rowIndex:s,rowInfo:g},se),o.onMouseLeave?.(se)}:void 0,B={ref:e,style:Fe,"data-column-id":u.id,"data-z-index":Fe.zIndex,"data-row-id":`${g.id}`,class:ne(ye,Ot,ni),onClick:a,onMousedown:l,onMouseenter:ge,onMouseleave:te},X=(0,Le.h)("div",{class:ne(`${Ot}_content`,je?It:Uo.hidden)},[q]),j=u.components?.Editor??_f,ie=F?(0,Le.h)(j):null,Q=ie?[X,ie]:[X],Ce=u.components?.ColumnCell;return Ce?(0,Le.h)(Ce,B,{default:()=>Q}):(0,Le.h)("div",B,Q)}}});var dn=require("vue");var Ff=ve({defaultClassName:"evqes20",variantClassNames:{},defaultVariants:{},compoundVariants:[]});function Eg(o,t){let{masterState:e,detailContext:n}=t,i=e.detailDataSourcesStateToRestore;if(i.has(o)){let r=i.get(o);return n.assignState(r),!0}return!1}function Fg(o,t){let{detailState:e,masterState:n,masterActions:i,cacheEntryForRow:r}=t,a=new Map(n.detailDataSourcesStateToRestore),l=rd(e);r.all||(r.groupBy||delete l.groupBy,r.sortInfo||delete l.sortInfo,r.filterValue||delete l.filterValue,r.data||delete l.originalDataArray),a.set(o,l),i.detailDataSourcesStateToRestore=a}function Nf(o,t){let e={current:!1};return{currentRowCache:{getRowId:()=>o,add:i=>{e.current=!0,t.add(o,i)},get:()=>t.get(o),delete:()=>(e.current=!0,t.delete(o)),has:()=>t.has(o)},cacheCalledByRowDetailRenderer:e}}function Of(o){let{rowInfo:t,currentRowCache:e,cacheCalledByRowDetailRenderer:n,getMasterDataSourceState:i,masterActions:r,getMasterState:a}=o,l=i().detailDataSourcesStateToRestore.has(t.id)&&e.has(),s={registerDetail:Ft(d=>{if(n.current||e.add({all:!0}),!e.has()){requestAnimationFrame(()=>{d.dataSourceState.destroyedRef.current||(d.dataSourceActions.stateReadyAsDetails=!0)});return}Eg(t.id,{masterState:i(),detailContext:d}),requestAnimationFrame(()=>{d.dataSourceState.destroyedRef.current||(d.dataSourceActions.stateReadyAsDetails=!0)}),d.dataSourceState.onCleanup.onChange(()=>{let c=e.get();c&&Fg(t.id,{detailState:d.getDataSourceState(),masterActions:r,masterState:i(),cacheEntryForRow:c})})}),shouldRestoreState:l};return s.masterRowInfo=t,s.getMasterDataSourceState=i,s.getMasterState=a,s}var{rootClassName:Ng}=Be,Og=`${Ng}RowDetail`,ar=(0,dn.defineComponent)({name:"InfiniteTableDetailRow",props:{rowInfo:{type:Object,required:!0},rowIndex:{type:Number,required:!0},domRef:{type:Function,required:!1},rowDetailHeight:{type:Number,required:!0},detailOffset:{type:Number,required:!0},rowDetailRenderer:{type:Function,required:!0},rowDetailsCache:{type:Object,required:!0}},setup(o){let{getDataSourceState:t,dataSourceActions:e}=qn(),{getState:n}=$e(),i=()=>{let{currentRowCache:l,cacheCalledByRowDetailRenderer:u}=Nf(o.rowInfo.id,o.rowDetailsCache);return{masterDetailContextValue:Of({rowInfo:o.rowInfo,currentRowCache:l,cacheCalledByRowDetailRenderer:u,getMasterDataSourceState:t,masterActions:e,getMasterState:n}),currentRowCache:l}},r=(0,dn.shallowRef)(i());(0,dn.watch)(()=>o.rowInfo.id,()=>{r.value=i()}),dd(()=>r.value.masterDetailContextValue);let a=l=>{let u=l&&l.$el!==void 0?l.$el:l;o.domRef?.(u||null)};return()=>{let{masterDetailContextValue:l,currentRowCache:u}=r.value;return l.masterRowInfo=o.rowInfo,(0,dn.h)("div",{ref:a,class:ne(Og,Ff({})),style:{position:"absolute",top:`${o.detailOffset}px`,left:0,width:`calc(${W.bodyWidth} - ${W.scrollbarWidthVertical})`,height:`${o.rowDetailHeight}px`}},[o.rowDetailRenderer(o.rowInfo,u)])}}});var Ka=class{constructor(){this.rowHeight=new Map;this.rowDetailHeight=new Map;this.getRowHeight=t=>this.rowHeight.get(t)??0;this.getRowDetailHeight=t=>this.rowDetailHeight.get(t)??0}getTotalRowHeight(t){return this.getRowHeight(t)+this.getRowDetailHeight(t)}getSize(t){let e=this.getRowHeight(t),n=this.getRowDetailHeight(t);return{rowHeight:e,rowDetailHeight:n,totalRowHeight:e+n}}};function kg(o,t){let e=o.rowDetailHeight,n=o.rowHeight,{isRowDetailsExpanded:i,isRowDetailsEnabled:r,getDataSourceState:a}=o;if(!i)return typeof n=="function"?d=>{if(t&&t.rowHeight.has(d))return t.rowHeight.get(d);let c=a().dataArray[d],f=c?n(c):0;return t&&t.rowHeight.set(d,f),f}:n;let l=typeof n=="function",u=typeof e=="function";return d=>{if(t&&t.rowHeight.has(d)&&t.rowDetailHeight.has(d))return t.rowHeight.get(d)+t.rowDetailHeight.get(d);let c=a().dataArray[d];if(!c)return t&&(t.rowHeight.set(d,0),t.rowDetailHeight.set(d,0)),0;let f=l?n(c):n;if(!!(!r||typeof r=="function"&&r(c)===!1)||!i(c))return t&&(t.rowHeight.set(d,f),t.rowDetailHeight.set(d,0)),f;let p=0;return u?p=e(c):p=e,t&&(t.rowHeight.set(d,f),t.rowDetailHeight.set(d,p)),f+p}}function kf(o){let t=new Ka;return{computedRowHeight:kg(o,t),computedRowSizeCacheForDetails:o.isRowDetailsExpanded?t:void 0}}var et=require("vue");function Lf(o,t,e,n){let i=new Map,r=new Map,a=new Map;o.forEach((d,c)=>{let f=d.id,m=o[c-1],p=m?.id??"",h=new Set,g=m?.computedPinned!==d.computedPinned?new Set:a.get(p)??new Set;a.set(f,h);let b={type:"column",id:f,ref:d,groupOffset:0,computedPinned:d.computedPinned,computedWidth:d.computedWidth,depth:d.columnGroup?(e.get(d.columnGroup)??0)+1:0};i.set([f],b);let C=d.columnGroup,T,v=b;for(;C;){let S=t[C];if(S){h.add(C);let D=[f,...h];T=g.has(C)?r.get(C):void 0,T||(T={id:C,type:"group",ref:S,columnItems:[],children:[],groupOffset:0,uniqueGroupId:[C],computedWidth:0,computedPinned:b.computedPinned,depth:e.get(C)??0},i.set(D,T),r.set(C,T)),T.columnItems.push(b),T.uniqueGroupId.push(b.id),v&&!g.has(v.id)&&T.children.push(v),v=T,C=S.columnGroup}else break}});let l=[],u=new $,s=0;return i.forEach(d=>{if(!d.ref.columnGroup){let c=d.type==="column"?d.ref.computedWidth:d.columnItems.reduce((f,m)=>f+m.ref.computedWidth,0);d.groupOffset=s,d.computedWidth=c,d.type==="group"&&zf(d.children),l.push(d),s+=c}if(d.type==="group")d.columnItems.forEach(c=>{u.set([d.depth,c.ref.computedVisibleIndex],d)});else for(let c=d.depth;c<=n+1;c++)u.set([c,d.ref.computedVisibleIndex],d)}),i.clear(),r.clear(),{tree:l,pathsToCells:u}}function zf(o,t=0){o.forEach(e=>{let n=e.type==="column"?e.ref.computedWidth:e.columnItems.reduce((i,r)=>i+r.ref.computedWidth,0);e.computedWidth=n,e.groupOffset=t,e.type==="group"&&zf(e.children),t+=n})}var io=require("vue");var In=require("vue");var{rootClassName:Lg}=Be,zg=`${Lg}HeaderCell_ResizeHandle`,Vf=(0,In.defineComponent)({name:"GroupResizeHandle",props:{groupColumns:{type:Array,required:!0},columns:{type:Array,required:!0},draggerStyle:{type:Object,default:void 0},brain:{type:Object,required:!0},computeResize:{type:Function,required:!0},onResize:{type:Function,required:!0}},setup(o){let t={current:null},e=(0,In.ref)(!1),n=i=>{i.stopPropagation();let r=o.groupColumns[0];if(!r)return;let a=r.computedPinned,l=i.pointerId,u=i.clientX,s=i.target;s.setPointerCapture(l);let d=!0,c=hu(o.groupColumns.map(h=>h.computedVisibleIndex),{columns:o.columns,domRef:t}),f=h=>{a==="end"&&(h*=-1);let{constrained:g,adjustedDiffs:b,adjustedDiff:C}=o.computeResize(h);return e.value!==g&&(e.value=g),c.resize(b),C},m=h=>{if(d){let g=o.groupColumns.reduce((T,v)=>T+v.computedWidth-v.computedMinWidth,0),b=o.brain.getAvailableSize(),C={width:b.width+g,height:b.height};o.brain.update(C),d=!1}f(Math.round(h.clientX-u))},p=h=>{s.releasePointerCapture(l),s.removeEventListener("pointermove",m),s.removeEventListener("pointerup",p);let g=Math.round(h.clientX-u),b=f(g);o.onResize(b)};s.addEventListener("pointermove",m),s.addEventListener("pointerup",p)};return()=>{let i=o.groupColumns[0];if(!i)return null;let r=i.computedPinned,a=i.computedFirstInCategory,l=i.computedLastInCategory,u=(r===!1||r==="start")&&l?{right:r==="start"?void 0:xe.components.HeaderCell.resizeHandleWidth}:r==="end"&&a?{right:void 0}:void 0;return(0,In.h)("div",{ref:s=>{t.current=s??null},class:`${zg} ${ai} ${si({computedPinned:r,computedFirstInCategory:a,computedLastInCategory:l})}`,onPointerdown:n},[(0,In.h)("div",{style:{...u,...o.draggerStyle},class:li({constrained:e.value})})])}}});var Gf=`${Ge}HeaderGroup`,Kf=U(W.columnWidthAtIndex),Vg=U(W.columnZIndexAtIndex),Hf=(0,io.defineComponent)({name:"InfiniteTableHeaderGroup",props:{columnGroup:{type:Object,required:!0},columns:{type:Array,required:!0},height:{type:Number,required:!0},width:{type:Number,required:!0},columnGroupsMaxDepth:{type:Number,required:!0},horizontalLayoutPageIndex:{type:Number,default:null},domRef:{type:Function,required:!0}},setup(o){let{getState:t,getComputed:e,actions:n}=$e(),i=l=>{o.domRef(l??null)},r=l=>{let u=t(),{columnSizing:s,viewportReservedWidth:d,bodySize:c}=u,f=e().computedVisibleColumns,m=o.columns,p=m[m.length-1],h=!1,g=f.reduce((C,T)=>(T.computedFlex&&(C[T.id]={...s[T.id],flex:T.computedWidth},h=!0),C),{}),b=h?{...s,...g}:s;return os({availableSize:c.width,reservedWidth:d||0,dragHandleOffset:l,dragHandlePositionAfter:p.computedVisibleIndex,columnSizing:b,columnGroupSize:m.length,items:f.map(C=>({id:C.id,resizable:C.computedResizable,computedFlex:C.computedFlex,computedWidth:C.computedWidth,computedMinWidth:C.computedMinWidth,computedMaxWidth:C.computedMaxWidth}))})},a=l=>{let{columnSizing:u,reservedWidth:s}=r(l);n.viewportReservedWidth=s,n.columnSizing=u};return()=>{let{columnGroup:l,height:u,columns:s,columnGroupsMaxDepth:d}=o,{header:c}=l,{style:f}=l;c instanceof Function&&(c=c({columnGroup:l,horizontalLayoutPageIndex:o.horizontalLayoutPageIndex}));let m=s[0],p=s.length>1?"calc( "+s.map(T=>`var(${Kf}-${T.computedVisibleIndex})`).join(" + ")+" )":`var(${Kf}-${m.computedVisibleIndex})`,h=`calc(var(${Vg}-${m.computedVisibleIndex}) + ${d-l.depth})`,g=typeof f=="function"?f({columnGroup:l,horizontalLayoutPageIndex:o.horizontalLayoutPageIndex}):f;g=g&&typeof g=="object"?{...g}:{},g.width=p,g.height=`${u}px`;let C=s.some(T=>T.computedResizable)?(0,io.h)(Vf,{brain:t().brain,draggerStyle:{height:`${u*(d-l.depth+2)}px`},columns:e().computedVisibleColumns,groupColumns:s,computeResize:r,onResize:a}):null;return(0,io.h)("div",{ref:i,"data-group-id":l.uniqueGroupId,class:ne($l,Gf),style:g,"data-z-index":h},[(0,io.h)("div",{class:ne(`${Gf}__header-content`,It)},[c]),C])}}});var{rootClassName:Gg}=Be,Bf=`${Gg}Header`,Kg=[],Hg=Kl({overflow:!1}),Wf=(0,et.defineComponent)({name:"TableHeaderWrapper",props:{headerBrain:{type:Object,required:!0},bodyBrain:{type:Object,required:!0},wrapRowsHorizontally:{type:Boolean,default:!1}},setup(o){let t=$e(),{state:e,getState:n,getComputed:i,dataSourceContext:r}=t,a=(0,et.computed)(()=>{let p=e.value,h=p.computedColumnGroups;return!h||!Object.keys(h).length?1:p.columnGroupsMaxDepth+2}),l=(0,et.computed)(()=>{let p=e.value;return a.value*p.columnHeaderHeight+(p.showColumnFilters?p.columnHeaderHeight:0)}),u=$t(()=>{let p=e.value;return[p.computedColumnGroups,p.columnGroupsDepthsMap,p.columnGroupsMaxDepth,i().computedVisibleColumns]},()=>{let p=n(),{computedColumnGroups:h,columnGroupsDepthsMap:g}=p,{computedVisibleColumns:b}=i();if(!(!h||!Object.keys(h).length))return Lf(b,h,g,p.columnGroupsMaxDepth)},"header.treeInfo");(0,et.watchEffect)(()=>{let p=e.value,{computedVisibleColumns:h,computedPinnedStartColumns:g,computedPinnedEndColumns:b,columnSize:C}=i(),T=a.value,v=l.value,S=u.value,D=p.showColumnFilters,R=p.columnHeaderHeight,E=({rowIndex:P,colIndex:_})=>{let A=h[_],I=1,M=1;if(!A||!S)return{rowspan:I,colspan:M};let F=S.pathsToCells.get([P,_]);if(!F)return{rowspan:I,colspan:M};if(F.type==="column")return{colspan:M,rowspan:T-F.depth};let O=F.columnItems.findIndex(z=>z.id===A.id);return{rowspan:I,colspan:O===0?F.columnItems.length:1}},N=P=>D?P<T-1?R:2*R:R,w=o.headerBrain;(g.length||b.length)&&w.updateFixedCells({fixedColsStart:g.length,fixedColsEnd:b.length}),w.update({colWidth:C,rowHeight:N,rows:T,cols:h.length,height:v,rowspan:({rowIndex:P,colIndex:_})=>E({rowIndex:P,colIndex:_}).rowspan,colspan:({rowIndex:P,colIndex:_})=>E({rowIndex:P,colIndex:_}).colspan})});let s=null,d=p=>{s&&(s.style.transform=`translate3d(-${p.scrollLeft}px, 0px, 0px)`)},c=p=>{s=p??null},f=null;(0,et.watch)(()=>o.headerBrain,p=>{f?.(),f=p.onScroll(d),d(p.getScrollPosition()||{scrollLeft:0,scrollTop:0})},{immediate:!0}),(0,et.onBeforeUnmount)(()=>{f?.(),f=null});let m=$t(()=>{let p=e.value,h=r.state.value,{computedVisibleColumns:g,computedColumnsMap:b}=i();return[p.headerOptions,p.columnHeaderHeight,p.columnGroupsMaxDepth,p.showColumnFilters,g,b,u.value,o.headerBrain,h.allRowsSelected,h.someRowsSelected,h.selectionMode,h.filterTypes,h.filterDelay]},()=>{let p=n(),h=r.getDataSourceState(),{computedVisibleColumns:g,computedColumnsMap:b}=i(),C=o.headerBrain,T=u.value,v=p.columnGroupsMaxDepth,S=p.headerOptions,{allRowsSelected:D,someRowsSelected:R,selectionMode:E}=h;return N=>{let{rowIndex:w,colIndex:P,domRef:_,height:A,widthWithColspan:I,heightWithRowspan:M,hidden:F}=N,O=g[P];if(!O||F)return null;let z=C.isHorizontalLayoutBrain?C.getPageIndexForRow(w):null,k=T?T.pathsToCells.get([w,P]):null;if(k&&k.type==="group"){let H=k.columnItems.map(q=>q.ref),oe={...k.ref,id:k.id,uniqueGroupId:k.uniqueGroupId,depth:k.depth,columns:H.map(q=>q.id),computedWidth:k.computedWidth,groupOffset:k.groupOffset};return n().columnGroupVisibility[k.id]!==!1?(0,et.h)(Hf,{key:k.uniqueGroupId.join("/"),horizontalLayoutPageIndex:z,columnGroupsMaxDepth:v,domRef:_,columns:H,width:I,height:A,columnGroup:oe}):null}return(0,et.h)(Cu,{key:O.id,domRef:_,column:O,columnsMap:b,horizontalLayoutPageIndex:z,headerOptions:S,width:I,height:M,allRowsSelected:D,someRowsSelected:R,selectionMode:E})}},"header.renderCell");return()=>{let p=l.value,{scrollbars:h}=i(),g=e.value,b=(0,et.h)("div",{ref:c,class:ne(Bf,`${Bf}--virtualized`,Hg),style:{height:`${p}px`}},[(0,et.h)(nr,{name:"header",renderCell:m.value,brain:o.headerBrain,renderer:g.headerRenderer,onRenderUpdater:g.headerOnRenderUpdater,cellHoverClassNames:Kg,cellDetachedClassNames:or})]),C=h.vertical&&nn()?(0,et.h)("div",{class:ql,style:{zIndex:1e3,width:`${nn()}px`}}):null;return(0,et.h)("div",{class:`${Fr} ${Jl}`,style:{height:`${p}px`}},[b,C])}}});var ro=require("vue");var jf={visible:"qy58ya1 qy58ya0 _16lm1iw2 _16lm1iw23 _16lm1iw26 _16lm1iw2c _16lm1iw2a",hidden:"qy58ya2 qy58ya0 _16lm1iw2 _16lm1iw23 _16lm1iw26 _16lm1iw2c _16lm1iw2a"},$f="qy58ya3 _16lm1iw2 _16lm1iw23 _16lm1iw26 _16lm1iw2c _16lm1iw2a",Uf="qy58ya4";var{rootClassName:Bg}=Be,Ha=`${Bg}-LoadMask`,lr=(0,ro.defineComponent)({name:"LoadMask",props:{visible:{type:Boolean,required:!0}},setup(o,{slots:t}){return()=>(0,ro.h)("div",{class:`${jf[o.visible?"visible":"hidden"]} ${Ha}`},[(0,ro.h)("div",{class:`${$f} ${Ha}-Overlay`}),(0,ro.h)("div",{class:`${Uf} ${Ha}-Text`},t.default?t.default():"Loading")])}});var qf=o=>`--infinite-${o}`;var Yf=40,Zf=qf(ws);var Qf=Be.rootClassName,Ba=["debugId","id","children","columns","columnDefaultWidth","columnDefaultFlex","columnMinWidth","columnMaxWidth","columnCssEllipsis","columnHeaderCssEllipsis","columnDefaultSortable","columnDefaultDraggable","columnDefaultEditable","columnDefaultFilterable","columnDefaultGroupable","columnOrder","defaultColumnOrder","onColumnOrderChange","columnVisibility","defaultColumnVisibility","onColumnVisibilityChange","columnPinning","defaultColumnPinning","onColumnPinningChange","columnSizing","defaultColumnSizing","onColumnSizingChange","columnTypes","columnGroups","defaultColumnGroups","columnGroupVisibility","collapsedColumnGroups","pinnedStartMaxWidth","pinnedEndMaxWidth","viewportReservedWidth","onViewportReservedWidthChange","resizableColumns","draggableColumns","draggableColumnsRestrictTo","sortable","multiSortBehavior","editable","rowHeight","onRowHeightChange","rowDetailHeight","columnHeaderHeight","onColumnGroupVisibilityChange","header","headerOptions","showColumnFilters","showZebraRows","showHoverRows","rowHoverClassName","rowClassName","rowStyle","rowProps","cellClassName","cellStyle","domProps","licenseKey","loadingText","components","keyboardNavigation","keyboardSelection","keyboardShortcuts","activeRowIndex","defaultActiveRowIndex","onActiveRowIndexChange","activeCellIndex","defaultActiveCellIndex","onActiveCellIndexChange","onKeyDown","onCellClick","onCellDoubleClick","onCellContextMenu","onContextMenu","onScrollToTop","onScrollToBottom","onScrollStop","scrollToBottomOffset","scrollStopDelay","scrollTopKey","onReady","onRenderRangeChange","onRowMouseEnter","onRowMouseLeave","onSelfFocus","onSelfBlur","onFocusWithin","onBlurWithin","focusedClassName","focusedWithinClassName","focusedStyle","focusedWithinStyle","groupColumn","groupRenderStrategy","hideColumnWhenGrouped","hideEmptyGroupColumns","pivotColumn","pivotColumns","pivotColumnGroups","pivotTotalColumnPosition","pivotGrandTotalColumnPosition","showSeparatePivotColumnForSingleAggregation","wrapRowsHorizontally","repeatWrappedGroupRows","onScrollbarsChange","autoSizeColumnsKey","columnMenuRealignDelay","getColumnMenuItems","getCellContextMenuItems","getContextMenuItems","getFilterOperatorMenuItems","onEditCancelled","onEditRejected","onEditAccepted","persistEdit","shouldAcceptEdit","onEditPersistError","onEditPersistSuccess","rowDetailCache","rowDetailRenderer","isRowDetailExpanded","isRowDetailEnabled","rowDetailState","defaultRowDetailState","onRowDetailStateChange"],{useManagedComponent:Wg,injectionKey:jg}=xn({initSetupState:Ad,forwardProps:_d,mapPropsToState:Nd,cleanup:Md,allowedControlledPropOverrides:{rowHeight:!0,columnHeaderHeight:!0},mappedCallbacks:Fd(),getParentState:()=>{let o=(0,Z.inject)(Un,null);return o?o.state:null},debugName:"InfiniteTable"});function Xf(o){return t=>o[t]?.computedWidth??0}function Jf(o,t){return o.filter(n=>typeof n.rowspan=="function").length?({rowIndex:n,colIndex:i})=>{let r=t().dataArray,a=r[n];if(!a)return 1;let l=o[i];return!l||!l.rowspan?1:l.rowspan({column:l,data:a.data,dataArray:r,rowInfo:a,rowIndex:n})}:void 0}var sr=(0,Z.defineComponent)({name:"InfiniteTable",props:[...Ba],setup(o,{attrs:t}){let e=qn();if(!e)throw new Error("InfiniteTable must be rendered inside a <DataSource> component");let n=new Proxy(o,{get(y,x,G){let V=Reflect.get(y,x,G);return x==="rowHeight"?V??Yf:x==="columnHeaderHeight"?V??Zf:x==="repeatWrappedGroupRows"?V??!!Reflect.get(y,"wrapRowsHorizontally"):V}}),{contextValue:i}=Wg(n);(0,Z.provide)(jg,i);let r=i.state,a=i.componentActions,l=i.getComponentState,{state:u,getDataSourceState:s}=e,d=y=>{A.toggleGroupRow(y)};(0,Z.watch)([()=>r.value.columns,()=>u.value.groupBy,()=>u.value.pivotBy,()=>u.value.selectionMode,()=>r.value.hideColumnWhenGrouped,()=>r.value.groupColumn,()=>r.value.groupRenderStrategy,()=>r.value.pivotColumns,()=>r.value.pivotTotalColumnPosition,()=>r.value.pivotColumn],()=>{let y=r.value,x=u.value,{columns:G,groupColumnIds:V}=rc({columns:y.columns,groupColumn:y.groupColumn,pivotColumn:y.pivotColumn,pivotTotalColumnPosition:y.pivotTotalColumnPosition,pivotGrandTotalColumnPosition:y.pivotGrandTotalColumnPosition,groupRenderStrategy:y.groupRenderStrategy==="inline"?"single-column":y.groupRenderStrategy,groupBy:x.groupBy,pivotBy:x.pivotBy,pivotColumns:y.pivotColumns,toggleGroupRow:d,selectionMode:x.selectionMode});a.columnsWhenGrouping=G;let L=r.value.columnOrder;if(V.length&&Array.isArray(L)){let J=new Set(L),re=!1;V.forEach(pe=>{J.has(pe)||(re=!0,L=[pe,...L])}),re&&(a.columnOrder=L)}},{immediate:!0}),(0,Z.watch)(()=>r.value.groupRenderStrategy,y=>{e.dataSourceActions.generateGroupRows=y!=="inline"},{immediate:!0}),(0,Z.watch)(()=>r.value.showSeparatePivotColumnForSingleAggregation,y=>{e.dataSourceActions.showSeparatePivotColumnForSingleAggregation=y},{immediate:!0}),(0,Z.watch)(()=>r.value.pivotTotalColumnPosition,y=>{e.dataSourceActions.pivotTotalColumnPosition=y},{immediate:!0}),(0,Z.watch)(()=>r.value.pivotGrandTotalColumnPosition,y=>{y!=null&&(e.dataSourceActions.pivotGrandTotalColumnPosition=y)},{immediate:!0});let c=(0,Z.ref)(0),f=null,m=null,p=()=>{let{autoSizeColumnsKey:y}=r.value;return typeof y=="object"?y.key:y};(0,Z.watch)(()=>r.value.brain,y=>{m?.(),m=y.onRenderRangeChange(()=>{p()!=null&&r.value.autoSizeColumnsKey!==f&&(c.value+=1)})},{immediate:!0}),(0,Z.onBeforeUnmount)(()=>{m?.()}),(0,Z.watch)([p,()=>r.value.ready,c],()=>{let y=p();if(y==null)return;let{autoSizeColumnsKey:x,domRef:G}=r.value,V,L,J=!0;typeof x=="object"&&(x.columnsToResize&&(V=new Set(x.columnsToResize)),x.columnsToSkip&&(L=new Set(x.columnsToSkip)),J=x.includeHeader??J),f=y;let re=Ld(G,{includeHeader:J,columnsToResize:V,columnsToSkip:L}),pe=Object.keys(re);if(!pe.length)return;let he=r.value.columnSizing,Te={...he},we=!1;pe.forEach(_e=>{Te[_e]={width:re[_e]},we=we||Te[_e].width!==he[_e]?.width}),we&&(a.columnSizing=Te)},{immediate:!0,flush:"post"});let h=(0,Z.computed)(()=>Ed(u.value.groupBy));(0,Z.watch)([()=>r.value.groupRenderStrategy,()=>u.value.originalLazyGroupDataChangeDetect,()=>u.value.groupBy,h,()=>r.value.computedColumns,()=>r.value.hideEmptyGroupColumns?u.value.dataArray:null,()=>r.value.hideEmptyGroupColumns?u.value.groupRowsState:null,()=>r.value.hideEmptyGroupColumns?u.value.groupRowsIndexesInDataArray:null,()=>r.value.hideEmptyGroupColumns],()=>{let y=r.value,x=u.value;if(y.groupRenderStrategy!=="multi-column")return;let G=h.value,V=Od(y.computedColumns,G),L=kd({computedGroupColumns:V,columnVisibility:y.columnVisibility,hideEmptyGroupColumns:y.hideEmptyGroupColumns,groupRowsIndexesInDataArray:x.groupRowsIndexesInDataArray,dataArray:x.dataArray,groupBy:x.groupBy,groupByMap:G});tn(y.columnVisibility,L)||(a.columnVisibility=L)},{immediate:!0}),(0,Z.watch)([()=>r.value.computedColumns,()=>r.value.columnTypes,()=>u.value.groupBy,h,()=>r.value.hideColumnWhenGrouped],()=>{let y=r.value,x=h.value,G=u.value.groupBy.length>0,{columnVisibility:V,columnVisibilityForGrouping:L,hideColumnWhenGrouped:J,computedColumns:re}=y,pe={...V},he={...L},Te=!1,we=new Set,_e=new Set;Object.keys(re).forEach(Oe=>{let de=re[Oe];if(de.defaultHiddenWhenGroupedBy||J!=null)if(de.defaultHiddenWhenGroupedBy==="*"&&G||(de.defaultHiddenWhenGroupedBy===!0||J)&&de.field&&x.get(de.field)||typeof de.defaultHiddenWhenGroupedBy=="string"&&x.get(de.defaultHiddenWhenGroupedBy)||typeof de.defaultHiddenWhenGroupedBy=="object"&&Object.keys(de.defaultHiddenWhenGroupedBy).reduce((Ht,Bt)=>Ht||x.has(Bt),!1)){if(he[Oe]!==!1){if(V[Oe]===!1)return;he[Oe]=!1,Te=!0,we.add(Oe)}}else he[Oe]===!1&&(delete he[Oe],Te=!0,_e.add(Oe))}),Te&&(a.columnVisibilityForGrouping=he,_e.forEach(Oe=>{delete pe[Oe]}),we.forEach(Oe=>{pe[Oe]=!1}),a.columnVisibility=pe)},{immediate:!0});let g=$t(()=>{let y=r.value,x=u.value;return[y.computedColumns,y.bodySize.width,y.columnMinWidth,y.columnMaxWidth,y.columnDefaultWidth,y.columnDefaultFlex,y.columnCssEllipsis,y.columnHeaderCssEllipsis,y.viewportReservedWidth,y.resizableColumns,x.filterValue,x.filterTypes,y.sortable,x.sortInfo,x.multiSort,y.pinnedEndMaxWidth,y.pinnedStartMaxWidth,y.draggableColumns,y.columnDefaultDraggable,y.columnOrder,y.columnPinning,y.columnDefaultEditable,y.columnDefaultFilterable,y.columnDefaultGroupable,y.columnDefaultSortable,y.editable,y.columnSizing,y.columnTypes,y.columnVisibility,x.groupBy]},()=>{let y=r.value,x=u.value;return ss({columns:y.computedColumns,scrollbarWidth:void 0,bodySize:y.bodySize,columnMinWidth:y.columnMinWidth,columnMaxWidth:y.columnMaxWidth,columnDefaultWidth:y.columnDefaultWidth,columnDefaultFlex:y.columnDefaultFlex,columnCssEllipsis:y.columnCssEllipsis,columnHeaderCssEllipsis:y.columnHeaderCssEllipsis,viewportReservedWidth:y.viewportReservedWidth,resizableColumns:y.resizableColumns,filterValue:x.filterValue,filterTypes:x.filterTypes,sortable:y.sortable,sortInfo:x.sortInfo??void 0,multiSort:x.multiSort,pinnedEndMaxWidth:y.pinnedEndMaxWidth,pinnedStartMaxWidth:y.pinnedStartMaxWidth,draggableColumns:y.draggableColumns,columnDefaultDraggable:y.columnDefaultDraggable,columnOrder:y.columnOrder,columnPinning:y.columnPinning,columnDefaultEditable:y.columnDefaultEditable,columnDefaultFilterable:y.columnDefaultFilterable,columnDefaultGroupable:y.columnDefaultGroupable,columnDefaultSortable:y.columnDefaultSortable,editable:y.editable,columnSizing:y.columnSizing,columnTypes:y.columnTypes,columnVisibility:y.columnVisibility,columnVisibilityAssumeVisible:!0,groupBy:x.groupBy})},"computedColumnsResult"),b=()=>g.value.computedVisibleColumns,{getDataSourceState:C,dataSourceApi:T}=e,v=new $i({isRowDisabledAt:y=>C().dataArray[y]?.rowDisabled??!1,getIdForIndex:y=>C().dataArray[y]?.id??-1}),S=new Ui({getPrimaryKeyByIndex:T.getPrimaryKeyByIndex,getColumnIdByIndex:y=>b()[y]?.id||""}),D=(0,Z.shallowRef)({vertical:!1,horizontal:!1}),R=null;(0,Z.watch)(()=>r.value.brain,y=>{R?.(),R=y.onRenderCountChange(()=>{let{scrollTopMax:x,scrollLeftMax:G}=y,V=x>0,L=G>0,J=D.value;(J.vertical!==V||J.horizontal!==L)&&(D.value={vertical:V,horizontal:L})})},{immediate:!0}),(0,Z.watch)(D,y=>{let x=C(),{onScrollbarsChange:G}=l();G&&x.updatedAt&&x.dataArray.length&&G(y),x.notifyScrollbarsChange(y)});let E=null,N=()=>{let y=l(),x=[y.rowHeight,y.rowDetailHeight,y.isRowDetailExpanded,y.isRowDetailEnabled];return(!E||E.deps.some((G,V)=>G!==x[V]))&&(E={deps:x,value:kf({rowHeight:y.rowHeight,rowDetailHeight:y.rowDetailHeight,isRowDetailsExpanded:y.isRowDetailExpanded,isRowDetailsEnabled:y.isRowDetailEnabled,getDataSourceState:C})}),E.value},w=()=>N().computedRowHeight,P=()=>{let y=g.value,x=y.computedPinnedStartWidth??y.computedPinnedStartColumnsWidth,G=y.computedPinnedEndWidth??y.computedPinnedEndColumnsWidth;return{...y,scrollbars:D.value,multiRowSelector:v,multiCellSelector:S,computedRowHeight:w(),computedRowSizeCacheForDetails:N().computedRowSizeCacheForDetails,rowspan:Jf(y.computedVisibleColumns,C),computedPinnedStartOverflow:x?y.computedPinnedStartColumnsWidth>x:!1,computedPinnedEndOverflow:G?y.computedPinnedEndColumnsWidth>G:!1,toggleGroupRow:V=>A.toggleGroupRow(V),columnSize:V=>Xf(y.computedVisibleColumns)(V)}},_=()=>C().getDataSourceMasterContextRef?.current?.()??void 0,A=gc({getComputed:P,getState:l,getDataSourceState:C,getDataSourceMasterContext:_,actions:a,dataSourceActions:e.dataSourceActions,dataSourceApi:T}),I={getState:l,getDataSourceState:C,getDataSourceMasterContext:_,actions:a,dataSourceActions:e.dataSourceActions,api:A,dataSourceApi:T},M={getComputed:P,getDataSourceMasterContext:_,dataSourceApi:T,api:A,getState:l,actions:a,getDataSourceState:C,dataSourceActions:e.dataSourceActions,cloneTreeSelection:y=>bi(y,C),cloneRowSelection:y=>jo(y,C)},F=l().keyDown.onChange(y=>{zc(M,y)}),O=l().cellClick.onChange(y=>{if(!y)return;let{event:x,rowIndex:G,colIndex:V}=y,L=P().computedVisibleColumns[V],J=at(L.id,M);x.key="",Sc({...M,rowIndex:G,colIndex:V,column:L,columnApi:J},x)}),z=l().cellMouseDown.onChange(y=>{if(!y)return;let{event:x,rowIndex:G,colIndex:V}=y,L=P().computedVisibleColumns[V],J=at(L.id,M);wc({...M,rowIndex:G,colIndex:V,column:L,columnApi:J},x)}),k=y=>{l().keyDown(y)};l().onRowHeightCSSVarChange.onChange(y=>{y&&(a.rowHeight=y)}),l().onFlashingDurationCSSVarChange.onChange(y=>{let x=y?y*1:null;x!=null&&!isNaN(x)&&(a.flashingDurationCSSVarValue=x)}),l().onRowDetailHeightCSSVarChange.onChange(y=>{y&&(a.rowDetailHeight=y)}),l().onColumnHeaderHeightCSSVarChange.onChange(y=>{y&&(a.columnHeaderHeight=y)});let{MenuPortal:H}=af({context:M,state:r}),{MenuPortal:oe}=pf({context:M,state:r}),{MenuPortal:le}=mf({context:M,state:r}),{MenuPortal:q}=sf({context:M,state:r}),Re=y=>{let x=l(),G=y.target,V=Ss(G,Ca(),x.domRef.current),L,J,re,pe;V&&(J=Number(V.dataset.colIndex),pe=Number(V.dataset.rowIndex),L=P().computedVisibleColumns[J].id,re=T.getRowInfoArray()[pe].id);let he={columnId:L,colIndex:J,rowId:re,rowIndex:pe,event:y,target:V??y.target};V&&x.cellContextMenu(he),x.contextMenu(he)},ye=Aa(y=>{a.focused=y}),Pe=Aa(y=>{a.focusedWithin=y}),je=y=>{let x=l();if(y.target===x.domRef.current||y.target===x.scrollerDOMRef.current){if(x.focused)return;ye(!0),x.onSelfFocus?.(y),x.focusedWithin&&(Pe(!1),x.onBlurWithin?.(y));return}x.focusedWithin||(Pe(!0),x.onFocusWithin?.(y))},Fe=y=>{let x=l();if(y.target===x.domRef.current||y.target===x.scrollerDOMRef.current){if(!x.focused)return;ye(!1),x.onSelfBlur?.(y),x.focusedWithin&&(Pe(!1),x.onBlurWithin?.(y));return}x.domRef.current?.contains(y.relatedTarget)||(Pe(!1),x.onBlurWithin?.(y))},be=10,De=(y,x)=>{let G=!1,V=null;return(0,Z.watch)([y,()=>u.value.dataArray.length],([L],[J]=[void 0,void 0])=>{if(L!=null&&L!==J&&(G=!1,V!=null&&cancelAnimationFrame(V)),L==null||G)return;let re=(pe=0)=>{pe++,V!=null&&cancelAnimationFrame(V),V=requestAnimationFrame(()=>{G=x(L),!G&&pe<be&&re(pe)})};re()},{immediate:!0}),()=>{V!=null&&cancelAnimationFrame(V)}},ge=De(()=>r.value.activeRowIndex,y=>A.scrollRowIntoView(y,{offset:0})),te=De(()=>r.value.activeCellIndex,y=>A.scrollCellIntoView(y[0],y[1],{offset:30})),B=()=>{let{rowIndex:y,columnId:x}=l().editingCell;return Gt({rowIndex:y,columnId:x,getComputed:P,getState:l,getDataSourceState:C,getDataSourceMasterContext:_,actions:a,dataSourceActions:e.dataSourceActions,api:A,dataSourceApi:T})};(0,Z.watch)([()=>{let y=r.value.editingCell;return y&&!y.active?y.cancelled:void 0},()=>{let y=r.value.editingCell;return y&&!y.active&&y.accepted instanceof Error?y.accepted:void 0},()=>{let y=r.value.editingCell;return!!(y&&!y.active&&!y.cancelled&&y.accepted===!0)},()=>r.value.editingCell?.persisted,()=>r.value.editingCell?.active],([y,x,G,V,L],[J,re,pe,he,Te])=>{if(y&&y!==J){let{initialValue:we}=l().editingCell;l().onEditCancelled?.({...B(),initialValue:we})}if(x&&x!==re){let{value:we,initialValue:_e}=l().editingCell;l().onEditRejected?.({...B(),value:we,error:x,initialValue:_e})}if(G&&G!==pe){let{value:we,initialValue:_e}=l().editingCell,Oe={...B(),value:we,initialValue:_e};l().onEditAccepted?.(Oe),A.persistEdit({value:we})}if(V&&V!==he){let we=l().editingCell;if(we){let{value:_e,initialValue:Oe}=we,de={...B(),value:_e,initialValue:Oe};V instanceof Error?l().onEditPersistError?.({...de,error:V}):l().onEditPersistSuccess?.(de)}}!L&&Te&&A.focus()}),(0,Z.watchEffect)(()=>{let y=r.value,x=u.value,{computedVisibleColumns:G,computedPinnedStartColumns:V,computedPinnedEndColumns:L}=g.value,J=y.brain;J.updateFixedCells({fixedColsStart:V.length,fixedColsEnd:L.length});let re=w();J.update({colWidth:Xf(G),rowHeight:re,rows:x.dataArray.length,cols:G.length,rowspan:Jf(G,s)})}),(0,Z.watch)(()=>r.value.wrapRowsHorizontally,(y,x)=>{if(x===y)return;let{brain:G,headerBrain:V,renderer:L,onRenderUpdater:J}=l();G.destroy(),V.destroy(),L.destroy(),J.destroy();let re=Ta(zd,!!y);a.brain=re.brain,a.headerBrain=re.headerBrain,a.renderer=re.renderer,a.onRenderUpdater=re.onRenderUpdater,a.headerRenderer=re.headerRenderer,a.headerOnRenderUpdater=re.headerOnRenderUpdater},{flush:"post"});let X=null,j=null,ie=()=>{X&&(clearTimeout(X),X=null),j?.(),j=null};(0,Z.watch)([()=>r.value.brain,()=>r.value.wrapRowsHorizontally,()=>u.value.groupBy,()=>u.value.isTree,()=>r.value.wrapRowsHorizontally?r.value.repeatWrappedGroupRows:!1],([y,x,G,V,L])=>{ie();let J=e.dataSourceActions;if(!x){s().repeatWrappedGroupRows&&(J.repeatWrappedGroupRows=!1);return}let re=()=>{let{rowsPerPage:pe,repeatWrappedGroupRows:he}=s(),Te=!1,we=y.rowsPerPage,_e=(G&&G.length>0||V)&&we>0?we:null;return pe!=_e&&(J.rowsPerPage=_e,Te=!0),he!=L&&(J.repeatWrappedGroupRows=L??!1,Te=!0),Te};re(),j=y.onVerticalRenderRangeChange(()=>{re()&&(X=setTimeout(()=>{a.forceBodyRerenderTimestamp=Date.now()}))})},{immediate:!0,flush:"post"}),(0,Z.onBeforeUnmount)(ie),(0,Z.watch)(()=>r.value.scrollStopDelay,y=>{r.value.brain.setScrollStopDelay(y),e.dataSourceActions.scrollStopDelayUpdatedByTable=y},{immediate:!0}),(0,Z.watch)(()=>r.value.ready,y=>{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(r.value.id,y,A,{dataSourceApi:e.dataSourceApi});let{onReady:x}=l();x&&x({api:A,dataSourceApi:T})},{immediate:!0,flush:"post"}),(0,Z.watch)(()=>!!r.value.bodySize.height,y=>{y&&(a.ready=!0)},{immediate:!0});let Q=null,Ce=null;(0,Z.watch)(()=>r.value.brain,y=>{Q?.(),Q=y.onVerticalRenderRangeChange(x=>{s().notifyRenderRangeChange({renderStartIndex:x[0],renderEndIndex:x[1]})}),Ce?.(),Ce=y.onRenderRangeChange(x=>{l().onRenderRangeChange?.(x)})},{immediate:!0});let se=1,ee=0,Y=null,ae=null;(0,Z.watch)(()=>r.value.brain,y=>{Y?.(),ae?.(),Y=y.onRenderCountChange(()=>{ee=y.scrollTopMax}),ae=y.onScrollStop(x=>{let{scrollTop:G,scrollLeft:V}=x,{onScrollToTop:L,onScrollToBottom:J,onScrollStop:re}=l();G===0&&L?.();let pe=l().scrollToBottomOffset??se;if(G+pe>=ee){J?.();let{livePagination:Te,livePaginationCursor:we,dataArray:_e}=s();Te&&(e.dataSourceActions.cursorId=we!==void 0?Date.now():_e.length)}if(re){let Te=y.getRenderRange();re({scrollTop:G,scrollLeft:V,renderRange:Te,viewportSize:l().bodySize,firstVisibleRowIndex:Te.start[0],lastVisibleRowIndex:Te.end[0],firstVisibleColIndex:Te.start[1],lastVisibleColIndex:Te.end[1]})}})},{immediate:!0});let ce=null,Ne=null,ze=y=>{ce=y,r.value.scrollerDOMRef.current=y,Ne?.(),Ne=null,y&&(a.bodySize={width:y.clientWidth,height:y.clientHeight},Ne=Yn(y,x=>{a.bodySize={width:Math.round(x.width),height:Math.round(x.height)}},{debounce:50}))};(0,Z.onMounted)(()=>{ce&&(a.bodySize={width:ce.clientWidth,height:ce.clientHeight})}),(0,Z.onBeforeUnmount)(()=>{Ne?.(),Q?.(),Ce?.(),F(),O(),z(),ge(),te()});let qe=()=>C().dataArray,Ze=()=>g.value.computedColumnOrder,ue=[Zd,`${Dt}--hovered`],pt=$t(()=>{let y=r.value;return[y.showHoverRows,y.rowHoverClassName]},()=>{let y=r.value;if(!y.showHoverRows)return;let x=[];return y.rowHoverClassName&&(x=x.concat(y.rowHoverClassName)),x=x.concat(ue),x.join(" ").split(" ").map(G=>G.trim()).filter(Boolean)},"hoverClassNames"),bt=$t(()=>{let y=u.value;return[y.isNodeReadOnly,y.selectionMode,y.cellSelection]},()=>{let y=C();return{isNodeReadOnly:y.isNodeReadOnly,selectionMode:y.selectionMode,cellSelection:y.cellSelection}},"dataSourceStatePartialForCell"),St=$t(()=>{let y=r.value,x=u.value;return[g.value,y.rowHeight,y.rowDetailHeight,y.onRowMouseEnter,y.onRowMouseLeave,y.isRowDetailExpanded,y.isRowDetailEnabled,y.groupRenderStrategy,y.wrapRowsHorizontally,y.showZebraRows,y.brain,y.rowStyle,y.rowClassName,y.cellStyle,y.cellClassName,y.editingCell,y.updatedAt,x.rowInfoStore,bt.value]},()=>{let{computedVisibleColumns:y,computedColumnsMap:x,fieldsToColumn:G}=g.value,V=l(),L=V.showZebraRows,J=C().rowInfoStore,re=bt.value;return pe=>{let{rowIndex:he,colIndex:Te,domRef:we,hidden:_e,width:Oe,heightWithRowspan:de,onMouseEnter:Zt,onMouseLeave:Ht}=pe,Bt=qe()[he],Ye=y[Te];if(!Bt||!Ye)return null;let Et=!1,vt=V.isRowDetailEnabled,Rn=V.isRowDetailExpanded;!vt||typeof vt=="function"&&!vt(Bt)?Et=!1:Rn&&(Et=Rn(Bt)?"expanded":"collapsed");let so=A.isEditorVisibleForCell({rowIndex:he,columnId:Ye.id});return(0,Z.h)(Ef,{key:`${he}:${Ye.id}`,rowIndex:he,rowHeight:de,width:Oe,hidden:_e,domRef:we,column:Ye,columnsMap:x,fieldsToColumn:G,showZebraRows:L,rowDetailState:Et,inEditMode:so,rowIndexInHorizontalLayoutPage:V.wrapRowsHorizontally?V.brain.getRowIndexInPage(he):null,horizontalLayoutPageIndex:V.wrapRowsHorizontally?V.brain.getPageIndexForRow(he):null,rowStyle:V.rowStyle,rowClassName:V.rowClassName,cellStyle:V.cellStyle,cellClassName:V.cellClassName,getData:qe,rowInfoStore:J,renderingContext:I,getComputedVisibleColumns:b,getComputedColumnOrder:Ze,dataSourceStatePartial:re,onMouseEnter:Zt,onMouseLeave:Ht})}},"body.renderCell"),wt=$t(()=>{let y=r.value;return[y.isRowDetailExpanded,y.rowDetailRenderer,y.rowDetailCache]},()=>{let y=l(),x=y.isRowDetailExpanded,G=y.rowDetailRenderer;if(!x||!G)return;let V=y.rowDetailCache;return L=>{let{rowIndex:J,domRef:re}=L,he=qe()[J],Te=N().computedRowSizeCacheForDetails;if(!he||!x(he)||!Te)return(0,Z.h)("div",{ref:re,class:Ml.hidden});let{rowDetailHeight:we,rowHeight:_e}=Te.getSize(J);return(0,Z.h)(ar,{rowInfo:he,rowDetailsCache:V,rowIndex:J,domRef:re,detailOffset:_e,rowDetailHeight:we,rowDetailRenderer:G})}});return(0,Z.provide)(Ln,{state:r,getState:l,actions:a,api:A,getComputed:P,getComputedVisibleColumns:b,dataSourceContext:e}),()=>{let y=r.value,x=g.value,G=Ns({computedVisibleColumns:x.computedVisibleColumns,computedPinnedStartColumns:x.computedPinnedStartColumns,computedPinnedEndColumns:x.computedPinnedEndColumns,computedPinnedStartColumnsWidth:x.computedPinnedStartColumnsWidth,computedPinnedEndColumnsWidth:x.computedPinnedEndColumnsWidth,computedUnpinnedColumnsWidth:x.computedUnpinnedColumnsWidth,bodySize:y.bodySize,activeCellIndex:y.activeCellIndex,brain:y.brain,scrollbars:D.value}),V=y.focused,L=y.focusedWithin,J=x.computedPinnedStartWidth??x.computedPinnedStartColumnsWidth,re=x.computedPinnedEndWidth??x.computedPinnedEndColumnsWidth,pe=J?x.computedPinnedStartColumnsWidth>J:!1,he=re?x.computedPinnedEndColumnsWidth>re:!1,{autoFocus:Te,tabIndex:we,className:_e,class:Oe,style:de,onKeyDown:Zt,onKeydown:Ht,...Bt}=y.domProps??{},Ye=ne(t.class,_e,Oe,Ge,hs,y.wrapRowsHorizontally?`${Ge}--horizontal-layout`:null,x.computedPinnedStartColumnsWidth?`${Ge}--has-pinned-start ${ys}`:null,x.computedPinnedEndColumnsWidth?`${Ge}--has-pinned-end ${gs}`:null,V?`${Ge}--focused`:null,L?`${Ge}--focused-within`:null,V&&y.focusedClassName?y.focusedClassName:null,L&&y.focusedWithinClassName?y.focusedWithinClassName:null,pe?`${Ge}--has-pinned-start-overflow`:null,he?`${Ge}--has-pinned-end-overflow`:null,bs({horizontalLayout:!!y.wrapRowsHorizontally,hasPinnedStart:!!x.computedPinnedStartColumnsWidth,hasPinnedEnd:!!x.computedPinnedEndColumnsWidth,focused:V,focusedWithin:L})),Et={...t.style,...de,...G};V&&y.focusedStyle&&Object.assign(Et,y.focusedStyle),L&&y.focusedWithinStyle&&Object.assign(Et,y.focusedWithinStyle);let vt=Ht??Zt,Rn=vt?Xt=>{k(Xt),vt(Xt)}:k,so=u.value.loading;return(0,Z.h)("div",{...t,...Bt,ref:Xt=>{y.domRef.current=Xt??null},"data-debug-id":y.debugId,class:Ye,style:Et,onKeydown:Rn,onFocusin:je,onFocusout:Fe},[y.header?(0,Z.h)(Wf,{wrapRowsHorizontally:!!y.wrapRowsHorizontally,bodyBrain:y.brain,headerBrain:y.headerBrain}):null,(0,Z.h)("div",{class:ne(Af,Er),onContextmenu:Re},[(0,Z.h)(Df,{brain:y.brain,renderer:y.renderer,onRenderUpdater:y.onRenderUpdater,renderCell:St.value,renderDetailRow:wt.value,cellHoverClassNames:pt.value,scrollStopDelay:y.scrollStopDelay,forceRerenderTimestamp:y.forceBodyRerenderTimestamp,scrollerRef:ze,tabIndex:we??0,autoFocus:!!Te,activeRowIndex:y.ready&&y.keyboardNavigation==="row"?y.activeRowIndex??null:null,activeCellIndex:y.ready&&y.keyboardNavigation==="cell"&&!y.columnReorderDragColumnId?y.activeCellIndex??null:null,activeCellRowHeight:N().computedRowSizeCacheForDetails?.getRowHeight||w()}),(0,Z.h)(lr,{visible:!!so},()=>y.loadingText)]),(0,Z.h)("div",{ref:Xt=>{y.portalDOMRef.current=Xt??null},class:ne(`${Ge}Portal`,El[1e7],Dl.absolute,Al[0],xl[0])},[(0,Z.h)(H),(0,Z.h)(oe),(0,Z.h)(le),(0,Z.h)(q)]),y.rowHeightCSSVar?(0,Z.h)(Oo,{key:"row-height",varName:y.rowHeightCSSVar,onChange:y.onRowHeightCSSVarChange}):null,(0,Z.h)(Oo,{key:"flashing-duration",allowInts:!0,varName:xe.components.Cell.flashingDuration,onChange:y.onFlashingDurationCSSVarChange}),y.rowDetailHeightCSSVar?(0,Z.h)(Oo,{key:"row-detail-height",varName:y.rowDetailHeightCSSVar,onChange:y.onRowDetailHeightCSSVarChange}):null,y.columnHeaderHeightCSSVar?(0,Z.h)(Oo,{key:"column-header-height",varName:y.columnHeaderHeightCSSVar,onChange:y.onColumnHeaderHeightCSSVarChange}):null])}}});var ao=require("vue");var ep=U(W.currentFlashingDuration),$g=({children:o})=>o,tp=1e3,np={up:oi({direction:"up"}).split(" "),down:oi({direction:"down"}).split(" "),neutral:oi({direction:"neutral"}).split(" ")},Wa=(o={})=>{let{flashDuration:t,flashClassName:e,render:n=$g}=o;return(0,ao.defineComponent)({name:"FlashingColumnCell",inheritAttrs:!1,setup(i,{attrs:r,slots:a}){let l=oo(),u=$e(),s=!0,d=null,c=l.value?.value,f,m,p=()=>{let g=l.value?.htmlElementRef.current;if(f&&(clearTimeout(f),f=void 0),m&&g){let b=np[m];g.classList.remove(...e?[e,...b]:b),g.style.removeProperty(ep),m=void 0}},h=(g,b)=>{let C=l.value?.htmlElementRef.current;if(!C)return;p();let{flashingDurationCSSVarValue:T}=u.getState(),v=typeof T=="number"?T??t??tp:t??tp,S=typeof g=="number"?g>b?"up":"down":"neutral",D=np[S];C.style.setProperty(ep,`${v}`),C.classList.add(...e?[e,...D]:D),m=S,f=setTimeout(p,v)};return(0,ao.watch)(()=>{let g=l.value;return g?[g.column.id,g.rowInfo.id,g.value]:null},(g,b)=>{if(!g)return;let[C,T,v]=g,[S,D]=b??[];if(!(C===S&&T===D)){p(),s=!0,d=null,c=v;return}v!==c&&(s=!1,d=c,c=v,h(v,d))},{flush:"post"}),()=>{let g=l.value;return(0,ao.h)("div",{...r,class:ne(r.class),ref:g?.domRef},[n({children:a.default?a.default():null,oldValue:s?null:d})])}}})},op=Wa();var lo=require("vue");var ja=o=>(e,{unfilteredTreePaths:n,treeSelectionState:i,prevTreeSelectionState:r,lastUpdatedNodeInfo:a})=>{let l=new Qe(r,{treePaths:n});i.forEachLeafNodePath((d,{selected:c})=>{l.setNodeSelection(d,c)}),a&&i.forEachLeafNodePath(d=>{l.setNodeSelection(d,a.selected)},a.nodePath);let s={defaultSelection:!1,selectedPaths:l.getSelectedLeafNodePaths()};o(s)};var ip=(0,lo.defineComponent)({name:"TreeGrid",props:[...Ba],setup(o,{slots:t}){return()=>(0,lo.h)(sr,{...o},t)}}),rp=(0,lo.defineComponent)({name:"TreeDataSource",props:[...ua],setup(o,{slots:t}){return()=>(0,lo.h)(Pi,{...o,nodesKey:o.nodesKey??"children"},t)}});var Ug={key:"*",when:o=>{let{activeCellIndex:t}=o.getState();if(t){let[e,n]=t,i=o.api.getColumnAtIndex(n);return i?o.api.isCellEditable({rowIndex:e,columnId:i.id}):!1}return!1},handler:(o,t)=>{let{key:e}=t;if(e!="Escape"&&e.length===1){let{activeCellIndex:n}=o.getState();if(n){let[i,r]=n,a=o.api.getColumnAtIndex(r);if(!a)return;requestAnimationFrame(()=>{o.api.startEdit({rowIndex:i,value:e,columnId:a.id})})}}}},ap={instantEdit:Ug};var qg={CheckBox:Wt,LoadMask:lr,MenuIcon:xo};0&&(module.exports={CellSelectionState,DataSource,DataSourceInjectionKeyForVue,DeepMap,FlashingColumnCell,GroupRowsState,InfiniteTable,InfiniteTableClassName,InfiniteTableDetailRow,InfiniteTableInjectionKeyForVue,Menu,NumberFilterEditor,RowDetailState,RowSelectionState,StringFilterEditor,TreeDataSource,TreeExpandState,TreeGrid,TreeSelectionState,components,createFlashingColumnCellComponent,debounce,defaultFilterTypes,flatten,group,keyboardShortcuts,toTreeDataArray,useDataSourceContext,useGetMasterDetailContextForVue,useInfiniteColumnCell,useInfiniteColumnEditor,useInfiniteColumnFilterEditor,useInfiniteHeaderCell,useInfiniteTableContext,useOverlay,withSelectedLeafNodesOnly});
|
|
27
|
+
Component DEBUG_ID = "${o.debugId}"`),e(i,n,t)},pa=o=>{let{debugId:t,key:e}=o,n=wd[e];if(n&&(Zh({...n,debugId:t}),t&&e)){let i=vd.get(t);i&&i.getState().devToolsDetected&&n&&(i.getState().debugWarnings.set(e,{...n,debugId:t,status:"new"}),Jh(t))}};globalThis.logDevToolsWarning=pa;var Jh=o=>{let t=window.__INFINITE_TABLE_DEVTOOLS_HOOK__;if(!t)return;let e=vd.get(o);e&&t(o,e)};var Ai=require("vue"),Id=Symbol("DataSourceMasterDetail");function Rd(o){(0,Ai.provide)(Id,o)}var Qh=()=>{};function _i(){return(0,Ai.inject)(Id,Qh)}var ma=["debugId","primaryKey","fields","refetchKey","batchOperationDelay","rowInfoReducers","data","selectionMode","useGroupKeysForMultiRowSelection","rowSelection","defaultRowSelection","onRowSelectionChange","cellSelection","defaultCellSelection","onCellSelectionChange","rowDisabledState","defaultRowDisabledState","onRowDisabledStateChange","isRowDisabled","isRowSelected","lazyLoad","loading","defaultLoading","onLoadingChange","onReady","pivotBy","defaultPivotBy","onPivotByChange","aggregationReducers","defaultAggregationReducers","groupBy","defaultGroupBy","onGroupByChange","groupRowsState","defaultGroupRowsState","onGroupRowsStateChange","collapseGroupRowsOnDataFunctionChange","sortFunction","sortInfo","defaultSortInfo","onSortInfoChange","onDataParamsChange","onDataArrayChange","onDataMutations","livePagination","livePaginationCursor","onLivePaginationCursorChange","filterFunction","treeFilterFunction","sortMode","filterMode","groupMode","shouldReloadData","filterValue","defaultFilterValue","onFilterValueChange","filterDelay","filterTypes","sortTypes","multiSort","nodesKey","isNodeExpanded","isNodeCollapsed","isNodeReadOnly","isNodeSelectable","isNodeSelected","treeSelection","defaultTreeSelection","onTreeSelectionChange","onTreeDataMutations","onNodeCollapse","onNodeExpand","treeExpandState","defaultTreeExpandState","onTreeExpandStateChange"],Zn=Symbol("DataSource");function Jn(){return(0,Le.inject)(Zn)}var{useManagedComponent:eg}=_n({debugName:"DataSource",initSetupState:pd,forwardProps:hd,concludeReducer:td,mapPropsToState:gd,onPropChange:yd,cleanup:md,interceptActions:Cd(),mappedCallbacks:bd()});function Mi(o,t){let e={},n=!0,i=r=>{let a={},l={};for(let u in r)r.hasOwnProperty(u)&&(n||r[u]!==e[u])&&(a[u]=r[u],l[u]=e[u]);e=r,n=!1,Object.keys(a).length!==0&&t(a,l)};(0,Le.onMounted)(()=>i(o())),(0,Le.watch)(o,i,{flush:"post"})}function tg(o){let{state:t,getDataSourceState:e,dataSourceActions:n,reloadedRef:i}=o;Mi(()=>({data:t.value.data,dataParams:t.value.dataParams}),()=>{n.lazyLoadCacheOfLoadedBatches=new $});let r=null,a=(s,c,f=e().lazyLoadCacheOfLoadedBatches)=>{let m=e();if(s=s||r,!s)return;let{renderStartIndex:p,renderEndIndex:h}=s,{lazyLoadBatchSize:y,lazyLoad:C}=m;C&&((!y||y<=0)&&(!m.groupBy||m.groupBy.length===0)||ld({startIndex:p,endIndex:h,lazyLoadBatchSize:y,componentState:m,componentActions:n,dismissLoadedRows:c?.dismissLoadedRows??!1},f))},l=null,u=()=>{let s=e().scrollStopDelayUpdatedByTable;return(!l||l.wait!==s)&&(l={wait:s,fn:en(a,{wait:s})}),l.fn},d=null;Mi(()=>{let s=t.value;return{sortInfo:s.sortInfo,filterValue:s.filterValue,groupBy:s.groupBy,pivotBy:s.pivotBy,refetchKey:s.refetchKey,cursorId:s.livePagination?s.cursorId:null,lazyLoadBatchSize:s.lazyLoadBatchSize,lazyLoad:s.lazyLoad,originalLazyGroupDataChangeDetect:s.originalLazyGroupDataChangeDetect,groupRowsState:s.groupRowsState}},s=>{d?.(),d=null;let{lazyLoad:c,notifyRenderRangeChange:f}=e();c&&(s.sortInfo||s.filterValue||s.groupBy||s.pivotBy||s.refetchKey||s.cursorId?(e().lazyLoadCacheOfLoadedBatches.clear(),e().originalLazyGroupData.clear(),a(f.get(),{dismissLoadedRows:!0}),i.current=!0,Promise.resolve().then(()=>{i.current=!1})):(s.originalLazyGroupDataChangeDetect||s.groupRowsState)&&a(f.get()),d=f.onChange(m=>{r=m,a(m)}))}),(0,Le.watch)(()=>t.value.dataArray,()=>{let{lazyLoadBatchSize:s}=e();s&&s>0&&u()()},{flush:"post"}),(0,Le.onBeforeUnmount)(()=>{d?.(),d=null})}function ng(o){let{state:t,getDataSourceState:e,dataSourceActions:n}=o,i=()=>t.value.getDataSourceMasterContextRef.current?.()??void 0,r=(0,Le.shallowRef)({vertical:!1,horizontal:!1}),a=t.value.notifyScrollbarsChange.onChange(p=>{p&&(r.value=p)});(0,Le.onBeforeUnmount)(()=>{a()});let l=null;(0,Le.watch)(()=>t.value.livePaginationCursor,p=>{t.value.livePagination&&(l!=null&&cancelAnimationFrame(l),l=requestAnimationFrame(()=>{l=null,r.value?.vertical||p&&(n.cursorId=p)}))},{flush:"post"});let u=null;(0,Le.watch)(()=>[t.value.dataArray.length,t.value.livePaginationCursor],()=>{let{livePagination:p,livePaginationCursor:h,cursorId:y,dataArray:C}=t.value;!p||h!==void 0||(u!=null&&cancelAnimationFrame(u),u=requestAnimationFrame(()=>{u=null,r.value?.vertical||y!=null&&C.length&&(n.cursorId=C.length)}))},{flush:"post"}),(0,Le.watch)(()=>r.value.vertical,p=>{let{livePaginationCursor:h,livePagination:y,dataArray:C}=e();!p&&y&&(h?n.cursorId=h:h===void 0&&C.length&&(n.cursorId=C.length))},{flush:"post"}),(0,Le.onBeforeUnmount)(()=>{l!=null&&cancelAnimationFrame(l),u!=null&&cancelAnimationFrame(u)});let d=rd(),s=()=>{let{filterValue:p,filterMode:h,filterTypes:y}=t.value;return d(p,y,h)},c=()=>{let{shouldReloadData:p,sortInfo:h,groupBy:y,pivotBy:C,refetchKey:b,livePagination:S,cursorId:w}=t.value;return{sortInfo:p.sortInfo?h:null,groupBy:p.groupBy?y:null,pivotBy:p.pivotBy?C:null,refetchKey:b,filterValue:p.filterValue?s():null,cursorId:S?w:null}},f={current:!1};tg({state:t,getDataSourceState:e,dataSourceActions:n,reloadedRef:f});let m=[];Mi(()=>({data:t.value.data}),()=>{let p=e(),h=i(),{isDetail:y,isDetailReady:C}=ua(h,e);if(y&&!C)return;let b=Date.now();m.length>=10&&m.splice(0,1),m.push(b),b-m[0]<200&&m.length>=10&&pa({debugId:p.debugId,key:"DS001"}),typeof p.data!="function"&&Yn(p.data,p,n,void 0,h)}),Mi(()=>({...c(),data:t.value.data}),p=>{let h=Object.keys(p),y=!1;if(h.length===1){if(y=!!p.cursorId,p.filterValue&&e().filterMode==="local")return;let T=e().data;if(Array.isArray(T)&&p.refetchKey){n.originalDataArray=T;return}}let C=i(),{isDetail:b,isDetailReady:S}=ua(C,e);if(b&&!S)return;let w=e();if(typeof w.data=="function"){if(f.current&&!y&&ad(w))return;Yn(w.data,w,n,{append:y},C)}}),(0,Le.onMounted)(()=>{let p=e(),h=Gt(p,void 0,i());n.dataParams=h})}function og(o){let t=_i(),e=!!t(),{contextValue:n}=eg(o),i=n.state,r=n.componentActions,a=n.getComponentState;i.value.getDataSourceMasterContextRef.current=t;let l=Uu({getState:a,actions:r}),u={state:i,getDataSourceState:a,dataSourceActions:r,dataSourceApi:l,assignState:n.assignState};return(0,Le.provide)(Zn,u),(0,Le.onMounted)(()=>{let d=t();if(d){let s={dataSourceState:i.value,dataSourceActions:r,getDataSourceMasterContext:t,getDataSourceState:a,assignState:u.assignState,dataSourceApi:l};d.registerDetail(s)}}),ng({state:i,getDataSourceState:a,dataSourceActions:r}),(0,Le.watch)(()=>i.value.originalDataArrayChangedInfo,()=>{let d=i.value;d.onDataArrayChange?.(d.originalDataArray,d.originalDataArrayChangedInfo),d.onDataMutations&&d.originalDataArrayChangedInfo.mutations&&d.originalDataArrayChangedInfo.mutations.size&&d.onDataMutations({primaryKeyField:typeof d.primaryKey=="string"?d.primaryKey:void 0,dataArray:d.originalDataArray,mutations:d.originalDataArrayChangedInfo.mutations,timestamp:d.originalDataArrayChangedInfo.timestamp}),d.onTreeDataMutations&&d.originalDataArrayChangedInfo.treeMutations&&d.originalDataArrayChangedInfo.treeMutations.size&&d.onTreeDataMutations({nodesKey:d.nodesKey?d.nodesKey:void 0,dataArray:d.originalDataArray,treeMutations:d.originalDataArrayChangedInfo.treeMutations,timestamp:d.originalDataArrayChangedInfo.timestamp})},{flush:"post"}),(0,Le.onMounted)(()=>{i.value.onReady?.(l)}),(0,Le.onBeforeUnmount)(()=>{let d=a();d.onCleanup(d)}),u}var Ei=(0,Le.defineComponent)({name:"DataSource",props:[...ma],setup(o,{slots:t}){let e=og(o);return()=>t.default?.(e.state.value)??null}});var X=require("vue");var xd=require("vue");function Yt(o,t,e){let n=null,i;return(0,xd.computed)(()=>{let r=o();return(n===null||r.length!==n.length||r.some((a,l)=>!Object.is(a,n[l])))&&(i=t()),n=r,i})}var Qn=(o,t,e={debounce:0})=>{let n=e.debounce??0,i=window.ResizeObserver,r=n?en(t,{wait:n}):t,a=new i(l=>{let u=l[0],{width:d,height:s}=u.contentRect;if(u.borderBoxSize?.[0])s=u.borderBoxSize[0].blockSize,d=u.borderBoxSize[0].inlineSize;else{let c=o.getBoundingClientRect();s=c.height,d=c.width}r({width:d,height:s})});return a.observe(o),()=>{a.disconnect()}};var Ni=class Ni{constructor(t,e){this.keysInOrder=[];if(typeof t=="number")this.maxSize=t,this.currentMap=new Map;else if(this.maxSize=e??Ni.DEFAULT_SIZE,t){let n=Array.from(t);this.maxSize<n.length&&n.slice(n.length-this.maxSize),this.currentMap=new Map,n.forEach(([i,r])=>{this.set(i,r)})}else this.currentMap=new Map}values(){return this.currentMap.values()}get size(){return this.currentMap.size}delete(t){return this.currentMap.has(t)?(this.currentMap.delete(t),this.keysInOrder=this.keysInOrder.filter(e=>e!==t),!0):!1}has(t){return this.currentMap.has(t)}get(t){return this.currentMap.get(t)}set(t,e){if(this.has(t)&&this.delete(t),this.maxSize-this.currentMap.size<=0){let[i]=this.keysInOrder.splice(0,1);i!=null&&this.currentMap.delete(i)}return this.keysInOrder.push(t),this.currentMap.set(t,e),this}};Ni.DEFAULT_SIZE=10;var Fi=Ni;var ha=class{add(t,e){}get(t){}delete(t){}has(t){return!1}},Oi=class{constructor(t){this.storage=new Fi(t)}add(t,e){this.storage.set(t,e)}get(t){return this.storage.get(t)}delete(t){this.storage.delete(t)}has(t){return this.storage.has(t)}},ga=class{constructor(){this.storage=new Map}add(t,e){this.storage.set(t,e)}get(t){return this.storage.get(t)}delete(t){this.storage.delete(t)}has(t){return this.storage.has(t)}},ki=class{constructor(t){this.cacheStorage=t===!1?new ha:t===!0?new ga:typeof t=="number"?new Oi(t):new Oi(5)}add(t,e){this.cacheStorage.add(t,e)}get(t){return this.cacheStorage.get(t)}delete(t){this.cacheStorage.delete(t)}has(t){return this.cacheStorage.has(t)}};var bt=class extends Un{constructor(e){super(e);this.isRowDetailsExpanded=e=>!!this.isItemPositive(e)}getState(){let e=this.allPositive?!0:[...this.positiveMap?.keys()??[]],n=this.allNegative?!0:[...this.negativeMap?.keys()??[]];return{expandedRows:e,collapsedRows:n}}getPositiveFromState(e){return e.expandedRows}getNegativeFromState(e){return e.collapsedRows}areAllCollapsed(){return this.areAllNegative()}areAllExpanded(){return this.areAllPositive()}collapseAll(){this.makeAllNegative()}expandAll(){this.makeAllPositive()}isRowDetailsCollapsed(e){return!this.isRowDetailsExpanded(e)}setRowDetailsExpanded(e,n){return this.setItemValue(e,n)}collapseRowDetails(e){this.setRowDetailsExpanded(e,!1)}expandRowDetails(e){this.setRowDetailsExpanded(e,!0)}toggleRowDetails(e){this.toggleItem(e)}};var Pd=po(Gn());var ya=(o,t)=>o-t,Xt={horizontal:!0,vertical:!0};function Li(o,t){let e=t.length;if(!e)return 0;let n=-1;for(let i=0;i<e;i++){let r=0,a=0;if(e-i<=n)break;for(let l=i;l<e;l++)if(r+=t[l],a++,r>o){a>n&&(n=a);break}}return n<0?e:Math.min(n,e)}var zi={start:0,end:0},ba=o=>{o()},Ca=o=>{let{start:t,end:e}=o,[n,i]=t,[r,a]=e,l=r-n,u=a-i;return l*u},Dd=o=>{let{start:t,end:e}=o,[n]=t,[i]=e;return i-n},Fo=typeof window<"u"?requestAnimationFrame:o=>setTimeout(o,0);function ig(o){return o.horizontalChange||o.verticalChange}var In=class extends ft{constructor(e){let n=Xn(e,`${e}:MatrixBrain`);super(n);this.scrolling=!1;this.RENDER_COUNT_SAFETY_MARGIN_START=1;this.RENDER_COUNT_SAFETY_MARGIN_END=1;this.availableWidth=0;this.availableRenderWidth=0;this.isHorizontalLayoutBrain=!1;this.name="";this.availableHeight=0;this.availableRenderHeight=0;this.cols=0;this.rows=0;this.alwaysRenderedColumns=new Set;this._rowsPerPage=0;this.rowHeight=0;this.colWidth=0;this.verticalTotalSize=0;this.horizontalTotalSize=0;this.horizontalRenderCount=void 0;this.verticalRenderCount=void 0;this.maxHorizontalRenderCount=0;this.maxVerticalRenderCount=0;this.horizontalExtendRangeBy=zi;this.verticalExtendRangeBy=zi;this.horizontalRenderRange={startIndex:0,endIndex:0};this.verticalRenderRange={startIndex:0,endIndex:0};this.extraSpanCells=[];this.scrollPosition={scrollLeft:0,scrollTop:0};this.onScrollFns=[];this.onRenderRangeChangeFns=new Set;this.onVerticalRenderRangeChangeFns=new Set;this.onHorizontalRenderRangeChangeFns=new Set;this.onDestroyFns=[];this.destroyed=!1;this.onRenderCountChangeFns=new Set;this.onAvailableSizeChangeFns=new Set;this.onScrollStartFns=[];this.onScrollStopFns=[];this.scrollTimeoutId=0;this.scrollStopDelay=250;this.fixedColsStart=0;this.fixedColsEnd=0;this.fixedRowsStart=0;this.fixedRowsEnd=0;this.setScrollStopDelay=e=>{this.scrollStopDelay=e};this.getRowCount=()=>this.rows;this.getColCount=()=>this.cols;this.setScrolling=e=>{let n=this.scrolling;this.scrolling=e,e&&(this.scrollTimeoutId&&clearTimeout(this.scrollTimeoutId),this.scrollTimeoutId=setTimeout(()=>{this.setScrolling(!1),this.scrollTimeoutId=0},this.scrollStopDelay)),e!==n&&(e?this.notifyScrollStart():this.notifyScrollStop())};this.notifyScrollStart=()=>{if(this.destroyed)return;let e=this.onScrollStartFns;for(let n=0,i=e.length;n<i;n++)e[n]()};this.notifyScrollStop=()=>{if(this.destroyed)return;let e=this.onScrollStopFns,n=this.scrollPosition,i=this.getRenderRange();for(let r=0,a=e.length;r<a;r++)e[r](n,i)};this.notifyAvailableSizeChange=()=>{if(this.destroyed)return;let e=this.onAvailableSizeChangeFns,n=this.getAvailableSize();e.forEach(i=>{Fo(()=>{this.destroyed||e.has(i)&&i(n)})})};this.notifyVerticalRenderRangeChange=(e=!1)=>{if(this.destroyed)return;let n=this.onVerticalRenderRangeChangeFns,i=this.verticalRenderRange,r=e?ba:Fo;n.forEach(a=>{r(()=>{this.destroyed||n.has(a)&&a([i.startIndex,i.endIndex])})})};this.notifyHorizontalRenderRangeChange=(e=!1)=>{if(this.destroyed)return;let n=this.onHorizontalRenderRangeChangeFns,i=this.horizontalRenderRange,r=e?ba:Fo;n.forEach(a=>{r(()=>{this.destroyed||n.has(a)&&a([i.startIndex,i.endIndex])})})};this.isColFixedEnd=e=>this.fixedColsEnd?e>=this.cols-this.fixedColsEnd:!1;this.isColFixedStart=e=>this.fixedColsStart?e<this.fixedColsStart:!1;this.isRowFixedEnd=e=>this.fixedRowsEnd?e>=this.rows-this.fixedRowsEnd:!1;this.isRowFixedStart=e=>this.fixedRowsStart?e<this.fixedRowsStart:!1;this.isColFixed=e=>this.isColFixedStart(e)||this.isColFixedEnd(e);this.isRowFixed=e=>this.isRowFixedStart(e)||this.isRowFixedEnd(e);this.getFixedEndColsWidth=()=>{if(!this.fixedColsEnd)return 0;let e=0;for(let n=this.cols-this.fixedColsEnd;n<this.cols;n++)e+=this.getColWidth(n);return e};this.getFixedEndColsOffsets=({skipScroll:e}={skipScroll:!1})=>{if(!this.fixedColsEnd)return[];let{scrollLeft:n}=this.scrollPosition,{width:i}=this.getAvailableSize(),r=[],a=[],l=0;for(let s=this.cols-this.fixedColsEnd;s<this.cols;s++){let c=this.getColWidth(s);a.push(c),l+=c}let u=i-l+(e?0:n);l=0;let d=0;for(let s=this.cols-this.fixedColsEnd;s<this.cols;s++){let c=u+l;r[s]=c,l+=a[d],d++}return r};this.getFixedEndRowsOffsets=({skipScroll:e}={skipScroll:!1})=>{if(!this.fixedRowsEnd)return[];let{scrollTop:n}=this.scrollPosition,{height:i}=this.getAvailableSize(),r=[],a=[],l=0;for(let s=this.rows-this.fixedRowsEnd;s<this.rows;s++){let c=this.getRowHeight(s);a.push(c),l+=c}let u=i-l+(e?0:n);l=0;let d=0;for(let s=this.rows-this.fixedRowsEnd;s<this.rows;s++){let c=u+l;r[s]=c,l+=a[d],d++}return r};this.getFixedStartColsWidth=()=>{if(!this.fixedColsStart)return 0;let e=0;for(let n=0;n<this.fixedColsStart;n++)e+=this.getColWidth(n);return e};this.getFixedEndRowsHeight=()=>{if(!this.fixedRowsEnd)return 0;let e=0;for(let n=this.rows-this.fixedRowsEnd;n<this.rows;n++)e+=this.getRowHeight(n);return e};this.getFixedStartRowsHeight=()=>{if(!this.fixedRowsStart)return 0;let e=0;for(let n=0;n<this.fixedRowsStart;n++)e+=this.getRowHeight(n);return e};this.computeRenderCount=(e=Xt)=>{let n=e.horizontal,i=e.vertical,r=this.horizontalRenderCount||0,a=this.verticalRenderCount||0;return n&&(r=this.computeDirectionalRenderCount("horizontal",this.colWidth,this.cols,this.getAvailableRenderSize())),i&&(a=this.computeDirectionalRenderCount("vertical",this.rowHeight,this.rows,this.getAvailableRenderSize())),{horizontal:r,vertical:a}};this.setRenderCount=({horizontal:e,vertical:n})=>{e===void 0&&(e=this.horizontalRenderCount),n===void 0&&(n=this.verticalRenderCount);let i=e===this.horizontalRenderCount,r=n===this.verticalRenderCount;i&&r||(this.horizontalRenderCount=e,this.verticalRenderCount=n,this.updateRenderRange({horizontal:!i,vertical:!r}),this.notifyRenderCountChange())};this.updateFixedCells=e=>{e.fixedColsStart!=this.fixedColsStart&&(this.fixedColsStart=e.fixedColsStart||0),e.fixedColsEnd!=this.fixedColsEnd&&(this.fixedColsEnd=e.fixedColsEnd||0),e.fixedRowsStart!=this.fixedRowsStart&&(this.fixedRowsStart=e.fixedRowsStart||0),e.fixedRowsEnd!=this.fixedRowsEnd&&(this.fixedRowsEnd=e.fixedRowsEnd||0)};this.getFixedCellInfo=()=>{let{fixedRowsStart:e,fixedColsStart:n,fixedRowsEnd:i,fixedColsEnd:r}=this;return{fixedRowsStart:e,fixedColsStart:n,fixedRowsEnd:i,fixedColsEnd:r}};this.updateRenderRange=(e=Xt)=>{this.setRenderRange(this.computeRenderRange(e))};this.getExtraSpanCellsForRange=({horizontal:e,vertical:n})=>{let{colspan:i,rowspan:r}=this,a=[];if(r){let l=n.startIndex,u=e.startIndex,d=e.endIndex;for(let s=u;s<d;s++){this.computeItemSpanUpTo(l,s,"vertical");let c=this.rowspanParent.get(s);if(c[l]!=l){let f=l;for(;c[f]!=f;)f--;a.push([f,s])}}}if(i){let l=e.startIndex,u=n.startIndex,d=n.endIndex;for(let s=u;s<d;s++){this.computeItemSpanUpTo(s,l,"horizontal");let c=this.colspanParent.get(s);if(c[l]!=l){let f=l;for(;c[f]!=f;)f--;a.push([s,f])}}}return a};this.computeRenderRange=(e=Xt)=>{let n=e.horizontal?this.computeDirectionalRenderRange("horizontal"):this.horizontalRenderRange,i=e.vertical?this.computeDirectionalRenderRange("vertical"):this.verticalRenderRange;return{horizontal:n,vertical:i,extraCells:this.getExtraSpanCellsForRange({horizontal:n,vertical:i})}};this.computeDirectionalRenderRange=e=>{let n=e==="horizontal"?this.colWidth:this.rowHeight,i=e==="horizontal"?this.horizontalRenderCount:this.verticalRenderCount,r=e==="horizontal"?this.cols:this.rows;if(!i)return{startIndex:0,endIndex:0};let a=(e==="horizontal"?this.fixedColsStart:this.fixedRowsStart)||0,l=e==="horizontal"?this.scrollPosition.scrollLeft:this.scrollPosition.scrollTop;l+=this.getFixedStartSize(e);let u=typeof n!="function",d=e==="horizontal"?this.horizontalExtendRangeBy:this.verticalExtendRangeBy,s=this.getItemAt(l,e),c=d.start||0,f=d.end||0;u||(c+=this.RENDER_COUNT_SAFETY_MARGIN_START,f+=this.RENDER_COUNT_SAFETY_MARGIN_END),c&&(s=Math.max(0,s-c),i+=c),f&&(i+=f);let m=s+i,p=Math.max(a,r-(e==="horizontal"?this.fixedColsEnd:this.fixedRowsEnd));return m>p&&(m=p,s=Math.max(a,m-i)),{startIndex:s,endIndex:m}};this.getItemAt=(e,n)=>{let i=n==="horizontal"?this.colWidth:this.rowHeight,r=n==="horizontal"?this.cols:this.rows;if(typeof i!="function")return Math.min(Math.max(0,Math.floor(e/i)),r-1);let a=n==="horizontal"?this.colOffsetCache:this.rowOffsetCache,l=n==="horizontal"?this.colWidthCache:this.rowHeightCache,u=a.length-1,d=l.length-1,s=a[u],c;for(;s<e;)if(u>=r||(d+=1,this.computeCacheFor(d,n),c=s,s=a[d],c===s&&c!=0))return r-1;let f=(0,Pd.default)(a,e,ya);return f>=0?f:~f-1};this.computeCacheFor=(e,n)=>{let i=n==="horizontal"?this.colWidth:this.rowHeight,r=n==="horizontal"?this.colWidthCache:this.rowHeightCache,a=n==="horizontal"?this.colOffsetCache:this.rowOffsetCache;if(typeof i!="function")return;let l=i(e);if(r[e]=l,e>0){let u=a[e-1],d=r[e-1];u==null&&console.error(`Offset was not available for ${n==="horizontal"?"col":"row"} ${e-1}`),d==null&&console.error(`Size was not available for ${n==="horizontal"?"col":"row"} ${e-1}`);let s=u+d;a[e]=s}};this.computeItemSpanUpTo=(e,n,i)=>{let r=i==="horizontal"?n:e,a=i==="horizontal"?e:n,l=i==="horizontal"?this.cols:this.rows,u=i==="horizontal"?this.colspan:this.rowspan;if(!u)return;let d=i==="horizontal"?this.colspanParent:this.rowspanParent;d.has(a)||d.set(a,[]);let s=i==="horizontal"?this.colspanValue:this.rowspanValue;s.has(a)||s.set(a,[]);let c=d.get(a),f=s.get(a);if(c[r]===void 0){let m=c.length,p=l?Math.min(r,l-1):0,h={rowIndex:e,colIndex:n};for(;m<=p;m++)if(c[m]===void 0){h[i==="horizontal"?"colIndex":"rowIndex"]=m;let y=u(h);c[m]=m,f[m]=y;let C=m;for(;y>1;)C+=1,c[C]=m,f[C]=0,y-=1}}};this.getCellSpan=(e,n,i)=>{let r=i==="horizontal"?this.colspan:this.rowspan,a=i==="horizontal"?n:e,l=i==="horizontal"?e:n;if(!r)return 1;let u=i==="horizontal"?this.colspanValue:this.rowspanValue,d=u.get(l);return(!d||d[a]===void 0)&&this.computeItemSpanUpTo(e,n,i),d||(d=u.get(l)),d[a]||1};this.getRowspan=(e,n)=>this.getCellSpan(e,n,"vertical");this.getColspan=(e,n)=>this.getCellSpan(e,n,"horizontal");this.getRowspanParent=(e,n)=>this.getItemSpanParent(e,n,"vertical");this.getColspanParent=(e,n)=>this.getItemSpanParent(e,n,"horizontal");this.getItemSpanParent=(e,n,i)=>{let r=i=="horizontal"?this.colspan:this.rowspan,a=i==="horizontal"?n:e,l=i==="horizontal"?e:n;if(!r)return a;let u=i==="horizontal"?this.colspanParent:this.rowspanParent,d=u.get(l);return(!d||d[a]===void 0)&&this.computeItemSpanUpTo(e,n,i),d||(d=u.get(l)),d[a]};this.getRowHeightWithSpan=(e,n,i)=>this.getItemSizeWithSpan(e,n,i,"vertical");this.getColWidthWithSpan=(e,n,i)=>this.getItemSizeWithSpan(e,n,i,"horizontal");this.getItemSizeWithSpan=(e,n,i,r)=>{let a=r==="horizontal"?n:e,l=this.getItemSize(a,r);for(;i>1;)a+=1,i-=1,l+=this.getItemSize(a,r);return l};this.getRowHeight=e=>this.getItemSize(e,"vertical");this.getColWidth=e=>this.getItemSize(e,"horizontal");this.getItemSize=(e,n)=>{let i=n==="horizontal"?this.cols:this.rows,r=n==="horizontal"?this.colWidth:this.rowHeight;if(typeof r!="function")return r;let a=this.getItemSizeCacheFor(e,n),l=n==="horizontal"?this.colWidthCache:this.rowHeightCache;if(a===void 0){let u=l.length,d=Math.min(e,i-1);for(;u<=d;u++)this.computeCacheFor(u,n);a=this.getItemSizeCacheFor(e,n)}return a};this.keepColumnRendered=e=>(this.alwaysRenderedColumns.add(e),()=>{this.alwaysRenderedColumns.delete(e)});this.getAlwaysRenderedColumns=()=>Array.from(this.alwaysRenderedColumns);this.setRenderRange=({horizontal:e,vertical:n,extraCells:i})=>{let r=!1;(e.startIndex!==this.horizontalRenderRange.startIndex||e.endIndex!==this.horizontalRenderRange.endIndex)&&(this.horizontalRenderRange=e,r=!0);let a=!1;(n.startIndex!==this.verticalRenderRange.startIndex||n.endIndex!==this.verticalRenderRange.endIndex)&&(this.verticalRenderRange=n,a=!0),this.extraSpanCells=i||[],(r||a)&&this.notifyRenderRangeChange(),a&&this.notifyVerticalRenderRangeChange(),r&&this.notifyHorizontalRenderRangeChange()};this.getRenderRangeCellCount=Ca;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=e=>(this.onScrollFns.push(e),()=>{this.onScrollFns=this.onScrollFns.filter(n=>n!==e)});this.onScrollStart=e=>(this.onScrollStartFns.push(e),()=>{this.onScrollStartFns=this.onScrollStartFns.filter(n=>n!==e)});this.onScrollStop=e=>(this.onScrollStopFns.push(e),()=>{this.onScrollStopFns=this.onScrollStopFns.filter(n=>n!==e)});this.onRenderRangeChange=e=>(this.onRenderRangeChangeFns.add(e),()=>{this.onRenderRangeChangeFns.delete(e)});this.onVerticalRenderRangeChange=e=>(this.onVerticalRenderRangeChangeFns.add(e),()=>{this.onVerticalRenderRangeChangeFns.delete(e)});this.onHorizontalRenderRangeChange=e=>(this.onHorizontalRenderRangeChangeFns.add(e),()=>{this.onHorizontalRenderRangeChangeFns.delete(e)});this.onRenderCountChange=e=>(this.onRenderCountChangeFns.add(e),()=>{this.onRenderCountChangeFns.delete(e)});this.onAvailableSizeChange=e=>(this.onAvailableSizeChangeFns.add(e),()=>{this.onAvailableSizeChangeFns.delete(e)});this.onDestroy=e=>(this.onDestroyFns.push(e),()=>{this.onDestroyFns=this.onDestroyFns.filter(n=>n!==e)});this.getAvailableSize=()=>({width:this.availableWidth,height:this.availableHeight});this.getAvailableRenderSize=()=>({width:this.availableRenderWidth??this.availableWidth,height:this.availableRenderHeight??this.availableHeight});this.name=n,this.update=this.update.bind(this),this.destroy=this.destroy.bind(this),this.getCellOffset=this.getCellOffset.bind(this),this.reset()}set rowsPerPage(e){e!=this._rowsPerPage&&(this._rowsPerPage=e)}get rowsPerPage(){return this._rowsPerPage}reset(e=Xt){e.vertical&&this.resetVertical(),e.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(e,n){return e}update(e,n){let{rows:i,cols:r,rowHeight:a,colWidth:l,width:u,height:d}=e,s=typeof u=="number",c=typeof d=="number",f=s&&u!==this.availableWidth,m=c&&d!==this.availableHeight;f&&(this.availableWidth=u,this.availableRenderWidth=u),m&&(this.availableHeight=d,this.availableRenderHeight=d),(f||m)&&this.notifyAvailableSizeChange();let p=typeof i=="number",h=typeof r=="number",y=p&&i!==this.rows,C=h&&r!==this.cols;p&&(this.rows=i,this.rowsPerPage=i),h&&(this.cols=r);let b=a!=null,S=l!=null,w=b&&a!==this.rowHeight,T=S&&l!==this.colWidth;b&&(this.rowHeight=a),S&&(this.colWidth=l);let P=e.rowspan!=null,R=e.colspan!=null,E=P&&e.rowspan!=this.rowspan,N=R&&e.colspan!=this.colspan;E&&(this.rowspan=e.rowspan),N&&(this.colspan=e.colspan);let v=C||T||f||N,D=y||w||m||E;(n||ig)({horizontalChange:v,verticalChange:D,colsChanged:C,colWidthChanged:T,widthChanged:f,colspanChanged:N,rowsChanged:y,rowHeightChanged:w,heightChanged:m,rowspanChanged:E})&&this.updateRenderCount({horizontal:v,vertical:D})}extendRenderRange(e){let{direction:n}=e,i=n==="horizontal",r=i?this.horizontalRenderCount||this.getInitialCols():this.verticalRenderCount||this.getInitialRows(),a=typeof e.start=="number"?e.start:e.start===!0?r:0,l=typeof e.end=="number"?e.end:e.end===!0?r:0;return i?this.horizontalExtendRangeBy={start:a,end:l}:this.verticalExtendRangeBy={start:a,end:l},this.updateRenderRange({horizontal:i,vertical:!i}),()=>{this.extendRenderRange({start:0,end:0,direction:n})}}updateRenderCount(e=Xt){this.reset(e),this.doUpdateRenderCount(e)}doUpdateRenderCount(e=Xt){if(!this.availableWidth||!this.availableHeight){let n={horizontal:void 0,vertical:void 0};this.availableWidth||(n.horizontal=0),this.availableHeight||(n.vertical=0),this.setRenderCount(n)}this.setRenderCount(this.computeRenderCount(e))}get scrollTopMax(){return this.getVirtualizedContentSize().height-this.availableHeight}get scrollLeftMax(){return this.getVirtualizedContentSize().width-this.availableWidth}setScrollPosition(e,n){this.setScrolling(!0);let i=e.scrollLeft!==this.scrollPosition.scrollLeft,r=e.scrollTop!==this.scrollPosition.scrollTop;this.scrollPosition=e,(i||r)&&(n?.(e),this.updateRenderRange({horizontal:i,vertical:r}),this.notifyScrollChange())}notifyRenderRangeChange(e=!1){if(this.destroyed)return;let n=this.onRenderRangeChangeFns,i=this.getRenderRange(),r=e?ba:Fo;n.forEach(a=>{r(()=>{this.destroyed||n.has(a)&&a(i)})})}notifyScrollChange(){if(this.destroyed)return;let{scrollPosition:e}=this,n=this.onScrollFns;for(let i=0,r=n.length;i<r;i++)n[i](e)}computeDirectionalRenderCount(e,n,i,r){let a=0,l=e==="horizontal"?r.width:r.height;if(l-=this.getFixedSize(e),l<=0)return 0;let u=e==="horizontal"?this.fixedColsStart:this.fixedRowsStart,d=e==="horizontal"?this.fixedColsEnd:this.fixedRowsEnd;if(typeof n=="function"){let s=[],c=0,f=i;c+=u,f-=d;for(let m=c;m<f;m++)s.push(this.getItemSize(m,e));a=Li(l,s)}else a=(n?Math.ceil(l/n):0)+1;return a+=u+d,e==="horizontal"?this.maxHorizontalRenderCount=a:this.maxVerticalRenderCount=a,a=Math.min(i,a),a}getFixedSize(e){return e==="horizontal"?this.getFixedStartColsWidth()+this.getFixedEndColsWidth():this.getFixedStartRowsHeight()+this.getFixedEndRowsHeight()}getFixedStartSize(e){return e==="horizontal"?this.getFixedStartColsWidth():this.getFixedStartRowsHeight()}getFixedEndSize(e){return e==="horizontal"?this.getFixedEndColsWidth():this.getFixedEndRowsHeight()}notifyRenderCountChange(){if(this.destroyed)return;let{horizontalRenderCount:e,verticalRenderCount:n}=this,i={horizontal:e,vertical:n},r=this.onRenderCountChangeFns;r.forEach(a=>{Fo(()=>{this.destroyed||r.has(a)&&a(i)})})}getCellOffset(e,n){return{x:this.getItemOffsetFor(n,"horizontal"),y:this.getItemOffsetFor(e,"vertical")}}getInitialRowHeight(){return this.rowHeight}getInitialCols(){return this.cols}getInitialRows(){return this.rows}getItemOffsetFor(e,n){let i=n==="horizontal"?this.colWidth:this.rowHeight;if(typeof i!="function")return e*i;let r=n==="horizontal"?this.colOffsetCache:this.rowOffsetCache,a=n==="horizontal"?this.colWidthCache:this.rowHeightCache,l=r[e];if(l==null){let u=a.length-1;for(;u<e;)u+=1,this.computeCacheFor(u,n);l=r[e]}return l}getItemSizeCacheFor(e,n){return(n==="horizontal"?this.colWidthCache:this.rowHeightCache)[e]}getRowIndexInPage(e){return e}getPageIndexForRow(e){return 0}getVirtualizedContentSize(){return{height:this.getVirtualizedContentSizeFor("vertical"),width:this.getVirtualizedContentSizeFor("horizontal")}}getVirtualizedContentSizeFor(e){let n=e==="horizontal"?this.cols:this.rows,i=e==="horizontal"?this.colWidth:this.rowHeight,r=e==="horizontal"?this.horizontalTotalSize:this.verticalTotalSize;if(typeof i!="function")return i*n;if(r!==0&&!isNaN(r))return r;let a=e==="horizontal"?this.colOffsetCache:this.rowOffsetCache,l=n?this.getItemSize(n-1,e):0,u=n?a[n-1]:0,d=l+u;return e==="horizontal"?this.horizontalTotalSize=d:this.verticalTotalSize=d,d}notifyDestroy(){let e=this.onDestroyFns;for(let n=0,i=e.length;n<i;n++)e[n]()}destroy(){this.destroyed||(this.notifyDestroy(),this.reset(),this.rowspanParent.clear(),this.colspanParent.clear(),this.alwaysRenderedColumns.clear(),this.horizontalExtendRangeBy=zi,this.verticalExtendRangeBy=zi,this.destroyed=!0,this.onDestroyFns=[],this.onScrollFns=[],this.onScrollStartFns=[],this.onScrollStopFns=[],this.onRenderCountChangeFns.clear(),this.onRenderRangeChangeFns.clear(),this.onVerticalRenderRangeChangeFns.clear(),this.onHorizontalRenderRangeChangeFns.clear())}};var rg={scrollLeft:0,scrollTop:0},No=class{constructor(){this.scrollPosition=rg;this.onScrollFns=[];this.getScrollPosition=()=>this.scrollPosition;this.onScroll=t=>(this.onScrollFns.push(t),()=>{this.onScrollFns=this.onScrollFns.filter(e=>e!==t)});this.setScrollPosition=t=>{this.scrollPosition=t,this.notifyScrollChange()};this.destroy=()=>{this.onScrollFns=[]}}notifyScrollChange(){let{scrollPosition:t}=this,e=this.onScrollFns;for(let n=0,i=e.length;n<i;n++)e[n](t)}};var{rootClassName:ag}=He,Pt=`${ag}ColumnCell`;function Ad(o,t){let e=new Map;function n(i){return t[i]!==!1}return Object.keys(o).forEach(i=>{let a=o[i].columnGroup,l=0;for(n(i)||(l=-1);a;){let u=o[a];if(!u)break;n(a)&&l++,a=u.columnGroup}e.set(i,l)}),e}var _d=require("vue");function Md(o){return(t,e)=>(0,_d.h)(o,{key:t.id,rowInfo:t,cache:e})}var Oo=class extends In{constructor(e,n){super(`${e}: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=e=>typeof this.initialColWidth=="number"?this.initialColWidth:this.initialColWidth(e%this.initialCols);this.onTotalPageCountChangeFns=new Set;this.onTotalPageCountChange=e=>(this.onTotalPageCountChangeFns.add(e),()=>{this.onTotalPageCountChangeFns.delete(e)});this.options=n,this.options.masterBrain&&this.options.masterBrain.onTotalPageCountChange(()=>{this.updateRenderCount({horizontal:!0,vertical:!0})})}computeDirectionalRenderCount(e,n,i,r){if(e==="vertical"||typeof n=="number")return super.computeDirectionalRenderCount(e,n,i,r);let a=0,l=r.width,u=Math.floor(l/this.pageWidth);a+=u*this.initialCols;let d=l-u*this.pageWidth,s=[];for(let c=0;c<this.initialCols;c++)s.push(this.getItemSize(c,e));return a+=Li(d,s.concat(s)),e==="horizontal"?this.maxHorizontalRenderCount=a:this.maxVerticalRenderCount=a,a=Math.min(i,a),a}getRowIndexInPage(e){return this.rowsPerPage?e%this.rowsPerPage:e}getInitialCols(){return this.initialCols}getInitialRows(){return this.initialRows}getPageIndexForRow(e){return Math.floor(e/this.rowsPerPage)}getMatrixCoordinatesForHorizontalLayoutPosition(e){let n=e.rowIndex,i=e.colIndex;return e.rowIndex>=this.rowsPerPage&&this.rowsPerPage>0&&(n=e.rowIndex%this.rowsPerPage,i=Math.floor(e.rowIndex/this.rowsPerPage)*this.initialCols+i),{rowIndex:n,colIndex:i}}getHorizontalLayoutPositionFromMatrixCoordinates(e){let n=e.rowIndex,i=e.colIndex;if(e.colIndex>=this.initialCols&&this.initialCols>0){let r=Math.floor(e.colIndex/this.initialCols);i=e.colIndex-r*this.initialCols,n=this.rowsPerPage*r+e.rowIndex}return{colIndex:Math.min(i,this.initialCols),rowIndex:this.options.isHeader?n:Math.min(n,this.initialRows)}}update(e){let{rows:n,cols:i,rowHeight:r,colWidth:a,width:l,height:u}=e,d=typeof l=="number",s=typeof u=="number",c=d&&l!==this.availableWidth,f=s&&u!==this.availableHeight;c&&(this.availableWidth=l,this.availableRenderWidth=l),f&&(this.availableHeight=u,this.availableRenderHeight=u),(c||f)&&this.notifyAvailableSizeChange();let m=typeof n=="number",p=typeof i=="number",h=m&&n!==this.initialRows,y=p&&i!==this.initialCols;m&&h&&(this.initialRows=n,this.rows=n),p&&y&&(this.initialCols=i,this.cols=i);let C=r!=null,b=a!=null,S=C&&r!==this.rowHeight,w=b&&a!==this.initialColWidth;C&&(this.rowHeight=r),b&&(this.initialColWidth=a,this.colWidth=this.getColWidth);let T=h||S||f,P=y||w||c||T;(P||T)&&this.updateRenderCount({horizontal:P,vertical:T})}getInitialRowHeight(){return typeof this.rowHeight!="number"?this.getRowHeight(0):this.rowHeight}get totalPageCount(){return this.options.masterBrain?this.options.masterBrain.totalPageCount:this._totalPageCount}set totalPageCount(e){this.options.masterBrain||(this._totalPageCount=e)}getPageWidth(){return this.pageWidth}doUpdateRenderCount(e=Xt){let n=this.getInitialRowHeight(),i=0;for(let a=0;a<this.initialCols;a++)i+=this.getColWidth(a);this.pageWidth=i,this.rowsPerPage=Math.floor(this.availableHeight/n);let r=!1;if(!this.options.masterBrain){let a=this.totalPageCount;this.totalPageCount=this.rowsPerPage?Math.ceil(this.initialRows/this.rowsPerPage):0,a!=this.totalPageCount&&(r=!0)}this.visiblePageCount=this.totalPageCount&&this.pageWidth?Math.max(Math.ceil(this.availableWidth/this.pageWidth),1):1,this.availableRenderHeight=this.visiblePageCount*this.rowsPerPage*n,this.cols=Math.max(this.totalPageCount*this.initialCols,this.initialCols),this.rows=this.rowsPerPage,super.doUpdateRenderCount(e),r&&this.notifyTotalPageCountChange()}notifyTotalPageCountChange(){if(this.destroyed)return;let e=this.onTotalPageCountChangeFns;e.forEach(n=>{Ke(()=>{this.destroyed||e.has(n)&&n(this.totalPageCount)})})}getVirtualColIndex(e,n){return this.initialCols*(n?.pageIndex??0)+e}destroy(){this.destroyed||(super.destroy(),this.options.masterBrain=void 0,this.onTotalPageCountChangeFns.clear())}getVirtualizedContentSizeFor(e){return e==="vertical"?this.getInitialRowHeight()*this.rowsPerPage:this.pageWidth*this.totalPageCount}};var Ta=po(Gn());function Ed(...o){if(!o.length)return new Set;let[t,...e]=o;return new Set([...t].filter(n=>e.every(i=>i.has(n))))}function Fd(o,t){let e=new Set;for(let n of o)t(n)&&e.add(n);return e}function ko(o,t){for(let e of o)if(t(e))return e}var Vi=(o,t)=>o-t,Gi=class extends ft{constructor(e,n){super(`${e}:GridCellManager`);this.matrix=new $;this.rowsWithCellsHistory=new Map;this.columnsWithCellsHistory=new Map;this.cellToMatrixPosition=new WeakMap;this.getCellsOutsideRenderRange=e=>{let{start:n,end:i}=e,[r,a]=n,[l,u]=i,d=new Set;return this.matrix.visit(({value:s},c)=>{if(!s)return;let[f,m]=c,p=f<r,h=f>=l,y=m<a,C=m>=u;(p||h||y||C)&&d.add(s)}),d};this.debugId=e,this.pool=n,this.offRemoveCell=this.pool.onRemoveCell(i=>this.onRemoveCell(i))}onRemoveCell(e){let n=this.cellToMatrixPosition.get(e);this.cellToMatrixPosition.delete(e),n&&this.clearCellFromMatrix(e,n,{skipHistory:!1})}set poolSize(e){this.pool.poolSize=e}get poolSize(){return this.pool.poolSize}getDetachedCell(){return this.pool.getDetachedCell()}clearCellFromMatrix(e,n,i){if(this.matrix.delete(n),i.skipHistory)return;let[r,a]=n,l=this.rowsWithCellsHistory.get(r),u=this.columnsWithCellsHistory.get(a);l&&(l.delete(e),l.size===0&&this.rowsWithCellsHistory.delete(r)),u&&(u.delete(e),u.size===0&&this.columnsWithCellsHistory.delete(a))}addCellToMatrix(e,n){let[i,r]=n;this.matrix.set(n,e),this.cellToMatrixPosition.set(e,n);let a=this.rowsWithCellsHistory.get(i),l=this.columnsWithCellsHistory.get(r);a?a.add(e):(a=new Set,a.add(e),this.rowsWithCellsHistory.set(i,a)),l?l.add(e):(l=new Set,l.add(e),this.columnsWithCellsHistory.set(r,l))}setCellPositionInMatrix(e,n){let i=this.cellToMatrixPosition.get(e);if(n==null){i&&this.clearCellFromMatrix(e,i,{skipHistory:!0});return}let[r,a]=n,l=i&&i[0]===r&&i[1]===a;i&&!l&&this.clearCellFromMatrix(e,i,{skipHistory:!1}),this.addCellToMatrix(e,n)}renderNodeAtCell(e,n,i,r){let a=this.getCellAt(i);return a&&a!==n&&this.detachCellAt(i),this.pool.attachCell(n),this.setCellPositionInMatrix(n,i),n.update(e,r),n}getCellPosition(e){let n=this.cellToMatrixPosition.get(e);return!n||this.getCellAt(n)!=e?null:n}getCellAt(e){return this.matrix.get(e)}getCellFor(e,n){let i=this.getCellAt(e);if(i)return i;let[r,a]=e;if(n==="row"){let l=this.rowsWithCellsHistory.get(r);l&&(i=ko(l,u=>!this.isCellAttached(u)))}if(n==="column"){let l=this.columnsWithCellsHistory.get(a);l&&(i=ko(l,u=>!this.isCellAttached(u)))}return i??this.getDetachedCell()}isCellAttached(e){return this.getCellPosition(e)!==null}isCellAttachedAt(e){let n=this.getCellAt(e);return n?this.isCellAttached(n):!1}getMatrix(){let e=this.getRowsWithCells().pop()??-1,n=this.getColumnsWithCells().pop()??-1;return Array.from({length:e+1},(r,a)=>Array.from({length:n+1},(u,d)=>{let s=[a,d],c=this.getCellAt(s);return c?c.getNode():null}))}getAllCells(){return[...this.pool.getAllCells()]}getCellsForRow(e){return this.matrix.getKeysStartingWith([e]).map(n=>this.getCellAt(n)).filter(Boolean)}getOneAttachedCell(){return this.pool.getAttachedCells().values().next().value}getRowsWithCells(){return this.matrix.rawKeysAt([]).sort(Vi)}getColumnsWithCells(){let e=this.matrix.getKeysOfFirstChildOnEachBranchStartingWith([],{excludeSelf:!0});return[...new Set(e.map(i=>i[1])).values()].sort(Vi)}isRowAttached(e){return this.getRowsWithCells().includes(e)}isColumnAttached(e){return this.getColumnsWithCells().includes(e)}detachRow(e){this.matrix.getKeysStartingWith([e]).forEach(i=>this.detachCellAt(i))}detachCol(e){this.matrix.visit((n,i)=>{i[1]===e&&this.detachCellAt(i)})}detachCell(e){return e?(this.pool.detachCell(e)&&this.setCellPositionInMatrix(e,null),!0):!1}detachCells(e){e.forEach(n=>this.detachCell(n))}detachRowsStartingWith(e){let n=this.getRowsWithCells().sort(),i=(0,Ta.default)(n,e,Vi);i<0&&(i=~i),n.slice(i).forEach(a=>this.detachRow(a))}detachColsStartingWith(e){let n=this.getColumnsWithCells().sort(),i=(0,Ta.default)(n,e,Vi);i<0&&(i=~i),n.slice(i).forEach(a=>this.detachCol(a))}detachCellsStartingAt(e){let[n,i]=e;this.matrix.visit((r,a)=>{let[l,u]=a;l>n&&this.detachCellAt(a),l===n&&u>=i&&this.detachCellAt(a)})}detachCellAt(e){let n=this.getCellAt(e);return n?this.detachCell(n):!1}onCellAttachmentChange(e){return this.pool.onCellAttachmentChange(e)}getCellFromListForRow(e,n){return ko(e,i=>this.getCellPosition(i)?.[0]===n)}getCellFromListForColumn(e,n){return ko(e,i=>this.getCellPosition(i)?.[1]===n)}getCellCountInMatrix(){return this.matrix.size}flushPendingAfterCommitWork(){this.pool.flushPendingAfterCommitWork()}destroy(){this.reset()}reset(){this.pool.reset(),this.matrix.clear(),this.rowsWithCellsHistory.clear(),this.columnsWithCellsHistory.clear(),this.offRemoveCell(),this.offRemoveCell=()=>{}}makeDetachedCellsEmpty(){this.pool.getDetachedCells().forEach(e=>{e.update(null)})}withDetachedCells(e){this.pool.getDetachedCells().forEach(e)}};var Nd=po(Gn());var Ki=class extends ft{constructor(e,n){super(`${e}:ListRowManager`);this.indexToRow=new Map;this.rowToIndex=new WeakMap;this.debugId=e,this.pool=n,this.offRemoveRow=this.pool.onRemoveRow(i=>this.onRemoveRow(i))}onRemoveRow(e){let n=this.rowToIndex.get(e);n!=null&&(this.rowToIndex.delete(e),this.indexToRow.delete(n))}set poolSize(e){this.pool.poolSize=e}get poolSize(){return this.pool.poolSize}getDetachedRow(){return this.pool.getDetachedRow()}getRowFor(e){return this.getRowAt(e)??this.getDetachedRow()}setRowIndexInList(e,n){let i=this.rowToIndex.get(e);i!=null&&this.indexToRow.delete(i),n==null?this.rowToIndex.delete(e):(this.rowToIndex.set(e,n),this.indexToRow.set(n,e))}detachStartingWith(e){let n=this.getAttachedIndexes(),i=(0,Nd.default)(n,e,(a,l)=>a-l);i<0&&(i=~i),n.slice(i).forEach(a=>this.detachRowAt(a))}getRowAt(e){return this.indexToRow.get(e)}getRowIndex(e){return this.rowToIndex.get(e)}isRowAttached(e){return this.getRowIndex(e)!=null}isRowAttachedAt(e){return!!this.getRowAt(e)}getList(){let e=Math.max(...this.indexToRow.keys());return Array.from({length:e+1},(i,r)=>{let a=this.indexToRow.get(r);return a?a.getNode():null})}getAttachedCount(){return this.indexToRow.size}forEachAttachedRow(e){this.indexToRow.forEach(e)}getAttachedIndexes(){return Array.from(this.indexToRow.keys()).sort()}getAllRows(){return[...this.pool.getAllRows()]}detachRowAt(e){let n=this.getRowAt(e);n&&(this.setRowIndexInList(n,null),this.pool.detachRow(n))}detachRow(e){let n=this.getRowIndex(e);n!=null&&this.detachRowAt(n)}renderNodeAtRow(e,n,i){let r=this.getRowAt(i);return r&&r!==n&&this.detachRowAt(i),this.pool.attachRow(n),this.setRowIndexInList(n,i),n.update(e),n}makeDetachedRowsEmpty(){this.pool.getDetachedRows().forEach(e=>{e.update(null)})}onRowAttachmentChange(e){return this.pool.onRowAttachmentChange(e)}withDetachedRows(e){this.pool.getDetachedRows().forEach(e)}destroy(){this.reset()}reset(){this.pool.reset(),this.indexToRow.clear(),this.offRemoveRow(),this.offRemoveRow=()=>{}}};var Od=!0,Rn=U(j.y),kd=U(j.scrollTop),Cx=U(j.columnOffsetAtIndex),Sa=U(j.columnOffsetAtIndexWhileReordering),eo=class extends ft{constructor(e,n,i){n=n||"ReactHeadlessTableRenderer";super(n);this.debugId="";this.destroyed=!1;this.scrolling=!1;this.cellHoverClassNames=[];this.cellDetachedClassNames=[];this.lastEnteredRow=-1;this.lastExitedRow=-1;this.hoverRowUpdatesInProgress=new Map;this.infiniteNode=null;this.setDetailTransform=(e,n,{y:i,scrollTop:r,scrollLeft:a})=>{e.style.setProperty(Rn,r?`calc( ${i}px + var(${kd}) )`:`${i}px`),e.style.transform=`translate3d(${a||0}px, var(${Rn}), 0)`};this.setTransform=(e,n,i,{x:r,y:a,scrollLeft:l,scrollTop:u},d)=>{let s=Se.columnOffsets.get(i),c=`${Sa}-${i}`,f=u?`calc( ${a}px + var(${kd}) )`:`${a}px`;e.__currentTransformY!==f&&(e.__currentTransformY=f,e.style.setProperty(Rn,f));let m=`translate3d(var(${c}, ${s}), var(${Rn}), 0)`;e.__transformValue!==m&&(e.__transformValue=m,e.style.transform=m),d!=null};this.getFullyVisibleRowsRange=()=>{let{start:[e],end:[n]}=this.brain.getRenderRange();for(;!this.isRowFullyVisible(e);)if(e++,e===n)return null;for(;!this.isRowFullyVisible(n);)if(n--,n===e)return null;return{start:e,end:n}};this.getScrollPositionForScrollRowIntoView=(e,n={offset:0})=>{if(this.destroyed)return null;let{brain:i}=this,r=i.getScrollPosition(),a=r.scrollLeft,{scrollAdjustPosition:l,offset:u=0}=n;if(this.isRowFullyVisible(e)&&!l)return r;let d=i.getItemOffsetFor(e,"vertical"),s=i.getItemSize(e,"vertical"),c=i.getFixedStartRowsHeight(),f=i.getFixedEndRowsHeight(),m=r.scrollTop,p=i.getAvailableSize();if(!p.height)return null;let h=m+p.height;l||(l=d>h-f?"end":d<m+c?"start":"end");let y=r.scrollTop;if(l==="center"?y=d-Math.floor((i.getAvailableSize().height-c-f)/2):l==="start"?(u=-u,y+=d-m+u-c):(u+=s,y+=d-h+u+f),this.brain.isHorizontalLayoutBrain){let C=n.colIndex??Math.ceil(this.brain.getInitialCols()/2),b=this.getScrollPositionForScrollColumnIntoView(C,{...n,horizontalLayoutPageIndex:this.brain.getPageIndexForRow(e)});b&&(a=b.scrollLeft)}return{scrollLeft:a,scrollTop:y}};this.getScrollPositionForScrollColumnIntoView=(e,n={offset:0})=>{if(this.destroyed)return null;let{brain:i}=this,r=i.getScrollPosition(),a=n.horizontalLayoutPageIndex!=null?{horizontalLayoutPageIndex:n.horizontalLayoutPageIndex}:void 0,{scrollAdjustPosition:l,offset:u=0}=n;if(this.isColumnFullyVisible(e,void 0,a)&&!l)return r;a&&(e=i.getInitialCols()*a.horizontalLayoutPageIndex+e);let d=i.getItemOffsetFor(e,"horizontal"),s=i.getItemSize(e,"horizontal"),c=i.getFixedStartColsWidth(),f=i.getFixedStartColsWidth(),m=r.scrollLeft,p=i.getAvailableSize();if(!p.width)return null;let h=m+p.width;l||(l=d>h-f?"end":d<m+c?"start":"end");let y=r.scrollLeft;return l==="center"?y=d-Math.floor((i.getAvailableSize().width-c-f)/2):l==="start"?(u=-u,y+=d-m+u-c):(u+=s,y+=d-h+u+f),{...r,scrollLeft:y}};this.getScrollPositionForScrollCellIntoView=(e,n,i={offsetLeft:0,offsetTop:0})=>{if(this.destroyed)return null;let r=this.getScrollPositionForScrollColumnIntoView(n,{scrollAdjustPosition:i.colScrollAdjustPosition||i.scrollAdjustPosition,offset:i.offsetLeft}),a=this.getScrollPositionForScrollRowIntoView(e,{scrollAdjustPosition:i.rowScrollAdjustPosition||i.scrollAdjustPosition,offset:i.offsetTop});if(!r||!a)return null;let{scrollLeft:l}=r,{scrollTop:u}=a;return{scrollLeft:l,scrollTop:u}};this.isRowFullyVisible=(e,n=2)=>this.isRowVisible(e,this.brain.getRowHeight(e)-n);this.isRowVisible=(e,n=10)=>{if(!this.isRowRendered(e))return!1;e=this.brain.getPageIndexForRow(e)&&this.brain.rowsPerPage?e%this.brain.rowsPerPage:e;let{brain:r}=this;if(r.isRowFixed(e))return!0;let{start:[a],end:[l]}=this.brain.getRenderRange(),u=Math.floor((a+l)/2);if(e<a||e>=l)return!1;if(e>=u){let d=r.getItemAt(r.getAvailableSize().height+r.getScrollPosition().scrollTop-n,"vertical");return e<=d}if(e<u){let d=r.getItemAt(r.getScrollPosition().scrollTop+n,"vertical");return e>=d}return!0};this.isRowRendered=e=>{if(!this.brain.isHorizontalLayoutBrain)return this.cellManager.isRowAttached(e);let n=e;return e=this.brain.rowsPerPage?e%this.brain.rowsPerPage:e,this.cellManager.getCellsForRow(e).filter(i=>i.getAdditionalInfo()?.renderRowIndex===n).length>0};this.isCellVisible=(e,n)=>this.isRowVisible(e)&&this.isColumnVisible(n);this.isCellFullyVisible=(e,n,i)=>this.isRowFullyVisible(e)&&this.isColumnVisible(n,void 0,i);this.isColumnFullyVisible=(e,n=2,i)=>this.isColumnVisible(e,this.brain.getColWidth(e)-n,i);this.isColumnVisible=(e,n=10,i)=>{if(!this.isColumnRendered(e,i))return!1;let{brain:r}=this;if(r.isColFixed(e))return!0;i&&i.horizontalLayoutPageIndex!=null&&(e=r.getVirtualColIndex(e,{pageIndex:i.horizontalLayoutPageIndex}));let{start:[a,l],end:[u,d]}=r.getRenderRange();if(e<l||e>=d)return!1;let s=Math.floor((l+d)/2);if(e>=s){let c=r.getItemAt(r.getAvailableSize().width+r.getScrollPosition().scrollLeft-n-r.getFixedEndColsWidth(),"horizontal");return e<=c}if(e<s){let c=r.getItemAt(r.getScrollPosition().scrollLeft+n+r.getFixedStartColsWidth(),"horizontal");return e>=c}return!0};this.isCellRendered=(e,n,i)=>this.isRowRendered(e)&&this.isColumnRendered(n,i);this.isColumnRendered=(e,n)=>{let{start:[i]}=this.brain.getRenderRange();return n?.horizontalLayoutPageIndex!=null&&(e=this.brain.getInitialCols()*n.horizontalLayoutPageIndex+e),this.cellManager.isCellAttachedAt([i,e])};this.getExtraSpanCellsForRange=e=>{let{start:n,end:i}=e,[r,a]=n,[l,u]=i;return this.brain.getExtraSpanCellsForRange({horizontal:{startIndex:a,endIndex:u},vertical:{startIndex:r,endIndex:l}})};this.getFixedRanges=e=>{let{fixedRowsStart:n,fixedRowsEnd:i,fixedColsStart:r,fixedColsEnd:a}=this.brain.getFixedCellInfo();if(!n&&!r&&!i&&!a)return[];let l=this.brain.getColCount(),u=this.brain.getRowCount(),{start:d,end:s}=e,[c,f]=d,[m,p]=s,h=[];if(r&&(n&&h.push({rowFixed:"start",colFixed:"start",start:[0,0],end:[n,r]}),i&&h.push({rowFixed:"end",colFixed:"start",start:[u-i,0],end:[u,r]}),h.push({rowFixed:!1,colFixed:"start",start:[c,0],end:[m,r]})),a&&(n&&h.push({colFixed:"end",rowFixed:"start",start:[0,l-a],end:[n,l]}),i&&h.push({colFixed:"end",rowFixed:"end",start:[u-i,l-a],end:[u,l]}),h.push({colFixed:"end",rowFixed:!1,start:[c,l-a],end:[m,l]})),n){let y={start:[0,f],end:[n,p],rowFixed:"start",colFixed:!1};h.push(y)}if(i){let y={rowFixed:"end",colFixed:!1,start:[u-i,f],end:[u,p]};h.push(y)}return h};this.isCellFixed=(e,n)=>{let{fixedRowsStart:i,fixedRowsEnd:r,fixedColsStart:a,fixedColsEnd:l}=this.brain.getFixedCellInfo(),u=this.brain.getColCount(),d=this.brain.getRowCount(),s=!1,c=!1,f=!1;if(e<i&&(s=!0,f="start"),r&&!s){let m=d-r;e>=m&&(s=!0,f="end")}if(n<a&&(c=!0,f="start"),l&&!c){let m=u-l;n>=m&&(c=!0,f="end")}return{row:s?f:!1,col:c?f:!1}};this.isCellCovered=(e,n)=>{let i=this.brain.getRowspanParent(e,n),r=this.brain.getColspanParent(e,n),a=i!=e,l=r!=n;return a||l?[i,r]:!1};this.onMouseEnterNotBound=e=>{let n=this.getMatrixRowIndexFromElement(e.currentTarget);this.onMouseEnter(n)};this.onMouseLeaveNotBound=e=>{let n=this.getMatrixRowIndexFromElement(e.currentTarget);this.onMouseLeave(n)};this.onMouseEnter=e=>{this.lastEnteredRow=e,this.lastExitedRow=-1,!this.scrolling&&e!=-1&&this.addHoverClass(e)};this.addHoverClass=e=>{this.cellManager.getCellsForRow(e).forEach(n=>{let i=n.getElement();i&&this.cellHoverClassNames.forEach(r=>{i.classList.add(r)})})};this.onMouseLeave=e=>{this.lastExitedRow=e,this.lastEnteredRow=-1,!this.scrolling&&e!=-1&&this.removeHoverClass(e)};this.removeHoverClass=e=>{this.cellManager.getCellsForRow(e).forEach(n=>{let i=n.getElement();i&&this.cellHoverClassNames.forEach(r=>{i.classList.remove(r)})})};this.updateHoverClassNamesForRow=e=>{if(this.scrolling||this.hoverRowUpdatesInProgress.has(e))return;this.hoverRowUpdatesInProgress.set(e,!0);let n=()=>{!this.scrolling&&this.lastEnteredRow!=-1&&(this.lastEnteredRow===e?this.addHoverClass(e):this.removeHoverClass(e))};Ke(()=>{this.destroyed||(n(),this.hoverRowUpdatesInProgress.delete(e))})};this.updateElementPosition=(e,n)=>{if(this.destroyed)return;let i=e.getElement(),r=this.cellManager.getCellPosition(e);if(!r)return;let[a,l]=r,u=this.brain.getCellOffset(a,l);if(u==null)return;let{x:d,y:s}=u;if(i){let c=()=>{this.updateHoverClassNamesForRow(a);let f=this.getCellRealCoordinates(a,l);if(i.dataset.rowIndex=f.rowIndex,i.dataset.colIndex=f.colIndex,Od){this.setTransform(i,a,l,{x:d,y:s},null),i.style.willChange="transform",i.style.backfaceVisibility="hidden";let p=(n?n.hidden:!!this.isCellCovered(a,l))?"-1":i.dataset.zIndex||"auto";i.__zIndex!==p&&(i.__zIndex=p,i.style.zIndex=p)}else i.style.display="",i.style.left=`${d}px`,i.style.top=`${s}px`};this.scrolling&&this.brain.isHorizontalLayoutBrain?e.setPendingAfterCommitWork(c):c()}};this.updateDetailElementPosition=e=>{if(this.destroyed)return;let n=e.getElement(),i=this.rowManager.getRowIndex(e);if(i==null)return;let r=this.brain.getItemOffsetFor(i,"vertical");if(r==null)return;let a=r;n&&(n.dataset.detailRowIndex=i,Od&&(this.setDetailTransform(n,i,{y:a,scrollLeft:this.brain.getScrollPosition().scrollLeft}),n.style.willChange="transform",n.style.backfaceVisibility="hidden",n.style.zIndex=n.dataset.zIndex||"auto"))};this.onScrollStart=()=>{this.scrolling=!0,this.lastEnteredRow!=-1&&this.removeHoverClass(this.lastEnteredRow)};this.onScrollStop=()=>{this.scrolling=!1,this.lastEnteredRow!=-1&&this.addHoverClass(this.lastEnteredRow),this.lastExitedRow!=-1&&this.removeHoverClass(this.lastExitedRow)};this.adjustFixedElementsOnScroll=(e=this.brain.getScrollPosition())=>{let{brain:n,cellManager:i,rowManager:r}=this,a=this.brain.getColCount(),l=this.brain.getRowCount(),{fixedColsStart:u,fixedColsEnd:d,fixedRowsStart:s,fixedRowsEnd:c}=this.brain.getFixedCellInfo();if(r.getAttachedCount()&&r.forEachAttachedRow(x=>{let F=r.getRowIndex(x);if(F!=null){let _=this.brain.getItemOffsetFor(F,"vertical");if(_==null)return;let O=x.getElement();if(!O)return;this.setDetailTransform(O,F,{y:_,scrollLeft:e.scrollLeft})}}),!u&&!d&&!s&&!c)return;let f=this.cellManager.getOneAttachedCell();f&&Fs(e,this.getInfiniteNode(f.getElement()));let m=this.brain.getFixedEndColsOffsets({skipScroll:!0}),p=this.brain.getFixedEndRowsOffsets({skipScroll:!0}),{start:h,end:y}=this.brain.getRenderRange(),[C,b]=h,[S,w]=y;function T(x,F,_){let O=i.getCellAt([x,F]);if(O==null)return;let L=n.getCellOffset(x,F),K=O.getElement();K&&L&&_(x,F,K,L)}let P=(x,F,_,{x:O,y:L})=>{this.setTransform(_,x,F,{x:O,y:L,scrollLeft:!0},u-F)},R=(x,F,_,O)=>{this.setTransform(_,x,F,{x:O.x,y:O.y,scrollTop:!0},s-x)},E=(x,F,_,{y:O})=>{let L=m[F];this.setTransform(_,x,F,{x:L,y:O,scrollLeft:!0},a-F)},N=(x,F,_,O)=>{this.setTransform(_,x,F,{x:O.x,y:p[x],scrollTop:!0},l-x)},v=(x,F,_,{x:O,y:L})=>{this.setTransform(_,x,F,{x:O,scrollLeft:!0,y:L,scrollTop:!0},1e5)},D=(x,F,_,{x:O})=>{this.setTransform(_,x,F,{x:O,scrollLeft:!0,y:p[x],scrollTop:!0},2e5)},M=(x,F,_,O)=>{this.setTransform(_,x,F,{x:m[F],y:O.y,scrollLeft:!0,scrollTop:!0},3e5)},A=(x,F,_)=>{this.setTransform(_,x,F,{x:m[F],y:p[x],scrollLeft:!0,scrollTop:!0},4e5)};if(u||d)for(let x=C;x<S;x++){for(let F=0;F<u;F++)T(x,F,P);if(d){let F=a-d;for(let _=F;_<a;_++)T(x,_,E)}}if(s||c)for(let x=b;x<w;x++){for(let F=0;F<s;F++)T(F,x,R);if(c){let F=l-c;for(let _=F;_<l;_++)T(_,x,N)}}if(u&&s)for(let x=0;x<s;x++)for(let F=0;F<u;F++)T(x,F,v);if(u&&c){let x=l-c;for(let F=x;F<l;F++)for(let _=0;_<u;_++)T(F,_,D)}if(d&&s){let x=a-d;for(let F=0;F<s;F++)for(let _=x;_<a;_++)T(F,_,M)}if(d&&c){let x=l-c,F=a-d;for(let _=x;_<l;_++)for(let O=F;O<a;O++)T(_,O,A)}};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=e,this.debugId=n,this.cellManager=new Gi(n,i.cellPool),this.cellManager.onCellAttachmentChange((d,s)=>{s?this.onCellAttached(d):this.onCellDetached(d)}),this.rowManager=new Ki(n,i.rowPool),this.rowManager.onRowAttachmentChange((d,s)=>{s?this.onRowAttached(d):this.onRowDetached(d)}),this.renderRange=this.renderRange.bind(this);let r=e.onScroll(this.adjustFixedElementsOnScroll),a=e.onAvailableSizeChange(()=>{this.adjustFixedElementsOnScroll(),Ke(()=>{this.destroyed||this.adjustFixedElementsOnScroll()})}),l=e.onScrollStart(this.onScrollStart),u=e.onScrollStop(this.onScrollStop);this.onDestroy=()=>{r(),a(),l(),u()}}getInfiniteNode(e){return this.infiniteNode||(this.infiniteNode=Vr(e)),this.infiniteNode}onCellAttached(e){if(this.cellDetachedClassNames.length){let n=e.getElement();n&&this.cellDetachedClassNames.forEach(i=>{n.classList.remove(i)})}}onCellDetached(e){if(this.cellDetachedClassNames.length){let n=e.getElement();n&&this.cellDetachedClassNames.forEach(i=>{n.classList.add(i)})}}onRowAttached(e){if(this.cellDetachedClassNames.length){let n=e.getElement();n&&this.cellDetachedClassNames.forEach(i=>{n.classList.remove(i)})}}onRowDetached(e){if(this.cellDetachedClassNames.length){let n=e.getElement();n&&this.cellDetachedClassNames.forEach(i=>{n.classList.add(i)})}}isCellRenderedAndMappedCorrectly(e,n){let i=!!this.cellManager.getCellAt([e,n]);return{rendered:i,mapped:i}}renderRange(e,{renderCell:n,renderDetailRow:i,force:r,onRender:a}){if(this.destroyed)return[];let{start:l,end:u}=e,d=this.brain.isHorizontalLayoutBrain,{rowManager:s,cellManager:c}=this,f=this.getFixedRanges(e),m=[e,...f],p=this.brain.getAlwaysRenderedColumns();if(p.length>0){let v=e.start[1],D=e.end[1];p.forEach(M=>{v<=M&&M<D||m.push({start:[e.start[0],M],end:[e.end[0],M+1]})})}let h=new Map,y=m.map(this.getExtraSpanCellsForRange).flat();y&&y.forEach(([v,D])=>{h.set(`${v}:${D}`,!0)});let C=m.reduce((v,D)=>v+Ca(D),0),b=i?m.reduce((v,D)=>v+Dd(D),0):0,S=this.brain.getRowCount(),w=this.brain.getColCount();c.detachCellsStartingAt([S,w]);let T=Math.min(S*w,C);i&&(s.detachStartingWith(this.brain.getRowCount()),s.poolSize>b&&(s.poolSize=b));let P=Ed(...m.map(v=>c.getCellsOutsideRenderRange(v)));P=Fd(P,v=>{let D=c.getCellPosition(v);return!(D&&h.has(`${D[0]}:${D[1]}`))}),c.detachCells(P),c.poolSize=T;let R=new Map,E=new Map;m.forEach(v=>{let{start:D,end:M}=v,[A,x]=D,[F,_]=M;for(let O=A;O<F;O++){for(let K=x;K<_;K++){let B=`${O}:${K}`;if(R.has(B))continue;R.set(B,!0);let{rendered:G,mapped:se}=this.isCellRenderedAndMappedCorrectly(O,K);if(O===A||K===x){let Ae=this.isCellCovered(O,K);if(Ae&&h.has(`${Ae[0]}:${Ae[1]}`)){let ge=c.getCellAt([O,K]);ge!=null&&c.detachCell(ge);continue}}if(G&&!r&&se)continue;let Y;G?Y=c.getCellAt([O,K]):Y=c.getCellFor([O,K],d?"row":"column"),Y==null&&(Y=c.getDetachedCell()),this.renderCellAt(O,K,Y,n)}!i||E.has(O)||(E.set(O,!0),s.isRowAttachedAt(O)&&!r)||this.renderDetailRowAtElement(O,this.rowManager.getRowFor(O),i)}}),y.forEach(([v,D])=>{let{rendered:M,mapped:A}=this.isCellRenderedAndMappedCorrectly(v,D);if(M){if(r||!A){let F=[v,D],_=c.getCellAt(F);this.renderCellAt(v,D,_,n)}return}let x=c.getCellFor([v,D],d?"row":"column");x!=null&&this.renderCellAt(v,D,x,n)});let N=c.getAllCells().map(v=>v.getNode());return i&&s.getAllRows().forEach(v=>{N.push(v.getNode())}),this.adjustFixedElementsOnScroll(),a&&a(N),N}renderDetailRowAtElement(e,n,i){if(this.destroyed)return;let r=!1,a=this.brain.getRowHeight(e),l=this.brain.isRowFixedStart(e)?"start":this.brain.isRowFixedEnd(e)?"end":!1,d=i({rowIndex:e,height:a,rowFixed:l,hidden:!!r,onMouseEnter:()=>{},onMouseLeave:()=>{},domRef:n.ref});if(n.isMounted()||n.onMount(s=>{let c=s.getElement();c&&(c.style.position="absolute",c.style.left="0px"),this.updateDetailElementPosition(s)}),!d){this.rowManager.detachRow(n);return}this.rowManager.renderNodeAtRow(d,n,e),this.updateDetailElementPosition(n)}getCellRealCoordinates(e,n){return{rowIndex:e,colIndex:n}}getMatrixRowIndexFromElement(e){let n=Number(e.dataset.rowIndex);return this.brain.isHorizontalLayoutBrain?this.brain.getRowIndexInPage(n):n}renderCellAt(e,n,i,r){if(this.destroyed)return;let a=this.isCellCovered(e,n),l=this.brain.getRowHeight(e),u=this.brain.getColWidth(n),d=this.brain.getRowspan(e,n),s=this.brain.getColspan(e,n),c=d===1?l:this.brain.getRowHeightWithSpan(e,n,d),f=s===1?u:this.brain.getColWidthWithSpan(e,n,s),{row:m,col:p}=this.isCellFixed(e,n),h=!!a,{rowIndex:y,colIndex:C}=this.getCellRealCoordinates(e,n),b=r({rowIndex:y,colIndex:C,height:l,width:u,rowspan:d,colspan:s,rowFixed:m,colFixed:p,hidden:h,heightWithRowspan:c,widthWithColspan:f,onMouseEnter:this.onMouseEnterNotBound,onMouseLeave:this.onMouseLeaveNotBound,domRef:i.ref});i.isMounted()||i.onMount(T=>{let P=T.getElement();P&&(P.style.position="absolute",P.style.left="0px",P.style.top="0px"),this.updateElementPosition(T)});let S=this.brain.isHorizontalLayoutBrain?{renderRowIndex:y,renderColIndex:C}:void 0,w=this.brain.isHorizontalLayoutBrain;if(!b){w?this.cellManager.detachCell(i):this.cellManager.detachCell(i);return}this.cellManager.renderNodeAtCell(b,i,[e,n],S),this.updateElementPosition(i,{hidden:h,rowspan:d,colspan:s})}reset(){this.cellManager.reset(),this.rowManager.reset()}};var Bi=class extends eo{constructor(e,n,i){super(e,n,i);this.setTransform=(e,n,i,r,a)=>{let l=this.getCellRealCoordinates(n,i),{y:u}=r,d=Math.floor(l.rowIndex/this.brain.rowsPerPage),s=Pe.runtime.totalVisibleColumnsWidthVar,c=d?`calc(${s} * ${d})`:"0px",f=Se.columnOffsets.get(l.colIndex),m=`${Sa}-${l.colIndex}`,p=`${u}px`;e.__currentTransformY!==p&&(e.__currentTransformY=p,e.style.setProperty(Rn,p));let h=`calc(var(${m}, ${f}) + ${c})`,y=`var(${Rn})`,C=`translate3d(${h}, ${y}, 0px)`;e.__transformValue!==C&&(e.__transformValue=C,e.style.transform=C)};this.brain=e}getCellRealCoordinates(e,n){return this.brain.getHorizontalLayoutPositionFromMatrixCoordinates({rowIndex:e,colIndex:n})}isCellRenderedAndMappedCorrectly(e,n){let i=this.cellManager.getCellAt([e,n]),r=!!i;if(!r)return{rendered:r,mapped:!1};let a=i.getAdditionalInfo();if(!a)return{rendered:r,mapped:!1};let l=this.getCellRealCoordinates(e,n),u=l.colIndex===a.renderColIndex&&l.rowIndex===a.renderRowIndex;return{rendered:r,mapped:u}}};var Vd=require("vue");var ot=require("vue");function Ld(o,t){if(!(!t||!o)){if(Array.isArray(o)){for(let e of o)Ld(e,t);return}if((0,ot.isVNode)(o)){let e=o.ref;e&&e.i==null&&(e.i=t)}}}var cn=(0,ot.defineComponent)({name:"RenderSlot",props:{name:{type:String,required:!1},useraf:{type:Boolean,required:!1,default:!1},updater:{type:Function,required:!0},afterCommit:{type:Function,required:!1}},setup(o){let t=(0,ot.shallowRef)(o.updater.get()??null),e=null;(0,ot.watch)(()=>[o.updater,o.useraf],([i,r],a,l)=>{t.value=i.get()??null;let u=i.onChange(d=>{r?(e!=null&&cancelAnimationFrame(e),e=requestAnimationFrame(()=>{t.value=d})):t.value=d});l(u)},{immediate:!0,flush:"sync"}),(0,ot.onBeforeUnmount)(()=>{e!=null&&cancelAnimationFrame(e)}),(0,ot.onMounted)(()=>o.afterCommit?.()),(0,ot.onUpdated)(()=>o.afterCommit?.());let n=(0,ot.getCurrentInstance)();return()=>{let i=t.value;return Ld(i,n),i??null}}});var to=class to extends ft{constructor(e){super(e);this.cellRemoveSubscription=he();this.cellAttachmentChangeSubscription=he();this.attachedCells=new Set,this.detachedCells=new Set,this.allCellsOrdered=new Set}destroy(){this.reset()}onRemoveCell(e){return this.cellRemoveSubscription.onChange(i=>{i!=null&&e(i)})}onCellAttachmentChange(e){return this.cellAttachmentChangeSubscription.onChange(i=>{if(i==null)return;let{cell:r,attached:a}=i;e(r,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 e=this.createCellInstance();return this.detachedCells.add(e),this.allCellsOrdered.add(e),e}removeCell(e){this.detachedCells.delete(e),this.attachedCells.delete(e),this.allCellsOrdered.delete(e),e.destroy(),this.cellRemoveSubscription(e)}attachCell(e){return e&&this.attachedCells.has(e)||(e||(e=this.getDetachedCell()),this.detachedCells.delete(e),this.attachedCells.add(e),this.cellAttachmentChangeSubscription({cell:e,attached:!0})),e}detachCell(e){return this.detachedCells.has(e)?!1:(this.attachedCells.delete(e),this.detachedCells.add(e),this.cellAttachmentChangeSubscription({cell:e,attached:!1}),!0)}getDetachedCell(){let{detachedCells:e}=this,n=e.values().next().value;return n||(this.poolSize+=to.POOL_SIZE_INCREMENT,n=e.values().next().value),n||this.error("No cells available in the pool!"),n}get attachedSize(){return this.attachedCells.size}get detachedSize(){return this.detachedCells.size}get poolSize(){return this.allCellsOrdered.size}flushPendingAfterCommitWork(){for(let e of this.attachedCells)e.flushPendingAfterCommitWork()}set poolSize(e){e=Math.ceil(e/to.POOL_SIZE_INCREMENT)*to.POOL_SIZE_INCREMENT;let n=this.poolSize;if(e===n)return;let{detachedCells:i}=this,r=n-e;if(r>0){r>i.size&&(r=i.size,this.debug("Trying to destroy more cells than are currently detached!"));let a=i.values();for(;r>0;){let l=a.next().value;this.removeCell(l),r--}}else for(r=-r;r>0;)this.createCell(),r--}};to.POOL_SIZE_INCREMENT=1;var Hi=to;var zd=new Map,lg=()=>{},wa=class{constructor(t,e){this.element=null;this.mounted=!1;this.pendingAfterCommitWork=null;this.mountSubscription=he();this.afterCommit=()=>{this.flushPendingAfterCommitWork()};let n=zd.get(t)??0,i=`${t}:GridCellVue:${n}`;zd.set(t,n+1),this.debugId=i,this.cellInfo=e,this.updater=he(),this.node=(0,Vd.h)(cn,{key:i,name:i,updater:this.updater,afterCommit:this.afterCommit}),this.ref=r=>{this.element=r,r?(this.mounted=!0,this.mountSubscription(this)):this.mounted=!1}}setPendingAfterCommitWork(t){this.pendingAfterCommitWork=t}flushPendingAfterCommitWork(){if(this.pendingAfterCommitWork){let t=this.pendingAfterCommitWork;this.pendingAfterCommitWork=null,t()}}isMounted(){return this.mounted}onMount(t){return this.mountSubscription.onChange(n=>{n!=null&&t(n)})}destroy(){this.mountSubscription.destroy(),this.updater.destroy(),this.pendingAfterCommitWork=null,this.ref=lg,this.element=null,this.node=null}getNode(){return this.node}update(t,e){this.updater(t),this.cellInfo=e}getAdditionalInfo(){return this.cellInfo}getElement(){return this.element}},Wi=class extends Hi{constructor(e){super(`${e}:GridCellPoolForVue`);this.cellDebugId=e}createCellInstance(){return new wa(this.cellDebugId)}};var Kd=require("vue");var no=class no extends ft{constructor(e){super(e);this.rowRemoveSubscription=he();this.rowAttachmentChangeSubscription=he();this.attachedRows=new Set,this.detachedRows=new Set,this.allRowsOrdered=new Set}destroy(){this.reset()}onRemoveRow(e){return this.rowRemoveSubscription.onChange(i=>{i!=null&&e(i)})}onRowAttachmentChange(e){return this.rowAttachmentChangeSubscription.onChange(i=>{if(i==null)return;let{row:r,attached:a}=i;e(r,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 e=this.createRowInstance();return this.detachedRows.add(e),this.allRowsOrdered.add(e),e}removeRow(e){this.detachedRows.delete(e),this.attachedRows.delete(e),this.allRowsOrdered.delete(e),e.destroy(),this.rowRemoveSubscription(e)}attachRow(e){return e&&this.attachedRows.has(e)||(e||(e=this.getDetachedRow()),this.detachedRows.delete(e),this.attachedRows.add(e),this.rowAttachmentChangeSubscription({row:e,attached:!0})),e}detachRow(e){return this.detachedRows.has(e)?!1:(this.attachedRows.delete(e),this.detachedRows.add(e),this.rowAttachmentChangeSubscription({row:e,attached:!1}),!0)}getDetachedRow(){let{detachedRows:e}=this,n=e.values().next().value;return n||(this.poolSize+=no.POOL_SIZE_INCREMENT),n=e.values().next().value,n||this.error("No rows available in the pool!"),n}get attachedSize(){return this.attachedRows.size}get detachedSize(){return this.detachedRows.size}get poolSize(){return this.allRowsOrdered.size}set poolSize(e){e=Math.ceil(e/no.POOL_SIZE_INCREMENT)*no.POOL_SIZE_INCREMENT;let n=this.poolSize;if(e===n)return;let{detachedRows:i}=this,r=n-e;if(r>0){r>i.size&&(r=i.size,this.debug("Trying to destroy more rows than are currently detached!"));let a=i.values();for(;r>0;){let l=a.next().value;this.removeRow(l),r--}}else for(r=-r;r>0;)this.createRow(),r--}};no.POOL_SIZE_INCREMENT=1;var ji=no;var Gd=new Map,sg=()=>{},va=class{constructor(t){this.element=null;this.mounted=!1;this.mountSubscription=he();let e=Gd.get(t)??0,n=`${t}:ListRowVue:${e}`;Gd.set(t,e+1),this.debugId=n,this.updater=he(),this.node=(0,Kd.h)(cn,{key:`detail-row-${n}`,name:`detail-row-${n}`,updater:this.updater}),this.ref=i=>{this.element=i,i?(this.mounted=!0,this.mountSubscription(this)):this.mounted=!1}}isMounted(){return this.mounted}onMount(t){return this.mountSubscription.onChange(n=>{n!=null&&t(n)})}destroy(){this.mountSubscription.destroy(),this.updater.destroy(),this.ref=sg,this.element=null,this.node=null}getNode(){return this.node}update(t){this.updater(t)}getElement(){return this.element}},$i=class extends ji{constructor(e){super(`${e}:ListRowPoolForVue`);this.rowDebugId=e}createRowInstance(){return new va(this.rowDebugId)}};function Bd(o){return{cellPool:new Wi(o),rowPool:new $i(o)}}function Lo(o){let t=o.isHorizontalLayoutBrain?new Bi(o,`${o.name}:VueHorizontalLayoutTableRenderer`,Bd(`${o.name}:VueHorizontalLayoutTableRenderer`)):new eo(o,`${o.name}:VueHeadlessTableRenderer`,Bd(`${o.name}:VueHeadlessTableRenderer`)),e=he();return o.onDestroy(()=>{t.destroy(),e.destroy()}),{renderer:t,onRenderUpdater:e}}function xn(){return{current:null}}var Hd={};function Ia(o){return`.${Pt}[data-row-index${o?`="${o.rowIndex}"`:""}][data-col-index${o?`="${o.colIndex}"`:""}]`}function Ra(o,t){let e=Xn(o),n=t?new Oo(e,{isHeader:!1}):new In(e),i=`${e}:header`,r=t?new Oo(i,{isHeader:!0,masterBrain:n}):new In(i);n.onScroll(s=>{r.setScrollPosition({scrollLeft:s.scrollLeft,scrollTop:0})});let{renderer:a,onRenderUpdater:l}=Lo(n),{renderer:u,onRenderUpdater:d}=Lo(r);return n.onAvailableSizeChange(s=>{r.update({width:s.width})}),{brain:n,headerBrain:r,renderer:a,onRenderUpdater:l,headerRenderer:u,headerOnRenderUpdater:d}}function Wd({debugId:o,wrapRowsHorizontally:t}){let e={},{brain:n,headerBrain:i,renderer:r,onRenderUpdater:a,headerRenderer:l,headerOnRenderUpdater:u}=Ra(o,!!t),d=xn(),s=Date.now();return{debugWarnings:new Map,renderer:r,onRenderUpdater:a,headerRenderer:l,headerOnRenderUpdater:u,updatedAt:s,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:c=>{if(!d.current)return null;let f=Ia(c);return d.current.querySelector(f)||null},brain:n,headerBrain:i,domRef:d,columnMenuTargetRef:xn(),editingValueRef:xn(),scrollerDOMRef:xn(),portalDOMRef:xn(),focusDetectDOMRef:xn(),activeCellIndicatorDOMRef:xn(),onColumnMenuClick:he(),cellContextMenu:he(),contextMenu:he(),onFilterOperatorMenuClick:he(),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:e,columnVisibilityForGrouping:{},pinnedStartScrollListener:new No,pinnedEndScrollListener:new No,columnsWhenInlineGroupRenderStrategy:void 0,editingCell:null,forceBodyRerenderTimestamp:0}}var jd=o=>({debugId:1,scrollTopKey:1,components:1,id:1,loadingText:1,pivotColumns:1,groupColumn:1,onReady:1,domProps:1,onKeyDown:1,onCellClick:1,onCellDoubleClick:1,focusedClassName:1,focusedWithinClassName:1,focusedStyle:1,focusedWithinStyle:1,onSelfFocus:1,onFocusWithin:1,onSelfBlur:1,onBlurWithin:1,onContextMenu:1,onCellContextMenu:1,onRenderRangeChange:1,onRowMouseEnter:1,onRowMouseLeave:1,onScrollToTop:1,onScrollToBottom:1,onScrollStop:1,scrollToBottomOffset:1,getColumnMenuItems:1,getCellContextMenuItems:1,getContextMenuItems:1,columnPinning:1,editable:1,columnDefaultEditable:1,columnDefaultFilterable:1,columnDefaultGroupable:1,columnDefaultSortable:1,keyboardShortcuts:1,rowStyle:1,cellStyle:1,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:t=>t??!1,columnMenuRealignDelay:t=>t??50,scrollStopDelay:t=>t??250,viewportReservedWidth:t=>t??0,resizableColumns:t=>t??!0,rowDetailCache:t=>new ki(t),hideColumnWhenGrouped:t=>t??!1,columnMinWidth:t=>t??30,columnMaxWidth:t=>t??5e3,columnDefaultWidth:t=>t??200,columnCssEllipsis:t=>t??!0,draggableColumns:1,columnDefaultDraggable:1,headerOptions:t=>({alwaysReserveSpaceForSortIcon:!0,...t}),showSeparatePivotColumnForSingleAggregation:t=>t??!1,sortable:1,hideEmptyGroupColumns:t=>t??!1,pivotTotalColumnPosition:t=>t??"end",pivotGrandTotalColumnPosition:1,licenseKey:t=>t||"",keyboardSelection:t=>t??!0,activeRowIndex:1,activeCellIndex:1,columnOrder:t=>t??!0,header:t=>t??!0,showZebraRows:t=>t??!0,showHoverRows:t=>t??!0,virtualizeColumns:t=>t??!0,rowHeight:t=>typeof t=="number"||typeof t=="function"?t:0,rowDetailHeight:t=>typeof t=="number"||typeof t=="function"?t:300,columnHeaderHeight:t=>typeof t=="number"?t:30,columns:1,columnVisibility:t=>t??Hd,columnGroupVisibility:t=>t??Hd,columnSizing:t=>t||{},columnTypes:t=>t||{},onEditCancelled:1,onEditRejected:1,onEditAccepted:1,persistEdit:1,shouldAcceptEdit:1,onEditPersistError:1,onEditPersistSuccess:1,multiSortBehavior:t=>t??"replace",collapsedColumnGroups:t=>t??new Map,columnGroups:1});function ug(o){let{groupBy:t,groupColumn:e,groupRenderStrategy:n}=o;return n||(e!=null&&typeof e=="object"?"single-column":(t.filter(r=>r.column).length,"multi-column"))}var $d=o=>{o.brain.destroy(),o.headerBrain.destroy(),o.renderer.destroy(),o.headerRenderer.destroy(),o.onRenderUpdater.destroy(),o.headerOnRenderUpdater.destroy(),o.onFlashingDurationCSSVarChange.destroy(),o.onRowHeightCSSVarChange.destroy(),o.onColumnHeaderHeightCSSVarChange.destroy(),o.onColumnMenuClick.destroy(),o.onFilterOperatorMenuClick.destroy(),o.domRef.current=null,o.columnMenuTargetRef.current=null,o.scrollerDOMRef.current=null,o.portalDOMRef.current=null,o.onRowDetailHeightCSSVarChange.destroy(),o.pinnedEndScrollListener.destroy(),o.pinnedStartScrollListener.destroy()};function Ud(o){return o.reduce((t,e,n)=>{let i={groupBy:e,groupIndex:n};return e.field?t.set(e.field,i):e.groupField&&t.set(e.groupField,i),t},new Map)}var Ui=new WeakMap;function qd(){return{rowDetailState:(o,t)=>({callbackParams:[o,{expandRow:t.lastRowToExpandRef.current,collapseRow:t.lastRowToCollapseRef.current}]})}}var Yd=o=>{let{props:t,state:e,oldState:n,parentState:i}=o,r=e.pivotColumnGroups||e.columnGroups,a=e.columnGroups&&e.columnGroups!=n?.columnGroups||e.columnGroups&&e.columnGroupVisibility!=n?.columnGroupVisibility||e.pivotColumnGroups&&e.pivotColumnGroups!=n?.pivotColumnGroups?Ad(r,e.columnGroupVisibility):e.columnGroupsDepthsMap,l=i?.groupBy,u=ug({groupRenderStrategy:t.groupRenderStrategy,groupBy:l,groupColumn:t.groupColumn}),d,s=t.rowDetailRenderer,c=t.components?.RowDetail;if(!s&&c){let y=Ui.get(c);y||(y=Md(c),Ui.set(c,y)),s=y}s&&(d=t.rowDetailState||e.rowDetailState||t.defaultRowDetailState,d&&!(d instanceof bt)&&(d=new bt(d)),d=d||new bt({expandedRows:[],collapsedRows:!0}));let f=e.columnsWhenGrouping||e.columnsWhenInlineGroupRenderStrategy||e.columns,m=d?t.isRowDetailExpanded:void 0;!m&&d&&(m=Ui.get(d),m||(m=y=>d.isRowDetailsExpanded(y.id),typeof d=="object"&&Ui.set(d,m)));let p=s?t.isRowDetailEnabled||!0:!1,h={updatedAt:Date.now(),isTree:i.isTree,rowDetailRenderer:s,rowDetailState:d,isRowDetailExpanded:m,isRowDetailEnabled:p,showColumnFilters:t.showColumnFilters??!!i.filterValue,controlledColumnVisibility:!!t.columnVisibility,groupRenderStrategy:u,groupBy:l,computedColumns:f,initialColumns:t.columns,keyboardNavigation:t.keyboardNavigation??(e.activeCellIndex!=null?"cell":e.activeRowIndex!=null?"row":"cell"),columnHeaderCssEllipsis:t.columnHeaderCssEllipsis??t.columnCssEllipsis??!0,columnGroupsDepthsMap:a,columnGroupsMaxDepth:a!=e.columnGroupsDepthsMap?Math.max(...a.values(),-1):e.columnGroupsMaxDepth,computedColumnGroups:r,rowHeightCSSVar:typeof t.rowHeight=="string"?t.rowHeight:"",rowDetailHeightCSSVar:typeof t.rowDetailHeight=="string"?t.rowDetailHeight:"",columnHeaderHeightCSSVar:typeof t.columnHeaderHeight=="string"?t.columnHeaderHeight||Pe.components.Header.columnHeaderHeight:""};if(e.devToolsDetected&&e.debugId){let y=da.get(e.debugId);y&&(h={...h,...y})}return h};function Xd(o,t){let e={};return Object.keys(o).forEach(n=>{let i=o[n],r=i;if(!r.groupByForColumn||Array.isArray(r.groupByForColumn))return;let{groupByForColumn:a}=r,l=a.field||a.groupField;l&&t.get(l)&&(e[n]=i)}),e}function Zd(o){let{hideEmptyGroupColumns:t,groupByMap:e,computedGroupColumns:n,groupRowsIndexesInDataArray:i,dataArray:r,groupBy:a}=o,l={...o.columnVisibility};if(!t)return Object.keys(n).forEach(c=>{l[c]===!1&&delete l[c]}),l;if(!i||!i.length)return l;let u=a.length,d=0,s=i.length;for(let c=0;c<s;c++){let f=i[c],m=r[f];if(!m.isTreeNode&&m.isGroupRow&&(d=Math.max(d,m.groupNesting-1),d===u-1))break}return Object.keys(n).forEach(c=>{let f=n[c],{groupByForColumn:m}=f;if(Array.isArray(m))return;let p=m.field||m.groupField;if(!p)return;e.get(p).groupIndex>d&&t?l[c]!==!1&&(l[c]=!1):l.hasOwnProperty(c)&&delete l[c]}),l}var dg=10;function Jd(o,t){let{includeHeader:e,columnsToResize:n,columnsToSkip:i}=t,r=`.${kt} > .${ui}`,a=o.current?.querySelectorAll(r),l={},u={};return a&&a.length&&a.forEach(d=>{let s=d.parentElement,c=s.matches(`.${yn}`);if(e===!1&&c)return;let f=s.getAttribute("data-column-id"),m=d.cloneNode(!0);m.style.visibility="hidden",m.style.pointerEvents="none",m.classList.remove(...Tt.split(" ")),m.style.position="absolute",m.style.width="auto",s.appendChild(m);let p=m.offsetWidth;if(s.removeChild(m),!u[f]){let h=ze().getComputedStyle(s);u[f]=parseInt(h.paddingLeft,10)+parseInt(h.paddingRight,10)+parseInt(h.borderLeftWidth,10)+parseInt(h.borderRightWidth,10)+dg}if(p+=u[f],c){let h=0;s.childNodes.forEach(y=>{if(y!==d&&y.nodeType===1){let C=y,b=Math.max(C.offsetWidth,parseInt(C.style.width,10));if(isNaN(b)&&(b=0),h+=b,b>0){let S=ze().getComputedStyle(C);h+=parseInt(S.marginLeft,10)+parseInt(S.marginRight,10)}}}),p+=h}i&&i.has(f)||n&&!n.has(f)||(l[f]=Math.max(p,l[f]||0))}),l}var Qd="InfiniteTable";var fn=require("vue");var ec=o=>o.dataSourceHasGrouping&&o.isGroupRow&&o.childrenLoading||!o.selfLoaded;var Zt=require("vue");var tc="_96uiwi0 _16lm1iw1d _16lm1iwk _16lm1iw9",nc=ve({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 oc="M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z",ic=Object.keys({size:1,expanded:1,defaultExpanded:1,onChange:1,style:1,disabled:1,className:1,direction:1});var qi=`${ht}-expand-collapse`,Pn=(0,Zt.defineComponent)(o=>{let t=()=>o.expanded!==void 0,e=(0,Zt.ref)(o.expanded??o.defaultExpanded??!1);(0,Zt.watch)(()=>o.expanded,i=>{t()&&(e.value=!!i)});let n=()=>{o.onChange?.(!e.value),t()||(e.value=!e.value)};return()=>{let i=e.value?"expanded":"collapsed",{size:r=24,direction:a="start",disabled:l=!1}=o;return(0,Zt.h)("svg",{"data-name":"expand-collapse-icon","data-state":i,"data-disabled":l,xmlns:"http://www.w3.org/2000/svg",height:`${r}px`,viewBox:"0 0 24 24",width:`${r}px`,style:o.style,onClick:l?void 0:n,class:te(o.className,tc,nc({direction:a||"start",expanded:e.value,disabled:l}),`${ht}`,`${qi}`,`${qi}--${i}`,`${qi}--${a==="end"?"end":"start"}`,l?`${qi}--disabled`:"")},[(0,Zt.h)("path",{d:oc})])}},{name:"ExpandCollapseIcon",props:[...ic]});var oo=require("vue");var rc="_16lm1iwb _16lm1iw1d _16lm1iwk";var ac="164.93361431346415 56.97787143782138",lc={margin:"auto",display:"block",shapeRendering:"auto"},sc=Object.keys({size:1,style:1,className:1,viewBox:1});var uc=(0,oo.defineComponent)(o=>()=>(0,oo.h)("svg",{xmlns:"http://www.w3.org/2000/svg",style:{...lc,...o.style},width:"24px",height:"24px",viewBox:o.viewBox??"0 0 100 100",preserveAspectRatio:"xMidYMid",class:te(o.className,rc,"InfiniteIcon","InfiniteIcon-loading")},[(0,oo.h)("circle",{cx:"50",cy:"50",fill:"none","stroke-width":"10",r:"35","stroke-dasharray":ac},[(0,oo.h)("animateTransform",{attributeName:"transform",type:"rotate",repeatCount:"indefinite",dur:"1s",values:"0 50 50;360 50 50",keyTimes:"0;1"})])]),{name:"LoadingIcon",props:[...sc]});var dc=ve({defaultClassName:"_7pupv01",variantClassNames:{align:{start:"_7pupv02",center:"_7pupv03",end:"_7pupv04"}},defaultVariants:{},compoundVariants:[]}),cc="_7pupv00",fc=ve({defaultClassName:"_7pupv05",variantClassNames:{align:{start:"_7pupv06",center:"_7pupv07",end:"_7pupv08"}},defaultVariants:{},compoundVariants:[]});function pc(o,t,e,n){let{groupByForColumn:i,groupIndexForColumn:r,groupRenderStrategy:a}=o,l=i.column?{...i.column}:{},u={header:`Group by ${i.field||i.groupField}`,groupByForColumn:i,render:n.getGroupColumnRender({groupIndexForColumn:r,groupRenderStrategy:a}),...l,renderGroupIcon:n.getGroupColumnRenderGroupIcon({initialRenderGroupIcon:l?.renderGroupIcon,groupIndexForColumn:r,toggleGroupRow:t,groupRenderStrategy:a})};return e&&(typeof e=="function"?u={...u,...e(o,t)}:u={...u,...e}),u}function mc(o,t,e,n){let i=typeof e=="function"?e(o,t):e,r={};return o.sortable!=null&&(r.sortable=o.sortable),{...r,header:"Group",groupByForColumn:o.groupBy,renderSelectionCheckBox:o.selectionMode==="multi-row",render:n.getGroupColumnRender({groupIndexForColumn:0,groupRenderStrategy:"single-column"}),...i,renderGroupIcon:n.getGroupColumnRenderGroupIcon({initialRenderGroupIcon:i?.renderGroupIcon,groupIndexForColumn:0,toggleGroupRow:t,groupRenderStrategy:"single-column"})}}var cg=U(j.columnZIndexAtIndex),fg=U(j.columnVisibilityAtIndex);function hc({rowInfo:o,column:t}){let e=0;if(o.dataSourceHasGrouping)if(o.isGroupRow){let n=t?.groupByForColumn,i=o.groupBy[o.groupBy.length-1],r=!!o.pivotValuesMap,a=r&&!!t?.field&&!!n&&!Array.isArray(n)&&(n.field??n.groupField)!==(i?.field??i?.groupField),l=r&&Array.isArray(n)&&o.groupNesting===o.rootGroupBy.length;e=a||l?o.groupNesting:o.groupNesting-1}else e=o.groupNesting;return{[U(Pe.components.Row.groupNesting)]:e}}function pg({rowInfo:o}){return{[U(Pe.components.Row.groupNesting)]:o.isTreeNode?o.isParentNode?o.treeNesting:o.treeNesting+1:0}}function xa(o,t){return o?typeof o=="function"?o(t):o:void 0}function Pa(o,t,e){return typeof t=="function"?{...o,...t(e)}:{...o,...t}}function gc(o){let{column:t,rowInfo:e,rowIndex:n,rowHeight:i,rowIndexInHorizontalLayoutPage:r,horizontalLayoutPageIndex:a,align:l,verticalAlign:u,stylingParam:d,formattedValueContext:s,groupByColumnReference:c,rowStyle:f,rowClassName:m,cellStyle:p,cellClassName:h,showZebraRows:y,rowActive:C,rowDisabled:b,rowSelected:S,cellSelected:w,cellSelection:T,getData:P,computedVisibleColumns:R,visibleColumnIds:E,computedColumnOrder:N,columnReorderInPageIndex:v}=o,D=E??R.map(Oe=>Oe.id),M=N,A,x={...s,visibleColumnIds:D,allColumnIds:M,rowIndex:n,get rowHasSelectedCells(){return A===void 0&&(A=e.hasSelectedCells(D)),A}},F=!!(e.isTreeNode&&(t.renderTreeIcon||t.renderTreeIconForLeafNode||t.renderTreeIconForParentNode)),_=typeof m=="function"?m(x):m,O;c?.className&&(O=xa(c.className,d)),h&&(O=te(O,xa(h,d))),t.className&&(O=te(O,xa(t.className,d))),F&&(O=te(O,fc({align:l})));let L;e.dataSourceHasGrouping&&t.groupByForColumn&&(L=hc({rowInfo:e,column:t})),F&&(L=pg({rowInfo:e})),f&&(L=typeof f=="function"?{...L,...f(x)}:{...L,...f}),p&&(L=Pa(L,p,d)),c?.style&&(L=Pa(L,c.style,d)),t.style&&(L=Pa(L,t.style,d)),L=L||{},L.height=i,L.zIndex=`var(${cg}-${t.computedVisibleIndex})`,L.visibility=`var(${fg}-${t.computedVisibleIndex}, visible)`;let K=r!=null?r%2===1:(e.indexInAll!=null?e.indexInAll:n)%2===1,B=y?K?"odd":"even":!1,G=!1,se=!1,Y=!1,Ae=!1;if(T&&w){let Oe=P(),we=Oe[e.indexInAll-1],Fe=Oe[e.indexInAll+1],ce=R[t.computedVisibleIndex+1],ee=R[t.computedVisibleIndex-1];G=we?!T.isCellSelected(we.id,t.id):!0,t.computedPinned==="end"&&t.computedFirstInCategory?se=!0:se=ee?!T.isCellSelected(e.id,ee.id):!0,t.computedPinned==="start"&&t.computedLastInCategory?Y=!0:Y=ce?!T.isCellSelected(e.id,ce.id):!0,Ae=Fe?!T.isCellSelected(Fe.id,t.id):!0}let ge=T&&w?{top:G,left:se,right:Y,bottom:Ae}:null,Re=v!=null?a!==v:!1,Ge=te(ge?uu(ge):"",oi(t,[Pt,kt],su,{dragging:!1,insideDisabledDraggingPage:Re,zebra:B,align:l,verticalAlign:u,rowDisabled:b,rowActive:C,cellSelected:w,rowSelected:S,treeNode:e.isTreeNode?e.isParentNode?"parent":"leaf":!1,firstRow:e.indexInAll===0,firstRowInHorizontalLayoutPage:r===0,groupRow:e.isGroupRow,groupCell:e.isGroupRow?!!t.groupByForColumn:!1,rowExpanded:e.isGroupRow?!e.collapsed:!1}),O,_);return{style:L,className:Ge,cellSelectionBorders:ge,zebra:B,columnIsTree:F}}function mg({groupIndexForColumn:o,groupRenderStrategy:t}){return e=>{let{rowInfo:n,renderBag:i,column:r,align:a}=e,{value:l,groupIcon:u,selectionCheckBox:d}=i,s=n,c=t==="multi-column"&&s.isGroupRow&&o+1!==s.groupNesting,f=te(Xo.flex,r.align==="end"?Pr.rowReverse:Pr.row,xl.center,`${Pt}Expander`,t==="single-column"||t==="multi-column"&&(!n.isGroupRow||d||c&&r.field)?dc({align:a}):null);return c?r.field?(0,fn.h)("div",{class:f},[d,(0,fn.h)("div",{class:Tt},[l??null])]):d?(0,fn.h)("div",{class:f},[d]):null:(0,fn.h)("div",{class:f},[u,d,(0,fn.h)("div",{class:Tt},[l??null])])}}function hg({groupIndexForColumn:o,groupRenderStrategy:t,toggleGroupRow:e,initialRenderGroupIcon:n}){return i=>{let{rowInfo:r,value:a,rootGroupBy:l,pivotBy:u,column:d}=i,s=t!=="inline"?r:r.isGroupRow&&r.parents?.[o]||r;if(!s)return null;let c=s.collapsed;if(t==="inline"){if(s.groupCount===1)return a;if(s.groupNesting===o&&c)return null}else if(!s.isGroupRow||t==="multi-column"&&o+1!==s.groupNesting)return null;let f=s.groupKeys,m=null,p=u?(s.groupKeys?.length||0)<l?.length:(s.groupKeys?.length||0)<=l?.length;return ec(s)?m=(0,fn.h)(uc):p&&(m=(0,fn.h)(Pn,{expanded:!c,direction:d.align==="end"?"end":"start",onChange:()=>{e(f)}})),n&&(i.renderBag.groupIcon=m,m=n(i)),m}}function yc(){return{getGroupColumnRender:mg,getGroupColumnRenderGroupIcon:hg}}function bc(o,t,e){return pc(o,t,e,yc())}function Cc(o,t,e){return mc(o,t,e,yc())}function Tc(o){let{pivotColumns:t,groupBy:e,pivotBy:n,selectionMode:i,groupColumn:r,pivotTotalColumnPosition:a,pivotGrandTotalColumnPosition:l,pivotColumn:u,groupRenderStrategy:d,toggleGroupRow:s,columns:c}=o;if(d==="inline")return{columns:void 0,groupColumnIds:[]};let f={},m=[];if(d==="multi-column")e.forEach((p,h,y)=>{let C=bc({groupByForColumn:p,groupBy:e,pivotBy:n,groupIndexForColumn:h,groupCount:y.length,groupRenderStrategy:d,selectionMode:i},s,r),b=C.id||`group-by-${p.field||p.groupField}`;m.push(b),f[b]=C});else if(d==="single-column"&&e.length){let p=Cc({groupCount:e.length,groupBy:e,pivotBy:n,groupRenderStrategy:d,selectionMode:i},s,r),h=p.id||"group-by";m.push(h),f[h]=p}return t?Object.keys(t).forEach(p=>{let h=t[p],y=h.pivotTotalColumn&&h.columnGroup,C=h.pivotTotalColumn&&!h.columnGroup;if(y&&a===!1||C&&l===!1)return;let b={...h};u&&(typeof u=="function"?b={...b,...u({column:b,pivotBy:n,groupBy:e})}:b={...b,...u}),b.inheritFromColumn!==!1&&(b={...typeof b.inheritFromColumn=="string"?c[b.inheritFromColumn]:b.pivotAggregator?.field?gn(c,b.pivotAggregator.field):void 0,...b}),!b.render&&b.renderValue&&(b.render=S=>b.renderValue(S)),f[p]=b}):Object.keys(c).forEach(p=>{let h=c[p];f[p]=h}),{columns:Object.keys(f).length?f:void 0,groupColumnIds:m}}function Sc(o){return typeof o.field=="string"}function wc(o){let{column:t,rowInfo:e,fieldsToColumn:n}=o,i;if(t.groupByForColumn){if(e.isGroupRow){let r=e.groupBy[e.groupBy.length-1];(Array.isArray(t.groupByForColumn)||t.groupByForColumn===r)&&(i=r?n.get(r.field||r.groupField):void 0)}!i&&t.field&&(i=n.get(t.field))}return i}function Kt(o){let{getComputed:t,getDataSourceState:e,getState:n,rowIndex:i,columnId:r,api:a,dataSourceApi:l}=o,{dataArray:u}=e(),d=u[i],{isGroupRow:s,isTreeNode:c}=d,f=t().computedColumnsMap.get(r),{activeRowIndex:m,keyboardNavigation:p,isRowDetailEnabled:h}=n(),y=i===m&&p==="row",C=!h||typeof h=="function"&&!h(d)?!1:a.rowDetailApi.isRowDetailExpanded(d.id)?"expanded":"collapsed",{formattedValue:b,formattedValueContext:{rawValue:S}}=io({column:f,rowInfo:d,rowDetailState:C,columnsMap:t().computedColumnsMap,context:o}),w=lt(f.id,o);return s?{api:a,dataSourceApi:l,column:f,columnApi:w,isParentNode:!1,isGroupRow:!0,isTreeNode:!1,nodeExpanded:!1,rowDetailState:!1,data:d.data,rowActive:y,rowInfo:d,rowSelected:d.rowSelected,value:b,rawValue:S}:c?d.isParentNode?{api:a,dataSourceApi:l,columnApi:w,column:f,nodeExpanded:d.nodeExpanded,isTreeNode:!0,isGroupRow:!1,isParentNode:!0,rowDetailState:C,data:d.data,rowActive:y,rowInfo:d,rowSelected:d.rowSelected,value:b,rawValue:S}:{api:a,dataSourceApi:l,columnApi:w,column:f,nodeExpanded:!1,isTreeNode:!0,isGroupRow:!1,isParentNode:!1,rowDetailState:C,data:d.data,rowActive:y,rowInfo:d,rowSelected:d.rowSelected,value:b,rawValue:S}:{api:a,dataSourceApi:l,columnApi:w,column:f,isTreeNode:!1,isParentNode:!1,isGroupRow:!1,nodeExpanded:!1,rowDetailState:C,data:d.data,rowActive:y,rowInfo:d,rowSelected:d.rowSelected,value:b,rawValue:S}}function vc(o){return Rc(o.column,o.rowInfo)}function Ic(o){let{column:t,context:e,rowInfo:n,visibleColumnIds:i}=o,r=wc({rowInfo:n,column:t,fieldsToColumn:o.fieldsToColumn,groupRenderStrategy:e.getState().groupRenderStrategy}),{getState:a}=e,{editingCell:l}=a(),u=io(o),{formattedValueContext:d}=u,s=e.api.isEditorVisibleForCell({columnId:t.id,rowIndex:n.indexInAll}),c=Object.assign({rowIndexInHorizontalLayoutPage:o.rowIndexInHorizontalLayoutPage,horizontalLayoutPageIndex:o.horizontalLayoutPageIndex,column:o.column,inEdit:s,rowHasSelectedCells:!1},d,{editError:l&&l.primaryKey===n.id&&l.columnId===t.id&&!l.active&&l.accepted instanceof Error?l.accepted:void 0});Object.defineProperty(c,"rowHasSelectedCells",{get(){return n.hasSelectedCells(i)}});let f=typeof t.align=="function"?t.align({isHeader:!1,...c}):t.align??"start",m=typeof t.verticalAlign=="function"?t.verticalAlign({isHeader:!1,...c}):t.verticalAlign??"center";return{inEdit:s,stylingParam:c,formattedValueContext:d,renderFunctions:{renderGroupIcon:t.renderGroupIcon||r?.renderGroupIcon,renderSelectionCheckBox:t.renderSelectionCheckBox,renderRowDetailIcon:t.renderRowDetailIcon,renderTreeIcon:t.renderTreeIcon,renderTreeIconForParentNode:t.renderTreeIconForParentNode,renderTreeIconForLeafNode:t.renderTreeIconForLeafNode,renderValue:t.renderValue||r?.renderValue,renderGroupValue:t.renderGroupValue||r?.renderGroupValue,renderLeafValue:t.renderLeafValue||r?.renderLeafValue},renderParams:gg({rowIndexInHorizontalLayoutPage:o.rowIndexInHorizontalLayoutPage,horizontalLayoutPageIndex:o.horizontalLayoutPageIndex,column:o.column,rowInfo:o.rowInfo,visibleColumnIds:o.visibleColumnIds,columnsMap:o.columnsMap,fieldsToColumn:o.fieldsToColumn,context:o.context,align:f,verticalAlign:m,formattedValueContext:d}),groupByColumnReference:r}}function gg(o){let{column:t,context:e,rowInfo:n,align:i,verticalAlign:r,visibleColumnIds:a,columnsMap:l,fieldsToColumn:u,formattedValueContext:d}=o,{value:s}=d,{api:c,getDataSourceState:f,getState:m,dataSourceApi:p}=e,{editingCell:h}=m(),{indexInAll:y}=n,C=f(),{selectionMode:b,cellSelection:S}=C,w=wc({rowInfo:n,column:t,fieldsToColumn:u,groupRenderStrategy:e.getState().groupRenderStrategy}),T=c.toggleGroupRow,P=S?.isCellSelected(n.id,t.id)??!1,R={column:t,columnsMap:l,fieldsToColumn:u,align:i,verticalAlign:r,cellSelected:P,rowHasSelectedCells:!1,horizontalLayoutPageIndex:o.horizontalLayoutPageIndex,rowIndexInHorizontalLayoutPage:o.rowIndexInHorizontalLayoutPage,...d,editError:h&&h.primaryKey===n.id&&h.columnId===t.id&&!h.active&&h.accepted instanceof Error?h.accepted:void 0,groupByColumn:w,selectionMode:b,api:c,dataSourceApi:p,toggleCurrentRowDetails:()=>c.rowDetailApi.toggleRowDetail(n.id),toggleRowDetails:c.rowDetailApi.toggleRowDetail,expandRowDetails:c.rowDetailApi.expandRowDetail,collapseRowDetails:c.rowDetailApi.collapseRowDetail,toggleCurrentTreeNode:()=>{p.treeApi.toggleNode(n.nodePath)},toggleTreeNode:p.treeApi.toggleNode,expandTreeNode:p.treeApi.expandNode,collapseTreeNode:p.treeApi.collapseNode,selectTreeNode:p.treeApi.selectNode,deselectTreeNode:p.treeApi.deselectNode,toggleTreeNodeSelection:p.treeApi.toggleNodeSelection,toggleCurrentTreeNodeSelection:()=>{n.isTreeNode&&p.treeApi.toggleNodeSelection(n.nodePath)},selectRow:c.rowSelectionApi.selectRow,deselectRow:c.rowSelectionApi.deselectRow,toggleRowSelection:c.rowSelectionApi.toggleRowSelection,toggleGroupRowSelection:c.rowSelectionApi.toggleGroupRowSelection,selectCell:()=>{c.cellSelectionApi.selectCell({rowId:n.id,colId:t.id})},deselectCell:()=>{c.cellSelectionApi.deselectCell({rowId:n.id,colId:t.id})},renderBag:{all:null,value:typeof s=="boolean"?`${s}`:s,selectionCheckBox:null,groupIcon:null,treeIcon:null},selectCurrentRow:()=>{if(!n.isTreeNode)return c.rowSelectionApi.selectRow(n.id,n.dataSourceHasGrouping?n.groupKeys:void 0)},deselectCurrentRow:()=>{if(!n.isTreeNode)return c.rowSelectionApi.deselectRow(n.id,n.dataSourceHasGrouping?n.groupKeys:void 0)},rowIndex:y,toggleGroupRow:T,toggleCurrentGroupRow:()=>{n.isGroupRow&&T(n.groupKeys)},toggleCurrentRowSelection:()=>{if(!(n.isGroupRow||n.isTreeNode))return c.rowSelectionApi.toggleRowSelection(n.id)},toggleCurrentGroupRowSelection:()=>{if(n.isGroupRow)return c.rowSelectionApi.toggleGroupRowSelection(n.isGroupRow?n.groupKeys:[])},rootGroupBy:C.groupBy,pivotBy:C.pivotBy};return Object.defineProperty(R,"rowHasSelectedCells",{get(){return n.hasSelectedCells(a)}}),R}function yg(o,t){if(!o.isGroupRow)return;let e=o.groupData;if(!e.length)return;let n=e[0][t];for(let i=1,r=e.length;i<r;i++)if(e[i][t]!==n)return;return n}function Rc(o,t){let{data:e,isGroupRow:n,dataSourceHasGrouping:i}=t,r=i?t.groupBy:void 0,a=n&&r&&o.groupByForColumn&&(Array.isArray(o.groupByForColumn)||o.groupByForColumn===r[r.length-1])?t.value:Sc(o)?e?.[o.field]:null;return o.field&&t.isGroupRow&&t.reducerData&&t.reducerData[o.field]!=null&&(a=t.reducerData[o.field]),a===void 0&&t.isGroupRow&&o.groupByForColumn&&Sc(o)&&(a=yg(t,o.field)),o.valueGetter&&!t.isGroupRow&&t.data&&(a=o.valueGetter({data:t.data,field:o.field})),a}function bg(o,t,e,n,i){let{rowSelected:r,indexInAll:a}=e,{activeRowIndex:l,keyboardNavigation:u}=n.getState(),d=a===l&&u==="row";return e.isGroupRow?{rowInfo:e,isGroupRow:!0,isTreeNode:!1,isParentNode:!1,nodeExpanded:!1,data:e.data,rowDetailState:!1,rowSelected:r,rowActive:d,value:o,rawValue:o,field:t.field}:e.isTreeNode?e.isParentNode?{rowInfo:e,isGroupRow:!1,isTreeNode:!0,isParentNode:!0,nodeExpanded:e.nodeExpanded,data:e.data,rowDetailState:i,rowSelected:r,rowActive:d,value:o,rawValue:o,field:t.field}:{rowInfo:e,isGroupRow:!1,isTreeNode:!0,isParentNode:!1,nodeExpanded:!1,data:e.data,rowDetailState:i,rowSelected:r,rowActive:d,value:o,rawValue:o,field:t.field}:{rowInfo:e,isGroupRow:!1,isTreeNode:!1,isParentNode:!1,nodeExpanded:!1,data:e.data,rowDetailState:i,rowSelected:r,rowActive:d,value:o,rawValue:o,field:t.field}}function io(o){let{column:t,rowInfo:e,context:n,rowDetailState:i}=o,r=Rc(t,e),a=bg(r,t,e,n,i),l=t.valueFormatter?t.valueFormatter(a):r;return a.value=l,{formattedValue:l,formattedValueContext:a}}function Da(o,t){let{rowIndex:e,primaryKey:n}=t,{dataArray:i}=o.getDataSourceState();if(n!==void 0){let r=o.dataSourceApi.getIndexByPrimaryKey(n);if(r!==-1)return r;if(i[e]?.id!==n)return-1}return i[e]?e:-1}function xc(o,t){let e=Da(o,t);return e===-1?null:Kt({...o,rowIndex:e,columnId:t.columnId})}function zo(o,t){console.warn(`Skipping "${o}": the edited row (primaryKey: ${String(t.primaryKey)}, rowIndex: ${t.rowIndex}) is no longer in the data array.`)}function Aa(o){let{getComputed:t,getState:e,actions:n}=o,i=e().columnMenuVisibleForColumnId;if(!i)return;let r=t(),a=r.computedVisibleColumnsMap,l=r.computedColumnOrder;if(a.has(i)){n.columnMenuVisibleKey=Date.now();return}function u(m,p){let h=l[d+m*p],y=a.get(h);if(y&&y.renderMenuIcon!==!1)return h}let d=l.indexOf(i),s=0,c=-1,f;for(;!f&&s<l.length&&(s++,f=u(s,c),f||(c*=-1,f=u(s,c)),!f););return f&&(n.columnMenuVisibleForColumnId=f),f}function Yi(o,t){let{rowIndex:e,colIndex:n}=o,{rowIndex:i,colIndex:r}=t,[a,l]=n>r?[r,n]:[n,r],[u,d]=e>i?[i,e]:[e,i];return[{rowIndex:u,colIndex:a},{rowIndex:d,colIndex:l}]}function _a(o,t,e){let{rowsPerPage:n}=e;return n?Math.floor(o.rowIndex/n)===Math.floor(t.rowIndex/n):!0}function Pc(o,t,e){if(_a(o,t,e))throw"You should not call this when the positions are in the same page";let{rowsPerPage:n,columnsPerSet:i}=e;if(n===0)throw"rowsPerPage cannot be 0";let r=o,a=t;Math.floor(o.rowIndex/n)>Math.floor(t.rowIndex/n)&&(r=t,a=o);let{rowIndex:l,colIndex:u}=r,{rowIndex:d,colIndex:s}=a,c=Math.floor(l/n),f=Math.floor(d/n),m=l%n,p=d%n,h=Math.min(m,p),y=Math.max(m,p),C=[];for(let b=c;b<=f;b++)for(let S=h;S<=y;S++){let w=b*n+S;if(b===c)for(let T=u;T<i;T++)C.push({rowIndex:w,colIndex:T});else if(b===f)for(let T=0;T<=s;T++)C.push({rowIndex:w,colIndex:T});else for(let T=0;T<i;T++)C.push({rowIndex:w,colIndex:T})}return C}function Cg(o,t){let e=new Set(o);return t.map(n=>e.has(n)?n:null).filter(n=>n!=null)}var Ma=class{constructor(t){this.getCellSelectionPosition=t=>{let e=t.rowId??dn(t.rowIndex,this.getDataSourceState)?.id,n=t.colId??this.getComputed().computedVisibleColumns[t.colIndex].id;return[e,n]};this.setRangeSelected=(t,e,n)=>{let i=this.getDataSourceState(),r=i.cellSelection;if(!r)return;let a=new Be(r);a.debugId=i.debugId??"";let[l,u]=this.getCellSelectionPosition(t),[d,s]=this.getCellSelectionPosition(e),c=this.getComputed().computedVisibleColumnsMap.get(u),f=this.getComputed().computedVisibleColumnsMap.get(s);if(!c||!f)return;let m=c.computedVisibleIndex,p=f.computedVisibleIndex,h=dn(l,this.getDataSourceState),y=dn(d,this.getDataSourceState);if(!h||!y)return;let C=h.indexInAll,b=y.indexInAll,[S,w]=Yi({rowIndex:C,colIndex:m},{rowIndex:b,colIndex:p});for(let T=S.rowIndex;T<=w.rowIndex;T++)for(let P=S.colIndex;P<=w.colIndex;P++){let R={rowIndex:T,colIndex:P},[E,N]=this.getCellSelectionPosition(R);n?a.selectCell(E,N):a.deselectCell(E,N)}this.dataSourceActions.cellSelection=a};this.getCellSelectionPositionsWithFn=(t,e)=>{let n=Ti(this.getDataSourceState),{computedVisibleColumns:i}=this.getComputed(),r=i.map(c=>c.id),a=new Set,l=[],u=new Set;n.filter(c=>{i.forEach(f=>{this.isCellSelected({rowId:c.id,colId:f.id})&&(a.has(f.id)||a.add(f.id),u.has(c.id)||(u.add(c.id),l.push(c)))})});let d=Cg(Array.from(a),r),s=l.map(c=>d.map(f=>this.isCellSelected({rowId:c.id,colId:f})?t(c,f):e));return{columnIds:d,positions:s}};this.getAllCellSelectionPositions=()=>this.getCellSelectionPositionsWithFn((t,e)=>[t.id,e],null);this.mapCellSelectionPositions=(t,e)=>this.getCellSelectionPositionsWithFn(t,e);this.deselectAll=()=>{let t=this.getDataSourceState(),e=t.cellSelection;if(!e)return;let n=new Be(e);n.debugId=t.debugId??"",n.deselectAll(),this.dataSourceActions.cellSelection=n};this.clear=()=>{this.deselectAll()};this.selectAll=()=>{let t=this.getDataSourceState(),e=t.cellSelection;if(!e)return;let n=new Be(e);n.debugId=t.debugId??"",n.selectAll(),this.dataSourceActions.cellSelection=n};this.selectRange=(t,e)=>{this.setRangeSelected(t,e,!0)};this.deselectRange=(t,e)=>{this.setRangeSelected(t,e,!1)};this.isCellSelected=t=>{let[e,n]=this.getCellSelectionPosition(t);return this.getDataSourceState().cellSelection?.isCellSelected(e,n)??!1};this.selectCell=t=>{let e=this.getDataSourceState(),n=e.cellSelection;if(!n)return;let[i,r]=this.getCellSelectionPosition(t),a=t.clear?new Be:new Be(n);a.debugId=e.debugId??"",a.selectCell(i,r),this.dataSourceActions.cellSelection=a};this.deselectCell=t=>{let e=this.getDataSourceState(),n=e.cellSelection;if(!n)return;let[i,r]=this.getCellSelectionPosition(t),a=new Be(n);a.debugId=e.debugId??"",a.deselectCell(i,r),this.dataSourceActions.cellSelection=a};this.selectColumn=(t,e)=>{e?.clear&&this.deselectAll();let n=this.getDataSourceState(),i=n.cellSelection;if(!i)return;let r=new Be(i);r.debugId=n.debugId??"",r.selectColumn(t),this.dataSourceActions.cellSelection=r};this.deselectColumn=t=>{let e=this.getDataSourceState(),n=e.cellSelection;if(!n)return;let i=new Be(n);i.debugId=e.debugId??"",i.deselectColumn(t),this.dataSourceActions.cellSelection=i};this.getComputed=t.getComputed,this.getDataSourceState=t.getDataSourceState,this.dataSourceActions=t.dataSourceActions}};function Dc(o){return new Ma(o)}function Ac(o){let{dataSourceApi:t,getState:e,actions:n}=o,i={collapseAllDetails(){n.rowDetailState=new bt({collapsedRows:!0,expandedRows:[]})},expandAllDetails(){n.rowDetailState=new bt({expandedRows:!0,collapsedRows:[]})},isRowDetailCollapsed(r){let a=e().isRowDetailExpanded;if(!a)return!0;let l=t.getRowInfoByPrimaryKey(r);return l?!a(l):!0},isRowDetailEnabledForRow(r){let{isRowDetailEnabled:a}=e();if(!a)return!1;if(typeof a=="function"){let l=t.getRowInfoByPrimaryKey(r);return l?a(l):!1}return!0},isRowDetailExpanded(r){return!i.isRowDetailCollapsed(r)},collapseRowDetail(r){let a=e(),l=a.rowDetailState;if(!l){console.error("Cannot collapse row details via rowDetailState, as no props.rowDetailState is provided.");return}let u=new bt(l);u.collapseRowDetails(r),a.lastRowToExpandRef.current=null,a.lastRowToCollapseRef.current=r,n.rowDetailState=u},expandRowDetail(r){let a=e(),l=a.rowDetailState;if(!l){console.error("Cannot expand row details via rowDetailState, as no props.rowDetailState is provided.");return}let u=new bt(l);u.expandRowDetails(r),a.lastRowToCollapseRef.current=null,a.lastRowToExpandRef.current=r,n.rowDetailState=u},toggleRowDetail(r){i.isRowDetailExpanded(r)?i.collapseRowDetail(r):i.expandRowDetail(r)}};return i}function pn(o,t,e){return Math.min(Math.max(o,t),e)}function Xi(o,t,e){let n=o().dataArray,i=0,r=n.length-1,a=t;do{a+=e;let l=n[a];if(!l)return a<i?i:r;if(!l.rowDisabled)return a}while(a>=i&&a<=r);return pn(a,i,r)}function Tg(o,t){let{getState:e,getDataSourceState:n,actions:i,api:r,dataSourceApi:a}=o,{key:l}=t,u=n().dataArray,d=u.length,s=e(),{brain:c}=s,{activeRowIndex:f}=s;if(f==null)return!1;let{start:[m],end:[p]}=c.getRenderRange(),h=f,y=p-m-1,C=0,b=d-1,S={ArrowDown:()=>{f=Xi(n,f,1)},ArrowUp:()=>{f=Xi(n,f,-1)},ArrowLeft:()=>{let T=u[f];if(c.isHorizontalLayoutBrain){let P=c.rowsPerPage;f-P>=C?f=f-P:S.ArrowUp();return}return T&&T.isGroupRow?r.collapseGroupRow(T.groupKeys):T&&r.rowDetailApi.isRowDetailEnabledForRow(T.id)?r.rowDetailApi.collapseRowDetail(T.id):!1},ArrowRight:()=>{let T=u[f];if(c.isHorizontalLayoutBrain){let P=c.rowsPerPage;f+P<=b?f=f+P:S.ArrowDown();return}return T&&T.isGroupRow?r.expandGroupRow(T.groupKeys):T&&r.rowDetailApi.isRowDetailEnabledForRow(T.id)?r.rowDetailApi.expandRowDetail(T.id):!1},Enter:()=>{let T=u[f];return T&&T.isGroupRow?r.toggleGroupRow(T.groupKeys):T&&T.isTreeNode&&T.isParentNode?a.treeApi.toggleNode(T.nodePath):r.rowDetailApi.isRowDetailEnabledForRow(T.id)?r.rowDetailApi.toggleRowDetail(T.id):!1},PageDown:()=>{f=Math.min(f+y,d-1)},PageUp:()=>{f=Math.max(f-y,C)},End:()=>{f=b},Home:()=>{f=C}},w=S[l];return w?(w(),h!==f?(i.activeRowIndex=f,!0):!1):!1}function Ea(o,t){let{api:e,getState:n,getComputed:i,getDataSourceState:r,dataSourceApi:a}=o,{key:l,shiftKey:u}=t,d=r().dataArray,s=n(),{activeCellIndex:c,brain:f}=s;if(!c)return!1;let[m,p]=c,{start:[h,y],end:[C,b]}=f.getRenderRange(),S=C-h-1,w=b-y-1,T=r().dataArray.length-1,P=i().computedVisibleColumns.length-1,R=0,E=0;m=pn(m,0,T),p=pn(p,0,P);let N={ArrowDown:()=>{m=pn(m+1,R,T)},ArrowUp:()=>{m=pn(m-1,R,T)},ArrowLeft:()=>{if(p===E)if(m!==R&&(p=P),f.isHorizontalLayoutBrain){let D=f.rowsPerPage;m-D>=R?m=m-D:N.ArrowUp()}else N.ArrowUp();else p=pn(p-1,E,P)},ArrowRight:()=>{if(p===P)if(m!==T&&(p=E),f.isHorizontalLayoutBrain){let D=f.rowsPerPage;m+D<=T?m=m+D:N.ArrowDown()}else N.ArrowDown();else p=pn(p+1,E,P)},Enter:()=>{let D=d[m];return D&&D.isGroupRow?e.toggleGroupRow(D.groupKeys):D&&D.isTreeNode&&D.isParentNode?a.treeApi.toggleNode(D.nodePath):D&&e.rowDetailApi.isRowDetailEnabledForRow(D.id)?e.rowDetailApi.toggleRowDetail(D.id):!1},PageDown:()=>{u?p=Math.min(p+w,P):m=Math.min(m+S,T)},PageUp:()=>{u?p=Math.max(p-w,E):m=Math.max(m-S,R)},End:()=>{u?p=P:m=T},Home:()=>{u?p=E:m=R}},v=N[l];return v?(v(),[m,p]):!1}function Sg(o,t){let e=Ea(o,t);return e?(o.actions.activeCellIndex=e,!0):!1}var wg={ArrowUp:!0,ArrowDown:!0,ArrowLeft:!0,ArrowRight:!0,PageUp:!0,PageDown:!0,Home:!0,End:!0,Enter:!0," ":!0};function _c(o,t){let{key:e}=t,{getState:n}=o,i=n(),{activeRowIndex:r,activeCellIndex:a,keyboardNavigation:l,cellContextMenuVisibleFor:u,contextMenuVisibleFor:d}=i;return u||d||!wg[e]?!1:r!=null&&l==="row"?Tg(o,t):a!=null&&l==="cell"?Sg(o,t):!1}var Fa=class{constructor(t){this.param=t}setKeyboardNavigation(t){this.param.actions.keyboardNavigation=t}setActiveCellIndex(t){this.param.actions.activeCellIndex=t}setActiveRowIndex(t){this.param.actions.activeRowIndex=t}gotoRowWithDirection(t){let{getDataSourceState:e,getState:n}=this.param,{activeRowIndex:i,keyboardNavigation:r}=n();if(r!=="row")return console.error("Keyboard navigation is not enabled for rows"),!1;if(i==null)return!1;let a=Xi(e,i,t);return a!==i?(this.param.actions.activeRowIndex=a,a):!1}gotoRow(t){return this.gotoRowWithDirection(t)}gotoNextRow(){return this.gotoRow(1)}gotoPreviousRow(){return this.gotoRow(-1)}gotoCell(t){let{direction:e}=t,n=e=="top"?"ArrowUp":e=="bottom"?"ArrowDown":e=="left"?"ArrowLeft":"ArrowRight",i=Ea(this.param,{key:n,shiftKey:!1});return i===!1?!1:(this.param.actions.activeCellIndex=i,i)}};function Mc(o){return new Fa(o)}function Ec(o,t){return o.id?o.id===t.id:!!(o.field&&o.field===t.field)}var Na=class{constructor(t){this.columnApiById=new Map;this.getVisibleRenderRange=()=>this.getState().brain.getRenderRange();this.hideFilterOperatorMenu=()=>{this.actions.filterOperatorMenuVisibleForColumnId=null};this.setGroupRenderStrategy=t=>{this.actions.groupRenderStrategy=t};this.getColumnOrder=()=>this.getComputed().computedColumnOrder;this.getComputedColumnById=t=>this.getComputed().computedColumnsMap.get(t);this.getVisibleColumnOrder=()=>{let t=this.getColumnOrder(),e=this.getComputed().computedVisibleColumnsMap;return t.filter(n=>e.has(n))};this.persistEdit=async t=>{t=t??{};let{editingCell:e,editingValueRef:n}=this.getState();if(!e)return Promise.resolve(new Error("no edit in progress"));await new Promise(f=>requestAnimationFrame(f));let i=this.getComputed().computedColumnsMap.get(e.columnId),r=t.value??e.value;!e.active&&e.waiting!=="persist"&&(this.actions.editingCell={...e,active:!1,waiting:"persist"});let a=Da({...this.context,api:this},e);if(a===-1){let f=new Error(`Cannot persist edit: the edited row (primaryKey: ${String(e.primaryKey)}, rowIndex: ${e.rowIndex}) is no longer in the data array.`);return this.actions.editingCell={...e,active:!1,accepted:!1,waiting:!1,persisted:f},Promise.resolve(f)}let l={...Kt({rowIndex:a,columnId:e.columnId,...this.context,api:this}),value:r,initialValue:e.initialValue},u=r;n.current=null,i.getValueToPersist&&(u=await i.getValueToPersist(l)),l.value=u,e.value=u;let d=this.getState().persistEdit??(()=>{if(!l.column.field)return r;let f=this.getDataSourceState().primaryKey,m=l.data&&typeof f=="string"?{[f]:l.data[f],[l.column.field]:u}:{...l.data,[l.column.field]:u};return this.context.dataSourceApi.updateData(m)}),s;try{s=await d(l)}catch(f){s=f}let c=s instanceof Error?s:!0;return this.actions.editingCell={...e,active:!1,accepted:!1,waiting:!1,persisted:c},Promise.resolve(c)};this.clearEditInfo=()=>{this.actions.editingCell=null};this.isEditInProgress=()=>{let{editingCell:t}=this.getState();return t?t.active:!1};this.isEditorVisibleForCell=t=>{let{rowIndex:e,columnId:n}=t,{dataArray:i}=this.getDataSourceState(),{editingCell:r}=this.getState(),a=i[e];return!a||!r?!1:r.columnId===n&&r.primaryKey===a.id&&!!(r.active||r.waiting)};this.confirmEdit=t=>this.stopEdit({value:t});this.stopEdit=async t=>{let e=this.getState(),{editingCell:n,editingValueRef:i}=e;if(!n)return!0;t||(t={});let r=t.value??i.current;if(!t.cancel&&!t.reject){let{rowIndex:a,columnId:l}=n;this.actions.editingCell={...e.editingCell,value:r,active:!1,waiting:"accept"};let{computedColumnsMap:u}=this.getComputed(),d=u.get(l),s=e.shouldAcceptEdit??d.shouldAcceptEdit,c=s?s({...Kt({...this.context,api:this,dataSourceApi:this.context.dataSourceApi,columnId:l,rowIndex:a}),value:r,initialValue:n.initialValue}):!0;return await new Promise(f=>requestAnimationFrame(f)),Promise.resolve(c).then(f=>{if(f===!0)return this.actions.editingCell={...e.editingCell,active:!1,accepted:!0,persisted:!1,waiting:"persist",value:r},!0;throw f}).catch(f=>(f instanceof Error||(f=new Error(`Edit rejected: ${f}`)),this.actions.editingCell={...n,value:r,persisted:!1,active:!1,waiting:!1,accepted:f},{reject:f,value:r}))}return t.cancel&&n?.active?(this.actions.editingCell={...n,active:!1,cancelled:!0,waiting:!1,persisted:!1},{cancel:!0,value:r}):t.reject&&n?.active?(this.actions.editingCell={...n,value:r,active:!1,persisted:!1,waiting:!1,accepted:t.reject},{reject:t.reject,value:r}):!0};this.cancelEdit=()=>this.stopEdit({cancel:!0});this.rejectEdit=t=>this.stopEdit({reject:t});this.getColumnAtIndex=t=>this.getComputed().computedVisibleColumns[t]??null;this.isCellEditable=t=>{let{rowIndex:e,primaryKey:n,columnId:i}=t,r=e??this.context.dataSourceApi.getIndexByPrimaryKey(n),{computedColumnsMap:a}=this.getComputed(),l=a.get(i);if(!l||!l.computedEditable||l.groupByForColumn)return Promise.resolve(!1);let u=this.getDataSourceState().dataArray[r];if(!u||u.isGroupRow)return Promise.resolve(!1);if(l.computedEditable===!0)return Promise.resolve(!0);let d=l.computedEditable(Kt({...this.context,api:this,columnId:i,rowIndex:r}));return typeof d=="boolean"?Promise.resolve(d):d};this.getColumnApi=t=>{let e=typeof t=="string"?t:this.getComputed().computedVisibleColumns[t]?.id,n=this.columnApiById.get(e);if(n)return n;let i=lt(t,{...this.context,api:this});return i&&this.columnApiById.set(i.getColumnId(),i),i};this.isColumnSortable=t=>this.getColumnApi(t)?.isSortable()??!1;this.getCellValue=t=>this.getCellValues(t)?.value??null;this.getCellValues=t=>{let{rowIndex:e,primaryKey:n,columnId:i}=t,{dataSourceApi:r,getState:a}=this.context,{computedColumnsMap:l}=this.getComputed(),u=e??r.getIndexByPrimaryKey(n),d=l.get(i),s=r.getRowInfoByIndex(u),c=s?.id;if(!s||!d)return d||console.warn(`No column found with id: "${i}"`),s||console.warn(`No row found with index: "${u}" or primary key: "${c}"`),null;let f=this,{isRowDetailEnabled:m}=a(),p=!m||typeof m=="function"&&!m(s)?!1:this.rowDetailApi.isRowDetailExpanded(s.id)?"expanded":"collapsed",h=io({column:d,rowInfo:s,columnsMap:l,context:{...this.context,api:f},rowDetailState:p});return{value:h.formattedValueContext.value,formattedValue:h.formattedValue,rawValue:h.formattedValueContext.rawValue}};this.getVerticalRenderRange=()=>{let t=this.getState().brain.getRenderRange();return{renderStartIndex:t.start[0],renderEndIndex:t.end[0]}};this.setColumnOrder=t=>{this.actions.columnOrder=t};this.setVisibilityForColumnGroup=(t,e)=>{let n={...this.getState().columnGroupVisibility};e?delete n[t]:n[t]=!1,this.actions.columnGroupVisibility=n};this.collapseAllGroupRows=()=>{let t=this.getDataSourceState(),e=new St(t.groupRowsState);e.collapseAll(),this.dataSourceActions.groupRowsState=e};this.collapseGroupRow=t=>this.getDataSourceState().groupRowsState.isGroupRowExpanded(t)?(this.toggleGroupRow(t),!0):!1;this.expandGroupRow=t=>this.getDataSourceState().groupRowsState.isGroupRowCollapsed(t)?(this.toggleGroupRow(t),!0):!1;this.toggleGroupRow=t=>{let e=this.getDataSourceState(),n=new St(e.groupRowsState);if(n.toggleGroupRow(t),this.dataSourceActions.groupRowsState=n,e.lazyLoad){let i=[jn,...t],r=e.originalLazyGroupData.get(i);n.isGroupRowExpanded(t)?r?.cache||Yn(e.data,e,this.dataSourceActions,{groupKeys:t},this.context.getDataSourceMasterContext()):r?.cache||(e.lazyLoadCacheOfLoadedBatches.getKeysStartingWith(t).forEach(l=>{e.lazyLoadCacheOfLoadedBatches.delete(l)}),this.dataSourceActions.lazyLoadCacheOfLoadedBatches=$.clone(e.lazyLoadCacheOfLoadedBatches),e.originalLazyGroupData.delete(i),this.dataSourceActions.originalLazyGroupDataChangeDetect=qt())}};this.toggleSortingForColumn=(t,e)=>{if(!this.getComputed().computedColumnsMap.get(t))return;let i=this.getSortingForColumn(t);i===null?i=1:i=i===1?-1:null,this.setSortingForColumn(t,i,e)};this.getState=()=>this.context.getState();this.getComputed=()=>this.context.getComputed();this.getDataSourceState=()=>this.context.getDataSourceState();this.scrollCellIntoView=(t,e,n={offset:0})=>{let i=this.getState(),r=this.getComputed(),a=e;if(typeof e=="string"){let h=r.computedVisibleColumnsMap.get(e);if(!h)return!1;a=h.computedVisibleIndex}if(i.brain.isHorizontalLayoutBrain){n=n||{};let h=i.brain.getPageIndexForRow(t);n.horizontalLayoutPageIndex=h||0}let l=i.renderer.getScrollPositionForScrollColumnIntoView(a,n),u=i.renderer.getScrollPositionForScrollRowIntoView(t,n);if(!l||!u)return!1;let d={scrollLeft:l.scrollLeft,scrollTop:u.scrollTop},s=i.brain.getScrollPosition(),c=i.brain.scrollLeftMax,f=i.brain.scrollTopMax;if(c<0&&f<0)return!0;let m=d.scrollLeft>c+(n.offset||0),p=d.scrollTop>f+(n.offset||0);return m&&p?!1:(d.scrollLeft!==s.scrollLeft&&!m&&(i.scrollerDOMRef.current.scrollLeft=d.scrollLeft),d.scrollTop!==s.scrollTop&&!p&&(i.scrollerDOMRef.current.scrollTop=d.scrollTop),!0)};this.context=t,this.rowSelectionApi=vl({dataSourceActions:t.dataSourceActions,getDataSourceState:t.getDataSourceState}),this.keyboardNavigationApi=Mc({getState:t.getState,getDataSourceState:t.getDataSourceState,actions:t.actions,getComputed:t.getComputed,api:this,dataSourceApi:t.dataSourceApi}),this.rowDetailApi=Ac({getState:t.getState,actions:t.actions,dataSourceApi:t.dataSourceApi}),this.cellSelectionApi=Dc({dataSourceActions:t.dataSourceActions,getDataSourceState:t.getDataSourceState,getComputed:t.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(t){let e={actions:this.actions,getState:this.getState,getComputed:this.getComputed},n=this.getState().columnMenuRealignDelay;(!n||n<0)&&(Aa(e),t?.()),setTimeout(()=>{this.isDestroyed()||(Aa(e),t?.())},n)}isDestroyed(){return!this.getState().domRef.current}async startEdit(t){let{columnId:e,rowIndex:n,primaryKey:i,value:r}=t,a=n??this.context.dataSourceApi.getIndexByPrimaryKey(i);return this.isCellEditable({rowIndex:a,columnId:e}).then(async l=>{if(l){let u=this.getDataSourceState().dataArray,s=this.getComputed().computedColumnsMap.get(e),c=u[a],f=r??vc({column:s,rowInfo:c}),m=f;s.getValueToEdit&&(f=await s.getValueToEdit(Kt({...this.context,rowIndex:a,columnId:e,api:this}))),this.actions.editingCell={active:!0,accepted:!1,persisted:!1,columnId:e,value:f,initialValue:m,rowIndex:a,primaryKey:u[a]?.id}}return l})}setSortingForColumn(t,e,n){let{computedColumnsMap:i}=this.getComputed(),r=i.get(t);if(!r||this.getSortingForColumn(t)===e&&this.getDataSourceState().multiSort===!1)return;if(e===null){this.setSortInfoForColumn(t,null,n);return}let l=!!r.pivotColumn,u=r.groupByForColumn,d=l?void 0:r.field,s=u?Array.isArray(u)?u:[u]:[],c=s.map(p=>p.valueGetter?h=>p.valueGetter({data:h,field:p.field}):p.field?p.field:p.groupField??void 0).filter(qn);c.length&&(d=c);let f=r.computedSortType;if(s.length&&f===Ut){let p=this.getState().initialColumns;f=s.flatMap(y=>{let C=y.field??y.groupField,b=C?i.get(C):null;if(b)return b.computedSortType;let S=C?gn(p,C):void 0;return S?S.sortType||(typeof S.type=="string"?S.type:"string"):[Ut]})}s.length&&!Array.isArray(f)&&(f=[f]);let m={dir:e,id:r.id,field:d,type:f};!l&&r.valueGetter&&(m.valueGetter=p=>r.valueGetter({data:p,field:r.field})),this.setSortInfoForColumn(t,m,n)}setSortInfoForColumn(t,e,n){let i=this.getDataSourceState(),r=this.getComputed().computedColumnsMap.get(t);if(!r)return;if(!i.multiSort){this.dataSourceApi.setSortInfo(e?[e]:null);return}let a=r.field,l={id:t,field:a},u=i.sortInfo?.slice()??[];if(e===null){u=u.filter(c=>!Ec(c,l)),this.dataSourceApi.setSortInfo(u);return}let d=!1;if((n?.multiSortBehavior??this.getState().multiSortBehavior)==="replace"){this.dataSourceApi.setSortInfo([e]);return}u=u.map(c=>d?c:Ec(c,l)?(d=!0,e):c),d||u.push(e),this.dataSourceApi.setSortInfo(u)}getSortTypeForColumn(t){let e=this.getComputed().computedColumnsMap.get(t);return e?e.computedSortType:null}getSortInfoForColumn(t){let e=this.getComputed().computedColumnsMap.get(t);return e?e.computedSortInfo:null}getSortingForColumn(t){let e=this.getSortInfoForColumn(t);return e?e.dir:null}setPinningForColumn(t,e){let n={...this.getState().columnPinning};e===!1?delete n[t]:n[t]=e,this.actions.columnPinning=n}setColumnFilter(t,e){let n=this.getComputed().computedColumnsMap.get(t);if(!n)return;let i=this.getDataSourceState(),{filterTypes:r}=i,a;if(n.computedFilterValue)a={...n.computedFilterValue,filter:{...n.computedFilterValue.filter}};else{let l=n.computedFilterType;if(!r[l])return;let u={filter:{type:l,value:e,operator:r[l].defaultOperator},valueGetter:n.valueGetter};(n.field||typeof n.groupByForColumn=="string")&&(u.field=n.field||n.groupByForColumn),a=u}a.id=n.id,a.filter.value=e,this.setFilterValueForColumn(t,a)}setColumnFilterOperator(t,e){let n=this.getComputed().computedColumnsMap.get(t);if(!n)return;let i=this.getDataSourceState(),{filterTypes:r}=i,a=n.computedFilterType,l=r[a].operators,u=l.find(c=>c.name===e)??l.find(c=>c.name===r[a].defaultOperator),d=u.name,s;n.computedFilterValue?(s={...n.computedFilterValue,filter:{...n.computedFilterValue.filter,operator:d}},u.defaultFilterValue!==void 0&&(s.filter.value=u.defaultFilterValue)):(s={filter:{operator:d,type:a,value:u.defaultFilterValue!==void 0?u.defaultFilterValue:[...r[a].emptyValues.values()][0]},valueGetter:n.valueGetter},n.field&&(s.field=n.field)),s.id=n.id,this.setFilterValueForColumn(t,s)}setFilterValueForColumn(t,e){let n=this.getComputed().computedColumnsMap.get(t);if(!n)return;let r=this.getDataSourceState().filterValue??[],a=!1;r=r.map(l=>l===n.computedFilterValue?(a=!0,e):l),a||r.push(e),this.dataSourceActions.filterValue=r}removeColumnFilter(t){let e=this.getComputed().computedColumnsMap.get(t);if(!e)return;let i=this.getDataSourceState().filterValue??[],r=!1;i=i.filter(a=>a===e.computedFilterValue?(r=!0,!1):!0),r&&(this.dataSourceActions.filterValue=i)}clearColumnFilter(t){let e=this.getComputed().computedColumnsMap.get(t);if(!e)return;let n=this.getDataSourceState(),i=n.filterValue??[],r=!1;i=i.map(a=>{if(a===e.computedFilterValue){let l=e.computedFilterValue.filter.type,u=n.operatorsByFilterType[l],d=n.filterTypes[l];if(r=!0,!d)return null;let s=a.filter.operator??d?.defaultOperator,f=u[s].defaultFilterValue??(d.emptyValues||[])[0]??void 0;return{...a,filter:{...a.filter,operator:s,value:f}}}return a}).filter(qn),r&&(this.dataSourceActions.filterValue=i)}setVisibilityForColumn(t,e){let n={...this.getState().columnVisibility};e?delete n[t]:n[t]=!1,this.actions.columnVisibility=n}getVisibleColumnsCount(){return this.getComputed().computedVisibleColumns.length}setColumnVisibility(t){this.actions.columnVisibility=t}get scrollContainer(){return this.getState().scrollerDOMRef.current}get scrollLeftMax(){return this.getState().brain.scrollLeftMax}get scrollTopMax(){return this.getState().brain.scrollTopMax}get scrollLeft(){return this.getState().brain.getScrollPosition().scrollLeft}set scrollLeft(t){let e=this.getState();e.scrollerDOMRef.current&&(e.scrollerDOMRef.current.scrollLeft=Math.max(t,0))}get scrollTop(){return this.getState().brain.getScrollPosition().scrollTop}set scrollTop(t){let e=this.getState();e.scrollerDOMRef.current&&(e.scrollerDOMRef.current.scrollTop=Math.max(t,0))}scrollRowIntoView(t,e={offset:0}){let n=this.getState(),i=this.getComputed(),r=n.brain.getScrollPosition(),a=e.columnId,l;!a&&n.brain.isHorizontalLayoutBrain&&i.computedVisibleColumns.length>0&&(a=i.computedVisibleColumns[Math.ceil(i.computedVisibleColumns.length/2)].id,l=i.computedVisibleColumnsMap.get(a)?.computedVisibleIndex);let u=n.renderer.getScrollPositionForScrollRowIntoView(t,{...e,colIndex:l});if(!u)return!1;let d=n.brain.scrollTopMax,s=u.scrollLeft!==r.scrollLeft,c=u.scrollTop<=d+(e.offset||0);return!c&&!s?!1:(c&&u.scrollTop!==r.scrollTop&&(n.scrollerDOMRef.current.scrollTop=u.scrollTop),s&&(n.scrollerDOMRef.current.scrollLeft=u.scrollLeft),!0)}scrollColumnIntoView(t,e={offset:0}){let n=this.getState(),r=this.getComputed().computedVisibleColumnsMap.get(t);if(!r)return!1;let a=r.computedVisibleIndex,l=n.renderer.getScrollPositionForScrollColumnIntoView(a,e);if(!l)return!1;let u=n.brain.getScrollPosition(),d=n.brain.scrollLeftMax;return l.scrollLeft>d+(e.offset||0)?!1:(l.scrollLeft!==u.scrollLeft&&(n.scrollerDOMRef.current.scrollLeft=l.scrollLeft),!0)}};function Fc(o){return new Na(o)}function Nc(o,t){return o<t?[o,t]:[t,o]}var Zi=class{constructor(t){this.multiSelectStartIndex=0;this.getIdForIndex=t.getIdForIndex,this.isRowDisabledAt=t.isRowDisabledAt}set rowSelectionState(t){this._rowSelectionState=t}get rowSelectionState(){return this._rowSelectionState}selectRange(t,e){let[n,i]=Nc(t,e),r=this.rowSelectionState;for(let a=n;a<=i;a++){let l=this.getIdForIndex(a);this.isRowDisabledAt(a)||r.selectRow(l)}}deselectRange(t,e){let[n,i]=Nc(t,e),r=this.rowSelectionState;for(let a=n;a<=i;a++){let l=this.getIdForIndex(a);this.isRowDisabledAt(a)||r.deselectRow(l)}}resetClick(t){this.rowSelectionState.deselectAll();let e=this.getIdForIndex(t);this.rowSelectionState.selectRow(e),this.multiSelectStartIndex=t,this.multiSelectEndIndex=void 0}singleAddClick(t){let e=this.getIdForIndex(t);if(this.rowSelectionState.isRowSelected(e))this.rowSelectionState.deselectRow(e),this.rowSelectionState.isRowSelected(this.getIdForIndex(t+1))&&(this.multiSelectStartIndex=t+1);else{this.rowSelectionState.selectRow(e),this.multiSelectStartIndex=t;let n;for(let i=t-1;i>=0;i--){let r=this.getIdForIndex(i);if(this.rowSelectionState.isRowSelected(r))n=i;else break}this.multiSelectEndIndex=n}}multiSelectClick(t){this.multiSelectEndIndex!=null&&this.deselectRange(this.multiSelectStartIndex,this.multiSelectEndIndex),this.selectRange(this.multiSelectStartIndex,t),this.multiSelectEndIndex=t}};var Ji=class{constructor(t){this.multiSelectStartPosition={rowIndex:0,colIndex:0};this.getPrimaryKeyByIndex=t.getPrimaryKeyByIndex,this.getColumnIdByIndex=t.getColumnIdByIndex}getCellSelectionPosition(t){let{rowIndex:e,colIndex:n}=t,i=this.getPrimaryKeyByIndex(e),r=this.getColumnIdByIndex(n);if(!(i===void 0||!r))return[i,r]}set cellSelectionState(t){this._cellSelectionState=t}get cellSelectionState(){return this._cellSelectionState}resetClick(t){this.cellSelectionState.deselectAll();let e=this.getCellSelectionPosition(t);e&&(this.cellSelectionState.deselectAll(),this.cellSelectionState.selectCell(...e),this.multiSelectStartPosition=t,this.multiSelectEndPosition=void 0)}singleAddClick(t){let e=this.getCellSelectionPosition(t);if(e)if(this.cellSelectionState.isCellSelected(...e)){this.cellSelectionState.deselectCell(...e);let n={rowIndex:t.rowIndex+1,colIndex:t.colIndex};this.getCellSelectionPosition(n)&&(this.multiSelectStartPosition=n)}else this.cellSelectionState.selectCell(...e),this.multiSelectStartPosition=t,this.multiSelectEndPosition=void 0}multiSelectClick(t,e){!this.multiSelectStartPosition||!this.getCellSelectionPosition(t)||(this.multiSelectEndPosition&&this.deselectRange(this.multiSelectStartPosition,this.multiSelectEndPosition,e),this.selectRange(this.multiSelectStartPosition,t,e),this.multiSelectEndPosition=t)}setRangeSelected(t,e,n,i){if(i.horizontalLayout&&!_a(t,e,i)){Pc(t,e,{rowsPerPage:i.rowsPerPage,columnsPerSet:i.columnsPerSet}).forEach(s=>{let c=this.getCellSelectionPosition({rowIndex:s.rowIndex,colIndex:s.colIndex});c&&(n?this.cellSelectionState.selectCell(...c):this.cellSelectionState.deselectCell(...c))});return}let[r,a]=Yi(t,e),l=this.getCellSelectionPosition(r),u=this.getCellSelectionPosition(a);if(!(!l||!u))for(let d=r.rowIndex;d<=a.rowIndex;d++)for(let s=r.colIndex;s<=a.colIndex;s++){let c=this.getCellSelectionPosition({rowIndex:d,colIndex:s});c&&(n?this.cellSelectionState.selectCell(...c):this.cellSelectionState.deselectCell(...c))}}deselectRange(t,e,n){this.setRangeSelected(t,e,!1,n)}selectRange(t,e,n){this.setRangeSelected(t,e,!0,n)}};var Jt=require("vue");var Oc=nn("CSSVariableWatch"),kc=tn("CSSVariableWatch"),Lc={position:"absolute",pointerEvents:"none",width:"0px",height:"0px",lineHeight:0,fontSize:0,overflow:"hidden"};var Vo=(0,Jt.defineComponent)({name:"CSSNumericVariableWatch",props:{varName:{type:String,required:!0},allowInts:{type:Boolean,default:!1},onChange:{type:Function,required:!0}},setup(o){let t={current:null},e=0,n=null;return(0,Jt.onMounted)(()=>{let i=t.current;if(!i)return;let r=i.getBoundingClientRect().height;r!=null?(e=r,kc(`Variable ${o.varName} found and equals ${r}.`),o.onChange(r)):Oc(`Specified variable ${o.varName} not found or does not have a numeric value.`),n=Qn(i,({height:a})=>{a!=null&&a!==e&&(e=a,o.onChange(a))})}),(0,Jt.onBeforeUnmount)(()=>{n?.(),n=null}),()=>{let i=o.varName.startsWith("var(")?o.varName:`var(${o.varName})`;return(0,Jt.h)("div",{"data-name":"css-variable-watcher","data-var":o.varName,style:Lc},[(0,Jt.h)("div",{ref:r=>{t.current=r??null},style:{height:o.allowInts?`calc(1px * ${i})`:i}})])}}});var Oa=o=>{let t=0;return(...e)=>{t&&cancelAnimationFrame(t),t=requestAnimationFrame(()=>{t=0,o(...e)})}};function zc(o,t){ka(o,t),Ig(o,t),t.detail===2&&vg(o,t),o.getState().onCellClick?.(o,t)}function vg(o,t){if(vo(t.target))return;let{onCellDoubleClick:e}=o.getState(),n={preventEdit:!1};if(e){let a=e(o,t);a&&typeof a=="object"&&(n={...n,...a})}if(n.preventEdit)return;let r=o.getComputed().computedVisibleColumns[o.colIndex];o.api.startEdit({rowIndex:o.rowIndex,columnId:r.id})}function Ig(o,t){let{getDataSourceState:e,getState:n,getComputed:i,rowIndex:r,colIndex:a,dataSourceActions:l}=o,u=e(),{selectionMode:d,cellSelection:s}=u;if(!s||d!=="multi-cell")return;let{multiCellSelector:c,computedVisibleColumns:f}=i(),{brain:m,debugId:p}=n(),{rowsPerPage:h}=m,y=f.length,C=new Be(s);C.debugId=p??"",c.cellSelectionState=C;let b={rowIndex:r,colIndex:a};if(t.metaKey||t.ctrlKey)c.singleAddClick(b);else if(t.shiftKey){let S=!!n().wrapRowsHorizontally;c.multiSelectClick(b,S?{horizontalLayout:S,rowsPerPage:h,columnsPerSet:y}:{horizontalLayout:S})}else c.resetClick(b);l.cellSelection=C}function ka(o,t){let{rowIndex:e,getDataSourceState:n,getComputed:i,dataSourceActions:r,api:a,cloneRowSelection:l}=o,{multiRowSelector:u,renderSelectionCheckBox:d}=i(),s=n(),{selectionMode:c,groupBy:f,dataArray:m,isTree:p}=s;if(f.length||p||m[e]?.rowDisabled)return!1;if(c==="multi-row"){if(d&&!t.key)return!1;let{rowSelection:y}=s;if(y=l(y),u.rowSelectionState=y,y&&typeof y=="object")return t.shiftKey?u.multiSelectClick(e):t.metaKey||t.ctrlKey?u.singleAddClick(e):u.resetClick(e),r.rowSelection=y,!0}else if(c==="single-row"){let C=m[e].id;t.metaKey||t.ctrlKey?a.rowSelectionApi.toggleRowSelection(C):a.rowSelectionApi.selectRow(C)}return!1}function Vc(o,t){t.detail!==2&&void 0}var Rg={Enter:!0," ":!0,a:!0};function Gc(o,t){let{getState:e,getDataSourceState:n,dataSourceActions:i,api:r,dataSourceApi:a,cloneRowSelection:l,cloneTreeSelection:u}=o,{key:d,ctrlKey:s,metaKey:c}=t;if(!Rg[d])return!1;let f=e(),m=n(),{activeRowIndex:p,activeCellIndex:h,keyboardNavigation:y,keyboardSelection:C}=f,{selectionMode:b,groupBy:S,rowSelection:w,treeSelectionState:T,isTree:P}=m;if(C===!1)return!1;let R=y==="row"&&p!=null?p:y==="cell"&&h!=null?h[0]:null,E=R!=null?m.dataArray[R]:null;if(!E||R==null)return!1;if(b==="single-row"&&d===" ")return r.rowSelectionApi.toggleRowSelection(E.id),!0;if(b!=="multi-row")return!1;if(d==="a"&&(s||c)){if(P&&T){let v=u(T);return v.selectAll(),i.treeSelection=v,!0}let N=l(w);return N.selectAll(),i.rowSelection=N,!0}if(d===" "){if(S.length)return E.isGroupRow&&E.groupKeys?r.rowSelectionApi.toggleGroupRowSelection(E.groupKeys):r.rowSelectionApi.toggleRowSelection(E.id),!0;if(P){if(E.isTreeNode&&E.nodePath)return a.treeApi.toggleNodeSelection(E.nodePath),!0}else{let N={key:t.key,metaKey:t.metaKey,ctrlKey:t.ctrlKey,shiftKey:t.shiftKey,preventDefault:()=>t.preventDefault()},{renderSelectionCheckBox:v}=o.getComputed();return v&&(N.metaKey=!1,N.ctrlKey=!0),ka({...o,rowIndex:R},N)}}return!1}var Kc=["input","textarea","select","[tabindex]","a[href]","button","object"].join(", "),Bc=o=>Array.from(o.querySelectorAll(Kc)).filter(e=>!!e.offsetParent),La=o=>o.querySelector(Kc);var Wc=po(Gn());async function Hc(o,t=10,e=300){return new Promise((n,i)=>{let r=Date.now();function a(){if(Date.now()-r>e)return i(!1);if(!o()){setTimeout(a,t);return}n(!0)}a()})}var xg=10,Pg=(o,t)=>o-t;function za(o,t){let{getComputed:e,getDataSourceState:n,getState:i,api:r,dataSourceApi:a}=t,{editingCell:l,isRowDetailEnabled:u}=i(),{dataArray:d}=n(),{computedVisibleColumns:s,computedColumnsMap:c}=e(),f=s[o.colIndex];if(!f)return!1;if(l&&l.columnId===f.id&&l.rowIndex===o.rowIndex)return!0;if(!f.contentFocusable)return!1;if(f.contentFocusable===!0)return!0;let m=d[o.rowIndex],p=!u||typeof u=="function"&&!u(m)?!1:r.rowDetailApi.isRowDetailExpanded(m.id)?"expanded":"collapsed",h=lt(f.id,t);return f.contentFocusable({column:f,...io({column:f,rowInfo:m,columnsMap:c,context:t,rowDetailState:p}).formattedValueContext,columnApi:h,api:r,dataSourceApi:a})}function jc(o,t,e){let n=e.getState().editingCell;return Dg(o,t,e,{isCellFocusable:za,isColumnElligible:r=>n&&n.columnId===r.id?!0:!!r.contentFocusable})}function $c(o,t,e){let n=(0,Wc.default)(e,o+t,Pg);return n<0&&(n=~n,t>0&&n>=e.length||t<0&&n===0)?null:e[n]??null}globalThis.getNextCol=$c;function Dg(o,t,e,n){let{isColumnElligible:i,isCellFocusable:r}=n,a=e.getComputed().computedVisibleColumns.filter(i).reduce((c,f)=>(c.push(f.computedVisibleIndex),c),[]);if(!a.length)return null;let{getDataSourceState:l}=e,{dataArray:u}=l(),d=o.rowIndex,s=o.colIndex;for(;d!=null||s!=null;){if(s=s===null?a[t===-1?a.length-1:0]:$c(s,t,a),s===null){if(d+=t,d<0||d>=u.length)return null;continue}if(r({colIndex:s,rowIndex:d},e))return{colIndex:s,rowIndex:d}}return null}async function Uc([o,t],e){let{api:n}=e;return new Promise((i,r)=>{let a=xg,l=null,u=!1;function d(s=0){s++,hn(l),l=Ke(async()=>{if(u=n.scrollCellIntoView(o,t,{offset:30}),!u&&s<a&&d(s),u){try{await Hc(()=>!!e.getState().getDOMNodeForCell({rowIndex:o,colIndex:t}))}catch(c){r(c);return}i(!0)}})}d()})}var Ag=`.${Pt}`;function qc(o,t){if(t.key!=="Tab")return!1;let e=t.shiftKey?-1:1,n=t.target,i=o.getState().scrollerDOMRef.current,r=document.activeElement===i||n===i;if(!i||r&&e===-1)return!1;let a=r?null:zn(n,Ag),l=null,u=null;if(a)l=Number(a.getAttribute("data-row-index")),u=Number(a.getAttribute("data-col-index"));else if(r){let{activeCellIndex:s}=o.getState();[l,u]=s||[0,0]}if(l==null||u==null||isNaN(l)||isNaN(u))return!1;let d=r&&za({colIndex:u,rowIndex:l},o)?{rowIndex:l,colIndex:u}:jc({rowIndex:l,colIndex:u},e,o);if(!d){if(e===-1)i.focus();else{let s=Bc(document.body),c=o.getState().focusDetectDOMRef.current,f=s.findIndex(p=>p===c);s[f+1]?.focus()}return!0}return Uc([d.rowIndex,d.colIndex],o).then(()=>{let s=o.getState().getDOMNodeForCell(d);if(!s)return;La(s)?.focus()}),!0}var Yc={control:"ctrl"},Xc={"control|cmd":"ctrl","cmd|control":"ctrl","ctrl|cmd":"ctrl","cmd|ctrl":"ctrl"},_g={esc:"escape"},Jc={cmd:o=>o.metaKey,alt:o=>o.altKey,ctrl:o=>o.ctrlKey,shift:o=>o.shiftKey},Qc=Object.keys(Jc),Va=new Set(Qc),Mg=new Set(["shift","alt"]);function ef(o,t){return Array.isArray(t)?t.some(e=>Zc(o,e)):Zc(o,t)}function Zc(o,t){let e=o.key.toLowerCase(),n=t.split("+").map(f=>f.toLowerCase().trim()),i=n.find(f=>Xc[f]),r=n.map(f=>Yc[f]||Xc[f]||_g[f]||f),a=r.filter(f=>Va.has(f)),l=r.filter(f=>!Va.has(f)),u=Qc.reduce((f,m)=>(f[m]=Jc[m](o),f),{});i&&u.cmd&&(u.cmd=!1,u.ctrl=!0);let d=Object.keys(u).filter(f=>u[f]);if(!a.every(f=>u[f]===!0))return!1;if(l.includes("*")){if(d.length<a.length||d.filter(m=>!Mg.has(m)).length)return!1}else if(a.length!=d.length)return!1;return!l.length||Va.has(e)||e==="meta"||Yc[e]?!1:l.reduce((f,m)=>f?m==="*"||e===m:!1,!0)}async function tf(o,t){let e={...o,cloneRowSelection:a=>Yo(a,o.getDataSourceState),cloneTreeSelection:a=>wi(a,o.getDataSourceState)},{onKeyDown:n}=o.getState(),i={preventEdit:!1,preventEditStop:!1,preventDefaultForTabKeyWhenEditing:!0,preventSelection:!1,preventNavigation:!1};if(n){let a=n(o,t);a&&typeof a=="object"&&(i={...i,...a})}if(!i.preventSelection&&Gc(e,t)&&t.preventDefault(),(qc(e,t)||!o.getState().focusedWithin&&!i.preventNavigation&&_c(e,t))&&t.preventDefault(),!i.preventEdit&&t.key==="Enter"&&!o.api.isEditInProgress()){let{activeCellIndex:a}=o.getState();if(a){let[l,u]=a,d=o.getComputed().computedVisibleColumns[u];d.computedEditable&&o.api.startEdit({rowIndex:l,columnId:d.id})}}o.api.isEditInProgress()&&(t.key==="Escape"&&!i.preventEditStop&&o.api.stopEdit({cancel:!0}),t.key==="Tab"&&i.preventDefaultForTabKeyWhenEditing&&t.preventDefault());let{keyboardShortcuts:r}=o.getState();if(r)for await(let a of r){if(!ef(t,a.key)||a.when&&!await a.when(o))continue;let l=await a.handler(o,t);if(l&&l.stopNext)break}}var tr=require("vue");var Ne=require("vue");var Qi="__is_infinite_menu_component";function Ga(o){return!!o.tagName}function rf(o){let{alignTarget:t,alignAnchor:e,constrainTo:n,alignPosition:i}=o,r=Ee.from(Ga(t)?t.getBoundingClientRect():t),a=Ee.from(Ga(e)?e.getBoundingClientRect():e),l=n?Ee.from(Ga(n)?n.getBoundingClientRect():n):null;if(!l)return{...nf({anchorRect:a,targetRect:r,position:i[0]}),index:0};let u=null;for(let d=0,s=i.length;d<s;d++){let c=nf({anchorRect:a,targetRect:r,position:i[d],constrainRect:l});if(d===0&&(u={...c,index:0}),c.valid)return{...c,index:d}}return u}function nf(o){let t=Ee.from(o.targetRect),e=Ee.from(o.anchorRect),n=o.constrainRect?Ee.from(o.constrainRect):null,{position:i}=o,[r,a]=i,l=of(t,r),u=of(e,a),d=l.getDistanceToPoint(u);t.shift(d);let s=n?n.contains(t):!0;return{alignPosition:i,alignedRect:t,valid:s,distance:d}}function of(o,t){return t==="TopLeft"?Je.from({top:o.top,left:o.left}):t==="TopCenter"?Je.from({top:o.top,left:o.left+(o.width>0?Math.round(o.width/2):0)}):t==="TopRight"?Je.from({top:o.top,left:o.left+o.width}):t==="BottomLeft"?Je.from({left:o.left,top:o.top+o.height}):t==="BottomCenter"?Je.from({left:o.left+(o.width>0?Math.round(o.width/2):0),top:o.top+o.height}):t==="BottomRight"?Je.from({left:o.left+o.width,top:o.top+o.height}):t==="CenterLeft"?Je.from({left:o.left,top:o.top+(o.height>0?Math.round(o.height/2):0)}):t==="CenterRight"?Je.from({left:o.left+o.width,top:o.top+(o.height>0?Math.round(o.height/2):0)}):Je.from({left:o.left+(o.width>0?Math.round(o.width/2):0),top:o.top+(o.height>0?Math.round(o.height/2):0)})}function Eg(o){return o&&typeof o.then=="function"||o instanceof Promise}function lf(o){return o==null||typeof o=="string"?!1:typeof o.tagName=="string"}async function af(o){return typeof o=="function"&&(o=o()),Eg(o)&&(o=await o),typeof o=="string"&&(o=document.querySelector(o)),o&&lf(o)&&(o=o.getBoundingClientRect()),o?Ee.from(o):null}async function sf(o){let t=null;typeof o=="function"?t=o():t=o;function e(n){let i=null;return typeof n=="string"&&(i=document.querySelector(n)),lf(n)&&(i=n),i||null}return e(await t)}async function Ka(o,t){let{constrainTo:e,alignTo:n,alignPosition:i}=t;Object.keys(n).length===2&&n.top!==void 0&&n.left!==void 0&&(n={...n,width:0,height:0}),typeof e=="boolean"&&(e=e?document.documentElement.getBoundingClientRect():void 0);let r=e&&await af(e)||void 0,a=n?await af(n):void 0,l=Ee.from(o.getBoundingClientRect());if(!a)return;let{alignedRect:u}=rf({constrainTo:r,alignAnchor:a,alignTarget:l,alignPosition:i});o.style.transform=`translate3d(${u.left}px,${u.top}px, 0px)`;let d=o.getBoundingClientRect();if(d.left!==u.left||d.top!==u.top){let s=o.offsetParent;if(s){let c=s.getBoundingClientRect(),f=c.left,m=c.top,p=u.left-f,h=u.top-m;o.style.transform=`translate3d(${p}px,${h}px, 0px)`}}}var Fg=(0,Ne.defineComponent)({name:"OverlayContent",props:{handle:{type:Object,required:!0}},setup(o){let t=null,e=r=>{r&&r!==t&&Ka(r,o.handle),t=r??null},n=null,i=r=>{n?.(),n=r.realign.onChange(a=>{t&&a&&Ka(t,a)})};return(0,Ne.onMounted)(()=>i(o.handle)),(0,Ne.watch)(()=>o.handle,i),(0,Ne.onBeforeUnmount)(()=>{n?.()}),()=>(0,Ne.h)("div",{style:{position:"absolute",top:"0px",left:"0px"},ref:e},[o.handle.children()])}});function Ng(o){return(0,Ne.isVNode)(o)?o.props?.id||o.key:null}function Og(o,t,e){if((0,Ne.isVNode)(o)&&o.type?.[Qi]){let n={};return o.props?.portalContainer===void 0&&(n.portalContainer=t),o.props?.constrainTo===void 0&&(n.constrainTo=e),(0,Ne.cloneVNode)(o,n)}return o}function Dt(o){let t=o,e=new Map,n=(0,Ne.shallowRef)(e),i=()=>(0,Ne.triggerRef)(n),r=(d,s)=>{let f=`${s.id||Ng(d)||qt()}`,m=e.get(f),p=C=>()=>{let b=typeof C=="function"?C():C;return Og(b,t.portalContainer,s.constrainTo??t.constrainTo)},h=p(d),y=(C,b)=>{if(!m)return;let S=p(C);Object.assign(m,{children:S}),i(),!!b?.skipRealign||(0,Ne.nextTick)(()=>{m&&e.get(m.key)===m&&m.realign(m)})};return m?(Object.assign(m,s),y(d),y):(m={key:f,children:h,alignPosition:s.alignPosition,alignTo:s.alignTo,constrainTo:s.constrainTo,realign:he()},e.set(m.key,m),i(),y)},a=d=>{d=`${d}`,e.has(d)&&(e.delete(d),i())},l=()=>{e.clear(),i()};return{portal:(0,Ne.defineComponent)({name:"OverlayPortal",setup(){let d=(0,Ne.shallowRef)(null),{portalContainer:s}=t;return s&&(async()=>{let c=await sf(s);c!=null&&(d.value=c)})(),()=>{let c=[];for(let[f,m]of n.value)c.push((0,Ne.h)(Fg,{handle:m,key:m.key}));return s?d.value?(0,Ne.h)(Ne.Teleport,{to:d.value},c):null:s===null||s===!1?c:(0,Ne.h)("div",{style:{position:"fixed",top:"0px",left:"0px"}},c)}}}),hideOverlay:a,clearAll:l,rerenderOverlays:i,showOverlay:r}}var Sf=require("vue");var We=require("vue");var uf="db3arf0 _16lm1iw0 _16lm1iw1 _16lm1iw1w _16lm1iw2f _16lm1iw8",df=ve({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"]]}),cf="db3arf1",ff="db3arfd";var pf="submenu",kg="-";function mf(){return{keyboardActiveItemKey:null,activeItemKey:null,generatedId:qt(),focused:!1,destroyed:!1,domRef:{current:null}}}function hf(){return{parentMenuId:1,parentMenuItemKey:1,onHideIntent:1,constrainTo:1,onAction:1,onShow:1,onHide:1,autoFocus:1,wrapLabels:1}}var Lg=({columns:o,keyboardActiveItemKey:t,activeItemKey:e,menuId:n},i,r)=>{let a=i&&(i.key!=null||i.label!=null)?i:null,l=a===null?i===kg?r.renderSeparator():i:null;return a!=null?{type:"item",parentMenuId:n,disabled:!!a.disabled,keyboardActive:a.key===t,active:a.key===e,value:a,span:a.span||1,key:a.key,menu:a.menu||null,style:a.style,className:a.className,originalMenuItem:a}:{type:"decoration",value:l,span:o.length,style:{gridColumnStart:1,gridColumnEnd:o.length+10}}},zg=[{name:"label"}],gf=(o,t)=>{let{props:e,state:n}=o,{activeItemKey:i,keyboardActiveItemKey:r}=n,{items:a,children:l,addSubmenuColumnIfNeeded:u,parentMenuId:d}=e,s=e.id||n.generatedId;d&&(s=`${d}-${s}`);let c=[...e.columns||zg],f={columns:c,keyboardActiveItemKey:r??null,activeItemKey:i??null,menuId:s},m=[];a?m=a.map(h=>Lg(f,h,t)):!a&&typeof l!="function"&&(m=t.childrenToRuntimeItems?t.childrenToRuntimeItems(f,l):[]),u&&m.filter(y=>y.type==="item"&&y.menu!=null).length>0&&!c.find(y=>y.name==pf)&&c.push({name:pf,render:t.renderSubmenuColumn});let p=m.filter(h=>h.type==="item"&&!h.disabled);return{runtimeItems:m,runtimeSelectableItems:p,columns:c,menuId:s}};function yf(o,t){let e=bf(o,t);if(!e.length)return null;let n=Ee.from(e[0]?.getBoundingClientRect()),i=Ee.from(e[e.length-1].getBoundingClientRect()),r=n;return r.width=i.left+i.width-n.left,r}function bf(o,t){let e=zn(document.querySelector(`[data-menu-id="${o}"] [data-menu-item-key="${t}"]`),`[data-menu-id="${o}"]`);if(!e)return[];let n=e.querySelectorAll(`[data-menu-item-key="${t}"]`);return Array.from(n)}function Cf(o,t){let e=bf(o,t);if(!e.length)return null;for(let n of e){let i=n.querySelector('input[type="checkbox"]');if(i)return i}return null}var Go=class extends Ln{constructor(t){super(t.slice(0,3))}};var Vg=250;function Gg(o,t=100){let e=Date.now();return new Promise(n=>{let i,r=()=>{if(i=o(),i!==void 0){n(i);return}if(Date.now()-e>t){n(void 0);return}Ke(r)};Ke(()=>{r()})})}var Kg=ze(),er=class{constructor(t){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||Vg;this.getPointerMoveTarget=()=>document.documentElement||Kg;this.removePointerMoveListener=()=>{this.getPointerMoveTarget().removeEventListener("pointermove",this.onPointerMoveWhileActiveItem)};this.onPointerMoveWhileActiveItem=t=>{if(clearTimeout(this.mouseMoveTimeoutId),!t){this.lastPointerMoveTimestamp=Date.now();return}if(!this.currentHoveredItem||this.currentHoveredItem===this.activeItem)return;let e=Date.now();this.lastPointerMoveTimestamp||(this.lastPointerMoveTimestamp=e);let i=e-this.lastPointerMoveTimestamp>this.getTimeout();this.lastPointerMoveTimestamp=e;let r=()=>{this.setActiveItem(null,null),this.onItemChange(!0,this.currentHoveredItem,t)};if(i){r();return}let a=this.currentHoveredItem;this.mouseMoveTimeoutId=setTimeout(()=>{if(a!==this.currentHoveredItem)return;Date.now()-this.lastPointerMoveTimestamp>this.getTimeout()&&r()},this.getTimeout());let l=new Je({left:t.clientX,top:t.clientY});if(!this.activeItemMenuRect||!this.activeItemLeavePoint)return;let u=this.activeItemLeavePoint.left<this.activeItemMenuRect.left,s=(u?1:-1)*(l.left-this.activeItemLeavePoint.left);if(s-this.lastHorizontalDiff<0){this.lastHorizontalDiff=0,r();return}this.lastHorizontalDiff=s,(u?new Go([this.activeItemLeavePoint,this.activeItemMenuRect.getTopLeft(),this.activeItemMenuRect.getBottomLeft()]):new Go([this.activeItemLeavePoint,this.activeItemMenuRect.getTopRight(),this.activeItemMenuRect.getBottomRight()])).containsPoint(l)||(this.setActiveItem(null,null),this.onItemChange(!0,this.currentHoveredItem,t))};this.setupMenuLeaveTracking=()=>{this.menuLeaveTimeoutId=setTimeout(()=>{this.activeItem&&this.params.itemHasSubMenu(this.activeItem)||this.setActiveItem(null,null)},this.getTimeout())};this.setActiveItem=(t,e)=>{if(t!==this.activeItem){if(t==null){this.removePointerMoveListener(),this.params.onItemActivate(null,null),this.activeItem=null,this.activeItemMenuRect=null;return}this.activeItem=t,this.params.onItemActivate(t,e),this.activeItemMenuRect=null,Gg(()=>this.activeItem!=t?!1:this.params.getMenuRectFor(t)).then(n=>{this.activeItem==t&&n&&(this.activeItemMenuRect=n)})}};this.onItemChange=(t,e,n)=>{if(clearTimeout(this.menuLeaveTimeoutId),clearTimeout(this.mouseMoveTimeoutId),!t){this.removePointerMoveListener(),e===this.activeItem&&(this.activeItemLeavePoint=new Je({left:n.clientX,top:n.clientY})),this.setupMenuLeaveTracking();return}if(this.currentHoveredItem=e,!this.activeItem||!this.params.itemHasSubMenu(this.activeItem)){this.setActiveItem(e,n.target);return}this.onPointerMoveWhileActiveItem(),this.getPointerMoveTarget().addEventListener("pointermove",this.onPointerMoveWhileActiveItem)};this.getHandlers=()=>({onItemEnter:(t,e)=>{this.onItemChange(!0,t,e)},onItemLeave:(t,e)=>{this.onItemChange(!1,t,e)}});this.params=t}};var Bg={renderSeparator:()=>(0,We.h)("hr",{class:ff}),renderSubmenuColumn:(({domProps:o,item:t})=>t.menu?(0,We.h)("div",o,[(0,We.h)(Pn,{expanded:!1})]):(0,We.h)("div",o))},{useManagedComponent:Hg}=_n({initSetupState:mf,forwardProps:()=>hf(),mapPropsToState:o=>gf(o,Bg),debugName:"Menu"}),Wg=(0,We.defineComponent)({name:"MenuRuntimeItem",props:{columns:{type:Array,required:!0},item:{type:Object,required:!0},index:{type:Number,required:!0},active:{type:Boolean,required:!0},keyboardActive:{type:Boolean,required:!0},onItemEnter:{type:Function,required:!1},onItemLeave:{type:Function,required:!1},onItemClick:{type:Function,required:!0}},setup(o){let t=(0,We.ref)(!1);return()=>{let{columns:e,item:n,index:i,active:r,keyboardActive:a}=o,l=n.type==="item"?n.value.key:i,u=null;if(n.type==="decoration")u=(0,We.h)("div",{style:n.style},[n.value]);else{let d=0;u=e.map((s,c)=>{let f=n.value,m=s.field||s.name,p=c+1,h=p+n.span;if(p<d)return null;d=h;let C={style:{...s.style,...n.style,gridColumnStart:p,gridColumnEnd:h},"data-menu-column-id":`${n.parentMenuId}-col-${s.name}`,"data-menu-col-name":`${s.name}`,"data-menu-row-id":`${n.parentMenuId}-row-${i}`,"data-menu-row-index":`${i}`,"data-menu-item-key":`${n.key}`,class:te(df({active:r,disabled:!!n.disabled,keyboardActive:a,pressed:t.value||r}),n.className),onPointerenter:b=>{n.disabled||o.onItemEnter?.(n,b)},onPointerleave:b=>{n.disabled||o.onItemLeave?.(n,b)},onMousedown:()=>{n.disabled||(t.value=!0)},onMouseup:()=>{n.disabled||(t.value=!1)},onClick:b=>{n.disabled||o.onItemClick(b,n)}};return s.render?s.render({item:f,column:s,value:f[m],domProps:C}):(0,We.h)("div",{key:`${l}-${m}`,...C},[f[m]])}).filter(Boolean)}return(0,We.h)("div",{class:cf},[u])}}}),At=(0,We.defineComponent)({name:"InfiniteMenu",inheritAttrs:!1,props:{id:{type:String,required:!1},items:{type:Array,required:!1},columns:{type:Array,required:!1,default:void 0},portalContainer:{type:[String,Object,Function,Boolean],required:!1,default:void 0},constrainTo:{type:[String,Object,Function,Boolean],required:!1,default:void 0},wrapLabels:{type:Boolean,required:!1,default:!1},autoFocus:{type:Boolean,required:!1,default:void 0},addSubmenuColumnIfNeeded:{type:Boolean,required:!1,default:!0},bubbleActionsFromSubmenus:{type:Boolean,required:!1,default:!0},parentMenuId:{type:String,required:!1},parentMenuItemKey:{type:String,required:!1},onShow:{type:Function,required:!1},onHide:{type:Function,required:!1},onHideIntent:{type:Function,required:!1},onAction:{type:Function,required:!1}},setup(o,{attrs:t}){let{contextValue:e}=Hg(o),n=e.state,i=e.componentActions,r=()=>n.value,a=D=>{i.keyboardActiveItemKey=D},l=D=>{i.activeItemKey=D},u=!1,d=()=>u,s=null,c=D=>{s=D},{showOverlay:f,portal:m,clearAll:p}=Dt({portalContainer:!1}),h=()=>{let D=r();D.onHideIntent?.(D)},y=()=>{i.focused=!0,setTimeout(()=>{let D=r().domRef.current;b&&D&&D===document.activeElement&&r().keyboardActiveItemKey==null&&a(r().runtimeSelectableItems[0]?.key??null)})},C=()=>{i.focused=!1},b=!0,S={hideMenu:h,focus:()=>{let D=r().domRef.current;D&&(D.focus(),setTimeout(()=>{let M=r().domRef.current;M&&M!==document.activeElement&&M.focus()},10),y())},getMenuId:()=>r().menuId,getParentMenuId:()=>r().parentMenuId},w=(D,M)=>{a(M.key),l(M.key),M.originalMenuItem.onClick&&M.originalMenuItem.onClick(D);let A={key:M.key,item:M.originalMenuItem,hideMenu:h};M.originalMenuItem.onAction&&M.originalMenuItem.onAction(A);let{onAction:x}=r();x&&x(A),M.originalMenuItem.hideMenuOnAction&&h()},{onItemEnter:T,onItemLeave:P}=new er({parentMenuId:r().parentMenuId,onItemActivate:D=>{d()&&l(D)},itemHasSubMenu:D=>!!r().runtimeItems.filter(A=>A.type==="item"&&A.key===D&&A.menu)[0],getMenuRectFor:D=>{let M=`[data-submenu-for="${D}"]`,A=document.querySelector(M);if(A)return Ee.from(A.getBoundingClientRect())}}).getHandlers(),R=D=>{let M=r().menuId,A=`${M}-submenu`,x=D.menu;return x?(typeof x=="function"&&(x=x()),(0,We.h)(At,{key:A,parentMenuItemKey:D.key,parentMenuId:M,constrainTo:r().constrainTo,...x,autoFocus:!1,onShow:(F,_)=>{x?.onShow?.(F,_),c(_)},onHideIntent:F=>{x?.onHideIntent?.(F),h()},onHide:F=>{F.focused&&(l(null),a(D.key),S.focus())}})):null};(0,We.watch)(()=>n.value.activeItemKey,D=>{let{runtimeItems:M,menuId:A,constrainTo:x}=r(),F=M.filter(O=>O.type==="item"&&D===O.key)[0];if(!F||!F.menu){c(null),p();return}let _=yf(A,F.key);_&&f(()=>R(F),{id:`${A}-submenu`,alignTo:_,alignPosition:[["TopLeft","TopRight"],["TopRight","TopLeft"]],constrainTo:x})},{flush:"post"});function E(D){let{runtimeItems:M,runtimeSelectableItems:A,keyboardActiveItemKey:x}=r(),F=M.findIndex(B=>B.type==="item"&&B.key===x),_=x,O=M[F],L={ArrowUp:()=>{let B=M.slice(0,F).filter(G=>G.type==="item"&&!G.disabled).pop();B&&B.type==="item"&&B.key&&(_=B.key)},ArrowDown:()=>{let B=M.slice(F+1).filter(G=>G.type==="item"&&!G.disabled)[0];B&&B.type==="item"&&B.key&&(_=B.key)},Home:()=>{L.PageUp()},End:()=>{L.PageDown()},PageUp:()=>{_=A[0].key},PageDown:()=>{_=A[A.length-1].key},ArrowLeft:()=>{l(null),r().parentMenuId&&(i.destroyed=!0)},ArrowRight:()=>{O&&(l(O.key),Ke(()=>{d()&&s&&s.getParentMenuId()===r().menuId&&s.focus()}))},Enter:()=>{if(O)if(O.originalMenuItem?.menu){if(s){L.ArrowLeft();return}l(O.key)}else w(D,O)}," ":()=>{if(!O)return;O.originalMenuItem.menu||w(D,O);let B=Cf(r().menuId,O.key);B&&B.click()},Escape:()=>{L.ArrowLeft();let B=r();B.parentMenuId||B.onHideIntent?.(B)}},K=L[D.key];K&&(K(),D.preventDefault()),_!=x&&a(_)}let N=!1,v=D=>{let M=D??null;M&&!N?(N=!0,r().domRef.current=M,u=!0,r().onShow?.(r(),S),r().autoFocus&&S.focus()):!M&&N?(N=!1,r().onHide?.(r()),r().domRef.current=null):M&&(r().domRef.current=M)};return(0,We.onBeforeUnmount)(()=>{u=!1,N&&(N=!1,r().onHide?.(r())),r().domRef.current=null}),()=>{let D=r(),{columns:M,runtimeItems:A,menuId:x,activeItemKey:F,keyboardActiveItemKey:_,destroyed:O,wrapLabels:L,parentMenuItemKey:K}=D;if(O)return null;let B=A.map((Y,Ae)=>(0,We.h)(Wg,{key:Y.type==="item"?Y.key:Ae,columns:M,item:Y,index:Ae,active:Y.type==="item"&&Y.key===F,keyboardActive:Y.type==="item"&&Y.key===_,onItemEnter:(ge,Re)=>T(ge.key,Re),onItemLeave:(ge,Re)=>P(ge.key,Re),onItemClick:w})),G=M.map(Y=>Y.width||(typeof Y.flex=="number"?`${Y.flex}fr`:Y.flex)||"auto").join(" "),se={...t.style,gridTemplateColumns:G,gridTemplateRows:A.map(()=>"auto").join(" ")};return L||(se.whiteSpace="nowrap"),(0,We.h)("div",{class:Xo.contents},[(0,We.h)("div",{...t,"data-menu-id":x,"data-submenu-for":K,tabindex:0,ref:v,onKeydown:E,onMousedown:()=>{b=!1},onMouseup:()=>{b=!0},onFocus:y,onBlur:C,class:te(uf,t.class,"InfiniteMenu"),style:se},B),(0,We.h)(m)])}}});At[Qi]=!0;var Ba=require("vue");function Tf(o,t){let{columnApi:e,column:n,getComputed:i,api:r,dataSourceApi:a,getState:l}=t,u=l().components?.CheckBox||ln,s=e.isSortable()?[{key:"sort-asc",label:"Sort Ascending",disabled:n.computedSortedAsc,onAction:()=>{r.setSortingForColumn(n.id,1)}},{key:"sort-desc",label:"Sort Descending",disabled:n.computedSortedDesc,onAction:()=>{r.setSortingForColumn(n.id,-1)}},{key:"sort-none",label:"Unsort",disabled:!n.computedSorted,onAction:()=>{r.setSortingForColumn(n.id,null)}},"-"]:[];return[...n.groupByForColumn?[{key:"collapse-all",label:"Collapse All",onAction:()=>{r.collapseAllGroupRows()}},"-"]:[],...s,n.computedFilterable?{key:"clear-filter",label:"Clear Filter",disabled:!n.computedFiltered,onAction:()=>{r.clearColumnFilter(n.id)}}:null,n.computedFilterable?"-":null,{key:"pin-start",label:"Pin to start",disabled:n.computedPinned==="start",onAction:()=>{r.setPinningForColumn(n.id,"start")}},{key:"unpin",label:"Unpin",disabled:!n.computedPinned,onAction:()=>{r.setPinningForColumn(n.id,!1)}},"-",{key:"columns",label:"Columns",menu:()=>{let f=[];return i().computedColumnsMapInInitialOrder.forEach((p,h)=>{let y=wo(p,t,"column-menu");f.push({key:h,label:y,check:(0,Ba.h)(u,{key:p.id,disabled:p.computedVisible&&r.getVisibleColumnsCount()===1,checked:p.computedVisible,onChange:C=>{let b=!!C;r.setVisibilityForColumn(p.id,b),requestAnimationFrame(()=>{r.realignColumnContextMenu()})}})})}),{columns:[{name:"check"},{name:"label"}],items:f}}},"-",{key:"group-by",label:"Group by",menu:()=>{let f=[];return i().computedColumnsMapInInitialOrder.forEach((p,h)=>{if(p.groupByForColumn)return;let y=wo(p,t,"column-menu");f.push({key:h,label:y,check:(0,Ba.h)(u,{key:p.id,disabled:!p.computedGroupable,checked:p.computedGroupedBy,onChange:()=>{a.toggleGroupByField(p.field)}})})}),{columns:[{name:"check"},{name:"label"}],items:f}}}].filter(f=>!!f)}function wf(o,t,e){if(o==null)return null;let{getComputed:n,getState:i}=t,{components:r,getColumnMenuItems:a}=i(),l=r?.Menu??At,u=n().computedColumnsMap.get(o);if(!u)return null;let d={column:u,columnApi:lt(u.id,t),...t},s=Tf([],d),c=a?a(s,d):s,f=p=>{p.__insideMenu=!0},m=p=>{p.domRef.current?.parentNode?.removeEventListener("mousedown",f)};return!c||!c.length?null:(0,Sf.h)(l,{autoFocus:!0,items:c,onShow:p=>{p.domRef.current?.parentNode?.addEventListener("mousedown",f)},onHide:m,onHideIntent:p=>{m(p),e?.()}})}function jg(o){let{columnId:t,context:e,clearAll:n,showOverlay:i}=o,{getState:r,actions:a}=e,{columnMenuTargetRef:l,domRef:u}=r();function d(){n(),a.columnMenuVisibleForColumnId=null}let s=o.target;if(s||(s=l.current??void 0,s&&!u.current.contains(s)&&(s=void 0)),!s){let c=`[data-column-id="${t}"] ${mu}`;s=r().domRef.current.querySelector(c)}if(!s){console.warn(`Cannot show column menu for column "${t}"`);return}l.current=null,i(()=>wf(t,e,d),{constrainTo:u.current,id:"column-menu",alignTo:s,alignPosition:[["TopLeft","BottomLeft"],["TopRight","BottomRight"]]})}function vf(o){let{context:t,state:e}=o,{getState:n,actions:i}=t,{showOverlay:r,portal:a,clearAll:l}=Dt({portalContainer:!1}),u=n().onColumnMenuClick.onChange(d=>{d&&(n().columnMenuTargetRef.current=d.target,i.contextMenuVisibleFor=null,i.cellContextMenuVisibleFor=null,i.filterOperatorMenuVisibleForColumnId=null,i.columnMenuVisibleForColumnId=d.column.id)});return(0,tr.watch)([()=>e.value.columnMenuVisibleForColumnId,()=>e.value.columnMenuVisibleKey],(d,s,c)=>{let{columnMenuVisibleForColumnId:f,columnMenuTargetRef:m}=n();if(f){let h=function(y){y.__insideMenu!==!0&&(l(),i.columnMenuVisibleForColumnId=null)};var p=h;document.documentElement.addEventListener("mousedown",h),jg({columnId:f,context:t,clearAll:l,showOverlay:r}),c(()=>{document.documentElement.removeEventListener("mousedown",h)})}else m.current=null,l()},{flush:"post"}),(0,tr.onBeforeUnmount)(()=>{u()}),{MenuPortal:a}}var or=require("vue");var Ko=require("vue");function If(o,t,e){if(o==null)return null;let{getComputed:n,getState:i,getDataSourceState:r,actions:a,dataSourceApi:l,dataSourceActions:u,api:d}=t,{components:s,getFilterOperatorMenuItems:c}=i(),f=s?.Menu??At,m=n().computedColumnsMap.get(o);if(!m)return null;let p=R=>{R.__insideMenu=!0},h=R=>{R.domRef.current?.parentNode?.removeEventListener("mousedown",p)},{filterTypes:y}=r(),C=y[m.computedFilterType];if(!C)return null;let b=C.operators.map(R=>{let E=R.name,N=m.computedFilterValue?m.computedFilterValue.filter.operator===E:E===C.defaultOperator,v=R.components?.Icon??Fn;return{key:E,icon:(0,Ko.h)(v),label:R.label??R.name,onAction:()=>{d.setColumnFilterOperator(o,E)},checked:N?(0,Ko.h)(au,{size:16}):null}}),w=[...[{key:"close",label:"Close Menu",icon:null,onAction:()=>{d.hideFilterOperatorMenu()}},{key:"reset",label:"Reset",icon:(0,Ko.h)(lu),disabled:!m.computedFiltered,onAction:()=>{d.clearColumnFilter(o)}},"-"],...b],T={column:m,api:d,getState:i,getDataSourceState:r,getComputed:n,actions:a,dataSourceApi:l,dataSourceActions:u,columnFilterValue:m.computedFilterValue,filterTypes:y},P=c?c(w,T):w;return(0,Ko.h)(f,{autoFocus:!0,columns:[{name:"icon"},{name:"label"},{name:"checked"}],items:P,onShow:R=>{R.domRef.current?.parentNode?.addEventListener("mousedown",p)},onHide:h,onHideIntent:R=>{h(R),e?.()}})}var nr=10;function Rf(o){let{context:t,state:e}=o,{getState:n,actions:i}=t,{showOverlay:r,portal:a,clearAll:l}=Dt({portalContainer:!1}),u=n().onFilterOperatorMenuClick.onChange(d=>{if(!d)return;let{target:s,column:c}=d;function f(){l(),i.filterOperatorMenuVisibleForColumnId=null}let m=s?.parentElement||s,p=Ee.from(m.getBoundingClientRect());p.top-=nr,p.left-=nr,p.width+=2*nr,p.height+=2*nr,r(()=>If(c.id,t,f),{constrainTo:n().domRef.current,id:"filter-operator-menu",alignTo:p,alignPosition:[["TopLeft","BottomLeft"],["TopRight","BottomRight"]]}),i.contextMenuVisibleFor=null,i.cellContextMenuVisibleFor=null,i.columnMenuVisibleForColumnId=null,i.filterOperatorMenuVisibleForColumnId=c.id});return(0,or.watch)(()=>e.value.filterOperatorMenuVisibleForColumnId,(d,s,c)=>{if(d){let m=function(p){p.__insideMenu!==!0&&(l(),i.filterOperatorMenuVisibleForColumnId=null)};var f=m;document.documentElement.addEventListener("mousedown",m),c(()=>{document.documentElement.removeEventListener("mousedown",m)})}else l()},{flush:"post"}),(0,or.onBeforeUnmount)(()=>{u()}),{MenuPortal:a}}var ro=require("vue");var Bo=require("vue");function ir(o){let t=o?Array.isArray(o)?o:o.items:null,e=o&&!Array.isArray(o)?o.columns:void 0;return{items:t,columns:e}}function Ha(o){let t=i=>{i.__insideMenu=!0},e=i=>{i.domRef.current?.parentNode?.removeEventListener("mousedown",t)};return{columns:[],items:[],autoFocus:!0,onShow:i=>{i.domRef.current?.parentNode?.addEventListener("mousedown",t)},onHide:e,onHideIntent:i=>{e(i),o.onHideIntent?.()}}}function xf(o,t,e){if(!o)return null;let n=he();return o.then(i=>{let{items:r,columns:a}=ir(i);r&&r.length&&n((0,Bo.h)(e,{...t,items:r||[],columns:a}))}),(0,Bo.h)(cn,{updater:n})}function Pf(o,t,e){let{columnId:n,rowIndex:i,event:r}=o,{getComputed:a,getState:l}=t,{components:u,getCellContextMenuItems:d}=l(),s=u?.Menu??At,{computedColumnsMap:c}=a(),f=c.get(n),m={...Kt({...t,rowIndex:i,columnId:f.id}),event:r};if(!f||!d)return{cellContext:m,menu:null,preventDefault:!1};let p=Ha({onHideIntent:e}),h=d(m,t),y=h instanceof Promise||Array.isArray(h)?!0:!!(h&&Array.isArray(h.items));if(h instanceof Promise)return{cellContext:m,menu:xf(h,p,s),preventDefault:y};let{items:C,columns:b}=ir(h);return!C||!C.length?{cellContext:m,menu:null,preventDefault:Array.isArray(C)}:{preventDefault:y,menu:(0,Bo.h)(s,{...p,columns:b,items:C}),cellContext:m}}function Df(o,t,e){let{getState:n,getComputed:i}=t,{components:r,getContextMenuItems:a}=n(),l=r?.Menu??At,{computedColumnsMap:u}=i(),d=o.columnId?u.get(o.columnId):void 0,s=d?{...o,...Kt({...t,rowIndex:o.rowIndex,columnId:d.id})}:o;if(!a)return{cellContext:s,menu:null,preventDefault:!1};let c=Ha({onHideIntent:e}),f=a(s,t),m=f instanceof Promise||Array.isArray(f)?!0:!!(f&&Array.isArray(f.items));if(f instanceof Promise)return{cellContext:s,menu:xf(f,c,l),preventDefault:m};let{items:p,columns:h}=ir(f);return!p||!p.length?{cellContext:s,menu:null,preventDefault:Array.isArray(p)}:{preventDefault:m,menu:(0,Bo.h)(l,{...c,columns:h,items:p}),cellContext:s}}var rr=5,Af=[["TopLeft","BottomLeft"],["TopRight","BottomRight"],["BottomLeft","BottomLeft"],["BottomRight","BottomRight"],["TopCenter","TopLeft"],["BottomCenter","TopLeft"],["CenterLeft","TopLeft"],["CenterRight","TopLeft"]];function _f(o){let{context:t,state:e}=o,{getState:n,actions:i,getDataSourceState:r}=t,{showOverlay:a,portal:l,clearAll:u}=Dt({portalContainer:!1}),d=n().cellContextMenu.onChange(s=>{if(!s)return;let{event:c}=s;function f(){u(),i.cellContextMenuVisibleFor=null}let{menu:m,cellContext:p,preventDefault:h}=Pf(s,t,f),y=Ee.fromPoint({top:c.clientY,left:c.clientX});y.width+=rr,y.height+=rr,a(()=>m,{constrainTo:n().domRef.current,id:"cell-context-menu",alignTo:y,alignPosition:Af}),h&&c.preventDefault(),i.cellContextMenuVisibleFor={columnId:s.columnId,rowId:s.rowId,rowIndex:s.rowIndex,colIndex:s.colIndex};let{onCellContextMenu:C}=n();C&&C({...p,getState:n,getDataSourceState:r},c)});return(0,ro.watch)(()=>e.value.cellContextMenuVisibleFor,(s,c,f)=>{if(s){let p=function(h){h.__insideMenu!==!0&&(u(),i.cellContextMenuVisibleFor=null)};var m=p;document.documentElement.addEventListener("mousedown",p),f(()=>{document.documentElement.removeEventListener("mousedown",p)})}else u()},{flush:"post"}),(0,ro.onBeforeUnmount)(()=>{d()}),{MenuPortal:l}}function Mf(o){let{context:t,state:e}=o,{getState:n,actions:i}=t,{showOverlay:r,portal:a,clearAll:l}=Dt({portalContainer:!1}),u=n().contextMenu.onChange(d=>{if(!d)return;let{event:s}=d;function c(){l(),i.contextMenuVisibleFor=null}let{menu:f,cellContext:m,preventDefault:p}=Df(d,t,c),h={top:s.clientY,left:s.clientX},y=Ee.fromPoint(h);y.width+=rr,y.height+=rr,r(()=>f,{constrainTo:n().domRef.current,id:"table-context-menu",alignTo:y,alignPosition:Af}),p&&s.preventDefault(),i.contextMenuVisibleFor={point:h,...d};let{onContextMenu:C}=n();C&&C({...t,...m},s)});return(0,ro.watch)(()=>e.value.contextMenuVisibleFor,(d,s,c)=>{if(d){let m=function(p){p.__insideMenu!==!0&&(l(),i.contextMenuVisibleFor=null)};var f=m;document.documentElement.addEventListener("mousedown",m),c(()=>{document.documentElement.removeEventListener("mousedown",m)})}else l()},{flush:"post"}),(0,ro.onBeforeUnmount)(()=>{u()}),{MenuPortal:a}}var Ye=require("vue");var Ef="mlx2t3";var ar=require("vue"),Ff=(0,ar.defineComponent)({name:"SpacePlaceholder",props:{width:{type:Number,required:!0},height:{type:Number,required:!0},count:{type:Number,required:!1}},setup(o){return()=>(0,ar.h)("div",{"data-count":o.count,"data-placeholder-width":void 0,"data-placeholder-height":void 0,"data-name":"SpacePlaceholder",style:{height:`${o.height}px`,width:`${o.width}px`,zIndex:-1,opacity:0,pointerEvents:"none",contain:"strict"}})}});var Nf={true:"_1ueijco2",false:"_1ueijco3",visible:"_1ueijco4",auto:"_1ueijco5",hidden:"_1ueijco6"},Of={true:"_1ueijco7",false:"_1ueijco8",visible:"_1ueijco9",auto:"_1ueijcoa",hidden:"_1ueijcob"},kf={true:"_1ueijcoc",false:"_1ueijcod",visible:"_1ueijcoe",auto:"_1ueijcof",hidden:"_1ueijcog"},Lf="_1ueijco1",zf="_1ueijco0 _16lm1iw0";var Bt=require("vue");var Vf=o=>{let t="";return typeof o=="boolean"||typeof o=="string"?t=Nf[`${o}`]:t=te(Of[`${o.horizontal}`],kf[`${o.vertical}`]),t};var $g="InfiniteVirtualScrollContainer",Gf=(0,Bt.defineComponent)({name:"VirtualScrollContainer",props:{scrollable:{type:[Boolean,String,Object],required:!1,default:!0},tabIndex:{type:Number,required:!1},autoFocus:{type:Boolean,required:!1},onContainerScroll:{type:Function,required:!1},scrollerRef:{type:Function,required:!1}},setup(o,{slots:t,attrs:e}){let n=(0,Bt.ref)(null),i=r=>{let a=r.target;o.onContainerScroll?.({scrollTop:a.scrollTop,scrollLeft:a.scrollLeft})};return(0,Bt.onMounted)(()=>{let r=n.value;r&&(o.scrollerRef?.(r),r.addEventListener("scroll",i,{passive:!1}),o.autoFocus&&document.activeElement!==r&&r.focus())}),(0,Bt.onBeforeUnmount)(()=>{n.value?.removeEventListener("scroll",i),o.scrollerRef?.(null)}),()=>(0,Bt.h)("div",{...e,ref:n,tabindex:o.tabIndex,class:te(e.class,$g,zf,Vf(o.scrollable))},t.default?.())}});var ut=require("vue");var lr=(0,ut.defineComponent)({name:"RawTable",props:{name:{type:String,required:!1},brain:{type:Object,required:!0},renderCell:{type:Function,required:!0},renderDetailRow:{type:Function,required:!1},cellHoverClassNames:{type:Array,required:!1},cellDetachedClassNames:{type:Array,required:!1,default:()=>[]},renderer:{type:Object,required:!1},onRenderUpdater:{type:Function,required:!1},forceRerenderTimestamp:{type:Number,required:!1}},setup(o){let t=(0,ut.computed)(()=>o.onRenderUpdater&&o.renderer?{renderer:o.renderer,onRenderUpdater:o.onRenderUpdater}:Lo(o.brain));(0,ut.watchEffect)(()=>{t.value.renderer.cellHoverClassNames=o.cellHoverClassNames||[]}),(0,ut.watchEffect)(()=>{t.value.renderer.cellDetachedClassNames=o.cellDetachedClassNames||[]});let e=null,n=()=>{e?.();let{renderer:i,onRenderUpdater:r}=t.value,{brain:a,renderCell:l,renderDetailRow:u}=o,d=a.getRenderRange();i.renderRange(d,{onRender:r,force:!0,renderCell:l,renderDetailRow:u}),e=a.onRenderRangeChange(s=>{i.renderRange(s,{force:!1,onRender:c=>{let f=r.get();f&&c&&f.length===c.length||r(c)},renderCell:l,renderDetailRow:u})})};return(0,ut.onMounted)(n),(0,ut.watch)(()=>[t.value,o.brain,o.renderCell,o.renderDetailRow,o.forceRerenderTimestamp],n,{flush:"post"}),(0,ut.onBeforeUnmount)(()=>{e?.(),e=null}),()=>(0,ut.h)(cn,{name:o.name,updater:t.value.onRenderUpdater})}});var sr=[du,`${Ve}DetachedCell`];var dt=require("vue");var Kf=ve({defaultClassName:"nxbq1c1 _16lm1iwz _16lm1iw2",variantClassNames:{visible:{true:"nxbq1c3",false:"nxbq1c4"}},defaultVariants:{},compoundVariants:[]}),ur="nxbq1c0 _16lm1iwz _16lm1iw4 _16lm1iw26 _16lm1iw23 _16lm1iw1y _16lm1iw1k";var{rootClassName:Ug}=He,qg=`${Ug}-ActiveCellIndicator`,Yg=U(j.columnZIndexAtIndex),Bf=(0,dt.defineComponent)({name:"ActiveCellIndicator",props:{activeCellIndex:{type:Array,required:!1,default:null},brain:{type:Object,required:!0},rowHeight:{type:[Number,Function],required:!1}},setup(o){let t=(0,dt.ref)(null),e=(0,dt.ref)(0),n=()=>{let{activeCellIndex:a,brain:l,rowHeight:u}=o;if(a==null)return;let[d]=a;l.isHorizontalLayoutBrain&&l.rowsPerPage&&(d=d%l.rowsPerPage);let s=typeof u=="function"?u(d):u??l.getRowHeight(d),c=l.getItemOffsetFor(d,"vertical");Vn({activeCellRowHeight:`${s}px`,activeCellRowOffset:`${c}px`},t.value)},i=null,r=a=>{i?.(),i=a.onRenderCountChange(()=>{e.value++})};return(0,dt.onMounted)(()=>{r(o.brain),n()}),(0,dt.watch)(()=>o.brain,r),(0,dt.watch)([()=>o.activeCellIndex,()=>o.rowHeight,()=>o.brain],()=>n(),{flush:"post"}),(0,dt.onBeforeUnmount)(()=>{i?.()}),()=>{e.value;let a=o.activeCellIndex!=null&&o.brain.getInitialRows()>o.activeCellIndex[0];return(0,dt.h)("div",{class:ur,ref:t,"data-name":"active-cell",style:a?{zIndex:`var(${Yg}-${o.activeCellIndex[1]})`}:void 0},[(0,dt.h)("div",{"data-name":"active-cell-indicator",class:`${qg} ${Kf({visible:a})}`})])}}});var ct=require("vue");var Hf=ve({defaultClassName:"j26lrx0 _16lm1iwz _16lm1iw2 _16lm1iw23 _16lm1iw26",variantClassNames:{active:{true:"j26lrx2",false:"j26lrx3"}},defaultVariants:{},compoundVariants:[]});var{rootClassName:Xg}=He,Zg=`${Xg}-ActiveRowIndicator`,Jg=`calc(${j.activeCellRowOffsetX} + var(${U(j.scrollLeftForActiveRowWhenHorizontalLayout)}, 0px))`,Qg={[U(j.activeCellOffsetY)]:j.activeCellRowOffset,transform:`translate3d(${Jg}, calc( ${j.activeCellOffsetY} + var(${U(j.scrollTopForActiveRow)}, 0px)), 0px)`,height:j.activeCellRowHeight,maxWidth:Pe.runtime.totalVisibleColumnsWidthVar},Wf=(0,ct.defineComponent)({name:"ActiveRowIndicator",props:{activeRowIndex:{type:Number,required:!1,default:null},brain:{type:Object,required:!0}},setup(o){let t=(0,ct.ref)(null),e=(0,ct.ref)(0),n=()=>{let{brain:u}=o;if(o.activeRowIndex==null)return;let d="0px",s=o.activeRowIndex;if(u.isHorizontalLayoutBrain&&u.rowsPerPage){let m=u.getPageIndexForRow(s);m>0&&(d=`calc(${Pe.runtime.totalVisibleColumnsWidthVar} * ${m})`),s=s%u.rowsPerPage}let c=u.getRowHeight(s),f=u.getItemOffsetFor(s,"vertical");Vn({activeCellRowHeight:`${c}px`,activeCellRowOffset:`${f}px`,activeCellRowOffsetX:d},t.value)},i=u=>{Vn({scrollTopForActiveRow:`${-u.scrollTop}px`,scrollLeftForActiveRowWhenHorizontalLayout:o.brain.isHorizontalLayoutBrain?`${-u.scrollLeft}px`:"0px"},t.value)},r=null,a=null,l=u=>{r?.(),a?.(),i(u.getScrollPosition()),r=u.onScroll(i),a=u.onRenderCountChange(()=>{e.value++})};return(0,ct.onMounted)(()=>{l(o.brain),n()}),(0,ct.watch)(()=>o.brain,l),(0,ct.watch)([()=>o.activeRowIndex,()=>o.brain],()=>n(),{flush:"post"}),(0,ct.onBeforeUnmount)(()=>{r?.(),a?.()}),()=>{e.value;let u=o.activeRowIndex!=null&&o.brain.getInitialRows()>o.activeRowIndex;return(0,ct.h)("div",{class:ur,"data-name":"active-row"},[(0,ct.h)("div",{ref:t,"data-name":"active-row-indicator",class:`${Zg} ${Hf({active:u})}`,style:u?Qg:void 0})])}}});var ey=te(Ef,Lf),jf=(0,Ye.defineComponent)({name:"HeadlessTable",props:{brain:{type:Object,required:!0},renderCell:{type:Function,required:!0},renderDetailRow:{type:Function,required:!1},cellHoverClassNames:{type:Array,required:!1},renderer:{type:Object,required:!1},onRenderUpdater:{type:Function,required:!1},forceRerenderTimestamp:{type:Number,required:!1},scrollStopDelay:{type:Number,required:!1},wrapRowsHorizontally:{type:Boolean,required:!1},autoFocus:{type:Boolean,required:!1},tabIndex:{type:Number,required:!1},activeRowIndex:{type:Number,required:!1,default:null},activeCellIndex:{type:Array,required:!1,default:null},activeCellRowHeight:{type:[Number,Function],required:!1},scrollerRef:{type:Function,required:!1}},setup(o,{attrs:t}){let e=(0,Ye.ref)(null),n=(0,Ye.shallowRef)({width:0,height:0});(0,Ye.watch)(()=>o.scrollStopDelay,s=>{s!=null&&o.brain.setScrollStopDelay(s)},{immediate:!0});let i=s=>{requestAnimationFrame(()=>{e.value&&e.value.style.setProperty("transform",`translate3d(${-s.scrollLeft}px, ${-s.scrollTop}px, 0px)`)})},r=s=>{o.brain.setScrollPosition(s,i)},a=null,l=null,u=s=>{l?.(),l=s.onRenderCountChange(()=>{n.value=s.getVirtualizedContentSize()}),n.value=s.getVirtualizedContentSize(),i(s.getScrollPosition()||{scrollLeft:0,scrollTop:0})},d=()=>{a?.(),a=null;let s=e.value?.parentNode;if(!s)return;a=Qn(s,()=>{let f={height:s.clientHeight,width:s.clientWidth};o.brain.update(f)},{debounce:50})};return(0,Ye.onMounted)(()=>{u(o.brain),d()}),(0,Ye.watch)(()=>o.brain,s=>{u(s),d()}),(0,Ye.watch)(()=>o.wrapRowsHorizontally,()=>{d()}),(0,Ye.onBeforeUnmount)(()=>{a?.(),l?.()}),()=>(0,Ye.h)(Gf,{...t,autoFocus:o.autoFocus,tabIndex:o.tabIndex,onContainerScroll:r,scrollerRef:o.scrollerRef},{default:()=>[(0,Ye.h)("div",{ref:e,class:ey,"data-name":"scroll-transform-target"},[(0,Ye.h)(lr,{forceRerenderTimestamp:o.forceRerenderTimestamp,renderer:o.renderer,onRenderUpdater:o.onRenderUpdater,renderCell:o.renderCell,renderDetailRow:o.renderDetailRow,brain:o.brain,cellHoverClassNames:o.cellHoverClassNames,cellDetachedClassNames:sr}),o.activeCellIndex!=null?(0,Ye.h)(Bf,{brain:o.brain,rowHeight:o.activeCellRowHeight,activeCellIndex:o.activeCellIndex}):null]),o.activeRowIndex!=null?(0,Ye.h)(Wf,{brain:o.brain,activeRowIndex:o.activeRowIndex}):null,(0,Ye.h)(Ff,{width:n.value.width,height:n.value.height})]})}});var $f="_16lm1iw1 _16lm1iw1c _16lm1iwe";var ke=require("vue"),Jf=require("vue");var qf=Symbol("REPAINT_CELLS_KEY_NO_ROW");function Yf(o){return typeof o=="function"}function Uf(o,t){let{column:e,rowIndex:n,rowInfoStore:i,getDataSourceState:r}=t,a=i.getRowInfoAtIndex(n);if(!a)return qf;let l=i.getDataSourceStates();return o({rowInfo:a,column:e,dataSourceState:l.dataSourceState??r(),previousDataSourceState:l.previousDataSourceState})}function Xf(o,t,e){let n=Uf(o,t);return t.rowInfoStore.subscribeToDataArrayChange(()=>{let i=Uf(o,t);i!==qf&&(Object.is(i,n)||(n=i,e()))})}var dr=require("vue");function Wa(){let{api:o,getState:t}=qe(),e=ao(),{editingCell:n,editingValueRef:i}=t(),r=n?.value,a=r;i.current=r;let l=s=>{i.current=s,a=s},{column:u,rowInfo:d}=e.value;return{api:o,initialValue:r,get value(){return a},get readOnly(){let{editingCell:s}=t();return s?!s.active&&!!s.waiting:!1},column:u,rowInfo:d,setValue:l,confirmEdit:o.confirmEdit,cancelEdit:o.cancelEdit,rejectEdit:o.rejectEdit}}var Zf=(0,dr.defineComponent)({name:"InfiniteTableColumnEditor",setup(){let{state:o}=qe(),t=Wa(),{initialValue:e,setValue:n,confirmEdit:i,cancelEdit:r}=t,a=!1,l=!1,u=f=>{f&&!l&&(l=!0,f.value=e??"",f.focus())},d=f=>{let{key:m}=f;m==="Enter"||m==="Tab"?(i(),f.stopPropagation(),m==="Tab"&&f.preventDefault()):m==="Escape"?(a=!0,r()):f.stopPropagation()},s=()=>{!a&&o.value.editingCell?.active&&i()},c=f=>{n(f.target.value)};return()=>(o.value.editingCell,(0,dr.h)("input",{readonly:t.readOnly||void 0,ref:u,onKeydown:d,onBlur:s,onInput:c,class:te(Rl,El.none),type:"text"}))}});var ty=U(j.columnWidthAtIndex),ny=U(j.columnReorderEffectDurationAtIndex),$a=Symbol("InfiniteColumnCell");function ao(){return(0,Jf.inject)($a)}var oy=o=>{let{toggleCurrentRowDetails:t,rowDetailState:e}=o;return(0,ke.h)(Pn,{style:{visibility:e===!1?"hidden":"visible"},expanded:e==="expanded",onChange:t})},iy={display:"inline-block",visibility:"visible"},ja=o=>{let{rowInfo:t,toggleCurrentTreeNode:e,nodeExpanded:n,api:i}=o,r=i.getDataSourceState().isNodeReadOnly;return(0,ke.h)(Pn,{disabled:t.isTreeNode&&t.isParentNode?r(t):!1,style:iy,expanded:n,onChange:e})},ry=o=>{let{rowInfo:t,selectCurrentRow:e,deselectCurrentRow:n,toggleCurrentGroupRowSelection:i,dataSourceApi:r,api:a}=o,{components:l}=a.getState(),u=a.getDataSourceState().isNodeSelectable,d=l?.CheckBox||ln;return(0,ke.h)(d,{domProps:{class:si},disabled:t.isTreeNode?!u(t):!1,onChange:s=>{if(t.isTreeNode){r.treeApi.setNodeSelection(t.nodePath,s??!1);return}if(t.isGroupRow){i();return}s?e():n()},checked:t.rowSelected})},ay=(0,ke.defineComponent)({name:"RenderCellHook",props:{renderParam:{type:Object,required:!0},content:{type:null,default:null}},setup(o){return(0,ke.provide)($a,(0,ke.computed)(()=>o.renderParam)),()=>o.content}});function _t(o,t){let e=o(t);return e==null?e:(0,ke.h)(ay,{renderParam:t,content:e})}var Qf=(0,ke.defineComponent)({name:"InfiniteTableColumnCell",props:{rowIndex:{type:Number,required:!0},rowHeight:{type:Number,required:!0},width:{type:Number,required:!0},hidden:{type:Boolean,default:!1},domRef:{type:Function,required:!0},column:{type:Object,required:!0},columnsMap:{type:Object,required:!0},fieldsToColumn:{type:Object,required:!0},showZebraRows:{type:Boolean,default:!0},rowDetailState:{type:[Boolean,String],default:!1},inEditMode:{type:Boolean,default:!1},rowIndexInHorizontalLayoutPage:{type:Number,default:null},horizontalLayoutPageIndex:{type:Number,default:null},rowStyle:{type:[Object,Function],default:void 0},rowClassName:{type:[String,Function],default:void 0},cellStyle:{type:[Object,Function],default:void 0},cellClassName:{type:[String,Function],default:void 0},repaintCellsKey:{type:[String,Number,Object,Function],default:void 0},getData:{type:Function,required:!0},rowInfoStore:{type:Object,required:!0},renderingContext:{type:Object,required:!0},getComputedVisibleColumns:{type:Function,required:!0},getComputedColumnOrder:{type:Function,required:!0},dataSourceStatePartial:{type:Object,default:void 0},onMouseEnter:{type:Function,default:void 0},onMouseLeave:{type:Function,default:void 0}},setup(o){let t={current:null},e=s=>{let c=s&&s.$el!==void 0?s.$el:s;t.current=c??null,o.domRef(t.current)},n=(0,ke.shallowRef)(o.rowInfoStore.getRowInfoAtIndex(o.rowIndex)),i=null;(0,ke.watch)([()=>o.rowInfoStore,()=>o.rowIndex],([s,c])=>{i?.(),n.value=s.getRowInfoAtIndex(c),i=s.subscribeToRowIndex(c,()=>{n.value=s.getRowInfoAtIndex(c)})},{immediate:!0});let r=(0,ke.shallowRef)(0),a=null;(0,ke.watch)([()=>o.repaintCellsKey,()=>o.column,()=>o.rowIndex,()=>o.rowInfoStore],([s,c,f,m])=>{a?.(),a=null,Yf(s)&&(a=Xf(s,{column:c,rowIndex:f,rowInfoStore:m,getDataSourceState:o.renderingContext.getDataSourceState},()=>{r.value++}))},{immediate:!0}),(0,ke.onBeforeUnmount)(()=>{i?.(),i=null,a?.(),a=null});let l=(0,ke.shallowRef)(null);(0,ke.provide)($a,l);let u=s=>{let{renderingContext:c,column:f,rowIndex:m}=o;c.getState().cellClick({rowIndex:m,colIndex:f.computedVisibleIndex,event:s})},d=s=>{let{renderingContext:c,column:f,rowIndex:m}=o,{getState:p,actions:h}=c,y=f.computedVisibleIndex;p().cellMouseDown({rowIndex:m,colIndex:y,event:s});let{keyboardNavigation:C}=p(),b=n.value?.rowDisabled??!1;if(C==="row"){b||(h.activeRowIndex=m);return}C==="cell"&&(h.activeCellIndex=[m,y])};return()=>{let{column:s,rowIndex:c,rowHeight:f,hidden:m,rowDetailState:p,renderingContext:h,rowIndexInHorizontalLayoutPage:y,horizontalLayoutPageIndex:C}=o,b=n.value;if(r.value,!s||!b)return(0,ke.h)("div",{ref:e,style:{display:"none"}});let{getState:S,getDataSourceState:w}=h,{activeRowIndex:T,keyboardNavigation:P,columnReorderInPageIndex:R}=S(),E=c===T&&P==="row",N=b.rowDisabled,{rowSelected:v}=b,D=o.getComputedVisibleColumns().map(W=>W.id),M=Ic({horizontalLayoutPageIndex:C,rowIndexInHorizontalLayoutPage:y,column:s,rowInfo:b,rowDetailState:p,columnsMap:o.columnsMap,visibleColumnIds:D,fieldsToColumn:o.fieldsToColumn,context:h}),{stylingParam:A,renderParams:x,formattedValueContext:F,renderFunctions:_,groupByColumnReference:O,inEdit:L}=M,{align:K,verticalAlign:B}=x,G=x;G.domRef=e,G.htmlElementRef=t,l.value=G;let{selectionMode:se}=w(),Y=G.cellSelected,Ae=w().cellSelection??null,ge=null;if(!m&&!L){if(_.renderGroupIcon&&(G.renderBag.groupIcon=_t(_.renderGroupIcon,{...G,renderBag:{...G.renderBag}})),_.renderSelectionCheckBox&&se=="multi-row"&&(G.renderBag.selectionCheckBox=_t(ry,G),_.renderSelectionCheckBox!==!0&&(G.renderBag.selectionCheckBox=_t(_.renderSelectionCheckBox,{...G,renderBag:{...G.renderBag}}))),b.isTreeNode){let{isParentNode:De}=b,Me;Me=(De?_.renderTreeIconForParentNode:_.renderTreeIconForLeafNode)||typeof _.renderTreeIcon=="function"?_.renderTreeIcon:De&&_.renderTreeIcon===!0?ja:void 0,Me===!0?Me=ja:Me&&(G.renderBag.treeIcon=_t(ja,G)),Me&&(G.renderBag.treeIcon=_t(Me,{...G,renderBag:{...G.renderBag}}))}_.renderRowDetailIcon&&(G.renderBag.rowDetailsIcon=_t(oy,{...G,renderBag:{...G.renderBag}}),typeof _.renderRowDetailIcon=="function"&&(G.renderBag.rowDetailsIcon=_t(_.renderRowDetailIcon,{...G,renderBag:{...G.renderBag}}))),_.renderValue&&(G.renderBag.value=_t(_.renderValue,{...G,renderBag:{...G.renderBag}})),b.isGroupRow&&_.renderGroupValue&&(G.renderBag.value=_t(_.renderGroupValue,{...G,renderBag:{...G.renderBag}})),!b.isGroupRow&&_.renderLeafValue&&(G.renderBag.value=_t(_.renderLeafValue,{...G,renderBag:{...G.renderBag}}));let W=G.renderBag.value;W instanceof Date&&(W=W.toLocaleDateString());let ne=G.renderBag,Te=[K!=="end"?ne.treeIcon:null,K!=="end"?ne.groupIcon:null,K!=="end"?ne.rowDetailsIcon:null,K!=="end"?ne.selectionCheckBox:null,W,K==="end"?ne.selectionCheckBox:null,K==="end"?ne.rowDetailsIcon:null,K==="end"?ne.groupIcon:null,K==="end"?ne.treeIcon:null];ge=s.render?_t(s.render,{...G,renderBag:{...G.renderBag,all:Te}}):Te}let{style:Re,className:Ge}=gc({column:s,rowInfo:b,rowIndex:c,rowHeight:f,rowIndexInHorizontalLayoutPage:y,horizontalLayoutPageIndex:C,align:K,verticalAlign:B,stylingParam:A,formattedValueContext:F,groupByColumnReference:O,rowStyle:o.rowStyle,rowClassName:o.rowClassName,cellStyle:o.cellStyle,cellClassName:o.cellClassName,showZebraRows:o.showZebraRows,rowActive:E,rowDisabled:N,rowSelected:v,cellSelected:Y,cellSelection:Ae,getData:o.getData,computedVisibleColumns:o.getComputedVisibleColumns(),computedColumnOrder:o.getComputedColumnOrder(),columnReorderInPageIndex:R}),Oe=s.computedVisibleIndex,we=s.cssEllipsis??!0,Fe={width:`var(${ty}-${Oe})`,transition:`transform var(${ny}-${Oe}, 0s)`,...Re,height:typeof Re.height=="number"?`${Re.height}px`:Re.height},{onRowMouseEnter:ce,onRowMouseLeave:ee}=o.renderingContext.getState(),H=ce||o.onMouseEnter?W=>{ce?.({...F,rowIndex:c},W),o.onMouseEnter?.(W)}:void 0,Z=ee||o.onMouseLeave?W=>{ee?.({...F,rowIndex:c,rowInfo:b},W),o.onMouseLeave?.(W)}:void 0,J={ref:e,style:Fe,"data-column-id":s.id,"data-z-index":Fe.zIndex,"data-row-id":`${b.id}`,class:te(Ge,kt,ai),onClick:u,onMousedown:d,onMouseenter:H,onMouseleave:Z},oe=(0,ke.h)("div",{class:te(`${kt}_content`,we?Tt:Zo.hidden)},[ge]),re=s.components?.Editor??Zf,ye=L?(0,ke.h)(re):null,be=ye?[oe,ye]:[oe],ie=s.components?.ColumnCell;return ie?(0,ke.h)(ie,J,{default:()=>be}):(0,ke.h)("div",J,be)}}});var mn=require("vue");var ep=ve({defaultClassName:"evqes20",variantClassNames:{},defaultVariants:{},compoundVariants:[]});function ly(o,t){let{masterState:e,detailContext:n}=t,i=e.detailDataSourcesStateToRestore;if(i.has(o)){let r=i.get(o);return n.assignState(r),!0}return!1}function sy(o,t){let{detailState:e,masterState:n,masterActions:i,cacheEntryForRow:r}=t,a=new Map(n.detailDataSourcesStateToRestore),l=Td(e);r.all||(r.groupBy||delete l.groupBy,r.sortInfo||delete l.sortInfo,r.filterValue||delete l.filterValue,r.data||delete l.originalDataArray),a.set(o,l),i.detailDataSourcesStateToRestore=a}function tp(o,t){let e={current:!1};return{currentRowCache:{getRowId:()=>o,add:i=>{e.current=!0,t.add(o,i)},get:()=>t.get(o),delete:()=>(e.current=!0,t.delete(o)),has:()=>t.has(o)},cacheCalledByRowDetailRenderer:e}}function np(o){let{rowInfo:t,currentRowCache:e,cacheCalledByRowDetailRenderer:n,getMasterDataSourceState:i,masterActions:r,getMasterState:a}=o,l=i().detailDataSourcesStateToRestore.has(t.id)&&e.has(),d={registerDetail:Ft(s=>{if(n.current||e.add({all:!0}),!e.has()){requestAnimationFrame(()=>{s.dataSourceState.destroyedRef.current||(s.dataSourceActions.stateReadyAsDetails=!0)});return}ly(t.id,{masterState:i(),detailContext:s}),requestAnimationFrame(()=>{s.dataSourceState.destroyedRef.current||(s.dataSourceActions.stateReadyAsDetails=!0)}),s.dataSourceState.onCleanup.onChange(()=>{let c=e.get();c&&sy(t.id,{detailState:s.getDataSourceState(),masterActions:r,masterState:i(),cacheEntryForRow:c})})}),shouldRestoreState:l};return d.masterRowInfo=t,d.getMasterDataSourceState=i,d.getMasterState=a,d}var{rootClassName:uy}=He,dy=`${uy}RowDetail`,cr=(0,mn.defineComponent)({name:"InfiniteTableDetailRow",props:{rowInfo:{type:Object,required:!0},rowIndex:{type:Number,required:!0},domRef:{type:Function,required:!1},rowDetailHeight:{type:Number,required:!0},detailOffset:{type:Number,required:!0},rowDetailRenderer:{type:Function,required:!0},rowDetailsCache:{type:Object,required:!0}},setup(o){let{getDataSourceState:t,dataSourceActions:e}=Jn(),{getState:n}=qe(),i=()=>{let{currentRowCache:l,cacheCalledByRowDetailRenderer:u}=tp(o.rowInfo.id,o.rowDetailsCache);return{masterDetailContextValue:np({rowInfo:o.rowInfo,currentRowCache:l,cacheCalledByRowDetailRenderer:u,getMasterDataSourceState:t,masterActions:e,getMasterState:n}),currentRowCache:l}},r=(0,mn.shallowRef)(i());(0,mn.watch)(()=>o.rowInfo.id,()=>{r.value=i()}),Rd(()=>r.value.masterDetailContextValue);let a=l=>{let u=l&&l.$el!==void 0?l.$el:l;o.domRef?.(u||null)};return()=>{let{masterDetailContextValue:l,currentRowCache:u}=r.value;return l.masterRowInfo=o.rowInfo,(0,mn.h)("div",{ref:a,class:te(dy,ep({})),style:{position:"absolute",top:`${o.detailOffset}px`,left:0,width:`calc(${j.bodyWidth} - ${j.scrollbarWidthVertical})`,height:`${o.rowDetailHeight}px`}},[o.rowDetailRenderer(o.rowInfo,u)])}}});var Ua=class{constructor(){this.rowHeight=new Map;this.rowDetailHeight=new Map;this.getRowHeight=t=>this.rowHeight.get(t)??0;this.getRowDetailHeight=t=>this.rowDetailHeight.get(t)??0}getTotalRowHeight(t){return this.getRowHeight(t)+this.getRowDetailHeight(t)}getSize(t){let e=this.getRowHeight(t),n=this.getRowDetailHeight(t);return{rowHeight:e,rowDetailHeight:n,totalRowHeight:e+n}}};function cy(o,t){let e=o.rowDetailHeight,n=o.rowHeight,{isRowDetailsExpanded:i,isRowDetailsEnabled:r,getDataSourceState:a}=o;if(!i)return typeof n=="function"?s=>{if(t&&t.rowHeight.has(s))return t.rowHeight.get(s);let c=a().dataArray[s],f=c?n(c):0;return t&&t.rowHeight.set(s,f),f}:n;let l=typeof n=="function",u=typeof e=="function";return s=>{if(t&&t.rowHeight.has(s)&&t.rowDetailHeight.has(s))return t.rowHeight.get(s)+t.rowDetailHeight.get(s);let c=a().dataArray[s];if(!c)return t&&(t.rowHeight.set(s,0),t.rowDetailHeight.set(s,0)),0;let f=l?n(c):n;if(!!(!r||typeof r=="function"&&r(c)===!1)||!i(c))return t&&(t.rowHeight.set(s,f),t.rowDetailHeight.set(s,0)),f;let p=0;return u?p=e(c):p=e,t&&(t.rowHeight.set(s,f),t.rowDetailHeight.set(s,p)),f+p}}function op(o){let t=new Ua;return{computedRowHeight:cy(o,t),computedRowSizeCacheForDetails:o.isRowDetailsExpanded?t:void 0}}var et=require("vue");function ip(o,t,e,n){let i=new Map,r=new Map,a=new Map;o.forEach((s,c)=>{let f=s.id,m=o[c-1],p=m?.id??"",h=new Set,y=m?.computedPinned!==s.computedPinned?new Set:a.get(p)??new Set;a.set(f,h);let C={type:"column",id:f,ref:s,groupOffset:0,computedPinned:s.computedPinned,computedWidth:s.computedWidth,depth:s.columnGroup?(e.get(s.columnGroup)??0)+1:0};i.set([f],C);let b=s.columnGroup,S,w=C;for(;b;){let T=t[b];if(T){h.add(b);let P=[f,...h];S=y.has(b)?r.get(b):void 0,S||(S={id:b,type:"group",ref:T,columnItems:[],children:[],groupOffset:0,uniqueGroupId:[b],computedWidth:0,computedPinned:C.computedPinned,depth:e.get(b)??0},i.set(P,S),r.set(b,S)),S.columnItems.push(C),S.uniqueGroupId.push(C.id),w&&!y.has(w.id)&&S.children.push(w),w=S,b=T.columnGroup}else break}});let l=[],u=new $,d=0;return i.forEach(s=>{if(!s.ref.columnGroup){let c=s.type==="column"?s.ref.computedWidth:s.columnItems.reduce((f,m)=>f+m.ref.computedWidth,0);s.groupOffset=d,s.computedWidth=c,s.type==="group"&&rp(s.children),l.push(s),d+=c}if(s.type==="group")s.columnItems.forEach(c=>{u.set([s.depth,c.ref.computedVisibleIndex],s)});else for(let c=s.depth;c<=n+1;c++)u.set([c,s.ref.computedVisibleIndex],s)}),i.clear(),r.clear(),{tree:l,pathsToCells:u}}function rp(o,t=0){o.forEach(e=>{let n=e.type==="column"?e.ref.computedWidth:e.columnItems.reduce((i,r)=>i+r.ref.computedWidth,0);e.computedWidth=n,e.groupOffset=t,e.type==="group"&&rp(e.children),t+=n})}var lo=require("vue");var Dn=require("vue");var{rootClassName:fy}=He,py=`${fy}HeaderCell_ResizeHandle`,ap=(0,Dn.defineComponent)({name:"GroupResizeHandle",props:{groupColumns:{type:Array,required:!0},columns:{type:Array,required:!0},draggerStyle:{type:Object,default:void 0},brain:{type:Object,required:!0},computeResize:{type:Function,required:!0},onResize:{type:Function,required:!0}},setup(o){let t={current:null},e=(0,Dn.ref)(!1),n=i=>{i.stopPropagation();let r=o.groupColumns[0];if(!r)return;let a=r.computedPinned,l=i.pointerId,u=i.clientX,d=i.target;d.setPointerCapture(l);let s=!0,c=wu(o.groupColumns.map(h=>h.computedVisibleIndex),{columns:o.columns,domRef:t}),f=h=>{a==="end"&&(h*=-1);let{constrained:y,adjustedDiffs:C,adjustedDiff:b}=o.computeResize(h);return e.value!==y&&(e.value=y),c.resize(C),b},m=h=>{if(s){let y=o.groupColumns.reduce((S,w)=>S+w.computedWidth-w.computedMinWidth,0),C=o.brain.getAvailableSize(),b={width:C.width+y,height:C.height};o.brain.update(b),s=!1}f(Math.round(h.clientX-u))},p=h=>{d.releasePointerCapture(l),d.removeEventListener("pointermove",m),d.removeEventListener("pointerup",p);let y=Math.round(h.clientX-u),C=f(y);c.resize(o.groupColumns.map(()=>0)),o.onResize(C)};d.addEventListener("pointermove",m),d.addEventListener("pointerup",p)};return()=>{let i=o.groupColumns[0];if(!i)return null;let r=i.computedPinned,a=i.computedFirstInCategory,l=i.computedLastInCategory,u=(r===!1||r==="start")&&l?{right:r==="start"?void 0:Pe.components.HeaderCell.resizeHandleWidth}:r==="end"&&a?{right:void 0}:void 0;return(0,Dn.h)("div",{ref:d=>{t.current=d??null},class:`${py} ${di} ${fi({computedPinned:r,computedFirstInCategory:a,computedLastInCategory:l})}`,onPointerdown:n},[(0,Dn.h)("div",{style:{...u,...o.draggerStyle},class:ci({constrained:e.value})})])}}});var lp=`${Ve}HeaderGroup`,sp=U(j.columnWidthAtIndex),my=U(j.columnZIndexAtIndex),up=(0,lo.defineComponent)({name:"InfiniteTableHeaderGroup",props:{columnGroup:{type:Object,required:!0},columns:{type:Array,required:!0},height:{type:Number,required:!0},width:{type:Number,required:!0},columnGroupsMaxDepth:{type:Number,required:!0},horizontalLayoutPageIndex:{type:Number,default:null},domRef:{type:Function,required:!0}},setup(o){let{getState:t,getComputed:e,actions:n}=qe(),i=l=>{o.domRef(l??null)},r=l=>{let u=t(),{columnSizing:d,viewportReservedWidth:s,bodySize:c}=u,f=e().computedVisibleColumns,m=o.columns,p=m[m.length-1],h=!1,y=f.reduce((b,S)=>(S.computedFlex&&(b[S.id]={...d[S.id],flex:S.computedWidth},h=!0),b),{}),C=h?{...d,...y}:d;return us({availableSize:Yr(c),reservedWidth:s||0,dragHandleOffset:l,dragHandlePositionAfter:p.computedVisibleIndex,columnSizing:C,columnGroupSize:m.length,items:f.map(b=>({id:b.id,resizable:b.computedResizable,computedFlex:b.computedFlex,computedWidth:b.computedWidth,computedMinWidth:b.computedMinWidth,computedMaxWidth:b.computedMaxWidth}))})},a=l=>{let{columnSizing:u,reservedWidth:d}=r(l);n.viewportReservedWidth=d,n.columnSizing=u};return()=>{let{columnGroup:l,height:u,columns:d,columnGroupsMaxDepth:s}=o,{header:c}=l,{style:f}=l;c instanceof Function&&(c=c({columnGroup:l,horizontalLayoutPageIndex:o.horizontalLayoutPageIndex}));let m=d[0],p=d.length>1?"calc( "+d.map(S=>`var(${sp}-${S.computedVisibleIndex})`).join(" + ")+" )":`var(${sp}-${m.computedVisibleIndex})`,h=`calc(var(${my}-${m.computedVisibleIndex}) + ${s-l.depth})`,y=typeof f=="function"?f({columnGroup:l,horizontalLayoutPageIndex:o.horizontalLayoutPageIndex}):f;y=y&&typeof y=="object"?{...y}:{},y.width=p,y.height=`${u}px`;let b=d.some(S=>S.computedResizable)?(0,lo.h)(ap,{brain:t().brain,draggerStyle:{height:`${u*(s-l.depth+2)}px`},columns:e().computedVisibleColumns,groupColumns:d,computeResize:r,onResize:a}):null;return(0,lo.h)("div",{ref:i,"data-group-id":l.uniqueGroupId,class:te(Zl,lp),style:y,"data-z-index":h},[(0,lo.h)("div",{class:te(`${lp}__header-content`,Tt)},[c]),b])}}});var{rootClassName:hy}=He,dp=`${hy}Header`,gy=[],yy=$l({overflow:!1}),cp=(0,et.defineComponent)({name:"TableHeaderWrapper",props:{headerBrain:{type:Object,required:!0},bodyBrain:{type:Object,required:!0},wrapRowsHorizontally:{type:Boolean,default:!1}},setup(o){let t=qe(),{state:e,getState:n,getComputed:i,dataSourceContext:r}=t,a=(0,et.computed)(()=>{let p=e.value,h=p.computedColumnGroups;return!h||!Object.keys(h).length?1:p.columnGroupsMaxDepth+2}),l=(0,et.computed)(()=>{let p=e.value;return a.value*p.columnHeaderHeight+(p.showColumnFilters?p.columnHeaderHeight:0)}),u=Yt(()=>{let p=e.value;return[p.computedColumnGroups,p.columnGroupsDepthsMap,p.columnGroupsMaxDepth,i().computedVisibleColumns]},()=>{let p=n(),{computedColumnGroups:h,columnGroupsDepthsMap:y}=p,{computedVisibleColumns:C}=i();if(!(!h||!Object.keys(h).length))return ip(C,h,y,p.columnGroupsMaxDepth)},"header.treeInfo");(0,et.watchEffect)(()=>{let p=e.value,{computedVisibleColumns:h,computedPinnedStartColumns:y,computedPinnedEndColumns:C,columnSize:b}=i(),S=a.value,w=l.value,T=u.value,P=p.showColumnFilters,R=p.columnHeaderHeight,E=({rowIndex:D,colIndex:M})=>{let A=h[M],x=1,F=1;if(!A||!T)return{rowspan:x,colspan:F};let _=T.pathsToCells.get([D,M]);if(!_)return{rowspan:x,colspan:F};if(_.type==="column")return{colspan:F,rowspan:S-_.depth};let O=_.columnItems.findIndex(L=>L.id===A.id);return{rowspan:x,colspan:O===0?_.columnItems.length:1}},N=D=>P?D<S-1?R:2*R:R,v=o.headerBrain;(y.length||C.length)&&v.updateFixedCells({fixedColsStart:y.length,fixedColsEnd:C.length}),v.update({colWidth:b,rowHeight:N,rows:S,cols:h.length,height:w,rowspan:({rowIndex:D,colIndex:M})=>E({rowIndex:D,colIndex:M}).rowspan,colspan:({rowIndex:D,colIndex:M})=>E({rowIndex:D,colIndex:M}).colspan})});let d=null,s=p=>{d&&(d.style.transform=`translate3d(-${p.scrollLeft}px, 0px, 0px)`)},c=p=>{d=p??null},f=null;(0,et.watch)(()=>o.headerBrain,p=>{f?.(),f=p.onScroll(s),s(p.getScrollPosition()||{scrollLeft:0,scrollTop:0})},{immediate:!0}),(0,et.onBeforeUnmount)(()=>{f?.(),f=null});let m=Yt(()=>{let p=e.value,h=r.state.value,{computedVisibleColumns:y,computedColumnsMap:C}=i();return[p.headerOptions,p.columnHeaderHeight,p.columnGroupsMaxDepth,p.showColumnFilters,y,C,u.value,o.headerBrain,h.allRowsSelected,h.someRowsSelected,h.selectionMode,h.filterTypes,h.filterDelay]},()=>{let p=n(),h=r.getDataSourceState(),{computedVisibleColumns:y,computedColumnsMap:C}=i(),b=o.headerBrain,S=u.value,w=p.columnGroupsMaxDepth,T=p.headerOptions,{allRowsSelected:P,someRowsSelected:R,selectionMode:E}=h;return N=>{let{rowIndex:v,colIndex:D,domRef:M,height:A,widthWithColspan:x,heightWithRowspan:F,hidden:_}=N,O=y[D];if(!O||_)return null;let L=b.isHorizontalLayoutBrain?b.getPageIndexForRow(v):null,K=S?S.pathsToCells.get([v,D]):null;if(K&&K.type==="group"){let B=K.columnItems.map(Y=>Y.ref),G={...K.ref,id:K.id,uniqueGroupId:K.uniqueGroupId,depth:K.depth,columns:B.map(Y=>Y.id),computedWidth:K.computedWidth,groupOffset:K.groupOffset};return n().columnGroupVisibility[K.id]!==!1?(0,et.h)(up,{key:K.uniqueGroupId.join("/"),horizontalLayoutPageIndex:L,columnGroupsMaxDepth:w,domRef:M,columns:B,width:x,height:A,columnGroup:G}):null}return(0,et.h)(xu,{key:O.id,domRef:M,column:O,columnsMap:C,horizontalLayoutPageIndex:L,headerOptions:T,width:x,height:F,allRowsSelected:P,someRowsSelected:R,selectionMode:E})}},"header.renderCell");return()=>{let p=l.value,{scrollbars:h}=i(),y=e.value,C=(0,et.h)("div",{ref:c,class:te(dp,`${dp}--virtualized`,yy),style:{height:`${p}px`}},[(0,et.h)(lr,{name:"header",renderCell:m.value,brain:o.headerBrain,renderer:y.headerRenderer,onRenderUpdater:y.headerOnRenderUpdater,cellHoverClassNames:gy,cellDetachedClassNames:sr})]),b=h.vertical&&Nt()?(0,et.h)("div",{class:Ql,style:{zIndex:1e3,width:`${Nt()}px`}}):null;return(0,et.h)("div",{class:`${zr} ${os}`,style:{height:`${p}px`}},[C,b])}}});var so=require("vue");var fp={visible:"qy58ya1 qy58ya0 _16lm1iw2 _16lm1iw23 _16lm1iw26 _16lm1iw2c _16lm1iw2a",hidden:"qy58ya2 qy58ya0 _16lm1iw2 _16lm1iw23 _16lm1iw26 _16lm1iw2c _16lm1iw2a"},pp="qy58ya3 _16lm1iw2 _16lm1iw23 _16lm1iw26 _16lm1iw2c _16lm1iw2a",mp="qy58ya4";var{rootClassName:by}=He,qa=`${by}-LoadMask`,fr=(0,so.defineComponent)({name:"LoadMask",props:{visible:{type:Boolean,required:!0}},setup(o,{slots:t}){return()=>(0,so.h)("div",{class:`${fp[o.visible?"visible":"hidden"]} ${qa}`},[(0,so.h)("div",{class:`${pp} ${qa}-Overlay`}),(0,so.h)("div",{class:`${mp} ${qa}-Text`},t.default?t.default():"Loading")])}});var hp=o=>`--infinite-${o}`;var gp=40,yp=hp(As);var Tp=He.rootClassName,Ya=["debugId","id","children","columns","columnDefaultWidth","columnDefaultFlex","columnMinWidth","columnMaxWidth","columnCssEllipsis","columnHeaderCssEllipsis","columnDefaultSortable","columnDefaultDraggable","columnDefaultEditable","columnDefaultFilterable","columnDefaultGroupable","columnOrder","defaultColumnOrder","onColumnOrderChange","columnVisibility","defaultColumnVisibility","onColumnVisibilityChange","columnPinning","defaultColumnPinning","onColumnPinningChange","columnSizing","defaultColumnSizing","onColumnSizingChange","columnTypes","columnGroups","defaultColumnGroups","columnGroupVisibility","collapsedColumnGroups","pinnedStartMaxWidth","pinnedEndMaxWidth","viewportReservedWidth","onViewportReservedWidthChange","resizableColumns","draggableColumns","draggableColumnsRestrictTo","sortable","multiSortBehavior","editable","rowHeight","onRowHeightChange","rowDetailHeight","columnHeaderHeight","onColumnGroupVisibilityChange","header","headerOptions","showColumnFilters","showZebraRows","showHoverRows","rowHoverClassName","rowClassName","rowStyle","rowProps","cellClassName","cellStyle","repaintCellsKey","domProps","licenseKey","loadingText","components","keyboardNavigation","keyboardSelection","keyboardShortcuts","activeRowIndex","defaultActiveRowIndex","onActiveRowIndexChange","activeCellIndex","defaultActiveCellIndex","onActiveCellIndexChange","onKeyDown","onCellClick","onCellDoubleClick","onCellContextMenu","onContextMenu","onScrollToTop","onScrollToBottom","onScrollStop","scrollToBottomOffset","scrollStopDelay","scrollTopKey","onReady","onRenderRangeChange","onRowMouseEnter","onRowMouseLeave","onSelfFocus","onSelfBlur","onFocusWithin","onBlurWithin","focusedClassName","focusedWithinClassName","focusedStyle","focusedWithinStyle","groupColumn","groupRenderStrategy","hideColumnWhenGrouped","hideEmptyGroupColumns","pivotColumn","pivotColumns","pivotColumnGroups","pivotTotalColumnPosition","pivotGrandTotalColumnPosition","showSeparatePivotColumnForSingleAggregation","wrapRowsHorizontally","repeatWrappedGroupRows","onScrollbarsChange","autoSizeColumnsKey","columnMenuRealignDelay","getColumnMenuItems","getCellContextMenuItems","getContextMenuItems","getFilterOperatorMenuItems","onEditCancelled","onEditRejected","onEditAccepted","persistEdit","shouldAcceptEdit","onEditPersistError","onEditPersistSuccess","rowDetailCache","rowDetailRenderer","isRowDetailExpanded","isRowDetailEnabled","rowDetailState","defaultRowDetailState","onRowDetailStateChange"],{useManagedComponent:Cy,injectionKey:Ty}=_n({initSetupState:Wd,forwardProps:jd,mapPropsToState:Yd,cleanup:$d,allowedControlledPropOverrides:{rowHeight:!0,columnHeaderHeight:!0},mappedCallbacks:qd(),getParentState:()=>{let o=(0,X.inject)(Zn,null);return o?o.state:null},debugName:"InfiniteTable"});function bp(o){return t=>o[t]?.computedWidth??0}function Cp(o,t){return o.filter(n=>typeof n.rowspan=="function").length?({rowIndex:n,colIndex:i})=>{let r=t().dataArray,a=r[n];if(!a)return 1;let l=o[i];return!l||!l.rowspan?1:l.rowspan({column:l,data:a.data,dataArray:r,rowInfo:a,rowIndex:n})}:void 0}var pr=(0,X.defineComponent)({name:"InfiniteTable",props:[...Ya],setup(o,{attrs:t}){let e=Jn();if(!e)throw new Error("InfiniteTable must be rendered inside a <DataSource> component");let n=new Proxy(o,{get(g,I,z){let k=Reflect.get(g,I,z);return I==="rowHeight"?k??gp:I==="columnHeaderHeight"?k??yp:I==="repeatWrappedGroupRows"?k??!!Reflect.get(g,"wrapRowsHorizontally"):k}}),{contextValue:i}=Cy(n);(0,X.provide)(Ty,i);let r=i.state,a=i.componentActions,l=i.getComponentState,{state:u,getDataSourceState:d}=e,s=g=>{A.toggleGroupRow(g)};(0,X.watch)([()=>r.value.columns,()=>u.value.groupBy,()=>u.value.pivotBy,()=>u.value.selectionMode,()=>r.value.hideColumnWhenGrouped,()=>r.value.groupColumn,()=>r.value.groupRenderStrategy,()=>r.value.pivotColumns,()=>r.value.pivotTotalColumnPosition,()=>r.value.pivotColumn],()=>{let g=r.value,I=u.value,{columns:z,groupColumnIds:k}=Tc({columns:g.columns,groupColumn:g.groupColumn,pivotColumn:g.pivotColumn,pivotTotalColumnPosition:g.pivotTotalColumnPosition,pivotGrandTotalColumnPosition:g.pivotGrandTotalColumnPosition,groupRenderStrategy:g.groupRenderStrategy==="inline"?"single-column":g.groupRenderStrategy,groupBy:I.groupBy,pivotBy:I.pivotBy,pivotColumns:g.pivotColumns,toggleGroupRow:s,selectionMode:I.selectionMode});a.columnsWhenGrouping=z;let q=r.value.columnOrder;if(k.length&&Array.isArray(q)){let V=new Set(q),Q=!1;k.forEach(pe=>{V.has(pe)||(Q=!0,q=[pe,...q])}),Q&&(a.columnOrder=q)}},{immediate:!0}),(0,X.watch)(()=>r.value.groupRenderStrategy,g=>{e.dataSourceActions.generateGroupRows=g!=="inline"},{immediate:!0}),(0,X.watch)(()=>r.value.showSeparatePivotColumnForSingleAggregation,g=>{e.dataSourceActions.showSeparatePivotColumnForSingleAggregation=g},{immediate:!0}),(0,X.watch)(()=>r.value.pivotTotalColumnPosition,g=>{e.dataSourceActions.pivotTotalColumnPosition=g},{immediate:!0}),(0,X.watch)(()=>r.value.pivotGrandTotalColumnPosition,g=>{g!=null&&(e.dataSourceActions.pivotGrandTotalColumnPosition=g)},{immediate:!0});let c=(0,X.ref)(0),f=null,m=null,p=()=>{let{autoSizeColumnsKey:g}=r.value;return typeof g=="object"?g.key:g};(0,X.watch)(()=>r.value.brain,g=>{m?.(),m=g.onRenderRangeChange(()=>{p()!=null&&r.value.autoSizeColumnsKey!==f&&(c.value+=1)})},{immediate:!0}),(0,X.onBeforeUnmount)(()=>{m?.()}),(0,X.watch)([p,()=>r.value.ready,c],()=>{let g=p();if(g==null)return;let{autoSizeColumnsKey:I,domRef:z}=r.value,k,q,V=!0;typeof I=="object"&&(I.columnsToResize&&(k=new Set(I.columnsToResize)),I.columnsToSkip&&(q=new Set(I.columnsToSkip)),V=I.includeHeader??V),f=g;let Q=Jd(z,{includeHeader:V,columnsToResize:k,columnsToSkip:q}),pe=Object.keys(Q);if(!pe.length)return;let ue=r.value.columnSizing,me={...ue},le=!1;pe.forEach(Ce=>{me[Ce]={width:Q[Ce]},le=le||me[Ce].width!==ue[Ce]?.width}),le&&(a.columnSizing=me)},{immediate:!0,flush:"post"});let h=(0,X.computed)(()=>Ud(u.value.groupBy));(0,X.watch)([()=>r.value.groupRenderStrategy,()=>u.value.originalLazyGroupDataChangeDetect,()=>u.value.groupBy,h,()=>r.value.computedColumns,()=>r.value.hideEmptyGroupColumns?u.value.dataArray:null,()=>r.value.hideEmptyGroupColumns?u.value.groupRowsState:null,()=>r.value.hideEmptyGroupColumns?u.value.groupRowsIndexesInDataArray:null,()=>r.value.hideEmptyGroupColumns],()=>{let g=r.value,I=u.value;if(g.groupRenderStrategy!=="multi-column")return;let z=h.value,k=Xd(g.computedColumns,z),q=Zd({computedGroupColumns:k,columnVisibility:g.columnVisibility,hideEmptyGroupColumns:g.hideEmptyGroupColumns,groupRowsIndexesInDataArray:I.groupRowsIndexesInDataArray,dataArray:I.dataArray,groupBy:I.groupBy,groupByMap:z});rn(g.columnVisibility,q)||(a.columnVisibility=q)},{immediate:!0}),(0,X.watch)([()=>r.value.computedColumns,()=>r.value.columnTypes,()=>u.value.groupBy,h,()=>r.value.hideColumnWhenGrouped],()=>{let g=r.value,I=h.value,z=u.value.groupBy.length>0,{columnVisibility:k,columnVisibilityForGrouping:q,hideColumnWhenGrouped:V,computedColumns:Q}=g,pe={...k},ue={...q},me=!1,le=new Set,Ce=new Set;Object.keys(Q).forEach(xe=>{let ae=Q[xe];if(ae.defaultHiddenWhenGroupedBy||V!=null)if(ae.defaultHiddenWhenGroupedBy==="*"&&z||(ae.defaultHiddenWhenGroupedBy===!0||V)&&ae.field&&I.get(ae.field)||typeof ae.defaultHiddenWhenGroupedBy=="string"&&I.get(ae.defaultHiddenWhenGroupedBy)||typeof ae.defaultHiddenWhenGroupedBy=="object"&&Object.keys(ae.defaultHiddenWhenGroupedBy).reduce((Ht,Wt)=>Ht||I.has(Wt),!1)){if(ue[xe]!==!1){if(k[xe]===!1)return;ue[xe]=!1,me=!0,le.add(xe)}}else ue[xe]===!1&&(delete ue[xe],me=!0,Ce.add(xe))}),me&&(a.columnVisibilityForGrouping=ue,Ce.forEach(xe=>{delete pe[xe]}),le.forEach(xe=>{pe[xe]=!1}),a.columnVisibility=pe)},{immediate:!0});let y=Yt(()=>{let g=r.value,I=u.value;return[g.computedColumns,g.bodySize.width,g.columnMinWidth,g.columnMaxWidth,g.columnDefaultWidth,g.columnDefaultFlex,g.columnCssEllipsis,g.columnHeaderCssEllipsis,g.viewportReservedWidth,g.resizableColumns,I.filterValue,I.filterTypes,g.sortable,I.sortInfo,I.multiSort,g.pinnedEndMaxWidth,g.pinnedStartMaxWidth,g.draggableColumns,g.columnDefaultDraggable,g.columnOrder,g.columnPinning,g.columnDefaultEditable,g.columnDefaultFilterable,g.columnDefaultGroupable,g.columnDefaultSortable,g.editable,g.columnSizing,g.columnTypes,g.columnVisibility,g.initialColumns,I.groupBy]},()=>{let g=r.value,I=u.value;return hs({columns:g.computedColumns,userColumns:g.initialColumns,scrollbarWidth:void 0,bodySize:g.bodySize,columnMinWidth:g.columnMinWidth,columnMaxWidth:g.columnMaxWidth,columnDefaultWidth:g.columnDefaultWidth,columnDefaultFlex:g.columnDefaultFlex,columnCssEllipsis:g.columnCssEllipsis,columnHeaderCssEllipsis:g.columnHeaderCssEllipsis,viewportReservedWidth:g.viewportReservedWidth,resizableColumns:g.resizableColumns,filterValue:I.filterValue,filterTypes:I.filterTypes,sortable:g.sortable,sortInfo:I.sortInfo??void 0,multiSort:I.multiSort,pinnedEndMaxWidth:g.pinnedEndMaxWidth,pinnedStartMaxWidth:g.pinnedStartMaxWidth,draggableColumns:g.draggableColumns,columnDefaultDraggable:g.columnDefaultDraggable,columnOrder:g.columnOrder,columnPinning:g.columnPinning,columnDefaultEditable:g.columnDefaultEditable,columnDefaultFilterable:g.columnDefaultFilterable,columnDefaultGroupable:g.columnDefaultGroupable,columnDefaultSortable:g.columnDefaultSortable,editable:g.editable,columnSizing:g.columnSizing,columnTypes:g.columnTypes,columnVisibility:g.columnVisibility,columnVisibilityAssumeVisible:!0,groupBy:I.groupBy})},"computedColumnsResult"),C=()=>y.value.computedVisibleColumns,{getDataSourceState:b,dataSourceApi:S}=e,w=new Zi({isRowDisabledAt:g=>b().dataArray[g]?.rowDisabled??!1,getIdForIndex:g=>b().dataArray[g]?.id??-1}),T=new Ji({getPrimaryKeyByIndex:S.getPrimaryKeyByIndex,getColumnIdByIndex:g=>C()[g]?.id||""}),P=(0,X.shallowRef)({vertical:!1,horizontal:!1}),R=null;(0,X.watch)(()=>r.value.brain,g=>{R?.(),R=g.onRenderCountChange(()=>{let{scrollTopMax:I,scrollLeftMax:z}=g,k=I>0,q=z>0,V=P.value;(V.vertical!==k||V.horizontal!==q)&&(P.value={vertical:k,horizontal:q})})},{immediate:!0}),(0,X.watch)(P,g=>{let I=b(),{onScrollbarsChange:z}=l();z&&I.updatedAt&&I.dataArray.length&&z(g),I.notifyScrollbarsChange(g)});let E=null,N=()=>{let g=l(),I=[g.rowHeight,g.rowDetailHeight,g.isRowDetailExpanded,g.isRowDetailEnabled];return(!E||E.deps.some((z,k)=>z!==I[k]))&&(E={deps:I,value:op({rowHeight:g.rowHeight,rowDetailHeight:g.rowDetailHeight,isRowDetailsExpanded:g.isRowDetailExpanded,isRowDetailsEnabled:g.isRowDetailEnabled,getDataSourceState:b})}),E.value},v=()=>N().computedRowHeight,D=()=>{let g=y.value,I=g.computedPinnedStartWidth??g.computedPinnedStartColumnsWidth,z=g.computedPinnedEndWidth??g.computedPinnedEndColumnsWidth;return{...g,scrollbars:P.value,multiRowSelector:w,multiCellSelector:T,computedRowHeight:v(),computedRowSizeCacheForDetails:N().computedRowSizeCacheForDetails,rowspan:Cp(g.computedVisibleColumns,b),computedPinnedStartOverflow:I?g.computedPinnedStartColumnsWidth>I:!1,computedPinnedEndOverflow:z?g.computedPinnedEndColumnsWidth>z:!1,toggleGroupRow:k=>A.toggleGroupRow(k),columnSize:k=>bp(g.computedVisibleColumns)(k)}},M=()=>b().getDataSourceMasterContextRef?.current?.()??void 0,A=Fc({getComputed:D,getState:l,getDataSourceState:b,getDataSourceMasterContext:M,actions:a,dataSourceActions:e.dataSourceActions,dataSourceApi:S}),x={getState:l,getDataSourceState:b,getDataSourceMasterContext:M,actions:a,dataSourceActions:e.dataSourceActions,api:A,dataSourceApi:S},F={getComputed:D,getDataSourceMasterContext:M,dataSourceApi:S,api:A,getState:l,actions:a,getDataSourceState:b,dataSourceActions:e.dataSourceActions,cloneTreeSelection:g=>wi(g,b),cloneRowSelection:g=>Yo(g,b)},_=l().keyDown.onChange(g=>{tf(F,g)}),O=l().cellClick.onChange(g=>{if(!g)return;let{event:I,rowIndex:z,colIndex:k}=g,q=D().computedVisibleColumns[k],V=lt(q.id,F);I.key="",zc({...F,rowIndex:z,colIndex:k,column:q,columnApi:V},I)}),L=l().cellMouseDown.onChange(g=>{if(!g)return;let{event:I,rowIndex:z,colIndex:k}=g,q=D().computedVisibleColumns[k],V=lt(q.id,F);Vc({...F,rowIndex:z,colIndex:k,column:q,columnApi:V},I)}),K=g=>{l().keyDown(g)};l().onRowHeightCSSVarChange.onChange(g=>{g&&(a.rowHeight=g)}),l().onFlashingDurationCSSVarChange.onChange(g=>{let I=g?g*1:null;I!=null&&!isNaN(I)&&(a.flashingDurationCSSVarValue=I)}),l().onRowDetailHeightCSSVarChange.onChange(g=>{g&&(a.rowDetailHeight=g)}),l().onColumnHeaderHeightCSSVarChange.onChange(g=>{g&&(a.columnHeaderHeight=g)});let{MenuPortal:B}=vf({context:F,state:r}),{MenuPortal:G}=_f({context:F,state:r}),{MenuPortal:se}=Mf({context:F,state:r}),{MenuPortal:Y}=Rf({context:F,state:r}),Ae=g=>{let I=l(),z=g.target,k=Ds(z,Ia(),I.domRef.current),q,V,Q,pe;k&&(V=Number(k.dataset.colIndex),pe=Number(k.dataset.rowIndex),q=D().computedVisibleColumns[V].id,Q=S.getRowInfoArray()[pe].id);let ue={columnId:q,colIndex:V,rowId:Q,rowIndex:pe,event:g,target:k??g.target};k&&I.cellContextMenu(ue),I.contextMenu(ue)},ge=Oa(g=>{a.focused=g}),Re=Oa(g=>{a.focusedWithin=g}),Ge=g=>{let I=l();if(g.target===I.domRef.current||g.target===I.scrollerDOMRef.current){if(I.focused)return;ge(!0),I.onSelfFocus?.(g),I.focusedWithin&&(Re(!1),I.onBlurWithin?.(g));return}I.focusedWithin||(Re(!0),I.onFocusWithin?.(g))},Oe=g=>{let I=l();if(g.target===I.domRef.current||g.target===I.scrollerDOMRef.current){if(!I.focused)return;ge(!1),I.onSelfBlur?.(g),I.focusedWithin&&(Re(!1),I.onBlurWithin?.(g));return}I.domRef.current?.contains(g.relatedTarget)||(Re(!1),I.onBlurWithin?.(g))},we=10,Fe=(g,I)=>{let z=!1,k=null;return(0,X.watch)([g,()=>u.value.dataArray.length],([q],[V]=[void 0,void 0])=>{if(q!=null&&q!==V&&(z=!1,k!=null&&cancelAnimationFrame(k)),q==null||z)return;let Q=(pe=0)=>{pe++,k!=null&&cancelAnimationFrame(k),k=requestAnimationFrame(()=>{z=I(q),!z&&pe<we&&Q(pe)})};Q()},{immediate:!0}),()=>{k!=null&&cancelAnimationFrame(k)}},ce=Fe(()=>r.value.activeRowIndex,g=>A.scrollRowIntoView(g,{offset:0})),ee=Fe(()=>r.value.activeCellIndex,g=>A.scrollCellIntoView(g[0],g[1],{offset:30})),H=()=>xc({getComputed:D,getState:l,getDataSourceState:b,getDataSourceMasterContext:M,actions:a,dataSourceActions:e.dataSourceActions,api:A,dataSourceApi:S},l().editingCell);(0,X.watch)([()=>{let g=r.value.editingCell;return g&&!g.active?g.cancelled:void 0},()=>{let g=r.value.editingCell;return g&&!g.active&&g.accepted instanceof Error?g.accepted:void 0},()=>{let g=r.value.editingCell;return!!(g&&!g.active&&!g.cancelled&&g.accepted===!0)},()=>r.value.editingCell?.persisted,()=>r.value.editingCell?.active],([g,I,z,k,q],[V,Q,pe,ue,me])=>{if(g&&g!==V){let le=l().editingCell,{onEditCancelled:Ce}=l();if(Ce){let xe=H();xe?Ce({...xe,initialValue:le.initialValue}):zo("onEditCancelled",le)}}if(I&&I!==Q){let le=l().editingCell,{onEditRejected:Ce}=l();if(Ce){let xe=H();xe?Ce({...xe,value:le.value,error:I,initialValue:le.initialValue}):zo("onEditRejected",le)}}if(z&&z!==pe){let le=l().editingCell,{value:Ce,initialValue:xe}=le,{onEditAccepted:ae}=l();if(ae){let Ct=H();Ct?ae({...Ct,value:Ce,initialValue:xe}):zo("onEditAccepted",le)}A.persistEdit({value:Ce})}if(k&&k!==ue){let le=l().editingCell;if(le){let Ce=k instanceof Error?"onEditPersistError":"onEditPersistSuccess";if(l()[Ce]){let xe=H();if(!xe)zo(Ce,le);else{let ae={...xe,value:le.value,initialValue:le.initialValue};k instanceof Error?l().onEditPersistError?.({...ae,error:k}):l().onEditPersistSuccess?.(ae)}}}}!q&&me&&A.focus()}),(0,X.watchEffect)(()=>{let g=r.value,I=u.value,{computedVisibleColumns:z,computedPinnedStartColumns:k,computedPinnedEndColumns:q}=y.value,V=g.brain;V.updateFixedCells({fixedColsStart:k.length,fixedColsEnd:q.length});let Q=v();V.update({colWidth:bp(z),rowHeight:Q,rows:I.dataArray.length,cols:z.length,rowspan:Cp(z,d)})}),(0,X.watch)(()=>r.value.wrapRowsHorizontally,(g,I)=>{if(I===g)return;let{brain:z,headerBrain:k,renderer:q,onRenderUpdater:V}=l();z.destroy(),k.destroy(),q.destroy(),V.destroy();let Q=Ra(Qd,!!g);a.brain=Q.brain,a.headerBrain=Q.headerBrain,a.renderer=Q.renderer,a.onRenderUpdater=Q.onRenderUpdater,a.headerRenderer=Q.headerRenderer,a.headerOnRenderUpdater=Q.headerOnRenderUpdater},{flush:"post"});let Z=null,J=null,oe=()=>{Z&&(clearTimeout(Z),Z=null),J?.(),J=null};(0,X.watch)([()=>r.value.brain,()=>r.value.wrapRowsHorizontally,()=>u.value.groupBy,()=>u.value.isTree,()=>r.value.wrapRowsHorizontally?r.value.repeatWrappedGroupRows:!1],([g,I,z,k,q])=>{oe();let V=e.dataSourceActions;if(!I){d().repeatWrappedGroupRows&&(V.repeatWrappedGroupRows=!1);return}let Q=()=>{let{rowsPerPage:pe,repeatWrappedGroupRows:ue}=d(),me=!1,le=g.rowsPerPage,Ce=(z&&z.length>0||k)&&le>0?le:null;return pe!=Ce&&(V.rowsPerPage=Ce,me=!0),ue!=q&&(V.repeatWrappedGroupRows=q??!1,me=!0),me};Q(),J=g.onVerticalRenderRangeChange(()=>{Q()&&(Z=setTimeout(()=>{a.forceBodyRerenderTimestamp=Date.now()}))})},{immediate:!0,flush:"post"}),(0,X.onBeforeUnmount)(oe),(0,X.watch)(()=>r.value.scrollStopDelay,g=>{r.value.brain.setScrollStopDelay(g),e.dataSourceActions.scrollStopDelayUpdatedByTable=g},{immediate:!0}),(0,X.watch)(()=>r.value.ready,g=>{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(r.value.id,g,A,{dataSourceApi:e.dataSourceApi});let{onReady:I}=l();I&&I({api:A,dataSourceApi:S})},{immediate:!0,flush:"post"}),(0,X.watch)(()=>!!r.value.bodySize.height,g=>{g&&(a.ready=!0)},{immediate:!0});let re=null,ye=null;(0,X.watch)(()=>r.value.brain,g=>{re?.(),re=g.onVerticalRenderRangeChange(I=>{d().notifyRenderRangeChange({renderStartIndex:I[0],renderEndIndex:I[1]})}),ye?.(),ye=g.onRenderRangeChange(I=>{l().onRenderRangeChange?.(I)})},{immediate:!0});let be=1,ie=0,W=null,ne=null;(0,X.watch)(()=>r.value.brain,g=>{W?.(),ne?.(),W=g.onRenderCountChange(()=>{ie=g.scrollTopMax}),ne=g.onScrollStop(I=>{let{scrollTop:z,scrollLeft:k}=I,{onScrollToTop:q,onScrollToBottom:V,onScrollStop:Q}=l();z===0&&q?.();let pe=l().scrollToBottomOffset??be;if(z+pe>=ie){V?.();let{livePagination:me,livePaginationCursor:le,dataArray:Ce}=d();me&&(e.dataSourceActions.cursorId=le!==void 0?Date.now():Ce.length)}if(Q){let me=g.getRenderRange();Q({scrollTop:z,scrollLeft:k,renderRange:me,viewportSize:l().bodySize,firstVisibleRowIndex:me.start[0],lastVisibleRowIndex:me.end[0],firstVisibleColIndex:me.start[1],lastVisibleColIndex:me.end[1]})}})},{immediate:!0});let Te=null,De=null,Me=g=>{Te=g,r.value.scrollerDOMRef.current=g,De?.(),De=null,g&&(a.bodySize={width:g.clientWidth,height:g.clientHeight},De=Qn(g,I=>{a.bodySize={width:Math.round(I.width),height:Math.round(I.height)}},{debounce:50}))};(0,X.onMounted)(()=>{Te&&(a.bodySize={width:Te.clientWidth,height:Te.clientHeight})}),(0,X.onBeforeUnmount)(()=>{De?.(),re?.(),ye?.(),_(),O(),L(),ce(),ee()});let Ze=()=>b().dataArray,je=()=>y.value.computedColumnOrder,fe=[cc,`${Pt}--hovered`],mt=Yt(()=>{let g=r.value;return[g.showHoverRows,g.rowHoverClassName]},()=>{let g=r.value;if(!g.showHoverRows)return;let I=[];return g.rowHoverClassName&&(I=I.concat(g.rowHoverClassName)),I=I.concat(fe),I.join(" ").split(" ").map(z=>z.trim()).filter(Boolean)},"hoverClassNames"),it=Yt(()=>{let g=u.value;return[g.isNodeReadOnly,g.selectionMode,g.cellSelection]},()=>{let g=b();return{isNodeReadOnly:g.isNodeReadOnly,selectionMode:g.selectionMode,cellSelection:g.cellSelection}},"dataSourceStatePartialForCell"),vt=Yt(()=>{let g=r.value,I=u.value;return[y.value,g.rowHeight,g.rowDetailHeight,g.onRowMouseEnter,g.onRowMouseLeave,g.isRowDetailExpanded,g.isRowDetailEnabled,g.groupRenderStrategy,g.wrapRowsHorizontally,g.showZebraRows,g.brain,g.rowStyle,g.rowClassName,g.cellStyle,g.cellClassName,g.repaintCellsKey,g.editingCell,g.updatedAt,I.rowInfoStore,it.value]},()=>{let{computedVisibleColumns:g,computedColumnsMap:I,fieldsToColumn:z}=y.value,k=l(),q=k.showZebraRows,V=b().rowInfoStore,Q=it.value;return pe=>{let{rowIndex:ue,colIndex:me,domRef:le,hidden:Ce,width:xe,heightWithRowspan:ae,onMouseEnter:Ct,onMouseLeave:Ht}=pe,Wt=Ze()[ue],Et=g[me];if(!Wt||!Et)return null;let Ue=!1,jt=k.isRowDetailEnabled,$t=k.isRowDetailExpanded;!jt||typeof jt=="function"&&!jt(Wt)?Ue=!1:$t&&(Ue=$t(Wt)?"expanded":"collapsed");let fo=A.isEditorVisibleForCell({rowIndex:ue,columnId:Et.id});return(0,X.h)(Qf,{key:`${ue}:${Et.id}`,rowIndex:ue,rowHeight:ae,width:xe,hidden:Ce,domRef:le,column:Et,columnsMap:I,fieldsToColumn:z,showZebraRows:q,rowDetailState:Ue,inEditMode:fo,rowIndexInHorizontalLayoutPage:k.wrapRowsHorizontally?k.brain.getRowIndexInPage(ue):null,horizontalLayoutPageIndex:k.wrapRowsHorizontally?k.brain.getPageIndexForRow(ue):null,rowStyle:k.rowStyle,rowClassName:k.rowClassName,cellStyle:k.cellStyle,cellClassName:k.cellClassName,repaintCellsKey:Et.repaintCellsKey!==void 0?Et.repaintCellsKey:k.repaintCellsKey,getData:Ze,rowInfoStore:V,renderingContext:x,getComputedVisibleColumns:C,getComputedColumnOrder:je,dataSourceStatePartial:Q,onMouseEnter:Ct,onMouseLeave:Ht})}},"body.renderCell"),Mt=Yt(()=>{let g=r.value;return[g.isRowDetailExpanded,g.rowDetailRenderer,g.rowDetailCache]},()=>{let g=l(),I=g.isRowDetailExpanded,z=g.rowDetailRenderer;if(!I||!z)return;let k=g.rowDetailCache;return q=>{let{rowIndex:V,domRef:Q}=q,ue=Ze()[V],me=N().computedRowSizeCacheForDetails;if(!ue||!I(ue)||!me)return(0,X.h)("div",{ref:Q,class:kl.hidden});let{rowDetailHeight:le,rowHeight:Ce}=me.getSize(V);return(0,X.h)(cr,{rowInfo:ue,rowDetailsCache:k,rowIndex:V,domRef:Q,detailOffset:Ce,rowDetailHeight:le,rowDetailRenderer:z})}});return(0,X.provide)(Kn,{state:r,getState:l,actions:a,api:A,getComputed:D,getComputedVisibleColumns:C,dataSourceContext:e}),()=>{let g=r.value,I=y.value,z=Ks({computedVisibleColumns:I.computedVisibleColumns,computedPinnedStartColumns:I.computedPinnedStartColumns,computedPinnedEndColumns:I.computedPinnedEndColumns,computedPinnedStartColumnsWidth:I.computedPinnedStartColumnsWidth,computedPinnedEndColumnsWidth:I.computedPinnedEndColumnsWidth,computedUnpinnedColumnsWidth:I.computedUnpinnedColumnsWidth,bodySize:g.bodySize,activeCellIndex:g.activeCellIndex,brain:g.brain,scrollbars:P.value}),k=g.focused,q=g.focusedWithin,V=I.computedPinnedStartWidth??I.computedPinnedStartColumnsWidth,Q=I.computedPinnedEndWidth??I.computedPinnedEndColumnsWidth,pe=V?I.computedPinnedStartColumnsWidth>V:!1,ue=Q?I.computedPinnedEndColumnsWidth>Q:!1,{autoFocus:me,tabIndex:le,className:Ce,class:xe,style:ae,onKeyDown:Ct,onKeydown:Ht,...Wt}=g.domProps??{},Et=te(t.class,Ce,xe,Ve,ws,g.wrapRowsHorizontally?`${Ve}--horizontal-layout`:null,I.computedPinnedStartColumnsWidth?`${Ve}--has-pinned-start ${Is}`:null,I.computedPinnedEndColumnsWidth?`${Ve}--has-pinned-end ${vs}`:null,k?`${Ve}--focused`:null,q?`${Ve}--focused-within`:null,k&&g.focusedClassName?g.focusedClassName:null,q&&g.focusedWithinClassName?g.focusedWithinClassName:null,pe?`${Ve}--has-pinned-start-overflow`:null,ue?`${Ve}--has-pinned-end-overflow`:null,Rs({horizontalLayout:!!g.wrapRowsHorizontally,hasPinnedStart:!!I.computedPinnedStartColumnsWidth,hasPinnedEnd:!!I.computedPinnedEndColumnsWidth,focused:k,focusedWithin:q})),Ue={...t.style,...ae,...z};k&&g.focusedStyle&&Object.assign(Ue,g.focusedStyle),q&&g.focusedWithinStyle&&Object.assign(Ue,g.focusedWithinStyle);let jt=Ht??Ct,$t=jt?Qt=>{K(Qt),jt(Qt)}:K,fo=u.value.loading;return(0,X.h)("div",{...t,...Wt,ref:Qt=>{g.domRef.current=Qt??null},"data-debug-id":g.debugId,class:Et,style:Ue,onKeydown:$t,onFocusin:Ge,onFocusout:Oe},[g.header?(0,X.h)(cp,{wrapRowsHorizontally:!!g.wrapRowsHorizontally,bodyBrain:g.brain,headerBrain:g.headerBrain}):null,(0,X.h)("div",{class:te($f,Lr),onContextmenu:Ae},[(0,X.h)(jf,{brain:g.brain,renderer:g.renderer,onRenderUpdater:g.onRenderUpdater,renderCell:vt.value,renderDetailRow:Mt.value,cellHoverClassNames:mt.value,scrollStopDelay:g.scrollStopDelay,forceRerenderTimestamp:g.forceBodyRerenderTimestamp,scrollerRef:Me,tabIndex:le??0,autoFocus:!!me,activeRowIndex:g.ready&&g.keyboardNavigation==="row"?g.activeRowIndex??null:null,activeCellIndex:g.ready&&g.keyboardNavigation==="cell"&&!g.columnReorderDragColumnId?g.activeCellIndex??null:null,activeCellRowHeight:N().computedRowSizeCacheForDetails?.getRowHeight||v()}),(0,X.h)(fr,{visible:!!fo},()=>g.loadingText)]),(0,X.h)("div",{ref:Qt=>{g.portalDOMRef.current=Qt??null},class:te(`${Ve}Portal`,Ll[1e7],Fl.absolute,Nl[0],Ml[0])},[(0,X.h)(B),(0,X.h)(G),(0,X.h)(se),(0,X.h)(Y)]),g.rowHeightCSSVar?(0,X.h)(Vo,{key:"row-height",varName:g.rowHeightCSSVar,onChange:g.onRowHeightCSSVarChange}):null,(0,X.h)(Vo,{key:"flashing-duration",allowInts:!0,varName:Pe.components.Cell.flashingDuration,onChange:g.onFlashingDurationCSSVarChange}),g.rowDetailHeightCSSVar?(0,X.h)(Vo,{key:"row-detail-height",varName:g.rowDetailHeightCSSVar,onChange:g.onRowDetailHeightCSSVarChange}):null,g.columnHeaderHeightCSSVar?(0,X.h)(Vo,{key:"column-header-height",varName:g.columnHeaderHeightCSSVar,onChange:g.onColumnHeaderHeightCSSVarChange}):null])}}});var uo=require("vue");var Sp=U(j.currentFlashingDuration),Sy=({children:o})=>o,wp=1e3,vp={up:li({direction:"up"}).split(" "),down:li({direction:"down"}).split(" "),neutral:li({direction:"neutral"}).split(" ")},Xa=(o={})=>{let{flashDuration:t,flashClassName:e,render:n=Sy}=o;return(0,uo.defineComponent)({name:"FlashingColumnCell",inheritAttrs:!1,setup(i,{attrs:r,slots:a}){let l=ao(),u=qe(),d=!0,s=null,c=l.value?.value,f,m,p=()=>{let y=l.value?.htmlElementRef.current;if(f&&(clearTimeout(f),f=void 0),m&&y){let C=vp[m];y.classList.remove(...e?[e,...C]:C),y.style.removeProperty(Sp),m=void 0}},h=(y,C)=>{let b=l.value?.htmlElementRef.current;if(!b)return;p();let{flashingDurationCSSVarValue:S}=u.getState(),w=typeof S=="number"?S??t??wp:t??wp,T=typeof y=="number"?y>C?"up":"down":"neutral",P=vp[T];b.style.setProperty(Sp,`${w}`),b.classList.add(...e?[e,...P]:P),m=T,f=setTimeout(p,w)};return(0,uo.watch)(()=>{let y=l.value;return y?[y.column.id,y.rowInfo.id,y.value]:null},(y,C)=>{if(!y)return;let[b,S,w]=y,[T,P]=C??[];if(!(b===T&&S===P)){p(),d=!0,s=null,c=w;return}w!==c&&(d=!1,s=c,c=w,h(w,s))},{flush:"post"}),()=>{let y=l.value;return(0,uo.h)("div",{...r,class:te(r.class),ref:y?.domRef},[n({children:a.default?a.default():null,oldValue:d?null:s})])}}})},Ip=Xa();var co=require("vue");var Za=o=>(e,{unfilteredTreePaths:n,treeSelectionState:i,prevTreeSelectionState:r,lastUpdatedNodeInfo:a})=>{let l=new Qe(r,{treePaths:n});i.forEachLeafNodePath((s,{selected:c})=>{l.setNodeSelection(s,c)}),a&&i.forEachLeafNodePath(s=>{l.setNodeSelection(s,a.selected)},a.nodePath);let d={defaultSelection:!1,selectedPaths:l.getSelectedLeafNodePaths()};o(d)};var Rp=(0,co.defineComponent)({name:"TreeGrid",props:[...Ya],setup(o,{slots:t}){return()=>(0,co.h)(pr,{...o},t)}}),xp=(0,co.defineComponent)({name:"TreeDataSource",props:[...ma],setup(o,{slots:t}){return()=>(0,co.h)(Ei,{...o,nodesKey:o.nodesKey??"children"},t)}});var wy={key:"*",when:o=>{let{activeCellIndex:t}=o.getState();if(t){let[e,n]=t,i=o.api.getColumnAtIndex(n);return i?o.api.isCellEditable({rowIndex:e,columnId:i.id}):!1}return!1},handler:(o,t)=>{let{key:e}=t;if(e!="Escape"&&e.length===1){let{activeCellIndex:n}=o.getState();if(n){let[i,r]=n,a=o.api.getColumnAtIndex(r);if(!a)return;requestAnimationFrame(()=>{o.api.startEdit({rowIndex:i,value:e,columnId:a.id})})}}}},Pp={instantEdit:wy};var vy={CheckBox:ln,LoadMask:fr,MenuIcon:Ao};0&&(module.exports={CellSelectionState,DataSource,DataSourceInjectionKeyForVue,DeepMap,FlashingColumnCell,GroupRowsState,InfiniteTable,InfiniteTableClassName,InfiniteTableDetailRow,InfiniteTableInjectionKeyForVue,Menu,NumberFilterEditor,RowDetailState,RowSelectionState,StringFilterEditor,TreeDataSource,TreeExpandState,TreeGrid,TreeSelectionState,components,createFlashingColumnCellComponent,debounce,defaultFilterTypes,flatten,group,keyboardShortcuts,toTreeDataArray,useDataSourceContext,useGetMasterDetailContextForVue,useInfiniteColumnCell,useInfiniteColumnEditor,useInfiniteColumnFilterEditor,useInfiniteHeaderCell,useInfiniteTableContext,useOverlay,withSelectedLeafNodesOnly});
|
|
28
28
|
//!collapsed || lazyLoad;
|