@infinite-table/infinite-vue 10.1.2 → 10.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.mjs CHANGED
@@ -1,7 +1,7 @@
1
- var 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||!a&&!r.groupKeys?.length);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 em=Object.create;var Ua=Object.defineProperty;var tm=Object.getOwnPropertyDescriptor;var nm=Object.getOwnPropertyNames;var om=Object.getPrototypeOf,im=Object.prototype.hasOwnProperty;var rm=(o,t)=>()=>(t||o((t={exports:{}}).exports,t),t.exports);var am=(o,t,e,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of nm(t))!im.call(o,i)&&i!==e&&Ua(o,i,{get:()=>t[i],enumerable:!(n=tm(t,i))||n.enumerable});return o};var Bn=(o,t,e)=>(e=o!=null?em(om(o)):{},am(t||!o||!o.__esModule?Ua(e,"default",{value:o,enumerable:!0}):e,o));var Rn=rm((Dv,Ks)=>{"use strict";Ks.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 iy,inject as ry,onBeforeUnmount as ci,onMounted as fi,provide as ay,shallowRef as ly,watch as Fn}from"vue";import{getCurrentInstance as sm,inject as um,isRef as dm,onBeforeUnmount as cm,provide as fm,shallowRef as pm,unref as mm,watch as hm}from"vue";function qa(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 Xi=o=>o&&o.substr(0,1).toUpperCase()+o.substr(1);function Hn(o){return o!==void 0}function Wn(o,t){let e=t[o];return Hn(e)}var Ji=(o,t,e)=>{let n=o[t];typeof n=="function"&&n(...e)};function lm(o,t,e){let n={};for(let i in o)if(o.hasOwnProperty(i)){let r=o[i],a=Wn(i,t)?t[i]:t[`default${Xi(i)}`];typeof r=="function"&&(a=r(a,e)),n[i]=a}return n}function Ya(o,t,e){let{fn:n,propertyReads:i}=qa(o,{getProxyTargetFromArgs:a=>a.props,putProxyToArgs:(a,l)=>[{...l,props:a}]}),r=n(t);return i.forEach(a=>e.add(a)),r}function Za(o){let{props:t,initialSetupState:e,propsToForward:n,parentState:i,mapPropsToState:r,propsToStateSet:a}=o,l={};n&&(l=lm(n,t,e));let u={...e,...l};if(r){let d=Ya(r,{props:t,state:u,oldState:null,parentState:i},a);return{...u,...d}}return u}function Xa(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=Ya(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 Ja(o){let{dispatch:t,getState:e,getProps:n,propsToForward:i,allowedControlledPropOverrides:r,interceptedActions:a,mappedCallbacks:l,notify:u=Ji}=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${Xi(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];Wn(c,h)&&!w||t({payload:{updatedProps:null,mappedState:{[c]:p}}})}}),s},{})}function Qa(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++,Wn(p,t)||Wn(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 gm(o){return(t,e,n)=>{if(Ji(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 hn(o){let t=o.injectionKey??Symbol("managed-component-state");function e(r){let a=sm(),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:dm(c)?mm(c)??null:typeof c=="function"?c()??null:c,m=Za({props:l(),initialSetupState:u,propsToForward:s,parentState:f(),mapPropsToState:o.mapPropsToState,propsToStateSet:d}),p=pm(m),h=()=>m,y=l,C=T=>{m=Xa(m,T,{getProps:y,getParentState:f,mapPropsToState:o.mapPropsToState,concludeReducer:o.concludeReducer,propsToStateSet:d}),p.value=m},b=gm(a?(T,...I)=>a.emit(T,...I):void 0),w=Ja({dispatch:C,getState:h,getProps:y,propsToForward:s,allowedControlledPropOverrides:o.allowedControlledPropOverrides,interceptedActions:o.interceptActions,mappedCallbacks:o.mappedCallbacks,notify:b});return hm(()=>({props:l(),parentState:f()}),(T,I)=>{let x=T.props,F=I.props,N=T.parentState!==I.parentState,{newMappedState:R,newMappedStateCount:A,updatedPropsToState:M,updatedPropsToStateCount:P,rawUpdatedProps:D,rawUpdatedPropsCount:E}=Qa({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?M: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&&E&&o.onPropsChange(D,x,w,z)}N&&T.parentState!=null&&!_&&C({type:"PARENT_STATE_CHANGE",payload:{}})},{flush:"post"}),cm(()=>{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 fm(t,a.contextValue),a}function i(){return um(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 el=(o,t)=>o-t;var Io=(o,t)=>el(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(Io).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(Io).map(f=>f.keys):l:(this.visitWithNext(t,(f,m,p,h,y)=>{u({...y,keys:m})},!1,d,i,n),r?a.sort(Io).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(Io);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 Po=["#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"],tl=Symbol("color"),xo=new WeakMap,Qi=pe();function er(o=Po){xo.set(o,o.map(t=>0))}er();var ym=(o=Po)=>{let t=[];xo.has(o)?t=xo.get(o):(t=o.map(n=>0),xo.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]??Po[0]},$n=":",tr="*",nl="-",bm=",",Cm="debug",Tm="diffdebug",il=!1,jn=new W,Un=new Map;function nr(o,t){let e=o.split($n),n=new W;n.set(e,!0);let i=t.split($n),r=new Set(i).has(tr),a=i.indexOf(tr),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($n)):!0}}function rl(o,t){let e=`channel=${o}_permissions=${t}`;if(Un.has(e))return Un.get(e);let n=t.split(bm);function i(l){return Un.set(e,l),l}let r=[],a=[];n.forEach(l=>{l.includes(tr)?a.push(l):r.push(l)});for(let l=0;l<r.length;l++){let u=r[l],d=u.startsWith(nl);if(d&&(u=u.substring(nl.length)),nr(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)),nr(o,u))return i(!d)}return i(!1)}var or=()=>Xe.enable??(Fe()&&Fe().localStorage?.getItem(Cm))??"",Sm=()=>Xe.diffenable??(Fe()&&Fe().localStorage?.getItem(Tm))??`${il}`,ir="",al=il;function rr(o){al=`${Sm()}`=="true",ir!==o&&(ir=o,Un.clear())}function ll(o){rr(or()),typeof Fe()<"u"&&Fe().addEventListener&&Fe().addEventListener("storage",function(){rr(or())});function t(e,n){let i=n?`${n}${$n}${e}`:e,r=i.split($n),a=jn.get(r);if(a)return a;let l=jn.get(r.slice(0,-1)),u=(l?l.logFn:Xe.logFn)??sl,d=u,s,c=0,f=()=>s??rl(i,ir),m=ym(Xe.colors),p=Object.defineProperties((...h)=>{let y=Qi.getListenersCount(),C;if(y>0&&(C=C??Date.now(),Qi({color:m,channel:i,args:h,timestamp:C})),f()){if(C=C??Date.now(),c&&al){let S=C-c;d(`%c[${i}]`,`color: ${m}`,`+${S}ms:`)}c=C;let b=[],w;if(h.forEach(S=>{if(S[tl])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[tl]=!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:()=>{jn.delete(r)}}});return jn.set(r,p),p}return t(o)}var sl=console.log.bind(console),ol;Object.defineProperty(ll,"enable",{get:()=>ol,set:o=>{ol=o,rr(or())}});var Xe=ll;Xe.colors=Po;Xe.logFn=sl;var wm=(o,t)=>Qi.onChange(e=>{if(!e)return;let{channel:n,args:i,color:r,timestamp:a}=e;nr(n,o)&&t({channel:n,color:r,args:i,timestamp:a})});Xe.onLogIntent=wm;Xe.isChannelEnabled=rl;Xe.destroyAll=()=>{er(),er(Xe.colors),jn.clear(),Un.clear()};var vm=Xe("IT:InfiniteTable"),Rm="#dc3545",Im="#eb9316";var dl="Warn",cl="Error",xm="Info",Pm="Success",Dm="Logs",Do=vm.extend(Dm),$T=Do.extend(xm),Am=Do.extend(dl),_m=Do.extend(cl),UT=Do.extend(Pm);var Mm=Im,Em=Rm;var Fm=(o,t)=>{t=t?t.extend?t.extend(dl):t:Am,t(typeof t.color=="function"?t.color(Mm,o):o)},Nm=(o,t)=>{t=t?t.extend?t.extend(cl):t:_m,t(typeof t.color=="function"?t.color(Em,o):o)};var ul=new W,fl=(o,...t)=>{ul.has(t)||(ul.set(t,!0),o())};var pl=(o,t=o,e)=>{fl(()=>Fm(o,e),t,"warn")},ml=(o,t=o,e)=>{fl(()=>Nm(o,e),t,"error")};function qn(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||qn)(l,o);return e.push(u),e},[])}var Ao="____not_loaded_yet____";function ar(o){return typeof o=="string"&&o.startsWith(Ao)}var Om=new W,hl=new WeakMap;function _o(o){let{originalDataArray:t,groupBy:e,toPrimaryKey:n}=o;if(!t||!e.length)return Om;let i=hl.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))}}),hl.set(t,{groupBy:e,groups:r}),r}function km(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?_o(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+(ar(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=>!ar(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 _o(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()?_o(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?km(_o(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},Yn=()=>Yn;Yn.extend=()=>Yn;var et=class{constructor(t){this.debug=Yn,this.error=Yn}};var Lm=function(o,t){return o-t},zm=function(o,t){return o=`${o}`,t=`${t}`,o.localeCompare(t)},Vm=function(o,t){return o-t},Gm={number:Lm,string:zm,date:Vm},Wt=Gm;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 lr(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 lr(o);if(o instanceof Date)return new Date(o);if(o instanceof Set)return new Set(lr(Array.from(o)));if(o instanceof Map)return new Map(lr(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 sr(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 Mo(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 yl(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=sr(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 M=I.slice(0,R),P=s.get(M);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,`${Ao}${N}`],D);continue}let A=x[N].data,M=x[N].keys||[];if(M.length){let D=M[M.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,E=x[N].pivot;c(D,E,i,0,m)}M.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 gl(o,t,e,n,i,r,a,l,u,d=qn){let{items:s,reducerResults:c,pivotDeepMap:f}=o.get(t);if(s.push(n),a&&Mo(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&&Mo(n,i,a,S,t)}e.length=0}}function bl(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&&Mo(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];bl(o,t,e,f,w,C,a,l)}a&&Zn(a,p,h)}}function ur(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=sr(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++)bl(o,a,l,[],t[d],d,e,i);e&&Zn(e,r,t);let u={deepMap:a,treeParams:o,treePaths:l,initialData:t,reducerResults:r};return n&&n.end(),u}function dr(o,t){let{marker:e,groupBy:n,defaultToKey:i=qn,pivot:r,reducers:a}=o;e&&e.start();let l=n.length,u=r?new W:void 0,d=new W,s=[],c=[],f=sr(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)}gl(d,s,c,C,h,r,a,u,f,i)}l||gl(d,s,c,C,h,r,a,u,f,i),a&&Mo(C,h,a,m,s),s.length=0}a&&(d.visitDepthFirst((h,y,C,b)=>{Zn(a,h.reducerResults,h.items),r&&h.pivotDeepMap.visitDepthFirst(({items:w,reducerResults:S},T,I,x)=>{Zn(a,S,w),x?.()}),b?.()}),Zn(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 Km(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 Bm(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(Ao)&&(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 Eo(o,t,e){return{...o,id:`duplicate_row_on_page_${e}_for__${o.id}`,indexInAll:t,duplicateOf:o.id}}function Zn(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 Cl(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=Eo(B,_.indexInAll,O);r[G.indexInAll]=G,_.indexInAll++}}T&&(r[_.indexInAll]=_);continue}let M=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:M,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(Eo(B,_+K,z)),K++,P.indexInAll++)})}}T&&(r[P.indexInAll]=P);let E=u(x);Array.isArray(E)&&Cl(E,N,[...e,P],P.indexInParentNodes,i,r)}return r}function Tl(o){let{dataArray:t,marker:e}=o;e&&e.start();let n=[];return Cl(t,[],[],[],o,n),e&&e.end(),{data:n}}function Sl(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,M=u?.isGroupRowCollapsed(x)??!1;T.push(F);let P=Bm({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||!M&&!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],E=D?.collapsed??!1;E&&(M=!0),P.collapsed=M;let _=f||M;if(E&&(_=!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(Eo(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+=M?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;M||(b.length+=R.length);let K=0;for(let B=0,G=R.length;B<G;B++){let le=R[B];if(!M&&r&&i!=null&&i>0){let ve=z+B+K;if(ve%i===0){let Oe=ve/i;S.forEach(Me=>{if(typeof r=="function"&&r(Me)!==!0)return;let Te=z+B+K;b[Te]=Eo(Me,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:M,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),M&&(ve.collapsedChildrenCount+=1),ve.deepRowInfoArray.push(me)}),M||(b[z+B+K]=me)}}}S.pop(),T.pop()}),t&&t.end(),{data:b,groupRowsIndexes:w}}function gn(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 wl(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 cr=new WeakMap,Hm=o=>o;function vl(o,t=50,e){cr.set(o,{lastCallTime:0,lastCallArg:null});let n=e??Hm;return i=>{let{lastCallTime:r,lastCallArg:a}=cr.get(o)||{lastCallTime:0,lastCallArg:null},l=Date.now(),u=l-r,d=jt(n(a),n(i));u<t&&d||(cr.set(o,{lastCallTime:l,lastCallArg:i}),o(i))}}var Wm="*",Ke=class{constructor(t){this.wildcard=Wm;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 Fu,h as Nu}from"vue";import{computed as vt,defineComponent as kr,h as xn,inject as rg,provide as ag,ref as Mu,shallowRef as lg,watch as sg}from"vue";var te=(...o)=>o.filter(t=>!!`${t}`).join(" ");var Rl="_16lm1iw2 _16lm1iw23 _16lm1iw26 _16lm1iw2c _16lm1iw2a",Il={center:"_16lm1iw2j",stretch:"_16lm1iw2k",start:"_16lm1iw2l",end:"_16lm1iw2m"};var lt="_16lm1iw3b _16lm1iw3c _16lm1iw35",xl={pointer:"_16lm1iwk",default:"_16lm1iwl",colResize:"_16lm1iwm",grabbing:"_16lm1iwn",grab:"_16lm1iwo"},Fo={flex:"_16lm1iw1p",contents:"_16lm1iw1q",none:"_16lm1iw1r",block:"_16lm1iw1s",grid:"_16lm1iw1t",inlineBlock:"_16lm1iw1u",inlineFlex:"_16lm1iw1v",inlineGrid:"_16lm1iw1w"};var Pl={1:"_16lm1iw1c",none:"_16lm1iw1d"},fr={column:"_16lm1iw2f",columnReverse:"_16lm1iw2g",row:"_16lm1iw2h",rowReverse:"_16lm1iw2i"};var Dl={0:"_16lm1iw1y","100%":"_16lm1iw1z","50%":"_16lm1iw20"},Al={center:"_16lm1iw30",spaceBetween:"_16lm1iw31",spaceAround:"_16lm1iw32",start:"_16lm1iw33",end:"_16lm1iw34"},_l={0:"_16lm1iw26","100%":"_16lm1iw27","50%":"_16lm1iw28",auto:"_16lm1iw29"};var Ml={none:"_16lm1iwd"},No={hidden:"_16lm1iw35",auto:"_16lm1iw36",visible:"_16lm1iw37"};var El={relative:"_16lm1iw1",absolute:"_16lm1iw2",static:"_16lm1iw3",sticky:"_16lm1iw4",fixed:"_16lm1iw5"};var Fl={0:"_16lm1iw23","100%":"_16lm1iw24","50%":"_16lm1iw25"};var Nl={none:"_16lm1iw1x"};var Ol={visible:"_16lm1iw38",hidden:"_16lm1iw39"};var kl={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 Ym,h as Xn,onBeforeUnmount as Zm,onMounted as Xm,ref as Jm}from"vue";function jm(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 $m(o){var t=jm(o,"string");return typeof t=="symbol"?t:String(t)}function Um(o,t,e){return t=$m(t),t in o?Object.defineProperty(o,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):o[t]=e,o}function Ll(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 zl(o){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?arguments[t]:{};t%2?Ll(Object(e),!0).forEach(function(n){Um(o,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(e)):Ll(Object(e)).forEach(function(n){Object.defineProperty(o,n,Object.getOwnPropertyDescriptor(e,n))})}return o}function Vl(o,t){var e={};for(var n in o)e[n]=t(o[n],n);return e}var qm=(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=zl(zl({},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)qm(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 Vl(o.variantClassNames,e=>Vl(e,n=>n.split(" ")[0]))}},t};var Gl="_1eexc2a6";var Kl=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:[]}),Bl="_12zfob1q _16lm1iw2 _16lm1iw1k _16lm1iw3b _16lm1iw3c _16lm1iw35",Hl=we({defaultClassName:"_16lm1iw2 _16lm1iw25 _16lm1iw26 _16lm1iwh _16lm1iwf",variantClassNames:{visible:{true:"_12zfob19",false:"_12zfob1a"}},defaultVariants:{},compoundVariants:[]}),Wl=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"]]}),jl=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"]]}),$l="_12zfob12u _16lm1iw22 _16lm1iw1z";var Ul="_12zfob17",ql="_12zfob12q _16lm1iw1p _16lm1iw2h _16lm1iw2j _16lm1iw1",Yl=we({defaultClassName:"_12zfob12r _16lm1iw1 _16lm1iw23",variantClassNames:{disabled:{true:"_12zfob12s",false:"_12zfob12t"}},defaultVariants:{},compoundVariants:[]}),pr=we({defaultClassName:"_12zfob12n _16lm1iw1p _16lm1iw2h _16lm1iw2k _16lm1iw1",variantClassNames:{active:{true:"_12zfob12o",false:"_12zfob12p"}},defaultVariants:{},compoundVariants:[]}),Zl="_12zfob12m _16lm1iw1p _16lm1iw2h _16lm1iw2j",Xl=we({defaultClassName:"_12zfob127 _16lm1iw1 _16lm1iw1p _16lm1iw2f _16lm1iw32 _16lm1iw39",variantClassNames:{menuVisible:{true:"_12zfob128"},reserveSpaceWhenHidden:{true:"_12zfob129",false:"_12zfob12a"}},defaultVariants:{},compoundVariants:[[{menuVisible:!0,reserveSpaceWhenHidden:!1},"_12zfob12b"]]}),Jl="_12zfob1b _16lm1iw2",Ql="_16lm1iw1",es="_12zfob16",ts=we({defaultClassName:"_12zfob12",variantClassNames:{align:{start:"_12zfob13",center:"_12zfob14",end:"_12zfob15"}},defaultVariants:{},compoundVariants:[]}),ns="_12zfob12l _16lm1iw35 _16lm1iw1 _16lm1iw1p _16lm1iw2h";var nt="InfiniteIcon";var os="_1nnkya20 _16lm1iw1p _16lm1iw2f _16lm1iw1 _16lm1iw32 _16lm1iw2j";var is={transition:"width 0.25s, opacity 0.25s"},rs=Object.keys({size:1,lineWidth:1,lineStyle:1,style:1,className:1,index:1});var yn=Ym(o=>{let t=Jm(0),e=null;return Xm(()=>{e=requestAnimationFrame(()=>{e=null,t.value=1})}),Zm(()=>{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={...is,borderTop:`${n}px solid currentColor`,...o.lineStyle,opacity:t.value};return Xn("div",{"data-name":"filter-icon",style:{...o.style,width:`${l}px`},class:te(i,nt,os,`${nt}-filter`)},[a?Xn("div",{"data-name":"index",class:Ul},`${r}`):null,Xn("div",{style:{width:`${d[0]}px`,...s}}),Xn("div",{style:{width:`${d[1]}px`,...s}}),Xn("div",{style:{width:`${d[2]}px`,...s}})])}},{name:"FilterIcon",props:[...rs]});var Oo=Object.freeze({}),Qm={string:Oo,number:{}};function bn(o,t){let e=t.default||Oo;return o.type===void 0?e:o.type===null?Oo:typeof o.type=="string"?t[o.type]||Qm[o.type]||Oo:o.type.reduce((n,i)=>Object.assign(n,t[i]),{})}var hr=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,M=!1,P=0;R!=null&&N>R&&(f[F]=!0,M=!0,P=R),A!=null&&N<A&&(m[F]=!0,M=!0,P=A),M&&(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,M=0,P=f[F],D=m[F],E=P||D,_=x.size??0;if(x.flex!=null){if(E)D&&(M=A),P&&(M=R);else{y+=1;let O=z=>(R!=null&&z>R&&(z=R),A!=null&&z<A&&(z=A),z);y===l?M=O(C):(M=O(Math.round(x.flex*c)),S+=M,C=s-S,b-=x.flex,c=C/b)}_=M,N.flexSize=M}return h.push(M),T.push(_),N.computedSize=_,w+=_,N}),flexSizes:h,minSizes:u,maxSizes:d,computedSizes:T,remainingSize:Math.round(t-w)}};function ko(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 ls(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 mr(o,t){return o.computedFlex&&!t?"flex":"width"}function Jn(o,t,e){if(t==="width"){let{flex:n,...i}=o??{};return{...i,width:e}}return{...o,flex:e}}var gr=o=>{let{availableSize:t,reservedWidth:e=0}=o,n=Object.keys(o.columnSizing).reduce((A,M)=>(A[M]={...o.columnSizing[M]},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=ls(o.items,t,e),f=l.computedWidth,m=l.computedMinWidth,p=l.computedMaxWidth,h=mr(l,c),y=u?.computedWidth,C=u?.computedMinWidth,b=u?.computedMaxWidth,w=u?mr(u,c):"width",S=!1,T=!1,I=i>0?1:-1,{value:x,clamped:F,diff:N}=ko(Math.round(f+i),m,p,I);if(o.shareSpaceOnResize){if(u==null)return n[d]=Jn(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:M,diff:P}=ko(Math.round(y-i),C,b,I);if(F&&M&&(Math.abs(N)>Math.abs(P)?M=!1:F=!1),!(!F&&!M)){if(F){let D=ko(Math.round(y-i-N),C,b,I);A=D.value,M=D.clamped,P=D.diff}else if(M){let D=ko(Math.round(f+i+P),m,p,I);x=D.value,F=D.clamped,N=D.diff}}n[d]=Jn(n[d],h,x),n[s]=Jn(n[s],w,A),T=F==="min"||M==="min",S=F==="max"||M==="max"}else n[d]=Jn(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 as(o,t){return o+t}function eh(o){return Object.keys(o).reduce((e,n)=>(e[n]={...o[n]},e),{})}var ss=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=ls(o.items,t,e),d=a.map(b=>mr(b,u)),s=0,{computedSizes:c}=hr({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(as,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=eh(n),{maxReached:F,minReached:N,constrained:R,adjustedDiff:A}=gr({availableSize:o.availableSize,reservedWidth:o.reservedWidth,dragHandleOffset:b,dragHandlePositionAfter:r[w],shareSpaceOnResize:!1,items:o.items,columnSizing:x});n[S.id]=Jn(x[S.id],T,Math.round(I+A)),y.push(A),F||(p=!1),N||(m=!1),R||(h=!1)});let C=y.reduce(as,0);return{minReached:m,maxReached:p,constrained:h,adjustedDiffs:y,adjustedDiff:C,columnSizing:n,reservedWidth:Math.round(e-C)}};var Lo;function Tt(){if(Lo!=null)return Lo;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),Lo=t.offsetWidth-e.offsetWidth,t.parentNode?.removeChild(t),Lo}var us=["start",void 0,"end"],ds=(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:us.indexOf(i)-us.indexOf(r)}),o);function cs(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 yr(o,...t){return cs(e=>e!=null,o,...t)}function fs(o,t,...e){return cs((n,i)=>!(i in o),t,...e)}var zo=!0,th=!0,nh=!0,ps="string",Ot="unknown";var oh=Ht("getComputedVisibleColumns"),ih=(o,t,e)=>o[e]!==!1,br=(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 rh(o,t){let e=bn(o,t);return o.sortType?o.sortType:e.sortType?e.sortType:typeof o.type=="string"?o.type:ps}function ah(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=rh(l,e);return Array.isArray(u)?u:[u]});return i.every(r=>r===Ot)?Ot:i.length===1?i[0]:i}function Cr(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??zo}var ms=({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=Qn,viewportReservedWidth:C,resizableColumns:b,draggableColumns:w,columnDefaultDraggable:S,columnOrder:T,columnPinning:I,editable:x,columnDefaultEditable:F,columnDefaultFilterable:N,columnDefaultGroupable:R,columnDefaultSortable:A,columnSizing:M,columnTypes:P,columnVisibility:D,columnVisibilityAssumeVisible:E,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=ds(T===!0?Object.keys(o):T,I),G=B.filter(g=>o[g]?ih(D,E,g):(oh(`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=bn(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=M[g];V?.width!=null&&V.flex==null&&delete Y.flex,V?.flex!=null&&V.width==null&&delete Y.width;let J=yr(Y,V);J.width!=null&&delete k.flex,J.flex!=null&&delete k.width,J=yr(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=hr({availableSize:Math.max(e.width-(C??0)-(l??Tt()),0),maxSize:i,minSize:n,items:G.map(me)}),{computedSizes:Oe,flexSizes:Me,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]=br(L,I);Y==="start"?ee+=k:Y==="end"?xe+=k:Se+=k});let be=e.width-xe,Ee=[],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=bn(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,Mt=k&&Me[L]||null,Et=k?Te[L]||0:re.minSize||0,yt=k?_e[L]||1e4:re.maxSize||1e4,Ge=k?br(v,I):!1,Ft=k?L===G.length-1:!1,Nt=J,Kn=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,Wp=k?Ge!==oe:!1,jp=k?Ft||Ge!==br(Y,I):!1,Ha=g.cssEllipsis??V.cssEllipsis??u,$p=g.headerCssEllipsis??V.cssEllipsis??g.cssEllipsis??V.headerCssEllipsis??d??Ha,Ro=k&&(K[v]||g.field||g.groupByForColumn)&&(K[v]||K[g.field||g.groupByForColumn])||null,Up=g.defaultFilterable??V.defaultFilterable??N??!0,qp=x??g.defaultEditable??V.defaultEditable??F??!1,qi=g.dataType||V.dataType||(Array.isArray(g.type)?g.type[0]:g.type)||ps,Yp=g.sortType||V.sortType||qi,Wa=g.filterType||V.filterType||qi,ja=!1;if(Ro!=null&&!Ro.disabled){let Zi=y[Wa];Zi&&(!Zi.emptyValues||!Zi.emptyValues.includes(Ro.filter.value))&&(ja=!0)}let mn=g.field??V.field,Zp=g.valueGetter??V.valueGetter,Yi=g.defaultGroupable??V.defaultGroupable??R??!!mn;mn||(Yi=!1),g.groupByForColumn&&(Yi=!1);let $a=mn?z[mn]!==void 0:!1,Xp=$a?z[mn]:void 0,Jp=Cr(g,{colType:V,sortable:m,columnDefaultSortable:A}),Qp=g.resizable??V.resizable??b??th,Be={colType:V,align:V.align,headerAlign:V.headerAlign,computedVisible:k,verticalAlign:V.verticalAlign,defaultHiddenWhenGroupedBy:V.defaultHiddenWhenGroupedBy,valueGetter:Zp,valueFormatter:V.valueFormatter,renderValue:V.renderValue,render:V.render,style:V.style,className:V.className,contentFocusable:V.contentFocusable,renderMenuIcon:V.renderMenuIcon,renderSortIcon:V.renderSortIcon,renderRowDetailIcon:V.renderRowDetailIcon,renderSelectionCheckBox:V.renderSelectionCheckBox,renderHeaderSelectionCheckBox:V.renderHeaderSelectionCheckBox,headerStyle:V.headerStyle,headerClassName:V.headerClassName,columnGroup:V.columnGroup,getValueToEdit:V.getValueToEdit,getValueToPersist:V.getValueToPersist,shouldAcceptEdit:V.shouldAcceptEdit,field:mn,...g,components:{...V.components,...g.components},computedResizable:Qp,computedMinWidth:Et,computedMaxWidth:yt,computedFlex:Mt,computedDataType:qi,computedEditable:qp,computedSortType:Yp,computedFilterType:Wa,cssEllipsis:Ha,headerCssEllipsis:$p,computedFilterValue:Ro,computedFiltered:ja,computedFilterable:Up,computedGroupable:Yi,computedGroupedBy:$a,computedGroupedByIndex:Xp,computedWidth:rt,computedAbsoluteOffset:Gt,computedPinningOffset:Kn,computedVisibleIndexInCategory:Nt,computedOffset:O,computedSortable:Jp,computedSortInfo:se,computedSortIndex:Re,computedMultiSort:h,computedSorted:fe,computedSortedAsc:ae,computedSortedDesc:ye,computedVisibleIndex:J,computedPinned:Ge,computedDraggable:w??g.defaultDraggable??S??nh,computedFirstInCategory:Wp,computedLastInCategory:jp,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||ah(Be.groupByForColumn,t,P),Ee.push(Be)),ne.set(Be.id,Be),Be.field&&!Be.groupByForColumn&&!tt.has(Be.field)&&tt.set(Be.field,Be)}),Ee.forEach(g=>{g.computedSortable=hs(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 hs(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??zo,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=Cr(T,{colType:bn(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??zo},!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 eo(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 Vo=`${Ne}HeaderCell__filter`,Tr=`${Ne}HeaderCell__filterOperator`,gs=`${Vo}__input`;import{computed as on,defineComponent as Yh,h as Ue,inject as Zh,provide as Xh,ref as Iu,shallowRef as Jh,Teleport as Qh}from"vue";function U(o){return o.slice(4,-1)}function Go(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 _h}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 ys(o,t){let e=Math.atan2(o.top-t.top,o.left-t.left);return e<=0&&(e=2*Math.PI+e),e}function bs(o,t){return Math.sqrt((t.top-o.top)**2+(t.left-o.left)**2)}function lh(o,t,e){let n=ys(o,e),i=ys(t,e);return n===i?bs(e,t)-bs(e,o):n-i}function Cs(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)=>lh(n,i,e)),t}function sh(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 uh(o,t){if(o.length<2)return o[0]?o[0].left===t.left&&o[0].top===t.top:!1;o=Cs(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 Ts(o,t){if(sh(o))return uh(o,t);o=Cs(o);let[e]=o;for(let n=1,i=o.length-1;n<i;n++){let r=o[n],a=o[n+1];if(dh([e,r,a],t))return!0}return!1}function dh(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 Cn=class{containsPoint(t){return Ts(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 Tn=class o extends Cn{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 ch(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 Cn{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=ch(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 Tn(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 Sn(o){if(!o)return!1;let t=o.tagName;return t==="INPUT"||t==="BUTTON"}var Ss="_1yeub2v0 _16lm1iw1 _16lm1iw1p _16lm1iw2f _16lm1iw0",ws="_1yeub2vs",vs="_1yeub2vr",Rs=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 Sr="_1yeub2vp";var iv=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 wr=`${Ne}Body`,Is=o=>o.querySelector(`.${wr}`);var nn=`${Ne}HeaderCell`,vr=`${Ne}HeaderWrapper`,xs=o=>Array.from(o.querySelectorAll(`.${vr}`));function wn(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 Ps(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)"}}},Ds="column-header-height";var As=`.${Le.rootClassName}`;function Rr(o){return wn(o,As)}var _s=U(j.scrollLeft),fh=U(j.scrollTop),ph=U(j.columnWidthAtIndex),Ir=U(j.columnOffsetAtIndex),Ms=U(j.columnReorderEffectDurationAtIndex),mh=U(j.columnOffsetAtIndexWhileReordering),hh=U(j.columnVisibilityAtIndex),gh=U(j.columnZIndexAtIndex);function St(o,t,e){let n=e?Rr(e):document.querySelector(As);yh(o,t,n)}function yh(o,t,e){if(e){let n=o,i=j[n]?U(j[n]):o;e.style.setProperty(i,`${t}`)}}function vn(o,t){if(t)for(var e in o){let n=j[e]?U(j[e]):e,i=`${o[e]}`;t.style.setProperty(n,i)}}function xr(o,t,e){St(`${Ir}-${o.computedVisibleIndex}`,o.computedPinned?`calc( ${o.computedAbsoluteOffset+t}px + var(${_s}))`:`${o.computedAbsoluteOffset+t}px`,e)}function Pr(o,t,e){St(`${gh}-${o}`,`${t}`,e)}function to(o,t,e){St(`${mh}-${o}`,typeof t=="number"?`calc( var(${Ir}-${o}) + ${t}px )`:t,e)}function no(o,t,e){St(`${hh}-${o}`,t,e)}function Ko(o,t,e){St(`${Ms}-${o}`,e??"",t)}function Dr(o,t){let e=`${Ms}-${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`${ph}-${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`${Ir}-${o}`}},set(o,t,e){t=typeof t=="number"?t+"px":t,St(this.varName.get(o),t,e)}}};function Es(o,t){vn({[_s]:`${o.scrollLeft}px`,[fh]:`${o.scrollTop}px`},t)}var oo={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:""}},bh=U(j.scrollbarWidthHorizontal),Fs=U(j.scrollbarWidthVertical),Ch=U(j.columnWidthAtIndex),Th=U(j.columnZIndexAtIndex),Ns=U(j.scrollLeft),Sh=U(j.activeCellColWidth),Os=U(j.activeCellColOffset),Vs=U(j.baseZIndexForCells),wh=U(j.pinnedStartWidth),ks=U(j.bodyWidth),vh=U(j.bodyHeight),Ls=U(j.pinnedEndOffset),zs=U(j.pinnedEndWidth),Rh=U(j.computedVisibleColumnsCount);function Ar(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(${Vs}) `+(e<0?"-":"+")+` ${Math.abs(e)} )`:"auto"}function Gs(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(${Ns}) )`:h.computedPinned==="end"?`calc( var(${Ls}) ${f.length?"+":""} ${f.map(b=>Ce.columnWidths.get(b.computedVisibleIndex)).join(" + ")} + var(${Ns}) )`:`${h.computedOffset}px`;let C=Ar(h,{pinnedStartColsCount:e.length,visibleColsCount:t.length});return p[`${Th}-${y}`]=`${C}`,h.computedPinned==="end"&&f.push(h),p},{});if(l.width&&(m[oo.browserScrollbarWidth.name]=`${Tt()}px`),m[oo.bodyWidth.name]=`calc(${j.bodyWidth} - ${j.scrollbarWidthVertical})`,m[oo.totalVisibleColumnsWidthValue.name]=`${i+r+a}px`,m[oo.totalVisibleColumnsWidthVar.name]=`calc(${t.map((p,h)=>`var(${Ch}-${h})`).join(" + ")})`,m[oo.visibleColumnsCount.name]=t.length,u!=null){m[Sh]=Ce.columnWidths.get(u[1]);let p=Ce.columnOffsets.get(u[1]);if(d.isHorizontalLayoutBrain){let h=d.getPageIndexForRow(u[0]);m[Os]=h?`calc( ${Ie.runtime.totalVisibleColumnsWidthVar} * ${h} + ${p})`:p}else m[Os]=p}return m[Rh]=t.length,m[bh]=s.horizontal?`${c}px`:"0px",m[Fs]=s.vertical?`${c}px`:"0px",m[wh]="calc( "+e.map(p=>Ce.columnWidths.get(p.computedVisibleIndex)).join(" + ")+")",m[zs]="calc( "+n.map(p=>Ce.columnWidths.get(p.computedVisibleIndex)).join(" + ")+")",m[Vs]=t.length*10,m[Ls]=`calc( var(${ks}) - var(${zs}) - var(${Fs}) )`,m[ks]=`${l.width}px`,m[vh]=`${l.height}px`,m}var io=(o,t,e)=>{if(o=[...o],t===e||o[t]===void 0||o[e]===void 0)return o;let n=o[t];return e<t,o.splice(t,1),o.splice(e,0,n),o};function _r(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 io(n,s,d)}else{let l=t.indexOf(i),u=t[l+1],d=n.indexOf(u),s=n.indexOf(i);return io(n,s,d)}return t}var js=Bn(Rn());function Bo(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=>Ih(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 Ih(o,t){return typeof o=="string"||typeof o=="number"?`${o}`:t?o.__get(t):o.done()}var xh=(...o)=>new Ut("+",Bo(o)),Bs=(...o)=>new Ut("-",Bo(o)),Ph=(...o)=>new Ut("*",Bo(o)),Dh=(...o)=>new Ut("/",Bo(o)),ro={add:xh,subtract:Bs,minus:Bs,multiply:Ph,divide:Dh};var Hs=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 Ws=10,Ah=U(j.pinnedStartWidth);function $s(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 E===O?q:O===H?q+P.computedWidth:E===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)+Ws,top:F.clientY-s.top-(F.clientY-u.top)+Ws},R=l.getScrollPosition(),A=t.map(H=>H.computedVisibleIndex),M=A,P=e.get(r),D=P.computedVisibleIndex,E=P?.computedPinned,_=D,O=E,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;E?E==="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(Ah,`${ne}px`,a)}}function Oe(H){if(H==null||H===_)return;if(_===-1&&H!==-1&&(no(D,"",a),p(!1)),_=H,H===-1){Me(D);return}let q=io(A,D,_>D?_-1:_);x=0;let ne=new Set;return q.forEach((ie,he)=>{let ge=M[he];ie!==ge&&ne.add(ie),me(q)}),M=q,Te(ne),{newColumnIndexes:q,indexesWithTransition:ne,pinnedStartCount:x}}function Me(H){M=M.filter(X=>X!==H),t.forEach(X=>{let ne=X.computedVisibleIndex,ie=ne>H;Dr(ne,a);let he="";ie&&(he=ro.minus(Ce.columnOffsets.get(ne),Ce.columnWidths.get(H)).done()),to(ne,he,a)}),no(H,"hidden",a),p(!0)}function Te(H){t.forEach(q=>{let X=q.computedVisibleIndex;H.has(X)?Dr(X,a):Ko(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):ro.add(Ce.columnOffsets.get(X),Ce.columnWidths.get(D)).done():he=ie?Ce.columnOffsets.get(X):ne?ro.add(Ce.columnOffsets.get(_-1),Ce.columnWidths.get(_-1)).minus(Ce.columnWidths.get(D)).done():ro.minus(Ce.columnOffsets.get(X),Ce.columnWidths.get(D)).done(),to(X,he,a)})}let _e=s.left+w("start"),ue=s.right-w("end"),Q=Hs({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,js.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 $=M[oe],ee=t[$];he[ee.id]="start"}let ge=M.map(oe=>t[oe].id);return{columnPinning:he,columnOrder:ge}}}}var Mh=U(j.baseZIndexForCells),Eh=(o,t)=>{let e=!o||Object.keys(o).length===0,n=!t||Object.keys(t).length===0;return e&&n?!0:!!o!=!!t?!1:jt(o,t)},Fh=()=>({dragSourceListId:null,dropTargetListId:null,dragItemId:"",status:"accepted"});function Us(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&&Sn(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(),M=C.getAvailableSize(),P=F.computedVisibleIndex,D=C.getVirtualColIndex(F.computedVisibleIndex,{pageIndex:h||0}),E=C.isHorizontalLayoutBrain?C.getPageWidth():null,_=N.style.cursor??"auto",O=!1,z=y.current,K=Ae.from(Is(z).getBoundingClientRect()),B=xs(z).map(Te=>Ae.from(Te.getBoundingClientRect())),G=K.getMinimumBoundingRectangle(...B),le=$s({brain:C,horizontalLayoutPageIndex:h,allowColumnHideOnDrag:r,pageWidth:E,draggableColumnsRestrictTo:b,computedPinnedEndColumns:x,computedPinnedStartColumns:T,computedUnpinnedColumns:I,computedVisibleColumns:w,computedVisibleColumnsMap:S,dragColumnHeaderTargetRect:R,dragColumnId:t,getCurrentDragSourceAndTarget:Fh,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;Eh(u().columnPinning,_e)||(s.columnPinning=_e);let Q=d().computedColumnOrder;s.columnOrder=_r({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),Pr(P,`calc( var(${Mh}) + 10000 )`,y.current),y.current?.classList.add(Sr),N.style.cursor="grabbing"}Z=le.onMove(Te)},Me=Te=>{let _e=Te.pointerId;requestAnimationFrame(async()=>{let{multiSortBehavior:ue}=u(),Q=y.current;Q?.classList.remove(Sr),le.stop(),C.update({...M}),De?.(),me?.(),N.style.cursor=_,N.hasPointerCapture?.(_e)&&N.releasePointerCapture(_e),N.removeEventListener("pointermove",Oe),N.removeEventListener("pointerup",Me),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 _h(),w.forEach(q=>{Ko(q.computedVisibleIndex,Q),no(q.computedVisibleIndex,"",Q),to(q.computedVisibleIndex,"",Q)}),Pr(P,Ar(F,{pinnedStartColsCount:T.length,visibleColsCount:w.length}),Q)})};N.addEventListener("pointermove",Oe),N.addEventListener("pointerup",Me),N.setPointerCapture(p.pointerId)};return{onPointerDown:p=>{d().computedVisibleColumnsMap.get(t)?.computedDraggable?m(p):p.target&&Sn(p.target)||f(p)}}}import{defineComponent as Nh,h as Ho}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 qs=Nh({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 Ho("svg",{viewBox:o.viewBox,class:o.className,style:e},o.paths.map(n=>Ho("path",{d:n})))}}});function ft(o,t){let e=n=>Ho(qs,{...n,paths:t});return e.displayName=o,e}var Ys=ft("IncludesOperatorIcon",ot.includesOperator),Zs=ft("StartsWithOperatorIcon",ot.startsWithOperator),Xs=ft("EndsWithOperatorIcon",ot.endsWithOperator),Js=ft("EqualOperatorIcon",ot.eqOperator),Qs=ft("NotEqualOperatorIcon",ot.neqOperator),eu=ft("GTOperatorIcon",ot.gtOperator),tu=ft("GTEOperatorIcon",ot.gteOperator),nu=ft("LTOperatorIcon",ot.ltOperator),ou=ft("LTEOperatorIcon",ot.lteOperator),iu=ft("DoneIcon",ot.done),ru=ft("ClearIcon",ot.clear),Mr=o=>Ho(qs,{...o,viewBox:"0 -960 960 960",paths:ot.hidden});Mr.displayName="HiddenIcon";var Wo="_1eexc2a7 _1eexc2a6",au=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"]]}),lu=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 su="_1eexc2a5",jo=we({defaultClassName:"_1eexc2aa",variantClassNames:{direction:{up:"_1eexc2ab",down:"_1eexc2ac",neutral:"_1eexc2ad"}},defaultVariants:{},compoundVariants:[]}),In="_1eexc2a8";import{defineComponent as Oh,h as kh,onMounted as Lh,ref as du,watch as zh}from"vue";var uu="qz8ht90 _16lm1iwk";var qt=Oh({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=du(e===void 0?!1:e),i=du(null),r=()=>{i.value&&(i.value.indeterminate=n.value==null)};Lh(r),zh(()=>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 kh("input",{...l,class:te("InfiniteCheckBox",uu,l.class),type:"checkbox",ref:i,checked:!!n.value,disabled:o.disabled,onChange:a})}}});import{defineComponent as Vh,h as $o}from"vue";function cu(o){let t={};return Object.keys(o).forEach(e=>{t[e]=e}),t}var fu=cu({"data-name":""}),Er={[fu["data-name"]]:"menu-icon"},pu=`[${fu["data-name"]}="${Er["data-name"]}"]`;var Gh={width:"100%",pointerEvents:"none"},Fr=`${nt}-menu`,ao=Vh({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={...Gh,borderTop:`${Ie.components.HeaderCell.menuIconLineWidth} solid currentColor`,...o.lineStyle},n=t.default?t.default():[$o("div",{class:Fr,style:e}),$o("div",{class:Fr,style:e}),$o("div",{class:Fr,style:e})];return $o("div",{...o.domProps,style:o.style,...Er,onPointerdown:i=>{i.stopPropagation(),o.domProps?.onPointerdown?.(i)},class:te(o.className,Xl({menuVisible:o.menuVisible,reserveSpaceWhenHidden:o.reserveSpaceWhenHidden}),nt,`${nt}-menu`)},n)}}});import{defineComponent as Kh,h as lo,ref as yu,watch as Bh,onBeforeUnmount as Hh}from"vue";var mu="_1b8djff0 _16lm1iw1p _16lm1iw2f _16lm1iw1 _16lm1iw32";var hu={transition:"width 0.25s, opacity 0.25s"},gu=Object.keys({direction:1,size:1,lineWidth:1,lineStyle:1,style:1,className:1,index:1,forceSize:1});var bu=Kh(o=>{let t=yu(!0),e=yu(0),n=null;Bh(()=>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}),Hh(()=>{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={...hu,borderTop:`${a}px solid currentColor`,...o.lineStyle,opacity:e.value},p={};return r===-1&&(p.top="100%"),lo("div",{"data-name":"sort-icon",style:{...o.style,width:`${s}px`},class:te(l,nt,mu,`${nt}-sort`)},[d?lo("div",{"data-name":"index",style:p,class:es},`${u}`):null,lo("div",{style:{width:`${f[0]}px`,...m},onTransitionend:i}),lo("div",{style:{width:`${f[1]}px`,...m}}),lo("div",{style:{width:`${f[2]}px`,...m}})])}},{name:"SortIcon",props:[...gu]});var{rootClassName:Cu}=Le,wt=`${Cu}Cell`,Uo=`${Cu}Cell_content`;function Nr(o){return Math.max(o.width-Tt(),0)}function Tu(o){let{context:t,column:e,diff:n,shareSpaceOnResize:i}=o,r=t.getState(),{columnSizing:a,viewportReservedWidth:l,bodySize:u}=r,d=t.getComputed().computedVisibleColumns,s=!1,c=d.reduce((m,p)=>(p.computedFlex&&(m[p.id]={...a[p.id],flex:p.computedWidth},s=!0),m),{}),f=s?{...a,...c}:a;return gr({shareSpaceOnResize:i,availableSize:Nr(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 jh,h as vu,ref as $h}from"vue";function Su(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"?xr(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"){xr(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 wu(o,t){let e=o[o.length-1];return{resize(n){let{columns:i,domRef:r}=t,a=i[o[0]],l=a.computedOffset,u=0,d=r.current;if(n.forEach((s,c)=>{u+=s;let f=o[c],m=i[f],p=m.computedWidth+s;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 qo="zneyzh0 _16lm1iw2 _16lm1iw23 _16lm1iw2c _16lm1iw2a _16lm1iwm _16lm1iw35",Yo=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"]]}),Zo=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 Wh}from"vue";var so=Symbol("InfiniteTable");function He(){return Wh(so)}var{rootClassName:Uh}=Le,qh=`${Uh}HeaderCell_ResizeHandle`,Ru=jh({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=$h(!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=Su(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 vu("div",{ref:c=>{n.current=c??null},class:`${qh} ${qo} ${Zo({computedPinned:l,computedFirstInCategory:u,computedLastInCategory:d})}`,onPointerdown:r},[vu("div",{style:s,class:Yo({constrained:i.value,computedPinned:l,computedFirstInCategory:u,computedLastInCategory:d})})])}}});var eg=U(j.columnWidthAtIndex),tg=U(j.columnReorderEffectDurationAtIndex),ng=U(j.columnZIndexAtIndex),og=U(j.columnVisibilityAtIndex),xu=Symbol("InfiniteHeaderCell");function Xo(){return Zh(xu)}var ig=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:In},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 Or=()=>Ue("div",{class:Pl[1]}),Pu=Yh({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=Jh(null);Xh(xu,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,M=`${R}:${A}`;if(!p||p.key!==M){let P=D=>{e.setColumnFilter(R,D)};p={key:M,fn:A>0?Jt(P,{wait:A}):P}}return p.fn},y=Iu(null),C=Iu(!1),{onPointerDown:b}=Us({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:M,headerOptions:P}=o,{allRowsSelected:D,someRowsSelected:E,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(bu,{index:R.computedMultiSort?R.computedSortIndex+1:void 0,style:{marginInlineStart:Ie.spacing[2],marginInlineEnd:Ie.spacing[2]},className:`${nn}__sort-icon ${Ql} ${ts({align:Z})}`,direction:R.computedSorted?R.computedSortedAsc?1:-1:0}):null,Oe=R.computedFilterable&&R.computedFiltered?Ue(yn):null,Me=R.headerCssEllipsis??R.cssEllipsis??!0,Te=w.value,_e=S.value,ue=T.value,Q=_e===R.id,H=ue!=null?M!==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||ao,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||uo,xe=oe?.components?.FilterOperatorSwitch||R.components?.FilterOperatorSwitch||Au,be=R.computedFilterable?Ue(Du,{filterProps:{horizontalLayoutPageIndex:M,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(_u),Ee={horizontalLayoutPageIndex:M,dragging:Q,domRef:c,htmlElementRef:s,renderLocation:"column-header",column:R,columnsMap:A,columnSortInfo:O,columnFilterValue:R.computedFilterValue,filtered:R.computedFiltered,someRowsSelected:E,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=Ee;ze.renderBag.filterEditor=be,f.value=ze;let de={...Ee,renderBag:{...Ee.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===ao?re:Ue(X,q,()=>re):null}if(R.renderSelectionCheckBox&&_==="multi-row"){de.renderBag.selectionCheckBox=rn(ig,{...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=Me?Ue("div",{class:lt},[de.renderBag.header]):de.renderBag.header,Ze=R.renderMenuIcon===!1?null:de.renderBag.menuIcon,ct=[Z==="center"?Or():null,de.renderBag.selectionCheckBox,tt,de.renderBag.sortIcon,de.renderBag.filterIcon,Z==="center"?Or():null,Z!=="center"?Or():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(${ng}-${R.computedVisibleIndex})`;Ve.zIndex=v,Ve.visibility=`var(${og}-${R.computedVisibleIndex}, visible)`,Ve.width=`var(${eg}-${R.computedVisibleIndex})`,Ve.transition=`transform var(${tg}-${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,Nl.none,B?xl.pointer:"",g,Go(R,[nn,wt],Wl,{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}),Gl,wt,Wo),V=Ue("div",{class:te(Uo,Me?lt:No.hidden,Kl(L),Al[Z]),style:ie?{height:`${o.height/2}px`}:void 0},[gt]),J=re=>Tu({context:{getState:i,getComputed:r},column:R,diff:re.diff,shareSpaceOnResize:re.shareSpaceOnResize}),ce=R.computedResizable?Ue(Ru,{horizontalLayoutPageIndex:M,columns:r().computedVisibleColumns,columnIndex:R.computedVisibleIndex,computeResize:J,onResize:re=>{let{columnSizing:rt,reservedWidth:Mt}=J(re);re.shareSpaceOnResize||(n.viewportReservedWidth=Mt),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(Qh,{to:ye},[Ue("div",{key:R.id,class:`${nn}Proxy ${Bl}`,style:{height:`${o.height}px`,width:`${o.width}px`,left:`${y.value.left??0}px`,top:`${y.value.top??0}px`}},[Ue("div",{class:Hl({visible:C.value})},[Ue(Mr,{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 Eu=Symbol("InfiniteColumnHeaderFilter"),Jo=o=>o.stopPropagation(),Du=kr({name:"InfiniteTableColumnHeaderFilter",props:{filterProps:{type:Object,required:!0}},setup(o){let t=He(),e=Xo(),n=lg(o.filterProps);ag(Eu,n);let i=Mu(!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 xn("div",{onPointerup:Jo,onPointerdown:Jo,onFocusin:r,onFocusout:a,class:`${Vo} ${pr({active:d})}`,style:{height:`${o.filterProps.columnHeaderHeight}px`}},[xn(c),xn(s)])}}}),Au=kr({name:"InfiniteTableFilterOperatorSwitch",setup(){let o=co();return()=>{let t=o.disabled.value,n=o.operator.value?.components?.Icon??yn;return xn("div",{"data-name":"filter-operator","data-disabled":t,onMousedown:i=>{i.stopPropagation(),!t&&o.columnApi.toggleFilterOperatorMenu(i.target)},class:te(Tr,ql,t?`${Tr}--disabled`:"")},[xn(n,{size:20,className:`${Yl({disabled:!!t})}`})])}}}),_u=kr({name:"InfiniteTableColumnHeaderFilterEmpty",setup(){return()=>xn("div",{onPointerup:Jo,onPointerdown:Jo,class:`${Vo} ${pr({active:!1})} ${Dl["50%"]}`})}});function co(){let o=He(),t=Xo(),e=rg(Eu),{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=Mu(e.value.columnFilterValue?.filter.value??"");sg(()=>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 ${eo(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:`${$l} ${gs}`}}var uo=Fu({name:"StringFilterEditor",setup(){let o=co();return()=>Nu("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})}}),Lr=Fu({name:"NumberFilterEditor",setup(){let o=co();return()=>Nu("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 Ou(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 Qn=Ou({StringFilterEditor:uo,NumberFilterEditor:Lr,icons:{includes:Ys,eq:Js,neq:Qs,startsWith:Zs,endsWith:Xs,gt:eu,gte:tu,lt:nu,lte:ou}});var Qo=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 Qo{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 ei=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 ti(o,t){return o&&o.filter(e=>{let n=t[e.filter.type];return!(!n||n.emptyValues&&n.emptyValues.includes(e.filter.value))})}var ku=new WeakMap;function ni(o,t){if(!o||!o.length)return[];let e=ku.get(o);e||(e=new WeakMap,ku.set(o,e));let n=e.get(t);if(n)return n;let i=[],r=ti(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 zr(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 ug=0;function Lu(o){return ug++,zr(ni(o.filterValue,o.filterTypes),o)}function Vr(o){return ni(o.filterValue,o.filterTypes).length?o.isLeafNode?Lu(o):o.filterTreeNode(o.data):!0}var dg="group-by",zu="group-by-";function Vu(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 oi(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===dg){let r=Vu(t);return r==null?i:(e=!0,{...i,field:r})}if(i.id.startsWith(zu)){let r=i.id.slice(zu.length),a=t.find(u=>String(u.field)===r||u.groupField===r);if(!a)return i;let l=Vu([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 Gu=!0,cg={originalDataArray:!0,changes:!0},fg={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=oi(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=Bu(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)&&!cg[u]){let d=u,s=fg[d],c=r[d],f=l[d];(s?s(c,f):c===f)||(a[d]=!0)}return r.changes=a,r}function Pn(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:Gu,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||!a&&!r.groupKeys?.length);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??Gu,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=fs({children:!0},N||{},I);R&&(A.chidren=[]),A.children.length=A.totalCount;let M=r.lazyLoadStartIndex??0,P=Math.min(b.totalCount??T.length,M+r.lazyLoadBatchSize);for(let D=M;D<P;D++){let E=I.children[D-M];if(!E)throw`lazily loaded item not found at index ${D-M}`;A.children[D]=E,E.dataset&&x.push({keys:E.keys,dataset:E.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 Bu(o,{filterTypes:t,filterMode:e}){return e==="local"?!o||!o.some(n=>n.valueGetter)?o:o.map(Ku):(ti(o,t)||[]).map(Ku)}function Ku(o){if(!o.valueGetter)return o;let t={...o};return delete t.valueGetter,t}function Hu(){let o;return(t,e,n)=>{if(o&&o.filterValue===t&&o.filterTypes===e&&o.filterMode===n)return o.result;let i=Bu(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 pg=()=>new Promise(o=>{ke(o)});function Gr(o,t){let e=!!o,{stateReadyAsDetails:n}=t(),i=e&&o.shouldRestoreState?n:!0;return{isDetail:e,isDetailReady:i}}function Wu(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 ju(o){for(let[t,e]of o.entries())e==="failed"&&o.delete(t)}function $u(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 M={lazyLoadStartIndex:I,lazyLoadBatchSize:i,groupKeys:b,append:s};T[R]||(T[R]=M),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(()=>pg()).then(()=>Pn(...b))},m)}var mg=Object.freeze([]),Uu=(o,t)=>{let e=o??mg,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 Dn=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 Dn{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 ii(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(!ii(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)||!ii(o[i],t[i]))return!1;return!0}return!1}function hg(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 ri={id:!0,value:!0,indexInAll:!0,rowSelected:!0,rowDisabled:!0,isCellSelected:!1,hasSelectedCells:!1},qu={...ri,dataSourceHasGrouping:!0,isTreeNode:!0,data:!1,isGroupRow:!0,selfLoaded:!0},gg={indexInGroup:!0,groupKeys:!0,groupBy:!0,rootGroupBy:!0,parents:!1,indexInParentGroups:!0,groupCount:!0,groupNesting:!0,collapsed:!0,selfLoaded:!0},yg={...ri,...gg,dataSourceHasGrouping:!0,isTreeNode:!0,data:!1,reducerData:!0,isGroupRow:!0,duplicateOf:!1,deepRowInfoArray:!1,error:!0,reducerResults:!0,groupCount:!0,groupData:!0,selectedChildredCount:!0,deselectedChildredCount:!0,totalChildrenCount:!0,collapsedChildrenCount:!0,collapsedGroupsCount:!0,directChildrenCount:!0,directChildrenLoadedCount:!0,pivotValuesMap:!0,childrenAvailable:!0,childrenLoading:!0},Yu={isTreeNode:!0,isParentNode:!0,indexInParent:!0,nodePath:!0,parentNodes:!1,indexInParentNodes:!0,totalLeafNodesCount:!0,collapsedLeafNodesCount:!0,treeNesting:!0,selfLoaded:!0},bg={...ri,...Yu,dataSourceHasGrouping:!0,isTreeNode:!0,isGroupRow:!0,isParentNode:!0,data:!1},Cg={...ri,...Yu,dataSourceHasGrouping:!0,isParentNode:!0,isGroupRow:!0,nodeExpanded:!0,selfExpanded:!0,data:!1,selectedLeafNodesCount:!0,deepRowInfoArray:!1,deselectedLeafNodesCount:!0,duplicateOf:!1},Tg=Object.entries(qu).map(([o,t])=>t?o:void 0).filter(Boolean),Sg=Object.entries(qu).map(([o,t])=>t?o:void 0),wg=Object.entries(yg).map(([o,t])=>t?o:void 0),vg=Object.entries(bg).map(([o,t])=>t?o:void 0),Rg=Object.entries(Cg).map(([o,t])=>t?o:void 0);function Ig(o,t){if(o===t)return!0;if(!o||!t||!hg(o,t)||o.id!==t.id||o.data!==t.data&&!ii(o.data,t.data))return!1;let e=[];o.dataSourceHasGrouping?e=o.isGroupRow?wg:Sg:o.isTreeNode?e=o.isTreeNode&&o.isParentNode?Rg:vg:e=Tg;for(let n of e){let i=o[n],r=t[n];if(!(typeof i=="function"||typeof r=="function")&&!ii(i,r))return!1}return!0}function Zu(){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}Ig(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 Kr=o=>Array.isArray(o)?new W(o.map(t=>[t,!0])):o,xg=(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?Kr(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:Kr(e.treePaths),strictCheckPaths:e.strictCheckPaths??!0,multiRowSelectionTarget:e.multiRowSelectionTarget,unfilteredTreePaths:e.unfilteredTreePaths?Kr(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(xg);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 ai(o){return o().dataArray}function _n(o,t){return new $e(o,An(t))}function An(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 li=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,An(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,An(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,An(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 Br=new Map,Hr=new Map;var Wr="DebugID=";function Mn(o,t){return t&&t.startsWith(Wr)?t:t?`${Wr}${o}:${t}`:`${Wr}${o}`}var Pg=Symbol("cursorId"),Xu=o=>o.totalLeafNodesCount===0,Dg=o=>o.isParentNode?!Xu(o):!0;function Ju(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:Zu(),indexer:new ei,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:Pg,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 Ag(o){let t={...o};return delete t.originalDataArray,t}var _g=[],Qu=o=>{o.destroyedRef.current=!0,o.__apiRef.current=null,o.lastSelectionUpdatedNodePathRef.current=null,o.lastExpandStateInfoRef.current={state:"collapsed",nodePath:null},o.treeExpandState?.destroy(),o.treePaths?.clear(),o.unfilteredTreePaths?.clear(),o.waitForNodePathPromises.clear(),o.pathToIndexMap?.clear(),o.rowDisabledState?.destroy(),o.groupRowsState?.destroy(),o.treeSelectionState?.destroy(),o.idToPathMap.clear(),o.idToIndexMap.clear(),o.rowInfoStore.clear()},ed=(o,t)=>({onDataParamsChange:e=>e?vl(e,100,Ag):void 0,lazyLoad:e=>!!e,isNodeReadOnly:e=>e??Xu,isNodeSelectable:e=>e??Dg,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=>({...Qn,...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=>Uu(e,o.propsCache.get("sortInfo")),groupBy:e=>e??_g});function Mg(o,t){return typeof o=="function"?o({array:t.originalDataArray,length:t.originalDataArray.length,lastItem:t.originalDataArray[t.originalDataArray.length-1]}):o}function Eg(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 Fg={selectedPaths:[],deselectedPaths:[],defaultSelection:!1};function td(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
- `);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.
4
+ `);let n=An(e);if(o instanceof $e)return o.setConfig(n),o;(o==null||typeof o!="object")&&(o=void 0);let i=o??Fg,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 nd(o){let{props:t,state:e,oldState:n}=o,i=!!e.nodesKey,r=Hn(t.sortInfo),a=Hn(t.filterValue),{filterTypes:l}=e,u=Object.keys(l).reduce((P,D)=>{let E=l[D].operators;P[D]=P[D]||{};let _=P[D];return E.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=Eg(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=E=>R.isRowDisabled(E.id),P.set(R,A))}let M={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?Mg(t.livePaginationCursor,e):e.livePaginationCursor:t.livePaginationCursor;M.livePaginationCursor=D}if(e.devToolsDetected&&e.debugId){let P=Hr.get(e.debugId);P&&(M={...M,...P})}return M}var Ng=Bt("DataSource:fullLazyLoad");function od(o,t,e){let{name:n,newValue:i}=o;n==="data"&&typeof i=="function"&&!t.groupRowsState&&(t.lazyLoad&&Ng('"data" function prop has changed'),t.collapseGroupRowsOnDataFunctionChange!==!1&&(e.groupRowsState=new pt({collapsedRows:!0,expandedRows:[]})))}function id(){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 rd(){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(Mn(t.debugId,"DataSource:dataParams"))("onDataParamsChange triggered because the following values have changed",o?.changes),!0)}}function ad(o){return{originalDataArray:o.originalDataArray,groupRowsState:o.groupRowsState,groupBy:o.groupBy,pivotBy:o.pivotBy,sortInfo:o.sortInfo,filterValue:o.filterValue,livePaginationCursor:o.livePaginationCursor}}function jr(...o){return(...e)=>{o.forEach(n=>{typeof n=="function"&&n(...e)})}}function $r(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 Ur(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 ld({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}`]=$r({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]=Ur({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=$r({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]=Ur({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]=Ur({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=$r({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 Og=()=>{};function sd(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 ud(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];ud(o,t,c,C)}});f?(d?.(n),u?.(n,Og)):(l?.(n,m,r(n)),u?.(n,m))}function dd(o,t,e){for(let n=0,i=e.length;n<i;n++)ud(o,t,[],e[n])}function cd(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(fd(cd(o),n)),i&&i.end(),t},qr=(o,t,e)=>{let{marker:n}=e;n&&n.start();let i=fd(cd(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 dd({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 kg=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}},Lg=o=>o.map(kg).filter(t=>t instanceof Function),fd=(o,t)=>{let e=Lg(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 pd=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=pd,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(pd);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 Yr=1e3;function md(o){return new Zr(o)}var Zr=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=()=>ai(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?Yr:i;return isNaN(a)||(a=Yr),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 li({...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??Yr,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 hd(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 si(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 ui(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 di(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 gd(o){return"groupNesting"in o?o.groupNesting??0:0}function yd(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 zg(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 Vg(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 Gg(o){let t=[],e=[];for(let n of o){let i={row:n,children:[]},r=gd(n);for(;e.length&&gd(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 Kg(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 bd(o,t,e,n){let i=Vg(t,e);if(!i.length||!o.length)return o;let r={...Wt,...n},a=Gg(o),l=(d,s)=>{for(let c of i){let f=zg(yd(d.row,c),yd(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),Kg(a)}var fo={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 Xr=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(fo).reduce((e,n)=>{let i={start:t.start,end:r=>t.end({...r,track:fo[n].track,label:r.label}),get label(){let r=fo[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=fo[n];return t.markerDetails.track=r.track,i}}),e},{})}};function it(o){return Xr.create(o)}function En(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 Bg(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 Hg(o,t){let e=o.get([at]);if(e)return t?e.totalChildrenCountUnfiltered:e.totalCountUnfiltered}function Jr(){return!1}function Wg(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:Jr,hasSelectedCells:Jr};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 jg=bt(()=>{console.warn(`Your "treeFilterFunction" should NOT MUTATE the data object. You're probably mutating the node children.
5
5
 
6
6
  Your filtering function probably looks like this:
7
7
 
@@ -13,16 +13,16 @@ function treeFilterFunction({ data }) {
13
13
 
14
14
  Make sure you avoid mutations.
15
15
 
16
- `)});function gd(o){let{dataArray:t,treeFilterFunction:e,toPrimaryKey:n,getNodeChildren:i,isLeafNode:r,nodesKey:a,filterValue:l,filterTypes:u}=o,d=[],s=f=>r(f)||!Array.isArray(i(f)),c=f=>{if(s(f))return f;let m=gd({...o,dataArray:i(f)});return m.length===0?!1:(f={...f,[a]:m},f)};for(let f=0,m=t.length;f<m;f++){let p=t[f],h=i(p),y=e({data:p,index:f,dataArray:t,primaryKey:n(p,f),filterValue:l,filterTypes:u,filterTreeNode:c,isLeafNode:s(p)});y&&(y===!0?y=p:typeof y=="object"&&y===p&&h!==i(y)&&Bg(),d.push(y))}return d}var Hg=[];function Wg(o){let{filterTypes:t,marker:e,filterFunction:n,toPrimaryKey:i,treeFilterFunction:r,getNodeChildren:a,nodesKey:l,isLeafNode:u}=o,d=o.filterValue||Hg,{dataArray:s}=o;e?.start({details:[{name:"Count before",value:s.length}]});let c=!!l&&!!a&&!!u,f=0;if(c){let m=n;s=gd({dataArray:s,treeFilterFunction:r||(m?h=>h.isLeafNode?m(h):h.filterTreeNode(h.data):kr),toPrimaryKey:i,getNodeChildren:a,nodesKey:l,isLeafNode:u,filterValue:d,filterTypes:t})}else if(n)s=s.filter((m,p,h)=>n({data:m,index:p,dataArray:h,primaryKey:i(m,p),filterValue:d,filterTypes:t}));else{let m=ei(d,t);m.length&&(s=s.filter((p,h,y)=>Or(m,{data:p,index:h,dataArray:y,primaryKey:i(p,h)})))}return e?.end({details:[{name:"Count after",value:s.length}]}),s}function yd(o){let t,{state:e,previousState:n}=o,i=e.debugId,r;i&&(r=it(i).track.DataSource.label.PrepareData.start());let a=fd(e),l=ti(e.sortInfo,e.groupBy),u=e.sortMode,d=l?.length?u==="local":!1;(e.lazyLoad||e.livePagination)&&(d=!1);let s=Pt(n,e,["refetchKey"]),c=Pt(n,e,["cache","originalDataArray","originalLazyGroupDataChangeDetect"]);Array.isArray(e.data)&&s&&(c=!0),!1&&(e.originalLazyGroupData=new W,c=!0);let m=e.cache?an.clone(e.cache):void 0;m&&!m.isEmpty()&&(c=!0);let p=e.toPrimaryKey,h=e.nodesKey,y=e.isTree,C=h?$=>$[h]:void 0,b=h?$=>$[h]===void 0:void 0,w,S;c&&(e.indexer.clear(),e.lazyLoad||(w=m?.getMutations(),S=m?.getTreeMutations(),e.originalDataArray=e.indexer.indexArray(e.originalDataArray,{toPrimaryKey:p,cache:m,getNodeChildren:C,isLeafNode:b,nodesKey:h}),y&&e.waitForNodePathPromises.visit(({value:$},ee)=>{$&&e.indexer.getDataForNodePath(ee)!==void 0&&$.resolve(!0)}))),m&&(m.clear(),e.cache=void 0);let{filterFunction:I,treeFilterFunction:x,filterValue:F,filterTypes:N}=e,R=!!I||!!x||Array.isArray(F)&&F.length,A=e.filterMode==="local"&&!e.lazyLoad,E=R&&A,P=Pt(n,e,["filterFunction","treeFilterFunction","filterValue","filterTypes"]),D=c||P,M=Pt(n,e,["sortInfo"]),_=c||P||M,O=A&&(D||!e.lastFilterDataArray),z=d&&(_||!e.lastSortDataArray||a.sortInfo),K=e.groupBy,B=e.pivotBy,G=!y&&(K.length>0||!!B),le=y,Z=Pt(n,e,["rowDisabledState","isRowDisabled"]),De=Pt(n,e,["rowSelection","cellSelection","isRowSelected","multiRowSelectionTarget","originalLazyGroupDataChangeDetect"]),me=Pt(n,e,["treeSelection","cellSelection","isNodeSelected","multiRowSelectionTarget","originalLazyGroupDataChangeDetect"]),ve=c||_||Pt(n,e,["generateGroupRows","originalLazyGroupData","originalLazyGroupDataChangeDetect","groupBy","groupRowsState","pivotBy","aggregationReducers","pivotTotalColumnPosition","pivotGrandTotalColumnPosition","showSeparatePivotColumnForSingleAggregation","repeatWrappedGroupRows","rowsPerPage"]),Oe=c||_||Pt(n,e,["originalLazyGroupData","originalLazyGroupDataChangeDetect","treeExpandState","isNodeExpanded","isNodeCollapsed","aggregationReducers","repeatWrappedGroupRows","rowsPerPage"]),Ee=Pt(n,e,["rowInfoReducers"]),Te=G&&(ve||!e.lastGroupDataArray||a.groupBy)||De||Z||Ee,_e=le&&(Oe||a.tree||!e.lastTreeDataArray)||me||Z||Ee,ue=Date.now(),Q=e.originalDataArray;if(le&&_e){let $={marker:i?it(i).track.DataSource.label.TreeUnfilteredTreePaths.start():void 0,isLeafNode:b,getNodeChildren:C,toKey:p};e.unfilteredTreePaths=ar($,Q).treePaths}if(R||(e.unfilteredCount=Q.length),E){e.unfilteredCount=Q.length;let $=ue;O?(e.devToolsDetected&&($=Date.now()),Q=Wg({marker:i?it(i).track.DataSource.label.Filter.start():void 0,getNodeChildren:C,isLeafNode:b,nodesKey:h,treeFilterFunction:x,dataArray:Q,toPrimaryKey:p,filterTypes:N,filterFunction:I,filterValue:F}),e.devToolsDetected&&e.debugTimings.set("filter",Date.now()-$)):Q=e.lastFilterDataArray,e.lastFilterDataArray=Q,e.filteredAt=ue}if(e.filteredCount=(e.lazyLoad&&K.length?Vg(e.originalLazyGroupData):void 0)??Q.length,e.lazyLoad&&(e.unfilteredCount=Gg(e.originalLazyGroupData,K.length>0)??e.filteredCount),e.postFilterDataArray=Q,d){let $=kt.knownTypes;if(kt.knownTypes={...$,...e.sortTypes},z){let ee=ue;if(e.devToolsDetected&&(ee=Date.now()),i&&(t=it(i).track.DataSource.label.Sort.start({details:[{name:"Count",value:Q.length}]})),e.sortFunction?(Q=e.sortFunction(l,[...Q]),t&&(t.end(),t=void 0)):y?Q=jr(l,Q,{marker:t,inplace:!1,isLeafNode:b,getNodeChildren:C,toKey:p,nodesKey:h}):Q=kt(l,[...Q],{marker:t}),i&&(t?.end(),t=void 0),e.devToolsDetected){let Se=Date.now()-ee;e.debugTimings.set("sort",Se)}}else Q=e.lastSortDataArray;kt.knownTypes=$,e.lastSortDataArray=Q,e.sortedAt=ue}e.postSortDataArray=Q;let H=e.dataArray,q=e.rowSelection instanceof Pe?e.rowSelection:void 0,X=e.treeExpandState instanceof Qe?e.treeExpandState:void 0,ne=e.cellSelection instanceof Ke?e.cellSelection:void 0;q&&(q.getConfig=Ye(e)),q?.xcache();let ie=e.selectionMode==="single-row"?$=>$.id===e.rowSelection:e.selectionMode==="multi-row"?$=>{let ee=q;return $.isGroupRow?ee.getGroupRowSelectionState($.groupKeys):ee.isRowSelected($.id,$.dataSourceHasGrouping?$.groupKeys:void 0)}:void 0,he=e.isRowDisabled||Yr;e.isRowSelected&&e.selectionMode==="multi-row"&&(ie=$=>e.isRowSelected($,q,e.selectionMode));let ge;e.isNodeExpanded&&(ge=$=>e.isNodeExpanded($,X)),e.isNodeCollapsed&&(ge=$=>!e.isNodeExpanded($,X)),ge||(ge=ee=>X.isNodeExpanded(ee.nodePath));let oe=e.rowInfoReducers;if(G){if(Te){let $=ue;e.devToolsDetected&&($=Date.now());let ee=e.aggregationReducers,Se=e.lazyLoad?ml({groupBy:K,pivot:B,mappings:e.pivotMappings,reducers:ee,indexer:e.indexer,toPrimaryKey:p,cache:m,marker:i?it(i).track.DataSource.label.LazyGroup.start():void 0},e.originalLazyGroupData):lr({groupBy:K,pivot:B,reducers:ee,marker:i?it(i).track.DataSource.label.Group.start():void 0},Q);e.groupDeepMap=Se.deepMap,q&&(q.getConfig=Ye(e));let xe=Object.keys(oe||{}),be=ai(oe),Me={reducers:oe,results:be,reducerKeys:xe,rowInfo:{}},ze=be?Ve=>{Me.rowInfo=Ve,li(Me)}:void 0,de=ne?Ve=>{Ve.isCellSelected=g=>ne.isCellSelected(Ve.id,g)}:void 0,tt=ze||de?Br(ze,de):void 0,Ze=bl({marker:i?it(i).track.DataSource.label.FlattenTree.start():void 0,groupResult:Se,lazyLoad:!!e.lazyLoad,reducers:ee,toPrimaryKey:p,isRowSelected:ie,rowSelectionState:q,withRowInfo:tt,repeatWrappedGroupRows:e.rowsPerPage!=null?e.repeatWrappedGroupRows:!1,rowsPerPage:e.rowsPerPage,groupRowsState:e.groupRowsState,generateGroupRows:e.generateGroupRows});H=Ze.data,e.rowInfoReducerResults=si({reducers:oe,results:be,array:H}),e.groupRowsIndexesInDataArray=Ze.groupRowsIndexes,e.reducerResults=Se.reducerResults;let ct=B?id({deepMap:Se.topLevelPivotColumns,pivotBy:B,pivotTotalColumnPosition:e.pivotTotalColumnPosition??"end",pivotGrandTotalColumnPosition:e.pivotGrandTotalColumnPosition??!1,reducers:e.aggregationReducers,showSeparatePivotColumnForSingleAggregation:e.showSeparatePivotColumnForSingleAggregation}):void 0;e.pivotColumns=ct?.columns,e.pivotColumnGroups=ct?.columnGroups;let gt=hd(H,l,e.pivotColumns,e.sortTypes);gt!==H&&(H=gt,e.groupRowsIndexesInDataArray=H.map((Ve,g)=>Ve.isGroupRow?g:-1).filter(Ve=>Ve>=0)),e.devToolsDetected&&e.debugTimings.set("group-and-pivot",Date.now()-$)}else H=e.lastGroupDataArray;e.lastGroupDataArray=H,e.groupedAt=ue}else if(le){if(_e){let $=ue;e.devToolsDetected&&($=Date.now());let ee=e.aggregationReducers,Se={marker:i?it(i).track.DataSource.label.Tree.start():void 0,isLeafNode:b,getNodeChildren:C,toKey:p,reducers:ee},xe=ar(Se,Q);e.treeDeepMap=xe.deepMap,e.treePaths=xe.treePaths;let be=e.selectionMode==="multi-row"?Ju(e.treeSelection,e.selectionMode,e):void 0;e.treeSelectionState=be;let Me=Object.keys(oe||{}),ze=ai(oe),de={reducers:oe,results:ze,reducerKeys:Me,rowInfo:{}},tt=ze?v=>{de.rowInfo=v,li(de)}:void 0,Ze=ne?v=>{v.isCellSelected=L=>ne.isCellSelected(v.id,L)}:void 0,ct=tt||Ze?Br(tt,Ze):void 0,gt=e.selectionMode==="single-row"?v=>v.id===e.treeSelection:e.selectionMode==="multi-row"?v=>be.isNodeSelected(v.nodePath):void 0,Ve=e.rowsPerPage!=null?e.repeatWrappedGroupRows:!1;H=yl({marker:i?it(i).track.DataSource.label.FlattenTree.start():void 0,treeResult:xe,treeParams:Se,dataArray:Q,reducers:ee,toPrimaryKey:p,isNodeSelected:gt,isNodeExpanded:ge,treeSelectionState:be,withRowInfo:ct,repeatWrappedGroupRows:Ve,rowsPerPage:e.rowsPerPage}).data,e.rowInfoReducerResults=si({reducers:oe,results:ze,array:H}),e.reducerResults=xe.reducerResults,e.totalLeafNodesCount=xe.deepMap.get([])?.totalLeafNodesCount??0,e.treeAt=ue,e.devToolsDetected&&e.debugTimings.set("tree",Date.now()-$)}else H=e.lastTreeDataArray;e.lastTreeDataArray=H}else if(e.groupDeepMap=void 0,e.pivotColumns=void 0,e.groupRowsIndexesInDataArray=void 0,n.postSortDataArray!=e.postSortDataArray||ve||De||Z||Ee){let ee=Object.keys(oe||{}),Se=ai(oe),xe={reducers:oe,results:Se,reducerKeys:ee,rowInfo:{}};H=Q.map((be,Me)=>{let ze=Kg(be,be?p(be):Me,Me,ie,he,ne);return Se&&(xe.rowInfo=ze,li(xe)),ze}),e.rowInfoReducerResults=si({reducers:oe,results:Se,array:H})}if(e.postGroupDataArray=H,H!==e.dataArray&&(e.updatedAt=ue),e.dataArray=H,e.reducedAt=ue,e.selectionMode==="multi-row"){let $=e.rowSelection instanceof Pe&&!e.rowSelection.onlyUsePrimaryKeys;if(G&&e.lazyLoad&&!$){i&&(t=it(i).track.DataSource.label.ComputeSelectionCountLazy.start());let ee=!0,Se=!1;e.dataArray.forEach(be=>{if(!be.isTreeNode&&be.isGroupRow&&be.groupKeys.length===1){let{rowSelected:Me}=be;Me!==!0&&(ee=!1),(Me===!0||Me===null)&&(Se=!0)}});let{rowSelection:xe}=e;xe instanceof Pe&&xe.getLazyHiddenRowsCount([])&&(xe.defaultSelection?Se=!0:ee=!1),e.allRowsSelected=ee,e.someRowsSelected=Se,i&&(t?.end(),t=void 0)}else{i&&(t=it(i).track.DataSource.label.ComputeSelectionCount.start());let ee=e.isTree?e.treeSelectionState?.getSelectionCountFor([]):e.rowSelection.getSelectionCountFor([]);ee?(e.allRowsSelected=ee.deselectedCount===0,e.someRowsSelected=ee.selectedCount>0):(e.allRowsSelected=e.totalLeafNodesCount===0,e.someRowsSelected=!1),i&&(t?.end(),t=void 0)}}return e.originalDataArrayChanged=c,c&&(e.originalDataArrayChangedInfo={timestamp:ue,mutations:w?.size?w:void 0,treeMutations:S?.size?S:void 0}),e.rowInfoStore.notifyDataArray(H,{marker:i?it(i).track.DataSource.label.DiffRowInfoInStore:void 0,dataSourceState:e,previousDataSourceState:n}),r&&r?.track.DataSource.label.PrepareData.end({details:[O||z||Te||_e?{name:"Performed operations",value:[O?"filter":null,z?"sort":null,Te?"group":null,_e?"tree":null].filter(_n).join(", ")}:null,s?{name:"Refetch key",value:`Old ${n.refetchKey} -> New ${e.refetchKey}`}:null,c?{name:"Original data array changed",value:""}:null,{name:"Unfiltered data length",value:e.originalDataArray.length}].filter(_n)}),e}function jg(o,t,e){return t=t.replaceAll("$ERR_CODE",o),t=`${t}
16
+ `)});function Cd(o){let{dataArray:t,treeFilterFunction:e,toPrimaryKey:n,getNodeChildren:i,isLeafNode:r,nodesKey:a,filterValue:l,filterTypes:u}=o,d=[],s=f=>r(f)||!Array.isArray(i(f)),c=f=>{if(s(f))return f;let m=Cd({...o,dataArray:i(f)});return m.length===0?!1:(f={...f,[a]:m},f)};for(let f=0,m=t.length;f<m;f++){let p=t[f],h=i(p),y=e({data:p,index:f,dataArray:t,primaryKey:n(p,f),filterValue:l,filterTypes:u,filterTreeNode:c,isLeafNode:s(p)});y&&(y===!0?y=p:typeof y=="object"&&y===p&&h!==i(y)&&jg(),d.push(y))}return d}var $g=[];function Ug(o){let{filterTypes:t,marker:e,filterFunction:n,toPrimaryKey:i,treeFilterFunction:r,getNodeChildren:a,nodesKey:l,isLeafNode:u}=o,d=o.filterValue||$g,{dataArray:s}=o;e?.start({details:[{name:"Count before",value:s.length}]});let c=!!l&&!!a&&!!u,f=0;if(c){let m=n;s=Cd({dataArray:s,treeFilterFunction:r||(m?h=>h.isLeafNode?m(h):h.filterTreeNode(h.data):Vr),toPrimaryKey:i,getNodeChildren:a,nodesKey:l,isLeafNode:u,filterValue:d,filterTypes:t})}else if(n)s=s.filter((m,p,h)=>n({data:m,index:p,dataArray:h,primaryKey:i(m,p),filterValue:d,filterTypes:t}));else{let m=ni(d,t);m.length&&(s=s.filter((p,h,y)=>zr(m,{data:p,index:h,dataArray:y,primaryKey:i(p,h)})))}return e?.end({details:[{name:"Count after",value:s.length}]}),s}function Td(o){let t,{state:e,previousState:n}=o,i=e.debugId,r;i&&(r=it(i).track.DataSource.label.PrepareData.start());let a=hd(e),l=oi(e.sortInfo,e.groupBy),u=e.sortMode,d=l?.length?u==="local":!1;(e.lazyLoad||e.livePagination)&&(d=!1);let s=Pt(n,e,["refetchKey"]),c=Pt(n,e,["cache","originalDataArray","originalLazyGroupDataChangeDetect"]);Array.isArray(e.data)&&s&&(c=!0),!1&&(e.originalLazyGroupData=new W,c=!0);let m=e.cache?an.clone(e.cache):void 0;m&&!m.isEmpty()&&(c=!0);let p=e.toPrimaryKey,h=e.nodesKey,y=e.isTree,C=h?$=>$[h]:void 0,b=h?$=>$[h]===void 0:void 0,w,S;c&&(e.indexer.clear(),e.lazyLoad||(w=m?.getMutations(),S=m?.getTreeMutations(),e.originalDataArray=e.indexer.indexArray(e.originalDataArray,{toPrimaryKey:p,cache:m,getNodeChildren:C,isLeafNode:b,nodesKey:h}),y&&e.waitForNodePathPromises.visit(({value:$},ee)=>{$&&e.indexer.getDataForNodePath(ee)!==void 0&&$.resolve(!0)}))),m&&(m.clear(),e.cache=void 0);let{filterFunction:I,treeFilterFunction:x,filterValue:F,filterTypes:N}=e,R=!!I||!!x||Array.isArray(F)&&F.length,A=e.filterMode==="local"&&!e.lazyLoad,M=R&&A,P=Pt(n,e,["filterFunction","treeFilterFunction","filterValue","filterTypes"]),D=c||P,E=Pt(n,e,["sortInfo"]),_=c||P||E,O=A&&(D||!e.lastFilterDataArray),z=d&&(_||!e.lastSortDataArray||a.sortInfo),K=e.groupBy,B=e.pivotBy,G=!y&&(K.length>0||!!B),le=y,Z=Pt(n,e,["rowDisabledState","isRowDisabled"]),De=Pt(n,e,["rowSelection","cellSelection","isRowSelected","multiRowSelectionTarget","originalLazyGroupDataChangeDetect"]),me=Pt(n,e,["treeSelection","cellSelection","isNodeSelected","multiRowSelectionTarget","originalLazyGroupDataChangeDetect"]),ve=c||_||Pt(n,e,["generateGroupRows","originalLazyGroupData","originalLazyGroupDataChangeDetect","groupBy","groupRowsState","pivotBy","aggregationReducers","pivotTotalColumnPosition","pivotGrandTotalColumnPosition","showSeparatePivotColumnForSingleAggregation","repeatWrappedGroupRows","rowsPerPage"]),Oe=c||_||Pt(n,e,["originalLazyGroupData","originalLazyGroupDataChangeDetect","treeExpandState","isNodeExpanded","isNodeCollapsed","aggregationReducers","repeatWrappedGroupRows","rowsPerPage"]),Me=Pt(n,e,["rowInfoReducers"]),Te=G&&(ve||!e.lastGroupDataArray||a.groupBy)||De||Z||Me,_e=le&&(Oe||a.tree||!e.lastTreeDataArray)||me||Z||Me,ue=Date.now(),Q=e.originalDataArray;if(le&&_e){let $={marker:i?it(i).track.DataSource.label.TreeUnfilteredTreePaths.start():void 0,isLeafNode:b,getNodeChildren:C,toKey:p};e.unfilteredTreePaths=ur($,Q).treePaths}if(R||(e.unfilteredCount=Q.length),M){e.unfilteredCount=Q.length;let $=ue;O?(e.devToolsDetected&&($=Date.now()),Q=Ug({marker:i?it(i).track.DataSource.label.Filter.start():void 0,getNodeChildren:C,isLeafNode:b,nodesKey:h,treeFilterFunction:x,dataArray:Q,toPrimaryKey:p,filterTypes:N,filterFunction:I,filterValue:F}),e.devToolsDetected&&e.debugTimings.set("filter",Date.now()-$)):Q=e.lastFilterDataArray,e.lastFilterDataArray=Q,e.filteredAt=ue}if(e.filteredCount=(e.lazyLoad&&K.length?Bg(e.originalLazyGroupData):void 0)??Q.length,e.lazyLoad&&(e.unfilteredCount=Hg(e.originalLazyGroupData,K.length>0)??e.filteredCount),e.postFilterDataArray=Q,d){let $=kt.knownTypes;if(kt.knownTypes={...$,...e.sortTypes},z){let ee=ue;if(e.devToolsDetected&&(ee=Date.now()),i&&(t=it(i).track.DataSource.label.Sort.start({details:[{name:"Count",value:Q.length}]})),e.sortFunction?(Q=e.sortFunction(l,[...Q]),t&&(t.end(),t=void 0)):y?Q=qr(l,Q,{marker:t,inplace:!1,isLeafNode:b,getNodeChildren:C,toKey:p,nodesKey:h}):Q=kt(l,[...Q],{marker:t}),i&&(t?.end(),t=void 0),e.devToolsDetected){let Se=Date.now()-ee;e.debugTimings.set("sort",Se)}}else Q=e.lastSortDataArray;kt.knownTypes=$,e.lastSortDataArray=Q,e.sortedAt=ue}e.postSortDataArray=Q;let H=e.dataArray,q=e.rowSelection instanceof Pe?e.rowSelection:void 0,X=e.treeExpandState instanceof Qe?e.treeExpandState:void 0,ne=e.cellSelection instanceof Ke?e.cellSelection:void 0;q&&(q.getConfig=Ye(e)),q?.xcache();let ie=e.selectionMode==="single-row"?$=>$.id===e.rowSelection:e.selectionMode==="multi-row"?$=>{let ee=q;return $.isGroupRow?ee.getGroupRowSelectionState($.groupKeys):ee.isRowSelected($.id,$.dataSourceHasGrouping?$.groupKeys:void 0)}:void 0,he=e.isRowDisabled||Jr;e.isRowSelected&&e.selectionMode==="multi-row"&&(ie=$=>e.isRowSelected($,q,e.selectionMode));let ge;e.isNodeExpanded&&(ge=$=>e.isNodeExpanded($,X)),e.isNodeCollapsed&&(ge=$=>!e.isNodeExpanded($,X)),ge||(ge=ee=>X.isNodeExpanded(ee.nodePath));let oe=e.rowInfoReducers;if(G){if(Te){let $=ue;e.devToolsDetected&&($=Date.now());let ee=e.aggregationReducers,Se=e.lazyLoad?yl({groupBy:K,pivot:B,mappings:e.pivotMappings,reducers:ee,indexer:e.indexer,toPrimaryKey:p,cache:m,marker:i?it(i).track.DataSource.label.LazyGroup.start():void 0},e.originalLazyGroupData):dr({groupBy:K,pivot:B,reducers:ee,marker:i?it(i).track.DataSource.label.Group.start():void 0},Q);e.groupDeepMap=Se.deepMap,q&&(q.getConfig=Ye(e));let xe=Object.keys(oe||{}),be=si(oe),Ee={reducers:oe,results:be,reducerKeys:xe,rowInfo:{}},ze=be?Ve=>{Ee.rowInfo=Ve,ui(Ee)}:void 0,de=ne?Ve=>{Ve.isCellSelected=g=>ne.isCellSelected(Ve.id,g)}:void 0,tt=ze||de?jr(ze,de):void 0,Ze=Sl({marker:i?it(i).track.DataSource.label.FlattenTree.start():void 0,groupResult:Se,lazyLoad:!!e.lazyLoad,reducers:ee,toPrimaryKey:p,isRowSelected:ie,rowSelectionState:q,withRowInfo:tt,repeatWrappedGroupRows:e.rowsPerPage!=null?e.repeatWrappedGroupRows:!1,rowsPerPage:e.rowsPerPage,groupRowsState:e.groupRowsState,generateGroupRows:e.generateGroupRows});H=Ze.data,e.rowInfoReducerResults=di({reducers:oe,results:be,array:H}),e.groupRowsIndexesInDataArray=Ze.groupRowsIndexes,e.reducerResults=Se.reducerResults;let ct=B?ld({deepMap:Se.topLevelPivotColumns,pivotBy:B,pivotTotalColumnPosition:e.pivotTotalColumnPosition??"end",pivotGrandTotalColumnPosition:e.pivotGrandTotalColumnPosition??!1,reducers:e.aggregationReducers,showSeparatePivotColumnForSingleAggregation:e.showSeparatePivotColumnForSingleAggregation}):void 0;e.pivotColumns=ct?.columns,e.pivotColumnGroups=ct?.columnGroups;let gt=bd(H,l,e.pivotColumns,e.sortTypes);gt!==H&&(H=gt,e.groupRowsIndexesInDataArray=H.map((Ve,g)=>Ve.isGroupRow?g:-1).filter(Ve=>Ve>=0)),e.devToolsDetected&&e.debugTimings.set("group-and-pivot",Date.now()-$)}else H=e.lastGroupDataArray;e.lastGroupDataArray=H,e.groupedAt=ue}else if(le){if(_e){let $=ue;e.devToolsDetected&&($=Date.now());let ee=e.aggregationReducers,Se={marker:i?it(i).track.DataSource.label.Tree.start():void 0,isLeafNode:b,getNodeChildren:C,toKey:p,reducers:ee},xe=ur(Se,Q);e.treeDeepMap=xe.deepMap,e.treePaths=xe.treePaths;let be=e.selectionMode==="multi-row"?td(e.treeSelection,e.selectionMode,e):void 0;e.treeSelectionState=be;let Ee=Object.keys(oe||{}),ze=si(oe),de={reducers:oe,results:ze,reducerKeys:Ee,rowInfo:{}},tt=ze?v=>{de.rowInfo=v,ui(de)}:void 0,Ze=ne?v=>{v.isCellSelected=L=>ne.isCellSelected(v.id,L)}:void 0,ct=tt||Ze?jr(tt,Ze):void 0,gt=e.selectionMode==="single-row"?v=>v.id===e.treeSelection:e.selectionMode==="multi-row"?v=>be.isNodeSelected(v.nodePath):void 0,Ve=e.rowsPerPage!=null?e.repeatWrappedGroupRows:!1;H=Tl({marker:i?it(i).track.DataSource.label.FlattenTree.start():void 0,treeResult:xe,treeParams:Se,dataArray:Q,reducers:ee,toPrimaryKey:p,isNodeSelected:gt,isNodeExpanded:ge,treeSelectionState:be,withRowInfo:ct,repeatWrappedGroupRows:Ve,rowsPerPage:e.rowsPerPage}).data,e.rowInfoReducerResults=di({reducers:oe,results:ze,array:H}),e.reducerResults=xe.reducerResults,e.totalLeafNodesCount=xe.deepMap.get([])?.totalLeafNodesCount??0,e.treeAt=ue,e.devToolsDetected&&e.debugTimings.set("tree",Date.now()-$)}else H=e.lastTreeDataArray;e.lastTreeDataArray=H}else if(e.groupDeepMap=void 0,e.pivotColumns=void 0,e.groupRowsIndexesInDataArray=void 0,n.postSortDataArray!=e.postSortDataArray||ve||De||Z||Me){let ee=Object.keys(oe||{}),Se=si(oe),xe={reducers:oe,results:Se,reducerKeys:ee,rowInfo:{}};H=Q.map((be,Ee)=>{let ze=Wg(be,be?p(be):Ee,Ee,ie,he,ne);return Se&&(xe.rowInfo=ze,ui(xe)),ze}),e.rowInfoReducerResults=di({reducers:oe,results:Se,array:H})}if(e.postGroupDataArray=H,H!==e.dataArray&&(e.updatedAt=ue),e.dataArray=H,e.reducedAt=ue,e.selectionMode==="multi-row"){let $=e.rowSelection instanceof Pe&&!e.rowSelection.onlyUsePrimaryKeys;if(G&&e.lazyLoad&&!$){i&&(t=it(i).track.DataSource.label.ComputeSelectionCountLazy.start());let ee=!0,Se=!1;e.dataArray.forEach(be=>{if(!be.isTreeNode&&be.isGroupRow&&be.groupKeys.length===1){let{rowSelected:Ee}=be;Ee!==!0&&(ee=!1),(Ee===!0||Ee===null)&&(Se=!0)}});let{rowSelection:xe}=e;xe instanceof Pe&&xe.getLazyHiddenRowsCount([])&&(xe.defaultSelection?Se=!0:ee=!1),e.allRowsSelected=ee,e.someRowsSelected=Se,i&&(t?.end(),t=void 0)}else{i&&(t=it(i).track.DataSource.label.ComputeSelectionCount.start());let ee=e.isTree?e.treeSelectionState?.getSelectionCountFor([]):e.rowSelection.getSelectionCountFor([]);ee?(e.allRowsSelected=ee.deselectedCount===0,e.someRowsSelected=ee.selectedCount>0):(e.allRowsSelected=e.totalLeafNodesCount===0,e.someRowsSelected=!1),i&&(t?.end(),t=void 0)}}return e.originalDataArrayChanged=c,c&&(e.originalDataArrayChangedInfo={timestamp:ue,mutations:w?.size?w:void 0,treeMutations:S?.size?S:void 0}),e.rowInfoStore.notifyDataArray(H,{marker:i?it(i).track.DataSource.label.DiffRowInfoInStore:void 0,dataSourceState:e,previousDataSourceState:n}),r&&r?.track.DataSource.label.PrepareData.end({details:[O||z||Te||_e?{name:"Performed operations",value:[O?"filter":null,z?"sort":null,Te?"group":null,_e?"tree":null].filter(En).join(", ")}:null,s?{name:"Refetch key",value:`Old ${n.refetchKey} -> New ${e.refetchKey}`}:null,c?{name:"Original data array changed",value:""}:null,{name:"Unfiltered data length",value:e.originalDataArray.length}].filter(En)}),e}function qg(o,t,e){return t=t.replaceAll("$ERR_CODE",o),t=`${t}
17
17
 
18
18
  ERROR_CODE = ${o}
19
19
 
20
- See http://infinite-table.com/docs/reference/error-codes#${o} for more info.`,{code:o,message:t,type:e??"error"}}function bd(o){return Object.entries(o).reduce((t,[e,n])=>{let i=e,r=jg(i,typeof n=="string"?n:n.message,typeof n=="string"?void 0:n.type);return t[i]=r,t},{})}function $g(o){return{message:o.join(""),type:"warning"}}function Ug(o){return{message:o.join(""),type:"error"}}var qg=bd({DS001:$g`The "data" prop of your DataSource seems to be updating too frequently.
21
- Make sure you don't pass a new reference on every render.`}),Yg=bd({CSS001_CSS:Ug`It appears you have not loaded the CSS file for InfiniteTable.
20
+ See http://infinite-table.com/docs/reference/error-codes#${o} for more info.`,{code:o,message:t,type:e??"error"}}function Sd(o){return Object.entries(o).reduce((t,[e,n])=>{let i=e,r=qg(i,typeof n=="string"?n:n.message,typeof n=="string"?void 0:n.type);return t[i]=r,t},{})}function Yg(o){return{message:o.join(""),type:"warning"}}function Zg(o){return{message:o.join(""),type:"error"}}var Xg=Sd({DS001:Yg`The "data" prop of your DataSource seems to be updating too frequently.
21
+ Make sure you don't pass a new reference on every render.`}),Jg=Sd({CSS001_CSS:Zg`It appears you have not loaded the CSS file for InfiniteTable.
22
22
  In most environments, you should be able to fix this by adding the following line:
23
23
 
24
24
  import '@infinite-table/infinite-react/index.css'
25
- `}),Cd={...qg,...Yg};var Td=new Map;var Zg=o=>{let t=o.type==="error"?Ht(o.debugId):Bt(o.debugId),e=o.type==="error"?cl:dl,n=o.debugId?`${o.code}-${o.debugId}`:o.code,i=o.message;o.debugId&&(i=`${i}
25
+ `}),wd={...Xg,...Jg};var vd=new Map;var Qg=o=>{let t=o.type==="error"?Ht(o.debugId):Bt(o.debugId),e=o.type==="error"?ml:pl,n=o.debugId?`${o.code}-${o.debugId}`:o.code,i=o.message;o.debugId&&(i=`${i}
26
26
 
27
- Component DEBUG_ID = "${o.debugId}"`),e(i,n,t)},Zr=o=>{let{debugId:t,key:e}=o,n=Cd[e];if(n&&(Zg({...n,debugId:t}),t&&e)){let i=Td.get(t);i&&i.getState().devToolsDetected&&n&&(i.getState().debugWarnings.set(e,{...n,debugId:t,status:"new"}),Xg(t))}};globalThis.logDevToolsWarning=Zr;var Xg=o=>{let t=window.__INFINITE_TABLE_DEVTOOLS_HOOK__;if(!t)return;let e=Td.get(o);e&&t(o,e)};import{inject as Jg,provide as Qg}from"vue";var Sd=Symbol("DataSourceMasterDetail");function wd(o){Qg(Sd,o)}var ey=()=>{};function Xr(){return Jg(Sd,ey)}var Jr=["debugId","primaryKey","fields","refetchKey","batchOperationDelay","rowInfoReducers","data","selectionMode","useGroupKeysForMultiRowSelection","multiRowSelectionTarget","rowSelection","defaultRowSelection","onRowSelectionChange","cellSelection","defaultCellSelection","onCellSelectionChange","rowDisabledState","defaultRowDisabledState","onRowDisabledStateChange","isRowDisabled","isRowSelected","lazyLoad","loading","defaultLoading","onLoadingChange","onReady","pivotBy","defaultPivotBy","onPivotByChange","aggregationReducers","defaultAggregationReducers","groupBy","defaultGroupBy","onGroupByChange","groupRowsState","defaultGroupRowsState","onGroupRowsStateChange","collapseGroupRowsOnDataFunctionChange","sortFunction","sortInfo","defaultSortInfo","onSortInfoChange","onDataParamsChange","onDataArrayChange","onDataMutations","livePagination","livePaginationCursor","onLivePaginationCursorChange","filterFunction","treeFilterFunction","shouldReloadData","filterValue","defaultFilterValue","onFilterValueChange","filterDelay","filterTypes","sortTypes","multiSort","nodesKey","isNodeExpanded","isNodeCollapsed","isNodeReadOnly","isNodeSelectable","isNodeSelected","treeSelection","defaultTreeSelection","onTreeSelectionChange","onTreeDataMutations","onNodeCollapse","onNodeExpand","treeExpandState","defaultTreeExpandState","onTreeExpandStateChange"],co=Symbol("DataSource");function fo(){return ny(co)}var{useManagedComponent:ry}=pn({debugName:"DataSource",initSetupState:Yu,forwardProps:Xu,concludeReducer:yd,mapPropsToState:Qu,onPropChange:ed,cleanup:Zu,interceptActions:nd(),mappedCallbacks:td()});function ci(o,t){let e={},n=!0,i=r=>{let a={},l={};for(let u in r)r.hasOwnProperty(u)&&(n||r[u]!==e[u])&&(a[u]=r[u],l[u]=e[u]);e=r,n=!1,Object.keys(a).length!==0&&t(a,l)};di(()=>i(o())),En(o,i,{flush:"post"})}function ay(o){let{state:t,getDataSourceState:e,dataSourceActions:n,reloadedRef:i}=o;ci(()=>({data:t.value.data,dataParams:t.value.dataParams}),()=>{n.lazyLoadCacheOfLoadedBatches=new W});let r=null,a=(s,c,f=e().lazyLoadCacheOfLoadedBatches)=>{let m=e();if(s=s||r,!s)return;let{renderStartIndex:p,renderEndIndex:h}=s,{lazyLoadBatchSize:y,lazyLoad:C}=m;C&&((!y||y<=0)&&(!m.groupBy||m.groupBy.length===0)||Hu({startIndex:p,endIndex:h,lazyLoadBatchSize:y,componentState:m,componentActions:n,dismissLoadedRows:c?.dismissLoadedRows??!1},f))},l=null,u=()=>{let s=e().scrollStopDelayUpdatedByTable;return(!l||l.wait!==s)&&(l={wait:s,fn:Jt(a,{wait:s})}),l.fn},d=null;ci(()=>{let s=t.value;return{sortInfo:s.sortInfo,filterValue:s.filterValue,groupBy:s.groupBy,pivotBy:s.pivotBy,refetchKey:s.refetchKey,cursorId:s.livePagination?s.cursorId:null,lazyLoadBatchSize:s.lazyLoadBatchSize,lazyLoad:s.lazyLoad,originalLazyGroupDataChangeDetect:s.originalLazyGroupDataChangeDetect,groupRowsState:s.groupRowsState}},s=>{d?.(),d=null;let{lazyLoad:c,notifyRenderRangeChange:f}=e();c&&(s.sortInfo||s.filterValue||s.groupBy||s.pivotBy||s.refetchKey||s.cursorId?(e().lazyLoadCacheOfLoadedBatches.clear(),e().originalLazyGroupData.clear(),a(f.get(),{dismissLoadedRows:!0}),i.current=!0,Promise.resolve().then(()=>{i.current=!1})):(s.originalLazyGroupDataChangeDetect||s.groupRowsState)&&a(f.get()),d=f.onChange(m=>{r=m,Bu(e().lazyLoadCacheOfLoadedBatches),a(m)}))}),En(()=>t.value.dataArray,()=>{let{lazyLoadBatchSize:s}=e();s&&s>0&&u()()},{flush:"post"}),ui(()=>{d?.(),d=null})}function ly(o){let{state:t,getDataSourceState:e,dataSourceActions:n}=o,i=()=>t.value.getDataSourceMasterContextRef.current?.()??void 0,r=iy({vertical:!1,horizontal:!1}),a=t.value.notifyScrollbarsChange.onChange(p=>{p&&(r.value=p)});ui(()=>{a()});let l=null;En(()=>t.value.livePaginationCursor,p=>{t.value.livePagination&&(l!=null&&cancelAnimationFrame(l),l=requestAnimationFrame(()=>{l=null,r.value?.vertical||p&&(n.cursorId=p)}))},{flush:"post"});let u=null;En(()=>[t.value.dataArray.length,t.value.livePaginationCursor],()=>{let{livePagination:p,livePaginationCursor:h,cursorId:y,dataArray:C}=t.value;!p||h!==void 0||(u!=null&&cancelAnimationFrame(u),u=requestAnimationFrame(()=>{u=null,r.value?.vertical||y!=null&&C.length&&(n.cursorId=C.length)}))},{flush:"post"}),En(()=>r.value.vertical,p=>{let{livePaginationCursor:h,livePagination:y,dataArray:C}=e();!p&&y&&(h?n.cursorId=h:h===void 0&&C.length&&(n.cursorId=C.length))},{flush:"post"}),ui(()=>{l!=null&&cancelAnimationFrame(l),u!=null&&cancelAnimationFrame(u)});let d=Gu(),s=()=>{let{filterValue:p,filterMode:h,filterTypes:y}=t.value;return d(p,y,h)},c=()=>{let{shouldReloadData:p,sortInfo:h,groupBy:y,pivotBy:C,refetchKey:b,livePagination:w,cursorId:S}=t.value;return{sortInfo:p.sortInfo?h:null,groupBy:p.groupBy?y:null,pivotBy:p.pivotBy?C:null,refetchKey:b,filterValue:p.filterValue?s():null,cursorId:w?S:null}},f={current:!1};ay({state:t,getDataSourceState:e,dataSourceActions:n,reloadedRef:f});let m=[];ci(()=>({data:t.value.data}),()=>{let p=e(),h=i(),{isDetail:y,isDetailReady:C}=Lr(h,e);if(y&&!C)return;let b=Date.now();m.length>=10&&m.splice(0,1),m.push(b),b-m[0]<200&&m.length>=10&&Zr({debugId:p.debugId,key:"DS001"}),typeof p.data!="function"&&In(p.data,p,n,void 0,h)}),ci(()=>({...c(),data:t.value.data}),p=>{let h=Object.keys(p),y=!1;if(h.length===1){y=!!p.cursorId;let T=e().data;if(Array.isArray(T)&&p.refetchKey){n.originalDataArray=T;return}}let C=i(),{isDetail:b,isDetailReady:w}=Lr(C,e);if(b&&!w)return;let S=e();if(typeof S.data=="function"){if(f.current&&!y&&Ku(S))return;In(S.data,S,n,{append:y},C)}}),di(()=>{let p=e(),h=xt(p,void 0,i());n.dataParams=h})}function sy(o){let t=Xr(),e=!!t(),{contextValue:n}=ry(o),i=n.state,r=n.componentActions,a=n.getComponentState;i.value.getDataSourceMasterContextRef.current=t;let l=cd({getState:a,actions:r}),u={state:i,getDataSourceState:a,dataSourceActions:r,dataSourceApi:l,assignState:n.assignState};return oy(co,u),di(()=>{let d=t();if(d){let s={dataSourceState:i.value,dataSourceActions:r,getDataSourceMasterContext:t,getDataSourceState:a,assignState:u.assignState,dataSourceApi:l};d.registerDetail(s)}}),ly({state:i,getDataSourceState:a,dataSourceActions:r}),En(()=>i.value.originalDataArrayChangedInfo,()=>{let d=i.value;d.onDataArrayChange?.(d.originalDataArray,d.originalDataArrayChangedInfo),d.onDataMutations&&d.originalDataArrayChangedInfo.mutations&&d.originalDataArrayChangedInfo.mutations.size&&d.onDataMutations({primaryKeyField:typeof d.primaryKey=="string"?d.primaryKey:void 0,dataArray:d.originalDataArray,mutations:d.originalDataArrayChangedInfo.mutations,timestamp:d.originalDataArrayChangedInfo.timestamp}),d.onTreeDataMutations&&d.originalDataArrayChangedInfo.treeMutations&&d.originalDataArrayChangedInfo.treeMutations.size&&d.onTreeDataMutations({nodesKey:d.nodesKey?d.nodesKey:void 0,dataArray:d.originalDataArray,treeMutations:d.originalDataArrayChangedInfo.treeMutations,timestamp:d.originalDataArrayChangedInfo.timestamp})},{flush:"post"}),di(()=>{i.value.onReady?.(l)}),ui(()=>{let d=a();d.onCleanup(d)}),u}var Qr=ty({name:"DataSource",props:[...Jr],setup(o,{slots:t}){let e=sy(o);return()=>t.default?.(e.state.value)??null}});import{computed as qC,defineComponent as YC,h as qe,inject as ZC,onBeforeUnmount as La,onMounted as XC,provide as Ep,ref as JC,shallowRef as QC,watch as We,watchEffect as eT}from"vue";import{computed as uy}from"vue";function Lt(o,t,e){let n=null,i;return uy(()=>{let r=o();return(n===null||r.length!==n.length||r.some((a,l)=>!Object.is(a,n[l])))&&(i=t()),n=r,i})}var Mn=(o,t,e={debounce:0})=>{let n=e.debounce??0,i=window.ResizeObserver,r=n?Jt(t,{wait:n}):t,a=new i(l=>{let u=l[0],{width:d,height:s}=u.contentRect;if(u.borderBoxSize?.[0])s=u.borderBoxSize[0].blockSize,d=u.borderBoxSize[0].inlineSize;else{let c=o.getBoundingClientRect();s=c.height,d=c.width}r({width:d,height:s})});return a.observe(o),()=>{a.disconnect()}};var pi=class pi{constructor(t,e){this.keysInOrder=[];if(typeof t=="number")this.maxSize=t,this.currentMap=new Map;else if(this.maxSize=e??pi.DEFAULT_SIZE,t){let n=Array.from(t);this.maxSize<n.length&&n.slice(n.length-this.maxSize),this.currentMap=new Map,n.forEach(([i,r])=>{this.set(i,r)})}else this.currentMap=new Map}values(){return this.currentMap.values()}get size(){return this.currentMap.size}delete(t){return this.currentMap.has(t)?(this.currentMap.delete(t),this.keysInOrder=this.keysInOrder.filter(e=>e!==t),!0):!1}has(t){return this.currentMap.has(t)}get(t){return this.currentMap.get(t)}set(t,e){if(this.has(t)&&this.delete(t),this.maxSize-this.currentMap.size<=0){let[i]=this.keysInOrder.splice(0,1);i!=null&&this.currentMap.delete(i)}return this.keysInOrder.push(t),this.currentMap.set(t,e),this}};pi.DEFAULT_SIZE=10;var fi=pi;var ea=class{add(t,e){}get(t){}delete(t){}has(t){return!1}},mi=class{constructor(t){this.storage=new fi(t)}add(t,e){this.storage.set(t,e)}get(t){return this.storage.get(t)}delete(t){this.storage.delete(t)}has(t){return this.storage.has(t)}},ta=class{constructor(){this.storage=new Map}add(t,e){this.storage.set(t,e)}get(t){return this.storage.get(t)}delete(t){this.storage.delete(t)}has(t){return this.storage.has(t)}},hi=class{constructor(t){this.cacheStorage=t===!1?new ea:t===!0?new ta:typeof t=="number"?new mi(t):new mi(5)}add(t,e){this.cacheStorage.add(t,e)}get(t){return this.cacheStorage.get(t)}delete(t){this.cacheStorage.delete(t)}has(t){return this.cacheStorage.has(t)}};var ut=class extends xn{constructor(e){super(e);this.isRowDetailsExpanded=e=>!!this.isItemPositive(e)}getState(){let e=this.allPositive?!0:[...this.positiveMap?.keys()??[]],n=this.allNegative?!0:[...this.negativeMap?.keys()??[]];return{expandedRows:e,collapsedRows:n}}getPositiveFromState(e){return e.expandedRows}getNegativeFromState(e){return e.collapsedRows}areAllCollapsed(){return this.areAllNegative()}areAllExpanded(){return this.areAllPositive()}collapseAll(){this.makeAllNegative()}expandAll(){this.makeAllPositive()}isRowDetailsCollapsed(e){return!this.isRowDetailsExpanded(e)}setRowDetailsExpanded(e,n){return this.setItemValue(e,n)}collapseRowDetails(e){this.setRowDetailsExpanded(e,!1)}expandRowDetails(e){this.setRowDetailsExpanded(e,!0)}toggleRowDetails(e){this.toggleItem(e)}};var vd=Gn(wn());var na=(o,t)=>o-t,zt={horizontal:!0,vertical:!0};function gi(o,t){let e=t.length;if(!e)return 0;let n=-1;for(let i=0;i<e;i++){let r=0,a=0;if(e-i<=n)break;for(let l=i;l<e;l++)if(r+=t[l],a++,r>o){a>n&&(n=a);break}}return n<0?e:Math.min(n,e)}var yi={start:0,end:0},oa=o=>{o()},ia=o=>{let{start:t,end:e}=o,[n,i]=t,[r,a]=e,l=r-n,u=a-i;return l*u},Rd=o=>{let{start:t,end:e}=o,[n]=t,[i]=e;return i-n},po=typeof window<"u"?requestAnimationFrame:o=>setTimeout(o,0);function dy(o){return o.horizontalChange||o.verticalChange}var ln=class extends et{constructor(e){let n=An(e,`${e}:MatrixBrain`);super(n);this.scrolling=!1;this.RENDER_COUNT_SAFETY_MARGIN_START=1;this.RENDER_COUNT_SAFETY_MARGIN_END=1;this.availableWidth=0;this.availableRenderWidth=0;this.isHorizontalLayoutBrain=!1;this.name="";this.availableHeight=0;this.availableRenderHeight=0;this.cols=0;this.rows=0;this.alwaysRenderedColumns=new Set;this._rowsPerPage=0;this.rowHeight=0;this.colWidth=0;this.verticalTotalSize=0;this.horizontalTotalSize=0;this.horizontalRenderCount=void 0;this.verticalRenderCount=void 0;this.maxHorizontalRenderCount=0;this.maxVerticalRenderCount=0;this.horizontalExtendRangeBy=yi;this.verticalExtendRangeBy=yi;this.horizontalRenderRange={startIndex:0,endIndex:0};this.verticalRenderRange={startIndex:0,endIndex:0};this.extraSpanCells=[];this.scrollPosition={scrollLeft:0,scrollTop:0};this.onScrollFns=[];this.onRenderRangeChangeFns=new Set;this.onVerticalRenderRangeChangeFns=new Set;this.onHorizontalRenderRangeChangeFns=new Set;this.onDestroyFns=[];this.destroyed=!1;this.onRenderCountChangeFns=new Set;this.onAvailableSizeChangeFns=new Set;this.onScrollStartFns=[];this.onScrollStopFns=[];this.scrollTimeoutId=0;this.scrollStopDelay=250;this.fixedColsStart=0;this.fixedColsEnd=0;this.fixedRowsStart=0;this.fixedRowsEnd=0;this.setScrollStopDelay=e=>{this.scrollStopDelay=e};this.getRowCount=()=>this.rows;this.getColCount=()=>this.cols;this.setScrolling=e=>{let n=this.scrolling;this.scrolling=e,e&&(this.scrollTimeoutId&&clearTimeout(this.scrollTimeoutId),this.scrollTimeoutId=setTimeout(()=>{this.setScrolling(!1),this.scrollTimeoutId=0},this.scrollStopDelay)),e!==n&&(e?this.notifyScrollStart():this.notifyScrollStop())};this.notifyScrollStart=()=>{if(this.destroyed)return;let e=this.onScrollStartFns;for(let n=0,i=e.length;n<i;n++)e[n]()};this.notifyScrollStop=()=>{if(this.destroyed)return;let e=this.onScrollStopFns,n=this.scrollPosition,i=this.getRenderRange();for(let r=0,a=e.length;r<a;r++)e[r](n,i)};this.notifyAvailableSizeChange=()=>{if(this.destroyed)return;let e=this.onAvailableSizeChangeFns,n=this.getAvailableSize();e.forEach(i=>{po(()=>{this.destroyed||e.has(i)&&i(n)})})};this.notifyVerticalRenderRangeChange=(e=!1)=>{if(this.destroyed)return;let n=this.onVerticalRenderRangeChangeFns,i=this.verticalRenderRange,r=e?oa:po;n.forEach(a=>{r(()=>{this.destroyed||n.has(a)&&a([i.startIndex,i.endIndex])})})};this.notifyHorizontalRenderRangeChange=(e=!1)=>{if(this.destroyed)return;let n=this.onHorizontalRenderRangeChangeFns,i=this.horizontalRenderRange,r=e?oa:po;n.forEach(a=>{r(()=>{this.destroyed||n.has(a)&&a([i.startIndex,i.endIndex])})})};this.isColFixedEnd=e=>this.fixedColsEnd?e>=this.cols-this.fixedColsEnd:!1;this.isColFixedStart=e=>this.fixedColsStart?e<this.fixedColsStart:!1;this.isRowFixedEnd=e=>this.fixedRowsEnd?e>=this.rows-this.fixedRowsEnd:!1;this.isRowFixedStart=e=>this.fixedRowsStart?e<this.fixedRowsStart:!1;this.isColFixed=e=>this.isColFixedStart(e)||this.isColFixedEnd(e);this.isRowFixed=e=>this.isRowFixedStart(e)||this.isRowFixedEnd(e);this.getFixedEndColsWidth=()=>{if(!this.fixedColsEnd)return 0;let e=0;for(let n=this.cols-this.fixedColsEnd;n<this.cols;n++)e+=this.getColWidth(n);return e};this.getFixedEndColsOffsets=({skipScroll:e}={skipScroll:!1})=>{if(!this.fixedColsEnd)return[];let{scrollLeft:n}=this.scrollPosition,{width:i}=this.getAvailableSize(),r=[],a=[],l=0;for(let s=this.cols-this.fixedColsEnd;s<this.cols;s++){let c=this.getColWidth(s);a.push(c),l+=c}let u=i-l+(e?0:n);l=0;let d=0;for(let s=this.cols-this.fixedColsEnd;s<this.cols;s++){let c=u+l;r[s]=c,l+=a[d],d++}return r};this.getFixedEndRowsOffsets=({skipScroll:e}={skipScroll:!1})=>{if(!this.fixedRowsEnd)return[];let{scrollTop:n}=this.scrollPosition,{height:i}=this.getAvailableSize(),r=[],a=[],l=0;for(let s=this.rows-this.fixedRowsEnd;s<this.rows;s++){let c=this.getRowHeight(s);a.push(c),l+=c}let u=i-l+(e?0:n);l=0;let d=0;for(let s=this.rows-this.fixedRowsEnd;s<this.rows;s++){let c=u+l;r[s]=c,l+=a[d],d++}return r};this.getFixedStartColsWidth=()=>{if(!this.fixedColsStart)return 0;let e=0;for(let n=0;n<this.fixedColsStart;n++)e+=this.getColWidth(n);return e};this.getFixedEndRowsHeight=()=>{if(!this.fixedRowsEnd)return 0;let e=0;for(let n=this.rows-this.fixedRowsEnd;n<this.rows;n++)e+=this.getRowHeight(n);return e};this.getFixedStartRowsHeight=()=>{if(!this.fixedRowsStart)return 0;let e=0;for(let n=0;n<this.fixedRowsStart;n++)e+=this.getRowHeight(n);return e};this.computeRenderCount=(e=zt)=>{let n=e.horizontal,i=e.vertical,r=this.horizontalRenderCount||0,a=this.verticalRenderCount||0;return n&&(r=this.computeDirectionalRenderCount("horizontal",this.colWidth,this.cols,this.getAvailableRenderSize())),i&&(a=this.computeDirectionalRenderCount("vertical",this.rowHeight,this.rows,this.getAvailableRenderSize())),{horizontal:r,vertical:a}};this.setRenderCount=({horizontal:e,vertical:n})=>{e===void 0&&(e=this.horizontalRenderCount),n===void 0&&(n=this.verticalRenderCount);let i=e===this.horizontalRenderCount,r=n===this.verticalRenderCount;i&&r||(this.horizontalRenderCount=e,this.verticalRenderCount=n,this.updateRenderRange({horizontal:!i,vertical:!r}),this.notifyRenderCountChange())};this.updateFixedCells=e=>{e.fixedColsStart!=this.fixedColsStart&&(this.fixedColsStart=e.fixedColsStart||0),e.fixedColsEnd!=this.fixedColsEnd&&(this.fixedColsEnd=e.fixedColsEnd||0),e.fixedRowsStart!=this.fixedRowsStart&&(this.fixedRowsStart=e.fixedRowsStart||0),e.fixedRowsEnd!=this.fixedRowsEnd&&(this.fixedRowsEnd=e.fixedRowsEnd||0)};this.getFixedCellInfo=()=>{let{fixedRowsStart:e,fixedColsStart:n,fixedRowsEnd:i,fixedColsEnd:r}=this;return{fixedRowsStart:e,fixedColsStart:n,fixedRowsEnd:i,fixedColsEnd:r}};this.updateRenderRange=(e=zt)=>{this.setRenderRange(this.computeRenderRange(e))};this.getExtraSpanCellsForRange=({horizontal:e,vertical:n})=>{let{colspan:i,rowspan:r}=this,a=[];if(r){let l=n.startIndex,u=e.startIndex,d=e.endIndex;for(let s=u;s<d;s++){this.computeItemSpanUpTo(l,s,"vertical");let c=this.rowspanParent.get(s);if(c[l]!=l){let f=l;for(;c[f]!=f;)f--;a.push([f,s])}}}if(i){let l=e.startIndex,u=n.startIndex,d=n.endIndex;for(let s=u;s<d;s++){this.computeItemSpanUpTo(s,l,"horizontal");let c=this.colspanParent.get(s);if(c[l]!=l){let f=l;for(;c[f]!=f;)f--;a.push([s,f])}}}return a};this.computeRenderRange=(e=zt)=>{let n=e.horizontal?this.computeDirectionalRenderRange("horizontal"):this.horizontalRenderRange,i=e.vertical?this.computeDirectionalRenderRange("vertical"):this.verticalRenderRange;return{horizontal:n,vertical:i,extraCells:this.getExtraSpanCellsForRange({horizontal:n,vertical:i})}};this.computeDirectionalRenderRange=e=>{let n=e==="horizontal"?this.colWidth:this.rowHeight,i=e==="horizontal"?this.horizontalRenderCount:this.verticalRenderCount,r=e==="horizontal"?this.cols:this.rows;if(!i)return{startIndex:0,endIndex:0};let a=(e==="horizontal"?this.fixedColsStart:this.fixedRowsStart)||0,l=e==="horizontal"?this.scrollPosition.scrollLeft:this.scrollPosition.scrollTop;l+=this.getFixedStartSize(e);let u=typeof n!="function",d=e==="horizontal"?this.horizontalExtendRangeBy:this.verticalExtendRangeBy,s=this.getItemAt(l,e),c=d.start||0,f=d.end||0;u||(c+=this.RENDER_COUNT_SAFETY_MARGIN_START,f+=this.RENDER_COUNT_SAFETY_MARGIN_END),c&&(s=Math.max(0,s-c),i+=c),f&&(i+=f);let m=s+i,p=Math.max(a,r-(e==="horizontal"?this.fixedColsEnd:this.fixedRowsEnd));return m>p&&(m=p,s=Math.max(a,m-i)),{startIndex:s,endIndex:m}};this.getItemAt=(e,n)=>{let i=n==="horizontal"?this.colWidth:this.rowHeight,r=n==="horizontal"?this.cols:this.rows;if(typeof i!="function")return Math.min(Math.max(0,Math.floor(e/i)),r-1);let a=n==="horizontal"?this.colOffsetCache:this.rowOffsetCache,l=n==="horizontal"?this.colWidthCache:this.rowHeightCache,u=a.length-1,d=l.length-1,s=a[u],c;for(;s<e;)if(u>=r||(d+=1,this.computeCacheFor(d,n),c=s,s=a[d],c===s&&c!=0))return r-1;let f=(0,vd.default)(a,e,na);return f>=0?f:~f-1};this.computeCacheFor=(e,n)=>{let i=n==="horizontal"?this.colWidth:this.rowHeight,r=n==="horizontal"?this.colWidthCache:this.rowHeightCache,a=n==="horizontal"?this.colOffsetCache:this.rowOffsetCache;if(typeof i!="function")return;let l=i(e);if(r[e]=l,e>0){let u=a[e-1],d=r[e-1];u==null&&console.error(`Offset was not available for ${n==="horizontal"?"col":"row"} ${e-1}`),d==null&&console.error(`Size was not available for ${n==="horizontal"?"col":"row"} ${e-1}`);let s=u+d;a[e]=s}};this.computeItemSpanUpTo=(e,n,i)=>{let r=i==="horizontal"?n:e,a=i==="horizontal"?e:n,l=i==="horizontal"?this.cols:this.rows,u=i==="horizontal"?this.colspan:this.rowspan;if(!u)return;let d=i==="horizontal"?this.colspanParent:this.rowspanParent;d.has(a)||d.set(a,[]);let s=i==="horizontal"?this.colspanValue:this.rowspanValue;s.has(a)||s.set(a,[]);let c=d.get(a),f=s.get(a);if(c[r]===void 0){let m=c.length,p=l?Math.min(r,l-1):0,h={rowIndex:e,colIndex:n};for(;m<=p;m++)if(c[m]===void 0){h[i==="horizontal"?"colIndex":"rowIndex"]=m;let y=u(h);c[m]=m,f[m]=y;let C=m;for(;y>1;)C+=1,c[C]=m,f[C]=0,y-=1}}};this.getCellSpan=(e,n,i)=>{let r=i==="horizontal"?this.colspan:this.rowspan,a=i==="horizontal"?n:e,l=i==="horizontal"?e:n;if(!r)return 1;let u=i==="horizontal"?this.colspanValue:this.rowspanValue,d=u.get(l);return(!d||d[a]===void 0)&&this.computeItemSpanUpTo(e,n,i),d||(d=u.get(l)),d[a]||1};this.getRowspan=(e,n)=>this.getCellSpan(e,n,"vertical");this.getColspan=(e,n)=>this.getCellSpan(e,n,"horizontal");this.getRowspanParent=(e,n)=>this.getItemSpanParent(e,n,"vertical");this.getColspanParent=(e,n)=>this.getItemSpanParent(e,n,"horizontal");this.getItemSpanParent=(e,n,i)=>{let r=i=="horizontal"?this.colspan:this.rowspan,a=i==="horizontal"?n:e,l=i==="horizontal"?e:n;if(!r)return a;let u=i==="horizontal"?this.colspanParent:this.rowspanParent,d=u.get(l);return(!d||d[a]===void 0)&&this.computeItemSpanUpTo(e,n,i),d||(d=u.get(l)),d[a]};this.getRowHeightWithSpan=(e,n,i)=>this.getItemSizeWithSpan(e,n,i,"vertical");this.getColWidthWithSpan=(e,n,i)=>this.getItemSizeWithSpan(e,n,i,"horizontal");this.getItemSizeWithSpan=(e,n,i,r)=>{let a=r==="horizontal"?n:e,l=this.getItemSize(a,r);for(;i>1;)a+=1,i-=1,l+=this.getItemSize(a,r);return l};this.getRowHeight=e=>this.getItemSize(e,"vertical");this.getColWidth=e=>this.getItemSize(e,"horizontal");this.getItemSize=(e,n)=>{let i=n==="horizontal"?this.cols:this.rows,r=n==="horizontal"?this.colWidth:this.rowHeight;if(typeof r!="function")return r;let a=this.getItemSizeCacheFor(e,n),l=n==="horizontal"?this.colWidthCache:this.rowHeightCache;if(a===void 0){let u=l.length,d=Math.min(e,i-1);for(;u<=d;u++)this.computeCacheFor(u,n);a=this.getItemSizeCacheFor(e,n)}return a};this.keepColumnRendered=e=>(this.alwaysRenderedColumns.add(e),()=>{this.alwaysRenderedColumns.delete(e)});this.getAlwaysRenderedColumns=()=>Array.from(this.alwaysRenderedColumns);this.setRenderRange=({horizontal:e,vertical:n,extraCells:i})=>{let r=!1;(e.startIndex!==this.horizontalRenderRange.startIndex||e.endIndex!==this.horizontalRenderRange.endIndex)&&(this.horizontalRenderRange=e,r=!0);let a=!1;(n.startIndex!==this.verticalRenderRange.startIndex||n.endIndex!==this.verticalRenderRange.endIndex)&&(this.verticalRenderRange=n,a=!0),this.extraSpanCells=i||[],(r||a)&&this.notifyRenderRangeChange(),a&&this.notifyVerticalRenderRangeChange(),r&&this.notifyHorizontalRenderRangeChange()};this.getRenderRangeCellCount=ia;this.getMaxCellCount=()=>this.maxHorizontalRenderCount*this.maxVerticalRenderCount;this.getExtraCells=()=>this.extraSpanCells;this.getScrollPosition=()=>this.scrollPosition;this.getRenderRange=()=>({start:[this.verticalRenderRange.startIndex,this.horizontalRenderRange.startIndex],end:[this.verticalRenderRange.endIndex,this.horizontalRenderRange.endIndex]});this.onScroll=e=>(this.onScrollFns.push(e),()=>{this.onScrollFns=this.onScrollFns.filter(n=>n!==e)});this.onScrollStart=e=>(this.onScrollStartFns.push(e),()=>{this.onScrollStartFns=this.onScrollStartFns.filter(n=>n!==e)});this.onScrollStop=e=>(this.onScrollStopFns.push(e),()=>{this.onScrollStopFns=this.onScrollStopFns.filter(n=>n!==e)});this.onRenderRangeChange=e=>(this.onRenderRangeChangeFns.add(e),()=>{this.onRenderRangeChangeFns.delete(e)});this.onVerticalRenderRangeChange=e=>(this.onVerticalRenderRangeChangeFns.add(e),()=>{this.onVerticalRenderRangeChangeFns.delete(e)});this.onHorizontalRenderRangeChange=e=>(this.onHorizontalRenderRangeChangeFns.add(e),()=>{this.onHorizontalRenderRangeChangeFns.delete(e)});this.onRenderCountChange=e=>(this.onRenderCountChangeFns.add(e),()=>{this.onRenderCountChangeFns.delete(e)});this.onAvailableSizeChange=e=>(this.onAvailableSizeChangeFns.add(e),()=>{this.onAvailableSizeChangeFns.delete(e)});this.onDestroy=e=>(this.onDestroyFns.push(e),()=>{this.onDestroyFns=this.onDestroyFns.filter(n=>n!==e)});this.getAvailableSize=()=>({width:this.availableWidth,height:this.availableHeight});this.getAvailableRenderSize=()=>({width:this.availableRenderWidth??this.availableWidth,height:this.availableRenderHeight??this.availableHeight});this.name=n,this.update=this.update.bind(this),this.destroy=this.destroy.bind(this),this.getCellOffset=this.getCellOffset.bind(this),this.reset()}set rowsPerPage(e){e!=this._rowsPerPage&&(this._rowsPerPage=e)}get rowsPerPage(){return this._rowsPerPage}reset(e=zt){e.vertical&&this.resetVertical(),e.horizontal&&this.resetHorizontal(),this.extraSpanCells=[]}resetVertical(){this.rowspanParent=new Map,this.rowspanValue=new Map,this.rowHeightCache=[],this.rowOffsetCache=[0],this.verticalRenderCount=void 0,this.verticalTotalSize=0,this.verticalRenderRange={startIndex:0,endIndex:0}}resetHorizontal(){this.colspanParent=new Map,this.colspanValue=new Map,this.colWidthCache=[],this.colOffsetCache=[0],this.horizontalRenderCount=void 0,this.horizontalTotalSize=0,this.horizontalRenderRange={startIndex:0,endIndex:0}}getVirtualColIndex(e,n){return e}update(e,n){let{rows:i,cols:r,rowHeight:a,colWidth:l,width:u,height:d}=e,s=typeof u=="number",c=typeof d=="number",f=s&&u!==this.availableWidth,m=c&&d!==this.availableHeight;f&&(this.availableWidth=u,this.availableRenderWidth=u),m&&(this.availableHeight=d,this.availableRenderHeight=d),(f||m)&&this.notifyAvailableSizeChange();let p=typeof i=="number",h=typeof r=="number",y=p&&i!==this.rows,C=h&&r!==this.cols;p&&(this.rows=i,this.rowsPerPage=i),h&&(this.cols=r);let b=a!=null,w=l!=null,S=b&&a!==this.rowHeight,T=w&&l!==this.colWidth;b&&(this.rowHeight=a),w&&(this.colWidth=l);let I=e.rowspan!=null,x=e.colspan!=null,F=I&&e.rowspan!=this.rowspan,N=x&&e.colspan!=this.colspan;F&&(this.rowspan=e.rowspan),N&&(this.colspan=e.colspan);let R=C||T||f||N,A=y||S||m||F;(n||dy)({horizontalChange:R,verticalChange:A,colsChanged:C,colWidthChanged:T,widthChanged:f,colspanChanged:N,rowsChanged:y,rowHeightChanged:S,heightChanged:m,rowspanChanged:F})&&this.updateRenderCount({horizontal:R,vertical:A})}extendRenderRange(e){let{direction:n}=e,i=n==="horizontal",r=i?this.horizontalRenderCount||this.getInitialCols():this.verticalRenderCount||this.getInitialRows(),a=typeof e.start=="number"?e.start:e.start===!0?r:0,l=typeof e.end=="number"?e.end:e.end===!0?r:0;return i?this.horizontalExtendRangeBy={start:a,end:l}:this.verticalExtendRangeBy={start:a,end:l},this.updateRenderRange({horizontal:i,vertical:!i}),()=>{this.extendRenderRange({start:0,end:0,direction:n})}}updateRenderCount(e=zt){this.reset(e),this.doUpdateRenderCount(e)}doUpdateRenderCount(e=zt){if(!this.availableWidth||!this.availableHeight){let n={horizontal:void 0,vertical:void 0};this.availableWidth||(n.horizontal=0),this.availableHeight||(n.vertical=0),this.setRenderCount(n)}this.setRenderCount(this.computeRenderCount(e))}get scrollTopMax(){return this.getVirtualizedContentSize().height-this.availableHeight}get scrollLeftMax(){return this.getVirtualizedContentSize().width-this.availableWidth}setScrollPosition(e,n){this.setScrolling(!0);let i=e.scrollLeft!==this.scrollPosition.scrollLeft,r=e.scrollTop!==this.scrollPosition.scrollTop;this.scrollPosition=e,(i||r)&&(n?.(e),this.updateRenderRange({horizontal:i,vertical:r}),this.notifyScrollChange())}notifyRenderRangeChange(e=!1){if(this.destroyed)return;let n=this.onRenderRangeChangeFns,i=this.getRenderRange(),r=e?oa:po;n.forEach(a=>{r(()=>{this.destroyed||n.has(a)&&a(i)})})}notifyScrollChange(){if(this.destroyed)return;let{scrollPosition:e}=this,n=this.onScrollFns;for(let i=0,r=n.length;i<r;i++)n[i](e)}computeDirectionalRenderCount(e,n,i,r){let a=0,l=e==="horizontal"?r.width:r.height;if(l-=this.getFixedSize(e),l<=0)return 0;let u=e==="horizontal"?this.fixedColsStart:this.fixedRowsStart,d=e==="horizontal"?this.fixedColsEnd:this.fixedRowsEnd;if(typeof n=="function"){let s=[],c=0,f=i;c+=u,f-=d;for(let m=c;m<f;m++)s.push(this.getItemSize(m,e));a=gi(l,s)}else a=(n?Math.ceil(l/n):0)+1;return a+=u+d,e==="horizontal"?this.maxHorizontalRenderCount=a:this.maxVerticalRenderCount=a,a=Math.min(i,a),a}getFixedSize(e){return e==="horizontal"?this.getFixedStartColsWidth()+this.getFixedEndColsWidth():this.getFixedStartRowsHeight()+this.getFixedEndRowsHeight()}getFixedStartSize(e){return e==="horizontal"?this.getFixedStartColsWidth():this.getFixedStartRowsHeight()}getFixedEndSize(e){return e==="horizontal"?this.getFixedEndColsWidth():this.getFixedEndRowsHeight()}notifyRenderCountChange(){if(this.destroyed)return;let{horizontalRenderCount:e,verticalRenderCount:n}=this,i={horizontal:e,vertical:n},r=this.onRenderCountChangeFns;r.forEach(a=>{po(()=>{this.destroyed||r.has(a)&&a(i)})})}getCellOffset(e,n){return{x:this.getItemOffsetFor(n,"horizontal"),y:this.getItemOffsetFor(e,"vertical")}}getInitialRowHeight(){return this.rowHeight}getInitialCols(){return this.cols}getInitialRows(){return this.rows}getItemOffsetFor(e,n){let i=n==="horizontal"?this.colWidth:this.rowHeight;if(typeof i!="function")return e*i;let r=n==="horizontal"?this.colOffsetCache:this.rowOffsetCache,a=n==="horizontal"?this.colWidthCache:this.rowHeightCache,l=r[e];if(l==null){let u=a.length-1;for(;u<e;)u+=1,this.computeCacheFor(u,n);l=r[e]}return l}getItemSizeCacheFor(e,n){return(n==="horizontal"?this.colWidthCache:this.rowHeightCache)[e]}getRowIndexInPage(e){return e}getPageIndexForRow(e){return 0}getVirtualizedContentSize(){return{height:this.getVirtualizedContentSizeFor("vertical"),width:this.getVirtualizedContentSizeFor("horizontal")}}getVirtualizedContentSizeFor(e){let n=e==="horizontal"?this.cols:this.rows,i=e==="horizontal"?this.colWidth:this.rowHeight,r=e==="horizontal"?this.horizontalTotalSize:this.verticalTotalSize;if(typeof i!="function")return i*n;if(r!==0&&!isNaN(r))return r;let a=e==="horizontal"?this.colOffsetCache:this.rowOffsetCache,l=n?this.getItemSize(n-1,e):0,u=n?a[n-1]:0,d=l+u;return e==="horizontal"?this.horizontalTotalSize=d:this.verticalTotalSize=d,d}notifyDestroy(){let e=this.onDestroyFns;for(let n=0,i=e.length;n<i;n++)e[n]()}destroy(){this.destroyed||(this.notifyDestroy(),this.reset(),this.rowspanParent.clear(),this.colspanParent.clear(),this.alwaysRenderedColumns.clear(),this.horizontalExtendRangeBy=yi,this.verticalExtendRangeBy=yi,this.destroyed=!0,this.onDestroyFns=[],this.onScrollFns=[],this.onScrollStartFns=[],this.onScrollStopFns=[],this.onRenderCountChangeFns.clear(),this.onRenderRangeChangeFns.clear(),this.onVerticalRenderRangeChangeFns.clear(),this.onHorizontalRenderRangeChangeFns.clear())}};var cy={scrollLeft:0,scrollTop:0},mo=class{constructor(){this.scrollPosition=cy;this.onScrollFns=[];this.getScrollPosition=()=>this.scrollPosition;this.onScroll=t=>(this.onScrollFns.push(t),()=>{this.onScrollFns=this.onScrollFns.filter(e=>e!==t)});this.setScrollPosition=t=>{this.scrollPosition=t,this.notifyScrollChange()};this.destroy=()=>{this.onScrollFns=[]}}notifyScrollChange(){let{scrollPosition:t}=this,e=this.onScrollFns;for(let n=0,i=e.length;n<i;n++)e[n](t)}};var{rootClassName:fy}=Le,mt=`${fy}ColumnCell`;function Id(o,t){let e=new Map;function n(i){return t[i]!==!1}return Object.keys(o).forEach(i=>{let a=o[i].columnGroup,l=0;for(n(i)||(l=-1);a;){let u=o[a];if(!u)break;n(a)&&l++,a=u.columnGroup}e.set(i,l)}),e}import{h as py}from"vue";function xd(o){return(t,e)=>py(o,{key:t.id,rowInfo:t,cache:e})}var ho=class extends ln{constructor(e,n){super(`${e}:HorizontalLayout`);this.visiblePageCount=0;this.isHorizontalLayoutBrain=!0;this._totalPageCount=0;this.pageWidth=0;this.initialCols=0;this.initialRows=0;this.initialColWidth=0;this.colWidth=()=>10;this.getColWidth=e=>typeof this.initialColWidth=="number"?this.initialColWidth:this.initialColWidth(e%this.initialCols);this.onTotalPageCountChangeFns=new Set;this.onTotalPageCountChange=e=>(this.onTotalPageCountChangeFns.add(e),()=>{this.onTotalPageCountChangeFns.delete(e)});this.options=n,this.options.masterBrain&&this.options.masterBrain.onTotalPageCountChange(()=>{this.updateRenderCount({horizontal:!0,vertical:!0})})}computeDirectionalRenderCount(e,n,i,r){if(e==="vertical"||typeof n=="number")return super.computeDirectionalRenderCount(e,n,i,r);let a=0,l=r.width,u=Math.floor(l/this.pageWidth);a+=u*this.initialCols;let d=l-u*this.pageWidth,s=[];for(let c=0;c<this.initialCols;c++)s.push(this.getItemSize(c,e));return a+=gi(d,s.concat(s)),e==="horizontal"?this.maxHorizontalRenderCount=a:this.maxVerticalRenderCount=a,a=Math.min(i,a),a}getRowIndexInPage(e){return this.rowsPerPage?e%this.rowsPerPage:e}getInitialCols(){return this.initialCols}getInitialRows(){return this.initialRows}getPageIndexForRow(e){return Math.floor(e/this.rowsPerPage)}getMatrixCoordinatesForHorizontalLayoutPosition(e){let n=e.rowIndex,i=e.colIndex;return e.rowIndex>=this.rowsPerPage&&this.rowsPerPage>0&&(n=e.rowIndex%this.rowsPerPage,i=Math.floor(e.rowIndex/this.rowsPerPage)*this.initialCols+i),{rowIndex:n,colIndex:i}}getHorizontalLayoutPositionFromMatrixCoordinates(e){let n=e.rowIndex,i=e.colIndex;if(e.colIndex>=this.initialCols&&this.initialCols>0){let r=Math.floor(e.colIndex/this.initialCols);i=e.colIndex-r*this.initialCols,n=this.rowsPerPage*r+e.rowIndex}return{colIndex:Math.min(i,this.initialCols),rowIndex:this.options.isHeader?n:Math.min(n,this.initialRows)}}update(e){let{rows:n,cols:i,rowHeight:r,colWidth:a,width:l,height:u}=e,d=typeof l=="number",s=typeof u=="number",c=d&&l!==this.availableWidth,f=s&&u!==this.availableHeight;c&&(this.availableWidth=l,this.availableRenderWidth=l),f&&(this.availableHeight=u,this.availableRenderHeight=u),(c||f)&&this.notifyAvailableSizeChange();let m=typeof n=="number",p=typeof i=="number",h=m&&n!==this.initialRows,y=p&&i!==this.initialCols;m&&h&&(this.initialRows=n,this.rows=n),p&&y&&(this.initialCols=i,this.cols=i);let C=r!=null,b=a!=null,w=C&&r!==this.rowHeight,S=b&&a!==this.initialColWidth;C&&(this.rowHeight=r),b&&(this.initialColWidth=a,this.colWidth=this.getColWidth);let T=h||w||f,I=y||S||c||T;(I||T)&&this.updateRenderCount({horizontal:I,vertical:T})}getInitialRowHeight(){return typeof this.rowHeight!="number"?this.getRowHeight(0):this.rowHeight}get totalPageCount(){return this.options.masterBrain?this.options.masterBrain.totalPageCount:this._totalPageCount}set totalPageCount(e){this.options.masterBrain||(this._totalPageCount=e)}getPageWidth(){return this.pageWidth}doUpdateRenderCount(e=zt){let n=this.getInitialRowHeight(),i=0;for(let a=0;a<this.initialCols;a++)i+=this.getColWidth(a);this.pageWidth=i,this.rowsPerPage=Math.floor(this.availableHeight/n);let r=!1;if(!this.options.masterBrain){let a=this.totalPageCount;this.totalPageCount=this.rowsPerPage?Math.ceil(this.initialRows/this.rowsPerPage):0,a!=this.totalPageCount&&(r=!0)}this.visiblePageCount=this.totalPageCount&&this.pageWidth?Math.max(Math.ceil(this.availableWidth/this.pageWidth),1):1,this.availableRenderHeight=this.visiblePageCount*this.rowsPerPage*n,this.cols=Math.max(this.totalPageCount*this.initialCols,this.initialCols),this.rows=this.rowsPerPage,super.doUpdateRenderCount(e),r&&this.notifyTotalPageCountChange()}notifyTotalPageCountChange(){if(this.destroyed)return;let e=this.onTotalPageCountChangeFns;e.forEach(n=>{ke(()=>{this.destroyed||e.has(n)&&n(this.totalPageCount)})})}getVirtualColIndex(e,n){return this.initialCols*(n?.pageIndex??0)+e}destroy(){this.destroyed||(super.destroy(),this.options.masterBrain=void 0,this.onTotalPageCountChangeFns.clear())}getVirtualizedContentSizeFor(e){return e==="vertical"?this.getInitialRowHeight()*this.rowsPerPage:this.pageWidth*this.totalPageCount}};var ra=Gn(wn());function Pd(...o){if(!o.length)return new Set;let[t,...e]=o;return new Set([...t].filter(n=>e.every(i=>i.has(n))))}function Dd(o,t){let e=new Set;for(let n of o)t(n)&&e.add(n);return e}function go(o,t){for(let e of o)if(t(e))return e}var bi=(o,t)=>o-t,Ci=class extends et{constructor(e,n){super(`${e}:GridCellManager`);this.matrix=new W;this.rowsWithCellsHistory=new Map;this.columnsWithCellsHistory=new Map;this.cellToMatrixPosition=new WeakMap;this.getCellsOutsideRenderRange=e=>{let{start:n,end:i}=e,[r,a]=n,[l,u]=i,d=new Set;return this.matrix.visit(({value:s},c)=>{if(!s)return;let[f,m]=c,p=f<r,h=f>=l,y=m<a,C=m>=u;(p||h||y||C)&&d.add(s)}),d};this.debugId=e,this.pool=n,this.offRemoveCell=this.pool.onRemoveCell(i=>this.onRemoveCell(i))}onRemoveCell(e){let n=this.cellToMatrixPosition.get(e);this.cellToMatrixPosition.delete(e),n&&this.clearCellFromMatrix(e,n,{skipHistory:!1})}set poolSize(e){this.pool.poolSize=e}get poolSize(){return this.pool.poolSize}getDetachedCell(){return this.pool.getDetachedCell()}clearCellFromMatrix(e,n,i){if(this.matrix.delete(n),i.skipHistory)return;let[r,a]=n,l=this.rowsWithCellsHistory.get(r),u=this.columnsWithCellsHistory.get(a);l&&(l.delete(e),l.size===0&&this.rowsWithCellsHistory.delete(r)),u&&(u.delete(e),u.size===0&&this.columnsWithCellsHistory.delete(a))}addCellToMatrix(e,n){let[i,r]=n;this.matrix.set(n,e),this.cellToMatrixPosition.set(e,n);let a=this.rowsWithCellsHistory.get(i),l=this.columnsWithCellsHistory.get(r);a?a.add(e):(a=new Set,a.add(e),this.rowsWithCellsHistory.set(i,a)),l?l.add(e):(l=new Set,l.add(e),this.columnsWithCellsHistory.set(r,l))}setCellPositionInMatrix(e,n){let i=this.cellToMatrixPosition.get(e);if(n==null){i&&this.clearCellFromMatrix(e,i,{skipHistory:!0});return}let[r,a]=n,l=i&&i[0]===r&&i[1]===a;i&&!l&&this.clearCellFromMatrix(e,i,{skipHistory:!1}),this.addCellToMatrix(e,n)}renderNodeAtCell(e,n,i,r){let a=this.getCellAt(i);return a&&a!==n&&this.detachCellAt(i),this.pool.attachCell(n),this.setCellPositionInMatrix(n,i),n.update(e,r),n}getCellPosition(e){let n=this.cellToMatrixPosition.get(e);return!n||this.getCellAt(n)!=e?null:n}getCellAt(e){return this.matrix.get(e)}getCellFor(e,n){let i=this.getCellAt(e);if(i)return i;let[r,a]=e;if(n==="row"){let l=this.rowsWithCellsHistory.get(r);l&&(i=go(l,u=>!this.isCellAttached(u)))}if(n==="column"){let l=this.columnsWithCellsHistory.get(a);l&&(i=go(l,u=>!this.isCellAttached(u)))}return i??this.getDetachedCell()}isCellAttached(e){return this.getCellPosition(e)!==null}isCellAttachedAt(e){let n=this.getCellAt(e);return n?this.isCellAttached(n):!1}getMatrix(){let e=this.getRowsWithCells().pop()??-1,n=this.getColumnsWithCells().pop()??-1;return Array.from({length:e+1},(r,a)=>Array.from({length:n+1},(u,d)=>{let s=[a,d],c=this.getCellAt(s);return c?c.getNode():null}))}getAllCells(){return[...this.pool.getAllCells()]}getCellsForRow(e){return this.matrix.getKeysStartingWith([e]).map(n=>this.getCellAt(n)).filter(Boolean)}getOneAttachedCell(){return this.pool.getAttachedCells().values().next().value}getRowsWithCells(){return this.matrix.rawKeysAt([]).sort(bi)}getColumnsWithCells(){let e=this.matrix.getKeysOfFirstChildOnEachBranchStartingWith([],{excludeSelf:!0});return[...new Set(e.map(i=>i[1])).values()].sort(bi)}isRowAttached(e){return this.getRowsWithCells().includes(e)}isColumnAttached(e){return this.getColumnsWithCells().includes(e)}detachRow(e){this.matrix.getKeysStartingWith([e]).forEach(i=>this.detachCellAt(i))}detachCol(e){this.matrix.visit((n,i)=>{i[1]===e&&this.detachCellAt(i)})}detachCell(e){return e?(this.pool.detachCell(e)&&this.setCellPositionInMatrix(e,null),!0):!1}detachCells(e){e.forEach(n=>this.detachCell(n))}detachRowsStartingWith(e){let n=this.getRowsWithCells().sort(),i=(0,ra.default)(n,e,bi);i<0&&(i=~i),n.slice(i).forEach(a=>this.detachRow(a))}detachColsStartingWith(e){let n=this.getColumnsWithCells().sort(),i=(0,ra.default)(n,e,bi);i<0&&(i=~i),n.slice(i).forEach(a=>this.detachCol(a))}detachCellsStartingAt(e){let[n,i]=e;this.matrix.visit((r,a)=>{let[l,u]=a;l>n&&this.detachCellAt(a),l===n&&u>=i&&this.detachCellAt(a)})}detachCellAt(e){let n=this.getCellAt(e);return n?this.detachCell(n):!1}onCellAttachmentChange(e){return this.pool.onCellAttachmentChange(e)}getCellFromListForRow(e,n){return go(e,i=>this.getCellPosition(i)?.[0]===n)}getCellFromListForColumn(e,n){return go(e,i=>this.getCellPosition(i)?.[1]===n)}getCellCountInMatrix(){return this.matrix.size}flushPendingAfterCommitWork(){this.pool.flushPendingAfterCommitWork()}destroy(){this.reset()}reset(){this.pool.reset(),this.matrix.clear(),this.rowsWithCellsHistory.clear(),this.columnsWithCellsHistory.clear(),this.offRemoveCell(),this.offRemoveCell=()=>{}}makeDetachedCellsEmpty(){this.pool.getDetachedCells().forEach(e=>{e.update(null)})}withDetachedCells(e){this.pool.getDetachedCells().forEach(e)}};var Ad=Gn(wn());var Ti=class extends et{constructor(e,n){super(`${e}:ListRowManager`);this.indexToRow=new Map;this.rowToIndex=new WeakMap;this.debugId=e,this.pool=n,this.offRemoveRow=this.pool.onRemoveRow(i=>this.onRemoveRow(i))}onRemoveRow(e){let n=this.rowToIndex.get(e);n!=null&&(this.rowToIndex.delete(e),this.indexToRow.delete(n))}set poolSize(e){this.pool.poolSize=e}get poolSize(){return this.pool.poolSize}getDetachedRow(){return this.pool.getDetachedRow()}getRowFor(e){return this.getRowAt(e)??this.getDetachedRow()}setRowIndexInList(e,n){let i=this.rowToIndex.get(e);i!=null&&this.indexToRow.delete(i),n==null?this.rowToIndex.delete(e):(this.rowToIndex.set(e,n),this.indexToRow.set(n,e))}detachStartingWith(e){let n=this.getAttachedIndexes(),i=(0,Ad.default)(n,e,(a,l)=>a-l);i<0&&(i=~i),n.slice(i).forEach(a=>this.detachRowAt(a))}getRowAt(e){return this.indexToRow.get(e)}getRowIndex(e){return this.rowToIndex.get(e)}isRowAttached(e){return this.getRowIndex(e)!=null}isRowAttachedAt(e){return!!this.getRowAt(e)}getList(){let e=Math.max(...this.indexToRow.keys());return Array.from({length:e+1},(i,r)=>{let a=this.indexToRow.get(r);return a?a.getNode():null})}getAttachedCount(){return this.indexToRow.size}forEachAttachedRow(e){this.indexToRow.forEach(e)}getAttachedIndexes(){return Array.from(this.indexToRow.keys()).sort()}getAllRows(){return[...this.pool.getAllRows()]}detachRowAt(e){let n=this.getRowAt(e);n&&(this.setRowIndexInList(n,null),this.pool.detachRow(n))}detachRow(e){let n=this.getRowIndex(e);n!=null&&this.detachRowAt(n)}renderNodeAtRow(e,n,i){let r=this.getRowAt(i);return r&&r!==n&&this.detachRowAt(i),this.pool.attachRow(n),this.setRowIndexInList(n,i),n.update(e),n}makeDetachedRowsEmpty(){this.pool.getDetachedRows().forEach(e=>{e.update(null)})}onRowAttachmentChange(e){return this.pool.onRowAttachmentChange(e)}withDetachedRows(e){this.pool.getDetachedRows().forEach(e)}destroy(){this.reset()}reset(){this.pool.reset(),this.indexToRow.clear(),this.offRemoveRow(),this.offRemoveRow=()=>{}}};var _d=!0,sn=U(j.y),Ed=U(j.scrollTop),N1=U(j.columnOffsetAtIndex),aa=U(j.columnOffsetAtIndexWhileReordering),Fn=class extends et{constructor(e,n,i){n=n||"ReactHeadlessTableRenderer";super(n);this.debugId="";this.destroyed=!1;this.scrolling=!1;this.cellHoverClassNames=[];this.cellDetachedClassNames=[];this.lastEnteredRow=-1;this.lastExitedRow=-1;this.hoverRowUpdatesInProgress=new Map;this.infiniteNode=null;this.setDetailTransform=(e,n,{y:i,scrollTop:r,scrollLeft:a})=>{e.style.setProperty(sn,r?`calc( ${i}px + var(${Ed}) )`:`${i}px`),e.style.transform=`translate3d(${a||0}px, var(${sn}), 0)`};this.setTransform=(e,n,i,{x:r,y:a,scrollLeft:l,scrollTop:u},d)=>{let s=Ce.columnOffsets.get(i),c=`${aa}-${i}`,f=u?`calc( ${a}px + var(${Ed}) )`:`${a}px`;e.__currentTransformY!==f&&(e.__currentTransformY=f,e.style.setProperty(sn,f));let m=`translate3d(var(${c}, ${s}), var(${sn}), 0)`;e.__transformValue!==m&&(e.__transformValue=m,e.style.transform=m),d!=null};this.getFullyVisibleRowsRange=()=>{let{start:[e],end:[n]}=this.brain.getRenderRange();for(;!this.isRowFullyVisible(e);)if(e++,e===n)return null;for(;!this.isRowFullyVisible(n);)if(n--,n===e)return null;return{start:e,end:n}};this.getScrollPositionForScrollRowIntoView=(e,n={offset:0})=>{if(this.destroyed)return null;let{brain:i}=this,r=i.getScrollPosition(),a=r.scrollLeft,{scrollAdjustPosition:l,offset:u=0}=n;if(this.isRowFullyVisible(e)&&!l)return r;let d=i.getItemOffsetFor(e,"vertical"),s=i.getItemSize(e,"vertical"),c=i.getFixedStartRowsHeight(),f=i.getFixedEndRowsHeight(),m=r.scrollTop,p=i.getAvailableSize();if(!p.height)return null;let h=m+p.height;l||(l=d>h-f?"end":d<m+c?"start":"end");let y=r.scrollTop;if(l==="center"?y=d-Math.floor((i.getAvailableSize().height-c-f)/2):l==="start"?(u=-u,y+=d-m+u-c):(u+=s,y+=d-h+u+f),this.brain.isHorizontalLayoutBrain){let C=n.colIndex??Math.ceil(this.brain.getInitialCols()/2),b=this.getScrollPositionForScrollColumnIntoView(C,{...n,horizontalLayoutPageIndex:this.brain.getPageIndexForRow(e)});b&&(a=b.scrollLeft)}return{scrollLeft:a,scrollTop:y}};this.getScrollPositionForScrollColumnIntoView=(e,n={offset:0})=>{if(this.destroyed)return null;let{brain:i}=this,r=i.getScrollPosition(),a=n.horizontalLayoutPageIndex!=null?{horizontalLayoutPageIndex:n.horizontalLayoutPageIndex}:void 0,{scrollAdjustPosition:l,offset:u=0}=n;if(this.isColumnFullyVisible(e,void 0,a)&&!l)return r;a&&(e=i.getInitialCols()*a.horizontalLayoutPageIndex+e);let d=i.getItemOffsetFor(e,"horizontal"),s=i.getItemSize(e,"horizontal"),c=i.getFixedStartColsWidth(),f=i.getFixedStartColsWidth(),m=r.scrollLeft,p=i.getAvailableSize();if(!p.width)return null;let h=m+p.width;l||(l=d>h-f?"end":d<m+c?"start":"end");let y=r.scrollLeft;return l==="center"?y=d-Math.floor((i.getAvailableSize().width-c-f)/2):l==="start"?(u=-u,y+=d-m+u-c):(u+=s,y+=d-h+u+f),{...r,scrollLeft:y}};this.getScrollPositionForScrollCellIntoView=(e,n,i={offsetLeft:0,offsetTop:0})=>{if(this.destroyed)return null;let r=this.getScrollPositionForScrollColumnIntoView(n,{scrollAdjustPosition:i.colScrollAdjustPosition||i.scrollAdjustPosition,offset:i.offsetLeft}),a=this.getScrollPositionForScrollRowIntoView(e,{scrollAdjustPosition:i.rowScrollAdjustPosition||i.scrollAdjustPosition,offset:i.offsetTop});if(!r||!a)return null;let{scrollLeft:l}=r,{scrollTop:u}=a;return{scrollLeft:l,scrollTop:u}};this.isRowFullyVisible=(e,n=2)=>this.isRowVisible(e,this.brain.getRowHeight(e)-n);this.isRowVisible=(e,n=10)=>{if(!this.isRowRendered(e))return!1;e=this.brain.getPageIndexForRow(e)&&this.brain.rowsPerPage?e%this.brain.rowsPerPage:e;let{brain:r}=this;if(r.isRowFixed(e))return!0;let{start:[a],end:[l]}=this.brain.getRenderRange(),u=Math.floor((a+l)/2);if(e<a||e>=l)return!1;if(e>=u){let d=r.getItemAt(r.getAvailableSize().height+r.getScrollPosition().scrollTop-n,"vertical");return e<=d}if(e<u){let d=r.getItemAt(r.getScrollPosition().scrollTop+n,"vertical");return e>=d}return!0};this.isRowRendered=e=>{if(!this.brain.isHorizontalLayoutBrain)return this.cellManager.isRowAttached(e);let n=e;return e=this.brain.rowsPerPage?e%this.brain.rowsPerPage:e,this.cellManager.getCellsForRow(e).filter(i=>i.getAdditionalInfo()?.renderRowIndex===n).length>0};this.isCellVisible=(e,n)=>this.isRowVisible(e)&&this.isColumnVisible(n);this.isCellFullyVisible=(e,n,i)=>this.isRowFullyVisible(e)&&this.isColumnVisible(n,void 0,i);this.isColumnFullyVisible=(e,n=2,i)=>this.isColumnVisible(e,this.brain.getColWidth(e)-n,i);this.isColumnVisible=(e,n=10,i)=>{if(!this.isColumnRendered(e,i))return!1;let{brain:r}=this;if(r.isColFixed(e))return!0;i&&i.horizontalLayoutPageIndex!=null&&(e=r.getVirtualColIndex(e,{pageIndex:i.horizontalLayoutPageIndex}));let{start:[a,l],end:[u,d]}=r.getRenderRange();if(e<l||e>=d)return!1;let s=Math.floor((l+d)/2);if(e>=s){let c=r.getItemAt(r.getAvailableSize().width+r.getScrollPosition().scrollLeft-n-r.getFixedEndColsWidth(),"horizontal");return e<=c}if(e<s){let c=r.getItemAt(r.getScrollPosition().scrollLeft+n+r.getFixedStartColsWidth(),"horizontal");return e>=c}return!0};this.isCellRendered=(e,n,i)=>this.isRowRendered(e)&&this.isColumnRendered(n,i);this.isColumnRendered=(e,n)=>{let{start:[i]}=this.brain.getRenderRange();return n?.horizontalLayoutPageIndex!=null&&(e=this.brain.getInitialCols()*n.horizontalLayoutPageIndex+e),this.cellManager.isCellAttachedAt([i,e])};this.getExtraSpanCellsForRange=e=>{let{start:n,end:i}=e,[r,a]=n,[l,u]=i;return this.brain.getExtraSpanCellsForRange({horizontal:{startIndex:a,endIndex:u},vertical:{startIndex:r,endIndex:l}})};this.getFixedRanges=e=>{let{fixedRowsStart:n,fixedRowsEnd:i,fixedColsStart:r,fixedColsEnd:a}=this.brain.getFixedCellInfo();if(!n&&!r&&!i&&!a)return[];let l=this.brain.getColCount(),u=this.brain.getRowCount(),{start:d,end:s}=e,[c,f]=d,[m,p]=s,h=[];if(r&&(n&&h.push({rowFixed:"start",colFixed:"start",start:[0,0],end:[n,r]}),i&&h.push({rowFixed:"end",colFixed:"start",start:[u-i,0],end:[u,r]}),h.push({rowFixed:!1,colFixed:"start",start:[c,0],end:[m,r]})),a&&(n&&h.push({colFixed:"end",rowFixed:"start",start:[0,l-a],end:[n,l]}),i&&h.push({colFixed:"end",rowFixed:"end",start:[u-i,l-a],end:[u,l]}),h.push({colFixed:"end",rowFixed:!1,start:[c,l-a],end:[m,l]})),n){let y={start:[0,f],end:[n,p],rowFixed:"start",colFixed:!1};h.push(y)}if(i){let y={rowFixed:"end",colFixed:!1,start:[u-i,f],end:[u,p]};h.push(y)}return h};this.isCellFixed=(e,n)=>{let{fixedRowsStart:i,fixedRowsEnd:r,fixedColsStart:a,fixedColsEnd:l}=this.brain.getFixedCellInfo(),u=this.brain.getColCount(),d=this.brain.getRowCount(),s=!1,c=!1,f=!1;if(e<i&&(s=!0,f="start"),r&&!s){let m=d-r;e>=m&&(s=!0,f="end")}if(n<a&&(c=!0,f="start"),l&&!c){let m=u-l;n>=m&&(c=!0,f="end")}return{row:s?f:!1,col:c?f:!1}};this.isCellCovered=(e,n)=>{let i=this.brain.getRowspanParent(e,n),r=this.brain.getColspanParent(e,n),a=i!=e,l=r!=n;return a||l?[i,r]:!1};this.onMouseEnterNotBound=e=>{let n=this.getMatrixRowIndexFromElement(e.currentTarget);this.onMouseEnter(n)};this.onMouseLeaveNotBound=e=>{let n=this.getMatrixRowIndexFromElement(e.currentTarget);this.onMouseLeave(n)};this.onMouseEnter=e=>{this.lastEnteredRow=e,this.lastExitedRow=-1,!this.scrolling&&e!=-1&&this.addHoverClass(e)};this.addHoverClass=e=>{this.cellManager.getCellsForRow(e).forEach(n=>{let i=n.getElement();i&&this.cellHoverClassNames.forEach(r=>{i.classList.add(r)})})};this.onMouseLeave=e=>{this.lastExitedRow=e,this.lastEnteredRow=-1,!this.scrolling&&e!=-1&&this.removeHoverClass(e)};this.removeHoverClass=e=>{this.cellManager.getCellsForRow(e).forEach(n=>{let i=n.getElement();i&&this.cellHoverClassNames.forEach(r=>{i.classList.remove(r)})})};this.updateHoverClassNamesForRow=e=>{if(this.scrolling||this.hoverRowUpdatesInProgress.has(e))return;this.hoverRowUpdatesInProgress.set(e,!0);let n=()=>{!this.scrolling&&this.lastEnteredRow!=-1&&(this.lastEnteredRow===e?this.addHoverClass(e):this.removeHoverClass(e))};ke(()=>{this.destroyed||(n(),this.hoverRowUpdatesInProgress.delete(e))})};this.updateElementPosition=(e,n)=>{if(this.destroyed)return;let i=e.getElement(),r=this.cellManager.getCellPosition(e);if(!r)return;let[a,l]=r,u=this.brain.getCellOffset(a,l);if(u==null)return;let{x:d,y:s}=u;if(i){let c=()=>{this.updateHoverClassNamesForRow(a);let f=this.getCellRealCoordinates(a,l);if(i.dataset.rowIndex=f.rowIndex,i.dataset.colIndex=f.colIndex,_d){this.setTransform(i,a,l,{x:d,y:s},null),i.style.willChange="transform",i.style.backfaceVisibility="hidden";let p=(n?n.hidden:!!this.isCellCovered(a,l))?"-1":i.dataset.zIndex||"auto";i.__zIndex!==p&&(i.__zIndex=p,i.style.zIndex=p)}else i.style.display="",i.style.left=`${d}px`,i.style.top=`${s}px`};this.scrolling&&this.brain.isHorizontalLayoutBrain?e.setPendingAfterCommitWork(c):c()}};this.updateDetailElementPosition=e=>{if(this.destroyed)return;let n=e.getElement(),i=this.rowManager.getRowIndex(e);if(i==null)return;let r=this.brain.getItemOffsetFor(i,"vertical");if(r==null)return;let a=r;n&&(n.dataset.detailRowIndex=i,_d&&(this.setDetailTransform(n,i,{y:a,scrollLeft:this.brain.getScrollPosition().scrollLeft}),n.style.willChange="transform",n.style.backfaceVisibility="hidden",n.style.zIndex=n.dataset.zIndex||"auto"))};this.onScrollStart=()=>{this.scrolling=!0,this.lastEnteredRow!=-1&&this.removeHoverClass(this.lastEnteredRow)};this.onScrollStop=()=>{this.scrolling=!1,this.lastEnteredRow!=-1&&this.addHoverClass(this.lastEnteredRow),this.lastExitedRow!=-1&&this.removeHoverClass(this.lastExitedRow)};this.adjustFixedElementsOnScroll=(e=this.brain.getScrollPosition())=>{let{brain:n,cellManager:i,rowManager:r}=this,a=this.brain.getColCount(),l=this.brain.getRowCount(),{fixedColsStart:u,fixedColsEnd:d,fixedRowsStart:s,fixedRowsEnd:c}=this.brain.getFixedCellInfo();if(r.getAttachedCount()&&r.forEachAttachedRow(D=>{let M=r.getRowIndex(D);if(M!=null){let _=this.brain.getItemOffsetFor(M,"vertical");if(_==null)return;let O=D.getElement();if(!O)return;this.setDetailTransform(O,M,{y:_,scrollLeft:e.scrollLeft})}}),!u&&!d&&!s&&!c)return;let f=this.cellManager.getOneAttachedCell();f&&As(e,this.getInfiniteNode(f.getElement()));let m=this.brain.getFixedEndColsOffsets({skipScroll:!0}),p=this.brain.getFixedEndRowsOffsets({skipScroll:!0}),{start:h,end:y}=this.brain.getRenderRange(),[C,b]=h,[w,S]=y;function T(D,M,_){let O=i.getCellAt([D,M]);if(O==null)return;let z=n.getCellOffset(D,M),K=O.getElement();K&&z&&_(D,M,K,z)}let I=(D,M,_,{x:O,y:z})=>{this.setTransform(_,D,M,{x:O,y:z,scrollLeft:!0},u-M)},x=(D,M,_,O)=>{this.setTransform(_,D,M,{x:O.x,y:O.y,scrollTop:!0},s-D)},F=(D,M,_,{y:O})=>{let z=m[M];this.setTransform(_,D,M,{x:z,y:O,scrollLeft:!0},a-M)},N=(D,M,_,O)=>{this.setTransform(_,D,M,{x:O.x,y:p[D],scrollTop:!0},l-D)},R=(D,M,_,{x:O,y:z})=>{this.setTransform(_,D,M,{x:O,scrollLeft:!0,y:z,scrollTop:!0},1e5)},A=(D,M,_,{x:O})=>{this.setTransform(_,D,M,{x:O,scrollLeft:!0,y:p[D],scrollTop:!0},2e5)},E=(D,M,_,O)=>{this.setTransform(_,D,M,{x:m[M],y:O.y,scrollLeft:!0,scrollTop:!0},3e5)},P=(D,M,_)=>{this.setTransform(_,D,M,{x:m[M],y:p[D],scrollLeft:!0,scrollTop:!0},4e5)};if(u||d)for(let D=C;D<w;D++){for(let M=0;M<u;M++)T(D,M,I);if(d){let M=a-d;for(let _=M;_<a;_++)T(D,_,F)}}if(s||c)for(let D=b;D<S;D++){for(let M=0;M<s;M++)T(M,D,x);if(c){let M=l-c;for(let _=M;_<l;_++)T(_,D,N)}}if(u&&s)for(let D=0;D<s;D++)for(let M=0;M<u;M++)T(D,M,R);if(u&&c){let D=l-c;for(let M=D;M<l;M++)for(let _=0;_<u;_++)T(M,_,A)}if(d&&s){let D=a-d;for(let M=0;M<s;M++)for(let _=D;_<a;_++)T(M,_,E)}if(d&&c){let D=l-c,M=a-d;for(let _=D;_<l;_++)for(let O=M;O<a;O++)T(_,O,P)}};this.flushPendingAfterCommitWork=()=>{this.destroyed||this.cellManager.flushPendingAfterCommitWork()};this.destroy=()=>{this.destroyed||(this.destroyed=!0,this.reset(),this.onDestroy(),this.hoverRowUpdatesInProgress.clear(),this.hoverRowUpdatesInProgress=null,this.brain=null)};this.brain=e,this.debugId=n,this.cellManager=new Ci(n,i.cellPool),this.cellManager.onCellAttachmentChange((d,s)=>{s?this.onCellAttached(d):this.onCellDetached(d)}),this.rowManager=new Ti(n,i.rowPool),this.rowManager.onRowAttachmentChange((d,s)=>{s?this.onRowAttached(d):this.onRowDetached(d)}),this.renderRange=this.renderRange.bind(this);let r=e.onScroll(this.adjustFixedElementsOnScroll),a=e.onAvailableSizeChange(()=>{this.adjustFixedElementsOnScroll(),ke(()=>{this.destroyed||this.adjustFixedElementsOnScroll()})}),l=e.onScrollStart(this.onScrollStart),u=e.onScrollStop(this.onScrollStop);this.onDestroy=()=>{r(),a(),l(),u()}}getInfiniteNode(e){return this.infiniteNode||(this.infiniteNode=Sr(e)),this.infiniteNode}onCellAttached(e){if(this.cellDetachedClassNames.length){let n=e.getElement();n&&this.cellDetachedClassNames.forEach(i=>{n.classList.remove(i)})}}onCellDetached(e){if(this.cellDetachedClassNames.length){let n=e.getElement();n&&this.cellDetachedClassNames.forEach(i=>{n.classList.add(i)})}}onRowAttached(e){if(this.cellDetachedClassNames.length){let n=e.getElement();n&&this.cellDetachedClassNames.forEach(i=>{n.classList.remove(i)})}}onRowDetached(e){if(this.cellDetachedClassNames.length){let n=e.getElement();n&&this.cellDetachedClassNames.forEach(i=>{n.classList.add(i)})}}isCellRenderedAndMappedCorrectly(e,n){let i=!!this.cellManager.getCellAt([e,n]);return{rendered:i,mapped:i}}renderRange(e,{renderCell:n,renderDetailRow:i,force:r,onRender:a}){if(this.destroyed)return[];let{start:l,end:u}=e,d=this.brain.isHorizontalLayoutBrain,{rowManager:s,cellManager:c}=this,f=this.getFixedRanges(e),m=[e,...f],p=this.brain.getAlwaysRenderedColumns();if(p.length>0){let R=e.start[1],A=e.end[1];p.forEach(E=>{R<=E&&E<A||m.push({start:[e.start[0],E],end:[e.end[0],E+1]})})}let h=new Map,y=m.map(this.getExtraSpanCellsForRange).flat();y&&y.forEach(([R,A])=>{h.set(`${R}:${A}`,!0)});let C=m.reduce((R,A)=>R+ia(A),0),b=i?m.reduce((R,A)=>R+Rd(A),0):0,w=this.brain.getRowCount(),S=this.brain.getColCount();c.detachCellsStartingAt([w,S]);let T=Math.min(w*S,C);i&&(s.detachStartingWith(this.brain.getRowCount()),s.poolSize>b&&(s.poolSize=b));let I=Pd(...m.map(R=>c.getCellsOutsideRenderRange(R)));I=Dd(I,R=>{let A=c.getCellPosition(R);return!(A&&h.has(`${A[0]}:${A[1]}`))}),c.detachCells(I),c.poolSize=T;let x=new Map,F=new Map;m.forEach(R=>{let{start:A,end:E}=R,[P,D]=A,[M,_]=E;for(let O=P;O<M;O++){for(let K=D;K<_;K++){let B=`${O}:${K}`;if(x.has(B))continue;x.set(B,!0);let{rendered:G,mapped:le}=this.isCellRenderedAndMappedCorrectly(O,K);if(O===P||K===D){let De=this.isCellCovered(O,K);if(De&&h.has(`${De[0]}:${De[1]}`)){let me=c.getCellAt([O,K]);me!=null&&c.detachCell(me);continue}}if(G&&!r&&le)continue;let Z;G?Z=c.getCellAt([O,K]):Z=c.getCellFor([O,K],d?"row":"column"),Z==null&&(Z=c.getDetachedCell()),this.renderCellAt(O,K,Z,n)}!i||F.has(O)||(F.set(O,!0),s.isRowAttachedAt(O)&&!r)||this.renderDetailRowAtElement(O,this.rowManager.getRowFor(O),i)}}),y.forEach(([R,A])=>{let{rendered:E,mapped:P}=this.isCellRenderedAndMappedCorrectly(R,A);if(E){if(r||!P){let M=[R,A],_=c.getCellAt(M);this.renderCellAt(R,A,_,n)}return}let D=c.getCellFor([R,A],d?"row":"column");D!=null&&this.renderCellAt(R,A,D,n)});let N=c.getAllCells().map(R=>R.getNode());return i&&s.getAllRows().forEach(R=>{N.push(R.getNode())}),this.adjustFixedElementsOnScroll(),a&&a(N),N}renderDetailRowAtElement(e,n,i){if(this.destroyed)return;let r=!1,a=this.brain.getRowHeight(e),l=this.brain.isRowFixedStart(e)?"start":this.brain.isRowFixedEnd(e)?"end":!1,d=i({rowIndex:e,height:a,rowFixed:l,hidden:!!r,onMouseEnter:()=>{},onMouseLeave:()=>{},domRef:n.ref});if(n.isMounted()||n.onMount(s=>{let c=s.getElement();c&&(c.style.position="absolute",c.style.left="0px"),this.updateDetailElementPosition(s)}),!d){this.rowManager.detachRow(n);return}this.rowManager.renderNodeAtRow(d,n,e),this.updateDetailElementPosition(n)}getCellRealCoordinates(e,n){return{rowIndex:e,colIndex:n}}getMatrixRowIndexFromElement(e){let n=Number(e.dataset.rowIndex);return this.brain.isHorizontalLayoutBrain?this.brain.getRowIndexInPage(n):n}renderCellAt(e,n,i,r){if(this.destroyed)return;let a=this.isCellCovered(e,n),l=this.brain.getRowHeight(e),u=this.brain.getColWidth(n),d=this.brain.getRowspan(e,n),s=this.brain.getColspan(e,n),c=d===1?l:this.brain.getRowHeightWithSpan(e,n,d),f=s===1?u:this.brain.getColWidthWithSpan(e,n,s),{row:m,col:p}=this.isCellFixed(e,n),h=!!a,{rowIndex:y,colIndex:C}=this.getCellRealCoordinates(e,n),b=r({rowIndex:y,colIndex:C,height:l,width:u,rowspan:d,colspan:s,rowFixed:m,colFixed:p,hidden:h,heightWithRowspan:c,widthWithColspan:f,onMouseEnter:this.onMouseEnterNotBound,onMouseLeave:this.onMouseLeaveNotBound,domRef:i.ref});i.isMounted()||i.onMount(T=>{let I=T.getElement();I&&(I.style.position="absolute",I.style.left="0px",I.style.top="0px"),this.updateElementPosition(T)});let w=this.brain.isHorizontalLayoutBrain?{renderRowIndex:y,renderColIndex:C}:void 0,S=this.brain.isHorizontalLayoutBrain;if(!b){S?this.cellManager.detachCell(i):this.cellManager.detachCell(i);return}this.cellManager.renderNodeAtCell(b,i,[e,n],w),this.updateElementPosition(i,{hidden:h,rowspan:d,colspan:s})}reset(){this.cellManager.reset(),this.rowManager.reset()}};var Si=class extends Fn{constructor(e,n,i){super(e,n,i);this.setTransform=(e,n,i,r,a)=>{let l=this.getCellRealCoordinates(n,i),{y:u}=r,d=Math.floor(l.rowIndex/this.brain.rowsPerPage),s=Ie.runtime.totalVisibleColumnsWidthVar,c=d?`calc(${s} * ${d})`:"0px",f=Ce.columnOffsets.get(l.colIndex),m=`${aa}-${l.colIndex}`,p=`${u}px`;e.__currentTransformY!==p&&(e.__currentTransformY=p,e.style.setProperty(sn,p));let h=`calc(var(${m}, ${f}) + ${c})`,y=`var(${sn})`,C=`translate3d(${h}, ${y}, 0px)`;e.__transformValue!==C&&(e.__transformValue=C,e.style.transform=C)};this.brain=e}getCellRealCoordinates(e,n){return this.brain.getHorizontalLayoutPositionFromMatrixCoordinates({rowIndex:e,colIndex:n})}isCellRenderedAndMappedCorrectly(e,n){let i=this.cellManager.getCellAt([e,n]),r=!!i;if(!r)return{rendered:r,mapped:!1};let a=i.getAdditionalInfo();if(!a)return{rendered:r,mapped:!1};let l=this.getCellRealCoordinates(e,n),u=l.colIndex===a.renderColIndex&&l.rowIndex===a.renderRowIndex;return{rendered:r,mapped:u}}};import{h as wy}from"vue";import{defineComponent as my,getCurrentInstance as hy,isVNode as gy,onBeforeUnmount as yy,onMounted as by,onUpdated as Cy,shallowRef as Ty,watch as Sy}from"vue";function Md(o,t){if(!(!t||!o)){if(Array.isArray(o)){for(let e of o)Md(e,t);return}if(gy(o)){let e=o.ref;e&&e.i==null&&(e.i=t)}}}var Zt=my({name:"RenderSlot",props:{name:{type:String,required:!1},useraf:{type:Boolean,required:!1,default:!1},updater:{type:Function,required:!0},afterCommit:{type:Function,required:!1}},setup(o){let t=Ty(o.updater.get()??null),e=null;Sy(()=>[o.updater,o.useraf],([i,r],a,l)=>{t.value=i.get()??null;let u=i.onChange(d=>{r?(e!=null&&cancelAnimationFrame(e),e=requestAnimationFrame(()=>{t.value=d})):t.value=d});l(u)},{immediate:!0,flush:"sync"}),yy(()=>{e!=null&&cancelAnimationFrame(e)}),by(()=>o.afterCommit?.()),Cy(()=>o.afterCommit?.());let n=hy();return()=>{let i=t.value;return Md(i,n),i??null}}});var Nn=class Nn extends et{constructor(e){super(e);this.cellRemoveSubscription=pe();this.cellAttachmentChangeSubscription=pe();this.attachedCells=new Set,this.detachedCells=new Set,this.allCellsOrdered=new Set}destroy(){this.reset()}onRemoveCell(e){return this.cellRemoveSubscription.onChange(i=>{i!=null&&e(i)})}onCellAttachmentChange(e){return this.cellAttachmentChangeSubscription.onChange(i=>{if(i==null)return;let{cell:r,attached:a}=i;e(r,a)})}reset(){this.attachedCells.clear(),this.detachedCells.clear(),this.allCellsOrdered.clear(),this.cellRemoveSubscription.destroy(),this.cellAttachmentChangeSubscription.destroy()}getAttachedCells(){return this.attachedCells}getDetachedCells(){return this.detachedCells}getAllCells(){return this.allCellsOrdered}createCell(){let e=this.createCellInstance();return this.detachedCells.add(e),this.allCellsOrdered.add(e),e}removeCell(e){this.detachedCells.delete(e),this.attachedCells.delete(e),this.allCellsOrdered.delete(e),e.destroy(),this.cellRemoveSubscription(e)}attachCell(e){return e&&this.attachedCells.has(e)||(e||(e=this.getDetachedCell()),this.detachedCells.delete(e),this.attachedCells.add(e),this.cellAttachmentChangeSubscription({cell:e,attached:!0})),e}detachCell(e){return this.detachedCells.has(e)?!1:(this.attachedCells.delete(e),this.detachedCells.add(e),this.cellAttachmentChangeSubscription({cell:e,attached:!1}),!0)}getDetachedCell(){let{detachedCells:e}=this,n=e.values().next().value;return n||(this.poolSize+=Nn.POOL_SIZE_INCREMENT,n=e.values().next().value),n||this.error("No cells available in the pool!"),n}get attachedSize(){return this.attachedCells.size}get detachedSize(){return this.detachedCells.size}get poolSize(){return this.allCellsOrdered.size}flushPendingAfterCommitWork(){for(let e of this.attachedCells)e.flushPendingAfterCommitWork()}set poolSize(e){e=Math.ceil(e/Nn.POOL_SIZE_INCREMENT)*Nn.POOL_SIZE_INCREMENT;let n=this.poolSize;if(e===n)return;let{detachedCells:i}=this,r=n-e;if(r>0){r>i.size&&(r=i.size,this.debug("Trying to destroy more cells than are currently detached!"));let a=i.values();for(;r>0;){let l=a.next().value;this.removeCell(l),r--}}else for(r=-r;r>0;)this.createCell(),r--}};Nn.POOL_SIZE_INCREMENT=1;var wi=Nn;var Fd=new Map,vy=()=>{},la=class{constructor(t,e){this.element=null;this.mounted=!1;this.pendingAfterCommitWork=null;this.mountSubscription=pe();this.afterCommit=()=>{this.flushPendingAfterCommitWork()};let n=Fd.get(t)??0,i=`${t}:GridCellVue:${n}`;Fd.set(t,n+1),this.debugId=i,this.cellInfo=e,this.updater=pe(),this.node=wy(Zt,{key:i,name:i,updater:this.updater,afterCommit:this.afterCommit}),this.ref=r=>{this.element=r,r?(this.mounted=!0,this.mountSubscription(this)):this.mounted=!1}}setPendingAfterCommitWork(t){this.pendingAfterCommitWork=t}flushPendingAfterCommitWork(){if(this.pendingAfterCommitWork){let t=this.pendingAfterCommitWork;this.pendingAfterCommitWork=null,t()}}isMounted(){return this.mounted}onMount(t){return this.mountSubscription.onChange(n=>{n!=null&&t(n)})}destroy(){this.mountSubscription.destroy(),this.updater.destroy(),this.pendingAfterCommitWork=null,this.ref=vy,this.element=null,this.node=null}getNode(){return this.node}update(t,e){this.updater(t),this.cellInfo=e}getAdditionalInfo(){return this.cellInfo}getElement(){return this.element}},vi=class extends wi{constructor(e){super(`${e}:GridCellPoolForVue`);this.cellDebugId=e}createCellInstance(){return new la(this.cellDebugId)}};import{h as Ry}from"vue";var On=class On extends et{constructor(e){super(e);this.rowRemoveSubscription=pe();this.rowAttachmentChangeSubscription=pe();this.attachedRows=new Set,this.detachedRows=new Set,this.allRowsOrdered=new Set}destroy(){this.reset()}onRemoveRow(e){return this.rowRemoveSubscription.onChange(i=>{i!=null&&e(i)})}onRowAttachmentChange(e){return this.rowAttachmentChangeSubscription.onChange(i=>{if(i==null)return;let{row:r,attached:a}=i;e(r,a)})}reset(){this.attachedRows.clear(),this.detachedRows.clear(),this.allRowsOrdered.clear(),this.rowRemoveSubscription.destroy(),this.rowAttachmentChangeSubscription.destroy()}getAttachedRows(){return this.attachedRows}getDetachedRows(){return this.detachedRows}getAllRows(){return this.allRowsOrdered}createRow(){let e=this.createRowInstance();return this.detachedRows.add(e),this.allRowsOrdered.add(e),e}removeRow(e){this.detachedRows.delete(e),this.attachedRows.delete(e),this.allRowsOrdered.delete(e),e.destroy(),this.rowRemoveSubscription(e)}attachRow(e){return e&&this.attachedRows.has(e)||(e||(e=this.getDetachedRow()),this.detachedRows.delete(e),this.attachedRows.add(e),this.rowAttachmentChangeSubscription({row:e,attached:!0})),e}detachRow(e){return this.detachedRows.has(e)?!1:(this.attachedRows.delete(e),this.detachedRows.add(e),this.rowAttachmentChangeSubscription({row:e,attached:!1}),!0)}getDetachedRow(){let{detachedRows:e}=this,n=e.values().next().value;return n||(this.poolSize+=On.POOL_SIZE_INCREMENT),n=e.values().next().value,n||this.error("No rows available in the pool!"),n}get attachedSize(){return this.attachedRows.size}get detachedSize(){return this.detachedRows.size}get poolSize(){return this.allRowsOrdered.size}set poolSize(e){e=Math.ceil(e/On.POOL_SIZE_INCREMENT)*On.POOL_SIZE_INCREMENT;let n=this.poolSize;if(e===n)return;let{detachedRows:i}=this,r=n-e;if(r>0){r>i.size&&(r=i.size,this.debug("Trying to destroy more rows than are currently detached!"));let a=i.values();for(;r>0;){let l=a.next().value;this.removeRow(l),r--}}else for(r=-r;r>0;)this.createRow(),r--}};On.POOL_SIZE_INCREMENT=1;var Ri=On;var Nd=new Map,Iy=()=>{},sa=class{constructor(t){this.element=null;this.mounted=!1;this.mountSubscription=pe();let e=Nd.get(t)??0,n=`${t}:ListRowVue:${e}`;Nd.set(t,e+1),this.debugId=n,this.updater=pe(),this.node=Ry(Zt,{key:`detail-row-${n}`,name:`detail-row-${n}`,updater:this.updater}),this.ref=i=>{this.element=i,i?(this.mounted=!0,this.mountSubscription(this)):this.mounted=!1}}isMounted(){return this.mounted}onMount(t){return this.mountSubscription.onChange(n=>{n!=null&&t(n)})}destroy(){this.mountSubscription.destroy(),this.updater.destroy(),this.ref=Iy,this.element=null,this.node=null}getNode(){return this.node}update(t){this.updater(t)}getElement(){return this.element}},Ii=class extends Ri{constructor(e){super(`${e}:ListRowPoolForVue`);this.rowDebugId=e}createRowInstance(){return new sa(this.rowDebugId)}};function Od(o){return{cellPool:new vi(o),rowPool:new Ii(o)}}function yo(o){let t=o.isHorizontalLayoutBrain?new Si(o,`${o.name}:VueHorizontalLayoutTableRenderer`,Od(`${o.name}:VueHorizontalLayoutTableRenderer`)):new Fn(o,`${o.name}:VueHeadlessTableRenderer`,Od(`${o.name}:VueHeadlessTableRenderer`)),e=pe();return o.onDestroy(()=>{t.destroy(),e.destroy()}),{renderer:t,onRenderUpdater:e}}function un(){return{current:null}}var kd={};function ua(o){return`.${mt}[data-row-index${o?`="${o.rowIndex}"`:""}][data-col-index${o?`="${o.colIndex}"`:""}]`}function da(o,t){let e=An(o),n=t?new ho(e,{isHeader:!1}):new ln(e),i=`${e}:header`,r=t?new ho(i,{isHeader:!0,masterBrain:n}):new ln(i);n.onScroll(s=>{r.setScrollPosition({scrollLeft:s.scrollLeft,scrollTop:0})});let{renderer:a,onRenderUpdater:l}=yo(n),{renderer:u,onRenderUpdater:d}=yo(r);return n.onAvailableSizeChange(s=>{r.update({width:s.width})}),{brain:n,headerBrain:r,renderer:a,onRenderUpdater:l,headerRenderer:u,headerOnRenderUpdater:d}}function Ld({debugId:o,wrapRowsHorizontally:t}){let e={},{brain:n,headerBrain:i,renderer:r,onRenderUpdater:a,headerRenderer:l,headerOnRenderUpdater:u}=da(o,!!t),d=un(),s=Date.now();return{debugWarnings:new Map,renderer:r,onRenderUpdater:a,headerRenderer:l,headerOnRenderUpdater:u,updatedAt:s,devToolsDetected:!!globalThis.__INFINITE_TABLE_DEVTOOLS_HOOK__,propsCache:new Map([]),lastRowToCollapseRef:{current:null},lastRowToExpandRef:{current:null},cellContextMenuVisibleFor:null,contextMenuVisibleFor:null,columnMenuVisibleForColumnId:null,columnMenuVisibleKey:0,filterOperatorMenuVisibleForColumnId:null,getDOMNodeForCell:c=>{if(!d.current)return null;let f=ua(c);return d.current.querySelector(f)||null},brain:n,headerBrain:i,domRef:d,columnMenuTargetRef:un(),editingValueRef:un(),scrollerDOMRef:un(),portalDOMRef:un(),focusDetectDOMRef:un(),activeCellIndicatorDOMRef:un(),onColumnMenuClick:pe(),cellContextMenu:pe(),contextMenu:pe(),onFilterOperatorMenuClick:pe(),flashingDurationCSSVarValue:null,onFlashingDurationCSSVarChange:pe(),onRowHeightCSSVarChange:pe(),onRowDetailHeightCSSVarChange:pe(),onColumnHeaderHeightCSSVarChange:pe(),cellClick:pe(),cellMouseDown:pe(),keyDown:pe(),bodySize:{width:0,height:0},scrollPosition:{scrollTop:0,scrollLeft:0},columnReorderDragColumnId:!1,columnReorderInPageIndex:null,ready:!1,focused:!1,focusedWithin:!1,columnsWhenGrouping:e,columnVisibilityForGrouping:{},pinnedStartScrollListener:new mo,pinnedEndScrollListener:new mo,columnsWhenInlineGroupRenderStrategy:void 0,editingCell:null,forceBodyRerenderTimestamp:0}}var zd=o=>({debugId:1,scrollTopKey:1,components:1,id:1,loadingText:1,pivotColumns:1,groupColumn:1,onReady:1,domProps:1,onKeyDown:1,onCellClick:1,onCellDoubleClick:1,focusedClassName:1,focusedWithinClassName:1,focusedStyle:1,focusedWithinStyle:1,onSelfFocus:1,onFocusWithin:1,onSelfBlur:1,onBlurWithin:1,onContextMenu:1,onCellContextMenu:1,onRenderRangeChange:1,onRowMouseEnter:1,onRowMouseLeave:1,onScrollToTop:1,onScrollToBottom:1,onScrollStop:1,scrollToBottomOffset:1,getColumnMenuItems:1,getCellContextMenuItems:1,getContextMenuItems:1,columnPinning:1,editable:1,columnDefaultEditable:1,columnDefaultFilterable:1,columnDefaultGroupable:1,columnDefaultSortable:1,keyboardShortcuts:1,rowStyle:1,cellStyle:1,repaintCellsKey:1,rowProps:1,rowClassName:1,rowHoverClassName:1,cellClassName:1,repeatWrappedGroupRows:1,pinnedStartMaxWidth:1,pinnedEndMaxWidth:1,pivotColumn:1,pivotColumnGroups:1,getFilterOperatorMenuItems:1,onScrollbarsChange:1,autoSizeColumnsKey:1,wrapRowsHorizontally:1,columnDefaultFlex:1,draggableColumnsRestrictTo:t=>t??!1,columnMenuRealignDelay:t=>t??50,scrollStopDelay:t=>t??250,viewportReservedWidth:t=>t??0,resizableColumns:t=>t??!0,rowDetailCache:t=>new hi(t),hideColumnWhenGrouped:t=>t??!1,columnMinWidth:t=>t??30,columnMaxWidth:t=>t??5e3,columnDefaultWidth:t=>t??200,columnCssEllipsis:t=>t??!0,draggableColumns:1,columnDefaultDraggable:1,headerOptions:t=>({alwaysReserveSpaceForSortIcon:!0,...t}),showSeparatePivotColumnForSingleAggregation:t=>t??!1,sortable:1,hideEmptyGroupColumns:t=>t??!1,pivotTotalColumnPosition:t=>t??"end",pivotGrandTotalColumnPosition:1,licenseKey:t=>t||"",keyboardSelection:t=>t??!0,multiRowSelectionWith:t=>t??"checkbox",activeRowIndex:1,activeCellIndex:1,columnOrder:t=>t??!0,header:t=>t??!0,showZebraRows:t=>t??!0,showHoverRows:t=>t??!0,virtualizeColumns:t=>t??!0,rowHeight:t=>typeof t=="number"||typeof t=="function"?t:0,rowDetailHeight:t=>typeof t=="number"||typeof t=="function"?t:300,columnHeaderHeight:t=>typeof t=="number"?t:30,columns:1,columnVisibility:t=>t??kd,columnGroupVisibility:t=>t??kd,columnSizing:t=>t||{},columnTypes:t=>t||{},onEditCancelled:1,onEditRejected:1,onEditAccepted:1,persistEdit:1,shouldAcceptEdit:1,onEditPersistError:1,onEditPersistSuccess:1,multiSortBehavior:t=>t??"replace",collapsedColumnGroups:t=>t??new Map,columnGroups:1});function xy(o){let{groupBy:t,groupColumn:e,groupRenderStrategy:n}=o;return n||(e!=null&&typeof e=="object"?"single-column":(t.filter(r=>r.column).length,"multi-column"))}var Vd=o=>{o.brain.destroy(),o.headerBrain.destroy(),o.renderer.destroy(),o.headerRenderer.destroy(),o.onRenderUpdater.destroy(),o.headerOnRenderUpdater.destroy(),o.onFlashingDurationCSSVarChange.destroy(),o.onRowHeightCSSVarChange.destroy(),o.onColumnHeaderHeightCSSVarChange.destroy(),o.onColumnMenuClick.destroy(),o.onFilterOperatorMenuClick.destroy(),o.domRef.current=null,o.columnMenuTargetRef.current=null,o.scrollerDOMRef.current=null,o.portalDOMRef.current=null,o.onRowDetailHeightCSSVarChange.destroy(),o.pinnedEndScrollListener.destroy(),o.pinnedStartScrollListener.destroy()};function Gd(o){return o.reduce((t,e,n)=>{let i={groupBy:e,groupIndex:n};return e.field?t.set(e.field,i):e.groupField&&t.set(e.groupField,i),t},new Map)}var xi=new WeakMap;function Kd(){return{rowDetailState:(o,t)=>({callbackParams:[o,{expandRow:t.lastRowToExpandRef.current,collapseRow:t.lastRowToCollapseRef.current}]})}}var Bd=o=>{let{props:t,state:e,oldState:n,parentState:i}=o,r=e.pivotColumnGroups||e.columnGroups,a=e.columnGroups&&e.columnGroups!=n?.columnGroups||e.columnGroups&&e.columnGroupVisibility!=n?.columnGroupVisibility||e.pivotColumnGroups&&e.pivotColumnGroups!=n?.pivotColumnGroups?Id(r,e.columnGroupVisibility):e.columnGroupsDepthsMap,l=i?.groupBy,u=xy({groupRenderStrategy:t.groupRenderStrategy,groupBy:l,groupColumn:t.groupColumn}),d,s=t.rowDetailRenderer,c=t.components?.RowDetail;if(!s&&c){let y=xi.get(c);y||(y=xd(c),xi.set(c,y)),s=y}s&&(d=t.rowDetailState||e.rowDetailState||t.defaultRowDetailState,d&&!(d instanceof ut)&&(d=new ut(d)),d=d||new ut({expandedRows:[],collapsedRows:!0}));let f=e.columnsWhenGrouping||e.columnsWhenInlineGroupRenderStrategy||e.columns,m=d?t.isRowDetailExpanded:void 0;!m&&d&&(m=xi.get(d),m||(m=y=>d.isRowDetailsExpanded(y.id),typeof d=="object"&&xi.set(d,m)));let p=s?t.isRowDetailEnabled||!0:!1,h={updatedAt:Date.now(),isTree:i.isTree,rowDetailRenderer:s,rowDetailState:d,isRowDetailExpanded:m,isRowDetailEnabled:p,showColumnFilters:t.showColumnFilters??!!i.filterValue,controlledColumnVisibility:!!t.columnVisibility,groupRenderStrategy:u,groupBy:l,computedColumns:f,initialColumns:t.columns,keyboardNavigation:t.keyboardNavigation??(e.activeCellIndex!=null?"cell":e.activeRowIndex!=null?"row":"cell"),columnHeaderCssEllipsis:t.columnHeaderCssEllipsis??t.columnCssEllipsis??!0,columnGroupsDepthsMap:a,columnGroupsMaxDepth:a!=e.columnGroupsDepthsMap?Math.max(...a.values(),-1):e.columnGroupsMaxDepth,computedColumnGroups:r,rowHeightCSSVar:typeof t.rowHeight=="string"?t.rowHeight:"",rowDetailHeightCSSVar:typeof t.rowDetailHeight=="string"?t.rowDetailHeight:"",columnHeaderHeightCSSVar:typeof t.columnHeaderHeight=="string"?t.columnHeaderHeight||Ie.components.Header.columnHeaderHeight:""};if(e.devToolsDetected&&e.debugId){let y=Vr.get(e.debugId);y&&(h={...h,...y})}return h};function Hd(o,t){let e={};return Object.keys(o).forEach(n=>{let i=o[n],r=i;if(!r.groupByForColumn||Array.isArray(r.groupByForColumn))return;let{groupByForColumn:a}=r,l=a.field||a.groupField;l&&t.get(l)&&(e[n]=i)}),e}function Wd(o){let{hideEmptyGroupColumns:t,groupByMap:e,computedGroupColumns:n,groupRowsIndexesInDataArray:i,dataArray:r,groupBy:a}=o,l={...o.columnVisibility};if(!t)return Object.keys(n).forEach(c=>{l[c]===!1&&delete l[c]}),l;if(!i||!i.length)return l;let u=a.length,d=0,s=i.length;for(let c=0;c<s;c++){let f=i[c],m=r[f];if(!m.isTreeNode&&m.isGroupRow&&(d=Math.max(d,m.groupNesting-1),d===u-1))break}return Object.keys(n).forEach(c=>{let f=n[c],{groupByForColumn:m}=f;if(Array.isArray(m))return;let p=m.field||m.groupField;if(!p)return;e.get(p).groupIndex>d&&t?l[c]!==!1&&(l[c]=!1):l.hasOwnProperty(c)&&delete l[c]}),l}var Py=10;function jd(o,t){let{includeHeader:e,columnsToResize:n,columnsToSkip:i}=t,r=`.${wt} > .${jo}`,a=o.current?.querySelectorAll(r),l={},u={};return a&&a.length&&a.forEach(d=>{let s=d.parentElement,c=s.matches(`.${nn}`);if(e===!1&&c)return;let f=s.getAttribute("data-column-id"),m=d.cloneNode(!0);m.style.visibility="hidden",m.style.pointerEvents="none",m.classList.remove(...lt.split(" ")),m.style.position="absolute",m.style.width="auto",s.appendChild(m);let p=m.offsetWidth;if(s.removeChild(m),!u[f]){let h=Fe().getComputedStyle(s);u[f]=parseInt(h.paddingLeft,10)+parseInt(h.paddingRight,10)+parseInt(h.borderLeftWidth,10)+parseInt(h.borderRightWidth,10)+Py}if(p+=u[f],c){let h=0;s.childNodes.forEach(y=>{if(y!==d&&y.nodeType===1){let C=y,b=Math.max(C.offsetWidth,parseInt(C.style.width,10));if(isNaN(b)&&(b=0),h+=b,b>0){let w=Fe().getComputedStyle(C);h+=parseInt(w.marginLeft,10)+parseInt(w.marginRight,10)}}}),p+=h}i&&i.has(f)||n&&!n.has(f)||(l[f]=Math.max(p,l[f]||0))}),l}var $d="InfiniteTable";import{h as cn}from"vue";var Ud=o=>o.dataSourceHasGrouping&&o.isGroupRow&&o.childrenLoading||!o.selfLoaded;import{defineComponent as Dy,h as Jd,ref as Ay,watch as _y}from"vue";var qd="_96uiwi0 _16lm1iw1d _16lm1iwk _16lm1iw9",Yd=we({defaultClassName:"_96uiwi1",variantClassNames:{expanded:{true:"_16lm1iwi",false:"_96uiwi3"},direction:{end:"_96uiwi4",start:"_96uiwi5"},disabled:{true:"_96uiwi6",false:"_96uiwi7"}},defaultVariants:{},compoundVariants:[[{expanded:!1,direction:"end"},"_16lm1iwj"]]});var Zd="M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z",Xd=Object.keys({size:1,expanded:1,defaultExpanded:1,onChange:1,style:1,disabled:1,className:1,direction:1});var Pi=`${nt}-expand-collapse`,dn=Dy(o=>{let t=()=>o.expanded!==void 0,e=Ay(o.expanded??o.defaultExpanded??!1);_y(()=>o.expanded,i=>{t()&&(e.value=!!i)});let n=()=>{o.onChange?.(!e.value),t()||(e.value=!e.value)};return()=>{let i=e.value?"expanded":"collapsed",{size:r=24,direction:a="start",disabled:l=!1}=o;return Jd("svg",{"data-name":"expand-collapse-icon","data-state":i,"data-disabled":l,xmlns:"http://www.w3.org/2000/svg",height:`${r}px`,viewBox:"0 0 24 24",width:`${r}px`,style:o.style,onClick:l?void 0:n,class:te(o.className,qd,Yd({direction:a||"start",expanded:e.value,disabled:l}),`${nt}`,`${Pi}`,`${Pi}--${i}`,`${Pi}--${a==="end"?"end":"start"}`,l?`${Pi}--disabled`:"")},[Jd("path",{d:Zd})])}},{name:"ExpandCollapseIcon",props:[...Xd]});import{defineComponent as Ey,h as ca}from"vue";var Qd="_16lm1iwb _16lm1iw1d _16lm1iwk";var ec="164.93361431346415 56.97787143782138",tc={margin:"auto",display:"block",shapeRendering:"auto"},nc=Object.keys({size:1,style:1,className:1,viewBox:1});var oc=Ey(o=>()=>ca("svg",{xmlns:"http://www.w3.org/2000/svg",style:{...tc,...o.style},width:"24px",height:"24px",viewBox:o.viewBox??"0 0 100 100",preserveAspectRatio:"xMidYMid",class:te(o.className,Qd,"InfiniteIcon","InfiniteIcon-loading")},[ca("circle",{cx:"50",cy:"50",fill:"none","stroke-width":"10",r:"35","stroke-dasharray":ec},[ca("animateTransform",{attributeName:"transform",type:"rotate",repeatCount:"indefinite",dur:"1s",values:"0 50 50;360 50 50",keyTimes:"0;1"})])]),{name:"LoadingIcon",props:[...nc]});var ic=we({defaultClassName:"_7pupv01",variantClassNames:{align:{start:"_7pupv02",center:"_7pupv03",end:"_7pupv04"}},defaultVariants:{},compoundVariants:[]}),rc="_7pupv00",ac=we({defaultClassName:"_7pupv05",variantClassNames:{align:{start:"_7pupv06",center:"_7pupv07",end:"_7pupv08"}},defaultVariants:{},compoundVariants:[]});function lc(o,t,e,n){let{groupByForColumn:i,groupIndexForColumn:r,groupRenderStrategy:a}=o,l=i.column?{...i.column}:{},u=typeof e=="function"?e(o,t):e;return{header:`Group by ${i.field||i.groupField}`,groupByForColumn:i,render:n.getGroupColumnRender({groupIndexForColumn:r,groupRenderStrategy:a}),...l,...u,renderGroupIcon:n.getGroupColumnRenderGroupIcon({initialRenderGroupIcon:u?.renderGroupIcon??l.renderGroupIcon,groupIndexForColumn:r,toggleGroupRow:t,groupRenderStrategy:a})}}function sc(o,t,e,n){let i=typeof e=="function"?e(o,t):e,r={};return o.sortable!=null&&(r.sortable=o.sortable),{...r,header:"Group",groupByForColumn:o.groupBy,renderSelectionCheckBox:o.selectionMode==="multi-row",render:n.getGroupColumnRender({groupIndexForColumn:0,groupRenderStrategy:"single-column"}),...i,renderGroupIcon:n.getGroupColumnRenderGroupIcon({initialRenderGroupIcon:i?.renderGroupIcon,groupIndexForColumn:0,toggleGroupRow:t,groupRenderStrategy:"single-column"})}}var My=U(j.columnZIndexAtIndex),Fy=U(j.columnVisibilityAtIndex);function uc({rowInfo:o,column:t}){let e=0;if(o.dataSourceHasGrouping)if(o.isGroupRow){let n=t?.groupByForColumn,i=o.groupBy[o.groupBy.length-1],r=!!o.pivotValuesMap,a=r&&!!t?.field&&!!n&&!Array.isArray(n)&&(n.field??n.groupField)!==(i?.field??i?.groupField),l=r&&Array.isArray(n)&&o.groupNesting===o.rootGroupBy.length;e=a||l?o.groupNesting:o.groupNesting-1}else e=o.groupNesting;return{[U(Ie.components.Row.groupNesting)]:e}}function Ny({rowInfo:o}){return{[U(Ie.components.Row.groupNesting)]:o.isTreeNode?o.isParentNode?o.treeNesting:o.treeNesting+1:0}}function fa(o,t){return o?typeof o=="function"?o(t):o:void 0}function pa(o,t,e){return typeof t=="function"?{...o,...t(e)}:{...o,...t}}function dc(o){let{column:t,rowInfo:e,rowIndex:n,rowHeight:i,rowIndexInHorizontalLayoutPage:r,horizontalLayoutPageIndex:a,align:l,verticalAlign:u,stylingParam:d,formattedValueContext:s,groupByColumnReference:c,rowStyle:f,rowClassName:m,cellStyle:p,cellClassName:h,showZebraRows:y,rowActive:C,rowDisabled:b,rowSelected:w,cellSelected:S,cellSelection:T,getData:I,computedVisibleColumns:x,visibleColumnIds:F,computedColumnOrder:N,columnReorderInPageIndex:R}=o,A=F??x.map(Ee=>Ee.id),E=N,P,D={...s,visibleColumnIds:A,allColumnIds:E,rowIndex:n,get rowHasSelectedCells(){return P===void 0&&(P=e.hasSelectedCells(A)),P}},M=!!(e.isTreeNode&&(t.renderTreeIcon||t.renderTreeIconForLeafNode||t.renderTreeIconForParentNode)),_=typeof m=="function"?m(D):m,O;c?.className&&(O=fa(c.className,d)),h&&(O=te(O,fa(h,d))),t.className&&(O=te(O,fa(t.className,d))),M&&(O=te(O,ac({align:l})));let z;e.dataSourceHasGrouping&&t.groupByForColumn&&(z=uc({rowInfo:e,column:t})),M&&(z=Ny({rowInfo:e})),f&&(z=typeof f=="function"?{...z,...f(D)}:{...z,...f}),p&&(z=pa(z,p,d)),c?.style&&(z=pa(z,c.style,d)),t.style&&(z=pa(z,t.style,d)),z=z||{},z.height=i,z.zIndex=`var(${My}-${t.computedVisibleIndex})`,z.visibility=`var(${Fy}-${t.computedVisibleIndex}, visible)`;let K=r!=null?r%2===1:(e.indexInAll!=null?e.indexInAll:n)%2===1,B=y?K?"odd":"even":!1,G=!1,le=!1,Z=!1,De=!1;if(T&&S){let Ee=I(),Te=Ee[e.indexInAll-1],_e=Ee[e.indexInAll+1],ue=x[t.computedVisibleIndex+1],Q=x[t.computedVisibleIndex-1];G=Te?!T.isCellSelected(Te.id,t.id):!0,t.computedPinned==="end"&&t.computedFirstInCategory?le=!0:le=Q?!T.isCellSelected(e.id,Q.id):!0,t.computedPinned==="start"&&t.computedLastInCategory?Z=!0:Z=ue?!T.isCellSelected(e.id,ue.id):!0,De=_e?!T.isCellSelected(_e.id,t.id):!0}let me=T&&S?{top:G,left:le,right:Z,bottom:De}:null,ve=R!=null?a!==R:!1,Oe=te(me?iu(me):"",zo(t,[mt,wt],ou,{dragging:!1,insideDisabledDraggingPage:ve,zebra:B,align:l,verticalAlign:u,rowDisabled:b,rowActive:C,cellSelected:S,rowSelected:w,treeNode:e.isTreeNode?e.isParentNode?"parent":"leaf":!1,firstRow:e.indexInAll===0,firstRowInHorizontalLayoutPage:r===0,groupRow:e.isGroupRow,groupCell:e.isGroupRow?!!t.groupByForColumn:!1,rowExpanded:e.isGroupRow?!e.collapsed:!1}),O,_);return{style:z,className:Oe,cellSelectionBorders:me,zebra:B,columnIsTree:M}}function Oy({groupIndexForColumn:o,groupRenderStrategy:t}){return e=>{let{rowInfo:n,renderBag:i,column:r,align:a}=e,{value:l,groupIcon:u,selectionCheckBox:d}=i,s=n,c=t==="multi-column"&&s.isGroupRow&&o+1!==s.groupNesting,f=te(Eo.flex,r.align==="end"?ur.rowReverse:ur.row,wl.center,`${mt}Expander`,t==="single-column"||t==="multi-column"&&(!n.isGroupRow||d||c&&r.field)?ic({align:a}):null);return c?r.field?cn("div",{class:f},[d,cn("div",{class:lt},[l??null])]):d?cn("div",{class:f},[d]):null:cn("div",{class:f},[u,d,cn("div",{class:lt},[l??null])])}}function ky({groupIndexForColumn:o,groupRenderStrategy:t,toggleGroupRow:e,initialRenderGroupIcon:n}){return i=>{let{rowInfo:r,value:a,rootGroupBy:l,pivotBy:u,column:d}=i,s=t!=="inline"?r:r.isGroupRow&&r.parents?.[o]||r;if(!s)return null;let c=s.collapsed;if(t==="inline"){if(s.groupCount===1)return a;if(s.groupNesting===o&&c)return null}else if(!s.isGroupRow||t==="multi-column"&&o+1!==s.groupNesting)return null;let f=s.groupKeys,m=null,p=u?(s.groupKeys?.length||0)<l?.length:(s.groupKeys?.length||0)<=l?.length;return Ud(s)?m=cn(oc):p&&(m=cn(dn,{expanded:!c,direction:d.align==="end"?"end":"start",onChange:()=>{e(f)}})),n&&(i.renderBag.groupIcon=m,m=n(i)),m}}function cc(){return{getGroupColumnRender:Oy,getGroupColumnRenderGroupIcon:ky}}function fc(o,t,e){return lc(o,t,e,cc())}function pc(o,t,e){return sc(o,t,e,cc())}function mc(o){let{pivotColumns:t,groupBy:e,pivotBy:n,selectionMode:i,groupColumn:r,pivotTotalColumnPosition:a,pivotGrandTotalColumnPosition:l,pivotColumn:u,groupRenderStrategy:d,toggleGroupRow:s,columns:c}=o;if(d==="inline")return{columns:void 0,groupColumnIds:[]};let f={},m=[];if(d==="multi-column")e.forEach((p,h,y)=>{let C=fc({groupByForColumn:p,groupBy:e,pivotBy:n,groupIndexForColumn:h,groupCount:y.length,groupRenderStrategy:d,selectionMode:i},s,r),b=C.id||`group-by-${p.field||p.groupField}`;m.push(b),f[b]=C});else if(d==="single-column"&&e.length){let p=pc({groupCount:e.length,groupBy:e,pivotBy:n,groupRenderStrategy:d,selectionMode:i},s,r),h=p.id||"group-by";m.push(h),f[h]=p}return t?Object.keys(t).forEach(p=>{let h=t[p],y=h.pivotTotalColumn&&h.columnGroup,C=h.pivotTotalColumn&&!h.columnGroup;if(y&&a===!1||C&&l===!1)return;let b={...h};u&&(typeof u=="function"?b={...b,...u({column:b,pivotBy:n,groupBy:e})}:b={...b,...u}),b.inheritFromColumn!==!1&&(b={...typeof b.inheritFromColumn=="string"?c[b.inheritFromColumn]:b.pivotAggregator?.field?tn(c,b.pivotAggregator.field):void 0,...b}),!b.render&&b.renderValue&&(b.render=w=>b.renderValue(w)),f[p]=b}):Object.keys(c).forEach(p=>{let h=c[p];f[p]=h}),{columns:Object.keys(f).length?f:void 0,groupColumnIds:m}}function hc(o){return typeof o.field=="string"}function gc(o){let{column:t,rowInfo:e,fieldsToColumn:n}=o,i;if(t.groupByForColumn){if(e.isGroupRow){let r=e.groupBy[e.groupBy.length-1];(Array.isArray(t.groupByForColumn)||t.groupByForColumn===r)&&(i=r?n.get(r.field||r.groupField):void 0)}!i&&t.field&&(i=n.get(t.field))}return i}function Dt(o){let{getComputed:t,getDataSourceState:e,getState:n,rowIndex:i,columnId:r,api:a,dataSourceApi:l}=o,{dataArray:u}=e(),d=u[i],{isGroupRow:s,isTreeNode:c}=d,f=t().computedColumnsMap.get(r),{activeRowIndex:m,keyboardNavigation:p,isRowDetailEnabled:h}=n(),y=i===m&&p==="row",C=!h||typeof h=="function"&&!h(d)?!1:a.rowDetailApi.isRowDetailExpanded(d.id)?"expanded":"collapsed",{formattedValue:b,formattedValueContext:{rawValue:w}}=kn({column:f,rowInfo:d,rowDetailState:C,columnsMap:t().computedColumnsMap,context:o}),S=Je(f.id,o);return s?{api:a,dataSourceApi:l,column:f,columnApi:S,isParentNode:!1,isGroupRow:!0,isTreeNode:!1,nodeExpanded:!1,rowDetailState:!1,data:d.data,rowActive:y,rowInfo:d,rowSelected:d.rowSelected,value:b,rawValue:w}:c?d.isParentNode?{api:a,dataSourceApi:l,columnApi:S,column:f,nodeExpanded:d.nodeExpanded,isTreeNode:!0,isGroupRow:!1,isParentNode:!0,rowDetailState:C,data:d.data,rowActive:y,rowInfo:d,rowSelected:d.rowSelected,value:b,rawValue:w}:{api:a,dataSourceApi:l,columnApi:S,column:f,nodeExpanded:!1,isTreeNode:!0,isGroupRow:!1,isParentNode:!1,rowDetailState:C,data:d.data,rowActive:y,rowInfo:d,rowSelected:d.rowSelected,value:b,rawValue:w}:{api:a,dataSourceApi:l,columnApi:S,column:f,isTreeNode:!1,isParentNode:!1,isGroupRow:!1,nodeExpanded:!1,rowDetailState:C,data:d.data,rowActive:y,rowInfo:d,rowSelected:d.rowSelected,value:b,rawValue:w}}function yc(o){return Cc(o.column,o.rowInfo)}function bc(o){let{column:t,context:e,rowInfo:n,visibleColumnIds:i}=o,r=gc({rowInfo:n,column:t,fieldsToColumn:o.fieldsToColumn,groupRenderStrategy:e.getState().groupRenderStrategy}),{getState:a}=e,{editingCell:l}=a(),u=kn(o),{formattedValueContext:d}=u,s=e.api.isEditorVisibleForCell({columnId:t.id,rowIndex:n.indexInAll}),c=Object.assign({rowIndexInHorizontalLayoutPage:o.rowIndexInHorizontalLayoutPage,horizontalLayoutPageIndex:o.horizontalLayoutPageIndex,column:o.column,inEdit:s,rowHasSelectedCells:!1},d,{editError:l&&l.primaryKey===n.id&&l.columnId===t.id&&!l.active&&l.accepted instanceof Error?l.accepted:void 0});Object.defineProperty(c,"rowHasSelectedCells",{get(){return n.hasSelectedCells(i)}});let f=typeof t.align=="function"?t.align({isHeader:!1,...c}):t.align??"start",m=typeof t.verticalAlign=="function"?t.verticalAlign({isHeader:!1,...c}):t.verticalAlign??"center";return{inEdit:s,stylingParam:c,formattedValueContext:d,renderFunctions:{renderGroupIcon:t.renderGroupIcon||r?.renderGroupIcon,renderSelectionCheckBox:t.renderSelectionCheckBox,renderRowDetailIcon:t.renderRowDetailIcon,renderTreeIcon:t.renderTreeIcon,renderTreeIconForParentNode:t.renderTreeIconForParentNode,renderTreeIconForLeafNode:t.renderTreeIconForLeafNode,renderValue:t.renderValue||r?.renderValue,renderGroupValue:t.renderGroupValue||r?.renderGroupValue,renderLeafValue:t.renderLeafValue||r?.renderLeafValue},renderParams:Ly({rowIndexInHorizontalLayoutPage:o.rowIndexInHorizontalLayoutPage,horizontalLayoutPageIndex:o.horizontalLayoutPageIndex,column:o.column,rowInfo:o.rowInfo,visibleColumnIds:o.visibleColumnIds,columnsMap:o.columnsMap,fieldsToColumn:o.fieldsToColumn,context:o.context,align:f,verticalAlign:m,formattedValueContext:d}),groupByColumnReference:r}}function Ly(o){let{column:t,context:e,rowInfo:n,align:i,verticalAlign:r,visibleColumnIds:a,columnsMap:l,fieldsToColumn:u,formattedValueContext:d}=o,{value:s}=d,{api:c,getDataSourceState:f,getState:m,dataSourceApi:p}=e,{editingCell:h}=m(),{indexInAll:y}=n,C=f(),{selectionMode:b,cellSelection:w}=C,S=gc({rowInfo:n,column:t,fieldsToColumn:u,groupRenderStrategy:e.getState().groupRenderStrategy}),T=c.toggleGroupRow,I=w?.isCellSelected(n.id,t.id)??!1,x={column:t,columnsMap:l,fieldsToColumn:u,align:i,verticalAlign:r,cellSelected:I,rowHasSelectedCells:!1,horizontalLayoutPageIndex:o.horizontalLayoutPageIndex,rowIndexInHorizontalLayoutPage:o.rowIndexInHorizontalLayoutPage,...d,editError:h&&h.primaryKey===n.id&&h.columnId===t.id&&!h.active&&h.accepted instanceof Error?h.accepted:void 0,groupByColumn:S,selectionMode:b,api:c,dataSourceApi:p,toggleCurrentRowDetails:()=>c.rowDetailApi.toggleRowDetail(n.id),toggleRowDetails:c.rowDetailApi.toggleRowDetail,expandRowDetails:c.rowDetailApi.expandRowDetail,collapseRowDetails:c.rowDetailApi.collapseRowDetail,toggleCurrentTreeNode:()=>{p.treeApi.toggleNode(n.nodePath)},toggleTreeNode:p.treeApi.toggleNode,expandTreeNode:p.treeApi.expandNode,collapseTreeNode:p.treeApi.collapseNode,selectTreeNode:p.treeApi.selectNode,deselectTreeNode:p.treeApi.deselectNode,toggleTreeNodeSelection:p.treeApi.toggleNodeSelection,toggleCurrentTreeNodeSelection:()=>{n.isTreeNode&&p.treeApi.toggleNodeSelection(n.nodePath)},selectRow:c.rowSelectionApi.selectRow,deselectRow:c.rowSelectionApi.deselectRow,toggleRowSelection:c.rowSelectionApi.toggleRowSelection,toggleGroupRowSelection:c.rowSelectionApi.toggleGroupRowSelection,selectCell:()=>{c.cellSelectionApi.selectCell({rowId:n.id,colId:t.id})},deselectCell:()=>{c.cellSelectionApi.deselectCell({rowId:n.id,colId:t.id})},renderBag:{all:null,value:typeof s=="boolean"?`${s}`:s,selectionCheckBox:null,groupIcon:null,treeIcon:null},selectCurrentRow:()=>{if(!n.isTreeNode)return c.rowSelectionApi.selectRow(n.id,n.dataSourceHasGrouping?n.groupKeys:void 0)},deselectCurrentRow:()=>{if(!n.isTreeNode)return c.rowSelectionApi.deselectRow(n.id,n.dataSourceHasGrouping?n.groupKeys:void 0)},rowIndex:y,toggleGroupRow:T,toggleCurrentGroupRow:()=>{n.isGroupRow&&T(n.groupKeys)},toggleCurrentRowSelection:()=>{if(!(n.isGroupRow||n.isTreeNode))return c.rowSelectionApi.toggleRowSelection(n.id)},toggleCurrentGroupRowSelection:()=>{if(n.isGroupRow)return c.rowSelectionApi.toggleGroupRowSelection(n.isGroupRow?n.groupKeys:[])},rootGroupBy:C.groupBy,pivotBy:C.pivotBy};return Object.defineProperty(x,"rowHasSelectedCells",{get(){return n.hasSelectedCells(a)}}),x}function zy(o,t){if(!o.isGroupRow)return;let e=o.groupData;if(!e.length)return;let n=e[0][t];for(let i=1,r=e.length;i<r;i++)if(e[i][t]!==n)return;return n}function Cc(o,t){let{data:e,isGroupRow:n,dataSourceHasGrouping:i}=t,r=i?t.groupBy:void 0,a=n&&r&&o.groupByForColumn&&(Array.isArray(o.groupByForColumn)||o.groupByForColumn===r[r.length-1])?t.value:hc(o)?e?.[o.field]:null;return o.field&&t.isGroupRow&&t.reducerData&&t.reducerData[o.field]!=null&&(a=t.reducerData[o.field]),a===void 0&&t.isGroupRow&&o.groupByForColumn&&hc(o)&&(a=zy(t,o.field)),o.valueGetter&&!t.isGroupRow&&t.data&&(a=o.valueGetter({data:t.data,field:o.field})),a}function Vy(o,t,e,n,i){let{rowSelected:r,indexInAll:a}=e,{activeRowIndex:l,keyboardNavigation:u}=n.getState(),d=a===l&&u==="row";return e.isGroupRow?{rowInfo:e,isGroupRow:!0,isTreeNode:!1,isParentNode:!1,nodeExpanded:!1,data:e.data,rowDetailState:!1,rowSelected:r,rowActive:d,value:o,rawValue:o,field:t.field}:e.isTreeNode?e.isParentNode?{rowInfo:e,isGroupRow:!1,isTreeNode:!0,isParentNode:!0,nodeExpanded:e.nodeExpanded,data:e.data,rowDetailState:i,rowSelected:r,rowActive:d,value:o,rawValue:o,field:t.field}:{rowInfo:e,isGroupRow:!1,isTreeNode:!0,isParentNode:!1,nodeExpanded:!1,data:e.data,rowDetailState:i,rowSelected:r,rowActive:d,value:o,rawValue:o,field:t.field}:{rowInfo:e,isGroupRow:!1,isTreeNode:!1,isParentNode:!1,nodeExpanded:!1,data:e.data,rowDetailState:i,rowSelected:r,rowActive:d,value:o,rawValue:o,field:t.field}}function kn(o){let{column:t,rowInfo:e,context:n,rowDetailState:i}=o,r=Cc(t,e),a=Vy(r,t,e,n,i),l=t.valueFormatter?t.valueFormatter(a):r;return a.value=l,{formattedValue:l,formattedValueContext:a}}function ma(o,t){let{rowIndex:e,primaryKey:n}=t,{dataArray:i}=o.getDataSourceState();if(n!==void 0){let r=o.dataSourceApi.getIndexByPrimaryKey(n);if(r!==-1)return r;if(i[e]?.id!==n)return-1}return i[e]?e:-1}function Tc(o,t){let e=ma(o,t);return e===-1?null:Dt({...o,rowIndex:e,columnId:t.columnId})}function bo(o,t){console.warn(`Skipping "${o}": the edited row (primaryKey: ${String(t.primaryKey)}, rowIndex: ${t.rowIndex}) is no longer in the data array.`)}function ha(o){let{getComputed:t,getState:e,actions:n}=o,i=e().columnMenuVisibleForColumnId;if(!i)return;let r=t(),a=r.computedVisibleColumnsMap,l=r.computedColumnOrder;if(a.has(i)){n.columnMenuVisibleKey=Date.now();return}function u(m,p){let h=l[d+m*p],y=a.get(h);if(y&&y.renderMenuIcon!==!1)return h}let d=l.indexOf(i),s=0,c=-1,f;for(;!f&&s<l.length&&(s++,f=u(s,c),f||(c*=-1,f=u(s,c)),!f););return f&&(n.columnMenuVisibleForColumnId=f),f}function Di(o,t){let{rowIndex:e,colIndex:n}=o,{rowIndex:i,colIndex:r}=t,[a,l]=n>r?[r,n]:[n,r],[u,d]=e>i?[i,e]:[e,i];return[{rowIndex:u,colIndex:a},{rowIndex:d,colIndex:l}]}function ga(o,t,e){let{rowsPerPage:n}=e;return n?Math.floor(o.rowIndex/n)===Math.floor(t.rowIndex/n):!0}function Sc(o,t,e){if(ga(o,t,e))throw"You should not call this when the positions are in the same page";let{rowsPerPage:n,columnsPerSet:i}=e;if(n===0)throw"rowsPerPage cannot be 0";let r=o,a=t;Math.floor(o.rowIndex/n)>Math.floor(t.rowIndex/n)&&(r=t,a=o);let{rowIndex:l,colIndex:u}=r,{rowIndex:d,colIndex:s}=a,c=Math.floor(l/n),f=Math.floor(d/n),m=l%n,p=d%n,h=Math.min(m,p),y=Math.max(m,p),C=[];for(let b=c;b<=f;b++)for(let w=h;w<=y;w++){let S=b*n+w;if(b===c)for(let T=u;T<i;T++)C.push({rowIndex:S,colIndex:T});else if(b===f)for(let T=0;T<=s;T++)C.push({rowIndex:S,colIndex:T});else for(let T=0;T<i;T++)C.push({rowIndex:S,colIndex:T})}return C}function Gy(o,t){let e=new Set(o);return t.map(n=>e.has(n)?n:null).filter(n=>n!=null)}var ya=class{constructor(t){this.getCellSelectionPosition=t=>{let e=t.rowId??Yt(t.rowIndex,this.getDataSourceState)?.id,n=t.colId??this.getComputed().computedVisibleColumns[t.colIndex].id;return[e,n]};this.setRangeSelected=(t,e,n)=>{let i=this.getDataSourceState(),r=i.cellSelection;if(!r)return;let a=new Ke(r);a.debugId=i.debugId??"";let[l,u]=this.getCellSelectionPosition(t),[d,s]=this.getCellSelectionPosition(e),c=this.getComputed().computedVisibleColumnsMap.get(u),f=this.getComputed().computedVisibleColumnsMap.get(s);if(!c||!f)return;let m=c.computedVisibleIndex,p=f.computedVisibleIndex,h=Yt(l,this.getDataSourceState),y=Yt(d,this.getDataSourceState);if(!h||!y)return;let C=h.indexInAll,b=y.indexInAll,[w,S]=Di({rowIndex:C,colIndex:m},{rowIndex:b,colIndex:p});for(let T=w.rowIndex;T<=S.rowIndex;T++)for(let I=w.colIndex;I<=S.colIndex;I++){let x={rowIndex:T,colIndex:I},[F,N]=this.getCellSelectionPosition(x);n?a.selectCell(F,N):a.deselectCell(F,N)}this.dataSourceActions.cellSelection=a};this.getCellSelectionPositionsWithFn=(t,e)=>{let n=ii(this.getDataSourceState),{computedVisibleColumns:i}=this.getComputed(),r=i.map(c=>c.id),a=new Set,l=[],u=new Set;n.filter(c=>{i.forEach(f=>{this.isCellSelected({rowId:c.id,colId:f.id})&&(a.has(f.id)||a.add(f.id),u.has(c.id)||(u.add(c.id),l.push(c)))})});let d=Gy(Array.from(a),r),s=l.map(c=>d.map(f=>this.isCellSelected({rowId:c.id,colId:f})?t(c,f):e));return{columnIds:d,positions:s}};this.getAllCellSelectionPositions=()=>this.getCellSelectionPositionsWithFn((t,e)=>[t.id,e],null);this.mapCellSelectionPositions=(t,e)=>this.getCellSelectionPositionsWithFn(t,e);this.deselectAll=()=>{let t=this.getDataSourceState(),e=t.cellSelection;if(!e)return;let n=new Ke(e);n.debugId=t.debugId??"",n.deselectAll(),this.dataSourceActions.cellSelection=n};this.clear=()=>{this.deselectAll()};this.selectAll=()=>{let t=this.getDataSourceState(),e=t.cellSelection;if(!e)return;let n=new Ke(e);n.debugId=t.debugId??"",n.selectAll(),this.dataSourceActions.cellSelection=n};this.selectRange=(t,e)=>{this.setRangeSelected(t,e,!0)};this.deselectRange=(t,e)=>{this.setRangeSelected(t,e,!1)};this.isCellSelected=t=>{let[e,n]=this.getCellSelectionPosition(t);return this.getDataSourceState().cellSelection?.isCellSelected(e,n)??!1};this.selectCell=t=>{let e=this.getDataSourceState(),n=e.cellSelection;if(!n)return;let[i,r]=this.getCellSelectionPosition(t),a=t.clear?new Ke:new Ke(n);a.debugId=e.debugId??"",a.selectCell(i,r),this.dataSourceActions.cellSelection=a};this.deselectCell=t=>{let e=this.getDataSourceState(),n=e.cellSelection;if(!n)return;let[i,r]=this.getCellSelectionPosition(t),a=new Ke(n);a.debugId=e.debugId??"",a.deselectCell(i,r),this.dataSourceActions.cellSelection=a};this.selectColumn=(t,e)=>{e?.clear&&this.deselectAll();let n=this.getDataSourceState(),i=n.cellSelection;if(!i)return;let r=new Ke(i);r.debugId=n.debugId??"",r.selectColumn(t),this.dataSourceActions.cellSelection=r};this.deselectColumn=t=>{let e=this.getDataSourceState(),n=e.cellSelection;if(!n)return;let i=new Ke(n);i.debugId=e.debugId??"",i.deselectColumn(t),this.dataSourceActions.cellSelection=i};this.getComputed=t.getComputed,this.getDataSourceState=t.getDataSourceState,this.dataSourceActions=t.dataSourceActions}};function wc(o){return new ya(o)}function vc(o){let{dataSourceApi:t,getState:e,actions:n}=o,i={collapseAllDetails(){n.rowDetailState=new ut({collapsedRows:!0,expandedRows:[]})},expandAllDetails(){n.rowDetailState=new ut({expandedRows:!0,collapsedRows:[]})},isRowDetailCollapsed(r){let a=e().isRowDetailExpanded;if(!a)return!0;let l=t.getRowInfoByPrimaryKey(r);return l?!a(l):!0},isRowDetailEnabledForRow(r){let{isRowDetailEnabled:a}=e();if(!a)return!1;if(typeof a=="function"){let l=t.getRowInfoByPrimaryKey(r);return l?a(l):!1}return!0},isRowDetailExpanded(r){return!i.isRowDetailCollapsed(r)},collapseRowDetail(r){let a=e(),l=a.rowDetailState;if(!l){console.error("Cannot collapse row details via rowDetailState, as no props.rowDetailState is provided.");return}let u=new ut(l);u.collapseRowDetails(r),a.lastRowToExpandRef.current=null,a.lastRowToCollapseRef.current=r,n.rowDetailState=u},expandRowDetail(r){let a=e(),l=a.rowDetailState;if(!l){console.error("Cannot expand row details via rowDetailState, as no props.rowDetailState is provided.");return}let u=new ut(l);u.expandRowDetails(r),a.lastRowToCollapseRef.current=null,a.lastRowToExpandRef.current=r,n.rowDetailState=u},toggleRowDetail(r){i.isRowDetailExpanded(r)?i.collapseRowDetail(r):i.expandRowDetail(r)}};return i}function Xt(o,t,e){return Math.min(Math.max(o,t),e)}function Ai(o,t,e){let n=o().dataArray,i=0,r=n.length-1,a=t;do{a+=e;let l=n[a];if(!l)return a<i?i:r;if(!l.rowDisabled)return a}while(a>=i&&a<=r);return Xt(a,i,r)}function Ky(o,t){let{getState:e,getDataSourceState:n,actions:i,api:r,dataSourceApi:a}=o,{key:l}=t,u=n().dataArray,d=u.length,s=e(),{brain:c}=s,{activeRowIndex:f}=s;if(f==null)return!1;let{start:[m],end:[p]}=c.getRenderRange(),h=f,y=p-m-1,C=0,b=d-1,w={ArrowDown:()=>{f=Ai(n,f,1)},ArrowUp:()=>{f=Ai(n,f,-1)},ArrowLeft:()=>{let T=u[f];if(c.isHorizontalLayoutBrain){let I=c.rowsPerPage;f-I>=C?f=f-I:w.ArrowUp();return}return T&&T.isGroupRow?r.collapseGroupRow(T.groupKeys):T&&r.rowDetailApi.isRowDetailEnabledForRow(T.id)?r.rowDetailApi.collapseRowDetail(T.id):!1},ArrowRight:()=>{let T=u[f];if(c.isHorizontalLayoutBrain){let I=c.rowsPerPage;f+I<=b?f=f+I:w.ArrowDown();return}return T&&T.isGroupRow?r.expandGroupRow(T.groupKeys):T&&r.rowDetailApi.isRowDetailEnabledForRow(T.id)?r.rowDetailApi.expandRowDetail(T.id):!1},Enter:()=>{let T=u[f];return T&&T.isGroupRow?r.toggleGroupRow(T.groupKeys):T&&T.isTreeNode&&T.isParentNode?a.treeApi.toggleNode(T.nodePath):r.rowDetailApi.isRowDetailEnabledForRow(T.id)?r.rowDetailApi.toggleRowDetail(T.id):!1},PageDown:()=>{f=Math.min(f+y,d-1)},PageUp:()=>{f=Math.max(f-y,C)},End:()=>{f=b},Home:()=>{f=C}},S=w[l];return S?(S(),h!==f?(i.activeRowIndex=f,!0):!1):!1}function ba(o,t){let{api:e,getState:n,getComputed:i,getDataSourceState:r,dataSourceApi:a}=o,{key:l,shiftKey:u}=t,d=r().dataArray,s=n(),{activeCellIndex:c,brain:f}=s;if(!c)return!1;let[m,p]=c,{start:[h,y],end:[C,b]}=f.getRenderRange(),w=C-h-1,S=b-y-1,T=r().dataArray.length-1,I=i().computedVisibleColumns.length-1,x=0,F=0;m=Xt(m,0,T),p=Xt(p,0,I);let N={ArrowDown:()=>{m=Xt(m+1,x,T)},ArrowUp:()=>{m=Xt(m-1,x,T)},ArrowLeft:()=>{if(p===F)if(m!==x&&(p=I),f.isHorizontalLayoutBrain){let A=f.rowsPerPage;m-A>=x?m=m-A:N.ArrowUp()}else N.ArrowUp();else p=Xt(p-1,F,I)},ArrowRight:()=>{if(p===I)if(m!==T&&(p=F),f.isHorizontalLayoutBrain){let A=f.rowsPerPage;m+A<=T?m=m+A:N.ArrowDown()}else N.ArrowDown();else p=Xt(p+1,F,I)},Enter:()=>{let A=d[m];return A&&A.isGroupRow?e.toggleGroupRow(A.groupKeys):A&&A.isTreeNode&&A.isParentNode?a.treeApi.toggleNode(A.nodePath):A&&e.rowDetailApi.isRowDetailEnabledForRow(A.id)?e.rowDetailApi.toggleRowDetail(A.id):!1},PageDown:()=>{u?p=Math.min(p+S,I):m=Math.min(m+w,T)},PageUp:()=>{u?p=Math.max(p-S,F):m=Math.max(m-w,x)},End:()=>{u?p=I:m=T},Home:()=>{u?p=F:m=x}},R=N[l];return R?(R(),[m,p]):!1}function By(o,t){let e=ba(o,t);return e?(o.actions.activeCellIndex=e,!0):!1}var Hy={ArrowUp:!0,ArrowDown:!0,ArrowLeft:!0,ArrowRight:!0,PageUp:!0,PageDown:!0,Home:!0,End:!0,Enter:!0," ":!0};function Rc(o,t){let{key:e}=t,{getState:n}=o,i=n(),{activeRowIndex:r,activeCellIndex:a,keyboardNavigation:l,cellContextMenuVisibleFor:u,contextMenuVisibleFor:d}=i;return u||d||!Hy[e]?!1:r!=null&&l==="row"?Ky(o,t):a!=null&&l==="cell"?By(o,t):!1}var Ca=class{constructor(t){this.param=t}setKeyboardNavigation(t){this.param.actions.keyboardNavigation=t}setActiveCellIndex(t){this.param.actions.activeCellIndex=t}setActiveRowIndex(t){this.param.actions.activeRowIndex=t}gotoRowWithDirection(t){let{getDataSourceState:e,getState:n}=this.param,{activeRowIndex:i,keyboardNavigation:r}=n();if(r!=="row")return console.error("Keyboard navigation is not enabled for rows"),!1;if(i==null)return!1;let a=Ai(e,i,t);return a!==i?(this.param.actions.activeRowIndex=a,a):!1}gotoRow(t){return this.gotoRowWithDirection(t)}gotoNextRow(){return this.gotoRow(1)}gotoPreviousRow(){return this.gotoRow(-1)}gotoCell(t){let{direction:e}=t,n=e=="top"?"ArrowUp":e=="bottom"?"ArrowDown":e=="left"?"ArrowLeft":"ArrowRight",i=ba(this.param,{key:n,shiftKey:!1});return i===!1?!1:(this.param.actions.activeCellIndex=i,i)}};function Ic(o){return new Ca(o)}function xc(o,t){return o.id?o.id===t.id:!!(o.field&&o.field===t.field)}var Ta=class{constructor(t){this.columnApiById=new Map;this.getVisibleRenderRange=()=>this.getState().brain.getRenderRange();this.hideFilterOperatorMenu=()=>{this.actions.filterOperatorMenuVisibleForColumnId=null};this.setGroupRenderStrategy=t=>{this.actions.groupRenderStrategy=t};this.getColumnOrder=()=>this.getComputed().computedColumnOrder;this.getComputedColumnById=t=>this.getComputed().computedColumnsMap.get(t);this.getVisibleColumnOrder=()=>{let t=this.getColumnOrder(),e=this.getComputed().computedVisibleColumnsMap;return t.filter(n=>e.has(n))};this.persistEdit=async t=>{t=t??{};let{editingCell:e,editingValueRef:n}=this.getState();if(!e)return Promise.resolve(new Error("no edit in progress"));await new Promise(f=>requestAnimationFrame(f));let i=this.getComputed().computedColumnsMap.get(e.columnId),r=t.value??e.value;!e.active&&e.waiting!=="persist"&&(this.actions.editingCell={...e,active:!1,waiting:"persist"});let a=ma({...this.context,api:this},e);if(a===-1){let f=new Error(`Cannot persist edit: the edited row (primaryKey: ${String(e.primaryKey)}, rowIndex: ${e.rowIndex}) is no longer in the data array.`);return this.actions.editingCell={...e,active:!1,accepted:!1,waiting:!1,persisted:f},Promise.resolve(f)}let l={...Dt({rowIndex:a,columnId:e.columnId,...this.context,api:this}),value:r,initialValue:e.initialValue},u=r;n.current=null,i.getValueToPersist&&(u=await i.getValueToPersist(l)),l.value=u,e.value=u;let d=this.getState().persistEdit??(()=>{if(!l.column.field)return r;let f=this.getDataSourceState().primaryKey,m=l.data&&typeof f=="string"?{[f]:l.data[f],[l.column.field]:u}:{...l.data,[l.column.field]:u};return this.context.dataSourceApi.updateData(m)}),s;try{s=await d(l)}catch(f){s=f}let c=s instanceof Error?s:!0;return this.actions.editingCell={...e,active:!1,accepted:!1,waiting:!1,persisted:c},Promise.resolve(c)};this.clearEditInfo=()=>{this.actions.editingCell=null};this.isEditInProgress=()=>{let{editingCell:t}=this.getState();return t?t.active:!1};this.isEditorVisibleForCell=t=>{let{rowIndex:e,columnId:n}=t,{dataArray:i}=this.getDataSourceState(),{editingCell:r}=this.getState(),a=i[e];return!a||!r?!1:r.columnId===n&&r.primaryKey===a.id&&!!(r.active||r.waiting)};this.confirmEdit=t=>this.stopEdit({value:t});this.stopEdit=async t=>{let e=this.getState(),{editingCell:n,editingValueRef:i}=e;if(!n)return!0;t||(t={});let r=t.value??i.current;if(!t.cancel&&!t.reject){let{rowIndex:a,columnId:l}=n;this.actions.editingCell={...e.editingCell,value:r,active:!1,waiting:"accept"};let{computedColumnsMap:u}=this.getComputed(),d=u.get(l),s=e.shouldAcceptEdit??d.shouldAcceptEdit,c=s?s({...Dt({...this.context,api:this,dataSourceApi:this.context.dataSourceApi,columnId:l,rowIndex:a}),value:r,initialValue:n.initialValue}):!0;return await new Promise(f=>requestAnimationFrame(f)),Promise.resolve(c).then(f=>{if(f===!0)return this.actions.editingCell={...e.editingCell,active:!1,accepted:!0,persisted:!1,waiting:"persist",value:r},!0;throw f}).catch(f=>(f instanceof Error||(f=new Error(`Edit rejected: ${f}`)),this.actions.editingCell={...n,value:r,persisted:!1,active:!1,waiting:!1,accepted:f},{reject:f,value:r}))}return t.cancel&&n?.active?(this.actions.editingCell={...n,active:!1,cancelled:!0,waiting:!1,persisted:!1},{cancel:!0,value:r}):t.reject&&n?.active?(this.actions.editingCell={...n,value:r,active:!1,persisted:!1,waiting:!1,accepted:t.reject},{reject:t.reject,value:r}):!0};this.cancelEdit=()=>this.stopEdit({cancel:!0});this.rejectEdit=t=>this.stopEdit({reject:t});this.getColumnAtIndex=t=>this.getComputed().computedVisibleColumns[t]??null;this.isCellEditable=t=>{let{rowIndex:e,primaryKey:n,columnId:i}=t,r=e??this.context.dataSourceApi.getIndexByPrimaryKey(n),{computedColumnsMap:a}=this.getComputed(),l=a.get(i);if(!l||!l.computedEditable||l.groupByForColumn)return Promise.resolve(!1);let u=this.getDataSourceState().dataArray[r];if(!u||u.isGroupRow)return Promise.resolve(!1);if(l.computedEditable===!0)return Promise.resolve(!0);let d=l.computedEditable(Dt({...this.context,api:this,columnId:i,rowIndex:r}));return typeof d=="boolean"?Promise.resolve(d):d};this.getColumnApi=t=>{let e=typeof t=="string"?t:this.getComputed().computedVisibleColumns[t]?.id,n=this.columnApiById.get(e);if(n)return n;let i=Je(t,{...this.context,api:this});return i&&this.columnApiById.set(i.getColumnId(),i),i};this.isColumnSortable=t=>this.getColumnApi(t)?.isSortable()??!1;this.getCellValue=t=>this.getCellValues(t)?.value??null;this.getCellValues=t=>{let{rowIndex:e,primaryKey:n,columnId:i}=t,{dataSourceApi:r,getState:a}=this.context,{computedColumnsMap:l}=this.getComputed(),u=e??r.getIndexByPrimaryKey(n),d=l.get(i),s=r.getRowInfoByIndex(u),c=s?.id;if(!s||!d)return d||console.warn(`No column found with id: "${i}"`),s||console.warn(`No row found with index: "${u}" or primary key: "${c}"`),null;let f=this,{isRowDetailEnabled:m}=a(),p=!m||typeof m=="function"&&!m(s)?!1:this.rowDetailApi.isRowDetailExpanded(s.id)?"expanded":"collapsed",h=kn({column:d,rowInfo:s,columnsMap:l,context:{...this.context,api:f},rowDetailState:p});return{value:h.formattedValueContext.value,formattedValue:h.formattedValue,rawValue:h.formattedValueContext.rawValue}};this.getVerticalRenderRange=()=>{let t=this.getState().brain.getRenderRange();return{renderStartIndex:t.start[0],renderEndIndex:t.end[0]}};this.setColumnOrder=t=>{this.actions.columnOrder=t};this.setVisibilityForColumnGroup=(t,e)=>{let n={...this.getState().columnGroupVisibility};e?delete n[t]:n[t]=!1,this.actions.columnGroupVisibility=n};this.collapseAllGroupRows=()=>{let t=this.getDataSourceState(),e=new pt(t.groupRowsState);e.collapseAll(),this.dataSourceActions.groupRowsState=e};this.collapseGroupRow=t=>this.getDataSourceState().groupRowsState.isGroupRowExpanded(t)?(this.toggleGroupRow(t),!0):!1;this.expandGroupRow=t=>this.getDataSourceState().groupRowsState.isGroupRowCollapsed(t)?(this.toggleGroupRow(t),!0):!1;this.toggleGroupRow=t=>{let e=this.getDataSourceState(),n=new pt(e.groupRowsState);if(n.toggleGroupRow(t),this.dataSourceActions.groupRowsState=n,e.lazyLoad){let i=[at,...t],r=e.originalLazyGroupData.get(i);n.isGroupRowExpanded(t)?r?.cache||In(e.data,e,this.dataSourceActions,{groupKeys:t},this.context.getDataSourceMasterContext()):r?.cache||(e.lazyLoadCacheOfLoadedBatches.getKeysStartingWith(t).forEach(l=>{e.lazyLoadCacheOfLoadedBatches.delete(l)}),this.dataSourceActions.lazyLoadCacheOfLoadedBatches=W.clone(e.lazyLoadCacheOfLoadedBatches),e.originalLazyGroupData.delete(i),this.dataSourceActions.originalLazyGroupDataChangeDetect=It())}};this.toggleSortingForColumn=(t,e)=>{if(!this.getComputed().computedColumnsMap.get(t))return;let i=this.getSortingForColumn(t);i===null?i=1:i=i===1?-1:null,this.setSortingForColumn(t,i,e)};this.getState=()=>this.context.getState();this.getComputed=()=>this.context.getComputed();this.getDataSourceState=()=>this.context.getDataSourceState();this.scrollCellIntoView=(t,e,n={offset:0})=>{let i=this.getState(),r=this.getComputed(),a=e;if(typeof e=="string"){let h=r.computedVisibleColumnsMap.get(e);if(!h)return!1;a=h.computedVisibleIndex}if(i.brain.isHorizontalLayoutBrain){n=n||{};let h=i.brain.getPageIndexForRow(t);n.horizontalLayoutPageIndex=h||0}let l=i.renderer.getScrollPositionForScrollColumnIntoView(a,n),u=i.renderer.getScrollPositionForScrollRowIntoView(t,n);if(!l||!u)return!1;let d={scrollLeft:l.scrollLeft,scrollTop:u.scrollTop},s=i.brain.getScrollPosition(),c=i.brain.scrollLeftMax,f=i.brain.scrollTopMax;if(c<0&&f<0)return!0;let m=d.scrollLeft>c+(n.offset||0),p=d.scrollTop>f+(n.offset||0);return m&&p?!1:(d.scrollLeft!==s.scrollLeft&&!m&&(i.scrollerDOMRef.current.scrollLeft=d.scrollLeft),d.scrollTop!==s.scrollTop&&!p&&(i.scrollerDOMRef.current.scrollTop=d.scrollTop),!0)};this.context=t,this.rowSelectionApi=Cl({dataSourceActions:t.dataSourceActions,getDataSourceState:t.getDataSourceState}),this.keyboardNavigationApi=Ic({getState:t.getState,getDataSourceState:t.getDataSourceState,actions:t.actions,getComputed:t.getComputed,api:this,dataSourceApi:t.dataSourceApi}),this.rowDetailApi=vc({getState:t.getState,actions:t.actions,dataSourceApi:t.dataSourceApi}),this.cellSelectionApi=wc({dataSourceActions:t.dataSourceActions,getDataSourceState:t.getDataSourceState,getComputed:t.getComputed})}get actions(){return this.context.actions}get dataSourceActions(){return this.context.dataSourceActions}get dataSourceApi(){return this.context.dataSourceApi}focus(){this.getState().scrollerDOMRef.current?.focus()}hideContextMenu(){this.actions.contextMenuVisibleFor=null,this.actions.cellContextMenuVisibleFor=null}realignColumnContextMenu(t){let e={actions:this.actions,getState:this.getState,getComputed:this.getComputed},n=this.getState().columnMenuRealignDelay;(!n||n<0)&&(ha(e),t?.()),setTimeout(()=>{this.isDestroyed()||(ha(e),t?.())},n)}isDestroyed(){return!this.getState().domRef.current}async startEdit(t){let{columnId:e,rowIndex:n,primaryKey:i,value:r}=t,a=n??this.context.dataSourceApi.getIndexByPrimaryKey(i);return this.isCellEditable({rowIndex:a,columnId:e}).then(async l=>{if(l){let u=this.getDataSourceState().dataArray,s=this.getComputed().computedColumnsMap.get(e),c=u[a],f=r??yc({column:s,rowInfo:c}),m=f;s.getValueToEdit&&(f=await s.getValueToEdit(Dt({...this.context,rowIndex:a,columnId:e,api:this}))),this.actions.editingCell={active:!0,accepted:!1,persisted:!1,columnId:e,value:f,initialValue:m,rowIndex:a,primaryKey:u[a]?.id}}return l})}setSortingForColumn(t,e,n){let{computedColumnsMap:i}=this.getComputed(),r=i.get(t);if(!r||this.getSortingForColumn(t)===e&&this.getDataSourceState().multiSort===!1)return;if(e===null){this.setSortInfoForColumn(t,null,n);return}let l=!!r.pivotColumn,u=r.groupByForColumn,d=l?void 0:r.field,s=u?Array.isArray(u)?u:[u]:[],c=s.map(p=>p.valueGetter?h=>p.valueGetter({data:h,field:p.field}):p.field?p.field:p.groupField??void 0).filter(_n);c.length&&(d=c);let f=r.computedSortType;if(s.length&&f===Ot){let p=this.getState().initialColumns;f=s.flatMap(y=>{let C=y.field??y.groupField,b=C?i.get(C):null;if(b)return b.computedSortType;let w=C?tn(p,C):void 0;return w?w.sortType||(typeof w.type=="string"?w.type:"string"):[Ot]})}s.length&&!Array.isArray(f)&&(f=[f]);let m={dir:e,id:r.id,field:d,type:f};!l&&r.valueGetter&&(m.valueGetter=p=>r.valueGetter({data:p,field:r.field})),this.setSortInfoForColumn(t,m,n)}setSortInfoForColumn(t,e,n){let i=this.getDataSourceState(),r=this.getComputed().computedColumnsMap.get(t);if(!r)return;if(!i.multiSort){this.dataSourceApi.setSortInfo(e?[e]:null);return}let a=r.field,l={id:t,field:a},u=i.sortInfo?.slice()??[];if(e===null){u=u.filter(c=>!xc(c,l)),this.dataSourceApi.setSortInfo(u);return}let d=!1;if((n?.multiSortBehavior??this.getState().multiSortBehavior)==="replace"){this.dataSourceApi.setSortInfo([e]);return}u=u.map(c=>d?c:xc(c,l)?(d=!0,e):c),d||u.push(e),this.dataSourceApi.setSortInfo(u)}getSortTypeForColumn(t){let e=this.getComputed().computedColumnsMap.get(t);return e?e.computedSortType:null}getSortInfoForColumn(t){let e=this.getComputed().computedColumnsMap.get(t);return e?e.computedSortInfo:null}getSortingForColumn(t){let e=this.getSortInfoForColumn(t);return e?e.dir:null}setPinningForColumn(t,e){let n={...this.getState().columnPinning};e===!1?delete n[t]:n[t]=e,this.actions.columnPinning=n}setColumnFilter(t,e){let n=this.getComputed().computedColumnsMap.get(t);if(!n)return;let i=this.getDataSourceState(),{filterTypes:r}=i,a;if(n.computedFilterValue)a={...n.computedFilterValue,filter:{...n.computedFilterValue.filter}};else{let l=n.computedFilterType;if(!r[l])return;let u={filter:{type:l,value:e,operator:r[l].defaultOperator},valueGetter:n.valueGetter};(n.field||typeof n.groupByForColumn=="string")&&(u.field=n.field||n.groupByForColumn),a=u}a.id=n.id,a.filter.value=e,this.setFilterValueForColumn(t,a)}setColumnFilterOperator(t,e){let n=this.getComputed().computedColumnsMap.get(t);if(!n)return;let i=this.getDataSourceState(),{filterTypes:r}=i,a=n.computedFilterType,l=r[a].operators,u=l.find(c=>c.name===e)??l.find(c=>c.name===r[a].defaultOperator),d=u.name,s;n.computedFilterValue?(s={...n.computedFilterValue,filter:{...n.computedFilterValue.filter,operator:d}},u.defaultFilterValue!==void 0&&(s.filter.value=u.defaultFilterValue)):(s={filter:{operator:d,type:a,value:u.defaultFilterValue!==void 0?u.defaultFilterValue:[...r[a].emptyValues.values()][0]},valueGetter:n.valueGetter},n.field&&(s.field=n.field)),s.id=n.id,this.setFilterValueForColumn(t,s)}setFilterValueForColumn(t,e){let n=this.getComputed().computedColumnsMap.get(t);if(!n)return;let r=this.getDataSourceState().filterValue??[],a=!1;r=r.map(l=>l===n.computedFilterValue?(a=!0,e):l),a||r.push(e),this.dataSourceActions.filterValue=r}removeColumnFilter(t){let e=this.getComputed().computedColumnsMap.get(t);if(!e)return;let i=this.getDataSourceState().filterValue??[],r=!1;i=i.filter(a=>a===e.computedFilterValue?(r=!0,!1):!0),r&&(this.dataSourceActions.filterValue=i)}clearColumnFilter(t){let e=this.getComputed().computedColumnsMap.get(t);if(!e)return;let n=this.getDataSourceState(),i=n.filterValue??[],r=!1;i=i.map(a=>{if(a===e.computedFilterValue){let l=e.computedFilterValue.filter.type,u=n.operatorsByFilterType[l],d=n.filterTypes[l];if(r=!0,!d)return null;let s=a.filter.operator??d?.defaultOperator,f=u[s].defaultFilterValue??(d.emptyValues||[])[0]??void 0;return{...a,filter:{...a.filter,operator:s,value:f}}}return a}).filter(_n),r&&(this.dataSourceActions.filterValue=i)}setVisibilityForColumn(t,e){let n={...this.getState().columnVisibility};e?delete n[t]:n[t]=!1,this.actions.columnVisibility=n}getVisibleColumnsCount(){return this.getComputed().computedVisibleColumns.length}setColumnVisibility(t){this.actions.columnVisibility=t}get scrollContainer(){return this.getState().scrollerDOMRef.current}get scrollLeftMax(){return this.getState().brain.scrollLeftMax}get scrollTopMax(){return this.getState().brain.scrollTopMax}get scrollLeft(){return this.getState().brain.getScrollPosition().scrollLeft}set scrollLeft(t){let e=this.getState();e.scrollerDOMRef.current&&(e.scrollerDOMRef.current.scrollLeft=Math.max(t,0))}get scrollTop(){return this.getState().brain.getScrollPosition().scrollTop}set scrollTop(t){let e=this.getState();e.scrollerDOMRef.current&&(e.scrollerDOMRef.current.scrollTop=Math.max(t,0))}scrollRowIntoView(t,e={offset:0}){let n=this.getState(),i=this.getComputed(),r=n.brain.getScrollPosition(),a=e.columnId,l;!a&&n.brain.isHorizontalLayoutBrain&&i.computedVisibleColumns.length>0&&(a=i.computedVisibleColumns[Math.ceil(i.computedVisibleColumns.length/2)].id,l=i.computedVisibleColumnsMap.get(a)?.computedVisibleIndex);let u=n.renderer.getScrollPositionForScrollRowIntoView(t,{...e,colIndex:l});if(!u)return!1;let d=n.brain.scrollTopMax,s=u.scrollLeft!==r.scrollLeft,c=u.scrollTop<=d+(e.offset||0);return!c&&!s?!1:(c&&u.scrollTop!==r.scrollTop&&(n.scrollerDOMRef.current.scrollTop=u.scrollTop),s&&(n.scrollerDOMRef.current.scrollLeft=u.scrollLeft),!0)}scrollColumnIntoView(t,e={offset:0}){let n=this.getState(),r=this.getComputed().computedVisibleColumnsMap.get(t);if(!r)return!1;let a=r.computedVisibleIndex,l=n.renderer.getScrollPositionForScrollColumnIntoView(a,e);if(!l)return!1;let u=n.brain.getScrollPosition(),d=n.brain.scrollLeftMax;return l.scrollLeft>d+(e.offset||0)?!1:(l.scrollLeft!==u.scrollLeft&&(n.scrollerDOMRef.current.scrollLeft=l.scrollLeft),!0)}};function Pc(o){return new Ta(o)}function Wy(o,t){return o<t?[o,t]:[t,o]}var _i=class{constructor(t){this.multiSelectStartIndex=0;this.getRowAt=t.getRowAt,this.isNodeSelectable=t.isNodeSelectable??(()=>!0)}set rowSelectionState(t){this._rowSelectionState=t,this._treeSelectionState=void 0}get rowSelectionState(){return this._rowSelectionState}set treeSelectionState(t){this._treeSelectionState=t}get treeSelectionState(){return this._treeSelectionState}deselectAll(){(this._treeSelectionState??this._rowSelectionState).deselectAll()}isContainerRow(t){return t.isGroupRow||!!t.isParentNode}isExpanded(t){return t.isGroupRow?!t.collapsed:!!t.nodeExpanded}getPath(t){if(t)return this._treeSelectionState?t.nodePath:this.getGroupKeys(t)}getGroupKeys(t){return t.groupKeys&&t.groupKeys.length?t.groupKeys:void 0}setSelectedAt(t,e){let n=this.getRowAt(t);if(!n||n.rowDisabled||n.selfLoaded===!1)return;let i=this._treeSelectionState;if(i){n.nodePath&&this.isNodeSelectable(n)&&i.setNodeSelection(n.nodePath,e);return}let r=this.rowSelectionState,a=this.getGroupKeys(n);if(n.isGroupRow){if(!a)return;e?r.selectGroupRow(a):r.deselectGroupRow(a);return}e?r.selectRow(n.id,a):r.deselectRow(n.id,a)}isSelectedAt(t){let e=this.getRowAt(t);if(!e)return!1;if(this._treeSelectionState)return e.nodePath?this._treeSelectionState.isNodeSelected(e.nodePath):!1;let n=this.getGroupKeys(e);return e.isGroupRow?n?this.rowSelectionState.isGroupRowSelected(n):!1:this.rowSelectionState.isRowSelected(e.id,n)}setRangeSelected(t,e,n){let[i,r]=Wy(t,e);for(let a=i;a<=r;a++){let l=this.getRowAt(a);l&&(a!==t&&this.isFollowedByItsChildren(a,l)||this.setSelectedAt(a,n))}}isFollowedByItsChildren(t,e){if(!this.isContainerRow(e)||!this.isExpanded(e))return!1;let n=this.getPath(e),i=this.getPath(this.getRowAt(t+1));return!n||!i||i.length<n.length?!1:n.every((r,a)=>r===i[a])}resetClick(t){this.deselectAll(),this.setSelectedAt(t,!0),this.multiSelectStartIndex=t,this.multiSelectEndIndex=void 0}singleAddClick(t){if(this.isSelectedAt(t))this.setSelectedAt(t,!1),this.isSelectedAt(t+1)&&(this.multiSelectStartIndex=t+1);else{this.setSelectedAt(t,!0),this.multiSelectStartIndex=t;let e;for(let n=t-1;n>=0&&this.isSelectedAt(n);n--)e=n;this.multiSelectEndIndex=e}}multiSelectClick(t){this.multiSelectEndIndex!=null&&this.setRangeSelected(this.multiSelectStartIndex,this.multiSelectEndIndex,!1),this.setRangeSelected(this.multiSelectStartIndex,t,!0),this.multiSelectEndIndex=t}};var Ei=class{constructor(t){this.multiSelectStartPosition={rowIndex:0,colIndex:0};this.getPrimaryKeyByIndex=t.getPrimaryKeyByIndex,this.getColumnIdByIndex=t.getColumnIdByIndex}getCellSelectionPosition(t){let{rowIndex:e,colIndex:n}=t,i=this.getPrimaryKeyByIndex(e),r=this.getColumnIdByIndex(n);if(!(i===void 0||!r))return[i,r]}set cellSelectionState(t){this._cellSelectionState=t}get cellSelectionState(){return this._cellSelectionState}resetClick(t){this.cellSelectionState.deselectAll();let e=this.getCellSelectionPosition(t);e&&(this.cellSelectionState.deselectAll(),this.cellSelectionState.selectCell(...e),this.multiSelectStartPosition=t,this.multiSelectEndPosition=void 0)}singleAddClick(t){let e=this.getCellSelectionPosition(t);if(e)if(this.cellSelectionState.isCellSelected(...e)){this.cellSelectionState.deselectCell(...e);let n={rowIndex:t.rowIndex+1,colIndex:t.colIndex};this.getCellSelectionPosition(n)&&(this.multiSelectStartPosition=n)}else this.cellSelectionState.selectCell(...e),this.multiSelectStartPosition=t,this.multiSelectEndPosition=void 0}multiSelectClick(t,e){!this.multiSelectStartPosition||!this.getCellSelectionPosition(t)||(this.multiSelectEndPosition&&this.deselectRange(this.multiSelectStartPosition,this.multiSelectEndPosition,e),this.selectRange(this.multiSelectStartPosition,t,e),this.multiSelectEndPosition=t)}setRangeSelected(t,e,n,i){if(i.horizontalLayout&&!ga(t,e,i)){Sc(t,e,{rowsPerPage:i.rowsPerPage,columnsPerSet:i.columnsPerSet}).forEach(s=>{let c=this.getCellSelectionPosition({rowIndex:s.rowIndex,colIndex:s.colIndex});c&&(n?this.cellSelectionState.selectCell(...c):this.cellSelectionState.deselectCell(...c))});return}let[r,a]=Di(t,e),l=this.getCellSelectionPosition(r),u=this.getCellSelectionPosition(a);if(!(!l||!u))for(let d=r.rowIndex;d<=a.rowIndex;d++)for(let s=r.colIndex;s<=a.colIndex;s++){let c=this.getCellSelectionPosition({rowIndex:d,colIndex:s});c&&(n?this.cellSelectionState.selectCell(...c):this.cellSelectionState.deselectCell(...c))}}deselectRange(t,e,n){this.setRangeSelected(t,e,!1,n)}selectRange(t,e,n){this.setRangeSelected(t,e,!0,n)}};import{defineComponent as jy,h as Ec,onBeforeUnmount as $y,onMounted as Uy}from"vue";var Dc=Ht("CSSVariableWatch"),Ac=Bt("CSSVariableWatch"),_c={position:"absolute",pointerEvents:"none",width:"0px",height:"0px",lineHeight:0,fontSize:0,overflow:"hidden"};var Co=jy({name:"CSSNumericVariableWatch",props:{varName:{type:String,required:!0},allowInts:{type:Boolean,default:!1},onChange:{type:Function,required:!0}},setup(o){let t={current:null},e=0,n=null;return Uy(()=>{let i=t.current;if(!i)return;let r=i.getBoundingClientRect().height;r!=null?(e=r,Ac(`Variable ${o.varName} found and equals ${r}.`),o.onChange(r)):Dc(`Specified variable ${o.varName} not found or does not have a numeric value.`),n=Mn(i,({height:a})=>{a!=null&&a!==e&&(e=a,o.onChange(a))})}),$y(()=>{n?.(),n=null}),()=>{let i=o.varName.startsWith("var(")?o.varName:`var(${o.varName})`;return Ec("div",{"data-name":"css-variable-watcher","data-var":o.varName,style:_c},[Ec("div",{ref:r=>{t.current=r??null},style:{height:o.allowInts?`calc(1px * ${i})`:i}})])}}});var Sa=o=>{let t=0;return(...e)=>{t&&cancelAnimationFrame(t),t=requestAnimationFrame(()=>{t=0,o(...e)})}};function Mc(o,t){Mi(o,t),Yy(o,t),t.detail===2&&qy(o,t),o.getState().onCellClick?.(o,t)}function qy(o,t){if(Cn(t.target))return;let{onCellDoubleClick:e}=o.getState(),n={preventEdit:!1};if(e){let a=e(o,t);a&&typeof a=="object"&&(n={...n,...a})}if(n.preventEdit)return;let r=o.getComputed().computedVisibleColumns[o.colIndex];o.api.startEdit({rowIndex:o.rowIndex,columnId:r.id})}function Yy(o,t){let{getDataSourceState:e,getState:n,getComputed:i,rowIndex:r,colIndex:a,dataSourceActions:l}=o,u=e(),{selectionMode:d,cellSelection:s}=u;if(!s||d!=="multi-cell")return;let{multiCellSelector:c,computedVisibleColumns:f}=i(),{brain:m,debugId:p}=n(),{rowsPerPage:h}=m,y=f.length,C=new Ke(s);C.debugId=p??"",c.cellSelectionState=C;let b={rowIndex:r,colIndex:a};if(t.metaKey||t.ctrlKey)c.singleAddClick(b);else if(t.shiftKey){let w=!!n().wrapRowsHorizontally;c.multiSelectClick(b,w?{horizontalLayout:w,rowsPerPage:h,columnsPerSet:y}:{horizontalLayout:w})}else c.resetClick(b);l.cellSelection=C}function Zy(o){return o.getState().multiRowSelectionWith!=="click"&&o.getComputed().renderSelectionCheckBox?"checkbox":"click"}function Xy(o){return o?Cn(o)?!0:typeof o.closest!="function"?!1:!!o.closest(`.${vn}, [data-name="expand-collapse-icon"]`):!1}function Mi(o,t,e=t.key?"keyboard":"click"){let{rowIndex:n,getDataSourceState:i,getComputed:r,dataSourceActions:a,dataSourceApi:l,api:u,cloneRowSelection:d,cloneTreeSelection:s}=o,{multiRowSelector:c}=r(),f=i(),{selectionMode:m,dataArray:p,isTree:h}=f;if(e==="click"&&Xy(t.target))return!1;let y=p[n];if(!y||y.rowDisabled)return!1;if(h){if(!y.isTreeNode||!y.nodePath)return!1;let{isNodeSelectable:C}=f;if(C&&!C(y))return!1}if(m==="multi-row"){let C=Zy(o);if(e==="click"&&C==="checkbox")return!1;let b=e==="checkbox"||e==="keyboard"&&C==="checkbox",w=()=>{t.shiftKey?c.multiSelectClick(n):b||t.metaKey||t.ctrlKey?c.singleAddClick(n):c.resetClick(n)};if(h){let{treeSelectionState:T}=f;if(!(T instanceof $e))return!1;let I=s(T);c.treeSelectionState=I,w(),c.treeSelectionState=void 0;let x=!t.shiftKey&&(b||t.metaKey||t.ctrlKey);return f.lastSelectionUpdatedNodePathRef&&(f.lastSelectionUpdatedNodePathRef.current=x?{nodePath:y.nodePath,selected:!!I.isNodeSelected(y.nodePath)}:null),a.treeSelection=I,!0}let{rowSelection:S}=f;return!S||typeof S!="object"?!1:(S=d(S),c.rowSelectionState=S,w(),a.rowSelection=S,!0)}else if(m==="single-row"){if(y.isGroupRow)return!1;let C=t.metaKey||t.ctrlKey||e!=="click";if(h){let{treeApi:w}=l;return C?w.toggleNodeSelection(y.nodePath):w.selectNode(y.nodePath),!0}let b=y.id;return C?u.rowSelectionApi.toggleRowSelection(b):u.rowSelectionApi.selectRow(b),!0}return!1}function Fc(o,t){let{getComputed:e,dataSourceActions:n,dataSourceApi:i}=o,r=e().multiRowSelector,a=r.lastPointerDown;r.lastPointerDown=void 0;let l=o.getDataSourceState;return Mi({rowIndex:t,api:o,getComputed:e,getState:o.getState,getDataSourceState:l,dataSourceActions:n,dataSourceApi:i,cloneRowSelection:u=>mn(u,l),cloneTreeSelection:u=>Dn(u,l)},{key:"",metaKey:!1,ctrlKey:!1,shiftKey:a?.rowIndex===t&&a.shiftKey,preventDefault:()=>{}},"checkbox")}function Nc(o,t){o.getComputed().multiRowSelector.lastPointerDown={rowIndex:o.rowIndex,shiftKey:!!t.shiftKey},t.detail!==2&&void 0}var Jy={Enter:!0," ":!0,a:!0};function Oc(o,t){let{getState:e,getDataSourceState:n,dataSourceActions:i,cloneRowSelection:r,cloneTreeSelection:a}=o,{key:l,ctrlKey:u,metaKey:d}=t;if(!Jy[l])return!1;let s=e(),c=n(),{activeRowIndex:f,activeCellIndex:m,keyboardNavigation:p,keyboardSelection:h}=s,{selectionMode:y,rowSelection:C,treeSelectionState:b,isTree:w}=c;if(h===!1)return!1;let S=p==="row"&&f!=null?f:p==="cell"&&m!=null?m[0]:null;if(!(S!=null?c.dataArray[S]:null)||S==null)return!1;if(l===" "&&(y==="single-row"||y==="multi-row")){let I={key:t.key,metaKey:t.metaKey,ctrlKey:t.ctrlKey,shiftKey:t.shiftKey,preventDefault:()=>t.preventDefault()};return Mi({...o,rowIndex:S},I,"keyboard")}if(y!=="multi-row")return!1;if(l==="a"&&(u||d)){if(w&&b){let x=a(b);return x.selectAll(),i.treeSelection=x,!0}let I=r(C);return I.selectAll(),i.rowSelection=I,!0}return!1}var kc=["input","textarea","select","[tabindex]","a[href]","button","object"].join(", "),Lc=o=>Array.from(o.querySelectorAll(kc)).filter(e=>!!e.offsetParent),wa=o=>o.querySelector(kc);var Vc=Gn(wn());async function zc(o,t=10,e=300){return new Promise((n,i)=>{let r=Date.now();function a(){if(Date.now()-r>e)return i(!1);if(!o()){setTimeout(a,t);return}n(!0)}a()})}var Qy=10,eb=(o,t)=>o-t;function va(o,t){let{getComputed:e,getDataSourceState:n,getState:i,api:r,dataSourceApi:a}=t,{editingCell:l,isRowDetailEnabled:u}=i(),{dataArray:d}=n(),{computedVisibleColumns:s,computedColumnsMap:c}=e(),f=s[o.colIndex];if(!f)return!1;if(l&&l.columnId===f.id&&l.rowIndex===o.rowIndex)return!0;if(!f.contentFocusable)return!1;if(f.contentFocusable===!0)return!0;let m=d[o.rowIndex],p=!u||typeof u=="function"&&!u(m)?!1:r.rowDetailApi.isRowDetailExpanded(m.id)?"expanded":"collapsed",h=Je(f.id,t);return f.contentFocusable({column:f,...kn({column:f,rowInfo:m,columnsMap:c,context:t,rowDetailState:p}).formattedValueContext,columnApi:h,api:r,dataSourceApi:a})}function Gc(o,t,e){let n=e.getState().editingCell;return tb(o,t,e,{isCellFocusable:va,isColumnElligible:r=>n&&n.columnId===r.id?!0:!!r.contentFocusable})}function Kc(o,t,e){let n=(0,Vc.default)(e,o+t,eb);return n<0&&(n=~n,t>0&&n>=e.length||t<0&&n===0)?null:e[n]??null}globalThis.getNextCol=Kc;function tb(o,t,e,n){let{isColumnElligible:i,isCellFocusable:r}=n,a=e.getComputed().computedVisibleColumns.filter(i).reduce((c,f)=>(c.push(f.computedVisibleIndex),c),[]);if(!a.length)return null;let{getDataSourceState:l}=e,{dataArray:u}=l(),d=o.rowIndex,s=o.colIndex;for(;d!=null||s!=null;){if(s=s===null?a[t===-1?a.length-1:0]:Kc(s,t,a),s===null){if(d+=t,d<0||d>=u.length)return null;continue}if(r({colIndex:s,rowIndex:d},e))return{colIndex:s,rowIndex:d}}return null}async function Bc([o,t],e){let{api:n}=e;return new Promise((i,r)=>{let a=Qy,l=null,u=!1;function d(s=0){s++,Qt(l),l=ke(async()=>{if(u=n.scrollCellIntoView(o,t,{offset:30}),!u&&s<a&&d(s),u){try{await zc(()=>!!e.getState().getDOMNodeForCell({rowIndex:o,colIndex:t}))}catch(c){r(c);return}i(!0)}})}d()})}var nb=`.${mt}`;function Hc(o,t){if(t.key!=="Tab")return!1;let e=t.shiftKey?-1:1,n=t.target,i=o.getState().scrollerDOMRef.current,r=document.activeElement===i||n===i;if(!i||r&&e===-1)return!1;let a=r?null:Tn(n,nb),l=null,u=null;if(a)l=Number(a.getAttribute("data-row-index")),u=Number(a.getAttribute("data-col-index"));else if(r){let{activeCellIndex:s}=o.getState();[l,u]=s||[0,0]}if(l==null||u==null||isNaN(l)||isNaN(u))return!1;let d=r&&va({colIndex:u,rowIndex:l},o)?{rowIndex:l,colIndex:u}:Gc({rowIndex:l,colIndex:u},e,o);if(!d){if(e===-1)i.focus();else{let s=Lc(document.body),c=o.getState().focusDetectDOMRef.current,f=s.findIndex(p=>p===c);s[f+1]?.focus()}return!0}return Bc([d.rowIndex,d.colIndex],o).then(()=>{let s=o.getState().getDOMNodeForCell(d);if(!s)return;wa(s)?.focus()}),!0}var Wc={control:"ctrl"},jc={"control|cmd":"ctrl","cmd|control":"ctrl","ctrl|cmd":"ctrl","cmd|ctrl":"ctrl"},ob={esc:"escape"},Uc={cmd:o=>o.metaKey,alt:o=>o.altKey,ctrl:o=>o.ctrlKey,shift:o=>o.shiftKey},qc=Object.keys(Uc),Ra=new Set(qc),ib=new Set(["shift","alt"]);function Yc(o,t){return Array.isArray(t)?t.some(e=>$c(o,e)):$c(o,t)}function $c(o,t){let e=o.key.toLowerCase(),n=t.split("+").map(f=>f.toLowerCase().trim()),i=n.find(f=>jc[f]),r=n.map(f=>Wc[f]||jc[f]||ob[f]||f),a=r.filter(f=>Ra.has(f)),l=r.filter(f=>!Ra.has(f)),u=qc.reduce((f,m)=>(f[m]=Uc[m](o),f),{});i&&u.cmd&&(u.cmd=!1,u.ctrl=!0);let d=Object.keys(u).filter(f=>u[f]);if(!a.every(f=>u[f]===!0))return!1;if(l.includes("*")){if(d.length<a.length||d.filter(m=>!ib.has(m)).length)return!1}else if(a.length!=d.length)return!1;return!l.length||Ra.has(e)||e==="meta"||Wc[e]?!1:l.reduce((f,m)=>f?m==="*"||e===m:!1,!0)}async function Zc(o,t){let e={...o,cloneRowSelection:a=>mn(a,o.getDataSourceState),cloneTreeSelection:a=>Dn(a,o.getDataSourceState)},{onKeyDown:n}=o.getState(),i={preventEdit:!1,preventEditStop:!1,preventDefaultForTabKeyWhenEditing:!0,preventSelection:!1,preventNavigation:!1};if(n){let a=n(o,t);a&&typeof a=="object"&&(i={...i,...a})}if(!i.preventSelection&&Oc(e,t)&&t.preventDefault(),(Hc(e,t)||!o.getState().focusedWithin&&!i.preventNavigation&&Rc(e,t))&&t.preventDefault(),!i.preventEdit&&t.key==="Enter"&&!o.api.isEditInProgress()){let{activeCellIndex:a}=o.getState();if(a){let[l,u]=a,d=o.getComputed().computedVisibleColumns[u];d.computedEditable&&o.api.startEdit({rowIndex:l,columnId:d.id})}}o.api.isEditInProgress()&&(t.key==="Escape"&&!i.preventEditStop&&o.api.stopEdit({cancel:!0}),t.key==="Tab"&&i.preventDefaultForTabKeyWhenEditing&&t.preventDefault());let{keyboardShortcuts:r}=o.getState();if(r)for await(let a of r){if(!Yc(t,a.key)||a.when&&!await a.when(o))continue;let l=await a.handler(o,t);if(l&&l.stopNext)break}}import{onBeforeUnmount as Ab,watch as _b}from"vue";import{Teleport as ab,cloneVNode as lb,defineComponent as rf,h as Ni,isVNode as af,nextTick as sb,onBeforeUnmount as ub,onMounted as db,shallowRef as of,triggerRef as cb,watch as fb}from"vue";var Fi="__is_infinite_menu_component";function Ia(o){return!!o.tagName}function Qc(o){let{alignTarget:t,alignAnchor:e,constrainTo:n,alignPosition:i}=o,r=Ae.from(Ia(t)?t.getBoundingClientRect():t),a=Ae.from(Ia(e)?e.getBoundingClientRect():e),l=n?Ae.from(Ia(n)?n.getBoundingClientRect():n):null;if(!l)return{...Xc({anchorRect:a,targetRect:r,position:i[0]}),index:0};let u=null;for(let d=0,s=i.length;d<s;d++){let c=Xc({anchorRect:a,targetRect:r,position:i[d],constrainRect:l});if(d===0&&(u={...c,index:0}),c.valid)return{...c,index:d}}return u}function Xc(o){let t=Ae.from(o.targetRect),e=Ae.from(o.anchorRect),n=o.constrainRect?Ae.from(o.constrainRect):null,{position:i}=o,[r,a]=i,l=Jc(t,r),u=Jc(e,a),d=l.getDistanceToPoint(u);t.shift(d);let s=n?n.contains(t):!0;return{alignPosition:i,alignedRect:t,valid:s,distance:d}}function Jc(o,t){return t==="TopLeft"?je.from({top:o.top,left:o.left}):t==="TopCenter"?je.from({top:o.top,left:o.left+(o.width>0?Math.round(o.width/2):0)}):t==="TopRight"?je.from({top:o.top,left:o.left+o.width}):t==="BottomLeft"?je.from({left:o.left,top:o.top+o.height}):t==="BottomCenter"?je.from({left:o.left+(o.width>0?Math.round(o.width/2):0),top:o.top+o.height}):t==="BottomRight"?je.from({left:o.left+o.width,top:o.top+o.height}):t==="CenterLeft"?je.from({left:o.left,top:o.top+(o.height>0?Math.round(o.height/2):0)}):t==="CenterRight"?je.from({left:o.left+o.width,top:o.top+(o.height>0?Math.round(o.height/2):0)}):je.from({left:o.left+(o.width>0?Math.round(o.width/2):0),top:o.top+(o.height>0?Math.round(o.height/2):0)})}function rb(o){return o&&typeof o.then=="function"||o instanceof Promise}function tf(o){return o==null||typeof o=="string"?!1:typeof o.tagName=="string"}async function ef(o){return typeof o=="function"&&(o=o()),rb(o)&&(o=await o),typeof o=="string"&&(o=document.querySelector(o)),o&&tf(o)&&(o=o.getBoundingClientRect()),o?Ae.from(o):null}async function nf(o){let t=null;typeof o=="function"?t=o():t=o;function e(n){let i=null;return typeof n=="string"&&(i=document.querySelector(n)),tf(n)&&(i=n),i||null}return e(await t)}async function xa(o,t){let{constrainTo:e,alignTo:n,alignPosition:i}=t;Object.keys(n).length===2&&n.top!==void 0&&n.left!==void 0&&(n={...n,width:0,height:0}),typeof e=="boolean"&&(e=e?document.documentElement.getBoundingClientRect():void 0);let r=e&&await ef(e)||void 0,a=n?await ef(n):void 0,l=Ae.from(o.getBoundingClientRect());if(!a)return;let{alignedRect:u}=Qc({constrainTo:r,alignAnchor:a,alignTarget:l,alignPosition:i});o.style.transform=`translate3d(${u.left}px,${u.top}px, 0px)`;let d=o.getBoundingClientRect();if(d.left!==u.left||d.top!==u.top){let s=o.offsetParent;if(s){let c=s.getBoundingClientRect(),f=c.left,m=c.top,p=u.left-f,h=u.top-m;o.style.transform=`translate3d(${p}px,${h}px, 0px)`}}}var pb=rf({name:"OverlayContent",props:{handle:{type:Object,required:!0}},setup(o){let t=null,e=r=>{r&&r!==t&&xa(r,o.handle),t=r??null},n=null,i=r=>{n?.(),n=r.realign.onChange(a=>{t&&a&&xa(t,a)})};return db(()=>i(o.handle)),fb(()=>o.handle,i),ub(()=>{n?.()}),()=>Ni("div",{style:{position:"absolute",top:"0px",left:"0px"},ref:e},[o.handle.children()])}});function mb(o){return af(o)?o.props?.id||o.key:null}function hb(o,t,e){if(af(o)&&o.type?.[Fi]){let n={};return o.props?.portalContainer===void 0&&(n.portalContainer=t),o.props?.constrainTo===void 0&&(n.constrainTo=e),lb(o,n)}return o}function At(o){let t=o,e=new Map,n=of(e),i=()=>cb(n),r=(d,s)=>{let f=`${s.id||mb(d)||It()}`,m=e.get(f),p=C=>()=>{let b=typeof C=="function"?C():C;return hb(b,t.portalContainer,s.constrainTo??t.constrainTo)},h=p(d),y=(C,b)=>{if(!m)return;let w=p(C);Object.assign(m,{children:w}),i(),!!b?.skipRealign||sb(()=>{m&&e.get(m.key)===m&&m.realign(m)})};return m?(Object.assign(m,s),y(d),y):(m={key:f,children:h,alignPosition:s.alignPosition,alignTo:s.alignTo,constrainTo:s.constrainTo,realign:pe()},e.set(m.key,m),i(),y)},a=d=>{d=`${d}`,e.has(d)&&(e.delete(d),i())},l=()=>{e.clear(),i()};return{portal:rf({name:"OverlayPortal",setup(){let d=of(null),{portalContainer:s}=t;return s&&(async()=>{let c=await nf(s);c!=null&&(d.value=c)})(),()=>{let c=[];for(let[f,m]of n.value)c.push(Ni(pb,{handle:m,key:m.key}));return s?d.value?Ni(ab,{to:d.value},c):null:s===null||s===!1?c:Ni("div",{style:{position:"fixed",top:"0px",left:"0px"}},c)}}}),hideOverlay:a,clearAll:l,rerenderOverlays:i,showOverlay:r}}import{h as Db}from"vue";import{defineComponent as bf,h as dt,onBeforeUnmount as wb,ref as vb,watch as Rb}from"vue";var lf="db3arf0 _16lm1iw0 _16lm1iw1 _16lm1iw1w _16lm1iw2f _16lm1iw8",sf=we({defaultClassName:"db3arf2 _16lm1iw1p _16lm1iw2j _16lm1iw1x",variantClassNames:{disabled:{true:"db3arf3 _16lm1iwl _16lm1iw1x",false:"_16lm1iwk"},active:{true:"db3arf5",false:"db3arf6"},pressed:{false:"db3arf7",true:"db3arf8"},keyboardActive:{true:"db3arf9",false:"db3arfa"}},defaultVariants:{},compoundVariants:[[{active:!0,disabled:!1},"db3arfb"],[{pressed:!0,active:!0,disabled:!1},"db3arfc"]]}),uf="db3arf1",df="db3arfd";var cf="submenu",gb="-";function ff(){return{keyboardActiveItemKey:null,activeItemKey:null,generatedId:It(),focused:!1,destroyed:!1,domRef:{current:null}}}function pf(){return{parentMenuId:1,parentMenuItemKey:1,onHideIntent:1,constrainTo:1,onAction:1,onShow:1,onHide:1,autoFocus:1,wrapLabels:1}}var yb=({columns:o,keyboardActiveItemKey:t,activeItemKey:e,menuId:n},i,r)=>{let a=i&&(i.key!=null||i.label!=null)?i:null,l=a===null?i===gb?r.renderSeparator():i:null;return a!=null?{type:"item",parentMenuId:n,disabled:!!a.disabled,keyboardActive:a.key===t,active:a.key===e,value:a,span:a.span||1,key:a.key,menu:a.menu||null,style:a.style,className:a.className,originalMenuItem:a}:{type:"decoration",value:l,span:o.length,style:{gridColumnStart:1,gridColumnEnd:o.length+10}}},bb=[{name:"label"}],mf=(o,t)=>{let{props:e,state:n}=o,{activeItemKey:i,keyboardActiveItemKey:r}=n,{items:a,children:l,addSubmenuColumnIfNeeded:u,parentMenuId:d}=e,s=e.id||n.generatedId;d&&(s=`${d}-${s}`);let c=[...e.columns||bb],f={columns:c,keyboardActiveItemKey:r??null,activeItemKey:i??null,menuId:s},m=[];a?m=a.map(h=>yb(f,h,t)):!a&&typeof l!="function"&&(m=t.childrenToRuntimeItems?t.childrenToRuntimeItems(f,l):[]),u&&m.filter(y=>y.type==="item"&&y.menu!=null).length>0&&!c.find(y=>y.name==cf)&&c.push({name:cf,render:t.renderSubmenuColumn});let p=m.filter(h=>h.type==="item"&&!h.disabled);return{runtimeItems:m,runtimeSelectableItems:p,columns:c,menuId:s}};function hf(o,t){let e=gf(o,t);if(!e.length)return null;let n=Ae.from(e[0]?.getBoundingClientRect()),i=Ae.from(e[e.length-1].getBoundingClientRect()),r=n;return r.width=i.left+i.width-n.left,r}function gf(o,t){let e=Tn(document.querySelector(`[data-menu-id="${o}"] [data-menu-item-key="${t}"]`),`[data-menu-id="${o}"]`);if(!e)return[];let n=e.querySelectorAll(`[data-menu-item-key="${t}"]`);return Array.from(n)}function yf(o,t){let e=gf(o,t);if(!e.length)return null;for(let n of e){let i=n.querySelector('input[type="checkbox"]');if(i)return i}return null}var To=class extends bn{constructor(t){super(t.slice(0,3))}};var Cb=250;function Tb(o,t=100){let e=Date.now();return new Promise(n=>{let i,r=()=>{if(i=o(),i!==void 0){n(i);return}if(Date.now()-e>t){n(void 0);return}ke(r)};ke(()=>{r()})})}var Sb=Fe(),Oi=class{constructor(t){this.activeItem=null;this.currentHoveredItem=null;this.activeItemLeavePoint=null;this.menuLeaveTimeoutId=null;this.activeItemMenuRect=null;this.lastPointerMoveTimestamp=0;this.mouseMoveTimeoutId=0;this.lastHorizontalDiff=0;this.getTimeout=()=>this.params.timeout||Cb;this.getPointerMoveTarget=()=>document.documentElement||Sb;this.removePointerMoveListener=()=>{this.getPointerMoveTarget().removeEventListener("pointermove",this.onPointerMoveWhileActiveItem)};this.onPointerMoveWhileActiveItem=t=>{if(clearTimeout(this.mouseMoveTimeoutId),!t){this.lastPointerMoveTimestamp=Date.now();return}if(!this.currentHoveredItem||this.currentHoveredItem===this.activeItem)return;let e=Date.now();this.lastPointerMoveTimestamp||(this.lastPointerMoveTimestamp=e);let i=e-this.lastPointerMoveTimestamp>this.getTimeout();this.lastPointerMoveTimestamp=e;let r=()=>{this.setActiveItem(null,null),this.onItemChange(!0,this.currentHoveredItem,t)};if(i){r();return}let a=this.currentHoveredItem;this.mouseMoveTimeoutId=setTimeout(()=>{if(a!==this.currentHoveredItem)return;Date.now()-this.lastPointerMoveTimestamp>this.getTimeout()&&r()},this.getTimeout());let l=new je({left:t.clientX,top:t.clientY});if(!this.activeItemMenuRect||!this.activeItemLeavePoint)return;let u=this.activeItemLeavePoint.left<this.activeItemMenuRect.left,s=(u?1:-1)*(l.left-this.activeItemLeavePoint.left);if(s-this.lastHorizontalDiff<0){this.lastHorizontalDiff=0,r();return}this.lastHorizontalDiff=s,(u?new To([this.activeItemLeavePoint,this.activeItemMenuRect.getTopLeft(),this.activeItemMenuRect.getBottomLeft()]):new To([this.activeItemLeavePoint,this.activeItemMenuRect.getTopRight(),this.activeItemMenuRect.getBottomRight()])).containsPoint(l)||(this.setActiveItem(null,null),this.onItemChange(!0,this.currentHoveredItem,t))};this.setupMenuLeaveTracking=()=>{this.menuLeaveTimeoutId=setTimeout(()=>{this.activeItem&&this.params.itemHasSubMenu(this.activeItem)||this.setActiveItem(null,null)},this.getTimeout())};this.setActiveItem=(t,e)=>{if(t!==this.activeItem){if(t==null){this.removePointerMoveListener(),this.params.onItemActivate(null,null),this.activeItem=null,this.activeItemMenuRect=null;return}this.activeItem=t,this.params.onItemActivate(t,e),this.activeItemMenuRect=null,Tb(()=>this.activeItem!=t?!1:this.params.getMenuRectFor(t)).then(n=>{this.activeItem==t&&n&&(this.activeItemMenuRect=n)})}};this.onItemChange=(t,e,n)=>{if(clearTimeout(this.menuLeaveTimeoutId),clearTimeout(this.mouseMoveTimeoutId),!t){this.removePointerMoveListener(),e===this.activeItem&&(this.activeItemLeavePoint=new je({left:n.clientX,top:n.clientY})),this.setupMenuLeaveTracking();return}if(this.currentHoveredItem=e,!this.activeItem||!this.params.itemHasSubMenu(this.activeItem)){this.setActiveItem(e,n.target);return}this.onPointerMoveWhileActiveItem(),this.getPointerMoveTarget().addEventListener("pointermove",this.onPointerMoveWhileActiveItem)};this.getHandlers=()=>({onItemEnter:(t,e)=>{this.onItemChange(!0,t,e)},onItemLeave:(t,e)=>{this.onItemChange(!1,t,e)}});this.params=t}};var Ib={renderSeparator:()=>dt("hr",{class:df}),renderSubmenuColumn:(({domProps:o,item:t})=>t.menu?dt("div",o,[dt(dn,{expanded:!1})]):dt("div",o))},{useManagedComponent:xb}=pn({initSetupState:ff,forwardProps:()=>pf(),mapPropsToState:o=>mf(o,Ib),debugName:"Menu"}),Pb=bf({name:"MenuRuntimeItem",props:{columns:{type:Array,required:!0},item:{type:Object,required:!0},index:{type:Number,required:!0},active:{type:Boolean,required:!0},keyboardActive:{type:Boolean,required:!0},onItemEnter:{type:Function,required:!1},onItemLeave:{type:Function,required:!1},onItemClick:{type:Function,required:!0}},setup(o){let t=vb(!1);return()=>{let{columns:e,item:n,index:i,active:r,keyboardActive:a}=o,l=n.type==="item"?n.value.key:i,u=null;if(n.type==="decoration")u=dt("div",{style:n.style},[n.value]);else{let d=0;u=e.map((s,c)=>{let f=n.value,m=s.field||s.name,p=c+1,h=p+n.span;if(p<d)return null;d=h;let C={style:{...s.style,...n.style,gridColumnStart:p,gridColumnEnd:h},"data-menu-column-id":`${n.parentMenuId}-col-${s.name}`,"data-menu-col-name":`${s.name}`,"data-menu-row-id":`${n.parentMenuId}-row-${i}`,"data-menu-row-index":`${i}`,"data-menu-item-key":`${n.key}`,class:te(sf({active:r,disabled:!!n.disabled,keyboardActive:a,pressed:t.value||r}),n.className),onPointerenter:b=>{n.disabled||o.onItemEnter?.(n,b)},onPointerleave:b=>{n.disabled||o.onItemLeave?.(n,b)},onMousedown:()=>{n.disabled||(t.value=!0)},onMouseup:()=>{n.disabled||(t.value=!1)},onClick:b=>{n.disabled||o.onItemClick(b,n)}};return s.render?s.render({item:f,column:s,value:f[m],domProps:C}):dt("div",{key:`${l}-${m}`,...C},[f[m]])}).filter(Boolean)}return dt("div",{class:uf},[u])}}}),_t=bf({name:"InfiniteMenu",inheritAttrs:!1,props:{id:{type:String,required:!1},items:{type:Array,required:!1},columns:{type:Array,required:!1,default:void 0},portalContainer:{type:[String,Object,Function,Boolean],required:!1,default:void 0},constrainTo:{type:[String,Object,Function,Boolean],required:!1,default:void 0},wrapLabels:{type:Boolean,required:!1,default:!1},autoFocus:{type:Boolean,required:!1,default:void 0},addSubmenuColumnIfNeeded:{type:Boolean,required:!1,default:!0},bubbleActionsFromSubmenus:{type:Boolean,required:!1,default:!0},parentMenuId:{type:String,required:!1},parentMenuItemKey:{type:String,required:!1},onShow:{type:Function,required:!1},onHide:{type:Function,required:!1},onHideIntent:{type:Function,required:!1},onAction:{type:Function,required:!1}},setup(o,{attrs:t}){let{contextValue:e}=xb(o),n=e.state,i=e.componentActions,r=()=>n.value,a=A=>{i.keyboardActiveItemKey=A},l=A=>{i.activeItemKey=A},u=!1,d=()=>u,s=null,c=A=>{s=A},{showOverlay:f,portal:m,clearAll:p}=At({portalContainer:!1}),h=()=>{let A=r();A.onHideIntent?.(A)},y=()=>{i.focused=!0,setTimeout(()=>{let A=r().domRef.current;b&&A&&A===document.activeElement&&r().keyboardActiveItemKey==null&&a(r().runtimeSelectableItems[0]?.key??null)})},C=()=>{i.focused=!1},b=!0,w={hideMenu:h,focus:()=>{let A=r().domRef.current;A&&(A.focus(),setTimeout(()=>{let E=r().domRef.current;E&&E!==document.activeElement&&E.focus()},10),y())},getMenuId:()=>r().menuId,getParentMenuId:()=>r().parentMenuId},S=(A,E)=>{a(E.key),l(E.key),E.originalMenuItem.onClick&&E.originalMenuItem.onClick(A);let P={key:E.key,item:E.originalMenuItem,hideMenu:h};E.originalMenuItem.onAction&&E.originalMenuItem.onAction(P);let{onAction:D}=r();D&&D(P),E.originalMenuItem.hideMenuOnAction&&h()},{onItemEnter:T,onItemLeave:I}=new Oi({parentMenuId:r().parentMenuId,onItemActivate:A=>{d()&&l(A)},itemHasSubMenu:A=>!!r().runtimeItems.filter(P=>P.type==="item"&&P.key===A&&P.menu)[0],getMenuRectFor:A=>{let E=`[data-submenu-for="${A}"]`,P=document.querySelector(E);if(P)return Ae.from(P.getBoundingClientRect())}}).getHandlers(),x=A=>{let E=r().menuId,P=`${E}-submenu`,D=A.menu;return D?(typeof D=="function"&&(D=D()),dt(_t,{key:P,parentMenuItemKey:A.key,parentMenuId:E,constrainTo:r().constrainTo,...D,autoFocus:!1,onShow:(M,_)=>{D?.onShow?.(M,_),c(_)},onHideIntent:M=>{D?.onHideIntent?.(M),h()},onHide:M=>{M.focused&&(l(null),a(A.key),w.focus())}})):null};Rb(()=>n.value.activeItemKey,A=>{let{runtimeItems:E,menuId:P,constrainTo:D}=r(),M=E.filter(O=>O.type==="item"&&A===O.key)[0];if(!M||!M.menu){c(null),p();return}let _=hf(P,M.key);_&&f(()=>x(M),{id:`${P}-submenu`,alignTo:_,alignPosition:[["TopLeft","TopRight"],["TopRight","TopLeft"]],constrainTo:D})},{flush:"post"});function F(A){let{runtimeItems:E,runtimeSelectableItems:P,keyboardActiveItemKey:D}=r(),M=E.findIndex(B=>B.type==="item"&&B.key===D),_=D,O=E[M],z={ArrowUp:()=>{let B=E.slice(0,M).filter(G=>G.type==="item"&&!G.disabled).pop();B&&B.type==="item"&&B.key&&(_=B.key)},ArrowDown:()=>{let B=E.slice(M+1).filter(G=>G.type==="item"&&!G.disabled)[0];B&&B.type==="item"&&B.key&&(_=B.key)},Home:()=>{z.PageUp()},End:()=>{z.PageDown()},PageUp:()=>{_=P[0].key},PageDown:()=>{_=P[P.length-1].key},ArrowLeft:()=>{l(null),r().parentMenuId&&(i.destroyed=!0)},ArrowRight:()=>{O&&(l(O.key),ke(()=>{d()&&s&&s.getParentMenuId()===r().menuId&&s.focus()}))},Enter:()=>{if(O)if(O.originalMenuItem?.menu){if(s){z.ArrowLeft();return}l(O.key)}else S(A,O)}," ":()=>{if(!O)return;O.originalMenuItem.menu||S(A,O);let B=yf(r().menuId,O.key);B&&B.click()},Escape:()=>{z.ArrowLeft();let B=r();B.parentMenuId||B.onHideIntent?.(B)}},K=z[A.key];K&&(K(),A.preventDefault()),_!=D&&a(_)}let N=!1,R=A=>{let E=A??null;E&&!N?(N=!0,r().domRef.current=E,u=!0,r().onShow?.(r(),w),r().autoFocus&&w.focus()):!E&&N?(N=!1,r().onHide?.(r()),r().domRef.current=null):E&&(r().domRef.current=E)};return wb(()=>{u=!1,N&&(N=!1,r().onHide?.(r())),r().domRef.current=null}),()=>{let A=r(),{columns:E,runtimeItems:P,menuId:D,activeItemKey:M,keyboardActiveItemKey:_,destroyed:O,wrapLabels:z,parentMenuItemKey:K}=A;if(O)return null;let B=P.map((Z,De)=>dt(Pb,{key:Z.type==="item"?Z.key:De,columns:E,item:Z,index:De,active:Z.type==="item"&&Z.key===M,keyboardActive:Z.type==="item"&&Z.key===_,onItemEnter:(me,ve)=>T(me.key,ve),onItemLeave:(me,ve)=>I(me.key,ve),onItemClick:S})),G=E.map(Z=>Z.width||(typeof Z.flex=="number"?`${Z.flex}fr`:Z.flex)||"auto").join(" "),le={...t.style,gridTemplateColumns:G,gridTemplateRows:P.map(()=>"auto").join(" ")};return z||(le.whiteSpace="nowrap"),dt("div",{class:Eo.contents},[dt("div",{...t,"data-menu-id":D,"data-submenu-for":K,tabindex:0,ref:R,onKeydown:F,onMousedown:()=>{b=!1},onMouseup:()=>{b=!0},onFocus:y,onBlur:C,class:te(lf,t.class,"InfiniteMenu"),style:le},B),dt(m)])}}});_t[Fi]=!0;import{h as Cf}from"vue";function Tf(o,t){let{columnApi:e,column:n,getComputed:i,api:r,dataSourceApi:a,getState:l}=t,u=l().components?.CheckBox||qt,s=e.isSortable()?[{key:"sort-asc",label:"Sort Ascending",disabled:n.computedSortedAsc,onAction:()=>{r.setSortingForColumn(n.id,1)}},{key:"sort-desc",label:"Sort Descending",disabled:n.computedSortedDesc,onAction:()=>{r.setSortingForColumn(n.id,-1)}},{key:"sort-none",label:"Unsort",disabled:!n.computedSorted,onAction:()=>{r.setSortingForColumn(n.id,null)}},"-"]:[];return[...n.groupByForColumn?[{key:"collapse-all",label:"Collapse All",onAction:()=>{r.collapseAllGroupRows()}},"-"]:[],...s,n.computedFilterable?{key:"clear-filter",label:"Clear Filter",disabled:!n.computedFiltered,onAction:()=>{r.clearColumnFilter(n.id)}}:null,n.computedFilterable?"-":null,{key:"pin-start",label:"Pin to start",disabled:n.computedPinned==="start",onAction:()=>{r.setPinningForColumn(n.id,"start")}},{key:"unpin",label:"Unpin",disabled:!n.computedPinned,onAction:()=>{r.setPinningForColumn(n.id,!1)}},"-",{key:"columns",label:"Columns",menu:()=>{let f=[];return i().computedColumnsMapInInitialOrder.forEach((p,h)=>{let y=Jn(p,t,"column-menu");f.push({key:h,label:y,check:Cf(u,{key:p.id,disabled:p.computedVisible&&r.getVisibleColumnsCount()===1,checked:p.computedVisible,onChange:C=>{let b=!!C;r.setVisibilityForColumn(p.id,b),requestAnimationFrame(()=>{r.realignColumnContextMenu()})}})})}),{columns:[{name:"check"},{name:"label"}],items:f}}},"-",{key:"group-by",label:"Group by",menu:()=>{let f=[];return i().computedColumnsMapInInitialOrder.forEach((p,h)=>{if(p.groupByForColumn)return;let y=Jn(p,t,"column-menu");f.push({key:h,label:y,check:Cf(u,{key:p.id,disabled:!p.computedGroupable,checked:p.computedGroupedBy,onChange:()=>{a.toggleGroupByField(p.field)}})})}),{columns:[{name:"check"},{name:"label"}],items:f}}}].filter(f=>!!f)}function Sf(o,t,e){if(o==null)return null;let{getComputed:n,getState:i}=t,{components:r,getColumnMenuItems:a}=i(),l=r?.Menu??_t,u=n().computedColumnsMap.get(o);if(!u)return null;let d={column:u,columnApi:Je(u.id,t),...t},s=Tf([],d),c=a?a(s,d):s,f=p=>{p.__insideMenu=!0},m=p=>{p.domRef.current?.parentNode?.removeEventListener("mousedown",f)};return!c||!c.length?null:Db(l,{autoFocus:!0,items:c,onShow:p=>{p.domRef.current?.parentNode?.addEventListener("mousedown",f)},onHide:m,onHideIntent:p=>{m(p),e?.()}})}function Eb(o){let{columnId:t,context:e,clearAll:n,showOverlay:i}=o,{getState:r,actions:a}=e,{columnMenuTargetRef:l,domRef:u}=r();function d(){n(),a.columnMenuVisibleForColumnId=null}let s=o.target;if(s||(s=l.current??void 0,s&&!u.current.contains(s)&&(s=void 0)),!s){let c=`[data-column-id="${t}"] ${du}`;s=r().domRef.current.querySelector(c)}if(!s){console.warn(`Cannot show column menu for column "${t}"`);return}l.current=null,i(()=>Sf(t,e,d),{constrainTo:u.current,id:"column-menu",alignTo:s,alignPosition:[["TopLeft","BottomLeft"],["TopRight","BottomRight"]]})}function wf(o){let{context:t,state:e}=o,{getState:n,actions:i}=t,{showOverlay:r,portal:a,clearAll:l}=At({portalContainer:!1}),u=n().onColumnMenuClick.onChange(d=>{d&&(n().columnMenuTargetRef.current=d.target,i.contextMenuVisibleFor=null,i.cellContextMenuVisibleFor=null,i.filterOperatorMenuVisibleForColumnId=null,i.columnMenuVisibleForColumnId=d.column.id)});return _b([()=>e.value.columnMenuVisibleForColumnId,()=>e.value.columnMenuVisibleKey],(d,s,c)=>{let{columnMenuVisibleForColumnId:f,columnMenuTargetRef:m}=n();if(f){let h=function(y){y.__insideMenu!==!0&&(l(),i.columnMenuVisibleForColumnId=null)};var p=h;document.documentElement.addEventListener("mousedown",h),Eb({columnId:f,context:t,clearAll:l,showOverlay:r}),c(()=>{document.documentElement.removeEventListener("mousedown",h)})}else m.current=null,l()},{flush:"post"}),Ab(()=>{u()}),{MenuPortal:a}}import{onBeforeUnmount as Mb,watch as Fb}from"vue";import{h as ki}from"vue";function vf(o,t,e){if(o==null)return null;let{getComputed:n,getState:i,getDataSourceState:r,actions:a,dataSourceApi:l,dataSourceActions:u,api:d}=t,{components:s,getFilterOperatorMenuItems:c}=i(),f=s?.Menu??_t,m=n().computedColumnsMap.get(o);if(!m)return null;let p=x=>{x.__insideMenu=!0},h=x=>{x.domRef.current?.parentNode?.removeEventListener("mousedown",p)},{filterTypes:y}=r(),C=y[m.computedFilterType];if(!C)return null;let b=C.operators.map(x=>{let F=x.name,N=m.computedFilterValue?m.computedFilterValue.filter.operator===F:F===C.defaultOperator,R=x.components?.Icon??hn;return{key:F,icon:ki(R),label:x.label??x.name,onAction:()=>{d.setColumnFilterOperator(o,F)},checked:N?ki(tu,{size:16}):null}}),S=[...[{key:"close",label:"Close Menu",icon:null,onAction:()=>{d.hideFilterOperatorMenu()}},{key:"reset",label:"Reset",icon:ki(nu),disabled:!m.computedFiltered,onAction:()=>{d.clearColumnFilter(o)}},"-"],...b],T={column:m,api:d,getState:i,getDataSourceState:r,getComputed:n,actions:a,dataSourceApi:l,dataSourceActions:u,columnFilterValue:m.computedFilterValue,filterTypes:y},I=c?c(S,T):S;return ki(f,{autoFocus:!0,columns:[{name:"icon"},{name:"label"},{name:"checked"}],items:I,onShow:x=>{x.domRef.current?.parentNode?.addEventListener("mousedown",p)},onHide:h,onHideIntent:x=>{h(x),e?.()}})}var Li=10;function Rf(o){let{context:t,state:e}=o,{getState:n,actions:i}=t,{showOverlay:r,portal:a,clearAll:l}=At({portalContainer:!1}),u=n().onFilterOperatorMenuClick.onChange(d=>{if(!d)return;let{target:s,column:c}=d;function f(){l(),i.filterOperatorMenuVisibleForColumnId=null}let m=s?.parentElement||s,p=Ae.from(m.getBoundingClientRect());p.top-=Li,p.left-=Li,p.width+=2*Li,p.height+=2*Li,r(()=>vf(c.id,t,f),{constrainTo:n().domRef.current,id:"filter-operator-menu",alignTo:p,alignPosition:[["TopLeft","BottomLeft"],["TopRight","BottomRight"]]}),i.contextMenuVisibleFor=null,i.cellContextMenuVisibleFor=null,i.columnMenuVisibleForColumnId=null,i.filterOperatorMenuVisibleForColumnId=c.id});return Fb(()=>e.value.filterOperatorMenuVisibleForColumnId,(d,s,c)=>{if(d){let m=function(p){p.__insideMenu!==!0&&(l(),i.filterOperatorMenuVisibleForColumnId=null)};var f=m;document.documentElement.addEventListener("mousedown",m),c(()=>{document.documentElement.removeEventListener("mousedown",m)})}else l()},{flush:"post"}),Mb(()=>{u()}),{MenuPortal:a}}import{onBeforeUnmount as Df,watch as Af}from"vue";import{h as Vi}from"vue";function zi(o){let t=o?Array.isArray(o)?o:o.items:null,e=o&&!Array.isArray(o)?o.columns:void 0;return{items:t,columns:e}}function Pa(o){let t=i=>{i.__insideMenu=!0},e=i=>{i.domRef.current?.parentNode?.removeEventListener("mousedown",t)};return{columns:[],items:[],autoFocus:!0,onShow:i=>{i.domRef.current?.parentNode?.addEventListener("mousedown",t)},onHide:e,onHideIntent:i=>{e(i),o.onHideIntent?.()}}}function If(o,t,e){if(!o)return null;let n=pe();return o.then(i=>{let{items:r,columns:a}=zi(i);r&&r.length&&n(Vi(e,{...t,items:r||[],columns:a}))}),Vi(Zt,{updater:n})}function xf(o,t,e){let{columnId:n,rowIndex:i,event:r}=o,{getComputed:a,getState:l}=t,{components:u,getCellContextMenuItems:d}=l(),s=u?.Menu??_t,{computedColumnsMap:c}=a(),f=c.get(n),m={...Dt({...t,rowIndex:i,columnId:f.id}),event:r};if(!f||!d)return{cellContext:m,menu:null,preventDefault:!1};let p=Pa({onHideIntent:e}),h=d(m,t),y=h instanceof Promise||Array.isArray(h)?!0:!!(h&&Array.isArray(h.items));if(h instanceof Promise)return{cellContext:m,menu:If(h,p,s),preventDefault:y};let{items:C,columns:b}=zi(h);return!C||!C.length?{cellContext:m,menu:null,preventDefault:Array.isArray(C)}:{preventDefault:y,menu:Vi(s,{...p,columns:b,items:C}),cellContext:m}}function Pf(o,t,e){let{getState:n,getComputed:i}=t,{components:r,getContextMenuItems:a}=n(),l=r?.Menu??_t,{computedColumnsMap:u}=i(),d=o.columnId?u.get(o.columnId):void 0,s=d?{...o,...Dt({...t,rowIndex:o.rowIndex,columnId:d.id})}:o;if(!a)return{cellContext:s,menu:null,preventDefault:!1};let c=Pa({onHideIntent:e}),f=a(s,t),m=f instanceof Promise||Array.isArray(f)?!0:!!(f&&Array.isArray(f.items));if(f instanceof Promise)return{cellContext:s,menu:If(f,c,l),preventDefault:m};let{items:p,columns:h}=zi(f);return!p||!p.length?{cellContext:s,menu:null,preventDefault:Array.isArray(p)}:{preventDefault:m,menu:Vi(l,{...c,columns:h,items:p}),cellContext:s}}var Gi=5,_f=[["TopLeft","BottomLeft"],["TopRight","BottomRight"],["BottomLeft","BottomLeft"],["BottomRight","BottomRight"],["TopCenter","TopLeft"],["BottomCenter","TopLeft"],["CenterLeft","TopLeft"],["CenterRight","TopLeft"]];function Ef(o){let{context:t,state:e}=o,{getState:n,actions:i,getDataSourceState:r}=t,{showOverlay:a,portal:l,clearAll:u}=At({portalContainer:!1}),d=n().cellContextMenu.onChange(s=>{if(!s)return;let{event:c}=s;function f(){u(),i.cellContextMenuVisibleFor=null}let{menu:m,cellContext:p,preventDefault:h}=xf(s,t,f),y=Ae.fromPoint({top:c.clientY,left:c.clientX});y.width+=Gi,y.height+=Gi,a(()=>m,{constrainTo:n().domRef.current,id:"cell-context-menu",alignTo:y,alignPosition:_f}),h&&c.preventDefault(),i.cellContextMenuVisibleFor={columnId:s.columnId,rowId:s.rowId,rowIndex:s.rowIndex,colIndex:s.colIndex};let{onCellContextMenu:C}=n();C&&C({...p,getState:n,getDataSourceState:r},c)});return Af(()=>e.value.cellContextMenuVisibleFor,(s,c,f)=>{if(s){let p=function(h){h.__insideMenu!==!0&&(u(),i.cellContextMenuVisibleFor=null)};var m=p;document.documentElement.addEventListener("mousedown",p),f(()=>{document.documentElement.removeEventListener("mousedown",p)})}else u()},{flush:"post"}),Df(()=>{d()}),{MenuPortal:l}}function Mf(o){let{context:t,state:e}=o,{getState:n,actions:i}=t,{showOverlay:r,portal:a,clearAll:l}=At({portalContainer:!1}),u=n().contextMenu.onChange(d=>{if(!d)return;let{event:s}=d;function c(){l(),i.contextMenuVisibleFor=null}let{menu:f,cellContext:m,preventDefault:p}=Pf(d,t,c),h={top:s.clientY,left:s.clientX},y=Ae.fromPoint(h);y.width+=Gi,y.height+=Gi,r(()=>f,{constrainTo:n().domRef.current,id:"table-context-menu",alignTo:y,alignPosition:_f}),p&&s.preventDefault(),i.contextMenuVisibleFor={point:h,...d};let{onContextMenu:C}=n();C&&C({...t,...m},s)});return Af(()=>e.value.contextMenuVisibleFor,(d,s,c)=>{if(d){let m=function(p){p.__insideMenu!==!0&&(l(),i.contextMenuVisibleFor=null)};var f=m;document.documentElement.addEventListener("mousedown",m),c(()=>{document.documentElement.removeEventListener("mousedown",m)})}else l()},{flush:"post"}),Df(()=>{u()}),{MenuPortal:a}}import{defineComponent as lC,h as Ln,onBeforeUnmount as sC,onMounted as uC,ref as dC,shallowRef as cC,watch as Da}from"vue";var Ff="mlx2t3";import{defineComponent as Nb,h as Ob}from"vue";var Nf=Nb({name:"SpacePlaceholder",props:{width:{type:Number,required:!0},height:{type:Number,required:!0},count:{type:Number,required:!1}},setup(o){return()=>Ob("div",{"data-count":o.count,"data-placeholder-width":void 0,"data-placeholder-height":void 0,"data-name":"SpacePlaceholder",style:{height:`${o.height}px`,width:`${o.width}px`,zIndex:-1,opacity:0,pointerEvents:"none",contain:"strict"}})}});var Of={true:"_1ueijco2",false:"_1ueijco3",visible:"_1ueijco4",auto:"_1ueijco5",hidden:"_1ueijco6"},kf={true:"_1ueijco7",false:"_1ueijco8",visible:"_1ueijco9",auto:"_1ueijcoa",hidden:"_1ueijcob"},Lf={true:"_1ueijcoc",false:"_1ueijcod",visible:"_1ueijcoe",auto:"_1ueijcof",hidden:"_1ueijcog"},zf="_1ueijco1",Vf="_1ueijco0 _16lm1iw0";import{defineComponent as kb,h as Lb,onBeforeUnmount as zb,onMounted as Vb,ref as Gb}from"vue";var Gf=o=>{let t="";return typeof o=="boolean"||typeof o=="string"?t=Of[`${o}`]:t=te(kf[`${o.horizontal}`],Lf[`${o.vertical}`]),t};var Kb="InfiniteVirtualScrollContainer",Kf=kb({name:"VirtualScrollContainer",props:{scrollable:{type:[Boolean,String,Object],required:!1,default:!0},tabIndex:{type:Number,required:!1},autoFocus:{type:Boolean,required:!1},onContainerScroll:{type:Function,required:!1},scrollerRef:{type:Function,required:!1}},setup(o,{slots:t,attrs:e}){let n=Gb(null),i=r=>{let a=r.target;o.onContainerScroll?.({scrollTop:a.scrollTop,scrollLeft:a.scrollLeft})};return Vb(()=>{let r=n.value;r&&(o.scrollerRef?.(r),r.addEventListener("scroll",i,{passive:!1}),o.autoFocus&&document.activeElement!==r&&r.focus())}),zb(()=>{n.value?.removeEventListener("scroll",i),o.scrollerRef?.(null)}),()=>Lb("div",{...e,ref:n,tabindex:o.tabIndex,class:te(e.class,Kb,Vf,Gf(o.scrollable))},t.default?.())}});import{computed as Bb,defineComponent as Hb,h as Wb,onBeforeUnmount as jb,onMounted as $b,watch as Ub,watchEffect as Bf}from"vue";var Ki=Hb({name:"RawTable",props:{name:{type:String,required:!1},brain:{type:Object,required:!0},renderCell:{type:Function,required:!0},renderDetailRow:{type:Function,required:!1},cellHoverClassNames:{type:Array,required:!1},cellDetachedClassNames:{type:Array,required:!1,default:()=>[]},renderer:{type:Object,required:!1},onRenderUpdater:{type:Function,required:!1},forceRerenderTimestamp:{type:Number,required:!1}},setup(o){let t=Bb(()=>o.onRenderUpdater&&o.renderer?{renderer:o.renderer,onRenderUpdater:o.onRenderUpdater}:yo(o.brain));Bf(()=>{t.value.renderer.cellHoverClassNames=o.cellHoverClassNames||[]}),Bf(()=>{t.value.renderer.cellDetachedClassNames=o.cellDetachedClassNames||[]});let e=null,n=()=>{e?.();let{renderer:i,onRenderUpdater:r}=t.value,{brain:a,renderCell:l,renderDetailRow:u}=o,d=a.getRenderRange();i.renderRange(d,{onRender:r,force:!0,renderCell:l,renderDetailRow:u}),e=a.onRenderRangeChange(s=>{i.renderRange(s,{force:!1,onRender:c=>{let f=r.get();f&&c&&f.length===c.length||r(c)},renderCell:l,renderDetailRow:u})})};return $b(n),Ub(()=>[t.value,o.brain,o.renderCell,o.renderDetailRow,o.forceRerenderTimestamp],n,{flush:"post"}),jb(()=>{e?.(),e=null}),()=>Wb(Zt,{name:o.name,updater:t.value.onRenderUpdater})}});var Bi=[ru,`${Ne}DetachedCell`];import{defineComponent as qb,h as Wf,onBeforeUnmount as Yb,onMounted as Zb,ref as jf,watch as $f}from"vue";var Hf=we({defaultClassName:"nxbq1c1 _16lm1iwz _16lm1iw2",variantClassNames:{visible:{true:"nxbq1c3",false:"nxbq1c4"}},defaultVariants:{},compoundVariants:[]}),Hi="nxbq1c0 _16lm1iwz _16lm1iw4 _16lm1iw26 _16lm1iw23 _16lm1iw1y _16lm1iw1k";var{rootClassName:Xb}=Le,Jb=`${Xb}-ActiveCellIndicator`,Qb=U(j.columnZIndexAtIndex),Uf=qb({name:"ActiveCellIndicator",props:{activeCellIndex:{type:Array,required:!1,default:null},brain:{type:Object,required:!0},rowHeight:{type:[Number,Function],required:!1}},setup(o){let t=jf(null),e=jf(0),n=()=>{let{activeCellIndex:a,brain:l,rowHeight:u}=o;if(a==null)return;let[d]=a;l.isHorizontalLayoutBrain&&l.rowsPerPage&&(d=d%l.rowsPerPage);let s=typeof u=="function"?u(d):u??l.getRowHeight(d),c=l.getItemOffsetFor(d,"vertical");Sn({activeCellRowHeight:`${s}px`,activeCellRowOffset:`${c}px`},t.value)},i=null,r=a=>{i?.(),i=a.onRenderCountChange(()=>{e.value++})};return Zb(()=>{r(o.brain),n()}),$f(()=>o.brain,r),$f([()=>o.activeCellIndex,()=>o.rowHeight,()=>o.brain],()=>n(),{flush:"post"}),Yb(()=>{i?.()}),()=>{e.value;let a=o.activeCellIndex!=null&&o.brain.getInitialRows()>o.activeCellIndex[0];return Wf("div",{class:Hi,ref:t,"data-name":"active-cell",style:a?{zIndex:`var(${Qb}-${o.activeCellIndex[1]})`}:void 0},[Wf("div",{"data-name":"active-cell-indicator",class:`${Jb} ${Hf({visible:a})}`})])}}});import{defineComponent as eC,h as Yf,onBeforeUnmount as tC,onMounted as nC,ref as Zf,watch as Xf}from"vue";var qf=we({defaultClassName:"j26lrx0 _16lm1iwz _16lm1iw2 _16lm1iw23 _16lm1iw26",variantClassNames:{active:{true:"j26lrx2",false:"j26lrx3"}},defaultVariants:{},compoundVariants:[]});var{rootClassName:oC}=Le,iC=`${oC}-ActiveRowIndicator`,rC=`calc(${j.activeCellRowOffsetX} + var(${U(j.scrollLeftForActiveRowWhenHorizontalLayout)}, 0px))`,aC={[U(j.activeCellOffsetY)]:j.activeCellRowOffset,transform:`translate3d(${rC}, calc( ${j.activeCellOffsetY} + var(${U(j.scrollTopForActiveRow)}, 0px)), 0px)`,height:j.activeCellRowHeight,maxWidth:Ie.runtime.totalVisibleColumnsWidthVar},Jf=eC({name:"ActiveRowIndicator",props:{activeRowIndex:{type:Number,required:!1,default:null},brain:{type:Object,required:!0}},setup(o){let t=Zf(null),e=Zf(0),n=()=>{let{brain:u}=o;if(o.activeRowIndex==null)return;let d="0px",s=o.activeRowIndex;if(u.isHorizontalLayoutBrain&&u.rowsPerPage){let m=u.getPageIndexForRow(s);m>0&&(d=`calc(${Ie.runtime.totalVisibleColumnsWidthVar} * ${m})`),s=s%u.rowsPerPage}let c=u.getRowHeight(s),f=u.getItemOffsetFor(s,"vertical");Sn({activeCellRowHeight:`${c}px`,activeCellRowOffset:`${f}px`,activeCellRowOffsetX:d},t.value)},i=u=>{Sn({scrollTopForActiveRow:`${-u.scrollTop}px`,scrollLeftForActiveRowWhenHorizontalLayout:o.brain.isHorizontalLayoutBrain?`${-u.scrollLeft}px`:"0px"},t.value)},r=null,a=null,l=u=>{r?.(),a?.(),i(u.getScrollPosition()),r=u.onScroll(i),a=u.onRenderCountChange(()=>{e.value++})};return nC(()=>{l(o.brain),n()}),Xf(()=>o.brain,l),Xf([()=>o.activeRowIndex,()=>o.brain],()=>n(),{flush:"post"}),tC(()=>{r?.(),a?.()}),()=>{e.value;let u=o.activeRowIndex!=null&&o.brain.getInitialRows()>o.activeRowIndex;return Yf("div",{class:Hi,"data-name":"active-row"},[Yf("div",{ref:t,"data-name":"active-row-indicator",class:`${iC} ${qf({active:u})}`,style:u?aC:void 0})])}}});var fC=te(Ff,zf),Qf=lC({name:"HeadlessTable",props:{brain:{type:Object,required:!0},renderCell:{type:Function,required:!0},renderDetailRow:{type:Function,required:!1},cellHoverClassNames:{type:Array,required:!1},renderer:{type:Object,required:!1},onRenderUpdater:{type:Function,required:!1},forceRerenderTimestamp:{type:Number,required:!1},scrollStopDelay:{type:Number,required:!1},wrapRowsHorizontally:{type:Boolean,required:!1},autoFocus:{type:Boolean,required:!1},tabIndex:{type:Number,required:!1},activeRowIndex:{type:Number,required:!1,default:null},activeCellIndex:{type:Array,required:!1,default:null},activeCellRowHeight:{type:[Number,Function],required:!1},scrollerRef:{type:Function,required:!1}},setup(o,{attrs:t}){let e=dC(null),n=cC({width:0,height:0});Da(()=>o.scrollStopDelay,s=>{s!=null&&o.brain.setScrollStopDelay(s)},{immediate:!0});let i=s=>{requestAnimationFrame(()=>{e.value&&e.value.style.setProperty("transform",`translate3d(${-s.scrollLeft}px, ${-s.scrollTop}px, 0px)`)})},r=s=>{o.brain.setScrollPosition(s,i)},a=null,l=null,u=s=>{l?.(),l=s.onRenderCountChange(()=>{n.value=s.getVirtualizedContentSize()}),n.value=s.getVirtualizedContentSize(),i(s.getScrollPosition()||{scrollLeft:0,scrollTop:0})},d=()=>{a?.(),a=null;let s=e.value?.parentNode;if(!s)return;a=Mn(s,()=>{let f={height:s.clientHeight,width:s.clientWidth};o.brain.update(f)},{debounce:50})};return uC(()=>{u(o.brain),d()}),Da(()=>o.brain,s=>{u(s),d()}),Da(()=>o.wrapRowsHorizontally,()=>{d()}),sC(()=>{a?.(),l?.()}),()=>Ln(Kf,{...t,autoFocus:o.autoFocus,tabIndex:o.tabIndex,onContainerScroll:r,scrollerRef:o.scrollerRef},{default:()=>[Ln("div",{ref:e,class:fC,"data-name":"scroll-transform-target"},[Ln(Ki,{forceRerenderTimestamp:o.forceRerenderTimestamp,renderer:o.renderer,onRenderUpdater:o.onRenderUpdater,renderCell:o.renderCell,renderDetailRow:o.renderDetailRow,brain:o.brain,cellHoverClassNames:o.cellHoverClassNames,cellDetachedClassNames:Bi}),o.activeCellIndex!=null?Ln(Uf,{brain:o.brain,rowHeight:o.activeCellRowHeight,activeCellIndex:o.activeCellIndex}):null]),o.activeRowIndex!=null?Ln(Jf,{brain:o.brain,activeRowIndex:o.activeRowIndex}):null,Ln(Nf,{width:n.value.width,height:n.value.height})]})}});var ep="_16lm1iw1 _16lm1iw1c _16lm1iwe";import{computed as hC,defineComponent as sp,h as Vt,onBeforeUnmount as gC,provide as up,shallowRef as Aa,watch as lp}from"vue";import{inject as yC}from"vue";var np=Symbol("REPAINT_CELLS_KEY_NO_ROW");function op(o){return typeof o=="function"}function tp(o,t){let{column:e,rowIndex:n,rowInfoStore:i,getDataSourceState:r}=t,a=i.getRowInfoAtIndex(n);if(!a)return np;let l=i.getDataSourceStates();return o({rowInfo:a,column:e,dataSourceState:l.dataSourceState??r(),previousDataSourceState:l.previousDataSourceState})}function ip(o,t,e){let n=tp(o,t);return t.rowInfoStore.subscribeToDataArrayChange(()=>{let i=tp(o,t);i!==np&&(Object.is(i,n)||(n=i,e()))})}import{defineComponent as pC,h as mC}from"vue";function rp(){let{api:o,getState:t}=He(),e=So(),{editingCell:n,editingValueRef:i}=t(),r=n?.value,a=r;i.current=r;let l=s=>{i.current=s,a=s},{column:u,rowInfo:d}=e.value;return{api:o,initialValue:r,get value(){return a},get readOnly(){let{editingCell:s}=t();return s?!s.active&&!!s.waiting:!1},column:u,rowInfo:d,setValue:l,confirmEdit:o.confirmEdit,cancelEdit:o.cancelEdit,rejectEdit:o.rejectEdit}}var ap=pC({name:"InfiniteTableColumnEditor",setup(){let{state:o}=He(),t=rp(),{initialValue:e,setValue:n,confirmEdit:i,cancelEdit:r}=t,a=!1,l=!1,u=f=>{f&&!l&&(l=!0,f.value=e??"",f.focus())},d=f=>{let{key:m}=f;m==="Enter"||m==="Tab"?(i(),f.stopPropagation(),m==="Tab"&&f.preventDefault()):m==="Escape"?(a=!0,r()):f.stopPropagation()},s=()=>{!a&&o.value.editingCell?.active&&i()},c=f=>{n(f.target.value)};return()=>(o.value.editingCell,mC("input",{readonly:t.readOnly||void 0,ref:u,onKeydown:d,onBlur:s,onInput:c,class:te(Sl,Dl.none),type:"text"}))}});var bC=U(j.columnWidthAtIndex),CC=U(j.columnReorderEffectDurationAtIndex),Ea=Symbol("InfiniteColumnCell");function So(){return yC(Ea)}var TC=o=>{let{toggleCurrentRowDetails:t,rowDetailState:e}=o;return Vt(dn,{style:{visibility:e===!1?"hidden":"visible"},expanded:e==="expanded",onChange:t})},SC={display:"inline-block",visibility:"visible"},_a=o=>{let{rowInfo:t,toggleCurrentTreeNode:e,nodeExpanded:n,api:i}=o,r=i.getDataSourceState().isNodeReadOnly;return Vt(dn,{disabled:t.isTreeNode&&t.isParentNode?r(t):!1,style:SC,expanded:n,onChange:e})},wC=o=>{let{rowInfo:t,rowIndex:e,api:n}=o,{components:i}=n.getState(),r=n.getDataSourceState().isNodeSelectable,a=i?.CheckBox||qt;return Vt(a,{domProps:{class:vn},disabled:t.isTreeNode?!r(t):!1,onChange:()=>{Fc(n,e)},checked:t.rowSelected})},vC=sp({name:"RenderCellHook",props:{renderParam:{type:Object,required:!0},content:{type:null,default:null}},setup(o){return up(Ea,hC(()=>o.renderParam)),()=>o.content}});function ht(o,t){let e=o(t);return e==null?e:Vt(vC,{renderParam:t,content:e})}var dp=sp({name:"InfiniteTableColumnCell",props:{rowIndex:{type:Number,required:!0},rowHeight:{type:Number,required:!0},width:{type:Number,required:!0},hidden:{type:Boolean,default:!1},domRef:{type:Function,required:!0},column:{type:Object,required:!0},columnsMap:{type:Object,required:!0},fieldsToColumn:{type:Object,required:!0},showZebraRows:{type:Boolean,default:!0},rowDetailState:{type:[Boolean,String],default:!1},inEditMode:{type:Boolean,default:!1},rowIndexInHorizontalLayoutPage:{type:Number,default:null},horizontalLayoutPageIndex:{type:Number,default:null},rowStyle:{type:[Object,Function],default:void 0},rowClassName:{type:[String,Function],default:void 0},cellStyle:{type:[Object,Function],default:void 0},cellClassName:{type:[String,Function],default:void 0},repaintCellsKey:{type:[String,Number,Object,Function],default:void 0},getData:{type:Function,required:!0},rowInfoStore:{type:Object,required:!0},renderingContext:{type:Object,required:!0},getComputedVisibleColumns:{type:Function,required:!0},getComputedColumnOrder:{type:Function,required:!0},dataSourceStatePartial:{type:Object,default:void 0},onMouseEnter:{type:Function,default:void 0},onMouseLeave:{type:Function,default:void 0}},setup(o){let t={current:null},e=s=>{let c=s&&s.$el!==void 0?s.$el:s;t.current=c??null,o.domRef(t.current)},n=Aa(o.rowInfoStore.getRowInfoAtIndex(o.rowIndex)),i=null;lp([()=>o.rowInfoStore,()=>o.rowIndex],([s,c])=>{i?.(),n.value=s.getRowInfoAtIndex(c),i=s.subscribeToRowIndex(c,()=>{n.value=s.getRowInfoAtIndex(c)})},{immediate:!0});let r=Aa(0),a=null;lp([()=>o.repaintCellsKey,()=>o.column,()=>o.rowIndex,()=>o.rowInfoStore],([s,c,f,m])=>{a?.(),a=null,op(s)&&(a=ip(s,{column:c,rowIndex:f,rowInfoStore:m,getDataSourceState:o.renderingContext.getDataSourceState},()=>{r.value++}))},{immediate:!0}),gC(()=>{i?.(),i=null,a?.(),a=null});let l=Aa(null);up(Ea,l);let u=s=>{let{renderingContext:c,column:f,rowIndex:m}=o;c.getState().cellClick({rowIndex:m,colIndex:f.computedVisibleIndex,event:s})},d=s=>{let{renderingContext:c,column:f,rowIndex:m}=o,{getState:p,actions:h}=c,y=f.computedVisibleIndex;p().cellMouseDown({rowIndex:m,colIndex:y,event:s});let{keyboardNavigation:C}=p(),b=n.value?.rowDisabled??!1;if(C==="row"){b||(h.activeRowIndex=m);return}C==="cell"&&(h.activeCellIndex=[m,y])};return()=>{let{column:s,rowIndex:c,rowHeight:f,hidden:m,rowDetailState:p,renderingContext:h,rowIndexInHorizontalLayoutPage:y,horizontalLayoutPageIndex:C}=o,b=n.value;if(r.value,!s||!b)return Vt("div",{ref:e,style:{display:"none"}});let{getState:w,getDataSourceState:S}=h,{activeRowIndex:T,keyboardNavigation:I,columnReorderInPageIndex:x}=w(),F=c===T&&I==="row",N=b.rowDisabled,{rowSelected:R}=b,A=o.getComputedVisibleColumns().map($=>$.id),E=bc({horizontalLayoutPageIndex:C,rowIndexInHorizontalLayoutPage:y,column:s,rowInfo:b,rowDetailState:p,columnsMap:o.columnsMap,visibleColumnIds:A,fieldsToColumn:o.fieldsToColumn,context:h}),{stylingParam:P,renderParams:D,formattedValueContext:M,renderFunctions:_,groupByColumnReference:O,inEdit:z}=E,{align:K,verticalAlign:B}=D,G=D;G.domRef=e,G.htmlElementRef=t,l.value=G;let{selectionMode:le}=S(),Z=G.cellSelected,De=S().cellSelection??null,me=null;if(!m&&!z){if(_.renderGroupIcon&&(G.renderBag.groupIcon=ht(_.renderGroupIcon,{...G,renderBag:{...G.renderBag}})),_.renderSelectionCheckBox&&le=="multi-row"&&(G.renderBag.selectionCheckBox=ht(wC,G),_.renderSelectionCheckBox!==!0&&(G.renderBag.selectionCheckBox=ht(_.renderSelectionCheckBox,{...G,renderBag:{...G.renderBag}}))),b.isTreeNode){let{isParentNode:xe}=b,be;be=(xe?_.renderTreeIconForParentNode:_.renderTreeIconForLeafNode)||typeof _.renderTreeIcon=="function"?_.renderTreeIcon:xe&&_.renderTreeIcon===!0?_a:void 0,be===!0?be=_a:be&&(G.renderBag.treeIcon=ht(_a,G)),be&&(G.renderBag.treeIcon=ht(be,{...G,renderBag:{...G.renderBag}}))}_.renderRowDetailIcon&&(G.renderBag.rowDetailsIcon=ht(TC,{...G,renderBag:{...G.renderBag}}),typeof _.renderRowDetailIcon=="function"&&(G.renderBag.rowDetailsIcon=ht(_.renderRowDetailIcon,{...G,renderBag:{...G.renderBag}}))),_.renderValue&&(G.renderBag.value=ht(_.renderValue,{...G,renderBag:{...G.renderBag}})),b.isGroupRow&&_.renderGroupValue&&(G.renderBag.value=ht(_.renderGroupValue,{...G,renderBag:{...G.renderBag}})),!b.isGroupRow&&_.renderLeafValue&&(G.renderBag.value=ht(_.renderLeafValue,{...G,renderBag:{...G.renderBag}}));let $=G.renderBag.value;$ instanceof Date&&($=$.toLocaleDateString());let ee=G.renderBag,Se=[K!=="end"?ee.treeIcon:null,K!=="end"?ee.groupIcon:null,K!=="end"?ee.rowDetailsIcon:null,K!=="end"?ee.selectionCheckBox:null,$,K==="end"?ee.selectionCheckBox:null,K==="end"?ee.rowDetailsIcon:null,K==="end"?ee.groupIcon:null,K==="end"?ee.treeIcon:null];me=s.render?ht(s.render,{...G,renderBag:{...G.renderBag,all:Se}}):Se}let{style:ve,className:Oe}=dc({column:s,rowInfo:b,rowIndex:c,rowHeight:f,rowIndexInHorizontalLayoutPage:y,horizontalLayoutPageIndex:C,align:K,verticalAlign:B,stylingParam:P,formattedValueContext:M,groupByColumnReference:O,rowStyle:o.rowStyle,rowClassName:o.rowClassName,cellStyle:o.cellStyle,cellClassName:o.cellClassName,showZebraRows:o.showZebraRows,rowActive:F,rowDisabled:N,rowSelected:R,cellSelected:Z,cellSelection:De,getData:o.getData,computedVisibleColumns:o.getComputedVisibleColumns(),computedColumnOrder:o.getComputedColumnOrder(),columnReorderInPageIndex:x}),Ee=s.computedVisibleIndex,Te=s.cssEllipsis??!0,_e={width:`var(${bC}-${Ee})`,transition:`transform var(${CC}-${Ee}, 0s)`,...ve,height:typeof ve.height=="number"?`${ve.height}px`:ve.height},{onRowMouseEnter:ue,onRowMouseLeave:Q}=o.renderingContext.getState(),H=ue||o.onMouseEnter?$=>{ue?.({...M,rowIndex:c},$),o.onMouseEnter?.($)}:void 0,q=Q||o.onMouseLeave?$=>{Q?.({...M,rowIndex:c,rowInfo:b},$),o.onMouseLeave?.($)}:void 0,X={ref:e,style:_e,"data-column-id":s.id,"data-z-index":_e.zIndex,"data-row-id":`${b.id}`,class:te(Oe,wt,Bo),onClick:u,onMousedown:d,onMouseenter:H,onMouseleave:q},ne=Vt("div",{class:te(`${wt}_content`,Te?lt:Mo.hidden)},[me]),ie=s.components?.Editor??ap,he=z?Vt(ie):null,ge=he?[ne,he]:[ne],oe=s.components?.ColumnCell;return oe?Vt(oe,X,{default:()=>ge}):Vt("div",X,ge)}}});import{defineComponent as xC,h as PC,shallowRef as DC,watch as AC}from"vue";var cp=we({defaultClassName:"evqes20",variantClassNames:{},defaultVariants:{},compoundVariants:[]});function RC(o,t){let{masterState:e,detailContext:n}=t,i=e.detailDataSourcesStateToRestore;if(i.has(o)){let r=i.get(o);return n.assignState(r),!0}return!1}function IC(o,t){let{detailState:e,masterState:n,masterActions:i,cacheEntryForRow:r}=t,a=new Map(n.detailDataSourcesStateToRestore),l=od(e);r.all||(r.groupBy||delete l.groupBy,r.sortInfo||delete l.sortInfo,r.filterValue||delete l.filterValue,r.data||delete l.originalDataArray),a.set(o,l),i.detailDataSourcesStateToRestore=a}function fp(o,t){let e={current:!1};return{currentRowCache:{getRowId:()=>o,add:i=>{e.current=!0,t.add(o,i)},get:()=>t.get(o),delete:()=>(e.current=!0,t.delete(o)),has:()=>t.has(o)},cacheCalledByRowDetailRenderer:e}}function pp(o){let{rowInfo:t,currentRowCache:e,cacheCalledByRowDetailRenderer:n,getMasterDataSourceState:i,masterActions:r,getMasterState:a}=o,l=i().detailDataSourcesStateToRestore.has(t.id)&&e.has(),d={registerDetail:bt(s=>{if(n.current||e.add({all:!0}),!e.has()){requestAnimationFrame(()=>{s.dataSourceState.destroyedRef.current||(s.dataSourceActions.stateReadyAsDetails=!0)});return}RC(t.id,{masterState:i(),detailContext:s}),requestAnimationFrame(()=>{s.dataSourceState.destroyedRef.current||(s.dataSourceActions.stateReadyAsDetails=!0)}),s.dataSourceState.onCleanup.onChange(()=>{let c=e.get();c&&IC(t.id,{detailState:s.getDataSourceState(),masterActions:r,masterState:i(),cacheEntryForRow:c})})}),shouldRestoreState:l};return d.masterRowInfo=t,d.getMasterDataSourceState=i,d.getMasterState=a,d}var{rootClassName:_C}=Le,EC=`${_C}RowDetail`,Ma=xC({name:"InfiniteTableDetailRow",props:{rowInfo:{type:Object,required:!0},rowIndex:{type:Number,required:!0},domRef:{type:Function,required:!1},rowDetailHeight:{type:Number,required:!0},detailOffset:{type:Number,required:!0},rowDetailRenderer:{type:Function,required:!0},rowDetailsCache:{type:Object,required:!0}},setup(o){let{getDataSourceState:t,dataSourceActions:e}=fo(),{getState:n}=He(),i=()=>{let{currentRowCache:l,cacheCalledByRowDetailRenderer:u}=fp(o.rowInfo.id,o.rowDetailsCache);return{masterDetailContextValue:pp({rowInfo:o.rowInfo,currentRowCache:l,cacheCalledByRowDetailRenderer:u,getMasterDataSourceState:t,masterActions:e,getMasterState:n}),currentRowCache:l}},r=DC(i());AC(()=>o.rowInfo.id,()=>{r.value=i()}),wd(()=>r.value.masterDetailContextValue);let a=l=>{let u=l&&l.$el!==void 0?l.$el:l;o.domRef?.(u||null)};return()=>{let{masterDetailContextValue:l,currentRowCache:u}=r.value;return l.masterRowInfo=o.rowInfo,PC("div",{ref:a,class:te(EC,cp({})),style:{position:"absolute",top:`${o.detailOffset}px`,left:0,width:`calc(${j.bodyWidth} - ${j.scrollbarWidthVertical})`,height:`${o.rowDetailHeight}px`}},[o.rowDetailRenderer(o.rowInfo,u)])}}});var Fa=class{constructor(){this.rowHeight=new Map;this.rowDetailHeight=new Map;this.getRowHeight=t=>this.rowHeight.get(t)??0;this.getRowDetailHeight=t=>this.rowDetailHeight.get(t)??0}getTotalRowHeight(t){return this.getRowHeight(t)+this.getRowDetailHeight(t)}getSize(t){let e=this.getRowHeight(t),n=this.getRowDetailHeight(t);return{rowHeight:e,rowDetailHeight:n,totalRowHeight:e+n}}};function MC(o,t){let e=o.rowDetailHeight,n=o.rowHeight,{isRowDetailsExpanded:i,isRowDetailsEnabled:r,getDataSourceState:a}=o;if(!i)return typeof n=="function"?s=>{if(t&&t.rowHeight.has(s))return t.rowHeight.get(s);let c=a().dataArray[s],f=c?n(c):0;return t&&t.rowHeight.set(s,f),f}:n;let l=typeof n=="function",u=typeof e=="function";return s=>{if(t&&t.rowHeight.has(s)&&t.rowDetailHeight.has(s))return t.rowHeight.get(s)+t.rowDetailHeight.get(s);let c=a().dataArray[s];if(!c)return t&&(t.rowHeight.set(s,0),t.rowDetailHeight.set(s,0)),0;let f=l?n(c):n;if(!!(!r||typeof r=="function"&&r(c)===!1)||!i(c))return t&&(t.rowHeight.set(s,f),t.rowDetailHeight.set(s,0)),f;let p=0;return u?p=e(c):p=e,t&&(t.rowHeight.set(s,f),t.rowDetailHeight.set(s,p)),f+p}}function mp(o){let t=new Fa;return{computedRowHeight:MC(o,t),computedRowSizeCacheForDetails:o.isRowDetailsExpanded?t:void 0}}import{computed as wp,defineComponent as VC,h as zn,onBeforeUnmount as GC,watch as KC,watchEffect as BC}from"vue";function hp(o,t,e,n){let i=new Map,r=new Map,a=new Map;o.forEach((s,c)=>{let f=s.id,m=o[c-1],p=m?.id??"",h=new Set,y=m?.computedPinned!==s.computedPinned?new Set:a.get(p)??new Set;a.set(f,h);let C={type:"column",id:f,ref:s,groupOffset:0,computedPinned:s.computedPinned,computedWidth:s.computedWidth,depth:s.columnGroup?(e.get(s.columnGroup)??0)+1:0};i.set([f],C);let b=s.columnGroup,w,S=C;for(;b;){let T=t[b];if(T){h.add(b);let I=[f,...h];w=y.has(b)?r.get(b):void 0,w||(w={id:b,type:"group",ref:T,columnItems:[],children:[],groupOffset:0,uniqueGroupId:[b],computedWidth:0,computedPinned:C.computedPinned,depth:e.get(b)??0},i.set(I,w),r.set(b,w)),w.columnItems.push(C),w.uniqueGroupId.push(C.id),S&&!y.has(S.id)&&w.children.push(S),S=w,b=T.columnGroup}else break}});let l=[],u=new W,d=0;return i.forEach(s=>{if(!s.ref.columnGroup){let c=s.type==="column"?s.ref.computedWidth:s.columnItems.reduce((f,m)=>f+m.ref.computedWidth,0);s.groupOffset=d,s.computedWidth=c,s.type==="group"&&gp(s.children),l.push(s),d+=c}if(s.type==="group")s.columnItems.forEach(c=>{u.set([s.depth,c.ref.computedVisibleIndex],s)});else for(let c=s.depth;c<=n+1;c++)u.set([c,s.ref.computedVisibleIndex],s)}),i.clear(),r.clear(),{tree:l,pathsToCells:u}}function gp(o,t=0){o.forEach(e=>{let n=e.type==="column"?e.ref.computedWidth:e.columnItems.reduce((i,r)=>i+r.ref.computedWidth,0);e.computedWidth=n,e.groupOffset=t,e.type==="group"&&gp(e.children),t+=n})}import{defineComponent as LC,h as Na}from"vue";import{defineComponent as FC,h as yp,ref as NC}from"vue";var{rootClassName:OC}=Le,kC=`${OC}HeaderCell_ResizeHandle`,bp=FC({name:"GroupResizeHandle",props:{groupColumns:{type:Array,required:!0},columns:{type:Array,required:!0},draggerStyle:{type:Object,default:void 0},brain:{type:Object,required:!0},computeResize:{type:Function,required:!0},onResize:{type:Function,required:!0}},setup(o){let t={current:null},e=NC(!1),n=i=>{i.stopPropagation();let r=o.groupColumns[0];if(!r)return;let a=r.computedPinned,l=i.pointerId,u=i.clientX,d=i.target;d.setPointerCapture(l);let s=!0,c=Cu(o.groupColumns.map(h=>h.computedVisibleIndex),{columns:o.columns,domRef:t}),f=h=>{a==="end"&&(h*=-1);let{constrained:y,adjustedDiffs:C,adjustedDiff:b}=o.computeResize(h);return e.value!==y&&(e.value=y),c.resize(C),b},m=h=>{if(s){let y=o.groupColumns.reduce((w,S)=>w+S.computedWidth-S.computedMinWidth,0),C=o.brain.getAvailableSize(),b={width:C.width+y,height:C.height};o.brain.update(b),s=!1}f(Math.round(h.clientX-u))},p=h=>{d.releasePointerCapture(l),d.removeEventListener("pointermove",m),d.removeEventListener("pointerup",p);let y=Math.round(h.clientX-u),C=f(y);c.resize(o.groupColumns.map(()=>0)),o.onResize(C)};d.addEventListener("pointermove",m),d.addEventListener("pointerup",p)};return()=>{let i=o.groupColumns[0];if(!i)return null;let r=i.computedPinned,a=i.computedFirstInCategory,l=i.computedLastInCategory,u=(r===!1||r==="start")&&l?{right:r==="start"?void 0:Ie.components.HeaderCell.resizeHandleWidth}:r==="end"&&a?{right:void 0}:void 0;return yp("div",{ref:d=>{t.current=d??null},class:`${kC} ${$o} ${qo({computedPinned:r,computedFirstInCategory:a,computedLastInCategory:l})}`,onPointerdown:n},[yp("div",{style:{...u,...o.draggerStyle},class:Uo({constrained:e.value})})])}}});var Cp=`${Ne}HeaderGroup`,Tp=U(j.columnWidthAtIndex),zC=U(j.columnZIndexAtIndex),Sp=LC({name:"InfiniteTableHeaderGroup",props:{columnGroup:{type:Object,required:!0},columns:{type:Array,required:!0},height:{type:Number,required:!0},width:{type:Number,required:!0},columnGroupsMaxDepth:{type:Number,required:!0},horizontalLayoutPageIndex:{type:Number,default:null},domRef:{type:Function,required:!0}},setup(o){let{getState:t,getComputed:e,actions:n}=He(),i=l=>{o.domRef(l??null)},r=l=>{let u=t(),{columnSizing:d,viewportReservedWidth:s,bodySize:c}=u,f=e().computedVisibleColumns,m=o.columns,p=m[m.length-1],h=!1,y=f.reduce((b,w)=>(w.computedFlex&&(b[w.id]={...d[w.id],flex:w.computedWidth},h=!0),b),{}),C=h?{...d,...y}:d;return rs({availableSize:Er(c),reservedWidth:s||0,dragHandleOffset:l,dragHandlePositionAfter:p.computedVisibleIndex,columnSizing:C,columnGroupSize:m.length,items:f.map(b=>({id:b.id,resizable:b.computedResizable,computedFlex:b.computedFlex,computedWidth:b.computedWidth,computedMinWidth:b.computedMinWidth,computedMaxWidth:b.computedMaxWidth}))})},a=l=>{let{columnSizing:u,reservedWidth:d}=r(l);n.viewportReservedWidth=d,n.columnSizing=u};return()=>{let{columnGroup:l,height:u,columns:d,columnGroupsMaxDepth:s}=o,{header:c}=l,{style:f}=l;c instanceof Function&&(c=c({columnGroup:l,horizontalLayoutPageIndex:o.horizontalLayoutPageIndex}));let m=d[0],p=d.length>1?"calc( "+d.map(w=>`var(${Tp}-${w.computedVisibleIndex})`).join(" + ")+" )":`var(${Tp}-${m.computedVisibleIndex})`,h=`calc(var(${zC}-${m.computedVisibleIndex}) + ${s-l.depth})`,y=typeof f=="function"?f({columnGroup:l,horizontalLayoutPageIndex:o.horizontalLayoutPageIndex}):f;y=y&&typeof y=="object"?{...y}:{},y.width=p,y.height=`${u}px`;let b=d.some(w=>w.computedResizable)?Na(bp,{brain:t().brain,draggerStyle:{height:`${u*(s-l.depth+2)}px`},columns:e().computedVisibleColumns,groupColumns:d,computeResize:r,onResize:a}):null;return Na("div",{ref:i,"data-group-id":l.uniqueGroupId,class:te(Ul,Cp),style:y,"data-z-index":h},[Na("div",{class:te(`${Cp}__header-content`,lt)},[c]),b])}}});var{rootClassName:HC}=Le,vp=`${HC}Header`,WC=[],jC=Bl({overflow:!1}),Rp=VC({name:"TableHeaderWrapper",props:{headerBrain:{type:Object,required:!0},bodyBrain:{type:Object,required:!0},wrapRowsHorizontally:{type:Boolean,default:!1}},setup(o){let t=He(),{state:e,getState:n,getComputed:i,dataSourceContext:r}=t,a=wp(()=>{let p=e.value,h=p.computedColumnGroups;return!h||!Object.keys(h).length?1:p.columnGroupsMaxDepth+2}),l=wp(()=>{let p=e.value;return a.value*p.columnHeaderHeight+(p.showColumnFilters?p.columnHeaderHeight:0)}),u=Lt(()=>{let p=e.value;return[p.computedColumnGroups,p.columnGroupsDepthsMap,p.columnGroupsMaxDepth,i().computedVisibleColumns]},()=>{let p=n(),{computedColumnGroups:h,columnGroupsDepthsMap:y}=p,{computedVisibleColumns:C}=i();if(!(!h||!Object.keys(h).length))return hp(C,h,y,p.columnGroupsMaxDepth)},"header.treeInfo");BC(()=>{let p=e.value,{computedVisibleColumns:h,computedPinnedStartColumns:y,computedPinnedEndColumns:C,columnSize:b}=i(),w=a.value,S=l.value,T=u.value,I=p.showColumnFilters,x=p.columnHeaderHeight,F=({rowIndex:A,colIndex:E})=>{let P=h[E],D=1,M=1;if(!P||!T)return{rowspan:D,colspan:M};let _=T.pathsToCells.get([A,E]);if(!_)return{rowspan:D,colspan:M};if(_.type==="column")return{colspan:M,rowspan:w-_.depth};let O=_.columnItems.findIndex(z=>z.id===P.id);return{rowspan:D,colspan:O===0?_.columnItems.length:1}},N=A=>I?A<w-1?x:2*x:x,R=o.headerBrain;(y.length||C.length)&&R.updateFixedCells({fixedColsStart:y.length,fixedColsEnd:C.length}),R.update({colWidth:b,rowHeight:N,rows:w,cols:h.length,height:S,rowspan:({rowIndex:A,colIndex:E})=>F({rowIndex:A,colIndex:E}).rowspan,colspan:({rowIndex:A,colIndex:E})=>F({rowIndex:A,colIndex:E}).colspan})});let d=null,s=p=>{d&&(d.style.transform=`translate3d(-${p.scrollLeft}px, 0px, 0px)`)},c=p=>{d=p??null},f=null;KC(()=>o.headerBrain,p=>{f?.(),f=p.onScroll(s),s(p.getScrollPosition()||{scrollLeft:0,scrollTop:0})},{immediate:!0}),GC(()=>{f?.(),f=null});let m=Lt(()=>{let p=e.value,h=r.state.value,{computedVisibleColumns:y,computedColumnsMap:C}=i();return[p.headerOptions,p.columnHeaderHeight,p.columnGroupsMaxDepth,p.showColumnFilters,y,C,u.value,o.headerBrain,h.allRowsSelected,h.someRowsSelected,h.selectionMode,h.filterTypes,h.filterDelay]},()=>{let p=n(),h=r.getDataSourceState(),{computedVisibleColumns:y,computedColumnsMap:C}=i(),b=o.headerBrain,w=u.value,S=p.columnGroupsMaxDepth,T=p.headerOptions,{allRowsSelected:I,someRowsSelected:x,selectionMode:F}=h;return N=>{let{rowIndex:R,colIndex:A,domRef:E,height:P,widthWithColspan:D,heightWithRowspan:M,hidden:_}=N,O=y[A];if(!O||_)return null;let z=b.isHorizontalLayoutBrain?b.getPageIndexForRow(R):null,K=w?w.pathsToCells.get([R,A]):null;if(K&&K.type==="group"){let B=K.columnItems.map(Z=>Z.ref),G={...K.ref,id:K.id,uniqueGroupId:K.uniqueGroupId,depth:K.depth,columns:B.map(Z=>Z.id),computedWidth:K.computedWidth,groupOffset:K.groupOffset};return n().columnGroupVisibility[K.id]!==!1?zn(Sp,{key:K.uniqueGroupId.join("/"),horizontalLayoutPageIndex:z,columnGroupsMaxDepth:S,domRef:E,columns:B,width:D,height:P,columnGroup:G}):null}return zn(Ru,{key:O.id,domRef:E,column:O,columnsMap:C,horizontalLayoutPageIndex:z,headerOptions:T,width:D,height:M,allRowsSelected:I,someRowsSelected:x,selectionMode:F})}},"header.renderCell");return()=>{let p=l.value,{scrollbars:h}=i(),y=e.value,C=zn("div",{ref:c,class:te(vp,`${vp}--virtualized`,jC),style:{height:`${p}px`}},[zn(Ki,{name:"header",renderCell:m.value,brain:o.headerBrain,renderer:y.headerRenderer,onRenderUpdater:y.headerOnRenderUpdater,cellHoverClassNames:WC,cellDetachedClassNames:Bi})]),b=h.vertical&&Tt()?zn("div",{class:Yl,style:{zIndex:1e3,width:`${Tt()}px`}}):null;return zn("div",{class:`${Tr} ${Ql}`,style:{height:`${p}px`}},[C,b])}}});import{defineComponent as $C,h as Oa}from"vue";var Ip={visible:"qy58ya1 qy58ya0 _16lm1iw2 _16lm1iw23 _16lm1iw26 _16lm1iw2c _16lm1iw2a",hidden:"qy58ya2 qy58ya0 _16lm1iw2 _16lm1iw23 _16lm1iw26 _16lm1iw2c _16lm1iw2a"},xp="qy58ya3 _16lm1iw2 _16lm1iw23 _16lm1iw26 _16lm1iw2c _16lm1iw2a",Pp="qy58ya4";var{rootClassName:UC}=Le,ka=`${UC}-LoadMask`,Wi=$C({name:"LoadMask",props:{visible:{type:Boolean,required:!0}},setup(o,{slots:t}){return()=>Oa("div",{class:`${Ip[o.visible?"visible":"hidden"]} ${ka}`},[Oa("div",{class:`${xp} ${ka}-Overlay`}),Oa("div",{class:`${Pp} ${ka}-Text`},t.default?t.default():"Loading")])}});var Dp=o=>`--infinite-${o}`;var Ap=40,_p=Dp(Is);var tT=Le.rootClassName,za=["debugId","id","children","columns","columnDefaultWidth","columnDefaultFlex","columnMinWidth","columnMaxWidth","columnCssEllipsis","columnHeaderCssEllipsis","columnDefaultSortable","columnDefaultDraggable","columnDefaultEditable","columnDefaultFilterable","columnDefaultGroupable","columnOrder","defaultColumnOrder","onColumnOrderChange","columnVisibility","defaultColumnVisibility","onColumnVisibilityChange","columnPinning","defaultColumnPinning","onColumnPinningChange","columnSizing","defaultColumnSizing","onColumnSizingChange","columnTypes","columnGroups","defaultColumnGroups","columnGroupVisibility","collapsedColumnGroups","pinnedStartMaxWidth","pinnedEndMaxWidth","viewportReservedWidth","onViewportReservedWidthChange","resizableColumns","draggableColumns","draggableColumnsRestrictTo","sortable","multiSortBehavior","editable","rowHeight","onRowHeightChange","rowDetailHeight","columnHeaderHeight","onColumnGroupVisibilityChange","header","headerOptions","showColumnFilters","showZebraRows","showHoverRows","rowHoverClassName","rowClassName","rowStyle","rowProps","cellClassName","cellStyle","repaintCellsKey","domProps","licenseKey","loadingText","components","keyboardNavigation","keyboardSelection","multiRowSelectionWith","keyboardShortcuts","activeRowIndex","defaultActiveRowIndex","onActiveRowIndexChange","activeCellIndex","defaultActiveCellIndex","onActiveCellIndexChange","onKeyDown","onCellClick","onCellDoubleClick","onCellContextMenu","onContextMenu","onScrollToTop","onScrollToBottom","onScrollStop","scrollToBottomOffset","scrollStopDelay","scrollTopKey","onReady","onRenderRangeChange","onRowMouseEnter","onRowMouseLeave","onSelfFocus","onSelfBlur","onFocusWithin","onBlurWithin","focusedClassName","focusedWithinClassName","focusedStyle","focusedWithinStyle","groupColumn","groupRenderStrategy","hideColumnWhenGrouped","hideEmptyGroupColumns","pivotColumn","pivotColumns","pivotColumnGroups","pivotTotalColumnPosition","pivotGrandTotalColumnPosition","showSeparatePivotColumnForSingleAggregation","wrapRowsHorizontally","repeatWrappedGroupRows","onScrollbarsChange","autoSizeColumnsKey","columnMenuRealignDelay","getColumnMenuItems","getCellContextMenuItems","getContextMenuItems","getFilterOperatorMenuItems","onEditCancelled","onEditRejected","onEditAccepted","persistEdit","shouldAcceptEdit","onEditPersistError","onEditPersistSuccess","rowDetailCache","rowDetailRenderer","isRowDetailExpanded","isRowDetailEnabled","rowDetailState","defaultRowDetailState","onRowDetailStateChange"],{useManagedComponent:nT,injectionKey:oT}=pn({initSetupState:Ld,forwardProps:zd,mapPropsToState:Bd,cleanup:Vd,allowedControlledPropOverrides:{rowHeight:!0,columnHeaderHeight:!0},mappedCallbacks:Kd(),getParentState:()=>{let o=ZC(co,null);return o?o.state:null},debugName:"InfiniteTable"});function Mp(o){return t=>o[t]?.computedWidth??0}function Fp(o,t){return o.filter(n=>typeof n.rowspan=="function").length?({rowIndex:n,colIndex:i})=>{let r=t().dataArray,a=r[n];if(!a)return 1;let l=o[i];return!l||!l.rowspan?1:l.rowspan({column:l,data:a.data,dataArray:r,rowInfo:a,rowIndex:n})}:void 0}var Va=YC({name:"InfiniteTable",props:[...za],setup(o,{attrs:t}){let e=fo();if(!e)throw new Error("InfiniteTable must be rendered inside a <DataSource> component");let n=new Proxy(o,{get(g,v,L){let k=Reflect.get(g,v,L);return v==="rowHeight"?k??Ap:v==="columnHeaderHeight"?k??_p:v==="repeatWrappedGroupRows"?k??!!Reflect.get(g,"wrapRowsHorizontally"):k}}),{contextValue:i}=nT(n);Ep(oT,i);let r=i.state,a=i.componentActions,l=i.getComponentState,{state:u,getDataSourceState:d}=e,s=g=>{P.toggleGroupRow(g)};We([()=>r.value.columns,()=>u.value.groupBy,()=>u.value.pivotBy,()=>u.value.selectionMode,()=>r.value.hideColumnWhenGrouped,()=>r.value.groupColumn,()=>r.value.groupRenderStrategy,()=>r.value.pivotColumns,()=>r.value.pivotTotalColumnPosition,()=>r.value.pivotColumn],()=>{let g=r.value,v=u.value,{columns:L,groupColumnIds:k}=mc({columns:g.columns,groupColumn:g.groupColumn,pivotColumn:g.pivotColumn,pivotTotalColumnPosition:g.pivotTotalColumnPosition,pivotGrandTotalColumnPosition:g.pivotGrandTotalColumnPosition,groupRenderStrategy:g.groupRenderStrategy==="inline"?"single-column":g.groupRenderStrategy,groupBy:v.groupBy,pivotBy:v.pivotBy,pivotColumns:g.pivotColumns,toggleGroupRow:s,selectionMode:v.selectionMode});a.columnsWhenGrouping=L;let Y=r.value.columnOrder;if(k.length&&Array.isArray(Y)){let V=new Set(Y),J=!1;k.forEach(ce=>{V.has(ce)||(J=!0,Y=[ce,...Y])}),J&&(a.columnOrder=Y)}},{immediate:!0}),We(()=>r.value.groupRenderStrategy,g=>{e.dataSourceActions.generateGroupRows=g!=="inline"},{immediate:!0}),We(()=>r.value.showSeparatePivotColumnForSingleAggregation,g=>{e.dataSourceActions.showSeparatePivotColumnForSingleAggregation=g},{immediate:!0}),We(()=>r.value.pivotTotalColumnPosition,g=>{e.dataSourceActions.pivotTotalColumnPosition=g},{immediate:!0}),We(()=>r.value.pivotGrandTotalColumnPosition,g=>{g!=null&&(e.dataSourceActions.pivotGrandTotalColumnPosition=g)},{immediate:!0});let c=JC(0),f=null,m=null,p=()=>{let{autoSizeColumnsKey:g}=r.value;return typeof g=="object"?g.key:g};We(()=>r.value.brain,g=>{m?.(),m=g.onRenderRangeChange(()=>{p()!=null&&r.value.autoSizeColumnsKey!==f&&(c.value+=1)})},{immediate:!0}),La(()=>{m?.()}),We([p,()=>r.value.ready,c],()=>{let g=p();if(g==null)return;let{autoSizeColumnsKey:v,domRef:L}=r.value,k,Y,V=!0;typeof v=="object"&&(v.columnsToResize&&(k=new Set(v.columnsToResize)),v.columnsToSkip&&(Y=new Set(v.columnsToSkip)),V=v.includeHeader??V),f=g;let J=jd(L,{includeHeader:V,columnsToResize:k,columnsToSkip:Y}),ce=Object.keys(J);if(!ce.length)return;let se=r.value.columnSizing,fe={...se},ae=!1;ce.forEach(ye=>{fe[ye]={width:J[ye]},ae=ae||fe[ye].width!==se[ye]?.width}),ae&&(a.columnSizing=fe)},{immediate:!0,flush:"post"});let h=qC(()=>Gd(u.value.groupBy));We([()=>r.value.groupRenderStrategy,()=>u.value.originalLazyGroupDataChangeDetect,()=>u.value.groupBy,h,()=>r.value.computedColumns,()=>r.value.hideEmptyGroupColumns?u.value.dataArray:null,()=>r.value.hideEmptyGroupColumns?u.value.groupRowsState:null,()=>r.value.hideEmptyGroupColumns?u.value.groupRowsIndexesInDataArray:null,()=>r.value.hideEmptyGroupColumns],()=>{let g=r.value,v=u.value;if(g.groupRenderStrategy!=="multi-column")return;let L=h.value,k=Hd(g.computedColumns,L),Y=Wd({computedGroupColumns:k,columnVisibility:g.columnVisibility,hideEmptyGroupColumns:g.hideEmptyGroupColumns,groupRowsIndexesInDataArray:v.groupRowsIndexesInDataArray,dataArray:v.dataArray,groupBy:v.groupBy,groupByMap:L});jt(g.columnVisibility,Y)||(a.columnVisibility=Y)},{immediate:!0}),We([()=>r.value.computedColumns,()=>r.value.columnTypes,()=>u.value.groupBy,h,()=>r.value.hideColumnWhenGrouped],()=>{let g=r.value,v=h.value,L=u.value.groupBy.length>0,{columnVisibility:k,columnVisibilityForGrouping:Y,hideColumnWhenGrouped:V,computedColumns:J}=g,ce={...k},se={...Y},fe=!1,ae=new Set,ye=new Set;Object.keys(J).forEach(Re=>{let re=J[Re];if(re.defaultHiddenWhenGroupedBy||V!=null)if(re.defaultHiddenWhenGroupedBy==="*"&&L||(re.defaultHiddenWhenGroupedBy===!0||V)&&re.field&&v.get(re.field)||typeof re.defaultHiddenWhenGroupedBy=="string"&&v.get(re.defaultHiddenWhenGroupedBy)||typeof re.defaultHiddenWhenGroupedBy=="object"&&Object.keys(re.defaultHiddenWhenGroupedBy).reduce((Et,Mt)=>Et||v.has(Mt),!1)){if(se[Re]!==!1){if(k[Re]===!1)return;se[Re]=!1,fe=!0,ae.add(Re)}}else se[Re]===!1&&(delete se[Re],fe=!0,ye.add(Re))}),fe&&(a.columnVisibilityForGrouping=se,ye.forEach(Re=>{delete ce[Re]}),ae.forEach(Re=>{ce[Re]=!1}),a.columnVisibility=ce)},{immediate:!0});let y=Lt(()=>{let g=r.value,v=u.value;return[g.computedColumns,g.bodySize.width,g.columnMinWidth,g.columnMaxWidth,g.columnDefaultWidth,g.columnDefaultFlex,g.columnCssEllipsis,g.columnHeaderCssEllipsis,g.viewportReservedWidth,g.resizableColumns,v.filterValue,v.filterTypes,g.sortable,v.sortInfo,v.multiSort,g.pinnedEndMaxWidth,g.pinnedStartMaxWidth,g.draggableColumns,g.columnDefaultDraggable,g.columnOrder,g.columnPinning,g.columnDefaultEditable,g.columnDefaultFilterable,g.columnDefaultGroupable,g.columnDefaultSortable,g.editable,g.columnSizing,g.columnTypes,g.columnVisibility,g.initialColumns,v.groupBy]},()=>{let g=r.value,v=u.value;return cs({columns:g.computedColumns,userColumns:g.initialColumns,scrollbarWidth:void 0,bodySize:g.bodySize,columnMinWidth:g.columnMinWidth,columnMaxWidth:g.columnMaxWidth,columnDefaultWidth:g.columnDefaultWidth,columnDefaultFlex:g.columnDefaultFlex,columnCssEllipsis:g.columnCssEllipsis,columnHeaderCssEllipsis:g.columnHeaderCssEllipsis,viewportReservedWidth:g.viewportReservedWidth,resizableColumns:g.resizableColumns,filterValue:v.filterValue,filterTypes:v.filterTypes,sortable:g.sortable,sortInfo:v.sortInfo??void 0,multiSort:v.multiSort,pinnedEndMaxWidth:g.pinnedEndMaxWidth,pinnedStartMaxWidth:g.pinnedStartMaxWidth,draggableColumns:g.draggableColumns,columnDefaultDraggable:g.columnDefaultDraggable,columnOrder:g.columnOrder,columnPinning:g.columnPinning,columnDefaultEditable:g.columnDefaultEditable,columnDefaultFilterable:g.columnDefaultFilterable,columnDefaultGroupable:g.columnDefaultGroupable,columnDefaultSortable:g.columnDefaultSortable,editable:g.editable,columnSizing:g.columnSizing,columnTypes:g.columnTypes,columnVisibility:g.columnVisibility,columnVisibilityAssumeVisible:!0,groupBy:v.groupBy})},"computedColumnsResult"),C=()=>y.value.computedVisibleColumns,{getDataSourceState:b,dataSourceApi:w}=e,S=new _i({getRowAt:g=>b().dataArray[g],isNodeSelectable:g=>{let{isNodeSelectable:v}=b();return v?v(g):!0}}),T=new Ei({getPrimaryKeyByIndex:w.getPrimaryKeyByIndex,getColumnIdByIndex:g=>C()[g]?.id||""}),I=QC({vertical:!1,horizontal:!1}),x=null;We(()=>r.value.brain,g=>{x?.(),x=g.onRenderCountChange(()=>{let{scrollTopMax:v,scrollLeftMax:L}=g,k=v>0,Y=L>0,V=I.value;(V.vertical!==k||V.horizontal!==Y)&&(I.value={vertical:k,horizontal:Y})})},{immediate:!0}),We(I,g=>{let v=b(),{onScrollbarsChange:L}=l();L&&v.updatedAt&&v.dataArray.length&&L(g),v.notifyScrollbarsChange(g)});let F=null,N=()=>{let g=l(),v=[g.rowHeight,g.rowDetailHeight,g.isRowDetailExpanded,g.isRowDetailEnabled];return(!F||F.deps.some((L,k)=>L!==v[k]))&&(F={deps:v,value:mp({rowHeight:g.rowHeight,rowDetailHeight:g.rowDetailHeight,isRowDetailsExpanded:g.isRowDetailExpanded,isRowDetailsEnabled:g.isRowDetailEnabled,getDataSourceState:b})}),F.value},R=()=>N().computedRowHeight,A=()=>{let g=y.value,v=g.computedPinnedStartWidth??g.computedPinnedStartColumnsWidth,L=g.computedPinnedEndWidth??g.computedPinnedEndColumnsWidth;return{...g,scrollbars:I.value,multiRowSelector:S,multiCellSelector:T,computedRowHeight:R(),computedRowSizeCacheForDetails:N().computedRowSizeCacheForDetails,rowspan:Fp(g.computedVisibleColumns,b),computedPinnedStartOverflow:v?g.computedPinnedStartColumnsWidth>v:!1,computedPinnedEndOverflow:L?g.computedPinnedEndColumnsWidth>L:!1,toggleGroupRow:k=>P.toggleGroupRow(k),columnSize:k=>Mp(g.computedVisibleColumns)(k)}},E=()=>b().getDataSourceMasterContextRef?.current?.()??void 0,P=Pc({getComputed:A,getState:l,getDataSourceState:b,getDataSourceMasterContext:E,actions:a,dataSourceActions:e.dataSourceActions,dataSourceApi:w}),D={getState:l,getDataSourceState:b,getDataSourceMasterContext:E,actions:a,dataSourceActions:e.dataSourceActions,api:P,dataSourceApi:w},M={getComputed:A,getDataSourceMasterContext:E,dataSourceApi:w,api:P,getState:l,actions:a,getDataSourceState:b,dataSourceActions:e.dataSourceActions,cloneTreeSelection:g=>Dn(g,b),cloneRowSelection:g=>mn(g,b)},_=l().keyDown.onChange(g=>{Zc(M,g)}),O=l().cellClick.onChange(g=>{if(!g)return;let{event:v,rowIndex:L,colIndex:k}=g,Y=A().computedVisibleColumns[k],V=Je(Y.id,M);v.key="",Mc({...M,rowIndex:L,colIndex:k,column:Y,columnApi:V},v)}),z=l().cellMouseDown.onChange(g=>{if(!g)return;let{event:v,rowIndex:L,colIndex:k}=g,Y=A().computedVisibleColumns[k],V=Je(Y.id,M);Nc({...M,rowIndex:L,colIndex:k,column:Y,columnApi:V},v)}),K=g=>{l().keyDown(g)};l().onRowHeightCSSVarChange.onChange(g=>{g&&(a.rowHeight=g)}),l().onFlashingDurationCSSVarChange.onChange(g=>{let v=g?g*1:null;v!=null&&!isNaN(v)&&(a.flashingDurationCSSVarValue=v)}),l().onRowDetailHeightCSSVarChange.onChange(g=>{g&&(a.rowDetailHeight=g)}),l().onColumnHeaderHeightCSSVarChange.onChange(g=>{g&&(a.columnHeaderHeight=g)});let{MenuPortal:B}=wf({context:M,state:r}),{MenuPortal:G}=Ef({context:M,state:r}),{MenuPortal:le}=Mf({context:M,state:r}),{MenuPortal:Z}=Rf({context:M,state:r}),De=g=>{let v=l(),L=g.target,k=Rs(L,ua(),v.domRef.current),Y,V,J,ce;k&&(V=Number(k.dataset.colIndex),ce=Number(k.dataset.rowIndex),Y=A().computedVisibleColumns[V].id,J=w.getRowInfoArray()[ce].id);let se={columnId:Y,colIndex:V,rowId:J,rowIndex:ce,event:g,target:k??g.target};k&&v.cellContextMenu(se),v.contextMenu(se)},me=Sa(g=>{a.focused=g}),ve=Sa(g=>{a.focusedWithin=g}),Oe=g=>{let v=l();if(g.target===v.domRef.current||g.target===v.scrollerDOMRef.current){if(v.focused)return;me(!0),v.onSelfFocus?.(g),v.focusedWithin&&(ve(!1),v.onBlurWithin?.(g));return}v.focusedWithin||(ve(!0),v.onFocusWithin?.(g))},Ee=g=>{let v=l();if(g.target===v.domRef.current||g.target===v.scrollerDOMRef.current){if(!v.focused)return;me(!1),v.onSelfBlur?.(g),v.focusedWithin&&(ve(!1),v.onBlurWithin?.(g));return}v.domRef.current?.contains(g.relatedTarget)||(ve(!1),v.onBlurWithin?.(g))},Te=10,_e=(g,v)=>{let L=!1,k=null;return We([g,()=>u.value.dataArray.length],([Y],[V]=[void 0,void 0])=>{if(Y!=null&&Y!==V&&(L=!1,k!=null&&cancelAnimationFrame(k)),Y==null||L)return;let J=(ce=0)=>{ce++,k!=null&&cancelAnimationFrame(k),k=requestAnimationFrame(()=>{L=v(Y),!L&&ce<Te&&J(ce)})};J()},{immediate:!0}),()=>{k!=null&&cancelAnimationFrame(k)}},ue=_e(()=>r.value.activeRowIndex,g=>P.scrollRowIntoView(g,{offset:0})),Q=_e(()=>r.value.activeCellIndex,g=>P.scrollCellIntoView(g[0],g[1],{offset:30})),H=()=>Tc({getComputed:A,getState:l,getDataSourceState:b,getDataSourceMasterContext:E,actions:a,dataSourceActions:e.dataSourceActions,api:P,dataSourceApi:w},l().editingCell);We([()=>{let g=r.value.editingCell;return g&&!g.active?g.cancelled:void 0},()=>{let g=r.value.editingCell;return g&&!g.active&&g.accepted instanceof Error?g.accepted:void 0},()=>{let g=r.value.editingCell;return!!(g&&!g.active&&!g.cancelled&&g.accepted===!0)},()=>r.value.editingCell?.persisted,()=>r.value.editingCell?.active],([g,v,L,k,Y],[V,J,ce,se,fe])=>{if(g&&g!==V){let ae=l().editingCell,{onEditCancelled:ye}=l();if(ye){let Re=H();Re?ye({...Re,initialValue:ae.initialValue}):bo("onEditCancelled",ae)}}if(v&&v!==J){let ae=l().editingCell,{onEditRejected:ye}=l();if(ye){let Re=H();Re?ye({...Re,value:ae.value,error:v,initialValue:ae.initialValue}):bo("onEditRejected",ae)}}if(L&&L!==ce){let ae=l().editingCell,{value:ye,initialValue:Re}=ae,{onEditAccepted:re}=l();if(re){let rt=H();rt?re({...rt,value:ye,initialValue:Re}):bo("onEditAccepted",ae)}P.persistEdit({value:ye})}if(k&&k!==se){let ae=l().editingCell;if(ae){let ye=k instanceof Error?"onEditPersistError":"onEditPersistSuccess";if(l()[ye]){let Re=H();if(!Re)bo(ye,ae);else{let re={...Re,value:ae.value,initialValue:ae.initialValue};k instanceof Error?l().onEditPersistError?.({...re,error:k}):l().onEditPersistSuccess?.(re)}}}}!Y&&fe&&P.focus()}),eT(()=>{let g=r.value,v=u.value,{computedVisibleColumns:L,computedPinnedStartColumns:k,computedPinnedEndColumns:Y}=y.value,V=g.brain;V.updateFixedCells({fixedColsStart:k.length,fixedColsEnd:Y.length});let J=R();V.update({colWidth:Mp(L),rowHeight:J,rows:v.dataArray.length,cols:L.length,rowspan:Fp(L,d)})}),We(()=>r.value.wrapRowsHorizontally,(g,v)=>{if(v===g)return;let{brain:L,headerBrain:k,renderer:Y,onRenderUpdater:V}=l();L.destroy(),k.destroy(),Y.destroy(),V.destroy();let J=da($d,!!g);a.brain=J.brain,a.headerBrain=J.headerBrain,a.renderer=J.renderer,a.onRenderUpdater=J.onRenderUpdater,a.headerRenderer=J.headerRenderer,a.headerOnRenderUpdater=J.headerOnRenderUpdater},{flush:"post"});let q=null,X=null,ne=()=>{q&&(clearTimeout(q),q=null),X?.(),X=null};We([()=>r.value.brain,()=>r.value.wrapRowsHorizontally,()=>u.value.groupBy,()=>u.value.isTree,()=>r.value.wrapRowsHorizontally?r.value.repeatWrappedGroupRows:!1],([g,v,L,k,Y])=>{ne();let V=e.dataSourceActions;if(!v){d().repeatWrappedGroupRows&&(V.repeatWrappedGroupRows=!1);return}let J=()=>{let{rowsPerPage:ce,repeatWrappedGroupRows:se}=d(),fe=!1,ae=g.rowsPerPage,ye=(L&&L.length>0||k)&&ae>0?ae:null;return ce!=ye&&(V.rowsPerPage=ye,fe=!0),se!=Y&&(V.repeatWrappedGroupRows=Y??!1,fe=!0),fe};J(),X=g.onVerticalRenderRangeChange(()=>{J()&&(q=setTimeout(()=>{a.forceBodyRerenderTimestamp=Date.now()}))})},{immediate:!0,flush:"post"}),La(ne),We(()=>r.value.scrollStopDelay,g=>{r.value.brain.setScrollStopDelay(g),e.dataSourceActions.scrollStopDelayUpdatedByTable=g},{immediate:!0}),We(()=>r.value.ready,g=>{typeof globalThis.__DO_NOT_USE_UNLESS_YOU_KNOW_WHAT_YOURE_DOING_IS_READY=="function"&&globalThis.__DO_NOT_USE_UNLESS_YOU_KNOW_WHAT_YOURE_DOING_IS_READY(r.value.id,g,P,{dataSourceApi:e.dataSourceApi});let{onReady:v}=l();v&&v({api:P,dataSourceApi:w})},{immediate:!0,flush:"post"}),We(()=>!!r.value.bodySize.height,g=>{g&&(a.ready=!0)},{immediate:!0});let ie=null,he=null;We(()=>r.value.brain,g=>{ie?.(),ie=g.onVerticalRenderRangeChange(v=>{d().notifyRenderRangeChange({renderStartIndex:v[0],renderEndIndex:v[1]})}),he?.(),he=g.onRenderRangeChange(v=>{l().onRenderRangeChange?.(v)})},{immediate:!0});let ge=1,oe=0,$=null,ee=null;We(()=>r.value.brain,g=>{$?.(),ee?.(),$=g.onRenderCountChange(()=>{oe=g.scrollTopMax}),ee=g.onScrollStop(v=>{let{scrollTop:L,scrollLeft:k}=v,{onScrollToTop:Y,onScrollToBottom:V,onScrollStop:J}=l();L===0&&Y?.();let ce=l().scrollToBottomOffset??ge;if(L+ce>=oe){V?.();let{livePagination:fe,livePaginationCursor:ae,dataArray:ye}=d();fe&&(e.dataSourceActions.cursorId=ae!==void 0?Date.now():ye.length)}if(J){let fe=g.getRenderRange();J({scrollTop:L,scrollLeft:k,renderRange:fe,viewportSize:l().bodySize,firstVisibleRowIndex:fe.start[0],lastVisibleRowIndex:fe.end[0],firstVisibleColIndex:fe.start[1],lastVisibleColIndex:fe.end[1]})}})},{immediate:!0});let Se=null,xe=null,be=g=>{Se=g,r.value.scrollerDOMRef.current=g,xe?.(),xe=null,g&&(a.bodySize={width:g.clientWidth,height:g.clientHeight},xe=Mn(g,v=>{a.bodySize={width:Math.round(v.width),height:Math.round(v.height)}},{debounce:50}))};XC(()=>{Se&&(a.bodySize={width:Se.clientWidth,height:Se.clientHeight})}),La(()=>{xe?.(),ie?.(),he?.(),_(),O(),z(),ue(),Q()});let Me=()=>b().dataArray,ze=()=>y.value.computedColumnOrder,de=[rc,`${mt}--hovered`],tt=Lt(()=>{let g=r.value;return[g.showHoverRows,g.rowHoverClassName]},()=>{let g=r.value;if(!g.showHoverRows)return;let v=[];return g.rowHoverClassName&&(v=v.concat(g.rowHoverClassName)),v=v.concat(de),v.join(" ").split(" ").map(L=>L.trim()).filter(Boolean)},"hoverClassNames"),Ze=Lt(()=>{let g=u.value;return[g.isNodeReadOnly,g.selectionMode,g.cellSelection]},()=>{let g=b();return{isNodeReadOnly:g.isNodeReadOnly,selectionMode:g.selectionMode,cellSelection:g.cellSelection}},"dataSourceStatePartialForCell"),ct=Lt(()=>{let g=r.value,v=u.value;return[y.value,g.rowHeight,g.rowDetailHeight,g.onRowMouseEnter,g.onRowMouseLeave,g.isRowDetailExpanded,g.isRowDetailEnabled,g.groupRenderStrategy,g.wrapRowsHorizontally,g.showZebraRows,g.brain,g.rowStyle,g.rowClassName,g.cellStyle,g.cellClassName,g.repaintCellsKey,g.editingCell,g.updatedAt,v.rowInfoStore,Ze.value]},()=>{let{computedVisibleColumns:g,computedColumnsMap:v,fieldsToColumn:L}=y.value,k=l(),Y=k.showZebraRows,V=b().rowInfoStore,J=Ze.value;return ce=>{let{rowIndex:se,colIndex:fe,domRef:ae,hidden:ye,width:Re,heightWithRowspan:re,onMouseEnter:rt,onMouseLeave:Et}=ce,Mt=Me()[se],yt=g[fe];if(!Mt||!yt)return null;let Ge=!1,Ft=k.isRowDetailEnabled,Nt=k.isRowDetailExpanded;!Ft||typeof Ft=="function"&&!Ft(Mt)?Ge=!1:Nt&&(Ge=Nt(Mt)?"expanded":"collapsed");let Vn=P.isEditorVisibleForCell({rowIndex:se,columnId:yt.id});return qe(dp,{key:`${se}:${yt.id}`,rowIndex:se,rowHeight:re,width:Re,hidden:ye,domRef:ae,column:yt,columnsMap:v,fieldsToColumn:L,showZebraRows:Y,rowDetailState:Ge,inEditMode:Vn,rowIndexInHorizontalLayoutPage:k.wrapRowsHorizontally?k.brain.getRowIndexInPage(se):null,horizontalLayoutPageIndex:k.wrapRowsHorizontally?k.brain.getPageIndexForRow(se):null,rowStyle:k.rowStyle,rowClassName:k.rowClassName,cellStyle:k.cellStyle,cellClassName:k.cellClassName,repaintCellsKey:yt.repaintCellsKey!==void 0?yt.repaintCellsKey:k.repaintCellsKey,getData:Me,rowInfoStore:V,renderingContext:D,getComputedVisibleColumns:C,getComputedColumnOrder:ze,dataSourceStatePartial:J,onMouseEnter:rt,onMouseLeave:Et})}},"body.renderCell"),gt=Lt(()=>{let g=r.value;return[g.isRowDetailExpanded,g.rowDetailRenderer,g.rowDetailCache]},()=>{let g=l(),v=g.isRowDetailExpanded,L=g.rowDetailRenderer;if(!v||!L)return;let k=g.rowDetailCache;return Y=>{let{rowIndex:V,domRef:J}=Y,se=Me()[V],fe=N().computedRowSizeCacheForDetails;if(!se||!v(se)||!fe)return qe("div",{ref:J,class:Ml.hidden});let{rowDetailHeight:ae,rowHeight:ye}=fe.getSize(V);return qe(Ma,{rowInfo:se,rowDetailsCache:k,rowIndex:V,domRef:J,detailOffset:ye,rowDetailHeight:ae,rowDetailRenderer:L})}});return Ep(ao,{state:r,getState:l,actions:a,api:P,getComputed:A,getComputedVisibleColumns:C,dataSourceContext:e}),()=>{let g=r.value,v=y.value,L=Ls({computedVisibleColumns:v.computedVisibleColumns,computedPinnedStartColumns:v.computedPinnedStartColumns,computedPinnedEndColumns:v.computedPinnedEndColumns,computedPinnedStartColumnsWidth:v.computedPinnedStartColumnsWidth,computedPinnedEndColumnsWidth:v.computedPinnedEndColumnsWidth,computedUnpinnedColumnsWidth:v.computedUnpinnedColumnsWidth,bodySize:g.bodySize,activeCellIndex:g.activeCellIndex,brain:g.brain,scrollbars:I.value}),k=g.focused,Y=g.focusedWithin,V=v.computedPinnedStartWidth??v.computedPinnedStartColumnsWidth,J=v.computedPinnedEndWidth??v.computedPinnedEndColumnsWidth,ce=V?v.computedPinnedStartColumnsWidth>V:!1,se=J?v.computedPinnedEndColumnsWidth>J:!1,{autoFocus:fe,tabIndex:ae,className:ye,class:Re,style:re,onKeyDown:rt,onKeydown:Et,...Mt}=g.domProps??{},yt=te(t.class,ye,Re,Ne,bs,g.wrapRowsHorizontally?`${Ne}--horizontal-layout`:null,v.computedPinnedStartColumnsWidth?`${Ne}--has-pinned-start ${Ts}`:null,v.computedPinnedEndColumnsWidth?`${Ne}--has-pinned-end ${Cs}`:null,k?`${Ne}--focused`:null,Y?`${Ne}--focused-within`:null,k&&g.focusedClassName?g.focusedClassName:null,Y&&g.focusedWithinClassName?g.focusedWithinClassName:null,ce?`${Ne}--has-pinned-start-overflow`:null,se?`${Ne}--has-pinned-end-overflow`:null,Ss({horizontalLayout:!!g.wrapRowsHorizontally,hasPinnedStart:!!v.computedPinnedStartColumnsWidth,hasPinnedEnd:!!v.computedPinnedEndColumnsWidth,focused:k,focusedWithin:Y})),Ge={...t.style,...re,...L};k&&g.focusedStyle&&Object.assign(Ge,g.focusedStyle),Y&&g.focusedWithinStyle&&Object.assign(Ge,g.focusedWithinStyle);let Ft=Et??rt,Nt=Ft?Gt=>{K(Gt),Ft(Gt)}:K,Vn=u.value.loading;return qe("div",{...t,...Mt,ref:Gt=>{g.domRef.current=Gt??null},"data-debug-id":g.debugId,class:yt,style:Ge,onKeydown:Nt,onFocusin:Oe,onFocusout:Ee},[g.header?qe(Rp,{wrapRowsHorizontally:!!g.wrapRowsHorizontally,bodyBrain:g.brain,headerBrain:g.headerBrain}):null,qe("div",{class:te(ep,Cr),onContextmenu:De},[qe(Qf,{brain:g.brain,renderer:g.renderer,onRenderUpdater:g.onRenderUpdater,renderCell:ct.value,renderDetailRow:gt.value,cellHoverClassNames:tt.value,scrollStopDelay:g.scrollStopDelay,forceRerenderTimestamp:g.forceBodyRerenderTimestamp,scrollerRef:be,tabIndex:ae??0,autoFocus:!!fe,activeRowIndex:g.ready&&g.keyboardNavigation==="row"?g.activeRowIndex??null:null,activeCellIndex:g.ready&&g.keyboardNavigation==="cell"&&!g.columnReorderDragColumnId?g.activeCellIndex??null:null,activeCellRowHeight:N().computedRowSizeCacheForDetails?.getRowHeight||R()}),qe(Wi,{visible:!!Vn},()=>g.loadingText)]),qe("div",{ref:Gt=>{g.portalDOMRef.current=Gt??null},class:te(`${Ne}Portal`,Fl[1e7],Al.absolute,_l[0],Pl[0])},[qe(B),qe(G),qe(le),qe(Z)]),g.rowHeightCSSVar?qe(Co,{key:"row-height",varName:g.rowHeightCSSVar,onChange:g.onRowHeightCSSVarChange}):null,qe(Co,{key:"flashing-duration",allowInts:!0,varName:Ie.components.Cell.flashingDuration,onChange:g.onFlashingDurationCSSVarChange}),g.rowDetailHeightCSSVar?qe(Co,{key:"row-detail-height",varName:g.rowDetailHeightCSSVar,onChange:g.onRowDetailHeightCSSVarChange}):null,g.columnHeaderHeightCSSVar?qe(Co,{key:"column-header-height",varName:g.columnHeaderHeightCSSVar,onChange:g.onColumnHeaderHeightCSSVarChange}):null])}}});import{defineComponent as iT,h as rT,watch as aT}from"vue";var Np=U(j.currentFlashingDuration),lT=({children:o})=>o,Op=1e3,kp={up:Ho({direction:"up"}).split(" "),down:Ho({direction:"down"}).split(" "),neutral:Ho({direction:"neutral"}).split(" ")},Lp=(o={})=>{let{flashDuration:t,flashClassName:e,render:n=lT}=o;return iT({name:"FlashingColumnCell",inheritAttrs:!1,setup(i,{attrs:r,slots:a}){let l=So(),u=He(),d=!0,s=null,c=l.value?.value,f,m,p=()=>{let y=l.value?.htmlElementRef.current;if(f&&(clearTimeout(f),f=void 0),m&&y){let C=kp[m];y.classList.remove(...e?[e,...C]:C),y.style.removeProperty(Np),m=void 0}},h=(y,C)=>{let b=l.value?.htmlElementRef.current;if(!b)return;p();let{flashingDurationCSSVarValue:w}=u.getState(),S=typeof w=="number"?w??t??Op:t??Op,T=typeof y=="number"?y>C?"up":"down":"neutral",I=kp[T];b.style.setProperty(Np,`${S}`),b.classList.add(...e?[e,...I]:I),m=T,f=setTimeout(p,S)};return aT(()=>{let y=l.value;return y?[y.column.id,y.rowInfo.id,y.value]:null},(y,C)=>{if(!y)return;let[b,w,S]=y,[T,I]=C??[];if(!(b===T&&w===I)){p(),d=!0,s=null,c=S;return}S!==c&&(d=!1,s=c,c=S,h(S,s))},{flush:"post"}),()=>{let y=l.value;return rT("div",{...r,class:te(r.class),ref:y?.domRef},[n({children:a.default?a.default():null,oldValue:d?null:s})])}}})},sT=Lp();import{defineComponent as Vp,h as Gp}from"vue";var zp=o=>(e,{unfilteredTreePaths:n,treeSelectionState:i,prevTreeSelectionState:r,lastUpdatedNodeInfo:a})=>{let l=new $e(r,{treePaths:n});i.forEachLeafNodePath((s,{selected:c})=>{l.setNodeSelection(s,c)}),a&&i.forEachLeafNodePath(s=>{l.setNodeSelection(s,a.selected)},a.nodePath);let d={defaultSelection:!1,selectedPaths:l.getSelectedLeafNodePaths()};o(d)};var uT=Vp({name:"TreeGrid",props:[...za],setup(o,{slots:t}){return()=>Gp(Va,{...o},t)}}),dT=Vp({name:"TreeDataSource",props:[...Jr],setup(o,{slots:t}){return()=>Gp(Qr,{...o,nodesKey:o.nodesKey??"children"},t)}});var cT={key:"*",when:o=>{let{activeCellIndex:t}=o.getState();if(t){let[e,n]=t,i=o.api.getColumnAtIndex(n);return i?o.api.isCellEditable({rowIndex:e,columnId:i.id}):!1}return!1},handler:(o,t)=>{let{key:e}=t;if(e!="Escape"&&e.length===1){let{activeCellIndex:n}=o.getState();if(n){let[i,r]=n,a=o.api.getColumnAtIndex(r);if(!a)return;requestAnimationFrame(()=>{o.api.startEdit({rowIndex:i,value:e,columnId:a.id})})}}}},fT={instantEdit:cT};var QL={CheckBox:qt,LoadMask:Wi,MenuIcon:io};export{Ke as CellSelectionState,Qr as DataSource,co as DataSourceInjectionKeyForVue,W as DeepMap,sT as FlashingColumnCell,pt as GroupRowsState,Va as InfiniteTable,tT as InfiniteTableClassName,Ma as InfiniteTableDetailRow,ao as InfiniteTableInjectionKeyForVue,_t as Menu,Nr as NumberFilterEditor,ut as RowDetailState,Pe as RowSelectionState,lo as StringFilterEditor,dT as TreeDataSource,Qe as TreeExpandState,uT as TreeGrid,$e as TreeSelectionState,QL as components,Lp as createFlashingColumnCellComponent,Jt as debounce,Nu as defaultFilterFunction,Xn as defaultFilterTypes,kr as defaultTreeFilterFunction,zm as flatten,lr as group,fT as keyboardShortcuts,kt as multisort,jr as multisortNested,rd as toTreeDataArray,fo as useDataSourceContext,Xr as useGetMasterDetailContextForVue,So as useInfiniteColumnCell,rp as useInfiniteColumnEditor,so as useInfiniteColumnFilterEditor,Yo as useInfiniteHeaderCell,He as useInfiniteTableContext,At as useOverlay,zp as withSelectedLeafNodesOnly};
27
+ Component DEBUG_ID = "${o.debugId}"`),e(i,n,t)},Qr=o=>{let{debugId:t,key:e}=o,n=wd[e];if(n&&(Qg({...n,debugId:t}),t&&e)){let i=vd.get(t);i&&i.getState().devToolsDetected&&n&&(i.getState().debugWarnings.set(e,{...n,debugId:t,status:"new"}),ey(t))}};globalThis.logDevToolsWarning=Qr;var ey=o=>{let t=window.__INFINITE_TABLE_DEVTOOLS_HOOK__;if(!t)return;let e=vd.get(o);e&&t(o,e)};import{inject as ty,provide as ny}from"vue";var Rd=Symbol("DataSourceMasterDetail");function Id(o){ny(Rd,o)}var oy=()=>{};function ea(){return ty(Rd,oy)}var ta=["debugId","primaryKey","fields","refetchKey","batchOperationDelay","rowInfoReducers","data","selectionMode","useGroupKeysForMultiRowSelection","multiRowSelectionTarget","rowSelection","defaultRowSelection","onRowSelectionChange","cellSelection","defaultCellSelection","onCellSelectionChange","rowDisabledState","defaultRowDisabledState","onRowDisabledStateChange","isRowDisabled","isRowSelected","lazyLoad","loading","defaultLoading","onLoadingChange","onReady","pivotBy","defaultPivotBy","onPivotByChange","aggregationReducers","defaultAggregationReducers","groupBy","defaultGroupBy","onGroupByChange","groupRowsState","defaultGroupRowsState","onGroupRowsStateChange","collapseGroupRowsOnDataFunctionChange","sortFunction","sortInfo","defaultSortInfo","onSortInfoChange","onDataParamsChange","onDataArrayChange","onDataMutations","livePagination","livePaginationCursor","onLivePaginationCursorChange","filterFunction","treeFilterFunction","shouldReloadData","filterValue","defaultFilterValue","onFilterValueChange","filterDelay","filterTypes","sortTypes","multiSort","nodesKey","isNodeExpanded","isNodeCollapsed","isNodeReadOnly","isNodeSelectable","isNodeSelected","treeSelection","defaultTreeSelection","onTreeSelectionChange","onTreeDataMutations","onNodeCollapse","onNodeExpand","treeExpandState","defaultTreeExpandState","onTreeExpandStateChange"],po=Symbol("DataSource");function mo(){return ry(po)}var{useManagedComponent:sy}=hn({debugName:"DataSource",initSetupState:Ju,forwardProps:ed,concludeReducer:Td,mapPropsToState:nd,onPropChange:od,cleanup:Qu,interceptActions:rd(),mappedCallbacks:id()});function pi(o,t){let e={},n=!0,i=r=>{let a={},l={};for(let u in r)r.hasOwnProperty(u)&&(n||r[u]!==e[u])&&(a[u]=r[u],l[u]=e[u]);e=r,n=!1,Object.keys(a).length!==0&&t(a,l)};fi(()=>i(o())),Fn(o,i,{flush:"post"})}function uy(o){let{state:t,getDataSourceState:e,dataSourceActions:n,reloadedRef:i}=o;pi(()=>({data:t.value.data,dataParams:t.value.dataParams}),()=>{n.lazyLoadCacheOfLoadedBatches=new W});let r=null,a=(s,c,f=e().lazyLoadCacheOfLoadedBatches)=>{let m=e();if(s=s||r,!s)return;let{renderStartIndex:p,renderEndIndex:h}=s,{lazyLoadBatchSize:y,lazyLoad:C}=m;C&&((!y||y<=0)&&(!m.groupBy||m.groupBy.length===0)||$u({startIndex:p,endIndex:h,lazyLoadBatchSize:y,componentState:m,componentActions:n,dismissLoadedRows:c?.dismissLoadedRows??!1},f))},l=null,u=()=>{let s=e().scrollStopDelayUpdatedByTable;return(!l||l.wait!==s)&&(l={wait:s,fn:Jt(a,{wait:s})}),l.fn},d=null;pi(()=>{let s=t.value;return{sortInfo:s.sortInfo,filterValue:s.filterValue,groupBy:s.groupBy,pivotBy:s.pivotBy,refetchKey:s.refetchKey,cursorId:s.livePagination?s.cursorId:null,lazyLoadBatchSize:s.lazyLoadBatchSize,lazyLoad:s.lazyLoad,originalLazyGroupDataChangeDetect:s.originalLazyGroupDataChangeDetect,groupRowsState:s.groupRowsState}},s=>{d?.(),d=null;let{lazyLoad:c,notifyRenderRangeChange:f}=e();c&&(s.sortInfo||s.filterValue||s.groupBy||s.pivotBy||s.refetchKey||s.cursorId?(e().lazyLoadCacheOfLoadedBatches.clear(),e().originalLazyGroupData.clear(),a(f.get(),{dismissLoadedRows:!0}),i.current=!0,Promise.resolve().then(()=>{i.current=!1})):(s.originalLazyGroupDataChangeDetect||s.groupRowsState)&&a(f.get()),d=f.onChange(m=>{r=m,ju(e().lazyLoadCacheOfLoadedBatches),a(m)}))}),Fn(()=>t.value.dataArray,()=>{let{lazyLoadBatchSize:s}=e();s&&s>0&&u()()},{flush:"post"}),ci(()=>{d?.(),d=null})}function dy(o){let{state:t,getDataSourceState:e,dataSourceActions:n}=o,i=()=>t.value.getDataSourceMasterContextRef.current?.()??void 0,r=ly({vertical:!1,horizontal:!1}),a=t.value.notifyScrollbarsChange.onChange(p=>{p&&(r.value=p)});ci(()=>{a()});let l=null;Fn(()=>t.value.livePaginationCursor,p=>{t.value.livePagination&&(l!=null&&cancelAnimationFrame(l),l=requestAnimationFrame(()=>{l=null,r.value?.vertical||p&&(n.cursorId=p)}))},{flush:"post"});let u=null;Fn(()=>[t.value.dataArray.length,t.value.livePaginationCursor],()=>{let{livePagination:p,livePaginationCursor:h,cursorId:y,dataArray:C}=t.value;!p||h!==void 0||(u!=null&&cancelAnimationFrame(u),u=requestAnimationFrame(()=>{u=null,r.value?.vertical||y!=null&&C.length&&(n.cursorId=C.length)}))},{flush:"post"}),Fn(()=>r.value.vertical,p=>{let{livePaginationCursor:h,livePagination:y,dataArray:C}=e();!p&&y&&(h?n.cursorId=h:h===void 0&&C.length&&(n.cursorId=C.length))},{flush:"post"}),ci(()=>{l!=null&&cancelAnimationFrame(l),u!=null&&cancelAnimationFrame(u)});let d=Hu(),s=()=>{let{filterValue:p,filterMode:h,filterTypes:y}=t.value;return d(p,y,h)},c=()=>{let{shouldReloadData:p,sortInfo:h,groupBy:y,pivotBy:C,refetchKey:b,livePagination:w,cursorId:S}=t.value;return{sortInfo:p.sortInfo?h:null,groupBy:p.groupBy?y:null,pivotBy:p.pivotBy?C:null,refetchKey:b,filterValue:p.filterValue?s():null,cursorId:w?S:null}},f={current:!1};uy({state:t,getDataSourceState:e,dataSourceActions:n,reloadedRef:f});let m=[];pi(()=>({data:t.value.data}),()=>{let p=e(),h=i(),{isDetail:y,isDetailReady:C}=Gr(h,e);if(y&&!C)return;let b=Date.now();m.length>=10&&m.splice(0,1),m.push(b),b-m[0]<200&&m.length>=10&&Qr({debugId:p.debugId,key:"DS001"}),typeof p.data!="function"&&Pn(p.data,p,n,void 0,h)}),pi(()=>({...c(),data:t.value.data}),p=>{let h=Object.keys(p),y=!1;if(h.length===1){y=!!p.cursorId;let T=e().data;if(Array.isArray(T)&&p.refetchKey){n.originalDataArray=T;return}}let C=i(),{isDetail:b,isDetailReady:w}=Gr(C,e);if(b&&!w)return;let S=e();if(typeof S.data=="function"){if(f.current&&!y&&Wu(S))return;Pn(S.data,S,n,{append:y},C)}}),fi(()=>{let p=e(),h=xt(p,void 0,i());n.dataParams=h})}function cy(o){let t=ea(),e=!!t(),{contextValue:n}=sy(o),i=n.state,r=n.componentActions,a=n.getComponentState;i.value.getDataSourceMasterContextRef.current=t;let l=md({getState:a,actions:r}),u={state:i,getDataSourceState:a,dataSourceActions:r,dataSourceApi:l,assignState:n.assignState};return ay(po,u),fi(()=>{let d=t();if(d){let s={dataSourceState:i.value,dataSourceActions:r,getDataSourceMasterContext:t,getDataSourceState:a,assignState:u.assignState,dataSourceApi:l};d.registerDetail(s)}}),dy({state:i,getDataSourceState:a,dataSourceActions:r}),Fn(()=>i.value.originalDataArrayChangedInfo,()=>{let d=i.value;d.onDataArrayChange?.(d.originalDataArray,d.originalDataArrayChangedInfo),d.onDataMutations&&d.originalDataArrayChangedInfo.mutations&&d.originalDataArrayChangedInfo.mutations.size&&d.onDataMutations({primaryKeyField:typeof d.primaryKey=="string"?d.primaryKey:void 0,dataArray:d.originalDataArray,mutations:d.originalDataArrayChangedInfo.mutations,timestamp:d.originalDataArrayChangedInfo.timestamp}),d.onTreeDataMutations&&d.originalDataArrayChangedInfo.treeMutations&&d.originalDataArrayChangedInfo.treeMutations.size&&d.onTreeDataMutations({nodesKey:d.nodesKey?d.nodesKey:void 0,dataArray:d.originalDataArray,treeMutations:d.originalDataArrayChangedInfo.treeMutations,timestamp:d.originalDataArrayChangedInfo.timestamp})},{flush:"post"}),fi(()=>{i.value.onReady?.(l)}),ci(()=>{let d=a();d.onCleanup(d)}),u}var na=iy({name:"DataSource",props:[...ta],setup(o,{slots:t}){let e=cy(o);return()=>t.default?.(e.state.value)??null}});import{computed as XC,defineComponent as JC,h as qe,inject as QC,onBeforeUnmount as Ga,onMounted as eT,provide as Np,ref as tT,shallowRef as nT,watch as We,watchEffect as oT}from"vue";import{computed as fy}from"vue";function Lt(o,t,e){let n=null,i;return fy(()=>{let r=o();return(n===null||r.length!==n.length||r.some((a,l)=>!Object.is(a,n[l])))&&(i=t()),n=r,i})}var Nn=(o,t,e={debounce:0})=>{let n=e.debounce??0,i=window.ResizeObserver,r=n?Jt(t,{wait:n}):t,a=new i(l=>{let u=l[0],{width:d,height:s}=u.contentRect;if(u.borderBoxSize?.[0])s=u.borderBoxSize[0].blockSize,d=u.borderBoxSize[0].inlineSize;else{let c=o.getBoundingClientRect();s=c.height,d=c.width}r({width:d,height:s})});return a.observe(o),()=>{a.disconnect()}};var hi=class hi{constructor(t,e){this.keysInOrder=[];if(typeof t=="number")this.maxSize=t,this.currentMap=new Map;else if(this.maxSize=e??hi.DEFAULT_SIZE,t){let n=Array.from(t);this.maxSize<n.length&&n.slice(n.length-this.maxSize),this.currentMap=new Map,n.forEach(([i,r])=>{this.set(i,r)})}else this.currentMap=new Map}values(){return this.currentMap.values()}get size(){return this.currentMap.size}delete(t){return this.currentMap.has(t)?(this.currentMap.delete(t),this.keysInOrder=this.keysInOrder.filter(e=>e!==t),!0):!1}has(t){return this.currentMap.has(t)}get(t){return this.currentMap.get(t)}set(t,e){if(this.has(t)&&this.delete(t),this.maxSize-this.currentMap.size<=0){let[i]=this.keysInOrder.splice(0,1);i!=null&&this.currentMap.delete(i)}return this.keysInOrder.push(t),this.currentMap.set(t,e),this}};hi.DEFAULT_SIZE=10;var mi=hi;var oa=class{add(t,e){}get(t){}delete(t){}has(t){return!1}},gi=class{constructor(t){this.storage=new mi(t)}add(t,e){this.storage.set(t,e)}get(t){return this.storage.get(t)}delete(t){this.storage.delete(t)}has(t){return this.storage.has(t)}},ia=class{constructor(){this.storage=new Map}add(t,e){this.storage.set(t,e)}get(t){return this.storage.get(t)}delete(t){this.storage.delete(t)}has(t){return this.storage.has(t)}},yi=class{constructor(t){this.cacheStorage=t===!1?new oa:t===!0?new ia:typeof t=="number"?new gi(t):new gi(5)}add(t,e){this.cacheStorage.add(t,e)}get(t){return this.cacheStorage.get(t)}delete(t){this.cacheStorage.delete(t)}has(t){return this.cacheStorage.has(t)}};var ut=class extends Dn{constructor(e){super(e);this.isRowDetailsExpanded=e=>!!this.isItemPositive(e)}getState(){let e=this.allPositive?!0:[...this.positiveMap?.keys()??[]],n=this.allNegative?!0:[...this.negativeMap?.keys()??[]];return{expandedRows:e,collapsedRows:n}}getPositiveFromState(e){return e.expandedRows}getNegativeFromState(e){return e.collapsedRows}areAllCollapsed(){return this.areAllNegative()}areAllExpanded(){return this.areAllPositive()}collapseAll(){this.makeAllNegative()}expandAll(){this.makeAllPositive()}isRowDetailsCollapsed(e){return!this.isRowDetailsExpanded(e)}setRowDetailsExpanded(e,n){return this.setItemValue(e,n)}collapseRowDetails(e){this.setRowDetailsExpanded(e,!1)}expandRowDetails(e){this.setRowDetailsExpanded(e,!0)}toggleRowDetails(e){this.toggleItem(e)}};var xd=Bn(Rn());var ra=(o,t)=>o-t,zt={horizontal:!0,vertical:!0};function bi(o,t){let e=t.length;if(!e)return 0;let n=-1;for(let i=0;i<e;i++){let r=0,a=0;if(e-i<=n)break;for(let l=i;l<e;l++)if(r+=t[l],a++,r>o){a>n&&(n=a);break}}return n<0?e:Math.min(n,e)}var Ci={start:0,end:0},aa=o=>{o()},la=o=>{let{start:t,end:e}=o,[n,i]=t,[r,a]=e,l=r-n,u=a-i;return l*u},Pd=o=>{let{start:t,end:e}=o,[n]=t,[i]=e;return i-n},ho=typeof window<"u"?requestAnimationFrame:o=>setTimeout(o,0);function py(o){return o.horizontalChange||o.verticalChange}var ln=class extends et{constructor(e){let n=Mn(e,`${e}:MatrixBrain`);super(n);this.scrolling=!1;this.RENDER_COUNT_SAFETY_MARGIN_START=1;this.RENDER_COUNT_SAFETY_MARGIN_END=1;this.availableWidth=0;this.availableRenderWidth=0;this.isHorizontalLayoutBrain=!1;this.name="";this.availableHeight=0;this.availableRenderHeight=0;this.cols=0;this.rows=0;this.alwaysRenderedColumns=new Set;this._rowsPerPage=0;this.rowHeight=0;this.colWidth=0;this.verticalTotalSize=0;this.horizontalTotalSize=0;this.horizontalRenderCount=void 0;this.verticalRenderCount=void 0;this.maxHorizontalRenderCount=0;this.maxVerticalRenderCount=0;this.horizontalExtendRangeBy=Ci;this.verticalExtendRangeBy=Ci;this.horizontalRenderRange={startIndex:0,endIndex:0};this.verticalRenderRange={startIndex:0,endIndex:0};this.extraSpanCells=[];this.scrollPosition={scrollLeft:0,scrollTop:0};this.onScrollFns=[];this.onRenderRangeChangeFns=new Set;this.onVerticalRenderRangeChangeFns=new Set;this.onHorizontalRenderRangeChangeFns=new Set;this.onDestroyFns=[];this.destroyed=!1;this.onRenderCountChangeFns=new Set;this.onAvailableSizeChangeFns=new Set;this.onScrollStartFns=[];this.onScrollStopFns=[];this.scrollTimeoutId=0;this.scrollStopDelay=250;this.fixedColsStart=0;this.fixedColsEnd=0;this.fixedRowsStart=0;this.fixedRowsEnd=0;this.setScrollStopDelay=e=>{this.scrollStopDelay=e};this.getRowCount=()=>this.rows;this.getColCount=()=>this.cols;this.setScrolling=e=>{let n=this.scrolling;this.scrolling=e,e&&(this.scrollTimeoutId&&clearTimeout(this.scrollTimeoutId),this.scrollTimeoutId=setTimeout(()=>{this.setScrolling(!1),this.scrollTimeoutId=0},this.scrollStopDelay)),e!==n&&(e?this.notifyScrollStart():this.notifyScrollStop())};this.notifyScrollStart=()=>{if(this.destroyed)return;let e=this.onScrollStartFns;for(let n=0,i=e.length;n<i;n++)e[n]()};this.notifyScrollStop=()=>{if(this.destroyed)return;let e=this.onScrollStopFns,n=this.scrollPosition,i=this.getRenderRange();for(let r=0,a=e.length;r<a;r++)e[r](n,i)};this.notifyAvailableSizeChange=()=>{if(this.destroyed)return;let e=this.onAvailableSizeChangeFns,n=this.getAvailableSize();e.forEach(i=>{ho(()=>{this.destroyed||e.has(i)&&i(n)})})};this.notifyVerticalRenderRangeChange=(e=!1)=>{if(this.destroyed)return;let n=this.onVerticalRenderRangeChangeFns,i=this.verticalRenderRange,r=e?aa:ho;n.forEach(a=>{r(()=>{this.destroyed||n.has(a)&&a([i.startIndex,i.endIndex])})})};this.notifyHorizontalRenderRangeChange=(e=!1)=>{if(this.destroyed)return;let n=this.onHorizontalRenderRangeChangeFns,i=this.horizontalRenderRange,r=e?aa:ho;n.forEach(a=>{r(()=>{this.destroyed||n.has(a)&&a([i.startIndex,i.endIndex])})})};this.isColFixedEnd=e=>this.fixedColsEnd?e>=this.cols-this.fixedColsEnd:!1;this.isColFixedStart=e=>this.fixedColsStart?e<this.fixedColsStart:!1;this.isRowFixedEnd=e=>this.fixedRowsEnd?e>=this.rows-this.fixedRowsEnd:!1;this.isRowFixedStart=e=>this.fixedRowsStart?e<this.fixedRowsStart:!1;this.isColFixed=e=>this.isColFixedStart(e)||this.isColFixedEnd(e);this.isRowFixed=e=>this.isRowFixedStart(e)||this.isRowFixedEnd(e);this.getFixedEndColsWidth=()=>{if(!this.fixedColsEnd)return 0;let e=0;for(let n=this.cols-this.fixedColsEnd;n<this.cols;n++)e+=this.getColWidth(n);return e};this.getFixedEndColsOffsets=({skipScroll:e}={skipScroll:!1})=>{if(!this.fixedColsEnd)return[];let{scrollLeft:n}=this.scrollPosition,{width:i}=this.getAvailableSize(),r=[],a=[],l=0;for(let s=this.cols-this.fixedColsEnd;s<this.cols;s++){let c=this.getColWidth(s);a.push(c),l+=c}let u=i-l+(e?0:n);l=0;let d=0;for(let s=this.cols-this.fixedColsEnd;s<this.cols;s++){let c=u+l;r[s]=c,l+=a[d],d++}return r};this.getFixedEndRowsOffsets=({skipScroll:e}={skipScroll:!1})=>{if(!this.fixedRowsEnd)return[];let{scrollTop:n}=this.scrollPosition,{height:i}=this.getAvailableSize(),r=[],a=[],l=0;for(let s=this.rows-this.fixedRowsEnd;s<this.rows;s++){let c=this.getRowHeight(s);a.push(c),l+=c}let u=i-l+(e?0:n);l=0;let d=0;for(let s=this.rows-this.fixedRowsEnd;s<this.rows;s++){let c=u+l;r[s]=c,l+=a[d],d++}return r};this.getFixedStartColsWidth=()=>{if(!this.fixedColsStart)return 0;let e=0;for(let n=0;n<this.fixedColsStart;n++)e+=this.getColWidth(n);return e};this.getFixedEndRowsHeight=()=>{if(!this.fixedRowsEnd)return 0;let e=0;for(let n=this.rows-this.fixedRowsEnd;n<this.rows;n++)e+=this.getRowHeight(n);return e};this.getFixedStartRowsHeight=()=>{if(!this.fixedRowsStart)return 0;let e=0;for(let n=0;n<this.fixedRowsStart;n++)e+=this.getRowHeight(n);return e};this.computeRenderCount=(e=zt)=>{let n=e.horizontal,i=e.vertical,r=this.horizontalRenderCount||0,a=this.verticalRenderCount||0;return n&&(r=this.computeDirectionalRenderCount("horizontal",this.colWidth,this.cols,this.getAvailableRenderSize())),i&&(a=this.computeDirectionalRenderCount("vertical",this.rowHeight,this.rows,this.getAvailableRenderSize())),{horizontal:r,vertical:a}};this.setRenderCount=({horizontal:e,vertical:n})=>{e===void 0&&(e=this.horizontalRenderCount),n===void 0&&(n=this.verticalRenderCount);let i=e===this.horizontalRenderCount,r=n===this.verticalRenderCount;i&&r||(this.horizontalRenderCount=e,this.verticalRenderCount=n,this.updateRenderRange({horizontal:!i,vertical:!r}),this.notifyRenderCountChange())};this.updateFixedCells=e=>{e.fixedColsStart!=this.fixedColsStart&&(this.fixedColsStart=e.fixedColsStart||0),e.fixedColsEnd!=this.fixedColsEnd&&(this.fixedColsEnd=e.fixedColsEnd||0),e.fixedRowsStart!=this.fixedRowsStart&&(this.fixedRowsStart=e.fixedRowsStart||0),e.fixedRowsEnd!=this.fixedRowsEnd&&(this.fixedRowsEnd=e.fixedRowsEnd||0)};this.getFixedCellInfo=()=>{let{fixedRowsStart:e,fixedColsStart:n,fixedRowsEnd:i,fixedColsEnd:r}=this;return{fixedRowsStart:e,fixedColsStart:n,fixedRowsEnd:i,fixedColsEnd:r}};this.updateRenderRange=(e=zt)=>{this.setRenderRange(this.computeRenderRange(e))};this.getExtraSpanCellsForRange=({horizontal:e,vertical:n})=>{let{colspan:i,rowspan:r}=this,a=[];if(r){let l=n.startIndex,u=e.startIndex,d=e.endIndex;for(let s=u;s<d;s++){this.computeItemSpanUpTo(l,s,"vertical");let c=this.rowspanParent.get(s);if(c[l]!=l){let f=l;for(;c[f]!=f;)f--;a.push([f,s])}}}if(i){let l=e.startIndex,u=n.startIndex,d=n.endIndex;for(let s=u;s<d;s++){this.computeItemSpanUpTo(s,l,"horizontal");let c=this.colspanParent.get(s);if(c[l]!=l){let f=l;for(;c[f]!=f;)f--;a.push([s,f])}}}return a};this.computeRenderRange=(e=zt)=>{let n=e.horizontal?this.computeDirectionalRenderRange("horizontal"):this.horizontalRenderRange,i=e.vertical?this.computeDirectionalRenderRange("vertical"):this.verticalRenderRange;return{horizontal:n,vertical:i,extraCells:this.getExtraSpanCellsForRange({horizontal:n,vertical:i})}};this.computeDirectionalRenderRange=e=>{let n=e==="horizontal"?this.colWidth:this.rowHeight,i=e==="horizontal"?this.horizontalRenderCount:this.verticalRenderCount,r=e==="horizontal"?this.cols:this.rows;if(!i)return{startIndex:0,endIndex:0};let a=(e==="horizontal"?this.fixedColsStart:this.fixedRowsStart)||0,l=e==="horizontal"?this.scrollPosition.scrollLeft:this.scrollPosition.scrollTop;l+=this.getFixedStartSize(e);let u=typeof n!="function",d=e==="horizontal"?this.horizontalExtendRangeBy:this.verticalExtendRangeBy,s=this.getItemAt(l,e),c=d.start||0,f=d.end||0;u||(c+=this.RENDER_COUNT_SAFETY_MARGIN_START,f+=this.RENDER_COUNT_SAFETY_MARGIN_END),c&&(s=Math.max(0,s-c),i+=c),f&&(i+=f);let m=s+i,p=Math.max(a,r-(e==="horizontal"?this.fixedColsEnd:this.fixedRowsEnd));return m>p&&(m=p,s=Math.max(a,m-i)),{startIndex:s,endIndex:m}};this.getItemAt=(e,n)=>{let i=n==="horizontal"?this.colWidth:this.rowHeight,r=n==="horizontal"?this.cols:this.rows;if(typeof i!="function")return Math.min(Math.max(0,Math.floor(e/i)),r-1);let a=n==="horizontal"?this.colOffsetCache:this.rowOffsetCache,l=n==="horizontal"?this.colWidthCache:this.rowHeightCache,u=a.length-1,d=l.length-1,s=a[u],c;for(;s<e;)if(u>=r||(d+=1,this.computeCacheFor(d,n),c=s,s=a[d],c===s&&c!=0))return r-1;let f=(0,xd.default)(a,e,ra);return f>=0?f:~f-1};this.computeCacheFor=(e,n)=>{let i=n==="horizontal"?this.colWidth:this.rowHeight,r=n==="horizontal"?this.colWidthCache:this.rowHeightCache,a=n==="horizontal"?this.colOffsetCache:this.rowOffsetCache;if(typeof i!="function")return;let l=i(e);if(r[e]=l,e>0){let u=a[e-1],d=r[e-1];u==null&&console.error(`Offset was not available for ${n==="horizontal"?"col":"row"} ${e-1}`),d==null&&console.error(`Size was not available for ${n==="horizontal"?"col":"row"} ${e-1}`);let s=u+d;a[e]=s}};this.computeItemSpanUpTo=(e,n,i)=>{let r=i==="horizontal"?n:e,a=i==="horizontal"?e:n,l=i==="horizontal"?this.cols:this.rows,u=i==="horizontal"?this.colspan:this.rowspan;if(!u)return;let d=i==="horizontal"?this.colspanParent:this.rowspanParent;d.has(a)||d.set(a,[]);let s=i==="horizontal"?this.colspanValue:this.rowspanValue;s.has(a)||s.set(a,[]);let c=d.get(a),f=s.get(a);if(c[r]===void 0){let m=c.length,p=l?Math.min(r,l-1):0,h={rowIndex:e,colIndex:n};for(;m<=p;m++)if(c[m]===void 0){h[i==="horizontal"?"colIndex":"rowIndex"]=m;let y=u(h);c[m]=m,f[m]=y;let C=m;for(;y>1;)C+=1,c[C]=m,f[C]=0,y-=1}}};this.getCellSpan=(e,n,i)=>{let r=i==="horizontal"?this.colspan:this.rowspan,a=i==="horizontal"?n:e,l=i==="horizontal"?e:n;if(!r)return 1;let u=i==="horizontal"?this.colspanValue:this.rowspanValue,d=u.get(l);return(!d||d[a]===void 0)&&this.computeItemSpanUpTo(e,n,i),d||(d=u.get(l)),d[a]||1};this.getRowspan=(e,n)=>this.getCellSpan(e,n,"vertical");this.getColspan=(e,n)=>this.getCellSpan(e,n,"horizontal");this.getRowspanParent=(e,n)=>this.getItemSpanParent(e,n,"vertical");this.getColspanParent=(e,n)=>this.getItemSpanParent(e,n,"horizontal");this.getItemSpanParent=(e,n,i)=>{let r=i=="horizontal"?this.colspan:this.rowspan,a=i==="horizontal"?n:e,l=i==="horizontal"?e:n;if(!r)return a;let u=i==="horizontal"?this.colspanParent:this.rowspanParent,d=u.get(l);return(!d||d[a]===void 0)&&this.computeItemSpanUpTo(e,n,i),d||(d=u.get(l)),d[a]};this.getRowHeightWithSpan=(e,n,i)=>this.getItemSizeWithSpan(e,n,i,"vertical");this.getColWidthWithSpan=(e,n,i)=>this.getItemSizeWithSpan(e,n,i,"horizontal");this.getItemSizeWithSpan=(e,n,i,r)=>{let a=r==="horizontal"?n:e,l=this.getItemSize(a,r);for(;i>1;)a+=1,i-=1,l+=this.getItemSize(a,r);return l};this.getRowHeight=e=>this.getItemSize(e,"vertical");this.getColWidth=e=>this.getItemSize(e,"horizontal");this.getItemSize=(e,n)=>{let i=n==="horizontal"?this.cols:this.rows,r=n==="horizontal"?this.colWidth:this.rowHeight;if(typeof r!="function")return r;let a=this.getItemSizeCacheFor(e,n),l=n==="horizontal"?this.colWidthCache:this.rowHeightCache;if(a===void 0){let u=l.length,d=Math.min(e,i-1);for(;u<=d;u++)this.computeCacheFor(u,n);a=this.getItemSizeCacheFor(e,n)}return a};this.keepColumnRendered=e=>(this.alwaysRenderedColumns.add(e),()=>{this.alwaysRenderedColumns.delete(e)});this.getAlwaysRenderedColumns=()=>Array.from(this.alwaysRenderedColumns);this.setRenderRange=({horizontal:e,vertical:n,extraCells:i})=>{let r=!1;(e.startIndex!==this.horizontalRenderRange.startIndex||e.endIndex!==this.horizontalRenderRange.endIndex)&&(this.horizontalRenderRange=e,r=!0);let a=!1;(n.startIndex!==this.verticalRenderRange.startIndex||n.endIndex!==this.verticalRenderRange.endIndex)&&(this.verticalRenderRange=n,a=!0),this.extraSpanCells=i||[],(r||a)&&this.notifyRenderRangeChange(),a&&this.notifyVerticalRenderRangeChange(),r&&this.notifyHorizontalRenderRangeChange()};this.getRenderRangeCellCount=la;this.getMaxCellCount=()=>this.maxHorizontalRenderCount*this.maxVerticalRenderCount;this.getExtraCells=()=>this.extraSpanCells;this.getScrollPosition=()=>this.scrollPosition;this.getRenderRange=()=>({start:[this.verticalRenderRange.startIndex,this.horizontalRenderRange.startIndex],end:[this.verticalRenderRange.endIndex,this.horizontalRenderRange.endIndex]});this.onScroll=e=>(this.onScrollFns.push(e),()=>{this.onScrollFns=this.onScrollFns.filter(n=>n!==e)});this.onScrollStart=e=>(this.onScrollStartFns.push(e),()=>{this.onScrollStartFns=this.onScrollStartFns.filter(n=>n!==e)});this.onScrollStop=e=>(this.onScrollStopFns.push(e),()=>{this.onScrollStopFns=this.onScrollStopFns.filter(n=>n!==e)});this.onRenderRangeChange=e=>(this.onRenderRangeChangeFns.add(e),()=>{this.onRenderRangeChangeFns.delete(e)});this.onVerticalRenderRangeChange=e=>(this.onVerticalRenderRangeChangeFns.add(e),()=>{this.onVerticalRenderRangeChangeFns.delete(e)});this.onHorizontalRenderRangeChange=e=>(this.onHorizontalRenderRangeChangeFns.add(e),()=>{this.onHorizontalRenderRangeChangeFns.delete(e)});this.onRenderCountChange=e=>(this.onRenderCountChangeFns.add(e),()=>{this.onRenderCountChangeFns.delete(e)});this.onAvailableSizeChange=e=>(this.onAvailableSizeChangeFns.add(e),()=>{this.onAvailableSizeChangeFns.delete(e)});this.onDestroy=e=>(this.onDestroyFns.push(e),()=>{this.onDestroyFns=this.onDestroyFns.filter(n=>n!==e)});this.getAvailableSize=()=>({width:this.availableWidth,height:this.availableHeight});this.getAvailableRenderSize=()=>({width:this.availableRenderWidth??this.availableWidth,height:this.availableRenderHeight??this.availableHeight});this.name=n,this.update=this.update.bind(this),this.destroy=this.destroy.bind(this),this.getCellOffset=this.getCellOffset.bind(this),this.reset()}set rowsPerPage(e){e!=this._rowsPerPage&&(this._rowsPerPage=e)}get rowsPerPage(){return this._rowsPerPage}reset(e=zt){e.vertical&&this.resetVertical(),e.horizontal&&this.resetHorizontal(),this.extraSpanCells=[]}resetVertical(){this.rowspanParent=new Map,this.rowspanValue=new Map,this.rowHeightCache=[],this.rowOffsetCache=[0],this.verticalRenderCount=void 0,this.verticalTotalSize=0,this.verticalRenderRange={startIndex:0,endIndex:0}}resetHorizontal(){this.colspanParent=new Map,this.colspanValue=new Map,this.colWidthCache=[],this.colOffsetCache=[0],this.horizontalRenderCount=void 0,this.horizontalTotalSize=0,this.horizontalRenderRange={startIndex:0,endIndex:0}}getVirtualColIndex(e,n){return e}update(e,n){let{rows:i,cols:r,rowHeight:a,colWidth:l,width:u,height:d}=e,s=typeof u=="number",c=typeof d=="number",f=s&&u!==this.availableWidth,m=c&&d!==this.availableHeight;f&&(this.availableWidth=u,this.availableRenderWidth=u),m&&(this.availableHeight=d,this.availableRenderHeight=d),(f||m)&&this.notifyAvailableSizeChange();let p=typeof i=="number",h=typeof r=="number",y=p&&i!==this.rows,C=h&&r!==this.cols;p&&(this.rows=i,this.rowsPerPage=i),h&&(this.cols=r);let b=a!=null,w=l!=null,S=b&&a!==this.rowHeight,T=w&&l!==this.colWidth;b&&(this.rowHeight=a),w&&(this.colWidth=l);let I=e.rowspan!=null,x=e.colspan!=null,F=I&&e.rowspan!=this.rowspan,N=x&&e.colspan!=this.colspan;F&&(this.rowspan=e.rowspan),N&&(this.colspan=e.colspan);let R=C||T||f||N,A=y||S||m||F;(n||py)({horizontalChange:R,verticalChange:A,colsChanged:C,colWidthChanged:T,widthChanged:f,colspanChanged:N,rowsChanged:y,rowHeightChanged:S,heightChanged:m,rowspanChanged:F})&&this.updateRenderCount({horizontal:R,vertical:A})}extendRenderRange(e){let{direction:n}=e,i=n==="horizontal",r=i?this.horizontalRenderCount||this.getInitialCols():this.verticalRenderCount||this.getInitialRows(),a=typeof e.start=="number"?e.start:e.start===!0?r:0,l=typeof e.end=="number"?e.end:e.end===!0?r:0;return i?this.horizontalExtendRangeBy={start:a,end:l}:this.verticalExtendRangeBy={start:a,end:l},this.updateRenderRange({horizontal:i,vertical:!i}),()=>{this.extendRenderRange({start:0,end:0,direction:n})}}updateRenderCount(e=zt){this.reset(e),this.doUpdateRenderCount(e)}doUpdateRenderCount(e=zt){if(!this.availableWidth||!this.availableHeight){let n={horizontal:void 0,vertical:void 0};this.availableWidth||(n.horizontal=0),this.availableHeight||(n.vertical=0),this.setRenderCount(n)}this.setRenderCount(this.computeRenderCount(e))}get scrollTopMax(){return this.getVirtualizedContentSize().height-this.availableHeight}get scrollLeftMax(){return this.getVirtualizedContentSize().width-this.availableWidth}setScrollPosition(e,n){this.setScrolling(!0);let i=e.scrollLeft!==this.scrollPosition.scrollLeft,r=e.scrollTop!==this.scrollPosition.scrollTop;this.scrollPosition=e,(i||r)&&(n?.(e),this.updateRenderRange({horizontal:i,vertical:r}),this.notifyScrollChange())}notifyRenderRangeChange(e=!1){if(this.destroyed)return;let n=this.onRenderRangeChangeFns,i=this.getRenderRange(),r=e?aa:ho;n.forEach(a=>{r(()=>{this.destroyed||n.has(a)&&a(i)})})}notifyScrollChange(){if(this.destroyed)return;let{scrollPosition:e}=this,n=this.onScrollFns;for(let i=0,r=n.length;i<r;i++)n[i](e)}computeDirectionalRenderCount(e,n,i,r){let a=0,l=e==="horizontal"?r.width:r.height;if(l-=this.getFixedSize(e),l<=0)return 0;let u=e==="horizontal"?this.fixedColsStart:this.fixedRowsStart,d=e==="horizontal"?this.fixedColsEnd:this.fixedRowsEnd;if(typeof n=="function"){let s=[],c=0,f=i;c+=u,f-=d;for(let m=c;m<f;m++)s.push(this.getItemSize(m,e));a=bi(l,s)}else a=(n?Math.ceil(l/n):0)+1;return a+=u+d,e==="horizontal"?this.maxHorizontalRenderCount=a:this.maxVerticalRenderCount=a,a=Math.min(i,a),a}getFixedSize(e){return e==="horizontal"?this.getFixedStartColsWidth()+this.getFixedEndColsWidth():this.getFixedStartRowsHeight()+this.getFixedEndRowsHeight()}getFixedStartSize(e){return e==="horizontal"?this.getFixedStartColsWidth():this.getFixedStartRowsHeight()}getFixedEndSize(e){return e==="horizontal"?this.getFixedEndColsWidth():this.getFixedEndRowsHeight()}notifyRenderCountChange(){if(this.destroyed)return;let{horizontalRenderCount:e,verticalRenderCount:n}=this,i={horizontal:e,vertical:n},r=this.onRenderCountChangeFns;r.forEach(a=>{ho(()=>{this.destroyed||r.has(a)&&a(i)})})}getCellOffset(e,n){return{x:this.getItemOffsetFor(n,"horizontal"),y:this.getItemOffsetFor(e,"vertical")}}getInitialRowHeight(){return this.rowHeight}getInitialCols(){return this.cols}getInitialRows(){return this.rows}getItemOffsetFor(e,n){let i=n==="horizontal"?this.colWidth:this.rowHeight;if(typeof i!="function")return e*i;let r=n==="horizontal"?this.colOffsetCache:this.rowOffsetCache,a=n==="horizontal"?this.colWidthCache:this.rowHeightCache,l=r[e];if(l==null){let u=a.length-1;for(;u<e;)u+=1,this.computeCacheFor(u,n);l=r[e]}return l}getItemSizeCacheFor(e,n){return(n==="horizontal"?this.colWidthCache:this.rowHeightCache)[e]}getRowIndexInPage(e){return e}getPageIndexForRow(e){return 0}getVirtualizedContentSize(){return{height:this.getVirtualizedContentSizeFor("vertical"),width:this.getVirtualizedContentSizeFor("horizontal")}}getVirtualizedContentSizeFor(e){let n=e==="horizontal"?this.cols:this.rows,i=e==="horizontal"?this.colWidth:this.rowHeight,r=e==="horizontal"?this.horizontalTotalSize:this.verticalTotalSize;if(typeof i!="function")return i*n;if(r!==0&&!isNaN(r))return r;let a=e==="horizontal"?this.colOffsetCache:this.rowOffsetCache,l=n?this.getItemSize(n-1,e):0,u=n?a[n-1]:0,d=l+u;return e==="horizontal"?this.horizontalTotalSize=d:this.verticalTotalSize=d,d}notifyDestroy(){let e=this.onDestroyFns;for(let n=0,i=e.length;n<i;n++)e[n]()}destroy(){this.destroyed||(this.notifyDestroy(),this.reset(),this.rowspanParent.clear(),this.colspanParent.clear(),this.alwaysRenderedColumns.clear(),this.horizontalExtendRangeBy=Ci,this.verticalExtendRangeBy=Ci,this.destroyed=!0,this.onDestroyFns=[],this.onScrollFns=[],this.onScrollStartFns=[],this.onScrollStopFns=[],this.onRenderCountChangeFns.clear(),this.onRenderRangeChangeFns.clear(),this.onVerticalRenderRangeChangeFns.clear(),this.onHorizontalRenderRangeChangeFns.clear())}};var my={scrollLeft:0,scrollTop:0},go=class{constructor(){this.scrollPosition=my;this.onScrollFns=[];this.getScrollPosition=()=>this.scrollPosition;this.onScroll=t=>(this.onScrollFns.push(t),()=>{this.onScrollFns=this.onScrollFns.filter(e=>e!==t)});this.setScrollPosition=t=>{this.scrollPosition=t,this.notifyScrollChange()};this.destroy=()=>{this.onScrollFns=[]}}notifyScrollChange(){let{scrollPosition:t}=this,e=this.onScrollFns;for(let n=0,i=e.length;n<i;n++)e[n](t)}};var{rootClassName:hy}=Le,mt=`${hy}ColumnCell`;function Dd(o,t){let e=new Map;function n(i){return t[i]!==!1}return Object.keys(o).forEach(i=>{let a=o[i].columnGroup,l=0;for(n(i)||(l=-1);a;){let u=o[a];if(!u)break;n(a)&&l++,a=u.columnGroup}e.set(i,l)}),e}import{h as gy}from"vue";function Ad(o){return(t,e)=>gy(o,{key:t.id,rowInfo:t,cache:e})}var yo=class extends ln{constructor(e,n){super(`${e}:HorizontalLayout`);this.visiblePageCount=0;this.isHorizontalLayoutBrain=!0;this._totalPageCount=0;this.pageWidth=0;this.initialCols=0;this.initialRows=0;this.initialColWidth=0;this.colWidth=()=>10;this.getColWidth=e=>typeof this.initialColWidth=="number"?this.initialColWidth:this.initialColWidth(e%this.initialCols);this.onTotalPageCountChangeFns=new Set;this.onTotalPageCountChange=e=>(this.onTotalPageCountChangeFns.add(e),()=>{this.onTotalPageCountChangeFns.delete(e)});this.options=n,this.options.masterBrain&&this.options.masterBrain.onTotalPageCountChange(()=>{this.updateRenderCount({horizontal:!0,vertical:!0})})}computeDirectionalRenderCount(e,n,i,r){if(e==="vertical"||typeof n=="number")return super.computeDirectionalRenderCount(e,n,i,r);let a=0,l=r.width,u=Math.floor(l/this.pageWidth);a+=u*this.initialCols;let d=l-u*this.pageWidth,s=[];for(let c=0;c<this.initialCols;c++)s.push(this.getItemSize(c,e));return a+=bi(d,s.concat(s)),e==="horizontal"?this.maxHorizontalRenderCount=a:this.maxVerticalRenderCount=a,a=Math.min(i,a),a}getRowIndexInPage(e){return this.rowsPerPage?e%this.rowsPerPage:e}getInitialCols(){return this.initialCols}getInitialRows(){return this.initialRows}getPageIndexForRow(e){return Math.floor(e/this.rowsPerPage)}getMatrixCoordinatesForHorizontalLayoutPosition(e){let n=e.rowIndex,i=e.colIndex;return e.rowIndex>=this.rowsPerPage&&this.rowsPerPage>0&&(n=e.rowIndex%this.rowsPerPage,i=Math.floor(e.rowIndex/this.rowsPerPage)*this.initialCols+i),{rowIndex:n,colIndex:i}}getHorizontalLayoutPositionFromMatrixCoordinates(e){let n=e.rowIndex,i=e.colIndex;if(e.colIndex>=this.initialCols&&this.initialCols>0){let r=Math.floor(e.colIndex/this.initialCols);i=e.colIndex-r*this.initialCols,n=this.rowsPerPage*r+e.rowIndex}return{colIndex:Math.min(i,this.initialCols),rowIndex:this.options.isHeader?n:Math.min(n,this.initialRows)}}update(e){let{rows:n,cols:i,rowHeight:r,colWidth:a,width:l,height:u}=e,d=typeof l=="number",s=typeof u=="number",c=d&&l!==this.availableWidth,f=s&&u!==this.availableHeight;c&&(this.availableWidth=l,this.availableRenderWidth=l),f&&(this.availableHeight=u,this.availableRenderHeight=u),(c||f)&&this.notifyAvailableSizeChange();let m=typeof n=="number",p=typeof i=="number",h=m&&n!==this.initialRows,y=p&&i!==this.initialCols;m&&h&&(this.initialRows=n,this.rows=n),p&&y&&(this.initialCols=i,this.cols=i);let C=r!=null,b=a!=null,w=C&&r!==this.rowHeight,S=b&&a!==this.initialColWidth;C&&(this.rowHeight=r),b&&(this.initialColWidth=a,this.colWidth=this.getColWidth);let T=h||w||f,I=y||S||c||T;(I||T)&&this.updateRenderCount({horizontal:I,vertical:T})}getInitialRowHeight(){return typeof this.rowHeight!="number"?this.getRowHeight(0):this.rowHeight}get totalPageCount(){return this.options.masterBrain?this.options.masterBrain.totalPageCount:this._totalPageCount}set totalPageCount(e){this.options.masterBrain||(this._totalPageCount=e)}getPageWidth(){return this.pageWidth}doUpdateRenderCount(e=zt){let n=this.getInitialRowHeight(),i=0;for(let a=0;a<this.initialCols;a++)i+=this.getColWidth(a);this.pageWidth=i,this.rowsPerPage=Math.floor(this.availableHeight/n);let r=!1;if(!this.options.masterBrain){let a=this.totalPageCount;this.totalPageCount=this.rowsPerPage?Math.ceil(this.initialRows/this.rowsPerPage):0,a!=this.totalPageCount&&(r=!0)}this.visiblePageCount=this.totalPageCount&&this.pageWidth?Math.max(Math.ceil(this.availableWidth/this.pageWidth),1):1,this.availableRenderHeight=this.visiblePageCount*this.rowsPerPage*n,this.cols=Math.max(this.totalPageCount*this.initialCols,this.initialCols),this.rows=this.rowsPerPage,super.doUpdateRenderCount(e),r&&this.notifyTotalPageCountChange()}notifyTotalPageCountChange(){if(this.destroyed)return;let e=this.onTotalPageCountChangeFns;e.forEach(n=>{ke(()=>{this.destroyed||e.has(n)&&n(this.totalPageCount)})})}getVirtualColIndex(e,n){return this.initialCols*(n?.pageIndex??0)+e}destroy(){this.destroyed||(super.destroy(),this.options.masterBrain=void 0,this.onTotalPageCountChangeFns.clear())}getVirtualizedContentSizeFor(e){return e==="vertical"?this.getInitialRowHeight()*this.rowsPerPage:this.pageWidth*this.totalPageCount}};var sa=Bn(Rn());function _d(...o){if(!o.length)return new Set;let[t,...e]=o;return new Set([...t].filter(n=>e.every(i=>i.has(n))))}function Md(o,t){let e=new Set;for(let n of o)t(n)&&e.add(n);return e}function bo(o,t){for(let e of o)if(t(e))return e}var Ti=(o,t)=>o-t,Si=class extends et{constructor(e,n){super(`${e}:GridCellManager`);this.matrix=new W;this.rowsWithCellsHistory=new Map;this.columnsWithCellsHistory=new Map;this.cellToMatrixPosition=new WeakMap;this.getCellsOutsideRenderRange=e=>{let{start:n,end:i}=e,[r,a]=n,[l,u]=i,d=new Set;return this.matrix.visit(({value:s},c)=>{if(!s)return;let[f,m]=c,p=f<r,h=f>=l,y=m<a,C=m>=u;(p||h||y||C)&&d.add(s)}),d};this.debugId=e,this.pool=n,this.offRemoveCell=this.pool.onRemoveCell(i=>this.onRemoveCell(i))}onRemoveCell(e){let n=this.cellToMatrixPosition.get(e);this.cellToMatrixPosition.delete(e),n&&this.clearCellFromMatrix(e,n,{skipHistory:!1})}set poolSize(e){this.pool.poolSize=e}get poolSize(){return this.pool.poolSize}getDetachedCell(){return this.pool.getDetachedCell()}clearCellFromMatrix(e,n,i){if(this.matrix.delete(n),i.skipHistory)return;let[r,a]=n,l=this.rowsWithCellsHistory.get(r),u=this.columnsWithCellsHistory.get(a);l&&(l.delete(e),l.size===0&&this.rowsWithCellsHistory.delete(r)),u&&(u.delete(e),u.size===0&&this.columnsWithCellsHistory.delete(a))}addCellToMatrix(e,n){let[i,r]=n;this.matrix.set(n,e),this.cellToMatrixPosition.set(e,n);let a=this.rowsWithCellsHistory.get(i),l=this.columnsWithCellsHistory.get(r);a?a.add(e):(a=new Set,a.add(e),this.rowsWithCellsHistory.set(i,a)),l?l.add(e):(l=new Set,l.add(e),this.columnsWithCellsHistory.set(r,l))}setCellPositionInMatrix(e,n){let i=this.cellToMatrixPosition.get(e);if(n==null){i&&this.clearCellFromMatrix(e,i,{skipHistory:!0});return}let[r,a]=n,l=i&&i[0]===r&&i[1]===a;i&&!l&&this.clearCellFromMatrix(e,i,{skipHistory:!1}),this.addCellToMatrix(e,n)}renderNodeAtCell(e,n,i,r){let a=this.getCellAt(i);return a&&a!==n&&this.detachCellAt(i),this.pool.attachCell(n),this.setCellPositionInMatrix(n,i),n.update(e,r),n}getCellPosition(e){let n=this.cellToMatrixPosition.get(e);return!n||this.getCellAt(n)!=e?null:n}getCellAt(e){return this.matrix.get(e)}getCellFor(e,n){let i=this.getCellAt(e);if(i)return i;let[r,a]=e;if(n==="row"){let l=this.rowsWithCellsHistory.get(r);l&&(i=bo(l,u=>!this.isCellAttached(u)))}if(n==="column"){let l=this.columnsWithCellsHistory.get(a);l&&(i=bo(l,u=>!this.isCellAttached(u)))}return i??this.getDetachedCell()}isCellAttached(e){return this.getCellPosition(e)!==null}isCellAttachedAt(e){let n=this.getCellAt(e);return n?this.isCellAttached(n):!1}getMatrix(){let e=this.getRowsWithCells().pop()??-1,n=this.getColumnsWithCells().pop()??-1;return Array.from({length:e+1},(r,a)=>Array.from({length:n+1},(u,d)=>{let s=[a,d],c=this.getCellAt(s);return c?c.getNode():null}))}getAllCells(){return[...this.pool.getAllCells()]}getCellsForRow(e){return this.matrix.getKeysStartingWith([e]).map(n=>this.getCellAt(n)).filter(Boolean)}getOneAttachedCell(){return this.pool.getAttachedCells().values().next().value}getRowsWithCells(){return this.matrix.rawKeysAt([]).sort(Ti)}getColumnsWithCells(){let e=this.matrix.getKeysOfFirstChildOnEachBranchStartingWith([],{excludeSelf:!0});return[...new Set(e.map(i=>i[1])).values()].sort(Ti)}isRowAttached(e){return this.getRowsWithCells().includes(e)}isColumnAttached(e){return this.getColumnsWithCells().includes(e)}detachRow(e){this.matrix.getKeysStartingWith([e]).forEach(i=>this.detachCellAt(i))}detachCol(e){this.matrix.visit((n,i)=>{i[1]===e&&this.detachCellAt(i)})}detachCell(e){return e?(this.pool.detachCell(e)&&this.setCellPositionInMatrix(e,null),!0):!1}detachCells(e){e.forEach(n=>this.detachCell(n))}detachRowsStartingWith(e){let n=this.getRowsWithCells().sort(),i=(0,sa.default)(n,e,Ti);i<0&&(i=~i),n.slice(i).forEach(a=>this.detachRow(a))}detachColsStartingWith(e){let n=this.getColumnsWithCells().sort(),i=(0,sa.default)(n,e,Ti);i<0&&(i=~i),n.slice(i).forEach(a=>this.detachCol(a))}detachCellsStartingAt(e){let[n,i]=e;this.matrix.visit((r,a)=>{let[l,u]=a;l>n&&this.detachCellAt(a),l===n&&u>=i&&this.detachCellAt(a)})}detachCellAt(e){let n=this.getCellAt(e);return n?this.detachCell(n):!1}onCellAttachmentChange(e){return this.pool.onCellAttachmentChange(e)}getCellFromListForRow(e,n){return bo(e,i=>this.getCellPosition(i)?.[0]===n)}getCellFromListForColumn(e,n){return bo(e,i=>this.getCellPosition(i)?.[1]===n)}getCellCountInMatrix(){return this.matrix.size}flushPendingAfterCommitWork(){this.pool.flushPendingAfterCommitWork()}destroy(){this.reset()}reset(){this.pool.reset(),this.matrix.clear(),this.rowsWithCellsHistory.clear(),this.columnsWithCellsHistory.clear(),this.offRemoveCell(),this.offRemoveCell=()=>{}}makeDetachedCellsEmpty(){this.pool.getDetachedCells().forEach(e=>{e.update(null)})}withDetachedCells(e){this.pool.getDetachedCells().forEach(e)}};var Ed=Bn(Rn());var wi=class extends et{constructor(e,n){super(`${e}:ListRowManager`);this.indexToRow=new Map;this.rowToIndex=new WeakMap;this.debugId=e,this.pool=n,this.offRemoveRow=this.pool.onRemoveRow(i=>this.onRemoveRow(i))}onRemoveRow(e){let n=this.rowToIndex.get(e);n!=null&&(this.rowToIndex.delete(e),this.indexToRow.delete(n))}set poolSize(e){this.pool.poolSize=e}get poolSize(){return this.pool.poolSize}getDetachedRow(){return this.pool.getDetachedRow()}getRowFor(e){return this.getRowAt(e)??this.getDetachedRow()}setRowIndexInList(e,n){let i=this.rowToIndex.get(e);i!=null&&this.indexToRow.delete(i),n==null?this.rowToIndex.delete(e):(this.rowToIndex.set(e,n),this.indexToRow.set(n,e))}detachStartingWith(e){let n=this.getAttachedIndexes(),i=(0,Ed.default)(n,e,(a,l)=>a-l);i<0&&(i=~i),n.slice(i).forEach(a=>this.detachRowAt(a))}getRowAt(e){return this.indexToRow.get(e)}getRowIndex(e){return this.rowToIndex.get(e)}isRowAttached(e){return this.getRowIndex(e)!=null}isRowAttachedAt(e){return!!this.getRowAt(e)}getList(){let e=Math.max(...this.indexToRow.keys());return Array.from({length:e+1},(i,r)=>{let a=this.indexToRow.get(r);return a?a.getNode():null})}getAttachedCount(){return this.indexToRow.size}forEachAttachedRow(e){this.indexToRow.forEach(e)}getAttachedIndexes(){return Array.from(this.indexToRow.keys()).sort()}getAllRows(){return[...this.pool.getAllRows()]}detachRowAt(e){let n=this.getRowAt(e);n&&(this.setRowIndexInList(n,null),this.pool.detachRow(n))}detachRow(e){let n=this.getRowIndex(e);n!=null&&this.detachRowAt(n)}renderNodeAtRow(e,n,i){let r=this.getRowAt(i);return r&&r!==n&&this.detachRowAt(i),this.pool.attachRow(n),this.setRowIndexInList(n,i),n.update(e),n}makeDetachedRowsEmpty(){this.pool.getDetachedRows().forEach(e=>{e.update(null)})}onRowAttachmentChange(e){return this.pool.onRowAttachmentChange(e)}withDetachedRows(e){this.pool.getDetachedRows().forEach(e)}destroy(){this.reset()}reset(){this.pool.reset(),this.indexToRow.clear(),this.offRemoveRow(),this.offRemoveRow=()=>{}}};var Fd=!0,sn=U(j.y),Nd=U(j.scrollTop),L1=U(j.columnOffsetAtIndex),ua=U(j.columnOffsetAtIndexWhileReordering),On=class extends et{constructor(e,n,i){n=n||"ReactHeadlessTableRenderer";super(n);this.debugId="";this.destroyed=!1;this.scrolling=!1;this.cellHoverClassNames=[];this.cellDetachedClassNames=[];this.lastEnteredRow=-1;this.lastExitedRow=-1;this.hoverRowUpdatesInProgress=new Map;this.infiniteNode=null;this.setDetailTransform=(e,n,{y:i,scrollTop:r,scrollLeft:a})=>{e.style.setProperty(sn,r?`calc( ${i}px + var(${Nd}) )`:`${i}px`),e.style.transform=`translate3d(${a||0}px, var(${sn}), 0)`};this.setTransform=(e,n,i,{x:r,y:a,scrollLeft:l,scrollTop:u},d)=>{let s=Ce.columnOffsets.get(i),c=`${ua}-${i}`,f=u?`calc( ${a}px + var(${Nd}) )`:`${a}px`;e.__currentTransformY!==f&&(e.__currentTransformY=f,e.style.setProperty(sn,f));let m=`translate3d(var(${c}, ${s}), var(${sn}), 0)`;e.__transformValue!==m&&(e.__transformValue=m,e.style.transform=m),d!=null};this.getFullyVisibleRowsRange=()=>{let{start:[e],end:[n]}=this.brain.getRenderRange();for(;!this.isRowFullyVisible(e);)if(e++,e===n)return null;for(;!this.isRowFullyVisible(n);)if(n--,n===e)return null;return{start:e,end:n}};this.getScrollPositionForScrollRowIntoView=(e,n={offset:0})=>{if(this.destroyed)return null;let{brain:i}=this,r=i.getScrollPosition(),a=r.scrollLeft,{scrollAdjustPosition:l,offset:u=0}=n;if(this.isRowFullyVisible(e)&&!l)return r;let d=i.getItemOffsetFor(e,"vertical"),s=i.getItemSize(e,"vertical"),c=i.getFixedStartRowsHeight(),f=i.getFixedEndRowsHeight(),m=r.scrollTop,p=i.getAvailableSize();if(!p.height)return null;let h=m+p.height;l||(l=d>h-f?"end":d<m+c?"start":"end");let y=r.scrollTop;if(l==="center"?y=d-Math.floor((i.getAvailableSize().height-c-f)/2):l==="start"?(u=-u,y+=d-m+u-c):(u+=s,y+=d-h+u+f),this.brain.isHorizontalLayoutBrain){let C=n.colIndex??Math.ceil(this.brain.getInitialCols()/2),b=this.getScrollPositionForScrollColumnIntoView(C,{...n,horizontalLayoutPageIndex:this.brain.getPageIndexForRow(e)});b&&(a=b.scrollLeft)}return{scrollLeft:a,scrollTop:y}};this.getScrollPositionForScrollColumnIntoView=(e,n={offset:0})=>{if(this.destroyed)return null;let{brain:i}=this,r=i.getScrollPosition(),a=n.horizontalLayoutPageIndex!=null?{horizontalLayoutPageIndex:n.horizontalLayoutPageIndex}:void 0,{scrollAdjustPosition:l,offset:u=0}=n;if(this.isColumnFullyVisible(e,void 0,a)&&!l)return r;a&&(e=i.getInitialCols()*a.horizontalLayoutPageIndex+e);let d=i.getItemOffsetFor(e,"horizontal"),s=i.getItemSize(e,"horizontal"),c=i.getFixedStartColsWidth(),f=i.getFixedStartColsWidth(),m=r.scrollLeft,p=i.getAvailableSize();if(!p.width)return null;let h=m+p.width;l||(l=d>h-f?"end":d<m+c?"start":"end");let y=r.scrollLeft;return l==="center"?y=d-Math.floor((i.getAvailableSize().width-c-f)/2):l==="start"?(u=-u,y+=d-m+u-c):(u+=s,y+=d-h+u+f),{...r,scrollLeft:y}};this.getScrollPositionForScrollCellIntoView=(e,n,i={offsetLeft:0,offsetTop:0})=>{if(this.destroyed)return null;let r=this.getScrollPositionForScrollColumnIntoView(n,{scrollAdjustPosition:i.colScrollAdjustPosition||i.scrollAdjustPosition,offset:i.offsetLeft}),a=this.getScrollPositionForScrollRowIntoView(e,{scrollAdjustPosition:i.rowScrollAdjustPosition||i.scrollAdjustPosition,offset:i.offsetTop});if(!r||!a)return null;let{scrollLeft:l}=r,{scrollTop:u}=a;return{scrollLeft:l,scrollTop:u}};this.isRowFullyVisible=(e,n=2)=>this.isRowVisible(e,this.brain.getRowHeight(e)-n);this.isRowVisible=(e,n=10)=>{if(!this.isRowRendered(e))return!1;e=this.brain.getPageIndexForRow(e)&&this.brain.rowsPerPage?e%this.brain.rowsPerPage:e;let{brain:r}=this;if(r.isRowFixed(e))return!0;let{start:[a],end:[l]}=this.brain.getRenderRange(),u=Math.floor((a+l)/2);if(e<a||e>=l)return!1;if(e>=u){let d=r.getItemAt(r.getAvailableSize().height+r.getScrollPosition().scrollTop-n,"vertical");return e<=d}if(e<u){let d=r.getItemAt(r.getScrollPosition().scrollTop+n,"vertical");return e>=d}return!0};this.isRowRendered=e=>{if(!this.brain.isHorizontalLayoutBrain)return this.cellManager.isRowAttached(e);let n=e;return e=this.brain.rowsPerPage?e%this.brain.rowsPerPage:e,this.cellManager.getCellsForRow(e).filter(i=>i.getAdditionalInfo()?.renderRowIndex===n).length>0};this.isCellVisible=(e,n)=>this.isRowVisible(e)&&this.isColumnVisible(n);this.isCellFullyVisible=(e,n,i)=>this.isRowFullyVisible(e)&&this.isColumnVisible(n,void 0,i);this.isColumnFullyVisible=(e,n=2,i)=>this.isColumnVisible(e,this.brain.getColWidth(e)-n,i);this.isColumnVisible=(e,n=10,i)=>{if(!this.isColumnRendered(e,i))return!1;let{brain:r}=this;if(r.isColFixed(e))return!0;i&&i.horizontalLayoutPageIndex!=null&&(e=r.getVirtualColIndex(e,{pageIndex:i.horizontalLayoutPageIndex}));let{start:[a,l],end:[u,d]}=r.getRenderRange();if(e<l||e>=d)return!1;let s=Math.floor((l+d)/2);if(e>=s){let c=r.getItemAt(r.getAvailableSize().width+r.getScrollPosition().scrollLeft-n-r.getFixedEndColsWidth(),"horizontal");return e<=c}if(e<s){let c=r.getItemAt(r.getScrollPosition().scrollLeft+n+r.getFixedStartColsWidth(),"horizontal");return e>=c}return!0};this.isCellRendered=(e,n,i)=>this.isRowRendered(e)&&this.isColumnRendered(n,i);this.isColumnRendered=(e,n)=>{let{start:[i]}=this.brain.getRenderRange();return n?.horizontalLayoutPageIndex!=null&&(e=this.brain.getInitialCols()*n.horizontalLayoutPageIndex+e),this.cellManager.isCellAttachedAt([i,e])};this.getExtraSpanCellsForRange=e=>{let{start:n,end:i}=e,[r,a]=n,[l,u]=i;return this.brain.getExtraSpanCellsForRange({horizontal:{startIndex:a,endIndex:u},vertical:{startIndex:r,endIndex:l}})};this.getFixedRanges=e=>{let{fixedRowsStart:n,fixedRowsEnd:i,fixedColsStart:r,fixedColsEnd:a}=this.brain.getFixedCellInfo();if(!n&&!r&&!i&&!a)return[];let l=this.brain.getColCount(),u=this.brain.getRowCount(),{start:d,end:s}=e,[c,f]=d,[m,p]=s,h=[];if(r&&(n&&h.push({rowFixed:"start",colFixed:"start",start:[0,0],end:[n,r]}),i&&h.push({rowFixed:"end",colFixed:"start",start:[u-i,0],end:[u,r]}),h.push({rowFixed:!1,colFixed:"start",start:[c,0],end:[m,r]})),a&&(n&&h.push({colFixed:"end",rowFixed:"start",start:[0,l-a],end:[n,l]}),i&&h.push({colFixed:"end",rowFixed:"end",start:[u-i,l-a],end:[u,l]}),h.push({colFixed:"end",rowFixed:!1,start:[c,l-a],end:[m,l]})),n){let y={start:[0,f],end:[n,p],rowFixed:"start",colFixed:!1};h.push(y)}if(i){let y={rowFixed:"end",colFixed:!1,start:[u-i,f],end:[u,p]};h.push(y)}return h};this.isCellFixed=(e,n)=>{let{fixedRowsStart:i,fixedRowsEnd:r,fixedColsStart:a,fixedColsEnd:l}=this.brain.getFixedCellInfo(),u=this.brain.getColCount(),d=this.brain.getRowCount(),s=!1,c=!1,f=!1;if(e<i&&(s=!0,f="start"),r&&!s){let m=d-r;e>=m&&(s=!0,f="end")}if(n<a&&(c=!0,f="start"),l&&!c){let m=u-l;n>=m&&(c=!0,f="end")}return{row:s?f:!1,col:c?f:!1}};this.isCellCovered=(e,n)=>{let i=this.brain.getRowspanParent(e,n),r=this.brain.getColspanParent(e,n),a=i!=e,l=r!=n;return a||l?[i,r]:!1};this.onMouseEnterNotBound=e=>{let n=this.getMatrixRowIndexFromElement(e.currentTarget);this.onMouseEnter(n)};this.onMouseLeaveNotBound=e=>{let n=this.getMatrixRowIndexFromElement(e.currentTarget);this.onMouseLeave(n)};this.onMouseEnter=e=>{this.lastEnteredRow=e,this.lastExitedRow=-1,!this.scrolling&&e!=-1&&this.addHoverClass(e)};this.addHoverClass=e=>{this.cellManager.getCellsForRow(e).forEach(n=>{let i=n.getElement();i&&this.cellHoverClassNames.forEach(r=>{i.classList.add(r)})})};this.onMouseLeave=e=>{this.lastExitedRow=e,this.lastEnteredRow=-1,!this.scrolling&&e!=-1&&this.removeHoverClass(e)};this.removeHoverClass=e=>{this.cellManager.getCellsForRow(e).forEach(n=>{let i=n.getElement();i&&this.cellHoverClassNames.forEach(r=>{i.classList.remove(r)})})};this.updateHoverClassNamesForRow=e=>{if(this.scrolling||this.hoverRowUpdatesInProgress.has(e))return;this.hoverRowUpdatesInProgress.set(e,!0);let n=()=>{!this.scrolling&&this.lastEnteredRow!=-1&&(this.lastEnteredRow===e?this.addHoverClass(e):this.removeHoverClass(e))};ke(()=>{this.destroyed||(n(),this.hoverRowUpdatesInProgress.delete(e))})};this.updateElementPosition=(e,n)=>{if(this.destroyed)return;let i=e.getElement(),r=this.cellManager.getCellPosition(e);if(!r)return;let[a,l]=r,u=this.brain.getCellOffset(a,l);if(u==null)return;let{x:d,y:s}=u;if(i){let c=()=>{this.updateHoverClassNamesForRow(a);let f=this.getCellRealCoordinates(a,l);if(i.dataset.rowIndex=f.rowIndex,i.dataset.colIndex=f.colIndex,Fd){this.setTransform(i,a,l,{x:d,y:s},null),i.style.willChange="transform",i.style.backfaceVisibility="hidden";let p=(n?n.hidden:!!this.isCellCovered(a,l))?"-1":i.dataset.zIndex||"auto";i.__zIndex!==p&&(i.__zIndex=p,i.style.zIndex=p)}else i.style.display="",i.style.left=`${d}px`,i.style.top=`${s}px`};this.scrolling&&this.brain.isHorizontalLayoutBrain?e.setPendingAfterCommitWork(c):c()}};this.updateDetailElementPosition=e=>{if(this.destroyed)return;let n=e.getElement(),i=this.rowManager.getRowIndex(e);if(i==null)return;let r=this.brain.getItemOffsetFor(i,"vertical");if(r==null)return;let a=r;n&&(n.dataset.detailRowIndex=i,Fd&&(this.setDetailTransform(n,i,{y:a,scrollLeft:this.brain.getScrollPosition().scrollLeft}),n.style.willChange="transform",n.style.backfaceVisibility="hidden",n.style.zIndex=n.dataset.zIndex||"auto"))};this.onScrollStart=()=>{this.scrolling=!0,this.lastEnteredRow!=-1&&this.removeHoverClass(this.lastEnteredRow)};this.onScrollStop=()=>{this.scrolling=!1,this.lastEnteredRow!=-1&&this.addHoverClass(this.lastEnteredRow),this.lastExitedRow!=-1&&this.removeHoverClass(this.lastExitedRow)};this.adjustFixedElementsOnScroll=(e=this.brain.getScrollPosition())=>{let{brain:n,cellManager:i,rowManager:r}=this,a=this.brain.getColCount(),l=this.brain.getRowCount(),{fixedColsStart:u,fixedColsEnd:d,fixedRowsStart:s,fixedRowsEnd:c}=this.brain.getFixedCellInfo();if(r.getAttachedCount()&&r.forEachAttachedRow(D=>{let E=r.getRowIndex(D);if(E!=null){let _=this.brain.getItemOffsetFor(E,"vertical");if(_==null)return;let O=D.getElement();if(!O)return;this.setDetailTransform(O,E,{y:_,scrollLeft:e.scrollLeft})}}),!u&&!d&&!s&&!c)return;let f=this.cellManager.getOneAttachedCell();f&&Es(e,this.getInfiniteNode(f.getElement()));let m=this.brain.getFixedEndColsOffsets({skipScroll:!0}),p=this.brain.getFixedEndRowsOffsets({skipScroll:!0}),{start:h,end:y}=this.brain.getRenderRange(),[C,b]=h,[w,S]=y;function T(D,E,_){let O=i.getCellAt([D,E]);if(O==null)return;let z=n.getCellOffset(D,E),K=O.getElement();K&&z&&_(D,E,K,z)}let I=(D,E,_,{x:O,y:z})=>{this.setTransform(_,D,E,{x:O,y:z,scrollLeft:!0},u-E)},x=(D,E,_,O)=>{this.setTransform(_,D,E,{x:O.x,y:O.y,scrollTop:!0},s-D)},F=(D,E,_,{y:O})=>{let z=m[E];this.setTransform(_,D,E,{x:z,y:O,scrollLeft:!0},a-E)},N=(D,E,_,O)=>{this.setTransform(_,D,E,{x:O.x,y:p[D],scrollTop:!0},l-D)},R=(D,E,_,{x:O,y:z})=>{this.setTransform(_,D,E,{x:O,scrollLeft:!0,y:z,scrollTop:!0},1e5)},A=(D,E,_,{x:O})=>{this.setTransform(_,D,E,{x:O,scrollLeft:!0,y:p[D],scrollTop:!0},2e5)},M=(D,E,_,O)=>{this.setTransform(_,D,E,{x:m[E],y:O.y,scrollLeft:!0,scrollTop:!0},3e5)},P=(D,E,_)=>{this.setTransform(_,D,E,{x:m[E],y:p[D],scrollLeft:!0,scrollTop:!0},4e5)};if(u||d)for(let D=C;D<w;D++){for(let E=0;E<u;E++)T(D,E,I);if(d){let E=a-d;for(let _=E;_<a;_++)T(D,_,F)}}if(s||c)for(let D=b;D<S;D++){for(let E=0;E<s;E++)T(E,D,x);if(c){let E=l-c;for(let _=E;_<l;_++)T(_,D,N)}}if(u&&s)for(let D=0;D<s;D++)for(let E=0;E<u;E++)T(D,E,R);if(u&&c){let D=l-c;for(let E=D;E<l;E++)for(let _=0;_<u;_++)T(E,_,A)}if(d&&s){let D=a-d;for(let E=0;E<s;E++)for(let _=D;_<a;_++)T(E,_,M)}if(d&&c){let D=l-c,E=a-d;for(let _=D;_<l;_++)for(let O=E;O<a;O++)T(_,O,P)}};this.flushPendingAfterCommitWork=()=>{this.destroyed||this.cellManager.flushPendingAfterCommitWork()};this.destroy=()=>{this.destroyed||(this.destroyed=!0,this.reset(),this.onDestroy(),this.hoverRowUpdatesInProgress.clear(),this.hoverRowUpdatesInProgress=null,this.brain=null)};this.brain=e,this.debugId=n,this.cellManager=new Si(n,i.cellPool),this.cellManager.onCellAttachmentChange((d,s)=>{s?this.onCellAttached(d):this.onCellDetached(d)}),this.rowManager=new wi(n,i.rowPool),this.rowManager.onRowAttachmentChange((d,s)=>{s?this.onRowAttached(d):this.onRowDetached(d)}),this.renderRange=this.renderRange.bind(this);let r=e.onScroll(this.adjustFixedElementsOnScroll),a=e.onAvailableSizeChange(()=>{this.adjustFixedElementsOnScroll(),ke(()=>{this.destroyed||this.adjustFixedElementsOnScroll()})}),l=e.onScrollStart(this.onScrollStart),u=e.onScrollStop(this.onScrollStop);this.onDestroy=()=>{r(),a(),l(),u()}}getInfiniteNode(e){return this.infiniteNode||(this.infiniteNode=Rr(e)),this.infiniteNode}onCellAttached(e){if(this.cellDetachedClassNames.length){let n=e.getElement();n&&this.cellDetachedClassNames.forEach(i=>{n.classList.remove(i)})}}onCellDetached(e){if(this.cellDetachedClassNames.length){let n=e.getElement();n&&this.cellDetachedClassNames.forEach(i=>{n.classList.add(i)})}}onRowAttached(e){if(this.cellDetachedClassNames.length){let n=e.getElement();n&&this.cellDetachedClassNames.forEach(i=>{n.classList.remove(i)})}}onRowDetached(e){if(this.cellDetachedClassNames.length){let n=e.getElement();n&&this.cellDetachedClassNames.forEach(i=>{n.classList.add(i)})}}isCellRenderedAndMappedCorrectly(e,n){let i=!!this.cellManager.getCellAt([e,n]);return{rendered:i,mapped:i}}renderRange(e,{renderCell:n,renderDetailRow:i,force:r,onRender:a}){if(this.destroyed)return[];let{start:l,end:u}=e,d=this.brain.isHorizontalLayoutBrain,{rowManager:s,cellManager:c}=this,f=this.getFixedRanges(e),m=[e,...f],p=this.brain.getAlwaysRenderedColumns();if(p.length>0){let R=e.start[1],A=e.end[1];p.forEach(M=>{R<=M&&M<A||m.push({start:[e.start[0],M],end:[e.end[0],M+1]})})}let h=new Map,y=m.map(this.getExtraSpanCellsForRange).flat();y&&y.forEach(([R,A])=>{h.set(`${R}:${A}`,!0)});let C=m.reduce((R,A)=>R+la(A),0),b=i?m.reduce((R,A)=>R+Pd(A),0):0,w=this.brain.getRowCount(),S=this.brain.getColCount();c.detachCellsStartingAt([w,S]);let T=Math.min(w*S,C);i&&(s.detachStartingWith(this.brain.getRowCount()),s.poolSize>b&&(s.poolSize=b));let I=_d(...m.map(R=>c.getCellsOutsideRenderRange(R)));I=Md(I,R=>{let A=c.getCellPosition(R);return!(A&&h.has(`${A[0]}:${A[1]}`))}),c.detachCells(I),c.poolSize=T;let x=new Map,F=new Map;m.forEach(R=>{let{start:A,end:M}=R,[P,D]=A,[E,_]=M;for(let O=P;O<E;O++){for(let K=D;K<_;K++){let B=`${O}:${K}`;if(x.has(B))continue;x.set(B,!0);let{rendered:G,mapped:le}=this.isCellRenderedAndMappedCorrectly(O,K);if(O===P||K===D){let De=this.isCellCovered(O,K);if(De&&h.has(`${De[0]}:${De[1]}`)){let me=c.getCellAt([O,K]);me!=null&&c.detachCell(me);continue}}if(G&&!r&&le)continue;let Z;G?Z=c.getCellAt([O,K]):Z=c.getCellFor([O,K],d?"row":"column"),Z==null&&(Z=c.getDetachedCell()),this.renderCellAt(O,K,Z,n)}!i||F.has(O)||(F.set(O,!0),s.isRowAttachedAt(O)&&!r)||this.renderDetailRowAtElement(O,this.rowManager.getRowFor(O),i)}}),y.forEach(([R,A])=>{let{rendered:M,mapped:P}=this.isCellRenderedAndMappedCorrectly(R,A);if(M){if(r||!P){let E=[R,A],_=c.getCellAt(E);this.renderCellAt(R,A,_,n)}return}let D=c.getCellFor([R,A],d?"row":"column");D!=null&&this.renderCellAt(R,A,D,n)});let N=c.getAllCells().map(R=>R.getNode());return i&&s.getAllRows().forEach(R=>{N.push(R.getNode())}),this.adjustFixedElementsOnScroll(),a&&a(N),N}renderDetailRowAtElement(e,n,i){if(this.destroyed)return;let r=!1,a=this.brain.getRowHeight(e),l=this.brain.isRowFixedStart(e)?"start":this.brain.isRowFixedEnd(e)?"end":!1,d=i({rowIndex:e,height:a,rowFixed:l,hidden:!!r,onMouseEnter:()=>{},onMouseLeave:()=>{},domRef:n.ref});if(n.isMounted()||n.onMount(s=>{let c=s.getElement();c&&(c.style.position="absolute",c.style.left="0px"),this.updateDetailElementPosition(s)}),!d){this.rowManager.detachRow(n);return}this.rowManager.renderNodeAtRow(d,n,e),this.updateDetailElementPosition(n)}getCellRealCoordinates(e,n){return{rowIndex:e,colIndex:n}}getMatrixRowIndexFromElement(e){let n=Number(e.dataset.rowIndex);return this.brain.isHorizontalLayoutBrain?this.brain.getRowIndexInPage(n):n}renderCellAt(e,n,i,r){if(this.destroyed)return;let a=this.isCellCovered(e,n),l=this.brain.getRowHeight(e),u=this.brain.getColWidth(n),d=this.brain.getRowspan(e,n),s=this.brain.getColspan(e,n),c=d===1?l:this.brain.getRowHeightWithSpan(e,n,d),f=s===1?u:this.brain.getColWidthWithSpan(e,n,s),{row:m,col:p}=this.isCellFixed(e,n),h=!!a,{rowIndex:y,colIndex:C}=this.getCellRealCoordinates(e,n),b=r({rowIndex:y,colIndex:C,height:l,width:u,rowspan:d,colspan:s,rowFixed:m,colFixed:p,hidden:h,heightWithRowspan:c,widthWithColspan:f,onMouseEnter:this.onMouseEnterNotBound,onMouseLeave:this.onMouseLeaveNotBound,domRef:i.ref});i.isMounted()||i.onMount(T=>{let I=T.getElement();I&&(I.style.position="absolute",I.style.left="0px",I.style.top="0px"),this.updateElementPosition(T)});let w=this.brain.isHorizontalLayoutBrain?{renderRowIndex:y,renderColIndex:C}:void 0,S=this.brain.isHorizontalLayoutBrain;if(!b){S?this.cellManager.detachCell(i):this.cellManager.detachCell(i);return}this.cellManager.renderNodeAtCell(b,i,[e,n],w),this.updateElementPosition(i,{hidden:h,rowspan:d,colspan:s})}reset(){this.cellManager.reset(),this.rowManager.reset()}};var vi=class extends On{constructor(e,n,i){super(e,n,i);this.setTransform=(e,n,i,r,a)=>{let l=this.getCellRealCoordinates(n,i),{y:u}=r,d=Math.floor(l.rowIndex/this.brain.rowsPerPage),s=Ie.runtime.totalVisibleColumnsWidthVar,c=d?`calc(${s} * ${d})`:"0px",f=Ce.columnOffsets.get(l.colIndex),m=`${ua}-${l.colIndex}`,p=`${u}px`;e.__currentTransformY!==p&&(e.__currentTransformY=p,e.style.setProperty(sn,p));let h=`calc(var(${m}, ${f}) + ${c})`,y=`var(${sn})`,C=`translate3d(${h}, ${y}, 0px)`;e.__transformValue!==C&&(e.__transformValue=C,e.style.transform=C)};this.brain=e}getCellRealCoordinates(e,n){return this.brain.getHorizontalLayoutPositionFromMatrixCoordinates({rowIndex:e,colIndex:n})}isCellRenderedAndMappedCorrectly(e,n){let i=this.cellManager.getCellAt([e,n]),r=!!i;if(!r)return{rendered:r,mapped:!1};let a=i.getAdditionalInfo();if(!a)return{rendered:r,mapped:!1};let l=this.getCellRealCoordinates(e,n),u=l.colIndex===a.renderColIndex&&l.rowIndex===a.renderRowIndex;return{rendered:r,mapped:u}}};import{h as Iy}from"vue";import{defineComponent as yy,getCurrentInstance as by,isVNode as Cy,onBeforeUnmount as Ty,onMounted as Sy,onUpdated as wy,shallowRef as vy,watch as Ry}from"vue";function Od(o,t){if(!(!t||!o)){if(Array.isArray(o)){for(let e of o)Od(e,t);return}if(Cy(o)){let e=o.ref;e&&e.i==null&&(e.i=t)}}}var Zt=yy({name:"RenderSlot",props:{name:{type:String,required:!1},useraf:{type:Boolean,required:!1,default:!1},updater:{type:Function,required:!0},afterCommit:{type:Function,required:!1}},setup(o){let t=vy(o.updater.get()??null),e=null;Ry(()=>[o.updater,o.useraf],([i,r],a,l)=>{t.value=i.get()??null;let u=i.onChange(d=>{r?(e!=null&&cancelAnimationFrame(e),e=requestAnimationFrame(()=>{t.value=d})):t.value=d});l(u)},{immediate:!0,flush:"sync"}),Ty(()=>{e!=null&&cancelAnimationFrame(e)}),Sy(()=>o.afterCommit?.()),wy(()=>o.afterCommit?.());let n=by();return()=>{let i=t.value;return Od(i,n),i??null}}});var kn=class kn extends et{constructor(e){super(e);this.cellRemoveSubscription=pe();this.cellAttachmentChangeSubscription=pe();this.attachedCells=new Set,this.detachedCells=new Set,this.allCellsOrdered=new Set}destroy(){this.reset()}onRemoveCell(e){return this.cellRemoveSubscription.onChange(i=>{i!=null&&e(i)})}onCellAttachmentChange(e){return this.cellAttachmentChangeSubscription.onChange(i=>{if(i==null)return;let{cell:r,attached:a}=i;e(r,a)})}reset(){this.attachedCells.clear(),this.detachedCells.clear(),this.allCellsOrdered.clear(),this.cellRemoveSubscription.destroy(),this.cellAttachmentChangeSubscription.destroy()}getAttachedCells(){return this.attachedCells}getDetachedCells(){return this.detachedCells}getAllCells(){return this.allCellsOrdered}createCell(){let e=this.createCellInstance();return this.detachedCells.add(e),this.allCellsOrdered.add(e),e}removeCell(e){this.detachedCells.delete(e),this.attachedCells.delete(e),this.allCellsOrdered.delete(e),e.destroy(),this.cellRemoveSubscription(e)}attachCell(e){return e&&this.attachedCells.has(e)||(e||(e=this.getDetachedCell()),this.detachedCells.delete(e),this.attachedCells.add(e),this.cellAttachmentChangeSubscription({cell:e,attached:!0})),e}detachCell(e){return this.detachedCells.has(e)?!1:(this.attachedCells.delete(e),this.detachedCells.add(e),this.cellAttachmentChangeSubscription({cell:e,attached:!1}),!0)}getDetachedCell(){let{detachedCells:e}=this,n=e.values().next().value;return n||(this.poolSize+=kn.POOL_SIZE_INCREMENT,n=e.values().next().value),n||this.error("No cells available in the pool!"),n}get attachedSize(){return this.attachedCells.size}get detachedSize(){return this.detachedCells.size}get poolSize(){return this.allCellsOrdered.size}flushPendingAfterCommitWork(){for(let e of this.attachedCells)e.flushPendingAfterCommitWork()}set poolSize(e){e=Math.ceil(e/kn.POOL_SIZE_INCREMENT)*kn.POOL_SIZE_INCREMENT;let n=this.poolSize;if(e===n)return;let{detachedCells:i}=this,r=n-e;if(r>0){r>i.size&&(r=i.size,this.debug("Trying to destroy more cells than are currently detached!"));let a=i.values();for(;r>0;){let l=a.next().value;this.removeCell(l),r--}}else for(r=-r;r>0;)this.createCell(),r--}};kn.POOL_SIZE_INCREMENT=1;var Ri=kn;var kd=new Map,xy=()=>{},da=class{constructor(t,e){this.element=null;this.mounted=!1;this.pendingAfterCommitWork=null;this.mountSubscription=pe();this.afterCommit=()=>{this.flushPendingAfterCommitWork()};let n=kd.get(t)??0,i=`${t}:GridCellVue:${n}`;kd.set(t,n+1),this.debugId=i,this.cellInfo=e,this.updater=pe(),this.node=Iy(Zt,{key:i,name:i,updater:this.updater,afterCommit:this.afterCommit}),this.ref=r=>{this.element=r,r?(this.mounted=!0,this.mountSubscription(this)):this.mounted=!1}}setPendingAfterCommitWork(t){this.pendingAfterCommitWork=t}flushPendingAfterCommitWork(){if(this.pendingAfterCommitWork){let t=this.pendingAfterCommitWork;this.pendingAfterCommitWork=null,t()}}isMounted(){return this.mounted}onMount(t){return this.mountSubscription.onChange(n=>{n!=null&&t(n)})}destroy(){this.mountSubscription.destroy(),this.updater.destroy(),this.pendingAfterCommitWork=null,this.ref=xy,this.element=null,this.node=null}getNode(){return this.node}update(t,e){this.updater(t),this.cellInfo=e}getAdditionalInfo(){return this.cellInfo}getElement(){return this.element}},Ii=class extends Ri{constructor(e){super(`${e}:GridCellPoolForVue`);this.cellDebugId=e}createCellInstance(){return new da(this.cellDebugId)}};import{h as Py}from"vue";var Ln=class Ln extends et{constructor(e){super(e);this.rowRemoveSubscription=pe();this.rowAttachmentChangeSubscription=pe();this.attachedRows=new Set,this.detachedRows=new Set,this.allRowsOrdered=new Set}destroy(){this.reset()}onRemoveRow(e){return this.rowRemoveSubscription.onChange(i=>{i!=null&&e(i)})}onRowAttachmentChange(e){return this.rowAttachmentChangeSubscription.onChange(i=>{if(i==null)return;let{row:r,attached:a}=i;e(r,a)})}reset(){this.attachedRows.clear(),this.detachedRows.clear(),this.allRowsOrdered.clear(),this.rowRemoveSubscription.destroy(),this.rowAttachmentChangeSubscription.destroy()}getAttachedRows(){return this.attachedRows}getDetachedRows(){return this.detachedRows}getAllRows(){return this.allRowsOrdered}createRow(){let e=this.createRowInstance();return this.detachedRows.add(e),this.allRowsOrdered.add(e),e}removeRow(e){this.detachedRows.delete(e),this.attachedRows.delete(e),this.allRowsOrdered.delete(e),e.destroy(),this.rowRemoveSubscription(e)}attachRow(e){return e&&this.attachedRows.has(e)||(e||(e=this.getDetachedRow()),this.detachedRows.delete(e),this.attachedRows.add(e),this.rowAttachmentChangeSubscription({row:e,attached:!0})),e}detachRow(e){return this.detachedRows.has(e)?!1:(this.attachedRows.delete(e),this.detachedRows.add(e),this.rowAttachmentChangeSubscription({row:e,attached:!1}),!0)}getDetachedRow(){let{detachedRows:e}=this,n=e.values().next().value;return n||(this.poolSize+=Ln.POOL_SIZE_INCREMENT),n=e.values().next().value,n||this.error("No rows available in the pool!"),n}get attachedSize(){return this.attachedRows.size}get detachedSize(){return this.detachedRows.size}get poolSize(){return this.allRowsOrdered.size}set poolSize(e){e=Math.ceil(e/Ln.POOL_SIZE_INCREMENT)*Ln.POOL_SIZE_INCREMENT;let n=this.poolSize;if(e===n)return;let{detachedRows:i}=this,r=n-e;if(r>0){r>i.size&&(r=i.size,this.debug("Trying to destroy more rows than are currently detached!"));let a=i.values();for(;r>0;){let l=a.next().value;this.removeRow(l),r--}}else for(r=-r;r>0;)this.createRow(),r--}};Ln.POOL_SIZE_INCREMENT=1;var xi=Ln;var Ld=new Map,Dy=()=>{},ca=class{constructor(t){this.element=null;this.mounted=!1;this.mountSubscription=pe();let e=Ld.get(t)??0,n=`${t}:ListRowVue:${e}`;Ld.set(t,e+1),this.debugId=n,this.updater=pe(),this.node=Py(Zt,{key:`detail-row-${n}`,name:`detail-row-${n}`,updater:this.updater}),this.ref=i=>{this.element=i,i?(this.mounted=!0,this.mountSubscription(this)):this.mounted=!1}}isMounted(){return this.mounted}onMount(t){return this.mountSubscription.onChange(n=>{n!=null&&t(n)})}destroy(){this.mountSubscription.destroy(),this.updater.destroy(),this.ref=Dy,this.element=null,this.node=null}getNode(){return this.node}update(t){this.updater(t)}getElement(){return this.element}},Pi=class extends xi{constructor(e){super(`${e}:ListRowPoolForVue`);this.rowDebugId=e}createRowInstance(){return new ca(this.rowDebugId)}};function zd(o){return{cellPool:new Ii(o),rowPool:new Pi(o)}}function Co(o){let t=o.isHorizontalLayoutBrain?new vi(o,`${o.name}:VueHorizontalLayoutTableRenderer`,zd(`${o.name}:VueHorizontalLayoutTableRenderer`)):new On(o,`${o.name}:VueHeadlessTableRenderer`,zd(`${o.name}:VueHeadlessTableRenderer`)),e=pe();return o.onDestroy(()=>{t.destroy(),e.destroy()}),{renderer:t,onRenderUpdater:e}}function un(){return{current:null}}var Vd={};function fa(o){return`.${mt}[data-row-index${o?`="${o.rowIndex}"`:""}][data-col-index${o?`="${o.colIndex}"`:""}]`}function pa(o,t){let e=Mn(o),n=t?new yo(e,{isHeader:!1}):new ln(e),i=`${e}:header`,r=t?new yo(i,{isHeader:!0,masterBrain:n}):new ln(i);n.onScroll(s=>{r.setScrollPosition({scrollLeft:s.scrollLeft,scrollTop:0})});let{renderer:a,onRenderUpdater:l}=Co(n),{renderer:u,onRenderUpdater:d}=Co(r);return n.onAvailableSizeChange(s=>{r.update({width:s.width})}),{brain:n,headerBrain:r,renderer:a,onRenderUpdater:l,headerRenderer:u,headerOnRenderUpdater:d}}function Gd({debugId:o,wrapRowsHorizontally:t}){let e={},{brain:n,headerBrain:i,renderer:r,onRenderUpdater:a,headerRenderer:l,headerOnRenderUpdater:u}=pa(o,!!t),d=un(),s=Date.now();return{debugWarnings:new Map,renderer:r,onRenderUpdater:a,headerRenderer:l,headerOnRenderUpdater:u,updatedAt:s,devToolsDetected:!!globalThis.__INFINITE_TABLE_DEVTOOLS_HOOK__,propsCache:new Map([]),lastRowToCollapseRef:{current:null},lastRowToExpandRef:{current:null},cellContextMenuVisibleFor:null,contextMenuVisibleFor:null,columnMenuVisibleForColumnId:null,columnMenuVisibleKey:0,filterOperatorMenuVisibleForColumnId:null,getDOMNodeForCell:c=>{if(!d.current)return null;let f=fa(c);return d.current.querySelector(f)||null},brain:n,headerBrain:i,domRef:d,columnMenuTargetRef:un(),editingValueRef:un(),scrollerDOMRef:un(),portalDOMRef:un(),focusDetectDOMRef:un(),activeCellIndicatorDOMRef:un(),onColumnMenuClick:pe(),cellContextMenu:pe(),contextMenu:pe(),onFilterOperatorMenuClick:pe(),flashingDurationCSSVarValue:null,onFlashingDurationCSSVarChange:pe(),onRowHeightCSSVarChange:pe(),onRowDetailHeightCSSVarChange:pe(),onColumnHeaderHeightCSSVarChange:pe(),cellClick:pe(),cellMouseDown:pe(),keyDown:pe(),bodySize:{width:0,height:0},scrollPosition:{scrollTop:0,scrollLeft:0},columnReorderDragColumnId:!1,columnReorderInPageIndex:null,ready:!1,focused:!1,focusedWithin:!1,columnsWhenGrouping:e,columnVisibilityForGrouping:{},pinnedStartScrollListener:new go,pinnedEndScrollListener:new go,columnsWhenInlineGroupRenderStrategy:void 0,editingCell:null,forceBodyRerenderTimestamp:0}}var Kd=o=>({debugId:1,scrollTopKey:1,components:1,id:1,loadingText:1,pivotColumns:1,groupColumn:1,onReady:1,domProps:1,onKeyDown:1,onCellClick:1,onCellDoubleClick:1,focusedClassName:1,focusedWithinClassName:1,focusedStyle:1,focusedWithinStyle:1,onSelfFocus:1,onFocusWithin:1,onSelfBlur:1,onBlurWithin:1,onContextMenu:1,onCellContextMenu:1,onRenderRangeChange:1,onRowMouseEnter:1,onRowMouseLeave:1,onScrollToTop:1,onScrollToBottom:1,onScrollStop:1,scrollToBottomOffset:1,getColumnMenuItems:1,getCellContextMenuItems:1,getContextMenuItems:1,menuPortalContainer:1,menuConstrainTo:1,columnPinning:1,editable:1,columnDefaultEditable:1,columnDefaultFilterable:1,columnDefaultGroupable:1,columnDefaultSortable:1,keyboardShortcuts:1,rowStyle:1,cellStyle:1,repaintCellsKey:1,rowProps:1,rowClassName:1,rowHoverClassName:1,cellClassName:1,repeatWrappedGroupRows:1,pinnedStartMaxWidth:1,pinnedEndMaxWidth:1,pivotColumn:1,pivotColumnGroups:1,getFilterOperatorMenuItems:1,onScrollbarsChange:1,autoSizeColumnsKey:1,wrapRowsHorizontally:1,columnDefaultFlex:1,draggableColumnsRestrictTo:t=>t??!1,columnMenuRealignDelay:t=>t??50,scrollStopDelay:t=>t??250,viewportReservedWidth:t=>t??0,resizableColumns:t=>t??!0,rowDetailCache:t=>new yi(t),hideColumnWhenGrouped:t=>t??!1,columnMinWidth:t=>t??30,columnMaxWidth:t=>t??5e3,columnDefaultWidth:t=>t??200,columnCssEllipsis:t=>t??!0,draggableColumns:1,columnDefaultDraggable:1,headerOptions:t=>({alwaysReserveSpaceForSortIcon:!0,...t}),showSeparatePivotColumnForSingleAggregation:t=>t??!1,sortable:1,hideEmptyGroupColumns:t=>t??!1,pivotTotalColumnPosition:t=>t??"end",pivotGrandTotalColumnPosition:1,licenseKey:t=>t||"",keyboardSelection:t=>t??!0,multiRowSelectionWith:t=>t??"checkbox",activeRowIndex:1,activeCellIndex:1,columnOrder:t=>t??!0,header:t=>t??!0,showZebraRows:t=>t??!0,showHoverRows:t=>t??!0,virtualizeColumns:t=>t??!0,rowHeight:t=>typeof t=="number"||typeof t=="function"?t:0,rowDetailHeight:t=>typeof t=="number"||typeof t=="function"?t:300,columnHeaderHeight:t=>typeof t=="number"?t:30,columns:1,columnVisibility:t=>t??Vd,columnGroupVisibility:t=>t??Vd,columnSizing:t=>t||{},columnTypes:t=>t||{},onEditCancelled:1,onEditRejected:1,onEditAccepted:1,persistEdit:1,shouldAcceptEdit:1,onEditPersistError:1,onEditPersistSuccess:1,multiSortBehavior:t=>t??"replace",collapsedColumnGroups:t=>t??new Map,columnGroups:1});function Ay(o){let{groupBy:t,groupColumn:e,groupRenderStrategy:n}=o;return n||(e!=null&&typeof e=="object"?"single-column":(t.filter(r=>r.column).length,"multi-column"))}var Bd=o=>{o.brain.destroy(),o.headerBrain.destroy(),o.renderer.destroy(),o.headerRenderer.destroy(),o.onRenderUpdater.destroy(),o.headerOnRenderUpdater.destroy(),o.onFlashingDurationCSSVarChange.destroy(),o.onRowHeightCSSVarChange.destroy(),o.onColumnHeaderHeightCSSVarChange.destroy(),o.onColumnMenuClick.destroy(),o.onFilterOperatorMenuClick.destroy(),o.domRef.current=null,o.columnMenuTargetRef.current=null,o.scrollerDOMRef.current=null,o.portalDOMRef.current=null,o.onRowDetailHeightCSSVarChange.destroy(),o.pinnedEndScrollListener.destroy(),o.pinnedStartScrollListener.destroy()};function Hd(o){return o.reduce((t,e,n)=>{let i={groupBy:e,groupIndex:n};return e.field?t.set(e.field,i):e.groupField&&t.set(e.groupField,i),t},new Map)}var Di=new WeakMap;function Wd(){return{rowDetailState:(o,t)=>({callbackParams:[o,{expandRow:t.lastRowToExpandRef.current,collapseRow:t.lastRowToCollapseRef.current}]})}}var jd=o=>{let{props:t,state:e,oldState:n,parentState:i}=o,r=e.pivotColumnGroups||e.columnGroups,a=e.columnGroups&&e.columnGroups!=n?.columnGroups||e.columnGroups&&e.columnGroupVisibility!=n?.columnGroupVisibility||e.pivotColumnGroups&&e.pivotColumnGroups!=n?.pivotColumnGroups?Dd(r,e.columnGroupVisibility):e.columnGroupsDepthsMap,l=i?.groupBy,u=Ay({groupRenderStrategy:t.groupRenderStrategy,groupBy:l,groupColumn:t.groupColumn}),d,s=t.rowDetailRenderer,c=t.components?.RowDetail;if(!s&&c){let y=Di.get(c);y||(y=Ad(c),Di.set(c,y)),s=y}s&&(d=t.rowDetailState||e.rowDetailState||t.defaultRowDetailState,d&&!(d instanceof ut)&&(d=new ut(d)),d=d||new ut({expandedRows:[],collapsedRows:!0}));let f=e.columnsWhenGrouping||e.columnsWhenInlineGroupRenderStrategy||e.columns,m=d?t.isRowDetailExpanded:void 0;!m&&d&&(m=Di.get(d),m||(m=y=>d.isRowDetailsExpanded(y.id),typeof d=="object"&&Di.set(d,m)));let p=s?t.isRowDetailEnabled||!0:!1,h={updatedAt:Date.now(),isTree:i.isTree,rowDetailRenderer:s,rowDetailState:d,isRowDetailExpanded:m,isRowDetailEnabled:p,showColumnFilters:t.showColumnFilters??!!i.filterValue,controlledColumnVisibility:!!t.columnVisibility,groupRenderStrategy:u,groupBy:l,computedColumns:f,initialColumns:t.columns,keyboardNavigation:t.keyboardNavigation??(e.activeCellIndex!=null?"cell":e.activeRowIndex!=null?"row":"cell"),columnHeaderCssEllipsis:t.columnHeaderCssEllipsis??t.columnCssEllipsis??!0,columnGroupsDepthsMap:a,columnGroupsMaxDepth:a!=e.columnGroupsDepthsMap?Math.max(...a.values(),-1):e.columnGroupsMaxDepth,computedColumnGroups:r,rowHeightCSSVar:typeof t.rowHeight=="string"?t.rowHeight:"",rowDetailHeightCSSVar:typeof t.rowDetailHeight=="string"?t.rowDetailHeight:"",columnHeaderHeightCSSVar:typeof t.columnHeaderHeight=="string"?t.columnHeaderHeight||Ie.components.Header.columnHeaderHeight:""};if(e.devToolsDetected&&e.debugId){let y=Br.get(e.debugId);y&&(h={...h,...y})}return h};function $d(o,t){let e={};return Object.keys(o).forEach(n=>{let i=o[n],r=i;if(!r.groupByForColumn||Array.isArray(r.groupByForColumn))return;let{groupByForColumn:a}=r,l=a.field||a.groupField;l&&t.get(l)&&(e[n]=i)}),e}function Ud(o){let{hideEmptyGroupColumns:t,groupByMap:e,computedGroupColumns:n,groupRowsIndexesInDataArray:i,dataArray:r,groupBy:a}=o,l={...o.columnVisibility};if(!t)return Object.keys(n).forEach(c=>{l[c]===!1&&delete l[c]}),l;if(!i||!i.length)return l;let u=a.length,d=0,s=i.length;for(let c=0;c<s;c++){let f=i[c],m=r[f];if(!m.isTreeNode&&m.isGroupRow&&(d=Math.max(d,m.groupNesting-1),d===u-1))break}return Object.keys(n).forEach(c=>{let f=n[c],{groupByForColumn:m}=f;if(Array.isArray(m))return;let p=m.field||m.groupField;if(!p)return;e.get(p).groupIndex>d&&t?l[c]!==!1&&(l[c]=!1):l.hasOwnProperty(c)&&delete l[c]}),l}var _y=10;function qd(o,t){let{includeHeader:e,columnsToResize:n,columnsToSkip:i}=t,r=`.${wt} > .${Uo}`,a=o.current?.querySelectorAll(r),l={},u={};return a&&a.length&&a.forEach(d=>{let s=d.parentElement,c=s.matches(`.${nn}`);if(e===!1&&c)return;let f=s.getAttribute("data-column-id"),m=d.cloneNode(!0);m.style.visibility="hidden",m.style.pointerEvents="none",m.classList.remove(...lt.split(" ")),m.style.position="absolute",m.style.width="auto",s.appendChild(m);let p=m.offsetWidth;if(s.removeChild(m),!u[f]){let h=Fe().getComputedStyle(s);u[f]=parseInt(h.paddingLeft,10)+parseInt(h.paddingRight,10)+parseInt(h.borderLeftWidth,10)+parseInt(h.borderRightWidth,10)+_y}if(p+=u[f],c){let h=0;s.childNodes.forEach(y=>{if(y!==d&&y.nodeType===1){let C=y,b=Math.max(C.offsetWidth,parseInt(C.style.width,10));if(isNaN(b)&&(b=0),h+=b,b>0){let w=Fe().getComputedStyle(C);h+=parseInt(w.marginLeft,10)+parseInt(w.marginRight,10)}}}),p+=h}i&&i.has(f)||n&&!n.has(f)||(l[f]=Math.max(p,l[f]||0))}),l}var Yd="InfiniteTable";import{h as cn}from"vue";var Zd=o=>o.dataSourceHasGrouping&&o.isGroupRow&&o.childrenLoading||!o.selfLoaded;import{defineComponent as My,h as tc,ref as Ey,watch as Fy}from"vue";var Xd="_96uiwi0 _16lm1iw1d _16lm1iwk _16lm1iw9",Jd=we({defaultClassName:"_96uiwi1",variantClassNames:{expanded:{true:"_16lm1iwi",false:"_96uiwi3"},direction:{end:"_96uiwi4",start:"_96uiwi5"},disabled:{true:"_96uiwi6",false:"_96uiwi7"}},defaultVariants:{},compoundVariants:[[{expanded:!1,direction:"end"},"_16lm1iwj"]]});var Qd="M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z",ec=Object.keys({size:1,expanded:1,defaultExpanded:1,onChange:1,style:1,disabled:1,className:1,direction:1});var Ai=`${nt}-expand-collapse`,dn=My(o=>{let t=()=>o.expanded!==void 0,e=Ey(o.expanded??o.defaultExpanded??!1);Fy(()=>o.expanded,i=>{t()&&(e.value=!!i)});let n=()=>{o.onChange?.(!e.value),t()||(e.value=!e.value)};return()=>{let i=e.value?"expanded":"collapsed",{size:r=24,direction:a="start",disabled:l=!1}=o;return tc("svg",{"data-name":"expand-collapse-icon","data-state":i,"data-disabled":l,xmlns:"http://www.w3.org/2000/svg",height:`${r}px`,viewBox:"0 0 24 24",width:`${r}px`,style:o.style,onClick:l?void 0:n,class:te(o.className,Xd,Jd({direction:a||"start",expanded:e.value,disabled:l}),`${nt}`,`${Ai}`,`${Ai}--${i}`,`${Ai}--${a==="end"?"end":"start"}`,l?`${Ai}--disabled`:"")},[tc("path",{d:Qd})])}},{name:"ExpandCollapseIcon",props:[...ec]});import{defineComponent as Ny,h as ma}from"vue";var nc="_16lm1iwb _16lm1iw1d _16lm1iwk";var oc="164.93361431346415 56.97787143782138",ic={margin:"auto",display:"block",shapeRendering:"auto"},rc=Object.keys({size:1,style:1,className:1,viewBox:1});var ac=Ny(o=>()=>ma("svg",{xmlns:"http://www.w3.org/2000/svg",style:{...ic,...o.style},width:"24px",height:"24px",viewBox:o.viewBox??"0 0 100 100",preserveAspectRatio:"xMidYMid",class:te(o.className,nc,"InfiniteIcon","InfiniteIcon-loading")},[ma("circle",{cx:"50",cy:"50",fill:"none","stroke-width":"10",r:"35","stroke-dasharray":oc},[ma("animateTransform",{attributeName:"transform",type:"rotate",repeatCount:"indefinite",dur:"1s",values:"0 50 50;360 50 50",keyTimes:"0;1"})])]),{name:"LoadingIcon",props:[...rc]});var lc=we({defaultClassName:"_7pupv01",variantClassNames:{align:{start:"_7pupv02",center:"_7pupv03",end:"_7pupv04"}},defaultVariants:{},compoundVariants:[]}),sc="_7pupv00",uc=we({defaultClassName:"_7pupv05",variantClassNames:{align:{start:"_7pupv06",center:"_7pupv07",end:"_7pupv08"}},defaultVariants:{},compoundVariants:[]});function dc(o,t,e,n){let{groupByForColumn:i,groupIndexForColumn:r,groupRenderStrategy:a}=o,l=i.column?{...i.column}:{},u=typeof e=="function"?e(o,t):e;return{header:`Group by ${i.field||i.groupField}`,groupByForColumn:i,render:n.getGroupColumnRender({groupIndexForColumn:r,groupRenderStrategy:a}),...l,...u,renderGroupIcon:n.getGroupColumnRenderGroupIcon({initialRenderGroupIcon:u?.renderGroupIcon??l.renderGroupIcon,groupIndexForColumn:r,toggleGroupRow:t,groupRenderStrategy:a})}}function cc(o,t,e,n){let i=typeof e=="function"?e(o,t):e,r={};return o.sortable!=null&&(r.sortable=o.sortable),{...r,header:"Group",groupByForColumn:o.groupBy,renderSelectionCheckBox:o.selectionMode==="multi-row",render:n.getGroupColumnRender({groupIndexForColumn:0,groupRenderStrategy:"single-column"}),...i,renderGroupIcon:n.getGroupColumnRenderGroupIcon({initialRenderGroupIcon:i?.renderGroupIcon,groupIndexForColumn:0,toggleGroupRow:t,groupRenderStrategy:"single-column"})}}var Oy=U(j.columnZIndexAtIndex),ky=U(j.columnVisibilityAtIndex);function fc({rowInfo:o,column:t}){let e=0;if(o.dataSourceHasGrouping)if(o.isGroupRow){let n=t?.groupByForColumn,i=o.groupBy[o.groupBy.length-1],r=!!o.pivotValuesMap,a=r&&!!t?.field&&!!n&&!Array.isArray(n)&&(n.field??n.groupField)!==(i?.field??i?.groupField),l=r&&Array.isArray(n)&&o.groupNesting===o.rootGroupBy.length;e=a||l?o.groupNesting:o.groupNesting-1}else e=o.groupNesting;return{[U(Ie.components.Row.groupNesting)]:e}}function Ly({rowInfo:o}){return{[U(Ie.components.Row.groupNesting)]:o.isTreeNode?o.isParentNode?o.treeNesting:o.treeNesting+1:0}}function ha(o,t){return o?typeof o=="function"?o(t):o:void 0}function ga(o,t,e){return typeof t=="function"?{...o,...t(e)}:{...o,...t}}function pc(o){let{column:t,rowInfo:e,rowIndex:n,rowHeight:i,rowIndexInHorizontalLayoutPage:r,horizontalLayoutPageIndex:a,align:l,verticalAlign:u,stylingParam:d,formattedValueContext:s,groupByColumnReference:c,rowStyle:f,rowClassName:m,cellStyle:p,cellClassName:h,showZebraRows:y,rowActive:C,rowDisabled:b,rowSelected:w,cellSelected:S,cellSelection:T,getData:I,computedVisibleColumns:x,visibleColumnIds:F,computedColumnOrder:N,columnReorderInPageIndex:R}=o,A=F??x.map(Me=>Me.id),M=N,P,D={...s,visibleColumnIds:A,allColumnIds:M,rowIndex:n,get rowHasSelectedCells(){return P===void 0&&(P=e.hasSelectedCells(A)),P}},E=!!(e.isTreeNode&&(t.renderTreeIcon||t.renderTreeIconForLeafNode||t.renderTreeIconForParentNode)),_=typeof m=="function"?m(D):m,O;c?.className&&(O=ha(c.className,d)),h&&(O=te(O,ha(h,d))),t.className&&(O=te(O,ha(t.className,d))),E&&(O=te(O,uc({align:l})));let z;e.dataSourceHasGrouping&&t.groupByForColumn&&(z=fc({rowInfo:e,column:t})),E&&(z=Ly({rowInfo:e})),f&&(z=typeof f=="function"?{...z,...f(D)}:{...z,...f}),p&&(z=ga(z,p,d)),c?.style&&(z=ga(z,c.style,d)),t.style&&(z=ga(z,t.style,d)),z=z||{},z.height=i,z.zIndex=`var(${Oy}-${t.computedVisibleIndex})`,z.visibility=`var(${ky}-${t.computedVisibleIndex}, visible)`;let K=r!=null?r%2===1:(e.indexInAll!=null?e.indexInAll:n)%2===1,B=y?K?"odd":"even":!1,G=!1,le=!1,Z=!1,De=!1;if(T&&S){let Me=I(),Te=Me[e.indexInAll-1],_e=Me[e.indexInAll+1],ue=x[t.computedVisibleIndex+1],Q=x[t.computedVisibleIndex-1];G=Te?!T.isCellSelected(Te.id,t.id):!0,t.computedPinned==="end"&&t.computedFirstInCategory?le=!0:le=Q?!T.isCellSelected(e.id,Q.id):!0,t.computedPinned==="start"&&t.computedLastInCategory?Z=!0:Z=ue?!T.isCellSelected(e.id,ue.id):!0,De=_e?!T.isCellSelected(_e.id,t.id):!0}let me=T&&S?{top:G,left:le,right:Z,bottom:De}:null,ve=R!=null?a!==R:!1,Oe=te(me?lu(me):"",Go(t,[mt,wt],au,{dragging:!1,insideDisabledDraggingPage:ve,zebra:B,align:l,verticalAlign:u,rowDisabled:b,rowActive:C,cellSelected:S,rowSelected:w,treeNode:e.isTreeNode?e.isParentNode?"parent":"leaf":!1,firstRow:e.indexInAll===0,firstRowInHorizontalLayoutPage:r===0,groupRow:e.isGroupRow,groupCell:e.isGroupRow?!!t.groupByForColumn:!1,rowExpanded:e.isGroupRow?!e.collapsed:!1}),O,_);return{style:z,className:Oe,cellSelectionBorders:me,zebra:B,columnIsTree:E}}function zy({groupIndexForColumn:o,groupRenderStrategy:t}){return e=>{let{rowInfo:n,renderBag:i,column:r,align:a}=e,{value:l,groupIcon:u,selectionCheckBox:d}=i,s=n,c=t==="multi-column"&&s.isGroupRow&&o+1!==s.groupNesting,f=te(Fo.flex,r.align==="end"?fr.rowReverse:fr.row,Il.center,`${mt}Expander`,t==="single-column"||t==="multi-column"&&(!n.isGroupRow||d||c&&r.field)?lc({align:a}):null);return c?r.field?cn("div",{class:f},[d,cn("div",{class:lt},[l??null])]):d?cn("div",{class:f},[d]):null:cn("div",{class:f},[u,d,cn("div",{class:lt},[l??null])])}}function Vy({groupIndexForColumn:o,groupRenderStrategy:t,toggleGroupRow:e,initialRenderGroupIcon:n}){return i=>{let{rowInfo:r,value:a,rootGroupBy:l,pivotBy:u,column:d}=i,s=t!=="inline"?r:r.isGroupRow&&r.parents?.[o]||r;if(!s)return null;let c=s.collapsed;if(t==="inline"){if(s.groupCount===1)return a;if(s.groupNesting===o&&c)return null}else if(!s.isGroupRow||t==="multi-column"&&o+1!==s.groupNesting)return null;let f=s.groupKeys,m=null,p=u?(s.groupKeys?.length||0)<l?.length:(s.groupKeys?.length||0)<=l?.length;return Zd(s)?m=cn(ac):p&&(m=cn(dn,{expanded:!c,direction:d.align==="end"?"end":"start",onChange:()=>{e(f)}})),n&&(i.renderBag.groupIcon=m,m=n(i)),m}}function mc(){return{getGroupColumnRender:zy,getGroupColumnRenderGroupIcon:Vy}}function hc(o,t,e){return dc(o,t,e,mc())}function gc(o,t,e){return cc(o,t,e,mc())}function yc(o){let{pivotColumns:t,groupBy:e,pivotBy:n,selectionMode:i,groupColumn:r,pivotTotalColumnPosition:a,pivotGrandTotalColumnPosition:l,pivotColumn:u,groupRenderStrategy:d,toggleGroupRow:s,columns:c}=o;if(d==="inline")return{columns:void 0,groupColumnIds:[]};let f={},m=[];if(d==="multi-column")e.forEach((p,h,y)=>{let C=hc({groupByForColumn:p,groupBy:e,pivotBy:n,groupIndexForColumn:h,groupCount:y.length,groupRenderStrategy:d,selectionMode:i},s,r),b=C.id||`group-by-${p.field||p.groupField}`;m.push(b),f[b]=C});else if(d==="single-column"&&e.length){let p=gc({groupCount:e.length,groupBy:e,pivotBy:n,groupRenderStrategy:d,selectionMode:i},s,r),h=p.id||"group-by";m.push(h),f[h]=p}return t?Object.keys(t).forEach(p=>{let h=t[p],y=h.pivotTotalColumn&&h.columnGroup,C=h.pivotTotalColumn&&!h.columnGroup;if(y&&a===!1||C&&l===!1)return;let b={...h};u&&(typeof u=="function"?b={...b,...u({column:b,pivotBy:n,groupBy:e})}:b={...b,...u}),b.inheritFromColumn!==!1&&(b={...typeof b.inheritFromColumn=="string"?c[b.inheritFromColumn]:b.pivotAggregator?.field?tn(c,b.pivotAggregator.field):void 0,...b}),!b.render&&b.renderValue&&(b.render=w=>b.renderValue(w)),f[p]=b}):Object.keys(c).forEach(p=>{let h=c[p];f[p]=h}),{columns:Object.keys(f).length?f:void 0,groupColumnIds:m}}function bc(o){return typeof o.field=="string"}function Cc(o){let{column:t,rowInfo:e,fieldsToColumn:n}=o,i;if(t.groupByForColumn){if(e.isGroupRow){let r=e.groupBy[e.groupBy.length-1];(Array.isArray(t.groupByForColumn)||t.groupByForColumn===r)&&(i=r?n.get(r.field||r.groupField):void 0)}!i&&t.field&&(i=n.get(t.field))}return i}function Dt(o){let{getComputed:t,getDataSourceState:e,getState:n,rowIndex:i,columnId:r,api:a,dataSourceApi:l}=o,{dataArray:u}=e(),d=u[i],{isGroupRow:s,isTreeNode:c}=d,f=t().computedColumnsMap.get(r),{activeRowIndex:m,keyboardNavigation:p,isRowDetailEnabled:h}=n(),y=i===m&&p==="row",C=!h||typeof h=="function"&&!h(d)?!1:a.rowDetailApi.isRowDetailExpanded(d.id)?"expanded":"collapsed",{formattedValue:b,formattedValueContext:{rawValue:w}}=zn({column:f,rowInfo:d,rowDetailState:C,columnsMap:t().computedColumnsMap,context:o}),S=Je(f.id,o);return s?{api:a,dataSourceApi:l,column:f,columnApi:S,isParentNode:!1,isGroupRow:!0,isTreeNode:!1,nodeExpanded:!1,rowDetailState:!1,data:d.data,rowActive:y,rowInfo:d,rowSelected:d.rowSelected,value:b,rawValue:w}:c?d.isParentNode?{api:a,dataSourceApi:l,columnApi:S,column:f,nodeExpanded:d.nodeExpanded,isTreeNode:!0,isGroupRow:!1,isParentNode:!0,rowDetailState:C,data:d.data,rowActive:y,rowInfo:d,rowSelected:d.rowSelected,value:b,rawValue:w}:{api:a,dataSourceApi:l,columnApi:S,column:f,nodeExpanded:!1,isTreeNode:!0,isGroupRow:!1,isParentNode:!1,rowDetailState:C,data:d.data,rowActive:y,rowInfo:d,rowSelected:d.rowSelected,value:b,rawValue:w}:{api:a,dataSourceApi:l,columnApi:S,column:f,isTreeNode:!1,isParentNode:!1,isGroupRow:!1,nodeExpanded:!1,rowDetailState:C,data:d.data,rowActive:y,rowInfo:d,rowSelected:d.rowSelected,value:b,rawValue:w}}function Tc(o){return wc(o.column,o.rowInfo)}function Sc(o){let{column:t,context:e,rowInfo:n,visibleColumnIds:i}=o,r=Cc({rowInfo:n,column:t,fieldsToColumn:o.fieldsToColumn,groupRenderStrategy:e.getState().groupRenderStrategy}),{getState:a}=e,{editingCell:l}=a(),u=zn(o),{formattedValueContext:d}=u,s=e.api.isEditorVisibleForCell({columnId:t.id,rowIndex:n.indexInAll}),c=Object.assign({rowIndexInHorizontalLayoutPage:o.rowIndexInHorizontalLayoutPage,horizontalLayoutPageIndex:o.horizontalLayoutPageIndex,column:o.column,inEdit:s,rowHasSelectedCells:!1},d,{editError:l&&l.primaryKey===n.id&&l.columnId===t.id&&!l.active&&l.accepted instanceof Error?l.accepted:void 0});Object.defineProperty(c,"rowHasSelectedCells",{get(){return n.hasSelectedCells(i)}});let f=typeof t.align=="function"?t.align({isHeader:!1,...c}):t.align??"start",m=typeof t.verticalAlign=="function"?t.verticalAlign({isHeader:!1,...c}):t.verticalAlign??"center";return{inEdit:s,stylingParam:c,formattedValueContext:d,renderFunctions:{renderGroupIcon:t.renderGroupIcon||r?.renderGroupIcon,renderSelectionCheckBox:t.renderSelectionCheckBox,renderRowDetailIcon:t.renderRowDetailIcon,renderTreeIcon:t.renderTreeIcon,renderTreeIconForParentNode:t.renderTreeIconForParentNode,renderTreeIconForLeafNode:t.renderTreeIconForLeafNode,renderValue:t.renderValue||r?.renderValue,renderGroupValue:t.renderGroupValue||r?.renderGroupValue,renderLeafValue:t.renderLeafValue||r?.renderLeafValue},renderParams:Gy({rowIndexInHorizontalLayoutPage:o.rowIndexInHorizontalLayoutPage,horizontalLayoutPageIndex:o.horizontalLayoutPageIndex,column:o.column,rowInfo:o.rowInfo,visibleColumnIds:o.visibleColumnIds,columnsMap:o.columnsMap,fieldsToColumn:o.fieldsToColumn,context:o.context,align:f,verticalAlign:m,formattedValueContext:d}),groupByColumnReference:r}}function Gy(o){let{column:t,context:e,rowInfo:n,align:i,verticalAlign:r,visibleColumnIds:a,columnsMap:l,fieldsToColumn:u,formattedValueContext:d}=o,{value:s}=d,{api:c,getDataSourceState:f,getState:m,dataSourceApi:p}=e,{editingCell:h}=m(),{indexInAll:y}=n,C=f(),{selectionMode:b,cellSelection:w}=C,S=Cc({rowInfo:n,column:t,fieldsToColumn:u,groupRenderStrategy:e.getState().groupRenderStrategy}),T=c.toggleGroupRow,I=w?.isCellSelected(n.id,t.id)??!1,x={column:t,columnsMap:l,fieldsToColumn:u,align:i,verticalAlign:r,cellSelected:I,rowHasSelectedCells:!1,horizontalLayoutPageIndex:o.horizontalLayoutPageIndex,rowIndexInHorizontalLayoutPage:o.rowIndexInHorizontalLayoutPage,...d,editError:h&&h.primaryKey===n.id&&h.columnId===t.id&&!h.active&&h.accepted instanceof Error?h.accepted:void 0,groupByColumn:S,selectionMode:b,api:c,dataSourceApi:p,toggleCurrentRowDetails:()=>c.rowDetailApi.toggleRowDetail(n.id),toggleRowDetails:c.rowDetailApi.toggleRowDetail,expandRowDetails:c.rowDetailApi.expandRowDetail,collapseRowDetails:c.rowDetailApi.collapseRowDetail,toggleCurrentTreeNode:()=>{p.treeApi.toggleNode(n.nodePath)},toggleTreeNode:p.treeApi.toggleNode,expandTreeNode:p.treeApi.expandNode,collapseTreeNode:p.treeApi.collapseNode,selectTreeNode:p.treeApi.selectNode,deselectTreeNode:p.treeApi.deselectNode,toggleTreeNodeSelection:p.treeApi.toggleNodeSelection,toggleCurrentTreeNodeSelection:()=>{n.isTreeNode&&p.treeApi.toggleNodeSelection(n.nodePath)},selectRow:c.rowSelectionApi.selectRow,deselectRow:c.rowSelectionApi.deselectRow,toggleRowSelection:c.rowSelectionApi.toggleRowSelection,toggleGroupRowSelection:c.rowSelectionApi.toggleGroupRowSelection,selectCell:()=>{c.cellSelectionApi.selectCell({rowId:n.id,colId:t.id})},deselectCell:()=>{c.cellSelectionApi.deselectCell({rowId:n.id,colId:t.id})},renderBag:{all:null,value:typeof s=="boolean"?`${s}`:s,selectionCheckBox:null,groupIcon:null,treeIcon:null},selectCurrentRow:()=>{if(!n.isTreeNode)return c.rowSelectionApi.selectRow(n.id,n.dataSourceHasGrouping?n.groupKeys:void 0)},deselectCurrentRow:()=>{if(!n.isTreeNode)return c.rowSelectionApi.deselectRow(n.id,n.dataSourceHasGrouping?n.groupKeys:void 0)},rowIndex:y,toggleGroupRow:T,toggleCurrentGroupRow:()=>{n.isGroupRow&&T(n.groupKeys)},toggleCurrentRowSelection:()=>{if(!(n.isGroupRow||n.isTreeNode))return c.rowSelectionApi.toggleRowSelection(n.id)},toggleCurrentGroupRowSelection:()=>{if(n.isGroupRow)return c.rowSelectionApi.toggleGroupRowSelection(n.isGroupRow?n.groupKeys:[])},rootGroupBy:C.groupBy,pivotBy:C.pivotBy};return Object.defineProperty(x,"rowHasSelectedCells",{get(){return n.hasSelectedCells(a)}}),x}function Ky(o,t){if(!o.isGroupRow)return;let e=o.groupData;if(!e.length)return;let n=e[0][t];for(let i=1,r=e.length;i<r;i++)if(e[i][t]!==n)return;return n}function wc(o,t){let{data:e,isGroupRow:n,dataSourceHasGrouping:i}=t,r=i?t.groupBy:void 0,a=n&&r&&o.groupByForColumn&&(Array.isArray(o.groupByForColumn)||o.groupByForColumn===r[r.length-1])?t.value:bc(o)?e?.[o.field]:null;return o.field&&t.isGroupRow&&t.reducerData&&t.reducerData[o.field]!=null&&(a=t.reducerData[o.field]),a===void 0&&t.isGroupRow&&o.groupByForColumn&&bc(o)&&(a=Ky(t,o.field)),o.valueGetter&&!t.isGroupRow&&t.data&&(a=o.valueGetter({data:t.data,field:o.field})),a}function By(o,t,e,n,i){let{rowSelected:r,indexInAll:a}=e,{activeRowIndex:l,keyboardNavigation:u}=n.getState(),d=a===l&&u==="row";return e.isGroupRow?{rowInfo:e,isGroupRow:!0,isTreeNode:!1,isParentNode:!1,nodeExpanded:!1,data:e.data,rowDetailState:!1,rowSelected:r,rowActive:d,value:o,rawValue:o,field:t.field}:e.isTreeNode?e.isParentNode?{rowInfo:e,isGroupRow:!1,isTreeNode:!0,isParentNode:!0,nodeExpanded:e.nodeExpanded,data:e.data,rowDetailState:i,rowSelected:r,rowActive:d,value:o,rawValue:o,field:t.field}:{rowInfo:e,isGroupRow:!1,isTreeNode:!0,isParentNode:!1,nodeExpanded:!1,data:e.data,rowDetailState:i,rowSelected:r,rowActive:d,value:o,rawValue:o,field:t.field}:{rowInfo:e,isGroupRow:!1,isTreeNode:!1,isParentNode:!1,nodeExpanded:!1,data:e.data,rowDetailState:i,rowSelected:r,rowActive:d,value:o,rawValue:o,field:t.field}}function zn(o){let{column:t,rowInfo:e,context:n,rowDetailState:i}=o,r=wc(t,e),a=By(r,t,e,n,i),l=t.valueFormatter?t.valueFormatter(a):r;return a.value=l,{formattedValue:l,formattedValueContext:a}}function ya(o,t){let{rowIndex:e,primaryKey:n}=t,{dataArray:i}=o.getDataSourceState();if(n!==void 0){let r=o.dataSourceApi.getIndexByPrimaryKey(n);if(r!==-1)return r;if(i[e]?.id!==n)return-1}return i[e]?e:-1}function vc(o,t){let e=ya(o,t);return e===-1?null:Dt({...o,rowIndex:e,columnId:t.columnId})}function To(o,t){console.warn(`Skipping "${o}": the edited row (primaryKey: ${String(t.primaryKey)}, rowIndex: ${t.rowIndex}) is no longer in the data array.`)}function ba(o){let{getComputed:t,getState:e,actions:n}=o,i=e().columnMenuVisibleForColumnId;if(!i)return;let r=t(),a=r.computedVisibleColumnsMap,l=r.computedColumnOrder;if(a.has(i)){n.columnMenuVisibleKey=Date.now();return}function u(m,p){let h=l[d+m*p],y=a.get(h);if(y&&y.renderMenuIcon!==!1)return h}let d=l.indexOf(i),s=0,c=-1,f;for(;!f&&s<l.length&&(s++,f=u(s,c),f||(c*=-1,f=u(s,c)),!f););return f&&(n.columnMenuVisibleForColumnId=f),f}function _i(o,t){let{rowIndex:e,colIndex:n}=o,{rowIndex:i,colIndex:r}=t,[a,l]=n>r?[r,n]:[n,r],[u,d]=e>i?[i,e]:[e,i];return[{rowIndex:u,colIndex:a},{rowIndex:d,colIndex:l}]}function Ca(o,t,e){let{rowsPerPage:n}=e;return n?Math.floor(o.rowIndex/n)===Math.floor(t.rowIndex/n):!0}function Rc(o,t,e){if(Ca(o,t,e))throw"You should not call this when the positions are in the same page";let{rowsPerPage:n,columnsPerSet:i}=e;if(n===0)throw"rowsPerPage cannot be 0";let r=o,a=t;Math.floor(o.rowIndex/n)>Math.floor(t.rowIndex/n)&&(r=t,a=o);let{rowIndex:l,colIndex:u}=r,{rowIndex:d,colIndex:s}=a,c=Math.floor(l/n),f=Math.floor(d/n),m=l%n,p=d%n,h=Math.min(m,p),y=Math.max(m,p),C=[];for(let b=c;b<=f;b++)for(let w=h;w<=y;w++){let S=b*n+w;if(b===c)for(let T=u;T<i;T++)C.push({rowIndex:S,colIndex:T});else if(b===f)for(let T=0;T<=s;T++)C.push({rowIndex:S,colIndex:T});else for(let T=0;T<i;T++)C.push({rowIndex:S,colIndex:T})}return C}function Hy(o,t){let e=new Set(o);return t.map(n=>e.has(n)?n:null).filter(n=>n!=null)}var Ta=class{constructor(t){this.getCellSelectionPosition=t=>{let e=t.rowId??Yt(t.rowIndex,this.getDataSourceState)?.id,n=t.colId??this.getComputed().computedVisibleColumns[t.colIndex].id;return[e,n]};this.setRangeSelected=(t,e,n)=>{let i=this.getDataSourceState(),r=i.cellSelection;if(!r)return;let a=new Ke(r);a.debugId=i.debugId??"";let[l,u]=this.getCellSelectionPosition(t),[d,s]=this.getCellSelectionPosition(e),c=this.getComputed().computedVisibleColumnsMap.get(u),f=this.getComputed().computedVisibleColumnsMap.get(s);if(!c||!f)return;let m=c.computedVisibleIndex,p=f.computedVisibleIndex,h=Yt(l,this.getDataSourceState),y=Yt(d,this.getDataSourceState);if(!h||!y)return;let C=h.indexInAll,b=y.indexInAll,[w,S]=_i({rowIndex:C,colIndex:m},{rowIndex:b,colIndex:p});for(let T=w.rowIndex;T<=S.rowIndex;T++)for(let I=w.colIndex;I<=S.colIndex;I++){let x={rowIndex:T,colIndex:I},[F,N]=this.getCellSelectionPosition(x);n?a.selectCell(F,N):a.deselectCell(F,N)}this.dataSourceActions.cellSelection=a};this.getCellSelectionPositionsWithFn=(t,e)=>{let n=ai(this.getDataSourceState),{computedVisibleColumns:i}=this.getComputed(),r=i.map(c=>c.id),a=new Set,l=[],u=new Set;n.filter(c=>{i.forEach(f=>{this.isCellSelected({rowId:c.id,colId:f.id})&&(a.has(f.id)||a.add(f.id),u.has(c.id)||(u.add(c.id),l.push(c)))})});let d=Hy(Array.from(a),r),s=l.map(c=>d.map(f=>this.isCellSelected({rowId:c.id,colId:f})?t(c,f):e));return{columnIds:d,positions:s}};this.getAllCellSelectionPositions=()=>this.getCellSelectionPositionsWithFn((t,e)=>[t.id,e],null);this.mapCellSelectionPositions=(t,e)=>this.getCellSelectionPositionsWithFn(t,e);this.deselectAll=()=>{let t=this.getDataSourceState(),e=t.cellSelection;if(!e)return;let n=new Ke(e);n.debugId=t.debugId??"",n.deselectAll(),this.dataSourceActions.cellSelection=n};this.clear=()=>{this.deselectAll()};this.selectAll=()=>{let t=this.getDataSourceState(),e=t.cellSelection;if(!e)return;let n=new Ke(e);n.debugId=t.debugId??"",n.selectAll(),this.dataSourceActions.cellSelection=n};this.selectRange=(t,e)=>{this.setRangeSelected(t,e,!0)};this.deselectRange=(t,e)=>{this.setRangeSelected(t,e,!1)};this.isCellSelected=t=>{let[e,n]=this.getCellSelectionPosition(t);return this.getDataSourceState().cellSelection?.isCellSelected(e,n)??!1};this.selectCell=t=>{let e=this.getDataSourceState(),n=e.cellSelection;if(!n)return;let[i,r]=this.getCellSelectionPosition(t),a=t.clear?new Ke:new Ke(n);a.debugId=e.debugId??"",a.selectCell(i,r),this.dataSourceActions.cellSelection=a};this.deselectCell=t=>{let e=this.getDataSourceState(),n=e.cellSelection;if(!n)return;let[i,r]=this.getCellSelectionPosition(t),a=new Ke(n);a.debugId=e.debugId??"",a.deselectCell(i,r),this.dataSourceActions.cellSelection=a};this.selectColumn=(t,e)=>{e?.clear&&this.deselectAll();let n=this.getDataSourceState(),i=n.cellSelection;if(!i)return;let r=new Ke(i);r.debugId=n.debugId??"",r.selectColumn(t),this.dataSourceActions.cellSelection=r};this.deselectColumn=t=>{let e=this.getDataSourceState(),n=e.cellSelection;if(!n)return;let i=new Ke(n);i.debugId=e.debugId??"",i.deselectColumn(t),this.dataSourceActions.cellSelection=i};this.getComputed=t.getComputed,this.getDataSourceState=t.getDataSourceState,this.dataSourceActions=t.dataSourceActions}};function Ic(o){return new Ta(o)}function xc(o){let{dataSourceApi:t,getState:e,actions:n}=o,i={collapseAllDetails(){n.rowDetailState=new ut({collapsedRows:!0,expandedRows:[]})},expandAllDetails(){n.rowDetailState=new ut({expandedRows:!0,collapsedRows:[]})},isRowDetailCollapsed(r){let a=e().isRowDetailExpanded;if(!a)return!0;let l=t.getRowInfoByPrimaryKey(r);return l?!a(l):!0},isRowDetailEnabledForRow(r){let{isRowDetailEnabled:a}=e();if(!a)return!1;if(typeof a=="function"){let l=t.getRowInfoByPrimaryKey(r);return l?a(l):!1}return!0},isRowDetailExpanded(r){return!i.isRowDetailCollapsed(r)},collapseRowDetail(r){let a=e(),l=a.rowDetailState;if(!l){console.error("Cannot collapse row details via rowDetailState, as no props.rowDetailState is provided.");return}let u=new ut(l);u.collapseRowDetails(r),a.lastRowToExpandRef.current=null,a.lastRowToCollapseRef.current=r,n.rowDetailState=u},expandRowDetail(r){let a=e(),l=a.rowDetailState;if(!l){console.error("Cannot expand row details via rowDetailState, as no props.rowDetailState is provided.");return}let u=new ut(l);u.expandRowDetails(r),a.lastRowToCollapseRef.current=null,a.lastRowToExpandRef.current=r,n.rowDetailState=u},toggleRowDetail(r){i.isRowDetailExpanded(r)?i.collapseRowDetail(r):i.expandRowDetail(r)}};return i}function Xt(o,t,e){return Math.min(Math.max(o,t),e)}function Mi(o,t,e){let n=o().dataArray,i=0,r=n.length-1,a=t;do{a+=e;let l=n[a];if(!l)return a<i?i:r;if(!l.rowDisabled)return a}while(a>=i&&a<=r);return Xt(a,i,r)}function Wy(o,t){let{getState:e,getDataSourceState:n,actions:i,api:r,dataSourceApi:a}=o,{key:l}=t,u=n().dataArray,d=u.length,s=e(),{brain:c}=s,{activeRowIndex:f}=s;if(f==null)return!1;let{start:[m],end:[p]}=c.getRenderRange(),h=f,y=p-m-1,C=0,b=d-1,w={ArrowDown:()=>{f=Mi(n,f,1)},ArrowUp:()=>{f=Mi(n,f,-1)},ArrowLeft:()=>{let T=u[f];if(c.isHorizontalLayoutBrain){let I=c.rowsPerPage;f-I>=C?f=f-I:w.ArrowUp();return}return T&&T.isGroupRow?r.collapseGroupRow(T.groupKeys):T&&r.rowDetailApi.isRowDetailEnabledForRow(T.id)?r.rowDetailApi.collapseRowDetail(T.id):!1},ArrowRight:()=>{let T=u[f];if(c.isHorizontalLayoutBrain){let I=c.rowsPerPage;f+I<=b?f=f+I:w.ArrowDown();return}return T&&T.isGroupRow?r.expandGroupRow(T.groupKeys):T&&r.rowDetailApi.isRowDetailEnabledForRow(T.id)?r.rowDetailApi.expandRowDetail(T.id):!1},Enter:()=>{let T=u[f];return T&&T.isGroupRow?r.toggleGroupRow(T.groupKeys):T&&T.isTreeNode&&T.isParentNode?a.treeApi.toggleNode(T.nodePath):r.rowDetailApi.isRowDetailEnabledForRow(T.id)?r.rowDetailApi.toggleRowDetail(T.id):!1},PageDown:()=>{f=Math.min(f+y,d-1)},PageUp:()=>{f=Math.max(f-y,C)},End:()=>{f=b},Home:()=>{f=C}},S=w[l];return S?(S(),h!==f?(i.activeRowIndex=f,!0):!1):!1}function Sa(o,t){let{api:e,getState:n,getComputed:i,getDataSourceState:r,dataSourceApi:a}=o,{key:l,shiftKey:u}=t,d=r().dataArray,s=n(),{activeCellIndex:c,brain:f}=s;if(!c)return!1;let[m,p]=c,{start:[h,y],end:[C,b]}=f.getRenderRange(),w=C-h-1,S=b-y-1,T=r().dataArray.length-1,I=i().computedVisibleColumns.length-1,x=0,F=0;m=Xt(m,0,T),p=Xt(p,0,I);let N={ArrowDown:()=>{m=Xt(m+1,x,T)},ArrowUp:()=>{m=Xt(m-1,x,T)},ArrowLeft:()=>{if(p===F)if(m!==x&&(p=I),f.isHorizontalLayoutBrain){let A=f.rowsPerPage;m-A>=x?m=m-A:N.ArrowUp()}else N.ArrowUp();else p=Xt(p-1,F,I)},ArrowRight:()=>{if(p===I)if(m!==T&&(p=F),f.isHorizontalLayoutBrain){let A=f.rowsPerPage;m+A<=T?m=m+A:N.ArrowDown()}else N.ArrowDown();else p=Xt(p+1,F,I)},Enter:()=>{let A=d[m];return A&&A.isGroupRow?e.toggleGroupRow(A.groupKeys):A&&A.isTreeNode&&A.isParentNode?a.treeApi.toggleNode(A.nodePath):A&&e.rowDetailApi.isRowDetailEnabledForRow(A.id)?e.rowDetailApi.toggleRowDetail(A.id):!1},PageDown:()=>{u?p=Math.min(p+S,I):m=Math.min(m+w,T)},PageUp:()=>{u?p=Math.max(p-S,F):m=Math.max(m-w,x)},End:()=>{u?p=I:m=T},Home:()=>{u?p=F:m=x}},R=N[l];return R?(R(),[m,p]):!1}function jy(o,t){let e=Sa(o,t);return e?(o.actions.activeCellIndex=e,!0):!1}var $y={ArrowUp:!0,ArrowDown:!0,ArrowLeft:!0,ArrowRight:!0,PageUp:!0,PageDown:!0,Home:!0,End:!0,Enter:!0," ":!0};function Pc(o,t){let{key:e}=t,{getState:n}=o,i=n(),{activeRowIndex:r,activeCellIndex:a,keyboardNavigation:l,cellContextMenuVisibleFor:u,contextMenuVisibleFor:d}=i;return u||d||!$y[e]?!1:r!=null&&l==="row"?Wy(o,t):a!=null&&l==="cell"?jy(o,t):!1}var wa=class{constructor(t){this.param=t}setKeyboardNavigation(t){this.param.actions.keyboardNavigation=t}setActiveCellIndex(t){this.param.actions.activeCellIndex=t}setActiveRowIndex(t){this.param.actions.activeRowIndex=t}gotoRowWithDirection(t){let{getDataSourceState:e,getState:n}=this.param,{activeRowIndex:i,keyboardNavigation:r}=n();if(r!=="row")return console.error("Keyboard navigation is not enabled for rows"),!1;if(i==null)return!1;let a=Mi(e,i,t);return a!==i?(this.param.actions.activeRowIndex=a,a):!1}gotoRow(t){return this.gotoRowWithDirection(t)}gotoNextRow(){return this.gotoRow(1)}gotoPreviousRow(){return this.gotoRow(-1)}gotoCell(t){let{direction:e}=t,n=e=="top"?"ArrowUp":e=="bottom"?"ArrowDown":e=="left"?"ArrowLeft":"ArrowRight",i=Sa(this.param,{key:n,shiftKey:!1});return i===!1?!1:(this.param.actions.activeCellIndex=i,i)}};function Dc(o){return new wa(o)}function Ac(o,t){return o.id?o.id===t.id:!!(o.field&&o.field===t.field)}var va=class{constructor(t){this.columnApiById=new Map;this.getVisibleRenderRange=()=>this.getState().brain.getRenderRange();this.hideFilterOperatorMenu=()=>{this.actions.filterOperatorMenuVisibleForColumnId=null};this.setGroupRenderStrategy=t=>{this.actions.groupRenderStrategy=t};this.getColumnOrder=()=>this.getComputed().computedColumnOrder;this.getComputedColumnById=t=>this.getComputed().computedColumnsMap.get(t);this.getVisibleColumnOrder=()=>{let t=this.getColumnOrder(),e=this.getComputed().computedVisibleColumnsMap;return t.filter(n=>e.has(n))};this.persistEdit=async t=>{t=t??{};let{editingCell:e,editingValueRef:n}=this.getState();if(!e)return Promise.resolve(new Error("no edit in progress"));await new Promise(f=>requestAnimationFrame(f));let i=this.getComputed().computedColumnsMap.get(e.columnId),r=t.value??e.value;!e.active&&e.waiting!=="persist"&&(this.actions.editingCell={...e,active:!1,waiting:"persist"});let a=ya({...this.context,api:this},e);if(a===-1){let f=new Error(`Cannot persist edit: the edited row (primaryKey: ${String(e.primaryKey)}, rowIndex: ${e.rowIndex}) is no longer in the data array.`);return this.actions.editingCell={...e,active:!1,accepted:!1,waiting:!1,persisted:f},Promise.resolve(f)}let l={...Dt({rowIndex:a,columnId:e.columnId,...this.context,api:this}),value:r,initialValue:e.initialValue},u=r;n.current=null,i.getValueToPersist&&(u=await i.getValueToPersist(l)),l.value=u,e.value=u;let d=this.getState().persistEdit??(()=>{if(!l.column.field)return r;let f=this.getDataSourceState().primaryKey,m=l.data&&typeof f=="string"?{[f]:l.data[f],[l.column.field]:u}:{...l.data,[l.column.field]:u};return this.context.dataSourceApi.updateData(m)}),s;try{s=await d(l)}catch(f){s=f}let c=s instanceof Error?s:!0;return this.actions.editingCell={...e,active:!1,accepted:!1,waiting:!1,persisted:c},Promise.resolve(c)};this.clearEditInfo=()=>{this.actions.editingCell=null};this.isEditInProgress=()=>{let{editingCell:t}=this.getState();return t?t.active:!1};this.isEditorVisibleForCell=t=>{let{rowIndex:e,columnId:n}=t,{dataArray:i}=this.getDataSourceState(),{editingCell:r}=this.getState(),a=i[e];return!a||!r?!1:r.columnId===n&&r.primaryKey===a.id&&!!(r.active||r.waiting)};this.confirmEdit=t=>this.stopEdit({value:t});this.stopEdit=async t=>{let e=this.getState(),{editingCell:n,editingValueRef:i}=e;if(!n)return!0;t||(t={});let r=t.value??i.current;if(!t.cancel&&!t.reject){let{rowIndex:a,columnId:l}=n;this.actions.editingCell={...e.editingCell,value:r,active:!1,waiting:"accept"};let{computedColumnsMap:u}=this.getComputed(),d=u.get(l),s=e.shouldAcceptEdit??d.shouldAcceptEdit,c=s?s({...Dt({...this.context,api:this,dataSourceApi:this.context.dataSourceApi,columnId:l,rowIndex:a}),value:r,initialValue:n.initialValue}):!0;return await new Promise(f=>requestAnimationFrame(f)),Promise.resolve(c).then(f=>{if(f===!0)return this.actions.editingCell={...e.editingCell,active:!1,accepted:!0,persisted:!1,waiting:"persist",value:r},!0;throw f}).catch(f=>(f instanceof Error||(f=new Error(`Edit rejected: ${f}`)),this.actions.editingCell={...n,value:r,persisted:!1,active:!1,waiting:!1,accepted:f},{reject:f,value:r}))}return t.cancel&&n?.active?(this.actions.editingCell={...n,active:!1,cancelled:!0,waiting:!1,persisted:!1},{cancel:!0,value:r}):t.reject&&n?.active?(this.actions.editingCell={...n,value:r,active:!1,persisted:!1,waiting:!1,accepted:t.reject},{reject:t.reject,value:r}):!0};this.cancelEdit=()=>this.stopEdit({cancel:!0});this.rejectEdit=t=>this.stopEdit({reject:t});this.getColumnAtIndex=t=>this.getComputed().computedVisibleColumns[t]??null;this.isCellEditable=t=>{let{rowIndex:e,primaryKey:n,columnId:i}=t,r=e??this.context.dataSourceApi.getIndexByPrimaryKey(n),{computedColumnsMap:a}=this.getComputed(),l=a.get(i);if(!l||!l.computedEditable||l.groupByForColumn)return Promise.resolve(!1);let u=this.getDataSourceState().dataArray[r];if(!u||u.isGroupRow)return Promise.resolve(!1);if(l.computedEditable===!0)return Promise.resolve(!0);let d=l.computedEditable(Dt({...this.context,api:this,columnId:i,rowIndex:r}));return typeof d=="boolean"?Promise.resolve(d):d};this.getColumnApi=t=>{let e=typeof t=="string"?t:this.getComputed().computedVisibleColumns[t]?.id,n=this.columnApiById.get(e);if(n)return n;let i=Je(t,{...this.context,api:this});return i&&this.columnApiById.set(i.getColumnId(),i),i};this.isColumnSortable=t=>this.getColumnApi(t)?.isSortable()??!1;this.getCellValue=t=>this.getCellValues(t)?.value??null;this.getCellValues=t=>{let{rowIndex:e,primaryKey:n,columnId:i}=t,{dataSourceApi:r,getState:a}=this.context,{computedColumnsMap:l}=this.getComputed(),u=e??r.getIndexByPrimaryKey(n),d=l.get(i),s=r.getRowInfoByIndex(u),c=s?.id;if(!s||!d)return d||console.warn(`No column found with id: "${i}"`),s||console.warn(`No row found with index: "${u}" or primary key: "${c}"`),null;let f=this,{isRowDetailEnabled:m}=a(),p=!m||typeof m=="function"&&!m(s)?!1:this.rowDetailApi.isRowDetailExpanded(s.id)?"expanded":"collapsed",h=zn({column:d,rowInfo:s,columnsMap:l,context:{...this.context,api:f},rowDetailState:p});return{value:h.formattedValueContext.value,formattedValue:h.formattedValue,rawValue:h.formattedValueContext.rawValue}};this.getVerticalRenderRange=()=>{let t=this.getState().brain.getRenderRange();return{renderStartIndex:t.start[0],renderEndIndex:t.end[0]}};this.setColumnOrder=t=>{this.actions.columnOrder=t};this.setVisibilityForColumnGroup=(t,e)=>{let n={...this.getState().columnGroupVisibility};e?delete n[t]:n[t]=!1,this.actions.columnGroupVisibility=n};this.collapseAllGroupRows=()=>{let t=this.getDataSourceState(),e=new pt(t.groupRowsState);e.collapseAll(),this.dataSourceActions.groupRowsState=e};this.collapseGroupRow=t=>this.getDataSourceState().groupRowsState.isGroupRowExpanded(t)?(this.toggleGroupRow(t),!0):!1;this.expandGroupRow=t=>this.getDataSourceState().groupRowsState.isGroupRowCollapsed(t)?(this.toggleGroupRow(t),!0):!1;this.toggleGroupRow=t=>{let e=this.getDataSourceState(),n=new pt(e.groupRowsState);if(n.toggleGroupRow(t),this.dataSourceActions.groupRowsState=n,e.lazyLoad){let i=[at,...t],r=e.originalLazyGroupData.get(i);n.isGroupRowExpanded(t)?r?.cache||Pn(e.data,e,this.dataSourceActions,{groupKeys:t},this.context.getDataSourceMasterContext()):r?.cache||(e.lazyLoadCacheOfLoadedBatches.getKeysStartingWith(t).forEach(l=>{e.lazyLoadCacheOfLoadedBatches.delete(l)}),this.dataSourceActions.lazyLoadCacheOfLoadedBatches=W.clone(e.lazyLoadCacheOfLoadedBatches),e.originalLazyGroupData.delete(i),this.dataSourceActions.originalLazyGroupDataChangeDetect=It())}};this.toggleSortingForColumn=(t,e)=>{if(!this.getComputed().computedColumnsMap.get(t))return;let i=this.getSortingForColumn(t);i===null?i=1:i=i===1?-1:null,this.setSortingForColumn(t,i,e)};this.getState=()=>this.context.getState();this.getComputed=()=>this.context.getComputed();this.getDataSourceState=()=>this.context.getDataSourceState();this.scrollCellIntoView=(t,e,n={offset:0})=>{let i=this.getState(),r=this.getComputed(),a=e;if(typeof e=="string"){let h=r.computedVisibleColumnsMap.get(e);if(!h)return!1;a=h.computedVisibleIndex}if(i.brain.isHorizontalLayoutBrain){n=n||{};let h=i.brain.getPageIndexForRow(t);n.horizontalLayoutPageIndex=h||0}let l=i.renderer.getScrollPositionForScrollColumnIntoView(a,n),u=i.renderer.getScrollPositionForScrollRowIntoView(t,n);if(!l||!u)return!1;let d={scrollLeft:l.scrollLeft,scrollTop:u.scrollTop},s=i.brain.getScrollPosition(),c=i.brain.scrollLeftMax,f=i.brain.scrollTopMax;if(c<0&&f<0)return!0;let m=d.scrollLeft>c+(n.offset||0),p=d.scrollTop>f+(n.offset||0);return m&&p?!1:(d.scrollLeft!==s.scrollLeft&&!m&&(i.scrollerDOMRef.current.scrollLeft=d.scrollLeft),d.scrollTop!==s.scrollTop&&!p&&(i.scrollerDOMRef.current.scrollTop=d.scrollTop),!0)};this.context=t,this.rowSelectionApi=wl({dataSourceActions:t.dataSourceActions,getDataSourceState:t.getDataSourceState}),this.keyboardNavigationApi=Dc({getState:t.getState,getDataSourceState:t.getDataSourceState,actions:t.actions,getComputed:t.getComputed,api:this,dataSourceApi:t.dataSourceApi}),this.rowDetailApi=xc({getState:t.getState,actions:t.actions,dataSourceApi:t.dataSourceApi}),this.cellSelectionApi=Ic({dataSourceActions:t.dataSourceActions,getDataSourceState:t.getDataSourceState,getComputed:t.getComputed})}get actions(){return this.context.actions}get dataSourceActions(){return this.context.dataSourceActions}get dataSourceApi(){return this.context.dataSourceApi}focus(){this.getState().scrollerDOMRef.current?.focus()}hideContextMenu(){this.actions.contextMenuVisibleFor=null,this.actions.cellContextMenuVisibleFor=null}realignColumnContextMenu(t){let e={actions:this.actions,getState:this.getState,getComputed:this.getComputed},n=this.getState().columnMenuRealignDelay;(!n||n<0)&&(ba(e),t?.()),setTimeout(()=>{this.isDestroyed()||(ba(e),t?.())},n)}isDestroyed(){return!this.getState().domRef.current}async startEdit(t){let{columnId:e,rowIndex:n,primaryKey:i,value:r}=t,a=n??this.context.dataSourceApi.getIndexByPrimaryKey(i);return this.isCellEditable({rowIndex:a,columnId:e}).then(async l=>{if(l){let u=this.getDataSourceState().dataArray,s=this.getComputed().computedColumnsMap.get(e),c=u[a],f=r??Tc({column:s,rowInfo:c}),m=f;s.getValueToEdit&&(f=await s.getValueToEdit(Dt({...this.context,rowIndex:a,columnId:e,api:this}))),this.actions.editingCell={active:!0,accepted:!1,persisted:!1,columnId:e,value:f,initialValue:m,rowIndex:a,primaryKey:u[a]?.id}}return l})}setSortingForColumn(t,e,n){let{computedColumnsMap:i}=this.getComputed(),r=i.get(t);if(!r||this.getSortingForColumn(t)===e&&this.getDataSourceState().multiSort===!1)return;if(e===null){this.setSortInfoForColumn(t,null,n);return}let l=!!r.pivotColumn,u=r.groupByForColumn,d=l?void 0:r.field,s=u?Array.isArray(u)?u:[u]:[],c=s.map(p=>p.valueGetter?h=>p.valueGetter({data:h,field:p.field}):p.field?p.field:p.groupField??void 0).filter(En);c.length&&(d=c);let f=r.computedSortType;if(s.length&&f===Ot){let p=this.getState().initialColumns;f=s.flatMap(y=>{let C=y.field??y.groupField,b=C?i.get(C):null;if(b)return b.computedSortType;let w=C?tn(p,C):void 0;return w?w.sortType||(typeof w.type=="string"?w.type:"string"):[Ot]})}s.length&&!Array.isArray(f)&&(f=[f]);let m={dir:e,id:r.id,field:d,type:f};!l&&r.valueGetter&&(m.valueGetter=p=>r.valueGetter({data:p,field:r.field})),this.setSortInfoForColumn(t,m,n)}setSortInfoForColumn(t,e,n){let i=this.getDataSourceState(),r=this.getComputed().computedColumnsMap.get(t);if(!r)return;if(!i.multiSort){this.dataSourceApi.setSortInfo(e?[e]:null);return}let a=r.field,l={id:t,field:a},u=i.sortInfo?.slice()??[];if(e===null){u=u.filter(c=>!Ac(c,l)),this.dataSourceApi.setSortInfo(u);return}let d=!1;if((n?.multiSortBehavior??this.getState().multiSortBehavior)==="replace"){this.dataSourceApi.setSortInfo([e]);return}u=u.map(c=>d?c:Ac(c,l)?(d=!0,e):c),d||u.push(e),this.dataSourceApi.setSortInfo(u)}getSortTypeForColumn(t){let e=this.getComputed().computedColumnsMap.get(t);return e?e.computedSortType:null}getSortInfoForColumn(t){let e=this.getComputed().computedColumnsMap.get(t);return e?e.computedSortInfo:null}getSortingForColumn(t){let e=this.getSortInfoForColumn(t);return e?e.dir:null}setPinningForColumn(t,e){let n={...this.getState().columnPinning};e===!1?delete n[t]:n[t]=e,this.actions.columnPinning=n}setColumnFilter(t,e){let n=this.getComputed().computedColumnsMap.get(t);if(!n)return;let i=this.getDataSourceState(),{filterTypes:r}=i,a;if(n.computedFilterValue)a={...n.computedFilterValue,filter:{...n.computedFilterValue.filter}};else{let l=n.computedFilterType;if(!r[l])return;let u={filter:{type:l,value:e,operator:r[l].defaultOperator},valueGetter:n.valueGetter};(n.field||typeof n.groupByForColumn=="string")&&(u.field=n.field||n.groupByForColumn),a=u}a.id=n.id,a.filter.value=e,this.setFilterValueForColumn(t,a)}setColumnFilterOperator(t,e){let n=this.getComputed().computedColumnsMap.get(t);if(!n)return;let i=this.getDataSourceState(),{filterTypes:r}=i,a=n.computedFilterType,l=r[a].operators,u=l.find(c=>c.name===e)??l.find(c=>c.name===r[a].defaultOperator),d=u.name,s;n.computedFilterValue?(s={...n.computedFilterValue,filter:{...n.computedFilterValue.filter,operator:d}},u.defaultFilterValue!==void 0&&(s.filter.value=u.defaultFilterValue)):(s={filter:{operator:d,type:a,value:u.defaultFilterValue!==void 0?u.defaultFilterValue:[...r[a].emptyValues.values()][0]},valueGetter:n.valueGetter},n.field&&(s.field=n.field)),s.id=n.id,this.setFilterValueForColumn(t,s)}setFilterValueForColumn(t,e){let n=this.getComputed().computedColumnsMap.get(t);if(!n)return;let r=this.getDataSourceState().filterValue??[],a=!1;r=r.map(l=>l===n.computedFilterValue?(a=!0,e):l),a||r.push(e),this.dataSourceActions.filterValue=r}removeColumnFilter(t){let e=this.getComputed().computedColumnsMap.get(t);if(!e)return;let i=this.getDataSourceState().filterValue??[],r=!1;i=i.filter(a=>a===e.computedFilterValue?(r=!0,!1):!0),r&&(this.dataSourceActions.filterValue=i)}clearColumnFilter(t){let e=this.getComputed().computedColumnsMap.get(t);if(!e)return;let n=this.getDataSourceState(),i=n.filterValue??[],r=!1;i=i.map(a=>{if(a===e.computedFilterValue){let l=e.computedFilterValue.filter.type,u=n.operatorsByFilterType[l],d=n.filterTypes[l];if(r=!0,!d)return null;let s=a.filter.operator??d?.defaultOperator,f=u[s].defaultFilterValue??(d.emptyValues||[])[0]??void 0;return{...a,filter:{...a.filter,operator:s,value:f}}}return a}).filter(En),r&&(this.dataSourceActions.filterValue=i)}setVisibilityForColumn(t,e){let n={...this.getState().columnVisibility};e?delete n[t]:n[t]=!1,this.actions.columnVisibility=n}getVisibleColumnsCount(){return this.getComputed().computedVisibleColumns.length}setColumnVisibility(t){this.actions.columnVisibility=t}get scrollContainer(){return this.getState().scrollerDOMRef.current}get scrollLeftMax(){return this.getState().brain.scrollLeftMax}get scrollTopMax(){return this.getState().brain.scrollTopMax}get scrollLeft(){return this.getState().brain.getScrollPosition().scrollLeft}set scrollLeft(t){let e=this.getState();e.scrollerDOMRef.current&&(e.scrollerDOMRef.current.scrollLeft=Math.max(t,0))}get scrollTop(){return this.getState().brain.getScrollPosition().scrollTop}set scrollTop(t){let e=this.getState();e.scrollerDOMRef.current&&(e.scrollerDOMRef.current.scrollTop=Math.max(t,0))}scrollRowIntoView(t,e={offset:0}){let n=this.getState(),i=this.getComputed(),r=n.brain.getScrollPosition(),a=e.columnId,l;!a&&n.brain.isHorizontalLayoutBrain&&i.computedVisibleColumns.length>0&&(a=i.computedVisibleColumns[Math.ceil(i.computedVisibleColumns.length/2)].id,l=i.computedVisibleColumnsMap.get(a)?.computedVisibleIndex);let u=n.renderer.getScrollPositionForScrollRowIntoView(t,{...e,colIndex:l});if(!u)return!1;let d=n.brain.scrollTopMax,s=u.scrollLeft!==r.scrollLeft,c=u.scrollTop<=d+(e.offset||0);return!c&&!s?!1:(c&&u.scrollTop!==r.scrollTop&&(n.scrollerDOMRef.current.scrollTop=u.scrollTop),s&&(n.scrollerDOMRef.current.scrollLeft=u.scrollLeft),!0)}scrollColumnIntoView(t,e={offset:0}){let n=this.getState(),r=this.getComputed().computedVisibleColumnsMap.get(t);if(!r)return!1;let a=r.computedVisibleIndex,l=n.renderer.getScrollPositionForScrollColumnIntoView(a,e);if(!l)return!1;let u=n.brain.getScrollPosition(),d=n.brain.scrollLeftMax;return l.scrollLeft>d+(e.offset||0)?!1:(l.scrollLeft!==u.scrollLeft&&(n.scrollerDOMRef.current.scrollLeft=l.scrollLeft),!0)}};function _c(o){return new va(o)}function Uy(o,t){return o<t?[o,t]:[t,o]}var Ei=class{constructor(t){this.multiSelectStartIndex=0;this.getRowAt=t.getRowAt,this.isNodeSelectable=t.isNodeSelectable??(()=>!0)}set rowSelectionState(t){this._rowSelectionState=t,this._treeSelectionState=void 0}get rowSelectionState(){return this._rowSelectionState}set treeSelectionState(t){this._treeSelectionState=t}get treeSelectionState(){return this._treeSelectionState}deselectAll(){(this._treeSelectionState??this._rowSelectionState).deselectAll()}isContainerRow(t){return t.isGroupRow||!!t.isParentNode}isExpanded(t){return t.isGroupRow?!t.collapsed:!!t.nodeExpanded}getPath(t){if(t)return this._treeSelectionState?t.nodePath:this.getGroupKeys(t)}getGroupKeys(t){return t.groupKeys&&t.groupKeys.length?t.groupKeys:void 0}setSelectedAt(t,e){let n=this.getRowAt(t);if(!n||n.rowDisabled||n.selfLoaded===!1)return;let i=this._treeSelectionState;if(i){n.nodePath&&this.isNodeSelectable(n)&&i.setNodeSelection(n.nodePath,e);return}let r=this.rowSelectionState,a=this.getGroupKeys(n);if(n.isGroupRow){if(!a)return;e?r.selectGroupRow(a):r.deselectGroupRow(a);return}e?r.selectRow(n.id,a):r.deselectRow(n.id,a)}isSelectedAt(t){let e=this.getRowAt(t);if(!e)return!1;if(this._treeSelectionState)return e.nodePath?this._treeSelectionState.isNodeSelected(e.nodePath):!1;let n=this.getGroupKeys(e);return e.isGroupRow?n?this.rowSelectionState.isGroupRowSelected(n):!1:this.rowSelectionState.isRowSelected(e.id,n)}setRangeSelected(t,e,n){let[i,r]=Uy(t,e);for(let a=i;a<=r;a++){let l=this.getRowAt(a);l&&(a!==t&&this.isFollowedByItsChildren(a,l)||this.setSelectedAt(a,n))}}isFollowedByItsChildren(t,e){if(!this.isContainerRow(e)||!this.isExpanded(e))return!1;let n=this.getPath(e),i=this.getPath(this.getRowAt(t+1));return!n||!i||i.length<n.length?!1:n.every((r,a)=>r===i[a])}resetClick(t){this.deselectAll(),this.setSelectedAt(t,!0),this.multiSelectStartIndex=t,this.multiSelectEndIndex=void 0}singleAddClick(t){if(this.isSelectedAt(t))this.setSelectedAt(t,!1),this.isSelectedAt(t+1)&&(this.multiSelectStartIndex=t+1);else{this.setSelectedAt(t,!0),this.multiSelectStartIndex=t;let e;for(let n=t-1;n>=0&&this.isSelectedAt(n);n--)e=n;this.multiSelectEndIndex=e}}multiSelectClick(t){this.multiSelectEndIndex!=null&&this.setRangeSelected(this.multiSelectStartIndex,this.multiSelectEndIndex,!1),this.setRangeSelected(this.multiSelectStartIndex,t,!0),this.multiSelectEndIndex=t}};var Fi=class{constructor(t){this.multiSelectStartPosition={rowIndex:0,colIndex:0};this.getPrimaryKeyByIndex=t.getPrimaryKeyByIndex,this.getColumnIdByIndex=t.getColumnIdByIndex}getCellSelectionPosition(t){let{rowIndex:e,colIndex:n}=t,i=this.getPrimaryKeyByIndex(e),r=this.getColumnIdByIndex(n);if(!(i===void 0||!r))return[i,r]}set cellSelectionState(t){this._cellSelectionState=t}get cellSelectionState(){return this._cellSelectionState}resetClick(t){this.cellSelectionState.deselectAll();let e=this.getCellSelectionPosition(t);e&&(this.cellSelectionState.deselectAll(),this.cellSelectionState.selectCell(...e),this.multiSelectStartPosition=t,this.multiSelectEndPosition=void 0)}singleAddClick(t){let e=this.getCellSelectionPosition(t);if(e)if(this.cellSelectionState.isCellSelected(...e)){this.cellSelectionState.deselectCell(...e);let n={rowIndex:t.rowIndex+1,colIndex:t.colIndex};this.getCellSelectionPosition(n)&&(this.multiSelectStartPosition=n)}else this.cellSelectionState.selectCell(...e),this.multiSelectStartPosition=t,this.multiSelectEndPosition=void 0}multiSelectClick(t,e){!this.multiSelectStartPosition||!this.getCellSelectionPosition(t)||(this.multiSelectEndPosition&&this.deselectRange(this.multiSelectStartPosition,this.multiSelectEndPosition,e),this.selectRange(this.multiSelectStartPosition,t,e),this.multiSelectEndPosition=t)}setRangeSelected(t,e,n,i){if(i.horizontalLayout&&!Ca(t,e,i)){Rc(t,e,{rowsPerPage:i.rowsPerPage,columnsPerSet:i.columnsPerSet}).forEach(s=>{let c=this.getCellSelectionPosition({rowIndex:s.rowIndex,colIndex:s.colIndex});c&&(n?this.cellSelectionState.selectCell(...c):this.cellSelectionState.deselectCell(...c))});return}let[r,a]=_i(t,e),l=this.getCellSelectionPosition(r),u=this.getCellSelectionPosition(a);if(!(!l||!u))for(let d=r.rowIndex;d<=a.rowIndex;d++)for(let s=r.colIndex;s<=a.colIndex;s++){let c=this.getCellSelectionPosition({rowIndex:d,colIndex:s});c&&(n?this.cellSelectionState.selectCell(...c):this.cellSelectionState.deselectCell(...c))}}deselectRange(t,e,n){this.setRangeSelected(t,e,!1,n)}selectRange(t,e,n){this.setRangeSelected(t,e,!0,n)}};import{defineComponent as qy,h as Nc,onBeforeUnmount as Yy,onMounted as Zy}from"vue";var Mc=Ht("CSSVariableWatch"),Ec=Bt("CSSVariableWatch"),Fc={position:"absolute",pointerEvents:"none",width:"0px",height:"0px",lineHeight:0,fontSize:0,overflow:"hidden"};var So=qy({name:"CSSNumericVariableWatch",props:{varName:{type:String,required:!0},allowInts:{type:Boolean,default:!1},onChange:{type:Function,required:!0}},setup(o){let t={current:null},e=0,n=null;return Zy(()=>{let i=t.current;if(!i)return;let r=i.getBoundingClientRect().height;r!=null?(e=r,Ec(`Variable ${o.varName} found and equals ${r}.`),o.onChange(r)):Mc(`Specified variable ${o.varName} not found or does not have a numeric value.`),n=Nn(i,({height:a})=>{a!=null&&a!==e&&(e=a,o.onChange(a))})}),Yy(()=>{n?.(),n=null}),()=>{let i=o.varName.startsWith("var(")?o.varName:`var(${o.varName})`;return Nc("div",{"data-name":"css-variable-watcher","data-var":o.varName,style:Fc},[Nc("div",{ref:r=>{t.current=r??null},style:{height:o.allowInts?`calc(1px * ${i})`:i}})])}}});var Ra=o=>{let t=0;return(...e)=>{t&&cancelAnimationFrame(t),t=requestAnimationFrame(()=>{t=0,o(...e)})}};function Oc(o,t){Ni(o,t),Jy(o,t),t.detail===2&&Xy(o,t),o.getState().onCellClick?.(o,t)}function Xy(o,t){if(Sn(t.target))return;let{onCellDoubleClick:e}=o.getState(),n={preventEdit:!1};if(e){let a=e(o,t);a&&typeof a=="object"&&(n={...n,...a})}if(n.preventEdit)return;let r=o.getComputed().computedVisibleColumns[o.colIndex];o.api.startEdit({rowIndex:o.rowIndex,columnId:r.id})}function Jy(o,t){let{getDataSourceState:e,getState:n,getComputed:i,rowIndex:r,colIndex:a,dataSourceActions:l}=o,u=e(),{selectionMode:d,cellSelection:s}=u;if(!s||d!=="multi-cell")return;let{multiCellSelector:c,computedVisibleColumns:f}=i(),{brain:m,debugId:p}=n(),{rowsPerPage:h}=m,y=f.length,C=new Ke(s);C.debugId=p??"",c.cellSelectionState=C;let b={rowIndex:r,colIndex:a};if(t.metaKey||t.ctrlKey)c.singleAddClick(b);else if(t.shiftKey){let w=!!n().wrapRowsHorizontally;c.multiSelectClick(b,w?{horizontalLayout:w,rowsPerPage:h,columnsPerSet:y}:{horizontalLayout:w})}else c.resetClick(b);l.cellSelection=C}function Qy(o){return o.getState().multiRowSelectionWith!=="click"&&o.getComputed().renderSelectionCheckBox?"checkbox":"click"}function eb(o){return o?Sn(o)?!0:typeof o.closest!="function"?!1:!!o.closest(`.${In}, [data-name="expand-collapse-icon"]`):!1}function Ni(o,t,e=t.key?"keyboard":"click"){let{rowIndex:n,getDataSourceState:i,getComputed:r,dataSourceActions:a,dataSourceApi:l,api:u,cloneRowSelection:d,cloneTreeSelection:s}=o,{multiRowSelector:c}=r(),f=i(),{selectionMode:m,dataArray:p,isTree:h}=f;if(e==="click"&&eb(t.target))return!1;let y=p[n];if(!y||y.rowDisabled)return!1;if(h){if(!y.isTreeNode||!y.nodePath)return!1;let{isNodeSelectable:C}=f;if(C&&!C(y))return!1}if(m==="multi-row"){let C=Qy(o);if(e==="click"&&C==="checkbox")return!1;let b=e==="checkbox"||e==="keyboard"&&C==="checkbox",w=()=>{t.shiftKey?c.multiSelectClick(n):b||t.metaKey||t.ctrlKey?c.singleAddClick(n):c.resetClick(n)};if(h){let{treeSelectionState:T}=f;if(!(T instanceof $e))return!1;let I=s(T);c.treeSelectionState=I,w(),c.treeSelectionState=void 0;let x=!t.shiftKey&&(b||t.metaKey||t.ctrlKey);return f.lastSelectionUpdatedNodePathRef&&(f.lastSelectionUpdatedNodePathRef.current=x?{nodePath:y.nodePath,selected:!!I.isNodeSelected(y.nodePath)}:null),a.treeSelection=I,!0}let{rowSelection:S}=f;return!S||typeof S!="object"?!1:(S=d(S),c.rowSelectionState=S,w(),a.rowSelection=S,!0)}else if(m==="single-row"){if(y.isGroupRow)return!1;let C=t.metaKey||t.ctrlKey||e!=="click";if(h){let{treeApi:w}=l;return C?w.toggleNodeSelection(y.nodePath):w.selectNode(y.nodePath),!0}let b=y.id;return C?u.rowSelectionApi.toggleRowSelection(b):u.rowSelectionApi.selectRow(b),!0}return!1}function kc(o,t){let{getComputed:e,dataSourceActions:n,dataSourceApi:i}=o,r=e().multiRowSelector,a=r.lastPointerDown;r.lastPointerDown=void 0;let l=o.getDataSourceState;return Ni({rowIndex:t,api:o,getComputed:e,getState:o.getState,getDataSourceState:l,dataSourceActions:n,dataSourceApi:i,cloneRowSelection:u=>gn(u,l),cloneTreeSelection:u=>_n(u,l)},{key:"",metaKey:!1,ctrlKey:!1,shiftKey:a?.rowIndex===t&&a.shiftKey,preventDefault:()=>{}},"checkbox")}function Lc(o,t){o.getComputed().multiRowSelector.lastPointerDown={rowIndex:o.rowIndex,shiftKey:!!t.shiftKey},t.detail!==2&&void 0}var tb={Enter:!0," ":!0,a:!0};function zc(o,t){let{getState:e,getDataSourceState:n,dataSourceActions:i,cloneRowSelection:r,cloneTreeSelection:a}=o,{key:l,ctrlKey:u,metaKey:d}=t;if(!tb[l])return!1;let s=e(),c=n(),{activeRowIndex:f,activeCellIndex:m,keyboardNavigation:p,keyboardSelection:h}=s,{selectionMode:y,rowSelection:C,treeSelectionState:b,isTree:w}=c;if(h===!1)return!1;let S=p==="row"&&f!=null?f:p==="cell"&&m!=null?m[0]:null;if(!(S!=null?c.dataArray[S]:null)||S==null)return!1;if(l===" "&&(y==="single-row"||y==="multi-row")){let I={key:t.key,metaKey:t.metaKey,ctrlKey:t.ctrlKey,shiftKey:t.shiftKey,preventDefault:()=>t.preventDefault()};return Ni({...o,rowIndex:S},I,"keyboard")}if(y!=="multi-row")return!1;if(l==="a"&&(u||d)){if(w&&b){let x=a(b);return x.selectAll(),i.treeSelection=x,!0}let I=r(C);return I.selectAll(),i.rowSelection=I,!0}return!1}var Vc=["input","textarea","select","[tabindex]","a[href]","button","object"].join(", "),Gc=o=>Array.from(o.querySelectorAll(Vc)).filter(e=>!!e.offsetParent),Ia=o=>o.querySelector(Vc);var Bc=Bn(Rn());async function Kc(o,t=10,e=300){return new Promise((n,i)=>{let r=Date.now();function a(){if(Date.now()-r>e)return i(!1);if(!o()){setTimeout(a,t);return}n(!0)}a()})}var nb=10,ob=(o,t)=>o-t;function xa(o,t){let{getComputed:e,getDataSourceState:n,getState:i,api:r,dataSourceApi:a}=t,{editingCell:l,isRowDetailEnabled:u}=i(),{dataArray:d}=n(),{computedVisibleColumns:s,computedColumnsMap:c}=e(),f=s[o.colIndex];if(!f)return!1;if(l&&l.columnId===f.id&&l.rowIndex===o.rowIndex)return!0;if(!f.contentFocusable)return!1;if(f.contentFocusable===!0)return!0;let m=d[o.rowIndex],p=!u||typeof u=="function"&&!u(m)?!1:r.rowDetailApi.isRowDetailExpanded(m.id)?"expanded":"collapsed",h=Je(f.id,t);return f.contentFocusable({column:f,...zn({column:f,rowInfo:m,columnsMap:c,context:t,rowDetailState:p}).formattedValueContext,columnApi:h,api:r,dataSourceApi:a})}function Hc(o,t,e){let n=e.getState().editingCell;return ib(o,t,e,{isCellFocusable:xa,isColumnElligible:r=>n&&n.columnId===r.id?!0:!!r.contentFocusable})}function Wc(o,t,e){let n=(0,Bc.default)(e,o+t,ob);return n<0&&(n=~n,t>0&&n>=e.length||t<0&&n===0)?null:e[n]??null}globalThis.getNextCol=Wc;function ib(o,t,e,n){let{isColumnElligible:i,isCellFocusable:r}=n,a=e.getComputed().computedVisibleColumns.filter(i).reduce((c,f)=>(c.push(f.computedVisibleIndex),c),[]);if(!a.length)return null;let{getDataSourceState:l}=e,{dataArray:u}=l(),d=o.rowIndex,s=o.colIndex;for(;d!=null||s!=null;){if(s=s===null?a[t===-1?a.length-1:0]:Wc(s,t,a),s===null){if(d+=t,d<0||d>=u.length)return null;continue}if(r({colIndex:s,rowIndex:d},e))return{colIndex:s,rowIndex:d}}return null}async function jc([o,t],e){let{api:n}=e;return new Promise((i,r)=>{let a=nb,l=null,u=!1;function d(s=0){s++,Qt(l),l=ke(async()=>{if(u=n.scrollCellIntoView(o,t,{offset:30}),!u&&s<a&&d(s),u){try{await Kc(()=>!!e.getState().getDOMNodeForCell({rowIndex:o,colIndex:t}))}catch(c){r(c);return}i(!0)}})}d()})}var rb=`.${mt}`;function $c(o,t){if(t.key!=="Tab")return!1;let e=t.shiftKey?-1:1,n=t.target,i=o.getState().scrollerDOMRef.current,r=document.activeElement===i||n===i;if(!i||r&&e===-1)return!1;let a=r?null:wn(n,rb),l=null,u=null;if(a)l=Number(a.getAttribute("data-row-index")),u=Number(a.getAttribute("data-col-index"));else if(r){let{activeCellIndex:s}=o.getState();[l,u]=s||[0,0]}if(l==null||u==null||isNaN(l)||isNaN(u))return!1;let d=r&&xa({colIndex:u,rowIndex:l},o)?{rowIndex:l,colIndex:u}:Hc({rowIndex:l,colIndex:u},e,o);if(!d){if(e===-1)i.focus();else{let s=Gc(document.body),c=o.getState().focusDetectDOMRef.current,f=s.findIndex(p=>p===c);s[f+1]?.focus()}return!0}return jc([d.rowIndex,d.colIndex],o).then(()=>{let s=o.getState().getDOMNodeForCell(d);if(!s)return;Ia(s)?.focus()}),!0}var Uc={control:"ctrl"},qc={"control|cmd":"ctrl","cmd|control":"ctrl","ctrl|cmd":"ctrl","cmd|ctrl":"ctrl"},ab={esc:"escape"},Zc={cmd:o=>o.metaKey,alt:o=>o.altKey,ctrl:o=>o.ctrlKey,shift:o=>o.shiftKey},Xc=Object.keys(Zc),Pa=new Set(Xc),lb=new Set(["shift","alt"]);function Jc(o,t){return Array.isArray(t)?t.some(e=>Yc(o,e)):Yc(o,t)}function Yc(o,t){let e=o.key.toLowerCase(),n=t.split("+").map(f=>f.toLowerCase().trim()),i=n.find(f=>qc[f]),r=n.map(f=>Uc[f]||qc[f]||ab[f]||f),a=r.filter(f=>Pa.has(f)),l=r.filter(f=>!Pa.has(f)),u=Xc.reduce((f,m)=>(f[m]=Zc[m](o),f),{});i&&u.cmd&&(u.cmd=!1,u.ctrl=!0);let d=Object.keys(u).filter(f=>u[f]);if(!a.every(f=>u[f]===!0))return!1;if(l.includes("*")){if(d.length<a.length||d.filter(m=>!lb.has(m)).length)return!1}else if(a.length!=d.length)return!1;return!l.length||Pa.has(e)||e==="meta"||Uc[e]?!1:l.reduce((f,m)=>f?m==="*"||e===m:!1,!0)}async function Qc(o,t){let e={...o,cloneRowSelection:a=>gn(a,o.getDataSourceState),cloneTreeSelection:a=>_n(a,o.getDataSourceState)},{onKeyDown:n}=o.getState(),i={preventEdit:!1,preventEditStop:!1,preventDefaultForTabKeyWhenEditing:!0,preventSelection:!1,preventNavigation:!1};if(n){let a=n(o,t);a&&typeof a=="object"&&(i={...i,...a})}if(!i.preventSelection&&zc(e,t)&&t.preventDefault(),($c(e,t)||!o.getState().focusedWithin&&!i.preventNavigation&&Pc(e,t))&&t.preventDefault(),!i.preventEdit&&t.key==="Enter"&&!o.api.isEditInProgress()){let{activeCellIndex:a}=o.getState();if(a){let[l,u]=a,d=o.getComputed().computedVisibleColumns[u];d.computedEditable&&o.api.startEdit({rowIndex:l,columnId:d.id})}}o.api.isEditInProgress()&&(t.key==="Escape"&&!i.preventEditStop&&o.api.stopEdit({cancel:!0}),t.key==="Tab"&&i.preventDefaultForTabKeyWhenEditing&&t.preventDefault());let{keyboardShortcuts:r}=o.getState();if(r)for await(let a of r){if(!Jc(t,a.key)||a.when&&!await a.when(o))continue;let l=await a.handler(o,t);if(l&&l.stopNext)break}}import{onBeforeUnmount as Eb,watch as Fb}from"vue";import{Teleport as ub,cloneVNode as db,defineComponent as lf,h as Li,isVNode as sf,nextTick as cb,onBeforeUnmount as fb,onMounted as pb,shallowRef as af,triggerRef as mb,watch as hb}from"vue";var Oi="__is_infinite_menu_component";function Da(o){return!!o.tagName}function nf(o){let{alignTarget:t,alignAnchor:e,constrainTo:n,alignPosition:i}=o,r=Ae.from(Da(t)?t.getBoundingClientRect():t),a=Ae.from(Da(e)?e.getBoundingClientRect():e),l=n?Ae.from(Da(n)?n.getBoundingClientRect():n):null;if(!l)return{...ef({anchorRect:a,targetRect:r,position:i[0]}),index:0};let u=null;for(let d=0,s=i.length;d<s;d++){let c=ef({anchorRect:a,targetRect:r,position:i[d],constrainRect:l});if(d===0&&(u={...c,index:0}),c.valid)return{...c,index:d}}return u}function ef(o){let t=Ae.from(o.targetRect),e=Ae.from(o.anchorRect),n=o.constrainRect?Ae.from(o.constrainRect):null,{position:i}=o,[r,a]=i,l=tf(t,r),u=tf(e,a),d=l.getDistanceToPoint(u);t.shift(d);let s=n?n.contains(t):!0;return{alignPosition:i,alignedRect:t,valid:s,distance:d}}function tf(o,t){return t==="TopLeft"?je.from({top:o.top,left:o.left}):t==="TopCenter"?je.from({top:o.top,left:o.left+(o.width>0?Math.round(o.width/2):0)}):t==="TopRight"?je.from({top:o.top,left:o.left+o.width}):t==="BottomLeft"?je.from({left:o.left,top:o.top+o.height}):t==="BottomCenter"?je.from({left:o.left+(o.width>0?Math.round(o.width/2):0),top:o.top+o.height}):t==="BottomRight"?je.from({left:o.left+o.width,top:o.top+o.height}):t==="CenterLeft"?je.from({left:o.left,top:o.top+(o.height>0?Math.round(o.height/2):0)}):t==="CenterRight"?je.from({left:o.left+o.width,top:o.top+(o.height>0?Math.round(o.height/2):0)}):je.from({left:o.left+(o.width>0?Math.round(o.width/2):0),top:o.top+(o.height>0?Math.round(o.height/2):0)})}function sb(o){return o&&typeof o.then=="function"||o instanceof Promise}function ki(o){return o==null||typeof o=="string"?!1:typeof o.tagName=="string"}async function of(o){return typeof o=="function"&&(o=o()),sb(o)&&(o=await o),typeof o=="string"&&(o=document.querySelector(o)),o&&ki(o)&&(o=o.getBoundingClientRect()),o?Ae.from(o):null}async function rf(o){let t=null;typeof o=="function"?t=o():t=o;function e(n){let i=null;return typeof n=="string"&&(i=document.querySelector(n)),ki(n)&&(i=n),i||null}return e(await t)}async function Aa(o,t){let{constrainTo:e,alignTo:n,alignPosition:i}=t;Object.keys(n).length===2&&n.top!==void 0&&n.left!==void 0&&(n={...n,width:0,height:0}),typeof e=="boolean"&&(e=e?document.documentElement.getBoundingClientRect():void 0);let r=e&&await of(e)||void 0,a=n?await of(n):void 0,l=Ae.from(o.getBoundingClientRect());if(!a)return;let{alignedRect:u}=nf({constrainTo:r,alignAnchor:a,alignTarget:l,alignPosition:i});o.style.transform=`translate3d(${u.left}px,${u.top}px, 0px)`;let d=o.getBoundingClientRect();if(d.left!==u.left||d.top!==u.top){let s=o.offsetParent;if(s){let c=s.getBoundingClientRect(),f=c.left,m=c.top,p=u.left-f,h=u.top-m;o.style.transform=`translate3d(${p}px,${h}px, 0px)`}}}var gb=lf({name:"OverlayContent",props:{handle:{type:Object,required:!0}},setup(o){let t=null,e=r=>{r&&r!==t&&Aa(r,o.handle),t=r??null},n=null,i=r=>{n?.(),n=r.realign.onChange(a=>{t&&a&&Aa(t,a)})};return pb(()=>i(o.handle)),hb(()=>o.handle,i),fb(()=>{n?.()}),()=>Li("div",{style:{position:"absolute",top:"0px",left:"0px"},ref:e},[o.handle.children()])}});function yb(o){return sf(o)?o.props?.id||o.key:null}function bb(o,t,e){if(sf(o)&&o.type?.[Oi]){let n={};return o.props?.portalContainer===void 0&&(n.portalContainer=t),o.props?.constrainTo===void 0&&(n.constrainTo=e),db(o,n)}return o}function At(o){let t=o,e=new Map,n=af(e),i=()=>mb(n),r=(d,s)=>{let f=`${s.id||yb(d)||It()}`,m=e.get(f),p=C=>()=>{let b=typeof C=="function"?C():C;return bb(b,t.portalContainer,s.constrainTo??t.constrainTo)},h=p(d),y=(C,b)=>{if(!m)return;let w=p(C);Object.assign(m,{children:w}),i(),!!b?.skipRealign||cb(()=>{m&&e.get(m.key)===m&&m.realign(m)})};return m?(Object.assign(m,s),y(d),y):(m={key:f,children:h,alignPosition:s.alignPosition,alignTo:s.alignTo,constrainTo:s.constrainTo,realign:pe()},e.set(m.key,m),i(),y)},a=d=>{d=`${d}`,e.has(d)&&(e.delete(d),i())},l=()=>{e.clear(),i()};return{portal:lf({name:"OverlayPortal",setup(){let d=af(null),{portalContainer:s}=t;return s&&(async()=>{let c=await rf(s);c!=null&&(d.value=c)})(),()=>{let c=[];for(let[f,m]of n.value)c.push(Li(gb,{handle:m,key:m.key}));if(s){let f=typeof s=="function"?s():null,m=ki(f)?f:d.value;return m?Li(ub,{to:m},c):null}return s===null||s===!1?c:Li("div",{style:{position:"fixed",top:"0px",left:"0px"}},c)}}}),hideOverlay:a,clearAll:l,rerenderOverlays:i,showOverlay:r}}import{h as Mb}from"vue";import{defineComponent as Tf,h as dt,onBeforeUnmount as Ib,ref as xb,watch as Pb}from"vue";var uf="db3arf0 _16lm1iw0 _16lm1iw1 _16lm1iw1w _16lm1iw2f _16lm1iw8",df=we({defaultClassName:"db3arf2 _16lm1iw1p _16lm1iw2j _16lm1iw1x",variantClassNames:{disabled:{true:"db3arf3 _16lm1iwl _16lm1iw1x",false:"_16lm1iwk"},active:{true:"db3arf5",false:"db3arf6"},pressed:{false:"db3arf7",true:"db3arf8"},keyboardActive:{true:"db3arf9",false:"db3arfa"}},defaultVariants:{},compoundVariants:[[{active:!0,disabled:!1},"db3arfb"],[{pressed:!0,active:!0,disabled:!1},"db3arfc"]]}),cf="db3arf1",ff="db3arfd";var pf="submenu",Cb="-";function mf(){return{keyboardActiveItemKey:null,activeItemKey:null,generatedId:It(),focused:!1,destroyed:!1,domRef:{current:null}}}function hf(){return{parentMenuId:1,parentMenuItemKey:1,onHideIntent:1,constrainTo:1,onAction:1,onShow:1,onHide:1,autoFocus:1,wrapLabels:1}}var Tb=({columns:o,keyboardActiveItemKey:t,activeItemKey:e,menuId:n},i,r)=>{let a=i&&(i.key!=null||i.label!=null)?i:null,l=a===null?i===Cb?r.renderSeparator():i:null;return a!=null?{type:"item",parentMenuId:n,disabled:!!a.disabled,keyboardActive:a.key===t,active:a.key===e,value:a,span:a.span||1,key:a.key,menu:a.menu||null,style:a.style,className:a.className,originalMenuItem:a}:{type:"decoration",value:l,span:o.length,style:{gridColumnStart:1,gridColumnEnd:o.length+10}}},Sb=[{name:"label"}],gf=(o,t)=>{let{props:e,state:n}=o,{activeItemKey:i,keyboardActiveItemKey:r}=n,{items:a,children:l,addSubmenuColumnIfNeeded:u,parentMenuId:d}=e,s=e.id||n.generatedId;d&&(s=`${d}-${s}`);let c=[...e.columns||Sb],f={columns:c,keyboardActiveItemKey:r??null,activeItemKey:i??null,menuId:s},m=[];a?m=a.map(h=>Tb(f,h,t)):!a&&typeof l!="function"&&(m=t.childrenToRuntimeItems?t.childrenToRuntimeItems(f,l):[]),u&&m.filter(y=>y.type==="item"&&y.menu!=null).length>0&&!c.find(y=>y.name==pf)&&c.push({name:pf,render:t.renderSubmenuColumn});let p=m.filter(h=>h.type==="item"&&!h.disabled);return{runtimeItems:m,runtimeSelectableItems:p,columns:c,menuId:s}};function yf(o,t){let e=bf(o,t);if(!e.length)return null;let n=Ae.from(e[0]?.getBoundingClientRect()),i=Ae.from(e[e.length-1].getBoundingClientRect()),r=n;return r.width=i.left+i.width-n.left,r}function bf(o,t){let e=wn(document.querySelector(`[data-menu-id="${o}"] [data-menu-item-key="${t}"]`),`[data-menu-id="${o}"]`);if(!e)return[];let n=e.querySelectorAll(`[data-menu-item-key="${t}"]`);return Array.from(n)}function Cf(o,t){let e=bf(o,t);if(!e.length)return null;for(let n of e){let i=n.querySelector('input[type="checkbox"]');if(i)return i}return null}var wo=class extends Tn{constructor(t){super(t.slice(0,3))}};var wb=250;function vb(o,t=100){let e=Date.now();return new Promise(n=>{let i,r=()=>{if(i=o(),i!==void 0){n(i);return}if(Date.now()-e>t){n(void 0);return}ke(r)};ke(()=>{r()})})}var Rb=Fe(),zi=class{constructor(t){this.activeItem=null;this.currentHoveredItem=null;this.activeItemLeavePoint=null;this.menuLeaveTimeoutId=null;this.activeItemMenuRect=null;this.lastPointerMoveTimestamp=0;this.mouseMoveTimeoutId=0;this.lastHorizontalDiff=0;this.getTimeout=()=>this.params.timeout||wb;this.getPointerMoveTarget=()=>document.documentElement||Rb;this.removePointerMoveListener=()=>{this.getPointerMoveTarget().removeEventListener("pointermove",this.onPointerMoveWhileActiveItem)};this.onPointerMoveWhileActiveItem=t=>{if(clearTimeout(this.mouseMoveTimeoutId),!t){this.lastPointerMoveTimestamp=Date.now();return}if(!this.currentHoveredItem||this.currentHoveredItem===this.activeItem)return;let e=Date.now();this.lastPointerMoveTimestamp||(this.lastPointerMoveTimestamp=e);let i=e-this.lastPointerMoveTimestamp>this.getTimeout();this.lastPointerMoveTimestamp=e;let r=()=>{this.setActiveItem(null,null),this.onItemChange(!0,this.currentHoveredItem,t)};if(i){r();return}let a=this.currentHoveredItem;this.mouseMoveTimeoutId=setTimeout(()=>{if(a!==this.currentHoveredItem)return;Date.now()-this.lastPointerMoveTimestamp>this.getTimeout()&&r()},this.getTimeout());let l=new je({left:t.clientX,top:t.clientY});if(!this.activeItemMenuRect||!this.activeItemLeavePoint)return;let u=this.activeItemLeavePoint.left<this.activeItemMenuRect.left,s=(u?1:-1)*(l.left-this.activeItemLeavePoint.left);if(s-this.lastHorizontalDiff<0){this.lastHorizontalDiff=0,r();return}this.lastHorizontalDiff=s,(u?new wo([this.activeItemLeavePoint,this.activeItemMenuRect.getTopLeft(),this.activeItemMenuRect.getBottomLeft()]):new wo([this.activeItemLeavePoint,this.activeItemMenuRect.getTopRight(),this.activeItemMenuRect.getBottomRight()])).containsPoint(l)||(this.setActiveItem(null,null),this.onItemChange(!0,this.currentHoveredItem,t))};this.setupMenuLeaveTracking=()=>{this.menuLeaveTimeoutId=setTimeout(()=>{this.activeItem&&this.params.itemHasSubMenu(this.activeItem)||this.setActiveItem(null,null)},this.getTimeout())};this.setActiveItem=(t,e)=>{if(t!==this.activeItem){if(t==null){this.removePointerMoveListener(),this.params.onItemActivate(null,null),this.activeItem=null,this.activeItemMenuRect=null;return}this.activeItem=t,this.params.onItemActivate(t,e),this.activeItemMenuRect=null,vb(()=>this.activeItem!=t?!1:this.params.getMenuRectFor(t)).then(n=>{this.activeItem==t&&n&&(this.activeItemMenuRect=n)})}};this.onItemChange=(t,e,n)=>{if(clearTimeout(this.menuLeaveTimeoutId),clearTimeout(this.mouseMoveTimeoutId),!t){this.removePointerMoveListener(),e===this.activeItem&&(this.activeItemLeavePoint=new je({left:n.clientX,top:n.clientY})),this.setupMenuLeaveTracking();return}if(this.currentHoveredItem=e,!this.activeItem||!this.params.itemHasSubMenu(this.activeItem)){this.setActiveItem(e,n.target);return}this.onPointerMoveWhileActiveItem(),this.getPointerMoveTarget().addEventListener("pointermove",this.onPointerMoveWhileActiveItem)};this.getHandlers=()=>({onItemEnter:(t,e)=>{this.onItemChange(!0,t,e)},onItemLeave:(t,e)=>{this.onItemChange(!1,t,e)}});this.params=t}};var Db={renderSeparator:()=>dt("hr",{class:ff}),renderSubmenuColumn:(({domProps:o,item:t})=>t.menu?dt("div",o,[dt(dn,{expanded:!1})]):dt("div",o))},{useManagedComponent:Ab}=hn({initSetupState:mf,forwardProps:()=>hf(),mapPropsToState:o=>gf(o,Db),debugName:"Menu"}),_b=Tf({name:"MenuRuntimeItem",props:{columns:{type:Array,required:!0},item:{type:Object,required:!0},index:{type:Number,required:!0},active:{type:Boolean,required:!0},keyboardActive:{type:Boolean,required:!0},onItemEnter:{type:Function,required:!1},onItemLeave:{type:Function,required:!1},onItemClick:{type:Function,required:!0}},setup(o){let t=xb(!1);return()=>{let{columns:e,item:n,index:i,active:r,keyboardActive:a}=o,l=n.type==="item"?n.value.key:i,u=null;if(n.type==="decoration")u=dt("div",{style:n.style},[n.value]);else{let d=0;u=e.map((s,c)=>{let f=n.value,m=s.field||s.name,p=c+1,h=p+n.span;if(p<d)return null;d=h;let C={style:{...s.style,...n.style,gridColumnStart:p,gridColumnEnd:h},"data-menu-column-id":`${n.parentMenuId}-col-${s.name}`,"data-menu-col-name":`${s.name}`,"data-menu-row-id":`${n.parentMenuId}-row-${i}`,"data-menu-row-index":`${i}`,"data-menu-item-key":`${n.key}`,class:te(df({active:r,disabled:!!n.disabled,keyboardActive:a,pressed:t.value||r}),n.className),onPointerenter:b=>{n.disabled||o.onItemEnter?.(n,b)},onPointerleave:b=>{n.disabled||o.onItemLeave?.(n,b)},onMousedown:()=>{n.disabled||(t.value=!0)},onMouseup:()=>{n.disabled||(t.value=!1)},onClick:b=>{n.disabled||o.onItemClick(b,n)}};return s.render?s.render({item:f,column:s,value:f[m],domProps:C}):dt("div",{key:`${l}-${m}`,...C},[f[m]])}).filter(Boolean)}return dt("div",{class:cf},[u])}}}),_t=Tf({name:"InfiniteMenu",inheritAttrs:!1,props:{id:{type:String,required:!1},items:{type:Array,required:!1},columns:{type:Array,required:!1,default:void 0},portalContainer:{type:[String,Object,Function,Boolean],required:!1,default:void 0},constrainTo:{type:[String,Object,Function,Boolean],required:!1,default:void 0},wrapLabels:{type:Boolean,required:!1,default:!1},autoFocus:{type:Boolean,required:!1,default:void 0},addSubmenuColumnIfNeeded:{type:Boolean,required:!1,default:!0},bubbleActionsFromSubmenus:{type:Boolean,required:!1,default:!0},parentMenuId:{type:String,required:!1},parentMenuItemKey:{type:String,required:!1},onShow:{type:Function,required:!1},onHide:{type:Function,required:!1},onHideIntent:{type:Function,required:!1},onAction:{type:Function,required:!1}},setup(o,{attrs:t}){let{contextValue:e}=Ab(o),n=e.state,i=e.componentActions,r=()=>n.value,a=A=>{i.keyboardActiveItemKey=A},l=A=>{i.activeItemKey=A},u=!1,d=()=>u,s=null,c=A=>{s=A},{showOverlay:f,portal:m,clearAll:p}=At({portalContainer:!1}),h=()=>{let A=r();A.onHideIntent?.(A)},y=()=>{i.focused=!0,setTimeout(()=>{let A=r().domRef.current;b&&A&&A===document.activeElement&&r().keyboardActiveItemKey==null&&a(r().runtimeSelectableItems[0]?.key??null)})},C=()=>{i.focused=!1},b=!0,w={hideMenu:h,focus:()=>{let A=r().domRef.current;A&&(A.focus(),setTimeout(()=>{let M=r().domRef.current;M&&M!==document.activeElement&&M.focus()},10),y())},getMenuId:()=>r().menuId,getParentMenuId:()=>r().parentMenuId},S=(A,M)=>{a(M.key),l(M.key),M.originalMenuItem.onClick&&M.originalMenuItem.onClick(A);let P={key:M.key,item:M.originalMenuItem,hideMenu:h};M.originalMenuItem.onAction&&M.originalMenuItem.onAction(P);let{onAction:D}=r();D&&D(P),M.originalMenuItem.hideMenuOnAction&&h()},{onItemEnter:T,onItemLeave:I}=new zi({parentMenuId:r().parentMenuId,onItemActivate:A=>{d()&&l(A)},itemHasSubMenu:A=>!!r().runtimeItems.filter(P=>P.type==="item"&&P.key===A&&P.menu)[0],getMenuRectFor:A=>{let M=`[data-submenu-for="${A}"]`,P=document.querySelector(M);if(P)return Ae.from(P.getBoundingClientRect())}}).getHandlers(),x=A=>{let M=r().menuId,P=`${M}-submenu`,D=A.menu;return D?(typeof D=="function"&&(D=D()),dt(_t,{key:P,parentMenuItemKey:A.key,parentMenuId:M,constrainTo:r().constrainTo,...D,autoFocus:!1,onShow:(E,_)=>{D?.onShow?.(E,_),c(_)},onHideIntent:E=>{D?.onHideIntent?.(E),h()},onHide:E=>{E.focused&&(l(null),a(A.key),w.focus())}})):null};Pb(()=>n.value.activeItemKey,A=>{let{runtimeItems:M,menuId:P,constrainTo:D}=r(),E=M.filter(O=>O.type==="item"&&A===O.key)[0];if(!E||!E.menu){c(null),p();return}let _=yf(P,E.key);_&&f(()=>x(E),{id:`${P}-submenu`,alignTo:_,alignPosition:[["TopLeft","TopRight"],["TopRight","TopLeft"]],constrainTo:D})},{flush:"post"});function F(A){let{runtimeItems:M,runtimeSelectableItems:P,keyboardActiveItemKey:D}=r(),E=M.findIndex(B=>B.type==="item"&&B.key===D),_=D,O=M[E],z={ArrowUp:()=>{let B=M.slice(0,E).filter(G=>G.type==="item"&&!G.disabled).pop();B&&B.type==="item"&&B.key&&(_=B.key)},ArrowDown:()=>{let B=M.slice(E+1).filter(G=>G.type==="item"&&!G.disabled)[0];B&&B.type==="item"&&B.key&&(_=B.key)},Home:()=>{z.PageUp()},End:()=>{z.PageDown()},PageUp:()=>{_=P[0].key},PageDown:()=>{_=P[P.length-1].key},ArrowLeft:()=>{l(null),r().parentMenuId&&(i.destroyed=!0)},ArrowRight:()=>{O&&(l(O.key),ke(()=>{d()&&s&&s.getParentMenuId()===r().menuId&&s.focus()}))},Enter:()=>{if(O)if(O.originalMenuItem?.menu){if(s){z.ArrowLeft();return}l(O.key)}else S(A,O)}," ":()=>{if(!O)return;O.originalMenuItem.menu||S(A,O);let B=Cf(r().menuId,O.key);B&&B.click()},Escape:()=>{z.ArrowLeft();let B=r();B.parentMenuId||B.onHideIntent?.(B)}},K=z[A.key];K&&(K(),A.preventDefault()),_!=D&&a(_)}let N=!1,R=A=>{let M=A??null;M&&!N?(N=!0,r().domRef.current=M,u=!0,r().onShow?.(r(),w),r().autoFocus&&w.focus()):!M&&N?(N=!1,r().onHide?.(r()),r().domRef.current=null):M&&(r().domRef.current=M)};return Ib(()=>{u=!1,N&&(N=!1,r().onHide?.(r())),r().domRef.current=null}),()=>{let A=r(),{columns:M,runtimeItems:P,menuId:D,activeItemKey:E,keyboardActiveItemKey:_,destroyed:O,wrapLabels:z,parentMenuItemKey:K}=A;if(O)return null;let B=P.map((Z,De)=>dt(_b,{key:Z.type==="item"?Z.key:De,columns:M,item:Z,index:De,active:Z.type==="item"&&Z.key===E,keyboardActive:Z.type==="item"&&Z.key===_,onItemEnter:(me,ve)=>T(me.key,ve),onItemLeave:(me,ve)=>I(me.key,ve),onItemClick:S})),G=M.map(Z=>Z.width||(typeof Z.flex=="number"?`${Z.flex}fr`:Z.flex)||"auto").join(" "),le={...t.style,gridTemplateColumns:G,gridTemplateRows:P.map(()=>"auto").join(" ")};return z||(le.whiteSpace="nowrap"),dt("div",{class:Fo.contents},[dt("div",{...t,"data-menu-id":D,"data-submenu-for":K,tabindex:0,ref:R,onKeydown:F,onMousedown:()=>{b=!1},onMouseup:()=>{b=!0},onFocus:y,onBlur:C,class:te(uf,t.class,"InfiniteMenu"),style:le},B),dt(m)])}}});_t[Oi]=!0;import{h as Sf}from"vue";function wf(o,t){let{columnApi:e,column:n,getComputed:i,api:r,dataSourceApi:a,getState:l}=t,u=l().components?.CheckBox||qt,s=e.isSortable()?[{key:"sort-asc",label:"Sort Ascending",disabled:n.computedSortedAsc,onAction:()=>{r.setSortingForColumn(n.id,1)}},{key:"sort-desc",label:"Sort Descending",disabled:n.computedSortedDesc,onAction:()=>{r.setSortingForColumn(n.id,-1)}},{key:"sort-none",label:"Unsort",disabled:!n.computedSorted,onAction:()=>{r.setSortingForColumn(n.id,null)}},"-"]:[];return[...n.groupByForColumn?[{key:"collapse-all",label:"Collapse All",onAction:()=>{r.collapseAllGroupRows()}},"-"]:[],...s,n.computedFilterable?{key:"clear-filter",label:"Clear Filter",disabled:!n.computedFiltered,onAction:()=>{r.clearColumnFilter(n.id)}}:null,n.computedFilterable?"-":null,{key:"pin-start",label:"Pin to start",disabled:n.computedPinned==="start",onAction:()=>{r.setPinningForColumn(n.id,"start")}},{key:"unpin",label:"Unpin",disabled:!n.computedPinned,onAction:()=>{r.setPinningForColumn(n.id,!1)}},"-",{key:"columns",label:"Columns",menu:()=>{let f=[];return i().computedColumnsMapInInitialOrder.forEach((p,h)=>{let y=eo(p,t,"column-menu");f.push({key:h,label:y,check:Sf(u,{key:p.id,disabled:p.computedVisible&&r.getVisibleColumnsCount()===1,checked:p.computedVisible,onChange:C=>{let b=!!C;r.setVisibilityForColumn(p.id,b),requestAnimationFrame(()=>{r.realignColumnContextMenu()})}})})}),{columns:[{name:"check"},{name:"label"}],items:f}}},"-",{key:"group-by",label:"Group by",menu:()=>{let f=[];return i().computedColumnsMapInInitialOrder.forEach((p,h)=>{if(p.groupByForColumn)return;let y=eo(p,t,"column-menu");f.push({key:h,label:y,check:Sf(u,{key:p.id,disabled:!p.computedGroupable,checked:p.computedGroupedBy,onChange:()=>{a.toggleGroupByField(p.field)}})})}),{columns:[{name:"check"},{name:"label"}],items:f}}}].filter(f=>!!f)}function vf(o,t,e){if(o==null)return null;let{getComputed:n,getState:i}=t,{components:r,getColumnMenuItems:a}=i(),l=r?.Menu??_t,u=n().computedColumnsMap.get(o);if(!u)return null;let d={column:u,columnApi:Je(u.id,t),...t},s=wf([],d),c=a?a(s,d):s,f=p=>{p.__insideMenu=!0},m=p=>{p.domRef.current?.parentNode?.removeEventListener("mousedown",f)};return!c||!c.length?null:Mb(l,{autoFocus:!0,items:c,onShow:p=>{p.domRef.current?.parentNode?.addEventListener("mousedown",f)},onHide:m,onHideIntent:p=>{m(p),e?.()}})}function Rf(o){return typeof o=="function"?o():o}function fn(o){return Rf(o.menuConstrainTo)??o.domRef.current}function pn(o,t,e){return t?()=>Rf(t)??(e||o().portalDOMRef.current):e||!1}function Nb(o){let{columnId:t,context:e,clearAll:n,showOverlay:i}=o,{getState:r,actions:a}=e,{columnMenuTargetRef:l,domRef:u}=r();function d(){n(),a.columnMenuVisibleForColumnId=null}let s=o.target;if(s||(s=l.current??void 0,s&&!u.current.contains(s)&&(s=void 0)),!s){let c=`[data-column-id="${t}"] ${pu}`;s=r().domRef.current.querySelector(c)}if(!s){console.warn(`Cannot show column menu for column "${t}"`);return}l.current=null,i(()=>vf(t,e,d),{constrainTo:fn(r()),id:"column-menu",alignTo:s,alignPosition:[["TopLeft","BottomLeft"],["TopRight","BottomRight"]]})}function If(o){let{context:t,state:e}=o,{getState:n,actions:i}=t,{showOverlay:r,portal:a,clearAll:l}=At({portalContainer:pn(n,n().menuPortalContainer,!1)}),u=n().onColumnMenuClick.onChange(d=>{d&&(n().columnMenuTargetRef.current=d.target,i.contextMenuVisibleFor=null,i.cellContextMenuVisibleFor=null,i.filterOperatorMenuVisibleForColumnId=null,i.columnMenuVisibleForColumnId=d.column.id)});return Fb([()=>e.value.columnMenuVisibleForColumnId,()=>e.value.columnMenuVisibleKey],(d,s,c)=>{let{columnMenuVisibleForColumnId:f,columnMenuTargetRef:m}=n();if(f){let h=function(y){y.__insideMenu!==!0&&(l(),i.columnMenuVisibleForColumnId=null)};var p=h;document.documentElement.addEventListener("mousedown",h),Nb({columnId:f,context:t,clearAll:l,showOverlay:r}),c(()=>{document.documentElement.removeEventListener("mousedown",h)})}else m.current=null,l()},{flush:"post"}),Eb(()=>{u()}),{MenuPortal:a}}import{onBeforeUnmount as Ob,watch as kb}from"vue";import{h as Vi}from"vue";function xf(o,t,e){if(o==null)return null;let{getComputed:n,getState:i,getDataSourceState:r,actions:a,dataSourceApi:l,dataSourceActions:u,api:d}=t,{components:s,getFilterOperatorMenuItems:c}=i(),f=s?.Menu??_t,m=n().computedColumnsMap.get(o);if(!m)return null;let p=x=>{x.__insideMenu=!0},h=x=>{x.domRef.current?.parentNode?.removeEventListener("mousedown",p)},{filterTypes:y}=r(),C=y[m.computedFilterType];if(!C)return null;let b=C.operators.map(x=>{let F=x.name,N=m.computedFilterValue?m.computedFilterValue.filter.operator===F:F===C.defaultOperator,R=x.components?.Icon??yn;return{key:F,icon:Vi(R),label:x.label??x.name,onAction:()=>{d.setColumnFilterOperator(o,F)},checked:N?Vi(iu,{size:16}):null}}),S=[...[{key:"close",label:"Close Menu",icon:null,onAction:()=>{d.hideFilterOperatorMenu()}},{key:"reset",label:"Reset",icon:Vi(ru),disabled:!m.computedFiltered,onAction:()=>{d.clearColumnFilter(o)}},"-"],...b],T={column:m,api:d,getState:i,getDataSourceState:r,getComputed:n,actions:a,dataSourceApi:l,dataSourceActions:u,columnFilterValue:m.computedFilterValue,filterTypes:y},I=c?c(S,T):S;return Vi(f,{autoFocus:!0,columns:[{name:"icon"},{name:"label"},{name:"checked"}],items:I,onShow:x=>{x.domRef.current?.parentNode?.addEventListener("mousedown",p)},onHide:h,onHideIntent:x=>{h(x),e?.()}})}var Gi=10;function Pf(o){let{context:t,state:e}=o,{getState:n,actions:i}=t,{showOverlay:r,portal:a,clearAll:l}=At({portalContainer:pn(n,n().menuPortalContainer,!1)}),u=n().onFilterOperatorMenuClick.onChange(d=>{if(!d)return;let{target:s,column:c}=d;function f(){l(),i.filterOperatorMenuVisibleForColumnId=null}let m=s?.parentElement||s,p=Ae.from(m.getBoundingClientRect());p.top-=Gi,p.left-=Gi,p.width+=2*Gi,p.height+=2*Gi,r(()=>xf(c.id,t,f),{constrainTo:fn(n()),id:"filter-operator-menu",alignTo:p,alignPosition:[["TopLeft","BottomLeft"],["TopRight","BottomRight"]]}),i.contextMenuVisibleFor=null,i.cellContextMenuVisibleFor=null,i.columnMenuVisibleForColumnId=null,i.filterOperatorMenuVisibleForColumnId=c.id});return kb(()=>e.value.filterOperatorMenuVisibleForColumnId,(d,s,c)=>{if(d){let m=function(p){p.__insideMenu!==!0&&(l(),i.filterOperatorMenuVisibleForColumnId=null)};var f=m;document.documentElement.addEventListener("mousedown",m),c(()=>{document.documentElement.removeEventListener("mousedown",m)})}else l()},{flush:"post"}),Ob(()=>{u()}),{MenuPortal:a}}import{onBeforeUnmount as Mf,watch as Ef}from"vue";import{h as Bi}from"vue";function Ki(o){let t=o?Array.isArray(o)?o:o.items:null,e=o&&!Array.isArray(o)?o.columns:void 0;return{items:t,columns:e}}function _a(o){let t=i=>{i.__insideMenu=!0},e=i=>{i.domRef.current?.parentNode?.removeEventListener("mousedown",t)};return{columns:[],items:[],autoFocus:!0,onShow:i=>{i.domRef.current?.parentNode?.addEventListener("mousedown",t)},onHide:e,onHideIntent:i=>{e(i),o.onHideIntent?.()}}}function Df(o,t,e){if(!o)return null;let n=pe();return o.then(i=>{let{items:r,columns:a}=Ki(i);r&&r.length&&n(Bi(e,{...t,items:r||[],columns:a}))}),Bi(Zt,{updater:n})}function Af(o,t,e){let{columnId:n,rowIndex:i,event:r}=o,{getComputed:a,getState:l}=t,{components:u,getCellContextMenuItems:d}=l(),s=u?.Menu??_t,{computedColumnsMap:c}=a(),f=c.get(n),m={...Dt({...t,rowIndex:i,columnId:f.id}),event:r};if(!f||!d)return{cellContext:m,menu:null,preventDefault:!1};let p=_a({onHideIntent:e}),h=d(m,t),y=h instanceof Promise||Array.isArray(h)?!0:!!(h&&Array.isArray(h.items));if(h instanceof Promise)return{cellContext:m,menu:Df(h,p,s),preventDefault:y};let{items:C,columns:b}=Ki(h);return!C||!C.length?{cellContext:m,menu:null,preventDefault:Array.isArray(C)}:{preventDefault:y,menu:Bi(s,{...p,columns:b,items:C}),cellContext:m}}function _f(o,t,e){let{getState:n,getComputed:i}=t,{components:r,getContextMenuItems:a}=n(),l=r?.Menu??_t,{computedColumnsMap:u}=i(),d=o.columnId?u.get(o.columnId):void 0,s=d?{...o,...Dt({...t,rowIndex:o.rowIndex,columnId:d.id})}:o;if(!a)return{cellContext:s,menu:null,preventDefault:!1};let c=_a({onHideIntent:e}),f=a(s,t),m=f instanceof Promise||Array.isArray(f)?!0:!!(f&&Array.isArray(f.items));if(f instanceof Promise)return{cellContext:s,menu:Df(f,c,l),preventDefault:m};let{items:p,columns:h}=Ki(f);return!p||!p.length?{cellContext:s,menu:null,preventDefault:Array.isArray(p)}:{preventDefault:m,menu:Bi(l,{...c,columns:h,items:p}),cellContext:s}}var Hi=5,Ff=[["TopLeft","BottomLeft"],["TopRight","BottomRight"],["BottomLeft","BottomLeft"],["BottomRight","BottomRight"],["TopCenter","TopLeft"],["BottomCenter","TopLeft"],["CenterLeft","TopLeft"],["CenterRight","TopLeft"]];function Nf(o){let{context:t,state:e}=o,{getState:n,actions:i,getDataSourceState:r}=t,{showOverlay:a,portal:l,clearAll:u}=At({portalContainer:pn(n,n().menuPortalContainer,!1)}),d=n().cellContextMenu.onChange(s=>{if(!s)return;let{event:c}=s;function f(){u(),i.cellContextMenuVisibleFor=null}let{menu:m,cellContext:p,preventDefault:h}=Af(s,t,f),y=Ae.fromPoint({top:c.clientY,left:c.clientX});y.width+=Hi,y.height+=Hi,a(()=>m,{constrainTo:fn(n()),id:"cell-context-menu",alignTo:y,alignPosition:Ff}),h&&c.preventDefault(),i.cellContextMenuVisibleFor={columnId:s.columnId,rowId:s.rowId,rowIndex:s.rowIndex,colIndex:s.colIndex};let{onCellContextMenu:C}=n();C&&C({...p,getState:n,getDataSourceState:r},c)});return Ef(()=>e.value.cellContextMenuVisibleFor,(s,c,f)=>{if(s){let p=function(h){h.__insideMenu!==!0&&(u(),i.cellContextMenuVisibleFor=null)};var m=p;document.documentElement.addEventListener("mousedown",p),f(()=>{document.documentElement.removeEventListener("mousedown",p)})}else u()},{flush:"post"}),Mf(()=>{d()}),{MenuPortal:l}}function Of(o){let{context:t,state:e}=o,{getState:n,actions:i}=t,{showOverlay:r,portal:a,clearAll:l}=At({portalContainer:pn(n,n().menuPortalContainer,!1)}),u=n().contextMenu.onChange(d=>{if(!d)return;let{event:s}=d;function c(){l(),i.contextMenuVisibleFor=null}let{menu:f,cellContext:m,preventDefault:p}=_f(d,t,c),h={top:s.clientY,left:s.clientX},y=Ae.fromPoint(h);y.width+=Hi,y.height+=Hi,r(()=>f,{constrainTo:fn(n()),id:"table-context-menu",alignTo:y,alignPosition:Ff}),p&&s.preventDefault(),i.contextMenuVisibleFor={point:h,...d};let{onContextMenu:C}=n();C&&C({...t,...m},s)});return Ef(()=>e.value.contextMenuVisibleFor,(d,s,c)=>{if(d){let m=function(p){p.__insideMenu!==!0&&(l(),i.contextMenuVisibleFor=null)};var f=m;document.documentElement.addEventListener("mousedown",m),c(()=>{document.documentElement.removeEventListener("mousedown",m)})}else l()},{flush:"post"}),Mf(()=>{u()}),{MenuPortal:a}}import{defineComponent as dC,h as Vn,onBeforeUnmount as cC,onMounted as fC,ref as pC,shallowRef as mC,watch as Ma}from"vue";var kf="mlx2t3";import{defineComponent as Lb,h as zb}from"vue";var Lf=Lb({name:"SpacePlaceholder",props:{width:{type:Number,required:!0},height:{type:Number,required:!0},count:{type:Number,required:!1}},setup(o){return()=>zb("div",{"data-count":o.count,"data-placeholder-width":void 0,"data-placeholder-height":void 0,"data-name":"SpacePlaceholder",style:{height:`${o.height}px`,width:`${o.width}px`,zIndex:-1,opacity:0,pointerEvents:"none",contain:"strict"}})}});var zf={true:"_1ueijco2",false:"_1ueijco3",visible:"_1ueijco4",auto:"_1ueijco5",hidden:"_1ueijco6"},Vf={true:"_1ueijco7",false:"_1ueijco8",visible:"_1ueijco9",auto:"_1ueijcoa",hidden:"_1ueijcob"},Gf={true:"_1ueijcoc",false:"_1ueijcod",visible:"_1ueijcoe",auto:"_1ueijcof",hidden:"_1ueijcog"},Kf="_1ueijco1",Bf="_1ueijco0 _16lm1iw0";import{defineComponent as Vb,h as Gb,onBeforeUnmount as Kb,onMounted as Bb,ref as Hb}from"vue";var Hf=o=>{let t="";return typeof o=="boolean"||typeof o=="string"?t=zf[`${o}`]:t=te(Vf[`${o.horizontal}`],Gf[`${o.vertical}`]),t};var Wb="InfiniteVirtualScrollContainer",Wf=Vb({name:"VirtualScrollContainer",props:{scrollable:{type:[Boolean,String,Object],required:!1,default:!0},tabIndex:{type:Number,required:!1},autoFocus:{type:Boolean,required:!1},onContainerScroll:{type:Function,required:!1},scrollerRef:{type:Function,required:!1}},setup(o,{slots:t,attrs:e}){let n=Hb(null),i=r=>{let a=r.target;o.onContainerScroll?.({scrollTop:a.scrollTop,scrollLeft:a.scrollLeft})};return Bb(()=>{let r=n.value;r&&(o.scrollerRef?.(r),r.addEventListener("scroll",i,{passive:!1}),o.autoFocus&&document.activeElement!==r&&r.focus())}),Kb(()=>{n.value?.removeEventListener("scroll",i),o.scrollerRef?.(null)}),()=>Gb("div",{...e,ref:n,tabindex:o.tabIndex,class:te(e.class,Wb,Bf,Hf(o.scrollable))},t.default?.())}});import{computed as jb,defineComponent as $b,h as Ub,onBeforeUnmount as qb,onMounted as Yb,watch as Zb,watchEffect as jf}from"vue";var Wi=$b({name:"RawTable",props:{name:{type:String,required:!1},brain:{type:Object,required:!0},renderCell:{type:Function,required:!0},renderDetailRow:{type:Function,required:!1},cellHoverClassNames:{type:Array,required:!1},cellDetachedClassNames:{type:Array,required:!1,default:()=>[]},renderer:{type:Object,required:!1},onRenderUpdater:{type:Function,required:!1},forceRerenderTimestamp:{type:Number,required:!1}},setup(o){let t=jb(()=>o.onRenderUpdater&&o.renderer?{renderer:o.renderer,onRenderUpdater:o.onRenderUpdater}:Co(o.brain));jf(()=>{t.value.renderer.cellHoverClassNames=o.cellHoverClassNames||[]}),jf(()=>{t.value.renderer.cellDetachedClassNames=o.cellDetachedClassNames||[]});let e=null,n=()=>{e?.();let{renderer:i,onRenderUpdater:r}=t.value,{brain:a,renderCell:l,renderDetailRow:u}=o,d=a.getRenderRange();i.renderRange(d,{onRender:r,force:!0,renderCell:l,renderDetailRow:u}),e=a.onRenderRangeChange(s=>{i.renderRange(s,{force:!1,onRender:c=>{let f=r.get();f&&c&&f.length===c.length||r(c)},renderCell:l,renderDetailRow:u})})};return Yb(n),Zb(()=>[t.value,o.brain,o.renderCell,o.renderDetailRow,o.forceRerenderTimestamp],n,{flush:"post"}),qb(()=>{e?.(),e=null}),()=>Ub(Zt,{name:o.name,updater:t.value.onRenderUpdater})}});var ji=[su,`${Ne}DetachedCell`];import{defineComponent as Xb,h as Uf,onBeforeUnmount as Jb,onMounted as Qb,ref as qf,watch as Yf}from"vue";var $f=we({defaultClassName:"nxbq1c1 _16lm1iwz _16lm1iw2",variantClassNames:{visible:{true:"nxbq1c3",false:"nxbq1c4"}},defaultVariants:{},compoundVariants:[]}),$i="nxbq1c0 _16lm1iwz _16lm1iw4 _16lm1iw26 _16lm1iw23 _16lm1iw1y _16lm1iw1k";var{rootClassName:eC}=Le,tC=`${eC}-ActiveCellIndicator`,nC=U(j.columnZIndexAtIndex),Zf=Xb({name:"ActiveCellIndicator",props:{activeCellIndex:{type:Array,required:!1,default:null},brain:{type:Object,required:!0},rowHeight:{type:[Number,Function],required:!1}},setup(o){let t=qf(null),e=qf(0),n=()=>{let{activeCellIndex:a,brain:l,rowHeight:u}=o;if(a==null)return;let[d]=a;l.isHorizontalLayoutBrain&&l.rowsPerPage&&(d=d%l.rowsPerPage);let s=typeof u=="function"?u(d):u??l.getRowHeight(d),c=l.getItemOffsetFor(d,"vertical");vn({activeCellRowHeight:`${s}px`,activeCellRowOffset:`${c}px`},t.value)},i=null,r=a=>{i?.(),i=a.onRenderCountChange(()=>{e.value++})};return Qb(()=>{r(o.brain),n()}),Yf(()=>o.brain,r),Yf([()=>o.activeCellIndex,()=>o.rowHeight,()=>o.brain],()=>n(),{flush:"post"}),Jb(()=>{i?.()}),()=>{e.value;let a=o.activeCellIndex!=null&&o.brain.getInitialRows()>o.activeCellIndex[0];return Uf("div",{class:$i,ref:t,"data-name":"active-cell",style:a?{zIndex:`var(${nC}-${o.activeCellIndex[1]})`}:void 0},[Uf("div",{"data-name":"active-cell-indicator",class:`${tC} ${$f({visible:a})}`})])}}});import{defineComponent as oC,h as Jf,onBeforeUnmount as iC,onMounted as rC,ref as Qf,watch as ep}from"vue";var Xf=we({defaultClassName:"j26lrx0 _16lm1iwz _16lm1iw2 _16lm1iw23 _16lm1iw26",variantClassNames:{active:{true:"j26lrx2",false:"j26lrx3"}},defaultVariants:{},compoundVariants:[]});var{rootClassName:aC}=Le,lC=`${aC}-ActiveRowIndicator`,sC=`calc(${j.activeCellRowOffsetX} + var(${U(j.scrollLeftForActiveRowWhenHorizontalLayout)}, 0px))`,uC={[U(j.activeCellOffsetY)]:j.activeCellRowOffset,transform:`translate3d(${sC}, calc( ${j.activeCellOffsetY} + var(${U(j.scrollTopForActiveRow)}, 0px)), 0px)`,height:j.activeCellRowHeight,maxWidth:Ie.runtime.totalVisibleColumnsWidthVar},tp=oC({name:"ActiveRowIndicator",props:{activeRowIndex:{type:Number,required:!1,default:null},brain:{type:Object,required:!0}},setup(o){let t=Qf(null),e=Qf(0),n=()=>{let{brain:u}=o;if(o.activeRowIndex==null)return;let d="0px",s=o.activeRowIndex;if(u.isHorizontalLayoutBrain&&u.rowsPerPage){let m=u.getPageIndexForRow(s);m>0&&(d=`calc(${Ie.runtime.totalVisibleColumnsWidthVar} * ${m})`),s=s%u.rowsPerPage}let c=u.getRowHeight(s),f=u.getItemOffsetFor(s,"vertical");vn({activeCellRowHeight:`${c}px`,activeCellRowOffset:`${f}px`,activeCellRowOffsetX:d},t.value)},i=u=>{vn({scrollTopForActiveRow:`${-u.scrollTop}px`,scrollLeftForActiveRowWhenHorizontalLayout:o.brain.isHorizontalLayoutBrain?`${-u.scrollLeft}px`:"0px"},t.value)},r=null,a=null,l=u=>{r?.(),a?.(),i(u.getScrollPosition()),r=u.onScroll(i),a=u.onRenderCountChange(()=>{e.value++})};return rC(()=>{l(o.brain),n()}),ep(()=>o.brain,l),ep([()=>o.activeRowIndex,()=>o.brain],()=>n(),{flush:"post"}),iC(()=>{r?.(),a?.()}),()=>{e.value;let u=o.activeRowIndex!=null&&o.brain.getInitialRows()>o.activeRowIndex;return Jf("div",{class:$i,"data-name":"active-row"},[Jf("div",{ref:t,"data-name":"active-row-indicator",class:`${lC} ${Xf({active:u})}`,style:u?uC:void 0})])}}});var hC=te(kf,Kf),np=dC({name:"HeadlessTable",props:{brain:{type:Object,required:!0},renderCell:{type:Function,required:!0},renderDetailRow:{type:Function,required:!1},cellHoverClassNames:{type:Array,required:!1},renderer:{type:Object,required:!1},onRenderUpdater:{type:Function,required:!1},forceRerenderTimestamp:{type:Number,required:!1},scrollStopDelay:{type:Number,required:!1},wrapRowsHorizontally:{type:Boolean,required:!1},autoFocus:{type:Boolean,required:!1},tabIndex:{type:Number,required:!1},activeRowIndex:{type:Number,required:!1,default:null},activeCellIndex:{type:Array,required:!1,default:null},activeCellRowHeight:{type:[Number,Function],required:!1},scrollerRef:{type:Function,required:!1}},setup(o,{attrs:t}){let e=pC(null),n=mC({width:0,height:0});Ma(()=>o.scrollStopDelay,s=>{s!=null&&o.brain.setScrollStopDelay(s)},{immediate:!0});let i=s=>{requestAnimationFrame(()=>{e.value&&e.value.style.setProperty("transform",`translate3d(${-s.scrollLeft}px, ${-s.scrollTop}px, 0px)`)})},r=s=>{o.brain.setScrollPosition(s,i)},a=null,l=null,u=s=>{l?.(),l=s.onRenderCountChange(()=>{n.value=s.getVirtualizedContentSize()}),n.value=s.getVirtualizedContentSize(),i(s.getScrollPosition()||{scrollLeft:0,scrollTop:0})},d=()=>{a?.(),a=null;let s=e.value?.parentNode;if(!s)return;a=Nn(s,()=>{let f={height:s.clientHeight,width:s.clientWidth};o.brain.update(f)},{debounce:50})};return fC(()=>{u(o.brain),d()}),Ma(()=>o.brain,s=>{u(s),d()}),Ma(()=>o.wrapRowsHorizontally,()=>{d()}),cC(()=>{a?.(),l?.()}),()=>Vn(Wf,{...t,autoFocus:o.autoFocus,tabIndex:o.tabIndex,onContainerScroll:r,scrollerRef:o.scrollerRef},{default:()=>[Vn("div",{ref:e,class:hC,"data-name":"scroll-transform-target"},[Vn(Wi,{forceRerenderTimestamp:o.forceRerenderTimestamp,renderer:o.renderer,onRenderUpdater:o.onRenderUpdater,renderCell:o.renderCell,renderDetailRow:o.renderDetailRow,brain:o.brain,cellHoverClassNames:o.cellHoverClassNames,cellDetachedClassNames:ji}),o.activeCellIndex!=null?Vn(Zf,{brain:o.brain,rowHeight:o.activeCellRowHeight,activeCellIndex:o.activeCellIndex}):null]),o.activeRowIndex!=null?Vn(tp,{brain:o.brain,activeRowIndex:o.activeRowIndex}):null,Vn(Lf,{width:n.value.width,height:n.value.height})]})}});var op="_16lm1iw1 _16lm1iw1c _16lm1iwe";import{computed as bC,defineComponent as cp,h as Vt,onBeforeUnmount as CC,provide as fp,shallowRef as Ea,watch as dp}from"vue";import{inject as TC}from"vue";var rp=Symbol("REPAINT_CELLS_KEY_NO_ROW");function ap(o){return typeof o=="function"}function ip(o,t){let{column:e,rowIndex:n,rowInfoStore:i,getDataSourceState:r}=t,a=i.getRowInfoAtIndex(n);if(!a)return rp;let l=i.getDataSourceStates();return o({rowInfo:a,column:e,dataSourceState:l.dataSourceState??r(),previousDataSourceState:l.previousDataSourceState})}function lp(o,t,e){let n=ip(o,t);return t.rowInfoStore.subscribeToDataArrayChange(()=>{let i=ip(o,t);i!==rp&&(Object.is(i,n)||(n=i,e()))})}import{defineComponent as gC,h as yC}from"vue";function sp(){let{api:o,getState:t}=He(),e=vo(),{editingCell:n,editingValueRef:i}=t(),r=n?.value,a=r;i.current=r;let l=s=>{i.current=s,a=s},{column:u,rowInfo:d}=e.value;return{api:o,initialValue:r,get value(){return a},get readOnly(){let{editingCell:s}=t();return s?!s.active&&!!s.waiting:!1},column:u,rowInfo:d,setValue:l,confirmEdit:o.confirmEdit,cancelEdit:o.cancelEdit,rejectEdit:o.rejectEdit}}var up=gC({name:"InfiniteTableColumnEditor",setup(){let{state:o}=He(),t=sp(),{initialValue:e,setValue:n,confirmEdit:i,cancelEdit:r}=t,a=!1,l=!1,u=f=>{f&&!l&&(l=!0,f.value=e??"",f.focus())},d=f=>{let{key:m}=f;m==="Enter"||m==="Tab"?(i(),f.stopPropagation(),m==="Tab"&&f.preventDefault()):m==="Escape"?(a=!0,r()):f.stopPropagation()},s=()=>{!a&&o.value.editingCell?.active&&i()},c=f=>{n(f.target.value)};return()=>(o.value.editingCell,yC("input",{readonly:t.readOnly||void 0,ref:u,onKeydown:d,onBlur:s,onInput:c,class:te(Rl,Ml.none),type:"text"}))}});var SC=U(j.columnWidthAtIndex),wC=U(j.columnReorderEffectDurationAtIndex),Na=Symbol("InfiniteColumnCell");function vo(){return TC(Na)}var vC=o=>{let{toggleCurrentRowDetails:t,rowDetailState:e}=o;return Vt(dn,{style:{visibility:e===!1?"hidden":"visible"},expanded:e==="expanded",onChange:t})},RC={display:"inline-block",visibility:"visible"},Fa=o=>{let{rowInfo:t,toggleCurrentTreeNode:e,nodeExpanded:n,api:i}=o,r=i.getDataSourceState().isNodeReadOnly;return Vt(dn,{disabled:t.isTreeNode&&t.isParentNode?r(t):!1,style:RC,expanded:n,onChange:e})},IC=o=>{let{rowInfo:t,rowIndex:e,api:n}=o,{components:i}=n.getState(),r=n.getDataSourceState().isNodeSelectable,a=i?.CheckBox||qt;return Vt(a,{domProps:{class:In},disabled:t.isTreeNode?!r(t):!1,onChange:()=>{kc(n,e)},checked:t.rowSelected})},xC=cp({name:"RenderCellHook",props:{renderParam:{type:Object,required:!0},content:{type:null,default:null}},setup(o){return fp(Na,bC(()=>o.renderParam)),()=>o.content}});function ht(o,t){let e=o(t);return e==null?e:Vt(xC,{renderParam:t,content:e})}var pp=cp({name:"InfiniteTableColumnCell",props:{rowIndex:{type:Number,required:!0},rowHeight:{type:Number,required:!0},width:{type:Number,required:!0},hidden:{type:Boolean,default:!1},domRef:{type:Function,required:!0},column:{type:Object,required:!0},columnsMap:{type:Object,required:!0},fieldsToColumn:{type:Object,required:!0},showZebraRows:{type:Boolean,default:!0},rowDetailState:{type:[Boolean,String],default:!1},inEditMode:{type:Boolean,default:!1},rowIndexInHorizontalLayoutPage:{type:Number,default:null},horizontalLayoutPageIndex:{type:Number,default:null},rowStyle:{type:[Object,Function],default:void 0},rowClassName:{type:[String,Function],default:void 0},cellStyle:{type:[Object,Function],default:void 0},cellClassName:{type:[String,Function],default:void 0},repaintCellsKey:{type:[String,Number,Object,Function],default:void 0},getData:{type:Function,required:!0},rowInfoStore:{type:Object,required:!0},renderingContext:{type:Object,required:!0},getComputedVisibleColumns:{type:Function,required:!0},getComputedColumnOrder:{type:Function,required:!0},dataSourceStatePartial:{type:Object,default:void 0},onMouseEnter:{type:Function,default:void 0},onMouseLeave:{type:Function,default:void 0}},setup(o){let t={current:null},e=s=>{let c=s&&s.$el!==void 0?s.$el:s;t.current=c??null,o.domRef(t.current)},n=Ea(o.rowInfoStore.getRowInfoAtIndex(o.rowIndex)),i=null;dp([()=>o.rowInfoStore,()=>o.rowIndex],([s,c])=>{i?.(),n.value=s.getRowInfoAtIndex(c),i=s.subscribeToRowIndex(c,()=>{n.value=s.getRowInfoAtIndex(c)})},{immediate:!0});let r=Ea(0),a=null;dp([()=>o.repaintCellsKey,()=>o.column,()=>o.rowIndex,()=>o.rowInfoStore],([s,c,f,m])=>{a?.(),a=null,ap(s)&&(a=lp(s,{column:c,rowIndex:f,rowInfoStore:m,getDataSourceState:o.renderingContext.getDataSourceState},()=>{r.value++}))},{immediate:!0}),CC(()=>{i?.(),i=null,a?.(),a=null});let l=Ea(null);fp(Na,l);let u=s=>{let{renderingContext:c,column:f,rowIndex:m}=o;c.getState().cellClick({rowIndex:m,colIndex:f.computedVisibleIndex,event:s})},d=s=>{let{renderingContext:c,column:f,rowIndex:m}=o,{getState:p,actions:h}=c,y=f.computedVisibleIndex;p().cellMouseDown({rowIndex:m,colIndex:y,event:s});let{keyboardNavigation:C}=p(),b=n.value?.rowDisabled??!1;if(C==="row"){b||(h.activeRowIndex=m);return}C==="cell"&&(h.activeCellIndex=[m,y])};return()=>{let{column:s,rowIndex:c,rowHeight:f,hidden:m,rowDetailState:p,renderingContext:h,rowIndexInHorizontalLayoutPage:y,horizontalLayoutPageIndex:C}=o,b=n.value;if(r.value,!s||!b)return Vt("div",{ref:e,style:{display:"none"}});let{getState:w,getDataSourceState:S}=h,{activeRowIndex:T,keyboardNavigation:I,columnReorderInPageIndex:x}=w(),F=c===T&&I==="row",N=b.rowDisabled,{rowSelected:R}=b,A=o.getComputedVisibleColumns().map($=>$.id),M=Sc({horizontalLayoutPageIndex:C,rowIndexInHorizontalLayoutPage:y,column:s,rowInfo:b,rowDetailState:p,columnsMap:o.columnsMap,visibleColumnIds:A,fieldsToColumn:o.fieldsToColumn,context:h}),{stylingParam:P,renderParams:D,formattedValueContext:E,renderFunctions:_,groupByColumnReference:O,inEdit:z}=M,{align:K,verticalAlign:B}=D,G=D;G.domRef=e,G.htmlElementRef=t,l.value=G;let{selectionMode:le}=S(),Z=G.cellSelected,De=S().cellSelection??null,me=null;if(!m&&!z){if(_.renderGroupIcon&&(G.renderBag.groupIcon=ht(_.renderGroupIcon,{...G,renderBag:{...G.renderBag}})),_.renderSelectionCheckBox&&le=="multi-row"&&(G.renderBag.selectionCheckBox=ht(IC,G),_.renderSelectionCheckBox!==!0&&(G.renderBag.selectionCheckBox=ht(_.renderSelectionCheckBox,{...G,renderBag:{...G.renderBag}}))),b.isTreeNode){let{isParentNode:xe}=b,be;be=(xe?_.renderTreeIconForParentNode:_.renderTreeIconForLeafNode)||typeof _.renderTreeIcon=="function"?_.renderTreeIcon:xe&&_.renderTreeIcon===!0?Fa:void 0,be===!0?be=Fa:be&&(G.renderBag.treeIcon=ht(Fa,G)),be&&(G.renderBag.treeIcon=ht(be,{...G,renderBag:{...G.renderBag}}))}_.renderRowDetailIcon&&(G.renderBag.rowDetailsIcon=ht(vC,{...G,renderBag:{...G.renderBag}}),typeof _.renderRowDetailIcon=="function"&&(G.renderBag.rowDetailsIcon=ht(_.renderRowDetailIcon,{...G,renderBag:{...G.renderBag}}))),_.renderValue&&(G.renderBag.value=ht(_.renderValue,{...G,renderBag:{...G.renderBag}})),b.isGroupRow&&_.renderGroupValue&&(G.renderBag.value=ht(_.renderGroupValue,{...G,renderBag:{...G.renderBag}})),!b.isGroupRow&&_.renderLeafValue&&(G.renderBag.value=ht(_.renderLeafValue,{...G,renderBag:{...G.renderBag}}));let $=G.renderBag.value;$ instanceof Date&&($=$.toLocaleDateString());let ee=G.renderBag,Se=[K!=="end"?ee.treeIcon:null,K!=="end"?ee.groupIcon:null,K!=="end"?ee.rowDetailsIcon:null,K!=="end"?ee.selectionCheckBox:null,$,K==="end"?ee.selectionCheckBox:null,K==="end"?ee.rowDetailsIcon:null,K==="end"?ee.groupIcon:null,K==="end"?ee.treeIcon:null];me=s.render?ht(s.render,{...G,renderBag:{...G.renderBag,all:Se}}):Se}let{style:ve,className:Oe}=pc({column:s,rowInfo:b,rowIndex:c,rowHeight:f,rowIndexInHorizontalLayoutPage:y,horizontalLayoutPageIndex:C,align:K,verticalAlign:B,stylingParam:P,formattedValueContext:E,groupByColumnReference:O,rowStyle:o.rowStyle,rowClassName:o.rowClassName,cellStyle:o.cellStyle,cellClassName:o.cellClassName,showZebraRows:o.showZebraRows,rowActive:F,rowDisabled:N,rowSelected:R,cellSelected:Z,cellSelection:De,getData:o.getData,computedVisibleColumns:o.getComputedVisibleColumns(),computedColumnOrder:o.getComputedColumnOrder(),columnReorderInPageIndex:x}),Me=s.computedVisibleIndex,Te=s.cssEllipsis??!0,_e={width:`var(${SC}-${Me})`,transition:`transform var(${wC}-${Me}, 0s)`,...ve,height:typeof ve.height=="number"?`${ve.height}px`:ve.height},{onRowMouseEnter:ue,onRowMouseLeave:Q}=o.renderingContext.getState(),H=ue||o.onMouseEnter?$=>{ue?.({...E,rowIndex:c},$),o.onMouseEnter?.($)}:void 0,q=Q||o.onMouseLeave?$=>{Q?.({...E,rowIndex:c,rowInfo:b},$),o.onMouseLeave?.($)}:void 0,X={ref:e,style:_e,"data-column-id":s.id,"data-z-index":_e.zIndex,"data-row-id":`${b.id}`,class:te(Oe,wt,Wo),onClick:u,onMousedown:d,onMouseenter:H,onMouseleave:q},ne=Vt("div",{class:te(`${wt}_content`,Te?lt:No.hidden)},[me]),ie=s.components?.Editor??up,he=z?Vt(ie):null,ge=he?[ne,he]:[ne],oe=s.components?.ColumnCell;return oe?Vt(oe,X,{default:()=>ge}):Vt("div",X,ge)}}});import{defineComponent as AC,h as _C,shallowRef as MC,watch as EC}from"vue";var mp=we({defaultClassName:"evqes20",variantClassNames:{},defaultVariants:{},compoundVariants:[]});function PC(o,t){let{masterState:e,detailContext:n}=t,i=e.detailDataSourcesStateToRestore;if(i.has(o)){let r=i.get(o);return n.assignState(r),!0}return!1}function DC(o,t){let{detailState:e,masterState:n,masterActions:i,cacheEntryForRow:r}=t,a=new Map(n.detailDataSourcesStateToRestore),l=ad(e);r.all||(r.groupBy||delete l.groupBy,r.sortInfo||delete l.sortInfo,r.filterValue||delete l.filterValue,r.data||delete l.originalDataArray),a.set(o,l),i.detailDataSourcesStateToRestore=a}function hp(o,t){let e={current:!1};return{currentRowCache:{getRowId:()=>o,add:i=>{e.current=!0,t.add(o,i)},get:()=>t.get(o),delete:()=>(e.current=!0,t.delete(o)),has:()=>t.has(o)},cacheCalledByRowDetailRenderer:e}}function gp(o){let{rowInfo:t,currentRowCache:e,cacheCalledByRowDetailRenderer:n,getMasterDataSourceState:i,masterActions:r,getMasterState:a}=o,l=i().detailDataSourcesStateToRestore.has(t.id)&&e.has(),d={registerDetail:bt(s=>{if(n.current||e.add({all:!0}),!e.has()){requestAnimationFrame(()=>{s.dataSourceState.destroyedRef.current||(s.dataSourceActions.stateReadyAsDetails=!0)});return}PC(t.id,{masterState:i(),detailContext:s}),requestAnimationFrame(()=>{s.dataSourceState.destroyedRef.current||(s.dataSourceActions.stateReadyAsDetails=!0)}),s.dataSourceState.onCleanup.onChange(()=>{let c=e.get();c&&DC(t.id,{detailState:s.getDataSourceState(),masterActions:r,masterState:i(),cacheEntryForRow:c})})}),shouldRestoreState:l};return d.masterRowInfo=t,d.getMasterDataSourceState=i,d.getMasterState=a,d}var{rootClassName:FC}=Le,NC=`${FC}RowDetail`,Oa=AC({name:"InfiniteTableDetailRow",props:{rowInfo:{type:Object,required:!0},rowIndex:{type:Number,required:!0},domRef:{type:Function,required:!1},rowDetailHeight:{type:Number,required:!0},detailOffset:{type:Number,required:!0},rowDetailRenderer:{type:Function,required:!0},rowDetailsCache:{type:Object,required:!0}},setup(o){let{getDataSourceState:t,dataSourceActions:e}=mo(),{getState:n}=He(),i=()=>{let{currentRowCache:l,cacheCalledByRowDetailRenderer:u}=hp(o.rowInfo.id,o.rowDetailsCache);return{masterDetailContextValue:gp({rowInfo:o.rowInfo,currentRowCache:l,cacheCalledByRowDetailRenderer:u,getMasterDataSourceState:t,masterActions:e,getMasterState:n}),currentRowCache:l}},r=MC(i());EC(()=>o.rowInfo.id,()=>{r.value=i()}),Id(()=>r.value.masterDetailContextValue);let a=l=>{let u=l&&l.$el!==void 0?l.$el:l;o.domRef?.(u||null)};return()=>{let{masterDetailContextValue:l,currentRowCache:u}=r.value;return l.masterRowInfo=o.rowInfo,_C("div",{ref:a,class:te(NC,mp({})),style:{position:"absolute",top:`${o.detailOffset}px`,left:0,width:`calc(${j.bodyWidth} - ${j.scrollbarWidthVertical})`,height:`${o.rowDetailHeight}px`}},[o.rowDetailRenderer(o.rowInfo,u)])}}});var ka=class{constructor(){this.rowHeight=new Map;this.rowDetailHeight=new Map;this.getRowHeight=t=>this.rowHeight.get(t)??0;this.getRowDetailHeight=t=>this.rowDetailHeight.get(t)??0}getTotalRowHeight(t){return this.getRowHeight(t)+this.getRowDetailHeight(t)}getSize(t){let e=this.getRowHeight(t),n=this.getRowDetailHeight(t);return{rowHeight:e,rowDetailHeight:n,totalRowHeight:e+n}}};function OC(o,t){let e=o.rowDetailHeight,n=o.rowHeight,{isRowDetailsExpanded:i,isRowDetailsEnabled:r,getDataSourceState:a}=o;if(!i)return typeof n=="function"?s=>{if(t&&t.rowHeight.has(s))return t.rowHeight.get(s);let c=a().dataArray[s],f=c?n(c):0;return t&&t.rowHeight.set(s,f),f}:n;let l=typeof n=="function",u=typeof e=="function";return s=>{if(t&&t.rowHeight.has(s)&&t.rowDetailHeight.has(s))return t.rowHeight.get(s)+t.rowDetailHeight.get(s);let c=a().dataArray[s];if(!c)return t&&(t.rowHeight.set(s,0),t.rowDetailHeight.set(s,0)),0;let f=l?n(c):n;if(!!(!r||typeof r=="function"&&r(c)===!1)||!i(c))return t&&(t.rowHeight.set(s,f),t.rowDetailHeight.set(s,0)),f;let p=0;return u?p=e(c):p=e,t&&(t.rowHeight.set(s,f),t.rowDetailHeight.set(s,p)),f+p}}function yp(o){let t=new ka;return{computedRowHeight:OC(o,t),computedRowSizeCacheForDetails:o.isRowDetailsExpanded?t:void 0}}import{computed as Ip,defineComponent as BC,h as Gn,onBeforeUnmount as HC,watch as WC,watchEffect as jC}from"vue";function bp(o,t,e,n){let i=new Map,r=new Map,a=new Map;o.forEach((s,c)=>{let f=s.id,m=o[c-1],p=m?.id??"",h=new Set,y=m?.computedPinned!==s.computedPinned?new Set:a.get(p)??new Set;a.set(f,h);let C={type:"column",id:f,ref:s,groupOffset:0,computedPinned:s.computedPinned,computedWidth:s.computedWidth,depth:s.columnGroup?(e.get(s.columnGroup)??0)+1:0};i.set([f],C);let b=s.columnGroup,w,S=C;for(;b;){let T=t[b];if(T){h.add(b);let I=[f,...h];w=y.has(b)?r.get(b):void 0,w||(w={id:b,type:"group",ref:T,columnItems:[],children:[],groupOffset:0,uniqueGroupId:[b],computedWidth:0,computedPinned:C.computedPinned,depth:e.get(b)??0},i.set(I,w),r.set(b,w)),w.columnItems.push(C),w.uniqueGroupId.push(C.id),S&&!y.has(S.id)&&w.children.push(S),S=w,b=T.columnGroup}else break}});let l=[],u=new W,d=0;return i.forEach(s=>{if(!s.ref.columnGroup){let c=s.type==="column"?s.ref.computedWidth:s.columnItems.reduce((f,m)=>f+m.ref.computedWidth,0);s.groupOffset=d,s.computedWidth=c,s.type==="group"&&Cp(s.children),l.push(s),d+=c}if(s.type==="group")s.columnItems.forEach(c=>{u.set([s.depth,c.ref.computedVisibleIndex],s)});else for(let c=s.depth;c<=n+1;c++)u.set([c,s.ref.computedVisibleIndex],s)}),i.clear(),r.clear(),{tree:l,pathsToCells:u}}function Cp(o,t=0){o.forEach(e=>{let n=e.type==="column"?e.ref.computedWidth:e.columnItems.reduce((i,r)=>i+r.ref.computedWidth,0);e.computedWidth=n,e.groupOffset=t,e.type==="group"&&Cp(e.children),t+=n})}import{defineComponent as GC,h as La}from"vue";import{defineComponent as kC,h as Tp,ref as LC}from"vue";var{rootClassName:zC}=Le,VC=`${zC}HeaderCell_ResizeHandle`,Sp=kC({name:"GroupResizeHandle",props:{groupColumns:{type:Array,required:!0},columns:{type:Array,required:!0},draggerStyle:{type:Object,default:void 0},brain:{type:Object,required:!0},computeResize:{type:Function,required:!0},onResize:{type:Function,required:!0}},setup(o){let t={current:null},e=LC(!1),n=i=>{i.stopPropagation();let r=o.groupColumns[0];if(!r)return;let a=r.computedPinned,l=i.pointerId,u=i.clientX,d=i.target;d.setPointerCapture(l);let s=!0,c=wu(o.groupColumns.map(h=>h.computedVisibleIndex),{columns:o.columns,domRef:t}),f=h=>{a==="end"&&(h*=-1);let{constrained:y,adjustedDiffs:C,adjustedDiff:b}=o.computeResize(h);return e.value!==y&&(e.value=y),c.resize(C),b},m=h=>{if(s){let y=o.groupColumns.reduce((w,S)=>w+S.computedWidth-S.computedMinWidth,0),C=o.brain.getAvailableSize(),b={width:C.width+y,height:C.height};o.brain.update(b),s=!1}f(Math.round(h.clientX-u))},p=h=>{d.releasePointerCapture(l),d.removeEventListener("pointermove",m),d.removeEventListener("pointerup",p);let y=Math.round(h.clientX-u),C=f(y);c.resize(o.groupColumns.map(()=>0)),o.onResize(C)};d.addEventListener("pointermove",m),d.addEventListener("pointerup",p)};return()=>{let i=o.groupColumns[0];if(!i)return null;let r=i.computedPinned,a=i.computedFirstInCategory,l=i.computedLastInCategory,u=(r===!1||r==="start")&&l?{right:r==="start"?void 0:Ie.components.HeaderCell.resizeHandleWidth}:r==="end"&&a?{right:void 0}:void 0;return Tp("div",{ref:d=>{t.current=d??null},class:`${VC} ${qo} ${Zo({computedPinned:r,computedFirstInCategory:a,computedLastInCategory:l})}`,onPointerdown:n},[Tp("div",{style:{...u,...o.draggerStyle},class:Yo({constrained:e.value})})])}}});var wp=`${Ne}HeaderGroup`,vp=U(j.columnWidthAtIndex),KC=U(j.columnZIndexAtIndex),Rp=GC({name:"InfiniteTableHeaderGroup",props:{columnGroup:{type:Object,required:!0},columns:{type:Array,required:!0},height:{type:Number,required:!0},width:{type:Number,required:!0},columnGroupsMaxDepth:{type:Number,required:!0},horizontalLayoutPageIndex:{type:Number,default:null},domRef:{type:Function,required:!0}},setup(o){let{getState:t,getComputed:e,actions:n}=He(),i=l=>{o.domRef(l??null)},r=l=>{let u=t(),{columnSizing:d,viewportReservedWidth:s,bodySize:c}=u,f=e().computedVisibleColumns,m=o.columns,p=m[m.length-1],h=!1,y=f.reduce((b,w)=>(w.computedFlex&&(b[w.id]={...d[w.id],flex:w.computedWidth},h=!0),b),{}),C=h?{...d,...y}:d;return ss({availableSize:Nr(c),reservedWidth:s||0,dragHandleOffset:l,dragHandlePositionAfter:p.computedVisibleIndex,columnSizing:C,columnGroupSize:m.length,items:f.map(b=>({id:b.id,resizable:b.computedResizable,computedFlex:b.computedFlex,computedWidth:b.computedWidth,computedMinWidth:b.computedMinWidth,computedMaxWidth:b.computedMaxWidth}))})},a=l=>{let{columnSizing:u,reservedWidth:d}=r(l);n.viewportReservedWidth=d,n.columnSizing=u};return()=>{let{columnGroup:l,height:u,columns:d,columnGroupsMaxDepth:s}=o,{header:c}=l,{style:f}=l;c instanceof Function&&(c=c({columnGroup:l,horizontalLayoutPageIndex:o.horizontalLayoutPageIndex}));let m=d[0],p=d.length>1?"calc( "+d.map(w=>`var(${vp}-${w.computedVisibleIndex})`).join(" + ")+" )":`var(${vp}-${m.computedVisibleIndex})`,h=`calc(var(${KC}-${m.computedVisibleIndex}) + ${s-l.depth})`,y=typeof f=="function"?f({columnGroup:l,horizontalLayoutPageIndex:o.horizontalLayoutPageIndex}):f;y=y&&typeof y=="object"?{...y}:{},y.width=p,y.height=`${u}px`;let b=d.some(w=>w.computedResizable)?La(Sp,{brain:t().brain,draggerStyle:{height:`${u*(s-l.depth+2)}px`},columns:e().computedVisibleColumns,groupColumns:d,computeResize:r,onResize:a}):null;return La("div",{ref:i,"data-group-id":l.uniqueGroupId,class:te(Zl,wp),style:y,"data-z-index":h},[La("div",{class:te(`${wp}__header-content`,lt)},[c]),b])}}});var{rootClassName:$C}=Le,xp=`${$C}Header`,UC=[],qC=jl({overflow:!1}),Pp=BC({name:"TableHeaderWrapper",props:{headerBrain:{type:Object,required:!0},bodyBrain:{type:Object,required:!0},wrapRowsHorizontally:{type:Boolean,default:!1}},setup(o){let t=He(),{state:e,getState:n,getComputed:i,dataSourceContext:r}=t,a=Ip(()=>{let p=e.value,h=p.computedColumnGroups;return!h||!Object.keys(h).length?1:p.columnGroupsMaxDepth+2}),l=Ip(()=>{let p=e.value;return a.value*p.columnHeaderHeight+(p.showColumnFilters?p.columnHeaderHeight:0)}),u=Lt(()=>{let p=e.value;return[p.computedColumnGroups,p.columnGroupsDepthsMap,p.columnGroupsMaxDepth,i().computedVisibleColumns]},()=>{let p=n(),{computedColumnGroups:h,columnGroupsDepthsMap:y}=p,{computedVisibleColumns:C}=i();if(!(!h||!Object.keys(h).length))return bp(C,h,y,p.columnGroupsMaxDepth)},"header.treeInfo");jC(()=>{let p=e.value,{computedVisibleColumns:h,computedPinnedStartColumns:y,computedPinnedEndColumns:C,columnSize:b}=i(),w=a.value,S=l.value,T=u.value,I=p.showColumnFilters,x=p.columnHeaderHeight,F=({rowIndex:A,colIndex:M})=>{let P=h[M],D=1,E=1;if(!P||!T)return{rowspan:D,colspan:E};let _=T.pathsToCells.get([A,M]);if(!_)return{rowspan:D,colspan:E};if(_.type==="column")return{colspan:E,rowspan:w-_.depth};let O=_.columnItems.findIndex(z=>z.id===P.id);return{rowspan:D,colspan:O===0?_.columnItems.length:1}},N=A=>I?A<w-1?x:2*x:x,R=o.headerBrain;(y.length||C.length)&&R.updateFixedCells({fixedColsStart:y.length,fixedColsEnd:C.length}),R.update({colWidth:b,rowHeight:N,rows:w,cols:h.length,height:S,rowspan:({rowIndex:A,colIndex:M})=>F({rowIndex:A,colIndex:M}).rowspan,colspan:({rowIndex:A,colIndex:M})=>F({rowIndex:A,colIndex:M}).colspan})});let d=null,s=p=>{d&&(d.style.transform=`translate3d(-${p.scrollLeft}px, 0px, 0px)`)},c=p=>{d=p??null},f=null;WC(()=>o.headerBrain,p=>{f?.(),f=p.onScroll(s),s(p.getScrollPosition()||{scrollLeft:0,scrollTop:0})},{immediate:!0}),HC(()=>{f?.(),f=null});let m=Lt(()=>{let p=e.value,h=r.state.value,{computedVisibleColumns:y,computedColumnsMap:C}=i();return[p.headerOptions,p.columnHeaderHeight,p.columnGroupsMaxDepth,p.showColumnFilters,y,C,u.value,o.headerBrain,h.allRowsSelected,h.someRowsSelected,h.selectionMode,h.filterTypes,h.filterDelay]},()=>{let p=n(),h=r.getDataSourceState(),{computedVisibleColumns:y,computedColumnsMap:C}=i(),b=o.headerBrain,w=u.value,S=p.columnGroupsMaxDepth,T=p.headerOptions,{allRowsSelected:I,someRowsSelected:x,selectionMode:F}=h;return N=>{let{rowIndex:R,colIndex:A,domRef:M,height:P,widthWithColspan:D,heightWithRowspan:E,hidden:_}=N,O=y[A];if(!O||_)return null;let z=b.isHorizontalLayoutBrain?b.getPageIndexForRow(R):null,K=w?w.pathsToCells.get([R,A]):null;if(K&&K.type==="group"){let B=K.columnItems.map(Z=>Z.ref),G={...K.ref,id:K.id,uniqueGroupId:K.uniqueGroupId,depth:K.depth,columns:B.map(Z=>Z.id),computedWidth:K.computedWidth,groupOffset:K.groupOffset};return n().columnGroupVisibility[K.id]!==!1?Gn(Rp,{key:K.uniqueGroupId.join("/"),horizontalLayoutPageIndex:z,columnGroupsMaxDepth:S,domRef:M,columns:B,width:D,height:P,columnGroup:G}):null}return Gn(Pu,{key:O.id,domRef:M,column:O,columnsMap:C,horizontalLayoutPageIndex:z,headerOptions:T,width:D,height:E,allRowsSelected:I,someRowsSelected:x,selectionMode:F})}},"header.renderCell");return()=>{let p=l.value,{scrollbars:h}=i(),y=e.value,C=Gn("div",{ref:c,class:te(xp,`${xp}--virtualized`,qC),style:{height:`${p}px`}},[Gn(Wi,{name:"header",renderCell:m.value,brain:o.headerBrain,renderer:y.headerRenderer,onRenderUpdater:y.headerOnRenderUpdater,cellHoverClassNames:UC,cellDetachedClassNames:ji})]),b=h.vertical&&Tt()?Gn("div",{class:Jl,style:{zIndex:1e3,width:`${Tt()}px`}}):null;return Gn("div",{class:`${vr} ${ns}`,style:{height:`${p}px`}},[C,b])}}});import{defineComponent as YC,h as za}from"vue";var Dp={visible:"qy58ya1 qy58ya0 _16lm1iw2 _16lm1iw23 _16lm1iw26 _16lm1iw2c _16lm1iw2a",hidden:"qy58ya2 qy58ya0 _16lm1iw2 _16lm1iw23 _16lm1iw26 _16lm1iw2c _16lm1iw2a"},Ap="qy58ya3 _16lm1iw2 _16lm1iw23 _16lm1iw26 _16lm1iw2c _16lm1iw2a",_p="qy58ya4";var{rootClassName:ZC}=Le,Va=`${ZC}-LoadMask`,Ui=YC({name:"LoadMask",props:{visible:{type:Boolean,required:!0}},setup(o,{slots:t}){return()=>za("div",{class:`${Dp[o.visible?"visible":"hidden"]} ${Va}`},[za("div",{class:`${Ap} ${Va}-Overlay`}),za("div",{class:`${_p} ${Va}-Text`},t.default?t.default():"Loading")])}});var Mp=o=>`--infinite-${o}`;var Ep=40,Fp=Mp(Ds);var iT=Le.rootClassName,Ka=["debugId","id","children","columns","columnDefaultWidth","columnDefaultFlex","columnMinWidth","columnMaxWidth","columnCssEllipsis","columnHeaderCssEllipsis","columnDefaultSortable","columnDefaultDraggable","columnDefaultEditable","columnDefaultFilterable","columnDefaultGroupable","columnOrder","defaultColumnOrder","onColumnOrderChange","columnVisibility","defaultColumnVisibility","onColumnVisibilityChange","columnPinning","defaultColumnPinning","onColumnPinningChange","columnSizing","defaultColumnSizing","onColumnSizingChange","columnTypes","columnGroups","defaultColumnGroups","columnGroupVisibility","collapsedColumnGroups","pinnedStartMaxWidth","pinnedEndMaxWidth","viewportReservedWidth","onViewportReservedWidthChange","resizableColumns","draggableColumns","draggableColumnsRestrictTo","sortable","multiSortBehavior","editable","rowHeight","onRowHeightChange","rowDetailHeight","columnHeaderHeight","onColumnGroupVisibilityChange","header","headerOptions","showColumnFilters","showZebraRows","showHoverRows","rowHoverClassName","rowClassName","rowStyle","rowProps","cellClassName","cellStyle","repaintCellsKey","domProps","licenseKey","loadingText","components","keyboardNavigation","keyboardSelection","multiRowSelectionWith","keyboardShortcuts","activeRowIndex","defaultActiveRowIndex","onActiveRowIndexChange","activeCellIndex","defaultActiveCellIndex","onActiveCellIndexChange","onKeyDown","onCellClick","onCellDoubleClick","onCellContextMenu","onContextMenu","onScrollToTop","onScrollToBottom","onScrollStop","scrollToBottomOffset","scrollStopDelay","scrollTopKey","onReady","onRenderRangeChange","onRowMouseEnter","onRowMouseLeave","onSelfFocus","onSelfBlur","onFocusWithin","onBlurWithin","focusedClassName","focusedWithinClassName","focusedStyle","focusedWithinStyle","groupColumn","groupRenderStrategy","hideColumnWhenGrouped","hideEmptyGroupColumns","pivotColumn","pivotColumns","pivotColumnGroups","pivotTotalColumnPosition","pivotGrandTotalColumnPosition","showSeparatePivotColumnForSingleAggregation","wrapRowsHorizontally","repeatWrappedGroupRows","onScrollbarsChange","autoSizeColumnsKey","columnMenuRealignDelay","getColumnMenuItems","getCellContextMenuItems","getContextMenuItems","getFilterOperatorMenuItems","menuPortalContainer","menuConstrainTo","onEditCancelled","onEditRejected","onEditAccepted","persistEdit","shouldAcceptEdit","onEditPersistError","onEditPersistSuccess","rowDetailCache","rowDetailRenderer","isRowDetailExpanded","isRowDetailEnabled","rowDetailState","defaultRowDetailState","onRowDetailStateChange"],{useManagedComponent:rT,injectionKey:aT}=hn({initSetupState:Gd,forwardProps:Kd,mapPropsToState:jd,cleanup:Bd,allowedControlledPropOverrides:{rowHeight:!0,columnHeaderHeight:!0},mappedCallbacks:Wd(),getParentState:()=>{let o=QC(po,null);return o?o.state:null},debugName:"InfiniteTable"});function Op(o){return t=>o[t]?.computedWidth??0}function kp(o,t){return o.filter(n=>typeof n.rowspan=="function").length?({rowIndex:n,colIndex:i})=>{let r=t().dataArray,a=r[n];if(!a)return 1;let l=o[i];return!l||!l.rowspan?1:l.rowspan({column:l,data:a.data,dataArray:r,rowInfo:a,rowIndex:n})}:void 0}var Ba=JC({name:"InfiniteTable",props:[...Ka],setup(o,{attrs:t}){let e=mo();if(!e)throw new Error("InfiniteTable must be rendered inside a <DataSource> component");let n=new Proxy(o,{get(g,v,L){let k=Reflect.get(g,v,L);return v==="rowHeight"?k??Ep:v==="columnHeaderHeight"?k??Fp:v==="repeatWrappedGroupRows"?k??!!Reflect.get(g,"wrapRowsHorizontally"):k}}),{contextValue:i}=rT(n);Np(aT,i);let r=i.state,a=i.componentActions,l=i.getComponentState,{state:u,getDataSourceState:d}=e,s=g=>{P.toggleGroupRow(g)};We([()=>r.value.columns,()=>u.value.groupBy,()=>u.value.pivotBy,()=>u.value.selectionMode,()=>r.value.hideColumnWhenGrouped,()=>r.value.groupColumn,()=>r.value.groupRenderStrategy,()=>r.value.pivotColumns,()=>r.value.pivotTotalColumnPosition,()=>r.value.pivotColumn],()=>{let g=r.value,v=u.value,{columns:L,groupColumnIds:k}=yc({columns:g.columns,groupColumn:g.groupColumn,pivotColumn:g.pivotColumn,pivotTotalColumnPosition:g.pivotTotalColumnPosition,pivotGrandTotalColumnPosition:g.pivotGrandTotalColumnPosition,groupRenderStrategy:g.groupRenderStrategy==="inline"?"single-column":g.groupRenderStrategy,groupBy:v.groupBy,pivotBy:v.pivotBy,pivotColumns:g.pivotColumns,toggleGroupRow:s,selectionMode:v.selectionMode});a.columnsWhenGrouping=L;let Y=r.value.columnOrder;if(k.length&&Array.isArray(Y)){let V=new Set(Y),J=!1;k.forEach(ce=>{V.has(ce)||(J=!0,Y=[ce,...Y])}),J&&(a.columnOrder=Y)}},{immediate:!0}),We(()=>r.value.groupRenderStrategy,g=>{e.dataSourceActions.generateGroupRows=g!=="inline"},{immediate:!0}),We(()=>r.value.showSeparatePivotColumnForSingleAggregation,g=>{e.dataSourceActions.showSeparatePivotColumnForSingleAggregation=g},{immediate:!0}),We(()=>r.value.pivotTotalColumnPosition,g=>{e.dataSourceActions.pivotTotalColumnPosition=g},{immediate:!0}),We(()=>r.value.pivotGrandTotalColumnPosition,g=>{g!=null&&(e.dataSourceActions.pivotGrandTotalColumnPosition=g)},{immediate:!0});let c=tT(0),f=null,m=null,p=()=>{let{autoSizeColumnsKey:g}=r.value;return typeof g=="object"?g.key:g};We(()=>r.value.brain,g=>{m?.(),m=g.onRenderRangeChange(()=>{p()!=null&&r.value.autoSizeColumnsKey!==f&&(c.value+=1)})},{immediate:!0}),Ga(()=>{m?.()}),We([p,()=>r.value.ready,c],()=>{let g=p();if(g==null)return;let{autoSizeColumnsKey:v,domRef:L}=r.value,k,Y,V=!0;typeof v=="object"&&(v.columnsToResize&&(k=new Set(v.columnsToResize)),v.columnsToSkip&&(Y=new Set(v.columnsToSkip)),V=v.includeHeader??V),f=g;let J=qd(L,{includeHeader:V,columnsToResize:k,columnsToSkip:Y}),ce=Object.keys(J);if(!ce.length)return;let se=r.value.columnSizing,fe={...se},ae=!1;ce.forEach(ye=>{fe[ye]={width:J[ye]},ae=ae||fe[ye].width!==se[ye]?.width}),ae&&(a.columnSizing=fe)},{immediate:!0,flush:"post"});let h=XC(()=>Hd(u.value.groupBy));We([()=>r.value.groupRenderStrategy,()=>u.value.originalLazyGroupDataChangeDetect,()=>u.value.groupBy,h,()=>r.value.computedColumns,()=>r.value.hideEmptyGroupColumns?u.value.dataArray:null,()=>r.value.hideEmptyGroupColumns?u.value.groupRowsState:null,()=>r.value.hideEmptyGroupColumns?u.value.groupRowsIndexesInDataArray:null,()=>r.value.hideEmptyGroupColumns],()=>{let g=r.value,v=u.value;if(g.groupRenderStrategy!=="multi-column")return;let L=h.value,k=$d(g.computedColumns,L),Y=Ud({computedGroupColumns:k,columnVisibility:g.columnVisibility,hideEmptyGroupColumns:g.hideEmptyGroupColumns,groupRowsIndexesInDataArray:v.groupRowsIndexesInDataArray,dataArray:v.dataArray,groupBy:v.groupBy,groupByMap:L});jt(g.columnVisibility,Y)||(a.columnVisibility=Y)},{immediate:!0}),We([()=>r.value.computedColumns,()=>r.value.columnTypes,()=>u.value.groupBy,h,()=>r.value.hideColumnWhenGrouped],()=>{let g=r.value,v=h.value,L=u.value.groupBy.length>0,{columnVisibility:k,columnVisibilityForGrouping:Y,hideColumnWhenGrouped:V,computedColumns:J}=g,ce={...k},se={...Y},fe=!1,ae=new Set,ye=new Set;Object.keys(J).forEach(Re=>{let re=J[Re];if(re.defaultHiddenWhenGroupedBy||V!=null)if(re.defaultHiddenWhenGroupedBy==="*"&&L||(re.defaultHiddenWhenGroupedBy===!0||V)&&re.field&&v.get(re.field)||typeof re.defaultHiddenWhenGroupedBy=="string"&&v.get(re.defaultHiddenWhenGroupedBy)||typeof re.defaultHiddenWhenGroupedBy=="object"&&Object.keys(re.defaultHiddenWhenGroupedBy).reduce((Mt,Et)=>Mt||v.has(Et),!1)){if(se[Re]!==!1){if(k[Re]===!1)return;se[Re]=!1,fe=!0,ae.add(Re)}}else se[Re]===!1&&(delete se[Re],fe=!0,ye.add(Re))}),fe&&(a.columnVisibilityForGrouping=se,ye.forEach(Re=>{delete ce[Re]}),ae.forEach(Re=>{ce[Re]=!1}),a.columnVisibility=ce)},{immediate:!0});let y=Lt(()=>{let g=r.value,v=u.value;return[g.computedColumns,g.bodySize.width,g.columnMinWidth,g.columnMaxWidth,g.columnDefaultWidth,g.columnDefaultFlex,g.columnCssEllipsis,g.columnHeaderCssEllipsis,g.viewportReservedWidth,g.resizableColumns,v.filterValue,v.filterTypes,g.sortable,v.sortInfo,v.multiSort,g.pinnedEndMaxWidth,g.pinnedStartMaxWidth,g.draggableColumns,g.columnDefaultDraggable,g.columnOrder,g.columnPinning,g.columnDefaultEditable,g.columnDefaultFilterable,g.columnDefaultGroupable,g.columnDefaultSortable,g.editable,g.columnSizing,g.columnTypes,g.columnVisibility,g.initialColumns,v.groupBy]},()=>{let g=r.value,v=u.value;return ms({columns:g.computedColumns,userColumns:g.initialColumns,scrollbarWidth:void 0,bodySize:g.bodySize,columnMinWidth:g.columnMinWidth,columnMaxWidth:g.columnMaxWidth,columnDefaultWidth:g.columnDefaultWidth,columnDefaultFlex:g.columnDefaultFlex,columnCssEllipsis:g.columnCssEllipsis,columnHeaderCssEllipsis:g.columnHeaderCssEllipsis,viewportReservedWidth:g.viewportReservedWidth,resizableColumns:g.resizableColumns,filterValue:v.filterValue,filterTypes:v.filterTypes,sortable:g.sortable,sortInfo:v.sortInfo??void 0,multiSort:v.multiSort,pinnedEndMaxWidth:g.pinnedEndMaxWidth,pinnedStartMaxWidth:g.pinnedStartMaxWidth,draggableColumns:g.draggableColumns,columnDefaultDraggable:g.columnDefaultDraggable,columnOrder:g.columnOrder,columnPinning:g.columnPinning,columnDefaultEditable:g.columnDefaultEditable,columnDefaultFilterable:g.columnDefaultFilterable,columnDefaultGroupable:g.columnDefaultGroupable,columnDefaultSortable:g.columnDefaultSortable,editable:g.editable,columnSizing:g.columnSizing,columnTypes:g.columnTypes,columnVisibility:g.columnVisibility,columnVisibilityAssumeVisible:!0,groupBy:v.groupBy})},"computedColumnsResult"),C=()=>y.value.computedVisibleColumns,{getDataSourceState:b,dataSourceApi:w}=e,S=new Ei({getRowAt:g=>b().dataArray[g],isNodeSelectable:g=>{let{isNodeSelectable:v}=b();return v?v(g):!0}}),T=new Fi({getPrimaryKeyByIndex:w.getPrimaryKeyByIndex,getColumnIdByIndex:g=>C()[g]?.id||""}),I=nT({vertical:!1,horizontal:!1}),x=null;We(()=>r.value.brain,g=>{x?.(),x=g.onRenderCountChange(()=>{let{scrollTopMax:v,scrollLeftMax:L}=g,k=v>0,Y=L>0,V=I.value;(V.vertical!==k||V.horizontal!==Y)&&(I.value={vertical:k,horizontal:Y})})},{immediate:!0}),We(I,g=>{let v=b(),{onScrollbarsChange:L}=l();L&&v.updatedAt&&v.dataArray.length&&L(g),v.notifyScrollbarsChange(g)});let F=null,N=()=>{let g=l(),v=[g.rowHeight,g.rowDetailHeight,g.isRowDetailExpanded,g.isRowDetailEnabled];return(!F||F.deps.some((L,k)=>L!==v[k]))&&(F={deps:v,value:yp({rowHeight:g.rowHeight,rowDetailHeight:g.rowDetailHeight,isRowDetailsExpanded:g.isRowDetailExpanded,isRowDetailsEnabled:g.isRowDetailEnabled,getDataSourceState:b})}),F.value},R=()=>N().computedRowHeight,A=()=>{let g=y.value,v=g.computedPinnedStartWidth??g.computedPinnedStartColumnsWidth,L=g.computedPinnedEndWidth??g.computedPinnedEndColumnsWidth;return{...g,scrollbars:I.value,multiRowSelector:S,multiCellSelector:T,computedRowHeight:R(),computedRowSizeCacheForDetails:N().computedRowSizeCacheForDetails,rowspan:kp(g.computedVisibleColumns,b),computedPinnedStartOverflow:v?g.computedPinnedStartColumnsWidth>v:!1,computedPinnedEndOverflow:L?g.computedPinnedEndColumnsWidth>L:!1,toggleGroupRow:k=>P.toggleGroupRow(k),columnSize:k=>Op(g.computedVisibleColumns)(k)}},M=()=>b().getDataSourceMasterContextRef?.current?.()??void 0,P=_c({getComputed:A,getState:l,getDataSourceState:b,getDataSourceMasterContext:M,actions:a,dataSourceActions:e.dataSourceActions,dataSourceApi:w}),D={getState:l,getDataSourceState:b,getDataSourceMasterContext:M,actions:a,dataSourceActions:e.dataSourceActions,api:P,dataSourceApi:w},E={getComputed:A,getDataSourceMasterContext:M,dataSourceApi:w,api:P,getState:l,actions:a,getDataSourceState:b,dataSourceActions:e.dataSourceActions,cloneTreeSelection:g=>_n(g,b),cloneRowSelection:g=>gn(g,b)},_=l().keyDown.onChange(g=>{Qc(E,g)}),O=l().cellClick.onChange(g=>{if(!g)return;let{event:v,rowIndex:L,colIndex:k}=g,Y=A().computedVisibleColumns[k],V=Je(Y.id,E);v.key="",Oc({...E,rowIndex:L,colIndex:k,column:Y,columnApi:V},v)}),z=l().cellMouseDown.onChange(g=>{if(!g)return;let{event:v,rowIndex:L,colIndex:k}=g,Y=A().computedVisibleColumns[k],V=Je(Y.id,E);Lc({...E,rowIndex:L,colIndex:k,column:Y,columnApi:V},v)}),K=g=>{l().keyDown(g)};l().onRowHeightCSSVarChange.onChange(g=>{g&&(a.rowHeight=g)}),l().onFlashingDurationCSSVarChange.onChange(g=>{let v=g?g*1:null;v!=null&&!isNaN(v)&&(a.flashingDurationCSSVarValue=v)}),l().onRowDetailHeightCSSVarChange.onChange(g=>{g&&(a.rowDetailHeight=g)}),l().onColumnHeaderHeightCSSVarChange.onChange(g=>{g&&(a.columnHeaderHeight=g)});let{MenuPortal:B}=If({context:E,state:r}),{MenuPortal:G}=Nf({context:E,state:r}),{MenuPortal:le}=Of({context:E,state:r}),{MenuPortal:Z}=Pf({context:E,state:r}),De=g=>{let v=l(),L=g.target,k=Ps(L,fa(),v.domRef.current),Y,V,J,ce;k&&(V=Number(k.dataset.colIndex),ce=Number(k.dataset.rowIndex),Y=A().computedVisibleColumns[V].id,J=w.getRowInfoArray()[ce].id);let se={columnId:Y,colIndex:V,rowId:J,rowIndex:ce,event:g,target:k??g.target};k&&v.cellContextMenu(se),v.contextMenu(se)},me=Ra(g=>{a.focused=g}),ve=Ra(g=>{a.focusedWithin=g}),Oe=g=>{let v=l();if(g.target===v.domRef.current||g.target===v.scrollerDOMRef.current){if(v.focused)return;me(!0),v.onSelfFocus?.(g),v.focusedWithin&&(ve(!1),v.onBlurWithin?.(g));return}v.focusedWithin||(ve(!0),v.onFocusWithin?.(g))},Me=g=>{let v=l();if(g.target===v.domRef.current||g.target===v.scrollerDOMRef.current){if(!v.focused)return;me(!1),v.onSelfBlur?.(g),v.focusedWithin&&(ve(!1),v.onBlurWithin?.(g));return}v.domRef.current?.contains(g.relatedTarget)||(ve(!1),v.onBlurWithin?.(g))},Te=10,_e=(g,v)=>{let L=!1,k=null;return We([g,()=>u.value.dataArray.length],([Y],[V]=[void 0,void 0])=>{if(Y!=null&&Y!==V&&(L=!1,k!=null&&cancelAnimationFrame(k)),Y==null||L)return;let J=(ce=0)=>{ce++,k!=null&&cancelAnimationFrame(k),k=requestAnimationFrame(()=>{L=v(Y),!L&&ce<Te&&J(ce)})};J()},{immediate:!0}),()=>{k!=null&&cancelAnimationFrame(k)}},ue=_e(()=>r.value.activeRowIndex,g=>P.scrollRowIntoView(g,{offset:0})),Q=_e(()=>r.value.activeCellIndex,g=>P.scrollCellIntoView(g[0],g[1],{offset:30})),H=()=>vc({getComputed:A,getState:l,getDataSourceState:b,getDataSourceMasterContext:M,actions:a,dataSourceActions:e.dataSourceActions,api:P,dataSourceApi:w},l().editingCell);We([()=>{let g=r.value.editingCell;return g&&!g.active?g.cancelled:void 0},()=>{let g=r.value.editingCell;return g&&!g.active&&g.accepted instanceof Error?g.accepted:void 0},()=>{let g=r.value.editingCell;return!!(g&&!g.active&&!g.cancelled&&g.accepted===!0)},()=>r.value.editingCell?.persisted,()=>r.value.editingCell?.active],([g,v,L,k,Y],[V,J,ce,se,fe])=>{if(g&&g!==V){let ae=l().editingCell,{onEditCancelled:ye}=l();if(ye){let Re=H();Re?ye({...Re,initialValue:ae.initialValue}):To("onEditCancelled",ae)}}if(v&&v!==J){let ae=l().editingCell,{onEditRejected:ye}=l();if(ye){let Re=H();Re?ye({...Re,value:ae.value,error:v,initialValue:ae.initialValue}):To("onEditRejected",ae)}}if(L&&L!==ce){let ae=l().editingCell,{value:ye,initialValue:Re}=ae,{onEditAccepted:re}=l();if(re){let rt=H();rt?re({...rt,value:ye,initialValue:Re}):To("onEditAccepted",ae)}P.persistEdit({value:ye})}if(k&&k!==se){let ae=l().editingCell;if(ae){let ye=k instanceof Error?"onEditPersistError":"onEditPersistSuccess";if(l()[ye]){let Re=H();if(!Re)To(ye,ae);else{let re={...Re,value:ae.value,initialValue:ae.initialValue};k instanceof Error?l().onEditPersistError?.({...re,error:k}):l().onEditPersistSuccess?.(re)}}}}!Y&&fe&&P.focus()}),oT(()=>{let g=r.value,v=u.value,{computedVisibleColumns:L,computedPinnedStartColumns:k,computedPinnedEndColumns:Y}=y.value,V=g.brain;V.updateFixedCells({fixedColsStart:k.length,fixedColsEnd:Y.length});let J=R();V.update({colWidth:Op(L),rowHeight:J,rows:v.dataArray.length,cols:L.length,rowspan:kp(L,d)})}),We(()=>r.value.wrapRowsHorizontally,(g,v)=>{if(v===g)return;let{brain:L,headerBrain:k,renderer:Y,onRenderUpdater:V}=l();L.destroy(),k.destroy(),Y.destroy(),V.destroy();let J=pa(Yd,!!g);a.brain=J.brain,a.headerBrain=J.headerBrain,a.renderer=J.renderer,a.onRenderUpdater=J.onRenderUpdater,a.headerRenderer=J.headerRenderer,a.headerOnRenderUpdater=J.headerOnRenderUpdater},{flush:"post"});let q=null,X=null,ne=()=>{q&&(clearTimeout(q),q=null),X?.(),X=null};We([()=>r.value.brain,()=>r.value.wrapRowsHorizontally,()=>u.value.groupBy,()=>u.value.isTree,()=>r.value.wrapRowsHorizontally?r.value.repeatWrappedGroupRows:!1],([g,v,L,k,Y])=>{ne();let V=e.dataSourceActions;if(!v){d().repeatWrappedGroupRows&&(V.repeatWrappedGroupRows=!1);return}let J=()=>{let{rowsPerPage:ce,repeatWrappedGroupRows:se}=d(),fe=!1,ae=g.rowsPerPage,ye=(L&&L.length>0||k)&&ae>0?ae:null;return ce!=ye&&(V.rowsPerPage=ye,fe=!0),se!=Y&&(V.repeatWrappedGroupRows=Y??!1,fe=!0),fe};J(),X=g.onVerticalRenderRangeChange(()=>{J()&&(q=setTimeout(()=>{a.forceBodyRerenderTimestamp=Date.now()}))})},{immediate:!0,flush:"post"}),Ga(ne),We(()=>r.value.scrollStopDelay,g=>{r.value.brain.setScrollStopDelay(g),e.dataSourceActions.scrollStopDelayUpdatedByTable=g},{immediate:!0}),We(()=>r.value.ready,g=>{typeof globalThis.__DO_NOT_USE_UNLESS_YOU_KNOW_WHAT_YOURE_DOING_IS_READY=="function"&&globalThis.__DO_NOT_USE_UNLESS_YOU_KNOW_WHAT_YOURE_DOING_IS_READY(r.value.id,g,P,{dataSourceApi:e.dataSourceApi});let{onReady:v}=l();v&&v({api:P,dataSourceApi:w})},{immediate:!0,flush:"post"}),We(()=>!!r.value.bodySize.height,g=>{g&&(a.ready=!0)},{immediate:!0});let ie=null,he=null;We(()=>r.value.brain,g=>{ie?.(),ie=g.onVerticalRenderRangeChange(v=>{d().notifyRenderRangeChange({renderStartIndex:v[0],renderEndIndex:v[1]})}),he?.(),he=g.onRenderRangeChange(v=>{l().onRenderRangeChange?.(v)})},{immediate:!0});let ge=1,oe=0,$=null,ee=null;We(()=>r.value.brain,g=>{$?.(),ee?.(),$=g.onRenderCountChange(()=>{oe=g.scrollTopMax}),ee=g.onScrollStop(v=>{let{scrollTop:L,scrollLeft:k}=v,{onScrollToTop:Y,onScrollToBottom:V,onScrollStop:J}=l();L===0&&Y?.();let ce=l().scrollToBottomOffset??ge;if(L+ce>=oe){V?.();let{livePagination:fe,livePaginationCursor:ae,dataArray:ye}=d();fe&&(e.dataSourceActions.cursorId=ae!==void 0?Date.now():ye.length)}if(J){let fe=g.getRenderRange();J({scrollTop:L,scrollLeft:k,renderRange:fe,viewportSize:l().bodySize,firstVisibleRowIndex:fe.start[0],lastVisibleRowIndex:fe.end[0],firstVisibleColIndex:fe.start[1],lastVisibleColIndex:fe.end[1]})}})},{immediate:!0});let Se=null,xe=null,be=g=>{Se=g,r.value.scrollerDOMRef.current=g,xe?.(),xe=null,g&&(a.bodySize={width:g.clientWidth,height:g.clientHeight},xe=Nn(g,v=>{a.bodySize={width:Math.round(v.width),height:Math.round(v.height)}},{debounce:50}))};eT(()=>{Se&&(a.bodySize={width:Se.clientWidth,height:Se.clientHeight})}),Ga(()=>{xe?.(),ie?.(),he?.(),_(),O(),z(),ue(),Q()});let Ee=()=>b().dataArray,ze=()=>y.value.computedColumnOrder,de=[sc,`${mt}--hovered`],tt=Lt(()=>{let g=r.value;return[g.showHoverRows,g.rowHoverClassName]},()=>{let g=r.value;if(!g.showHoverRows)return;let v=[];return g.rowHoverClassName&&(v=v.concat(g.rowHoverClassName)),v=v.concat(de),v.join(" ").split(" ").map(L=>L.trim()).filter(Boolean)},"hoverClassNames"),Ze=Lt(()=>{let g=u.value;return[g.isNodeReadOnly,g.selectionMode,g.cellSelection]},()=>{let g=b();return{isNodeReadOnly:g.isNodeReadOnly,selectionMode:g.selectionMode,cellSelection:g.cellSelection}},"dataSourceStatePartialForCell"),ct=Lt(()=>{let g=r.value,v=u.value;return[y.value,g.rowHeight,g.rowDetailHeight,g.onRowMouseEnter,g.onRowMouseLeave,g.isRowDetailExpanded,g.isRowDetailEnabled,g.groupRenderStrategy,g.wrapRowsHorizontally,g.showZebraRows,g.brain,g.rowStyle,g.rowClassName,g.cellStyle,g.cellClassName,g.repaintCellsKey,g.editingCell,g.updatedAt,v.rowInfoStore,Ze.value]},()=>{let{computedVisibleColumns:g,computedColumnsMap:v,fieldsToColumn:L}=y.value,k=l(),Y=k.showZebraRows,V=b().rowInfoStore,J=Ze.value;return ce=>{let{rowIndex:se,colIndex:fe,domRef:ae,hidden:ye,width:Re,heightWithRowspan:re,onMouseEnter:rt,onMouseLeave:Mt}=ce,Et=Ee()[se],yt=g[fe];if(!Et||!yt)return null;let Ge=!1,Ft=k.isRowDetailEnabled,Nt=k.isRowDetailExpanded;!Ft||typeof Ft=="function"&&!Ft(Et)?Ge=!1:Nt&&(Ge=Nt(Et)?"expanded":"collapsed");let Kn=P.isEditorVisibleForCell({rowIndex:se,columnId:yt.id});return qe(pp,{key:`${se}:${yt.id}`,rowIndex:se,rowHeight:re,width:Re,hidden:ye,domRef:ae,column:yt,columnsMap:v,fieldsToColumn:L,showZebraRows:Y,rowDetailState:Ge,inEditMode:Kn,rowIndexInHorizontalLayoutPage:k.wrapRowsHorizontally?k.brain.getRowIndexInPage(se):null,horizontalLayoutPageIndex:k.wrapRowsHorizontally?k.brain.getPageIndexForRow(se):null,rowStyle:k.rowStyle,rowClassName:k.rowClassName,cellStyle:k.cellStyle,cellClassName:k.cellClassName,repaintCellsKey:yt.repaintCellsKey!==void 0?yt.repaintCellsKey:k.repaintCellsKey,getData:Ee,rowInfoStore:V,renderingContext:D,getComputedVisibleColumns:C,getComputedColumnOrder:ze,dataSourceStatePartial:J,onMouseEnter:rt,onMouseLeave:Mt})}},"body.renderCell"),gt=Lt(()=>{let g=r.value;return[g.isRowDetailExpanded,g.rowDetailRenderer,g.rowDetailCache]},()=>{let g=l(),v=g.isRowDetailExpanded,L=g.rowDetailRenderer;if(!v||!L)return;let k=g.rowDetailCache;return Y=>{let{rowIndex:V,domRef:J}=Y,se=Ee()[V],fe=N().computedRowSizeCacheForDetails;if(!se||!v(se)||!fe)return qe("div",{ref:J,class:Ol.hidden});let{rowDetailHeight:ae,rowHeight:ye}=fe.getSize(V);return qe(Oa,{rowInfo:se,rowDetailsCache:k,rowIndex:V,domRef:J,detailOffset:ye,rowDetailHeight:ae,rowDetailRenderer:L})}});return Np(so,{state:r,getState:l,actions:a,api:P,getComputed:A,getComputedVisibleColumns:C,dataSourceContext:e}),()=>{let g=r.value,v=y.value,L=Gs({computedVisibleColumns:v.computedVisibleColumns,computedPinnedStartColumns:v.computedPinnedStartColumns,computedPinnedEndColumns:v.computedPinnedEndColumns,computedPinnedStartColumnsWidth:v.computedPinnedStartColumnsWidth,computedPinnedEndColumnsWidth:v.computedPinnedEndColumnsWidth,computedUnpinnedColumnsWidth:v.computedUnpinnedColumnsWidth,bodySize:g.bodySize,activeCellIndex:g.activeCellIndex,brain:g.brain,scrollbars:I.value}),k=g.focused,Y=g.focusedWithin,V=v.computedPinnedStartWidth??v.computedPinnedStartColumnsWidth,J=v.computedPinnedEndWidth??v.computedPinnedEndColumnsWidth,ce=V?v.computedPinnedStartColumnsWidth>V:!1,se=J?v.computedPinnedEndColumnsWidth>J:!1,{autoFocus:fe,tabIndex:ae,className:ye,class:Re,style:re,onKeyDown:rt,onKeydown:Mt,...Et}=g.domProps??{},yt=te(t.class,ye,Re,Ne,Ss,g.wrapRowsHorizontally?`${Ne}--horizontal-layout`:null,v.computedPinnedStartColumnsWidth?`${Ne}--has-pinned-start ${vs}`:null,v.computedPinnedEndColumnsWidth?`${Ne}--has-pinned-end ${ws}`:null,k?`${Ne}--focused`:null,Y?`${Ne}--focused-within`:null,k&&g.focusedClassName?g.focusedClassName:null,Y&&g.focusedWithinClassName?g.focusedWithinClassName:null,ce?`${Ne}--has-pinned-start-overflow`:null,se?`${Ne}--has-pinned-end-overflow`:null,Rs({horizontalLayout:!!g.wrapRowsHorizontally,hasPinnedStart:!!v.computedPinnedStartColumnsWidth,hasPinnedEnd:!!v.computedPinnedEndColumnsWidth,focused:k,focusedWithin:Y})),Ge={...t.style,...re,...L};k&&g.focusedStyle&&Object.assign(Ge,g.focusedStyle),Y&&g.focusedWithinStyle&&Object.assign(Ge,g.focusedWithinStyle);let Ft=Mt??rt,Nt=Ft?Gt=>{K(Gt),Ft(Gt)}:K,Kn=u.value.loading;return qe("div",{...t,...Et,ref:Gt=>{g.domRef.current=Gt??null},"data-debug-id":g.debugId,class:yt,style:Ge,onKeydown:Nt,onFocusin:Oe,onFocusout:Me},[g.header?qe(Pp,{wrapRowsHorizontally:!!g.wrapRowsHorizontally,bodyBrain:g.brain,headerBrain:g.headerBrain}):null,qe("div",{class:te(op,wr),onContextmenu:De},[qe(np,{brain:g.brain,renderer:g.renderer,onRenderUpdater:g.onRenderUpdater,renderCell:ct.value,renderDetailRow:gt.value,cellHoverClassNames:tt.value,scrollStopDelay:g.scrollStopDelay,forceRerenderTimestamp:g.forceBodyRerenderTimestamp,scrollerRef:be,tabIndex:ae??0,autoFocus:!!fe,activeRowIndex:g.ready&&g.keyboardNavigation==="row"?g.activeRowIndex??null:null,activeCellIndex:g.ready&&g.keyboardNavigation==="cell"&&!g.columnReorderDragColumnId?g.activeCellIndex??null:null,activeCellRowHeight:N().computedRowSizeCacheForDetails?.getRowHeight||R()}),qe(Ui,{visible:!!Kn},()=>g.loadingText)]),qe("div",{ref:Gt=>{g.portalDOMRef.current=Gt??null},class:te(`${Ne}Portal`,kl[1e7],El.absolute,Fl[0],_l[0])},[qe(B),qe(G),qe(le),qe(Z)]),g.rowHeightCSSVar?qe(So,{key:"row-height",varName:g.rowHeightCSSVar,onChange:g.onRowHeightCSSVarChange}):null,qe(So,{key:"flashing-duration",allowInts:!0,varName:Ie.components.Cell.flashingDuration,onChange:g.onFlashingDurationCSSVarChange}),g.rowDetailHeightCSSVar?qe(So,{key:"row-detail-height",varName:g.rowDetailHeightCSSVar,onChange:g.onRowDetailHeightCSSVarChange}):null,g.columnHeaderHeightCSSVar?qe(So,{key:"column-header-height",varName:g.columnHeaderHeightCSSVar,onChange:g.onColumnHeaderHeightCSSVarChange}):null])}}});import{defineComponent as lT,h as sT,watch as uT}from"vue";var Lp=U(j.currentFlashingDuration),dT=({children:o})=>o,zp=1e3,Vp={up:jo({direction:"up"}).split(" "),down:jo({direction:"down"}).split(" "),neutral:jo({direction:"neutral"}).split(" ")},Gp=(o={})=>{let{flashDuration:t,flashClassName:e,render:n=dT}=o;return lT({name:"FlashingColumnCell",inheritAttrs:!1,setup(i,{attrs:r,slots:a}){let l=vo(),u=He(),d=!0,s=null,c=l.value?.value,f,m,p=()=>{let y=l.value?.htmlElementRef.current;if(f&&(clearTimeout(f),f=void 0),m&&y){let C=Vp[m];y.classList.remove(...e?[e,...C]:C),y.style.removeProperty(Lp),m=void 0}},h=(y,C)=>{let b=l.value?.htmlElementRef.current;if(!b)return;p();let{flashingDurationCSSVarValue:w}=u.getState(),S=typeof w=="number"?w??t??zp:t??zp,T=typeof y=="number"?y>C?"up":"down":"neutral",I=Vp[T];b.style.setProperty(Lp,`${S}`),b.classList.add(...e?[e,...I]:I),m=T,f=setTimeout(p,S)};return uT(()=>{let y=l.value;return y?[y.column.id,y.rowInfo.id,y.value]:null},(y,C)=>{if(!y)return;let[b,w,S]=y,[T,I]=C??[];if(!(b===T&&w===I)){p(),d=!0,s=null,c=S;return}S!==c&&(d=!1,s=c,c=S,h(S,s))},{flush:"post"}),()=>{let y=l.value;return sT("div",{...r,class:te(r.class),ref:y?.domRef},[n({children:a.default?a.default():null,oldValue:d?null:s})])}}})},cT=Gp();import{defineComponent as Bp,h as Hp}from"vue";var Kp=o=>(e,{unfilteredTreePaths:n,treeSelectionState:i,prevTreeSelectionState:r,lastUpdatedNodeInfo:a})=>{let l=new $e(r,{treePaths:n});i.forEachLeafNodePath((s,{selected:c})=>{l.setNodeSelection(s,c)}),a&&i.forEachLeafNodePath(s=>{l.setNodeSelection(s,a.selected)},a.nodePath);let d={defaultSelection:!1,selectedPaths:l.getSelectedLeafNodePaths()};o(d)};var fT=Bp({name:"TreeGrid",props:[...Ka],setup(o,{slots:t}){return()=>Hp(Ba,{...o},t)}}),pT=Bp({name:"TreeDataSource",props:[...ta],setup(o,{slots:t}){return()=>Hp(na,{...o,nodesKey:o.nodesKey??"children"},t)}});var mT={key:"*",when:o=>{let{activeCellIndex:t}=o.getState();if(t){let[e,n]=t,i=o.api.getColumnAtIndex(n);return i?o.api.isCellEditable({rowIndex:e,columnId:i.id}):!1}return!1},handler:(o,t)=>{let{key:e}=t;if(e!="Escape"&&e.length===1){let{activeCellIndex:n}=o.getState();if(n){let[i,r]=n,a=o.api.getColumnAtIndex(r);if(!a)return;requestAnimationFrame(()=>{o.api.startEdit({rowIndex:i,value:e,columnId:a.id})})}}}},hT={instantEdit:mT};var a0={CheckBox:qt,LoadMask:Ui,MenuIcon:ao};export{Ke as CellSelectionState,na as DataSource,po as DataSourceInjectionKeyForVue,W as DeepMap,cT as FlashingColumnCell,pt as GroupRowsState,Ba as InfiniteTable,iT as InfiniteTableClassName,Oa as InfiniteTableDetailRow,so as InfiniteTableInjectionKeyForVue,_t as Menu,Lr as NumberFilterEditor,ut as RowDetailState,Pe as RowSelectionState,uo as StringFilterEditor,pT as TreeDataSource,Qe as TreeExpandState,fT as TreeGrid,$e as TreeSelectionState,a0 as components,Gp as createFlashingColumnCellComponent,Jt as debounce,Lu as defaultFilterFunction,Qn as defaultFilterTypes,Vr as defaultTreeFilterFunction,Km as flatten,dr as group,hT as keyboardShortcuts,kt as multisort,qr as multisortNested,sd as toTreeDataArray,mo as useDataSourceContext,ea as useGetMasterDetailContextForVue,vo as useInfiniteColumnCell,sp as useInfiniteColumnEditor,co as useInfiniteColumnFilterEditor,Xo as useInfiniteHeaderCell,He as useInfiniteTableContext,At as useOverlay,Kp as withSelectedLeafNodesOnly};
28
28
  //!collapsed || lazyLoad;