@platforma-sdk/ui-vue 1.14.20 → 1.14.22

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.
Files changed (36) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/lib.js +5715 -5554
  3. package/dist/lib.umd.cjs +25 -25
  4. package/dist/src/components/PlAgColumnHeader/PlAgColumnHeader.vue.d.ts +9 -0
  5. package/dist/src/components/PlAgColumnHeader/PlAgColumnHeader.vue.d.ts.map +1 -0
  6. package/dist/src/components/PlAgColumnHeader/index.d.ts +3 -0
  7. package/dist/src/components/PlAgColumnHeader/index.d.ts.map +1 -0
  8. package/dist/src/components/PlAgColumnHeader/types.d.ts +5 -0
  9. package/dist/src/components/PlAgColumnHeader/types.d.ts.map +1 -0
  10. package/dist/src/components/PlAgDataTable/PlAgDataTable.vue.d.ts.map +1 -1
  11. package/dist/src/components/PlAgDataTable/index.d.ts +1 -0
  12. package/dist/src/components/PlAgDataTable/index.d.ts.map +1 -1
  13. package/dist/src/components/PlAgDataTable/sources/row-number.d.ts +5 -0
  14. package/dist/src/components/PlAgDataTable/sources/row-number.d.ts.map +1 -0
  15. package/dist/src/components/PlAgDataTable/sources/table-source.d.ts +0 -5
  16. package/dist/src/components/PlAgDataTable/sources/table-source.d.ts.map +1 -1
  17. package/dist/src/components/PlAgDataTable/types.d.ts +6 -0
  18. package/dist/src/components/PlAgDataTable/types.d.ts.map +1 -1
  19. package/dist/src/components/PlAgGridColumnManager/PlAgGridColumnManager.vue.d.ts.map +1 -1
  20. package/dist/src/lib.d.ts +1 -0
  21. package/dist/src/lib.d.ts.map +1 -1
  22. package/dist/style.css +1 -1
  23. package/dist/tsconfig.lib.tsbuildinfo +1 -1
  24. package/package.json +1 -1
  25. package/src/components/PlAgColumnHeader/PlAgColumnHeader.vue +71 -0
  26. package/src/components/PlAgColumnHeader/index.ts +3 -0
  27. package/src/components/PlAgColumnHeader/pl-ag-column-header.scss +29 -0
  28. package/src/components/PlAgColumnHeader/types.ts +3 -0
  29. package/src/components/PlAgDataTable/PlAgDataTable.vue +12 -7
  30. package/src/components/PlAgDataTable/index.ts +2 -0
  31. package/src/components/PlAgDataTable/sources/row-number.ts +91 -0
  32. package/src/components/PlAgDataTable/sources/table-source.ts +26 -10
  33. package/src/components/PlAgDataTable/types.ts +7 -0
  34. package/src/components/PlAgGridColumnManager/PlAgGridColumnManager.vue +16 -5
  35. package/src/components/PlAgGridColumnManager/pl-ag-grid-column-manager.scss +12 -1
  36. package/src/lib.ts +2 -0
package/dist/lib.umd.cjs CHANGED
@@ -1,56 +1,56 @@
1
- (function(L,r){typeof exports=="object"&&typeof module<"u"?r(exports,require("vue"),require("@ag-grid-enterprise/core"),require("@ag-grid-community/core"),require("@ag-grid-community/client-side-row-model"),require("@ag-grid-community/infinite-row-model"),require("@ag-grid-enterprise/server-side-row-model"),require("@ag-grid-community/csv-export"),require("@ag-grid-enterprise/clipboard"),require("@ag-grid-enterprise/range-selection"),require("@ag-grid-enterprise/rich-select"),require("@ag-grid-enterprise/menu"),require("@ag-grid-enterprise/excel-export"),require("@ag-grid-community/theming"),require("@ag-grid-community/vue3")):typeof define=="function"&&define.amd?define(["exports","vue","@ag-grid-enterprise/core","@ag-grid-community/core","@ag-grid-community/client-side-row-model","@ag-grid-community/infinite-row-model","@ag-grid-enterprise/server-side-row-model","@ag-grid-community/csv-export","@ag-grid-enterprise/clipboard","@ag-grid-enterprise/range-selection","@ag-grid-enterprise/rich-select","@ag-grid-enterprise/menu","@ag-grid-enterprise/excel-export","@ag-grid-community/theming","@ag-grid-community/vue3"],r):(L=typeof globalThis<"u"?globalThis:L||self,r(L.SdkVueLib={},L.Vue,L.core$1,L.core,L.clientSideRowModel,L.infiniteRowModel,L.serverSideRowModel,L.csvExport,L.clipboard,L.rangeSelection,L.richSelect,L.menu,L.excelExport,L.theming,L.vue3))})(this,function(L,r,Me,T,us,Sg,Wd,Tg,jd,Hd,Ng,Vg,Ag,qd,Bg){"use strict";var MM=Object.defineProperty;var xg=L=>{throw TypeError(L)};var GM=(L,r,Me)=>r in L?MM(L,r,{enumerable:!0,configurable:!0,writable:!0,value:Me}):L[r]=Me;var We=(L,r,Me)=>GM(L,typeof r!="symbol"?r+"":r,Me),Gd=(L,r,Me)=>r.has(L)||xg("Cannot "+Me);var E=(L,r,Me)=>(Gd(L,r,"read from private field"),Me?Me.call(L):r.get(L)),Ue=(L,r,Me)=>r.has(L)?xg("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(L):r.set(L,Me),ye=(L,r,Me,T)=>(Gd(L,r,"write to private field"),T?T.call(L,Me):r.set(L,Me),Me),ue=(L,r,Me)=>(Gd(L,r,"access private method"),Me);var Wa=(L,r,Me,T)=>({set _(us){ye(L,r,us,Me)},get _(){return E(L,r,T)}});var zh,Ao,Uh,Zh,Cn,jt,wn,bn,Bo,Po,ut,xn,dt,Je,Se,Pt,Ht,Et,mt,kn,gt,En,Sn,qt,Tn,Nr,Rt,re,$d,Xr,Jn,Gi,Kt,Eg,Jr,Ro,$i,Or,Mr,zd,ja,Ha,et,Ud,ds,Gr,Zd;function Pg(t,e){if(t==null)throw Error(e??"Empty (null | undefined) value");return t}function Rg(t,e){return t=Math.ceil(t),e=Math.floor(e),Math.floor(Math.random()*(e-t))+t}function Dg(t){let e="";for(let n=0;n<t;n++)e+=String.fromCharCode(Rg(65,91));return e}function Ig(){return Dg(42)}const Kd=Array.isArray;function Fg(t){return t!==null&&typeof t=="object"}function Yd(t){if(typeof t!="object"||t===null)return!1;const e=Object.getPrototypeOf(t);return e===null||e===Object.prototype||Object.getPrototypeOf(e)===null}function Dn(t){if(Array.isArray(t)){const e=[];for(let n=0;n<t.length;n++)e[n]=Dn(t[n]);return e}else if(Fg(t)){const e={};return Object.keys(t).forEach(n=>{e[n]=Dn(t[n])}),e}else return t}function Xd(t,e){return new Set([...Object.keys(t),...Object.keys(e)]).forEach(n=>{const o=t[n],i=e[n];Yd(o)&&Yd(i)||Kd(o)&&Kd(i)&&o.length===i.length?Xd(o,i):t[n]=i}),t}function qa(t,e,n=!0){let o=0,i;return function(...l){i=()=>{t.apply(this,l),o=new Date().getTime()+e,i=null,n&&setTimeout(()=>{i&&i()},e)},new Date().getTime()>o&&i()}}function Lg(t){let e=0n,n;return async function(...o){const i=++e;try{await n}catch{}if(e!==i)return{ok:!1};const l=t(...o);return n=l,{ok:!0,value:await l}}}var Ko=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Jd(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Og=function t(e){if(typeof e=="number"&&isNaN(e))throw new Error("NaN is not allowed");if(typeof e=="number"&&!isFinite(e))throw new Error("Infinity is not allowed");return e===null||typeof e!="object"?JSON.stringify(e):e.toJSON instanceof Function?t(e.toJSON()):Array.isArray(e)?`[${e.reduce((i,l,c)=>`${i}${c===0?"":","}${t(l===void 0||typeof l=="symbol"?null:l)}`,"")}]`:`{${Object.keys(e).sort().reduce((o,i)=>{if(e[i]===void 0||typeof e[i]=="symbol")return o;const l=o.length===0?"":",";return`${o}${l}${t(i)}:${t(e[i])}`},"")}}`};const $r=Jd(Og);class Ka extends Error{}class Ya extends Error{constructor(e){super(e.join(`
1
+ (function(L,r){typeof exports=="object"&&typeof module<"u"?r(exports,require("vue"),require("@ag-grid-enterprise/core"),require("@ag-grid-community/core"),require("@ag-grid-community/client-side-row-model"),require("@ag-grid-community/infinite-row-model"),require("@ag-grid-enterprise/server-side-row-model"),require("@ag-grid-community/csv-export"),require("@ag-grid-enterprise/clipboard"),require("@ag-grid-enterprise/range-selection"),require("@ag-grid-enterprise/rich-select"),require("@ag-grid-enterprise/menu"),require("@ag-grid-enterprise/excel-export"),require("@ag-grid-community/theming"),require("@ag-grid-community/vue3")):typeof define=="function"&&define.amd?define(["exports","vue","@ag-grid-enterprise/core","@ag-grid-community/core","@ag-grid-community/client-side-row-model","@ag-grid-community/infinite-row-model","@ag-grid-enterprise/server-side-row-model","@ag-grid-community/csv-export","@ag-grid-enterprise/clipboard","@ag-grid-enterprise/range-selection","@ag-grid-enterprise/rich-select","@ag-grid-enterprise/menu","@ag-grid-enterprise/excel-export","@ag-grid-community/theming","@ag-grid-community/vue3"],r):(L=typeof globalThis<"u"?globalThis:L||self,r(L.SdkVueLib={},L.Vue,L.core$1,L.core,L.clientSideRowModel,L.infiniteRowModel,L.serverSideRowModel,L.csvExport,L.clipboard,L.rangeSelection,L.richSelect,L.menu,L.excelExport,L.theming,L.vue3))})(this,function(L,r,Me,T,ps,Vg,jd,Ag,Hd,qd,Bg,Pg,Rg,Kd,Dg){"use strict";var HM=Object.defineProperty;var Sg=L=>{throw TypeError(L)};var qM=(L,r,Me)=>r in L?HM(L,r,{enumerable:!0,configurable:!0,writable:!0,value:Me}):L[r]=Me;var We=(L,r,Me)=>qM(L,typeof r!="symbol"?r+"":r,Me),$d=(L,r,Me)=>r.has(L)||Sg("Cannot "+Me);var E=(L,r,Me)=>($d(L,r,"read from private field"),Me?Me.call(L):r.get(L)),Ue=(L,r,Me)=>r.has(L)?Sg("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(L):r.set(L,Me),ye=(L,r,Me,T)=>($d(L,r,"write to private field"),T?T.call(L,Me):r.set(L,Me),Me),ue=(L,r,Me)=>($d(L,r,"access private method"),Me);var ja=(L,r,Me,T)=>({set _(ps){ye(L,r,ps,Me)},get _(){return E(L,r,T)}});var Wh,Bo,jh,Hh,vn,Ht,wn,bn,Po,Ro,ut,xn,dt,Je,Se,Rt,qt,Et,mt,kn,gt,En,Sn,Kt,Tn,Nr,Dt,re,zd,Jr,Jn,$i,Yt,Ng,Qr,Do,zi,Or,Mr,Ud,Ha,qa,et,Zd,us,Gr,Wd;function Ig(t,e){if(t==null)throw Error(e??"Empty (null | undefined) value");return t}function Fg(t,e){return t=Math.ceil(t),e=Math.floor(e),Math.floor(Math.random()*(e-t))+t}function Lg(t){let e="";for(let n=0;n<t;n++)e+=String.fromCharCode(Fg(65,91));return e}function Og(){return Lg(42)}const Yd=Array.isArray;function Mg(t){return t!==null&&typeof t=="object"}function Xd(t){if(typeof t!="object"||t===null)return!1;const e=Object.getPrototypeOf(t);return e===null||e===Object.prototype||Object.getPrototypeOf(e)===null}function Dn(t){if(Array.isArray(t)){const e=[];for(let n=0;n<t.length;n++)e[n]=Dn(t[n]);return e}else if(Mg(t)){const e={};return Object.keys(t).forEach(n=>{e[n]=Dn(t[n])}),e}else return t}function Jd(t,e){return new Set([...Object.keys(t),...Object.keys(e)]).forEach(n=>{const o=t[n],i=e[n];Xd(o)&&Xd(i)||Yd(o)&&Yd(i)&&o.length===i.length?Jd(o,i):t[n]=i}),t}function Ka(t,e,n=!0){let o=0,i;return function(...l){i=()=>{t.apply(this,l),o=new Date().getTime()+e,i=null,n&&setTimeout(()=>{i&&i()},e)},new Date().getTime()>o&&i()}}function Gg(t){let e=0n,n;return async function(...o){const i=++e;try{await n}catch{}if(e!==i)return{ok:!1};const l=t(...o);return n=l,{ok:!0,value:await l}}}var Yo=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Qd(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var $g=function t(e){if(typeof e=="number"&&isNaN(e))throw new Error("NaN is not allowed");if(typeof e=="number"&&!isFinite(e))throw new Error("Infinity is not allowed");return e===null||typeof e!="object"?JSON.stringify(e):e.toJSON instanceof Function?t(e.toJSON()):Array.isArray(e)?`[${e.reduce((i,l,c)=>`${i}${c===0?"":","}${t(l===void 0||typeof l=="symbol"?null:l)}`,"")}]`:`{${Object.keys(e).sort().reduce((o,i)=>{if(e[i]===void 0||typeof e[i]=="symbol")return o;const l=o.length===0?"":",";return`${o}${l}${t(i)}:${t(e[i])}`},"")}}`};const $r=Qd($g);class Ya extends Error{}class Xa extends Error{constructor(e){super(e.join(`
2
2
  `)),this.errors=e}toString(){return this.errors.join(`
3
- `)}}function Mg(t){return{ok:!0,value:t}}function Qd(t){if(!t)throw new Ka;if(!t.ok)throw Error(t.errors.join(";"));return t.value}function eu(t){return{value:t,errors:void 0}}function Gg(t){if(t.errors)throw new Ya(t.errors);if(!t.value)throw new Ka;return t.value}function $g(t){return t!==void 0}function Xa(t,e){return $r(t)===$r(e)}const Ja=t=>t,Qa=t=>t instanceof Error?t:Error(String(t)),el=t=>t.name==="ZodError",tl=t=>{const{formErrors:e,fieldErrors:n}=t.flatten(),o=Object.entries(n).map(([i,l])=>i+":"+(l==null?void 0:l.join(",")));return e.concat(o).join("; ")};function nl(t){const e=t.validate??Ja,{autoSave:n}=t,o=r.ref(),i=r.ref(),l=S=>{i.value={model:Dn(S)}};r.watch(()=>t.get(),S=>l(S),{immediate:!0});const c=()=>{var S;t.onSave(e(Dn((S=i.value)==null?void 0:S.model)))},d=()=>{l(t.get()),o.value=void 0},p=S=>{const M=Qa(S);el(M)?o.value=Error(tl(M)):o.value=M},h=S=>{o.value=void 0;try{e(S),n&&c()}catch(M){p(M)}},m=r.computed({get:()=>{var S;return(S=i.value)==null?void 0:S.model},set(S){l(S),h(S)}});r.watch(i,(S,M)=>{S&&S===M&&h(S.model)},{deep:!0});const y=r.computed(()=>!o.value),b=r.computed(()=>!Xa(t.get(),r.unref(i))),w=r.computed(()=>o.value?o.value.message:"");return r.reactive({model:m,valid:y,isChanged:b,error:o,errorString:w,save:c,revert:d,setError:p})}function zg(t,e,n){const o=t.validate??Ja,{autoSave:i}=t,l=r.ref(),c=r.ref(),d=O=>{var C;if(n.deepPatchModel){const I=(C=c.value)==null?void 0:C.model,F=Object.assign(Dn(O),e??{});c.value={model:I?Xd(I,F):F,stage:Symbol()}}else c.value={model:Object.assign(Dn(O),e??{}),stage:Symbol()}};r.watch(()=>t.get(),O=>d(O),{immediate:!0});const p=()=>{var O;t.onSave(o(Dn((O=c.value)==null?void 0:O.model)))},h=()=>{d(t.get()),l.value=void 0},m=O=>{const C=Qa(O);el(C)?l.value=Error(tl(C)):l.value=C},y=O=>{l.value=void 0;try{o(O),i&&p()}catch(C){m(C)}},b=r.computed({get:()=>{var O;return(O=c.value)==null?void 0:O.model},set(){throw Error("Cannot replace base model")}});r.watch([()=>({args:b.value.args,ui:b.value.ui}),()=>{var O;return(O=c.value)==null?void 0:O.stage}],([O,C],[I,F])=>{C===F&&y(O)},{deep:!0});const w=r.computed(()=>!l.value),S=r.computed(()=>{var I;const{args:O,ui:C}=((I=r.unref(c))==null?void 0:I.model)??{};return!Xa(t.get(),{args:O,ui:C})}),M=r.computed(()=>l.value?l.value.message:"");return r.reactive({model:b,valid:w,isChanged:S,error:l,errorString:M,save:p,revert:h,setError:m})}const Ug=t=>Object.fromEntries(new URL(t,"http://dummy").searchParams);function Zg(t,e,n){const o=(C,...I)=>{n.debug&&console.log(`%c>>> %c${C}`,"color: orange; font-weight: bold","color: orange",...I)},l=qa(e.setBlockArgs,100),c=qa(e.setBlockUiState,100),d=qa(e.setBlockArgsAndUiState,100),p=r.reactive({args:Object.freeze(t.args),outputs:Object.freeze(t.outputs),ui:Object.freeze(t.ui),navigationState:Object.freeze(t.navigationState)});e.onStateUpdates(async C=>{C.forEach(I=>{I.key==="args"&&(p.args=Object.freeze(I.value),o("args patch",p.args)),I.key==="ui"&&(p.ui=Object.freeze(I.value),o("ui patch",p.ui)),I.key==="outputs"&&(p.outputs=Object.freeze(I.value),o("outputs patch",p.outputs)),I.key==="navigationState"&&(p.navigationState=Object.freeze(I.value),o("navigationState patch",p.navigationState))}),await r.nextTick()});const h=()=>Dn(p.args),m=()=>Dn(p.ui),y=()=>Dn(p.navigationState),b={createArgsModel(C={}){return nl({get(){return C.transform?C.transform(p.args):p.args},validate:C.validate,autoSave:!0,onSave(I){l(I)}})},createUiModel(C={},I){return nl({get(){return C.transform?C.transform(p.ui):p.ui??I()},validate:C.validate,autoSave:!0,onSave(F){c(F)}})},useOutputs(...C){const I=r.reactive({errors:void 0,value:void 0});return r.watch(()=>p.outputs,()=>{try{Object.assign(I,{value:this.unwrapOutputs(...C),errors:void 0})}catch(F){Object.assign(I,{value:void 0,errors:[String(F)]})}},{immediate:!0,deep:!0}),I},unwrapOutputs(...C){const I=p.outputs,F=C.map(W=>[W,Qd(I[W])]);return Object.fromEntries(F)},getOutputField(C){return p.outputs[C]},getOutputFieldOkOptional(C){console.warn("use reactive app.outputValues.fieldName instead instead of getOutputFieldOkOptional(fieldName)");const I=this.getOutputField(C);if(I&&I.ok)return I.value},getOutputFieldErrorsOptional(C){console.warn("use reactive app.outputErrors.fieldName instead instead of getOutputFieldErrorsOptional(fieldName)");const I=this.getOutputField(C);if(I&&!I.ok)return I.errors},updateArgs(C){const I=h();return C(I),e.setBlockArgs(I)},updateUiState(C){const I=m();return e.setBlockUiState(C(I))},updateNavigationState(C){const I=y();return C(I),e.setNavigationState(I)},navigateTo(C){const I=y();return I.href=C,e.setNavigationState(I)}},w=r.computed(()=>{const C=Object.entries(p.outputs).map(([I,F])=>[I,F.ok&&F.value!==void 0?F.value:void 0]);return Object.fromEntries(C)}),S=r.computed(()=>{const C=Object.entries(p.outputs).map(([I,F])=>[I,F&&!F.ok?new Ya(F.errors):void 0]);return Object.fromEntries(C)}),M={snapshot:p,queryParams:r.computed(()=>Ug(p.navigationState.href)),href:r.computed(()=>p.navigationState.href),hasErrors:r.computed(()=>Object.values(p.outputs).some(C=>!(C!=null&&C.ok))),outputValues:r.computed(()=>(console.warn("Change app.outputValues to app.model.outputs"),w.value)),outputErrors:r.computed(()=>(console.warn("Change app.outputErrors to app.model.outputErrors"),S.value)),args:r.computed(()=>(console.warn("Change app.args to app.snapshot.args"),p.args)),outputs:r.computed(()=>(console.warn("Change app.outputs to app.snapshot.outputs"),p.outputs)),ui:r.computed(()=>(console.warn("Change app.ui to app.snapshot.ui"),p.ui)),navigationState:r.computed(()=>(console.warn("Change app.navigationState to app.snapshot.navigationState"),p.navigationState))},O=zg({get(){return{args:p.args,ui:p.ui}},autoSave:!0,onSave(C){d(C.args,C.ui)}},{outputs:w,outputErrors:S},n);return r.reactive(Object.assign(O,b,M))}var Ge;(function(t){t.assertEqual=i=>i;function e(i){}t.assertIs=e;function n(i){throw new Error}t.assertNever=n,t.arrayToEnum=i=>{const l={};for(const c of i)l[c]=c;return l},t.getValidEnumValues=i=>{const l=t.objectKeys(i).filter(d=>typeof i[i[d]]!="number"),c={};for(const d of l)c[d]=i[d];return t.objectValues(c)},t.objectValues=i=>t.objectKeys(i).map(function(l){return i[l]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const l=[];for(const c in i)Object.prototype.hasOwnProperty.call(i,c)&&l.push(c);return l},t.find=(i,l)=>{for(const c of i)if(l(c))return c},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function o(i,l=" | "){return i.map(c=>typeof c=="string"?`'${c}'`:c).join(l)}t.joinValues=o,t.jsonStringifyReplacer=(i,l)=>typeof l=="bigint"?l.toString():l})(Ge||(Ge={}));var rl;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(rl||(rl={}));const le=Ge.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),cr=t=>{switch(typeof t){case"undefined":return le.undefined;case"string":return le.string;case"number":return isNaN(t)?le.nan:le.number;case"boolean":return le.boolean;case"function":return le.function;case"bigint":return le.bigint;case"symbol":return le.symbol;case"object":return Array.isArray(t)?le.array:t===null?le.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?le.promise:typeof Map<"u"&&t instanceof Map?le.map:typeof Set<"u"&&t instanceof Set?le.set:typeof Date<"u"&&t instanceof Date?le.date:le.object;default:return le.unknown}},ee=Ge.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),Wg=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:");class Zt extends Error{constructor(e){super(),this.issues=[],this.addIssue=o=>{this.issues=[...this.issues,o]},this.addIssues=(o=[])=>{this.issues=[...this.issues,...o]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const n=e||function(l){return l.message},o={_errors:[]},i=l=>{for(const c of l.issues)if(c.code==="invalid_union")c.unionErrors.map(i);else if(c.code==="invalid_return_type")i(c.returnTypeError);else if(c.code==="invalid_arguments")i(c.argumentsError);else if(c.path.length===0)o._errors.push(n(c));else{let d=o,p=0;for(;p<c.path.length;){const h=c.path[p];p===c.path.length-1?(d[h]=d[h]||{_errors:[]},d[h]._errors.push(n(c))):d[h]=d[h]||{_errors:[]},d=d[h],p++}}};return i(this),o}static assert(e){if(!(e instanceof Zt))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Ge.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){const n={},o=[];for(const i of this.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(e(i))):o.push(e(i));return{formErrors:o,fieldErrors:n}}get formErrors(){return this.flatten()}}Zt.create=t=>new Zt(t);const co=(t,e)=>{let n;switch(t.code){case ee.invalid_type:t.received===le.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case ee.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,Ge.jsonStringifyReplacer)}`;break;case ee.unrecognized_keys:n=`Unrecognized key(s) in object: ${Ge.joinValues(t.keys,", ")}`;break;case ee.invalid_union:n="Invalid input";break;case ee.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Ge.joinValues(t.options)}`;break;case ee.invalid_enum_value:n=`Invalid enum value. Expected ${Ge.joinValues(t.options)}, received '${t.received}'`;break;case ee.invalid_arguments:n="Invalid function arguments";break;case ee.invalid_return_type:n="Invalid function return type";break;case ee.invalid_date:n="Invalid date";break;case ee.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:Ge.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case ee.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case ee.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case ee.custom:n="Invalid input";break;case ee.invalid_intersection_types:n="Intersection results could not be merged";break;case ee.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case ee.not_finite:n="Number must be finite";break;default:n=e.defaultError,Ge.assertNever(t)}return{message:n}};let tu=co;function jg(t){tu=t}function ps(){return tu}const hs=t=>{const{data:e,path:n,errorMaps:o,issueData:i}=t,l=[...n,...i.path||[]],c={...i,path:l};if(i.message!==void 0)return{...i,path:l,message:i.message};let d="";const p=o.filter(h=>!!h).slice().reverse();for(const h of p)d=h(c,{data:e,defaultError:d}).message;return{...i,path:l,message:d}},Hg=[];function ie(t,e){const n=ps(),o=hs({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===co?void 0:co].filter(i=>!!i)});t.common.issues.push(o)}class bt{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){const o=[];for(const i of n){if(i.status==="aborted")return be;i.status==="dirty"&&e.dirty(),o.push(i.value)}return{status:e.value,value:o}}static async mergeObjectAsync(e,n){const o=[];for(const i of n){const l=await i.key,c=await i.value;o.push({key:l,value:c})}return bt.mergeObjectSync(e,o)}static mergeObjectSync(e,n){const o={};for(const i of n){const{key:l,value:c}=i;if(l.status==="aborted"||c.status==="aborted")return be;l.status==="dirty"&&e.dirty(),c.status==="dirty"&&e.dirty(),l.value!=="__proto__"&&(typeof c.value<"u"||i.alwaysSet)&&(o[l.value]=c.value)}return{status:e.value,value:o}}}const be=Object.freeze({status:"aborted"}),uo=t=>({status:"dirty",value:t}),Nt=t=>({status:"valid",value:t}),ol=t=>t.status==="aborted",il=t=>t.status==="dirty",Yo=t=>t.status==="valid",Xo=t=>typeof Promise<"u"&&t instanceof Promise;function fs(t,e,n,o){if(typeof e=="function"?t!==e||!o:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e.get(t)}function nu(t,e,n,o,i){if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return e.set(t,n),n}typeof SuppressedError=="function"&&SuppressedError;var fe;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(fe||(fe={}));var Jo,Qo;class In{constructor(e,n,o,i){this._cachedPath=[],this.parent=e,this.data=n,this._path=o,this._key=i}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const ru=(t,e)=>{if(Yo(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new Zt(t.common.issues);return this._error=n,this._error}}};function Ve(t){if(!t)return{};const{errorMap:e,invalid_type_error:n,required_error:o,description:i}=t;if(e&&(n||o))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:(c,d)=>{var p,h;const{message:m}=t;return c.code==="invalid_enum_value"?{message:m??d.defaultError}:typeof d.data>"u"?{message:(p=m??o)!==null&&p!==void 0?p:d.defaultError}:c.code!=="invalid_type"?{message:d.defaultError}:{message:(h=m??n)!==null&&h!==void 0?h:d.defaultError}},description:i}}class Pe{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return cr(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:cr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new bt,ctx:{common:e.parent.common,data:e.data,parsedType:cr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const n=this._parse(e);if(Xo(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){const n=this._parse(e);return Promise.resolve(n)}parse(e,n){const o=this.safeParse(e,n);if(o.success)return o.data;throw o.error}safeParse(e,n){var o;const i={common:{issues:[],async:(o=n==null?void 0:n.async)!==null&&o!==void 0?o:!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:cr(e)},l=this._parseSync({data:e,path:i.path,parent:i});return ru(i,l)}async parseAsync(e,n){const o=await this.safeParseAsync(e,n);if(o.success)return o.data;throw o.error}async safeParseAsync(e,n){const o={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:cr(e)},i=this._parse({data:e,path:o.path,parent:o}),l=await(Xo(i)?i:Promise.resolve(i));return ru(o,l)}refine(e,n){const o=i=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(i):n;return this._refinement((i,l)=>{const c=e(i),d=()=>l.addIssue({code:ee.custom,...o(i)});return typeof Promise<"u"&&c instanceof Promise?c.then(p=>p?!0:(d(),!1)):c?!0:(d(),!1)})}refinement(e,n){return this._refinement((o,i)=>e(o)?!0:(i.addIssue(typeof n=="function"?n(o,i):n),!1))}_refinement(e){return new fn({schema:this,typeName:Ce.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return Ln.create(this,this._def)}nullable(){return hr.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return hn.create(this,this._def)}promise(){return mo.create(this,this._def)}or(e){return ri.create([this,e],this._def)}and(e){return oi.create(this,e,this._def)}transform(e){return new fn({...Ve(this._def),schema:this,typeName:Ce.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new ci({...Ve(this._def),innerType:this,defaultValue:n,typeName:Ce.ZodDefault})}brand(){return new ll({typeName:Ce.ZodBranded,type:this,...Ve(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new di({...Ve(this._def),innerType:this,catchValue:n,typeName:Ce.ZodCatch})}describe(e){const n=this.constructor;return new n({...this._def,description:e})}pipe(e){return ui.create(this,e)}readonly(){return pi.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const qg=/^c[^\s-]{8,}$/i,Kg=/^[0-9a-z]+$/,Yg=/^[0-9A-HJKMNP-TV-Z]{26}$/,Xg=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Jg=/^[a-z0-9_-]{21}$/i,Qg=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,ey=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,ty="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let sl;const ny=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ry=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,oy=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,ou="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",iy=new RegExp(`^${ou}$`);function iu(t){let e="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`),e}function sy(t){return new RegExp(`^${iu(t)}$`)}function su(t){let e=`${ou}T${iu(t)}`;const n=[];return n.push(t.local?"Z?":"Z"),t.offset&&n.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${n.join("|")})`,new RegExp(`^${e}$`)}function ay(t,e){return!!((e==="v4"||!e)&&ny.test(t)||(e==="v6"||!e)&&ry.test(t))}class pn extends Pe{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==le.string){const l=this._getOrReturnCtx(e);return ie(l,{code:ee.invalid_type,expected:le.string,received:l.parsedType}),be}const o=new bt;let i;for(const l of this._def.checks)if(l.kind==="min")e.data.length<l.value&&(i=this._getOrReturnCtx(e,i),ie(i,{code:ee.too_small,minimum:l.value,type:"string",inclusive:!0,exact:!1,message:l.message}),o.dirty());else if(l.kind==="max")e.data.length>l.value&&(i=this._getOrReturnCtx(e,i),ie(i,{code:ee.too_big,maximum:l.value,type:"string",inclusive:!0,exact:!1,message:l.message}),o.dirty());else if(l.kind==="length"){const c=e.data.length>l.value,d=e.data.length<l.value;(c||d)&&(i=this._getOrReturnCtx(e,i),c?ie(i,{code:ee.too_big,maximum:l.value,type:"string",inclusive:!0,exact:!0,message:l.message}):d&&ie(i,{code:ee.too_small,minimum:l.value,type:"string",inclusive:!0,exact:!0,message:l.message}),o.dirty())}else if(l.kind==="email")ey.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"email",code:ee.invalid_string,message:l.message}),o.dirty());else if(l.kind==="emoji")sl||(sl=new RegExp(ty,"u")),sl.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"emoji",code:ee.invalid_string,message:l.message}),o.dirty());else if(l.kind==="uuid")Xg.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"uuid",code:ee.invalid_string,message:l.message}),o.dirty());else if(l.kind==="nanoid")Jg.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"nanoid",code:ee.invalid_string,message:l.message}),o.dirty());else if(l.kind==="cuid")qg.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"cuid",code:ee.invalid_string,message:l.message}),o.dirty());else if(l.kind==="cuid2")Kg.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"cuid2",code:ee.invalid_string,message:l.message}),o.dirty());else if(l.kind==="ulid")Yg.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"ulid",code:ee.invalid_string,message:l.message}),o.dirty());else if(l.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),ie(i,{validation:"url",code:ee.invalid_string,message:l.message}),o.dirty()}else l.kind==="regex"?(l.regex.lastIndex=0,l.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"regex",code:ee.invalid_string,message:l.message}),o.dirty())):l.kind==="trim"?e.data=e.data.trim():l.kind==="includes"?e.data.includes(l.value,l.position)||(i=this._getOrReturnCtx(e,i),ie(i,{code:ee.invalid_string,validation:{includes:l.value,position:l.position},message:l.message}),o.dirty()):l.kind==="toLowerCase"?e.data=e.data.toLowerCase():l.kind==="toUpperCase"?e.data=e.data.toUpperCase():l.kind==="startsWith"?e.data.startsWith(l.value)||(i=this._getOrReturnCtx(e,i),ie(i,{code:ee.invalid_string,validation:{startsWith:l.value},message:l.message}),o.dirty()):l.kind==="endsWith"?e.data.endsWith(l.value)||(i=this._getOrReturnCtx(e,i),ie(i,{code:ee.invalid_string,validation:{endsWith:l.value},message:l.message}),o.dirty()):l.kind==="datetime"?su(l).test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{code:ee.invalid_string,validation:"datetime",message:l.message}),o.dirty()):l.kind==="date"?iy.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{code:ee.invalid_string,validation:"date",message:l.message}),o.dirty()):l.kind==="time"?sy(l).test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{code:ee.invalid_string,validation:"time",message:l.message}),o.dirty()):l.kind==="duration"?Qg.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"duration",code:ee.invalid_string,message:l.message}),o.dirty()):l.kind==="ip"?ay(e.data,l.version)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"ip",code:ee.invalid_string,message:l.message}),o.dirty()):l.kind==="base64"?oy.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"base64",code:ee.invalid_string,message:l.message}),o.dirty()):Ge.assertNever(l);return{status:o.value,value:e.data}}_regex(e,n,o){return this.refinement(i=>e.test(i),{validation:n,code:ee.invalid_string,...fe.errToObj(o)})}_addCheck(e){return new pn({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...fe.errToObj(e)})}url(e){return this._addCheck({kind:"url",...fe.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...fe.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...fe.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...fe.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...fe.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...fe.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...fe.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...fe.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...fe.errToObj(e)})}datetime(e){var n,o;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(n=e==null?void 0:e.offset)!==null&&n!==void 0?n:!1,local:(o=e==null?void 0:e.local)!==null&&o!==void 0?o:!1,...fe.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...fe.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...fe.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...fe.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n==null?void 0:n.position,...fe.errToObj(n==null?void 0:n.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...fe.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...fe.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...fe.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...fe.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...fe.errToObj(n)})}nonempty(e){return this.min(1,fe.errToObj(e))}trim(){return new pn({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new pn({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new pn({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get minLength(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}pn.create=t=>{var e;return new pn({checks:[],typeName:Ce.ZodString,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...Ve(t)})};function ly(t,e){const n=(t.toString().split(".")[1]||"").length,o=(e.toString().split(".")[1]||"").length,i=n>o?n:o,l=parseInt(t.toFixed(i).replace(".","")),c=parseInt(e.toFixed(i).replace(".",""));return l%c/Math.pow(10,i)}class dr extends Pe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==le.number){const l=this._getOrReturnCtx(e);return ie(l,{code:ee.invalid_type,expected:le.number,received:l.parsedType}),be}let o;const i=new bt;for(const l of this._def.checks)l.kind==="int"?Ge.isInteger(e.data)||(o=this._getOrReturnCtx(e,o),ie(o,{code:ee.invalid_type,expected:"integer",received:"float",message:l.message}),i.dirty()):l.kind==="min"?(l.inclusive?e.data<l.value:e.data<=l.value)&&(o=this._getOrReturnCtx(e,o),ie(o,{code:ee.too_small,minimum:l.value,type:"number",inclusive:l.inclusive,exact:!1,message:l.message}),i.dirty()):l.kind==="max"?(l.inclusive?e.data>l.value:e.data>=l.value)&&(o=this._getOrReturnCtx(e,o),ie(o,{code:ee.too_big,maximum:l.value,type:"number",inclusive:l.inclusive,exact:!1,message:l.message}),i.dirty()):l.kind==="multipleOf"?ly(e.data,l.value)!==0&&(o=this._getOrReturnCtx(e,o),ie(o,{code:ee.not_multiple_of,multipleOf:l.value,message:l.message}),i.dirty()):l.kind==="finite"?Number.isFinite(e.data)||(o=this._getOrReturnCtx(e,o),ie(o,{code:ee.not_finite,message:l.message}),i.dirty()):Ge.assertNever(l);return{status:i.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,fe.toString(n))}gt(e,n){return this.setLimit("min",e,!1,fe.toString(n))}lte(e,n){return this.setLimit("max",e,!0,fe.toString(n))}lt(e,n){return this.setLimit("max",e,!1,fe.toString(n))}setLimit(e,n,o,i){return new dr({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:o,message:fe.toString(i)}]})}_addCheck(e){return new dr({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:fe.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:fe.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:fe.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:fe.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:fe.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:fe.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:fe.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:fe.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:fe.toString(e)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&Ge.isInteger(e.value))}get isFinite(){let e=null,n=null;for(const o of this._def.checks){if(o.kind==="finite"||o.kind==="int"||o.kind==="multipleOf")return!0;o.kind==="min"?(n===null||o.value>n)&&(n=o.value):o.kind==="max"&&(e===null||o.value<e)&&(e=o.value)}return Number.isFinite(n)&&Number.isFinite(e)}}dr.create=t=>new dr({checks:[],typeName:Ce.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...Ve(t)});class ur extends Pe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==le.bigint){const l=this._getOrReturnCtx(e);return ie(l,{code:ee.invalid_type,expected:le.bigint,received:l.parsedType}),be}let o;const i=new bt;for(const l of this._def.checks)l.kind==="min"?(l.inclusive?e.data<l.value:e.data<=l.value)&&(o=this._getOrReturnCtx(e,o),ie(o,{code:ee.too_small,type:"bigint",minimum:l.value,inclusive:l.inclusive,message:l.message}),i.dirty()):l.kind==="max"?(l.inclusive?e.data>l.value:e.data>=l.value)&&(o=this._getOrReturnCtx(e,o),ie(o,{code:ee.too_big,type:"bigint",maximum:l.value,inclusive:l.inclusive,message:l.message}),i.dirty()):l.kind==="multipleOf"?e.data%l.value!==BigInt(0)&&(o=this._getOrReturnCtx(e,o),ie(o,{code:ee.not_multiple_of,multipleOf:l.value,message:l.message}),i.dirty()):Ge.assertNever(l);return{status:i.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,fe.toString(n))}gt(e,n){return this.setLimit("min",e,!1,fe.toString(n))}lte(e,n){return this.setLimit("max",e,!0,fe.toString(n))}lt(e,n){return this.setLimit("max",e,!1,fe.toString(n))}setLimit(e,n,o,i){return new ur({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:o,message:fe.toString(i)}]})}_addCheck(e){return new ur({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:fe.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:fe.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:fe.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:fe.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:fe.toString(n)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}ur.create=t=>{var e;return new ur({checks:[],typeName:Ce.ZodBigInt,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...Ve(t)})};class ei extends Pe{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==le.boolean){const o=this._getOrReturnCtx(e);return ie(o,{code:ee.invalid_type,expected:le.boolean,received:o.parsedType}),be}return Nt(e.data)}}ei.create=t=>new ei({typeName:Ce.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...Ve(t)});class zr extends Pe{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==le.date){const l=this._getOrReturnCtx(e);return ie(l,{code:ee.invalid_type,expected:le.date,received:l.parsedType}),be}if(isNaN(e.data.getTime())){const l=this._getOrReturnCtx(e);return ie(l,{code:ee.invalid_date}),be}const o=new bt;let i;for(const l of this._def.checks)l.kind==="min"?e.data.getTime()<l.value&&(i=this._getOrReturnCtx(e,i),ie(i,{code:ee.too_small,message:l.message,inclusive:!0,exact:!1,minimum:l.value,type:"date"}),o.dirty()):l.kind==="max"?e.data.getTime()>l.value&&(i=this._getOrReturnCtx(e,i),ie(i,{code:ee.too_big,message:l.message,inclusive:!0,exact:!1,maximum:l.value,type:"date"}),o.dirty()):Ge.assertNever(l);return{status:o.value,value:new Date(e.data.getTime())}}_addCheck(e){return new zr({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:fe.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:fe.toString(n)})}get minDate(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}}zr.create=t=>new zr({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:Ce.ZodDate,...Ve(t)});class ms extends Pe{_parse(e){if(this._getType(e)!==le.symbol){const o=this._getOrReturnCtx(e);return ie(o,{code:ee.invalid_type,expected:le.symbol,received:o.parsedType}),be}return Nt(e.data)}}ms.create=t=>new ms({typeName:Ce.ZodSymbol,...Ve(t)});class ti extends Pe{_parse(e){if(this._getType(e)!==le.undefined){const o=this._getOrReturnCtx(e);return ie(o,{code:ee.invalid_type,expected:le.undefined,received:o.parsedType}),be}return Nt(e.data)}}ti.create=t=>new ti({typeName:Ce.ZodUndefined,...Ve(t)});class ni extends Pe{_parse(e){if(this._getType(e)!==le.null){const o=this._getOrReturnCtx(e);return ie(o,{code:ee.invalid_type,expected:le.null,received:o.parsedType}),be}return Nt(e.data)}}ni.create=t=>new ni({typeName:Ce.ZodNull,...Ve(t)});class po extends Pe{constructor(){super(...arguments),this._any=!0}_parse(e){return Nt(e.data)}}po.create=t=>new po({typeName:Ce.ZodAny,...Ve(t)});class Ur extends Pe{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Nt(e.data)}}Ur.create=t=>new Ur({typeName:Ce.ZodUnknown,...Ve(t)});class qn extends Pe{_parse(e){const n=this._getOrReturnCtx(e);return ie(n,{code:ee.invalid_type,expected:le.never,received:n.parsedType}),be}}qn.create=t=>new qn({typeName:Ce.ZodNever,...Ve(t)});class gs extends Pe{_parse(e){if(this._getType(e)!==le.undefined){const o=this._getOrReturnCtx(e);return ie(o,{code:ee.invalid_type,expected:le.void,received:o.parsedType}),be}return Nt(e.data)}}gs.create=t=>new gs({typeName:Ce.ZodVoid,...Ve(t)});class hn extends Pe{_parse(e){const{ctx:n,status:o}=this._processInputParams(e),i=this._def;if(n.parsedType!==le.array)return ie(n,{code:ee.invalid_type,expected:le.array,received:n.parsedType}),be;if(i.exactLength!==null){const c=n.data.length>i.exactLength.value,d=n.data.length<i.exactLength.value;(c||d)&&(ie(n,{code:c?ee.too_big:ee.too_small,minimum:d?i.exactLength.value:void 0,maximum:c?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),o.dirty())}if(i.minLength!==null&&n.data.length<i.minLength.value&&(ie(n,{code:ee.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),o.dirty()),i.maxLength!==null&&n.data.length>i.maxLength.value&&(ie(n,{code:ee.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),o.dirty()),n.common.async)return Promise.all([...n.data].map((c,d)=>i.type._parseAsync(new In(n,c,n.path,d)))).then(c=>bt.mergeArray(o,c));const l=[...n.data].map((c,d)=>i.type._parseSync(new In(n,c,n.path,d)));return bt.mergeArray(o,l)}get element(){return this._def.type}min(e,n){return new hn({...this._def,minLength:{value:e,message:fe.toString(n)}})}max(e,n){return new hn({...this._def,maxLength:{value:e,message:fe.toString(n)}})}length(e,n){return new hn({...this._def,exactLength:{value:e,message:fe.toString(n)}})}nonempty(e){return this.min(1,e)}}hn.create=(t,e)=>new hn({type:t,minLength:null,maxLength:null,exactLength:null,typeName:Ce.ZodArray,...Ve(e)});function ho(t){if(t instanceof nt){const e={};for(const n in t.shape){const o=t.shape[n];e[n]=Ln.create(ho(o))}return new nt({...t._def,shape:()=>e})}else return t instanceof hn?new hn({...t._def,type:ho(t.element)}):t instanceof Ln?Ln.create(ho(t.unwrap())):t instanceof hr?hr.create(ho(t.unwrap())):t instanceof Fn?Fn.create(t.items.map(e=>ho(e))):t}class nt extends Pe{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),n=Ge.objectKeys(e);return this._cached={shape:e,keys:n}}_parse(e){if(this._getType(e)!==le.object){const h=this._getOrReturnCtx(e);return ie(h,{code:ee.invalid_type,expected:le.object,received:h.parsedType}),be}const{status:o,ctx:i}=this._processInputParams(e),{shape:l,keys:c}=this._getCached(),d=[];if(!(this._def.catchall instanceof qn&&this._def.unknownKeys==="strip"))for(const h in i.data)c.includes(h)||d.push(h);const p=[];for(const h of c){const m=l[h],y=i.data[h];p.push({key:{status:"valid",value:h},value:m._parse(new In(i,y,i.path,h)),alwaysSet:h in i.data})}if(this._def.catchall instanceof qn){const h=this._def.unknownKeys;if(h==="passthrough")for(const m of d)p.push({key:{status:"valid",value:m},value:{status:"valid",value:i.data[m]}});else if(h==="strict")d.length>0&&(ie(i,{code:ee.unrecognized_keys,keys:d}),o.dirty());else if(h!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const h=this._def.catchall;for(const m of d){const y=i.data[m];p.push({key:{status:"valid",value:m},value:h._parse(new In(i,y,i.path,m)),alwaysSet:m in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const h=[];for(const m of p){const y=await m.key,b=await m.value;h.push({key:y,value:b,alwaysSet:m.alwaysSet})}return h}).then(h=>bt.mergeObjectSync(o,h)):bt.mergeObjectSync(o,p)}get shape(){return this._def.shape()}strict(e){return fe.errToObj,new nt({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,o)=>{var i,l,c,d;const p=(c=(l=(i=this._def).errorMap)===null||l===void 0?void 0:l.call(i,n,o).message)!==null&&c!==void 0?c:o.defaultError;return n.code==="unrecognized_keys"?{message:(d=fe.errToObj(e).message)!==null&&d!==void 0?d:p}:{message:p}}}:{}})}strip(){return new nt({...this._def,unknownKeys:"strip"})}passthrough(){return new nt({...this._def,unknownKeys:"passthrough"})}extend(e){return new nt({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new nt({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:Ce.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new nt({...this._def,catchall:e})}pick(e){const n={};return Ge.objectKeys(e).forEach(o=>{e[o]&&this.shape[o]&&(n[o]=this.shape[o])}),new nt({...this._def,shape:()=>n})}omit(e){const n={};return Ge.objectKeys(this.shape).forEach(o=>{e[o]||(n[o]=this.shape[o])}),new nt({...this._def,shape:()=>n})}deepPartial(){return ho(this)}partial(e){const n={};return Ge.objectKeys(this.shape).forEach(o=>{const i=this.shape[o];e&&!e[o]?n[o]=i:n[o]=i.optional()}),new nt({...this._def,shape:()=>n})}required(e){const n={};return Ge.objectKeys(this.shape).forEach(o=>{if(e&&!e[o])n[o]=this.shape[o];else{let l=this.shape[o];for(;l instanceof Ln;)l=l._def.innerType;n[o]=l}}),new nt({...this._def,shape:()=>n})}keyof(){return au(Ge.objectKeys(this.shape))}}nt.create=(t,e)=>new nt({shape:()=>t,unknownKeys:"strip",catchall:qn.create(),typeName:Ce.ZodObject,...Ve(e)}),nt.strictCreate=(t,e)=>new nt({shape:()=>t,unknownKeys:"strict",catchall:qn.create(),typeName:Ce.ZodObject,...Ve(e)}),nt.lazycreate=(t,e)=>new nt({shape:t,unknownKeys:"strip",catchall:qn.create(),typeName:Ce.ZodObject,...Ve(e)});class ri extends Pe{_parse(e){const{ctx:n}=this._processInputParams(e),o=this._def.options;function i(l){for(const d of l)if(d.result.status==="valid")return d.result;for(const d of l)if(d.result.status==="dirty")return n.common.issues.push(...d.ctx.common.issues),d.result;const c=l.map(d=>new Zt(d.ctx.common.issues));return ie(n,{code:ee.invalid_union,unionErrors:c}),be}if(n.common.async)return Promise.all(o.map(async l=>{const c={...n,common:{...n.common,issues:[]},parent:null};return{result:await l._parseAsync({data:n.data,path:n.path,parent:c}),ctx:c}})).then(i);{let l;const c=[];for(const p of o){const h={...n,common:{...n.common,issues:[]},parent:null},m=p._parseSync({data:n.data,path:n.path,parent:h});if(m.status==="valid")return m;m.status==="dirty"&&!l&&(l={result:m,ctx:h}),h.common.issues.length&&c.push(h.common.issues)}if(l)return n.common.issues.push(...l.ctx.common.issues),l.result;const d=c.map(p=>new Zt(p));return ie(n,{code:ee.invalid_union,unionErrors:d}),be}}get options(){return this._def.options}}ri.create=(t,e)=>new ri({options:t,typeName:Ce.ZodUnion,...Ve(e)});const Kn=t=>t instanceof si?Kn(t.schema):t instanceof fn?Kn(t.innerType()):t instanceof ai?[t.value]:t instanceof pr?t.options:t instanceof li?Ge.objectValues(t.enum):t instanceof ci?Kn(t._def.innerType):t instanceof ti?[void 0]:t instanceof ni?[null]:t instanceof Ln?[void 0,...Kn(t.unwrap())]:t instanceof hr?[null,...Kn(t.unwrap())]:t instanceof ll||t instanceof pi?Kn(t.unwrap()):t instanceof di?Kn(t._def.innerType):[];class ys extends Pe{_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==le.object)return ie(n,{code:ee.invalid_type,expected:le.object,received:n.parsedType}),be;const o=this.discriminator,i=n.data[o],l=this.optionsMap.get(i);return l?n.common.async?l._parseAsync({data:n.data,path:n.path,parent:n}):l._parseSync({data:n.data,path:n.path,parent:n}):(ie(n,{code:ee.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[o]}),be)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,o){const i=new Map;for(const l of n){const c=Kn(l.shape[e]);if(!c.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const d of c){if(i.has(d))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(d)}`);i.set(d,l)}}return new ys({typeName:Ce.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:i,...Ve(o)})}}function al(t,e){const n=cr(t),o=cr(e);if(t===e)return{valid:!0,data:t};if(n===le.object&&o===le.object){const i=Ge.objectKeys(e),l=Ge.objectKeys(t).filter(d=>i.indexOf(d)!==-1),c={...t,...e};for(const d of l){const p=al(t[d],e[d]);if(!p.valid)return{valid:!1};c[d]=p.data}return{valid:!0,data:c}}else if(n===le.array&&o===le.array){if(t.length!==e.length)return{valid:!1};const i=[];for(let l=0;l<t.length;l++){const c=t[l],d=e[l],p=al(c,d);if(!p.valid)return{valid:!1};i.push(p.data)}return{valid:!0,data:i}}else return n===le.date&&o===le.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class oi extends Pe{_parse(e){const{status:n,ctx:o}=this._processInputParams(e),i=(l,c)=>{if(ol(l)||ol(c))return be;const d=al(l.value,c.value);return d.valid?((il(l)||il(c))&&n.dirty(),{status:n.value,value:d.data}):(ie(o,{code:ee.invalid_intersection_types}),be)};return o.common.async?Promise.all([this._def.left._parseAsync({data:o.data,path:o.path,parent:o}),this._def.right._parseAsync({data:o.data,path:o.path,parent:o})]).then(([l,c])=>i(l,c)):i(this._def.left._parseSync({data:o.data,path:o.path,parent:o}),this._def.right._parseSync({data:o.data,path:o.path,parent:o}))}}oi.create=(t,e,n)=>new oi({left:t,right:e,typeName:Ce.ZodIntersection,...Ve(n)});class Fn extends Pe{_parse(e){const{status:n,ctx:o}=this._processInputParams(e);if(o.parsedType!==le.array)return ie(o,{code:ee.invalid_type,expected:le.array,received:o.parsedType}),be;if(o.data.length<this._def.items.length)return ie(o,{code:ee.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),be;!this._def.rest&&o.data.length>this._def.items.length&&(ie(o,{code:ee.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const l=[...o.data].map((c,d)=>{const p=this._def.items[d]||this._def.rest;return p?p._parse(new In(o,c,o.path,d)):null}).filter(c=>!!c);return o.common.async?Promise.all(l).then(c=>bt.mergeArray(n,c)):bt.mergeArray(n,l)}get items(){return this._def.items}rest(e){return new Fn({...this._def,rest:e})}}Fn.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Fn({items:t,typeName:Ce.ZodTuple,rest:null,...Ve(e)})};class ii extends Pe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:o}=this._processInputParams(e);if(o.parsedType!==le.object)return ie(o,{code:ee.invalid_type,expected:le.object,received:o.parsedType}),be;const i=[],l=this._def.keyType,c=this._def.valueType;for(const d in o.data)i.push({key:l._parse(new In(o,d,o.path,d)),value:c._parse(new In(o,o.data[d],o.path,d)),alwaysSet:d in o.data});return o.common.async?bt.mergeObjectAsync(n,i):bt.mergeObjectSync(n,i)}get element(){return this._def.valueType}static create(e,n,o){return n instanceof Pe?new ii({keyType:e,valueType:n,typeName:Ce.ZodRecord,...Ve(o)}):new ii({keyType:pn.create(),valueType:e,typeName:Ce.ZodRecord,...Ve(n)})}}class _s extends Pe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:o}=this._processInputParams(e);if(o.parsedType!==le.map)return ie(o,{code:ee.invalid_type,expected:le.map,received:o.parsedType}),be;const i=this._def.keyType,l=this._def.valueType,c=[...o.data.entries()].map(([d,p],h)=>({key:i._parse(new In(o,d,o.path,[h,"key"])),value:l._parse(new In(o,p,o.path,[h,"value"]))}));if(o.common.async){const d=new Map;return Promise.resolve().then(async()=>{for(const p of c){const h=await p.key,m=await p.value;if(h.status==="aborted"||m.status==="aborted")return be;(h.status==="dirty"||m.status==="dirty")&&n.dirty(),d.set(h.value,m.value)}return{status:n.value,value:d}})}else{const d=new Map;for(const p of c){const h=p.key,m=p.value;if(h.status==="aborted"||m.status==="aborted")return be;(h.status==="dirty"||m.status==="dirty")&&n.dirty(),d.set(h.value,m.value)}return{status:n.value,value:d}}}}_s.create=(t,e,n)=>new _s({valueType:e,keyType:t,typeName:Ce.ZodMap,...Ve(n)});class Zr extends Pe{_parse(e){const{status:n,ctx:o}=this._processInputParams(e);if(o.parsedType!==le.set)return ie(o,{code:ee.invalid_type,expected:le.set,received:o.parsedType}),be;const i=this._def;i.minSize!==null&&o.data.size<i.minSize.value&&(ie(o,{code:ee.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),n.dirty()),i.maxSize!==null&&o.data.size>i.maxSize.value&&(ie(o,{code:ee.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),n.dirty());const l=this._def.valueType;function c(p){const h=new Set;for(const m of p){if(m.status==="aborted")return be;m.status==="dirty"&&n.dirty(),h.add(m.value)}return{status:n.value,value:h}}const d=[...o.data.values()].map((p,h)=>l._parse(new In(o,p,o.path,h)));return o.common.async?Promise.all(d).then(p=>c(p)):c(d)}min(e,n){return new Zr({...this._def,minSize:{value:e,message:fe.toString(n)}})}max(e,n){return new Zr({...this._def,maxSize:{value:e,message:fe.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}}Zr.create=(t,e)=>new Zr({valueType:t,minSize:null,maxSize:null,typeName:Ce.ZodSet,...Ve(e)});class fo extends Pe{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==le.function)return ie(n,{code:ee.invalid_type,expected:le.function,received:n.parsedType}),be;function o(d,p){return hs({data:d,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,ps(),co].filter(h=>!!h),issueData:{code:ee.invalid_arguments,argumentsError:p}})}function i(d,p){return hs({data:d,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,ps(),co].filter(h=>!!h),issueData:{code:ee.invalid_return_type,returnTypeError:p}})}const l={errorMap:n.common.contextualErrorMap},c=n.data;if(this._def.returns instanceof mo){const d=this;return Nt(async function(...p){const h=new Zt([]),m=await d._def.args.parseAsync(p,l).catch(w=>{throw h.addIssue(o(p,w)),h}),y=await Reflect.apply(c,this,m);return await d._def.returns._def.type.parseAsync(y,l).catch(w=>{throw h.addIssue(i(y,w)),h})})}else{const d=this;return Nt(function(...p){const h=d._def.args.safeParse(p,l);if(!h.success)throw new Zt([o(p,h.error)]);const m=Reflect.apply(c,this,h.data),y=d._def.returns.safeParse(m,l);if(!y.success)throw new Zt([i(m,y.error)]);return y.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new fo({...this._def,args:Fn.create(e).rest(Ur.create())})}returns(e){return new fo({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,n,o){return new fo({args:e||Fn.create([]).rest(Ur.create()),returns:n||Ur.create(),typeName:Ce.ZodFunction,...Ve(o)})}}class si extends Pe{get schema(){return this._def.getter()}_parse(e){const{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}si.create=(t,e)=>new si({getter:t,typeName:Ce.ZodLazy,...Ve(e)});class ai extends Pe{_parse(e){if(e.data!==this._def.value){const n=this._getOrReturnCtx(e);return ie(n,{received:n.data,code:ee.invalid_literal,expected:this._def.value}),be}return{status:"valid",value:e.data}}get value(){return this._def.value}}ai.create=(t,e)=>new ai({value:t,typeName:Ce.ZodLiteral,...Ve(e)});function au(t,e){return new pr({values:t,typeName:Ce.ZodEnum,...Ve(e)})}class pr extends Pe{constructor(){super(...arguments),Jo.set(this,void 0)}_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),o=this._def.values;return ie(n,{expected:Ge.joinValues(o),received:n.parsedType,code:ee.invalid_type}),be}if(fs(this,Jo)||nu(this,Jo,new Set(this._def.values)),!fs(this,Jo).has(e.data)){const n=this._getOrReturnCtx(e),o=this._def.values;return ie(n,{received:n.data,code:ee.invalid_enum_value,options:o}),be}return Nt(e.data)}get options(){return this._def.values}get enum(){const e={};for(const n of this._def.values)e[n]=n;return e}get Values(){const e={};for(const n of this._def.values)e[n]=n;return e}get Enum(){const e={};for(const n of this._def.values)e[n]=n;return e}extract(e,n=this._def){return pr.create(e,{...this._def,...n})}exclude(e,n=this._def){return pr.create(this.options.filter(o=>!e.includes(o)),{...this._def,...n})}}Jo=new WeakMap,pr.create=au;class li extends Pe{constructor(){super(...arguments),Qo.set(this,void 0)}_parse(e){const n=Ge.getValidEnumValues(this._def.values),o=this._getOrReturnCtx(e);if(o.parsedType!==le.string&&o.parsedType!==le.number){const i=Ge.objectValues(n);return ie(o,{expected:Ge.joinValues(i),received:o.parsedType,code:ee.invalid_type}),be}if(fs(this,Qo)||nu(this,Qo,new Set(Ge.getValidEnumValues(this._def.values))),!fs(this,Qo).has(e.data)){const i=Ge.objectValues(n);return ie(o,{received:o.data,code:ee.invalid_enum_value,options:i}),be}return Nt(e.data)}get enum(){return this._def.values}}Qo=new WeakMap,li.create=(t,e)=>new li({values:t,typeName:Ce.ZodNativeEnum,...Ve(e)});class mo extends Pe{unwrap(){return this._def.type}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==le.promise&&n.common.async===!1)return ie(n,{code:ee.invalid_type,expected:le.promise,received:n.parsedType}),be;const o=n.parsedType===le.promise?n.data:Promise.resolve(n.data);return Nt(o.then(i=>this._def.type.parseAsync(i,{path:n.path,errorMap:n.common.contextualErrorMap})))}}mo.create=(t,e)=>new mo({type:t,typeName:Ce.ZodPromise,...Ve(e)});class fn extends Pe{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Ce.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:n,ctx:o}=this._processInputParams(e),i=this._def.effect||null,l={addIssue:c=>{ie(o,c),c.fatal?n.abort():n.dirty()},get path(){return o.path}};if(l.addIssue=l.addIssue.bind(l),i.type==="preprocess"){const c=i.transform(o.data,l);if(o.common.async)return Promise.resolve(c).then(async d=>{if(n.value==="aborted")return be;const p=await this._def.schema._parseAsync({data:d,path:o.path,parent:o});return p.status==="aborted"?be:p.status==="dirty"||n.value==="dirty"?uo(p.value):p});{if(n.value==="aborted")return be;const d=this._def.schema._parseSync({data:c,path:o.path,parent:o});return d.status==="aborted"?be:d.status==="dirty"||n.value==="dirty"?uo(d.value):d}}if(i.type==="refinement"){const c=d=>{const p=i.refinement(d,l);if(o.common.async)return Promise.resolve(p);if(p instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return d};if(o.common.async===!1){const d=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});return d.status==="aborted"?be:(d.status==="dirty"&&n.dirty(),c(d.value),{status:n.value,value:d.value})}else return this._def.schema._parseAsync({data:o.data,path:o.path,parent:o}).then(d=>d.status==="aborted"?be:(d.status==="dirty"&&n.dirty(),c(d.value).then(()=>({status:n.value,value:d.value}))))}if(i.type==="transform")if(o.common.async===!1){const c=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});if(!Yo(c))return c;const d=i.transform(c.value,l);if(d instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:d}}else return this._def.schema._parseAsync({data:o.data,path:o.path,parent:o}).then(c=>Yo(c)?Promise.resolve(i.transform(c.value,l)).then(d=>({status:n.value,value:d})):c);Ge.assertNever(i)}}fn.create=(t,e,n)=>new fn({schema:t,typeName:Ce.ZodEffects,effect:e,...Ve(n)}),fn.createWithPreprocess=(t,e,n)=>new fn({schema:e,effect:{type:"preprocess",transform:t},typeName:Ce.ZodEffects,...Ve(n)});class Ln extends Pe{_parse(e){return this._getType(e)===le.undefined?Nt(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Ln.create=(t,e)=>new Ln({innerType:t,typeName:Ce.ZodOptional,...Ve(e)});class hr extends Pe{_parse(e){return this._getType(e)===le.null?Nt(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}hr.create=(t,e)=>new hr({innerType:t,typeName:Ce.ZodNullable,...Ve(e)});class ci extends Pe{_parse(e){const{ctx:n}=this._processInputParams(e);let o=n.data;return n.parsedType===le.undefined&&(o=this._def.defaultValue()),this._def.innerType._parse({data:o,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}ci.create=(t,e)=>new ci({innerType:t,typeName:Ce.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Ve(e)});class di extends Pe{_parse(e){const{ctx:n}=this._processInputParams(e),o={...n,common:{...n.common,issues:[]}},i=this._def.innerType._parse({data:o.data,path:o.path,parent:{...o}});return Xo(i)?i.then(l=>({status:"valid",value:l.status==="valid"?l.value:this._def.catchValue({get error(){return new Zt(o.common.issues)},input:o.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Zt(o.common.issues)},input:o.data})}}removeCatch(){return this._def.innerType}}di.create=(t,e)=>new di({innerType:t,typeName:Ce.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Ve(e)});class vs extends Pe{_parse(e){if(this._getType(e)!==le.nan){const o=this._getOrReturnCtx(e);return ie(o,{code:ee.invalid_type,expected:le.nan,received:o.parsedType}),be}return{status:"valid",value:e.data}}}vs.create=t=>new vs({typeName:Ce.ZodNaN,...Ve(t)});const cy=Symbol("zod_brand");class ll extends Pe{_parse(e){const{ctx:n}=this._processInputParams(e),o=n.data;return this._def.type._parse({data:o,path:n.path,parent:n})}unwrap(){return this._def.type}}class ui extends Pe{_parse(e){const{status:n,ctx:o}=this._processInputParams(e);if(o.common.async)return(async()=>{const l=await this._def.in._parseAsync({data:o.data,path:o.path,parent:o});return l.status==="aborted"?be:l.status==="dirty"?(n.dirty(),uo(l.value)):this._def.out._parseAsync({data:l.value,path:o.path,parent:o})})();{const i=this._def.in._parseSync({data:o.data,path:o.path,parent:o});return i.status==="aborted"?be:i.status==="dirty"?(n.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:o.path,parent:o})}}static create(e,n){return new ui({in:e,out:n,typeName:Ce.ZodPipeline})}}class pi extends Pe{_parse(e){const n=this._def.innerType._parse(e),o=i=>(Yo(i)&&(i.value=Object.freeze(i.value)),i);return Xo(n)?n.then(i=>o(i)):o(n)}unwrap(){return this._def.innerType}}pi.create=(t,e)=>new pi({innerType:t,typeName:Ce.ZodReadonly,...Ve(e)});function lu(t,e={},n){return t?po.create().superRefine((o,i)=>{var l,c;if(!t(o)){const d=typeof e=="function"?e(o):typeof e=="string"?{message:e}:e,p=(c=(l=d.fatal)!==null&&l!==void 0?l:n)!==null&&c!==void 0?c:!0,h=typeof d=="string"?{message:d}:d;i.addIssue({code:"custom",...h,fatal:p})}}):po.create()}const dy={object:nt.lazycreate};var Ce;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(Ce||(Ce={}));const uy=(t,e={message:`Input not instance of ${t.name}`})=>lu(n=>n instanceof t,e),cu=pn.create,du=dr.create,py=vs.create,hy=ur.create,uu=ei.create,fy=zr.create,my=ms.create,gy=ti.create,yy=ni.create,_y=po.create,vy=Ur.create,Cy=qn.create,wy=gs.create,by=hn.create,xy=nt.create,ky=nt.strictCreate,Ey=ri.create,Sy=ys.create,Ty=oi.create,Ny=Fn.create,Vy=ii.create,Ay=_s.create,By=Zr.create,Py=fo.create,Ry=si.create,Dy=ai.create,Iy=pr.create,Fy=li.create,Ly=mo.create,pu=fn.create,Oy=Ln.create,My=hr.create,Gy=fn.createWithPreprocess,$y=ui.create;var On=Object.freeze({__proto__:null,defaultErrorMap:co,setErrorMap:jg,getErrorMap:ps,makeIssue:hs,EMPTY_PATH:Hg,addIssueToContext:ie,ParseStatus:bt,INVALID:be,DIRTY:uo,OK:Nt,isAborted:ol,isDirty:il,isValid:Yo,isAsync:Xo,get util(){return Ge},get objectUtil(){return rl},ZodParsedType:le,getParsedType:cr,ZodType:Pe,datetimeRegex:su,ZodString:pn,ZodNumber:dr,ZodBigInt:ur,ZodBoolean:ei,ZodDate:zr,ZodSymbol:ms,ZodUndefined:ti,ZodNull:ni,ZodAny:po,ZodUnknown:Ur,ZodNever:qn,ZodVoid:gs,ZodArray:hn,ZodObject:nt,ZodUnion:ri,ZodDiscriminatedUnion:ys,ZodIntersection:oi,ZodTuple:Fn,ZodRecord:ii,ZodMap:_s,ZodSet:Zr,ZodFunction:fo,ZodLazy:si,ZodLiteral:ai,ZodEnum:pr,ZodNativeEnum:li,ZodPromise:mo,ZodEffects:fn,ZodTransformer:fn,ZodOptional:Ln,ZodNullable:hr,ZodDefault:ci,ZodCatch:di,ZodNaN:vs,BRAND:cy,ZodBranded:ll,ZodPipeline:ui,ZodReadonly:pi,custom:lu,Schema:Pe,ZodSchema:Pe,late:dy,get ZodFirstPartyTypeKind(){return Ce},coerce:{string:t=>pn.create({...t,coerce:!0}),number:t=>dr.create({...t,coerce:!0}),boolean:t=>ei.create({...t,coerce:!0}),bigint:t=>ur.create({...t,coerce:!0}),date:t=>zr.create({...t,coerce:!0})},any:_y,array:by,bigint:hy,boolean:uu,date:fy,discriminatedUnion:Sy,effect:pu,enum:Iy,function:Py,instanceof:uy,intersection:Ty,lazy:Ry,literal:Dy,map:Ay,nan:py,nativeEnum:Fy,never:Cy,null:yy,nullable:My,number:du,object:xy,oboolean:()=>uu().optional(),onumber:()=>du().optional(),optional:Oy,ostring:()=>cu().optional(),pipeline:$y,preprocess:Gy,promise:Ly,record:Vy,set:By,strictObject:ky,string:cu,symbol:my,transformer:pu,tuple:Ny,undefined:gy,union:Ey,unknown:vy,void:wy,NEVER:be,ZodIssueCode:ee,quotelessJson:Wg,ZodError:Zt});function zy(t){throw new Error("Unexpected object: "+t)}const Uy=-2147483648,hu=-9007199254740991n,Zy=NaN,Wy=NaN,jy=null,Hy=null;function fu(t,e){switch(e){case"Int":return t===Uy;case"Long":return t===Number(hu)||t===hu;case"Float":return t===Zy;case"Double":return t===Wy;case"String":return t===jy;case"Bytes":return t===Hy;default:throw Error(`unsupported data type: ${e}`)}}function qy(t,e){const n=Math.floor(e/8),o=1<<7-e%8;return(t[n]&o)>0}function cl(t){const{type:e,name:n,domain:o}=t;return{type:e,name:n,...o&&{domain:o}}}function mu(t){return t.map(cl)}function Cs(t,e){switch(t.type){case"column":return{type:"column",column:e(t.column)};case"inner":case"full":return{type:t.type,entries:t.entries.map(n=>Cs(n,e))};case"outer":return{type:"outer",primary:Cs(t.primary,e),secondary:t.secondary.map(n=>Cs(n,e))};default:zy(t)}}On.object({__isRef:On.literal(!0).describe("Crucial marker for the block dependency tree reconstruction"),blockId:On.string().describe("Upstream block id"),name:On.string().describe("Name of the output provided to the upstream block's output context")}).describe("Universal reference type, allowing to set block connections. It is crucial that {@link __isRef} is present and equal to true, internal logic relies on this marker to build block dependency trees.").strict().readonly();function Ky(t){if(t&&typeof globalThis.getPlatforma=="function")return globalThis.getPlatforma(t);if(typeof globalThis.platforma<"u")return globalThis.platforma;throw new Error("Can't get platforma instance.")}const Yy=On.object({type:On.string(),importance:On.number().optional(),id:On.string().optional(),label:On.string()});On.array(Yy);const Xy="1.14.1";function gu(){return Ky({sdkVersion:Xy})}function Jy(t){if(typeof globalThis.getEnvironmentValue=="function")return globalThis.getEnvironmentValue(t)}function go(t){return!!t&&typeof t.children<"u"}function fr(t){return go(t)?t.groupId:t.colId}function yu(t,e,n){const o=(c,d)=>{const p=c.children.map(fr),h=T._includes(p,fr(d)),m=T._last(c.children),y=m&&fr(m)!==fr(d);return h&&y};if(!go(t))return!0;const i=t,l=n;if(o(i,l))return i.children.push(l),!0;if(i.groupId===e){const c=i.children.map(fr);if(!T._includes(c,fr(l)))return i.children.push(l),!0}for(let c=i.children.length-1;c>=0&&!yu(i.children[c],e,n);c--);return!1}function Qy(t){const e=(i,l)=>go(i)&&go(l)&&fr(i)===fr(l),n=(i,l)=>{if(!go(l))return i;const c=i,d=l;return d.children&&d.groupId&&yu(c,d.groupId,d.children[0])||d.children.forEach(p=>n(c,p)),c},o=[];for(let i=1;i<=t.length;i++){const l=t[i-1],c=t[i];e(l,c)?t[i]=n(l,c):o.push(l)}return o}var e_=class extends T.BeanStub{constructor(){super(...arguments),this.beanName="toolPanelColDefService"}wireBeans(t){this.columnModel=t.columnModel}createColumnTree(t){const e=[],n=(i,l)=>{if(go(i)){const c=i,d=typeof c.groupId<"u"?c.groupId:c.headerName,p=new T.AgProvidedColumnGroup(c,d,!1,l),h=[];return c.children.forEach(m=>{const y=n(m,l+1);y&&h.push(y)}),p.setChildren(h),p}else{const c=i,d=c.colId?c.colId:c.field,p=this.columnModel.getColDefCol(d);return p||e.push(c),p}},o=[];return t.forEach(i=>{const l=n(i,0);l&&o.push(l)}),e.length>0&&T._warnOnce("unable to find grid columns for the supplied colDef(s):",e),o}syncLayoutWithGrid(t){const e=this.getLeafPathTrees(),n=Qy(e);t(n)}getLeafPathTrees(){const t=(o,i)=>{let l;if(T.isProvidedColumnGroup(o))if(o.isPadding())l=i;else{const d=Object.assign({},o.getColGroupDef());d.groupId=o.getGroupId(),d.children=[i],l=d}else{const d=Object.assign({},o.getColDef());d.colId=o.getColId(),l=d}const c=o.getOriginalParent();return c?t(c,l):l};return this.columnModel.getCols().filter(o=>{const i=o.getColDef();return o.isPrimary()&&!i.showRowGroup}).map(o=>t(o,o.getColDef()))}};function t_(t){var e;return((e=t.sideBarService)==null?void 0:e.getSideBarComp().isDisplayed())??!1}function n_(t,e){var n;(n=t.sideBarService)==null||n.getSideBarComp().setDisplayed(e)}function r_(t,e){var n;(n=t.sideBarService)==null||n.getSideBarComp().setSideBarPosition(e)}function o_(t,e){var n;(n=t.sideBarService)==null||n.getSideBarComp().openToolPanel(e,"api")}function i_(t){var e;(e=t.sideBarService)==null||e.getSideBarComp().close("api")}function s_(t){var e;return((e=t.sideBarService)==null?void 0:e.getSideBarComp().openedItem())??null}function a_(t){var e;(e=t.sideBarService)==null||e.getSideBarComp().refresh()}function l_(t){var e;return((e=t.sideBarService)==null?void 0:e.getSideBarComp().isToolPanelShowing())??!1}function c_(t,e){var o;const n=(o=t.sideBarService)==null?void 0:o.getSideBarComp().getToolPanelInstance(e);return T._unwrapUserComp(n)}function d_(t){var e;return(e=t.sideBarService)==null?void 0:e.getSideBarComp().getDef()}var u_=class extends T.Component{constructor(t){super(),this.eToggleButton=T.RefPlaceholder,this.eIconWrapper=T.RefPlaceholder,this.eLabel=T.RefPlaceholder,this.toolPanelDef=t}getToolPanelId(){return this.toolPanelDef.id}postConstruct(){const t=this.createTemplate();this.setTemplate(t,[]),this.setLabel(),this.setIcon(),this.addManagedElementListeners(this.eToggleButton,{click:this.onButtonPressed.bind(this)}),this.eToggleButton.setAttribute("id",`ag-${this.getCompId()}-button`)}createTemplate(){return`<div class="ag-side-button" role="presentation">
3
+ `)}}function zg(t){return{ok:!0,value:t}}function eu(t){if(!t)throw new Ya;if(!t.ok)throw Error(t.errors.join(";"));return t.value}function tu(t){return{value:t,errors:void 0}}function Ug(t){if(t.errors)throw new Xa(t.errors);if(!t.value)throw new Ya;return t.value}function Zg(t){return t!==void 0}function Ja(t,e){return $r(t)===$r(e)}const Qa=t=>t,el=t=>t instanceof Error?t:Error(String(t)),tl=t=>t.name==="ZodError",nl=t=>{const{formErrors:e,fieldErrors:n}=t.flatten(),o=Object.entries(n).map(([i,l])=>i+":"+(l==null?void 0:l.join(",")));return e.concat(o).join("; ")};function rl(t){const e=t.validate??Qa,{autoSave:n}=t,o=r.ref(),i=r.ref(),l=S=>{i.value={model:Dn(S)}};r.watch(()=>t.get(),S=>l(S),{immediate:!0});const c=()=>{var S;t.onSave(e(Dn((S=i.value)==null?void 0:S.model)))},d=()=>{l(t.get()),o.value=void 0},p=S=>{const M=el(S);tl(M)?o.value=Error(nl(M)):o.value=M},h=S=>{o.value=void 0;try{e(S),n&&c()}catch(M){p(M)}},m=r.computed({get:()=>{var S;return(S=i.value)==null?void 0:S.model},set(S){l(S),h(S)}});r.watch(i,(S,M)=>{S&&S===M&&h(S.model)},{deep:!0});const y=r.computed(()=>!o.value),b=r.computed(()=>!Ja(t.get(),r.unref(i))),w=r.computed(()=>o.value?o.value.message:"");return r.reactive({model:m,valid:y,isChanged:b,error:o,errorString:w,save:c,revert:d,setError:p})}function Wg(t,e,n){const o=t.validate??Qa,{autoSave:i}=t,l=r.ref(),c=r.ref(),d=O=>{var v;if(n.deepPatchModel){const I=(v=c.value)==null?void 0:v.model,F=Object.assign(Dn(O),e??{});c.value={model:I?Jd(I,F):F,stage:Symbol()}}else c.value={model:Object.assign(Dn(O),e??{}),stage:Symbol()}};r.watch(()=>t.get(),O=>d(O),{immediate:!0});const p=()=>{var O;t.onSave(o(Dn((O=c.value)==null?void 0:O.model)))},h=()=>{d(t.get()),l.value=void 0},m=O=>{const v=el(O);tl(v)?l.value=Error(nl(v)):l.value=v},y=O=>{l.value=void 0;try{o(O),i&&p()}catch(v){m(v)}},b=r.computed({get:()=>{var O;return(O=c.value)==null?void 0:O.model},set(){throw Error("Cannot replace base model")}});r.watch([()=>({args:b.value.args,ui:b.value.ui}),()=>{var O;return(O=c.value)==null?void 0:O.stage}],([O,v],[I,F])=>{v===F&&y(O)},{deep:!0});const w=r.computed(()=>!l.value),S=r.computed(()=>{var I;const{args:O,ui:v}=((I=r.unref(c))==null?void 0:I.model)??{};return!Ja(t.get(),{args:O,ui:v})}),M=r.computed(()=>l.value?l.value.message:"");return r.reactive({model:b,valid:w,isChanged:S,error:l,errorString:M,save:p,revert:h,setError:m})}const jg=t=>Object.fromEntries(new URL(t,"http://dummy").searchParams);function Hg(t,e,n){const o=(v,...I)=>{n.debug&&console.log(`%c>>> %c${v}`,"color: orange; font-weight: bold","color: orange",...I)},l=Ka(e.setBlockArgs,100),c=Ka(e.setBlockUiState,100),d=Ka(e.setBlockArgsAndUiState,100),p=r.reactive({args:Object.freeze(t.args),outputs:Object.freeze(t.outputs),ui:Object.freeze(t.ui),navigationState:Object.freeze(t.navigationState)});e.onStateUpdates(async v=>{v.forEach(I=>{I.key==="args"&&(p.args=Object.freeze(I.value),o("args patch",p.args)),I.key==="ui"&&(p.ui=Object.freeze(I.value),o("ui patch",p.ui)),I.key==="outputs"&&(p.outputs=Object.freeze(I.value),o("outputs patch",p.outputs)),I.key==="navigationState"&&(p.navigationState=Object.freeze(I.value),o("navigationState patch",p.navigationState))}),await r.nextTick()});const h=()=>Dn(p.args),m=()=>Dn(p.ui),y=()=>Dn(p.navigationState),b={createArgsModel(v={}){return rl({get(){return v.transform?v.transform(p.args):p.args},validate:v.validate,autoSave:!0,onSave(I){l(I)}})},createUiModel(v={},I){return rl({get(){return v.transform?v.transform(p.ui):p.ui??I()},validate:v.validate,autoSave:!0,onSave(F){c(F)}})},useOutputs(...v){const I=r.reactive({errors:void 0,value:void 0});return r.watch(()=>p.outputs,()=>{try{Object.assign(I,{value:this.unwrapOutputs(...v),errors:void 0})}catch(F){Object.assign(I,{value:void 0,errors:[String(F)]})}},{immediate:!0,deep:!0}),I},unwrapOutputs(...v){const I=p.outputs,F=v.map(W=>[W,eu(I[W])]);return Object.fromEntries(F)},getOutputField(v){return p.outputs[v]},getOutputFieldOkOptional(v){console.warn("use reactive app.outputValues.fieldName instead instead of getOutputFieldOkOptional(fieldName)");const I=this.getOutputField(v);if(I&&I.ok)return I.value},getOutputFieldErrorsOptional(v){console.warn("use reactive app.outputErrors.fieldName instead instead of getOutputFieldErrorsOptional(fieldName)");const I=this.getOutputField(v);if(I&&!I.ok)return I.errors},updateArgs(v){const I=h();return v(I),e.setBlockArgs(I)},updateUiState(v){const I=m();return e.setBlockUiState(v(I))},updateNavigationState(v){const I=y();return v(I),e.setNavigationState(I)},navigateTo(v){const I=y();return I.href=v,e.setNavigationState(I)}},w=r.computed(()=>{const v=Object.entries(p.outputs).map(([I,F])=>[I,F.ok&&F.value!==void 0?F.value:void 0]);return Object.fromEntries(v)}),S=r.computed(()=>{const v=Object.entries(p.outputs).map(([I,F])=>[I,F&&!F.ok?new Xa(F.errors):void 0]);return Object.fromEntries(v)}),M={snapshot:p,queryParams:r.computed(()=>jg(p.navigationState.href)),href:r.computed(()=>p.navigationState.href),hasErrors:r.computed(()=>Object.values(p.outputs).some(v=>!(v!=null&&v.ok))),outputValues:r.computed(()=>(console.warn("Change app.outputValues to app.model.outputs"),w.value)),outputErrors:r.computed(()=>(console.warn("Change app.outputErrors to app.model.outputErrors"),S.value)),args:r.computed(()=>(console.warn("Change app.args to app.snapshot.args"),p.args)),outputs:r.computed(()=>(console.warn("Change app.outputs to app.snapshot.outputs"),p.outputs)),ui:r.computed(()=>(console.warn("Change app.ui to app.snapshot.ui"),p.ui)),navigationState:r.computed(()=>(console.warn("Change app.navigationState to app.snapshot.navigationState"),p.navigationState))},O=Wg({get(){return{args:p.args,ui:p.ui}},autoSave:!0,onSave(v){d(v.args,v.ui)}},{outputs:w,outputErrors:S},n);return r.reactive(Object.assign(O,b,M))}var Ge;(function(t){t.assertEqual=i=>i;function e(i){}t.assertIs=e;function n(i){throw new Error}t.assertNever=n,t.arrayToEnum=i=>{const l={};for(const c of i)l[c]=c;return l},t.getValidEnumValues=i=>{const l=t.objectKeys(i).filter(d=>typeof i[i[d]]!="number"),c={};for(const d of l)c[d]=i[d];return t.objectValues(c)},t.objectValues=i=>t.objectKeys(i).map(function(l){return i[l]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const l=[];for(const c in i)Object.prototype.hasOwnProperty.call(i,c)&&l.push(c);return l},t.find=(i,l)=>{for(const c of i)if(l(c))return c},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function o(i,l=" | "){return i.map(c=>typeof c=="string"?`'${c}'`:c).join(l)}t.joinValues=o,t.jsonStringifyReplacer=(i,l)=>typeof l=="bigint"?l.toString():l})(Ge||(Ge={}));var ol;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(ol||(ol={}));const le=Ge.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),cr=t=>{switch(typeof t){case"undefined":return le.undefined;case"string":return le.string;case"number":return isNaN(t)?le.nan:le.number;case"boolean":return le.boolean;case"function":return le.function;case"bigint":return le.bigint;case"symbol":return le.symbol;case"object":return Array.isArray(t)?le.array:t===null?le.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?le.promise:typeof Map<"u"&&t instanceof Map?le.map:typeof Set<"u"&&t instanceof Set?le.set:typeof Date<"u"&&t instanceof Date?le.date:le.object;default:return le.unknown}},ee=Ge.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),qg=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:");class Wt extends Error{constructor(e){super(),this.issues=[],this.addIssue=o=>{this.issues=[...this.issues,o]},this.addIssues=(o=[])=>{this.issues=[...this.issues,...o]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const n=e||function(l){return l.message},o={_errors:[]},i=l=>{for(const c of l.issues)if(c.code==="invalid_union")c.unionErrors.map(i);else if(c.code==="invalid_return_type")i(c.returnTypeError);else if(c.code==="invalid_arguments")i(c.argumentsError);else if(c.path.length===0)o._errors.push(n(c));else{let d=o,p=0;for(;p<c.path.length;){const h=c.path[p];p===c.path.length-1?(d[h]=d[h]||{_errors:[]},d[h]._errors.push(n(c))):d[h]=d[h]||{_errors:[]},d=d[h],p++}}};return i(this),o}static assert(e){if(!(e instanceof Wt))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Ge.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){const n={},o=[];for(const i of this.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(e(i))):o.push(e(i));return{formErrors:o,fieldErrors:n}}get formErrors(){return this.flatten()}}Wt.create=t=>new Wt(t);const uo=(t,e)=>{let n;switch(t.code){case ee.invalid_type:t.received===le.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case ee.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,Ge.jsonStringifyReplacer)}`;break;case ee.unrecognized_keys:n=`Unrecognized key(s) in object: ${Ge.joinValues(t.keys,", ")}`;break;case ee.invalid_union:n="Invalid input";break;case ee.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Ge.joinValues(t.options)}`;break;case ee.invalid_enum_value:n=`Invalid enum value. Expected ${Ge.joinValues(t.options)}, received '${t.received}'`;break;case ee.invalid_arguments:n="Invalid function arguments";break;case ee.invalid_return_type:n="Invalid function return type";break;case ee.invalid_date:n="Invalid date";break;case ee.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:Ge.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case ee.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case ee.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case ee.custom:n="Invalid input";break;case ee.invalid_intersection_types:n="Intersection results could not be merged";break;case ee.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case ee.not_finite:n="Number must be finite";break;default:n=e.defaultError,Ge.assertNever(t)}return{message:n}};let nu=uo;function Kg(t){nu=t}function hs(){return nu}const fs=t=>{const{data:e,path:n,errorMaps:o,issueData:i}=t,l=[...n,...i.path||[]],c={...i,path:l};if(i.message!==void 0)return{...i,path:l,message:i.message};let d="";const p=o.filter(h=>!!h).slice().reverse();for(const h of p)d=h(c,{data:e,defaultError:d}).message;return{...i,path:l,message:d}},Yg=[];function ie(t,e){const n=hs(),o=fs({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===uo?void 0:uo].filter(i=>!!i)});t.common.issues.push(o)}class bt{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){const o=[];for(const i of n){if(i.status==="aborted")return be;i.status==="dirty"&&e.dirty(),o.push(i.value)}return{status:e.value,value:o}}static async mergeObjectAsync(e,n){const o=[];for(const i of n){const l=await i.key,c=await i.value;o.push({key:l,value:c})}return bt.mergeObjectSync(e,o)}static mergeObjectSync(e,n){const o={};for(const i of n){const{key:l,value:c}=i;if(l.status==="aborted"||c.status==="aborted")return be;l.status==="dirty"&&e.dirty(),c.status==="dirty"&&e.dirty(),l.value!=="__proto__"&&(typeof c.value<"u"||i.alwaysSet)&&(o[l.value]=c.value)}return{status:e.value,value:o}}}const be=Object.freeze({status:"aborted"}),po=t=>({status:"dirty",value:t}),Nt=t=>({status:"valid",value:t}),il=t=>t.status==="aborted",sl=t=>t.status==="dirty",Xo=t=>t.status==="valid",Jo=t=>typeof Promise<"u"&&t instanceof Promise;function ms(t,e,n,o){if(typeof e=="function"?t!==e||!o:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e.get(t)}function ru(t,e,n,o,i){if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return e.set(t,n),n}typeof SuppressedError=="function"&&SuppressedError;var fe;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(fe||(fe={}));var Qo,ei;class In{constructor(e,n,o,i){this._cachedPath=[],this.parent=e,this.data=n,this._path=o,this._key=i}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const ou=(t,e)=>{if(Xo(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new Wt(t.common.issues);return this._error=n,this._error}}};function Ve(t){if(!t)return{};const{errorMap:e,invalid_type_error:n,required_error:o,description:i}=t;if(e&&(n||o))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:(c,d)=>{var p,h;const{message:m}=t;return c.code==="invalid_enum_value"?{message:m??d.defaultError}:typeof d.data>"u"?{message:(p=m??o)!==null&&p!==void 0?p:d.defaultError}:c.code!=="invalid_type"?{message:d.defaultError}:{message:(h=m??n)!==null&&h!==void 0?h:d.defaultError}},description:i}}class Pe{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return cr(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:cr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new bt,ctx:{common:e.parent.common,data:e.data,parsedType:cr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const n=this._parse(e);if(Jo(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){const n=this._parse(e);return Promise.resolve(n)}parse(e,n){const o=this.safeParse(e,n);if(o.success)return o.data;throw o.error}safeParse(e,n){var o;const i={common:{issues:[],async:(o=n==null?void 0:n.async)!==null&&o!==void 0?o:!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:cr(e)},l=this._parseSync({data:e,path:i.path,parent:i});return ou(i,l)}async parseAsync(e,n){const o=await this.safeParseAsync(e,n);if(o.success)return o.data;throw o.error}async safeParseAsync(e,n){const o={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:cr(e)},i=this._parse({data:e,path:o.path,parent:o}),l=await(Jo(i)?i:Promise.resolve(i));return ou(o,l)}refine(e,n){const o=i=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(i):n;return this._refinement((i,l)=>{const c=e(i),d=()=>l.addIssue({code:ee.custom,...o(i)});return typeof Promise<"u"&&c instanceof Promise?c.then(p=>p?!0:(d(),!1)):c?!0:(d(),!1)})}refinement(e,n){return this._refinement((o,i)=>e(o)?!0:(i.addIssue(typeof n=="function"?n(o,i):n),!1))}_refinement(e){return new fn({schema:this,typeName:ve.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return Ln.create(this,this._def)}nullable(){return hr.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return hn.create(this,this._def)}promise(){return go.create(this,this._def)}or(e){return oi.create([this,e],this._def)}and(e){return ii.create(this,e,this._def)}transform(e){return new fn({...Ve(this._def),schema:this,typeName:ve.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new di({...Ve(this._def),innerType:this,defaultValue:n,typeName:ve.ZodDefault})}brand(){return new cl({typeName:ve.ZodBranded,type:this,...Ve(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new ui({...Ve(this._def),innerType:this,catchValue:n,typeName:ve.ZodCatch})}describe(e){const n=this.constructor;return new n({...this._def,description:e})}pipe(e){return pi.create(this,e)}readonly(){return hi.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Xg=/^c[^\s-]{8,}$/i,Jg=/^[0-9a-z]+$/,Qg=/^[0-9A-HJKMNP-TV-Z]{26}$/,ey=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,ty=/^[a-z0-9_-]{21}$/i,ny=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,ry=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,oy="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let al;const iy=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,sy=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ay=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,iu="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",ly=new RegExp(`^${iu}$`);function su(t){let e="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`),e}function cy(t){return new RegExp(`^${su(t)}$`)}function au(t){let e=`${iu}T${su(t)}`;const n=[];return n.push(t.local?"Z?":"Z"),t.offset&&n.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${n.join("|")})`,new RegExp(`^${e}$`)}function dy(t,e){return!!((e==="v4"||!e)&&iy.test(t)||(e==="v6"||!e)&&sy.test(t))}class pn extends Pe{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==le.string){const l=this._getOrReturnCtx(e);return ie(l,{code:ee.invalid_type,expected:le.string,received:l.parsedType}),be}const o=new bt;let i;for(const l of this._def.checks)if(l.kind==="min")e.data.length<l.value&&(i=this._getOrReturnCtx(e,i),ie(i,{code:ee.too_small,minimum:l.value,type:"string",inclusive:!0,exact:!1,message:l.message}),o.dirty());else if(l.kind==="max")e.data.length>l.value&&(i=this._getOrReturnCtx(e,i),ie(i,{code:ee.too_big,maximum:l.value,type:"string",inclusive:!0,exact:!1,message:l.message}),o.dirty());else if(l.kind==="length"){const c=e.data.length>l.value,d=e.data.length<l.value;(c||d)&&(i=this._getOrReturnCtx(e,i),c?ie(i,{code:ee.too_big,maximum:l.value,type:"string",inclusive:!0,exact:!0,message:l.message}):d&&ie(i,{code:ee.too_small,minimum:l.value,type:"string",inclusive:!0,exact:!0,message:l.message}),o.dirty())}else if(l.kind==="email")ry.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"email",code:ee.invalid_string,message:l.message}),o.dirty());else if(l.kind==="emoji")al||(al=new RegExp(oy,"u")),al.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"emoji",code:ee.invalid_string,message:l.message}),o.dirty());else if(l.kind==="uuid")ey.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"uuid",code:ee.invalid_string,message:l.message}),o.dirty());else if(l.kind==="nanoid")ty.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"nanoid",code:ee.invalid_string,message:l.message}),o.dirty());else if(l.kind==="cuid")Xg.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"cuid",code:ee.invalid_string,message:l.message}),o.dirty());else if(l.kind==="cuid2")Jg.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"cuid2",code:ee.invalid_string,message:l.message}),o.dirty());else if(l.kind==="ulid")Qg.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"ulid",code:ee.invalid_string,message:l.message}),o.dirty());else if(l.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),ie(i,{validation:"url",code:ee.invalid_string,message:l.message}),o.dirty()}else l.kind==="regex"?(l.regex.lastIndex=0,l.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"regex",code:ee.invalid_string,message:l.message}),o.dirty())):l.kind==="trim"?e.data=e.data.trim():l.kind==="includes"?e.data.includes(l.value,l.position)||(i=this._getOrReturnCtx(e,i),ie(i,{code:ee.invalid_string,validation:{includes:l.value,position:l.position},message:l.message}),o.dirty()):l.kind==="toLowerCase"?e.data=e.data.toLowerCase():l.kind==="toUpperCase"?e.data=e.data.toUpperCase():l.kind==="startsWith"?e.data.startsWith(l.value)||(i=this._getOrReturnCtx(e,i),ie(i,{code:ee.invalid_string,validation:{startsWith:l.value},message:l.message}),o.dirty()):l.kind==="endsWith"?e.data.endsWith(l.value)||(i=this._getOrReturnCtx(e,i),ie(i,{code:ee.invalid_string,validation:{endsWith:l.value},message:l.message}),o.dirty()):l.kind==="datetime"?au(l).test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{code:ee.invalid_string,validation:"datetime",message:l.message}),o.dirty()):l.kind==="date"?ly.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{code:ee.invalid_string,validation:"date",message:l.message}),o.dirty()):l.kind==="time"?cy(l).test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{code:ee.invalid_string,validation:"time",message:l.message}),o.dirty()):l.kind==="duration"?ny.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"duration",code:ee.invalid_string,message:l.message}),o.dirty()):l.kind==="ip"?dy(e.data,l.version)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"ip",code:ee.invalid_string,message:l.message}),o.dirty()):l.kind==="base64"?ay.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"base64",code:ee.invalid_string,message:l.message}),o.dirty()):Ge.assertNever(l);return{status:o.value,value:e.data}}_regex(e,n,o){return this.refinement(i=>e.test(i),{validation:n,code:ee.invalid_string,...fe.errToObj(o)})}_addCheck(e){return new pn({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...fe.errToObj(e)})}url(e){return this._addCheck({kind:"url",...fe.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...fe.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...fe.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...fe.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...fe.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...fe.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...fe.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...fe.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...fe.errToObj(e)})}datetime(e){var n,o;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(n=e==null?void 0:e.offset)!==null&&n!==void 0?n:!1,local:(o=e==null?void 0:e.local)!==null&&o!==void 0?o:!1,...fe.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...fe.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...fe.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...fe.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n==null?void 0:n.position,...fe.errToObj(n==null?void 0:n.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...fe.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...fe.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...fe.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...fe.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...fe.errToObj(n)})}nonempty(e){return this.min(1,fe.errToObj(e))}trim(){return new pn({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new pn({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new pn({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get minLength(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}pn.create=t=>{var e;return new pn({checks:[],typeName:ve.ZodString,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...Ve(t)})};function uy(t,e){const n=(t.toString().split(".")[1]||"").length,o=(e.toString().split(".")[1]||"").length,i=n>o?n:o,l=parseInt(t.toFixed(i).replace(".","")),c=parseInt(e.toFixed(i).replace(".",""));return l%c/Math.pow(10,i)}class dr extends Pe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==le.number){const l=this._getOrReturnCtx(e);return ie(l,{code:ee.invalid_type,expected:le.number,received:l.parsedType}),be}let o;const i=new bt;for(const l of this._def.checks)l.kind==="int"?Ge.isInteger(e.data)||(o=this._getOrReturnCtx(e,o),ie(o,{code:ee.invalid_type,expected:"integer",received:"float",message:l.message}),i.dirty()):l.kind==="min"?(l.inclusive?e.data<l.value:e.data<=l.value)&&(o=this._getOrReturnCtx(e,o),ie(o,{code:ee.too_small,minimum:l.value,type:"number",inclusive:l.inclusive,exact:!1,message:l.message}),i.dirty()):l.kind==="max"?(l.inclusive?e.data>l.value:e.data>=l.value)&&(o=this._getOrReturnCtx(e,o),ie(o,{code:ee.too_big,maximum:l.value,type:"number",inclusive:l.inclusive,exact:!1,message:l.message}),i.dirty()):l.kind==="multipleOf"?uy(e.data,l.value)!==0&&(o=this._getOrReturnCtx(e,o),ie(o,{code:ee.not_multiple_of,multipleOf:l.value,message:l.message}),i.dirty()):l.kind==="finite"?Number.isFinite(e.data)||(o=this._getOrReturnCtx(e,o),ie(o,{code:ee.not_finite,message:l.message}),i.dirty()):Ge.assertNever(l);return{status:i.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,fe.toString(n))}gt(e,n){return this.setLimit("min",e,!1,fe.toString(n))}lte(e,n){return this.setLimit("max",e,!0,fe.toString(n))}lt(e,n){return this.setLimit("max",e,!1,fe.toString(n))}setLimit(e,n,o,i){return new dr({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:o,message:fe.toString(i)}]})}_addCheck(e){return new dr({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:fe.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:fe.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:fe.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:fe.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:fe.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:fe.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:fe.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:fe.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:fe.toString(e)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&Ge.isInteger(e.value))}get isFinite(){let e=null,n=null;for(const o of this._def.checks){if(o.kind==="finite"||o.kind==="int"||o.kind==="multipleOf")return!0;o.kind==="min"?(n===null||o.value>n)&&(n=o.value):o.kind==="max"&&(e===null||o.value<e)&&(e=o.value)}return Number.isFinite(n)&&Number.isFinite(e)}}dr.create=t=>new dr({checks:[],typeName:ve.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...Ve(t)});class ur extends Pe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==le.bigint){const l=this._getOrReturnCtx(e);return ie(l,{code:ee.invalid_type,expected:le.bigint,received:l.parsedType}),be}let o;const i=new bt;for(const l of this._def.checks)l.kind==="min"?(l.inclusive?e.data<l.value:e.data<=l.value)&&(o=this._getOrReturnCtx(e,o),ie(o,{code:ee.too_small,type:"bigint",minimum:l.value,inclusive:l.inclusive,message:l.message}),i.dirty()):l.kind==="max"?(l.inclusive?e.data>l.value:e.data>=l.value)&&(o=this._getOrReturnCtx(e,o),ie(o,{code:ee.too_big,type:"bigint",maximum:l.value,inclusive:l.inclusive,message:l.message}),i.dirty()):l.kind==="multipleOf"?e.data%l.value!==BigInt(0)&&(o=this._getOrReturnCtx(e,o),ie(o,{code:ee.not_multiple_of,multipleOf:l.value,message:l.message}),i.dirty()):Ge.assertNever(l);return{status:i.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,fe.toString(n))}gt(e,n){return this.setLimit("min",e,!1,fe.toString(n))}lte(e,n){return this.setLimit("max",e,!0,fe.toString(n))}lt(e,n){return this.setLimit("max",e,!1,fe.toString(n))}setLimit(e,n,o,i){return new ur({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:o,message:fe.toString(i)}]})}_addCheck(e){return new ur({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:fe.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:fe.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:fe.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:fe.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:fe.toString(n)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}ur.create=t=>{var e;return new ur({checks:[],typeName:ve.ZodBigInt,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...Ve(t)})};class ti extends Pe{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==le.boolean){const o=this._getOrReturnCtx(e);return ie(o,{code:ee.invalid_type,expected:le.boolean,received:o.parsedType}),be}return Nt(e.data)}}ti.create=t=>new ti({typeName:ve.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...Ve(t)});class zr extends Pe{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==le.date){const l=this._getOrReturnCtx(e);return ie(l,{code:ee.invalid_type,expected:le.date,received:l.parsedType}),be}if(isNaN(e.data.getTime())){const l=this._getOrReturnCtx(e);return ie(l,{code:ee.invalid_date}),be}const o=new bt;let i;for(const l of this._def.checks)l.kind==="min"?e.data.getTime()<l.value&&(i=this._getOrReturnCtx(e,i),ie(i,{code:ee.too_small,message:l.message,inclusive:!0,exact:!1,minimum:l.value,type:"date"}),o.dirty()):l.kind==="max"?e.data.getTime()>l.value&&(i=this._getOrReturnCtx(e,i),ie(i,{code:ee.too_big,message:l.message,inclusive:!0,exact:!1,maximum:l.value,type:"date"}),o.dirty()):Ge.assertNever(l);return{status:o.value,value:new Date(e.data.getTime())}}_addCheck(e){return new zr({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:fe.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:fe.toString(n)})}get minDate(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}}zr.create=t=>new zr({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:ve.ZodDate,...Ve(t)});class gs extends Pe{_parse(e){if(this._getType(e)!==le.symbol){const o=this._getOrReturnCtx(e);return ie(o,{code:ee.invalid_type,expected:le.symbol,received:o.parsedType}),be}return Nt(e.data)}}gs.create=t=>new gs({typeName:ve.ZodSymbol,...Ve(t)});class ni extends Pe{_parse(e){if(this._getType(e)!==le.undefined){const o=this._getOrReturnCtx(e);return ie(o,{code:ee.invalid_type,expected:le.undefined,received:o.parsedType}),be}return Nt(e.data)}}ni.create=t=>new ni({typeName:ve.ZodUndefined,...Ve(t)});class ri extends Pe{_parse(e){if(this._getType(e)!==le.null){const o=this._getOrReturnCtx(e);return ie(o,{code:ee.invalid_type,expected:le.null,received:o.parsedType}),be}return Nt(e.data)}}ri.create=t=>new ri({typeName:ve.ZodNull,...Ve(t)});class ho extends Pe{constructor(){super(...arguments),this._any=!0}_parse(e){return Nt(e.data)}}ho.create=t=>new ho({typeName:ve.ZodAny,...Ve(t)});class Ur extends Pe{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Nt(e.data)}}Ur.create=t=>new Ur({typeName:ve.ZodUnknown,...Ve(t)});class qn extends Pe{_parse(e){const n=this._getOrReturnCtx(e);return ie(n,{code:ee.invalid_type,expected:le.never,received:n.parsedType}),be}}qn.create=t=>new qn({typeName:ve.ZodNever,...Ve(t)});class ys extends Pe{_parse(e){if(this._getType(e)!==le.undefined){const o=this._getOrReturnCtx(e);return ie(o,{code:ee.invalid_type,expected:le.void,received:o.parsedType}),be}return Nt(e.data)}}ys.create=t=>new ys({typeName:ve.ZodVoid,...Ve(t)});class hn extends Pe{_parse(e){const{ctx:n,status:o}=this._processInputParams(e),i=this._def;if(n.parsedType!==le.array)return ie(n,{code:ee.invalid_type,expected:le.array,received:n.parsedType}),be;if(i.exactLength!==null){const c=n.data.length>i.exactLength.value,d=n.data.length<i.exactLength.value;(c||d)&&(ie(n,{code:c?ee.too_big:ee.too_small,minimum:d?i.exactLength.value:void 0,maximum:c?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),o.dirty())}if(i.minLength!==null&&n.data.length<i.minLength.value&&(ie(n,{code:ee.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),o.dirty()),i.maxLength!==null&&n.data.length>i.maxLength.value&&(ie(n,{code:ee.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),o.dirty()),n.common.async)return Promise.all([...n.data].map((c,d)=>i.type._parseAsync(new In(n,c,n.path,d)))).then(c=>bt.mergeArray(o,c));const l=[...n.data].map((c,d)=>i.type._parseSync(new In(n,c,n.path,d)));return bt.mergeArray(o,l)}get element(){return this._def.type}min(e,n){return new hn({...this._def,minLength:{value:e,message:fe.toString(n)}})}max(e,n){return new hn({...this._def,maxLength:{value:e,message:fe.toString(n)}})}length(e,n){return new hn({...this._def,exactLength:{value:e,message:fe.toString(n)}})}nonempty(e){return this.min(1,e)}}hn.create=(t,e)=>new hn({type:t,minLength:null,maxLength:null,exactLength:null,typeName:ve.ZodArray,...Ve(e)});function fo(t){if(t instanceof nt){const e={};for(const n in t.shape){const o=t.shape[n];e[n]=Ln.create(fo(o))}return new nt({...t._def,shape:()=>e})}else return t instanceof hn?new hn({...t._def,type:fo(t.element)}):t instanceof Ln?Ln.create(fo(t.unwrap())):t instanceof hr?hr.create(fo(t.unwrap())):t instanceof Fn?Fn.create(t.items.map(e=>fo(e))):t}class nt extends Pe{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),n=Ge.objectKeys(e);return this._cached={shape:e,keys:n}}_parse(e){if(this._getType(e)!==le.object){const h=this._getOrReturnCtx(e);return ie(h,{code:ee.invalid_type,expected:le.object,received:h.parsedType}),be}const{status:o,ctx:i}=this._processInputParams(e),{shape:l,keys:c}=this._getCached(),d=[];if(!(this._def.catchall instanceof qn&&this._def.unknownKeys==="strip"))for(const h in i.data)c.includes(h)||d.push(h);const p=[];for(const h of c){const m=l[h],y=i.data[h];p.push({key:{status:"valid",value:h},value:m._parse(new In(i,y,i.path,h)),alwaysSet:h in i.data})}if(this._def.catchall instanceof qn){const h=this._def.unknownKeys;if(h==="passthrough")for(const m of d)p.push({key:{status:"valid",value:m},value:{status:"valid",value:i.data[m]}});else if(h==="strict")d.length>0&&(ie(i,{code:ee.unrecognized_keys,keys:d}),o.dirty());else if(h!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const h=this._def.catchall;for(const m of d){const y=i.data[m];p.push({key:{status:"valid",value:m},value:h._parse(new In(i,y,i.path,m)),alwaysSet:m in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const h=[];for(const m of p){const y=await m.key,b=await m.value;h.push({key:y,value:b,alwaysSet:m.alwaysSet})}return h}).then(h=>bt.mergeObjectSync(o,h)):bt.mergeObjectSync(o,p)}get shape(){return this._def.shape()}strict(e){return fe.errToObj,new nt({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,o)=>{var i,l,c,d;const p=(c=(l=(i=this._def).errorMap)===null||l===void 0?void 0:l.call(i,n,o).message)!==null&&c!==void 0?c:o.defaultError;return n.code==="unrecognized_keys"?{message:(d=fe.errToObj(e).message)!==null&&d!==void 0?d:p}:{message:p}}}:{}})}strip(){return new nt({...this._def,unknownKeys:"strip"})}passthrough(){return new nt({...this._def,unknownKeys:"passthrough"})}extend(e){return new nt({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new nt({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:ve.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new nt({...this._def,catchall:e})}pick(e){const n={};return Ge.objectKeys(e).forEach(o=>{e[o]&&this.shape[o]&&(n[o]=this.shape[o])}),new nt({...this._def,shape:()=>n})}omit(e){const n={};return Ge.objectKeys(this.shape).forEach(o=>{e[o]||(n[o]=this.shape[o])}),new nt({...this._def,shape:()=>n})}deepPartial(){return fo(this)}partial(e){const n={};return Ge.objectKeys(this.shape).forEach(o=>{const i=this.shape[o];e&&!e[o]?n[o]=i:n[o]=i.optional()}),new nt({...this._def,shape:()=>n})}required(e){const n={};return Ge.objectKeys(this.shape).forEach(o=>{if(e&&!e[o])n[o]=this.shape[o];else{let l=this.shape[o];for(;l instanceof Ln;)l=l._def.innerType;n[o]=l}}),new nt({...this._def,shape:()=>n})}keyof(){return lu(Ge.objectKeys(this.shape))}}nt.create=(t,e)=>new nt({shape:()=>t,unknownKeys:"strip",catchall:qn.create(),typeName:ve.ZodObject,...Ve(e)}),nt.strictCreate=(t,e)=>new nt({shape:()=>t,unknownKeys:"strict",catchall:qn.create(),typeName:ve.ZodObject,...Ve(e)}),nt.lazycreate=(t,e)=>new nt({shape:t,unknownKeys:"strip",catchall:qn.create(),typeName:ve.ZodObject,...Ve(e)});class oi extends Pe{_parse(e){const{ctx:n}=this._processInputParams(e),o=this._def.options;function i(l){for(const d of l)if(d.result.status==="valid")return d.result;for(const d of l)if(d.result.status==="dirty")return n.common.issues.push(...d.ctx.common.issues),d.result;const c=l.map(d=>new Wt(d.ctx.common.issues));return ie(n,{code:ee.invalid_union,unionErrors:c}),be}if(n.common.async)return Promise.all(o.map(async l=>{const c={...n,common:{...n.common,issues:[]},parent:null};return{result:await l._parseAsync({data:n.data,path:n.path,parent:c}),ctx:c}})).then(i);{let l;const c=[];for(const p of o){const h={...n,common:{...n.common,issues:[]},parent:null},m=p._parseSync({data:n.data,path:n.path,parent:h});if(m.status==="valid")return m;m.status==="dirty"&&!l&&(l={result:m,ctx:h}),h.common.issues.length&&c.push(h.common.issues)}if(l)return n.common.issues.push(...l.ctx.common.issues),l.result;const d=c.map(p=>new Wt(p));return ie(n,{code:ee.invalid_union,unionErrors:d}),be}}get options(){return this._def.options}}oi.create=(t,e)=>new oi({options:t,typeName:ve.ZodUnion,...Ve(e)});const Kn=t=>t instanceof ai?Kn(t.schema):t instanceof fn?Kn(t.innerType()):t instanceof li?[t.value]:t instanceof pr?t.options:t instanceof ci?Ge.objectValues(t.enum):t instanceof di?Kn(t._def.innerType):t instanceof ni?[void 0]:t instanceof ri?[null]:t instanceof Ln?[void 0,...Kn(t.unwrap())]:t instanceof hr?[null,...Kn(t.unwrap())]:t instanceof cl||t instanceof hi?Kn(t.unwrap()):t instanceof ui?Kn(t._def.innerType):[];class _s extends Pe{_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==le.object)return ie(n,{code:ee.invalid_type,expected:le.object,received:n.parsedType}),be;const o=this.discriminator,i=n.data[o],l=this.optionsMap.get(i);return l?n.common.async?l._parseAsync({data:n.data,path:n.path,parent:n}):l._parseSync({data:n.data,path:n.path,parent:n}):(ie(n,{code:ee.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[o]}),be)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,o){const i=new Map;for(const l of n){const c=Kn(l.shape[e]);if(!c.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const d of c){if(i.has(d))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(d)}`);i.set(d,l)}}return new _s({typeName:ve.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:i,...Ve(o)})}}function ll(t,e){const n=cr(t),o=cr(e);if(t===e)return{valid:!0,data:t};if(n===le.object&&o===le.object){const i=Ge.objectKeys(e),l=Ge.objectKeys(t).filter(d=>i.indexOf(d)!==-1),c={...t,...e};for(const d of l){const p=ll(t[d],e[d]);if(!p.valid)return{valid:!1};c[d]=p.data}return{valid:!0,data:c}}else if(n===le.array&&o===le.array){if(t.length!==e.length)return{valid:!1};const i=[];for(let l=0;l<t.length;l++){const c=t[l],d=e[l],p=ll(c,d);if(!p.valid)return{valid:!1};i.push(p.data)}return{valid:!0,data:i}}else return n===le.date&&o===le.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class ii extends Pe{_parse(e){const{status:n,ctx:o}=this._processInputParams(e),i=(l,c)=>{if(il(l)||il(c))return be;const d=ll(l.value,c.value);return d.valid?((sl(l)||sl(c))&&n.dirty(),{status:n.value,value:d.data}):(ie(o,{code:ee.invalid_intersection_types}),be)};return o.common.async?Promise.all([this._def.left._parseAsync({data:o.data,path:o.path,parent:o}),this._def.right._parseAsync({data:o.data,path:o.path,parent:o})]).then(([l,c])=>i(l,c)):i(this._def.left._parseSync({data:o.data,path:o.path,parent:o}),this._def.right._parseSync({data:o.data,path:o.path,parent:o}))}}ii.create=(t,e,n)=>new ii({left:t,right:e,typeName:ve.ZodIntersection,...Ve(n)});class Fn extends Pe{_parse(e){const{status:n,ctx:o}=this._processInputParams(e);if(o.parsedType!==le.array)return ie(o,{code:ee.invalid_type,expected:le.array,received:o.parsedType}),be;if(o.data.length<this._def.items.length)return ie(o,{code:ee.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),be;!this._def.rest&&o.data.length>this._def.items.length&&(ie(o,{code:ee.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const l=[...o.data].map((c,d)=>{const p=this._def.items[d]||this._def.rest;return p?p._parse(new In(o,c,o.path,d)):null}).filter(c=>!!c);return o.common.async?Promise.all(l).then(c=>bt.mergeArray(n,c)):bt.mergeArray(n,l)}get items(){return this._def.items}rest(e){return new Fn({...this._def,rest:e})}}Fn.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Fn({items:t,typeName:ve.ZodTuple,rest:null,...Ve(e)})};class si extends Pe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:o}=this._processInputParams(e);if(o.parsedType!==le.object)return ie(o,{code:ee.invalid_type,expected:le.object,received:o.parsedType}),be;const i=[],l=this._def.keyType,c=this._def.valueType;for(const d in o.data)i.push({key:l._parse(new In(o,d,o.path,d)),value:c._parse(new In(o,o.data[d],o.path,d)),alwaysSet:d in o.data});return o.common.async?bt.mergeObjectAsync(n,i):bt.mergeObjectSync(n,i)}get element(){return this._def.valueType}static create(e,n,o){return n instanceof Pe?new si({keyType:e,valueType:n,typeName:ve.ZodRecord,...Ve(o)}):new si({keyType:pn.create(),valueType:e,typeName:ve.ZodRecord,...Ve(n)})}}class Cs extends Pe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:o}=this._processInputParams(e);if(o.parsedType!==le.map)return ie(o,{code:ee.invalid_type,expected:le.map,received:o.parsedType}),be;const i=this._def.keyType,l=this._def.valueType,c=[...o.data.entries()].map(([d,p],h)=>({key:i._parse(new In(o,d,o.path,[h,"key"])),value:l._parse(new In(o,p,o.path,[h,"value"]))}));if(o.common.async){const d=new Map;return Promise.resolve().then(async()=>{for(const p of c){const h=await p.key,m=await p.value;if(h.status==="aborted"||m.status==="aborted")return be;(h.status==="dirty"||m.status==="dirty")&&n.dirty(),d.set(h.value,m.value)}return{status:n.value,value:d}})}else{const d=new Map;for(const p of c){const h=p.key,m=p.value;if(h.status==="aborted"||m.status==="aborted")return be;(h.status==="dirty"||m.status==="dirty")&&n.dirty(),d.set(h.value,m.value)}return{status:n.value,value:d}}}}Cs.create=(t,e,n)=>new Cs({valueType:e,keyType:t,typeName:ve.ZodMap,...Ve(n)});class Zr extends Pe{_parse(e){const{status:n,ctx:o}=this._processInputParams(e);if(o.parsedType!==le.set)return ie(o,{code:ee.invalid_type,expected:le.set,received:o.parsedType}),be;const i=this._def;i.minSize!==null&&o.data.size<i.minSize.value&&(ie(o,{code:ee.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),n.dirty()),i.maxSize!==null&&o.data.size>i.maxSize.value&&(ie(o,{code:ee.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),n.dirty());const l=this._def.valueType;function c(p){const h=new Set;for(const m of p){if(m.status==="aborted")return be;m.status==="dirty"&&n.dirty(),h.add(m.value)}return{status:n.value,value:h}}const d=[...o.data.values()].map((p,h)=>l._parse(new In(o,p,o.path,h)));return o.common.async?Promise.all(d).then(p=>c(p)):c(d)}min(e,n){return new Zr({...this._def,minSize:{value:e,message:fe.toString(n)}})}max(e,n){return new Zr({...this._def,maxSize:{value:e,message:fe.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}}Zr.create=(t,e)=>new Zr({valueType:t,minSize:null,maxSize:null,typeName:ve.ZodSet,...Ve(e)});class mo extends Pe{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==le.function)return ie(n,{code:ee.invalid_type,expected:le.function,received:n.parsedType}),be;function o(d,p){return fs({data:d,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,hs(),uo].filter(h=>!!h),issueData:{code:ee.invalid_arguments,argumentsError:p}})}function i(d,p){return fs({data:d,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,hs(),uo].filter(h=>!!h),issueData:{code:ee.invalid_return_type,returnTypeError:p}})}const l={errorMap:n.common.contextualErrorMap},c=n.data;if(this._def.returns instanceof go){const d=this;return Nt(async function(...p){const h=new Wt([]),m=await d._def.args.parseAsync(p,l).catch(w=>{throw h.addIssue(o(p,w)),h}),y=await Reflect.apply(c,this,m);return await d._def.returns._def.type.parseAsync(y,l).catch(w=>{throw h.addIssue(i(y,w)),h})})}else{const d=this;return Nt(function(...p){const h=d._def.args.safeParse(p,l);if(!h.success)throw new Wt([o(p,h.error)]);const m=Reflect.apply(c,this,h.data),y=d._def.returns.safeParse(m,l);if(!y.success)throw new Wt([i(m,y.error)]);return y.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new mo({...this._def,args:Fn.create(e).rest(Ur.create())})}returns(e){return new mo({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,n,o){return new mo({args:e||Fn.create([]).rest(Ur.create()),returns:n||Ur.create(),typeName:ve.ZodFunction,...Ve(o)})}}class ai extends Pe{get schema(){return this._def.getter()}_parse(e){const{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}ai.create=(t,e)=>new ai({getter:t,typeName:ve.ZodLazy,...Ve(e)});class li extends Pe{_parse(e){if(e.data!==this._def.value){const n=this._getOrReturnCtx(e);return ie(n,{received:n.data,code:ee.invalid_literal,expected:this._def.value}),be}return{status:"valid",value:e.data}}get value(){return this._def.value}}li.create=(t,e)=>new li({value:t,typeName:ve.ZodLiteral,...Ve(e)});function lu(t,e){return new pr({values:t,typeName:ve.ZodEnum,...Ve(e)})}class pr extends Pe{constructor(){super(...arguments),Qo.set(this,void 0)}_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),o=this._def.values;return ie(n,{expected:Ge.joinValues(o),received:n.parsedType,code:ee.invalid_type}),be}if(ms(this,Qo)||ru(this,Qo,new Set(this._def.values)),!ms(this,Qo).has(e.data)){const n=this._getOrReturnCtx(e),o=this._def.values;return ie(n,{received:n.data,code:ee.invalid_enum_value,options:o}),be}return Nt(e.data)}get options(){return this._def.values}get enum(){const e={};for(const n of this._def.values)e[n]=n;return e}get Values(){const e={};for(const n of this._def.values)e[n]=n;return e}get Enum(){const e={};for(const n of this._def.values)e[n]=n;return e}extract(e,n=this._def){return pr.create(e,{...this._def,...n})}exclude(e,n=this._def){return pr.create(this.options.filter(o=>!e.includes(o)),{...this._def,...n})}}Qo=new WeakMap,pr.create=lu;class ci extends Pe{constructor(){super(...arguments),ei.set(this,void 0)}_parse(e){const n=Ge.getValidEnumValues(this._def.values),o=this._getOrReturnCtx(e);if(o.parsedType!==le.string&&o.parsedType!==le.number){const i=Ge.objectValues(n);return ie(o,{expected:Ge.joinValues(i),received:o.parsedType,code:ee.invalid_type}),be}if(ms(this,ei)||ru(this,ei,new Set(Ge.getValidEnumValues(this._def.values))),!ms(this,ei).has(e.data)){const i=Ge.objectValues(n);return ie(o,{received:o.data,code:ee.invalid_enum_value,options:i}),be}return Nt(e.data)}get enum(){return this._def.values}}ei=new WeakMap,ci.create=(t,e)=>new ci({values:t,typeName:ve.ZodNativeEnum,...Ve(e)});class go extends Pe{unwrap(){return this._def.type}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==le.promise&&n.common.async===!1)return ie(n,{code:ee.invalid_type,expected:le.promise,received:n.parsedType}),be;const o=n.parsedType===le.promise?n.data:Promise.resolve(n.data);return Nt(o.then(i=>this._def.type.parseAsync(i,{path:n.path,errorMap:n.common.contextualErrorMap})))}}go.create=(t,e)=>new go({type:t,typeName:ve.ZodPromise,...Ve(e)});class fn extends Pe{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ve.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:n,ctx:o}=this._processInputParams(e),i=this._def.effect||null,l={addIssue:c=>{ie(o,c),c.fatal?n.abort():n.dirty()},get path(){return o.path}};if(l.addIssue=l.addIssue.bind(l),i.type==="preprocess"){const c=i.transform(o.data,l);if(o.common.async)return Promise.resolve(c).then(async d=>{if(n.value==="aborted")return be;const p=await this._def.schema._parseAsync({data:d,path:o.path,parent:o});return p.status==="aborted"?be:p.status==="dirty"||n.value==="dirty"?po(p.value):p});{if(n.value==="aborted")return be;const d=this._def.schema._parseSync({data:c,path:o.path,parent:o});return d.status==="aborted"?be:d.status==="dirty"||n.value==="dirty"?po(d.value):d}}if(i.type==="refinement"){const c=d=>{const p=i.refinement(d,l);if(o.common.async)return Promise.resolve(p);if(p instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return d};if(o.common.async===!1){const d=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});return d.status==="aborted"?be:(d.status==="dirty"&&n.dirty(),c(d.value),{status:n.value,value:d.value})}else return this._def.schema._parseAsync({data:o.data,path:o.path,parent:o}).then(d=>d.status==="aborted"?be:(d.status==="dirty"&&n.dirty(),c(d.value).then(()=>({status:n.value,value:d.value}))))}if(i.type==="transform")if(o.common.async===!1){const c=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});if(!Xo(c))return c;const d=i.transform(c.value,l);if(d instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:d}}else return this._def.schema._parseAsync({data:o.data,path:o.path,parent:o}).then(c=>Xo(c)?Promise.resolve(i.transform(c.value,l)).then(d=>({status:n.value,value:d})):c);Ge.assertNever(i)}}fn.create=(t,e,n)=>new fn({schema:t,typeName:ve.ZodEffects,effect:e,...Ve(n)}),fn.createWithPreprocess=(t,e,n)=>new fn({schema:e,effect:{type:"preprocess",transform:t},typeName:ve.ZodEffects,...Ve(n)});class Ln extends Pe{_parse(e){return this._getType(e)===le.undefined?Nt(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Ln.create=(t,e)=>new Ln({innerType:t,typeName:ve.ZodOptional,...Ve(e)});class hr extends Pe{_parse(e){return this._getType(e)===le.null?Nt(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}hr.create=(t,e)=>new hr({innerType:t,typeName:ve.ZodNullable,...Ve(e)});class di extends Pe{_parse(e){const{ctx:n}=this._processInputParams(e);let o=n.data;return n.parsedType===le.undefined&&(o=this._def.defaultValue()),this._def.innerType._parse({data:o,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}di.create=(t,e)=>new di({innerType:t,typeName:ve.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Ve(e)});class ui extends Pe{_parse(e){const{ctx:n}=this._processInputParams(e),o={...n,common:{...n.common,issues:[]}},i=this._def.innerType._parse({data:o.data,path:o.path,parent:{...o}});return Jo(i)?i.then(l=>({status:"valid",value:l.status==="valid"?l.value:this._def.catchValue({get error(){return new Wt(o.common.issues)},input:o.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Wt(o.common.issues)},input:o.data})}}removeCatch(){return this._def.innerType}}ui.create=(t,e)=>new ui({innerType:t,typeName:ve.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Ve(e)});class vs extends Pe{_parse(e){if(this._getType(e)!==le.nan){const o=this._getOrReturnCtx(e);return ie(o,{code:ee.invalid_type,expected:le.nan,received:o.parsedType}),be}return{status:"valid",value:e.data}}}vs.create=t=>new vs({typeName:ve.ZodNaN,...Ve(t)});const py=Symbol("zod_brand");class cl extends Pe{_parse(e){const{ctx:n}=this._processInputParams(e),o=n.data;return this._def.type._parse({data:o,path:n.path,parent:n})}unwrap(){return this._def.type}}class pi extends Pe{_parse(e){const{status:n,ctx:o}=this._processInputParams(e);if(o.common.async)return(async()=>{const l=await this._def.in._parseAsync({data:o.data,path:o.path,parent:o});return l.status==="aborted"?be:l.status==="dirty"?(n.dirty(),po(l.value)):this._def.out._parseAsync({data:l.value,path:o.path,parent:o})})();{const i=this._def.in._parseSync({data:o.data,path:o.path,parent:o});return i.status==="aborted"?be:i.status==="dirty"?(n.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:o.path,parent:o})}}static create(e,n){return new pi({in:e,out:n,typeName:ve.ZodPipeline})}}class hi extends Pe{_parse(e){const n=this._def.innerType._parse(e),o=i=>(Xo(i)&&(i.value=Object.freeze(i.value)),i);return Jo(n)?n.then(i=>o(i)):o(n)}unwrap(){return this._def.innerType}}hi.create=(t,e)=>new hi({innerType:t,typeName:ve.ZodReadonly,...Ve(e)});function cu(t,e={},n){return t?ho.create().superRefine((o,i)=>{var l,c;if(!t(o)){const d=typeof e=="function"?e(o):typeof e=="string"?{message:e}:e,p=(c=(l=d.fatal)!==null&&l!==void 0?l:n)!==null&&c!==void 0?c:!0,h=typeof d=="string"?{message:d}:d;i.addIssue({code:"custom",...h,fatal:p})}}):ho.create()}const hy={object:nt.lazycreate};var ve;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(ve||(ve={}));const fy=(t,e={message:`Input not instance of ${t.name}`})=>cu(n=>n instanceof t,e),du=pn.create,uu=dr.create,my=vs.create,gy=ur.create,pu=ti.create,yy=zr.create,_y=gs.create,Cy=ni.create,vy=ri.create,wy=ho.create,by=Ur.create,xy=qn.create,ky=ys.create,Ey=hn.create,Sy=nt.create,Ty=nt.strictCreate,Ny=oi.create,Vy=_s.create,Ay=ii.create,By=Fn.create,Py=si.create,Ry=Cs.create,Dy=Zr.create,Iy=mo.create,Fy=ai.create,Ly=li.create,Oy=pr.create,My=ci.create,Gy=go.create,hu=fn.create,$y=Ln.create,zy=hr.create,Uy=fn.createWithPreprocess,Zy=pi.create;var On=Object.freeze({__proto__:null,defaultErrorMap:uo,setErrorMap:Kg,getErrorMap:hs,makeIssue:fs,EMPTY_PATH:Yg,addIssueToContext:ie,ParseStatus:bt,INVALID:be,DIRTY:po,OK:Nt,isAborted:il,isDirty:sl,isValid:Xo,isAsync:Jo,get util(){return Ge},get objectUtil(){return ol},ZodParsedType:le,getParsedType:cr,ZodType:Pe,datetimeRegex:au,ZodString:pn,ZodNumber:dr,ZodBigInt:ur,ZodBoolean:ti,ZodDate:zr,ZodSymbol:gs,ZodUndefined:ni,ZodNull:ri,ZodAny:ho,ZodUnknown:Ur,ZodNever:qn,ZodVoid:ys,ZodArray:hn,ZodObject:nt,ZodUnion:oi,ZodDiscriminatedUnion:_s,ZodIntersection:ii,ZodTuple:Fn,ZodRecord:si,ZodMap:Cs,ZodSet:Zr,ZodFunction:mo,ZodLazy:ai,ZodLiteral:li,ZodEnum:pr,ZodNativeEnum:ci,ZodPromise:go,ZodEffects:fn,ZodTransformer:fn,ZodOptional:Ln,ZodNullable:hr,ZodDefault:di,ZodCatch:ui,ZodNaN:vs,BRAND:py,ZodBranded:cl,ZodPipeline:pi,ZodReadonly:hi,custom:cu,Schema:Pe,ZodSchema:Pe,late:hy,get ZodFirstPartyTypeKind(){return ve},coerce:{string:t=>pn.create({...t,coerce:!0}),number:t=>dr.create({...t,coerce:!0}),boolean:t=>ti.create({...t,coerce:!0}),bigint:t=>ur.create({...t,coerce:!0}),date:t=>zr.create({...t,coerce:!0})},any:wy,array:Ey,bigint:gy,boolean:pu,date:yy,discriminatedUnion:Vy,effect:hu,enum:Oy,function:Iy,instanceof:fy,intersection:Ay,lazy:Fy,literal:Ly,map:Ry,nan:my,nativeEnum:My,never:xy,null:vy,nullable:zy,number:uu,object:Sy,oboolean:()=>pu().optional(),onumber:()=>uu().optional(),optional:$y,ostring:()=>du().optional(),pipeline:Zy,preprocess:Uy,promise:Gy,record:Py,set:Dy,strictObject:Ty,string:du,symbol:_y,transformer:hu,tuple:By,undefined:Cy,union:Ny,unknown:by,void:ky,NEVER:be,ZodIssueCode:ee,quotelessJson:qg,ZodError:Wt});function Wy(t){throw new Error("Unexpected object: "+t)}const jy=-2147483648,fu=-9007199254740991n,Hy=NaN,qy=NaN,Ky=null,Yy=null;function mu(t,e){switch(e){case"Int":return t===jy;case"Long":return t===Number(fu)||t===fu;case"Float":return t===Hy;case"Double":return t===qy;case"String":return t===Ky;case"Bytes":return t===Yy;default:throw Error(`unsupported data type: ${e}`)}}function Xy(t,e){const n=Math.floor(e/8),o=1<<7-e%8;return(t[n]&o)>0}function dl(t){const{type:e,name:n,domain:o}=t;return{type:e,name:n,...o&&{domain:o}}}function gu(t){return t.map(dl)}function ws(t,e){switch(t.type){case"column":return{type:"column",column:e(t.column)};case"inner":case"full":return{type:t.type,entries:t.entries.map(n=>ws(n,e))};case"outer":return{type:"outer",primary:ws(t.primary,e),secondary:t.secondary.map(n=>ws(n,e))};default:Wy(t)}}On.object({__isRef:On.literal(!0).describe("Crucial marker for the block dependency tree reconstruction"),blockId:On.string().describe("Upstream block id"),name:On.string().describe("Name of the output provided to the upstream block's output context")}).describe("Universal reference type, allowing to set block connections. It is crucial that {@link __isRef} is present and equal to true, internal logic relies on this marker to build block dependency trees.").strict().readonly();function Jy(t){if(t&&typeof globalThis.getPlatforma=="function")return globalThis.getPlatforma(t);if(typeof globalThis.platforma<"u")return globalThis.platforma;throw new Error("Can't get platforma instance.")}const Qy=On.object({type:On.string(),importance:On.number().optional(),id:On.string().optional(),label:On.string()});On.array(Qy);const e_="1.14.1";function yu(){return Jy({sdkVersion:e_})}function t_(t){if(typeof globalThis.getEnvironmentValue=="function")return globalThis.getEnvironmentValue(t)}function yo(t){return!!t&&typeof t.children<"u"}function fr(t){return yo(t)?t.groupId:t.colId}function _u(t,e,n){const o=(c,d)=>{const p=c.children.map(fr),h=T._includes(p,fr(d)),m=T._last(c.children),y=m&&fr(m)!==fr(d);return h&&y};if(!yo(t))return!0;const i=t,l=n;if(o(i,l))return i.children.push(l),!0;if(i.groupId===e){const c=i.children.map(fr);if(!T._includes(c,fr(l)))return i.children.push(l),!0}for(let c=i.children.length-1;c>=0&&!_u(i.children[c],e,n);c--);return!1}function n_(t){const e=(i,l)=>yo(i)&&yo(l)&&fr(i)===fr(l),n=(i,l)=>{if(!yo(l))return i;const c=i,d=l;return d.children&&d.groupId&&_u(c,d.groupId,d.children[0])||d.children.forEach(p=>n(c,p)),c},o=[];for(let i=1;i<=t.length;i++){const l=t[i-1],c=t[i];e(l,c)?t[i]=n(l,c):o.push(l)}return o}var r_=class extends T.BeanStub{constructor(){super(...arguments),this.beanName="toolPanelColDefService"}wireBeans(t){this.columnModel=t.columnModel}createColumnTree(t){const e=[],n=(i,l)=>{if(yo(i)){const c=i,d=typeof c.groupId<"u"?c.groupId:c.headerName,p=new T.AgProvidedColumnGroup(c,d,!1,l),h=[];return c.children.forEach(m=>{const y=n(m,l+1);y&&h.push(y)}),p.setChildren(h),p}else{const c=i,d=c.colId?c.colId:c.field,p=this.columnModel.getColDefCol(d);return p||e.push(c),p}},o=[];return t.forEach(i=>{const l=n(i,0);l&&o.push(l)}),e.length>0&&T._warnOnce("unable to find grid columns for the supplied colDef(s):",e),o}syncLayoutWithGrid(t){const e=this.getLeafPathTrees(),n=n_(e);t(n)}getLeafPathTrees(){const t=(o,i)=>{let l;if(T.isProvidedColumnGroup(o))if(o.isPadding())l=i;else{const d=Object.assign({},o.getColGroupDef());d.groupId=o.getGroupId(),d.children=[i],l=d}else{const d=Object.assign({},o.getColDef());d.colId=o.getColId(),l=d}const c=o.getOriginalParent();return c?t(c,l):l};return this.columnModel.getCols().filter(o=>{const i=o.getColDef();return o.isPrimary()&&!i.showRowGroup}).map(o=>t(o,o.getColDef()))}};function o_(t){var e;return((e=t.sideBarService)==null?void 0:e.getSideBarComp().isDisplayed())??!1}function i_(t,e){var n;(n=t.sideBarService)==null||n.getSideBarComp().setDisplayed(e)}function s_(t,e){var n;(n=t.sideBarService)==null||n.getSideBarComp().setSideBarPosition(e)}function a_(t,e){var n;(n=t.sideBarService)==null||n.getSideBarComp().openToolPanel(e,"api")}function l_(t){var e;(e=t.sideBarService)==null||e.getSideBarComp().close("api")}function c_(t){var e;return((e=t.sideBarService)==null?void 0:e.getSideBarComp().openedItem())??null}function d_(t){var e;(e=t.sideBarService)==null||e.getSideBarComp().refresh()}function u_(t){var e;return((e=t.sideBarService)==null?void 0:e.getSideBarComp().isToolPanelShowing())??!1}function p_(t,e){var o;const n=(o=t.sideBarService)==null?void 0:o.getSideBarComp().getToolPanelInstance(e);return T._unwrapUserComp(n)}function h_(t){var e;return(e=t.sideBarService)==null?void 0:e.getSideBarComp().getDef()}var f_=class extends T.Component{constructor(t){super(),this.eToggleButton=T.RefPlaceholder,this.eIconWrapper=T.RefPlaceholder,this.eLabel=T.RefPlaceholder,this.toolPanelDef=t}getToolPanelId(){return this.toolPanelDef.id}postConstruct(){const t=this.createTemplate();this.setTemplate(t,[]),this.setLabel(),this.setIcon(),this.addManagedElementListeners(this.eToggleButton,{click:this.onButtonPressed.bind(this)}),this.eToggleButton.setAttribute("id",`ag-${this.getCompId()}-button`)}createTemplate(){return`<div class="ag-side-button" role="presentation">
4
4
  <button type="button" data-ref="eToggleButton" tabindex="-1" role="tab" aria-expanded="false" class="ag-button ag-side-button-button">
5
5
  <div data-ref="eIconWrapper" class="ag-side-button-icon-wrapper" aria-hidden="true"></div>
6
6
  <span data-ref="eLabel" class="ag-side-button-label"></span>
7
7
  </button>
8
- </div>`}setLabel(){const t=this.localeService.getLocaleTextFunc(),e=this.toolPanelDef,n=t(e.labelKey,e.labelDefault);this.eLabel.innerText=n}setIcon(){this.eIconWrapper.insertAdjacentElement("afterbegin",T._createIconNoSpan(this.toolPanelDef.iconKey,this.gos))}onButtonPressed(){this.dispatchLocalEvent({type:"toggleButtonClicked"})}setSelected(t){this.addOrRemoveCssClass("ag-selected",t),T._setAriaExpanded(this.eToggleButton,t)}getButtonElement(){return this.eToggleButton}},p_=class extends T.Component{constructor(){super('<div class="ag-side-buttons" role="tablist"></div>'),this.buttonComps=[]}wireBeans(t){this.focusService=t.focusService,this.visibleColsService=t.visibleColsService}postConstruct(){this.addManagedElementListeners(this.getFocusableElement(),{keydown:this.handleKeyDown.bind(this)})}handleKeyDown(t){if(!(t.key!==T.KeyCode.TAB||!t.shiftKey)){if(this.focusService.focusNextGridCoreContainer(!0)){t.preventDefault();return}T._stopPropagationForAgGrid(t)}}setActiveButton(t){this.buttonComps.forEach(e=>{e.setSelected(t===e.getToolPanelId())})}addButtonComp(t){const e=this.createBean(new u_(t));return this.buttonComps.push(e),this.appendChild(e),e.addEventListener("toggleButtonClicked",()=>{this.dispatchLocalEvent({type:"sideBarButtonClicked",toolPanelId:t.id})}),e}clearButtons(){this.buttonComps=this.destroyBeans(this.buttonComps),T._clearElement(this.getGui()),super.destroy()}destroy(){this.clearButtons(),super.destroy()}},h_={selector:"AG-SIDE-BAR-BUTTONS",component:p_},_u={id:"columns",labelDefault:"Columns",labelKey:"columns",iconKey:"columns",toolPanel:"agColumnsToolPanel"},vu={id:"filters",labelDefault:"Filters",labelKey:"filters",iconKey:"filter",toolPanel:"agFiltersToolPanel"},dl={columns:_u,filters:vu};function ul(t){if(!t)return;if(t===!0)return{toolPanels:[_u,vu],defaultToolPanel:"columns"};if(typeof t=="string")return ul([t]);if(Array.isArray(t)){const n=[];return t.forEach(o=>{const i=dl[o];if(!i){Cu(o);return}n.push(i)}),n.length===0?void 0:{toolPanels:n,defaultToolPanel:n[0].id}}return{toolPanels:f_(t.toolPanels),defaultToolPanel:t.defaultToolPanel,hiddenByDefault:t.hiddenByDefault,position:t.position}}function Cu(t){T._warnOnce(`the key ${t} is not a valid key for specifying a tool panel, valid keys are: ${Object.keys(dl).join(",")}`)}function f_(t){const e=[];return t&&t.forEach(n=>{let o=null;if(typeof n=="string"){const i=dl[n];if(!i){Cu(n);return}o=i}else o=n;e.push(o)}),e}var m_=class extends T.Component{constructor(){super('<div class="ag-tool-panel-horizontal-resize"></div>'),this.minWidth=100,this.maxWidth=null}wireBeans(t){this.horizontalResizeService=t.horizontalResizeService}setElementToResize(t){this.elementToResize=t}postConstruct(){const t=this.horizontalResizeService.addResizeBar({eResizeBar:this.getGui(),dragStartPixels:1,onResizeStart:this.onResizeStart.bind(this),onResizing:this.onResizing.bind(this),onResizeEnd:this.onResizeEnd.bind(this)});this.addDestroyFunc(t),this.setInverted(this.gos.get("enableRtl"))}dispatchResizeEvent(t,e,n){this.eventService.dispatchEvent({type:"toolPanelSizeChanged",width:n,started:t,ended:e})}onResizeStart(){this.startingWidth=this.elementToResize.offsetWidth,this.dispatchResizeEvent(!0,!1,this.startingWidth)}onResizeEnd(t){return this.onResizing(t,!0)}onResizing(t,e=!1){const n=this.inverted?-1:1;let o=Math.max(this.minWidth,Math.floor(this.startingWidth-t*n));this.maxWidth!=null&&(o=Math.min(this.maxWidth,o)),this.elementToResize.style.width=`${o}px`,this.dispatchResizeEvent(!1,e,o)}setInverted(t){this.inverted=t}setMaxWidth(t){this.maxWidth=t}setMinWidth(t){t!=null?this.minWidth=t:this.minWidth=100}},g_=class extends T.Component{wireBeans(t){this.userComponentFactory=t.userComponentFactory}constructor(){super('<div class="ag-tool-panel-wrapper" role="tabpanel"/>')}postConstruct(){const t=this.getGui(),e=this.resizeBar=this.createManagedBean(new m_);t.setAttribute("id",`ag-${this.getCompId()}`),e.setElementToResize(t),this.appendChild(e)}getToolPanelId(){return this.toolPanelId}setToolPanelDef(t,e){const{id:n,minWidth:o,maxWidth:i,width:l}=t;this.toolPanelId=n,this.width=l;const c=this.userComponentFactory.getToolPanelCompDetails(t,e),d=c.newAgStackInstance();if(this.params=c.params,d==null){T._warnOnce(`error processing tool panel component ${n}. You need to specify 'toolPanel'`);return}d.then(this.setToolPanelComponent.bind(this)),o!=null&&this.resizeBar.setMinWidth(o),i!=null&&this.resizeBar.setMaxWidth(i)}setToolPanelComponent(t){this.toolPanelCompInstance=t,this.appendChild(t.getGui()),this.addDestroyFunc(()=>{this.destroyBean(t)}),this.width&&(this.getGui().style.width=`${this.width}px`)}getToolPanelInstance(){return this.toolPanelCompInstance}setResizerSizerSide(t){const e=this.gos.get("enableRtl"),n=t==="left",o=e?n:!n;this.resizeBar.setInverted(o)}refresh(){var t;(t=this.toolPanelCompInstance)==null||t.refresh(this.params)}},y_=class extends T.Component{constructor(){super(`<div class="ag-side-bar ag-unselectable">
8
+ </div>`}setLabel(){const t=this.localeService.getLocaleTextFunc(),e=this.toolPanelDef,n=t(e.labelKey,e.labelDefault);this.eLabel.innerText=n}setIcon(){this.eIconWrapper.insertAdjacentElement("afterbegin",T._createIconNoSpan(this.toolPanelDef.iconKey,this.gos))}onButtonPressed(){this.dispatchLocalEvent({type:"toggleButtonClicked"})}setSelected(t){this.addOrRemoveCssClass("ag-selected",t),T._setAriaExpanded(this.eToggleButton,t)}getButtonElement(){return this.eToggleButton}},m_=class extends T.Component{constructor(){super('<div class="ag-side-buttons" role="tablist"></div>'),this.buttonComps=[]}wireBeans(t){this.focusService=t.focusService,this.visibleColsService=t.visibleColsService}postConstruct(){this.addManagedElementListeners(this.getFocusableElement(),{keydown:this.handleKeyDown.bind(this)})}handleKeyDown(t){if(!(t.key!==T.KeyCode.TAB||!t.shiftKey)){if(this.focusService.focusNextGridCoreContainer(!0)){t.preventDefault();return}T._stopPropagationForAgGrid(t)}}setActiveButton(t){this.buttonComps.forEach(e=>{e.setSelected(t===e.getToolPanelId())})}addButtonComp(t){const e=this.createBean(new f_(t));return this.buttonComps.push(e),this.appendChild(e),e.addEventListener("toggleButtonClicked",()=>{this.dispatchLocalEvent({type:"sideBarButtonClicked",toolPanelId:t.id})}),e}clearButtons(){this.buttonComps=this.destroyBeans(this.buttonComps),T._clearElement(this.getGui()),super.destroy()}destroy(){this.clearButtons(),super.destroy()}},g_={selector:"AG-SIDE-BAR-BUTTONS",component:m_},Cu={id:"columns",labelDefault:"Columns",labelKey:"columns",iconKey:"columns",toolPanel:"agColumnsToolPanel"},vu={id:"filters",labelDefault:"Filters",labelKey:"filters",iconKey:"filter",toolPanel:"agFiltersToolPanel"},ul={columns:Cu,filters:vu};function pl(t){if(!t)return;if(t===!0)return{toolPanels:[Cu,vu],defaultToolPanel:"columns"};if(typeof t=="string")return pl([t]);if(Array.isArray(t)){const n=[];return t.forEach(o=>{const i=ul[o];if(!i){wu(o);return}n.push(i)}),n.length===0?void 0:{toolPanels:n,defaultToolPanel:n[0].id}}return{toolPanels:y_(t.toolPanels),defaultToolPanel:t.defaultToolPanel,hiddenByDefault:t.hiddenByDefault,position:t.position}}function wu(t){T._warnOnce(`the key ${t} is not a valid key for specifying a tool panel, valid keys are: ${Object.keys(ul).join(",")}`)}function y_(t){const e=[];return t&&t.forEach(n=>{let o=null;if(typeof n=="string"){const i=ul[n];if(!i){wu(n);return}o=i}else o=n;e.push(o)}),e}var __=class extends T.Component{constructor(){super('<div class="ag-tool-panel-horizontal-resize"></div>'),this.minWidth=100,this.maxWidth=null}wireBeans(t){this.horizontalResizeService=t.horizontalResizeService}setElementToResize(t){this.elementToResize=t}postConstruct(){const t=this.horizontalResizeService.addResizeBar({eResizeBar:this.getGui(),dragStartPixels:1,onResizeStart:this.onResizeStart.bind(this),onResizing:this.onResizing.bind(this),onResizeEnd:this.onResizeEnd.bind(this)});this.addDestroyFunc(t),this.setInverted(this.gos.get("enableRtl"))}dispatchResizeEvent(t,e,n){this.eventService.dispatchEvent({type:"toolPanelSizeChanged",width:n,started:t,ended:e})}onResizeStart(){this.startingWidth=this.elementToResize.offsetWidth,this.dispatchResizeEvent(!0,!1,this.startingWidth)}onResizeEnd(t){return this.onResizing(t,!0)}onResizing(t,e=!1){const n=this.inverted?-1:1;let o=Math.max(this.minWidth,Math.floor(this.startingWidth-t*n));this.maxWidth!=null&&(o=Math.min(this.maxWidth,o)),this.elementToResize.style.width=`${o}px`,this.dispatchResizeEvent(!1,e,o)}setInverted(t){this.inverted=t}setMaxWidth(t){this.maxWidth=t}setMinWidth(t){t!=null?this.minWidth=t:this.minWidth=100}},C_=class extends T.Component{wireBeans(t){this.userComponentFactory=t.userComponentFactory}constructor(){super('<div class="ag-tool-panel-wrapper" role="tabpanel"/>')}postConstruct(){const t=this.getGui(),e=this.resizeBar=this.createManagedBean(new __);t.setAttribute("id",`ag-${this.getCompId()}`),e.setElementToResize(t),this.appendChild(e)}getToolPanelId(){return this.toolPanelId}setToolPanelDef(t,e){const{id:n,minWidth:o,maxWidth:i,width:l}=t;this.toolPanelId=n,this.width=l;const c=this.userComponentFactory.getToolPanelCompDetails(t,e),d=c.newAgStackInstance();if(this.params=c.params,d==null){T._warnOnce(`error processing tool panel component ${n}. You need to specify 'toolPanel'`);return}d.then(this.setToolPanelComponent.bind(this)),o!=null&&this.resizeBar.setMinWidth(o),i!=null&&this.resizeBar.setMaxWidth(i)}setToolPanelComponent(t){this.toolPanelCompInstance=t,this.appendChild(t.getGui()),this.addDestroyFunc(()=>{this.destroyBean(t)}),this.width&&(this.getGui().style.width=`${this.width}px`)}getToolPanelInstance(){return this.toolPanelCompInstance}setResizerSizerSide(t){const e=this.gos.get("enableRtl"),n=t==="left",o=e?n:!n;this.resizeBar.setInverted(o)}refresh(){var t;(t=this.toolPanelCompInstance)==null||t.refresh(this.params)}},v_=class extends T.Component{constructor(){super(`<div class="ag-side-bar ag-unselectable">
9
9
  <ag-side-bar-buttons data-ref="sideBarButtons"></ag-side-bar-buttons>
10
- </div>`,[h_]),this.sideBarButtons=T.RefPlaceholder,this.toolPanelWrappers=[]}wireBeans(t){this.focusService=t.focusService,this.filterManager=t.filterManager,this.sideBarService=t.sideBarService}postConstruct(){this.sideBarButtons.addEventListener("sideBarButtonClicked",this.onToolPanelButtonClicked.bind(this));const{sideBar:t}=this.gos.get("initialState")??{};this.setSideBarDef({sideBarDef:ul(this.gos.get("sideBar")),sideBarState:t}),this.addManagedPropertyListener("sideBar",this.onSideBarUpdated.bind(this)),this.sideBarService.registerSideBarComp(this);const e=this.getFocusableElement();this.createManagedBean(new T.ManagedFocusFeature(e,{onTabKeyDown:this.onTabKeyDown.bind(this),handleKeyDown:this.handleKeyDown.bind(this)})),T._addFocusableContainerListener(this,e,this.focusService)}onTabKeyDown(t){if(t.defaultPrevented)return;const{focusService:e,sideBarButtons:n}=this,o=this.getGui(),i=n.getGui(),l=T._getActiveDomElement(this.gos),c=o.querySelector(".ag-tool-panel-wrapper:not(.ag-hidden)"),d=t.target;if(!c)return e.focusNextGridCoreContainer(t.shiftKey,!0);if(i.contains(l)){e.focusInto(c,t.shiftKey)&&t.preventDefault();return}if(!t.shiftKey)return;let p=null;c.contains(l)?p=this.focusService.findNextFocusableElement(c,void 0,!0):e.isTargetUnderManagedComponent(c,d)&&t.shiftKey&&(p=this.focusService.findFocusableElementBeforeTabGuard(c,d)),p||(p=i.querySelector(".ag-selected button")),p&&p!==t.target&&(t.preventDefault(),p.focus())}handleKeyDown(t){const e=T._getActiveDomElement(this.gos);if(!this.sideBarButtons.getGui().contains(e))return;const n=this.sideBarButtons.getGui(),o=Array.prototype.slice.call(n.querySelectorAll(".ag-side-button")),i=o.findIndex(d=>d.contains(e));let l=null;switch(t.key){case T.KeyCode.LEFT:case T.KeyCode.UP:l=Math.max(0,i-1);break;case T.KeyCode.RIGHT:case T.KeyCode.DOWN:l=Math.min(i+1,o.length-1);break}if(l===null)return;const c=o[l].querySelector("button");c&&(c.focus(),t.preventDefault())}onToolPanelButtonClicked(t){const e=t.toolPanelId;this.openedItem()===e?this.openToolPanel(void 0,"sideBarButtonClicked"):this.openToolPanel(e,"sideBarButtonClicked")}clearDownUi(){this.sideBarButtons.clearButtons(),this.destroyToolPanelWrappers()}setSideBarDef({sideBarDef:t,sideBarState:e,existingToolPanelWrappers:n}){if(this.setDisplayed(!1),this.sideBar=t,this.sideBar&&this.sideBar.toolPanels){const o=this.sideBar.toolPanels;if(this.createToolPanelsAndSideButtons(o,e,n),!this.toolPanelWrappers.length)return;const i=e?e.visible:!this.sideBar.hiddenByDefault;if(this.setDisplayed(i),this.setSideBarPosition(e?e.position:this.sideBar.position),i)if(e){const{openToolPanel:l}=e;l&&this.openToolPanel(l,"sideBarInitializing")}else this.openToolPanel(this.sideBar.defaultToolPanel,"sideBarInitializing")}}getDef(){return this.sideBar}setSideBarPosition(t){t||(t="right"),this.position=t;const e=t==="left",n=e?"right":"left";return this.addOrRemoveCssClass("ag-side-bar-left",e),this.addOrRemoveCssClass("ag-side-bar-right",!e),this.toolPanelWrappers.forEach(o=>{o.setResizerSizerSide(n)}),this.dispatchSideBarUpdated(),this}setDisplayed(t,e){super.setDisplayed(t,e),this.dispatchSideBarUpdated()}getState(){const t={};return this.toolPanelWrappers.forEach(e=>{var n,o;t[e.getToolPanelId()]=(o=(n=e.getToolPanelInstance())==null?void 0:n.getState)==null?void 0:o.call(n)}),{visible:this.isDisplayed(),position:this.position,openToolPanel:this.openedItem(),toolPanels:t}}createToolPanelsAndSideButtons(t,e,n){var o;for(const i of t)this.createToolPanelAndSideButton(i,(o=e==null?void 0:e.toolPanels)==null?void 0:o[i.id],n==null?void 0:n[i.id])}validateDef(t){var e;if(t.id==null)return T._warnOnce("please review all your toolPanel components, it seems like at least one of them doesn't have an id"),!1;if(t.toolPanel==="agColumnsToolPanel"&&!this.gos.assertModuleRegistered(T.ModuleNames.ColumnsToolPanelModule,"Column Tool Panel"))return!1;if(t.toolPanel==="agFiltersToolPanel"){if(!this.gos.assertModuleRegistered(T.ModuleNames.FiltersToolPanelModule,"Filters Tool Panel"))return!1;if((e=this.filterManager)!=null&&e.isAdvancedFilterEnabled())return T._warnOnce("Advanced Filter does not work with Filters Tool Panel. Filters Tool Panel has been disabled."),!1}return!0}createToolPanelAndSideButton(t,e,n){if(!this.validateDef(t))return;const o=this.sideBarButtons.addButtonComp(t);let i;n?i=n:(i=this.createBean(new g_),i.setToolPanelDef(t,{initialState:e,onStateUpdated:()=>this.dispatchSideBarUpdated()})),i.setDisplayed(!1);const l=i.getGui();this.appendChild(l),this.toolPanelWrappers.push(i),T._setAriaControls(o.getButtonElement(),l)}refresh(){this.toolPanelWrappers.forEach(t=>t.refresh())}openToolPanel(t,e="api"){const n=this.openedItem();if(n===t)return;this.toolPanelWrappers.forEach(l=>{const c=t===l.getToolPanelId();l.setDisplayed(c)});const o=this.openedItem();n!==o&&(this.sideBarButtons.setActiveButton(t),this.raiseToolPanelVisibleEvent(t,n??void 0,e))}getToolPanelInstance(t){const e=this.toolPanelWrappers.filter(n=>n.getToolPanelId()===t)[0];if(!e){T._warnOnce(`unable to lookup Tool Panel as invalid key supplied: ${t}`);return}return e.getToolPanelInstance()}raiseToolPanelVisibleEvent(t,e,n){const o=!!t&&!!e;e&&this.eventService.dispatchEvent({type:"toolPanelVisibleChanged",source:n,key:e,visible:!1,switchingToolPanel:o}),t&&this.eventService.dispatchEvent({type:"toolPanelVisibleChanged",source:n,key:t,visible:!0,switchingToolPanel:o})}close(t="api"){this.openToolPanel(void 0,t)}isToolPanelShowing(){return!!this.openedItem()}openedItem(){let t=null;return this.toolPanelWrappers.forEach(e=>{e.isDisplayed()&&(t=e.getToolPanelId())}),t}onSideBarUpdated(){var n;const t=ul(this.gos.get("sideBar")),e={};t&&this.sideBar&&((n=t.toolPanels)==null||n.forEach(o=>{var h,m;const{id:i}=o;if(!i)return;const l=(h=this.sideBar.toolPanels)==null?void 0:h.find(y=>y.id===i);if(!l||o.toolPanel!==l.toolPanel)return;const c=this.toolPanelWrappers.find(y=>y.getToolPanelId()===i);if(!c)return;const d=this.gos.addGridCommonParams({...o.toolPanelParams??{},onStateUpdated:()=>this.dispatchSideBarUpdated()});((m=c.getToolPanelInstance())==null?void 0:m.refresh(d))===!0&&(this.toolPanelWrappers=this.toolPanelWrappers.filter(y=>y!==c),T._removeFromParent(c.getGui()),e[i]=c)})),this.clearDownUi(),this.setSideBarDef({sideBarDef:t,existingToolPanelWrappers:e})}dispatchSideBarUpdated(){this.eventService.dispatchEvent({type:"sideBarUpdated"})}destroyToolPanelWrappers(){this.toolPanelWrappers.forEach(t=>{T._removeFromParent(t.getGui()),this.destroyBean(t)}),this.toolPanelWrappers.length=0}destroy(){this.destroyToolPanelWrappers(),super.destroy()}},__={selector:"AG-SIDE-BAR",component:y_},v_=class extends T.BeanStub{constructor(){super(...arguments),this.beanName="sideBarService"}registerSideBarComp(t){this.sideBarComp=t}getSideBarComp(){return this.sideBarComp}getSideBarSelector(){return __}},pl="32.3.3",wu=T._defineModule({version:pl,moduleName:`${T.ModuleNames.SideBarModule}-core`,beans:[e_,v_],dependantModules:[Me.EnterpriseCoreModule]}),C_=T._defineModule({version:pl,moduleName:`${T.ModuleNames.SideBarModule}-api`,apiFunctions:{isSideBarVisible:t_,setSideBarVisible:n_,setSideBarPosition:r_,openToolPanel:o_,closeToolPanel:i_,getOpenedToolPanel:s_,refreshToolPanel:a_,isToolPanelShowing:l_,getToolPanelInstance:c_,getSideBar:d_},dependantModules:[wu]}),hl=T._defineModule({version:pl,moduleName:T.ModuleNames.SideBarModule,dependantModules:[wu,C_]}),w_={sum:"Sum",first:"First",last:"Last",min:"Min",max:"Max",count:"Count",avg:"Average"},b_=class extends T.BeanStub{constructor(){super(...arguments),this.beanName="aggFuncService",this.aggFuncsMap={},this.initialised=!1}postConstruct(){this.init()}init(){this.initialised||(this.initialiseWithDefaultAggregations(),this.addAggFuncs(this.gos.get("aggFuncs")))}initialiseWithDefaultAggregations(){const t=this.aggFuncsMap;t.sum=x_,t.first=k_,t.last=E_,t.min=S_,t.max=T_,t.count=N_,t.avg=V_,this.initialised=!0}isAggFuncPossible(t,e){const n=this.getFuncNames(t),o=T._includes(n,e),i=T._exists(this.aggFuncsMap[e]);return o&&i}getDefaultFuncLabel(t){return w_[t]??t}getDefaultAggFunc(t){const e=t.getColDef().defaultAggFunc;if(T._exists(e)&&this.isAggFuncPossible(t,e))return e;if(this.isAggFuncPossible(t,"sum"))return"sum";const n=this.getFuncNames(t);return T._existsAndNotEmpty(n)?n[0]:null}addAggFuncs(t){this.init(),T._iterateObject(t,(e,n)=>{this.aggFuncsMap[e]=n})}getAggFunc(t){return this.init(),this.aggFuncsMap[t]}getFuncNames(t){const e=t.getColDef().allowedAggFuncs;return e??Object.keys(this.aggFuncsMap).sort()}clear(){this.aggFuncsMap={}}};function x_(t){const{values:e}=t;let n=null;for(let o=0;o<e.length;o++){const i=e[o];typeof i=="number"?n===null?n=i:n+=typeof n=="number"?i:BigInt(i):typeof i=="bigint"&&(n===null?n=i:n=(typeof n=="bigint"?n:BigInt(n))+i)}return n}function k_(t){return t.values.length>0?t.values[0]:null}function E_(t){return t.values.length>0?T._last(t.values):null}function S_(t){const{values:e}=t;let n=null;for(let o=0;o<e.length;o++){const i=e[o];(typeof i=="number"||typeof i=="bigint")&&(n===null||n>i)&&(n=i)}return n}function T_(t){const{values:e}=t;let n=null;for(let o=0;o<e.length;o++){const i=e[o];(typeof i=="number"||typeof i=="bigint")&&(n===null||n<i)&&(n=i)}return n}function N_(t){var i,l;const{values:e}=t;let n=0;for(let c=0;c<e.length;c++){const d=e[c];n+=d!=null&&typeof d.value=="number"?d.value:1}const o=(l=(i=t.rowNode)==null?void 0:i.aggData)==null?void 0:l[t.column.getColId()];return o&&o.value===n?o:{value:n,toString:function(){return this.value.toString()},toNumber:function(){return this.value}}}function V_(t){var c,d,p;const{values:e}=t;let n=0,o=0;for(let h=0;h<e.length;h++){const m=e[h];let y=null;typeof m=="number"||typeof m=="bigint"?(y=m,o++):m!=null&&(typeof m.value=="number"||typeof m.value=="bigint")&&typeof m.count=="number"&&(y=m.value*(typeof m.value=="number"?m.count:BigInt(m.count)),o+=m.count),typeof y=="number"?n+=typeof n=="number"?y:BigInt(y):typeof y=="bigint"&&(n=(typeof n=="bigint"?n:BigInt(n))+y)}let i=null;o>0&&(i=n/(typeof n=="number"?o:BigInt(o)));const l=(p=(c=t.rowNode)==null?void 0:c.aggData)==null?void 0:p[(d=t.column)==null?void 0:d.getColId()];return l&&l.count===o&&l.value===i?l:{count:o,value:i,toString:function(){return typeof this.value=="number"||typeof this.value=="bigint"?this.value.toString():""},toNumber:function(){return this.value}}}var A_=class extends T.BeanStub{constructor(){super(...arguments),this.beanName="aggregationStage"}wireBeans(t){this.columnModel=t.columnModel,this.aggFuncService=t.aggFuncService,this.funcColsService=t.funcColsService,this.pivotResultColsService=t.pivotResultColsService,this.valueService=t.valueService}execute(t){const e=T._missingOrEmpty(this.funcColsService.getValueColumns()),n=!this.gos.getCallback("getGroupRowAgg"),o=t.changedPath&&t.changedPath.isActive();if(e&&n&&o)return;const i=this.createAggDetails(t);this.recursivelyCreateAggData(i)}createAggDetails(t){const e=this.columnModel.isPivotActive(),n=this.funcColsService.getValueColumns(),o=e?this.funcColsService.getPivotColumns():[];return{alwaysAggregateAtRootLevel:this.gos.get("alwaysAggregateAtRootLevel"),groupIncludeTotalFooter:!!T._getGrandTotalRow(this.gos),changedPath:t.changedPath,valueColumns:n,pivotColumns:o,filteredOnly:!this.isSuppressAggFilteredOnly(),userAggFunc:this.gos.getCallback("getGroupRowAgg")}}isSuppressAggFilteredOnly(){return T._getGroupAggFiltering(this.gos)!==void 0||this.gos.get("suppressAggFilteredOnly")}recursivelyCreateAggData(t){const e=n=>{if(!n.hasChildren()){n.aggData&&n.setAggData(null);return}if(n.level===-1&&!t.groupIncludeTotalFooter){const l=!this.columnModel.isPivotMode();if(!t.alwaysAggregateAtRootLevel&&l){n.setAggData(null);return}}this.aggregateRowNode(n,t)};t.changedPath.forEachChangedNodeDepthFirst(e,!0)}aggregateRowNode(t,e){const n=e.valueColumns.length===0,o=e.pivotColumns.length===0;let i;e.userAggFunc?i=e.userAggFunc({nodes:t.childrenAfterFilter}):n?i=null:o?i=this.aggregateRowNodeUsingValuesOnly(t,e):i=this.aggregateRowNodeUsingValuesAndPivot(t),t.setAggData(i),t.sibling&&t.sibling.setAggData(i)}aggregateRowNodeUsingValuesAndPivot(t){var i;const e={},n=((i=this.pivotResultColsService.getPivotResultCols())==null?void 0:i.list)??[];let o=!0;for(let l=0;l<n.length;l++){const c=n[l],d=c.getColDef();if(d.pivotTotalColumnIds!=null){o=!1;continue}const p=d.pivotKeys??[];let h;t.leafGroup?h=this.getValuesFromMappedSet(t.childrenMapped,p,d.pivotValueColumn):h=this.getValuesPivotNonLeaf(t,d.colId),e[d.colId]=this.aggregateValues(h,d.pivotValueColumn.getAggFunc(),d.pivotValueColumn,t,c)}if(!o)for(let l=0;l<n.length;l++){const c=n[l],d=c.getColDef();if(d.pivotTotalColumnIds==null||!d.pivotTotalColumnIds.length)continue;const p=d.pivotTotalColumnIds.map(h=>e[h]);e[d.colId]=this.aggregateValues(p,d.pivotValueColumn.getAggFunc(),d.pivotValueColumn,t,c)}return e}aggregateRowNodeUsingValuesOnly(t,e){const n={},o=e.changedPath.isActive()?e.changedPath.getValueColumnsForNode(t,e.valueColumns):e.valueColumns,i=e.changedPath.isActive()?e.changedPath.getNotValueColumnsForNode(t,e.valueColumns):null,l=this.getValuesNormal(t,o,e.filteredOnly),c=t.aggData;return o.forEach((d,p)=>{n[d.getId()]=this.aggregateValues(l[p],d.getAggFunc(),d,t)}),i&&c&&i.forEach(d=>{n[d.getId()]=c[d.getId()]}),n}getValuesPivotNonLeaf(t,e){return t.childrenAfterFilter.map(n=>n.aggData[e])}getValuesFromMappedSet(t,e,n){let o=t;for(let i=0;i<e.length;i++){const l=e[i];o=o?o[l]:null}return o?o.map(i=>this.valueService.getValue(n,i)):[]}getValuesNormal(t,e,n){const o=[];e.forEach(()=>o.push([]));const i=e.length,l=n?t.childrenAfterFilter:t.childrenAfterGroup,c=l.length;for(let d=0;d<c;d++){const p=l[d];for(let h=0;h<i;h++){const m=e[h],y=this.valueService.getValue(m,p);o[h].push(y)}}return o}aggregateValues(t,e,n,o,i){const l=typeof e=="string"?this.aggFuncService.getAggFunc(e):e;if(typeof l!="function")return T._errorOnce(`unrecognised aggregation function ${e}`),null;const c=l,d=this.gos.addGridCommonParams({values:t,column:n,colDef:n?n.getColDef():void 0,pivotResultColumn:i,rowNode:o,data:o?o.data:void 0});return c(d)}},B_=class extends T.BeanStub{constructor(){super(...arguments),this.beanName="autoColService"}wireBeans(t){this.columnModel=t.columnModel,this.columnNameService=t.columnNameService,this.columnFactory=t.columnFactory}createAutoCols(t){const e=[],n=this.gos.get("treeData");let o=T._isGroupMultiAutoColumn(this.gos);return n&&o&&(T._warnOnce('you cannot mix groupDisplayType = "multipleColumns" with treeData, only one column can be used to display groups when doing tree data'),o=!1),o?t.forEach((i,l)=>{e.push(this.createOneAutoCol(i,l))}):e.push(this.createOneAutoCol()),e}updateAutoCols(t,e){t.forEach((n,o)=>this.updateOneAutoCol(n,o,e))}createOneAutoCol(t,e){let n;t?n=`${T.GROUP_AUTO_COLUMN_ID}-${t.getId()}`:n=T.GROUP_AUTO_COLUMN_ID;const o=this.createAutoColDef(n,t,e);o.colId=n;const i=new T.AgColumn(o,null,n,!0);return this.createBean(i),i}updateOneAutoCol(t,e,n){const o=t.getColDef(),i=typeof o.showRowGroup=="string"?o.showRowGroup:void 0,l=i!=null?this.columnModel.getColDefCol(i):void 0,c=this.createAutoColDef(t.getId(),l??void 0,e);t.setColDef(c,null,n),this.columnFactory.applyColumnState(t,c,n)}createAutoColDef(t,e,n){let o=this.createBaseColDef(e);const i=this.gos.get("autoGroupColumnDef");T._mergeDeep(o,i),o=this.columnFactory.addColumnDefaultAndTypes(o,t),this.gos.get("treeData")||T._missing(o.field)&&T._missing(o.valueGetter)&&T._missing(o.filterValueGetter)&&o.filter!=="agGroupColumnFilter"&&(o.filter=!1),n&&n>0&&(o.headerCheckboxSelection=!1);const l=T._isColumnsSortingCoupledToGroup(this.gos),c=o.valueGetter||o.field!=null;return l&&!c&&(o.sortIndex=void 0,o.initialSort=void 0),o}createBaseColDef(t){const e=this.gos.get("autoGroupColumnDef"),o={headerName:this.localeService.getLocaleTextFunc()("group","Group")};if(e&&(e.cellRenderer||e.cellRendererSelector)||(o.cellRenderer="agGroupCellRenderer"),t){const l=t.getColDef();Object.assign(o,{headerName:this.columnNameService.getDisplayNameForColumn(t,"header"),headerValueGetter:l.headerValueGetter}),l.cellRenderer&&Object.assign(o,{cellRendererParams:{innerRenderer:l.cellRenderer,innerRendererParams:l.cellRendererParams}}),o.showRowGroup=t.getColId()}else o.showRowGroup=!0;return o}},P_=class extends Me.PillDragComp{constructor(t,e,n,o,i){super(e,n,i,`
10
+ </div>`,[g_]),this.sideBarButtons=T.RefPlaceholder,this.toolPanelWrappers=[]}wireBeans(t){this.focusService=t.focusService,this.filterManager=t.filterManager,this.sideBarService=t.sideBarService}postConstruct(){this.sideBarButtons.addEventListener("sideBarButtonClicked",this.onToolPanelButtonClicked.bind(this));const{sideBar:t}=this.gos.get("initialState")??{};this.setSideBarDef({sideBarDef:pl(this.gos.get("sideBar")),sideBarState:t}),this.addManagedPropertyListener("sideBar",this.onSideBarUpdated.bind(this)),this.sideBarService.registerSideBarComp(this);const e=this.getFocusableElement();this.createManagedBean(new T.ManagedFocusFeature(e,{onTabKeyDown:this.onTabKeyDown.bind(this),handleKeyDown:this.handleKeyDown.bind(this)})),T._addFocusableContainerListener(this,e,this.focusService)}onTabKeyDown(t){if(t.defaultPrevented)return;const{focusService:e,sideBarButtons:n}=this,o=this.getGui(),i=n.getGui(),l=T._getActiveDomElement(this.gos),c=o.querySelector(".ag-tool-panel-wrapper:not(.ag-hidden)"),d=t.target;if(!c)return e.focusNextGridCoreContainer(t.shiftKey,!0);if(i.contains(l)){e.focusInto(c,t.shiftKey)&&t.preventDefault();return}if(!t.shiftKey)return;let p=null;c.contains(l)?p=this.focusService.findNextFocusableElement(c,void 0,!0):e.isTargetUnderManagedComponent(c,d)&&t.shiftKey&&(p=this.focusService.findFocusableElementBeforeTabGuard(c,d)),p||(p=i.querySelector(".ag-selected button")),p&&p!==t.target&&(t.preventDefault(),p.focus())}handleKeyDown(t){const e=T._getActiveDomElement(this.gos);if(!this.sideBarButtons.getGui().contains(e))return;const n=this.sideBarButtons.getGui(),o=Array.prototype.slice.call(n.querySelectorAll(".ag-side-button")),i=o.findIndex(d=>d.contains(e));let l=null;switch(t.key){case T.KeyCode.LEFT:case T.KeyCode.UP:l=Math.max(0,i-1);break;case T.KeyCode.RIGHT:case T.KeyCode.DOWN:l=Math.min(i+1,o.length-1);break}if(l===null)return;const c=o[l].querySelector("button");c&&(c.focus(),t.preventDefault())}onToolPanelButtonClicked(t){const e=t.toolPanelId;this.openedItem()===e?this.openToolPanel(void 0,"sideBarButtonClicked"):this.openToolPanel(e,"sideBarButtonClicked")}clearDownUi(){this.sideBarButtons.clearButtons(),this.destroyToolPanelWrappers()}setSideBarDef({sideBarDef:t,sideBarState:e,existingToolPanelWrappers:n}){if(this.setDisplayed(!1),this.sideBar=t,this.sideBar&&this.sideBar.toolPanels){const o=this.sideBar.toolPanels;if(this.createToolPanelsAndSideButtons(o,e,n),!this.toolPanelWrappers.length)return;const i=e?e.visible:!this.sideBar.hiddenByDefault;if(this.setDisplayed(i),this.setSideBarPosition(e?e.position:this.sideBar.position),i)if(e){const{openToolPanel:l}=e;l&&this.openToolPanel(l,"sideBarInitializing")}else this.openToolPanel(this.sideBar.defaultToolPanel,"sideBarInitializing")}}getDef(){return this.sideBar}setSideBarPosition(t){t||(t="right"),this.position=t;const e=t==="left",n=e?"right":"left";return this.addOrRemoveCssClass("ag-side-bar-left",e),this.addOrRemoveCssClass("ag-side-bar-right",!e),this.toolPanelWrappers.forEach(o=>{o.setResizerSizerSide(n)}),this.dispatchSideBarUpdated(),this}setDisplayed(t,e){super.setDisplayed(t,e),this.dispatchSideBarUpdated()}getState(){const t={};return this.toolPanelWrappers.forEach(e=>{var n,o;t[e.getToolPanelId()]=(o=(n=e.getToolPanelInstance())==null?void 0:n.getState)==null?void 0:o.call(n)}),{visible:this.isDisplayed(),position:this.position,openToolPanel:this.openedItem(),toolPanels:t}}createToolPanelsAndSideButtons(t,e,n){var o;for(const i of t)this.createToolPanelAndSideButton(i,(o=e==null?void 0:e.toolPanels)==null?void 0:o[i.id],n==null?void 0:n[i.id])}validateDef(t){var e;if(t.id==null)return T._warnOnce("please review all your toolPanel components, it seems like at least one of them doesn't have an id"),!1;if(t.toolPanel==="agColumnsToolPanel"&&!this.gos.assertModuleRegistered(T.ModuleNames.ColumnsToolPanelModule,"Column Tool Panel"))return!1;if(t.toolPanel==="agFiltersToolPanel"){if(!this.gos.assertModuleRegistered(T.ModuleNames.FiltersToolPanelModule,"Filters Tool Panel"))return!1;if((e=this.filterManager)!=null&&e.isAdvancedFilterEnabled())return T._warnOnce("Advanced Filter does not work with Filters Tool Panel. Filters Tool Panel has been disabled."),!1}return!0}createToolPanelAndSideButton(t,e,n){if(!this.validateDef(t))return;const o=this.sideBarButtons.addButtonComp(t);let i;n?i=n:(i=this.createBean(new C_),i.setToolPanelDef(t,{initialState:e,onStateUpdated:()=>this.dispatchSideBarUpdated()})),i.setDisplayed(!1);const l=i.getGui();this.appendChild(l),this.toolPanelWrappers.push(i),T._setAriaControls(o.getButtonElement(),l)}refresh(){this.toolPanelWrappers.forEach(t=>t.refresh())}openToolPanel(t,e="api"){const n=this.openedItem();if(n===t)return;this.toolPanelWrappers.forEach(l=>{const c=t===l.getToolPanelId();l.setDisplayed(c)});const o=this.openedItem();n!==o&&(this.sideBarButtons.setActiveButton(t),this.raiseToolPanelVisibleEvent(t,n??void 0,e))}getToolPanelInstance(t){const e=this.toolPanelWrappers.filter(n=>n.getToolPanelId()===t)[0];if(!e){T._warnOnce(`unable to lookup Tool Panel as invalid key supplied: ${t}`);return}return e.getToolPanelInstance()}raiseToolPanelVisibleEvent(t,e,n){const o=!!t&&!!e;e&&this.eventService.dispatchEvent({type:"toolPanelVisibleChanged",source:n,key:e,visible:!1,switchingToolPanel:o}),t&&this.eventService.dispatchEvent({type:"toolPanelVisibleChanged",source:n,key:t,visible:!0,switchingToolPanel:o})}close(t="api"){this.openToolPanel(void 0,t)}isToolPanelShowing(){return!!this.openedItem()}openedItem(){let t=null;return this.toolPanelWrappers.forEach(e=>{e.isDisplayed()&&(t=e.getToolPanelId())}),t}onSideBarUpdated(){var n;const t=pl(this.gos.get("sideBar")),e={};t&&this.sideBar&&((n=t.toolPanels)==null||n.forEach(o=>{var h,m;const{id:i}=o;if(!i)return;const l=(h=this.sideBar.toolPanels)==null?void 0:h.find(y=>y.id===i);if(!l||o.toolPanel!==l.toolPanel)return;const c=this.toolPanelWrappers.find(y=>y.getToolPanelId()===i);if(!c)return;const d=this.gos.addGridCommonParams({...o.toolPanelParams??{},onStateUpdated:()=>this.dispatchSideBarUpdated()});((m=c.getToolPanelInstance())==null?void 0:m.refresh(d))===!0&&(this.toolPanelWrappers=this.toolPanelWrappers.filter(y=>y!==c),T._removeFromParent(c.getGui()),e[i]=c)})),this.clearDownUi(),this.setSideBarDef({sideBarDef:t,existingToolPanelWrappers:e})}dispatchSideBarUpdated(){this.eventService.dispatchEvent({type:"sideBarUpdated"})}destroyToolPanelWrappers(){this.toolPanelWrappers.forEach(t=>{T._removeFromParent(t.getGui()),this.destroyBean(t)}),this.toolPanelWrappers.length=0}destroy(){this.destroyToolPanelWrappers(),super.destroy()}},w_={selector:"AG-SIDE-BAR",component:v_},b_=class extends T.BeanStub{constructor(){super(...arguments),this.beanName="sideBarService"}registerSideBarComp(t){this.sideBarComp=t}getSideBarComp(){return this.sideBarComp}getSideBarSelector(){return w_}},hl="32.3.3",bu=T._defineModule({version:hl,moduleName:`${T.ModuleNames.SideBarModule}-core`,beans:[r_,b_],dependantModules:[Me.EnterpriseCoreModule]}),x_=T._defineModule({version:hl,moduleName:`${T.ModuleNames.SideBarModule}-api`,apiFunctions:{isSideBarVisible:o_,setSideBarVisible:i_,setSideBarPosition:s_,openToolPanel:a_,closeToolPanel:l_,getOpenedToolPanel:c_,refreshToolPanel:d_,isToolPanelShowing:u_,getToolPanelInstance:p_,getSideBar:h_},dependantModules:[bu]}),fl=T._defineModule({version:hl,moduleName:T.ModuleNames.SideBarModule,dependantModules:[bu,x_]}),k_={sum:"Sum",first:"First",last:"Last",min:"Min",max:"Max",count:"Count",avg:"Average"},E_=class extends T.BeanStub{constructor(){super(...arguments),this.beanName="aggFuncService",this.aggFuncsMap={},this.initialised=!1}postConstruct(){this.init()}init(){this.initialised||(this.initialiseWithDefaultAggregations(),this.addAggFuncs(this.gos.get("aggFuncs")))}initialiseWithDefaultAggregations(){const t=this.aggFuncsMap;t.sum=S_,t.first=T_,t.last=N_,t.min=V_,t.max=A_,t.count=B_,t.avg=P_,this.initialised=!0}isAggFuncPossible(t,e){const n=this.getFuncNames(t),o=T._includes(n,e),i=T._exists(this.aggFuncsMap[e]);return o&&i}getDefaultFuncLabel(t){return k_[t]??t}getDefaultAggFunc(t){const e=t.getColDef().defaultAggFunc;if(T._exists(e)&&this.isAggFuncPossible(t,e))return e;if(this.isAggFuncPossible(t,"sum"))return"sum";const n=this.getFuncNames(t);return T._existsAndNotEmpty(n)?n[0]:null}addAggFuncs(t){this.init(),T._iterateObject(t,(e,n)=>{this.aggFuncsMap[e]=n})}getAggFunc(t){return this.init(),this.aggFuncsMap[t]}getFuncNames(t){const e=t.getColDef().allowedAggFuncs;return e??Object.keys(this.aggFuncsMap).sort()}clear(){this.aggFuncsMap={}}};function S_(t){const{values:e}=t;let n=null;for(let o=0;o<e.length;o++){const i=e[o];typeof i=="number"?n===null?n=i:n+=typeof n=="number"?i:BigInt(i):typeof i=="bigint"&&(n===null?n=i:n=(typeof n=="bigint"?n:BigInt(n))+i)}return n}function T_(t){return t.values.length>0?t.values[0]:null}function N_(t){return t.values.length>0?T._last(t.values):null}function V_(t){const{values:e}=t;let n=null;for(let o=0;o<e.length;o++){const i=e[o];(typeof i=="number"||typeof i=="bigint")&&(n===null||n>i)&&(n=i)}return n}function A_(t){const{values:e}=t;let n=null;for(let o=0;o<e.length;o++){const i=e[o];(typeof i=="number"||typeof i=="bigint")&&(n===null||n<i)&&(n=i)}return n}function B_(t){var i,l;const{values:e}=t;let n=0;for(let c=0;c<e.length;c++){const d=e[c];n+=d!=null&&typeof d.value=="number"?d.value:1}const o=(l=(i=t.rowNode)==null?void 0:i.aggData)==null?void 0:l[t.column.getColId()];return o&&o.value===n?o:{value:n,toString:function(){return this.value.toString()},toNumber:function(){return this.value}}}function P_(t){var c,d,p;const{values:e}=t;let n=0,o=0;for(let h=0;h<e.length;h++){const m=e[h];let y=null;typeof m=="number"||typeof m=="bigint"?(y=m,o++):m!=null&&(typeof m.value=="number"||typeof m.value=="bigint")&&typeof m.count=="number"&&(y=m.value*(typeof m.value=="number"?m.count:BigInt(m.count)),o+=m.count),typeof y=="number"?n+=typeof n=="number"?y:BigInt(y):typeof y=="bigint"&&(n=(typeof n=="bigint"?n:BigInt(n))+y)}let i=null;o>0&&(i=n/(typeof n=="number"?o:BigInt(o)));const l=(p=(c=t.rowNode)==null?void 0:c.aggData)==null?void 0:p[(d=t.column)==null?void 0:d.getColId()];return l&&l.count===o&&l.value===i?l:{count:o,value:i,toString:function(){return typeof this.value=="number"||typeof this.value=="bigint"?this.value.toString():""},toNumber:function(){return this.value}}}var R_=class extends T.BeanStub{constructor(){super(...arguments),this.beanName="aggregationStage"}wireBeans(t){this.columnModel=t.columnModel,this.aggFuncService=t.aggFuncService,this.funcColsService=t.funcColsService,this.pivotResultColsService=t.pivotResultColsService,this.valueService=t.valueService}execute(t){const e=T._missingOrEmpty(this.funcColsService.getValueColumns()),n=!this.gos.getCallback("getGroupRowAgg"),o=t.changedPath&&t.changedPath.isActive();if(e&&n&&o)return;const i=this.createAggDetails(t);this.recursivelyCreateAggData(i)}createAggDetails(t){const e=this.columnModel.isPivotActive(),n=this.funcColsService.getValueColumns(),o=e?this.funcColsService.getPivotColumns():[];return{alwaysAggregateAtRootLevel:this.gos.get("alwaysAggregateAtRootLevel"),groupIncludeTotalFooter:!!T._getGrandTotalRow(this.gos),changedPath:t.changedPath,valueColumns:n,pivotColumns:o,filteredOnly:!this.isSuppressAggFilteredOnly(),userAggFunc:this.gos.getCallback("getGroupRowAgg")}}isSuppressAggFilteredOnly(){return T._getGroupAggFiltering(this.gos)!==void 0||this.gos.get("suppressAggFilteredOnly")}recursivelyCreateAggData(t){const e=n=>{if(!n.hasChildren()){n.aggData&&n.setAggData(null);return}if(n.level===-1&&!t.groupIncludeTotalFooter){const l=!this.columnModel.isPivotMode();if(!t.alwaysAggregateAtRootLevel&&l){n.setAggData(null);return}}this.aggregateRowNode(n,t)};t.changedPath.forEachChangedNodeDepthFirst(e,!0)}aggregateRowNode(t,e){const n=e.valueColumns.length===0,o=e.pivotColumns.length===0;let i;e.userAggFunc?i=e.userAggFunc({nodes:t.childrenAfterFilter}):n?i=null:o?i=this.aggregateRowNodeUsingValuesOnly(t,e):i=this.aggregateRowNodeUsingValuesAndPivot(t),t.setAggData(i),t.sibling&&t.sibling.setAggData(i)}aggregateRowNodeUsingValuesAndPivot(t){var i;const e={},n=((i=this.pivotResultColsService.getPivotResultCols())==null?void 0:i.list)??[];let o=!0;for(let l=0;l<n.length;l++){const c=n[l],d=c.getColDef();if(d.pivotTotalColumnIds!=null){o=!1;continue}const p=d.pivotKeys??[];let h;t.leafGroup?h=this.getValuesFromMappedSet(t.childrenMapped,p,d.pivotValueColumn):h=this.getValuesPivotNonLeaf(t,d.colId),e[d.colId]=this.aggregateValues(h,d.pivotValueColumn.getAggFunc(),d.pivotValueColumn,t,c)}if(!o)for(let l=0;l<n.length;l++){const c=n[l],d=c.getColDef();if(d.pivotTotalColumnIds==null||!d.pivotTotalColumnIds.length)continue;const p=d.pivotTotalColumnIds.map(h=>e[h]);e[d.colId]=this.aggregateValues(p,d.pivotValueColumn.getAggFunc(),d.pivotValueColumn,t,c)}return e}aggregateRowNodeUsingValuesOnly(t,e){const n={},o=e.changedPath.isActive()?e.changedPath.getValueColumnsForNode(t,e.valueColumns):e.valueColumns,i=e.changedPath.isActive()?e.changedPath.getNotValueColumnsForNode(t,e.valueColumns):null,l=this.getValuesNormal(t,o,e.filteredOnly),c=t.aggData;return o.forEach((d,p)=>{n[d.getId()]=this.aggregateValues(l[p],d.getAggFunc(),d,t)}),i&&c&&i.forEach(d=>{n[d.getId()]=c[d.getId()]}),n}getValuesPivotNonLeaf(t,e){return t.childrenAfterFilter.map(n=>n.aggData[e])}getValuesFromMappedSet(t,e,n){let o=t;for(let i=0;i<e.length;i++){const l=e[i];o=o?o[l]:null}return o?o.map(i=>this.valueService.getValue(n,i)):[]}getValuesNormal(t,e,n){const o=[];e.forEach(()=>o.push([]));const i=e.length,l=n?t.childrenAfterFilter:t.childrenAfterGroup,c=l.length;for(let d=0;d<c;d++){const p=l[d];for(let h=0;h<i;h++){const m=e[h],y=this.valueService.getValue(m,p);o[h].push(y)}}return o}aggregateValues(t,e,n,o,i){const l=typeof e=="string"?this.aggFuncService.getAggFunc(e):e;if(typeof l!="function")return T._errorOnce(`unrecognised aggregation function ${e}`),null;const c=l,d=this.gos.addGridCommonParams({values:t,column:n,colDef:n?n.getColDef():void 0,pivotResultColumn:i,rowNode:o,data:o?o.data:void 0});return c(d)}},D_=class extends T.BeanStub{constructor(){super(...arguments),this.beanName="autoColService"}wireBeans(t){this.columnModel=t.columnModel,this.columnNameService=t.columnNameService,this.columnFactory=t.columnFactory}createAutoCols(t){const e=[],n=this.gos.get("treeData");let o=T._isGroupMultiAutoColumn(this.gos);return n&&o&&(T._warnOnce('you cannot mix groupDisplayType = "multipleColumns" with treeData, only one column can be used to display groups when doing tree data'),o=!1),o?t.forEach((i,l)=>{e.push(this.createOneAutoCol(i,l))}):e.push(this.createOneAutoCol()),e}updateAutoCols(t,e){t.forEach((n,o)=>this.updateOneAutoCol(n,o,e))}createOneAutoCol(t,e){let n;t?n=`${T.GROUP_AUTO_COLUMN_ID}-${t.getId()}`:n=T.GROUP_AUTO_COLUMN_ID;const o=this.createAutoColDef(n,t,e);o.colId=n;const i=new T.AgColumn(o,null,n,!0);return this.createBean(i),i}updateOneAutoCol(t,e,n){const o=t.getColDef(),i=typeof o.showRowGroup=="string"?o.showRowGroup:void 0,l=i!=null?this.columnModel.getColDefCol(i):void 0,c=this.createAutoColDef(t.getId(),l??void 0,e);t.setColDef(c,null,n),this.columnFactory.applyColumnState(t,c,n)}createAutoColDef(t,e,n){let o=this.createBaseColDef(e);const i=this.gos.get("autoGroupColumnDef");T._mergeDeep(o,i),o=this.columnFactory.addColumnDefaultAndTypes(o,t),this.gos.get("treeData")||T._missing(o.field)&&T._missing(o.valueGetter)&&T._missing(o.filterValueGetter)&&o.filter!=="agGroupColumnFilter"&&(o.filter=!1),n&&n>0&&(o.headerCheckboxSelection=!1);const l=T._isColumnsSortingCoupledToGroup(this.gos),c=o.valueGetter||o.field!=null;return l&&!c&&(o.sortIndex=void 0,o.initialSort=void 0),o}createBaseColDef(t){const e=this.gos.get("autoGroupColumnDef"),o={headerName:this.localeService.getLocaleTextFunc()("group","Group")};if(e&&(e.cellRenderer||e.cellRendererSelector)||(o.cellRenderer="agGroupCellRenderer"),t){const l=t.getColDef();Object.assign(o,{headerName:this.columnNameService.getDisplayNameForColumn(t,"header"),headerValueGetter:l.headerValueGetter}),l.cellRenderer&&Object.assign(o,{cellRendererParams:{innerRenderer:l.cellRenderer,innerRendererParams:l.cellRendererParams}}),o.showRowGroup=t.getColId()}else o.showRowGroup=!0;return o}},I_=class extends Me.PillDragComp{constructor(t,e,n,o,i){super(e,n,i,`
11
11
  <span role="option">
12
12
  <span data-ref="eDragHandle" class="ag-drag-handle ag-column-drop-cell-drag-handle" role="presentation"></span>
13
13
  <span data-ref="eText" class="ag-column-drop-cell-text" aria-hidden="true"></span>
14
14
  <ag-sort-indicator data-ref="eSortIndicator"></ag-sort-indicator>
15
15
  <span data-ref="eButton" class="ag-column-drop-cell-button" role="presentation"></span>
16
16
  </span>
17
- `,[T.SortIndicatorSelector]),this.column=t,this.dropZonePurpose=o,this.eSortIndicator=T.RefPlaceholder,this.popupShowing=!1}wireBeans(t){super.wireBeans(t),this.popupService=t.popupService,this.sortController=t.sortController,this.columnModel=t.columnModel,this.columnNameService=t.columnNameService,this.funcColsService=t.funcColsService,this.aggFuncService=t.aggFuncService}postConstruct(){this.displayName=this.columnNameService.getDisplayNameForColumn(this.column,"columnDrop"),super.postConstruct(),this.setupSort(),this.addManagedEventListeners({sortChanged:()=>{this.setupAria()}}),this.isGroupingZone()&&this.addManagedPropertyListener("groupLockGroupColumns",()=>{this.refreshRemove(),this.refreshDraggable(),this.setupAria()})}getItem(){return this.column}getDisplayName(){return this.displayName}getTooltip(){return this.column.getColDef().headerTooltip}addAdditionalAriaInstructions(t,e){const n=this.gos.get("rowGroupPanelSuppressSort"),o=this.gos.get("functionsReadOnly");if(this.isAggregationZone()&&!o){const i=e("ariaDropZoneColumnValueItemDescription","Press ENTER to change the aggregation type");t.push(i)}if(this.isGroupingZone()&&this.column.isSortable()&&!n){const i=e("ariaDropZoneColumnGroupItemDescription","Press ENTER to sort");t.push(i)}super.addAdditionalAriaInstructions(t,e)}isDraggable(){return this.isReadOnly()}isRemovable(){return this.isReadOnly()}isReadOnly(){return!this.isGroupingAndLocked()&&!this.gos.get("functionsReadOnly")}getAriaDisplayName(){const t=this.localeService.getLocaleTextFunc(),{name:e,aggFuncName:n}=this.getColumnAndAggFuncName(),o=t("ariaDropZoneColumnComponentAggFuncSeparator"," of "),i={asc:t("ariaDropZoneColumnComponentSortAscending","ascending"),desc:t("ariaDropZoneColumnComponentSortDescending","descending")},l=this.column.getSort(),c=this.gos.get("rowGroupPanelSuppressSort");return[n&&`${n}${o}`,e,this.isGroupingZone()&&!c&&l&&`, ${i[l]}`].filter(d=>!!d).join("")}getColumnAndAggFuncName(){const t=this.displayName;let e="";if(this.isAggregationZone()){const n=this.column.getAggFunc(),o=typeof n=="string"?n:"agg";e=this.localeService.getLocaleTextFunc()(o,o)}return{name:t,aggFuncName:e}}setupSort(){const t=this.column.isSortable(),e=this.isGroupingZone();if(!(!t||!e)&&!this.gos.get("rowGroupPanelSuppressSort")){this.eSortIndicator.setupSort(this.column,!0);const n=o=>{o.preventDefault();const l=this.gos.get("multiSortKey")==="ctrl"?o.ctrlKey||o.metaKey:o.shiftKey;this.sortController.progressSort(this.column,l,"uiColumnSorted")};this.addGuiEventListener("click",n),this.addGuiEventListener("keydown",o=>{o.key===T.KeyCode.ENTER&&this.isGroupingZone()&&n(o)})}}getDefaultIconName(){return"hide"}createGetDragItem(){const{column:t}=this;return()=>{const e={};return e[t.getId()]=t.isVisible(),{columns:[t],visibleState:e}}}setupComponents(){super.setupComponents(),this.isAggregationZone()&&!this.gos.get("functionsReadOnly")&&this.addGuiEventListener("click",this.onShowAggFuncSelection.bind(this))}onKeyDown(t){super.onKeyDown(t),t.key===T.KeyCode.ENTER&&this.isAggregationZone()&&!this.gos.get("functionsReadOnly")&&(t.preventDefault(),this.onShowAggFuncSelection())}getDisplayValue(){const{name:t,aggFuncName:e}=this.getColumnAndAggFuncName();return this.isAggregationZone()?`${e}(${t})`:t}onShowAggFuncSelection(){if(this.popupShowing)return;this.popupShowing=!0;const t=new Me.VirtualList({cssIdentifier:"select-agg-func"}),e=this.aggFuncService.getFuncNames(this.column),n=this.getGui(),o=t.getGui();t.setModel({getRow:function(m){return e[m]},getRowCount:function(){return e.length}}),this.createBean(t);const i=T._loadTemplate('<div class="ag-select-agg-func-popup"></div>');i.style.top="0px",i.style.left="0px",i.appendChild(o),i.style.width=`${n.clientWidth}px`;const[l]=this.addManagedElementListeners(i,{focusout:m=>{!i.contains(m.relatedTarget)&&p&&p.hideFunc()}}),c=m=>{this.destroyBean(t),this.popupShowing=!1,(m==null?void 0:m.key)==="Escape"&&n.focus(),l&&l()},d=this.localeService.getLocaleTextFunc(),p=this.popupService.addPopup({modal:!0,eChild:i,closeOnEsc:!0,closedCallback:c,ariaLabel:d("ariaLabelAggregationFunction","Aggregation Function")});p&&t.setComponentCreator(this.createAggSelect.bind(this,p.hideFunc)),t.addGuiEventListener("keydown",m=>{if(m.key===T.KeyCode.ENTER||m.key===T.KeyCode.SPACE){const y=t.getLastFocusedRow();if(y==null)return;const b=t.getComponentAt(y);b&&b.selectItem()}}),this.popupService.positionPopupByComponent({type:"aggFuncSelect",eventSource:n,ePopup:i,keepWithinBounds:!0,column:this.column,position:"under"}),t.refresh();let h=e.findIndex(m=>m===this.column.getAggFunc());h===-1&&(h=0),t.focusRow(h)}createAggSelect(t,e){const n=()=>{t(),this.getGui().focus(),this.funcColsService.setColumnAggFunc(this.column,e,"toolPanelDragAndDrop")},o=this.localeService.getLocaleTextFunc(),i=e.toString(),l=o(i,i);return new R_(n,l)}isGroupingAndLocked(){return this.isGroupingZone()&&this.columnModel.isColGroupLocked(this.column)}isAggregationZone(){return this.dropZonePurpose==="aggregation"}isGroupingZone(){return this.dropZonePurpose==="rowGroup"}getDragSourceType(){return T.DragSourceType.ToolPanel}destroy(){super.destroy(),this.column=null}},R_=class extends T.Component{constructor(t,e){super('<div class="ag-select-agg-func-item"/>'),this.selectItem=t,this.getGui().innerText=e,this.addGuiEventListener("click",this.selectItem)}},fl=class extends Me.PillDropZonePanel{constructor(t,e){super(t),this.dropZonePurpose=e}wireBeans(t){super.wireBeans(t),this.columnModel=t.columnModel,this.funcColsService=t.funcColsService}init(t){super.init(t),this.addManagedEventListeners({newColumnsLoaded:this.refreshGui.bind(this)}),this.addManagedPropertyListeners(["functionsReadOnly","rowGroupPanelSuppressSort","groupLockGroupColumns"],this.refreshGui.bind(this))}getItems(t){return t.columns??[]}isInterestedIn(t){return t===T.DragSourceType.HeaderCell||t===T.DragSourceType.ToolPanel}minimumAllowedNewInsertIndex(){const t=this.gos.get("groupLockGroupColumns"),e=this.funcColsService.getRowGroupColumns().length;return t===-1?e:Math.min(t,e)}showOrHideColumnOnExit(t){return this.isRowGroupPanel()&&!this.gos.get("suppressRowGroupHidesColumns")&&!t.fromNudge}handleDragEnterEnd(t){if(this.showOrHideColumnOnExit(t)){const o=t.dragSource.getDragItem().columns;this.setColumnsVisible(o,!1,"uiColumnDragged")}}handleDragLeaveEnd(t){if(this.showOrHideColumnOnExit(t)){const n=t.dragSource.getDragItem();this.setColumnsVisible(n.columns,!0,"uiColumnDragged")}}setColumnsVisible(t,e,n){if(t){const o=t.filter(i=>!i.getColDef().lockVisible);this.columnModel.setColsVisible(o,e,n)}}isRowGroupPanel(){return this.dropZonePurpose==="rowGroup"}createPillComponent(t,e,n,o){return new P_(t,e,n,this.dropZonePurpose,o)}},ml=class extends fl{constructor(t){super(t,"pivot")}postConstruct(){const t=this.localeService.getLocaleTextFunc(),e=t("pivotColumnsEmptyMessage","Drag here to set column labels"),n=t("pivots","Column Labels");super.init({icon:T._createIconNoSpan("pivotPanel",this.gos,null),emptyMessage:e,title:n}),this.addManagedEventListeners({newColumnsLoaded:this.refresh.bind(this),columnPivotChanged:this.refresh.bind(this),columnPivotModeChanged:this.checkVisibility.bind(this)}),this.refresh()}getAriaLabel(){return this.localeService.getLocaleTextFunc()("ariaPivotDropZonePanelLabel","Column Labels")}getTooltipParams(){const t=super.getTooltipParams();return t.location="pivotColumnsList",t}refresh(){this.checkVisibility(),this.refreshGui()}checkVisibility(){const t=this.columnModel.isPivotMode();if(this.isHorizontal())switch(this.gos.get("pivotPanelShow")){case"always":this.setDisplayed(t);break;case"onlyWhenPivoting":{const e=this.columnModel.isPivotActive();this.setDisplayed(t&&e);break}default:this.setDisplayed(!1);break}else this.setDisplayed(t)}isItemDroppable(t,e){return this.gos.get("functionsReadOnly")||!t.isPrimary()?!1:t.isAllowPivot()&&(!t.isPivotActive()||this.isSourceEventFromTarget(e))}updateItems(t){this.funcColsService.setPivotColumns(t,"toolPanelUi")}getIconName(){return this.isPotentialDndItems()?"pivot":"notAllowed"}getExistingItems(){return this.funcColsService.getPivotColumns()}},gl=class extends fl{constructor(t){super(t,"rowGroup")}postConstruct(){const t=this.localeService.getLocaleTextFunc(),e=t("rowGroupColumnsEmptyMessage","Drag here to set row groups"),n=t("groups","Row Groups");super.init({icon:T._createIconNoSpan("rowGroupPanel",this.gos,null),emptyMessage:e,title:n}),this.addManagedEventListeners({columnRowGroupChanged:this.refreshGui.bind(this)})}getAriaLabel(){return this.localeService.getLocaleTextFunc()("ariaRowGroupDropZonePanelLabel","Row Groups")}getTooltipParams(){const t=super.getTooltipParams();return t.location="rowGroupColumnsList",t}isItemDroppable(t,e){return this.gos.get("functionsReadOnly")||!t.isPrimary()?!1:t.isAllowRowGroup()&&(!t.isRowGroupActive()||this.isSourceEventFromTarget(e))}updateItems(t){this.funcColsService.setRowGroupColumns(t,"toolPanelUi")}getIconName(){return this.isPotentialDndItems()?"group":"notAllowed"}getExistingItems(){return this.funcColsService.getRowGroupColumns()}},D_=class extends T.Component{wireBeans(t){this.columnModel=t.columnModel,this.funcColsService=t.funcColsService}constructor(){super()}postConstruct(){this.setGui(this.createNorthPanel());const t=this.onRowGroupChanged.bind(this);this.addManagedEventListeners({columnRowGroupChanged:t,newColumnsLoaded:t}),this.addManagedPropertyListener("rowGroupPanelShow",t),this.addManagedPropertyListener("pivotPanelShow",()=>this.onPivotPanelShow()),this.onRowGroupChanged()}createNorthPanel(){const t=document.createElement("div");t.classList.add("ag-column-drop-wrapper"),T._setAriaRole(t,"presentation"),this.rowGroupComp=new gl(!0),this.createManagedBean(this.rowGroupComp),this.pivotComp=new ml(!0),this.createManagedBean(this.pivotComp),t.appendChild(this.rowGroupComp.getGui()),t.appendChild(this.pivotComp.getGui());const e=this.onDropPanelVisible.bind(this);return this.addManagedListeners(this.rowGroupComp,{displayChanged:e}),this.addManagedListeners(this.pivotComp,{displayChanged:e}),this.onDropPanelVisible(),t}onDropPanelVisible(){const t=this.rowGroupComp.isDisplayed()&&this.pivotComp.isDisplayed(),e="ag-column-drop-horizontal-half-width";this.rowGroupComp.addOrRemoveCssClass(e,t),this.pivotComp.addOrRemoveCssClass(e,t)}onRowGroupChanged(){if(!this.rowGroupComp)return;const t=this.gos.get("rowGroupPanelShow");if(t==="always")this.rowGroupComp.setDisplayed(!0);else if(t==="onlyWhenGrouping"){const e=!this.funcColsService.isRowGroupEmpty();this.rowGroupComp.setDisplayed(e)}else this.rowGroupComp.setDisplayed(!1)}onPivotPanelShow(){if(!this.pivotComp)return;const t=this.gos.get("pivotPanelShow");if(t==="always")this.pivotComp.setDisplayed(!0);else if(t==="onlyWhenPivoting"){const e=this.columnModel.isPivotActive();this.pivotComp.setDisplayed(e)}else this.pivotComp.setDisplayed(!1)}},I_={selector:"AG-GRID-HEADER-DROP-ZONES",component:D_},F_=class extends T.BeanStub{constructor(){super(...arguments),this.beanName="columnDropZonesService"}getDropZoneSelector(){return I_}},L_=class extends T.BeanStub{constructor(){super(...arguments),this.beanName="filterAggregatesStage"}wireBeans(t){this.filterManager=t.filterManager,this.columnModel=t.columnModel}execute(t){var h,m;const e=this.columnModel.isPivotMode(),n=((h=this.filterManager)==null?void 0:h.isAggregateFilterPresent())||((m=this.filterManager)==null?void 0:m.isAggregateQuickFilterPresent()),o=y=>!y.node.group,i=y=>y.node.leafGroup,l=T._getGroupAggFiltering(this.gos)||(e?i:o),{changedPath:c}=t,d=(y,b=!1)=>{y.childrenAfterFilter&&(y.childrenAfterAggFilter=y.childrenAfterFilter,b&&y.childrenAfterAggFilter.forEach(w=>d(w,b)),this.setAllChildrenCount(y)),y.sibling&&(y.sibling.childrenAfterAggFilter=y.childrenAfterAggFilter)},p=y=>{var b;y.childrenAfterAggFilter=((b=y.childrenAfterFilter)==null?void 0:b.filter(w=>{var O;return l({node:w})&&this.filterManager.doesRowPassAggregateFilters({rowNode:w})?(d(w,!0),!0):(O=w.childrenAfterAggFilter)==null?void 0:O.length}))||null,this.setAllChildrenCount(y),y.sibling&&(y.sibling.childrenAfterAggFilter=y.childrenAfterAggFilter)};c.forEachChangedNodeDepthFirst(n?p:d,!0)}setAllChildrenCountTreeData(t){const e=t.childrenAfterAggFilter;let n=0;if(e){const o=e.length;n=o;for(let i=0;i<o;++i)n+=e[i].allChildrenCount??0}t.setAllChildrenCount(n===0&&t.level>=0?null:n)}setAllChildrenCountGridGrouping(t){let e=0;t.childrenAfterAggFilter.forEach(n=>{n.group?e+=n.allChildrenCount:e++}),t.setAllChildrenCount(e)}setAllChildrenCount(t){if(!t.hasChildren()){t.setAllChildrenCount(null);return}this.gos.get("treeData")?this.setAllChildrenCountTreeData(t):this.setAllChildrenCountGridGrouping(t)}},O_=class extends T.TabGuardComp{constructor(){super(`
17
+ `,[T.SortIndicatorSelector]),this.column=t,this.dropZonePurpose=o,this.eSortIndicator=T.RefPlaceholder,this.popupShowing=!1}wireBeans(t){super.wireBeans(t),this.popupService=t.popupService,this.sortController=t.sortController,this.columnModel=t.columnModel,this.columnNameService=t.columnNameService,this.funcColsService=t.funcColsService,this.aggFuncService=t.aggFuncService}postConstruct(){this.displayName=this.columnNameService.getDisplayNameForColumn(this.column,"columnDrop"),super.postConstruct(),this.setupSort(),this.addManagedEventListeners({sortChanged:()=>{this.setupAria()}}),this.isGroupingZone()&&this.addManagedPropertyListener("groupLockGroupColumns",()=>{this.refreshRemove(),this.refreshDraggable(),this.setupAria()})}getItem(){return this.column}getDisplayName(){return this.displayName}getTooltip(){return this.column.getColDef().headerTooltip}addAdditionalAriaInstructions(t,e){const n=this.gos.get("rowGroupPanelSuppressSort"),o=this.gos.get("functionsReadOnly");if(this.isAggregationZone()&&!o){const i=e("ariaDropZoneColumnValueItemDescription","Press ENTER to change the aggregation type");t.push(i)}if(this.isGroupingZone()&&this.column.isSortable()&&!n){const i=e("ariaDropZoneColumnGroupItemDescription","Press ENTER to sort");t.push(i)}super.addAdditionalAriaInstructions(t,e)}isDraggable(){return this.isReadOnly()}isRemovable(){return this.isReadOnly()}isReadOnly(){return!this.isGroupingAndLocked()&&!this.gos.get("functionsReadOnly")}getAriaDisplayName(){const t=this.localeService.getLocaleTextFunc(),{name:e,aggFuncName:n}=this.getColumnAndAggFuncName(),o=t("ariaDropZoneColumnComponentAggFuncSeparator"," of "),i={asc:t("ariaDropZoneColumnComponentSortAscending","ascending"),desc:t("ariaDropZoneColumnComponentSortDescending","descending")},l=this.column.getSort(),c=this.gos.get("rowGroupPanelSuppressSort");return[n&&`${n}${o}`,e,this.isGroupingZone()&&!c&&l&&`, ${i[l]}`].filter(d=>!!d).join("")}getColumnAndAggFuncName(){const t=this.displayName;let e="";if(this.isAggregationZone()){const n=this.column.getAggFunc(),o=typeof n=="string"?n:"agg";e=this.localeService.getLocaleTextFunc()(o,o)}return{name:t,aggFuncName:e}}setupSort(){const t=this.column.isSortable(),e=this.isGroupingZone();if(!(!t||!e)&&!this.gos.get("rowGroupPanelSuppressSort")){this.eSortIndicator.setupSort(this.column,!0);const n=o=>{o.preventDefault();const l=this.gos.get("multiSortKey")==="ctrl"?o.ctrlKey||o.metaKey:o.shiftKey;this.sortController.progressSort(this.column,l,"uiColumnSorted")};this.addGuiEventListener("click",n),this.addGuiEventListener("keydown",o=>{o.key===T.KeyCode.ENTER&&this.isGroupingZone()&&n(o)})}}getDefaultIconName(){return"hide"}createGetDragItem(){const{column:t}=this;return()=>{const e={};return e[t.getId()]=t.isVisible(),{columns:[t],visibleState:e}}}setupComponents(){super.setupComponents(),this.isAggregationZone()&&!this.gos.get("functionsReadOnly")&&this.addGuiEventListener("click",this.onShowAggFuncSelection.bind(this))}onKeyDown(t){super.onKeyDown(t),t.key===T.KeyCode.ENTER&&this.isAggregationZone()&&!this.gos.get("functionsReadOnly")&&(t.preventDefault(),this.onShowAggFuncSelection())}getDisplayValue(){const{name:t,aggFuncName:e}=this.getColumnAndAggFuncName();return this.isAggregationZone()?`${e}(${t})`:t}onShowAggFuncSelection(){if(this.popupShowing)return;this.popupShowing=!0;const t=new Me.VirtualList({cssIdentifier:"select-agg-func"}),e=this.aggFuncService.getFuncNames(this.column),n=this.getGui(),o=t.getGui();t.setModel({getRow:function(m){return e[m]},getRowCount:function(){return e.length}}),this.createBean(t);const i=T._loadTemplate('<div class="ag-select-agg-func-popup"></div>');i.style.top="0px",i.style.left="0px",i.appendChild(o),i.style.width=`${n.clientWidth}px`;const[l]=this.addManagedElementListeners(i,{focusout:m=>{!i.contains(m.relatedTarget)&&p&&p.hideFunc()}}),c=m=>{this.destroyBean(t),this.popupShowing=!1,(m==null?void 0:m.key)==="Escape"&&n.focus(),l&&l()},d=this.localeService.getLocaleTextFunc(),p=this.popupService.addPopup({modal:!0,eChild:i,closeOnEsc:!0,closedCallback:c,ariaLabel:d("ariaLabelAggregationFunction","Aggregation Function")});p&&t.setComponentCreator(this.createAggSelect.bind(this,p.hideFunc)),t.addGuiEventListener("keydown",m=>{if(m.key===T.KeyCode.ENTER||m.key===T.KeyCode.SPACE){const y=t.getLastFocusedRow();if(y==null)return;const b=t.getComponentAt(y);b&&b.selectItem()}}),this.popupService.positionPopupByComponent({type:"aggFuncSelect",eventSource:n,ePopup:i,keepWithinBounds:!0,column:this.column,position:"under"}),t.refresh();let h=e.findIndex(m=>m===this.column.getAggFunc());h===-1&&(h=0),t.focusRow(h)}createAggSelect(t,e){const n=()=>{t(),this.getGui().focus(),this.funcColsService.setColumnAggFunc(this.column,e,"toolPanelDragAndDrop")},o=this.localeService.getLocaleTextFunc(),i=e.toString(),l=o(i,i);return new F_(n,l)}isGroupingAndLocked(){return this.isGroupingZone()&&this.columnModel.isColGroupLocked(this.column)}isAggregationZone(){return this.dropZonePurpose==="aggregation"}isGroupingZone(){return this.dropZonePurpose==="rowGroup"}getDragSourceType(){return T.DragSourceType.ToolPanel}destroy(){super.destroy(),this.column=null}},F_=class extends T.Component{constructor(t,e){super('<div class="ag-select-agg-func-item"/>'),this.selectItem=t,this.getGui().innerText=e,this.addGuiEventListener("click",this.selectItem)}},ml=class extends Me.PillDropZonePanel{constructor(t,e){super(t),this.dropZonePurpose=e}wireBeans(t){super.wireBeans(t),this.columnModel=t.columnModel,this.funcColsService=t.funcColsService}init(t){super.init(t),this.addManagedEventListeners({newColumnsLoaded:this.refreshGui.bind(this)}),this.addManagedPropertyListeners(["functionsReadOnly","rowGroupPanelSuppressSort","groupLockGroupColumns"],this.refreshGui.bind(this))}getItems(t){return t.columns??[]}isInterestedIn(t){return t===T.DragSourceType.HeaderCell||t===T.DragSourceType.ToolPanel}minimumAllowedNewInsertIndex(){const t=this.gos.get("groupLockGroupColumns"),e=this.funcColsService.getRowGroupColumns().length;return t===-1?e:Math.min(t,e)}showOrHideColumnOnExit(t){return this.isRowGroupPanel()&&!this.gos.get("suppressRowGroupHidesColumns")&&!t.fromNudge}handleDragEnterEnd(t){if(this.showOrHideColumnOnExit(t)){const o=t.dragSource.getDragItem().columns;this.setColumnsVisible(o,!1,"uiColumnDragged")}}handleDragLeaveEnd(t){if(this.showOrHideColumnOnExit(t)){const n=t.dragSource.getDragItem();this.setColumnsVisible(n.columns,!0,"uiColumnDragged")}}setColumnsVisible(t,e,n){if(t){const o=t.filter(i=>!i.getColDef().lockVisible);this.columnModel.setColsVisible(o,e,n)}}isRowGroupPanel(){return this.dropZonePurpose==="rowGroup"}createPillComponent(t,e,n,o){return new I_(t,e,n,this.dropZonePurpose,o)}},gl=class extends ml{constructor(t){super(t,"pivot")}postConstruct(){const t=this.localeService.getLocaleTextFunc(),e=t("pivotColumnsEmptyMessage","Drag here to set column labels"),n=t("pivots","Column Labels");super.init({icon:T._createIconNoSpan("pivotPanel",this.gos,null),emptyMessage:e,title:n}),this.addManagedEventListeners({newColumnsLoaded:this.refresh.bind(this),columnPivotChanged:this.refresh.bind(this),columnPivotModeChanged:this.checkVisibility.bind(this)}),this.refresh()}getAriaLabel(){return this.localeService.getLocaleTextFunc()("ariaPivotDropZonePanelLabel","Column Labels")}getTooltipParams(){const t=super.getTooltipParams();return t.location="pivotColumnsList",t}refresh(){this.checkVisibility(),this.refreshGui()}checkVisibility(){const t=this.columnModel.isPivotMode();if(this.isHorizontal())switch(this.gos.get("pivotPanelShow")){case"always":this.setDisplayed(t);break;case"onlyWhenPivoting":{const e=this.columnModel.isPivotActive();this.setDisplayed(t&&e);break}default:this.setDisplayed(!1);break}else this.setDisplayed(t)}isItemDroppable(t,e){return this.gos.get("functionsReadOnly")||!t.isPrimary()?!1:t.isAllowPivot()&&(!t.isPivotActive()||this.isSourceEventFromTarget(e))}updateItems(t){this.funcColsService.setPivotColumns(t,"toolPanelUi")}getIconName(){return this.isPotentialDndItems()?"pivot":"notAllowed"}getExistingItems(){return this.funcColsService.getPivotColumns()}},yl=class extends ml{constructor(t){super(t,"rowGroup")}postConstruct(){const t=this.localeService.getLocaleTextFunc(),e=t("rowGroupColumnsEmptyMessage","Drag here to set row groups"),n=t("groups","Row Groups");super.init({icon:T._createIconNoSpan("rowGroupPanel",this.gos,null),emptyMessage:e,title:n}),this.addManagedEventListeners({columnRowGroupChanged:this.refreshGui.bind(this)})}getAriaLabel(){return this.localeService.getLocaleTextFunc()("ariaRowGroupDropZonePanelLabel","Row Groups")}getTooltipParams(){const t=super.getTooltipParams();return t.location="rowGroupColumnsList",t}isItemDroppable(t,e){return this.gos.get("functionsReadOnly")||!t.isPrimary()?!1:t.isAllowRowGroup()&&(!t.isRowGroupActive()||this.isSourceEventFromTarget(e))}updateItems(t){this.funcColsService.setRowGroupColumns(t,"toolPanelUi")}getIconName(){return this.isPotentialDndItems()?"group":"notAllowed"}getExistingItems(){return this.funcColsService.getRowGroupColumns()}},L_=class extends T.Component{wireBeans(t){this.columnModel=t.columnModel,this.funcColsService=t.funcColsService}constructor(){super()}postConstruct(){this.setGui(this.createNorthPanel());const t=this.onRowGroupChanged.bind(this);this.addManagedEventListeners({columnRowGroupChanged:t,newColumnsLoaded:t}),this.addManagedPropertyListener("rowGroupPanelShow",t),this.addManagedPropertyListener("pivotPanelShow",()=>this.onPivotPanelShow()),this.onRowGroupChanged()}createNorthPanel(){const t=document.createElement("div");t.classList.add("ag-column-drop-wrapper"),T._setAriaRole(t,"presentation"),this.rowGroupComp=new yl(!0),this.createManagedBean(this.rowGroupComp),this.pivotComp=new gl(!0),this.createManagedBean(this.pivotComp),t.appendChild(this.rowGroupComp.getGui()),t.appendChild(this.pivotComp.getGui());const e=this.onDropPanelVisible.bind(this);return this.addManagedListeners(this.rowGroupComp,{displayChanged:e}),this.addManagedListeners(this.pivotComp,{displayChanged:e}),this.onDropPanelVisible(),t}onDropPanelVisible(){const t=this.rowGroupComp.isDisplayed()&&this.pivotComp.isDisplayed(),e="ag-column-drop-horizontal-half-width";this.rowGroupComp.addOrRemoveCssClass(e,t),this.pivotComp.addOrRemoveCssClass(e,t)}onRowGroupChanged(){if(!this.rowGroupComp)return;const t=this.gos.get("rowGroupPanelShow");if(t==="always")this.rowGroupComp.setDisplayed(!0);else if(t==="onlyWhenGrouping"){const e=!this.funcColsService.isRowGroupEmpty();this.rowGroupComp.setDisplayed(e)}else this.rowGroupComp.setDisplayed(!1)}onPivotPanelShow(){if(!this.pivotComp)return;const t=this.gos.get("pivotPanelShow");if(t==="always")this.pivotComp.setDisplayed(!0);else if(t==="onlyWhenPivoting"){const e=this.columnModel.isPivotActive();this.pivotComp.setDisplayed(e)}else this.pivotComp.setDisplayed(!1)}},O_={selector:"AG-GRID-HEADER-DROP-ZONES",component:L_},M_=class extends T.BeanStub{constructor(){super(...arguments),this.beanName="columnDropZonesService"}getDropZoneSelector(){return O_}},G_=class extends T.BeanStub{constructor(){super(...arguments),this.beanName="filterAggregatesStage"}wireBeans(t){this.filterManager=t.filterManager,this.columnModel=t.columnModel}execute(t){var h,m;const e=this.columnModel.isPivotMode(),n=((h=this.filterManager)==null?void 0:h.isAggregateFilterPresent())||((m=this.filterManager)==null?void 0:m.isAggregateQuickFilterPresent()),o=y=>!y.node.group,i=y=>y.node.leafGroup,l=T._getGroupAggFiltering(this.gos)||(e?i:o),{changedPath:c}=t,d=(y,b=!1)=>{y.childrenAfterFilter&&(y.childrenAfterAggFilter=y.childrenAfterFilter,b&&y.childrenAfterAggFilter.forEach(w=>d(w,b)),this.setAllChildrenCount(y)),y.sibling&&(y.sibling.childrenAfterAggFilter=y.childrenAfterAggFilter)},p=y=>{var b;y.childrenAfterAggFilter=((b=y.childrenAfterFilter)==null?void 0:b.filter(w=>{var O;return l({node:w})&&this.filterManager.doesRowPassAggregateFilters({rowNode:w})?(d(w,!0),!0):(O=w.childrenAfterAggFilter)==null?void 0:O.length}))||null,this.setAllChildrenCount(y),y.sibling&&(y.sibling.childrenAfterAggFilter=y.childrenAfterAggFilter)};c.forEachChangedNodeDepthFirst(n?p:d,!0)}setAllChildrenCountTreeData(t){const e=t.childrenAfterAggFilter;let n=0;if(e){const o=e.length;n=o;for(let i=0;i<o;++i)n+=e[i].allChildrenCount??0}t.setAllChildrenCount(n===0&&t.level>=0?null:n)}setAllChildrenCountGridGrouping(t){let e=0;t.childrenAfterAggFilter.forEach(n=>{n.group?e+=n.allChildrenCount:e++}),t.setAllChildrenCount(e)}setAllChildrenCount(t){if(!t.hasChildren()){t.setAllChildrenCount(null);return}this.gos.get("treeData")?this.setAllChildrenCountTreeData(t):this.setAllChildrenCountGridGrouping(t)}},$_=class extends T.TabGuardComp{constructor(){super(`
18
18
  <div class="ag-group-filter">
19
19
  <div data-ref="eGroupField"></div>
20
20
  <div data-ref="eUnderlyingFilter"></div>
21
21
  </div>
22
- `),this.eGroupField=T.RefPlaceholder,this.eUnderlyingFilter=T.RefPlaceholder}wireBeans(t){this.filterManager=t.filterManager,this.columnNameService=t.columnNameService,this.funcColsService=t.funcColsService}postConstruct(){this.initialiseTabGuard({})}init(t){return this.updateParams(t).then(()=>{this.addManagedEventListeners({columnRowGroupChanged:()=>this.onColumnRowGroupChanged(),filterDestroyed:e=>this.onFilterDestroyed(e)})})}refresh(t){return this.updateParams(t),!0}updateParams(t){return this.params=t,this.validateParams(),this.updateGroups()}validateParams(){const{colDef:t}=this.params;t.field&&T._warnOnce('Group Column Filter does not work with the colDef property "field". This property will be ignored.'),t.filterValueGetter&&T._warnOnce('Group Column Filter does not work with the colDef property "filterValueGetter". This property will be ignored.'),t.filterParams&&T._warnOnce('Group Column Filter does not work with the colDef property "filterParams". This property will be ignored.')}updateGroups(){const t=this.updateGroupField();return this.getUnderlyingFilters(t)}getSourceColumns(){if(this.groupColumn=this.params.column,this.gos.get("treeData"))return T._warnOnce("Group Column Filter does not work with Tree Data enabled. Please disable Tree Data, or use a different filter."),[];const t=this.funcColsService.getSourceColumnsForGroupColumn(this.groupColumn);return t||(T._warnOnce("Group Column Filter only works on group columns. Please use a different filter."),[])}updateGroupField(){T._clearElement(this.eGroupField),this.eGroupFieldSelect&&this.destroyBean(this.eGroupFieldSelect);const t=this.getSourceColumns(),e=t.filter(n=>n.isFilterAllowed());return e.length?(t.length===1?(this.selectedColumn=e[0],T._setDisplayed(this.eGroupField,!1)):((!this.selectedColumn||!e.some(n=>n.getId()===this.selectedColumn.getId()))&&(this.selectedColumn=e[0]),this.createGroupFieldSelectElement(e),this.eGroupField.appendChild(this.eGroupFieldSelect.getGui()),this.eGroupField.appendChild(T._loadTemplate('<div class="ag-filter-separator"></div>')),T._setDisplayed(this.eGroupField,!0)),e):(this.selectedColumn=void 0,T._setDisplayed(this.eGroupField,!1),null)}createGroupFieldSelectElement(t){this.eGroupFieldSelect=this.createManagedBean(new T.AgSelect);const e=this.localeService.getLocaleTextFunc();this.eGroupFieldSelect.setLabel(e("groupFilterSelect","Select field:")),this.eGroupFieldSelect.setLabelAlignment("top"),this.eGroupFieldSelect.addOptions(t.map(n=>({value:n.getId(),text:this.columnNameService.getDisplayNameForColumn(n,"groupFilter",!1)??void 0}))),this.eGroupFieldSelect.setValue(this.selectedColumn.getId()),this.eGroupFieldSelect.onValueChange(n=>this.updateSelectedColumn(n)),this.eGroupFieldSelect.addCssClass("ag-group-filter-field-select-wrapper"),t.length===1&&this.eGroupFieldSelect.setDisabled(!0)}getUnderlyingFilters(t){if(!t)return this.filterColumnPairs=void 0,this.selectedFilter=void 0,this.groupColumn.setFilterActive(!1,"columnRowGroupChanged"),T.AgPromise.resolve();const e=[],n=[];return t.forEach(o=>{const i=this.filterManager.getOrCreateFilterWrapper(o);i!=null&&i.filterPromise&&e.push(i.filterPromise.then(l=>(l&&n.push({filter:l,column:o}),o.getId()===this.selectedColumn.getId()&&(this.selectedFilter=l??void 0),l)))}),T.AgPromise.all(e).then(()=>{this.filterColumnPairs=n,this.groupColumn.setFilterActive(this.isFilterActive(),"columnRowGroupChanged")})}addUnderlyingFilterElement(){var e;if(T._clearElement(this.eUnderlyingFilter),!this.selectedColumn)return T.AgPromise.resolve();const t=this.createManagedBean(new T.FilterWrapperComp(this.selectedColumn,"COLUMN_MENU"));return this.filterWrapperComp=t,t.hasFilter()?(this.eUnderlyingFilter.appendChild(t.getGui()),((e=t.getFilter())==null?void 0:e.then(()=>{var n,o;(n=t.afterGuiAttached)==null||n.call(t,this.afterGuiAttachedParams),!((o=this.afterGuiAttachedParams)!=null&&o.suppressFocus)&&this.eGroupFieldSelect&&!this.eGroupFieldSelect.isDisabled()&&this.eGroupFieldSelect.getFocusableElement().focus()}))??T.AgPromise.resolve()):T.AgPromise.resolve()}updateSelectedColumn(t){var n;if(!t)return;(n=this.filterWrapperComp)==null||n.afterGuiDetached(),this.destroyBean(this.filterWrapperComp);const e=this.getFilterColumnPair(t);this.selectedColumn=e==null?void 0:e.column,this.selectedFilter=e==null?void 0:e.filter,this.dispatchLocalEvent({type:"selectedColumnChanged"}),this.addUnderlyingFilterElement()}isFilterActive(){var t;return!!((t=this.filterColumnPairs)!=null&&t.some(({filter:e})=>e.isFilterActive()))}doesFilterPass(){return!0}getModel(){return null}setModel(){return T.AgPromise.resolve()}afterGuiAttached(t){this.afterGuiAttachedParams=t,this.addUnderlyingFilterElement()}afterGuiDetached(){var t,e;T._clearElement(this.eUnderlyingFilter),(e=(t=this.selectedFilter)==null?void 0:t.afterGuiDetached)==null||e.call(t)}onColumnRowGroupChanged(){this.updateGroups().then(()=>{this.dispatchLocalEvent({type:"columnRowGroupChanged"})})}onFilterDestroyed({column:t,source:e}){var o;if(e==="gridDestroyed")return;const n=t.getColId();(o=this.filterColumnPairs)!=null&&o.some(({column:i})=>i.getColId()===n)&&setTimeout(()=>{this.isAlive()&&this.updateGroups()})}getFilterColumnPair(t){var e;if(t)return(e=this.filterColumnPairs)==null?void 0:e.find(({column:n})=>n.getId()===t)}getSelectedFilter(){return this.selectedFilter}getSelectedColumn(){return this.selectedColumn}isFilterAllowed(){return!!this.selectedColumn}destroy(){super.destroy()}},M_=class extends T.Component{constructor(){super(`
22
+ `),this.eGroupField=T.RefPlaceholder,this.eUnderlyingFilter=T.RefPlaceholder}wireBeans(t){this.filterManager=t.filterManager,this.columnNameService=t.columnNameService,this.funcColsService=t.funcColsService}postConstruct(){this.initialiseTabGuard({})}init(t){return this.updateParams(t).then(()=>{this.addManagedEventListeners({columnRowGroupChanged:()=>this.onColumnRowGroupChanged(),filterDestroyed:e=>this.onFilterDestroyed(e)})})}refresh(t){return this.updateParams(t),!0}updateParams(t){return this.params=t,this.validateParams(),this.updateGroups()}validateParams(){const{colDef:t}=this.params;t.field&&T._warnOnce('Group Column Filter does not work with the colDef property "field". This property will be ignored.'),t.filterValueGetter&&T._warnOnce('Group Column Filter does not work with the colDef property "filterValueGetter". This property will be ignored.'),t.filterParams&&T._warnOnce('Group Column Filter does not work with the colDef property "filterParams". This property will be ignored.')}updateGroups(){const t=this.updateGroupField();return this.getUnderlyingFilters(t)}getSourceColumns(){if(this.groupColumn=this.params.column,this.gos.get("treeData"))return T._warnOnce("Group Column Filter does not work with Tree Data enabled. Please disable Tree Data, or use a different filter."),[];const t=this.funcColsService.getSourceColumnsForGroupColumn(this.groupColumn);return t||(T._warnOnce("Group Column Filter only works on group columns. Please use a different filter."),[])}updateGroupField(){T._clearElement(this.eGroupField),this.eGroupFieldSelect&&this.destroyBean(this.eGroupFieldSelect);const t=this.getSourceColumns(),e=t.filter(n=>n.isFilterAllowed());return e.length?(t.length===1?(this.selectedColumn=e[0],T._setDisplayed(this.eGroupField,!1)):((!this.selectedColumn||!e.some(n=>n.getId()===this.selectedColumn.getId()))&&(this.selectedColumn=e[0]),this.createGroupFieldSelectElement(e),this.eGroupField.appendChild(this.eGroupFieldSelect.getGui()),this.eGroupField.appendChild(T._loadTemplate('<div class="ag-filter-separator"></div>')),T._setDisplayed(this.eGroupField,!0)),e):(this.selectedColumn=void 0,T._setDisplayed(this.eGroupField,!1),null)}createGroupFieldSelectElement(t){this.eGroupFieldSelect=this.createManagedBean(new T.AgSelect);const e=this.localeService.getLocaleTextFunc();this.eGroupFieldSelect.setLabel(e("groupFilterSelect","Select field:")),this.eGroupFieldSelect.setLabelAlignment("top"),this.eGroupFieldSelect.addOptions(t.map(n=>({value:n.getId(),text:this.columnNameService.getDisplayNameForColumn(n,"groupFilter",!1)??void 0}))),this.eGroupFieldSelect.setValue(this.selectedColumn.getId()),this.eGroupFieldSelect.onValueChange(n=>this.updateSelectedColumn(n)),this.eGroupFieldSelect.addCssClass("ag-group-filter-field-select-wrapper"),t.length===1&&this.eGroupFieldSelect.setDisabled(!0)}getUnderlyingFilters(t){if(!t)return this.filterColumnPairs=void 0,this.selectedFilter=void 0,this.groupColumn.setFilterActive(!1,"columnRowGroupChanged"),T.AgPromise.resolve();const e=[],n=[];return t.forEach(o=>{const i=this.filterManager.getOrCreateFilterWrapper(o);i!=null&&i.filterPromise&&e.push(i.filterPromise.then(l=>(l&&n.push({filter:l,column:o}),o.getId()===this.selectedColumn.getId()&&(this.selectedFilter=l??void 0),l)))}),T.AgPromise.all(e).then(()=>{this.filterColumnPairs=n,this.groupColumn.setFilterActive(this.isFilterActive(),"columnRowGroupChanged")})}addUnderlyingFilterElement(){var e;if(T._clearElement(this.eUnderlyingFilter),!this.selectedColumn)return T.AgPromise.resolve();const t=this.createManagedBean(new T.FilterWrapperComp(this.selectedColumn,"COLUMN_MENU"));return this.filterWrapperComp=t,t.hasFilter()?(this.eUnderlyingFilter.appendChild(t.getGui()),((e=t.getFilter())==null?void 0:e.then(()=>{var n,o;(n=t.afterGuiAttached)==null||n.call(t,this.afterGuiAttachedParams),!((o=this.afterGuiAttachedParams)!=null&&o.suppressFocus)&&this.eGroupFieldSelect&&!this.eGroupFieldSelect.isDisabled()&&this.eGroupFieldSelect.getFocusableElement().focus()}))??T.AgPromise.resolve()):T.AgPromise.resolve()}updateSelectedColumn(t){var n;if(!t)return;(n=this.filterWrapperComp)==null||n.afterGuiDetached(),this.destroyBean(this.filterWrapperComp);const e=this.getFilterColumnPair(t);this.selectedColumn=e==null?void 0:e.column,this.selectedFilter=e==null?void 0:e.filter,this.dispatchLocalEvent({type:"selectedColumnChanged"}),this.addUnderlyingFilterElement()}isFilterActive(){var t;return!!((t=this.filterColumnPairs)!=null&&t.some(({filter:e})=>e.isFilterActive()))}doesFilterPass(){return!0}getModel(){return null}setModel(){return T.AgPromise.resolve()}afterGuiAttached(t){this.afterGuiAttachedParams=t,this.addUnderlyingFilterElement()}afterGuiDetached(){var t,e;T._clearElement(this.eUnderlyingFilter),(e=(t=this.selectedFilter)==null?void 0:t.afterGuiDetached)==null||e.call(t)}onColumnRowGroupChanged(){this.updateGroups().then(()=>{this.dispatchLocalEvent({type:"columnRowGroupChanged"})})}onFilterDestroyed({column:t,source:e}){var o;if(e==="gridDestroyed")return;const n=t.getColId();(o=this.filterColumnPairs)!=null&&o.some(({column:i})=>i.getColId()===n)&&setTimeout(()=>{this.isAlive()&&this.updateGroups()})}getFilterColumnPair(t){var e;if(t)return(e=this.filterColumnPairs)==null?void 0:e.find(({column:n})=>n.getId()===t)}getSelectedFilter(){return this.selectedFilter}getSelectedColumn(){return this.selectedColumn}isFilterAllowed(){return!!this.selectedColumn}destroy(){super.destroy()}},z_=class extends T.Component{constructor(){super(`
23
23
  <div data-ref="eFloatingFilter" class="ag-group-floating-filter ag-floating-filter-input" role="presentation"></div>
24
- `),this.eFloatingFilter=T.RefPlaceholder,this.haveAddedColumnListeners=!1}wireBeans(t){this.columnNameService=t.columnNameService,this.filterManager=t.filterManager}init(t){this.params=t;const e=this.gos.get("groupDisplayType")==="multipleColumns";return new T.AgPromise(n=>{this.params.parentFilterInstance(o=>{this.parentFilterInstance=o,e?this.setupUnderlyingFloatingFilterElement().then(()=>n()):(this.setupReadOnlyFloatingFilterElement(),n())})}).then(()=>{this.addManagedListeners(this.parentFilterInstance,{selectedColumnChanged:this.onSelectedColumnChanged.bind(this),columnRowGroupChanged:this.onColumnRowGroupChanged.bind(this)})})}onParamsUpdated(t){this.refresh(t)}refresh(t){this.params=t,this.setParams()}setParams(){var n;const t=this.columnNameService.getDisplayNameForColumn(this.params.column,"header",!0),e=this.localeService.getLocaleTextFunc();(n=this.eFloatingFilterText)==null||n.setInputAriaLabel(`${t} ${e("ariaFilterInput","Filter Input")}`)}setupReadOnlyFloatingFilterElement(){this.eFloatingFilterText||(this.eFloatingFilterText=this.createManagedBean(new T.AgInputTextField),this.eFloatingFilterText.setDisabled(!0).addGuiEventListener("click",()=>this.params.showParentFilter()),this.setParams()),this.updateDisplayedValue(),this.eFloatingFilter.appendChild(this.eFloatingFilterText.getGui())}setupUnderlyingFloatingFilterElement(){this.showingUnderlyingFloatingFilter=!1,this.underlyingFloatingFilter=void 0,T._clearElement(this.eFloatingFilter);const t=this.parentFilterInstance.getSelectedColumn();if(t&&!t.isVisible()){const e=this.filterManager.getFloatingFilterCompDetails(t,this.params.showParentFilter);if(e)return this.haveAddedColumnListeners||(this.haveAddedColumnListeners=!0,this.addManagedListeners(t,{visibleChanged:this.onColumnVisibleChanged.bind(this),colDefChanged:this.onColDefChanged.bind(this)})),e.newAgStackInstance().then(n=>{var o,i;this.underlyingFloatingFilter=n,(i=this.underlyingFloatingFilter)==null||i.onParentModelChanged((o=this.parentFilterInstance.getSelectedFilter())==null?void 0:o.getModel()),this.appendChild(n.getGui()),this.showingUnderlyingFloatingFilter=!0})}return this.setupReadOnlyFloatingFilterElement(),T.AgPromise.resolve()}onColumnVisibleChanged(){this.setupUnderlyingFloatingFilterElement()}onColDefChanged(t){var n,o,i;if(!t.column)return;const e=this.filterManager.getFloatingFilterCompDetails(t.column,this.params.showParentFilter);e&&((n=this.underlyingFloatingFilter)!=null&&n.refresh?this.underlyingFloatingFilter.refresh(e.params):(i=(o=this.underlyingFloatingFilter)==null?void 0:o.onParamsUpdated)==null||i.call(o,e.params))}onParentModelChanged(t,e){var n,o;this.showingUnderlyingFloatingFilter?(o=this.underlyingFloatingFilter)==null||o.onParentModelChanged((n=this.parentFilterInstance.getSelectedFilter())==null?void 0:n.getModel(),e):this.updateDisplayedValue()}updateDisplayedValue(){if(!this.parentFilterInstance||!this.eFloatingFilterText)return;const t=this.parentFilterInstance.getSelectedFilter();if(!t){this.eFloatingFilterText.setValue(""),this.eFloatingFilterText.setDisplayed(!1);return}if(this.eFloatingFilterText.setDisplayed(!0),t.getModelAsString){const e=t.getModel();this.eFloatingFilterText.setValue(e==null?"":t.getModelAsString(e))}else this.eFloatingFilterText.setValue("")}onSelectedColumnChanged(){this.showingUnderlyingFloatingFilter||this.updateDisplayedValue()}onColumnRowGroupChanged(){this.showingUnderlyingFloatingFilter||this.updateDisplayedValue()}destroy(){super.destroy()}},yl=class{constructor(){this.allSets={},this.allParents=[]}removeFromChildrenAfterGroup(t,e){const n=this.getSet(t);n.removeFromChildrenAfterGroup[e.id]=!0}isRemoveFromAllLeafChildren(t,e){return!!this.getSet(t).removeFromAllLeafChildren[e.id]}preventRemoveFromAllLeafChildren(t,e){const n=this.getSet(t);delete n.removeFromAllLeafChildren[e.id]}removeFromAllLeafChildren(t,e){const n=this.getSet(t);n.removeFromAllLeafChildren[e.id]=!0}getSet(t){return this.allSets[t.id]||(this.allSets[t.id]={removeFromAllLeafChildren:{},removeFromChildrenAfterGroup:{}},this.allParents.push(t)),this.allSets[t.id]}getAllParents(){return this.allParents}flush(){this.allParents.forEach(t=>{var o;const e=this.allSets[t.id];t.childrenAfterGroup=t.childrenAfterGroup.filter(i=>!e.removeFromChildrenAfterGroup[i.id]),t.allLeafChildren=((o=t.allLeafChildren)==null?void 0:o.filter(i=>!e.removeFromAllLeafChildren[i.id]))??null,t.updateHasChildren();const n=t.sibling;n&&(n.childrenAfterGroup=t.childrenAfterGroup,n.allLeafChildren=t.allLeafChildren)}),this.allSets={},this.allParents.length=0}};function G_(t){if(!t)return!1;const e=t.length;if(e<2)return!1;let n=!1;for(let o=1;o<e;o++)if(bu(t[o-1],t[o])>0){n=!0;break}return n?(t.sort(bu),!0):!1}function bu(t,e){const n=t.sourceRowIndex,o=e.sourceRowIndex,i=n>=0,l=o>=0,c=i&&l,d=!i&&!l;return c?n-o:d?t.__objectId-e.__objectId:i?1:-1}var $_=class extends T.BeanStub{wireBeans(t){this.beans=t,this.columnModel=t.columnModel,this.funcColsService=t.funcColsService,this.valueService=t.valueService,this.selectionService=t.selectionService,this.showRowGroupColsService=t.showRowGroupColsService}execute(t){const e=this.createGroupingDetails(t);if(e.transactions)this.handleTransaction(e);else{const n=t.afterColumnsChanged===!0;this.shotgunResetEverything(e,n)}this.positionLeafsAndGroups(t.changedPath),this.orderGroups(e)}positionLeafsAndGroups(t){t.forEachChangedNodeDepthFirst(e=>{if(e.childrenAfterGroup){const n=[],o=[];let i;e.childrenAfterGroup.forEach(l=>{var c;(c=l.childrenAfterGroup)!=null&&c.length?l.key===""&&!i?i=l:o.push(l):n.push(l)}),i&&o.push(i),e.childrenAfterGroup=[...n,...o]}},!1)}createGroupingDetails(t){const{rowNode:e,changedPath:n,rowNodeTransactions:o,rowNodesOrderChanged:i}=t,l=this.funcColsService.getRowGroupColumns();return{expandByDefault:this.gos.get("groupDefaultExpanded"),groupedCols:l,rootNode:e,pivotMode:this.columnModel.isPivotMode(),groupedColCount:(l==null?void 0:l.length)??0,transactions:o,rowNodesOrderChanged:!!i,changedPath:n,groupAllowUnbalanced:this.gos.get("groupAllowUnbalanced"),isGroupOpenByDefault:this.gos.getCallback("isGroupOpenByDefault"),initialGroupOrderComparator:this.gos.getCallback("initialGroupOrderComparator"),suppressGroupMaintainValueType:this.gos.get("suppressGroupMaintainValueType"),keyCreators:(l==null?void 0:l.map(d=>d.getColDef().keyCreator))??[]}}handleTransaction(t){t.transactions.forEach(e=>{const n=new yl;T._existsAndNotEmpty(e.remove)&&this.removeNodes(e.remove,t,n),T._existsAndNotEmpty(e.update)&&this.moveNodesInWrongPath(e.update,t,n),T._existsAndNotEmpty(e.add)&&this.insertNodes(e.add,t);const o=n.getAllParents().slice();n.flush(),this.removeEmptyGroups(o,t)}),t.rowNodesOrderChanged&&this.sortChildren(t)}sortChildren(t){t.changedPath.forEachChangedNodeDepthFirst(e=>{G_(e.childrenAfterGroup)&&t.changedPath.addParentNode(e)},!1,!0)}orderGroups(t){const e=t.initialGroupOrderComparator;T._exists(e)&&n(t.rootNode);function n(o){T._exists(o.childrenAfterGroup)&&!o.leafGroup&&(o.childrenAfterGroup.sort((l,c)=>e({nodeA:l,nodeB:c})),o.childrenAfterGroup.forEach(l=>n(l)))}}getExistingPathForNode(t,e){const n=[];let o=t.parent;for(;o&&o!==e.rootNode;)n.push({key:o.key,rowGroupColumn:o.rowGroupColumn,field:o.field}),o=o.parent;return n.reverse(),n}moveNodesInWrongPath(t,e,n){t.forEach(o=>{e.changedPath.isActive()&&e.changedPath.addParentNode(o.parent);const i=p=>p.key,l=this.getExistingPathForNode(o,e).map(i),c=this.getGroupInfo(o,e).map(i);T._areEqual(l,c)||this.moveNode(o,e,n)})}moveNode(t,e,n){if(this.removeNodesFromParents([t],e,n),this.insertOneNode(t,e,n),t.setData(t.data),e.changedPath.isActive()){const o=t.parent;e.changedPath.addParentNode(o)}}removeNodes(t,e,n){this.removeNodesFromParents(t,e,n),e.changedPath.isActive()&&t.forEach(o=>e.changedPath.addParentNode(o.parent))}forEachParentGroup(t,e,n){let o=e;for(;o&&o!==t.rootNode;)n(o),o=o.parent}removeNodesFromParents(t,e,n){const o=n==null,i=n||new yl;t.forEach(l=>{this.removeFromParent(l,i),this.forEachParentGroup(e,l.parent,c=>{i.removeFromAllLeafChildren(c,l)})}),o&&i.flush()}removeEmptyGroups(t,e){let n=!0;const o=i=>{var p;const l=this.getChildrenMappedKey(i.key,i.rowGroupColumn),c=i.parent;return(c!=null&&c.childrenMapped?!c.childrenMapped[l]:!0)?!1:!!i.group&&(((p=i.childrenAfterGroup)==null?void 0:p.length)??0)===0};for(;n;){n=!1;const i=new yl;t.forEach(l=>{this.forEachParentGroup(e,l,c=>{o(c)&&(n=!0,this.removeFromParent(c,i),c.setSelectedParams({newValue:!1,source:"rowGroupChanged"}))})}),i.flush()}}removeFromParent(t,e){var o;t.parent&&(e?e.removeFromChildrenAfterGroup(t.parent,t):(T._removeFromArray(t.parent.childrenAfterGroup,t),t.parent.updateHasChildren()));const n=this.getChildrenMappedKey(t.key,t.rowGroupColumn);(o=t.parent)!=null&&o.childrenMapped&&delete t.parent.childrenMapped[n],t.setRowTop(null),t.setRowIndex(null)}addToParent(t,e){const n=this.getChildrenMappedKey(t.key,t.rowGroupColumn);e!=null&&e.childrenMapped&&e.childrenMapped[n]!==t&&(e.childrenMapped[n]=t,e.childrenAfterGroup.push(t),e.setGroup(!0))}areGroupColsEqual(t,e){return t==null||e==null||t.pivotMode!==e.pivotMode?!1:T._areEqual(t.groupedCols,e.groupedCols)&&T._areEqual(t.keyCreators,e.keyCreators)}checkAllGroupDataAfterColsChanged(t){const e=n=>{n&&n.forEach(o=>{var c;if(!o.group)return;const l={field:o.field,key:o.key,rowGroupColumn:o.rowGroupColumn,leafNode:(c=o.allLeafChildren)==null?void 0:c[0]};this.setGroupData(o,l,t),e(o.childrenAfterGroup)})};e(t.rootNode.childrenAfterGroup)}shotgunResetEverything(t,e){if(this.noChangeInGroupingColumns(t,e))return;this.selectionService.filterFromSelection(l=>l&&!l.group);const{groupedCols:n}=t,o=t.rootNode;o.leafGroup=n.length===0,o.childrenAfterGroup=[],o.childrenMapped={},o.updateHasChildren();const i=o.sibling;i&&(i.childrenAfterGroup=o.childrenAfterGroup,i.childrenMapped=o.childrenMapped),this.insertNodes(o.allLeafChildren,t)}noChangeInGroupingColumns(t,e){let n=!1;const o=this.showRowGroupColsService.getShowRowGroupCols(),i=o?o.map(l=>l.getId()).join("-"):"";return e&&(n=this.areGroupColsEqual(t,this.oldGroupingDetails),this.oldGroupDisplayColIds!==i&&this.checkAllGroupDataAfterColsChanged(t)),this.oldGroupingDetails=t,this.oldGroupDisplayColIds=i,n}insertNodes(t,e){t.forEach(n=>{this.insertOneNode(n,e),e.changedPath.isActive()&&e.changedPath.addParentNode(n.parent)})}insertOneNode(t,e,n){const o=this.getGroupInfo(t,e),i=this.findParentForNode(t,o,e,n);i.group||T._warnOnce("duplicate group keys for row data, keys should be unique",[i.data,t.data]),t.parent=i,t.level=o.length,i.childrenAfterGroup.push(t),i.updateHasChildren()}findParentForNode(t,e,n,o){let i=n.rootNode;return e.forEach((l,c)=>{i=this.getOrCreateNextNode(i,l,c,n),o!=null&&o.isRemoveFromAllLeafChildren(i,t)?o==null||o.preventRemoveFromAllLeafChildren(i,t):i.allLeafChildren.push(t)}),i}getOrCreateNextNode(t,e,n,o){var c;const i=this.getChildrenMappedKey(e.key,e.rowGroupColumn);let l=(c=t==null?void 0:t.childrenMapped)==null?void 0:c[i];return l||(l=this.createGroup(e,t,n,o),this.addToParent(l,t)),l}createGroup(t,e,n,o){const i=new T.RowNode(this.beans);return i.group=!0,i.field=t.field,i.rowGroupColumn=t.rowGroupColumn,this.setGroupData(i,t,o),i.key=t.key,i.id=this.createGroupId(i,e,n),i.level=n,i.leafGroup=n===o.groupedColCount-1,i.allLeafChildren=[],i.setAllChildrenCount(0),i.rowGroupIndex=n,i.childrenAfterGroup=[],i.childrenMapped={},i.updateHasChildren(),i.parent=e,this.setExpandedInitialValue(o,i),i}createGroupId(t,e,n){const o=(i,l)=>{if(!i.rowGroupColumn)return null;const c=l?o(l,l.parent):null;return`${c==null?"":c+"-"}${i.rowGroupColumn.getColId()}-${i.key}`};return T.RowNode.ID_PREFIX_ROW_GROUP+o(t,e)}setGroupData(t,e,n){t.groupData={},this.showRowGroupColsService.getShowRowGroupCols().forEach(i=>{const l=t.rowGroupColumn;l!==null&&i.isRowGroupDisplayed(l.getId())&&(n.suppressGroupMaintainValueType?t.groupData[i.getColId()]=e.key:t.groupData[i.getColId()]=this.valueService.getValue(l,e.leafNode))})}getChildrenMappedKey(t,e){return e?e.getId()+"-"+t:t}setExpandedInitialValue(t,e){if(t.pivotMode&&e.leafGroup){e.expanded=!1;return}const n=t.isGroupOpenByDefault;if(n){const o={rowNode:e,field:e.field,key:e.key,level:e.level,rowGroupColumn:e.rowGroupColumn};e.expanded=n(o)==!0;return}if(t.expandByDefault===-1){e.expanded=!0;return}e.expanded=e.level<t.expandByDefault}getGroupInfo(t,e){const n=[];return e.groupedCols.forEach(o=>{let i=this.valueService.getKeyForNode(o,t),l=i!=null&&i!=="";if((e.pivotMode||!e.groupAllowUnbalanced)&&!l&&(i="",l=!0),l){const d={key:i,field:o.getColDef().field,rowGroupColumn:o,leafNode:t};n.push(d)}}),n}},z_=(t,e)=>t.treeNode.oldSourceRowIndex-e.treeNode.oldSourceRowIndex,ft=Object.freeze([]),U_=ft.values(),ws=(t,e)=>{t.parent=null,t.treeNode=null,e?t.childrenAfterGroup=[]:(t.level=0,t.childrenAfterGroup=null,t.allLeafChildren=null)},Z_=class kg{constructor(e,n,o){this.parent=e,this.key=n,this.level=o,this.children=null,this.invalidatedHead=null,this.invalidatedNext=void 0,this.row=null,this.oldRow=null,this.duplicateRows=null,this.childrenAfterGroup=ft,this.allLeafChildren=ft,this.childrenChanged=!1,this.leafChildrenChanged=!1,this.oldSourceRowIndex=-1}isEmptyFillerNode(){var e,n;return!((e=this.row)!=null&&e.data)&&!((n=this.children)!=null&&n.size)}hasChildren(){var e;return!!((e=this.children)!=null&&e.size)}enumChildren(){var e;return((e=this.children)==null?void 0:e.values())??U_}upsertKey(e){var o,i;typeof e!="string"&&(e=String(e));let n=(o=this.children)==null?void 0:o.get(e);return n||(n=new kg(this,e,this.level+1),(i=this.children??(this.children=new Map))==null||i.set(n.key,n)),n}destroy(){var o;const{row:e,parent:n}=this;n!==null&&((o=n==null?void 0:n.children)==null||o.delete(this.key),e!==null&&ws(e,!0),this.parent=null)}setRow(e){const{level:n,row:o,childrenAfterGroup:i}=this;if(n<0)o!==null&&o!==e&&ws(o,!0);else{if(o===e)return!1;o!==null?(e.allLeafChildren=o.allLeafChildren??this.allLeafChildren??ft,ws(o,!1)):e.allLeafChildren=this.allLeafChildren??ft}return e.level=n,e.childrenAfterGroup=i,e.treeNode=this,this.row=e,!0}removeRow(e){const{level:n,row:o,duplicateRows:i,childrenAfterGroup:l}=this;if(o===e){const c=this.popDuplicateRow();c?(this.row=c,c.childrenAfterGroup=l,n>=0&&(c.allLeafChildren=o.allLeafChildren??this.allLeafChildren??ft)):this.row=null}else{if(!(i!=null&&i.delete(e)))return!1;i.size===0&&(this.duplicateRows=null)}return ws(e,n<0),!0}addDuplicateRow(e){const{level:n}=this;let o=this.duplicateRows;if(o===null)o=new Set,this.duplicateRows=o;else if(o.has(e))return!1;return o.add(e),e.treeNode=this,e.level=n,n>=0&&(e.allLeafChildren=ft),e.childrenAfterGroup=ft,!0}sortFirstDuplicateRow(){const e=this.duplicateRows,n=this.row;if(!n||!e)return n;let o=n;for(const i of e)i.sourceRowIndex<o.sourceRowIndex&&(o=i);return o!==n&&(o.childrenAfterGroup=this.childrenAfterGroup,o.allLeafChildren=n.allLeafChildren??this.allLeafChildren??ft,n.childrenAfterGroup=ft,n.allLeafChildren=ft,e.delete(o),e.add(n),this.row=o),o}popDuplicateRow(){let e=null;const n=this.duplicateRows;return n!==null&&(e=n.values().next().value,e!==null&&n.delete(e)&&n.size===0&&(this.duplicateRows=null)),e}dequeueInvalidated(){const e=this.invalidatedHead;return e!==null&&(this.invalidatedHead=e.invalidatedNext??null,e.invalidatedNext=void 0),e}invalidate(){let e=this,n=this.parent;for(;n!==null&&e.invalidatedNext===void 0;)e.invalidatedNext=n.invalidatedHead,n.invalidatedHead=e,e=n,n=e.parent}invalidateOrder(){var n,o;const e=this.parent;e!==null&&!e.childrenChanged&&((((n=this.children)==null?void 0:n.size)??0)>1||!((o=e.row)!=null&&o.data))&&(e.childrenChanged=!0,e.invalidate())}getRowPosition(){var n,o;const e=this.row;return e!=null&&e.data?e.sourceRowIndex:((o=(n=this.childrenAfterGroup[0])==null?void 0:n.treeNode)==null?void 0:o.oldSourceRowIndex)??this.oldSourceRowIndex}updateChildrenAfterGroup(){var d;this.childrenChanged=!1;const e=((d=this.children)==null?void 0:d.size)??0;if(e===0)return this.childrenAfterGroup.length===0?!1:(this.leafChildrenChanged=!0,this.childrenAfterGroup=ft,this.row.childrenAfterGroup=ft,!0);let n=!1,o=this.childrenAfterGroup;o===ft?(o=new Array(e),this.childrenAfterGroup=o,this.row.childrenAfterGroup=o,n=!0):o.length!==e&&(o.length=e,n=!0);let i=0,l=-1,c=!1;for(const p of this.enumChildren()){const h=p.getRowPosition();h<l&&(c=!0),l=h,p.oldSourceRowIndex=h;const m=p.row;o[i]!==m&&(o[i]=m,n=!0),++i}return n&&(this.leafChildrenChanged=!0),c&&this.reorderChildrenList(o),n||c}reorderChildrenList(e){const n=e.length,o=this.children;e.sort(z_),o.clear();for(let i=0;i<n;++i){const l=e[i].treeNode;o.set(l.key,l)}}updateAllLeafChildren(){var c,d;const{parent:e,row:n,childrenAfterGroup:o}=this;this.leafChildrenChanged=!1;let i=!1;const l=o.length;if(l===0)i=((c=n.allLeafChildren)==null?void 0:c.length)!==0,n.allLeafChildren=ft,this.allLeafChildren=ft;else if(l===1&&((d=o[0].allLeafChildren)!=null&&d.length))n.allLeafChildren=o[0].allLeafChildren,this.allLeafChildren=null,i=!0;else{let p=this.allLeafChildren;(p===ft||p===null)&&(p=[],this.allLeafChildren=p);const h=p.length;let m=0;for(let y=0;y<l;++y){const b=o[y],w=b.allLeafChildren,S=w.length;if(S)for(let M=0;M<S;++M){const O=w[M];(m>=h||p[m]!==O)&&(p[m]=O,i=!0),++m}else(m>=h||p[m]!==b)&&b&&(p[m]=b,i=!0),++m}h!==m&&(p.length=m,i=!0),n.allLeafChildren!==p&&(n.allLeafChildren=p,i=!0)}i&&e&&(e.leafChildrenChanged=!0)}},xu=t=>(t.treeNodeFlags&1)!==0,ku=t=>(t.treeNodeFlags&2)!==0,Eu=t=>(t.treeNodeFlags&4)!==0,W_=t=>(t.treeNodeFlags&8)!==0,Su=t=>(t.treeNodeFlags&16)!==0,Tu=(t,e)=>{e?t.treeNodeFlags|=2:t.treeNodeFlags&=-3},j_=t=>{const e=t.treeNodeFlags;e&1&&(t.treeNodeFlags=e|4)},H_=t=>{const e=t.treeNodeFlags;e&1&&(t.treeNodeFlags=e|12)},mr=t=>{t.treeNodeFlags|=16},Nu=t=>{t.treeNodeFlags=1|t.treeNodeFlags&-29},hi=t=>{t.treeNodeFlags=0},q_=class extends T.BeanStub{constructor(){super(...arguments),this.rowsPendingDestruction=null,this.root=new Z_(null,"",-1)}wireBeans(t){this.beans=t,this.showRowGroupColsService=t.showRowGroupColsService}destroy(){const t=this.root.row;t!==null&&(this.root.removeRow(t),hi(t)),this.destroyTree(this.root),this.commitDestroyedRows(),super.destroy()}execute(t){const{rowNodeTransactions:e,rowNodesOrderChanged:n,changedPath:o}=t,i=t.rowNode,l=this.gos,c={changedPath:o,expandByDefault:l.get("groupDefaultExpanded"),suppressGroupMaintainValueType:l.get("suppressGroupMaintainValueType"),getDataPath:l.get("getDataPath"),isGroupOpenByDefault:l.getCallback("isGroupOpenByDefault"),initialGroupOrderComparator:l.getCallback("initialGroupOrderComparator")};this.root.setRow(i),i.leafGroup=!1;const p=i.sibling;p&&(p.childrenAfterGroup=i.childrenAfterGroup,p.childrenMapped=i.childrenMapped),e?this.handleTransaction(c,e,n):this.handleRowData(c,i,t.afterColumnsChanged===!0)}handleRowData(t,e,n){var i,l,c;const o=this.root;if(n||this.oldGroupDisplayColIds===void 0){const d=((l=(i=this.showRowGroupColsService)==null?void 0:i.getShowRowGroupCols())==null?void 0:l.map(p=>p.getId()).join("-"))??"";if(n){this.oldGroupDisplayColIds!==d&&this.checkAllGroupDataAfterColsChanged((c=o.row)==null?void 0:c.childrenAfterGroup);return}this.oldGroupDisplayColIds=d}this.clearTree(o),this.addOrUpdateRows(t,e.allLeafChildren,!1),this.commitTree(t)}handleTransaction(t,e,n){for(const{remove:o,update:i,add:l}of e)this.removeRows(o),this.addOrUpdateRows(t,i,!0),this.addOrUpdateRows(t,l,!1);n&&this.handleRowNodesOrderChanged(),this.commitTree(t)}handleRowNodesOrderChanged(){var e;const t=(e=this.root.row)==null?void 0:e.allLeafChildren;if(t)for(let n=0,o=t.length;n<o;++n){const i=t[n].treeNode;i&&i.oldSourceRowIndex!==n&&i.invalidateOrder()}}checkAllGroupDataAfterColsChanged(t){var e;for(let n=0,o=(t==null?void 0:t.length)??0;n<o;++n){const i=t[n];this.setGroupData(i,((e=i.treeNode)==null?void 0:e.key)??i.key),this.checkAllGroupDataAfterColsChanged(i.childrenAfterGroup)}}addOrUpdateRows(t,e,n){for(let o=0,i=(e==null?void 0:e.length)??0;o<i;++o){const l=e[o],c=this.upsertPath(this.getDataPath(t,l));c&&this.addOrUpdateRow(c,l,n)}}removeRows(t){for(let e=0,n=(t==null?void 0:t.length)??0;e<n;++e){const o=t[e],i=o.treeNode;i!==null&&this.removeRow(i,o)}}getDataPath({getDataPath:t},{data:e}){const n=(t==null?void 0:t(e))||ft;return n.length||T._warnOnce("getDataPath() should not return an empty path",[e]),n}upsertPath(t){let e=this.root;const n=t.length-1;for(let o=0;o<=n;++o){const i=e.upsertKey(t[o]);if(o>=n)return i.invalidate(),i;e=i}return null}addOrUpdateRow(t,e,n){var c;const{level:o,row:i}=t;if(o<0)return;let l=!1;if(i!==e){const d=e.treeNode;d!==null&&d!==t&&(d.removeRow(e),d.invalidate()),i===null?(t.setRow(e),l=!0):i.data?t.addDuplicateRow(e)&&(l=!0):(t.setRow(e),this.destroyRow(i,!0),l=!0)}n&&!Eu(e)&&(j_(e),l=!0),l&&t.invalidate(),(c=this.rowsPendingDestruction)==null||c.delete(e)}removeRow(t,e){const{parent:n,level:o}=t;if(o<0)return;let i=!1;t.removeRow(e)&&(i=!0,n&&(n.childrenChanged=!0),this.destroyRow(e,!e.data)),i&&t.invalidate()}commitTree(t){var o;const e=this.root;this.commitInvalidatedChildren(t,e);const n=e.row;e.childrenChanged&&e.updateChildrenAfterGroup()&&mr(n),n.updateHasChildren(),Su(n)&&(o=t.changedPath)!=null&&o.isActive()&&t.changedPath.addParentNode(n),Nu(n),this.commitDestroyedRows()}commitInvalidatedChildren(t,e){for(;;){const n=e.dequeueInvalidated();if(n===null)break;n.parent===e&&this.commitChild(t,e,n)}}commitChild(t,e,n){if(n.isEmptyFillerNode()){this.clearTree(n);return}this.commitNodePreOrder(e,n),this.commitInvalidatedChildren(t,n),this.commitNodePostOrder(t,e,n)}commitNodePreOrder(t,e){let n=e.row;if(n===null?(n=this.createFillerRow(e),e.setRow(n)):(n=e.sortFirstDuplicateRow(),n.allChildrenCount===void 0&&(n.allChildrenCount=null)),n.parent=t.row,e.oldRow!==n)for(const i of e.enumChildren()){const l=i.row;l!==null&&(l.parent=n)}const o=e.key;n.key!==o?(n.key=o,H_(n),this.setGroupData(n,o)):n.groupData||this.setGroupData(n,o)}commitNodePostOrder(t,e,n){var h,m,y;const o=n.row,i=n.oldRow;if(n.isEmptyFillerNode()){this.clearTree(n);return}n.childrenChanged&&n.updateChildrenAfterGroup()&&mr(o),n.leafChildrenChanged&&n.updateAllLeafChildren();const l=n.getRowPosition();n.oldSourceRowIndex!==l&&(n.oldSourceRowIndex=l,e.childrenChanged=!0);const c=!!((h=o.childrenAfterGroup)!=null&&h.length),d=c||!o.data,p=o.group;p!==d?(mr(o),o.setGroup(d),!d&&!o.expanded&&Tu(o,!1)):o.hasChildren()!==c&&(mr(o),o.updateHasChildren()),o.group&&!ku(o)&&(i!==o&&i!==null&&i.group&&ku(i)&&!t.isGroupOpenByDefault?o.expanded=i.expanded:o.expanded=this.getExpandedInitialValue(t,o),Tu(o,!0)),Eu(o)&&(mr(e.row),W_(o)&&o.setData(o.data)),i!==o&&(n.oldRow=o,i!==null&&(p||n.hasChildren())&&mr(o),e.childrenChanged=!0,mr(e.row)),Su(o)?(m=t.changedPath)!=null&&m.isActive()&&t.changedPath.addParentNode(o):xu(o)||(o.childrenAfterFilter||(o.childrenAfterFilter=o.childrenAfterGroup.slice()),o.childrenAfterAggFilter||(o.childrenAfterAggFilter=o.childrenAfterFilter.slice()),o.childrenAfterSort||(o.childrenAfterSort=o.childrenAfterAggFilter.slice())),Nu(o),(y=n.duplicateRows)!=null&&y.size&&!n.duplicateRowsWarned&&(n.duplicateRowsWarned=!0,T._warnOnce("duplicate group keys for row data, keys should be unique",[o.id,o.data,...Array.from(n.duplicateRows).map(b=>b.data)]))}createFillerRow(t){const e=new T.RowNode(this.beans);e.key=t.key,e.group=!0,e.field=null,e.leafGroup=!1,e.rowGroupIndex=null,e.allChildrenCount=null;let n=t.level+"-"+t.key,o=t.parent;for(;o!==null;){const i=o.parent;if(i===null)break;n=`${o.level}-${o.key}-${n}`,o=i}return e.id=T.RowNode.ID_PREFIX_ROW_GROUP+n,e}setGroupData(t,e){var i;const n={};t.groupData=n;const o=(i=this.showRowGroupColsService)==null?void 0:i.getShowRowGroupCols();if(o)for(const l of o)n[l.getColId()]=e}getExpandedInitialValue(t,e){const n=t.isGroupOpenByDefault;return n?n({rowNode:e,field:e.field,key:e.key,level:e.level,rowGroupColumn:e.rowGroupColumn})==!0:t.expandByDefault===-1||e.level<t.expandByDefault}clearTree(t){const{parent:e,oldRow:n,row:o,level:i}=t;if(e!==null&&n!==null&&(e.childrenChanged=!0,e.row!==null&&mr(e.row)),o!==null&&i>=0){let l=t.row;for(;l!==null&&t.removeRow(l);)this.destroyRow(l,!l.data),l=t.row}for(const l of t.enumChildren())this.clearTree(l);t.destroy()}destroyTree(t){const{row:e,level:n,duplicateRows:o}=t;if(e&&(n>=0&&!e.data?this.destroyRow(e,!0):hi(e)),o)for(const i of o)n>=0&&!i.data?this.destroyRow(i,!0):hi(i);for(const i of t.enumChildren())this.destroyTree(i);t.destroy()}destroyRow(t,e){if(!xu(t)){hi(t);return}if(!e){(this.rowsPendingDestruction??(this.rowsPendingDestruction=new Set)).add(t);return}hi(t),t.setRowIndex(null),t.setRowTop(null),!t.data&&t.isSelected()&&t.setSelectedParams({newValue:!1,source:"rowGroupChanged"})}commitDestroyedRows(){const{rowsPendingDestruction:t}=this;if(t!==null){this.rowsPendingDestruction=null;for(const e of t)this.destroyRow(e,!0)}}},K_=class extends T.BeanStub{constructor(){super(...arguments),this.beanName="groupStage"}wireBeans(t){this.selectableService=t.selectableService}execute(t){const e=this.gos.get("treeData")?q_:$_;let n=this.strategy;(n==null?void 0:n.constructor)!==e&&(this.destroyBean(n),n=this.createManagedBean(new e),this.strategy=n),n.execute(t),this.selectableService.updateSelectableAfterGrouping()}destroy(){this.destroyBean(this.strategy),this.strategy=void 0,super.destroy()}},Vu="PivotRowTotal_",Y_=class extends T.BeanStub{constructor(){super(...arguments),this.beanName="pivotColDefService"}wireBeans(t){this.columnModel=t.columnModel,this.funcColsService=t.funcColsService,this.columnNameService=t.columnNameService}postConstruct(){const t=()=>this.gos.get("serverSidePivotResultFieldSeparator")??"_";this.fieldSeparator=t(),this.addManagedPropertyListener("serverSidePivotResultFieldSeparator",()=>{this.fieldSeparator=t()});const e=()=>this.gos.get("pivotDefaultExpanded");this.pivotDefaultExpanded=e(),this.addManagedPropertyListener("pivotDefaultExpanded",()=>{this.pivotDefaultExpanded=e()})}createPivotColumnDefs(t){const e=this.createPivotColumnsFromUniqueValues(t);function n(l,c=[]){return l.forEach(d=>{d.children!==void 0?n(d.children,c):c.push(d)}),c}const o=n(e);this.addRowGroupTotals(e,o),this.addExpandablePivotGroups(e,o),this.addPivotTotalsToGroups(e,o);const i=o.map(l=>T._cloneObject(l));return{pivotColumnGroupDefs:e,pivotColumnDefs:i}}createPivotColumnsFromUniqueValues(t){const e=this.funcColsService.getPivotColumns(),n=e.length;return this.recursivelyBuildGroup(0,t,[],n,e)}recursivelyBuildGroup(t,e,n,o,i){const l=this.funcColsService.getValueColumns();if(t>=o)return this.buildMeasureCols(n);const c=i[t].getColDef(),d=this.headerNameComparator.bind(this,c.pivotComparator);if(l.length===1&&this.gos.get("removePivotHeaderRowWhenSingleValueColumn")&&t===o-1){const h=[];return T._iterateObject(e,m=>{const y=[...n,m],b=this.createColDef(l[0],m,y);b.columnGroupShow="open",h.push(b)}),h.sort(d),h}const p=[];return T._iterateObject(e,(h,m)=>{const y=this.pivotDefaultExpanded===-1||t<this.pivotDefaultExpanded,b=[...n,h];p.push({children:this.recursivelyBuildGroup(t+1,m,b,o,i),headerName:h,pivotKeys:b,columnGroupShow:"open",openByDefault:y,groupId:this.generateColumnGroupId(b)})}),p.sort(d),p}buildMeasureCols(t){const e=this.funcColsService.getValueColumns();return e.length===0?[this.createColDef(null,"-",t)]:e.map(n=>{const o=this.columnNameService.getDisplayNameForColumn(n,"header");return{...this.createColDef(n,o,t),columnGroupShow:"open"}})}addExpandablePivotGroups(t,e){const n=this.gos.get("suppressExpandablePivotGroups");if(n||this.gos.get("pivotColumnGroupTotals"))return;const o=(i,l,c)=>{if("children"in i){const h=new Map;i.children.forEach(y=>{o(y,l,h)});const m=!i.children.some(y=>y.children);this.funcColsService.getValueColumns().forEach(y=>{const b=this.columnNameService.getDisplayNameForColumn(y,"header"),w=this.createColDef(y,b,i.pivotKeys);w.pivotTotalColumnIds=h.get(y.getColId()),w.columnGroupShow=n?"open":"closed",w.aggFunc=y.getAggFunc(),m||(i.children.push(w),l.push(w))}),this.merge(c,h);return}if(!i.pivotValueColumn)return;const d=i.pivotValueColumn.getColId();c.has(d)?c.get(d).push(i.colId):c.set(d,[i.colId])};t.forEach(i=>{o(i,e,new Map)})}addPivotTotalsToGroups(t,e){if(!this.gos.get("pivotColumnGroupTotals"))return;const n=this.gos.get("pivotColumnGroupTotals")==="after",o=this.funcColsService.getValueColumns(),i=o.map(c=>c.getAggFunc());if(!i||i.length<1||!this.sameAggFuncs(i))return;const l=o[0];t.forEach(c=>{this.recursivelyAddPivotTotal(c,e,l,n)})}recursivelyAddPivotTotal(t,e,n,o){const i=t;if(!i.children){const c=t;return c.colId?[c.colId]:null}let l=[];if(i.children.forEach(c=>{const d=this.recursivelyAddPivotTotal(c,e,n,o);d&&(l=l.concat(d))}),i.children.length>1){const d=this.localeService.getLocaleTextFunc()("pivotColumnGroupTotals","Total"),p=this.createColDef(n,d,t.pivotKeys,!0);p.pivotTotalColumnIds=l,p.aggFunc=n.getAggFunc(),p.columnGroupShow=this.gos.get("suppressExpandablePivotGroups")?"open":void 0;const h=t.children;o?h.push(p):h.unshift(p),e.push(p)}return l}addRowGroupTotals(t,e){if(!this.gos.get("pivotRowTotals"))return;const n=this.gos.get("pivotRowTotals")==="after",i=this.funcColsService.getValueColumns().slice();n||i.reverse();const l=i.length>1||!this.gos.get("removePivotHeaderRowWhenSingleValueColumn");for(let c=0;c<i.length;c++){const d=i[c],p=this.columnNameService.getDisplayNameForColumn(d,"header"),h=this.createColDef(d,p,[]),m=[];for(let b=0;b<e.length;b++){const w=e[b];w.pivotValueColumn===d&&m.push(w.colId)}h.pivotTotalColumnIds=m,h.colId=Vu+h.colId;const y=l?{children:[h],pivotKeys:[],groupId:`${Vu}_pivotGroup_${d.getColId()}`}:h;e.push(h),n?t.push(y):t.unshift(y)}}createColDef(t,e,n,o=!1){const i={};if(t){const l=t.getColDef();Object.assign(i,l),i.hide=!1}return i.headerName=e,i.colId=this.generateColumnId(n||[],t&&!o?t.getColId():""),i.field=i.colId,i.valueGetter=l=>{var c;return(c=l.data)==null?void 0:c[l.colDef.field]},i.pivotKeys=n,i.pivotValueColumn=t,i.filter===!0&&(i.filter="agNumberColumnFilter"),i}sameAggFuncs(t){if(t.length==1)return!0;for(let e=1;e<t.length;e++)if(t[e]!==t[0])return!1;return!0}headerNameComparator(t,e,n){return t?t(e.headerName,n.headerName):e.headerName&&!n.headerName?1:!e.headerName&&n.headerName?-1:!e.headerName||!n.headerName?0:e.headerName<n.headerName?-1:e.headerName>n.headerName?1:0}merge(t,e){e.forEach((n,o)=>{const l=[...t.has(o)?t.get(o):[],...n];t.set(o,l)})}generateColumnGroupId(t){return`pivotGroup_${this.funcColsService.getPivotColumns().map(n=>n.getColId()).join("-")}_${t.join("-")}`}generateColumnId(t,e){return`pivot_${this.funcColsService.getPivotColumns().map(o=>o.getColId()).join("-")}_${t.join("-")}_${e}`}createColDefsFromFields(t){const e={};for(let i=0;i<t.length;i++){const c=t[i].split(this.fieldSeparator);let d=e;for(let p=0;p<c.length;p++){const h=c[p];d[h]==null&&(d[h]={}),d=d[h]}}const n=(i,l,c,d)=>{const p=[];for(const y in c){const b=c[y],w=n(`${i}${this.fieldSeparator}${y}`,y,b,d+1);p.push(w)}if(p.length===0){const y=this.columnModel.getColDefCol(l);if(y){const w=this.columnNameService.getDisplayNameForColumn(y,"header")??l,S=this.createColDef(y,w,void 0,!1);return S.colId=i,S.aggFunc=y.getAggFunc(),S.valueGetter=M=>{var O;return(O=M.data)==null?void 0:O[i]},S}return{colId:i,headerName:l,valueGetter:w=>{var S;return(S=w.data)==null?void 0:S[i]}}}return this.gos.get("removePivotHeaderRowWhenSingleValueColumn")&&p.length===1&&"colId"in p[0]?(p[0].headerName=l,p[0]):{openByDefault:this.pivotDefaultExpanded===-1||d<this.pivotDefaultExpanded,groupId:i,headerName:l,children:p}},o=[];for(const i in e){const l=e[i],c=n(i,i,l,0);o.push(c)}return o}},Au="Exceeded maximum allowed pivot column count.",X_=class extends T.BeanStub{constructor(){super(...arguments),this.beanName="pivotStage",this.uniqueValues={},this.lastTimeFailed=!1,this.maxUniqueValues=-1,this.currentUniqueCount=0}wireBeans(t){this.valueService=t.valueService,this.columnModel=t.columnModel,this.pivotResultColsService=t.pivotResultColsService,this.funcColsService=t.funcColsService,this.pivotColDefService=t.pivotColDefService}execute(t){const e=t.changedPath;this.columnModel.isPivotActive()?this.executePivotOn(e):this.executePivotOff(e)}executePivotOff(t){this.aggregationColumnsHashLastTime=null,this.uniqueValues={},this.pivotResultColsService.isPivotResultColsPresent()&&(this.pivotResultColsService.setPivotResultCols(null,"rowModelUpdated"),t&&t.setInactive())}executePivotOn(t){const e=this.funcColsService.getValueColumns().length??1,n=this.gos.get("pivotMaxGeneratedColumns");this.maxUniqueValues=n===-1?-1:n/e;let o;try{o=this.bucketUpRowNodes(t)}catch(C){if(C.message===Au){this.pivotResultColsService.setPivotResultCols([],"rowModelUpdated"),this.eventService.dispatchEvent({type:"pivotMaxColumnsExceeded",message:C.message}),this.lastTimeFailed=!0;return}throw C}const i=this.setUniqueValues(o),l=this.funcColsService.getValueColumns(),c=l.map(C=>`${C.getId()}-${C.getColDef().headerName}`).join("#"),d=l.map(C=>C.getAggFunc().toString()).join("#"),p=this.aggregationColumnsHashLastTime!==c,h=this.aggregationFuncsHashLastTime!==d;this.aggregationColumnsHashLastTime=c,this.aggregationFuncsHashLastTime=d;const m=this.funcColsService.getRowGroupColumns().map(C=>C.getId()).join("#"),y=m!==this.groupColumnsHashLastTime;this.groupColumnsHashLastTime=m;const b=this.gos.get("pivotRowTotals"),w=this.gos.get("pivotColumnGroupTotals"),S=this.gos.get("suppressExpandablePivotGroups"),M=this.gos.get("removePivotHeaderRowWhenSingleValueColumn"),O=b!==this.pivotRowTotalsLastTime||w!==this.pivotColumnGroupTotalsLastTime||S!==this.suppressExpandablePivotGroupsLastTime||M!==this.removePivotHeaderRowWhenSingleValueColumnLastTime;if(this.pivotRowTotalsLastTime=b,this.pivotColumnGroupTotalsLastTime=w,this.suppressExpandablePivotGroupsLastTime=S,this.removePivotHeaderRowWhenSingleValueColumnLastTime=M,this.lastTimeFailed||i||p||y||h||O){const{pivotColumnGroupDefs:C,pivotColumnDefs:I}=this.pivotColDefService.createPivotColumnDefs(this.uniqueValues);this.pivotColumnDefs=I,this.pivotResultColsService.setPivotResultCols(C,"rowModelUpdated"),t&&t.setInactive()}this.lastTimeFailed=!1}setUniqueValues(t){const e=JSON.stringify(t),n=JSON.stringify(this.uniqueValues);return e!==n?(this.uniqueValues=t,!0):!1}bucketUpRowNodes(t){this.currentUniqueCount=0;const e={};t.forEachChangedNodeDepthFirst(o=>{o.leafGroup&&(o.childrenMapped=null)});const n=o=>{var i;o.leafGroup?this.bucketRowNode(o,e):(i=o.childrenAfterFilter)==null||i.forEach(n)};return t.executeFromRootNode(n),e}bucketRowNode(t,e){const n=this.funcColsService.getPivotColumns();n.length===0?t.childrenMapped=null:t.childrenMapped=this.bucketChildren(t.childrenAfterFilter,n,0,e),t.sibling&&(t.sibling.childrenMapped=t.childrenMapped)}bucketChildren(t,e,n,o){const i={},l=e[n];if(t.forEach(c=>{let d=this.valueService.getKeyForNode(l,c);if(T._missing(d)&&(d=""),!o[d]){this.currentUniqueCount+=1,o[d]={};const p=this.maxUniqueValues!==-1,h=this.currentUniqueCount>this.maxUniqueValues;if(p&&h)throw Error(Au)}i[d]||(i[d]=[]),i[d].push(c)}),n===e.length-1)return i;{const c={};return T._iterateObject(i,(d,p)=>{c[d]=this.bucketChildren(p,e,n+1,o[d])}),c}}getPivotColumnDefs(){return this.pivotColumnDefs}};function J_(t,e,n){t.aggFuncService&&t.aggFuncService.addAggFuncs({key:n})}function Q_(t,e){t.aggFuncService&&t.aggFuncService.addAggFuncs(e)}function ev(t){t.aggFuncService&&t.aggFuncService.clear()}function tv(t,e,n){t.funcColsService.setColumnAggFunc(e,n,"api")}function nv(t){return t.columnModel.isPivotMode()}function rv(t,e,n){return t.pivotResultColsService.lookupPivotResultCol(e,n)}function ov(t,e){t.funcColsService.setValueColumns(e,"api")}function iv(t){return t.funcColsService.getValueColumns()}function sv(t,e){t.funcColsService.removeValueColumns([e],"api")}function av(t,e){t.funcColsService.removeValueColumns(e,"api")}function lv(t,e){t.funcColsService.addValueColumns([e],"api")}function cv(t,e){t.funcColsService.addValueColumns(e,"api")}function dv(t,e){t.funcColsService.setRowGroupColumns(e,"api")}function uv(t,e){t.funcColsService.removeRowGroupColumns([e],"api")}function pv(t,e){t.funcColsService.removeRowGroupColumns(e,"api")}function hv(t,e){t.funcColsService.addRowGroupColumns([e],"api")}function fv(t,e){t.funcColsService.addRowGroupColumns(e,"api")}function mv(t,e,n){t.funcColsService.moveRowGroupColumn(e,n,"api")}function gv(t){return t.funcColsService.getRowGroupColumns()}function yv(t,e){t.funcColsService.setPivotColumns(e,"api")}function _v(t,e){t.funcColsService.removePivotColumns([e],"api")}function vv(t,e){t.funcColsService.removePivotColumns(e,"api")}function Cv(t,e){t.funcColsService.addPivotColumns([e],"api")}function wv(t,e){t.funcColsService.addPivotColumns(e,"api")}function bv(t){return t.funcColsService.getPivotColumns()}function xv(t,e){t.pivotResultColsService.setPivotResultCols(e,"api")}function kv(t){const e=t.pivotResultColsService.getPivotResultCols();return e?e.list:null}var Ev=class extends T.BeanStub{constructor(){super(...arguments),this.beanName="showRowGroupColsService"}wireBeans(t){this.columnModel=t.columnModel,this.funcColsService=t.funcColsService}refresh(){this.showRowGroupCols=[],this.showRowGroupColsMap={},this.columnModel.getCols().forEach(t=>{const n=t.getColDef().showRowGroup,o=typeof n=="string";!o&&!(n===!0)||(this.showRowGroupCols.push(t),o?this.showRowGroupColsMap[n]=t:this.funcColsService.getRowGroupColumns().forEach(c=>{this.showRowGroupColsMap[c.getId()]=t}))})}getShowRowGroupCols(){return this.showRowGroupCols}getShowRowGroupCol(t){return this.showRowGroupColsMap[t]}},fi="32.3.3",_l=T._defineModule({version:fi,moduleName:`${T.ModuleNames.RowGroupingModule}-core`,beans:[A_,L_,K_,Y_,X_,b_,B_,Ev,F_],userComponents:[{name:"agGroupRowRenderer",classImp:Me.GroupCellRenderer},{name:"agGroupCellRenderer",classImp:Me.GroupCellRenderer}],controllers:[{name:"groupCellRendererCtrl",classImp:Me.GroupCellRendererCtrl}],dependantModules:[Me.EnterpriseCoreModule]}),Sv=T._defineModule({version:fi,moduleName:`${T.ModuleNames.RowGroupingModule}-api`,apiFunctions:{addAggFunc:J_,addAggFuncs:Q_,clearAggFuncs:ev,setColumnAggFunc:tv,isPivotMode:nv,getPivotResultColumn:rv,setValueColumns:ov,getValueColumns:iv,removeValueColumn:sv,removeValueColumns:av,addValueColumn:lv,addValueColumns:cv,setRowGroupColumns:dv,removeRowGroupColumn:uv,removeRowGroupColumns:pv,addRowGroupColumn:hv,addRowGroupColumns:fv,getRowGroupColumns:gv,moveRowGroupColumn:mv,setPivotColumns:yv,removePivotColumn:_v,removePivotColumns:vv,addPivotColumn:Cv,addPivotColumns:wv,getPivotColumns:bv,setPivotResultColumns:xv,getPivotResultColumns:kv},dependantModules:[_l]}),Bu=T._defineModule({version:fi,moduleName:"@ag-grid-enterprise/group-filter",userComponents:[{name:"agGroupColumnFilter",classImp:O_}],dependantModules:[_l,T._ColumnFilterModule]}),Tv=T._defineModule({version:fi,moduleName:"@ag-grid-enterprise/group-floating-filter",userComponents:[{name:"agGroupColumnFloatingFilter",classImp:M_}],dependantModules:[Bu,T._FloatingFilterModule]}),Nv=T._defineModule({version:fi,moduleName:T.ModuleNames.RowGroupingModule,dependantModules:[_l,Sv,Bu,Tv]}),Pu=class extends fl{constructor(t){super(t,"aggregation")}postConstruct(){const t=this.localeService.getLocaleTextFunc(),e=t("valueColumnsEmptyMessage","Drag here to aggregate"),n=t("values","Values");super.init({icon:T._createIconNoSpan("valuePanel",this.gos,null),emptyMessage:e,title:n}),this.addManagedEventListeners({columnValueChanged:this.refreshGui.bind(this)})}getAriaLabel(){return this.localeService.getLocaleTextFunc()("ariaValuesDropZonePanelLabel","Values")}getTooltipParams(){const t=super.getTooltipParams();return t.location="valueColumnsList",t}getIconName(){return this.isPotentialDndItems()?"aggregate":"notAllowed"}isItemDroppable(t,e){return this.gos.get("functionsReadOnly")||!t.isPrimary()?!1:t.isAllowValue()&&(!t.isValueActive()||this.isSourceEventFromTarget(e))}updateItems(t){this.funcColsService.setValueColumns(t,"toolPanelUi")}getExistingItems(){return this.funcColsService.getValueColumns()}},Ru=300,Vv=class extends T.Component{constructor(){super(`<div class="ag-column-select-header" role="presentation">
24
+ `),this.eFloatingFilter=T.RefPlaceholder,this.haveAddedColumnListeners=!1}wireBeans(t){this.columnNameService=t.columnNameService,this.filterManager=t.filterManager}init(t){this.params=t;const e=this.gos.get("groupDisplayType")==="multipleColumns";return new T.AgPromise(n=>{this.params.parentFilterInstance(o=>{this.parentFilterInstance=o,e?this.setupUnderlyingFloatingFilterElement().then(()=>n()):(this.setupReadOnlyFloatingFilterElement(),n())})}).then(()=>{this.addManagedListeners(this.parentFilterInstance,{selectedColumnChanged:this.onSelectedColumnChanged.bind(this),columnRowGroupChanged:this.onColumnRowGroupChanged.bind(this)})})}onParamsUpdated(t){this.refresh(t)}refresh(t){this.params=t,this.setParams()}setParams(){var n;const t=this.columnNameService.getDisplayNameForColumn(this.params.column,"header",!0),e=this.localeService.getLocaleTextFunc();(n=this.eFloatingFilterText)==null||n.setInputAriaLabel(`${t} ${e("ariaFilterInput","Filter Input")}`)}setupReadOnlyFloatingFilterElement(){this.eFloatingFilterText||(this.eFloatingFilterText=this.createManagedBean(new T.AgInputTextField),this.eFloatingFilterText.setDisabled(!0).addGuiEventListener("click",()=>this.params.showParentFilter()),this.setParams()),this.updateDisplayedValue(),this.eFloatingFilter.appendChild(this.eFloatingFilterText.getGui())}setupUnderlyingFloatingFilterElement(){this.showingUnderlyingFloatingFilter=!1,this.underlyingFloatingFilter=void 0,T._clearElement(this.eFloatingFilter);const t=this.parentFilterInstance.getSelectedColumn();if(t&&!t.isVisible()){const e=this.filterManager.getFloatingFilterCompDetails(t,this.params.showParentFilter);if(e)return this.haveAddedColumnListeners||(this.haveAddedColumnListeners=!0,this.addManagedListeners(t,{visibleChanged:this.onColumnVisibleChanged.bind(this),colDefChanged:this.onColDefChanged.bind(this)})),e.newAgStackInstance().then(n=>{var o,i;this.underlyingFloatingFilter=n,(i=this.underlyingFloatingFilter)==null||i.onParentModelChanged((o=this.parentFilterInstance.getSelectedFilter())==null?void 0:o.getModel()),this.appendChild(n.getGui()),this.showingUnderlyingFloatingFilter=!0})}return this.setupReadOnlyFloatingFilterElement(),T.AgPromise.resolve()}onColumnVisibleChanged(){this.setupUnderlyingFloatingFilterElement()}onColDefChanged(t){var n,o,i;if(!t.column)return;const e=this.filterManager.getFloatingFilterCompDetails(t.column,this.params.showParentFilter);e&&((n=this.underlyingFloatingFilter)!=null&&n.refresh?this.underlyingFloatingFilter.refresh(e.params):(i=(o=this.underlyingFloatingFilter)==null?void 0:o.onParamsUpdated)==null||i.call(o,e.params))}onParentModelChanged(t,e){var n,o;this.showingUnderlyingFloatingFilter?(o=this.underlyingFloatingFilter)==null||o.onParentModelChanged((n=this.parentFilterInstance.getSelectedFilter())==null?void 0:n.getModel(),e):this.updateDisplayedValue()}updateDisplayedValue(){if(!this.parentFilterInstance||!this.eFloatingFilterText)return;const t=this.parentFilterInstance.getSelectedFilter();if(!t){this.eFloatingFilterText.setValue(""),this.eFloatingFilterText.setDisplayed(!1);return}if(this.eFloatingFilterText.setDisplayed(!0),t.getModelAsString){const e=t.getModel();this.eFloatingFilterText.setValue(e==null?"":t.getModelAsString(e))}else this.eFloatingFilterText.setValue("")}onSelectedColumnChanged(){this.showingUnderlyingFloatingFilter||this.updateDisplayedValue()}onColumnRowGroupChanged(){this.showingUnderlyingFloatingFilter||this.updateDisplayedValue()}destroy(){super.destroy()}},_l=class{constructor(){this.allSets={},this.allParents=[]}removeFromChildrenAfterGroup(t,e){const n=this.getSet(t);n.removeFromChildrenAfterGroup[e.id]=!0}isRemoveFromAllLeafChildren(t,e){return!!this.getSet(t).removeFromAllLeafChildren[e.id]}preventRemoveFromAllLeafChildren(t,e){const n=this.getSet(t);delete n.removeFromAllLeafChildren[e.id]}removeFromAllLeafChildren(t,e){const n=this.getSet(t);n.removeFromAllLeafChildren[e.id]=!0}getSet(t){return this.allSets[t.id]||(this.allSets[t.id]={removeFromAllLeafChildren:{},removeFromChildrenAfterGroup:{}},this.allParents.push(t)),this.allSets[t.id]}getAllParents(){return this.allParents}flush(){this.allParents.forEach(t=>{var o;const e=this.allSets[t.id];t.childrenAfterGroup=t.childrenAfterGroup.filter(i=>!e.removeFromChildrenAfterGroup[i.id]),t.allLeafChildren=((o=t.allLeafChildren)==null?void 0:o.filter(i=>!e.removeFromAllLeafChildren[i.id]))??null,t.updateHasChildren();const n=t.sibling;n&&(n.childrenAfterGroup=t.childrenAfterGroup,n.allLeafChildren=t.allLeafChildren)}),this.allSets={},this.allParents.length=0}};function U_(t){if(!t)return!1;const e=t.length;if(e<2)return!1;let n=!1;for(let o=1;o<e;o++)if(xu(t[o-1],t[o])>0){n=!0;break}return n?(t.sort(xu),!0):!1}function xu(t,e){const n=t.sourceRowIndex,o=e.sourceRowIndex,i=n>=0,l=o>=0,c=i&&l,d=!i&&!l;return c?n-o:d?t.__objectId-e.__objectId:i?1:-1}var Z_=class extends T.BeanStub{wireBeans(t){this.beans=t,this.columnModel=t.columnModel,this.funcColsService=t.funcColsService,this.valueService=t.valueService,this.selectionService=t.selectionService,this.showRowGroupColsService=t.showRowGroupColsService}execute(t){const e=this.createGroupingDetails(t);if(e.transactions)this.handleTransaction(e);else{const n=t.afterColumnsChanged===!0;this.shotgunResetEverything(e,n)}this.positionLeafsAndGroups(t.changedPath),this.orderGroups(e)}positionLeafsAndGroups(t){t.forEachChangedNodeDepthFirst(e=>{if(e.childrenAfterGroup){const n=[],o=[];let i;e.childrenAfterGroup.forEach(l=>{var c;(c=l.childrenAfterGroup)!=null&&c.length?l.key===""&&!i?i=l:o.push(l):n.push(l)}),i&&o.push(i),e.childrenAfterGroup=[...n,...o]}},!1)}createGroupingDetails(t){const{rowNode:e,changedPath:n,rowNodeTransactions:o,rowNodesOrderChanged:i}=t,l=this.funcColsService.getRowGroupColumns();return{expandByDefault:this.gos.get("groupDefaultExpanded"),groupedCols:l,rootNode:e,pivotMode:this.columnModel.isPivotMode(),groupedColCount:(l==null?void 0:l.length)??0,transactions:o,rowNodesOrderChanged:!!i,changedPath:n,groupAllowUnbalanced:this.gos.get("groupAllowUnbalanced"),isGroupOpenByDefault:this.gos.getCallback("isGroupOpenByDefault"),initialGroupOrderComparator:this.gos.getCallback("initialGroupOrderComparator"),suppressGroupMaintainValueType:this.gos.get("suppressGroupMaintainValueType"),keyCreators:(l==null?void 0:l.map(d=>d.getColDef().keyCreator))??[]}}handleTransaction(t){t.transactions.forEach(e=>{const n=new _l;T._existsAndNotEmpty(e.remove)&&this.removeNodes(e.remove,t,n),T._existsAndNotEmpty(e.update)&&this.moveNodesInWrongPath(e.update,t,n),T._existsAndNotEmpty(e.add)&&this.insertNodes(e.add,t);const o=n.getAllParents().slice();n.flush(),this.removeEmptyGroups(o,t)}),t.rowNodesOrderChanged&&this.sortChildren(t)}sortChildren(t){t.changedPath.forEachChangedNodeDepthFirst(e=>{U_(e.childrenAfterGroup)&&t.changedPath.addParentNode(e)},!1,!0)}orderGroups(t){const e=t.initialGroupOrderComparator;T._exists(e)&&n(t.rootNode);function n(o){T._exists(o.childrenAfterGroup)&&!o.leafGroup&&(o.childrenAfterGroup.sort((l,c)=>e({nodeA:l,nodeB:c})),o.childrenAfterGroup.forEach(l=>n(l)))}}getExistingPathForNode(t,e){const n=[];let o=t.parent;for(;o&&o!==e.rootNode;)n.push({key:o.key,rowGroupColumn:o.rowGroupColumn,field:o.field}),o=o.parent;return n.reverse(),n}moveNodesInWrongPath(t,e,n){t.forEach(o=>{e.changedPath.isActive()&&e.changedPath.addParentNode(o.parent);const i=p=>p.key,l=this.getExistingPathForNode(o,e).map(i),c=this.getGroupInfo(o,e).map(i);T._areEqual(l,c)||this.moveNode(o,e,n)})}moveNode(t,e,n){if(this.removeNodesFromParents([t],e,n),this.insertOneNode(t,e,n),t.setData(t.data),e.changedPath.isActive()){const o=t.parent;e.changedPath.addParentNode(o)}}removeNodes(t,e,n){this.removeNodesFromParents(t,e,n),e.changedPath.isActive()&&t.forEach(o=>e.changedPath.addParentNode(o.parent))}forEachParentGroup(t,e,n){let o=e;for(;o&&o!==t.rootNode;)n(o),o=o.parent}removeNodesFromParents(t,e,n){const o=n==null,i=n||new _l;t.forEach(l=>{this.removeFromParent(l,i),this.forEachParentGroup(e,l.parent,c=>{i.removeFromAllLeafChildren(c,l)})}),o&&i.flush()}removeEmptyGroups(t,e){let n=!0;const o=i=>{var p;const l=this.getChildrenMappedKey(i.key,i.rowGroupColumn),c=i.parent;return(c!=null&&c.childrenMapped?!c.childrenMapped[l]:!0)?!1:!!i.group&&(((p=i.childrenAfterGroup)==null?void 0:p.length)??0)===0};for(;n;){n=!1;const i=new _l;t.forEach(l=>{this.forEachParentGroup(e,l,c=>{o(c)&&(n=!0,this.removeFromParent(c,i),c.setSelectedParams({newValue:!1,source:"rowGroupChanged"}))})}),i.flush()}}removeFromParent(t,e){var o;t.parent&&(e?e.removeFromChildrenAfterGroup(t.parent,t):(T._removeFromArray(t.parent.childrenAfterGroup,t),t.parent.updateHasChildren()));const n=this.getChildrenMappedKey(t.key,t.rowGroupColumn);(o=t.parent)!=null&&o.childrenMapped&&delete t.parent.childrenMapped[n],t.setRowTop(null),t.setRowIndex(null)}addToParent(t,e){const n=this.getChildrenMappedKey(t.key,t.rowGroupColumn);e!=null&&e.childrenMapped&&e.childrenMapped[n]!==t&&(e.childrenMapped[n]=t,e.childrenAfterGroup.push(t),e.setGroup(!0))}areGroupColsEqual(t,e){return t==null||e==null||t.pivotMode!==e.pivotMode?!1:T._areEqual(t.groupedCols,e.groupedCols)&&T._areEqual(t.keyCreators,e.keyCreators)}checkAllGroupDataAfterColsChanged(t){const e=n=>{n&&n.forEach(o=>{var c;if(!o.group)return;const l={field:o.field,key:o.key,rowGroupColumn:o.rowGroupColumn,leafNode:(c=o.allLeafChildren)==null?void 0:c[0]};this.setGroupData(o,l,t),e(o.childrenAfterGroup)})};e(t.rootNode.childrenAfterGroup)}shotgunResetEverything(t,e){if(this.noChangeInGroupingColumns(t,e))return;this.selectionService.filterFromSelection(l=>l&&!l.group);const{groupedCols:n}=t,o=t.rootNode;o.leafGroup=n.length===0,o.childrenAfterGroup=[],o.childrenMapped={},o.updateHasChildren();const i=o.sibling;i&&(i.childrenAfterGroup=o.childrenAfterGroup,i.childrenMapped=o.childrenMapped),this.insertNodes(o.allLeafChildren,t)}noChangeInGroupingColumns(t,e){let n=!1;const o=this.showRowGroupColsService.getShowRowGroupCols(),i=o?o.map(l=>l.getId()).join("-"):"";return e&&(n=this.areGroupColsEqual(t,this.oldGroupingDetails),this.oldGroupDisplayColIds!==i&&this.checkAllGroupDataAfterColsChanged(t)),this.oldGroupingDetails=t,this.oldGroupDisplayColIds=i,n}insertNodes(t,e){t.forEach(n=>{this.insertOneNode(n,e),e.changedPath.isActive()&&e.changedPath.addParentNode(n.parent)})}insertOneNode(t,e,n){const o=this.getGroupInfo(t,e),i=this.findParentForNode(t,o,e,n);i.group||T._warnOnce("duplicate group keys for row data, keys should be unique",[i.data,t.data]),t.parent=i,t.level=o.length,i.childrenAfterGroup.push(t),i.updateHasChildren()}findParentForNode(t,e,n,o){let i=n.rootNode;return e.forEach((l,c)=>{i=this.getOrCreateNextNode(i,l,c,n),o!=null&&o.isRemoveFromAllLeafChildren(i,t)?o==null||o.preventRemoveFromAllLeafChildren(i,t):i.allLeafChildren.push(t)}),i}getOrCreateNextNode(t,e,n,o){var c;const i=this.getChildrenMappedKey(e.key,e.rowGroupColumn);let l=(c=t==null?void 0:t.childrenMapped)==null?void 0:c[i];return l||(l=this.createGroup(e,t,n,o),this.addToParent(l,t)),l}createGroup(t,e,n,o){const i=new T.RowNode(this.beans);return i.group=!0,i.field=t.field,i.rowGroupColumn=t.rowGroupColumn,this.setGroupData(i,t,o),i.key=t.key,i.id=this.createGroupId(i,e,n),i.level=n,i.leafGroup=n===o.groupedColCount-1,i.allLeafChildren=[],i.setAllChildrenCount(0),i.rowGroupIndex=n,i.childrenAfterGroup=[],i.childrenMapped={},i.updateHasChildren(),i.parent=e,this.setExpandedInitialValue(o,i),i}createGroupId(t,e,n){const o=(i,l)=>{if(!i.rowGroupColumn)return null;const c=l?o(l,l.parent):null;return`${c==null?"":c+"-"}${i.rowGroupColumn.getColId()}-${i.key}`};return T.RowNode.ID_PREFIX_ROW_GROUP+o(t,e)}setGroupData(t,e,n){t.groupData={},this.showRowGroupColsService.getShowRowGroupCols().forEach(i=>{const l=t.rowGroupColumn;l!==null&&i.isRowGroupDisplayed(l.getId())&&(n.suppressGroupMaintainValueType?t.groupData[i.getColId()]=e.key:t.groupData[i.getColId()]=this.valueService.getValue(l,e.leafNode))})}getChildrenMappedKey(t,e){return e?e.getId()+"-"+t:t}setExpandedInitialValue(t,e){if(t.pivotMode&&e.leafGroup){e.expanded=!1;return}const n=t.isGroupOpenByDefault;if(n){const o={rowNode:e,field:e.field,key:e.key,level:e.level,rowGroupColumn:e.rowGroupColumn};e.expanded=n(o)==!0;return}if(t.expandByDefault===-1){e.expanded=!0;return}e.expanded=e.level<t.expandByDefault}getGroupInfo(t,e){const n=[];return e.groupedCols.forEach(o=>{let i=this.valueService.getKeyForNode(o,t),l=i!=null&&i!=="";if((e.pivotMode||!e.groupAllowUnbalanced)&&!l&&(i="",l=!0),l){const d={key:i,field:o.getColDef().field,rowGroupColumn:o,leafNode:t};n.push(d)}}),n}},W_=(t,e)=>t.treeNode.oldSourceRowIndex-e.treeNode.oldSourceRowIndex,ft=Object.freeze([]),j_=ft.values(),bs=(t,e)=>{t.parent=null,t.treeNode=null,e?t.childrenAfterGroup=[]:(t.level=0,t.childrenAfterGroup=null,t.allLeafChildren=null)},H_=class Tg{constructor(e,n,o){this.parent=e,this.key=n,this.level=o,this.children=null,this.invalidatedHead=null,this.invalidatedNext=void 0,this.row=null,this.oldRow=null,this.duplicateRows=null,this.childrenAfterGroup=ft,this.allLeafChildren=ft,this.childrenChanged=!1,this.leafChildrenChanged=!1,this.oldSourceRowIndex=-1}isEmptyFillerNode(){var e,n;return!((e=this.row)!=null&&e.data)&&!((n=this.children)!=null&&n.size)}hasChildren(){var e;return!!((e=this.children)!=null&&e.size)}enumChildren(){var e;return((e=this.children)==null?void 0:e.values())??j_}upsertKey(e){var o,i;typeof e!="string"&&(e=String(e));let n=(o=this.children)==null?void 0:o.get(e);return n||(n=new Tg(this,e,this.level+1),(i=this.children??(this.children=new Map))==null||i.set(n.key,n)),n}destroy(){var o;const{row:e,parent:n}=this;n!==null&&((o=n==null?void 0:n.children)==null||o.delete(this.key),e!==null&&bs(e,!0),this.parent=null)}setRow(e){const{level:n,row:o,childrenAfterGroup:i}=this;if(n<0)o!==null&&o!==e&&bs(o,!0);else{if(o===e)return!1;o!==null?(e.allLeafChildren=o.allLeafChildren??this.allLeafChildren??ft,bs(o,!1)):e.allLeafChildren=this.allLeafChildren??ft}return e.level=n,e.childrenAfterGroup=i,e.treeNode=this,this.row=e,!0}removeRow(e){const{level:n,row:o,duplicateRows:i,childrenAfterGroup:l}=this;if(o===e){const c=this.popDuplicateRow();c?(this.row=c,c.childrenAfterGroup=l,n>=0&&(c.allLeafChildren=o.allLeafChildren??this.allLeafChildren??ft)):this.row=null}else{if(!(i!=null&&i.delete(e)))return!1;i.size===0&&(this.duplicateRows=null)}return bs(e,n<0),!0}addDuplicateRow(e){const{level:n}=this;let o=this.duplicateRows;if(o===null)o=new Set,this.duplicateRows=o;else if(o.has(e))return!1;return o.add(e),e.treeNode=this,e.level=n,n>=0&&(e.allLeafChildren=ft),e.childrenAfterGroup=ft,!0}sortFirstDuplicateRow(){const e=this.duplicateRows,n=this.row;if(!n||!e)return n;let o=n;for(const i of e)i.sourceRowIndex<o.sourceRowIndex&&(o=i);return o!==n&&(o.childrenAfterGroup=this.childrenAfterGroup,o.allLeafChildren=n.allLeafChildren??this.allLeafChildren??ft,n.childrenAfterGroup=ft,n.allLeafChildren=ft,e.delete(o),e.add(n),this.row=o),o}popDuplicateRow(){let e=null;const n=this.duplicateRows;return n!==null&&(e=n.values().next().value,e!==null&&n.delete(e)&&n.size===0&&(this.duplicateRows=null)),e}dequeueInvalidated(){const e=this.invalidatedHead;return e!==null&&(this.invalidatedHead=e.invalidatedNext??null,e.invalidatedNext=void 0),e}invalidate(){let e=this,n=this.parent;for(;n!==null&&e.invalidatedNext===void 0;)e.invalidatedNext=n.invalidatedHead,n.invalidatedHead=e,e=n,n=e.parent}invalidateOrder(){var n,o;const e=this.parent;e!==null&&!e.childrenChanged&&((((n=this.children)==null?void 0:n.size)??0)>1||!((o=e.row)!=null&&o.data))&&(e.childrenChanged=!0,e.invalidate())}getRowPosition(){var n,o;const e=this.row;return e!=null&&e.data?e.sourceRowIndex:((o=(n=this.childrenAfterGroup[0])==null?void 0:n.treeNode)==null?void 0:o.oldSourceRowIndex)??this.oldSourceRowIndex}updateChildrenAfterGroup(){var d;this.childrenChanged=!1;const e=((d=this.children)==null?void 0:d.size)??0;if(e===0)return this.childrenAfterGroup.length===0?!1:(this.leafChildrenChanged=!0,this.childrenAfterGroup=ft,this.row.childrenAfterGroup=ft,!0);let n=!1,o=this.childrenAfterGroup;o===ft?(o=new Array(e),this.childrenAfterGroup=o,this.row.childrenAfterGroup=o,n=!0):o.length!==e&&(o.length=e,n=!0);let i=0,l=-1,c=!1;for(const p of this.enumChildren()){const h=p.getRowPosition();h<l&&(c=!0),l=h,p.oldSourceRowIndex=h;const m=p.row;o[i]!==m&&(o[i]=m,n=!0),++i}return n&&(this.leafChildrenChanged=!0),c&&this.reorderChildrenList(o),n||c}reorderChildrenList(e){const n=e.length,o=this.children;e.sort(W_),o.clear();for(let i=0;i<n;++i){const l=e[i].treeNode;o.set(l.key,l)}}updateAllLeafChildren(){var c,d;const{parent:e,row:n,childrenAfterGroup:o}=this;this.leafChildrenChanged=!1;let i=!1;const l=o.length;if(l===0)i=((c=n.allLeafChildren)==null?void 0:c.length)!==0,n.allLeafChildren=ft,this.allLeafChildren=ft;else if(l===1&&((d=o[0].allLeafChildren)!=null&&d.length))n.allLeafChildren=o[0].allLeafChildren,this.allLeafChildren=null,i=!0;else{let p=this.allLeafChildren;(p===ft||p===null)&&(p=[],this.allLeafChildren=p);const h=p.length;let m=0;for(let y=0;y<l;++y){const b=o[y],w=b.allLeafChildren,S=w.length;if(S)for(let M=0;M<S;++M){const O=w[M];(m>=h||p[m]!==O)&&(p[m]=O,i=!0),++m}else(m>=h||p[m]!==b)&&b&&(p[m]=b,i=!0),++m}h!==m&&(p.length=m,i=!0),n.allLeafChildren!==p&&(n.allLeafChildren=p,i=!0)}i&&e&&(e.leafChildrenChanged=!0)}},ku=t=>(t.treeNodeFlags&1)!==0,Eu=t=>(t.treeNodeFlags&2)!==0,Su=t=>(t.treeNodeFlags&4)!==0,q_=t=>(t.treeNodeFlags&8)!==0,Tu=t=>(t.treeNodeFlags&16)!==0,Nu=(t,e)=>{e?t.treeNodeFlags|=2:t.treeNodeFlags&=-3},K_=t=>{const e=t.treeNodeFlags;e&1&&(t.treeNodeFlags=e|4)},Y_=t=>{const e=t.treeNodeFlags;e&1&&(t.treeNodeFlags=e|12)},mr=t=>{t.treeNodeFlags|=16},Vu=t=>{t.treeNodeFlags=1|t.treeNodeFlags&-29},fi=t=>{t.treeNodeFlags=0},X_=class extends T.BeanStub{constructor(){super(...arguments),this.rowsPendingDestruction=null,this.root=new H_(null,"",-1)}wireBeans(t){this.beans=t,this.showRowGroupColsService=t.showRowGroupColsService}destroy(){const t=this.root.row;t!==null&&(this.root.removeRow(t),fi(t)),this.destroyTree(this.root),this.commitDestroyedRows(),super.destroy()}execute(t){const{rowNodeTransactions:e,rowNodesOrderChanged:n,changedPath:o}=t,i=t.rowNode,l=this.gos,c={changedPath:o,expandByDefault:l.get("groupDefaultExpanded"),suppressGroupMaintainValueType:l.get("suppressGroupMaintainValueType"),getDataPath:l.get("getDataPath"),isGroupOpenByDefault:l.getCallback("isGroupOpenByDefault"),initialGroupOrderComparator:l.getCallback("initialGroupOrderComparator")};this.root.setRow(i),i.leafGroup=!1;const p=i.sibling;p&&(p.childrenAfterGroup=i.childrenAfterGroup,p.childrenMapped=i.childrenMapped),e?this.handleTransaction(c,e,n):this.handleRowData(c,i,t.afterColumnsChanged===!0)}handleRowData(t,e,n){var i,l,c;const o=this.root;if(n||this.oldGroupDisplayColIds===void 0){const d=((l=(i=this.showRowGroupColsService)==null?void 0:i.getShowRowGroupCols())==null?void 0:l.map(p=>p.getId()).join("-"))??"";if(n){this.oldGroupDisplayColIds!==d&&this.checkAllGroupDataAfterColsChanged((c=o.row)==null?void 0:c.childrenAfterGroup);return}this.oldGroupDisplayColIds=d}this.clearTree(o),this.addOrUpdateRows(t,e.allLeafChildren,!1),this.commitTree(t)}handleTransaction(t,e,n){for(const{remove:o,update:i,add:l}of e)this.removeRows(o),this.addOrUpdateRows(t,i,!0),this.addOrUpdateRows(t,l,!1);n&&this.handleRowNodesOrderChanged(),this.commitTree(t)}handleRowNodesOrderChanged(){var e;const t=(e=this.root.row)==null?void 0:e.allLeafChildren;if(t)for(let n=0,o=t.length;n<o;++n){const i=t[n].treeNode;i&&i.oldSourceRowIndex!==n&&i.invalidateOrder()}}checkAllGroupDataAfterColsChanged(t){var e;for(let n=0,o=(t==null?void 0:t.length)??0;n<o;++n){const i=t[n];this.setGroupData(i,((e=i.treeNode)==null?void 0:e.key)??i.key),this.checkAllGroupDataAfterColsChanged(i.childrenAfterGroup)}}addOrUpdateRows(t,e,n){for(let o=0,i=(e==null?void 0:e.length)??0;o<i;++o){const l=e[o],c=this.upsertPath(this.getDataPath(t,l));c&&this.addOrUpdateRow(c,l,n)}}removeRows(t){for(let e=0,n=(t==null?void 0:t.length)??0;e<n;++e){const o=t[e],i=o.treeNode;i!==null&&this.removeRow(i,o)}}getDataPath({getDataPath:t},{data:e}){const n=(t==null?void 0:t(e))||ft;return n.length||T._warnOnce("getDataPath() should not return an empty path",[e]),n}upsertPath(t){let e=this.root;const n=t.length-1;for(let o=0;o<=n;++o){const i=e.upsertKey(t[o]);if(o>=n)return i.invalidate(),i;e=i}return null}addOrUpdateRow(t,e,n){var c;const{level:o,row:i}=t;if(o<0)return;let l=!1;if(i!==e){const d=e.treeNode;d!==null&&d!==t&&(d.removeRow(e),d.invalidate()),i===null?(t.setRow(e),l=!0):i.data?t.addDuplicateRow(e)&&(l=!0):(t.setRow(e),this.destroyRow(i,!0),l=!0)}n&&!Su(e)&&(K_(e),l=!0),l&&t.invalidate(),(c=this.rowsPendingDestruction)==null||c.delete(e)}removeRow(t,e){const{parent:n,level:o}=t;if(o<0)return;let i=!1;t.removeRow(e)&&(i=!0,n&&(n.childrenChanged=!0),this.destroyRow(e,!e.data)),i&&t.invalidate()}commitTree(t){var o;const e=this.root;this.commitInvalidatedChildren(t,e);const n=e.row;e.childrenChanged&&e.updateChildrenAfterGroup()&&mr(n),n.updateHasChildren(),Tu(n)&&(o=t.changedPath)!=null&&o.isActive()&&t.changedPath.addParentNode(n),Vu(n),this.commitDestroyedRows()}commitInvalidatedChildren(t,e){for(;;){const n=e.dequeueInvalidated();if(n===null)break;n.parent===e&&this.commitChild(t,e,n)}}commitChild(t,e,n){if(n.isEmptyFillerNode()){this.clearTree(n);return}this.commitNodePreOrder(e,n),this.commitInvalidatedChildren(t,n),this.commitNodePostOrder(t,e,n)}commitNodePreOrder(t,e){let n=e.row;if(n===null?(n=this.createFillerRow(e),e.setRow(n)):(n=e.sortFirstDuplicateRow(),n.allChildrenCount===void 0&&(n.allChildrenCount=null)),n.parent=t.row,e.oldRow!==n)for(const i of e.enumChildren()){const l=i.row;l!==null&&(l.parent=n)}const o=e.key;n.key!==o?(n.key=o,Y_(n),this.setGroupData(n,o)):n.groupData||this.setGroupData(n,o)}commitNodePostOrder(t,e,n){var h,m,y;const o=n.row,i=n.oldRow;if(n.isEmptyFillerNode()){this.clearTree(n);return}n.childrenChanged&&n.updateChildrenAfterGroup()&&mr(o),n.leafChildrenChanged&&n.updateAllLeafChildren();const l=n.getRowPosition();n.oldSourceRowIndex!==l&&(n.oldSourceRowIndex=l,e.childrenChanged=!0);const c=!!((h=o.childrenAfterGroup)!=null&&h.length),d=c||!o.data,p=o.group;p!==d?(mr(o),o.setGroup(d),!d&&!o.expanded&&Nu(o,!1)):o.hasChildren()!==c&&(mr(o),o.updateHasChildren()),o.group&&!Eu(o)&&(i!==o&&i!==null&&i.group&&Eu(i)&&!t.isGroupOpenByDefault?o.expanded=i.expanded:o.expanded=this.getExpandedInitialValue(t,o),Nu(o,!0)),Su(o)&&(mr(e.row),q_(o)&&o.setData(o.data)),i!==o&&(n.oldRow=o,i!==null&&(p||n.hasChildren())&&mr(o),e.childrenChanged=!0,mr(e.row)),Tu(o)?(m=t.changedPath)!=null&&m.isActive()&&t.changedPath.addParentNode(o):ku(o)||(o.childrenAfterFilter||(o.childrenAfterFilter=o.childrenAfterGroup.slice()),o.childrenAfterAggFilter||(o.childrenAfterAggFilter=o.childrenAfterFilter.slice()),o.childrenAfterSort||(o.childrenAfterSort=o.childrenAfterAggFilter.slice())),Vu(o),(y=n.duplicateRows)!=null&&y.size&&!n.duplicateRowsWarned&&(n.duplicateRowsWarned=!0,T._warnOnce("duplicate group keys for row data, keys should be unique",[o.id,o.data,...Array.from(n.duplicateRows).map(b=>b.data)]))}createFillerRow(t){const e=new T.RowNode(this.beans);e.key=t.key,e.group=!0,e.field=null,e.leafGroup=!1,e.rowGroupIndex=null,e.allChildrenCount=null;let n=t.level+"-"+t.key,o=t.parent;for(;o!==null;){const i=o.parent;if(i===null)break;n=`${o.level}-${o.key}-${n}`,o=i}return e.id=T.RowNode.ID_PREFIX_ROW_GROUP+n,e}setGroupData(t,e){var i;const n={};t.groupData=n;const o=(i=this.showRowGroupColsService)==null?void 0:i.getShowRowGroupCols();if(o)for(const l of o)n[l.getColId()]=e}getExpandedInitialValue(t,e){const n=t.isGroupOpenByDefault;return n?n({rowNode:e,field:e.field,key:e.key,level:e.level,rowGroupColumn:e.rowGroupColumn})==!0:t.expandByDefault===-1||e.level<t.expandByDefault}clearTree(t){const{parent:e,oldRow:n,row:o,level:i}=t;if(e!==null&&n!==null&&(e.childrenChanged=!0,e.row!==null&&mr(e.row)),o!==null&&i>=0){let l=t.row;for(;l!==null&&t.removeRow(l);)this.destroyRow(l,!l.data),l=t.row}for(const l of t.enumChildren())this.clearTree(l);t.destroy()}destroyTree(t){const{row:e,level:n,duplicateRows:o}=t;if(e&&(n>=0&&!e.data?this.destroyRow(e,!0):fi(e)),o)for(const i of o)n>=0&&!i.data?this.destroyRow(i,!0):fi(i);for(const i of t.enumChildren())this.destroyTree(i);t.destroy()}destroyRow(t,e){if(!ku(t)){fi(t);return}if(!e){(this.rowsPendingDestruction??(this.rowsPendingDestruction=new Set)).add(t);return}fi(t),t.setRowIndex(null),t.setRowTop(null),!t.data&&t.isSelected()&&t.setSelectedParams({newValue:!1,source:"rowGroupChanged"})}commitDestroyedRows(){const{rowsPendingDestruction:t}=this;if(t!==null){this.rowsPendingDestruction=null;for(const e of t)this.destroyRow(e,!0)}}},J_=class extends T.BeanStub{constructor(){super(...arguments),this.beanName="groupStage"}wireBeans(t){this.selectableService=t.selectableService}execute(t){const e=this.gos.get("treeData")?X_:Z_;let n=this.strategy;(n==null?void 0:n.constructor)!==e&&(this.destroyBean(n),n=this.createManagedBean(new e),this.strategy=n),n.execute(t),this.selectableService.updateSelectableAfterGrouping()}destroy(){this.destroyBean(this.strategy),this.strategy=void 0,super.destroy()}},Au="PivotRowTotal_",Q_=class extends T.BeanStub{constructor(){super(...arguments),this.beanName="pivotColDefService"}wireBeans(t){this.columnModel=t.columnModel,this.funcColsService=t.funcColsService,this.columnNameService=t.columnNameService}postConstruct(){const t=()=>this.gos.get("serverSidePivotResultFieldSeparator")??"_";this.fieldSeparator=t(),this.addManagedPropertyListener("serverSidePivotResultFieldSeparator",()=>{this.fieldSeparator=t()});const e=()=>this.gos.get("pivotDefaultExpanded");this.pivotDefaultExpanded=e(),this.addManagedPropertyListener("pivotDefaultExpanded",()=>{this.pivotDefaultExpanded=e()})}createPivotColumnDefs(t){const e=this.createPivotColumnsFromUniqueValues(t);function n(l,c=[]){return l.forEach(d=>{d.children!==void 0?n(d.children,c):c.push(d)}),c}const o=n(e);this.addRowGroupTotals(e,o),this.addExpandablePivotGroups(e,o),this.addPivotTotalsToGroups(e,o);const i=o.map(l=>T._cloneObject(l));return{pivotColumnGroupDefs:e,pivotColumnDefs:i}}createPivotColumnsFromUniqueValues(t){const e=this.funcColsService.getPivotColumns(),n=e.length;return this.recursivelyBuildGroup(0,t,[],n,e)}recursivelyBuildGroup(t,e,n,o,i){const l=this.funcColsService.getValueColumns();if(t>=o)return this.buildMeasureCols(n);const c=i[t].getColDef(),d=this.headerNameComparator.bind(this,c.pivotComparator);if(l.length===1&&this.gos.get("removePivotHeaderRowWhenSingleValueColumn")&&t===o-1){const h=[];return T._iterateObject(e,m=>{const y=[...n,m],b=this.createColDef(l[0],m,y);b.columnGroupShow="open",h.push(b)}),h.sort(d),h}const p=[];return T._iterateObject(e,(h,m)=>{const y=this.pivotDefaultExpanded===-1||t<this.pivotDefaultExpanded,b=[...n,h];p.push({children:this.recursivelyBuildGroup(t+1,m,b,o,i),headerName:h,pivotKeys:b,columnGroupShow:"open",openByDefault:y,groupId:this.generateColumnGroupId(b)})}),p.sort(d),p}buildMeasureCols(t){const e=this.funcColsService.getValueColumns();return e.length===0?[this.createColDef(null,"-",t)]:e.map(n=>{const o=this.columnNameService.getDisplayNameForColumn(n,"header");return{...this.createColDef(n,o,t),columnGroupShow:"open"}})}addExpandablePivotGroups(t,e){const n=this.gos.get("suppressExpandablePivotGroups");if(n||this.gos.get("pivotColumnGroupTotals"))return;const o=(i,l,c)=>{if("children"in i){const h=new Map;i.children.forEach(y=>{o(y,l,h)});const m=!i.children.some(y=>y.children);this.funcColsService.getValueColumns().forEach(y=>{const b=this.columnNameService.getDisplayNameForColumn(y,"header"),w=this.createColDef(y,b,i.pivotKeys);w.pivotTotalColumnIds=h.get(y.getColId()),w.columnGroupShow=n?"open":"closed",w.aggFunc=y.getAggFunc(),m||(i.children.push(w),l.push(w))}),this.merge(c,h);return}if(!i.pivotValueColumn)return;const d=i.pivotValueColumn.getColId();c.has(d)?c.get(d).push(i.colId):c.set(d,[i.colId])};t.forEach(i=>{o(i,e,new Map)})}addPivotTotalsToGroups(t,e){if(!this.gos.get("pivotColumnGroupTotals"))return;const n=this.gos.get("pivotColumnGroupTotals")==="after",o=this.funcColsService.getValueColumns(),i=o.map(c=>c.getAggFunc());if(!i||i.length<1||!this.sameAggFuncs(i))return;const l=o[0];t.forEach(c=>{this.recursivelyAddPivotTotal(c,e,l,n)})}recursivelyAddPivotTotal(t,e,n,o){const i=t;if(!i.children){const c=t;return c.colId?[c.colId]:null}let l=[];if(i.children.forEach(c=>{const d=this.recursivelyAddPivotTotal(c,e,n,o);d&&(l=l.concat(d))}),i.children.length>1){const d=this.localeService.getLocaleTextFunc()("pivotColumnGroupTotals","Total"),p=this.createColDef(n,d,t.pivotKeys,!0);p.pivotTotalColumnIds=l,p.aggFunc=n.getAggFunc(),p.columnGroupShow=this.gos.get("suppressExpandablePivotGroups")?"open":void 0;const h=t.children;o?h.push(p):h.unshift(p),e.push(p)}return l}addRowGroupTotals(t,e){if(!this.gos.get("pivotRowTotals"))return;const n=this.gos.get("pivotRowTotals")==="after",i=this.funcColsService.getValueColumns().slice();n||i.reverse();const l=i.length>1||!this.gos.get("removePivotHeaderRowWhenSingleValueColumn");for(let c=0;c<i.length;c++){const d=i[c],p=this.columnNameService.getDisplayNameForColumn(d,"header"),h=this.createColDef(d,p,[]),m=[];for(let b=0;b<e.length;b++){const w=e[b];w.pivotValueColumn===d&&m.push(w.colId)}h.pivotTotalColumnIds=m,h.colId=Au+h.colId;const y=l?{children:[h],pivotKeys:[],groupId:`${Au}_pivotGroup_${d.getColId()}`}:h;e.push(h),n?t.push(y):t.unshift(y)}}createColDef(t,e,n,o=!1){const i={};if(t){const l=t.getColDef();Object.assign(i,l),i.hide=!1}return i.headerName=e,i.colId=this.generateColumnId(n||[],t&&!o?t.getColId():""),i.field=i.colId,i.valueGetter=l=>{var c;return(c=l.data)==null?void 0:c[l.colDef.field]},i.pivotKeys=n,i.pivotValueColumn=t,i.filter===!0&&(i.filter="agNumberColumnFilter"),i}sameAggFuncs(t){if(t.length==1)return!0;for(let e=1;e<t.length;e++)if(t[e]!==t[0])return!1;return!0}headerNameComparator(t,e,n){return t?t(e.headerName,n.headerName):e.headerName&&!n.headerName?1:!e.headerName&&n.headerName?-1:!e.headerName||!n.headerName?0:e.headerName<n.headerName?-1:e.headerName>n.headerName?1:0}merge(t,e){e.forEach((n,o)=>{const l=[...t.has(o)?t.get(o):[],...n];t.set(o,l)})}generateColumnGroupId(t){return`pivotGroup_${this.funcColsService.getPivotColumns().map(n=>n.getColId()).join("-")}_${t.join("-")}`}generateColumnId(t,e){return`pivot_${this.funcColsService.getPivotColumns().map(o=>o.getColId()).join("-")}_${t.join("-")}_${e}`}createColDefsFromFields(t){const e={};for(let i=0;i<t.length;i++){const c=t[i].split(this.fieldSeparator);let d=e;for(let p=0;p<c.length;p++){const h=c[p];d[h]==null&&(d[h]={}),d=d[h]}}const n=(i,l,c,d)=>{const p=[];for(const y in c){const b=c[y],w=n(`${i}${this.fieldSeparator}${y}`,y,b,d+1);p.push(w)}if(p.length===0){const y=this.columnModel.getColDefCol(l);if(y){const w=this.columnNameService.getDisplayNameForColumn(y,"header")??l,S=this.createColDef(y,w,void 0,!1);return S.colId=i,S.aggFunc=y.getAggFunc(),S.valueGetter=M=>{var O;return(O=M.data)==null?void 0:O[i]},S}return{colId:i,headerName:l,valueGetter:w=>{var S;return(S=w.data)==null?void 0:S[i]}}}return this.gos.get("removePivotHeaderRowWhenSingleValueColumn")&&p.length===1&&"colId"in p[0]?(p[0].headerName=l,p[0]):{openByDefault:this.pivotDefaultExpanded===-1||d<this.pivotDefaultExpanded,groupId:i,headerName:l,children:p}},o=[];for(const i in e){const l=e[i],c=n(i,i,l,0);o.push(c)}return o}},Bu="Exceeded maximum allowed pivot column count.",eC=class extends T.BeanStub{constructor(){super(...arguments),this.beanName="pivotStage",this.uniqueValues={},this.lastTimeFailed=!1,this.maxUniqueValues=-1,this.currentUniqueCount=0}wireBeans(t){this.valueService=t.valueService,this.columnModel=t.columnModel,this.pivotResultColsService=t.pivotResultColsService,this.funcColsService=t.funcColsService,this.pivotColDefService=t.pivotColDefService}execute(t){const e=t.changedPath;this.columnModel.isPivotActive()?this.executePivotOn(e):this.executePivotOff(e)}executePivotOff(t){this.aggregationColumnsHashLastTime=null,this.uniqueValues={},this.pivotResultColsService.isPivotResultColsPresent()&&(this.pivotResultColsService.setPivotResultCols(null,"rowModelUpdated"),t&&t.setInactive())}executePivotOn(t){const e=this.funcColsService.getValueColumns().length??1,n=this.gos.get("pivotMaxGeneratedColumns");this.maxUniqueValues=n===-1?-1:n/e;let o;try{o=this.bucketUpRowNodes(t)}catch(v){if(v.message===Bu){this.pivotResultColsService.setPivotResultCols([],"rowModelUpdated"),this.eventService.dispatchEvent({type:"pivotMaxColumnsExceeded",message:v.message}),this.lastTimeFailed=!0;return}throw v}const i=this.setUniqueValues(o),l=this.funcColsService.getValueColumns(),c=l.map(v=>`${v.getId()}-${v.getColDef().headerName}`).join("#"),d=l.map(v=>v.getAggFunc().toString()).join("#"),p=this.aggregationColumnsHashLastTime!==c,h=this.aggregationFuncsHashLastTime!==d;this.aggregationColumnsHashLastTime=c,this.aggregationFuncsHashLastTime=d;const m=this.funcColsService.getRowGroupColumns().map(v=>v.getId()).join("#"),y=m!==this.groupColumnsHashLastTime;this.groupColumnsHashLastTime=m;const b=this.gos.get("pivotRowTotals"),w=this.gos.get("pivotColumnGroupTotals"),S=this.gos.get("suppressExpandablePivotGroups"),M=this.gos.get("removePivotHeaderRowWhenSingleValueColumn"),O=b!==this.pivotRowTotalsLastTime||w!==this.pivotColumnGroupTotalsLastTime||S!==this.suppressExpandablePivotGroupsLastTime||M!==this.removePivotHeaderRowWhenSingleValueColumnLastTime;if(this.pivotRowTotalsLastTime=b,this.pivotColumnGroupTotalsLastTime=w,this.suppressExpandablePivotGroupsLastTime=S,this.removePivotHeaderRowWhenSingleValueColumnLastTime=M,this.lastTimeFailed||i||p||y||h||O){const{pivotColumnGroupDefs:v,pivotColumnDefs:I}=this.pivotColDefService.createPivotColumnDefs(this.uniqueValues);this.pivotColumnDefs=I,this.pivotResultColsService.setPivotResultCols(v,"rowModelUpdated"),t&&t.setInactive()}this.lastTimeFailed=!1}setUniqueValues(t){const e=JSON.stringify(t),n=JSON.stringify(this.uniqueValues);return e!==n?(this.uniqueValues=t,!0):!1}bucketUpRowNodes(t){this.currentUniqueCount=0;const e={};t.forEachChangedNodeDepthFirst(o=>{o.leafGroup&&(o.childrenMapped=null)});const n=o=>{var i;o.leafGroup?this.bucketRowNode(o,e):(i=o.childrenAfterFilter)==null||i.forEach(n)};return t.executeFromRootNode(n),e}bucketRowNode(t,e){const n=this.funcColsService.getPivotColumns();n.length===0?t.childrenMapped=null:t.childrenMapped=this.bucketChildren(t.childrenAfterFilter,n,0,e),t.sibling&&(t.sibling.childrenMapped=t.childrenMapped)}bucketChildren(t,e,n,o){const i={},l=e[n];if(t.forEach(c=>{let d=this.valueService.getKeyForNode(l,c);if(T._missing(d)&&(d=""),!o[d]){this.currentUniqueCount+=1,o[d]={};const p=this.maxUniqueValues!==-1,h=this.currentUniqueCount>this.maxUniqueValues;if(p&&h)throw Error(Bu)}i[d]||(i[d]=[]),i[d].push(c)}),n===e.length-1)return i;{const c={};return T._iterateObject(i,(d,p)=>{c[d]=this.bucketChildren(p,e,n+1,o[d])}),c}}getPivotColumnDefs(){return this.pivotColumnDefs}};function tC(t,e,n){t.aggFuncService&&t.aggFuncService.addAggFuncs({key:n})}function nC(t,e){t.aggFuncService&&t.aggFuncService.addAggFuncs(e)}function rC(t){t.aggFuncService&&t.aggFuncService.clear()}function oC(t,e,n){t.funcColsService.setColumnAggFunc(e,n,"api")}function iC(t){return t.columnModel.isPivotMode()}function sC(t,e,n){return t.pivotResultColsService.lookupPivotResultCol(e,n)}function aC(t,e){t.funcColsService.setValueColumns(e,"api")}function lC(t){return t.funcColsService.getValueColumns()}function cC(t,e){t.funcColsService.removeValueColumns([e],"api")}function dC(t,e){t.funcColsService.removeValueColumns(e,"api")}function uC(t,e){t.funcColsService.addValueColumns([e],"api")}function pC(t,e){t.funcColsService.addValueColumns(e,"api")}function hC(t,e){t.funcColsService.setRowGroupColumns(e,"api")}function fC(t,e){t.funcColsService.removeRowGroupColumns([e],"api")}function mC(t,e){t.funcColsService.removeRowGroupColumns(e,"api")}function gC(t,e){t.funcColsService.addRowGroupColumns([e],"api")}function yC(t,e){t.funcColsService.addRowGroupColumns(e,"api")}function _C(t,e,n){t.funcColsService.moveRowGroupColumn(e,n,"api")}function CC(t){return t.funcColsService.getRowGroupColumns()}function vC(t,e){t.funcColsService.setPivotColumns(e,"api")}function wC(t,e){t.funcColsService.removePivotColumns([e],"api")}function bC(t,e){t.funcColsService.removePivotColumns(e,"api")}function xC(t,e){t.funcColsService.addPivotColumns([e],"api")}function kC(t,e){t.funcColsService.addPivotColumns(e,"api")}function EC(t){return t.funcColsService.getPivotColumns()}function SC(t,e){t.pivotResultColsService.setPivotResultCols(e,"api")}function TC(t){const e=t.pivotResultColsService.getPivotResultCols();return e?e.list:null}var NC=class extends T.BeanStub{constructor(){super(...arguments),this.beanName="showRowGroupColsService"}wireBeans(t){this.columnModel=t.columnModel,this.funcColsService=t.funcColsService}refresh(){this.showRowGroupCols=[],this.showRowGroupColsMap={},this.columnModel.getCols().forEach(t=>{const n=t.getColDef().showRowGroup,o=typeof n=="string";!o&&!(n===!0)||(this.showRowGroupCols.push(t),o?this.showRowGroupColsMap[n]=t:this.funcColsService.getRowGroupColumns().forEach(c=>{this.showRowGroupColsMap[c.getId()]=t}))})}getShowRowGroupCols(){return this.showRowGroupCols}getShowRowGroupCol(t){return this.showRowGroupColsMap[t]}},mi="32.3.3",Cl=T._defineModule({version:mi,moduleName:`${T.ModuleNames.RowGroupingModule}-core`,beans:[R_,G_,J_,Q_,eC,E_,D_,NC,M_],userComponents:[{name:"agGroupRowRenderer",classImp:Me.GroupCellRenderer},{name:"agGroupCellRenderer",classImp:Me.GroupCellRenderer}],controllers:[{name:"groupCellRendererCtrl",classImp:Me.GroupCellRendererCtrl}],dependantModules:[Me.EnterpriseCoreModule]}),VC=T._defineModule({version:mi,moduleName:`${T.ModuleNames.RowGroupingModule}-api`,apiFunctions:{addAggFunc:tC,addAggFuncs:nC,clearAggFuncs:rC,setColumnAggFunc:oC,isPivotMode:iC,getPivotResultColumn:sC,setValueColumns:aC,getValueColumns:lC,removeValueColumn:cC,removeValueColumns:dC,addValueColumn:uC,addValueColumns:pC,setRowGroupColumns:hC,removeRowGroupColumn:fC,removeRowGroupColumns:mC,addRowGroupColumn:gC,addRowGroupColumns:yC,getRowGroupColumns:CC,moveRowGroupColumn:_C,setPivotColumns:vC,removePivotColumn:wC,removePivotColumns:bC,addPivotColumn:xC,addPivotColumns:kC,getPivotColumns:EC,setPivotResultColumns:SC,getPivotResultColumns:TC},dependantModules:[Cl]}),Pu=T._defineModule({version:mi,moduleName:"@ag-grid-enterprise/group-filter",userComponents:[{name:"agGroupColumnFilter",classImp:$_}],dependantModules:[Cl,T._ColumnFilterModule]}),AC=T._defineModule({version:mi,moduleName:"@ag-grid-enterprise/group-floating-filter",userComponents:[{name:"agGroupColumnFloatingFilter",classImp:z_}],dependantModules:[Pu,T._FloatingFilterModule]}),BC=T._defineModule({version:mi,moduleName:T.ModuleNames.RowGroupingModule,dependantModules:[Cl,VC,Pu,AC]}),Ru=class extends ml{constructor(t){super(t,"aggregation")}postConstruct(){const t=this.localeService.getLocaleTextFunc(),e=t("valueColumnsEmptyMessage","Drag here to aggregate"),n=t("values","Values");super.init({icon:T._createIconNoSpan("valuePanel",this.gos,null),emptyMessage:e,title:n}),this.addManagedEventListeners({columnValueChanged:this.refreshGui.bind(this)})}getAriaLabel(){return this.localeService.getLocaleTextFunc()("ariaValuesDropZonePanelLabel","Values")}getTooltipParams(){const t=super.getTooltipParams();return t.location="valueColumnsList",t}getIconName(){return this.isPotentialDndItems()?"aggregate":"notAllowed"}isItemDroppable(t,e){return this.gos.get("functionsReadOnly")||!t.isPrimary()?!1:t.isAllowValue()&&(!t.isValueActive()||this.isSourceEventFromTarget(e))}updateItems(t){this.funcColsService.setValueColumns(t,"toolPanelUi")}getExistingItems(){return this.funcColsService.getValueColumns()}},Du=300,PC=class extends T.Component{constructor(){super(`<div class="ag-column-select-header" role="presentation">
25
25
  <div data-ref="eExpand" class="ag-column-select-header-icon"></div>
26
26
  <ag-checkbox data-ref="eSelect" class="ag-column-select-header-checkbox"></ag-checkbox>
27
27
  <ag-input-text-field class="ag-column-select-header-filter-wrapper" data-ref="eFilterTextField"></ag-input-text-field>
28
- </div>`,[T.AgCheckboxSelector,T.AgInputTextFieldSelector]),this.eExpand=T.RefPlaceholder,this.eSelect=T.RefPlaceholder,this.eFilterTextField=T.RefPlaceholder}wireBeans(t){this.columnModel=t.columnModel}postConstruct(){this.createExpandIcons(),this.addManagedListeners(this.eExpand,{click:this.onExpandClicked.bind(this),keydown:e=>{e.key===T.KeyCode.SPACE&&(e.preventDefault(),this.onExpandClicked())}}),this.addManagedElementListeners(this.eSelect.getInputElement(),{click:this.onSelectClicked.bind(this)}),this.addManagedPropertyListener("functionsReadOnly",()=>this.onFunctionsReadOnlyPropChanged()),this.eFilterTextField.setAutoComplete(!1).onValueChange(()=>this.onFilterTextChanged()),this.addManagedElementListeners(this.eFilterTextField.getInputElement(),{keydown:this.onMiniFilterKeyDown.bind(this)}),this.addManagedEventListeners({newColumnsLoaded:this.showOrHideOptions.bind(this)});const t=this.localeService.getLocaleTextFunc();this.eSelect.setInputAriaLabel(t("ariaColumnSelectAll","Toggle All Columns Visibility")),this.eFilterTextField.setInputAriaLabel(t("ariaFilterColumnsInput","Filter Columns Input")),this.activateTabIndex([this.eExpand])}onFunctionsReadOnlyPropChanged(){const t=this.gos.get("functionsReadOnly");this.eSelect.setReadOnly(t),this.eSelect.addOrRemoveCssClass("ag-column-select-column-readonly",t)}init(t){this.params=t;const e=this.gos.get("functionsReadOnly");this.eSelect.setReadOnly(e),this.eSelect.addOrRemoveCssClass("ag-column-select-column-readonly",e),this.columnModel.isReady()&&this.showOrHideOptions()}createExpandIcons(){this.eExpand.appendChild(this.eExpandChecked=T._createIconNoSpan("columnSelectOpen",this.gos)),this.eExpand.appendChild(this.eExpandUnchecked=T._createIconNoSpan("columnSelectClosed",this.gos)),this.eExpand.appendChild(this.eExpandIndeterminate=T._createIconNoSpan("columnSelectIndeterminate",this.gos)),this.setExpandState(0)}showOrHideOptions(){const t=!this.params.suppressColumnFilter,e=!this.params.suppressColumnSelectAll,n=!this.params.suppressColumnExpandAll,o=this.columnModel.isProvidedColGroupsPresent(),i=this.localeService.getLocaleTextFunc();this.eFilterTextField.setInputPlaceholder(i("searchOoo","Search...")),T._setDisplayed(this.eFilterTextField.getGui(),t),T._setDisplayed(this.eSelect.getGui(),e),T._setDisplayed(this.eExpand,n&&o)}onFilterTextChanged(){this.onFilterTextChangedDebounced||(this.onFilterTextChangedDebounced=T._debounce(()=>{const t=this.eFilterTextField.getValue();this.dispatchLocalEvent({type:"filterChanged",filterText:t})},Ru)),this.onFilterTextChangedDebounced()}onMiniFilterKeyDown(t){t.key===T.KeyCode.ENTER&&setTimeout(()=>this.onSelectClicked(),Ru)}onSelectClicked(){this.dispatchLocalEvent({type:this.selectState?"unselectAll":"selectAll"})}onExpandClicked(){this.dispatchLocalEvent({type:this.expandState===0?"collapseAll":"expandAll"})}setExpandState(t){this.expandState=t,T._setDisplayed(this.eExpandChecked,this.expandState===0),T._setDisplayed(this.eExpandUnchecked,this.expandState===1),T._setDisplayed(this.eExpandIndeterminate,this.expandState===2)}setSelectionState(t){this.selectState=t,this.eSelect.setValue(this.selectState)}},Av={selector:"AG-PRIMARY-COLS-HEADER",component:Vv},Du=class{constructor(t,e,n,o=!1,i){this.localEventService=new T.LocalEventService,this.displayName=t,this.dept=n,this.group=o,o?(this.columnGroup=e,this.expanded=i,this.children=[]):this.column=e}isGroup(){return this.group}getDisplayName(){return this.displayName}getColumnGroup(){return this.columnGroup}getColumn(){return this.column}getDept(){return this.dept}isExpanded(){return!!this.expanded}getChildren(){return this.children}isPassesFilter(){return this.passesFilter}setExpanded(t){t!==this.expanded&&(this.expanded=t,this.localEventService.dispatchEvent({type:"expandedChanged"}))}setPassesFilter(t){this.passesFilter=t}addEventListener(t,e){this.localEventService.addEventListener(t,e)}removeEventListener(t,e){this.localEventService.removeEventListener(t,e)}},Iu=class extends T.Component{constructor(t,e,n){super('<div class="ag-menu"></div>'),this.column=t,this.mouseEvent=e,this.parentEl=n,this.displayName=null}wireBeans(t){this.columnModel=t.columnModel,this.columnNameService=t.columnNameService,this.funcColsService=t.funcColsService,this.popupService=t.popupService,this.focusService=t.focusService}postConstruct(){if(this.initializeProperties(this.column),this.buildMenuItemMap(),T.isColumn(this.column)?this.displayName=this.columnNameService.getDisplayNameForColumn(this.column,"columnToolPanel"):this.displayName=this.columnNameService.getDisplayNameForProvidedColumnGroup(null,this.column,"columnToolPanel"),this.isActive()){this.mouseEvent.preventDefault();const t=this.getMappedMenuItems();if(t.length===0)return;this.displayContextMenu(t)}}initializeProperties(t){T.isProvidedColumnGroup(t)?this.columns=t.getLeafColumns():this.columns=[t],this.allowGrouping=this.columns.some(e=>e.isPrimary()&&e.isAllowRowGroup()),this.allowValues=this.columns.some(e=>e.isPrimary()&&e.isAllowValue()),this.allowPivoting=this.columnModel.isPivotMode()&&this.columns.some(e=>e.isPrimary()&&e.isAllowPivot())}buildMenuItemMap(){const t=this.localeService.getLocaleTextFunc();this.menuItemMap=new Map,this.menuItemMap.set("rowGroup",{allowedFunction:e=>e.isPrimary()&&e.isAllowRowGroup()&&!this.columnModel.isColGroupLocked(e),activeFunction:e=>e.isRowGroupActive(),activateLabel:()=>`${t("groupBy","Group by")} ${this.displayName}`,deactivateLabel:()=>`${t("ungroupBy","Un-Group by")} ${this.displayName}`,activateFunction:()=>{const e=this.funcColsService.getRowGroupColumns();this.funcColsService.setRowGroupColumns(this.addColumnsToList(e),"toolPanelUi")},deActivateFunction:()=>{const e=this.funcColsService.getRowGroupColumns();this.funcColsService.setRowGroupColumns(this.removeColumnsFromList(e),"toolPanelUi")},addIcon:"menuAddRowGroup",removeIcon:"menuRemoveRowGroup"}),this.menuItemMap.set("value",{allowedFunction:e=>e.isPrimary()&&e.isAllowValue(),activeFunction:e=>e.isValueActive(),activateLabel:()=>t("addToValues",`Add ${this.displayName} to values`,[this.displayName]),deactivateLabel:()=>t("removeFromValues",`Remove ${this.displayName} from values`,[this.displayName]),activateFunction:()=>{const e=this.funcColsService.getValueColumns();this.funcColsService.setValueColumns(this.addColumnsToList(e),"toolPanelUi")},deActivateFunction:()=>{const e=this.funcColsService.getValueColumns();this.funcColsService.setValueColumns(this.removeColumnsFromList(e),"toolPanelUi")},addIcon:"valuePanel",removeIcon:"valuePanel"}),this.menuItemMap.set("pivot",{allowedFunction:e=>this.columnModel.isPivotMode()&&e.isPrimary()&&e.isAllowPivot(),activeFunction:e=>e.isPivotActive(),activateLabel:()=>t("addToLabels",`Add ${this.displayName} to labels`,[this.displayName]),deactivateLabel:()=>t("removeFromLabels",`Remove ${this.displayName} from labels`,[this.displayName]),activateFunction:()=>{const e=this.funcColsService.getPivotColumns();this.funcColsService.setPivotColumns(this.addColumnsToList(e),"toolPanelUi")},deActivateFunction:()=>{const e=this.funcColsService.getPivotColumns();this.funcColsService.setPivotColumns(this.removeColumnsFromList(e),"toolPanelUi")},addIcon:"pivotPanel",removeIcon:"pivotPanel"})}addColumnsToList(t){return[...t].concat(this.columns.filter(e=>t.indexOf(e)===-1))}removeColumnsFromList(t){return t.filter(e=>this.columns.indexOf(e)===-1)}displayContextMenu(t){const e=this.getGui(),n=this.createBean(new Me.AgMenuList),o=this.localeService.getLocaleTextFunc();let i=()=>{};e.appendChild(n.getGui()),n.addMenuItems(t),n.addManagedListeners(n,{closeMenu:()=>{this.parentEl.focus(),i()}});const l=this.popupService.addPopup({modal:!0,eChild:e,closeOnEsc:!0,afterGuiAttached:()=>this.focusService.focusInto(n.getGui()),ariaLabel:o("ariaLabelContextMenu","Context Menu"),closedCallback:c=>{c instanceof KeyboardEvent&&this.parentEl.focus(),this.destroyBean(n)}});l&&(i=l.hideFunc),this.popupService.positionPopupUnderMouseEvent({type:"columnContextMenu",mouseEvent:this.mouseEvent,ePopup:e})}isActive(){return this.allowGrouping||this.allowValues||this.allowPivoting}getMappedMenuItems(){const t=[];for(const e of this.menuItemMap.values()){const n=this.columns.some(i=>e.allowedFunction(i)&&!e.activeFunction(i)),o=this.columns.some(i=>e.allowedFunction(i)&&e.activeFunction(i));n&&t.push({name:e.activateLabel(this.displayName),icon:T._createIconNoSpan(e.addIcon,this.gos,null),action:()=>e.activateFunction()}),o&&t.push({name:e.deactivateLabel(this.displayName),icon:T._createIconNoSpan(e.removeIcon,this.gos,null),action:()=>e.deActivateFunction()})}return t}},Fu=class extends T.Component{constructor(t,e,n,o){super(),this.modelItem=t,this.allowDragging=e,this.eventType=n,this.focusWrapper=o,this.cbSelect=T.RefPlaceholder,this.eLabel=T.RefPlaceholder,this.eGroupOpenedIcon=T.RefPlaceholder,this.eGroupClosedIcon=T.RefPlaceholder,this.eColumnGroupIcons=T.RefPlaceholder,this.processingColumnStateChange=!1,this.modelItem=t,this.columnGroup=t.getColumnGroup(),this.columnDept=t.getDept(),this.displayName=t.getDisplayName(),this.allowDragging=e}wireBeans(t){this.columnModel=t.columnModel,this.dragAndDropService=t.dragAndDropService,this.modelItemUtils=t.modelItemUtils}postConstruct(){this.setTemplate(`<div class="ag-column-select-column-group">
28
+ </div>`,[T.AgCheckboxSelector,T.AgInputTextFieldSelector]),this.eExpand=T.RefPlaceholder,this.eSelect=T.RefPlaceholder,this.eFilterTextField=T.RefPlaceholder}wireBeans(t){this.columnModel=t.columnModel}postConstruct(){this.createExpandIcons(),this.addManagedListeners(this.eExpand,{click:this.onExpandClicked.bind(this),keydown:e=>{e.key===T.KeyCode.SPACE&&(e.preventDefault(),this.onExpandClicked())}}),this.addManagedElementListeners(this.eSelect.getInputElement(),{click:this.onSelectClicked.bind(this)}),this.addManagedPropertyListener("functionsReadOnly",()=>this.onFunctionsReadOnlyPropChanged()),this.eFilterTextField.setAutoComplete(!1).onValueChange(()=>this.onFilterTextChanged()),this.addManagedElementListeners(this.eFilterTextField.getInputElement(),{keydown:this.onMiniFilterKeyDown.bind(this)}),this.addManagedEventListeners({newColumnsLoaded:this.showOrHideOptions.bind(this)});const t=this.localeService.getLocaleTextFunc();this.eSelect.setInputAriaLabel(t("ariaColumnSelectAll","Toggle All Columns Visibility")),this.eFilterTextField.setInputAriaLabel(t("ariaFilterColumnsInput","Filter Columns Input")),this.activateTabIndex([this.eExpand])}onFunctionsReadOnlyPropChanged(){const t=this.gos.get("functionsReadOnly");this.eSelect.setReadOnly(t),this.eSelect.addOrRemoveCssClass("ag-column-select-column-readonly",t)}init(t){this.params=t;const e=this.gos.get("functionsReadOnly");this.eSelect.setReadOnly(e),this.eSelect.addOrRemoveCssClass("ag-column-select-column-readonly",e),this.columnModel.isReady()&&this.showOrHideOptions()}createExpandIcons(){this.eExpand.appendChild(this.eExpandChecked=T._createIconNoSpan("columnSelectOpen",this.gos)),this.eExpand.appendChild(this.eExpandUnchecked=T._createIconNoSpan("columnSelectClosed",this.gos)),this.eExpand.appendChild(this.eExpandIndeterminate=T._createIconNoSpan("columnSelectIndeterminate",this.gos)),this.setExpandState(0)}showOrHideOptions(){const t=!this.params.suppressColumnFilter,e=!this.params.suppressColumnSelectAll,n=!this.params.suppressColumnExpandAll,o=this.columnModel.isProvidedColGroupsPresent(),i=this.localeService.getLocaleTextFunc();this.eFilterTextField.setInputPlaceholder(i("searchOoo","Search...")),T._setDisplayed(this.eFilterTextField.getGui(),t),T._setDisplayed(this.eSelect.getGui(),e),T._setDisplayed(this.eExpand,n&&o)}onFilterTextChanged(){this.onFilterTextChangedDebounced||(this.onFilterTextChangedDebounced=T._debounce(()=>{const t=this.eFilterTextField.getValue();this.dispatchLocalEvent({type:"filterChanged",filterText:t})},Du)),this.onFilterTextChangedDebounced()}onMiniFilterKeyDown(t){t.key===T.KeyCode.ENTER&&setTimeout(()=>this.onSelectClicked(),Du)}onSelectClicked(){this.dispatchLocalEvent({type:this.selectState?"unselectAll":"selectAll"})}onExpandClicked(){this.dispatchLocalEvent({type:this.expandState===0?"collapseAll":"expandAll"})}setExpandState(t){this.expandState=t,T._setDisplayed(this.eExpandChecked,this.expandState===0),T._setDisplayed(this.eExpandUnchecked,this.expandState===1),T._setDisplayed(this.eExpandIndeterminate,this.expandState===2)}setSelectionState(t){this.selectState=t,this.eSelect.setValue(this.selectState)}},RC={selector:"AG-PRIMARY-COLS-HEADER",component:PC},Iu=class{constructor(t,e,n,o=!1,i){this.localEventService=new T.LocalEventService,this.displayName=t,this.dept=n,this.group=o,o?(this.columnGroup=e,this.expanded=i,this.children=[]):this.column=e}isGroup(){return this.group}getDisplayName(){return this.displayName}getColumnGroup(){return this.columnGroup}getColumn(){return this.column}getDept(){return this.dept}isExpanded(){return!!this.expanded}getChildren(){return this.children}isPassesFilter(){return this.passesFilter}setExpanded(t){t!==this.expanded&&(this.expanded=t,this.localEventService.dispatchEvent({type:"expandedChanged"}))}setPassesFilter(t){this.passesFilter=t}addEventListener(t,e){this.localEventService.addEventListener(t,e)}removeEventListener(t,e){this.localEventService.removeEventListener(t,e)}},Fu=class extends T.Component{constructor(t,e,n){super('<div class="ag-menu"></div>'),this.column=t,this.mouseEvent=e,this.parentEl=n,this.displayName=null}wireBeans(t){this.columnModel=t.columnModel,this.columnNameService=t.columnNameService,this.funcColsService=t.funcColsService,this.popupService=t.popupService,this.focusService=t.focusService}postConstruct(){if(this.initializeProperties(this.column),this.buildMenuItemMap(),T.isColumn(this.column)?this.displayName=this.columnNameService.getDisplayNameForColumn(this.column,"columnToolPanel"):this.displayName=this.columnNameService.getDisplayNameForProvidedColumnGroup(null,this.column,"columnToolPanel"),this.isActive()){this.mouseEvent.preventDefault();const t=this.getMappedMenuItems();if(t.length===0)return;this.displayContextMenu(t)}}initializeProperties(t){T.isProvidedColumnGroup(t)?this.columns=t.getLeafColumns():this.columns=[t],this.allowGrouping=this.columns.some(e=>e.isPrimary()&&e.isAllowRowGroup()),this.allowValues=this.columns.some(e=>e.isPrimary()&&e.isAllowValue()),this.allowPivoting=this.columnModel.isPivotMode()&&this.columns.some(e=>e.isPrimary()&&e.isAllowPivot())}buildMenuItemMap(){const t=this.localeService.getLocaleTextFunc();this.menuItemMap=new Map,this.menuItemMap.set("rowGroup",{allowedFunction:e=>e.isPrimary()&&e.isAllowRowGroup()&&!this.columnModel.isColGroupLocked(e),activeFunction:e=>e.isRowGroupActive(),activateLabel:()=>`${t("groupBy","Group by")} ${this.displayName}`,deactivateLabel:()=>`${t("ungroupBy","Un-Group by")} ${this.displayName}`,activateFunction:()=>{const e=this.funcColsService.getRowGroupColumns();this.funcColsService.setRowGroupColumns(this.addColumnsToList(e),"toolPanelUi")},deActivateFunction:()=>{const e=this.funcColsService.getRowGroupColumns();this.funcColsService.setRowGroupColumns(this.removeColumnsFromList(e),"toolPanelUi")},addIcon:"menuAddRowGroup",removeIcon:"menuRemoveRowGroup"}),this.menuItemMap.set("value",{allowedFunction:e=>e.isPrimary()&&e.isAllowValue(),activeFunction:e=>e.isValueActive(),activateLabel:()=>t("addToValues",`Add ${this.displayName} to values`,[this.displayName]),deactivateLabel:()=>t("removeFromValues",`Remove ${this.displayName} from values`,[this.displayName]),activateFunction:()=>{const e=this.funcColsService.getValueColumns();this.funcColsService.setValueColumns(this.addColumnsToList(e),"toolPanelUi")},deActivateFunction:()=>{const e=this.funcColsService.getValueColumns();this.funcColsService.setValueColumns(this.removeColumnsFromList(e),"toolPanelUi")},addIcon:"valuePanel",removeIcon:"valuePanel"}),this.menuItemMap.set("pivot",{allowedFunction:e=>this.columnModel.isPivotMode()&&e.isPrimary()&&e.isAllowPivot(),activeFunction:e=>e.isPivotActive(),activateLabel:()=>t("addToLabels",`Add ${this.displayName} to labels`,[this.displayName]),deactivateLabel:()=>t("removeFromLabels",`Remove ${this.displayName} from labels`,[this.displayName]),activateFunction:()=>{const e=this.funcColsService.getPivotColumns();this.funcColsService.setPivotColumns(this.addColumnsToList(e),"toolPanelUi")},deActivateFunction:()=>{const e=this.funcColsService.getPivotColumns();this.funcColsService.setPivotColumns(this.removeColumnsFromList(e),"toolPanelUi")},addIcon:"pivotPanel",removeIcon:"pivotPanel"})}addColumnsToList(t){return[...t].concat(this.columns.filter(e=>t.indexOf(e)===-1))}removeColumnsFromList(t){return t.filter(e=>this.columns.indexOf(e)===-1)}displayContextMenu(t){const e=this.getGui(),n=this.createBean(new Me.AgMenuList),o=this.localeService.getLocaleTextFunc();let i=()=>{};e.appendChild(n.getGui()),n.addMenuItems(t),n.addManagedListeners(n,{closeMenu:()=>{this.parentEl.focus(),i()}});const l=this.popupService.addPopup({modal:!0,eChild:e,closeOnEsc:!0,afterGuiAttached:()=>this.focusService.focusInto(n.getGui()),ariaLabel:o("ariaLabelContextMenu","Context Menu"),closedCallback:c=>{c instanceof KeyboardEvent&&this.parentEl.focus(),this.destroyBean(n)}});l&&(i=l.hideFunc),this.popupService.positionPopupUnderMouseEvent({type:"columnContextMenu",mouseEvent:this.mouseEvent,ePopup:e})}isActive(){return this.allowGrouping||this.allowValues||this.allowPivoting}getMappedMenuItems(){const t=[];for(const e of this.menuItemMap.values()){const n=this.columns.some(i=>e.allowedFunction(i)&&!e.activeFunction(i)),o=this.columns.some(i=>e.allowedFunction(i)&&e.activeFunction(i));n&&t.push({name:e.activateLabel(this.displayName),icon:T._createIconNoSpan(e.addIcon,this.gos,null),action:()=>e.activateFunction()}),o&&t.push({name:e.deactivateLabel(this.displayName),icon:T._createIconNoSpan(e.removeIcon,this.gos,null),action:()=>e.deActivateFunction()})}return t}},Lu=class extends T.Component{constructor(t,e,n,o){super(),this.modelItem=t,this.allowDragging=e,this.eventType=n,this.focusWrapper=o,this.cbSelect=T.RefPlaceholder,this.eLabel=T.RefPlaceholder,this.eGroupOpenedIcon=T.RefPlaceholder,this.eGroupClosedIcon=T.RefPlaceholder,this.eColumnGroupIcons=T.RefPlaceholder,this.processingColumnStateChange=!1,this.modelItem=t,this.columnGroup=t.getColumnGroup(),this.columnDept=t.getDept(),this.displayName=t.getDisplayName(),this.allowDragging=e}wireBeans(t){this.columnModel=t.columnModel,this.dragAndDropService=t.dragAndDropService,this.modelItemUtils=t.modelItemUtils}postConstruct(){this.setTemplate(`<div class="ag-column-select-column-group">
29
29
  <span class="ag-column-group-icons" data-ref="eColumnGroupIcons" >
30
30
  <span class="ag-column-group-closed-icon" data-ref="eGroupClosedIcon"></span>
31
31
  <span class="ag-column-group-opened-icon" data-ref="eGroupOpenedIcon"></span>
32
32
  </span>
33
33
  <ag-checkbox data-ref="cbSelect" class="ag-column-select-checkbox"></ag-checkbox>
34
34
  <span class="ag-column-select-column-label" data-ref="eLabel"></span>
35
- </div>`,[T.AgCheckboxSelector]),this.eDragHandle=T._createIconNoSpan("columnDrag",this.gos),this.eDragHandle.classList.add("ag-drag-handle","ag-column-select-column-group-drag-handle");const t=this.cbSelect.getGui(),e=this.cbSelect.getInputElement();t.insertAdjacentElement("afterend",this.eDragHandle),e.setAttribute("tabindex","-1"),this.eLabel.innerHTML=this.displayName?this.displayName:"",this.setupExpandContract(),this.addCssClass("ag-column-select-indent-"+this.columnDept),this.getGui().style.setProperty("--ag-indentation-level",String(this.columnDept)),this.addManagedEventListeners({columnPivotModeChanged:this.onColumnStateChanged.bind(this)}),this.addManagedElementListeners(this.eLabel,{click:this.onLabelClicked.bind(this)}),this.addManagedListeners(this.cbSelect,{fieldValueChanged:this.onCheckboxChanged.bind(this)}),this.addManagedListeners(this.modelItem,{expandedChanged:this.onExpandChanged.bind(this)}),this.addManagedListeners(this.focusWrapper,{keydown:this.handleKeyDown.bind(this),contextmenu:this.onContextMenu.bind(this)}),this.setOpenClosedIcons(),this.setupDragging(),this.onColumnStateChanged(),this.addVisibilityListenersToAllChildren(),this.refreshAriaExpanded(),this.refreshAriaLabel(),this.setupTooltip(),T._getToolPanelClassesFromColDef(this.columnGroup.getColGroupDef(),this.gos,null,this.columnGroup).forEach(o=>this.addOrRemoveCssClass(o,!0))}getColumns(){return this.columnGroup.getLeafColumns()}setupTooltip(){const t=this.columnGroup.getColGroupDef();if(!t)return;const e=this.gos.get("tooltipShowMode")==="whenTruncated";let n;e&&(n=()=>this.eLabel.scrollWidth>this.eLabel.clientWidth);const o=()=>{const i=t.headerTooltip;this.setTooltip({newTooltipText:i,location:"columnToolPanelColumnGroup",shouldDisplayTooltip:n})};o(),this.addManagedEventListeners({newColumnsLoaded:o})}getTooltipParams(){const t=super.getTooltipParams();return t.location="columnToolPanelColumnGroup",t}handleKeyDown(t){switch(t.key){case T.KeyCode.LEFT:t.preventDefault(),this.modelItem.setExpanded(!1);break;case T.KeyCode.RIGHT:t.preventDefault(),this.modelItem.setExpanded(!0);break;case T.KeyCode.SPACE:t.preventDefault(),this.isSelectable()&&this.onSelectAllChanged(!this.isSelected());break}}onContextMenu(t){const{columnGroup:e,gos:n}=this;if(n.get("functionsReadOnly"))return;const o=this.createBean(new Iu(e,t,this.focusWrapper));this.addDestroyFunc(()=>{o.isAlive()&&this.destroyBean(o)})}addVisibilityListenersToAllChildren(){const t=this.onColumnStateChanged.bind(this);this.columnGroup.getLeafColumns().forEach(e=>{this.addManagedListeners(e,{visibleChanged:t,columnValueChanged:t,columnPivotChanged:t,columnRowGroupChanged:t})})}setupDragging(){if(!this.allowDragging){T._setDisplayed(this.eDragHandle,!1);return}let t=!this.gos.get("suppressDragLeaveHidesColumns");const e={type:T.DragSourceType.ToolPanel,eElement:this.eDragHandle,dragItemName:this.displayName,getDefaultIconName:()=>t?"hide":"notAllowed",getDragItem:()=>this.createDragItem(),onDragStarted:()=>{t=!this.gos.get("suppressDragLeaveHidesColumns"),this.eventService.dispatchEvent({type:"columnPanelItemDragStart",column:this.columnGroup})},onDragStopped:()=>{this.eventService.dispatchEvent({type:"columnPanelItemDragEnd"})},onGridEnter:n=>{t&&this.modelItemUtils.updateColumns({columns:this.columnGroup.getLeafColumns(),visibleState:n==null?void 0:n.visibleState,pivotState:n==null?void 0:n.pivotState,eventType:this.eventType})},onGridExit:()=>{t&&this.onChangeCommon(!1)}};this.dragAndDropService.addDragSource(e,!0),this.addDestroyFunc(()=>this.dragAndDropService.removeDragSource(e))}createDragItem(){const t=this.columnGroup.getLeafColumns(),e={},n={};return t.forEach(o=>{const i=o.getId();e[i]=o.isVisible(),n[i]=this.modelItemUtils.createPivotState(o)}),{columns:t,visibleState:e,pivotState:n}}setupExpandContract(){this.eGroupClosedIcon.appendChild(T._createIcon("columnSelectClosed",this.gos,null)),this.eGroupOpenedIcon.appendChild(T._createIcon("columnSelectOpen",this.gos,null));const t=this.onExpandOrContractClicked.bind(this);this.addManagedElementListeners(this.eGroupClosedIcon,{click:t}),this.addManagedElementListeners(this.eGroupOpenedIcon,{click:t});const e=new T.TouchListener(this.eColumnGroupIcons,!0);this.addManagedListeners(e,{tap:t}),this.addDestroyFunc(e.destroy.bind(e))}onLabelClicked(){const t=!this.cbSelect.getValue();this.onChangeCommon(t)}onCheckboxChanged(t){this.onChangeCommon(t.selected)}getVisibleLeafColumns(){const t=[],e=n=>{n.forEach(o=>{o.isPassesFilter()&&(o.isGroup()?e(o.getChildren()):t.push(o.getColumn()))})};return e(this.modelItem.getChildren()),t}onChangeCommon(t){this.refreshAriaLabel(),!this.processingColumnStateChange&&this.modelItemUtils.selectAllChildren(this.modelItem.getChildren(),t,this.eventType)}refreshAriaLabel(){const t=this.localeService.getLocaleTextFunc(),e=t("ariaColumnGroup","Column Group"),n=this.cbSelect.getValue(),o=n===void 0?t("ariaIndeterminate","indeterminate"):n?t("ariaVisible","visible"):t("ariaHidden","hidden"),i=t("ariaToggleVisibility","Press SPACE to toggle visibility");T._setAriaLabel(this.focusWrapper,`${this.displayName} ${e}`),this.cbSelect.setInputAriaLabel(`${i} (${o})`),T._setAriaDescribedBy(this.focusWrapper,this.cbSelect.getInputElement().id)}onColumnStateChanged(){const t=this.workOutSelectedValue(),e=this.workOutReadOnlyValue();this.processingColumnStateChange=!0,this.cbSelect.setValue(t),this.cbSelect.setReadOnly(e),this.addOrRemoveCssClass("ag-column-select-column-group-readonly",e),this.processingColumnStateChange=!1}workOutSelectedValue(){const t=this.columnModel.isPivotMode(),e=this.getVisibleLeafColumns();let n=0,o=0;if(e.forEach(i=>{!t&&i.getColDef().lockVisible||(this.isColumnChecked(i,t)?n++:o++)}),!(n>0&&o>0))return n>0}workOutReadOnlyValue(){const t=this.columnModel.isPivotMode();let e=0;return this.columnGroup.getLeafColumns().forEach(n=>{t?n.isAnyFunctionAllowed()&&e++:n.getColDef().lockVisible||e++}),e===0}isColumnChecked(t,e){if(e){const n=t.isPivotActive(),o=t.isRowGroupActive(),i=t.isValueActive();return n||o||i}return t.isVisible()}onExpandOrContractClicked(){const t=this.modelItem.isExpanded();this.modelItem.setExpanded(!t)}onExpandChanged(){this.setOpenClosedIcons(),this.refreshAriaExpanded()}setOpenClosedIcons(){const t=this.modelItem.isExpanded();T._setDisplayed(this.eGroupClosedIcon,!t),T._setDisplayed(this.eGroupOpenedIcon,t)}refreshAriaExpanded(){T._setAriaExpanded(this.focusWrapper,this.modelItem.isExpanded())}getDisplayName(){return this.displayName}onSelectAllChanged(t){const e=this.cbSelect.getValue();!this.cbSelect.isReadOnly()&&(t&&!e||!t&&e)&&this.cbSelect.toggle()}isSelected(){return this.cbSelect.getValue()}isSelectable(){return!this.cbSelect.isReadOnly()}setSelected(t){this.cbSelect.setValue(t,!0)}},Bv=class extends T.BeanStub{constructor(t,e){super(),this.comp=t,this.virtualList=e}wireBeans(t){this.columnMoveService=t.columnMoveService,this.columnModel=t.columnModel}postConstruct(){this.createManagedBean(new Me.VirtualListDragFeature(this.comp,this.virtualList,{dragSourceType:T.DragSourceType.ToolPanel,listItemDragStartEvent:"columnPanelItemDragStart",listItemDragEndEvent:"columnPanelItemDragEnd",eventSource:this.eventService,getCurrentDragValue:t=>this.getCurrentDragValue(t),isMoveBlocked:t=>this.isMoveBlocked(t),getNumRows:t=>t.getDisplayedColsList().length,moveItem:(t,e)=>this.moveItem(this.getCurrentColumnsBeingMoved(t),e)}))}getCurrentDragValue(t){return t.column}getCurrentColumnsBeingMoved(t){return T.isProvidedColumnGroup(t)?t.getLeafColumns():t?[t]:[]}isMoveBlocked(t){return this.gos.get("suppressMovableColumns")?!0:!!this.getCurrentColumnsBeingMoved(t).find(i=>{const l=i.getColDef();return!!l.suppressMovable||!!l.lockPosition})}moveItem(t,e){if(!e)return;const{component:n}=e;let o=null,i=e.position==="top";if(n instanceof Fu?(o=n.getColumns()[0],i=!0):n&&(o=n.getColumn()),!o)return;const l=this.getMoveTargetIndex({currentColumns:t,lastHoveredColumn:o,isBefore:i});l!=null&&this.columnMoveService.moveColumns(t,l,"toolPanelUi")}getMoveTargetIndex(t){const{currentColumns:e,lastHoveredColumn:n,isBefore:o}=t;if(!n||!e)return null;const i=this.columnModel.getCols().indexOf(n),l=o?i:i+1,c=this.getMoveDiff(e,l);return l-c}getMoveDiff(t,e){const n=this.columnModel.getCols();if(!t)return 0;const o=t[0],i=t.length;return n.indexOf(o)<e?i:0}},Pv=class extends T.Component{constructor(t,e,n,o){super(),this.allowDragging=e,this.groupsExist=n,this.focusWrapper=o,this.eLabel=T.RefPlaceholder,this.cbSelect=T.RefPlaceholder,this.processingColumnStateChange=!1,this.column=t.getColumn(),this.columnDept=t.getDept(),this.displayName=t.getDisplayName()}wireBeans(t){this.columnModel=t.columnModel,this.dragAndDropService=t.dragAndDropService,this.modelItemUtils=t.modelItemUtils}postConstruct(){this.setTemplate(`<div class="ag-column-select-column">
35
+ </div>`,[T.AgCheckboxSelector]),this.eDragHandle=T._createIconNoSpan("columnDrag",this.gos),this.eDragHandle.classList.add("ag-drag-handle","ag-column-select-column-group-drag-handle");const t=this.cbSelect.getGui(),e=this.cbSelect.getInputElement();t.insertAdjacentElement("afterend",this.eDragHandle),e.setAttribute("tabindex","-1"),this.eLabel.innerHTML=this.displayName?this.displayName:"",this.setupExpandContract(),this.addCssClass("ag-column-select-indent-"+this.columnDept),this.getGui().style.setProperty("--ag-indentation-level",String(this.columnDept)),this.addManagedEventListeners({columnPivotModeChanged:this.onColumnStateChanged.bind(this)}),this.addManagedElementListeners(this.eLabel,{click:this.onLabelClicked.bind(this)}),this.addManagedListeners(this.cbSelect,{fieldValueChanged:this.onCheckboxChanged.bind(this)}),this.addManagedListeners(this.modelItem,{expandedChanged:this.onExpandChanged.bind(this)}),this.addManagedListeners(this.focusWrapper,{keydown:this.handleKeyDown.bind(this),contextmenu:this.onContextMenu.bind(this)}),this.setOpenClosedIcons(),this.setupDragging(),this.onColumnStateChanged(),this.addVisibilityListenersToAllChildren(),this.refreshAriaExpanded(),this.refreshAriaLabel(),this.setupTooltip(),T._getToolPanelClassesFromColDef(this.columnGroup.getColGroupDef(),this.gos,null,this.columnGroup).forEach(o=>this.addOrRemoveCssClass(o,!0))}getColumns(){return this.columnGroup.getLeafColumns()}setupTooltip(){const t=this.columnGroup.getColGroupDef();if(!t)return;const e=this.gos.get("tooltipShowMode")==="whenTruncated";let n;e&&(n=()=>this.eLabel.scrollWidth>this.eLabel.clientWidth);const o=()=>{const i=t.headerTooltip;this.setTooltip({newTooltipText:i,location:"columnToolPanelColumnGroup",shouldDisplayTooltip:n})};o(),this.addManagedEventListeners({newColumnsLoaded:o})}getTooltipParams(){const t=super.getTooltipParams();return t.location="columnToolPanelColumnGroup",t}handleKeyDown(t){switch(t.key){case T.KeyCode.LEFT:t.preventDefault(),this.modelItem.setExpanded(!1);break;case T.KeyCode.RIGHT:t.preventDefault(),this.modelItem.setExpanded(!0);break;case T.KeyCode.SPACE:t.preventDefault(),this.isSelectable()&&this.onSelectAllChanged(!this.isSelected());break}}onContextMenu(t){const{columnGroup:e,gos:n}=this;if(n.get("functionsReadOnly"))return;const o=this.createBean(new Fu(e,t,this.focusWrapper));this.addDestroyFunc(()=>{o.isAlive()&&this.destroyBean(o)})}addVisibilityListenersToAllChildren(){const t=this.onColumnStateChanged.bind(this);this.columnGroup.getLeafColumns().forEach(e=>{this.addManagedListeners(e,{visibleChanged:t,columnValueChanged:t,columnPivotChanged:t,columnRowGroupChanged:t})})}setupDragging(){if(!this.allowDragging){T._setDisplayed(this.eDragHandle,!1);return}let t=!this.gos.get("suppressDragLeaveHidesColumns");const e={type:T.DragSourceType.ToolPanel,eElement:this.eDragHandle,dragItemName:this.displayName,getDefaultIconName:()=>t?"hide":"notAllowed",getDragItem:()=>this.createDragItem(),onDragStarted:()=>{t=!this.gos.get("suppressDragLeaveHidesColumns"),this.eventService.dispatchEvent({type:"columnPanelItemDragStart",column:this.columnGroup})},onDragStopped:()=>{this.eventService.dispatchEvent({type:"columnPanelItemDragEnd"})},onGridEnter:n=>{t&&this.modelItemUtils.updateColumns({columns:this.columnGroup.getLeafColumns(),visibleState:n==null?void 0:n.visibleState,pivotState:n==null?void 0:n.pivotState,eventType:this.eventType})},onGridExit:()=>{t&&this.onChangeCommon(!1)}};this.dragAndDropService.addDragSource(e,!0),this.addDestroyFunc(()=>this.dragAndDropService.removeDragSource(e))}createDragItem(){const t=this.columnGroup.getLeafColumns(),e={},n={};return t.forEach(o=>{const i=o.getId();e[i]=o.isVisible(),n[i]=this.modelItemUtils.createPivotState(o)}),{columns:t,visibleState:e,pivotState:n}}setupExpandContract(){this.eGroupClosedIcon.appendChild(T._createIcon("columnSelectClosed",this.gos,null)),this.eGroupOpenedIcon.appendChild(T._createIcon("columnSelectOpen",this.gos,null));const t=this.onExpandOrContractClicked.bind(this);this.addManagedElementListeners(this.eGroupClosedIcon,{click:t}),this.addManagedElementListeners(this.eGroupOpenedIcon,{click:t});const e=new T.TouchListener(this.eColumnGroupIcons,!0);this.addManagedListeners(e,{tap:t}),this.addDestroyFunc(e.destroy.bind(e))}onLabelClicked(){const t=!this.cbSelect.getValue();this.onChangeCommon(t)}onCheckboxChanged(t){this.onChangeCommon(t.selected)}getVisibleLeafColumns(){const t=[],e=n=>{n.forEach(o=>{o.isPassesFilter()&&(o.isGroup()?e(o.getChildren()):t.push(o.getColumn()))})};return e(this.modelItem.getChildren()),t}onChangeCommon(t){this.refreshAriaLabel(),!this.processingColumnStateChange&&this.modelItemUtils.selectAllChildren(this.modelItem.getChildren(),t,this.eventType)}refreshAriaLabel(){const t=this.localeService.getLocaleTextFunc(),e=t("ariaColumnGroup","Column Group"),n=this.cbSelect.getValue(),o=n===void 0?t("ariaIndeterminate","indeterminate"):n?t("ariaVisible","visible"):t("ariaHidden","hidden"),i=t("ariaToggleVisibility","Press SPACE to toggle visibility");T._setAriaLabel(this.focusWrapper,`${this.displayName} ${e}`),this.cbSelect.setInputAriaLabel(`${i} (${o})`),T._setAriaDescribedBy(this.focusWrapper,this.cbSelect.getInputElement().id)}onColumnStateChanged(){const t=this.workOutSelectedValue(),e=this.workOutReadOnlyValue();this.processingColumnStateChange=!0,this.cbSelect.setValue(t),this.cbSelect.setReadOnly(e),this.addOrRemoveCssClass("ag-column-select-column-group-readonly",e),this.processingColumnStateChange=!1}workOutSelectedValue(){const t=this.columnModel.isPivotMode(),e=this.getVisibleLeafColumns();let n=0,o=0;if(e.forEach(i=>{!t&&i.getColDef().lockVisible||(this.isColumnChecked(i,t)?n++:o++)}),!(n>0&&o>0))return n>0}workOutReadOnlyValue(){const t=this.columnModel.isPivotMode();let e=0;return this.columnGroup.getLeafColumns().forEach(n=>{t?n.isAnyFunctionAllowed()&&e++:n.getColDef().lockVisible||e++}),e===0}isColumnChecked(t,e){if(e){const n=t.isPivotActive(),o=t.isRowGroupActive(),i=t.isValueActive();return n||o||i}return t.isVisible()}onExpandOrContractClicked(){const t=this.modelItem.isExpanded();this.modelItem.setExpanded(!t)}onExpandChanged(){this.setOpenClosedIcons(),this.refreshAriaExpanded()}setOpenClosedIcons(){const t=this.modelItem.isExpanded();T._setDisplayed(this.eGroupClosedIcon,!t),T._setDisplayed(this.eGroupOpenedIcon,t)}refreshAriaExpanded(){T._setAriaExpanded(this.focusWrapper,this.modelItem.isExpanded())}getDisplayName(){return this.displayName}onSelectAllChanged(t){const e=this.cbSelect.getValue();!this.cbSelect.isReadOnly()&&(t&&!e||!t&&e)&&this.cbSelect.toggle()}isSelected(){return this.cbSelect.getValue()}isSelectable(){return!this.cbSelect.isReadOnly()}setSelected(t){this.cbSelect.setValue(t,!0)}},DC=class extends T.BeanStub{constructor(t,e){super(),this.comp=t,this.virtualList=e}wireBeans(t){this.columnMoveService=t.columnMoveService,this.columnModel=t.columnModel}postConstruct(){this.createManagedBean(new Me.VirtualListDragFeature(this.comp,this.virtualList,{dragSourceType:T.DragSourceType.ToolPanel,listItemDragStartEvent:"columnPanelItemDragStart",listItemDragEndEvent:"columnPanelItemDragEnd",eventSource:this.eventService,getCurrentDragValue:t=>this.getCurrentDragValue(t),isMoveBlocked:t=>this.isMoveBlocked(t),getNumRows:t=>t.getDisplayedColsList().length,moveItem:(t,e)=>this.moveItem(this.getCurrentColumnsBeingMoved(t),e)}))}getCurrentDragValue(t){return t.column}getCurrentColumnsBeingMoved(t){return T.isProvidedColumnGroup(t)?t.getLeafColumns():t?[t]:[]}isMoveBlocked(t){return this.gos.get("suppressMovableColumns")?!0:!!this.getCurrentColumnsBeingMoved(t).find(i=>{const l=i.getColDef();return!!l.suppressMovable||!!l.lockPosition})}moveItem(t,e){if(!e)return;const{component:n}=e;let o=null,i=e.position==="top";if(n instanceof Lu?(o=n.getColumns()[0],i=!0):n&&(o=n.getColumn()),!o)return;const l=this.getMoveTargetIndex({currentColumns:t,lastHoveredColumn:o,isBefore:i});l!=null&&this.columnMoveService.moveColumns(t,l,"toolPanelUi")}getMoveTargetIndex(t){const{currentColumns:e,lastHoveredColumn:n,isBefore:o}=t;if(!n||!e)return null;const i=this.columnModel.getCols().indexOf(n),l=o?i:i+1,c=this.getMoveDiff(e,l);return l-c}getMoveDiff(t,e){const n=this.columnModel.getCols();if(!t)return 0;const o=t[0],i=t.length;return n.indexOf(o)<e?i:0}},IC=class extends T.Component{constructor(t,e,n,o){super(),this.allowDragging=e,this.groupsExist=n,this.focusWrapper=o,this.eLabel=T.RefPlaceholder,this.cbSelect=T.RefPlaceholder,this.processingColumnStateChange=!1,this.column=t.getColumn(),this.columnDept=t.getDept(),this.displayName=t.getDisplayName()}wireBeans(t){this.columnModel=t.columnModel,this.dragAndDropService=t.dragAndDropService,this.modelItemUtils=t.modelItemUtils}postConstruct(){this.setTemplate(`<div class="ag-column-select-column">
36
36
  <ag-checkbox data-ref="cbSelect" class="ag-column-select-checkbox"></ag-checkbox>
37
37
  <span class="ag-column-select-column-label" data-ref="eLabel"></span>
38
- </div>`,[T.AgCheckboxSelector]),this.eDragHandle=T._createIconNoSpan("columnDrag",this.gos),this.eDragHandle.classList.add("ag-drag-handle","ag-column-select-column-drag-handle");const t=this.cbSelect.getGui(),e=this.cbSelect.getInputElement();t.insertAdjacentElement("afterend",this.eDragHandle),e.setAttribute("tabindex","-1");const n=T._escapeString(this.displayName);this.eLabel.innerHTML=n;const o=this.columnDept;this.groupsExist&&this.addCssClass("ag-column-select-add-group-indent"),this.addCssClass(`ag-column-select-indent-${o}`),this.getGui().style.setProperty("--ag-indentation-level",String(o)),this.setupDragging();const i=this.onColumnStateChanged.bind(this);this.addManagedEventListeners({columnPivotModeChanged:i}),this.addManagedListeners(this.column,{columnValueChanged:i,columnPivotChanged:i,columnRowGroupChanged:i,visibleChanged:i}),this.addManagedListeners(this.focusWrapper,{keydown:this.handleKeyDown.bind(this),contextmenu:this.onContextMenu.bind(this)}),this.addManagedPropertyListener("functionsReadOnly",this.onColumnStateChanged.bind(this)),this.addManagedListeners(this.cbSelect,{fieldValueChanged:this.onCheckboxChanged.bind(this)}),this.addManagedElementListeners(this.eLabel,{click:this.onLabelClicked.bind(this)}),this.onColumnStateChanged(),this.refreshAriaLabel(),this.setupTooltip(),T._getToolPanelClassesFromColDef(this.column.getColDef(),this.gos,this.column,null).forEach(c=>this.addOrRemoveCssClass(c,!0))}getColumn(){return this.column}setupTooltip(){const t=this.gos.get("tooltipShowMode")==="whenTruncated";let e;t&&(e=()=>this.eLabel.scrollWidth>this.eLabel.clientWidth);const n=()=>{const o=this.column.getColDef().headerTooltip;this.setTooltip({newTooltipText:o,location:"columnToolPanelColumn",shouldDisplayTooltip:e})};n(),this.addManagedEventListeners({newColumnsLoaded:n})}getTooltipParams(){const t=super.getTooltipParams();return t.location="columnToolPanelColumn",t.colDef=this.column.getColDef(),t}onContextMenu(t){const{column:e,gos:n}=this;if(n.get("functionsReadOnly"))return;const o=this.createBean(new Iu(e,t,this.focusWrapper));this.addDestroyFunc(()=>{o.isAlive()&&this.destroyBean(o)})}handleKeyDown(t){t.key===T.KeyCode.SPACE&&(t.preventDefault(),this.isSelectable()&&this.onSelectAllChanged(!this.isSelected()))}onLabelClicked(){if(this.gos.get("functionsReadOnly"))return;const t=!this.cbSelect.getValue();this.onChangeCommon(t)}onCheckboxChanged(t){this.onChangeCommon(t.selected)}onChangeCommon(t){this.cbSelect.isReadOnly()||(this.refreshAriaLabel(),!this.processingColumnStateChange&&this.modelItemUtils.setColumn(this.column,t,"toolPanelUi"))}refreshAriaLabel(){const t=this.localeService.getLocaleTextFunc(),e=t("ariaColumn","Column"),n=this.cbSelect.getValue()?t("ariaVisible","visible"):t("ariaHidden","hidden"),o=t("ariaToggleVisibility","Press SPACE to toggle visibility");T._setAriaLabel(this.focusWrapper,`${this.displayName} ${e}`),this.cbSelect.setInputAriaLabel(`${o} (${n})`),T._setAriaDescribedBy(this.focusWrapper,this.cbSelect.getInputElement().id)}setupDragging(){if(!this.allowDragging){T._setDisplayed(this.eDragHandle,!1);return}let t=!this.gos.get("suppressDragLeaveHidesColumns");const e={type:T.DragSourceType.ToolPanel,eElement:this.eDragHandle,dragItemName:this.displayName,getDefaultIconName:()=>t?"hide":"notAllowed",getDragItem:()=>this.createDragItem(),onDragStarted:()=>{t=!this.gos.get("suppressDragLeaveHidesColumns"),this.eventService.dispatchEvent({type:"columnPanelItemDragStart",column:this.column})},onDragStopped:()=>{this.eventService.dispatchEvent({type:"columnPanelItemDragEnd"})},onGridEnter:n=>{t&&this.modelItemUtils.updateColumns({columns:[this.column],visibleState:n==null?void 0:n.visibleState,pivotState:n==null?void 0:n.pivotState,eventType:"toolPanelUi"})},onGridExit:()=>{t&&this.onChangeCommon(!1)}};this.dragAndDropService.addDragSource(e,!0),this.addDestroyFunc(()=>this.dragAndDropService.removeDragSource(e))}createDragItem(){const t=this.column.getColId(),e={[t]:this.column.isVisible()},n={[t]:this.modelItemUtils.createPivotState(this.column)};return{columns:[this.column],visibleState:e,pivotState:n}}onColumnStateChanged(){this.processingColumnStateChange=!0;const t=this.columnModel.isPivotMode();if(t){const o=this.column.isAnyFunctionActive();this.cbSelect.setValue(o)}else this.cbSelect.setValue(this.column.isVisible());let e=!0,n=!0;if(t){const o=this.gos.get("functionsReadOnly"),i=!this.column.isAnyFunctionAllowed();e=!o&&!i,n=e}else{const{enableRowGroup:o,enableValue:i,lockPosition:l,suppressMovable:c,lockVisible:d}=this.column.getColDef(),p=!!o||!!i,h=!!l||!!c;e=!d,n=p||!h}this.cbSelect.setReadOnly(!e),this.eDragHandle.classList.toggle("ag-column-select-column-readonly",!n),this.addOrRemoveCssClass("ag-column-select-column-readonly",!n&&!e),this.cbSelect.setPassive(!1),this.processingColumnStateChange=!1}getDisplayName(){return this.displayName}onSelectAllChanged(t){t!==this.cbSelect.getValue()&&(this.cbSelect.isReadOnly()||this.cbSelect.toggle())}isSelected(){return this.cbSelect.getValue()}isSelectable(){return!this.cbSelect.isReadOnly()}isExpandable(){return!1}setExpanded(t){T._warnOnce("can not expand a column item that does not represent a column group header")}},Rv=class{constructor(t){this.items=t}getRowCount(){return this.items.length}getRow(t){return this.items[t]}},Dv="ag-column-select-list",Iv=class extends T.Component{constructor(){super(`<div class="${Dv}" role="presentation"></div>`),this.destroyColumnItemFuncs=[],this.hasLoadedInitialState=!1,this.isInitialState=!1}wireBeans(t){this.columnModel=t.columnModel,this.columnNameService=t.columnNameService,this.colDefService=t.toolPanelColDefService,this.modelItemUtils=t.modelItemUtils}destroy(){this.destroyColumnTree(),super.destroy()}destroyColumnTree(){this.allColsTree=[],this.destroyColumnItemFuncs.forEach(t=>t()),this.destroyColumnItemFuncs=[]}init(t,e,n){this.params=t,this.allowDragging=e,this.eventType=n,this.params.suppressSyncLayoutWithGrid||this.addManagedEventListeners({columnMoved:this.onColumnsChanged.bind(this)}),this.addManagedEventListeners({newColumnsLoaded:this.onColumnsChanged.bind(this)});const o=this.fireSelectionChangedEvent.bind(this);this.addManagedEventListeners({columnPivotChanged:o,columnPivotModeChanged:o,columnRowGroupChanged:o,columnValueChanged:o,columnVisible:o,newColumnsLoaded:o}),this.expandGroupsByDefault=!this.params.contractColumnSelection,this.virtualList=this.createManagedBean(new Me.VirtualList({cssIdentifier:"column-select",ariaRole:"tree"})),this.appendChild(this.virtualList.getGui()),this.virtualList.setComponentCreator((i,l)=>(T._setAriaLevel(l,i.getDept()+1),this.createComponentFromItem(i,l))),this.columnModel.isReady()&&this.onColumnsChanged(),!this.params.suppressColumnMove&&this.createManagedBean(new Bv(this,this.virtualList))}createComponentFromItem(t,e){if(t.isGroup()){const o=new Fu(t,this.allowDragging,this.eventType,e);return this.createBean(o),o}const n=new Pv(t,this.allowDragging,this.groupsExist,e);return this.createBean(n),n}onColumnsChanged(){this.hasLoadedInitialState||(this.hasLoadedInitialState=!0,this.isInitialState=!!this.params.initialState);const t=this.getExpandedStates(),e=this.columnModel.isPivotMode();!this.params.suppressSyncLayoutWithGrid&&!e?this.buildTreeFromWhatGridIsDisplaying():this.buildTreeFromProvidedColumnDefs(),this.setExpandedStates(t),this.markFilteredColumns(),this.flattenAndFilterModel(),this.isInitialState=!1}getDisplayedColsList(){return this.displayedColsList}getExpandedStates(){const t={};if(this.isInitialState){const{expandedGroupIds:e}=this.params.initialState;return e.forEach(n=>{t[n]=!0}),t}return this.allColsTree?(this.forEachItem(e=>{if(!e.isGroup())return;const n=e.getColumnGroup();n&&(t[n.getId()]=e.isExpanded())}),t):{}}setExpandedStates(t){if(!this.allColsTree)return;const{isInitialState:e}=this;this.forEachItem(n=>{if(!n.isGroup())return;const o=n.getColumnGroup();if(o){const i=t[o.getId()];(i!=null||e)&&n.setExpanded(!!i)}})}buildTreeFromWhatGridIsDisplaying(){this.colDefService.syncLayoutWithGrid(this.setColumnLayout.bind(this))}setColumnLayout(t){const e=this.colDefService.createColumnTree(t);this.buildListModel(e),this.groupsExist=t.some(n=>n&&typeof n.children<"u"),this.markFilteredColumns(),this.flattenAndFilterModel()}buildTreeFromProvidedColumnDefs(){this.buildListModel(this.columnModel.getColDefColTree()),this.groupsExist=this.columnModel.isProvidedColGroupsPresent()}buildListModel(t){const e=this.onColumnExpanded.bind(this),n=c=>{c.addEventListener("expandedChanged",e);const d=c.removeEventListener.bind(c,"expandedChanged",e);this.destroyColumnItemFuncs.push(d)},o=(c,d,p)=>{c.forEach(h=>{T.isProvidedColumnGroup(h)?i(h,d,p):l(h,d,p)})},i=(c,d,p)=>{const h=c.getColGroupDef();if(h&&h.suppressColumnsToolPanel)return;if(c.isPadding()){o(c.getChildren(),d,p);return}const y=this.columnNameService.getDisplayNameForProvidedColumnGroup(null,c,"columnToolPanel"),b=new Du(y,c,d,!0,this.expandGroupsByDefault);p.push(b),n(b),o(c.getChildren(),d+1,b.getChildren())},l=(c,d,p)=>{if(c.getColDef()&&c.getColDef().suppressColumnsToolPanel)return;const m=this.columnNameService.getDisplayNameForColumn(c,"columnToolPanel");p.push(new Du(m,c,d))};this.destroyColumnTree(),o(t,0,this.allColsTree)}onColumnExpanded(){this.flattenAndFilterModel()}flattenAndFilterModel(){this.displayedColsList=[];const t=n=>{n.isPassesFilter()&&(this.displayedColsList.push(n),n.isGroup()&&n.isExpanded()&&n.getChildren().forEach(t))};this.allColsTree.forEach(t),this.virtualList.setModel(new Rv(this.displayedColsList));const e=this.virtualList.getLastFocusedRow();this.virtualList.refresh(),e!=null&&this.focusRowIfAlive(e),this.notifyListeners(),this.refreshAriaLabel()}refreshAriaLabel(){const t=this.localeService.getLocaleTextFunc(),e=t("ariaColumnPanelList","Column List"),n=t("columns","Columns"),o=this.displayedColsList.length;T._setAriaLabel(this.virtualList.getAriaElement(),`${e} ${o} ${n}`)}focusRowIfAlive(t){window.setTimeout(()=>{this.isAlive()&&this.virtualList.focusRow(t)},0)}forEachItem(t){const e=n=>{n.forEach(o=>{t(o),o.isGroup()&&e(o.getChildren())})};this.allColsTree&&e(this.allColsTree)}doSetExpandedAll(t){this.forEachItem(e=>{e.isGroup()&&e.setExpanded(t)})}setGroupsExpanded(t,e){if(!e){this.doSetExpandedAll(t);return}const n=[];this.forEachItem(i=>{if(!i.isGroup())return;const l=i.getColumnGroup().getId();e.indexOf(l)>=0&&(i.setExpanded(t),n.push(l))});const o=e.filter(i=>!T._includes(n,i));o.length>0&&T._warnOnce("unable to find group(s) for supplied groupIds:",o)}getExpandState(){let t=0,e=0;return this.forEachItem(n=>{n.isGroup()&&(n.isExpanded()?t++:e++)}),t>0&&e>0?2:e>0?1:0}doSetSelectedAll(t){this.modelItemUtils.selectAllChildren(this.allColsTree,t,this.eventType)}getSelectionState(){let t=0,e=0;const n=this.columnModel.isPivotMode();if(this.forEachItem(o=>{if(o.isGroup()||!o.isPassesFilter())return;const i=o.getColumn(),l=i.getColDef();let c;if(n){if(!i.isAllowPivot()&&!i.isAllowRowGroup()&&!i.isAllowValue())return;c=i.isValueActive()||i.isPivotActive()||i.isRowGroupActive()}else{if(l.lockVisible)return;c=i.isVisible()}c?t++:e++}),!(t>0&&e>0))return!(t===0||e>0)}setFilterText(t){this.filterText=T._exists(t)?t.toLowerCase():null,this.markFilteredColumns(),this.flattenAndFilterModel()}markFilteredColumns(){const t=n=>{if(!T._exists(this.filterText))return!0;const o=n.getDisplayName();return o==null||o.toLowerCase().indexOf(this.filterText)!==-1},e=(n,o)=>{let i=!1;if(n.isGroup()){const c=t(n);n.getChildren().forEach(d=>{const p=e(d,c||o);p&&(i=p)})}const l=o||i?!0:t(n);return n.setPassesFilter(l),l};this.allColsTree.forEach(n=>e(n,!1))}notifyListeners(){this.fireGroupExpandedEvent(),this.fireSelectionChangedEvent()}fireGroupExpandedEvent(){const t=this.getExpandState();this.dispatchLocalEvent({type:"groupExpanded",state:t})}fireSelectionChangedEvent(){if(!this.allColsTree)return;const t=this.getSelectionState();this.dispatchLocalEvent({type:"selectionChanged",state:t})}getExpandedGroups(){const t=[];return this.allColsTree&&this.forEachItem(e=>{e.isGroup()&&e.isExpanded()&&t.push(e.getColumnGroup().getId())}),t}},Fv={selector:"AG-PRIMARY-COLS-LIST",component:Iv},Lv=class extends T.Component{constructor(){super(`<div class="ag-column-select">
38
+ </div>`,[T.AgCheckboxSelector]),this.eDragHandle=T._createIconNoSpan("columnDrag",this.gos),this.eDragHandle.classList.add("ag-drag-handle","ag-column-select-column-drag-handle");const t=this.cbSelect.getGui(),e=this.cbSelect.getInputElement();t.insertAdjacentElement("afterend",this.eDragHandle),e.setAttribute("tabindex","-1");const n=T._escapeString(this.displayName);this.eLabel.innerHTML=n;const o=this.columnDept;this.groupsExist&&this.addCssClass("ag-column-select-add-group-indent"),this.addCssClass(`ag-column-select-indent-${o}`),this.getGui().style.setProperty("--ag-indentation-level",String(o)),this.setupDragging();const i=this.onColumnStateChanged.bind(this);this.addManagedEventListeners({columnPivotModeChanged:i}),this.addManagedListeners(this.column,{columnValueChanged:i,columnPivotChanged:i,columnRowGroupChanged:i,visibleChanged:i}),this.addManagedListeners(this.focusWrapper,{keydown:this.handleKeyDown.bind(this),contextmenu:this.onContextMenu.bind(this)}),this.addManagedPropertyListener("functionsReadOnly",this.onColumnStateChanged.bind(this)),this.addManagedListeners(this.cbSelect,{fieldValueChanged:this.onCheckboxChanged.bind(this)}),this.addManagedElementListeners(this.eLabel,{click:this.onLabelClicked.bind(this)}),this.onColumnStateChanged(),this.refreshAriaLabel(),this.setupTooltip(),T._getToolPanelClassesFromColDef(this.column.getColDef(),this.gos,this.column,null).forEach(c=>this.addOrRemoveCssClass(c,!0))}getColumn(){return this.column}setupTooltip(){const t=this.gos.get("tooltipShowMode")==="whenTruncated";let e;t&&(e=()=>this.eLabel.scrollWidth>this.eLabel.clientWidth);const n=()=>{const o=this.column.getColDef().headerTooltip;this.setTooltip({newTooltipText:o,location:"columnToolPanelColumn",shouldDisplayTooltip:e})};n(),this.addManagedEventListeners({newColumnsLoaded:n})}getTooltipParams(){const t=super.getTooltipParams();return t.location="columnToolPanelColumn",t.colDef=this.column.getColDef(),t}onContextMenu(t){const{column:e,gos:n}=this;if(n.get("functionsReadOnly"))return;const o=this.createBean(new Fu(e,t,this.focusWrapper));this.addDestroyFunc(()=>{o.isAlive()&&this.destroyBean(o)})}handleKeyDown(t){t.key===T.KeyCode.SPACE&&(t.preventDefault(),this.isSelectable()&&this.onSelectAllChanged(!this.isSelected()))}onLabelClicked(){if(this.gos.get("functionsReadOnly"))return;const t=!this.cbSelect.getValue();this.onChangeCommon(t)}onCheckboxChanged(t){this.onChangeCommon(t.selected)}onChangeCommon(t){this.cbSelect.isReadOnly()||(this.refreshAriaLabel(),!this.processingColumnStateChange&&this.modelItemUtils.setColumn(this.column,t,"toolPanelUi"))}refreshAriaLabel(){const t=this.localeService.getLocaleTextFunc(),e=t("ariaColumn","Column"),n=this.cbSelect.getValue()?t("ariaVisible","visible"):t("ariaHidden","hidden"),o=t("ariaToggleVisibility","Press SPACE to toggle visibility");T._setAriaLabel(this.focusWrapper,`${this.displayName} ${e}`),this.cbSelect.setInputAriaLabel(`${o} (${n})`),T._setAriaDescribedBy(this.focusWrapper,this.cbSelect.getInputElement().id)}setupDragging(){if(!this.allowDragging){T._setDisplayed(this.eDragHandle,!1);return}let t=!this.gos.get("suppressDragLeaveHidesColumns");const e={type:T.DragSourceType.ToolPanel,eElement:this.eDragHandle,dragItemName:this.displayName,getDefaultIconName:()=>t?"hide":"notAllowed",getDragItem:()=>this.createDragItem(),onDragStarted:()=>{t=!this.gos.get("suppressDragLeaveHidesColumns"),this.eventService.dispatchEvent({type:"columnPanelItemDragStart",column:this.column})},onDragStopped:()=>{this.eventService.dispatchEvent({type:"columnPanelItemDragEnd"})},onGridEnter:n=>{t&&this.modelItemUtils.updateColumns({columns:[this.column],visibleState:n==null?void 0:n.visibleState,pivotState:n==null?void 0:n.pivotState,eventType:"toolPanelUi"})},onGridExit:()=>{t&&this.onChangeCommon(!1)}};this.dragAndDropService.addDragSource(e,!0),this.addDestroyFunc(()=>this.dragAndDropService.removeDragSource(e))}createDragItem(){const t=this.column.getColId(),e={[t]:this.column.isVisible()},n={[t]:this.modelItemUtils.createPivotState(this.column)};return{columns:[this.column],visibleState:e,pivotState:n}}onColumnStateChanged(){this.processingColumnStateChange=!0;const t=this.columnModel.isPivotMode();if(t){const o=this.column.isAnyFunctionActive();this.cbSelect.setValue(o)}else this.cbSelect.setValue(this.column.isVisible());let e=!0,n=!0;if(t){const o=this.gos.get("functionsReadOnly"),i=!this.column.isAnyFunctionAllowed();e=!o&&!i,n=e}else{const{enableRowGroup:o,enableValue:i,lockPosition:l,suppressMovable:c,lockVisible:d}=this.column.getColDef(),p=!!o||!!i,h=!!l||!!c;e=!d,n=p||!h}this.cbSelect.setReadOnly(!e),this.eDragHandle.classList.toggle("ag-column-select-column-readonly",!n),this.addOrRemoveCssClass("ag-column-select-column-readonly",!n&&!e),this.cbSelect.setPassive(!1),this.processingColumnStateChange=!1}getDisplayName(){return this.displayName}onSelectAllChanged(t){t!==this.cbSelect.getValue()&&(this.cbSelect.isReadOnly()||this.cbSelect.toggle())}isSelected(){return this.cbSelect.getValue()}isSelectable(){return!this.cbSelect.isReadOnly()}isExpandable(){return!1}setExpanded(t){T._warnOnce("can not expand a column item that does not represent a column group header")}},FC=class{constructor(t){this.items=t}getRowCount(){return this.items.length}getRow(t){return this.items[t]}},LC="ag-column-select-list",OC=class extends T.Component{constructor(){super(`<div class="${LC}" role="presentation"></div>`),this.destroyColumnItemFuncs=[],this.hasLoadedInitialState=!1,this.isInitialState=!1}wireBeans(t){this.columnModel=t.columnModel,this.columnNameService=t.columnNameService,this.colDefService=t.toolPanelColDefService,this.modelItemUtils=t.modelItemUtils}destroy(){this.destroyColumnTree(),super.destroy()}destroyColumnTree(){this.allColsTree=[],this.destroyColumnItemFuncs.forEach(t=>t()),this.destroyColumnItemFuncs=[]}init(t,e,n){this.params=t,this.allowDragging=e,this.eventType=n,this.params.suppressSyncLayoutWithGrid||this.addManagedEventListeners({columnMoved:this.onColumnsChanged.bind(this)}),this.addManagedEventListeners({newColumnsLoaded:this.onColumnsChanged.bind(this)});const o=this.fireSelectionChangedEvent.bind(this);this.addManagedEventListeners({columnPivotChanged:o,columnPivotModeChanged:o,columnRowGroupChanged:o,columnValueChanged:o,columnVisible:o,newColumnsLoaded:o}),this.expandGroupsByDefault=!this.params.contractColumnSelection,this.virtualList=this.createManagedBean(new Me.VirtualList({cssIdentifier:"column-select",ariaRole:"tree"})),this.appendChild(this.virtualList.getGui()),this.virtualList.setComponentCreator((i,l)=>(T._setAriaLevel(l,i.getDept()+1),this.createComponentFromItem(i,l))),this.columnModel.isReady()&&this.onColumnsChanged(),!this.params.suppressColumnMove&&this.createManagedBean(new DC(this,this.virtualList))}createComponentFromItem(t,e){if(t.isGroup()){const o=new Lu(t,this.allowDragging,this.eventType,e);return this.createBean(o),o}const n=new IC(t,this.allowDragging,this.groupsExist,e);return this.createBean(n),n}onColumnsChanged(){this.hasLoadedInitialState||(this.hasLoadedInitialState=!0,this.isInitialState=!!this.params.initialState);const t=this.getExpandedStates(),e=this.columnModel.isPivotMode();!this.params.suppressSyncLayoutWithGrid&&!e?this.buildTreeFromWhatGridIsDisplaying():this.buildTreeFromProvidedColumnDefs(),this.setExpandedStates(t),this.markFilteredColumns(),this.flattenAndFilterModel(),this.isInitialState=!1}getDisplayedColsList(){return this.displayedColsList}getExpandedStates(){const t={};if(this.isInitialState){const{expandedGroupIds:e}=this.params.initialState;return e.forEach(n=>{t[n]=!0}),t}return this.allColsTree?(this.forEachItem(e=>{if(!e.isGroup())return;const n=e.getColumnGroup();n&&(t[n.getId()]=e.isExpanded())}),t):{}}setExpandedStates(t){if(!this.allColsTree)return;const{isInitialState:e}=this;this.forEachItem(n=>{if(!n.isGroup())return;const o=n.getColumnGroup();if(o){const i=t[o.getId()];(i!=null||e)&&n.setExpanded(!!i)}})}buildTreeFromWhatGridIsDisplaying(){this.colDefService.syncLayoutWithGrid(this.setColumnLayout.bind(this))}setColumnLayout(t){const e=this.colDefService.createColumnTree(t);this.buildListModel(e),this.groupsExist=t.some(n=>n&&typeof n.children<"u"),this.markFilteredColumns(),this.flattenAndFilterModel()}buildTreeFromProvidedColumnDefs(){this.buildListModel(this.columnModel.getColDefColTree()),this.groupsExist=this.columnModel.isProvidedColGroupsPresent()}buildListModel(t){const e=this.onColumnExpanded.bind(this),n=c=>{c.addEventListener("expandedChanged",e);const d=c.removeEventListener.bind(c,"expandedChanged",e);this.destroyColumnItemFuncs.push(d)},o=(c,d,p)=>{c.forEach(h=>{T.isProvidedColumnGroup(h)?i(h,d,p):l(h,d,p)})},i=(c,d,p)=>{const h=c.getColGroupDef();if(h&&h.suppressColumnsToolPanel)return;if(c.isPadding()){o(c.getChildren(),d,p);return}const y=this.columnNameService.getDisplayNameForProvidedColumnGroup(null,c,"columnToolPanel"),b=new Iu(y,c,d,!0,this.expandGroupsByDefault);p.push(b),n(b),o(c.getChildren(),d+1,b.getChildren())},l=(c,d,p)=>{if(c.getColDef()&&c.getColDef().suppressColumnsToolPanel)return;const m=this.columnNameService.getDisplayNameForColumn(c,"columnToolPanel");p.push(new Iu(m,c,d))};this.destroyColumnTree(),o(t,0,this.allColsTree)}onColumnExpanded(){this.flattenAndFilterModel()}flattenAndFilterModel(){this.displayedColsList=[];const t=n=>{n.isPassesFilter()&&(this.displayedColsList.push(n),n.isGroup()&&n.isExpanded()&&n.getChildren().forEach(t))};this.allColsTree.forEach(t),this.virtualList.setModel(new FC(this.displayedColsList));const e=this.virtualList.getLastFocusedRow();this.virtualList.refresh(),e!=null&&this.focusRowIfAlive(e),this.notifyListeners(),this.refreshAriaLabel()}refreshAriaLabel(){const t=this.localeService.getLocaleTextFunc(),e=t("ariaColumnPanelList","Column List"),n=t("columns","Columns"),o=this.displayedColsList.length;T._setAriaLabel(this.virtualList.getAriaElement(),`${e} ${o} ${n}`)}focusRowIfAlive(t){window.setTimeout(()=>{this.isAlive()&&this.virtualList.focusRow(t)},0)}forEachItem(t){const e=n=>{n.forEach(o=>{t(o),o.isGroup()&&e(o.getChildren())})};this.allColsTree&&e(this.allColsTree)}doSetExpandedAll(t){this.forEachItem(e=>{e.isGroup()&&e.setExpanded(t)})}setGroupsExpanded(t,e){if(!e){this.doSetExpandedAll(t);return}const n=[];this.forEachItem(i=>{if(!i.isGroup())return;const l=i.getColumnGroup().getId();e.indexOf(l)>=0&&(i.setExpanded(t),n.push(l))});const o=e.filter(i=>!T._includes(n,i));o.length>0&&T._warnOnce("unable to find group(s) for supplied groupIds:",o)}getExpandState(){let t=0,e=0;return this.forEachItem(n=>{n.isGroup()&&(n.isExpanded()?t++:e++)}),t>0&&e>0?2:e>0?1:0}doSetSelectedAll(t){this.modelItemUtils.selectAllChildren(this.allColsTree,t,this.eventType)}getSelectionState(){let t=0,e=0;const n=this.columnModel.isPivotMode();if(this.forEachItem(o=>{if(o.isGroup()||!o.isPassesFilter())return;const i=o.getColumn(),l=i.getColDef();let c;if(n){if(!i.isAllowPivot()&&!i.isAllowRowGroup()&&!i.isAllowValue())return;c=i.isValueActive()||i.isPivotActive()||i.isRowGroupActive()}else{if(l.lockVisible)return;c=i.isVisible()}c?t++:e++}),!(t>0&&e>0))return!(t===0||e>0)}setFilterText(t){this.filterText=T._exists(t)?t.toLowerCase():null,this.markFilteredColumns(),this.flattenAndFilterModel()}markFilteredColumns(){const t=n=>{if(!T._exists(this.filterText))return!0;const o=n.getDisplayName();return o==null||o.toLowerCase().indexOf(this.filterText)!==-1},e=(n,o)=>{let i=!1;if(n.isGroup()){const c=t(n);n.getChildren().forEach(d=>{const p=e(d,c||o);p&&(i=p)})}const l=o||i?!0:t(n);return n.setPassesFilter(l),l};this.allColsTree.forEach(n=>e(n,!1))}notifyListeners(){this.fireGroupExpandedEvent(),this.fireSelectionChangedEvent()}fireGroupExpandedEvent(){const t=this.getExpandState();this.dispatchLocalEvent({type:"groupExpanded",state:t})}fireSelectionChangedEvent(){if(!this.allColsTree)return;const t=this.getSelectionState();this.dispatchLocalEvent({type:"selectionChanged",state:t})}getExpandedGroups(){const t=[];return this.allColsTree&&this.forEachItem(e=>{e.isGroup()&&e.isExpanded()&&t.push(e.getColumnGroup().getId())}),t}},MC={selector:"AG-PRIMARY-COLS-LIST",component:OC},GC=class extends T.Component{constructor(){super(`<div class="ag-column-select">
39
39
  <ag-primary-cols-header data-ref="primaryColsHeaderPanel"></ag-primary-cols-header>
40
40
  <ag-primary-cols-list data-ref="primaryColsListPanel"></ag-primary-cols-list>
41
- </div>`,[Av,Fv]),this.primaryColsHeaderPanel=T.RefPlaceholder,this.primaryColsListPanel=T.RefPlaceholder}init(t,e,n){this.allowDragging=t,this.params=e,this.eventType=n,this.primaryColsHeaderPanel.init(this.params);const o=this.params.suppressColumnFilter,i=this.params.suppressColumnSelectAll;this.params.suppressColumnExpandAll&&o&&i&&this.primaryColsHeaderPanel.setDisplayed(!1),this.addManagedListeners(this.primaryColsListPanel,{groupExpanded:this.onGroupExpanded.bind(this),selectionChanged:this.onSelectionChange.bind(this)}),this.primaryColsListPanel.init(this.params,this.allowDragging,this.eventType),this.addManagedListeners(this.primaryColsHeaderPanel,{expandAll:this.onExpandAll.bind(this),collapseAll:this.onCollapseAll.bind(this),selectAll:this.onSelectAll.bind(this),unselectAll:this.onUnselectAll.bind(this),filterChanged:this.onFilterChanged.bind(this)}),this.positionableFeature=new T.PositionableFeature(this.getGui(),{minHeight:100}),this.createManagedBean(this.positionableFeature)}toggleResizable(t){this.positionableFeature.setResizable(t?{bottom:!0}:!1)}onExpandAll(){this.primaryColsListPanel.doSetExpandedAll(!0)}onCollapseAll(){this.primaryColsListPanel.doSetExpandedAll(!1)}expandGroups(t){this.primaryColsListPanel.setGroupsExpanded(!0,t)}collapseGroups(t){this.primaryColsListPanel.setGroupsExpanded(!1,t)}setColumnLayout(t){this.primaryColsListPanel.setColumnLayout(t)}onFilterChanged(t){this.primaryColsListPanel.setFilterText(t.filterText)}syncLayoutWithGrid(){this.primaryColsListPanel.onColumnsChanged()}onSelectAll(){this.primaryColsListPanel.doSetSelectedAll(!0)}onUnselectAll(){this.primaryColsListPanel.doSetSelectedAll(!1)}onGroupExpanded(t){this.primaryColsHeaderPanel.setExpandState(t.state),this.params.onStateUpdated()}onSelectionChange(t){this.primaryColsHeaderPanel.setSelectionState(t.state)}getExpandedGroups(){return this.primaryColsListPanel.getExpandedGroups()}},Lu=class extends T.Component{constructor(){super(...arguments),this.cbPivotMode=T.RefPlaceholder}wireBeans(t){this.columnModel=t.columnModel,this.ctrlsService=t.ctrlsService}createTemplate(){return`<div class="ag-pivot-mode-panel">
41
+ </div>`,[RC,MC]),this.primaryColsHeaderPanel=T.RefPlaceholder,this.primaryColsListPanel=T.RefPlaceholder}init(t,e,n){this.allowDragging=t,this.params=e,this.eventType=n,this.primaryColsHeaderPanel.init(this.params);const o=this.params.suppressColumnFilter,i=this.params.suppressColumnSelectAll;this.params.suppressColumnExpandAll&&o&&i&&this.primaryColsHeaderPanel.setDisplayed(!1),this.addManagedListeners(this.primaryColsListPanel,{groupExpanded:this.onGroupExpanded.bind(this),selectionChanged:this.onSelectionChange.bind(this)}),this.primaryColsListPanel.init(this.params,this.allowDragging,this.eventType),this.addManagedListeners(this.primaryColsHeaderPanel,{expandAll:this.onExpandAll.bind(this),collapseAll:this.onCollapseAll.bind(this),selectAll:this.onSelectAll.bind(this),unselectAll:this.onUnselectAll.bind(this),filterChanged:this.onFilterChanged.bind(this)}),this.positionableFeature=new T.PositionableFeature(this.getGui(),{minHeight:100}),this.createManagedBean(this.positionableFeature)}toggleResizable(t){this.positionableFeature.setResizable(t?{bottom:!0}:!1)}onExpandAll(){this.primaryColsListPanel.doSetExpandedAll(!0)}onCollapseAll(){this.primaryColsListPanel.doSetExpandedAll(!1)}expandGroups(t){this.primaryColsListPanel.setGroupsExpanded(!0,t)}collapseGroups(t){this.primaryColsListPanel.setGroupsExpanded(!1,t)}setColumnLayout(t){this.primaryColsListPanel.setColumnLayout(t)}onFilterChanged(t){this.primaryColsListPanel.setFilterText(t.filterText)}syncLayoutWithGrid(){this.primaryColsListPanel.onColumnsChanged()}onSelectAll(){this.primaryColsListPanel.doSetSelectedAll(!0)}onUnselectAll(){this.primaryColsListPanel.doSetSelectedAll(!1)}onGroupExpanded(t){this.primaryColsHeaderPanel.setExpandState(t.state),this.params.onStateUpdated()}onSelectionChange(t){this.primaryColsHeaderPanel.setSelectionState(t.state)}getExpandedGroups(){return this.primaryColsListPanel.getExpandedGroups()}},Ou=class extends T.Component{constructor(){super(...arguments),this.cbPivotMode=T.RefPlaceholder}wireBeans(t){this.columnModel=t.columnModel,this.ctrlsService=t.ctrlsService}createTemplate(){return`<div class="ag-pivot-mode-panel">
42
42
  <ag-toggle-button data-ref="cbPivotMode" class="ag-pivot-mode-select"></ag-toggle-button>
43
- </div>`}postConstruct(){this.setTemplate(this.createTemplate(),[T.AgToggleButtonSelector]),this.cbPivotMode.setValue(this.columnModel.isPivotMode());const t=this.localeService.getLocaleTextFunc();this.cbPivotMode.setLabel(t("pivotMode","Pivot Mode")),this.addManagedListeners(this.cbPivotMode,{fieldValueChanged:this.onBtPivotMode.bind(this)});const e=this.onPivotModeChanged.bind(this);this.addManagedEventListeners({newColumnsLoaded:e,columnPivotModeChanged:e})}onBtPivotMode(){const t=!!this.cbPivotMode.getValue();t!==this.columnModel.isPivotMode()&&(this.gos.updateGridOptions({options:{pivotMode:t},source:"toolPanelUi"}),this.ctrlsService.getHeaderRowContainerCtrls().forEach(e=>e.refresh()))}onPivotModeChanged(){const t=this.columnModel.isPivotMode();this.cbPivotMode.setValue(t)}},Ov=class extends T.Component{constructor(){super('<div class="ag-column-panel"></div>'),this.initialised=!1,this.childDestroyFuncs=[]}setVisible(t){super.setDisplayed(t),t&&!this.initialised&&this.init(this.params)}init(t){const e=this.gos.addGridCommonParams({suppressColumnMove:!1,suppressColumnSelectAll:!1,suppressColumnFilter:!1,suppressColumnExpandAll:!1,contractColumnSelection:!1,suppressPivotMode:!1,suppressRowGroups:!1,suppressValues:!1,suppressPivots:!1,suppressSyncLayoutWithGrid:!1});if(this.params={...e,...t},this.isRowGroupingModuleLoaded()&&!this.params.suppressPivotMode&&(this.pivotModePanel=this.createBean(new Lu),this.childDestroyFuncs.push(()=>this.destroyBean(this.pivotModePanel)),this.appendChild(this.pivotModePanel)),this.primaryColsPanel=this.createBean(new Lv),this.childDestroyFuncs.push(()=>this.destroyBean(this.primaryColsPanel)),this.primaryColsPanel.init(!0,this.params,"toolPanelUi"),this.primaryColsPanel.addCssClass("ag-column-panel-column-select"),this.appendChild(this.primaryColsPanel),this.isRowGroupingModuleLoaded()){this.params.suppressRowGroups||(this.rowGroupDropZonePanel=this.createBean(new gl(!1)),this.childDestroyFuncs.push(()=>this.destroyBean(this.rowGroupDropZonePanel)),this.appendChild(this.rowGroupDropZonePanel)),this.params.suppressValues||(this.valuesDropZonePanel=this.createBean(new Pu(!1)),this.childDestroyFuncs.push(()=>this.destroyBean(this.valuesDropZonePanel)),this.appendChild(this.valuesDropZonePanel)),this.params.suppressPivots||(this.pivotDropZonePanel=this.createBean(new ml(!1)),this.childDestroyFuncs.push(()=>this.destroyBean(this.pivotDropZonePanel)),this.appendChild(this.pivotDropZonePanel)),this.setLastVisible();const[n]=this.addManagedEventListeners({columnPivotModeChanged:()=>{this.resetChildrenHeight(),this.setLastVisible()}});this.childDestroyFuncs.push(()=>n())}this.initialised=!0}setPivotModeSectionVisible(t){this.isRowGroupingModuleLoaded()&&(this.pivotModePanel?this.pivotModePanel.setDisplayed(t):t&&(this.pivotModePanel=this.createBean(new Lu),this.getGui().insertBefore(this.pivotModePanel.getGui(),this.getGui().firstChild),this.childDestroyFuncs.push(()=>this.destroyBean(this.pivotModePanel))),this.setLastVisible())}setRowGroupsSectionVisible(t){this.isRowGroupingModuleLoaded()&&(this.rowGroupDropZonePanel?this.rowGroupDropZonePanel.setDisplayed(t):t&&(this.rowGroupDropZonePanel=this.createManagedBean(new gl(!1)),this.appendChild(this.rowGroupDropZonePanel)),this.setLastVisible())}setValuesSectionVisible(t){this.isRowGroupingModuleLoaded()&&(this.valuesDropZonePanel?this.valuesDropZonePanel.setDisplayed(t):t&&(this.valuesDropZonePanel=this.createManagedBean(new Pu(!1)),this.appendChild(this.valuesDropZonePanel)),this.setLastVisible())}setPivotSectionVisible(t){this.isRowGroupingModuleLoaded()&&(this.pivotDropZonePanel?this.pivotDropZonePanel.setDisplayed(t):t&&(this.pivotDropZonePanel=this.createManagedBean(new ml(!1)),this.appendChild(this.pivotDropZonePanel),this.pivotDropZonePanel.setDisplayed(t)),this.setLastVisible())}setResizers(){[this.primaryColsPanel,this.rowGroupDropZonePanel,this.valuesDropZonePanel,this.pivotDropZonePanel].forEach(t=>{if(!t)return;const e=t.getGui();t.toggleResizable(!e.classList.contains("ag-last-column-drop")&&!e.classList.contains("ag-hidden"))})}setLastVisible(){const t=this.getGui();Array.prototype.slice.call(t.querySelectorAll(".ag-column-drop")).forEach(i=>i.classList.remove("ag-last-column-drop"));const n=t.querySelectorAll(".ag-column-drop:not(.ag-hidden)"),o=T._last(n);o&&o.classList.add("ag-last-column-drop"),this.setResizers()}resetChildrenHeight(){const e=this.getGui().children;for(let n=0;n<e.length;n++){const o=e[n];o.style.removeProperty("height"),o.style.removeProperty("flex")}}isRowGroupingModuleLoaded(){return this.gos.assertModuleRegistered(T.ModuleNames.RowGroupingModule,"Row Grouping")}expandColumnGroups(t){this.primaryColsPanel.expandGroups(t)}collapseColumnGroups(t){this.primaryColsPanel.collapseGroups(t)}setColumnLayout(t){this.primaryColsPanel.setColumnLayout(t)}syncLayoutWithGrid(){this.primaryColsPanel.syncLayoutWithGrid()}destroyChildren(){this.childDestroyFuncs.forEach(t=>t()),this.childDestroyFuncs.length=0,T._clearElement(this.getGui())}refresh(t){return this.destroyChildren(),this.init(t),!0}getState(){return{expandedGroupIds:this.primaryColsPanel.getExpandedGroups()}}destroy(){this.destroyChildren(),super.destroy()}},Mv=class extends T.BeanStub{constructor(){super(...arguments),this.beanName="modelItemUtils"}wireBeans(t){this.aggFuncService=t.aggFuncService,this.columnModel=t.columnModel,this.columnApplyStateService=t.columnApplyStateService}selectAllChildren(t,e,n){const o=this.extractAllLeafColumns(t);this.setAllColumns(o,e,n)}setColumn(t,e,n){this.setAllColumns([t],e,n)}setAllColumns(t,e,n){this.columnModel.isPivotMode()?this.setAllPivot(t,e,n):this.setAllVisible(t,e,n)}extractAllLeafColumns(t){const e=[],n=o=>{o.forEach(i=>{i.isPassesFilter()&&(i.isGroup()?n(i.getChildren()):e.push(i.getColumn()))})};return n(t),e}setAllVisible(t,e,n){const o=[];t.forEach(i=>{i.getColDef().lockVisible||i.isVisible()!=e&&o.push({colId:i.getId(),hide:!e})}),o.length>0&&this.columnApplyStateService.applyColumnState({state:o},n)}setAllPivot(t,e,n){this.setAllPivotActive(t,e,n)}setAllPivotActive(t,e,n){const o=[],c=e?d=>{var p;if(!d.isAnyFunctionActive())if(d.isAllowValue()){const h=typeof d.getAggFunc()=="string"?d.getAggFunc():(p=this.aggFuncService)==null?void 0:p.getDefaultAggFunc(d);o.push({colId:d.getId(),aggFunc:h})}else d.isAllowRowGroup()?o.push({colId:d.getId(),rowGroup:!0}):d.isAllowPivot()&&o.push({colId:d.getId(),pivot:!0})}:d=>{(d.isPivotActive()||d.isRowGroupActive()||d.isValueActive())&&o.push({colId:d.getId(),pivot:!1,rowGroup:!1,aggFunc:null})};t.forEach(c),o.length>0&&this.columnApplyStateService.applyColumnState({state:o},n)}updateColumns(t){const{columns:e,visibleState:n,pivotState:o,eventType:i}=t,l=e.map(c=>{const d=c.getColId();if(this.columnModel.isPivotMode()){const p=o==null?void 0:o[d];return{colId:d,pivot:p==null?void 0:p.pivot,rowGroup:p==null?void 0:p.rowGroup,aggFunc:p==null?void 0:p.aggFunc}}else return{colId:d,hide:!(n!=null&&n[d])}});this.columnApplyStateService.applyColumnState({state:l},i)}createPivotState(t){return{pivot:t.isPivotActive(),rowGroup:t.isRowGroupActive(),aggFunc:t.isValueActive()?t.getAggFunc():void 0}}},Gv="32.3.3",Ou=T._defineModule({version:Gv,moduleName:T.ModuleNames.ColumnsToolPanelModule,beans:[Mv],userComponents:[{name:"agColumnsToolPanel",classImp:Ov},{name:"agMenuItem",classImp:Me.AgMenuItemRenderer}],dependantModules:[Me.EnterpriseCoreModule,Nv,hl]});const $v=`.ag-header {
43
+ </div>`}postConstruct(){this.setTemplate(this.createTemplate(),[T.AgToggleButtonSelector]),this.cbPivotMode.setValue(this.columnModel.isPivotMode());const t=this.localeService.getLocaleTextFunc();this.cbPivotMode.setLabel(t("pivotMode","Pivot Mode")),this.addManagedListeners(this.cbPivotMode,{fieldValueChanged:this.onBtPivotMode.bind(this)});const e=this.onPivotModeChanged.bind(this);this.addManagedEventListeners({newColumnsLoaded:e,columnPivotModeChanged:e})}onBtPivotMode(){const t=!!this.cbPivotMode.getValue();t!==this.columnModel.isPivotMode()&&(this.gos.updateGridOptions({options:{pivotMode:t},source:"toolPanelUi"}),this.ctrlsService.getHeaderRowContainerCtrls().forEach(e=>e.refresh()))}onPivotModeChanged(){const t=this.columnModel.isPivotMode();this.cbPivotMode.setValue(t)}},$C=class extends T.Component{constructor(){super('<div class="ag-column-panel"></div>'),this.initialised=!1,this.childDestroyFuncs=[]}setVisible(t){super.setDisplayed(t),t&&!this.initialised&&this.init(this.params)}init(t){const e=this.gos.addGridCommonParams({suppressColumnMove:!1,suppressColumnSelectAll:!1,suppressColumnFilter:!1,suppressColumnExpandAll:!1,contractColumnSelection:!1,suppressPivotMode:!1,suppressRowGroups:!1,suppressValues:!1,suppressPivots:!1,suppressSyncLayoutWithGrid:!1});if(this.params={...e,...t},this.isRowGroupingModuleLoaded()&&!this.params.suppressPivotMode&&(this.pivotModePanel=this.createBean(new Ou),this.childDestroyFuncs.push(()=>this.destroyBean(this.pivotModePanel)),this.appendChild(this.pivotModePanel)),this.primaryColsPanel=this.createBean(new GC),this.childDestroyFuncs.push(()=>this.destroyBean(this.primaryColsPanel)),this.primaryColsPanel.init(!0,this.params,"toolPanelUi"),this.primaryColsPanel.addCssClass("ag-column-panel-column-select"),this.appendChild(this.primaryColsPanel),this.isRowGroupingModuleLoaded()){this.params.suppressRowGroups||(this.rowGroupDropZonePanel=this.createBean(new yl(!1)),this.childDestroyFuncs.push(()=>this.destroyBean(this.rowGroupDropZonePanel)),this.appendChild(this.rowGroupDropZonePanel)),this.params.suppressValues||(this.valuesDropZonePanel=this.createBean(new Ru(!1)),this.childDestroyFuncs.push(()=>this.destroyBean(this.valuesDropZonePanel)),this.appendChild(this.valuesDropZonePanel)),this.params.suppressPivots||(this.pivotDropZonePanel=this.createBean(new gl(!1)),this.childDestroyFuncs.push(()=>this.destroyBean(this.pivotDropZonePanel)),this.appendChild(this.pivotDropZonePanel)),this.setLastVisible();const[n]=this.addManagedEventListeners({columnPivotModeChanged:()=>{this.resetChildrenHeight(),this.setLastVisible()}});this.childDestroyFuncs.push(()=>n())}this.initialised=!0}setPivotModeSectionVisible(t){this.isRowGroupingModuleLoaded()&&(this.pivotModePanel?this.pivotModePanel.setDisplayed(t):t&&(this.pivotModePanel=this.createBean(new Ou),this.getGui().insertBefore(this.pivotModePanel.getGui(),this.getGui().firstChild),this.childDestroyFuncs.push(()=>this.destroyBean(this.pivotModePanel))),this.setLastVisible())}setRowGroupsSectionVisible(t){this.isRowGroupingModuleLoaded()&&(this.rowGroupDropZonePanel?this.rowGroupDropZonePanel.setDisplayed(t):t&&(this.rowGroupDropZonePanel=this.createManagedBean(new yl(!1)),this.appendChild(this.rowGroupDropZonePanel)),this.setLastVisible())}setValuesSectionVisible(t){this.isRowGroupingModuleLoaded()&&(this.valuesDropZonePanel?this.valuesDropZonePanel.setDisplayed(t):t&&(this.valuesDropZonePanel=this.createManagedBean(new Ru(!1)),this.appendChild(this.valuesDropZonePanel)),this.setLastVisible())}setPivotSectionVisible(t){this.isRowGroupingModuleLoaded()&&(this.pivotDropZonePanel?this.pivotDropZonePanel.setDisplayed(t):t&&(this.pivotDropZonePanel=this.createManagedBean(new gl(!1)),this.appendChild(this.pivotDropZonePanel),this.pivotDropZonePanel.setDisplayed(t)),this.setLastVisible())}setResizers(){[this.primaryColsPanel,this.rowGroupDropZonePanel,this.valuesDropZonePanel,this.pivotDropZonePanel].forEach(t=>{if(!t)return;const e=t.getGui();t.toggleResizable(!e.classList.contains("ag-last-column-drop")&&!e.classList.contains("ag-hidden"))})}setLastVisible(){const t=this.getGui();Array.prototype.slice.call(t.querySelectorAll(".ag-column-drop")).forEach(i=>i.classList.remove("ag-last-column-drop"));const n=t.querySelectorAll(".ag-column-drop:not(.ag-hidden)"),o=T._last(n);o&&o.classList.add("ag-last-column-drop"),this.setResizers()}resetChildrenHeight(){const e=this.getGui().children;for(let n=0;n<e.length;n++){const o=e[n];o.style.removeProperty("height"),o.style.removeProperty("flex")}}isRowGroupingModuleLoaded(){return this.gos.assertModuleRegistered(T.ModuleNames.RowGroupingModule,"Row Grouping")}expandColumnGroups(t){this.primaryColsPanel.expandGroups(t)}collapseColumnGroups(t){this.primaryColsPanel.collapseGroups(t)}setColumnLayout(t){this.primaryColsPanel.setColumnLayout(t)}syncLayoutWithGrid(){this.primaryColsPanel.syncLayoutWithGrid()}destroyChildren(){this.childDestroyFuncs.forEach(t=>t()),this.childDestroyFuncs.length=0,T._clearElement(this.getGui())}refresh(t){return this.destroyChildren(),this.init(t),!0}getState(){return{expandedGroupIds:this.primaryColsPanel.getExpandedGroups()}}destroy(){this.destroyChildren(),super.destroy()}},zC=class extends T.BeanStub{constructor(){super(...arguments),this.beanName="modelItemUtils"}wireBeans(t){this.aggFuncService=t.aggFuncService,this.columnModel=t.columnModel,this.columnApplyStateService=t.columnApplyStateService}selectAllChildren(t,e,n){const o=this.extractAllLeafColumns(t);this.setAllColumns(o,e,n)}setColumn(t,e,n){this.setAllColumns([t],e,n)}setAllColumns(t,e,n){this.columnModel.isPivotMode()?this.setAllPivot(t,e,n):this.setAllVisible(t,e,n)}extractAllLeafColumns(t){const e=[],n=o=>{o.forEach(i=>{i.isPassesFilter()&&(i.isGroup()?n(i.getChildren()):e.push(i.getColumn()))})};return n(t),e}setAllVisible(t,e,n){const o=[];t.forEach(i=>{i.getColDef().lockVisible||i.isVisible()!=e&&o.push({colId:i.getId(),hide:!e})}),o.length>0&&this.columnApplyStateService.applyColumnState({state:o},n)}setAllPivot(t,e,n){this.setAllPivotActive(t,e,n)}setAllPivotActive(t,e,n){const o=[],c=e?d=>{var p;if(!d.isAnyFunctionActive())if(d.isAllowValue()){const h=typeof d.getAggFunc()=="string"?d.getAggFunc():(p=this.aggFuncService)==null?void 0:p.getDefaultAggFunc(d);o.push({colId:d.getId(),aggFunc:h})}else d.isAllowRowGroup()?o.push({colId:d.getId(),rowGroup:!0}):d.isAllowPivot()&&o.push({colId:d.getId(),pivot:!0})}:d=>{(d.isPivotActive()||d.isRowGroupActive()||d.isValueActive())&&o.push({colId:d.getId(),pivot:!1,rowGroup:!1,aggFunc:null})};t.forEach(c),o.length>0&&this.columnApplyStateService.applyColumnState({state:o},n)}updateColumns(t){const{columns:e,visibleState:n,pivotState:o,eventType:i}=t,l=e.map(c=>{const d=c.getColId();if(this.columnModel.isPivotMode()){const p=o==null?void 0:o[d];return{colId:d,pivot:p==null?void 0:p.pivot,rowGroup:p==null?void 0:p.rowGroup,aggFunc:p==null?void 0:p.aggFunc}}else return{colId:d,hide:!(n!=null&&n[d])}});this.columnApplyStateService.applyColumnState({state:l},i)}createPivotState(t){return{pivot:t.isPivotActive(),rowGroup:t.isRowGroupActive(),aggFunc:t.isValueActive()?t.getAggFunc():void 0}}},UC="32.3.3",Mu=T._defineModule({version:UC,moduleName:T.ModuleNames.ColumnsToolPanelModule,beans:[zC],userComponents:[{name:"agColumnsToolPanel",classImp:$C},{name:"agMenuItem",classImp:Me.AgMenuItemRenderer}],dependantModules:[Me.EnterpriseCoreModule,BC,fl]});const ZC=`.ag-header {
44
44
  border-bottom: 1px solid var(--border-color-default);
45
- }`;function Mu(){T.ModuleRegistry.registerModules([us.ClientSideRowModelModule,Sg.InfiniteRowModelModule,Wd.ServerSideRowModelModule,Tg.CsvExportModule,jd.ClipboardModule,Hd.RangeSelectionModule,Ng.RichSelectModule,Vg.MenuModule,Ag.ExcelExportModule,hl,Ou]);const t=Jy("AGGRID_LICENSE");t?(Me.LicenseManager.setLicenseKey(t),console.log("AG Grid Activated")):console.log("AG Grid License not found")}const zv=qd.createPart("headerBottomBorder").withCSS($v),Gu=qd.themeQuartz.withParams({headerColumnResizeHandleColor:"transparent",accentColor:"#49cc49",borderColor:"#E1E3EB",cellHorizontalPaddingScale:1,checkboxBorderRadius:"3px",checkboxCheckedBackgroundColor:"#110529",checkboxCheckedBorderColor:"#110529",checkboxIndeterminateBackgroundColor:"#110529",checkboxIndeterminateBorderColor:"#110529",checkboxUncheckedBorderColor:"#CFD1DB",columnBorder:!0,columnHoverColor:"#9BABCC16",fontFamily:"inherit",foregroundColor:"#110529",headerBackgroundColor:"#F7F8FA",headerColumnBorder:!0,headerFontWeight:600,headerRowBorder:!0,headerVerticalPaddingScale:.8,iconButtonHoverColor:"#9BABCC32",iconSize:"16px",menuBackgroundColor:"#FFFFFF",menuBorder:!0,menuTextColor:"#110529",rowHoverColor:"#9BABCC16",rowVerticalPaddingScale:1,selectedRowBackgroundColor:"#63E02424",sidePanelBorder:!1,spacing:"8px",tooltipBackgroundColor:"#110529",tooltipTextColor:"#FFFFFF",wrapperBorderRadius:"6px"}).withPart(zv),$u=Symbol("sdk-vue");function vl(){return r.inject($u)}function Uv(t,e,n={}){let o;Mu();const i=()=>{t.loadBlockState().then(c=>{l.loaded=!0;const d=Zg(c,t,n),p=e(d),h=Object.fromEntries(Object.entries(p.routes).map(([m,y])=>{const b=typeof y=="function"?y():y;return[m,r.markRaw(b)]}));o=Object.assign(d,{...p,getRoute(m){return h[m]}})}).catch(c=>{console.error("load initial state error",c),l.error=c})},l=r.reactive({loaded:!1,error:void 0,useApp(){return Pg(o,"App is not loaded")},install(c){c.provide($u,this),i()}});return l}var Zv=Object.defineProperty,Wv=(t,e,n)=>e in t?Zv(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,jv=(t,e,n)=>Wv(t,e+"",n);function bs(t,e){if(t==null)throw Error("Empty (null | undefined) value");return t}function Hv(t,e,n){const o=Math.min(e,n),i=Math.max(e,n);return t>=o&&t<=i}function qv(t){return new Promise(e=>setTimeout(e,t))}function Kv(t){return t()}function xs(t,e,n){return e>t?e:t>n?n:t}function zu(t,e){return e(t)}function gr(t,e){if(t!=null)return e(t)}function Yv(t){if(t&&t.ok)return t.value}async function Xv(t){return Object.fromEntries(await Promise.all(Object.entries(t).map(async([e,n])=>[e,await n])))}const Uu=t=>t;function Jv(t,e){return t=Math.ceil(t),e=Math.floor(e),Math.floor(Math.random()*(e-t))+t}function Qv(t,e=[]){for(t=t?String(t):"";e.includes(t.charAt(0));)t=t.substring(1);return t}function eC(t){let e="";for(let n=0;n<t;n++)e+=String.fromCharCode(Jv(65,91));return e}function Zu(){return eC(42)}const Cl=Array.isArray;function mi(t){return t!==null&&typeof t=="object"}function wl(t){if(typeof t!="object"||t===null)return!1;const e=Object.getPrototypeOf(t);return e===null||e===Object.prototype||Object.getPrototypeOf(e)===null}function tC(t,e){return Object.keys(t).map(n=>e(t[n],n))}function gi(t,e){return mi(t)&&mi(e)?Object.keys(t).length!==Object.keys(e).length?!1:Object.keys(t).every(n=>gi(t[n],e[n])):t===e}function yi(t){if(Array.isArray(t)){const e=[];for(let n=0;n<t.length;n++)e[n]=yi(t[n]);return e}else if(mi(t)){const e={};return Object.keys(t).forEach(n=>{e[n]=yi(t[n])}),e}else return t}function nC(t){return Array.isArray(t)?Object.assign([],t):mi(t)?Object.assign({},t):t}function rC(t,e){const n={};for(const o in e)e[o]!==t[o]&&(n[o]=t[o]);return n}function oC(t){return Object.entries(t).forEach(([e,n])=>{n instanceof Function&&(t[e]=n.bind(t))}),t}function iC(t,e,n){return t[e]=n,t}function sC(t,e){return t[e]}function aC(t,e){t={...t};const n=t[e];return delete t[e],[n,t]}function lC(t,...e){return Object.assign({},...e.map(n=>({[n]:t[n]})))}function cC(t,...e){return e.map(n=>t[n])}function dC(t,...e){const n=Object.assign({},t);return e.forEach(o=>delete n[o]),n}function Wu(t,e){return new Set([...Object.keys(t),...Object.keys(e)]).forEach(n=>{const o=t[n],i=e[n];wl(o)&&wl(i)||Cl(o)&&Cl(i)&&o.length===i.length?Wu(o,i):t[n]=i}),t}const bl=Object.freeze(Object.defineProperty({__proto__:null,bindMethods:oC,deepClone:yi,deepEqual:gi,deepPatch:Wu,getProp:sC,isArray:Cl,isObject:mi,isPlainObject:wl,map:tC,omit:dC,pick:lC,pickValues:cC,setProp:iC,shallowClone:nC,shallowDiff:rC,shiftProp:aC},Symbol.toStringTag,{value:"Module"}));function uC(t,e){const n=t.findIndex(e);if(n<0)return[];const o=(()=>{for(let i=n;i<t.length;i++)if(!e(t[i],i))return i;return t.length})();return t.slice(n,o)}function pC(t,e,n){let o;return function(...i){o&&clearTimeout(o),o=setTimeout(()=>{o=void 0,t.apply(this,i)},e)}}const hC=["B","kB","MB","GB","TB","PB","EB","ZB","YB"],fC=["B","kiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],mC=["b","kbit","Mbit","Gbit","Tbit","Pbit","Ebit","Zbit","Ybit"],gC=["b","kibit","Mibit","Gibit","Tibit","Pibit","Eibit","Zibit","Yibit"],ju=(t,e)=>{let n=String(t);return typeof e=="string"||Array.isArray(e)?n=t.toLocaleString(e):e===!0&&(n=t.toLocaleString(void 0)),n};function xl(t,e){if(t=typeof t=="bigint"?Number(t):t,!Number.isFinite(t))throw new TypeError(`Expected a finite number, got ${typeof t}: ${t}`);Object.assign(e,{bits:!1,binary:!1});const n=e.bits?e.binary?gC:mC:e.binary?fC:hC;if(e.signed&&t===0)return` 0 ${n[0]}`;const o=t<0,i=o?"-":e.signed?"+":"";if(o&&(t=-t),t<1){const p=ju(t,e.locale);return i+p+" "+n[0]}const l=Math.min(Math.floor(e.binary?Math.log(t)/Math.log(1024):Math.log10(t)/3),n.length-1);t/=(e.binary?1024:1e3)**l,t=Number(t.toPrecision(3));const c=ju(Number(t),e.locale),d=n[l];return i+c+" "+d}const yC={class:"context-menu"},_C=["onClick"],vC=r.defineComponent({__name:"Menu",props:{options:{}},emits:["close"],setup(t,{emit:e}){const n=e,o=i=>{i.cb(),n("close")};return(i,l)=>(r.openBlock(),r.createElementBlock("div",yC,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(i.options,(c,d)=>(r.openBlock(),r.createElementBlock("div",{key:d,onClick:r.withModifiers(p=>o(c),["stop"])},[r.createElementVNode("span",null,r.toDisplayString(c.text),1)],8,_C))),128))]))}}),Ot=(t,e)=>{const n=t.__vccOpts||t;for(const[o,i]of e)n[o]=i;return n},CC=Ot(vC,[["__scopeId","data-v-12530966"]]);function kl(t,e){t.preventDefault();const n=()=>{r.render(null,document.body)},o=r.h(CC,{options:e,onClose:()=>{n()}});r.render(o,document.body);const i=o.el;return i.style.top=t.clientY+"px",i.style.left=t.clientX+"px",document.addEventListener("click",l=>{i.contains(l.target)||n()}),n}const Hu=Symbol(),ks=()=>r.inject(Hu),wC=["value"],bC={key:1},xC=r.defineComponent({__name:"BaseCellComponent",props:{modelValue:{},valueType:{},editable:{type:Boolean}},emits:["update:modelValue"],setup(t,{emit:e}){const n=e,o=t,i=r.reactive({edit:!1}),l=r.computed(()=>o.valueType),c=h=>{var m;let y=(m=h.target)==null?void 0:m.value;const b=r.unref(l),w=Kv(()=>b==="integer"?parseInt(y,10):b==="float"?Number(y):y);n("update:modelValue",w),i.edit=!1},d=r.ref(),p=h=>{!h.metaKey&&o.editable&&(i.edit=!0,requestAnimationFrame(()=>{var m,y;(y=(m=d.value)==null?void 0:m.querySelector("input"))==null||y.focus()}))};return(h,m)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"baseRef",ref:d,class:r.normalizeClass(["base-cell",{"base-cell__edit":i.edit}]),onClick:p},[i.edit?(r.openBlock(),r.createElementBlock("input",{key:0,value:h.modelValue,onFocusout:m[0]||(m[0]=y=>i.edit=!1),onChange:c},null,40,wC)):(r.openBlock(),r.createElementBlock("div",bC,r.toDisplayString(h.modelValue),1))],2))}}),kC=["^data-row-index"],EC={key:0,class:"control-cell"},SC=r.defineComponent({__name:"TdCell",props:{cell:{}},setup(t){const e=t,n=ks(),o=r.computed(()=>e.cell.column.valueType),i=h=>{gr(n.settings.value.onUpdatedRow,m=>{const y=e.cell.row,b={...y.dataRow,[e.cell.id]:h};m({...y,dataRow:b})})},l=h=>{h.metaKey&&n.selectRow(e.cell.row.primaryKey)},c=(h,m)=>{if(h.type==="contextmenu")h.preventDefault();else return;const y=n.settings??{},b=[],{onSelectedRows:w,onSelectedColumns:S}=y.value,M=n.data.selectedRows.has(m.primaryKey);w&&w.length&&(M?b.push({text:"Deselect row",cb(){n.data.selectedRows.delete(e.cell.row.primaryKey)}}):b.push({text:"Select row",cb(){n.selectRow(e.cell.row.primaryKey)}})),S&&S.length&&(b.push({text:"Select column",cb(){n.selectColumn(e.cell.column.id)}}),b.push({text:"Unselect column",cb(){n.unselectColumn(e.cell.column.id)}})),b.length&&kl(h,b)},d=r.ref(),p=r.computed(()=>e.cell.column.component?e.cell.column.component():void 0);return(h,m)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"cellRef",ref:d,class:r.normalizeClass(["td-cell",{[h.cell.class]:!0}]),"^data-row-index":h.cell.row.index,onClick:l,onContextmenu:m[0]||(m[0]=y=>c(y,h.cell.row))},[h.cell.control?(r.openBlock(),r.createElementBlock("div",EC,r.toDisplayString(h.cell.row.index),1)):p.value?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(p.value),{key:1,"model-value":h.cell.value,"onUpdate:modelValue":i},null,8,["model-value"])):(r.openBlock(),r.createBlock(xC,{key:2,"model-value":h.cell.value,"value-type":o.value,editable:h.cell.column.editable,"onUpdate:modelValue":i},null,8,["model-value","value-type","editable"]))],42,kC))}}),TC={},NC={width:"48",height:"48",viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function VC(t,e){return r.openBlock(),r.createElementBlock("svg",NC,e[0]||(e[0]=[r.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M24 41.5H9C7.61929 41.5 6.5 40.3807 6.5 39V24H9.5V38.5H24V41.5Z",fill:"#CFD1DB"},null,-1),r.createTextVNode(),r.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M41.5 9C41.5 7.61929 40.3807 6.5 39 6.5H9C7.61929 6.5 6.5 7.61929 6.5 9V19.5H9.5H28.5V38.5V41.5H39C40.3807 41.5 41.5 40.3807 41.5 39V9ZM38.5 9.5V16.5H31.5V9.5H38.5ZM38.5 38.5V19.5H31.5V38.5H38.5ZM9.5 9.5V16.5H28.5V9.5H9.5Z",fill:"#CFD1DB"},null,-1)]))}const AC=Ot(TC,[["render",VC]]),BC={class:"tr-head"},PC=r.defineComponent({__name:"TrHead",setup(t){return(e,n)=>(r.openBlock(),r.createElementBlock("div",BC,[r.renderSlot(e.$slots,"default")]))}});function RC(t,e){const n=e.indexOf(t)+1;return e[n>=e.length?0:n]}function DC(t,e){const n=t.findIndex(e);if(n<0)return[];const o=(()=>{for(let i=n;i<t.length;i++)if(!e(t[i],i))return i;return t.length})();return t.slice(n,o)}const IC=["^data-col-id"],FC=r.defineComponent({__name:"ThCell",props:{col:{}},emits:["delete:column","expand:column","change:sort"],setup(t,{emit:e}){const n=e;function o(l){l.preventDefault();const c=[];c.length&&kl(l,c)}function i(l){var c;const d=((c=l.sort)==null?void 0:c.direction)??"DESC";n("change:sort",{colId:l.id,direction:RC(d,["DESC","ASC"])})}return(l,c)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["cell th-cell",{"justify-center":l.col.justify,frozen:l.col.frozen}]),"^data-col-id":l.col.id,onContextmenu:o},[l.col.valueType?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(l.col.valueType)},null,2)):r.createCommentVNode("",!0),r.createTextVNode(" "+r.toDisplayString(l.col.label)+" ",1),l.col.sort?(r.openBlock(),r.createElementBlock("div",{key:1,class:r.normalizeClass(["sort",l.col.sort.direction]),onClick:c[0]||(c[0]=r.withModifiers(()=>i(l.col),["stop"]))},null,2)):r.createCommentVNode("",!0)],42,IC))}}),LC=r.defineComponent({__name:"TrBody",props:{row:{}},setup(t){const e=r.ref(),n=()=>{r.nextTick().then(()=>{gr(e.value,o=>o.scrollLeft=0)})};return(o,i)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"trRef",ref:e,class:r.normalizeClass(["tr-body",{selected:o.row.selected}]),scroll:"no",style:r.normalizeStyle(o.row.style),onScroll:n},[r.renderSlot(o.$slots,"default")],38))}}),OC=r.defineComponent({__name:"ColumnCaret",props:{column:{}},setup(t){const e=ks(),n=t,o=r.computed(()=>e.data.selectedColumns.has(n.column.id));return(i,l)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["column-caret",{selected:o.value,frozen:i.column.frozen}])},null,2))}});function st(t,e,n,o){r.onMounted(()=>{var i;return(i=r.unref(t))==null?void 0:i.addEventListener(e,n,o)}),r.onUnmounted(()=>{var i;return(i=r.unref(t))==null?void 0:i.removeEventListener(e,n,o)})}function MC(t){r.onMounted(()=>window.addEventListener("mouseup",t)),r.onUnmounted(()=>window.removeEventListener("mouseup",t))}function GC(t){let e=!1;return function(...n){e?console.log("handle pressure"):(requestAnimationFrame(()=>{t(...n),e=!1}),e=!0)}}function $C(t,e){let n;function o(l){n={...l}}MC(()=>{n=void 0,e()});const i=GC(t);return st(window,"mousemove",l=>{n&&i({x:n.x,width:n.width,diff:l.x-n.x})}),{start:o}}const yo=1,zC=10,UC=30,qu=60;function Ku(){const t=r.reactive({x:0,y:0});function e(n){t.x=n.pageX,t.y=n.pageY}return r.onMounted(()=>window.addEventListener("mousemove",e)),r.onUnmounted(()=>window.removeEventListener("mousemove",e)),t}function Yu(t,e={}){const{delayEnter:n=0,delayLeave:o=0}=e,i=r.ref(!1);let l;const c=d=>{const p=d?n:o;l&&(clearTimeout(l),l=void 0),p?l=setTimeout(()=>i.value=d,p):i.value=d};return window&&(st(t,"mouseenter",()=>c(!0)),st(t,"mouseleave",()=>c(!1))),i}function ZC(t){var e;const n=gr((e=r.unref(t))==null?void 0:e.querySelectorAll(".th-cell"),o=>[...o])??[];return n.map(o=>{const{width:i,x:l}=o.getBoundingClientRect(),c=o.getAttribute("data-col-id");return Uu({colId:c,width:i,x:l,right:l+i})}).slice(0,n.length-1)}function WC(t,e){const n=Ku(),o=Yu(e,{}),{data:i}=t,l=$C(d=>{gr(i.resizeTh,p=>{const h=i.columns.find(m=>m.id===p.colId);h&&(h.width=xs(d.width+d.diff,UC,1e4),t.adjustWidth())})},()=>{i.resize=!1,i.resizeTh=void 0,document.body.style.cursor=""}),c=d=>{i.resizeTh&&(i.resize=!0,l.start({x:d.x,width:i.resizeTh.width}))};return r.watchEffect(()=>{if(!o.value){document.body.style.cursor="";return}if(i.resize)return;const d=ZC(e).find(p=>Math.abs(n.x-p.right)<zC);d?(document.body.style.cursor="col-resize",i.resizeTh=d):(i.resizeTh=void 0,document.body.style.cursor="")}),{mouseDown:c}}const jC={key:0,class:"command-menu"},HC={key:0},qC=["onClick"],KC=r.defineComponent({__name:"RowsCommandMenu",setup(t){const e=ks(),n=r.computed(()=>e.getSelectedRows()),o=r.computed(()=>n.value.length>0),i=r.computed(()=>{var c;return((c=e.settings)==null?void 0:c.value.onSelectedRows)??[]}),l=r.computed(()=>i.value.map(c=>({label:c.label,cb:()=>{c.cb(n.value),e.data.selectedRows.clear(),e.data.rows=[]}})));return(c,d)=>o.value?(r.openBlock(),r.createElementBlock("div",jC,[n.value.length?(r.openBlock(),r.createElementBlock("span",HC,r.toDisplayString(n.value.length)+" rows selected",1)):r.createCommentVNode("",!0),d[0]||(d[0]=r.createTextVNode()),d[1]||(d[1]=r.createElementVNode("hr",null,null,-1)),d[2]||(d[2]=r.createTextVNode()),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(l.value,(p,h)=>(r.openBlock(),r.createElementBlock("span",{key:h,class:"command",onClick:r.withModifiers(p.cb,["stop"])},r.toDisplayString(p.label),9,qC))),128))])):r.createCommentVNode("",!0)}}),YC={key:0,class:"command-menu"},XC={key:0},JC=["onClick"],QC=r.defineComponent({__name:"ColumnsCommandMenu",setup(t){const e=ks(),n=r.computed(()=>e.getSelectedColumns()),o=r.computed(()=>n.value.length>0),i=r.computed(()=>{var c;return((c=e.settings)==null?void 0:c.value.onSelectedColumns)??[]}),l=r.computed(()=>i.value.map(c=>({label:c.label,cb:()=>{c.cb(n.value),e.data.selectedColumns.clear()}})));return(c,d)=>o.value?(r.openBlock(),r.createElementBlock("div",YC,[n.value.length?(r.openBlock(),r.createElementBlock("span",XC,"selected columns "+r.toDisplayString(n.value.length),1)):r.createCommentVNode("",!0),d[0]||(d[0]=r.createTextVNode()),d[1]||(d[1]=r.createElementVNode("hr",null,null,-1)),d[2]||(d[2]=r.createTextVNode()),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(l.value,(p,h)=>(r.openBlock(),r.createElementBlock("span",{key:h,class:"command",onClick:r.withModifiers(p.cb,["stop"])},r.toDisplayString(p.label),9,JC))),128))])):r.createCommentVNode("",!0)}});function yr(t,e){const n={el:void 0,x:0,y:0},o=i=>({x:i.x,y:i.y,dx:i.x-n.x,dy:i.y-n.y});st(document,"mousedown",i=>{i.target===r.unref(t)&&(i.stopPropagation&&i.stopPropagation(),i.preventDefault&&i.preventDefault(),n.el=r.unref(t),n.x=i.x,n.y=i.y)}),st(document,"mouseup",i=>{n.el&&(n.el=void 0,e({...o(i),stop:!0},n))}),st(document,"mousemove",i=>{n.el&&e(o(i),n)})}const e0=r.defineComponent({__name:"TScroll",props:{offset:{},windowSize:{},dataSize:{}},emits:["change:offset"],setup(t,{emit:e}){const n=e,o=t,i=r.ref(),l=r.computed(()=>o.windowSize-12),c=r.computed(()=>o.windowSize<o.dataSize),d=r.computed(()=>Math.ceil(o.offset*(l.value/o.dataSize))),p=r.computed(()=>Math.ceil(l.value*l.value/o.dataSize)),h=r.computed(()=>({top:`${d.value}px`,height:`${p.value}px`}));return yr(i,(m,y)=>{const b=(d.value+m.dy)*o.dataSize/l.value;n("change:offset",b),y.x=m.x,y.y=m.y}),(m,y)=>(r.openBlock(),r.createElementBlock("div",{class:"t-scroll",style:r.normalizeStyle({height:`${m.windowSize}px`})},[r.createElementVNode("div",null,[c.value?(r.openBlock(),r.createElementBlock("div",{key:0,ref_key:"handleRef",ref:i,class:"t-scroll__handle",style:r.normalizeStyle(h.value)},null,4)):r.createCommentVNode("",!0)])],4))}});function t0(t){return r.computed(()=>{const{data:e,settings:n}=t,{bodyWidth:o,scrollLeft:i}=e,l=[...e.columns],c=Zu();n.value.controlColumn&&l.unshift({id:c,label:"#",width:60,frozen:!0});let d=0;const p=l.map(m=>{const y={...m,offset:d};return d+=m.width+yo,y}),h=p.filter(m=>m.frozen);return uC(p,m=>m.frozen?!1:i<m.offset+m.width&&m.offset<o+i).concat(h).map(m=>({...m,style:{left:m.frozen?`${m.offset}px`:`${m.offset-e.scrollLeft}px`,width:`${m.width}px`},control:m.id===c}))})}function n0(t,e){const n=r.computed(()=>e.value.reduce((o,i)=>(o[i.id]=i.justify?"justify-"+i.justify:"",o),{}));return r.computed(()=>t.rows.map(o=>{const i=n.value,{primaryKey:l,offset:c,dataRow:d,height:p}=o,h=e.value.map(m=>({id:m.id,column:m,row:o,value:d[m.id],class:i[m.id],editable:m.editable,width:m.width,style:m.style,control:m.control}));return Uu({style:{top:`${c-t.scrollTop}px`,height:`${o.height}px`},primaryKey:l,offset:c,height:p,cells:h,selected:t.selectedRows.has(l)})}))}const r0=async(t,e)=>{const{scrollTop:n,bodyHeight:o}=t;return await qv(0),Xv({rows:e.getRows(n,o),dataWindow:t})};function o0(t){const e=r.reactive({rowIndex:-1,columns:[],pendingLoads:0,currentWindow:void 0,rows:[],resize:!1,resizeTh:void 0,dataHeight:0,bodyHeight:t.settings.height,bodyWidth:0,scrollTop:0,scrollLeft:0,selectedRows:new Set,selectedColumns:new Set});r.watch(()=>t.settings,m=>{e.columns=yi(m.columns),e.currentWindow=void 0,m.dataSource.getHeight().then(y=>{e.dataHeight=y,h.updateBodyHeight()}).catch(y=>e.error=y)},{immediate:!0});const n=r.computed(()=>t.settings),o=r.computed(()=>e.columns.reduce((m,y)=>m+y.width+yo,0)),i=r.computed(()=>zu(h.data.dataHeight-h.data.bodyHeight,m=>m>0?m:0)),l=r.computed(()=>zu(o.value-h.data.bodyWidth,m=>m>0?m:0)),c=r.computed(()=>({bodyHeight:e.bodyHeight,scrollTop:e.scrollTop,current:e.currentWindow})),d=t0({data:e,settings:n}),p=n0(e,d),h={data:e,settings:n,tableColumns:d,tableRows:p,adjustWidth:()=>{const m=e.columns.reduce((b,w)=>b+w.width+yo,0),y=e.bodyWidth+e.scrollLeft;if(m<y){const b=e.columns[e.columns.length-1];b.width=b.width+(y-m)}},updateOffsets(m){this.updateScrollTop(e.scrollTop+m.deltaY),this.updateScrollLeft(e.scrollLeft+m.deltaX)},getSelectedRows(){return e.rows.filter(m=>e.selectedRows.has(m.primaryKey))},getSelectedColumns(){return e.columns.filter(m=>e.selectedColumns.has(m.id))},selectRow(m){e.selectedRows.add(m)},unselectRow(m){e.selectedRows.delete(m)},selectColumn(m){e.selectedColumns.add(m)},unselectColumn(m){e.selectedColumns.delete(m)},updateScrollTop(m){e.scrollTop=xs(m,0,i.value)},updateScrollLeft(m){e.scrollLeft=xs(m,0,l.value)},updateBodyHeight(){const{height:m}=t.settings,{dataHeight:y}=e,b=m>y?y:m;e.bodyHeight=b},updateDimensions(m){this.updateBodyHeight(),h.data.bodyWidth=m.width,h.adjustWidth(),e.rows=[],e.currentWindow=void 0}};return r.watch(c,(m,y)=>{const b=m.current;(!b||m.scrollTop<b.scrollTop||m.scrollTop+m.bodyHeight>b.bodyHeight+b.scrollTop)&&(e.currentWindow={scrollTop:m.scrollTop-qu,bodyHeight:m.bodyHeight+qu*2},r0(yi(e.currentWindow),n.value.dataSource).then(({rows:w,dataWindow:S})=>{gi(e.currentWindow,S)&&(e.rows=w)}))},{deep:!0,immediate:!0}),r.provide(Hu,h),h}const i0={class:"command-menu__container"},s0={key:0,class:"table-body__no-data"},a0={class:"carets"},El=r.defineComponent({__name:"TableComponent",props:{settings:{}},emits:["update:data","change:sort"],setup(t,{emit:e}){const n=e,o=t,i=o0(o),l=r.computed(()=>i.data.rows.length===0),c=r.computed(()=>({height:l.value?"212px":i.data.bodyHeight+"px"}));r.watch(i.data,M=>n("update:data",M),{deep:!0}),r.watch(o,()=>m);const d=r.ref(),p=r.ref(),h=r.ref(),m=()=>{gr(h.value,M=>{i.updateDimensions(M.getBoundingClientRect())})},y=i.tableColumns,b=i.tableRows,{mouseDown:w}=WC(i,d);r.onMounted(()=>{r.nextTick(m)}),r.watchPostEffect(()=>{r.unref(o.settings),r.nextTick(m)}),st(window,"resize",()=>r.nextTick(m));const S=M=>{M.preventDefault(),i.updateOffsets(M)};return(M,O)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"tableRef",ref:d,class:"data-table",onMousedown:O[2]||(O[2]=(...C)=>r.unref(w)&&r.unref(w)(...C))},[r.createElementVNode("div",i0,[r.createVNode(KC),O[3]||(O[3]=r.createTextVNode()),r.createVNode(QC)]),O[7]||(O[7]=r.createTextVNode()),r.createElementVNode("div",{ref_key:"headRef",ref:p,class:"table-head"},[r.createVNode(PC,null,{default:r.withCtx(()=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(y),(C,I)=>(r.openBlock(),r.createBlock(FC,{key:I,col:C,style:r.normalizeStyle(C.style),"onChange:sort":O[0]||(O[0]=F=>M.$emit("change:sort",F))},null,8,["col","style"]))),128))]),_:1})],512),O[8]||(O[8]=r.createTextVNode()),r.createElementVNode("div",{ref_key:"bodyRef",ref:h,class:"table-body",style:r.normalizeStyle(c.value),onWheel:S},[l.value?(r.openBlock(),r.createElementBlock("div",s0,[r.createElementVNode("div",null,[r.createVNode(AC),O[4]||(O[4]=r.createTextVNode()),O[5]||(O[5]=r.createElementVNode("div",null,"No Data To Show",-1))])])):r.createCommentVNode("",!0),O[6]||(O[6]=r.createTextVNode()),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(b),(C,I)=>(r.openBlock(),r.createBlock(LC,{key:I,row:C},{default:r.withCtx(()=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(C.cells,F=>(r.openBlock(),r.createBlock(SC,{key:F.column.id+":"+I,cell:F,style:r.normalizeStyle(F.style)},null,8,["cell","style"]))),128))]),_:2},1032,["row"]))),128))],36),O[9]||(O[9]=r.createTextVNode()),r.createElementVNode("div",a0,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(y),(C,I)=>(r.openBlock(),r.createBlock(OC,{key:I,column:C,style:r.normalizeStyle(C.style),"onChange:sort":O[1]||(O[1]=F=>M.$emit("change:sort",F))},null,8,["column","style"]))),128))]),O[10]||(O[10]=r.createTextVNode()),r.createVNode(e0,{offset:r.unref(i).data.scrollTop,"window-size":r.unref(i).data.bodyHeight,"data-size":r.unref(i).data.dataHeight,"onChange:offset":r.unref(i).updateScrollTop},null,8,["offset","window-size","data-size","onChange:offset"])],544))}}),Xu=new WeakMap;class l0{constructor(e,n,o){jv(this,"dataHeight"),this.datum=e,this.resolveHeight=n,this.resolvePrimaryKey=o;const i=e.reduce((c,d,p)=>(c.indices.set(p,c.total),c.total+=this.resolveHeight(d,p)+yo,c),{total:0,indices:new Map});this.dataHeight=i.total;const l=e.map((c,d)=>({dataRow:c,index:d,primaryKey:this.resolvePrimaryKey(c,d),offset:bs(i.indices.get(d)),height:this.resolveHeight(c,d)}));Xu.set(this,l)}get rows(){return Xu.get(this)}async getHeight(){return this.dataHeight}async getRows(e,n){return DC(this.rows,o=>{const i=o.offset;return e<i+o.height&&i<n+e})}}class c0{constructor(e,n,o){this.api=e,this.rowHeight=n,this.resolvePrimaryKey=o}get height(){return this.rowHeight+yo}async getHeight(){return await this.api.count()*this.height}async getRows(e,n){const o=xs(Math.floor(e/this.height),0,Number.POSITIVE_INFINITY),i=Math.ceil(n+40/this.height);return(await this.api.query({offset:o,limit:i})).map((l,c)=>({dataRow:l,index:o+c,primaryKey:this.resolvePrimaryKey(l,o+c),offset:(o+c)*(this.rowHeight+yo),height:this.rowHeight}))}}function d0(t){return Object.freeze(t)}function u0(t){return r.h(El,{settings:Object.freeze(t)})}function Sl(t,e){const n=new l0(t,e.resolveRowHeight,e.resolvePrimaryKey);return{...e,dataSource:n}}function p0(t,e){return r.computed(()=>{const n=r.unref(t);return Sl(n,r.unref(e))})}function h0(t,e){const n=r.computed(()=>{const i=r.unref(t);return Sl(i,r.unref(e))}),o=r.reactive({settings:n});return r.computed(()=>r.h(El,o))}const f0=Object.freeze(Object.defineProperty({__proto__:null,AsyncData:c0,Component:El,factory:u0,rawDataSettings:Sl,settings:d0,useRawData:p0,useRawDataComponent:h0},Symbol.toStringTag,{value:"Module"}));function*m0(t,e){for(const n of t)yield e(n)}function g0(t){const e=[];for(const n of t)e.push(n);return e}function Ju(t){return t()}function Tl(t,e){if(t==null)throw Error(e);return t}function Nl(t){let e=!1;return function(...n){e||(requestAnimationFrame(()=>{t(...n),e=!1}),e=!0)}}function Qu(t){return new Promise(e=>setTimeout(e,t))}function ep(t,e){const n=setTimeout(t,e);return()=>{clearTimeout(n)}}function tp(t,e){return t=Math.ceil(t),e=Math.floor(e),Math.floor(Math.random()*(e-t))+t}function y0(t){let e="";for(let n=0;n<t;n++)e+=String.fromCharCode(tp(65,91));return e}function np(t){return function(e){return 1-t(1-e)}}function _0(t){return function(e){return e<.5?t(2*e)/2:(2-t(2*(1-e)))/2}}function rp(t){const{duration:e,draw:n,timing:o}=t,i=performance.now();let l=!1;return requestAnimationFrame(function c(d){let p=(d-i)/e;(p>1||l)&&(p=1);const h=o(p);n(h),p<1&&requestAnimationFrame(c)}),function(){l=!0}}function v0(t){const{getFraction:e,draw:n,timing:o}=t,i=performance.now();let l=!1;return requestAnimationFrame(function c(d){let p=e(d-i);if(l)return;p>1&&(p=1);const h=o(p);n(h),p<1&&requestAnimationFrame(c)}),function(){l=!0}}function op(t,e){let n=-1;return(...o)=>{n!==-1&&(clearTimeout(n),n=-1),n=window.setTimeout(()=>t(...o),e)}}function ip(t,e,n=!0){let o=0,i;return function(...l){i=()=>{t.apply(this,l),o=new Date().getTime()+e,i=null,n&&setTimeout(()=>{i&&i()},e)},new Date().getTime()>o&&i()}}function C0(t){return t.map(e=>({text:String(e),value:e}))}function _r(t){return t.map(e=>({label:"label"in e?e.label:e.text,value:e.value,description:e.description}))}const Vl=new Map;function w0(t){return Vl.has(t)||Vl.set(t,r.ref(localStorage.getItem(t))),Tl(Vl.get(t),"...")}function b0(t,e){e==null?localStorage.removeItem(t):localStorage.setItem(t,e)}function sp(t){const e=w0(t);return r.watch(e,n=>b0(t,n)),e}const Al=new Set;window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",t=>{g0(m0(Al.values(),e=>e(t.matches?"dark":"light")))});const x0=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",ap=r.ref(x0),Bl=sp("theme");function lp(t){const e=r.computed(()=>Bl.value?Bl.value:ap.value),n=i=>{ap.value=i,t&&t(i)};function o(){Bl.value=e.value==="light"?"dark":(e.value,"light")}return r.watch(e,i=>{t&&t(r.unref(i))}),r.onMounted(()=>{Al.add(n)}),r.onUnmounted(()=>{Al.delete(n)}),[e,o]}const k0=r.defineComponent({__name:"ThemeSwitcher",setup(t){const[e,n]=lp();return(o,i)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["ui-theme-switcher",r.unref(e)]),onClick:i[0]||(i[0]=(...l)=>r.unref(n)&&r.unref(n)(...l))},i[1]||(i[1]=[r.createElementVNode("div",null,null,-1)]),2))}}),E0={key:0,class:"pl-block-page__title"},S0={class:"pl-block-page__title__default"},T0={class:"pl-block-page__title__append"},N0={key:1},V0={class:"pl-block-page__body"},A0={name:"PlBlockPage"},B0=r.defineComponent({...A0,props:{noBodyGutters:{type:Boolean}},setup(t){const e=r.useSlots();return(n,o)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["pl-layout-component pl-block-page",{noBodyGutters:n.noBodyGutters}])},[r.unref(e).title?(r.openBlock(),r.createElementBlock("div",E0,[r.createElementVNode("div",S0,[r.renderSlot(n.$slots,"title")]),o[0]||(o[0]=r.createTextVNode()),r.createElementVNode("div",T0,[r.renderSlot(n.$slots,"append")])])):(r.openBlock(),r.createElementBlock("div",N0)),o[1]||(o[1]=r.createTextVNode()),r.createElementVNode("div",V0,[r.renderSlot(n.$slots,"default")])],2))}}),P0={name:"PlContainer"},R0=r.defineComponent({...P0,props:{width:{}},setup(t){const e=t,n=r.computed(()=>({width:e.width}));return(o,i)=>(r.openBlock(),r.createElementBlock("div",{class:"pl-container pl-layout-component",style:r.normalizeStyle(n.value)},[r.renderSlot(o.$slots,"default")],4))}}),D0={name:"PlRow"},I0=r.defineComponent({...D0,props:{wrap:{type:Boolean},alignCenter:{type:Boolean},noGap:{type:Boolean}},setup(t){return(e,n)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["pl-layout-component pl-row",{wrap:e.wrap,"align-center":e.alignCenter}])},[r.renderSlot(e.$slots,"default")],2))}}),F0={class:"pl-layout-component",style:{"flex-grow":"1"}},L0={name:"PlSpacer"},cp=r.defineComponent({...L0,setup(t){return(e,n)=>(r.openBlock(),r.createElementBlock("div",F0))}}),O0={name:"PlGrid"},M0=r.defineComponent({...O0,props:{columns:{}},setup(t){const e=t,n=r.computed(()=>({gridTemplateColumns:`repeat(${e.columns}, minmax(0, 1fr))`}));return(o,i)=>(r.openBlock(),r.createElementBlock("div",{class:"pl-layout-component pl-grid",style:r.normalizeStyle(n.value)},[r.renderSlot(o.$slots,"default")],4))}}),G0={key:0,class:"pl-alert__icon"},$0={class:"pl-alert__main"},z0={key:0},U0={class:"pl-alert__main__text"},Z0={name:"PlAlert"},W0=r.defineComponent({...Z0,props:{modelValue:{type:Boolean,default:!0},type:{default:void 0},label:{default:void 0},icon:{type:Boolean,default:void 0},closeable:{type:Boolean,default:void 0},monospace:{type:Boolean,default:void 0},whiteSpacePre:{type:Boolean,default:void 0},maxHeight:{default:void 0}},emits:["update:modelValue"],setup(t){const e={success:"success",warn:"warning",info:"edit",error:"error"};return(n,o)=>n.modelValue?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(["pl-alert",[{monospace:n.monospace,whiteSpacePre:n.whiteSpacePre},n.type?`pl-alert__${n.type}`:""]]),style:r.normalizeStyle({maxHeight:n.maxHeight})},[n.icon&&n.type?(r.openBlock(),r.createElementBlock("div",G0,[r.createElementVNode("div",{class:r.normalizeClass(`icon-24 icon-${e[n.type]}`)},null,2)])):r.createCommentVNode("",!0),o[2]||(o[2]=r.createTextVNode()),r.createElementVNode("div",$0,[n.label?(r.openBlock(),r.createElementBlock("label",z0,r.toDisplayString(n.label),1)):r.createCommentVNode("",!0),o[1]||(o[1]=r.createTextVNode()),r.createElementVNode("div",U0,[r.renderSlot(n.$slots,"default")])]),o[3]||(o[3]=r.createTextVNode()),n.closeable?(r.openBlock(),r.createElementBlock("div",{key:1,class:"pl-alert__close-btn","aria-label":"Close alert",role:"button",onClick:o[0]||(o[0]=i=>n.$emit("update:modelValue",!1))})):r.createCommentVNode("",!0)],6)):r.createCommentVNode("",!0)}}),j0=`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
45
+ }`;function Gu(){T.ModuleRegistry.registerModules([ps.ClientSideRowModelModule,Vg.InfiniteRowModelModule,jd.ServerSideRowModelModule,Ag.CsvExportModule,Hd.ClipboardModule,qd.RangeSelectionModule,Bg.RichSelectModule,Pg.MenuModule,Rg.ExcelExportModule,fl,Mu]);const t=t_("AGGRID_LICENSE");t?(Me.LicenseManager.setLicenseKey(t),console.log("AG Grid Activated")):console.log("AG Grid License not found")}const WC=Kd.createPart("headerBottomBorder").withCSS(ZC),$u=Kd.themeQuartz.withParams({headerColumnResizeHandleColor:"transparent",accentColor:"#49cc49",borderColor:"#E1E3EB",cellHorizontalPaddingScale:1,checkboxBorderRadius:"3px",checkboxCheckedBackgroundColor:"#110529",checkboxCheckedBorderColor:"#110529",checkboxIndeterminateBackgroundColor:"#110529",checkboxIndeterminateBorderColor:"#110529",checkboxUncheckedBorderColor:"#CFD1DB",columnBorder:!0,columnHoverColor:"#9BABCC16",fontFamily:"inherit",foregroundColor:"#110529",headerBackgroundColor:"#F7F8FA",headerColumnBorder:!0,headerFontWeight:600,headerRowBorder:!0,headerVerticalPaddingScale:.8,iconButtonHoverColor:"#9BABCC32",iconSize:"16px",menuBackgroundColor:"#FFFFFF",menuBorder:!0,menuTextColor:"#110529",rowHoverColor:"#9BABCC16",rowVerticalPaddingScale:1,selectedRowBackgroundColor:"#63E02424",sidePanelBorder:!1,spacing:"8px",tooltipBackgroundColor:"#110529",tooltipTextColor:"#FFFFFF",wrapperBorderRadius:"6px"}).withPart(WC),zu=Symbol("sdk-vue");function vl(){return r.inject(zu)}function jC(t,e,n={}){let o;Gu();const i=()=>{t.loadBlockState().then(c=>{l.loaded=!0;const d=Hg(c,t,n),p=e(d),h=Object.fromEntries(Object.entries(p.routes).map(([m,y])=>{const b=typeof y=="function"?y():y;return[m,r.markRaw(b)]}));o=Object.assign(d,{...p,getRoute(m){return h[m]}})}).catch(c=>{console.error("load initial state error",c),l.error=c})},l=r.reactive({loaded:!1,error:void 0,useApp(){return Ig(o,"App is not loaded")},install(c){c.provide(zu,this),i()}});return l}var HC=Object.defineProperty,qC=(t,e,n)=>e in t?HC(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,KC=(t,e,n)=>qC(t,e+"",n);function xs(t,e){if(t==null)throw Error("Empty (null | undefined) value");return t}function YC(t,e,n){const o=Math.min(e,n),i=Math.max(e,n);return t>=o&&t<=i}function XC(t){return new Promise(e=>setTimeout(e,t))}function JC(t){return t()}function ks(t,e,n){return e>t?e:t>n?n:t}function Uu(t,e){return e(t)}function gr(t,e){if(t!=null)return e(t)}function QC(t){if(t&&t.ok)return t.value}async function ev(t){return Object.fromEntries(await Promise.all(Object.entries(t).map(async([e,n])=>[e,await n])))}const Zu=t=>t;function tv(t,e){return t=Math.ceil(t),e=Math.floor(e),Math.floor(Math.random()*(e-t))+t}function nv(t,e=[]){for(t=t?String(t):"";e.includes(t.charAt(0));)t=t.substring(1);return t}function rv(t){let e="";for(let n=0;n<t;n++)e+=String.fromCharCode(tv(65,91));return e}function Wu(){return rv(42)}const wl=Array.isArray;function gi(t){return t!==null&&typeof t=="object"}function bl(t){if(typeof t!="object"||t===null)return!1;const e=Object.getPrototypeOf(t);return e===null||e===Object.prototype||Object.getPrototypeOf(e)===null}function ov(t,e){return Object.keys(t).map(n=>e(t[n],n))}function yi(t,e){return gi(t)&&gi(e)?Object.keys(t).length!==Object.keys(e).length?!1:Object.keys(t).every(n=>yi(t[n],e[n])):t===e}function _i(t){if(Array.isArray(t)){const e=[];for(let n=0;n<t.length;n++)e[n]=_i(t[n]);return e}else if(gi(t)){const e={};return Object.keys(t).forEach(n=>{e[n]=_i(t[n])}),e}else return t}function iv(t){return Array.isArray(t)?Object.assign([],t):gi(t)?Object.assign({},t):t}function sv(t,e){const n={};for(const o in e)e[o]!==t[o]&&(n[o]=t[o]);return n}function av(t){return Object.entries(t).forEach(([e,n])=>{n instanceof Function&&(t[e]=n.bind(t))}),t}function lv(t,e,n){return t[e]=n,t}function cv(t,e){return t[e]}function dv(t,e){t={...t};const n=t[e];return delete t[e],[n,t]}function uv(t,...e){return Object.assign({},...e.map(n=>({[n]:t[n]})))}function pv(t,...e){return e.map(n=>t[n])}function hv(t,...e){const n=Object.assign({},t);return e.forEach(o=>delete n[o]),n}function ju(t,e){return new Set([...Object.keys(t),...Object.keys(e)]).forEach(n=>{const o=t[n],i=e[n];bl(o)&&bl(i)||wl(o)&&wl(i)&&o.length===i.length?ju(o,i):t[n]=i}),t}const xl=Object.freeze(Object.defineProperty({__proto__:null,bindMethods:av,deepClone:_i,deepEqual:yi,deepPatch:ju,getProp:cv,isArray:wl,isObject:gi,isPlainObject:bl,map:ov,omit:hv,pick:uv,pickValues:pv,setProp:lv,shallowClone:iv,shallowDiff:sv,shiftProp:dv},Symbol.toStringTag,{value:"Module"}));function fv(t,e){const n=t.findIndex(e);if(n<0)return[];const o=(()=>{for(let i=n;i<t.length;i++)if(!e(t[i],i))return i;return t.length})();return t.slice(n,o)}function mv(t,e,n){let o;return function(...i){o&&clearTimeout(o),o=setTimeout(()=>{o=void 0,t.apply(this,i)},e)}}const gv=["B","kB","MB","GB","TB","PB","EB","ZB","YB"],yv=["B","kiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],_v=["b","kbit","Mbit","Gbit","Tbit","Pbit","Ebit","Zbit","Ybit"],Cv=["b","kibit","Mibit","Gibit","Tibit","Pibit","Eibit","Zibit","Yibit"],Hu=(t,e)=>{let n=String(t);return typeof e=="string"||Array.isArray(e)?n=t.toLocaleString(e):e===!0&&(n=t.toLocaleString(void 0)),n};function kl(t,e){if(t=typeof t=="bigint"?Number(t):t,!Number.isFinite(t))throw new TypeError(`Expected a finite number, got ${typeof t}: ${t}`);Object.assign(e,{bits:!1,binary:!1});const n=e.bits?e.binary?Cv:_v:e.binary?yv:gv;if(e.signed&&t===0)return` 0 ${n[0]}`;const o=t<0,i=o?"-":e.signed?"+":"";if(o&&(t=-t),t<1){const p=Hu(t,e.locale);return i+p+" "+n[0]}const l=Math.min(Math.floor(e.binary?Math.log(t)/Math.log(1024):Math.log10(t)/3),n.length-1);t/=(e.binary?1024:1e3)**l,t=Number(t.toPrecision(3));const c=Hu(Number(t),e.locale),d=n[l];return i+c+" "+d}const vv={class:"context-menu"},wv=["onClick"],bv=r.defineComponent({__name:"Menu",props:{options:{}},emits:["close"],setup(t,{emit:e}){const n=e,o=i=>{i.cb(),n("close")};return(i,l)=>(r.openBlock(),r.createElementBlock("div",vv,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(i.options,(c,d)=>(r.openBlock(),r.createElementBlock("div",{key:d,onClick:r.withModifiers(p=>o(c),["stop"])},[r.createElementVNode("span",null,r.toDisplayString(c.text),1)],8,wv))),128))]))}}),Mt=(t,e)=>{const n=t.__vccOpts||t;for(const[o,i]of e)n[o]=i;return n},xv=Mt(bv,[["__scopeId","data-v-12530966"]]);function El(t,e){t.preventDefault();const n=()=>{r.render(null,document.body)},o=r.h(xv,{options:e,onClose:()=>{n()}});r.render(o,document.body);const i=o.el;return i.style.top=t.clientY+"px",i.style.left=t.clientX+"px",document.addEventListener("click",l=>{i.contains(l.target)||n()}),n}const qu=Symbol(),Es=()=>r.inject(qu),kv=["value"],Ev={key:1},Sv=r.defineComponent({__name:"BaseCellComponent",props:{modelValue:{},valueType:{},editable:{type:Boolean}},emits:["update:modelValue"],setup(t,{emit:e}){const n=e,o=t,i=r.reactive({edit:!1}),l=r.computed(()=>o.valueType),c=h=>{var m;let y=(m=h.target)==null?void 0:m.value;const b=r.unref(l),w=JC(()=>b==="integer"?parseInt(y,10):b==="float"?Number(y):y);n("update:modelValue",w),i.edit=!1},d=r.ref(),p=h=>{!h.metaKey&&o.editable&&(i.edit=!0,requestAnimationFrame(()=>{var m,y;(y=(m=d.value)==null?void 0:m.querySelector("input"))==null||y.focus()}))};return(h,m)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"baseRef",ref:d,class:r.normalizeClass(["base-cell",{"base-cell__edit":i.edit}]),onClick:p},[i.edit?(r.openBlock(),r.createElementBlock("input",{key:0,value:h.modelValue,onFocusout:m[0]||(m[0]=y=>i.edit=!1),onChange:c},null,40,kv)):(r.openBlock(),r.createElementBlock("div",Ev,r.toDisplayString(h.modelValue),1))],2))}}),Tv=["^data-row-index"],Nv={key:0,class:"control-cell"},Vv=r.defineComponent({__name:"TdCell",props:{cell:{}},setup(t){const e=t,n=Es(),o=r.computed(()=>e.cell.column.valueType),i=h=>{gr(n.settings.value.onUpdatedRow,m=>{const y=e.cell.row,b={...y.dataRow,[e.cell.id]:h};m({...y,dataRow:b})})},l=h=>{h.metaKey&&n.selectRow(e.cell.row.primaryKey)},c=(h,m)=>{if(h.type==="contextmenu")h.preventDefault();else return;const y=n.settings??{},b=[],{onSelectedRows:w,onSelectedColumns:S}=y.value,M=n.data.selectedRows.has(m.primaryKey);w&&w.length&&(M?b.push({text:"Deselect row",cb(){n.data.selectedRows.delete(e.cell.row.primaryKey)}}):b.push({text:"Select row",cb(){n.selectRow(e.cell.row.primaryKey)}})),S&&S.length&&(b.push({text:"Select column",cb(){n.selectColumn(e.cell.column.id)}}),b.push({text:"Unselect column",cb(){n.unselectColumn(e.cell.column.id)}})),b.length&&El(h,b)},d=r.ref(),p=r.computed(()=>e.cell.column.component?e.cell.column.component():void 0);return(h,m)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"cellRef",ref:d,class:r.normalizeClass(["td-cell",{[h.cell.class]:!0}]),"^data-row-index":h.cell.row.index,onClick:l,onContextmenu:m[0]||(m[0]=y=>c(y,h.cell.row))},[h.cell.control?(r.openBlock(),r.createElementBlock("div",Nv,r.toDisplayString(h.cell.row.index),1)):p.value?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(p.value),{key:1,"model-value":h.cell.value,"onUpdate:modelValue":i},null,8,["model-value"])):(r.openBlock(),r.createBlock(Sv,{key:2,"model-value":h.cell.value,"value-type":o.value,editable:h.cell.column.editable,"onUpdate:modelValue":i},null,8,["model-value","value-type","editable"]))],42,Tv))}}),Av={},Bv={width:"48",height:"48",viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function Pv(t,e){return r.openBlock(),r.createElementBlock("svg",Bv,e[0]||(e[0]=[r.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M24 41.5H9C7.61929 41.5 6.5 40.3807 6.5 39V24H9.5V38.5H24V41.5Z",fill:"#CFD1DB"},null,-1),r.createTextVNode(),r.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M41.5 9C41.5 7.61929 40.3807 6.5 39 6.5H9C7.61929 6.5 6.5 7.61929 6.5 9V19.5H9.5H28.5V38.5V41.5H39C40.3807 41.5 41.5 40.3807 41.5 39V9ZM38.5 9.5V16.5H31.5V9.5H38.5ZM38.5 38.5V19.5H31.5V38.5H38.5ZM9.5 9.5V16.5H28.5V9.5H9.5Z",fill:"#CFD1DB"},null,-1)]))}const Rv=Mt(Av,[["render",Pv]]),Dv={class:"tr-head"},Iv=r.defineComponent({__name:"TrHead",setup(t){return(e,n)=>(r.openBlock(),r.createElementBlock("div",Dv,[r.renderSlot(e.$slots,"default")]))}});function Fv(t,e){const n=e.indexOf(t)+1;return e[n>=e.length?0:n]}function Lv(t,e){const n=t.findIndex(e);if(n<0)return[];const o=(()=>{for(let i=n;i<t.length;i++)if(!e(t[i],i))return i;return t.length})();return t.slice(n,o)}const Ov=["^data-col-id"],Mv=r.defineComponent({__name:"ThCell",props:{col:{}},emits:["delete:column","expand:column","change:sort"],setup(t,{emit:e}){const n=e;function o(l){l.preventDefault();const c=[];c.length&&El(l,c)}function i(l){var c;const d=((c=l.sort)==null?void 0:c.direction)??"DESC";n("change:sort",{colId:l.id,direction:Fv(d,["DESC","ASC"])})}return(l,c)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["cell th-cell",{"justify-center":l.col.justify,frozen:l.col.frozen}]),"^data-col-id":l.col.id,onContextmenu:o},[l.col.valueType?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(l.col.valueType)},null,2)):r.createCommentVNode("",!0),r.createTextVNode(" "+r.toDisplayString(l.col.label)+" ",1),l.col.sort?(r.openBlock(),r.createElementBlock("div",{key:1,class:r.normalizeClass(["sort",l.col.sort.direction]),onClick:c[0]||(c[0]=r.withModifiers(()=>i(l.col),["stop"]))},null,2)):r.createCommentVNode("",!0)],42,Ov))}}),Gv=r.defineComponent({__name:"TrBody",props:{row:{}},setup(t){const e=r.ref(),n=()=>{r.nextTick().then(()=>{gr(e.value,o=>o.scrollLeft=0)})};return(o,i)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"trRef",ref:e,class:r.normalizeClass(["tr-body",{selected:o.row.selected}]),scroll:"no",style:r.normalizeStyle(o.row.style),onScroll:n},[r.renderSlot(o.$slots,"default")],38))}}),$v=r.defineComponent({__name:"ColumnCaret",props:{column:{}},setup(t){const e=Es(),n=t,o=r.computed(()=>e.data.selectedColumns.has(n.column.id));return(i,l)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["column-caret",{selected:o.value,frozen:i.column.frozen}])},null,2))}});function st(t,e,n,o){r.onMounted(()=>{var i;return(i=r.unref(t))==null?void 0:i.addEventListener(e,n,o)}),r.onUnmounted(()=>{var i;return(i=r.unref(t))==null?void 0:i.removeEventListener(e,n,o)})}function zv(t){r.onMounted(()=>window.addEventListener("mouseup",t)),r.onUnmounted(()=>window.removeEventListener("mouseup",t))}function Uv(t){let e=!1;return function(...n){e?console.log("handle pressure"):(requestAnimationFrame(()=>{t(...n),e=!1}),e=!0)}}function Zv(t,e){let n;function o(l){n={...l}}zv(()=>{n=void 0,e()});const i=Uv(t);return st(window,"mousemove",l=>{n&&i({x:n.x,width:n.width,diff:l.x-n.x})}),{start:o}}const _o=1,Wv=10,jv=30,Ku=60;function Yu(){const t=r.reactive({x:0,y:0});function e(n){t.x=n.pageX,t.y=n.pageY}return r.onMounted(()=>window.addEventListener("mousemove",e)),r.onUnmounted(()=>window.removeEventListener("mousemove",e)),t}function Xu(t,e={}){const{delayEnter:n=0,delayLeave:o=0}=e,i=r.ref(!1);let l;const c=d=>{const p=d?n:o;l&&(clearTimeout(l),l=void 0),p?l=setTimeout(()=>i.value=d,p):i.value=d};return window&&(st(t,"mouseenter",()=>c(!0)),st(t,"mouseleave",()=>c(!1))),i}function Hv(t){var e;const n=gr((e=r.unref(t))==null?void 0:e.querySelectorAll(".th-cell"),o=>[...o])??[];return n.map(o=>{const{width:i,x:l}=o.getBoundingClientRect(),c=o.getAttribute("data-col-id");return Zu({colId:c,width:i,x:l,right:l+i})}).slice(0,n.length-1)}function qv(t,e){const n=Yu(),o=Xu(e,{}),{data:i}=t,l=Zv(d=>{gr(i.resizeTh,p=>{const h=i.columns.find(m=>m.id===p.colId);h&&(h.width=ks(d.width+d.diff,jv,1e4),t.adjustWidth())})},()=>{i.resize=!1,i.resizeTh=void 0,document.body.style.cursor=""}),c=d=>{i.resizeTh&&(i.resize=!0,l.start({x:d.x,width:i.resizeTh.width}))};return r.watchEffect(()=>{if(!o.value){document.body.style.cursor="";return}if(i.resize)return;const d=Hv(e).find(p=>Math.abs(n.x-p.right)<Wv);d?(document.body.style.cursor="col-resize",i.resizeTh=d):(i.resizeTh=void 0,document.body.style.cursor="")}),{mouseDown:c}}const Kv={key:0,class:"command-menu"},Yv={key:0},Xv=["onClick"],Jv=r.defineComponent({__name:"RowsCommandMenu",setup(t){const e=Es(),n=r.computed(()=>e.getSelectedRows()),o=r.computed(()=>n.value.length>0),i=r.computed(()=>{var c;return((c=e.settings)==null?void 0:c.value.onSelectedRows)??[]}),l=r.computed(()=>i.value.map(c=>({label:c.label,cb:()=>{c.cb(n.value),e.data.selectedRows.clear(),e.data.rows=[]}})));return(c,d)=>o.value?(r.openBlock(),r.createElementBlock("div",Kv,[n.value.length?(r.openBlock(),r.createElementBlock("span",Yv,r.toDisplayString(n.value.length)+" rows selected",1)):r.createCommentVNode("",!0),d[0]||(d[0]=r.createTextVNode()),d[1]||(d[1]=r.createElementVNode("hr",null,null,-1)),d[2]||(d[2]=r.createTextVNode()),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(l.value,(p,h)=>(r.openBlock(),r.createElementBlock("span",{key:h,class:"command",onClick:r.withModifiers(p.cb,["stop"])},r.toDisplayString(p.label),9,Xv))),128))])):r.createCommentVNode("",!0)}}),Qv={key:0,class:"command-menu"},e0={key:0},t0=["onClick"],n0=r.defineComponent({__name:"ColumnsCommandMenu",setup(t){const e=Es(),n=r.computed(()=>e.getSelectedColumns()),o=r.computed(()=>n.value.length>0),i=r.computed(()=>{var c;return((c=e.settings)==null?void 0:c.value.onSelectedColumns)??[]}),l=r.computed(()=>i.value.map(c=>({label:c.label,cb:()=>{c.cb(n.value),e.data.selectedColumns.clear()}})));return(c,d)=>o.value?(r.openBlock(),r.createElementBlock("div",Qv,[n.value.length?(r.openBlock(),r.createElementBlock("span",e0,"selected columns "+r.toDisplayString(n.value.length),1)):r.createCommentVNode("",!0),d[0]||(d[0]=r.createTextVNode()),d[1]||(d[1]=r.createElementVNode("hr",null,null,-1)),d[2]||(d[2]=r.createTextVNode()),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(l.value,(p,h)=>(r.openBlock(),r.createElementBlock("span",{key:h,class:"command",onClick:r.withModifiers(p.cb,["stop"])},r.toDisplayString(p.label),9,t0))),128))])):r.createCommentVNode("",!0)}});function yr(t,e){const n={el:void 0,x:0,y:0},o=i=>({x:i.x,y:i.y,dx:i.x-n.x,dy:i.y-n.y});st(document,"mousedown",i=>{i.target===r.unref(t)&&(i.stopPropagation&&i.stopPropagation(),i.preventDefault&&i.preventDefault(),n.el=r.unref(t),n.x=i.x,n.y=i.y)}),st(document,"mouseup",i=>{n.el&&(n.el=void 0,e({...o(i),stop:!0},n))}),st(document,"mousemove",i=>{n.el&&e(o(i),n)})}const r0=r.defineComponent({__name:"TScroll",props:{offset:{},windowSize:{},dataSize:{}},emits:["change:offset"],setup(t,{emit:e}){const n=e,o=t,i=r.ref(),l=r.computed(()=>o.windowSize-12),c=r.computed(()=>o.windowSize<o.dataSize),d=r.computed(()=>Math.ceil(o.offset*(l.value/o.dataSize))),p=r.computed(()=>Math.ceil(l.value*l.value/o.dataSize)),h=r.computed(()=>({top:`${d.value}px`,height:`${p.value}px`}));return yr(i,(m,y)=>{const b=(d.value+m.dy)*o.dataSize/l.value;n("change:offset",b),y.x=m.x,y.y=m.y}),(m,y)=>(r.openBlock(),r.createElementBlock("div",{class:"t-scroll",style:r.normalizeStyle({height:`${m.windowSize}px`})},[r.createElementVNode("div",null,[c.value?(r.openBlock(),r.createElementBlock("div",{key:0,ref_key:"handleRef",ref:i,class:"t-scroll__handle",style:r.normalizeStyle(h.value)},null,4)):r.createCommentVNode("",!0)])],4))}});function o0(t){return r.computed(()=>{const{data:e,settings:n}=t,{bodyWidth:o,scrollLeft:i}=e,l=[...e.columns],c=Wu();n.value.controlColumn&&l.unshift({id:c,label:"#",width:60,frozen:!0});let d=0;const p=l.map(m=>{const y={...m,offset:d};return d+=m.width+_o,y}),h=p.filter(m=>m.frozen);return fv(p,m=>m.frozen?!1:i<m.offset+m.width&&m.offset<o+i).concat(h).map(m=>({...m,style:{left:m.frozen?`${m.offset}px`:`${m.offset-e.scrollLeft}px`,width:`${m.width}px`},control:m.id===c}))})}function i0(t,e){const n=r.computed(()=>e.value.reduce((o,i)=>(o[i.id]=i.justify?"justify-"+i.justify:"",o),{}));return r.computed(()=>t.rows.map(o=>{const i=n.value,{primaryKey:l,offset:c,dataRow:d,height:p}=o,h=e.value.map(m=>({id:m.id,column:m,row:o,value:d[m.id],class:i[m.id],editable:m.editable,width:m.width,style:m.style,control:m.control}));return Zu({style:{top:`${c-t.scrollTop}px`,height:`${o.height}px`},primaryKey:l,offset:c,height:p,cells:h,selected:t.selectedRows.has(l)})}))}const s0=async(t,e)=>{const{scrollTop:n,bodyHeight:o}=t;return await XC(0),ev({rows:e.getRows(n,o),dataWindow:t})};function a0(t){const e=r.reactive({rowIndex:-1,columns:[],pendingLoads:0,currentWindow:void 0,rows:[],resize:!1,resizeTh:void 0,dataHeight:0,bodyHeight:t.settings.height,bodyWidth:0,scrollTop:0,scrollLeft:0,selectedRows:new Set,selectedColumns:new Set});r.watch(()=>t.settings,m=>{e.columns=_i(m.columns),e.currentWindow=void 0,m.dataSource.getHeight().then(y=>{e.dataHeight=y,h.updateBodyHeight()}).catch(y=>e.error=y)},{immediate:!0});const n=r.computed(()=>t.settings),o=r.computed(()=>e.columns.reduce((m,y)=>m+y.width+_o,0)),i=r.computed(()=>Uu(h.data.dataHeight-h.data.bodyHeight,m=>m>0?m:0)),l=r.computed(()=>Uu(o.value-h.data.bodyWidth,m=>m>0?m:0)),c=r.computed(()=>({bodyHeight:e.bodyHeight,scrollTop:e.scrollTop,current:e.currentWindow})),d=o0({data:e,settings:n}),p=i0(e,d),h={data:e,settings:n,tableColumns:d,tableRows:p,adjustWidth:()=>{const m=e.columns.reduce((b,w)=>b+w.width+_o,0),y=e.bodyWidth+e.scrollLeft;if(m<y){const b=e.columns[e.columns.length-1];b.width=b.width+(y-m)}},updateOffsets(m){this.updateScrollTop(e.scrollTop+m.deltaY),this.updateScrollLeft(e.scrollLeft+m.deltaX)},getSelectedRows(){return e.rows.filter(m=>e.selectedRows.has(m.primaryKey))},getSelectedColumns(){return e.columns.filter(m=>e.selectedColumns.has(m.id))},selectRow(m){e.selectedRows.add(m)},unselectRow(m){e.selectedRows.delete(m)},selectColumn(m){e.selectedColumns.add(m)},unselectColumn(m){e.selectedColumns.delete(m)},updateScrollTop(m){e.scrollTop=ks(m,0,i.value)},updateScrollLeft(m){e.scrollLeft=ks(m,0,l.value)},updateBodyHeight(){const{height:m}=t.settings,{dataHeight:y}=e,b=m>y?y:m;e.bodyHeight=b},updateDimensions(m){this.updateBodyHeight(),h.data.bodyWidth=m.width,h.adjustWidth(),e.rows=[],e.currentWindow=void 0}};return r.watch(c,(m,y)=>{const b=m.current;(!b||m.scrollTop<b.scrollTop||m.scrollTop+m.bodyHeight>b.bodyHeight+b.scrollTop)&&(e.currentWindow={scrollTop:m.scrollTop-Ku,bodyHeight:m.bodyHeight+Ku*2},s0(_i(e.currentWindow),n.value.dataSource).then(({rows:w,dataWindow:S})=>{yi(e.currentWindow,S)&&(e.rows=w)}))},{deep:!0,immediate:!0}),r.provide(qu,h),h}const l0={class:"command-menu__container"},c0={key:0,class:"table-body__no-data"},d0={class:"carets"},Sl=r.defineComponent({__name:"TableComponent",props:{settings:{}},emits:["update:data","change:sort"],setup(t,{emit:e}){const n=e,o=t,i=a0(o),l=r.computed(()=>i.data.rows.length===0),c=r.computed(()=>({height:l.value?"212px":i.data.bodyHeight+"px"}));r.watch(i.data,M=>n("update:data",M),{deep:!0}),r.watch(o,()=>m);const d=r.ref(),p=r.ref(),h=r.ref(),m=()=>{gr(h.value,M=>{i.updateDimensions(M.getBoundingClientRect())})},y=i.tableColumns,b=i.tableRows,{mouseDown:w}=qv(i,d);r.onMounted(()=>{r.nextTick(m)}),r.watchPostEffect(()=>{r.unref(o.settings),r.nextTick(m)}),st(window,"resize",()=>r.nextTick(m));const S=M=>{M.preventDefault(),i.updateOffsets(M)};return(M,O)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"tableRef",ref:d,class:"data-table",onMousedown:O[2]||(O[2]=(...v)=>r.unref(w)&&r.unref(w)(...v))},[r.createElementVNode("div",l0,[r.createVNode(Jv),O[3]||(O[3]=r.createTextVNode()),r.createVNode(n0)]),O[7]||(O[7]=r.createTextVNode()),r.createElementVNode("div",{ref_key:"headRef",ref:p,class:"table-head"},[r.createVNode(Iv,null,{default:r.withCtx(()=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(y),(v,I)=>(r.openBlock(),r.createBlock(Mv,{key:I,col:v,style:r.normalizeStyle(v.style),"onChange:sort":O[0]||(O[0]=F=>M.$emit("change:sort",F))},null,8,["col","style"]))),128))]),_:1})],512),O[8]||(O[8]=r.createTextVNode()),r.createElementVNode("div",{ref_key:"bodyRef",ref:h,class:"table-body",style:r.normalizeStyle(c.value),onWheel:S},[l.value?(r.openBlock(),r.createElementBlock("div",c0,[r.createElementVNode("div",null,[r.createVNode(Rv),O[4]||(O[4]=r.createTextVNode()),O[5]||(O[5]=r.createElementVNode("div",null,"No Data To Show",-1))])])):r.createCommentVNode("",!0),O[6]||(O[6]=r.createTextVNode()),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(b),(v,I)=>(r.openBlock(),r.createBlock(Gv,{key:I,row:v},{default:r.withCtx(()=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(v.cells,F=>(r.openBlock(),r.createBlock(Vv,{key:F.column.id+":"+I,cell:F,style:r.normalizeStyle(F.style)},null,8,["cell","style"]))),128))]),_:2},1032,["row"]))),128))],36),O[9]||(O[9]=r.createTextVNode()),r.createElementVNode("div",d0,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(y),(v,I)=>(r.openBlock(),r.createBlock($v,{key:I,column:v,style:r.normalizeStyle(v.style),"onChange:sort":O[1]||(O[1]=F=>M.$emit("change:sort",F))},null,8,["column","style"]))),128))]),O[10]||(O[10]=r.createTextVNode()),r.createVNode(r0,{offset:r.unref(i).data.scrollTop,"window-size":r.unref(i).data.bodyHeight,"data-size":r.unref(i).data.dataHeight,"onChange:offset":r.unref(i).updateScrollTop},null,8,["offset","window-size","data-size","onChange:offset"])],544))}}),Ju=new WeakMap;class u0{constructor(e,n,o){KC(this,"dataHeight"),this.datum=e,this.resolveHeight=n,this.resolvePrimaryKey=o;const i=e.reduce((c,d,p)=>(c.indices.set(p,c.total),c.total+=this.resolveHeight(d,p)+_o,c),{total:0,indices:new Map});this.dataHeight=i.total;const l=e.map((c,d)=>({dataRow:c,index:d,primaryKey:this.resolvePrimaryKey(c,d),offset:xs(i.indices.get(d)),height:this.resolveHeight(c,d)}));Ju.set(this,l)}get rows(){return Ju.get(this)}async getHeight(){return this.dataHeight}async getRows(e,n){return Lv(this.rows,o=>{const i=o.offset;return e<i+o.height&&i<n+e})}}class p0{constructor(e,n,o){this.api=e,this.rowHeight=n,this.resolvePrimaryKey=o}get height(){return this.rowHeight+_o}async getHeight(){return await this.api.count()*this.height}async getRows(e,n){const o=ks(Math.floor(e/this.height),0,Number.POSITIVE_INFINITY),i=Math.ceil(n+40/this.height);return(await this.api.query({offset:o,limit:i})).map((l,c)=>({dataRow:l,index:o+c,primaryKey:this.resolvePrimaryKey(l,o+c),offset:(o+c)*(this.rowHeight+_o),height:this.rowHeight}))}}function h0(t){return Object.freeze(t)}function f0(t){return r.h(Sl,{settings:Object.freeze(t)})}function Tl(t,e){const n=new u0(t,e.resolveRowHeight,e.resolvePrimaryKey);return{...e,dataSource:n}}function m0(t,e){return r.computed(()=>{const n=r.unref(t);return Tl(n,r.unref(e))})}function g0(t,e){const n=r.computed(()=>{const i=r.unref(t);return Tl(i,r.unref(e))}),o=r.reactive({settings:n});return r.computed(()=>r.h(Sl,o))}const y0=Object.freeze(Object.defineProperty({__proto__:null,AsyncData:p0,Component:Sl,factory:f0,rawDataSettings:Tl,settings:h0,useRawData:m0,useRawDataComponent:g0},Symbol.toStringTag,{value:"Module"}));function*_0(t,e){for(const n of t)yield e(n)}function C0(t){const e=[];for(const n of t)e.push(n);return e}function Qu(t){return t()}function Nl(t,e){if(t==null)throw Error(e);return t}function Vl(t){let e=!1;return function(...n){e||(requestAnimationFrame(()=>{t(...n),e=!1}),e=!0)}}function ep(t){return new Promise(e=>setTimeout(e,t))}function tp(t,e){const n=setTimeout(t,e);return()=>{clearTimeout(n)}}function np(t,e){return t=Math.ceil(t),e=Math.floor(e),Math.floor(Math.random()*(e-t))+t}function v0(t){let e="";for(let n=0;n<t;n++)e+=String.fromCharCode(np(65,91));return e}function rp(t){return function(e){return 1-t(1-e)}}function w0(t){return function(e){return e<.5?t(2*e)/2:(2-t(2*(1-e)))/2}}function op(t){const{duration:e,draw:n,timing:o}=t,i=performance.now();let l=!1;return requestAnimationFrame(function c(d){let p=(d-i)/e;(p>1||l)&&(p=1);const h=o(p);n(h),p<1&&requestAnimationFrame(c)}),function(){l=!0}}function b0(t){const{getFraction:e,draw:n,timing:o}=t,i=performance.now();let l=!1;return requestAnimationFrame(function c(d){let p=e(d-i);if(l)return;p>1&&(p=1);const h=o(p);n(h),p<1&&requestAnimationFrame(c)}),function(){l=!0}}function ip(t,e){let n=-1;return(...o)=>{n!==-1&&(clearTimeout(n),n=-1),n=window.setTimeout(()=>t(...o),e)}}function sp(t,e,n=!0){let o=0,i;return function(...l){i=()=>{t.apply(this,l),o=new Date().getTime()+e,i=null,n&&setTimeout(()=>{i&&i()},e)},new Date().getTime()>o&&i()}}function x0(t){return t.map(e=>({text:String(e),value:e}))}function _r(t){return t.map(e=>({label:"label"in e?e.label:e.text,value:e.value,description:e.description}))}const Al=new Map;function k0(t){return Al.has(t)||Al.set(t,r.ref(localStorage.getItem(t))),Nl(Al.get(t),"...")}function E0(t,e){e==null?localStorage.removeItem(t):localStorage.setItem(t,e)}function ap(t){const e=k0(t);return r.watch(e,n=>E0(t,n)),e}const Bl=new Set;window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",t=>{C0(_0(Bl.values(),e=>e(t.matches?"dark":"light")))});const S0=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",lp=r.ref(S0),Pl=ap("theme");function cp(t){const e=r.computed(()=>Pl.value?Pl.value:lp.value),n=i=>{lp.value=i,t&&t(i)};function o(){Pl.value=e.value==="light"?"dark":(e.value,"light")}return r.watch(e,i=>{t&&t(r.unref(i))}),r.onMounted(()=>{Bl.add(n)}),r.onUnmounted(()=>{Bl.delete(n)}),[e,o]}const T0=r.defineComponent({__name:"ThemeSwitcher",setup(t){const[e,n]=cp();return(o,i)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["ui-theme-switcher",r.unref(e)]),onClick:i[0]||(i[0]=(...l)=>r.unref(n)&&r.unref(n)(...l))},i[1]||(i[1]=[r.createElementVNode("div",null,null,-1)]),2))}}),N0={key:0,class:"pl-block-page__title"},V0={class:"pl-block-page__title__default"},A0={class:"pl-block-page__title__append"},B0={key:1},P0={class:"pl-block-page__body"},R0={name:"PlBlockPage"},D0=r.defineComponent({...R0,props:{noBodyGutters:{type:Boolean}},setup(t){const e=r.useSlots();return(n,o)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["pl-layout-component pl-block-page",{noBodyGutters:n.noBodyGutters}])},[r.unref(e).title?(r.openBlock(),r.createElementBlock("div",N0,[r.createElementVNode("div",V0,[r.renderSlot(n.$slots,"title")]),o[0]||(o[0]=r.createTextVNode()),r.createElementVNode("div",A0,[r.renderSlot(n.$slots,"append")])])):(r.openBlock(),r.createElementBlock("div",B0)),o[1]||(o[1]=r.createTextVNode()),r.createElementVNode("div",P0,[r.renderSlot(n.$slots,"default")])],2))}}),I0={name:"PlContainer"},F0=r.defineComponent({...I0,props:{width:{}},setup(t){const e=t,n=r.computed(()=>({width:e.width}));return(o,i)=>(r.openBlock(),r.createElementBlock("div",{class:"pl-container pl-layout-component",style:r.normalizeStyle(n.value)},[r.renderSlot(o.$slots,"default")],4))}}),L0={name:"PlRow"},O0=r.defineComponent({...L0,props:{wrap:{type:Boolean},alignCenter:{type:Boolean},noGap:{type:Boolean}},setup(t){return(e,n)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["pl-layout-component pl-row",{wrap:e.wrap,"align-center":e.alignCenter}])},[r.renderSlot(e.$slots,"default")],2))}}),M0={class:"pl-layout-component",style:{"flex-grow":"1"}},G0={name:"PlSpacer"},dp=r.defineComponent({...G0,setup(t){return(e,n)=>(r.openBlock(),r.createElementBlock("div",M0))}}),$0={name:"PlGrid"},z0=r.defineComponent({...$0,props:{columns:{}},setup(t){const e=t,n=r.computed(()=>({gridTemplateColumns:`repeat(${e.columns}, minmax(0, 1fr))`}));return(o,i)=>(r.openBlock(),r.createElementBlock("div",{class:"pl-layout-component pl-grid",style:r.normalizeStyle(n.value)},[r.renderSlot(o.$slots,"default")],4))}}),U0={key:0,class:"pl-alert__icon"},Z0={class:"pl-alert__main"},W0={key:0},j0={class:"pl-alert__main__text"},H0={name:"PlAlert"},q0=r.defineComponent({...H0,props:{modelValue:{type:Boolean,default:!0},type:{default:void 0},label:{default:void 0},icon:{type:Boolean,default:void 0},closeable:{type:Boolean,default:void 0},monospace:{type:Boolean,default:void 0},whiteSpacePre:{type:Boolean,default:void 0},maxHeight:{default:void 0}},emits:["update:modelValue"],setup(t){const e={success:"success",warn:"warning",info:"edit",error:"error"};return(n,o)=>n.modelValue?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(["pl-alert",[{monospace:n.monospace,whiteSpacePre:n.whiteSpacePre},n.type?`pl-alert__${n.type}`:""]]),style:r.normalizeStyle({maxHeight:n.maxHeight})},[n.icon&&n.type?(r.openBlock(),r.createElementBlock("div",U0,[r.createElementVNode("div",{class:r.normalizeClass(`icon-24 icon-${e[n.type]}`)},null,2)])):r.createCommentVNode("",!0),o[2]||(o[2]=r.createTextVNode()),r.createElementVNode("div",Z0,[n.label?(r.openBlock(),r.createElementBlock("label",W0,r.toDisplayString(n.label),1)):r.createCommentVNode("",!0),o[1]||(o[1]=r.createTextVNode()),r.createElementVNode("div",j0,[r.renderSlot(n.$slots,"default")])]),o[3]||(o[3]=r.createTextVNode()),n.closeable?(r.openBlock(),r.createElementBlock("div",{key:1,class:"pl-alert__close-btn","aria-label":"Close alert",role:"button",onClick:o[0]||(o[0]=i=>n.$emit("update:modelValue",!1))})):r.createCommentVNode("",!0)],6)):r.createCommentVNode("",!0)}}),K0=`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
46
46
  <path fill-rule="evenodd" clip-rule="evenodd" d="M19.5 4.5H4.5L4.5 19.5H19.5V4.5ZM4.5 3C3.67157 3 3 3.67157 3 4.5V19.5C3 20.3284 3.67157 21 4.5 21H19.5C20.3284 21 21 20.3284 21 19.5V4.5C21 3.67157 20.3284 3 19.5 3H4.5Z" fill="#110529"/>
47
47
  </svg>
48
- `,H0=`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
48
+ `,Y0=`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
49
49
  <rect x="3" y="3" width="18" height="18" rx="2" fill="#110529"/>
50
50
  <path fill-rule="evenodd" clip-rule="evenodd" d="M17.5431 8.51724L10.3333 16.0875L6.45691 12.0172L7.54312 10.9828L10.3333 13.9125L16.4569 7.48276L17.5431 8.51724Z" fill="white"/>
51
51
  </svg>
52
- `,q0=["innerHTML"],K0={class:"dropdown-list-item__title-container"},Y0={class:"dropdown-list-item__title text-s"},X0={key:0,class:"dropdown-list-item__description text-description"},J0={key:1,class:"dropdown-list-item__icon flex-self-start"},_o=r.defineComponent({__name:"DropdownListItem",props:{option:{},isSelected:{type:Boolean,default:!1},size:{default:"small"},isHovered:{type:Boolean,default:!1},useCheckbox:{type:Boolean,default:!1}},setup(t){const e=t,n=r.computed(()=>{const l=[];return e.size==="small"&&l.push("dropdown-list-item__small"),e.isSelected&&l.push("dropdown-list-item__selected"),e.isHovered&&l.push("hovered-item"),l.join(" ")}),o=r.computed(()=>{const l=["dropdown-list-item__checkbox","flex-self-start"];return e.isSelected&&l.push("checked"),l.join(" ")}),i=r.computed(()=>e.isSelected?H0:j0);return(l,c)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass([n.value,"dropdown-list-item"])},[e.useCheckbox?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(o.value),innerHTML:i.value},null,10,q0)):r.createCommentVNode("",!0),c[1]||(c[1]=r.createTextVNode()),r.createElementVNode("div",K0,[r.createElementVNode("div",Y0,r.toDisplayString(l.option.label),1),c[0]||(c[0]=r.createTextVNode()),l.option.description?(r.openBlock(),r.createElementBlock("div",X0,r.toDisplayString(l.option.description),1)):r.createCommentVNode("",!0)]),c[2]||(c[2]=r.createTextVNode()),!e.useCheckbox&&e.isSelected?(r.openBlock(),r.createElementBlock("div",J0)):r.createCommentVNode("",!0)],2))}});function _i(t,e){const n=Nl(()=>{if(t.value){const{scrollTop:o,scrollLeft:i,scrollHeight:l,scrollWidth:c,clientHeight:d,clientWidth:p}=document.documentElement,h=t.value.getBoundingClientRect();e({scrollTop:o,scrollLeft:i,scrollHeight:l,scrollWidth:c,clientHeight:d,clientWidth:p,offsetY:o+h.y,offsetX:i+h.x,top:h.top,right:h.right,bottom:h.bottom,left:h.left,width:h.width,height:h.height,x:h.x,y:h.y})}});r.onMounted(n),st(window,"scroll",n,{capture:!0,passive:!0}),st(window,"resize",n,{passive:!0}),st(window,"adjust",n,!0)}const Q0=r.defineComponent({__name:"PlMaskIcon16",props:{name:{},size:{}},setup(t){const e=t,n=r.computed(()=>e.size==="large"?"--mask-size: 24px":""),o=r.computed(()=>`mask-16 mask-${e.name}`);return(i,l)=>(r.openBlock(),r.createElementBlock("i",{style:r.normalizeStyle(n.value),class:r.normalizeClass([o.value,i.$style.icon])},null,6))}}),ew="_icon_1ugxm_2",tw={icon:ew},nw={$style:tw},nn=Ot(Q0,[["__cssModules",nw]]),rw=["onKeyup"],ow=r.defineComponent({__name:"PlBtnSplit",props:r.mergeModels({options:{},disabled:{type:Boolean},loading:{type:Boolean}},{modelValue:{required:!0},modelModifiers:{}}),emits:r.mergeModels(["click"],["update:modelValue"]),setup(t,{expose:e,emit:n}){const o=t,i=n,l=r.useModel(t,"modelValue"),c=r.ref(),d=r.ref(),p=r.ref(),h=r.ref(),m=r.reactive({open:!1,optionsHeight:0,activeIndex:-1});e({data:m});const y=r.reactive({top:"0px",left:"0px",width:"0px"});r.watch(d,P=>{if(P){const V=P.getBoundingClientRect();m.optionsHeight=V.height,window.dispatchEvent(new CustomEvent("adjust"))}},{immediate:!0});const b=r.computed(()=>m.open?"mask-24 mask-chevron-up":"mask-24 mask-chevron-down"),w=r.computed(()=>(o.options??[]).findIndex(P=>gi(P.value,l.value))),S=r.computed(()=>_r(o.options??[]).map((P,V)=>({...P,index:V,isSelected:V===w.value,isActive:V===m.activeIndex}))),M=r.computed(()=>o.loading||o.options===void 0),O=r.computed(()=>{var P;return((P=S.value.find(V=>gi(V.value,l.value)))==null?void 0:P.label)??(o.options===void 0?"...":"")});_i(c,P=>{const V=P.top+P.height+3;V+m.optionsHeight>P.clientHeight?y.top=P.top-m.optionsHeight-3+"px":y.top=V+"px",y.left=P.left+"px",y.width=P.width+"px"});const C=P=>{var V;l.value=P,m.open=!1,(V=c==null?void 0:c.value)==null||V.focus()};function I(){i("click")}const F=P=>{var V,Z;if(["ArrowDown","ArrowUp","Enter","Escape"].includes(P.code))P.preventDefault();else return;if(P.target===h.value&&P.code==="Enter"){I();return}const{open:J,activeIndex:ae}=m;if(!J&&P.target===p.value){P.code==="Enter"&&(m.open=!0);return}P.code==="Escape"&&(m.open=!1,(V=c.value)==null||V.focus());const $=r.unref(S),{length:j}=$;if(!j)return;P.code==="Enter"&&C((Z=$.find(B=>B.index===ae))==null?void 0:Z.value);const U=$.findIndex(B=>B.index===ae)??-1,k=P.code==="ArrowDown"?1:P.code==="ArrowUp"?-1:0,x=Math.abs(U+k+j)%j;m.activeIndex=S.value[x].index??-1},W=P=>{var V,Z;const J=P.relatedTarget;!((V=c.value)!=null&&V.contains(J))&&!((Z=d.value)!=null&&Z.contains(J))&&(m.open=!1)};return(P,V)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"root",ref:c,class:r.normalizeClass([{disabled:P.disabled||M.value,loading:M.value},"pl-btn-split d-flex"]),onFocusout:W,onKeydown:F},[r.createElementVNode("div",{ref_key:"buttonAction",ref:h,class:"pl-btn-split__title flex-grow-1 d-flex align-center text-s-btn",tabindex:"0",onClick:I,onKeyup:r.withKeys(r.withModifiers(I,["stop"]),["enter"])},r.toDisplayString(O.value),41,rw),V[1]||(V[1]=r.createTextVNode()),r.createElementVNode("div",{ref_key:"menuActivator",ref:p,class:"pl-btn-split__icon-container d-flex align-center justify-center",tabindex:"0",onClick:V[0]||(V[0]=Z=>m.open=!m.open)},[M.value?(r.openBlock(),r.createBlock(nn,{key:0,name:"loading"})):(r.openBlock(),r.createElementBlock("div",{key:1,class:r.normalizeClass([b.value,"pl-btn-split__icon"])},null,2))],512),V[2]||(V[2]=r.createTextVNode()),m.open?(r.openBlock(),r.createBlock(r.Teleport,{key:0,to:"body"},[r.createElementVNode("div",{ref_key:"list",ref:d,class:"pl-dropdown__options",style:r.normalizeStyle(y),tabindex:"-1"},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(S.value,(Z,J)=>(r.openBlock(),r.createBlock(_o,{key:J,option:Z,"is-selected":Z.isSelected,"is-hovered":Z.isActive,size:"medium",onClick:r.withModifiers(ae=>C(Z.value),["stop"])},null,8,["option","is-selected","is-hovered","onClick"]))),128))],4)])):r.createCommentVNode("",!0)],34))}});function dp(t){function e(n){const o=n.currentTarget,i=document.createElement("span"),l=Math.max(o.clientWidth,o.clientHeight),c=l/2;i.style.width=i.style.height=`${l}px`,i.style.left=`${n.clientX-o.offsetLeft-c}px`,i.style.top=`${n.clientY-o.offsetTop-c}px`,i.classList.add("ripple");const d=o.getElementsByClassName("ripple")[0];d&&d.remove(),o.appendChild(i)}r.onMounted(()=>{var n;(n=t.value)==null||n.addEventListener("click",e)})}const iw={key:0},sw={inheritAttrs:!1},Es=r.defineComponent({...sw,__name:"BtnBase",props:{loading:{type:Boolean},small:{type:Boolean},large:{type:Boolean},size:{},round:{type:Boolean},icon:{},reverse:{type:Boolean},justifyCenter:{type:Boolean}},setup(t){const e=t,n=r.ref(),o=r.computed(()=>e.small||e.size==="small"),i=r.computed(()=>e.large||e.size==="large");return dp(n),(l,c)=>(r.openBlock(),r.createElementBlock("button",r.mergeProps({ref_key:"btn",ref:n,tabindex:"0",class:{loading:l.loading,small:o.value,large:i.value,round:l.round,reverse:l.reverse,justifyCenter:l.justifyCenter,[l.$attrs.class+""]:!0}},{...l.$attrs,disabled:!!l.$attrs.disabled||l.loading}),[l.round?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("span",iw,[r.renderSlot(l.$slots,"default")])),c[0]||(c[0]=r.createTextVNode()),l.loading?(r.openBlock(),r.createBlock(r.unref(nn),{key:1,name:"loading",size:l.size},null,8,["size"])):l.icon?(r.openBlock(),r.createBlock(r.unref(nn),{key:2,name:l.icon,size:l.size},null,8,["name","size"])):r.createCommentVNode("",!0)],16))}}),aw={name:"PlBtnPrimary"},Ss=r.defineComponent({...aw,props:{loading:{type:Boolean},size:{},round:{type:Boolean},icon:{},reverse:{type:Boolean},justifyCenter:{type:Boolean}},setup(t){const e=t;return(n,o)=>(r.openBlock(),r.createBlock(Es,r.mergeProps({class:"pl-btn-primary"},e),{default:r.withCtx(()=>[r.renderSlot(n.$slots,"default")]),_:3},16))}}),lw={name:"PlBtnAccent"},cw=r.defineComponent({...lw,props:{loading:{type:Boolean},size:{},round:{type:Boolean},icon:{},reverse:{type:Boolean},justifyCenter:{type:Boolean}},setup(t){const e=t;return(n,o)=>(r.openBlock(),r.createBlock(Es,r.mergeProps({class:"pl-btn-accent"},e),{default:r.withCtx(()=>[r.renderSlot(n.$slots,"default")]),_:3},16))}}),dw={name:"PlBtnDanger"},uw=r.defineComponent({...dw,props:{loading:{type:Boolean},size:{},round:{type:Boolean},icon:{},reverse:{type:Boolean},justifyCenter:{type:Boolean}},setup(t){const e=t;return(n,o)=>(r.openBlock(),r.createBlock(Es,r.mergeProps({class:"pl-btn-danger"},e),{default:r.withCtx(()=>[r.renderSlot(n.$slots,"default")]),_:3},16))}}),pw={name:"PlBtnSecondary"},Pl=r.defineComponent({...pw,props:{loading:{type:Boolean},size:{},round:{type:Boolean},icon:{},reverse:{type:Boolean},justifyCenter:{type:Boolean}},setup(t){const e=t;return(n,o)=>(r.openBlock(),r.createBlock(Es,r.mergeProps(e,{class:"pl-btn-secondary"}),{default:r.withCtx(()=>[r.renderSlot(n.$slots,"default")]),_:3},16))}}),hw={key:0},fw={name:"PlBtnGhost"},vo=r.defineComponent({...fw,props:{loading:{type:Boolean},size:{default:void 0},round:{type:Boolean},icon:{default:void 0},reverse:{type:Boolean},justifyCenter:{type:Boolean,default:!1}},setup(t){const e=t,n=r.computed(()=>e.size==="small"),o=r.computed(()=>e.size==="large"),i=r.ref(),l=r.useSlots();return dp(i),(c,d)=>(r.openBlock(),r.createElementBlock("button",r.mergeProps({ref_key:"btnRef",ref:i,tabindex:"0",class:["pl-btn-ghost",{loading:c.loading,small:n.value,large:o.value,round:c.round,reverse:c.reverse,justifyCenter:c.justifyCenter,[c.$attrs.class+""]:!0}]},{...c.$attrs,disabled:!!c.$attrs.disabled||c.loading}),[r.unref(l).default&&!c.round?(r.openBlock(),r.createElementBlock("span",hw,[r.renderSlot(c.$slots,"default")])):r.createCommentVNode("",!0),d[0]||(d[0]=r.createTextVNode()),c.loading?(r.openBlock(),r.createBlock(r.unref(nn),{key:1,name:"loading",size:c.size},null,8,["size"])):c.icon?(r.openBlock(),r.createBlock(r.unref(nn),{key:2,name:c.icon,size:c.size},null,8,["name","size"])):r.createCommentVNode("",!0),d[1]||(d[1]=r.createTextVNode()),r.renderSlot(c.$slots,"append")],16))}}),mw=r.defineComponent({__name:"PlBtnLink",props:{loading:{type:Boolean},size:{},icon:{},reverse:{type:Boolean},justifyCenter:{type:Boolean},disabled:{type:Boolean}},setup(t){const e=t,n=r.ref(!1);return(o,i)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["ui-btn-link",{disabled:o.disabled,loading:o.loading,hover:n.value}]),onMouseover:i[0]||(i[0]=l=>n.value=!0),onMouseleave:i[1]||(i[1]=l=>n.value=!1)},[r.createVNode(Pl,r.mergeProps({round:"",hover:n.value},e),null,16,["hover"]),i[2]||(i[2]=r.createTextVNode()),r.renderSlot(o.$slots,"default")],34))}});function gw(t,e){const n=r.ref();return _i(t,o=>{n.value=o}),r.computed(()=>{const o=r.unref(n),i=r.unref(e),l=i.position??"top",c=i.gap??8;if(!o)return"";const d=o.offsetY+Math.floor(o.height/2),p=o.offsetX+Math.floor(o.width/2);return l==="top-left"?`left: ${o.offsetX}px; top: ${o.offsetY-c}px;`:l==="top"?`left: ${p}px; top: ${o.offsetY-c}px;`:l==="right"?`left: ${o.offsetX+o.width+c}px; top: ${d}px;`:l==="left"?`right: ${o.scrollWidth-o.x+c}px; top: ${d}px;`:l==="southwest"?`left: ${o.offsetX+o.width}px; top: ${o.offsetY+o.height+c}px;`:""})}function vi(t,e){return e(t)}function _t(t,e){if(t!=null)return e(t)}function yw(t){return Array.isArray(t)?t:[t]}function _w(t,e,...n){n.forEach(o=>{t[o]=e[o]})}function Ts(t,e){st(document,"click",n=>{document.contains(n.target)&&(yw(t).map(o=>o.value).filter(o=>!!o).some(o=>o==null?void 0:o.contains(n.target))||e())})}const vw={},Cw={class:"beak",width:"5",height:"9",viewBox:"0 0 3 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function ww(t,e){return r.openBlock(),r.createElementBlock("svg",Cw,e[0]||(e[0]=[r.createElementVNode("path",{d:"M4.00222 8.00933L0 4.00711L4.00222 0.00488281L4.00222 8.00933Z",fill:"#24223D"},null,-1)]))}const bw=Ot(vw,[["render",ww]]),Rl=new Map,xw={name:"PlTooltip"},vt=r.defineComponent({...xw,props:{openDelay:{default:100},closeDelay:{default:1e3},position:{default:"top"},hide:{type:Boolean},gap:{default:8},element:{default:"div"},maxWidth:{default:"300px"}},emits:["tooltip:close"],setup(t,{emit:e}){const n=e,o=Symbol(),i=t,l=r.reactive({open:!1,over:!1,tooltipOpen:!1,key:Symbol()});Rl.set(o,()=>h()),r.watch(()=>l.open,O=>{requestAnimationFrame(()=>{l.tooltipOpen=O})});let c=()=>{};const d=ip(()=>window.dispatchEvent(new CustomEvent("adjust")),1e3),p=()=>{l.open=!0;for(let[O,C]of Rl.entries())O!==o&&C()},h=()=>{l.open=!1,n("tooltip:close")},m=async()=>{i.hide||(d(),l.over=!0,c(),await Qu(100),l.over&&p())},y=()=>{l.over=!1,c=ep(()=>{l.over||h()},i.closeDelay)};r.watch(()=>i.hide,O=>{O&&h()});const b=r.ref(),w=r.ref(),S=gw(b,r.toRef(i));Ts([b,w],()=>h());const M=r.computed(()=>({"--pl-tooltip-max-width":i.maxWidth}));return r.onUnmounted(()=>{Rl.delete(o)}),(O,C)=>(r.openBlock(),r.createBlock(r.resolveDynamicComponent(O.element),r.mergeProps(O.$attrs,{ref_key:"rootRef",ref:b,onClick:m,onMouseover:m,onMouseleave:y}),{default:r.withCtx(()=>[r.renderSlot(O.$slots,"default"),C[1]||(C[1]=r.createTextVNode()),O.$slots.tooltip&&l.open?(r.openBlock(),r.createBlock(r.Teleport,{key:0,to:"body"},[r.createVNode(r.Transition,{name:"tooltip-transition"},{default:r.withCtx(()=>[l.tooltipOpen?(r.openBlock(),r.createElementBlock("div",{key:0,class:"pl-tooltip__container",style:r.normalizeStyle(r.unref(S))},[r.createElementVNode("div",{ref_key:"tooltip",ref:w,class:r.normalizeClass(["pl-tooltip",O.position]),style:r.normalizeStyle(M.value),onMouseover:m,onMouseleave:y},[r.createElementVNode("div",null,[r.renderSlot(O.$slots,"tooltip")]),C[0]||(C[0]=r.createTextVNode()),r.createVNode(bw)],38)],4)):r.createCommentVNode("",!0)]),_:3})])):r.createCommentVNode("",!0)]),_:3},16))}}),kw={},Ew={class:"inner-border"};function Sw(t,e,n,o,i,l){return r.openBlock(),r.createElementBlock("div",Ew,[r.renderSlot(t.$slots,"default")])}const Tw=Ot(kw,[["render",Sw]]),Nw={key:0},Vw=["tabindex","onKeydown","onClick"],Aw={key:1,class:"pl-btn-group__helper"},Bw={key:2,class:"pl-btn-group__error"},Pw={name:"PlBtnGroup"},up=r.defineComponent({...Pw,props:{modelValue:{},label:{},options:{},disabled:{type:Boolean},compact:{type:Boolean},helper:{},error:{}},emits:["update:modelValue"],setup(t,{emit:e}){const n=r.useSlots(),o=e,i=d=>o("update:modelValue",d),l=t,c=r.computed(()=>l.options.map(d=>({label:"label"in d?d.label:d.text,value:d.value})));return(d,p)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["pl-btn-group",{disabled:d.disabled,compact:d.compact}])},[d.label?(r.openBlock(),r.createElementBlock("label",Nw,[r.createElementVNode("span",null,r.toDisplayString(d.label),1),p[0]||(p[0]=r.createTextVNode()),r.unref(n).tooltip?(r.openBlock(),r.createBlock(r.unref(vt),{key:0,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.renderSlot(d.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0),p[1]||(p[1]=r.createTextVNode()),r.createVNode(Tw,{class:"pl-btn-group__container"},{default:r.withCtx(()=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(c.value,(h,m)=>(r.openBlock(),r.createElementBlock("div",{key:m,class:r.normalizeClass(["pl-btn-group__option text-s",{active:d.modelValue===h.value}]),tabindex:d.modelValue===h.value||d.disabled?void 0:0,onKeydown:r.withKeys(y=>i(h.value),["enter"]),onClick:y=>i(h.value)},r.toDisplayString(h.label),43,Vw))),128))]),_:1}),p[2]||(p[2]=r.createTextVNode()),d.helper?(r.openBlock(),r.createElementBlock("div",Aw,r.toDisplayString(d.helper),1)):d.error?(r.openBlock(),r.createElementBlock("div",Bw,r.toDisplayString(d.error),1)):r.createCommentVNode("",!0)],2))}});function Rw(t,e){const n=r.ref(),o=r.ref(),{parse:i,update:l}=e,c=()=>{n.value=void 0,o.value=void 0},d=r.computed({get(){return n.value!==void 0?n.value:t.value},set(p){c();try{const h=i?i(p):p;!l||l(h)?t.value=h:n.value=h}catch(h){n.value=p,o.value=h instanceof Error?h.message:String(h)}}});return r.reactive({value:d,error:o,reset:c})}const Dw="_component_1abv8_1",Iw="_container_1abv8_15",Fw="_error_1abv8_69",Dl={component:Dw,container:Iw,error:Fw},Lw={key:0},Ow=["placeholder"],Mw=r.defineComponent({__name:"PlEditableTitle",props:r.mergeModels({placeholder:{default:"Title"},maxWidth:{default:"80%"},prefix:{default:void 0},maxLength:{default:1e3},minLength:{default:void 0}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=r.useModel(t,"modelValue"),n=t,o=Rw(e,{update(){return!1},parse:d=>{if(typeof d!="string")throw Error("value should be a string");if(n.maxLength&&d.length>n.maxLength)throw Error(`Max title length is ${n.maxLength} characters`);if(n.minLength&&d.length<n.minLength)throw Error(`Min title length is ${n.minLength} characters`);return d.trim()}}),i=r.computed(()=>({maxWidth:n.maxWidth??"80%"})),l=()=>{e.value=o.value&&!o.error?o.value:e.value,o.reset()},c=r.ref();return(d,p)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["pl-editable-title",r.unref(Dl).component]),style:r.normalizeStyle(i.value)},[r.createElementVNode("div",{class:r.normalizeClass(r.unref(Dl).container),onClick:p[3]||(p[3]=()=>{var h;return(h=c.value)==null?void 0:h.focus()})},[d.prefix?(r.openBlock(),r.createElementBlock("span",Lw,r.toDisplayString(d.prefix.trim())+" ",1)):r.createCommentVNode("",!0),p[4]||(p[4]=r.createTextVNode()),r.withDirectives(r.createElementVNode("input",{ref_key:"inputRef",ref:c,"onUpdate:modelValue":p[0]||(p[0]=h=>r.unref(o).value=h),placeholder:d.placeholder,onFocusout:l,onKeydown:[p[1]||(p[1]=r.withKeys((...h)=>r.unref(o).reset&&r.unref(o).reset(...h),["escape"])),p[2]||(p[2]=r.withKeys(h=>{var m;return(m=h.target)==null?void 0:m.blur()},["enter"]))]},null,40,Ow),[[r.vModelText,r.unref(o).value]])],2),p[5]||(p[5]=r.createTextVNode()),r.unref(o).error?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(r.unref(Dl).error)},r.toDisplayString(r.unref(o).error),3)):r.createCommentVNode("",!0)],6))}}),Gw={inheritAttrs:!1},$w={class:"double-contour"};function zw(t,e,n,o,i,l){return r.openBlock(),r.createElementBlock("div",$w,[r.createElementVNode("div",r.normalizeProps(r.guardReactiveProps(t.$attrs)),[r.renderSlot(t.$slots,"default")],16)])}const vr=Ot(Gw,[["render",zw]]);function pp(t){r.onMounted(t),r.onUpdated(t)}const Il=new WeakMap,Fl=new ResizeObserver(t=>{for(const e of t)_t(Il.get(e.target),n=>n(e))});function hp(t,e){Il.set(t,e),Fl.unobserve(t),Fl.observe(t)}function fp(t){Fl.unobserve(t),Il.delete(t)}const Uw=8,mp=4;function Yn(t,e="label"){const n=new Set;pp(()=>{_t(t==null?void 0:t.value,o=>{const i=o.querySelector(e);i&&(n.add(i),hp(i,()=>{const l=Ju(()=>i.getBoundingClientRect().width+vi(Uw,c=>Number.isNaN(c)?mp:c+mp));o.style.getPropertyValue("--label-offset-right-x")!==`${l}px`&&o.style.setProperty("--label-offset-right-x",`${l}px`)}))})}),r.onBeforeUnmount(()=>{Array.from(n.values()).map(o=>fp(o))})}function Zw(t,e){const n=[];return e&&e.length>0&&e.forEach(o=>{const i=o(t);typeof i=="string"&&n.push(i)}),{isValid:n.length===0,errors:n}}function gp(t,e){return r.computed(()=>Zw(t.value,e))}const Ww=r.defineComponent({__name:"PlIcon16",props:{name:{},size:{}},setup(t){const e=t,n=r.computed(()=>e.size==="large"?"--icon-size: 24px":""),o=r.computed(()=>`icon-16 icon-${e.name}`);return(i,l)=>(r.openBlock(),r.createElementBlock("i",{style:r.normalizeStyle(n.value),class:r.normalizeClass([o.value,i.$style.icon])},null,6))}}),jw="_icon_1ugxm_2",Hw={icon:jw},qw={$style:Hw},Wr=Ot(Ww,[["__cssModules",qw]]),Kw=r.defineComponent({__name:"PlMaskIcon24",props:{name:{},size:{}},setup(t){const e=t,n=r.computed(()=>`mask-24 mask-${e.name}`);return(o,i)=>(r.openBlock(),r.createElementBlock("i",{class:r.normalizeClass([n.value,o.$style.icon])},null,2))}}),Yw="_icon_1ugxm_2",Xw={icon:Yw},Jw={$style:Xw},Vt=Ot(Kw,[["__cssModules",Jw]]),Qw={class:"pl-text-field__envelope"},eb={key:0,ref:"label"},tb={key:0,class:"required-icon"},nb={key:1,class:"pl-text-field__prefix"},rb=["disabled","placeholder","type"],ob={class:"pl-text-field__append"},ib={key:0,class:"pl-text-field__error"},sb={key:1,class:"pl-text-field__helper"},ab={name:"PlTextField"},jr=r.defineComponent({...ab,props:r.mergeModels({label:{},clearable:{type:[Boolean,Function]},parse:{type:Function},required:{type:Boolean},error:{},helper:{},placeholder:{},disabled:{type:Boolean},dashed:{type:Boolean},prefix:{},rules:{},type:{}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=r.useSlots(),n=r.useModel(t,"modelValue"),o=t,i=r.ref(void 0),l=r.ref(),c=r.ref(!1),d=r.reactive({cached:void 0}),p=r.computed({get(){return d.cached?d.cached.value:n.value===void 0||n.value===null?"":String(n.value)},set(W){if(d.cached=void 0,o.parse)try{n.value=o.parse(W)}catch(P){d.cached={error:P instanceof Error?P.message:String(P),value:W}}else n.value=W}}),h=r.computed(()=>o.type&&o.type==="password"?c.value?"text":o.type:"text"),m=r.computed(()=>c.value?"view-show":"view-hide"),y=()=>{o.clearable&&(d.cached=void 0,n.value=o.clearable===!0?"":o.clearable())},b=gp(p,o.rules||[]),w=r.computed(()=>o.clearable?o.clearable===!0?n.value==="":n.value===o.clearable():n.value===""),S=r.computed(()=>!w.value),M=r.computed(()=>{const W=[];return o.error&&W.push(o.error),d.cached&&W.push(d.cached.error),b.value.isValid||W.push(...b.value.errors),W}),O=r.computed(()=>M.value.length>0),C=r.computed(()=>o.clearable&&S.value&&o.type!=="password"&&!o.disabled),I=()=>c.value=!c.value,F=()=>{d.cached=void 0};return Yn(i),(W,P)=>(r.openBlock(),r.createElementBlock("div",Qw,[r.createElementVNode("div",{ref_key:"rootRef",ref:i,class:r.normalizeClass(["pl-text-field",{error:O.value,disabled:W.disabled,dashed:W.dashed,nonEmpty:S.value}])},[W.label?(r.openBlock(),r.createElementBlock("label",eb,[W.required?(r.openBlock(),r.createElementBlock("i",tb)):r.createCommentVNode("",!0),P[1]||(P[1]=r.createTextVNode()),r.createElementVNode("span",null,r.toDisplayString(W.label),1),P[2]||(P[2]=r.createTextVNode()),r.unref(e).tooltip?(r.openBlock(),r.createBlock(r.unref(vt),{key:1,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.renderSlot(W.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)],512)):r.createCommentVNode("",!0),P[5]||(P[5]=r.createTextVNode()),W.prefix?(r.openBlock(),r.createElementBlock("div",nb,r.toDisplayString(W.prefix),1)):r.createCommentVNode("",!0),P[6]||(P[6]=r.createTextVNode()),r.withDirectives(r.createElementVNode("input",{ref_key:"inputRef",ref:l,"onUpdate:modelValue":P[0]||(P[0]=V=>p.value=V),disabled:W.disabled,placeholder:W.placeholder||"...",type:h.value,spellcheck:"false",onFocusout:F},null,40,rb),[[r.vModelDynamic,p.value]]),P[7]||(P[7]=r.createTextVNode()),r.createElementVNode("div",ob,[C.value?(r.openBlock(),r.createBlock(r.unref(Wr),{key:0,class:"pl-text-field__clearable",name:"delete-clear",onClick:y})):r.createCommentVNode("",!0),P[3]||(P[3]=r.createTextVNode()),W.type==="password"?(r.openBlock(),r.createBlock(r.unref(Vt),{key:1,name:m.value,style:{cursor:"pointer"},onClick:I},null,8,["name"])):r.createCommentVNode("",!0),P[4]||(P[4]=r.createTextVNode()),r.renderSlot(W.$slots,"append")]),P[8]||(P[8]=r.createTextVNode()),r.createVNode(vr,{class:"pl-text-field__contour"})],2),P[9]||(P[9]=r.createTextVNode()),O.value?(r.openBlock(),r.createElementBlock("div",ib,r.toDisplayString(M.value.join(" ")),1)):W.helper?(r.openBlock(),r.createElementBlock("div",sb,r.toDisplayString(W.helper),1)):r.createCommentVNode("",!0)]))}}),lb=r.defineComponent({__name:"PlIcon24",props:{name:{},size:{}},setup(t){const e=t,n=r.computed(()=>`icon-24 icon-${e.name}`);return(o,i)=>(r.openBlock(),r.createElementBlock("i",{class:r.normalizeClass([n.value,o.$style.icon])},null,2))}}),cb="_icon_1ugxm_2",db={icon:cb},ub={$style:db},Ns=Ot(lb,[["__cssModules",ub]]),pb=["disabled","placeholder"],hb=r.defineComponent({__name:"PlSearchField",props:{modelValue:{},clearable:{type:Boolean},placeholder:{},disabled:{type:Boolean}},emits:["update:modelValue"],setup(t,{emit:e}){const n=e,o=t,i=r.ref(void 0),l=r.ref(),c=r.computed({get(){return o.modelValue??""},set(h){n("update:modelValue",h)}}),d=r.computed(()=>!!o.modelValue),p=()=>n("update:modelValue","");return(h,m)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"root",ref:i,class:r.normalizeClass(["pl-search-field",[h.$style.component]])},[r.createVNode(r.unref(Ns),{name:"search"}),m[1]||(m[1]=r.createTextVNode()),r.withDirectives(r.createElementVNode("input",{ref_key:"input",ref:l,"onUpdate:modelValue":m[0]||(m[0]=y=>c.value=y),disabled:h.disabled,type:"text",placeholder:h.placeholder||"Find...",spellcheck:"false"},null,8,pb),[[r.vModelText,c.value]]),m[2]||(m[2]=r.createTextVNode()),h.clearable&&d.value?(r.openBlock(),r.createBlock(r.unref(Wr),{key:0,class:r.normalizeClass(h.$style.clear),name:"delete-clear",onClick:r.withModifiers(p,["stop"])},null,8,["class"])):r.createCommentVNode("",!0)],2))}}),fb="_component_1ng5b_1",mb="_clear_1ng5b_35",gb={component:fb,clear:mb},yb={$style:gb},yp=Ot(hb,[["__cssModules",yb]]),_b={class:"ui-text-area__envelope"},vb={key:0,ref:"label"},Cb={key:0,class:"required-icon"},wb=["readonly","rows","disabled","placeholder"],bb={class:"ui-text-area__append"},xb={key:0,class:"ui-text-area__error"},kb={key:1,class:"ui-text-area__helper"},Eb={name:"PlTextArea"},Sb=r.defineComponent({...Eb,props:{modelValue:{},label:{},required:{type:Boolean},error:{},helper:{},placeholder:{},disabled:{type:Boolean},readonly:{type:Boolean},dashed:{type:Boolean},rows:{},autogrow:{type:Boolean},rules:{}},emits:["update:modelValue"],setup(t,{emit:e}){const n=r.useSlots(),o=e,i=t,l=r.ref(),c=r.ref(),d=r.computed({get(){return i.modelValue??""},set(w){o("update:modelValue",w)}}),p=r.computed(()=>!!i.modelValue),h=gp(d,i.rules||[]);Yn(l);const m=r.computed(()=>{const w=[];return i.error&&w.push(i.error),w.push(...h.value.errors),w}),y=r.computed(()=>m.value.length>0),b=()=>{if(!i.autogrow)return;const w=c.value;w&&(w.style.height="auto",w.style.height=`${w.scrollHeight}px`)};return r.onMounted(()=>{b()}),(w,S)=>(r.openBlock(),r.createElementBlock("div",_b,[r.createElementVNode("div",{ref_key:"root",ref:l,class:r.normalizeClass(["ui-text-area",{error:y.value,disabled:w.disabled,dashed:w.dashed,nonEmpty:p.value}])},[w.label?(r.openBlock(),r.createElementBlock("label",vb,[w.required?(r.openBlock(),r.createElementBlock("i",Cb)):r.createCommentVNode("",!0),S[1]||(S[1]=r.createTextVNode()),r.createElementVNode("span",null,r.toDisplayString(w.label),1),S[2]||(S[2]=r.createTextVNode()),r.unref(n).tooltip?(r.openBlock(),r.createBlock(r.unref(vt),{key:1,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.renderSlot(w.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)],512)):r.createCommentVNode("",!0),S[3]||(S[3]=r.createTextVNode()),r.withDirectives(r.createElementVNode("textarea",{ref_key:"input",ref:c,"onUpdate:modelValue":S[0]||(S[0]=M=>d.value=M),readonly:w.readonly,rows:w.rows,disabled:w.disabled,placeholder:w.placeholder??"...",spellcheck:"false",onInput:b},null,40,wb),[[r.vModelText,d.value]]),S[4]||(S[4]=r.createTextVNode()),r.createElementVNode("div",bb,[r.renderSlot(w.$slots,"append")]),S[5]||(S[5]=r.createTextVNode()),r.createVNode(vr,{class:"ui-text-area__contour"})],2),S[6]||(S[6]=r.createTextVNode()),y.value?(r.openBlock(),r.createElementBlock("div",xb,r.toDisplayString(m.value.join(" ")),1)):w.helper?(r.openBlock(),r.createElementBlock("div",kb,r.toDisplayString(w.helper),1)):r.createCommentVNode("",!0)]))}});function _p(t){return t!==null&&typeof t=="object"}function Mt(t,e){return _p(t)&&_p(e)?Object.keys(t).length!==Object.keys(e).length?!1:Object.keys(t).every(n=>Mt(t[n],e[n])):t===e}function Ll(t,e){return t.some(n=>Mt(n,e))}const Ol=r.defineComponent({__name:"LongText",setup(t){r.useCssVars(m=>({"8d68520c":c.value}));const e=r.ref(!1),n=r.ref(),o=r.ref(!1),i=r.computed(()=>o.value&&e.value?"ui-lt-animate":""),l=op(m=>o.value=m,500),c=r.computed(()=>{var m;return n.value?`${((m=n.value)==null?void 0:m.innerHTML.length)*.4}s`:"5s"});function d(){const m=Tl(n.value,"span cannot be empty");e.value=m.clientWidth<m.scrollWidth}function p(){d(),l(!0)}function h(){l(!1)}return(m,y)=>(r.openBlock(),r.createElementBlock("div",r.mergeProps(m.$attrs,{class:"ui-lt-container"}),[r.createElementVNode("span",{onMouseover:p,onMouseleave:h},[r.createElementVNode("span",{ref_key:"span",ref:n,class:r.normalizeClass(i.value)},[r.renderSlot(m.$slots,"default")],2)],32)],16))}});function vp(t,e){const n=t.scrollTop,o=t.getBoundingClientRect().height,i=e.offsetTop,l=e.getBoundingClientRect().height;return i+l<o+n&&i>n}function Cp(t,e){const n=t.scrollTop,o=t.getBoundingClientRect().height,i=e.offsetTop,l=e.getBoundingClientRect().height;return i+l<o+n?"ceil":i>n?"floor":"visible"}function Vs(t,e,n={}){const o=t.scrollTop,i=t.getBoundingClientRect().height,l=e.getBoundingClientRect().height,c=e.offsetTop,d=Cp(t,e);if(d==="visible")return;const p=h=>{const m=d==="floor"?c-(i-l):c;t.scrollTop=o+h*(m-o)};vp(t,e)||rp({duration:n.duration||100,timing:np(h=>h),draw:p})}function Ml(t,e,n,o){return t.addEventListener(e,n,o),function(){t.removeEventListener(e,n)}}function Tb(t,e){const n=e.getBoundingClientRect();return t.x<n.x||t.x>n.x+n.width||t.y<n.y||t.y>n.y+n.height}const Gl=r.defineComponent({__name:"DropdownOverlay",props:{root:{},gap:{}},setup(t,{expose:e}){const n=t,o=r.reactive({optionsHeight:0}),i=r.reactive({top:"0px",left:"0px",width:"0px"}),l=r.toRef(n,"root"),c=r.ref();return e({scrollIntoActive:()=>{const d=c.value;d&&gr(d.querySelector(".hovered-item"),p=>{Vs(d,p)})},listRef:c}),r.watch(c,d=>{d&&requestAnimationFrame(()=>{const p=d.getBoundingClientRect();o.optionsHeight=p.height,window.dispatchEvent(new CustomEvent("adjust"))})}),_i(l,d=>{const p=document.body.getBoundingClientRect(),h=d.top-p.top,m=d.left-p.left,y=n.gap??0,b=h+d.height+y;b+o.optionsHeight>d.clientHeight?i.top=h-o.optionsHeight-y+"px":i.top=b+"px",i.left=m+"px",i.width=d.width+"px"}),(d,p)=>(r.openBlock(),r.createBlock(r.Teleport,{to:"body"},[r.createElementVNode("div",r.mergeProps({ref_key:"listRef",ref:c},d.$attrs,{style:i,tabindex:"-1"}),[r.renderSlot(d.$slots,"default",{ref:"list"})],16)]))}}),Nb={class:"pl-dropdown__envelope"},Vb=["tabindex"],Ab={class:"pl-dropdown__container"},Bb={class:"pl-dropdown__field"},Pb=["disabled","placeholder"],Rb={class:"pl-dropdown__controls"},Db={key:0},Ib={key:0,class:"required-icon"},Fb={key:0,class:"nothing-found"},Lb={key:0,class:"pl-dropdown__error"},Ob={key:1,class:"pl-dropdown__helper"},Mb={key:2,class:"pl-dropdown__helper"},Gb={name:"PlDropdown"},Co=r.defineComponent({...Gb,props:{modelValue:{},label:{default:""},options:{default:void 0},helper:{default:void 0},loadingOptionsHelper:{default:void 0},error:{default:void 0},placeholder:{default:"..."},clearable:{type:Boolean,default:!1},required:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},arrowIcon:{default:void 0},arrowIconLarge:{default:void 0},optionSize:{default:"small"}},emits:["update:modelValue"],setup(t,{emit:e}){const n=e,o=t,i=r.useSlots(),l=r.ref(),c=r.ref(),d=r.useTemplateRef("overlay"),p=r.reactive({search:"",activeIndex:-1,open:!1,optionsHeight:0}),h=()=>vi(F.value.findIndex(U=>Mt(U.value,o.modelValue)),U=>U<0?0:U),m=()=>p.activeIndex=h(),y=r.computed(()=>o.options===void 0),b=r.computed(()=>y.value?!0:o.disabled),w=r.computed(()=>(o.options??[]).findIndex(U=>Mt(U.value,o.modelValue))),S=r.computed(()=>{if(!y.value){if(o.error)return o.error;if(o.modelValue!==void 0&&w.value===-1)return"The selected value is not one of the options"}}),M=r.computed(()=>_r(o.options??[]).map((U,k)=>({...U,index:k,isSelected:k===w.value,isActive:k===p.activeIndex}))),O=r.computed(()=>{const U=r.unref(M).find(k=>Mt(k.value,o.modelValue));return(U==null?void 0:U.label)||o.modelValue}),C=r.computed(()=>!p.open&&o.modelValue?"":o.modelValue?String(O.value):o.placeholder),I=r.computed(()=>o.modelValue!==void 0&&o.modelValue!==null),F=r.computed(()=>{const U=M.value;return p.search?U.filter(k=>{const x=p.search.toLowerCase();return k.label.toLowerCase().includes(x)||k.description&&k.description.toLowerCase().includes(x)?!0:typeof k.value=="string"?k.value.toLowerCase().includes(x):k.value===p.search}):U}),W=r.computed(()=>b.value?void 0:"0"),P=U=>{var k;n("update:modelValue",U),p.search="",p.open=!1,(k=l==null?void 0:l.value)==null||k.focus()},V=()=>n("update:modelValue",void 0),Z=()=>{var U;return(U=c.value)==null?void 0:U.focus()},J=()=>p.open=!p.open,ae=()=>p.open=!0,$=U=>{var k,x,B;const G=U.relatedTarget;!((k=l.value)!=null&&k.contains(G))&&!((B=(x=d.value)==null?void 0:x.listRef)!=null&&B.contains(G))&&(p.search="",p.open=!1)},j=U=>{var k,x;if(["ArrowDown","ArrowUp","Enter","Escape"].includes(U.code))U.preventDefault();else return;const{open:B,activeIndex:G}=p;if(!B){U.code==="Enter"&&(p.open=!0);return}U.code==="Escape"&&(p.open=!1,(k=l.value)==null||k.focus());const H=r.unref(F),{length:K}=H;if(!K)return;U.code==="Enter"&&P((x=H.find(Ee=>Ee.index===G))==null?void 0:x.value);const ne=H.findIndex(Ee=>Ee.index===G)??-1,pe=U.code==="ArrowDown"?1:U.code==="ArrowUp"?-1:0,ke=Math.abs(ne+pe+K)%K;p.activeIndex=F.value[ke].index??-1};return Yn(l),r.watch(()=>o.modelValue,m,{immediate:!0}),r.watch(()=>p.open,U=>{var k;return U?(k=c.value)==null?void 0:k.focus():""}),r.watchPostEffect(()=>{var U;p.search,p.activeIndex>=0&&p.open&&((U=d.value)==null||U.scrollIntoActive())}),(U,k)=>(r.openBlock(),r.createElementBlock("div",Nb,[r.createElementVNode("div",{ref_key:"rootRef",ref:l,tabindex:W.value,class:r.normalizeClass(["pl-dropdown",{open:p.open,error:U.error,disabled:b.value}]),onKeydown:j,onFocusout:$},[r.createElementVNode("div",Ab,[r.createElementVNode("div",Bb,[r.withDirectives(r.createElementVNode("input",{ref_key:"input",ref:c,"onUpdate:modelValue":k[0]||(k[0]=x=>p.search=x),type:"text",tabindex:"-1",disabled:b.value,placeholder:C.value,spellcheck:"false",autocomplete:"chrome-off",onFocus:ae},null,40,Pb),[[r.vModelText,p.search]]),k[4]||(k[4]=r.createTextVNode()),p.open?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",{key:0,onClick:Z},[r.createVNode(Ol,{class:"input-value"},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(O.value),1)]),_:1})])),k[5]||(k[5]=r.createTextVNode()),r.createElementVNode("div",Rb,[y.value?(r.openBlock(),r.createBlock(r.unref(Vt),{key:0,name:"loading"})):r.createCommentVNode("",!0),k[1]||(k[1]=r.createTextVNode()),U.clearable&&I.value?(r.openBlock(),r.createBlock(r.unref(Wr),{key:1,name:"delete-clear",onClick:r.withModifiers(V,["stop"])})):r.createCommentVNode("",!0),k[2]||(k[2]=r.createTextVNode()),r.renderSlot(U.$slots,"append"),k[3]||(k[3]=r.createTextVNode()),U.arrowIconLarge?(r.openBlock(),r.createElementBlock("div",{key:2,class:r.normalizeClass(["arrow-icon",[`icon-24 ${U.arrowIconLarge}`]]),onClick:r.withModifiers(J,["stop"])},null,2)):U.arrowIcon?(r.openBlock(),r.createElementBlock("div",{key:3,class:r.normalizeClass(["arrow-icon",[`icon-16 ${U.arrowIcon}`]]),onClick:r.withModifiers(J,["stop"])},null,2)):(r.openBlock(),r.createElementBlock("div",{key:4,class:"arrow-icon arrow-icon-default",onClick:r.withModifiers(J,["stop"])}))])]),k[9]||(k[9]=r.createTextVNode()),U.label?(r.openBlock(),r.createElementBlock("label",Db,[U.required?(r.openBlock(),r.createElementBlock("i",Ib)):r.createCommentVNode("",!0),k[6]||(k[6]=r.createTextVNode()),r.createElementVNode("span",null,r.toDisplayString(U.label),1),k[7]||(k[7]=r.createTextVNode()),r.unref(i).tooltip?(r.openBlock(),r.createBlock(r.unref(vt),{key:1,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.renderSlot(U.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0),k[10]||(k[10]=r.createTextVNode()),p.open?(r.openBlock(),r.createBlock(r.unref(Gl),{key:1,ref_key:"overlay",ref:d,root:l.value,class:"pl-dropdown__options",tabindex:"-1",gap:3},{default:r.withCtx(()=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(F.value,(x,B)=>(r.openBlock(),r.createBlock(_o,{key:B,option:x,"is-selected":x.isSelected,"is-hovered":x.isActive,size:U.optionSize,onClick:r.withModifiers(G=>P(x.value),["stop"])},null,8,["option","is-selected","is-hovered","size","onClick"]))),128)),k[8]||(k[8]=r.createTextVNode()),F.value.length?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",Fb,"Nothing found"))]),_:1},8,["root"])):r.createCommentVNode("",!0),k[11]||(k[11]=r.createTextVNode()),r.createVNode(vr,{class:"pl-dropdown__contour"})])],42,Vb),k[12]||(k[12]=r.createTextVNode()),S.value?(r.openBlock(),r.createElementBlock("div",Lb,r.toDisplayString(S.value),1)):y.value&&U.loadingOptionsHelper?(r.openBlock(),r.createElementBlock("div",Ob,r.toDisplayString(U.loadingOptionsHelper),1)):U.helper?(r.openBlock(),r.createElementBlock("div",Mb,r.toDisplayString(U.helper),1)):r.createCommentVNode("",!0)]))}}),$b={name:"PlDropdownRef"},zb=r.defineComponent({...$b,props:{modelValue:{},label:{default:""},options:{default:void 0},helper:{default:void 0},loadingOptionsHelper:{default:void 0},error:{default:void 0},placeholder:{default:"..."},clearable:{type:Boolean,default:!1},required:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},optionSize:{default:"small"}},emits:["update:modelValue"],setup(t){const e=t,n=r.computed(()=>{var i;return(i=e.options)==null?void 0:i.map(l=>({label:l.label,value:l.ref}))}),o=r.computed(()=>e.disabled?"icon-link-disabled":"icon-link");return(i,l)=>(r.openBlock(),r.createBlock(r.unref(Co),r.mergeProps(e,{options:n.value,"loading-options-helper":i.loadingOptionsHelper,"arrow-icon-large":o.value,"onUpdate:modelValue":l[0]||(l[0]=c=>i.$emit("update:modelValue",c))}),null,16,["options","loading-options-helper","arrow-icon-large"]))}});function Ub(t,e){return r.computed(()=>{const n=_r(t.value);return e.value?n.filter(o=>o.label.toLowerCase().includes(e.value.toLowerCase())):n})}const Zb={class:"resizable-input"},Wb=["placeholder","value","disabled"],jb=r.defineComponent({__name:"ResizableInput",props:{modelValue:{},placeholder:{},value:{},disabled:{type:Boolean},maxWidth:{},width:{}},emits:["input","update:modelValue"],setup(t,{emit:e}){const n=t,o=e,i=r.computed(()=>{var d;return n.placeholder?n.placeholder:(d=n.modelValue||n.value)==null?void 0:d.replace('"',"")}),l=r.computed(()=>{const d={};return n.width&&(d.width=n.width),n.maxWidth&&(d.maxWidth=n.maxWidth),d});function c(d){const p=d.target.value;o("update:modelValue",p)}return(d,p)=>(r.openBlock(),r.createElementBlock("div",Zb,[r.createElementVNode("span",{style:r.normalizeStyle(l.value),class:"resizable-input__size-span"},r.toDisplayString(i.value),5),p[0]||(p[0]=r.createTextVNode()),r.createElementVNode("input",r.mergeProps(d.$attrs,{placeholder:d.placeholder,value:n.modelValue,disabled:n.disabled,style:l.value,onInput:c}),null,16,Wb)]))}}),Hb={class:"dropdown-tab-item__title text-caps13"},qb=r.defineComponent({__name:"TabItem",props:{option:{},isSelected:{type:Boolean,default:!1},isHovered:{type:Boolean,default:!1}},setup(t){const e=t,n=r.computed(()=>e.option.label),o=r.computed(()=>{const i=[];return e.isSelected&&i.push("dropdown-tab-item__selected"),e.isHovered&&i.push("hovered-item"),i.join(" ")});return(i,l)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass([o.value,"dropdown-tab-item"])},[r.createElementVNode("div",Hb,r.toDisplayString(n.value),1)],2))}}),Kb={class:"pl-line-dropdown__prefix"},Yb={class:"pl-line-dropdown__icon-wrapper"},Xb={class:"pl-line-dropdown__icon"},Jb={key:0,class:"pl-line-dropdown__no-item"},Qb={key:0,class:"pl-line-dropdown__no-item"},wp=r.defineComponent({__name:"PlDropdownLine",props:{modelValue:{},disabled:{type:Boolean},prefix:{default:""},options:{},placeholder:{default:"Select.."},mode:{default:"list"},tabsContainerStyles:{type:[Boolean,null,String,Object,Array],default:void 0},clearable:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{emit:e}){const n=e,o=t,i=r.reactive({isOpen:!1,activeOption:-1,optionsHeight:0}),l=r.ref(),c=r.ref(),d=r.computed(()=>{const $=[];return i.isOpen&&$.push("open"),o.disabled&&$.push("disabled"),$.join(" ")}),p=r.ref(""),h=Ub(r.toRef(o,"options"),p),m=r.computed(()=>!!(o.clearable&&i.isOpen&&o.modelValue&&y.value)),y=r.computed(()=>{if(o.modelValue){const $=S();if($!==-1){const j=_r(o.options)[$];return typeof j.label=="object"?j.label.title:j.label}}return""}),b=r.ref(y.value),w=r.computed(()=>i.isOpen&&p.value&&p.value.length>=y.value.length-1?p.value:y.value??"...");Ts(l,()=>{o.mode==="list"&&(i.isOpen=!1)}),r.watch(()=>b.value,$=>{y.value!==$?p.value=$:p.value=""}),r.watch(()=>i.isOpen,$=>{var j;$&&l.value&&((j=l.value.querySelector("input"))==null||j.focus(),r.nextTick(()=>Z()))}),r.watch(()=>o.modelValue,()=>M(),{immediate:!0});function S(){return o.options.findIndex($=>Mt($.value,o.modelValue))}function M(){i.activeOption=vi(h.value.findIndex($=>Mt($.value,o.modelValue)),$=>$<0?0:$),b.value=y.value}function O(){p.value=""}function C(){o.disabled?i.isOpen=!1:r.nextTick(()=>{i.isOpen=!i.isOpen})}function I(){o.mode==="list"&&(i.isOpen=!1)}function F($){$&&(n("update:modelValue",$.value),I(),O())}function W($){return Mt($.value,o.modelValue)}const P=$=>{var j,U;const k=$.relatedTarget;!((j=l.value)!=null&&j.contains(k))&&!((U=c.value)!=null&&U.contains(k))&&(p.value="",i.isOpen=!1)};function V($){const{activeOption:j}=i;if(!i.isOpen&&$.code==="Enter"){i.isOpen=!0;return}const{length:U}=h.value;if(!U)return;["ArrowDown","ArrowUp","Enter"].includes($.code)&&$.preventDefault(),$.code==="Enter"&&F(h.value[j]);const k=$.code==="ArrowDown"?1:$.code==="ArrowUp"?-1:0;i.activeOption=Math.abs(j+k+U)%U,requestAnimationFrame(Z)}function Z(){const $=c.value;$&&_t($.querySelector(".hovered-item"),j=>{o.mode==="list"?Vs($,j):j.scrollIntoView({behavior:"smooth",block:"nearest",inline:"center"})})}function J(){n("update:modelValue",void 0)}const ae=r.reactive({top:"0px",left:"0px"});return r.watch(c,$=>{if($){const j=$.getBoundingClientRect();i.optionsHeight=j.height,window.dispatchEvent(new CustomEvent("adjust"))}}),_i(l,$=>{const j=$.top+$.height+2;j+i.optionsHeight>$.clientHeight?ae.top=$.top-i.optionsHeight-2+"px":ae.top=j+"px",ae.left=$.left+"px"}),($,j)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"container",ref:l,tabindex:"0",class:r.normalizeClass([d.value,"pl-line-dropdown uc-pointer"]),onKeydown:V,onFocusout:P,onClick:C},[r.createElementVNode("div",Kb,r.toDisplayString(o==null?void 0:o.prefix),1),j[6]||(j[6]=r.createTextVNode()),r.createVNode(jb,{modelValue:b.value,"onUpdate:modelValue":j[0]||(j[0]=U=>b.value=U),placeholder:w.value,disabled:o.disabled,class:"pl-line-dropdown__input"},null,8,["modelValue","placeholder","disabled"]),j[7]||(j[7]=r.createTextVNode()),r.createElementVNode("div",Yb,[r.withDirectives(r.createElementVNode("div",Xb,null,512),[[r.vShow,!m.value]]),j[1]||(j[1]=r.createTextVNode()),r.withDirectives(r.createElementVNode("div",{class:"pl-line-dropdown__icon-clear",onClick:J},null,512),[[r.vShow,m.value]])]),j[8]||(j[8]=r.createTextVNode()),i.isOpen?(r.openBlock(),r.createBlock(r.Teleport,{key:0,to:"body"},[o.mode==="list"?(r.openBlock(),r.createElementBlock("div",{key:0,ref_key:"list",ref:c,style:r.normalizeStyle(ae),tabindex:"-1",class:"pl-line-dropdown__items",onFocusout:P},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(h),(U,k)=>r.renderSlot($.$slots,"item",{key:k,item:U,textItem:"text",isSelected:W(U),isHovered:i.activeOption==k,onClick:r.withModifiers(x=>F(U),["stop"])},()=>[r.createVNode(_o,{option:U,"text-item":"text","is-selected":W(U),"is-hovered":i.activeOption==k,size:"medium",onClick:r.withModifiers(x=>F(U),["stop"])},null,8,["option","is-selected","is-hovered","onClick"])])),128)),j[3]||(j[3]=r.createTextVNode()),r.unref(h).length===0?(r.openBlock(),r.createElementBlock("div",Jb,j[2]||(j[2]=[r.createElementVNode("div",{class:"pl-line-dropdown__no-item-title text-s"},"Didn't find anything that matched",-1)]))):r.createCommentVNode("",!0)],36)):o.mode==="tabs"?(r.openBlock(),r.createElementBlock("div",{key:1,ref_key:"list",ref:c,style:r.normalizeStyle(ae),tabindex:"-1",class:"pl-line-dropdown__items-tabs",onFocusout:P},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(h),(U,k)=>r.renderSlot($.$slots,"item",{key:k,item:U,isSelected:W(U),isHovered:i.activeOption==k,onClick:r.withModifiers(x=>F(U),["stop"])},()=>[r.createVNode(qb,{option:U,"is-selected":W(U),"is-hovered":i.activeOption==k,onClick:r.withModifiers(x=>F(U),["stop"])},null,8,["option","is-selected","is-hovered","onClick"])])),128)),j[5]||(j[5]=r.createTextVNode()),r.unref(h).length===0?(r.openBlock(),r.createElementBlock("div",Qb,j[4]||(j[4]=[r.createElementVNode("div",{class:"pl-line-dropdown__no-item-title text-s"},"Didn't find anything that matched",-1)]))):r.createCommentVNode("",!0)],36)):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0)],34))}}),ex={class:"ui-dropdown__envelope"},tx=["tabindex"],nx={class:"ui-dropdown__container"},rx={class:"ui-dropdown__field"},ox=["disabled","placeholder"],ix={class:"ui-dropdown__controls"},sx={key:0},ax={key:0,class:"required-icon"},lx={key:0,class:"nothing-found"},cx={key:0,class:"ui-dropdown__error"},dx={key:1,class:"ui-dropdown__helper"},ux={key:2,class:"ui-dropdown__helper"},px={name:"PlDropdown"},hx=r.defineComponent({...px,props:{modelValue:{},label:{default:""},options:{default:void 0},helper:{default:void 0},loadingOptionsHelper:{default:void 0},error:{default:void 0},placeholder:{default:"..."},clearable:{type:Boolean,default:!1},required:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},arrowIcon:{default:void 0},arrowIconLarge:{default:void 0},optionSize:{default:"small"}},emits:["update:modelValue"],setup(t,{emit:e}){const n=e,o=t,i=r.useSlots(),l=r.ref(),c=r.ref(),d=r.ref(),p=r.reactive({search:"",activeIndex:-1,open:!1}),h=()=>vi(F.value.findIndex(k=>Mt(k.value,o.modelValue)),k=>k<0?0:k),m=()=>p.activeIndex=h(),y=r.computed(()=>o.options===void 0),b=r.computed(()=>y.value?!0:o.disabled),w=r.computed(()=>(o.options??[]).findIndex(k=>Mt(k.value,o.modelValue))),S=r.computed(()=>{if(!y.value){if(o.error)return o.error;if(o.modelValue!==void 0&&w.value===-1)return"The selected value is not one of the options"}}),M=r.computed(()=>_r(o.options??[]).map((k,x)=>({...k,index:x,isSelected:x===w.value,isActive:x===p.activeIndex}))),O=r.computed(()=>{const k=r.unref(M).find(x=>Mt(x.value,o.modelValue));return(k==null?void 0:k.label)||o.modelValue}),C=r.computed(()=>!p.open&&o.modelValue?"":o.modelValue?String(O.value):o.placeholder),I=r.computed(()=>o.modelValue!==void 0&&o.modelValue!==null),F=r.computed(()=>{const k=M.value;return p.search?k.filter(x=>{const B=p.search.toLowerCase();return x.label.toLowerCase().includes(B)||x.description&&x.description.toLowerCase().includes(B)?!0:typeof x.value=="string"?x.value.toLowerCase().includes(B):x.value===p.search}):k}),W=r.computed(()=>b.value?void 0:"0"),P=k=>{var x;n("update:modelValue",k),p.search="",p.open=!1,(x=l==null?void 0:l.value)==null||x.focus()},V=()=>n("update:modelValue",void 0),Z=()=>{var k;return(k=d.value)==null?void 0:k.focus()},J=()=>p.open=!p.open,ae=()=>p.open=!0,$=k=>{var x;(x=l==null?void 0:l.value)!=null&&x.contains(k.relatedTarget)||(p.search="",p.open=!1)},j=()=>{const k=c.value;k&&_t(k.querySelector(".hovered-item"),x=>{Vs(k,x)})},U=k=>{var x,B;if(["ArrowDown","ArrowUp","Enter","Escape"].includes(k.code))k.preventDefault();else return;const{open:G,activeIndex:H}=p;if(!G){k.code==="Enter"&&(p.open=!0);return}k.code==="Escape"&&(p.open=!1,(x=l.value)==null||x.focus());const K=r.unref(F),{length:ne}=K;if(!ne)return;k.code==="Enter"&&P((B=K.find(He=>He.index===H))==null?void 0:B.value);const pe=K.findIndex(He=>He.index===H)??-1,ke=k.code==="ArrowDown"?1:k.code==="ArrowUp"?-1:0,Ee=Math.abs(pe+ke+ne)%ne;p.activeIndex=F.value[Ee].index??-1};return Yn(l),r.watch(()=>o.modelValue,m,{immediate:!0}),r.watch(()=>p.open,k=>{var x;return k?(x=d.value)==null?void 0:x.focus():""}),r.watchPostEffect(()=>{p.search,p.activeIndex>=0&&p.open&&j()}),(k,x)=>(r.openBlock(),r.createElementBlock("div",ex,[r.createElementVNode("div",{ref_key:"root",ref:l,tabindex:W.value,class:r.normalizeClass(["ui-dropdown",{open:p.open,error:k.error,disabled:b.value}]),onKeydown:U,onFocusout:$},[r.createElementVNode("div",nx,[r.createElementVNode("div",rx,[r.withDirectives(r.createElementVNode("input",{ref_key:"input",ref:d,"onUpdate:modelValue":x[0]||(x[0]=B=>p.search=B),type:"text",tabindex:"-1",disabled:b.value,placeholder:C.value,spellcheck:"false",autocomplete:"chrome-off",onFocus:ae},null,40,ox),[[r.vModelText,p.search]]),x[4]||(x[4]=r.createTextVNode()),p.open?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",{key:0,onClick:Z},[r.createVNode(Ol,{class:"input-value"},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(O.value),1)]),_:1})])),x[5]||(x[5]=r.createTextVNode()),r.createElementVNode("div",ix,[y.value?(r.openBlock(),r.createBlock(r.unref(Vt),{key:0,name:"loading"})):r.createCommentVNode("",!0),x[1]||(x[1]=r.createTextVNode()),k.clearable&&I.value?(r.openBlock(),r.createBlock(r.unref(Wr),{key:1,name:"delete-clear",onClick:r.withModifiers(V,["stop"])})):r.createCommentVNode("",!0),x[2]||(x[2]=r.createTextVNode()),r.renderSlot(k.$slots,"append"),x[3]||(x[3]=r.createTextVNode()),k.arrowIconLarge?(r.openBlock(),r.createElementBlock("div",{key:2,class:r.normalizeClass(["arrow-icon",[`icon-24 ${k.arrowIconLarge}`]]),onClick:r.withModifiers(J,["stop"])},null,2)):k.arrowIcon?(r.openBlock(),r.createElementBlock("div",{key:3,class:r.normalizeClass(["arrow-icon",[`icon-16 ${k.arrowIcon}`]]),onClick:r.withModifiers(J,["stop"])},null,2)):(r.openBlock(),r.createElementBlock("div",{key:4,class:"arrow-icon arrow-icon-default",onClick:r.withModifiers(J,["stop"])}))])]),x[9]||(x[9]=r.createTextVNode()),k.label?(r.openBlock(),r.createElementBlock("label",sx,[k.required?(r.openBlock(),r.createElementBlock("i",ax)):r.createCommentVNode("",!0),x[6]||(x[6]=r.createTextVNode()),r.createElementVNode("span",null,r.toDisplayString(k.label),1),x[7]||(x[7]=r.createTextVNode()),r.unref(i).tooltip?(r.openBlock(),r.createBlock(r.unref(vt),{key:1,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.renderSlot(k.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0),x[10]||(x[10]=r.createTextVNode()),p.open?(r.openBlock(),r.createElementBlock("div",{key:1,ref_key:"list",ref:c,class:"ui-dropdown__options"},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(F.value,(B,G)=>(r.openBlock(),r.createBlock(_o,{key:G,option:B,"is-selected":B.isSelected,"is-hovered":B.isActive,size:k.optionSize,onClick:r.withModifiers(H=>P(B.value),["stop"])},null,8,["option","is-selected","is-hovered","size","onClick"]))),128)),x[8]||(x[8]=r.createTextVNode()),F.value.length?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",lx,"Nothing found"))],512)):r.createCommentVNode("",!0),x[11]||(x[11]=r.createTextVNode()),r.createVNode(vr,{class:"ui-dropdown__contour"})])],42,tx),x[12]||(x[12]=r.createTextVNode()),S.value?(r.openBlock(),r.createElementBlock("div",cx,r.toDisplayString(S.value),1)):y.value&&k.loadingOptionsHelper?(r.openBlock(),r.createElementBlock("div",dx,r.toDisplayString(k.loadingOptionsHelper),1)):k.helper?(r.openBlock(),r.createElementBlock("div",ux,r.toDisplayString(k.helper),1)):r.createCommentVNode("",!0)]))}}),fx={key:0,class:"ui-progress-bar"},mx={class:"ui-progress-bar__messages d-flex align-center pl-6 pr-6"},gx={class:"ui-progress-bar__message flex-grow-1"},yx={class:"ui-progress-bar__percent"},_x=r.defineComponent({__name:"PlProgressBar",props:{loading:{type:Boolean},progress:{default:0},completeMessage:{default:"Completed"}},setup(t){const e=t,n=r.computed(()=>e.progress===100?e.completeMessage:"");return(o,i)=>o.loading?(r.openBlock(),r.createElementBlock("div",fx,[r.createElementVNode("div",{class:"ui-progress-bar__indicator",style:r.normalizeStyle({width:o.progress+"%"})},null,4),i[1]||(i[1]=r.createTextVNode()),r.createElementVNode("div",mx,[r.createElementVNode("div",gx,r.toDisplayString(n.value),1),i[0]||(i[0]=r.createTextVNode()),r.createElementVNode("div",yx,r.toDisplayString(o.progress+"%"),1)])])):r.createCommentVNode("",!0)}}),vx={class:"mi-number-field__main-wrapper d-flex"},Cx={class:"mi-number-field__wrapper flex-grow d-flex flex-align-center"},wx={key:0,class:"text-description"},bx=["disabled","placeholder"],xx={class:"mi-number-field__icons d-flex-column"},kx={key:0,class:"mi-number-field__hint text-description"},Ex=r.defineComponent({__name:"PlNumberField",props:{modelValue:{},disabled:{type:Boolean},label:{default:void 0},placeholder:{default:void 0},step:{default:1},minValue:{default:void 0},maxValue:{default:void 0},errorMessage:{default:void 0},validate:{type:Function,default:void 0}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,o=e,i=r.ref(),l=r.useSlots(),c=r.ref();Yn(i);const d=r.ref(!0),p=r.computed({get(){return d.value&&n.modelValue!==void 0?new Number(n.modelValue).toString():""},set(C){var I;C=C.replace(/,/g,""),b(C)?(o("update:modelValue",+C),C.toString()!==((I=n.modelValue)==null?void 0:I.toString())&&+C===n.modelValue&&C[C.length-1]!=="."&&(d.value=!1,r.nextTick(()=>{d.value=!0}))):(C.trim()===""&&o("update:modelValue",void 0),d.value=!1,r.nextTick(()=>{d.value=!0}))}}),h=r.computed(()=>{let C=[];return n.errorMessage&&C.push(n.errorMessage),b(n.modelValue)?(n.minValue!==void 0&&n.modelValue!==void 0&&n.modelValue<n.minValue&&C.push(`Model value must be higher than ${n.minValue}`),n.maxValue!==void 0&&n.modelValue!==void 0&&n.modelValue>n.maxValue&&C.push(`Model value must be less than ${n.maxValue}`)):C.push("Model value is not a number."),C=[...C],C.join(" ")}),m=r.computed(()=>!!(n.maxValue&&n.modelValue!==void 0&&(n.modelValue||0)+n.step>n.maxValue)),y=r.computed(()=>!!(n.minValue&&n.modelValue!==void 0&&(n.modelValue||0)-n.step<n.minValue));function b(C){return C!==void 0?(C=C==null?void 0:C.toString(),!isNaN(+C)&&!isNaN(parseFloat(C))):!1}function w(){if(!m.value){let C=0;n.modelValue===void 0?C=n.minValue?n.minValue:0:C=+(n.modelValue||0)+n.step,p.value=C.toString()}}function S(){if(!y.value){let C=0;n.modelValue===void 0?C=0:C=+(n.modelValue||0)-n.step,p.value=n.minValue?Math.max(n.minValue,C).toString():C.toString()}}function M(C){["ArrowDown","ArrowUp"].includes(C.code)&&C.preventDefault(),C.code==="ArrowUp"?w():C.code==="ArrowDown"&&S()}const O=C=>{C.detail>1&&C.preventDefault()};return(C,I)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"root",ref:i,class:r.normalizeClass([{error:!!h.value.trim(),disabled:C.disabled},"mi-number-field d-flex-column"]),onMousedown:O,onKeydown:I[1]||(I[1]=F=>M(F))},[r.createElementVNode("div",vx,[r.createVNode(vr,{class:"mi-number-field__contour"}),I[6]||(I[6]=r.createTextVNode()),r.createElementVNode("div",Cx,[C.label?(r.openBlock(),r.createElementBlock("label",wx,[r.createTextVNode(r.toDisplayString(C.label)+" ",1),r.unref(l).tooltip?(r.openBlock(),r.createBlock(r.unref(vt),{key:0,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.renderSlot(C.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0),I[2]||(I[2]=r.createTextVNode()),r.withDirectives(r.createElementVNode("input",{ref_key:"input",ref:c,"onUpdate:modelValue":I[0]||(I[0]=F=>p.value=F),disabled:C.disabled,placeholder:C.placeholder,class:"text-s flex-grow"},null,8,bx),[[r.vModelText,p.value]])]),I[7]||(I[7]=r.createTextVNode()),r.createElementVNode("div",xx,[r.createElementVNode("div",{class:r.normalizeClass([{disabled:m.value},"mi-number-field__icon d-flex flex-justify-center uc-pointer flex-grow flex-align-center"]),onClick:w},I[3]||(I[3]=[r.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},[r.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M8 4.93933L13.5303 10.4697L12.4697 11.5303L8 7.06065L3.53033 11.5303L2.46967 10.4697L8 4.93933Z",fill:"#110529"})],-1)]),2),I[5]||(I[5]=r.createTextVNode()),r.createElementVNode("div",{class:r.normalizeClass([{disabled:y.value},"mi-number-field__icon d-flex flex-justify-center uc-pointer flex-grow flex-align-center"]),onClick:S},I[4]||(I[4]=[r.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},[r.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M2.46967 6.53033L3.53033 5.46967L8 9.93934L12.4697 5.46967L13.5303 6.53033L8 12.0607L2.46967 6.53033Z",fill:"#110529"})],-1)]),2)])]),I[8]||(I[8]=r.createTextVNode()),h.value.trim()?(r.openBlock(),r.createElementBlock("div",kx,r.toDisplayString(h.value),1)):r.createCommentVNode("",!0)],34))}}),Sx={class:"pl-chip__text"},$l=r.defineComponent({__name:"PlChip",props:{closeable:{type:Boolean},small:{type:Boolean}},emits:["close"],setup(t){const e=r.ref(),n=r.ref(!1);return r.onMounted(()=>{var o;e.value&&(n.value=((o=e.value)==null?void 0:o.clientWidth)>=256)}),(o,i)=>(r.openBlock(),r.createBlock(r.unref(vt),{position:"top",class:"pl-chip-tooltip",delay:500},r.createSlots({default:r.withCtx(()=>[i[4]||(i[4]=r.createTextVNode()),r.createElementVNode("div",{ref_key:"chip",ref:e,class:r.normalizeClass(["pl-chip",{small:o.small}])},[r.createElementVNode("div",Sx,[r.renderSlot(o.$slots,"default")]),i[3]||(i[3]=r.createTextVNode()),o.closeable?(r.openBlock(),r.createElementBlock("div",{key:0,tabindex:"0",class:"pl-chip__close",onKeydown:i[0]||(i[0]=r.withKeys(l=>o.$emit("close"),["enter"])),onClick:i[1]||(i[1]=r.withModifiers(l=>o.$emit("close"),["stop"]))},i[2]||(i[2]=[r.createElementVNode("div",{class:"pl-chip__close--icon"},null,-1)]),32)):r.createCommentVNode("",!0)],2)]),_:2},[n.value?{name:"tooltip",fn:r.withCtx(()=>[r.renderSlot(o.$slots,"default")]),key:"0"}:void 0]),1024))}}),Tx={class:"pl-multi-dropdown__envelope"},Nx=["tabindex"],Vx={class:"pl-multi-dropdown__container"},Ax={class:"pl-multi-dropdown__field"},Bx=["disabled","placeholder"],Px={class:"pl-multi-dropdown__append"},Rx={key:0},Dx={key:0,class:"required-icon"},Ix={class:"pl-multi-dropdown__open-chips-container"},Fx={key:0,class:"nothing-found"},Lx={key:0,class:"pl-multi-dropdown__error"},Ox={key:1,class:"pl-multi-dropdown__helper"},Mx={name:"PlDropdownMulti"},Gx=r.defineComponent({...Mx,props:{modelValue:{default:()=>[]},label:{default:void 0},options:{},helper:{default:void 0},error:{default:void 0},placeholder:{default:"..."},required:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{emit:e}){const n=e,o=V=>n("update:modelValue",V),i=r.useSlots(),l=t,c=r.ref(),d=r.ref(),p=r.useTemplateRef("overlay"),h=r.reactive({search:"",activeOption:-1,open:!1,optionsHeight:0}),m=r.computed(()=>Array.isArray(l.modelValue)?l.modelValue:[]),y=r.computed(()=>h.open&&l.modelValue.length>0?l.placeholder:l.modelValue.length>0?"":l.placeholder),b=r.computed(()=>_r(l.options).filter(V=>Ll(m.value,V.value))),w=r.computed(()=>{const V=r.unref(m),Z=_r(l.options);return(h.search?Z.filter(J=>{const ae=h.search.toLowerCase();return J.label.toLowerCase().includes(ae)?!0:typeof J.value=="string"?J.value.toLowerCase().includes(ae):J.value===h.search}):[...Z]).map(J=>({...J,selected:Ll(V,J.value)}))}),S=r.computed(()=>l.disabled?void 0:"0"),M=()=>{h.activeOption=vi(w.value.findIndex(V=>Mt(V.value,l.modelValue)),V=>V<0?0:V)},O=V=>{var Z;const J=r.unref(m);o(Ll(J,V)?J.filter(ae=>!Mt(ae,V)):[...J,V]),h.search="",(Z=c==null?void 0:c.value)==null||Z.focus()},C=V=>o(r.unref(m).filter(Z=>!Mt(Z,V))),I=()=>{var V;return(V=d.value)==null?void 0:V.focus()},F=()=>h.open=!h.open,W=V=>{var Z,J,ae,$;const j=V.relatedTarget;console.log(">>>> overlay.value?.$el",(Z=p.value)==null?void 0:Z.$el),!((J=c.value)!=null&&J.contains(j))&&!(($=(ae=p.value)==null?void 0:ae.listRef)!=null&&$.contains(j))&&(h.search="",h.open=!1)},P=V=>{var Z;const{open:J,activeOption:ae}=h;if(!J){V.code==="Enter"&&(h.open=!0);return}V.code==="Escape"&&(h.open=!1,(Z=c.value)==null||Z.focus());const $=r.unref(w),{length:j}=$;if(!j)return;["ArrowDown","ArrowUp","Enter"].includes(V.code)&&V.preventDefault(),V.code==="Enter"&&O($[ae].value);const U=V.code==="ArrowDown"?1:V.code==="ArrowUp"?-1:0;h.activeOption=Math.abs(ae+U+j)%j,requestAnimationFrame(()=>{var k;return(k=p.value)==null?void 0:k.scrollIntoActive()})};return Yn(c),r.watch(()=>l.modelValue,()=>M(),{immediate:!0}),r.watchPostEffect(()=>{var V;h.search,h.open&&((V=p.value)==null||V.scrollIntoActive())}),(V,Z)=>(r.openBlock(),r.createElementBlock("div",Tx,[r.createElementVNode("div",{ref_key:"rootRef",ref:c,tabindex:S.value,class:r.normalizeClass(["pl-multi-dropdown",{open:h.open,error:V.error,disabled:V.disabled}]),onKeydown:P,onFocusout:W},[r.createElementVNode("div",Vx,[r.createElementVNode("div",Ax,[r.withDirectives(r.createElementVNode("input",{ref_key:"input",ref:d,"onUpdate:modelValue":Z[0]||(Z[0]=J=>h.search=J),type:"text",tabindex:"-1",disabled:V.disabled,placeholder:y.value,spellcheck:"false",autocomplete:"chrome-off",onFocus:Z[1]||(Z[1]=J=>h.open=!0)},null,40,Bx),[[r.vModelText,h.search]]),Z[3]||(Z[3]=r.createTextVNode()),h.open?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",{key:0,class:"chips-container",onClick:I},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(b.value,(J,ae)=>(r.openBlock(),r.createBlock(r.unref($l),{key:ae,closeable:"",small:"",onClick:Z[2]||(Z[2]=r.withModifiers($=>h.open=!0,["stop"])),onClose:$=>C(J.value)},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(J.label||J.value),1)]),_:2},1032,["onClose"]))),128))])),Z[4]||(Z[4]=r.createTextVNode()),r.createElementVNode("div",{class:"arrow",onClick:r.withModifiers(F,["stop"])}),Z[5]||(Z[5]=r.createTextVNode()),r.createElementVNode("div",Px,[r.renderSlot(V.$slots,"append")])]),Z[10]||(Z[10]=r.createTextVNode()),V.label?(r.openBlock(),r.createElementBlock("label",Rx,[V.required?(r.openBlock(),r.createElementBlock("i",Dx)):r.createCommentVNode("",!0),Z[6]||(Z[6]=r.createTextVNode()),r.createElementVNode("span",null,r.toDisplayString(V.label),1),Z[7]||(Z[7]=r.createTextVNode()),r.unref(i).tooltip?(r.openBlock(),r.createBlock(r.unref(vt),{key:1,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.renderSlot(V.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0),Z[11]||(Z[11]=r.createTextVNode()),h.open?(r.openBlock(),r.createBlock(Gl,{key:1,ref_key:"overlay",ref:p,root:c.value,class:"pl-multi-dropdown__options",gap:3,tabindex:"-1",onFocusout:W},{default:r.withCtx(()=>[r.createElementVNode("div",Ix,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(b.value,(J,ae)=>(r.openBlock(),r.createBlock(r.unref($l),{key:ae,closeable:"",small:"",onClose:$=>C(J.value)},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(J.label||J.value),1)]),_:2},1032,["onClose"]))),128))]),Z[8]||(Z[8]=r.createTextVNode()),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(w.value,(J,ae)=>(r.openBlock(),r.createBlock(_o,{key:ae,option:J,"text-item":"text","is-selected":J.selected,"is-hovered":h.activeOption==ae,size:"medium","use-checkbox":"",onClick:r.withModifiers($=>O(J.value),["stop"])},null,8,["option","is-selected","is-hovered","onClick"]))),128)),Z[9]||(Z[9]=r.createTextVNode()),w.value.length?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",Fx,"Nothing found"))]),_:1},8,["root"])):r.createCommentVNode("",!0),Z[12]||(Z[12]=r.createTextVNode()),r.createVNode(vr,{class:"pl-multi-dropdown__contour"})])],42,Nx),Z[13]||(Z[13]=r.createTextVNode()),V.error?(r.openBlock(),r.createElementBlock("div",Lx,r.toDisplayString(V.error),1)):V.helper?(r.openBlock(),r.createElementBlock("div",Ox,r.toDisplayString(V.helper),1)):r.createCommentVNode("",!0)]))}}),zl=r.defineComponent({__name:"PlCheckboxBase",props:{modelValue:{type:Boolean},disabled:{type:Boolean}},emits:["update:modelValue"],setup(t){const e=t,n=r.computed(()=>e.modelValue);return(o,i)=>(r.openBlock(),r.createElementBlock("div",{tabindex:"0",class:r.normalizeClass(["pl-checkbox-base",{checked:n.value,disabled:o.disabled}]),onClick:i[0]||(i[0]=l=>o.$emit("update:modelValue",!o.modelValue)),onKeydown:i[1]||(i[1]=r.withKeys(l=>o.$emit("update:modelValue",!o.modelValue),["enter"]))},null,34))}}),$x={name:"PlCheckbox"},zx=r.defineComponent({...$x,props:{modelValue:{type:Boolean},disabled:{type:Boolean}},emits:["update:modelValue"],setup(t){const e=t,n=r.useSlots();return(o,i)=>r.unref(n).default?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(["pl-checkbox",{disabled:o.disabled}])},[r.createVNode(zl,r.mergeProps(e,{"onUpdate:modelValue":i[0]||(i[0]=l=>o.$emit("update:modelValue",l))}),null,16),i[3]||(i[3]=r.createTextVNode()),r.createElementVNode("label",{onClick:i[1]||(i[1]=l=>o.$emit("update:modelValue",!o.$props.modelValue))},[r.renderSlot(o.$slots,"default")])],2)):(r.openBlock(),r.createBlock(zl,r.mergeProps({key:1},e,{"onUpdate:modelValue":i[2]||(i[2]=l=>o.$emit("update:modelValue",l))}),null,16))}}),Ux={key:0},Zx=["onClick"],Wx={name:"PlCheckboxGroup"},jx=r.defineComponent({...Wx,props:{modelValue:{},label:{},options:{},disabled:{type:Boolean}},emits:["update:modelValue"],setup(t,{emit:e}){const n=e,o=t,i=c=>o.modelValue.includes(c),l=c=>{const d=o.modelValue??[];n("update:modelValue",i(c)?d.filter(p=>p!==c):[...d,c])};return(c,d)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["ui-checkbox-group",{disabled:c.disabled}])},[c.label?(r.openBlock(),r.createElementBlock("label",Ux,r.toDisplayString(c.label),1)):r.createCommentVNode("",!0),d[1]||(d[1]=r.createTextVNode()),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(c.options.map(p=>({label:"label"in p?p.label:p.text,value:p.value})),(p,h)=>(r.openBlock(),r.createElementBlock("div",{key:h},[r.createVNode(zl,{disabled:c.disabled,label:p.label,"model-value":i(p.value),"onUpdate:modelValue":()=>l(p.value)},null,8,["disabled","label","model-value","onUpdate:modelValue"]),d[0]||(d[0]=r.createTextVNode()),r.createElementVNode("label",{onClick:r.withModifiers(()=>l(p.value),["stop"])},r.toDisplayString(p.label),9,Zx)]))),128))],2))}}),Hx="_component_tupwt_1",qx={component:Hx},Kx={};function Yx(t,e){return r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(t.$style.component)},e[0]||(e[0]=[r.createElementVNode("div",null,null,-1)]),2)}const Xx={$style:qx},bp=Ot(Kx,[["render",Yx],["__cssModules",Xx]]),Jx={key:1,class:"pl-dialog-modal__title"},Qx={inheritAttrs:!1},Ul=r.defineComponent({...Qx,__name:"PlDialogModal",props:{modelValue:{type:Boolean},width:{default:"448px"},height:{default:"auto"},minHeight:{default:"auto"},maxHeight:{default:"auto"},closable:{type:Boolean,default:!0},noContentGutters:{type:Boolean,default:!1},noTopContentGutter:{type:Boolean},actionsHasTopBorder:{type:Boolean,default:!0},closeOnOutsideClick:{type:Boolean}},emits:["update:modelValue"],setup(t,{emit:e}){const n=r.useSlots(),o=e,i=t,l=r.ref(),c=r.useAttrs();function d(p){l.value&&i.closeOnOutsideClick&&document.contains(p.target)&&!l.value.contains(p.target)&&o("update:modelValue",!1)}return st(document.body,"keyup",p=>{i.modelValue&&p.code==="Escape"&&o("update:modelValue",!1)}),(p,h)=>(r.openBlock(),r.createBlock(r.Teleport,{to:"body"},[r.createVNode(r.Transition,{name:"dialog"},{default:r.withCtx(()=>[p.modelValue?(r.openBlock(),r.createElementBlock("div",{key:0,class:"pl-dialog-modal__shadow",onClick:d},[r.createElementVNode("div",r.mergeProps(r.unref(c),{ref_key:"modal",ref:l,class:["pl-dialog-modal",{"has-title":r.unref(n).title,"has-content":r.unref(n).default}],style:{width:p.width,height:p.height,minHeight:p.minHeight,maxHeight:p.maxHeight}}),[p.closable?(r.openBlock(),r.createBlock(bp,{key:0,class:"close-modal-btn",onClick:h[0]||(h[0]=r.withModifiers(m=>o("update:modelValue",!1),["stop"]))})):r.createCommentVNode("",!0),h[1]||(h[1]=r.createTextVNode()),r.unref(n).title?(r.openBlock(),r.createElementBlock("div",Jx,[r.renderSlot(p.$slots,"title")])):r.createCommentVNode("",!0),h[2]||(h[2]=r.createTextVNode()),r.createElementVNode("div",{class:r.normalizeClass(["pl-dialog-modal__content",{"no-content-gutters":p.noContentGutters,"no-top-content-gutter":p.noTopContentGutter}])},[r.renderSlot(p.$slots,"default")],2),h[3]||(h[3]=r.createTextVNode()),r.unref(n).actions?(r.openBlock(),r.createElementBlock("div",{key:2,class:r.normalizeClass(["pl-dialog-modal__actions",{"has-top-border":p.actionsHasTopBorder}])},[r.renderSlot(p.$slots,"actions")],2)):r.createCommentVNode("",!0)],16)])):r.createCommentVNode("",!0)]),_:3})]))}}),ek=r.defineComponent({__name:"TransitionSlidePanel",setup(t){function e(){window.dispatchEvent(new CustomEvent("adjust"))}function n(){window.dispatchEvent(new CustomEvent("adjust"))}return(o,i)=>(r.openBlock(),r.createBlock(r.Transition,{name:"slide-panel",onAfterEnter:e,onAfterLeave:n},{default:r.withCtx(()=>[r.renderSlot(o.$slots,"default")]),_:3}))}}),tk={key:0,class:"pl-slide-modal__title"},nk={class:"pl-slide-modal__content"},rk={key:1,class:"pl-slide-modal__actions"},ok={name:"PlSlideModal",inheritAttrs:!1},As=r.defineComponent({...ok,props:{modelValue:{type:Boolean,default:!1},width:{default:"368px"},shadow:{type:Boolean,default:!1},closeOnOutsideClick:{type:Boolean,default:!0}},emits:["update:modelValue"],setup(t,{emit:e}){const n=r.useSlots(),o=e,i=t,l=r.ref(),c=r.useAttrs();return Ts(l,()=>{i.modelValue&&i.closeOnOutsideClick&&o("update:modelValue",!1)}),st(document,"keydown",d=>{d.key==="Escape"&&o("update:modelValue",!1)}),(d,p)=>(r.openBlock(),r.createBlock(r.Teleport,{to:"body"},[r.createVNode(ek,null,{default:r.withCtx(()=>[d.modelValue?(r.openBlock(),r.createElementBlock("div",r.mergeProps({key:0,ref_key:"modal",ref:l,style:{width:d.width}},r.unref(c),{class:["pl-slide-modal",{"has-title":r.unref(n).title,"has-actions":r.unref(n).actions}],onKeyup:p[1]||(p[1]=r.withKeys(h=>o("update:modelValue",!1),["esc"]))}),[r.createElementVNode("div",{class:"close-dialog-btn",onClick:p[0]||(p[0]=h=>o("update:modelValue",!1))}),p[3]||(p[3]=r.createTextVNode()),r.unref(n).title?(r.openBlock(),r.createElementBlock("div",tk,[r.renderSlot(d.$slots,"title")])):r.createCommentVNode("",!0),p[4]||(p[4]=r.createTextVNode()),r.createElementVNode("div",nk,[r.renderSlot(d.$slots,"default")]),p[5]||(p[5]=r.createTextVNode()),r.unref(n).actions?(r.openBlock(),r.createElementBlock("div",rk,[r.renderSlot(d.$slots,"actions")])):r.createCommentVNode("",!0)],16)):r.createCommentVNode("",!0)]),_:3}),p[6]||(p[6]=r.createTextVNode()),d.modelValue&&d.shadow?(r.openBlock(),r.createElementBlock("div",{key:0,class:"pl-slide-modal__shadow",onKeyup:p[2]||(p[2]=r.withKeys(h=>o("update:modelValue",!1),["esc"]))},null,32)):r.createCommentVNode("",!0)]))}}),ik={key:0,class:"label"},sk={name:"PlToggleSwitch"},Bs=r.defineComponent({...sk,props:{label:{},modelValue:{type:Boolean}},emits:["update:modelValue"],setup(t){return(e,n)=>(r.openBlock(),r.createElementBlock("div",{tabindex:"0",class:r.normalizeClass(["ui-toggle-switch",{active:e.modelValue}]),onClick:n[0]||(n[0]=o=>e.$emit("update:modelValue",!e.modelValue)),onKeydown:n[1]||(n[1]=r.withKeys(o=>e.$emit("update:modelValue",!e.modelValue),["enter"]))},[n[2]||(n[2]=r.createElementVNode("div",{class:"ui-toggle-switch__body"},[r.createElementVNode("div",{class:"ui-toggle-switch__handle"})],-1)),n[3]||(n[3]=r.createTextVNode()),e.label?(r.openBlock(),r.createElementBlock("span",ik,r.toDisplayString(e.label),1)):r.createCommentVNode("",!0)],34))}});function xp(t){return r.getCurrentScope()?(r.onScopeDispose(t),!0):!1}function ak(t){return r.unref(t)}const lk=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;function ck(t,e,n={}){const{immediate:o=!0}=n,i=r.ref(!1);let l=null;function c(){l&&(clearTimeout(l),l=null)}function d(){i.value=!1,c()}function p(...h){c(),i.value=!0,l=setTimeout(()=>{i.value=!1,l=null,t(...h)},ak(e))}return o&&(i.value=!0,lk&&p()),xp(d),{isPending:r.readonly(i),start:p,stop:d}}function dk(t,e,n){return r.watch(t,(o,i,l)=>{o&&e(o,i,l)},{...n,once:!1})}function uk(t,e,n){const{start:o}=ck(l,e,{immediate:!1}),i=r.ref(!1);async function l(){i.value&&(await t(),o())}function c(){i.value||(i.value=!0,l())}function d(){i.value=!1}return n!=null&&n.immediate&&c(),xp(d),{isActive:i,pause:d,resume:c}}const pk="[==PROGRESS==]";function hk(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function fk(t){const e=r.ref(),n=r.reactive({errorCount:0});async function o(){var l;let c=e.value;if(c===void 0)return;const d=t.mockPlatforma??window.platforma;if(!d){console.warn("Platforma API is not available");return}for(;;){const p=await d.logDriver.readText(c.logHandle,100,c.lastOffset);if(c.error=void 0,n.errorCount=0,p.shouldUpdateHandle||c.logHandle!==((l=e.value)==null?void 0:l.logHandle))return;const h=t.progressPrefix??pk,m=new TextDecoder().decode(p.data).replace(new RegExp(`${hk(h)}`,"g"),"");if(c=Object.assign(c,{lines:c.lines+m,lastOffset:p.newOffset,finished:!p.live}),p.newOffset>=p.size)break}}const i=uk(()=>o().catch(l=>{e.value&&(n.errorCount++,n.errorCount>(t.maxRetries??3)?e.value.error=l:console.warn("skip error:",l,"retry..."))}),1500,{immediate:!1});return dk(()=>{var l;return(l=e==null?void 0:e.value)==null?void 0:l.finished},()=>i.pause()),r.watch(()=>t.logHandle,l=>{var c;l===void 0?(e.value=void 0,i.pause()):l!==((c=e.value)==null?void 0:c.logHandle)&&(e.value={logHandle:l,lastOffset:0,lines:"",finished:!1,error:void 0},n.errorCount=0,i.resume())},{immediate:!0}),e}const mk={key:0},gk={class:"pl-log-view__copy"},yk={key:1,class:"pl-log-view__error"},_k={name:"PlLogView"},kp=r.defineComponent({..._k,props:{value:{},logHandle:{},progressPrefix:{},error:{},output:{},maxRetries:{},mockPlatforma:{},label:{}},setup(t){const e=S=>{if(S&&S.ok===!1)return S.errors.join(`
53
- `)},n=t,o=fk(n),i=r.ref(!0),l=r.ref(),c=r.ref(),d=r.computed(()=>{var S;return((S=o.value)==null?void 0:S.error)??n.error??e(n.output)}),p=r.computed(()=>{var S;return((S=o.value)==null?void 0:S.lines)??n.value??Yv(n.output)}),h=r.ref(!1);Yn(c);const m=r.computed(()=>h.value?"clipboard-copied":"clipboard"),y=()=>{h.value=!0,setTimeout(()=>{h.value=!1},1200),p.value&&typeof p.value=="string"&&navigator.clipboard.writeText(p.value)},b=()=>{gr(l.value,S=>{i.value&&S.scrollTo(S.scrollLeft,S.scrollHeight)})};r.watch(p,()=>{requestAnimationFrame(()=>{b()})},{immediate:!0});const w=S=>{const M=S.target;i.value=M.scrollTop+20>=M.scrollHeight-M.offsetHeight};return(S,M)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"root",ref:c,class:r.normalizeClass(["pl-log-view",{"has-error":d.value}])},[S.label?(r.openBlock(),r.createElementBlock("label",mk,r.toDisplayString(S.label),1)):r.createCommentVNode("",!0),M[1]||(M[1]=r.createTextVNode()),r.createVNode(vr,{class:"pl-log-view__contour"}),M[2]||(M[2]=r.createTextVNode()),r.createElementVNode("div",gk,[r.createVNode(r.unref(vt),{"close-delay":800,position:"top"},{tooltip:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(h.value?"copied":"copy"),1)]),default:r.withCtx(()=>[r.createVNode(r.unref(Vt),{title:"Copy content",name:m.value,onClick:y},null,8,["name"]),M[0]||(M[0]=r.createTextVNode())]),_:1})]),M[3]||(M[3]=r.createTextVNode()),d.value?(r.openBlock(),r.createElementBlock("div",yk,r.toDisplayString(d.value),1)):(r.openBlock(),r.createElementBlock("div",{key:2,ref_key:"contentRef",ref:l,class:"pl-log-view__content",onScroll:w},r.toDisplayString(p.value),545))],2))}}),vk="_component_1ukal_1",Ck="_tab_1ukal_14",wk="_disabled_1ukal_27",bk="_active_1ukal_56",xk="_topLine_1ukal_69",wo={component:vk,tab:Ck,disabled:wk,active:bk,topLine:xk},kk=r.defineComponent({__name:"Tab",props:{option:{}},setup(t){const e=r.ref(),n=r.reactive({isOverflown:!1});return r.onMounted(()=>{const o=r.unref(e);if(!o)return;const i=o.$el.querySelector("span");i&&requestAnimationFrame(()=>{i.offsetWidth<i.scrollWidth&&(n.isOverflown=!0)})}),(o,i)=>(r.openBlock(),r.createBlock(r.unref(vt),{ref_key:"rootRef",ref:e,element:"div",position:"top",hide:!n.isOverflown,"close-delay":300,"data-is-overflown":n.isOverflown?"true":"false"},{tooltip:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(o.option.label),1)]),default:r.withCtx(()=>[r.renderSlot(o.$slots,"default"),i[0]||(i[0]=r.createTextVNode())]),_:3},8,["hide","data-is-overflown"]))}}),Ek={name:"PlTabs"},Sk=r.defineComponent({...Ek,props:{modelValue:{},options:{},disabled:{type:Boolean},topLine:{type:Boolean},maxTabWidth:{}},emits:["update:modelValue"],setup(t,{emit:e}){const n=e,o=i=>n("update:modelValue",i);return(i,l)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass([r.unref(wo).component,{[r.unref(wo).disabled]:i.disabled,[r.unref(wo).topLine]:i.topLine}])},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(i.options,(c,d)=>(r.openBlock(),r.createBlock(kk,{key:d,tabindex:i.modelValue===c.value||i.disabled||c.disabled?void 0:0,option:c,class:r.normalizeClass([{[r.unref(wo).active]:i.modelValue===c.value,[r.unref(wo).disabled]:c.disabled},r.unref(wo).tab]),style:r.normalizeStyle({"--pl-tabs-item-max-width":c.maxWidth??i.maxTabWidth}),onKeydown:r.withKeys(p=>o(c.value),["enter"]),onClick:p=>o(c.value)},{default:r.withCtx(()=>[r.renderSlot(i.$slots,c.value,{option:c},()=>[r.createElementVNode("span",null,r.toDisplayString(c.label),1)])]),_:2},1032,["tabindex","option","class","style","onKeydown","onClick"]))),128))],2))}}),Tk=r.defineComponent({__name:"PlSectionSeparator",props:{compact:{type:Boolean}},setup(t){return(e,n)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["pl-section-separator",{[e.$style.compact]:e.compact}])},[r.createElementVNode("div",{class:r.normalizeClass(e.$style.content)},[r.renderSlot(e.$slots,"default")],2)],2))}}),Nk="_compact_rhd5u_16",Vk="_content_rhd5u_20",Ak={compact:Nk,content:Vk},Bk={$style:Ak},Ep=Ot(Tk,[["__cssModules",Bk]]),Pk=r.defineComponent({__name:"PlAccordion",props:r.mergeModels({multiple:{type:Boolean}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=r.useModel(t,"modelValue"),n=t;return r.provide("pl-accordion-model",e),r.provide("pl-accordion-props",r.toRef(n)),(o,i)=>(r.openBlock(),r.createElementBlock(r.Fragment,null,[r.renderSlot(o.$slots,"header"),i[0]||(i[0]=r.createTextVNode()),r.renderSlot(o.$slots,"default")],64))}}),Rk=r.defineComponent({__name:"ExpandTransition",setup(t){const e=o=>{o.style.setProperty("--component-height",o.scrollHeight+"px"),o.classList.add("expand-collapse-fix")},n=o=>{o.style.removeProperty("--component-height"),o.classList.remove("expand-collapse-fix")};return(o,i)=>(r.openBlock(),r.createBlock(r.Transition,{name:"expand-collapse",onEnter:e,onLeave:e,onAfterEnter:n,onAfterLeave:n},{default:r.withCtx(()=>[r.renderSlot(o.$slots,"default")]),_:3}))}}),Dk=r.defineComponent({__name:"PlAccordionSection",props:r.mergeModels({label:{},compact:{type:Boolean}},{modelValue:{type:Boolean},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=r.inject("pl-accordion-model"),n=r.inject("pl-accordion-props"),o=r.useModel(t,"modelValue"),i=Zu(),l=r.computed(()=>!n||n.value.multiple),c=r.computed({get(){return l.value?o.value:e?e.value===i:o.value},set(d){l.value?o.value=d:e&&(e.value=e.value===i?"":i)}});return(d,p)=>(r.openBlock(),r.createElementBlock(r.Fragment,null,[r.createVNode(r.unref(Ep),{class:r.normalizeClass(d.$style.separator),compact:d.compact,onClick:p[0]||(p[0]=h=>c.value=!c.value)},{default:r.withCtx(()=>[r.createVNode(r.unref(nn),{name:"chevron-right",class:r.normalizeClass([{[d.$style.down]:c.value},d.$style.chevron])},null,8,["class"]),r.createTextVNode(" "+r.toDisplayString(d.label),1)]),_:1},8,["class","compact"]),p[1]||(p[1]=r.createTextVNode()),r.createVNode(Rk,null,{default:r.withCtx(()=>[c.value?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(d.$style.content)},[r.renderSlot(d.$slots,"default")],2)):r.createCommentVNode("",!0)]),_:3})],64))}}),Ik="_content_jmjfk_2",Fk="_separator_jmjfk_14",Lk="_chevron_jmjfk_19",Ok="_down_jmjfk_23",Mk={content:Ik,separator:Fk,chevron:Lk,down:Ok},Gk={$style:Mk},$k=Ot(Dk,[["__cssModules",Gk]]),zk="_component_1ietr_1",Uk="_local_1ietr_1",Zk="_supported_1ietr_26",Wk="_remote_1ietr_32",jk="_search_1ietr_40",Hk="_selected_1ietr_72",qk="_breadcrumbs_1ietr_86",Kk="_cat_1ietr_116",Yk="_message_1ietr_122",Xk="_isFile_1ietr_197",Jk="_isDir_1ietr_201",Qk="_canBeSelected_1ietr_207",eE="_spin_1ietr_1",ct={component:zk,local:Uk,supported:Zk,remote:Wk,search:jk,"ls-container":"_ls-container_1ietr_50","ls-head":"_ls-head_1ietr_57",selected:Hk,breadcrumbs:qk,"ls-error":"_ls-error_1ietr_108",cat:Kk,message:Yk,"ls-empty":"_ls-empty_1ietr_131","ls-body":"_ls-body_1ietr_152",isFile:Xk,isDir:Jk,canBeSelected:Qk,"ls-loader":"_ls-loader_1ietr_213","loader-icon":"_loader-icon_1ietr_221",spin:eE},tE=r.defineComponent({__name:"Shortcuts",setup(t){return(e,n)=>(r.openBlock(),r.createBlock(r.unref(vt),{class:"info",position:"southwest","max-width":"420px"},{tooltip:r.withCtx(()=>[r.createElementVNode("span",{class:r.normalizeClass(e.$style.title)},"Shortcuts",2),n[2]||(n[2]=r.createTextVNode()),r.createElementVNode("div",{class:r.normalizeClass([e.$style.row,e.$style.head])},n[0]||(n[0]=[r.createElementVNode("div",null,null,-1),r.createTextVNode(),r.createElementVNode("div",null,"MacOS",-1),r.createTextVNode(),r.createElementVNode("div",null,"Windows/Linux",-1)]),2),n[3]||(n[3]=r.createTextVNode()),r.createElementVNode("div",{class:r.normalizeClass([e.$style.row,e.$style.body])},n[1]||(n[1]=[r.createElementVNode("div",null,"Single File",-1),r.createTextVNode(),r.createElementVNode("div",null,"Click the file",-1),r.createTextVNode(),r.createElementVNode("div",null,"Click the file",-1),r.createTextVNode(),r.createElementVNode("div",null,"Adjacent multiple files",-1),r.createTextVNode(),r.createElementVNode("div",null,"Hold Shift, click first and last files",-1),r.createTextVNode(),r.createElementVNode("div",null,"Hold Shift, click first and last files",-1),r.createTextVNode(),r.createElementVNode("div",null,"Non-adjacent multiple files",-1),r.createTextVNode(),r.createElementVNode("div",null,"Hold Command (⌘), click each file",-1),r.createTextVNode(),r.createElementVNode("div",null,"Hold Ctrl, click each file",-1),r.createTextVNode(),r.createElementVNode("div",null,"All files",-1),r.createTextVNode(),r.createElementVNode("div",null,"Press Command (⌘) + A",-1),r.createTextVNode(),r.createElementVNode("div",null,"Press Ctrl + A",-1)]),2)]),_:1}))}}),nE="_title_14dct_2",rE="_row_14dct_10",oE="_head_14dct_30",iE="_body_14dct_58",sE={title:nE,row:rE,head:oE,body:iE},aE={$style:sE},lE=Ot(tE,[["__cssModules",aE]]),Sp=()=>({dirPath:"",search:"",storageEntry:void 0,items:[],error:"",storageOptions:[],selected:[],lastSelected:void 0,currentLoadingPath:void 0,showHiddenItems:!1});function cE(t){return r.computed(()=>{let e=t.items;if(t.showHiddenItems||(e=e.filter(n=>!n.name.startsWith("."))),t.search){const n=t.search.toLocaleLowerCase();e=e.filter(o=>o.name.toLocaleLowerCase().includes(n))}return e})}const Tp={mounted:t=>{if(t.clientWidth<t.scrollWidth){const e=t.innerText;t.innerText=e.substring(0,57)+"..."+e.substring(e.length-10)}}};function Np(t){return t?t.map(e=>"."+Qv(e,["."])):void 0}function dE(t){const e=t.split("/");e[0]!==""&&e.unshift("");const n=[];for(let o=0;o<e.length;o++)n.push({index:o,name:o===0?"Root":e[o],path:e.slice(0,o+1).filter(i=>i!=="").join("/")});return n}const uE=["title","onClick"],pE={key:0,class:"ls-loader"},hE=["onClick"],fE=["title"],mE=["onClick"],gE=["title"],yE=r.defineComponent({__name:"Remote",props:{modelValue:{type:Boolean},extensions:{default:void 0},multi:{type:Boolean},title:{default:void 0},autoSelectStorage:{type:Boolean,default:!0},submit:{}},emits:["update:modelValue","import:files"],setup(t,{expose:e}){const n=P=>P.ctrlKey||P.metaKey,o=t,i=r.reactive(Sp()),l=()=>{i.search="",i.error="",i.lastSelected=void 0},c=r.computed(()=>Np(o.extensions)),d=cE(i),p=r.computed(()=>{var P;return{modelValue:o.modelValue,dirPath:i.dirPath,storageHandle:(P=i.storageEntry)==null?void 0:P.handle}}),h=(P,V)=>{window.platforma&&i.currentLoadingPath!==V&&(i.currentLoadingPath=V,window.platforma.lsDriver.listFiles(P,V).then(Z=>{V===i.dirPath&&(i.items=bs(Z).entries.map(J=>({path:J.fullPath,name:J.name,isDir:J.type==="dir",canBeSelected:J.type==="file"&&(!c.value||c.value.some(ae=>J.fullPath.endsWith(ae))),handle:J.type==="file"?J.handle:void 0,selected:!1})).sort((J,ae)=>J.isDir&&!ae.isDir?-1:!J.isDir&&ae.isDir?1:J.name.localeCompare(ae.name)).map((J,ae)=>({id:ae,...J})),i.lastSelected=void 0)}).catch(Z=>i.error=String(Z)).finally(()=>{i.currentLoadingPath=void 0}))},m=()=>{l();const{storageHandle:P,dirPath:V,modelValue:Z}=p.value;P&&Z&&h(P,V)},y=r.computed(()=>dE(i.dirPath)),b=r.computed(()=>i.items.filter(P=>P.canBeSelected&&P.selected&&!P.isDir)),w=r.computed(()=>{var P;return b.value.length>0&&((P=i.storageEntry)==null?void 0:P.handle)}),S=()=>{var P;return{storageHandle:bs((P=i.storageEntry)==null?void 0:P.handle),files:b.value.map(V=>V.handle)}},M=P=>{i.dirPath=P},O=(P,V)=>{const{shiftKey:Z}=P,J=n(P),{lastSelected:ae}=i;if(P.preventDefault(),V.canBeSelected){if(o.multi||i.items.forEach($=>$.selected=!1),V.selected=!V.selected,!o.multi)return;!J&&!Z&&i.items.forEach($=>{$.id!==V.id&&($.selected=!1)}),Z&&ae!==void 0&&i.items.forEach($=>{Hv($.id,ae,V.id)&&($.selected=!0)}),V.selected&&(i.lastSelected=V.id)}},C=P=>{P&&!o.multi||i.items.filter(V=>V.canBeSelected).forEach(V=>{V.selected=P})},I=()=>C(!0),F=()=>C(!1),W=()=>{if(l(),F(),!window.platforma){console.warn("platforma API is not found");return}window.platforma.lsDriver.getStorageList().then(P=>{P=P.filter(V=>V.name!=="local"&&!V.name.startsWith("local_disk_")),i.storageOptions=P.map(V=>({text:V.name,value:V})),o.autoSelectStorage&&gr(P[0],V=>{i.storageEntry=V})}).catch(P=>i.error=String(P))};return r.watch(r.toRef(i,"storageEntry"),P=>{l(),i.dirPath=(P==null?void 0:P.initialFullPath)??""},{immediate:!0}),r.watch([()=>i.dirPath,()=>i.storageEntry],()=>{m()}),r.watch(()=>o.modelValue,P=>{P?W():Object.assign(i,Sp())},{immediate:!0}),st(document,"keydown",P=>{if(!o.modelValue||P.target!==document.body)return;const V=n(P);V&&P.code==="KeyA"&&(P.preventDefault(),I()),V&&P.shiftKey&&P.code==="Period"&&(P.preventDefault(),i.showHiddenItems=!i.showHiddenItems),P.code==="Enter"&&o.submit()}),e({isReady:w,getFilesToImport:S}),r.onMounted(W),(P,V)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(r.unref(ct).remote),onClick:r.withModifiers(F,["stop"])},[r.createElementVNode("div",{class:r.normalizeClass(r.unref(ct).search)},[r.createElementVNode("div",null,[r.createVNode(r.unref(Co),{modelValue:i.storageEntry,"onUpdate:modelValue":V[0]||(V[0]=Z=>i.storageEntry=Z),label:"Select storage",options:i.storageOptions},null,8,["modelValue","options"])]),V[2]||(V[2]=r.createTextVNode()),r.createElementVNode("div",null,[r.createVNode(r.unref(yp),{modelValue:i.search,"onUpdate:modelValue":V[1]||(V[1]=Z=>i.search=Z),label:"Search in folder",clearable:""},null,8,["modelValue"])])],2),V[12]||(V[12]=r.createTextVNode()),r.createElementVNode("div",{class:r.normalizeClass(r.unref(ct)["ls-container"])},[r.createElementVNode("div",{class:r.normalizeClass(r.unref(ct)["ls-head"])},[r.createElementVNode("div",{class:r.normalizeClass(r.unref(ct).breadcrumbs)},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(y.value,(Z,J)=>(r.openBlock(),r.createElementBlock(r.Fragment,{key:J},[r.createElementVNode("div",{title:Z.path,onClick:ae=>M(Z.path)},r.toDisplayString(Z.name),9,uE),V[3]||(V[3]=r.createTextVNode()),Z.index!==y.value.length-1?(r.openBlock(),r.createBlock(r.unref(Wr),{key:0,name:"chevron-right"})):r.createCommentVNode("",!0)],64))),128))],2),V[5]||(V[5]=r.createTextVNode()),r.createElementVNode("div",{class:r.normalizeClass(r.unref(ct).selected)},[r.createElementVNode("span",null,"Selected: "+r.toDisplayString(b.value.length),1),V[4]||(V[4]=r.createTextVNode()),r.createVNode(lE)],2)],2),V[11]||(V[11]=r.createTextVNode()),i.currentLoadingPath!==void 0?(r.openBlock(),r.createElementBlock("div",pE,V[6]||(V[6]=[r.createElementVNode("i",{class:"mask-24 mask-loading loader-icon"},null,-1)]))):i.storageEntry?i.error?(r.openBlock(),r.createElementBlock("div",{key:2,class:r.normalizeClass(r.unref(ct)["ls-error"])},[r.createElementVNode("div",{class:r.normalizeClass(r.unref(ct).cat)},null,2),V[8]||(V[8]=r.createTextVNode()),r.createElementVNode("div",{class:r.normalizeClass(r.unref(ct).message)},r.toDisplayString(i.error),3)],2)):(r.openBlock(),r.createElementBlock("div",{key:3,class:r.normalizeClass(r.unref(ct)["ls-body"])},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(d),Z=>(r.openBlock(),r.createElementBlock(r.Fragment,{key:Z.id},[Z.isDir?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(r.unref(ct).isDir),onClick:J=>M(Z.path)},[r.createVNode(r.unref(Wr),{name:"chevron-right"}),V[9]||(V[9]=r.createTextVNode()),r.withDirectives((r.openBlock(),r.createElementBlock("span",{title:Z.name},[r.createTextVNode(r.toDisplayString(Z.name),1)],8,fE)),[[r.unref(Tp)]])],10,hE)):(r.openBlock(),r.createElementBlock("div",{key:1,class:r.normalizeClass({[r.unref(ct).canBeSelected]:Z.canBeSelected,[r.unref(ct).selected]:Z.selected}),onClick:r.withModifiers(J=>O(J,Z),["stop"])},[r.createVNode(r.unref(nn),{name:"box",class:r.normalizeClass(r.unref(ct).isFile)},null,8,["class"]),V[10]||(V[10]=r.createTextVNode()),r.withDirectives((r.openBlock(),r.createElementBlock("span",{title:Z.name},[r.createTextVNode(r.toDisplayString(Z.name),1)],8,gE)),[[r.unref(Tp)]])],10,mE))],64))),128))],2)):(r.openBlock(),r.createElementBlock("div",{key:1,class:r.normalizeClass(r.unref(ct)["ls-empty"])},[r.createElementVNode("div",{class:r.normalizeClass(r.unref(ct).cat)},null,2),V[7]||(V[7]=r.createTextVNode()),r.createElementVNode("div",{class:r.normalizeClass(r.unref(ct).message)},"Select storage to preview",2)],2))],2)],2))}}),_E={key:1,class:"alert-error"},vE=r.defineComponent({__name:"Local",props:{importFiles:{type:Function},multi:{type:Boolean},extensions:{}},setup(t){const e=t,n=r.reactive({error:void 0}),o=r.computed(()=>e.multi?"Drag & Drop files here or click to add":"Drag & Drop file here or click to add"),i=async c=>{var d,p,h;const m=(p=(d=window.platforma)==null?void 0:d.lsDriver)==null?void 0:p.fileToImportHandle;if(!m)return console.error("API platforma.lsDriver.fileToImportHandle is not available");const y=Np(e.extensions),b=await Promise.all([...((h=c.dataTransfer)==null?void 0:h.files)??[]].filter(w=>!!w).filter(w=>y?y.some(S=>w.name.endsWith(S)):!0).map(w=>m(w)));b.length&&e.importFiles({files:b})},l=async()=>{var c,d;const p=e.extensions?[{name:"All Files",extensions:e.extensions}]:[];e.multi?(c=window.platforma)==null||c.lsDriver.showOpenMultipleFilesDialog({title:"Select files to import",filters:p}).then(({files:h})=>{h&&e.importFiles({files:h})}).catch(h=>n.error=h):(d=window.platforma)==null||d.lsDriver.showOpenSingleFileDialog({title:"Select file to import",filters:p}).then(({file:h})=>{h&&e.importFiles({files:[h]})}).catch(h=>n.error=h)};return(c,d)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(r.unref(ct).local),onDrop:i,onDragover:d[0]||(d[0]=r.withModifiers(()=>{},["prevent"])),onClick:l},[r.createVNode(r.unref(Ns),{name:"cloud-upload"}),d[1]||(d[1]=r.createTextVNode()),r.createElementVNode("span",null,r.toDisplayString(o.value),1),d[2]||(d[2]=r.createTextVNode()),c.extensions?(r.openBlock(),r.createElementBlock("span",{key:0,class:r.normalizeClass(r.unref(ct).supported)},"Supported formats: "+r.toDisplayString(c.extensions.join(", ")),3)):r.createCommentVNode("",!0),d[3]||(d[3]=r.createTextVNode()),n.error?(r.openBlock(),r.createElementBlock("span",_E,r.toDisplayString(n.error),1)):r.createCommentVNode("",!0)],34))}}),CE={style:{margin:"0 24px"}},Vp=r.defineComponent({__name:"PlFileDialog",props:{modelValue:{type:Boolean},extensions:{default:void 0},multi:{type:Boolean},title:{default:void 0},autoSelectStorage:{type:Boolean,default:!0},closeOnOutsideClick:{type:Boolean,default:!0}},emits:["update:modelValue","import:files"],setup(t,{emit:e}){const n=e,o=t,i=r.ref("local"),l=r.computed(()=>o.multi?"Select Files to Import":"Select File to Import"),c=[{label:"My Computer",value:"local"},{label:"Remote",value:"remote"}],d=()=>n("update:modelValue",!1),p=r.useTemplateRef("remote"),h=()=>{var y,b;(y=p.value)!=null&&y.isReady&&(n("import:files",bs((b=p.value)==null?void 0:b.getFilesToImport())),d())},m=y=>{n("import:files",y),d()};return(y,b)=>(r.openBlock(),r.createBlock(r.unref(Ul),{"no-content-gutters":!0,"close-on-outside-click":y.closeOnOutsideClick,class:r.normalizeClass(["pl-dialog-modal",r.unref(ct).component]),"model-value":y.modelValue,width:"688px",height:"720px","onUpdate:modelValue":d},r.createSlots({title:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(y.title??l.value),1)]),default:r.withCtx(()=>[b[4]||(b[4]=r.createTextVNode()),r.createElementVNode("div",CE,[r.createVNode(r.unref(up),{modelValue:i.value,"onUpdate:modelValue":b[0]||(b[0]=w=>i.value=w),options:c},null,8,["modelValue"])]),b[5]||(b[5]=r.createTextVNode()),i.value==="remote"?(r.openBlock(),r.createBlock(yE,r.mergeProps({key:0,ref:"remote"},y.$props,{submit:h}),null,16)):r.createCommentVNode("",!0),b[6]||(b[6]=r.createTextVNode()),i.value==="local"?(r.openBlock(),r.createBlock(vE,r.mergeProps({key:1,"import-files":m},y.$props),null,16)):r.createCommentVNode("",!0),b[7]||(b[7]=r.createTextVNode())]),_:2},[i.value==="remote"?{name:"actions",fn:r.withCtx(()=>{var w;return[r.createVNode(r.unref(Ss),{style:{"min-width":"160px"},disabled:!((w=r.unref(p))!=null&&w.isReady),onClick:r.withModifiers(h,["stop"])},{default:r.withCtx(()=>b[1]||(b[1]=[r.createTextVNode("Import")])),_:1},8,["disabled"]),b[3]||(b[3]=r.createTextVNode()),r.createVNode(r.unref(vo),{"justify-center":!1,onClick:r.withModifiers(d,["stop"])},{default:r.withCtx(()=>b[2]||(b[2]=[r.createTextVNode("Cancel")])),_:1})]}),key:"0"}:void 0]),1032,["close-on-outside-click","class","model-value"]))}});var $e;(function(t){t.assertEqual=i=>i;function e(i){}t.assertIs=e;function n(i){throw new Error}t.assertNever=n,t.arrayToEnum=i=>{const l={};for(const c of i)l[c]=c;return l},t.getValidEnumValues=i=>{const l=t.objectKeys(i).filter(d=>typeof i[i[d]]!="number"),c={};for(const d of l)c[d]=i[d];return t.objectValues(c)},t.objectValues=i=>t.objectKeys(i).map(function(l){return i[l]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const l=[];for(const c in i)Object.prototype.hasOwnProperty.call(i,c)&&l.push(c);return l},t.find=(i,l)=>{for(const c of i)if(l(c))return c},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function o(i,l=" | "){return i.map(c=>typeof c=="string"?`'${c}'`:c).join(l)}t.joinValues=o,t.jsonStringifyReplacer=(i,l)=>typeof l=="bigint"?l.toString():l})($e||($e={}));var Zl;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(Zl||(Zl={}));const ce=$e.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Cr=t=>{switch(typeof t){case"undefined":return ce.undefined;case"string":return ce.string;case"number":return isNaN(t)?ce.nan:ce.number;case"boolean":return ce.boolean;case"function":return ce.function;case"bigint":return ce.bigint;case"symbol":return ce.symbol;case"object":return Array.isArray(t)?ce.array:t===null?ce.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?ce.promise:typeof Map<"u"&&t instanceof Map?ce.map:typeof Set<"u"&&t instanceof Set?ce.set:typeof Date<"u"&&t instanceof Date?ce.date:ce.object;default:return ce.unknown}},te=$e.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),wE=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:");class Wt extends Error{constructor(e){super(),this.issues=[],this.addIssue=o=>{this.issues=[...this.issues,o]},this.addIssues=(o=[])=>{this.issues=[...this.issues,...o]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const n=e||function(l){return l.message},o={_errors:[]},i=l=>{for(const c of l.issues)if(c.code==="invalid_union")c.unionErrors.map(i);else if(c.code==="invalid_return_type")i(c.returnTypeError);else if(c.code==="invalid_arguments")i(c.argumentsError);else if(c.path.length===0)o._errors.push(n(c));else{let d=o,p=0;for(;p<c.path.length;){const h=c.path[p];p===c.path.length-1?(d[h]=d[h]||{_errors:[]},d[h]._errors.push(n(c))):d[h]=d[h]||{_errors:[]},d=d[h],p++}}};return i(this),o}static assert(e){if(!(e instanceof Wt))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,$e.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){const n={},o=[];for(const i of this.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(e(i))):o.push(e(i));return{formErrors:o,fieldErrors:n}}get formErrors(){return this.flatten()}}Wt.create=t=>new Wt(t);const bo=(t,e)=>{let n;switch(t.code){case te.invalid_type:t.received===ce.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case te.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,$e.jsonStringifyReplacer)}`;break;case te.unrecognized_keys:n=`Unrecognized key(s) in object: ${$e.joinValues(t.keys,", ")}`;break;case te.invalid_union:n="Invalid input";break;case te.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${$e.joinValues(t.options)}`;break;case te.invalid_enum_value:n=`Invalid enum value. Expected ${$e.joinValues(t.options)}, received '${t.received}'`;break;case te.invalid_arguments:n="Invalid function arguments";break;case te.invalid_return_type:n="Invalid function return type";break;case te.invalid_date:n="Invalid date";break;case te.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:$e.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case te.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case te.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case te.custom:n="Invalid input";break;case te.invalid_intersection_types:n="Intersection results could not be merged";break;case te.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case te.not_finite:n="Number must be finite";break;default:n=e.defaultError,$e.assertNever(t)}return{message:n}};let Ap=bo;function bE(t){Ap=t}function Ps(){return Ap}const Rs=t=>{const{data:e,path:n,errorMaps:o,issueData:i}=t,l=[...n,...i.path||[]],c={...i,path:l};if(i.message!==void 0)return{...i,path:l,message:i.message};let d="";const p=o.filter(h=>!!h).slice().reverse();for(const h of p)d=h(c,{data:e,defaultError:d}).message;return{...i,path:l,message:d}},xE=[];function se(t,e){const n=Ps(),o=Rs({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===bo?void 0:bo].filter(i=>!!i)});t.common.issues.push(o)}class xt{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){const o=[];for(const i of n){if(i.status==="aborted")return xe;i.status==="dirty"&&e.dirty(),o.push(i.value)}return{status:e.value,value:o}}static async mergeObjectAsync(e,n){const o=[];for(const i of n){const l=await i.key,c=await i.value;o.push({key:l,value:c})}return xt.mergeObjectSync(e,o)}static mergeObjectSync(e,n){const o={};for(const i of n){const{key:l,value:c}=i;if(l.status==="aborted"||c.status==="aborted")return xe;l.status==="dirty"&&e.dirty(),c.status==="dirty"&&e.dirty(),l.value!=="__proto__"&&(typeof c.value<"u"||i.alwaysSet)&&(o[l.value]=c.value)}return{status:e.value,value:o}}}const xe=Object.freeze({status:"aborted"}),Ds=t=>({status:"dirty",value:t}),At=t=>({status:"valid",value:t}),Wl=t=>t.status==="aborted",jl=t=>t.status==="dirty",Ci=t=>t.status==="valid",wi=t=>typeof Promise<"u"&&t instanceof Promise;function Is(t,e,n,o){if(typeof e=="function"?t!==e||!o:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e.get(t)}function Bp(t,e,n,o,i){if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return e.set(t,n),n}var me;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(me||(me={}));var bi,xi;class Mn{constructor(e,n,o,i){this._cachedPath=[],this.parent=e,this.data=n,this._path=o,this._key=i}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Pp=(t,e)=>{if(Ci(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new Wt(t.common.issues);return this._error=n,this._error}}};function Ae(t){if(!t)return{};const{errorMap:e,invalid_type_error:n,required_error:o,description:i}=t;if(e&&(n||o))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:(l,c)=>{var d,p;const{message:h}=t;return l.code==="invalid_enum_value"?{message:h??c.defaultError}:typeof c.data>"u"?{message:(d=h??o)!==null&&d!==void 0?d:c.defaultError}:l.code!=="invalid_type"?{message:c.defaultError}:{message:(p=h??n)!==null&&p!==void 0?p:c.defaultError}},description:i}}class Re{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return Cr(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:Cr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new xt,ctx:{common:e.parent.common,data:e.data,parsedType:Cr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const n=this._parse(e);if(wi(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){const n=this._parse(e);return Promise.resolve(n)}parse(e,n){const o=this.safeParse(e,n);if(o.success)return o.data;throw o.error}safeParse(e,n){var o;const i={common:{issues:[],async:(o=n==null?void 0:n.async)!==null&&o!==void 0?o:!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Cr(e)},l=this._parseSync({data:e,path:i.path,parent:i});return Pp(i,l)}async parseAsync(e,n){const o=await this.safeParseAsync(e,n);if(o.success)return o.data;throw o.error}async safeParseAsync(e,n){const o={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Cr(e)},i=this._parse({data:e,path:o.path,parent:o}),l=await(wi(i)?i:Promise.resolve(i));return Pp(o,l)}refine(e,n){const o=i=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(i):n;return this._refinement((i,l)=>{const c=e(i),d=()=>l.addIssue({code:te.custom,...o(i)});return typeof Promise<"u"&&c instanceof Promise?c.then(p=>p?!0:(d(),!1)):c?!0:(d(),!1)})}refinement(e,n){return this._refinement((o,i)=>e(o)?!0:(i.addIssue(typeof n=="function"?n(o,i):n),!1))}_refinement(e){return new yn({schema:this,typeName:we.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return $n.create(this,this._def)}nullable(){return Er.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return gn.create(this,this._def)}promise(){return So.create(this,this._def)}or(e){return Ti.create([this,e],this._def)}and(e){return Ni.create(this,e,this._def)}transform(e){return new yn({...Ae(this._def),schema:this,typeName:we.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new Ri({...Ae(this._def),innerType:this,defaultValue:n,typeName:we.ZodDefault})}brand(){return new Kl({typeName:we.ZodBranded,type:this,...Ae(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new Di({...Ae(this._def),innerType:this,catchValue:n,typeName:we.ZodCatch})}describe(e){const n=this.constructor;return new n({...this._def,description:e})}pipe(e){return Ii.create(this,e)}readonly(){return Fi.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const kE=/^c[^\s-]{8,}$/i,EE=/^[0-9a-z]+$/,SE=/^[0-9A-HJKMNP-TV-Z]{26}$/,TE=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,NE=/^[a-z0-9_-]{21}$/i,VE=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,AE=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,BE="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Hl;const PE=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,RE=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,DE=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Rp="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",IE=new RegExp(`^${Rp}$`);function Dp(t){let e="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`),e}function FE(t){return new RegExp(`^${Dp(t)}$`)}function Ip(t){let e=`${Rp}T${Dp(t)}`;const n=[];return n.push(t.local?"Z?":"Z"),t.offset&&n.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${n.join("|")})`,new RegExp(`^${e}$`)}function LE(t,e){return!!((e==="v4"||!e)&&PE.test(t)||(e==="v6"||!e)&&RE.test(t))}class mn extends Re{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==ce.string){const i=this._getOrReturnCtx(e);return se(i,{code:te.invalid_type,expected:ce.string,received:i.parsedType}),xe}const n=new xt;let o;for(const i of this._def.checks)if(i.kind==="min")e.data.length<i.value&&(o=this._getOrReturnCtx(e,o),se(o,{code:te.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="max")e.data.length>i.value&&(o=this._getOrReturnCtx(e,o),se(o,{code:te.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="length"){const l=e.data.length>i.value,c=e.data.length<i.value;(l||c)&&(o=this._getOrReturnCtx(e,o),l?se(o,{code:te.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):c&&se(o,{code:te.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),n.dirty())}else if(i.kind==="email")AE.test(e.data)||(o=this._getOrReturnCtx(e,o),se(o,{validation:"email",code:te.invalid_string,message:i.message}),n.dirty());else if(i.kind==="emoji")Hl||(Hl=new RegExp(BE,"u")),Hl.test(e.data)||(o=this._getOrReturnCtx(e,o),se(o,{validation:"emoji",code:te.invalid_string,message:i.message}),n.dirty());else if(i.kind==="uuid")TE.test(e.data)||(o=this._getOrReturnCtx(e,o),se(o,{validation:"uuid",code:te.invalid_string,message:i.message}),n.dirty());else if(i.kind==="nanoid")NE.test(e.data)||(o=this._getOrReturnCtx(e,o),se(o,{validation:"nanoid",code:te.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid")kE.test(e.data)||(o=this._getOrReturnCtx(e,o),se(o,{validation:"cuid",code:te.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid2")EE.test(e.data)||(o=this._getOrReturnCtx(e,o),se(o,{validation:"cuid2",code:te.invalid_string,message:i.message}),n.dirty());else if(i.kind==="ulid")SE.test(e.data)||(o=this._getOrReturnCtx(e,o),se(o,{validation:"ulid",code:te.invalid_string,message:i.message}),n.dirty());else if(i.kind==="url")try{new URL(e.data)}catch{o=this._getOrReturnCtx(e,o),se(o,{validation:"url",code:te.invalid_string,message:i.message}),n.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(e.data)||(o=this._getOrReturnCtx(e,o),se(o,{validation:"regex",code:te.invalid_string,message:i.message}),n.dirty())):i.kind==="trim"?e.data=e.data.trim():i.kind==="includes"?e.data.includes(i.value,i.position)||(o=this._getOrReturnCtx(e,o),se(o,{code:te.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),n.dirty()):i.kind==="toLowerCase"?e.data=e.data.toLowerCase():i.kind==="toUpperCase"?e.data=e.data.toUpperCase():i.kind==="startsWith"?e.data.startsWith(i.value)||(o=this._getOrReturnCtx(e,o),se(o,{code:te.invalid_string,validation:{startsWith:i.value},message:i.message}),n.dirty()):i.kind==="endsWith"?e.data.endsWith(i.value)||(o=this._getOrReturnCtx(e,o),se(o,{code:te.invalid_string,validation:{endsWith:i.value},message:i.message}),n.dirty()):i.kind==="datetime"?Ip(i).test(e.data)||(o=this._getOrReturnCtx(e,o),se(o,{code:te.invalid_string,validation:"datetime",message:i.message}),n.dirty()):i.kind==="date"?IE.test(e.data)||(o=this._getOrReturnCtx(e,o),se(o,{code:te.invalid_string,validation:"date",message:i.message}),n.dirty()):i.kind==="time"?FE(i).test(e.data)||(o=this._getOrReturnCtx(e,o),se(o,{code:te.invalid_string,validation:"time",message:i.message}),n.dirty()):i.kind==="duration"?VE.test(e.data)||(o=this._getOrReturnCtx(e,o),se(o,{validation:"duration",code:te.invalid_string,message:i.message}),n.dirty()):i.kind==="ip"?LE(e.data,i.version)||(o=this._getOrReturnCtx(e,o),se(o,{validation:"ip",code:te.invalid_string,message:i.message}),n.dirty()):i.kind==="base64"?DE.test(e.data)||(o=this._getOrReturnCtx(e,o),se(o,{validation:"base64",code:te.invalid_string,message:i.message}),n.dirty()):$e.assertNever(i);return{status:n.value,value:e.data}}_regex(e,n,o){return this.refinement(i=>e.test(i),{validation:n,code:te.invalid_string,...me.errToObj(o)})}_addCheck(e){return new mn({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...me.errToObj(e)})}url(e){return this._addCheck({kind:"url",...me.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...me.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...me.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...me.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...me.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...me.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...me.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...me.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...me.errToObj(e)})}datetime(e){var n,o;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(n=e==null?void 0:e.offset)!==null&&n!==void 0?n:!1,local:(o=e==null?void 0:e.local)!==null&&o!==void 0?o:!1,...me.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...me.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...me.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...me.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n==null?void 0:n.position,...me.errToObj(n==null?void 0:n.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...me.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...me.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...me.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...me.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...me.errToObj(n)})}nonempty(e){return this.min(1,me.errToObj(e))}trim(){return new mn({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new mn({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new mn({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get minLength(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}mn.create=t=>{var e;return new mn({checks:[],typeName:we.ZodString,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...Ae(t)})};function OE(t,e){const n=(t.toString().split(".")[1]||"").length,o=(e.toString().split(".")[1]||"").length,i=n>o?n:o,l=parseInt(t.toFixed(i).replace(".","")),c=parseInt(e.toFixed(i).replace(".",""));return l%c/Math.pow(10,i)}class wr extends Re{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==ce.number){const i=this._getOrReturnCtx(e);return se(i,{code:te.invalid_type,expected:ce.number,received:i.parsedType}),xe}let n;const o=new xt;for(const i of this._def.checks)i.kind==="int"?$e.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),se(n,{code:te.invalid_type,expected:"integer",received:"float",message:i.message}),o.dirty()):i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(n=this._getOrReturnCtx(e,n),se(n,{code:te.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),o.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(n=this._getOrReturnCtx(e,n),se(n,{code:te.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),o.dirty()):i.kind==="multipleOf"?OE(e.data,i.value)!==0&&(n=this._getOrReturnCtx(e,n),se(n,{code:te.not_multiple_of,multipleOf:i.value,message:i.message}),o.dirty()):i.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),se(n,{code:te.not_finite,message:i.message}),o.dirty()):$e.assertNever(i);return{status:o.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,me.toString(n))}gt(e,n){return this.setLimit("min",e,!1,me.toString(n))}lte(e,n){return this.setLimit("max",e,!0,me.toString(n))}lt(e,n){return this.setLimit("max",e,!1,me.toString(n))}setLimit(e,n,o,i){return new wr({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:o,message:me.toString(i)}]})}_addCheck(e){return new wr({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:me.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:me.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:me.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:me.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:me.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:me.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:me.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:me.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:me.toString(e)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&$e.isInteger(e.value))}get isFinite(){let e=null,n=null;for(const o of this._def.checks){if(o.kind==="finite"||o.kind==="int"||o.kind==="multipleOf")return!0;o.kind==="min"?(n===null||o.value>n)&&(n=o.value):o.kind==="max"&&(e===null||o.value<e)&&(e=o.value)}return Number.isFinite(n)&&Number.isFinite(e)}}wr.create=t=>new wr({checks:[],typeName:we.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...Ae(t)});class br extends Re{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==ce.bigint){const i=this._getOrReturnCtx(e);return se(i,{code:te.invalid_type,expected:ce.bigint,received:i.parsedType}),xe}let n;const o=new xt;for(const i of this._def.checks)i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(n=this._getOrReturnCtx(e,n),se(n,{code:te.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),o.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(n=this._getOrReturnCtx(e,n),se(n,{code:te.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),o.dirty()):i.kind==="multipleOf"?e.data%i.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),se(n,{code:te.not_multiple_of,multipleOf:i.value,message:i.message}),o.dirty()):$e.assertNever(i);return{status:o.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,me.toString(n))}gt(e,n){return this.setLimit("min",e,!1,me.toString(n))}lte(e,n){return this.setLimit("max",e,!0,me.toString(n))}lt(e,n){return this.setLimit("max",e,!1,me.toString(n))}setLimit(e,n,o,i){return new br({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:o,message:me.toString(i)}]})}_addCheck(e){return new br({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:me.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:me.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:me.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:me.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:me.toString(n)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}br.create=t=>{var e;return new br({checks:[],typeName:we.ZodBigInt,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...Ae(t)})};class ki extends Re{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==ce.boolean){const n=this._getOrReturnCtx(e);return se(n,{code:te.invalid_type,expected:ce.boolean,received:n.parsedType}),xe}return At(e.data)}}ki.create=t=>new ki({typeName:we.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...Ae(t)});class Hr extends Re{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==ce.date){const i=this._getOrReturnCtx(e);return se(i,{code:te.invalid_type,expected:ce.date,received:i.parsedType}),xe}if(isNaN(e.data.getTime())){const i=this._getOrReturnCtx(e);return se(i,{code:te.invalid_date}),xe}const n=new xt;let o;for(const i of this._def.checks)i.kind==="min"?e.data.getTime()<i.value&&(o=this._getOrReturnCtx(e,o),se(o,{code:te.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),n.dirty()):i.kind==="max"?e.data.getTime()>i.value&&(o=this._getOrReturnCtx(e,o),se(o,{code:te.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),n.dirty()):$e.assertNever(i);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Hr({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:me.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:me.toString(n)})}get minDate(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}}Hr.create=t=>new Hr({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:we.ZodDate,...Ae(t)});class Fs extends Re{_parse(e){if(this._getType(e)!==ce.symbol){const n=this._getOrReturnCtx(e);return se(n,{code:te.invalid_type,expected:ce.symbol,received:n.parsedType}),xe}return At(e.data)}}Fs.create=t=>new Fs({typeName:we.ZodSymbol,...Ae(t)});class Ei extends Re{_parse(e){if(this._getType(e)!==ce.undefined){const n=this._getOrReturnCtx(e);return se(n,{code:te.invalid_type,expected:ce.undefined,received:n.parsedType}),xe}return At(e.data)}}Ei.create=t=>new Ei({typeName:we.ZodUndefined,...Ae(t)});class Si extends Re{_parse(e){if(this._getType(e)!==ce.null){const n=this._getOrReturnCtx(e);return se(n,{code:te.invalid_type,expected:ce.null,received:n.parsedType}),xe}return At(e.data)}}Si.create=t=>new Si({typeName:we.ZodNull,...Ae(t)});class xo extends Re{constructor(){super(...arguments),this._any=!0}_parse(e){return At(e.data)}}xo.create=t=>new xo({typeName:we.ZodAny,...Ae(t)});class qr extends Re{constructor(){super(...arguments),this._unknown=!0}_parse(e){return At(e.data)}}qr.create=t=>new qr({typeName:we.ZodUnknown,...Ae(t)});class Xn extends Re{_parse(e){const n=this._getOrReturnCtx(e);return se(n,{code:te.invalid_type,expected:ce.never,received:n.parsedType}),xe}}Xn.create=t=>new Xn({typeName:we.ZodNever,...Ae(t)});class Ls extends Re{_parse(e){if(this._getType(e)!==ce.undefined){const n=this._getOrReturnCtx(e);return se(n,{code:te.invalid_type,expected:ce.void,received:n.parsedType}),xe}return At(e.data)}}Ls.create=t=>new Ls({typeName:we.ZodVoid,...Ae(t)});class gn extends Re{_parse(e){const{ctx:n,status:o}=this._processInputParams(e),i=this._def;if(n.parsedType!==ce.array)return se(n,{code:te.invalid_type,expected:ce.array,received:n.parsedType}),xe;if(i.exactLength!==null){const c=n.data.length>i.exactLength.value,d=n.data.length<i.exactLength.value;(c||d)&&(se(n,{code:c?te.too_big:te.too_small,minimum:d?i.exactLength.value:void 0,maximum:c?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),o.dirty())}if(i.minLength!==null&&n.data.length<i.minLength.value&&(se(n,{code:te.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),o.dirty()),i.maxLength!==null&&n.data.length>i.maxLength.value&&(se(n,{code:te.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),o.dirty()),n.common.async)return Promise.all([...n.data].map((c,d)=>i.type._parseAsync(new Mn(n,c,n.path,d)))).then(c=>xt.mergeArray(o,c));const l=[...n.data].map((c,d)=>i.type._parseSync(new Mn(n,c,n.path,d)));return xt.mergeArray(o,l)}get element(){return this._def.type}min(e,n){return new gn({...this._def,minLength:{value:e,message:me.toString(n)}})}max(e,n){return new gn({...this._def,maxLength:{value:e,message:me.toString(n)}})}length(e,n){return new gn({...this._def,exactLength:{value:e,message:me.toString(n)}})}nonempty(e){return this.min(1,e)}}gn.create=(t,e)=>new gn({type:t,minLength:null,maxLength:null,exactLength:null,typeName:we.ZodArray,...Ae(e)});function ko(t){if(t instanceof rt){const e={};for(const n in t.shape){const o=t.shape[n];e[n]=$n.create(ko(o))}return new rt({...t._def,shape:()=>e})}else return t instanceof gn?new gn({...t._def,type:ko(t.element)}):t instanceof $n?$n.create(ko(t.unwrap())):t instanceof Er?Er.create(ko(t.unwrap())):t instanceof Gn?Gn.create(t.items.map(e=>ko(e))):t}class rt extends Re{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),n=$e.objectKeys(e);return this._cached={shape:e,keys:n}}_parse(e){if(this._getType(e)!==ce.object){const p=this._getOrReturnCtx(e);return se(p,{code:te.invalid_type,expected:ce.object,received:p.parsedType}),xe}const{status:n,ctx:o}=this._processInputParams(e),{shape:i,keys:l}=this._getCached(),c=[];if(!(this._def.catchall instanceof Xn&&this._def.unknownKeys==="strip"))for(const p in o.data)l.includes(p)||c.push(p);const d=[];for(const p of l){const h=i[p],m=o.data[p];d.push({key:{status:"valid",value:p},value:h._parse(new Mn(o,m,o.path,p)),alwaysSet:p in o.data})}if(this._def.catchall instanceof Xn){const p=this._def.unknownKeys;if(p==="passthrough")for(const h of c)d.push({key:{status:"valid",value:h},value:{status:"valid",value:o.data[h]}});else if(p==="strict")c.length>0&&(se(o,{code:te.unrecognized_keys,keys:c}),n.dirty());else if(p!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const p=this._def.catchall;for(const h of c){const m=o.data[h];d.push({key:{status:"valid",value:h},value:p._parse(new Mn(o,m,o.path,h)),alwaysSet:h in o.data})}}return o.common.async?Promise.resolve().then(async()=>{const p=[];for(const h of d){const m=await h.key,y=await h.value;p.push({key:m,value:y,alwaysSet:h.alwaysSet})}return p}).then(p=>xt.mergeObjectSync(n,p)):xt.mergeObjectSync(n,d)}get shape(){return this._def.shape()}strict(e){return me.errToObj,new rt({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,o)=>{var i,l,c,d;const p=(c=(l=(i=this._def).errorMap)===null||l===void 0?void 0:l.call(i,n,o).message)!==null&&c!==void 0?c:o.defaultError;return n.code==="unrecognized_keys"?{message:(d=me.errToObj(e).message)!==null&&d!==void 0?d:p}:{message:p}}}:{}})}strip(){return new rt({...this._def,unknownKeys:"strip"})}passthrough(){return new rt({...this._def,unknownKeys:"passthrough"})}extend(e){return new rt({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new rt({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:we.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new rt({...this._def,catchall:e})}pick(e){const n={};return $e.objectKeys(e).forEach(o=>{e[o]&&this.shape[o]&&(n[o]=this.shape[o])}),new rt({...this._def,shape:()=>n})}omit(e){const n={};return $e.objectKeys(this.shape).forEach(o=>{e[o]||(n[o]=this.shape[o])}),new rt({...this._def,shape:()=>n})}deepPartial(){return ko(this)}partial(e){const n={};return $e.objectKeys(this.shape).forEach(o=>{const i=this.shape[o];e&&!e[o]?n[o]=i:n[o]=i.optional()}),new rt({...this._def,shape:()=>n})}required(e){const n={};return $e.objectKeys(this.shape).forEach(o=>{if(e&&!e[o])n[o]=this.shape[o];else{let i=this.shape[o];for(;i instanceof $n;)i=i._def.innerType;n[o]=i}}),new rt({...this._def,shape:()=>n})}keyof(){return Fp($e.objectKeys(this.shape))}}rt.create=(t,e)=>new rt({shape:()=>t,unknownKeys:"strip",catchall:Xn.create(),typeName:we.ZodObject,...Ae(e)}),rt.strictCreate=(t,e)=>new rt({shape:()=>t,unknownKeys:"strict",catchall:Xn.create(),typeName:we.ZodObject,...Ae(e)}),rt.lazycreate=(t,e)=>new rt({shape:t,unknownKeys:"strip",catchall:Xn.create(),typeName:we.ZodObject,...Ae(e)});class Ti extends Re{_parse(e){const{ctx:n}=this._processInputParams(e),o=this._def.options;function i(l){for(const d of l)if(d.result.status==="valid")return d.result;for(const d of l)if(d.result.status==="dirty")return n.common.issues.push(...d.ctx.common.issues),d.result;const c=l.map(d=>new Wt(d.ctx.common.issues));return se(n,{code:te.invalid_union,unionErrors:c}),xe}if(n.common.async)return Promise.all(o.map(async l=>{const c={...n,common:{...n.common,issues:[]},parent:null};return{result:await l._parseAsync({data:n.data,path:n.path,parent:c}),ctx:c}})).then(i);{let l;const c=[];for(const p of o){const h={...n,common:{...n.common,issues:[]},parent:null},m=p._parseSync({data:n.data,path:n.path,parent:h});if(m.status==="valid")return m;m.status==="dirty"&&!l&&(l={result:m,ctx:h}),h.common.issues.length&&c.push(h.common.issues)}if(l)return n.common.issues.push(...l.ctx.common.issues),l.result;const d=c.map(p=>new Wt(p));return se(n,{code:te.invalid_union,unionErrors:d}),xe}}get options(){return this._def.options}}Ti.create=(t,e)=>new Ti({options:t,typeName:we.ZodUnion,...Ae(e)});const xr=t=>t instanceof Ai?xr(t.schema):t instanceof yn?xr(t.innerType()):t instanceof Bi?[t.value]:t instanceof kr?t.options:t instanceof Pi?$e.objectValues(t.enum):t instanceof Ri?xr(t._def.innerType):t instanceof Ei?[void 0]:t instanceof Si?[null]:t instanceof $n?[void 0,...xr(t.unwrap())]:t instanceof Er?[null,...xr(t.unwrap())]:t instanceof Kl||t instanceof Fi?xr(t.unwrap()):t instanceof Di?xr(t._def.innerType):[];class Os extends Re{_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==ce.object)return se(n,{code:te.invalid_type,expected:ce.object,received:n.parsedType}),xe;const o=this.discriminator,i=n.data[o],l=this.optionsMap.get(i);return l?n.common.async?l._parseAsync({data:n.data,path:n.path,parent:n}):l._parseSync({data:n.data,path:n.path,parent:n}):(se(n,{code:te.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[o]}),xe)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,o){const i=new Map;for(const l of n){const c=xr(l.shape[e]);if(!c.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const d of c){if(i.has(d))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(d)}`);i.set(d,l)}}return new Os({typeName:we.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:i,...Ae(o)})}}function ql(t,e){const n=Cr(t),o=Cr(e);if(t===e)return{valid:!0,data:t};if(n===ce.object&&o===ce.object){const i=$e.objectKeys(e),l=$e.objectKeys(t).filter(d=>i.indexOf(d)!==-1),c={...t,...e};for(const d of l){const p=ql(t[d],e[d]);if(!p.valid)return{valid:!1};c[d]=p.data}return{valid:!0,data:c}}else if(n===ce.array&&o===ce.array){if(t.length!==e.length)return{valid:!1};const i=[];for(let l=0;l<t.length;l++){const c=t[l],d=e[l],p=ql(c,d);if(!p.valid)return{valid:!1};i.push(p.data)}return{valid:!0,data:i}}else return n===ce.date&&o===ce.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class Ni extends Re{_parse(e){const{status:n,ctx:o}=this._processInputParams(e),i=(l,c)=>{if(Wl(l)||Wl(c))return xe;const d=ql(l.value,c.value);return d.valid?((jl(l)||jl(c))&&n.dirty(),{status:n.value,value:d.data}):(se(o,{code:te.invalid_intersection_types}),xe)};return o.common.async?Promise.all([this._def.left._parseAsync({data:o.data,path:o.path,parent:o}),this._def.right._parseAsync({data:o.data,path:o.path,parent:o})]).then(([l,c])=>i(l,c)):i(this._def.left._parseSync({data:o.data,path:o.path,parent:o}),this._def.right._parseSync({data:o.data,path:o.path,parent:o}))}}Ni.create=(t,e,n)=>new Ni({left:t,right:e,typeName:we.ZodIntersection,...Ae(n)});class Gn extends Re{_parse(e){const{status:n,ctx:o}=this._processInputParams(e);if(o.parsedType!==ce.array)return se(o,{code:te.invalid_type,expected:ce.array,received:o.parsedType}),xe;if(o.data.length<this._def.items.length)return se(o,{code:te.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),xe;!this._def.rest&&o.data.length>this._def.items.length&&(se(o,{code:te.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const i=[...o.data].map((l,c)=>{const d=this._def.items[c]||this._def.rest;return d?d._parse(new Mn(o,l,o.path,c)):null}).filter(l=>!!l);return o.common.async?Promise.all(i).then(l=>xt.mergeArray(n,l)):xt.mergeArray(n,i)}get items(){return this._def.items}rest(e){return new Gn({...this._def,rest:e})}}Gn.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Gn({items:t,typeName:we.ZodTuple,rest:null,...Ae(e)})};class Vi extends Re{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:o}=this._processInputParams(e);if(o.parsedType!==ce.object)return se(o,{code:te.invalid_type,expected:ce.object,received:o.parsedType}),xe;const i=[],l=this._def.keyType,c=this._def.valueType;for(const d in o.data)i.push({key:l._parse(new Mn(o,d,o.path,d)),value:c._parse(new Mn(o,o.data[d],o.path,d)),alwaysSet:d in o.data});return o.common.async?xt.mergeObjectAsync(n,i):xt.mergeObjectSync(n,i)}get element(){return this._def.valueType}static create(e,n,o){return n instanceof Re?new Vi({keyType:e,valueType:n,typeName:we.ZodRecord,...Ae(o)}):new Vi({keyType:mn.create(),valueType:e,typeName:we.ZodRecord,...Ae(n)})}}class Ms extends Re{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:o}=this._processInputParams(e);if(o.parsedType!==ce.map)return se(o,{code:te.invalid_type,expected:ce.map,received:o.parsedType}),xe;const i=this._def.keyType,l=this._def.valueType,c=[...o.data.entries()].map(([d,p],h)=>({key:i._parse(new Mn(o,d,o.path,[h,"key"])),value:l._parse(new Mn(o,p,o.path,[h,"value"]))}));if(o.common.async){const d=new Map;return Promise.resolve().then(async()=>{for(const p of c){const h=await p.key,m=await p.value;if(h.status==="aborted"||m.status==="aborted")return xe;(h.status==="dirty"||m.status==="dirty")&&n.dirty(),d.set(h.value,m.value)}return{status:n.value,value:d}})}else{const d=new Map;for(const p of c){const h=p.key,m=p.value;if(h.status==="aborted"||m.status==="aborted")return xe;(h.status==="dirty"||m.status==="dirty")&&n.dirty(),d.set(h.value,m.value)}return{status:n.value,value:d}}}}Ms.create=(t,e,n)=>new Ms({valueType:e,keyType:t,typeName:we.ZodMap,...Ae(n)});class Kr extends Re{_parse(e){const{status:n,ctx:o}=this._processInputParams(e);if(o.parsedType!==ce.set)return se(o,{code:te.invalid_type,expected:ce.set,received:o.parsedType}),xe;const i=this._def;i.minSize!==null&&o.data.size<i.minSize.value&&(se(o,{code:te.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),n.dirty()),i.maxSize!==null&&o.data.size>i.maxSize.value&&(se(o,{code:te.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),n.dirty());const l=this._def.valueType;function c(p){const h=new Set;for(const m of p){if(m.status==="aborted")return xe;m.status==="dirty"&&n.dirty(),h.add(m.value)}return{status:n.value,value:h}}const d=[...o.data.values()].map((p,h)=>l._parse(new Mn(o,p,o.path,h)));return o.common.async?Promise.all(d).then(p=>c(p)):c(d)}min(e,n){return new Kr({...this._def,minSize:{value:e,message:me.toString(n)}})}max(e,n){return new Kr({...this._def,maxSize:{value:e,message:me.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}}Kr.create=(t,e)=>new Kr({valueType:t,minSize:null,maxSize:null,typeName:we.ZodSet,...Ae(e)});class Eo extends Re{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==ce.function)return se(n,{code:te.invalid_type,expected:ce.function,received:n.parsedType}),xe;function o(d,p){return Rs({data:d,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Ps(),bo].filter(h=>!!h),issueData:{code:te.invalid_arguments,argumentsError:p}})}function i(d,p){return Rs({data:d,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Ps(),bo].filter(h=>!!h),issueData:{code:te.invalid_return_type,returnTypeError:p}})}const l={errorMap:n.common.contextualErrorMap},c=n.data;if(this._def.returns instanceof So){const d=this;return At(async function(...p){const h=new Wt([]),m=await d._def.args.parseAsync(p,l).catch(b=>{throw h.addIssue(o(p,b)),h}),y=await Reflect.apply(c,this,m);return await d._def.returns._def.type.parseAsync(y,l).catch(b=>{throw h.addIssue(i(y,b)),h})})}else{const d=this;return At(function(...p){const h=d._def.args.safeParse(p,l);if(!h.success)throw new Wt([o(p,h.error)]);const m=Reflect.apply(c,this,h.data),y=d._def.returns.safeParse(m,l);if(!y.success)throw new Wt([i(m,y.error)]);return y.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new Eo({...this._def,args:Gn.create(e).rest(qr.create())})}returns(e){return new Eo({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,n,o){return new Eo({args:e||Gn.create([]).rest(qr.create()),returns:n||qr.create(),typeName:we.ZodFunction,...Ae(o)})}}class Ai extends Re{get schema(){return this._def.getter()}_parse(e){const{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}Ai.create=(t,e)=>new Ai({getter:t,typeName:we.ZodLazy,...Ae(e)});class Bi extends Re{_parse(e){if(e.data!==this._def.value){const n=this._getOrReturnCtx(e);return se(n,{received:n.data,code:te.invalid_literal,expected:this._def.value}),xe}return{status:"valid",value:e.data}}get value(){return this._def.value}}Bi.create=(t,e)=>new Bi({value:t,typeName:we.ZodLiteral,...Ae(e)});function Fp(t,e){return new kr({values:t,typeName:we.ZodEnum,...Ae(e)})}class kr extends Re{constructor(){super(...arguments),bi.set(this,void 0)}_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),o=this._def.values;return se(n,{expected:$e.joinValues(o),received:n.parsedType,code:te.invalid_type}),xe}if(Is(this,bi)||Bp(this,bi,new Set(this._def.values)),!Is(this,bi).has(e.data)){const n=this._getOrReturnCtx(e),o=this._def.values;return se(n,{received:n.data,code:te.invalid_enum_value,options:o}),xe}return At(e.data)}get options(){return this._def.values}get enum(){const e={};for(const n of this._def.values)e[n]=n;return e}get Values(){const e={};for(const n of this._def.values)e[n]=n;return e}get Enum(){const e={};for(const n of this._def.values)e[n]=n;return e}extract(e,n=this._def){return kr.create(e,{...this._def,...n})}exclude(e,n=this._def){return kr.create(this.options.filter(o=>!e.includes(o)),{...this._def,...n})}}bi=new WeakMap,kr.create=Fp;class Pi extends Re{constructor(){super(...arguments),xi.set(this,void 0)}_parse(e){const n=$e.getValidEnumValues(this._def.values),o=this._getOrReturnCtx(e);if(o.parsedType!==ce.string&&o.parsedType!==ce.number){const i=$e.objectValues(n);return se(o,{expected:$e.joinValues(i),received:o.parsedType,code:te.invalid_type}),xe}if(Is(this,xi)||Bp(this,xi,new Set($e.getValidEnumValues(this._def.values))),!Is(this,xi).has(e.data)){const i=$e.objectValues(n);return se(o,{received:o.data,code:te.invalid_enum_value,options:i}),xe}return At(e.data)}get enum(){return this._def.values}}xi=new WeakMap,Pi.create=(t,e)=>new Pi({values:t,typeName:we.ZodNativeEnum,...Ae(e)});class So extends Re{unwrap(){return this._def.type}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==ce.promise&&n.common.async===!1)return se(n,{code:te.invalid_type,expected:ce.promise,received:n.parsedType}),xe;const o=n.parsedType===ce.promise?n.data:Promise.resolve(n.data);return At(o.then(i=>this._def.type.parseAsync(i,{path:n.path,errorMap:n.common.contextualErrorMap})))}}So.create=(t,e)=>new So({type:t,typeName:we.ZodPromise,...Ae(e)});class yn extends Re{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===we.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:n,ctx:o}=this._processInputParams(e),i=this._def.effect||null,l={addIssue:c=>{se(o,c),c.fatal?n.abort():n.dirty()},get path(){return o.path}};if(l.addIssue=l.addIssue.bind(l),i.type==="preprocess"){const c=i.transform(o.data,l);if(o.common.async)return Promise.resolve(c).then(async d=>{if(n.value==="aborted")return xe;const p=await this._def.schema._parseAsync({data:d,path:o.path,parent:o});return p.status==="aborted"?xe:p.status==="dirty"||n.value==="dirty"?Ds(p.value):p});{if(n.value==="aborted")return xe;const d=this._def.schema._parseSync({data:c,path:o.path,parent:o});return d.status==="aborted"?xe:d.status==="dirty"||n.value==="dirty"?Ds(d.value):d}}if(i.type==="refinement"){const c=d=>{const p=i.refinement(d,l);if(o.common.async)return Promise.resolve(p);if(p instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return d};if(o.common.async===!1){const d=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});return d.status==="aborted"?xe:(d.status==="dirty"&&n.dirty(),c(d.value),{status:n.value,value:d.value})}else return this._def.schema._parseAsync({data:o.data,path:o.path,parent:o}).then(d=>d.status==="aborted"?xe:(d.status==="dirty"&&n.dirty(),c(d.value).then(()=>({status:n.value,value:d.value}))))}if(i.type==="transform")if(o.common.async===!1){const c=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});if(!Ci(c))return c;const d=i.transform(c.value,l);if(d instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:d}}else return this._def.schema._parseAsync({data:o.data,path:o.path,parent:o}).then(c=>Ci(c)?Promise.resolve(i.transform(c.value,l)).then(d=>({status:n.value,value:d})):c);$e.assertNever(i)}}yn.create=(t,e,n)=>new yn({schema:t,typeName:we.ZodEffects,effect:e,...Ae(n)}),yn.createWithPreprocess=(t,e,n)=>new yn({schema:e,effect:{type:"preprocess",transform:t},typeName:we.ZodEffects,...Ae(n)});class $n extends Re{_parse(e){return this._getType(e)===ce.undefined?At(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}$n.create=(t,e)=>new $n({innerType:t,typeName:we.ZodOptional,...Ae(e)});class Er extends Re{_parse(e){return this._getType(e)===ce.null?At(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Er.create=(t,e)=>new Er({innerType:t,typeName:we.ZodNullable,...Ae(e)});class Ri extends Re{_parse(e){const{ctx:n}=this._processInputParams(e);let o=n.data;return n.parsedType===ce.undefined&&(o=this._def.defaultValue()),this._def.innerType._parse({data:o,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}Ri.create=(t,e)=>new Ri({innerType:t,typeName:we.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Ae(e)});class Di extends Re{_parse(e){const{ctx:n}=this._processInputParams(e),o={...n,common:{...n.common,issues:[]}},i=this._def.innerType._parse({data:o.data,path:o.path,parent:{...o}});return wi(i)?i.then(l=>({status:"valid",value:l.status==="valid"?l.value:this._def.catchValue({get error(){return new Wt(o.common.issues)},input:o.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Wt(o.common.issues)},input:o.data})}}removeCatch(){return this._def.innerType}}Di.create=(t,e)=>new Di({innerType:t,typeName:we.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Ae(e)});class Gs extends Re{_parse(e){if(this._getType(e)!==ce.nan){const n=this._getOrReturnCtx(e);return se(n,{code:te.invalid_type,expected:ce.nan,received:n.parsedType}),xe}return{status:"valid",value:e.data}}}Gs.create=t=>new Gs({typeName:we.ZodNaN,...Ae(t)});const ME=Symbol("zod_brand");class Kl extends Re{_parse(e){const{ctx:n}=this._processInputParams(e),o=n.data;return this._def.type._parse({data:o,path:n.path,parent:n})}unwrap(){return this._def.type}}class Ii extends Re{_parse(e){const{status:n,ctx:o}=this._processInputParams(e);if(o.common.async)return(async()=>{const i=await this._def.in._parseAsync({data:o.data,path:o.path,parent:o});return i.status==="aborted"?xe:i.status==="dirty"?(n.dirty(),Ds(i.value)):this._def.out._parseAsync({data:i.value,path:o.path,parent:o})})();{const i=this._def.in._parseSync({data:o.data,path:o.path,parent:o});return i.status==="aborted"?xe:i.status==="dirty"?(n.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:o.path,parent:o})}}static create(e,n){return new Ii({in:e,out:n,typeName:we.ZodPipeline})}}class Fi extends Re{_parse(e){const n=this._def.innerType._parse(e),o=i=>(Ci(i)&&(i.value=Object.freeze(i.value)),i);return wi(n)?n.then(i=>o(i)):o(n)}unwrap(){return this._def.innerType}}Fi.create=(t,e)=>new Fi({innerType:t,typeName:we.ZodReadonly,...Ae(e)});function Lp(t,e={},n){return t?xo.create().superRefine((o,i)=>{var l,c;if(!t(o)){const d=typeof e=="function"?e(o):typeof e=="string"?{message:e}:e,p=(c=(l=d.fatal)!==null&&l!==void 0?l:n)!==null&&c!==void 0?c:!0,h=typeof d=="string"?{message:d}:d;i.addIssue({code:"custom",...h,fatal:p})}}):xo.create()}const GE={object:rt.lazycreate};var we;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(we||(we={}));const $E=(t,e={message:`Input not instance of ${t.name}`})=>Lp(n=>n instanceof t,e),Op=mn.create,Mp=wr.create,zE=Gs.create,UE=br.create,Gp=ki.create,ZE=Hr.create,WE=Fs.create,jE=Ei.create,HE=Si.create,qE=xo.create,KE=qr.create,YE=Xn.create,XE=Ls.create,JE=gn.create,QE=rt.create,eS=rt.strictCreate,tS=Ti.create,nS=Os.create,rS=Ni.create,oS=Gn.create,iS=Vi.create,sS=Ms.create,aS=Kr.create,lS=Eo.create,cS=Ai.create,dS=Bi.create,uS=kr.create,pS=Pi.create,hS=So.create,$p=yn.create,fS=$n.create,mS=Er.create,gS=yn.createWithPreprocess,yS=Ii.create;var zn=Object.freeze({__proto__:null,defaultErrorMap:bo,setErrorMap:bE,getErrorMap:Ps,makeIssue:Rs,EMPTY_PATH:xE,addIssueToContext:se,ParseStatus:xt,INVALID:xe,DIRTY:Ds,OK:At,isAborted:Wl,isDirty:jl,isValid:Ci,isAsync:wi,get util(){return $e},get objectUtil(){return Zl},ZodParsedType:ce,getParsedType:Cr,ZodType:Re,datetimeRegex:Ip,ZodString:mn,ZodNumber:wr,ZodBigInt:br,ZodBoolean:ki,ZodDate:Hr,ZodSymbol:Fs,ZodUndefined:Ei,ZodNull:Si,ZodAny:xo,ZodUnknown:qr,ZodNever:Xn,ZodVoid:Ls,ZodArray:gn,ZodObject:rt,ZodUnion:Ti,ZodDiscriminatedUnion:Os,ZodIntersection:Ni,ZodTuple:Gn,ZodRecord:Vi,ZodMap:Ms,ZodSet:Kr,ZodFunction:Eo,ZodLazy:Ai,ZodLiteral:Bi,ZodEnum:kr,ZodNativeEnum:Pi,ZodPromise:So,ZodEffects:yn,ZodTransformer:yn,ZodOptional:$n,ZodNullable:Er,ZodDefault:Ri,ZodCatch:Di,ZodNaN:Gs,BRAND:ME,ZodBranded:Kl,ZodPipeline:Ii,ZodReadonly:Fi,custom:Lp,Schema:Re,ZodSchema:Re,late:GE,get ZodFirstPartyTypeKind(){return we},coerce:{string:t=>mn.create({...t,coerce:!0}),number:t=>wr.create({...t,coerce:!0}),boolean:t=>ki.create({...t,coerce:!0}),bigint:t=>br.create({...t,coerce:!0}),date:t=>Hr.create({...t,coerce:!0})},any:qE,array:JE,bigint:UE,boolean:Gp,date:ZE,discriminatedUnion:nS,effect:$p,enum:uS,function:lS,instanceof:$E,intersection:rS,lazy:cS,literal:dS,map:sS,nan:zE,nativeEnum:pS,never:YE,null:HE,nullable:mS,number:Mp,object:QE,oboolean:()=>Gp().optional(),onumber:()=>Mp().optional(),optional:fS,ostring:()=>Op().optional(),pipeline:yS,preprocess:gS,promise:hS,record:iS,set:aS,strictObject:eS,string:Op,symbol:WE,transformer:$p,tuple:oS,undefined:jE,union:tS,unknown:KE,void:XE,NEVER:xe,ZodIssueCode:te,quotelessJson:wE,ZodError:Wt});function _S(t){throw new Error("Unexpected object: "+t)}const zp="upload://upload/",Up="index://index/";function vS(t){return t.startsWith(zp)}function CS(t){return t.startsWith(Up)}function Zp(t){if(CS(t)){const e=t.slice(Up.length);return JSON.parse(decodeURIComponent(e)).path}else if(vS(t)){const e=t.slice(zp.length);return JSON.parse(decodeURIComponent(e)).localPath}_S(t)}function wS(t){return t.replace(/^.*[\\/]/,"")}function bS(t){return wS(Zp(t))}zn.object({__isRef:zn.literal(!0).describe("Crucial marker for the block dependency tree reconstruction"),blockId:zn.string().describe("Upstream block id"),name:zn.string().describe("Name of the output provided to the upstream block's output context")}).describe("Universal reference type, allowing to set block connections. It is crucial that {@link __isRef} is present and equal to true, internal logic relies on this marker to build block dependency trees.").strict().readonly();const xS=zn.object({type:zn.string(),importance:zn.number().optional(),id:zn.string().optional(),label:zn.string()});zn.array(xS);const kS={key:0,ref:"label"},ES={key:0,class:"required-icon"},SS=["data-placeholder"],TS={key:5,class:"pl-file-input__stats"},NS={key:0,class:"pl-file-input__error"},VS={key:1,class:"pl-file-input__helper"},Wp=r.defineComponent({__name:"PlFileInput",props:{modelValue:{},label:{default:void 0},required:{type:Boolean},dashed:{type:Boolean},extensions:{default:void 0},placeholder:{default:void 0},progress:{default:void 0},error:{default:void 0},helper:{default:void 0},cellStyle:{type:Boolean,default:!1},fileDialogTitle:{default:void 0},fileDialogCloseOnOutsideClick:{type:Boolean,default:!0}},emits:["update:modelValue"],setup(t,{emit:e}){const n=r.reactive({fileDialogOpen:!1,error:""}),o=r.useSlots(),i=e,l=t,c=(F,W)=>{if(F)try{return W(F)}catch(P){return n.error=P instanceof Error?P.message:String(P),F}},d=r.computed(()=>c(l.modelValue,bS)),p=r.computed(()=>c(l.modelValue,Zp)),h=r.computed(()=>l.progress&&!l.progress.done),m=r.computed(()=>l.progress&&l.progress.done),y=r.computed(()=>n.error??l.error),b=r.computed(()=>!!y.value),w=r.computed(()=>{const{status:F,done:W}=l.progress??{};return!F||!F.bytesTotal?"":F.bytesProcessed&&!W?xl(F.bytesProcessed,{})+" / "+xl(F.bytesTotal,{}):xl(F.bytesTotal,{})}),S=r.computed(()=>{var F;const{progress:W}=l;return W?{width:W.done?"100%":Math.round((((F=W.status)==null?void 0:F.progress)??0)*100)+"%"}:{}}),M=()=>{n.fileDialogOpen=!0},O=F=>{F.files.length&&i("update:modelValue",F.files[0])},C=()=>i("update:modelValue",void 0);r.watch(()=>l.modelValue,()=>{n.error=""},{immediate:!0});const I=r.ref();return l.cellStyle||Yn(I),(F,W)=>(r.openBlock(),r.createElementBlock(r.Fragment,null,[r.createElementVNode("div",{class:r.normalizeClass([{"pl-file-input__cell-style":!!F.cellStyle,"has-file":!!d.value},"pl-file-input__envelope"])},[r.createElementVNode("div",{ref_key:"rootRef",ref:I,class:r.normalizeClass(["pl-file-input",{dashed:F.dashed,error:b.value}]),tabindex:"0",onKeyup:r.withKeys(M,["enter"]),onClick:r.withModifiers(M,["stop"])},[r.createElementVNode("div",{class:"pl-file-input__progress",style:r.normalizeStyle(S.value)},null,4),W[3]||(W[3]=r.createTextVNode()),!F.cellStyle&&F.label?(r.openBlock(),r.createElementBlock("label",kS,[F.required?(r.openBlock(),r.createElementBlock("i",ES)):r.createCommentVNode("",!0),W[1]||(W[1]=r.createTextVNode()),r.createElementVNode("span",null,r.toDisplayString(F.label),1),W[2]||(W[2]=r.createTextVNode()),r.unref(o).tooltip||p.value?(r.openBlock(),r.createBlock(r.unref(vt),{key:1,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.unref(o).tooltip?r.renderSlot(F.$slots,"tooltip",{key:0}):(r.openBlock(),r.createElementBlock(r.Fragment,{key:1},[r.createTextVNode(r.toDisplayString(p.value),1)],64))]),_:3})):r.createCommentVNode("",!0)],512)):r.createCommentVNode("",!0),W[4]||(W[4]=r.createTextVNode()),b.value?(r.openBlock(),r.createBlock(r.unref(Vt),{key:1,name:"restart"})):h.value?(r.openBlock(),r.createBlock(r.unref(Vt),{key:2,name:"cloud-upload"})):m.value?(r.openBlock(),r.createBlock(r.unref(Vt),{key:3,name:"success"})):(r.openBlock(),r.createBlock(r.unref(Vt),{key:4,name:"paper-clip"})),W[5]||(W[5]=r.createTextVNode()),r.createElementVNode("div",{"data-placeholder":F.placeholder??"Choose file",class:"pl-file-input__filename"},r.toDisplayString(d.value),9,SS),W[6]||(W[6]=r.createTextVNode()),w.value?(r.openBlock(),r.createElementBlock("div",TS,r.toDisplayString(w.value),1)):r.createCommentVNode("",!0),W[7]||(W[7]=r.createTextVNode()),F.modelValue?(r.openBlock(),r.createBlock(r.unref(Vt),{key:6,name:"close",onClick:r.withModifiers(C,["stop"])})):r.createCommentVNode("",!0),W[8]||(W[8]=r.createTextVNode()),r.createVNode(vr,{class:"pl-file-input__contour"})],34),W[9]||(W[9]=r.createTextVNode()),b.value?(r.openBlock(),r.createElementBlock("div",NS,r.toDisplayString(y.value),1)):F.helper?(r.openBlock(),r.createElementBlock("div",VS,r.toDisplayString(F.helper),1)):r.createCommentVNode("",!0)],2),W[10]||(W[10]=r.createTextVNode()),r.createVNode(r.unref(Vp),{modelValue:n.fileDialogOpen,"onUpdate:modelValue":W[0]||(W[0]=P=>n.fileDialogOpen=P),extensions:F.extensions,title:F.fileDialogTitle,"close-on-outside-click":F.fileDialogCloseOnOutsideClick,"onImport:files":O},null,8,["modelValue","extensions","title","close-on-outside-click"])],64))}}),AS={class:"pl-notification-alert__wrapper d-flex"},BS={class:"pl-notification-alert__content flex-grow-1"},PS={key:0,class:"pl-notification-alert__close"},RS={key:0,class:"pl-notification-alert__actions d-flex"},jp=r.defineComponent({__name:"PlNotificationAlert",props:r.mergeModels({type:{default:"neutral"},width:{default:"256px"},closable:{type:Boolean}},{modelValue:{type:Boolean,default:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=t,n=r.useModel(t,"modelValue");function o(){e.closable&&(n.value=!1)}return(i,l)=>n.value?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass([i.type,"pl-notification-alert d-flex flex-column gap-16"]),style:r.normalizeStyle({width:`${i.width}`})},[r.createElementVNode("div",AS,[r.createElementVNode("div",BS,[r.renderSlot(i.$slots,"default")]),l[0]||(l[0]=r.createTextVNode()),i.closable?(r.openBlock(),r.createElementBlock("div",PS,[r.createVNode(r.unref(vo),{icon:"close",onClick:o})])):r.createCommentVNode("",!0)]),l[1]||(l[1]=r.createTextVNode()),i.$slots.actions?(r.openBlock(),r.createElementBlock("div",RS,[r.renderSlot(i.$slots,"actions")])):r.createCommentVNode("",!0)],6)):r.createCommentVNode("",!0)}}),DS=r.defineComponent({__name:"ContextProvider",props:{context:{},contextKey:{}},setup(t){const e=t;return r.provide(e.contextKey,r.computed(()=>e.context)),(n,o)=>r.renderSlot(n.$slots,"default")}});function kt(t,e,n){return e>t?e:t>n?n:t}const Yl=t=>r.computed(()=>{const e=[100],{min:n,max:o,step:i}=t.value;let l=n;for(;l<o;){l+=i;const c=(1-(kt(l,n,o)-n)/(o-n))*100;e.push(c)}return e}),IS={class:"ui-slider__wrapper"},FS={class:"ui-slider__label-section"},LS={key:0,class:"text-s"},OS={key:1,class:"ui-slider__value-static text-s"},MS={class:"ui-slider__base"},GS={class:"ui-slider__container"},$S={class:"ui-slider__container ui-slider__container-thumb"},zS={class:"ui-slider__input-wrapper d-flex"},US=["value"],ZS={key:0,class:"ui-slider__error"},Hp=r.defineComponent({__name:"Slider",props:{modelValue:{},min:{default:0},max:{},step:{default:1},label:{default:void 0},helper:{default:void 0},error:{default:void 0},mode:{default:"text"},measure:{default:""},breakpoints:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{emit:e}){const n=r.useSlots(),o=e,i=t,l=r.reactive({deltaValue:0}),c=r.computed(()=>i.max-i.min),d=r.computed(()=>kt((i.modelValue??0)+l.deltaValue,i.min,i.max)),p=r.ref(i.modelValue),h=r.computed(()=>{const P=i.modelValue;return Number.isFinite(P)?P<i.min?`Min value: ${i.min}`:P>i.max?`Max value: ${i.max}`:i.error:"Not a number"}),m=r.computed(()=>i),y=Yl(m),b=r.computed(()=>(d.value-i.min)/c.value),w=r.computed(()=>({right:Math.ceil((1-b.value)*100)+"%"})),S=r.computed(()=>({right:`calc(${Math.ceil((1-b.value)*100)}%) `})),M=r.ref(),O=r.ref();r.watch(()=>i.modelValue,P=>{p.value=P});function C(P){const V=kt(P,i.min,i.max);return Math.round((V+Number.EPSILON)*(1/i.step))/(1/i.step)}yr(O,P=>{var V;_t((V=r.unref(M))==null?void 0:V.getBoundingClientRect(),Z=>{const{dx:J}=P;l.deltaValue=J/Z.width*c.value,p.value=C(kt((i.modelValue??0)+l.deltaValue,i.min,i.max)),P.stop&&(o("update:modelValue",C(d.value)),l.deltaValue=0)})});function I(P){o("update:modelValue",C(P))}function F(P){I(+P.target.value)}function W(P){["ArrowDown","ArrowUp","ArrowRight","ArrowLeft","Enter"].includes(P.code)&&P.preventDefault();const V=P.code==="ArrowUp"||P.code==="ArrowRight"?i.step*1:P.code==="ArrowDown"||P.code==="ArrowLeft"?i.step*-1:0;I(i.modelValue+V)}return(P,V)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass([i.disabled?"ui-slider__disabled":void 0,"ui-slider__envelope"])},[r.createElementVNode("div",{class:r.normalizeClass([`ui-slider__mode-${i.mode}`,"ui-slider"])},[r.createElementVNode("div",IS,[r.createElementVNode("div",FS,[P.label?(r.openBlock(),r.createElementBlock("label",LS,[r.createElementVNode("span",null,r.toDisplayString(P.label),1),V[1]||(V[1]=r.createTextVNode()),r.unref(n).tooltip?(r.openBlock(),r.createBlock(r.unref(vt),{key:0,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.renderSlot(P.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0),V[2]||(V[2]=r.createTextVNode()),i.mode==="text"?(r.openBlock(),r.createElementBlock("div",OS,r.toDisplayString(p.value)+r.toDisplayString(P.measure),1)):r.createCommentVNode("",!0)]),V[6]||(V[6]=r.createTextVNode()),r.createElementVNode("div",MS,[r.createElementVNode("div",GS,[r.createElementVNode("div",{ref_key:"barRef",ref:M,class:"ui-slider__bar"},[r.createElementVNode("div",{class:"ui-slider__progress",style:r.normalizeStyle(w.value)},null,4)],512)]),V[5]||(V[5]=r.createTextVNode()),r.createElementVNode("div",$S,[i.breakpoints?(r.openBlock(!0),r.createElementBlock(r.Fragment,{key:0},r.renderList(r.unref(y),(Z,J)=>(r.openBlock(),r.createElementBlock("div",{key:J,style:r.normalizeStyle({right:`${Z}%`}),class:"ui-slider__thumb-step"},null,4))),128)):r.createCommentVNode("",!0),V[4]||(V[4]=r.createTextVNode()),r.createElementVNode("div",{ref_key:"thumbRef",ref:O,tabindex:"0",class:"ui-slider__thumb ui-slider__thumb-active",style:r.normalizeStyle(S.value),onKeydown:W},V[3]||(V[3]=[r.createElementVNode("div",{class:"ui-slider__thumb-focused-contour"},null,-1)]),36)])])]),V[7]||(V[7]=r.createTextVNode()),r.createElementVNode("div",zS,[i.mode==="input"?(r.openBlock(),r.createElementBlock("input",{key:0,value:p.value,class:"ui-slider__value text-s",onChange:V[0]||(V[0]=Z=>F(Z))},null,40,US)):r.createCommentVNode("",!0)])],2),V[8]||(V[8]=r.createTextVNode()),h.value?(r.openBlock(),r.createElementBlock("div",ZS,r.toDisplayString(h.value),1)):r.createCommentVNode("",!0)],2))}});function WS(t,e=null,n=null){function o(d){const{scrollTop:p,scrollHeight:h,clientHeight:m}=d;if(!(h>m)||!e)return null;const y=h-p-m,b=p>e?e:0,w=y>e?m-e-b:m;return`linear-gradient(
52
+ `,X0=["innerHTML"],J0={class:"dropdown-list-item__title-container"},Q0={class:"dropdown-list-item__title text-s"},ew={key:0,class:"dropdown-list-item__description text-description"},tw={key:1,class:"dropdown-list-item__icon flex-self-start"},Co=r.defineComponent({__name:"DropdownListItem",props:{option:{},isSelected:{type:Boolean,default:!1},size:{default:"small"},isHovered:{type:Boolean,default:!1},useCheckbox:{type:Boolean,default:!1}},setup(t){const e=t,n=r.computed(()=>{const l=[];return e.size==="small"&&l.push("dropdown-list-item__small"),e.isSelected&&l.push("dropdown-list-item__selected"),e.isHovered&&l.push("hovered-item"),l.join(" ")}),o=r.computed(()=>{const l=["dropdown-list-item__checkbox","flex-self-start"];return e.isSelected&&l.push("checked"),l.join(" ")}),i=r.computed(()=>e.isSelected?Y0:K0);return(l,c)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass([n.value,"dropdown-list-item"])},[e.useCheckbox?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(o.value),innerHTML:i.value},null,10,X0)):r.createCommentVNode("",!0),c[1]||(c[1]=r.createTextVNode()),r.createElementVNode("div",J0,[r.createElementVNode("div",Q0,r.toDisplayString(l.option.label),1),c[0]||(c[0]=r.createTextVNode()),l.option.description?(r.openBlock(),r.createElementBlock("div",ew,r.toDisplayString(l.option.description),1)):r.createCommentVNode("",!0)]),c[2]||(c[2]=r.createTextVNode()),!e.useCheckbox&&e.isSelected?(r.openBlock(),r.createElementBlock("div",tw)):r.createCommentVNode("",!0)],2))}});function Ci(t,e){const n=Vl(()=>{if(t.value){const{scrollTop:o,scrollLeft:i,scrollHeight:l,scrollWidth:c,clientHeight:d,clientWidth:p}=document.documentElement,h=t.value.getBoundingClientRect();e({scrollTop:o,scrollLeft:i,scrollHeight:l,scrollWidth:c,clientHeight:d,clientWidth:p,offsetY:o+h.y,offsetX:i+h.x,top:h.top,right:h.right,bottom:h.bottom,left:h.left,width:h.width,height:h.height,x:h.x,y:h.y})}});r.onMounted(n),st(window,"scroll",n,{capture:!0,passive:!0}),st(window,"resize",n,{passive:!0}),st(window,"adjust",n,!0)}const nw=r.defineComponent({__name:"PlMaskIcon16",props:{name:{},size:{}},setup(t){const e=t,n=r.computed(()=>e.size==="large"?"--mask-size: 24px":""),o=r.computed(()=>`mask-16 mask-${e.name}`);return(i,l)=>(r.openBlock(),r.createElementBlock("i",{style:r.normalizeStyle(n.value),class:r.normalizeClass([o.value,i.$style.icon])},null,6))}}),rw="_icon_1ugxm_2",ow={icon:rw},iw={$style:ow},Vt=Mt(nw,[["__cssModules",iw]]),sw=["onKeyup"],aw=r.defineComponent({__name:"PlBtnSplit",props:r.mergeModels({options:{},disabled:{type:Boolean},loading:{type:Boolean}},{modelValue:{required:!0},modelModifiers:{}}),emits:r.mergeModels(["click"],["update:modelValue"]),setup(t,{expose:e,emit:n}){const o=t,i=n,l=r.useModel(t,"modelValue"),c=r.ref(),d=r.ref(),p=r.ref(),h=r.ref(),m=r.reactive({open:!1,optionsHeight:0,activeIndex:-1});e({data:m});const y=r.reactive({top:"0px",left:"0px",width:"0px"});r.watch(d,P=>{if(P){const V=P.getBoundingClientRect();m.optionsHeight=V.height,window.dispatchEvent(new CustomEvent("adjust"))}},{immediate:!0});const b=r.computed(()=>m.open?"mask-24 mask-chevron-up":"mask-24 mask-chevron-down"),w=r.computed(()=>(o.options??[]).findIndex(P=>yi(P.value,l.value))),S=r.computed(()=>_r(o.options??[]).map((P,V)=>({...P,index:V,isSelected:V===w.value,isActive:V===m.activeIndex}))),M=r.computed(()=>o.loading||o.options===void 0),O=r.computed(()=>{var P;return((P=S.value.find(V=>yi(V.value,l.value)))==null?void 0:P.label)??(o.options===void 0?"...":"")});Ci(c,P=>{const V=P.top+P.height+3;V+m.optionsHeight>P.clientHeight?y.top=P.top-m.optionsHeight-3+"px":y.top=V+"px",y.left=P.left+"px",y.width=P.width+"px"});const v=P=>{var V;l.value=P,m.open=!1,(V=c==null?void 0:c.value)==null||V.focus()};function I(){i("click")}const F=P=>{var V,Z;if(["ArrowDown","ArrowUp","Enter","Escape"].includes(P.code))P.preventDefault();else return;if(P.target===h.value&&P.code==="Enter"){I();return}const{open:J,activeIndex:ae}=m;if(!J&&P.target===p.value){P.code==="Enter"&&(m.open=!0);return}P.code==="Escape"&&(m.open=!1,(V=c.value)==null||V.focus());const $=r.unref(S),{length:j}=$;if(!j)return;P.code==="Enter"&&v((Z=$.find(B=>B.index===ae))==null?void 0:Z.value);const U=$.findIndex(B=>B.index===ae)??-1,k=P.code==="ArrowDown"?1:P.code==="ArrowUp"?-1:0,x=Math.abs(U+k+j)%j;m.activeIndex=S.value[x].index??-1},W=P=>{var V,Z;const J=P.relatedTarget;!((V=c.value)!=null&&V.contains(J))&&!((Z=d.value)!=null&&Z.contains(J))&&(m.open=!1)};return(P,V)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"root",ref:c,class:r.normalizeClass([{disabled:P.disabled||M.value,loading:M.value},"pl-btn-split d-flex"]),onFocusout:W,onKeydown:F},[r.createElementVNode("div",{ref_key:"buttonAction",ref:h,class:"pl-btn-split__title flex-grow-1 d-flex align-center text-s-btn",tabindex:"0",onClick:I,onKeyup:r.withKeys(r.withModifiers(I,["stop"]),["enter"])},r.toDisplayString(O.value),41,sw),V[1]||(V[1]=r.createTextVNode()),r.createElementVNode("div",{ref_key:"menuActivator",ref:p,class:"pl-btn-split__icon-container d-flex align-center justify-center",tabindex:"0",onClick:V[0]||(V[0]=Z=>m.open=!m.open)},[M.value?(r.openBlock(),r.createBlock(Vt,{key:0,name:"loading"})):(r.openBlock(),r.createElementBlock("div",{key:1,class:r.normalizeClass([b.value,"pl-btn-split__icon"])},null,2))],512),V[2]||(V[2]=r.createTextVNode()),m.open?(r.openBlock(),r.createBlock(r.Teleport,{key:0,to:"body"},[r.createElementVNode("div",{ref_key:"list",ref:d,class:"pl-dropdown__options",style:r.normalizeStyle(y),tabindex:"-1"},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(S.value,(Z,J)=>(r.openBlock(),r.createBlock(Co,{key:J,option:Z,"is-selected":Z.isSelected,"is-hovered":Z.isActive,size:"medium",onClick:r.withModifiers(ae=>v(Z.value),["stop"])},null,8,["option","is-selected","is-hovered","onClick"]))),128))],4)])):r.createCommentVNode("",!0)],34))}});function up(t){function e(n){const o=n.currentTarget,i=document.createElement("span"),l=Math.max(o.clientWidth,o.clientHeight),c=l/2;i.style.width=i.style.height=`${l}px`,i.style.left=`${n.clientX-o.offsetLeft-c}px`,i.style.top=`${n.clientY-o.offsetTop-c}px`,i.classList.add("ripple");const d=o.getElementsByClassName("ripple")[0];d&&d.remove(),o.appendChild(i)}r.onMounted(()=>{var n;(n=t.value)==null||n.addEventListener("click",e)})}const lw={key:0},cw={inheritAttrs:!1},Ss=r.defineComponent({...cw,__name:"BtnBase",props:{loading:{type:Boolean},small:{type:Boolean},large:{type:Boolean},size:{},round:{type:Boolean},icon:{},reverse:{type:Boolean},justifyCenter:{type:Boolean}},setup(t){const e=t,n=r.ref(),o=r.computed(()=>e.small||e.size==="small"),i=r.computed(()=>e.large||e.size==="large");return up(n),(l,c)=>(r.openBlock(),r.createElementBlock("button",r.mergeProps({ref_key:"btn",ref:n,tabindex:"0",class:{loading:l.loading,small:o.value,large:i.value,round:l.round,reverse:l.reverse,justifyCenter:l.justifyCenter,[l.$attrs.class+""]:!0}},{...l.$attrs,disabled:!!l.$attrs.disabled||l.loading}),[l.round?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("span",lw,[r.renderSlot(l.$slots,"default")])),c[0]||(c[0]=r.createTextVNode()),l.loading?(r.openBlock(),r.createBlock(r.unref(Vt),{key:1,name:"loading",size:l.size},null,8,["size"])):l.icon?(r.openBlock(),r.createBlock(r.unref(Vt),{key:2,name:l.icon,size:l.size},null,8,["name","size"])):r.createCommentVNode("",!0)],16))}}),dw={name:"PlBtnPrimary"},Ts=r.defineComponent({...dw,props:{loading:{type:Boolean},size:{},round:{type:Boolean},icon:{},reverse:{type:Boolean},justifyCenter:{type:Boolean}},setup(t){const e=t;return(n,o)=>(r.openBlock(),r.createBlock(Ss,r.mergeProps({class:"pl-btn-primary"},e),{default:r.withCtx(()=>[r.renderSlot(n.$slots,"default")]),_:3},16))}}),uw={name:"PlBtnAccent"},pw=r.defineComponent({...uw,props:{loading:{type:Boolean},size:{},round:{type:Boolean},icon:{},reverse:{type:Boolean},justifyCenter:{type:Boolean}},setup(t){const e=t;return(n,o)=>(r.openBlock(),r.createBlock(Ss,r.mergeProps({class:"pl-btn-accent"},e),{default:r.withCtx(()=>[r.renderSlot(n.$slots,"default")]),_:3},16))}}),hw={name:"PlBtnDanger"},fw=r.defineComponent({...hw,props:{loading:{type:Boolean},size:{},round:{type:Boolean},icon:{},reverse:{type:Boolean},justifyCenter:{type:Boolean}},setup(t){const e=t;return(n,o)=>(r.openBlock(),r.createBlock(Ss,r.mergeProps({class:"pl-btn-danger"},e),{default:r.withCtx(()=>[r.renderSlot(n.$slots,"default")]),_:3},16))}}),mw={name:"PlBtnSecondary"},Rl=r.defineComponent({...mw,props:{loading:{type:Boolean},size:{},round:{type:Boolean},icon:{},reverse:{type:Boolean},justifyCenter:{type:Boolean}},setup(t){const e=t;return(n,o)=>(r.openBlock(),r.createBlock(Ss,r.mergeProps(e,{class:"pl-btn-secondary"}),{default:r.withCtx(()=>[r.renderSlot(n.$slots,"default")]),_:3},16))}}),gw={key:0},yw={name:"PlBtnGhost"},vo=r.defineComponent({...yw,props:{loading:{type:Boolean},size:{default:void 0},round:{type:Boolean},icon:{default:void 0},reverse:{type:Boolean},justifyCenter:{type:Boolean,default:!1}},setup(t){const e=t,n=r.computed(()=>e.size==="small"),o=r.computed(()=>e.size==="large"),i=r.ref(),l=r.useSlots();return up(i),(c,d)=>(r.openBlock(),r.createElementBlock("button",r.mergeProps({ref_key:"btnRef",ref:i,tabindex:"0",class:["pl-btn-ghost",{loading:c.loading,small:n.value,large:o.value,round:c.round,reverse:c.reverse,justifyCenter:c.justifyCenter,[c.$attrs.class+""]:!0}]},{...c.$attrs,disabled:!!c.$attrs.disabled||c.loading}),[r.unref(l).default&&!c.round?(r.openBlock(),r.createElementBlock("span",gw,[r.renderSlot(c.$slots,"default")])):r.createCommentVNode("",!0),d[0]||(d[0]=r.createTextVNode()),c.loading?(r.openBlock(),r.createBlock(r.unref(Vt),{key:1,name:"loading",size:c.size},null,8,["size"])):c.icon?(r.openBlock(),r.createBlock(r.unref(Vt),{key:2,name:c.icon,size:c.size},null,8,["name","size"])):r.createCommentVNode("",!0),d[1]||(d[1]=r.createTextVNode()),r.renderSlot(c.$slots,"append")],16))}}),_w=r.defineComponent({__name:"PlBtnLink",props:{loading:{type:Boolean},size:{},icon:{},reverse:{type:Boolean},justifyCenter:{type:Boolean},disabled:{type:Boolean}},setup(t){const e=t,n=r.ref(!1);return(o,i)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["ui-btn-link",{disabled:o.disabled,loading:o.loading,hover:n.value}]),onMouseover:i[0]||(i[0]=l=>n.value=!0),onMouseleave:i[1]||(i[1]=l=>n.value=!1)},[r.createVNode(Rl,r.mergeProps({round:"",hover:n.value},e),null,16,["hover"]),i[2]||(i[2]=r.createTextVNode()),r.renderSlot(o.$slots,"default")],34))}});function Cw(t,e){const n=r.ref();return Ci(t,o=>{n.value=o}),r.computed(()=>{const o=r.unref(n),i=r.unref(e),l=i.position??"top",c=i.gap??8;if(!o)return"";const d=o.offsetY+Math.floor(o.height/2),p=o.offsetX+Math.floor(o.width/2);return l==="top-left"?`left: ${o.offsetX}px; top: ${o.offsetY-c}px;`:l==="top"?`left: ${p}px; top: ${o.offsetY-c}px;`:l==="right"?`left: ${o.offsetX+o.width+c}px; top: ${d}px;`:l==="left"?`right: ${o.scrollWidth-o.x+c}px; top: ${d}px;`:l==="southwest"?`left: ${o.offsetX+o.width}px; top: ${o.offsetY+o.height+c}px;`:""})}function vi(t,e){return e(t)}function _t(t,e){if(t!=null)return e(t)}function vw(t){return Array.isArray(t)?t:[t]}function ww(t,e,...n){n.forEach(o=>{t[o]=e[o]})}function Ns(t,e){st(document,"click",n=>{document.contains(n.target)&&(vw(t).map(o=>o.value).filter(o=>!!o).some(o=>o==null?void 0:o.contains(n.target))||e())})}const bw={},xw={class:"beak",width:"5",height:"9",viewBox:"0 0 3 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function kw(t,e){return r.openBlock(),r.createElementBlock("svg",xw,e[0]||(e[0]=[r.createElementVNode("path",{d:"M4.00222 8.00933L0 4.00711L4.00222 0.00488281L4.00222 8.00933Z",fill:"#24223D"},null,-1)]))}const Ew=Mt(bw,[["render",kw]]),Dl=new Map,Sw={name:"PlTooltip"},Ct=r.defineComponent({...Sw,props:{openDelay:{default:100},closeDelay:{default:1e3},position:{default:"top"},hide:{type:Boolean},gap:{default:8},element:{default:"div"},maxWidth:{default:"300px"}},emits:["tooltip:close"],setup(t,{emit:e}){const n=e,o=Symbol(),i=t,l=r.reactive({open:!1,over:!1,tooltipOpen:!1,key:Symbol()});Dl.set(o,()=>h()),r.watch(()=>l.open,O=>{requestAnimationFrame(()=>{l.tooltipOpen=O})});let c=()=>{};const d=sp(()=>window.dispatchEvent(new CustomEvent("adjust")),1e3),p=()=>{l.open=!0;for(let[O,v]of Dl.entries())O!==o&&v()},h=()=>{l.open=!1,n("tooltip:close")},m=async()=>{i.hide||(d(),l.over=!0,c(),await ep(100),l.over&&p())},y=()=>{l.over=!1,c=tp(()=>{l.over||h()},i.closeDelay)};r.watch(()=>i.hide,O=>{O&&h()});const b=r.ref(),w=r.ref(),S=Cw(b,r.toRef(i));Ns([b,w],()=>h());const M=r.computed(()=>({"--pl-tooltip-max-width":i.maxWidth}));return r.onUnmounted(()=>{Dl.delete(o)}),(O,v)=>(r.openBlock(),r.createBlock(r.resolveDynamicComponent(O.element),r.mergeProps(O.$attrs,{ref_key:"rootRef",ref:b,onClick:m,onMouseover:m,onMouseleave:y}),{default:r.withCtx(()=>[r.renderSlot(O.$slots,"default"),v[1]||(v[1]=r.createTextVNode()),O.$slots.tooltip&&l.open?(r.openBlock(),r.createBlock(r.Teleport,{key:0,to:"body"},[r.createVNode(r.Transition,{name:"tooltip-transition"},{default:r.withCtx(()=>[l.tooltipOpen?(r.openBlock(),r.createElementBlock("div",{key:0,class:"pl-tooltip__container",style:r.normalizeStyle(r.unref(S))},[r.createElementVNode("div",{ref_key:"tooltip",ref:w,class:r.normalizeClass(["pl-tooltip",O.position]),style:r.normalizeStyle(M.value),onMouseover:m,onMouseleave:y},[r.createElementVNode("div",null,[r.renderSlot(O.$slots,"tooltip")]),v[0]||(v[0]=r.createTextVNode()),r.createVNode(Ew)],38)],4)):r.createCommentVNode("",!0)]),_:3})])):r.createCommentVNode("",!0)]),_:3},16))}}),Tw={},Nw={class:"inner-border"};function Vw(t,e,n,o,i,l){return r.openBlock(),r.createElementBlock("div",Nw,[r.renderSlot(t.$slots,"default")])}const Aw=Mt(Tw,[["render",Vw]]),Bw={key:0},Pw=["tabindex","onKeydown","onClick"],Rw={key:1,class:"pl-btn-group__helper"},Dw={key:2,class:"pl-btn-group__error"},Iw={name:"PlBtnGroup"},pp=r.defineComponent({...Iw,props:{modelValue:{},label:{},options:{},disabled:{type:Boolean},compact:{type:Boolean},helper:{},error:{}},emits:["update:modelValue"],setup(t,{emit:e}){const n=r.useSlots(),o=e,i=d=>o("update:modelValue",d),l=t,c=r.computed(()=>l.options.map(d=>({label:"label"in d?d.label:d.text,value:d.value})));return(d,p)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["pl-btn-group",{disabled:d.disabled,compact:d.compact}])},[d.label?(r.openBlock(),r.createElementBlock("label",Bw,[r.createElementVNode("span",null,r.toDisplayString(d.label),1),p[0]||(p[0]=r.createTextVNode()),r.unref(n).tooltip?(r.openBlock(),r.createBlock(r.unref(Ct),{key:0,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.renderSlot(d.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0),p[1]||(p[1]=r.createTextVNode()),r.createVNode(Aw,{class:"pl-btn-group__container"},{default:r.withCtx(()=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(c.value,(h,m)=>(r.openBlock(),r.createElementBlock("div",{key:m,class:r.normalizeClass(["pl-btn-group__option text-s",{active:d.modelValue===h.value}]),tabindex:d.modelValue===h.value||d.disabled?void 0:0,onKeydown:r.withKeys(y=>i(h.value),["enter"]),onClick:y=>i(h.value)},r.toDisplayString(h.label),43,Pw))),128))]),_:1}),p[2]||(p[2]=r.createTextVNode()),d.helper?(r.openBlock(),r.createElementBlock("div",Rw,r.toDisplayString(d.helper),1)):d.error?(r.openBlock(),r.createElementBlock("div",Dw,r.toDisplayString(d.error),1)):r.createCommentVNode("",!0)],2))}});function Fw(t,e){const n=r.ref(),o=r.ref(),{parse:i,update:l}=e,c=()=>{n.value=void 0,o.value=void 0},d=r.computed({get(){return n.value!==void 0?n.value:t.value},set(p){c();try{const h=i?i(p):p;!l||l(h)?t.value=h:n.value=h}catch(h){n.value=p,o.value=h instanceof Error?h.message:String(h)}}});return r.reactive({value:d,error:o,reset:c})}const Lw="_component_1abv8_1",Ow="_container_1abv8_15",Mw="_error_1abv8_69",Il={component:Lw,container:Ow,error:Mw},Gw={key:0},$w=["placeholder"],zw=r.defineComponent({__name:"PlEditableTitle",props:r.mergeModels({placeholder:{default:"Title"},maxWidth:{default:"80%"},prefix:{default:void 0},maxLength:{default:1e3},minLength:{default:void 0}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=r.useModel(t,"modelValue"),n=t,o=Fw(e,{update(){return!1},parse:d=>{if(typeof d!="string")throw Error("value should be a string");if(n.maxLength&&d.length>n.maxLength)throw Error(`Max title length is ${n.maxLength} characters`);if(n.minLength&&d.length<n.minLength)throw Error(`Min title length is ${n.minLength} characters`);return d.trim()}}),i=r.computed(()=>({maxWidth:n.maxWidth??"80%"})),l=()=>{e.value=o.value&&!o.error?o.value:e.value,o.reset()},c=r.ref();return(d,p)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["pl-editable-title",r.unref(Il).component]),style:r.normalizeStyle(i.value)},[r.createElementVNode("div",{class:r.normalizeClass(r.unref(Il).container),onClick:p[3]||(p[3]=()=>{var h;return(h=c.value)==null?void 0:h.focus()})},[d.prefix?(r.openBlock(),r.createElementBlock("span",Gw,r.toDisplayString(d.prefix.trim())+" ",1)):r.createCommentVNode("",!0),p[4]||(p[4]=r.createTextVNode()),r.withDirectives(r.createElementVNode("input",{ref_key:"inputRef",ref:c,"onUpdate:modelValue":p[0]||(p[0]=h=>r.unref(o).value=h),placeholder:d.placeholder,onFocusout:l,onKeydown:[p[1]||(p[1]=r.withKeys((...h)=>r.unref(o).reset&&r.unref(o).reset(...h),["escape"])),p[2]||(p[2]=r.withKeys(h=>{var m;return(m=h.target)==null?void 0:m.blur()},["enter"]))]},null,40,$w),[[r.vModelText,r.unref(o).value]])],2),p[5]||(p[5]=r.createTextVNode()),r.unref(o).error?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(r.unref(Il).error)},r.toDisplayString(r.unref(o).error),3)):r.createCommentVNode("",!0)],6))}}),Uw={inheritAttrs:!1},Zw={class:"double-contour"};function Ww(t,e,n,o,i,l){return r.openBlock(),r.createElementBlock("div",Zw,[r.createElementVNode("div",r.normalizeProps(r.guardReactiveProps(t.$attrs)),[r.renderSlot(t.$slots,"default")],16)])}const Cr=Mt(Uw,[["render",Ww]]);function hp(t){r.onMounted(t),r.onUpdated(t)}const Fl=new WeakMap,Ll=new ResizeObserver(t=>{for(const e of t)_t(Fl.get(e.target),n=>n(e))});function fp(t,e){Fl.set(t,e),Ll.unobserve(t),Ll.observe(t)}function mp(t){Ll.unobserve(t),Fl.delete(t)}const jw=8,gp=4;function Yn(t,e="label"){const n=new Set;hp(()=>{_t(t==null?void 0:t.value,o=>{const i=o.querySelector(e);i&&(n.add(i),fp(i,()=>{const l=Qu(()=>i.getBoundingClientRect().width+vi(jw,c=>Number.isNaN(c)?gp:c+gp));o.style.getPropertyValue("--label-offset-right-x")!==`${l}px`&&o.style.setProperty("--label-offset-right-x",`${l}px`)}))})}),r.onBeforeUnmount(()=>{Array.from(n.values()).map(o=>mp(o))})}function Hw(t,e){const n=[];return e&&e.length>0&&e.forEach(o=>{const i=o(t);typeof i=="string"&&n.push(i)}),{isValid:n.length===0,errors:n}}function yp(t,e){return r.computed(()=>Hw(t.value,e))}const qw=r.defineComponent({__name:"PlIcon16",props:{name:{},size:{}},setup(t){const e=t,n=r.computed(()=>e.size==="large"?"--icon-size: 24px":""),o=r.computed(()=>`icon-16 icon-${e.name}`);return(i,l)=>(r.openBlock(),r.createElementBlock("i",{style:r.normalizeStyle(n.value),class:r.normalizeClass([o.value,i.$style.icon])},null,6))}}),Kw="_icon_1ugxm_2",Yw={icon:Kw},Xw={$style:Yw},Wr=Mt(qw,[["__cssModules",Xw]]),Jw=r.defineComponent({__name:"PlMaskIcon24",props:{name:{},size:{}},setup(t){const e=t,n=r.computed(()=>`mask-24 mask-${e.name}`);return(o,i)=>(r.openBlock(),r.createElementBlock("i",{class:r.normalizeClass([n.value,o.$style.icon])},null,2))}}),Qw="_icon_1ugxm_2",eb={icon:Qw},tb={$style:eb},At=Mt(Jw,[["__cssModules",tb]]),nb={class:"pl-text-field__envelope"},rb={key:0,ref:"label"},ob={key:0,class:"required-icon"},ib={key:1,class:"pl-text-field__prefix"},sb=["disabled","placeholder","type"],ab={class:"pl-text-field__append"},lb={key:0,class:"pl-text-field__error"},cb={key:1,class:"pl-text-field__helper"},db={name:"PlTextField"},jr=r.defineComponent({...db,props:r.mergeModels({label:{},clearable:{type:[Boolean,Function]},parse:{type:Function},required:{type:Boolean},error:{},helper:{},placeholder:{},disabled:{type:Boolean},dashed:{type:Boolean},prefix:{},rules:{},type:{}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=r.useSlots(),n=r.useModel(t,"modelValue"),o=t,i=r.ref(void 0),l=r.ref(),c=r.ref(!1),d=r.reactive({cached:void 0}),p=r.computed({get(){return d.cached?d.cached.value:n.value===void 0||n.value===null?"":String(n.value)},set(W){if(d.cached=void 0,o.parse)try{n.value=o.parse(W)}catch(P){d.cached={error:P instanceof Error?P.message:String(P),value:W}}else n.value=W}}),h=r.computed(()=>o.type&&o.type==="password"?c.value?"text":o.type:"text"),m=r.computed(()=>c.value?"view-show":"view-hide"),y=()=>{o.clearable&&(d.cached=void 0,n.value=o.clearable===!0?"":o.clearable())},b=yp(p,o.rules||[]),w=r.computed(()=>o.clearable?o.clearable===!0?n.value==="":n.value===o.clearable():n.value===""),S=r.computed(()=>!w.value),M=r.computed(()=>{const W=[];return o.error&&W.push(o.error),d.cached&&W.push(d.cached.error),b.value.isValid||W.push(...b.value.errors),W}),O=r.computed(()=>M.value.length>0),v=r.computed(()=>o.clearable&&S.value&&o.type!=="password"&&!o.disabled),I=()=>c.value=!c.value,F=()=>{d.cached=void 0};return Yn(i),(W,P)=>(r.openBlock(),r.createElementBlock("div",nb,[r.createElementVNode("div",{ref_key:"rootRef",ref:i,class:r.normalizeClass(["pl-text-field",{error:O.value,disabled:W.disabled,dashed:W.dashed,nonEmpty:S.value}])},[W.label?(r.openBlock(),r.createElementBlock("label",rb,[W.required?(r.openBlock(),r.createElementBlock("i",ob)):r.createCommentVNode("",!0),P[1]||(P[1]=r.createTextVNode()),r.createElementVNode("span",null,r.toDisplayString(W.label),1),P[2]||(P[2]=r.createTextVNode()),r.unref(e).tooltip?(r.openBlock(),r.createBlock(r.unref(Ct),{key:1,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.renderSlot(W.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)],512)):r.createCommentVNode("",!0),P[5]||(P[5]=r.createTextVNode()),W.prefix?(r.openBlock(),r.createElementBlock("div",ib,r.toDisplayString(W.prefix),1)):r.createCommentVNode("",!0),P[6]||(P[6]=r.createTextVNode()),r.withDirectives(r.createElementVNode("input",{ref_key:"inputRef",ref:l,"onUpdate:modelValue":P[0]||(P[0]=V=>p.value=V),disabled:W.disabled,placeholder:W.placeholder||"...",type:h.value,spellcheck:"false",onFocusout:F},null,40,sb),[[r.vModelDynamic,p.value]]),P[7]||(P[7]=r.createTextVNode()),r.createElementVNode("div",ab,[v.value?(r.openBlock(),r.createBlock(r.unref(Wr),{key:0,class:"pl-text-field__clearable",name:"delete-clear",onClick:y})):r.createCommentVNode("",!0),P[3]||(P[3]=r.createTextVNode()),W.type==="password"?(r.openBlock(),r.createBlock(r.unref(At),{key:1,name:m.value,style:{cursor:"pointer"},onClick:I},null,8,["name"])):r.createCommentVNode("",!0),P[4]||(P[4]=r.createTextVNode()),r.renderSlot(W.$slots,"append")]),P[8]||(P[8]=r.createTextVNode()),r.createVNode(Cr,{class:"pl-text-field__contour"})],2),P[9]||(P[9]=r.createTextVNode()),O.value?(r.openBlock(),r.createElementBlock("div",lb,r.toDisplayString(M.value.join(" ")),1)):W.helper?(r.openBlock(),r.createElementBlock("div",cb,r.toDisplayString(W.helper),1)):r.createCommentVNode("",!0)]))}}),ub=r.defineComponent({__name:"PlIcon24",props:{name:{},size:{}},setup(t){const e=t,n=r.computed(()=>`icon-24 icon-${e.name}`);return(o,i)=>(r.openBlock(),r.createElementBlock("i",{class:r.normalizeClass([n.value,o.$style.icon])},null,2))}}),pb="_icon_1ugxm_2",hb={icon:pb},fb={$style:hb},Vs=Mt(ub,[["__cssModules",fb]]),mb=["disabled","placeholder"],gb=r.defineComponent({__name:"PlSearchField",props:{modelValue:{},clearable:{type:Boolean},placeholder:{},disabled:{type:Boolean}},emits:["update:modelValue"],setup(t,{emit:e}){const n=e,o=t,i=r.ref(void 0),l=r.ref(),c=r.computed({get(){return o.modelValue??""},set(h){n("update:modelValue",h)}}),d=r.computed(()=>!!o.modelValue),p=()=>n("update:modelValue","");return(h,m)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"root",ref:i,class:r.normalizeClass(["pl-search-field",[h.$style.component]])},[r.createVNode(r.unref(Vs),{name:"search"}),m[1]||(m[1]=r.createTextVNode()),r.withDirectives(r.createElementVNode("input",{ref_key:"input",ref:l,"onUpdate:modelValue":m[0]||(m[0]=y=>c.value=y),disabled:h.disabled,type:"text",placeholder:h.placeholder||"Find...",spellcheck:"false"},null,8,mb),[[r.vModelText,c.value]]),m[2]||(m[2]=r.createTextVNode()),h.clearable&&d.value?(r.openBlock(),r.createBlock(r.unref(Wr),{key:0,class:r.normalizeClass(h.$style.clear),name:"delete-clear",onClick:r.withModifiers(p,["stop"])},null,8,["class"])):r.createCommentVNode("",!0)],2))}}),yb="_component_1ng5b_1",_b="_clear_1ng5b_35",Cb={component:yb,clear:_b},vb={$style:Cb},_p=Mt(gb,[["__cssModules",vb]]),wb={class:"ui-text-area__envelope"},bb={key:0,ref:"label"},xb={key:0,class:"required-icon"},kb=["readonly","rows","disabled","placeholder"],Eb={class:"ui-text-area__append"},Sb={key:0,class:"ui-text-area__error"},Tb={key:1,class:"ui-text-area__helper"},Nb={name:"PlTextArea"},Vb=r.defineComponent({...Nb,props:{modelValue:{},label:{},required:{type:Boolean},error:{},helper:{},placeholder:{},disabled:{type:Boolean},readonly:{type:Boolean},dashed:{type:Boolean},rows:{},autogrow:{type:Boolean},rules:{}},emits:["update:modelValue"],setup(t,{emit:e}){const n=r.useSlots(),o=e,i=t,l=r.ref(),c=r.ref(),d=r.computed({get(){return i.modelValue??""},set(w){o("update:modelValue",w)}}),p=r.computed(()=>!!i.modelValue),h=yp(d,i.rules||[]);Yn(l);const m=r.computed(()=>{const w=[];return i.error&&w.push(i.error),w.push(...h.value.errors),w}),y=r.computed(()=>m.value.length>0),b=()=>{if(!i.autogrow)return;const w=c.value;w&&(w.style.height="auto",w.style.height=`${w.scrollHeight}px`)};return r.onMounted(()=>{b()}),(w,S)=>(r.openBlock(),r.createElementBlock("div",wb,[r.createElementVNode("div",{ref_key:"root",ref:l,class:r.normalizeClass(["ui-text-area",{error:y.value,disabled:w.disabled,dashed:w.dashed,nonEmpty:p.value}])},[w.label?(r.openBlock(),r.createElementBlock("label",bb,[w.required?(r.openBlock(),r.createElementBlock("i",xb)):r.createCommentVNode("",!0),S[1]||(S[1]=r.createTextVNode()),r.createElementVNode("span",null,r.toDisplayString(w.label),1),S[2]||(S[2]=r.createTextVNode()),r.unref(n).tooltip?(r.openBlock(),r.createBlock(r.unref(Ct),{key:1,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.renderSlot(w.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)],512)):r.createCommentVNode("",!0),S[3]||(S[3]=r.createTextVNode()),r.withDirectives(r.createElementVNode("textarea",{ref_key:"input",ref:c,"onUpdate:modelValue":S[0]||(S[0]=M=>d.value=M),readonly:w.readonly,rows:w.rows,disabled:w.disabled,placeholder:w.placeholder??"...",spellcheck:"false",onInput:b},null,40,kb),[[r.vModelText,d.value]]),S[4]||(S[4]=r.createTextVNode()),r.createElementVNode("div",Eb,[r.renderSlot(w.$slots,"append")]),S[5]||(S[5]=r.createTextVNode()),r.createVNode(Cr,{class:"ui-text-area__contour"})],2),S[6]||(S[6]=r.createTextVNode()),y.value?(r.openBlock(),r.createElementBlock("div",Sb,r.toDisplayString(m.value.join(" ")),1)):w.helper?(r.openBlock(),r.createElementBlock("div",Tb,r.toDisplayString(w.helper),1)):r.createCommentVNode("",!0)]))}});function Cp(t){return t!==null&&typeof t=="object"}function Gt(t,e){return Cp(t)&&Cp(e)?Object.keys(t).length!==Object.keys(e).length?!1:Object.keys(t).every(n=>Gt(t[n],e[n])):t===e}function Ol(t,e){return t.some(n=>Gt(n,e))}const Ml=r.defineComponent({__name:"LongText",setup(t){r.useCssVars(m=>({"8d68520c":c.value}));const e=r.ref(!1),n=r.ref(),o=r.ref(!1),i=r.computed(()=>o.value&&e.value?"ui-lt-animate":""),l=ip(m=>o.value=m,500),c=r.computed(()=>{var m;return n.value?`${((m=n.value)==null?void 0:m.innerHTML.length)*.4}s`:"5s"});function d(){const m=Nl(n.value,"span cannot be empty");e.value=m.clientWidth<m.scrollWidth}function p(){d(),l(!0)}function h(){l(!1)}return(m,y)=>(r.openBlock(),r.createElementBlock("div",r.mergeProps(m.$attrs,{class:"ui-lt-container"}),[r.createElementVNode("span",{onMouseover:p,onMouseleave:h},[r.createElementVNode("span",{ref_key:"span",ref:n,class:r.normalizeClass(i.value)},[r.renderSlot(m.$slots,"default")],2)],32)],16))}});function vp(t,e){const n=t.scrollTop,o=t.getBoundingClientRect().height,i=e.offsetTop,l=e.getBoundingClientRect().height;return i+l<o+n&&i>n}function wp(t,e){const n=t.scrollTop,o=t.getBoundingClientRect().height,i=e.offsetTop,l=e.getBoundingClientRect().height;return i+l<o+n?"ceil":i>n?"floor":"visible"}function As(t,e,n={}){const o=t.scrollTop,i=t.getBoundingClientRect().height,l=e.getBoundingClientRect().height,c=e.offsetTop,d=wp(t,e);if(d==="visible")return;const p=h=>{const m=d==="floor"?c-(i-l):c;t.scrollTop=o+h*(m-o)};vp(t,e)||op({duration:n.duration||100,timing:rp(h=>h),draw:p})}function Gl(t,e,n,o){return t.addEventListener(e,n,o),function(){t.removeEventListener(e,n)}}function Ab(t,e){const n=e.getBoundingClientRect();return t.x<n.x||t.x>n.x+n.width||t.y<n.y||t.y>n.y+n.height}const $l=r.defineComponent({__name:"DropdownOverlay",props:{root:{},gap:{}},setup(t,{expose:e}){const n=t,o=r.reactive({optionsHeight:0}),i=r.reactive({top:"0px",left:"0px",width:"0px"}),l=r.toRef(n,"root"),c=r.ref();return e({scrollIntoActive:()=>{const d=c.value;d&&gr(d.querySelector(".hovered-item"),p=>{As(d,p)})},listRef:c}),r.watch(c,d=>{d&&requestAnimationFrame(()=>{const p=d.getBoundingClientRect();o.optionsHeight=p.height,window.dispatchEvent(new CustomEvent("adjust"))})}),Ci(l,d=>{const p=document.body.getBoundingClientRect(),h=d.top-p.top,m=d.left-p.left,y=n.gap??0,b=h+d.height+y;b+o.optionsHeight>d.clientHeight?i.top=h-o.optionsHeight-y+"px":i.top=b+"px",i.left=m+"px",i.width=d.width+"px"}),(d,p)=>(r.openBlock(),r.createBlock(r.Teleport,{to:"body"},[r.createElementVNode("div",r.mergeProps({ref_key:"listRef",ref:c},d.$attrs,{style:i,tabindex:"-1"}),[r.renderSlot(d.$slots,"default",{ref:"list"})],16)]))}}),Bb={class:"pl-dropdown__envelope"},Pb=["tabindex"],Rb={class:"pl-dropdown__container"},Db={class:"pl-dropdown__field"},Ib=["disabled","placeholder"],Fb={class:"pl-dropdown__controls"},Lb={key:0},Ob={key:0,class:"required-icon"},Mb={key:0,class:"nothing-found"},Gb={key:0,class:"pl-dropdown__error"},$b={key:1,class:"pl-dropdown__helper"},zb={key:2,class:"pl-dropdown__helper"},Ub={name:"PlDropdown"},wo=r.defineComponent({...Ub,props:{modelValue:{},label:{default:""},options:{default:void 0},helper:{default:void 0},loadingOptionsHelper:{default:void 0},error:{default:void 0},placeholder:{default:"..."},clearable:{type:Boolean,default:!1},required:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},arrowIcon:{default:void 0},arrowIconLarge:{default:void 0},optionSize:{default:"small"}},emits:["update:modelValue"],setup(t,{emit:e}){const n=e,o=t,i=r.useSlots(),l=r.ref(),c=r.ref(),d=r.useTemplateRef("overlay"),p=r.reactive({search:"",activeIndex:-1,open:!1,optionsHeight:0}),h=()=>vi(F.value.findIndex(U=>Gt(U.value,o.modelValue)),U=>U<0?0:U),m=()=>p.activeIndex=h(),y=r.computed(()=>o.options===void 0),b=r.computed(()=>y.value?!0:o.disabled),w=r.computed(()=>(o.options??[]).findIndex(U=>Gt(U.value,o.modelValue))),S=r.computed(()=>{if(!y.value){if(o.error)return o.error;if(o.modelValue!==void 0&&w.value===-1)return"The selected value is not one of the options"}}),M=r.computed(()=>_r(o.options??[]).map((U,k)=>({...U,index:k,isSelected:k===w.value,isActive:k===p.activeIndex}))),O=r.computed(()=>{const U=r.unref(M).find(k=>Gt(k.value,o.modelValue));return(U==null?void 0:U.label)||o.modelValue}),v=r.computed(()=>!p.open&&o.modelValue?"":o.modelValue?String(O.value):o.placeholder),I=r.computed(()=>o.modelValue!==void 0&&o.modelValue!==null),F=r.computed(()=>{const U=M.value;return p.search?U.filter(k=>{const x=p.search.toLowerCase();return k.label.toLowerCase().includes(x)||k.description&&k.description.toLowerCase().includes(x)?!0:typeof k.value=="string"?k.value.toLowerCase().includes(x):k.value===p.search}):U}),W=r.computed(()=>b.value?void 0:"0"),P=U=>{var k;n("update:modelValue",U),p.search="",p.open=!1,(k=l==null?void 0:l.value)==null||k.focus()},V=()=>n("update:modelValue",void 0),Z=()=>{var U;return(U=c.value)==null?void 0:U.focus()},J=()=>p.open=!p.open,ae=()=>p.open=!0,$=U=>{var k,x,B;const G=U.relatedTarget;!((k=l.value)!=null&&k.contains(G))&&!((B=(x=d.value)==null?void 0:x.listRef)!=null&&B.contains(G))&&(p.search="",p.open=!1)},j=U=>{var k,x;if(["ArrowDown","ArrowUp","Enter","Escape"].includes(U.code))U.preventDefault();else return;const{open:B,activeIndex:G}=p;if(!B){U.code==="Enter"&&(p.open=!0);return}U.code==="Escape"&&(p.open=!1,(k=l.value)==null||k.focus());const H=r.unref(F),{length:K}=H;if(!K)return;U.code==="Enter"&&P((x=H.find(Ee=>Ee.index===G))==null?void 0:x.value);const ne=H.findIndex(Ee=>Ee.index===G)??-1,pe=U.code==="ArrowDown"?1:U.code==="ArrowUp"?-1:0,ke=Math.abs(ne+pe+K)%K;p.activeIndex=F.value[ke].index??-1};return Yn(l),r.watch(()=>o.modelValue,m,{immediate:!0}),r.watch(()=>p.open,U=>{var k;return U?(k=c.value)==null?void 0:k.focus():""}),r.watchPostEffect(()=>{var U;p.search,p.activeIndex>=0&&p.open&&((U=d.value)==null||U.scrollIntoActive())}),(U,k)=>(r.openBlock(),r.createElementBlock("div",Bb,[r.createElementVNode("div",{ref_key:"rootRef",ref:l,tabindex:W.value,class:r.normalizeClass(["pl-dropdown",{open:p.open,error:U.error,disabled:b.value}]),onKeydown:j,onFocusout:$},[r.createElementVNode("div",Rb,[r.createElementVNode("div",Db,[r.withDirectives(r.createElementVNode("input",{ref_key:"input",ref:c,"onUpdate:modelValue":k[0]||(k[0]=x=>p.search=x),type:"text",tabindex:"-1",disabled:b.value,placeholder:v.value,spellcheck:"false",autocomplete:"chrome-off",onFocus:ae},null,40,Ib),[[r.vModelText,p.search]]),k[4]||(k[4]=r.createTextVNode()),p.open?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",{key:0,onClick:Z},[r.createVNode(Ml,{class:"input-value"},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(O.value),1)]),_:1})])),k[5]||(k[5]=r.createTextVNode()),r.createElementVNode("div",Fb,[y.value?(r.openBlock(),r.createBlock(r.unref(At),{key:0,name:"loading"})):r.createCommentVNode("",!0),k[1]||(k[1]=r.createTextVNode()),U.clearable&&I.value?(r.openBlock(),r.createBlock(r.unref(Wr),{key:1,name:"delete-clear",onClick:r.withModifiers(V,["stop"])})):r.createCommentVNode("",!0),k[2]||(k[2]=r.createTextVNode()),r.renderSlot(U.$slots,"append"),k[3]||(k[3]=r.createTextVNode()),U.arrowIconLarge?(r.openBlock(),r.createElementBlock("div",{key:2,class:r.normalizeClass(["arrow-icon",[`icon-24 ${U.arrowIconLarge}`]]),onClick:r.withModifiers(J,["stop"])},null,2)):U.arrowIcon?(r.openBlock(),r.createElementBlock("div",{key:3,class:r.normalizeClass(["arrow-icon",[`icon-16 ${U.arrowIcon}`]]),onClick:r.withModifiers(J,["stop"])},null,2)):(r.openBlock(),r.createElementBlock("div",{key:4,class:"arrow-icon arrow-icon-default",onClick:r.withModifiers(J,["stop"])}))])]),k[9]||(k[9]=r.createTextVNode()),U.label?(r.openBlock(),r.createElementBlock("label",Lb,[U.required?(r.openBlock(),r.createElementBlock("i",Ob)):r.createCommentVNode("",!0),k[6]||(k[6]=r.createTextVNode()),r.createElementVNode("span",null,r.toDisplayString(U.label),1),k[7]||(k[7]=r.createTextVNode()),r.unref(i).tooltip?(r.openBlock(),r.createBlock(r.unref(Ct),{key:1,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.renderSlot(U.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0),k[10]||(k[10]=r.createTextVNode()),p.open?(r.openBlock(),r.createBlock(r.unref($l),{key:1,ref_key:"overlay",ref:d,root:l.value,class:"pl-dropdown__options",tabindex:"-1",gap:3},{default:r.withCtx(()=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(F.value,(x,B)=>(r.openBlock(),r.createBlock(Co,{key:B,option:x,"is-selected":x.isSelected,"is-hovered":x.isActive,size:U.optionSize,onClick:r.withModifiers(G=>P(x.value),["stop"])},null,8,["option","is-selected","is-hovered","size","onClick"]))),128)),k[8]||(k[8]=r.createTextVNode()),F.value.length?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",Mb,"Nothing found"))]),_:1},8,["root"])):r.createCommentVNode("",!0),k[11]||(k[11]=r.createTextVNode()),r.createVNode(Cr,{class:"pl-dropdown__contour"})])],42,Pb),k[12]||(k[12]=r.createTextVNode()),S.value?(r.openBlock(),r.createElementBlock("div",Gb,r.toDisplayString(S.value),1)):y.value&&U.loadingOptionsHelper?(r.openBlock(),r.createElementBlock("div",$b,r.toDisplayString(U.loadingOptionsHelper),1)):U.helper?(r.openBlock(),r.createElementBlock("div",zb,r.toDisplayString(U.helper),1)):r.createCommentVNode("",!0)]))}}),Zb={name:"PlDropdownRef"},Wb=r.defineComponent({...Zb,props:{modelValue:{},label:{default:""},options:{default:void 0},helper:{default:void 0},loadingOptionsHelper:{default:void 0},error:{default:void 0},placeholder:{default:"..."},clearable:{type:Boolean,default:!1},required:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},optionSize:{default:"small"}},emits:["update:modelValue"],setup(t){const e=t,n=r.computed(()=>{var i;return(i=e.options)==null?void 0:i.map(l=>({label:l.label,value:l.ref}))}),o=r.computed(()=>e.disabled?"icon-link-disabled":"icon-link");return(i,l)=>(r.openBlock(),r.createBlock(r.unref(wo),r.mergeProps(e,{options:n.value,"loading-options-helper":i.loadingOptionsHelper,"arrow-icon-large":o.value,"onUpdate:modelValue":l[0]||(l[0]=c=>i.$emit("update:modelValue",c))}),null,16,["options","loading-options-helper","arrow-icon-large"]))}});function jb(t,e){return r.computed(()=>{const n=_r(t.value);return e.value?n.filter(o=>o.label.toLowerCase().includes(e.value.toLowerCase())):n})}const Hb={class:"resizable-input"},qb=["placeholder","value","disabled"],Kb=r.defineComponent({__name:"ResizableInput",props:{modelValue:{},placeholder:{},value:{},disabled:{type:Boolean},maxWidth:{},width:{}},emits:["input","update:modelValue"],setup(t,{emit:e}){const n=t,o=e,i=r.computed(()=>{var d;return n.placeholder?n.placeholder:(d=n.modelValue||n.value)==null?void 0:d.replace('"',"")}),l=r.computed(()=>{const d={};return n.width&&(d.width=n.width),n.maxWidth&&(d.maxWidth=n.maxWidth),d});function c(d){const p=d.target.value;o("update:modelValue",p)}return(d,p)=>(r.openBlock(),r.createElementBlock("div",Hb,[r.createElementVNode("span",{style:r.normalizeStyle(l.value),class:"resizable-input__size-span"},r.toDisplayString(i.value),5),p[0]||(p[0]=r.createTextVNode()),r.createElementVNode("input",r.mergeProps(d.$attrs,{placeholder:d.placeholder,value:n.modelValue,disabled:n.disabled,style:l.value,onInput:c}),null,16,qb)]))}}),Yb={class:"dropdown-tab-item__title text-caps13"},Xb=r.defineComponent({__name:"TabItem",props:{option:{},isSelected:{type:Boolean,default:!1},isHovered:{type:Boolean,default:!1}},setup(t){const e=t,n=r.computed(()=>e.option.label),o=r.computed(()=>{const i=[];return e.isSelected&&i.push("dropdown-tab-item__selected"),e.isHovered&&i.push("hovered-item"),i.join(" ")});return(i,l)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass([o.value,"dropdown-tab-item"])},[r.createElementVNode("div",Yb,r.toDisplayString(n.value),1)],2))}}),Jb={class:"pl-line-dropdown__prefix"},Qb={class:"pl-line-dropdown__icon-wrapper"},ex={class:"pl-line-dropdown__icon"},tx={key:0,class:"pl-line-dropdown__no-item"},nx={key:0,class:"pl-line-dropdown__no-item"},bp=r.defineComponent({__name:"PlDropdownLine",props:{modelValue:{},disabled:{type:Boolean},prefix:{default:""},options:{},placeholder:{default:"Select.."},mode:{default:"list"},tabsContainerStyles:{type:[Boolean,null,String,Object,Array],default:void 0},clearable:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{emit:e}){const n=e,o=t,i=r.reactive({isOpen:!1,activeOption:-1,optionsHeight:0}),l=r.ref(),c=r.ref(),d=r.computed(()=>{const $=[];return i.isOpen&&$.push("open"),o.disabled&&$.push("disabled"),$.join(" ")}),p=r.ref(""),h=jb(r.toRef(o,"options"),p),m=r.computed(()=>!!(o.clearable&&i.isOpen&&o.modelValue&&y.value)),y=r.computed(()=>{if(o.modelValue){const $=S();if($!==-1){const j=_r(o.options)[$];return typeof j.label=="object"?j.label.title:j.label}}return""}),b=r.ref(y.value),w=r.computed(()=>i.isOpen&&p.value&&p.value.length>=y.value.length-1?p.value:y.value??"...");Ns(l,()=>{o.mode==="list"&&(i.isOpen=!1)}),r.watch(()=>b.value,$=>{y.value!==$?p.value=$:p.value=""}),r.watch(()=>i.isOpen,$=>{var j;$&&l.value&&((j=l.value.querySelector("input"))==null||j.focus(),r.nextTick(()=>Z()))}),r.watch(()=>o.modelValue,()=>M(),{immediate:!0});function S(){return o.options.findIndex($=>Gt($.value,o.modelValue))}function M(){i.activeOption=vi(h.value.findIndex($=>Gt($.value,o.modelValue)),$=>$<0?0:$),b.value=y.value}function O(){p.value=""}function v(){o.disabled?i.isOpen=!1:r.nextTick(()=>{i.isOpen=!i.isOpen})}function I(){o.mode==="list"&&(i.isOpen=!1)}function F($){$&&(n("update:modelValue",$.value),I(),O())}function W($){return Gt($.value,o.modelValue)}const P=$=>{var j,U;const k=$.relatedTarget;!((j=l.value)!=null&&j.contains(k))&&!((U=c.value)!=null&&U.contains(k))&&(p.value="",i.isOpen=!1)};function V($){const{activeOption:j}=i;if(!i.isOpen&&$.code==="Enter"){i.isOpen=!0;return}const{length:U}=h.value;if(!U)return;["ArrowDown","ArrowUp","Enter"].includes($.code)&&$.preventDefault(),$.code==="Enter"&&F(h.value[j]);const k=$.code==="ArrowDown"?1:$.code==="ArrowUp"?-1:0;i.activeOption=Math.abs(j+k+U)%U,requestAnimationFrame(Z)}function Z(){const $=c.value;$&&_t($.querySelector(".hovered-item"),j=>{o.mode==="list"?As($,j):j.scrollIntoView({behavior:"smooth",block:"nearest",inline:"center"})})}function J(){n("update:modelValue",void 0)}const ae=r.reactive({top:"0px",left:"0px"});return r.watch(c,$=>{if($){const j=$.getBoundingClientRect();i.optionsHeight=j.height,window.dispatchEvent(new CustomEvent("adjust"))}}),Ci(l,$=>{const j=$.top+$.height+2;j+i.optionsHeight>$.clientHeight?ae.top=$.top-i.optionsHeight-2+"px":ae.top=j+"px",ae.left=$.left+"px"}),($,j)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"container",ref:l,tabindex:"0",class:r.normalizeClass([d.value,"pl-line-dropdown uc-pointer"]),onKeydown:V,onFocusout:P,onClick:v},[r.createElementVNode("div",Jb,r.toDisplayString(o==null?void 0:o.prefix),1),j[6]||(j[6]=r.createTextVNode()),r.createVNode(Kb,{modelValue:b.value,"onUpdate:modelValue":j[0]||(j[0]=U=>b.value=U),placeholder:w.value,disabled:o.disabled,class:"pl-line-dropdown__input"},null,8,["modelValue","placeholder","disabled"]),j[7]||(j[7]=r.createTextVNode()),r.createElementVNode("div",Qb,[r.withDirectives(r.createElementVNode("div",ex,null,512),[[r.vShow,!m.value]]),j[1]||(j[1]=r.createTextVNode()),r.withDirectives(r.createElementVNode("div",{class:"pl-line-dropdown__icon-clear",onClick:J},null,512),[[r.vShow,m.value]])]),j[8]||(j[8]=r.createTextVNode()),i.isOpen?(r.openBlock(),r.createBlock(r.Teleport,{key:0,to:"body"},[o.mode==="list"?(r.openBlock(),r.createElementBlock("div",{key:0,ref_key:"list",ref:c,style:r.normalizeStyle(ae),tabindex:"-1",class:"pl-line-dropdown__items",onFocusout:P},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(h),(U,k)=>r.renderSlot($.$slots,"item",{key:k,item:U,textItem:"text",isSelected:W(U),isHovered:i.activeOption==k,onClick:r.withModifiers(x=>F(U),["stop"])},()=>[r.createVNode(Co,{option:U,"text-item":"text","is-selected":W(U),"is-hovered":i.activeOption==k,size:"medium",onClick:r.withModifiers(x=>F(U),["stop"])},null,8,["option","is-selected","is-hovered","onClick"])])),128)),j[3]||(j[3]=r.createTextVNode()),r.unref(h).length===0?(r.openBlock(),r.createElementBlock("div",tx,j[2]||(j[2]=[r.createElementVNode("div",{class:"pl-line-dropdown__no-item-title text-s"},"Didn't find anything that matched",-1)]))):r.createCommentVNode("",!0)],36)):o.mode==="tabs"?(r.openBlock(),r.createElementBlock("div",{key:1,ref_key:"list",ref:c,style:r.normalizeStyle(ae),tabindex:"-1",class:"pl-line-dropdown__items-tabs",onFocusout:P},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(h),(U,k)=>r.renderSlot($.$slots,"item",{key:k,item:U,isSelected:W(U),isHovered:i.activeOption==k,onClick:r.withModifiers(x=>F(U),["stop"])},()=>[r.createVNode(Xb,{option:U,"is-selected":W(U),"is-hovered":i.activeOption==k,onClick:r.withModifiers(x=>F(U),["stop"])},null,8,["option","is-selected","is-hovered","onClick"])])),128)),j[5]||(j[5]=r.createTextVNode()),r.unref(h).length===0?(r.openBlock(),r.createElementBlock("div",nx,j[4]||(j[4]=[r.createElementVNode("div",{class:"pl-line-dropdown__no-item-title text-s"},"Didn't find anything that matched",-1)]))):r.createCommentVNode("",!0)],36)):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0)],34))}}),rx={class:"ui-dropdown__envelope"},ox=["tabindex"],ix={class:"ui-dropdown__container"},sx={class:"ui-dropdown__field"},ax=["disabled","placeholder"],lx={class:"ui-dropdown__controls"},cx={key:0},dx={key:0,class:"required-icon"},ux={key:0,class:"nothing-found"},px={key:0,class:"ui-dropdown__error"},hx={key:1,class:"ui-dropdown__helper"},fx={key:2,class:"ui-dropdown__helper"},mx={name:"PlDropdown"},gx=r.defineComponent({...mx,props:{modelValue:{},label:{default:""},options:{default:void 0},helper:{default:void 0},loadingOptionsHelper:{default:void 0},error:{default:void 0},placeholder:{default:"..."},clearable:{type:Boolean,default:!1},required:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},arrowIcon:{default:void 0},arrowIconLarge:{default:void 0},optionSize:{default:"small"}},emits:["update:modelValue"],setup(t,{emit:e}){const n=e,o=t,i=r.useSlots(),l=r.ref(),c=r.ref(),d=r.ref(),p=r.reactive({search:"",activeIndex:-1,open:!1}),h=()=>vi(F.value.findIndex(k=>Gt(k.value,o.modelValue)),k=>k<0?0:k),m=()=>p.activeIndex=h(),y=r.computed(()=>o.options===void 0),b=r.computed(()=>y.value?!0:o.disabled),w=r.computed(()=>(o.options??[]).findIndex(k=>Gt(k.value,o.modelValue))),S=r.computed(()=>{if(!y.value){if(o.error)return o.error;if(o.modelValue!==void 0&&w.value===-1)return"The selected value is not one of the options"}}),M=r.computed(()=>_r(o.options??[]).map((k,x)=>({...k,index:x,isSelected:x===w.value,isActive:x===p.activeIndex}))),O=r.computed(()=>{const k=r.unref(M).find(x=>Gt(x.value,o.modelValue));return(k==null?void 0:k.label)||o.modelValue}),v=r.computed(()=>!p.open&&o.modelValue?"":o.modelValue?String(O.value):o.placeholder),I=r.computed(()=>o.modelValue!==void 0&&o.modelValue!==null),F=r.computed(()=>{const k=M.value;return p.search?k.filter(x=>{const B=p.search.toLowerCase();return x.label.toLowerCase().includes(B)||x.description&&x.description.toLowerCase().includes(B)?!0:typeof x.value=="string"?x.value.toLowerCase().includes(B):x.value===p.search}):k}),W=r.computed(()=>b.value?void 0:"0"),P=k=>{var x;n("update:modelValue",k),p.search="",p.open=!1,(x=l==null?void 0:l.value)==null||x.focus()},V=()=>n("update:modelValue",void 0),Z=()=>{var k;return(k=d.value)==null?void 0:k.focus()},J=()=>p.open=!p.open,ae=()=>p.open=!0,$=k=>{var x;(x=l==null?void 0:l.value)!=null&&x.contains(k.relatedTarget)||(p.search="",p.open=!1)},j=()=>{const k=c.value;k&&_t(k.querySelector(".hovered-item"),x=>{As(k,x)})},U=k=>{var x,B;if(["ArrowDown","ArrowUp","Enter","Escape"].includes(k.code))k.preventDefault();else return;const{open:G,activeIndex:H}=p;if(!G){k.code==="Enter"&&(p.open=!0);return}k.code==="Escape"&&(p.open=!1,(x=l.value)==null||x.focus());const K=r.unref(F),{length:ne}=K;if(!ne)return;k.code==="Enter"&&P((B=K.find(He=>He.index===H))==null?void 0:B.value);const pe=K.findIndex(He=>He.index===H)??-1,ke=k.code==="ArrowDown"?1:k.code==="ArrowUp"?-1:0,Ee=Math.abs(pe+ke+ne)%ne;p.activeIndex=F.value[Ee].index??-1};return Yn(l),r.watch(()=>o.modelValue,m,{immediate:!0}),r.watch(()=>p.open,k=>{var x;return k?(x=d.value)==null?void 0:x.focus():""}),r.watchPostEffect(()=>{p.search,p.activeIndex>=0&&p.open&&j()}),(k,x)=>(r.openBlock(),r.createElementBlock("div",rx,[r.createElementVNode("div",{ref_key:"root",ref:l,tabindex:W.value,class:r.normalizeClass(["ui-dropdown",{open:p.open,error:k.error,disabled:b.value}]),onKeydown:U,onFocusout:$},[r.createElementVNode("div",ix,[r.createElementVNode("div",sx,[r.withDirectives(r.createElementVNode("input",{ref_key:"input",ref:d,"onUpdate:modelValue":x[0]||(x[0]=B=>p.search=B),type:"text",tabindex:"-1",disabled:b.value,placeholder:v.value,spellcheck:"false",autocomplete:"chrome-off",onFocus:ae},null,40,ax),[[r.vModelText,p.search]]),x[4]||(x[4]=r.createTextVNode()),p.open?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",{key:0,onClick:Z},[r.createVNode(Ml,{class:"input-value"},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(O.value),1)]),_:1})])),x[5]||(x[5]=r.createTextVNode()),r.createElementVNode("div",lx,[y.value?(r.openBlock(),r.createBlock(r.unref(At),{key:0,name:"loading"})):r.createCommentVNode("",!0),x[1]||(x[1]=r.createTextVNode()),k.clearable&&I.value?(r.openBlock(),r.createBlock(r.unref(Wr),{key:1,name:"delete-clear",onClick:r.withModifiers(V,["stop"])})):r.createCommentVNode("",!0),x[2]||(x[2]=r.createTextVNode()),r.renderSlot(k.$slots,"append"),x[3]||(x[3]=r.createTextVNode()),k.arrowIconLarge?(r.openBlock(),r.createElementBlock("div",{key:2,class:r.normalizeClass(["arrow-icon",[`icon-24 ${k.arrowIconLarge}`]]),onClick:r.withModifiers(J,["stop"])},null,2)):k.arrowIcon?(r.openBlock(),r.createElementBlock("div",{key:3,class:r.normalizeClass(["arrow-icon",[`icon-16 ${k.arrowIcon}`]]),onClick:r.withModifiers(J,["stop"])},null,2)):(r.openBlock(),r.createElementBlock("div",{key:4,class:"arrow-icon arrow-icon-default",onClick:r.withModifiers(J,["stop"])}))])]),x[9]||(x[9]=r.createTextVNode()),k.label?(r.openBlock(),r.createElementBlock("label",cx,[k.required?(r.openBlock(),r.createElementBlock("i",dx)):r.createCommentVNode("",!0),x[6]||(x[6]=r.createTextVNode()),r.createElementVNode("span",null,r.toDisplayString(k.label),1),x[7]||(x[7]=r.createTextVNode()),r.unref(i).tooltip?(r.openBlock(),r.createBlock(r.unref(Ct),{key:1,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.renderSlot(k.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0),x[10]||(x[10]=r.createTextVNode()),p.open?(r.openBlock(),r.createElementBlock("div",{key:1,ref_key:"list",ref:c,class:"ui-dropdown__options"},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(F.value,(B,G)=>(r.openBlock(),r.createBlock(Co,{key:G,option:B,"is-selected":B.isSelected,"is-hovered":B.isActive,size:k.optionSize,onClick:r.withModifiers(H=>P(B.value),["stop"])},null,8,["option","is-selected","is-hovered","size","onClick"]))),128)),x[8]||(x[8]=r.createTextVNode()),F.value.length?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",ux,"Nothing found"))],512)):r.createCommentVNode("",!0),x[11]||(x[11]=r.createTextVNode()),r.createVNode(Cr,{class:"ui-dropdown__contour"})])],42,ox),x[12]||(x[12]=r.createTextVNode()),S.value?(r.openBlock(),r.createElementBlock("div",px,r.toDisplayString(S.value),1)):y.value&&k.loadingOptionsHelper?(r.openBlock(),r.createElementBlock("div",hx,r.toDisplayString(k.loadingOptionsHelper),1)):k.helper?(r.openBlock(),r.createElementBlock("div",fx,r.toDisplayString(k.helper),1)):r.createCommentVNode("",!0)]))}}),yx={key:0,class:"ui-progress-bar"},_x={class:"ui-progress-bar__messages d-flex align-center pl-6 pr-6"},Cx={class:"ui-progress-bar__message flex-grow-1"},vx={class:"ui-progress-bar__percent"},wx=r.defineComponent({__name:"PlProgressBar",props:{loading:{type:Boolean},progress:{default:0},completeMessage:{default:"Completed"}},setup(t){const e=t,n=r.computed(()=>e.progress===100?e.completeMessage:"");return(o,i)=>o.loading?(r.openBlock(),r.createElementBlock("div",yx,[r.createElementVNode("div",{class:"ui-progress-bar__indicator",style:r.normalizeStyle({width:o.progress+"%"})},null,4),i[1]||(i[1]=r.createTextVNode()),r.createElementVNode("div",_x,[r.createElementVNode("div",Cx,r.toDisplayString(n.value),1),i[0]||(i[0]=r.createTextVNode()),r.createElementVNode("div",vx,r.toDisplayString(o.progress+"%"),1)])])):r.createCommentVNode("",!0)}}),bx={class:"mi-number-field__main-wrapper d-flex"},xx={class:"mi-number-field__wrapper flex-grow d-flex flex-align-center"},kx={key:0,class:"text-description"},Ex=["disabled","placeholder"],Sx={class:"mi-number-field__icons d-flex-column"},Tx={key:0,class:"mi-number-field__hint text-description"},Nx=r.defineComponent({__name:"PlNumberField",props:{modelValue:{},disabled:{type:Boolean},label:{default:void 0},placeholder:{default:void 0},step:{default:1},minValue:{default:void 0},maxValue:{default:void 0},errorMessage:{default:void 0},validate:{type:Function,default:void 0}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,o=e,i=r.ref(),l=r.useSlots(),c=r.ref();Yn(i);const d=r.ref(!0),p=r.computed({get(){return d.value&&n.modelValue!==void 0?new Number(n.modelValue).toString():""},set(v){var I;v=v.replace(/,/g,""),b(v)?(o("update:modelValue",+v),v.toString()!==((I=n.modelValue)==null?void 0:I.toString())&&+v===n.modelValue&&v[v.length-1]!=="."&&(d.value=!1,r.nextTick(()=>{d.value=!0}))):(v.trim()===""&&o("update:modelValue",void 0),d.value=!1,r.nextTick(()=>{d.value=!0}))}}),h=r.computed(()=>{let v=[];return n.errorMessage&&v.push(n.errorMessage),b(n.modelValue)?(n.minValue!==void 0&&n.modelValue!==void 0&&n.modelValue<n.minValue&&v.push(`Model value must be higher than ${n.minValue}`),n.maxValue!==void 0&&n.modelValue!==void 0&&n.modelValue>n.maxValue&&v.push(`Model value must be less than ${n.maxValue}`)):v.push("Model value is not a number."),v=[...v],v.join(" ")}),m=r.computed(()=>!!(n.maxValue&&n.modelValue!==void 0&&(n.modelValue||0)+n.step>n.maxValue)),y=r.computed(()=>!!(n.minValue&&n.modelValue!==void 0&&(n.modelValue||0)-n.step<n.minValue));function b(v){return v!==void 0?(v=v==null?void 0:v.toString(),!isNaN(+v)&&!isNaN(parseFloat(v))):!1}function w(){if(!m.value){let v=0;n.modelValue===void 0?v=n.minValue?n.minValue:0:v=+(n.modelValue||0)+n.step,p.value=v.toString()}}function S(){if(!y.value){let v=0;n.modelValue===void 0?v=0:v=+(n.modelValue||0)-n.step,p.value=n.minValue?Math.max(n.minValue,v).toString():v.toString()}}function M(v){["ArrowDown","ArrowUp"].includes(v.code)&&v.preventDefault(),v.code==="ArrowUp"?w():v.code==="ArrowDown"&&S()}const O=v=>{v.detail>1&&v.preventDefault()};return(v,I)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"root",ref:i,class:r.normalizeClass([{error:!!h.value.trim(),disabled:v.disabled},"mi-number-field d-flex-column"]),onMousedown:O,onKeydown:I[1]||(I[1]=F=>M(F))},[r.createElementVNode("div",bx,[r.createVNode(Cr,{class:"mi-number-field__contour"}),I[6]||(I[6]=r.createTextVNode()),r.createElementVNode("div",xx,[v.label?(r.openBlock(),r.createElementBlock("label",kx,[r.createTextVNode(r.toDisplayString(v.label)+" ",1),r.unref(l).tooltip?(r.openBlock(),r.createBlock(r.unref(Ct),{key:0,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.renderSlot(v.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0),I[2]||(I[2]=r.createTextVNode()),r.withDirectives(r.createElementVNode("input",{ref_key:"input",ref:c,"onUpdate:modelValue":I[0]||(I[0]=F=>p.value=F),disabled:v.disabled,placeholder:v.placeholder,class:"text-s flex-grow"},null,8,Ex),[[r.vModelText,p.value]])]),I[7]||(I[7]=r.createTextVNode()),r.createElementVNode("div",Sx,[r.createElementVNode("div",{class:r.normalizeClass([{disabled:m.value},"mi-number-field__icon d-flex flex-justify-center uc-pointer flex-grow flex-align-center"]),onClick:w},I[3]||(I[3]=[r.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},[r.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M8 4.93933L13.5303 10.4697L12.4697 11.5303L8 7.06065L3.53033 11.5303L2.46967 10.4697L8 4.93933Z",fill:"#110529"})],-1)]),2),I[5]||(I[5]=r.createTextVNode()),r.createElementVNode("div",{class:r.normalizeClass([{disabled:y.value},"mi-number-field__icon d-flex flex-justify-center uc-pointer flex-grow flex-align-center"]),onClick:S},I[4]||(I[4]=[r.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},[r.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M2.46967 6.53033L3.53033 5.46967L8 9.93934L12.4697 5.46967L13.5303 6.53033L8 12.0607L2.46967 6.53033Z",fill:"#110529"})],-1)]),2)])]),I[8]||(I[8]=r.createTextVNode()),h.value.trim()?(r.openBlock(),r.createElementBlock("div",Tx,r.toDisplayString(h.value),1)):r.createCommentVNode("",!0)],34))}}),Vx={class:"pl-chip__text"},zl=r.defineComponent({__name:"PlChip",props:{closeable:{type:Boolean},small:{type:Boolean}},emits:["close"],setup(t){const e=r.ref(),n=r.ref(!1);return r.onMounted(()=>{var o;e.value&&(n.value=((o=e.value)==null?void 0:o.clientWidth)>=256)}),(o,i)=>(r.openBlock(),r.createBlock(r.unref(Ct),{position:"top",class:"pl-chip-tooltip",delay:500},r.createSlots({default:r.withCtx(()=>[i[4]||(i[4]=r.createTextVNode()),r.createElementVNode("div",{ref_key:"chip",ref:e,class:r.normalizeClass(["pl-chip",{small:o.small}])},[r.createElementVNode("div",Vx,[r.renderSlot(o.$slots,"default")]),i[3]||(i[3]=r.createTextVNode()),o.closeable?(r.openBlock(),r.createElementBlock("div",{key:0,tabindex:"0",class:"pl-chip__close",onKeydown:i[0]||(i[0]=r.withKeys(l=>o.$emit("close"),["enter"])),onClick:i[1]||(i[1]=r.withModifiers(l=>o.$emit("close"),["stop"]))},i[2]||(i[2]=[r.createElementVNode("div",{class:"pl-chip__close--icon"},null,-1)]),32)):r.createCommentVNode("",!0)],2)]),_:2},[n.value?{name:"tooltip",fn:r.withCtx(()=>[r.renderSlot(o.$slots,"default")]),key:"0"}:void 0]),1024))}}),Ax={class:"pl-multi-dropdown__envelope"},Bx=["tabindex"],Px={class:"pl-multi-dropdown__container"},Rx={class:"pl-multi-dropdown__field"},Dx=["disabled","placeholder"],Ix={class:"pl-multi-dropdown__append"},Fx={key:0},Lx={key:0,class:"required-icon"},Ox={class:"pl-multi-dropdown__open-chips-container"},Mx={key:0,class:"nothing-found"},Gx={key:0,class:"pl-multi-dropdown__error"},$x={key:1,class:"pl-multi-dropdown__helper"},zx={name:"PlDropdownMulti"},Ux=r.defineComponent({...zx,props:{modelValue:{default:()=>[]},label:{default:void 0},options:{},helper:{default:void 0},error:{default:void 0},placeholder:{default:"..."},required:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{emit:e}){const n=e,o=V=>n("update:modelValue",V),i=r.useSlots(),l=t,c=r.ref(),d=r.ref(),p=r.useTemplateRef("overlay"),h=r.reactive({search:"",activeOption:-1,open:!1,optionsHeight:0}),m=r.computed(()=>Array.isArray(l.modelValue)?l.modelValue:[]),y=r.computed(()=>h.open&&l.modelValue.length>0?l.placeholder:l.modelValue.length>0?"":l.placeholder),b=r.computed(()=>_r(l.options).filter(V=>Ol(m.value,V.value))),w=r.computed(()=>{const V=r.unref(m),Z=_r(l.options);return(h.search?Z.filter(J=>{const ae=h.search.toLowerCase();return J.label.toLowerCase().includes(ae)?!0:typeof J.value=="string"?J.value.toLowerCase().includes(ae):J.value===h.search}):[...Z]).map(J=>({...J,selected:Ol(V,J.value)}))}),S=r.computed(()=>l.disabled?void 0:"0"),M=()=>{h.activeOption=vi(w.value.findIndex(V=>Gt(V.value,l.modelValue)),V=>V<0?0:V)},O=V=>{var Z;const J=r.unref(m);o(Ol(J,V)?J.filter(ae=>!Gt(ae,V)):[...J,V]),h.search="",(Z=c==null?void 0:c.value)==null||Z.focus()},v=V=>o(r.unref(m).filter(Z=>!Gt(Z,V))),I=()=>{var V;return(V=d.value)==null?void 0:V.focus()},F=()=>h.open=!h.open,W=V=>{var Z,J,ae,$;const j=V.relatedTarget;console.log(">>>> overlay.value?.$el",(Z=p.value)==null?void 0:Z.$el),!((J=c.value)!=null&&J.contains(j))&&!(($=(ae=p.value)==null?void 0:ae.listRef)!=null&&$.contains(j))&&(h.search="",h.open=!1)},P=V=>{var Z;const{open:J,activeOption:ae}=h;if(!J){V.code==="Enter"&&(h.open=!0);return}V.code==="Escape"&&(h.open=!1,(Z=c.value)==null||Z.focus());const $=r.unref(w),{length:j}=$;if(!j)return;["ArrowDown","ArrowUp","Enter"].includes(V.code)&&V.preventDefault(),V.code==="Enter"&&O($[ae].value);const U=V.code==="ArrowDown"?1:V.code==="ArrowUp"?-1:0;h.activeOption=Math.abs(ae+U+j)%j,requestAnimationFrame(()=>{var k;return(k=p.value)==null?void 0:k.scrollIntoActive()})};return Yn(c),r.watch(()=>l.modelValue,()=>M(),{immediate:!0}),r.watchPostEffect(()=>{var V;h.search,h.open&&((V=p.value)==null||V.scrollIntoActive())}),(V,Z)=>(r.openBlock(),r.createElementBlock("div",Ax,[r.createElementVNode("div",{ref_key:"rootRef",ref:c,tabindex:S.value,class:r.normalizeClass(["pl-multi-dropdown",{open:h.open,error:V.error,disabled:V.disabled}]),onKeydown:P,onFocusout:W},[r.createElementVNode("div",Px,[r.createElementVNode("div",Rx,[r.withDirectives(r.createElementVNode("input",{ref_key:"input",ref:d,"onUpdate:modelValue":Z[0]||(Z[0]=J=>h.search=J),type:"text",tabindex:"-1",disabled:V.disabled,placeholder:y.value,spellcheck:"false",autocomplete:"chrome-off",onFocus:Z[1]||(Z[1]=J=>h.open=!0)},null,40,Dx),[[r.vModelText,h.search]]),Z[3]||(Z[3]=r.createTextVNode()),h.open?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",{key:0,class:"chips-container",onClick:I},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(b.value,(J,ae)=>(r.openBlock(),r.createBlock(r.unref(zl),{key:ae,closeable:"",small:"",onClick:Z[2]||(Z[2]=r.withModifiers($=>h.open=!0,["stop"])),onClose:$=>v(J.value)},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(J.label||J.value),1)]),_:2},1032,["onClose"]))),128))])),Z[4]||(Z[4]=r.createTextVNode()),r.createElementVNode("div",{class:"arrow",onClick:r.withModifiers(F,["stop"])}),Z[5]||(Z[5]=r.createTextVNode()),r.createElementVNode("div",Ix,[r.renderSlot(V.$slots,"append")])]),Z[10]||(Z[10]=r.createTextVNode()),V.label?(r.openBlock(),r.createElementBlock("label",Fx,[V.required?(r.openBlock(),r.createElementBlock("i",Lx)):r.createCommentVNode("",!0),Z[6]||(Z[6]=r.createTextVNode()),r.createElementVNode("span",null,r.toDisplayString(V.label),1),Z[7]||(Z[7]=r.createTextVNode()),r.unref(i).tooltip?(r.openBlock(),r.createBlock(r.unref(Ct),{key:1,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.renderSlot(V.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0),Z[11]||(Z[11]=r.createTextVNode()),h.open?(r.openBlock(),r.createBlock($l,{key:1,ref_key:"overlay",ref:p,root:c.value,class:"pl-multi-dropdown__options",gap:3,tabindex:"-1",onFocusout:W},{default:r.withCtx(()=>[r.createElementVNode("div",Ox,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(b.value,(J,ae)=>(r.openBlock(),r.createBlock(r.unref(zl),{key:ae,closeable:"",small:"",onClose:$=>v(J.value)},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(J.label||J.value),1)]),_:2},1032,["onClose"]))),128))]),Z[8]||(Z[8]=r.createTextVNode()),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(w.value,(J,ae)=>(r.openBlock(),r.createBlock(Co,{key:ae,option:J,"text-item":"text","is-selected":J.selected,"is-hovered":h.activeOption==ae,size:"medium","use-checkbox":"",onClick:r.withModifiers($=>O(J.value),["stop"])},null,8,["option","is-selected","is-hovered","onClick"]))),128)),Z[9]||(Z[9]=r.createTextVNode()),w.value.length?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",Mx,"Nothing found"))]),_:1},8,["root"])):r.createCommentVNode("",!0),Z[12]||(Z[12]=r.createTextVNode()),r.createVNode(Cr,{class:"pl-multi-dropdown__contour"})])],42,Bx),Z[13]||(Z[13]=r.createTextVNode()),V.error?(r.openBlock(),r.createElementBlock("div",Gx,r.toDisplayString(V.error),1)):V.helper?(r.openBlock(),r.createElementBlock("div",$x,r.toDisplayString(V.helper),1)):r.createCommentVNode("",!0)]))}}),Ul=r.defineComponent({__name:"PlCheckboxBase",props:{modelValue:{type:Boolean},disabled:{type:Boolean}},emits:["update:modelValue"],setup(t){const e=t,n=r.computed(()=>e.modelValue);return(o,i)=>(r.openBlock(),r.createElementBlock("div",{tabindex:"0",class:r.normalizeClass(["pl-checkbox-base",{checked:n.value,disabled:o.disabled}]),onClick:i[0]||(i[0]=l=>o.$emit("update:modelValue",!o.modelValue)),onKeydown:i[1]||(i[1]=r.withKeys(l=>o.$emit("update:modelValue",!o.modelValue),["enter"]))},null,34))}}),Zx={name:"PlCheckbox"},Wx=r.defineComponent({...Zx,props:{modelValue:{type:Boolean},disabled:{type:Boolean}},emits:["update:modelValue"],setup(t){const e=t,n=r.useSlots();return(o,i)=>r.unref(n).default?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(["pl-checkbox",{disabled:o.disabled}])},[r.createVNode(Ul,r.mergeProps(e,{"onUpdate:modelValue":i[0]||(i[0]=l=>o.$emit("update:modelValue",l))}),null,16),i[3]||(i[3]=r.createTextVNode()),r.createElementVNode("label",{onClick:i[1]||(i[1]=l=>o.$emit("update:modelValue",!o.$props.modelValue))},[r.renderSlot(o.$slots,"default")])],2)):(r.openBlock(),r.createBlock(Ul,r.mergeProps({key:1},e,{"onUpdate:modelValue":i[2]||(i[2]=l=>o.$emit("update:modelValue",l))}),null,16))}}),jx={key:0},Hx=["onClick"],qx={name:"PlCheckboxGroup"},Kx=r.defineComponent({...qx,props:{modelValue:{},label:{},options:{},disabled:{type:Boolean}},emits:["update:modelValue"],setup(t,{emit:e}){const n=e,o=t,i=c=>o.modelValue.includes(c),l=c=>{const d=o.modelValue??[];n("update:modelValue",i(c)?d.filter(p=>p!==c):[...d,c])};return(c,d)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["ui-checkbox-group",{disabled:c.disabled}])},[c.label?(r.openBlock(),r.createElementBlock("label",jx,r.toDisplayString(c.label),1)):r.createCommentVNode("",!0),d[1]||(d[1]=r.createTextVNode()),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(c.options.map(p=>({label:"label"in p?p.label:p.text,value:p.value})),(p,h)=>(r.openBlock(),r.createElementBlock("div",{key:h},[r.createVNode(Ul,{disabled:c.disabled,label:p.label,"model-value":i(p.value),"onUpdate:modelValue":()=>l(p.value)},null,8,["disabled","label","model-value","onUpdate:modelValue"]),d[0]||(d[0]=r.createTextVNode()),r.createElementVNode("label",{onClick:r.withModifiers(()=>l(p.value),["stop"])},r.toDisplayString(p.label),9,Hx)]))),128))],2))}}),Yx="_component_tupwt_1",Xx={component:Yx},Jx={};function Qx(t,e){return r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(t.$style.component)},e[0]||(e[0]=[r.createElementVNode("div",null,null,-1)]),2)}const ek={$style:Xx},xp=Mt(Jx,[["render",Qx],["__cssModules",ek]]),tk={key:1,class:"pl-dialog-modal__title"},nk={inheritAttrs:!1},Zl=r.defineComponent({...nk,__name:"PlDialogModal",props:{modelValue:{type:Boolean},width:{default:"448px"},height:{default:"auto"},minHeight:{default:"auto"},maxHeight:{default:"auto"},closable:{type:Boolean,default:!0},noContentGutters:{type:Boolean,default:!1},noTopContentGutter:{type:Boolean},actionsHasTopBorder:{type:Boolean,default:!0},closeOnOutsideClick:{type:Boolean}},emits:["update:modelValue"],setup(t,{emit:e}){const n=r.useSlots(),o=e,i=t,l=r.ref(),c=r.useAttrs();function d(p){l.value&&i.closeOnOutsideClick&&document.contains(p.target)&&!l.value.contains(p.target)&&o("update:modelValue",!1)}return st(document.body,"keyup",p=>{i.modelValue&&p.code==="Escape"&&o("update:modelValue",!1)}),(p,h)=>(r.openBlock(),r.createBlock(r.Teleport,{to:"body"},[r.createVNode(r.Transition,{name:"dialog"},{default:r.withCtx(()=>[p.modelValue?(r.openBlock(),r.createElementBlock("div",{key:0,class:"pl-dialog-modal__shadow",onClick:d},[r.createElementVNode("div",r.mergeProps(r.unref(c),{ref_key:"modal",ref:l,class:["pl-dialog-modal",{"has-title":r.unref(n).title,"has-content":r.unref(n).default}],style:{width:p.width,height:p.height,minHeight:p.minHeight,maxHeight:p.maxHeight}}),[p.closable?(r.openBlock(),r.createBlock(xp,{key:0,class:"close-modal-btn",onClick:h[0]||(h[0]=r.withModifiers(m=>o("update:modelValue",!1),["stop"]))})):r.createCommentVNode("",!0),h[1]||(h[1]=r.createTextVNode()),r.unref(n).title?(r.openBlock(),r.createElementBlock("div",tk,[r.renderSlot(p.$slots,"title")])):r.createCommentVNode("",!0),h[2]||(h[2]=r.createTextVNode()),r.createElementVNode("div",{class:r.normalizeClass(["pl-dialog-modal__content",{"no-content-gutters":p.noContentGutters,"no-top-content-gutter":p.noTopContentGutter}])},[r.renderSlot(p.$slots,"default")],2),h[3]||(h[3]=r.createTextVNode()),r.unref(n).actions?(r.openBlock(),r.createElementBlock("div",{key:2,class:r.normalizeClass(["pl-dialog-modal__actions",{"has-top-border":p.actionsHasTopBorder}])},[r.renderSlot(p.$slots,"actions")],2)):r.createCommentVNode("",!0)],16)])):r.createCommentVNode("",!0)]),_:3})]))}}),rk=r.defineComponent({__name:"TransitionSlidePanel",setup(t){function e(){window.dispatchEvent(new CustomEvent("adjust"))}function n(){window.dispatchEvent(new CustomEvent("adjust"))}return(o,i)=>(r.openBlock(),r.createBlock(r.Transition,{name:"slide-panel",onAfterEnter:e,onAfterLeave:n},{default:r.withCtx(()=>[r.renderSlot(o.$slots,"default")]),_:3}))}}),ok={key:0,class:"pl-slide-modal__title"},ik={class:"pl-slide-modal__content"},sk={key:1,class:"pl-slide-modal__actions"},ak={name:"PlSlideModal",inheritAttrs:!1},Bs=r.defineComponent({...ak,props:{modelValue:{type:Boolean,default:!1},width:{default:"368px"},shadow:{type:Boolean,default:!1},closeOnOutsideClick:{type:Boolean,default:!0}},emits:["update:modelValue"],setup(t,{emit:e}){const n=r.useSlots(),o=e,i=t,l=r.ref(),c=r.useAttrs();return Ns(l,()=>{i.modelValue&&i.closeOnOutsideClick&&o("update:modelValue",!1)}),st(document,"keydown",d=>{d.key==="Escape"&&o("update:modelValue",!1)}),(d,p)=>(r.openBlock(),r.createBlock(r.Teleport,{to:"body"},[r.createVNode(rk,null,{default:r.withCtx(()=>[d.modelValue?(r.openBlock(),r.createElementBlock("div",r.mergeProps({key:0,ref_key:"modal",ref:l,style:{width:d.width}},r.unref(c),{class:["pl-slide-modal",{"has-title":r.unref(n).title,"has-actions":r.unref(n).actions}],onKeyup:p[1]||(p[1]=r.withKeys(h=>o("update:modelValue",!1),["esc"]))}),[r.createElementVNode("div",{class:"close-dialog-btn",onClick:p[0]||(p[0]=h=>o("update:modelValue",!1))}),p[3]||(p[3]=r.createTextVNode()),r.unref(n).title?(r.openBlock(),r.createElementBlock("div",ok,[r.renderSlot(d.$slots,"title")])):r.createCommentVNode("",!0),p[4]||(p[4]=r.createTextVNode()),r.createElementVNode("div",ik,[r.renderSlot(d.$slots,"default")]),p[5]||(p[5]=r.createTextVNode()),r.unref(n).actions?(r.openBlock(),r.createElementBlock("div",sk,[r.renderSlot(d.$slots,"actions")])):r.createCommentVNode("",!0)],16)):r.createCommentVNode("",!0)]),_:3}),p[6]||(p[6]=r.createTextVNode()),d.modelValue&&d.shadow?(r.openBlock(),r.createElementBlock("div",{key:0,class:"pl-slide-modal__shadow",onKeyup:p[2]||(p[2]=r.withKeys(h=>o("update:modelValue",!1),["esc"]))},null,32)):r.createCommentVNode("",!0)]))}}),lk={key:0,class:"label"},ck={name:"PlToggleSwitch"},Ps=r.defineComponent({...ck,props:{label:{},modelValue:{type:Boolean}},emits:["update:modelValue"],setup(t){return(e,n)=>(r.openBlock(),r.createElementBlock("div",{tabindex:"0",class:r.normalizeClass(["ui-toggle-switch",{active:e.modelValue}]),onClick:n[0]||(n[0]=o=>e.$emit("update:modelValue",!e.modelValue)),onKeydown:n[1]||(n[1]=r.withKeys(o=>e.$emit("update:modelValue",!e.modelValue),["enter"]))},[n[2]||(n[2]=r.createElementVNode("div",{class:"ui-toggle-switch__body"},[r.createElementVNode("div",{class:"ui-toggle-switch__handle"})],-1)),n[3]||(n[3]=r.createTextVNode()),e.label?(r.openBlock(),r.createElementBlock("span",lk,r.toDisplayString(e.label),1)):r.createCommentVNode("",!0)],34))}});function kp(t){return r.getCurrentScope()?(r.onScopeDispose(t),!0):!1}function dk(t){return r.unref(t)}const uk=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;function pk(t,e,n={}){const{immediate:o=!0}=n,i=r.ref(!1);let l=null;function c(){l&&(clearTimeout(l),l=null)}function d(){i.value=!1,c()}function p(...h){c(),i.value=!0,l=setTimeout(()=>{i.value=!1,l=null,t(...h)},dk(e))}return o&&(i.value=!0,uk&&p()),kp(d),{isPending:r.readonly(i),start:p,stop:d}}function hk(t,e,n){return r.watch(t,(o,i,l)=>{o&&e(o,i,l)},{...n,once:!1})}function fk(t,e,n){const{start:o}=pk(l,e,{immediate:!1}),i=r.ref(!1);async function l(){i.value&&(await t(),o())}function c(){i.value||(i.value=!0,l())}function d(){i.value=!1}return n!=null&&n.immediate&&c(),kp(d),{isActive:i,pause:d,resume:c}}const mk="[==PROGRESS==]";function gk(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function yk(t){const e=r.ref(),n=r.reactive({errorCount:0});async function o(){var l;let c=e.value;if(c===void 0)return;const d=t.mockPlatforma??window.platforma;if(!d){console.warn("Platforma API is not available");return}for(;;){const p=await d.logDriver.readText(c.logHandle,100,c.lastOffset);if(c.error=void 0,n.errorCount=0,p.shouldUpdateHandle||c.logHandle!==((l=e.value)==null?void 0:l.logHandle))return;const h=t.progressPrefix??mk,m=new TextDecoder().decode(p.data).replace(new RegExp(`${gk(h)}`,"g"),"");if(c=Object.assign(c,{lines:c.lines+m,lastOffset:p.newOffset,finished:!p.live}),p.newOffset>=p.size)break}}const i=fk(()=>o().catch(l=>{e.value&&(n.errorCount++,n.errorCount>(t.maxRetries??3)?e.value.error=l:console.warn("skip error:",l,"retry..."))}),1500,{immediate:!1});return hk(()=>{var l;return(l=e==null?void 0:e.value)==null?void 0:l.finished},()=>i.pause()),r.watch(()=>t.logHandle,l=>{var c;l===void 0?(e.value=void 0,i.pause()):l!==((c=e.value)==null?void 0:c.logHandle)&&(e.value={logHandle:l,lastOffset:0,lines:"",finished:!1,error:void 0},n.errorCount=0,i.resume())},{immediate:!0}),e}const _k={key:0},Ck={class:"pl-log-view__copy"},vk={key:1,class:"pl-log-view__error"},wk={name:"PlLogView"},Ep=r.defineComponent({...wk,props:{value:{},logHandle:{},progressPrefix:{},error:{},output:{},maxRetries:{},mockPlatforma:{},label:{}},setup(t){const e=S=>{if(S&&S.ok===!1)return S.errors.join(`
53
+ `)},n=t,o=yk(n),i=r.ref(!0),l=r.ref(),c=r.ref(),d=r.computed(()=>{var S;return((S=o.value)==null?void 0:S.error)??n.error??e(n.output)}),p=r.computed(()=>{var S;return((S=o.value)==null?void 0:S.lines)??n.value??QC(n.output)}),h=r.ref(!1);Yn(c);const m=r.computed(()=>h.value?"clipboard-copied":"clipboard"),y=()=>{h.value=!0,setTimeout(()=>{h.value=!1},1200),p.value&&typeof p.value=="string"&&navigator.clipboard.writeText(p.value)},b=()=>{gr(l.value,S=>{i.value&&S.scrollTo(S.scrollLeft,S.scrollHeight)})};r.watch(p,()=>{requestAnimationFrame(()=>{b()})},{immediate:!0});const w=S=>{const M=S.target;i.value=M.scrollTop+20>=M.scrollHeight-M.offsetHeight};return(S,M)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"root",ref:c,class:r.normalizeClass(["pl-log-view",{"has-error":d.value}])},[S.label?(r.openBlock(),r.createElementBlock("label",_k,r.toDisplayString(S.label),1)):r.createCommentVNode("",!0),M[1]||(M[1]=r.createTextVNode()),r.createVNode(Cr,{class:"pl-log-view__contour"}),M[2]||(M[2]=r.createTextVNode()),r.createElementVNode("div",Ck,[r.createVNode(r.unref(Ct),{"close-delay":800,position:"top"},{tooltip:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(h.value?"copied":"copy"),1)]),default:r.withCtx(()=>[r.createVNode(r.unref(At),{title:"Copy content",name:m.value,onClick:y},null,8,["name"]),M[0]||(M[0]=r.createTextVNode())]),_:1})]),M[3]||(M[3]=r.createTextVNode()),d.value?(r.openBlock(),r.createElementBlock("div",vk,r.toDisplayString(d.value),1)):(r.openBlock(),r.createElementBlock("div",{key:2,ref_key:"contentRef",ref:l,class:"pl-log-view__content",onScroll:w},r.toDisplayString(p.value),545))],2))}}),bk="_component_1ukal_1",xk="_tab_1ukal_14",kk="_disabled_1ukal_27",Ek="_active_1ukal_56",Sk="_topLine_1ukal_69",bo={component:bk,tab:xk,disabled:kk,active:Ek,topLine:Sk},Tk=r.defineComponent({__name:"Tab",props:{option:{}},setup(t){const e=r.ref(),n=r.reactive({isOverflown:!1});return r.onMounted(()=>{const o=r.unref(e);if(!o)return;const i=o.$el.querySelector("span");i&&requestAnimationFrame(()=>{i.offsetWidth<i.scrollWidth&&(n.isOverflown=!0)})}),(o,i)=>(r.openBlock(),r.createBlock(r.unref(Ct),{ref_key:"rootRef",ref:e,element:"div",position:"top",hide:!n.isOverflown,"close-delay":300,"data-is-overflown":n.isOverflown?"true":"false"},{tooltip:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(o.option.label),1)]),default:r.withCtx(()=>[r.renderSlot(o.$slots,"default"),i[0]||(i[0]=r.createTextVNode())]),_:3},8,["hide","data-is-overflown"]))}}),Nk={name:"PlTabs"},Vk=r.defineComponent({...Nk,props:{modelValue:{},options:{},disabled:{type:Boolean},topLine:{type:Boolean},maxTabWidth:{}},emits:["update:modelValue"],setup(t,{emit:e}){const n=e,o=i=>n("update:modelValue",i);return(i,l)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass([r.unref(bo).component,{[r.unref(bo).disabled]:i.disabled,[r.unref(bo).topLine]:i.topLine}])},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(i.options,(c,d)=>(r.openBlock(),r.createBlock(Tk,{key:d,tabindex:i.modelValue===c.value||i.disabled||c.disabled?void 0:0,option:c,class:r.normalizeClass([{[r.unref(bo).active]:i.modelValue===c.value,[r.unref(bo).disabled]:c.disabled},r.unref(bo).tab]),style:r.normalizeStyle({"--pl-tabs-item-max-width":c.maxWidth??i.maxTabWidth}),onKeydown:r.withKeys(p=>o(c.value),["enter"]),onClick:p=>o(c.value)},{default:r.withCtx(()=>[r.renderSlot(i.$slots,c.value,{option:c},()=>[r.createElementVNode("span",null,r.toDisplayString(c.label),1)])]),_:2},1032,["tabindex","option","class","style","onKeydown","onClick"]))),128))],2))}}),Ak=r.defineComponent({__name:"PlSectionSeparator",props:{compact:{type:Boolean}},setup(t){return(e,n)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["pl-section-separator",{[e.$style.compact]:e.compact}])},[r.createElementVNode("div",{class:r.normalizeClass(e.$style.content)},[r.renderSlot(e.$slots,"default")],2)],2))}}),Bk="_compact_rhd5u_16",Pk="_content_rhd5u_20",Rk={compact:Bk,content:Pk},Dk={$style:Rk},Sp=Mt(Ak,[["__cssModules",Dk]]),Ik=r.defineComponent({__name:"PlAccordion",props:r.mergeModels({multiple:{type:Boolean}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=r.useModel(t,"modelValue"),n=t;return r.provide("pl-accordion-model",e),r.provide("pl-accordion-props",r.toRef(n)),(o,i)=>(r.openBlock(),r.createElementBlock(r.Fragment,null,[r.renderSlot(o.$slots,"header"),i[0]||(i[0]=r.createTextVNode()),r.renderSlot(o.$slots,"default")],64))}}),Fk=r.defineComponent({__name:"ExpandTransition",setup(t){const e=o=>{o.style.setProperty("--component-height",o.scrollHeight+"px"),o.classList.add("expand-collapse-fix")},n=o=>{o.style.removeProperty("--component-height"),o.classList.remove("expand-collapse-fix")};return(o,i)=>(r.openBlock(),r.createBlock(r.Transition,{name:"expand-collapse",onEnter:e,onLeave:e,onAfterEnter:n,onAfterLeave:n},{default:r.withCtx(()=>[r.renderSlot(o.$slots,"default")]),_:3}))}}),Lk=r.defineComponent({__name:"PlAccordionSection",props:r.mergeModels({label:{},compact:{type:Boolean}},{modelValue:{type:Boolean},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=r.inject("pl-accordion-model"),n=r.inject("pl-accordion-props"),o=r.useModel(t,"modelValue"),i=Wu(),l=r.computed(()=>!n||n.value.multiple),c=r.computed({get(){return l.value?o.value:e?e.value===i:o.value},set(d){l.value?o.value=d:e&&(e.value=e.value===i?"":i)}});return(d,p)=>(r.openBlock(),r.createElementBlock(r.Fragment,null,[r.createVNode(r.unref(Sp),{class:r.normalizeClass(d.$style.separator),compact:d.compact,onClick:p[0]||(p[0]=h=>c.value=!c.value)},{default:r.withCtx(()=>[r.createVNode(r.unref(Vt),{name:"chevron-right",class:r.normalizeClass([{[d.$style.down]:c.value},d.$style.chevron])},null,8,["class"]),r.createTextVNode(" "+r.toDisplayString(d.label),1)]),_:1},8,["class","compact"]),p[1]||(p[1]=r.createTextVNode()),r.createVNode(Fk,null,{default:r.withCtx(()=>[c.value?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(d.$style.content)},[r.renderSlot(d.$slots,"default")],2)):r.createCommentVNode("",!0)]),_:3})],64))}}),Ok="_content_jmjfk_2",Mk="_separator_jmjfk_14",Gk="_chevron_jmjfk_19",$k="_down_jmjfk_23",zk={content:Ok,separator:Mk,chevron:Gk,down:$k},Uk={$style:zk},Zk=Mt(Lk,[["__cssModules",Uk]]),Wk="_component_1ietr_1",jk="_local_1ietr_1",Hk="_supported_1ietr_26",qk="_remote_1ietr_32",Kk="_search_1ietr_40",Yk="_selected_1ietr_72",Xk="_breadcrumbs_1ietr_86",Jk="_cat_1ietr_116",Qk="_message_1ietr_122",eE="_isFile_1ietr_197",tE="_isDir_1ietr_201",nE="_canBeSelected_1ietr_207",rE="_spin_1ietr_1",ct={component:Wk,local:jk,supported:Hk,remote:qk,search:Kk,"ls-container":"_ls-container_1ietr_50","ls-head":"_ls-head_1ietr_57",selected:Yk,breadcrumbs:Xk,"ls-error":"_ls-error_1ietr_108",cat:Jk,message:Qk,"ls-empty":"_ls-empty_1ietr_131","ls-body":"_ls-body_1ietr_152",isFile:eE,isDir:tE,canBeSelected:nE,"ls-loader":"_ls-loader_1ietr_213","loader-icon":"_loader-icon_1ietr_221",spin:rE},oE=r.defineComponent({__name:"Shortcuts",setup(t){return(e,n)=>(r.openBlock(),r.createBlock(r.unref(Ct),{class:"info",position:"southwest","max-width":"420px"},{tooltip:r.withCtx(()=>[r.createElementVNode("span",{class:r.normalizeClass(e.$style.title)},"Shortcuts",2),n[2]||(n[2]=r.createTextVNode()),r.createElementVNode("div",{class:r.normalizeClass([e.$style.row,e.$style.head])},n[0]||(n[0]=[r.createElementVNode("div",null,null,-1),r.createTextVNode(),r.createElementVNode("div",null,"MacOS",-1),r.createTextVNode(),r.createElementVNode("div",null,"Windows/Linux",-1)]),2),n[3]||(n[3]=r.createTextVNode()),r.createElementVNode("div",{class:r.normalizeClass([e.$style.row,e.$style.body])},n[1]||(n[1]=[r.createElementVNode("div",null,"Single File",-1),r.createTextVNode(),r.createElementVNode("div",null,"Click the file",-1),r.createTextVNode(),r.createElementVNode("div",null,"Click the file",-1),r.createTextVNode(),r.createElementVNode("div",null,"Adjacent multiple files",-1),r.createTextVNode(),r.createElementVNode("div",null,"Hold Shift, click first and last files",-1),r.createTextVNode(),r.createElementVNode("div",null,"Hold Shift, click first and last files",-1),r.createTextVNode(),r.createElementVNode("div",null,"Non-adjacent multiple files",-1),r.createTextVNode(),r.createElementVNode("div",null,"Hold Command (⌘), click each file",-1),r.createTextVNode(),r.createElementVNode("div",null,"Hold Ctrl, click each file",-1),r.createTextVNode(),r.createElementVNode("div",null,"All files",-1),r.createTextVNode(),r.createElementVNode("div",null,"Press Command (⌘) + A",-1),r.createTextVNode(),r.createElementVNode("div",null,"Press Ctrl + A",-1)]),2)]),_:1}))}}),iE="_title_14dct_2",sE="_row_14dct_10",aE="_head_14dct_30",lE="_body_14dct_58",cE={title:iE,row:sE,head:aE,body:lE},dE={$style:cE},uE=Mt(oE,[["__cssModules",dE]]),Tp=()=>({dirPath:"",search:"",storageEntry:void 0,items:[],error:"",storageOptions:[],selected:[],lastSelected:void 0,currentLoadingPath:void 0,showHiddenItems:!1});function pE(t){return r.computed(()=>{let e=t.items;if(t.showHiddenItems||(e=e.filter(n=>!n.name.startsWith("."))),t.search){const n=t.search.toLocaleLowerCase();e=e.filter(o=>o.name.toLocaleLowerCase().includes(n))}return e})}const Np={mounted:t=>{if(t.clientWidth<t.scrollWidth){const e=t.innerText;t.innerText=e.substring(0,57)+"..."+e.substring(e.length-10)}}};function Vp(t){return t?t.map(e=>"."+nv(e,["."])):void 0}function hE(t){const e=t.split("/");e[0]!==""&&e.unshift("");const n=[];for(let o=0;o<e.length;o++)n.push({index:o,name:o===0?"Root":e[o],path:e.slice(0,o+1).filter(i=>i!=="").join("/")});return n}const fE=["title","onClick"],mE={key:0,class:"ls-loader"},gE=["onClick"],yE=["title"],_E=["onClick"],CE=["title"],vE=r.defineComponent({__name:"Remote",props:{modelValue:{type:Boolean},extensions:{default:void 0},multi:{type:Boolean},title:{default:void 0},autoSelectStorage:{type:Boolean,default:!0},submit:{}},emits:["update:modelValue","import:files"],setup(t,{expose:e}){const n=P=>P.ctrlKey||P.metaKey,o=t,i=r.reactive(Tp()),l=()=>{i.search="",i.error="",i.lastSelected=void 0},c=r.computed(()=>Vp(o.extensions)),d=pE(i),p=r.computed(()=>{var P;return{modelValue:o.modelValue,dirPath:i.dirPath,storageHandle:(P=i.storageEntry)==null?void 0:P.handle}}),h=(P,V)=>{window.platforma&&i.currentLoadingPath!==V&&(i.currentLoadingPath=V,window.platforma.lsDriver.listFiles(P,V).then(Z=>{V===i.dirPath&&(i.items=xs(Z).entries.map(J=>({path:J.fullPath,name:J.name,isDir:J.type==="dir",canBeSelected:J.type==="file"&&(!c.value||c.value.some(ae=>J.fullPath.endsWith(ae))),handle:J.type==="file"?J.handle:void 0,selected:!1})).sort((J,ae)=>J.isDir&&!ae.isDir?-1:!J.isDir&&ae.isDir?1:J.name.localeCompare(ae.name)).map((J,ae)=>({id:ae,...J})),i.lastSelected=void 0)}).catch(Z=>i.error=String(Z)).finally(()=>{i.currentLoadingPath=void 0}))},m=()=>{l();const{storageHandle:P,dirPath:V,modelValue:Z}=p.value;P&&Z&&h(P,V)},y=r.computed(()=>hE(i.dirPath)),b=r.computed(()=>i.items.filter(P=>P.canBeSelected&&P.selected&&!P.isDir)),w=r.computed(()=>{var P;return b.value.length>0&&((P=i.storageEntry)==null?void 0:P.handle)}),S=()=>{var P;return{storageHandle:xs((P=i.storageEntry)==null?void 0:P.handle),files:b.value.map(V=>V.handle)}},M=P=>{i.dirPath=P},O=(P,V)=>{const{shiftKey:Z}=P,J=n(P),{lastSelected:ae}=i;if(P.preventDefault(),V.canBeSelected){if(o.multi||i.items.forEach($=>$.selected=!1),V.selected=!V.selected,!o.multi)return;!J&&!Z&&i.items.forEach($=>{$.id!==V.id&&($.selected=!1)}),Z&&ae!==void 0&&i.items.forEach($=>{YC($.id,ae,V.id)&&($.selected=!0)}),V.selected&&(i.lastSelected=V.id)}},v=P=>{P&&!o.multi||i.items.filter(V=>V.canBeSelected).forEach(V=>{V.selected=P})},I=()=>v(!0),F=()=>v(!1),W=()=>{if(l(),F(),!window.platforma){console.warn("platforma API is not found");return}window.platforma.lsDriver.getStorageList().then(P=>{P=P.filter(V=>V.name!=="local"&&!V.name.startsWith("local_disk_")),i.storageOptions=P.map(V=>({text:V.name,value:V})),o.autoSelectStorage&&gr(P[0],V=>{i.storageEntry=V})}).catch(P=>i.error=String(P))};return r.watch(r.toRef(i,"storageEntry"),P=>{l(),i.dirPath=(P==null?void 0:P.initialFullPath)??""},{immediate:!0}),r.watch([()=>i.dirPath,()=>i.storageEntry],()=>{m()}),r.watch(()=>o.modelValue,P=>{P?W():Object.assign(i,Tp())},{immediate:!0}),st(document,"keydown",P=>{if(!o.modelValue||P.target!==document.body)return;const V=n(P);V&&P.code==="KeyA"&&(P.preventDefault(),I()),V&&P.shiftKey&&P.code==="Period"&&(P.preventDefault(),i.showHiddenItems=!i.showHiddenItems),P.code==="Enter"&&o.submit()}),e({isReady:w,getFilesToImport:S}),r.onMounted(W),(P,V)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(r.unref(ct).remote),onClick:r.withModifiers(F,["stop"])},[r.createElementVNode("div",{class:r.normalizeClass(r.unref(ct).search)},[r.createElementVNode("div",null,[r.createVNode(r.unref(wo),{modelValue:i.storageEntry,"onUpdate:modelValue":V[0]||(V[0]=Z=>i.storageEntry=Z),label:"Select storage",options:i.storageOptions},null,8,["modelValue","options"])]),V[2]||(V[2]=r.createTextVNode()),r.createElementVNode("div",null,[r.createVNode(r.unref(_p),{modelValue:i.search,"onUpdate:modelValue":V[1]||(V[1]=Z=>i.search=Z),label:"Search in folder",clearable:""},null,8,["modelValue"])])],2),V[12]||(V[12]=r.createTextVNode()),r.createElementVNode("div",{class:r.normalizeClass(r.unref(ct)["ls-container"])},[r.createElementVNode("div",{class:r.normalizeClass(r.unref(ct)["ls-head"])},[r.createElementVNode("div",{class:r.normalizeClass(r.unref(ct).breadcrumbs)},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(y.value,(Z,J)=>(r.openBlock(),r.createElementBlock(r.Fragment,{key:J},[r.createElementVNode("div",{title:Z.path,onClick:ae=>M(Z.path)},r.toDisplayString(Z.name),9,fE),V[3]||(V[3]=r.createTextVNode()),Z.index!==y.value.length-1?(r.openBlock(),r.createBlock(r.unref(Wr),{key:0,name:"chevron-right"})):r.createCommentVNode("",!0)],64))),128))],2),V[5]||(V[5]=r.createTextVNode()),r.createElementVNode("div",{class:r.normalizeClass(r.unref(ct).selected)},[r.createElementVNode("span",null,"Selected: "+r.toDisplayString(b.value.length),1),V[4]||(V[4]=r.createTextVNode()),r.createVNode(uE)],2)],2),V[11]||(V[11]=r.createTextVNode()),i.currentLoadingPath!==void 0?(r.openBlock(),r.createElementBlock("div",mE,V[6]||(V[6]=[r.createElementVNode("i",{class:"mask-24 mask-loading loader-icon"},null,-1)]))):i.storageEntry?i.error?(r.openBlock(),r.createElementBlock("div",{key:2,class:r.normalizeClass(r.unref(ct)["ls-error"])},[r.createElementVNode("div",{class:r.normalizeClass(r.unref(ct).cat)},null,2),V[8]||(V[8]=r.createTextVNode()),r.createElementVNode("div",{class:r.normalizeClass(r.unref(ct).message)},r.toDisplayString(i.error),3)],2)):(r.openBlock(),r.createElementBlock("div",{key:3,class:r.normalizeClass(r.unref(ct)["ls-body"])},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(d),Z=>(r.openBlock(),r.createElementBlock(r.Fragment,{key:Z.id},[Z.isDir?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(r.unref(ct).isDir),onClick:J=>M(Z.path)},[r.createVNode(r.unref(Wr),{name:"chevron-right"}),V[9]||(V[9]=r.createTextVNode()),r.withDirectives((r.openBlock(),r.createElementBlock("span",{title:Z.name},[r.createTextVNode(r.toDisplayString(Z.name),1)],8,yE)),[[r.unref(Np)]])],10,gE)):(r.openBlock(),r.createElementBlock("div",{key:1,class:r.normalizeClass({[r.unref(ct).canBeSelected]:Z.canBeSelected,[r.unref(ct).selected]:Z.selected}),onClick:r.withModifiers(J=>O(J,Z),["stop"])},[r.createVNode(r.unref(Vt),{name:"box",class:r.normalizeClass(r.unref(ct).isFile)},null,8,["class"]),V[10]||(V[10]=r.createTextVNode()),r.withDirectives((r.openBlock(),r.createElementBlock("span",{title:Z.name},[r.createTextVNode(r.toDisplayString(Z.name),1)],8,CE)),[[r.unref(Np)]])],10,_E))],64))),128))],2)):(r.openBlock(),r.createElementBlock("div",{key:1,class:r.normalizeClass(r.unref(ct)["ls-empty"])},[r.createElementVNode("div",{class:r.normalizeClass(r.unref(ct).cat)},null,2),V[7]||(V[7]=r.createTextVNode()),r.createElementVNode("div",{class:r.normalizeClass(r.unref(ct).message)},"Select storage to preview",2)],2))],2)],2))}}),wE={key:1,class:"alert-error"},bE=r.defineComponent({__name:"Local",props:{importFiles:{type:Function},multi:{type:Boolean},extensions:{}},setup(t){const e=t,n=r.reactive({error:void 0}),o=r.computed(()=>e.multi?"Drag & Drop files here or click to add":"Drag & Drop file here or click to add"),i=async c=>{var d,p,h;const m=(p=(d=window.platforma)==null?void 0:d.lsDriver)==null?void 0:p.fileToImportHandle;if(!m)return console.error("API platforma.lsDriver.fileToImportHandle is not available");const y=Vp(e.extensions),b=await Promise.all([...((h=c.dataTransfer)==null?void 0:h.files)??[]].filter(w=>!!w).filter(w=>y?y.some(S=>w.name.endsWith(S)):!0).map(w=>m(w)));b.length&&e.importFiles({files:b})},l=async()=>{var c,d;const p=e.extensions?[{name:"All Files",extensions:e.extensions}]:[];e.multi?(c=window.platforma)==null||c.lsDriver.showOpenMultipleFilesDialog({title:"Select files to import",filters:p}).then(({files:h})=>{h&&e.importFiles({files:h})}).catch(h=>n.error=h):(d=window.platforma)==null||d.lsDriver.showOpenSingleFileDialog({title:"Select file to import",filters:p}).then(({file:h})=>{h&&e.importFiles({files:[h]})}).catch(h=>n.error=h)};return(c,d)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(r.unref(ct).local),onDrop:i,onDragover:d[0]||(d[0]=r.withModifiers(()=>{},["prevent"])),onClick:l},[r.createVNode(r.unref(Vs),{name:"cloud-upload"}),d[1]||(d[1]=r.createTextVNode()),r.createElementVNode("span",null,r.toDisplayString(o.value),1),d[2]||(d[2]=r.createTextVNode()),c.extensions?(r.openBlock(),r.createElementBlock("span",{key:0,class:r.normalizeClass(r.unref(ct).supported)},"Supported formats: "+r.toDisplayString(c.extensions.join(", ")),3)):r.createCommentVNode("",!0),d[3]||(d[3]=r.createTextVNode()),n.error?(r.openBlock(),r.createElementBlock("span",wE,r.toDisplayString(n.error),1)):r.createCommentVNode("",!0)],34))}}),xE={style:{margin:"0 24px"}},Ap=r.defineComponent({__name:"PlFileDialog",props:{modelValue:{type:Boolean},extensions:{default:void 0},multi:{type:Boolean},title:{default:void 0},autoSelectStorage:{type:Boolean,default:!0},closeOnOutsideClick:{type:Boolean,default:!0}},emits:["update:modelValue","import:files"],setup(t,{emit:e}){const n=e,o=t,i=r.ref("local"),l=r.computed(()=>o.multi?"Select Files to Import":"Select File to Import"),c=[{label:"My Computer",value:"local"},{label:"Remote",value:"remote"}],d=()=>n("update:modelValue",!1),p=r.useTemplateRef("remote"),h=()=>{var y,b;(y=p.value)!=null&&y.isReady&&(n("import:files",xs((b=p.value)==null?void 0:b.getFilesToImport())),d())},m=y=>{n("import:files",y),d()};return(y,b)=>(r.openBlock(),r.createBlock(r.unref(Zl),{"no-content-gutters":!0,"close-on-outside-click":y.closeOnOutsideClick,class:r.normalizeClass(["pl-dialog-modal",r.unref(ct).component]),"model-value":y.modelValue,width:"688px",height:"720px","onUpdate:modelValue":d},r.createSlots({title:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(y.title??l.value),1)]),default:r.withCtx(()=>[b[4]||(b[4]=r.createTextVNode()),r.createElementVNode("div",xE,[r.createVNode(r.unref(pp),{modelValue:i.value,"onUpdate:modelValue":b[0]||(b[0]=w=>i.value=w),options:c},null,8,["modelValue"])]),b[5]||(b[5]=r.createTextVNode()),i.value==="remote"?(r.openBlock(),r.createBlock(vE,r.mergeProps({key:0,ref:"remote"},y.$props,{submit:h}),null,16)):r.createCommentVNode("",!0),b[6]||(b[6]=r.createTextVNode()),i.value==="local"?(r.openBlock(),r.createBlock(bE,r.mergeProps({key:1,"import-files":m},y.$props),null,16)):r.createCommentVNode("",!0),b[7]||(b[7]=r.createTextVNode())]),_:2},[i.value==="remote"?{name:"actions",fn:r.withCtx(()=>{var w;return[r.createVNode(r.unref(Ts),{style:{"min-width":"160px"},disabled:!((w=r.unref(p))!=null&&w.isReady),onClick:r.withModifiers(h,["stop"])},{default:r.withCtx(()=>b[1]||(b[1]=[r.createTextVNode("Import")])),_:1},8,["disabled"]),b[3]||(b[3]=r.createTextVNode()),r.createVNode(r.unref(vo),{"justify-center":!1,onClick:r.withModifiers(d,["stop"])},{default:r.withCtx(()=>b[2]||(b[2]=[r.createTextVNode("Cancel")])),_:1})]}),key:"0"}:void 0]),1032,["close-on-outside-click","class","model-value"]))}});var $e;(function(t){t.assertEqual=i=>i;function e(i){}t.assertIs=e;function n(i){throw new Error}t.assertNever=n,t.arrayToEnum=i=>{const l={};for(const c of i)l[c]=c;return l},t.getValidEnumValues=i=>{const l=t.objectKeys(i).filter(d=>typeof i[i[d]]!="number"),c={};for(const d of l)c[d]=i[d];return t.objectValues(c)},t.objectValues=i=>t.objectKeys(i).map(function(l){return i[l]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const l=[];for(const c in i)Object.prototype.hasOwnProperty.call(i,c)&&l.push(c);return l},t.find=(i,l)=>{for(const c of i)if(l(c))return c},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function o(i,l=" | "){return i.map(c=>typeof c=="string"?`'${c}'`:c).join(l)}t.joinValues=o,t.jsonStringifyReplacer=(i,l)=>typeof l=="bigint"?l.toString():l})($e||($e={}));var Wl;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(Wl||(Wl={}));const ce=$e.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),vr=t=>{switch(typeof t){case"undefined":return ce.undefined;case"string":return ce.string;case"number":return isNaN(t)?ce.nan:ce.number;case"boolean":return ce.boolean;case"function":return ce.function;case"bigint":return ce.bigint;case"symbol":return ce.symbol;case"object":return Array.isArray(t)?ce.array:t===null?ce.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?ce.promise:typeof Map<"u"&&t instanceof Map?ce.map:typeof Set<"u"&&t instanceof Set?ce.set:typeof Date<"u"&&t instanceof Date?ce.date:ce.object;default:return ce.unknown}},te=$e.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),kE=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:");class jt extends Error{constructor(e){super(),this.issues=[],this.addIssue=o=>{this.issues=[...this.issues,o]},this.addIssues=(o=[])=>{this.issues=[...this.issues,...o]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const n=e||function(l){return l.message},o={_errors:[]},i=l=>{for(const c of l.issues)if(c.code==="invalid_union")c.unionErrors.map(i);else if(c.code==="invalid_return_type")i(c.returnTypeError);else if(c.code==="invalid_arguments")i(c.argumentsError);else if(c.path.length===0)o._errors.push(n(c));else{let d=o,p=0;for(;p<c.path.length;){const h=c.path[p];p===c.path.length-1?(d[h]=d[h]||{_errors:[]},d[h]._errors.push(n(c))):d[h]=d[h]||{_errors:[]},d=d[h],p++}}};return i(this),o}static assert(e){if(!(e instanceof jt))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,$e.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){const n={},o=[];for(const i of this.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(e(i))):o.push(e(i));return{formErrors:o,fieldErrors:n}}get formErrors(){return this.flatten()}}jt.create=t=>new jt(t);const xo=(t,e)=>{let n;switch(t.code){case te.invalid_type:t.received===ce.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case te.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,$e.jsonStringifyReplacer)}`;break;case te.unrecognized_keys:n=`Unrecognized key(s) in object: ${$e.joinValues(t.keys,", ")}`;break;case te.invalid_union:n="Invalid input";break;case te.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${$e.joinValues(t.options)}`;break;case te.invalid_enum_value:n=`Invalid enum value. Expected ${$e.joinValues(t.options)}, received '${t.received}'`;break;case te.invalid_arguments:n="Invalid function arguments";break;case te.invalid_return_type:n="Invalid function return type";break;case te.invalid_date:n="Invalid date";break;case te.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:$e.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case te.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case te.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case te.custom:n="Invalid input";break;case te.invalid_intersection_types:n="Intersection results could not be merged";break;case te.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case te.not_finite:n="Number must be finite";break;default:n=e.defaultError,$e.assertNever(t)}return{message:n}};let Bp=xo;function EE(t){Bp=t}function Rs(){return Bp}const Ds=t=>{const{data:e,path:n,errorMaps:o,issueData:i}=t,l=[...n,...i.path||[]],c={...i,path:l};if(i.message!==void 0)return{...i,path:l,message:i.message};let d="";const p=o.filter(h=>!!h).slice().reverse();for(const h of p)d=h(c,{data:e,defaultError:d}).message;return{...i,path:l,message:d}},SE=[];function se(t,e){const n=Rs(),o=Ds({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===xo?void 0:xo].filter(i=>!!i)});t.common.issues.push(o)}class xt{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){const o=[];for(const i of n){if(i.status==="aborted")return xe;i.status==="dirty"&&e.dirty(),o.push(i.value)}return{status:e.value,value:o}}static async mergeObjectAsync(e,n){const o=[];for(const i of n){const l=await i.key,c=await i.value;o.push({key:l,value:c})}return xt.mergeObjectSync(e,o)}static mergeObjectSync(e,n){const o={};for(const i of n){const{key:l,value:c}=i;if(l.status==="aborted"||c.status==="aborted")return xe;l.status==="dirty"&&e.dirty(),c.status==="dirty"&&e.dirty(),l.value!=="__proto__"&&(typeof c.value<"u"||i.alwaysSet)&&(o[l.value]=c.value)}return{status:e.value,value:o}}}const xe=Object.freeze({status:"aborted"}),Is=t=>({status:"dirty",value:t}),Bt=t=>({status:"valid",value:t}),jl=t=>t.status==="aborted",Hl=t=>t.status==="dirty",wi=t=>t.status==="valid",bi=t=>typeof Promise<"u"&&t instanceof Promise;function Fs(t,e,n,o){if(typeof e=="function"?t!==e||!o:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e.get(t)}function Pp(t,e,n,o,i){if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return e.set(t,n),n}var me;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(me||(me={}));var xi,ki;class Mn{constructor(e,n,o,i){this._cachedPath=[],this.parent=e,this.data=n,this._path=o,this._key=i}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Rp=(t,e)=>{if(wi(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new jt(t.common.issues);return this._error=n,this._error}}};function Ae(t){if(!t)return{};const{errorMap:e,invalid_type_error:n,required_error:o,description:i}=t;if(e&&(n||o))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:(l,c)=>{var d,p;const{message:h}=t;return l.code==="invalid_enum_value"?{message:h??c.defaultError}:typeof c.data>"u"?{message:(d=h??o)!==null&&d!==void 0?d:c.defaultError}:l.code!=="invalid_type"?{message:c.defaultError}:{message:(p=h??n)!==null&&p!==void 0?p:c.defaultError}},description:i}}class Re{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return vr(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:vr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new xt,ctx:{common:e.parent.common,data:e.data,parsedType:vr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const n=this._parse(e);if(bi(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){const n=this._parse(e);return Promise.resolve(n)}parse(e,n){const o=this.safeParse(e,n);if(o.success)return o.data;throw o.error}safeParse(e,n){var o;const i={common:{issues:[],async:(o=n==null?void 0:n.async)!==null&&o!==void 0?o:!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:vr(e)},l=this._parseSync({data:e,path:i.path,parent:i});return Rp(i,l)}async parseAsync(e,n){const o=await this.safeParseAsync(e,n);if(o.success)return o.data;throw o.error}async safeParseAsync(e,n){const o={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:vr(e)},i=this._parse({data:e,path:o.path,parent:o}),l=await(bi(i)?i:Promise.resolve(i));return Rp(o,l)}refine(e,n){const o=i=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(i):n;return this._refinement((i,l)=>{const c=e(i),d=()=>l.addIssue({code:te.custom,...o(i)});return typeof Promise<"u"&&c instanceof Promise?c.then(p=>p?!0:(d(),!1)):c?!0:(d(),!1)})}refinement(e,n){return this._refinement((o,i)=>e(o)?!0:(i.addIssue(typeof n=="function"?n(o,i):n),!1))}_refinement(e){return new yn({schema:this,typeName:we.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return $n.create(this,this._def)}nullable(){return Er.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return gn.create(this,this._def)}promise(){return To.create(this,this._def)}or(e){return Ni.create([this,e],this._def)}and(e){return Vi.create(this,e,this._def)}transform(e){return new yn({...Ae(this._def),schema:this,typeName:we.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new Di({...Ae(this._def),innerType:this,defaultValue:n,typeName:we.ZodDefault})}brand(){return new Yl({typeName:we.ZodBranded,type:this,...Ae(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new Ii({...Ae(this._def),innerType:this,catchValue:n,typeName:we.ZodCatch})}describe(e){const n=this.constructor;return new n({...this._def,description:e})}pipe(e){return Fi.create(this,e)}readonly(){return Li.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const TE=/^c[^\s-]{8,}$/i,NE=/^[0-9a-z]+$/,VE=/^[0-9A-HJKMNP-TV-Z]{26}$/,AE=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,BE=/^[a-z0-9_-]{21}$/i,PE=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,RE=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,DE="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let ql;const IE=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,FE=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,LE=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Dp="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",OE=new RegExp(`^${Dp}$`);function Ip(t){let e="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`),e}function ME(t){return new RegExp(`^${Ip(t)}$`)}function Fp(t){let e=`${Dp}T${Ip(t)}`;const n=[];return n.push(t.local?"Z?":"Z"),t.offset&&n.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${n.join("|")})`,new RegExp(`^${e}$`)}function GE(t,e){return!!((e==="v4"||!e)&&IE.test(t)||(e==="v6"||!e)&&FE.test(t))}class mn extends Re{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==ce.string){const i=this._getOrReturnCtx(e);return se(i,{code:te.invalid_type,expected:ce.string,received:i.parsedType}),xe}const n=new xt;let o;for(const i of this._def.checks)if(i.kind==="min")e.data.length<i.value&&(o=this._getOrReturnCtx(e,o),se(o,{code:te.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="max")e.data.length>i.value&&(o=this._getOrReturnCtx(e,o),se(o,{code:te.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="length"){const l=e.data.length>i.value,c=e.data.length<i.value;(l||c)&&(o=this._getOrReturnCtx(e,o),l?se(o,{code:te.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):c&&se(o,{code:te.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),n.dirty())}else if(i.kind==="email")RE.test(e.data)||(o=this._getOrReturnCtx(e,o),se(o,{validation:"email",code:te.invalid_string,message:i.message}),n.dirty());else if(i.kind==="emoji")ql||(ql=new RegExp(DE,"u")),ql.test(e.data)||(o=this._getOrReturnCtx(e,o),se(o,{validation:"emoji",code:te.invalid_string,message:i.message}),n.dirty());else if(i.kind==="uuid")AE.test(e.data)||(o=this._getOrReturnCtx(e,o),se(o,{validation:"uuid",code:te.invalid_string,message:i.message}),n.dirty());else if(i.kind==="nanoid")BE.test(e.data)||(o=this._getOrReturnCtx(e,o),se(o,{validation:"nanoid",code:te.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid")TE.test(e.data)||(o=this._getOrReturnCtx(e,o),se(o,{validation:"cuid",code:te.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid2")NE.test(e.data)||(o=this._getOrReturnCtx(e,o),se(o,{validation:"cuid2",code:te.invalid_string,message:i.message}),n.dirty());else if(i.kind==="ulid")VE.test(e.data)||(o=this._getOrReturnCtx(e,o),se(o,{validation:"ulid",code:te.invalid_string,message:i.message}),n.dirty());else if(i.kind==="url")try{new URL(e.data)}catch{o=this._getOrReturnCtx(e,o),se(o,{validation:"url",code:te.invalid_string,message:i.message}),n.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(e.data)||(o=this._getOrReturnCtx(e,o),se(o,{validation:"regex",code:te.invalid_string,message:i.message}),n.dirty())):i.kind==="trim"?e.data=e.data.trim():i.kind==="includes"?e.data.includes(i.value,i.position)||(o=this._getOrReturnCtx(e,o),se(o,{code:te.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),n.dirty()):i.kind==="toLowerCase"?e.data=e.data.toLowerCase():i.kind==="toUpperCase"?e.data=e.data.toUpperCase():i.kind==="startsWith"?e.data.startsWith(i.value)||(o=this._getOrReturnCtx(e,o),se(o,{code:te.invalid_string,validation:{startsWith:i.value},message:i.message}),n.dirty()):i.kind==="endsWith"?e.data.endsWith(i.value)||(o=this._getOrReturnCtx(e,o),se(o,{code:te.invalid_string,validation:{endsWith:i.value},message:i.message}),n.dirty()):i.kind==="datetime"?Fp(i).test(e.data)||(o=this._getOrReturnCtx(e,o),se(o,{code:te.invalid_string,validation:"datetime",message:i.message}),n.dirty()):i.kind==="date"?OE.test(e.data)||(o=this._getOrReturnCtx(e,o),se(o,{code:te.invalid_string,validation:"date",message:i.message}),n.dirty()):i.kind==="time"?ME(i).test(e.data)||(o=this._getOrReturnCtx(e,o),se(o,{code:te.invalid_string,validation:"time",message:i.message}),n.dirty()):i.kind==="duration"?PE.test(e.data)||(o=this._getOrReturnCtx(e,o),se(o,{validation:"duration",code:te.invalid_string,message:i.message}),n.dirty()):i.kind==="ip"?GE(e.data,i.version)||(o=this._getOrReturnCtx(e,o),se(o,{validation:"ip",code:te.invalid_string,message:i.message}),n.dirty()):i.kind==="base64"?LE.test(e.data)||(o=this._getOrReturnCtx(e,o),se(o,{validation:"base64",code:te.invalid_string,message:i.message}),n.dirty()):$e.assertNever(i);return{status:n.value,value:e.data}}_regex(e,n,o){return this.refinement(i=>e.test(i),{validation:n,code:te.invalid_string,...me.errToObj(o)})}_addCheck(e){return new mn({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...me.errToObj(e)})}url(e){return this._addCheck({kind:"url",...me.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...me.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...me.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...me.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...me.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...me.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...me.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...me.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...me.errToObj(e)})}datetime(e){var n,o;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(n=e==null?void 0:e.offset)!==null&&n!==void 0?n:!1,local:(o=e==null?void 0:e.local)!==null&&o!==void 0?o:!1,...me.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...me.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...me.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...me.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n==null?void 0:n.position,...me.errToObj(n==null?void 0:n.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...me.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...me.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...me.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...me.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...me.errToObj(n)})}nonempty(e){return this.min(1,me.errToObj(e))}trim(){return new mn({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new mn({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new mn({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get minLength(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}mn.create=t=>{var e;return new mn({checks:[],typeName:we.ZodString,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...Ae(t)})};function $E(t,e){const n=(t.toString().split(".")[1]||"").length,o=(e.toString().split(".")[1]||"").length,i=n>o?n:o,l=parseInt(t.toFixed(i).replace(".","")),c=parseInt(e.toFixed(i).replace(".",""));return l%c/Math.pow(10,i)}class wr extends Re{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==ce.number){const i=this._getOrReturnCtx(e);return se(i,{code:te.invalid_type,expected:ce.number,received:i.parsedType}),xe}let n;const o=new xt;for(const i of this._def.checks)i.kind==="int"?$e.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),se(n,{code:te.invalid_type,expected:"integer",received:"float",message:i.message}),o.dirty()):i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(n=this._getOrReturnCtx(e,n),se(n,{code:te.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),o.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(n=this._getOrReturnCtx(e,n),se(n,{code:te.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),o.dirty()):i.kind==="multipleOf"?$E(e.data,i.value)!==0&&(n=this._getOrReturnCtx(e,n),se(n,{code:te.not_multiple_of,multipleOf:i.value,message:i.message}),o.dirty()):i.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),se(n,{code:te.not_finite,message:i.message}),o.dirty()):$e.assertNever(i);return{status:o.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,me.toString(n))}gt(e,n){return this.setLimit("min",e,!1,me.toString(n))}lte(e,n){return this.setLimit("max",e,!0,me.toString(n))}lt(e,n){return this.setLimit("max",e,!1,me.toString(n))}setLimit(e,n,o,i){return new wr({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:o,message:me.toString(i)}]})}_addCheck(e){return new wr({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:me.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:me.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:me.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:me.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:me.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:me.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:me.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:me.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:me.toString(e)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&$e.isInteger(e.value))}get isFinite(){let e=null,n=null;for(const o of this._def.checks){if(o.kind==="finite"||o.kind==="int"||o.kind==="multipleOf")return!0;o.kind==="min"?(n===null||o.value>n)&&(n=o.value):o.kind==="max"&&(e===null||o.value<e)&&(e=o.value)}return Number.isFinite(n)&&Number.isFinite(e)}}wr.create=t=>new wr({checks:[],typeName:we.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...Ae(t)});class br extends Re{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==ce.bigint){const i=this._getOrReturnCtx(e);return se(i,{code:te.invalid_type,expected:ce.bigint,received:i.parsedType}),xe}let n;const o=new xt;for(const i of this._def.checks)i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(n=this._getOrReturnCtx(e,n),se(n,{code:te.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),o.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(n=this._getOrReturnCtx(e,n),se(n,{code:te.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),o.dirty()):i.kind==="multipleOf"?e.data%i.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),se(n,{code:te.not_multiple_of,multipleOf:i.value,message:i.message}),o.dirty()):$e.assertNever(i);return{status:o.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,me.toString(n))}gt(e,n){return this.setLimit("min",e,!1,me.toString(n))}lte(e,n){return this.setLimit("max",e,!0,me.toString(n))}lt(e,n){return this.setLimit("max",e,!1,me.toString(n))}setLimit(e,n,o,i){return new br({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:o,message:me.toString(i)}]})}_addCheck(e){return new br({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:me.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:me.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:me.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:me.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:me.toString(n)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}br.create=t=>{var e;return new br({checks:[],typeName:we.ZodBigInt,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...Ae(t)})};class Ei extends Re{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==ce.boolean){const n=this._getOrReturnCtx(e);return se(n,{code:te.invalid_type,expected:ce.boolean,received:n.parsedType}),xe}return Bt(e.data)}}Ei.create=t=>new Ei({typeName:we.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...Ae(t)});class Hr extends Re{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==ce.date){const i=this._getOrReturnCtx(e);return se(i,{code:te.invalid_type,expected:ce.date,received:i.parsedType}),xe}if(isNaN(e.data.getTime())){const i=this._getOrReturnCtx(e);return se(i,{code:te.invalid_date}),xe}const n=new xt;let o;for(const i of this._def.checks)i.kind==="min"?e.data.getTime()<i.value&&(o=this._getOrReturnCtx(e,o),se(o,{code:te.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),n.dirty()):i.kind==="max"?e.data.getTime()>i.value&&(o=this._getOrReturnCtx(e,o),se(o,{code:te.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),n.dirty()):$e.assertNever(i);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Hr({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:me.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:me.toString(n)})}get minDate(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}}Hr.create=t=>new Hr({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:we.ZodDate,...Ae(t)});class Ls extends Re{_parse(e){if(this._getType(e)!==ce.symbol){const n=this._getOrReturnCtx(e);return se(n,{code:te.invalid_type,expected:ce.symbol,received:n.parsedType}),xe}return Bt(e.data)}}Ls.create=t=>new Ls({typeName:we.ZodSymbol,...Ae(t)});class Si extends Re{_parse(e){if(this._getType(e)!==ce.undefined){const n=this._getOrReturnCtx(e);return se(n,{code:te.invalid_type,expected:ce.undefined,received:n.parsedType}),xe}return Bt(e.data)}}Si.create=t=>new Si({typeName:we.ZodUndefined,...Ae(t)});class Ti extends Re{_parse(e){if(this._getType(e)!==ce.null){const n=this._getOrReturnCtx(e);return se(n,{code:te.invalid_type,expected:ce.null,received:n.parsedType}),xe}return Bt(e.data)}}Ti.create=t=>new Ti({typeName:we.ZodNull,...Ae(t)});class ko extends Re{constructor(){super(...arguments),this._any=!0}_parse(e){return Bt(e.data)}}ko.create=t=>new ko({typeName:we.ZodAny,...Ae(t)});class qr extends Re{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Bt(e.data)}}qr.create=t=>new qr({typeName:we.ZodUnknown,...Ae(t)});class Xn extends Re{_parse(e){const n=this._getOrReturnCtx(e);return se(n,{code:te.invalid_type,expected:ce.never,received:n.parsedType}),xe}}Xn.create=t=>new Xn({typeName:we.ZodNever,...Ae(t)});class Os extends Re{_parse(e){if(this._getType(e)!==ce.undefined){const n=this._getOrReturnCtx(e);return se(n,{code:te.invalid_type,expected:ce.void,received:n.parsedType}),xe}return Bt(e.data)}}Os.create=t=>new Os({typeName:we.ZodVoid,...Ae(t)});class gn extends Re{_parse(e){const{ctx:n,status:o}=this._processInputParams(e),i=this._def;if(n.parsedType!==ce.array)return se(n,{code:te.invalid_type,expected:ce.array,received:n.parsedType}),xe;if(i.exactLength!==null){const c=n.data.length>i.exactLength.value,d=n.data.length<i.exactLength.value;(c||d)&&(se(n,{code:c?te.too_big:te.too_small,minimum:d?i.exactLength.value:void 0,maximum:c?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),o.dirty())}if(i.minLength!==null&&n.data.length<i.minLength.value&&(se(n,{code:te.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),o.dirty()),i.maxLength!==null&&n.data.length>i.maxLength.value&&(se(n,{code:te.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),o.dirty()),n.common.async)return Promise.all([...n.data].map((c,d)=>i.type._parseAsync(new Mn(n,c,n.path,d)))).then(c=>xt.mergeArray(o,c));const l=[...n.data].map((c,d)=>i.type._parseSync(new Mn(n,c,n.path,d)));return xt.mergeArray(o,l)}get element(){return this._def.type}min(e,n){return new gn({...this._def,minLength:{value:e,message:me.toString(n)}})}max(e,n){return new gn({...this._def,maxLength:{value:e,message:me.toString(n)}})}length(e,n){return new gn({...this._def,exactLength:{value:e,message:me.toString(n)}})}nonempty(e){return this.min(1,e)}}gn.create=(t,e)=>new gn({type:t,minLength:null,maxLength:null,exactLength:null,typeName:we.ZodArray,...Ae(e)});function Eo(t){if(t instanceof rt){const e={};for(const n in t.shape){const o=t.shape[n];e[n]=$n.create(Eo(o))}return new rt({...t._def,shape:()=>e})}else return t instanceof gn?new gn({...t._def,type:Eo(t.element)}):t instanceof $n?$n.create(Eo(t.unwrap())):t instanceof Er?Er.create(Eo(t.unwrap())):t instanceof Gn?Gn.create(t.items.map(e=>Eo(e))):t}class rt extends Re{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),n=$e.objectKeys(e);return this._cached={shape:e,keys:n}}_parse(e){if(this._getType(e)!==ce.object){const p=this._getOrReturnCtx(e);return se(p,{code:te.invalid_type,expected:ce.object,received:p.parsedType}),xe}const{status:n,ctx:o}=this._processInputParams(e),{shape:i,keys:l}=this._getCached(),c=[];if(!(this._def.catchall instanceof Xn&&this._def.unknownKeys==="strip"))for(const p in o.data)l.includes(p)||c.push(p);const d=[];for(const p of l){const h=i[p],m=o.data[p];d.push({key:{status:"valid",value:p},value:h._parse(new Mn(o,m,o.path,p)),alwaysSet:p in o.data})}if(this._def.catchall instanceof Xn){const p=this._def.unknownKeys;if(p==="passthrough")for(const h of c)d.push({key:{status:"valid",value:h},value:{status:"valid",value:o.data[h]}});else if(p==="strict")c.length>0&&(se(o,{code:te.unrecognized_keys,keys:c}),n.dirty());else if(p!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const p=this._def.catchall;for(const h of c){const m=o.data[h];d.push({key:{status:"valid",value:h},value:p._parse(new Mn(o,m,o.path,h)),alwaysSet:h in o.data})}}return o.common.async?Promise.resolve().then(async()=>{const p=[];for(const h of d){const m=await h.key,y=await h.value;p.push({key:m,value:y,alwaysSet:h.alwaysSet})}return p}).then(p=>xt.mergeObjectSync(n,p)):xt.mergeObjectSync(n,d)}get shape(){return this._def.shape()}strict(e){return me.errToObj,new rt({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,o)=>{var i,l,c,d;const p=(c=(l=(i=this._def).errorMap)===null||l===void 0?void 0:l.call(i,n,o).message)!==null&&c!==void 0?c:o.defaultError;return n.code==="unrecognized_keys"?{message:(d=me.errToObj(e).message)!==null&&d!==void 0?d:p}:{message:p}}}:{}})}strip(){return new rt({...this._def,unknownKeys:"strip"})}passthrough(){return new rt({...this._def,unknownKeys:"passthrough"})}extend(e){return new rt({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new rt({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:we.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new rt({...this._def,catchall:e})}pick(e){const n={};return $e.objectKeys(e).forEach(o=>{e[o]&&this.shape[o]&&(n[o]=this.shape[o])}),new rt({...this._def,shape:()=>n})}omit(e){const n={};return $e.objectKeys(this.shape).forEach(o=>{e[o]||(n[o]=this.shape[o])}),new rt({...this._def,shape:()=>n})}deepPartial(){return Eo(this)}partial(e){const n={};return $e.objectKeys(this.shape).forEach(o=>{const i=this.shape[o];e&&!e[o]?n[o]=i:n[o]=i.optional()}),new rt({...this._def,shape:()=>n})}required(e){const n={};return $e.objectKeys(this.shape).forEach(o=>{if(e&&!e[o])n[o]=this.shape[o];else{let i=this.shape[o];for(;i instanceof $n;)i=i._def.innerType;n[o]=i}}),new rt({...this._def,shape:()=>n})}keyof(){return Lp($e.objectKeys(this.shape))}}rt.create=(t,e)=>new rt({shape:()=>t,unknownKeys:"strip",catchall:Xn.create(),typeName:we.ZodObject,...Ae(e)}),rt.strictCreate=(t,e)=>new rt({shape:()=>t,unknownKeys:"strict",catchall:Xn.create(),typeName:we.ZodObject,...Ae(e)}),rt.lazycreate=(t,e)=>new rt({shape:t,unknownKeys:"strip",catchall:Xn.create(),typeName:we.ZodObject,...Ae(e)});class Ni extends Re{_parse(e){const{ctx:n}=this._processInputParams(e),o=this._def.options;function i(l){for(const d of l)if(d.result.status==="valid")return d.result;for(const d of l)if(d.result.status==="dirty")return n.common.issues.push(...d.ctx.common.issues),d.result;const c=l.map(d=>new jt(d.ctx.common.issues));return se(n,{code:te.invalid_union,unionErrors:c}),xe}if(n.common.async)return Promise.all(o.map(async l=>{const c={...n,common:{...n.common,issues:[]},parent:null};return{result:await l._parseAsync({data:n.data,path:n.path,parent:c}),ctx:c}})).then(i);{let l;const c=[];for(const p of o){const h={...n,common:{...n.common,issues:[]},parent:null},m=p._parseSync({data:n.data,path:n.path,parent:h});if(m.status==="valid")return m;m.status==="dirty"&&!l&&(l={result:m,ctx:h}),h.common.issues.length&&c.push(h.common.issues)}if(l)return n.common.issues.push(...l.ctx.common.issues),l.result;const d=c.map(p=>new jt(p));return se(n,{code:te.invalid_union,unionErrors:d}),xe}}get options(){return this._def.options}}Ni.create=(t,e)=>new Ni({options:t,typeName:we.ZodUnion,...Ae(e)});const xr=t=>t instanceof Bi?xr(t.schema):t instanceof yn?xr(t.innerType()):t instanceof Pi?[t.value]:t instanceof kr?t.options:t instanceof Ri?$e.objectValues(t.enum):t instanceof Di?xr(t._def.innerType):t instanceof Si?[void 0]:t instanceof Ti?[null]:t instanceof $n?[void 0,...xr(t.unwrap())]:t instanceof Er?[null,...xr(t.unwrap())]:t instanceof Yl||t instanceof Li?xr(t.unwrap()):t instanceof Ii?xr(t._def.innerType):[];class Ms extends Re{_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==ce.object)return se(n,{code:te.invalid_type,expected:ce.object,received:n.parsedType}),xe;const o=this.discriminator,i=n.data[o],l=this.optionsMap.get(i);return l?n.common.async?l._parseAsync({data:n.data,path:n.path,parent:n}):l._parseSync({data:n.data,path:n.path,parent:n}):(se(n,{code:te.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[o]}),xe)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,o){const i=new Map;for(const l of n){const c=xr(l.shape[e]);if(!c.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const d of c){if(i.has(d))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(d)}`);i.set(d,l)}}return new Ms({typeName:we.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:i,...Ae(o)})}}function Kl(t,e){const n=vr(t),o=vr(e);if(t===e)return{valid:!0,data:t};if(n===ce.object&&o===ce.object){const i=$e.objectKeys(e),l=$e.objectKeys(t).filter(d=>i.indexOf(d)!==-1),c={...t,...e};for(const d of l){const p=Kl(t[d],e[d]);if(!p.valid)return{valid:!1};c[d]=p.data}return{valid:!0,data:c}}else if(n===ce.array&&o===ce.array){if(t.length!==e.length)return{valid:!1};const i=[];for(let l=0;l<t.length;l++){const c=t[l],d=e[l],p=Kl(c,d);if(!p.valid)return{valid:!1};i.push(p.data)}return{valid:!0,data:i}}else return n===ce.date&&o===ce.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class Vi extends Re{_parse(e){const{status:n,ctx:o}=this._processInputParams(e),i=(l,c)=>{if(jl(l)||jl(c))return xe;const d=Kl(l.value,c.value);return d.valid?((Hl(l)||Hl(c))&&n.dirty(),{status:n.value,value:d.data}):(se(o,{code:te.invalid_intersection_types}),xe)};return o.common.async?Promise.all([this._def.left._parseAsync({data:o.data,path:o.path,parent:o}),this._def.right._parseAsync({data:o.data,path:o.path,parent:o})]).then(([l,c])=>i(l,c)):i(this._def.left._parseSync({data:o.data,path:o.path,parent:o}),this._def.right._parseSync({data:o.data,path:o.path,parent:o}))}}Vi.create=(t,e,n)=>new Vi({left:t,right:e,typeName:we.ZodIntersection,...Ae(n)});class Gn extends Re{_parse(e){const{status:n,ctx:o}=this._processInputParams(e);if(o.parsedType!==ce.array)return se(o,{code:te.invalid_type,expected:ce.array,received:o.parsedType}),xe;if(o.data.length<this._def.items.length)return se(o,{code:te.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),xe;!this._def.rest&&o.data.length>this._def.items.length&&(se(o,{code:te.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const i=[...o.data].map((l,c)=>{const d=this._def.items[c]||this._def.rest;return d?d._parse(new Mn(o,l,o.path,c)):null}).filter(l=>!!l);return o.common.async?Promise.all(i).then(l=>xt.mergeArray(n,l)):xt.mergeArray(n,i)}get items(){return this._def.items}rest(e){return new Gn({...this._def,rest:e})}}Gn.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Gn({items:t,typeName:we.ZodTuple,rest:null,...Ae(e)})};class Ai extends Re{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:o}=this._processInputParams(e);if(o.parsedType!==ce.object)return se(o,{code:te.invalid_type,expected:ce.object,received:o.parsedType}),xe;const i=[],l=this._def.keyType,c=this._def.valueType;for(const d in o.data)i.push({key:l._parse(new Mn(o,d,o.path,d)),value:c._parse(new Mn(o,o.data[d],o.path,d)),alwaysSet:d in o.data});return o.common.async?xt.mergeObjectAsync(n,i):xt.mergeObjectSync(n,i)}get element(){return this._def.valueType}static create(e,n,o){return n instanceof Re?new Ai({keyType:e,valueType:n,typeName:we.ZodRecord,...Ae(o)}):new Ai({keyType:mn.create(),valueType:e,typeName:we.ZodRecord,...Ae(n)})}}class Gs extends Re{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:o}=this._processInputParams(e);if(o.parsedType!==ce.map)return se(o,{code:te.invalid_type,expected:ce.map,received:o.parsedType}),xe;const i=this._def.keyType,l=this._def.valueType,c=[...o.data.entries()].map(([d,p],h)=>({key:i._parse(new Mn(o,d,o.path,[h,"key"])),value:l._parse(new Mn(o,p,o.path,[h,"value"]))}));if(o.common.async){const d=new Map;return Promise.resolve().then(async()=>{for(const p of c){const h=await p.key,m=await p.value;if(h.status==="aborted"||m.status==="aborted")return xe;(h.status==="dirty"||m.status==="dirty")&&n.dirty(),d.set(h.value,m.value)}return{status:n.value,value:d}})}else{const d=new Map;for(const p of c){const h=p.key,m=p.value;if(h.status==="aborted"||m.status==="aborted")return xe;(h.status==="dirty"||m.status==="dirty")&&n.dirty(),d.set(h.value,m.value)}return{status:n.value,value:d}}}}Gs.create=(t,e,n)=>new Gs({valueType:e,keyType:t,typeName:we.ZodMap,...Ae(n)});class Kr extends Re{_parse(e){const{status:n,ctx:o}=this._processInputParams(e);if(o.parsedType!==ce.set)return se(o,{code:te.invalid_type,expected:ce.set,received:o.parsedType}),xe;const i=this._def;i.minSize!==null&&o.data.size<i.minSize.value&&(se(o,{code:te.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),n.dirty()),i.maxSize!==null&&o.data.size>i.maxSize.value&&(se(o,{code:te.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),n.dirty());const l=this._def.valueType;function c(p){const h=new Set;for(const m of p){if(m.status==="aborted")return xe;m.status==="dirty"&&n.dirty(),h.add(m.value)}return{status:n.value,value:h}}const d=[...o.data.values()].map((p,h)=>l._parse(new Mn(o,p,o.path,h)));return o.common.async?Promise.all(d).then(p=>c(p)):c(d)}min(e,n){return new Kr({...this._def,minSize:{value:e,message:me.toString(n)}})}max(e,n){return new Kr({...this._def,maxSize:{value:e,message:me.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}}Kr.create=(t,e)=>new Kr({valueType:t,minSize:null,maxSize:null,typeName:we.ZodSet,...Ae(e)});class So extends Re{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==ce.function)return se(n,{code:te.invalid_type,expected:ce.function,received:n.parsedType}),xe;function o(d,p){return Ds({data:d,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Rs(),xo].filter(h=>!!h),issueData:{code:te.invalid_arguments,argumentsError:p}})}function i(d,p){return Ds({data:d,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Rs(),xo].filter(h=>!!h),issueData:{code:te.invalid_return_type,returnTypeError:p}})}const l={errorMap:n.common.contextualErrorMap},c=n.data;if(this._def.returns instanceof To){const d=this;return Bt(async function(...p){const h=new jt([]),m=await d._def.args.parseAsync(p,l).catch(b=>{throw h.addIssue(o(p,b)),h}),y=await Reflect.apply(c,this,m);return await d._def.returns._def.type.parseAsync(y,l).catch(b=>{throw h.addIssue(i(y,b)),h})})}else{const d=this;return Bt(function(...p){const h=d._def.args.safeParse(p,l);if(!h.success)throw new jt([o(p,h.error)]);const m=Reflect.apply(c,this,h.data),y=d._def.returns.safeParse(m,l);if(!y.success)throw new jt([i(m,y.error)]);return y.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new So({...this._def,args:Gn.create(e).rest(qr.create())})}returns(e){return new So({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,n,o){return new So({args:e||Gn.create([]).rest(qr.create()),returns:n||qr.create(),typeName:we.ZodFunction,...Ae(o)})}}class Bi extends Re{get schema(){return this._def.getter()}_parse(e){const{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}Bi.create=(t,e)=>new Bi({getter:t,typeName:we.ZodLazy,...Ae(e)});class Pi extends Re{_parse(e){if(e.data!==this._def.value){const n=this._getOrReturnCtx(e);return se(n,{received:n.data,code:te.invalid_literal,expected:this._def.value}),xe}return{status:"valid",value:e.data}}get value(){return this._def.value}}Pi.create=(t,e)=>new Pi({value:t,typeName:we.ZodLiteral,...Ae(e)});function Lp(t,e){return new kr({values:t,typeName:we.ZodEnum,...Ae(e)})}class kr extends Re{constructor(){super(...arguments),xi.set(this,void 0)}_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),o=this._def.values;return se(n,{expected:$e.joinValues(o),received:n.parsedType,code:te.invalid_type}),xe}if(Fs(this,xi)||Pp(this,xi,new Set(this._def.values)),!Fs(this,xi).has(e.data)){const n=this._getOrReturnCtx(e),o=this._def.values;return se(n,{received:n.data,code:te.invalid_enum_value,options:o}),xe}return Bt(e.data)}get options(){return this._def.values}get enum(){const e={};for(const n of this._def.values)e[n]=n;return e}get Values(){const e={};for(const n of this._def.values)e[n]=n;return e}get Enum(){const e={};for(const n of this._def.values)e[n]=n;return e}extract(e,n=this._def){return kr.create(e,{...this._def,...n})}exclude(e,n=this._def){return kr.create(this.options.filter(o=>!e.includes(o)),{...this._def,...n})}}xi=new WeakMap,kr.create=Lp;class Ri extends Re{constructor(){super(...arguments),ki.set(this,void 0)}_parse(e){const n=$e.getValidEnumValues(this._def.values),o=this._getOrReturnCtx(e);if(o.parsedType!==ce.string&&o.parsedType!==ce.number){const i=$e.objectValues(n);return se(o,{expected:$e.joinValues(i),received:o.parsedType,code:te.invalid_type}),xe}if(Fs(this,ki)||Pp(this,ki,new Set($e.getValidEnumValues(this._def.values))),!Fs(this,ki).has(e.data)){const i=$e.objectValues(n);return se(o,{received:o.data,code:te.invalid_enum_value,options:i}),xe}return Bt(e.data)}get enum(){return this._def.values}}ki=new WeakMap,Ri.create=(t,e)=>new Ri({values:t,typeName:we.ZodNativeEnum,...Ae(e)});class To extends Re{unwrap(){return this._def.type}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==ce.promise&&n.common.async===!1)return se(n,{code:te.invalid_type,expected:ce.promise,received:n.parsedType}),xe;const o=n.parsedType===ce.promise?n.data:Promise.resolve(n.data);return Bt(o.then(i=>this._def.type.parseAsync(i,{path:n.path,errorMap:n.common.contextualErrorMap})))}}To.create=(t,e)=>new To({type:t,typeName:we.ZodPromise,...Ae(e)});class yn extends Re{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===we.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:n,ctx:o}=this._processInputParams(e),i=this._def.effect||null,l={addIssue:c=>{se(o,c),c.fatal?n.abort():n.dirty()},get path(){return o.path}};if(l.addIssue=l.addIssue.bind(l),i.type==="preprocess"){const c=i.transform(o.data,l);if(o.common.async)return Promise.resolve(c).then(async d=>{if(n.value==="aborted")return xe;const p=await this._def.schema._parseAsync({data:d,path:o.path,parent:o});return p.status==="aborted"?xe:p.status==="dirty"||n.value==="dirty"?Is(p.value):p});{if(n.value==="aborted")return xe;const d=this._def.schema._parseSync({data:c,path:o.path,parent:o});return d.status==="aborted"?xe:d.status==="dirty"||n.value==="dirty"?Is(d.value):d}}if(i.type==="refinement"){const c=d=>{const p=i.refinement(d,l);if(o.common.async)return Promise.resolve(p);if(p instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return d};if(o.common.async===!1){const d=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});return d.status==="aborted"?xe:(d.status==="dirty"&&n.dirty(),c(d.value),{status:n.value,value:d.value})}else return this._def.schema._parseAsync({data:o.data,path:o.path,parent:o}).then(d=>d.status==="aborted"?xe:(d.status==="dirty"&&n.dirty(),c(d.value).then(()=>({status:n.value,value:d.value}))))}if(i.type==="transform")if(o.common.async===!1){const c=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});if(!wi(c))return c;const d=i.transform(c.value,l);if(d instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:d}}else return this._def.schema._parseAsync({data:o.data,path:o.path,parent:o}).then(c=>wi(c)?Promise.resolve(i.transform(c.value,l)).then(d=>({status:n.value,value:d})):c);$e.assertNever(i)}}yn.create=(t,e,n)=>new yn({schema:t,typeName:we.ZodEffects,effect:e,...Ae(n)}),yn.createWithPreprocess=(t,e,n)=>new yn({schema:e,effect:{type:"preprocess",transform:t},typeName:we.ZodEffects,...Ae(n)});class $n extends Re{_parse(e){return this._getType(e)===ce.undefined?Bt(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}$n.create=(t,e)=>new $n({innerType:t,typeName:we.ZodOptional,...Ae(e)});class Er extends Re{_parse(e){return this._getType(e)===ce.null?Bt(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Er.create=(t,e)=>new Er({innerType:t,typeName:we.ZodNullable,...Ae(e)});class Di extends Re{_parse(e){const{ctx:n}=this._processInputParams(e);let o=n.data;return n.parsedType===ce.undefined&&(o=this._def.defaultValue()),this._def.innerType._parse({data:o,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}Di.create=(t,e)=>new Di({innerType:t,typeName:we.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Ae(e)});class Ii extends Re{_parse(e){const{ctx:n}=this._processInputParams(e),o={...n,common:{...n.common,issues:[]}},i=this._def.innerType._parse({data:o.data,path:o.path,parent:{...o}});return bi(i)?i.then(l=>({status:"valid",value:l.status==="valid"?l.value:this._def.catchValue({get error(){return new jt(o.common.issues)},input:o.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new jt(o.common.issues)},input:o.data})}}removeCatch(){return this._def.innerType}}Ii.create=(t,e)=>new Ii({innerType:t,typeName:we.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Ae(e)});class $s extends Re{_parse(e){if(this._getType(e)!==ce.nan){const n=this._getOrReturnCtx(e);return se(n,{code:te.invalid_type,expected:ce.nan,received:n.parsedType}),xe}return{status:"valid",value:e.data}}}$s.create=t=>new $s({typeName:we.ZodNaN,...Ae(t)});const zE=Symbol("zod_brand");class Yl extends Re{_parse(e){const{ctx:n}=this._processInputParams(e),o=n.data;return this._def.type._parse({data:o,path:n.path,parent:n})}unwrap(){return this._def.type}}class Fi extends Re{_parse(e){const{status:n,ctx:o}=this._processInputParams(e);if(o.common.async)return(async()=>{const i=await this._def.in._parseAsync({data:o.data,path:o.path,parent:o});return i.status==="aborted"?xe:i.status==="dirty"?(n.dirty(),Is(i.value)):this._def.out._parseAsync({data:i.value,path:o.path,parent:o})})();{const i=this._def.in._parseSync({data:o.data,path:o.path,parent:o});return i.status==="aborted"?xe:i.status==="dirty"?(n.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:o.path,parent:o})}}static create(e,n){return new Fi({in:e,out:n,typeName:we.ZodPipeline})}}class Li extends Re{_parse(e){const n=this._def.innerType._parse(e),o=i=>(wi(i)&&(i.value=Object.freeze(i.value)),i);return bi(n)?n.then(i=>o(i)):o(n)}unwrap(){return this._def.innerType}}Li.create=(t,e)=>new Li({innerType:t,typeName:we.ZodReadonly,...Ae(e)});function Op(t,e={},n){return t?ko.create().superRefine((o,i)=>{var l,c;if(!t(o)){const d=typeof e=="function"?e(o):typeof e=="string"?{message:e}:e,p=(c=(l=d.fatal)!==null&&l!==void 0?l:n)!==null&&c!==void 0?c:!0,h=typeof d=="string"?{message:d}:d;i.addIssue({code:"custom",...h,fatal:p})}}):ko.create()}const UE={object:rt.lazycreate};var we;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(we||(we={}));const ZE=(t,e={message:`Input not instance of ${t.name}`})=>Op(n=>n instanceof t,e),Mp=mn.create,Gp=wr.create,WE=$s.create,jE=br.create,$p=Ei.create,HE=Hr.create,qE=Ls.create,KE=Si.create,YE=Ti.create,XE=ko.create,JE=qr.create,QE=Xn.create,eS=Os.create,tS=gn.create,nS=rt.create,rS=rt.strictCreate,oS=Ni.create,iS=Ms.create,sS=Vi.create,aS=Gn.create,lS=Ai.create,cS=Gs.create,dS=Kr.create,uS=So.create,pS=Bi.create,hS=Pi.create,fS=kr.create,mS=Ri.create,gS=To.create,zp=yn.create,yS=$n.create,_S=Er.create,CS=yn.createWithPreprocess,vS=Fi.create;var zn=Object.freeze({__proto__:null,defaultErrorMap:xo,setErrorMap:EE,getErrorMap:Rs,makeIssue:Ds,EMPTY_PATH:SE,addIssueToContext:se,ParseStatus:xt,INVALID:xe,DIRTY:Is,OK:Bt,isAborted:jl,isDirty:Hl,isValid:wi,isAsync:bi,get util(){return $e},get objectUtil(){return Wl},ZodParsedType:ce,getParsedType:vr,ZodType:Re,datetimeRegex:Fp,ZodString:mn,ZodNumber:wr,ZodBigInt:br,ZodBoolean:Ei,ZodDate:Hr,ZodSymbol:Ls,ZodUndefined:Si,ZodNull:Ti,ZodAny:ko,ZodUnknown:qr,ZodNever:Xn,ZodVoid:Os,ZodArray:gn,ZodObject:rt,ZodUnion:Ni,ZodDiscriminatedUnion:Ms,ZodIntersection:Vi,ZodTuple:Gn,ZodRecord:Ai,ZodMap:Gs,ZodSet:Kr,ZodFunction:So,ZodLazy:Bi,ZodLiteral:Pi,ZodEnum:kr,ZodNativeEnum:Ri,ZodPromise:To,ZodEffects:yn,ZodTransformer:yn,ZodOptional:$n,ZodNullable:Er,ZodDefault:Di,ZodCatch:Ii,ZodNaN:$s,BRAND:zE,ZodBranded:Yl,ZodPipeline:Fi,ZodReadonly:Li,custom:Op,Schema:Re,ZodSchema:Re,late:UE,get ZodFirstPartyTypeKind(){return we},coerce:{string:t=>mn.create({...t,coerce:!0}),number:t=>wr.create({...t,coerce:!0}),boolean:t=>Ei.create({...t,coerce:!0}),bigint:t=>br.create({...t,coerce:!0}),date:t=>Hr.create({...t,coerce:!0})},any:XE,array:tS,bigint:jE,boolean:$p,date:HE,discriminatedUnion:iS,effect:zp,enum:fS,function:uS,instanceof:ZE,intersection:sS,lazy:pS,literal:hS,map:cS,nan:WE,nativeEnum:mS,never:QE,null:YE,nullable:_S,number:Gp,object:nS,oboolean:()=>$p().optional(),onumber:()=>Gp().optional(),optional:yS,ostring:()=>Mp().optional(),pipeline:vS,preprocess:CS,promise:gS,record:lS,set:dS,strictObject:rS,string:Mp,symbol:qE,transformer:zp,tuple:aS,undefined:KE,union:oS,unknown:JE,void:eS,NEVER:xe,ZodIssueCode:te,quotelessJson:kE,ZodError:jt});function wS(t){throw new Error("Unexpected object: "+t)}const Up="upload://upload/",Zp="index://index/";function bS(t){return t.startsWith(Up)}function xS(t){return t.startsWith(Zp)}function Wp(t){if(xS(t)){const e=t.slice(Zp.length);return JSON.parse(decodeURIComponent(e)).path}else if(bS(t)){const e=t.slice(Up.length);return JSON.parse(decodeURIComponent(e)).localPath}wS(t)}function kS(t){return t.replace(/^.*[\\/]/,"")}function ES(t){return kS(Wp(t))}zn.object({__isRef:zn.literal(!0).describe("Crucial marker for the block dependency tree reconstruction"),blockId:zn.string().describe("Upstream block id"),name:zn.string().describe("Name of the output provided to the upstream block's output context")}).describe("Universal reference type, allowing to set block connections. It is crucial that {@link __isRef} is present and equal to true, internal logic relies on this marker to build block dependency trees.").strict().readonly();const SS=zn.object({type:zn.string(),importance:zn.number().optional(),id:zn.string().optional(),label:zn.string()});zn.array(SS);const TS={key:0,ref:"label"},NS={key:0,class:"required-icon"},VS=["data-placeholder"],AS={key:5,class:"pl-file-input__stats"},BS={key:0,class:"pl-file-input__error"},PS={key:1,class:"pl-file-input__helper"},jp=r.defineComponent({__name:"PlFileInput",props:{modelValue:{},label:{default:void 0},required:{type:Boolean},dashed:{type:Boolean},extensions:{default:void 0},placeholder:{default:void 0},progress:{default:void 0},error:{default:void 0},helper:{default:void 0},cellStyle:{type:Boolean,default:!1},fileDialogTitle:{default:void 0},fileDialogCloseOnOutsideClick:{type:Boolean,default:!0}},emits:["update:modelValue"],setup(t,{emit:e}){const n=r.reactive({fileDialogOpen:!1,error:""}),o=r.useSlots(),i=e,l=t,c=(F,W)=>{if(F)try{return W(F)}catch(P){return n.error=P instanceof Error?P.message:String(P),F}},d=r.computed(()=>c(l.modelValue,ES)),p=r.computed(()=>c(l.modelValue,Wp)),h=r.computed(()=>l.progress&&!l.progress.done),m=r.computed(()=>l.progress&&l.progress.done),y=r.computed(()=>n.error??l.error),b=r.computed(()=>!!y.value),w=r.computed(()=>{const{status:F,done:W}=l.progress??{};return!F||!F.bytesTotal?"":F.bytesProcessed&&!W?kl(F.bytesProcessed,{})+" / "+kl(F.bytesTotal,{}):kl(F.bytesTotal,{})}),S=r.computed(()=>{var F;const{progress:W}=l;return W?{width:W.done?"100%":Math.round((((F=W.status)==null?void 0:F.progress)??0)*100)+"%"}:{}}),M=()=>{n.fileDialogOpen=!0},O=F=>{F.files.length&&i("update:modelValue",F.files[0])},v=()=>i("update:modelValue",void 0);r.watch(()=>l.modelValue,()=>{n.error=""},{immediate:!0});const I=r.ref();return l.cellStyle||Yn(I),(F,W)=>(r.openBlock(),r.createElementBlock(r.Fragment,null,[r.createElementVNode("div",{class:r.normalizeClass([{"pl-file-input__cell-style":!!F.cellStyle,"has-file":!!d.value},"pl-file-input__envelope"])},[r.createElementVNode("div",{ref_key:"rootRef",ref:I,class:r.normalizeClass(["pl-file-input",{dashed:F.dashed,error:b.value}]),tabindex:"0",onKeyup:r.withKeys(M,["enter"]),onClick:r.withModifiers(M,["stop"])},[r.createElementVNode("div",{class:"pl-file-input__progress",style:r.normalizeStyle(S.value)},null,4),W[3]||(W[3]=r.createTextVNode()),!F.cellStyle&&F.label?(r.openBlock(),r.createElementBlock("label",TS,[F.required?(r.openBlock(),r.createElementBlock("i",NS)):r.createCommentVNode("",!0),W[1]||(W[1]=r.createTextVNode()),r.createElementVNode("span",null,r.toDisplayString(F.label),1),W[2]||(W[2]=r.createTextVNode()),r.unref(o).tooltip||p.value?(r.openBlock(),r.createBlock(r.unref(Ct),{key:1,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.unref(o).tooltip?r.renderSlot(F.$slots,"tooltip",{key:0}):(r.openBlock(),r.createElementBlock(r.Fragment,{key:1},[r.createTextVNode(r.toDisplayString(p.value),1)],64))]),_:3})):r.createCommentVNode("",!0)],512)):r.createCommentVNode("",!0),W[4]||(W[4]=r.createTextVNode()),b.value?(r.openBlock(),r.createBlock(r.unref(At),{key:1,name:"restart"})):h.value?(r.openBlock(),r.createBlock(r.unref(At),{key:2,name:"cloud-upload"})):m.value?(r.openBlock(),r.createBlock(r.unref(At),{key:3,name:"success"})):(r.openBlock(),r.createBlock(r.unref(At),{key:4,name:"paper-clip"})),W[5]||(W[5]=r.createTextVNode()),r.createElementVNode("div",{"data-placeholder":F.placeholder??"Choose file",class:"pl-file-input__filename"},r.toDisplayString(d.value),9,VS),W[6]||(W[6]=r.createTextVNode()),w.value?(r.openBlock(),r.createElementBlock("div",AS,r.toDisplayString(w.value),1)):r.createCommentVNode("",!0),W[7]||(W[7]=r.createTextVNode()),F.modelValue?(r.openBlock(),r.createBlock(r.unref(At),{key:6,name:"close",onClick:r.withModifiers(v,["stop"])})):r.createCommentVNode("",!0),W[8]||(W[8]=r.createTextVNode()),r.createVNode(Cr,{class:"pl-file-input__contour"})],34),W[9]||(W[9]=r.createTextVNode()),b.value?(r.openBlock(),r.createElementBlock("div",BS,r.toDisplayString(y.value),1)):F.helper?(r.openBlock(),r.createElementBlock("div",PS,r.toDisplayString(F.helper),1)):r.createCommentVNode("",!0)],2),W[10]||(W[10]=r.createTextVNode()),r.createVNode(r.unref(Ap),{modelValue:n.fileDialogOpen,"onUpdate:modelValue":W[0]||(W[0]=P=>n.fileDialogOpen=P),extensions:F.extensions,title:F.fileDialogTitle,"close-on-outside-click":F.fileDialogCloseOnOutsideClick,"onImport:files":O},null,8,["modelValue","extensions","title","close-on-outside-click"])],64))}}),RS={class:"pl-notification-alert__wrapper d-flex"},DS={class:"pl-notification-alert__content flex-grow-1"},IS={key:0,class:"pl-notification-alert__close"},FS={key:0,class:"pl-notification-alert__actions d-flex"},Hp=r.defineComponent({__name:"PlNotificationAlert",props:r.mergeModels({type:{default:"neutral"},width:{default:"256px"},closable:{type:Boolean}},{modelValue:{type:Boolean,default:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=t,n=r.useModel(t,"modelValue");function o(){e.closable&&(n.value=!1)}return(i,l)=>n.value?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass([i.type,"pl-notification-alert d-flex flex-column gap-16"]),style:r.normalizeStyle({width:`${i.width}`})},[r.createElementVNode("div",RS,[r.createElementVNode("div",DS,[r.renderSlot(i.$slots,"default")]),l[0]||(l[0]=r.createTextVNode()),i.closable?(r.openBlock(),r.createElementBlock("div",IS,[r.createVNode(r.unref(vo),{icon:"close",onClick:o})])):r.createCommentVNode("",!0)]),l[1]||(l[1]=r.createTextVNode()),i.$slots.actions?(r.openBlock(),r.createElementBlock("div",FS,[r.renderSlot(i.$slots,"actions")])):r.createCommentVNode("",!0)],6)):r.createCommentVNode("",!0)}}),LS=r.defineComponent({__name:"ContextProvider",props:{context:{},contextKey:{}},setup(t){const e=t;return r.provide(e.contextKey,r.computed(()=>e.context)),(n,o)=>r.renderSlot(n.$slots,"default")}});function kt(t,e,n){return e>t?e:t>n?n:t}const Xl=t=>r.computed(()=>{const e=[100],{min:n,max:o,step:i}=t.value;let l=n;for(;l<o;){l+=i;const c=(1-(kt(l,n,o)-n)/(o-n))*100;e.push(c)}return e}),OS={class:"ui-slider__wrapper"},MS={class:"ui-slider__label-section"},GS={key:0,class:"text-s"},$S={key:1,class:"ui-slider__value-static text-s"},zS={class:"ui-slider__base"},US={class:"ui-slider__container"},ZS={class:"ui-slider__container ui-slider__container-thumb"},WS={class:"ui-slider__input-wrapper d-flex"},jS=["value"],HS={key:0,class:"ui-slider__error"},qp=r.defineComponent({__name:"Slider",props:{modelValue:{},min:{default:0},max:{},step:{default:1},label:{default:void 0},helper:{default:void 0},error:{default:void 0},mode:{default:"text"},measure:{default:""},breakpoints:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{emit:e}){const n=r.useSlots(),o=e,i=t,l=r.reactive({deltaValue:0}),c=r.computed(()=>i.max-i.min),d=r.computed(()=>kt((i.modelValue??0)+l.deltaValue,i.min,i.max)),p=r.ref(i.modelValue),h=r.computed(()=>{const P=i.modelValue;return Number.isFinite(P)?P<i.min?`Min value: ${i.min}`:P>i.max?`Max value: ${i.max}`:i.error:"Not a number"}),m=r.computed(()=>i),y=Xl(m),b=r.computed(()=>(d.value-i.min)/c.value),w=r.computed(()=>({right:Math.ceil((1-b.value)*100)+"%"})),S=r.computed(()=>({right:`calc(${Math.ceil((1-b.value)*100)}%) `})),M=r.ref(),O=r.ref();r.watch(()=>i.modelValue,P=>{p.value=P});function v(P){const V=kt(P,i.min,i.max);return Math.round((V+Number.EPSILON)*(1/i.step))/(1/i.step)}yr(O,P=>{var V;_t((V=r.unref(M))==null?void 0:V.getBoundingClientRect(),Z=>{const{dx:J}=P;l.deltaValue=J/Z.width*c.value,p.value=v(kt((i.modelValue??0)+l.deltaValue,i.min,i.max)),P.stop&&(o("update:modelValue",v(d.value)),l.deltaValue=0)})});function I(P){o("update:modelValue",v(P))}function F(P){I(+P.target.value)}function W(P){["ArrowDown","ArrowUp","ArrowRight","ArrowLeft","Enter"].includes(P.code)&&P.preventDefault();const V=P.code==="ArrowUp"||P.code==="ArrowRight"?i.step*1:P.code==="ArrowDown"||P.code==="ArrowLeft"?i.step*-1:0;I(i.modelValue+V)}return(P,V)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass([i.disabled?"ui-slider__disabled":void 0,"ui-slider__envelope"])},[r.createElementVNode("div",{class:r.normalizeClass([`ui-slider__mode-${i.mode}`,"ui-slider"])},[r.createElementVNode("div",OS,[r.createElementVNode("div",MS,[P.label?(r.openBlock(),r.createElementBlock("label",GS,[r.createElementVNode("span",null,r.toDisplayString(P.label),1),V[1]||(V[1]=r.createTextVNode()),r.unref(n).tooltip?(r.openBlock(),r.createBlock(r.unref(Ct),{key:0,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.renderSlot(P.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0),V[2]||(V[2]=r.createTextVNode()),i.mode==="text"?(r.openBlock(),r.createElementBlock("div",$S,r.toDisplayString(p.value)+r.toDisplayString(P.measure),1)):r.createCommentVNode("",!0)]),V[6]||(V[6]=r.createTextVNode()),r.createElementVNode("div",zS,[r.createElementVNode("div",US,[r.createElementVNode("div",{ref_key:"barRef",ref:M,class:"ui-slider__bar"},[r.createElementVNode("div",{class:"ui-slider__progress",style:r.normalizeStyle(w.value)},null,4)],512)]),V[5]||(V[5]=r.createTextVNode()),r.createElementVNode("div",ZS,[i.breakpoints?(r.openBlock(!0),r.createElementBlock(r.Fragment,{key:0},r.renderList(r.unref(y),(Z,J)=>(r.openBlock(),r.createElementBlock("div",{key:J,style:r.normalizeStyle({right:`${Z}%`}),class:"ui-slider__thumb-step"},null,4))),128)):r.createCommentVNode("",!0),V[4]||(V[4]=r.createTextVNode()),r.createElementVNode("div",{ref_key:"thumbRef",ref:O,tabindex:"0",class:"ui-slider__thumb ui-slider__thumb-active",style:r.normalizeStyle(S.value),onKeydown:W},V[3]||(V[3]=[r.createElementVNode("div",{class:"ui-slider__thumb-focused-contour"},null,-1)]),36)])])]),V[7]||(V[7]=r.createTextVNode()),r.createElementVNode("div",WS,[i.mode==="input"?(r.openBlock(),r.createElementBlock("input",{key:0,value:p.value,class:"ui-slider__value text-s",onChange:V[0]||(V[0]=Z=>F(Z))},null,40,jS)):r.createCommentVNode("",!0)])],2),V[8]||(V[8]=r.createTextVNode()),h.value?(r.openBlock(),r.createElementBlock("div",HS,r.toDisplayString(h.value),1)):r.createCommentVNode("",!0)],2))}});function qS(t,e=null,n=null){function o(d){const{scrollTop:p,scrollHeight:h,clientHeight:m}=d;if(!(h>m)||!e)return null;const y=h-p-m,b=p>e?e:0,w=y>e?m-e-b:m;return`linear-gradient(
54
54
  to bottom,
55
55
  transparent,
56
56
  black ${b}px,
@@ -62,30 +62,30 @@
62
62
  black ${b}px,
63
63
  black ${w}px,
64
64
  transparent 100%
65
- )`}function l(){const d=t.value;if(!d)return;const p=[o(d),i(d)].filter(h=>h!==null);d.style.setProperty("-webkit-mask-image",p.join(",")),d.style.setProperty("mask-image",p.join(",")),p.length>1&&(d.style.setProperty("-webkit-mask-composite","source-in"),d.style.setProperty("mask-composite","source-in"))}const c=Nl(l);r.onMounted(l),st(window,"scroll",c,!0),st(window,"resize",c,!0)}function qp(t,e){pp(()=>{_t(r.unref(t),n=>{hp(n,()=>e(n))})}),r.onUnmounted(()=>{_t(r.unref(t),n=>{fp(n)})})}const Sr={item:"sortable__item",animate:"sortable__animate"},Li=t=>t.getBoundingClientRect().y,Kp=t=>{const{y:e,height:n}=t.getBoundingClientRect();return e+Math.ceil(n/2)},jS=t=>{const{y:e,height:n}=t.getBoundingClientRect();return e+n};function Yp(t,e){const n={item:void 0,options(){var w;return[...((w=t.value)==null?void 0:w.children)??[]]}},o=r.computed(()=>n.options()),i=e.shakeBuffer??10,l=e.reorderDelay??100;function c(w){const S=e.handle?this.querySelector(e.handle):null;S&&(S&&!S.contains(w.target)||(this.classList.remove(Sr.animate),this.classList.add(Sr.item),n.item={el:this,y:w.y,dy:0,orderChanged:!1}))}function d(w){const S=n.options();return S.slice(0,S.indexOf(w))}function p(w){const S=n.options();return S.slice(S.indexOf(w)+1)}function h(w,S){const M=n.options().filter(C=>C!==S),O=M.indexOf(w);return M.splice(O,0,S),M}function m(w,S){const M=n.options().filter(C=>C!==S),O=M.indexOf(w);return M.splice(O+1,0,S),M}function y(w,S){w.dy=S-w.y,w.el.style.setProperty("transform",`translateY(${w.dy}px)`)}function b(w){var S;if(!n.item)return;const{el:M}=n.item;if(!M.isConnected){n.item=void 0;return}const O=w.map(V=>Li(V)),C=Li(M);(S=t.value)==null||S.replaceChildren(...w);const I=Li(M),F=w.map(V=>Li(V)),W=[];for(let V=0;V<F.length;V++){const Z=w[V];if(Z===n.item.el)continue;const J=F[V],ae=O[V]-J;Z.style.transform=`translateY(${ae}px)`,W.push(Z)}const P=I-C;n.item.y=n.item.y+P,n.item.dy=n.item.dy-P,n.item.orderChanged=!0,n.item.el.style.setProperty("transform",`translateY(${n.item.dy}px)`),W.forEach(V=>V.classList.remove(Sr.animate)),requestAnimationFrame(function(){W.forEach(V=>{V.classList.add(Sr.animate),V.style.transform="",V.addEventListener("transitionend",()=>{V.classList.remove(Sr.animate)})})})}st(window,"mousemove",w=>{if(!n.item)return;const{el:S}=n.item;y(n.item,w.y);const M=Li(n.item.el),O=jS(n.item.el),C=d(S),I=p(S);C.forEach(F=>{const W=Kp(F);M+i<W&&b(h(F,S))}),I.forEach(F=>{const W=Kp(F);O-i>W&&b(m(F,S))})}),st(window,"mouseup",()=>{if(!n.item)return;const{el:w,orderChanged:S}=n.item;w.classList.add(Sr.animate),w.style.removeProperty("transform"),w.addEventListener("transitionend",()=>{w.classList.remove(Sr.animate,Sr.item)}),setTimeout(()=>{if(!S)return;const M=n.options().map(C=>Number(C.getAttribute("data-index"))),O=t.value;if(O){for(const C of n.options())O.removeChild(C);o.value.forEach(C=>{O.appendChild(C)})}e.onChange(M)},l),n.item=void 0}),r.watchEffect(()=>{o.value.forEach((w,S)=>{w.removeEventListener("mousedown",c),w.addEventListener("mousedown",c),w.setAttribute("data-index",String(S))})})}function HS(t,e){let n;r.onMounted(()=>{n=setInterval(t,e)}),r.onUnmounted(()=>clearInterval(n))}function qS(t,e,n){const o=r.reactive({data:bl.deepClone(e(t.value)),changed:!1});return r.watch(()=>o.data,i=>{o.changed?n(bl.deepClone(i)):o.changed=!0},{deep:!0}),r.watch(t,i=>{Object.assign(o,{data:bl.deepClone(e(i)),changed:!1})},{deep:!0,immediate:!0}),o}function KS(t){const e=r.reactive({isLoading:!1,result:void 0,error:void 0,async run(...n){this.isLoading=!0,this.error=void 0;try{this.result=await t(...n)}catch(o){this.error=o}finally{this.isLoading=!1}},debounce(n,o=1e3){return pC(()=>{const i=n();this.run(...i).catch(console.error)},o)}});return e.run=e.run.bind(e),e}function YS(t,e){function n(c,d){const p=r.unref(t);if(!p)return;const h=`translate(${d.x-c.x}px, ${d.y-c.y}px)`;p.style.setProperty("transform",h),e(d)}function o(c){const d=p=>n(c,p);document.addEventListener("mousemove",d),document.addEventListener("mouseup",()=>{const p=r.unref(t);document.removeEventListener("mousemove",d),p&&(p.style.setProperty("transition","all .3s ease-in-out"),p.style.removeProperty("transform"),p.addEventListener("transitionend",()=>{p.style.removeProperty("transition")}))},{once:!0})}function i(){var c;(c=r.unref(t))==null||c.addEventListener("mousedown",o)}function l(){var c;(c=r.unref(t))==null||c.removeEventListener("mousedown",o)}r.onMounted(i),r.onUnmounted(l)}const XS={class:"ui-slider__wrapper"},JS={class:"ui-slider__label-section"},QS={key:0,class:"text-s"},e1={class:"ui-slider__base"},t1={class:"ui-slider__container"},n1={class:"ui-slider__container ui-slider__container-thumb"},r1=["data-percent"],o1=["data-percent"],i1=["data-percent"],s1={key:0,class:"ui-slider__error"},a1=r.defineComponent({__name:"SliderRangeTriple",props:{modelValue:{},min:{default:0},max:{},step:{default:1},label:{default:void 0},helper:{default:void 0},error:{default:void 0},mode:{default:"text"},measure:{default:"%"},breakpoints:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{emit:e}){const n=r.useSlots(),o=e,i=t,l=r.reactive({deltaValue1:0,deltaValue2:0,deltaValue3:0}),c=r.ref(),d=r.ref(),p=r.ref(),h=r.ref(),m=r.computed(()=>i.max-i.min),y=r.computed(()=>i),b=Yl(y),w=r.computed(()=>kt((i.modelValue[0]??0)+l.deltaValue1,i.min,i.max)),S=r.computed(()=>kt((i.modelValue[1]??0)+l.deltaValue2,i.min,i.max)),M=r.computed(()=>kt((i.modelValue[2]??0)+l.deltaValue3,i.min,i.max)),O=r.computed(()=>{const B=i.modelValue;if(!(Array.isArray(B)&&B.length===3&&B.every(H=>Number.isFinite(H))))return"Expected model [number, number, number]";const G=[];return[...i.modelValue].forEach(H=>{H>i.max&&G.push(`Max model value must be lower than max props ${i.max}.`),H<i.min&&G.push("Min model value must be greater than max props.")}),G.length>0?G.join(" "):i.error}),C=r.computed(()=>(w.value-i.min)/m.value),I=r.computed(()=>(S.value-i.min)/m.value),F=r.computed(()=>(M.value-i.min)/m.value),W=r.computed(()=>$()),P=r.computed(()=>({right:W.value[0]+"%",left:100-W.value[2]+"%"})),V=r.computed(()=>({right:Math.ceil((1-C.value)*100)+"%"})),Z=r.computed(()=>({right:Math.ceil((1-I.value)*100)+"%"})),J=r.computed(()=>({right:Math.ceil((1-F.value)*100)+"%"}));yr(d,B=>{var G;_t((G=r.unref(c))==null?void 0:G.getBoundingClientRect(),H=>{const{dx:K}=B;l.deltaValue1=K/H.width*m.value,d.value&&ae(d.value,i.modelValue[0],l.deltaValue1),B.stop&&(U([j(w.value),j(S.value),j(M.value)]),l.deltaValue1=0)})}),yr(p,B=>{var G;_t((G=r.unref(c))==null?void 0:G.getBoundingClientRect(),H=>{const{dx:K}=B;l.deltaValue2=K/H.width*m.value,p.value&&ae(p.value,i.modelValue[1],l.deltaValue2),B.stop&&(U([j(w.value),j(S.value),j(M.value)]),l.deltaValue2=0)})}),yr(h,B=>{var G;_t((G=r.unref(c))==null?void 0:G.getBoundingClientRect(),H=>{const{dx:K}=B;l.deltaValue3=K/H.width*m.value,h.value&&ae(h.value,i.modelValue[2],l.deltaValue3),B.stop&&(U([j(w.value),j(S.value),j(M.value)]),l.deltaValue3=0)})});function ae(B,G,H){const K=j(kt((G??0)+H,i.min,i.max));B.dataset.percent=`${K}${i.measure}`,k()}function $(){const B=Math.ceil((1-C.value)*100),G=Math.ceil((1-I.value)*100),H=Math.ceil((1-F.value)*100);return[B,G,H].sort((K,ne)=>K-ne)}function j(B){const G=kt(B,i.min,i.max);return Math.round((G+Number.EPSILON)*(1/i.step))/(1/i.step)}function U(B){o("update:modelValue",B)}function k(){const B=Number(V.value.right.substring(0,V.value.right.length-1)),G=Number(Z.value.right.substring(0,Z.value.right.length-1)),H=Number(J.value.right.substring(0,J.value.right.length-1)),K=[{r:B,th:d},{r:G,th:p},{r:H,th:h}].sort((ne,pe)=>ne.r-pe.r);K[0].th.value&&(K[0].th.value.dataset.hint="high"),K[1].th.value&&(K[1].th.value.dataset.hint="mid"),K[2].th.value&&(K[2].th.value.dataset.hint="low")}function x(B,G){["ArrowDown","ArrowUp","ArrowRight","ArrowLeft","Enter"].includes(B.code)&&B.preventDefault();const H=B.code==="ArrowUp"||B.code==="ArrowRight"?i.step*1:B.code==="ArrowDown"||B.code==="ArrowLeft"?i.step*-1:0,K=[...i.modelValue];K[G]=kt(K[G]+H,i.min,i.max),U(K),k()}return r.onMounted(()=>{k()}),(B,G)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass([i.disabled?"ui-slider__disabled":void 0,"ui-slider__envelope ui-slider__triple"])},[r.createElementVNode("div",{class:r.normalizeClass([`ui-slider__mode-${i.mode}`,"ui-slider"])},[r.createElementVNode("div",XS,[r.createElementVNode("div",JS,[B.label?(r.openBlock(),r.createElementBlock("label",QS,[r.createElementVNode("span",null,r.toDisplayString(B.label),1),G[3]||(G[3]=r.createTextVNode()),r.unref(n).tooltip?(r.openBlock(),r.createBlock(r.unref(vt),{key:0,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.renderSlot(B.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0)]),G[11]||(G[11]=r.createTextVNode()),r.createElementVNode("div",e1,[r.createElementVNode("div",t1,[r.createElementVNode("div",{ref_key:"barRef",ref:c,class:"ui-slider__bar"},[r.createElementVNode("div",{class:"ui-slider__progress",style:r.normalizeStyle(P.value)},null,4)],512)]),G[10]||(G[10]=r.createTextVNode()),r.createElementVNode("div",n1,[i.breakpoints?(r.openBlock(!0),r.createElementBlock(r.Fragment,{key:0},r.renderList(r.unref(b),(H,K)=>(r.openBlock(),r.createElementBlock("div",{key:K,style:r.normalizeStyle({right:`${H}%`}),class:"ui-slider__thumb-step"},null,4))),128)):r.createCommentVNode("",!0),G[7]||(G[7]=r.createTextVNode()),r.createElementVNode("div",{ref_key:"thumbRef1",ref:d,style:r.normalizeStyle(V.value),"data-percent":i.modelValue[0]+"%",class:"ui-slider__thumb ui-slider__triple-thumb",r1:"",tabindex:"0",onKeydown:G[0]||(G[0]=H=>x(H,0))},G[4]||(G[4]=[r.createElementVNode("div",{class:"ui-slider__thumb-focused-contour"},null,-1)]),44,r1),G[8]||(G[8]=r.createTextVNode()),r.createElementVNode("div",{ref_key:"thumbRef2",ref:p,style:r.normalizeStyle(Z.value),"data-percent":i.modelValue[1]+"%",class:"ui-slider__thumb ui-slider__triple-thumb",r2:"",tabindex:"0",onKeydown:G[1]||(G[1]=H=>x(H,1))},G[5]||(G[5]=[r.createElementVNode("div",{class:"ui-slider__thumb-focused-contour"},null,-1)]),44,o1),G[9]||(G[9]=r.createTextVNode()),r.createElementVNode("div",{ref_key:"thumbRef3",ref:h,style:r.normalizeStyle(J.value),"data-percent":i.modelValue[2]+"%",class:"ui-slider__thumb ui-slider__triple-thumb",r3:"",tabindex:"0",onKeydown:G[2]||(G[2]=H=>x(H,2))},G[6]||(G[6]=[r.createElementVNode("div",{class:"ui-slider__thumb-focused-contour"},null,-1)]),44,i1)])])]),G[12]||(G[12]=r.createTextVNode()),G[13]||(G[13]=r.createElementVNode("div",{class:"ui-slider__input-wrapper d-flex"},null,-1))],2),G[14]||(G[14]=r.createTextVNode()),O.value?(r.openBlock(),r.createElementBlock("div",s1,r.toDisplayString(O.value),1)):r.createCommentVNode("",!0)],2))}}),l1={class:"ui-input-range__separator"},c1=r.defineComponent({__name:"InputRange",props:{modelValue:{},separator:{default:"-"}},emits:["update:modelValue","change"],setup(t,{emit:e}){const n=t,o=e,i=r.reactive({left:n.modelValue[0],right:n.modelValue[1]}),l=r.ref(!1),c=r.computed(()=>(l.value,"ui-input-range-focused")),d=r.computed({get(){return{left:Math.min(...n.modelValue),right:Math.max(...n.modelValue)}},set(){}});r.watch(()=>d.value,m=>(i.left=m.left)&&(i.right=m.right));function p(){o("update:modelValue",[+i.left,+i.right]),o("change",[+i.left,+i.right])}function h(m,y){const b=y.target.value;/^[0-9]{0,2}$/.test(b)?m?i.left=+b:i.right=+b:m?i.left=+b.slice(0,b.length-1):i.right=+b.slice(0,b.length-1)}return(m,y)=>(r.openBlock(),r.createElementBlock("div",r.mergeProps({class:[c.value,"ui-input-range"]},m.$attrs),[r.withDirectives(r.createElementVNode("input",{"onUpdate:modelValue":y[0]||(y[0]=b=>d.value.left=b),class:"text-s",type:"text",onChange:p,onFocus:y[1]||(y[1]=b=>l.value=!0),onFocusout:y[2]||(y[2]=b=>l.value=!1),onInput:y[3]||(y[3]=b=>h(!0,b))},null,544),[[r.vModelText,d.value.left]]),y[8]||(y[8]=r.createTextVNode()),r.createElementVNode("div",l1,r.toDisplayString(n.separator),1),y[9]||(y[9]=r.createTextVNode()),r.withDirectives(r.createElementVNode("input",{"onUpdate:modelValue":y[4]||(y[4]=b=>d.value.right=b),class:"text-s",type:"text",onChange:p,onFocus:y[5]||(y[5]=b=>l.value=!0),onFocusout:y[6]||(y[6]=b=>l.value=!1),onInput:y[7]||(y[7]=b=>h(!1,b))},null,544),[[r.vModelText,d.value.right]])],16))}}),d1={class:"ui-slider__wrapper"},u1={class:"ui-slider__label-section"},p1={key:0,class:"text-s"},h1={key:1,class:"ui-slider__value-static text-s"},f1={class:"ui-slider__base"},m1={class:"ui-slider__container"},g1={class:"ui-slider__container ui-slider__container-thumb"},y1={class:"ui-slider__input-wrapper d-flex"},_1={key:0,class:"ui-slider__error"},v1=r.defineComponent({__name:"SliderRange",props:{modelValue:{},min:{default:0},max:{},step:{default:1},label:{default:void 0},helper:{default:void 0},error:{default:void 0},mode:{default:"text"},measure:{default:""},breakpoints:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{emit:e}){const n=r.useSlots(),o=e,i=t,l=r.reactive({deltaValue1:0,deltaValue2:0}),c=r.ref(),d=r.ref(),p=r.ref(),h=r.ref(i.modelValue),m=r.ref(i.modelValue[0]),y=r.ref(i.modelValue[1]),b=r.computed(()=>i),w=Yl(b),S=r.computed(()=>[m.value,y.value].sort((k,x)=>k-x).join("-")),M=r.computed(()=>i.max-i.min),O=r.computed(()=>kt((i.modelValue[0]??0)+l.deltaValue1,i.min,i.max)),C=r.computed(()=>kt((i.modelValue[1]??0)+l.deltaValue2,i.min,i.max)),I=r.computed(()=>{const k=i.modelValue;return Array.isArray(k)&&k.length===2&&k.every(x=>Number.isFinite(x))?i.error:"Expected model [number, number]"}),F=r.computed(()=>(O.value-i.min)/M.value),W=r.computed(()=>(C.value-i.min)/M.value),P=r.computed(()=>ae()),V=r.computed(()=>({right:P.value[0]+"%",left:100-P.value[1]+"%"})),Z=r.computed(()=>({right:Math.ceil((1-F.value)*100)+"%"})),J=r.computed(()=>({right:Math.ceil((1-W.value)*100)+"%"}));r.watch(()=>i.modelValue,k=>{h.value=k,m.value=+k[0],y.value=+k[1]},{immediate:!0}),yr(d,k=>{var x;_t((x=r.unref(c))==null?void 0:x.getBoundingClientRect(),B=>{const{dx:G}=k;l.deltaValue1=G/B.width*M.value,m.value=$(kt((i.modelValue[0]??0)+l.deltaValue1,i.min,i.max)),h.value=[m.value,y.value].sort((H,K)=>H-K),k.stop&&(j([$(O.value),$(C.value)]),l.deltaValue1=0)})}),yr(p,k=>{var x;_t((x=r.unref(c))==null?void 0:x.getBoundingClientRect(),B=>{const{dx:G}=k;l.deltaValue2=G/B.width*M.value,y.value=$(kt((i.modelValue[1]??0)+l.deltaValue2,i.min,i.max)),h.value=[m.value,y.value].sort((H,K)=>H-K),k.stop&&(j([$(O.value),$(C.value)]),l.deltaValue2=0)})});function ae(){const k=Math.ceil((1-F.value)*100),x=Math.ceil((1-W.value)*100);return[k,x].sort((B,G)=>B-G)}function $(k){const x=kt(k,i.min,i.max);return Math.round((x+Number.EPSILON)*(1/i.step))/(1/i.step)}function j(k){o("update:modelValue",k)}function U(k,x){["ArrowDown","ArrowUp","ArrowRight","ArrowLeft","Enter"].includes(k.code)&&k.preventDefault();const B=k.code==="ArrowUp"||k.code==="ArrowRight"?i.step*1:k.code==="ArrowDown"||k.code==="ArrowLeft"?i.step*-1:0,G=[...i.modelValue];G[x]=kt(G[x]+B,i.min,i.max),j(G)}return(k,x)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass([i.disabled?"ui-slider__disabled":void 0,"ui-slider__envelope"])},[r.createElementVNode("div",{class:r.normalizeClass([`ui-slider__mode-${i.mode}`,"ui-slider"])},[r.createElementVNode("div",d1,[r.createElementVNode("div",u1,[k.label?(r.openBlock(),r.createElementBlock("label",p1,[r.createElementVNode("span",null,r.toDisplayString(k.label),1),x[3]||(x[3]=r.createTextVNode()),r.unref(n).tooltip?(r.openBlock(),r.createBlock(r.unref(vt),{key:0,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.renderSlot(k.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0),x[4]||(x[4]=r.createTextVNode()),i.mode==="text"?(r.openBlock(),r.createElementBlock("div",h1,r.toDisplayString(S.value),1)):r.createCommentVNode("",!0)]),x[10]||(x[10]=r.createTextVNode()),r.createElementVNode("div",f1,[r.createElementVNode("div",m1,[r.createElementVNode("div",{ref_key:"barRef",ref:c,class:"ui-slider__bar"},[r.createElementVNode("div",{class:"ui-slider__progress",style:r.normalizeStyle(V.value)},null,4)],512)]),x[9]||(x[9]=r.createTextVNode()),r.createElementVNode("div",g1,[i.breakpoints?(r.openBlock(!0),r.createElementBlock(r.Fragment,{key:0},r.renderList(r.unref(w),(B,G)=>(r.openBlock(),r.createElementBlock("div",{key:G,style:r.normalizeStyle({right:`${B}%`}),class:"ui-slider__thumb-step"},null,4))),128)):r.createCommentVNode("",!0),x[7]||(x[7]=r.createTextVNode()),r.createElementVNode("div",{ref_key:"thumbRef1",ref:d,style:r.normalizeStyle(Z.value),class:"ui-slider__thumb",tabindex:"0",onKeydown:x[0]||(x[0]=B=>U(B,0))},x[5]||(x[5]=[r.createElementVNode("div",{class:"ui-slider__thumb-focused-contour"},null,-1)]),36),x[8]||(x[8]=r.createTextVNode()),r.createElementVNode("div",{ref_key:"thumbRef2",ref:p,style:r.normalizeStyle(J.value),class:"ui-slider__thumb",tabindex:"0",onKeydown:x[1]||(x[1]=B=>U(B,1))},x[6]||(x[6]=[r.createElementVNode("div",{class:"ui-slider__thumb-focused-contour"},null,-1)]),36)])])]),x[11]||(x[11]=r.createTextVNode()),r.createElementVNode("div",y1,[i.mode==="input"?(r.openBlock(),r.createBlock(c1,{key:0,modelValue:h.value,"onUpdate:modelValue":x[2]||(x[2]=B=>h.value=B),class:"ui-focused-border",onChange:j},null,8,["modelValue"])):r.createCommentVNode("",!0)])],2),x[12]||(x[12]=r.createTextVNode()),I.value?(r.openBlock(),r.createElementBlock("div",_1,r.toDisplayString(I.value),1)):r.createCommentVNode("",!0)],2))}}),C1=r.defineComponent({__name:"VScroll",props:{scrollTop:{},clientHeight:{},scrollHeight:{}},emits:["update:scrollTop"],setup(t,{emit:e}){const n=e,o=t,i=r.ref(),l=r.computed(()=>o.clientHeight/(o.scrollHeight||1)),c=r.computed(()=>l.value<1),d=r.computed(()=>{const p=r.unref(l);return{top:o.scrollTop*p+"px",height:Math.floor(o.clientHeight*p)+"px"}});return st(i,"pointerdown",p=>{const h={clientY:p.clientY},m=Ml(document,"mousemove",y=>{const b=(y.clientY-h.clientY)/l.value;n("update:scrollTop",o.scrollTop+b),h.clientY=y.clientY});["mouseup","pointercancel"].forEach(y=>{document.addEventListener(y,m,{once:!0})})}),(p,h)=>c.value?(r.openBlock(),r.createElementBlock("div",{key:0,ref_key:"scrollRef",ref:i,class:"v-scroll"},[r.createElementVNode("div",{class:"v-scroll__scrollbar",style:r.normalizeStyle(d.value)},null,4)],512)):r.createCommentVNode("",!0)}}),w1=r.defineComponent({__name:"HScroll",props:{scrollLeft:{},clientWidth:{},scrollWidth:{}},emits:["update:scrollLeft"],setup(t,{emit:e}){const n=e,o=t,i=r.ref(),l=r.computed(()=>o.clientWidth/(o.scrollWidth||1)),c=r.computed(()=>l.value<1),d=r.computed(()=>{const p=r.unref(l);return{left:o.scrollLeft*p+"px",width:Math.floor(o.clientWidth*p)+"px"}});return st(i,"pointerdown",p=>{const h={clientX:p.clientX},m=Ml(document,"mousemove",y=>{const b=(y.clientX-h.clientX)/l.value;n("update:scrollLeft",o.scrollLeft+b),h.clientX=y.clientX});["mouseup","pointercancel"].forEach(y=>{document.addEventListener(y,m,{once:!0})})}),(p,h)=>c.value?(r.openBlock(),r.createElementBlock("div",{key:0,ref_key:"scrollRef",ref:i,class:"h-scroll"},[r.createElementVNode("div",{class:"h-scroll__scrollbar",style:r.normalizeStyle(d.value)},null,4)],512)):r.createCommentVNode("",!0)}}),b1={class:"ui-scrollable"},x1=r.defineComponent({__name:"Scrollable",setup(t){const e=r.ref(),n=r.reactive({scrollTop:0,scrollLeft:0,clientHeight:0,clientWidth:0,scrollHeight:0,scrollWidth:0});function o(d){_w(n,d,"scrollTop","scrollLeft","clientHeight","clientWidth","scrollHeight","scrollWidth")}const i=d=>{d.preventDefault();const p=d.currentTarget;p.scrollTop+=d.deltaY,p.scrollLeft+=d.deltaX,o(p)};function l(d){_t(r.unref(e),p=>{p.scrollTop=d,o(p)})}function c(d){_t(r.unref(e),p=>{p.scrollLeft=d,o(p)})}return qp(e,d=>{_t(d,p=>o(p))}),r.onMounted(()=>{_t(r.unref(e),d=>{o(d),d.addEventListener("wheel",i)})}),r.onUnmounted(()=>{_t(r.unref(e),d=>d.removeEventListener("wheel",i))}),(d,p)=>(r.openBlock(),r.createElementBlock("div",b1,[r.createElementVNode("div",{ref_key:"containerRef",ref:e,class:"ui-scrollable__container",onWheel:i},[r.renderSlot(d.$slots,"default")],544),p[2]||(p[2]=r.createTextVNode()),r.createVNode(C1,{"scroll-top":n.scrollTop,"client-height":n.clientHeight,"scroll-height":n.scrollHeight,onWheel:p[0]||(p[0]=r.withModifiers(()=>{},["stop"])),"onUpdate:scrollTop":l},null,8,["scroll-top","client-height","scroll-height"]),p[3]||(p[3]=r.createTextVNode()),r.createVNode(w1,{"scroll-left":n.scrollLeft,"client-width":n.clientWidth,"scroll-width":n.scrollWidth,onWheel:p[1]||(p[1]=r.withModifiers(()=>{},["stop"])),"onUpdate:scrollLeft":c},null,8,["scroll-left","client-width","scroll-width"])]))}}),k1="add.svg",E1="box.svg",S1="calendar.svg",T1="checkmark.svg",N1="clipboard.svg",V1="close.svg",A1="copy.svg",B1="download.svg",P1="duplicate.svg",R1="edit.svg",D1="error.svg",I1="filter.svg",F1="help.svg",L1="info.svg",O1="link.svg",M1="loading.svg",G1="lock.svg",$1="maximize.svg",z1="minimize.svg",U1="minus.svg",Z1="more.svg",W1="open.svg",j1="pause.svg",H1="play.svg",q1="renew.svg",K1="restart.svg",Y1="reverse.svg",X1="settings.svg",J1="sort.svg",Q1="stop.svg",eT="success.svg",tT="time.svg",nT="tune.svg",rT="warning.svg",oT="zip.svg",iT={add:k1,"arrow-down":"arrow-down.svg","arrow-left":"arrow-left.svg","arrow-link":"arrow-link.svg","arrow-right":"arrow-right.svg","arrow-up":"arrow-up.svg",box:E1,calendar:S1,"caret-down":"caret-down.svg","caret-left":"caret-left.svg","caret-right":"caret-right.svg","caret-up":"caret-up.svg","cell-type-num":"cell-type-num.svg","cell-type-txt":"cell-type-txt.svg",checkmark:T1,"chevron-down":"chevron-down.svg","chevron-first":"chevron-first.svg","chevron-last":"chevron-last.svg","chevron-left":"chevron-left.svg","chevron-right":"chevron-right.svg","chevron-up":"chevron-up.svg","clipboard-copied":"clipboard-copied.svg",clipboard:N1,close:V1,copy:A1,"data-dimentions":"data-dimentions.svg","delete-bin":"delete-bin.svg","delete-circle":"delete-circle.svg","delete-clear":"delete-clear.svg",download:B1,"drag-dots":"drag-dots.svg",duplicate:P1,edit:R1,error:D1,export:"export.svg","filter-on":"filter-on.svg",filter:I1,"help-outline":"help-outline.svg",help:F1,"info-outline":"info-outline.svg",info:L1,"jump-link":"jump-link.svg",link:O1,loading:M1,lock:G1,maximize:$1,minimize:z1,minus:U1,more:Z1,open:W1,"paper-clip":"paper-clip.svg",pause:j1,play:H1,renew:q1,restart:K1,reverse:Y1,settings:X1,sort:J1,stop:Q1,success:eT,time:tT,tune:nT,warning:rT,"x-axis":"x-axis.svg","y-axis":"y-axis.svg",zip:oT},sT="add.svg",aT="annotate.svg",lT="annotation.svg",cT="area.svg",dT="axes.svg",uT="bar.svg",pT="bindot.svg",hT="box.svg",fT="boxplot.svg",mT="bubble.svg",gT="calendar.svg",yT="canvas.svg",_T="checkbox.svg",vT="checkmark.svg",CT="clipboard.svg",wT="close.svg",bT="cluster.svg",xT="code.svg",kT="color.svg",ET="columns.svg",ST="container.svg",TT="cookie.svg",NT="copy.svg",VT="cpu.svg",AT="debug.svg",BT="dna.svg",PT="download.svg",RT="duplicate.svg",DT="edit.svg",IT="error.svg",FT="filter.svg",LT="generate.svg",OT="graph.svg",MT="heatmap.svg",GT="help.svg",$T="info.svg",zT="jitter.svg",UT="lasso.svg",ZT="layers.svg",WT="learn.svg",jT="legend.svg",HT="line.svg",qT="link.svg",KT="loading.svg",YT="lock.svg",XT="maximize.svg",JT="menu.svg",QT="minimize.svg",eN="minus.svg",tN="more.svg",nN="pause.svg",rN="pin.svg",oN="play.svg",iN="product.svg",sN="publications.svg",aN="renew.svg",lN="restart.svg",cN="reverse.svg",dN="search.svg",uN="server.svg",pN="settings.svg",hN="sina.svg",fN="skatterplot.svg",mN="slice.svg",gN="sort.svg",yN="statistics.svg",_N="stop.svg",vN="success.svg",CN="table.svg",wN="template.svg",bN="terminal.svg",xN="time.svg",kN="tune.svg",EN="venn.svg",SN="violin.svg",TN="warning.svg",NN="wetlab.svg",VN="zip.svg",AN={"add-layer":"add-layer.svg",add:sT,"align-center":"align-center.svg","align-left":"align-left.svg","align-right":"align-right.svg",annotate:aT,annotation:lT,area:cT,"arrow-down":"arrow-down.svg","arrow-left":"arrow-left.svg","arrow-link":"arrow-link.svg","arrow-right":"arrow-right.svg","arrow-up":"arrow-up.svg",axes:dT,"bar-cross":"bar-cross.svg","bar-error":"bar-error.svg","bar-stacked":"bar-stacked.svg","bar-trend":"bar-trend.svg",bar:uT,bindot:pT,box:hT,"boxplot-binned":"boxplot-binned.svg","boxplot-jitter":"boxplot-jitter.svg","boxplot-notched":"boxplot-notched.svg",boxplot:fT,bubble:mT,calendar:gT,canvas:yT,"cell-type-num":"cell-type-num.svg","cell-type-txt":"cell-type-txt.svg","checkbox-checked":"checkbox-checked.svg","checkbox-intermediate":"checkbox-intermediate.svg",checkbox:_T,checkmark:vT,"chevron-down":"chevron-down.svg","chevron-first":"chevron-first.svg","chevron-last":"chevron-last.svg","chevron-left":"chevron-left.svg","chevron-right":"chevron-right.svg","chevron-sort":"chevron-sort.svg","chevron-up":"chevron-up.svg","clipboard-copied":"clipboard-copied.svg",clipboard:CT,close:wT,"cloud-download":"cloud-download.svg","cloud-offline":"cloud-offline.svg","cloud-online":"cloud-online.svg","cloud-upload":"cloud-upload.svg",cluster:bT,code:xT,"color-fill":"color-fill.svg","color-none":"color-none.svg","color-stroke":"color-stroke.svg",color:kT,columns:ET,"connected-points":"connected-points.svg",container:ST,cookie:TT,copy:NT,cpu:VT,"data-dimentions":"data-dimentions.svg",debug:AT,"delete-bin":"delete-bin.svg","delete-circle":"delete-circle.svg","delete-clear":"delete-clear.svg","dendrogram-X-line":"dendrogram-X-line.svg","dendrogram-X":"dendrogram-X.svg","dendrogram-Y-line":"dendrogram-Y-line.svg","dendrogram-Y":"dendrogram-Y.svg","dna-add":"dna-add.svg","dna-import":"dna-import.svg",dna:BT,download:PT,"drag-dots":"drag-dots.svg","drag-horizontal":"drag-horizontal.svg","drag-vertical":"drag-vertical.svg",duplicate:RT,edit:DT,"error-bar":"error-bar.svg",error:IT,"expand-left":"expand-left.svg","expand-right":"expand-right.svg",export:"export.svg","file-doc-add":"file-doc-add.svg","file-doc-download":"file-doc-download.svg","file-doc-import":"file-doc-import.svg","file-doc":"file-doc.svg","filter-on":"filter-on.svg",filter:FT,"fire-tips":"fire-tips.svg","folder-parent":"folder-parent.svg","frame-type-all":"frame-type-all.svg","frame-type-bottom":"frame-type-bottom.svg","frame-type-left-bottom":"frame-type-left-bottom.svg","frame-type-left":"frame-type-left.svg","frame-type-none":"frame-type-none.svg",generate:LT,graph:OT,heatmap:MT,"help-outline":"help-outline.svg",help:GT,"info-outline":"info-outline.svg",info:$T,jitter:zT,"jump-link":"jump-link.svg",lasso:UT,layers:ZT,learn:WT,"legend-box-dot":"legend-box-dot.svg","legend-box":"legend-box.svg",legend:jT,"line-binned":"line-binned.svg","line-error":"line-error.svg","line-jitter":"line-jitter.svg",line:HT,"linetype-dashed":"linetype-dashed.svg","linetype-dotdash":"linetype-dotdash.svg","linetype-dotted":"linetype-dotted.svg","linetype-longdash":"linetype-longdash.svg","linetype-solid":"linetype-solid.svg","linetype-twodash":"linetype-twodash.svg","link-disabled":"link-disabled.svg",link:qT,loading:KT,lock:YT,maximize:XT,menu:JT,minimize:QT,minus:eN,more:tN,"paper-clip":"paper-clip.svg",pause:nN,pin:rN,play:oN,"position-bottom-annotation":"position-bottom-annotation.svg","position-bottom":"position-bottom.svg","position-left-annotation":"position-left-annotation.svg","position-left":"position-left.svg","position-right-annotation":"position-right-annotation.svg","position-right":"position-right.svg","position-top-annotation":"position-top-annotation.svg","position-top":"position-top.svg",product:iN,publications:sN,"radio-button-checked":"radio-button-checked.svg","radio-button":"radio-button.svg",renew:aN,restart:lN,reverse:cN,"rotation-0":"rotation-0.svg","rotation-45":"rotation-45.svg","rotation-90":"rotation-90.svg",search:dN,"server-on":"server-on.svg",server:uN,settings:pN,sina:hN,skatterplot:fN,slice:mN,"social-github":"social-github.svg","social-linkedin":"social-linkedin.svg","social-twitter-X":"social-twitter-X.svg","social-twitter-bird":"social-twitter-bird.svg","social-youtube":"social-youtube.svg","sort-list-down":"sort-list-down.svg","sort-list-up":"sort-list-up.svg",sort:gN,statistics:yN,stop:_N,"strip-plot":"strip-plot.svg",success:vN,"table-add":"table-add.svg","table-alias":"table-alias.svg","table-import":"table-import.svg",table:CN,template:wN,terminal:bN,"text-align-center":"text-align-center.svg","text-align-left":"text-align-left.svg","text-align-right":"text-align-right.svg","theme-dark":"theme-dark.svg","theme-light":"theme-light.svg",time:xN,tune:kN,venn:EN,"view-hide":"view-hide.svg","view-show":"view-show.svg","violin-binned":"violin-binned.svg","violin-jitter":"violin-jitter.svg",violin:SN,warning:TN,wetlab:NN,"windows-collapse":"windows-collapse.svg","windows-expand":"windows-expand.svg","x-axis":"x-axis.svg","y-axis":"y-axis.svg",zip:VN,"zoom-in":"zoom-in.svg","zoom-out":"zoom-out.svg"};function BN(){return{txtSec:{title:"Text",data:{"--txt-00":{light:[!1,!1],value:["#FFFFFF","#FFFFFF"],description:"Text on the colored elements"},"--txt-01":{light:[!0,!1],value:["#110529","#FFFFFF"],description:"Primary text layer"},"--txt-02":{light:[!0,!1],value:["#231842","#ADAEB8"],description:"Secondary text layer - large arrays of text"},"--txt-03":{light:[!0,!0],value:["#9D9EAE","#60616B"],description:"Tetritary text layer - hints and descriptions"},"--txt-mask":{light:[!1,!0],value:["#CFD1DB","#3D3D42"],description:"Text mask in inputs, icons, etc."},"--txt-focus":{light:[!0,!0],value:["#07AD3E","#87E087"],description:"Colored text in active/focus elements"},"--txt-error":{light:[!0,!0],value:["#F1222F","#FF5C5C"],description:"Colored text in error elements"},"--txt-link":{light:[!0,!0],value:["#5F31CC","#9470FF"],description:"Colored text in links"}}},iconSec:{title:"Icon",data:{"--ic-00":{light:[!1,!1],value:["#FFFFFF","#FFFFFF"],description:"Icons on colored elements"},"--ic-01":{light:[!0,!1],value:["#110529","#FFFFFF"],description:"Primary elements"},"--ic-02":{light:[!1,!0],value:["#CFD1DB","#60616B"],description:"Secondary & tetritary elements"},"--ic-accent":{light:[!0,!1],value:["#07AD3E","#87E087"],description:"Focus/active elements"}}},borderSec:{title:"Border",data:{"--border-color-default":{light:[!0,!0],value:["#110529","#60616B"],description:"Main border for components"},"--border-color-hover":{light:[!0,!0],value:["#231842","#ADAEB8"],description:"Hover on main border"},"--border-color-focus":{light:[!1,!1],value:["#49CC49","#49CC49"],description:"Active border for components"},"--border-color-error":{light:[!1,!1],value:["#FF5C5C","#FF5C5C"],description:"Error border for components"},"--border-color-div-grey":{light:[!1,!0],value:["#E1E3EB","#232329"],description:"Divider lines low contrast"},"--border-color-div-bw":{light:[!1,!0],value:["#FFFFFF","#000000"],description:"Divider lines hight contrast"}}},btnSec:{title:"Button",data:{"--btn-accent-default":{light:[!0,!0],value:["#845CFF"," #5F31CC"],description:"Accent coloured button"},"--btn-accent-hover":{light:[!0,!0],value:["#9470FF"," #5F31CC"],description:"Hover on accent coloured button"},"--btn-accent-press":{light:[!0,!0],value:["#6F4DD6","#5F31CC"],description:"Pressed on accent coloured button"},"--btn-primary-default":{light:[!0,!0],value:["#110529","#5F31CC"],description:"Primary button"},"--btn-primary-hover":{light:[!0,!0],value:["#231842","#6D3DDB"],description:"Hover on primary button"},"--btn-primary-press":{light:[!0,!0],value:["#080214","#5328B8"],description:"Hover on primary button"},"--btn-sec-hover-white":{light:[!1,!0],value:["rgba(255, 255, 255, 0.50)","rgba(131, 131, 163, 0.16)"],description:"Hover background on transparent button"},"--btn-sec-hover-grey":{light:[!1,!0],value:["rgba(155, 171, 204, 0.16)","rgba(131, 131, 163, 0.16)"],description:"Hover background on ghost button & icons"},"--btn-sec-press-grey":{light:[!1,!0],value:["rgba(155, 171, 204, 0.24)","rgba(131, 131, 163, 0.24)"],description:"Hover background on ghost button & icons"},"--btn-active-select":{light:[!1,!0],value:["rgba(99, 224, 36, 0.24)","rgba(99, 224, 36, 0.24)"],description:"Fill on selected elements"},"--btn-switcher":{light:[!1,!0],value:["linear-gradient(180deg, #A1E59C 0%, #D0F5B0 100%)","#5E5E70"],description:"Gradient on active controll/switcher element"}}},disSec:{title:"Disable",data:{"--dis-00":{light:[!1,!0],value:["#FFFFFF","#65656B"],description:"Elements on dis-01, labels, texts, icons"},"--dis-01":{light:[!1,!0],value:["#CFD1DB","#3D3D42"],description:"Buttons, borders, labels, texts, icons"}}},bgSec:{title:"Background",data:{"--bg-base-dark":{light:[!0,!0],value:["#110529","#0D0D0F"],description:"Default dark block background"},"--bg-base-light":{light:[!1,!0],value:["#F7F8FA","#0D0D0F"],description:"Default light block background"},"--bg-elevated-01":{light:[!1,!0],value:["#FFFFFF","#1B1B1F"],description:"Default block background"},"--bg-elevated-02":{light:[!1,!0],value:["#E1E3EB","#2D2D33"],description:"Secondary block background"}}},filledSec:{title:"Filled",data:{"--filled-V-BG":{light:[!1,!0],value:["#D0F0C0","rgba(66, 184, 66, 0.40)"],description:"Text background selection on V-read"},"--filled-D-BG":{light:[!1,!0],value:["#FFCECC","rgba(229, 83, 229, 0.40)"],description:"Text background selection on D-read"},"--filled-N-BG":{light:[!1,!0],value:["#FAF5AA","rgba(83, 82, 102, 0.40)"],description:"Text background selection on C/N-read"},"--filled-J-BG":{light:[!1,!0],value:["#DEDBFF","rgba(132, 92, 255, 0.40)"],description:"Text background selection on J-read"}}},notificationSec:{title:"Notification",data:{"--notification-neutral":{light:[!1,!0],value:["linear-gradient(90deg, #D6D9FF 0%, #FFF 100%)","linear-gradient(90deg, #4D4D8F 0%, #292933 100%)"],description:"Background on neutral blocks"},"--notification-success":{light:[!1,!0],value:["linear-gradient(90deg, #C9F0B6 0%, #FFF 100%)","linear-gradient(90deg, #305C3E 0%, #292933 100%)"],description:"Background on success blocks"},"--notification-warning":{light:[!1,!0],value:["linear-gradient(90deg, #FEE0A3 0%, #FFF 100%)","linear-gradient(90deg, #754F2D 0%, #292933 100%)"],description:"Background on warning blocks"},"--notification-error":{light:[!1,!0],value:["linear-gradient(90deg, #FFB8B8 0%, #FFF 100%)","linear-gradient(90deg, #8F3343 0%, #292933 100%)"],description:"Background on error blocks"}}},gradientSec:{title:"Gradient",data:{"--gradient-blue-green":{light:[!0,!0],value:["linear-gradient(0deg, #478063 0%, #2E4652 45.93%, #24223D 91.63%)","linear-gradient(0deg, #478063 0%, #2E4652 45.93%, #24223D 91.63%)"],description:"Main brand dark gradient"},"--gradient-green-lime":{light:[!1,!0],value:["linear-gradient(180deg, #A1E59C 0%, #D0F5B0 100%)","linear-gradient(0deg, #478063 0%, #2E4652 45.93%, #24223D 91.63%)"],description:"Main brand light gradient"},"--gradient-blue-violet":{light:[!1,!0],value:["linear-gradient(180deg, #ADB8FF 0%, #D6E9FF 100%)","linear-gradient(0deg, #478063 0%, #2E4652 45.93%, #24223D 91.63%)"],description:"Main brand light gradient"},"--gradient-blue-clear":{light:[!1,!0],value:["linear-gradient(180deg, #85BEFF 0%, #CEF 100%)","linear-gradient(0deg, #478063 0%, #2E4652 45.93%, #24223D 91.63%)"],description:"Additional brand gradient"},"--gradient-orange":{light:[!1,!0],value:["linear-gradient(180deg, #FFB766 0%, #FFEAA3 100%)","linear-gradient(0deg, #478063 0%, #2E4652 45.93%, #24223D 91.63%)"],description:"Additional brand gradient"},"--gradient-mint":{light:[!1,!0],value:["linear-gradient(180deg, #7DD1D1 0%, #C8FAE9 100%)","linear-gradient(0deg, #478063 0%, #2E4652 45.93%, #24223D 91.63%)"],description:"Additional brand gradient"},"--gradient-lime":{light:[!1,!0],value:["linear-gradient(180deg, #BFE062 0%, #E4FFAD 100%)","linear-gradient(0deg, #478063 0%, #2E4652 45.93%, #24223D 91.63%)"],description:"Additional brand gradient"},"--gradient-rose":{light:[!1,!0],value:["linear-gradient(0deg, #FFDDD6 0%, #FF99C9 100%)","linear-gradient(0deg, #478063 0%, #2E4652 45.93%, #24223D 91.63%)"],description:"Additional brand gradient"},"--gradient-red":{light:[!1,!0],value:["linear-gradient(0deg, #FFD5CC 0%, #FF9494 100%)","linear-gradient(0deg, #478063 0%, #2E4652 45.93%, #24223D 91.63%)"],description:"Additional brand gradient"},"--gradient-violet":{light:[!1,!0],value:["linear-gradient(180deg, #BCA3FF 0%, #E5E5FF 100%)","linear-gradient(0deg, #478063 0%, #2E4652 45.93%, #24223D 91.63%)"],description:"Additional brand gradient"}}}}}const PN=["add","arrow-down","arrow-left","arrow-link","arrow-right","arrow-up","box","calendar","caret-down","caret-left","caret-right","caret-up","cell-type-num","cell-type-txt","checkmark","chevron-down","chevron-first","chevron-last","chevron-left","chevron-right","chevron-up","clipboard-copied","clipboard","close","copy","data-dimentions","delete-bin","delete-circle","delete-clear","download","drag-dots","duplicate","edit","error","export","filter-on","filter","help-outline","help","info-outline","info","jump-link","link","loading","lock","maximize","minimize","minus","more","open","paper-clip","pause","play","renew","restart","reverse","settings","sort","stop","success","time","tune","warning","x-axis","y-axis","zip"],RN=["add-layer","add","align-center","align-left","align-right","annotate","annotation","area","arrow-down","arrow-left","arrow-link","arrow-right","arrow-up","axes","bar-cross","bar-error","bar-stacked","bar-trend","bar","bindot","box","boxplot-binned","boxplot-jitter","boxplot-notched","boxplot","bubble","calendar","canvas","cell-type-num","cell-type-txt","checkbox-checked","checkbox-intermediate","checkbox","checkmark","chevron-down","chevron-first","chevron-last","chevron-left","chevron-right","chevron-sort","chevron-up","clipboard-copied","clipboard","close","cloud-download","cloud-offline","cloud-online","cloud-upload","cluster","code","color-fill","color-none","color-stroke","color","columns","connected-points","container","cookie","copy","cpu","data-dimentions","debug","delete-bin","delete-circle","delete-clear","dendrogram-X-line","dendrogram-X","dendrogram-Y-line","dendrogram-Y","dna-add","dna-import","dna","download","drag-dots","drag-horizontal","drag-vertical","duplicate","edit","error-bar","error","expand-left","expand-right","export","file-doc-add","file-doc-download","file-doc-import","file-doc","filter-on","filter","fire-tips","folder-parent","frame-type-all","frame-type-bottom","frame-type-left-bottom","frame-type-left","frame-type-none","generate","graph","heatmap","help-outline","help","info-outline","info","jitter","jump-link","lasso","layers","learn","legend-box-dot","legend-box","legend","line-binned","line-error","line-jitter","line","linetype-dashed","linetype-dotdash","linetype-dotted","linetype-longdash","linetype-solid","linetype-twodash","link-disabled","link","loading","lock","maximize","menu","minimize","minus","more","paper-clip","pause","pin","play","position-bottom-annotation","position-bottom","position-left-annotation","position-left","position-right-annotation","position-right","position-top-annotation","position-top","product","publications","radio-button-checked","radio-button","renew","restart","reverse","rotation-0","rotation-45","rotation-90","search","server-on","server","settings","sina","skatterplot","slice","social-github","social-linkedin","social-twitter-X","social-twitter-bird","social-youtube","sort-list-down","sort-list-up","sort","statistics","stop","strip-plot","success","table-add","table-alias","table-import","table","template","terminal","text-align-center","text-align-left","text-align-right","theme-dark","theme-light","time","tune","venn","view-hide","view-show","violin-binned","violin-jitter","violin","warning","wetlab","windows-collapse","windows-expand","x-axis","y-axis","zip","zoom-in","zoom-out"],DN={allCssVariables:BN(),icons16:iT,icons24:AN},IN={class:"block__not-found"},FN=r.defineComponent({__name:"NotFound",setup(t){const n=vl().useApp(),o=()=>{n.updateNavigationState(i=>{i.href="/"})};return(i,l)=>(r.openBlock(),r.createElementBlock("div",IN,[r.createElementVNode("h1",null,"Not found route: "+r.toDisplayString(r.unref(n).snapshot.navigationState.href),1),r.createVNode(r.unref(Pl),{onClick:r.withModifiers(o,["stop"])},{default:r.withCtx(()=>l[0]||(l[0]=[r.createTextVNode("Return to main page")])),_:1})]))}}),Xl=(t,e)=>{const n=t.__vccOpts||t;for(const[o,i]of e)n[o]=i;return n},LN={},ON={class:"block__loader-page"};function MN(t,e){return r.openBlock(),r.createElementBlock("div",ON,e[0]||(e[0]=[r.createElementVNode("div",{class:"loader-container"},[r.createElementVNode("i",{class:"mask-24 mask-loading loader-icon"})],-1)]))}const GN=Xl(LN,[["render",MN]]),$N={class:"pl-app-notification-alert"},zN={class:"pl-app-notification-alert__content"},UN={class:"pl-app-notification-alert__title"},ZN=r.defineComponent({__name:"PlAppErrorNotificationAlert",props:{errors:{}},setup(t){const e=t,n=r.ref(!1),o=r.ref(!0),i=r.computed(()=>Object.entries(e.errors).filter(c=>!!c[1]));function l(){n.value=!0}return r.watch(()=>e.errors,c=>{o.value=Object.values(c).some(d=>!!d)},{immediate:!0,deep:!0}),(c,d)=>(r.openBlock(),r.createElementBlock("div",$N,[r.createVNode(r.unref(Ul),{modelValue:n.value,"onUpdate:modelValue":d[0]||(d[0]=p=>n.value=p),width:"720px",style:{"max-height":"100vh"}},{title:r.withCtx(()=>d[2]||(d[2]=[r.createTextVNode(" Errors ")])),default:r.withCtx(()=>[r.createElementVNode("div",zN,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(i.value,p=>{var h;return r.openBlock(),r.createElementBlock("div",{key:p[0],class:"pl-app-notification-alert__item"},[r.createElementVNode("div",UN,r.toDisplayString(p[0]),1),r.createVNode(r.unref(kp),{value:(h=p[1])==null?void 0:h.message},null,8,["value"])])}),128))])]),_:1},8,["modelValue"]),r.createVNode(r.unref(jp),{modelValue:o.value,"onUpdate:modelValue":d[1]||(d[1]=p=>o.value=p),type:"error",closable:""},{actions:r.withCtx(()=>[r.createVNode(r.unref(Ss),{icon:"arrow-right",onClick:l},{default:r.withCtx(()=>d[3]||(d[3]=[r.createTextVNode("See errors")])),_:1}),r.createVNode(r.unref(cp))]),default:r.withCtx(()=>[d[4]||(d[4]=r.createTextVNode(" Some outputs have errors. "))]),_:1},8,["modelValue"])]))}}),WN={key:0,class:"block__loader"},jN=r.defineComponent({__name:"BlockLoader",props:{value:{type:[Boolean,Number]}},setup(t){const e=t,n=r.computed(()=>typeof e.value=="boolean"&&e.value),o=r.computed(()=>{const i=e.value;if(typeof i=="number")return i>=1?void 0:(i*100).toFixed(2)+"%"});return(i,l)=>n.value?(r.openBlock(),r.createElementBlock("div",WN)):o.value!==void 0?(r.openBlock(),r.createElementBlock("div",{key:1,class:"block__progress",style:r.normalizeStyle({"--progress-width":o.value})},null,4)):r.createCommentVNode("",!0)}}),HN={class:"block block__layout"},qN={key:0},KN=r.defineComponent({__name:"BlockLayout",setup(t){const e=vl(),n=h=>{try{return new URL(h,"http://dummy").pathname}catch{console.error("Invalid href",h);return}},o=r.computed(()=>e.loaded?e.useApp().href:void 0),i=r.computed(()=>{if(e.loaded){const h=e.useApp(),m=n(h.snapshot.navigationState.href);return m?h.getRoute(m):void 0}}),l=r.computed(()=>e.loaded?e.useApp():void 0),c=r.computed(()=>l.value?l.value.model.outputErrors:{}),d=r.computed(()=>{var h;return((h=l.value)==null?void 0:h.showErrorsNotification)??!0}),p=r.computed(()=>{var h,m;return(m=(h=l.value)==null?void 0:h.progress)==null?void 0:m.call(h)});return(h,m)=>(r.openBlock(),r.createElementBlock("div",HN,[r.createVNode(jN,{value:p.value},null,8,["value"]),r.unref(e).error?(r.openBlock(),r.createElementBlock("div",qN,r.toDisplayString(r.unref(e).error),1)):r.unref(e).loaded?i.value?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(i.value),{key:o.value})):(r.openBlock(),r.createBlock(FN,{key:3})):(r.openBlock(),r.createBlock(GN,{key:1},{default:r.withCtx(()=>m[0]||(m[0]=[r.createTextVNode("Loading...")])),_:1})),r.unref(e).loaded&&d.value?(r.openBlock(),r.createBlock(r.unref(ZN),{key:4,errors:c.value},null,8,["errors"])):r.createCommentVNode("",!0)]))}});var $s={exports:{}};/**
65
+ )`}function l(){const d=t.value;if(!d)return;const p=[o(d),i(d)].filter(h=>h!==null);d.style.setProperty("-webkit-mask-image",p.join(",")),d.style.setProperty("mask-image",p.join(",")),p.length>1&&(d.style.setProperty("-webkit-mask-composite","source-in"),d.style.setProperty("mask-composite","source-in"))}const c=Vl(l);r.onMounted(l),st(window,"scroll",c,!0),st(window,"resize",c,!0)}function Kp(t,e){hp(()=>{_t(r.unref(t),n=>{fp(n,()=>e(n))})}),r.onUnmounted(()=>{_t(r.unref(t),n=>{mp(n)})})}const Sr={item:"sortable__item",animate:"sortable__animate"},Oi=t=>t.getBoundingClientRect().y,Yp=t=>{const{y:e,height:n}=t.getBoundingClientRect();return e+Math.ceil(n/2)},KS=t=>{const{y:e,height:n}=t.getBoundingClientRect();return e+n};function Xp(t,e){const n={item:void 0,options(){var w;return[...((w=t.value)==null?void 0:w.children)??[]]}},o=r.computed(()=>n.options()),i=e.shakeBuffer??10,l=e.reorderDelay??100;function c(w){const S=e.handle?this.querySelector(e.handle):null;S&&(S&&!S.contains(w.target)||(this.classList.remove(Sr.animate),this.classList.add(Sr.item),n.item={el:this,y:w.y,dy:0,orderChanged:!1}))}function d(w){const S=n.options();return S.slice(0,S.indexOf(w))}function p(w){const S=n.options();return S.slice(S.indexOf(w)+1)}function h(w,S){const M=n.options().filter(v=>v!==S),O=M.indexOf(w);return M.splice(O,0,S),M}function m(w,S){const M=n.options().filter(v=>v!==S),O=M.indexOf(w);return M.splice(O+1,0,S),M}function y(w,S){w.dy=S-w.y,w.el.style.setProperty("transform",`translateY(${w.dy}px)`)}function b(w){var S;if(!n.item)return;const{el:M}=n.item;if(!M.isConnected){n.item=void 0;return}const O=w.map(V=>Oi(V)),v=Oi(M);(S=t.value)==null||S.replaceChildren(...w);const I=Oi(M),F=w.map(V=>Oi(V)),W=[];for(let V=0;V<F.length;V++){const Z=w[V];if(Z===n.item.el)continue;const J=F[V],ae=O[V]-J;Z.style.transform=`translateY(${ae}px)`,W.push(Z)}const P=I-v;n.item.y=n.item.y+P,n.item.dy=n.item.dy-P,n.item.orderChanged=!0,n.item.el.style.setProperty("transform",`translateY(${n.item.dy}px)`),W.forEach(V=>V.classList.remove(Sr.animate)),requestAnimationFrame(function(){W.forEach(V=>{V.classList.add(Sr.animate),V.style.transform="",V.addEventListener("transitionend",()=>{V.classList.remove(Sr.animate)})})})}st(window,"mousemove",w=>{if(!n.item)return;const{el:S}=n.item;y(n.item,w.y);const M=Oi(n.item.el),O=KS(n.item.el),v=d(S),I=p(S);v.forEach(F=>{const W=Yp(F);M+i<W&&b(h(F,S))}),I.forEach(F=>{const W=Yp(F);O-i>W&&b(m(F,S))})}),st(window,"mouseup",()=>{if(!n.item)return;const{el:w,orderChanged:S}=n.item;w.classList.add(Sr.animate),w.style.removeProperty("transform"),w.addEventListener("transitionend",()=>{w.classList.remove(Sr.animate,Sr.item)}),setTimeout(()=>{if(!S)return;const M=n.options().map(v=>Number(v.getAttribute("data-index"))),O=t.value;if(O){for(const v of n.options())O.removeChild(v);o.value.forEach(v=>{O.appendChild(v)})}e.onChange(M)},l),n.item=void 0}),r.watchEffect(()=>{o.value.forEach((w,S)=>{w.removeEventListener("mousedown",c),w.addEventListener("mousedown",c),w.setAttribute("data-index",String(S))})})}function YS(t,e){let n;r.onMounted(()=>{n=setInterval(t,e)}),r.onUnmounted(()=>clearInterval(n))}function XS(t,e,n){const o=r.reactive({data:xl.deepClone(e(t.value)),changed:!1});return r.watch(()=>o.data,i=>{o.changed?n(xl.deepClone(i)):o.changed=!0},{deep:!0}),r.watch(t,i=>{Object.assign(o,{data:xl.deepClone(e(i)),changed:!1})},{deep:!0,immediate:!0}),o}function JS(t){const e=r.reactive({isLoading:!1,result:void 0,error:void 0,async run(...n){this.isLoading=!0,this.error=void 0;try{this.result=await t(...n)}catch(o){this.error=o}finally{this.isLoading=!1}},debounce(n,o=1e3){return mv(()=>{const i=n();this.run(...i).catch(console.error)},o)}});return e.run=e.run.bind(e),e}function QS(t,e){function n(c,d){const p=r.unref(t);if(!p)return;const h=`translate(${d.x-c.x}px, ${d.y-c.y}px)`;p.style.setProperty("transform",h),e(d)}function o(c){const d=p=>n(c,p);document.addEventListener("mousemove",d),document.addEventListener("mouseup",()=>{const p=r.unref(t);document.removeEventListener("mousemove",d),p&&(p.style.setProperty("transition","all .3s ease-in-out"),p.style.removeProperty("transform"),p.addEventListener("transitionend",()=>{p.style.removeProperty("transition")}))},{once:!0})}function i(){var c;(c=r.unref(t))==null||c.addEventListener("mousedown",o)}function l(){var c;(c=r.unref(t))==null||c.removeEventListener("mousedown",o)}r.onMounted(i),r.onUnmounted(l)}const e1={class:"ui-slider__wrapper"},t1={class:"ui-slider__label-section"},n1={key:0,class:"text-s"},r1={class:"ui-slider__base"},o1={class:"ui-slider__container"},i1={class:"ui-slider__container ui-slider__container-thumb"},s1=["data-percent"],a1=["data-percent"],l1=["data-percent"],c1={key:0,class:"ui-slider__error"},d1=r.defineComponent({__name:"SliderRangeTriple",props:{modelValue:{},min:{default:0},max:{},step:{default:1},label:{default:void 0},helper:{default:void 0},error:{default:void 0},mode:{default:"text"},measure:{default:"%"},breakpoints:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{emit:e}){const n=r.useSlots(),o=e,i=t,l=r.reactive({deltaValue1:0,deltaValue2:0,deltaValue3:0}),c=r.ref(),d=r.ref(),p=r.ref(),h=r.ref(),m=r.computed(()=>i.max-i.min),y=r.computed(()=>i),b=Xl(y),w=r.computed(()=>kt((i.modelValue[0]??0)+l.deltaValue1,i.min,i.max)),S=r.computed(()=>kt((i.modelValue[1]??0)+l.deltaValue2,i.min,i.max)),M=r.computed(()=>kt((i.modelValue[2]??0)+l.deltaValue3,i.min,i.max)),O=r.computed(()=>{const B=i.modelValue;if(!(Array.isArray(B)&&B.length===3&&B.every(H=>Number.isFinite(H))))return"Expected model [number, number, number]";const G=[];return[...i.modelValue].forEach(H=>{H>i.max&&G.push(`Max model value must be lower than max props ${i.max}.`),H<i.min&&G.push("Min model value must be greater than max props.")}),G.length>0?G.join(" "):i.error}),v=r.computed(()=>(w.value-i.min)/m.value),I=r.computed(()=>(S.value-i.min)/m.value),F=r.computed(()=>(M.value-i.min)/m.value),W=r.computed(()=>$()),P=r.computed(()=>({right:W.value[0]+"%",left:100-W.value[2]+"%"})),V=r.computed(()=>({right:Math.ceil((1-v.value)*100)+"%"})),Z=r.computed(()=>({right:Math.ceil((1-I.value)*100)+"%"})),J=r.computed(()=>({right:Math.ceil((1-F.value)*100)+"%"}));yr(d,B=>{var G;_t((G=r.unref(c))==null?void 0:G.getBoundingClientRect(),H=>{const{dx:K}=B;l.deltaValue1=K/H.width*m.value,d.value&&ae(d.value,i.modelValue[0],l.deltaValue1),B.stop&&(U([j(w.value),j(S.value),j(M.value)]),l.deltaValue1=0)})}),yr(p,B=>{var G;_t((G=r.unref(c))==null?void 0:G.getBoundingClientRect(),H=>{const{dx:K}=B;l.deltaValue2=K/H.width*m.value,p.value&&ae(p.value,i.modelValue[1],l.deltaValue2),B.stop&&(U([j(w.value),j(S.value),j(M.value)]),l.deltaValue2=0)})}),yr(h,B=>{var G;_t((G=r.unref(c))==null?void 0:G.getBoundingClientRect(),H=>{const{dx:K}=B;l.deltaValue3=K/H.width*m.value,h.value&&ae(h.value,i.modelValue[2],l.deltaValue3),B.stop&&(U([j(w.value),j(S.value),j(M.value)]),l.deltaValue3=0)})});function ae(B,G,H){const K=j(kt((G??0)+H,i.min,i.max));B.dataset.percent=`${K}${i.measure}`,k()}function $(){const B=Math.ceil((1-v.value)*100),G=Math.ceil((1-I.value)*100),H=Math.ceil((1-F.value)*100);return[B,G,H].sort((K,ne)=>K-ne)}function j(B){const G=kt(B,i.min,i.max);return Math.round((G+Number.EPSILON)*(1/i.step))/(1/i.step)}function U(B){o("update:modelValue",B)}function k(){const B=Number(V.value.right.substring(0,V.value.right.length-1)),G=Number(Z.value.right.substring(0,Z.value.right.length-1)),H=Number(J.value.right.substring(0,J.value.right.length-1)),K=[{r:B,th:d},{r:G,th:p},{r:H,th:h}].sort((ne,pe)=>ne.r-pe.r);K[0].th.value&&(K[0].th.value.dataset.hint="high"),K[1].th.value&&(K[1].th.value.dataset.hint="mid"),K[2].th.value&&(K[2].th.value.dataset.hint="low")}function x(B,G){["ArrowDown","ArrowUp","ArrowRight","ArrowLeft","Enter"].includes(B.code)&&B.preventDefault();const H=B.code==="ArrowUp"||B.code==="ArrowRight"?i.step*1:B.code==="ArrowDown"||B.code==="ArrowLeft"?i.step*-1:0,K=[...i.modelValue];K[G]=kt(K[G]+H,i.min,i.max),U(K),k()}return r.onMounted(()=>{k()}),(B,G)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass([i.disabled?"ui-slider__disabled":void 0,"ui-slider__envelope ui-slider__triple"])},[r.createElementVNode("div",{class:r.normalizeClass([`ui-slider__mode-${i.mode}`,"ui-slider"])},[r.createElementVNode("div",e1,[r.createElementVNode("div",t1,[B.label?(r.openBlock(),r.createElementBlock("label",n1,[r.createElementVNode("span",null,r.toDisplayString(B.label),1),G[3]||(G[3]=r.createTextVNode()),r.unref(n).tooltip?(r.openBlock(),r.createBlock(r.unref(Ct),{key:0,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.renderSlot(B.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0)]),G[11]||(G[11]=r.createTextVNode()),r.createElementVNode("div",r1,[r.createElementVNode("div",o1,[r.createElementVNode("div",{ref_key:"barRef",ref:c,class:"ui-slider__bar"},[r.createElementVNode("div",{class:"ui-slider__progress",style:r.normalizeStyle(P.value)},null,4)],512)]),G[10]||(G[10]=r.createTextVNode()),r.createElementVNode("div",i1,[i.breakpoints?(r.openBlock(!0),r.createElementBlock(r.Fragment,{key:0},r.renderList(r.unref(b),(H,K)=>(r.openBlock(),r.createElementBlock("div",{key:K,style:r.normalizeStyle({right:`${H}%`}),class:"ui-slider__thumb-step"},null,4))),128)):r.createCommentVNode("",!0),G[7]||(G[7]=r.createTextVNode()),r.createElementVNode("div",{ref_key:"thumbRef1",ref:d,style:r.normalizeStyle(V.value),"data-percent":i.modelValue[0]+"%",class:"ui-slider__thumb ui-slider__triple-thumb",r1:"",tabindex:"0",onKeydown:G[0]||(G[0]=H=>x(H,0))},G[4]||(G[4]=[r.createElementVNode("div",{class:"ui-slider__thumb-focused-contour"},null,-1)]),44,s1),G[8]||(G[8]=r.createTextVNode()),r.createElementVNode("div",{ref_key:"thumbRef2",ref:p,style:r.normalizeStyle(Z.value),"data-percent":i.modelValue[1]+"%",class:"ui-slider__thumb ui-slider__triple-thumb",r2:"",tabindex:"0",onKeydown:G[1]||(G[1]=H=>x(H,1))},G[5]||(G[5]=[r.createElementVNode("div",{class:"ui-slider__thumb-focused-contour"},null,-1)]),44,a1),G[9]||(G[9]=r.createTextVNode()),r.createElementVNode("div",{ref_key:"thumbRef3",ref:h,style:r.normalizeStyle(J.value),"data-percent":i.modelValue[2]+"%",class:"ui-slider__thumb ui-slider__triple-thumb",r3:"",tabindex:"0",onKeydown:G[2]||(G[2]=H=>x(H,2))},G[6]||(G[6]=[r.createElementVNode("div",{class:"ui-slider__thumb-focused-contour"},null,-1)]),44,l1)])])]),G[12]||(G[12]=r.createTextVNode()),G[13]||(G[13]=r.createElementVNode("div",{class:"ui-slider__input-wrapper d-flex"},null,-1))],2),G[14]||(G[14]=r.createTextVNode()),O.value?(r.openBlock(),r.createElementBlock("div",c1,r.toDisplayString(O.value),1)):r.createCommentVNode("",!0)],2))}}),u1={class:"ui-input-range__separator"},p1=r.defineComponent({__name:"InputRange",props:{modelValue:{},separator:{default:"-"}},emits:["update:modelValue","change"],setup(t,{emit:e}){const n=t,o=e,i=r.reactive({left:n.modelValue[0],right:n.modelValue[1]}),l=r.ref(!1),c=r.computed(()=>(l.value,"ui-input-range-focused")),d=r.computed({get(){return{left:Math.min(...n.modelValue),right:Math.max(...n.modelValue)}},set(){}});r.watch(()=>d.value,m=>(i.left=m.left)&&(i.right=m.right));function p(){o("update:modelValue",[+i.left,+i.right]),o("change",[+i.left,+i.right])}function h(m,y){const b=y.target.value;/^[0-9]{0,2}$/.test(b)?m?i.left=+b:i.right=+b:m?i.left=+b.slice(0,b.length-1):i.right=+b.slice(0,b.length-1)}return(m,y)=>(r.openBlock(),r.createElementBlock("div",r.mergeProps({class:[c.value,"ui-input-range"]},m.$attrs),[r.withDirectives(r.createElementVNode("input",{"onUpdate:modelValue":y[0]||(y[0]=b=>d.value.left=b),class:"text-s",type:"text",onChange:p,onFocus:y[1]||(y[1]=b=>l.value=!0),onFocusout:y[2]||(y[2]=b=>l.value=!1),onInput:y[3]||(y[3]=b=>h(!0,b))},null,544),[[r.vModelText,d.value.left]]),y[8]||(y[8]=r.createTextVNode()),r.createElementVNode("div",u1,r.toDisplayString(n.separator),1),y[9]||(y[9]=r.createTextVNode()),r.withDirectives(r.createElementVNode("input",{"onUpdate:modelValue":y[4]||(y[4]=b=>d.value.right=b),class:"text-s",type:"text",onChange:p,onFocus:y[5]||(y[5]=b=>l.value=!0),onFocusout:y[6]||(y[6]=b=>l.value=!1),onInput:y[7]||(y[7]=b=>h(!1,b))},null,544),[[r.vModelText,d.value.right]])],16))}}),h1={class:"ui-slider__wrapper"},f1={class:"ui-slider__label-section"},m1={key:0,class:"text-s"},g1={key:1,class:"ui-slider__value-static text-s"},y1={class:"ui-slider__base"},_1={class:"ui-slider__container"},C1={class:"ui-slider__container ui-slider__container-thumb"},v1={class:"ui-slider__input-wrapper d-flex"},w1={key:0,class:"ui-slider__error"},b1=r.defineComponent({__name:"SliderRange",props:{modelValue:{},min:{default:0},max:{},step:{default:1},label:{default:void 0},helper:{default:void 0},error:{default:void 0},mode:{default:"text"},measure:{default:""},breakpoints:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{emit:e}){const n=r.useSlots(),o=e,i=t,l=r.reactive({deltaValue1:0,deltaValue2:0}),c=r.ref(),d=r.ref(),p=r.ref(),h=r.ref(i.modelValue),m=r.ref(i.modelValue[0]),y=r.ref(i.modelValue[1]),b=r.computed(()=>i),w=Xl(b),S=r.computed(()=>[m.value,y.value].sort((k,x)=>k-x).join("-")),M=r.computed(()=>i.max-i.min),O=r.computed(()=>kt((i.modelValue[0]??0)+l.deltaValue1,i.min,i.max)),v=r.computed(()=>kt((i.modelValue[1]??0)+l.deltaValue2,i.min,i.max)),I=r.computed(()=>{const k=i.modelValue;return Array.isArray(k)&&k.length===2&&k.every(x=>Number.isFinite(x))?i.error:"Expected model [number, number]"}),F=r.computed(()=>(O.value-i.min)/M.value),W=r.computed(()=>(v.value-i.min)/M.value),P=r.computed(()=>ae()),V=r.computed(()=>({right:P.value[0]+"%",left:100-P.value[1]+"%"})),Z=r.computed(()=>({right:Math.ceil((1-F.value)*100)+"%"})),J=r.computed(()=>({right:Math.ceil((1-W.value)*100)+"%"}));r.watch(()=>i.modelValue,k=>{h.value=k,m.value=+k[0],y.value=+k[1]},{immediate:!0}),yr(d,k=>{var x;_t((x=r.unref(c))==null?void 0:x.getBoundingClientRect(),B=>{const{dx:G}=k;l.deltaValue1=G/B.width*M.value,m.value=$(kt((i.modelValue[0]??0)+l.deltaValue1,i.min,i.max)),h.value=[m.value,y.value].sort((H,K)=>H-K),k.stop&&(j([$(O.value),$(v.value)]),l.deltaValue1=0)})}),yr(p,k=>{var x;_t((x=r.unref(c))==null?void 0:x.getBoundingClientRect(),B=>{const{dx:G}=k;l.deltaValue2=G/B.width*M.value,y.value=$(kt((i.modelValue[1]??0)+l.deltaValue2,i.min,i.max)),h.value=[m.value,y.value].sort((H,K)=>H-K),k.stop&&(j([$(O.value),$(v.value)]),l.deltaValue2=0)})});function ae(){const k=Math.ceil((1-F.value)*100),x=Math.ceil((1-W.value)*100);return[k,x].sort((B,G)=>B-G)}function $(k){const x=kt(k,i.min,i.max);return Math.round((x+Number.EPSILON)*(1/i.step))/(1/i.step)}function j(k){o("update:modelValue",k)}function U(k,x){["ArrowDown","ArrowUp","ArrowRight","ArrowLeft","Enter"].includes(k.code)&&k.preventDefault();const B=k.code==="ArrowUp"||k.code==="ArrowRight"?i.step*1:k.code==="ArrowDown"||k.code==="ArrowLeft"?i.step*-1:0,G=[...i.modelValue];G[x]=kt(G[x]+B,i.min,i.max),j(G)}return(k,x)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass([i.disabled?"ui-slider__disabled":void 0,"ui-slider__envelope"])},[r.createElementVNode("div",{class:r.normalizeClass([`ui-slider__mode-${i.mode}`,"ui-slider"])},[r.createElementVNode("div",h1,[r.createElementVNode("div",f1,[k.label?(r.openBlock(),r.createElementBlock("label",m1,[r.createElementVNode("span",null,r.toDisplayString(k.label),1),x[3]||(x[3]=r.createTextVNode()),r.unref(n).tooltip?(r.openBlock(),r.createBlock(r.unref(Ct),{key:0,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.renderSlot(k.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0),x[4]||(x[4]=r.createTextVNode()),i.mode==="text"?(r.openBlock(),r.createElementBlock("div",g1,r.toDisplayString(S.value),1)):r.createCommentVNode("",!0)]),x[10]||(x[10]=r.createTextVNode()),r.createElementVNode("div",y1,[r.createElementVNode("div",_1,[r.createElementVNode("div",{ref_key:"barRef",ref:c,class:"ui-slider__bar"},[r.createElementVNode("div",{class:"ui-slider__progress",style:r.normalizeStyle(V.value)},null,4)],512)]),x[9]||(x[9]=r.createTextVNode()),r.createElementVNode("div",C1,[i.breakpoints?(r.openBlock(!0),r.createElementBlock(r.Fragment,{key:0},r.renderList(r.unref(w),(B,G)=>(r.openBlock(),r.createElementBlock("div",{key:G,style:r.normalizeStyle({right:`${B}%`}),class:"ui-slider__thumb-step"},null,4))),128)):r.createCommentVNode("",!0),x[7]||(x[7]=r.createTextVNode()),r.createElementVNode("div",{ref_key:"thumbRef1",ref:d,style:r.normalizeStyle(Z.value),class:"ui-slider__thumb",tabindex:"0",onKeydown:x[0]||(x[0]=B=>U(B,0))},x[5]||(x[5]=[r.createElementVNode("div",{class:"ui-slider__thumb-focused-contour"},null,-1)]),36),x[8]||(x[8]=r.createTextVNode()),r.createElementVNode("div",{ref_key:"thumbRef2",ref:p,style:r.normalizeStyle(J.value),class:"ui-slider__thumb",tabindex:"0",onKeydown:x[1]||(x[1]=B=>U(B,1))},x[6]||(x[6]=[r.createElementVNode("div",{class:"ui-slider__thumb-focused-contour"},null,-1)]),36)])])]),x[11]||(x[11]=r.createTextVNode()),r.createElementVNode("div",v1,[i.mode==="input"?(r.openBlock(),r.createBlock(p1,{key:0,modelValue:h.value,"onUpdate:modelValue":x[2]||(x[2]=B=>h.value=B),class:"ui-focused-border",onChange:j},null,8,["modelValue"])):r.createCommentVNode("",!0)])],2),x[12]||(x[12]=r.createTextVNode()),I.value?(r.openBlock(),r.createElementBlock("div",w1,r.toDisplayString(I.value),1)):r.createCommentVNode("",!0)],2))}}),x1=r.defineComponent({__name:"VScroll",props:{scrollTop:{},clientHeight:{},scrollHeight:{}},emits:["update:scrollTop"],setup(t,{emit:e}){const n=e,o=t,i=r.ref(),l=r.computed(()=>o.clientHeight/(o.scrollHeight||1)),c=r.computed(()=>l.value<1),d=r.computed(()=>{const p=r.unref(l);return{top:o.scrollTop*p+"px",height:Math.floor(o.clientHeight*p)+"px"}});return st(i,"pointerdown",p=>{const h={clientY:p.clientY},m=Gl(document,"mousemove",y=>{const b=(y.clientY-h.clientY)/l.value;n("update:scrollTop",o.scrollTop+b),h.clientY=y.clientY});["mouseup","pointercancel"].forEach(y=>{document.addEventListener(y,m,{once:!0})})}),(p,h)=>c.value?(r.openBlock(),r.createElementBlock("div",{key:0,ref_key:"scrollRef",ref:i,class:"v-scroll"},[r.createElementVNode("div",{class:"v-scroll__scrollbar",style:r.normalizeStyle(d.value)},null,4)],512)):r.createCommentVNode("",!0)}}),k1=r.defineComponent({__name:"HScroll",props:{scrollLeft:{},clientWidth:{},scrollWidth:{}},emits:["update:scrollLeft"],setup(t,{emit:e}){const n=e,o=t,i=r.ref(),l=r.computed(()=>o.clientWidth/(o.scrollWidth||1)),c=r.computed(()=>l.value<1),d=r.computed(()=>{const p=r.unref(l);return{left:o.scrollLeft*p+"px",width:Math.floor(o.clientWidth*p)+"px"}});return st(i,"pointerdown",p=>{const h={clientX:p.clientX},m=Gl(document,"mousemove",y=>{const b=(y.clientX-h.clientX)/l.value;n("update:scrollLeft",o.scrollLeft+b),h.clientX=y.clientX});["mouseup","pointercancel"].forEach(y=>{document.addEventListener(y,m,{once:!0})})}),(p,h)=>c.value?(r.openBlock(),r.createElementBlock("div",{key:0,ref_key:"scrollRef",ref:i,class:"h-scroll"},[r.createElementVNode("div",{class:"h-scroll__scrollbar",style:r.normalizeStyle(d.value)},null,4)],512)):r.createCommentVNode("",!0)}}),E1={class:"ui-scrollable"},S1=r.defineComponent({__name:"Scrollable",setup(t){const e=r.ref(),n=r.reactive({scrollTop:0,scrollLeft:0,clientHeight:0,clientWidth:0,scrollHeight:0,scrollWidth:0});function o(d){ww(n,d,"scrollTop","scrollLeft","clientHeight","clientWidth","scrollHeight","scrollWidth")}const i=d=>{d.preventDefault();const p=d.currentTarget;p.scrollTop+=d.deltaY,p.scrollLeft+=d.deltaX,o(p)};function l(d){_t(r.unref(e),p=>{p.scrollTop=d,o(p)})}function c(d){_t(r.unref(e),p=>{p.scrollLeft=d,o(p)})}return Kp(e,d=>{_t(d,p=>o(p))}),r.onMounted(()=>{_t(r.unref(e),d=>{o(d),d.addEventListener("wheel",i)})}),r.onUnmounted(()=>{_t(r.unref(e),d=>d.removeEventListener("wheel",i))}),(d,p)=>(r.openBlock(),r.createElementBlock("div",E1,[r.createElementVNode("div",{ref_key:"containerRef",ref:e,class:"ui-scrollable__container",onWheel:i},[r.renderSlot(d.$slots,"default")],544),p[2]||(p[2]=r.createTextVNode()),r.createVNode(x1,{"scroll-top":n.scrollTop,"client-height":n.clientHeight,"scroll-height":n.scrollHeight,onWheel:p[0]||(p[0]=r.withModifiers(()=>{},["stop"])),"onUpdate:scrollTop":l},null,8,["scroll-top","client-height","scroll-height"]),p[3]||(p[3]=r.createTextVNode()),r.createVNode(k1,{"scroll-left":n.scrollLeft,"client-width":n.clientWidth,"scroll-width":n.scrollWidth,onWheel:p[1]||(p[1]=r.withModifiers(()=>{},["stop"])),"onUpdate:scrollLeft":c},null,8,["scroll-left","client-width","scroll-width"])]))}}),T1="add.svg",N1="box.svg",V1="calendar.svg",A1="checkmark.svg",B1="clipboard.svg",P1="close.svg",R1="copy.svg",D1="download.svg",I1="duplicate.svg",F1="edit.svg",L1="error.svg",O1="filter.svg",M1="help.svg",G1="info.svg",$1="link.svg",z1="loading.svg",U1="lock.svg",Z1="maximize.svg",W1="minimize.svg",j1="minus.svg",H1="more.svg",q1="open.svg",K1="pause.svg",Y1="play.svg",X1="renew.svg",J1="restart.svg",Q1="reverse.svg",eT="settings.svg",tT="sort.svg",nT="stop.svg",rT="success.svg",oT="time.svg",iT="tune.svg",sT="warning.svg",aT="zip.svg",lT={add:T1,"arrow-down":"arrow-down.svg","arrow-left":"arrow-left.svg","arrow-link":"arrow-link.svg","arrow-right":"arrow-right.svg","arrow-up":"arrow-up.svg",box:N1,calendar:V1,"caret-down":"caret-down.svg","caret-left":"caret-left.svg","caret-right":"caret-right.svg","caret-up":"caret-up.svg","cell-type-num":"cell-type-num.svg","cell-type-txt":"cell-type-txt.svg",checkmark:A1,"chevron-down":"chevron-down.svg","chevron-first":"chevron-first.svg","chevron-last":"chevron-last.svg","chevron-left":"chevron-left.svg","chevron-right":"chevron-right.svg","chevron-up":"chevron-up.svg","clipboard-copied":"clipboard-copied.svg",clipboard:B1,close:P1,copy:R1,"data-dimentions":"data-dimentions.svg","delete-bin":"delete-bin.svg","delete-circle":"delete-circle.svg","delete-clear":"delete-clear.svg",download:D1,"drag-dots":"drag-dots.svg",duplicate:I1,edit:F1,error:L1,export:"export.svg","filter-on":"filter-on.svg",filter:O1,"help-outline":"help-outline.svg",help:M1,"info-outline":"info-outline.svg",info:G1,"jump-link":"jump-link.svg",link:$1,loading:z1,lock:U1,maximize:Z1,minimize:W1,minus:j1,more:H1,open:q1,"paper-clip":"paper-clip.svg",pause:K1,play:Y1,renew:X1,restart:J1,reverse:Q1,settings:eT,sort:tT,stop:nT,success:rT,time:oT,tune:iT,warning:sT,"x-axis":"x-axis.svg","y-axis":"y-axis.svg",zip:aT},cT="add.svg",dT="annotate.svg",uT="annotation.svg",pT="area.svg",hT="axes.svg",fT="bar.svg",mT="bindot.svg",gT="box.svg",yT="boxplot.svg",_T="bubble.svg",CT="calendar.svg",vT="canvas.svg",wT="checkbox.svg",bT="checkmark.svg",xT="clipboard.svg",kT="close.svg",ET="cluster.svg",ST="code.svg",TT="color.svg",NT="columns.svg",VT="container.svg",AT="cookie.svg",BT="copy.svg",PT="cpu.svg",RT="debug.svg",DT="dna.svg",IT="download.svg",FT="duplicate.svg",LT="edit.svg",OT="error.svg",MT="filter.svg",GT="generate.svg",$T="graph.svg",zT="heatmap.svg",UT="help.svg",ZT="info.svg",WT="jitter.svg",jT="lasso.svg",HT="layers.svg",qT="learn.svg",KT="legend.svg",YT="line.svg",XT="link.svg",JT="loading.svg",QT="lock.svg",eN="maximize.svg",tN="menu.svg",nN="minimize.svg",rN="minus.svg",oN="more.svg",iN="pause.svg",sN="pin.svg",aN="play.svg",lN="product.svg",cN="publications.svg",dN="renew.svg",uN="restart.svg",pN="reverse.svg",hN="search.svg",fN="server.svg",mN="settings.svg",gN="sina.svg",yN="skatterplot.svg",_N="slice.svg",CN="sort.svg",vN="statistics.svg",wN="stop.svg",bN="success.svg",xN="table.svg",kN="template.svg",EN="terminal.svg",SN="time.svg",TN="tune.svg",NN="venn.svg",VN="violin.svg",AN="warning.svg",BN="wetlab.svg",PN="zip.svg",RN={"add-layer":"add-layer.svg",add:cT,"align-center":"align-center.svg","align-left":"align-left.svg","align-right":"align-right.svg",annotate:dT,annotation:uT,area:pT,"arrow-down":"arrow-down.svg","arrow-left":"arrow-left.svg","arrow-link":"arrow-link.svg","arrow-right":"arrow-right.svg","arrow-up":"arrow-up.svg",axes:hT,"bar-cross":"bar-cross.svg","bar-error":"bar-error.svg","bar-stacked":"bar-stacked.svg","bar-trend":"bar-trend.svg",bar:fT,bindot:mT,box:gT,"boxplot-binned":"boxplot-binned.svg","boxplot-jitter":"boxplot-jitter.svg","boxplot-notched":"boxplot-notched.svg",boxplot:yT,bubble:_T,calendar:CT,canvas:vT,"cell-type-num":"cell-type-num.svg","cell-type-txt":"cell-type-txt.svg","checkbox-checked":"checkbox-checked.svg","checkbox-intermediate":"checkbox-intermediate.svg",checkbox:wT,checkmark:bT,"chevron-down":"chevron-down.svg","chevron-first":"chevron-first.svg","chevron-last":"chevron-last.svg","chevron-left":"chevron-left.svg","chevron-right":"chevron-right.svg","chevron-sort":"chevron-sort.svg","chevron-up":"chevron-up.svg","clipboard-copied":"clipboard-copied.svg",clipboard:xT,close:kT,"cloud-download":"cloud-download.svg","cloud-offline":"cloud-offline.svg","cloud-online":"cloud-online.svg","cloud-upload":"cloud-upload.svg",cluster:ET,code:ST,"color-fill":"color-fill.svg","color-none":"color-none.svg","color-stroke":"color-stroke.svg",color:TT,columns:NT,"connected-points":"connected-points.svg",container:VT,cookie:AT,copy:BT,cpu:PT,"data-dimentions":"data-dimentions.svg",debug:RT,"delete-bin":"delete-bin.svg","delete-circle":"delete-circle.svg","delete-clear":"delete-clear.svg","dendrogram-X-line":"dendrogram-X-line.svg","dendrogram-X":"dendrogram-X.svg","dendrogram-Y-line":"dendrogram-Y-line.svg","dendrogram-Y":"dendrogram-Y.svg","dna-add":"dna-add.svg","dna-import":"dna-import.svg",dna:DT,download:IT,"drag-dots":"drag-dots.svg","drag-horizontal":"drag-horizontal.svg","drag-vertical":"drag-vertical.svg",duplicate:FT,edit:LT,"error-bar":"error-bar.svg",error:OT,"expand-left":"expand-left.svg","expand-right":"expand-right.svg",export:"export.svg","file-doc-add":"file-doc-add.svg","file-doc-download":"file-doc-download.svg","file-doc-import":"file-doc-import.svg","file-doc":"file-doc.svg","filter-on":"filter-on.svg",filter:MT,"fire-tips":"fire-tips.svg","folder-parent":"folder-parent.svg","frame-type-all":"frame-type-all.svg","frame-type-bottom":"frame-type-bottom.svg","frame-type-left-bottom":"frame-type-left-bottom.svg","frame-type-left":"frame-type-left.svg","frame-type-none":"frame-type-none.svg",generate:GT,graph:$T,heatmap:zT,"help-outline":"help-outline.svg",help:UT,"info-outline":"info-outline.svg",info:ZT,jitter:WT,"jump-link":"jump-link.svg",lasso:jT,layers:HT,learn:qT,"legend-box-dot":"legend-box-dot.svg","legend-box":"legend-box.svg",legend:KT,"line-binned":"line-binned.svg","line-error":"line-error.svg","line-jitter":"line-jitter.svg",line:YT,"linetype-dashed":"linetype-dashed.svg","linetype-dotdash":"linetype-dotdash.svg","linetype-dotted":"linetype-dotted.svg","linetype-longdash":"linetype-longdash.svg","linetype-solid":"linetype-solid.svg","linetype-twodash":"linetype-twodash.svg","link-disabled":"link-disabled.svg",link:XT,loading:JT,lock:QT,maximize:eN,menu:tN,minimize:nN,minus:rN,more:oN,"paper-clip":"paper-clip.svg",pause:iN,pin:sN,play:aN,"position-bottom-annotation":"position-bottom-annotation.svg","position-bottom":"position-bottom.svg","position-left-annotation":"position-left-annotation.svg","position-left":"position-left.svg","position-right-annotation":"position-right-annotation.svg","position-right":"position-right.svg","position-top-annotation":"position-top-annotation.svg","position-top":"position-top.svg",product:lN,publications:cN,"radio-button-checked":"radio-button-checked.svg","radio-button":"radio-button.svg",renew:dN,restart:uN,reverse:pN,"rotation-0":"rotation-0.svg","rotation-45":"rotation-45.svg","rotation-90":"rotation-90.svg",search:hN,"server-on":"server-on.svg",server:fN,settings:mN,sina:gN,skatterplot:yN,slice:_N,"social-github":"social-github.svg","social-linkedin":"social-linkedin.svg","social-twitter-X":"social-twitter-X.svg","social-twitter-bird":"social-twitter-bird.svg","social-youtube":"social-youtube.svg","sort-list-down":"sort-list-down.svg","sort-list-up":"sort-list-up.svg",sort:CN,statistics:vN,stop:wN,"strip-plot":"strip-plot.svg",success:bN,"table-add":"table-add.svg","table-alias":"table-alias.svg","table-import":"table-import.svg",table:xN,template:kN,terminal:EN,"text-align-center":"text-align-center.svg","text-align-left":"text-align-left.svg","text-align-right":"text-align-right.svg","theme-dark":"theme-dark.svg","theme-light":"theme-light.svg",time:SN,tune:TN,venn:NN,"view-hide":"view-hide.svg","view-show":"view-show.svg","violin-binned":"violin-binned.svg","violin-jitter":"violin-jitter.svg",violin:VN,warning:AN,wetlab:BN,"windows-collapse":"windows-collapse.svg","windows-expand":"windows-expand.svg","x-axis":"x-axis.svg","y-axis":"y-axis.svg",zip:PN,"zoom-in":"zoom-in.svg","zoom-out":"zoom-out.svg"};function DN(){return{txtSec:{title:"Text",data:{"--txt-00":{light:[!1,!1],value:["#FFFFFF","#FFFFFF"],description:"Text on the colored elements"},"--txt-01":{light:[!0,!1],value:["#110529","#FFFFFF"],description:"Primary text layer"},"--txt-02":{light:[!0,!1],value:["#231842","#ADAEB8"],description:"Secondary text layer - large arrays of text"},"--txt-03":{light:[!0,!0],value:["#9D9EAE","#60616B"],description:"Tetritary text layer - hints and descriptions"},"--txt-mask":{light:[!1,!0],value:["#CFD1DB","#3D3D42"],description:"Text mask in inputs, icons, etc."},"--txt-focus":{light:[!0,!0],value:["#07AD3E","#87E087"],description:"Colored text in active/focus elements"},"--txt-error":{light:[!0,!0],value:["#F1222F","#FF5C5C"],description:"Colored text in error elements"},"--txt-link":{light:[!0,!0],value:["#5F31CC","#9470FF"],description:"Colored text in links"}}},iconSec:{title:"Icon",data:{"--ic-00":{light:[!1,!1],value:["#FFFFFF","#FFFFFF"],description:"Icons on colored elements"},"--ic-01":{light:[!0,!1],value:["#110529","#FFFFFF"],description:"Primary elements"},"--ic-02":{light:[!1,!0],value:["#CFD1DB","#60616B"],description:"Secondary & tetritary elements"},"--ic-accent":{light:[!0,!1],value:["#07AD3E","#87E087"],description:"Focus/active elements"}}},borderSec:{title:"Border",data:{"--border-color-default":{light:[!0,!0],value:["#110529","#60616B"],description:"Main border for components"},"--border-color-hover":{light:[!0,!0],value:["#231842","#ADAEB8"],description:"Hover on main border"},"--border-color-focus":{light:[!1,!1],value:["#49CC49","#49CC49"],description:"Active border for components"},"--border-color-error":{light:[!1,!1],value:["#FF5C5C","#FF5C5C"],description:"Error border for components"},"--border-color-div-grey":{light:[!1,!0],value:["#E1E3EB","#232329"],description:"Divider lines low contrast"},"--border-color-div-bw":{light:[!1,!0],value:["#FFFFFF","#000000"],description:"Divider lines hight contrast"}}},btnSec:{title:"Button",data:{"--btn-accent-default":{light:[!0,!0],value:["#845CFF"," #5F31CC"],description:"Accent coloured button"},"--btn-accent-hover":{light:[!0,!0],value:["#9470FF"," #5F31CC"],description:"Hover on accent coloured button"},"--btn-accent-press":{light:[!0,!0],value:["#6F4DD6","#5F31CC"],description:"Pressed on accent coloured button"},"--btn-primary-default":{light:[!0,!0],value:["#110529","#5F31CC"],description:"Primary button"},"--btn-primary-hover":{light:[!0,!0],value:["#231842","#6D3DDB"],description:"Hover on primary button"},"--btn-primary-press":{light:[!0,!0],value:["#080214","#5328B8"],description:"Hover on primary button"},"--btn-sec-hover-white":{light:[!1,!0],value:["rgba(255, 255, 255, 0.50)","rgba(131, 131, 163, 0.16)"],description:"Hover background on transparent button"},"--btn-sec-hover-grey":{light:[!1,!0],value:["rgba(155, 171, 204, 0.16)","rgba(131, 131, 163, 0.16)"],description:"Hover background on ghost button & icons"},"--btn-sec-press-grey":{light:[!1,!0],value:["rgba(155, 171, 204, 0.24)","rgba(131, 131, 163, 0.24)"],description:"Hover background on ghost button & icons"},"--btn-active-select":{light:[!1,!0],value:["rgba(99, 224, 36, 0.24)","rgba(99, 224, 36, 0.24)"],description:"Fill on selected elements"},"--btn-switcher":{light:[!1,!0],value:["linear-gradient(180deg, #A1E59C 0%, #D0F5B0 100%)","#5E5E70"],description:"Gradient on active controll/switcher element"}}},disSec:{title:"Disable",data:{"--dis-00":{light:[!1,!0],value:["#FFFFFF","#65656B"],description:"Elements on dis-01, labels, texts, icons"},"--dis-01":{light:[!1,!0],value:["#CFD1DB","#3D3D42"],description:"Buttons, borders, labels, texts, icons"}}},bgSec:{title:"Background",data:{"--bg-base-dark":{light:[!0,!0],value:["#110529","#0D0D0F"],description:"Default dark block background"},"--bg-base-light":{light:[!1,!0],value:["#F7F8FA","#0D0D0F"],description:"Default light block background"},"--bg-elevated-01":{light:[!1,!0],value:["#FFFFFF","#1B1B1F"],description:"Default block background"},"--bg-elevated-02":{light:[!1,!0],value:["#E1E3EB","#2D2D33"],description:"Secondary block background"}}},filledSec:{title:"Filled",data:{"--filled-V-BG":{light:[!1,!0],value:["#D0F0C0","rgba(66, 184, 66, 0.40)"],description:"Text background selection on V-read"},"--filled-D-BG":{light:[!1,!0],value:["#FFCECC","rgba(229, 83, 229, 0.40)"],description:"Text background selection on D-read"},"--filled-N-BG":{light:[!1,!0],value:["#FAF5AA","rgba(83, 82, 102, 0.40)"],description:"Text background selection on C/N-read"},"--filled-J-BG":{light:[!1,!0],value:["#DEDBFF","rgba(132, 92, 255, 0.40)"],description:"Text background selection on J-read"}}},notificationSec:{title:"Notification",data:{"--notification-neutral":{light:[!1,!0],value:["linear-gradient(90deg, #D6D9FF 0%, #FFF 100%)","linear-gradient(90deg, #4D4D8F 0%, #292933 100%)"],description:"Background on neutral blocks"},"--notification-success":{light:[!1,!0],value:["linear-gradient(90deg, #C9F0B6 0%, #FFF 100%)","linear-gradient(90deg, #305C3E 0%, #292933 100%)"],description:"Background on success blocks"},"--notification-warning":{light:[!1,!0],value:["linear-gradient(90deg, #FEE0A3 0%, #FFF 100%)","linear-gradient(90deg, #754F2D 0%, #292933 100%)"],description:"Background on warning blocks"},"--notification-error":{light:[!1,!0],value:["linear-gradient(90deg, #FFB8B8 0%, #FFF 100%)","linear-gradient(90deg, #8F3343 0%, #292933 100%)"],description:"Background on error blocks"}}},gradientSec:{title:"Gradient",data:{"--gradient-blue-green":{light:[!0,!0],value:["linear-gradient(0deg, #478063 0%, #2E4652 45.93%, #24223D 91.63%)","linear-gradient(0deg, #478063 0%, #2E4652 45.93%, #24223D 91.63%)"],description:"Main brand dark gradient"},"--gradient-green-lime":{light:[!1,!0],value:["linear-gradient(180deg, #A1E59C 0%, #D0F5B0 100%)","linear-gradient(0deg, #478063 0%, #2E4652 45.93%, #24223D 91.63%)"],description:"Main brand light gradient"},"--gradient-blue-violet":{light:[!1,!0],value:["linear-gradient(180deg, #ADB8FF 0%, #D6E9FF 100%)","linear-gradient(0deg, #478063 0%, #2E4652 45.93%, #24223D 91.63%)"],description:"Main brand light gradient"},"--gradient-blue-clear":{light:[!1,!0],value:["linear-gradient(180deg, #85BEFF 0%, #CEF 100%)","linear-gradient(0deg, #478063 0%, #2E4652 45.93%, #24223D 91.63%)"],description:"Additional brand gradient"},"--gradient-orange":{light:[!1,!0],value:["linear-gradient(180deg, #FFB766 0%, #FFEAA3 100%)","linear-gradient(0deg, #478063 0%, #2E4652 45.93%, #24223D 91.63%)"],description:"Additional brand gradient"},"--gradient-mint":{light:[!1,!0],value:["linear-gradient(180deg, #7DD1D1 0%, #C8FAE9 100%)","linear-gradient(0deg, #478063 0%, #2E4652 45.93%, #24223D 91.63%)"],description:"Additional brand gradient"},"--gradient-lime":{light:[!1,!0],value:["linear-gradient(180deg, #BFE062 0%, #E4FFAD 100%)","linear-gradient(0deg, #478063 0%, #2E4652 45.93%, #24223D 91.63%)"],description:"Additional brand gradient"},"--gradient-rose":{light:[!1,!0],value:["linear-gradient(0deg, #FFDDD6 0%, #FF99C9 100%)","linear-gradient(0deg, #478063 0%, #2E4652 45.93%, #24223D 91.63%)"],description:"Additional brand gradient"},"--gradient-red":{light:[!1,!0],value:["linear-gradient(0deg, #FFD5CC 0%, #FF9494 100%)","linear-gradient(0deg, #478063 0%, #2E4652 45.93%, #24223D 91.63%)"],description:"Additional brand gradient"},"--gradient-violet":{light:[!1,!0],value:["linear-gradient(180deg, #BCA3FF 0%, #E5E5FF 100%)","linear-gradient(0deg, #478063 0%, #2E4652 45.93%, #24223D 91.63%)"],description:"Additional brand gradient"}}}}}const IN=["add","arrow-down","arrow-left","arrow-link","arrow-right","arrow-up","box","calendar","caret-down","caret-left","caret-right","caret-up","cell-type-num","cell-type-txt","checkmark","chevron-down","chevron-first","chevron-last","chevron-left","chevron-right","chevron-up","clipboard-copied","clipboard","close","copy","data-dimentions","delete-bin","delete-circle","delete-clear","download","drag-dots","duplicate","edit","error","export","filter-on","filter","help-outline","help","info-outline","info","jump-link","link","loading","lock","maximize","minimize","minus","more","open","paper-clip","pause","play","renew","restart","reverse","settings","sort","stop","success","time","tune","warning","x-axis","y-axis","zip"],FN=["add-layer","add","align-center","align-left","align-right","annotate","annotation","area","arrow-down","arrow-left","arrow-link","arrow-right","arrow-up","axes","bar-cross","bar-error","bar-stacked","bar-trend","bar","bindot","box","boxplot-binned","boxplot-jitter","boxplot-notched","boxplot","bubble","calendar","canvas","cell-type-num","cell-type-txt","checkbox-checked","checkbox-intermediate","checkbox","checkmark","chevron-down","chevron-first","chevron-last","chevron-left","chevron-right","chevron-sort","chevron-up","clipboard-copied","clipboard","close","cloud-download","cloud-offline","cloud-online","cloud-upload","cluster","code","color-fill","color-none","color-stroke","color","columns","connected-points","container","cookie","copy","cpu","data-dimentions","debug","delete-bin","delete-circle","delete-clear","dendrogram-X-line","dendrogram-X","dendrogram-Y-line","dendrogram-Y","dna-add","dna-import","dna","download","drag-dots","drag-horizontal","drag-vertical","duplicate","edit","error-bar","error","expand-left","expand-right","export","file-doc-add","file-doc-download","file-doc-import","file-doc","filter-on","filter","fire-tips","folder-parent","frame-type-all","frame-type-bottom","frame-type-left-bottom","frame-type-left","frame-type-none","generate","graph","heatmap","help-outline","help","info-outline","info","jitter","jump-link","lasso","layers","learn","legend-box-dot","legend-box","legend","line-binned","line-error","line-jitter","line","linetype-dashed","linetype-dotdash","linetype-dotted","linetype-longdash","linetype-solid","linetype-twodash","link-disabled","link","loading","lock","maximize","menu","minimize","minus","more","paper-clip","pause","pin","play","position-bottom-annotation","position-bottom","position-left-annotation","position-left","position-right-annotation","position-right","position-top-annotation","position-top","product","publications","radio-button-checked","radio-button","renew","restart","reverse","rotation-0","rotation-45","rotation-90","search","server-on","server","settings","sina","skatterplot","slice","social-github","social-linkedin","social-twitter-X","social-twitter-bird","social-youtube","sort-list-down","sort-list-up","sort","statistics","stop","strip-plot","success","table-add","table-alias","table-import","table","template","terminal","text-align-center","text-align-left","text-align-right","theme-dark","theme-light","time","tune","venn","view-hide","view-show","violin-binned","violin-jitter","violin","warning","wetlab","windows-collapse","windows-expand","x-axis","y-axis","zip","zoom-in","zoom-out"],LN={allCssVariables:DN(),icons16:lT,icons24:RN},ON={class:"block__not-found"},MN=r.defineComponent({__name:"NotFound",setup(t){const n=vl().useApp(),o=()=>{n.updateNavigationState(i=>{i.href="/"})};return(i,l)=>(r.openBlock(),r.createElementBlock("div",ON,[r.createElementVNode("h1",null,"Not found route: "+r.toDisplayString(r.unref(n).snapshot.navigationState.href),1),r.createVNode(r.unref(Rl),{onClick:r.withModifiers(o,["stop"])},{default:r.withCtx(()=>l[0]||(l[0]=[r.createTextVNode("Return to main page")])),_:1})]))}}),Jl=(t,e)=>{const n=t.__vccOpts||t;for(const[o,i]of e)n[o]=i;return n},GN={},$N={class:"block__loader-page"};function zN(t,e){return r.openBlock(),r.createElementBlock("div",$N,e[0]||(e[0]=[r.createElementVNode("div",{class:"loader-container"},[r.createElementVNode("i",{class:"mask-24 mask-loading loader-icon"})],-1)]))}const UN=Jl(GN,[["render",zN]]),ZN={class:"pl-app-notification-alert"},WN={class:"pl-app-notification-alert__content"},jN={class:"pl-app-notification-alert__title"},HN=r.defineComponent({__name:"PlAppErrorNotificationAlert",props:{errors:{}},setup(t){const e=t,n=r.ref(!1),o=r.ref(!0),i=r.computed(()=>Object.entries(e.errors).filter(c=>!!c[1]));function l(){n.value=!0}return r.watch(()=>e.errors,c=>{o.value=Object.values(c).some(d=>!!d)},{immediate:!0,deep:!0}),(c,d)=>(r.openBlock(),r.createElementBlock("div",ZN,[r.createVNode(r.unref(Zl),{modelValue:n.value,"onUpdate:modelValue":d[0]||(d[0]=p=>n.value=p),width:"720px",style:{"max-height":"100vh"}},{title:r.withCtx(()=>d[2]||(d[2]=[r.createTextVNode(" Errors ")])),default:r.withCtx(()=>[r.createElementVNode("div",WN,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(i.value,p=>{var h;return r.openBlock(),r.createElementBlock("div",{key:p[0],class:"pl-app-notification-alert__item"},[r.createElementVNode("div",jN,r.toDisplayString(p[0]),1),r.createVNode(r.unref(Ep),{value:(h=p[1])==null?void 0:h.message},null,8,["value"])])}),128))])]),_:1},8,["modelValue"]),r.createVNode(r.unref(Hp),{modelValue:o.value,"onUpdate:modelValue":d[1]||(d[1]=p=>o.value=p),type:"error",closable:""},{actions:r.withCtx(()=>[r.createVNode(r.unref(Ts),{icon:"arrow-right",onClick:l},{default:r.withCtx(()=>d[3]||(d[3]=[r.createTextVNode("See errors")])),_:1}),r.createVNode(r.unref(dp))]),default:r.withCtx(()=>[d[4]||(d[4]=r.createTextVNode(" Some outputs have errors. "))]),_:1},8,["modelValue"])]))}}),qN={key:0,class:"block__loader"},KN=r.defineComponent({__name:"BlockLoader",props:{value:{type:[Boolean,Number]}},setup(t){const e=t,n=r.computed(()=>typeof e.value=="boolean"&&e.value),o=r.computed(()=>{const i=e.value;if(typeof i=="number")return i>=1?void 0:(i*100).toFixed(2)+"%"});return(i,l)=>n.value?(r.openBlock(),r.createElementBlock("div",qN)):o.value!==void 0?(r.openBlock(),r.createElementBlock("div",{key:1,class:"block__progress",style:r.normalizeStyle({"--progress-width":o.value})},null,4)):r.createCommentVNode("",!0)}}),YN={class:"block block__layout"},XN={key:0},JN=r.defineComponent({__name:"BlockLayout",setup(t){const e=vl(),n=h=>{try{return new URL(h,"http://dummy").pathname}catch{console.error("Invalid href",h);return}},o=r.computed(()=>e.loaded?e.useApp().href:void 0),i=r.computed(()=>{if(e.loaded){const h=e.useApp(),m=n(h.snapshot.navigationState.href);return m?h.getRoute(m):void 0}}),l=r.computed(()=>e.loaded?e.useApp():void 0),c=r.computed(()=>l.value?l.value.model.outputErrors:{}),d=r.computed(()=>{var h;return((h=l.value)==null?void 0:h.showErrorsNotification)??!0}),p=r.computed(()=>{var h,m;return(m=(h=l.value)==null?void 0:h.progress)==null?void 0:m.call(h)});return(h,m)=>(r.openBlock(),r.createElementBlock("div",YN,[r.createVNode(KN,{value:p.value},null,8,["value"]),r.unref(e).error?(r.openBlock(),r.createElementBlock("div",XN,r.toDisplayString(r.unref(e).error),1)):r.unref(e).loaded?i.value?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(i.value),{key:o.value})):(r.openBlock(),r.createBlock(MN,{key:3})):(r.openBlock(),r.createBlock(UN,{key:1},{default:r.withCtx(()=>m[0]||(m[0]=[r.createTextVNode("Loading...")])),_:1})),r.unref(e).loaded&&d.value?(r.openBlock(),r.createBlock(r.unref(HN),{key:4,errors:c.value},null,8,["errors"])):r.createCommentVNode("",!0)]))}});var zs={exports:{}};/**
66
66
  * @license
67
67
  * Lodash <https://lodash.com/>
68
68
  * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
69
69
  * Released under MIT license <https://lodash.com/license>
70
70
  * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
71
71
  * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
72
- */$s.exports,function(t,e){(function(){var n,o="4.17.21",i=200,l="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",c="Expected a function",d="Invalid `variable` option passed into `_.template`",p="__lodash_hash_undefined__",h=500,m="__lodash_placeholder__",y=1,b=2,w=4,S=1,M=2,O=1,C=2,I=4,F=8,W=16,P=32,V=64,Z=128,J=256,ae=512,$=30,j="...",U=800,k=16,x=1,B=2,G=3,H=1/0,K=9007199254740991,ne=17976931348623157e292,pe=NaN,ke=4294967295,Ee=ke-1,He=ke>>>1,Dt=[["ary",Z],["bind",O],["bindKey",C],["curry",F],["curryRight",W],["flip",ae],["partial",P],["partialRight",V],["rearg",J]],Ke="[object Arguments]",Un="[object Array]",eP="[object AsyncFunction]",zi="[object Boolean]",Ui="[object Date]",tP="[object DOMException]",ea="[object Error]",ta="[object Function]",Wh="[object GeneratorFunction]",Nn="[object Map]",Zi="[object Number]",nP="[object Null]",Qn="[object Object]",jh="[object Promise]",rP="[object Proxy]",Wi="[object RegExp]",Vn="[object Set]",ji="[object String]",na="[object Symbol]",oP="[object Undefined]",Hi="[object WeakMap]",iP="[object WeakSet]",qi="[object ArrayBuffer]",Do="[object DataView]",vc="[object Float32Array]",Cc="[object Float64Array]",wc="[object Int8Array]",bc="[object Int16Array]",xc="[object Int32Array]",kc="[object Uint8Array]",Ec="[object Uint8ClampedArray]",Sc="[object Uint16Array]",Tc="[object Uint32Array]",sP=/\b__p \+= '';/g,aP=/\b(__p \+=) '' \+/g,lP=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Hh=/&(?:amp|lt|gt|quot|#39);/g,qh=/[&<>"']/g,cP=RegExp(Hh.source),dP=RegExp(qh.source),uP=/<%-([\s\S]+?)%>/g,pP=/<%([\s\S]+?)%>/g,Kh=/<%=([\s\S]+?)%>/g,hP=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,fP=/^\w*$/,mP=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Nc=/[\\^$.*+?()[\]{}|]/g,gP=RegExp(Nc.source),Vc=/^\s+/,yP=/\s/,_P=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,vP=/\{\n\/\* \[wrapped with (.+)\] \*/,CP=/,? & /,wP=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,bP=/[()=,{}\[\]\/\s]/,xP=/\\(\\)?/g,kP=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Yh=/\w*$/,EP=/^[-+]0x[0-9a-f]+$/i,SP=/^0b[01]+$/i,TP=/^\[object .+?Constructor\]$/,NP=/^0o[0-7]+$/i,VP=/^(?:0|[1-9]\d*)$/,AP=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ra=/($^)/,BP=/['\n\r\u2028\u2029\\]/g,oa="\\ud800-\\udfff",PP="\\u0300-\\u036f",RP="\\ufe20-\\ufe2f",DP="\\u20d0-\\u20ff",Xh=PP+RP+DP,Jh="\\u2700-\\u27bf",Qh="a-z\\xdf-\\xf6\\xf8-\\xff",IP="\\xac\\xb1\\xd7\\xf7",FP="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",LP="\\u2000-\\u206f",OP=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",ef="A-Z\\xc0-\\xd6\\xd8-\\xde",tf="\\ufe0e\\ufe0f",nf=IP+FP+LP+OP,Ac="['’]",MP="["+oa+"]",rf="["+nf+"]",ia="["+Xh+"]",of="\\d+",GP="["+Jh+"]",sf="["+Qh+"]",af="[^"+oa+nf+of+Jh+Qh+ef+"]",Bc="\\ud83c[\\udffb-\\udfff]",$P="(?:"+ia+"|"+Bc+")",lf="[^"+oa+"]",Pc="(?:\\ud83c[\\udde6-\\uddff]){2}",Rc="[\\ud800-\\udbff][\\udc00-\\udfff]",Io="["+ef+"]",cf="\\u200d",df="(?:"+sf+"|"+af+")",zP="(?:"+Io+"|"+af+")",uf="(?:"+Ac+"(?:d|ll|m|re|s|t|ve))?",pf="(?:"+Ac+"(?:D|LL|M|RE|S|T|VE))?",hf=$P+"?",ff="["+tf+"]?",UP="(?:"+cf+"(?:"+[lf,Pc,Rc].join("|")+")"+ff+hf+")*",ZP="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",WP="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",mf=ff+hf+UP,jP="(?:"+[GP,Pc,Rc].join("|")+")"+mf,HP="(?:"+[lf+ia+"?",ia,Pc,Rc,MP].join("|")+")",qP=RegExp(Ac,"g"),KP=RegExp(ia,"g"),Dc=RegExp(Bc+"(?="+Bc+")|"+HP+mf,"g"),YP=RegExp([Io+"?"+sf+"+"+uf+"(?="+[rf,Io,"$"].join("|")+")",zP+"+"+pf+"(?="+[rf,Io+df,"$"].join("|")+")",Io+"?"+df+"+"+uf,Io+"+"+pf,WP,ZP,of,jP].join("|"),"g"),XP=RegExp("["+cf+oa+Xh+tf+"]"),JP=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,QP=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],eR=-1,Qe={};Qe[vc]=Qe[Cc]=Qe[wc]=Qe[bc]=Qe[xc]=Qe[kc]=Qe[Ec]=Qe[Sc]=Qe[Tc]=!0,Qe[Ke]=Qe[Un]=Qe[qi]=Qe[zi]=Qe[Do]=Qe[Ui]=Qe[ea]=Qe[ta]=Qe[Nn]=Qe[Zi]=Qe[Qn]=Qe[Wi]=Qe[Vn]=Qe[ji]=Qe[Hi]=!1;var Xe={};Xe[Ke]=Xe[Un]=Xe[qi]=Xe[Do]=Xe[zi]=Xe[Ui]=Xe[vc]=Xe[Cc]=Xe[wc]=Xe[bc]=Xe[xc]=Xe[Nn]=Xe[Zi]=Xe[Qn]=Xe[Wi]=Xe[Vn]=Xe[ji]=Xe[na]=Xe[kc]=Xe[Ec]=Xe[Sc]=Xe[Tc]=!0,Xe[ea]=Xe[ta]=Xe[Hi]=!1;var tR={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},nR={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},rR={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},oR={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},iR=parseFloat,sR=parseInt,gf=typeof Ko=="object"&&Ko&&Ko.Object===Object&&Ko,aR=typeof self=="object"&&self&&self.Object===Object&&self,Ct=gf||aR||Function("return this")(),Ic=e&&!e.nodeType&&e,eo=Ic&&!0&&t&&!t.nodeType&&t,yf=eo&&eo.exports===Ic,Fc=yf&&gf.process,rn=function(){try{var R=eo&&eo.require&&eo.require("util").types;return R||Fc&&Fc.binding&&Fc.binding("util")}catch{}}(),_f=rn&&rn.isArrayBuffer,vf=rn&&rn.isDate,Cf=rn&&rn.isMap,wf=rn&&rn.isRegExp,bf=rn&&rn.isSet,xf=rn&&rn.isTypedArray;function Yt(R,q,z){switch(z.length){case 0:return R.call(q);case 1:return R.call(q,z[0]);case 2:return R.call(q,z[0],z[1]);case 3:return R.call(q,z[0],z[1],z[2])}return R.apply(q,z)}function lR(R,q,z,de){for(var Te=-1,Ze=R==null?0:R.length;++Te<Ze;){var pt=R[Te];q(de,pt,z(pt),R)}return de}function on(R,q){for(var z=-1,de=R==null?0:R.length;++z<de&&q(R[z],z,R)!==!1;);return R}function cR(R,q){for(var z=R==null?0:R.length;z--&&q(R[z],z,R)!==!1;);return R}function kf(R,q){for(var z=-1,de=R==null?0:R.length;++z<de;)if(!q(R[z],z,R))return!1;return!0}function Vr(R,q){for(var z=-1,de=R==null?0:R.length,Te=0,Ze=[];++z<de;){var pt=R[z];q(pt,z,R)&&(Ze[Te++]=pt)}return Ze}function sa(R,q){var z=R==null?0:R.length;return!!z&&Fo(R,q,0)>-1}function Lc(R,q,z){for(var de=-1,Te=R==null?0:R.length;++de<Te;)if(z(q,R[de]))return!0;return!1}function tt(R,q){for(var z=-1,de=R==null?0:R.length,Te=Array(de);++z<de;)Te[z]=q(R[z],z,R);return Te}function Ar(R,q){for(var z=-1,de=q.length,Te=R.length;++z<de;)R[Te+z]=q[z];return R}function Oc(R,q,z,de){var Te=-1,Ze=R==null?0:R.length;for(de&&Ze&&(z=R[++Te]);++Te<Ze;)z=q(z,R[Te],Te,R);return z}function dR(R,q,z,de){var Te=R==null?0:R.length;for(de&&Te&&(z=R[--Te]);Te--;)z=q(z,R[Te],Te,R);return z}function Mc(R,q){for(var z=-1,de=R==null?0:R.length;++z<de;)if(q(R[z],z,R))return!0;return!1}var uR=Gc("length");function pR(R){return R.split("")}function hR(R){return R.match(wP)||[]}function Ef(R,q,z){var de;return z(R,function(Te,Ze,pt){if(q(Te,Ze,pt))return de=Ze,!1}),de}function aa(R,q,z,de){for(var Te=R.length,Ze=z+(de?1:-1);de?Ze--:++Ze<Te;)if(q(R[Ze],Ze,R))return Ze;return-1}function Fo(R,q,z){return q===q?ER(R,q,z):aa(R,Sf,z)}function fR(R,q,z,de){for(var Te=z-1,Ze=R.length;++Te<Ze;)if(de(R[Te],q))return Te;return-1}function Sf(R){return R!==R}function Tf(R,q){var z=R==null?0:R.length;return z?zc(R,q)/z:pe}function Gc(R){return function(q){return q==null?n:q[R]}}function $c(R){return function(q){return R==null?n:R[q]}}function Nf(R,q,z,de,Te){return Te(R,function(Ze,pt,Ye){z=de?(de=!1,Ze):q(z,Ze,pt,Ye)}),z}function mR(R,q){var z=R.length;for(R.sort(q);z--;)R[z]=R[z].value;return R}function zc(R,q){for(var z,de=-1,Te=R.length;++de<Te;){var Ze=q(R[de]);Ze!==n&&(z=z===n?Ze:z+Ze)}return z}function Uc(R,q){for(var z=-1,de=Array(R);++z<R;)de[z]=q(z);return de}function gR(R,q){return tt(q,function(z){return[z,R[z]]})}function Vf(R){return R&&R.slice(0,Rf(R)+1).replace(Vc,"")}function Xt(R){return function(q){return R(q)}}function Zc(R,q){return tt(q,function(z){return R[z]})}function Ki(R,q){return R.has(q)}function Af(R,q){for(var z=-1,de=R.length;++z<de&&Fo(q,R[z],0)>-1;);return z}function Bf(R,q){for(var z=R.length;z--&&Fo(q,R[z],0)>-1;);return z}function yR(R,q){for(var z=R.length,de=0;z--;)R[z]===q&&++de;return de}var _R=$c(tR),vR=$c(nR);function CR(R){return"\\"+oR[R]}function wR(R,q){return R==null?n:R[q]}function Lo(R){return XP.test(R)}function bR(R){return JP.test(R)}function xR(R){for(var q,z=[];!(q=R.next()).done;)z.push(q.value);return z}function Wc(R){var q=-1,z=Array(R.size);return R.forEach(function(de,Te){z[++q]=[Te,de]}),z}function Pf(R,q){return function(z){return R(q(z))}}function Br(R,q){for(var z=-1,de=R.length,Te=0,Ze=[];++z<de;){var pt=R[z];(pt===q||pt===m)&&(R[z]=m,Ze[Te++]=z)}return Ze}function la(R){var q=-1,z=Array(R.size);return R.forEach(function(de){z[++q]=de}),z}function kR(R){var q=-1,z=Array(R.size);return R.forEach(function(de){z[++q]=[de,de]}),z}function ER(R,q,z){for(var de=z-1,Te=R.length;++de<Te;)if(R[de]===q)return de;return-1}function SR(R,q,z){for(var de=z+1;de--;)if(R[de]===q)return de;return de}function Oo(R){return Lo(R)?NR(R):uR(R)}function An(R){return Lo(R)?VR(R):pR(R)}function Rf(R){for(var q=R.length;q--&&yP.test(R.charAt(q)););return q}var TR=$c(rR);function NR(R){for(var q=Dc.lastIndex=0;Dc.test(R);)++q;return q}function VR(R){return R.match(Dc)||[]}function AR(R){return R.match(YP)||[]}var BR=function R(q){q=q==null?Ct:Mo.defaults(Ct.Object(),q,Mo.pick(Ct,QP));var z=q.Array,de=q.Date,Te=q.Error,Ze=q.Function,pt=q.Math,Ye=q.Object,jc=q.RegExp,PR=q.String,sn=q.TypeError,ca=z.prototype,RR=Ze.prototype,Go=Ye.prototype,da=q["__core-js_shared__"],ua=RR.toString,qe=Go.hasOwnProperty,DR=0,Df=function(){var s=/[^.]+$/.exec(da&&da.keys&&da.keys.IE_PROTO||"");return s?"Symbol(src)_1."+s:""}(),pa=Go.toString,IR=ua.call(Ye),FR=Ct._,LR=jc("^"+ua.call(qe).replace(Nc,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ha=yf?q.Buffer:n,Pr=q.Symbol,fa=q.Uint8Array,If=ha?ha.allocUnsafe:n,ma=Pf(Ye.getPrototypeOf,Ye),Ff=Ye.create,Lf=Go.propertyIsEnumerable,ga=ca.splice,Of=Pr?Pr.isConcatSpreadable:n,Yi=Pr?Pr.iterator:n,to=Pr?Pr.toStringTag:n,ya=function(){try{var s=so(Ye,"defineProperty");return s({},"",{}),s}catch{}}(),OR=q.clearTimeout!==Ct.clearTimeout&&q.clearTimeout,MR=de&&de.now!==Ct.Date.now&&de.now,GR=q.setTimeout!==Ct.setTimeout&&q.setTimeout,_a=pt.ceil,va=pt.floor,Hc=Ye.getOwnPropertySymbols,$R=ha?ha.isBuffer:n,Mf=q.isFinite,zR=ca.join,UR=Pf(Ye.keys,Ye),ht=pt.max,St=pt.min,ZR=de.now,WR=q.parseInt,Gf=pt.random,jR=ca.reverse,qc=so(q,"DataView"),Xi=so(q,"Map"),Kc=so(q,"Promise"),$o=so(q,"Set"),Ji=so(q,"WeakMap"),Qi=so(Ye,"create"),Ca=Ji&&new Ji,zo={},HR=ao(qc),qR=ao(Xi),KR=ao(Kc),YR=ao($o),XR=ao(Ji),wa=Pr?Pr.prototype:n,es=wa?wa.valueOf:n,$f=wa?wa.toString:n;function _(s){if(it(s)&&!Ne(s)&&!(s instanceof Le)){if(s instanceof an)return s;if(qe.call(s,"__wrapped__"))return zm(s)}return new an(s)}var Uo=function(){function s(){}return function(a){if(!ot(a))return{};if(Ff)return Ff(a);s.prototype=a;var u=new s;return s.prototype=n,u}}();function ba(){}function an(s,a){this.__wrapped__=s,this.__actions__=[],this.__chain__=!!a,this.__index__=0,this.__values__=n}_.templateSettings={escape:uP,evaluate:pP,interpolate:Kh,variable:"",imports:{_}},_.prototype=ba.prototype,_.prototype.constructor=_,an.prototype=Uo(ba.prototype),an.prototype.constructor=an;function Le(s){this.__wrapped__=s,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=ke,this.__views__=[]}function JR(){var s=new Le(this.__wrapped__);return s.__actions__=Gt(this.__actions__),s.__dir__=this.__dir__,s.__filtered__=this.__filtered__,s.__iteratees__=Gt(this.__iteratees__),s.__takeCount__=this.__takeCount__,s.__views__=Gt(this.__views__),s}function QR(){if(this.__filtered__){var s=new Le(this);s.__dir__=-1,s.__filtered__=!0}else s=this.clone(),s.__dir__*=-1;return s}function eD(){var s=this.__wrapped__.value(),a=this.__dir__,u=Ne(s),f=a<0,g=u?s.length:0,v=pI(0,g,this.__views__),N=v.start,A=v.end,D=A-N,Y=f?A:N-1,X=this.__iteratees__,Q=X.length,oe=0,he=St(D,this.__takeCount__);if(!u||!f&&g==D&&he==D)return um(s,this.__actions__);var _e=[];e:for(;D--&&oe<he;){Y+=a;for(var De=-1,ve=s[Y];++De<Q;){var Fe=X[De],Oe=Fe.iteratee,en=Fe.type,Lt=Oe(ve);if(en==B)ve=Lt;else if(!Lt){if(en==x)continue e;break e}}_e[oe++]=ve}return _e}Le.prototype=Uo(ba.prototype),Le.prototype.constructor=Le;function no(s){var a=-1,u=s==null?0:s.length;for(this.clear();++a<u;){var f=s[a];this.set(f[0],f[1])}}function tD(){this.__data__=Qi?Qi(null):{},this.size=0}function nD(s){var a=this.has(s)&&delete this.__data__[s];return this.size-=a?1:0,a}function rD(s){var a=this.__data__;if(Qi){var u=a[s];return u===p?n:u}return qe.call(a,s)?a[s]:n}function oD(s){var a=this.__data__;return Qi?a[s]!==n:qe.call(a,s)}function iD(s,a){var u=this.__data__;return this.size+=this.has(s)?0:1,u[s]=Qi&&a===n?p:a,this}no.prototype.clear=tD,no.prototype.delete=nD,no.prototype.get=rD,no.prototype.has=oD,no.prototype.set=iD;function er(s){var a=-1,u=s==null?0:s.length;for(this.clear();++a<u;){var f=s[a];this.set(f[0],f[1])}}function sD(){this.__data__=[],this.size=0}function aD(s){var a=this.__data__,u=xa(a,s);if(u<0)return!1;var f=a.length-1;return u==f?a.pop():ga.call(a,u,1),--this.size,!0}function lD(s){var a=this.__data__,u=xa(a,s);return u<0?n:a[u][1]}function cD(s){return xa(this.__data__,s)>-1}function dD(s,a){var u=this.__data__,f=xa(u,s);return f<0?(++this.size,u.push([s,a])):u[f][1]=a,this}er.prototype.clear=sD,er.prototype.delete=aD,er.prototype.get=lD,er.prototype.has=cD,er.prototype.set=dD;function tr(s){var a=-1,u=s==null?0:s.length;for(this.clear();++a<u;){var f=s[a];this.set(f[0],f[1])}}function uD(){this.size=0,this.__data__={hash:new no,map:new(Xi||er),string:new no}}function pD(s){var a=Ia(this,s).delete(s);return this.size-=a?1:0,a}function hD(s){return Ia(this,s).get(s)}function fD(s){return Ia(this,s).has(s)}function mD(s,a){var u=Ia(this,s),f=u.size;return u.set(s,a),this.size+=u.size==f?0:1,this}tr.prototype.clear=uD,tr.prototype.delete=pD,tr.prototype.get=hD,tr.prototype.has=fD,tr.prototype.set=mD;function ro(s){var a=-1,u=s==null?0:s.length;for(this.__data__=new tr;++a<u;)this.add(s[a])}function gD(s){return this.__data__.set(s,p),this}function yD(s){return this.__data__.has(s)}ro.prototype.add=ro.prototype.push=gD,ro.prototype.has=yD;function Bn(s){var a=this.__data__=new er(s);this.size=a.size}function _D(){this.__data__=new er,this.size=0}function vD(s){var a=this.__data__,u=a.delete(s);return this.size=a.size,u}function CD(s){return this.__data__.get(s)}function wD(s){return this.__data__.has(s)}function bD(s,a){var u=this.__data__;if(u instanceof er){var f=u.__data__;if(!Xi||f.length<i-1)return f.push([s,a]),this.size=++u.size,this;u=this.__data__=new tr(f)}return u.set(s,a),this.size=u.size,this}Bn.prototype.clear=_D,Bn.prototype.delete=vD,Bn.prototype.get=CD,Bn.prototype.has=wD,Bn.prototype.set=bD;function zf(s,a){var u=Ne(s),f=!u&&lo(s),g=!u&&!f&&Lr(s),v=!u&&!f&&!g&&Ho(s),N=u||f||g||v,A=N?Uc(s.length,PR):[],D=A.length;for(var Y in s)(a||qe.call(s,Y))&&!(N&&(Y=="length"||g&&(Y=="offset"||Y=="parent")||v&&(Y=="buffer"||Y=="byteLength"||Y=="byteOffset")||ir(Y,D)))&&A.push(Y);return A}function Uf(s){var a=s.length;return a?s[sd(0,a-1)]:n}function xD(s,a){return Fa(Gt(s),oo(a,0,s.length))}function kD(s){return Fa(Gt(s))}function Yc(s,a,u){(u!==n&&!Pn(s[a],u)||u===n&&!(a in s))&&nr(s,a,u)}function ts(s,a,u){var f=s[a];(!(qe.call(s,a)&&Pn(f,u))||u===n&&!(a in s))&&nr(s,a,u)}function xa(s,a){for(var u=s.length;u--;)if(Pn(s[u][0],a))return u;return-1}function ED(s,a,u,f){return Rr(s,function(g,v,N){a(f,g,u(g),N)}),f}function Zf(s,a){return s&&Wn(a,yt(a),s)}function SD(s,a){return s&&Wn(a,zt(a),s)}function nr(s,a,u){a=="__proto__"&&ya?ya(s,a,{configurable:!0,enumerable:!0,value:u,writable:!0}):s[a]=u}function Xc(s,a){for(var u=-1,f=a.length,g=z(f),v=s==null;++u<f;)g[u]=v?n:Bd(s,a[u]);return g}function oo(s,a,u){return s===s&&(u!==n&&(s=s<=u?s:u),a!==n&&(s=s>=a?s:a)),s}function ln(s,a,u,f,g,v){var N,A=a&y,D=a&b,Y=a&w;if(u&&(N=g?u(s,f,g,v):u(s)),N!==n)return N;if(!ot(s))return s;var X=Ne(s);if(X){if(N=fI(s),!A)return Gt(s,N)}else{var Q=Tt(s),oe=Q==ta||Q==Wh;if(Lr(s))return fm(s,A);if(Q==Qn||Q==Ke||oe&&!g){if(N=D||oe?{}:Rm(s),!A)return D?rI(s,SD(N,s)):nI(s,Zf(N,s))}else{if(!Xe[Q])return g?s:{};N=mI(s,Q,A)}}v||(v=new Bn);var he=v.get(s);if(he)return he;v.set(s,N),lg(s)?s.forEach(function(ve){N.add(ln(ve,a,u,ve,s,v))}):sg(s)&&s.forEach(function(ve,Fe){N.set(Fe,ln(ve,a,u,Fe,s,v))});var _e=Y?D?yd:gd:D?zt:yt,De=X?n:_e(s);return on(De||s,function(ve,Fe){De&&(Fe=ve,ve=s[Fe]),ts(N,Fe,ln(ve,a,u,Fe,s,v))}),N}function TD(s){var a=yt(s);return function(u){return Wf(u,s,a)}}function Wf(s,a,u){var f=u.length;if(s==null)return!f;for(s=Ye(s);f--;){var g=u[f],v=a[g],N=s[g];if(N===n&&!(g in s)||!v(N))return!1}return!0}function jf(s,a,u){if(typeof s!="function")throw new sn(c);return ls(function(){s.apply(n,u)},a)}function ns(s,a,u,f){var g=-1,v=sa,N=!0,A=s.length,D=[],Y=a.length;if(!A)return D;u&&(a=tt(a,Xt(u))),f?(v=Lc,N=!1):a.length>=i&&(v=Ki,N=!1,a=new ro(a));e:for(;++g<A;){var X=s[g],Q=u==null?X:u(X);if(X=f||X!==0?X:0,N&&Q===Q){for(var oe=Y;oe--;)if(a[oe]===Q)continue e;D.push(X)}else v(a,Q,f)||D.push(X)}return D}var Rr=vm(Zn),Hf=vm(Qc,!0);function ND(s,a){var u=!0;return Rr(s,function(f,g,v){return u=!!a(f,g,v),u}),u}function ka(s,a,u){for(var f=-1,g=s.length;++f<g;){var v=s[f],N=a(v);if(N!=null&&(A===n?N===N&&!Qt(N):u(N,A)))var A=N,D=v}return D}function VD(s,a,u,f){var g=s.length;for(u=Be(u),u<0&&(u=-u>g?0:g+u),f=f===n||f>g?g:Be(f),f<0&&(f+=g),f=u>f?0:dg(f);u<f;)s[u++]=a;return s}function qf(s,a){var u=[];return Rr(s,function(f,g,v){a(f,g,v)&&u.push(f)}),u}function wt(s,a,u,f,g){var v=-1,N=s.length;for(u||(u=yI),g||(g=[]);++v<N;){var A=s[v];a>0&&u(A)?a>1?wt(A,a-1,u,f,g):Ar(g,A):f||(g[g.length]=A)}return g}var Jc=Cm(),Kf=Cm(!0);function Zn(s,a){return s&&Jc(s,a,yt)}function Qc(s,a){return s&&Kf(s,a,yt)}function Ea(s,a){return Vr(a,function(u){return sr(s[u])})}function io(s,a){a=Ir(a,s);for(var u=0,f=a.length;s!=null&&u<f;)s=s[jn(a[u++])];return u&&u==f?s:n}function Yf(s,a,u){var f=a(s);return Ne(s)?f:Ar(f,u(s))}function It(s){return s==null?s===n?oP:nP:to&&to in Ye(s)?uI(s):kI(s)}function ed(s,a){return s>a}function AD(s,a){return s!=null&&qe.call(s,a)}function BD(s,a){return s!=null&&a in Ye(s)}function PD(s,a,u){return s>=St(a,u)&&s<ht(a,u)}function td(s,a,u){for(var f=u?Lc:sa,g=s[0].length,v=s.length,N=v,A=z(v),D=1/0,Y=[];N--;){var X=s[N];N&&a&&(X=tt(X,Xt(a))),D=St(X.length,D),A[N]=!u&&(a||g>=120&&X.length>=120)?new ro(N&&X):n}X=s[0];var Q=-1,oe=A[0];e:for(;++Q<g&&Y.length<D;){var he=X[Q],_e=a?a(he):he;if(he=u||he!==0?he:0,!(oe?Ki(oe,_e):f(Y,_e,u))){for(N=v;--N;){var De=A[N];if(!(De?Ki(De,_e):f(s[N],_e,u)))continue e}oe&&oe.push(_e),Y.push(he)}}return Y}function RD(s,a,u,f){return Zn(s,function(g,v,N){a(f,u(g),v,N)}),f}function rs(s,a,u){a=Ir(a,s),s=Lm(s,a);var f=s==null?s:s[jn(dn(a))];return f==null?n:Yt(f,s,u)}function Xf(s){return it(s)&&It(s)==Ke}function DD(s){return it(s)&&It(s)==qi}function ID(s){return it(s)&&It(s)==Ui}function os(s,a,u,f,g){return s===a?!0:s==null||a==null||!it(s)&&!it(a)?s!==s&&a!==a:FD(s,a,u,f,os,g)}function FD(s,a,u,f,g,v){var N=Ne(s),A=Ne(a),D=N?Un:Tt(s),Y=A?Un:Tt(a);D=D==Ke?Qn:D,Y=Y==Ke?Qn:Y;var X=D==Qn,Q=Y==Qn,oe=D==Y;if(oe&&Lr(s)){if(!Lr(a))return!1;N=!0,X=!1}if(oe&&!X)return v||(v=new Bn),N||Ho(s)?Am(s,a,u,f,g,v):cI(s,a,D,u,f,g,v);if(!(u&S)){var he=X&&qe.call(s,"__wrapped__"),_e=Q&&qe.call(a,"__wrapped__");if(he||_e){var De=he?s.value():s,ve=_e?a.value():a;return v||(v=new Bn),g(De,ve,u,f,v)}}return oe?(v||(v=new Bn),dI(s,a,u,f,g,v)):!1}function LD(s){return it(s)&&Tt(s)==Nn}function nd(s,a,u,f){var g=u.length,v=g,N=!f;if(s==null)return!v;for(s=Ye(s);g--;){var A=u[g];if(N&&A[2]?A[1]!==s[A[0]]:!(A[0]in s))return!1}for(;++g<v;){A=u[g];var D=A[0],Y=s[D],X=A[1];if(N&&A[2]){if(Y===n&&!(D in s))return!1}else{var Q=new Bn;if(f)var oe=f(Y,X,D,s,a,Q);if(!(oe===n?os(X,Y,S|M,f,Q):oe))return!1}}return!0}function Jf(s){if(!ot(s)||vI(s))return!1;var a=sr(s)?LR:TP;return a.test(ao(s))}function OD(s){return it(s)&&It(s)==Wi}function MD(s){return it(s)&&Tt(s)==Vn}function GD(s){return it(s)&&za(s.length)&&!!Qe[It(s)]}function Qf(s){return typeof s=="function"?s:s==null?Ut:typeof s=="object"?Ne(s)?nm(s[0],s[1]):tm(s):wg(s)}function rd(s){if(!as(s))return UR(s);var a=[];for(var u in Ye(s))qe.call(s,u)&&u!="constructor"&&a.push(u);return a}function $D(s){if(!ot(s))return xI(s);var a=as(s),u=[];for(var f in s)f=="constructor"&&(a||!qe.call(s,f))||u.push(f);return u}function od(s,a){return s<a}function em(s,a){var u=-1,f=$t(s)?z(s.length):[];return Rr(s,function(g,v,N){f[++u]=a(g,v,N)}),f}function tm(s){var a=vd(s);return a.length==1&&a[0][2]?Im(a[0][0],a[0][1]):function(u){return u===s||nd(u,s,a)}}function nm(s,a){return wd(s)&&Dm(a)?Im(jn(s),a):function(u){var f=Bd(u,s);return f===n&&f===a?Pd(u,s):os(a,f,S|M)}}function Sa(s,a,u,f,g){s!==a&&Jc(a,function(v,N){if(g||(g=new Bn),ot(v))zD(s,a,N,u,Sa,f,g);else{var A=f?f(xd(s,N),v,N+"",s,a,g):n;A===n&&(A=v),Yc(s,N,A)}},zt)}function zD(s,a,u,f,g,v,N){var A=xd(s,u),D=xd(a,u),Y=N.get(D);if(Y){Yc(s,u,Y);return}var X=v?v(A,D,u+"",s,a,N):n,Q=X===n;if(Q){var oe=Ne(D),he=!oe&&Lr(D),_e=!oe&&!he&&Ho(D);X=D,oe||he||_e?Ne(A)?X=A:at(A)?X=Gt(A):he?(Q=!1,X=fm(D,!0)):_e?(Q=!1,X=mm(D,!0)):X=[]:cs(D)||lo(D)?(X=A,lo(A)?X=ug(A):(!ot(A)||sr(A))&&(X=Rm(D))):Q=!1}Q&&(N.set(D,X),g(X,D,f,v,N),N.delete(D)),Yc(s,u,X)}function rm(s,a){var u=s.length;if(u)return a+=a<0?u:0,ir(a,u)?s[a]:n}function om(s,a,u){a.length?a=tt(a,function(v){return Ne(v)?function(N){return io(N,v.length===1?v[0]:v)}:v}):a=[Ut];var f=-1;a=tt(a,Xt(ge()));var g=em(s,function(v,N,A){var D=tt(a,function(Y){return Y(v)});return{criteria:D,index:++f,value:v}});return mR(g,function(v,N){return tI(v,N,u)})}function UD(s,a){return im(s,a,function(u,f){return Pd(s,f)})}function im(s,a,u){for(var f=-1,g=a.length,v={};++f<g;){var N=a[f],A=io(s,N);u(A,N)&&is(v,Ir(N,s),A)}return v}function ZD(s){return function(a){return io(a,s)}}function id(s,a,u,f){var g=f?fR:Fo,v=-1,N=a.length,A=s;for(s===a&&(a=Gt(a)),u&&(A=tt(s,Xt(u)));++v<N;)for(var D=0,Y=a[v],X=u?u(Y):Y;(D=g(A,X,D,f))>-1;)A!==s&&ga.call(A,D,1),ga.call(s,D,1);return s}function sm(s,a){for(var u=s?a.length:0,f=u-1;u--;){var g=a[u];if(u==f||g!==v){var v=g;ir(g)?ga.call(s,g,1):cd(s,g)}}return s}function sd(s,a){return s+va(Gf()*(a-s+1))}function WD(s,a,u,f){for(var g=-1,v=ht(_a((a-s)/(u||1)),0),N=z(v);v--;)N[f?v:++g]=s,s+=u;return N}function ad(s,a){var u="";if(!s||a<1||a>K)return u;do a%2&&(u+=s),a=va(a/2),a&&(s+=s);while(a);return u}function Ie(s,a){return kd(Fm(s,a,Ut),s+"")}function jD(s){return Uf(qo(s))}function HD(s,a){var u=qo(s);return Fa(u,oo(a,0,u.length))}function is(s,a,u,f){if(!ot(s))return s;a=Ir(a,s);for(var g=-1,v=a.length,N=v-1,A=s;A!=null&&++g<v;){var D=jn(a[g]),Y=u;if(D==="__proto__"||D==="constructor"||D==="prototype")return s;if(g!=N){var X=A[D];Y=f?f(X,D,A):n,Y===n&&(Y=ot(X)?X:ir(a[g+1])?[]:{})}ts(A,D,Y),A=A[D]}return s}var am=Ca?function(s,a){return Ca.set(s,a),s}:Ut,qD=ya?function(s,a){return ya(s,"toString",{configurable:!0,enumerable:!1,value:Dd(a),writable:!0})}:Ut;function KD(s){return Fa(qo(s))}function cn(s,a,u){var f=-1,g=s.length;a<0&&(a=-a>g?0:g+a),u=u>g?g:u,u<0&&(u+=g),g=a>u?0:u-a>>>0,a>>>=0;for(var v=z(g);++f<g;)v[f]=s[f+a];return v}function YD(s,a){var u;return Rr(s,function(f,g,v){return u=a(f,g,v),!u}),!!u}function Ta(s,a,u){var f=0,g=s==null?f:s.length;if(typeof a=="number"&&a===a&&g<=He){for(;f<g;){var v=f+g>>>1,N=s[v];N!==null&&!Qt(N)&&(u?N<=a:N<a)?f=v+1:g=v}return g}return ld(s,a,Ut,u)}function ld(s,a,u,f){var g=0,v=s==null?0:s.length;if(v===0)return 0;a=u(a);for(var N=a!==a,A=a===null,D=Qt(a),Y=a===n;g<v;){var X=va((g+v)/2),Q=u(s[X]),oe=Q!==n,he=Q===null,_e=Q===Q,De=Qt(Q);if(N)var ve=f||_e;else Y?ve=_e&&(f||oe):A?ve=_e&&oe&&(f||!he):D?ve=_e&&oe&&!he&&(f||!De):he||De?ve=!1:ve=f?Q<=a:Q<a;ve?g=X+1:v=X}return St(v,Ee)}function lm(s,a){for(var u=-1,f=s.length,g=0,v=[];++u<f;){var N=s[u],A=a?a(N):N;if(!u||!Pn(A,D)){var D=A;v[g++]=N===0?0:N}}return v}function cm(s){return typeof s=="number"?s:Qt(s)?pe:+s}function Jt(s){if(typeof s=="string")return s;if(Ne(s))return tt(s,Jt)+"";if(Qt(s))return $f?$f.call(s):"";var a=s+"";return a=="0"&&1/s==-H?"-0":a}function Dr(s,a,u){var f=-1,g=sa,v=s.length,N=!0,A=[],D=A;if(u)N=!1,g=Lc;else if(v>=i){var Y=a?null:aI(s);if(Y)return la(Y);N=!1,g=Ki,D=new ro}else D=a?[]:A;e:for(;++f<v;){var X=s[f],Q=a?a(X):X;if(X=u||X!==0?X:0,N&&Q===Q){for(var oe=D.length;oe--;)if(D[oe]===Q)continue e;a&&D.push(Q),A.push(X)}else g(D,Q,u)||(D!==A&&D.push(Q),A.push(X))}return A}function cd(s,a){return a=Ir(a,s),s=Lm(s,a),s==null||delete s[jn(dn(a))]}function dm(s,a,u,f){return is(s,a,u(io(s,a)),f)}function Na(s,a,u,f){for(var g=s.length,v=f?g:-1;(f?v--:++v<g)&&a(s[v],v,s););return u?cn(s,f?0:v,f?v+1:g):cn(s,f?v+1:0,f?g:v)}function um(s,a){var u=s;return u instanceof Le&&(u=u.value()),Oc(a,function(f,g){return g.func.apply(g.thisArg,Ar([f],g.args))},u)}function dd(s,a,u){var f=s.length;if(f<2)return f?Dr(s[0]):[];for(var g=-1,v=z(f);++g<f;)for(var N=s[g],A=-1;++A<f;)A!=g&&(v[g]=ns(v[g]||N,s[A],a,u));return Dr(wt(v,1),a,u)}function pm(s,a,u){for(var f=-1,g=s.length,v=a.length,N={};++f<g;){var A=f<v?a[f]:n;u(N,s[f],A)}return N}function ud(s){return at(s)?s:[]}function pd(s){return typeof s=="function"?s:Ut}function Ir(s,a){return Ne(s)?s:wd(s,a)?[s]:$m(je(s))}var XD=Ie;function Fr(s,a,u){var f=s.length;return u=u===n?f:u,!a&&u>=f?s:cn(s,a,u)}var hm=OR||function(s){return Ct.clearTimeout(s)};function fm(s,a){if(a)return s.slice();var u=s.length,f=If?If(u):new s.constructor(u);return s.copy(f),f}function hd(s){var a=new s.constructor(s.byteLength);return new fa(a).set(new fa(s)),a}function JD(s,a){var u=a?hd(s.buffer):s.buffer;return new s.constructor(u,s.byteOffset,s.byteLength)}function QD(s){var a=new s.constructor(s.source,Yh.exec(s));return a.lastIndex=s.lastIndex,a}function eI(s){return es?Ye(es.call(s)):{}}function mm(s,a){var u=a?hd(s.buffer):s.buffer;return new s.constructor(u,s.byteOffset,s.length)}function gm(s,a){if(s!==a){var u=s!==n,f=s===null,g=s===s,v=Qt(s),N=a!==n,A=a===null,D=a===a,Y=Qt(a);if(!A&&!Y&&!v&&s>a||v&&N&&D&&!A&&!Y||f&&N&&D||!u&&D||!g)return 1;if(!f&&!v&&!Y&&s<a||Y&&u&&g&&!f&&!v||A&&u&&g||!N&&g||!D)return-1}return 0}function tI(s,a,u){for(var f=-1,g=s.criteria,v=a.criteria,N=g.length,A=u.length;++f<N;){var D=gm(g[f],v[f]);if(D){if(f>=A)return D;var Y=u[f];return D*(Y=="desc"?-1:1)}}return s.index-a.index}function ym(s,a,u,f){for(var g=-1,v=s.length,N=u.length,A=-1,D=a.length,Y=ht(v-N,0),X=z(D+Y),Q=!f;++A<D;)X[A]=a[A];for(;++g<N;)(Q||g<v)&&(X[u[g]]=s[g]);for(;Y--;)X[A++]=s[g++];return X}function _m(s,a,u,f){for(var g=-1,v=s.length,N=-1,A=u.length,D=-1,Y=a.length,X=ht(v-A,0),Q=z(X+Y),oe=!f;++g<X;)Q[g]=s[g];for(var he=g;++D<Y;)Q[he+D]=a[D];for(;++N<A;)(oe||g<v)&&(Q[he+u[N]]=s[g++]);return Q}function Gt(s,a){var u=-1,f=s.length;for(a||(a=z(f));++u<f;)a[u]=s[u];return a}function Wn(s,a,u,f){var g=!u;u||(u={});for(var v=-1,N=a.length;++v<N;){var A=a[v],D=f?f(u[A],s[A],A,u,s):n;D===n&&(D=s[A]),g?nr(u,A,D):ts(u,A,D)}return u}function nI(s,a){return Wn(s,Cd(s),a)}function rI(s,a){return Wn(s,Bm(s),a)}function Va(s,a){return function(u,f){var g=Ne(u)?lR:ED,v=a?a():{};return g(u,s,ge(f,2),v)}}function Zo(s){return Ie(function(a,u){var f=-1,g=u.length,v=g>1?u[g-1]:n,N=g>2?u[2]:n;for(v=s.length>3&&typeof v=="function"?(g--,v):n,N&&Ft(u[0],u[1],N)&&(v=g<3?n:v,g=1),a=Ye(a);++f<g;){var A=u[f];A&&s(a,A,f,v)}return a})}function vm(s,a){return function(u,f){if(u==null)return u;if(!$t(u))return s(u,f);for(var g=u.length,v=a?g:-1,N=Ye(u);(a?v--:++v<g)&&f(N[v],v,N)!==!1;);return u}}function Cm(s){return function(a,u,f){for(var g=-1,v=Ye(a),N=f(a),A=N.length;A--;){var D=N[s?A:++g];if(u(v[D],D,v)===!1)break}return a}}function oI(s,a,u){var f=a&O,g=ss(s);function v(){var N=this&&this!==Ct&&this instanceof v?g:s;return N.apply(f?u:this,arguments)}return v}function wm(s){return function(a){a=je(a);var u=Lo(a)?An(a):n,f=u?u[0]:a.charAt(0),g=u?Fr(u,1).join(""):a.slice(1);return f[s]()+g}}function Wo(s){return function(a){return Oc(vg(_g(a).replace(qP,"")),s,"")}}function ss(s){return function(){var a=arguments;switch(a.length){case 0:return new s;case 1:return new s(a[0]);case 2:return new s(a[0],a[1]);case 3:return new s(a[0],a[1],a[2]);case 4:return new s(a[0],a[1],a[2],a[3]);case 5:return new s(a[0],a[1],a[2],a[3],a[4]);case 6:return new s(a[0],a[1],a[2],a[3],a[4],a[5]);case 7:return new s(a[0],a[1],a[2],a[3],a[4],a[5],a[6])}var u=Uo(s.prototype),f=s.apply(u,a);return ot(f)?f:u}}function iI(s,a,u){var f=ss(s);function g(){for(var v=arguments.length,N=z(v),A=v,D=jo(g);A--;)N[A]=arguments[A];var Y=v<3&&N[0]!==D&&N[v-1]!==D?[]:Br(N,D);if(v-=Y.length,v<u)return Sm(s,a,Aa,g.placeholder,n,N,Y,n,n,u-v);var X=this&&this!==Ct&&this instanceof g?f:s;return Yt(X,this,N)}return g}function bm(s){return function(a,u,f){var g=Ye(a);if(!$t(a)){var v=ge(u,3);a=yt(a),u=function(A){return v(g[A],A,g)}}var N=s(a,u,f);return N>-1?g[v?a[N]:N]:n}}function xm(s){return or(function(a){var u=a.length,f=u,g=an.prototype.thru;for(s&&a.reverse();f--;){var v=a[f];if(typeof v!="function")throw new sn(c);if(g&&!N&&Da(v)=="wrapper")var N=new an([],!0)}for(f=N?f:u;++f<u;){v=a[f];var A=Da(v),D=A=="wrapper"?_d(v):n;D&&bd(D[0])&&D[1]==(Z|F|P|J)&&!D[4].length&&D[9]==1?N=N[Da(D[0])].apply(N,D[3]):N=v.length==1&&bd(v)?N[A]():N.thru(v)}return function(){var Y=arguments,X=Y[0];if(N&&Y.length==1&&Ne(X))return N.plant(X).value();for(var Q=0,oe=u?a[Q].apply(this,Y):X;++Q<u;)oe=a[Q].call(this,oe);return oe}})}function Aa(s,a,u,f,g,v,N,A,D,Y){var X=a&Z,Q=a&O,oe=a&C,he=a&(F|W),_e=a&ae,De=oe?n:ss(s);function ve(){for(var Fe=arguments.length,Oe=z(Fe),en=Fe;en--;)Oe[en]=arguments[en];if(he)var Lt=jo(ve),tn=yR(Oe,Lt);if(f&&(Oe=ym(Oe,f,g,he)),v&&(Oe=_m(Oe,v,N,he)),Fe-=tn,he&&Fe<Y){var lt=Br(Oe,Lt);return Sm(s,a,Aa,ve.placeholder,u,Oe,lt,A,D,Y-Fe)}var Rn=Q?u:this,lr=oe?Rn[s]:s;return Fe=Oe.length,A?Oe=EI(Oe,A):_e&&Fe>1&&Oe.reverse(),X&&D<Fe&&(Oe.length=D),this&&this!==Ct&&this instanceof ve&&(lr=De||ss(lr)),lr.apply(Rn,Oe)}return ve}function km(s,a){return function(u,f){return RD(u,s,a(f),{})}}function Ba(s,a){return function(u,f){var g;if(u===n&&f===n)return a;if(u!==n&&(g=u),f!==n){if(g===n)return f;typeof u=="string"||typeof f=="string"?(u=Jt(u),f=Jt(f)):(u=cm(u),f=cm(f)),g=s(u,f)}return g}}function fd(s){return or(function(a){return a=tt(a,Xt(ge())),Ie(function(u){var f=this;return s(a,function(g){return Yt(g,f,u)})})})}function Pa(s,a){a=a===n?" ":Jt(a);var u=a.length;if(u<2)return u?ad(a,s):a;var f=ad(a,_a(s/Oo(a)));return Lo(a)?Fr(An(f),0,s).join(""):f.slice(0,s)}function sI(s,a,u,f){var g=a&O,v=ss(s);function N(){for(var A=-1,D=arguments.length,Y=-1,X=f.length,Q=z(X+D),oe=this&&this!==Ct&&this instanceof N?v:s;++Y<X;)Q[Y]=f[Y];for(;D--;)Q[Y++]=arguments[++A];return Yt(oe,g?u:this,Q)}return N}function Em(s){return function(a,u,f){return f&&typeof f!="number"&&Ft(a,u,f)&&(u=f=n),a=ar(a),u===n?(u=a,a=0):u=ar(u),f=f===n?a<u?1:-1:ar(f),WD(a,u,f,s)}}function Ra(s){return function(a,u){return typeof a=="string"&&typeof u=="string"||(a=un(a),u=un(u)),s(a,u)}}function Sm(s,a,u,f,g,v,N,A,D,Y){var X=a&F,Q=X?N:n,oe=X?n:N,he=X?v:n,_e=X?n:v;a|=X?P:V,a&=~(X?V:P),a&I||(a&=~(O|C));var De=[s,a,g,he,Q,_e,oe,A,D,Y],ve=u.apply(n,De);return bd(s)&&Om(ve,De),ve.placeholder=f,Mm(ve,s,a)}function md(s){var a=pt[s];return function(u,f){if(u=un(u),f=f==null?0:St(Be(f),292),f&&Mf(u)){var g=(je(u)+"e").split("e"),v=a(g[0]+"e"+(+g[1]+f));return g=(je(v)+"e").split("e"),+(g[0]+"e"+(+g[1]-f))}return a(u)}}var aI=$o&&1/la(new $o([,-0]))[1]==H?function(s){return new $o(s)}:Ld;function Tm(s){return function(a){var u=Tt(a);return u==Nn?Wc(a):u==Vn?kR(a):gR(a,s(a))}}function rr(s,a,u,f,g,v,N,A){var D=a&C;if(!D&&typeof s!="function")throw new sn(c);var Y=f?f.length:0;if(Y||(a&=~(P|V),f=g=n),N=N===n?N:ht(Be(N),0),A=A===n?A:Be(A),Y-=g?g.length:0,a&V){var X=f,Q=g;f=g=n}var oe=D?n:_d(s),he=[s,a,u,f,g,X,Q,v,N,A];if(oe&&bI(he,oe),s=he[0],a=he[1],u=he[2],f=he[3],g=he[4],A=he[9]=he[9]===n?D?0:s.length:ht(he[9]-Y,0),!A&&a&(F|W)&&(a&=~(F|W)),!a||a==O)var _e=oI(s,a,u);else a==F||a==W?_e=iI(s,a,A):(a==P||a==(O|P))&&!g.length?_e=sI(s,a,u,f):_e=Aa.apply(n,he);var De=oe?am:Om;return Mm(De(_e,he),s,a)}function Nm(s,a,u,f){return s===n||Pn(s,Go[u])&&!qe.call(f,u)?a:s}function Vm(s,a,u,f,g,v){return ot(s)&&ot(a)&&(v.set(a,s),Sa(s,a,n,Vm,v),v.delete(a)),s}function lI(s){return cs(s)?n:s}function Am(s,a,u,f,g,v){var N=u&S,A=s.length,D=a.length;if(A!=D&&!(N&&D>A))return!1;var Y=v.get(s),X=v.get(a);if(Y&&X)return Y==a&&X==s;var Q=-1,oe=!0,he=u&M?new ro:n;for(v.set(s,a),v.set(a,s);++Q<A;){var _e=s[Q],De=a[Q];if(f)var ve=N?f(De,_e,Q,a,s,v):f(_e,De,Q,s,a,v);if(ve!==n){if(ve)continue;oe=!1;break}if(he){if(!Mc(a,function(Fe,Oe){if(!Ki(he,Oe)&&(_e===Fe||g(_e,Fe,u,f,v)))return he.push(Oe)})){oe=!1;break}}else if(!(_e===De||g(_e,De,u,f,v))){oe=!1;break}}return v.delete(s),v.delete(a),oe}function cI(s,a,u,f,g,v,N){switch(u){case Do:if(s.byteLength!=a.byteLength||s.byteOffset!=a.byteOffset)return!1;s=s.buffer,a=a.buffer;case qi:return!(s.byteLength!=a.byteLength||!v(new fa(s),new fa(a)));case zi:case Ui:case Zi:return Pn(+s,+a);case ea:return s.name==a.name&&s.message==a.message;case Wi:case ji:return s==a+"";case Nn:var A=Wc;case Vn:var D=f&S;if(A||(A=la),s.size!=a.size&&!D)return!1;var Y=N.get(s);if(Y)return Y==a;f|=M,N.set(s,a);var X=Am(A(s),A(a),f,g,v,N);return N.delete(s),X;case na:if(es)return es.call(s)==es.call(a)}return!1}function dI(s,a,u,f,g,v){var N=u&S,A=gd(s),D=A.length,Y=gd(a),X=Y.length;if(D!=X&&!N)return!1;for(var Q=D;Q--;){var oe=A[Q];if(!(N?oe in a:qe.call(a,oe)))return!1}var he=v.get(s),_e=v.get(a);if(he&&_e)return he==a&&_e==s;var De=!0;v.set(s,a),v.set(a,s);for(var ve=N;++Q<D;){oe=A[Q];var Fe=s[oe],Oe=a[oe];if(f)var en=N?f(Oe,Fe,oe,a,s,v):f(Fe,Oe,oe,s,a,v);if(!(en===n?Fe===Oe||g(Fe,Oe,u,f,v):en)){De=!1;break}ve||(ve=oe=="constructor")}if(De&&!ve){var Lt=s.constructor,tn=a.constructor;Lt!=tn&&"constructor"in s&&"constructor"in a&&!(typeof Lt=="function"&&Lt instanceof Lt&&typeof tn=="function"&&tn instanceof tn)&&(De=!1)}return v.delete(s),v.delete(a),De}function or(s){return kd(Fm(s,n,Wm),s+"")}function gd(s){return Yf(s,yt,Cd)}function yd(s){return Yf(s,zt,Bm)}var _d=Ca?function(s){return Ca.get(s)}:Ld;function Da(s){for(var a=s.name+"",u=zo[a],f=qe.call(zo,a)?u.length:0;f--;){var g=u[f],v=g.func;if(v==null||v==s)return g.name}return a}function jo(s){var a=qe.call(_,"placeholder")?_:s;return a.placeholder}function ge(){var s=_.iteratee||Id;return s=s===Id?Qf:s,arguments.length?s(arguments[0],arguments[1]):s}function Ia(s,a){var u=s.__data__;return _I(a)?u[typeof a=="string"?"string":"hash"]:u.map}function vd(s){for(var a=yt(s),u=a.length;u--;){var f=a[u],g=s[f];a[u]=[f,g,Dm(g)]}return a}function so(s,a){var u=wR(s,a);return Jf(u)?u:n}function uI(s){var a=qe.call(s,to),u=s[to];try{s[to]=n;var f=!0}catch{}var g=pa.call(s);return f&&(a?s[to]=u:delete s[to]),g}var Cd=Hc?function(s){return s==null?[]:(s=Ye(s),Vr(Hc(s),function(a){return Lf.call(s,a)}))}:Od,Bm=Hc?function(s){for(var a=[];s;)Ar(a,Cd(s)),s=ma(s);return a}:Od,Tt=It;(qc&&Tt(new qc(new ArrayBuffer(1)))!=Do||Xi&&Tt(new Xi)!=Nn||Kc&&Tt(Kc.resolve())!=jh||$o&&Tt(new $o)!=Vn||Ji&&Tt(new Ji)!=Hi)&&(Tt=function(s){var a=It(s),u=a==Qn?s.constructor:n,f=u?ao(u):"";if(f)switch(f){case HR:return Do;case qR:return Nn;case KR:return jh;case YR:return Vn;case XR:return Hi}return a});function pI(s,a,u){for(var f=-1,g=u.length;++f<g;){var v=u[f],N=v.size;switch(v.type){case"drop":s+=N;break;case"dropRight":a-=N;break;case"take":a=St(a,s+N);break;case"takeRight":s=ht(s,a-N);break}}return{start:s,end:a}}function hI(s){var a=s.match(vP);return a?a[1].split(CP):[]}function Pm(s,a,u){a=Ir(a,s);for(var f=-1,g=a.length,v=!1;++f<g;){var N=jn(a[f]);if(!(v=s!=null&&u(s,N)))break;s=s[N]}return v||++f!=g?v:(g=s==null?0:s.length,!!g&&za(g)&&ir(N,g)&&(Ne(s)||lo(s)))}function fI(s){var a=s.length,u=new s.constructor(a);return a&&typeof s[0]=="string"&&qe.call(s,"index")&&(u.index=s.index,u.input=s.input),u}function Rm(s){return typeof s.constructor=="function"&&!as(s)?Uo(ma(s)):{}}function mI(s,a,u){var f=s.constructor;switch(a){case qi:return hd(s);case zi:case Ui:return new f(+s);case Do:return JD(s,u);case vc:case Cc:case wc:case bc:case xc:case kc:case Ec:case Sc:case Tc:return mm(s,u);case Nn:return new f;case Zi:case ji:return new f(s);case Wi:return QD(s);case Vn:return new f;case na:return eI(s)}}function gI(s,a){var u=a.length;if(!u)return s;var f=u-1;return a[f]=(u>1?"& ":"")+a[f],a=a.join(u>2?", ":" "),s.replace(_P,`{
72
+ */zs.exports,function(t,e){(function(){var n,o="4.17.21",i=200,l="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",c="Expected a function",d="Invalid `variable` option passed into `_.template`",p="__lodash_hash_undefined__",h=500,m="__lodash_placeholder__",y=1,b=2,w=4,S=1,M=2,O=1,v=2,I=4,F=8,W=16,P=32,V=64,Z=128,J=256,ae=512,$=30,j="...",U=800,k=16,x=1,B=2,G=3,H=1/0,K=9007199254740991,ne=17976931348623157e292,pe=NaN,ke=4294967295,Ee=ke-1,He=ke>>>1,It=[["ary",Z],["bind",O],["bindKey",v],["curry",F],["curryRight",W],["flip",ae],["partial",P],["partialRight",V],["rearg",J]],Ke="[object Arguments]",Un="[object Array]",lP="[object AsyncFunction]",Ui="[object Boolean]",Zi="[object Date]",cP="[object DOMException]",ta="[object Error]",na="[object Function]",qh="[object GeneratorFunction]",Nn="[object Map]",Wi="[object Number]",dP="[object Null]",Qn="[object Object]",Kh="[object Promise]",uP="[object Proxy]",ji="[object RegExp]",Vn="[object Set]",Hi="[object String]",ra="[object Symbol]",pP="[object Undefined]",qi="[object WeakMap]",hP="[object WeakSet]",Ki="[object ArrayBuffer]",Io="[object DataView]",vc="[object Float32Array]",wc="[object Float64Array]",bc="[object Int8Array]",xc="[object Int16Array]",kc="[object Int32Array]",Ec="[object Uint8Array]",Sc="[object Uint8ClampedArray]",Tc="[object Uint16Array]",Nc="[object Uint32Array]",fP=/\b__p \+= '';/g,mP=/\b(__p \+=) '' \+/g,gP=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Yh=/&(?:amp|lt|gt|quot|#39);/g,Xh=/[&<>"']/g,yP=RegExp(Yh.source),_P=RegExp(Xh.source),CP=/<%-([\s\S]+?)%>/g,vP=/<%([\s\S]+?)%>/g,Jh=/<%=([\s\S]+?)%>/g,wP=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,bP=/^\w*$/,xP=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Vc=/[\\^$.*+?()[\]{}|]/g,kP=RegExp(Vc.source),Ac=/^\s+/,EP=/\s/,SP=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,TP=/\{\n\/\* \[wrapped with (.+)\] \*/,NP=/,? & /,VP=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,AP=/[()=,{}\[\]\/\s]/,BP=/\\(\\)?/g,PP=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Qh=/\w*$/,RP=/^[-+]0x[0-9a-f]+$/i,DP=/^0b[01]+$/i,IP=/^\[object .+?Constructor\]$/,FP=/^0o[0-7]+$/i,LP=/^(?:0|[1-9]\d*)$/,OP=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,oa=/($^)/,MP=/['\n\r\u2028\u2029\\]/g,ia="\\ud800-\\udfff",GP="\\u0300-\\u036f",$P="\\ufe20-\\ufe2f",zP="\\u20d0-\\u20ff",ef=GP+$P+zP,tf="\\u2700-\\u27bf",nf="a-z\\xdf-\\xf6\\xf8-\\xff",UP="\\xac\\xb1\\xd7\\xf7",ZP="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",WP="\\u2000-\\u206f",jP=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",rf="A-Z\\xc0-\\xd6\\xd8-\\xde",of="\\ufe0e\\ufe0f",sf=UP+ZP+WP+jP,Bc="['’]",HP="["+ia+"]",af="["+sf+"]",sa="["+ef+"]",lf="\\d+",qP="["+tf+"]",cf="["+nf+"]",df="[^"+ia+sf+lf+tf+nf+rf+"]",Pc="\\ud83c[\\udffb-\\udfff]",KP="(?:"+sa+"|"+Pc+")",uf="[^"+ia+"]",Rc="(?:\\ud83c[\\udde6-\\uddff]){2}",Dc="[\\ud800-\\udbff][\\udc00-\\udfff]",Fo="["+rf+"]",pf="\\u200d",hf="(?:"+cf+"|"+df+")",YP="(?:"+Fo+"|"+df+")",ff="(?:"+Bc+"(?:d|ll|m|re|s|t|ve))?",mf="(?:"+Bc+"(?:D|LL|M|RE|S|T|VE))?",gf=KP+"?",yf="["+of+"]?",XP="(?:"+pf+"(?:"+[uf,Rc,Dc].join("|")+")"+yf+gf+")*",JP="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",QP="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",_f=yf+gf+XP,eR="(?:"+[qP,Rc,Dc].join("|")+")"+_f,tR="(?:"+[uf+sa+"?",sa,Rc,Dc,HP].join("|")+")",nR=RegExp(Bc,"g"),rR=RegExp(sa,"g"),Ic=RegExp(Pc+"(?="+Pc+")|"+tR+_f,"g"),oR=RegExp([Fo+"?"+cf+"+"+ff+"(?="+[af,Fo,"$"].join("|")+")",YP+"+"+mf+"(?="+[af,Fo+hf,"$"].join("|")+")",Fo+"?"+hf+"+"+ff,Fo+"+"+mf,QP,JP,lf,eR].join("|"),"g"),iR=RegExp("["+pf+ia+ef+of+"]"),sR=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,aR=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],lR=-1,Qe={};Qe[vc]=Qe[wc]=Qe[bc]=Qe[xc]=Qe[kc]=Qe[Ec]=Qe[Sc]=Qe[Tc]=Qe[Nc]=!0,Qe[Ke]=Qe[Un]=Qe[Ki]=Qe[Ui]=Qe[Io]=Qe[Zi]=Qe[ta]=Qe[na]=Qe[Nn]=Qe[Wi]=Qe[Qn]=Qe[ji]=Qe[Vn]=Qe[Hi]=Qe[qi]=!1;var Xe={};Xe[Ke]=Xe[Un]=Xe[Ki]=Xe[Io]=Xe[Ui]=Xe[Zi]=Xe[vc]=Xe[wc]=Xe[bc]=Xe[xc]=Xe[kc]=Xe[Nn]=Xe[Wi]=Xe[Qn]=Xe[ji]=Xe[Vn]=Xe[Hi]=Xe[ra]=Xe[Ec]=Xe[Sc]=Xe[Tc]=Xe[Nc]=!0,Xe[ta]=Xe[na]=Xe[qi]=!1;var cR={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},dR={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},uR={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},pR={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},hR=parseFloat,fR=parseInt,Cf=typeof Yo=="object"&&Yo&&Yo.Object===Object&&Yo,mR=typeof self=="object"&&self&&self.Object===Object&&self,vt=Cf||mR||Function("return this")(),Fc=e&&!e.nodeType&&e,to=Fc&&!0&&t&&!t.nodeType&&t,vf=to&&to.exports===Fc,Lc=vf&&Cf.process,rn=function(){try{var R=to&&to.require&&to.require("util").types;return R||Lc&&Lc.binding&&Lc.binding("util")}catch{}}(),wf=rn&&rn.isArrayBuffer,bf=rn&&rn.isDate,xf=rn&&rn.isMap,kf=rn&&rn.isRegExp,Ef=rn&&rn.isSet,Sf=rn&&rn.isTypedArray;function Xt(R,q,z){switch(z.length){case 0:return R.call(q);case 1:return R.call(q,z[0]);case 2:return R.call(q,z[0],z[1]);case 3:return R.call(q,z[0],z[1],z[2])}return R.apply(q,z)}function gR(R,q,z,de){for(var Te=-1,Ze=R==null?0:R.length;++Te<Ze;){var pt=R[Te];q(de,pt,z(pt),R)}return de}function on(R,q){for(var z=-1,de=R==null?0:R.length;++z<de&&q(R[z],z,R)!==!1;);return R}function yR(R,q){for(var z=R==null?0:R.length;z--&&q(R[z],z,R)!==!1;);return R}function Tf(R,q){for(var z=-1,de=R==null?0:R.length;++z<de;)if(!q(R[z],z,R))return!1;return!0}function Vr(R,q){for(var z=-1,de=R==null?0:R.length,Te=0,Ze=[];++z<de;){var pt=R[z];q(pt,z,R)&&(Ze[Te++]=pt)}return Ze}function aa(R,q){var z=R==null?0:R.length;return!!z&&Lo(R,q,0)>-1}function Oc(R,q,z){for(var de=-1,Te=R==null?0:R.length;++de<Te;)if(z(q,R[de]))return!0;return!1}function tt(R,q){for(var z=-1,de=R==null?0:R.length,Te=Array(de);++z<de;)Te[z]=q(R[z],z,R);return Te}function Ar(R,q){for(var z=-1,de=q.length,Te=R.length;++z<de;)R[Te+z]=q[z];return R}function Mc(R,q,z,de){var Te=-1,Ze=R==null?0:R.length;for(de&&Ze&&(z=R[++Te]);++Te<Ze;)z=q(z,R[Te],Te,R);return z}function _R(R,q,z,de){var Te=R==null?0:R.length;for(de&&Te&&(z=R[--Te]);Te--;)z=q(z,R[Te],Te,R);return z}function Gc(R,q){for(var z=-1,de=R==null?0:R.length;++z<de;)if(q(R[z],z,R))return!0;return!1}var CR=$c("length");function vR(R){return R.split("")}function wR(R){return R.match(VP)||[]}function Nf(R,q,z){var de;return z(R,function(Te,Ze,pt){if(q(Te,Ze,pt))return de=Ze,!1}),de}function la(R,q,z,de){for(var Te=R.length,Ze=z+(de?1:-1);de?Ze--:++Ze<Te;)if(q(R[Ze],Ze,R))return Ze;return-1}function Lo(R,q,z){return q===q?RR(R,q,z):la(R,Vf,z)}function bR(R,q,z,de){for(var Te=z-1,Ze=R.length;++Te<Ze;)if(de(R[Te],q))return Te;return-1}function Vf(R){return R!==R}function Af(R,q){var z=R==null?0:R.length;return z?Uc(R,q)/z:pe}function $c(R){return function(q){return q==null?n:q[R]}}function zc(R){return function(q){return R==null?n:R[q]}}function Bf(R,q,z,de,Te){return Te(R,function(Ze,pt,Ye){z=de?(de=!1,Ze):q(z,Ze,pt,Ye)}),z}function xR(R,q){var z=R.length;for(R.sort(q);z--;)R[z]=R[z].value;return R}function Uc(R,q){for(var z,de=-1,Te=R.length;++de<Te;){var Ze=q(R[de]);Ze!==n&&(z=z===n?Ze:z+Ze)}return z}function Zc(R,q){for(var z=-1,de=Array(R);++z<R;)de[z]=q(z);return de}function kR(R,q){return tt(q,function(z){return[z,R[z]]})}function Pf(R){return R&&R.slice(0,Ff(R)+1).replace(Ac,"")}function Jt(R){return function(q){return R(q)}}function Wc(R,q){return tt(q,function(z){return R[z]})}function Yi(R,q){return R.has(q)}function Rf(R,q){for(var z=-1,de=R.length;++z<de&&Lo(q,R[z],0)>-1;);return z}function Df(R,q){for(var z=R.length;z--&&Lo(q,R[z],0)>-1;);return z}function ER(R,q){for(var z=R.length,de=0;z--;)R[z]===q&&++de;return de}var SR=zc(cR),TR=zc(dR);function NR(R){return"\\"+pR[R]}function VR(R,q){return R==null?n:R[q]}function Oo(R){return iR.test(R)}function AR(R){return sR.test(R)}function BR(R){for(var q,z=[];!(q=R.next()).done;)z.push(q.value);return z}function jc(R){var q=-1,z=Array(R.size);return R.forEach(function(de,Te){z[++q]=[Te,de]}),z}function If(R,q){return function(z){return R(q(z))}}function Br(R,q){for(var z=-1,de=R.length,Te=0,Ze=[];++z<de;){var pt=R[z];(pt===q||pt===m)&&(R[z]=m,Ze[Te++]=z)}return Ze}function ca(R){var q=-1,z=Array(R.size);return R.forEach(function(de){z[++q]=de}),z}function PR(R){var q=-1,z=Array(R.size);return R.forEach(function(de){z[++q]=[de,de]}),z}function RR(R,q,z){for(var de=z-1,Te=R.length;++de<Te;)if(R[de]===q)return de;return-1}function DR(R,q,z){for(var de=z+1;de--;)if(R[de]===q)return de;return de}function Mo(R){return Oo(R)?FR(R):CR(R)}function An(R){return Oo(R)?LR(R):vR(R)}function Ff(R){for(var q=R.length;q--&&EP.test(R.charAt(q)););return q}var IR=zc(uR);function FR(R){for(var q=Ic.lastIndex=0;Ic.test(R);)++q;return q}function LR(R){return R.match(Ic)||[]}function OR(R){return R.match(oR)||[]}var MR=function R(q){q=q==null?vt:Go.defaults(vt.Object(),q,Go.pick(vt,aR));var z=q.Array,de=q.Date,Te=q.Error,Ze=q.Function,pt=q.Math,Ye=q.Object,Hc=q.RegExp,GR=q.String,sn=q.TypeError,da=z.prototype,$R=Ze.prototype,$o=Ye.prototype,ua=q["__core-js_shared__"],pa=$R.toString,qe=$o.hasOwnProperty,zR=0,Lf=function(){var s=/[^.]+$/.exec(ua&&ua.keys&&ua.keys.IE_PROTO||"");return s?"Symbol(src)_1."+s:""}(),ha=$o.toString,UR=pa.call(Ye),ZR=vt._,WR=Hc("^"+pa.call(qe).replace(Vc,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),fa=vf?q.Buffer:n,Pr=q.Symbol,ma=q.Uint8Array,Of=fa?fa.allocUnsafe:n,ga=If(Ye.getPrototypeOf,Ye),Mf=Ye.create,Gf=$o.propertyIsEnumerable,ya=da.splice,$f=Pr?Pr.isConcatSpreadable:n,Xi=Pr?Pr.iterator:n,no=Pr?Pr.toStringTag:n,_a=function(){try{var s=ao(Ye,"defineProperty");return s({},"",{}),s}catch{}}(),jR=q.clearTimeout!==vt.clearTimeout&&q.clearTimeout,HR=de&&de.now!==vt.Date.now&&de.now,qR=q.setTimeout!==vt.setTimeout&&q.setTimeout,Ca=pt.ceil,va=pt.floor,qc=Ye.getOwnPropertySymbols,KR=fa?fa.isBuffer:n,zf=q.isFinite,YR=da.join,XR=If(Ye.keys,Ye),ht=pt.max,St=pt.min,JR=de.now,QR=q.parseInt,Uf=pt.random,eD=da.reverse,Kc=ao(q,"DataView"),Ji=ao(q,"Map"),Yc=ao(q,"Promise"),zo=ao(q,"Set"),Qi=ao(q,"WeakMap"),es=ao(Ye,"create"),wa=Qi&&new Qi,Uo={},tD=lo(Kc),nD=lo(Ji),rD=lo(Yc),oD=lo(zo),iD=lo(Qi),ba=Pr?Pr.prototype:n,ts=ba?ba.valueOf:n,Zf=ba?ba.toString:n;function _(s){if(it(s)&&!Ne(s)&&!(s instanceof Le)){if(s instanceof an)return s;if(qe.call(s,"__wrapped__"))return Wm(s)}return new an(s)}var Zo=function(){function s(){}return function(a){if(!ot(a))return{};if(Mf)return Mf(a);s.prototype=a;var u=new s;return s.prototype=n,u}}();function xa(){}function an(s,a){this.__wrapped__=s,this.__actions__=[],this.__chain__=!!a,this.__index__=0,this.__values__=n}_.templateSettings={escape:CP,evaluate:vP,interpolate:Jh,variable:"",imports:{_}},_.prototype=xa.prototype,_.prototype.constructor=_,an.prototype=Zo(xa.prototype),an.prototype.constructor=an;function Le(s){this.__wrapped__=s,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=ke,this.__views__=[]}function sD(){var s=new Le(this.__wrapped__);return s.__actions__=$t(this.__actions__),s.__dir__=this.__dir__,s.__filtered__=this.__filtered__,s.__iteratees__=$t(this.__iteratees__),s.__takeCount__=this.__takeCount__,s.__views__=$t(this.__views__),s}function aD(){if(this.__filtered__){var s=new Le(this);s.__dir__=-1,s.__filtered__=!0}else s=this.clone(),s.__dir__*=-1;return s}function lD(){var s=this.__wrapped__.value(),a=this.__dir__,u=Ne(s),f=a<0,g=u?s.length:0,C=vI(0,g,this.__views__),N=C.start,A=C.end,D=A-N,Y=f?A:N-1,X=this.__iteratees__,Q=X.length,oe=0,he=St(D,this.__takeCount__);if(!u||!f&&g==D&&he==D)return fm(s,this.__actions__);var _e=[];e:for(;D--&&oe<he;){Y+=a;for(var De=-1,Ce=s[Y];++De<Q;){var Fe=X[De],Oe=Fe.iteratee,tn=Fe.type,Ot=Oe(Ce);if(tn==B)Ce=Ot;else if(!Ot){if(tn==x)continue e;break e}}_e[oe++]=Ce}return _e}Le.prototype=Zo(xa.prototype),Le.prototype.constructor=Le;function ro(s){var a=-1,u=s==null?0:s.length;for(this.clear();++a<u;){var f=s[a];this.set(f[0],f[1])}}function cD(){this.__data__=es?es(null):{},this.size=0}function dD(s){var a=this.has(s)&&delete this.__data__[s];return this.size-=a?1:0,a}function uD(s){var a=this.__data__;if(es){var u=a[s];return u===p?n:u}return qe.call(a,s)?a[s]:n}function pD(s){var a=this.__data__;return es?a[s]!==n:qe.call(a,s)}function hD(s,a){var u=this.__data__;return this.size+=this.has(s)?0:1,u[s]=es&&a===n?p:a,this}ro.prototype.clear=cD,ro.prototype.delete=dD,ro.prototype.get=uD,ro.prototype.has=pD,ro.prototype.set=hD;function er(s){var a=-1,u=s==null?0:s.length;for(this.clear();++a<u;){var f=s[a];this.set(f[0],f[1])}}function fD(){this.__data__=[],this.size=0}function mD(s){var a=this.__data__,u=ka(a,s);if(u<0)return!1;var f=a.length-1;return u==f?a.pop():ya.call(a,u,1),--this.size,!0}function gD(s){var a=this.__data__,u=ka(a,s);return u<0?n:a[u][1]}function yD(s){return ka(this.__data__,s)>-1}function _D(s,a){var u=this.__data__,f=ka(u,s);return f<0?(++this.size,u.push([s,a])):u[f][1]=a,this}er.prototype.clear=fD,er.prototype.delete=mD,er.prototype.get=gD,er.prototype.has=yD,er.prototype.set=_D;function tr(s){var a=-1,u=s==null?0:s.length;for(this.clear();++a<u;){var f=s[a];this.set(f[0],f[1])}}function CD(){this.size=0,this.__data__={hash:new ro,map:new(Ji||er),string:new ro}}function vD(s){var a=Fa(this,s).delete(s);return this.size-=a?1:0,a}function wD(s){return Fa(this,s).get(s)}function bD(s){return Fa(this,s).has(s)}function xD(s,a){var u=Fa(this,s),f=u.size;return u.set(s,a),this.size+=u.size==f?0:1,this}tr.prototype.clear=CD,tr.prototype.delete=vD,tr.prototype.get=wD,tr.prototype.has=bD,tr.prototype.set=xD;function oo(s){var a=-1,u=s==null?0:s.length;for(this.__data__=new tr;++a<u;)this.add(s[a])}function kD(s){return this.__data__.set(s,p),this}function ED(s){return this.__data__.has(s)}oo.prototype.add=oo.prototype.push=kD,oo.prototype.has=ED;function Bn(s){var a=this.__data__=new er(s);this.size=a.size}function SD(){this.__data__=new er,this.size=0}function TD(s){var a=this.__data__,u=a.delete(s);return this.size=a.size,u}function ND(s){return this.__data__.get(s)}function VD(s){return this.__data__.has(s)}function AD(s,a){var u=this.__data__;if(u instanceof er){var f=u.__data__;if(!Ji||f.length<i-1)return f.push([s,a]),this.size=++u.size,this;u=this.__data__=new tr(f)}return u.set(s,a),this.size=u.size,this}Bn.prototype.clear=SD,Bn.prototype.delete=TD,Bn.prototype.get=ND,Bn.prototype.has=VD,Bn.prototype.set=AD;function Wf(s,a){var u=Ne(s),f=!u&&co(s),g=!u&&!f&&Lr(s),C=!u&&!f&&!g&&qo(s),N=u||f||g||C,A=N?Zc(s.length,GR):[],D=A.length;for(var Y in s)(a||qe.call(s,Y))&&!(N&&(Y=="length"||g&&(Y=="offset"||Y=="parent")||C&&(Y=="buffer"||Y=="byteLength"||Y=="byteOffset")||ir(Y,D)))&&A.push(Y);return A}function jf(s){var a=s.length;return a?s[ad(0,a-1)]:n}function BD(s,a){return La($t(s),io(a,0,s.length))}function PD(s){return La($t(s))}function Xc(s,a,u){(u!==n&&!Pn(s[a],u)||u===n&&!(a in s))&&nr(s,a,u)}function ns(s,a,u){var f=s[a];(!(qe.call(s,a)&&Pn(f,u))||u===n&&!(a in s))&&nr(s,a,u)}function ka(s,a){for(var u=s.length;u--;)if(Pn(s[u][0],a))return u;return-1}function RD(s,a,u,f){return Rr(s,function(g,C,N){a(f,g,u(g),N)}),f}function Hf(s,a){return s&&Wn(a,yt(a),s)}function DD(s,a){return s&&Wn(a,Ut(a),s)}function nr(s,a,u){a=="__proto__"&&_a?_a(s,a,{configurable:!0,enumerable:!0,value:u,writable:!0}):s[a]=u}function Jc(s,a){for(var u=-1,f=a.length,g=z(f),C=s==null;++u<f;)g[u]=C?n:Pd(s,a[u]);return g}function io(s,a,u){return s===s&&(u!==n&&(s=s<=u?s:u),a!==n&&(s=s>=a?s:a)),s}function ln(s,a,u,f,g,C){var N,A=a&y,D=a&b,Y=a&w;if(u&&(N=g?u(s,f,g,C):u(s)),N!==n)return N;if(!ot(s))return s;var X=Ne(s);if(X){if(N=bI(s),!A)return $t(s,N)}else{var Q=Tt(s),oe=Q==na||Q==qh;if(Lr(s))return ym(s,A);if(Q==Qn||Q==Ke||oe&&!g){if(N=D||oe?{}:Fm(s),!A)return D?uI(s,DD(N,s)):dI(s,Hf(N,s))}else{if(!Xe[Q])return g?s:{};N=xI(s,Q,A)}}C||(C=new Bn);var he=C.get(s);if(he)return he;C.set(s,N),ug(s)?s.forEach(function(Ce){N.add(ln(Ce,a,u,Ce,s,C))}):cg(s)&&s.forEach(function(Ce,Fe){N.set(Fe,ln(Ce,a,u,Fe,s,C))});var _e=Y?D?_d:yd:D?Ut:yt,De=X?n:_e(s);return on(De||s,function(Ce,Fe){De&&(Fe=Ce,Ce=s[Fe]),ns(N,Fe,ln(Ce,a,u,Fe,s,C))}),N}function ID(s){var a=yt(s);return function(u){return qf(u,s,a)}}function qf(s,a,u){var f=u.length;if(s==null)return!f;for(s=Ye(s);f--;){var g=u[f],C=a[g],N=s[g];if(N===n&&!(g in s)||!C(N))return!1}return!0}function Kf(s,a,u){if(typeof s!="function")throw new sn(c);return cs(function(){s.apply(n,u)},a)}function rs(s,a,u,f){var g=-1,C=aa,N=!0,A=s.length,D=[],Y=a.length;if(!A)return D;u&&(a=tt(a,Jt(u))),f?(C=Oc,N=!1):a.length>=i&&(C=Yi,N=!1,a=new oo(a));e:for(;++g<A;){var X=s[g],Q=u==null?X:u(X);if(X=f||X!==0?X:0,N&&Q===Q){for(var oe=Y;oe--;)if(a[oe]===Q)continue e;D.push(X)}else C(a,Q,f)||D.push(X)}return D}var Rr=bm(Zn),Yf=bm(ed,!0);function FD(s,a){var u=!0;return Rr(s,function(f,g,C){return u=!!a(f,g,C),u}),u}function Ea(s,a,u){for(var f=-1,g=s.length;++f<g;){var C=s[f],N=a(C);if(N!=null&&(A===n?N===N&&!en(N):u(N,A)))var A=N,D=C}return D}function LD(s,a,u,f){var g=s.length;for(u=Be(u),u<0&&(u=-u>g?0:g+u),f=f===n||f>g?g:Be(f),f<0&&(f+=g),f=u>f?0:hg(f);u<f;)s[u++]=a;return s}function Xf(s,a){var u=[];return Rr(s,function(f,g,C){a(f,g,C)&&u.push(f)}),u}function wt(s,a,u,f,g){var C=-1,N=s.length;for(u||(u=EI),g||(g=[]);++C<N;){var A=s[C];a>0&&u(A)?a>1?wt(A,a-1,u,f,g):Ar(g,A):f||(g[g.length]=A)}return g}var Qc=xm(),Jf=xm(!0);function Zn(s,a){return s&&Qc(s,a,yt)}function ed(s,a){return s&&Jf(s,a,yt)}function Sa(s,a){return Vr(a,function(u){return sr(s[u])})}function so(s,a){a=Ir(a,s);for(var u=0,f=a.length;s!=null&&u<f;)s=s[jn(a[u++])];return u&&u==f?s:n}function Qf(s,a,u){var f=a(s);return Ne(s)?f:Ar(f,u(s))}function Ft(s){return s==null?s===n?pP:dP:no&&no in Ye(s)?CI(s):PI(s)}function td(s,a){return s>a}function OD(s,a){return s!=null&&qe.call(s,a)}function MD(s,a){return s!=null&&a in Ye(s)}function GD(s,a,u){return s>=St(a,u)&&s<ht(a,u)}function nd(s,a,u){for(var f=u?Oc:aa,g=s[0].length,C=s.length,N=C,A=z(C),D=1/0,Y=[];N--;){var X=s[N];N&&a&&(X=tt(X,Jt(a))),D=St(X.length,D),A[N]=!u&&(a||g>=120&&X.length>=120)?new oo(N&&X):n}X=s[0];var Q=-1,oe=A[0];e:for(;++Q<g&&Y.length<D;){var he=X[Q],_e=a?a(he):he;if(he=u||he!==0?he:0,!(oe?Yi(oe,_e):f(Y,_e,u))){for(N=C;--N;){var De=A[N];if(!(De?Yi(De,_e):f(s[N],_e,u)))continue e}oe&&oe.push(_e),Y.push(he)}}return Y}function $D(s,a,u,f){return Zn(s,function(g,C,N){a(f,u(g),C,N)}),f}function os(s,a,u){a=Ir(a,s),s=Gm(s,a);var f=s==null?s:s[jn(dn(a))];return f==null?n:Xt(f,s,u)}function em(s){return it(s)&&Ft(s)==Ke}function zD(s){return it(s)&&Ft(s)==Ki}function UD(s){return it(s)&&Ft(s)==Zi}function is(s,a,u,f,g){return s===a?!0:s==null||a==null||!it(s)&&!it(a)?s!==s&&a!==a:ZD(s,a,u,f,is,g)}function ZD(s,a,u,f,g,C){var N=Ne(s),A=Ne(a),D=N?Un:Tt(s),Y=A?Un:Tt(a);D=D==Ke?Qn:D,Y=Y==Ke?Qn:Y;var X=D==Qn,Q=Y==Qn,oe=D==Y;if(oe&&Lr(s)){if(!Lr(a))return!1;N=!0,X=!1}if(oe&&!X)return C||(C=new Bn),N||qo(s)?Rm(s,a,u,f,g,C):yI(s,a,D,u,f,g,C);if(!(u&S)){var he=X&&qe.call(s,"__wrapped__"),_e=Q&&qe.call(a,"__wrapped__");if(he||_e){var De=he?s.value():s,Ce=_e?a.value():a;return C||(C=new Bn),g(De,Ce,u,f,C)}}return oe?(C||(C=new Bn),_I(s,a,u,f,g,C)):!1}function WD(s){return it(s)&&Tt(s)==Nn}function rd(s,a,u,f){var g=u.length,C=g,N=!f;if(s==null)return!C;for(s=Ye(s);g--;){var A=u[g];if(N&&A[2]?A[1]!==s[A[0]]:!(A[0]in s))return!1}for(;++g<C;){A=u[g];var D=A[0],Y=s[D],X=A[1];if(N&&A[2]){if(Y===n&&!(D in s))return!1}else{var Q=new Bn;if(f)var oe=f(Y,X,D,s,a,Q);if(!(oe===n?is(X,Y,S|M,f,Q):oe))return!1}}return!0}function tm(s){if(!ot(s)||TI(s))return!1;var a=sr(s)?WR:IP;return a.test(lo(s))}function jD(s){return it(s)&&Ft(s)==ji}function HD(s){return it(s)&&Tt(s)==Vn}function qD(s){return it(s)&&Ua(s.length)&&!!Qe[Ft(s)]}function nm(s){return typeof s=="function"?s:s==null?Zt:typeof s=="object"?Ne(s)?im(s[0],s[1]):om(s):kg(s)}function od(s){if(!ls(s))return XR(s);var a=[];for(var u in Ye(s))qe.call(s,u)&&u!="constructor"&&a.push(u);return a}function KD(s){if(!ot(s))return BI(s);var a=ls(s),u=[];for(var f in s)f=="constructor"&&(a||!qe.call(s,f))||u.push(f);return u}function id(s,a){return s<a}function rm(s,a){var u=-1,f=zt(s)?z(s.length):[];return Rr(s,function(g,C,N){f[++u]=a(g,C,N)}),f}function om(s){var a=vd(s);return a.length==1&&a[0][2]?Om(a[0][0],a[0][1]):function(u){return u===s||rd(u,s,a)}}function im(s,a){return bd(s)&&Lm(a)?Om(jn(s),a):function(u){var f=Pd(u,s);return f===n&&f===a?Rd(u,s):is(a,f,S|M)}}function Ta(s,a,u,f,g){s!==a&&Qc(a,function(C,N){if(g||(g=new Bn),ot(C))YD(s,a,N,u,Ta,f,g);else{var A=f?f(kd(s,N),C,N+"",s,a,g):n;A===n&&(A=C),Xc(s,N,A)}},Ut)}function YD(s,a,u,f,g,C,N){var A=kd(s,u),D=kd(a,u),Y=N.get(D);if(Y){Xc(s,u,Y);return}var X=C?C(A,D,u+"",s,a,N):n,Q=X===n;if(Q){var oe=Ne(D),he=!oe&&Lr(D),_e=!oe&&!he&&qo(D);X=D,oe||he||_e?Ne(A)?X=A:at(A)?X=$t(A):he?(Q=!1,X=ym(D,!0)):_e?(Q=!1,X=_m(D,!0)):X=[]:ds(D)||co(D)?(X=A,co(A)?X=fg(A):(!ot(A)||sr(A))&&(X=Fm(D))):Q=!1}Q&&(N.set(D,X),g(X,D,f,C,N),N.delete(D)),Xc(s,u,X)}function sm(s,a){var u=s.length;if(u)return a+=a<0?u:0,ir(a,u)?s[a]:n}function am(s,a,u){a.length?a=tt(a,function(C){return Ne(C)?function(N){return so(N,C.length===1?C[0]:C)}:C}):a=[Zt];var f=-1;a=tt(a,Jt(ge()));var g=rm(s,function(C,N,A){var D=tt(a,function(Y){return Y(C)});return{criteria:D,index:++f,value:C}});return xR(g,function(C,N){return cI(C,N,u)})}function XD(s,a){return lm(s,a,function(u,f){return Rd(s,f)})}function lm(s,a,u){for(var f=-1,g=a.length,C={};++f<g;){var N=a[f],A=so(s,N);u(A,N)&&ss(C,Ir(N,s),A)}return C}function JD(s){return function(a){return so(a,s)}}function sd(s,a,u,f){var g=f?bR:Lo,C=-1,N=a.length,A=s;for(s===a&&(a=$t(a)),u&&(A=tt(s,Jt(u)));++C<N;)for(var D=0,Y=a[C],X=u?u(Y):Y;(D=g(A,X,D,f))>-1;)A!==s&&ya.call(A,D,1),ya.call(s,D,1);return s}function cm(s,a){for(var u=s?a.length:0,f=u-1;u--;){var g=a[u];if(u==f||g!==C){var C=g;ir(g)?ya.call(s,g,1):dd(s,g)}}return s}function ad(s,a){return s+va(Uf()*(a-s+1))}function QD(s,a,u,f){for(var g=-1,C=ht(Ca((a-s)/(u||1)),0),N=z(C);C--;)N[f?C:++g]=s,s+=u;return N}function ld(s,a){var u="";if(!s||a<1||a>K)return u;do a%2&&(u+=s),a=va(a/2),a&&(s+=s);while(a);return u}function Ie(s,a){return Ed(Mm(s,a,Zt),s+"")}function eI(s){return jf(Ko(s))}function tI(s,a){var u=Ko(s);return La(u,io(a,0,u.length))}function ss(s,a,u,f){if(!ot(s))return s;a=Ir(a,s);for(var g=-1,C=a.length,N=C-1,A=s;A!=null&&++g<C;){var D=jn(a[g]),Y=u;if(D==="__proto__"||D==="constructor"||D==="prototype")return s;if(g!=N){var X=A[D];Y=f?f(X,D,A):n,Y===n&&(Y=ot(X)?X:ir(a[g+1])?[]:{})}ns(A,D,Y),A=A[D]}return s}var dm=wa?function(s,a){return wa.set(s,a),s}:Zt,nI=_a?function(s,a){return _a(s,"toString",{configurable:!0,enumerable:!1,value:Id(a),writable:!0})}:Zt;function rI(s){return La(Ko(s))}function cn(s,a,u){var f=-1,g=s.length;a<0&&(a=-a>g?0:g+a),u=u>g?g:u,u<0&&(u+=g),g=a>u?0:u-a>>>0,a>>>=0;for(var C=z(g);++f<g;)C[f]=s[f+a];return C}function oI(s,a){var u;return Rr(s,function(f,g,C){return u=a(f,g,C),!u}),!!u}function Na(s,a,u){var f=0,g=s==null?f:s.length;if(typeof a=="number"&&a===a&&g<=He){for(;f<g;){var C=f+g>>>1,N=s[C];N!==null&&!en(N)&&(u?N<=a:N<a)?f=C+1:g=C}return g}return cd(s,a,Zt,u)}function cd(s,a,u,f){var g=0,C=s==null?0:s.length;if(C===0)return 0;a=u(a);for(var N=a!==a,A=a===null,D=en(a),Y=a===n;g<C;){var X=va((g+C)/2),Q=u(s[X]),oe=Q!==n,he=Q===null,_e=Q===Q,De=en(Q);if(N)var Ce=f||_e;else Y?Ce=_e&&(f||oe):A?Ce=_e&&oe&&(f||!he):D?Ce=_e&&oe&&!he&&(f||!De):he||De?Ce=!1:Ce=f?Q<=a:Q<a;Ce?g=X+1:C=X}return St(C,Ee)}function um(s,a){for(var u=-1,f=s.length,g=0,C=[];++u<f;){var N=s[u],A=a?a(N):N;if(!u||!Pn(A,D)){var D=A;C[g++]=N===0?0:N}}return C}function pm(s){return typeof s=="number"?s:en(s)?pe:+s}function Qt(s){if(typeof s=="string")return s;if(Ne(s))return tt(s,Qt)+"";if(en(s))return Zf?Zf.call(s):"";var a=s+"";return a=="0"&&1/s==-H?"-0":a}function Dr(s,a,u){var f=-1,g=aa,C=s.length,N=!0,A=[],D=A;if(u)N=!1,g=Oc;else if(C>=i){var Y=a?null:mI(s);if(Y)return ca(Y);N=!1,g=Yi,D=new oo}else D=a?[]:A;e:for(;++f<C;){var X=s[f],Q=a?a(X):X;if(X=u||X!==0?X:0,N&&Q===Q){for(var oe=D.length;oe--;)if(D[oe]===Q)continue e;a&&D.push(Q),A.push(X)}else g(D,Q,u)||(D!==A&&D.push(Q),A.push(X))}return A}function dd(s,a){return a=Ir(a,s),s=Gm(s,a),s==null||delete s[jn(dn(a))]}function hm(s,a,u,f){return ss(s,a,u(so(s,a)),f)}function Va(s,a,u,f){for(var g=s.length,C=f?g:-1;(f?C--:++C<g)&&a(s[C],C,s););return u?cn(s,f?0:C,f?C+1:g):cn(s,f?C+1:0,f?g:C)}function fm(s,a){var u=s;return u instanceof Le&&(u=u.value()),Mc(a,function(f,g){return g.func.apply(g.thisArg,Ar([f],g.args))},u)}function ud(s,a,u){var f=s.length;if(f<2)return f?Dr(s[0]):[];for(var g=-1,C=z(f);++g<f;)for(var N=s[g],A=-1;++A<f;)A!=g&&(C[g]=rs(C[g]||N,s[A],a,u));return Dr(wt(C,1),a,u)}function mm(s,a,u){for(var f=-1,g=s.length,C=a.length,N={};++f<g;){var A=f<C?a[f]:n;u(N,s[f],A)}return N}function pd(s){return at(s)?s:[]}function hd(s){return typeof s=="function"?s:Zt}function Ir(s,a){return Ne(s)?s:bd(s,a)?[s]:Zm(je(s))}var iI=Ie;function Fr(s,a,u){var f=s.length;return u=u===n?f:u,!a&&u>=f?s:cn(s,a,u)}var gm=jR||function(s){return vt.clearTimeout(s)};function ym(s,a){if(a)return s.slice();var u=s.length,f=Of?Of(u):new s.constructor(u);return s.copy(f),f}function fd(s){var a=new s.constructor(s.byteLength);return new ma(a).set(new ma(s)),a}function sI(s,a){var u=a?fd(s.buffer):s.buffer;return new s.constructor(u,s.byteOffset,s.byteLength)}function aI(s){var a=new s.constructor(s.source,Qh.exec(s));return a.lastIndex=s.lastIndex,a}function lI(s){return ts?Ye(ts.call(s)):{}}function _m(s,a){var u=a?fd(s.buffer):s.buffer;return new s.constructor(u,s.byteOffset,s.length)}function Cm(s,a){if(s!==a){var u=s!==n,f=s===null,g=s===s,C=en(s),N=a!==n,A=a===null,D=a===a,Y=en(a);if(!A&&!Y&&!C&&s>a||C&&N&&D&&!A&&!Y||f&&N&&D||!u&&D||!g)return 1;if(!f&&!C&&!Y&&s<a||Y&&u&&g&&!f&&!C||A&&u&&g||!N&&g||!D)return-1}return 0}function cI(s,a,u){for(var f=-1,g=s.criteria,C=a.criteria,N=g.length,A=u.length;++f<N;){var D=Cm(g[f],C[f]);if(D){if(f>=A)return D;var Y=u[f];return D*(Y=="desc"?-1:1)}}return s.index-a.index}function vm(s,a,u,f){for(var g=-1,C=s.length,N=u.length,A=-1,D=a.length,Y=ht(C-N,0),X=z(D+Y),Q=!f;++A<D;)X[A]=a[A];for(;++g<N;)(Q||g<C)&&(X[u[g]]=s[g]);for(;Y--;)X[A++]=s[g++];return X}function wm(s,a,u,f){for(var g=-1,C=s.length,N=-1,A=u.length,D=-1,Y=a.length,X=ht(C-A,0),Q=z(X+Y),oe=!f;++g<X;)Q[g]=s[g];for(var he=g;++D<Y;)Q[he+D]=a[D];for(;++N<A;)(oe||g<C)&&(Q[he+u[N]]=s[g++]);return Q}function $t(s,a){var u=-1,f=s.length;for(a||(a=z(f));++u<f;)a[u]=s[u];return a}function Wn(s,a,u,f){var g=!u;u||(u={});for(var C=-1,N=a.length;++C<N;){var A=a[C],D=f?f(u[A],s[A],A,u,s):n;D===n&&(D=s[A]),g?nr(u,A,D):ns(u,A,D)}return u}function dI(s,a){return Wn(s,wd(s),a)}function uI(s,a){return Wn(s,Dm(s),a)}function Aa(s,a){return function(u,f){var g=Ne(u)?gR:RD,C=a?a():{};return g(u,s,ge(f,2),C)}}function Wo(s){return Ie(function(a,u){var f=-1,g=u.length,C=g>1?u[g-1]:n,N=g>2?u[2]:n;for(C=s.length>3&&typeof C=="function"?(g--,C):n,N&&Lt(u[0],u[1],N)&&(C=g<3?n:C,g=1),a=Ye(a);++f<g;){var A=u[f];A&&s(a,A,f,C)}return a})}function bm(s,a){return function(u,f){if(u==null)return u;if(!zt(u))return s(u,f);for(var g=u.length,C=a?g:-1,N=Ye(u);(a?C--:++C<g)&&f(N[C],C,N)!==!1;);return u}}function xm(s){return function(a,u,f){for(var g=-1,C=Ye(a),N=f(a),A=N.length;A--;){var D=N[s?A:++g];if(u(C[D],D,C)===!1)break}return a}}function pI(s,a,u){var f=a&O,g=as(s);function C(){var N=this&&this!==vt&&this instanceof C?g:s;return N.apply(f?u:this,arguments)}return C}function km(s){return function(a){a=je(a);var u=Oo(a)?An(a):n,f=u?u[0]:a.charAt(0),g=u?Fr(u,1).join(""):a.slice(1);return f[s]()+g}}function jo(s){return function(a){return Mc(bg(wg(a).replace(nR,"")),s,"")}}function as(s){return function(){var a=arguments;switch(a.length){case 0:return new s;case 1:return new s(a[0]);case 2:return new s(a[0],a[1]);case 3:return new s(a[0],a[1],a[2]);case 4:return new s(a[0],a[1],a[2],a[3]);case 5:return new s(a[0],a[1],a[2],a[3],a[4]);case 6:return new s(a[0],a[1],a[2],a[3],a[4],a[5]);case 7:return new s(a[0],a[1],a[2],a[3],a[4],a[5],a[6])}var u=Zo(s.prototype),f=s.apply(u,a);return ot(f)?f:u}}function hI(s,a,u){var f=as(s);function g(){for(var C=arguments.length,N=z(C),A=C,D=Ho(g);A--;)N[A]=arguments[A];var Y=C<3&&N[0]!==D&&N[C-1]!==D?[]:Br(N,D);if(C-=Y.length,C<u)return Vm(s,a,Ba,g.placeholder,n,N,Y,n,n,u-C);var X=this&&this!==vt&&this instanceof g?f:s;return Xt(X,this,N)}return g}function Em(s){return function(a,u,f){var g=Ye(a);if(!zt(a)){var C=ge(u,3);a=yt(a),u=function(A){return C(g[A],A,g)}}var N=s(a,u,f);return N>-1?g[C?a[N]:N]:n}}function Sm(s){return or(function(a){var u=a.length,f=u,g=an.prototype.thru;for(s&&a.reverse();f--;){var C=a[f];if(typeof C!="function")throw new sn(c);if(g&&!N&&Ia(C)=="wrapper")var N=new an([],!0)}for(f=N?f:u;++f<u;){C=a[f];var A=Ia(C),D=A=="wrapper"?Cd(C):n;D&&xd(D[0])&&D[1]==(Z|F|P|J)&&!D[4].length&&D[9]==1?N=N[Ia(D[0])].apply(N,D[3]):N=C.length==1&&xd(C)?N[A]():N.thru(C)}return function(){var Y=arguments,X=Y[0];if(N&&Y.length==1&&Ne(X))return N.plant(X).value();for(var Q=0,oe=u?a[Q].apply(this,Y):X;++Q<u;)oe=a[Q].call(this,oe);return oe}})}function Ba(s,a,u,f,g,C,N,A,D,Y){var X=a&Z,Q=a&O,oe=a&v,he=a&(F|W),_e=a&ae,De=oe?n:as(s);function Ce(){for(var Fe=arguments.length,Oe=z(Fe),tn=Fe;tn--;)Oe[tn]=arguments[tn];if(he)var Ot=Ho(Ce),nn=ER(Oe,Ot);if(f&&(Oe=vm(Oe,f,g,he)),C&&(Oe=wm(Oe,C,N,he)),Fe-=nn,he&&Fe<Y){var lt=Br(Oe,Ot);return Vm(s,a,Ba,Ce.placeholder,u,Oe,lt,A,D,Y-Fe)}var Rn=Q?u:this,lr=oe?Rn[s]:s;return Fe=Oe.length,A?Oe=RI(Oe,A):_e&&Fe>1&&Oe.reverse(),X&&D<Fe&&(Oe.length=D),this&&this!==vt&&this instanceof Ce&&(lr=De||as(lr)),lr.apply(Rn,Oe)}return Ce}function Tm(s,a){return function(u,f){return $D(u,s,a(f),{})}}function Pa(s,a){return function(u,f){var g;if(u===n&&f===n)return a;if(u!==n&&(g=u),f!==n){if(g===n)return f;typeof u=="string"||typeof f=="string"?(u=Qt(u),f=Qt(f)):(u=pm(u),f=pm(f)),g=s(u,f)}return g}}function md(s){return or(function(a){return a=tt(a,Jt(ge())),Ie(function(u){var f=this;return s(a,function(g){return Xt(g,f,u)})})})}function Ra(s,a){a=a===n?" ":Qt(a);var u=a.length;if(u<2)return u?ld(a,s):a;var f=ld(a,Ca(s/Mo(a)));return Oo(a)?Fr(An(f),0,s).join(""):f.slice(0,s)}function fI(s,a,u,f){var g=a&O,C=as(s);function N(){for(var A=-1,D=arguments.length,Y=-1,X=f.length,Q=z(X+D),oe=this&&this!==vt&&this instanceof N?C:s;++Y<X;)Q[Y]=f[Y];for(;D--;)Q[Y++]=arguments[++A];return Xt(oe,g?u:this,Q)}return N}function Nm(s){return function(a,u,f){return f&&typeof f!="number"&&Lt(a,u,f)&&(u=f=n),a=ar(a),u===n?(u=a,a=0):u=ar(u),f=f===n?a<u?1:-1:ar(f),QD(a,u,f,s)}}function Da(s){return function(a,u){return typeof a=="string"&&typeof u=="string"||(a=un(a),u=un(u)),s(a,u)}}function Vm(s,a,u,f,g,C,N,A,D,Y){var X=a&F,Q=X?N:n,oe=X?n:N,he=X?C:n,_e=X?n:C;a|=X?P:V,a&=~(X?V:P),a&I||(a&=~(O|v));var De=[s,a,g,he,Q,_e,oe,A,D,Y],Ce=u.apply(n,De);return xd(s)&&$m(Ce,De),Ce.placeholder=f,zm(Ce,s,a)}function gd(s){var a=pt[s];return function(u,f){if(u=un(u),f=f==null?0:St(Be(f),292),f&&zf(u)){var g=(je(u)+"e").split("e"),C=a(g[0]+"e"+(+g[1]+f));return g=(je(C)+"e").split("e"),+(g[0]+"e"+(+g[1]-f))}return a(u)}}var mI=zo&&1/ca(new zo([,-0]))[1]==H?function(s){return new zo(s)}:Od;function Am(s){return function(a){var u=Tt(a);return u==Nn?jc(a):u==Vn?PR(a):kR(a,s(a))}}function rr(s,a,u,f,g,C,N,A){var D=a&v;if(!D&&typeof s!="function")throw new sn(c);var Y=f?f.length:0;if(Y||(a&=~(P|V),f=g=n),N=N===n?N:ht(Be(N),0),A=A===n?A:Be(A),Y-=g?g.length:0,a&V){var X=f,Q=g;f=g=n}var oe=D?n:Cd(s),he=[s,a,u,f,g,X,Q,C,N,A];if(oe&&AI(he,oe),s=he[0],a=he[1],u=he[2],f=he[3],g=he[4],A=he[9]=he[9]===n?D?0:s.length:ht(he[9]-Y,0),!A&&a&(F|W)&&(a&=~(F|W)),!a||a==O)var _e=pI(s,a,u);else a==F||a==W?_e=hI(s,a,A):(a==P||a==(O|P))&&!g.length?_e=fI(s,a,u,f):_e=Ba.apply(n,he);var De=oe?dm:$m;return zm(De(_e,he),s,a)}function Bm(s,a,u,f){return s===n||Pn(s,$o[u])&&!qe.call(f,u)?a:s}function Pm(s,a,u,f,g,C){return ot(s)&&ot(a)&&(C.set(a,s),Ta(s,a,n,Pm,C),C.delete(a)),s}function gI(s){return ds(s)?n:s}function Rm(s,a,u,f,g,C){var N=u&S,A=s.length,D=a.length;if(A!=D&&!(N&&D>A))return!1;var Y=C.get(s),X=C.get(a);if(Y&&X)return Y==a&&X==s;var Q=-1,oe=!0,he=u&M?new oo:n;for(C.set(s,a),C.set(a,s);++Q<A;){var _e=s[Q],De=a[Q];if(f)var Ce=N?f(De,_e,Q,a,s,C):f(_e,De,Q,s,a,C);if(Ce!==n){if(Ce)continue;oe=!1;break}if(he){if(!Gc(a,function(Fe,Oe){if(!Yi(he,Oe)&&(_e===Fe||g(_e,Fe,u,f,C)))return he.push(Oe)})){oe=!1;break}}else if(!(_e===De||g(_e,De,u,f,C))){oe=!1;break}}return C.delete(s),C.delete(a),oe}function yI(s,a,u,f,g,C,N){switch(u){case Io:if(s.byteLength!=a.byteLength||s.byteOffset!=a.byteOffset)return!1;s=s.buffer,a=a.buffer;case Ki:return!(s.byteLength!=a.byteLength||!C(new ma(s),new ma(a)));case Ui:case Zi:case Wi:return Pn(+s,+a);case ta:return s.name==a.name&&s.message==a.message;case ji:case Hi:return s==a+"";case Nn:var A=jc;case Vn:var D=f&S;if(A||(A=ca),s.size!=a.size&&!D)return!1;var Y=N.get(s);if(Y)return Y==a;f|=M,N.set(s,a);var X=Rm(A(s),A(a),f,g,C,N);return N.delete(s),X;case ra:if(ts)return ts.call(s)==ts.call(a)}return!1}function _I(s,a,u,f,g,C){var N=u&S,A=yd(s),D=A.length,Y=yd(a),X=Y.length;if(D!=X&&!N)return!1;for(var Q=D;Q--;){var oe=A[Q];if(!(N?oe in a:qe.call(a,oe)))return!1}var he=C.get(s),_e=C.get(a);if(he&&_e)return he==a&&_e==s;var De=!0;C.set(s,a),C.set(a,s);for(var Ce=N;++Q<D;){oe=A[Q];var Fe=s[oe],Oe=a[oe];if(f)var tn=N?f(Oe,Fe,oe,a,s,C):f(Fe,Oe,oe,s,a,C);if(!(tn===n?Fe===Oe||g(Fe,Oe,u,f,C):tn)){De=!1;break}Ce||(Ce=oe=="constructor")}if(De&&!Ce){var Ot=s.constructor,nn=a.constructor;Ot!=nn&&"constructor"in s&&"constructor"in a&&!(typeof Ot=="function"&&Ot instanceof Ot&&typeof nn=="function"&&nn instanceof nn)&&(De=!1)}return C.delete(s),C.delete(a),De}function or(s){return Ed(Mm(s,n,qm),s+"")}function yd(s){return Qf(s,yt,wd)}function _d(s){return Qf(s,Ut,Dm)}var Cd=wa?function(s){return wa.get(s)}:Od;function Ia(s){for(var a=s.name+"",u=Uo[a],f=qe.call(Uo,a)?u.length:0;f--;){var g=u[f],C=g.func;if(C==null||C==s)return g.name}return a}function Ho(s){var a=qe.call(_,"placeholder")?_:s;return a.placeholder}function ge(){var s=_.iteratee||Fd;return s=s===Fd?nm:s,arguments.length?s(arguments[0],arguments[1]):s}function Fa(s,a){var u=s.__data__;return SI(a)?u[typeof a=="string"?"string":"hash"]:u.map}function vd(s){for(var a=yt(s),u=a.length;u--;){var f=a[u],g=s[f];a[u]=[f,g,Lm(g)]}return a}function ao(s,a){var u=VR(s,a);return tm(u)?u:n}function CI(s){var a=qe.call(s,no),u=s[no];try{s[no]=n;var f=!0}catch{}var g=ha.call(s);return f&&(a?s[no]=u:delete s[no]),g}var wd=qc?function(s){return s==null?[]:(s=Ye(s),Vr(qc(s),function(a){return Gf.call(s,a)}))}:Md,Dm=qc?function(s){for(var a=[];s;)Ar(a,wd(s)),s=ga(s);return a}:Md,Tt=Ft;(Kc&&Tt(new Kc(new ArrayBuffer(1)))!=Io||Ji&&Tt(new Ji)!=Nn||Yc&&Tt(Yc.resolve())!=Kh||zo&&Tt(new zo)!=Vn||Qi&&Tt(new Qi)!=qi)&&(Tt=function(s){var a=Ft(s),u=a==Qn?s.constructor:n,f=u?lo(u):"";if(f)switch(f){case tD:return Io;case nD:return Nn;case rD:return Kh;case oD:return Vn;case iD:return qi}return a});function vI(s,a,u){for(var f=-1,g=u.length;++f<g;){var C=u[f],N=C.size;switch(C.type){case"drop":s+=N;break;case"dropRight":a-=N;break;case"take":a=St(a,s+N);break;case"takeRight":s=ht(s,a-N);break}}return{start:s,end:a}}function wI(s){var a=s.match(TP);return a?a[1].split(NP):[]}function Im(s,a,u){a=Ir(a,s);for(var f=-1,g=a.length,C=!1;++f<g;){var N=jn(a[f]);if(!(C=s!=null&&u(s,N)))break;s=s[N]}return C||++f!=g?C:(g=s==null?0:s.length,!!g&&Ua(g)&&ir(N,g)&&(Ne(s)||co(s)))}function bI(s){var a=s.length,u=new s.constructor(a);return a&&typeof s[0]=="string"&&qe.call(s,"index")&&(u.index=s.index,u.input=s.input),u}function Fm(s){return typeof s.constructor=="function"&&!ls(s)?Zo(ga(s)):{}}function xI(s,a,u){var f=s.constructor;switch(a){case Ki:return fd(s);case Ui:case Zi:return new f(+s);case Io:return sI(s,u);case vc:case wc:case bc:case xc:case kc:case Ec:case Sc:case Tc:case Nc:return _m(s,u);case Nn:return new f;case Wi:case Hi:return new f(s);case ji:return aI(s);case Vn:return new f;case ra:return lI(s)}}function kI(s,a){var u=a.length;if(!u)return s;var f=u-1;return a[f]=(u>1?"& ":"")+a[f],a=a.join(u>2?", ":" "),s.replace(SP,`{
73
73
  /* [wrapped with `+a+`] */
74
- `)}function yI(s){return Ne(s)||lo(s)||!!(Of&&s&&s[Of])}function ir(s,a){var u=typeof s;return a=a??K,!!a&&(u=="number"||u!="symbol"&&VP.test(s))&&s>-1&&s%1==0&&s<a}function Ft(s,a,u){if(!ot(u))return!1;var f=typeof a;return(f=="number"?$t(u)&&ir(a,u.length):f=="string"&&a in u)?Pn(u[a],s):!1}function wd(s,a){if(Ne(s))return!1;var u=typeof s;return u=="number"||u=="symbol"||u=="boolean"||s==null||Qt(s)?!0:fP.test(s)||!hP.test(s)||a!=null&&s in Ye(a)}function _I(s){var a=typeof s;return a=="string"||a=="number"||a=="symbol"||a=="boolean"?s!=="__proto__":s===null}function bd(s){var a=Da(s),u=_[a];if(typeof u!="function"||!(a in Le.prototype))return!1;if(s===u)return!0;var f=_d(u);return!!f&&s===f[0]}function vI(s){return!!Df&&Df in s}var CI=da?sr:Md;function as(s){var a=s&&s.constructor,u=typeof a=="function"&&a.prototype||Go;return s===u}function Dm(s){return s===s&&!ot(s)}function Im(s,a){return function(u){return u==null?!1:u[s]===a&&(a!==n||s in Ye(u))}}function wI(s){var a=Ga(s,function(f){return u.size===h&&u.clear(),f}),u=a.cache;return a}function bI(s,a){var u=s[1],f=a[1],g=u|f,v=g<(O|C|Z),N=f==Z&&u==F||f==Z&&u==J&&s[7].length<=a[8]||f==(Z|J)&&a[7].length<=a[8]&&u==F;if(!(v||N))return s;f&O&&(s[2]=a[2],g|=u&O?0:I);var A=a[3];if(A){var D=s[3];s[3]=D?ym(D,A,a[4]):A,s[4]=D?Br(s[3],m):a[4]}return A=a[5],A&&(D=s[5],s[5]=D?_m(D,A,a[6]):A,s[6]=D?Br(s[5],m):a[6]),A=a[7],A&&(s[7]=A),f&Z&&(s[8]=s[8]==null?a[8]:St(s[8],a[8])),s[9]==null&&(s[9]=a[9]),s[0]=a[0],s[1]=g,s}function xI(s){var a=[];if(s!=null)for(var u in Ye(s))a.push(u);return a}function kI(s){return pa.call(s)}function Fm(s,a,u){return a=ht(a===n?s.length-1:a,0),function(){for(var f=arguments,g=-1,v=ht(f.length-a,0),N=z(v);++g<v;)N[g]=f[a+g];g=-1;for(var A=z(a+1);++g<a;)A[g]=f[g];return A[a]=u(N),Yt(s,this,A)}}function Lm(s,a){return a.length<2?s:io(s,cn(a,0,-1))}function EI(s,a){for(var u=s.length,f=St(a.length,u),g=Gt(s);f--;){var v=a[f];s[f]=ir(v,u)?g[v]:n}return s}function xd(s,a){if(!(a==="constructor"&&typeof s[a]=="function")&&a!="__proto__")return s[a]}var Om=Gm(am),ls=GR||function(s,a){return Ct.setTimeout(s,a)},kd=Gm(qD);function Mm(s,a,u){var f=a+"";return kd(s,gI(f,SI(hI(f),u)))}function Gm(s){var a=0,u=0;return function(){var f=ZR(),g=k-(f-u);if(u=f,g>0){if(++a>=U)return arguments[0]}else a=0;return s.apply(n,arguments)}}function Fa(s,a){var u=-1,f=s.length,g=f-1;for(a=a===n?f:a;++u<a;){var v=sd(u,g),N=s[v];s[v]=s[u],s[u]=N}return s.length=a,s}var $m=wI(function(s){var a=[];return s.charCodeAt(0)===46&&a.push(""),s.replace(mP,function(u,f,g,v){a.push(g?v.replace(xP,"$1"):f||u)}),a});function jn(s){if(typeof s=="string"||Qt(s))return s;var a=s+"";return a=="0"&&1/s==-H?"-0":a}function ao(s){if(s!=null){try{return ua.call(s)}catch{}try{return s+""}catch{}}return""}function SI(s,a){return on(Dt,function(u){var f="_."+u[0];a&u[1]&&!sa(s,f)&&s.push(f)}),s.sort()}function zm(s){if(s instanceof Le)return s.clone();var a=new an(s.__wrapped__,s.__chain__);return a.__actions__=Gt(s.__actions__),a.__index__=s.__index__,a.__values__=s.__values__,a}function TI(s,a,u){(u?Ft(s,a,u):a===n)?a=1:a=ht(Be(a),0);var f=s==null?0:s.length;if(!f||a<1)return[];for(var g=0,v=0,N=z(_a(f/a));g<f;)N[v++]=cn(s,g,g+=a);return N}function NI(s){for(var a=-1,u=s==null?0:s.length,f=0,g=[];++a<u;){var v=s[a];v&&(g[f++]=v)}return g}function VI(){var s=arguments.length;if(!s)return[];for(var a=z(s-1),u=arguments[0],f=s;f--;)a[f-1]=arguments[f];return Ar(Ne(u)?Gt(u):[u],wt(a,1))}var AI=Ie(function(s,a){return at(s)?ns(s,wt(a,1,at,!0)):[]}),BI=Ie(function(s,a){var u=dn(a);return at(u)&&(u=n),at(s)?ns(s,wt(a,1,at,!0),ge(u,2)):[]}),PI=Ie(function(s,a){var u=dn(a);return at(u)&&(u=n),at(s)?ns(s,wt(a,1,at,!0),n,u):[]});function RI(s,a,u){var f=s==null?0:s.length;return f?(a=u||a===n?1:Be(a),cn(s,a<0?0:a,f)):[]}function DI(s,a,u){var f=s==null?0:s.length;return f?(a=u||a===n?1:Be(a),a=f-a,cn(s,0,a<0?0:a)):[]}function II(s,a){return s&&s.length?Na(s,ge(a,3),!0,!0):[]}function FI(s,a){return s&&s.length?Na(s,ge(a,3),!0):[]}function LI(s,a,u,f){var g=s==null?0:s.length;return g?(u&&typeof u!="number"&&Ft(s,a,u)&&(u=0,f=g),VD(s,a,u,f)):[]}function Um(s,a,u){var f=s==null?0:s.length;if(!f)return-1;var g=u==null?0:Be(u);return g<0&&(g=ht(f+g,0)),aa(s,ge(a,3),g)}function Zm(s,a,u){var f=s==null?0:s.length;if(!f)return-1;var g=f-1;return u!==n&&(g=Be(u),g=u<0?ht(f+g,0):St(g,f-1)),aa(s,ge(a,3),g,!0)}function Wm(s){var a=s==null?0:s.length;return a?wt(s,1):[]}function OI(s){var a=s==null?0:s.length;return a?wt(s,H):[]}function MI(s,a){var u=s==null?0:s.length;return u?(a=a===n?1:Be(a),wt(s,a)):[]}function GI(s){for(var a=-1,u=s==null?0:s.length,f={};++a<u;){var g=s[a];f[g[0]]=g[1]}return f}function jm(s){return s&&s.length?s[0]:n}function $I(s,a,u){var f=s==null?0:s.length;if(!f)return-1;var g=u==null?0:Be(u);return g<0&&(g=ht(f+g,0)),Fo(s,a,g)}function zI(s){var a=s==null?0:s.length;return a?cn(s,0,-1):[]}var UI=Ie(function(s){var a=tt(s,ud);return a.length&&a[0]===s[0]?td(a):[]}),ZI=Ie(function(s){var a=dn(s),u=tt(s,ud);return a===dn(u)?a=n:u.pop(),u.length&&u[0]===s[0]?td(u,ge(a,2)):[]}),WI=Ie(function(s){var a=dn(s),u=tt(s,ud);return a=typeof a=="function"?a:n,a&&u.pop(),u.length&&u[0]===s[0]?td(u,n,a):[]});function jI(s,a){return s==null?"":zR.call(s,a)}function dn(s){var a=s==null?0:s.length;return a?s[a-1]:n}function HI(s,a,u){var f=s==null?0:s.length;if(!f)return-1;var g=f;return u!==n&&(g=Be(u),g=g<0?ht(f+g,0):St(g,f-1)),a===a?SR(s,a,g):aa(s,Sf,g,!0)}function qI(s,a){return s&&s.length?rm(s,Be(a)):n}var KI=Ie(Hm);function Hm(s,a){return s&&s.length&&a&&a.length?id(s,a):s}function YI(s,a,u){return s&&s.length&&a&&a.length?id(s,a,ge(u,2)):s}function XI(s,a,u){return s&&s.length&&a&&a.length?id(s,a,n,u):s}var JI=or(function(s,a){var u=s==null?0:s.length,f=Xc(s,a);return sm(s,tt(a,function(g){return ir(g,u)?+g:g}).sort(gm)),f});function QI(s,a){var u=[];if(!(s&&s.length))return u;var f=-1,g=[],v=s.length;for(a=ge(a,3);++f<v;){var N=s[f];a(N,f,s)&&(u.push(N),g.push(f))}return sm(s,g),u}function Ed(s){return s==null?s:jR.call(s)}function eF(s,a,u){var f=s==null?0:s.length;return f?(u&&typeof u!="number"&&Ft(s,a,u)?(a=0,u=f):(a=a==null?0:Be(a),u=u===n?f:Be(u)),cn(s,a,u)):[]}function tF(s,a){return Ta(s,a)}function nF(s,a,u){return ld(s,a,ge(u,2))}function rF(s,a){var u=s==null?0:s.length;if(u){var f=Ta(s,a);if(f<u&&Pn(s[f],a))return f}return-1}function oF(s,a){return Ta(s,a,!0)}function iF(s,a,u){return ld(s,a,ge(u,2),!0)}function sF(s,a){var u=s==null?0:s.length;if(u){var f=Ta(s,a,!0)-1;if(Pn(s[f],a))return f}return-1}function aF(s){return s&&s.length?lm(s):[]}function lF(s,a){return s&&s.length?lm(s,ge(a,2)):[]}function cF(s){var a=s==null?0:s.length;return a?cn(s,1,a):[]}function dF(s,a,u){return s&&s.length?(a=u||a===n?1:Be(a),cn(s,0,a<0?0:a)):[]}function uF(s,a,u){var f=s==null?0:s.length;return f?(a=u||a===n?1:Be(a),a=f-a,cn(s,a<0?0:a,f)):[]}function pF(s,a){return s&&s.length?Na(s,ge(a,3),!1,!0):[]}function hF(s,a){return s&&s.length?Na(s,ge(a,3)):[]}var fF=Ie(function(s){return Dr(wt(s,1,at,!0))}),mF=Ie(function(s){var a=dn(s);return at(a)&&(a=n),Dr(wt(s,1,at,!0),ge(a,2))}),gF=Ie(function(s){var a=dn(s);return a=typeof a=="function"?a:n,Dr(wt(s,1,at,!0),n,a)});function yF(s){return s&&s.length?Dr(s):[]}function _F(s,a){return s&&s.length?Dr(s,ge(a,2)):[]}function vF(s,a){return a=typeof a=="function"?a:n,s&&s.length?Dr(s,n,a):[]}function Sd(s){if(!(s&&s.length))return[];var a=0;return s=Vr(s,function(u){if(at(u))return a=ht(u.length,a),!0}),Uc(a,function(u){return tt(s,Gc(u))})}function qm(s,a){if(!(s&&s.length))return[];var u=Sd(s);return a==null?u:tt(u,function(f){return Yt(a,n,f)})}var CF=Ie(function(s,a){return at(s)?ns(s,a):[]}),wF=Ie(function(s){return dd(Vr(s,at))}),bF=Ie(function(s){var a=dn(s);return at(a)&&(a=n),dd(Vr(s,at),ge(a,2))}),xF=Ie(function(s){var a=dn(s);return a=typeof a=="function"?a:n,dd(Vr(s,at),n,a)}),kF=Ie(Sd);function EF(s,a){return pm(s||[],a||[],ts)}function SF(s,a){return pm(s||[],a||[],is)}var TF=Ie(function(s){var a=s.length,u=a>1?s[a-1]:n;return u=typeof u=="function"?(s.pop(),u):n,qm(s,u)});function Km(s){var a=_(s);return a.__chain__=!0,a}function NF(s,a){return a(s),s}function La(s,a){return a(s)}var VF=or(function(s){var a=s.length,u=a?s[0]:0,f=this.__wrapped__,g=function(v){return Xc(v,s)};return a>1||this.__actions__.length||!(f instanceof Le)||!ir(u)?this.thru(g):(f=f.slice(u,+u+(a?1:0)),f.__actions__.push({func:La,args:[g],thisArg:n}),new an(f,this.__chain__).thru(function(v){return a&&!v.length&&v.push(n),v}))});function AF(){return Km(this)}function BF(){return new an(this.value(),this.__chain__)}function PF(){this.__values__===n&&(this.__values__=cg(this.value()));var s=this.__index__>=this.__values__.length,a=s?n:this.__values__[this.__index__++];return{done:s,value:a}}function RF(){return this}function DF(s){for(var a,u=this;u instanceof ba;){var f=zm(u);f.__index__=0,f.__values__=n,a?g.__wrapped__=f:a=f;var g=f;u=u.__wrapped__}return g.__wrapped__=s,a}function IF(){var s=this.__wrapped__;if(s instanceof Le){var a=s;return this.__actions__.length&&(a=new Le(this)),a=a.reverse(),a.__actions__.push({func:La,args:[Ed],thisArg:n}),new an(a,this.__chain__)}return this.thru(Ed)}function FF(){return um(this.__wrapped__,this.__actions__)}var LF=Va(function(s,a,u){qe.call(s,u)?++s[u]:nr(s,u,1)});function OF(s,a,u){var f=Ne(s)?kf:ND;return u&&Ft(s,a,u)&&(a=n),f(s,ge(a,3))}function MF(s,a){var u=Ne(s)?Vr:qf;return u(s,ge(a,3))}var GF=bm(Um),$F=bm(Zm);function zF(s,a){return wt(Oa(s,a),1)}function UF(s,a){return wt(Oa(s,a),H)}function ZF(s,a,u){return u=u===n?1:Be(u),wt(Oa(s,a),u)}function Ym(s,a){var u=Ne(s)?on:Rr;return u(s,ge(a,3))}function Xm(s,a){var u=Ne(s)?cR:Hf;return u(s,ge(a,3))}var WF=Va(function(s,a,u){qe.call(s,u)?s[u].push(a):nr(s,u,[a])});function jF(s,a,u,f){s=$t(s)?s:qo(s),u=u&&!f?Be(u):0;var g=s.length;return u<0&&(u=ht(g+u,0)),Ua(s)?u<=g&&s.indexOf(a,u)>-1:!!g&&Fo(s,a,u)>-1}var HF=Ie(function(s,a,u){var f=-1,g=typeof a=="function",v=$t(s)?z(s.length):[];return Rr(s,function(N){v[++f]=g?Yt(a,N,u):rs(N,a,u)}),v}),qF=Va(function(s,a,u){nr(s,u,a)});function Oa(s,a){var u=Ne(s)?tt:em;return u(s,ge(a,3))}function KF(s,a,u,f){return s==null?[]:(Ne(a)||(a=a==null?[]:[a]),u=f?n:u,Ne(u)||(u=u==null?[]:[u]),om(s,a,u))}var YF=Va(function(s,a,u){s[u?0:1].push(a)},function(){return[[],[]]});function XF(s,a,u){var f=Ne(s)?Oc:Nf,g=arguments.length<3;return f(s,ge(a,4),u,g,Rr)}function JF(s,a,u){var f=Ne(s)?dR:Nf,g=arguments.length<3;return f(s,ge(a,4),u,g,Hf)}function QF(s,a){var u=Ne(s)?Vr:qf;return u(s,$a(ge(a,3)))}function eL(s){var a=Ne(s)?Uf:jD;return a(s)}function tL(s,a,u){(u?Ft(s,a,u):a===n)?a=1:a=Be(a);var f=Ne(s)?xD:HD;return f(s,a)}function nL(s){var a=Ne(s)?kD:KD;return a(s)}function rL(s){if(s==null)return 0;if($t(s))return Ua(s)?Oo(s):s.length;var a=Tt(s);return a==Nn||a==Vn?s.size:rd(s).length}function oL(s,a,u){var f=Ne(s)?Mc:YD;return u&&Ft(s,a,u)&&(a=n),f(s,ge(a,3))}var iL=Ie(function(s,a){if(s==null)return[];var u=a.length;return u>1&&Ft(s,a[0],a[1])?a=[]:u>2&&Ft(a[0],a[1],a[2])&&(a=[a[0]]),om(s,wt(a,1),[])}),Ma=MR||function(){return Ct.Date.now()};function sL(s,a){if(typeof a!="function")throw new sn(c);return s=Be(s),function(){if(--s<1)return a.apply(this,arguments)}}function Jm(s,a,u){return a=u?n:a,a=s&&a==null?s.length:a,rr(s,Z,n,n,n,n,a)}function Qm(s,a){var u;if(typeof a!="function")throw new sn(c);return s=Be(s),function(){return--s>0&&(u=a.apply(this,arguments)),s<=1&&(a=n),u}}var Td=Ie(function(s,a,u){var f=O;if(u.length){var g=Br(u,jo(Td));f|=P}return rr(s,f,a,u,g)}),eg=Ie(function(s,a,u){var f=O|C;if(u.length){var g=Br(u,jo(eg));f|=P}return rr(a,f,s,u,g)});function tg(s,a,u){a=u?n:a;var f=rr(s,F,n,n,n,n,n,a);return f.placeholder=tg.placeholder,f}function ng(s,a,u){a=u?n:a;var f=rr(s,W,n,n,n,n,n,a);return f.placeholder=ng.placeholder,f}function rg(s,a,u){var f,g,v,N,A,D,Y=0,X=!1,Q=!1,oe=!0;if(typeof s!="function")throw new sn(c);a=un(a)||0,ot(u)&&(X=!!u.leading,Q="maxWait"in u,v=Q?ht(un(u.maxWait)||0,a):v,oe="trailing"in u?!!u.trailing:oe);function he(lt){var Rn=f,lr=g;return f=g=n,Y=lt,N=s.apply(lr,Rn),N}function _e(lt){return Y=lt,A=ls(Fe,a),X?he(lt):N}function De(lt){var Rn=lt-D,lr=lt-Y,bg=a-Rn;return Q?St(bg,v-lr):bg}function ve(lt){var Rn=lt-D,lr=lt-Y;return D===n||Rn>=a||Rn<0||Q&&lr>=v}function Fe(){var lt=Ma();if(ve(lt))return Oe(lt);A=ls(Fe,De(lt))}function Oe(lt){return A=n,oe&&f?he(lt):(f=g=n,N)}function en(){A!==n&&hm(A),Y=0,f=D=g=A=n}function Lt(){return A===n?N:Oe(Ma())}function tn(){var lt=Ma(),Rn=ve(lt);if(f=arguments,g=this,D=lt,Rn){if(A===n)return _e(D);if(Q)return hm(A),A=ls(Fe,a),he(D)}return A===n&&(A=ls(Fe,a)),N}return tn.cancel=en,tn.flush=Lt,tn}var aL=Ie(function(s,a){return jf(s,1,a)}),lL=Ie(function(s,a,u){return jf(s,un(a)||0,u)});function cL(s){return rr(s,ae)}function Ga(s,a){if(typeof s!="function"||a!=null&&typeof a!="function")throw new sn(c);var u=function(){var f=arguments,g=a?a.apply(this,f):f[0],v=u.cache;if(v.has(g))return v.get(g);var N=s.apply(this,f);return u.cache=v.set(g,N)||v,N};return u.cache=new(Ga.Cache||tr),u}Ga.Cache=tr;function $a(s){if(typeof s!="function")throw new sn(c);return function(){var a=arguments;switch(a.length){case 0:return!s.call(this);case 1:return!s.call(this,a[0]);case 2:return!s.call(this,a[0],a[1]);case 3:return!s.call(this,a[0],a[1],a[2])}return!s.apply(this,a)}}function dL(s){return Qm(2,s)}var uL=XD(function(s,a){a=a.length==1&&Ne(a[0])?tt(a[0],Xt(ge())):tt(wt(a,1),Xt(ge()));var u=a.length;return Ie(function(f){for(var g=-1,v=St(f.length,u);++g<v;)f[g]=a[g].call(this,f[g]);return Yt(s,this,f)})}),Nd=Ie(function(s,a){var u=Br(a,jo(Nd));return rr(s,P,n,a,u)}),og=Ie(function(s,a){var u=Br(a,jo(og));return rr(s,V,n,a,u)}),pL=or(function(s,a){return rr(s,J,n,n,n,a)});function hL(s,a){if(typeof s!="function")throw new sn(c);return a=a===n?a:Be(a),Ie(s,a)}function fL(s,a){if(typeof s!="function")throw new sn(c);return a=a==null?0:ht(Be(a),0),Ie(function(u){var f=u[a],g=Fr(u,0,a);return f&&Ar(g,f),Yt(s,this,g)})}function mL(s,a,u){var f=!0,g=!0;if(typeof s!="function")throw new sn(c);return ot(u)&&(f="leading"in u?!!u.leading:f,g="trailing"in u?!!u.trailing:g),rg(s,a,{leading:f,maxWait:a,trailing:g})}function gL(s){return Jm(s,1)}function yL(s,a){return Nd(pd(a),s)}function _L(){if(!arguments.length)return[];var s=arguments[0];return Ne(s)?s:[s]}function vL(s){return ln(s,w)}function CL(s,a){return a=typeof a=="function"?a:n,ln(s,w,a)}function wL(s){return ln(s,y|w)}function bL(s,a){return a=typeof a=="function"?a:n,ln(s,y|w,a)}function xL(s,a){return a==null||Wf(s,a,yt(a))}function Pn(s,a){return s===a||s!==s&&a!==a}var kL=Ra(ed),EL=Ra(function(s,a){return s>=a}),lo=Xf(function(){return arguments}())?Xf:function(s){return it(s)&&qe.call(s,"callee")&&!Lf.call(s,"callee")},Ne=z.isArray,SL=_f?Xt(_f):DD;function $t(s){return s!=null&&za(s.length)&&!sr(s)}function at(s){return it(s)&&$t(s)}function TL(s){return s===!0||s===!1||it(s)&&It(s)==zi}var Lr=$R||Md,NL=vf?Xt(vf):ID;function VL(s){return it(s)&&s.nodeType===1&&!cs(s)}function AL(s){if(s==null)return!0;if($t(s)&&(Ne(s)||typeof s=="string"||typeof s.splice=="function"||Lr(s)||Ho(s)||lo(s)))return!s.length;var a=Tt(s);if(a==Nn||a==Vn)return!s.size;if(as(s))return!rd(s).length;for(var u in s)if(qe.call(s,u))return!1;return!0}function BL(s,a){return os(s,a)}function PL(s,a,u){u=typeof u=="function"?u:n;var f=u?u(s,a):n;return f===n?os(s,a,n,u):!!f}function Vd(s){if(!it(s))return!1;var a=It(s);return a==ea||a==tP||typeof s.message=="string"&&typeof s.name=="string"&&!cs(s)}function RL(s){return typeof s=="number"&&Mf(s)}function sr(s){if(!ot(s))return!1;var a=It(s);return a==ta||a==Wh||a==eP||a==rP}function ig(s){return typeof s=="number"&&s==Be(s)}function za(s){return typeof s=="number"&&s>-1&&s%1==0&&s<=K}function ot(s){var a=typeof s;return s!=null&&(a=="object"||a=="function")}function it(s){return s!=null&&typeof s=="object"}var sg=Cf?Xt(Cf):LD;function DL(s,a){return s===a||nd(s,a,vd(a))}function IL(s,a,u){return u=typeof u=="function"?u:n,nd(s,a,vd(a),u)}function FL(s){return ag(s)&&s!=+s}function LL(s){if(CI(s))throw new Te(l);return Jf(s)}function OL(s){return s===null}function ML(s){return s==null}function ag(s){return typeof s=="number"||it(s)&&It(s)==Zi}function cs(s){if(!it(s)||It(s)!=Qn)return!1;var a=ma(s);if(a===null)return!0;var u=qe.call(a,"constructor")&&a.constructor;return typeof u=="function"&&u instanceof u&&ua.call(u)==IR}var Ad=wf?Xt(wf):OD;function GL(s){return ig(s)&&s>=-K&&s<=K}var lg=bf?Xt(bf):MD;function Ua(s){return typeof s=="string"||!Ne(s)&&it(s)&&It(s)==ji}function Qt(s){return typeof s=="symbol"||it(s)&&It(s)==na}var Ho=xf?Xt(xf):GD;function $L(s){return s===n}function zL(s){return it(s)&&Tt(s)==Hi}function UL(s){return it(s)&&It(s)==iP}var ZL=Ra(od),WL=Ra(function(s,a){return s<=a});function cg(s){if(!s)return[];if($t(s))return Ua(s)?An(s):Gt(s);if(Yi&&s[Yi])return xR(s[Yi]());var a=Tt(s),u=a==Nn?Wc:a==Vn?la:qo;return u(s)}function ar(s){if(!s)return s===0?s:0;if(s=un(s),s===H||s===-H){var a=s<0?-1:1;return a*ne}return s===s?s:0}function Be(s){var a=ar(s),u=a%1;return a===a?u?a-u:a:0}function dg(s){return s?oo(Be(s),0,ke):0}function un(s){if(typeof s=="number")return s;if(Qt(s))return pe;if(ot(s)){var a=typeof s.valueOf=="function"?s.valueOf():s;s=ot(a)?a+"":a}if(typeof s!="string")return s===0?s:+s;s=Vf(s);var u=SP.test(s);return u||NP.test(s)?sR(s.slice(2),u?2:8):EP.test(s)?pe:+s}function ug(s){return Wn(s,zt(s))}function jL(s){return s?oo(Be(s),-K,K):s===0?s:0}function je(s){return s==null?"":Jt(s)}var HL=Zo(function(s,a){if(as(a)||$t(a)){Wn(a,yt(a),s);return}for(var u in a)qe.call(a,u)&&ts(s,u,a[u])}),pg=Zo(function(s,a){Wn(a,zt(a),s)}),Za=Zo(function(s,a,u,f){Wn(a,zt(a),s,f)}),qL=Zo(function(s,a,u,f){Wn(a,yt(a),s,f)}),KL=or(Xc);function YL(s,a){var u=Uo(s);return a==null?u:Zf(u,a)}var XL=Ie(function(s,a){s=Ye(s);var u=-1,f=a.length,g=f>2?a[2]:n;for(g&&Ft(a[0],a[1],g)&&(f=1);++u<f;)for(var v=a[u],N=zt(v),A=-1,D=N.length;++A<D;){var Y=N[A],X=s[Y];(X===n||Pn(X,Go[Y])&&!qe.call(s,Y))&&(s[Y]=v[Y])}return s}),JL=Ie(function(s){return s.push(n,Vm),Yt(hg,n,s)});function QL(s,a){return Ef(s,ge(a,3),Zn)}function eO(s,a){return Ef(s,ge(a,3),Qc)}function tO(s,a){return s==null?s:Jc(s,ge(a,3),zt)}function nO(s,a){return s==null?s:Kf(s,ge(a,3),zt)}function rO(s,a){return s&&Zn(s,ge(a,3))}function oO(s,a){return s&&Qc(s,ge(a,3))}function iO(s){return s==null?[]:Ea(s,yt(s))}function sO(s){return s==null?[]:Ea(s,zt(s))}function Bd(s,a,u){var f=s==null?n:io(s,a);return f===n?u:f}function aO(s,a){return s!=null&&Pm(s,a,AD)}function Pd(s,a){return s!=null&&Pm(s,a,BD)}var lO=km(function(s,a,u){a!=null&&typeof a.toString!="function"&&(a=pa.call(a)),s[a]=u},Dd(Ut)),cO=km(function(s,a,u){a!=null&&typeof a.toString!="function"&&(a=pa.call(a)),qe.call(s,a)?s[a].push(u):s[a]=[u]},ge),dO=Ie(rs);function yt(s){return $t(s)?zf(s):rd(s)}function zt(s){return $t(s)?zf(s,!0):$D(s)}function uO(s,a){var u={};return a=ge(a,3),Zn(s,function(f,g,v){nr(u,a(f,g,v),f)}),u}function pO(s,a){var u={};return a=ge(a,3),Zn(s,function(f,g,v){nr(u,g,a(f,g,v))}),u}var hO=Zo(function(s,a,u){Sa(s,a,u)}),hg=Zo(function(s,a,u,f){Sa(s,a,u,f)}),fO=or(function(s,a){var u={};if(s==null)return u;var f=!1;a=tt(a,function(v){return v=Ir(v,s),f||(f=v.length>1),v}),Wn(s,yd(s),u),f&&(u=ln(u,y|b|w,lI));for(var g=a.length;g--;)cd(u,a[g]);return u});function mO(s,a){return fg(s,$a(ge(a)))}var gO=or(function(s,a){return s==null?{}:UD(s,a)});function fg(s,a){if(s==null)return{};var u=tt(yd(s),function(f){return[f]});return a=ge(a),im(s,u,function(f,g){return a(f,g[0])})}function yO(s,a,u){a=Ir(a,s);var f=-1,g=a.length;for(g||(g=1,s=n);++f<g;){var v=s==null?n:s[jn(a[f])];v===n&&(f=g,v=u),s=sr(v)?v.call(s):v}return s}function _O(s,a,u){return s==null?s:is(s,a,u)}function vO(s,a,u,f){return f=typeof f=="function"?f:n,s==null?s:is(s,a,u,f)}var mg=Tm(yt),gg=Tm(zt);function CO(s,a,u){var f=Ne(s),g=f||Lr(s)||Ho(s);if(a=ge(a,4),u==null){var v=s&&s.constructor;g?u=f?new v:[]:ot(s)?u=sr(v)?Uo(ma(s)):{}:u={}}return(g?on:Zn)(s,function(N,A,D){return a(u,N,A,D)}),u}function wO(s,a){return s==null?!0:cd(s,a)}function bO(s,a,u){return s==null?s:dm(s,a,pd(u))}function xO(s,a,u,f){return f=typeof f=="function"?f:n,s==null?s:dm(s,a,pd(u),f)}function qo(s){return s==null?[]:Zc(s,yt(s))}function kO(s){return s==null?[]:Zc(s,zt(s))}function EO(s,a,u){return u===n&&(u=a,a=n),u!==n&&(u=un(u),u=u===u?u:0),a!==n&&(a=un(a),a=a===a?a:0),oo(un(s),a,u)}function SO(s,a,u){return a=ar(a),u===n?(u=a,a=0):u=ar(u),s=un(s),PD(s,a,u)}function TO(s,a,u){if(u&&typeof u!="boolean"&&Ft(s,a,u)&&(a=u=n),u===n&&(typeof a=="boolean"?(u=a,a=n):typeof s=="boolean"&&(u=s,s=n)),s===n&&a===n?(s=0,a=1):(s=ar(s),a===n?(a=s,s=0):a=ar(a)),s>a){var f=s;s=a,a=f}if(u||s%1||a%1){var g=Gf();return St(s+g*(a-s+iR("1e-"+((g+"").length-1))),a)}return sd(s,a)}var NO=Wo(function(s,a,u){return a=a.toLowerCase(),s+(u?yg(a):a)});function yg(s){return Rd(je(s).toLowerCase())}function _g(s){return s=je(s),s&&s.replace(AP,_R).replace(KP,"")}function VO(s,a,u){s=je(s),a=Jt(a);var f=s.length;u=u===n?f:oo(Be(u),0,f);var g=u;return u-=a.length,u>=0&&s.slice(u,g)==a}function AO(s){return s=je(s),s&&dP.test(s)?s.replace(qh,vR):s}function BO(s){return s=je(s),s&&gP.test(s)?s.replace(Nc,"\\$&"):s}var PO=Wo(function(s,a,u){return s+(u?"-":"")+a.toLowerCase()}),RO=Wo(function(s,a,u){return s+(u?" ":"")+a.toLowerCase()}),DO=wm("toLowerCase");function IO(s,a,u){s=je(s),a=Be(a);var f=a?Oo(s):0;if(!a||f>=a)return s;var g=(a-f)/2;return Pa(va(g),u)+s+Pa(_a(g),u)}function FO(s,a,u){s=je(s),a=Be(a);var f=a?Oo(s):0;return a&&f<a?s+Pa(a-f,u):s}function LO(s,a,u){s=je(s),a=Be(a);var f=a?Oo(s):0;return a&&f<a?Pa(a-f,u)+s:s}function OO(s,a,u){return u||a==null?a=0:a&&(a=+a),WR(je(s).replace(Vc,""),a||0)}function MO(s,a,u){return(u?Ft(s,a,u):a===n)?a=1:a=Be(a),ad(je(s),a)}function GO(){var s=arguments,a=je(s[0]);return s.length<3?a:a.replace(s[1],s[2])}var $O=Wo(function(s,a,u){return s+(u?"_":"")+a.toLowerCase()});function zO(s,a,u){return u&&typeof u!="number"&&Ft(s,a,u)&&(a=u=n),u=u===n?ke:u>>>0,u?(s=je(s),s&&(typeof a=="string"||a!=null&&!Ad(a))&&(a=Jt(a),!a&&Lo(s))?Fr(An(s),0,u):s.split(a,u)):[]}var UO=Wo(function(s,a,u){return s+(u?" ":"")+Rd(a)});function ZO(s,a,u){return s=je(s),u=u==null?0:oo(Be(u),0,s.length),a=Jt(a),s.slice(u,u+a.length)==a}function WO(s,a,u){var f=_.templateSettings;u&&Ft(s,a,u)&&(a=n),s=je(s),a=Za({},a,f,Nm);var g=Za({},a.imports,f.imports,Nm),v=yt(g),N=Zc(g,v),A,D,Y=0,X=a.interpolate||ra,Q="__p += '",oe=jc((a.escape||ra).source+"|"+X.source+"|"+(X===Kh?kP:ra).source+"|"+(a.evaluate||ra).source+"|$","g"),he="//# sourceURL="+(qe.call(a,"sourceURL")?(a.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++eR+"]")+`
75
- `;s.replace(oe,function(ve,Fe,Oe,en,Lt,tn){return Oe||(Oe=en),Q+=s.slice(Y,tn).replace(BP,CR),Fe&&(A=!0,Q+=`' +
74
+ `)}function EI(s){return Ne(s)||co(s)||!!($f&&s&&s[$f])}function ir(s,a){var u=typeof s;return a=a??K,!!a&&(u=="number"||u!="symbol"&&LP.test(s))&&s>-1&&s%1==0&&s<a}function Lt(s,a,u){if(!ot(u))return!1;var f=typeof a;return(f=="number"?zt(u)&&ir(a,u.length):f=="string"&&a in u)?Pn(u[a],s):!1}function bd(s,a){if(Ne(s))return!1;var u=typeof s;return u=="number"||u=="symbol"||u=="boolean"||s==null||en(s)?!0:bP.test(s)||!wP.test(s)||a!=null&&s in Ye(a)}function SI(s){var a=typeof s;return a=="string"||a=="number"||a=="symbol"||a=="boolean"?s!=="__proto__":s===null}function xd(s){var a=Ia(s),u=_[a];if(typeof u!="function"||!(a in Le.prototype))return!1;if(s===u)return!0;var f=Cd(u);return!!f&&s===f[0]}function TI(s){return!!Lf&&Lf in s}var NI=ua?sr:Gd;function ls(s){var a=s&&s.constructor,u=typeof a=="function"&&a.prototype||$o;return s===u}function Lm(s){return s===s&&!ot(s)}function Om(s,a){return function(u){return u==null?!1:u[s]===a&&(a!==n||s in Ye(u))}}function VI(s){var a=$a(s,function(f){return u.size===h&&u.clear(),f}),u=a.cache;return a}function AI(s,a){var u=s[1],f=a[1],g=u|f,C=g<(O|v|Z),N=f==Z&&u==F||f==Z&&u==J&&s[7].length<=a[8]||f==(Z|J)&&a[7].length<=a[8]&&u==F;if(!(C||N))return s;f&O&&(s[2]=a[2],g|=u&O?0:I);var A=a[3];if(A){var D=s[3];s[3]=D?vm(D,A,a[4]):A,s[4]=D?Br(s[3],m):a[4]}return A=a[5],A&&(D=s[5],s[5]=D?wm(D,A,a[6]):A,s[6]=D?Br(s[5],m):a[6]),A=a[7],A&&(s[7]=A),f&Z&&(s[8]=s[8]==null?a[8]:St(s[8],a[8])),s[9]==null&&(s[9]=a[9]),s[0]=a[0],s[1]=g,s}function BI(s){var a=[];if(s!=null)for(var u in Ye(s))a.push(u);return a}function PI(s){return ha.call(s)}function Mm(s,a,u){return a=ht(a===n?s.length-1:a,0),function(){for(var f=arguments,g=-1,C=ht(f.length-a,0),N=z(C);++g<C;)N[g]=f[a+g];g=-1;for(var A=z(a+1);++g<a;)A[g]=f[g];return A[a]=u(N),Xt(s,this,A)}}function Gm(s,a){return a.length<2?s:so(s,cn(a,0,-1))}function RI(s,a){for(var u=s.length,f=St(a.length,u),g=$t(s);f--;){var C=a[f];s[f]=ir(C,u)?g[C]:n}return s}function kd(s,a){if(!(a==="constructor"&&typeof s[a]=="function")&&a!="__proto__")return s[a]}var $m=Um(dm),cs=qR||function(s,a){return vt.setTimeout(s,a)},Ed=Um(nI);function zm(s,a,u){var f=a+"";return Ed(s,kI(f,DI(wI(f),u)))}function Um(s){var a=0,u=0;return function(){var f=JR(),g=k-(f-u);if(u=f,g>0){if(++a>=U)return arguments[0]}else a=0;return s.apply(n,arguments)}}function La(s,a){var u=-1,f=s.length,g=f-1;for(a=a===n?f:a;++u<a;){var C=ad(u,g),N=s[C];s[C]=s[u],s[u]=N}return s.length=a,s}var Zm=VI(function(s){var a=[];return s.charCodeAt(0)===46&&a.push(""),s.replace(xP,function(u,f,g,C){a.push(g?C.replace(BP,"$1"):f||u)}),a});function jn(s){if(typeof s=="string"||en(s))return s;var a=s+"";return a=="0"&&1/s==-H?"-0":a}function lo(s){if(s!=null){try{return pa.call(s)}catch{}try{return s+""}catch{}}return""}function DI(s,a){return on(It,function(u){var f="_."+u[0];a&u[1]&&!aa(s,f)&&s.push(f)}),s.sort()}function Wm(s){if(s instanceof Le)return s.clone();var a=new an(s.__wrapped__,s.__chain__);return a.__actions__=$t(s.__actions__),a.__index__=s.__index__,a.__values__=s.__values__,a}function II(s,a,u){(u?Lt(s,a,u):a===n)?a=1:a=ht(Be(a),0);var f=s==null?0:s.length;if(!f||a<1)return[];for(var g=0,C=0,N=z(Ca(f/a));g<f;)N[C++]=cn(s,g,g+=a);return N}function FI(s){for(var a=-1,u=s==null?0:s.length,f=0,g=[];++a<u;){var C=s[a];C&&(g[f++]=C)}return g}function LI(){var s=arguments.length;if(!s)return[];for(var a=z(s-1),u=arguments[0],f=s;f--;)a[f-1]=arguments[f];return Ar(Ne(u)?$t(u):[u],wt(a,1))}var OI=Ie(function(s,a){return at(s)?rs(s,wt(a,1,at,!0)):[]}),MI=Ie(function(s,a){var u=dn(a);return at(u)&&(u=n),at(s)?rs(s,wt(a,1,at,!0),ge(u,2)):[]}),GI=Ie(function(s,a){var u=dn(a);return at(u)&&(u=n),at(s)?rs(s,wt(a,1,at,!0),n,u):[]});function $I(s,a,u){var f=s==null?0:s.length;return f?(a=u||a===n?1:Be(a),cn(s,a<0?0:a,f)):[]}function zI(s,a,u){var f=s==null?0:s.length;return f?(a=u||a===n?1:Be(a),a=f-a,cn(s,0,a<0?0:a)):[]}function UI(s,a){return s&&s.length?Va(s,ge(a,3),!0,!0):[]}function ZI(s,a){return s&&s.length?Va(s,ge(a,3),!0):[]}function WI(s,a,u,f){var g=s==null?0:s.length;return g?(u&&typeof u!="number"&&Lt(s,a,u)&&(u=0,f=g),LD(s,a,u,f)):[]}function jm(s,a,u){var f=s==null?0:s.length;if(!f)return-1;var g=u==null?0:Be(u);return g<0&&(g=ht(f+g,0)),la(s,ge(a,3),g)}function Hm(s,a,u){var f=s==null?0:s.length;if(!f)return-1;var g=f-1;return u!==n&&(g=Be(u),g=u<0?ht(f+g,0):St(g,f-1)),la(s,ge(a,3),g,!0)}function qm(s){var a=s==null?0:s.length;return a?wt(s,1):[]}function jI(s){var a=s==null?0:s.length;return a?wt(s,H):[]}function HI(s,a){var u=s==null?0:s.length;return u?(a=a===n?1:Be(a),wt(s,a)):[]}function qI(s){for(var a=-1,u=s==null?0:s.length,f={};++a<u;){var g=s[a];f[g[0]]=g[1]}return f}function Km(s){return s&&s.length?s[0]:n}function KI(s,a,u){var f=s==null?0:s.length;if(!f)return-1;var g=u==null?0:Be(u);return g<0&&(g=ht(f+g,0)),Lo(s,a,g)}function YI(s){var a=s==null?0:s.length;return a?cn(s,0,-1):[]}var XI=Ie(function(s){var a=tt(s,pd);return a.length&&a[0]===s[0]?nd(a):[]}),JI=Ie(function(s){var a=dn(s),u=tt(s,pd);return a===dn(u)?a=n:u.pop(),u.length&&u[0]===s[0]?nd(u,ge(a,2)):[]}),QI=Ie(function(s){var a=dn(s),u=tt(s,pd);return a=typeof a=="function"?a:n,a&&u.pop(),u.length&&u[0]===s[0]?nd(u,n,a):[]});function eF(s,a){return s==null?"":YR.call(s,a)}function dn(s){var a=s==null?0:s.length;return a?s[a-1]:n}function tF(s,a,u){var f=s==null?0:s.length;if(!f)return-1;var g=f;return u!==n&&(g=Be(u),g=g<0?ht(f+g,0):St(g,f-1)),a===a?DR(s,a,g):la(s,Vf,g,!0)}function nF(s,a){return s&&s.length?sm(s,Be(a)):n}var rF=Ie(Ym);function Ym(s,a){return s&&s.length&&a&&a.length?sd(s,a):s}function oF(s,a,u){return s&&s.length&&a&&a.length?sd(s,a,ge(u,2)):s}function iF(s,a,u){return s&&s.length&&a&&a.length?sd(s,a,n,u):s}var sF=or(function(s,a){var u=s==null?0:s.length,f=Jc(s,a);return cm(s,tt(a,function(g){return ir(g,u)?+g:g}).sort(Cm)),f});function aF(s,a){var u=[];if(!(s&&s.length))return u;var f=-1,g=[],C=s.length;for(a=ge(a,3);++f<C;){var N=s[f];a(N,f,s)&&(u.push(N),g.push(f))}return cm(s,g),u}function Sd(s){return s==null?s:eD.call(s)}function lF(s,a,u){var f=s==null?0:s.length;return f?(u&&typeof u!="number"&&Lt(s,a,u)?(a=0,u=f):(a=a==null?0:Be(a),u=u===n?f:Be(u)),cn(s,a,u)):[]}function cF(s,a){return Na(s,a)}function dF(s,a,u){return cd(s,a,ge(u,2))}function uF(s,a){var u=s==null?0:s.length;if(u){var f=Na(s,a);if(f<u&&Pn(s[f],a))return f}return-1}function pF(s,a){return Na(s,a,!0)}function hF(s,a,u){return cd(s,a,ge(u,2),!0)}function fF(s,a){var u=s==null?0:s.length;if(u){var f=Na(s,a,!0)-1;if(Pn(s[f],a))return f}return-1}function mF(s){return s&&s.length?um(s):[]}function gF(s,a){return s&&s.length?um(s,ge(a,2)):[]}function yF(s){var a=s==null?0:s.length;return a?cn(s,1,a):[]}function _F(s,a,u){return s&&s.length?(a=u||a===n?1:Be(a),cn(s,0,a<0?0:a)):[]}function CF(s,a,u){var f=s==null?0:s.length;return f?(a=u||a===n?1:Be(a),a=f-a,cn(s,a<0?0:a,f)):[]}function vF(s,a){return s&&s.length?Va(s,ge(a,3),!1,!0):[]}function wF(s,a){return s&&s.length?Va(s,ge(a,3)):[]}var bF=Ie(function(s){return Dr(wt(s,1,at,!0))}),xF=Ie(function(s){var a=dn(s);return at(a)&&(a=n),Dr(wt(s,1,at,!0),ge(a,2))}),kF=Ie(function(s){var a=dn(s);return a=typeof a=="function"?a:n,Dr(wt(s,1,at,!0),n,a)});function EF(s){return s&&s.length?Dr(s):[]}function SF(s,a){return s&&s.length?Dr(s,ge(a,2)):[]}function TF(s,a){return a=typeof a=="function"?a:n,s&&s.length?Dr(s,n,a):[]}function Td(s){if(!(s&&s.length))return[];var a=0;return s=Vr(s,function(u){if(at(u))return a=ht(u.length,a),!0}),Zc(a,function(u){return tt(s,$c(u))})}function Xm(s,a){if(!(s&&s.length))return[];var u=Td(s);return a==null?u:tt(u,function(f){return Xt(a,n,f)})}var NF=Ie(function(s,a){return at(s)?rs(s,a):[]}),VF=Ie(function(s){return ud(Vr(s,at))}),AF=Ie(function(s){var a=dn(s);return at(a)&&(a=n),ud(Vr(s,at),ge(a,2))}),BF=Ie(function(s){var a=dn(s);return a=typeof a=="function"?a:n,ud(Vr(s,at),n,a)}),PF=Ie(Td);function RF(s,a){return mm(s||[],a||[],ns)}function DF(s,a){return mm(s||[],a||[],ss)}var IF=Ie(function(s){var a=s.length,u=a>1?s[a-1]:n;return u=typeof u=="function"?(s.pop(),u):n,Xm(s,u)});function Jm(s){var a=_(s);return a.__chain__=!0,a}function FF(s,a){return a(s),s}function Oa(s,a){return a(s)}var LF=or(function(s){var a=s.length,u=a?s[0]:0,f=this.__wrapped__,g=function(C){return Jc(C,s)};return a>1||this.__actions__.length||!(f instanceof Le)||!ir(u)?this.thru(g):(f=f.slice(u,+u+(a?1:0)),f.__actions__.push({func:Oa,args:[g],thisArg:n}),new an(f,this.__chain__).thru(function(C){return a&&!C.length&&C.push(n),C}))});function OF(){return Jm(this)}function MF(){return new an(this.value(),this.__chain__)}function GF(){this.__values__===n&&(this.__values__=pg(this.value()));var s=this.__index__>=this.__values__.length,a=s?n:this.__values__[this.__index__++];return{done:s,value:a}}function $F(){return this}function zF(s){for(var a,u=this;u instanceof xa;){var f=Wm(u);f.__index__=0,f.__values__=n,a?g.__wrapped__=f:a=f;var g=f;u=u.__wrapped__}return g.__wrapped__=s,a}function UF(){var s=this.__wrapped__;if(s instanceof Le){var a=s;return this.__actions__.length&&(a=new Le(this)),a=a.reverse(),a.__actions__.push({func:Oa,args:[Sd],thisArg:n}),new an(a,this.__chain__)}return this.thru(Sd)}function ZF(){return fm(this.__wrapped__,this.__actions__)}var WF=Aa(function(s,a,u){qe.call(s,u)?++s[u]:nr(s,u,1)});function jF(s,a,u){var f=Ne(s)?Tf:FD;return u&&Lt(s,a,u)&&(a=n),f(s,ge(a,3))}function HF(s,a){var u=Ne(s)?Vr:Xf;return u(s,ge(a,3))}var qF=Em(jm),KF=Em(Hm);function YF(s,a){return wt(Ma(s,a),1)}function XF(s,a){return wt(Ma(s,a),H)}function JF(s,a,u){return u=u===n?1:Be(u),wt(Ma(s,a),u)}function Qm(s,a){var u=Ne(s)?on:Rr;return u(s,ge(a,3))}function eg(s,a){var u=Ne(s)?yR:Yf;return u(s,ge(a,3))}var QF=Aa(function(s,a,u){qe.call(s,u)?s[u].push(a):nr(s,u,[a])});function eL(s,a,u,f){s=zt(s)?s:Ko(s),u=u&&!f?Be(u):0;var g=s.length;return u<0&&(u=ht(g+u,0)),Za(s)?u<=g&&s.indexOf(a,u)>-1:!!g&&Lo(s,a,u)>-1}var tL=Ie(function(s,a,u){var f=-1,g=typeof a=="function",C=zt(s)?z(s.length):[];return Rr(s,function(N){C[++f]=g?Xt(a,N,u):os(N,a,u)}),C}),nL=Aa(function(s,a,u){nr(s,u,a)});function Ma(s,a){var u=Ne(s)?tt:rm;return u(s,ge(a,3))}function rL(s,a,u,f){return s==null?[]:(Ne(a)||(a=a==null?[]:[a]),u=f?n:u,Ne(u)||(u=u==null?[]:[u]),am(s,a,u))}var oL=Aa(function(s,a,u){s[u?0:1].push(a)},function(){return[[],[]]});function iL(s,a,u){var f=Ne(s)?Mc:Bf,g=arguments.length<3;return f(s,ge(a,4),u,g,Rr)}function sL(s,a,u){var f=Ne(s)?_R:Bf,g=arguments.length<3;return f(s,ge(a,4),u,g,Yf)}function aL(s,a){var u=Ne(s)?Vr:Xf;return u(s,za(ge(a,3)))}function lL(s){var a=Ne(s)?jf:eI;return a(s)}function cL(s,a,u){(u?Lt(s,a,u):a===n)?a=1:a=Be(a);var f=Ne(s)?BD:tI;return f(s,a)}function dL(s){var a=Ne(s)?PD:rI;return a(s)}function uL(s){if(s==null)return 0;if(zt(s))return Za(s)?Mo(s):s.length;var a=Tt(s);return a==Nn||a==Vn?s.size:od(s).length}function pL(s,a,u){var f=Ne(s)?Gc:oI;return u&&Lt(s,a,u)&&(a=n),f(s,ge(a,3))}var hL=Ie(function(s,a){if(s==null)return[];var u=a.length;return u>1&&Lt(s,a[0],a[1])?a=[]:u>2&&Lt(a[0],a[1],a[2])&&(a=[a[0]]),am(s,wt(a,1),[])}),Ga=HR||function(){return vt.Date.now()};function fL(s,a){if(typeof a!="function")throw new sn(c);return s=Be(s),function(){if(--s<1)return a.apply(this,arguments)}}function tg(s,a,u){return a=u?n:a,a=s&&a==null?s.length:a,rr(s,Z,n,n,n,n,a)}function ng(s,a){var u;if(typeof a!="function")throw new sn(c);return s=Be(s),function(){return--s>0&&(u=a.apply(this,arguments)),s<=1&&(a=n),u}}var Nd=Ie(function(s,a,u){var f=O;if(u.length){var g=Br(u,Ho(Nd));f|=P}return rr(s,f,a,u,g)}),rg=Ie(function(s,a,u){var f=O|v;if(u.length){var g=Br(u,Ho(rg));f|=P}return rr(a,f,s,u,g)});function og(s,a,u){a=u?n:a;var f=rr(s,F,n,n,n,n,n,a);return f.placeholder=og.placeholder,f}function ig(s,a,u){a=u?n:a;var f=rr(s,W,n,n,n,n,n,a);return f.placeholder=ig.placeholder,f}function sg(s,a,u){var f,g,C,N,A,D,Y=0,X=!1,Q=!1,oe=!0;if(typeof s!="function")throw new sn(c);a=un(a)||0,ot(u)&&(X=!!u.leading,Q="maxWait"in u,C=Q?ht(un(u.maxWait)||0,a):C,oe="trailing"in u?!!u.trailing:oe);function he(lt){var Rn=f,lr=g;return f=g=n,Y=lt,N=s.apply(lr,Rn),N}function _e(lt){return Y=lt,A=cs(Fe,a),X?he(lt):N}function De(lt){var Rn=lt-D,lr=lt-Y,Eg=a-Rn;return Q?St(Eg,C-lr):Eg}function Ce(lt){var Rn=lt-D,lr=lt-Y;return D===n||Rn>=a||Rn<0||Q&&lr>=C}function Fe(){var lt=Ga();if(Ce(lt))return Oe(lt);A=cs(Fe,De(lt))}function Oe(lt){return A=n,oe&&f?he(lt):(f=g=n,N)}function tn(){A!==n&&gm(A),Y=0,f=D=g=A=n}function Ot(){return A===n?N:Oe(Ga())}function nn(){var lt=Ga(),Rn=Ce(lt);if(f=arguments,g=this,D=lt,Rn){if(A===n)return _e(D);if(Q)return gm(A),A=cs(Fe,a),he(D)}return A===n&&(A=cs(Fe,a)),N}return nn.cancel=tn,nn.flush=Ot,nn}var mL=Ie(function(s,a){return Kf(s,1,a)}),gL=Ie(function(s,a,u){return Kf(s,un(a)||0,u)});function yL(s){return rr(s,ae)}function $a(s,a){if(typeof s!="function"||a!=null&&typeof a!="function")throw new sn(c);var u=function(){var f=arguments,g=a?a.apply(this,f):f[0],C=u.cache;if(C.has(g))return C.get(g);var N=s.apply(this,f);return u.cache=C.set(g,N)||C,N};return u.cache=new($a.Cache||tr),u}$a.Cache=tr;function za(s){if(typeof s!="function")throw new sn(c);return function(){var a=arguments;switch(a.length){case 0:return!s.call(this);case 1:return!s.call(this,a[0]);case 2:return!s.call(this,a[0],a[1]);case 3:return!s.call(this,a[0],a[1],a[2])}return!s.apply(this,a)}}function _L(s){return ng(2,s)}var CL=iI(function(s,a){a=a.length==1&&Ne(a[0])?tt(a[0],Jt(ge())):tt(wt(a,1),Jt(ge()));var u=a.length;return Ie(function(f){for(var g=-1,C=St(f.length,u);++g<C;)f[g]=a[g].call(this,f[g]);return Xt(s,this,f)})}),Vd=Ie(function(s,a){var u=Br(a,Ho(Vd));return rr(s,P,n,a,u)}),ag=Ie(function(s,a){var u=Br(a,Ho(ag));return rr(s,V,n,a,u)}),vL=or(function(s,a){return rr(s,J,n,n,n,a)});function wL(s,a){if(typeof s!="function")throw new sn(c);return a=a===n?a:Be(a),Ie(s,a)}function bL(s,a){if(typeof s!="function")throw new sn(c);return a=a==null?0:ht(Be(a),0),Ie(function(u){var f=u[a],g=Fr(u,0,a);return f&&Ar(g,f),Xt(s,this,g)})}function xL(s,a,u){var f=!0,g=!0;if(typeof s!="function")throw new sn(c);return ot(u)&&(f="leading"in u?!!u.leading:f,g="trailing"in u?!!u.trailing:g),sg(s,a,{leading:f,maxWait:a,trailing:g})}function kL(s){return tg(s,1)}function EL(s,a){return Vd(hd(a),s)}function SL(){if(!arguments.length)return[];var s=arguments[0];return Ne(s)?s:[s]}function TL(s){return ln(s,w)}function NL(s,a){return a=typeof a=="function"?a:n,ln(s,w,a)}function VL(s){return ln(s,y|w)}function AL(s,a){return a=typeof a=="function"?a:n,ln(s,y|w,a)}function BL(s,a){return a==null||qf(s,a,yt(a))}function Pn(s,a){return s===a||s!==s&&a!==a}var PL=Da(td),RL=Da(function(s,a){return s>=a}),co=em(function(){return arguments}())?em:function(s){return it(s)&&qe.call(s,"callee")&&!Gf.call(s,"callee")},Ne=z.isArray,DL=wf?Jt(wf):zD;function zt(s){return s!=null&&Ua(s.length)&&!sr(s)}function at(s){return it(s)&&zt(s)}function IL(s){return s===!0||s===!1||it(s)&&Ft(s)==Ui}var Lr=KR||Gd,FL=bf?Jt(bf):UD;function LL(s){return it(s)&&s.nodeType===1&&!ds(s)}function OL(s){if(s==null)return!0;if(zt(s)&&(Ne(s)||typeof s=="string"||typeof s.splice=="function"||Lr(s)||qo(s)||co(s)))return!s.length;var a=Tt(s);if(a==Nn||a==Vn)return!s.size;if(ls(s))return!od(s).length;for(var u in s)if(qe.call(s,u))return!1;return!0}function ML(s,a){return is(s,a)}function GL(s,a,u){u=typeof u=="function"?u:n;var f=u?u(s,a):n;return f===n?is(s,a,n,u):!!f}function Ad(s){if(!it(s))return!1;var a=Ft(s);return a==ta||a==cP||typeof s.message=="string"&&typeof s.name=="string"&&!ds(s)}function $L(s){return typeof s=="number"&&zf(s)}function sr(s){if(!ot(s))return!1;var a=Ft(s);return a==na||a==qh||a==lP||a==uP}function lg(s){return typeof s=="number"&&s==Be(s)}function Ua(s){return typeof s=="number"&&s>-1&&s%1==0&&s<=K}function ot(s){var a=typeof s;return s!=null&&(a=="object"||a=="function")}function it(s){return s!=null&&typeof s=="object"}var cg=xf?Jt(xf):WD;function zL(s,a){return s===a||rd(s,a,vd(a))}function UL(s,a,u){return u=typeof u=="function"?u:n,rd(s,a,vd(a),u)}function ZL(s){return dg(s)&&s!=+s}function WL(s){if(NI(s))throw new Te(l);return tm(s)}function jL(s){return s===null}function HL(s){return s==null}function dg(s){return typeof s=="number"||it(s)&&Ft(s)==Wi}function ds(s){if(!it(s)||Ft(s)!=Qn)return!1;var a=ga(s);if(a===null)return!0;var u=qe.call(a,"constructor")&&a.constructor;return typeof u=="function"&&u instanceof u&&pa.call(u)==UR}var Bd=kf?Jt(kf):jD;function qL(s){return lg(s)&&s>=-K&&s<=K}var ug=Ef?Jt(Ef):HD;function Za(s){return typeof s=="string"||!Ne(s)&&it(s)&&Ft(s)==Hi}function en(s){return typeof s=="symbol"||it(s)&&Ft(s)==ra}var qo=Sf?Jt(Sf):qD;function KL(s){return s===n}function YL(s){return it(s)&&Tt(s)==qi}function XL(s){return it(s)&&Ft(s)==hP}var JL=Da(id),QL=Da(function(s,a){return s<=a});function pg(s){if(!s)return[];if(zt(s))return Za(s)?An(s):$t(s);if(Xi&&s[Xi])return BR(s[Xi]());var a=Tt(s),u=a==Nn?jc:a==Vn?ca:Ko;return u(s)}function ar(s){if(!s)return s===0?s:0;if(s=un(s),s===H||s===-H){var a=s<0?-1:1;return a*ne}return s===s?s:0}function Be(s){var a=ar(s),u=a%1;return a===a?u?a-u:a:0}function hg(s){return s?io(Be(s),0,ke):0}function un(s){if(typeof s=="number")return s;if(en(s))return pe;if(ot(s)){var a=typeof s.valueOf=="function"?s.valueOf():s;s=ot(a)?a+"":a}if(typeof s!="string")return s===0?s:+s;s=Pf(s);var u=DP.test(s);return u||FP.test(s)?fR(s.slice(2),u?2:8):RP.test(s)?pe:+s}function fg(s){return Wn(s,Ut(s))}function eO(s){return s?io(Be(s),-K,K):s===0?s:0}function je(s){return s==null?"":Qt(s)}var tO=Wo(function(s,a){if(ls(a)||zt(a)){Wn(a,yt(a),s);return}for(var u in a)qe.call(a,u)&&ns(s,u,a[u])}),mg=Wo(function(s,a){Wn(a,Ut(a),s)}),Wa=Wo(function(s,a,u,f){Wn(a,Ut(a),s,f)}),nO=Wo(function(s,a,u,f){Wn(a,yt(a),s,f)}),rO=or(Jc);function oO(s,a){var u=Zo(s);return a==null?u:Hf(u,a)}var iO=Ie(function(s,a){s=Ye(s);var u=-1,f=a.length,g=f>2?a[2]:n;for(g&&Lt(a[0],a[1],g)&&(f=1);++u<f;)for(var C=a[u],N=Ut(C),A=-1,D=N.length;++A<D;){var Y=N[A],X=s[Y];(X===n||Pn(X,$o[Y])&&!qe.call(s,Y))&&(s[Y]=C[Y])}return s}),sO=Ie(function(s){return s.push(n,Pm),Xt(gg,n,s)});function aO(s,a){return Nf(s,ge(a,3),Zn)}function lO(s,a){return Nf(s,ge(a,3),ed)}function cO(s,a){return s==null?s:Qc(s,ge(a,3),Ut)}function dO(s,a){return s==null?s:Jf(s,ge(a,3),Ut)}function uO(s,a){return s&&Zn(s,ge(a,3))}function pO(s,a){return s&&ed(s,ge(a,3))}function hO(s){return s==null?[]:Sa(s,yt(s))}function fO(s){return s==null?[]:Sa(s,Ut(s))}function Pd(s,a,u){var f=s==null?n:so(s,a);return f===n?u:f}function mO(s,a){return s!=null&&Im(s,a,OD)}function Rd(s,a){return s!=null&&Im(s,a,MD)}var gO=Tm(function(s,a,u){a!=null&&typeof a.toString!="function"&&(a=ha.call(a)),s[a]=u},Id(Zt)),yO=Tm(function(s,a,u){a!=null&&typeof a.toString!="function"&&(a=ha.call(a)),qe.call(s,a)?s[a].push(u):s[a]=[u]},ge),_O=Ie(os);function yt(s){return zt(s)?Wf(s):od(s)}function Ut(s){return zt(s)?Wf(s,!0):KD(s)}function CO(s,a){var u={};return a=ge(a,3),Zn(s,function(f,g,C){nr(u,a(f,g,C),f)}),u}function vO(s,a){var u={};return a=ge(a,3),Zn(s,function(f,g,C){nr(u,g,a(f,g,C))}),u}var wO=Wo(function(s,a,u){Ta(s,a,u)}),gg=Wo(function(s,a,u,f){Ta(s,a,u,f)}),bO=or(function(s,a){var u={};if(s==null)return u;var f=!1;a=tt(a,function(C){return C=Ir(C,s),f||(f=C.length>1),C}),Wn(s,_d(s),u),f&&(u=ln(u,y|b|w,gI));for(var g=a.length;g--;)dd(u,a[g]);return u});function xO(s,a){return yg(s,za(ge(a)))}var kO=or(function(s,a){return s==null?{}:XD(s,a)});function yg(s,a){if(s==null)return{};var u=tt(_d(s),function(f){return[f]});return a=ge(a),lm(s,u,function(f,g){return a(f,g[0])})}function EO(s,a,u){a=Ir(a,s);var f=-1,g=a.length;for(g||(g=1,s=n);++f<g;){var C=s==null?n:s[jn(a[f])];C===n&&(f=g,C=u),s=sr(C)?C.call(s):C}return s}function SO(s,a,u){return s==null?s:ss(s,a,u)}function TO(s,a,u,f){return f=typeof f=="function"?f:n,s==null?s:ss(s,a,u,f)}var _g=Am(yt),Cg=Am(Ut);function NO(s,a,u){var f=Ne(s),g=f||Lr(s)||qo(s);if(a=ge(a,4),u==null){var C=s&&s.constructor;g?u=f?new C:[]:ot(s)?u=sr(C)?Zo(ga(s)):{}:u={}}return(g?on:Zn)(s,function(N,A,D){return a(u,N,A,D)}),u}function VO(s,a){return s==null?!0:dd(s,a)}function AO(s,a,u){return s==null?s:hm(s,a,hd(u))}function BO(s,a,u,f){return f=typeof f=="function"?f:n,s==null?s:hm(s,a,hd(u),f)}function Ko(s){return s==null?[]:Wc(s,yt(s))}function PO(s){return s==null?[]:Wc(s,Ut(s))}function RO(s,a,u){return u===n&&(u=a,a=n),u!==n&&(u=un(u),u=u===u?u:0),a!==n&&(a=un(a),a=a===a?a:0),io(un(s),a,u)}function DO(s,a,u){return a=ar(a),u===n?(u=a,a=0):u=ar(u),s=un(s),GD(s,a,u)}function IO(s,a,u){if(u&&typeof u!="boolean"&&Lt(s,a,u)&&(a=u=n),u===n&&(typeof a=="boolean"?(u=a,a=n):typeof s=="boolean"&&(u=s,s=n)),s===n&&a===n?(s=0,a=1):(s=ar(s),a===n?(a=s,s=0):a=ar(a)),s>a){var f=s;s=a,a=f}if(u||s%1||a%1){var g=Uf();return St(s+g*(a-s+hR("1e-"+((g+"").length-1))),a)}return ad(s,a)}var FO=jo(function(s,a,u){return a=a.toLowerCase(),s+(u?vg(a):a)});function vg(s){return Dd(je(s).toLowerCase())}function wg(s){return s=je(s),s&&s.replace(OP,SR).replace(rR,"")}function LO(s,a,u){s=je(s),a=Qt(a);var f=s.length;u=u===n?f:io(Be(u),0,f);var g=u;return u-=a.length,u>=0&&s.slice(u,g)==a}function OO(s){return s=je(s),s&&_P.test(s)?s.replace(Xh,TR):s}function MO(s){return s=je(s),s&&kP.test(s)?s.replace(Vc,"\\$&"):s}var GO=jo(function(s,a,u){return s+(u?"-":"")+a.toLowerCase()}),$O=jo(function(s,a,u){return s+(u?" ":"")+a.toLowerCase()}),zO=km("toLowerCase");function UO(s,a,u){s=je(s),a=Be(a);var f=a?Mo(s):0;if(!a||f>=a)return s;var g=(a-f)/2;return Ra(va(g),u)+s+Ra(Ca(g),u)}function ZO(s,a,u){s=je(s),a=Be(a);var f=a?Mo(s):0;return a&&f<a?s+Ra(a-f,u):s}function WO(s,a,u){s=je(s),a=Be(a);var f=a?Mo(s):0;return a&&f<a?Ra(a-f,u)+s:s}function jO(s,a,u){return u||a==null?a=0:a&&(a=+a),QR(je(s).replace(Ac,""),a||0)}function HO(s,a,u){return(u?Lt(s,a,u):a===n)?a=1:a=Be(a),ld(je(s),a)}function qO(){var s=arguments,a=je(s[0]);return s.length<3?a:a.replace(s[1],s[2])}var KO=jo(function(s,a,u){return s+(u?"_":"")+a.toLowerCase()});function YO(s,a,u){return u&&typeof u!="number"&&Lt(s,a,u)&&(a=u=n),u=u===n?ke:u>>>0,u?(s=je(s),s&&(typeof a=="string"||a!=null&&!Bd(a))&&(a=Qt(a),!a&&Oo(s))?Fr(An(s),0,u):s.split(a,u)):[]}var XO=jo(function(s,a,u){return s+(u?" ":"")+Dd(a)});function JO(s,a,u){return s=je(s),u=u==null?0:io(Be(u),0,s.length),a=Qt(a),s.slice(u,u+a.length)==a}function QO(s,a,u){var f=_.templateSettings;u&&Lt(s,a,u)&&(a=n),s=je(s),a=Wa({},a,f,Bm);var g=Wa({},a.imports,f.imports,Bm),C=yt(g),N=Wc(g,C),A,D,Y=0,X=a.interpolate||oa,Q="__p += '",oe=Hc((a.escape||oa).source+"|"+X.source+"|"+(X===Jh?PP:oa).source+"|"+(a.evaluate||oa).source+"|$","g"),he="//# sourceURL="+(qe.call(a,"sourceURL")?(a.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++lR+"]")+`
75
+ `;s.replace(oe,function(Ce,Fe,Oe,tn,Ot,nn){return Oe||(Oe=tn),Q+=s.slice(Y,nn).replace(MP,NR),Fe&&(A=!0,Q+=`' +
76
76
  __e(`+Fe+`) +
77
- '`),Lt&&(D=!0,Q+=`';
78
- `+Lt+`;
77
+ '`),Ot&&(D=!0,Q+=`';
78
+ `+Ot+`;
79
79
  __p += '`),Oe&&(Q+=`' +
80
80
  ((__t = (`+Oe+`)) == null ? '' : __t) +
81
- '`),Y=tn+ve.length,ve}),Q+=`';
81
+ '`),Y=nn+Ce.length,Ce}),Q+=`';
82
82
  `;var _e=qe.call(a,"variable")&&a.variable;if(!_e)Q=`with (obj) {
83
83
  `+Q+`
84
84
  }
85
- `;else if(bP.test(_e))throw new Te(d);Q=(D?Q.replace(sP,""):Q).replace(aP,"$1").replace(lP,"$1;"),Q="function("+(_e||"obj")+`) {
85
+ `;else if(AP.test(_e))throw new Te(d);Q=(D?Q.replace(fP,""):Q).replace(mP,"$1").replace(gP,"$1;"),Q="function("+(_e||"obj")+`) {
86
86
  `+(_e?"":`obj || (obj = {});
87
87
  `)+"var __t, __p = ''"+(A?", __e = _.escape":"")+(D?`, __j = Array.prototype.join;
88
88
  function print() { __p += __j.call(arguments, '') }
89
89
  `:`;
90
90
  `)+Q+`return __p
91
- }`;var De=Cg(function(){return Ze(v,he+"return "+Q).apply(n,N)});if(De.source=Q,Vd(De))throw De;return De}function jO(s){return je(s).toLowerCase()}function HO(s){return je(s).toUpperCase()}function qO(s,a,u){if(s=je(s),s&&(u||a===n))return Vf(s);if(!s||!(a=Jt(a)))return s;var f=An(s),g=An(a),v=Af(f,g),N=Bf(f,g)+1;return Fr(f,v,N).join("")}function KO(s,a,u){if(s=je(s),s&&(u||a===n))return s.slice(0,Rf(s)+1);if(!s||!(a=Jt(a)))return s;var f=An(s),g=Bf(f,An(a))+1;return Fr(f,0,g).join("")}function YO(s,a,u){if(s=je(s),s&&(u||a===n))return s.replace(Vc,"");if(!s||!(a=Jt(a)))return s;var f=An(s),g=Af(f,An(a));return Fr(f,g).join("")}function XO(s,a){var u=$,f=j;if(ot(a)){var g="separator"in a?a.separator:g;u="length"in a?Be(a.length):u,f="omission"in a?Jt(a.omission):f}s=je(s);var v=s.length;if(Lo(s)){var N=An(s);v=N.length}if(u>=v)return s;var A=u-Oo(f);if(A<1)return f;var D=N?Fr(N,0,A).join(""):s.slice(0,A);if(g===n)return D+f;if(N&&(A+=D.length-A),Ad(g)){if(s.slice(A).search(g)){var Y,X=D;for(g.global||(g=jc(g.source,je(Yh.exec(g))+"g")),g.lastIndex=0;Y=g.exec(X);)var Q=Y.index;D=D.slice(0,Q===n?A:Q)}}else if(s.indexOf(Jt(g),A)!=A){var oe=D.lastIndexOf(g);oe>-1&&(D=D.slice(0,oe))}return D+f}function JO(s){return s=je(s),s&&cP.test(s)?s.replace(Hh,TR):s}var QO=Wo(function(s,a,u){return s+(u?" ":"")+a.toUpperCase()}),Rd=wm("toUpperCase");function vg(s,a,u){return s=je(s),a=u?n:a,a===n?bR(s)?AR(s):hR(s):s.match(a)||[]}var Cg=Ie(function(s,a){try{return Yt(s,n,a)}catch(u){return Vd(u)?u:new Te(u)}}),eM=or(function(s,a){return on(a,function(u){u=jn(u),nr(s,u,Td(s[u],s))}),s});function tM(s){var a=s==null?0:s.length,u=ge();return s=a?tt(s,function(f){if(typeof f[1]!="function")throw new sn(c);return[u(f[0]),f[1]]}):[],Ie(function(f){for(var g=-1;++g<a;){var v=s[g];if(Yt(v[0],this,f))return Yt(v[1],this,f)}})}function nM(s){return TD(ln(s,y))}function Dd(s){return function(){return s}}function rM(s,a){return s==null||s!==s?a:s}var oM=xm(),iM=xm(!0);function Ut(s){return s}function Id(s){return Qf(typeof s=="function"?s:ln(s,y))}function sM(s){return tm(ln(s,y))}function aM(s,a){return nm(s,ln(a,y))}var lM=Ie(function(s,a){return function(u){return rs(u,s,a)}}),cM=Ie(function(s,a){return function(u){return rs(s,u,a)}});function Fd(s,a,u){var f=yt(a),g=Ea(a,f);u==null&&!(ot(a)&&(g.length||!f.length))&&(u=a,a=s,s=this,g=Ea(a,yt(a)));var v=!(ot(u)&&"chain"in u)||!!u.chain,N=sr(s);return on(g,function(A){var D=a[A];s[A]=D,N&&(s.prototype[A]=function(){var Y=this.__chain__;if(v||Y){var X=s(this.__wrapped__),Q=X.__actions__=Gt(this.__actions__);return Q.push({func:D,args:arguments,thisArg:s}),X.__chain__=Y,X}return D.apply(s,Ar([this.value()],arguments))})}),s}function dM(){return Ct._===this&&(Ct._=FR),this}function Ld(){}function uM(s){return s=Be(s),Ie(function(a){return rm(a,s)})}var pM=fd(tt),hM=fd(kf),fM=fd(Mc);function wg(s){return wd(s)?Gc(jn(s)):ZD(s)}function mM(s){return function(a){return s==null?n:io(s,a)}}var gM=Em(),yM=Em(!0);function Od(){return[]}function Md(){return!1}function _M(){return{}}function vM(){return""}function CM(){return!0}function wM(s,a){if(s=Be(s),s<1||s>K)return[];var u=ke,f=St(s,ke);a=ge(a),s-=ke;for(var g=Uc(f,a);++u<s;)a(u);return g}function bM(s){return Ne(s)?tt(s,jn):Qt(s)?[s]:Gt($m(je(s)))}function xM(s){var a=++DR;return je(s)+a}var kM=Ba(function(s,a){return s+a},0),EM=md("ceil"),SM=Ba(function(s,a){return s/a},1),TM=md("floor");function NM(s){return s&&s.length?ka(s,Ut,ed):n}function VM(s,a){return s&&s.length?ka(s,ge(a,2),ed):n}function AM(s){return Tf(s,Ut)}function BM(s,a){return Tf(s,ge(a,2))}function PM(s){return s&&s.length?ka(s,Ut,od):n}function RM(s,a){return s&&s.length?ka(s,ge(a,2),od):n}var DM=Ba(function(s,a){return s*a},1),IM=md("round"),FM=Ba(function(s,a){return s-a},0);function LM(s){return s&&s.length?zc(s,Ut):0}function OM(s,a){return s&&s.length?zc(s,ge(a,2)):0}return _.after=sL,_.ary=Jm,_.assign=HL,_.assignIn=pg,_.assignInWith=Za,_.assignWith=qL,_.at=KL,_.before=Qm,_.bind=Td,_.bindAll=eM,_.bindKey=eg,_.castArray=_L,_.chain=Km,_.chunk=TI,_.compact=NI,_.concat=VI,_.cond=tM,_.conforms=nM,_.constant=Dd,_.countBy=LF,_.create=YL,_.curry=tg,_.curryRight=ng,_.debounce=rg,_.defaults=XL,_.defaultsDeep=JL,_.defer=aL,_.delay=lL,_.difference=AI,_.differenceBy=BI,_.differenceWith=PI,_.drop=RI,_.dropRight=DI,_.dropRightWhile=II,_.dropWhile=FI,_.fill=LI,_.filter=MF,_.flatMap=zF,_.flatMapDeep=UF,_.flatMapDepth=ZF,_.flatten=Wm,_.flattenDeep=OI,_.flattenDepth=MI,_.flip=cL,_.flow=oM,_.flowRight=iM,_.fromPairs=GI,_.functions=iO,_.functionsIn=sO,_.groupBy=WF,_.initial=zI,_.intersection=UI,_.intersectionBy=ZI,_.intersectionWith=WI,_.invert=lO,_.invertBy=cO,_.invokeMap=HF,_.iteratee=Id,_.keyBy=qF,_.keys=yt,_.keysIn=zt,_.map=Oa,_.mapKeys=uO,_.mapValues=pO,_.matches=sM,_.matchesProperty=aM,_.memoize=Ga,_.merge=hO,_.mergeWith=hg,_.method=lM,_.methodOf=cM,_.mixin=Fd,_.negate=$a,_.nthArg=uM,_.omit=fO,_.omitBy=mO,_.once=dL,_.orderBy=KF,_.over=pM,_.overArgs=uL,_.overEvery=hM,_.overSome=fM,_.partial=Nd,_.partialRight=og,_.partition=YF,_.pick=gO,_.pickBy=fg,_.property=wg,_.propertyOf=mM,_.pull=KI,_.pullAll=Hm,_.pullAllBy=YI,_.pullAllWith=XI,_.pullAt=JI,_.range=gM,_.rangeRight=yM,_.rearg=pL,_.reject=QF,_.remove=QI,_.rest=hL,_.reverse=Ed,_.sampleSize=tL,_.set=_O,_.setWith=vO,_.shuffle=nL,_.slice=eF,_.sortBy=iL,_.sortedUniq=aF,_.sortedUniqBy=lF,_.split=zO,_.spread=fL,_.tail=cF,_.take=dF,_.takeRight=uF,_.takeRightWhile=pF,_.takeWhile=hF,_.tap=NF,_.throttle=mL,_.thru=La,_.toArray=cg,_.toPairs=mg,_.toPairsIn=gg,_.toPath=bM,_.toPlainObject=ug,_.transform=CO,_.unary=gL,_.union=fF,_.unionBy=mF,_.unionWith=gF,_.uniq=yF,_.uniqBy=_F,_.uniqWith=vF,_.unset=wO,_.unzip=Sd,_.unzipWith=qm,_.update=bO,_.updateWith=xO,_.values=qo,_.valuesIn=kO,_.without=CF,_.words=vg,_.wrap=yL,_.xor=wF,_.xorBy=bF,_.xorWith=xF,_.zip=kF,_.zipObject=EF,_.zipObjectDeep=SF,_.zipWith=TF,_.entries=mg,_.entriesIn=gg,_.extend=pg,_.extendWith=Za,Fd(_,_),_.add=kM,_.attempt=Cg,_.camelCase=NO,_.capitalize=yg,_.ceil=EM,_.clamp=EO,_.clone=vL,_.cloneDeep=wL,_.cloneDeepWith=bL,_.cloneWith=CL,_.conformsTo=xL,_.deburr=_g,_.defaultTo=rM,_.divide=SM,_.endsWith=VO,_.eq=Pn,_.escape=AO,_.escapeRegExp=BO,_.every=OF,_.find=GF,_.findIndex=Um,_.findKey=QL,_.findLast=$F,_.findLastIndex=Zm,_.findLastKey=eO,_.floor=TM,_.forEach=Ym,_.forEachRight=Xm,_.forIn=tO,_.forInRight=nO,_.forOwn=rO,_.forOwnRight=oO,_.get=Bd,_.gt=kL,_.gte=EL,_.has=aO,_.hasIn=Pd,_.head=jm,_.identity=Ut,_.includes=jF,_.indexOf=$I,_.inRange=SO,_.invoke=dO,_.isArguments=lo,_.isArray=Ne,_.isArrayBuffer=SL,_.isArrayLike=$t,_.isArrayLikeObject=at,_.isBoolean=TL,_.isBuffer=Lr,_.isDate=NL,_.isElement=VL,_.isEmpty=AL,_.isEqual=BL,_.isEqualWith=PL,_.isError=Vd,_.isFinite=RL,_.isFunction=sr,_.isInteger=ig,_.isLength=za,_.isMap=sg,_.isMatch=DL,_.isMatchWith=IL,_.isNaN=FL,_.isNative=LL,_.isNil=ML,_.isNull=OL,_.isNumber=ag,_.isObject=ot,_.isObjectLike=it,_.isPlainObject=cs,_.isRegExp=Ad,_.isSafeInteger=GL,_.isSet=lg,_.isString=Ua,_.isSymbol=Qt,_.isTypedArray=Ho,_.isUndefined=$L,_.isWeakMap=zL,_.isWeakSet=UL,_.join=jI,_.kebabCase=PO,_.last=dn,_.lastIndexOf=HI,_.lowerCase=RO,_.lowerFirst=DO,_.lt=ZL,_.lte=WL,_.max=NM,_.maxBy=VM,_.mean=AM,_.meanBy=BM,_.min=PM,_.minBy=RM,_.stubArray=Od,_.stubFalse=Md,_.stubObject=_M,_.stubString=vM,_.stubTrue=CM,_.multiply=DM,_.nth=qI,_.noConflict=dM,_.noop=Ld,_.now=Ma,_.pad=IO,_.padEnd=FO,_.padStart=LO,_.parseInt=OO,_.random=TO,_.reduce=XF,_.reduceRight=JF,_.repeat=MO,_.replace=GO,_.result=yO,_.round=IM,_.runInContext=R,_.sample=eL,_.size=rL,_.snakeCase=$O,_.some=oL,_.sortedIndex=tF,_.sortedIndexBy=nF,_.sortedIndexOf=rF,_.sortedLastIndex=oF,_.sortedLastIndexBy=iF,_.sortedLastIndexOf=sF,_.startCase=UO,_.startsWith=ZO,_.subtract=FM,_.sum=LM,_.sumBy=OM,_.template=WO,_.times=wM,_.toFinite=ar,_.toInteger=Be,_.toLength=dg,_.toLower=jO,_.toNumber=un,_.toSafeInteger=jL,_.toString=je,_.toUpper=HO,_.trim=qO,_.trimEnd=KO,_.trimStart=YO,_.truncate=XO,_.unescape=JO,_.uniqueId=xM,_.upperCase=QO,_.upperFirst=Rd,_.each=Ym,_.eachRight=Xm,_.first=jm,Fd(_,function(){var s={};return Zn(_,function(a,u){qe.call(_.prototype,u)||(s[u]=a)}),s}(),{chain:!1}),_.VERSION=o,on(["bind","bindKey","curry","curryRight","partial","partialRight"],function(s){_[s].placeholder=_}),on(["drop","take"],function(s,a){Le.prototype[s]=function(u){u=u===n?1:ht(Be(u),0);var f=this.__filtered__&&!a?new Le(this):this.clone();return f.__filtered__?f.__takeCount__=St(u,f.__takeCount__):f.__views__.push({size:St(u,ke),type:s+(f.__dir__<0?"Right":"")}),f},Le.prototype[s+"Right"]=function(u){return this.reverse()[s](u).reverse()}}),on(["filter","map","takeWhile"],function(s,a){var u=a+1,f=u==x||u==G;Le.prototype[s]=function(g){var v=this.clone();return v.__iteratees__.push({iteratee:ge(g,3),type:u}),v.__filtered__=v.__filtered__||f,v}}),on(["head","last"],function(s,a){var u="take"+(a?"Right":"");Le.prototype[s]=function(){return this[u](1).value()[0]}}),on(["initial","tail"],function(s,a){var u="drop"+(a?"":"Right");Le.prototype[s]=function(){return this.__filtered__?new Le(this):this[u](1)}}),Le.prototype.compact=function(){return this.filter(Ut)},Le.prototype.find=function(s){return this.filter(s).head()},Le.prototype.findLast=function(s){return this.reverse().find(s)},Le.prototype.invokeMap=Ie(function(s,a){return typeof s=="function"?new Le(this):this.map(function(u){return rs(u,s,a)})}),Le.prototype.reject=function(s){return this.filter($a(ge(s)))},Le.prototype.slice=function(s,a){s=Be(s);var u=this;return u.__filtered__&&(s>0||a<0)?new Le(u):(s<0?u=u.takeRight(-s):s&&(u=u.drop(s)),a!==n&&(a=Be(a),u=a<0?u.dropRight(-a):u.take(a-s)),u)},Le.prototype.takeRightWhile=function(s){return this.reverse().takeWhile(s).reverse()},Le.prototype.toArray=function(){return this.take(ke)},Zn(Le.prototype,function(s,a){var u=/^(?:filter|find|map|reject)|While$/.test(a),f=/^(?:head|last)$/.test(a),g=_[f?"take"+(a=="last"?"Right":""):a],v=f||/^find/.test(a);g&&(_.prototype[a]=function(){var N=this.__wrapped__,A=f?[1]:arguments,D=N instanceof Le,Y=A[0],X=D||Ne(N),Q=function(Fe){var Oe=g.apply(_,Ar([Fe],A));return f&&oe?Oe[0]:Oe};X&&u&&typeof Y=="function"&&Y.length!=1&&(D=X=!1);var oe=this.__chain__,he=!!this.__actions__.length,_e=v&&!oe,De=D&&!he;if(!v&&X){N=De?N:new Le(this);var ve=s.apply(N,A);return ve.__actions__.push({func:La,args:[Q],thisArg:n}),new an(ve,oe)}return _e&&De?s.apply(this,A):(ve=this.thru(Q),_e?f?ve.value()[0]:ve.value():ve)})}),on(["pop","push","shift","sort","splice","unshift"],function(s){var a=ca[s],u=/^(?:push|sort|unshift)$/.test(s)?"tap":"thru",f=/^(?:pop|shift)$/.test(s);_.prototype[s]=function(){var g=arguments;if(f&&!this.__chain__){var v=this.value();return a.apply(Ne(v)?v:[],g)}return this[u](function(N){return a.apply(Ne(N)?N:[],g)})}}),Zn(Le.prototype,function(s,a){var u=_[a];if(u){var f=u.name+"";qe.call(zo,f)||(zo[f]=[]),zo[f].push({name:a,func:u})}}),zo[Aa(n,C).name]=[{name:"wrapper",func:n}],Le.prototype.clone=JR,Le.prototype.reverse=QR,Le.prototype.value=eD,_.prototype.at=VF,_.prototype.chain=AF,_.prototype.commit=BF,_.prototype.next=PF,_.prototype.plant=DF,_.prototype.reverse=IF,_.prototype.toJSON=_.prototype.valueOf=_.prototype.value=FF,_.prototype.first=_.prototype.head,Yi&&(_.prototype[Yi]=RF),_},Mo=BR();eo?((eo.exports=Mo)._=Mo,Ic._=Mo):Ct._=Mo}).call(Ko)}($s,$s.exports);var ze=$s.exports;const YN={class:"grid-overlay-container"},Xp=r.defineComponent({__name:"PlAgOverlayLoading",props:{params:{}},setup(t){return(e,n)=>(r.openBlock(),r.createElementBlock("div",YN,[e.params.notReady?(r.openBlock(),r.createElementBlock(r.Fragment,{key:0},[n[0]||(n[0]=r.createElementVNode("div",{class:"grid-icon-cat-in-bag"},null,-1)),n[1]||(n[1]=r.createElementVNode("span",{class:"text-subtitle-m"},"Not calculated",-1))],64)):(r.openBlock(),r.createElementBlock(r.Fragment,{key:1},[n[2]||(n[2]=r.createElementVNode("div",{class:"mask-24 mask-loading grid-mask-loading"},null,-1)),n[3]||(n[3]=r.createElementVNode("span",{class:"text-subtitle-m"},"Loading",-1))],64))]))}}),XN={},JN={class:"grid-overlay-container"};function QN(t,e){return r.openBlock(),r.createElementBlock("div",JN,e[0]||(e[0]=[r.createElementVNode("div",{class:"grid-icon-sad-cat"},null,-1),r.createElementVNode("span",{class:"text-subtitle-m"},"Empty",-1)]))}const Jp=Xl(XN,[["render",QN]]);async function eV(t,e){throw Error("not implemented")}function tV(t){return t.axesSpec.filter(e=>{var n;return((n=e.annotations)==null?void 0:n["pl7.app/axisNature"])==="heterogeneous"})}function nV(t,e){const n=[];for(const o of e)if(t[o].type==="column"){const i=tV(t[o].spec);for(const l of i){if(l.type!=="String"){console.warn("heterogeneous axis with string type expected, got",l,"skipping");continue}const c=cl(l),d=t.findIndex(p=>ze.isEqual(p.id,c));if(d===-1)throw console.error("axis not found",o,c,t),Error("axis not found");n.push({columnIdx:o,axisIdx:d})}}return n}const Qp=(t,e)=>(t+e).toString();function rV(t,e,n,o,i,l){if(t.length>1)throw Error("hColumns.length > 1 is not supported");const c=t[0];let d=-1,p=-1;for(let y=0;y<l.length;++y)l[y]===c.axisIdx&&(d=y),l[y]===c.columnIdx&&(p=y);const h=(()=>{const b=o[d].data.filter(w=>w!==null);return Array.from(new Set(b))})();h.sort(),p>d?(n.splice(p,1),n.splice(d,1)):(n.splice(d,1),n.splice(p,1));const m=oV(i,o,d,p,h,e.rows);for(let y=0;y<h.length;++y){const b=h[y],w=$r(b+"@"+y);n.push({colId:w,field:Qp(o.length,y),headerName:b,valueFormatter:th})}return{rowModelType:"clientSide",columnDefs:n,rowData:m}}function oV(t,e,n,o,i,l){const c=new Map;let d=0;for(let h=0;h<l;h++){const m={};for(let M=0;M<e.length;++M){if(M===n||M===o)continue;const O=t[M].toString();m[O]=e[M].data[h]}let y;const b=$r(Object.values(m))??"";c.has(b)?y=c.get(b):(c.set(b,m),y=m,y.id=d.toString(),d++);const w=i.indexOf(e[n].data[h]);if(w===-1)throw Error("index not found");const S=Qp(e.length,w);y[S]=e[o].data[h]}return Array.from(c.values())}function iV(t){return $r(t)}function eh(t){return JSON.parse(t)}const th=t=>t?t.value===void 0?"NULL":t.value===null?"NA":t.value.toString():"ERROR";function sV(t,e,n){var i,l,c;const o=iV(e);return{colId:o,field:t.toString(),headerName:((l=(i=e.spec.annotations)==null?void 0:i["pl7.app/label"])==null?void 0:l.trim())??"Unlabeled "+e.type+" "+t.toString(),lockPosition:e.type==="axis",hide:(n==null?void 0:n.includes(o))??((c=e.spec.annotations)==null?void 0:c["pl7.app/table/visibility"])==="optional",valueFormatter:th,cellDataType:(d=>{switch(d){case"Int":case"Long":case"Float":case"Double":return"number";case"String":case"Bytes":return"text";default:throw Error(`unsupported data type: ${d}`)}})(e.type==="axis"?e.spec.type:e.spec.valueType)}}function nh(t,e){switch(e){case"Int":return t;case"Long":return typeof t=="bigint"?Number(t):t;case"Float":return t;case"Double":return t;case"String":return t;case"Bytes":return Buffer.from(t).toString("hex");default:throw Error(`unsupported data type: ${e}`)}}function rh(t){const e=[];return Cs(t,n=>(e.push(n),n)),e}async function aV(t,e,n){return n.length?(await t.findColumns(e,{columnFilter:{name:["pl7.app/label"]},compatibleWith:ze.uniqWith(n.map(i=>mu(i.spec.axesSpec).map(ze.cloneDeep)).flat(),ze.isEqual),strictlyCompatible:!0})).hits.filter(i=>i.spec.axesSpec.length===1):[]}async function lV(t,e,n){const o=rh(n),l=(await aV(t,e,o)).filter(c=>!ze.find(o,d=>c.columnId===d.columnId));return l.length===0?n:{type:"outer",primary:n,secondary:l.map(c=>({type:"column",column:c}))}}async function cV(t,e,n,o){const i=n.filter(m=>m.type!=="Bytes"),l=rh(o),c=i.map(m=>[]),d=i.map(m=>null);for(let m=0;m<l.length;++m){const y=mu(l[m].spec.axesSpec);for(let b=0;b<y.length;++b){const w=ze.findIndex(i,S=>ze.isEqual(S,y[b]));w===-1||d[w]||(y.length===1&&l[m].spec.name==="pl7.app/label"?(c[w]=[[m,b]],d[w]=l[m].columnId):c[w].push([m,b]))}}for(let m=i.length-1;m>=0;--m)c[m].length||(d.splice(m,1),c.splice(m,1),i.splice(m,1));const p=100,h=i.map(m=>new Set);e:for(let m=i.length-1;m>=0;--m){for(const[y,b]of c[m]){const w=await t.getUniqueValues(e,{columnId:l[y].columnId,...!d[m]&&{axis:ze.cloneDeep(i[m])},filters:[],limit:p});if(w.overflow){d.splice(m,1),c.splice(m,1),i.splice(m,1);continue e}const S=w.values.type;for(const M of w.values.data)if(!(fu(M,S)||M===null)&&(h[m].add(nh(M,S)),h[m].size===p)){d.splice(m,1),c.splice(m,1),i.splice(m,1);continue e}}if(!h[m].size){d.splice(m,1),c.splice(m,1),i.splice(m,1);continue e}}return i.map((m,y)=>{const b=[...h[y]].map(S=>({value:S,label:S.toString()})),w=b[0].value;return{axis:ze.cloneDeep(m),...d[y]&&{column:d[y]},options:b,defaultValue:w}})}function dV(t,e,n,o){const i=t.length,l=[];for(let c=0;c<e[0].data.length;++c){const d=[],p=(o++).toString();for(const m of n)d.push(e[m].data[c]);const h={key:d,id:p};for(let m=0;m<i;++m){const y=t[m].toString(),b=e[m].data[c],w=e[m].type;qy(e[m].absent,c)?h[y]=void 0:fu(b,w)||b===null?h[y]=null:h[y]=nh(b,w)}l.push(h)}return l}const uV=t=>t.type==="column"&&t.spec.axesSpec.length===1&&t.spec.name==="pl7.app/label";async function pV(t,e,n,o){const i=await t.getSpec(e);let l=i.findIndex(C=>C.type==="column");l===-1&&(l=i.length);const c=[...i.keys()].filter(C=>!ze.find(n,I=>ze.isEqual(I.axis,i[C].id)||ze.isEqual(I.column,i[C].id))).sort((C,I)=>{var P,V;if(i[C].type!==i[I].type)return i[C].type==="axis"?-1:1;const F=(P=i[C].spec.annotations)==null?void 0:P["pl7.app/table/orderPriority"],W=(V=i[I].spec.annotations)==null?void 0:V["pl7.app/table/orderPriority"];return F===void 0?W===void 0?0:1:W===void 0?-1:Number(W)-Number(F)}),d=ze.cloneDeep(c),p=nV(i,c);for(let C=c.length-1;C>=0;--C){const I=c[C];if(!uV(i[I]))continue;const F=cl(i[I].spec.axesSpec[0]),W=ze.findIndex(c,P=>ze.isEqual(i[P].id,F));if(W===-1&&ze.findIndex(n,V=>ze.isEqual(V.axis,F))===-1){console.warn(`added label column, but the axis is not in the data; axisId: ${F}`);continue}c[W]=I;for(const P of p)P.axisIdx===I&&(P.axisIdx=W);c.splice(C,1),d.splice(C,1)}const h=await t.getShape(e),m=h.rows,y=d.map(C=>sV(C,i[C],o));if(p.length>1&&console.warn("Currently, only one heterogeneous axis is supported in the table, got",p.length," transposition will not be applied."),p.length===1)return rV(p,h,y,await t.getData(e,c),d,c);const b=[...c],w=new Map;for(let C=0;C<l;++C)w.set(C,-1);for(let C=0;C<b.length;++C){const I=b[C];w.has(I)&&w.set(I,C)}for(const[C,I]of w)I===-1&&(w.set(C,b.length),b.push(C));const S=[];for(let C=0;C<l;++C){const I=w.get(C);if(I===void 0||I===-1)throw new Error("assertion exception");S.push(I)}let M;return{rowModelType:"serverSide",columnDefs:y,serverSideDatasource:{getRows:async C=>{try{if(m==0){C.success({rowData:[],rowCount:m}),C.api.setGridOption("loading",!1),C.api.showNoRowsOverlay();return}if(M&&!ze.isEqual(M.request.sortModel,C.request.sortModel)){M=void 0,C.api.setGridOption("loading",!0),C.success({rowData:[],rowCount:0});return}M=C;let I=0,F=[];if(m>0&&C.request.startRow!==void 0&&C.request.endRow!==void 0&&(I=Math.min(m,C.request.endRow)-C.request.startRow,I>0)){const W=await t.getData(e,b,{offset:C.request.startRow,length:I});F=dV(d,W,S,C.request.startRow)}C.success({rowData:F,rowCount:m}),C.api.autoSizeAllColumns(),C.api.setGridOption("loading",!1)}catch(I){C.api.setGridOption("loading",!0),C.fail(),console.trace(I)}}}}}const Jl=Ig(),hV=["onClick"],oh=r.defineComponent({__name:"PlAgGridColumnManager",props:{api:{}},setup(t){const e=t,{api:n}=r.toRefs(e),o=r.ref([]),i=r.ref(),l=r.ref(!1),c=r.ref(0);Yp(i,{handle:".handle",onChange(p){n.value.moveColumns(p.map(h=>o.value[h]),0)}});function d(p){n.value.setColumnsVisible([p],!p.isVisible())}return r.onMounted(()=>{n.value.addEventListener("displayedColumnsChanged",()=>{o.value=[...n.value.getAllGridColumns()??[]],c.value++}),o.value=n.value.getAllGridColumns()??[]}),(p,h)=>(r.openBlock(),r.createElementBlock("div",null,[(r.openBlock(),r.createBlock(r.Teleport,{to:`#${r.unref(Jl)}`},[r.createVNode(r.unref(vo),{onClick:h[0]||(h[0]=r.withModifiers(m=>l.value=!l.value,["stop"]))},{append:r.withCtx(()=>[r.createVNode(r.unref(Vt),{name:"columns"})]),default:r.withCtx(()=>[h[2]||(h[2]=r.createTextVNode(" Columns "))]),_:1})],8,["to"])),r.createVNode(r.unref(As),{modelValue:l.value,"onUpdate:modelValue":h[1]||(h[1]=m=>l.value=m),width:"368px","close-on-outside-click":""},{title:r.withCtx(()=>h[3]||(h[3]=[r.createTextVNode("Columns")])),default:r.withCtx(()=>[(r.openBlock(),r.createElementBlock("div",{ref_key:"listRef",ref:i,key:c.value,class:"pl-ag-columns"},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(o.value,m=>(r.openBlock(),r.createElementBlock("div",{key:m.getId(),class:"pl-ag-columns__item"},[r.createElementVNode("div",{class:r.normalizeClass([{handle:!m.getColDef().lockPosition},"pl-ag-columns__drag"])},[r.createVNode(r.unref(nn),{name:"drag-dots"})],2),r.createElementVNode("div",{class:r.normalizeClass([{visible:m.isVisible()},"pl-ag-columns__title"])},r.toDisplayString(m.getColDef().headerName),3),r.createElementVNode("div",{class:"pl-ag-columns__visibility",onClick:y=>d(m)},[r.createVNode(r.unref(vt),{"close-delay":500,position:"top"},{tooltip:r.withCtx(()=>h[4]||(h[4]=[r.createTextVNode("Show/Hide")])),default:r.withCtx(()=>[r.createVNode(r.unref(Vt),{name:m.isVisible()?"view-show":"view-hide"},null,8,["name"])]),_:2},1024)],8,hV)]))),128))]))]),_:1},8,["modelValue"])]))}}),fV=["id"],mV=r.defineComponent({__name:"PlAgDataTableToolsPanel",setup(t){return(e,n)=>(r.openBlock(),r.createElementBlock("div",{id:r.unref(Jl),class:"d-flex gap-6"},[r.renderSlot(e.$slots,"default")],8,fV))}}),gV={class:"ap-ag-data-table-container"},yV={key:1,class:"ap-ag-data-table-sheets"},_V=Xl(r.defineComponent({__name:"PlAgDataTable",props:r.mergeModels({settings:{},showColumnsPanel:{type:Boolean}},{modelValue:{default:{gridState:{}}},modelModifiers:{}}),emits:r.mergeModels(["onRowDoubleClicked","columnsChanged"],["update:modelValue"]),setup(t,{expose:e,emit:n}){T.ModuleRegistry.registerModules([us.ClientSideRowModelModule,jd.ClipboardModule,Wd.ServerSideRowModelModule,Hd.RangeSelectionModule,hl,Ou]);const o=r.useModel(t,"modelValue"),i=t,{settings:l}=r.toRefs(i),c=n;r.watch(()=>l.value,async(k,x)=>{if(k.sourceType!=="pframe"||!k.pFrame||!k.join||x&&x.sourceType==="pframe"&&ze.isEqual(k.pFrame,x.pFrame)&&ze.isEqual(k.join,x.join))return;const B=window.platforma;if(!B)throw Error("platforma not set");const G=B.pFrameDriver;if(!G)throw Error("platforma.pFrameDriver not set");const H=await lV(G,k.pFrame,k.join),K=o.value;K.pTableParams||(K.pTableParams={sorting:[],filters:[]}),K.pTableParams.join=H,o.value=K});const d=Lh(()=>l.value.sourceType,async k=>{var B;const x=l.value.sourceType;switch(x){case"pframe":{const G=window.platforma;if(!G)throw Error("platforma not set");const H=G.pFrameDriver;if(!H)throw Error("platforma.pFrameDriver not set");if(!l.value.pFrame)return[];const K=l.value.pFrame,ne=(B=o.value.pTableParams)==null?void 0:B.join;return ne?await cV(H,K,l.value.sheetAxes,ne):[]}case"ptable":return l.value.sheets??[];case"xsv":return[];default:throw Error(`unsupported source type: ${x}`)}});function p(k){if(!(l.value.sourceType!=="ptable"&&l.value.sourceType!=="pframe"))return(k==null?void 0:k.sortModel.map(x=>{const{spec:B,...G}=eh(x.colId);return{column:G,ascending:x.sort==="asc",naAndAbsentAreLeastValues:!0}}))??[]}const h=r.computed({get:()=>{const k=o.value;return{columnOrder:k.gridState.columnOrder,sort:k.gridState.sort,columnVisibility:k.gridState.columnVisibility}},set:k=>{const x=o.value,B=S.value.rowModelType==="clientSide"?void 0:p(k.sort);x.gridState={...x.gridState,...k},(l.value.sourceType==="ptable"||l.value.sourceType==="pframe")&&(x.pTableParams||(x.pTableParams={sorting:[],filters:[]}),x.pTableParams.sorting=B),o.value=x}}),m=k=>$r(k);function y(k){var x;if(!(l.value.sourceType!=="ptable"&&l.value.sourceType!=="pframe"))return((x=d.value)==null?void 0:x.map(B=>({type:"bySingleColumnV2",column:B.column?{type:"column",id:B.column}:{type:"axis",id:B.axis},predicate:{operator:"Equal",reference:k[m(B.axis)]}})))??[]}const b=r.computed({get:()=>o.value.gridState.sheets??{},set:k=>{const x=y(k),B=o.value;B.gridState.sheets=k,(l.value.sourceType==="ptable"||l.value.sourceType==="pframe")&&(B.pTableParams||(B.pTableParams={sorting:[],filters:[]}),B.pTableParams.filters=x),o.value=B}});r.watch(()=>[l.value,d.value],(k,x)=>{const[B,G]=k;if(!G)return;if(x){const[K,ne]=x;if((B.sourceType==="ptable"||B.sourceType==="pframe")&&B.sourceType===(K==null?void 0:K.sourceType)&&ze.isEqual(G,ne))return}if(B.sourceType!=="ptable"&&B.sourceType!=="pframe"){b.value={};return}const H=b.value;for(const K of G){const ne=m(K.axis);H[ne]||(H[ne]=K.defaultValue??K.options[0].value)}b.value=H},{immediate:!0});const w=r.shallowRef(),S=r.shallowRef({animateRows:!1,suppressColumnMoveAnimation:!0,cellSelection:!0,initialState:h.value,autoSizeStrategy:{type:"fitCellContents"},onRowDataUpdated:k=>{k.api.autoSizeAllColumns()},onRowDoubleClicked:k=>{k.data&&c("onRowDoubleClicked",k.data.key)},defaultColDef:{suppressHeaderMenuButton:!0},maintainColumnOrder:!0,localeText:{loadingError:"..."},rowModelType:"clientSide",maxBlocksInCache:1e3,cacheBlockSize:100,blockLoadDebounceMillis:500,serverSideSortAllLevels:!0,suppressServerSideFullWidthLoadingRow:!0,getRowId:k=>k.data.id,loading:!0,loadingOverlayComponentParams:{notReady:!0},loadingOverlayComponent:Xp,noRowsOverlayComponent:Jp,sideBar:{},defaultCsvExportParams:{allColumns:!0,suppressQuotes:!0,fileName:"table.csv"}}),M=k=>{const x=k.api;w.value=new Proxy(x,{get(B,G,H){switch(G){case"setGridOption":return(K,ne)=>{const pe=S.value;pe[K]=ne,S.value=pe,x.setGridOption(K,ne)};case"updateGridOptions":return K=>{S.value={...S.value,...K},x.updateGridOptions(K)};default:return Reflect.get(B,G,H)}}})},O=k=>({columnOrder:k.columnOrder,sort:k.sort,columnVisibility:k.columnVisibility??(k.columnOrder?{hiddenColIds:[]}:void 0)}),C=k=>{S.value.initialState=h.value=O(k.state),k.api.autoSizeAllColumns()},I=()=>{S.value.initialState=h.value=O(w.value.getState()),w.value=void 0};let F=!1;const W=()=>{if(!F)return;const k=w.value;k!==void 0&&(k.exportDataAsCsv(),F=!1,k.setGridOption("cacheBlockSize",100))},P=()=>{if(!F)return;const k=w.value;if(k===void 0)return;const x=k.getServerSideGroupLevelState()[0];x.cacheBlockSize===x.rowCount&&k.refreshServerSide({route:x.route,purge:!1})};e({exportCsv:async()=>{const k=w.value;if(k!==void 0){if(S.value.rowModelType==="clientSide"){k.exportDataAsCsv();return}if(S.value.rowModelType==="serverSide"){const x=k.getServerSideGroupLevelState()[0];if(x.rowCount<=x.cacheBlockSize){k.exportDataAsCsv();return}F||(F=!0,k.setGridOption("cacheBlockSize",x.rowCount))}}}});const Z=r.ref(0);r.watch(()=>[w.value,h.value],(k,x)=>{if(ze.isEqual(k,x))return;const[B,G]=k;if(!B)return;const H=O(B.getState());ze.isEqual(G,H)||(S.value.initialState=G,++Z.value)}),r.watch(()=>S.value,(k,x)=>{var B;if(x&&(k.rowModelType!=x.rowModelType&&++Z.value,!ze.isEqual(k.columnDefs,x.columnDefs)&&k.columnDefs)){const G=ne=>!("children"in ne),H=(B=k.columnDefs)==null?void 0:B.filter(G),K=H==null?void 0:H.map(ne=>ne.colId).filter(ne=>ne!==void 0).map(ne=>eh(ne));c("columnsChanged",K??[])}});const J=(k,x)=>{var G;const B=b.value;B[k]!==x&&(B[k]=x,b.value=B,(G=w.value)==null||G.updateGridOptions({loading:!0,loadingOverlayComponentParams:{notReady:!1}}))},ae=window.platforma;if(!ae)throw Error("platforma not set");const $=ae.pFrameDriver;if(!$)throw Error("platforma.pFrameDriver not set");const j=ae.blobDriver;if(!j)throw Error("platforma.blobDriver not set");let U;return r.watch(()=>[w.value,l.value,d.value],async k=>{var K,ne;const[x,B,G]=k;if(!x||ze.isEqual(B,U))return;U=B;const H=B.sourceType;switch(H){case"pframe":case"ptable":{const pe=B.pTable;if(!pe||!G)return x.updateGridOptions({loading:!0,loadingOverlayComponentParams:{notReady:!0},columnDefs:[]});const ke=(ne=(K=h.value)==null?void 0:K.columnVisibility)==null?void 0:ne.hiddenColIds,Ee=await pV($,pe,G,ke);return x.updateGridOptions({loading:Ee.rowModelType!=="clientSide",loadingOverlayComponentParams:{notReady:!1},...Ee})}case"xsv":{const pe=B.xsvFile;if(!(pe!=null&&pe.ok)||!pe.value)return x.updateGridOptions({loading:!0,loadingOverlayComponentParams:{notReady:!0},columnDefs:[]});const ke=await eV(j,pe.value);return x.updateGridOptions({loading:!0,loadingOverlayComponentParams:{notReady:!1},...ke})}default:throw Error(`unsupported source type: ${H}`)}}),(k,x)=>(r.openBlock(),r.createElementBlock("div",gV,[w.value&&k.showColumnsPanel?(r.openBlock(),r.createBlock(r.unref(oh),{key:0,api:w.value},null,8,["api"])):r.createCommentVNode("",!0),r.unref(d).value&&r.unref(d).value.length>0?(r.openBlock(),r.createElementBlock("div",yV,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(d).value,(B,G)=>(r.openBlock(),r.createBlock(r.unref(wp),{key:G,"model-value":b.value[m(B.axis)],options:B.options,"onUpdate:modelValue":H=>J(m(B.axis),H)},null,8,["model-value","options","onUpdate:modelValue"]))),128))])):r.createCommentVNode("",!0),(r.openBlock(),r.createBlock(r.unref(Bg.AgGridVue),{key:Z.value,theme:r.unref(Gu),class:"ap-ag-data-table-grid","grid-options":S.value,onGridReady:M,onStateUpdated:C,onGridPreDestroyed:I,onStoreRefreshed:W,onModelUpdated:P},null,8,["theme","grid-options"]))]))}}),[["__scopeId","data-v-ea0278e4"]]),vV={key:1,class:"alert-error"},CV={key:2},wV=r.defineComponent({__name:"ValueOrErrorsComponent",props:{valueOrError:{}},setup(t){const e=t,n=r.computed(()=>e.valueOrError&&e.valueOrError.ok?e.valueOrError.value:void 0),o=r.computed(()=>e.valueOrError&&!e.valueOrError.ok?e.valueOrError.errors:void 0),i=r.computed(()=>n.value===void 0&&o.value===void 0);return(l,c)=>(r.openBlock(),r.createElementBlock("div",null,[n.value!==void 0?r.renderSlot(l.$slots,"default",r.normalizeProps(r.mergeProps({key:0},{value:n.value}))):r.createCommentVNode("",!0),o.value?(r.openBlock(),r.createElementBlock("div",vV,r.toDisplayString(o.value),1)):r.createCommentVNode("",!0),i.value?(r.openBlock(),r.createElementBlock("div",CV,"Unresolved")):r.createCommentVNode("",!0)]))}}),bV={style:{height:"100%"}},xV=r.defineComponent({__name:"PlAgCellFile",props:{params:{}},setup(t){const e=t,n=r.computed(()=>e.params.extensions),o=r.computed(()=>e.params.value);function i(c){e.params.setValue(c)}const l=r.computed(()=>e.params.resolveProgress?e.params.resolveProgress(o.value):void 0);return(c,d)=>(r.openBlock(),r.createElementBlock("div",bV,[r.createVNode(r.unref(Wp),{"show-filename-only":"",clearable:"","cell-style":"","file-dialog-title":"Select any file",placeholder:`Choose file ${n.value?n.value[0]:""}`,extensions:n.value,"model-value":o.value,progress:l.value,"onUpdate:modelValue":i},null,8,["placeholder","extensions","model-value","progress"])]))}}),kV={class:"pl-ag-grid-open-cell d-flex"},EV={class:"pl-ag-grid-open-cell__value"},SV=r.defineComponent({__name:"PlAgTextAndButtonCell",props:{params:{}},setup(t){const e=t;function n(){if(e.params.invokeRowsOnDoubleClick){const o=e.params.api,i={rowPinned:e.params.node.rowPinned,api:o,rowIndex:e.params.node.rowIndex,context:o,type:"rowDoubleClicked",node:e.params.node,data:e.params.data,event:null};o.dispatchEvent(i)}else e.params.onClick&&e.params.onClick(e.params)}return(o,i)=>(r.openBlock(),r.createElementBlock("div",kV,[r.createElementVNode("div",EV,r.toDisplayString(o.params.value),1),r.createElementVNode("div",{class:"pl-ag-grid-open-cell__activator text-caps11 align-center",onClick:r.withModifiers(n,["stop"])},[r.createVNode(r.unref(nn),{name:o.params.icon??"maximize"},null,8,["name"]),r.createTextVNode(" "+r.toDisplayString(o.params.btnLabel??"Open"),1)])]))}});var Ql={exports:{}};const TV="2.0.0",ih=256,NV=Number.MAX_SAFE_INTEGER||9007199254740991,VV=16,AV=ih-6;var zs={MAX_LENGTH:ih,MAX_SAFE_COMPONENT_LENGTH:VV,MAX_SAFE_BUILD_LENGTH:AV,MAX_SAFE_INTEGER:NV,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:TV,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},Us=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{};(function(t,e){const{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:o,MAX_LENGTH:i}=zs,l=Us;e=t.exports={};const c=e.re=[],d=e.safeRe=[],p=e.src=[],h=e.t={};let m=0;const y="[a-zA-Z0-9-]",b=[["\\s",1],["\\d",i],[y,o]],w=M=>{for(const[O,C]of b)M=M.split(`${O}*`).join(`${O}{0,${C}}`).split(`${O}+`).join(`${O}{1,${C}}`);return M},S=(M,O,C)=>{const I=w(O),F=m++;l(M,F,O),h[M]=F,p[F]=O,c[F]=new RegExp(O,C?"g":void 0),d[F]=new RegExp(I,C?"g":void 0)};S("NUMERICIDENTIFIER","0|[1-9]\\d*"),S("NUMERICIDENTIFIERLOOSE","\\d+"),S("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${y}*`),S("MAINVERSION",`(${p[h.NUMERICIDENTIFIER]})\\.(${p[h.NUMERICIDENTIFIER]})\\.(${p[h.NUMERICIDENTIFIER]})`),S("MAINVERSIONLOOSE",`(${p[h.NUMERICIDENTIFIERLOOSE]})\\.(${p[h.NUMERICIDENTIFIERLOOSE]})\\.(${p[h.NUMERICIDENTIFIERLOOSE]})`),S("PRERELEASEIDENTIFIER",`(?:${p[h.NUMERICIDENTIFIER]}|${p[h.NONNUMERICIDENTIFIER]})`),S("PRERELEASEIDENTIFIERLOOSE",`(?:${p[h.NUMERICIDENTIFIERLOOSE]}|${p[h.NONNUMERICIDENTIFIER]})`),S("PRERELEASE",`(?:-(${p[h.PRERELEASEIDENTIFIER]}(?:\\.${p[h.PRERELEASEIDENTIFIER]})*))`),S("PRERELEASELOOSE",`(?:-?(${p[h.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${p[h.PRERELEASEIDENTIFIERLOOSE]})*))`),S("BUILDIDENTIFIER",`${y}+`),S("BUILD",`(?:\\+(${p[h.BUILDIDENTIFIER]}(?:\\.${p[h.BUILDIDENTIFIER]})*))`),S("FULLPLAIN",`v?${p[h.MAINVERSION]}${p[h.PRERELEASE]}?${p[h.BUILD]}?`),S("FULL",`^${p[h.FULLPLAIN]}$`),S("LOOSEPLAIN",`[v=\\s]*${p[h.MAINVERSIONLOOSE]}${p[h.PRERELEASELOOSE]}?${p[h.BUILD]}?`),S("LOOSE",`^${p[h.LOOSEPLAIN]}$`),S("GTLT","((?:<|>)?=?)"),S("XRANGEIDENTIFIERLOOSE",`${p[h.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),S("XRANGEIDENTIFIER",`${p[h.NUMERICIDENTIFIER]}|x|X|\\*`),S("XRANGEPLAIN",`[v=\\s]*(${p[h.XRANGEIDENTIFIER]})(?:\\.(${p[h.XRANGEIDENTIFIER]})(?:\\.(${p[h.XRANGEIDENTIFIER]})(?:${p[h.PRERELEASE]})?${p[h.BUILD]}?)?)?`),S("XRANGEPLAINLOOSE",`[v=\\s]*(${p[h.XRANGEIDENTIFIERLOOSE]})(?:\\.(${p[h.XRANGEIDENTIFIERLOOSE]})(?:\\.(${p[h.XRANGEIDENTIFIERLOOSE]})(?:${p[h.PRERELEASELOOSE]})?${p[h.BUILD]}?)?)?`),S("XRANGE",`^${p[h.GTLT]}\\s*${p[h.XRANGEPLAIN]}$`),S("XRANGELOOSE",`^${p[h.GTLT]}\\s*${p[h.XRANGEPLAINLOOSE]}$`),S("COERCEPLAIN",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?`),S("COERCE",`${p[h.COERCEPLAIN]}(?:$|[^\\d])`),S("COERCEFULL",p[h.COERCEPLAIN]+`(?:${p[h.PRERELEASE]})?(?:${p[h.BUILD]})?(?:$|[^\\d])`),S("COERCERTL",p[h.COERCE],!0),S("COERCERTLFULL",p[h.COERCEFULL],!0),S("LONETILDE","(?:~>?)"),S("TILDETRIM",`(\\s*)${p[h.LONETILDE]}\\s+`,!0),e.tildeTrimReplace="$1~",S("TILDE",`^${p[h.LONETILDE]}${p[h.XRANGEPLAIN]}$`),S("TILDELOOSE",`^${p[h.LONETILDE]}${p[h.XRANGEPLAINLOOSE]}$`),S("LONECARET","(?:\\^)"),S("CARETTRIM",`(\\s*)${p[h.LONECARET]}\\s+`,!0),e.caretTrimReplace="$1^",S("CARET",`^${p[h.LONECARET]}${p[h.XRANGEPLAIN]}$`),S("CARETLOOSE",`^${p[h.LONECARET]}${p[h.XRANGEPLAINLOOSE]}$`),S("COMPARATORLOOSE",`^${p[h.GTLT]}\\s*(${p[h.LOOSEPLAIN]})$|^$`),S("COMPARATOR",`^${p[h.GTLT]}\\s*(${p[h.FULLPLAIN]})$|^$`),S("COMPARATORTRIM",`(\\s*)${p[h.GTLT]}\\s*(${p[h.LOOSEPLAIN]}|${p[h.XRANGEPLAIN]})`,!0),e.comparatorTrimReplace="$1$2$3",S("HYPHENRANGE",`^\\s*(${p[h.XRANGEPLAIN]})\\s+-\\s+(${p[h.XRANGEPLAIN]})\\s*$`),S("HYPHENRANGELOOSE",`^\\s*(${p[h.XRANGEPLAINLOOSE]})\\s+-\\s+(${p[h.XRANGEPLAINLOOSE]})\\s*$`),S("STAR","(<|>)?=?\\s*\\*"),S("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),S("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(Ql,Ql.exports);var Oi=Ql.exports;const BV=Object.freeze({loose:!0}),PV=Object.freeze({});var ec=t=>t?typeof t!="object"?BV:t:PV;const sh=/^[0-9]+$/,ah=(t,e)=>{const n=sh.test(t),o=sh.test(e);return n&&o&&(t=+t,e=+e),t===e?0:n&&!o?-1:o&&!n?1:t<e?-1:1};var lh={compareIdentifiers:ah,rcompareIdentifiers:(t,e)=>ah(e,t)};const Zs=Us,{MAX_LENGTH:ch,MAX_SAFE_INTEGER:Ws}=zs,{safeRe:dh,t:uh}=Oi,RV=ec,{compareIdentifiers:To}=lh;var Bt=class Hn{constructor(e,n){if(n=RV(n),e instanceof Hn){if(e.loose===!!n.loose&&e.includePrerelease===!!n.includePrerelease)return e;e=e.version}else if(typeof e!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>ch)throw new TypeError(`version is longer than ${ch} characters`);Zs("SemVer",e,n),this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease;const o=e.trim().match(n.loose?dh[uh.LOOSE]:dh[uh.FULL]);if(!o)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+o[1],this.minor=+o[2],this.patch=+o[3],this.major>Ws||this.major<0)throw new TypeError("Invalid major version");if(this.minor>Ws||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>Ws||this.patch<0)throw new TypeError("Invalid patch version");o[4]?this.prerelease=o[4].split(".").map(i=>{if(/^[0-9]+$/.test(i)){const l=+i;if(l>=0&&l<Ws)return l}return i}):this.prerelease=[],this.build=o[5]?o[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(Zs("SemVer.compare",this.version,this.options,e),!(e instanceof Hn)){if(typeof e=="string"&&e===this.version)return 0;e=new Hn(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof Hn||(e=new Hn(e,this.options)),To(this.major,e.major)||To(this.minor,e.minor)||To(this.patch,e.patch)}comparePre(e){if(e instanceof Hn||(e=new Hn(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let n=0;do{const o=this.prerelease[n],i=e.prerelease[n];if(Zs("prerelease compare",n,o,i),o===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(o===void 0)return-1;if(o===i)continue;return To(o,i)}while(++n)}compareBuild(e){e instanceof Hn||(e=new Hn(e,this.options));let n=0;do{const o=this.build[n],i=e.build[n];if(Zs("build compare",n,o,i),o===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(o===void 0)return-1;if(o===i)continue;return To(o,i)}while(++n)}inc(e,n,o){switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",n,o);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",n,o);break;case"prepatch":this.prerelease.length=0,this.inc("patch",n,o),this.inc("pre",n,o);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",n,o),this.inc("pre",n,o);break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{const i=Number(o)?1:0;if(!n&&o===!1)throw new Error("invalid increment argument: identifier is empty");if(this.prerelease.length===0)this.prerelease=[i];else{let l=this.prerelease.length;for(;--l>=0;)typeof this.prerelease[l]=="number"&&(this.prerelease[l]++,l=-2);if(l===-1){if(n===this.prerelease.join(".")&&o===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(i)}}if(n){let l=[n,i];o===!1&&(l=[n]),To(this.prerelease[0],n)===0?isNaN(this.prerelease[1])&&(this.prerelease=l):this.prerelease=l}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};const ph=Bt;var No=(t,e,n=!1)=>{if(t instanceof ph)return t;try{return new ph(t,e)}catch(o){if(!n)return null;throw o}};const DV=No;var IV=(t,e)=>{const n=DV(t,e);return n?n.version:null};const FV=No;var LV=(t,e)=>{const n=FV(t.trim().replace(/^[=v]+/,""),e);return n?n.version:null};const hh=Bt;var OV=(t,e,n,o,i)=>{typeof n=="string"&&(i=o,o=n,n=void 0);try{return new hh(t instanceof hh?t.version:t,n).inc(e,o,i).version}catch{return null}};const fh=No;var MV=(t,e)=>{const n=fh(t,null,!0),o=fh(e,null,!0),i=n.compare(o);if(i===0)return null;const l=i>0,c=l?n:o,d=l?o:n,p=!!c.prerelease.length;if(!!d.prerelease.length&&!p)return!d.patch&&!d.minor?"major":c.patch?"patch":c.minor?"minor":"major";const m=p?"pre":"";return n.major!==o.major?m+"major":n.minor!==o.minor?m+"minor":n.patch!==o.patch?m+"patch":"prerelease"};const GV=Bt;var $V=(t,e)=>new GV(t,e).major;const zV=Bt;var UV=(t,e)=>new zV(t,e).minor;const ZV=Bt;var WV=(t,e)=>new ZV(t,e).patch;const jV=No;var HV=(t,e)=>{const n=jV(t,e);return n&&n.prerelease.length?n.prerelease:null};const mh=Bt;var _n=(t,e,n)=>new mh(t,n).compare(new mh(e,n));const qV=_n;var KV=(t,e,n)=>qV(e,t,n);const YV=_n;var XV=(t,e)=>YV(t,e,!0);const gh=Bt;var tc=(t,e,n)=>{const o=new gh(t,n),i=new gh(e,n);return o.compare(i)||o.compareBuild(i)};const JV=tc;var QV=(t,e)=>t.sort((n,o)=>JV(n,o,e));const eA=tc;var tA=(t,e)=>t.sort((n,o)=>eA(o,n,e));const nA=_n;var js=(t,e,n)=>nA(t,e,n)>0;const rA=_n;var nc=(t,e,n)=>rA(t,e,n)<0;const oA=_n;var yh=(t,e,n)=>oA(t,e,n)===0;const iA=_n;var _h=(t,e,n)=>iA(t,e,n)!==0;const sA=_n;var rc=(t,e,n)=>sA(t,e,n)>=0;const aA=_n;var oc=(t,e,n)=>aA(t,e,n)<=0;const lA=yh,cA=_h,dA=js,uA=rc,pA=nc,hA=oc;var vh=(t,e,n,o)=>{switch(e){case"===":return typeof t=="object"&&(t=t.version),typeof n=="object"&&(n=n.version),t===n;case"!==":return typeof t=="object"&&(t=t.version),typeof n=="object"&&(n=n.version),t!==n;case"":case"=":case"==":return lA(t,n,o);case"!=":return cA(t,n,o);case">":return dA(t,n,o);case">=":return uA(t,n,o);case"<":return pA(t,n,o);case"<=":return hA(t,n,o);default:throw new TypeError(`Invalid operator: ${e}`)}};const fA=Bt,mA=No,{safeRe:Hs,t:qs}=Oi;var gA=(t,e)=>{if(t instanceof fA)return t;if(typeof t=="number"&&(t=String(t)),typeof t!="string")return null;e=e||{};let n=null;if(!e.rtl)n=t.match(e.includePrerelease?Hs[qs.COERCEFULL]:Hs[qs.COERCE]);else{const p=e.includePrerelease?Hs[qs.COERCERTLFULL]:Hs[qs.COERCERTL];let h;for(;(h=p.exec(t))&&(!n||n.index+n[0].length!==t.length);)(!n||h.index+h[0].length!==n.index+n[0].length)&&(n=h),p.lastIndex=h.index+h[1].length+h[2].length;p.lastIndex=-1}if(n===null)return null;const o=n[2],i=n[3]||"0",l=n[4]||"0",c=e.includePrerelease&&n[5]?`-${n[5]}`:"",d=e.includePrerelease&&n[6]?`+${n[6]}`:"";return mA(`${o}.${i}.${l}${c}${d}`,e)},yA=class{constructor(){this.max=1e3,this.map=new Map}get(e){const n=this.map.get(e);if(n!==void 0)return this.map.delete(e),this.map.set(e,n),n}delete(e){return this.map.delete(e)}set(e,n){if(!this.delete(e)&&n!==void 0){if(this.map.size>=this.max){const i=this.map.keys().next().value;this.delete(i)}this.map.set(e,n)}return this}},ic,Ch;function vn(){if(Ch)return ic;Ch=1;const t=/\s+/g;class e{constructor(B,G){if(G=i(G),B instanceof e)return B.loose===!!G.loose&&B.includePrerelease===!!G.includePrerelease?B:new e(B.raw,G);if(B instanceof l)return this.raw=B.value,this.set=[[B]],this.formatted=void 0,this;if(this.options=G,this.loose=!!G.loose,this.includePrerelease=!!G.includePrerelease,this.raw=B.trim().replace(t," "),this.set=this.raw.split("||").map(H=>this.parseRange(H.trim())).filter(H=>H.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const H=this.set[0];if(this.set=this.set.filter(K=>!M(K[0])),this.set.length===0)this.set=[H];else if(this.set.length>1){for(const K of this.set)if(K.length===1&&O(K[0])){this.set=[K];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let B=0;B<this.set.length;B++){B>0&&(this.formatted+="||");const G=this.set[B];for(let H=0;H<G.length;H++)H>0&&(this.formatted+=" "),this.formatted+=G[H].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(B){const H=((this.options.includePrerelease&&w)|(this.options.loose&&S))+":"+B,K=o.get(H);if(K)return K;const ne=this.options.loose,pe=ne?p[h.HYPHENRANGELOOSE]:p[h.HYPHENRANGE];B=B.replace(pe,U(this.options.includePrerelease)),c("hyphen replace",B),B=B.replace(p[h.COMPARATORTRIM],m),c("comparator trim",B),B=B.replace(p[h.TILDETRIM],y),c("tilde trim",B),B=B.replace(p[h.CARETTRIM],b),c("caret trim",B);let ke=B.split(" ").map(Ke=>I(Ke,this.options)).join(" ").split(/\s+/).map(Ke=>j(Ke,this.options));ne&&(ke=ke.filter(Ke=>(c("loose invalid filter",Ke,this.options),!!Ke.match(p[h.COMPARATORLOOSE])))),c("range list",ke);const Ee=new Map,He=ke.map(Ke=>new l(Ke,this.options));for(const Ke of He){if(M(Ke))return[Ke];Ee.set(Ke.value,Ke)}Ee.size>1&&Ee.has("")&&Ee.delete("");const Dt=[...Ee.values()];return o.set(H,Dt),Dt}intersects(B,G){if(!(B instanceof e))throw new TypeError("a Range is required");return this.set.some(H=>C(H,G)&&B.set.some(K=>C(K,G)&&H.every(ne=>K.every(pe=>ne.intersects(pe,G)))))}test(B){if(!B)return!1;if(typeof B=="string")try{B=new d(B,this.options)}catch{return!1}for(let G=0;G<this.set.length;G++)if(k(this.set[G],B,this.options))return!0;return!1}}ic=e;const n=yA,o=new n,i=ec,l=Ks(),c=Us,d=Bt,{safeRe:p,t:h,comparatorTrimReplace:m,tildeTrimReplace:y,caretTrimReplace:b}=Oi,{FLAG_INCLUDE_PRERELEASE:w,FLAG_LOOSE:S}=zs,M=x=>x.value==="<0.0.0-0",O=x=>x.value==="",C=(x,B)=>{let G=!0;const H=x.slice();let K=H.pop();for(;G&&H.length;)G=H.every(ne=>K.intersects(ne,B)),K=H.pop();return G},I=(x,B)=>(c("comp",x,B),x=V(x,B),c("caret",x),x=W(x,B),c("tildes",x),x=J(x,B),c("xrange",x),x=$(x,B),c("stars",x),x),F=x=>!x||x.toLowerCase()==="x"||x==="*",W=(x,B)=>x.trim().split(/\s+/).map(G=>P(G,B)).join(" "),P=(x,B)=>{const G=B.loose?p[h.TILDELOOSE]:p[h.TILDE];return x.replace(G,(H,K,ne,pe,ke)=>{c("tilde",x,H,K,ne,pe,ke);let Ee;return F(K)?Ee="":F(ne)?Ee=`>=${K}.0.0 <${+K+1}.0.0-0`:F(pe)?Ee=`>=${K}.${ne}.0 <${K}.${+ne+1}.0-0`:ke?(c("replaceTilde pr",ke),Ee=`>=${K}.${ne}.${pe}-${ke} <${K}.${+ne+1}.0-0`):Ee=`>=${K}.${ne}.${pe} <${K}.${+ne+1}.0-0`,c("tilde return",Ee),Ee})},V=(x,B)=>x.trim().split(/\s+/).map(G=>Z(G,B)).join(" "),Z=(x,B)=>{c("caret",x,B);const G=B.loose?p[h.CARETLOOSE]:p[h.CARET],H=B.includePrerelease?"-0":"";return x.replace(G,(K,ne,pe,ke,Ee)=>{c("caret",x,K,ne,pe,ke,Ee);let He;return F(ne)?He="":F(pe)?He=`>=${ne}.0.0${H} <${+ne+1}.0.0-0`:F(ke)?ne==="0"?He=`>=${ne}.${pe}.0${H} <${ne}.${+pe+1}.0-0`:He=`>=${ne}.${pe}.0${H} <${+ne+1}.0.0-0`:Ee?(c("replaceCaret pr",Ee),ne==="0"?pe==="0"?He=`>=${ne}.${pe}.${ke}-${Ee} <${ne}.${pe}.${+ke+1}-0`:He=`>=${ne}.${pe}.${ke}-${Ee} <${ne}.${+pe+1}.0-0`:He=`>=${ne}.${pe}.${ke}-${Ee} <${+ne+1}.0.0-0`):(c("no pr"),ne==="0"?pe==="0"?He=`>=${ne}.${pe}.${ke}${H} <${ne}.${pe}.${+ke+1}-0`:He=`>=${ne}.${pe}.${ke}${H} <${ne}.${+pe+1}.0-0`:He=`>=${ne}.${pe}.${ke} <${+ne+1}.0.0-0`),c("caret return",He),He})},J=(x,B)=>(c("replaceXRanges",x,B),x.split(/\s+/).map(G=>ae(G,B)).join(" ")),ae=(x,B)=>{x=x.trim();const G=B.loose?p[h.XRANGELOOSE]:p[h.XRANGE];return x.replace(G,(H,K,ne,pe,ke,Ee)=>{c("xRange",x,H,K,ne,pe,ke,Ee);const He=F(ne),Dt=He||F(pe),Ke=Dt||F(ke),Un=Ke;return K==="="&&Un&&(K=""),Ee=B.includePrerelease?"-0":"",He?K===">"||K==="<"?H="<0.0.0-0":H="*":K&&Un?(Dt&&(pe=0),ke=0,K===">"?(K=">=",Dt?(ne=+ne+1,pe=0,ke=0):(pe=+pe+1,ke=0)):K==="<="&&(K="<",Dt?ne=+ne+1:pe=+pe+1),K==="<"&&(Ee="-0"),H=`${K+ne}.${pe}.${ke}${Ee}`):Dt?H=`>=${ne}.0.0${Ee} <${+ne+1}.0.0-0`:Ke&&(H=`>=${ne}.${pe}.0${Ee} <${ne}.${+pe+1}.0-0`),c("xRange return",H),H})},$=(x,B)=>(c("replaceStars",x,B),x.trim().replace(p[h.STAR],"")),j=(x,B)=>(c("replaceGTE0",x,B),x.trim().replace(p[B.includePrerelease?h.GTE0PRE:h.GTE0],"")),U=x=>(B,G,H,K,ne,pe,ke,Ee,He,Dt,Ke,Un)=>(F(H)?G="":F(K)?G=`>=${H}.0.0${x?"-0":""}`:F(ne)?G=`>=${H}.${K}.0${x?"-0":""}`:pe?G=`>=${G}`:G=`>=${G}${x?"-0":""}`,F(He)?Ee="":F(Dt)?Ee=`<${+He+1}.0.0-0`:F(Ke)?Ee=`<${He}.${+Dt+1}.0-0`:Un?Ee=`<=${He}.${Dt}.${Ke}-${Un}`:x?Ee=`<${He}.${Dt}.${+Ke+1}-0`:Ee=`<=${Ee}`,`${G} ${Ee}`.trim()),k=(x,B,G)=>{for(let H=0;H<x.length;H++)if(!x[H].test(B))return!1;if(B.prerelease.length&&!G.includePrerelease){for(let H=0;H<x.length;H++)if(c(x[H].semver),x[H].semver!==l.ANY&&x[H].semver.prerelease.length>0){const K=x[H].semver;if(K.major===B.major&&K.minor===B.minor&&K.patch===B.patch)return!0}return!1}return!0};return ic}var sc,wh;function Ks(){if(wh)return sc;wh=1;const t=Symbol("SemVer ANY");class e{static get ANY(){return t}constructor(m,y){if(y=n(y),m instanceof e){if(m.loose===!!y.loose)return m;m=m.value}m=m.trim().split(/\s+/).join(" "),c("comparator",m,y),this.options=y,this.loose=!!y.loose,this.parse(m),this.semver===t?this.value="":this.value=this.operator+this.semver.version,c("comp",this)}parse(m){const y=this.options.loose?o[i.COMPARATORLOOSE]:o[i.COMPARATOR],b=m.match(y);if(!b)throw new TypeError(`Invalid comparator: ${m}`);this.operator=b[1]!==void 0?b[1]:"",this.operator==="="&&(this.operator=""),b[2]?this.semver=new d(b[2],this.options.loose):this.semver=t}toString(){return this.value}test(m){if(c("Comparator.test",m,this.options.loose),this.semver===t||m===t)return!0;if(typeof m=="string")try{m=new d(m,this.options)}catch{return!1}return l(m,this.operator,this.semver,this.options)}intersects(m,y){if(!(m instanceof e))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new p(m.value,y).test(this.value):m.operator===""?m.value===""?!0:new p(this.value,y).test(m.semver):(y=n(y),y.includePrerelease&&(this.value==="<0.0.0-0"||m.value==="<0.0.0-0")||!y.includePrerelease&&(this.value.startsWith("<0.0.0")||m.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&m.operator.startsWith(">")||this.operator.startsWith("<")&&m.operator.startsWith("<")||this.semver.version===m.semver.version&&this.operator.includes("=")&&m.operator.includes("=")||l(this.semver,"<",m.semver,y)&&this.operator.startsWith(">")&&m.operator.startsWith("<")||l(this.semver,">",m.semver,y)&&this.operator.startsWith("<")&&m.operator.startsWith(">")))}}sc=e;const n=ec,{safeRe:o,t:i}=Oi,l=vh,c=Us,d=Bt,p=vn();return sc}const _A=vn();var Ys=(t,e,n)=>{try{e=new _A(e,n)}catch{return!1}return e.test(t)};const vA=vn();var CA=(t,e)=>new vA(t,e).set.map(n=>n.map(o=>o.value).join(" ").trim().split(" "));const wA=Bt,bA=vn();var xA=(t,e,n)=>{let o=null,i=null,l=null;try{l=new bA(e,n)}catch{return null}return t.forEach(c=>{l.test(c)&&(!o||i.compare(c)===-1)&&(o=c,i=new wA(o,n))}),o};const kA=Bt,EA=vn();var SA=(t,e,n)=>{let o=null,i=null,l=null;try{l=new EA(e,n)}catch{return null}return t.forEach(c=>{l.test(c)&&(!o||i.compare(c)===1)&&(o=c,i=new kA(o,n))}),o};const ac=Bt,TA=vn(),bh=js;var NA=(t,e)=>{t=new TA(t,e);let n=new ac("0.0.0");if(t.test(n)||(n=new ac("0.0.0-0"),t.test(n)))return n;n=null;for(let o=0;o<t.set.length;++o){const i=t.set[o];let l=null;i.forEach(c=>{const d=new ac(c.semver.version);switch(c.operator){case">":d.prerelease.length===0?d.patch++:d.prerelease.push(0),d.raw=d.format();case"":case">=":(!l||bh(d,l))&&(l=d);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${c.operator}`)}}),l&&(!n||bh(n,l))&&(n=l)}return n&&t.test(n)?n:null};const VA=vn();var AA=(t,e)=>{try{return new VA(t,e).range||"*"}catch{return null}};const BA=Bt,xh=Ks(),{ANY:PA}=xh,RA=vn(),DA=Ys,kh=js,Eh=nc,IA=oc,FA=rc;var lc=(t,e,n,o)=>{t=new BA(t,o),e=new RA(e,o);let i,l,c,d,p;switch(n){case">":i=kh,l=IA,c=Eh,d=">",p=">=";break;case"<":i=Eh,l=FA,c=kh,d="<",p="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(DA(t,e,o))return!1;for(let h=0;h<e.set.length;++h){const m=e.set[h];let y=null,b=null;if(m.forEach(w=>{w.semver===PA&&(w=new xh(">=0.0.0")),y=y||w,b=b||w,i(w.semver,y.semver,o)?y=w:c(w.semver,b.semver,o)&&(b=w)}),y.operator===d||y.operator===p||(!b.operator||b.operator===d)&&l(t,b.semver))return!1;if(b.operator===p&&c(t,b.semver))return!1}return!0};const LA=lc;var OA=(t,e,n)=>LA(t,e,">",n);const MA=lc;var GA=(t,e,n)=>MA(t,e,"<",n);const Sh=vn();var $A=(t,e,n)=>(t=new Sh(t,n),e=new Sh(e,n),t.intersects(e,n));const zA=Ys,UA=_n;var ZA=(t,e,n)=>{const o=[];let i=null,l=null;const c=t.sort((m,y)=>UA(m,y,n));for(const m of c)zA(m,e,n)?(l=m,i||(i=m)):(l&&o.push([i,l]),l=null,i=null);i&&o.push([i,null]);const d=[];for(const[m,y]of o)m===y?d.push(m):!y&&m===c[0]?d.push("*"):y?m===c[0]?d.push(`<=${y}`):d.push(`${m} - ${y}`):d.push(`>=${m}`);const p=d.join(" || "),h=typeof e.raw=="string"?e.raw:String(e);return p.length<h.length?p:e};const Th=vn(),cc=Ks(),{ANY:dc}=cc,Mi=Ys,uc=_n,WA=(t,e,n={})=>{if(t===e)return!0;t=new Th(t,n),e=new Th(e,n);let o=!1;e:for(const i of t.set){for(const l of e.set){const c=HA(i,l,n);if(o=o||c!==null,c)continue e}if(o)return!1}return!0},jA=[new cc(">=0.0.0-0")],Nh=[new cc(">=0.0.0")],HA=(t,e,n)=>{if(t===e)return!0;if(t.length===1&&t[0].semver===dc){if(e.length===1&&e[0].semver===dc)return!0;n.includePrerelease?t=jA:t=Nh}if(e.length===1&&e[0].semver===dc){if(n.includePrerelease)return!0;e=Nh}const o=new Set;let i,l;for(const w of t)w.operator===">"||w.operator===">="?i=Vh(i,w,n):w.operator==="<"||w.operator==="<="?l=Ah(l,w,n):o.add(w.semver);if(o.size>1)return null;let c;if(i&&l){if(c=uc(i.semver,l.semver,n),c>0)return null;if(c===0&&(i.operator!==">="||l.operator!=="<="))return null}for(const w of o){if(i&&!Mi(w,String(i),n)||l&&!Mi(w,String(l),n))return null;for(const S of e)if(!Mi(w,String(S),n))return!1;return!0}let d,p,h,m,y=l&&!n.includePrerelease&&l.semver.prerelease.length?l.semver:!1,b=i&&!n.includePrerelease&&i.semver.prerelease.length?i.semver:!1;y&&y.prerelease.length===1&&l.operator==="<"&&y.prerelease[0]===0&&(y=!1);for(const w of e){if(m=m||w.operator===">"||w.operator===">=",h=h||w.operator==="<"||w.operator==="<=",i){if(b&&w.semver.prerelease&&w.semver.prerelease.length&&w.semver.major===b.major&&w.semver.minor===b.minor&&w.semver.patch===b.patch&&(b=!1),w.operator===">"||w.operator===">="){if(d=Vh(i,w,n),d===w&&d!==i)return!1}else if(i.operator===">="&&!Mi(i.semver,String(w),n))return!1}if(l){if(y&&w.semver.prerelease&&w.semver.prerelease.length&&w.semver.major===y.major&&w.semver.minor===y.minor&&w.semver.patch===y.patch&&(y=!1),w.operator==="<"||w.operator==="<="){if(p=Ah(l,w,n),p===w&&p!==l)return!1}else if(l.operator==="<="&&!Mi(l.semver,String(w),n))return!1}if(!w.operator&&(l||i)&&c!==0)return!1}return!(i&&h&&!l&&c!==0||l&&m&&!i&&c!==0||b||y)},Vh=(t,e,n)=>{if(!t)return e;const o=uc(t.semver,e.semver,n);return o>0?t:o<0||e.operator===">"&&t.operator===">="?e:t},Ah=(t,e,n)=>{if(!t)return e;const o=uc(t.semver,e.semver,n);return o<0?t:o>0||e.operator==="<"&&t.operator==="<="?e:t};var qA=WA;const pc=Oi,Bh=zs,KA=Bt,Ph=lh,YA=No,XA=IV,JA=LV,QA=OV,eB=MV,tB=$V,nB=UV,rB=WV,oB=HV,iB=_n,sB=KV,aB=XV,lB=tc,cB=QV,dB=tA,uB=js,pB=nc,hB=yh,fB=_h,mB=rc,gB=oc,yB=vh,_B=gA,vB=Ks(),CB=vn();var wB={parse:YA,valid:XA,clean:JA,inc:QA,diff:eB,major:tB,minor:nB,patch:rB,prerelease:oB,compare:iB,rcompare:sB,compareLoose:aB,compareBuild:lB,sort:cB,rsort:dB,gt:uB,lt:pB,eq:hB,neq:fB,gte:mB,lte:gB,cmp:yB,coerce:_B,Comparator:vB,Range:CB,satisfies:Ys,toComparators:CA,maxSatisfying:xA,minSatisfying:SA,minVersion:NA,validRange:AA,outside:lc,gtr:OA,ltr:GA,intersects:$A,simplifyRange:ZA,subset:qA,SemVer:KA,re:pc.re,src:pc.src,tokens:pc.t,SEMVER_SPEC_VERSION:Bh.SEMVER_SPEC_VERSION,RELEASE_TYPES:Bh.RELEASE_TYPES,compareIdentifiers:Ph.compareIdentifiers,rcompareIdentifiers:Ph.rcompareIdentifiers};const bB=Jd(wB);function xB(t){return $r(t.id)}function kB(t){switch(t){case"isNotNA":return"Is not NA";case"isNA":return"Is NA";case"number_equals":case"string_equals":return"Equals";case"number_notEquals":case"string_notEquals":return"Not equals";case"number_greaterThan":return"Greater than";case"number_greaterThanOrEqualTo":return"Greater than or equal to";case"number_lessThan":return"Less than";case"number_lessThanOrEqualTo":return"Less than or equal to";case"number_between":return"Between";case"string_contains":return"Contains";case"string_doesNotContain":return"Does not contain";case"string_matches":return"Matches";case"string_doesNotMatch":return"Does not match";case"string_containsFuzzyMatch":return"Contains fuzzy match";default:throw Error(`unsupported filter type: ${t}`)}}const EB=["isNotNA","isNA","number_equals","number_notEquals","number_greaterThan","number_greaterThanOrEqualTo","number_lessThan","number_lessThanOrEqualTo","number_between"],SB=["isNotNA","isNA","string_equals","string_notEquals","string_contains","string_doesNotContain","string_matches","string_doesNotMatch","string_containsFuzzyMatch"];function Rh(t,e){var n,o;return((o=(n=t.spec.annotations)==null?void 0:n["pl7.app/label"])==null?void 0:o.trim())??"Unlabeled "+t.type+" "+e.toString()}function TB(t){const e=t.type;switch(e){case"isNotNA":case"isNA":return;case"number_equals":case"number_notEquals":case"number_greaterThan":case"number_greaterThanOrEqualTo":case"number_lessThan":case"number_lessThanOrEqualTo":return t.reference;case"number_between":return t.lowerBound;case"string_equals":case"string_notEquals":case"string_contains":case"string_doesNotContain":case"string_matches":case"string_doesNotMatch":case"string_containsFuzzyMatch":return t.reference;default:throw Error(`unsupported filter type: ${e}`)}}function Dh(t,e){switch(t){case"isNotNA":case"isNA":return{type:t};case"number_equals":case"number_notEquals":case"number_greaterThan":case"number_greaterThanOrEqualTo":case"number_lessThan":case"number_lessThanOrEqualTo":return{type:t,reference:typeof e=="number"?e:0};case"number_between":return{type:t,lowerBound:typeof e=="number"?e:0,includeLowerBound:!0,upperBound:100,includeUpperBound:!1};case"string_equals":case"string_notEquals":case"string_contains":case"string_doesNotContain":case"string_matches":case"string_doesNotMatch":return{type:t,reference:typeof e=="string"?e:""};case"string_containsFuzzyMatch":return{type:t,reference:typeof e=="string"?e:"",maxEdits:2,substitutionsOnly:!1,wildcard:void 0};default:throw Error(`unsupported filter type: ${t}`)}}function NB(t,e){return{columnId:t.columnId,filter:Dh(e,TB(t.filter)),disabled:t.disabled}}function hc(t,e){var c,d;const n=Number(e);if(!Number.isFinite(n))throw Error("Model value is not a number.");const o=t.type==="column"?t.spec.valueType:t.spec.type;if((o==="Int"||o==="Long")&&!Number.isInteger(n))throw Error("Model value is not an integer.");const i=(c=t.spec.annotations)==null?void 0:c["pl7.app/min"];if(i!==void 0){const p=Number(i);if(Number.isFinite(p)&&n<Number(i))throw Error("Model value is too low.")}const l=(d=t.spec.annotations)==null?void 0:d["pl7.app/max"];if(l!==void 0){const p=Number(l);if(Number.isFinite(p)&&n>Number(l))throw Error("Model value is too high.")}return n}function Ih(t,e){var o,i;const n=((o=t.spec.domain)==null?void 0:o["pl7.app/alphabet"])??((i=t.spec.annotations)==null?void 0:i["pl7.app/alphabet"]);if(n==="nucleotide"&&!/^[AaTtGgCcNn]+$/.test(e))throw Error("Model value is not a nucleotide.");if(n==="aminoacid"&&!/^[AaCcDdEeFfGgHhIiKkLlMmNnPpQqRrSsTtVvWwYyXx]+$/.test(e))throw Error("Model value is not an aminoacid.");return e}function VB(t){try{return new RegExp(t),t}catch(e){throw e instanceof SyntaxError?Error("Model value is not a regexp."):e}}function AB(t,e){var i,l;const n=((i=t.spec.domain)==null?void 0:i["pl7.app/alphabet"])??((l=t.spec.annotations)==null?void 0:l["pl7.app/alphabet"]);if(n==="nucleotide")return[{value:"N",text:"N"}];if(n==="aminoacid")return[{value:"X",text:"X"}];const o=ze.uniq(e);return o.sort(),o.map(c=>({value:c,text:c}))}function BB(t,e){var i,l;const n=bB.gt(gu().sdkInfo.sdkVersion,"1.14.0")&&(t.type==="column"?t.spec.valueType:t.spec.type)==="String"&&(((i=t.spec.domain)==null?void 0:i["pl7.app/alphabet"])??((l=t.spec.annotations)==null?void 0:l["pl7.app/alphabet"]))!==void 0,o=e.type;switch(o){case"isNotNA":return{operator:"Not",operand:{operator:"IsNA"}};case"isNA":return{operator:"IsNA"};case"number_equals":return{operator:"Equal",reference:e.reference};case"string_equals":return{operator:n?"IEqual":"Equal",reference:e.reference};case"number_notEquals":return{operator:"Not",operand:{operator:"Equal",reference:e.reference}};case"string_notEquals":return{operator:"Not",operand:{operator:n?"IEqual":"Equal",reference:e.reference}};case"number_greaterThan":return{operator:"Greater",reference:e.reference};case"number_greaterThanOrEqualTo":return{operator:"GreaterOrEqual",reference:e.reference};case"number_lessThan":return{operator:"Less",reference:e.reference};case"number_lessThanOrEqualTo":return{operator:"LessOrEqual",reference:e.reference};case"number_between":return{operator:"And",operands:[{operator:e.includeLowerBound?"GreaterOrEqual":"Greater",reference:e.lowerBound},{operator:e.includeUpperBound?"LessOrEqual":"Less",reference:e.upperBound}]};case"string_contains":return{operator:n?"StringIContains":"StringContains",substring:e.reference};case"string_doesNotContain":return{operator:"Not",operand:{operator:n?"StringIContains":"StringContains",substring:e.reference}};case"string_matches":return{operator:"Matches",regex:e.reference};case"string_doesNotMatch":return{operator:"Not",operand:{operator:"Matches",regex:e.reference}};case"string_containsFuzzyMatch":return{operator:n?"StringIContainsFuzzy":"StringContainsFuzzy",reference:e.reference,maxEdits:e.maxEdits,substitutionsOnly:e.substitutionsOnly,wildcard:e.wildcard};default:throw Error(`unsupported filter type: ${o}`)}}const PB={class:"d-flex flex-column gap-24"},Fh=r.defineComponent({__name:"PlTableFilterEntry",props:r.mergeModels({column:{},options:{},disabled:{type:Boolean}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=r.useModel(t,"modelValue"),n=t,{column:o,options:i}=r.toRefs(n);return(l,c)=>(r.openBlock(),r.createElementBlock("div",PB,[r.createVNode(r.unref(Co),{"model-value":e.value.filter.type,options:r.unref(i),disabled:l.disabled,label:"Predicate","onUpdate:modelValue":c[0]||(c[0]=d=>e.value=r.unref(NB)(e.value,d))},null,8,["model-value","options","disabled"]),e.value.filter.type==="number_equals"||e.value.filter.type==="number_notEquals"||e.value.filter.type==="number_lessThan"||e.value.filter.type==="number_lessThanOrEqualTo"||e.value.filter.type==="number_greaterThan"||e.value.filter.type==="number_greaterThanOrEqualTo"?(r.openBlock(),r.createBlock(r.unref(jr),{key:0,modelValue:e.value.filter.reference,"onUpdate:modelValue":c[1]||(c[1]=d=>e.value.filter.reference=d),disabled:l.disabled,parse:d=>r.unref(hc)(r.unref(o),d),label:"Reference value"},null,8,["modelValue","disabled","parse"])):r.createCommentVNode("",!0),e.value.filter.type==="number_between"?(r.openBlock(),r.createElementBlock(r.Fragment,{key:1},[r.createVNode(r.unref(jr),{modelValue:e.value.filter.lowerBound,"onUpdate:modelValue":c[2]||(c[2]=d=>e.value.filter.lowerBound=d),disabled:l.disabled,parse:d=>r.unref(hc)(r.unref(o),d),label:"Lower bound"},null,8,["modelValue","disabled","parse"]),r.createVNode(r.unref(Bs),{modelValue:e.value.filter.includeLowerBound,"onUpdate:modelValue":c[3]||(c[3]=d=>e.value.filter.includeLowerBound=d),disabled:l.disabled,label:"Include lower bound"},null,8,["modelValue","disabled"]),r.createVNode(r.unref(jr),{modelValue:e.value.filter.upperBound,"onUpdate:modelValue":c[4]||(c[4]=d=>e.value.filter.upperBound=d),disabled:l.disabled,parse:d=>r.unref(hc)(r.unref(o),d),label:"Upper bound"},null,8,["modelValue","disabled","parse"]),r.createVNode(r.unref(Bs),{modelValue:e.value.filter.includeUpperBound,"onUpdate:modelValue":c[5]||(c[5]=d=>e.value.filter.includeUpperBound=d),disabled:l.disabled,label:"Include upper bound"},null,8,["modelValue","disabled"])],64)):r.createCommentVNode("",!0),e.value.filter.type==="string_equals"||e.value.filter.type==="string_notEquals"||e.value.filter.type==="string_contains"||e.value.filter.type==="string_doesNotContain"?(r.openBlock(),r.createBlock(r.unref(jr),{key:2,modelValue:e.value.filter.reference,"onUpdate:modelValue":c[6]||(c[6]=d=>e.value.filter.reference=d),disabled:l.disabled,parse:d=>r.unref(Ih)(r.unref(o),d),label:"Reference value"},null,8,["modelValue","disabled","parse"])):r.createCommentVNode("",!0),e.value.filter.type==="string_matches"||e.value.filter.type==="string_doesNotMatch"?(r.openBlock(),r.createBlock(r.unref(jr),{key:3,modelValue:e.value.filter.reference,"onUpdate:modelValue":c[7]||(c[7]=d=>e.value.filter.reference=d),disabled:l.disabled,parse:r.unref(VB),label:"Reference value"},null,8,["modelValue","disabled","parse"])):r.createCommentVNode("",!0),e.value.filter.type==="string_containsFuzzyMatch"?(r.openBlock(),r.createElementBlock(r.Fragment,{key:4},[r.createVNode(r.unref(jr),{modelValue:e.value.filter.reference,"onUpdate:modelValue":c[8]||(c[8]=d=>e.value.filter.reference=d),disabled:l.disabled,parse:d=>r.unref(Ih)(r.unref(o),d),label:"Reference value"},null,8,["modelValue","disabled","parse"]),r.createVNode(r.unref(Hp),{modelValue:e.value.filter.maxEdits,"onUpdate:modelValue":c[9]||(c[9]=d=>e.value.filter.maxEdits=d),max:5,disabled:l.disabled,breakpoints:"",label:"Maximum nuber of substitutions and indels"},null,8,["modelValue","disabled"]),r.createVNode(r.unref(Bs),{modelValue:e.value.filter.substitutionsOnly,"onUpdate:modelValue":c[10]||(c[10]=d=>e.value.filter.substitutionsOnly=d),disabled:l.disabled,label:"Substitutions only"},null,8,["modelValue","disabled"]),r.createVNode(r.unref(Co),{modelValue:e.value.filter.wildcard,"onUpdate:modelValue":c[11]||(c[11]=d=>e.value.filter.wildcard=d),disabled:l.disabled,options:r.unref(AB)(r.unref(o),e.value.filter.reference),clearable:"",label:"Wildcard symbol"},null,8,["modelValue","disabled","options"])],64)):r.createCommentVNode("",!0)]))}}),RB={class:"d-flex flex-column gap-24"},DB={key:0,class:"text-subtitle-m",style:{color:"var(--txt-mask)"}},IB=r.defineComponent({__name:"PlTableAddFilter",props:r.mergeModels({columnsById:{},columnOptions:{},filterOptions:{},makeFilter:{type:Function}},{modelValue:{type:Boolean,required:!0},modelModifiers:{}}),emits:r.mergeModels(["addFilter"],["update:modelValue"]),setup(t,{emit:e}){const n=r.useModel(t,"modelValue"),o=t,{columnsById:i,columnOptions:l,filterOptions:c}=r.toRefs(o),d=e,p=r.ref(),h=r.ref();r.watch(()=>p.value,b=>{b?h.value=o.makeFilter(b):h.value=void 0});const m=()=>{p.value=void 0,n.value=!1},y=()=>{h.value&&(d("addFilter",h.value),m())};return(b,w)=>(r.openBlock(),r.createBlock(r.unref(As),{modelValue:n.value,"onUpdate:modelValue":w[2]||(w[2]=S=>n.value=S),"close-on-outside-click":!1},{title:r.withCtx(()=>w[3]||(w[3]=[r.createTextVNode("Add Filter")])),actions:r.withCtx(()=>[r.createVNode(r.unref(Ss),{disabled:!h.value,onClick:y},{default:r.withCtx(()=>w[4]||(w[4]=[r.createTextVNode("Add Filter")])),_:1},8,["disabled"]),r.createVNode(r.unref(vo),{"justify-center":!1,onClick:m},{default:r.withCtx(()=>w[5]||(w[5]=[r.createTextVNode("Cancel")])),_:1})]),default:r.withCtx(()=>[r.createElementVNode("div",RB,[r.createVNode(r.unref(Co),{modelValue:p.value,"onUpdate:modelValue":w[0]||(w[0]=S=>p.value=S),options:r.unref(l),label:"Column",placeholder:"Choose..."},null,8,["modelValue","options"]),h.value?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",DB,"Choose a column to view and adjust its options")),h.value?(r.openBlock(),r.createBlock(Fh,{key:1,modelValue:h.value,"onUpdate:modelValue":w[1]||(w[1]=S=>h.value=S),column:r.unref(i)[h.value.columnId],options:r.unref(c)[h.value.columnId]},null,8,["modelValue","column","options"])):r.createCommentVNode("",!0)])]),_:1},8,["modelValue"]))}}),FB=["onClick"],LB={class:"pl-filter-manager__expand-icon"},OB={class:"pl-filter-manager__title flex-grow-1 text-s-btn"},MB={class:"pl-filter-manager__actions d-flex gap-12"},GB=["onClick"],$B=["onClick"],zB={class:"pl-filter-manager__content d-flex gap-24 p-24 flex-column"},UB={class:"d-flex justify-center"},ZB=["onClick"],WB={class:"pl-filter-manager__add-btn-icon"},jB={key:0},HB=r.defineComponent({__name:"PlTableFilters",props:r.mergeModels({columns:{},restrictions:{},defaults:{}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=r.useModel(t,"modelValue"),n=t,{columns:o,restrictions:i,defaults:l}=r.toRefs(n),c=r.computed(()=>{const $=o.value.filter(U=>{const k=U.type;switch(k){case"axis":return U.spec.type!=="Bytes";case"column":return U.spec.valueType!=="Bytes";default:throw Error(`unsupported data type: ${k}`)}}),j={};for(const U of $)j[xB(U)]=U;return j}),d=r.computed(()=>{const $=i.value??[],j={};for(const[U,k]of Object.entries(c.value)){const x=ze.find($,B=>ze.isEqual(B.column.id,k.id));x&&(j[U]=x.allowedFilterTypes)}return j}),p=r.computed(()=>{const $=l.value??[],j={};for(const[U,k]of Object.entries(c.value)){const x=ze.find($,B=>ze.isEqual(B.column.id,k.id));x&&(j[U]={columnId:U,filter:x.default,disabled:!1})}return j});(()=>{let $=e.value.state;typeof $=="object"&&!Array.isArray($)&&(e.value.state=Object.entries($).map(([j,U])=>({columnId:j,filter:U,disabled:!1})))})();const h=$=>$??Object.values(p.value),m=r.reactive({state:h(e.value.state)});r.watch(()=>e.value,$=>{ze.isEqual(m.state,$.state)||(m.state=h($.state))}),r.watch(()=>m,$=>{ze.isEqual($.state,e.value.state)||(e.value={state:ze.cloneDeep($.state),filters:$.state.filter(j=>!j.disabled).map(j=>{const U=c.value[j.columnId],{spec:k,...x}=U;return{type:"bySingleColumnV2",column:x,predicate:BB(U,j.filter)}})})},{immediate:!0,deep:!0}),r.watch(()=>c.value,$=>{Object.keys($).length===0&&m.state!==void 0||(m.state=m.state.filter(j=>!!$[j.columnId]))},{immediate:!0});const y=r.computed(()=>Object.keys(c).length>0&&m.state.length>0),b=r.computed(()=>{const $=d.value,j={};for(const[U,k]of Object.entries(c.value)){let B=(k.type==="column"?k.spec.valueType:k.spec.type)==="String"?SB:EB;const G=$[U];G&&(B=B.filter(H=>G.includes(H))),j[U]=B.map(H=>({value:H,text:kB(H)}))}return j}),w=r.computed(()=>ze.some(Object.values(b.value),$=>$.length>0)),S=r.computed(()=>Object.entries(Object.entries(c.value)).filter(([$,[j,U]])=>b.value[j].length>0).filter(([$,[j,U]])=>!m.state.some(k=>k.columnId===j)).map(([$,[j,U]])=>({label:Rh(U,$),value:j}))),M=$=>p.value[$]??{columnId:$,filter:Dh(b.value[$][0].value),disabled:!1},O=$=>{m.state[$]=M(m.state[$].columnId)},C=$=>m.state.splice($,1),I=r.ref(!1),F=r.ref(!1),W=r.ref(!1);r.onMounted(()=>{W.value=!0});const P=r.reactive({}),V=$=>{P[$]?delete P[$]:P[$]=!0},Z=r.ref(!1),J=r.ref();let ae;return r.onMounted(()=>{ae=new ResizeObserver(()=>{var j;const $=(j=J.value)==null?void 0:j.parentElement;$&&(Z.value=$.scrollHeight>$.clientHeight||$.scrollWidth>$.clientWidth)}),J.value&&J.value.parentElement&&ae.observe(J.value.parentElement)}),r.watch(J,($,j)=>{j!=null&&j.parentElement&&ae.unobserve(j.parentElement),$!=null&&$.parentElement&&ae.observe($.parentElement)}),r.onBeforeUnmount(()=>{ae!==void 0&&ae.disconnect()}),($,j)=>(r.openBlock(),r.createElementBlock(r.Fragment,null,[W.value?(r.openBlock(),r.createBlock(r.Teleport,{key:0,to:`#${r.unref(Jl)}`},[r.createVNode(r.unref(vo),{onClick:j[0]||(j[0]=r.withModifiers(U=>I.value=!0,["stop"]))},{append:r.withCtx(()=>[r.createVNode(r.unref(Ns),{name:y.value?"filter-on":"filter"},null,8,["name"])]),default:r.withCtx(()=>[j[5]||(j[5]=r.createTextVNode(" Filters "))]),_:1})],8,["to"])):r.createCommentVNode("",!0),r.createVNode(r.unref(As),{modelValue:I.value,"onUpdate:modelValue":j[2]||(j[2]=U=>I.value=U),"close-on-outside-click":!1},{title:r.withCtx(()=>j[6]||(j[6]=[r.createTextVNode("Manage Filters")])),default:r.withCtx(()=>[r.createElementVNode("div",{ref_key:"filterManager",ref:J,class:"pl-filter-manager d-flex flex-column gap-6"},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(m.state,(U,k)=>(r.openBlock(),r.createElementBlock("div",{key:U.columnId,class:r.normalizeClass([{open:P[U.columnId],disabled:U.disabled},"pl-filter-manager__filter"])},[r.createElementVNode("div",{class:"pl-filter-manager__header d-flex align-center gap-8",onClick:x=>V(U.columnId)},[r.createElementVNode("div",LB,[r.createVNode(r.unref(nn),{name:"chevron-right"})]),r.createElementVNode("div",OB,r.toDisplayString(r.unref(Rh)(c.value[U.columnId],k)),1),r.createElementVNode("div",MB,[r.createElementVNode("div",{class:"pl-filter-manager__toggle",onClick:r.withModifiers(x=>U.disabled=!U.disabled,["stop"])},[r.createVNode(r.unref(Vt),{name:U.disabled?"view-hide":"view-show"},null,8,["name"])],8,GB),r.createElementVNode("div",{class:"pl-filter-manager__delete",onClick:r.withModifiers(x=>C(k),["stop"])},[r.createVNode(r.unref(Vt),{name:"close"})],8,$B)])],8,FB),r.createElementVNode("div",zB,[r.createVNode(Fh,{modelValue:m.state[k],"onUpdate:modelValue":x=>m.state[k]=x,disabled:U.disabled,column:c.value[U.columnId],options:b.value[U.columnId]},null,8,["modelValue","onUpdate:modelValue","disabled","column","options"]),r.createElementVNode("div",UB,[r.createElementVNode("div",{class:r.normalizeClass([{disabled:U.disabled},"pl-filter-manager__revert-btn text-s-btn d-flex align-center gap-8"]),onClick:x=>O(k)},[j[7]||(j[7]=r.createTextVNode(" Revert Settings to Default ")),r.createVNode(r.unref(Vt),{name:"reverse"})],10,ZB)])])],2))),128)),r.createElementVNode("div",{class:r.normalizeClass([{"pt-24":Z.value},"pl-filter-manager__add-action-wrapper"])},[S.value.length>0?(r.openBlock(),r.createElementBlock("div",{key:0,class:"pl-filter-manager__add-btn",onClick:j[1]||(j[1]=U=>F.value=!0)},[r.createElementVNode("div",WB,[r.createVNode(r.unref(nn),{name:"add"})]),j[8]||(j[8]=r.createElementVNode("div",{class:"pl-filter-manager__add-btn-title text-s-btn"},"Add Filter",-1))])):r.createCommentVNode("",!0)],2),w.value?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",jB,"No filters applicable"))],512)]),_:1},8,["modelValue"]),r.createVNode(IB,{modelValue:F.value,"onUpdate:modelValue":j[3]||(j[3]=U=>F.value=U),"columns-by-id":c.value,"column-options":S.value,"filter-options":b.value,"make-filter":M,onAddFilter:j[4]||(j[4]=U=>m.state.push(U))},null,8,["modelValue","columns-by-id","column-options","filter-options"])],64))}}),Xs=new Map;function qB(t,e){const n=r.getCurrentScope()??r.effectScope(),o=n.run(()=>(r.onScopeDispose(()=>{Xs.delete(t)}),r.reactive(e())));return o[Symbol.dispose]=()=>{n.stop()},o}function KB(t){const e=Symbol();return()=>(Xs.has(e)||Xs.set(e,qB(e,t)),Xs.get(e))}function YB(t){return r.computed(()=>{try{return eu(t())}catch(e){return{errors:[String(e)],value:void 0}}})}function Lh(t,e,n){const o=r.ref(0),i=r.reactive({loading:r.computed(()=>o.value>0),loadingRef:o,value:void 0,error:void 0}),l=Lg(e);return r.watch(t,async c=>{i.error=void 0,o.value++,l(c).then(d=>{d.ok&&(i.value=d.value)}).catch(d=>{i.value=void 0,i.error=d}).finally(()=>{o.value--})},Object.assign({immediate:!0,deep:!0},n??{})),i}const Vo=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,Oh=new Set,fc=typeof process=="object"&&process?process:{},Mh=(t,e,n,o)=>{typeof fc.emitWarning=="function"?fc.emitWarning(t,e,n,o):console.error(`[${n}] ${e}: ${t}`)};let Js=globalThis.AbortController,Gh=globalThis.AbortSignal;if(typeof Js>"u"){Gh=class{constructor(){We(this,"onabort");We(this,"_onabort",[]);We(this,"reason");We(this,"aborted",!1)}addEventListener(o,i){this._onabort.push(i)}},Js=class{constructor(){We(this,"signal",new Gh);e()}abort(o){var i,l;if(!this.signal.aborted){this.signal.reason=o,this.signal.aborted=!0;for(const c of this.signal._onabort)c(o);(l=(i=this.signal).onabort)==null||l.call(i,o)}}};let t=((zh=fc.env)==null?void 0:zh.LRU_CACHE_IGNORE_AC_WARNING)!=="1";const e=()=>{t&&(t=!1,Mh("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",e))}}const XB=t=>!Oh.has(t),Tr=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),$h=t=>Tr(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?Qs:null:null;class Qs extends Array{constructor(e){super(e),this.fill(0)}}const Yr=class Yr{constructor(e,n){We(this,"heap");We(this,"length");if(!E(Yr,Ao))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new n(e),this.length=0}static create(e){const n=$h(e);if(!n)return[];ye(Yr,Ao,!0);const o=new Yr(e,n);return ye(Yr,Ao,!1),o}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}};Ao=new WeakMap,Ue(Yr,Ao,!1);let mc=Yr;const _c=class _c{constructor(e){Ue(this,re);Ue(this,Cn);Ue(this,jt);Ue(this,wn);Ue(this,bn);Ue(this,Bo);Ue(this,Po);We(this,"ttl");We(this,"ttlResolution");We(this,"ttlAutopurge");We(this,"updateAgeOnGet");We(this,"updateAgeOnHas");We(this,"allowStale");We(this,"noDisposeOnSet");We(this,"noUpdateTTL");We(this,"maxEntrySize");We(this,"sizeCalculation");We(this,"noDeleteOnFetchRejection");We(this,"noDeleteOnStaleGet");We(this,"allowStaleOnFetchAbort");We(this,"allowStaleOnFetchRejection");We(this,"ignoreFetchAbort");Ue(this,ut);Ue(this,xn);Ue(this,dt);Ue(this,Je);Ue(this,Se);Ue(this,Pt);Ue(this,Ht);Ue(this,Et);Ue(this,mt);Ue(this,kn);Ue(this,gt);Ue(this,En);Ue(this,Sn);Ue(this,qt);Ue(this,Tn);Ue(this,Nr);Ue(this,Rt);Ue(this,Xr,()=>{});Ue(this,Jn,()=>{});Ue(this,Gi,()=>{});Ue(this,Kt,()=>!1);Ue(this,Jr,e=>{});Ue(this,Ro,(e,n,o)=>{});Ue(this,$i,(e,n,o,i)=>{if(o||i)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});We(this,Uh,"LRUCache");const{max:n=0,ttl:o,ttlResolution:i=1,ttlAutopurge:l,updateAgeOnGet:c,updateAgeOnHas:d,allowStale:p,dispose:h,disposeAfter:m,noDisposeOnSet:y,noUpdateTTL:b,maxSize:w=0,maxEntrySize:S=0,sizeCalculation:M,fetchMethod:O,memoMethod:C,noDeleteOnFetchRejection:I,noDeleteOnStaleGet:F,allowStaleOnFetchRejection:W,allowStaleOnFetchAbort:P,ignoreFetchAbort:V}=e;if(n!==0&&!Tr(n))throw new TypeError("max option must be a nonnegative integer");const Z=n?$h(n):Array;if(!Z)throw new Error("invalid max value: "+n);if(ye(this,Cn,n),ye(this,jt,w),this.maxEntrySize=S||E(this,jt),this.sizeCalculation=M,this.sizeCalculation){if(!E(this,jt)&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(C!==void 0&&typeof C!="function")throw new TypeError("memoMethod must be a function if defined");if(ye(this,Po,C),O!==void 0&&typeof O!="function")throw new TypeError("fetchMethod must be a function if specified");if(ye(this,Bo,O),ye(this,Nr,!!O),ye(this,dt,new Map),ye(this,Je,new Array(n).fill(void 0)),ye(this,Se,new Array(n).fill(void 0)),ye(this,Pt,new Z(n)),ye(this,Ht,new Z(n)),ye(this,Et,0),ye(this,mt,0),ye(this,kn,mc.create(n)),ye(this,ut,0),ye(this,xn,0),typeof h=="function"&&ye(this,wn,h),typeof m=="function"?(ye(this,bn,m),ye(this,gt,[])):(ye(this,bn,void 0),ye(this,gt,void 0)),ye(this,Tn,!!E(this,wn)),ye(this,Rt,!!E(this,bn)),this.noDisposeOnSet=!!y,this.noUpdateTTL=!!b,this.noDeleteOnFetchRejection=!!I,this.allowStaleOnFetchRejection=!!W,this.allowStaleOnFetchAbort=!!P,this.ignoreFetchAbort=!!V,this.maxEntrySize!==0){if(E(this,jt)!==0&&!Tr(E(this,jt)))throw new TypeError("maxSize must be a positive integer if specified");if(!Tr(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");ue(this,re,Eg).call(this)}if(this.allowStale=!!p,this.noDeleteOnStaleGet=!!F,this.updateAgeOnGet=!!c,this.updateAgeOnHas=!!d,this.ttlResolution=Tr(i)||i===0?i:1,this.ttlAutopurge=!!l,this.ttl=o||0,this.ttl){if(!Tr(this.ttl))throw new TypeError("ttl must be a positive integer if specified");ue(this,re,$d).call(this)}if(E(this,Cn)===0&&this.ttl===0&&E(this,jt)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!E(this,Cn)&&!E(this,jt)){const J="LRU_CACHE_UNBOUNDED";XB(J)&&(Oh.add(J),Mh("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",J,_c))}}static unsafeExposeInternals(e){return{starts:E(e,Sn),ttls:E(e,qt),sizes:E(e,En),keyMap:E(e,dt),keyList:E(e,Je),valList:E(e,Se),next:E(e,Pt),prev:E(e,Ht),get head(){return E(e,Et)},get tail(){return E(e,mt)},free:E(e,kn),isBackgroundFetch:n=>{var o;return ue(o=e,re,et).call(o,n)},backgroundFetch:(n,o,i,l)=>{var c;return ue(c=e,re,Ha).call(c,n,o,i,l)},moveToTail:n=>{var o;return ue(o=e,re,ds).call(o,n)},indexes:n=>{var o;return ue(o=e,re,Or).call(o,n)},rindexes:n=>{var o;return ue(o=e,re,Mr).call(o,n)},isStale:n=>{var o;return E(o=e,Kt).call(o,n)}}}get max(){return E(this,Cn)}get maxSize(){return E(this,jt)}get calculatedSize(){return E(this,xn)}get size(){return E(this,ut)}get fetchMethod(){return E(this,Bo)}get memoMethod(){return E(this,Po)}get dispose(){return E(this,wn)}get disposeAfter(){return E(this,bn)}getRemainingTTL(e){return E(this,dt).has(e)?1/0:0}*entries(){for(const e of ue(this,re,Or).call(this))E(this,Se)[e]!==void 0&&E(this,Je)[e]!==void 0&&!ue(this,re,et).call(this,E(this,Se)[e])&&(yield[E(this,Je)[e],E(this,Se)[e]])}*rentries(){for(const e of ue(this,re,Mr).call(this))E(this,Se)[e]!==void 0&&E(this,Je)[e]!==void 0&&!ue(this,re,et).call(this,E(this,Se)[e])&&(yield[E(this,Je)[e],E(this,Se)[e]])}*keys(){for(const e of ue(this,re,Or).call(this)){const n=E(this,Je)[e];n!==void 0&&!ue(this,re,et).call(this,E(this,Se)[e])&&(yield n)}}*rkeys(){for(const e of ue(this,re,Mr).call(this)){const n=E(this,Je)[e];n!==void 0&&!ue(this,re,et).call(this,E(this,Se)[e])&&(yield n)}}*values(){for(const e of ue(this,re,Or).call(this))E(this,Se)[e]!==void 0&&!ue(this,re,et).call(this,E(this,Se)[e])&&(yield E(this,Se)[e])}*rvalues(){for(const e of ue(this,re,Mr).call(this))E(this,Se)[e]!==void 0&&!ue(this,re,et).call(this,E(this,Se)[e])&&(yield E(this,Se)[e])}[(Zh=Symbol.iterator,Uh=Symbol.toStringTag,Zh)](){return this.entries()}find(e,n={}){for(const o of ue(this,re,Or).call(this)){const i=E(this,Se)[o],l=ue(this,re,et).call(this,i)?i.__staleWhileFetching:i;if(l!==void 0&&e(l,E(this,Je)[o],this))return this.get(E(this,Je)[o],n)}}forEach(e,n=this){for(const o of ue(this,re,Or).call(this)){const i=E(this,Se)[o],l=ue(this,re,et).call(this,i)?i.__staleWhileFetching:i;l!==void 0&&e.call(n,l,E(this,Je)[o],this)}}rforEach(e,n=this){for(const o of ue(this,re,Mr).call(this)){const i=E(this,Se)[o],l=ue(this,re,et).call(this,i)?i.__staleWhileFetching:i;l!==void 0&&e.call(n,l,E(this,Je)[o],this)}}purgeStale(){let e=!1;for(const n of ue(this,re,Mr).call(this,{allowStale:!0}))E(this,Kt).call(this,n)&&(ue(this,re,Gr).call(this,E(this,Je)[n],"expire"),e=!0);return e}info(e){const n=E(this,dt).get(e);if(n===void 0)return;const o=E(this,Se)[n],i=ue(this,re,et).call(this,o)?o.__staleWhileFetching:o;if(i===void 0)return;const l={value:i};if(E(this,qt)&&E(this,Sn)){const c=E(this,qt)[n],d=E(this,Sn)[n];if(c&&d){const p=c-(Vo.now()-d);l.ttl=p,l.start=Date.now()}}return E(this,En)&&(l.size=E(this,En)[n]),l}dump(){const e=[];for(const n of ue(this,re,Or).call(this,{allowStale:!0})){const o=E(this,Je)[n],i=E(this,Se)[n],l=ue(this,re,et).call(this,i)?i.__staleWhileFetching:i;if(l===void 0||o===void 0)continue;const c={value:l};if(E(this,qt)&&E(this,Sn)){c.ttl=E(this,qt)[n];const d=Vo.now()-E(this,Sn)[n];c.start=Math.floor(Date.now()-d)}E(this,En)&&(c.size=E(this,En)[n]),e.unshift([o,c])}return e}load(e){this.clear();for(const[n,o]of e){if(o.start){const i=Date.now()-o.start;o.start=Vo.now()-i}this.set(n,o.value,o)}}set(e,n,o={}){var b,w,S,M,O;if(n===void 0)return this.delete(e),this;const{ttl:i=this.ttl,start:l,noDisposeOnSet:c=this.noDisposeOnSet,sizeCalculation:d=this.sizeCalculation,status:p}=o;let{noUpdateTTL:h=this.noUpdateTTL}=o;const m=E(this,$i).call(this,e,n,o.size||0,d);if(this.maxEntrySize&&m>this.maxEntrySize)return p&&(p.set="miss",p.maxEntrySizeExceeded=!0),ue(this,re,Gr).call(this,e,"set"),this;let y=E(this,ut)===0?void 0:E(this,dt).get(e);if(y===void 0)y=E(this,ut)===0?E(this,mt):E(this,kn).length!==0?E(this,kn).pop():E(this,ut)===E(this,Cn)?ue(this,re,ja).call(this,!1):E(this,ut),E(this,Je)[y]=e,E(this,Se)[y]=n,E(this,dt).set(e,y),E(this,Pt)[E(this,mt)]=y,E(this,Ht)[y]=E(this,mt),ye(this,mt,y),Wa(this,ut)._++,E(this,Ro).call(this,y,m,p),p&&(p.set="add"),h=!1;else{ue(this,re,ds).call(this,y);const C=E(this,Se)[y];if(n!==C){if(E(this,Nr)&&ue(this,re,et).call(this,C)){C.__abortController.abort(new Error("replaced"));const{__staleWhileFetching:I}=C;I!==void 0&&!c&&(E(this,Tn)&&((b=E(this,wn))==null||b.call(this,I,e,"set")),E(this,Rt)&&((w=E(this,gt))==null||w.push([I,e,"set"])))}else c||(E(this,Tn)&&((S=E(this,wn))==null||S.call(this,C,e,"set")),E(this,Rt)&&((M=E(this,gt))==null||M.push([C,e,"set"])));if(E(this,Jr).call(this,y),E(this,Ro).call(this,y,m,p),E(this,Se)[y]=n,p){p.set="replace";const I=C&&ue(this,re,et).call(this,C)?C.__staleWhileFetching:C;I!==void 0&&(p.oldValue=I)}}else p&&(p.set="update")}if(i!==0&&!E(this,qt)&&ue(this,re,$d).call(this),E(this,qt)&&(h||E(this,Gi).call(this,y,i,l),p&&E(this,Jn).call(this,p,y)),!c&&E(this,Rt)&&E(this,gt)){const C=E(this,gt);let I;for(;I=C==null?void 0:C.shift();)(O=E(this,bn))==null||O.call(this,...I)}return this}pop(){var e;try{for(;E(this,ut);){const n=E(this,Se)[E(this,Et)];if(ue(this,re,ja).call(this,!0),ue(this,re,et).call(this,n)){if(n.__staleWhileFetching)return n.__staleWhileFetching}else if(n!==void 0)return n}}finally{if(E(this,Rt)&&E(this,gt)){const n=E(this,gt);let o;for(;o=n==null?void 0:n.shift();)(e=E(this,bn))==null||e.call(this,...o)}}}has(e,n={}){const{updateAgeOnHas:o=this.updateAgeOnHas,status:i}=n,l=E(this,dt).get(e);if(l!==void 0){const c=E(this,Se)[l];if(ue(this,re,et).call(this,c)&&c.__staleWhileFetching===void 0)return!1;if(E(this,Kt).call(this,l))i&&(i.has="stale",E(this,Jn).call(this,i,l));else return o&&E(this,Xr).call(this,l),i&&(i.has="hit",E(this,Jn).call(this,i,l)),!0}else i&&(i.has="miss");return!1}peek(e,n={}){const{allowStale:o=this.allowStale}=n,i=E(this,dt).get(e);if(i===void 0||!o&&E(this,Kt).call(this,i))return;const l=E(this,Se)[i];return ue(this,re,et).call(this,l)?l.__staleWhileFetching:l}async fetch(e,n={}){const{allowStale:o=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:l=this.noDeleteOnStaleGet,ttl:c=this.ttl,noDisposeOnSet:d=this.noDisposeOnSet,size:p=0,sizeCalculation:h=this.sizeCalculation,noUpdateTTL:m=this.noUpdateTTL,noDeleteOnFetchRejection:y=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:b=this.allowStaleOnFetchRejection,ignoreFetchAbort:w=this.ignoreFetchAbort,allowStaleOnFetchAbort:S=this.allowStaleOnFetchAbort,context:M,forceRefresh:O=!1,status:C,signal:I}=n;if(!E(this,Nr))return C&&(C.fetch="get"),this.get(e,{allowStale:o,updateAgeOnGet:i,noDeleteOnStaleGet:l,status:C});const F={allowStale:o,updateAgeOnGet:i,noDeleteOnStaleGet:l,ttl:c,noDisposeOnSet:d,size:p,sizeCalculation:h,noUpdateTTL:m,noDeleteOnFetchRejection:y,allowStaleOnFetchRejection:b,allowStaleOnFetchAbort:S,ignoreFetchAbort:w,status:C,signal:I};let W=E(this,dt).get(e);if(W===void 0){C&&(C.fetch="miss");const P=ue(this,re,Ha).call(this,e,W,F,M);return P.__returned=P}else{const P=E(this,Se)[W];if(ue(this,re,et).call(this,P)){const $=o&&P.__staleWhileFetching!==void 0;return C&&(C.fetch="inflight",$&&(C.returnedStale=!0)),$?P.__staleWhileFetching:P.__returned=P}const V=E(this,Kt).call(this,W);if(!O&&!V)return C&&(C.fetch="hit"),ue(this,re,ds).call(this,W),i&&E(this,Xr).call(this,W),C&&E(this,Jn).call(this,C,W),P;const Z=ue(this,re,Ha).call(this,e,W,F,M),ae=Z.__staleWhileFetching!==void 0&&o;return C&&(C.fetch=V?"stale":"refresh",ae&&V&&(C.returnedStale=!0)),ae?Z.__staleWhileFetching:Z.__returned=Z}}async forceFetch(e,n={}){const o=await this.fetch(e,n);if(o===void 0)throw new Error("fetch() returned undefined");return o}memo(e,n={}){const o=E(this,Po);if(!o)throw new Error("no memoMethod provided to constructor");const{context:i,forceRefresh:l,...c}=n,d=this.get(e,c);if(!l&&d!==void 0)return d;const p=o(e,d,{options:c,context:i});return this.set(e,p,c),p}get(e,n={}){const{allowStale:o=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:l=this.noDeleteOnStaleGet,status:c}=n,d=E(this,dt).get(e);if(d!==void 0){const p=E(this,Se)[d],h=ue(this,re,et).call(this,p);return c&&E(this,Jn).call(this,c,d),E(this,Kt).call(this,d)?(c&&(c.get="stale"),h?(c&&o&&p.__staleWhileFetching!==void 0&&(c.returnedStale=!0),o?p.__staleWhileFetching:void 0):(l||ue(this,re,Gr).call(this,e,"expire"),c&&o&&(c.returnedStale=!0),o?p:void 0)):(c&&(c.get="hit"),h?p.__staleWhileFetching:(ue(this,re,ds).call(this,d),i&&E(this,Xr).call(this,d),p))}else c&&(c.get="miss")}delete(e){return ue(this,re,Gr).call(this,e,"delete")}clear(){return ue(this,re,Zd).call(this,"delete")}};Cn=new WeakMap,jt=new WeakMap,wn=new WeakMap,bn=new WeakMap,Bo=new WeakMap,Po=new WeakMap,ut=new WeakMap,xn=new WeakMap,dt=new WeakMap,Je=new WeakMap,Se=new WeakMap,Pt=new WeakMap,Ht=new WeakMap,Et=new WeakMap,mt=new WeakMap,kn=new WeakMap,gt=new WeakMap,En=new WeakMap,Sn=new WeakMap,qt=new WeakMap,Tn=new WeakMap,Nr=new WeakMap,Rt=new WeakMap,re=new WeakSet,$d=function(){const e=new Qs(E(this,Cn)),n=new Qs(E(this,Cn));ye(this,qt,e),ye(this,Sn,n),ye(this,Gi,(l,c,d=Vo.now())=>{if(n[l]=c!==0?d:0,e[l]=c,c!==0&&this.ttlAutopurge){const p=setTimeout(()=>{E(this,Kt).call(this,l)&&ue(this,re,Gr).call(this,E(this,Je)[l],"expire")},c+1);p.unref&&p.unref()}}),ye(this,Xr,l=>{n[l]=e[l]!==0?Vo.now():0}),ye(this,Jn,(l,c)=>{if(e[c]){const d=e[c],p=n[c];if(!d||!p)return;l.ttl=d,l.start=p,l.now=o||i();const h=l.now-p;l.remainingTTL=d-h}});let o=0;const i=()=>{const l=Vo.now();if(this.ttlResolution>0){o=l;const c=setTimeout(()=>o=0,this.ttlResolution);c.unref&&c.unref()}return l};this.getRemainingTTL=l=>{const c=E(this,dt).get(l);if(c===void 0)return 0;const d=e[c],p=n[c];if(!d||!p)return 1/0;const h=(o||i())-p;return d-h},ye(this,Kt,l=>{const c=n[l],d=e[l];return!!d&&!!c&&(o||i())-c>d})},Xr=new WeakMap,Jn=new WeakMap,Gi=new WeakMap,Kt=new WeakMap,Eg=function(){const e=new Qs(E(this,Cn));ye(this,xn,0),ye(this,En,e),ye(this,Jr,n=>{ye(this,xn,E(this,xn)-e[n]),e[n]=0}),ye(this,$i,(n,o,i,l)=>{if(ue(this,re,et).call(this,o))return 0;if(!Tr(i))if(l){if(typeof l!="function")throw new TypeError("sizeCalculation must be a function");if(i=l(o,n),!Tr(i))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return i}),ye(this,Ro,(n,o,i)=>{if(e[n]=o,E(this,jt)){const l=E(this,jt)-e[n];for(;E(this,xn)>l;)ue(this,re,ja).call(this,!0)}ye(this,xn,E(this,xn)+e[n]),i&&(i.entrySize=o,i.totalCalculatedSize=E(this,xn))})},Jr=new WeakMap,Ro=new WeakMap,$i=new WeakMap,Or=function*({allowStale:e=this.allowStale}={}){if(E(this,ut))for(let n=E(this,mt);!(!ue(this,re,zd).call(this,n)||((e||!E(this,Kt).call(this,n))&&(yield n),n===E(this,Et)));)n=E(this,Ht)[n]},Mr=function*({allowStale:e=this.allowStale}={}){if(E(this,ut))for(let n=E(this,Et);!(!ue(this,re,zd).call(this,n)||((e||!E(this,Kt).call(this,n))&&(yield n),n===E(this,mt)));)n=E(this,Pt)[n]},zd=function(e){return e!==void 0&&E(this,dt).get(E(this,Je)[e])===e},ja=function(e){var l,c;const n=E(this,Et),o=E(this,Je)[n],i=E(this,Se)[n];return E(this,Nr)&&ue(this,re,et).call(this,i)?i.__abortController.abort(new Error("evicted")):(E(this,Tn)||E(this,Rt))&&(E(this,Tn)&&((l=E(this,wn))==null||l.call(this,i,o,"evict")),E(this,Rt)&&((c=E(this,gt))==null||c.push([i,o,"evict"]))),E(this,Jr).call(this,n),e&&(E(this,Je)[n]=void 0,E(this,Se)[n]=void 0,E(this,kn).push(n)),E(this,ut)===1?(ye(this,Et,ye(this,mt,0)),E(this,kn).length=0):ye(this,Et,E(this,Pt)[n]),E(this,dt).delete(o),Wa(this,ut)._--,n},Ha=function(e,n,o,i){const l=n===void 0?void 0:E(this,Se)[n];if(ue(this,re,et).call(this,l))return l;const c=new Js,{signal:d}=o;d==null||d.addEventListener("abort",()=>c.abort(d.reason),{signal:c.signal});const p={signal:c.signal,options:o,context:i},h=(M,O=!1)=>{const{aborted:C}=c.signal,I=o.ignoreFetchAbort&&M!==void 0;if(o.status&&(C&&!O?(o.status.fetchAborted=!0,o.status.fetchError=c.signal.reason,I&&(o.status.fetchAbortIgnored=!0)):o.status.fetchResolved=!0),C&&!I&&!O)return y(c.signal.reason);const F=w;return E(this,Se)[n]===w&&(M===void 0?F.__staleWhileFetching?E(this,Se)[n]=F.__staleWhileFetching:ue(this,re,Gr).call(this,e,"fetch"):(o.status&&(o.status.fetchUpdated=!0),this.set(e,M,p.options))),M},m=M=>(o.status&&(o.status.fetchRejected=!0,o.status.fetchError=M),y(M)),y=M=>{const{aborted:O}=c.signal,C=O&&o.allowStaleOnFetchAbort,I=C||o.allowStaleOnFetchRejection,F=I||o.noDeleteOnFetchRejection,W=w;if(E(this,Se)[n]===w&&(!F||W.__staleWhileFetching===void 0?ue(this,re,Gr).call(this,e,"fetch"):C||(E(this,Se)[n]=W.__staleWhileFetching)),I)return o.status&&W.__staleWhileFetching!==void 0&&(o.status.returnedStale=!0),W.__staleWhileFetching;if(W.__returned===W)throw M},b=(M,O)=>{var I;const C=(I=E(this,Bo))==null?void 0:I.call(this,e,l,p);C&&C instanceof Promise&&C.then(F=>M(F===void 0?void 0:F),O),c.signal.addEventListener("abort",()=>{(!o.ignoreFetchAbort||o.allowStaleOnFetchAbort)&&(M(void 0),o.allowStaleOnFetchAbort&&(M=F=>h(F,!0)))})};o.status&&(o.status.fetchDispatched=!0);const w=new Promise(b).then(h,m),S=Object.assign(w,{__abortController:c,__staleWhileFetching:l,__returned:void 0});return n===void 0?(this.set(e,S,{...p.options,status:void 0}),n=E(this,dt).get(e)):E(this,Se)[n]=S,S},et=function(e){if(!E(this,Nr))return!1;const n=e;return!!n&&n instanceof Promise&&n.hasOwnProperty("__staleWhileFetching")&&n.__abortController instanceof Js},Ud=function(e,n){E(this,Ht)[n]=e,E(this,Pt)[e]=n},ds=function(e){e!==E(this,mt)&&(e===E(this,Et)?ye(this,Et,E(this,Pt)[e]):ue(this,re,Ud).call(this,E(this,Ht)[e],E(this,Pt)[e]),ue(this,re,Ud).call(this,E(this,mt),e),ye(this,mt,e))},Gr=function(e,n){var i,l,c,d;let o=!1;if(E(this,ut)!==0){const p=E(this,dt).get(e);if(p!==void 0)if(o=!0,E(this,ut)===1)ue(this,re,Zd).call(this,n);else{E(this,Jr).call(this,p);const h=E(this,Se)[p];if(ue(this,re,et).call(this,h)?h.__abortController.abort(new Error("deleted")):(E(this,Tn)||E(this,Rt))&&(E(this,Tn)&&((i=E(this,wn))==null||i.call(this,h,e,n)),E(this,Rt)&&((l=E(this,gt))==null||l.push([h,e,n]))),E(this,dt).delete(e),E(this,Je)[p]=void 0,E(this,Se)[p]=void 0,p===E(this,mt))ye(this,mt,E(this,Ht)[p]);else if(p===E(this,Et))ye(this,Et,E(this,Pt)[p]);else{const m=E(this,Ht)[p];E(this,Pt)[m]=E(this,Pt)[p];const y=E(this,Pt)[p];E(this,Ht)[y]=E(this,Ht)[p]}Wa(this,ut)._--,E(this,kn).push(p)}}if(E(this,Rt)&&((c=E(this,gt))!=null&&c.length)){const p=E(this,gt);let h;for(;h=p==null?void 0:p.shift();)(d=E(this,bn))==null||d.call(this,...h)}return o},Zd=function(e){var n,o,i;for(const l of ue(this,re,Mr).call(this,{allowStale:!0})){const c=E(this,Se)[l];if(ue(this,re,et).call(this,c))c.__abortController.abort(new Error("deleted"));else{const d=E(this,Je)[l];E(this,Tn)&&((n=E(this,wn))==null||n.call(this,c,d,e)),E(this,Rt)&&((o=E(this,gt))==null||o.push([c,d,e]))}}if(E(this,dt).clear(),E(this,Se).fill(void 0),E(this,Je).fill(void 0),E(this,qt)&&E(this,Sn)&&(E(this,qt).fill(0),E(this,Sn).fill(0)),E(this,En)&&E(this,En).fill(0),ye(this,Et,0),ye(this,mt,0),E(this,kn).length=0,ye(this,xn,0),ye(this,ut,0),E(this,Rt)&&E(this,gt)){const l=E(this,gt);let c;for(;c=l==null?void 0:l.shift();)(i=E(this,bn))==null||i.call(this,...c)}};let gc=_c;const JB={cacheSize:15e6};class QB{constructor(e){We(this,"_str");We(this,"_rawJson");We(this,"_zodSchema");We(this,"_validatedJson");this.bytes=e}get str(){return this._str===void 0&&(this._str=new TextDecoder().decode(this.bytes)),this._str}get rawJson(){return this._rawJson===void 0&&(this._rawJson=JSON.parse(this.str)),this._rawJson}validatedJson(e){return this._zodSchema!==e&&(this._validatedJson=e.parse(this.rawJson),this._zodSchema=e),this._validatedJson}}const Qr=class Qr{constructor(e){We(this,"fileDataCache");We(this,"fileDataRefs",new Map);const n={...JB,...e??{}};this.fileDataCache=new gc({maxSize:n.cacheSize,fetchMethod:async o=>new QB(await gu().blobDriver.getContent(o)),sizeCalculation:o=>o.bytes.length,dispose:(o,i)=>{this.fileDataRefs.delete(i)}})}getDataRef(e){const n=this.fileDataRefs.get(e);if(n!==void 0)return n;const o=r.shallowRef();return this.fileDataRefs.set(e,o),(async()=>{try{const i=await this.fileDataCache.fetch(e);o.value=i}catch(i){console.error(i)}})(),o}getContentBytes(e){if(e===void 0)return;const n=this.getDataRef(e);return r.computed(()=>{var o;return(o=n.value)==null?void 0:o.bytes})}getContentString(e){if(e===void 0)return;const n=this.getDataRef(e);return r.computed(()=>{var o;return(o=n==null?void 0:n.value)==null?void 0:o.str})}getContentJson(e,n){if(e===void 0)return;const o=this.getDataRef(e);return r.computed(()=>{var i,l;return n===void 0?(i=o==null?void 0:o.value)==null?void 0:i.rawJson:(l=o==null?void 0:o.value)==null?void 0:l.validatedJson(n)})}static getContentBytes(e){return Qr.globalInstance.getContentBytes(e)}static getContentString(e){return Qr.globalInstance.getContentString(e)}static getContentJson(e,n){return Qr.globalInstance.getContentJson(e,n)}};We(Qr,"globalInstance",new Qr);let yc=Qr;L.AgGridTheme=Gu,L.BlockLayout=KN,L.ContextProvider=DS,L.DataTable=f0,L.DemoData=DN,L.DropdownListItem=_o,L.DropdownOverlay=Gl,L.LongText=Ol,L.MultiError=Ya,L.PlAccordion=Pk,L.PlAccordionSection=$k,L.PlAgCellFile=xV,L.PlAgDataTable=_V,L.PlAgDataTableToolsPanel=mV,L.PlAgGridColumnManager=oh,L.PlAgOverlayLoading=Xp,L.PlAgOverlayNoRows=Jp,L.PlAgTextAndButtonCell=SV,L.PlAlert=W0,L.PlBlockPage=B0,L.PlBtnAccent=cw,L.PlBtnDanger=uw,L.PlBtnGhost=vo,L.PlBtnGroup=up,L.PlBtnLink=mw,L.PlBtnPrimary=Ss,L.PlBtnSecondary=Pl,L.PlBtnSplit=ow,L.PlCheckbox=zx,L.PlCheckboxGroup=jx,L.PlChip=$l,L.PlCloseModalBtn=bp,L.PlContainer=R0,L.PlDialogModal=Ul,L.PlDropdown=Co,L.PlDropdownLegacy=hx,L.PlDropdownLine=wp,L.PlDropdownMulti=Gx,L.PlDropdownRef=zb,L.PlEditableTitle=Mw,L.PlFileDialog=Vp,L.PlFileInput=Wp,L.PlGrid=M0,L.PlIcon16=Wr,L.PlIcon24=Ns,L.PlLogView=kp,L.PlMaskIcon16=nn,L.PlMaskIcon24=Vt,L.PlNotificationAlert=jp,L.PlNumberField=Ex,L.PlProgressBar=_x,L.PlRow=I0,L.PlSearchField=yp,L.PlSectionSeparator=Ep,L.PlSlideModal=As,L.PlSpacer=cp,L.PlTableFilters=HB,L.PlTabs=Sk,L.PlTextArea=Sb,L.PlTextField=jr,L.PlToggleSwitch=Bs,L.PlTooltip=vt,L.ReactiveFileContent=yc,L.Scrollable=x1,L.Slider=Hp,L.SliderRange=v1,L.SliderRangeTriple=a1,L.ThemeSwitcher=k0,L.UnresolvedError=Ka,L.ValueOrErrorsComponent=wV,L.activateAgGrid=Mu,L.animate=rp,L.animateInfinite=v0,L.call=Ju,L.computedResult=YB,L.createModel=nl,L.debounce=op,L.defineApp=Uv,L.defineStore=KB,L.delay=Qu,L.detectOutside=Tb,L.ensureError=Qa,L.eventListener=Ml,L.formatZodError=tl,L.getElementScrollPosition=Cp,L.identity=Ja,L.isDefined=$g,L.isElementVisible=vp,L.isJsonEqual=Xa,L.isZodError=el,L.listToOptions=C0,L.makeEaseInOut=_0,L.makeEaseOut=np,L.maskIcons16=PN,L.maskIcons24=RN,L.normalizeListOptions=_r,L.notEmpty=Tl,L.randomInt=tp,L.randomString=y0,L.requestTick=Nl,L.scrollIntoView=Vs,L.showContextMenu=kl,L.throttle=ip,L.timeout=ep,L.unwrapOptionalResult=Gg,L.unwrapValueOrErrors=Qd,L.useClickOutside=Ts,L.useDraggable=YS,L.useEventListener=st,L.useFormState=qS,L.useHover=Yu,L.useInterval=HS,L.useLabelNotch=Yn,L.useLocalStorage=sp,L.useMouse=Ku,L.useMouseCapture=yr,L.usePosition=_i,L.useQuery=KS,L.useResizeObserver=qp,L.useScroll=WS,L.useSdkPlugin=vl,L.useSortable=Yp,L.useTheme=lp,L.useWatchFetch=Lh,L.wrapOptionalResult=eu,L.wrapValueOrErrors=Mg,Object.defineProperty(L,Symbol.toStringTag,{value:"Module"})});
91
+ }`;var De=xg(function(){return Ze(C,he+"return "+Q).apply(n,N)});if(De.source=Q,Ad(De))throw De;return De}function eM(s){return je(s).toLowerCase()}function tM(s){return je(s).toUpperCase()}function nM(s,a,u){if(s=je(s),s&&(u||a===n))return Pf(s);if(!s||!(a=Qt(a)))return s;var f=An(s),g=An(a),C=Rf(f,g),N=Df(f,g)+1;return Fr(f,C,N).join("")}function rM(s,a,u){if(s=je(s),s&&(u||a===n))return s.slice(0,Ff(s)+1);if(!s||!(a=Qt(a)))return s;var f=An(s),g=Df(f,An(a))+1;return Fr(f,0,g).join("")}function oM(s,a,u){if(s=je(s),s&&(u||a===n))return s.replace(Ac,"");if(!s||!(a=Qt(a)))return s;var f=An(s),g=Rf(f,An(a));return Fr(f,g).join("")}function iM(s,a){var u=$,f=j;if(ot(a)){var g="separator"in a?a.separator:g;u="length"in a?Be(a.length):u,f="omission"in a?Qt(a.omission):f}s=je(s);var C=s.length;if(Oo(s)){var N=An(s);C=N.length}if(u>=C)return s;var A=u-Mo(f);if(A<1)return f;var D=N?Fr(N,0,A).join(""):s.slice(0,A);if(g===n)return D+f;if(N&&(A+=D.length-A),Bd(g)){if(s.slice(A).search(g)){var Y,X=D;for(g.global||(g=Hc(g.source,je(Qh.exec(g))+"g")),g.lastIndex=0;Y=g.exec(X);)var Q=Y.index;D=D.slice(0,Q===n?A:Q)}}else if(s.indexOf(Qt(g),A)!=A){var oe=D.lastIndexOf(g);oe>-1&&(D=D.slice(0,oe))}return D+f}function sM(s){return s=je(s),s&&yP.test(s)?s.replace(Yh,IR):s}var aM=jo(function(s,a,u){return s+(u?" ":"")+a.toUpperCase()}),Dd=km("toUpperCase");function bg(s,a,u){return s=je(s),a=u?n:a,a===n?AR(s)?OR(s):wR(s):s.match(a)||[]}var xg=Ie(function(s,a){try{return Xt(s,n,a)}catch(u){return Ad(u)?u:new Te(u)}}),lM=or(function(s,a){return on(a,function(u){u=jn(u),nr(s,u,Nd(s[u],s))}),s});function cM(s){var a=s==null?0:s.length,u=ge();return s=a?tt(s,function(f){if(typeof f[1]!="function")throw new sn(c);return[u(f[0]),f[1]]}):[],Ie(function(f){for(var g=-1;++g<a;){var C=s[g];if(Xt(C[0],this,f))return Xt(C[1],this,f)}})}function dM(s){return ID(ln(s,y))}function Id(s){return function(){return s}}function uM(s,a){return s==null||s!==s?a:s}var pM=Sm(),hM=Sm(!0);function Zt(s){return s}function Fd(s){return nm(typeof s=="function"?s:ln(s,y))}function fM(s){return om(ln(s,y))}function mM(s,a){return im(s,ln(a,y))}var gM=Ie(function(s,a){return function(u){return os(u,s,a)}}),yM=Ie(function(s,a){return function(u){return os(s,u,a)}});function Ld(s,a,u){var f=yt(a),g=Sa(a,f);u==null&&!(ot(a)&&(g.length||!f.length))&&(u=a,a=s,s=this,g=Sa(a,yt(a)));var C=!(ot(u)&&"chain"in u)||!!u.chain,N=sr(s);return on(g,function(A){var D=a[A];s[A]=D,N&&(s.prototype[A]=function(){var Y=this.__chain__;if(C||Y){var X=s(this.__wrapped__),Q=X.__actions__=$t(this.__actions__);return Q.push({func:D,args:arguments,thisArg:s}),X.__chain__=Y,X}return D.apply(s,Ar([this.value()],arguments))})}),s}function _M(){return vt._===this&&(vt._=ZR),this}function Od(){}function CM(s){return s=Be(s),Ie(function(a){return sm(a,s)})}var vM=md(tt),wM=md(Tf),bM=md(Gc);function kg(s){return bd(s)?$c(jn(s)):JD(s)}function xM(s){return function(a){return s==null?n:so(s,a)}}var kM=Nm(),EM=Nm(!0);function Md(){return[]}function Gd(){return!1}function SM(){return{}}function TM(){return""}function NM(){return!0}function VM(s,a){if(s=Be(s),s<1||s>K)return[];var u=ke,f=St(s,ke);a=ge(a),s-=ke;for(var g=Zc(f,a);++u<s;)a(u);return g}function AM(s){return Ne(s)?tt(s,jn):en(s)?[s]:$t(Zm(je(s)))}function BM(s){var a=++zR;return je(s)+a}var PM=Pa(function(s,a){return s+a},0),RM=gd("ceil"),DM=Pa(function(s,a){return s/a},1),IM=gd("floor");function FM(s){return s&&s.length?Ea(s,Zt,td):n}function LM(s,a){return s&&s.length?Ea(s,ge(a,2),td):n}function OM(s){return Af(s,Zt)}function MM(s,a){return Af(s,ge(a,2))}function GM(s){return s&&s.length?Ea(s,Zt,id):n}function $M(s,a){return s&&s.length?Ea(s,ge(a,2),id):n}var zM=Pa(function(s,a){return s*a},1),UM=gd("round"),ZM=Pa(function(s,a){return s-a},0);function WM(s){return s&&s.length?Uc(s,Zt):0}function jM(s,a){return s&&s.length?Uc(s,ge(a,2)):0}return _.after=fL,_.ary=tg,_.assign=tO,_.assignIn=mg,_.assignInWith=Wa,_.assignWith=nO,_.at=rO,_.before=ng,_.bind=Nd,_.bindAll=lM,_.bindKey=rg,_.castArray=SL,_.chain=Jm,_.chunk=II,_.compact=FI,_.concat=LI,_.cond=cM,_.conforms=dM,_.constant=Id,_.countBy=WF,_.create=oO,_.curry=og,_.curryRight=ig,_.debounce=sg,_.defaults=iO,_.defaultsDeep=sO,_.defer=mL,_.delay=gL,_.difference=OI,_.differenceBy=MI,_.differenceWith=GI,_.drop=$I,_.dropRight=zI,_.dropRightWhile=UI,_.dropWhile=ZI,_.fill=WI,_.filter=HF,_.flatMap=YF,_.flatMapDeep=XF,_.flatMapDepth=JF,_.flatten=qm,_.flattenDeep=jI,_.flattenDepth=HI,_.flip=yL,_.flow=pM,_.flowRight=hM,_.fromPairs=qI,_.functions=hO,_.functionsIn=fO,_.groupBy=QF,_.initial=YI,_.intersection=XI,_.intersectionBy=JI,_.intersectionWith=QI,_.invert=gO,_.invertBy=yO,_.invokeMap=tL,_.iteratee=Fd,_.keyBy=nL,_.keys=yt,_.keysIn=Ut,_.map=Ma,_.mapKeys=CO,_.mapValues=vO,_.matches=fM,_.matchesProperty=mM,_.memoize=$a,_.merge=wO,_.mergeWith=gg,_.method=gM,_.methodOf=yM,_.mixin=Ld,_.negate=za,_.nthArg=CM,_.omit=bO,_.omitBy=xO,_.once=_L,_.orderBy=rL,_.over=vM,_.overArgs=CL,_.overEvery=wM,_.overSome=bM,_.partial=Vd,_.partialRight=ag,_.partition=oL,_.pick=kO,_.pickBy=yg,_.property=kg,_.propertyOf=xM,_.pull=rF,_.pullAll=Ym,_.pullAllBy=oF,_.pullAllWith=iF,_.pullAt=sF,_.range=kM,_.rangeRight=EM,_.rearg=vL,_.reject=aL,_.remove=aF,_.rest=wL,_.reverse=Sd,_.sampleSize=cL,_.set=SO,_.setWith=TO,_.shuffle=dL,_.slice=lF,_.sortBy=hL,_.sortedUniq=mF,_.sortedUniqBy=gF,_.split=YO,_.spread=bL,_.tail=yF,_.take=_F,_.takeRight=CF,_.takeRightWhile=vF,_.takeWhile=wF,_.tap=FF,_.throttle=xL,_.thru=Oa,_.toArray=pg,_.toPairs=_g,_.toPairsIn=Cg,_.toPath=AM,_.toPlainObject=fg,_.transform=NO,_.unary=kL,_.union=bF,_.unionBy=xF,_.unionWith=kF,_.uniq=EF,_.uniqBy=SF,_.uniqWith=TF,_.unset=VO,_.unzip=Td,_.unzipWith=Xm,_.update=AO,_.updateWith=BO,_.values=Ko,_.valuesIn=PO,_.without=NF,_.words=bg,_.wrap=EL,_.xor=VF,_.xorBy=AF,_.xorWith=BF,_.zip=PF,_.zipObject=RF,_.zipObjectDeep=DF,_.zipWith=IF,_.entries=_g,_.entriesIn=Cg,_.extend=mg,_.extendWith=Wa,Ld(_,_),_.add=PM,_.attempt=xg,_.camelCase=FO,_.capitalize=vg,_.ceil=RM,_.clamp=RO,_.clone=TL,_.cloneDeep=VL,_.cloneDeepWith=AL,_.cloneWith=NL,_.conformsTo=BL,_.deburr=wg,_.defaultTo=uM,_.divide=DM,_.endsWith=LO,_.eq=Pn,_.escape=OO,_.escapeRegExp=MO,_.every=jF,_.find=qF,_.findIndex=jm,_.findKey=aO,_.findLast=KF,_.findLastIndex=Hm,_.findLastKey=lO,_.floor=IM,_.forEach=Qm,_.forEachRight=eg,_.forIn=cO,_.forInRight=dO,_.forOwn=uO,_.forOwnRight=pO,_.get=Pd,_.gt=PL,_.gte=RL,_.has=mO,_.hasIn=Rd,_.head=Km,_.identity=Zt,_.includes=eL,_.indexOf=KI,_.inRange=DO,_.invoke=_O,_.isArguments=co,_.isArray=Ne,_.isArrayBuffer=DL,_.isArrayLike=zt,_.isArrayLikeObject=at,_.isBoolean=IL,_.isBuffer=Lr,_.isDate=FL,_.isElement=LL,_.isEmpty=OL,_.isEqual=ML,_.isEqualWith=GL,_.isError=Ad,_.isFinite=$L,_.isFunction=sr,_.isInteger=lg,_.isLength=Ua,_.isMap=cg,_.isMatch=zL,_.isMatchWith=UL,_.isNaN=ZL,_.isNative=WL,_.isNil=HL,_.isNull=jL,_.isNumber=dg,_.isObject=ot,_.isObjectLike=it,_.isPlainObject=ds,_.isRegExp=Bd,_.isSafeInteger=qL,_.isSet=ug,_.isString=Za,_.isSymbol=en,_.isTypedArray=qo,_.isUndefined=KL,_.isWeakMap=YL,_.isWeakSet=XL,_.join=eF,_.kebabCase=GO,_.last=dn,_.lastIndexOf=tF,_.lowerCase=$O,_.lowerFirst=zO,_.lt=JL,_.lte=QL,_.max=FM,_.maxBy=LM,_.mean=OM,_.meanBy=MM,_.min=GM,_.minBy=$M,_.stubArray=Md,_.stubFalse=Gd,_.stubObject=SM,_.stubString=TM,_.stubTrue=NM,_.multiply=zM,_.nth=nF,_.noConflict=_M,_.noop=Od,_.now=Ga,_.pad=UO,_.padEnd=ZO,_.padStart=WO,_.parseInt=jO,_.random=IO,_.reduce=iL,_.reduceRight=sL,_.repeat=HO,_.replace=qO,_.result=EO,_.round=UM,_.runInContext=R,_.sample=lL,_.size=uL,_.snakeCase=KO,_.some=pL,_.sortedIndex=cF,_.sortedIndexBy=dF,_.sortedIndexOf=uF,_.sortedLastIndex=pF,_.sortedLastIndexBy=hF,_.sortedLastIndexOf=fF,_.startCase=XO,_.startsWith=JO,_.subtract=ZM,_.sum=WM,_.sumBy=jM,_.template=QO,_.times=VM,_.toFinite=ar,_.toInteger=Be,_.toLength=hg,_.toLower=eM,_.toNumber=un,_.toSafeInteger=eO,_.toString=je,_.toUpper=tM,_.trim=nM,_.trimEnd=rM,_.trimStart=oM,_.truncate=iM,_.unescape=sM,_.uniqueId=BM,_.upperCase=aM,_.upperFirst=Dd,_.each=Qm,_.eachRight=eg,_.first=Km,Ld(_,function(){var s={};return Zn(_,function(a,u){qe.call(_.prototype,u)||(s[u]=a)}),s}(),{chain:!1}),_.VERSION=o,on(["bind","bindKey","curry","curryRight","partial","partialRight"],function(s){_[s].placeholder=_}),on(["drop","take"],function(s,a){Le.prototype[s]=function(u){u=u===n?1:ht(Be(u),0);var f=this.__filtered__&&!a?new Le(this):this.clone();return f.__filtered__?f.__takeCount__=St(u,f.__takeCount__):f.__views__.push({size:St(u,ke),type:s+(f.__dir__<0?"Right":"")}),f},Le.prototype[s+"Right"]=function(u){return this.reverse()[s](u).reverse()}}),on(["filter","map","takeWhile"],function(s,a){var u=a+1,f=u==x||u==G;Le.prototype[s]=function(g){var C=this.clone();return C.__iteratees__.push({iteratee:ge(g,3),type:u}),C.__filtered__=C.__filtered__||f,C}}),on(["head","last"],function(s,a){var u="take"+(a?"Right":"");Le.prototype[s]=function(){return this[u](1).value()[0]}}),on(["initial","tail"],function(s,a){var u="drop"+(a?"":"Right");Le.prototype[s]=function(){return this.__filtered__?new Le(this):this[u](1)}}),Le.prototype.compact=function(){return this.filter(Zt)},Le.prototype.find=function(s){return this.filter(s).head()},Le.prototype.findLast=function(s){return this.reverse().find(s)},Le.prototype.invokeMap=Ie(function(s,a){return typeof s=="function"?new Le(this):this.map(function(u){return os(u,s,a)})}),Le.prototype.reject=function(s){return this.filter(za(ge(s)))},Le.prototype.slice=function(s,a){s=Be(s);var u=this;return u.__filtered__&&(s>0||a<0)?new Le(u):(s<0?u=u.takeRight(-s):s&&(u=u.drop(s)),a!==n&&(a=Be(a),u=a<0?u.dropRight(-a):u.take(a-s)),u)},Le.prototype.takeRightWhile=function(s){return this.reverse().takeWhile(s).reverse()},Le.prototype.toArray=function(){return this.take(ke)},Zn(Le.prototype,function(s,a){var u=/^(?:filter|find|map|reject)|While$/.test(a),f=/^(?:head|last)$/.test(a),g=_[f?"take"+(a=="last"?"Right":""):a],C=f||/^find/.test(a);g&&(_.prototype[a]=function(){var N=this.__wrapped__,A=f?[1]:arguments,D=N instanceof Le,Y=A[0],X=D||Ne(N),Q=function(Fe){var Oe=g.apply(_,Ar([Fe],A));return f&&oe?Oe[0]:Oe};X&&u&&typeof Y=="function"&&Y.length!=1&&(D=X=!1);var oe=this.__chain__,he=!!this.__actions__.length,_e=C&&!oe,De=D&&!he;if(!C&&X){N=De?N:new Le(this);var Ce=s.apply(N,A);return Ce.__actions__.push({func:Oa,args:[Q],thisArg:n}),new an(Ce,oe)}return _e&&De?s.apply(this,A):(Ce=this.thru(Q),_e?f?Ce.value()[0]:Ce.value():Ce)})}),on(["pop","push","shift","sort","splice","unshift"],function(s){var a=da[s],u=/^(?:push|sort|unshift)$/.test(s)?"tap":"thru",f=/^(?:pop|shift)$/.test(s);_.prototype[s]=function(){var g=arguments;if(f&&!this.__chain__){var C=this.value();return a.apply(Ne(C)?C:[],g)}return this[u](function(N){return a.apply(Ne(N)?N:[],g)})}}),Zn(Le.prototype,function(s,a){var u=_[a];if(u){var f=u.name+"";qe.call(Uo,f)||(Uo[f]=[]),Uo[f].push({name:a,func:u})}}),Uo[Ba(n,v).name]=[{name:"wrapper",func:n}],Le.prototype.clone=sD,Le.prototype.reverse=aD,Le.prototype.value=lD,_.prototype.at=LF,_.prototype.chain=OF,_.prototype.commit=MF,_.prototype.next=GF,_.prototype.plant=zF,_.prototype.reverse=UF,_.prototype.toJSON=_.prototype.valueOf=_.prototype.value=ZF,_.prototype.first=_.prototype.head,Xi&&(_.prototype[Xi]=$F),_},Go=MR();to?((to.exports=Go)._=Go,Fc._=Go):vt._=Go}).call(Yo)}(zs,zs.exports);var ze=zs.exports;const QN={class:"grid-overlay-container"},Jp=r.defineComponent({__name:"PlAgOverlayLoading",props:{params:{}},setup(t){return(e,n)=>(r.openBlock(),r.createElementBlock("div",QN,[e.params.notReady?(r.openBlock(),r.createElementBlock(r.Fragment,{key:0},[n[0]||(n[0]=r.createElementVNode("div",{class:"grid-icon-cat-in-bag"},null,-1)),n[1]||(n[1]=r.createElementVNode("span",{class:"text-subtitle-m"},"Not calculated",-1))],64)):(r.openBlock(),r.createElementBlock(r.Fragment,{key:1},[n[2]||(n[2]=r.createElementVNode("div",{class:"mask-24 mask-loading grid-mask-loading"},null,-1)),n[3]||(n[3]=r.createElementVNode("span",{class:"text-subtitle-m"},"Loading",-1))],64))]))}}),eV={},tV={class:"grid-overlay-container"};function nV(t,e){return r.openBlock(),r.createElementBlock("div",tV,e[0]||(e[0]=[r.createElementVNode("div",{class:"grid-icon-sad-cat"},null,-1),r.createElementVNode("span",{class:"text-subtitle-m"},"Empty",-1)]))}const Qp=Jl(eV,[["render",nV]]);async function rV(t,e){throw Error("not implemented")}function oV(t){return t.axesSpec.filter(e=>{var n;return((n=e.annotations)==null?void 0:n["pl7.app/axisNature"])==="heterogeneous"})}function iV(t,e){const n=[];for(const o of e)if(t[o].type==="column"){const i=oV(t[o].spec);for(const l of i){if(l.type!=="String"){console.warn("heterogeneous axis with string type expected, got",l,"skipping");continue}const c=dl(l),d=t.findIndex(p=>ze.isEqual(p.id,c));if(d===-1)throw console.error("axis not found",o,c,t),Error("axis not found");n.push({columnIdx:o,axisIdx:d})}}return n}const eh=(t,e)=>(t+e).toString();function sV(t,e,n,o,i,l){if(t.length>1)throw Error("hColumns.length > 1 is not supported");const c=t[0];let d=-1,p=-1;for(let y=0;y<l.length;++y)l[y]===c.axisIdx&&(d=y),l[y]===c.columnIdx&&(p=y);const h=(()=>{const b=o[d].data.filter(w=>w!==null);return Array.from(new Set(b))})();h.sort(),p>d?(n.splice(p,1),n.splice(d,1)):(n.splice(d,1),n.splice(p,1));const m=aV(i,o,d,p,h,e.rows);for(let y=0;y<h.length;++y){const b=h[y],w=$r(b+"@"+y);n.push({colId:w,field:eh(o.length,y),headerName:b,valueFormatter:oh})}return{rowModelType:"clientSide",columnDefs:n,rowData:m}}function aV(t,e,n,o,i,l){const c=new Map;let d=0;for(let h=0;h<l;h++){const m={};for(let M=0;M<e.length;++M){if(M===n||M===o)continue;const O=t[M].toString();m[O]=e[M].data[h]}let y;const b=$r(Object.values(m))??"";c.has(b)?y=c.get(b):(c.set(b,m),y=m,y.id=d.toString(),d++);const w=i.indexOf(e[n].data[h]);if(w===-1)throw Error("index not found");const S=eh(e.length,w);y[S]=e[o].data[h]}return Array.from(c.values())}const Yr='"##RowNumberColumnId##"';function lV(){return{colId:Yr,headerName:"#",valueGetter:t=>t.node===null||t.node.rowIndex===null?null:t.node.rowIndex+1,suppressNavigable:!0,lockPosition:"left",suppressMovable:!0,mainMenuItems:[],contextMenuItems:[],pinned:"left",lockPinned:!0,minWidth:45,suppressSizeToFit:!0,suppressAutoSize:!0,cellStyle:{color:"var(--txt-03)","background-color":"var(--bg-base-light)",overflow:"visible !important","text-align":"center"},sortable:!1,resizable:!1}}function cV(){const t=document.createElement("div");return t.style.visibility="hidden",t.style.position="absolute",t.style.boxSizing="border-box",t.style.padding="15.5px",t.style.border="1px solid",t.style.width="auto",document.body.appendChild(t),t}function th(t,e){const n=t.getCellValue({rowNode:t.getDisplayedRowAtIndex(t.getLastDisplayedRowIndex()),colKey:Yr});if(typeof n!="number")return;const o=n.toString().length;if(e.innerHTML.length===o)return;const i="5";e.innerHTML=i.repeat(o),r.nextTick(()=>{t.setColumnWidths([{key:Yr,newWidth:e.offsetWidth}])})}function dV(t){document.body.removeChild(t)}function uV(t){const e=cV();t.addEventListener("viewportChanged",()=>{th(t,e)}),t.addEventListener("columnVisible",n=>{n.columns&&n.columns.some(o=>o.isVisible()&&o.getColId()===Yr)&&th(t,e)}),t.addEventListener("gridPreDestroyed",()=>{dV(e)})}const pV={class:"pl-ag-column-header__title d-flex align-center gap-6 flex-grow-1"},nh=r.defineComponent({__name:"PlAgColumnHeader",props:{params:{}},setup(t){const e=t,n=r.computed(()=>{var m,y;const h=(y=(m=e.params.column.getUserProvidedColDef())==null?void 0:m.headerComponentParams)==null?void 0:y.type;switch(h){case void 0:case"Text":return"cell-type-txt";case"Number":return"cell-type-num";case"File":return"paper-clip";case"Date":return"calendar";case"Duration":return"time";default:throw Error(`unsupported data type: ${h} for PlAgColumnHeader component. Column ${e.params.column.getColId()}`)}}),o=r.ref(null),i=()=>o.value=e.params.column.getSort()??null;r.onMounted(()=>i());function l(){e.params.column.isSortable()&&(e.params.progressSort(),i())}const c=r.computed(()=>{const h=o.value;switch(h){case"asc":return"arrow-up";case"desc":return"arrow-down";case null:return null;default:throw Error(`unsupported sort direction: ${h}. Column ${e.params.column.getColId()}`)}}),d=r.ref();function p(){const h=d.value;h&&e.params.showColumnMenu(h)}return(h,m)=>(r.openBlock(),r.createElementBlock("div",{class:"pl-ag-column-header d-flex align-center gap-6",onClick:l},[r.createElementVNode("div",pV,[r.createVNode(r.unref(Vt),{name:n.value,class:"pl-ag-column-header__type-icon"},null,8,["name"]),r.createElementVNode("span",null,r.toDisplayString(h.params.displayName),1),c.value?(r.openBlock(),r.createBlock(r.unref(Vt),{key:0,name:c.value},null,8,["name"])):r.createCommentVNode("",!0)]),h.params.enableMenu?(r.openBlock(),r.createElementBlock("div",{key:0,ref_key:"menuActivatorBtn",ref:d,class:"pl-ag-column-header__menu-icon",onClick:r.withModifiers(p,["stop"])},[r.createVNode(r.unref(Vt),{name:"more"})],512)):r.createCommentVNode("",!0)]))}});function hV(t){return $r(t)}function rh(t){return JSON.parse(t)}const oh=t=>t?t.value===void 0?"NULL":t.value===null?"NA":t.value.toString():"ERROR";function fV(t,e,n){var l,c,d;const o=hV(e),i=e.type==="axis"?e.spec.type:e.spec.valueType;return{colId:o,field:t.toString(),headerName:((c=(l=e.spec.annotations)==null?void 0:l["pl7.app/label"])==null?void 0:c.trim())??"Unlabeled "+e.type+" "+t.toString(),lockPosition:e.type==="axis",hide:(n==null?void 0:n.includes(o))??((d=e.spec.annotations)==null?void 0:d["pl7.app/table/visibility"])==="optional",valueFormatter:oh,headerComponent:nh,headerComponentParams:{type:(()=>{switch(i){case"Int":case"Long":case"Float":case"Double":return"Number";case"String":case"Bytes":return"Text";default:throw Error(`unsupported data type: ${i}`)}})()},cellDataType:(()=>{switch(i){case"Int":case"Long":case"Float":case"Double":return"number";case"String":case"Bytes":return"text";default:throw Error(`unsupported data type: ${i}`)}})()}}function ih(t,e){switch(e){case"Int":return t;case"Long":return typeof t=="bigint"?Number(t):t;case"Float":return t;case"Double":return t;case"String":return t;case"Bytes":return Buffer.from(t).toString("hex");default:throw Error(`unsupported data type: ${e}`)}}function sh(t){const e=[];return ws(t,n=>(e.push(n),n)),e}async function mV(t,e,n){return n.length?(await t.findColumns(e,{columnFilter:{name:["pl7.app/label"]},compatibleWith:ze.uniqWith(n.map(i=>gu(i.spec.axesSpec).map(ze.cloneDeep)).flat(),ze.isEqual),strictlyCompatible:!0})).hits.filter(i=>i.spec.axesSpec.length===1):[]}async function gV(t,e,n){const o=sh(n),l=(await mV(t,e,o)).filter(c=>!ze.find(o,d=>c.columnId===d.columnId));return l.length===0?n:{type:"outer",primary:n,secondary:l.map(c=>({type:"column",column:c}))}}async function yV(t,e,n,o){const i=n.filter(m=>m.type!=="Bytes"),l=sh(o),c=i.map(m=>[]),d=i.map(m=>null);for(let m=0;m<l.length;++m){const y=gu(l[m].spec.axesSpec);for(let b=0;b<y.length;++b){const w=ze.findIndex(i,S=>ze.isEqual(S,y[b]));w===-1||d[w]||(y.length===1&&l[m].spec.name==="pl7.app/label"?(c[w]=[[m,b]],d[w]=l[m].columnId):c[w].push([m,b]))}}for(let m=i.length-1;m>=0;--m)c[m].length||(d.splice(m,1),c.splice(m,1),i.splice(m,1));const p=100,h=i.map(m=>new Set);e:for(let m=i.length-1;m>=0;--m){for(const[y,b]of c[m]){const w=await t.getUniqueValues(e,{columnId:l[y].columnId,...!d[m]&&{axis:ze.cloneDeep(i[m])},filters:[],limit:p});if(w.overflow){d.splice(m,1),c.splice(m,1),i.splice(m,1);continue e}const S=w.values.type;for(const M of w.values.data)if(!(mu(M,S)||M===null)&&(h[m].add(ih(M,S)),h[m].size===p)){d.splice(m,1),c.splice(m,1),i.splice(m,1);continue e}}if(!h[m].size){d.splice(m,1),c.splice(m,1),i.splice(m,1);continue e}}return i.map((m,y)=>{const b=[...h[y]].map(S=>({value:S,label:S.toString()})),w=b[0].value;return{axis:ze.cloneDeep(m),...d[y]&&{column:d[y]},options:b,defaultValue:w}})}function _V(t,e,n,o){const i=t.length,l=[];for(let c=0;c<e[0].data.length;++c){const d=[],p=(o++).toString();for(const m of n)d.push(e[m].data[c]);const h={key:d,id:p};for(let m=0;m<i;++m){const y=t[m].toString(),b=e[m].data[c],w=e[m].type;Xy(e[m].absent,c)?h[y]=void 0:mu(b,w)||b===null?h[y]=null:h[y]=ih(b,w)}l.push(h)}return l}const CV=t=>t.type==="column"&&t.spec.axesSpec.length===1&&t.spec.name==="pl7.app/label";async function vV(t,e,n,o){const i=await t.getSpec(e);let l=i.findIndex(v=>v.type==="column");l===-1&&(l=i.length);const c=[...i.keys()].filter(v=>!ze.find(n,I=>ze.isEqual(I.axis,i[v].id)||ze.isEqual(I.column,i[v].id))).sort((v,I)=>{var P,V;if(i[v].type!==i[I].type)return i[v].type==="axis"?-1:1;const F=(P=i[v].spec.annotations)==null?void 0:P["pl7.app/table/orderPriority"],W=(V=i[I].spec.annotations)==null?void 0:V["pl7.app/table/orderPriority"];return F===void 0?W===void 0?0:1:W===void 0?-1:Number(W)-Number(F)}),d=ze.cloneDeep(c),p=iV(i,c);for(let v=c.length-1;v>=0;--v){const I=c[v];if(!CV(i[I]))continue;const F=dl(i[I].spec.axesSpec[0]),W=ze.findIndex(c,P=>ze.isEqual(i[P].id,F));if(W===-1&&ze.findIndex(n,V=>ze.isEqual(V.axis,F))===-1){console.warn(`added label column, but the axis is not in the data; axisId: ${F}`);continue}c[W]=I;for(const P of p)P.axisIdx===I&&(P.axisIdx=W);c.splice(v,1),d.splice(v,1)}const h=await t.getShape(e),m=h.rows,y=[lV(),...d.map(v=>fV(v,i[v],o))];if(p.length>1&&console.warn("Currently, only one heterogeneous axis is supported in the table, got",p.length," transposition will not be applied."),p.length===1)return sV(p,h,y,await t.getData(e,c),d,c);const b=[...c],w=new Map;for(let v=0;v<l;++v)w.set(v,-1);for(let v=0;v<b.length;++v){const I=b[v];w.has(I)&&w.set(I,v)}for(const[v,I]of w)I===-1&&(w.set(v,b.length),b.push(v));const S=[];for(let v=0;v<l;++v){const I=w.get(v);if(I===void 0||I===-1)throw new Error("assertion exception");S.push(I)}let M;return{rowModelType:"serverSide",columnDefs:y,serverSideDatasource:{getRows:async v=>{try{if(m==0){v.success({rowData:[],rowCount:m}),v.api.setGridOption("loading",!1),v.api.showNoRowsOverlay();return}if(M&&!ze.isEqual(M.request.sortModel,v.request.sortModel)){M=void 0,v.api.setGridOption("loading",!0),v.success({rowData:[],rowCount:0});return}M=v;let I=0,F=[];if(m>0&&v.request.startRow!==void 0&&v.request.endRow!==void 0&&(I=Math.min(m,v.request.endRow)-v.request.startRow,I>0)){const W=await t.getData(e,b,{offset:v.request.startRow,length:I});F=_V(d,W,S,v.request.startRow)}v.success({rowData:F,rowCount:m}),v.api.setGridOption("loading",!1)}catch(I){v.api.setGridOption("loading",!0),v.fail(),console.trace(I)}}}}}const Ql=Og(),wV=["onClick"],ah=r.defineComponent({__name:"PlAgGridColumnManager",props:{api:{}},setup(t){const e=t,{api:n}=r.toRefs(e),o=r.ref([]),i=r.ref(),l=r.ref(!1),c=r.ref(0);Xp(i,{handle:".handle",onChange(h){n.value.moveColumns(p(h.map(m=>o.value[m])),0)}});function d(h){n.value.setColumnsVisible([h],!h.isVisible())}function p(h){const m=h.findIndex(y=>y.getId()===Yr);if(m!==0){const[y]=h.splice(m,1);return h.splice(0,0,y)}return h}return r.onMounted(()=>{n.value.getAllGridColumns().length>0&&n.value.moveColumns(p(n.value.getAllGridColumns()),0),n.value.addEventListener("displayedColumnsChanged",()=>{o.value=[...n.value.getAllGridColumns()??[]],c.value++}),o.value=n.value.getAllGridColumns()??[]}),(h,m)=>(r.openBlock(),r.createElementBlock("div",null,[(r.openBlock(),r.createBlock(r.Teleport,{to:`#${r.unref(Ql)}`},[r.createVNode(r.unref(vo),{onClick:m[0]||(m[0]=r.withModifiers(y=>l.value=!l.value,["stop"]))},{append:r.withCtx(()=>[r.createVNode(r.unref(At),{name:"columns"})]),default:r.withCtx(()=>[m[2]||(m[2]=r.createTextVNode(" Columns "))]),_:1})],8,["to"])),r.createVNode(r.unref(Bs),{modelValue:l.value,"onUpdate:modelValue":m[1]||(m[1]=y=>l.value=y),width:"368px","close-on-outside-click":""},{title:r.withCtx(()=>m[3]||(m[3]=[r.createTextVNode("Columns")])),default:r.withCtx(()=>[(r.openBlock(),r.createElementBlock("div",{ref_key:"listRef",ref:i,key:c.value,class:"pl-ag-columns"},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(o.value,y=>(r.openBlock(),r.createElementBlock("div",{key:y.getId(),class:"pl-ag-columns__item"},[r.createElementVNode("div",{class:r.normalizeClass([{handle:!y.getColDef().lockPosition},"pl-ag-columns__drag"])},[r.createVNode(r.unref(Vt),{name:"drag-dots"})],2),r.createElementVNode("div",{class:r.normalizeClass([{visible:y.isVisible()},"pl-ag-columns__title text-s-btn"])},r.toDisplayString(y.getColDef().headerName),3),r.createElementVNode("div",{class:"pl-ag-columns__visibility",onClick:b=>d(y)},[r.createVNode(r.unref(Ct),{"close-delay":500,position:"top"},{tooltip:r.withCtx(()=>m[4]||(m[4]=[r.createTextVNode("Show/Hide")])),default:r.withCtx(()=>[r.createVNode(r.unref(At),{name:y.isVisible()?"view-show":"view-hide"},null,8,["name"])]),_:2},1024)],8,wV)]))),128))]))]),_:1},8,["modelValue"])]))}}),bV=["id"],xV=r.defineComponent({__name:"PlAgDataTableToolsPanel",setup(t){return(e,n)=>(r.openBlock(),r.createElementBlock("div",{id:r.unref(Ql),class:"d-flex gap-6"},[r.renderSlot(e.$slots,"default")],8,bV))}}),kV={class:"ap-ag-data-table-container"},EV={key:1,class:"ap-ag-data-table-sheets"},SV=Jl(r.defineComponent({__name:"PlAgDataTable",props:r.mergeModels({settings:{},showColumnsPanel:{type:Boolean}},{modelValue:{default:{gridState:{}}},modelModifiers:{}}),emits:r.mergeModels(["onRowDoubleClicked","columnsChanged"],["update:modelValue"]),setup(t,{expose:e,emit:n}){T.ModuleRegistry.registerModules([ps.ClientSideRowModelModule,Hd.ClipboardModule,jd.ServerSideRowModelModule,qd.RangeSelectionModule,fl,Mu]);const o=r.useModel(t,"modelValue"),i=t,{settings:l}=r.toRefs(i),c=n;r.watch(()=>l.value,async(k,x)=>{if(k.sourceType!=="pframe"||!k.pFrame||!k.join||x&&x.sourceType==="pframe"&&ze.isEqual(k.pFrame,x.pFrame)&&ze.isEqual(k.join,x.join))return;const B=window.platforma;if(!B)throw Error("platforma not set");const G=B.pFrameDriver;if(!G)throw Error("platforma.pFrameDriver not set");const H=await gV(G,k.pFrame,k.join),K=o.value;K.pTableParams||(K.pTableParams={sorting:[],filters:[]}),K.pTableParams.join=H,o.value=K});const d=Gh(()=>l.value.sourceType,async k=>{var B;const x=l.value.sourceType;switch(x){case"pframe":{const G=window.platforma;if(!G)throw Error("platforma not set");const H=G.pFrameDriver;if(!H)throw Error("platforma.pFrameDriver not set");if(!l.value.pFrame)return[];const K=l.value.pFrame,ne=(B=o.value.pTableParams)==null?void 0:B.join;return ne?await yV(H,K,l.value.sheetAxes,ne):[]}case"ptable":return l.value.sheets??[];case"xsv":return[];default:throw Error(`unsupported source type: ${x}`)}});function p(k){if(!(l.value.sourceType!=="ptable"&&l.value.sourceType!=="pframe"))return(k==null?void 0:k.sortModel.map(x=>{const{spec:B,...G}=rh(x.colId);return{column:G,ascending:x.sort==="asc",naAndAbsentAreLeastValues:!0}}))??[]}const h=r.computed({get:()=>{const k=o.value;return{columnOrder:k.gridState.columnOrder,sort:k.gridState.sort,columnVisibility:k.gridState.columnVisibility}},set:k=>{const x=o.value,B=S.value.rowModelType==="clientSide"?void 0:p(k.sort);x.gridState={...x.gridState,...k},(l.value.sourceType==="ptable"||l.value.sourceType==="pframe")&&(x.pTableParams||(x.pTableParams={sorting:[],filters:[]}),x.pTableParams.sorting=B),o.value=x}}),m=k=>$r(k);function y(k){var x;if(!(l.value.sourceType!=="ptable"&&l.value.sourceType!=="pframe"))return((x=d.value)==null?void 0:x.map(B=>({type:"bySingleColumnV2",column:B.column?{type:"column",id:B.column}:{type:"axis",id:B.axis},predicate:{operator:"Equal",reference:k[m(B.axis)]}})))??[]}const b=r.computed({get:()=>o.value.gridState.sheets??{},set:k=>{const x=y(k),B=o.value;B.gridState.sheets=k,(l.value.sourceType==="ptable"||l.value.sourceType==="pframe")&&(B.pTableParams||(B.pTableParams={sorting:[],filters:[]}),B.pTableParams.filters=x),o.value=B}});r.watch(()=>[l.value,d.value],(k,x)=>{const[B,G]=k;if(!G)return;if(x){const[K,ne]=x;if((B.sourceType==="ptable"||B.sourceType==="pframe")&&B.sourceType===(K==null?void 0:K.sourceType)&&ze.isEqual(G,ne))return}if(B.sourceType!=="ptable"&&B.sourceType!=="pframe"){b.value={};return}const H=b.value;for(const K of G){const ne=m(K.axis);H[ne]||(H[ne]=K.defaultValue??K.options[0].value)}b.value=H},{immediate:!0});const w=r.shallowRef(),S=r.shallowRef({animateRows:!1,suppressColumnMoveAnimation:!0,cellSelection:!0,initialState:h.value,autoSizeStrategy:{type:"fitCellContents"},onRowDoubleClicked:k=>{k.data&&c("onRowDoubleClicked",k.data.key)},onSortChanged:k=>{k.api.refreshCells()},onFilterChanged:k=>{k.api.refreshCells()},defaultColDef:{suppressHeaderMenuButton:!0},maintainColumnOrder:!0,localeText:{loadingError:"..."},rowModelType:"clientSide",maxBlocksInCache:1e3,cacheBlockSize:100,blockLoadDebounceMillis:500,serverSideSortAllLevels:!0,suppressServerSideFullWidthLoadingRow:!0,getRowId:k=>k.data.id,loading:!0,loadingOverlayComponentParams:{notReady:!0},loadingOverlayComponent:Jp,noRowsOverlayComponent:Qp,sideBar:{},defaultCsvExportParams:{allColumns:!0,suppressQuotes:!0,fileName:"table.csv"}}),M=k=>{const x=k.api;uV(x),w.value=new Proxy(x,{get(B,G,H){switch(G){case"setGridOption":return(K,ne)=>{const pe=S.value;pe[K]=ne,S.value=pe,x.setGridOption(K,ne)};case"updateGridOptions":return K=>{S.value={...S.value,...K},x.updateGridOptions(K)};default:return Reflect.get(B,G,H)}}})},O=k=>({columnOrder:k.columnOrder,sort:k.sort,columnVisibility:k.columnVisibility??(k.columnOrder?{hiddenColIds:[]}:void 0)}),v=k=>{S.value.initialState=h.value=O(k.state),k.api.autoSizeColumns(k.api.getAllDisplayedColumns().filter(x=>x.getColId()!==Yr))},I=()=>{S.value.initialState=h.value=O(w.value.getState()),w.value=void 0};let F=!1;const W=()=>{if(!F)return;const k=w.value;k!==void 0&&(k.exportDataAsCsv(),F=!1,k.setGridOption("cacheBlockSize",100))},P=()=>{if(!F)return;const k=w.value;if(k===void 0)return;const x=k.getServerSideGroupLevelState()[0];x.cacheBlockSize===x.rowCount&&k.refreshServerSide({route:x.route,purge:!1})};e({exportCsv:async()=>{const k=w.value;if(k!==void 0){if(S.value.rowModelType==="clientSide"){k.exportDataAsCsv();return}if(S.value.rowModelType==="serverSide"){const x=k.getServerSideGroupLevelState()[0];if(x.rowCount<=x.cacheBlockSize){k.exportDataAsCsv();return}F||(F=!0,k.setGridOption("cacheBlockSize",x.rowCount))}}}});const Z=r.ref(0);r.watch(()=>[w.value,h.value],(k,x)=>{if(ze.isEqual(k,x))return;const[B,G]=k;if(!B)return;const H=O(B.getState());ze.isEqual(G,H)||(S.value.initialState=G,++Z.value)}),r.watch(()=>S.value,(k,x)=>{var B;if(x&&(k.rowModelType!=x.rowModelType&&++Z.value,!ze.isEqual(k.columnDefs,x.columnDefs)&&k.columnDefs)){const G=ne=>!("children"in ne),H=(B=k.columnDefs)==null?void 0:B.filter(G),K=H==null?void 0:H.map(ne=>ne.colId).filter(ne=>ne!==void 0).filter(ne=>ne!==Yr).map(ne=>rh(ne));c("columnsChanged",K??[])}});const J=(k,x)=>{var G;const B=b.value;B[k]!==x&&(B[k]=x,b.value=B,(G=w.value)==null||G.updateGridOptions({loading:!0,loadingOverlayComponentParams:{notReady:!1}}))},ae=window.platforma;if(!ae)throw Error("platforma not set");const $=ae.pFrameDriver;if(!$)throw Error("platforma.pFrameDriver not set");const j=ae.blobDriver;if(!j)throw Error("platforma.blobDriver not set");let U;return r.watch(()=>[w.value,l.value,d.value],async k=>{var K,ne;const[x,B,G]=k;if(!x||ze.isEqual(B,U))return;U=B;const H=B.sourceType;switch(H){case"pframe":case"ptable":{const pe=B.pTable;if(!pe||!G)return x.updateGridOptions({loading:!0,loadingOverlayComponentParams:{notReady:!0},columnDefs:[]});const ke=(ne=(K=h.value)==null?void 0:K.columnVisibility)==null?void 0:ne.hiddenColIds,Ee=await vV($,pe,G,ke);return x.updateGridOptions({loading:Ee.rowModelType!=="clientSide",loadingOverlayComponentParams:{notReady:!1},...Ee})}case"xsv":{const pe=B.xsvFile;if(!(pe!=null&&pe.ok)||!pe.value)return x.updateGridOptions({loading:!0,loadingOverlayComponentParams:{notReady:!0},columnDefs:[]});const ke=await rV(j,pe.value);return x.updateGridOptions({loading:!0,loadingOverlayComponentParams:{notReady:!1},...ke})}default:throw Error(`unsupported source type: ${H}`)}}),(k,x)=>(r.openBlock(),r.createElementBlock("div",kV,[w.value&&k.showColumnsPanel?(r.openBlock(),r.createBlock(r.unref(ah),{key:0,api:w.value},null,8,["api"])):r.createCommentVNode("",!0),r.unref(d).value&&r.unref(d).value.length>0?(r.openBlock(),r.createElementBlock("div",EV,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(d).value,(B,G)=>(r.openBlock(),r.createBlock(r.unref(bp),{key:G,"model-value":b.value[m(B.axis)],options:B.options,"onUpdate:modelValue":H=>J(m(B.axis),H)},null,8,["model-value","options","onUpdate:modelValue"]))),128))])):r.createCommentVNode("",!0),(r.openBlock(),r.createBlock(r.unref(Dg.AgGridVue),{key:Z.value,theme:r.unref($u),class:"ap-ag-data-table-grid","grid-options":S.value,onGridReady:M,onStateUpdated:v,onGridPreDestroyed:I,onStoreRefreshed:W,onModelUpdated:P},null,8,["theme","grid-options"]))]))}}),[["__scopeId","data-v-6e23bf04"]]),TV={key:1,class:"alert-error"},NV={key:2},VV=r.defineComponent({__name:"ValueOrErrorsComponent",props:{valueOrError:{}},setup(t){const e=t,n=r.computed(()=>e.valueOrError&&e.valueOrError.ok?e.valueOrError.value:void 0),o=r.computed(()=>e.valueOrError&&!e.valueOrError.ok?e.valueOrError.errors:void 0),i=r.computed(()=>n.value===void 0&&o.value===void 0);return(l,c)=>(r.openBlock(),r.createElementBlock("div",null,[n.value!==void 0?r.renderSlot(l.$slots,"default",r.normalizeProps(r.mergeProps({key:0},{value:n.value}))):r.createCommentVNode("",!0),o.value?(r.openBlock(),r.createElementBlock("div",TV,r.toDisplayString(o.value),1)):r.createCommentVNode("",!0),i.value?(r.openBlock(),r.createElementBlock("div",NV,"Unresolved")):r.createCommentVNode("",!0)]))}}),AV={style:{height:"100%"}},BV=r.defineComponent({__name:"PlAgCellFile",props:{params:{}},setup(t){const e=t,n=r.computed(()=>e.params.extensions),o=r.computed(()=>e.params.value);function i(c){e.params.setValue(c)}const l=r.computed(()=>e.params.resolveProgress?e.params.resolveProgress(o.value):void 0);return(c,d)=>(r.openBlock(),r.createElementBlock("div",AV,[r.createVNode(r.unref(jp),{"show-filename-only":"",clearable:"","cell-style":"","file-dialog-title":"Select any file",placeholder:`Choose file ${n.value?n.value[0]:""}`,extensions:n.value,"model-value":o.value,progress:l.value,"onUpdate:modelValue":i},null,8,["placeholder","extensions","model-value","progress"])]))}}),PV={class:"pl-ag-grid-open-cell d-flex"},RV={class:"pl-ag-grid-open-cell__value"},DV=r.defineComponent({__name:"PlAgTextAndButtonCell",props:{params:{}},setup(t){const e=t;function n(){if(e.params.invokeRowsOnDoubleClick){const o=e.params.api,i={rowPinned:e.params.node.rowPinned,api:o,rowIndex:e.params.node.rowIndex,context:o,type:"rowDoubleClicked",node:e.params.node,data:e.params.data,event:null};o.dispatchEvent(i)}else e.params.onClick&&e.params.onClick(e.params)}return(o,i)=>(r.openBlock(),r.createElementBlock("div",PV,[r.createElementVNode("div",RV,r.toDisplayString(o.params.value),1),r.createElementVNode("div",{class:"pl-ag-grid-open-cell__activator text-caps11 align-center",onClick:r.withModifiers(n,["stop"])},[r.createVNode(r.unref(Vt),{name:o.params.icon??"maximize"},null,8,["name"]),r.createTextVNode(" "+r.toDisplayString(o.params.btnLabel??"Open"),1)])]))}});var ec={exports:{}};const IV="2.0.0",lh=256,FV=Number.MAX_SAFE_INTEGER||9007199254740991,LV=16,OV=lh-6;var Us={MAX_LENGTH:lh,MAX_SAFE_COMPONENT_LENGTH:LV,MAX_SAFE_BUILD_LENGTH:OV,MAX_SAFE_INTEGER:FV,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:IV,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},Zs=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{};(function(t,e){const{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:o,MAX_LENGTH:i}=Us,l=Zs;e=t.exports={};const c=e.re=[],d=e.safeRe=[],p=e.src=[],h=e.t={};let m=0;const y="[a-zA-Z0-9-]",b=[["\\s",1],["\\d",i],[y,o]],w=M=>{for(const[O,v]of b)M=M.split(`${O}*`).join(`${O}{0,${v}}`).split(`${O}+`).join(`${O}{1,${v}}`);return M},S=(M,O,v)=>{const I=w(O),F=m++;l(M,F,O),h[M]=F,p[F]=O,c[F]=new RegExp(O,v?"g":void 0),d[F]=new RegExp(I,v?"g":void 0)};S("NUMERICIDENTIFIER","0|[1-9]\\d*"),S("NUMERICIDENTIFIERLOOSE","\\d+"),S("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${y}*`),S("MAINVERSION",`(${p[h.NUMERICIDENTIFIER]})\\.(${p[h.NUMERICIDENTIFIER]})\\.(${p[h.NUMERICIDENTIFIER]})`),S("MAINVERSIONLOOSE",`(${p[h.NUMERICIDENTIFIERLOOSE]})\\.(${p[h.NUMERICIDENTIFIERLOOSE]})\\.(${p[h.NUMERICIDENTIFIERLOOSE]})`),S("PRERELEASEIDENTIFIER",`(?:${p[h.NUMERICIDENTIFIER]}|${p[h.NONNUMERICIDENTIFIER]})`),S("PRERELEASEIDENTIFIERLOOSE",`(?:${p[h.NUMERICIDENTIFIERLOOSE]}|${p[h.NONNUMERICIDENTIFIER]})`),S("PRERELEASE",`(?:-(${p[h.PRERELEASEIDENTIFIER]}(?:\\.${p[h.PRERELEASEIDENTIFIER]})*))`),S("PRERELEASELOOSE",`(?:-?(${p[h.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${p[h.PRERELEASEIDENTIFIERLOOSE]})*))`),S("BUILDIDENTIFIER",`${y}+`),S("BUILD",`(?:\\+(${p[h.BUILDIDENTIFIER]}(?:\\.${p[h.BUILDIDENTIFIER]})*))`),S("FULLPLAIN",`v?${p[h.MAINVERSION]}${p[h.PRERELEASE]}?${p[h.BUILD]}?`),S("FULL",`^${p[h.FULLPLAIN]}$`),S("LOOSEPLAIN",`[v=\\s]*${p[h.MAINVERSIONLOOSE]}${p[h.PRERELEASELOOSE]}?${p[h.BUILD]}?`),S("LOOSE",`^${p[h.LOOSEPLAIN]}$`),S("GTLT","((?:<|>)?=?)"),S("XRANGEIDENTIFIERLOOSE",`${p[h.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),S("XRANGEIDENTIFIER",`${p[h.NUMERICIDENTIFIER]}|x|X|\\*`),S("XRANGEPLAIN",`[v=\\s]*(${p[h.XRANGEIDENTIFIER]})(?:\\.(${p[h.XRANGEIDENTIFIER]})(?:\\.(${p[h.XRANGEIDENTIFIER]})(?:${p[h.PRERELEASE]})?${p[h.BUILD]}?)?)?`),S("XRANGEPLAINLOOSE",`[v=\\s]*(${p[h.XRANGEIDENTIFIERLOOSE]})(?:\\.(${p[h.XRANGEIDENTIFIERLOOSE]})(?:\\.(${p[h.XRANGEIDENTIFIERLOOSE]})(?:${p[h.PRERELEASELOOSE]})?${p[h.BUILD]}?)?)?`),S("XRANGE",`^${p[h.GTLT]}\\s*${p[h.XRANGEPLAIN]}$`),S("XRANGELOOSE",`^${p[h.GTLT]}\\s*${p[h.XRANGEPLAINLOOSE]}$`),S("COERCEPLAIN",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?`),S("COERCE",`${p[h.COERCEPLAIN]}(?:$|[^\\d])`),S("COERCEFULL",p[h.COERCEPLAIN]+`(?:${p[h.PRERELEASE]})?(?:${p[h.BUILD]})?(?:$|[^\\d])`),S("COERCERTL",p[h.COERCE],!0),S("COERCERTLFULL",p[h.COERCEFULL],!0),S("LONETILDE","(?:~>?)"),S("TILDETRIM",`(\\s*)${p[h.LONETILDE]}\\s+`,!0),e.tildeTrimReplace="$1~",S("TILDE",`^${p[h.LONETILDE]}${p[h.XRANGEPLAIN]}$`),S("TILDELOOSE",`^${p[h.LONETILDE]}${p[h.XRANGEPLAINLOOSE]}$`),S("LONECARET","(?:\\^)"),S("CARETTRIM",`(\\s*)${p[h.LONECARET]}\\s+`,!0),e.caretTrimReplace="$1^",S("CARET",`^${p[h.LONECARET]}${p[h.XRANGEPLAIN]}$`),S("CARETLOOSE",`^${p[h.LONECARET]}${p[h.XRANGEPLAINLOOSE]}$`),S("COMPARATORLOOSE",`^${p[h.GTLT]}\\s*(${p[h.LOOSEPLAIN]})$|^$`),S("COMPARATOR",`^${p[h.GTLT]}\\s*(${p[h.FULLPLAIN]})$|^$`),S("COMPARATORTRIM",`(\\s*)${p[h.GTLT]}\\s*(${p[h.LOOSEPLAIN]}|${p[h.XRANGEPLAIN]})`,!0),e.comparatorTrimReplace="$1$2$3",S("HYPHENRANGE",`^\\s*(${p[h.XRANGEPLAIN]})\\s+-\\s+(${p[h.XRANGEPLAIN]})\\s*$`),S("HYPHENRANGELOOSE",`^\\s*(${p[h.XRANGEPLAINLOOSE]})\\s+-\\s+(${p[h.XRANGEPLAINLOOSE]})\\s*$`),S("STAR","(<|>)?=?\\s*\\*"),S("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),S("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(ec,ec.exports);var Mi=ec.exports;const MV=Object.freeze({loose:!0}),GV=Object.freeze({});var tc=t=>t?typeof t!="object"?MV:t:GV;const ch=/^[0-9]+$/,dh=(t,e)=>{const n=ch.test(t),o=ch.test(e);return n&&o&&(t=+t,e=+e),t===e?0:n&&!o?-1:o&&!n?1:t<e?-1:1};var uh={compareIdentifiers:dh,rcompareIdentifiers:(t,e)=>dh(e,t)};const Ws=Zs,{MAX_LENGTH:ph,MAX_SAFE_INTEGER:js}=Us,{safeRe:hh,t:fh}=Mi,$V=tc,{compareIdentifiers:No}=uh;var Pt=class Hn{constructor(e,n){if(n=$V(n),e instanceof Hn){if(e.loose===!!n.loose&&e.includePrerelease===!!n.includePrerelease)return e;e=e.version}else if(typeof e!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>ph)throw new TypeError(`version is longer than ${ph} characters`);Ws("SemVer",e,n),this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease;const o=e.trim().match(n.loose?hh[fh.LOOSE]:hh[fh.FULL]);if(!o)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+o[1],this.minor=+o[2],this.patch=+o[3],this.major>js||this.major<0)throw new TypeError("Invalid major version");if(this.minor>js||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>js||this.patch<0)throw new TypeError("Invalid patch version");o[4]?this.prerelease=o[4].split(".").map(i=>{if(/^[0-9]+$/.test(i)){const l=+i;if(l>=0&&l<js)return l}return i}):this.prerelease=[],this.build=o[5]?o[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(Ws("SemVer.compare",this.version,this.options,e),!(e instanceof Hn)){if(typeof e=="string"&&e===this.version)return 0;e=new Hn(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof Hn||(e=new Hn(e,this.options)),No(this.major,e.major)||No(this.minor,e.minor)||No(this.patch,e.patch)}comparePre(e){if(e instanceof Hn||(e=new Hn(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let n=0;do{const o=this.prerelease[n],i=e.prerelease[n];if(Ws("prerelease compare",n,o,i),o===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(o===void 0)return-1;if(o===i)continue;return No(o,i)}while(++n)}compareBuild(e){e instanceof Hn||(e=new Hn(e,this.options));let n=0;do{const o=this.build[n],i=e.build[n];if(Ws("build compare",n,o,i),o===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(o===void 0)return-1;if(o===i)continue;return No(o,i)}while(++n)}inc(e,n,o){switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",n,o);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",n,o);break;case"prepatch":this.prerelease.length=0,this.inc("patch",n,o),this.inc("pre",n,o);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",n,o),this.inc("pre",n,o);break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{const i=Number(o)?1:0;if(!n&&o===!1)throw new Error("invalid increment argument: identifier is empty");if(this.prerelease.length===0)this.prerelease=[i];else{let l=this.prerelease.length;for(;--l>=0;)typeof this.prerelease[l]=="number"&&(this.prerelease[l]++,l=-2);if(l===-1){if(n===this.prerelease.join(".")&&o===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(i)}}if(n){let l=[n,i];o===!1&&(l=[n]),No(this.prerelease[0],n)===0?isNaN(this.prerelease[1])&&(this.prerelease=l):this.prerelease=l}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};const mh=Pt;var Vo=(t,e,n=!1)=>{if(t instanceof mh)return t;try{return new mh(t,e)}catch(o){if(!n)return null;throw o}};const zV=Vo;var UV=(t,e)=>{const n=zV(t,e);return n?n.version:null};const ZV=Vo;var WV=(t,e)=>{const n=ZV(t.trim().replace(/^[=v]+/,""),e);return n?n.version:null};const gh=Pt;var jV=(t,e,n,o,i)=>{typeof n=="string"&&(i=o,o=n,n=void 0);try{return new gh(t instanceof gh?t.version:t,n).inc(e,o,i).version}catch{return null}};const yh=Vo;var HV=(t,e)=>{const n=yh(t,null,!0),o=yh(e,null,!0),i=n.compare(o);if(i===0)return null;const l=i>0,c=l?n:o,d=l?o:n,p=!!c.prerelease.length;if(!!d.prerelease.length&&!p)return!d.patch&&!d.minor?"major":c.patch?"patch":c.minor?"minor":"major";const m=p?"pre":"";return n.major!==o.major?m+"major":n.minor!==o.minor?m+"minor":n.patch!==o.patch?m+"patch":"prerelease"};const qV=Pt;var KV=(t,e)=>new qV(t,e).major;const YV=Pt;var XV=(t,e)=>new YV(t,e).minor;const JV=Pt;var QV=(t,e)=>new JV(t,e).patch;const eA=Vo;var tA=(t,e)=>{const n=eA(t,e);return n&&n.prerelease.length?n.prerelease:null};const _h=Pt;var _n=(t,e,n)=>new _h(t,n).compare(new _h(e,n));const nA=_n;var rA=(t,e,n)=>nA(e,t,n);const oA=_n;var iA=(t,e)=>oA(t,e,!0);const Ch=Pt;var nc=(t,e,n)=>{const o=new Ch(t,n),i=new Ch(e,n);return o.compare(i)||o.compareBuild(i)};const sA=nc;var aA=(t,e)=>t.sort((n,o)=>sA(n,o,e));const lA=nc;var cA=(t,e)=>t.sort((n,o)=>lA(o,n,e));const dA=_n;var Hs=(t,e,n)=>dA(t,e,n)>0;const uA=_n;var rc=(t,e,n)=>uA(t,e,n)<0;const pA=_n;var vh=(t,e,n)=>pA(t,e,n)===0;const hA=_n;var wh=(t,e,n)=>hA(t,e,n)!==0;const fA=_n;var oc=(t,e,n)=>fA(t,e,n)>=0;const mA=_n;var ic=(t,e,n)=>mA(t,e,n)<=0;const gA=vh,yA=wh,_A=Hs,CA=oc,vA=rc,wA=ic;var bh=(t,e,n,o)=>{switch(e){case"===":return typeof t=="object"&&(t=t.version),typeof n=="object"&&(n=n.version),t===n;case"!==":return typeof t=="object"&&(t=t.version),typeof n=="object"&&(n=n.version),t!==n;case"":case"=":case"==":return gA(t,n,o);case"!=":return yA(t,n,o);case">":return _A(t,n,o);case">=":return CA(t,n,o);case"<":return vA(t,n,o);case"<=":return wA(t,n,o);default:throw new TypeError(`Invalid operator: ${e}`)}};const bA=Pt,xA=Vo,{safeRe:qs,t:Ks}=Mi;var kA=(t,e)=>{if(t instanceof bA)return t;if(typeof t=="number"&&(t=String(t)),typeof t!="string")return null;e=e||{};let n=null;if(!e.rtl)n=t.match(e.includePrerelease?qs[Ks.COERCEFULL]:qs[Ks.COERCE]);else{const p=e.includePrerelease?qs[Ks.COERCERTLFULL]:qs[Ks.COERCERTL];let h;for(;(h=p.exec(t))&&(!n||n.index+n[0].length!==t.length);)(!n||h.index+h[0].length!==n.index+n[0].length)&&(n=h),p.lastIndex=h.index+h[1].length+h[2].length;p.lastIndex=-1}if(n===null)return null;const o=n[2],i=n[3]||"0",l=n[4]||"0",c=e.includePrerelease&&n[5]?`-${n[5]}`:"",d=e.includePrerelease&&n[6]?`+${n[6]}`:"";return xA(`${o}.${i}.${l}${c}${d}`,e)},EA=class{constructor(){this.max=1e3,this.map=new Map}get(e){const n=this.map.get(e);if(n!==void 0)return this.map.delete(e),this.map.set(e,n),n}delete(e){return this.map.delete(e)}set(e,n){if(!this.delete(e)&&n!==void 0){if(this.map.size>=this.max){const i=this.map.keys().next().value;this.delete(i)}this.map.set(e,n)}return this}},sc,xh;function Cn(){if(xh)return sc;xh=1;const t=/\s+/g;class e{constructor(B,G){if(G=i(G),B instanceof e)return B.loose===!!G.loose&&B.includePrerelease===!!G.includePrerelease?B:new e(B.raw,G);if(B instanceof l)return this.raw=B.value,this.set=[[B]],this.formatted=void 0,this;if(this.options=G,this.loose=!!G.loose,this.includePrerelease=!!G.includePrerelease,this.raw=B.trim().replace(t," "),this.set=this.raw.split("||").map(H=>this.parseRange(H.trim())).filter(H=>H.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const H=this.set[0];if(this.set=this.set.filter(K=>!M(K[0])),this.set.length===0)this.set=[H];else if(this.set.length>1){for(const K of this.set)if(K.length===1&&O(K[0])){this.set=[K];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let B=0;B<this.set.length;B++){B>0&&(this.formatted+="||");const G=this.set[B];for(let H=0;H<G.length;H++)H>0&&(this.formatted+=" "),this.formatted+=G[H].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(B){const H=((this.options.includePrerelease&&w)|(this.options.loose&&S))+":"+B,K=o.get(H);if(K)return K;const ne=this.options.loose,pe=ne?p[h.HYPHENRANGELOOSE]:p[h.HYPHENRANGE];B=B.replace(pe,U(this.options.includePrerelease)),c("hyphen replace",B),B=B.replace(p[h.COMPARATORTRIM],m),c("comparator trim",B),B=B.replace(p[h.TILDETRIM],y),c("tilde trim",B),B=B.replace(p[h.CARETTRIM],b),c("caret trim",B);let ke=B.split(" ").map(Ke=>I(Ke,this.options)).join(" ").split(/\s+/).map(Ke=>j(Ke,this.options));ne&&(ke=ke.filter(Ke=>(c("loose invalid filter",Ke,this.options),!!Ke.match(p[h.COMPARATORLOOSE])))),c("range list",ke);const Ee=new Map,He=ke.map(Ke=>new l(Ke,this.options));for(const Ke of He){if(M(Ke))return[Ke];Ee.set(Ke.value,Ke)}Ee.size>1&&Ee.has("")&&Ee.delete("");const It=[...Ee.values()];return o.set(H,It),It}intersects(B,G){if(!(B instanceof e))throw new TypeError("a Range is required");return this.set.some(H=>v(H,G)&&B.set.some(K=>v(K,G)&&H.every(ne=>K.every(pe=>ne.intersects(pe,G)))))}test(B){if(!B)return!1;if(typeof B=="string")try{B=new d(B,this.options)}catch{return!1}for(let G=0;G<this.set.length;G++)if(k(this.set[G],B,this.options))return!0;return!1}}sc=e;const n=EA,o=new n,i=tc,l=Ys(),c=Zs,d=Pt,{safeRe:p,t:h,comparatorTrimReplace:m,tildeTrimReplace:y,caretTrimReplace:b}=Mi,{FLAG_INCLUDE_PRERELEASE:w,FLAG_LOOSE:S}=Us,M=x=>x.value==="<0.0.0-0",O=x=>x.value==="",v=(x,B)=>{let G=!0;const H=x.slice();let K=H.pop();for(;G&&H.length;)G=H.every(ne=>K.intersects(ne,B)),K=H.pop();return G},I=(x,B)=>(c("comp",x,B),x=V(x,B),c("caret",x),x=W(x,B),c("tildes",x),x=J(x,B),c("xrange",x),x=$(x,B),c("stars",x),x),F=x=>!x||x.toLowerCase()==="x"||x==="*",W=(x,B)=>x.trim().split(/\s+/).map(G=>P(G,B)).join(" "),P=(x,B)=>{const G=B.loose?p[h.TILDELOOSE]:p[h.TILDE];return x.replace(G,(H,K,ne,pe,ke)=>{c("tilde",x,H,K,ne,pe,ke);let Ee;return F(K)?Ee="":F(ne)?Ee=`>=${K}.0.0 <${+K+1}.0.0-0`:F(pe)?Ee=`>=${K}.${ne}.0 <${K}.${+ne+1}.0-0`:ke?(c("replaceTilde pr",ke),Ee=`>=${K}.${ne}.${pe}-${ke} <${K}.${+ne+1}.0-0`):Ee=`>=${K}.${ne}.${pe} <${K}.${+ne+1}.0-0`,c("tilde return",Ee),Ee})},V=(x,B)=>x.trim().split(/\s+/).map(G=>Z(G,B)).join(" "),Z=(x,B)=>{c("caret",x,B);const G=B.loose?p[h.CARETLOOSE]:p[h.CARET],H=B.includePrerelease?"-0":"";return x.replace(G,(K,ne,pe,ke,Ee)=>{c("caret",x,K,ne,pe,ke,Ee);let He;return F(ne)?He="":F(pe)?He=`>=${ne}.0.0${H} <${+ne+1}.0.0-0`:F(ke)?ne==="0"?He=`>=${ne}.${pe}.0${H} <${ne}.${+pe+1}.0-0`:He=`>=${ne}.${pe}.0${H} <${+ne+1}.0.0-0`:Ee?(c("replaceCaret pr",Ee),ne==="0"?pe==="0"?He=`>=${ne}.${pe}.${ke}-${Ee} <${ne}.${pe}.${+ke+1}-0`:He=`>=${ne}.${pe}.${ke}-${Ee} <${ne}.${+pe+1}.0-0`:He=`>=${ne}.${pe}.${ke}-${Ee} <${+ne+1}.0.0-0`):(c("no pr"),ne==="0"?pe==="0"?He=`>=${ne}.${pe}.${ke}${H} <${ne}.${pe}.${+ke+1}-0`:He=`>=${ne}.${pe}.${ke}${H} <${ne}.${+pe+1}.0-0`:He=`>=${ne}.${pe}.${ke} <${+ne+1}.0.0-0`),c("caret return",He),He})},J=(x,B)=>(c("replaceXRanges",x,B),x.split(/\s+/).map(G=>ae(G,B)).join(" ")),ae=(x,B)=>{x=x.trim();const G=B.loose?p[h.XRANGELOOSE]:p[h.XRANGE];return x.replace(G,(H,K,ne,pe,ke,Ee)=>{c("xRange",x,H,K,ne,pe,ke,Ee);const He=F(ne),It=He||F(pe),Ke=It||F(ke),Un=Ke;return K==="="&&Un&&(K=""),Ee=B.includePrerelease?"-0":"",He?K===">"||K==="<"?H="<0.0.0-0":H="*":K&&Un?(It&&(pe=0),ke=0,K===">"?(K=">=",It?(ne=+ne+1,pe=0,ke=0):(pe=+pe+1,ke=0)):K==="<="&&(K="<",It?ne=+ne+1:pe=+pe+1),K==="<"&&(Ee="-0"),H=`${K+ne}.${pe}.${ke}${Ee}`):It?H=`>=${ne}.0.0${Ee} <${+ne+1}.0.0-0`:Ke&&(H=`>=${ne}.${pe}.0${Ee} <${ne}.${+pe+1}.0-0`),c("xRange return",H),H})},$=(x,B)=>(c("replaceStars",x,B),x.trim().replace(p[h.STAR],"")),j=(x,B)=>(c("replaceGTE0",x,B),x.trim().replace(p[B.includePrerelease?h.GTE0PRE:h.GTE0],"")),U=x=>(B,G,H,K,ne,pe,ke,Ee,He,It,Ke,Un)=>(F(H)?G="":F(K)?G=`>=${H}.0.0${x?"-0":""}`:F(ne)?G=`>=${H}.${K}.0${x?"-0":""}`:pe?G=`>=${G}`:G=`>=${G}${x?"-0":""}`,F(He)?Ee="":F(It)?Ee=`<${+He+1}.0.0-0`:F(Ke)?Ee=`<${He}.${+It+1}.0-0`:Un?Ee=`<=${He}.${It}.${Ke}-${Un}`:x?Ee=`<${He}.${It}.${+Ke+1}-0`:Ee=`<=${Ee}`,`${G} ${Ee}`.trim()),k=(x,B,G)=>{for(let H=0;H<x.length;H++)if(!x[H].test(B))return!1;if(B.prerelease.length&&!G.includePrerelease){for(let H=0;H<x.length;H++)if(c(x[H].semver),x[H].semver!==l.ANY&&x[H].semver.prerelease.length>0){const K=x[H].semver;if(K.major===B.major&&K.minor===B.minor&&K.patch===B.patch)return!0}return!1}return!0};return sc}var ac,kh;function Ys(){if(kh)return ac;kh=1;const t=Symbol("SemVer ANY");class e{static get ANY(){return t}constructor(m,y){if(y=n(y),m instanceof e){if(m.loose===!!y.loose)return m;m=m.value}m=m.trim().split(/\s+/).join(" "),c("comparator",m,y),this.options=y,this.loose=!!y.loose,this.parse(m),this.semver===t?this.value="":this.value=this.operator+this.semver.version,c("comp",this)}parse(m){const y=this.options.loose?o[i.COMPARATORLOOSE]:o[i.COMPARATOR],b=m.match(y);if(!b)throw new TypeError(`Invalid comparator: ${m}`);this.operator=b[1]!==void 0?b[1]:"",this.operator==="="&&(this.operator=""),b[2]?this.semver=new d(b[2],this.options.loose):this.semver=t}toString(){return this.value}test(m){if(c("Comparator.test",m,this.options.loose),this.semver===t||m===t)return!0;if(typeof m=="string")try{m=new d(m,this.options)}catch{return!1}return l(m,this.operator,this.semver,this.options)}intersects(m,y){if(!(m instanceof e))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new p(m.value,y).test(this.value):m.operator===""?m.value===""?!0:new p(this.value,y).test(m.semver):(y=n(y),y.includePrerelease&&(this.value==="<0.0.0-0"||m.value==="<0.0.0-0")||!y.includePrerelease&&(this.value.startsWith("<0.0.0")||m.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&m.operator.startsWith(">")||this.operator.startsWith("<")&&m.operator.startsWith("<")||this.semver.version===m.semver.version&&this.operator.includes("=")&&m.operator.includes("=")||l(this.semver,"<",m.semver,y)&&this.operator.startsWith(">")&&m.operator.startsWith("<")||l(this.semver,">",m.semver,y)&&this.operator.startsWith("<")&&m.operator.startsWith(">")))}}ac=e;const n=tc,{safeRe:o,t:i}=Mi,l=bh,c=Zs,d=Pt,p=Cn();return ac}const SA=Cn();var Xs=(t,e,n)=>{try{e=new SA(e,n)}catch{return!1}return e.test(t)};const TA=Cn();var NA=(t,e)=>new TA(t,e).set.map(n=>n.map(o=>o.value).join(" ").trim().split(" "));const VA=Pt,AA=Cn();var BA=(t,e,n)=>{let o=null,i=null,l=null;try{l=new AA(e,n)}catch{return null}return t.forEach(c=>{l.test(c)&&(!o||i.compare(c)===-1)&&(o=c,i=new VA(o,n))}),o};const PA=Pt,RA=Cn();var DA=(t,e,n)=>{let o=null,i=null,l=null;try{l=new RA(e,n)}catch{return null}return t.forEach(c=>{l.test(c)&&(!o||i.compare(c)===1)&&(o=c,i=new PA(o,n))}),o};const lc=Pt,IA=Cn(),Eh=Hs;var FA=(t,e)=>{t=new IA(t,e);let n=new lc("0.0.0");if(t.test(n)||(n=new lc("0.0.0-0"),t.test(n)))return n;n=null;for(let o=0;o<t.set.length;++o){const i=t.set[o];let l=null;i.forEach(c=>{const d=new lc(c.semver.version);switch(c.operator){case">":d.prerelease.length===0?d.patch++:d.prerelease.push(0),d.raw=d.format();case"":case">=":(!l||Eh(d,l))&&(l=d);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${c.operator}`)}}),l&&(!n||Eh(n,l))&&(n=l)}return n&&t.test(n)?n:null};const LA=Cn();var OA=(t,e)=>{try{return new LA(t,e).range||"*"}catch{return null}};const MA=Pt,Sh=Ys(),{ANY:GA}=Sh,$A=Cn(),zA=Xs,Th=Hs,Nh=rc,UA=ic,ZA=oc;var cc=(t,e,n,o)=>{t=new MA(t,o),e=new $A(e,o);let i,l,c,d,p;switch(n){case">":i=Th,l=UA,c=Nh,d=">",p=">=";break;case"<":i=Nh,l=ZA,c=Th,d="<",p="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(zA(t,e,o))return!1;for(let h=0;h<e.set.length;++h){const m=e.set[h];let y=null,b=null;if(m.forEach(w=>{w.semver===GA&&(w=new Sh(">=0.0.0")),y=y||w,b=b||w,i(w.semver,y.semver,o)?y=w:c(w.semver,b.semver,o)&&(b=w)}),y.operator===d||y.operator===p||(!b.operator||b.operator===d)&&l(t,b.semver))return!1;if(b.operator===p&&c(t,b.semver))return!1}return!0};const WA=cc;var jA=(t,e,n)=>WA(t,e,">",n);const HA=cc;var qA=(t,e,n)=>HA(t,e,"<",n);const Vh=Cn();var KA=(t,e,n)=>(t=new Vh(t,n),e=new Vh(e,n),t.intersects(e,n));const YA=Xs,XA=_n;var JA=(t,e,n)=>{const o=[];let i=null,l=null;const c=t.sort((m,y)=>XA(m,y,n));for(const m of c)YA(m,e,n)?(l=m,i||(i=m)):(l&&o.push([i,l]),l=null,i=null);i&&o.push([i,null]);const d=[];for(const[m,y]of o)m===y?d.push(m):!y&&m===c[0]?d.push("*"):y?m===c[0]?d.push(`<=${y}`):d.push(`${m} - ${y}`):d.push(`>=${m}`);const p=d.join(" || "),h=typeof e.raw=="string"?e.raw:String(e);return p.length<h.length?p:e};const Ah=Cn(),dc=Ys(),{ANY:uc}=dc,Gi=Xs,pc=_n,QA=(t,e,n={})=>{if(t===e)return!0;t=new Ah(t,n),e=new Ah(e,n);let o=!1;e:for(const i of t.set){for(const l of e.set){const c=tB(i,l,n);if(o=o||c!==null,c)continue e}if(o)return!1}return!0},eB=[new dc(">=0.0.0-0")],Bh=[new dc(">=0.0.0")],tB=(t,e,n)=>{if(t===e)return!0;if(t.length===1&&t[0].semver===uc){if(e.length===1&&e[0].semver===uc)return!0;n.includePrerelease?t=eB:t=Bh}if(e.length===1&&e[0].semver===uc){if(n.includePrerelease)return!0;e=Bh}const o=new Set;let i,l;for(const w of t)w.operator===">"||w.operator===">="?i=Ph(i,w,n):w.operator==="<"||w.operator==="<="?l=Rh(l,w,n):o.add(w.semver);if(o.size>1)return null;let c;if(i&&l){if(c=pc(i.semver,l.semver,n),c>0)return null;if(c===0&&(i.operator!==">="||l.operator!=="<="))return null}for(const w of o){if(i&&!Gi(w,String(i),n)||l&&!Gi(w,String(l),n))return null;for(const S of e)if(!Gi(w,String(S),n))return!1;return!0}let d,p,h,m,y=l&&!n.includePrerelease&&l.semver.prerelease.length?l.semver:!1,b=i&&!n.includePrerelease&&i.semver.prerelease.length?i.semver:!1;y&&y.prerelease.length===1&&l.operator==="<"&&y.prerelease[0]===0&&(y=!1);for(const w of e){if(m=m||w.operator===">"||w.operator===">=",h=h||w.operator==="<"||w.operator==="<=",i){if(b&&w.semver.prerelease&&w.semver.prerelease.length&&w.semver.major===b.major&&w.semver.minor===b.minor&&w.semver.patch===b.patch&&(b=!1),w.operator===">"||w.operator===">="){if(d=Ph(i,w,n),d===w&&d!==i)return!1}else if(i.operator===">="&&!Gi(i.semver,String(w),n))return!1}if(l){if(y&&w.semver.prerelease&&w.semver.prerelease.length&&w.semver.major===y.major&&w.semver.minor===y.minor&&w.semver.patch===y.patch&&(y=!1),w.operator==="<"||w.operator==="<="){if(p=Rh(l,w,n),p===w&&p!==l)return!1}else if(l.operator==="<="&&!Gi(l.semver,String(w),n))return!1}if(!w.operator&&(l||i)&&c!==0)return!1}return!(i&&h&&!l&&c!==0||l&&m&&!i&&c!==0||b||y)},Ph=(t,e,n)=>{if(!t)return e;const o=pc(t.semver,e.semver,n);return o>0?t:o<0||e.operator===">"&&t.operator===">="?e:t},Rh=(t,e,n)=>{if(!t)return e;const o=pc(t.semver,e.semver,n);return o<0?t:o>0||e.operator==="<"&&t.operator==="<="?e:t};var nB=QA;const hc=Mi,Dh=Us,rB=Pt,Ih=uh,oB=Vo,iB=UV,sB=WV,aB=jV,lB=HV,cB=KV,dB=XV,uB=QV,pB=tA,hB=_n,fB=rA,mB=iA,gB=nc,yB=aA,_B=cA,CB=Hs,vB=rc,wB=vh,bB=wh,xB=oc,kB=ic,EB=bh,SB=kA,TB=Ys(),NB=Cn();var VB={parse:oB,valid:iB,clean:sB,inc:aB,diff:lB,major:cB,minor:dB,patch:uB,prerelease:pB,compare:hB,rcompare:fB,compareLoose:mB,compareBuild:gB,sort:yB,rsort:_B,gt:CB,lt:vB,eq:wB,neq:bB,gte:xB,lte:kB,cmp:EB,coerce:SB,Comparator:TB,Range:NB,satisfies:Xs,toComparators:NA,maxSatisfying:BA,minSatisfying:DA,minVersion:FA,validRange:OA,outside:cc,gtr:jA,ltr:qA,intersects:KA,simplifyRange:JA,subset:nB,SemVer:rB,re:hc.re,src:hc.src,tokens:hc.t,SEMVER_SPEC_VERSION:Dh.SEMVER_SPEC_VERSION,RELEASE_TYPES:Dh.RELEASE_TYPES,compareIdentifiers:Ih.compareIdentifiers,rcompareIdentifiers:Ih.rcompareIdentifiers};const AB=Qd(VB);function BB(t){return $r(t.id)}function PB(t){switch(t){case"isNotNA":return"Is not NA";case"isNA":return"Is NA";case"number_equals":case"string_equals":return"Equals";case"number_notEquals":case"string_notEquals":return"Not equals";case"number_greaterThan":return"Greater than";case"number_greaterThanOrEqualTo":return"Greater than or equal to";case"number_lessThan":return"Less than";case"number_lessThanOrEqualTo":return"Less than or equal to";case"number_between":return"Between";case"string_contains":return"Contains";case"string_doesNotContain":return"Does not contain";case"string_matches":return"Matches";case"string_doesNotMatch":return"Does not match";case"string_containsFuzzyMatch":return"Contains fuzzy match";default:throw Error(`unsupported filter type: ${t}`)}}const RB=["isNotNA","isNA","number_equals","number_notEquals","number_greaterThan","number_greaterThanOrEqualTo","number_lessThan","number_lessThanOrEqualTo","number_between"],DB=["isNotNA","isNA","string_equals","string_notEquals","string_contains","string_doesNotContain","string_matches","string_doesNotMatch","string_containsFuzzyMatch"];function Fh(t,e){var n,o;return((o=(n=t.spec.annotations)==null?void 0:n["pl7.app/label"])==null?void 0:o.trim())??"Unlabeled "+t.type+" "+e.toString()}function IB(t){const e=t.type;switch(e){case"isNotNA":case"isNA":return;case"number_equals":case"number_notEquals":case"number_greaterThan":case"number_greaterThanOrEqualTo":case"number_lessThan":case"number_lessThanOrEqualTo":return t.reference;case"number_between":return t.lowerBound;case"string_equals":case"string_notEquals":case"string_contains":case"string_doesNotContain":case"string_matches":case"string_doesNotMatch":case"string_containsFuzzyMatch":return t.reference;default:throw Error(`unsupported filter type: ${e}`)}}function Lh(t,e){switch(t){case"isNotNA":case"isNA":return{type:t};case"number_equals":case"number_notEquals":case"number_greaterThan":case"number_greaterThanOrEqualTo":case"number_lessThan":case"number_lessThanOrEqualTo":return{type:t,reference:typeof e=="number"?e:0};case"number_between":return{type:t,lowerBound:typeof e=="number"?e:0,includeLowerBound:!0,upperBound:100,includeUpperBound:!1};case"string_equals":case"string_notEquals":case"string_contains":case"string_doesNotContain":case"string_matches":case"string_doesNotMatch":return{type:t,reference:typeof e=="string"?e:""};case"string_containsFuzzyMatch":return{type:t,reference:typeof e=="string"?e:"",maxEdits:2,substitutionsOnly:!1,wildcard:void 0};default:throw Error(`unsupported filter type: ${t}`)}}function FB(t,e){return{columnId:t.columnId,filter:Lh(e,IB(t.filter)),disabled:t.disabled}}function fc(t,e){var c,d;const n=Number(e);if(!Number.isFinite(n))throw Error("Model value is not a number.");const o=t.type==="column"?t.spec.valueType:t.spec.type;if((o==="Int"||o==="Long")&&!Number.isInteger(n))throw Error("Model value is not an integer.");const i=(c=t.spec.annotations)==null?void 0:c["pl7.app/min"];if(i!==void 0){const p=Number(i);if(Number.isFinite(p)&&n<Number(i))throw Error("Model value is too low.")}const l=(d=t.spec.annotations)==null?void 0:d["pl7.app/max"];if(l!==void 0){const p=Number(l);if(Number.isFinite(p)&&n>Number(l))throw Error("Model value is too high.")}return n}function Oh(t,e){var o,i;const n=((o=t.spec.domain)==null?void 0:o["pl7.app/alphabet"])??((i=t.spec.annotations)==null?void 0:i["pl7.app/alphabet"]);if(n==="nucleotide"&&!/^[AaTtGgCcNn]+$/.test(e))throw Error("Model value is not a nucleotide.");if(n==="aminoacid"&&!/^[AaCcDdEeFfGgHhIiKkLlMmNnPpQqRrSsTtVvWwYyXx]+$/.test(e))throw Error("Model value is not an aminoacid.");return e}function LB(t){try{return new RegExp(t),t}catch(e){throw e instanceof SyntaxError?Error("Model value is not a regexp."):e}}function OB(t,e){var i,l;const n=((i=t.spec.domain)==null?void 0:i["pl7.app/alphabet"])??((l=t.spec.annotations)==null?void 0:l["pl7.app/alphabet"]);if(n==="nucleotide")return[{value:"N",text:"N"}];if(n==="aminoacid")return[{value:"X",text:"X"}];const o=ze.uniq(e);return o.sort(),o.map(c=>({value:c,text:c}))}function MB(t,e){var i,l;const n=AB.gt(yu().sdkInfo.sdkVersion,"1.14.0")&&(t.type==="column"?t.spec.valueType:t.spec.type)==="String"&&(((i=t.spec.domain)==null?void 0:i["pl7.app/alphabet"])??((l=t.spec.annotations)==null?void 0:l["pl7.app/alphabet"]))!==void 0,o=e.type;switch(o){case"isNotNA":return{operator:"Not",operand:{operator:"IsNA"}};case"isNA":return{operator:"IsNA"};case"number_equals":return{operator:"Equal",reference:e.reference};case"string_equals":return{operator:n?"IEqual":"Equal",reference:e.reference};case"number_notEquals":return{operator:"Not",operand:{operator:"Equal",reference:e.reference}};case"string_notEquals":return{operator:"Not",operand:{operator:n?"IEqual":"Equal",reference:e.reference}};case"number_greaterThan":return{operator:"Greater",reference:e.reference};case"number_greaterThanOrEqualTo":return{operator:"GreaterOrEqual",reference:e.reference};case"number_lessThan":return{operator:"Less",reference:e.reference};case"number_lessThanOrEqualTo":return{operator:"LessOrEqual",reference:e.reference};case"number_between":return{operator:"And",operands:[{operator:e.includeLowerBound?"GreaterOrEqual":"Greater",reference:e.lowerBound},{operator:e.includeUpperBound?"LessOrEqual":"Less",reference:e.upperBound}]};case"string_contains":return{operator:n?"StringIContains":"StringContains",substring:e.reference};case"string_doesNotContain":return{operator:"Not",operand:{operator:n?"StringIContains":"StringContains",substring:e.reference}};case"string_matches":return{operator:"Matches",regex:e.reference};case"string_doesNotMatch":return{operator:"Not",operand:{operator:"Matches",regex:e.reference}};case"string_containsFuzzyMatch":return{operator:n?"StringIContainsFuzzy":"StringContainsFuzzy",reference:e.reference,maxEdits:e.maxEdits,substitutionsOnly:e.substitutionsOnly,wildcard:e.wildcard};default:throw Error(`unsupported filter type: ${o}`)}}const GB={class:"d-flex flex-column gap-24"},Mh=r.defineComponent({__name:"PlTableFilterEntry",props:r.mergeModels({column:{},options:{},disabled:{type:Boolean}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=r.useModel(t,"modelValue"),n=t,{column:o,options:i}=r.toRefs(n);return(l,c)=>(r.openBlock(),r.createElementBlock("div",GB,[r.createVNode(r.unref(wo),{"model-value":e.value.filter.type,options:r.unref(i),disabled:l.disabled,label:"Predicate","onUpdate:modelValue":c[0]||(c[0]=d=>e.value=r.unref(FB)(e.value,d))},null,8,["model-value","options","disabled"]),e.value.filter.type==="number_equals"||e.value.filter.type==="number_notEquals"||e.value.filter.type==="number_lessThan"||e.value.filter.type==="number_lessThanOrEqualTo"||e.value.filter.type==="number_greaterThan"||e.value.filter.type==="number_greaterThanOrEqualTo"?(r.openBlock(),r.createBlock(r.unref(jr),{key:0,modelValue:e.value.filter.reference,"onUpdate:modelValue":c[1]||(c[1]=d=>e.value.filter.reference=d),disabled:l.disabled,parse:d=>r.unref(fc)(r.unref(o),d),label:"Reference value"},null,8,["modelValue","disabled","parse"])):r.createCommentVNode("",!0),e.value.filter.type==="number_between"?(r.openBlock(),r.createElementBlock(r.Fragment,{key:1},[r.createVNode(r.unref(jr),{modelValue:e.value.filter.lowerBound,"onUpdate:modelValue":c[2]||(c[2]=d=>e.value.filter.lowerBound=d),disabled:l.disabled,parse:d=>r.unref(fc)(r.unref(o),d),label:"Lower bound"},null,8,["modelValue","disabled","parse"]),r.createVNode(r.unref(Ps),{modelValue:e.value.filter.includeLowerBound,"onUpdate:modelValue":c[3]||(c[3]=d=>e.value.filter.includeLowerBound=d),disabled:l.disabled,label:"Include lower bound"},null,8,["modelValue","disabled"]),r.createVNode(r.unref(jr),{modelValue:e.value.filter.upperBound,"onUpdate:modelValue":c[4]||(c[4]=d=>e.value.filter.upperBound=d),disabled:l.disabled,parse:d=>r.unref(fc)(r.unref(o),d),label:"Upper bound"},null,8,["modelValue","disabled","parse"]),r.createVNode(r.unref(Ps),{modelValue:e.value.filter.includeUpperBound,"onUpdate:modelValue":c[5]||(c[5]=d=>e.value.filter.includeUpperBound=d),disabled:l.disabled,label:"Include upper bound"},null,8,["modelValue","disabled"])],64)):r.createCommentVNode("",!0),e.value.filter.type==="string_equals"||e.value.filter.type==="string_notEquals"||e.value.filter.type==="string_contains"||e.value.filter.type==="string_doesNotContain"?(r.openBlock(),r.createBlock(r.unref(jr),{key:2,modelValue:e.value.filter.reference,"onUpdate:modelValue":c[6]||(c[6]=d=>e.value.filter.reference=d),disabled:l.disabled,parse:d=>r.unref(Oh)(r.unref(o),d),label:"Reference value"},null,8,["modelValue","disabled","parse"])):r.createCommentVNode("",!0),e.value.filter.type==="string_matches"||e.value.filter.type==="string_doesNotMatch"?(r.openBlock(),r.createBlock(r.unref(jr),{key:3,modelValue:e.value.filter.reference,"onUpdate:modelValue":c[7]||(c[7]=d=>e.value.filter.reference=d),disabled:l.disabled,parse:r.unref(LB),label:"Reference value"},null,8,["modelValue","disabled","parse"])):r.createCommentVNode("",!0),e.value.filter.type==="string_containsFuzzyMatch"?(r.openBlock(),r.createElementBlock(r.Fragment,{key:4},[r.createVNode(r.unref(jr),{modelValue:e.value.filter.reference,"onUpdate:modelValue":c[8]||(c[8]=d=>e.value.filter.reference=d),disabled:l.disabled,parse:d=>r.unref(Oh)(r.unref(o),d),label:"Reference value"},null,8,["modelValue","disabled","parse"]),r.createVNode(r.unref(qp),{modelValue:e.value.filter.maxEdits,"onUpdate:modelValue":c[9]||(c[9]=d=>e.value.filter.maxEdits=d),max:5,disabled:l.disabled,breakpoints:"",label:"Maximum nuber of substitutions and indels"},null,8,["modelValue","disabled"]),r.createVNode(r.unref(Ps),{modelValue:e.value.filter.substitutionsOnly,"onUpdate:modelValue":c[10]||(c[10]=d=>e.value.filter.substitutionsOnly=d),disabled:l.disabled,label:"Substitutions only"},null,8,["modelValue","disabled"]),r.createVNode(r.unref(wo),{modelValue:e.value.filter.wildcard,"onUpdate:modelValue":c[11]||(c[11]=d=>e.value.filter.wildcard=d),disabled:l.disabled,options:r.unref(OB)(r.unref(o),e.value.filter.reference),clearable:"",label:"Wildcard symbol"},null,8,["modelValue","disabled","options"])],64)):r.createCommentVNode("",!0)]))}}),$B={class:"d-flex flex-column gap-24"},zB={key:0,class:"text-subtitle-m",style:{color:"var(--txt-mask)"}},UB=r.defineComponent({__name:"PlTableAddFilter",props:r.mergeModels({columnsById:{},columnOptions:{},filterOptions:{},makeFilter:{type:Function}},{modelValue:{type:Boolean,required:!0},modelModifiers:{}}),emits:r.mergeModels(["addFilter"],["update:modelValue"]),setup(t,{emit:e}){const n=r.useModel(t,"modelValue"),o=t,{columnsById:i,columnOptions:l,filterOptions:c}=r.toRefs(o),d=e,p=r.ref(),h=r.ref();r.watch(()=>p.value,b=>{b?h.value=o.makeFilter(b):h.value=void 0});const m=()=>{p.value=void 0,n.value=!1},y=()=>{h.value&&(d("addFilter",h.value),m())};return(b,w)=>(r.openBlock(),r.createBlock(r.unref(Bs),{modelValue:n.value,"onUpdate:modelValue":w[2]||(w[2]=S=>n.value=S),"close-on-outside-click":!1},{title:r.withCtx(()=>w[3]||(w[3]=[r.createTextVNode("Add Filter")])),actions:r.withCtx(()=>[r.createVNode(r.unref(Ts),{disabled:!h.value,onClick:y},{default:r.withCtx(()=>w[4]||(w[4]=[r.createTextVNode("Add Filter")])),_:1},8,["disabled"]),r.createVNode(r.unref(vo),{"justify-center":!1,onClick:m},{default:r.withCtx(()=>w[5]||(w[5]=[r.createTextVNode("Cancel")])),_:1})]),default:r.withCtx(()=>[r.createElementVNode("div",$B,[r.createVNode(r.unref(wo),{modelValue:p.value,"onUpdate:modelValue":w[0]||(w[0]=S=>p.value=S),options:r.unref(l),label:"Column",placeholder:"Choose..."},null,8,["modelValue","options"]),h.value?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",zB,"Choose a column to view and adjust its options")),h.value?(r.openBlock(),r.createBlock(Mh,{key:1,modelValue:h.value,"onUpdate:modelValue":w[1]||(w[1]=S=>h.value=S),column:r.unref(i)[h.value.columnId],options:r.unref(c)[h.value.columnId]},null,8,["modelValue","column","options"])):r.createCommentVNode("",!0)])]),_:1},8,["modelValue"]))}}),ZB=["onClick"],WB={class:"pl-filter-manager__expand-icon"},jB={class:"pl-filter-manager__title flex-grow-1 text-s-btn"},HB={class:"pl-filter-manager__actions d-flex gap-12"},qB=["onClick"],KB=["onClick"],YB={class:"pl-filter-manager__content d-flex gap-24 p-24 flex-column"},XB={class:"d-flex justify-center"},JB=["onClick"],QB={class:"pl-filter-manager__add-btn-icon"},eP={key:0},tP=r.defineComponent({__name:"PlTableFilters",props:r.mergeModels({columns:{},restrictions:{},defaults:{}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=r.useModel(t,"modelValue"),n=t,{columns:o,restrictions:i,defaults:l}=r.toRefs(n),c=r.computed(()=>{const $=o.value.filter(U=>{const k=U.type;switch(k){case"axis":return U.spec.type!=="Bytes";case"column":return U.spec.valueType!=="Bytes";default:throw Error(`unsupported data type: ${k}`)}}),j={};for(const U of $)j[BB(U)]=U;return j}),d=r.computed(()=>{const $=i.value??[],j={};for(const[U,k]of Object.entries(c.value)){const x=ze.find($,B=>ze.isEqual(B.column.id,k.id));x&&(j[U]=x.allowedFilterTypes)}return j}),p=r.computed(()=>{const $=l.value??[],j={};for(const[U,k]of Object.entries(c.value)){const x=ze.find($,B=>ze.isEqual(B.column.id,k.id));x&&(j[U]={columnId:U,filter:x.default,disabled:!1})}return j});(()=>{let $=e.value.state;typeof $=="object"&&!Array.isArray($)&&(e.value.state=Object.entries($).map(([j,U])=>({columnId:j,filter:U,disabled:!1})))})();const h=$=>$??Object.values(p.value),m=r.reactive({state:h(e.value.state)});r.watch(()=>e.value,$=>{ze.isEqual(m.state,$.state)||(m.state=h($.state))}),r.watch(()=>m,$=>{ze.isEqual($.state,e.value.state)||(e.value={state:ze.cloneDeep($.state),filters:$.state.filter(j=>!j.disabled).map(j=>{const U=c.value[j.columnId],{spec:k,...x}=U;return{type:"bySingleColumnV2",column:x,predicate:MB(U,j.filter)}})})},{immediate:!0,deep:!0}),r.watch(()=>c.value,$=>{Object.keys($).length===0&&m.state!==void 0||(m.state=m.state.filter(j=>!!$[j.columnId]))},{immediate:!0});const y=r.computed(()=>Object.keys(c).length>0&&m.state.length>0),b=r.computed(()=>{const $=d.value,j={};for(const[U,k]of Object.entries(c.value)){let B=(k.type==="column"?k.spec.valueType:k.spec.type)==="String"?DB:RB;const G=$[U];G&&(B=B.filter(H=>G.includes(H))),j[U]=B.map(H=>({value:H,text:PB(H)}))}return j}),w=r.computed(()=>ze.some(Object.values(b.value),$=>$.length>0)),S=r.computed(()=>Object.entries(Object.entries(c.value)).filter(([$,[j,U]])=>b.value[j].length>0).filter(([$,[j,U]])=>!m.state.some(k=>k.columnId===j)).map(([$,[j,U]])=>({label:Fh(U,$),value:j}))),M=$=>p.value[$]??{columnId:$,filter:Lh(b.value[$][0].value),disabled:!1},O=$=>{m.state[$]=M(m.state[$].columnId)},v=$=>m.state.splice($,1),I=r.ref(!1),F=r.ref(!1),W=r.ref(!1);r.onMounted(()=>{W.value=!0});const P=r.reactive({}),V=$=>{P[$]?delete P[$]:P[$]=!0},Z=r.ref(!1),J=r.ref();let ae;return r.onMounted(()=>{ae=new ResizeObserver(()=>{var j;const $=(j=J.value)==null?void 0:j.parentElement;$&&(Z.value=$.scrollHeight>$.clientHeight||$.scrollWidth>$.clientWidth)}),J.value&&J.value.parentElement&&ae.observe(J.value.parentElement)}),r.watch(J,($,j)=>{j!=null&&j.parentElement&&ae.unobserve(j.parentElement),$!=null&&$.parentElement&&ae.observe($.parentElement)}),r.onBeforeUnmount(()=>{ae!==void 0&&ae.disconnect()}),($,j)=>(r.openBlock(),r.createElementBlock(r.Fragment,null,[W.value?(r.openBlock(),r.createBlock(r.Teleport,{key:0,to:`#${r.unref(Ql)}`},[r.createVNode(r.unref(vo),{onClick:j[0]||(j[0]=r.withModifiers(U=>I.value=!0,["stop"]))},{append:r.withCtx(()=>[r.createVNode(r.unref(Vs),{name:y.value?"filter-on":"filter"},null,8,["name"])]),default:r.withCtx(()=>[j[5]||(j[5]=r.createTextVNode(" Filters "))]),_:1})],8,["to"])):r.createCommentVNode("",!0),r.createVNode(r.unref(Bs),{modelValue:I.value,"onUpdate:modelValue":j[2]||(j[2]=U=>I.value=U),"close-on-outside-click":!1},{title:r.withCtx(()=>j[6]||(j[6]=[r.createTextVNode("Manage Filters")])),default:r.withCtx(()=>[r.createElementVNode("div",{ref_key:"filterManager",ref:J,class:"pl-filter-manager d-flex flex-column gap-6"},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(m.state,(U,k)=>(r.openBlock(),r.createElementBlock("div",{key:U.columnId,class:r.normalizeClass([{open:P[U.columnId],disabled:U.disabled},"pl-filter-manager__filter"])},[r.createElementVNode("div",{class:"pl-filter-manager__header d-flex align-center gap-8",onClick:x=>V(U.columnId)},[r.createElementVNode("div",WB,[r.createVNode(r.unref(Vt),{name:"chevron-right"})]),r.createElementVNode("div",jB,r.toDisplayString(r.unref(Fh)(c.value[U.columnId],k)),1),r.createElementVNode("div",HB,[r.createElementVNode("div",{class:"pl-filter-manager__toggle",onClick:r.withModifiers(x=>U.disabled=!U.disabled,["stop"])},[r.createVNode(r.unref(At),{name:U.disabled?"view-hide":"view-show"},null,8,["name"])],8,qB),r.createElementVNode("div",{class:"pl-filter-manager__delete",onClick:r.withModifiers(x=>v(k),["stop"])},[r.createVNode(r.unref(At),{name:"close"})],8,KB)])],8,ZB),r.createElementVNode("div",YB,[r.createVNode(Mh,{modelValue:m.state[k],"onUpdate:modelValue":x=>m.state[k]=x,disabled:U.disabled,column:c.value[U.columnId],options:b.value[U.columnId]},null,8,["modelValue","onUpdate:modelValue","disabled","column","options"]),r.createElementVNode("div",XB,[r.createElementVNode("div",{class:r.normalizeClass([{disabled:U.disabled},"pl-filter-manager__revert-btn text-s-btn d-flex align-center gap-8"]),onClick:x=>O(k)},[j[7]||(j[7]=r.createTextVNode(" Revert Settings to Default ")),r.createVNode(r.unref(At),{name:"reverse"})],10,JB)])])],2))),128)),r.createElementVNode("div",{class:r.normalizeClass([{"pt-24":Z.value},"pl-filter-manager__add-action-wrapper"])},[S.value.length>0?(r.openBlock(),r.createElementBlock("div",{key:0,class:"pl-filter-manager__add-btn",onClick:j[1]||(j[1]=U=>F.value=!0)},[r.createElementVNode("div",QB,[r.createVNode(r.unref(Vt),{name:"add"})]),j[8]||(j[8]=r.createElementVNode("div",{class:"pl-filter-manager__add-btn-title text-s-btn"},"Add Filter",-1))])):r.createCommentVNode("",!0)],2),w.value?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",eP,"No filters applicable"))],512)]),_:1},8,["modelValue"]),r.createVNode(UB,{modelValue:F.value,"onUpdate:modelValue":j[3]||(j[3]=U=>F.value=U),"columns-by-id":c.value,"column-options":S.value,"filter-options":b.value,"make-filter":M,onAddFilter:j[4]||(j[4]=U=>m.state.push(U))},null,8,["modelValue","columns-by-id","column-options","filter-options"])],64))}}),Js=new Map;function nP(t,e){const n=r.getCurrentScope()??r.effectScope(),o=n.run(()=>(r.onScopeDispose(()=>{Js.delete(t)}),r.reactive(e())));return o[Symbol.dispose]=()=>{n.stop()},o}function rP(t){const e=Symbol();return()=>(Js.has(e)||Js.set(e,nP(e,t)),Js.get(e))}function oP(t){return r.computed(()=>{try{return tu(t())}catch(e){return{errors:[String(e)],value:void 0}}})}function Gh(t,e,n){const o=r.ref(0),i=r.reactive({loading:r.computed(()=>o.value>0),loadingRef:o,value:void 0,error:void 0}),l=Gg(e);return r.watch(t,async c=>{i.error=void 0,o.value++,l(c).then(d=>{d.ok&&(i.value=d.value)}).catch(d=>{i.value=void 0,i.error=d}).finally(()=>{o.value--})},Object.assign({immediate:!0,deep:!0},n??{})),i}const Ao=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,$h=new Set,mc=typeof process=="object"&&process?process:{},zh=(t,e,n,o)=>{typeof mc.emitWarning=="function"?mc.emitWarning(t,e,n,o):console.error(`[${n}] ${e}: ${t}`)};let Qs=globalThis.AbortController,Uh=globalThis.AbortSignal;if(typeof Qs>"u"){Uh=class{constructor(){We(this,"onabort");We(this,"_onabort",[]);We(this,"reason");We(this,"aborted",!1)}addEventListener(o,i){this._onabort.push(i)}},Qs=class{constructor(){We(this,"signal",new Uh);e()}abort(o){var i,l;if(!this.signal.aborted){this.signal.reason=o,this.signal.aborted=!0;for(const c of this.signal._onabort)c(o);(l=(i=this.signal).onabort)==null||l.call(i,o)}}};let t=((Wh=mc.env)==null?void 0:Wh.LRU_CACHE_IGNORE_AC_WARNING)!=="1";const e=()=>{t&&(t=!1,zh("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",e))}}const iP=t=>!$h.has(t),Tr=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),Zh=t=>Tr(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?ea:null:null;class ea extends Array{constructor(e){super(e),this.fill(0)}}const Xr=class Xr{constructor(e,n){We(this,"heap");We(this,"length");if(!E(Xr,Bo))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new n(e),this.length=0}static create(e){const n=Zh(e);if(!n)return[];ye(Xr,Bo,!0);const o=new Xr(e,n);return ye(Xr,Bo,!1),o}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}};Bo=new WeakMap,Ue(Xr,Bo,!1);let gc=Xr;const Cc=class Cc{constructor(e){Ue(this,re);Ue(this,vn);Ue(this,Ht);Ue(this,wn);Ue(this,bn);Ue(this,Po);Ue(this,Ro);We(this,"ttl");We(this,"ttlResolution");We(this,"ttlAutopurge");We(this,"updateAgeOnGet");We(this,"updateAgeOnHas");We(this,"allowStale");We(this,"noDisposeOnSet");We(this,"noUpdateTTL");We(this,"maxEntrySize");We(this,"sizeCalculation");We(this,"noDeleteOnFetchRejection");We(this,"noDeleteOnStaleGet");We(this,"allowStaleOnFetchAbort");We(this,"allowStaleOnFetchRejection");We(this,"ignoreFetchAbort");Ue(this,ut);Ue(this,xn);Ue(this,dt);Ue(this,Je);Ue(this,Se);Ue(this,Rt);Ue(this,qt);Ue(this,Et);Ue(this,mt);Ue(this,kn);Ue(this,gt);Ue(this,En);Ue(this,Sn);Ue(this,Kt);Ue(this,Tn);Ue(this,Nr);Ue(this,Dt);Ue(this,Jr,()=>{});Ue(this,Jn,()=>{});Ue(this,$i,()=>{});Ue(this,Yt,()=>!1);Ue(this,Qr,e=>{});Ue(this,Do,(e,n,o)=>{});Ue(this,zi,(e,n,o,i)=>{if(o||i)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});We(this,jh,"LRUCache");const{max:n=0,ttl:o,ttlResolution:i=1,ttlAutopurge:l,updateAgeOnGet:c,updateAgeOnHas:d,allowStale:p,dispose:h,disposeAfter:m,noDisposeOnSet:y,noUpdateTTL:b,maxSize:w=0,maxEntrySize:S=0,sizeCalculation:M,fetchMethod:O,memoMethod:v,noDeleteOnFetchRejection:I,noDeleteOnStaleGet:F,allowStaleOnFetchRejection:W,allowStaleOnFetchAbort:P,ignoreFetchAbort:V}=e;if(n!==0&&!Tr(n))throw new TypeError("max option must be a nonnegative integer");const Z=n?Zh(n):Array;if(!Z)throw new Error("invalid max value: "+n);if(ye(this,vn,n),ye(this,Ht,w),this.maxEntrySize=S||E(this,Ht),this.sizeCalculation=M,this.sizeCalculation){if(!E(this,Ht)&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(v!==void 0&&typeof v!="function")throw new TypeError("memoMethod must be a function if defined");if(ye(this,Ro,v),O!==void 0&&typeof O!="function")throw new TypeError("fetchMethod must be a function if specified");if(ye(this,Po,O),ye(this,Nr,!!O),ye(this,dt,new Map),ye(this,Je,new Array(n).fill(void 0)),ye(this,Se,new Array(n).fill(void 0)),ye(this,Rt,new Z(n)),ye(this,qt,new Z(n)),ye(this,Et,0),ye(this,mt,0),ye(this,kn,gc.create(n)),ye(this,ut,0),ye(this,xn,0),typeof h=="function"&&ye(this,wn,h),typeof m=="function"?(ye(this,bn,m),ye(this,gt,[])):(ye(this,bn,void 0),ye(this,gt,void 0)),ye(this,Tn,!!E(this,wn)),ye(this,Dt,!!E(this,bn)),this.noDisposeOnSet=!!y,this.noUpdateTTL=!!b,this.noDeleteOnFetchRejection=!!I,this.allowStaleOnFetchRejection=!!W,this.allowStaleOnFetchAbort=!!P,this.ignoreFetchAbort=!!V,this.maxEntrySize!==0){if(E(this,Ht)!==0&&!Tr(E(this,Ht)))throw new TypeError("maxSize must be a positive integer if specified");if(!Tr(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");ue(this,re,Ng).call(this)}if(this.allowStale=!!p,this.noDeleteOnStaleGet=!!F,this.updateAgeOnGet=!!c,this.updateAgeOnHas=!!d,this.ttlResolution=Tr(i)||i===0?i:1,this.ttlAutopurge=!!l,this.ttl=o||0,this.ttl){if(!Tr(this.ttl))throw new TypeError("ttl must be a positive integer if specified");ue(this,re,zd).call(this)}if(E(this,vn)===0&&this.ttl===0&&E(this,Ht)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!E(this,vn)&&!E(this,Ht)){const J="LRU_CACHE_UNBOUNDED";iP(J)&&($h.add(J),zh("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",J,Cc))}}static unsafeExposeInternals(e){return{starts:E(e,Sn),ttls:E(e,Kt),sizes:E(e,En),keyMap:E(e,dt),keyList:E(e,Je),valList:E(e,Se),next:E(e,Rt),prev:E(e,qt),get head(){return E(e,Et)},get tail(){return E(e,mt)},free:E(e,kn),isBackgroundFetch:n=>{var o;return ue(o=e,re,et).call(o,n)},backgroundFetch:(n,o,i,l)=>{var c;return ue(c=e,re,qa).call(c,n,o,i,l)},moveToTail:n=>{var o;return ue(o=e,re,us).call(o,n)},indexes:n=>{var o;return ue(o=e,re,Or).call(o,n)},rindexes:n=>{var o;return ue(o=e,re,Mr).call(o,n)},isStale:n=>{var o;return E(o=e,Yt).call(o,n)}}}get max(){return E(this,vn)}get maxSize(){return E(this,Ht)}get calculatedSize(){return E(this,xn)}get size(){return E(this,ut)}get fetchMethod(){return E(this,Po)}get memoMethod(){return E(this,Ro)}get dispose(){return E(this,wn)}get disposeAfter(){return E(this,bn)}getRemainingTTL(e){return E(this,dt).has(e)?1/0:0}*entries(){for(const e of ue(this,re,Or).call(this))E(this,Se)[e]!==void 0&&E(this,Je)[e]!==void 0&&!ue(this,re,et).call(this,E(this,Se)[e])&&(yield[E(this,Je)[e],E(this,Se)[e]])}*rentries(){for(const e of ue(this,re,Mr).call(this))E(this,Se)[e]!==void 0&&E(this,Je)[e]!==void 0&&!ue(this,re,et).call(this,E(this,Se)[e])&&(yield[E(this,Je)[e],E(this,Se)[e]])}*keys(){for(const e of ue(this,re,Or).call(this)){const n=E(this,Je)[e];n!==void 0&&!ue(this,re,et).call(this,E(this,Se)[e])&&(yield n)}}*rkeys(){for(const e of ue(this,re,Mr).call(this)){const n=E(this,Je)[e];n!==void 0&&!ue(this,re,et).call(this,E(this,Se)[e])&&(yield n)}}*values(){for(const e of ue(this,re,Or).call(this))E(this,Se)[e]!==void 0&&!ue(this,re,et).call(this,E(this,Se)[e])&&(yield E(this,Se)[e])}*rvalues(){for(const e of ue(this,re,Mr).call(this))E(this,Se)[e]!==void 0&&!ue(this,re,et).call(this,E(this,Se)[e])&&(yield E(this,Se)[e])}[(Hh=Symbol.iterator,jh=Symbol.toStringTag,Hh)](){return this.entries()}find(e,n={}){for(const o of ue(this,re,Or).call(this)){const i=E(this,Se)[o],l=ue(this,re,et).call(this,i)?i.__staleWhileFetching:i;if(l!==void 0&&e(l,E(this,Je)[o],this))return this.get(E(this,Je)[o],n)}}forEach(e,n=this){for(const o of ue(this,re,Or).call(this)){const i=E(this,Se)[o],l=ue(this,re,et).call(this,i)?i.__staleWhileFetching:i;l!==void 0&&e.call(n,l,E(this,Je)[o],this)}}rforEach(e,n=this){for(const o of ue(this,re,Mr).call(this)){const i=E(this,Se)[o],l=ue(this,re,et).call(this,i)?i.__staleWhileFetching:i;l!==void 0&&e.call(n,l,E(this,Je)[o],this)}}purgeStale(){let e=!1;for(const n of ue(this,re,Mr).call(this,{allowStale:!0}))E(this,Yt).call(this,n)&&(ue(this,re,Gr).call(this,E(this,Je)[n],"expire"),e=!0);return e}info(e){const n=E(this,dt).get(e);if(n===void 0)return;const o=E(this,Se)[n],i=ue(this,re,et).call(this,o)?o.__staleWhileFetching:o;if(i===void 0)return;const l={value:i};if(E(this,Kt)&&E(this,Sn)){const c=E(this,Kt)[n],d=E(this,Sn)[n];if(c&&d){const p=c-(Ao.now()-d);l.ttl=p,l.start=Date.now()}}return E(this,En)&&(l.size=E(this,En)[n]),l}dump(){const e=[];for(const n of ue(this,re,Or).call(this,{allowStale:!0})){const o=E(this,Je)[n],i=E(this,Se)[n],l=ue(this,re,et).call(this,i)?i.__staleWhileFetching:i;if(l===void 0||o===void 0)continue;const c={value:l};if(E(this,Kt)&&E(this,Sn)){c.ttl=E(this,Kt)[n];const d=Ao.now()-E(this,Sn)[n];c.start=Math.floor(Date.now()-d)}E(this,En)&&(c.size=E(this,En)[n]),e.unshift([o,c])}return e}load(e){this.clear();for(const[n,o]of e){if(o.start){const i=Date.now()-o.start;o.start=Ao.now()-i}this.set(n,o.value,o)}}set(e,n,o={}){var b,w,S,M,O;if(n===void 0)return this.delete(e),this;const{ttl:i=this.ttl,start:l,noDisposeOnSet:c=this.noDisposeOnSet,sizeCalculation:d=this.sizeCalculation,status:p}=o;let{noUpdateTTL:h=this.noUpdateTTL}=o;const m=E(this,zi).call(this,e,n,o.size||0,d);if(this.maxEntrySize&&m>this.maxEntrySize)return p&&(p.set="miss",p.maxEntrySizeExceeded=!0),ue(this,re,Gr).call(this,e,"set"),this;let y=E(this,ut)===0?void 0:E(this,dt).get(e);if(y===void 0)y=E(this,ut)===0?E(this,mt):E(this,kn).length!==0?E(this,kn).pop():E(this,ut)===E(this,vn)?ue(this,re,Ha).call(this,!1):E(this,ut),E(this,Je)[y]=e,E(this,Se)[y]=n,E(this,dt).set(e,y),E(this,Rt)[E(this,mt)]=y,E(this,qt)[y]=E(this,mt),ye(this,mt,y),ja(this,ut)._++,E(this,Do).call(this,y,m,p),p&&(p.set="add"),h=!1;else{ue(this,re,us).call(this,y);const v=E(this,Se)[y];if(n!==v){if(E(this,Nr)&&ue(this,re,et).call(this,v)){v.__abortController.abort(new Error("replaced"));const{__staleWhileFetching:I}=v;I!==void 0&&!c&&(E(this,Tn)&&((b=E(this,wn))==null||b.call(this,I,e,"set")),E(this,Dt)&&((w=E(this,gt))==null||w.push([I,e,"set"])))}else c||(E(this,Tn)&&((S=E(this,wn))==null||S.call(this,v,e,"set")),E(this,Dt)&&((M=E(this,gt))==null||M.push([v,e,"set"])));if(E(this,Qr).call(this,y),E(this,Do).call(this,y,m,p),E(this,Se)[y]=n,p){p.set="replace";const I=v&&ue(this,re,et).call(this,v)?v.__staleWhileFetching:v;I!==void 0&&(p.oldValue=I)}}else p&&(p.set="update")}if(i!==0&&!E(this,Kt)&&ue(this,re,zd).call(this),E(this,Kt)&&(h||E(this,$i).call(this,y,i,l),p&&E(this,Jn).call(this,p,y)),!c&&E(this,Dt)&&E(this,gt)){const v=E(this,gt);let I;for(;I=v==null?void 0:v.shift();)(O=E(this,bn))==null||O.call(this,...I)}return this}pop(){var e;try{for(;E(this,ut);){const n=E(this,Se)[E(this,Et)];if(ue(this,re,Ha).call(this,!0),ue(this,re,et).call(this,n)){if(n.__staleWhileFetching)return n.__staleWhileFetching}else if(n!==void 0)return n}}finally{if(E(this,Dt)&&E(this,gt)){const n=E(this,gt);let o;for(;o=n==null?void 0:n.shift();)(e=E(this,bn))==null||e.call(this,...o)}}}has(e,n={}){const{updateAgeOnHas:o=this.updateAgeOnHas,status:i}=n,l=E(this,dt).get(e);if(l!==void 0){const c=E(this,Se)[l];if(ue(this,re,et).call(this,c)&&c.__staleWhileFetching===void 0)return!1;if(E(this,Yt).call(this,l))i&&(i.has="stale",E(this,Jn).call(this,i,l));else return o&&E(this,Jr).call(this,l),i&&(i.has="hit",E(this,Jn).call(this,i,l)),!0}else i&&(i.has="miss");return!1}peek(e,n={}){const{allowStale:o=this.allowStale}=n,i=E(this,dt).get(e);if(i===void 0||!o&&E(this,Yt).call(this,i))return;const l=E(this,Se)[i];return ue(this,re,et).call(this,l)?l.__staleWhileFetching:l}async fetch(e,n={}){const{allowStale:o=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:l=this.noDeleteOnStaleGet,ttl:c=this.ttl,noDisposeOnSet:d=this.noDisposeOnSet,size:p=0,sizeCalculation:h=this.sizeCalculation,noUpdateTTL:m=this.noUpdateTTL,noDeleteOnFetchRejection:y=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:b=this.allowStaleOnFetchRejection,ignoreFetchAbort:w=this.ignoreFetchAbort,allowStaleOnFetchAbort:S=this.allowStaleOnFetchAbort,context:M,forceRefresh:O=!1,status:v,signal:I}=n;if(!E(this,Nr))return v&&(v.fetch="get"),this.get(e,{allowStale:o,updateAgeOnGet:i,noDeleteOnStaleGet:l,status:v});const F={allowStale:o,updateAgeOnGet:i,noDeleteOnStaleGet:l,ttl:c,noDisposeOnSet:d,size:p,sizeCalculation:h,noUpdateTTL:m,noDeleteOnFetchRejection:y,allowStaleOnFetchRejection:b,allowStaleOnFetchAbort:S,ignoreFetchAbort:w,status:v,signal:I};let W=E(this,dt).get(e);if(W===void 0){v&&(v.fetch="miss");const P=ue(this,re,qa).call(this,e,W,F,M);return P.__returned=P}else{const P=E(this,Se)[W];if(ue(this,re,et).call(this,P)){const $=o&&P.__staleWhileFetching!==void 0;return v&&(v.fetch="inflight",$&&(v.returnedStale=!0)),$?P.__staleWhileFetching:P.__returned=P}const V=E(this,Yt).call(this,W);if(!O&&!V)return v&&(v.fetch="hit"),ue(this,re,us).call(this,W),i&&E(this,Jr).call(this,W),v&&E(this,Jn).call(this,v,W),P;const Z=ue(this,re,qa).call(this,e,W,F,M),ae=Z.__staleWhileFetching!==void 0&&o;return v&&(v.fetch=V?"stale":"refresh",ae&&V&&(v.returnedStale=!0)),ae?Z.__staleWhileFetching:Z.__returned=Z}}async forceFetch(e,n={}){const o=await this.fetch(e,n);if(o===void 0)throw new Error("fetch() returned undefined");return o}memo(e,n={}){const o=E(this,Ro);if(!o)throw new Error("no memoMethod provided to constructor");const{context:i,forceRefresh:l,...c}=n,d=this.get(e,c);if(!l&&d!==void 0)return d;const p=o(e,d,{options:c,context:i});return this.set(e,p,c),p}get(e,n={}){const{allowStale:o=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:l=this.noDeleteOnStaleGet,status:c}=n,d=E(this,dt).get(e);if(d!==void 0){const p=E(this,Se)[d],h=ue(this,re,et).call(this,p);return c&&E(this,Jn).call(this,c,d),E(this,Yt).call(this,d)?(c&&(c.get="stale"),h?(c&&o&&p.__staleWhileFetching!==void 0&&(c.returnedStale=!0),o?p.__staleWhileFetching:void 0):(l||ue(this,re,Gr).call(this,e,"expire"),c&&o&&(c.returnedStale=!0),o?p:void 0)):(c&&(c.get="hit"),h?p.__staleWhileFetching:(ue(this,re,us).call(this,d),i&&E(this,Jr).call(this,d),p))}else c&&(c.get="miss")}delete(e){return ue(this,re,Gr).call(this,e,"delete")}clear(){return ue(this,re,Wd).call(this,"delete")}};vn=new WeakMap,Ht=new WeakMap,wn=new WeakMap,bn=new WeakMap,Po=new WeakMap,Ro=new WeakMap,ut=new WeakMap,xn=new WeakMap,dt=new WeakMap,Je=new WeakMap,Se=new WeakMap,Rt=new WeakMap,qt=new WeakMap,Et=new WeakMap,mt=new WeakMap,kn=new WeakMap,gt=new WeakMap,En=new WeakMap,Sn=new WeakMap,Kt=new WeakMap,Tn=new WeakMap,Nr=new WeakMap,Dt=new WeakMap,re=new WeakSet,zd=function(){const e=new ea(E(this,vn)),n=new ea(E(this,vn));ye(this,Kt,e),ye(this,Sn,n),ye(this,$i,(l,c,d=Ao.now())=>{if(n[l]=c!==0?d:0,e[l]=c,c!==0&&this.ttlAutopurge){const p=setTimeout(()=>{E(this,Yt).call(this,l)&&ue(this,re,Gr).call(this,E(this,Je)[l],"expire")},c+1);p.unref&&p.unref()}}),ye(this,Jr,l=>{n[l]=e[l]!==0?Ao.now():0}),ye(this,Jn,(l,c)=>{if(e[c]){const d=e[c],p=n[c];if(!d||!p)return;l.ttl=d,l.start=p,l.now=o||i();const h=l.now-p;l.remainingTTL=d-h}});let o=0;const i=()=>{const l=Ao.now();if(this.ttlResolution>0){o=l;const c=setTimeout(()=>o=0,this.ttlResolution);c.unref&&c.unref()}return l};this.getRemainingTTL=l=>{const c=E(this,dt).get(l);if(c===void 0)return 0;const d=e[c],p=n[c];if(!d||!p)return 1/0;const h=(o||i())-p;return d-h},ye(this,Yt,l=>{const c=n[l],d=e[l];return!!d&&!!c&&(o||i())-c>d})},Jr=new WeakMap,Jn=new WeakMap,$i=new WeakMap,Yt=new WeakMap,Ng=function(){const e=new ea(E(this,vn));ye(this,xn,0),ye(this,En,e),ye(this,Qr,n=>{ye(this,xn,E(this,xn)-e[n]),e[n]=0}),ye(this,zi,(n,o,i,l)=>{if(ue(this,re,et).call(this,o))return 0;if(!Tr(i))if(l){if(typeof l!="function")throw new TypeError("sizeCalculation must be a function");if(i=l(o,n),!Tr(i))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return i}),ye(this,Do,(n,o,i)=>{if(e[n]=o,E(this,Ht)){const l=E(this,Ht)-e[n];for(;E(this,xn)>l;)ue(this,re,Ha).call(this,!0)}ye(this,xn,E(this,xn)+e[n]),i&&(i.entrySize=o,i.totalCalculatedSize=E(this,xn))})},Qr=new WeakMap,Do=new WeakMap,zi=new WeakMap,Or=function*({allowStale:e=this.allowStale}={}){if(E(this,ut))for(let n=E(this,mt);!(!ue(this,re,Ud).call(this,n)||((e||!E(this,Yt).call(this,n))&&(yield n),n===E(this,Et)));)n=E(this,qt)[n]},Mr=function*({allowStale:e=this.allowStale}={}){if(E(this,ut))for(let n=E(this,Et);!(!ue(this,re,Ud).call(this,n)||((e||!E(this,Yt).call(this,n))&&(yield n),n===E(this,mt)));)n=E(this,Rt)[n]},Ud=function(e){return e!==void 0&&E(this,dt).get(E(this,Je)[e])===e},Ha=function(e){var l,c;const n=E(this,Et),o=E(this,Je)[n],i=E(this,Se)[n];return E(this,Nr)&&ue(this,re,et).call(this,i)?i.__abortController.abort(new Error("evicted")):(E(this,Tn)||E(this,Dt))&&(E(this,Tn)&&((l=E(this,wn))==null||l.call(this,i,o,"evict")),E(this,Dt)&&((c=E(this,gt))==null||c.push([i,o,"evict"]))),E(this,Qr).call(this,n),e&&(E(this,Je)[n]=void 0,E(this,Se)[n]=void 0,E(this,kn).push(n)),E(this,ut)===1?(ye(this,Et,ye(this,mt,0)),E(this,kn).length=0):ye(this,Et,E(this,Rt)[n]),E(this,dt).delete(o),ja(this,ut)._--,n},qa=function(e,n,o,i){const l=n===void 0?void 0:E(this,Se)[n];if(ue(this,re,et).call(this,l))return l;const c=new Qs,{signal:d}=o;d==null||d.addEventListener("abort",()=>c.abort(d.reason),{signal:c.signal});const p={signal:c.signal,options:o,context:i},h=(M,O=!1)=>{const{aborted:v}=c.signal,I=o.ignoreFetchAbort&&M!==void 0;if(o.status&&(v&&!O?(o.status.fetchAborted=!0,o.status.fetchError=c.signal.reason,I&&(o.status.fetchAbortIgnored=!0)):o.status.fetchResolved=!0),v&&!I&&!O)return y(c.signal.reason);const F=w;return E(this,Se)[n]===w&&(M===void 0?F.__staleWhileFetching?E(this,Se)[n]=F.__staleWhileFetching:ue(this,re,Gr).call(this,e,"fetch"):(o.status&&(o.status.fetchUpdated=!0),this.set(e,M,p.options))),M},m=M=>(o.status&&(o.status.fetchRejected=!0,o.status.fetchError=M),y(M)),y=M=>{const{aborted:O}=c.signal,v=O&&o.allowStaleOnFetchAbort,I=v||o.allowStaleOnFetchRejection,F=I||o.noDeleteOnFetchRejection,W=w;if(E(this,Se)[n]===w&&(!F||W.__staleWhileFetching===void 0?ue(this,re,Gr).call(this,e,"fetch"):v||(E(this,Se)[n]=W.__staleWhileFetching)),I)return o.status&&W.__staleWhileFetching!==void 0&&(o.status.returnedStale=!0),W.__staleWhileFetching;if(W.__returned===W)throw M},b=(M,O)=>{var I;const v=(I=E(this,Po))==null?void 0:I.call(this,e,l,p);v&&v instanceof Promise&&v.then(F=>M(F===void 0?void 0:F),O),c.signal.addEventListener("abort",()=>{(!o.ignoreFetchAbort||o.allowStaleOnFetchAbort)&&(M(void 0),o.allowStaleOnFetchAbort&&(M=F=>h(F,!0)))})};o.status&&(o.status.fetchDispatched=!0);const w=new Promise(b).then(h,m),S=Object.assign(w,{__abortController:c,__staleWhileFetching:l,__returned:void 0});return n===void 0?(this.set(e,S,{...p.options,status:void 0}),n=E(this,dt).get(e)):E(this,Se)[n]=S,S},et=function(e){if(!E(this,Nr))return!1;const n=e;return!!n&&n instanceof Promise&&n.hasOwnProperty("__staleWhileFetching")&&n.__abortController instanceof Qs},Zd=function(e,n){E(this,qt)[n]=e,E(this,Rt)[e]=n},us=function(e){e!==E(this,mt)&&(e===E(this,Et)?ye(this,Et,E(this,Rt)[e]):ue(this,re,Zd).call(this,E(this,qt)[e],E(this,Rt)[e]),ue(this,re,Zd).call(this,E(this,mt),e),ye(this,mt,e))},Gr=function(e,n){var i,l,c,d;let o=!1;if(E(this,ut)!==0){const p=E(this,dt).get(e);if(p!==void 0)if(o=!0,E(this,ut)===1)ue(this,re,Wd).call(this,n);else{E(this,Qr).call(this,p);const h=E(this,Se)[p];if(ue(this,re,et).call(this,h)?h.__abortController.abort(new Error("deleted")):(E(this,Tn)||E(this,Dt))&&(E(this,Tn)&&((i=E(this,wn))==null||i.call(this,h,e,n)),E(this,Dt)&&((l=E(this,gt))==null||l.push([h,e,n]))),E(this,dt).delete(e),E(this,Je)[p]=void 0,E(this,Se)[p]=void 0,p===E(this,mt))ye(this,mt,E(this,qt)[p]);else if(p===E(this,Et))ye(this,Et,E(this,Rt)[p]);else{const m=E(this,qt)[p];E(this,Rt)[m]=E(this,Rt)[p];const y=E(this,Rt)[p];E(this,qt)[y]=E(this,qt)[p]}ja(this,ut)._--,E(this,kn).push(p)}}if(E(this,Dt)&&((c=E(this,gt))!=null&&c.length)){const p=E(this,gt);let h;for(;h=p==null?void 0:p.shift();)(d=E(this,bn))==null||d.call(this,...h)}return o},Wd=function(e){var n,o,i;for(const l of ue(this,re,Mr).call(this,{allowStale:!0})){const c=E(this,Se)[l];if(ue(this,re,et).call(this,c))c.__abortController.abort(new Error("deleted"));else{const d=E(this,Je)[l];E(this,Tn)&&((n=E(this,wn))==null||n.call(this,c,d,e)),E(this,Dt)&&((o=E(this,gt))==null||o.push([c,d,e]))}}if(E(this,dt).clear(),E(this,Se).fill(void 0),E(this,Je).fill(void 0),E(this,Kt)&&E(this,Sn)&&(E(this,Kt).fill(0),E(this,Sn).fill(0)),E(this,En)&&E(this,En).fill(0),ye(this,Et,0),ye(this,mt,0),E(this,kn).length=0,ye(this,xn,0),ye(this,ut,0),E(this,Dt)&&E(this,gt)){const l=E(this,gt);let c;for(;c=l==null?void 0:l.shift();)(i=E(this,bn))==null||i.call(this,...c)}};let yc=Cc;const sP={cacheSize:15e6};class aP{constructor(e){We(this,"_str");We(this,"_rawJson");We(this,"_zodSchema");We(this,"_validatedJson");this.bytes=e}get str(){return this._str===void 0&&(this._str=new TextDecoder().decode(this.bytes)),this._str}get rawJson(){return this._rawJson===void 0&&(this._rawJson=JSON.parse(this.str)),this._rawJson}validatedJson(e){return this._zodSchema!==e&&(this._validatedJson=e.parse(this.rawJson),this._zodSchema=e),this._validatedJson}}const eo=class eo{constructor(e){We(this,"fileDataCache");We(this,"fileDataRefs",new Map);const n={...sP,...e??{}};this.fileDataCache=new yc({maxSize:n.cacheSize,fetchMethod:async o=>new aP(await yu().blobDriver.getContent(o)),sizeCalculation:o=>o.bytes.length,dispose:(o,i)=>{this.fileDataRefs.delete(i)}})}getDataRef(e){const n=this.fileDataRefs.get(e);if(n!==void 0)return n;const o=r.shallowRef();return this.fileDataRefs.set(e,o),(async()=>{try{const i=await this.fileDataCache.fetch(e);o.value=i}catch(i){console.error(i)}})(),o}getContentBytes(e){if(e===void 0)return;const n=this.getDataRef(e);return r.computed(()=>{var o;return(o=n.value)==null?void 0:o.bytes})}getContentString(e){if(e===void 0)return;const n=this.getDataRef(e);return r.computed(()=>{var o;return(o=n==null?void 0:n.value)==null?void 0:o.str})}getContentJson(e,n){if(e===void 0)return;const o=this.getDataRef(e);return r.computed(()=>{var i,l;return n===void 0?(i=o==null?void 0:o.value)==null?void 0:i.rawJson:(l=o==null?void 0:o.value)==null?void 0:l.validatedJson(n)})}static getContentBytes(e){return eo.globalInstance.getContentBytes(e)}static getContentString(e){return eo.globalInstance.getContentString(e)}static getContentJson(e,n){return eo.globalInstance.getContentJson(e,n)}};We(eo,"globalInstance",new eo);let _c=eo;L.AgGridTheme=$u,L.BlockLayout=JN,L.ContextProvider=LS,L.DataTable=y0,L.DemoData=LN,L.DropdownListItem=Co,L.DropdownOverlay=$l,L.LongText=Ml,L.MultiError=Xa,L.PlAccordion=Ik,L.PlAccordionSection=Zk,L.PlAgCellFile=BV,L.PlAgColumnHeader=nh,L.PlAgDataTable=SV,L.PlAgDataTableToolsPanel=xV,L.PlAgGridColumnManager=ah,L.PlAgOverlayLoading=Jp,L.PlAgOverlayNoRows=Qp,L.PlAgTextAndButtonCell=DV,L.PlAlert=q0,L.PlBlockPage=D0,L.PlBtnAccent=pw,L.PlBtnDanger=fw,L.PlBtnGhost=vo,L.PlBtnGroup=pp,L.PlBtnLink=_w,L.PlBtnPrimary=Ts,L.PlBtnSecondary=Rl,L.PlBtnSplit=aw,L.PlCheckbox=Wx,L.PlCheckboxGroup=Kx,L.PlChip=zl,L.PlCloseModalBtn=xp,L.PlContainer=F0,L.PlDialogModal=Zl,L.PlDropdown=wo,L.PlDropdownLegacy=gx,L.PlDropdownLine=bp,L.PlDropdownMulti=Ux,L.PlDropdownRef=Wb,L.PlEditableTitle=zw,L.PlFileDialog=Ap,L.PlFileInput=jp,L.PlGrid=z0,L.PlIcon16=Wr,L.PlIcon24=Vs,L.PlLogView=Ep,L.PlMaskIcon16=Vt,L.PlMaskIcon24=At,L.PlNotificationAlert=Hp,L.PlNumberField=Nx,L.PlProgressBar=wx,L.PlRow=O0,L.PlSearchField=_p,L.PlSectionSeparator=Sp,L.PlSlideModal=Bs,L.PlSpacer=dp,L.PlTableFilters=tP,L.PlTabs=Vk,L.PlTextArea=Vb,L.PlTextField=jr,L.PlToggleSwitch=Ps,L.PlTooltip=Ct,L.ReactiveFileContent=_c,L.Scrollable=S1,L.Slider=qp,L.SliderRange=b1,L.SliderRangeTriple=d1,L.ThemeSwitcher=T0,L.UnresolvedError=Ya,L.ValueOrErrorsComponent=VV,L.activateAgGrid=Gu,L.animate=op,L.animateInfinite=b0,L.call=Qu,L.computedResult=oP,L.createModel=rl,L.debounce=ip,L.defineApp=jC,L.defineStore=rP,L.delay=ep,L.detectOutside=Ab,L.ensureError=el,L.eventListener=Gl,L.formatZodError=nl,L.getElementScrollPosition=wp,L.identity=Qa,L.isDefined=Zg,L.isElementVisible=vp,L.isJsonEqual=Ja,L.isZodError=tl,L.listToOptions=x0,L.makeEaseInOut=w0,L.makeEaseOut=rp,L.maskIcons16=IN,L.maskIcons24=FN,L.normalizeListOptions=_r,L.notEmpty=Nl,L.randomInt=np,L.randomString=v0,L.requestTick=Vl,L.scrollIntoView=As,L.showContextMenu=El,L.throttle=sp,L.timeout=tp,L.unwrapOptionalResult=Ug,L.unwrapValueOrErrors=eu,L.useClickOutside=Ns,L.useDraggable=QS,L.useEventListener=st,L.useFormState=XS,L.useHover=Xu,L.useInterval=YS,L.useLabelNotch=Yn,L.useLocalStorage=ap,L.useMouse=Yu,L.useMouseCapture=yr,L.usePosition=Ci,L.useQuery=JS,L.useResizeObserver=Kp,L.useScroll=qS,L.useSdkPlugin=vl,L.useSortable=Xp,L.useTheme=cp,L.useWatchFetch=Gh,L.wrapOptionalResult=tu,L.wrapValueOrErrors=zg,Object.defineProperty(L,Symbol.toStringTag,{value:"Module"})});