@infinite-table/infinite-vue 10.1.0 → 10.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.css +1 -1
- package/index.js +1 -1
- package/index.mjs +1 -1
- package/package.json +2 -2
package/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var Xp=Object.create;var Wa=Object.defineProperty;var Jp=Object.getOwnPropertyDescriptor;var Qp=Object.getOwnPropertyNames;var em=Object.getPrototypeOf,tm=Object.prototype.hasOwnProperty;var nm=(o,t)=>()=>(t||o((t={exports:{}}).exports,t),t.exports);var om=(o,t,e,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Qp(t))!tm.call(o,i)&&i!==e&&Wa(o,i,{get:()=>t[i],enumerable:!(n=Jp(t,i))||n.enumerable});return o};var Gn=(o,t,e)=>(e=o!=null?Xp(em(o)):{},om(t||!o||!o.__esModule?Wa(e,"default",{value:o,enumerable:!0}):e,o));var wn=nm((Iv,zs)=>{"use strict";zs.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}});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)}}import{defineComponent as ty,inject as ny,onBeforeUnmount as ui,onMounted as di,provide as oy,shallowRef as iy,watch as En}from"vue";import{getCurrentInstance as rm,inject as am,isRef as lm,onBeforeUnmount as sm,provide as um,shallowRef as dm,unref as cm,watch as fm}from"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(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 qi=o=>o&&o.substr(0,1).toUpperCase()+o.substr(1);function Kn(o){return o!==void 0}function Bn(o,t){let e=t[o];return Kn(e)}var Yi=(o,t,e)=>{let n=o[t];typeof n=="function"&&n(...e)};function im(o,t,e){let n={};for(let i in o)if(o.hasOwnProperty(i)){let r=o[i],a=Bn(i,t)?t[i]:t[`default${qi(i)}`];typeof r=="function"&&(a=r(a,e)),n[i]=a}return n}function $a(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 Ua(o){let{props:t,initialSetupState:e,propsToForward:n,parentState:i,mapPropsToState:r,propsToStateSet:a}=o,l={};n&&(l=im(n,t,e));let u={...e,...l};if(r){let d=$a(r,{props:t,state:u,oldState:null,parentState:i},a);return{...u,...d}}return u}function qa(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=$a(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 Ya(o){let{dispatch:t,getState:e,getProps:n,propsToForward:i,allowedControlledPropOverrides:r,interceptedActions:a,mappedCallbacks:l,notify:u=Yi}=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 S=[p],T=`on${qi(c)}Change`;if(l&&l[f]){let I=l[f](p,y);T=I.callbackName||T,S=I.callbackParams}u(h,T,S)}let b=i[f];typeof b=="function"&&(p=b(p));let w=!!r?.[f];Bn(c,h)&&!w||t({payload:{updatedProps:null,mappedState:{[c]:p}}})}}),s},{})}function Za(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++,Bn(p,t)||Bn(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 pm(o){return(t,e,n)=>{if(Yi(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 pn(o){let t=o.injectionKey??Symbol("managed-component-state");function e(r){let a=rm(),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:lm(c)?cm(c)??null:typeof c=="function"?c()??null:c,m=Ua({props:l(),initialSetupState:u,propsToForward:s,parentState:f(),mapPropsToState:o.mapPropsToState,propsToStateSet:d}),p=dm(m),h=()=>m,y=l,C=T=>{m=qa(m,T,{getProps:y,getParentState:f,mapPropsToState:o.mapPropsToState,concludeReducer:o.concludeReducer,propsToStateSet:d}),p.value=m},b=pm(a?(T,...I)=>a.emit(T,...I):void 0),w=Ya({dispatch:C,getState:h,getProps:y,propsToForward:s,allowedControlledPropOverrides:o.allowedControlledPropOverrides,interceptedActions:o.interceptActions,mappedCallbacks:o.mappedCallbacks,notify:b});return fm(()=>({props:l(),parentState:f()}),(T,I)=>{let x=T.props,F=I.props,N=T.parentState!==I.parentState,{newMappedState:R,newMappedStateCount:A,updatedPropsToState:E,updatedPropsToStateCount:P,rawUpdatedProps:D,rawUpdatedPropsCount:M}=Za({currentProps:x,prevProps:F,state:p.value,propsToForward:s,propsToStateSet:d}),_=!1;if(P>0||A>0){let O={payload:{mappedState:A?R:null,updatedPropsToState:P?E:null}},z=p.value;if(C(O),_=!0,o.onPropChange){for(let K in D)if(D.hasOwnProperty(K)){let{newValue:B,oldValue:G}=D[K];o.onPropChange({name:K,newValue:B,oldValue:G},x,w,z)}}o.onPropsChange&&M&&o.onPropsChange(D,x,w,z)}N&&T.parentState!=null&&!_&&C({type:"PARENT_STATE_CHANGE",payload:{}})},{flush:"post"}),sm(()=>{o.cleanup?.(h())}),{contextValue:{state:p,componentActions:w,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 um(t,a.contextValue),a}function i(){return am(t)}return{useManagedComponent:e,provideManagedComponent:n,useManagedComponentState:i,injectionKey:t}}function pe(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 bt(o){let t=!1,e=null;return(...i)=>(t||(t=!0,e=o(...i)),e)}var Xa=(o,t)=>o-t;var vo=(o,t)=>Xa(o.revision,t.revision),W=class o{constructor(t){this.map=new Map;this.length=0;this.revision=0;this.mutations=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)}get version(){return this.mutations}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(vo).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(vo).map(f=>f.keys):l:(this.visitWithNext(t,(f,m,p,h,y)=>{u({...y,keys:m})},!1,d,i,n),r?a.sort(vo).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;this.mutations++,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,this.mutations++}delete(t){let e=this.map;this.mutations++,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=bt(()=>{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(vo);function*n(){for(let i=0,r=e.length;i<r;i++)yield t(e[i])}return n()}};globalThis.DeepMap=W;function Fe(){return globalThis}var Io=["#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"],Ja=Symbol("color"),Ro=new WeakMap,Zi=pe();function Xi(o=Io){Ro.set(o,o.map(t=>0))}Xi();var mm=(o=Io)=>{let t=[];Ro.has(o)?t=Ro.get(o):(t=o.map(n=>0),Ro.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]??Io[0]},Wn=":",Ji="*",Qa="-",hm=",",gm="debug",ym="diffdebug",tl=!1,Hn=new W,jn=new Map;function Qi(o,t){let e=o.split(Wn),n=new W;n.set(e,!0);let i=t.split(Wn),r=new Set(i).has(Ji),a=i.indexOf(Ji),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(Wn)):!0}}function nl(o,t){let e=`channel=${o}_permissions=${t}`;if(jn.has(e))return jn.get(e);let n=t.split(hm);function i(l){return jn.set(e,l),l}let r=[],a=[];n.forEach(l=>{l.includes(Ji)?a.push(l):r.push(l)});for(let l=0;l<r.length;l++){let u=r[l],d=u.startsWith(Qa);if(d&&(u=u.substring(Qa.length)),Qi(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)),Qi(o,u))return i(!d)}return i(!1)}var er=()=>Xe.enable??(Fe()&&Fe().localStorage?.getItem(gm))??"",bm=()=>Xe.diffenable??(Fe()&&Fe().localStorage?.getItem(ym))??`${tl}`,tr="",ol=tl;function nr(o){ol=`${bm()}`=="true",tr!==o&&(tr=o,jn.clear())}function il(o){nr(er()),typeof Fe()<"u"&&Fe().addEventListener&&Fe().addEventListener("storage",function(){nr(er())});function t(e,n){let i=n?`${n}${Wn}${e}`:e,r=i.split(Wn),a=Hn.get(r);if(a)return a;let l=Hn.get(r.slice(0,-1)),u=(l?l.logFn:Xe.logFn)??rl,d=u,s,c=0,f=()=>s??nl(i,tr),m=mm(Xe.colors),p=Object.defineProperties((...h)=>{let y=Zi.getListenersCount(),C;if(y>0&&(C=C??Date.now(),Zi({color:m,channel:i,args:h,timestamp:C})),f()){if(C=C??Date.now(),c&&ol){let S=C-c;d(`%c[${i}]`,`color: ${m}`,`+${S}ms:`)}c=C;let b=[],w;if(h.forEach(S=>{if(S[Ja])w===void 0&&(w=!0),b.push(...S);else{if(typeof S!="string"&&typeof S!="number"){w=!1;return}b.push(`${S}%s`)}}),w){let S=[`%c[${i}]%c %s`,`color: ${m}`,"",...b,""];d(...S)}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[Ja]=!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:()=>{Hn.delete(r)}}});return Hn.set(r,p),p}return t(o)}var rl=console.log.bind(console),el;Object.defineProperty(il,"enable",{get:()=>el,set:o=>{el=o,nr(er())}});var Xe=il;Xe.colors=Io;Xe.logFn=rl;var Cm=(o,t)=>Zi.onChange(e=>{if(!e)return;let{channel:n,args:i,color:r,timestamp:a}=e;Qi(n,o)&&t({channel:n,color:r,args:i,timestamp:a})});Xe.onLogIntent=Cm;Xe.isChannelEnabled=nl;Xe.destroyAll=()=>{Xi(),Xi(Xe.colors),Hn.clear(),jn.clear()};var Tm=Xe("IT:InfiniteTable"),Sm="#dc3545",wm="#eb9316";var ll="Warn",sl="Error",vm="Info",Rm="Success",Im="Logs",xo=Tm.extend(Im),HT=xo.extend(vm),xm=xo.extend(ll),Pm=xo.extend(sl),WT=xo.extend(Rm);var Dm=wm,Am=Sm;var _m=(o,t)=>{t=t?t.extend?t.extend(ll):t:xm,t(typeof t.color=="function"?t.color(Dm,o):o)},Em=(o,t)=>{t=t?t.extend?t.extend(sl):t:Pm,t(typeof t.color=="function"?t.color(Am,o):o)};var al=new W,ul=(o,...t)=>{al.has(t)||(al.set(t,!0),o())};var dl=(o,t=o,e)=>{ul(()=>_m(o,e),t,"warn")},cl=(o,t=o,e)=>{ul(()=>Em(o,e),t,"error")};function $n(o){return o}function Kt(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||$n)(l,o);return e.push(u),e},[])}var Po="____not_loaded_yet____";function or(o){return typeof o=="string"&&o.startsWith(Po)}var Mm=new W,fl=new WeakMap;function Do(o){let{originalDataArray:t,groupBy:e,toPrimaryKey:n}=o;if(!t||!e.length)return Mm;let i=fl.get(t);if(i&&i.groupBy===e)return i.groups;let r=new W,a=e.length,l=[];return t.forEach(u=>{let d=Kt(u,e);l.length=0;for(let s=0;s<d.length;s++){l.push(d[s]);let c=r.get(l);c||(c={count:0},l.length===a&&(c.primaryKeys=[]),r.set(l,c)),c.count++,c.primaryKeys?.push(n(u))}}),fl.set(t,{groupBy:e,groups:r}),r}function Fm(o,t){let e=[];return o.getLeafNodesStartingWith(t,n=>{let i=n.value?.primaryKeys;if(i)for(let r=0;r<i.length;r++)e.push(i[r])}),e}var Pe=class o{constructor(t,e,n){this.selectedRows=null;this.deselectedRows=null;this.defaultSelection=!1;this.selectedMap=new W;this.deselectedMap=new W;this.onlyUsePrimaryKeys=!1;this.selectionCache=new W;this.selectionCountCache=new W;this.lazyEntries=null;this.lazyLoadedRows=null;this.lazyChildrenLoaded=null;this.lazyRowCounts=null;this.mapSet=(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?Kt(i,n):[]}getGroupDeepMap(){return this.getConfig().groupDeepMap}targetsVisibleRowsOnly(){let{multiRowSelectionTarget:t,someRowsFilteredOut:e}=this.getConfig();return t==="visible"&&!!e}targetsFilteredOutRows(){let{multiRowSelectionTarget:t,someRowsFilteredOut:e}=this.getConfig();return t!=="visible"&&!!e}getVisibleDataInsideGroup(t){let{postFilterDataArray:e,groupDeepMap:n}=this.getConfig();return t.length?n?.get(t)?.items??[]:e??[]}hasFilteredOutRowsInsideGroup(t){let e=this.getConfig();return e.someRowsFilteredOut?(t.length?Do(e).get(t)?.count??0:e.originalDataArray?.length??0)>this.getVisibleDataInsideGroup(t).length:!1}setVisibleRowsSelection(t,e){let{groupBy:n,toPrimaryKey:i}=this.getConfig(),r=e?this.selectedMap:this.deselectedMap,a=e?this.deselectedMap:this.selectedMap;this.xcache(),this.getVisibleDataInsideGroup(t).forEach(l=>{let u=Kt(l,n),d=i(l),s=[...u,d];a.delete(s),this.isRowSelected(d,u)!==e&&r.set(s,!0)}),this.xcache()}getLazyUnfilteredCount(t){let e=this.getConfig();if(!(!e.lazyLoad||e.multiRowSelectionTarget==="visible"))return t.length?e.groupDeepMap?.get(t)?.totalChildrenCountUnfiltered:e.lazyUnfilteredCount}getLazyHiddenRowsCount(t){let e=t.length<this.getGroupByLength()?this.getLazyUnfilteredCount(t):void 0;if(e===void 0)return 0;let{groupDeepMap:n}=this.getConfig(),i=0;return this.getGroupKeysDirectlyInsideGroup(t).forEach(r=>{i+=this.getLazyUnfilteredCount(r)??(n?.get(r)?.totalChildrenCount||0)}),Math.max(e-i,0)}getLazyEntries(){let t=`${this.selectedMap.version}:${this.deselectedMap.version}`;if(this.lazyEntries?.version!==t){let e=new W;this.selectedMap.getKeysStartingWith([]).forEach(n=>e.set(n,!0)),this.deselectedMap.getKeysStartingWith([]).forEach(n=>e.set(n,!1)),this.lazyEntries={version:t,entries:e}}return this.lazyEntries.entries}getLazyRowCount(t){this.lazyRowCounts=this.lazyRowCounts??new W;let e=this.lazyRowCounts.get(t);if(e!==void 0)return e??void 0;let n=this.computeLazyRowCount(t);return this.lazyRowCounts.set(t,n??null),n}computeLazyRowCount(t){let e=this.getConfig(),n=this.getGroupByLength(),i=this.getLazyUnfilteredCount(t);if(i!==void 0)return i;if(!t.length&&!n)return e.totalCount;let r=t.length?e.groupDeepMap?.get(t):void 0,a=t.length?r?.totalChildrenCount:e.lazyGroupedRowCount;if(a!=null)return a;if(t.length===n)return r?.childrenAvailable?r.items.length:void 0;let l=e.groupDeepMap?.getKeysStartingWith(t,{excludeSelf:!0,depthLimit:1})??[];if(l.length)return l.reduce((u,d)=>u+(or(d[d.length-1])?1:this.getLazyRowCount(d)??1),0)}areLazyChildrenLoaded(t){this.lazyChildrenLoaded=this.lazyChildrenLoaded??new W;let e=this.lazyChildrenLoaded.get(t);if(e!==void 0)return e;let n=this.computeLazyChildrenLoaded(t);return this.lazyChildrenLoaded.set(t,n),n}computeLazyChildrenLoaded(t){let{groupDeepMap:e}=this.getConfig(),n=t.length?e?.get(t):void 0;return t.length&&!n?.childrenAvailable?!1:t.length===this.getGroupByLength()?this.getLazyLoadedRows(t).complete:(e?.getKeysStartingWith(t,{excludeSelf:!0,depthLimit:1})??[]).every(i=>!or(i[i.length-1]))}getLazyLoadedRows(t){this.lazyLoadedRows=this.lazyLoadedRows??new W;let e=this.lazyLoadedRows.get(t);if(!e){let{groupDeepMap:n,originalDataArray:i,toPrimaryKey:r,totalCount:a}=this.getConfig(),l=t.length?n?.get(t):void 0,u=l?l.items:i??[],d=l?l.totalChildrenCount:a,s=new Set,c=d==null||u.length>=d;for(let f=0;f<u.length;f++){let m=u[f];m==null?c=!1:s.add(r(m))}e={primaryKeys:s,complete:c},this.lazyLoadedRows.set(t,e)}return e}isLazyEntryFilteredOut(t){let{groupDeepMap:e}=this.getConfig(),n=this.getGroupByLength();for(let i=1;i<=t.length;i++){let r=t.slice(0,i-1);if(!(i>n?this.getLazyLoadedRows(r).primaryKeys.has(t[i-1]):!!e?.get(t.slice(0,i))))return this.areLazyChildrenLoaded(r)}return!1}getLazySelectionCountFor(t,e){let n=this.selectionCountCache.get(t);if(n!=null)return n;let i=this.getLazyEntries(),r=this.getGroupByLength()+1,a=this.getLazyUnfilteredCount([])!==void 0,l=0,u=0;i.getKeysOfFirstChildOnEachBranchStartingWith(t,{excludeSelf:!0,respectOrder:!1}).forEach(f=>{if(!a&&this.isLazyEntryFilteredOut(f))return;let m=i.get(f);if(f.length>=r){m?l++:u++;return}let p=this.getLazySelectionCountFor(f,m);l+=p.selectedCount,u+=p.deselectedCount});let d=this.getLazyRowCount(t),s=d===void 0?1:Math.max(d-l-u,0);e?l+=s:u+=s;let c={selectedCount:l,deselectedCount:u};return this.selectionCountCache.set(t,c),c}getGroupCount(t){if(t.length==0)return this.getLazyUnfilteredCount([])??this.getConfig().totalCount;if(this.targetsFilteredOutRows())return Do(this.getConfig()).get(t)?.count??0;let n=this.getGroupDeepMap()?.get(t);return n?this.getLazyUnfilteredCount(t)??n.totalChildrenCount??(n.items.length||0):0}getGroupKeysDirectlyInsideGroup(t){let e=this.getConfig(),n={excludeSelf:!0,depthLimit:1};return this.targetsFilteredOutRows()?Do(e).getKeysStartingWith(t,n):e.groupDeepMap?.getKeysStartingWith(t,n)||[]}getAllPrimaryKeysInsideGroup(t){let e=this.getConfig(),{groupDeepMap:n,toPrimaryKey:i}=e;if(this.targetsFilteredOutRows())return t.length?Fm(Do(e),t):(e.originalDataArray??[]).map(i);if(!e.groupBy.length)return this.getVisibleDataInsideGroup([]).map(i);if(!t.length)return(n?.getKeysStartingWith([],{excludeSelf:!0,depthLimit:1})||[]).map(l=>this.getAllPrimaryKeysInsideGroup(l)).flat();let r=n?.get(t);return r?r.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(),this.lazyLoadedRows=null,this.lazyChildrenLoaded=null,this.lazyRowCounts=null}getState(){let t=i=>{let r=this.getGroupByLength();return i.map(a=>this.onlyUsePrimaryKeys||r===0&&a.length===1?a[0]:a)},e=t(this.selectedMap.topDownKeys()),n=t(this.deselectedMap.topDownKeys());return{defaultSelection:this.defaultSelection,selectedRows:e,deselectedRows:n}}deselectAll(){if(this.targetsVisibleRowsOnly()){this.onlyUsePrimaryKeys?this.deselectGroupRow([]):this.setVisibleRowsSelection([],!1);return}this.update({defaultSelection:!1,selectedRows:[],deselectedRows:[]})}selectAll(){if(this.targetsVisibleRowsOnly()){this.onlyUsePrimaryKeys?this.selectGroupRow([]):this.setVisibleRowsSelection([],!0);return}this.update({defaultSelection:!0,deselectedRows:[],selectedRows:[]})}isRowDefaultSelected(){return this.defaultSelection===!0}isRowDefaultDeselected(){return this.defaultSelection===!1}isRowSelected(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}if(this.targetsVisibleRowsOnly()&&this.hasFilteredOutRowsInsideGroup(t)){this.setVisibleRowsSelection(t,!0);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)}),this.xcache()}deselectGroupRow(t){if(this.onlyUsePrimaryKeys){this.getAllPrimaryKeysInsideGroup(t).forEach(r=>{this.defaultSelection===!1?this.selectedMap.delete([r]):this._deselectedMapSet(r)}),this.xcache();return}if(this.targetsVisibleRowsOnly()&&this.hasFilteredOutRowsInsideGroup(t)){this.setVisibleRowsSelection(t,!1);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)}),this.xcache()}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(this.getConfig().lazyLoad&&(!this.onlyUsePrimaryKeys||!i))return this.getLazySelectionCountFor(t,e??this.getGroupRowBooleanSelectionStateFromParent(t));if(this.onlyUsePrimaryKeys&&(i||this.targetsVisibleRowsOnly())){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}if(t.length===i&&this.targetsVisibleRowsOnly()){let{toPrimaryKey:d}=this.getConfig(),s=0,c=0;this.getVisibleDataInsideGroup(t).forEach(m=>{this.isRowSelected(d(m),t)?s++: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;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 Bt=o=>{let t=Xe(o?`IT:${o}:TYPE=debug`:"IT:TYPE=debug");return t.logFn=console.log.bind(console),t},Ht=o=>{let t=Xe(o?`IT:${o}:TYPE=error`:"IT:TYPE=error");return t.logFn=console.error.bind(console),t},Un=()=>Un;Un.extend=()=>Un;var et=class{constructor(t){this.debug=Un,this.error=Un}};var Nm=function(o,t){return o-t},Om=function(o,t){return o=`${o}`,t=`${t}`,o.localeCompare(t)},km=function(o,t){return o-t},Lm={number:Nm,string:Om,date:km},Wt=Lm;var ke=Fe().requestAnimationFrame||(o=>setTimeout(o,16)),Qt=Fe().cancelAnimationFrame||(o=>clearTimeout(o));function jt(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 ir(o){return o.map(Ct)}function Ct(o){if(Fe().structuredClone)return Fe().structuredClone(o);if(o===null||typeof o!="object")return o;if(Array.isArray(o))return ir(o);if(o instanceof Date)return new Date(o);if(o instanceof Set)return new Set(ir(Array.from(o)));if(o instanceof Map)return new Map(ir(Array.from(o)));let t={};for(let e in o)o.hasOwnProperty(e)&&(t[e]=Ct(o[e]));return t}var en=Object.seal({data:null,field:null});var at="____root____";function $t(){return!1}function rr(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 Ao(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 ml(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 W;function c(C,b,w,S=0,T=[]){let I=!w.length||S===w.length-1,x=b[d?.values||"values"]||{};for(let F in x)if(x.hasOwnProperty(F)){let N=F;T.push(N),f.set(T,!0),C.set(T,{reducerResults:x[F][d?.totals||"totals"]||{},items:[]}),I||c(C,x[F],w,S+1,T),T.pop()}}let f=i?new W:void 0,m=[],p=rr(n),h=Ct(p);t.visitDepthFirst((C,b,w,S)=>{let[T,...I]=b,x=C.children,F=s.get(I);if(F&&(F.cache=C.cache,F.childrenLoading=C.childrenLoading,F.childrenAvailable=C.childrenAvailable,F.error=C.error),I.length==r.length&&r.length){if(F){F.items=x;for(let R=0,A=I.length;R<A;R++){let E=I.slice(0,R),P=s.get(E);P&&(P.items=P.items||[],P.items=P.items.concat(x))}x=a.indexArray(x,{toPrimaryKey:l,cache:u,nodesKey:void 0})}return S?.()}for(let N=0,R=x.length;N<R;N++){if(!x[N]){let D={items:[],reducerResults:{},cache:!1,childrenLoading:!1,childrenAvailable:!1,isTree:!1,isGroupBy:!0};s.set([...I,`${Po}${N}`],D);continue}let A=x[N].data,E=x[N].keys||[];if(E.length){let D=E[E.length-1];I.push(D)}let P={items:[],cache:!1,childrenLoading:!1,childrenAvailable:!1,commonData:A,totalChildrenCount:x[N].totalChildrenCount,totalChildrenCountUnfiltered:x[N].totalChildrenCountUnfiltered,reducerResults:x[N].aggregations||{},isTree:!1,isGroupBy:!0};if(s.set(I,P),i){let D=P.pivotDeepMap=new W,M=x[N].pivot;c(D,M,i,0,m)}E.length&&I.pop()}S?.()});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 pl(o,t,e,n,i,r,a,l,u,d=$n){let{items:s,reducerResults:c,pivotDeepMap:f}=o.get(t);if(s.push(n),a&&Ao(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&&(en.data=n,en.field=h,b=y(en));let w=(C||d)(b,n);e.push(w),f.has(e)||(l.set(e,!0),f?.set(e,{reducerResults:Ct(u),items:[]}));let{reducerResults:S,items:T}=f.get(e);T.push(n),a&&Ao(n,i,a,S,t)}e.length=0}}function hl(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 w=n.slice(0,C),S=t.get(w),{reducerResults:T,items:I}=S;I.push(i),S.leavesAvailableCount++,S.totalLeafNodesCount++,a&&Ao(i,r,a,T,w)}return}let p=Ct(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 w=y[C];hl(o,t,e,f,w,C,a,l)}a&&qn(a,p,h)}}function ar(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=rr(e),r=Ct(i),a=new W,l=new W;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++)hl(o,a,l,[],t[d],d,e,i);e&&qn(e,r,t);let u={deepMap:a,treeParams:o,treePaths:l,initialData:t,reducerResults:r};return n&&n.end(),u}function lr(o,t){let{marker:e,groupBy:n,defaultToKey:i=$n,pivot:r,reducers:a}=o;e&&e.start();let l=n.length,u=r?new W:void 0,d=new W,s=[],c=[],f=rr(a),m=Ct(f);if(!l){let h={items:[],isTree:!1,isGroupBy:!0,cache:!1,childrenLoading:!1,childrenAvailable:!1,reducerResults:Ct(f)};r&&(h.pivotDeepMap=new W),d.set(s,h)}for(let h=0,y=t.length;h<y;h++){let C=t[h],b={};for(let w=0;w<l;w++){let{field:S,groupField:T,valueGetter:I,toKey:x}=n[w],F=S?C[S]:null;I&&(en.data=C,en.field=S,F=I(en));let N=(x||i)(F,C);if(b[S||T]=N,s.push(N),!d.has(s)){let R={items:[],isTree:!1,isGroupBy:!0,cache:!1,commonData:{...b},childrenLoading:!1,childrenAvailable:!1,reducerResults:Ct(f)};r&&(R.pivotDeepMap=new W),d.set(s,R)}pl(d,s,c,C,h,r,a,u,f,i)}l||pl(d,s,c,C,h,r,a,u,f,i),a&&Ao(C,h,a,m,s),s.length=0}a&&(d.visitDepthFirst((h,y,C,b)=>{qn(a,h.reducerResults,h.items),r&&h.pivotDeepMap.visitDepthFirst(({items:w,reducerResults:S},T,I,x)=>{qn(a,S,w),x?.()}),b?.()}),qn(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 zm(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 Vm(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 S=r[b].field;S&&(m[S]=d[b]),S&&f[S]==null&&(f[S]=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(Po)&&(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:$t,hasSelectedCells:$t,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 _o(o,t,e){return{...o,id:`duplicate_row_on_page_${e}_for__${o.id}`,indexInAll:t,duplicateOf:o.id}}function qn(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 gl(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,w=o.length,S=e[e.length-1],T=S?S.nodeExpanded:!0;for(let I=0;I<w;I++){let x=o[I],F=d(x,I),N=[...t,F];if(l(x)){let _={id:F,nodePath:N,isGroupRow:!1,data:x,treeNesting:a,totalLeafNodesCount:0,collapsedLeafNodesCount:0,isTreeNode:!0,isParentNode:!1,selfLoaded:!0,rowSelected:!1,rowDisabled:!1,isCellSelected:$t,hasSelectedCells:$t,dataSourceHasGrouping:!1,parentNodes:Array.from(e),indexInParentNodes:[...n,I],indexInParent:I,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 z=0,K=e.length;z<K;z++){let B=e[z];if(T||(B.collapsedLeafNodesCount+=1),B.deepRowInfoArray.push(_),O!=null&&T){if(typeof y=="function"&&y(B)!==!0)continue;let G=_o(B,_.indexInAll,O);r[G.indexInAll]=G,_.indexInAll++}}T&&(r[_.indexInAll]=_);continue}let E=b.get(N)?.totalLeafNodesCount??0,P={dataSourceHasGrouping:!1,nodeExpanded:!1,selfExpanded:!1,nodePath:N,id:F,data:x,indexInAll:r.length,indexInParent:I,indexInParentNodes:[...n,I],totalLeafNodesCount:E,treeNesting:a,selfLoaded:!0,isParentNode:!0,isTreeNode:!0,isGroupRow:!1,deepRowInfoArray:[],parentNodes:Array.from(e),collapsedLeafNodesCount:0,rowSelected:!1,rowDisabled:!1,isCellSelected:$t,hasSelectedCells:$t,selectedLeafNodesCount:0,deselectedLeafNodesCount:0};if(f&&(P.rowSelected=f(P),h)){let _=h.getSelectionCountFor(P.nodePath);P.selectedLeafNodesCount=_.selectedCount,P.deselectedLeafNodesCount=_.deselectedCount}c&&(P.rowDisabled=c(P)),m&&m(P);let D=!0;if(p&&(P.selfExpanded=D=p(P)),T||(D=!1),P.nodeExpanded=D,T&&y&&C!=null&&C>0){let _=P.indexInAll,O=P.parentNodes;if(O.length>0&&_%C===0){let z=_/C,K=0;O.forEach(B=>{typeof y=="function"&&y(B)!==!0||(r.push(_o(B,_+K,z)),K++,P.indexInAll++)})}}T&&(r[P.indexInAll]=P);let M=u(x);Array.isArray(M)&&gl(M,N,[...e,P],P.indexInParentNodes,i,r)}return r}function yl(o){let{dataArray:t,marker:e}=o;e&&e.start();let n=[];return gl(t,[],[],[],o,n),e&&e.end(),{data:n}}function bl(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(I=>I.field).join(", ")}]});let b=[],w=[],S=[],T=[];return h.visitDepthFirst((I,x,F,N)=>{let R=I.items,A=x.length,E=u?.isGroupRowCollapsed(x)??!1;T.push(F);let P=Vm({lazyLoad:e,groupBy:C,parents:Array.from(S),reducers:m,indexInGroup:F,indexInParentGroups:Array.from(T),indexInAll:b.length,groupKeys:x,error:I.error,totalChildrenCount:I.totalChildrenCount,childrenLoading:(I.childrenLoading||!E&&!I.childrenAvailable)&&e,childrenAvailable:I.childrenAvailable,directChildrenCount:x.length===C.length?I.items.length:h.getDirectChildrenSizeFor(x),directChildrenLoadedCount:0},I);if(s&&(P.rowSelected=s(P),c)){let z=c.getSelectionCountFor(P.groupKeys);P.selectedChildredCount=z.selectedCount,P.deselectedChildredCount=z.deselectedCount}d&&(P.rowDisabled=d(P));let D=S[S.length-1],M=D?.collapsed??!1;M&&(E=!0),P.collapsed=E;let _=f||E;if(M&&(_=!1),_){if(r&&i!=null&&i>0){let z=P.indexInAll,K=P.parents;if(K.length>0&&z%i===0){let B=z/i,G=0;K.forEach(le=>{typeof r=="function"&&r(le)!==!0||(b.push(_o(le,z+G,B)),G++,P.indexInAll++)})}}b.push(P),w.push(b.length-1)}P.collapsedChildrenCount=0,S.forEach(z=>{z.deepRowInfoArray.push(P),z.collapsedGroupsCount+=E?1:0}),D&&P.selfLoaded&&e&&(D.directChildrenLoadedCount+=1),a&&a(P),S.push(P);let O=!0;if(O){if(N)N();else if(!y){let z=b.length;E||(b.length+=R.length);let K=0;for(let B=0,G=R.length;B<G;B++){let le=R[B];if(!E&&r&&i!=null&&i>0){let ve=z+B+K;if(ve%i===0){let Oe=ve/i;S.forEach(Ee=>{if(typeof r=="function"&&r(Ee)!==!0)return;let Te=z+B+K;b[Te]=_o(Ee,Te,Oe),K++,b.length++})}}let Z=z+B+K,me={id:le?l(le,Z):`${x}-${B}`,data:le,isCellSelected:$t,hasSelectedCells:$t,dataSourceHasGrouping:!0,isTreeNode:!1,isGroupRow:!1,selfLoaded:!!le,rowSelected:!1,rowDisabled:!1,rootGroupBy:C,collapsed:E,groupKeys:x,parents:Array.from(S),indexInParentGroups:[...T,B],indexInGroup:B,indexInAll:Z,groupBy:C,groupNesting:A+1,groupCount:P.groupCount};s&&(me.rowSelected=s(me)),d&&(me.rowDisabled=d(me)),a&&a(me),S.forEach((ve,Oe)=>{Oe===S.length-1&&le&&(ve.directChildrenLoadedCount+=1),E&&(ve.collapsedChildrenCount+=1),ve.deepRowInfoArray.push(me)}),E||(b[z+B+K]=me)}}}S.pop(),T.pop()}),t&&t.end(),{data:b,groupRowsIndexes:w}}function mn(o,t){return new Pe(o,Ye(t))}function Ye(o){return()=>{let t=typeof o=="function"?o():o,{originalDataArray:e,postFilterDataArray:n}=t,i=!!t.lazyLoad,r=i?t.originalLazyGroupData.get([at]):void 0;return{lazyLoad:i,toPrimaryKey:t.toPrimaryKey,onlyUsePrimaryKeys:!t.useGroupKeysForMultiRowSelection,groupBy:t.groupBy,groupDeepMap:t.groupDeepMap,indexer:t.indexer,totalCount:i?e?.length??0:t.unfilteredCount,lazyGroupedRowCount:t.groupBy.length?r?.totalChildrenCount:void 0,lazyUnfilteredCount:t.groupBy.length?r?.totalChildrenCountUnfiltered:r?.totalCountUnfiltered,multiRowSelectionTarget:t.multiRowSelectionTarget,someRowsFilteredOut:!t.lazyLoad&&!!e&&!!n&&n.length<e.length,originalDataArray:e,postFilterDataArray:n}}}function Cl(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 Pe))throw"Invalid row selection";let a=new Pe(i,Ye(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 Pe))throw"Invalid row selection";let a=new Pe(i,Ye(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 Pe))throw"Invalid row selection";if(!r){let s=u.getDataForPrimaryKey(i);r=s?Kt(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 Pe))throw"Invalid row selection";if(!r){let c=u.getDataForPrimaryKey(i);r=c?Kt(c,d):[]}let s=new Pe(a,Ye(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 Pe))throw"Invalid row selection";if(a==="multi-row"){if(!r){let c=u.getDataForPrimaryKey(i);r=c?Kt(c,d):[]}let s=new Pe(l,Ye(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 Pe))throw"Invalid row selection";let u=new Pe(a,Ye(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 Pe))throw"Invalid row selection";let u=new Pe(a,Ye(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 Pe))throw"Invalid row selection";let u=new Pe(a,Ye(t));u.toggleGroupRowSelection(i),e.rowSelection=u},getGroupRowSelectionState(i,r){let a=t(),{selectionMode:l,groupBy:u}=a,d=r?new Pe(r,Ye(a)):a.rowSelection;if(l!=="multi-row")throw'Selection mode should be "multi-row"';if(!u)throw"No grouping specified";if(!(d instanceof Pe))throw"Invalid row selection";return d.getGroupRowSelectionState(i)},getSelectedPrimaryKeys:i=>{let r=t(),a=i?new Pe(i,Ye(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 sr=new WeakMap,Gm=o=>o;function Tl(o,t=50,e){sr.set(o,{lastCallTime:0,lastCallArg:null});let n=e??Gm;return i=>{let{lastCallTime:r,lastCallArg:a}=sr.get(o)||{lastCallTime:0,lastCallArg:null},l=Date.now(),u=l-r,d=jt(n(a),n(i));u<t&&d||(sr.set(o,{lastCallTime:l,lastCallArg:i}),o(i))}}var Km="*",Ke=class{constructor(t){this.wildcard=Km;this.cache=new W;this.selectedRowsToColumns=new Map;this.selectedColumnsToRows=new Map;this.deselectedRowsToColumns=new Map;this.deselectedColumnsToRows=new Map;this.defaultSelection=!1;this.debugId="";this.deselectAll=()=>{this.update({defaultSelection:!1,selectedCells:[]})};this.selectAll=()=>{this.update({defaultSelection:!0,deselectedCells:[]})};let 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){Ht(`${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}}};import{defineComponent as _u,h as Eu}from"vue";import{computed as vt,defineComponent as Fr,h as Rn,inject as ng,provide as og,ref as Du,shallowRef as ig,watch as rg}from"vue";var te=(...o)=>o.filter(t=>!!`${t}`).join(" ");var Sl="_16lm1iw2 _16lm1iw23 _16lm1iw26 _16lm1iw2c _16lm1iw2a",wl={center:"_16lm1iw2j",stretch:"_16lm1iw2k",start:"_16lm1iw2l",end:"_16lm1iw2m"};var lt="_16lm1iw3b _16lm1iw3c _16lm1iw35",vl={pointer:"_16lm1iwk",default:"_16lm1iwl",colResize:"_16lm1iwm",grabbing:"_16lm1iwn",grab:"_16lm1iwo"},Eo={flex:"_16lm1iw1p",contents:"_16lm1iw1q",none:"_16lm1iw1r",block:"_16lm1iw1s",grid:"_16lm1iw1t",inlineBlock:"_16lm1iw1u",inlineFlex:"_16lm1iw1v",inlineGrid:"_16lm1iw1w"};var Rl={1:"_16lm1iw1c",none:"_16lm1iw1d"},ur={column:"_16lm1iw2f",columnReverse:"_16lm1iw2g",row:"_16lm1iw2h",rowReverse:"_16lm1iw2i"};var Il={0:"_16lm1iw1y","100%":"_16lm1iw1z","50%":"_16lm1iw20"},xl={center:"_16lm1iw30",spaceBetween:"_16lm1iw31",spaceAround:"_16lm1iw32",start:"_16lm1iw33",end:"_16lm1iw34"},Pl={0:"_16lm1iw26","100%":"_16lm1iw27","50%":"_16lm1iw28",auto:"_16lm1iw29"};var Dl={none:"_16lm1iwd"},Mo={hidden:"_16lm1iw35",auto:"_16lm1iw36",visible:"_16lm1iw37"};var Al={relative:"_16lm1iw1",absolute:"_16lm1iw2",static:"_16lm1iw3",sticky:"_16lm1iw4",fixed:"_16lm1iw5"};var _l={0:"_16lm1iw23","100%":"_16lm1iw24","50%":"_16lm1iw25"};var El={none:"_16lm1iw1x"};var Ml={visible:"_16lm1iw38",hidden:"_16lm1iw39"};var Fl={1:"_16lm1iw1e",10:"_16lm1iw1f",100:"_16lm1iw1g",1e3:"_16lm1iw1h",1e4:"_16lm1iw1i",1e5:"_16lm1iw1j",1e6:"_16lm1iw1k",1e7:"_16lm1iw1l","1k":"_16lm1iw1m","10k":"_16lm1iw1n","100k":"_16lm1iw1o"};import{defineComponent as $m,h as Yn,onBeforeUnmount as Um,onMounted as qm,ref as Ym}from"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 Hm(o){var t=Bm(o,"string");return typeof t=="symbol"?t:String(t)}function Wm(o,t,e){return t=Hm(t),t in o?Object.defineProperty(o,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):o[t]=e,o}function Nl(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 Ol(o){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?arguments[t]:{};t%2?Nl(Object(e),!0).forEach(function(n){Wm(o,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(e)):Nl(Object(e)).forEach(function(n){Object.defineProperty(o,n,Object.getOwnPropertyDescriptor(e,n))})}return o}function kl(o,t){var e={};for(var n in o)e[n]=t(o[n],n);return e}var jm=(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},we=o=>{var t=e=>{var n=o.defaultClassName,i=Ol(Ol({},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)jm(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 kl(o.variantClassNames,e=>kl(e,n=>n.split(" ")[0]))}},t};var Ll="_1eexc2a6";var zl=we({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:[]}),Vl="_12zfob1q _16lm1iw2 _16lm1iw1k _16lm1iw3b _16lm1iw3c _16lm1iw35",Gl=we({defaultClassName:"_16lm1iw2 _16lm1iw25 _16lm1iw26 _16lm1iwh _16lm1iwf",variantClassNames:{visible:{true:"_12zfob19",false:"_12zfob1a"}},defaultVariants:{},compoundVariants:[]}),Kl=we({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"]]}),Bl=we({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 Wl="_12zfob17",jl="_12zfob12q _16lm1iw1p _16lm1iw2h _16lm1iw2j _16lm1iw1",$l=we({defaultClassName:"_12zfob12r _16lm1iw1 _16lm1iw23",variantClassNames:{disabled:{true:"_12zfob12s",false:"_12zfob12t"}},defaultVariants:{},compoundVariants:[]}),dr=we({defaultClassName:"_12zfob12n _16lm1iw1p _16lm1iw2h _16lm1iw2k _16lm1iw1",variantClassNames:{active:{true:"_12zfob12o",false:"_12zfob12p"}},defaultVariants:{},compoundVariants:[]}),Ul="_12zfob12m _16lm1iw1p _16lm1iw2h _16lm1iw2j",ql=we({defaultClassName:"_12zfob127 _16lm1iw1 _16lm1iw1p _16lm1iw2f _16lm1iw32 _16lm1iw39",variantClassNames:{menuVisible:{true:"_12zfob128"},reserveSpaceWhenHidden:{true:"_12zfob129",false:"_12zfob12a"}},defaultVariants:{},compoundVariants:[[{menuVisible:!0,reserveSpaceWhenHidden:!1},"_12zfob12b"]]}),Yl="_12zfob1b _16lm1iw2",Zl="_16lm1iw1",Xl="_12zfob16",Jl=we({defaultClassName:"_12zfob12",variantClassNames:{align:{start:"_12zfob13",center:"_12zfob14",end:"_12zfob15"}},defaultVariants:{},compoundVariants:[]}),Ql="_12zfob12l _16lm1iw35 _16lm1iw1 _16lm1iw1p _16lm1iw2h";var nt="InfiniteIcon";var es="_1nnkya20 _16lm1iw1p _16lm1iw2f _16lm1iw1 _16lm1iw32 _16lm1iw2j";var ts={transition:"width 0.25s, opacity 0.25s"},ns=Object.keys({size:1,lineWidth:1,lineStyle:1,style:1,className:1,index:1});var hn=$m(o=>{let t=Ym(0),e=null;return qm(()=>{e=requestAnimationFrame(()=>{e=null,t.value=1})}),Um(()=>{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={...ts,borderTop:`${n}px solid currentColor`,...o.lineStyle,opacity:t.value};return Yn("div",{"data-name":"filter-icon",style:{...o.style,width:`${l}px`},class:te(i,nt,es,`${nt}-filter`)},[a?Yn("div",{"data-name":"index",class:Wl},`${r}`):null,Yn("div",{style:{width:`${d[0]}px`,...s}}),Yn("div",{style:{width:`${d[1]}px`,...s}}),Yn("div",{style:{width:`${d[2]}px`,...s}})])}},{name:"FilterIcon",props:[...ns]});var Fo=Object.freeze({}),Zm={string:Fo,number:{}};function gn(o,t){let e=t.default||Fo;return o.type===void 0?e:o.type===null?Fo:typeof o.type=="string"?t[o.type]||Zm[o.type]||Fo:o.type.reduce((n,i)=>Object.assign(n,t[i]),{})}var fr=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((x,F)=>{let N=x.maxSize??i??void 0,R=x.minSize??n??void 0;u.push(R),d.push(N),x.size!=null&&(N!=null&&x.size>N&&(x.size=N),R!=null&&x.size<R&&(x.size=R));let A=x.flex==0?null:x.flex;if(x.size==null&&A==null)throw`Items must specify either a size or a flex property. Item at index ${F} doesn't have either of those.`;A!=null&&(l+=1),a+=A??0,r+=x.size??0});let s=o.computeSpecialSpaceDistribution?Math.max(t,0):Math.max(t-r,0),c=s/a,f={},m={},p=0;e.forEach((x,F)=>{if(x.flex!=null){let N=c*x.flex,R=x.maxSize??i??void 0,A=x.minSize??n??void 0,E=!1,P=0;R!=null&&N>R&&(f[F]=!0,E=!0,P=R),A!=null&&N<A&&(m[F]=!0,E=!0,P=A),E&&(p+=1,l-=1,a-=x.flex,s-=P)}}),p&&(c=s/a);let h=[],y=0,C=s,b=a,w=0,S=0,T=[];return{items:e.map((x,F)=>{let N={...x},R=x.maxSize??i??void 0,A=x.minSize??n??void 0,E=0,P=f[F],D=m[F],M=P||D,_=x.size??0;if(x.flex!=null){if(M)D&&(E=A),P&&(E=R);else{y+=1;let O=z=>(R!=null&&z>R&&(z=R),A!=null&&z<A&&(z=A),z);y===l?E=O(C):(E=O(Math.round(x.flex*c)),S+=E,C=s-S,b-=x.flex,c=C/b)}_=E,N.flexSize=E}return h.push(E),T.push(_),N.computedSize=_,w+=_,N}),flexSizes:h,minSizes:u,maxSizes:d,computedSizes:T,remainingSize:Math.round(t-w)}};function No(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 is(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 cr(o,t){return o.computedFlex&&!t?"flex":"width"}function Zn(o,t,e){if(t==="width"){let{flex:n,...i}=o??{};return{...i,width:e}}return{...o,flex:e}}var pr=o=>{let{availableSize:t,reservedWidth:e=0}=o,n=Object.keys(o.columnSizing).reduce((A,E)=>(A[E]={...o.columnSizing[E]},A),{});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=is(o.items,t,e),f=l.computedWidth,m=l.computedMinWidth,p=l.computedMaxWidth,h=cr(l,c),y=u?.computedWidth,C=u?.computedMinWidth,b=u?.computedMaxWidth,w=u?cr(u,c):"width",S=!1,T=!1,I=i>0?1:-1,{value:x,clamped:F,diff:N}=No(Math.round(f+i),m,p,I);if(o.shareSpaceOnResize){if(u==null)return n[d]=Zn(n[d],h,x),T=F==="min",S=F==="max",{adjustedDiff:x-f,reservedWidth:e,columnSizing:n,minReached:T,maxReached:S,constrained:T||S};let{value:A,clamped:E,diff:P}=No(Math.round(y-i),C,b,I);if(F&&E&&(Math.abs(N)>Math.abs(P)?E=!1:F=!1),!(!F&&!E)){if(F){let D=No(Math.round(y-i-N),C,b,I);A=D.value,E=D.clamped,P=D.diff}else if(E){let D=No(Math.round(f+i+P),m,p,I);x=D.value,F=D.clamped,N=D.diff}}n[d]=Zn(n[d],h,x),n[s]=Zn(n[s],w,A),T=F==="min"||E==="min",S=F==="max"||E==="max"}else n[d]=Zn(n[d],h,x),T=F==="min",S=F==="max";let R=x-f;return{adjustedDiff:R,reservedWidth:o.shareSpaceOnResize?e:Math.round(e-R),columnSizing:n,minReached:T,maxReached:S,constrained:T||S}};function os(o,t){return o+t}function Xm(o){return Object.keys(o).reduce((e,n)=>(e[n]={...o[n]},e),{})}var rs=o=>{let{availableSize:t,reservedWidth:e=0}=o,n=Object.keys(o.columnSizing).reduce((b,w)=>(b[w]={...o.columnSizing[w]},b),{});if(t<0)throw"The provided availableSize cannot be negative!";let i=o.dragHandleOffset,r=[...new Array(o.columnGroupSize)].map((b,w)=>o.dragHandlePositionAfter-w).reverse(),a=r.map(b=>o.items[b]),l=a.map(b=>b.computedWidth),u=is(o.items,t,e),d=a.map(b=>cr(b,u)),s=0,{computedSizes:c}=fr({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(os,0)+i-s,0)}),f=a.map((b,w)=>c[w]-b.computedWidth),m=!0,p=!0,h=!0,y=[];f.forEach((b,w)=>{let S=a[w];if(!S.resizable){y.push(0);return}let T=d[w],I=l[w],x=Xm(n),{maxReached:F,minReached:N,constrained:R,adjustedDiff:A}=pr({availableSize:o.availableSize,reservedWidth:o.reservedWidth,dragHandleOffset:b,dragHandlePositionAfter:r[w],shareSpaceOnResize:!1,items:o.items,columnSizing:x});n[S.id]=Zn(x[S.id],T,Math.round(I+A)),y.push(A),F||(p=!1),N||(m=!1),R||(h=!1)});let C=y.reduce(os,0);return{minReached:m,maxReached:p,constrained:h,adjustedDiffs:y,adjustedDiff:C,columnSizing:n,reservedWidth:Math.round(e-C)}};var Oo;function Tt(){if(Oo!=null)return Oo;let o=Fe().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),Oo=t.offsetWidth-e.offsetWidth,t.parentNode?.removeChild(t),Oo}var as=["start",void 0,"end"],ls=(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:as.indexOf(i)-as.indexOf(r)}),o);function ss(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 mr(o,...t){return ss(e=>e!=null,o,...t)}function us(o,t,...e){return ss((n,i)=>!(i in o),t,...e)}var ko=!0,Jm=!0,Qm=!0,ds="string",Ot="unknown";var eh=Ht("getComputedVisibleColumns"),th=(o,t,e)=>o[e]!==!1,hr=(o,t)=>{if(!t)return!1;let e=t[o];return e==="start"||e===!0?"start":e==="end"?"end":!1};function tn(o,t){if(o)return o[t]?o[t]:Object.values(o).find(e=>e.field===t)}function nh(o,t){let e=gn(o,t);return o.sortType?o.sortType:e.sortType?e.sortType:typeof o.type=="string"?o.type:ds}function oh(o,t,e){let i=(Array.isArray(o)?o:o?[o]:[]).flatMap(r=>{let a=r.field??r.groupField;if(!a)return[Ot];let l=tn(t,a);if(!l)return[Ot];let u=nh(l,e);return Array.isArray(u)?u:[u]});return i.every(r=>r===Ot)?Ot:i.length===1?i[0]:i}function gr(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??ko}var cs=({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=Xn,viewportReservedWidth:C,resizableColumns:b,draggableColumns:w,columnDefaultDraggable:S,columnOrder:T,columnPinning:I,editable:x,columnDefaultEditable:F,columnDefaultFilterable:N,columnDefaultGroupable:R,columnDefaultSortable:A,columnSizing:E,columnTypes:P,columnVisibility:D,columnVisibilityAssumeVisible:M,groupBy:_})=>{let O=0,z={};_.forEach((g,v)=>{g.field&&(z[g.field]=v)});let K=(f||[]).reduce((g,v)=>{let{id:L,field:k}=v;return k&&(g[k]=v),L&&(g[L]=v),g},{}),B=ls(T===!0?Object.keys(o):T,I),G=B.filter(g=>o[g]?th(D,M,g):(eh(`Column with id "${g}" specified in columnOrder array cannot be found in the columns map.`),!1)),le=new Map,Z=G.map((g,v)=>{let L=o[g];return le.set(g,v),L}),De=(p??[]).reduce((g,v,L)=>(v.id?g[v.id]={sortInfo:v,index:L}:v.field&&(g[v.field]={sortInfo:v,index:L}),g),{});function me(g){let v=o[g],L=gn(v,P),k={minWidth:L?.minWidth,maxWidth:L?.maxWidth,width:L?.defaultWidth,flex:L?.defaultFlex},Y={width:v?.defaultWidth,flex:v?.defaultFlex,minWidth:v?.minWidth,maxWidth:v?.maxWidth},V=E[g];V?.width!=null&&V.flex==null&&delete Y.flex,V?.flex!=null&&V.width==null&&delete Y.width;let J=mr(Y,V);J.width!=null&&delete k.flex,J.flex!=null&&delete k.width,J=mr(k,J);let ce=J.flex??void 0,se=J.minWidth??v?.minWidth??n,fe=J.maxWidth??v?.maxWidth??i,ae=ce!=null?void 0:J.width??(a?void 0:r);return!ae&&ce==null&&(a?ce=a:ae=se),{size:ae,flex:ce,minSize:se,maxSize:fe}}let ve=fr({availableSize:Math.max(e.width-(C??0)-(l??Tt()),0),maxSize:i,minSize:n,items:G.map(me)}),{computedSizes:Oe,flexSizes:Ee,minSizes:Te,maxSizes:_e}=ve,ue=[],Q=[],H=[],q=[];q.length=G.length;let X=new Map,ne=new Map,ie=0,he=0,ge=0,oe=null,$=[],ee=0,Se=0,xe=0;Z.forEach((g,v)=>{let L=G[v],k=Oe[v],Y=$[v]=hr(L,I);Y==="start"?ee+=k:Y==="end"?xe+=k:Se+=k});let be=e.width-xe,Me=[],ze=new Map;G.forEach((g,v)=>{let L=Z[v];ze.set(g,L)});let de=[];Object.keys(o).forEach(g=>{let v=o[g];de.push(g),ze.has(g)||ze.set(g,v)});let tt=new Map;ze.forEach((g,v)=>{let L=le.get(v);L==null&&(L=-1);let k=L!=-1,Y=G[L+1],V=gn(g,P),J=L,ce=De[v]?De[v]:g.field?De[g.field]??null:null,se=ce?.sortInfo??null,fe=!!se,ae=fe&&se.dir===1,ye=fe&&!ae,Re=ce?.index??-1,re=k?{}:me(v),rt=k?Oe[L]:re.size||0,Et=k&&Ee[L]||null,Mt=k?Te[L]||0:re.minSize||0,yt=k?_e[L]||1e4:re.maxSize||1e4,Ge=k?hr(v,I):!1,Ft=k?L===G.length-1:!1,Nt=J,Vn=k?Ge==="start"?he:Ge==="end"?ge:O-he:0;Ge=="start"?Nt=k?J:-1:Ge==="end"?Nt=k?J-(ue.length+H.length):-1:Nt=k?J-ue.length:-1;let Gt=k?Ge==="start"||Ge===!1?O:be+ge:-1,Kp=k?Ge!==oe:!1,Bp=k?Ft||Ge!==hr(Y,I):!1,Ga=g.cssEllipsis??V.cssEllipsis??u,Hp=g.headerCssEllipsis??V.cssEllipsis??g.cssEllipsis??V.headerCssEllipsis??d??Ga,wo=k&&(K[v]||g.field||g.groupByForColumn)&&(K[v]||K[g.field||g.groupByForColumn])||null,Wp=g.defaultFilterable??V.defaultFilterable??N??!0,jp=x??g.defaultEditable??V.defaultEditable??F??!1,ji=g.dataType||V.dataType||(Array.isArray(g.type)?g.type[0]:g.type)||ds,$p=g.sortType||V.sortType||ji,Ka=g.filterType||V.filterType||ji,Ba=!1;if(wo!=null&&!wo.disabled){let Ui=y[Ka];Ui&&(!Ui.emptyValues||!Ui.emptyValues.includes(wo.filter.value))&&(Ba=!0)}let fn=g.field??V.field,Up=g.valueGetter??V.valueGetter,$i=g.defaultGroupable??V.defaultGroupable??R??!!fn;fn||($i=!1),g.groupByForColumn&&($i=!1);let Ha=fn?z[fn]!==void 0:!1,qp=Ha?z[fn]:void 0,Yp=gr(g,{colType:V,sortable:m,columnDefaultSortable:A}),Zp=g.resizable??V.resizable??b??Jm,Be={colType:V,align:V.align,headerAlign:V.headerAlign,computedVisible:k,verticalAlign:V.verticalAlign,defaultHiddenWhenGroupedBy:V.defaultHiddenWhenGroupedBy,valueGetter:Up,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:fn,...g,components:{...V.components,...g.components},computedResizable:Zp,computedMinWidth:Mt,computedMaxWidth:yt,computedFlex:Et,computedDataType:ji,computedEditable:jp,computedSortType:$p,computedFilterType:Ka,cssEllipsis:Ga,headerCssEllipsis:Hp,computedFilterValue:wo,computedFiltered:Ba,computedFilterable:Wp,computedGroupable:$i,computedGroupedBy:Ha,computedGroupedByIndex:qp,computedWidth:rt,computedAbsoluteOffset:Gt,computedPinningOffset:Vn,computedVisibleIndexInCategory:Nt,computedOffset:O,computedSortable:Yp,computedSortInfo:se,computedSortIndex:Re,computedMultiSort:h,computedSorted:fe,computedSortedAsc:ae,computedSortedDesc:ye,computedVisibleIndex:J,computedPinned:Ge,computedDraggable:w??g.defaultDraggable??S??Qm,computedFirstInCategory:Kp,computedLastInCategory:Bp,computedFirst:L===0,computedLast:Ft,id:v,header:g.header??V.header??g.name??g.field};k&&(O+=rt,X.set(Be.id,Be),q[L]=Be,Ge==="start"&&(ue.push(Be),he+=Be.computedWidth),Ge==="end"&&(Q.push(Be),ge+=Be.computedWidth),Ge||(H.push(Be),ie+=Be.computedWidth),oe=Ge),Be.groupByForColumn&&(Be.computedSortType=g.sortType||V.sortType||oh(Be.groupByForColumn,t,P),Me.push(Be)),ne.set(Be.id,Be),Be.field&&!Be.groupByForColumn&&!tt.has(Be.field)&&tt.set(Be.field,Be)}),Me.forEach(g=>{g.computedSortable=fs(g,{fieldsToColumn:tt,userColumns:t,columnTypes:P,sortable:m,columnDefaultSortable:A})});let Ze=new Map;de.forEach(g=>{let v=ne.get(g);v&&Ze.set(g,v)}),ne.forEach(g=>{Ze.has(g.id)||Ze.set(g.id,g)});let ct=s!=null?Math.min(s,he):he,gt=c!=null?Math.min(c,ge):ge;return{computedRemainingSpace:e.width-(ee+xe+Se),computedPinnedStartColumnsWidth:he,computedPinnedEndColumnsWidth:ge,computedUnpinnedColumnsWidth:ie,computedColumnOrder:B,computedPinnedStartColumns:ue,computedPinnedEndColumns:Q,computedUnpinnedOffset:he,computedPinnedEndOffset:he+ie,computedUnpinnedColumns:H,computedVisibleColumns:q,computedColumnsMap:ne,computedColumnsMapInInitialOrder:Ze,computedVisibleColumnsMap:X,computedPinnedEndWidth:gt,computedPinnedStartWidth:ct,renderSelectionCheckBox:q.reduce((g,v)=>g||!!v.renderSelectionCheckBox,!1),fieldsToColumn:tt}};function fs(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??ko,d=o.sortType??o.colType.sortType;return d!=null&&d!==Ot&&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 w=n.get(C),S=w?m.getColumnApi(w.id):void 0;if(w&&S)b=S.isSortable();else{let T=tn(r,C);if(T){let I=gr(T,{colType:gn(T,a??{}),sortable:e,columnDefaultSortable:i});b=typeof I=="boolean"?I:void 0}else b=!1}}return b===void 0&&y.valueGetter&&(b=!0),b??i??ko},!0)}}function Je(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 Jn(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=Je(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 Ne="Infinite",Le={rootClassName:Ne};var Lo=`${Ne}HeaderCell__filter`,yr=`${Ne}HeaderCell__filterOperator`,ps=`${Lo}__input`;import{computed as on,defineComponent as $h,h as Ue,inject as Uh,provide as qh,ref as wu,shallowRef as Yh,Teleport as Zh}from"vue";function U(o){return o.slice(4,-1)}function zo(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(" ")}import{nextTick as Ph}from"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 ms(o,t){let e=Math.atan2(o.top-t.top,o.left-t.left);return e<=0&&(e=2*Math.PI+e),e}function hs(o,t){return Math.sqrt((t.top-o.top)**2+(t.left-o.left)**2)}function ih(o,t,e){let n=ms(o,e),i=ms(t,e);return n===i?hs(e,t)-hs(e,o):n-i}function gs(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)=>ih(n,i,e)),t}function rh(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 ah(o,t){if(o.length<2)return o[0]?o[0].left===t.left&&o[0].top===t.top:!1;o=gs(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 ys(o,t){if(rh(o))return ah(o,t);o=gs(o);let[e]=o;for(let n=1,i=o.length-1;n<i;n++){let r=o[n],a=o[n+1];if(lh([e,r,a],t))return!0}return!1}function lh(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 yn=class{containsPoint(t){return ys(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 bn=class o extends yn{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 sh(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 Ae({top:n,left:e,width:a-e,height:d-n})}var Ae=class o extends yn{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=sh(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 bn(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 Cn(o){if(!o)return!1;let t=o.tagName;return t==="INPUT"||t==="BUTTON"}var bs="_1yeub2v0 _16lm1iw1 _16lm1iw1p _16lm1iw2f _16lm1iw0",Cs="_1yeub2vs",Ts="_1yeub2vr",Ss=we({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 br="_1yeub2vp";var tv=we({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 Cr=`${Ne}Body`,ws=o=>o.querySelector(`.${Cr}`);var nn=`${Ne}HeaderCell`,Tr=`${Ne}HeaderWrapper`,vs=o=>Array.from(o.querySelectorAll(`.${Tr}`));function Tn(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 Rs(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 Ie={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)"}}},Is="column-header-height";var xs=`.${Le.rootClassName}`;function Sr(o){return Tn(o,xs)}var Ps=U(j.scrollLeft),uh=U(j.scrollTop),dh=U(j.columnWidthAtIndex),wr=U(j.columnOffsetAtIndex),Ds=U(j.columnReorderEffectDurationAtIndex),ch=U(j.columnOffsetAtIndexWhileReordering),fh=U(j.columnVisibilityAtIndex),ph=U(j.columnZIndexAtIndex);function St(o,t,e){let n=e?Sr(e):document.querySelector(xs);mh(o,t,n)}function mh(o,t,e){if(e){let n=o,i=j[n]?U(j[n]):o;e.style.setProperty(i,`${t}`)}}function Sn(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 vr(o,t,e){St(`${wr}-${o.computedVisibleIndex}`,o.computedPinned?`calc( ${o.computedAbsoluteOffset+t}px + var(${Ps}))`:`${o.computedAbsoluteOffset+t}px`,e)}function Rr(o,t,e){St(`${ph}-${o}`,`${t}`,e)}function Qn(o,t,e){St(`${ch}-${o}`,typeof t=="number"?`calc( var(${wr}-${o}) + ${t}px )`:t,e)}function eo(o,t,e){St(`${fh}-${o}`,t,e)}function Vo(o,t,e){St(`${Ds}-${o}`,e??"",t)}function Ir(o,t){let e=`${Ds}-${o}`;St(e,Ie.components.Cell.reorderEffectDuration,t)}var Ce={columnWidths:{get(o){return`var(${this.getVarName(o)})`},getVarName(o){return this.varName.get(o)},varName:{get(o){return`${dh}-${o}`}},set(o,t,e){t=typeof t=="number"?t+"px":t,St(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`${wr}-${o}`}},set(o,t,e){t=typeof t=="number"?t+"px":t,St(this.varName.get(o),t,e)}}};function As(o,t){Sn({[Ps]:`${o.scrollLeft}px`,[uh]:`${o.scrollTop}px`},t)}var to={bodyWidth:{name:U(Ie.runtime.bodyWidth),value:""},totalVisibleColumnsWidthValue:{name:U(Ie.runtime.totalVisibleColumnsWidthValue),value:""},totalVisibleColumnsWidthVar:{name:U(Ie.runtime.totalVisibleColumnsWidthVar),value:""},visibleColumnsCount:{name:U(Ie.runtime.visibleColumnsCount),value:""},browserScrollbarWidth:{name:U(Ie.runtime.browserScrollbarWidth),value:""}},hh=U(j.scrollbarWidthHorizontal),_s=U(j.scrollbarWidthVertical),gh=U(j.columnWidthAtIndex),yh=U(j.columnZIndexAtIndex),Es=U(j.scrollLeft),bh=U(j.activeCellColWidth),Ms=U(j.activeCellColOffset),ks=U(j.baseZIndexForCells),Ch=U(j.pinnedStartWidth),Fs=U(j.bodyWidth),Th=U(j.bodyHeight),Ns=U(j.pinnedEndOffset),Os=U(j.pinnedEndWidth),Sh=U(j.computedVisibleColumnsCount);function xr(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(${ks}) `+(e<0?"-":"+")+` ${Math.abs(e)} )`:"auto"}function Ls(o){let{computedVisibleColumns:t,computedPinnedStartColumns:e,computedPinnedEndColumns:n,computedPinnedStartColumnsWidth:i,computedPinnedEndColumnsWidth:r,computedUnpinnedColumnsWidth:a,bodySize:l,activeCellIndex:u,brain:d,scrollbars:s}=o,c=Tt(),f=[],m=t.reduce((p,h)=>{let y=h.computedVisibleIndex;p[Ce.columnWidths.varName.get(y)]=h.computedWidth+"px",p[Ce.columnOffsets.varName.get(y)]=h.computedPinned==="start"?`calc( ${h.computedOffset}px + var(${Es}) )`:h.computedPinned==="end"?`calc( var(${Ns}) ${f.length?"+":""} ${f.map(b=>Ce.columnWidths.get(b.computedVisibleIndex)).join(" + ")} + var(${Es}) )`:`${h.computedOffset}px`;let C=xr(h,{pinnedStartColsCount:e.length,visibleColsCount:t.length});return p[`${yh}-${y}`]=`${C}`,h.computedPinned==="end"&&f.push(h),p},{});if(l.width&&(m[to.browserScrollbarWidth.name]=`${Tt()}px`),m[to.bodyWidth.name]=`calc(${j.bodyWidth} - ${j.scrollbarWidthVertical})`,m[to.totalVisibleColumnsWidthValue.name]=`${i+r+a}px`,m[to.totalVisibleColumnsWidthVar.name]=`calc(${t.map((p,h)=>`var(${gh}-${h})`).join(" + ")})`,m[to.visibleColumnsCount.name]=t.length,u!=null){m[bh]=Ce.columnWidths.get(u[1]);let p=Ce.columnOffsets.get(u[1]);if(d.isHorizontalLayoutBrain){let h=d.getPageIndexForRow(u[0]);m[Ms]=h?`calc( ${Ie.runtime.totalVisibleColumnsWidthVar} * ${h} + ${p})`:p}else m[Ms]=p}return m[Sh]=t.length,m[hh]=s.horizontal?`${c}px`:"0px",m[_s]=s.vertical?`${c}px`:"0px",m[Ch]="calc( "+e.map(p=>Ce.columnWidths.get(p.computedVisibleIndex)).join(" + ")+")",m[Os]="calc( "+n.map(p=>Ce.columnWidths.get(p.computedVisibleIndex)).join(" + ")+")",m[ks]=t.length*10,m[Ns]=`calc( var(${Fs}) - var(${Os}) - var(${_s}) )`,m[Fs]=`${l.width}px`,m[Th]=`${l.height}px`,m}var no=(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 Pr(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 no(n,s,d)}else{let l=t.indexOf(i),u=t[l+1],d=n.indexOf(u),s=n.indexOf(i);return no(n,s,d)}return t}var Bs=Gn(wn());function Go(o){return o.map(t=>t instanceof Ut?t:new Ut(null,[t]))}var Ut=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=>wh(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 wh(o,t){return typeof o=="string"||typeof o=="number"?`${o}`:t?o.__get(t):o.done()}var vh=(...o)=>new Ut("+",Go(o)),Vs=(...o)=>new Ut("-",Go(o)),Rh=(...o)=>new Ut("*",Go(o)),Ih=(...o)=>new Ut("/",Go(o)),oo={add:vh,subtract:Vs,minus:Vs,multiply:Rh,divide:Ih};var Gs=o=>{let t=null,e=null;return{stop(){t!==null&&Qt(t),e!=null&&Qt(e)},scroll(n){t!==null&&Qt(t),e!=null&&Qt(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 Ks=10,xh=U(j.pinnedStartWidth);function Hs(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 w(H){let q=H==="start"?z:K;return M===O?q:O===H?q+P.computedWidth:M===H?q-P.computedWidth:q}function S(H){if(H.columnIndex===D||C!=null)return!0;let q=t[H.columnIndex];if(q.computedPinned)return!0;let X=l.getScrollPosition().scrollLeft,ne=q.computedOffset+(C!=null&&b!=null?b*C:0);return ne>=X+w("start")&&ne+q.computedWidth<=X+s.width-w("end")}let T=(H,q)=>{let{restrictToParentGroup:X,dragColumn:ne}=q,ie=[];if(H.forEach(ge=>{if(ge.computedVisibleIndex===D)return;let oe={columnId:ge.id,columnIndex:ge.computedVisibleIndex,offsetX:ge.computedOffset+Math.round(ge.computedWidth/2)};S(oe)&&ie.push(oe)}),X){let oe=function(ee,Se,xe){let be=H[ee];be&&(be.columnGroup!==ne.columnGroup&&xe.add(be.id),oe(ee+Se,Se,xe))};var he=oe;let ge=ne.computedVisibleIndex,$=new Set;oe(ge-1,-1,$),oe(ge+1,1,$),ie=ie.filter(ee=>!$.has(ee.columnId))}return ie},x=i.length,F={clientX:Math.round(o.initialMousePosition.clientX),clientY:Math.round(o.initialMousePosition.clientY)},N={left:F.clientX-s.left-(F.clientX-u.left)+Ks,top:F.clientY-s.top-(F.clientY-u.top)+Ks},R=l.getScrollPosition(),A=t.map(H=>H.computedVisibleIndex),E=A,P=e.get(r),D=P.computedVisibleIndex,M=P?.computedPinned,_=D,O=M,z=l.getFixedStartColsWidth(),K=l.getFixedEndColsWidth(),B=F,G={x:0,y:0},le=1,Z=0;function De(H){let q=Math.round(H.clientX),X=Math.round(H.clientY);if(q===B.clientX&&X===B.clientY)return Ae.from(u).shift({left:G.x,top:G.y});B={clientX:q,clientY:X};let ie=l.getScrollPosition().scrollLeft-R.scrollLeft;return G.x=B.clientX-F.clientX,G.y=B.clientY-F.clientY,Z=G.x+ie,le=Z<0?-1:1,m({left:N.left+G.x,top:N.top+G.y}),Ae.from(u).shift({left:G.x,top:G.y})}function me(H){let q=0;M?M==="start"&&H.forEach((X,ne)=>{q||t[X]?.computedPinned!=="start"&&(q=ne)}):H.forEach((X,ne)=>{t[X]?.computedPinned==="start"&&(q=ne+1)}),x=q,ve("start",H,q)}function ve(H,q,X){if(H==="start"){let ne=0;for(let ie=0;ie<X;ie++){let he=q[ie],ge=t[he];ne+=ge.computedWidth}St(xh,`${ne}px`,a)}}function Oe(H){if(H==null||H===_)return;if(_===-1&&H!==-1&&(eo(D,"",a),p(!1)),_=H,H===-1){Ee(D);return}let q=no(A,D,_>D?_-1:_);x=0;let ne=new Set;return q.forEach((ie,he)=>{let ge=E[he];ie!==ge&&ne.add(ie),me(q)}),E=q,Te(ne),{newColumnIndexes:q,indexesWithTransition:ne,pinnedStartCount:x}}function Ee(H){E=E.filter(X=>X!==H),t.forEach(X=>{let ne=X.computedVisibleIndex,ie=ne>H;Ir(ne,a);let he="";ie&&(he=oo.minus(Ce.columnOffsets.get(ne),Ce.columnWidths.get(H)).done()),Qn(ne,he,a)}),eo(H,"hidden",a),p(!0)}function Te(H){t.forEach(q=>{let X=q.computedVisibleIndex;H.has(X)?Ir(X,a):Vo(X,a);let ne=X===D,ie=le===-1?X<_||X>D:X<D||X>=_,he="";le===-1?he=ne?Ce.columnOffsets.get(_):ie?Ce.columnOffsets.get(X):oo.add(Ce.columnOffsets.get(X),Ce.columnWidths.get(D)).done():he=ie?Ce.columnOffsets.get(X):ne?oo.add(Ce.columnOffsets.get(_-1),Ce.columnWidths.get(_-1)).minus(Ce.columnWidths.get(D)).done():oo.minus(Ce.columnOffsets.get(X),Ce.columnWidths.get(D)).done(),Qn(X,he,a)})}let _e=s.left+w("start"),ue=s.right-w("end"),Q=Gs({scrollOffsetStart:_e,scrollOffsetEnd:ue});return De(F),{speedScroller:Q,stop(){Q.stop()},onMove(H){let q=De(H);if(h().dropTargetListId==="grouping-toolbar"||f&&!c.containsPoint(q.getCenter()))return f&&Oe(-1),null;Q.scroll({mousePosition:B,get scrollLeft(){return l.getScrollPosition().scrollLeft},set scrollLeft(oe){y.scrollLeft=oe}});let X=T(t,{dragColumn:P,restrictToParentGroup:d==="group"}),ne=le===-1?P.computedOffset+Z:P.computedOffset+P.computedWidth+Z,ie=(0,Bs.default)(X,ne,({offsetX:oe},$)=>oe<$?-1:oe>$?1:0);ie<0&&(ie=~ie),X.length?ie=X[ie]?X[ie].columnIndex:X[X.length-1].columnIndex+1:(t.length>1&&console.error("No breakpoints available, something is wrong!"),ie=0),ie===D+1&&(ie=D),Oe(ie);let he={};n.forEach(oe=>{he[oe.id]="end"});for(let oe=0;oe<x;oe++){let $=E[oe],ee=t[$];he[ee.id]="start"}let ge=E.map(oe=>t[oe].id);return{columnPinning:he,columnOrder:ge}}}}var Dh=U(j.baseZIndexForCells),Ah=(o,t)=>{let e=!o||Object.keys(o).length===0,n=!t||Object.keys(t).length===0;return e&&n?!0:!!o!=!!t?!1:jt(o,t)},_h=()=>({dragSourceListId:null,dropTargetListId:null,dragItemId:"",status:"accepted"});function Ws(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&&Cn(p.target))return;let h=i(),y=u().domRef,{brain:C,draggableColumnsRestrictTo:b}=u(),{computedVisibleColumns:w,computedVisibleColumnsMap:S,computedPinnedStartColumns:T,computedUnpinnedColumns:I,computedPinnedEndColumns:x}=d(),F=S.get(t);if(!F||!F.computedDraggable){f(p);return}let N=n.current,R=N.getBoundingClientRect(),A=y.current.getBoundingClientRect(),E=C.getAvailableSize(),P=F.computedVisibleIndex,D=C.getVirtualColIndex(F.computedVisibleIndex,{pageIndex:h||0}),M=C.isHorizontalLayoutBrain?C.getPageWidth():null,_=N.style.cursor??"auto",O=!1,z=y.current,K=Ae.from(ws(z).getBoundingClientRect()),B=vs(z).map(Te=>Ae.from(Te.getBoundingClientRect())),G=K.getMinimumBoundingRectangle(...B),le=Hs({brain:C,horizontalLayoutPageIndex:h,allowColumnHideOnDrag:r,pageWidth:M,draggableColumnsRestrictTo:b,computedPinnedEndColumns:x,computedPinnedStartColumns:T,computedUnpinnedColumns:I,computedVisibleColumns:w,computedVisibleColumnsMap:S,dragColumnHeaderTargetRect:R,dragColumnId:t,getCurrentDragSourceAndTarget:_h,api:c,infiniteDOMNode:y.current,setProxyPosition:Te=>{a.value=Te},setDragColumnOutside:Te=>{l.value=Te},tableRect:A,acceptDropToReorderRect:G,initialMousePosition:{clientX:p.clientX,clientY:p.clientY}}),Z=null,De,me;function ve(Te){let{columnPinning:_e,columnOrder:ue}=Te;Ah(u().columnPinning,_e)||(s.columnPinning=_e);let Q=d().computedColumnOrder;s.columnOrder=Pr({newColumnOrder:ue,visibleColumnOrder:d().computedVisibleColumns.map(H=>H.id),existingColumnOrder:Q,dragColumnId:t})}let Oe=Te=>{let{headerBrain:_e,brain:ue}=u();if(!O){O=!0;let Q=ue.keepColumnRendered(D),H=_e.keepColumnRendered(D);if(ue.isHorizontalLayoutBrain){let X=ue.extendRenderRange({start:!0,end:!0,direction:"horizontal"}),ne=_e.extendRenderRange({start:!0,end:!0,direction:"horizontal"});me=()=>{X(),ne()}}De=()=>{Q(),H()},s.columnReorderDragColumnId=F.id,h!=null&&(s.columnReorderInPageIndex=h),Rr(P,`calc( var(${Dh}) + 10000 )`,y.current),y.current?.classList.add(br),N.style.cursor="grabbing"}Z=le.onMove(Te)},Ee=Te=>{let _e=Te.pointerId;requestAnimationFrame(async()=>{let{multiSortBehavior:ue}=u(),Q=y.current;Q?.classList.remove(br),le.stop(),C.update({...E}),De?.(),me?.(),N.style.cursor=_,N.hasPointerCapture?.(_e)&&N.releasePointerCapture(_e),N.removeEventListener("pointermove",Oe),N.removeEventListener("pointerup",Ee),a.value=null;let H=c.getColumnApi(F.id)?.isSortable()??!1;!O&&H&&c.toggleSortingForColumn(F.id,{multiSortBehavior:ue==="replace"&&(Te.ctrlKey||Te.metaKey)?"append":ue}),Z?ve(Z):O&&r&&c.setVisibilityForColumn(F.id,!1),s.columnReorderDragColumnId=!1,h!=null&&(s.columnReorderInPageIndex=null),await Ph(),w.forEach(q=>{Vo(q.computedVisibleIndex,Q),eo(q.computedVisibleIndex,"",Q),Qn(q.computedVisibleIndex,"",Q)}),Rr(P,xr(F,{pinnedStartColsCount:T.length,visibleColsCount:w.length}),Q)})};N.addEventListener("pointermove",Oe),N.addEventListener("pointerup",Ee),N.setPointerCapture(p.pointerId)};return{onPointerDown:p=>{d().computedVisibleColumnsMap.get(t)?.computedDraggable?m(p):p.target&&Cn(p.target)||f(p)}}}import{defineComponent as Eh,h as Ko}from"vue";var ot={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 js=Eh({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 Ko("svg",{viewBox:o.viewBox,class:o.className,style:e},o.paths.map(n=>Ko("path",{d:n})))}}});function ft(o,t){let e=n=>Ko(js,{...n,paths:t});return e.displayName=o,e}var $s=ft("IncludesOperatorIcon",ot.includesOperator),Us=ft("StartsWithOperatorIcon",ot.startsWithOperator),qs=ft("EndsWithOperatorIcon",ot.endsWithOperator),Ys=ft("EqualOperatorIcon",ot.eqOperator),Zs=ft("NotEqualOperatorIcon",ot.neqOperator),Xs=ft("GTOperatorIcon",ot.gtOperator),Js=ft("GTEOperatorIcon",ot.gteOperator),Qs=ft("LTOperatorIcon",ot.ltOperator),eu=ft("LTEOperatorIcon",ot.lteOperator),tu=ft("DoneIcon",ot.done),nu=ft("ClearIcon",ot.clear),Dr=o=>Ko(js,{...o,viewBox:"0 -960 960 960",paths:ot.hidden});Dr.displayName="HiddenIcon";var Bo="_1eexc2a7 _1eexc2a6",ou=we({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"]]}),iu=we({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 ru="_1eexc2a5",Ho=we({defaultClassName:"_1eexc2aa",variantClassNames:{direction:{up:"_1eexc2ab",down:"_1eexc2ac",neutral:"_1eexc2ad"}},defaultVariants:{},compoundVariants:[]}),vn="_1eexc2a8";import{defineComponent as Mh,h as Fh,onMounted as Nh,ref as lu,watch as Oh}from"vue";var au="qz8ht90 _16lm1iwk";var qt=Mh({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=lu(e===void 0?!1:e),i=lu(null),r=()=>{i.value&&(i.value.indeterminate=n.value==null)};Nh(r),Oh(()=>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 Fh("input",{...l,class:te("InfiniteCheckBox",au,l.class),type:"checkbox",ref:i,checked:!!n.value,disabled:o.disabled,onChange:a})}}});import{defineComponent as kh,h as Wo}from"vue";function su(o){let t={};return Object.keys(o).forEach(e=>{t[e]=e}),t}var uu=su({"data-name":""}),Ar={[uu["data-name"]]:"menu-icon"},du=`[${uu["data-name"]}="${Ar["data-name"]}"]`;var Lh={width:"100%",pointerEvents:"none"},_r=`${nt}-menu`,io=kh({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={...Lh,borderTop:`${Ie.components.HeaderCell.menuIconLineWidth} solid currentColor`,...o.lineStyle},n=t.default?t.default():[Wo("div",{class:_r,style:e}),Wo("div",{class:_r,style:e}),Wo("div",{class:_r,style:e})];return Wo("div",{...o.domProps,style:o.style,...Ar,onPointerdown:i=>{i.stopPropagation(),o.domProps?.onPointerdown?.(i)},class:te(o.className,ql({menuVisible:o.menuVisible,reserveSpaceWhenHidden:o.reserveSpaceWhenHidden}),nt,`${nt}-menu`)},n)}}});import{defineComponent as zh,h as ro,ref as mu,watch as Vh,onBeforeUnmount as Gh}from"vue";var cu="_1b8djff0 _16lm1iw1p _16lm1iw2f _16lm1iw1 _16lm1iw32";var fu={transition:"width 0.25s, opacity 0.25s"},pu=Object.keys({direction:1,size:1,lineWidth:1,lineStyle:1,style:1,className:1,index:1,forceSize:1});var hu=zh(o=>{let t=mu(!0),e=mu(0),n=null;Vh(()=>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}),Gh(()=>{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={...fu,borderTop:`${a}px solid currentColor`,...o.lineStyle,opacity:e.value},p={};return r===-1&&(p.top="100%"),ro("div",{"data-name":"sort-icon",style:{...o.style,width:`${s}px`},class:te(l,nt,cu,`${nt}-sort`)},[d?ro("div",{"data-name":"index",style:p,class:Xl},`${u}`):null,ro("div",{style:{width:`${f[0]}px`,...m},onTransitionend:i}),ro("div",{style:{width:`${f[1]}px`,...m}}),ro("div",{style:{width:`${f[2]}px`,...m}})])}},{name:"SortIcon",props:[...pu]});var{rootClassName:gu}=Le,wt=`${gu}Cell`,jo=`${gu}Cell_content`;function Er(o){return Math.max(o.width-Tt(),0)}function yu(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 pr({shareSpaceOnResize:i,availableSize:Er(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}))})}import{defineComponent as Bh,h as Tu,ref as Hh}from"vue";function bu(o,{columns:t,shareSpaceOnResize:e,domRef:n}){let i=t[o];return{resize(r){Ce.columnWidths.set(o,i.computedWidth+r,n.current);let a=o+1;if(e){let l=t[a];if(!l)return;Ce.columnWidths.set(a,l.computedWidth-r,n.current),l.computedPinned==="start"?vr(l,r,n.current):Ce.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"){vr(d,r,n.current);continue}d.computedPinned!=="end"&&Ce.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||Ce.columnOffsets.set(l,d.computedOffset+r,n.current)}}}}}function Cu(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;Ce.columnWidths.set(f,p,d),m.computedPinned!=="end"&&(l&&Ce.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"&&Ce.columnOffsets.set(s,c.computedOffset+u,d)}}}}var $o="zneyzh0 _16lm1iw2 _16lm1iw23 _16lm1iw2c _16lm1iw2a _16lm1iwm _16lm1iw35",Uo=we({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"]]}),qo=we({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"]]});import{inject as Kh}from"vue";var ao=Symbol("InfiniteTable");function He(){return Kh(ao)}var{rootClassName:Wh}=Le,jh=`${Wh}HeaderCell_ResizeHandle`,Su=Bh({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=He(),{getState:e}=t,n={current:null},i=Hh(!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"}),I=c.extendRenderRange({start:!0,end:!0,direction:"horizontal"});y=()=>{T(),I()}}h.setPointerCapture(m);let C=bu(o.columnIndex,{columns:o.columns,shareSpaceOnResize:f,domRef:n}),b=(T,{done:I}={})=>{d&&(T=T/(d+1),I&&(T=Math.round(T))),u==="end"&&(T*=-1);let{adjustedDiff:x,constrained:F}=o.computeResize({diff:T,shareSpaceOnResize:f});return i.value!==F&&(i.value=F),C.resize(x),x},w=T=>{b(Math.round(T.clientX-p))},S=T=>{h.releasePointerCapture(m),h.removeEventListener("pointermove",w),h.removeEventListener("pointerup",S);let I=Math.round(T.clientX-p),x=b(I,{done:!0});y(),C.resize(0),o.onResize({diff:x,shareSpaceOnResize:f})};h.addEventListener("pointermove",w),h.addEventListener("pointerup",S)};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 Tu("div",{ref:c=>{n.current=c??null},class:`${jh} ${$o} ${qo({computedPinned:l,computedFirstInCategory:u,computedLastInCategory:d})}`,onPointerdown:r},[Tu("div",{style:s,class:Uo({constrained:i.value,computedPinned:l,computedFirstInCategory:u,computedLastInCategory:d})})])}}});var Xh=U(j.columnWidthAtIndex),Jh=U(j.columnReorderEffectDurationAtIndex),Qh=U(j.columnZIndexAtIndex),eg=U(j.columnVisibilityAtIndex),vu=Symbol("InfiniteHeaderCell");function Yo(){return Uh(vu)}var tg=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||qt;return Ue(u,{domProps:{class:vn},onChange:d=>{if(l){d?i.treeApi.selectAll():i.treeApi.deselectAll();return}d?n.rowSelectionApi.selectAll():n.rowSelectionApi.deselectAll()},checked:r})};function rn(o,t){return o(t)}var Mr=()=>Ue("div",{class:Rl[1]}),Ru=$h({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=He(),{api:e,actions:n,getState:i,getComputed:r,dataSourceContext:a}=t,{getDataSourceState:l,dataSourceApi:u,dataSourceActions:d}=a,s={current:null},c=R=>{let A=R&&R.$el!==void 0?R.$el:R;s.current=A??null,o.domRef(s.current)},f=Yh(null);qh(vu,f);let m=()=>Je(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 R=o.column.id,A=l().filterDelay,E=`${R}:${A}`;if(!p||p.key!==E){let P=D=>{e.setColumnFilter(R,D)};p={key:E,fn:A>0?Jt(P,{wait:A}):P}}return p.fn},y=wu(null),C=wu(!1),{onPointerDown:b}=Ws({columnId:o.column.id,context:{getState:i,getComputed:r,actions:n,api:e},domRef:s,getHorizontalLayoutPageIndex:()=>o.horizontalLayoutPageIndex,allowColumnHideOnDrag:!0,proxyPosition:y,dragColumnOutside:C}),w=on(()=>t.state.value.columnMenuVisibleForColumnId),S=on(()=>t.state.value.columnReorderDragColumnId),T=on(()=>t.state.value.columnReorderInPageIndex),I=on(()=>t.state.value.showColumnFilters),x=on(()=>t.state.value.columnHeaderHeight),F=on(()=>t.state.value.components),N=on(()=>a.state.value.filterTypes);return()=>{let{column:R,columnsMap:A,horizontalLayoutPageIndex:E,headerOptions:P}=o,{allRowsSelected:D,someRowsSelected:M,selectionMode:_}=o,O=R.computedSortInfo,z=R.header,K=m(),B=K.isSortable(),G=P.alwaysReserveSpaceForSortIcon,le=R.headerAlign??R.align,Z=(typeof le=="function"?le({isHeader:!0,column:R}):le)??"start",De=(typeof R.verticalAlign=="function"?R.verticalAlign({isHeader:!0,column:R}):R.verticalAlign)??"center",me=B&&(R.computedSorted||G)?Ue(hu,{index:R.computedMultiSort?R.computedSortIndex+1:void 0,style:{marginInlineStart:Ie.spacing[2],marginInlineEnd:Ie.spacing[2]},className:`${nn}__sort-icon ${Zl} ${Jl({align:Z})}`,direction:R.computedSorted?R.computedSortedAsc?1:-1:0}):null,Oe=R.computedFilterable&&R.computedFiltered?Ue(hn):null,Ee=R.headerCssEllipsis??R.cssEllipsis??!0,Te=w.value,_e=S.value,ue=T.value,Q=_e===R.id,H=ue!=null?E!==ue:!1,q={reserveSpaceWhenHidden:Z==="center",menuVisible:Te===R.id,style:Z==="end"?{marginInlineStart:`calc(${Ie.components.HeaderCell.resizeHandleActiveAreaWidth} / 2)`,marginInlineEnd:Ie.spacing[2]}:{marginInlineEnd:`calc(${Ie.components.HeaderCell.resizeHandleActiveAreaWidth} / 2)`,marginInlineStart:Ie.spacing[2]},domProps:{onMousedown:re=>{re.stopPropagation(),K.toggleContextMenu(re.target)}}},X=R.components?.MenuIcon||F.value?.MenuIcon||io,ne=Ue(X,q),ie=I.value,he=N.value,ge=R.computedFilterType,oe=he[ge],$=R.computedFilterable?R.computedFilterValue?.filter.operator??oe?.defaultOperator:void 0,ee=R.computedFilterable&&oe?oe.operators.find(re=>re.name===$):void 0,Se=ee?.components?.FilterEditor||oe?.components?.FilterEditor||R.components?.FilterEditor||lo,xe=oe?.components?.FilterOperatorSwitch||R.components?.FilterOperatorSwitch||xu,be=R.computedFilterable?Ue(Iu,{filterProps:{horizontalLayoutPageIndex:E,filterEditor:Se,filterOperatorSwitch:xe,operator:ee,filterTypes:he,onChange:h(),columnFilterType:ge,columnLabel:R.field||R.name||R.id,columnFilterValue:R.computedFilterValue,columnHeaderHeight:x.value}}):Ue(Pu),Me={horizontalLayoutPageIndex:E,dragging:Q,domRef:c,htmlElementRef:s,renderLocation:"column-header",column:R,columnsMap:A,columnSortInfo:O,columnFilterValue:R.computedFilterValue,filtered:R.computedFiltered,someRowsSelected:M,allRowsSelected:D,selectionMode:_,api:e,dataSourceApi:u,columnApi:K,renderBag:{sortIcon:me,filterIcon:Oe,menuIcon:ne,menuIconProps:q,selectionCheckBox:null,header:R.header&&typeof R.header!="function"?R.header:R.name}},ze=Me;ze.renderBag.filterEditor=be,f.value=ze;let de={...Me,renderBag:{...Me.renderBag}};if(R.renderSortIcon&&(de.renderBag.sortIcon=rn(R.renderSortIcon,{...de,renderBag:{...de.renderBag}})),R.renderFilterIcon&&(de.renderBag.filterIcon=rn(R.renderFilterIcon,{...de,renderBag:{...de.renderBag}})),typeof R.renderMenuIcon=="function"){let re=rn(R.renderMenuIcon,{...de,renderBag:{...de.renderBag}});de.renderBag.menuIcon=re?re.type===X||re.type===io?re:Ue(X,q,()=>re):null}if(R.renderSelectionCheckBox&&_==="multi-row"){de.renderBag.selectionCheckBox=rn(tg,{...de,renderBag:{...de.renderBag}});let re=R.renderHeaderSelectionCheckBox??R.renderSelectionCheckBox;re&&re!==!0&&(de.renderBag.selectionCheckBox=rn(re,{...de,renderBag:{...de.renderBag}}))}z instanceof Function&&(de.renderBag.header=rn(z,{...de,renderBag:{...de.renderBag}}));let tt=Ee?Ue("div",{class:lt},[de.renderBag.header]):de.renderBag.header,Ze=R.renderMenuIcon===!1?null:de.renderBag.menuIcon,ct=[Z==="center"?Mr():null,de.renderBag.selectionCheckBox,tt,de.renderBag.sortIcon,de.renderBag.filterIcon,Z==="center"?Mr():null,Z!=="center"?Mr():null,Ze],gt=R.renderHeader?rn(R.renderHeader,{...de,renderBag:{...de.renderBag,all:ct}}):ct,Ve={height:`${o.height}px`};R.headerStyle&&(Ve=typeof R.headerStyle=="function"?{...Ve,...R.headerStyle(ze)||{}}:{...Ve,...R.headerStyle});let g=typeof R.headerClassName=="function"?R.headerClassName(ze):R.headerClassName,v=`var(${Qh}-${R.computedVisibleIndex})`;Ve.zIndex=v,Ve.visibility=`var(${eg}-${R.computedVisibleIndex}, visible)`,Ve.width=`var(${Xh}-${R.computedVisibleIndex})`,Ve.transition=`transform var(${Jh}-${R.computedVisibleIndex}, 0s)`;let L={filtered:R.computedFiltered,verticalAlign:De,align:Z},k={"data-field":`${R.field||""}`,"data-column-id":R.id,"data-header-align":Z,"data-name":"HeaderCell","data-sort":R.computedSortedAsc?"asc":R.computedSortedDesc?"desc":"none","data-sort-index":`${R.computedSortIndex??-1}`},Y=te(nn,El.none,B?vl.pointer:"",g,zo(R,[nn,wt],Kl,{dragging:Q,insideDisabledDraggingPage:H,align:Z,verticalAlign:De,rowSelected:!1,cellSelected:!1,rowDisabled:!1,zebra:!1,rowActive:!1,firstRow:!0,firstRowInHorizontalLayoutPage:!0,treeNode:!1,groupCell:!1,groupRow:!1,rowExpanded:!1}),Ll,wt,Bo),V=Ue("div",{class:te(jo,Ee?lt:Mo.hidden,zl(L),xl[Z]),style:ie?{height:`${o.height/2}px`}:void 0},[gt]),J=re=>yu({context:{getState:i,getComputed:r},column:R,diff:re.diff,shareSpaceOnResize:re.shareSpaceOnResize}),ce=R.computedResizable?Ue(Su,{horizontalLayoutPageIndex:E,columns:r().computedVisibleColumns,columnIndex:R.computedVisibleIndex,computeResize:J,onResize:re=>{let{columnSizing:rt,reservedWidth:Et}=J(re);re.shareSpaceOnResize||(n.viewportReservedWidth=Et),n.columnSizing=rt}}):null,se=[ie?be:null,ce],fe={ref:c,...k,"data-z-index":v,style:Ve,class:Y,onPointerdown:b},ae=null,ye=i().portalDOMRef.current;Q&&y.value&&ye&&(ae=Ue(Zh,{to:ye},[Ue("div",{key:R.id,class:`${nn}Proxy ${Vl}`,style:{height:`${o.height}px`,width:`${o.width}px`,left:`${y.value.left??0}px`,top:`${y.value.top??0}px`}},[Ue("div",{class:Gl({visible:C.value})},[Ue(Dr,{size:16})]),de.renderBag.header])]));let Re=R.components?.HeaderCell;return Re?[Ue(Re,fe,{default:()=>[V,se]}),ae]:[Ue("div",fe,[V,se]),ae]}}});var Au=Symbol("InfiniteColumnHeaderFilter"),Zo=o=>o.stopPropagation(),Iu=Fr({name:"InfiniteTableColumnHeaderFilter",props:{filterProps:{type:Object,required:!0}},setup(o){let t=He(),e=Yo(),n=ig(o.filterProps);og(Au,n);let i=Du(!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 Rn("div",{onPointerup:Zo,onPointerdown:Zo,onFocusin:r,onFocusout:a,class:`${Lo} ${dr({active:d})}`,style:{height:`${o.filterProps.columnHeaderHeight}px`}},[Rn(c),Rn(s)])}}}),xu=Fr({name:"InfiniteTableFilterOperatorSwitch",setup(){let o=so();return()=>{let t=o.disabled.value,n=o.operator.value?.components?.Icon??hn;return Rn("div",{"data-name":"filter-operator","data-disabled":t,onMousedown:i=>{i.stopPropagation(),!t&&o.columnApi.toggleFilterOperatorMenu(i.target)},class:te(yr,jl,t?`${yr}--disabled`:"")},[Rn(n,{size:20,className:`${$l({disabled:!!t})}`})])}}}),Pu=Fr({name:"InfiniteTableColumnHeaderFilterEmpty",setup(){return()=>Rn("div",{onPointerup:Zo,onPointerdown:Zo,class:`${Lo} ${dr({active:!1})} ${Il["50%"]}`})}});function so(){let o=He(),t=Yo(),e=ng(Au),{api:n,getComputed:i,getState:r,actions:a,dataSourceContext:l}=o,{getDataSourceState:u,dataSourceApi:d,dataSourceActions:s}=l,c=vt(()=>t.value.column),f=vt(()=>{let{columnFilterType:w,filterTypes:S}=e.value;return S[w]}),m=Du(e.value.columnFilterValue?.filter.value??"");rg(()=>e.value.columnFilterValue?.filter.value,w=>{if(e.value.columnFilterValue)m.value!==w&&(m.value=w);else{let S=f.value;if(S){let T=[...S.emptyValues][0];T!==m.value&&(m.value=T)}}});let p=w=>{m.value=w,e.value.onChange(w)},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=vt(()=>`Filter for ${Jn(c.value,C,"column-filter")}`);return{api:n,column:c,columnFilterValue:vt(()=>e.value.columnFilterValue),columnApi:t.value.columnApi,operator:vt(()=>e.value.operator),operatorName:vt(()=>e.value.operator?.name),value:m,disabled:vt(()=>e.value.columnFilterValue?.disabled),filterType:f,filterTypes:vt(()=>e.value.filterTypes),filterTypeKey:vt(()=>e.value.columnFilterType),filtered:vt(()=>c.value.computedFiltered),setValue:p,clearValue:h,removeColumnFilter:y,ariaLabel:b,className:`${Hl} ${ps}`}}var lo=_u({name:"StringFilterEditor",setup(){let o=so();return()=>Eu("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})}}),Nr=_u({name:"NumberFilterEditor",setup(){let o=so();return()=>Eu("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 Rt=(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",...Rt(n,"includes"),label:"Includes",fn:({currentValue:i,filterValue:r})=>typeof i=="string"&&typeof r=="string"&&i.toLowerCase().includes(r.toLowerCase())},{label:"Equals",...Rt(n,"eq"),name:"eq",fn:({currentValue:i,filterValue:r})=>typeof i=="string"&&i===r},{name:"startsWith",...Rt(n,"startsWith"),label:"Starts With",fn:({currentValue:i,filterValue:r})=>i.startsWith(r)},{name:"endsWith",...Rt(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",...Rt(n,"eq"),name:"eq",fn:({currentValue:i,filterValue:r})=>i==r},{label:"Not Equals",...Rt(n,"neq"),name:"neq",fn:({currentValue:i,filterValue:r})=>i!=r},{name:"gt",label:"Greater Than",...Rt(n,"gt"),fn:({currentValue:i,filterValue:r,emptyValues:a})=>a.includes(i)?!0:i>r},{name:"gte",...Rt(n,"gte"),label:"Greater Than or Equal",fn:({currentValue:i,filterValue:r,emptyValues:a})=>a.includes(i)?!0:i>=r},{name:"lt",...Rt(n,"lt"),label:"Less Than",fn:({currentValue:i,filterValue:r,emptyValues:a})=>a.includes(i)?!0:i<r},{name:"lte",...Rt(n,"lte"),label:"Less Than or Equal",fn:({currentValue:i,filterValue:r,emptyValues:a})=>a.includes(i)?!0:i<=r}]}}}var Xn=Mu({StringFilterEditor:lo,NumberFilterEditor:Nr,icons:{includes:$s,eq:Ys,neq:Zs,startsWith:Us,endsWith:qs,gt:Xs,gte:Js,lt:Qs,lte:eu}});var Xo=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 W(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 W(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 pt=class extends Xo{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 Jo=class{constructor(){this.primaryKeyToData=new Map;this.nodePathsToData=new W;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,w=b?n?.getMutationsForNodePath(C):n?.getMutationsForPrimaryKey(y);if(w&&w.length){for(let S=0,T=w.length;S<T;S++){let I=w[S];if(I.type==="delete"&&!h&&(b?this.removeNodePath(C,e):this.remove(y),h=!0,c.splice(m,1),m--),I.type==="update"&&!h&&(p={...p,...I.data},c[m]=p),I.type==="update-children"&&!h){let x=I.children(p[l],p);p={...p},x!==void 0?p[l]=x:delete p[l],c[m]=p}I.type==="insert"&&(I.position==="before"?(c.splice(m,0,I.data),m--):c.splice(m+1,0,I.data))}b?n?.removeNodePathInfo(C):n?.removeInfo(y)}if(!h)if(b){this.addNodePath(C,p);let S=a(p),T=S?null:r(p);!S&&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 Qo(o,t){return o&&o.filter(e=>{let n=t[e.filter.type];return!(!n||n.emptyValues&&n.emptyValues.includes(e.filter.value))})}var Fu=new WeakMap;function ei(o,t){if(!o||!o.length)return[];let e=Fu.get(o);e||(e=new WeakMap,Fu.set(o,e));let n=e.get(t);if(n)return n;let i=[],r=Qo(o,t)||[];for(let a=0,l=r.length;a<l;a++){let u=r[a],d=t[u.filter.type];if(u.disabled||!d)continue;let s;for(let c=0;c<d.operators.length;c++){let f=d.operators[c];f.name===u.filter.operator&&(s=f.fn)}s&&i.push({field:u.field,valueGetter:u.valueGetter||d.valueGetter,fn:s,value:u.filter.value,emptyValues:d.emptyValues})}return e.set(t,i),i}function Or(o,t){if(!o.length)return!0;let{data:e}=t,n={data:e,index:t.index,dataArray:t.dataArray,primaryKey:t.primaryKey,field:void 0,filterValue:void 0,currentValue:void 0,emptyValues:[]};for(let i=0,r=o.length;i<r;i++){let a=o[i];if(n.field=a.field,n.filterValue=a.value,n.currentValue=a.valueGetter?a.valueGetter(n):a.field?e[a.field]:e,n.emptyValues=a.emptyValues,!a.fn(n))return!1}return!0}var ag=0;function Nu(o){return ag++,Or(ei(o.filterValue,o.filterTypes),o)}function kr(o){return ei(o.filterValue,o.filterTypes).length?o.isLeafNode?Nu(o):o.filterTreeNode(o.data):!0}var lg="group-by",Ou="group-by-";function ku(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 ti(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===lg){let r=ku(t);return r==null?i:(e=!0,{...i,field:r})}if(i.id.startsWith(Ou)){let r=i.id.slice(Ou.length),a=t.find(u=>String(u.field)===r||u.groupField===r);if(!a)return i;let l=ku([a]);return l==null?i:(e=!0,{...i,field:l})}return i});return e?n:o}function It(){let o=Fe().performance?.now();return`${Date.now()}:${o}`}var Lu=!0,sg={originalDataArray:!0,changes:!0},ug={filterValue:(o,t)=>JSON.stringify(o)===JSON.stringify(t),groupRowsState:(o,t)=>JSON.stringify(o)===JSON.stringify(t)};function xt(o,t,e){let n=ti(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=[],o.selectionMode==="multi-row"&&(r.multiRowSelectionTarget=o.multiRowSelectionTarget)),t&&Object.assign(r,t),r.filterValue&&r.filterValue.length){let u=Vu(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)&&!sg[u]){let d=u,s=ug[d],c=r[d],f=l[d];(s?s(c,f):c===f)||(a[d]=!0)}return r.changes=a,r}function In(o,t,e,n,i){let r=xt(t,n,i),a=r.append;if(t.lazyLoad){let s=t.originalLazyGroupData,c=[at,...r.groupKeys||[]],f=s.get(c);if(!f){let m=[...r.groupKeys||[],r.lazyLoadStartIndex??0];t.lazyLoadCacheOfLoadedBatches.set(m,!0)}if(f&&f.cache&&c.length>1){let m=f.children,p=m.length,h=!0;for(let y=0;y<p;y++)if(m[y]==null){h=!1;break}if(h)return Promise.resolve(!0)}f?f.childrenLoading||(f.childrenLoading=!0):s.set(c,{error:void 0,children:[],childrenLoading:!0,childrenAvailable:!1,cache:Lu,totalCount:0}),e.originalLazyGroupDataChangeDetect=It()}if(typeof o=="function")try{o=o(r)}catch(s){o=Promise.reject(s)}let u=typeof o=="object"&&typeof o.then=="function"&&(!t.lazyLoad||t.lazyLoad&&!a);u&&(e.loading=!0);let d=s=>{if(console.error('The DataSource "data" function failed:',s),t.lazyLoad){let c=r.groupKeys||[],f=t.originalLazyGroupData.get([at,...c]),m=s instanceof Error?s.message:String(s);if(c.length&&f&&!f.childrenAvailable)f.childrenLoading=!1,f.cache=!1,f.error=m,e.originalLazyGroupDataChangeDetect=It();else{let p=t.lazyLoadCacheOfLoadedBatches,h=[...c,r.lazyLoadStartIndex??0];p.has(h)&&p.set(h,"failed"),f&&(f.childrenLoading=!1,f.error=m)}}u&&(e.loading=!1)};return Promise.resolve(o).then(s=>{let c=[],f=!1;if(Array.isArray(s.data)){let p=s;if(c=p.data,p.livePaginationCursor!==void 0&&(e.livePaginationCursor=p.livePaginationCursor),p.mappings&&(e.pivotMappings=p.mappings),t.lazyLoad||(e.unfilteredCount=p.totalCountUnfiltered??c.length),t.lazyLoad){let y=function(C,b,w){let S=[at,...C],T=b.data,I={cache:b.cache??Lu,childrenLoading:!1,childrenAvailable:!0,totalCount:b.totalCount??T.length,totalCountUnfiltered:b.totalCountUnfiltered,totalChildrenCount:b.totalChildrenCount,totalChildrenCountUnfiltered:b.totalChildrenCountUnfiltered,children:T,error:b.error},x=[];if(r.lazyLoadBatchSize&&!w){let N=h.get(S),R=!N,A=us({children:!0},N||{},I);R&&(A.chidren=[]),A.children.length=A.totalCount;let E=r.lazyLoadStartIndex??0,P=Math.min(b.totalCount??T.length,E+r.lazyLoadBatchSize);for(let D=E;D<P;D++){let M=I.children[D-E];if(!M)throw`lazily loaded item not found at index ${D-E}`;A.children[D]=M,M.dataset&&x.push({keys:M.keys,dataset:M.dataset})}R&&h.set(S,A)}else I.children.forEach(N=>{N&&N.dataset&&x.push({keys:N.keys,dataset:N.dataset})}),I.children.length=I.totalCount,h.set(S,I);let F=!1;if(!C||!C.length){let N=h.get([at]);e.originalDataArray=[...N.children],F=!0}if(F||(e.originalLazyGroupDataChangeDetect=It()),x.length){let N=C;x.forEach(({keys:R,dataset:A})=>{y(R,A,N)})}};var m=y;let h=t.originalLazyGroupData;f=!0,y(r.groupKeys||[],p)}}else c=s;f||(e.originalDataArray=a?t.originalDataArray.concat(c):c),u&&(e.loading=!1)}).catch(d)}function Vu(o,{filterTypes:t,filterMode:e}){return e==="local"?!o||!o.some(n=>n.valueGetter)?o:o.map(zu):(Qo(o,t)||[]).map(zu)}function zu(o){if(!o.valueGetter)return o;let t={...o};return delete t.valueGetter,t}function Gu(){let o;return(t,e,n)=>{if(o&&o.filterValue===t&&o.filterTypes===e&&o.filterMode===n)return o.result;let i=Vu(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 dg=()=>new Promise(o=>{ke(o)});function Lr(o,t){let e=!!o,{stateReadyAsDetails:n}=t(),i=e&&o.shouldRestoreState?n:!0;return{isDetail:e,isDetailReady:i}}function Ku(o){let{lazyLoad:t,lazyLoadBatchSize:e,lazyLoadCacheOfLoadedBatches:n}=o;if(!t||!e||e<=0)return!1;for(let i of n.keys())if(i.length===1)return!0;return!1}function Bu(o){for(let[t,e]of o.entries())e==="failed"&&o.delete(t)}function Hu(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 W,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 w=b.length?b:f,S=y.dataSourceHasGrouping?y.indexInGroup:y.indexInAll;if(y.isGroupRow&&!y.collapsed&&!y.childrenAvailable){let T={lazyLoadStartIndex:0,lazyLoadBatchSize:i,groupKeys:y.groupKeys,append:s},I=y.groupKeys,x=c.get(I);if(!x?.[y.id]){let F=!x;x=x||{},x[y.id]||(x[y.id]=T),F&&c.set(I,x)}}if(!C&&i!=null){let T=c.get(w),I=Math.floor(S/i)*i,x=S-I,F=u[y.indexInAll-x].indexInAll,N=d(F),R=u[F].id;if(N||T?.[R])continue;let A=!T;T=T||{};let E={lazyLoadStartIndex:I,lazyLoadBatchSize:i,groupKeys:b,append:s};T[R]||(T[R]=E),A&&c.set(w,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(()=>dg()).then(()=>In(...b))},m)}var cg=Object.freeze([]),Wu=(o,t)=>{let e=o??cg,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};var xn=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 st=class extends xn{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 Qe=class{constructor(t){this.collapsedPathsMap=new W;this.expandedPathsMap=new W;this.collapsedIdsMap=new Map;this.expandedIdsMap=new Map;this._mode="path";this.defaultExpanded=!1;this.expandAll=()=>{this.update({defaultExpanded:!0,collapsedPaths:[]})};this.collapseAll=()=>{this.update({defaultExpanded:!1,expandedPaths:[]})};let 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}}};function ni(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(!ni(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)||!ni(o[i],t[i]))return!1;return!0}return!1}function fg(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 oi={id:!0,value:!0,indexInAll:!0,rowSelected:!0,rowDisabled:!0,isCellSelected:!1,hasSelectedCells:!1},ju={...oi,dataSourceHasGrouping:!0,isTreeNode:!0,data:!1,isGroupRow:!0,selfLoaded:!0},pg={indexInGroup:!0,groupKeys:!0,groupBy:!0,rootGroupBy:!0,parents:!1,indexInParentGroups:!0,groupCount:!0,groupNesting:!0,collapsed:!0,selfLoaded:!0},mg={...oi,...pg,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},$u={isTreeNode:!0,isParentNode:!0,indexInParent:!0,nodePath:!0,parentNodes:!1,indexInParentNodes:!0,totalLeafNodesCount:!0,collapsedLeafNodesCount:!0,treeNesting:!0,selfLoaded:!0},hg={...oi,...$u,dataSourceHasGrouping:!0,isTreeNode:!0,isGroupRow:!0,isParentNode:!0,data:!1},gg={...oi,...$u,dataSourceHasGrouping:!0,isParentNode:!0,isGroupRow:!0,nodeExpanded:!0,selfExpanded:!0,data:!1,selectedLeafNodesCount:!0,deepRowInfoArray:!1,deselectedLeafNodesCount:!0,duplicateOf:!1},yg=Object.entries(ju).map(([o,t])=>t?o:void 0).filter(Boolean),bg=Object.entries(ju).map(([o,t])=>t?o:void 0),Cg=Object.entries(mg).map(([o,t])=>t?o:void 0),Tg=Object.entries(hg).map(([o,t])=>t?o:void 0),Sg=Object.entries(gg).map(([o,t])=>t?o:void 0);function wg(o,t){if(o===t)return!0;if(!o||!t||!fg(o,t)||o.id!==t.id||o.data!==t.data&&!ni(o.data,t.data))return!1;let e=[];o.dataSourceHasGrouping?e=o.isGroupRow?Cg:bg:o.isTreeNode?e=o.isTreeNode&&o.isParentNode?Sg:Tg:e=yg;for(let n of e){let i=o[n],r=t[n];if(!(typeof i=="function"||typeof r=="function")&&!ni(i,r))return!1}return!0}function Uu(){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=[],w=l();for(let S of w){let T=p[S],I=f[S];if(I===void 0){b.push(S);continue}wg(T,I)||b.push(S)}o=f,(b.length>0||C)&&queueMicrotask(()=>{for(let S=0,T=b.length;S<T;S++){let I=b[S],x=t.get(I);if(x)for(let F of x)F()}if(C)for(let S of Array.from(e))S()}),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 zr=o=>Array.isArray(o)?new W(o.map(t=>[t,!0])):o,vg=(o,t)=>o.length-t.length,$e=class o{constructor(t,e){this.selectedPaths=null;this.deselectedPaths=null;this.defaultSelection=!1;this.selectionMap=new W;this.cache=new W;this.strictMode=!1;let n=t instanceof Object.getPrototypeOf(this).constructor,i=n?t.getState():t;this.setConfig(e||(n?t.config:{treePaths:new W})),this.disableStrictMode(),this.update(i),this.config.strictCheckPaths&&this.enableStrictMode()}getTreePaths(t){return t?zr(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:zr(e.treePaths),strictCheckPaths:e.strictCheckPaths??!0,multiRowSelectionTarget:e.multiRowSelectionTarget,unfilteredTreePaths:e.unfilteredTreePaths?zr(e.unfilteredTreePaths):void 0},this.xcache()}hasFilteredOutLeavesInside(t){let{multiRowSelectionTarget:e,unfilteredTreePaths:n,treePaths:i}=this.config;return e!=="visible"||!n||n===i?!1:n.getAllChildrenSizeFor(t)>i.getAllChildrenSizeFor(t)}setVisibleLeafNodesSelection(t,e){let{unfilteredTreePaths:n,treePaths:i}=this.config;this.xcache(),i.getKeysForLeafNodesStartingWith(t).forEach(r=>{n.getAllChildrenSizeFor(r)>0||(this.selectionMap.delete(r),this.isNodeSelected(r)!==e&&this.setSelectionForPath(r,e))}),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(){if(this.hasFilteredOutLeavesInside([])){this.setVisibleLeafNodesSelection([],!1);return}this.update({defaultSelection:!1,selectedPaths:[],deselectedPaths:[]})}selectAll(){if(this.hasFilteredOutLeavesInside([])){this.setVisibleLeafNodesSelection([],!0);return}this.update({defaultSelection:!0,deselectedPaths:[],selectedPaths:[]})}enableStrictMode(){this.strictMode=!0}disableStrictMode(){this.strictMode=!1}isPathAvailable(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(vg);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.hasFilteredOutLeavesInside(t)){this.setVisibleLeafNodesSelection(t,e);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 Yt(o,t){return t().dataArray[o]}function ii(o){return o().dataArray}function Dn(o,t){return new $e(o,Pn(t))}function Pn(o){return()=>{let t=typeof o=="function"?o():o,{treePaths:e,unfilteredTreePaths:n,multiRowSelectionTarget:i}=t;return i==="visible"?{treePaths:e,unfilteredTreePaths:n,multiRowSelectionTarget:i}:{treePaths:n??e,multiRowSelectionTarget:i}}}var ri=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 $e))throw"Invalid tree selection";let a=new $e(i,Pn(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 Qe({defaultExpanded:!0,collapsedPaths:[]});this.getState().lastExpandStateInfoRef.current={state:"expanded",nodePath:null},this.actions.treeExpandState=t}collapseAll(){let t=new Qe({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 Qe(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 Qe(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 Qe(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?Yt(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 $e))throw"Invalid node selection";let n=new $e(t,Pn(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 $e))throw"Invalid node selection";let n=new $e(t,Pn(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 $e))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 Vr=new Map,Gr=new Map;var Kr="DebugID=";function An(o,t){return t&&t.startsWith(Kr)?t:t?`${Kr}${o}:${t}`:`${Kr}${o}`}var Rg=Symbol("cursorId"),qu=o=>o.totalLeafNodesCount===0,Ig=o=>o.isParentNode?!qu(o):!0;function Yu(o){let t=Date.now(),e=[],n=[],i=new W;return{logger:Bt(`${o.debugId}:DataSource`),debugTimings:new Map,debugWarnings:new Map,devToolsDetected:!!globalThis.__INFINITE_TABLE_DEVTOOLS_HOOK__,rowInfoStore:Uu(),indexer:new Jo,totalLeafNodesCount:0,__apiRef:{current:null},repeatWrappedGroupRows:!1,destroyedRef:{current:!1},lastSelectionUpdatedNodePathRef:{current:null},lastExpandStateInfoRef:{current:{state:"collapsed",nodePath:null}},idToIndexMap:new Map,idToPathMap:new Map,pathToIndexMap:new W,waitForNodePathPromises:new W,getDataSourceMasterContextRef:{current:()=>{}},cache:void 0,detailDataSourcesStateToRestore:new Map,stateReadyAsDetails:!1,originalDataArrayChanged:!1,originalDataArrayChangedInfo:{timestamp:0,mutations:void 0},rowsPerPage:null,lazyLoadCacheOfLoadedBatches:new W,dataParams:void 0,onCleanup:pe(),notifyScrollbarsChange:pe(),notifyScrollStop:pe(),notifyRenderRangeChange:pe(),pivotTotalColumnPosition:"end",pivotGrandTotalColumnPosition:!1,scrollStopDelayUpdatedByTable:100,originalLazyGroupData:i,originalLazyGroupDataChangeDetect:0,originalDataArray:e,cursorId:Rg,showSeparatePivotColumnForSingleAggregation:!1,propsCache:new Map([["sortInfo",new WeakMap],["rowDisabledState",new WeakMap],["isRowDisabled",new WeakMap],["cellSelection",new WeakMap],["treeSelection",new WeakMap],["treeExpandState",new WeakMap],["groupRowsState",new WeakMap]]),rowInfoReducerResults:void 0,pivotMappings:void 0,pivotColumns:void 0,pivotColumnGroups:void 0,dataArray:n,unfilteredCount:n.length,filteredCount:n.length,updatedAt: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 xg(o){let t={...o};return delete t.originalDataArray,t}var Pg=[],Zu=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()},Xu=(o,t)=>({onDataParamsChange:e=>e?Tl(e,100,xg):void 0,lazyLoad:e=>!!e,isNodeReadOnly:e=>e??qu,isNodeSelectable:e=>e??Ig,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,multiRowSelectionTarget:e=>e??"all",filterDelay:e=>e??200,filterTypes:e=>({...Xn,...e}),sortTypes:e=>({...Wt,...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 st)return e;let n=o.propsCache.get("rowDisabledState"),i=n.get(e);return i||(i=new st(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=>Wu(e,o.propsCache.get("sortInfo")),groupBy:e=>e??Pg});function Dg(o,t){return typeof o=="function"?o({array:t.originalDataArray,length:t.originalDataArray.length,lastItem:t.originalDataArray[t.originalDataArray.length-1]}):o}function Ag(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 _g={selectedPaths:[],deselectedPaths:[],defaultSelection:!1};function Ju(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.
|
|
1
|
+
var Xp=Object.create;var Wa=Object.defineProperty;var Jp=Object.getOwnPropertyDescriptor;var Qp=Object.getOwnPropertyNames;var em=Object.getPrototypeOf,tm=Object.prototype.hasOwnProperty;var nm=(o,t)=>()=>(t||o((t={exports:{}}).exports,t),t.exports);var om=(o,t,e,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Qp(t))!tm.call(o,i)&&i!==e&&Wa(o,i,{get:()=>t[i],enumerable:!(n=Jp(t,i))||n.enumerable});return o};var Gn=(o,t,e)=>(e=o!=null?Xp(em(o)):{},om(t||!o||!o.__esModule?Wa(e,"default",{value:o,enumerable:!0}):e,o));var wn=nm((Iv,zs)=>{"use strict";zs.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}});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)}}import{defineComponent as ty,inject as ny,onBeforeUnmount as ui,onMounted as di,provide as oy,shallowRef as iy,watch as En}from"vue";import{getCurrentInstance as rm,inject as am,isRef as lm,onBeforeUnmount as sm,provide as um,shallowRef as dm,unref as cm,watch as fm}from"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(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 qi=o=>o&&o.substr(0,1).toUpperCase()+o.substr(1);function Kn(o){return o!==void 0}function Bn(o,t){let e=t[o];return Kn(e)}var Yi=(o,t,e)=>{let n=o[t];typeof n=="function"&&n(...e)};function im(o,t,e){let n={};for(let i in o)if(o.hasOwnProperty(i)){let r=o[i],a=Bn(i,t)?t[i]:t[`default${qi(i)}`];typeof r=="function"&&(a=r(a,e)),n[i]=a}return n}function $a(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 Ua(o){let{props:t,initialSetupState:e,propsToForward:n,parentState:i,mapPropsToState:r,propsToStateSet:a}=o,l={};n&&(l=im(n,t,e));let u={...e,...l};if(r){let d=$a(r,{props:t,state:u,oldState:null,parentState:i},a);return{...u,...d}}return u}function qa(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=$a(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 Ya(o){let{dispatch:t,getState:e,getProps:n,propsToForward:i,allowedControlledPropOverrides:r,interceptedActions:a,mappedCallbacks:l,notify:u=Yi}=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 S=[p],T=`on${qi(c)}Change`;if(l&&l[f]){let I=l[f](p,y);T=I.callbackName||T,S=I.callbackParams}u(h,T,S)}let b=i[f];typeof b=="function"&&(p=b(p));let w=!!r?.[f];Bn(c,h)&&!w||t({payload:{updatedProps:null,mappedState:{[c]:p}}})}}),s},{})}function Za(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++,Bn(p,t)||Bn(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 pm(o){return(t,e,n)=>{if(Yi(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 pn(o){let t=o.injectionKey??Symbol("managed-component-state");function e(r){let a=rm(),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:lm(c)?cm(c)??null:typeof c=="function"?c()??null:c,m=Ua({props:l(),initialSetupState:u,propsToForward:s,parentState:f(),mapPropsToState:o.mapPropsToState,propsToStateSet:d}),p=dm(m),h=()=>m,y=l,C=T=>{m=qa(m,T,{getProps:y,getParentState:f,mapPropsToState:o.mapPropsToState,concludeReducer:o.concludeReducer,propsToStateSet:d}),p.value=m},b=pm(a?(T,...I)=>a.emit(T,...I):void 0),w=Ya({dispatch:C,getState:h,getProps:y,propsToForward:s,allowedControlledPropOverrides:o.allowedControlledPropOverrides,interceptedActions:o.interceptActions,mappedCallbacks:o.mappedCallbacks,notify:b});return fm(()=>({props:l(),parentState:f()}),(T,I)=>{let x=T.props,F=I.props,N=T.parentState!==I.parentState,{newMappedState:R,newMappedStateCount:A,updatedPropsToState:E,updatedPropsToStateCount:P,rawUpdatedProps:D,rawUpdatedPropsCount:M}=Za({currentProps:x,prevProps:F,state:p.value,propsToForward:s,propsToStateSet:d}),_=!1;if(P>0||A>0){let O={payload:{mappedState:A?R:null,updatedPropsToState:P?E:null}},z=p.value;if(C(O),_=!0,o.onPropChange){for(let K in D)if(D.hasOwnProperty(K)){let{newValue:B,oldValue:G}=D[K];o.onPropChange({name:K,newValue:B,oldValue:G},x,w,z)}}o.onPropsChange&&M&&o.onPropsChange(D,x,w,z)}N&&T.parentState!=null&&!_&&C({type:"PARENT_STATE_CHANGE",payload:{}})},{flush:"post"}),sm(()=>{o.cleanup?.(h())}),{contextValue:{state:p,componentActions:w,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 um(t,a.contextValue),a}function i(){return am(t)}return{useManagedComponent:e,provideManagedComponent:n,useManagedComponentState:i,injectionKey:t}}function pe(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 bt(o){let t=!1,e=null;return(...i)=>(t||(t=!0,e=o(...i)),e)}var Xa=(o,t)=>o-t;var vo=(o,t)=>Xa(o.revision,t.revision),W=class o{constructor(t){this.map=new Map;this.length=0;this.revision=0;this.mutations=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)}get version(){return this.mutations}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(vo).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(vo).map(f=>f.keys):l:(this.visitWithNext(t,(f,m,p,h,y)=>{u({...y,keys:m})},!1,d,i,n),r?a.sort(vo).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;this.mutations++,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,this.mutations++}delete(t){let e=this.map;this.mutations++,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=bt(()=>{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(vo);function*n(){for(let i=0,r=e.length;i<r;i++)yield t(e[i])}return n()}};globalThis.DeepMap=W;function Fe(){return globalThis}var Io=["#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"],Ja=Symbol("color"),Ro=new WeakMap,Zi=pe();function Xi(o=Io){Ro.set(o,o.map(t=>0))}Xi();var mm=(o=Io)=>{let t=[];Ro.has(o)?t=Ro.get(o):(t=o.map(n=>0),Ro.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]??Io[0]},Wn=":",Ji="*",Qa="-",hm=",",gm="debug",ym="diffdebug",tl=!1,Hn=new W,jn=new Map;function Qi(o,t){let e=o.split(Wn),n=new W;n.set(e,!0);let i=t.split(Wn),r=new Set(i).has(Ji),a=i.indexOf(Ji),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(Wn)):!0}}function nl(o,t){let e=`channel=${o}_permissions=${t}`;if(jn.has(e))return jn.get(e);let n=t.split(hm);function i(l){return jn.set(e,l),l}let r=[],a=[];n.forEach(l=>{l.includes(Ji)?a.push(l):r.push(l)});for(let l=0;l<r.length;l++){let u=r[l],d=u.startsWith(Qa);if(d&&(u=u.substring(Qa.length)),Qi(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)),Qi(o,u))return i(!d)}return i(!1)}var er=()=>Xe.enable??(Fe()&&Fe().localStorage?.getItem(gm))??"",bm=()=>Xe.diffenable??(Fe()&&Fe().localStorage?.getItem(ym))??`${tl}`,tr="",ol=tl;function nr(o){ol=`${bm()}`=="true",tr!==o&&(tr=o,jn.clear())}function il(o){nr(er()),typeof Fe()<"u"&&Fe().addEventListener&&Fe().addEventListener("storage",function(){nr(er())});function t(e,n){let i=n?`${n}${Wn}${e}`:e,r=i.split(Wn),a=Hn.get(r);if(a)return a;let l=Hn.get(r.slice(0,-1)),u=(l?l.logFn:Xe.logFn)??rl,d=u,s,c=0,f=()=>s??nl(i,tr),m=mm(Xe.colors),p=Object.defineProperties((...h)=>{let y=Zi.getListenersCount(),C;if(y>0&&(C=C??Date.now(),Zi({color:m,channel:i,args:h,timestamp:C})),f()){if(C=C??Date.now(),c&&ol){let S=C-c;d(`%c[${i}]`,`color: ${m}`,`+${S}ms:`)}c=C;let b=[],w;if(h.forEach(S=>{if(S[Ja])w===void 0&&(w=!0),b.push(...S);else{if(typeof S!="string"&&typeof S!="number"){w=!1;return}b.push(`${S}%s`)}}),w){let S=[`%c[${i}]%c %s`,`color: ${m}`,"",...b,""];d(...S)}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[Ja]=!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:()=>{Hn.delete(r)}}});return Hn.set(r,p),p}return t(o)}var rl=console.log.bind(console),el;Object.defineProperty(il,"enable",{get:()=>el,set:o=>{el=o,nr(er())}});var Xe=il;Xe.colors=Io;Xe.logFn=rl;var Cm=(o,t)=>Zi.onChange(e=>{if(!e)return;let{channel:n,args:i,color:r,timestamp:a}=e;Qi(n,o)&&t({channel:n,color:r,args:i,timestamp:a})});Xe.onLogIntent=Cm;Xe.isChannelEnabled=nl;Xe.destroyAll=()=>{Xi(),Xi(Xe.colors),Hn.clear(),jn.clear()};var Tm=Xe("IT:InfiniteTable"),Sm="#dc3545",wm="#eb9316";var ll="Warn",sl="Error",vm="Info",Rm="Success",Im="Logs",xo=Tm.extend(Im),HT=xo.extend(vm),xm=xo.extend(ll),Pm=xo.extend(sl),WT=xo.extend(Rm);var Dm=wm,Am=Sm;var _m=(o,t)=>{t=t?t.extend?t.extend(ll):t:xm,t(typeof t.color=="function"?t.color(Dm,o):o)},Em=(o,t)=>{t=t?t.extend?t.extend(sl):t:Pm,t(typeof t.color=="function"?t.color(Am,o):o)};var al=new W,ul=(o,...t)=>{al.has(t)||(al.set(t,!0),o())};var dl=(o,t=o,e)=>{ul(()=>_m(o,e),t,"warn")},cl=(o,t=o,e)=>{ul(()=>Em(o,e),t,"error")};function $n(o){return o}function Kt(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||$n)(l,o);return e.push(u),e},[])}var Po="____not_loaded_yet____";function or(o){return typeof o=="string"&&o.startsWith(Po)}var Mm=new W,fl=new WeakMap;function Do(o){let{originalDataArray:t,groupBy:e,toPrimaryKey:n}=o;if(!t||!e.length)return Mm;let i=fl.get(t);if(i&&i.groupBy===e)return i.groups;let r=new W,a=e.length,l=[];return t.forEach(u=>{let d=Kt(u,e);l.length=0;for(let s=0;s<d.length;s++){l.push(d[s]);let c=r.get(l);c||(c={count:0},l.length===a&&(c.primaryKeys=[]),r.set(l,c)),c.count++,c.primaryKeys?.push(n(u))}}),fl.set(t,{groupBy:e,groups:r}),r}function Fm(o,t){let e=[];return o.getLeafNodesStartingWith(t,n=>{let i=n.value?.primaryKeys;if(i)for(let r=0;r<i.length;r++)e.push(i[r])}),e}var Pe=class o{constructor(t,e,n){this.selectedRows=null;this.deselectedRows=null;this.defaultSelection=!1;this.selectedMap=new W;this.deselectedMap=new W;this.onlyUsePrimaryKeys=!1;this.selectionCache=new W;this.selectionCountCache=new W;this.lazyEntries=null;this.lazyLoadedRows=null;this.lazyChildrenLoaded=null;this.lazyRowCounts=null;this.mapSet=(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?Kt(i,n):[]}getGroupDeepMap(){return this.getConfig().groupDeepMap}targetsVisibleRowsOnly(){let{multiRowSelectionTarget:t,someRowsFilteredOut:e}=this.getConfig();return t==="visible"&&!!e}targetsFilteredOutRows(){let{multiRowSelectionTarget:t,someRowsFilteredOut:e}=this.getConfig();return t!=="visible"&&!!e}getVisibleDataInsideGroup(t){let{postFilterDataArray:e,groupDeepMap:n}=this.getConfig();return t.length?n?.get(t)?.items??[]:e??[]}hasFilteredOutRowsInsideGroup(t){let e=this.getConfig();return e.someRowsFilteredOut?(t.length?Do(e).get(t)?.count??0:e.originalDataArray?.length??0)>this.getVisibleDataInsideGroup(t).length:!1}setVisibleRowsSelection(t,e){let{groupBy:n,toPrimaryKey:i}=this.getConfig(),r=e?this.selectedMap:this.deselectedMap,a=e?this.deselectedMap:this.selectedMap;this.xcache(),this.getVisibleDataInsideGroup(t).forEach(l=>{let u=Kt(l,n),d=i(l),s=[...u,d];a.delete(s),this.isRowSelected(d,u)!==e&&r.set(s,!0)}),this.xcache()}getLazyUnfilteredCount(t){let e=this.getConfig();if(!(!e.lazyLoad||e.multiRowSelectionTarget==="visible"))return t.length?e.groupDeepMap?.get(t)?.totalChildrenCountUnfiltered:e.lazyUnfilteredCount}getLazyHiddenRowsCount(t){let e=t.length<this.getGroupByLength()?this.getLazyUnfilteredCount(t):void 0;if(e===void 0)return 0;let{groupDeepMap:n}=this.getConfig(),i=0;return this.getGroupKeysDirectlyInsideGroup(t).forEach(r=>{i+=this.getLazyUnfilteredCount(r)??(n?.get(r)?.totalChildrenCount||0)}),Math.max(e-i,0)}getLazyEntries(){let t=`${this.selectedMap.version}:${this.deselectedMap.version}`;if(this.lazyEntries?.version!==t){let e=new W;this.selectedMap.getKeysStartingWith([]).forEach(n=>e.set(n,!0)),this.deselectedMap.getKeysStartingWith([]).forEach(n=>e.set(n,!1)),this.lazyEntries={version:t,entries:e}}return this.lazyEntries.entries}getLazyRowCount(t){this.lazyRowCounts=this.lazyRowCounts??new W;let e=this.lazyRowCounts.get(t);if(e!==void 0)return e??void 0;let n=this.computeLazyRowCount(t);return this.lazyRowCounts.set(t,n??null),n}computeLazyRowCount(t){let e=this.getConfig(),n=this.getGroupByLength(),i=this.getLazyUnfilteredCount(t);if(i!==void 0)return i;if(!t.length&&!n)return e.totalCount;let r=t.length?e.groupDeepMap?.get(t):void 0,a=t.length?r?.totalChildrenCount:e.lazyGroupedRowCount;if(a!=null)return a;if(t.length===n)return r?.childrenAvailable?r.items.length:void 0;let l=e.groupDeepMap?.getKeysStartingWith(t,{excludeSelf:!0,depthLimit:1})??[];if(l.length)return l.reduce((u,d)=>u+(or(d[d.length-1])?1:this.getLazyRowCount(d)??1),0)}areLazyChildrenLoaded(t){this.lazyChildrenLoaded=this.lazyChildrenLoaded??new W;let e=this.lazyChildrenLoaded.get(t);if(e!==void 0)return e;let n=this.computeLazyChildrenLoaded(t);return this.lazyChildrenLoaded.set(t,n),n}computeLazyChildrenLoaded(t){let{groupDeepMap:e}=this.getConfig(),n=t.length?e?.get(t):void 0;return t.length&&!n?.childrenAvailable?!1:t.length===this.getGroupByLength()?this.getLazyLoadedRows(t).complete:(e?.getKeysStartingWith(t,{excludeSelf:!0,depthLimit:1})??[]).every(i=>!or(i[i.length-1]))}getLazyLoadedRows(t){this.lazyLoadedRows=this.lazyLoadedRows??new W;let e=this.lazyLoadedRows.get(t);if(!e){let{groupDeepMap:n,originalDataArray:i,toPrimaryKey:r,totalCount:a}=this.getConfig(),l=t.length?n?.get(t):void 0,u=l?l.items:i??[],d=l?l.totalChildrenCount:a,s=new Set,c=d==null||u.length>=d;for(let f=0;f<u.length;f++){let m=u[f];m==null?c=!1:s.add(r(m))}e={primaryKeys:s,complete:c},this.lazyLoadedRows.set(t,e)}return e}isLazyEntryFilteredOut(t){let{groupDeepMap:e}=this.getConfig(),n=this.getGroupByLength();for(let i=1;i<=t.length;i++){let r=t.slice(0,i-1);if(!(i>n?this.getLazyLoadedRows(r).primaryKeys.has(t[i-1]):!!e?.get(t.slice(0,i))))return this.areLazyChildrenLoaded(r)}return!1}getLazySelectionCountFor(t,e){let n=this.selectionCountCache.get(t);if(n!=null)return n;let i=this.getLazyEntries(),r=this.getGroupByLength()+1,a=this.getLazyUnfilteredCount([])!==void 0,l=0,u=0;i.getKeysOfFirstChildOnEachBranchStartingWith(t,{excludeSelf:!0,respectOrder:!1}).forEach(f=>{if(!a&&this.isLazyEntryFilteredOut(f))return;let m=i.get(f);if(f.length>=r){m?l++:u++;return}let p=this.getLazySelectionCountFor(f,m);l+=p.selectedCount,u+=p.deselectedCount});let d=this.getLazyRowCount(t),s=d===void 0?1:Math.max(d-l-u,0);e?l+=s:u+=s;let c={selectedCount:l,deselectedCount:u};return this.selectionCountCache.set(t,c),c}getGroupCount(t){if(t.length==0)return this.getLazyUnfilteredCount([])??this.getConfig().totalCount;if(this.targetsFilteredOutRows())return Do(this.getConfig()).get(t)?.count??0;let n=this.getGroupDeepMap()?.get(t);return n?this.getLazyUnfilteredCount(t)??n.totalChildrenCount??(n.items.length||0):0}getGroupKeysDirectlyInsideGroup(t){let e=this.getConfig(),n={excludeSelf:!0,depthLimit:1};return this.targetsFilteredOutRows()?Do(e).getKeysStartingWith(t,n):e.groupDeepMap?.getKeysStartingWith(t,n)||[]}getAllPrimaryKeysInsideGroup(t){let e=this.getConfig(),{groupDeepMap:n,toPrimaryKey:i}=e;if(this.targetsFilteredOutRows())return t.length?Fm(Do(e),t):(e.originalDataArray??[]).map(i);if(!e.groupBy.length)return this.getVisibleDataInsideGroup([]).map(i);if(!t.length)return(n?.getKeysStartingWith([],{excludeSelf:!0,depthLimit:1})||[]).map(l=>this.getAllPrimaryKeysInsideGroup(l)).flat();let r=n?.get(t);return r?r.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(),this.lazyLoadedRows=null,this.lazyChildrenLoaded=null,this.lazyRowCounts=null}getState(){let t=i=>{let r=this.getGroupByLength();return i.map(a=>this.onlyUsePrimaryKeys||r===0&&a.length===1?a[0]:a)},e=t(this.selectedMap.topDownKeys()),n=t(this.deselectedMap.topDownKeys());return{defaultSelection:this.defaultSelection,selectedRows:e,deselectedRows:n}}deselectAll(){if(this.targetsVisibleRowsOnly()){this.onlyUsePrimaryKeys?this.deselectGroupRow([]):this.setVisibleRowsSelection([],!1);return}this.update({defaultSelection:!1,selectedRows:[],deselectedRows:[]})}selectAll(){if(this.targetsVisibleRowsOnly()){this.onlyUsePrimaryKeys?this.selectGroupRow([]):this.setVisibleRowsSelection([],!0);return}this.update({defaultSelection:!0,deselectedRows:[],selectedRows:[]})}isRowDefaultSelected(){return this.defaultSelection===!0}isRowDefaultDeselected(){return this.defaultSelection===!1}isRowSelected(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}if(this.targetsVisibleRowsOnly()&&this.hasFilteredOutRowsInsideGroup(t)){this.setVisibleRowsSelection(t,!0);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)}),this.xcache()}deselectGroupRow(t){if(this.onlyUsePrimaryKeys){this.getAllPrimaryKeysInsideGroup(t).forEach(r=>{this.defaultSelection===!1?this.selectedMap.delete([r]):this._deselectedMapSet(r)}),this.xcache();return}if(this.targetsVisibleRowsOnly()&&this.hasFilteredOutRowsInsideGroup(t)){this.setVisibleRowsSelection(t,!1);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)}),this.xcache()}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(this.getConfig().lazyLoad&&(!this.onlyUsePrimaryKeys||!i))return this.getLazySelectionCountFor(t,e??this.getGroupRowBooleanSelectionStateFromParent(t));if(this.onlyUsePrimaryKeys&&(i||this.targetsVisibleRowsOnly())){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}if(t.length===i&&this.targetsVisibleRowsOnly()){let{toPrimaryKey:d}=this.getConfig(),s=0,c=0;this.getVisibleDataInsideGroup(t).forEach(m=>{this.isRowSelected(d(m),t)?s++: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;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 Bt=o=>{let t=Xe(o?`IT:${o}:TYPE=debug`:"IT:TYPE=debug");return t.logFn=console.log.bind(console),t},Ht=o=>{let t=Xe(o?`IT:${o}:TYPE=error`:"IT:TYPE=error");return t.logFn=console.error.bind(console),t},Un=()=>Un;Un.extend=()=>Un;var et=class{constructor(t){this.debug=Un,this.error=Un}};var Nm=function(o,t){return o-t},Om=function(o,t){return o=`${o}`,t=`${t}`,o.localeCompare(t)},km=function(o,t){return o-t},Lm={number:Nm,string:Om,date:km},Wt=Lm;var ke=Fe().requestAnimationFrame||(o=>setTimeout(o,16)),Qt=Fe().cancelAnimationFrame||(o=>clearTimeout(o));function jt(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 ir(o){return o.map(Ct)}function Ct(o){if(Fe().structuredClone)return Fe().structuredClone(o);if(o===null||typeof o!="object")return o;if(Array.isArray(o))return ir(o);if(o instanceof Date)return new Date(o);if(o instanceof Set)return new Set(ir(Array.from(o)));if(o instanceof Map)return new Map(ir(Array.from(o)));let t={};for(let e in o)o.hasOwnProperty(e)&&(t[e]=Ct(o[e]));return t}var en=Object.seal({data:null,field:null});var at="____root____";function $t(){return!1}function rr(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 Ao(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 ml(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 W;function c(C,b,w,S=0,T=[]){let I=!w.length||S===w.length-1,x=b[d?.values||"values"]||{};for(let F in x)if(x.hasOwnProperty(F)){let N=F;T.push(N),f.set(T,!0),C.set(T,{reducerResults:x[F][d?.totals||"totals"]||{},items:[]}),I||c(C,x[F],w,S+1,T),T.pop()}}let f=i?new W:void 0,m=[],p=rr(n),h=Ct(p);t.visitDepthFirst((C,b,w,S)=>{let[T,...I]=b,x=C.children,F=s.get(I);if(F&&(F.cache=C.cache,F.childrenLoading=C.childrenLoading,F.childrenAvailable=C.childrenAvailable,F.error=C.error),I.length==r.length&&r.length){if(F){F.items=x;for(let R=0,A=I.length;R<A;R++){let E=I.slice(0,R),P=s.get(E);P&&(P.items=P.items||[],P.items=P.items.concat(x))}x=a.indexArray(x,{toPrimaryKey:l,cache:u,nodesKey:void 0})}return S?.()}for(let N=0,R=x.length;N<R;N++){if(!x[N]){let D={items:[],reducerResults:{},cache:!1,childrenLoading:!1,childrenAvailable:!1,isTree:!1,isGroupBy:!0};s.set([...I,`${Po}${N}`],D);continue}let A=x[N].data,E=x[N].keys||[];if(E.length){let D=E[E.length-1];I.push(D)}let P={items:[],cache:!1,childrenLoading:!1,childrenAvailable:!1,commonData:A,totalChildrenCount:x[N].totalChildrenCount,totalChildrenCountUnfiltered:x[N].totalChildrenCountUnfiltered,reducerResults:x[N].aggregations||{},isTree:!1,isGroupBy:!0};if(s.set(I,P),i){let D=P.pivotDeepMap=new W,M=x[N].pivot;c(D,M,i,0,m)}E.length&&I.pop()}S?.()});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 pl(o,t,e,n,i,r,a,l,u,d=$n){let{items:s,reducerResults:c,pivotDeepMap:f}=o.get(t);if(s.push(n),a&&Ao(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&&(en.data=n,en.field=h,b=y(en));let w=(C||d)(b,n);e.push(w),f.has(e)||(l.set(e,!0),f?.set(e,{reducerResults:Ct(u),items:[]}));let{reducerResults:S,items:T}=f.get(e);T.push(n),a&&Ao(n,i,a,S,t)}e.length=0}}function hl(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 w=n.slice(0,C),S=t.get(w),{reducerResults:T,items:I}=S;I.push(i),S.leavesAvailableCount++,S.totalLeafNodesCount++,a&&Ao(i,r,a,T,w)}return}let p=Ct(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 w=y[C];hl(o,t,e,f,w,C,a,l)}a&&qn(a,p,h)}}function ar(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=rr(e),r=Ct(i),a=new W,l=new W;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++)hl(o,a,l,[],t[d],d,e,i);e&&qn(e,r,t);let u={deepMap:a,treeParams:o,treePaths:l,initialData:t,reducerResults:r};return n&&n.end(),u}function lr(o,t){let{marker:e,groupBy:n,defaultToKey:i=$n,pivot:r,reducers:a}=o;e&&e.start();let l=n.length,u=r?new W:void 0,d=new W,s=[],c=[],f=rr(a),m=Ct(f);if(!l){let h={items:[],isTree:!1,isGroupBy:!0,cache:!1,childrenLoading:!1,childrenAvailable:!1,reducerResults:Ct(f)};r&&(h.pivotDeepMap=new W),d.set(s,h)}for(let h=0,y=t.length;h<y;h++){let C=t[h],b={};for(let w=0;w<l;w++){let{field:S,groupField:T,valueGetter:I,toKey:x}=n[w],F=S?C[S]:null;I&&(en.data=C,en.field=S,F=I(en));let N=(x||i)(F,C);if(b[S||T]=N,s.push(N),!d.has(s)){let R={items:[],isTree:!1,isGroupBy:!0,cache:!1,commonData:{...b},childrenLoading:!1,childrenAvailable:!1,reducerResults:Ct(f)};r&&(R.pivotDeepMap=new W),d.set(s,R)}pl(d,s,c,C,h,r,a,u,f,i)}l||pl(d,s,c,C,h,r,a,u,f,i),a&&Ao(C,h,a,m,s),s.length=0}a&&(d.visitDepthFirst((h,y,C,b)=>{qn(a,h.reducerResults,h.items),r&&h.pivotDeepMap.visitDepthFirst(({items:w,reducerResults:S},T,I,x)=>{qn(a,S,w),x?.()}),b?.()}),qn(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 zm(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 Vm(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 S=r[b].field;S&&(m[S]=d[b]),S&&f[S]==null&&(f[S]=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(Po)&&(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:$t,hasSelectedCells:$t,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 _o(o,t,e){return{...o,id:`duplicate_row_on_page_${e}_for__${o.id}`,indexInAll:t,duplicateOf:o.id}}function qn(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 gl(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,w=o.length,S=e[e.length-1],T=S?S.nodeExpanded:!0;for(let I=0;I<w;I++){let x=o[I],F=d(x,I),N=[...t,F];if(l(x)){let _={id:F,nodePath:N,isGroupRow:!1,data:x,treeNesting:a,totalLeafNodesCount:0,collapsedLeafNodesCount:0,isTreeNode:!0,isParentNode:!1,selfLoaded:!0,rowSelected:!1,rowDisabled:!1,isCellSelected:$t,hasSelectedCells:$t,dataSourceHasGrouping:!1,parentNodes:Array.from(e),indexInParentNodes:[...n,I],indexInParent:I,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 z=0,K=e.length;z<K;z++){let B=e[z];if(T||(B.collapsedLeafNodesCount+=1),B.deepRowInfoArray.push(_),O!=null&&T){if(typeof y=="function"&&y(B)!==!0)continue;let G=_o(B,_.indexInAll,O);r[G.indexInAll]=G,_.indexInAll++}}T&&(r[_.indexInAll]=_);continue}let E=b.get(N)?.totalLeafNodesCount??0,P={dataSourceHasGrouping:!1,nodeExpanded:!1,selfExpanded:!1,nodePath:N,id:F,data:x,indexInAll:r.length,indexInParent:I,indexInParentNodes:[...n,I],totalLeafNodesCount:E,treeNesting:a,selfLoaded:!0,isParentNode:!0,isTreeNode:!0,isGroupRow:!1,deepRowInfoArray:[],parentNodes:Array.from(e),collapsedLeafNodesCount:0,rowSelected:!1,rowDisabled:!1,isCellSelected:$t,hasSelectedCells:$t,selectedLeafNodesCount:0,deselectedLeafNodesCount:0};if(f&&(P.rowSelected=f(P),h)){let _=h.getSelectionCountFor(P.nodePath);P.selectedLeafNodesCount=_.selectedCount,P.deselectedLeafNodesCount=_.deselectedCount}c&&(P.rowDisabled=c(P)),m&&m(P);let D=!0;if(p&&(P.selfExpanded=D=p(P)),T||(D=!1),P.nodeExpanded=D,T&&y&&C!=null&&C>0){let _=P.indexInAll,O=P.parentNodes;if(O.length>0&&_%C===0){let z=_/C,K=0;O.forEach(B=>{typeof y=="function"&&y(B)!==!0||(r.push(_o(B,_+K,z)),K++,P.indexInAll++)})}}T&&(r[P.indexInAll]=P);let M=u(x);Array.isArray(M)&&gl(M,N,[...e,P],P.indexInParentNodes,i,r)}return r}function yl(o){let{dataArray:t,marker:e}=o;e&&e.start();let n=[];return gl(t,[],[],[],o,n),e&&e.end(),{data:n}}function bl(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(I=>I.field).join(", ")}]});let b=[],w=[],S=[],T=[];return h.visitDepthFirst((I,x,F,N)=>{let R=I.items,A=x.length,E=u?.isGroupRowCollapsed(x)??!1;T.push(F);let P=Vm({lazyLoad:e,groupBy:C,parents:Array.from(S),reducers:m,indexInGroup:F,indexInParentGroups:Array.from(T),indexInAll:b.length,groupKeys:x,error:I.error,totalChildrenCount:I.totalChildrenCount,childrenLoading:(I.childrenLoading||!E&&!I.childrenAvailable)&&e,childrenAvailable:I.childrenAvailable,directChildrenCount:x.length===C.length?I.items.length:h.getDirectChildrenSizeFor(x),directChildrenLoadedCount:0},I);if(s&&(P.rowSelected=s(P),c)){let z=c.getSelectionCountFor(P.groupKeys);P.selectedChildredCount=z.selectedCount,P.deselectedChildredCount=z.deselectedCount}d&&(P.rowDisabled=d(P));let D=S[S.length-1],M=D?.collapsed??!1;M&&(E=!0),P.collapsed=E;let _=f||E;if(M&&(_=!1),_){if(r&&i!=null&&i>0){let z=P.indexInAll,K=P.parents;if(K.length>0&&z%i===0){let B=z/i,G=0;K.forEach(le=>{typeof r=="function"&&r(le)!==!0||(b.push(_o(le,z+G,B)),G++,P.indexInAll++)})}}b.push(P),w.push(b.length-1)}P.collapsedChildrenCount=0,S.forEach(z=>{z.deepRowInfoArray.push(P),z.collapsedGroupsCount+=E?1:0}),D&&P.selfLoaded&&e&&(D.directChildrenLoadedCount+=1),a&&a(P),S.push(P);let O=!0;if(O){if(N)N();else if(!y){let z=b.length;E||(b.length+=R.length);let K=0;for(let B=0,G=R.length;B<G;B++){let le=R[B];if(!E&&r&&i!=null&&i>0){let ve=z+B+K;if(ve%i===0){let Oe=ve/i;S.forEach(Ee=>{if(typeof r=="function"&&r(Ee)!==!0)return;let Te=z+B+K;b[Te]=_o(Ee,Te,Oe),K++,b.length++})}}let Z=z+B+K,me={id:le?l(le,Z):`${x}-${B}`,data:le,isCellSelected:$t,hasSelectedCells:$t,dataSourceHasGrouping:!0,isTreeNode:!1,isGroupRow:!1,selfLoaded:!!le,rowSelected:!1,rowDisabled:!1,rootGroupBy:C,collapsed:E,groupKeys:x,parents:Array.from(S),indexInParentGroups:[...T,B],indexInGroup:B,indexInAll:Z,groupBy:C,groupNesting:A+1,groupCount:P.groupCount};s&&(me.rowSelected=s(me)),d&&(me.rowDisabled=d(me)),a&&a(me),S.forEach((ve,Oe)=>{Oe===S.length-1&&le&&(ve.directChildrenLoadedCount+=1),E&&(ve.collapsedChildrenCount+=1),ve.deepRowInfoArray.push(me)}),E||(b[z+B+K]=me)}}}S.pop(),T.pop()}),t&&t.end(),{data:b,groupRowsIndexes:w}}function mn(o,t){return new Pe(o,Ye(t))}function Ye(o){return()=>{let t=typeof o=="function"?o():o,{originalDataArray:e,postFilterDataArray:n}=t,i=!!t.lazyLoad,r=i?t.originalLazyGroupData.get([at]):void 0;return{lazyLoad:i,toPrimaryKey:t.toPrimaryKey,onlyUsePrimaryKeys:!t.useGroupKeysForMultiRowSelection,groupBy:t.groupBy,groupDeepMap:t.groupDeepMap,indexer:t.indexer,totalCount:i?e?.length??0:t.unfilteredCount,lazyGroupedRowCount:t.groupBy.length?r?.totalChildrenCount:void 0,lazyUnfilteredCount:t.groupBy.length?r?.totalChildrenCountUnfiltered:r?.totalCountUnfiltered,multiRowSelectionTarget:t.multiRowSelectionTarget,someRowsFilteredOut:!t.lazyLoad&&!!e&&!!n&&n.length<e.length,originalDataArray:e,postFilterDataArray:n}}}function Cl(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 Pe))throw"Invalid row selection";let a=new Pe(i,Ye(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 Pe))throw"Invalid row selection";let a=new Pe(i,Ye(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 Pe))throw"Invalid row selection";if(!r){let s=u.getDataForPrimaryKey(i);r=s?Kt(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 Pe))throw"Invalid row selection";if(!r){let c=u.getDataForPrimaryKey(i);r=c?Kt(c,d):[]}let s=new Pe(a,Ye(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 Pe))throw"Invalid row selection";if(a==="multi-row"){if(!r){let c=u.getDataForPrimaryKey(i);r=c?Kt(c,d):[]}let s=new Pe(l,Ye(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 Pe))throw"Invalid row selection";let u=new Pe(a,Ye(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 Pe))throw"Invalid row selection";let u=new Pe(a,Ye(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 Pe))throw"Invalid row selection";let u=new Pe(a,Ye(t));u.toggleGroupRowSelection(i),e.rowSelection=u},getGroupRowSelectionState(i,r){let a=t(),{selectionMode:l,groupBy:u}=a,d=r?new Pe(r,Ye(a)):a.rowSelection;if(l!=="multi-row")throw'Selection mode should be "multi-row"';if(!u)throw"No grouping specified";if(!(d instanceof Pe))throw"Invalid row selection";return d.getGroupRowSelectionState(i)},getSelectedPrimaryKeys:i=>{let r=t(),a=i?new Pe(i,Ye(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 sr=new WeakMap,Gm=o=>o;function Tl(o,t=50,e){sr.set(o,{lastCallTime:0,lastCallArg:null});let n=e??Gm;return i=>{let{lastCallTime:r,lastCallArg:a}=sr.get(o)||{lastCallTime:0,lastCallArg:null},l=Date.now(),u=l-r,d=jt(n(a),n(i));u<t&&d||(sr.set(o,{lastCallTime:l,lastCallArg:i}),o(i))}}var Km="*",Ke=class{constructor(t){this.wildcard=Km;this.cache=new W;this.selectedRowsToColumns=new Map;this.selectedColumnsToRows=new Map;this.deselectedRowsToColumns=new Map;this.deselectedColumnsToRows=new Map;this.defaultSelection=!1;this.debugId="";this.deselectAll=()=>{this.update({defaultSelection:!1,selectedCells:[]})};this.selectAll=()=>{this.update({defaultSelection:!0,deselectedCells:[]})};let 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){Ht(`${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}}};import{defineComponent as _u,h as Eu}from"vue";import{computed as vt,defineComponent as Fr,h as Rn,inject as ng,provide as og,ref as Du,shallowRef as ig,watch as rg}from"vue";var te=(...o)=>o.filter(t=>!!`${t}`).join(" ");var Sl="_16lm1iw2 _16lm1iw23 _16lm1iw26 _16lm1iw2c _16lm1iw2a",wl={center:"_16lm1iw2j",stretch:"_16lm1iw2k",start:"_16lm1iw2l",end:"_16lm1iw2m"};var lt="_16lm1iw3b _16lm1iw3c _16lm1iw35",vl={pointer:"_16lm1iwk",default:"_16lm1iwl",colResize:"_16lm1iwm",grabbing:"_16lm1iwn",grab:"_16lm1iwo"},Eo={flex:"_16lm1iw1p",contents:"_16lm1iw1q",none:"_16lm1iw1r",block:"_16lm1iw1s",grid:"_16lm1iw1t",inlineBlock:"_16lm1iw1u",inlineFlex:"_16lm1iw1v",inlineGrid:"_16lm1iw1w"};var Rl={1:"_16lm1iw1c",none:"_16lm1iw1d"},ur={column:"_16lm1iw2f",columnReverse:"_16lm1iw2g",row:"_16lm1iw2h",rowReverse:"_16lm1iw2i"};var Il={0:"_16lm1iw1y","100%":"_16lm1iw1z","50%":"_16lm1iw20"},xl={center:"_16lm1iw30",spaceBetween:"_16lm1iw31",spaceAround:"_16lm1iw32",start:"_16lm1iw33",end:"_16lm1iw34"},Pl={0:"_16lm1iw26","100%":"_16lm1iw27","50%":"_16lm1iw28",auto:"_16lm1iw29"};var Dl={none:"_16lm1iwd"},Mo={hidden:"_16lm1iw35",auto:"_16lm1iw36",visible:"_16lm1iw37"};var Al={relative:"_16lm1iw1",absolute:"_16lm1iw2",static:"_16lm1iw3",sticky:"_16lm1iw4",fixed:"_16lm1iw5"};var _l={0:"_16lm1iw23","100%":"_16lm1iw24","50%":"_16lm1iw25"};var El={none:"_16lm1iw1x"};var Ml={visible:"_16lm1iw38",hidden:"_16lm1iw39"};var Fl={1:"_16lm1iw1e",10:"_16lm1iw1f",100:"_16lm1iw1g",1e3:"_16lm1iw1h",1e4:"_16lm1iw1i",1e5:"_16lm1iw1j",1e6:"_16lm1iw1k",1e7:"_16lm1iw1l","1k":"_16lm1iw1m","10k":"_16lm1iw1n","100k":"_16lm1iw1o"};import{defineComponent as $m,h as Yn,onBeforeUnmount as Um,onMounted as qm,ref as Ym}from"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 Hm(o){var t=Bm(o,"string");return typeof t=="symbol"?t:String(t)}function Wm(o,t,e){return t=Hm(t),t in o?Object.defineProperty(o,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):o[t]=e,o}function Nl(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 Ol(o){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?arguments[t]:{};t%2?Nl(Object(e),!0).forEach(function(n){Wm(o,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(e)):Nl(Object(e)).forEach(function(n){Object.defineProperty(o,n,Object.getOwnPropertyDescriptor(e,n))})}return o}function kl(o,t){var e={};for(var n in o)e[n]=t(o[n],n);return e}var jm=(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},we=o=>{var t=e=>{var n=o.defaultClassName,i=Ol(Ol({},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)jm(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 kl(o.variantClassNames,e=>kl(e,n=>n.split(" ")[0]))}},t};var Ll="_1eexc2a6";var zl=we({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:[]}),Vl="_12zfob1q _16lm1iw2 _16lm1iw1k _16lm1iw3b _16lm1iw3c _16lm1iw35",Gl=we({defaultClassName:"_16lm1iw2 _16lm1iw25 _16lm1iw26 _16lm1iwh _16lm1iwf",variantClassNames:{visible:{true:"_12zfob19",false:"_12zfob1a"}},defaultVariants:{},compoundVariants:[]}),Kl=we({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"]]}),Bl=we({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 Wl="_12zfob17",jl="_12zfob12q _16lm1iw1p _16lm1iw2h _16lm1iw2j _16lm1iw1",$l=we({defaultClassName:"_12zfob12r _16lm1iw1 _16lm1iw23",variantClassNames:{disabled:{true:"_12zfob12s",false:"_12zfob12t"}},defaultVariants:{},compoundVariants:[]}),dr=we({defaultClassName:"_12zfob12n _16lm1iw1p _16lm1iw2h _16lm1iw2k _16lm1iw1",variantClassNames:{active:{true:"_12zfob12o",false:"_12zfob12p"}},defaultVariants:{},compoundVariants:[]}),Ul="_12zfob12m _16lm1iw1p _16lm1iw2h _16lm1iw2j",ql=we({defaultClassName:"_12zfob127 _16lm1iw1 _16lm1iw1p _16lm1iw2f _16lm1iw32 _16lm1iw39",variantClassNames:{menuVisible:{true:"_12zfob128"},reserveSpaceWhenHidden:{true:"_12zfob129",false:"_12zfob12a"}},defaultVariants:{},compoundVariants:[[{menuVisible:!0,reserveSpaceWhenHidden:!1},"_12zfob12b"]]}),Yl="_12zfob1b _16lm1iw2",Zl="_16lm1iw1",Xl="_12zfob16",Jl=we({defaultClassName:"_12zfob12",variantClassNames:{align:{start:"_12zfob13",center:"_12zfob14",end:"_12zfob15"}},defaultVariants:{},compoundVariants:[]}),Ql="_12zfob12l _16lm1iw35 _16lm1iw1 _16lm1iw1p _16lm1iw2h";var nt="InfiniteIcon";var es="_1nnkya20 _16lm1iw1p _16lm1iw2f _16lm1iw1 _16lm1iw32 _16lm1iw2j";var ts={transition:"width 0.25s, opacity 0.25s"},ns=Object.keys({size:1,lineWidth:1,lineStyle:1,style:1,className:1,index:1});var hn=$m(o=>{let t=Ym(0),e=null;return qm(()=>{e=requestAnimationFrame(()=>{e=null,t.value=1})}),Um(()=>{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={...ts,borderTop:`${n}px solid currentColor`,...o.lineStyle,opacity:t.value};return Yn("div",{"data-name":"filter-icon",style:{...o.style,width:`${l}px`},class:te(i,nt,es,`${nt}-filter`)},[a?Yn("div",{"data-name":"index",class:Wl},`${r}`):null,Yn("div",{style:{width:`${d[0]}px`,...s}}),Yn("div",{style:{width:`${d[1]}px`,...s}}),Yn("div",{style:{width:`${d[2]}px`,...s}})])}},{name:"FilterIcon",props:[...ns]});var Fo=Object.freeze({}),Zm={string:Fo,number:{}};function gn(o,t){let e=t.default||Fo;return o.type===void 0?e:o.type===null?Fo:typeof o.type=="string"?t[o.type]||Zm[o.type]||Fo:o.type.reduce((n,i)=>Object.assign(n,t[i]),{})}var fr=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((x,F)=>{let N=x.maxSize??i??void 0,R=x.minSize??n??void 0;u.push(R),d.push(N),x.size!=null&&(N!=null&&x.size>N&&(x.size=N),R!=null&&x.size<R&&(x.size=R));let A=x.flex==0?null:x.flex;if(x.size==null&&A==null)throw`Items must specify either a size or a flex property. Item at index ${F} doesn't have either of those.`;A!=null&&(l+=1),a+=A??0,r+=x.size??0});let s=o.computeSpecialSpaceDistribution?Math.max(t,0):Math.max(t-r,0),c=s/a,f={},m={},p=0;e.forEach((x,F)=>{if(x.flex!=null){let N=c*x.flex,R=x.maxSize??i??void 0,A=x.minSize??n??void 0,E=!1,P=0;R!=null&&N>R&&(f[F]=!0,E=!0,P=R),A!=null&&N<A&&(m[F]=!0,E=!0,P=A),E&&(p+=1,l-=1,a-=x.flex,s-=P)}}),p&&(c=s/a);let h=[],y=0,C=s,b=a,w=0,S=0,T=[];return{items:e.map((x,F)=>{let N={...x},R=x.maxSize??i??void 0,A=x.minSize??n??void 0,E=0,P=f[F],D=m[F],M=P||D,_=x.size??0;if(x.flex!=null){if(M)D&&(E=A),P&&(E=R);else{y+=1;let O=z=>(R!=null&&z>R&&(z=R),A!=null&&z<A&&(z=A),z);y===l?E=O(C):(E=O(Math.round(x.flex*c)),S+=E,C=s-S,b-=x.flex,c=C/b)}_=E,N.flexSize=E}return h.push(E),T.push(_),N.computedSize=_,w+=_,N}),flexSizes:h,minSizes:u,maxSizes:d,computedSizes:T,remainingSize:Math.round(t-w)}};function No(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 is(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 cr(o,t){return o.computedFlex&&!t?"flex":"width"}function Zn(o,t,e){if(t==="width"){let{flex:n,...i}=o??{};return{...i,width:e}}return{...o,flex:e}}var pr=o=>{let{availableSize:t,reservedWidth:e=0}=o,n=Object.keys(o.columnSizing).reduce((A,E)=>(A[E]={...o.columnSizing[E]},A),{});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=is(o.items,t,e),f=l.computedWidth,m=l.computedMinWidth,p=l.computedMaxWidth,h=cr(l,c),y=u?.computedWidth,C=u?.computedMinWidth,b=u?.computedMaxWidth,w=u?cr(u,c):"width",S=!1,T=!1,I=i>0?1:-1,{value:x,clamped:F,diff:N}=No(Math.round(f+i),m,p,I);if(o.shareSpaceOnResize){if(u==null)return n[d]=Zn(n[d],h,x),T=F==="min",S=F==="max",{adjustedDiff:x-f,reservedWidth:e,columnSizing:n,minReached:T,maxReached:S,constrained:T||S};let{value:A,clamped:E,diff:P}=No(Math.round(y-i),C,b,I);if(F&&E&&(Math.abs(N)>Math.abs(P)?E=!1:F=!1),!(!F&&!E)){if(F){let D=No(Math.round(y-i-N),C,b,I);A=D.value,E=D.clamped,P=D.diff}else if(E){let D=No(Math.round(f+i+P),m,p,I);x=D.value,F=D.clamped,N=D.diff}}n[d]=Zn(n[d],h,x),n[s]=Zn(n[s],w,A),T=F==="min"||E==="min",S=F==="max"||E==="max"}else n[d]=Zn(n[d],h,x),T=F==="min",S=F==="max";let R=x-f;return{adjustedDiff:R,reservedWidth:o.shareSpaceOnResize?e:Math.round(e-R),columnSizing:n,minReached:T,maxReached:S,constrained:T||S}};function os(o,t){return o+t}function Xm(o){return Object.keys(o).reduce((e,n)=>(e[n]={...o[n]},e),{})}var rs=o=>{let{availableSize:t,reservedWidth:e=0}=o,n=Object.keys(o.columnSizing).reduce((b,w)=>(b[w]={...o.columnSizing[w]},b),{});if(t<0)throw"The provided availableSize cannot be negative!";let i=o.dragHandleOffset,r=[...new Array(o.columnGroupSize)].map((b,w)=>o.dragHandlePositionAfter-w).reverse(),a=r.map(b=>o.items[b]),l=a.map(b=>b.computedWidth),u=is(o.items,t,e),d=a.map(b=>cr(b,u)),s=0,{computedSizes:c}=fr({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(os,0)+i-s,0)}),f=a.map((b,w)=>c[w]-b.computedWidth),m=!0,p=!0,h=!0,y=[];f.forEach((b,w)=>{let S=a[w];if(!S.resizable){y.push(0);return}let T=d[w],I=l[w],x=Xm(n),{maxReached:F,minReached:N,constrained:R,adjustedDiff:A}=pr({availableSize:o.availableSize,reservedWidth:o.reservedWidth,dragHandleOffset:b,dragHandlePositionAfter:r[w],shareSpaceOnResize:!1,items:o.items,columnSizing:x});n[S.id]=Zn(x[S.id],T,Math.round(I+A)),y.push(A),F||(p=!1),N||(m=!1),R||(h=!1)});let C=y.reduce(os,0);return{minReached:m,maxReached:p,constrained:h,adjustedDiffs:y,adjustedDiff:C,columnSizing:n,reservedWidth:Math.round(e-C)}};var Oo;function Tt(){if(Oo!=null)return Oo;let o=Fe().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),Oo=t.offsetWidth-e.offsetWidth,t.parentNode?.removeChild(t),Oo}var as=["start",void 0,"end"],ls=(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:as.indexOf(i)-as.indexOf(r)}),o);function ss(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 mr(o,...t){return ss(e=>e!=null,o,...t)}function us(o,t,...e){return ss((n,i)=>!(i in o),t,...e)}var ko=!0,Jm=!0,Qm=!0,ds="string",Ot="unknown";var eh=Ht("getComputedVisibleColumns"),th=(o,t,e)=>o[e]!==!1,hr=(o,t)=>{if(!t)return!1;let e=t[o];return e==="start"||e===!0?"start":e==="end"?"end":!1};function tn(o,t){if(o)return o[t]?o[t]:Object.values(o).find(e=>e.field===t)}function nh(o,t){let e=gn(o,t);return o.sortType?o.sortType:e.sortType?e.sortType:typeof o.type=="string"?o.type:ds}function oh(o,t,e){let i=(Array.isArray(o)?o:o?[o]:[]).flatMap(r=>{let a=r.field??r.groupField;if(!a)return[Ot];let l=tn(t,a);if(!l)return[Ot];let u=nh(l,e);return Array.isArray(u)?u:[u]});return i.every(r=>r===Ot)?Ot:i.length===1?i[0]:i}function gr(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??ko}var cs=({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=Xn,viewportReservedWidth:C,resizableColumns:b,draggableColumns:w,columnDefaultDraggable:S,columnOrder:T,columnPinning:I,editable:x,columnDefaultEditable:F,columnDefaultFilterable:N,columnDefaultGroupable:R,columnDefaultSortable:A,columnSizing:E,columnTypes:P,columnVisibility:D,columnVisibilityAssumeVisible:M,groupBy:_})=>{let O=0,z={};_.forEach((g,v)=>{g.field&&(z[g.field]=v)});let K=(f||[]).reduce((g,v)=>{let{id:L,field:k}=v;return k&&(g[k]=v),L&&(g[L]=v),g},{}),B=ls(T===!0?Object.keys(o):T,I),G=B.filter(g=>o[g]?th(D,M,g):(eh(`Column with id "${g}" specified in columnOrder array cannot be found in the columns map.`),!1)),le=new Map,Z=G.map((g,v)=>{let L=o[g];return le.set(g,v),L}),De=(p??[]).reduce((g,v,L)=>(v.id?g[v.id]={sortInfo:v,index:L}:v.field&&(g[v.field]={sortInfo:v,index:L}),g),{});function me(g){let v=o[g],L=gn(v,P),k={minWidth:L?.minWidth,maxWidth:L?.maxWidth,width:L?.defaultWidth,flex:L?.defaultFlex},Y={width:v?.defaultWidth,flex:v?.defaultFlex,minWidth:v?.minWidth,maxWidth:v?.maxWidth},V=E[g];V?.width!=null&&V.flex==null&&delete Y.flex,V?.flex!=null&&V.width==null&&delete Y.width;let J=mr(Y,V);J.width!=null&&delete k.flex,J.flex!=null&&delete k.width,J=mr(k,J);let ce=J.flex??void 0,se=J.minWidth??v?.minWidth??n,fe=J.maxWidth??v?.maxWidth??i,ae=ce!=null?void 0:J.width??(a?void 0:r);return!ae&&ce==null&&(a?ce=a:ae=se),{size:ae,flex:ce,minSize:se,maxSize:fe}}let ve=fr({availableSize:Math.max(e.width-(C??0)-(l??Tt()),0),maxSize:i,minSize:n,items:G.map(me)}),{computedSizes:Oe,flexSizes:Ee,minSizes:Te,maxSizes:_e}=ve,ue=[],Q=[],H=[],q=[];q.length=G.length;let X=new Map,ne=new Map,ie=0,he=0,ge=0,oe=null,$=[],ee=0,Se=0,xe=0;Z.forEach((g,v)=>{let L=G[v],k=Oe[v],Y=$[v]=hr(L,I);Y==="start"?ee+=k:Y==="end"?xe+=k:Se+=k});let be=e.width-xe,Me=[],ze=new Map;G.forEach((g,v)=>{let L=Z[v];ze.set(g,L)});let de=[];Object.keys(o).forEach(g=>{let v=o[g];de.push(g),ze.has(g)||ze.set(g,v)});let tt=new Map;ze.forEach((g,v)=>{let L=le.get(v);L==null&&(L=-1);let k=L!=-1,Y=G[L+1],V=gn(g,P),J=L,ce=De[v]?De[v]:g.field?De[g.field]??null:null,se=ce?.sortInfo??null,fe=!!se,ae=fe&&se.dir===1,ye=fe&&!ae,Re=ce?.index??-1,re=k?{}:me(v),rt=k?Oe[L]:re.size||0,Et=k&&Ee[L]||null,Mt=k?Te[L]||0:re.minSize||0,yt=k?_e[L]||1e4:re.maxSize||1e4,Ge=k?hr(v,I):!1,Ft=k?L===G.length-1:!1,Nt=J,Vn=k?Ge==="start"?he:Ge==="end"?ge:O-he:0;Ge=="start"?Nt=k?J:-1:Ge==="end"?Nt=k?J-(ue.length+H.length):-1:Nt=k?J-ue.length:-1;let Gt=k?Ge==="start"||Ge===!1?O:be+ge:-1,Kp=k?Ge!==oe:!1,Bp=k?Ft||Ge!==hr(Y,I):!1,Ga=g.cssEllipsis??V.cssEllipsis??u,Hp=g.headerCssEllipsis??V.cssEllipsis??g.cssEllipsis??V.headerCssEllipsis??d??Ga,wo=k&&(K[v]||g.field||g.groupByForColumn)&&(K[v]||K[g.field||g.groupByForColumn])||null,Wp=g.defaultFilterable??V.defaultFilterable??N??!0,jp=x??g.defaultEditable??V.defaultEditable??F??!1,ji=g.dataType||V.dataType||(Array.isArray(g.type)?g.type[0]:g.type)||ds,$p=g.sortType||V.sortType||ji,Ka=g.filterType||V.filterType||ji,Ba=!1;if(wo!=null&&!wo.disabled){let Ui=y[Ka];Ui&&(!Ui.emptyValues||!Ui.emptyValues.includes(wo.filter.value))&&(Ba=!0)}let fn=g.field??V.field,Up=g.valueGetter??V.valueGetter,$i=g.defaultGroupable??V.defaultGroupable??R??!!fn;fn||($i=!1),g.groupByForColumn&&($i=!1);let Ha=fn?z[fn]!==void 0:!1,qp=Ha?z[fn]:void 0,Yp=gr(g,{colType:V,sortable:m,columnDefaultSortable:A}),Zp=g.resizable??V.resizable??b??Jm,Be={colType:V,align:V.align,headerAlign:V.headerAlign,computedVisible:k,verticalAlign:V.verticalAlign,defaultHiddenWhenGroupedBy:V.defaultHiddenWhenGroupedBy,valueGetter:Up,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:fn,...g,components:{...V.components,...g.components},computedResizable:Zp,computedMinWidth:Mt,computedMaxWidth:yt,computedFlex:Et,computedDataType:ji,computedEditable:jp,computedSortType:$p,computedFilterType:Ka,cssEllipsis:Ga,headerCssEllipsis:Hp,computedFilterValue:wo,computedFiltered:Ba,computedFilterable:Wp,computedGroupable:$i,computedGroupedBy:Ha,computedGroupedByIndex:qp,computedWidth:rt,computedAbsoluteOffset:Gt,computedPinningOffset:Vn,computedVisibleIndexInCategory:Nt,computedOffset:O,computedSortable:Yp,computedSortInfo:se,computedSortIndex:Re,computedMultiSort:h,computedSorted:fe,computedSortedAsc:ae,computedSortedDesc:ye,computedVisibleIndex:J,computedPinned:Ge,computedDraggable:w??g.defaultDraggable??S??Qm,computedFirstInCategory:Kp,computedLastInCategory:Bp,computedFirst:L===0,computedLast:Ft,id:v,header:g.header??V.header??g.name??g.field};k&&(O+=rt,X.set(Be.id,Be),q[L]=Be,Ge==="start"&&(ue.push(Be),he+=Be.computedWidth),Ge==="end"&&(Q.push(Be),ge+=Be.computedWidth),Ge||(H.push(Be),ie+=Be.computedWidth),oe=Ge),Be.groupByForColumn&&(Be.computedSortType=g.sortType||V.sortType||oh(Be.groupByForColumn,t,P),Me.push(Be)),ne.set(Be.id,Be),Be.field&&!Be.groupByForColumn&&!tt.has(Be.field)&&tt.set(Be.field,Be)}),Me.forEach(g=>{g.computedSortable=fs(g,{fieldsToColumn:tt,userColumns:t,columnTypes:P,sortable:m,columnDefaultSortable:A})});let Ze=new Map;de.forEach(g=>{let v=ne.get(g);v&&Ze.set(g,v)}),ne.forEach(g=>{Ze.has(g.id)||Ze.set(g.id,g)});let ct=s!=null?Math.min(s,he):he,gt=c!=null?Math.min(c,ge):ge;return{computedRemainingSpace:e.width-(ee+xe+Se),computedPinnedStartColumnsWidth:he,computedPinnedEndColumnsWidth:ge,computedUnpinnedColumnsWidth:ie,computedColumnOrder:B,computedPinnedStartColumns:ue,computedPinnedEndColumns:Q,computedUnpinnedOffset:he,computedPinnedEndOffset:he+ie,computedUnpinnedColumns:H,computedVisibleColumns:q,computedColumnsMap:ne,computedColumnsMapInInitialOrder:Ze,computedVisibleColumnsMap:X,computedPinnedEndWidth:gt,computedPinnedStartWidth:ct,renderSelectionCheckBox:q.reduce((g,v)=>g||!!v.renderSelectionCheckBox,!1),fieldsToColumn:tt}};function fs(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??ko,d=o.sortType??o.colType.sortType;return d!=null&&d!==Ot&&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 w=n.get(C),S=w?m.getColumnApi(w.id):void 0;if(w&&S)b=S.isSortable();else{let T=tn(r,C);if(T){let I=gr(T,{colType:gn(T,a??{}),sortable:e,columnDefaultSortable:i});b=typeof I=="boolean"?I:void 0}else b=!1}}return b===void 0&&y.valueGetter&&(b=!0),b??i??ko},!0)}}function Je(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 Jn(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=Je(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 Ne="Infinite",Le={rootClassName:Ne};var Lo=`${Ne}HeaderCell__filter`,yr=`${Ne}HeaderCell__filterOperator`,ps=`${Lo}__input`;import{computed as on,defineComponent as $h,h as Ue,inject as Uh,provide as qh,ref as wu,shallowRef as Yh,Teleport as Zh}from"vue";function U(o){return o.slice(4,-1)}function zo(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===null?i.push(...t.map(l=>`${l}--row-partially-selected`)):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(" ")}import{nextTick as Ph}from"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 ms(o,t){let e=Math.atan2(o.top-t.top,o.left-t.left);return e<=0&&(e=2*Math.PI+e),e}function hs(o,t){return Math.sqrt((t.top-o.top)**2+(t.left-o.left)**2)}function ih(o,t,e){let n=ms(o,e),i=ms(t,e);return n===i?hs(e,t)-hs(e,o):n-i}function gs(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)=>ih(n,i,e)),t}function rh(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 ah(o,t){if(o.length<2)return o[0]?o[0].left===t.left&&o[0].top===t.top:!1;o=gs(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 ys(o,t){if(rh(o))return ah(o,t);o=gs(o);let[e]=o;for(let n=1,i=o.length-1;n<i;n++){let r=o[n],a=o[n+1];if(lh([e,r,a],t))return!0}return!1}function lh(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 yn=class{containsPoint(t){return ys(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 bn=class o extends yn{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 sh(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 Ae({top:n,left:e,width:a-e,height:d-n})}var Ae=class o extends yn{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=sh(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 bn(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 Cn(o){if(!o)return!1;let t=o.tagName;return t==="INPUT"||t==="BUTTON"}var bs="_1yeub2v0 _16lm1iw1 _16lm1iw1p _16lm1iw2f _16lm1iw0",Cs="_1yeub2vs",Ts="_1yeub2vr",Ss=we({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 br="_1yeub2vp";var tv=we({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 Cr=`${Ne}Body`,ws=o=>o.querySelector(`.${Cr}`);var nn=`${Ne}HeaderCell`,Tr=`${Ne}HeaderWrapper`,vs=o=>Array.from(o.querySelectorAll(`.${Tr}`));function Tn(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 Rs(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 Ie={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)"}}},Is="column-header-height";var xs=`.${Le.rootClassName}`;function Sr(o){return Tn(o,xs)}var Ps=U(j.scrollLeft),uh=U(j.scrollTop),dh=U(j.columnWidthAtIndex),wr=U(j.columnOffsetAtIndex),Ds=U(j.columnReorderEffectDurationAtIndex),ch=U(j.columnOffsetAtIndexWhileReordering),fh=U(j.columnVisibilityAtIndex),ph=U(j.columnZIndexAtIndex);function St(o,t,e){let n=e?Sr(e):document.querySelector(xs);mh(o,t,n)}function mh(o,t,e){if(e){let n=o,i=j[n]?U(j[n]):o;e.style.setProperty(i,`${t}`)}}function Sn(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 vr(o,t,e){St(`${wr}-${o.computedVisibleIndex}`,o.computedPinned?`calc( ${o.computedAbsoluteOffset+t}px + var(${Ps}))`:`${o.computedAbsoluteOffset+t}px`,e)}function Rr(o,t,e){St(`${ph}-${o}`,`${t}`,e)}function Qn(o,t,e){St(`${ch}-${o}`,typeof t=="number"?`calc( var(${wr}-${o}) + ${t}px )`:t,e)}function eo(o,t,e){St(`${fh}-${o}`,t,e)}function Vo(o,t,e){St(`${Ds}-${o}`,e??"",t)}function Ir(o,t){let e=`${Ds}-${o}`;St(e,Ie.components.Cell.reorderEffectDuration,t)}var Ce={columnWidths:{get(o){return`var(${this.getVarName(o)})`},getVarName(o){return this.varName.get(o)},varName:{get(o){return`${dh}-${o}`}},set(o,t,e){t=typeof t=="number"?t+"px":t,St(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`${wr}-${o}`}},set(o,t,e){t=typeof t=="number"?t+"px":t,St(this.varName.get(o),t,e)}}};function As(o,t){Sn({[Ps]:`${o.scrollLeft}px`,[uh]:`${o.scrollTop}px`},t)}var to={bodyWidth:{name:U(Ie.runtime.bodyWidth),value:""},totalVisibleColumnsWidthValue:{name:U(Ie.runtime.totalVisibleColumnsWidthValue),value:""},totalVisibleColumnsWidthVar:{name:U(Ie.runtime.totalVisibleColumnsWidthVar),value:""},visibleColumnsCount:{name:U(Ie.runtime.visibleColumnsCount),value:""},browserScrollbarWidth:{name:U(Ie.runtime.browserScrollbarWidth),value:""}},hh=U(j.scrollbarWidthHorizontal),_s=U(j.scrollbarWidthVertical),gh=U(j.columnWidthAtIndex),yh=U(j.columnZIndexAtIndex),Es=U(j.scrollLeft),bh=U(j.activeCellColWidth),Ms=U(j.activeCellColOffset),ks=U(j.baseZIndexForCells),Ch=U(j.pinnedStartWidth),Fs=U(j.bodyWidth),Th=U(j.bodyHeight),Ns=U(j.pinnedEndOffset),Os=U(j.pinnedEndWidth),Sh=U(j.computedVisibleColumnsCount);function xr(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(${ks}) `+(e<0?"-":"+")+` ${Math.abs(e)} )`:"auto"}function Ls(o){let{computedVisibleColumns:t,computedPinnedStartColumns:e,computedPinnedEndColumns:n,computedPinnedStartColumnsWidth:i,computedPinnedEndColumnsWidth:r,computedUnpinnedColumnsWidth:a,bodySize:l,activeCellIndex:u,brain:d,scrollbars:s}=o,c=Tt(),f=[],m=t.reduce((p,h)=>{let y=h.computedVisibleIndex;p[Ce.columnWidths.varName.get(y)]=h.computedWidth+"px",p[Ce.columnOffsets.varName.get(y)]=h.computedPinned==="start"?`calc( ${h.computedOffset}px + var(${Es}) )`:h.computedPinned==="end"?`calc( var(${Ns}) ${f.length?"+":""} ${f.map(b=>Ce.columnWidths.get(b.computedVisibleIndex)).join(" + ")} + var(${Es}) )`:`${h.computedOffset}px`;let C=xr(h,{pinnedStartColsCount:e.length,visibleColsCount:t.length});return p[`${yh}-${y}`]=`${C}`,h.computedPinned==="end"&&f.push(h),p},{});if(l.width&&(m[to.browserScrollbarWidth.name]=`${Tt()}px`),m[to.bodyWidth.name]=`calc(${j.bodyWidth} - ${j.scrollbarWidthVertical})`,m[to.totalVisibleColumnsWidthValue.name]=`${i+r+a}px`,m[to.totalVisibleColumnsWidthVar.name]=`calc(${t.map((p,h)=>`var(${gh}-${h})`).join(" + ")})`,m[to.visibleColumnsCount.name]=t.length,u!=null){m[bh]=Ce.columnWidths.get(u[1]);let p=Ce.columnOffsets.get(u[1]);if(d.isHorizontalLayoutBrain){let h=d.getPageIndexForRow(u[0]);m[Ms]=h?`calc( ${Ie.runtime.totalVisibleColumnsWidthVar} * ${h} + ${p})`:p}else m[Ms]=p}return m[Sh]=t.length,m[hh]=s.horizontal?`${c}px`:"0px",m[_s]=s.vertical?`${c}px`:"0px",m[Ch]="calc( "+e.map(p=>Ce.columnWidths.get(p.computedVisibleIndex)).join(" + ")+")",m[Os]="calc( "+n.map(p=>Ce.columnWidths.get(p.computedVisibleIndex)).join(" + ")+")",m[ks]=t.length*10,m[Ns]=`calc( var(${Fs}) - var(${Os}) - var(${_s}) )`,m[Fs]=`${l.width}px`,m[Th]=`${l.height}px`,m}var no=(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 Pr(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 no(n,s,d)}else{let l=t.indexOf(i),u=t[l+1],d=n.indexOf(u),s=n.indexOf(i);return no(n,s,d)}return t}var Bs=Gn(wn());function Go(o){return o.map(t=>t instanceof Ut?t:new Ut(null,[t]))}var Ut=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=>wh(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 wh(o,t){return typeof o=="string"||typeof o=="number"?`${o}`:t?o.__get(t):o.done()}var vh=(...o)=>new Ut("+",Go(o)),Vs=(...o)=>new Ut("-",Go(o)),Rh=(...o)=>new Ut("*",Go(o)),Ih=(...o)=>new Ut("/",Go(o)),oo={add:vh,subtract:Vs,minus:Vs,multiply:Rh,divide:Ih};var Gs=o=>{let t=null,e=null;return{stop(){t!==null&&Qt(t),e!=null&&Qt(e)},scroll(n){t!==null&&Qt(t),e!=null&&Qt(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 Ks=10,xh=U(j.pinnedStartWidth);function Hs(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 w(H){let q=H==="start"?z:K;return M===O?q:O===H?q+P.computedWidth:M===H?q-P.computedWidth:q}function S(H){if(H.columnIndex===D||C!=null)return!0;let q=t[H.columnIndex];if(q.computedPinned)return!0;let X=l.getScrollPosition().scrollLeft,ne=q.computedOffset+(C!=null&&b!=null?b*C:0);return ne>=X+w("start")&&ne+q.computedWidth<=X+s.width-w("end")}let T=(H,q)=>{let{restrictToParentGroup:X,dragColumn:ne}=q,ie=[];if(H.forEach(ge=>{if(ge.computedVisibleIndex===D)return;let oe={columnId:ge.id,columnIndex:ge.computedVisibleIndex,offsetX:ge.computedOffset+Math.round(ge.computedWidth/2)};S(oe)&&ie.push(oe)}),X){let oe=function(ee,Se,xe){let be=H[ee];be&&(be.columnGroup!==ne.columnGroup&&xe.add(be.id),oe(ee+Se,Se,xe))};var he=oe;let ge=ne.computedVisibleIndex,$=new Set;oe(ge-1,-1,$),oe(ge+1,1,$),ie=ie.filter(ee=>!$.has(ee.columnId))}return ie},x=i.length,F={clientX:Math.round(o.initialMousePosition.clientX),clientY:Math.round(o.initialMousePosition.clientY)},N={left:F.clientX-s.left-(F.clientX-u.left)+Ks,top:F.clientY-s.top-(F.clientY-u.top)+Ks},R=l.getScrollPosition(),A=t.map(H=>H.computedVisibleIndex),E=A,P=e.get(r),D=P.computedVisibleIndex,M=P?.computedPinned,_=D,O=M,z=l.getFixedStartColsWidth(),K=l.getFixedEndColsWidth(),B=F,G={x:0,y:0},le=1,Z=0;function De(H){let q=Math.round(H.clientX),X=Math.round(H.clientY);if(q===B.clientX&&X===B.clientY)return Ae.from(u).shift({left:G.x,top:G.y});B={clientX:q,clientY:X};let ie=l.getScrollPosition().scrollLeft-R.scrollLeft;return G.x=B.clientX-F.clientX,G.y=B.clientY-F.clientY,Z=G.x+ie,le=Z<0?-1:1,m({left:N.left+G.x,top:N.top+G.y}),Ae.from(u).shift({left:G.x,top:G.y})}function me(H){let q=0;M?M==="start"&&H.forEach((X,ne)=>{q||t[X]?.computedPinned!=="start"&&(q=ne)}):H.forEach((X,ne)=>{t[X]?.computedPinned==="start"&&(q=ne+1)}),x=q,ve("start",H,q)}function ve(H,q,X){if(H==="start"){let ne=0;for(let ie=0;ie<X;ie++){let he=q[ie],ge=t[he];ne+=ge.computedWidth}St(xh,`${ne}px`,a)}}function Oe(H){if(H==null||H===_)return;if(_===-1&&H!==-1&&(eo(D,"",a),p(!1)),_=H,H===-1){Ee(D);return}let q=no(A,D,_>D?_-1:_);x=0;let ne=new Set;return q.forEach((ie,he)=>{let ge=E[he];ie!==ge&&ne.add(ie),me(q)}),E=q,Te(ne),{newColumnIndexes:q,indexesWithTransition:ne,pinnedStartCount:x}}function Ee(H){E=E.filter(X=>X!==H),t.forEach(X=>{let ne=X.computedVisibleIndex,ie=ne>H;Ir(ne,a);let he="";ie&&(he=oo.minus(Ce.columnOffsets.get(ne),Ce.columnWidths.get(H)).done()),Qn(ne,he,a)}),eo(H,"hidden",a),p(!0)}function Te(H){t.forEach(q=>{let X=q.computedVisibleIndex;H.has(X)?Ir(X,a):Vo(X,a);let ne=X===D,ie=le===-1?X<_||X>D:X<D||X>=_,he="";le===-1?he=ne?Ce.columnOffsets.get(_):ie?Ce.columnOffsets.get(X):oo.add(Ce.columnOffsets.get(X),Ce.columnWidths.get(D)).done():he=ie?Ce.columnOffsets.get(X):ne?oo.add(Ce.columnOffsets.get(_-1),Ce.columnWidths.get(_-1)).minus(Ce.columnWidths.get(D)).done():oo.minus(Ce.columnOffsets.get(X),Ce.columnWidths.get(D)).done(),Qn(X,he,a)})}let _e=s.left+w("start"),ue=s.right-w("end"),Q=Gs({scrollOffsetStart:_e,scrollOffsetEnd:ue});return De(F),{speedScroller:Q,stop(){Q.stop()},onMove(H){let q=De(H);if(h().dropTargetListId==="grouping-toolbar"||f&&!c.containsPoint(q.getCenter()))return f&&Oe(-1),null;Q.scroll({mousePosition:B,get scrollLeft(){return l.getScrollPosition().scrollLeft},set scrollLeft(oe){y.scrollLeft=oe}});let X=T(t,{dragColumn:P,restrictToParentGroup:d==="group"}),ne=le===-1?P.computedOffset+Z:P.computedOffset+P.computedWidth+Z,ie=(0,Bs.default)(X,ne,({offsetX:oe},$)=>oe<$?-1:oe>$?1:0);ie<0&&(ie=~ie),X.length?ie=X[ie]?X[ie].columnIndex:X[X.length-1].columnIndex+1:(t.length>1&&console.error("No breakpoints available, something is wrong!"),ie=0),ie===D+1&&(ie=D),Oe(ie);let he={};n.forEach(oe=>{he[oe.id]="end"});for(let oe=0;oe<x;oe++){let $=E[oe],ee=t[$];he[ee.id]="start"}let ge=E.map(oe=>t[oe].id);return{columnPinning:he,columnOrder:ge}}}}var Dh=U(j.baseZIndexForCells),Ah=(o,t)=>{let e=!o||Object.keys(o).length===0,n=!t||Object.keys(t).length===0;return e&&n?!0:!!o!=!!t?!1:jt(o,t)},_h=()=>({dragSourceListId:null,dropTargetListId:null,dragItemId:"",status:"accepted"});function Ws(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&&Cn(p.target))return;let h=i(),y=u().domRef,{brain:C,draggableColumnsRestrictTo:b}=u(),{computedVisibleColumns:w,computedVisibleColumnsMap:S,computedPinnedStartColumns:T,computedUnpinnedColumns:I,computedPinnedEndColumns:x}=d(),F=S.get(t);if(!F||!F.computedDraggable){f(p);return}let N=n.current,R=N.getBoundingClientRect(),A=y.current.getBoundingClientRect(),E=C.getAvailableSize(),P=F.computedVisibleIndex,D=C.getVirtualColIndex(F.computedVisibleIndex,{pageIndex:h||0}),M=C.isHorizontalLayoutBrain?C.getPageWidth():null,_=N.style.cursor??"auto",O=!1,z=y.current,K=Ae.from(ws(z).getBoundingClientRect()),B=vs(z).map(Te=>Ae.from(Te.getBoundingClientRect())),G=K.getMinimumBoundingRectangle(...B),le=Hs({brain:C,horizontalLayoutPageIndex:h,allowColumnHideOnDrag:r,pageWidth:M,draggableColumnsRestrictTo:b,computedPinnedEndColumns:x,computedPinnedStartColumns:T,computedUnpinnedColumns:I,computedVisibleColumns:w,computedVisibleColumnsMap:S,dragColumnHeaderTargetRect:R,dragColumnId:t,getCurrentDragSourceAndTarget:_h,api:c,infiniteDOMNode:y.current,setProxyPosition:Te=>{a.value=Te},setDragColumnOutside:Te=>{l.value=Te},tableRect:A,acceptDropToReorderRect:G,initialMousePosition:{clientX:p.clientX,clientY:p.clientY}}),Z=null,De,me;function ve(Te){let{columnPinning:_e,columnOrder:ue}=Te;Ah(u().columnPinning,_e)||(s.columnPinning=_e);let Q=d().computedColumnOrder;s.columnOrder=Pr({newColumnOrder:ue,visibleColumnOrder:d().computedVisibleColumns.map(H=>H.id),existingColumnOrder:Q,dragColumnId:t})}let Oe=Te=>{let{headerBrain:_e,brain:ue}=u();if(!O){O=!0;let Q=ue.keepColumnRendered(D),H=_e.keepColumnRendered(D);if(ue.isHorizontalLayoutBrain){let X=ue.extendRenderRange({start:!0,end:!0,direction:"horizontal"}),ne=_e.extendRenderRange({start:!0,end:!0,direction:"horizontal"});me=()=>{X(),ne()}}De=()=>{Q(),H()},s.columnReorderDragColumnId=F.id,h!=null&&(s.columnReorderInPageIndex=h),Rr(P,`calc( var(${Dh}) + 10000 )`,y.current),y.current?.classList.add(br),N.style.cursor="grabbing"}Z=le.onMove(Te)},Ee=Te=>{let _e=Te.pointerId;requestAnimationFrame(async()=>{let{multiSortBehavior:ue}=u(),Q=y.current;Q?.classList.remove(br),le.stop(),C.update({...E}),De?.(),me?.(),N.style.cursor=_,N.hasPointerCapture?.(_e)&&N.releasePointerCapture(_e),N.removeEventListener("pointermove",Oe),N.removeEventListener("pointerup",Ee),a.value=null;let H=c.getColumnApi(F.id)?.isSortable()??!1;!O&&H&&c.toggleSortingForColumn(F.id,{multiSortBehavior:ue==="replace"&&(Te.ctrlKey||Te.metaKey)?"append":ue}),Z?ve(Z):O&&r&&c.setVisibilityForColumn(F.id,!1),s.columnReorderDragColumnId=!1,h!=null&&(s.columnReorderInPageIndex=null),await Ph(),w.forEach(q=>{Vo(q.computedVisibleIndex,Q),eo(q.computedVisibleIndex,"",Q),Qn(q.computedVisibleIndex,"",Q)}),Rr(P,xr(F,{pinnedStartColsCount:T.length,visibleColsCount:w.length}),Q)})};N.addEventListener("pointermove",Oe),N.addEventListener("pointerup",Ee),N.setPointerCapture(p.pointerId)};return{onPointerDown:p=>{d().computedVisibleColumnsMap.get(t)?.computedDraggable?m(p):p.target&&Cn(p.target)||f(p)}}}import{defineComponent as Eh,h as Ko}from"vue";var ot={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 js=Eh({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 Ko("svg",{viewBox:o.viewBox,class:o.className,style:e},o.paths.map(n=>Ko("path",{d:n})))}}});function ft(o,t){let e=n=>Ko(js,{...n,paths:t});return e.displayName=o,e}var $s=ft("IncludesOperatorIcon",ot.includesOperator),Us=ft("StartsWithOperatorIcon",ot.startsWithOperator),qs=ft("EndsWithOperatorIcon",ot.endsWithOperator),Ys=ft("EqualOperatorIcon",ot.eqOperator),Zs=ft("NotEqualOperatorIcon",ot.neqOperator),Xs=ft("GTOperatorIcon",ot.gtOperator),Js=ft("GTEOperatorIcon",ot.gteOperator),Qs=ft("LTOperatorIcon",ot.ltOperator),eu=ft("LTEOperatorIcon",ot.lteOperator),tu=ft("DoneIcon",ot.done),nu=ft("ClearIcon",ot.clear),Dr=o=>Ko(js,{...o,viewBox:"0 -960 960 960",paths:ot.hidden});Dr.displayName="HiddenIcon";var Bo="_1eexc2a7 _1eexc2a6",ou=we({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"]]}),iu=we({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 ru="_1eexc2a5",Ho=we({defaultClassName:"_1eexc2aa",variantClassNames:{direction:{up:"_1eexc2ab",down:"_1eexc2ac",neutral:"_1eexc2ad"}},defaultVariants:{},compoundVariants:[]}),vn="_1eexc2a8";import{defineComponent as Mh,h as Fh,onMounted as Nh,ref as lu,watch as Oh}from"vue";var au="qz8ht90 _16lm1iwk";var qt=Mh({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=lu(e===void 0?!1:e),i=lu(null),r=()=>{i.value&&(i.value.indeterminate=n.value==null)};Nh(r),Oh(()=>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 Fh("input",{...l,class:te("InfiniteCheckBox",au,l.class),type:"checkbox",ref:i,checked:!!n.value,disabled:o.disabled,onChange:a})}}});import{defineComponent as kh,h as Wo}from"vue";function su(o){let t={};return Object.keys(o).forEach(e=>{t[e]=e}),t}var uu=su({"data-name":""}),Ar={[uu["data-name"]]:"menu-icon"},du=`[${uu["data-name"]}="${Ar["data-name"]}"]`;var Lh={width:"100%",pointerEvents:"none"},_r=`${nt}-menu`,io=kh({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={...Lh,borderTop:`${Ie.components.HeaderCell.menuIconLineWidth} solid currentColor`,...o.lineStyle},n=t.default?t.default():[Wo("div",{class:_r,style:e}),Wo("div",{class:_r,style:e}),Wo("div",{class:_r,style:e})];return Wo("div",{...o.domProps,style:o.style,...Ar,onPointerdown:i=>{i.stopPropagation(),o.domProps?.onPointerdown?.(i)},class:te(o.className,ql({menuVisible:o.menuVisible,reserveSpaceWhenHidden:o.reserveSpaceWhenHidden}),nt,`${nt}-menu`)},n)}}});import{defineComponent as zh,h as ro,ref as mu,watch as Vh,onBeforeUnmount as Gh}from"vue";var cu="_1b8djff0 _16lm1iw1p _16lm1iw2f _16lm1iw1 _16lm1iw32";var fu={transition:"width 0.25s, opacity 0.25s"},pu=Object.keys({direction:1,size:1,lineWidth:1,lineStyle:1,style:1,className:1,index:1,forceSize:1});var hu=zh(o=>{let t=mu(!0),e=mu(0),n=null;Vh(()=>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}),Gh(()=>{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={...fu,borderTop:`${a}px solid currentColor`,...o.lineStyle,opacity:e.value},p={};return r===-1&&(p.top="100%"),ro("div",{"data-name":"sort-icon",style:{...o.style,width:`${s}px`},class:te(l,nt,cu,`${nt}-sort`)},[d?ro("div",{"data-name":"index",style:p,class:Xl},`${u}`):null,ro("div",{style:{width:`${f[0]}px`,...m},onTransitionend:i}),ro("div",{style:{width:`${f[1]}px`,...m}}),ro("div",{style:{width:`${f[2]}px`,...m}})])}},{name:"SortIcon",props:[...pu]});var{rootClassName:gu}=Le,wt=`${gu}Cell`,jo=`${gu}Cell_content`;function Er(o){return Math.max(o.width-Tt(),0)}function yu(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 pr({shareSpaceOnResize:i,availableSize:Er(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}))})}import{defineComponent as Bh,h as Tu,ref as Hh}from"vue";function bu(o,{columns:t,shareSpaceOnResize:e,domRef:n}){let i=t[o];return{resize(r){Ce.columnWidths.set(o,i.computedWidth+r,n.current);let a=o+1;if(e){let l=t[a];if(!l)return;Ce.columnWidths.set(a,l.computedWidth-r,n.current),l.computedPinned==="start"?vr(l,r,n.current):Ce.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"){vr(d,r,n.current);continue}d.computedPinned!=="end"&&Ce.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||Ce.columnOffsets.set(l,d.computedOffset+r,n.current)}}}}}function Cu(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;Ce.columnWidths.set(f,p,d),m.computedPinned!=="end"&&(l&&Ce.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"&&Ce.columnOffsets.set(s,c.computedOffset+u,d)}}}}var $o="zneyzh0 _16lm1iw2 _16lm1iw23 _16lm1iw2c _16lm1iw2a _16lm1iwm _16lm1iw35",Uo=we({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"]]}),qo=we({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"]]});import{inject as Kh}from"vue";var ao=Symbol("InfiniteTable");function He(){return Kh(ao)}var{rootClassName:Wh}=Le,jh=`${Wh}HeaderCell_ResizeHandle`,Su=Bh({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=He(),{getState:e}=t,n={current:null},i=Hh(!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"}),I=c.extendRenderRange({start:!0,end:!0,direction:"horizontal"});y=()=>{T(),I()}}h.setPointerCapture(m);let C=bu(o.columnIndex,{columns:o.columns,shareSpaceOnResize:f,domRef:n}),b=(T,{done:I}={})=>{d&&(T=T/(d+1),I&&(T=Math.round(T))),u==="end"&&(T*=-1);let{adjustedDiff:x,constrained:F}=o.computeResize({diff:T,shareSpaceOnResize:f});return i.value!==F&&(i.value=F),C.resize(x),x},w=T=>{b(Math.round(T.clientX-p))},S=T=>{h.releasePointerCapture(m),h.removeEventListener("pointermove",w),h.removeEventListener("pointerup",S);let I=Math.round(T.clientX-p),x=b(I,{done:!0});y(),C.resize(0),o.onResize({diff:x,shareSpaceOnResize:f})};h.addEventListener("pointermove",w),h.addEventListener("pointerup",S)};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 Tu("div",{ref:c=>{n.current=c??null},class:`${jh} ${$o} ${qo({computedPinned:l,computedFirstInCategory:u,computedLastInCategory:d})}`,onPointerdown:r},[Tu("div",{style:s,class:Uo({constrained:i.value,computedPinned:l,computedFirstInCategory:u,computedLastInCategory:d})})])}}});var Xh=U(j.columnWidthAtIndex),Jh=U(j.columnReorderEffectDurationAtIndex),Qh=U(j.columnZIndexAtIndex),eg=U(j.columnVisibilityAtIndex),vu=Symbol("InfiniteHeaderCell");function Yo(){return Uh(vu)}var tg=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||qt;return Ue(u,{domProps:{class:vn},onChange:d=>{if(l){d?i.treeApi.selectAll():i.treeApi.deselectAll();return}d?n.rowSelectionApi.selectAll():n.rowSelectionApi.deselectAll()},checked:r})};function rn(o,t){return o(t)}var Mr=()=>Ue("div",{class:Rl[1]}),Ru=$h({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=He(),{api:e,actions:n,getState:i,getComputed:r,dataSourceContext:a}=t,{getDataSourceState:l,dataSourceApi:u,dataSourceActions:d}=a,s={current:null},c=R=>{let A=R&&R.$el!==void 0?R.$el:R;s.current=A??null,o.domRef(s.current)},f=Yh(null);qh(vu,f);let m=()=>Je(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 R=o.column.id,A=l().filterDelay,E=`${R}:${A}`;if(!p||p.key!==E){let P=D=>{e.setColumnFilter(R,D)};p={key:E,fn:A>0?Jt(P,{wait:A}):P}}return p.fn},y=wu(null),C=wu(!1),{onPointerDown:b}=Ws({columnId:o.column.id,context:{getState:i,getComputed:r,actions:n,api:e},domRef:s,getHorizontalLayoutPageIndex:()=>o.horizontalLayoutPageIndex,allowColumnHideOnDrag:!0,proxyPosition:y,dragColumnOutside:C}),w=on(()=>t.state.value.columnMenuVisibleForColumnId),S=on(()=>t.state.value.columnReorderDragColumnId),T=on(()=>t.state.value.columnReorderInPageIndex),I=on(()=>t.state.value.showColumnFilters),x=on(()=>t.state.value.columnHeaderHeight),F=on(()=>t.state.value.components),N=on(()=>a.state.value.filterTypes);return()=>{let{column:R,columnsMap:A,horizontalLayoutPageIndex:E,headerOptions:P}=o,{allRowsSelected:D,someRowsSelected:M,selectionMode:_}=o,O=R.computedSortInfo,z=R.header,K=m(),B=K.isSortable(),G=P.alwaysReserveSpaceForSortIcon,le=R.headerAlign??R.align,Z=(typeof le=="function"?le({isHeader:!0,column:R}):le)??"start",De=(typeof R.verticalAlign=="function"?R.verticalAlign({isHeader:!0,column:R}):R.verticalAlign)??"center",me=B&&(R.computedSorted||G)?Ue(hu,{index:R.computedMultiSort?R.computedSortIndex+1:void 0,style:{marginInlineStart:Ie.spacing[2],marginInlineEnd:Ie.spacing[2]},className:`${nn}__sort-icon ${Zl} ${Jl({align:Z})}`,direction:R.computedSorted?R.computedSortedAsc?1:-1:0}):null,Oe=R.computedFilterable&&R.computedFiltered?Ue(hn):null,Ee=R.headerCssEllipsis??R.cssEllipsis??!0,Te=w.value,_e=S.value,ue=T.value,Q=_e===R.id,H=ue!=null?E!==ue:!1,q={reserveSpaceWhenHidden:Z==="center",menuVisible:Te===R.id,style:Z==="end"?{marginInlineStart:`calc(${Ie.components.HeaderCell.resizeHandleActiveAreaWidth} / 2)`,marginInlineEnd:Ie.spacing[2]}:{marginInlineEnd:`calc(${Ie.components.HeaderCell.resizeHandleActiveAreaWidth} / 2)`,marginInlineStart:Ie.spacing[2]},domProps:{onMousedown:re=>{re.stopPropagation(),K.toggleContextMenu(re.target)}}},X=R.components?.MenuIcon||F.value?.MenuIcon||io,ne=Ue(X,q),ie=I.value,he=N.value,ge=R.computedFilterType,oe=he[ge],$=R.computedFilterable?R.computedFilterValue?.filter.operator??oe?.defaultOperator:void 0,ee=R.computedFilterable&&oe?oe.operators.find(re=>re.name===$):void 0,Se=ee?.components?.FilterEditor||oe?.components?.FilterEditor||R.components?.FilterEditor||lo,xe=oe?.components?.FilterOperatorSwitch||R.components?.FilterOperatorSwitch||xu,be=R.computedFilterable?Ue(Iu,{filterProps:{horizontalLayoutPageIndex:E,filterEditor:Se,filterOperatorSwitch:xe,operator:ee,filterTypes:he,onChange:h(),columnFilterType:ge,columnLabel:R.field||R.name||R.id,columnFilterValue:R.computedFilterValue,columnHeaderHeight:x.value}}):Ue(Pu),Me={horizontalLayoutPageIndex:E,dragging:Q,domRef:c,htmlElementRef:s,renderLocation:"column-header",column:R,columnsMap:A,columnSortInfo:O,columnFilterValue:R.computedFilterValue,filtered:R.computedFiltered,someRowsSelected:M,allRowsSelected:D,selectionMode:_,api:e,dataSourceApi:u,columnApi:K,renderBag:{sortIcon:me,filterIcon:Oe,menuIcon:ne,menuIconProps:q,selectionCheckBox:null,header:R.header&&typeof R.header!="function"?R.header:R.name}},ze=Me;ze.renderBag.filterEditor=be,f.value=ze;let de={...Me,renderBag:{...Me.renderBag}};if(R.renderSortIcon&&(de.renderBag.sortIcon=rn(R.renderSortIcon,{...de,renderBag:{...de.renderBag}})),R.renderFilterIcon&&(de.renderBag.filterIcon=rn(R.renderFilterIcon,{...de,renderBag:{...de.renderBag}})),typeof R.renderMenuIcon=="function"){let re=rn(R.renderMenuIcon,{...de,renderBag:{...de.renderBag}});de.renderBag.menuIcon=re?re.type===X||re.type===io?re:Ue(X,q,()=>re):null}if(R.renderSelectionCheckBox&&_==="multi-row"){de.renderBag.selectionCheckBox=rn(tg,{...de,renderBag:{...de.renderBag}});let re=R.renderHeaderSelectionCheckBox??R.renderSelectionCheckBox;re&&re!==!0&&(de.renderBag.selectionCheckBox=rn(re,{...de,renderBag:{...de.renderBag}}))}z instanceof Function&&(de.renderBag.header=rn(z,{...de,renderBag:{...de.renderBag}}));let tt=Ee?Ue("div",{class:lt},[de.renderBag.header]):de.renderBag.header,Ze=R.renderMenuIcon===!1?null:de.renderBag.menuIcon,ct=[Z==="center"?Mr():null,de.renderBag.selectionCheckBox,tt,de.renderBag.sortIcon,de.renderBag.filterIcon,Z==="center"?Mr():null,Z!=="center"?Mr():null,Ze],gt=R.renderHeader?rn(R.renderHeader,{...de,renderBag:{...de.renderBag,all:ct}}):ct,Ve={height:`${o.height}px`};R.headerStyle&&(Ve=typeof R.headerStyle=="function"?{...Ve,...R.headerStyle(ze)||{}}:{...Ve,...R.headerStyle});let g=typeof R.headerClassName=="function"?R.headerClassName(ze):R.headerClassName,v=`var(${Qh}-${R.computedVisibleIndex})`;Ve.zIndex=v,Ve.visibility=`var(${eg}-${R.computedVisibleIndex}, visible)`,Ve.width=`var(${Xh}-${R.computedVisibleIndex})`,Ve.transition=`transform var(${Jh}-${R.computedVisibleIndex}, 0s)`;let L={filtered:R.computedFiltered,verticalAlign:De,align:Z},k={"data-field":`${R.field||""}`,"data-column-id":R.id,"data-header-align":Z,"data-name":"HeaderCell","data-sort":R.computedSortedAsc?"asc":R.computedSortedDesc?"desc":"none","data-sort-index":`${R.computedSortIndex??-1}`},Y=te(nn,El.none,B?vl.pointer:"",g,zo(R,[nn,wt],Kl,{dragging:Q,insideDisabledDraggingPage:H,align:Z,verticalAlign:De,rowSelected:!1,cellSelected:!1,rowDisabled:!1,zebra:!1,rowActive:!1,firstRow:!0,firstRowInHorizontalLayoutPage:!0,treeNode:!1,groupCell:!1,groupRow:!1,rowExpanded:!1}),Ll,wt,Bo),V=Ue("div",{class:te(jo,Ee?lt:Mo.hidden,zl(L),xl[Z]),style:ie?{height:`${o.height/2}px`}:void 0},[gt]),J=re=>yu({context:{getState:i,getComputed:r},column:R,diff:re.diff,shareSpaceOnResize:re.shareSpaceOnResize}),ce=R.computedResizable?Ue(Su,{horizontalLayoutPageIndex:E,columns:r().computedVisibleColumns,columnIndex:R.computedVisibleIndex,computeResize:J,onResize:re=>{let{columnSizing:rt,reservedWidth:Et}=J(re);re.shareSpaceOnResize||(n.viewportReservedWidth=Et),n.columnSizing=rt}}):null,se=[ie?be:null,ce],fe={ref:c,...k,"data-z-index":v,style:Ve,class:Y,onPointerdown:b},ae=null,ye=i().portalDOMRef.current;Q&&y.value&&ye&&(ae=Ue(Zh,{to:ye},[Ue("div",{key:R.id,class:`${nn}Proxy ${Vl}`,style:{height:`${o.height}px`,width:`${o.width}px`,left:`${y.value.left??0}px`,top:`${y.value.top??0}px`}},[Ue("div",{class:Gl({visible:C.value})},[Ue(Dr,{size:16})]),de.renderBag.header])]));let Re=R.components?.HeaderCell;return Re?[Ue(Re,fe,{default:()=>[V,se]}),ae]:[Ue("div",fe,[V,se]),ae]}}});var Au=Symbol("InfiniteColumnHeaderFilter"),Zo=o=>o.stopPropagation(),Iu=Fr({name:"InfiniteTableColumnHeaderFilter",props:{filterProps:{type:Object,required:!0}},setup(o){let t=He(),e=Yo(),n=ig(o.filterProps);og(Au,n);let i=Du(!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 Rn("div",{onPointerup:Zo,onPointerdown:Zo,onFocusin:r,onFocusout:a,class:`${Lo} ${dr({active:d})}`,style:{height:`${o.filterProps.columnHeaderHeight}px`}},[Rn(c),Rn(s)])}}}),xu=Fr({name:"InfiniteTableFilterOperatorSwitch",setup(){let o=so();return()=>{let t=o.disabled.value,n=o.operator.value?.components?.Icon??hn;return Rn("div",{"data-name":"filter-operator","data-disabled":t,onMousedown:i=>{i.stopPropagation(),!t&&o.columnApi.toggleFilterOperatorMenu(i.target)},class:te(yr,jl,t?`${yr}--disabled`:"")},[Rn(n,{size:20,className:`${$l({disabled:!!t})}`})])}}}),Pu=Fr({name:"InfiniteTableColumnHeaderFilterEmpty",setup(){return()=>Rn("div",{onPointerup:Zo,onPointerdown:Zo,class:`${Lo} ${dr({active:!1})} ${Il["50%"]}`})}});function so(){let o=He(),t=Yo(),e=ng(Au),{api:n,getComputed:i,getState:r,actions:a,dataSourceContext:l}=o,{getDataSourceState:u,dataSourceApi:d,dataSourceActions:s}=l,c=vt(()=>t.value.column),f=vt(()=>{let{columnFilterType:w,filterTypes:S}=e.value;return S[w]}),m=Du(e.value.columnFilterValue?.filter.value??"");rg(()=>e.value.columnFilterValue?.filter.value,w=>{if(e.value.columnFilterValue)m.value!==w&&(m.value=w);else{let S=f.value;if(S){let T=[...S.emptyValues][0];T!==m.value&&(m.value=T)}}});let p=w=>{m.value=w,e.value.onChange(w)},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=vt(()=>`Filter for ${Jn(c.value,C,"column-filter")}`);return{api:n,column:c,columnFilterValue:vt(()=>e.value.columnFilterValue),columnApi:t.value.columnApi,operator:vt(()=>e.value.operator),operatorName:vt(()=>e.value.operator?.name),value:m,disabled:vt(()=>e.value.columnFilterValue?.disabled),filterType:f,filterTypes:vt(()=>e.value.filterTypes),filterTypeKey:vt(()=>e.value.columnFilterType),filtered:vt(()=>c.value.computedFiltered),setValue:p,clearValue:h,removeColumnFilter:y,ariaLabel:b,className:`${Hl} ${ps}`}}var lo=_u({name:"StringFilterEditor",setup(){let o=so();return()=>Eu("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})}}),Nr=_u({name:"NumberFilterEditor",setup(){let o=so();return()=>Eu("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 Rt=(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",...Rt(n,"includes"),label:"Includes",fn:({currentValue:i,filterValue:r})=>typeof i=="string"&&typeof r=="string"&&i.toLowerCase().includes(r.toLowerCase())},{label:"Equals",...Rt(n,"eq"),name:"eq",fn:({currentValue:i,filterValue:r})=>typeof i=="string"&&i===r},{name:"startsWith",...Rt(n,"startsWith"),label:"Starts With",fn:({currentValue:i,filterValue:r})=>i.startsWith(r)},{name:"endsWith",...Rt(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",...Rt(n,"eq"),name:"eq",fn:({currentValue:i,filterValue:r})=>i==r},{label:"Not Equals",...Rt(n,"neq"),name:"neq",fn:({currentValue:i,filterValue:r})=>i!=r},{name:"gt",label:"Greater Than",...Rt(n,"gt"),fn:({currentValue:i,filterValue:r,emptyValues:a})=>a.includes(i)?!0:i>r},{name:"gte",...Rt(n,"gte"),label:"Greater Than or Equal",fn:({currentValue:i,filterValue:r,emptyValues:a})=>a.includes(i)?!0:i>=r},{name:"lt",...Rt(n,"lt"),label:"Less Than",fn:({currentValue:i,filterValue:r,emptyValues:a})=>a.includes(i)?!0:i<r},{name:"lte",...Rt(n,"lte"),label:"Less Than or Equal",fn:({currentValue:i,filterValue:r,emptyValues:a})=>a.includes(i)?!0:i<=r}]}}}var Xn=Mu({StringFilterEditor:lo,NumberFilterEditor:Nr,icons:{includes:$s,eq:Ys,neq:Zs,startsWith:Us,endsWith:qs,gt:Xs,gte:Js,lt:Qs,lte:eu}});var Xo=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 W(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 W(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 pt=class extends Xo{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 Jo=class{constructor(){this.primaryKeyToData=new Map;this.nodePathsToData=new W;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,w=b?n?.getMutationsForNodePath(C):n?.getMutationsForPrimaryKey(y);if(w&&w.length){for(let S=0,T=w.length;S<T;S++){let I=w[S];if(I.type==="delete"&&!h&&(b?this.removeNodePath(C,e):this.remove(y),h=!0,c.splice(m,1),m--),I.type==="update"&&!h&&(p={...p,...I.data},c[m]=p),I.type==="update-children"&&!h){let x=I.children(p[l],p);p={...p},x!==void 0?p[l]=x:delete p[l],c[m]=p}I.type==="insert"&&(I.position==="before"?(c.splice(m,0,I.data),m--):c.splice(m+1,0,I.data))}b?n?.removeNodePathInfo(C):n?.removeInfo(y)}if(!h)if(b){this.addNodePath(C,p);let S=a(p),T=S?null:r(p);!S&&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 Qo(o,t){return o&&o.filter(e=>{let n=t[e.filter.type];return!(!n||n.emptyValues&&n.emptyValues.includes(e.filter.value))})}var Fu=new WeakMap;function ei(o,t){if(!o||!o.length)return[];let e=Fu.get(o);e||(e=new WeakMap,Fu.set(o,e));let n=e.get(t);if(n)return n;let i=[],r=Qo(o,t)||[];for(let a=0,l=r.length;a<l;a++){let u=r[a],d=t[u.filter.type];if(u.disabled||!d)continue;let s;for(let c=0;c<d.operators.length;c++){let f=d.operators[c];f.name===u.filter.operator&&(s=f.fn)}s&&i.push({field:u.field,valueGetter:u.valueGetter||d.valueGetter,fn:s,value:u.filter.value,emptyValues:d.emptyValues})}return e.set(t,i),i}function Or(o,t){if(!o.length)return!0;let{data:e}=t,n={data:e,index:t.index,dataArray:t.dataArray,primaryKey:t.primaryKey,field:void 0,filterValue:void 0,currentValue:void 0,emptyValues:[]};for(let i=0,r=o.length;i<r;i++){let a=o[i];if(n.field=a.field,n.filterValue=a.value,n.currentValue=a.valueGetter?a.valueGetter(n):a.field?e[a.field]:e,n.emptyValues=a.emptyValues,!a.fn(n))return!1}return!0}var ag=0;function Nu(o){return ag++,Or(ei(o.filterValue,o.filterTypes),o)}function kr(o){return ei(o.filterValue,o.filterTypes).length?o.isLeafNode?Nu(o):o.filterTreeNode(o.data):!0}var lg="group-by",Ou="group-by-";function ku(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 ti(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===lg){let r=ku(t);return r==null?i:(e=!0,{...i,field:r})}if(i.id.startsWith(Ou)){let r=i.id.slice(Ou.length),a=t.find(u=>String(u.field)===r||u.groupField===r);if(!a)return i;let l=ku([a]);return l==null?i:(e=!0,{...i,field:l})}return i});return e?n:o}function It(){let o=Fe().performance?.now();return`${Date.now()}:${o}`}var Lu=!0,sg={originalDataArray:!0,changes:!0},ug={filterValue:(o,t)=>JSON.stringify(o)===JSON.stringify(t),groupRowsState:(o,t)=>JSON.stringify(o)===JSON.stringify(t)};function xt(o,t,e){let n=ti(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=[],o.selectionMode==="multi-row"&&(r.multiRowSelectionTarget=o.multiRowSelectionTarget)),t&&Object.assign(r,t),r.filterValue&&r.filterValue.length){let u=Vu(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)&&!sg[u]){let d=u,s=ug[d],c=r[d],f=l[d];(s?s(c,f):c===f)||(a[d]=!0)}return r.changes=a,r}function In(o,t,e,n,i){let r=xt(t,n,i),a=r.append;if(t.lazyLoad){let s=t.originalLazyGroupData,c=[at,...r.groupKeys||[]],f=s.get(c);if(!f){let m=[...r.groupKeys||[],r.lazyLoadStartIndex??0];t.lazyLoadCacheOfLoadedBatches.set(m,!0)}if(f&&f.cache&&c.length>1){let m=f.children,p=m.length,h=!0;for(let y=0;y<p;y++)if(m[y]==null){h=!1;break}if(h)return Promise.resolve(!0)}f?f.childrenLoading||(f.childrenLoading=!0):s.set(c,{error:void 0,children:[],childrenLoading:!0,childrenAvailable:!1,cache:Lu,totalCount:0}),e.originalLazyGroupDataChangeDetect=It()}if(typeof o=="function")try{o=o(r)}catch(s){o=Promise.reject(s)}let u=typeof o=="object"&&typeof o.then=="function"&&(!t.lazyLoad||t.lazyLoad&&!a);u&&(e.loading=!0);let d=s=>{if(console.error('The DataSource "data" function failed:',s),t.lazyLoad){let c=r.groupKeys||[],f=t.originalLazyGroupData.get([at,...c]),m=s instanceof Error?s.message:String(s);if(c.length&&f&&!f.childrenAvailable)f.childrenLoading=!1,f.cache=!1,f.error=m,e.originalLazyGroupDataChangeDetect=It();else{let p=t.lazyLoadCacheOfLoadedBatches,h=[...c,r.lazyLoadStartIndex??0];p.has(h)&&p.set(h,"failed"),f&&(f.childrenLoading=!1,f.error=m)}}u&&(e.loading=!1)};return Promise.resolve(o).then(s=>{let c=[],f=!1;if(Array.isArray(s.data)){let p=s;if(c=p.data,p.livePaginationCursor!==void 0&&(e.livePaginationCursor=p.livePaginationCursor),p.mappings&&(e.pivotMappings=p.mappings),t.lazyLoad||(e.unfilteredCount=p.totalCountUnfiltered??c.length),t.lazyLoad){let y=function(C,b,w){let S=[at,...C],T=b.data,I={cache:b.cache??Lu,childrenLoading:!1,childrenAvailable:!0,totalCount:b.totalCount??T.length,totalCountUnfiltered:b.totalCountUnfiltered,totalChildrenCount:b.totalChildrenCount,totalChildrenCountUnfiltered:b.totalChildrenCountUnfiltered,children:T,error:b.error},x=[];if(r.lazyLoadBatchSize&&!w){let N=h.get(S),R=!N,A=us({children:!0},N||{},I);R&&(A.chidren=[]),A.children.length=A.totalCount;let E=r.lazyLoadStartIndex??0,P=Math.min(b.totalCount??T.length,E+r.lazyLoadBatchSize);for(let D=E;D<P;D++){let M=I.children[D-E];if(!M)throw`lazily loaded item not found at index ${D-E}`;A.children[D]=M,M.dataset&&x.push({keys:M.keys,dataset:M.dataset})}R&&h.set(S,A)}else I.children.forEach(N=>{N&&N.dataset&&x.push({keys:N.keys,dataset:N.dataset})}),I.children.length=I.totalCount,h.set(S,I);let F=!1;if(!C||!C.length){let N=h.get([at]);e.originalDataArray=[...N.children],F=!0}if(F||(e.originalLazyGroupDataChangeDetect=It()),x.length){let N=C;x.forEach(({keys:R,dataset:A})=>{y(R,A,N)})}};var m=y;let h=t.originalLazyGroupData;f=!0,y(r.groupKeys||[],p)}}else c=s;f||(e.originalDataArray=a?t.originalDataArray.concat(c):c),u&&(e.loading=!1)}).catch(d)}function Vu(o,{filterTypes:t,filterMode:e}){return e==="local"?!o||!o.some(n=>n.valueGetter)?o:o.map(zu):(Qo(o,t)||[]).map(zu)}function zu(o){if(!o.valueGetter)return o;let t={...o};return delete t.valueGetter,t}function Gu(){let o;return(t,e,n)=>{if(o&&o.filterValue===t&&o.filterTypes===e&&o.filterMode===n)return o.result;let i=Vu(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 dg=()=>new Promise(o=>{ke(o)});function Lr(o,t){let e=!!o,{stateReadyAsDetails:n}=t(),i=e&&o.shouldRestoreState?n:!0;return{isDetail:e,isDetailReady:i}}function Ku(o){let{lazyLoad:t,lazyLoadBatchSize:e,lazyLoadCacheOfLoadedBatches:n}=o;if(!t||!e||e<=0)return!1;for(let i of n.keys())if(i.length===1)return!0;return!1}function Bu(o){for(let[t,e]of o.entries())e==="failed"&&o.delete(t)}function Hu(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 W,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 w=b.length?b:f,S=y.dataSourceHasGrouping?y.indexInGroup:y.indexInAll;if(y.isGroupRow&&!y.collapsed&&!y.childrenAvailable){let T={lazyLoadStartIndex:0,lazyLoadBatchSize:i,groupKeys:y.groupKeys,append:s},I=y.groupKeys,x=c.get(I);if(!x?.[y.id]){let F=!x;x=x||{},x[y.id]||(x[y.id]=T),F&&c.set(I,x)}}if(!C&&i!=null){let T=c.get(w),I=Math.floor(S/i)*i,x=S-I,F=u[y.indexInAll-x].indexInAll,N=d(F),R=u[F].id;if(N||T?.[R])continue;let A=!T;T=T||{};let E={lazyLoadStartIndex:I,lazyLoadBatchSize:i,groupKeys:b,append:s};T[R]||(T[R]=E),A&&c.set(w,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(()=>dg()).then(()=>In(...b))},m)}var cg=Object.freeze([]),Wu=(o,t)=>{let e=o??cg,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};var xn=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 st=class extends xn{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 Qe=class{constructor(t){this.collapsedPathsMap=new W;this.expandedPathsMap=new W;this.collapsedIdsMap=new Map;this.expandedIdsMap=new Map;this._mode="path";this.defaultExpanded=!1;this.expandAll=()=>{this.update({defaultExpanded:!0,collapsedPaths:[]})};this.collapseAll=()=>{this.update({defaultExpanded:!1,expandedPaths:[]})};let 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}}};function ni(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(!ni(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)||!ni(o[i],t[i]))return!1;return!0}return!1}function fg(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 oi={id:!0,value:!0,indexInAll:!0,rowSelected:!0,rowDisabled:!0,isCellSelected:!1,hasSelectedCells:!1},ju={...oi,dataSourceHasGrouping:!0,isTreeNode:!0,data:!1,isGroupRow:!0,selfLoaded:!0},pg={indexInGroup:!0,groupKeys:!0,groupBy:!0,rootGroupBy:!0,parents:!1,indexInParentGroups:!0,groupCount:!0,groupNesting:!0,collapsed:!0,selfLoaded:!0},mg={...oi,...pg,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},$u={isTreeNode:!0,isParentNode:!0,indexInParent:!0,nodePath:!0,parentNodes:!1,indexInParentNodes:!0,totalLeafNodesCount:!0,collapsedLeafNodesCount:!0,treeNesting:!0,selfLoaded:!0},hg={...oi,...$u,dataSourceHasGrouping:!0,isTreeNode:!0,isGroupRow:!0,isParentNode:!0,data:!1},gg={...oi,...$u,dataSourceHasGrouping:!0,isParentNode:!0,isGroupRow:!0,nodeExpanded:!0,selfExpanded:!0,data:!1,selectedLeafNodesCount:!0,deepRowInfoArray:!1,deselectedLeafNodesCount:!0,duplicateOf:!1},yg=Object.entries(ju).map(([o,t])=>t?o:void 0).filter(Boolean),bg=Object.entries(ju).map(([o,t])=>t?o:void 0),Cg=Object.entries(mg).map(([o,t])=>t?o:void 0),Tg=Object.entries(hg).map(([o,t])=>t?o:void 0),Sg=Object.entries(gg).map(([o,t])=>t?o:void 0);function wg(o,t){if(o===t)return!0;if(!o||!t||!fg(o,t)||o.id!==t.id||o.data!==t.data&&!ni(o.data,t.data))return!1;let e=[];o.dataSourceHasGrouping?e=o.isGroupRow?Cg:bg:o.isTreeNode?e=o.isTreeNode&&o.isParentNode?Sg:Tg:e=yg;for(let n of e){let i=o[n],r=t[n];if(!(typeof i=="function"||typeof r=="function")&&!ni(i,r))return!1}return!0}function Uu(){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=[],w=l();for(let S of w){let T=p[S],I=f[S];if(I===void 0){b.push(S);continue}wg(T,I)||b.push(S)}o=f,(b.length>0||C)&&queueMicrotask(()=>{for(let S=0,T=b.length;S<T;S++){let I=b[S],x=t.get(I);if(x)for(let F of x)F()}if(C)for(let S of Array.from(e))S()}),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 zr=o=>Array.isArray(o)?new W(o.map(t=>[t,!0])):o,vg=(o,t)=>o.length-t.length,$e=class o{constructor(t,e){this.selectedPaths=null;this.deselectedPaths=null;this.defaultSelection=!1;this.selectionMap=new W;this.cache=new W;this.strictMode=!1;let n=t instanceof Object.getPrototypeOf(this).constructor,i=n?t.getState():t;this.setConfig(e||(n?t.config:{treePaths:new W})),this.disableStrictMode(),this.update(i),this.config.strictCheckPaths&&this.enableStrictMode()}getTreePaths(t){return t?zr(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:zr(e.treePaths),strictCheckPaths:e.strictCheckPaths??!0,multiRowSelectionTarget:e.multiRowSelectionTarget,unfilteredTreePaths:e.unfilteredTreePaths?zr(e.unfilteredTreePaths):void 0},this.xcache()}hasFilteredOutLeavesInside(t){let{multiRowSelectionTarget:e,unfilteredTreePaths:n,treePaths:i}=this.config;return e!=="visible"||!n||n===i?!1:n.getAllChildrenSizeFor(t)>i.getAllChildrenSizeFor(t)}setVisibleLeafNodesSelection(t,e){let{unfilteredTreePaths:n,treePaths:i}=this.config;this.xcache(),i.getKeysForLeafNodesStartingWith(t).forEach(r=>{n.getAllChildrenSizeFor(r)>0||(this.selectionMap.delete(r),this.isNodeSelected(r)!==e&&this.setSelectionForPath(r,e))}),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(){if(this.hasFilteredOutLeavesInside([])){this.setVisibleLeafNodesSelection([],!1);return}this.update({defaultSelection:!1,selectedPaths:[],deselectedPaths:[]})}selectAll(){if(this.hasFilteredOutLeavesInside([])){this.setVisibleLeafNodesSelection([],!0);return}this.update({defaultSelection:!0,deselectedPaths:[],selectedPaths:[]})}enableStrictMode(){this.strictMode=!0}disableStrictMode(){this.strictMode=!1}isPathAvailable(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(vg);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.hasFilteredOutLeavesInside(t)){this.setVisibleLeafNodesSelection(t,e);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 Yt(o,t){return t().dataArray[o]}function ii(o){return o().dataArray}function Dn(o,t){return new $e(o,Pn(t))}function Pn(o){return()=>{let t=typeof o=="function"?o():o,{treePaths:e,unfilteredTreePaths:n,multiRowSelectionTarget:i}=t;return i==="visible"?{treePaths:e,unfilteredTreePaths:n,multiRowSelectionTarget:i}:{treePaths:n??e,multiRowSelectionTarget:i}}}var ri=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 $e))throw"Invalid tree selection";let a=new $e(i,Pn(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 Qe({defaultExpanded:!0,collapsedPaths:[]});this.getState().lastExpandStateInfoRef.current={state:"expanded",nodePath:null},this.actions.treeExpandState=t}collapseAll(){let t=new Qe({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 Qe(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 Qe(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 Qe(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?Yt(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 $e))throw"Invalid node selection";let n=new $e(t,Pn(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 $e))throw"Invalid node selection";let n=new $e(t,Pn(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 $e))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 Vr=new Map,Gr=new Map;var Kr="DebugID=";function An(o,t){return t&&t.startsWith(Kr)?t:t?`${Kr}${o}:${t}`:`${Kr}${o}`}var Rg=Symbol("cursorId"),qu=o=>o.totalLeafNodesCount===0,Ig=o=>o.isParentNode?!qu(o):!0;function Yu(o){let t=Date.now(),e=[],n=[],i=new W;return{logger:Bt(`${o.debugId}:DataSource`),debugTimings:new Map,debugWarnings:new Map,devToolsDetected:!!globalThis.__INFINITE_TABLE_DEVTOOLS_HOOK__,rowInfoStore:Uu(),indexer:new Jo,totalLeafNodesCount:0,__apiRef:{current:null},repeatWrappedGroupRows:!1,destroyedRef:{current:!1},lastSelectionUpdatedNodePathRef:{current:null},lastExpandStateInfoRef:{current:{state:"collapsed",nodePath:null}},idToIndexMap:new Map,idToPathMap:new Map,pathToIndexMap:new W,waitForNodePathPromises:new W,getDataSourceMasterContextRef:{current:()=>{}},cache:void 0,detailDataSourcesStateToRestore:new Map,stateReadyAsDetails:!1,originalDataArrayChanged:!1,originalDataArrayChangedInfo:{timestamp:0,mutations:void 0},rowsPerPage:null,lazyLoadCacheOfLoadedBatches:new W,dataParams:void 0,onCleanup:pe(),notifyScrollbarsChange:pe(),notifyScrollStop:pe(),notifyRenderRangeChange:pe(),pivotTotalColumnPosition:"end",pivotGrandTotalColumnPosition:!1,scrollStopDelayUpdatedByTable:100,originalLazyGroupData:i,originalLazyGroupDataChangeDetect:0,originalDataArray:e,cursorId:Rg,showSeparatePivotColumnForSingleAggregation:!1,propsCache:new Map([["sortInfo",new WeakMap],["rowDisabledState",new WeakMap],["isRowDisabled",new WeakMap],["cellSelection",new WeakMap],["treeSelection",new WeakMap],["treeExpandState",new WeakMap],["groupRowsState",new WeakMap]]),rowInfoReducerResults:void 0,pivotMappings:void 0,pivotColumns:void 0,pivotColumnGroups:void 0,dataArray:n,unfilteredCount:n.length,filteredCount:n.length,updatedAt: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 xg(o){let t={...o};return delete t.originalDataArray,t}var Pg=[],Zu=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()},Xu=(o,t)=>({onDataParamsChange:e=>e?Tl(e,100,xg):void 0,lazyLoad:e=>!!e,isNodeReadOnly:e=>e??qu,isNodeSelectable:e=>e??Ig,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,multiRowSelectionTarget:e=>e??"all",filterDelay:e=>e??200,filterTypes:e=>({...Xn,...e}),sortTypes:e=>({...Wt,...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 st)return e;let n=o.propsCache.get("rowDisabledState"),i=n.get(e);return i||(i=new st(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=>Wu(e,o.propsCache.get("sortInfo")),groupBy:e=>e??Pg});function Dg(o,t){return typeof o=="function"?o({array:t.originalDataArray,length:t.originalDataArray.length,lastItem:t.originalDataArray[t.originalDataArray.length-1]}):o}function Ag(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 _g={selectedPaths:[],deselectedPaths:[],defaultSelection:!1};function Ju(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.
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
`);let n=Pn(e);if(o instanceof $e)return o.setConfig(n),o;(o==null||typeof o!="object")&&(o=void 0);let i=o??_g,r=e.propsCache.get("treeSelection"),a=r.get(i);return a&&a.setConfig(n),a=a??new $e(i,n),r.set(i,a),a}function Qu(o){let{props:t,state:e,oldState:n}=o,i=!!e.nodesKey,r=Kn(t.sortInfo),a=Kn(t.filterValue),{filterTypes:l}=e,u=Object.keys(l).reduce((P,D)=>{let M=l[D].operators;P[D]=P[D]||{};let _=P[D];return M.forEach(O=>{_[O.name]=O}),P},{}),d=t,s=t.selectionMode;if(s===void 0)if(t.cellSelection!==void 0||t.defaultCellSelection!==void 0)s="multi-cell";else{let P=t.rowSelection!==void 0?t.rowSelection:t.defaultRowSelection;if(P!==void 0&&(P&&typeof P=="object"?s="multi-row":s="single-row"),!s){let D=d.treeSelection??d.defaultTreeSelection;D!==void 0&&(s=typeof D=="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 Pe({selectedRows:[],deselectedRows:[],defaultSelection:!1},Ye(e)):s==="single-row"||m instanceof Pe?c=m:c=new Pe(m,Ye(e))),s==="single-cell"||s==="multi-cell"))if(p===null)f=s==="single-cell"?null:new Ke;else if(p instanceof Ke)f=p;else{let P=e.propsCache.get("cellSelection"),D=P.get(p)??new Ke(p);P.set(p,D),f=D}let h=e.primaryKey,y=typeof h=="function"?P=>h(P):P=>P[h],C=d.treeExpandState||e.treeExpandState||d.defaultTreeExpandState;if(C&&!(C instanceof Qe)){let P=e.propsCache.get("treeExpandState"),D=P.get(C)??new Qe(C);P.set(C,D),C=D}C=C||new Qe({defaultExpanded:!0,collapsedPaths:[]});let b=t.groupRowsState||e.groupRowsState||t.defaultGroupRowsState;if(b&&!(b instanceof pt)){let P=e.propsCache.get("groupRowsState"),D=P.get(b)??new pt(b);P.set(b,D),b=D}b=b||new pt(e.lazyLoad?{expandedRows:[],collapsedRows:!0}:{expandedRows:!0,collapsedRows:[]});let w=Ag(t.shouldReloadData||{}),S=typeof t.data=="function"&&!!t.lazyLoad,T=!!t.livePagination,I={sortInfo:w.sortInfo??(S||T),filterValue:w.filterValue??(S||T),groupBy:w.groupBy??S,pivotBy:w.pivotBy??S},x=t.sortFunction?"local":I.sortInfo?"remote":"local",N=(typeof t.filterFunction=="function"||typeof t.treeFilterFunction=="function")&&!t.lazyLoad?"local":I.filterValue||t.lazyLoad?"remote":"local",R=e.rowDisabledState,A=t.isRowDisabled;if(!A&&R){let P=e.propsCache.get("isRowDisabled"),D=P.get(R);D?A=D:(A=M=>R.isRowDisabled(M.id),P.set(R,A))}let E={debugId:e.debugId??t.debugId,isTree:i,selectionMode:s,groupRowsState:b,treeExpandState:C,treeExpandMode:C.mode,shouldReloadData:I,isRowDisabled:A,rowSelection:c,cellSelection:f,sortMode:x,filterMode:N,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 P=!n||n.originalDataArray!==e.originalDataArray,D=typeof t.livePaginationCursor=="function"?P?Dg(t.livePaginationCursor,e):e.livePaginationCursor:t.livePaginationCursor;E.livePaginationCursor=D}if(e.devToolsDetected&&e.debugId){let P=Gr.get(e.debugId);P&&(E={...E,...P})}return E}var Eg=Bt("DataSource:fullLazyLoad");function ed(o,t,e){let{name:n,newValue:i}=o;n==="data"&&typeof i=="function"&&!t.groupRowsState&&(t.lazyLoad&&Eg('"data" function prop has changed'),t.collapseGroupRowsOnDataFunctionChange!==!1&&(e.groupRowsState=new pt({collapsedRows:!0,expandedRows:[]})))}function td(){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 Ke?o.getState().selectedCells:null,"single-cell"]}:{callbackParams:[o.getState(),"multi-cell"]}}}function nd(){return{sortInfo:(o,{actions:t,state:e})=>{let n=e.getDataSourceMasterContextRef.current,i=xt(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=xt(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=xt(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=xt(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=xt(e,{__cursorId:o},n());t.dataParams=i},livePaginationCursor:(o,{actions:t,state:e})=>{let n=e.getDataSourceMasterContextRef.current,i=xt(e,{livePaginationCursor:o},n());t.dataParams=i},dataParams:(o,{state:t})=>jt(o,t.dataParams,new Set(["changes","originalDataArray","masterRowInfo"]))?!1:(Bt(An(t.debugId,"DataSource:dataParams"))("onDataParamsChange triggered because the following values have changed",o?.changes),!0)}}function od(o){return{originalDataArray:o.originalDataArray,groupRowsState:o.groupRowsState,groupBy:o.groupBy,pivotBy:o.pivotBy,sortInfo:o.sortInfo,filterValue:o.filterValue,livePaginationCursor:o.livePaginationCursor}}function Br(...o){return(...e)=>{o.forEach(n=>{typeof n=="function"&&n(...e)})}}function Hr(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 Wr(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 id({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=bt(function(){l.forEach((m,p)=>{u[`total:${m.id}`]=Hr({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],w=p.slice(0,-1).join("/");if(!c){let S=w;w=p.join("/");let T=p[p.length-1];d[w]=Wr({header:`${T}`,columnGroup:S,pivotBy:t,pivotGroupKeys:p,pivotByAtIndex:C,pivotIndex:p.length-1,pivotGroupKey:T})}l.forEach((S,T)=>{let I=c?`${p[p.length-1]}`:S.name||S.id,x=Hr({pivotBy:t,pivotColumn:!0,pivotTotalColumn:!1,pivotAggregator:S,pivotAggregatorIndex:T,pivotGroupKeys:p,pivotGroupKey:p[p.length-1],pivotIndex:p.length-1,pivotByAtIndex:C,columnGroup:w,header:I,valueFormatter:({rowInfo:N})=>N.isGroupRow?N.pivotValuesMap?.get(p)?.reducerResults[S.id]:null}),F=`${S.id}:${p.join("/")}`;u[F]=x})}else{let C=p.join("/"),b=p.slice(0,-1);if(d[C]=Wr({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 w=t[p.length-1],S=b.length?b.join("/"):void 0;if(!c){let T=S;S=`total:${p.join("/")}`,d[S]=Wr({header:`${p[p.length-1]} total`,columnGroup:T,pivotBy:t,pivotTotalColumnGroup:!0,pivotGroupKeys:p,pivotIndex:p.length-1,pivotByAtIndex:w,pivotGroupKey:p[p.length-1]})}l.forEach((T,I)=>{let x=c?`${p[p.length-1]} total `:`${T.name||T.id} total`,F=Hr({columnGroup:S,header:x,pivotAggregator:T,pivotAggregatorIndex:I,pivotColumn:!0,pivotTotalColumn:!0,pivotGroupKeys:p,pivotGroupKey:p[p.length-1],pivotByAtIndex:w,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("/")}`]=F})}}(e==="start"||e===!1)&&y?.()}),(!a&&e==="end"||n==="end")&&s(),{columns:u,columnGroups:d}}var Mg=()=>{};function rd(o,t){let e=new W,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 ad(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=bt(()=>{let p=r(n);if(!(!p||!Array.isArray(p)))for(let h=0,y=p.length;h<y;h++){let C=p[h];ad(o,t,c,C)}});f?(d?.(n),u?.(n,Mg)):(l?.(n,m,r(n)),u?.(n,m))}function ld(o,t,e){for(let n=0,i=e.length;n<i;n++)ad(o,t,[],e[n])}function sd(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 kt=(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(ud(sd(o),n)),i&&i.end(),t},jr=(o,t,e)=>{let{marker:n}=e;n&&n.start();let i=ud(sd(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 ld({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};kt.knownTypes=Wt;var Fg=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=kt.knownTypes[r],i||console.warn(`Unknown sort type "${o.type}" - please pass one of ${Object.keys(kt.knownTypes).join(", ")}`)}return i||(i=Wt.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}},Ng=o=>o.map(Fg).filter(t=>t instanceof Function),ud=(o,t)=>{let e=Ng(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 dd=Symbol("CLEAR"),an=class o{constructor(t){this.affectedFields=new Set;this.allFieldsAffected=!1;this.primaryKeyToData=new Map;this.nodePathToData=new W;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=dd,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(dd);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=()=>W.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:W.clone(t.nodePathToData),n}};var $r=1e3;function cd(o){return new Ur(o)}var Ur=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=()=>ii(this.getState);this.getRowInfoByIndex=t=>Yt(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?$r:i;return isNaN(a)||(a=$r),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 st(n):new st({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 st({enabledRows:!0,disabledRows:[]});return}let e=new st(t);e.enableAll(),this.actions.rowDisabledState=e};this.disableAllRows=()=>{let t=this.getState().rowDisabledState;if(!t){this.actions.rowDisabledState=new st({disabledRows:!0,enabledRows:[]});return}let e=new st(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 ri({...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?an.clone(e,{light:!0}):new an({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??$r,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 fd(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 ai(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 li(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}function pd(o){return"groupNesting"in o?o.groupNesting??0:0}function md(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 Og(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||Wt.string)(o,t);return a===0?0:e.dir*a}function kg(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 Lg(o){let t=[],e=[];for(let n of o){let i={row:n,children:[]},r=pd(n);for(;e.length&&pd(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 zg(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 hd(o,t,e,n){let i=kg(t,e);if(!i.length||!o.length)return o;let r={...Wt,...n},a=Lg(o),l=(d,s)=>{for(let c of i){let f=Og(md(d.row,c),md(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),zg(a)}var uo={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 qr=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(uo).reduce((e,n)=>{let i={start:t.start,end:r=>t.end({...r,track:uo[n].track,label:r.label}),get label(){let r=uo[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=uo[n];return t.markerDetails.track=r.track,i}}),e},{})}};function it(o){return qr.create(o)}function _n(o){if(o==null)return!1;let t=o;return!0}var Pt=(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 Vg(o){let t=o.get([at]);if(!t)return;if(t.totalChildrenCount!=null)return t.totalChildrenCount;let e=0;for(let n=0;n<t.children.length;n++){let i=t.children[n]?.totalChildrenCount;if(i==null)return;e+=i}return e}function Gg(o,t){let e=o.get([at]);if(e)return t?e.totalChildrenCountUnfiltered:e.totalCountUnfiltered}function Yr(){return!1}function Kg(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:Yr,hasSelectedCells:Yr};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 Bg=bt(()=>{console.warn(`Your "treeFilterFunction" should NOT MUTATE the data object. You're probably mutating the node children.
|