@platforma-sdk/ui-vue 1.14.1 → 1.14.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/lib.umd.cjs CHANGED
@@ -1,91 +1,91 @@
1
- (function(M,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):(M=typeof globalThis<"u"?globalThis:M||self,r(M.SdkVueLib={},M.Vue,M.core$1,M.core,M.clientSideRowModel,M.infiniteRowModel,M.serverSideRowModel,M.csvExport,M.clipboard,M.rangeSelection,M.richSelect,M.menu,M.excelExport,M.theming,M.vue3))})(this,function(M,r,Me,b,os,ym,hd,_m,fd,md,Cm,vm,wm,gd,bm){"use strict";var NM=Object.defineProperty;var fm=M=>{throw TypeError(M)};var AM=(M,r,Me)=>r in M?NM(M,r,{enumerable:!0,configurable:!0,writable:!0,value:Me}):M[r]=Me;var $e=(M,r,Me)=>AM(M,typeof r!="symbol"?r+"":r,Me),ld=(M,r,Me)=>r.has(M)||fm("Cannot "+Me);var w=(M,r,Me)=>(ld(M,r,"read from private field"),Me?Me.call(M):r.get(M)),Ge=(M,r,Me)=>r.has(M)?fm("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(M):r.set(M,Me),me=(M,r,Me,b)=>(ld(M,r,"write to private field"),b?b.call(M,Me):r.set(M,Me),Me),ce=(M,r,Me)=>(ld(M,r,"access private method"),Me);var Ba=(M,r,Me,b)=>({set _(os){me(M,r,os,Me)},get _(){return w(M,r,b)}});var Dp,bo,Fp,Rp,hn,zt,fn,mn,xo,ko,lt,gn,st,je,be,Tt,$t,bt,pt,yn,ht,_n,Cn,Zt,vn,_r,Bt,ee,cd,$r,Zn,Pi,Ut,gm,Zr,So,Di,Vr,Nr,dd,Va,Na,Ke,ud,rs,Ar,pd;function xm(t,e){if(t==null)throw Error(e??"Empty (null | undefined) value");return t}function km(t,e){return t=Math.ceil(t),e=Math.floor(e),Math.floor(Math.random()*(e-t))+t}function Sm(t){let e="";for(let n=0;n<t;n++)e+=String.fromCharCode(km(65,91));return e}function Em(){return Sm(42)}const yd=Array.isArray;function Tm(t){return t!==null&&typeof t=="object"}function _d(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 Tn(t){if(Array.isArray(t)){const e=[];for(let n=0;n<t.length;n++)e[n]=Tn(t[n]);return e}else if(Tm(t)){const e={};return Object.keys(t).forEach(n=>{e[n]=Tn(t[n])}),e}else return t}function Cd(t,e){return new Set([...Object.keys(t),...Object.keys(e)]).forEach(n=>{const o=t[n],s=e[n];_d(o)&&_d(s)||yd(o)&&yd(s)&&o.length===s.length?Cd(o,s):t[n]=s}),t}function Aa(t,e,n=!0){let o=0,s;return function(...l){s=()=>{t.apply(this,l),o=new Date().getTime()+e,s=null,n&&setTimeout(()=>{s&&s()},e)},new Date().getTime()>o&&s()}}function Bm(t){let e=0n,n;return async function(...o){const s=++e;try{await n}catch{}if(e!==s)return{ok:!1};const l=t(...o);return n=l,{ok:!0,value:await l}}}var $o=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Vm(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Nm=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((s,l,c)=>`${s}${c===0?"":","}${t(l===void 0||typeof l=="symbol"?null:l)}`,"")}]`:`{${Object.keys(e).sort().reduce((o,s)=>{if(e[s]===void 0||typeof e[s]=="symbol")return o;const l=o.length===0?"":",";return`${o}${l}${t(s)}:${t(e[s])}`},"")}}`};const Pr=Vm(Nm);class Pa extends Error{}class Da 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,hs,kg,Zd,Sg,Wd,jd,Eg,Tg,Ng,Hd,Ag){"use strict";var VM=Object.defineProperty;var wg=L=>{throw TypeError(L)};var BM=(L,r,Me)=>r in L?VM(L,r,{enumerable:!0,configurable:!0,writable:!0,value:Me}):L[r]=Me;var je=(L,r,Me)=>BM(L,typeof r!="symbol"?r+"":r,Me),Md=(L,r,Me)=>r.has(L)||wg("Cannot "+Me);var S=(L,r,Me)=>(Md(L,r,"read from private field"),Me?Me.call(L):r.get(L)),Ue=(L,r,Me)=>r.has(L)?wg("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(L):r.set(L,Me),ye=(L,r,Me,T)=>(Md(L,r,"write to private field"),T?T.call(L,Me):r.set(L,Me),Me),pe=(L,r,Me)=>(Md(L,r,"access private method"),Me);var Wa=(L,r,Me,T)=>({set _(hs){ye(L,r,hs,Me)},get _(){return S(L,r,T)}});var Gh,Bo,$h,zh,Cn,jt,wn,bn,Po,Ro,pt,xn,dt,Je,Ee,Pt,Ht,Et,yt,kn,vt,Sn,En,qt,Tn,Tr,Rt,oe,Gd,Xr,Jn,zi,Kt,xg,Yr,Do,Ui,Or,Lr,$d,ja,Ha,et,zd,ps,Mr,Ud;function Vg(t,e){if(t==null)throw Error(e??"Empty (null | undefined) value");return t}function Bg(t,e){return t=Math.ceil(t),e=Math.floor(e),Math.floor(Math.random()*(e-t))+t}function Pg(t){let e="";for(let n=0;n<t;n++)e+=String.fromCharCode(Bg(65,91));return e}function Rg(){return Pg(42)}const qd=Array.isArray;function Dg(t){return t!==null&&typeof t=="object"}function Kd(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(Dg(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];Kd(o)&&Kd(i)||qd(o)&&qd(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 Ig(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 Xo=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Yd(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Fg=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 Gr=Yd(Fg);class Ka extends Error{}class Xa extends Error{constructor(e){super(e.join(`
2
2
  `)),this.errors=e}toString(){return this.errors.join(`
3
- `)}}function Am(t){return{ok:!0,value:t}}function vd(t){if(!t)throw new Pa;if(!t.ok)throw Error(t.errors.join(";"));return t.value}function wd(t){return{value:t,errors:void 0}}function Pm(t){if(t.errors)throw new Da(t.errors);if(!t.value)throw new Pa;return t.value}function Dm(t){return t!==void 0}function Fa(t,e){return Pr(t)===Pr(e)}const Ra=t=>t,Ma=t=>t instanceof Error?t:Error(String(t)),Ia=t=>t.name==="ZodError",Oa=t=>{const{formErrors:e,fieldErrors:n}=t.flatten(),o=Object.entries(n).map(([s,l])=>s+":"+(l==null?void 0:l.join(",")));return e.concat(o).join("; ")};function La(t){const e=t.validate??Ra,{autoSave:n}=t,o=r.ref(),s=r.ref(),l=V=>{s.value={model:Tn(V)}};r.watch(()=>t.get(),V=>l(V),{immediate:!0});const c=()=>{var V;t.onSave(e(Tn((V=s.value)==null?void 0:V.model)))},u=()=>{l(t.get()),o.value=void 0},p=V=>{const I=Ma(V);Ia(I)?o.value=Error(Oa(I)):o.value=I},f=V=>{o.value=void 0;try{e(V),n&&c()}catch(I){p(I)}},m=r.computed({get:()=>{var V;return(V=s.value)==null?void 0:V.model},set(V){l(V),f(V)}});r.watch(s,(V,I)=>{V&&V===I&&f(V.model)},{deep:!0});const _=r.computed(()=>!o.value),x=r.computed(()=>!Fa(t.get(),r.unref(s))),S=r.computed(()=>o.value?o.value.message:"");return r.reactive({model:m,valid:_,isChanged:x,error:o,errorString:S,save:c,revert:u,setError:p})}function Fm(t,e,n){const o=t.validate??Ra,{autoSave:s}=t,l=r.ref(),c=r.ref(),u=G=>{var v;if(n.deepPatchModel){const R=(v=c.value)==null?void 0:v.model,L=Object.assign(Tn(G),e??{});c.value={model:R?Cd(R,L):L,stage:Symbol()}}else c.value={model:Object.assign(Tn(G),e??{}),stage:Symbol()}};r.watch(()=>t.get(),G=>u(G),{immediate:!0});const p=()=>{var G;t.onSave(o(Tn((G=c.value)==null?void 0:G.model)))},f=()=>{u(t.get()),l.value=void 0},m=G=>{const v=Ma(G);Ia(v)?l.value=Error(Oa(v)):l.value=v},_=G=>{l.value=void 0;try{o(G),s&&p()}catch(v){m(v)}},x=r.computed({get:()=>{var G;return(G=c.value)==null?void 0:G.model},set(){throw Error("Cannot replace base model")}});r.watch([()=>({args:x.value.args,ui:x.value.ui}),()=>{var G;return(G=c.value)==null?void 0:G.stage}],([G,v],[R,L])=>{v===L&&_(G)},{deep:!0});const S=r.computed(()=>!l.value),V=r.computed(()=>{var R;const{args:G,ui:v}=((R=r.unref(c))==null?void 0:R.model)??{};return!Fa(t.get(),{args:G,ui:v})}),I=r.computed(()=>l.value?l.value.message:"");return r.reactive({model:x,valid:S,isChanged:V,error:l,errorString:I,save:p,revert:f,setError:m})}const Rm=t=>Object.fromEntries(new URL(t,"http://dummy").searchParams);function Mm(t,e,n){const o=(v,...R)=>{n.debug&&console.log(`%c>>> %c${v}`,"color: orange; font-weight: bold","color: orange",...R)},l=Aa(e.setBlockArgs,100),c=Aa(e.setBlockUiState,100),u=Aa(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(R=>{R.key==="args"&&(p.args=Object.freeze(R.value),o("args patch",p.args)),R.key==="ui"&&(p.ui=Object.freeze(R.value),o("ui patch",p.ui)),R.key==="outputs"&&(p.outputs=Object.freeze(R.value),o("outputs patch",p.outputs)),R.key==="navigationState"&&(p.navigationState=Object.freeze(R.value),o("navigationState patch",p.navigationState))}),await r.nextTick()});const f=()=>Tn(p.args),m=()=>Tn(p.ui),_=()=>Tn(p.navigationState),x={createArgsModel(v={}){return La({get(){return v.transform?v.transform(p.args):p.args},validate:v.validate,autoSave:!0,onSave(R){l(R)}})},createUiModel(v={},R){return La({get(){return v.transform?v.transform(p.ui):p.ui??R()},validate:v.validate,autoSave:!0,onSave(L){c(L)}})},useOutputs(...v){const R=r.reactive({errors:void 0,value:void 0});return r.watch(()=>p.outputs,()=>{try{Object.assign(R,{value:this.unwrapOutputs(...v),errors:void 0})}catch(L){Object.assign(R,{value:void 0,errors:[String(L)]})}},{immediate:!0,deep:!0}),R},unwrapOutputs(...v){const R=p.outputs,L=v.map(F=>[F,vd(R[F])]);return Object.fromEntries(L)},getOutputField(v){return p.outputs[v]},getOutputFieldOkOptional(v){console.warn("use reactive app.outputValues.fieldName instead instead of getOutputFieldOkOptional(fieldName)");const R=this.getOutputField(v);if(R&&R.ok)return R.value},getOutputFieldErrorsOptional(v){console.warn("use reactive app.outputErrors.fieldName instead instead of getOutputFieldErrorsOptional(fieldName)");const R=this.getOutputField(v);if(R&&!R.ok)return R.errors},updateArgs(v){const R=f();return v(R),e.setBlockArgs(R)},updateUiState(v){const R=m();return e.setBlockUiState(v(R))},updateNavigationState(v){const R=_();return v(R),e.setNavigationState(R)},navigateTo(v){const R=_();return R.href=v,e.setNavigationState(R)}},S=r.computed(()=>{const v=Object.entries(p.outputs).map(([R,L])=>[R,L.ok&&L.value!==void 0?L.value:void 0]);return Object.fromEntries(v)}),V=r.computed(()=>{const v=Object.entries(p.outputs).map(([R,L])=>[R,L&&!L.ok?new Da(L.errors):void 0]);return Object.fromEntries(v)}),I={snapshot:p,queryParams:r.computed(()=>Rm(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"),S.value)),outputErrors:r.computed(()=>(console.warn("Change app.outputErrors to app.model.outputErrors"),V.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))},G=Fm({get(){return{args:p.args,ui:p.ui}},autoSave:!0,onSave(v){u(v.args,v.ui)}},{outputs:S,outputErrors:V},n);return r.reactive(Object.assign(G,x,I))}var Ie;(function(t){t.assertEqual=s=>s;function e(s){}t.assertIs=e;function n(s){throw new Error}t.assertNever=n,t.arrayToEnum=s=>{const l={};for(const c of s)l[c]=c;return l},t.getValidEnumValues=s=>{const l=t.objectKeys(s).filter(u=>typeof s[s[u]]!="number"),c={};for(const u of l)c[u]=s[u];return t.objectValues(c)},t.objectValues=s=>t.objectKeys(s).map(function(l){return s[l]}),t.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const l=[];for(const c in s)Object.prototype.hasOwnProperty.call(s,c)&&l.push(c);return l},t.find=(s,l)=>{for(const c of s)if(l(c))return c},t.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&isFinite(s)&&Math.floor(s)===s;function o(s,l=" | "){return s.map(c=>typeof c=="string"?`'${c}'`:c).join(l)}t.joinValues=o,t.jsonStringifyReplacer=(s,l)=>typeof l=="bigint"?l.toString():l})(Ie||(Ie={}));var Ga;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(Ga||(Ga={}));const ie=Ie.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),er=t=>{switch(typeof t){case"undefined":return ie.undefined;case"string":return ie.string;case"number":return isNaN(t)?ie.nan:ie.number;case"boolean":return ie.boolean;case"function":return ie.function;case"bigint":return ie.bigint;case"symbol":return ie.symbol;case"object":return Array.isArray(t)?ie.array:t===null?ie.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?ie.promise:typeof Map<"u"&&t instanceof Map?ie.map:typeof Set<"u"&&t instanceof Set?ie.set:typeof Date<"u"&&t instanceof Date?ie.date:ie.object;default:return ie.unknown}},X=Ie.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"]),Im=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:");class Ot 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:[]},s=l=>{for(const c of l.issues)if(c.code==="invalid_union")c.unionErrors.map(s);else if(c.code==="invalid_return_type")s(c.returnTypeError);else if(c.code==="invalid_arguments")s(c.argumentsError);else if(c.path.length===0)o._errors.push(n(c));else{let u=o,p=0;for(;p<c.path.length;){const f=c.path[p];p===c.path.length-1?(u[f]=u[f]||{_errors:[]},u[f]._errors.push(n(c))):u[f]=u[f]||{_errors:[]},u=u[f],p++}}};return s(this),o}static assert(e){if(!(e instanceof Ot))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Ie.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){const n={},o=[];for(const s of this.issues)s.path.length>0?(n[s.path[0]]=n[s.path[0]]||[],n[s.path[0]].push(e(s))):o.push(e(s));return{formErrors:o,fieldErrors:n}}get formErrors(){return this.flatten()}}Ot.create=t=>new Ot(t);const to=(t,e)=>{let n;switch(t.code){case X.invalid_type:t.received===ie.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case X.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,Ie.jsonStringifyReplacer)}`;break;case X.unrecognized_keys:n=`Unrecognized key(s) in object: ${Ie.joinValues(t.keys,", ")}`;break;case X.invalid_union:n="Invalid input";break;case X.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Ie.joinValues(t.options)}`;break;case X.invalid_enum_value:n=`Invalid enum value. Expected ${Ie.joinValues(t.options)}, received '${t.received}'`;break;case X.invalid_arguments:n="Invalid function arguments";break;case X.invalid_return_type:n="Invalid function return type";break;case X.invalid_date:n="Invalid date";break;case X.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}"`:Ie.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case X.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 X.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 X.custom:n="Invalid input";break;case X.invalid_intersection_types:n="Intersection results could not be merged";break;case X.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case X.not_finite:n="Number must be finite";break;default:n=e.defaultError,Ie.assertNever(t)}return{message:n}};let bd=to;function Om(t){bd=t}function is(){return bd}const ss=t=>{const{data:e,path:n,errorMaps:o,issueData:s}=t,l=[...n,...s.path||[]],c={...s,path:l};if(s.message!==void 0)return{...s,path:l,message:s.message};let u="";const p=o.filter(f=>!!f).slice().reverse();for(const f of p)u=f(c,{data:e,defaultError:u}).message;return{...s,path:l,message:u}},Lm=[];function ne(t,e){const n=is(),o=ss({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===to?void 0:to].filter(s=>!!s)});t.common.issues.push(o)}class _t{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 s of n){if(s.status==="aborted")return ve;s.status==="dirty"&&e.dirty(),o.push(s.value)}return{status:e.value,value:o}}static async mergeObjectAsync(e,n){const o=[];for(const s of n){const l=await s.key,c=await s.value;o.push({key:l,value:c})}return _t.mergeObjectSync(e,o)}static mergeObjectSync(e,n){const o={};for(const s of n){const{key:l,value:c}=s;if(l.status==="aborted"||c.status==="aborted")return ve;l.status==="dirty"&&e.dirty(),c.status==="dirty"&&e.dirty(),l.value!=="__proto__"&&(typeof c.value<"u"||s.alwaysSet)&&(o[l.value]=c.value)}return{status:e.value,value:o}}}const ve=Object.freeze({status:"aborted"}),no=t=>({status:"dirty",value:t}),St=t=>({status:"valid",value:t}),za=t=>t.status==="aborted",$a=t=>t.status==="dirty",Zo=t=>t.status==="valid",Uo=t=>typeof Promise<"u"&&t instanceof Promise;function as(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 xd(t,e,n,o,s){if(typeof e=="function"?t!==e||!s:!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 ue;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(ue||(ue={}));var Wo,Ho;class Bn{constructor(e,n,o,s){this._cachedPath=[],this.parent=e,this.data=n,this._path=o,this._key=s}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 kd=(t,e)=>{if(Zo(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 Ot(t.common.issues);return this._error=n,this._error}}};function Se(t){if(!t)return{};const{errorMap:e,invalid_type_error:n,required_error:o,description:s}=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:s}:{errorMap:(c,u)=>{var p,f;const{message:m}=t;return c.code==="invalid_enum_value"?{message:m??u.defaultError}:typeof u.data>"u"?{message:(p=m??o)!==null&&p!==void 0?p:u.defaultError}:c.code!=="invalid_type"?{message:u.defaultError}:{message:(f=m??n)!==null&&f!==void 0?f:u.defaultError}},description:s}}class Be{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 er(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:er(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new _t,ctx:{common:e.parent.common,data:e.data,parsedType:er(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const n=this._parse(e);if(Uo(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 s={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:er(e)},l=this._parseSync({data:e,path:s.path,parent:s});return kd(s,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:er(e)},s=this._parse({data:e,path:o.path,parent:o}),l=await(Uo(s)?s:Promise.resolve(s));return kd(o,l)}refine(e,n){const o=s=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(s):n;return this._refinement((s,l)=>{const c=e(s),u=()=>l.addIssue({code:X.custom,...o(s)});return typeof Promise<"u"&&c instanceof Promise?c.then(p=>p?!0:(u(),!1)):c?!0:(u(),!1)})}refinement(e,n){return this._refinement((o,s)=>e(o)?!0:(s.addIssue(typeof n=="function"?n(o,s):n),!1))}_refinement(e){return new ln({schema:this,typeName:_e.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return Nn.create(this,this._def)}nullable(){return or.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return an.create(this,this._def)}promise(){return so.create(this,this._def)}or(e){return Yo.create([this,e],this._def)}and(e){return Jo.create(this,e,this._def)}transform(e){return new ln({...Se(this._def),schema:this,typeName:_e.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new ni({...Se(this._def),innerType:this,defaultValue:n,typeName:_e.ZodDefault})}brand(){return new Wa({typeName:_e.ZodBranded,type:this,...Se(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new ri({...Se(this._def),innerType:this,catchValue:n,typeName:_e.ZodCatch})}describe(e){const n=this.constructor;return new n({...this._def,description:e})}pipe(e){return oi.create(this,e)}readonly(){return ii.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Gm=/^c[^\s-]{8,}$/i,zm=/^[0-9a-z]+$/,$m=/^[0-9A-HJKMNP-TV-Z]{26}$/,Zm=/^[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,Um=/^[a-z0-9_-]{21}$/i,Wm=/^[-+]?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)?)??$/,Hm=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,jm="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Za;const qm=/^(?:(?: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])$/,Km=/^(([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})))$/,Ym=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Sd="((\\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])))",Jm=new RegExp(`^${Sd}$`);function Ed(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 Xm(t){return new RegExp(`^${Ed(t)}$`)}function Td(t){let e=`${Sd}T${Ed(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 Qm(t,e){return!!((e==="v4"||!e)&&qm.test(t)||(e==="v6"||!e)&&Km.test(t))}class sn extends Be{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==ie.string){const l=this._getOrReturnCtx(e);return ne(l,{code:X.invalid_type,expected:ie.string,received:l.parsedType}),ve}const o=new _t;let s;for(const l of this._def.checks)if(l.kind==="min")e.data.length<l.value&&(s=this._getOrReturnCtx(e,s),ne(s,{code:X.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&&(s=this._getOrReturnCtx(e,s),ne(s,{code:X.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,u=e.data.length<l.value;(c||u)&&(s=this._getOrReturnCtx(e,s),c?ne(s,{code:X.too_big,maximum:l.value,type:"string",inclusive:!0,exact:!0,message:l.message}):u&&ne(s,{code:X.too_small,minimum:l.value,type:"string",inclusive:!0,exact:!0,message:l.message}),o.dirty())}else if(l.kind==="email")Hm.test(e.data)||(s=this._getOrReturnCtx(e,s),ne(s,{validation:"email",code:X.invalid_string,message:l.message}),o.dirty());else if(l.kind==="emoji")Za||(Za=new RegExp(jm,"u")),Za.test(e.data)||(s=this._getOrReturnCtx(e,s),ne(s,{validation:"emoji",code:X.invalid_string,message:l.message}),o.dirty());else if(l.kind==="uuid")Zm.test(e.data)||(s=this._getOrReturnCtx(e,s),ne(s,{validation:"uuid",code:X.invalid_string,message:l.message}),o.dirty());else if(l.kind==="nanoid")Um.test(e.data)||(s=this._getOrReturnCtx(e,s),ne(s,{validation:"nanoid",code:X.invalid_string,message:l.message}),o.dirty());else if(l.kind==="cuid")Gm.test(e.data)||(s=this._getOrReturnCtx(e,s),ne(s,{validation:"cuid",code:X.invalid_string,message:l.message}),o.dirty());else if(l.kind==="cuid2")zm.test(e.data)||(s=this._getOrReturnCtx(e,s),ne(s,{validation:"cuid2",code:X.invalid_string,message:l.message}),o.dirty());else if(l.kind==="ulid")$m.test(e.data)||(s=this._getOrReturnCtx(e,s),ne(s,{validation:"ulid",code:X.invalid_string,message:l.message}),o.dirty());else if(l.kind==="url")try{new URL(e.data)}catch{s=this._getOrReturnCtx(e,s),ne(s,{validation:"url",code:X.invalid_string,message:l.message}),o.dirty()}else l.kind==="regex"?(l.regex.lastIndex=0,l.regex.test(e.data)||(s=this._getOrReturnCtx(e,s),ne(s,{validation:"regex",code:X.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)||(s=this._getOrReturnCtx(e,s),ne(s,{code:X.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)||(s=this._getOrReturnCtx(e,s),ne(s,{code:X.invalid_string,validation:{startsWith:l.value},message:l.message}),o.dirty()):l.kind==="endsWith"?e.data.endsWith(l.value)||(s=this._getOrReturnCtx(e,s),ne(s,{code:X.invalid_string,validation:{endsWith:l.value},message:l.message}),o.dirty()):l.kind==="datetime"?Td(l).test(e.data)||(s=this._getOrReturnCtx(e,s),ne(s,{code:X.invalid_string,validation:"datetime",message:l.message}),o.dirty()):l.kind==="date"?Jm.test(e.data)||(s=this._getOrReturnCtx(e,s),ne(s,{code:X.invalid_string,validation:"date",message:l.message}),o.dirty()):l.kind==="time"?Xm(l).test(e.data)||(s=this._getOrReturnCtx(e,s),ne(s,{code:X.invalid_string,validation:"time",message:l.message}),o.dirty()):l.kind==="duration"?Wm.test(e.data)||(s=this._getOrReturnCtx(e,s),ne(s,{validation:"duration",code:X.invalid_string,message:l.message}),o.dirty()):l.kind==="ip"?Qm(e.data,l.version)||(s=this._getOrReturnCtx(e,s),ne(s,{validation:"ip",code:X.invalid_string,message:l.message}),o.dirty()):l.kind==="base64"?Ym.test(e.data)||(s=this._getOrReturnCtx(e,s),ne(s,{validation:"base64",code:X.invalid_string,message:l.message}),o.dirty()):Ie.assertNever(l);return{status:o.value,value:e.data}}_regex(e,n,o){return this.refinement(s=>e.test(s),{validation:n,code:X.invalid_string,...ue.errToObj(o)})}_addCheck(e){return new sn({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...ue.errToObj(e)})}url(e){return this._addCheck({kind:"url",...ue.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...ue.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...ue.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...ue.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...ue.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...ue.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...ue.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...ue.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...ue.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,...ue.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,...ue.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...ue.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...ue.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n==null?void 0:n.position,...ue.errToObj(n==null?void 0:n.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...ue.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...ue.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...ue.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...ue.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...ue.errToObj(n)})}nonempty(e){return this.min(1,ue.errToObj(e))}trim(){return new sn({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new sn({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new sn({...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}}sn.create=t=>{var e;return new sn({checks:[],typeName:_e.ZodString,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...Se(t)})};function eg(t,e){const n=(t.toString().split(".")[1]||"").length,o=(e.toString().split(".")[1]||"").length,s=n>o?n:o,l=parseInt(t.toFixed(s).replace(".","")),c=parseInt(e.toFixed(s).replace(".",""));return l%c/Math.pow(10,s)}class tr extends Be{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)!==ie.number){const l=this._getOrReturnCtx(e);return ne(l,{code:X.invalid_type,expected:ie.number,received:l.parsedType}),ve}let o;const s=new _t;for(const l of this._def.checks)l.kind==="int"?Ie.isInteger(e.data)||(o=this._getOrReturnCtx(e,o),ne(o,{code:X.invalid_type,expected:"integer",received:"float",message:l.message}),s.dirty()):l.kind==="min"?(l.inclusive?e.data<l.value:e.data<=l.value)&&(o=this._getOrReturnCtx(e,o),ne(o,{code:X.too_small,minimum:l.value,type:"number",inclusive:l.inclusive,exact:!1,message:l.message}),s.dirty()):l.kind==="max"?(l.inclusive?e.data>l.value:e.data>=l.value)&&(o=this._getOrReturnCtx(e,o),ne(o,{code:X.too_big,maximum:l.value,type:"number",inclusive:l.inclusive,exact:!1,message:l.message}),s.dirty()):l.kind==="multipleOf"?eg(e.data,l.value)!==0&&(o=this._getOrReturnCtx(e,o),ne(o,{code:X.not_multiple_of,multipleOf:l.value,message:l.message}),s.dirty()):l.kind==="finite"?Number.isFinite(e.data)||(o=this._getOrReturnCtx(e,o),ne(o,{code:X.not_finite,message:l.message}),s.dirty()):Ie.assertNever(l);return{status:s.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,ue.toString(n))}gt(e,n){return this.setLimit("min",e,!1,ue.toString(n))}lte(e,n){return this.setLimit("max",e,!0,ue.toString(n))}lt(e,n){return this.setLimit("max",e,!1,ue.toString(n))}setLimit(e,n,o,s){return new tr({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:o,message:ue.toString(s)}]})}_addCheck(e){return new tr({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:ue.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:ue.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:ue.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:ue.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:ue.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:ue.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:ue.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:ue.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:ue.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"&&Ie.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)}}tr.create=t=>new tr({checks:[],typeName:_e.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...Se(t)});class nr extends Be{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)!==ie.bigint){const l=this._getOrReturnCtx(e);return ne(l,{code:X.invalid_type,expected:ie.bigint,received:l.parsedType}),ve}let o;const s=new _t;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),ne(o,{code:X.too_small,type:"bigint",minimum:l.value,inclusive:l.inclusive,message:l.message}),s.dirty()):l.kind==="max"?(l.inclusive?e.data>l.value:e.data>=l.value)&&(o=this._getOrReturnCtx(e,o),ne(o,{code:X.too_big,type:"bigint",maximum:l.value,inclusive:l.inclusive,message:l.message}),s.dirty()):l.kind==="multipleOf"?e.data%l.value!==BigInt(0)&&(o=this._getOrReturnCtx(e,o),ne(o,{code:X.not_multiple_of,multipleOf:l.value,message:l.message}),s.dirty()):Ie.assertNever(l);return{status:s.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,ue.toString(n))}gt(e,n){return this.setLimit("min",e,!1,ue.toString(n))}lte(e,n){return this.setLimit("max",e,!0,ue.toString(n))}lt(e,n){return this.setLimit("max",e,!1,ue.toString(n))}setLimit(e,n,o,s){return new nr({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:o,message:ue.toString(s)}]})}_addCheck(e){return new nr({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:ue.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:ue.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:ue.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:ue.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:ue.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}}nr.create=t=>{var e;return new nr({checks:[],typeName:_e.ZodBigInt,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...Se(t)})};class jo extends Be{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==ie.boolean){const o=this._getOrReturnCtx(e);return ne(o,{code:X.invalid_type,expected:ie.boolean,received:o.parsedType}),ve}return St(e.data)}}jo.create=t=>new jo({typeName:_e.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...Se(t)});class Dr extends Be{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==ie.date){const l=this._getOrReturnCtx(e);return ne(l,{code:X.invalid_type,expected:ie.date,received:l.parsedType}),ve}if(isNaN(e.data.getTime())){const l=this._getOrReturnCtx(e);return ne(l,{code:X.invalid_date}),ve}const o=new _t;let s;for(const l of this._def.checks)l.kind==="min"?e.data.getTime()<l.value&&(s=this._getOrReturnCtx(e,s),ne(s,{code:X.too_small,message:l.message,inclusive:!0,exact:!1,minimum:l.value,type:"date"}),o.dirty()):l.kind==="max"?e.data.getTime()>l.value&&(s=this._getOrReturnCtx(e,s),ne(s,{code:X.too_big,message:l.message,inclusive:!0,exact:!1,maximum:l.value,type:"date"}),o.dirty()):Ie.assertNever(l);return{status:o.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Dr({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:ue.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:ue.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}}Dr.create=t=>new Dr({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:_e.ZodDate,...Se(t)});class ls extends Be{_parse(e){if(this._getType(e)!==ie.symbol){const o=this._getOrReturnCtx(e);return ne(o,{code:X.invalid_type,expected:ie.symbol,received:o.parsedType}),ve}return St(e.data)}}ls.create=t=>new ls({typeName:_e.ZodSymbol,...Se(t)});class qo extends Be{_parse(e){if(this._getType(e)!==ie.undefined){const o=this._getOrReturnCtx(e);return ne(o,{code:X.invalid_type,expected:ie.undefined,received:o.parsedType}),ve}return St(e.data)}}qo.create=t=>new qo({typeName:_e.ZodUndefined,...Se(t)});class Ko extends Be{_parse(e){if(this._getType(e)!==ie.null){const o=this._getOrReturnCtx(e);return ne(o,{code:X.invalid_type,expected:ie.null,received:o.parsedType}),ve}return St(e.data)}}Ko.create=t=>new Ko({typeName:_e.ZodNull,...Se(t)});class ro extends Be{constructor(){super(...arguments),this._any=!0}_parse(e){return St(e.data)}}ro.create=t=>new ro({typeName:_e.ZodAny,...Se(t)});class Fr extends Be{constructor(){super(...arguments),this._unknown=!0}_parse(e){return St(e.data)}}Fr.create=t=>new Fr({typeName:_e.ZodUnknown,...Se(t)});class Ln extends Be{_parse(e){const n=this._getOrReturnCtx(e);return ne(n,{code:X.invalid_type,expected:ie.never,received:n.parsedType}),ve}}Ln.create=t=>new Ln({typeName:_e.ZodNever,...Se(t)});class cs extends Be{_parse(e){if(this._getType(e)!==ie.undefined){const o=this._getOrReturnCtx(e);return ne(o,{code:X.invalid_type,expected:ie.void,received:o.parsedType}),ve}return St(e.data)}}cs.create=t=>new cs({typeName:_e.ZodVoid,...Se(t)});class an extends Be{_parse(e){const{ctx:n,status:o}=this._processInputParams(e),s=this._def;if(n.parsedType!==ie.array)return ne(n,{code:X.invalid_type,expected:ie.array,received:n.parsedType}),ve;if(s.exactLength!==null){const c=n.data.length>s.exactLength.value,u=n.data.length<s.exactLength.value;(c||u)&&(ne(n,{code:c?X.too_big:X.too_small,minimum:u?s.exactLength.value:void 0,maximum:c?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),o.dirty())}if(s.minLength!==null&&n.data.length<s.minLength.value&&(ne(n,{code:X.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),o.dirty()),s.maxLength!==null&&n.data.length>s.maxLength.value&&(ne(n,{code:X.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),o.dirty()),n.common.async)return Promise.all([...n.data].map((c,u)=>s.type._parseAsync(new Bn(n,c,n.path,u)))).then(c=>_t.mergeArray(o,c));const l=[...n.data].map((c,u)=>s.type._parseSync(new Bn(n,c,n.path,u)));return _t.mergeArray(o,l)}get element(){return this._def.type}min(e,n){return new an({...this._def,minLength:{value:e,message:ue.toString(n)}})}max(e,n){return new an({...this._def,maxLength:{value:e,message:ue.toString(n)}})}length(e,n){return new an({...this._def,exactLength:{value:e,message:ue.toString(n)}})}nonempty(e){return this.min(1,e)}}an.create=(t,e)=>new an({type:t,minLength:null,maxLength:null,exactLength:null,typeName:_e.ZodArray,...Se(e)});function oo(t){if(t instanceof Xe){const e={};for(const n in t.shape){const o=t.shape[n];e[n]=Nn.create(oo(o))}return new Xe({...t._def,shape:()=>e})}else return t instanceof an?new an({...t._def,type:oo(t.element)}):t instanceof Nn?Nn.create(oo(t.unwrap())):t instanceof or?or.create(oo(t.unwrap())):t instanceof Vn?Vn.create(t.items.map(e=>oo(e))):t}class Xe extends Be{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=Ie.objectKeys(e);return this._cached={shape:e,keys:n}}_parse(e){if(this._getType(e)!==ie.object){const f=this._getOrReturnCtx(e);return ne(f,{code:X.invalid_type,expected:ie.object,received:f.parsedType}),ve}const{status:o,ctx:s}=this._processInputParams(e),{shape:l,keys:c}=this._getCached(),u=[];if(!(this._def.catchall instanceof Ln&&this._def.unknownKeys==="strip"))for(const f in s.data)c.includes(f)||u.push(f);const p=[];for(const f of c){const m=l[f],_=s.data[f];p.push({key:{status:"valid",value:f},value:m._parse(new Bn(s,_,s.path,f)),alwaysSet:f in s.data})}if(this._def.catchall instanceof Ln){const f=this._def.unknownKeys;if(f==="passthrough")for(const m of u)p.push({key:{status:"valid",value:m},value:{status:"valid",value:s.data[m]}});else if(f==="strict")u.length>0&&(ne(s,{code:X.unrecognized_keys,keys:u}),o.dirty());else if(f!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const f=this._def.catchall;for(const m of u){const _=s.data[m];p.push({key:{status:"valid",value:m},value:f._parse(new Bn(s,_,s.path,m)),alwaysSet:m in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const f=[];for(const m of p){const _=await m.key,x=await m.value;f.push({key:_,value:x,alwaysSet:m.alwaysSet})}return f}).then(f=>_t.mergeObjectSync(o,f)):_t.mergeObjectSync(o,p)}get shape(){return this._def.shape()}strict(e){return ue.errToObj,new Xe({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,o)=>{var s,l,c,u;const p=(c=(l=(s=this._def).errorMap)===null||l===void 0?void 0:l.call(s,n,o).message)!==null&&c!==void 0?c:o.defaultError;return n.code==="unrecognized_keys"?{message:(u=ue.errToObj(e).message)!==null&&u!==void 0?u:p}:{message:p}}}:{}})}strip(){return new Xe({...this._def,unknownKeys:"strip"})}passthrough(){return new Xe({...this._def,unknownKeys:"passthrough"})}extend(e){return new Xe({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Xe({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:_e.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new Xe({...this._def,catchall:e})}pick(e){const n={};return Ie.objectKeys(e).forEach(o=>{e[o]&&this.shape[o]&&(n[o]=this.shape[o])}),new Xe({...this._def,shape:()=>n})}omit(e){const n={};return Ie.objectKeys(this.shape).forEach(o=>{e[o]||(n[o]=this.shape[o])}),new Xe({...this._def,shape:()=>n})}deepPartial(){return oo(this)}partial(e){const n={};return Ie.objectKeys(this.shape).forEach(o=>{const s=this.shape[o];e&&!e[o]?n[o]=s:n[o]=s.optional()}),new Xe({...this._def,shape:()=>n})}required(e){const n={};return Ie.objectKeys(this.shape).forEach(o=>{if(e&&!e[o])n[o]=this.shape[o];else{let l=this.shape[o];for(;l instanceof Nn;)l=l._def.innerType;n[o]=l}}),new Xe({...this._def,shape:()=>n})}keyof(){return Bd(Ie.objectKeys(this.shape))}}Xe.create=(t,e)=>new Xe({shape:()=>t,unknownKeys:"strip",catchall:Ln.create(),typeName:_e.ZodObject,...Se(e)}),Xe.strictCreate=(t,e)=>new Xe({shape:()=>t,unknownKeys:"strict",catchall:Ln.create(),typeName:_e.ZodObject,...Se(e)}),Xe.lazycreate=(t,e)=>new Xe({shape:t,unknownKeys:"strip",catchall:Ln.create(),typeName:_e.ZodObject,...Se(e)});class Yo extends Be{_parse(e){const{ctx:n}=this._processInputParams(e),o=this._def.options;function s(l){for(const u of l)if(u.result.status==="valid")return u.result;for(const u of l)if(u.result.status==="dirty")return n.common.issues.push(...u.ctx.common.issues),u.result;const c=l.map(u=>new Ot(u.ctx.common.issues));return ne(n,{code:X.invalid_union,unionErrors:c}),ve}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(s);{let l;const c=[];for(const p of o){const f={...n,common:{...n.common,issues:[]},parent:null},m=p._parseSync({data:n.data,path:n.path,parent:f});if(m.status==="valid")return m;m.status==="dirty"&&!l&&(l={result:m,ctx:f}),f.common.issues.length&&c.push(f.common.issues)}if(l)return n.common.issues.push(...l.ctx.common.issues),l.result;const u=c.map(p=>new Ot(p));return ne(n,{code:X.invalid_union,unionErrors:u}),ve}}get options(){return this._def.options}}Yo.create=(t,e)=>new Yo({options:t,typeName:_e.ZodUnion,...Se(e)});const Gn=t=>t instanceof Qo?Gn(t.schema):t instanceof ln?Gn(t.innerType()):t instanceof ei?[t.value]:t instanceof rr?t.options:t instanceof ti?Ie.objectValues(t.enum):t instanceof ni?Gn(t._def.innerType):t instanceof qo?[void 0]:t instanceof Ko?[null]:t instanceof Nn?[void 0,...Gn(t.unwrap())]:t instanceof or?[null,...Gn(t.unwrap())]:t instanceof Wa||t instanceof ii?Gn(t.unwrap()):t instanceof ri?Gn(t._def.innerType):[];class ds extends Be{_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==ie.object)return ne(n,{code:X.invalid_type,expected:ie.object,received:n.parsedType}),ve;const o=this.discriminator,s=n.data[o],l=this.optionsMap.get(s);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}):(ne(n,{code:X.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[o]}),ve)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,o){const s=new Map;for(const l of n){const c=Gn(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 u of c){if(s.has(u))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(u)}`);s.set(u,l)}}return new ds({typeName:_e.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:s,...Se(o)})}}function Ua(t,e){const n=er(t),o=er(e);if(t===e)return{valid:!0,data:t};if(n===ie.object&&o===ie.object){const s=Ie.objectKeys(e),l=Ie.objectKeys(t).filter(u=>s.indexOf(u)!==-1),c={...t,...e};for(const u of l){const p=Ua(t[u],e[u]);if(!p.valid)return{valid:!1};c[u]=p.data}return{valid:!0,data:c}}else if(n===ie.array&&o===ie.array){if(t.length!==e.length)return{valid:!1};const s=[];for(let l=0;l<t.length;l++){const c=t[l],u=e[l],p=Ua(c,u);if(!p.valid)return{valid:!1};s.push(p.data)}return{valid:!0,data:s}}else return n===ie.date&&o===ie.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class Jo extends Be{_parse(e){const{status:n,ctx:o}=this._processInputParams(e),s=(l,c)=>{if(za(l)||za(c))return ve;const u=Ua(l.value,c.value);return u.valid?(($a(l)||$a(c))&&n.dirty(),{status:n.value,value:u.data}):(ne(o,{code:X.invalid_intersection_types}),ve)};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])=>s(l,c)):s(this._def.left._parseSync({data:o.data,path:o.path,parent:o}),this._def.right._parseSync({data:o.data,path:o.path,parent:o}))}}Jo.create=(t,e,n)=>new Jo({left:t,right:e,typeName:_e.ZodIntersection,...Se(n)});class Vn extends Be{_parse(e){const{status:n,ctx:o}=this._processInputParams(e);if(o.parsedType!==ie.array)return ne(o,{code:X.invalid_type,expected:ie.array,received:o.parsedType}),ve;if(o.data.length<this._def.items.length)return ne(o,{code:X.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),ve;!this._def.rest&&o.data.length>this._def.items.length&&(ne(o,{code:X.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const l=[...o.data].map((c,u)=>{const p=this._def.items[u]||this._def.rest;return p?p._parse(new Bn(o,c,o.path,u)):null}).filter(c=>!!c);return o.common.async?Promise.all(l).then(c=>_t.mergeArray(n,c)):_t.mergeArray(n,l)}get items(){return this._def.items}rest(e){return new Vn({...this._def,rest:e})}}Vn.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Vn({items:t,typeName:_e.ZodTuple,rest:null,...Se(e)})};class Xo extends Be{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!==ie.object)return ne(o,{code:X.invalid_type,expected:ie.object,received:o.parsedType}),ve;const s=[],l=this._def.keyType,c=this._def.valueType;for(const u in o.data)s.push({key:l._parse(new Bn(o,u,o.path,u)),value:c._parse(new Bn(o,o.data[u],o.path,u)),alwaysSet:u in o.data});return o.common.async?_t.mergeObjectAsync(n,s):_t.mergeObjectSync(n,s)}get element(){return this._def.valueType}static create(e,n,o){return n instanceof Be?new Xo({keyType:e,valueType:n,typeName:_e.ZodRecord,...Se(o)}):new Xo({keyType:sn.create(),valueType:e,typeName:_e.ZodRecord,...Se(n)})}}class us extends Be{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!==ie.map)return ne(o,{code:X.invalid_type,expected:ie.map,received:o.parsedType}),ve;const s=this._def.keyType,l=this._def.valueType,c=[...o.data.entries()].map(([u,p],f)=>({key:s._parse(new Bn(o,u,o.path,[f,"key"])),value:l._parse(new Bn(o,p,o.path,[f,"value"]))}));if(o.common.async){const u=new Map;return Promise.resolve().then(async()=>{for(const p of c){const f=await p.key,m=await p.value;if(f.status==="aborted"||m.status==="aborted")return ve;(f.status==="dirty"||m.status==="dirty")&&n.dirty(),u.set(f.value,m.value)}return{status:n.value,value:u}})}else{const u=new Map;for(const p of c){const f=p.key,m=p.value;if(f.status==="aborted"||m.status==="aborted")return ve;(f.status==="dirty"||m.status==="dirty")&&n.dirty(),u.set(f.value,m.value)}return{status:n.value,value:u}}}}us.create=(t,e,n)=>new us({valueType:e,keyType:t,typeName:_e.ZodMap,...Se(n)});class Rr extends Be{_parse(e){const{status:n,ctx:o}=this._processInputParams(e);if(o.parsedType!==ie.set)return ne(o,{code:X.invalid_type,expected:ie.set,received:o.parsedType}),ve;const s=this._def;s.minSize!==null&&o.data.size<s.minSize.value&&(ne(o,{code:X.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),n.dirty()),s.maxSize!==null&&o.data.size>s.maxSize.value&&(ne(o,{code:X.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),n.dirty());const l=this._def.valueType;function c(p){const f=new Set;for(const m of p){if(m.status==="aborted")return ve;m.status==="dirty"&&n.dirty(),f.add(m.value)}return{status:n.value,value:f}}const u=[...o.data.values()].map((p,f)=>l._parse(new Bn(o,p,o.path,f)));return o.common.async?Promise.all(u).then(p=>c(p)):c(u)}min(e,n){return new Rr({...this._def,minSize:{value:e,message:ue.toString(n)}})}max(e,n){return new Rr({...this._def,maxSize:{value:e,message:ue.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}}Rr.create=(t,e)=>new Rr({valueType:t,minSize:null,maxSize:null,typeName:_e.ZodSet,...Se(e)});class io extends Be{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==ie.function)return ne(n,{code:X.invalid_type,expected:ie.function,received:n.parsedType}),ve;function o(u,p){return ss({data:u,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,is(),to].filter(f=>!!f),issueData:{code:X.invalid_arguments,argumentsError:p}})}function s(u,p){return ss({data:u,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,is(),to].filter(f=>!!f),issueData:{code:X.invalid_return_type,returnTypeError:p}})}const l={errorMap:n.common.contextualErrorMap},c=n.data;if(this._def.returns instanceof so){const u=this;return St(async function(...p){const f=new Ot([]),m=await u._def.args.parseAsync(p,l).catch(S=>{throw f.addIssue(o(p,S)),f}),_=await Reflect.apply(c,this,m);return await u._def.returns._def.type.parseAsync(_,l).catch(S=>{throw f.addIssue(s(_,S)),f})})}else{const u=this;return St(function(...p){const f=u._def.args.safeParse(p,l);if(!f.success)throw new Ot([o(p,f.error)]);const m=Reflect.apply(c,this,f.data),_=u._def.returns.safeParse(m,l);if(!_.success)throw new Ot([s(m,_.error)]);return _.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new io({...this._def,args:Vn.create(e).rest(Fr.create())})}returns(e){return new io({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,n,o){return new io({args:e||Vn.create([]).rest(Fr.create()),returns:n||Fr.create(),typeName:_e.ZodFunction,...Se(o)})}}class Qo extends Be{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})}}Qo.create=(t,e)=>new Qo({getter:t,typeName:_e.ZodLazy,...Se(e)});class ei extends Be{_parse(e){if(e.data!==this._def.value){const n=this._getOrReturnCtx(e);return ne(n,{received:n.data,code:X.invalid_literal,expected:this._def.value}),ve}return{status:"valid",value:e.data}}get value(){return this._def.value}}ei.create=(t,e)=>new ei({value:t,typeName:_e.ZodLiteral,...Se(e)});function Bd(t,e){return new rr({values:t,typeName:_e.ZodEnum,...Se(e)})}class rr extends Be{constructor(){super(...arguments),Wo.set(this,void 0)}_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),o=this._def.values;return ne(n,{expected:Ie.joinValues(o),received:n.parsedType,code:X.invalid_type}),ve}if(as(this,Wo)||xd(this,Wo,new Set(this._def.values)),!as(this,Wo).has(e.data)){const n=this._getOrReturnCtx(e),o=this._def.values;return ne(n,{received:n.data,code:X.invalid_enum_value,options:o}),ve}return St(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 rr.create(e,{...this._def,...n})}exclude(e,n=this._def){return rr.create(this.options.filter(o=>!e.includes(o)),{...this._def,...n})}}Wo=new WeakMap,rr.create=Bd;class ti extends Be{constructor(){super(...arguments),Ho.set(this,void 0)}_parse(e){const n=Ie.getValidEnumValues(this._def.values),o=this._getOrReturnCtx(e);if(o.parsedType!==ie.string&&o.parsedType!==ie.number){const s=Ie.objectValues(n);return ne(o,{expected:Ie.joinValues(s),received:o.parsedType,code:X.invalid_type}),ve}if(as(this,Ho)||xd(this,Ho,new Set(Ie.getValidEnumValues(this._def.values))),!as(this,Ho).has(e.data)){const s=Ie.objectValues(n);return ne(o,{received:o.data,code:X.invalid_enum_value,options:s}),ve}return St(e.data)}get enum(){return this._def.values}}Ho=new WeakMap,ti.create=(t,e)=>new ti({values:t,typeName:_e.ZodNativeEnum,...Se(e)});class so extends Be{unwrap(){return this._def.type}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==ie.promise&&n.common.async===!1)return ne(n,{code:X.invalid_type,expected:ie.promise,received:n.parsedType}),ve;const o=n.parsedType===ie.promise?n.data:Promise.resolve(n.data);return St(o.then(s=>this._def.type.parseAsync(s,{path:n.path,errorMap:n.common.contextualErrorMap})))}}so.create=(t,e)=>new so({type:t,typeName:_e.ZodPromise,...Se(e)});class ln extends Be{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===_e.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:n,ctx:o}=this._processInputParams(e),s=this._def.effect||null,l={addIssue:c=>{ne(o,c),c.fatal?n.abort():n.dirty()},get path(){return o.path}};if(l.addIssue=l.addIssue.bind(l),s.type==="preprocess"){const c=s.transform(o.data,l);if(o.common.async)return Promise.resolve(c).then(async u=>{if(n.value==="aborted")return ve;const p=await this._def.schema._parseAsync({data:u,path:o.path,parent:o});return p.status==="aborted"?ve:p.status==="dirty"||n.value==="dirty"?no(p.value):p});{if(n.value==="aborted")return ve;const u=this._def.schema._parseSync({data:c,path:o.path,parent:o});return u.status==="aborted"?ve:u.status==="dirty"||n.value==="dirty"?no(u.value):u}}if(s.type==="refinement"){const c=u=>{const p=s.refinement(u,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 u};if(o.common.async===!1){const u=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});return u.status==="aborted"?ve:(u.status==="dirty"&&n.dirty(),c(u.value),{status:n.value,value:u.value})}else return this._def.schema._parseAsync({data:o.data,path:o.path,parent:o}).then(u=>u.status==="aborted"?ve:(u.status==="dirty"&&n.dirty(),c(u.value).then(()=>({status:n.value,value:u.value}))))}if(s.type==="transform")if(o.common.async===!1){const c=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});if(!Zo(c))return c;const u=s.transform(c.value,l);if(u instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:u}}else return this._def.schema._parseAsync({data:o.data,path:o.path,parent:o}).then(c=>Zo(c)?Promise.resolve(s.transform(c.value,l)).then(u=>({status:n.value,value:u})):c);Ie.assertNever(s)}}ln.create=(t,e,n)=>new ln({schema:t,typeName:_e.ZodEffects,effect:e,...Se(n)}),ln.createWithPreprocess=(t,e,n)=>new ln({schema:e,effect:{type:"preprocess",transform:t},typeName:_e.ZodEffects,...Se(n)});class Nn extends Be{_parse(e){return this._getType(e)===ie.undefined?St(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Nn.create=(t,e)=>new Nn({innerType:t,typeName:_e.ZodOptional,...Se(e)});class or extends Be{_parse(e){return this._getType(e)===ie.null?St(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}or.create=(t,e)=>new or({innerType:t,typeName:_e.ZodNullable,...Se(e)});class ni extends Be{_parse(e){const{ctx:n}=this._processInputParams(e);let o=n.data;return n.parsedType===ie.undefined&&(o=this._def.defaultValue()),this._def.innerType._parse({data:o,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}ni.create=(t,e)=>new ni({innerType:t,typeName:_e.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Se(e)});class ri extends Be{_parse(e){const{ctx:n}=this._processInputParams(e),o={...n,common:{...n.common,issues:[]}},s=this._def.innerType._parse({data:o.data,path:o.path,parent:{...o}});return Uo(s)?s.then(l=>({status:"valid",value:l.status==="valid"?l.value:this._def.catchValue({get error(){return new Ot(o.common.issues)},input:o.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Ot(o.common.issues)},input:o.data})}}removeCatch(){return this._def.innerType}}ri.create=(t,e)=>new ri({innerType:t,typeName:_e.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Se(e)});class ps extends Be{_parse(e){if(this._getType(e)!==ie.nan){const o=this._getOrReturnCtx(e);return ne(o,{code:X.invalid_type,expected:ie.nan,received:o.parsedType}),ve}return{status:"valid",value:e.data}}}ps.create=t=>new ps({typeName:_e.ZodNaN,...Se(t)});const tg=Symbol("zod_brand");class Wa extends Be{_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 oi extends Be{_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"?ve:l.status==="dirty"?(n.dirty(),no(l.value)):this._def.out._parseAsync({data:l.value,path:o.path,parent:o})})();{const s=this._def.in._parseSync({data:o.data,path:o.path,parent:o});return s.status==="aborted"?ve:s.status==="dirty"?(n.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:o.path,parent:o})}}static create(e,n){return new oi({in:e,out:n,typeName:_e.ZodPipeline})}}class ii extends Be{_parse(e){const n=this._def.innerType._parse(e),o=s=>(Zo(s)&&(s.value=Object.freeze(s.value)),s);return Uo(n)?n.then(s=>o(s)):o(n)}unwrap(){return this._def.innerType}}ii.create=(t,e)=>new ii({innerType:t,typeName:_e.ZodReadonly,...Se(e)});function Vd(t,e={},n){return t?ro.create().superRefine((o,s)=>{var l,c;if(!t(o)){const u=typeof e=="function"?e(o):typeof e=="string"?{message:e}:e,p=(c=(l=u.fatal)!==null&&l!==void 0?l:n)!==null&&c!==void 0?c:!0,f=typeof u=="string"?{message:u}:u;s.addIssue({code:"custom",...f,fatal:p})}}):ro.create()}const ng={object:Xe.lazycreate};var _e;(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"})(_e||(_e={}));const rg=(t,e={message:`Input not instance of ${t.name}`})=>Vd(n=>n instanceof t,e),Nd=sn.create,Ad=tr.create,og=ps.create,ig=nr.create,Pd=jo.create,sg=Dr.create,ag=ls.create,lg=qo.create,cg=Ko.create,dg=ro.create,ug=Fr.create,pg=Ln.create,hg=cs.create,fg=an.create,mg=Xe.create,gg=Xe.strictCreate,yg=Yo.create,_g=ds.create,Cg=Jo.create,vg=Vn.create,wg=Xo.create,bg=us.create,xg=Rr.create,kg=io.create,Sg=Qo.create,Eg=ei.create,Tg=rr.create,Bg=ti.create,Vg=so.create,Dd=ln.create,Ng=Nn.create,Ag=or.create,Pg=ln.createWithPreprocess,Dg=oi.create;var An=Object.freeze({__proto__:null,defaultErrorMap:to,setErrorMap:Om,getErrorMap:is,makeIssue:ss,EMPTY_PATH:Lm,addIssueToContext:ne,ParseStatus:_t,INVALID:ve,DIRTY:no,OK:St,isAborted:za,isDirty:$a,isValid:Zo,isAsync:Uo,get util(){return Ie},get objectUtil(){return Ga},ZodParsedType:ie,getParsedType:er,ZodType:Be,datetimeRegex:Td,ZodString:sn,ZodNumber:tr,ZodBigInt:nr,ZodBoolean:jo,ZodDate:Dr,ZodSymbol:ls,ZodUndefined:qo,ZodNull:Ko,ZodAny:ro,ZodUnknown:Fr,ZodNever:Ln,ZodVoid:cs,ZodArray:an,ZodObject:Xe,ZodUnion:Yo,ZodDiscriminatedUnion:ds,ZodIntersection:Jo,ZodTuple:Vn,ZodRecord:Xo,ZodMap:us,ZodSet:Rr,ZodFunction:io,ZodLazy:Qo,ZodLiteral:ei,ZodEnum:rr,ZodNativeEnum:ti,ZodPromise:so,ZodEffects:ln,ZodTransformer:ln,ZodOptional:Nn,ZodNullable:or,ZodDefault:ni,ZodCatch:ri,ZodNaN:ps,BRAND:tg,ZodBranded:Wa,ZodPipeline:oi,ZodReadonly:ii,custom:Vd,Schema:Be,ZodSchema:Be,late:ng,get ZodFirstPartyTypeKind(){return _e},coerce:{string:t=>sn.create({...t,coerce:!0}),number:t=>tr.create({...t,coerce:!0}),boolean:t=>jo.create({...t,coerce:!0}),bigint:t=>nr.create({...t,coerce:!0}),date:t=>Dr.create({...t,coerce:!0})},any:dg,array:fg,bigint:ig,boolean:Pd,date:sg,discriminatedUnion:_g,effect:Dd,enum:Tg,function:kg,instanceof:rg,intersection:Cg,lazy:Sg,literal:Eg,map:bg,nan:og,nativeEnum:Bg,never:pg,null:cg,nullable:Ag,number:Ad,object:mg,oboolean:()=>Pd().optional(),onumber:()=>Ad().optional(),optional:Ng,ostring:()=>Nd().optional(),pipeline:Dg,preprocess:Pg,promise:Vg,record:wg,set:xg,strictObject:gg,string:Nd,symbol:ag,transformer:Dd,tuple:vg,undefined:lg,union:yg,unknown:ug,void:hg,NEVER:ve,ZodIssueCode:X,quotelessJson:Im,ZodError:Ot});function Fg(t){throw new Error("Unexpected object: "+t)}const Rg=-2147483648,Fd=-9007199254740991n,Mg=NaN,Ig=NaN,Og=null,Lg=null;function Rd(t,e){switch(e){case"Int":return t===Rg;case"Long":return t===Number(Fd)||t===Fd;case"Float":return t===Mg;case"Double":return t===Ig;case"String":return t===Og;case"Bytes":return t===Lg;default:throw Error(`unsupported data type: ${e}`)}}function Gg(t,e){const n=Math.floor(e/8),o=1<<7-e%8;return(t[n]&o)>0}function Ha(t){const{type:e,name:n,domain:o}=t;return{type:e,name:n,...o&&{domain:o}}}function Md(t){return t.map(Ha)}function hs(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=>hs(n,e))};case"outer":return{type:"outer",primary:hs(t.primary,e),secondary:t.secondary.map(n=>hs(n,e))};default:Fg(t)}}An.object({__isRef:An.literal(!0).describe("Crucial marker for the block dependency tree reconstruction"),blockId:An.string().describe("Upstream block id"),name:An.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 zg(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 $g=An.object({type:An.string(),importance:An.number().optional(),id:An.string().optional(),label:An.string()});An.array($g);const Zg="1.14.1";function Ug(){return zg({sdkVersion:Zg})}function Wg(t){if(typeof globalThis.getEnvironmentValue=="function")return globalThis.getEnvironmentValue(t)}function ao(t){return!!t&&typeof t.children<"u"}function ir(t){return ao(t)?t.groupId:t.colId}function Id(t,e,n){const o=(c,u)=>{const p=c.children.map(ir),f=b._includes(p,ir(u)),m=b._last(c.children),_=m&&ir(m)!==ir(u);return f&&_};if(!ao(t))return!0;const s=t,l=n;if(o(s,l))return s.children.push(l),!0;if(s.groupId===e){const c=s.children.map(ir);if(!b._includes(c,ir(l)))return s.children.push(l),!0}for(let c=s.children.length-1;c>=0&&!Id(s.children[c],e,n);c--);return!1}function Hg(t){const e=(s,l)=>ao(s)&&ao(l)&&ir(s)===ir(l),n=(s,l)=>{if(!ao(l))return s;const c=s,u=l;return u.children&&u.groupId&&Id(c,u.groupId,u.children[0])||u.children.forEach(p=>n(c,p)),c},o=[];for(let s=1;s<=t.length;s++){const l=t[s-1],c=t[s];e(l,c)?t[s]=n(l,c):o.push(l)}return o}var jg=class extends b.BeanStub{constructor(){super(...arguments),this.beanName="toolPanelColDefService"}wireBeans(t){this.columnModel=t.columnModel}createColumnTree(t){const e=[],n=(s,l)=>{if(ao(s)){const c=s,u=typeof c.groupId<"u"?c.groupId:c.headerName,p=new b.AgProvidedColumnGroup(c,u,!1,l),f=[];return c.children.forEach(m=>{const _=n(m,l+1);_&&f.push(_)}),p.setChildren(f),p}else{const c=s,u=c.colId?c.colId:c.field,p=this.columnModel.getColDefCol(u);return p||e.push(c),p}},o=[];return t.forEach(s=>{const l=n(s,0);l&&o.push(l)}),e.length>0&&b._warnOnce("unable to find grid columns for the supplied colDef(s):",e),o}syncLayoutWithGrid(t){const e=this.getLeafPathTrees(),n=Hg(e);t(n)}getLeafPathTrees(){const t=(o,s)=>{let l;if(b.isProvidedColumnGroup(o))if(o.isPadding())l=s;else{const u=Object.assign({},o.getColGroupDef());u.groupId=o.getGroupId(),u.children=[s],l=u}else{const u=Object.assign({},o.getColDef());u.colId=o.getColId(),l=u}const c=o.getOriginalParent();return c?t(c,l):l};return this.columnModel.getCols().filter(o=>{const s=o.getColDef();return o.isPrimary()&&!s.showRowGroup}).map(o=>t(o,o.getColDef()))}};function qg(t){var e;return((e=t.sideBarService)==null?void 0:e.getSideBarComp().isDisplayed())??!1}function Kg(t,e){var n;(n=t.sideBarService)==null||n.getSideBarComp().setDisplayed(e)}function Yg(t,e){var n;(n=t.sideBarService)==null||n.getSideBarComp().setSideBarPosition(e)}function Jg(t,e){var n;(n=t.sideBarService)==null||n.getSideBarComp().openToolPanel(e,"api")}function Xg(t){var e;(e=t.sideBarService)==null||e.getSideBarComp().close("api")}function Qg(t){var e;return((e=t.sideBarService)==null?void 0:e.getSideBarComp().openedItem())??null}function ey(t){var e;(e=t.sideBarService)==null||e.getSideBarComp().refresh()}function ty(t){var e;return((e=t.sideBarService)==null?void 0:e.getSideBarComp().isToolPanelShowing())??!1}function ny(t,e){var o;const n=(o=t.sideBarService)==null?void 0:o.getSideBarComp().getToolPanelInstance(e);return b._unwrapUserComp(n)}function ry(t){var e;return(e=t.sideBarService)==null?void 0:e.getSideBarComp().getDef()}var oy=class extends b.Component{constructor(t){super(),this.eToggleButton=b.RefPlaceholder,this.eIconWrapper=b.RefPlaceholder,this.eLabel=b.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 Og(t){return{ok:!0,value:t}}function Jd(t){if(!t)throw new Ka;if(!t.ok)throw Error(t.errors.join(";"));return t.value}function Qd(t){return{value:t,errors:void 0}}function Lg(t){if(t.errors)throw new Xa(t.errors);if(!t.value)throw new Ka;return t.value}function Mg(t){return t!==void 0}function Ya(t,e){return Gr(t)===Gr(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=E=>{i.value={model:Dn(E)}};r.watch(()=>t.get(),E=>l(E),{immediate:!0});const c=()=>{var E;t.onSave(e(Dn((E=i.value)==null?void 0:E.model)))},d=()=>{l(t.get()),o.value=void 0},p=E=>{const O=Qa(E);el(O)?o.value=Error(tl(O)):o.value=O},h=E=>{o.value=void 0;try{e(E),n&&c()}catch(O){p(O)}},m=r.computed({get:()=>{var E;return(E=i.value)==null?void 0:E.model},set(E){l(E),h(E)}});r.watch(i,(E,O)=>{E&&E===O&&h(E.model)},{deep:!0});const y=r.computed(()=>!o.value),x=r.computed(()=>!Ya(t.get(),r.unref(i))),w=r.computed(()=>o.value?o.value.message:"");return r.reactive({model:m,valid:y,isChanged:x,error:o,errorString:w,save:c,revert:d,setError:p})}function Gg(t,e,n){const o=t.validate??Ja,{autoSave:i}=t,l=r.ref(),c=r.ref(),d=$=>{var b;if(n.deepPatchModel){const R=(b=c.value)==null?void 0:b.model,F=Object.assign(Dn($),e??{});c.value={model:R?Xd(R,F):F,stage:Symbol()}}else c.value={model:Object.assign(Dn($),e??{}),stage:Symbol()}};r.watch(()=>t.get(),$=>d($),{immediate:!0});const p=()=>{var $;t.onSave(o(Dn(($=c.value)==null?void 0:$.model)))},h=()=>{d(t.get()),l.value=void 0},m=$=>{const b=Qa($);el(b)?l.value=Error(tl(b)):l.value=b},y=$=>{l.value=void 0;try{o($),i&&p()}catch(b){m(b)}},x=r.computed({get:()=>{var $;return($=c.value)==null?void 0:$.model},set(){throw Error("Cannot replace base model")}});r.watch([()=>({args:x.value.args,ui:x.value.ui}),()=>{var $;return($=c.value)==null?void 0:$.stage}],([$,b],[R,F])=>{b===F&&y($)},{deep:!0});const w=r.computed(()=>!l.value),E=r.computed(()=>{var R;const{args:$,ui:b}=((R=r.unref(c))==null?void 0:R.model)??{};return!Ya(t.get(),{args:$,ui:b})}),O=r.computed(()=>l.value?l.value.message:"");return r.reactive({model:x,valid:w,isChanged:E,error:l,errorString:O,save:p,revert:h,setError:m})}const $g=t=>Object.fromEntries(new URL(t,"http://dummy").searchParams);function zg(t,e,n){const o=(b,...R)=>{n.debug&&console.log(`%c>>> %c${b}`,"color: orange; font-weight: bold","color: orange",...R)},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 b=>{b.forEach(R=>{R.key==="args"&&(p.args=Object.freeze(R.value),o("args patch",p.args)),R.key==="ui"&&(p.ui=Object.freeze(R.value),o("ui patch",p.ui)),R.key==="outputs"&&(p.outputs=Object.freeze(R.value),o("outputs patch",p.outputs)),R.key==="navigationState"&&(p.navigationState=Object.freeze(R.value),o("navigationState patch",p.navigationState))}),await r.nextTick()});const h=()=>Dn(p.args),m=()=>Dn(p.ui),y=()=>Dn(p.navigationState),x={createArgsModel(b={}){return nl({get(){return b.transform?b.transform(p.args):p.args},validate:b.validate,autoSave:!0,onSave(R){l(R)}})},createUiModel(b={},R){return nl({get(){return b.transform?b.transform(p.ui):p.ui??R()},validate:b.validate,autoSave:!0,onSave(F){c(F)}})},useOutputs(...b){const R=r.reactive({errors:void 0,value:void 0});return r.watch(()=>p.outputs,()=>{try{Object.assign(R,{value:this.unwrapOutputs(...b),errors:void 0})}catch(F){Object.assign(R,{value:void 0,errors:[String(F)]})}},{immediate:!0,deep:!0}),R},unwrapOutputs(...b){const R=p.outputs,F=b.map(D=>[D,Jd(R[D])]);return Object.fromEntries(F)},getOutputField(b){return p.outputs[b]},getOutputFieldOkOptional(b){console.warn("use reactive app.outputValues.fieldName instead instead of getOutputFieldOkOptional(fieldName)");const R=this.getOutputField(b);if(R&&R.ok)return R.value},getOutputFieldErrorsOptional(b){console.warn("use reactive app.outputErrors.fieldName instead instead of getOutputFieldErrorsOptional(fieldName)");const R=this.getOutputField(b);if(R&&!R.ok)return R.errors},updateArgs(b){const R=h();return b(R),e.setBlockArgs(R)},updateUiState(b){const R=m();return e.setBlockUiState(b(R))},updateNavigationState(b){const R=y();return b(R),e.setNavigationState(R)},navigateTo(b){const R=y();return R.href=b,e.setNavigationState(R)}},w=r.computed(()=>{const b=Object.entries(p.outputs).map(([R,F])=>[R,F.ok&&F.value!==void 0?F.value:void 0]);return Object.fromEntries(b)}),E=r.computed(()=>{const b=Object.entries(p.outputs).map(([R,F])=>[R,F&&!F.ok?new Xa(F.errors):void 0]);return Object.fromEntries(b)}),O={snapshot:p,queryParams:r.computed(()=>$g(p.navigationState.href)),href:r.computed(()=>p.navigationState.href),hasErrors:r.computed(()=>Object.values(p.outputs).some(b=>!(b!=null&&b.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"),E.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))},$=Gg({get(){return{args:p.args,ui:p.ui}},autoSave:!0,onSave(b){d(b.args,b.ui)}},{outputs:w,outputErrors:E},n);return r.reactive(Object.assign($,x,O))}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"]),Ug=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:");class Ut 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 Ut))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()}}Ut.create=t=>new Ut(t);const lo=(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 eu=lo;function Zg(t){eu=t}function fs(){return eu}const ms=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}},Wg=[];function se(t,e){const n=fs(),o=ms({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===lo?void 0:lo].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"}),co=t=>({status:"dirty",value:t}),At=t=>({status:"valid",value:t}),ol=t=>t.status==="aborted",il=t=>t.status==="dirty",Yo=t=>t.status==="valid",Jo=t=>typeof Promise<"u"&&t instanceof Promise;function gs(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 tu(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 nu=(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 Ut(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:(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 nu(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 nu(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 hn({schema:this,typeName:Ce.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return On.create(this,this._def)}nullable(){return hr.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return pn.create(this,this._def)}promise(){return fo.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 hn({...Ae(this._def),schema:this,typeName:Ce.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:Ce.ZodDefault})}brand(){return new ll({typeName:Ce.ZodBranded,type:this,...Ae(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new ui({...Ae(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 pi.create(this,e)}readonly(){return hi.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const jg=/^c[^\s-]{8,}$/i,Hg=/^[0-9a-z]+$/,qg=/^[0-9A-HJKMNP-TV-Z]{26}$/,Kg=/^[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,Xg=/^[a-z0-9_-]{21}$/i,Yg=/^[-+]?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)?)??$/,Jg=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Qg="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let sl;const ey=/^(?:(?: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])$/,ty=/^(([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})))$/,ny=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,ru="((\\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])))",ry=new RegExp(`^${ru}$`);function ou(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 oy(t){return new RegExp(`^${ou(t)}$`)}function iu(t){let e=`${ru}T${ou(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 iy(t,e){return!!((e==="v4"||!e)&&ey.test(t)||(e==="v6"||!e)&&ty.test(t))}class un extends Pe{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==le.string){const l=this._getOrReturnCtx(e);return se(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),se(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),se(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?se(i,{code:ee.too_big,maximum:l.value,type:"string",inclusive:!0,exact:!0,message:l.message}):d&&se(i,{code:ee.too_small,minimum:l.value,type:"string",inclusive:!0,exact:!0,message:l.message}),o.dirty())}else if(l.kind==="email")Jg.test(e.data)||(i=this._getOrReturnCtx(e,i),se(i,{validation:"email",code:ee.invalid_string,message:l.message}),o.dirty());else if(l.kind==="emoji")sl||(sl=new RegExp(Qg,"u")),sl.test(e.data)||(i=this._getOrReturnCtx(e,i),se(i,{validation:"emoji",code:ee.invalid_string,message:l.message}),o.dirty());else if(l.kind==="uuid")Kg.test(e.data)||(i=this._getOrReturnCtx(e,i),se(i,{validation:"uuid",code:ee.invalid_string,message:l.message}),o.dirty());else if(l.kind==="nanoid")Xg.test(e.data)||(i=this._getOrReturnCtx(e,i),se(i,{validation:"nanoid",code:ee.invalid_string,message:l.message}),o.dirty());else if(l.kind==="cuid")jg.test(e.data)||(i=this._getOrReturnCtx(e,i),se(i,{validation:"cuid",code:ee.invalid_string,message:l.message}),o.dirty());else if(l.kind==="cuid2")Hg.test(e.data)||(i=this._getOrReturnCtx(e,i),se(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),se(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),se(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),se(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),se(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),se(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),se(i,{code:ee.invalid_string,validation:{endsWith:l.value},message:l.message}),o.dirty()):l.kind==="datetime"?iu(l).test(e.data)||(i=this._getOrReturnCtx(e,i),se(i,{code:ee.invalid_string,validation:"datetime",message:l.message}),o.dirty()):l.kind==="date"?ry.test(e.data)||(i=this._getOrReturnCtx(e,i),se(i,{code:ee.invalid_string,validation:"date",message:l.message}),o.dirty()):l.kind==="time"?oy(l).test(e.data)||(i=this._getOrReturnCtx(e,i),se(i,{code:ee.invalid_string,validation:"time",message:l.message}),o.dirty()):l.kind==="duration"?Yg.test(e.data)||(i=this._getOrReturnCtx(e,i),se(i,{validation:"duration",code:ee.invalid_string,message:l.message}),o.dirty()):l.kind==="ip"?iy(e.data,l.version)||(i=this._getOrReturnCtx(e,i),se(i,{validation:"ip",code:ee.invalid_string,message:l.message}),o.dirty()):l.kind==="base64"?ny.test(e.data)||(i=this._getOrReturnCtx(e,i),se(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 un({...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 un({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new un({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new un({...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}}un.create=t=>{var e;return new un({checks:[],typeName:Ce.ZodString,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...Ae(t)})};function sy(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 se(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),se(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),se(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),se(o,{code:ee.too_big,maximum:l.value,type:"number",inclusive:l.inclusive,exact:!1,message:l.message}),i.dirty()):l.kind==="multipleOf"?sy(e.data,l.value)!==0&&(o=this._getOrReturnCtx(e,o),se(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),se(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,...Ae(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 se(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),se(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),se(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),se(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,...Ae(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 se(o,{code:ee.invalid_type,expected:le.boolean,received:o.parsedType}),be}return At(e.data)}}ti.create=t=>new ti({typeName:Ce.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...Ae(t)});class $r 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 se(l,{code:ee.invalid_type,expected:le.date,received:l.parsedType}),be}if(isNaN(e.data.getTime())){const l=this._getOrReturnCtx(e);return se(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),se(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),se(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 $r({...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}}$r.create=t=>new $r({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:Ce.ZodDate,...Ae(t)});class ys extends Pe{_parse(e){if(this._getType(e)!==le.symbol){const o=this._getOrReturnCtx(e);return se(o,{code:ee.invalid_type,expected:le.symbol,received:o.parsedType}),be}return At(e.data)}}ys.create=t=>new ys({typeName:Ce.ZodSymbol,...Ae(t)});class ni extends Pe{_parse(e){if(this._getType(e)!==le.undefined){const o=this._getOrReturnCtx(e);return se(o,{code:ee.invalid_type,expected:le.undefined,received:o.parsedType}),be}return At(e.data)}}ni.create=t=>new ni({typeName:Ce.ZodUndefined,...Ae(t)});class ri extends Pe{_parse(e){if(this._getType(e)!==le.null){const o=this._getOrReturnCtx(e);return se(o,{code:ee.invalid_type,expected:le.null,received:o.parsedType}),be}return At(e.data)}}ri.create=t=>new ri({typeName:Ce.ZodNull,...Ae(t)});class uo extends Pe{constructor(){super(...arguments),this._any=!0}_parse(e){return At(e.data)}}uo.create=t=>new uo({typeName:Ce.ZodAny,...Ae(t)});class zr extends Pe{constructor(){super(...arguments),this._unknown=!0}_parse(e){return At(e.data)}}zr.create=t=>new zr({typeName:Ce.ZodUnknown,...Ae(t)});class qn extends Pe{_parse(e){const n=this._getOrReturnCtx(e);return se(n,{code:ee.invalid_type,expected:le.never,received:n.parsedType}),be}}qn.create=t=>new qn({typeName:Ce.ZodNever,...Ae(t)});class vs extends Pe{_parse(e){if(this._getType(e)!==le.undefined){const o=this._getOrReturnCtx(e);return se(o,{code:ee.invalid_type,expected:le.void,received:o.parsedType}),be}return At(e.data)}}vs.create=t=>new vs({typeName:Ce.ZodVoid,...Ae(t)});class pn extends Pe{_parse(e){const{ctx:n,status:o}=this._processInputParams(e),i=this._def;if(n.parsedType!==le.array)return se(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)&&(se(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&&(se(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&&(se(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 pn({...this._def,minLength:{value:e,message:fe.toString(n)}})}max(e,n){return new pn({...this._def,maxLength:{value:e,message:fe.toString(n)}})}length(e,n){return new pn({...this._def,exactLength:{value:e,message:fe.toString(n)}})}nonempty(e){return this.min(1,e)}}pn.create=(t,e)=>new pn({type:t,minLength:null,maxLength:null,exactLength:null,typeName:Ce.ZodArray,...Ae(e)});function po(t){if(t instanceof nt){const e={};for(const n in t.shape){const o=t.shape[n];e[n]=On.create(po(o))}return new nt({...t._def,shape:()=>e})}else return t instanceof pn?new pn({...t._def,type:po(t.element)}):t instanceof On?On.create(po(t.unwrap())):t instanceof hr?hr.create(po(t.unwrap())):t instanceof Fn?Fn.create(t.items.map(e=>po(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 se(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&&(se(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,x=await m.value;h.push({key:y,value:x,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 po(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 On;)l=l._def.innerType;n[o]=l}}),new nt({...this._def,shape:()=>n})}keyof(){return su(Ge.objectKeys(this.shape))}}nt.create=(t,e)=>new nt({shape:()=>t,unknownKeys:"strip",catchall:qn.create(),typeName:Ce.ZodObject,...Ae(e)}),nt.strictCreate=(t,e)=>new nt({shape:()=>t,unknownKeys:"strict",catchall:qn.create(),typeName:Ce.ZodObject,...Ae(e)}),nt.lazycreate=(t,e)=>new nt({shape:t,unknownKeys:"strip",catchall:qn.create(),typeName:Ce.ZodObject,...Ae(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 Ut(d.ctx.common.issues));return se(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 Ut(p));return se(n,{code:ee.invalid_union,unionErrors:d}),be}}get options(){return this._def.options}}oi.create=(t,e)=>new oi({options:t,typeName:Ce.ZodUnion,...Ae(e)});const Kn=t=>t instanceof ai?Kn(t.schema):t instanceof hn?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 On?[void 0,...Kn(t.unwrap())]:t instanceof hr?[null,...Kn(t.unwrap())]:t instanceof ll||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 se(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}):(se(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:Ce.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:i,...Ae(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 ii 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}):(se(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:Ce.ZodIntersection,...Ae(n)});class Fn extends Pe{_parse(e){const{status:n,ctx:o}=this._processInputParams(e);if(o.parsedType!==le.array)return se(o,{code:ee.invalid_type,expected:le.array,received:o.parsedType}),be;if(o.data.length<this._def.items.length)return se(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&&(se(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,...Ae(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 se(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:Ce.ZodRecord,...Ae(o)}):new si({keyType:un.create(),valueType:e,typeName:Ce.ZodRecord,...Ae(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 se(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:Ce.ZodMap,...Ae(n)});class Ur extends Pe{_parse(e){const{status:n,ctx:o}=this._processInputParams(e);if(o.parsedType!==le.set)return se(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&&(se(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&&(se(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 Ur({...this._def,minSize:{value:e,message:fe.toString(n)}})}max(e,n){return new Ur({...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)}}Ur.create=(t,e)=>new Ur({valueType:t,minSize:null,maxSize:null,typeName:Ce.ZodSet,...Ae(e)});class ho extends Pe{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==le.function)return se(n,{code:ee.invalid_type,expected:le.function,received:n.parsedType}),be;function o(d,p){return ms({data:d,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,fs(),lo].filter(h=>!!h),issueData:{code:ee.invalid_arguments,argumentsError:p}})}function i(d,p){return ms({data:d,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,fs(),lo].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 fo){const d=this;return At(async function(...p){const h=new Ut([]),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 At(function(...p){const h=d._def.args.safeParse(p,l);if(!h.success)throw new Ut([o(p,h.error)]);const m=Reflect.apply(c,this,h.data),y=d._def.returns.safeParse(m,l);if(!y.success)throw new Ut([i(m,y.error)]);return y.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new ho({...this._def,args:Fn.create(e).rest(zr.create())})}returns(e){return new ho({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,n,o){return new ho({args:e||Fn.create([]).rest(zr.create()),returns:n||zr.create(),typeName:Ce.ZodFunction,...Ae(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:Ce.ZodLazy,...Ae(e)});class li extends Pe{_parse(e){if(e.data!==this._def.value){const n=this._getOrReturnCtx(e);return se(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:Ce.ZodLiteral,...Ae(e)});function su(t,e){return new pr({values:t,typeName:Ce.ZodEnum,...Ae(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 se(n,{expected:Ge.joinValues(o),received:n.parsedType,code:ee.invalid_type}),be}if(gs(this,Qo)||tu(this,Qo,new Set(this._def.values)),!gs(this,Qo).has(e.data)){const n=this._getOrReturnCtx(e),o=this._def.values;return se(n,{received:n.data,code:ee.invalid_enum_value,options:o}),be}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 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=su;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 se(o,{expected:Ge.joinValues(i),received:o.parsedType,code:ee.invalid_type}),be}if(gs(this,ei)||tu(this,ei,new Set(Ge.getValidEnumValues(this._def.values))),!gs(this,ei).has(e.data)){const i=Ge.objectValues(n);return se(o,{received:o.data,code:ee.invalid_enum_value,options:i}),be}return At(e.data)}get enum(){return this._def.values}}ei=new WeakMap,ci.create=(t,e)=>new ci({values:t,typeName:Ce.ZodNativeEnum,...Ae(e)});class fo 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 se(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 At(o.then(i=>this._def.type.parseAsync(i,{path:n.path,errorMap:n.common.contextualErrorMap})))}}fo.create=(t,e)=>new fo({type:t,typeName:Ce.ZodPromise,...Ae(e)});class hn 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=>{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 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"?co(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"?co(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)}}hn.create=(t,e,n)=>new hn({schema:t,typeName:Ce.ZodEffects,effect:e,...Ae(n)}),hn.createWithPreprocess=(t,e,n)=>new hn({schema:e,effect:{type:"preprocess",transform:t},typeName:Ce.ZodEffects,...Ae(n)});class On extends Pe{_parse(e){return this._getType(e)===le.undefined?At(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}On.create=(t,e)=>new On({innerType:t,typeName:Ce.ZodOptional,...Ae(e)});class hr extends Pe{_parse(e){return this._getType(e)===le.null?At(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}hr.create=(t,e)=>new hr({innerType:t,typeName:Ce.ZodNullable,...Ae(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:Ce.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Ae(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 Ut(o.common.issues)},input:o.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Ut(o.common.issues)},input:o.data})}}removeCatch(){return this._def.innerType}}ui.create=(t,e)=>new ui({innerType:t,typeName:Ce.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Ae(e)});class ws extends Pe{_parse(e){if(this._getType(e)!==le.nan){const o=this._getOrReturnCtx(e);return se(o,{code:ee.invalid_type,expected:le.nan,received:o.parsedType}),be}return{status:"valid",value:e.data}}}ws.create=t=>new ws({typeName:Ce.ZodNaN,...Ae(t)});const ay=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 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(),co(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:Ce.ZodPipeline})}}class hi extends Pe{_parse(e){const n=this._def.innerType._parse(e),o=i=>(Yo(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:Ce.ZodReadonly,...Ae(e)});function au(t,e={},n){return t?uo.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})}}):uo.create()}const ly={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 cy=(t,e={message:`Input not instance of ${t.name}`})=>au(n=>n instanceof t,e),lu=un.create,cu=dr.create,dy=ws.create,uy=ur.create,du=ti.create,py=$r.create,hy=ys.create,fy=ni.create,my=ri.create,gy=uo.create,yy=zr.create,vy=qn.create,_y=vs.create,Cy=pn.create,wy=nt.create,by=nt.strictCreate,xy=oi.create,ky=_s.create,Sy=ii.create,Ey=Fn.create,Ty=si.create,Ny=Cs.create,Ay=Ur.create,Vy=ho.create,By=ai.create,Py=li.create,Ry=pr.create,Dy=ci.create,Iy=fo.create,uu=hn.create,Fy=On.create,Oy=hr.create,Ly=hn.createWithPreprocess,My=pi.create;var Ln=Object.freeze({__proto__:null,defaultErrorMap:lo,setErrorMap:Zg,getErrorMap:fs,makeIssue:ms,EMPTY_PATH:Wg,addIssueToContext:se,ParseStatus:bt,INVALID:be,DIRTY:co,OK:At,isAborted:ol,isDirty:il,isValid:Yo,isAsync:Jo,get util(){return Ge},get objectUtil(){return rl},ZodParsedType:le,getParsedType:cr,ZodType:Pe,datetimeRegex:iu,ZodString:un,ZodNumber:dr,ZodBigInt:ur,ZodBoolean:ti,ZodDate:$r,ZodSymbol:ys,ZodUndefined:ni,ZodNull:ri,ZodAny:uo,ZodUnknown:zr,ZodNever:qn,ZodVoid:vs,ZodArray:pn,ZodObject:nt,ZodUnion:oi,ZodDiscriminatedUnion:_s,ZodIntersection:ii,ZodTuple:Fn,ZodRecord:si,ZodMap:Cs,ZodSet:Ur,ZodFunction:ho,ZodLazy:ai,ZodLiteral:li,ZodEnum:pr,ZodNativeEnum:ci,ZodPromise:fo,ZodEffects:hn,ZodTransformer:hn,ZodOptional:On,ZodNullable:hr,ZodDefault:di,ZodCatch:ui,ZodNaN:ws,BRAND:ay,ZodBranded:ll,ZodPipeline:pi,ZodReadonly:hi,custom:au,Schema:Pe,ZodSchema:Pe,late:ly,get ZodFirstPartyTypeKind(){return Ce},coerce:{string:t=>un.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=>$r.create({...t,coerce:!0})},any:gy,array:Cy,bigint:uy,boolean:du,date:py,discriminatedUnion:ky,effect:uu,enum:Ry,function:Vy,instanceof:cy,intersection:Sy,lazy:By,literal:Py,map:Ny,nan:dy,nativeEnum:Dy,never:vy,null:my,nullable:Oy,number:cu,object:wy,oboolean:()=>du().optional(),onumber:()=>cu().optional(),optional:Fy,ostring:()=>lu().optional(),pipeline:My,preprocess:Ly,promise:Iy,record:Ty,set:Ay,strictObject:by,string:lu,symbol:hy,transformer:uu,tuple:Ey,undefined:fy,union:xy,unknown:yy,void:_y,NEVER:be,ZodIssueCode:ee,quotelessJson:Ug,ZodError:Ut});function Gy(t){throw new Error("Unexpected object: "+t)}const $y=-2147483648,pu=-9007199254740991n,zy=NaN,Uy=NaN,Zy=null,Wy=null;function hu(t,e){switch(e){case"Int":return t===$y;case"Long":return t===Number(pu)||t===pu;case"Float":return t===zy;case"Double":return t===Uy;case"String":return t===Zy;case"Bytes":return t===Wy;default:throw Error(`unsupported data type: ${e}`)}}function jy(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 fu(t){return t.map(cl)}function bs(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=>bs(n,e))};case"outer":return{type:"outer",primary:bs(t.primary,e),secondary:t.secondary.map(n=>bs(n,e))};default:Gy(t)}}Ln.object({__isRef:Ln.literal(!0).describe("Crucial marker for the block dependency tree reconstruction"),blockId:Ln.string().describe("Upstream block id"),name:Ln.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 Hy(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=Ln.object({type:Ln.string(),importance:Ln.number().optional(),id:Ln.string().optional(),label:Ln.string()});Ln.array(qy);const Ky="1.14.1";function mu(){return Hy({sdkVersion:Ky})}function Xy(t){if(typeof globalThis.getEnvironmentValue=="function")return globalThis.getEnvironmentValue(t)}function mo(t){return!!t&&typeof t.children<"u"}function fr(t){return mo(t)?t.groupId:t.colId}function gu(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(!mo(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&&!gu(i.children[c],e,n);c--);return!1}function Yy(t){const e=(i,l)=>mo(i)&&mo(l)&&fr(i)===fr(l),n=(i,l)=>{if(!mo(l))return i;const c=i,d=l;return d.children&&d.groupId&&gu(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 Jy=class extends T.BeanStub{constructor(){super(...arguments),this.beanName="toolPanelColDefService"}wireBeans(t){this.columnModel=t.columnModel}createColumnTree(t){const e=[],n=(i,l)=>{if(mo(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=Yy(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 Qy(t){var e;return((e=t.sideBarService)==null?void 0:e.getSideBarComp().isDisplayed())??!1}function ev(t,e){var n;(n=t.sideBarService)==null||n.getSideBarComp().setDisplayed(e)}function tv(t,e){var n;(n=t.sideBarService)==null||n.getSideBarComp().setSideBarPosition(e)}function nv(t,e){var n;(n=t.sideBarService)==null||n.getSideBarComp().openToolPanel(e,"api")}function rv(t){var e;(e=t.sideBarService)==null||e.getSideBarComp().close("api")}function ov(t){var e;return((e=t.sideBarService)==null?void 0:e.getSideBarComp().openedItem())??null}function iv(t){var e;(e=t.sideBarService)==null||e.getSideBarComp().refresh()}function sv(t){var e;return((e=t.sideBarService)==null?void 0:e.getSideBarComp().isToolPanelShowing())??!1}function av(t,e){var o;const n=(o=t.sideBarService)==null?void 0:o.getSideBarComp().getToolPanelInstance(e);return T._unwrapUserComp(n)}function lv(t){var e;return(e=t.sideBarService)==null?void 0:e.getSideBarComp().getDef()}var cv=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",b._createIconNoSpan(this.toolPanelDef.iconKey,this.gos))}onButtonPressed(){this.dispatchLocalEvent({type:"toggleButtonClicked"})}setSelected(t){this.addOrRemoveCssClass("ag-selected",t),b._setAriaExpanded(this.eToggleButton,t)}getButtonElement(){return this.eToggleButton}},iy=class extends b.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!==b.KeyCode.TAB||!t.shiftKey)){if(this.focusService.focusNextGridCoreContainer(!0)){t.preventDefault();return}b._stopPropagationForAgGrid(t)}}setActiveButton(t){this.buttonComps.forEach(e=>{e.setSelected(t===e.getToolPanelId())})}addButtonComp(t){const e=this.createBean(new oy(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),b._clearElement(this.getGui()),super.destroy()}destroy(){this.clearButtons(),super.destroy()}},sy={selector:"AG-SIDE-BAR-BUTTONS",component:iy},Od={id:"columns",labelDefault:"Columns",labelKey:"columns",iconKey:"columns",toolPanel:"agColumnsToolPanel"},Ld={id:"filters",labelDefault:"Filters",labelKey:"filters",iconKey:"filter",toolPanel:"agFiltersToolPanel"},ja={columns:Od,filters:Ld};function qa(t){if(!t)return;if(t===!0)return{toolPanels:[Od,Ld],defaultToolPanel:"columns"};if(typeof t=="string")return qa([t]);if(Array.isArray(t)){const n=[];return t.forEach(o=>{const s=ja[o];if(!s){Gd(o);return}n.push(s)}),n.length===0?void 0:{toolPanels:n,defaultToolPanel:n[0].id}}return{toolPanels:ay(t.toolPanels),defaultToolPanel:t.defaultToolPanel,hiddenByDefault:t.hiddenByDefault,position:t.position}}function Gd(t){b._warnOnce(`the key ${t} is not a valid key for specifying a tool panel, valid keys are: ${Object.keys(ja).join(",")}`)}function ay(t){const e=[];return t&&t.forEach(n=>{let o=null;if(typeof n=="string"){const s=ja[n];if(!s){Gd(n);return}o=s}else o=n;e.push(o)}),e}var ly=class extends b.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}},cy=class extends b.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 ly);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:s,width:l}=t;this.toolPanelId=n,this.width=l;const c=this.userComponentFactory.getToolPanelCompDetails(t,e),u=c.newAgStackInstance();if(this.params=c.params,u==null){b._warnOnce(`error processing tool panel component ${n}. You need to specify 'toolPanel'`);return}u.then(this.setToolPanelComponent.bind(this)),o!=null&&this.resizeBar.setMinWidth(o),s!=null&&this.resizeBar.setMaxWidth(s)}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)}},dy=class extends b.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}},dv=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 cv(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()}},uv={selector:"AG-SIDE-BAR-BUTTONS",component:dv},yu={id:"columns",labelDefault:"Columns",labelKey:"columns",iconKey:"columns",toolPanel:"agColumnsToolPanel"},vu={id:"filters",labelDefault:"Filters",labelKey:"filters",iconKey:"filter",toolPanel:"agFiltersToolPanel"},dl={columns:yu,filters:vu};function ul(t){if(!t)return;if(t===!0)return{toolPanels:[yu,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){_u(o);return}n.push(i)}),n.length===0?void 0:{toolPanels:n,defaultToolPanel:n[0].id}}return{toolPanels:pv(t.toolPanels),defaultToolPanel:t.defaultToolPanel,hiddenByDefault:t.hiddenByDefault,position:t.position}}function _u(t){T._warnOnce(`the key ${t} is not a valid key for specifying a tool panel, valid keys are: ${Object.keys(dl).join(",")}`)}function pv(t){const e=[];return t&&t.forEach(n=>{let o=null;if(typeof n=="string"){const i=dl[n];if(!i){_u(n);return}o=i}else o=n;e.push(o)}),e}var hv=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}},fv=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 hv);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)}},mv=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>`,[sy]),this.sideBarButtons=b.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:qa(this.gos.get("sideBar")),sideBarState:t}),this.addManagedPropertyListener("sideBar",this.onSideBarUpdated.bind(this)),this.sideBarService.registerSideBarComp(this);const e=this.getFocusableElement();this.createManagedBean(new b.ManagedFocusFeature(e,{onTabKeyDown:this.onTabKeyDown.bind(this),handleKeyDown:this.handleKeyDown.bind(this)})),b._addFocusableContainerListener(this,e,this.focusService)}onTabKeyDown(t){if(t.defaultPrevented)return;const{focusService:e,sideBarButtons:n}=this,o=this.getGui(),s=n.getGui(),l=b._getActiveDomElement(this.gos),c=o.querySelector(".ag-tool-panel-wrapper:not(.ag-hidden)"),u=t.target;if(!c)return e.focusNextGridCoreContainer(t.shiftKey,!0);if(s.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,u)&&t.shiftKey&&(p=this.focusService.findFocusableElementBeforeTabGuard(c,u)),p||(p=s.querySelector(".ag-selected button")),p&&p!==t.target&&(t.preventDefault(),p.focus())}handleKeyDown(t){const e=b._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")),s=o.findIndex(u=>u.contains(e));let l=null;switch(t.key){case b.KeyCode.LEFT:case b.KeyCode.UP:l=Math.max(0,s-1);break;case b.KeyCode.RIGHT:case b.KeyCode.DOWN:l=Math.min(s+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 s=e?e.visible:!this.sideBar.hiddenByDefault;if(this.setDisplayed(s),this.setSideBarPosition(e?e.position:this.sideBar.position),s)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 s of t)this.createToolPanelAndSideButton(s,(o=e==null?void 0:e.toolPanels)==null?void 0:o[s.id],n==null?void 0:n[s.id])}validateDef(t){var e;if(t.id==null)return b._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(b.ModuleNames.ColumnsToolPanelModule,"Column Tool Panel"))return!1;if(t.toolPanel==="agFiltersToolPanel"){if(!this.gos.assertModuleRegistered(b.ModuleNames.FiltersToolPanelModule,"Filters Tool Panel"))return!1;if((e=this.filterManager)!=null&&e.isAdvancedFilterEnabled())return b._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 s;n?s=n:(s=this.createBean(new cy),s.setToolPanelDef(t,{initialState:e,onStateUpdated:()=>this.dispatchSideBarUpdated()})),s.setDisplayed(!1);const l=s.getGui();this.appendChild(l),this.toolPanelWrappers.push(s),b._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){b._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=qa(this.gos.get("sideBar")),e={};t&&this.sideBar&&((n=t.toolPanels)==null||n.forEach(o=>{var f,m;const{id:s}=o;if(!s)return;const l=(f=this.sideBar.toolPanels)==null?void 0:f.find(_=>_.id===s);if(!l||o.toolPanel!==l.toolPanel)return;const c=this.toolPanelWrappers.find(_=>_.getToolPanelId()===s);if(!c)return;const u=this.gos.addGridCommonParams({...o.toolPanelParams??{},onStateUpdated:()=>this.dispatchSideBarUpdated()});((m=c.getToolPanelInstance())==null?void 0:m.refresh(u))===!0&&(this.toolPanelWrappers=this.toolPanelWrappers.filter(_=>_!==c),b._removeFromParent(c.getGui()),e[s]=c)})),this.clearDownUi(),this.setSideBarDef({sideBarDef:t,existingToolPanelWrappers:e})}dispatchSideBarUpdated(){this.eventService.dispatchEvent({type:"sideBarUpdated"})}destroyToolPanelWrappers(){this.toolPanelWrappers.forEach(t=>{b._removeFromParent(t.getGui()),this.destroyBean(t)}),this.toolPanelWrappers.length=0}destroy(){this.destroyToolPanelWrappers(),super.destroy()}},uy={selector:"AG-SIDE-BAR",component:dy},py=class extends b.BeanStub{constructor(){super(...arguments),this.beanName="sideBarService"}registerSideBarComp(t){this.sideBarComp=t}getSideBarComp(){return this.sideBarComp}getSideBarSelector(){return uy}},Ka="32.3.3",zd=b._defineModule({version:Ka,moduleName:`${b.ModuleNames.SideBarModule}-core`,beans:[jg,py],dependantModules:[Me.EnterpriseCoreModule]}),hy=b._defineModule({version:Ka,moduleName:`${b.ModuleNames.SideBarModule}-api`,apiFunctions:{isSideBarVisible:qg,setSideBarVisible:Kg,setSideBarPosition:Yg,openToolPanel:Jg,closeToolPanel:Xg,getOpenedToolPanel:Qg,refreshToolPanel:ey,isToolPanelShowing:ty,getToolPanelInstance:ny,getSideBar:ry},dependantModules:[zd]}),Ya=b._defineModule({version:Ka,moduleName:b.ModuleNames.SideBarModule,dependantModules:[zd,hy]}),fy={sum:"Sum",first:"First",last:"Last",min:"Min",max:"Max",count:"Count",avg:"Average"},my=class extends b.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=gy,t.first=yy,t.last=_y,t.min=Cy,t.max=vy,t.count=wy,t.avg=by,this.initialised=!0}isAggFuncPossible(t,e){const n=this.getFuncNames(t),o=b._includes(n,e),s=b._exists(this.aggFuncsMap[e]);return o&&s}getDefaultFuncLabel(t){return fy[t]??t}getDefaultAggFunc(t){const e=t.getColDef().defaultAggFunc;if(b._exists(e)&&this.isAggFuncPossible(t,e))return e;if(this.isAggFuncPossible(t,"sum"))return"sum";const n=this.getFuncNames(t);return b._existsAndNotEmpty(n)?n[0]:null}addAggFuncs(t){this.init(),b._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 gy(t){const{values:e}=t;let n=null;for(let o=0;o<e.length;o++){const s=e[o];typeof s=="number"?n===null?n=s:n+=typeof n=="number"?s:BigInt(s):typeof s=="bigint"&&(n===null?n=s:n=(typeof n=="bigint"?n:BigInt(n))+s)}return n}function yy(t){return t.values.length>0?t.values[0]:null}function _y(t){return t.values.length>0?b._last(t.values):null}function Cy(t){const{values:e}=t;let n=null;for(let o=0;o<e.length;o++){const s=e[o];(typeof s=="number"||typeof s=="bigint")&&(n===null||n>s)&&(n=s)}return n}function vy(t){const{values:e}=t;let n=null;for(let o=0;o<e.length;o++){const s=e[o];(typeof s=="number"||typeof s=="bigint")&&(n===null||n<s)&&(n=s)}return n}function wy(t){var s,l;const{values:e}=t;let n=0;for(let c=0;c<e.length;c++){const u=e[c];n+=u!=null&&typeof u.value=="number"?u.value:1}const o=(l=(s=t.rowNode)==null?void 0:s.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 by(t){var c,u,p;const{values:e}=t;let n=0,o=0;for(let f=0;f<e.length;f++){const m=e[f];let _=null;typeof m=="number"||typeof m=="bigint"?(_=m,o++):m!=null&&(typeof m.value=="number"||typeof m.value=="bigint")&&typeof m.count=="number"&&(_=m.value*(typeof m.value=="number"?m.count:BigInt(m.count)),o+=m.count),typeof _=="number"?n+=typeof n=="number"?_:BigInt(_):typeof _=="bigint"&&(n=(typeof n=="bigint"?n:BigInt(n))+_)}let s=null;o>0&&(s=n/(typeof n=="number"?o:BigInt(o)));const l=(p=(c=t.rowNode)==null?void 0:c.aggData)==null?void 0:p[(u=t.column)==null?void 0:u.getColId()];return l&&l.count===o&&l.value===s?l:{count:o,value:s,toString:function(){return typeof this.value=="number"||typeof this.value=="bigint"?this.value.toString():""},toNumber:function(){return this.value}}}var xy=class extends b.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=b._missingOrEmpty(this.funcColsService.getValueColumns()),n=!this.gos.getCallback("getGroupRowAgg"),o=t.changedPath&&t.changedPath.isActive();if(e&&n&&o)return;const s=this.createAggDetails(t);this.recursivelyCreateAggData(s)}createAggDetails(t){const e=this.columnModel.isPivotActive(),n=this.funcColsService.getValueColumns(),o=e?this.funcColsService.getPivotColumns():[];return{alwaysAggregateAtRootLevel:this.gos.get("alwaysAggregateAtRootLevel"),groupIncludeTotalFooter:!!b._getGrandTotalRow(this.gos),changedPath:t.changedPath,valueColumns:n,pivotColumns:o,filteredOnly:!this.isSuppressAggFilteredOnly(),userAggFunc:this.gos.getCallback("getGroupRowAgg")}}isSuppressAggFilteredOnly(){return b._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 s;e.userAggFunc?s=e.userAggFunc({nodes:t.childrenAfterFilter}):n?s=null:o?s=this.aggregateRowNodeUsingValuesOnly(t,e):s=this.aggregateRowNodeUsingValuesAndPivot(t),t.setAggData(s),t.sibling&&t.sibling.setAggData(s)}aggregateRowNodeUsingValuesAndPivot(t){var s;const e={},n=((s=this.pivotResultColsService.getPivotResultCols())==null?void 0:s.list)??[];let o=!0;for(let l=0;l<n.length;l++){const c=n[l],u=c.getColDef();if(u.pivotTotalColumnIds!=null){o=!1;continue}const p=u.pivotKeys??[];let f;t.leafGroup?f=this.getValuesFromMappedSet(t.childrenMapped,p,u.pivotValueColumn):f=this.getValuesPivotNonLeaf(t,u.colId),e[u.colId]=this.aggregateValues(f,u.pivotValueColumn.getAggFunc(),u.pivotValueColumn,t,c)}if(!o)for(let l=0;l<n.length;l++){const c=n[l],u=c.getColDef();if(u.pivotTotalColumnIds==null||!u.pivotTotalColumnIds.length)continue;const p=u.pivotTotalColumnIds.map(f=>e[f]);e[u.colId]=this.aggregateValues(p,u.pivotValueColumn.getAggFunc(),u.pivotValueColumn,t,c)}return e}aggregateRowNodeUsingValuesOnly(t,e){const n={},o=e.changedPath.isActive()?e.changedPath.getValueColumnsForNode(t,e.valueColumns):e.valueColumns,s=e.changedPath.isActive()?e.changedPath.getNotValueColumnsForNode(t,e.valueColumns):null,l=this.getValuesNormal(t,o,e.filteredOnly),c=t.aggData;return o.forEach((u,p)=>{n[u.getId()]=this.aggregateValues(l[p],u.getAggFunc(),u,t)}),s&&c&&s.forEach(u=>{n[u.getId()]=c[u.getId()]}),n}getValuesPivotNonLeaf(t,e){return t.childrenAfterFilter.map(n=>n.aggData[e])}getValuesFromMappedSet(t,e,n){let o=t;for(let s=0;s<e.length;s++){const l=e[s];o=o?o[l]:null}return o?o.map(s=>this.valueService.getValue(n,s)):[]}getValuesNormal(t,e,n){const o=[];e.forEach(()=>o.push([]));const s=e.length,l=n?t.childrenAfterFilter:t.childrenAfterGroup,c=l.length;for(let u=0;u<c;u++){const p=l[u];for(let f=0;f<s;f++){const m=e[f],_=this.valueService.getValue(m,p);o[f].push(_)}}return o}aggregateValues(t,e,n,o,s){const l=typeof e=="string"?this.aggFuncService.getAggFunc(e):e;if(typeof l!="function")return b._errorOnce(`unrecognised aggregation function ${e}`),null;const c=l,u=this.gos.addGridCommonParams({values:t,column:n,colDef:n?n.getColDef():void 0,pivotResultColumn:s,rowNode:o,data:o?o.data:void 0});return c(u)}},ky=class extends b.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=b._isGroupMultiAutoColumn(this.gos);return n&&o&&(b._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((s,l)=>{e.push(this.createOneAutoCol(s,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=`${b.GROUP_AUTO_COLUMN_ID}-${t.getId()}`:n=b.GROUP_AUTO_COLUMN_ID;const o=this.createAutoColDef(n,t,e);o.colId=n;const s=new b.AgColumn(o,null,n,!0);return this.createBean(s),s}updateOneAutoCol(t,e,n){const o=t.getColDef(),s=typeof o.showRowGroup=="string"?o.showRowGroup:void 0,l=s!=null?this.columnModel.getColDefCol(s):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 s=this.gos.get("autoGroupColumnDef");b._mergeDeep(o,s),o=this.columnFactory.addColumnDefaultAndTypes(o,t),this.gos.get("treeData")||b._missing(o.field)&&b._missing(o.valueGetter)&&b._missing(o.filterValueGetter)&&o.filter!=="agGroupColumnFilter"&&(o.filter=!1),n&&n>0&&(o.headerCheckboxSelection=!1);const l=b._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}},Sy=class extends Me.PillDragComp{constructor(t,e,n,o,s){super(e,n,s,`
10
+ </div>`,[uv]),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 fv),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()}},gv={selector:"AG-SIDE-BAR",component:mv},yv=class extends T.BeanStub{constructor(){super(...arguments),this.beanName="sideBarService"}registerSideBarComp(t){this.sideBarComp=t}getSideBarComp(){return this.sideBarComp}getSideBarSelector(){return gv}},pl="32.3.3",Cu=T._defineModule({version:pl,moduleName:`${T.ModuleNames.SideBarModule}-core`,beans:[Jy,yv],dependantModules:[Me.EnterpriseCoreModule]}),vv=T._defineModule({version:pl,moduleName:`${T.ModuleNames.SideBarModule}-api`,apiFunctions:{isSideBarVisible:Qy,setSideBarVisible:ev,setSideBarPosition:tv,openToolPanel:nv,closeToolPanel:rv,getOpenedToolPanel:ov,refreshToolPanel:iv,isToolPanelShowing:sv,getToolPanelInstance:av,getSideBar:lv},dependantModules:[Cu]}),hl=T._defineModule({version:pl,moduleName:T.ModuleNames.SideBarModule,dependantModules:[Cu,vv]}),_v={sum:"Sum",first:"First",last:"Last",min:"Min",max:"Max",count:"Count",avg:"Average"},Cv=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=wv,t.first=bv,t.last=xv,t.min=kv,t.max=Sv,t.count=Ev,t.avg=Tv,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 _v[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 wv(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 bv(t){return t.values.length>0?t.values[0]:null}function xv(t){return t.values.length>0?T._last(t.values):null}function kv(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 Sv(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 Ev(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 Tv(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 Nv=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)}},Av=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}},Vv=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
- `,[b.SortIndicatorSelector]),this.column=t,this.dropZonePurpose=o,this.eSortIndicator=b.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 s=e("ariaDropZoneColumnValueItemDescription","Press ENTER to change the aggregation type");t.push(s)}if(this.isGroupingZone()&&this.column.isSortable()&&!n){const s=e("ariaDropZoneColumnGroupItemDescription","Press ENTER to sort");t.push(s)}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 "),s={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&&`, ${s[l]}`].filter(u=>!!u).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===b.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===b.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 s=b._loadTemplate('<div class="ag-select-agg-func-popup"></div>');s.style.top="0px",s.style.left="0px",s.appendChild(o),s.style.width=`${n.clientWidth}px`;const[l]=this.addManagedElementListeners(s,{focusout:m=>{!s.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()},u=this.localeService.getLocaleTextFunc(),p=this.popupService.addPopup({modal:!0,eChild:s,closeOnEsc:!0,closedCallback:c,ariaLabel:u("ariaLabelAggregationFunction","Aggregation Function")});p&&t.setComponentCreator(this.createAggSelect.bind(this,p.hideFunc)),t.addGuiEventListener("keydown",m=>{if(m.key===b.KeyCode.ENTER||m.key===b.KeyCode.SPACE){const _=t.getLastFocusedRow();if(_==null)return;const x=t.getComponentAt(_);x&&x.selectItem()}}),this.popupService.positionPopupByComponent({type:"aggFuncSelect",eventSource:n,ePopup:s,keepWithinBounds:!0,column:this.column,position:"under"}),t.refresh();let f=e.findIndex(m=>m===this.column.getAggFunc());f===-1&&(f=0),t.focusRow(f)}createAggSelect(t,e){const n=()=>{t(),this.getGui().focus(),this.funcColsService.setColumnAggFunc(this.column,e,"toolPanelDragAndDrop")},o=this.localeService.getLocaleTextFunc(),s=e.toString(),l=o(s,s);return new Ey(n,l)}isGroupingAndLocked(){return this.isGroupingZone()&&this.columnModel.isColGroupLocked(this.column)}isAggregationZone(){return this.dropZonePurpose==="aggregation"}isGroupingZone(){return this.dropZonePurpose==="rowGroup"}getDragSourceType(){return b.DragSourceType.ToolPanel}destroy(){super.destroy(),this.column=null}},Ey=class extends b.Component{constructor(t,e){super('<div class="ag-select-agg-func-item"/>'),this.selectItem=t,this.getGui().innerText=e,this.addGuiEventListener("click",this.selectItem)}},Ja=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===b.DragSourceType.HeaderCell||t===b.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(s=>!s.getColDef().lockVisible);this.columnModel.setColsVisible(o,e,n)}}isRowGroupPanel(){return this.dropZonePurpose==="rowGroup"}createPillComponent(t,e,n,o){return new Sy(t,e,n,this.dropZonePurpose,o)}},Xa=class extends Ja{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:b._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()}},Qa=class extends Ja{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:b._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()}},Ty=class extends b.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"),b._setAriaRole(t,"presentation"),this.rowGroupComp=new Qa(!0),this.createManagedBean(this.rowGroupComp),this.pivotComp=new Xa(!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)}},By={selector:"AG-GRID-HEADER-DROP-ZONES",component:Ty},Vy=class extends b.BeanStub{constructor(){super(...arguments),this.beanName="columnDropZonesService"}getDropZoneSelector(){return By}},Ny=class extends b.BeanStub{constructor(){super(...arguments),this.beanName="filterAggregatesStage"}wireBeans(t){this.filterManager=t.filterManager,this.columnModel=t.columnModel}execute(t){var f,m;const e=this.columnModel.isPivotMode(),n=((f=this.filterManager)==null?void 0:f.isAggregateFilterPresent())||((m=this.filterManager)==null?void 0:m.isAggregateQuickFilterPresent()),o=_=>!_.node.group,s=_=>_.node.leafGroup,l=b._getGroupAggFiltering(this.gos)||(e?s:o),{changedPath:c}=t,u=(_,x=!1)=>{_.childrenAfterFilter&&(_.childrenAfterAggFilter=_.childrenAfterFilter,x&&_.childrenAfterAggFilter.forEach(S=>u(S,x)),this.setAllChildrenCount(_)),_.sibling&&(_.sibling.childrenAfterAggFilter=_.childrenAfterAggFilter)},p=_=>{var x;_.childrenAfterAggFilter=((x=_.childrenAfterFilter)==null?void 0:x.filter(S=>{var G;return l({node:S})&&this.filterManager.doesRowPassAggregateFilters({rowNode:S})?(u(S,!0),!0):(G=S.childrenAfterAggFilter)==null?void 0:G.length}))||null,this.setAllChildrenCount(_),_.sibling&&(_.sibling.childrenAfterAggFilter=_.childrenAfterAggFilter)};c.forEachChangedNodeDepthFirst(n?p:u,!0)}setAllChildrenCountTreeData(t){const e=t.childrenAfterAggFilter;let n=0;if(e){const o=e.length;n=o;for(let s=0;s<o;++s)n+=e[s].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)}},Ay=class extends b.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 x=t.getComponentAt(y);x&&x.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 Bv(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}},Bv=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 Vv(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()}},Pv=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)}},Rv={selector:"AG-GRID-HEADER-DROP-ZONES",component:Pv},Dv=class extends T.BeanStub{constructor(){super(...arguments),this.beanName="columnDropZonesService"}getDropZoneSelector(){return Rv}},Iv=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,x=!1)=>{y.childrenAfterFilter&&(y.childrenAfterAggFilter=y.childrenAfterFilter,x&&y.childrenAfterAggFilter.forEach(w=>d(w,x)),this.setAllChildrenCount(y)),y.sibling&&(y.sibling.childrenAfterAggFilter=y.childrenAfterAggFilter)},p=y=>{var x;y.childrenAfterAggFilter=((x=y.childrenAfterFilter)==null?void 0:x.filter(w=>{var $;return l({node:w})&&this.filterManager.doesRowPassAggregateFilters({rowNode:w})?(d(w,!0),!0):($=w.childrenAfterAggFilter)==null?void 0:$.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)}},Fv=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=b.RefPlaceholder,this.eUnderlyingFilter=b.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&&b._warnOnce('Group Column Filter does not work with the colDef property "field". This property will be ignored.'),t.filterValueGetter&&b._warnOnce('Group Column Filter does not work with the colDef property "filterValueGetter". This property will be ignored.'),t.filterParams&&b._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 b._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||(b._warnOnce("Group Column Filter only works on group columns. Please use a different filter."),[])}updateGroupField(){b._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],b._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(b._loadTemplate('<div class="ag-filter-separator"></div>')),b._setDisplayed(this.eGroupField,!0)),e):(this.selectedColumn=void 0,b._setDisplayed(this.eGroupField,!1),null)}createGroupFieldSelectElement(t){this.eGroupFieldSelect=this.createManagedBean(new b.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"),b.AgPromise.resolve();const e=[],n=[];return t.forEach(o=>{const s=this.filterManager.getOrCreateFilterWrapper(o);s!=null&&s.filterPromise&&e.push(s.filterPromise.then(l=>(l&&n.push({filter:l,column:o}),o.getId()===this.selectedColumn.getId()&&(this.selectedFilter=l??void 0),l)))}),b.AgPromise.all(e).then(()=>{this.filterColumnPairs=n,this.groupColumn.setFilterActive(this.isFilterActive(),"columnRowGroupChanged")})}addUnderlyingFilterElement(){var e;if(b._clearElement(this.eUnderlyingFilter),!this.selectedColumn)return b.AgPromise.resolve();const t=this.createManagedBean(new b.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()}))??b.AgPromise.resolve()):b.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 b.AgPromise.resolve()}afterGuiAttached(t){this.afterGuiAttachedParams=t,this.addUnderlyingFilterElement()}afterGuiDetached(){var t,e;b._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:s})=>s.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()}},Py=class extends b.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()}},Ov=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=b.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 b.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 b.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,b._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,s;this.underlyingFloatingFilter=n,(s=this.underlyingFloatingFilter)==null||s.onParentModelChanged((o=this.parentFilterInstance.getSelectedFilter())==null?void 0:o.getModel()),this.appendChild(n.getGui()),this.showingUnderlyingFloatingFilter=!0})}return this.setupReadOnlyFloatingFilterElement(),b.AgPromise.resolve()}onColumnVisibleChanged(){this.setupUnderlyingFloatingFilterElement()}onColDefChanged(t){var n,o,s;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):(s=(o=this.underlyingFloatingFilter)==null?void 0:o.onParamsUpdated)==null||s.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()}},el=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(s=>!e.removeFromChildrenAfterGroup[s.id]),t.allLeafChildren=((o=t.allLeafChildren)==null?void 0:o.filter(s=>!e.removeFromAllLeafChildren[s.id]))??null,t.updateHasChildren();const n=t.sibling;n&&(n.childrenAfterGroup=t.childrenAfterGroup,n.allLeafChildren=t.allLeafChildren)}),this.allSets={},this.allParents.length=0}};function Dy(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($d(t[o-1],t[o])>0){n=!0;break}return n?(t.sort($d),!0):!1}function $d(t,e){const n=t.sourceRowIndex,o=e.sourceRowIndex,s=n>=0,l=o>=0,c=s&&l,u=!s&&!l;return c?n-o:u?t.__objectId-e.__objectId:s?1:-1}var Fy=class extends b.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 s;e.childrenAfterGroup.forEach(l=>{var c;(c=l.childrenAfterGroup)!=null&&c.length?l.key===""&&!s?s=l:o.push(l):n.push(l)}),s&&o.push(s),e.childrenAfterGroup=[...n,...o]}},!1)}createGroupingDetails(t){const{rowNode:e,changedPath:n,rowNodeTransactions:o,rowNodesOrderChanged:s}=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:!!s,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(u=>u.getColDef().keyCreator))??[]}}handleTransaction(t){t.transactions.forEach(e=>{const n=new el;b._existsAndNotEmpty(e.remove)&&this.removeNodes(e.remove,t,n),b._existsAndNotEmpty(e.update)&&this.moveNodesInWrongPath(e.update,t,n),b._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=>{Dy(e.childrenAfterGroup)&&t.changedPath.addParentNode(e)},!1,!0)}orderGroups(t){const e=t.initialGroupOrderComparator;b._exists(e)&&n(t.rootNode);function n(o){b._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 s=p=>p.key,l=this.getExistingPathForNode(o,e).map(s),c=this.getGroupInfo(o,e).map(s);b._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,s=n||new el;t.forEach(l=>{this.removeFromParent(l,s),this.forEachParentGroup(e,l.parent,c=>{s.removeFromAllLeafChildren(c,l)})}),o&&s.flush()}removeEmptyGroups(t,e){let n=!0;const o=s=>{var p;const l=this.getChildrenMappedKey(s.key,s.rowGroupColumn),c=s.parent;return(c!=null&&c.childrenMapped?!c.childrenMapped[l]:!0)?!1:!!s.group&&(((p=s.childrenAfterGroup)==null?void 0:p.length)??0)===0};for(;n;){n=!1;const s=new el;t.forEach(l=>{this.forEachParentGroup(e,l,c=>{o(c)&&(n=!0,this.removeFromParent(c,s),c.setSelectedParams({newValue:!1,source:"rowGroupChanged"}))})}),s.flush()}}removeFromParent(t,e){var o;t.parent&&(e?e.removeFromChildrenAfterGroup(t.parent,t):(b._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:b._areEqual(t.groupedCols,e.groupedCols)&&b._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 s=o.sibling;s&&(s.childrenAfterGroup=o.childrenAfterGroup,s.childrenMapped=o.childrenMapped),this.insertNodes(o.allLeafChildren,t)}noChangeInGroupingColumns(t,e){let n=!1;const o=this.showRowGroupColsService.getShowRowGroupCols(),s=o?o.map(l=>l.getId()).join("-"):"";return e&&(n=this.areGroupColsEqual(t,this.oldGroupingDetails),this.oldGroupDisplayColIds!==s&&this.checkAllGroupDataAfterColsChanged(t)),this.oldGroupingDetails=t,this.oldGroupDisplayColIds=s,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),s=this.findParentForNode(t,o,e,n);s.group||b._warnOnce("duplicate group keys for row data, keys should be unique",[s.data,t.data]),t.parent=s,t.level=o.length,s.childrenAfterGroup.push(t),s.updateHasChildren()}findParentForNode(t,e,n,o){let s=n.rootNode;return e.forEach((l,c)=>{s=this.getOrCreateNextNode(s,l,c,n),o!=null&&o.isRemoveFromAllLeafChildren(s,t)?o==null||o.preventRemoveFromAllLeafChildren(s,t):s.allLeafChildren.push(t)}),s}getOrCreateNextNode(t,e,n,o){var c;const s=this.getChildrenMappedKey(e.key,e.rowGroupColumn);let l=(c=t==null?void 0:t.childrenMapped)==null?void 0:c[s];return l||(l=this.createGroup(e,t,n,o),this.addToParent(l,t)),l}createGroup(t,e,n,o){const s=new b.RowNode(this.beans);return s.group=!0,s.field=t.field,s.rowGroupColumn=t.rowGroupColumn,this.setGroupData(s,t,o),s.key=t.key,s.id=this.createGroupId(s,e,n),s.level=n,s.leafGroup=n===o.groupedColCount-1,s.allLeafChildren=[],s.setAllChildrenCount(0),s.rowGroupIndex=n,s.childrenAfterGroup=[],s.childrenMapped={},s.updateHasChildren(),s.parent=e,this.setExpandedInitialValue(o,s),s}createGroupId(t,e,n){const o=(s,l)=>{if(!s.rowGroupColumn)return null;const c=l?o(l,l.parent):null;return`${c==null?"":c+"-"}${s.rowGroupColumn.getColId()}-${s.key}`};return b.RowNode.ID_PREFIX_ROW_GROUP+o(t,e)}setGroupData(t,e,n){t.groupData={},this.showRowGroupColsService.getShowRowGroupCols().forEach(s=>{const l=t.rowGroupColumn;l!==null&&s.isRowGroupDisplayed(l.getId())&&(n.suppressGroupMaintainValueType?t.groupData[s.getColId()]=e.key:t.groupData[s.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 s=this.valueService.getKeyForNode(o,t),l=s!=null&&s!=="";if((e.pivotMode||!e.groupAllowUnbalanced)&&!l&&(s="",l=!0),l){const u={key:s,field:o.getColDef().field,rowGroupColumn:o,leafNode:t};n.push(u)}}),n}},Ry=(t,e)=>t.treeNode.oldSourceRowIndex-e.treeNode.oldSourceRowIndex,ut=Object.freeze([]),My=ut.values(),fs=(t,e)=>{t.parent=null,t.treeNode=null,e?t.childrenAfterGroup=[]:(t.level=0,t.childrenAfterGroup=null,t.allLeafChildren=null)},Iy=class mm{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=ut,this.allLeafChildren=ut,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())??My}upsertKey(e){var o,s;typeof e!="string"&&(e=String(e));let n=(o=this.children)==null?void 0:o.get(e);return n||(n=new mm(this,e,this.level+1),(s=this.children??(this.children=new Map))==null||s.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&&fs(e,!0),this.parent=null)}setRow(e){const{level:n,row:o,childrenAfterGroup:s}=this;if(n<0)o!==null&&o!==e&&fs(o,!0);else{if(o===e)return!1;o!==null?(e.allLeafChildren=o.allLeafChildren??this.allLeafChildren??ut,fs(o,!1)):e.allLeafChildren=this.allLeafChildren??ut}return e.level=n,e.childrenAfterGroup=s,e.treeNode=this,this.row=e,!0}removeRow(e){const{level:n,row:o,duplicateRows:s,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??ut)):this.row=null}else{if(!(s!=null&&s.delete(e)))return!1;s.size===0&&(this.duplicateRows=null)}return fs(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=ut),e.childrenAfterGroup=ut,!0}sortFirstDuplicateRow(){const e=this.duplicateRows,n=this.row;if(!n||!e)return n;let o=n;for(const s of e)s.sourceRowIndex<o.sourceRowIndex&&(o=s);return o!==n&&(o.childrenAfterGroup=this.childrenAfterGroup,o.allLeafChildren=n.allLeafChildren??this.allLeafChildren??ut,n.childrenAfterGroup=ut,n.allLeafChildren=ut,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 u;this.childrenChanged=!1;const e=((u=this.children)==null?void 0:u.size)??0;if(e===0)return this.childrenAfterGroup.length===0?!1:(this.leafChildrenChanged=!0,this.childrenAfterGroup=ut,this.row.childrenAfterGroup=ut,!0);let n=!1,o=this.childrenAfterGroup;o===ut?(o=new Array(e),this.childrenAfterGroup=o,this.row.childrenAfterGroup=o,n=!0):o.length!==e&&(o.length=e,n=!0);let s=0,l=-1,c=!1;for(const p of this.enumChildren()){const f=p.getRowPosition();f<l&&(c=!0),l=f,p.oldSourceRowIndex=f;const m=p.row;o[s]!==m&&(o[s]=m,n=!0),++s}return n&&(this.leafChildrenChanged=!0),c&&this.reorderChildrenList(o),n||c}reorderChildrenList(e){const n=e.length,o=this.children;e.sort(Ry),o.clear();for(let s=0;s<n;++s){const l=e[s].treeNode;o.set(l.key,l)}}updateAllLeafChildren(){var c,u;const{parent:e,row:n,childrenAfterGroup:o}=this;this.leafChildrenChanged=!1;let s=!1;const l=o.length;if(l===0)s=((c=n.allLeafChildren)==null?void 0:c.length)!==0,n.allLeafChildren=ut,this.allLeafChildren=ut;else if(l===1&&((u=o[0].allLeafChildren)!=null&&u.length))n.allLeafChildren=o[0].allLeafChildren,this.allLeafChildren=null,s=!0;else{let p=this.allLeafChildren;(p===ut||p===null)&&(p=[],this.allLeafChildren=p);const f=p.length;let m=0;for(let _=0;_<l;++_){const x=o[_],S=x.allLeafChildren,V=S.length;if(V)for(let I=0;I<V;++I){const G=S[I];(m>=f||p[m]!==G)&&(p[m]=G,s=!0),++m}else(m>=f||p[m]!==x)&&x&&(p[m]=x,s=!0),++m}f!==m&&(p.length=m,s=!0),n.allLeafChildren!==p&&(n.allLeafChildren=p,s=!0)}s&&e&&(e.leafChildrenChanged=!0)}},Zd=t=>(t.treeNodeFlags&1)!==0,Ud=t=>(t.treeNodeFlags&2)!==0,Wd=t=>(t.treeNodeFlags&4)!==0,Oy=t=>(t.treeNodeFlags&8)!==0,Hd=t=>(t.treeNodeFlags&16)!==0,jd=(t,e)=>{e?t.treeNodeFlags|=2:t.treeNodeFlags&=-3},Ly=t=>{const e=t.treeNodeFlags;e&1&&(t.treeNodeFlags=e|4)},Gy=t=>{const e=t.treeNodeFlags;e&1&&(t.treeNodeFlags=e|12)},sr=t=>{t.treeNodeFlags|=16},qd=t=>{t.treeNodeFlags=1|t.treeNodeFlags&-29},si=t=>{t.treeNodeFlags=0},zy=class extends b.BeanStub{constructor(){super(...arguments),this.rowsPendingDestruction=null,this.root=new Iy(null,"",-1)}wireBeans(t){this.beans=t,this.showRowGroupColsService=t.showRowGroupColsService}destroy(){const t=this.root.row;t!==null&&(this.root.removeRow(t),si(t)),this.destroyTree(this.root),this.commitDestroyedRows(),super.destroy()}execute(t){const{rowNodeTransactions:e,rowNodesOrderChanged:n,changedPath:o}=t,s=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(s),s.leafGroup=!1;const p=s.sibling;p&&(p.childrenAfterGroup=s.childrenAfterGroup,p.childrenMapped=s.childrenMapped),e?this.handleTransaction(c,e,n):this.handleRowData(c,s,t.afterColumnsChanged===!0)}handleRowData(t,e,n){var s,l,c;const o=this.root;if(n||this.oldGroupDisplayColIds===void 0){const u=((l=(s=this.showRowGroupColsService)==null?void 0:s.getShowRowGroupCols())==null?void 0:l.map(p=>p.getId()).join("-"))??"";if(n){this.oldGroupDisplayColIds!==u&&this.checkAllGroupDataAfterColsChanged((c=o.row)==null?void 0:c.childrenAfterGroup);return}this.oldGroupDisplayColIds=u}this.clearTree(o),this.addOrUpdateRows(t,e.allLeafChildren,!1),this.commitTree(t)}handleTransaction(t,e,n){for(const{remove:o,update:s,add:l}of e)this.removeRows(o),this.addOrUpdateRows(t,s,!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 s=t[n].treeNode;s&&s.oldSourceRowIndex!==n&&s.invalidateOrder()}}checkAllGroupDataAfterColsChanged(t){var e;for(let n=0,o=(t==null?void 0:t.length)??0;n<o;++n){const s=t[n];this.setGroupData(s,((e=s.treeNode)==null?void 0:e.key)??s.key),this.checkAllGroupDataAfterColsChanged(s.childrenAfterGroup)}}addOrUpdateRows(t,e,n){for(let o=0,s=(e==null?void 0:e.length)??0;o<s;++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],s=o.treeNode;s!==null&&this.removeRow(s,o)}}getDataPath({getDataPath:t},{data:e}){const n=(t==null?void 0:t(e))||ut;return n.length||b._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 s=e.upsertKey(t[o]);if(o>=n)return s.invalidate(),s;e=s}return null}addOrUpdateRow(t,e,n){var c;const{level:o,row:s}=t;if(o<0)return;let l=!1;if(s!==e){const u=e.treeNode;u!==null&&u!==t&&(u.removeRow(e),u.invalidate()),s===null?(t.setRow(e),l=!0):s.data?t.addDuplicateRow(e)&&(l=!0):(t.setRow(e),this.destroyRow(s,!0),l=!0)}n&&!Wd(e)&&(Ly(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 s=!1;t.removeRow(e)&&(s=!0,n&&(n.childrenChanged=!0),this.destroyRow(e,!e.data)),s&&t.invalidate()}commitTree(t){var o;const e=this.root;this.commitInvalidatedChildren(t,e);const n=e.row;e.childrenChanged&&e.updateChildrenAfterGroup()&&sr(n),n.updateHasChildren(),Hd(n)&&(o=t.changedPath)!=null&&o.isActive()&&t.changedPath.addParentNode(n),qd(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 s of e.enumChildren()){const l=s.row;l!==null&&(l.parent=n)}const o=e.key;n.key!==o?(n.key=o,Gy(n),this.setGroupData(n,o)):n.groupData||this.setGroupData(n,o)}commitNodePostOrder(t,e,n){var f,m,_;const o=n.row,s=n.oldRow;if(n.isEmptyFillerNode()){this.clearTree(n);return}n.childrenChanged&&n.updateChildrenAfterGroup()&&sr(o),n.leafChildrenChanged&&n.updateAllLeafChildren();const l=n.getRowPosition();n.oldSourceRowIndex!==l&&(n.oldSourceRowIndex=l,e.childrenChanged=!0);const c=!!((f=o.childrenAfterGroup)!=null&&f.length),u=c||!o.data,p=o.group;p!==u?(sr(o),o.setGroup(u),!u&&!o.expanded&&jd(o,!1)):o.hasChildren()!==c&&(sr(o),o.updateHasChildren()),o.group&&!Ud(o)&&(s!==o&&s!==null&&s.group&&Ud(s)&&!t.isGroupOpenByDefault?o.expanded=s.expanded:o.expanded=this.getExpandedInitialValue(t,o),jd(o,!0)),Wd(o)&&(sr(e.row),Oy(o)&&o.setData(o.data)),s!==o&&(n.oldRow=o,s!==null&&(p||n.hasChildren())&&sr(o),e.childrenChanged=!0,sr(e.row)),Hd(o)?(m=t.changedPath)!=null&&m.isActive()&&t.changedPath.addParentNode(o):Zd(o)||(o.childrenAfterFilter||(o.childrenAfterFilter=o.childrenAfterGroup.slice()),o.childrenAfterAggFilter||(o.childrenAfterAggFilter=o.childrenAfterFilter.slice()),o.childrenAfterSort||(o.childrenAfterSort=o.childrenAfterAggFilter.slice())),qd(o),(_=n.duplicateRows)!=null&&_.size&&!n.duplicateRowsWarned&&(n.duplicateRowsWarned=!0,b._warnOnce("duplicate group keys for row data, keys should be unique",[o.id,o.data,...Array.from(n.duplicateRows).map(x=>x.data)]))}createFillerRow(t){const e=new b.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 s=o.parent;if(s===null)break;n=`${o.level}-${o.key}-${n}`,o=s}return e.id=b.RowNode.ID_PREFIX_ROW_GROUP+n,e}setGroupData(t,e){var s;const n={};t.groupData=n;const o=(s=this.showRowGroupColsService)==null?void 0:s.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:s}=t;if(e!==null&&n!==null&&(e.childrenChanged=!0,e.row!==null&&sr(e.row)),o!==null&&s>=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):si(e)),o)for(const s of o)n>=0&&!s.data?this.destroyRow(s,!0):si(s);for(const s of t.enumChildren())this.destroyTree(s);t.destroy()}destroyRow(t,e){if(!Zd(t)){si(t);return}if(!e){(this.rowsPendingDestruction??(this.rowsPendingDestruction=new Set)).add(t);return}si(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)}}},$y=class extends b.BeanStub{constructor(){super(...arguments),this.beanName="groupStage"}wireBeans(t){this.selectableService=t.selectableService}execute(t){const e=this.gos.get("treeData")?zy:Fy;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()}},Kd="PivotRowTotal_",Zy=class extends b.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(u=>{u.children!==void 0?n(u.children,c):c.push(u)}),c}const o=n(e);this.addRowGroupTotals(e,o),this.addExpandablePivotGroups(e,o),this.addPivotTotalsToGroups(e,o);const s=o.map(l=>b._cloneObject(l));return{pivotColumnGroupDefs:e,pivotColumnDefs:s}}createPivotColumnsFromUniqueValues(t){const e=this.funcColsService.getPivotColumns(),n=e.length;return this.recursivelyBuildGroup(0,t,[],n,e)}recursivelyBuildGroup(t,e,n,o,s){const l=this.funcColsService.getValueColumns();if(t>=o)return this.buildMeasureCols(n);const c=s[t].getColDef(),u=this.headerNameComparator.bind(this,c.pivotComparator);if(l.length===1&&this.gos.get("removePivotHeaderRowWhenSingleValueColumn")&&t===o-1){const f=[];return b._iterateObject(e,m=>{const _=[...n,m],x=this.createColDef(l[0],m,_);x.columnGroupShow="open",f.push(x)}),f.sort(u),f}const p=[];return b._iterateObject(e,(f,m)=>{const _=this.pivotDefaultExpanded===-1||t<this.pivotDefaultExpanded,x=[...n,f];p.push({children:this.recursivelyBuildGroup(t+1,m,x,o,s),headerName:f,pivotKeys:x,columnGroupShow:"open",openByDefault:_,groupId:this.generateColumnGroupId(x)})}),p.sort(u),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=(s,l,c)=>{if("children"in s){const f=new Map;s.children.forEach(_=>{o(_,l,f)});const m=!s.children.some(_=>_.children);this.funcColsService.getValueColumns().forEach(_=>{const x=this.columnNameService.getDisplayNameForColumn(_,"header"),S=this.createColDef(_,x,s.pivotKeys);S.pivotTotalColumnIds=f.get(_.getColId()),S.columnGroupShow=n?"open":"closed",S.aggFunc=_.getAggFunc(),m||(s.children.push(S),l.push(S))}),this.merge(c,f);return}if(!s.pivotValueColumn)return;const u=s.pivotValueColumn.getColId();c.has(u)?c.get(u).push(s.colId):c.set(u,[s.colId])};t.forEach(s=>{o(s,e,new Map)})}addPivotTotalsToGroups(t,e){if(!this.gos.get("pivotColumnGroupTotals"))return;const n=this.gos.get("pivotColumnGroupTotals")==="after",o=this.funcColsService.getValueColumns(),s=o.map(c=>c.getAggFunc());if(!s||s.length<1||!this.sameAggFuncs(s))return;const l=o[0];t.forEach(c=>{this.recursivelyAddPivotTotal(c,e,l,n)})}recursivelyAddPivotTotal(t,e,n,o){const s=t;if(!s.children){const c=t;return c.colId?[c.colId]:null}let l=[];if(s.children.forEach(c=>{const u=this.recursivelyAddPivotTotal(c,e,n,o);u&&(l=l.concat(u))}),s.children.length>1){const u=this.localeService.getLocaleTextFunc()("pivotColumnGroupTotals","Total"),p=this.createColDef(n,u,t.pivotKeys,!0);p.pivotTotalColumnIds=l,p.aggFunc=n.getAggFunc(),p.columnGroupShow=this.gos.get("suppressExpandablePivotGroups")?"open":void 0;const f=t.children;o?f.push(p):f.unshift(p),e.push(p)}return l}addRowGroupTotals(t,e){if(!this.gos.get("pivotRowTotals"))return;const n=this.gos.get("pivotRowTotals")==="after",s=this.funcColsService.getValueColumns().slice();n||s.reverse();const l=s.length>1||!this.gos.get("removePivotHeaderRowWhenSingleValueColumn");for(let c=0;c<s.length;c++){const u=s[c],p=this.columnNameService.getDisplayNameForColumn(u,"header"),f=this.createColDef(u,p,[]),m=[];for(let x=0;x<e.length;x++){const S=e[x];S.pivotValueColumn===u&&m.push(S.colId)}f.pivotTotalColumnIds=m,f.colId=Kd+f.colId;const _=l?{children:[f],pivotKeys:[],groupId:`${Kd}_pivotGroup_${u.getColId()}`}:f;e.push(f),n?t.push(_):t.unshift(_)}}createColDef(t,e,n,o=!1){const s={};if(t){const l=t.getColDef();Object.assign(s,l),s.hide=!1}return s.headerName=e,s.colId=this.generateColumnId(n||[],t&&!o?t.getColId():""),s.field=s.colId,s.valueGetter=l=>{var c;return(c=l.data)==null?void 0:c[l.colDef.field]},s.pivotKeys=n,s.pivotValueColumn=t,s.filter===!0&&(s.filter="agNumberColumnFilter"),s}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 s=0;s<t.length;s++){const c=t[s].split(this.fieldSeparator);let u=e;for(let p=0;p<c.length;p++){const f=c[p];u[f]==null&&(u[f]={}),u=u[f]}}const n=(s,l,c,u)=>{const p=[];for(const _ in c){const x=c[_],S=n(`${s}${this.fieldSeparator}${_}`,_,x,u+1);p.push(S)}if(p.length===0){const _=this.columnModel.getColDefCol(l);if(_){const S=this.columnNameService.getDisplayNameForColumn(_,"header")??l,V=this.createColDef(_,S,void 0,!1);return V.colId=s,V.aggFunc=_.getAggFunc(),V.valueGetter=I=>{var G;return(G=I.data)==null?void 0:G[s]},V}return{colId:s,headerName:l,valueGetter:S=>{var V;return(V=S.data)==null?void 0:V[s]}}}return this.gos.get("removePivotHeaderRowWhenSingleValueColumn")&&p.length===1&&"colId"in p[0]?(p[0].headerName=l,p[0]):{openByDefault:this.pivotDefaultExpanded===-1||u<this.pivotDefaultExpanded,groupId:s,headerName:l,children:p}},o=[];for(const s in e){const l=e[s],c=n(s,s,l,0);o.push(c)}return o}},Yd="Exceeded maximum allowed pivot column count.",Uy=class extends b.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===Yd){this.pivotResultColsService.setPivotResultCols([],"rowModelUpdated"),this.eventService.dispatchEvent({type:"pivotMaxColumnsExceeded",message:v.message}),this.lastTimeFailed=!0;return}throw v}const s=this.setUniqueValues(o),l=this.funcColsService.getValueColumns(),c=l.map(v=>`${v.getId()}-${v.getColDef().headerName}`).join("#"),u=l.map(v=>v.getAggFunc().toString()).join("#"),p=this.aggregationColumnsHashLastTime!==c,f=this.aggregationFuncsHashLastTime!==u;this.aggregationColumnsHashLastTime=c,this.aggregationFuncsHashLastTime=u;const m=this.funcColsService.getRowGroupColumns().map(v=>v.getId()).join("#"),_=m!==this.groupColumnsHashLastTime;this.groupColumnsHashLastTime=m;const x=this.gos.get("pivotRowTotals"),S=this.gos.get("pivotColumnGroupTotals"),V=this.gos.get("suppressExpandablePivotGroups"),I=this.gos.get("removePivotHeaderRowWhenSingleValueColumn"),G=x!==this.pivotRowTotalsLastTime||S!==this.pivotColumnGroupTotalsLastTime||V!==this.suppressExpandablePivotGroupsLastTime||I!==this.removePivotHeaderRowWhenSingleValueColumnLastTime;if(this.pivotRowTotalsLastTime=x,this.pivotColumnGroupTotalsLastTime=S,this.suppressExpandablePivotGroupsLastTime=V,this.removePivotHeaderRowWhenSingleValueColumnLastTime=I,this.lastTimeFailed||s||p||_||f||G){const{pivotColumnGroupDefs:v,pivotColumnDefs:R}=this.pivotColDefService.createPivotColumnDefs(this.uniqueValues);this.pivotColumnDefs=R,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 s;o.leafGroup?this.bucketRowNode(o,e):(s=o.childrenAfterFilter)==null||s.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 s={},l=e[n];if(t.forEach(c=>{let u=this.valueService.getKeyForNode(l,c);if(b._missing(u)&&(u=""),!o[u]){this.currentUniqueCount+=1,o[u]={};const p=this.maxUniqueValues!==-1,f=this.currentUniqueCount>this.maxUniqueValues;if(p&&f)throw Error(Yd)}s[u]||(s[u]=[]),s[u].push(c)}),n===e.length-1)return s;{const c={};return b._iterateObject(s,(u,p)=>{c[u]=this.bucketChildren(p,e,n+1,o[u])}),c}}getPivotColumnDefs(){return this.pivotColumnDefs}};function Wy(t,e,n){t.aggFuncService&&t.aggFuncService.addAggFuncs({key:n})}function Hy(t,e){t.aggFuncService&&t.aggFuncService.addAggFuncs(e)}function jy(t){t.aggFuncService&&t.aggFuncService.clear()}function qy(t,e,n){t.funcColsService.setColumnAggFunc(e,n,"api")}function Ky(t){return t.columnModel.isPivotMode()}function Yy(t,e,n){return t.pivotResultColsService.lookupPivotResultCol(e,n)}function Jy(t,e){t.funcColsService.setValueColumns(e,"api")}function Xy(t){return t.funcColsService.getValueColumns()}function Qy(t,e){t.funcColsService.removeValueColumns([e],"api")}function e_(t,e){t.funcColsService.removeValueColumns(e,"api")}function t_(t,e){t.funcColsService.addValueColumns([e],"api")}function n_(t,e){t.funcColsService.addValueColumns(e,"api")}function r_(t,e){t.funcColsService.setRowGroupColumns(e,"api")}function o_(t,e){t.funcColsService.removeRowGroupColumns([e],"api")}function i_(t,e){t.funcColsService.removeRowGroupColumns(e,"api")}function s_(t,e){t.funcColsService.addRowGroupColumns([e],"api")}function a_(t,e){t.funcColsService.addRowGroupColumns(e,"api")}function l_(t,e,n){t.funcColsService.moveRowGroupColumn(e,n,"api")}function c_(t){return t.funcColsService.getRowGroupColumns()}function d_(t,e){t.funcColsService.setPivotColumns(e,"api")}function u_(t,e){t.funcColsService.removePivotColumns([e],"api")}function p_(t,e){t.funcColsService.removePivotColumns(e,"api")}function h_(t,e){t.funcColsService.addPivotColumns([e],"api")}function f_(t,e){t.funcColsService.addPivotColumns(e,"api")}function m_(t){return t.funcColsService.getPivotColumns()}function g_(t,e){t.pivotResultColsService.setPivotResultCols(e,"api")}function y_(t){const e=t.pivotResultColsService.getPivotResultCols();return e?e.list:null}var __=class extends b.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]}},ai="32.3.3",tl=b._defineModule({version:ai,moduleName:`${b.ModuleNames.RowGroupingModule}-core`,beans:[xy,Ny,$y,Zy,Uy,my,ky,__,Vy],userComponents:[{name:"agGroupRowRenderer",classImp:Me.GroupCellRenderer},{name:"agGroupCellRenderer",classImp:Me.GroupCellRenderer}],controllers:[{name:"groupCellRendererCtrl",classImp:Me.GroupCellRendererCtrl}],dependantModules:[Me.EnterpriseCoreModule]}),C_=b._defineModule({version:ai,moduleName:`${b.ModuleNames.RowGroupingModule}-api`,apiFunctions:{addAggFunc:Wy,addAggFuncs:Hy,clearAggFuncs:jy,setColumnAggFunc:qy,isPivotMode:Ky,getPivotResultColumn:Yy,setValueColumns:Jy,getValueColumns:Xy,removeValueColumn:Qy,removeValueColumns:e_,addValueColumn:t_,addValueColumns:n_,setRowGroupColumns:r_,removeRowGroupColumn:o_,removeRowGroupColumns:i_,addRowGroupColumn:s_,addRowGroupColumns:a_,getRowGroupColumns:c_,moveRowGroupColumn:l_,setPivotColumns:d_,removePivotColumn:u_,removePivotColumns:p_,addPivotColumn:h_,addPivotColumns:f_,getPivotColumns:m_,setPivotResultColumns:g_,getPivotResultColumns:y_},dependantModules:[tl]}),Jd=b._defineModule({version:ai,moduleName:"@ag-grid-enterprise/group-filter",userComponents:[{name:"agGroupColumnFilter",classImp:Ay}],dependantModules:[tl,b._ColumnFilterModule]}),v_=b._defineModule({version:ai,moduleName:"@ag-grid-enterprise/group-floating-filter",userComponents:[{name:"agGroupColumnFloatingFilter",classImp:Py}],dependantModules:[Jd,b._FloatingFilterModule]}),w_=b._defineModule({version:ai,moduleName:b.ModuleNames.RowGroupingModule,dependantModules:[tl,C_,Jd,v_]}),Xd=class extends Ja{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:b._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()}},Qd=300,b_=class extends b.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()}},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 Lv(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(wu(t[o-1],t[o])>0){n=!0;break}return n?(t.sort(wu),!0):!1}function wu(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 Mv=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=>{Lv(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}},Gv=(t,e)=>t.treeNode.oldSourceRowIndex-e.treeNode.oldSourceRowIndex,gt=Object.freeze([]),$v=gt.values(),xs=(t,e)=>{t.parent=null,t.treeNode=null,e?t.childrenAfterGroup=[]:(t.level=0,t.childrenAfterGroup=null,t.allLeafChildren=null)},zv=class bg{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=gt,this.allLeafChildren=gt,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())??$v}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 bg(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&&xs(e,!0),this.parent=null)}setRow(e){const{level:n,row:o,childrenAfterGroup:i}=this;if(n<0)o!==null&&o!==e&&xs(o,!0);else{if(o===e)return!1;o!==null?(e.allLeafChildren=o.allLeafChildren??this.allLeafChildren??gt,xs(o,!1)):e.allLeafChildren=this.allLeafChildren??gt}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??gt)):this.row=null}else{if(!(i!=null&&i.delete(e)))return!1;i.size===0&&(this.duplicateRows=null)}return xs(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=gt),e.childrenAfterGroup=gt,!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??gt,n.childrenAfterGroup=gt,n.allLeafChildren=gt,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=gt,this.row.childrenAfterGroup=gt,!0);let n=!1,o=this.childrenAfterGroup;o===gt?(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(Gv),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=gt,this.allLeafChildren=gt;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===gt||p===null)&&(p=[],this.allLeafChildren=p);const h=p.length;let m=0;for(let y=0;y<l;++y){const x=o[y],w=x.allLeafChildren,E=w.length;if(E)for(let O=0;O<E;++O){const $=w[O];(m>=h||p[m]!==$)&&(p[m]=$,i=!0),++m}else(m>=h||p[m]!==x)&&x&&(p[m]=x,i=!0),++m}h!==m&&(p.length=m,i=!0),n.allLeafChildren!==p&&(n.allLeafChildren=p,i=!0)}i&&e&&(e.leafChildrenChanged=!0)}},bu=t=>(t.treeNodeFlags&1)!==0,xu=t=>(t.treeNodeFlags&2)!==0,ku=t=>(t.treeNodeFlags&4)!==0,Uv=t=>(t.treeNodeFlags&8)!==0,Su=t=>(t.treeNodeFlags&16)!==0,Eu=(t,e)=>{e?t.treeNodeFlags|=2:t.treeNodeFlags&=-3},Zv=t=>{const e=t.treeNodeFlags;e&1&&(t.treeNodeFlags=e|4)},Wv=t=>{const e=t.treeNodeFlags;e&1&&(t.treeNodeFlags=e|12)},mr=t=>{t.treeNodeFlags|=16},Tu=t=>{t.treeNodeFlags=1|t.treeNodeFlags&-29},fi=t=>{t.treeNodeFlags=0},jv=class extends T.BeanStub{constructor(){super(...arguments),this.rowsPendingDestruction=null,this.root=new zv(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))||gt;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&&!ku(e)&&(Zv(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),Tu(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,Wv(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&&Eu(o,!1)):o.hasChildren()!==c&&(mr(o),o.updateHasChildren()),o.group&&!xu(o)&&(i!==o&&i!==null&&i.group&&xu(i)&&!t.isGroupOpenByDefault?o.expanded=i.expanded:o.expanded=this.getExpandedInitialValue(t,o),Eu(o,!0)),ku(o)&&(mr(e.row),Uv(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):bu(o)||(o.childrenAfterFilter||(o.childrenAfterFilter=o.childrenAfterGroup.slice()),o.childrenAfterAggFilter||(o.childrenAfterAggFilter=o.childrenAfterFilter.slice()),o.childrenAfterSort||(o.childrenAfterSort=o.childrenAfterAggFilter.slice())),Tu(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(x=>x.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(!bu(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)}}},Hv=class extends T.BeanStub{constructor(){super(...arguments),this.beanName="groupStage"}wireBeans(t){this.selectableService=t.selectableService}execute(t){const e=this.gos.get("treeData")?jv:Mv;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()}},Nu="PivotRowTotal_",qv=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],x=this.createColDef(l[0],m,y);x.columnGroupShow="open",h.push(x)}),h.sort(d),h}const p=[];return T._iterateObject(e,(h,m)=>{const y=this.pivotDefaultExpanded===-1||t<this.pivotDefaultExpanded,x=[...n,h];p.push({children:this.recursivelyBuildGroup(t+1,m,x,o,i),headerName:h,pivotKeys:x,columnGroupShow:"open",openByDefault:y,groupId:this.generateColumnGroupId(x)})}),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 x=this.columnNameService.getDisplayNameForColumn(y,"header"),w=this.createColDef(y,x,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 x=0;x<e.length;x++){const w=e[x];w.pivotValueColumn===d&&m.push(w.colId)}h.pivotTotalColumnIds=m,h.colId=Nu+h.colId;const y=l?{children:[h],pivotKeys:[],groupId:`${Nu}_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 x=c[y],w=n(`${i}${this.fieldSeparator}${y}`,y,x,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,E=this.createColDef(y,w,void 0,!1);return E.colId=i,E.aggFunc=y.getAggFunc(),E.valueGetter=O=>{var $;return($=O.data)==null?void 0:$[i]},E}return{colId:i,headerName:l,valueGetter:w=>{var E;return(E=w.data)==null?void 0:E[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.",Kv=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(b){if(b.message===Au){this.pivotResultColsService.setPivotResultCols([],"rowModelUpdated"),this.eventService.dispatchEvent({type:"pivotMaxColumnsExceeded",message:b.message}),this.lastTimeFailed=!0;return}throw b}const i=this.setUniqueValues(o),l=this.funcColsService.getValueColumns(),c=l.map(b=>`${b.getId()}-${b.getColDef().headerName}`).join("#"),d=l.map(b=>b.getAggFunc().toString()).join("#"),p=this.aggregationColumnsHashLastTime!==c,h=this.aggregationFuncsHashLastTime!==d;this.aggregationColumnsHashLastTime=c,this.aggregationFuncsHashLastTime=d;const m=this.funcColsService.getRowGroupColumns().map(b=>b.getId()).join("#"),y=m!==this.groupColumnsHashLastTime;this.groupColumnsHashLastTime=m;const x=this.gos.get("pivotRowTotals"),w=this.gos.get("pivotColumnGroupTotals"),E=this.gos.get("suppressExpandablePivotGroups"),O=this.gos.get("removePivotHeaderRowWhenSingleValueColumn"),$=x!==this.pivotRowTotalsLastTime||w!==this.pivotColumnGroupTotalsLastTime||E!==this.suppressExpandablePivotGroupsLastTime||O!==this.removePivotHeaderRowWhenSingleValueColumnLastTime;if(this.pivotRowTotalsLastTime=x,this.pivotColumnGroupTotalsLastTime=w,this.suppressExpandablePivotGroupsLastTime=E,this.removePivotHeaderRowWhenSingleValueColumnLastTime=O,this.lastTimeFailed||i||p||y||h||$){const{pivotColumnGroupDefs:b,pivotColumnDefs:R}=this.pivotColDefService.createPivotColumnDefs(this.uniqueValues);this.pivotColumnDefs=R,this.pivotResultColsService.setPivotResultCols(b,"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 Xv(t,e,n){t.aggFuncService&&t.aggFuncService.addAggFuncs({key:n})}function Yv(t,e){t.aggFuncService&&t.aggFuncService.addAggFuncs(e)}function Jv(t){t.aggFuncService&&t.aggFuncService.clear()}function Qv(t,e,n){t.funcColsService.setColumnAggFunc(e,n,"api")}function e_(t){return t.columnModel.isPivotMode()}function t_(t,e,n){return t.pivotResultColsService.lookupPivotResultCol(e,n)}function n_(t,e){t.funcColsService.setValueColumns(e,"api")}function r_(t){return t.funcColsService.getValueColumns()}function o_(t,e){t.funcColsService.removeValueColumns([e],"api")}function i_(t,e){t.funcColsService.removeValueColumns(e,"api")}function s_(t,e){t.funcColsService.addValueColumns([e],"api")}function a_(t,e){t.funcColsService.addValueColumns(e,"api")}function l_(t,e){t.funcColsService.setRowGroupColumns(e,"api")}function c_(t,e){t.funcColsService.removeRowGroupColumns([e],"api")}function d_(t,e){t.funcColsService.removeRowGroupColumns(e,"api")}function u_(t,e){t.funcColsService.addRowGroupColumns([e],"api")}function p_(t,e){t.funcColsService.addRowGroupColumns(e,"api")}function h_(t,e,n){t.funcColsService.moveRowGroupColumn(e,n,"api")}function f_(t){return t.funcColsService.getRowGroupColumns()}function m_(t,e){t.funcColsService.setPivotColumns(e,"api")}function g_(t,e){t.funcColsService.removePivotColumns([e],"api")}function y_(t,e){t.funcColsService.removePivotColumns(e,"api")}function v_(t,e){t.funcColsService.addPivotColumns([e],"api")}function __(t,e){t.funcColsService.addPivotColumns(e,"api")}function C_(t){return t.funcColsService.getPivotColumns()}function w_(t,e){t.pivotResultColsService.setPivotResultCols(e,"api")}function b_(t){const e=t.pivotResultColsService.getPivotResultCols();return e?e.list:null}var x_=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",vl=T._defineModule({version:mi,moduleName:`${T.ModuleNames.RowGroupingModule}-core`,beans:[Nv,Iv,Hv,qv,Kv,Cv,Av,x_,Dv],userComponents:[{name:"agGroupRowRenderer",classImp:Me.GroupCellRenderer},{name:"agGroupCellRenderer",classImp:Me.GroupCellRenderer}],controllers:[{name:"groupCellRendererCtrl",classImp:Me.GroupCellRendererCtrl}],dependantModules:[Me.EnterpriseCoreModule]}),k_=T._defineModule({version:mi,moduleName:`${T.ModuleNames.RowGroupingModule}-api`,apiFunctions:{addAggFunc:Xv,addAggFuncs:Yv,clearAggFuncs:Jv,setColumnAggFunc:Qv,isPivotMode:e_,getPivotResultColumn:t_,setValueColumns:n_,getValueColumns:r_,removeValueColumn:o_,removeValueColumns:i_,addValueColumn:s_,addValueColumns:a_,setRowGroupColumns:l_,removeRowGroupColumn:c_,removeRowGroupColumns:d_,addRowGroupColumn:u_,addRowGroupColumns:p_,getRowGroupColumns:f_,moveRowGroupColumn:h_,setPivotColumns:m_,removePivotColumn:g_,removePivotColumns:y_,addPivotColumn:v_,addPivotColumns:__,getPivotColumns:C_,setPivotResultColumns:w_,getPivotResultColumns:b_},dependantModules:[vl]}),Vu=T._defineModule({version:mi,moduleName:"@ag-grid-enterprise/group-filter",userComponents:[{name:"agGroupColumnFilter",classImp:Fv}],dependantModules:[vl,T._ColumnFilterModule]}),S_=T._defineModule({version:mi,moduleName:"@ag-grid-enterprise/group-floating-filter",userComponents:[{name:"agGroupColumnFloatingFilter",classImp:Ov}],dependantModules:[Vu,T._FloatingFilterModule]}),E_=T._defineModule({version:mi,moduleName:T.ModuleNames.RowGroupingModule,dependantModules:[vl,k_,Vu,S_]}),Bu=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()}},Pu=300,T_=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>`,[b.AgCheckboxSelector,b.AgInputTextFieldSelector]),this.eExpand=b.RefPlaceholder,this.eSelect=b.RefPlaceholder,this.eFilterTextField=b.RefPlaceholder}wireBeans(t){this.columnModel=t.columnModel}postConstruct(){this.createExpandIcons(),this.addManagedListeners(this.eExpand,{click:this.onExpandClicked.bind(this),keydown:e=>{e.key===b.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=b._createIconNoSpan("columnSelectOpen",this.gos)),this.eExpand.appendChild(this.eExpandUnchecked=b._createIconNoSpan("columnSelectClosed",this.gos)),this.eExpand.appendChild(this.eExpandIndeterminate=b._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(),s=this.localeService.getLocaleTextFunc();this.eFilterTextField.setInputPlaceholder(s("searchOoo","Search...")),b._setDisplayed(this.eFilterTextField.getGui(),t),b._setDisplayed(this.eSelect.getGui(),e),b._setDisplayed(this.eExpand,n&&o)}onFilterTextChanged(){this.onFilterTextChangedDebounced||(this.onFilterTextChangedDebounced=b._debounce(()=>{const t=this.eFilterTextField.getValue();this.dispatchLocalEvent({type:"filterChanged",filterText:t})},Qd)),this.onFilterTextChangedDebounced()}onMiniFilterKeyDown(t){t.key===b.KeyCode.ENTER&&setTimeout(()=>this.onSelectClicked(),Qd)}onSelectClicked(){this.dispatchLocalEvent({type:this.selectState?"unselectAll":"selectAll"})}onExpandClicked(){this.dispatchLocalEvent({type:this.expandState===0?"collapseAll":"expandAll"})}setExpandState(t){this.expandState=t,b._setDisplayed(this.eExpandChecked,this.expandState===0),b._setDisplayed(this.eExpandUnchecked,this.expandState===1),b._setDisplayed(this.eExpandIndeterminate,this.expandState===2)}setSelectionState(t){this.selectState=t,this.eSelect.setValue(this.selectState)}},x_={selector:"AG-PRIMARY-COLS-HEADER",component:b_},eu=class{constructor(t,e,n,o=!1,s){this.localEventService=new b.LocalEventService,this.displayName=t,this.dept=n,this.group=o,o?(this.columnGroup=e,this.expanded=s,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)}},tu=class extends b.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(),b.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){b.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 s=()=>{};e.appendChild(n.getGui()),n.addMenuItems(t),n.addManagedListeners(n,{closeMenu:()=>{this.parentEl.focus(),s()}});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&&(s=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(s=>e.allowedFunction(s)&&!e.activeFunction(s)),o=this.columns.some(s=>e.allowedFunction(s)&&e.activeFunction(s));n&&t.push({name:e.activateLabel(this.displayName),icon:b._createIconNoSpan(e.addIcon,this.gos,null),action:()=>e.activateFunction()}),o&&t.push({name:e.deactivateLabel(this.displayName),icon:b._createIconNoSpan(e.removeIcon,this.gos,null),action:()=>e.deActivateFunction()})}return t}},nu=class extends b.Component{constructor(t,e,n,o){super(),this.modelItem=t,this.allowDragging=e,this.eventType=n,this.focusWrapper=o,this.cbSelect=b.RefPlaceholder,this.eLabel=b.RefPlaceholder,this.eGroupOpenedIcon=b.RefPlaceholder,this.eGroupClosedIcon=b.RefPlaceholder,this.eColumnGroupIcons=b.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})},Pu)),this.onFilterTextChangedDebounced()}onMiniFilterKeyDown(t){t.key===T.KeyCode.ENTER&&setTimeout(()=>this.onSelectClicked(),Pu)}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)}},N_={selector:"AG-PRIMARY-COLS-HEADER",component:T_},Ru=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)}},Du=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}},Iu=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>`,[b.AgCheckboxSelector]),this.eDragHandle=b._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(),b._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 s=t.headerTooltip;this.setTooltip({newTooltipText:s,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 b.KeyCode.LEFT:t.preventDefault(),this.modelItem.setExpanded(!1);break;case b.KeyCode.RIGHT:t.preventDefault(),this.modelItem.setExpanded(!0);break;case b.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 tu(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){b._setDisplayed(this.eDragHandle,!1);return}let t=!this.gos.get("suppressDragLeaveHidesColumns");const e={type:b.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 s=o.getId();e[s]=o.isVisible(),n[s]=this.modelItemUtils.createPivotState(o)}),{columns:t,visibleState:e,pivotState:n}}setupExpandContract(){this.eGroupClosedIcon.appendChild(b._createIcon("columnSelectClosed",this.gos,null)),this.eGroupOpenedIcon.appendChild(b._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 b.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"),s=t("ariaToggleVisibility","Press SPACE to toggle visibility");b._setAriaLabel(this.focusWrapper,`${this.displayName} ${e}`),this.cbSelect.setInputAriaLabel(`${s} (${o})`),b._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(s=>{!t&&s.getColDef().lockVisible||(this.isColumnChecked(s,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(),s=t.isValueActive();return n||o||s}return t.isVisible()}onExpandOrContractClicked(){const t=this.modelItem.isExpanded();this.modelItem.setExpanded(!t)}onExpandChanged(){this.setOpenClosedIcons(),this.refreshAriaExpanded()}setOpenClosedIcons(){const t=this.modelItem.isExpanded();b._setDisplayed(this.eGroupClosedIcon,!t),b._setDisplayed(this.eGroupOpenedIcon,t)}refreshAriaExpanded(){b._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)}},k_=class extends b.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:b.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 b.isProvidedColumnGroup(t)?t.getLeafColumns():t?[t]:[]}isMoveBlocked(t){return this.gos.get("suppressMovableColumns")?!0:!!this.getCurrentColumnsBeingMoved(t).find(s=>{const l=s.getColDef();return!!l.suppressMovable||!!l.lockPosition})}moveItem(t,e){if(!e)return;const{component:n}=e;let o=null,s=e.position==="top";if(n instanceof nu?(o=n.getColumns()[0],s=!0):n&&(o=n.getColumn()),!o)return;const l=this.getMoveTargetIndex({currentColumns:t,lastHoveredColumn:o,isBefore:s});l!=null&&this.columnMoveService.moveColumns(t,l,"toolPanelUi")}getMoveTargetIndex(t){const{currentColumns:e,lastHoveredColumn:n,isBefore:o}=t;if(!n||!e)return null;const s=this.columnModel.getCols().indexOf(n),l=o?s:s+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],s=t.length;return n.indexOf(o)<e?s:0}},S_=class extends b.Component{constructor(t,e,n,o){super(),this.allowDragging=e,this.groupsExist=n,this.focusWrapper=o,this.eLabel=b.RefPlaceholder,this.cbSelect=b.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 Du(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)}},A_=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 Iu?(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}},V_=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>`,[b.AgCheckboxSelector]),this.eDragHandle=b._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=b._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 s=this.onColumnStateChanged.bind(this);this.addManagedEventListeners({columnPivotModeChanged:s}),this.addManagedListeners(this.column,{columnValueChanged:s,columnPivotChanged:s,columnRowGroupChanged:s,visibleChanged:s}),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(),b._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 tu(e,t,this.focusWrapper));this.addDestroyFunc(()=>{o.isAlive()&&this.destroyBean(o)})}handleKeyDown(t){t.key===b.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");b._setAriaLabel(this.focusWrapper,`${this.displayName} ${e}`),this.cbSelect.setInputAriaLabel(`${o} (${n})`),b._setAriaDescribedBy(this.focusWrapper,this.cbSelect.getInputElement().id)}setupDragging(){if(!this.allowDragging){b._setDisplayed(this.eDragHandle,!1);return}let t=!this.gos.get("suppressDragLeaveHidesColumns");const e={type:b.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"),s=!this.column.isAnyFunctionAllowed();e=!o&&!s,n=e}else{const{enableRowGroup:o,enableValue:s,lockPosition:l,suppressMovable:c,lockVisible:u}=this.column.getColDef(),p=!!o||!!s,f=!!l||!!c;e=!u,n=p||!f}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){b._warnOnce("can not expand a column item that does not represent a column group header")}},E_=class{constructor(t){this.items=t}getRowCount(){return this.items.length}getRow(t){return this.items[t]}},T_="ag-column-select-list",B_=class extends b.Component{constructor(){super(`<div class="${T_}" 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((s,l)=>(b._setAriaLevel(l,s.getDept()+1),this.createComponentFromItem(s,l))),this.columnModel.isReady()&&this.onColumnsChanged(),!this.params.suppressColumnMove&&this.createManagedBean(new k_(this,this.virtualList))}createComponentFromItem(t,e){if(t.isGroup()){const o=new nu(t,this.allowDragging,this.eventType,e);return this.createBean(o),o}const n=new S_(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 s=t[o.getId()];(s!=null||e)&&n.setExpanded(!!s)}})}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 u=c.removeEventListener.bind(c,"expandedChanged",e);this.destroyColumnItemFuncs.push(u)},o=(c,u,p)=>{c.forEach(f=>{b.isProvidedColumnGroup(f)?s(f,u,p):l(f,u,p)})},s=(c,u,p)=>{const f=c.getColGroupDef();if(f&&f.suppressColumnsToolPanel)return;if(c.isPadding()){o(c.getChildren(),u,p);return}const _=this.columnNameService.getDisplayNameForProvidedColumnGroup(null,c,"columnToolPanel"),x=new eu(_,c,u,!0,this.expandGroupsByDefault);p.push(x),n(x),o(c.getChildren(),u+1,x.getChildren())},l=(c,u,p)=>{if(c.getColDef()&&c.getColDef().suppressColumnsToolPanel)return;const m=this.columnNameService.getDisplayNameForColumn(c,"columnToolPanel");p.push(new eu(m,c,u))};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 E_(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;b._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(s=>{if(!s.isGroup())return;const l=s.getColumnGroup().getId();e.indexOf(l)>=0&&(s.setExpanded(t),n.push(l))});const o=e.filter(s=>!b._includes(n,s));o.length>0&&b._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 s=o.getColumn(),l=s.getColDef();let c;if(n){if(!s.isAllowPivot()&&!s.isAllowRowGroup()&&!s.isAllowValue())return;c=s.isValueActive()||s.isPivotActive()||s.isRowGroupActive()}else{if(l.lockVisible)return;c=s.isVisible()}c?t++:e++}),!(t>0&&e>0))return!(t===0||e>0)}setFilterText(t){this.filterText=b._exists(t)?t.toLowerCase():null,this.markFilteredColumns(),this.flattenAndFilterModel()}markFilteredColumns(){const t=n=>{if(!b._exists(this.filterText))return!0;const o=n.getDisplayName();return o==null||o.toLowerCase().indexOf(this.filterText)!==-1},e=(n,o)=>{let s=!1;if(n.isGroup()){const c=t(n);n.getChildren().forEach(u=>{const p=e(u,c||o);p&&(s=p)})}const l=o||s?!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}},V_={selector:"AG-PRIMARY-COLS-LIST",component:B_},N_=class extends b.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 Du(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")}},B_=class{constructor(t){this.items=t}getRowCount(){return this.items.length}getRow(t){return this.items[t]}},P_="ag-column-select-list",R_=class extends T.Component{constructor(){super(`<div class="${P_}" 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 A_(this,this.virtualList))}createComponentFromItem(t,e){if(t.isGroup()){const o=new Iu(t,this.allowDragging,this.eventType,e);return this.createBean(o),o}const n=new V_(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"),x=new Ru(y,c,d,!0,this.expandGroupsByDefault);p.push(x),n(x),o(c.getChildren(),d+1,x.getChildren())},l=(c,d,p)=>{if(c.getColDef()&&c.getColDef().suppressColumnsToolPanel)return;const m=this.columnNameService.getDisplayNameForColumn(c,"columnToolPanel");p.push(new Ru(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 B_(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}},D_={selector:"AG-PRIMARY-COLS-LIST",component:R_},I_=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>`,[x_,V_]),this.primaryColsHeaderPanel=b.RefPlaceholder,this.primaryColsListPanel=b.RefPlaceholder}init(t,e,n){this.allowDragging=t,this.params=e,this.eventType=n,this.primaryColsHeaderPanel.init(this.params);const o=this.params.suppressColumnFilter,s=this.params.suppressColumnSelectAll;this.params.suppressColumnExpandAll&&o&&s&&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 b.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()}},ru=class extends b.Component{constructor(){super(...arguments),this.cbPivotMode=b.RefPlaceholder}wireBeans(t){this.columnModel=t.columnModel,this.ctrlsService=t.ctrlsService}createTemplate(){return`<div class="ag-pivot-mode-panel">
41
+ </div>`,[N_,D_]),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()}},Fu=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(),[b.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)}},A_=class extends b.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 ru),this.childDestroyFuncs.push(()=>this.destroyBean(this.pivotModePanel)),this.appendChild(this.pivotModePanel)),this.primaryColsPanel=this.createBean(new N_),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 Qa(!1)),this.childDestroyFuncs.push(()=>this.destroyBean(this.rowGroupDropZonePanel)),this.appendChild(this.rowGroupDropZonePanel)),this.params.suppressValues||(this.valuesDropZonePanel=this.createBean(new Xd(!1)),this.childDestroyFuncs.push(()=>this.destroyBean(this.valuesDropZonePanel)),this.appendChild(this.valuesDropZonePanel)),this.params.suppressPivots||(this.pivotDropZonePanel=this.createBean(new Xa(!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 ru),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 Qa(!1)),this.appendChild(this.rowGroupDropZonePanel)),this.setLastVisible())}setValuesSectionVisible(t){this.isRowGroupingModuleLoaded()&&(this.valuesDropZonePanel?this.valuesDropZonePanel.setDisplayed(t):t&&(this.valuesDropZonePanel=this.createManagedBean(new Xd(!1)),this.appendChild(this.valuesDropZonePanel)),this.setLastVisible())}setPivotSectionVisible(t){this.isRowGroupingModuleLoaded()&&(this.pivotDropZonePanel?this.pivotDropZonePanel.setDisplayed(t):t&&(this.pivotDropZonePanel=this.createManagedBean(new Xa(!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(s=>s.classList.remove("ag-last-column-drop"));const n=t.querySelectorAll(".ag-column-drop:not(.ag-hidden)"),o=b._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(b.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,b._clearElement(this.getGui())}refresh(t){return this.destroyChildren(),this.init(t),!0}getState(){return{expandedGroupIds:this.primaryColsPanel.getExpandedGroups()}}destroy(){this.destroyChildren(),super.destroy()}},P_=class extends b.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(s=>{s.isPassesFilter()&&(s.isGroup()?n(s.getChildren()):e.push(s.getColumn()))})};return n(t),e}setAllVisible(t,e,n){const o=[];t.forEach(s=>{s.getColDef().lockVisible||s.isVisible()!=e&&o.push({colId:s.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?u=>{var p;if(!u.isAnyFunctionActive())if(u.isAllowValue()){const f=typeof u.getAggFunc()=="string"?u.getAggFunc():(p=this.aggFuncService)==null?void 0:p.getDefaultAggFunc(u);o.push({colId:u.getId(),aggFunc:f})}else u.isAllowRowGroup()?o.push({colId:u.getId(),rowGroup:!0}):u.isAllowPivot()&&o.push({colId:u.getId(),pivot:!0})}:u=>{(u.isPivotActive()||u.isRowGroupActive()||u.isValueActive())&&o.push({colId:u.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:s}=t,l=e.map(c=>{const u=c.getColId();if(this.columnModel.isPivotMode()){const p=o==null?void 0:o[u];return{colId:u,pivot:p==null?void 0:p.pivot,rowGroup:p==null?void 0:p.rowGroup,aggFunc:p==null?void 0:p.aggFunc}}else return{colId:u,hide:!(n!=null&&n[u])}});this.columnApplyStateService.applyColumnState({state:l},s)}createPivotState(t){return{pivot:t.isPivotActive(),rowGroup:t.isRowGroupActive(),aggFunc:t.isValueActive()?t.getAggFunc():void 0}}},D_="32.3.3",ou=b._defineModule({version:D_,moduleName:b.ModuleNames.ColumnsToolPanelModule,beans:[P_],userComponents:[{name:"agColumnsToolPanel",classImp:A_},{name:"agMenuItem",classImp:Me.AgMenuItemRenderer}],dependantModules:[Me.EnterpriseCoreModule,w_,Ya]});const F_=`.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)}},F_=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 Fu),this.childDestroyFuncs.push(()=>this.destroyBean(this.pivotModePanel)),this.appendChild(this.pivotModePanel)),this.primaryColsPanel=this.createBean(new I_),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 Bu(!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 Fu),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 Bu(!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()}},O_=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}}},L_="32.3.3",Ou=T._defineModule({version:L_,moduleName:T.ModuleNames.ColumnsToolPanelModule,beans:[O_],userComponents:[{name:"agColumnsToolPanel",classImp:F_},{name:"agMenuItem",classImp:Me.AgMenuItemRenderer}],dependantModules:[Me.EnterpriseCoreModule,E_,hl]});const M_=`.ag-header {
44
44
  border-bottom: 1px solid var(--border-color-default);
45
- }`;function iu(){b.ModuleRegistry.registerModules([os.ClientSideRowModelModule,ym.InfiniteRowModelModule,hd.ServerSideRowModelModule,_m.CsvExportModule,fd.ClipboardModule,md.RangeSelectionModule,Cm.RichSelectModule,vm.MenuModule,wm.ExcelExportModule,Ya,ou]);const t=Wg("AGGRID_LICENSE");t?(Me.LicenseManager.setLicenseKey(t),console.log("AG Grid Activated")):console.log("AG Grid License not found")}const R_=gd.createPart("headerBottomBorder").withCSS(F_),su=gd.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(R_),au=Symbol("sdk-vue");function nl(){return r.inject(au)}function M_(t,e,n={}){let o;iu();const s=()=>{t.loadBlockState().then(c=>{l.loaded=!0;const u=Mm(c,t,n),p=e(u),f=Object.fromEntries(Object.entries(p.routes).map(([m,_])=>{const x=typeof _=="function"?_():_;return[m,r.markRaw(x)]}));o=Object.assign(u,{...p,getRoute(m){return f[m]}})}).catch(c=>{console.error("load initial state error",c),l.error=c})},l=r.reactive({loaded:!1,error:void 0,useApp(){return xm(o,"App is not loaded")},install(c){c.provide(au,this),s()}});return l}var I_=Object.defineProperty,O_=(t,e,n)=>e in t?I_(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,L_=(t,e,n)=>O_(t,e+"",n);function ms(t,e){if(t==null)throw Error("Empty (null | undefined) value");return t}function G_(t,e,n){const o=Math.min(e,n),s=Math.max(e,n);return t>=o&&t<=s}function z_(t){return new Promise(e=>setTimeout(e,t))}function $_(t){return t()}function gs(t,e,n){return e>t?e:t>n?n:t}function lu(t,e){return e(t)}function Mr(t,e){if(t!=null)return e(t)}function Z_(t){if(t&&t.ok)return t.value}async function U_(t){return Object.fromEntries(await Promise.all(Object.entries(t).map(async([e,n])=>[e,await n])))}const cu=t=>t;function W_(t,e){return t=Math.ceil(t),e=Math.floor(e),Math.floor(Math.random()*(e-t))+t}function H_(t,e=[]){for(t=t?String(t):"";e.includes(t.charAt(0));)t=t.substring(1);return t}function j_(t){let e="";for(let n=0;n<t;n++)e+=String.fromCharCode(W_(65,91));return e}function du(){return j_(42)}const rl=Array.isArray;function li(t){return t!==null&&typeof t=="object"}function ol(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 q_(t,e){return Object.keys(t).map(n=>e(t[n],n))}function ci(t,e){return li(t)&&li(e)?Object.keys(t).length!==Object.keys(e).length?!1:Object.keys(t).every(n=>ci(t[n],e[n])):t===e}function di(t){if(Array.isArray(t)){const e=[];for(let n=0;n<t.length;n++)e[n]=di(t[n]);return e}else if(li(t)){const e={};return Object.keys(t).forEach(n=>{e[n]=di(t[n])}),e}else return t}function K_(t){return Array.isArray(t)?Object.assign([],t):li(t)?Object.assign({},t):t}function Y_(t,e){const n={};for(const o in e)e[o]!==t[o]&&(n[o]=t[o]);return n}function J_(t){return Object.entries(t).forEach(([e,n])=>{n instanceof Function&&(t[e]=n.bind(t))}),t}function X_(t,e,n){return t[e]=n,t}function Q_(t,e){return t[e]}function eC(t,e){t={...t};const n=t[e];return delete t[e],[n,t]}function tC(t,...e){return Object.assign({},...e.map(n=>({[n]:t[n]})))}function nC(t,...e){return e.map(n=>t[n])}function rC(t,...e){const n=Object.assign({},t);return e.forEach(o=>delete n[o]),n}function uu(t,e){return new Set([...Object.keys(t),...Object.keys(e)]).forEach(n=>{const o=t[n],s=e[n];ol(o)&&ol(s)||rl(o)&&rl(s)&&o.length===s.length?uu(o,s):t[n]=s}),t}const il=Object.freeze(Object.defineProperty({__proto__:null,bindMethods:J_,deepClone:di,deepEqual:ci,deepPatch:uu,getProp:Q_,isArray:rl,isObject:li,isPlainObject:ol,map:q_,omit:rC,pick:tC,pickValues:nC,setProp:X_,shallowClone:K_,shallowDiff:Y_,shiftProp:eC},Symbol.toStringTag,{value:"Module"}));function oC(t,e){const n=t.findIndex(e);if(n<0)return[];const o=(()=>{for(let s=n;s<t.length;s++)if(!e(t[s],s))return s;return t.length})();return t.slice(n,o)}function iC(t,e,n){let o;return function(...s){o&&clearTimeout(o),o=setTimeout(()=>{o=void 0,t.apply(this,s)},e)}}const sC=["B","kB","MB","GB","TB","PB","EB","ZB","YB"],aC=["B","kiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],lC=["b","kbit","Mbit","Gbit","Tbit","Pbit","Ebit","Zbit","Ybit"],cC=["b","kibit","Mibit","Gibit","Tibit","Pibit","Eibit","Zibit","Yibit"],pu=(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 sl(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?cC:lC:e.binary?aC:sC;if(e.signed&&t===0)return` 0 ${n[0]}`;const o=t<0,s=o?"-":e.signed?"+":"";if(o&&(t=-t),t<1){const p=pu(t,e.locale);return s+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=pu(Number(t),e.locale),u=n[l];return s+c+" "+u}const dC={class:"context-menu"},uC=["onClick"],pC=r.defineComponent({__name:"Menu",props:{options:{}},emits:["close"],setup(t,{emit:e}){const n=e,o=s=>{s.cb(),n("close")};return(s,l)=>(r.openBlock(),r.createElementBlock("div",dC,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(s.options,(c,u)=>(r.openBlock(),r.createElementBlock("div",{key:u,onClick:r.withModifiers(p=>o(c),["stop"])},[r.createElementVNode("span",null,r.toDisplayString(c.text),1)],8,uC))),128))]))}}),Lt=(t,e)=>{const n=t.__vccOpts||t;for(const[o,s]of e)n[o]=s;return n},hC=Lt(pC,[["__scopeId","data-v-12530966"]]);function al(t,e){t.preventDefault();const n=()=>{r.render(null,document.body)},o=r.h(hC,{options:e,onClose:()=>{n()}});r.render(o,document.body);const s=o.el;return s.style.top=t.clientY+"px",s.style.left=t.clientX+"px",document.addEventListener("click",l=>{s.contains(l.target)||n()}),n}const hu=Symbol(),ys=()=>r.inject(hu),fC=["value"],mC={key:1},gC=r.defineComponent({__name:"BaseCellComponent",props:{modelValue:{},valueType:{},editable:{type:Boolean}},emits:["update:modelValue"],setup(t,{emit:e}){const n=e,o=t,s=r.reactive({edit:!1}),l=r.computed(()=>o.valueType),c=f=>{var m;let _=(m=f.target)==null?void 0:m.value;const x=r.unref(l),S=$_(()=>x==="integer"?parseInt(_,10):x==="float"?Number(_):_);n("update:modelValue",S),s.edit=!1},u=r.ref(),p=f=>{!f.metaKey&&o.editable&&(s.edit=!0,requestAnimationFrame(()=>{var m,_;(_=(m=u.value)==null?void 0:m.querySelector("input"))==null||_.focus()}))};return(f,m)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"baseRef",ref:u,class:r.normalizeClass(["base-cell",{"base-cell__edit":s.edit}]),onClick:p},[s.edit?(r.openBlock(),r.createElementBlock("input",{key:0,value:f.modelValue,onFocusout:m[0]||(m[0]=_=>s.edit=!1),onChange:c},null,40,fC)):(r.openBlock(),r.createElementBlock("div",mC,r.toDisplayString(f.modelValue),1))],2))}}),yC=["^data-row-index"],_C={key:0,class:"control-cell"},CC=r.defineComponent({__name:"TdCell",props:{cell:{}},setup(t){const e=t,n=ys(),o=r.computed(()=>e.cell.column.valueType),s=f=>{Mr(n.settings.value.onUpdatedRow,m=>{const _=e.cell.row,x={..._.dataRow,[e.cell.id]:f};m({..._,dataRow:x})})},l=f=>{f.metaKey&&n.selectRow(e.cell.row.primaryKey)},c=(f,m)=>{if(f.type==="contextmenu")f.preventDefault();else return;const _=n.settings??{},x=[],{onSelectedRows:S,onSelectedColumns:V}=_.value,I=n.data.selectedRows.has(m.primaryKey);S&&S.length&&(I?x.push({text:"Deselect row",cb(){n.data.selectedRows.delete(e.cell.row.primaryKey)}}):x.push({text:"Select row",cb(){n.selectRow(e.cell.row.primaryKey)}})),V&&V.length&&(x.push({text:"Select column",cb(){n.selectColumn(e.cell.column.id)}}),x.push({text:"Unselect column",cb(){n.unselectColumn(e.cell.column.id)}})),x.length&&al(f,x)},u=r.ref(),p=r.computed(()=>e.cell.column.component?e.cell.column.component():void 0);return(f,m)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"cellRef",ref:u,class:r.normalizeClass(["td-cell",{[f.cell.class]:!0}]),"^data-row-index":f.cell.row.index,onClick:l,onContextmenu:m[0]||(m[0]=_=>c(_,f.cell.row))},[f.cell.control?(r.openBlock(),r.createElementBlock("div",_C,r.toDisplayString(f.cell.row.index),1)):p.value?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(p.value),{key:1,"model-value":f.cell.value,"onUpdate:modelValue":s},null,8,["model-value"])):(r.openBlock(),r.createBlock(gC,{key:2,"model-value":f.cell.value,"value-type":o.value,editable:f.cell.column.editable,"onUpdate:modelValue":s},null,8,["model-value","value-type","editable"]))],42,yC))}}),vC={},wC={width:"48",height:"48",viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function bC(t,e){return r.openBlock(),r.createElementBlock("svg",wC,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 xC=Lt(vC,[["render",bC]]),kC={class:"tr-head"},SC=r.defineComponent({__name:"TrHead",setup(t){return(e,n)=>(r.openBlock(),r.createElementBlock("div",kC,[r.renderSlot(e.$slots,"default")]))}});function EC(t,e){const n=e.indexOf(t)+1;return e[n>=e.length?0:n]}function TC(t,e){const n=t.findIndex(e);if(n<0)return[];const o=(()=>{for(let s=n;s<t.length;s++)if(!e(t[s],s))return s;return t.length})();return t.slice(n,o)}const BC=["^data-col-id"],VC=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&&al(l,c)}function s(l){var c;const u=((c=l.sort)==null?void 0:c.direction)??"DESC";n("change:sort",{colId:l.id,direction:EC(u,["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(()=>s(l.col),["stop"]))},null,2)):r.createCommentVNode("",!0)],42,BC))}}),NC=r.defineComponent({__name:"TrBody",props:{row:{}},setup(t){const e=r.ref(),n=()=>{r.nextTick().then(()=>{Mr(e.value,o=>o.scrollLeft=0)})};return(o,s)=>(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))}}),AC=r.defineComponent({__name:"ColumnCaret",props:{column:{}},setup(t){const e=ys(),n=t,o=r.computed(()=>e.data.selectedColumns.has(n.column.id));return(s,l)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["column-caret",{selected:o.value,frozen:s.column.frozen}])},null,2))}});function nt(t,e,n,o){r.onMounted(()=>{var s;return(s=r.unref(t))==null?void 0:s.addEventListener(e,n,o)}),r.onUnmounted(()=>{var s;return(s=r.unref(t))==null?void 0:s.removeEventListener(e,n,o)})}function PC(t){r.onMounted(()=>window.addEventListener("mouseup",t)),r.onUnmounted(()=>window.removeEventListener("mouseup",t))}function DC(t){let e=!1;return function(...n){e?console.log("handle pressure"):(requestAnimationFrame(()=>{t(...n),e=!1}),e=!0)}}function FC(t,e){let n;function o(l){n={...l}}PC(()=>{n=void 0,e()});const s=DC(t);return nt(window,"mousemove",l=>{n&&s({x:n.x,width:n.width,diff:l.x-n.x})}),{start:o}}const lo=1,RC=10,MC=30,fu=60;function mu(){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 gu(t,e={}){const{delayEnter:n=0,delayLeave:o=0}=e,s=r.ref(!1);let l;const c=u=>{const p=u?n:o;l&&(clearTimeout(l),l=void 0),p?l=setTimeout(()=>s.value=u,p):s.value=u};return window&&(nt(t,"mouseenter",()=>c(!0)),nt(t,"mouseleave",()=>c(!1))),s}function IC(t){var e;const n=Mr((e=r.unref(t))==null?void 0:e.querySelectorAll(".th-cell"),o=>[...o])??[];return n.map(o=>{const{width:s,x:l}=o.getBoundingClientRect(),c=o.getAttribute("data-col-id");return cu({colId:c,width:s,x:l,right:l+s})}).slice(0,n.length-1)}function OC(t,e){const n=mu(),o=gu(e,{}),{data:s}=t,l=FC(u=>{Mr(s.resizeTh,p=>{const f=s.columns.find(m=>m.id===p.colId);f&&(f.width=gs(u.width+u.diff,MC,1e4),t.adjustWidth())})},()=>{s.resize=!1,s.resizeTh=void 0,document.body.style.cursor=""}),c=u=>{s.resizeTh&&(s.resize=!0,l.start({x:u.x,width:s.resizeTh.width}))};return r.watchEffect(()=>{if(!o.value){document.body.style.cursor="";return}if(s.resize)return;const u=IC(e).find(p=>Math.abs(n.x-p.right)<RC);u?(document.body.style.cursor="col-resize",s.resizeTh=u):(s.resizeTh=void 0,document.body.style.cursor="")}),{mouseDown:c}}const LC={key:0,class:"command-menu"},GC={key:0},zC=["onClick"],$C=r.defineComponent({__name:"RowsCommandMenu",setup(t){const e=ys(),n=r.computed(()=>e.getSelectedRows()),o=r.computed(()=>n.value.length>0),s=r.computed(()=>{var c;return((c=e.settings)==null?void 0:c.value.onSelectedRows)??[]}),l=r.computed(()=>s.value.map(c=>({label:c.label,cb:()=>{c.cb(n.value),e.data.selectedRows.clear(),e.data.rows=[]}})));return(c,u)=>o.value?(r.openBlock(),r.createElementBlock("div",LC,[n.value.length?(r.openBlock(),r.createElementBlock("span",GC,r.toDisplayString(n.value.length)+" rows selected",1)):r.createCommentVNode("",!0),u[0]||(u[0]=r.createTextVNode()),u[1]||(u[1]=r.createElementVNode("hr",null,null,-1)),u[2]||(u[2]=r.createTextVNode()),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(l.value,(p,f)=>(r.openBlock(),r.createElementBlock("span",{key:f,class:"command",onClick:r.withModifiers(p.cb,["stop"])},r.toDisplayString(p.label),9,zC))),128))])):r.createCommentVNode("",!0)}}),ZC={key:0,class:"command-menu"},UC={key:0},WC=["onClick"],HC=r.defineComponent({__name:"ColumnsCommandMenu",setup(t){const e=ys(),n=r.computed(()=>e.getSelectedColumns()),o=r.computed(()=>n.value.length>0),s=r.computed(()=>{var c;return((c=e.settings)==null?void 0:c.value.onSelectedColumns)??[]}),l=r.computed(()=>s.value.map(c=>({label:c.label,cb:()=>{c.cb(n.value),e.data.selectedColumns.clear()}})));return(c,u)=>o.value?(r.openBlock(),r.createElementBlock("div",ZC,[n.value.length?(r.openBlock(),r.createElementBlock("span",UC,"selected columns "+r.toDisplayString(n.value.length),1)):r.createCommentVNode("",!0),u[0]||(u[0]=r.createTextVNode()),u[1]||(u[1]=r.createElementVNode("hr",null,null,-1)),u[2]||(u[2]=r.createTextVNode()),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(l.value,(p,f)=>(r.openBlock(),r.createElementBlock("span",{key:f,class:"command",onClick:r.withModifiers(p.cb,["stop"])},r.toDisplayString(p.label),9,WC))),128))])):r.createCommentVNode("",!0)}});function ar(t,e){const n={el:void 0,x:0,y:0},o=s=>({x:s.x,y:s.y,dx:s.x-n.x,dy:s.y-n.y});nt(document,"mousedown",s=>{s.target===r.unref(t)&&(s.stopPropagation&&s.stopPropagation(),s.preventDefault&&s.preventDefault(),n.el=r.unref(t),n.x=s.x,n.y=s.y)}),nt(document,"mouseup",s=>{n.el&&(n.el=void 0,e({...o(s),stop:!0},n))}),nt(document,"mousemove",s=>{n.el&&e(o(s),n)})}const jC=r.defineComponent({__name:"TScroll",props:{offset:{},windowSize:{},dataSize:{}},emits:["change:offset"],setup(t,{emit:e}){const n=e,o=t,s=r.ref(),l=r.computed(()=>o.windowSize-12),c=r.computed(()=>o.windowSize<o.dataSize),u=r.computed(()=>Math.ceil(o.offset*(l.value/o.dataSize))),p=r.computed(()=>Math.ceil(l.value*l.value/o.dataSize)),f=r.computed(()=>({top:`${u.value}px`,height:`${p.value}px`}));return ar(s,(m,_)=>{const x=(u.value+m.dy)*o.dataSize/l.value;n("change:offset",x),_.x=m.x,_.y=m.y}),(m,_)=>(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:s,class:"t-scroll__handle",style:r.normalizeStyle(f.value)},null,4)):r.createCommentVNode("",!0)])],4))}});function qC(t){return r.computed(()=>{const{data:e,settings:n}=t,{bodyWidth:o,scrollLeft:s}=e,l=[...e.columns],c=du();n.value.controlColumn&&l.unshift({id:c,label:"#",width:60,frozen:!0});let u=0;const p=l.map(m=>{const _={...m,offset:u};return u+=m.width+lo,_}),f=p.filter(m=>m.frozen);return oC(p,m=>m.frozen?!1:s<m.offset+m.width&&m.offset<o+s).concat(f).map(m=>({...m,style:{left:m.frozen?`${m.offset}px`:`${m.offset-e.scrollLeft}px`,width:`${m.width}px`},control:m.id===c}))})}function KC(t,e){const n=r.computed(()=>e.value.reduce((o,s)=>(o[s.id]=s.justify?"justify-"+s.justify:"",o),{}));return r.computed(()=>t.rows.map(o=>{const s=n.value,{primaryKey:l,offset:c,dataRow:u,height:p}=o,f=e.value.map(m=>({id:m.id,column:m,row:o,value:u[m.id],class:s[m.id],editable:m.editable,width:m.width,style:m.style,control:m.control}));return cu({style:{top:`${c-t.scrollTop}px`,height:`${o.height}px`},primaryKey:l,offset:c,height:p,cells:f,selected:t.selectedRows.has(l)})}))}const YC=async(t,e)=>{const{scrollTop:n,bodyHeight:o}=t;return await z_(0),U_({rows:e.getRows(n,o),dataWindow:t})};function JC(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=di(m.columns),e.currentWindow=void 0,m.dataSource.getHeight().then(_=>{e.dataHeight=_,f.updateBodyHeight()}).catch(_=>e.error=_)},{immediate:!0});const n=r.computed(()=>t.settings),o=r.computed(()=>e.columns.reduce((m,_)=>m+_.width+lo,0)),s=r.computed(()=>lu(f.data.dataHeight-f.data.bodyHeight,m=>m>0?m:0)),l=r.computed(()=>lu(o.value-f.data.bodyWidth,m=>m>0?m:0)),c=r.computed(()=>({bodyHeight:e.bodyHeight,scrollTop:e.scrollTop,current:e.currentWindow})),u=qC({data:e,settings:n}),p=KC(e,u),f={data:e,settings:n,tableColumns:u,tableRows:p,adjustWidth:()=>{const m=e.columns.reduce((x,S)=>x+S.width+lo,0),_=e.bodyWidth+e.scrollLeft;if(m<_){const x=e.columns[e.columns.length-1];x.width=x.width+(_-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=gs(m,0,s.value)},updateScrollLeft(m){e.scrollLeft=gs(m,0,l.value)},updateBodyHeight(){const{height:m}=t.settings,{dataHeight:_}=e,x=m>_?_:m;e.bodyHeight=x},updateDimensions(m){this.updateBodyHeight(),f.data.bodyWidth=m.width,f.adjustWidth(),e.rows=[],e.currentWindow=void 0}};return r.watch(c,(m,_)=>{const x=m.current;(!x||m.scrollTop<x.scrollTop||m.scrollTop+m.bodyHeight>x.bodyHeight+x.scrollTop)&&(e.currentWindow={scrollTop:m.scrollTop-fu,bodyHeight:m.bodyHeight+fu*2},YC(di(e.currentWindow),n.value.dataSource).then(({rows:S,dataWindow:V})=>{ci(e.currentWindow,V)&&(e.rows=S)}))},{deep:!0,immediate:!0}),r.provide(hu,f),f}const XC={class:"command-menu__container"},QC={key:0,class:"table-body__no-data"},ev={class:"carets"},ll=r.defineComponent({__name:"TableComponent",props:{settings:{}},emits:["update:data","change:sort"],setup(t,{emit:e}){const n=e,o=t,s=JC(o),l=r.computed(()=>s.data.rows.length===0),c=r.computed(()=>({height:l.value?"212px":s.data.bodyHeight+"px"}));r.watch(s.data,I=>n("update:data",I),{deep:!0}),r.watch(o,()=>m);const u=r.ref(),p=r.ref(),f=r.ref(),m=()=>{Mr(f.value,I=>{s.updateDimensions(I.getBoundingClientRect())})},_=s.tableColumns,x=s.tableRows,{mouseDown:S}=OC(s,u);r.onMounted(()=>{r.nextTick(m)}),r.watchPostEffect(()=>{r.unref(o.settings),r.nextTick(m)}),nt(window,"resize",()=>r.nextTick(m));const V=I=>{I.preventDefault(),s.updateOffsets(I)};return(I,G)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"tableRef",ref:u,class:"data-table",onMousedown:G[2]||(G[2]=(...v)=>r.unref(S)&&r.unref(S)(...v))},[r.createElementVNode("div",XC,[r.createVNode($C),G[3]||(G[3]=r.createTextVNode()),r.createVNode(HC)]),G[7]||(G[7]=r.createTextVNode()),r.createElementVNode("div",{ref_key:"headRef",ref:p,class:"table-head"},[r.createVNode(SC,null,{default:r.withCtx(()=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(_),(v,R)=>(r.openBlock(),r.createBlock(VC,{key:R,col:v,style:r.normalizeStyle(v.style),"onChange:sort":G[0]||(G[0]=L=>I.$emit("change:sort",L))},null,8,["col","style"]))),128))]),_:1})],512),G[8]||(G[8]=r.createTextVNode()),r.createElementVNode("div",{ref_key:"bodyRef",ref:f,class:"table-body",style:r.normalizeStyle(c.value),onWheel:V},[l.value?(r.openBlock(),r.createElementBlock("div",QC,[r.createElementVNode("div",null,[r.createVNode(xC),G[4]||(G[4]=r.createTextVNode()),G[5]||(G[5]=r.createElementVNode("div",null,"No Data To Show",-1))])])):r.createCommentVNode("",!0),G[6]||(G[6]=r.createTextVNode()),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(x),(v,R)=>(r.openBlock(),r.createBlock(NC,{key:R,row:v},{default:r.withCtx(()=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(v.cells,L=>(r.openBlock(),r.createBlock(CC,{key:L.column.id+":"+R,cell:L,style:r.normalizeStyle(L.style)},null,8,["cell","style"]))),128))]),_:2},1032,["row"]))),128))],36),G[9]||(G[9]=r.createTextVNode()),r.createElementVNode("div",ev,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(_),(v,R)=>(r.openBlock(),r.createBlock(AC,{key:R,column:v,style:r.normalizeStyle(v.style),"onChange:sort":G[1]||(G[1]=L=>I.$emit("change:sort",L))},null,8,["column","style"]))),128))]),G[10]||(G[10]=r.createTextVNode()),r.createVNode(jC,{offset:r.unref(s).data.scrollTop,"window-size":r.unref(s).data.bodyHeight,"data-size":r.unref(s).data.dataHeight,"onChange:offset":r.unref(s).updateScrollTop},null,8,["offset","window-size","data-size","onChange:offset"])],544))}}),yu=new WeakMap;class tv{constructor(e,n,o){L_(this,"dataHeight"),this.datum=e,this.resolveHeight=n,this.resolvePrimaryKey=o;const s=e.reduce((c,u,p)=>(c.indices.set(p,c.total),c.total+=this.resolveHeight(u,p)+lo,c),{total:0,indices:new Map});this.dataHeight=s.total;const l=e.map((c,u)=>({dataRow:c,index:u,primaryKey:this.resolvePrimaryKey(c,u),offset:ms(s.indices.get(u)),height:this.resolveHeight(c,u)}));yu.set(this,l)}get rows(){return yu.get(this)}async getHeight(){return this.dataHeight}async getRows(e,n){return TC(this.rows,o=>{const s=o.offset;return e<s+o.height&&s<n+e})}}class nv{constructor(e,n,o){this.api=e,this.rowHeight=n,this.resolvePrimaryKey=o}get height(){return this.rowHeight+lo}async getHeight(){return await this.api.count()*this.height}async getRows(e,n){const o=gs(Math.floor(e/this.height),0,Number.POSITIVE_INFINITY),s=Math.ceil(n+40/this.height);return(await this.api.query({offset:o,limit:s})).map((l,c)=>({dataRow:l,index:o+c,primaryKey:this.resolvePrimaryKey(l,o+c),offset:(o+c)*(this.rowHeight+lo),height:this.rowHeight}))}}function rv(t){return Object.freeze(t)}function ov(t){return r.h(ll,{settings:Object.freeze(t)})}function cl(t,e){const n=new tv(t,e.resolveRowHeight,e.resolvePrimaryKey);return{...e,dataSource:n}}function iv(t,e){return r.computed(()=>{const n=r.unref(t);return cl(n,r.unref(e))})}function sv(t,e){const n=r.computed(()=>{const s=r.unref(t);return cl(s,r.unref(e))}),o=r.reactive({settings:n});return r.computed(()=>r.h(ll,o))}const av=Object.freeze(Object.defineProperty({__proto__:null,AsyncData:nv,Component:ll,factory:ov,rawDataSettings:cl,settings:rv,useRawData:iv,useRawDataComponent:sv},Symbol.toStringTag,{value:"Module"}));function*lv(t,e){for(const n of t)yield e(n)}function cv(t){const e=[];for(const n of t)e.push(n);return e}function _u(t){return t()}function dl(t,e){if(t==null)throw Error(e);return t}function ul(t){let e=!1;return function(...n){e||(requestAnimationFrame(()=>{t(...n),e=!1}),e=!0)}}function Cu(t){return new Promise(e=>setTimeout(e,t))}function vu(t,e){const n=setTimeout(t,e);return()=>{clearTimeout(n)}}function wu(t,e){return t=Math.ceil(t),e=Math.floor(e),Math.floor(Math.random()*(e-t))+t}function dv(t){let e="";for(let n=0;n<t;n++)e+=String.fromCharCode(wu(65,91));return e}function bu(t){return function(e){return 1-t(1-e)}}function uv(t){return function(e){return e<.5?t(2*e)/2:(2-t(2*(1-e)))/2}}function xu(t){const{duration:e,draw:n,timing:o}=t,s=performance.now();let l=!1;return requestAnimationFrame(function c(u){let p=(u-s)/e;(p>1||l)&&(p=1);const f=o(p);n(f),p<1&&requestAnimationFrame(c)}),function(){l=!0}}function pv(t){const{getFraction:e,draw:n,timing:o}=t,s=performance.now();let l=!1;return requestAnimationFrame(function c(u){let p=e(u-s);if(l)return;p>1&&(p=1);const f=o(p);n(f),p<1&&requestAnimationFrame(c)}),function(){l=!0}}function ku(t,e){let n=-1;return(...o)=>{n!==-1&&(clearTimeout(n),n=-1),n=window.setTimeout(()=>t(...o),e)}}function Su(t,e,n=!0){let o=0,s;return function(...l){s=()=>{t.apply(this,l),o=new Date().getTime()+e,s=null,n&&setTimeout(()=>{s&&s()},e)},new Date().getTime()>o&&s()}}function hv(t){return t.map(e=>({text:String(e),value:e}))}function lr(t){return t.map(e=>({label:"label"in e?e.label:e.text,value:e.value,description:e.description}))}const pl=new Map;function fv(t){return pl.has(t)||pl.set(t,r.ref(localStorage.getItem(t))),dl(pl.get(t),"...")}function mv(t,e){e==null?localStorage.removeItem(t):localStorage.setItem(t,e)}function Eu(t){const e=fv(t);return r.watch(e,n=>mv(t,n)),e}const hl=new Set;window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",t=>{cv(lv(hl.values(),e=>e(t.matches?"dark":"light")))});const gv=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",Tu=r.ref(gv),fl=Eu("theme");function Bu(t){const e=r.computed(()=>fl.value?fl.value:Tu.value),n=s=>{Tu.value=s,t&&t(s)};function o(){fl.value=e.value==="light"?"dark":(e.value,"light")}return r.watch(e,s=>{t&&t(r.unref(s))}),r.onMounted(()=>{hl.add(n)}),r.onUnmounted(()=>{hl.delete(n)}),[e,o]}const yv=r.defineComponent({__name:"ThemeSwitcher",setup(t){const[e,n]=Bu();return(o,s)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["ui-theme-switcher",r.unref(e)]),onClick:s[0]||(s[0]=(...l)=>r.unref(n)&&r.unref(n)(...l))},s[1]||(s[1]=[r.createElementVNode("div",null,null,-1)]),2))}}),_v={key:0,class:"pl-block-page__title"},Cv={class:"pl-block-page__title__default"},vv={class:"pl-block-page__title__append"},wv={key:1},bv={class:"pl-block-page__body"},xv={name:"PlBlockPage"},kv=r.defineComponent({...xv,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",_v,[r.createElementVNode("div",Cv,[r.renderSlot(n.$slots,"title")]),o[0]||(o[0]=r.createTextVNode()),r.createElementVNode("div",vv,[r.renderSlot(n.$slots,"append")])])):(r.openBlock(),r.createElementBlock("div",wv)),o[1]||(o[1]=r.createTextVNode()),r.createElementVNode("div",bv,[r.renderSlot(n.$slots,"default")])],2))}}),Sv={name:"PlContainer"},Ev=r.defineComponent({...Sv,props:{width:{}},setup(t){const e=t,n=r.computed(()=>({width:e.width}));return(o,s)=>(r.openBlock(),r.createElementBlock("div",{class:"pl-container pl-layout-component",style:r.normalizeStyle(n.value)},[r.renderSlot(o.$slots,"default")],4))}}),Tv={name:"PlRow"},Bv=r.defineComponent({...Tv,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))}}),Vv={class:"pl-layout-component",style:{"flex-grow":"1"}},Nv={name:"PlSpacer"},Vu=r.defineComponent({...Nv,setup(t){return(e,n)=>(r.openBlock(),r.createElementBlock("div",Vv))}}),Av={name:"PlGrid"},Pv=r.defineComponent({...Av,props:{columns:{}},setup(t){const e=t,n=r.computed(()=>({gridTemplateColumns:`repeat(${e.columns}, minmax(0, 1fr))`}));return(o,s)=>(r.openBlock(),r.createElementBlock("div",{class:"pl-layout-component pl-grid",style:r.normalizeStyle(n.value)},[r.renderSlot(o.$slots,"default")],4))}}),Dv={key:0,class:"pl-alert__icon"},Fv={class:"pl-alert__main"},Rv={key:0},Mv={class:"pl-alert__main__text"},Iv={name:"PlAlert"},Ov=r.defineComponent({...Iv,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",Dv,[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",Fv,[n.label?(r.openBlock(),r.createElementBlock("label",Rv,r.toDisplayString(n.label),1)):r.createCommentVNode("",!0),o[1]||(o[1]=r.createTextVNode()),r.createElementVNode("div",Mv,[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]=s=>n.$emit("update:modelValue",!1))})):r.createCommentVNode("",!0)],6)):r.createCommentVNode("",!0)}}),Lv=`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
45
+ }`;function Lu(){T.ModuleRegistry.registerModules([hs.ClientSideRowModelModule,kg.InfiniteRowModelModule,Zd.ServerSideRowModelModule,Sg.CsvExportModule,Wd.ClipboardModule,jd.RangeSelectionModule,Eg.RichSelectModule,Tg.MenuModule,Ng.ExcelExportModule,hl,Ou]);const t=Xy("AGGRID_LICENSE");t?(Me.LicenseManager.setLicenseKey(t),console.log("AG Grid Activated")):console.log("AG Grid License not found")}const G_=Hd.createPart("headerBottomBorder").withCSS(M_),Mu=Hd.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(G_),Gu=Symbol("sdk-vue");function _l(){return r.inject(Gu)}function $_(t,e,n={}){let o;Lu();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 x=typeof y=="function"?y():y;return[m,r.markRaw(x)]}));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 Vg(o,"App is not loaded")},install(c){c.provide(Gu,this),i()}});return l}var z_=Object.defineProperty,U_=(t,e,n)=>e in t?z_(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Z_=(t,e,n)=>U_(t,e+"",n);function ks(t,e){if(t==null)throw Error("Empty (null | undefined) value");return t}function W_(t,e,n){const o=Math.min(e,n),i=Math.max(e,n);return t>=o&&t<=i}function j_(t){return new Promise(e=>setTimeout(e,t))}function H_(t){return t()}function Ss(t,e,n){return e>t?e:t>n?n:t}function $u(t,e){return e(t)}function Zr(t,e){if(t!=null)return e(t)}function q_(t){if(t&&t.ok)return t.value}async function K_(t){return Object.fromEntries(await Promise.all(Object.entries(t).map(async([e,n])=>[e,await n])))}const zu=t=>t;function X_(t,e){return t=Math.ceil(t),e=Math.floor(e),Math.floor(Math.random()*(e-t))+t}function Y_(t,e=[]){for(t=t?String(t):"";e.includes(t.charAt(0));)t=t.substring(1);return t}function J_(t){let e="";for(let n=0;n<t;n++)e+=String.fromCharCode(X_(65,91));return e}function Uu(){return J_(42)}const Cl=Array.isArray;function gi(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 Q_(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 vi(t){if(Array.isArray(t)){const e=[];for(let n=0;n<t.length;n++)e[n]=vi(t[n]);return e}else if(gi(t)){const e={};return Object.keys(t).forEach(n=>{e[n]=vi(t[n])}),e}else return t}function eC(t){return Array.isArray(t)?Object.assign([],t):gi(t)?Object.assign({},t):t}function tC(t,e){const n={};for(const o in e)e[o]!==t[o]&&(n[o]=t[o]);return n}function nC(t){return Object.entries(t).forEach(([e,n])=>{n instanceof Function&&(t[e]=n.bind(t))}),t}function rC(t,e,n){return t[e]=n,t}function oC(t,e){return t[e]}function iC(t,e){t={...t};const n=t[e];return delete t[e],[n,t]}function sC(t,...e){return Object.assign({},...e.map(n=>({[n]:t[n]})))}function aC(t,...e){return e.map(n=>t[n])}function lC(t,...e){const n=Object.assign({},t);return e.forEach(o=>delete n[o]),n}function Zu(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?Zu(o,i):t[n]=i}),t}const bl=Object.freeze(Object.defineProperty({__proto__:null,bindMethods:nC,deepClone:vi,deepEqual:yi,deepPatch:Zu,getProp:oC,isArray:Cl,isObject:gi,isPlainObject:wl,map:Q_,omit:lC,pick:sC,pickValues:aC,setProp:rC,shallowClone:eC,shallowDiff:tC,shiftProp:iC},Symbol.toStringTag,{value:"Module"}));function cC(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 dC(t,e,n){let o;return function(...i){o&&clearTimeout(o),o=setTimeout(()=>{o=void 0,t.apply(this,i)},e)}}const uC=["B","kB","MB","GB","TB","PB","EB","ZB","YB"],pC=["B","kiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],hC=["b","kbit","Mbit","Gbit","Tbit","Pbit","Ebit","Zbit","Ybit"],fC=["b","kibit","Mibit","Gibit","Tibit","Pibit","Eibit","Zibit","Yibit"],Wu=(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?fC:hC:e.binary?pC:uC;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=Wu(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=Wu(Number(t),e.locale),d=n[l];return i+c+" "+d}const mC={class:"context-menu"},gC=["onClick"],yC=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",mC,[(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,gC))),128))]))}}),Zt=(t,e)=>{const n=t.__vccOpts||t;for(const[o,i]of e)n[o]=i;return n},vC=Zt(yC,[["__scopeId","data-v-12530966"]]);function kl(t,e){t.preventDefault();const n=()=>{r.render(null,document.body)},o=r.h(vC,{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 ju=Symbol(),Es=()=>r.inject(ju),_C=["value"],CC={key:1},wC=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 x=r.unref(l),w=H_(()=>x==="integer"?parseInt(y,10):x==="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,_C)):(r.openBlock(),r.createElementBlock("div",CC,r.toDisplayString(h.modelValue),1))],2))}}),bC=["^data-row-index"],xC={key:0,class:"control-cell"},kC=r.defineComponent({__name:"TdCell",props:{cell:{}},setup(t){const e=t,n=Es(),o=r.computed(()=>e.cell.column.valueType),i=h=>{Zr(n.settings.value.onUpdatedRow,m=>{const y=e.cell.row,x={...y.dataRow,[e.cell.id]:h};m({...y,dataRow:x})})},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??{},x=[],{onSelectedRows:w,onSelectedColumns:E}=y.value,O=n.data.selectedRows.has(m.primaryKey);w&&w.length&&(O?x.push({text:"Deselect row",cb(){n.data.selectedRows.delete(e.cell.row.primaryKey)}}):x.push({text:"Select row",cb(){n.selectRow(e.cell.row.primaryKey)}})),E&&E.length&&(x.push({text:"Select column",cb(){n.selectColumn(e.cell.column.id)}}),x.push({text:"Unselect column",cb(){n.unselectColumn(e.cell.column.id)}})),x.length&&kl(h,x)},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",xC,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(wC,{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,bC))}}),SC={},EC={width:"48",height:"48",viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function TC(t,e){return r.openBlock(),r.createElementBlock("svg",EC,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 NC=Zt(SC,[["render",TC]]),AC={class:"tr-head"},VC=r.defineComponent({__name:"TrHead",setup(t){return(e,n)=>(r.openBlock(),r.createElementBlock("div",AC,[r.renderSlot(e.$slots,"default")]))}});function BC(t,e){const n=e.indexOf(t)+1;return e[n>=e.length?0:n]}function PC(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 RC=["^data-col-id"],DC=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:BC(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,RC))}}),IC=r.defineComponent({__name:"TrBody",props:{row:{}},setup(t){const e=r.ref(),n=()=>{r.nextTick().then(()=>{Zr(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))}}),FC=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 OC(t){r.onMounted(()=>window.addEventListener("mouseup",t)),r.onUnmounted(()=>window.removeEventListener("mouseup",t))}function LC(t){let e=!1;return function(...n){e?console.log("handle pressure"):(requestAnimationFrame(()=>{t(...n),e=!1}),e=!0)}}function MC(t,e){let n;function o(l){n={...l}}OC(()=>{n=void 0,e()});const i=LC(t);return st(window,"mousemove",l=>{n&&i({x:n.x,width:n.width,diff:l.x-n.x})}),{start:o}}const go=1,GC=10,$C=30,Hu=60;function qu(){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 Ku(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=Zr((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 UC(t,e){const n=qu(),o=Ku(e,{}),{data:i}=t,l=MC(d=>{Zr(i.resizeTh,p=>{const h=i.columns.find(m=>m.id===p.colId);h&&(h.width=Ss(d.width+d.diff,$C,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)<GC);d?(document.body.style.cursor="col-resize",i.resizeTh=d):(i.resizeTh=void 0,document.body.style.cursor="")}),{mouseDown:c}}const ZC={key:0,class:"command-menu"},WC={key:0},jC=["onClick"],HC=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",ZC,[n.value.length?(r.openBlock(),r.createElementBlock("span",WC,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,jC))),128))])):r.createCommentVNode("",!0)}}),qC={key:0,class:"command-menu"},KC={key:0},XC=["onClick"],YC=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",qC,[n.value.length?(r.openBlock(),r.createElementBlock("span",KC,"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,XC))),128))])):r.createCommentVNode("",!0)}});function gr(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 JC=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 gr(i,(m,y)=>{const x=(d.value+m.dy)*o.dataSize/l.value;n("change:offset",x),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 QC(t){return r.computed(()=>{const{data:e,settings:n}=t,{bodyWidth:o,scrollLeft:i}=e,l=[...e.columns],c=Uu();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+go,y}),h=p.filter(m=>m.frozen);return cC(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 e0(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 t0=async(t,e)=>{const{scrollTop:n,bodyHeight:o}=t;return await j_(0),K_({rows:e.getRows(n,o),dataWindow:t})};function n0(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=vi(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+go,0)),i=r.computed(()=>$u(h.data.dataHeight-h.data.bodyHeight,m=>m>0?m:0)),l=r.computed(()=>$u(o.value-h.data.bodyWidth,m=>m>0?m:0)),c=r.computed(()=>({bodyHeight:e.bodyHeight,scrollTop:e.scrollTop,current:e.currentWindow})),d=QC({data:e,settings:n}),p=e0(e,d),h={data:e,settings:n,tableColumns:d,tableRows:p,adjustWidth:()=>{const m=e.columns.reduce((x,w)=>x+w.width+go,0),y=e.bodyWidth+e.scrollLeft;if(m<y){const x=e.columns[e.columns.length-1];x.width=x.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=Ss(m,0,i.value)},updateScrollLeft(m){e.scrollLeft=Ss(m,0,l.value)},updateBodyHeight(){const{height:m}=t.settings,{dataHeight:y}=e,x=m>y?y:m;e.bodyHeight=x},updateDimensions(m){this.updateBodyHeight(),h.data.bodyWidth=m.width,h.adjustWidth(),e.rows=[],e.currentWindow=void 0}};return r.watch(c,(m,y)=>{const x=m.current;(!x||m.scrollTop<x.scrollTop||m.scrollTop+m.bodyHeight>x.bodyHeight+x.scrollTop)&&(e.currentWindow={scrollTop:m.scrollTop-Hu,bodyHeight:m.bodyHeight+Hu*2},t0(vi(e.currentWindow),n.value.dataSource).then(({rows:w,dataWindow:E})=>{yi(e.currentWindow,E)&&(e.rows=w)}))},{deep:!0,immediate:!0}),r.provide(ju,h),h}const r0={class:"command-menu__container"},o0={key:0,class:"table-body__no-data"},i0={class:"carets"},Sl=r.defineComponent({__name:"TableComponent",props:{settings:{}},emits:["update:data","change:sort"],setup(t,{emit:e}){const n=e,o=t,i=n0(o),l=r.computed(()=>i.data.rows.length===0),c=r.computed(()=>({height:l.value?"212px":i.data.bodyHeight+"px"}));r.watch(i.data,O=>n("update:data",O),{deep:!0}),r.watch(o,()=>m);const d=r.ref(),p=r.ref(),h=r.ref(),m=()=>{Zr(h.value,O=>{i.updateDimensions(O.getBoundingClientRect())})},y=i.tableColumns,x=i.tableRows,{mouseDown:w}=UC(i,d);r.onMounted(()=>{r.nextTick(m)}),r.watchPostEffect(()=>{r.unref(o.settings),r.nextTick(m)}),st(window,"resize",()=>r.nextTick(m));const E=O=>{O.preventDefault(),i.updateOffsets(O)};return(O,$)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"tableRef",ref:d,class:"data-table",onMousedown:$[2]||($[2]=(...b)=>r.unref(w)&&r.unref(w)(...b))},[r.createElementVNode("div",r0,[r.createVNode(HC),$[3]||($[3]=r.createTextVNode()),r.createVNode(YC)]),$[7]||($[7]=r.createTextVNode()),r.createElementVNode("div",{ref_key:"headRef",ref:p,class:"table-head"},[r.createVNode(VC,null,{default:r.withCtx(()=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(y),(b,R)=>(r.openBlock(),r.createBlock(DC,{key:R,col:b,style:r.normalizeStyle(b.style),"onChange:sort":$[0]||($[0]=F=>O.$emit("change:sort",F))},null,8,["col","style"]))),128))]),_:1})],512),$[8]||($[8]=r.createTextVNode()),r.createElementVNode("div",{ref_key:"bodyRef",ref:h,class:"table-body",style:r.normalizeStyle(c.value),onWheel:E},[l.value?(r.openBlock(),r.createElementBlock("div",o0,[r.createElementVNode("div",null,[r.createVNode(NC),$[4]||($[4]=r.createTextVNode()),$[5]||($[5]=r.createElementVNode("div",null,"No Data To Show",-1))])])):r.createCommentVNode("",!0),$[6]||($[6]=r.createTextVNode()),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(x),(b,R)=>(r.openBlock(),r.createBlock(IC,{key:R,row:b},{default:r.withCtx(()=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(b.cells,F=>(r.openBlock(),r.createBlock(kC,{key:F.column.id+":"+R,cell:F,style:r.normalizeStyle(F.style)},null,8,["cell","style"]))),128))]),_:2},1032,["row"]))),128))],36),$[9]||($[9]=r.createTextVNode()),r.createElementVNode("div",i0,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(y),(b,R)=>(r.openBlock(),r.createBlock(FC,{key:R,column:b,style:r.normalizeStyle(b.style),"onChange:sort":$[1]||($[1]=F=>O.$emit("change:sort",F))},null,8,["column","style"]))),128))]),$[10]||($[10]=r.createTextVNode()),r.createVNode(JC,{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 s0{constructor(e,n,o){Z_(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)+go,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:ks(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 PC(this.rows,o=>{const i=o.offset;return e<i+o.height&&i<n+e})}}class a0{constructor(e,n,o){this.api=e,this.rowHeight=n,this.resolvePrimaryKey=o}get height(){return this.rowHeight+go}async getHeight(){return await this.api.count()*this.height}async getRows(e,n){const o=Ss(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+go),height:this.rowHeight}))}}function l0(t){return Object.freeze(t)}function c0(t){return r.h(Sl,{settings:Object.freeze(t)})}function El(t,e){const n=new s0(t,e.resolveRowHeight,e.resolvePrimaryKey);return{...e,dataSource:n}}function d0(t,e){return r.computed(()=>{const n=r.unref(t);return El(n,r.unref(e))})}function u0(t,e){const n=r.computed(()=>{const i=r.unref(t);return El(i,r.unref(e))}),o=r.reactive({settings:n});return r.computed(()=>r.h(Sl,o))}const p0=Object.freeze(Object.defineProperty({__proto__:null,AsyncData:a0,Component:Sl,factory:c0,rawDataSettings:El,settings:l0,useRawData:d0,useRawDataComponent:u0},Symbol.toStringTag,{value:"Module"}));function*h0(t,e){for(const n of t)yield e(n)}function f0(t){const e=[];for(const n of t)e.push(n);return e}function Yu(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 Ju(t){return new Promise(e=>setTimeout(e,t))}function Qu(t,e){const n=setTimeout(t,e);return()=>{clearTimeout(n)}}function ep(t,e){return t=Math.ceil(t),e=Math.floor(e),Math.floor(Math.random()*(e-t))+t}function m0(t){let e="";for(let n=0;n<t;n++)e+=String.fromCharCode(ep(65,91));return e}function tp(t){return function(e){return 1-t(1-e)}}function g0(t){return function(e){return e<.5?t(2*e)/2:(2-t(2*(1-e)))/2}}function np(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 y0(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 rp(t,e){let n=-1;return(...o)=>{n!==-1&&(clearTimeout(n),n=-1),n=window.setTimeout(()=>t(...o),e)}}function op(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 v0(t){return t.map(e=>({text:String(e),value:e}))}function yr(t){return t.map(e=>({label:"label"in e?e.label:e.text,value:e.value,description:e.description}))}const Al=new Map;function _0(t){return Al.has(t)||Al.set(t,r.ref(localStorage.getItem(t))),Tl(Al.get(t),"...")}function C0(t,e){e==null?localStorage.removeItem(t):localStorage.setItem(t,e)}function ip(t){const e=_0(t);return r.watch(e,n=>C0(t,n)),e}const Vl=new Set;window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",t=>{f0(h0(Vl.values(),e=>e(t.matches?"dark":"light")))});const w0=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",sp=r.ref(w0),Bl=ip("theme");function ap(t){const e=r.computed(()=>Bl.value?Bl.value:sp.value),n=i=>{sp.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(()=>{Vl.add(n)}),r.onUnmounted(()=>{Vl.delete(n)}),[e,o]}const b0=r.defineComponent({__name:"ThemeSwitcher",setup(t){const[e,n]=ap();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))}}),x0={key:0,class:"pl-block-page__title"},k0={class:"pl-block-page__title__default"},S0={class:"pl-block-page__title__append"},E0={key:1},T0={class:"pl-block-page__body"},N0={name:"PlBlockPage"},A0=r.defineComponent({...N0,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",x0,[r.createElementVNode("div",k0,[r.renderSlot(n.$slots,"title")]),o[0]||(o[0]=r.createTextVNode()),r.createElementVNode("div",S0,[r.renderSlot(n.$slots,"append")])])):(r.openBlock(),r.createElementBlock("div",E0)),o[1]||(o[1]=r.createTextVNode()),r.createElementVNode("div",T0,[r.renderSlot(n.$slots,"default")])],2))}}),V0={name:"PlContainer"},B0=r.defineComponent({...V0,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))}}),P0={name:"PlRow"},R0=r.defineComponent({...P0,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))}}),D0={class:"pl-layout-component",style:{"flex-grow":"1"}},I0={name:"PlSpacer"},lp=r.defineComponent({...I0,setup(t){return(e,n)=>(r.openBlock(),r.createElementBlock("div",D0))}}),F0={name:"PlGrid"},O0=r.defineComponent({...F0,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))}}),L0={key:0,class:"pl-alert__icon"},M0={class:"pl-alert__main"},G0={key:0},$0={class:"pl-alert__main__text"},z0={name:"PlAlert"},U0=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",L0,[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",M0,[n.label?(r.openBlock(),r.createElementBlock("label",G0,r.toDisplayString(n.label),1)):r.createCommentVNode("",!0),o[1]||(o[1]=r.createTextVNode()),r.createElementVNode("div",$0,[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)}}),Z0=`<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
- `,Gv=`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
48
+ `,W0=`<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
- `,zv=["innerHTML"],$v={class:"dropdown-list-item__title-container"},Zv={class:"dropdown-list-item__title text-s"},Uv={key:0,class:"dropdown-list-item__description text-description"},Wv={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(" ")}),s=r.computed(()=>e.isSelected?Gv:Lv);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:s.value},null,10,zv)):r.createCommentVNode("",!0),c[1]||(c[1]=r.createTextVNode()),r.createElementVNode("div",$v,[r.createElementVNode("div",Zv,r.toDisplayString(l.option.label),1),c[0]||(c[0]=r.createTextVNode()),l.option.description?(r.openBlock(),r.createElementBlock("div",Uv,r.toDisplayString(l.option.description),1)):r.createCommentVNode("",!0)]),c[2]||(c[2]=r.createTextVNode()),!e.useCheckbox&&e.isSelected?(r.openBlock(),r.createElementBlock("div",Wv)):r.createCommentVNode("",!0)],2))}});function uo(t,e){const n=ul(()=>{if(t.value){const{scrollTop:o,scrollLeft:s,scrollHeight:l,scrollWidth:c,clientHeight:u,clientWidth:p}=document.documentElement,f=t.value.getBoundingClientRect();e({scrollTop:o,scrollLeft:s,scrollHeight:l,scrollWidth:c,clientHeight:u,clientWidth:p,offsetY:o+f.y,offsetX:s+f.x,top:f.top,right:f.right,bottom:f.bottom,left:f.left,width:f.width,height:f.height,x:f.x,y:f.y})}});r.onMounted(n),nt(window,"scroll",n,{capture:!0,passive:!0}),nt(window,"resize",n,{passive:!0}),nt(window,"adjust",n,!0)}const Hv=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(s,l)=>(r.openBlock(),r.createElementBlock("i",{style:r.normalizeStyle(n.value),class:r.normalizeClass([o.value,s.$style.icon])},null,6))}}),jv="_icon_1ugxm_2",qv={icon:jv},Kv={$style:qv},cn=Lt(Hv,[["__cssModules",Kv]]),Yv=["onKeyup"],Jv=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,s=n,l=r.useModel(t,"modelValue"),c=r.ref(),u=r.ref(),p=r.ref(),f=r.ref(),m=r.reactive({open:!1,optionsHeight:0,activeIndex:-1});e({data:m});const _=r.reactive({top:"0px",left:"0px",width:"0px"});r.watch(u,T=>{if(T){const $=T.getBoundingClientRect();m.optionsHeight=$.height,window.dispatchEvent(new CustomEvent("adjust"))}},{immediate:!0});const x=r.computed(()=>m.open?"mask-24 mask-chevron-up":"mask-24 mask-chevron-down"),S=r.computed(()=>(o.options??[]).findIndex(T=>ci(T.value,l.value))),V=r.computed(()=>lr(o.options??[]).map((T,$)=>({...T,index:$,isSelected:$===S.value,isActive:$===m.activeIndex}))),I=r.computed(()=>o.loading||o.options===void 0),G=r.computed(()=>{var T;return((T=V.value.find($=>ci($.value,l.value)))==null?void 0:T.label)??(o.options===void 0?"...":"")});uo(c,T=>{const $=T.top+T.height+3;$+m.optionsHeight>T.clientHeight?_.top=T.top-m.optionsHeight-3+"px":_.top=$+"px",_.left=T.left+"px",_.width=T.width+"px"});const v=T=>{var $;l.value=T,m.open=!1,($=c==null?void 0:c.value)==null||$.focus()};function R(){s("click")}const L=T=>{var $,U;if(["ArrowDown","ArrowUp","Enter","Escape"].includes(T.code))T.preventDefault();else return;if(T.target===f.value&&T.code==="Enter"){R();return}const{open:O,activeIndex:Z}=m;if(!O&&T.target===p.value){T.code==="Enter"&&(m.open=!0);return}T.code==="Escape"&&(m.open=!1,($=c.value)==null||$.focus());const W=r.unref(V),{length:J}=W;if(!J)return;T.code==="Enter"&&v((U=W.find(P=>P.index===Z))==null?void 0:U.value);const he=W.findIndex(P=>P.index===Z)??-1,N=T.code==="ArrowDown"?1:T.code==="ArrowUp"?-1:0,E=Math.abs(he+N+J)%J;m.activeIndex=V.value[E].index??-1},F=T=>{var $,U;const O=T.relatedTarget;!(($=c.value)!=null&&$.contains(O))&&!((U=u.value)!=null&&U.contains(O))&&(m.open=!1)};return(T,$)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"root",ref:c,class:r.normalizeClass([{disabled:T.disabled||I.value,loading:I.value},"pl-btn-split d-flex"]),onFocusout:F,onKeydown:L},[r.createElementVNode("div",{ref_key:"buttonAction",ref:f,class:"pl-btn-split__title flex-grow-1 d-flex align-center text-s-btn",tabindex:"0",onClick:R,onKeyup:r.withKeys(r.withModifiers(R,["stop"]),["enter"])},r.toDisplayString(G.value),41,Yv),$[1]||($[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:$[0]||($[0]=U=>m.open=!m.open)},[I.value?(r.openBlock(),r.createBlock(cn,{key:0,name:"loading"})):(r.openBlock(),r.createElementBlock("div",{key:1,class:r.normalizeClass([x.value,"pl-btn-split__icon"])},null,2))],512),$[2]||($[2]=r.createTextVNode()),m.open?(r.openBlock(),r.createBlock(r.Teleport,{key:0,to:"body"},[r.createElementVNode("div",{ref_key:"list",ref:u,class:"pl-dropdown__options",style:r.normalizeStyle(_),tabindex:"-1"},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(V.value,(U,O)=>(r.openBlock(),r.createBlock(co,{key:O,option:U,"is-selected":U.isSelected,"is-hovered":U.isActive,size:"medium",onClick:r.withModifiers(Z=>v(U.value),["stop"])},null,8,["option","is-selected","is-hovered","onClick"]))),128))],4)])):r.createCommentVNode("",!0)],34))}});function Nu(t){function e(n){const o=n.currentTarget,s=document.createElement("span"),l=Math.max(o.clientWidth,o.clientHeight),c=l/2;s.style.width=s.style.height=`${l}px`,s.style.left=`${n.clientX-o.offsetLeft-c}px`,s.style.top=`${n.clientY-o.offsetTop-c}px`,s.classList.add("ripple");const u=o.getElementsByClassName("ripple")[0];u&&u.remove(),o.appendChild(s)}r.onMounted(()=>{var n;(n=t.value)==null||n.addEventListener("click",e)})}const Xv={key:0},Qv={inheritAttrs:!1},_s=r.defineComponent({...Qv,__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"),s=r.computed(()=>e.large||e.size==="large");return Nu(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:s.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",Xv,[r.renderSlot(l.$slots,"default")])),c[0]||(c[0]=r.createTextVNode()),l.loading?(r.openBlock(),r.createBlock(r.unref(cn),{key:1,name:"loading",size:l.size},null,8,["size"])):l.icon?(r.openBlock(),r.createBlock(r.unref(cn),{key:2,name:l.icon,size:l.size},null,8,["name","size"])):r.createCommentVNode("",!0)],16))}}),ew={name:"PlBtnPrimary"},Cs=r.defineComponent({...ew,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(_s,r.mergeProps({class:"pl-btn-primary"},e),{default:r.withCtx(()=>[r.renderSlot(n.$slots,"default")]),_:3},16))}}),tw={name:"PlBtnAccent"},nw=r.defineComponent({...tw,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(_s,r.mergeProps({class:"pl-btn-accent"},e),{default:r.withCtx(()=>[r.renderSlot(n.$slots,"default")]),_:3},16))}}),rw={name:"PlBtnDanger"},ow=r.defineComponent({...rw,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(_s,r.mergeProps({class:"pl-btn-danger"},e),{default:r.withCtx(()=>[r.renderSlot(n.$slots,"default")]),_:3},16))}}),iw={name:"PlBtnSecondary"},ml=r.defineComponent({...iw,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(_s,r.mergeProps(e,{class:"pl-btn-secondary"}),{default:r.withCtx(()=>[r.renderSlot(n.$slots,"default")]),_:3},16))}}),sw={key:0},aw={name:"PlBtnGhost"},po=r.defineComponent({...aw,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"),s=r.ref(),l=r.useSlots();return Nu(s),(c,u)=>(r.openBlock(),r.createElementBlock("button",r.mergeProps({ref_key:"btnRef",ref:s,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",sw,[r.renderSlot(c.$slots,"default")])):r.createCommentVNode("",!0),u[0]||(u[0]=r.createTextVNode()),c.loading?(r.openBlock(),r.createBlock(r.unref(cn),{key:1,name:"loading",size:c.size},null,8,["size"])):c.icon?(r.openBlock(),r.createBlock(r.unref(cn),{key:2,name:c.icon,size:c.size},null,8,["name","size"])):r.createCommentVNode("",!0),u[1]||(u[1]=r.createTextVNode()),r.renderSlot(c.$slots,"append")],16))}}),lw=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,s)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["ui-btn-link",{disabled:o.disabled,loading:o.loading,hover:n.value}]),onMouseover:s[0]||(s[0]=l=>n.value=!0),onMouseleave:s[1]||(s[1]=l=>n.value=!1)},[r.createVNode(ml,r.mergeProps({round:"",hover:n.value},e),null,16,["hover"]),s[2]||(s[2]=r.createTextVNode()),r.renderSlot(o.$slots,"default")],34))}});function cw(t,e){const n=r.ref();return uo(t,o=>{n.value=o}),r.computed(()=>{const o=r.unref(n),s=r.unref(e),l=s.position??"top",c=s.gap??8;if(!o)return"";const u=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: ${u}px;`:l==="left"?`right: ${o.scrollWidth-o.x+c}px; top: ${u}px;`:""})}function ui(t,e){return e(t)}function at(t,e){if(t!=null)return e(t)}function dw(t){return Array.isArray(t)?t:[t]}function uw(t,e,...n){n.forEach(o=>{t[o]=e[o]})}function vs(t,e){nt(document,"click",n=>{document.contains(n.target)&&(dw(t).map(o=>o.value).filter(o=>!!o).some(o=>o==null?void 0:o.contains(n.target))||e())})}const pw={},hw={class:"beak",width:"5",height:"9",viewBox:"0 0 3 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function fw(t,e){return r.openBlock(),r.createElementBlock("svg",hw,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 mw=Lt(pw,[["render",fw]]),gl=new Map,gw={name:"PlTooltip"},Ct=r.defineComponent({...gw,props:{openDelay:{default:100},closeDelay:{default:1e3},position:{default:"top"},hide:{type:Boolean},gap:{default:8},element:{default:"div"}},emits:["tooltip:close"],setup(t,{emit:e}){const n=e,o=Symbol(),s=t,l=r.reactive({open:!1,over:!1,tooltipOpen:!1,key:Symbol()});gl.set(o,()=>f()),r.watch(()=>l.open,I=>{requestAnimationFrame(()=>{l.tooltipOpen=I})});let c=()=>{};const u=Su(()=>window.dispatchEvent(new CustomEvent("adjust")),1e3),p=()=>{l.open=!0;for(let[I,G]of gl.entries())I!==o&&G()},f=()=>{l.open=!1,n("tooltip:close")},m=async()=>{s.hide||(u(),l.over=!0,c(),await Cu(100),l.over&&p())},_=()=>{l.over=!1,c=vu(()=>{l.over||f()},s.closeDelay)};r.watch(()=>s.hide,I=>{I&&f()});const x=r.ref(),S=r.ref(),V=cw(x,r.toRef(s));return vs([x,S],()=>f()),r.onUnmounted(()=>{gl.delete(o)}),(I,G)=>(r.openBlock(),r.createBlock(r.resolveDynamicComponent(I.element),r.mergeProps(I.$attrs,{ref_key:"rootRef",ref:x,onClick:m,onMouseover:m,onMouseleave:_}),{default:r.withCtx(()=>[r.renderSlot(I.$slots,"default"),G[1]||(G[1]=r.createTextVNode()),I.$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(V))},[r.createElementVNode("div",{ref_key:"tooltip",ref:S,class:r.normalizeClass(["pl-tooltip",I.position]),onMouseover:m,onMouseleave:_},[r.createElementVNode("div",null,[r.renderSlot(I.$slots,"tooltip")]),G[0]||(G[0]=r.createTextVNode()),r.createVNode(mw)],34)],4)):r.createCommentVNode("",!0)]),_:3})])):r.createCommentVNode("",!0)]),_:3},16))}}),yw={},_w={class:"inner-border"};function Cw(t,e,n,o,s,l){return r.openBlock(),r.createElementBlock("div",_w,[r.renderSlot(t.$slots,"default")])}const vw=Lt(yw,[["render",Cw]]),ww={key:0},bw=["tabindex","onKeydown","onClick"],xw={key:1,class:"pl-btn-group__helper"},kw={key:2,class:"pl-btn-group__error"},Sw={name:"PlBtnGroup"},Au=r.defineComponent({...Sw,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,s=u=>o("update:modelValue",u),l=t,c=r.computed(()=>l.options.map(u=>({label:"label"in u?u.label:u.text,value:u.value})));return(u,p)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["pl-btn-group",{disabled:u.disabled,compact:u.compact}])},[u.label?(r.openBlock(),r.createElementBlock("label",ww,[r.createElementVNode("span",null,r.toDisplayString(u.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(u.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0),p[1]||(p[1]=r.createTextVNode()),r.createVNode(vw,{class:"pl-btn-group__container"},{default:r.withCtx(()=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(c.value,(f,m)=>(r.openBlock(),r.createElementBlock("div",{key:m,class:r.normalizeClass(["pl-btn-group__option text-s",{active:u.modelValue===f.value}]),tabindex:u.modelValue===f.value||u.disabled?void 0:0,onKeydown:r.withKeys(_=>s(f.value),["enter"]),onClick:_=>s(f.value)},r.toDisplayString(f.label),43,bw))),128))]),_:1}),p[2]||(p[2]=r.createTextVNode()),u.helper?(r.openBlock(),r.createElementBlock("div",xw,r.toDisplayString(u.helper),1)):u.error?(r.openBlock(),r.createElementBlock("div",kw,r.toDisplayString(u.error),1)):r.createCommentVNode("",!0)],2))}});function Ew(t,e){const n=r.ref(),o=r.ref(),{parse:s,update:l}=e,c=()=>{n.value=void 0,o.value=void 0},u=r.computed({get(){return n.value!==void 0?n.value:t.value},set(p){c();try{const f=s?s(p):p;!l||l(f)?t.value=f:n.value=f}catch(f){n.value=p,o.value=f instanceof Error?f.message:String(f)}}});return r.reactive({value:u,error:o,reset:c})}const Tw="_component_1abv8_1",Bw="_container_1abv8_15",Vw="_error_1abv8_69",yl={component:Tw,container:Bw,error:Vw},Nw={key:0},Aw=["placeholder"],Pw=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=Ew(e,{update(){return!1},parse:u=>{if(typeof u!="string")throw Error("value should be a string");if(n.maxLength&&u.length>n.maxLength)throw Error(`Max title length is ${n.maxLength} characters`);if(n.minLength&&u.length<n.minLength)throw Error(`Min title length is ${n.minLength} characters`);return u.trim()}}),s=r.computed(()=>({maxWidth:n.maxWidth??"80%"})),l=()=>{e.value=o.value&&!o.error?o.value:e.value,o.reset()},c=r.ref();return(u,p)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["pl-editable-title",r.unref(yl).component]),style:r.normalizeStyle(s.value)},[r.createElementVNode("div",{class:r.normalizeClass(r.unref(yl).container),onClick:p[3]||(p[3]=()=>{var f;return(f=c.value)==null?void 0:f.focus()})},[u.prefix?(r.openBlock(),r.createElementBlock("span",Nw,r.toDisplayString(u.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]=f=>r.unref(o).value=f),placeholder:u.placeholder,onFocusout:l,onKeydown:[p[1]||(p[1]=r.withKeys((...f)=>r.unref(o).reset&&r.unref(o).reset(...f),["escape"])),p[2]||(p[2]=r.withKeys(f=>{var m;return(m=f.target)==null?void 0:m.blur()},["enter"]))]},null,40,Aw),[[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(yl).error)},r.toDisplayString(r.unref(o).error),3)):r.createCommentVNode("",!0)],6))}}),Dw={inheritAttrs:!1},Fw={class:"double-contour"};function Rw(t,e,n,o,s,l){return r.openBlock(),r.createElementBlock("div",Fw,[r.createElementVNode("div",r.normalizeProps(r.guardReactiveProps(t.$attrs)),[r.renderSlot(t.$slots,"default")],16)])}const cr=Lt(Dw,[["render",Rw]]);function Pu(t){r.onMounted(t),r.onUpdated(t)}const _l=new WeakMap,Cl=new ResizeObserver(t=>{for(const e of t)at(_l.get(e.target),n=>n(e))});function Du(t,e){_l.set(t,e),Cl.unobserve(t),Cl.observe(t)}function Fu(t){Cl.unobserve(t),_l.delete(t)}const Mw=8,Ru=4;function zn(t,e="label"){const n=new Set;Pu(()=>{at(t==null?void 0:t.value,o=>{const s=o.querySelector(e);s&&(n.add(s),Du(s,()=>{const l=_u(()=>s.getBoundingClientRect().width+ui(Mw,c=>Number.isNaN(c)?Ru:c+Ru));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=>Fu(o))})}function Iw(t,e){const n=[];return e&&e.length>0&&e.forEach(o=>{const s=o(t);typeof s=="string"&&n.push(s)}),{isValid:n.length===0,errors:n}}function Mu(t,e){return r.computed(()=>Iw(t.value,e))}const Ow=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(s,l)=>(r.openBlock(),r.createElementBlock("i",{style:r.normalizeStyle(n.value),class:r.normalizeClass([o.value,s.$style.icon])},null,6))}}),Lw="_icon_1ugxm_2",Gw={icon:Lw},zw={$style:Gw},ho=Lt(Ow,[["__cssModules",zw]]),$w=r.defineComponent({__name:"PlIcon24",props:{name:{},size:{}},setup(t){const e=t,n=r.computed(()=>`icon-24 icon-${e.name}`);return(o,s)=>(r.openBlock(),r.createElementBlock("i",{class:r.normalizeClass([n.value,o.$style.icon])},null,2))}}),Zw="_icon_1ugxm_2",Uw={icon:Zw},Ww={$style:Uw},pi=Lt($w,[["__cssModules",Ww]]),Hw={class:"pl-text-field__envelope"},jw={key:0,ref:"label"},qw={key:0,class:"required-icon"},Kw={key:1,class:"pl-text-field__prefix"},Yw=["disabled","placeholder","type"],Jw={class:"pl-text-field__append"},Xw={key:0,class:"pl-text-field__error"},Qw={key:1,class:"pl-text-field__helper"},e0={name:"PlTextField"},Ir=r.defineComponent({...e0,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,s=r.ref(void 0),l=r.ref(),c=r.ref(!1),u=r.reactive({cached:void 0}),p=r.computed({get(){return u.cached?u.cached.value:n.value===void 0||n.value===null?"":String(n.value)},set(F){if(u.cached=void 0,o.parse)try{n.value=o.parse(F)}catch(T){u.cached={error:T instanceof Error?T.message:String(T),value:F}}else n.value=F}}),f=r.computed(()=>o.type&&o.type==="password"?c.value?"text":o.type:"text"),m=r.computed(()=>c.value?"view-show":"view-hide"),_=()=>{o.clearable&&(u.cached=void 0,n.value=o.clearable===!0?"":o.clearable())},x=Mu(p,o.rules||[]),S=r.computed(()=>o.clearable?o.clearable===!0?n.value==="":n.value===o.clearable():n.value===""),V=r.computed(()=>!S.value),I=r.computed(()=>{const F=[];return o.error&&F.push(o.error),u.cached&&F.push(u.cached.error),x.value.isValid||F.push(...x.value.errors),F}),G=r.computed(()=>I.value.length>0),v=r.computed(()=>o.clearable&&V.value&&o.type!=="password"),R=()=>c.value=!c.value,L=()=>{u.cached=void 0};return zn(s),(F,T)=>(r.openBlock(),r.createElementBlock("div",Hw,[r.createElementVNode("div",{ref_key:"rootRef",ref:s,class:r.normalizeClass(["pl-text-field",{error:G.value,disabled:F.disabled,dashed:F.dashed,nonEmpty:V.value}])},[F.label?(r.openBlock(),r.createElementBlock("label",jw,[F.required?(r.openBlock(),r.createElementBlock("i",qw)):r.createCommentVNode("",!0),T[1]||(T[1]=r.createTextVNode()),r.createElementVNode("span",null,r.toDisplayString(F.label),1),T[2]||(T[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(F.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)],512)):r.createCommentVNode("",!0),T[5]||(T[5]=r.createTextVNode()),F.prefix?(r.openBlock(),r.createElementBlock("div",Kw,r.toDisplayString(F.prefix),1)):r.createCommentVNode("",!0),T[6]||(T[6]=r.createTextVNode()),r.withDirectives(r.createElementVNode("input",{ref_key:"inputRef",ref:l,"onUpdate:modelValue":T[0]||(T[0]=$=>p.value=$),disabled:F.disabled,placeholder:F.placeholder||"...",type:f.value,spellcheck:"false",onFocusout:L},null,40,Yw),[[r.vModelDynamic,p.value]]),T[7]||(T[7]=r.createTextVNode()),r.createElementVNode("div",Jw,[v.value?(r.openBlock(),r.createBlock(r.unref(ho),{key:0,class:"pl-text-field__clearable",name:"delete-clear",onClick:_})):r.createCommentVNode("",!0),T[3]||(T[3]=r.createTextVNode()),F.type==="password"?(r.openBlock(),r.createBlock(r.unref(pi),{key:1,name:m.value,style:{cursor:"pointer"},onClick:R},null,8,["name"])):r.createCommentVNode("",!0),T[4]||(T[4]=r.createTextVNode()),r.renderSlot(F.$slots,"append")]),T[8]||(T[8]=r.createTextVNode()),r.createVNode(cr,{class:"pl-text-field__contour"})],2),T[9]||(T[9]=r.createTextVNode()),G.value?(r.openBlock(),r.createElementBlock("div",Xw,r.toDisplayString(I.value.join(" ")),1)):F.helper?(r.openBlock(),r.createElementBlock("div",Qw,r.toDisplayString(F.helper),1)):r.createCommentVNode("",!0)]))}}),t0=["disabled","placeholder"],n0=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,s=r.ref(void 0),l=r.ref(),c=r.computed({get(){return o.modelValue??""},set(f){n("update:modelValue",f)}}),u=r.computed(()=>!!o.modelValue),p=()=>n("update:modelValue","");return(f,m)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"root",ref:s,class:r.normalizeClass(["pl-search-field",[f.$style.component]])},[r.createVNode(r.unref(pi),{name:"search"}),m[1]||(m[1]=r.createTextVNode()),r.withDirectives(r.createElementVNode("input",{ref_key:"input",ref:l,"onUpdate:modelValue":m[0]||(m[0]=_=>c.value=_),disabled:f.disabled,type:"text",placeholder:f.placeholder||"Find...",spellcheck:"false"},null,8,t0),[[r.vModelText,c.value]]),m[2]||(m[2]=r.createTextVNode()),f.clearable&&u.value?(r.openBlock(),r.createBlock(r.unref(ho),{key:0,class:r.normalizeClass(f.$style.clear),name:"delete-clear",onClick:r.withModifiers(p,["stop"])},null,8,["class"])):r.createCommentVNode("",!0)],2))}}),r0="_component_1ng5b_1",o0="_clear_1ng5b_35",i0={component:r0,clear:o0},s0={$style:i0},Iu=Lt(n0,[["__cssModules",s0]]),a0={class:"ui-text-area__envelope"},l0={key:0,ref:"label"},c0={key:0,class:"required-icon"},d0=["readonly","rows","disabled","placeholder"],u0={class:"ui-text-area__append"},p0={key:0,class:"ui-text-area__error"},h0={key:1,class:"ui-text-area__helper"},f0={name:"PlTextArea"},m0=r.defineComponent({...f0,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,s=t,l=r.ref(),c=r.ref(),u=r.computed({get(){return s.modelValue??""},set(S){o("update:modelValue",S)}}),p=r.computed(()=>!!s.modelValue),f=Mu(u,s.rules||[]);zn(l);const m=r.computed(()=>{const S=[];return s.error&&S.push(s.error),S.push(...f.value.errors),S}),_=r.computed(()=>m.value.length>0),x=()=>{if(!s.autogrow)return;const S=c.value;S&&(S.style.height="auto",S.style.height=`${S.scrollHeight}px`)};return r.onMounted(()=>{x()}),(S,V)=>(r.openBlock(),r.createElementBlock("div",a0,[r.createElementVNode("div",{ref_key:"root",ref:l,class:r.normalizeClass(["ui-text-area",{error:_.value,disabled:S.disabled,dashed:S.dashed,nonEmpty:p.value}])},[S.label?(r.openBlock(),r.createElementBlock("label",l0,[S.required?(r.openBlock(),r.createElementBlock("i",c0)):r.createCommentVNode("",!0),V[1]||(V[1]=r.createTextVNode()),r.createElementVNode("span",null,r.toDisplayString(S.label),1),V[2]||(V[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(S.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)],512)):r.createCommentVNode("",!0),V[3]||(V[3]=r.createTextVNode()),r.withDirectives(r.createElementVNode("textarea",{ref_key:"input",ref:c,"onUpdate:modelValue":V[0]||(V[0]=I=>u.value=I),readonly:S.readonly,rows:S.rows,disabled:S.disabled,placeholder:S.placeholder??"...",spellcheck:"false",onInput:x},null,40,d0),[[r.vModelText,u.value]]),V[4]||(V[4]=r.createTextVNode()),r.createElementVNode("div",u0,[r.renderSlot(S.$slots,"append")]),V[5]||(V[5]=r.createTextVNode()),r.createVNode(cr,{class:"ui-text-area__contour"})],2),V[6]||(V[6]=r.createTextVNode()),_.value?(r.openBlock(),r.createElementBlock("div",p0,r.toDisplayString(m.value.join(" ")),1)):S.helper?(r.openBlock(),r.createElementBlock("div",h0,r.toDisplayString(S.helper),1)):r.createCommentVNode("",!0)]))}});function Ou(t,e){const n=t.scrollTop,o=t.getBoundingClientRect().height,s=e.offsetTop,l=e.getBoundingClientRect().height;return s+l<o+n&&s>n}function Lu(t,e){const n=t.scrollTop,o=t.getBoundingClientRect().height,s=e.offsetTop,l=e.getBoundingClientRect().height;return s+l<o+n?"ceil":s>n?"floor":"visible"}function hi(t,e,n={}){const o=t.scrollTop,s=t.getBoundingClientRect().height,l=e.getBoundingClientRect().height,c=e.offsetTop,u=Lu(t,e);if(u==="visible")return;const p=f=>{const m=u==="floor"?c-(s-l):c;t.scrollTop=o+f*(m-o)};Ou(t,e)||xu({duration:n.duration||100,timing:bu(f=>f),draw:p})}function vl(t,e,n,o){return t.addEventListener(e,n,o),function(){t.removeEventListener(e,n)}}function g0(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}function Gu(t){return t!==null&&typeof t=="object"}function Pt(t,e){return Gu(t)&&Gu(e)?Object.keys(t).length!==Object.keys(e).length?!1:Object.keys(t).every(n=>Pt(t[n],e[n])):t===e}function wl(t,e){return t.some(n=>Pt(n,e))}const bl=r.defineComponent({__name:"LongText",setup(t){r.useCssVars(m=>({"8d68520c":c.value}));const e=r.ref(!1),n=r.ref(),o=r.ref(!1),s=r.computed(()=>o.value&&e.value?"ui-lt-animate":""),l=ku(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 u(){const m=dl(n.value,"span cannot be empty");e.value=m.clientWidth<m.scrollWidth}function p(){u(),l(!0)}function f(){l(!1)}return(m,_)=>(r.openBlock(),r.createElementBlock("div",r.mergeProps(m.$attrs,{class:"ui-lt-container"}),[r.createElementVNode("span",{onMouseover:p,onMouseleave:f},[r.createElementVNode("span",{ref_key:"span",ref:n,class:r.normalizeClass(s.value)},[r.renderSlot(m.$slots,"default")],2)],32)],16))}}),y0=r.defineComponent({__name:"PlMaskIcon24",props:{name:{},size:{}},setup(t){const e=t,n=r.computed(()=>`mask-24 mask-${e.name}`);return(o,s)=>(r.openBlock(),r.createElementBlock("i",{class:r.normalizeClass([n.value,o.$style.icon])},null,2))}}),_0="_icon_1ugxm_2",C0={icon:_0},v0={$style:C0},Dt=Lt(y0,[["__cssModules",v0]]),w0={class:"pl-dropdown__envelope"},b0=["tabindex"],x0={class:"pl-dropdown__container"},k0={class:"pl-dropdown__field"},S0=["disabled","placeholder"],E0={class:"pl-dropdown__controls"},T0={key:0},B0={key:0,class:"required-icon"},V0={key:0,class:"nothing-found"},N0={key:0,class:"pl-dropdown__error"},A0={key:1,class:"pl-dropdown__helper"},P0={key:2,class:"pl-dropdown__helper"},D0={name:"PlDropdown"},fo=r.defineComponent({...D0,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,s=r.useSlots(),l=r.ref(),c=r.ref(),u=r.ref(),p=r.reactive({search:"",activeIndex:-1,open:!1,optionsHeight:0}),f=()=>ui(L.value.findIndex(E=>Pt(E.value,o.modelValue)),E=>E<0?0:E),m=()=>p.activeIndex=f(),_=r.computed(()=>o.options===void 0),x=r.computed(()=>_.value?!0:o.disabled),S=r.computed(()=>(o.options??[]).findIndex(E=>Pt(E.value,o.modelValue))),V=r.computed(()=>{if(!_.value){if(o.error)return o.error;if(o.modelValue!==void 0&&S.value===-1)return"The selected value is not one of the options"}}),I=r.computed(()=>lr(o.options??[]).map((E,P)=>({...E,index:P,isSelected:P===S.value,isActive:P===p.activeIndex}))),G=r.computed(()=>{const E=r.unref(I).find(P=>Pt(P.value,o.modelValue));return(E==null?void 0:E.label)||o.modelValue}),v=r.computed(()=>!p.open&&o.modelValue?"":o.modelValue?String(G.value):o.placeholder),R=r.computed(()=>o.modelValue!==void 0&&o.modelValue!==null),L=r.computed(()=>{const E=I.value;return p.search?E.filter(P=>{const j=p.search.toLowerCase();return P.label.toLowerCase().includes(j)||P.description&&P.description.toLowerCase().includes(j)?!0:typeof P.value=="string"?P.value.toLowerCase().includes(j):P.value===p.search}):E}),F=r.computed(()=>x.value?void 0:"0"),T=E=>{var P;n("update:modelValue",E),p.search="",p.open=!1,(P=l==null?void 0:l.value)==null||P.focus()},$=()=>n("update:modelValue",void 0),U=()=>{var E;return(E=u.value)==null?void 0:E.focus()},O=()=>p.open=!p.open,Z=()=>p.open=!0,W=E=>{var P,j;const oe=E.relatedTarget;!((P=l.value)!=null&&P.contains(oe))&&!((j=c.value)!=null&&j.contains(oe))&&(p.search="",p.open=!1)},J=()=>{const E=c.value;E&&at(E.querySelector(".hovered-item"),P=>{hi(E,P)})},he=E=>{var P,j;if(["ArrowDown","ArrowUp","Enter","Escape"].includes(E.code))E.preventDefault();else return;const{open:oe,activeIndex:ae}=p;if(!oe){E.code==="Enter"&&(p.open=!0);return}E.code==="Escape"&&(p.open=!1,(P=l.value)==null||P.focus());const Fe=r.unref(L),{length:Ye}=Fe;if(!Ye)return;E.code==="Enter"&&T((j=Fe.find(Fi=>Fi.index===ae))==null?void 0:j.value);const ft=Fe.findIndex(Fi=>Fi.index===ae)??-1,Cr=E.code==="ArrowDown"?1:E.code==="ArrowUp"?-1:0,Wr=Math.abs(ft+Cr+Ye)%Ye;p.activeIndex=L.value[Wr].index??-1};zn(l),r.watch(()=>o.modelValue,m,{immediate:!0}),r.watch(()=>p.open,E=>{var P;return E?(P=u.value)==null?void 0:P.focus():""}),r.watchPostEffect(()=>{p.search,p.activeIndex>=0&&p.open&&J()});const N=r.reactive({top:"0px",left:"0px",width:"0px"});return r.watch(c,E=>{if(E){const P=E.getBoundingClientRect();p.optionsHeight=P.height,window.dispatchEvent(new CustomEvent("adjust"))}}),uo(l,E=>{const P=E.top+E.height+3;P+p.optionsHeight>E.clientHeight?N.top=E.top-p.optionsHeight-3+"px":N.top=P+"px",N.left=E.left+"px",N.width=E.width+"px"}),(E,P)=>(r.openBlock(),r.createElementBlock("div",w0,[r.createElementVNode("div",{ref_key:"root",ref:l,tabindex:F.value,class:r.normalizeClass(["pl-dropdown",{open:p.open,error:E.error,disabled:x.value}]),onKeydown:he,onFocusout:W},[r.createElementVNode("div",x0,[r.createElementVNode("div",k0,[r.withDirectives(r.createElementVNode("input",{ref_key:"input",ref:u,"onUpdate:modelValue":P[0]||(P[0]=j=>p.search=j),type:"text",tabindex:"-1",disabled:x.value,placeholder:v.value,spellcheck:"false",autocomplete:"chrome-off",onFocus:Z},null,40,S0),[[r.vModelText,p.search]]),P[4]||(P[4]=r.createTextVNode()),p.open?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",{key:0,onClick:U},[r.createVNode(bl,{class:"input-value"},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(G.value),1)]),_:1})])),P[5]||(P[5]=r.createTextVNode()),r.createElementVNode("div",E0,[_.value?(r.openBlock(),r.createBlock(r.unref(Dt),{key:0,name:"loading"})):r.createCommentVNode("",!0),P[1]||(P[1]=r.createTextVNode()),E.clearable&&R.value?(r.openBlock(),r.createBlock(r.unref(ho),{key:1,name:"delete-clear",onClick:r.withModifiers($,["stop"])})):r.createCommentVNode("",!0),P[2]||(P[2]=r.createTextVNode()),r.renderSlot(E.$slots,"append"),P[3]||(P[3]=r.createTextVNode()),E.arrowIconLarge?(r.openBlock(),r.createElementBlock("div",{key:2,class:r.normalizeClass(["arrow-icon",[`icon-24 ${E.arrowIconLarge}`]]),onClick:r.withModifiers(O,["stop"])},null,2)):E.arrowIcon?(r.openBlock(),r.createElementBlock("div",{key:3,class:r.normalizeClass(["arrow-icon",[`icon-16 ${E.arrowIcon}`]]),onClick:r.withModifiers(O,["stop"])},null,2)):(r.openBlock(),r.createElementBlock("div",{key:4,class:"arrow-icon arrow-icon-default",onClick:r.withModifiers(O,["stop"])}))])]),P[9]||(P[9]=r.createTextVNode()),E.label?(r.openBlock(),r.createElementBlock("label",T0,[E.required?(r.openBlock(),r.createElementBlock("i",B0)):r.createCommentVNode("",!0),P[6]||(P[6]=r.createTextVNode()),r.createElementVNode("span",null,r.toDisplayString(E.label),1),P[7]||(P[7]=r.createTextVNode()),r.unref(s).tooltip?(r.openBlock(),r.createBlock(r.unref(Ct),{key:1,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.renderSlot(E.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0),P[10]||(P[10]=r.createTextVNode()),p.open?(r.openBlock(),r.createBlock(r.Teleport,{key:1,to:"body"},[r.createElementVNode("div",{ref_key:"list",ref:c,class:"pl-dropdown__options",style:r.normalizeStyle(N),tabindex:"-1"},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(L.value,(j,oe)=>(r.openBlock(),r.createBlock(co,{key:oe,option:j,"is-selected":j.isSelected,"is-hovered":j.isActive,size:E.optionSize,onClick:r.withModifiers(ae=>T(j.value),["stop"])},null,8,["option","is-selected","is-hovered","size","onClick"]))),128)),P[8]||(P[8]=r.createTextVNode()),L.value.length?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",V0,"Nothing found"))],4)])):r.createCommentVNode("",!0),P[11]||(P[11]=r.createTextVNode()),r.createVNode(cr,{class:"pl-dropdown__contour"})])],42,b0),P[12]||(P[12]=r.createTextVNode()),V.value?(r.openBlock(),r.createElementBlock("div",N0,r.toDisplayString(V.value),1)):_.value&&E.loadingOptionsHelper?(r.openBlock(),r.createElementBlock("div",A0,r.toDisplayString(E.loadingOptionsHelper),1)):E.helper?(r.openBlock(),r.createElementBlock("div",P0,r.toDisplayString(E.helper),1)):r.createCommentVNode("",!0)]))}}),F0={name:"PlDropdownRef"},R0=r.defineComponent({...F0,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 s;return(s=e.options)==null?void 0:s.map(l=>({label:l.label,value:l.ref}))}),o=r.computed(()=>e.disabled?"icon-link-disabled":"icon-link");return(s,l)=>(r.openBlock(),r.createBlock(r.unref(fo),r.mergeProps(e,{options:n.value,"loading-options-helper":s.loadingOptionsHelper,"arrow-icon-large":o.value,"onUpdate:modelValue":l[0]||(l[0]=c=>s.$emit("update:modelValue",c))}),null,16,["options","loading-options-helper","arrow-icon-large"]))}});function M0(t,e){return r.computed(()=>{const n=lr(t.value);return e.value?n.filter(o=>o.label.toLowerCase().includes(e.value.toLowerCase())):n})}const I0={class:"resizable-input"},O0=["placeholder","value","disabled"],L0=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,s=r.computed(()=>{var u;return n.placeholder?n.placeholder:(u=n.modelValue||n.value)==null?void 0:u.replace('"',"")}),l=r.computed(()=>{const u={};return n.width&&(u.width=n.width),n.maxWidth&&(u.maxWidth=n.maxWidth),u});function c(u){const p=u.target.value;o("update:modelValue",p)}return(u,p)=>(r.openBlock(),r.createElementBlock("div",I0,[r.createElementVNode("span",{style:r.normalizeStyle(l.value),class:"resizable-input__size-span"},r.toDisplayString(s.value),5),p[0]||(p[0]=r.createTextVNode()),r.createElementVNode("input",r.mergeProps(u.$attrs,{placeholder:u.placeholder,value:n.modelValue,disabled:n.disabled,style:l.value,onInput:c}),null,16,O0)]))}}),G0={class:"dropdown-tab-item__title text-caps13"},z0=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 s=[];return e.isSelected&&s.push("dropdown-tab-item__selected"),e.isHovered&&s.push("hovered-item"),s.join(" ")});return(s,l)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass([o.value,"dropdown-tab-item"])},[r.createElementVNode("div",G0,r.toDisplayString(n.value),1)],2))}}),$0={class:"pl-line-dropdown__prefix"},Z0={class:"pl-line-dropdown__icon-wrapper"},U0={class:"pl-line-dropdown__icon"},W0={key:0,class:"pl-line-dropdown__no-item"},H0={key:0,class:"pl-line-dropdown__no-item"},zu=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,s=r.reactive({isOpen:!1,activeOption:-1,optionsHeight:0}),l=r.ref(),c=r.ref(),u=r.computed(()=>{const W=[];return s.isOpen&&W.push("open"),o.disabled&&W.push("disabled"),W.join(" ")}),p=r.ref(""),f=M0(r.toRef(o,"options"),p),m=r.computed(()=>!!(o.clearable&&s.isOpen&&o.modelValue&&_.value)),_=r.computed(()=>{if(o.modelValue){const W=V();if(W!==-1){const J=lr(o.options)[W];return typeof J.label=="object"?J.label.title:J.label}}return""}),x=r.ref(_.value),S=r.computed(()=>s.isOpen&&p.value&&p.value.length>=_.value.length-1?p.value:_.value??"...");vs(l,()=>{o.mode==="list"&&(s.isOpen=!1)}),r.watch(()=>x.value,W=>{_.value!==W?p.value=W:p.value=""}),r.watch(()=>s.isOpen,W=>{var J;W&&l.value&&((J=l.value.querySelector("input"))==null||J.focus(),r.nextTick(()=>U()))}),r.watch(()=>o.modelValue,()=>I(),{immediate:!0});function V(){return o.options.findIndex(W=>Pt(W.value,o.modelValue))}function I(){s.activeOption=ui(f.value.findIndex(W=>Pt(W.value,o.modelValue)),W=>W<0?0:W),x.value=_.value}function G(){p.value=""}function v(){o.disabled?s.isOpen=!1:r.nextTick(()=>{s.isOpen=!s.isOpen})}function R(){o.mode==="list"&&(s.isOpen=!1)}function L(W){W&&(n("update:modelValue",W.value),R(),G())}function F(W){return Pt(W.value,o.modelValue)}const T=W=>{var J,he;const N=W.relatedTarget;!((J=l.value)!=null&&J.contains(N))&&!((he=c.value)!=null&&he.contains(N))&&(p.value="",s.isOpen=!1)};function $(W){const{activeOption:J}=s;if(!s.isOpen&&W.code==="Enter"){s.isOpen=!0;return}const{length:he}=f.value;if(!he)return;["ArrowDown","ArrowUp","Enter"].includes(W.code)&&W.preventDefault(),W.code==="Enter"&&L(f.value[J]);const N=W.code==="ArrowDown"?1:W.code==="ArrowUp"?-1:0;s.activeOption=Math.abs(J+N+he)%he,requestAnimationFrame(U)}function U(){const W=c.value;W&&at(W.querySelector(".hovered-item"),J=>{o.mode==="list"?hi(W,J):J.scrollIntoView({behavior:"smooth",block:"nearest",inline:"center"})})}function O(){n("update:modelValue",void 0)}const Z=r.reactive({top:"0px",left:"0px"});return r.watch(c,W=>{if(W){const J=W.getBoundingClientRect();s.optionsHeight=J.height,window.dispatchEvent(new CustomEvent("adjust"))}}),uo(l,W=>{const J=W.top+W.height+2;J+s.optionsHeight>W.clientHeight?Z.top=W.top-s.optionsHeight-2+"px":Z.top=J+"px",Z.left=W.left+"px"}),(W,J)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"container",ref:l,tabindex:"0",class:r.normalizeClass([u.value,"pl-line-dropdown uc-pointer"]),onKeydown:$,onFocusout:T,onClick:v},[r.createElementVNode("div",$0,r.toDisplayString(o==null?void 0:o.prefix),1),J[6]||(J[6]=r.createTextVNode()),r.createVNode(L0,{modelValue:x.value,"onUpdate:modelValue":J[0]||(J[0]=he=>x.value=he),placeholder:S.value,disabled:o.disabled,class:"pl-line-dropdown__input"},null,8,["modelValue","placeholder","disabled"]),J[7]||(J[7]=r.createTextVNode()),r.createElementVNode("div",Z0,[r.withDirectives(r.createElementVNode("div",U0,null,512),[[r.vShow,!m.value]]),J[1]||(J[1]=r.createTextVNode()),r.withDirectives(r.createElementVNode("div",{class:"pl-line-dropdown__icon-clear",onClick:O},null,512),[[r.vShow,m.value]])]),J[8]||(J[8]=r.createTextVNode()),s.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(Z),tabindex:"-1",class:"pl-line-dropdown__items",onFocusout:T},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(f),(he,N)=>r.renderSlot(W.$slots,"item",{key:N,item:he,textItem:"text",isSelected:F(he),isHovered:s.activeOption==N,onClick:r.withModifiers(E=>L(he),["stop"])},()=>[r.createVNode(co,{option:he,"text-item":"text","is-selected":F(he),"is-hovered":s.activeOption==N,size:"medium",onClick:r.withModifiers(E=>L(he),["stop"])},null,8,["option","is-selected","is-hovered","onClick"])])),128)),J[3]||(J[3]=r.createTextVNode()),r.unref(f).length===0?(r.openBlock(),r.createElementBlock("div",W0,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(Z),tabindex:"-1",class:"pl-line-dropdown__items-tabs",onFocusout:T},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(f),(he,N)=>r.renderSlot(W.$slots,"item",{key:N,item:he,isSelected:F(he),isHovered:s.activeOption==N,onClick:r.withModifiers(E=>L(he),["stop"])},()=>[r.createVNode(z0,{option:he,"is-selected":F(he),"is-hovered":s.activeOption==N,onClick:r.withModifiers(E=>L(he),["stop"])},null,8,["option","is-selected","is-hovered","onClick"])])),128)),J[5]||(J[5]=r.createTextVNode()),r.unref(f).length===0?(r.openBlock(),r.createElementBlock("div",H0,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))}}),j0={class:"ui-dropdown__envelope"},q0=["tabindex"],K0={class:"ui-dropdown__container"},Y0={class:"ui-dropdown__field"},J0=["disabled","placeholder"],X0={class:"ui-dropdown__controls"},Q0={key:0},eb={key:0,class:"required-icon"},tb={key:0,class:"nothing-found"},nb={key:0,class:"ui-dropdown__error"},rb={key:1,class:"ui-dropdown__helper"},ob={key:2,class:"ui-dropdown__helper"},ib={name:"PlDropdown"},sb=r.defineComponent({...ib,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,s=r.useSlots(),l=r.ref(),c=r.ref(),u=r.ref(),p=r.reactive({search:"",activeIndex:-1,open:!1}),f=()=>ui(L.value.findIndex(N=>Pt(N.value,o.modelValue)),N=>N<0?0:N),m=()=>p.activeIndex=f(),_=r.computed(()=>o.options===void 0),x=r.computed(()=>_.value?!0:o.disabled),S=r.computed(()=>(o.options??[]).findIndex(N=>Pt(N.value,o.modelValue))),V=r.computed(()=>{if(!_.value){if(o.error)return o.error;if(o.modelValue!==void 0&&S.value===-1)return"The selected value is not one of the options"}}),I=r.computed(()=>lr(o.options??[]).map((N,E)=>({...N,index:E,isSelected:E===S.value,isActive:E===p.activeIndex}))),G=r.computed(()=>{const N=r.unref(I).find(E=>Pt(E.value,o.modelValue));return(N==null?void 0:N.label)||o.modelValue}),v=r.computed(()=>!p.open&&o.modelValue?"":o.modelValue?String(G.value):o.placeholder),R=r.computed(()=>o.modelValue!==void 0&&o.modelValue!==null),L=r.computed(()=>{const N=I.value;return p.search?N.filter(E=>{const P=p.search.toLowerCase();return E.label.toLowerCase().includes(P)||E.description&&E.description.toLowerCase().includes(P)?!0:typeof E.value=="string"?E.value.toLowerCase().includes(P):E.value===p.search}):N}),F=r.computed(()=>x.value?void 0:"0"),T=N=>{var E;n("update:modelValue",N),p.search="",p.open=!1,(E=l==null?void 0:l.value)==null||E.focus()},$=()=>n("update:modelValue",void 0),U=()=>{var N;return(N=u.value)==null?void 0:N.focus()},O=()=>p.open=!p.open,Z=()=>p.open=!0,W=N=>{var E;(E=l==null?void 0:l.value)!=null&&E.contains(N.relatedTarget)||(p.search="",p.open=!1)},J=()=>{const N=c.value;N&&at(N.querySelector(".hovered-item"),E=>{hi(N,E)})},he=N=>{var E,P;if(["ArrowDown","ArrowUp","Enter","Escape"].includes(N.code))N.preventDefault();else return;const{open:j,activeIndex:oe}=p;if(!j){N.code==="Enter"&&(p.open=!0);return}N.code==="Escape"&&(p.open=!1,(E=l.value)==null||E.focus());const ae=r.unref(L),{length:Fe}=ae;if(!Fe)return;N.code==="Enter"&&T((P=ae.find(Wr=>Wr.index===oe))==null?void 0:P.value);const Ye=ae.findIndex(Wr=>Wr.index===oe)??-1,ft=N.code==="ArrowDown"?1:N.code==="ArrowUp"?-1:0,Cr=Math.abs(Ye+ft+Fe)%Fe;p.activeIndex=L.value[Cr].index??-1};return zn(l),r.watch(()=>o.modelValue,m,{immediate:!0}),r.watch(()=>p.open,N=>{var E;return N?(E=u.value)==null?void 0:E.focus():""}),r.watchPostEffect(()=>{p.search,p.activeIndex>=0&&p.open&&J()}),(N,E)=>(r.openBlock(),r.createElementBlock("div",j0,[r.createElementVNode("div",{ref_key:"root",ref:l,tabindex:F.value,class:r.normalizeClass(["ui-dropdown",{open:p.open,error:N.error,disabled:x.value}]),onKeydown:he,onFocusout:W},[r.createElementVNode("div",K0,[r.createElementVNode("div",Y0,[r.withDirectives(r.createElementVNode("input",{ref_key:"input",ref:u,"onUpdate:modelValue":E[0]||(E[0]=P=>p.search=P),type:"text",tabindex:"-1",disabled:x.value,placeholder:v.value,spellcheck:"false",autocomplete:"chrome-off",onFocus:Z},null,40,J0),[[r.vModelText,p.search]]),E[4]||(E[4]=r.createTextVNode()),p.open?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",{key:0,onClick:U},[r.createVNode(bl,{class:"input-value"},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(G.value),1)]),_:1})])),E[5]||(E[5]=r.createTextVNode()),r.createElementVNode("div",X0,[_.value?(r.openBlock(),r.createBlock(r.unref(Dt),{key:0,name:"loading"})):r.createCommentVNode("",!0),E[1]||(E[1]=r.createTextVNode()),N.clearable&&R.value?(r.openBlock(),r.createBlock(r.unref(ho),{key:1,name:"delete-clear",onClick:r.withModifiers($,["stop"])})):r.createCommentVNode("",!0),E[2]||(E[2]=r.createTextVNode()),r.renderSlot(N.$slots,"append"),E[3]||(E[3]=r.createTextVNode()),N.arrowIconLarge?(r.openBlock(),r.createElementBlock("div",{key:2,class:r.normalizeClass(["arrow-icon",[`icon-24 ${N.arrowIconLarge}`]]),onClick:r.withModifiers(O,["stop"])},null,2)):N.arrowIcon?(r.openBlock(),r.createElementBlock("div",{key:3,class:r.normalizeClass(["arrow-icon",[`icon-16 ${N.arrowIcon}`]]),onClick:r.withModifiers(O,["stop"])},null,2)):(r.openBlock(),r.createElementBlock("div",{key:4,class:"arrow-icon arrow-icon-default",onClick:r.withModifiers(O,["stop"])}))])]),E[9]||(E[9]=r.createTextVNode()),N.label?(r.openBlock(),r.createElementBlock("label",Q0,[N.required?(r.openBlock(),r.createElementBlock("i",eb)):r.createCommentVNode("",!0),E[6]||(E[6]=r.createTextVNode()),r.createElementVNode("span",null,r.toDisplayString(N.label),1),E[7]||(E[7]=r.createTextVNode()),r.unref(s).tooltip?(r.openBlock(),r.createBlock(r.unref(Ct),{key:1,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.renderSlot(N.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0),E[10]||(E[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(L.value,(P,j)=>(r.openBlock(),r.createBlock(co,{key:j,option:P,"is-selected":P.isSelected,"is-hovered":P.isActive,size:N.optionSize,onClick:r.withModifiers(oe=>T(P.value),["stop"])},null,8,["option","is-selected","is-hovered","size","onClick"]))),128)),E[8]||(E[8]=r.createTextVNode()),L.value.length?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",tb,"Nothing found"))],512)):r.createCommentVNode("",!0),E[11]||(E[11]=r.createTextVNode()),r.createVNode(cr,{class:"ui-dropdown__contour"})])],42,q0),E[12]||(E[12]=r.createTextVNode()),V.value?(r.openBlock(),r.createElementBlock("div",nb,r.toDisplayString(V.value),1)):_.value&&N.loadingOptionsHelper?(r.openBlock(),r.createElementBlock("div",rb,r.toDisplayString(N.loadingOptionsHelper),1)):N.helper?(r.openBlock(),r.createElementBlock("div",ob,r.toDisplayString(N.helper),1)):r.createCommentVNode("",!0)]))}}),ab={key:0,class:"ui-progress-bar"},lb={class:"ui-progress-bar__messages d-flex align-center pl-6 pr-6"},cb={class:"ui-progress-bar__message flex-grow-1"},db={class:"ui-progress-bar__percent"},ub=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,s)=>o.loading?(r.openBlock(),r.createElementBlock("div",ab,[r.createElementVNode("div",{class:"ui-progress-bar__indicator",style:r.normalizeStyle({width:o.progress+"%"})},null,4),s[1]||(s[1]=r.createTextVNode()),r.createElementVNode("div",lb,[r.createElementVNode("div",cb,r.toDisplayString(n.value),1),s[0]||(s[0]=r.createTextVNode()),r.createElementVNode("div",db,r.toDisplayString(o.progress+"%"),1)])])):r.createCommentVNode("",!0)}}),pb={class:"mi-number-field__main-wrapper d-flex"},hb={class:"mi-number-field__wrapper flex-grow d-flex flex-align-center"},fb={key:0,class:"text-description"},mb=["disabled","placeholder"],gb={class:"mi-number-field__icons d-flex-column"},yb={key:0,class:"mi-number-field__hint text-description"},_b=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,s=r.ref(),l=r.useSlots(),c=r.ref();zn(s);const u=r.ref(!0),p=r.computed({get(){return u.value&&n.modelValue!==void 0?new Number(n.modelValue).toString():""},set(v){var R;v=v.replace(/,/g,""),x(v)?(o("update:modelValue",+v),v.toString()!==((R=n.modelValue)==null?void 0:R.toString())&&+v===n.modelValue&&v[v.length-1]!=="."&&(u.value=!1,r.nextTick(()=>{u.value=!0}))):(v.trim()===""&&o("update:modelValue",void 0),u.value=!1,r.nextTick(()=>{u.value=!0}))}}),f=r.computed(()=>{let v=[];return n.errorMessage&&v.push(n.errorMessage),x(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)),_=r.computed(()=>!!(n.minValue&&n.modelValue!==void 0&&(n.modelValue||0)-n.step<n.minValue));function x(v){return v!==void 0?(v=v==null?void 0:v.toString(),!isNaN(+v)&&!isNaN(parseFloat(v))):!1}function S(){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 V(){if(!_.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 I(v){["ArrowDown","ArrowUp"].includes(v.code)&&v.preventDefault(),v.code==="ArrowUp"?S():v.code==="ArrowDown"&&V()}const G=v=>{v.detail>1&&v.preventDefault()};return(v,R)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"root",ref:s,class:r.normalizeClass([{error:!!f.value.trim(),disabled:v.disabled},"mi-number-field d-flex-column"]),onMousedown:G,onKeydown:R[1]||(R[1]=L=>I(L))},[r.createElementVNode("div",pb,[r.createVNode(cr,{class:"mi-number-field__contour"}),R[6]||(R[6]=r.createTextVNode()),r.createElementVNode("div",hb,[v.label?(r.openBlock(),r.createElementBlock("label",fb,[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),R[2]||(R[2]=r.createTextVNode()),r.withDirectives(r.createElementVNode("input",{ref_key:"input",ref:c,"onUpdate:modelValue":R[0]||(R[0]=L=>p.value=L),disabled:v.disabled,placeholder:v.placeholder,class:"text-s flex-grow"},null,8,mb),[[r.vModelText,p.value]])]),R[7]||(R[7]=r.createTextVNode()),r.createElementVNode("div",gb,[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:S},R[3]||(R[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),R[5]||(R[5]=r.createTextVNode()),r.createElementVNode("div",{class:r.normalizeClass([{disabled:_.value},"mi-number-field__icon d-flex flex-justify-center uc-pointer flex-grow flex-align-center"]),onClick:V},R[4]||(R[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)])]),R[8]||(R[8]=r.createTextVNode()),f.value.trim()?(r.openBlock(),r.createElementBlock("div",yb,r.toDisplayString(f.value),1)):r.createCommentVNode("",!0)],34))}}),Cb={class:"pl-chip__text"},xl=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,s)=>(r.openBlock(),r.createBlock(r.unref(Ct),{position:"top",class:"pl-chip-tooltip",delay:500},r.createSlots({default:r.withCtx(()=>[s[4]||(s[4]=r.createTextVNode()),r.createElementVNode("div",{ref_key:"chip",ref:e,class:r.normalizeClass(["pl-chip",{small:o.small}])},[r.createElementVNode("div",Cb,[r.renderSlot(o.$slots,"default")]),s[3]||(s[3]=r.createTextVNode()),o.closeable?(r.openBlock(),r.createElementBlock("div",{key:0,tabindex:"0",class:"pl-chip__close",onKeydown:s[0]||(s[0]=r.withKeys(l=>o.$emit("close"),["enter"])),onClick:s[1]||(s[1]=r.withModifiers(l=>o.$emit("close"),["stop"]))},s[2]||(s[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))}}),vb={class:"pl-multi-dropdown__envelope"},wb=["tabindex"],bb={class:"pl-multi-dropdown__container"},xb={class:"pl-multi-dropdown__field"},kb=["disabled","placeholder"],Sb={class:"pl-multi-dropdown__append"},Eb={key:0},Tb={key:0,class:"required-icon"},Bb={class:"pl-multi-dropdown__open-chips-container"},Vb={key:0,class:"nothing-found"},Nb={key:0,class:"pl-multi-dropdown__error"},Ab={key:1,class:"pl-multi-dropdown__helper"},Pb={name:"PlDropdownMulti"},Db=r.defineComponent({...Pb,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=O=>n("update:modelValue",O),s=r.useSlots(),l=t,c=r.ref(),u=r.ref(),p=r.ref(),f=r.reactive({search:"",activeOption:-1,open:!1,optionsHeight:0}),m=r.computed(()=>Array.isArray(l.modelValue)?l.modelValue:[]),_=r.computed(()=>f.open&&l.modelValue.length>0?l.placeholder:l.modelValue.length>0?"":l.placeholder),x=r.computed(()=>lr(l.options).filter(O=>wl(m.value,O.value))),S=r.computed(()=>{const O=r.unref(m),Z=lr(l.options);return(f.search?Z.filter(W=>{const J=f.search.toLowerCase();return W.label.toLowerCase().includes(J)?!0:typeof W.value=="string"?W.value.toLowerCase().includes(J):W.value===f.search}):[...Z]).map(W=>({...W,selected:wl(O,W.value)}))}),V=r.computed(()=>l.disabled?void 0:"0"),I=()=>{f.activeOption=ui(S.value.findIndex(O=>Pt(O.value,l.modelValue)),O=>O<0?0:O)},G=O=>{var Z;const W=r.unref(m);o(wl(W,O)?W.filter(J=>!Pt(J,O)):[...W,O]),f.search="",(Z=c==null?void 0:c.value)==null||Z.focus()},v=O=>o(r.unref(m).filter(Z=>!Pt(Z,O))),R=()=>{var O;return(O=p.value)==null?void 0:O.focus()},L=()=>f.open=!f.open,F=O=>{var Z,W;const J=O.relatedTarget;!((Z=c.value)!=null&&Z.contains(J))&&!((W=u.value)!=null&&W.contains(J))&&(f.search="",f.open=!1)},T=()=>{const O=u.value;O&&at(O.querySelector(".hovered-item"),Z=>{hi(O,Z)})},$=O=>{var Z;const{open:W,activeOption:J}=f;if(!W){O.code==="Enter"&&(f.open=!0);return}O.code==="Escape"&&(f.open=!1,(Z=c.value)==null||Z.focus());const he=r.unref(S),{length:N}=he;if(!N)return;["ArrowDown","ArrowUp","Enter"].includes(O.code)&&O.preventDefault(),O.code==="Enter"&&G(he[J].value);const E=O.code==="ArrowDown"?1:O.code==="ArrowUp"?-1:0;f.activeOption=Math.abs(J+E+N)%N,requestAnimationFrame(T)};zn(c),r.watch(()=>l.modelValue,()=>I(),{immediate:!0}),r.watchPostEffect(()=>{f.search,f.open&&T()});const U=r.reactive({top:"0px",left:"0px",width:"0px"});return r.watch(u,O=>{if(O){const Z=O.getBoundingClientRect();f.optionsHeight=Z.height,window.dispatchEvent(new CustomEvent("adjust"))}}),uo(c,O=>{const Z=O.top+O.height+5;Z+f.optionsHeight>O.clientHeight?U.top=O.top-f.optionsHeight-5+"px":U.top=Z+"px",U.left=O.left+"px",U.width=O.width+"px"}),(O,Z)=>(r.openBlock(),r.createElementBlock("div",vb,[r.createElementVNode("div",{ref_key:"rootRef",ref:c,tabindex:V.value,class:r.normalizeClass(["pl-multi-dropdown",{open:f.open,error:O.error,disabled:O.disabled}]),onKeydown:$,onFocusout:F},[r.createElementVNode("div",bb,[r.createElementVNode("div",xb,[r.withDirectives(r.createElementVNode("input",{ref_key:"input",ref:p,"onUpdate:modelValue":Z[0]||(Z[0]=W=>f.search=W),type:"text",tabindex:"-1",disabled:O.disabled,placeholder:_.value,spellcheck:"false",autocomplete:"chrome-off",onFocus:Z[1]||(Z[1]=W=>f.open=!0)},null,40,kb),[[r.vModelText,f.search]]),Z[3]||(Z[3]=r.createTextVNode()),f.open?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",{key:0,class:"chips-container",onClick:R},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(x.value,(W,J)=>(r.openBlock(),r.createBlock(r.unref(xl),{key:J,closeable:"",small:"",onClick:Z[2]||(Z[2]=r.withModifiers(he=>f.open=!0,["stop"])),onClose:he=>v(W.value)},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(W.label||W.value),1)]),_:2},1032,["onClose"]))),128))])),Z[4]||(Z[4]=r.createTextVNode()),r.createElementVNode("div",{class:"arrow",onClick:r.withModifiers(L,["stop"])}),Z[5]||(Z[5]=r.createTextVNode()),r.createElementVNode("div",Sb,[r.renderSlot(O.$slots,"append")])]),Z[10]||(Z[10]=r.createTextVNode()),O.label?(r.openBlock(),r.createElementBlock("label",Eb,[O.required?(r.openBlock(),r.createElementBlock("i",Tb)):r.createCommentVNode("",!0),Z[6]||(Z[6]=r.createTextVNode()),r.createElementVNode("span",null,r.toDisplayString(O.label),1),Z[7]||(Z[7]=r.createTextVNode()),r.unref(s).tooltip?(r.openBlock(),r.createBlock(r.unref(Ct),{key:1,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.renderSlot(O.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0),Z[11]||(Z[11]=r.createTextVNode()),f.open?(r.openBlock(),r.createBlock(r.Teleport,{key:1,to:"body"},[r.createElementVNode("div",{ref_key:"list",ref:u,class:"pl-multi-dropdown__options",style:r.normalizeStyle(U),tabindex:"-1",onFocusout:F},[r.createElementVNode("div",Bb,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(x.value,(W,J)=>(r.openBlock(),r.createBlock(r.unref(xl),{key:J,closeable:"",small:"",onClose:he=>v(W.value)},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(W.label||W.value),1)]),_:2},1032,["onClose"]))),128))]),Z[8]||(Z[8]=r.createTextVNode()),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(S.value,(W,J)=>(r.openBlock(),r.createBlock(co,{key:J,option:W,"text-item":"text","is-selected":W.selected,"is-hovered":f.activeOption==J,size:"medium","use-checkbox":"",onClick:r.withModifiers(he=>G(W.value),["stop"])},null,8,["option","is-selected","is-hovered","onClick"]))),128)),Z[9]||(Z[9]=r.createTextVNode()),S.value.length?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",Vb,"Nothing found"))],36)])):r.createCommentVNode("",!0),Z[12]||(Z[12]=r.createTextVNode()),r.createVNode(cr,{class:"pl-multi-dropdown__contour"})])],42,wb),Z[13]||(Z[13]=r.createTextVNode()),O.error?(r.openBlock(),r.createElementBlock("div",Nb,r.toDisplayString(O.error),1)):O.helper?(r.openBlock(),r.createElementBlock("div",Ab,r.toDisplayString(O.helper),1)):r.createCommentVNode("",!0)]))}}),kl=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,s)=>(r.openBlock(),r.createElementBlock("div",{tabindex:"0",class:r.normalizeClass(["pl-checkbox-base",{checked:n.value,disabled:o.disabled}]),onClick:s[0]||(s[0]=l=>o.$emit("update:modelValue",!o.modelValue)),onKeydown:s[1]||(s[1]=r.withKeys(l=>o.$emit("update:modelValue",!o.modelValue),["enter"]))},null,34))}}),Fb={name:"PlCheckbox"},Rb=r.defineComponent({...Fb,props:{modelValue:{type:Boolean},disabled:{type:Boolean}},emits:["update:modelValue"],setup(t){const e=t,n=r.useSlots();return(o,s)=>r.unref(n).default?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(["pl-checkbox",{disabled:o.disabled}])},[r.createVNode(kl,r.mergeProps(e,{"onUpdate:modelValue":s[0]||(s[0]=l=>o.$emit("update:modelValue",l))}),null,16),s[3]||(s[3]=r.createTextVNode()),r.createElementVNode("label",{onClick:s[1]||(s[1]=l=>o.$emit("update:modelValue",!o.$props.modelValue))},[r.renderSlot(o.$slots,"default")])],2)):(r.openBlock(),r.createBlock(kl,r.mergeProps({key:1},e,{"onUpdate:modelValue":s[2]||(s[2]=l=>o.$emit("update:modelValue",l))}),null,16))}}),Mb={key:0},Ib=["onClick"],Ob={name:"PlCheckboxGroup"},Lb=r.defineComponent({...Ob,props:{modelValue:{},label:{},options:{},disabled:{type:Boolean}},emits:["update:modelValue"],setup(t,{emit:e}){const n=e,o=t,s=c=>o.modelValue.includes(c),l=c=>{const u=o.modelValue??[];n("update:modelValue",s(c)?u.filter(p=>p!==c):[...u,c])};return(c,u)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["ui-checkbox-group",{disabled:c.disabled}])},[c.label?(r.openBlock(),r.createElementBlock("label",Mb,r.toDisplayString(c.label),1)):r.createCommentVNode("",!0),u[1]||(u[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,f)=>(r.openBlock(),r.createElementBlock("div",{key:f},[r.createVNode(kl,{disabled:c.disabled,label:p.label,"model-value":s(p.value),"onUpdate:modelValue":()=>l(p.value)},null,8,["disabled","label","model-value","onUpdate:modelValue"]),u[0]||(u[0]=r.createTextVNode()),r.createElementVNode("label",{onClick:r.withModifiers(()=>l(p.value),["stop"])},r.toDisplayString(p.label),9,Ib)]))),128))],2))}}),Gb="_component_tupwt_1",zb={component:Gb},$b={};function Zb(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 Ub={$style:zb},Wb=Lt($b,[["render",Zb],["__cssModules",Ub]]),Hb={key:1,class:"pl-dialog-modal__title"},jb={inheritAttrs:!1},Sl=r.defineComponent({...jb,__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,s=t,l=r.ref(),c=r.useAttrs();function u(p){l.value&&s.closeOnOutsideClick&&document.contains(p.target)&&!l.value.contains(p.target)&&o("update:modelValue",!1)}return nt(document.body,"keyup",p=>{s.modelValue&&p.code==="Escape"&&o("update:modelValue",!1)}),(p,f)=>(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:u},[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(Wb,{key:0,class:"close-modal-btn",onClick:f[0]||(f[0]=r.withModifiers(m=>o("update:modelValue",!1),["stop"]))})):r.createCommentVNode("",!0),f[1]||(f[1]=r.createTextVNode()),r.unref(n).title?(r.openBlock(),r.createElementBlock("div",Hb,[r.renderSlot(p.$slots,"title")])):r.createCommentVNode("",!0),f[2]||(f[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),f[3]||(f[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})]))}}),qb=r.defineComponent({__name:"TransitionSlidePanel",setup(t){function e(){window.dispatchEvent(new CustomEvent("adjust"))}function n(){window.dispatchEvent(new CustomEvent("adjust"))}return(o,s)=>(r.openBlock(),r.createBlock(r.Transition,{name:"slide-panel",onAfterEnter:e,onAfterLeave:n},{default:r.withCtx(()=>[r.renderSlot(o.$slots,"default")]),_:3}))}}),Kb={key:0,class:"pl-slide-modal__title"},Yb={class:"pl-slide-modal__content"},Jb={key:1,class:"pl-slide-modal__actions"},Xb={name:"PlSlideModal",inheritAttrs:!1},ws=r.defineComponent({...Xb,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,s=t,l=r.ref(),c=r.useAttrs();return vs(l,()=>{s.modelValue&&s.closeOnOutsideClick&&o("update:modelValue",!1)}),nt(document,"keydown",u=>{u.key==="Escape"&&o("update:modelValue",!1)}),(u,p)=>(r.openBlock(),r.createBlock(r.Teleport,{to:"body"},[r.createVNode(qb,null,{default:r.withCtx(()=>[u.modelValue?(r.openBlock(),r.createElementBlock("div",r.mergeProps({key:0,ref_key:"modal",ref:l,style:{width:u.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(f=>o("update:modelValue",!1),["esc"]))}),[r.createElementVNode("div",{class:"close-dialog-btn",onClick:p[0]||(p[0]=f=>o("update:modelValue",!1))}),p[3]||(p[3]=r.createTextVNode()),r.unref(n).title?(r.openBlock(),r.createElementBlock("div",Kb,[r.renderSlot(u.$slots,"title")])):r.createCommentVNode("",!0),p[4]||(p[4]=r.createTextVNode()),r.createElementVNode("div",Yb,[r.renderSlot(u.$slots,"default")]),p[5]||(p[5]=r.createTextVNode()),r.unref(n).actions?(r.openBlock(),r.createElementBlock("div",Jb,[r.renderSlot(u.$slots,"actions")])):r.createCommentVNode("",!0)],16)):r.createCommentVNode("",!0)]),_:3}),p[6]||(p[6]=r.createTextVNode()),u.modelValue&&u.shadow?(r.openBlock(),r.createElementBlock("div",{key:0,class:"pl-slide-modal__shadow",onKeyup:p[2]||(p[2]=r.withKeys(f=>o("update:modelValue",!1),["esc"]))},null,32)):r.createCommentVNode("",!0)]))}}),Qb={key:0,class:"label"},ex={name:"PlToggleSwitch"},bs=r.defineComponent({...ex,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",Qb,r.toDisplayString(e.label),1)):r.createCommentVNode("",!0)],34))}});function $u(t){return r.getCurrentScope()?(r.onScopeDispose(t),!0):!1}function tx(t){return r.unref(t)}const nx=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;function rx(t,e,n={}){const{immediate:o=!0}=n,s=r.ref(!1);let l=null;function c(){l&&(clearTimeout(l),l=null)}function u(){s.value=!1,c()}function p(...f){c(),s.value=!0,l=setTimeout(()=>{s.value=!1,l=null,t(...f)},tx(e))}return o&&(s.value=!0,nx&&p()),$u(u),{isPending:r.readonly(s),start:p,stop:u}}function ox(t,e,n){return r.watch(t,(o,s,l)=>{o&&e(o,s,l)},{...n,once:!1})}function ix(t,e,n){const{start:o}=rx(l,e,{immediate:!1}),s=r.ref(!1);async function l(){s.value&&(await t(),o())}function c(){s.value||(s.value=!0,l())}function u(){s.value=!1}return n!=null&&n.immediate&&c(),$u(u),{isActive:s,pause:u,resume:c}}const sx="[==PROGRESS==]";function ax(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function lx(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 u=t.mockPlatforma??window.platforma;if(!u){console.warn("Platforma API is not available");return}for(;;){const p=await u.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 f=t.progressPrefix??sx,m=new TextDecoder().decode(p.data).replace(new RegExp(`${ax(f)}`,"g"),"");if(c=Object.assign(c,{lines:c.lines+m,lastOffset:p.newOffset,finished:!p.live}),p.newOffset>=p.size)break}}const s=ix(()=>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 ox(()=>{var l;return(l=e==null?void 0:e.value)==null?void 0:l.finished},()=>s.pause()),r.watch(()=>t.logHandle,l=>{var c;l===void 0?(e.value=void 0,s.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,s.resume())},{immediate:!0}),e}const cx={key:0},dx={class:"pl-log-view__copy"},ux={key:1,class:"pl-log-view__error"},px={name:"PlLogView"},Zu=r.defineComponent({...px,props:{value:{},logHandle:{},progressPrefix:{},error:{},output:{},maxRetries:{},mockPlatforma:{},label:{}},setup(t){const e=V=>{if(V&&V.ok===!1)return V.errors.join(`
53
- `)},n=t,o=lx(n),s=r.ref(!0),l=r.ref(),c=r.ref(),u=r.computed(()=>{var V;return((V=o.value)==null?void 0:V.error)??n.error??e(n.output)}),p=r.computed(()=>{var V;return((V=o.value)==null?void 0:V.lines)??n.value??Z_(n.output)}),f=r.ref(!1);zn(c);const m=r.computed(()=>f.value?"clipboard-copied":"clipboard"),_=()=>{f.value=!0,setTimeout(()=>{f.value=!1},1200),p.value&&typeof p.value=="string"&&navigator.clipboard.writeText(p.value)},x=()=>{Mr(l.value,V=>{s.value&&V.scrollTo(V.scrollLeft,V.scrollHeight)})};r.watch(p,()=>{requestAnimationFrame(()=>{x()})},{immediate:!0});const S=V=>{const I=V.target;s.value=I.scrollTop+20>=I.scrollHeight-I.offsetHeight};return(V,I)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"root",ref:c,class:r.normalizeClass(["pl-log-view",{"has-error":u.value}])},[V.label?(r.openBlock(),r.createElementBlock("label",cx,r.toDisplayString(V.label),1)):r.createCommentVNode("",!0),I[1]||(I[1]=r.createTextVNode()),r.createVNode(cr,{class:"pl-log-view__contour"}),I[2]||(I[2]=r.createTextVNode()),r.createElementVNode("div",dx,[r.createVNode(r.unref(Ct),{"close-delay":800,position:"top"},{tooltip:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(f.value?"copied":"copy"),1)]),default:r.withCtx(()=>[r.createVNode(r.unref(Dt),{title:"Copy content",name:m.value,onClick:_},null,8,["name"]),I[0]||(I[0]=r.createTextVNode())]),_:1})]),I[3]||(I[3]=r.createTextVNode()),u.value?(r.openBlock(),r.createElementBlock("div",ux,r.toDisplayString(u.value),1)):(r.openBlock(),r.createElementBlock("div",{key:2,ref_key:"contentRef",ref:l,class:"pl-log-view__content",onScroll:S},r.toDisplayString(p.value),545))],2))}}),hx="_component_1ukal_1",fx="_tab_1ukal_14",mx="_disabled_1ukal_27",gx="_active_1ukal_56",yx="_topLine_1ukal_69",mo={component:hx,tab:fx,disabled:mx,active:gx,topLine:yx},_x=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 s=o.$el.querySelector("span");s&&requestAnimationFrame(()=>{s.offsetWidth<s.scrollWidth&&(n.isOverflown=!0)})}),(o,s)=>(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"),s[0]||(s[0]=r.createTextVNode())]),_:3},8,["hide","data-is-overflown"]))}}),Cx={name:"PlTabs"},vx=r.defineComponent({...Cx,props:{modelValue:{},options:{},disabled:{type:Boolean},topLine:{type:Boolean},maxTabWidth:{}},emits:["update:modelValue"],setup(t,{emit:e}){const n=e,o=s=>n("update:modelValue",s);return(s,l)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass([r.unref(mo).component,{[r.unref(mo).disabled]:s.disabled,[r.unref(mo).topLine]:s.topLine}])},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(s.options,(c,u)=>(r.openBlock(),r.createBlock(_x,{key:u,tabindex:s.modelValue===c.value||s.disabled||c.disabled?void 0:0,option:c,class:r.normalizeClass([{[r.unref(mo).active]:s.modelValue===c.value,[r.unref(mo).disabled]:c.disabled},r.unref(mo).tab]),style:r.normalizeStyle({"--pl-tabs-item-max-width":c.maxWidth??s.maxTabWidth}),onKeydown:r.withKeys(p=>o(c.value),["enter"]),onClick:p=>o(c.value)},{default:r.withCtx(()=>[r.renderSlot(s.$slots,c.value,{option:c},()=>[r.createElementVNode("span",null,r.toDisplayString(c.label),1)])]),_:2},1032,["tabindex","option","class","style","onKeydown","onClick"]))),128))],2))}}),wx=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))}}),bx="_compact_rhd5u_16",xx="_content_rhd5u_20",kx={compact:bx,content:xx},Sx={$style:kx},Uu=Lt(wx,[["__cssModules",Sx]]),Ex=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,s)=>(r.openBlock(),r.createElementBlock(r.Fragment,null,[r.renderSlot(o.$slots,"header"),s[0]||(s[0]=r.createTextVNode()),r.renderSlot(o.$slots,"default")],64))}}),Tx=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,s)=>(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}))}}),Bx=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"),s=du(),l=r.computed(()=>!n||n.value.multiple),c=r.computed({get(){return l.value?o.value:e?e.value===s:o.value},set(u){l.value?o.value=u:e&&(e.value=e.value===s?"":s)}});return(u,p)=>(r.openBlock(),r.createElementBlock(r.Fragment,null,[r.createVNode(r.unref(Uu),{class:r.normalizeClass(u.$style.separator),compact:u.compact,onClick:p[0]||(p[0]=f=>c.value=!c.value)},{default:r.withCtx(()=>[r.createVNode(r.unref(cn),{name:"chevron-right",class:r.normalizeClass([{[u.$style.down]:c.value},u.$style.chevron])},null,8,["class"]),r.createTextVNode(" "+r.toDisplayString(u.label),1)]),_:1},8,["class","compact"]),p[1]||(p[1]=r.createTextVNode()),r.createVNode(Tx,null,{default:r.withCtx(()=>[c.value?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(u.$style.content)},[r.renderSlot(u.$slots,"default")],2)):r.createCommentVNode("",!0)]),_:3})],64))}}),Vx="_content_jmjfk_2",Nx="_separator_jmjfk_14",Ax="_chevron_jmjfk_19",Px="_down_jmjfk_23",Dx={content:Vx,separator:Nx,chevron:Ax,down:Px},Fx={$style:Dx},Rx=Lt(Bx,[["__cssModules",Fx]]),Mx="_component_1ietr_1",Ix="_local_1ietr_1",Ox="_supported_1ietr_26",Lx="_remote_1ietr_32",Gx="_search_1ietr_40",zx="_selected_1ietr_72",$x="_breadcrumbs_1ietr_86",Zx="_cat_1ietr_116",Ux="_message_1ietr_122",Wx="_isFile_1ietr_197",Hx="_isDir_1ietr_201",jx="_canBeSelected_1ietr_207",qx="_spin_1ietr_1",it={component:Mx,local:Ix,supported:Ox,remote:Lx,search:Gx,"ls-container":"_ls-container_1ietr_50","ls-head":"_ls-head_1ietr_57",selected:zx,breadcrumbs:$x,"ls-error":"_ls-error_1ietr_108",cat:Zx,message:Ux,"ls-empty":"_ls-empty_1ietr_131","ls-body":"_ls-body_1ietr_152",isFile:Wx,isDir:Hx,canBeSelected:jx,"ls-loader":"_ls-loader_1ietr_213","loader-icon":"_loader-icon_1ietr_221",spin:qx};function Wu(t){return t?t.map(e=>"."+H_(e,["."])):void 0}function Kx(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(s=>s!=="").join("/")});return n}const Hu=()=>({dirPath:"",search:"",storageEntry:void 0,items:[],error:"",storageOptions:[],selected:[],lastSelected:void 0,currentLoadingPath:void 0,showHiddenItems:!1});function Yx(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 ju={mounted:t=>{if(t.clientWidth<t.scrollWidth){const e=t.innerText;t.innerText=e.substring(0,57)+"..."+e.substring(e.length-10)}}},Jx=["title","onClick"],Xx={key:0,class:"ls-loader"},Qx=["onClick"],ek=["title"],tk=["onClick"],nk=["title"],rk=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=t,o=r.reactive(Hu()),s=()=>{o.search="",o.error="",o.lastSelected=void 0},l=r.computed(()=>Wu(n.extensions)),c=Yx(o),u=r.computed(()=>{var F;return{modelValue:n.modelValue,dirPath:o.dirPath,storageHandle:(F=o.storageEntry)==null?void 0:F.handle}}),p=(F,T)=>{window.platforma&&o.currentLoadingPath!==T&&(o.currentLoadingPath=T,window.platforma.lsDriver.listFiles(F,T).then($=>{T===o.dirPath&&(o.items=ms($).entries.map(U=>({path:U.fullPath,name:U.name,isDir:U.type==="dir",canBeSelected:U.type==="file"&&(!l.value||l.value.some(O=>U.fullPath.endsWith(O))),handle:U.type==="file"?U.handle:void 0,selected:!1})).sort((U,O)=>U.isDir&&!O.isDir?-1:!U.isDir&&O.isDir?1:U.name.localeCompare(O.name)).map((U,O)=>({id:O,...U})),o.lastSelected=void 0)}).catch($=>o.error=String($)).finally(()=>{o.currentLoadingPath=void 0}))},f=()=>{s();const{storageHandle:F,dirPath:T,modelValue:$}=u.value;F&&$&&p(F,T)},m=r.computed(()=>Kx(o.dirPath)),_=r.computed(()=>o.items.filter(F=>F.canBeSelected&&F.selected&&!F.isDir)),x=r.computed(()=>{var F;return _.value.length>0&&((F=o.storageEntry)==null?void 0:F.handle)}),S=()=>{var F;return{storageHandle:ms((F=o.storageEntry)==null?void 0:F.handle),files:_.value.map(T=>T.handle)}},V=F=>{o.dirPath=F},I=(F,T)=>{const{shiftKey:$,metaKey:U}=F,{lastSelected:O}=o;if(F.preventDefault(),T.canBeSelected){if(n.multi||o.items.forEach(Z=>Z.selected=!1),T.selected=!0,!n.multi)return;!U&&!$&&o.items.forEach(Z=>{Z.id!==T.id&&(Z.selected=!1)}),$&&O!==void 0&&o.items.forEach(Z=>{G_(Z.id,O,T.id)&&(Z.selected=!0)}),T.selected&&(o.lastSelected=T.id)}},G=F=>{F&&!n.multi||o.items.filter(T=>T.canBeSelected).forEach(T=>{T.selected=F})},v=()=>G(!0),R=()=>G(!1),L=()=>{if(s(),R(),!window.platforma){console.warn("platforma API is not found");return}window.platforma.lsDriver.getStorageList().then(F=>{o.storageOptions=F.map(T=>({text:T.name,value:T})),n.autoSelectStorage&&Mr(F.find(T=>T.name==="local"||T.name.startsWith("local_disk_")&&T.initialFullPath.length>4),T=>{o.storageEntry=T})}).catch(F=>o.error=String(F))};return r.watch(r.toRef(o,"storageEntry"),F=>{s(),o.dirPath=(F==null?void 0:F.initialFullPath)??""},{immediate:!0}),r.watch([()=>o.dirPath,()=>o.storageEntry],()=>{f()}),r.watch(()=>n.modelValue,F=>{F?L():Object.assign(o,Hu())},{immediate:!0}),nt(document,"keydown",F=>{n.modelValue&&F.target===document.body&&(F.metaKey&&F.code==="KeyA"&&(F.preventDefault(),v()),F.metaKey&&F.shiftKey&&F.code==="Period"&&(F.preventDefault(),o.showHiddenItems=!o.showHiddenItems),F.code==="Enter"&&n.submit())}),e({isReady:x,getFilesToImport:S}),r.onMounted(L),(F,T)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(r.unref(it).remote),onClick:r.withModifiers(R,["stop"])},[r.createElementVNode("div",{class:r.normalizeClass(r.unref(it).search)},[r.createElementVNode("div",null,[r.createVNode(r.unref(fo),{modelValue:o.storageEntry,"onUpdate:modelValue":T[0]||(T[0]=$=>o.storageEntry=$),label:"Select storage",options:o.storageOptions},null,8,["modelValue","options"])]),T[2]||(T[2]=r.createTextVNode()),r.createElementVNode("div",null,[r.createVNode(r.unref(Iu),{modelValue:o.search,"onUpdate:modelValue":T[1]||(T[1]=$=>o.search=$),label:"Search in folder",clearable:""},null,8,["modelValue"])])],2),T[12]||(T[12]=r.createTextVNode()),r.createElementVNode("div",{class:r.normalizeClass(r.unref(it)["ls-container"])},[r.createElementVNode("div",{class:r.normalizeClass(r.unref(it)["ls-head"])},[r.createElementVNode("div",{class:r.normalizeClass(r.unref(it).breadcrumbs)},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(m.value,($,U)=>(r.openBlock(),r.createElementBlock(r.Fragment,{key:U},[r.createElementVNode("div",{title:$.path,onClick:O=>V($.path)},r.toDisplayString($.name),9,Jx),T[3]||(T[3]=r.createTextVNode()),$.index!==m.value.length-1?(r.openBlock(),r.createBlock(r.unref(ho),{key:0,name:"chevron-right"})):r.createCommentVNode("",!0)],64))),128))],2),T[4]||(T[4]=r.createTextVNode()),r.createElementVNode("div",{class:r.normalizeClass(r.unref(it).selected)},"Selected: "+r.toDisplayString(_.value.length),3)],2),T[11]||(T[11]=r.createTextVNode()),o.currentLoadingPath!==void 0?(r.openBlock(),r.createElementBlock("div",Xx,T[5]||(T[5]=[r.createElementVNode("i",{class:"mask-24 mask-loading loader-icon"},null,-1)]))):o.storageEntry?o.error?(r.openBlock(),r.createElementBlock("div",{key:2,class:r.normalizeClass(r.unref(it)["ls-error"])},[r.createElementVNode("div",{class:r.normalizeClass(r.unref(it).cat)},null,2),T[7]||(T[7]=r.createTextVNode()),r.createElementVNode("div",{class:r.normalizeClass(r.unref(it).message)},r.toDisplayString(o.error),3)],2)):(r.openBlock(),r.createElementBlock("div",{key:3,class:r.normalizeClass(r.unref(it)["ls-body"])},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(c),$=>(r.openBlock(),r.createElementBlock(r.Fragment,{key:$.id},[$.isDir?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(r.unref(it).isDir),onClick:U=>V($.path)},[T[8]||(T[8]=r.createElementVNode("i",{class:"icon-16 icon-chevron-right"},null,-1)),T[9]||(T[9]=r.createTextVNode()),r.withDirectives((r.openBlock(),r.createElementBlock("span",{title:$.name},[r.createTextVNode(r.toDisplayString($.name),1)],8,ek)),[[r.unref(ju)]])],10,Qx)):(r.openBlock(),r.createElementBlock("div",{key:1,class:r.normalizeClass({[r.unref(it).canBeSelected]:$.canBeSelected,[r.unref(it).selected]:$.selected}),onClick:r.withModifiers(U=>I(U,$),["stop"])},[r.createElementVNode("i",{class:r.normalizeClass(["mask-16 mask-box",r.unref(it).isFile])},null,2),T[10]||(T[10]=r.createTextVNode()),r.withDirectives((r.openBlock(),r.createElementBlock("span",{title:$.name},[r.createTextVNode(r.toDisplayString($.name),1)],8,nk)),[[r.unref(ju)]])],10,tk))],64))),128))],2)):(r.openBlock(),r.createElementBlock("div",{key:1,class:r.normalizeClass(r.unref(it)["ls-empty"])},[r.createElementVNode("div",{class:r.normalizeClass(r.unref(it).cat)},null,2),T[6]||(T[6]=r.createTextVNode()),r.createElementVNode("div",{class:r.normalizeClass(r.unref(it).message)},"Select storage to preview",2)],2))],2)],2))}}),ok={key:1,class:"alert-error"},ik=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"),s=async c=>{var u,p,f;const m=(p=(u=window.platforma)==null?void 0:u.lsDriver)==null?void 0:p.fileToImportHandle;if(!m)return console.error("API platforma.lsDriver.fileToImportHandle is not available");const _=Wu(e.extensions),x=await Promise.all([...((f=c.dataTransfer)==null?void 0:f.files)??[]].filter(S=>!!S).filter(S=>_?_.some(V=>S.name.endsWith(V)):!0).map(S=>m(S)));x.length&&e.importFiles({files:x})},l=async()=>{var c,u;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:f})=>{f&&e.importFiles({files:f})}).catch(f=>n.error=f):(u=window.platforma)==null||u.lsDriver.showOpenSingleFileDialog({title:"Select file to import",filters:p}).then(({file:f})=>{f&&e.importFiles({files:[f]})}).catch(f=>n.error=f)};return(c,u)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(r.unref(it).local),onDrop:s,onDragover:u[0]||(u[0]=r.withModifiers(()=>{},["prevent"])),onClick:l},[r.createVNode(r.unref(pi),{name:"cloud-upload"}),u[1]||(u[1]=r.createTextVNode()),r.createElementVNode("span",null,r.toDisplayString(o.value),1),u[2]||(u[2]=r.createTextVNode()),c.extensions?(r.openBlock(),r.createElementBlock("span",{key:0,class:r.normalizeClass(r.unref(it).supported)},"Supported formats: "+r.toDisplayString(c.extensions.join(", ")),3)):r.createCommentVNode("",!0),u[3]||(u[3]=r.createTextVNode()),n.error?(r.openBlock(),r.createElementBlock("span",ok,r.toDisplayString(n.error),1)):r.createCommentVNode("",!0)],34))}}),sk={style:{margin:"0 24px"}},qu=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,s=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"}],u=()=>n("update:modelValue",!1),p=r.useTemplateRef("remote"),f=()=>{var _,x;(_=p.value)!=null&&_.isReady&&(n("import:files",ms((x=p.value)==null?void 0:x.getFilesToImport())),u())},m=_=>{n("import:files",_),u()};return(_,x)=>(r.openBlock(),r.createBlock(r.unref(Sl),{"no-content-gutters":!0,"close-on-outside-click":_.closeOnOutsideClick,class:r.normalizeClass(["pl-dialog-modal",r.unref(it).component]),"model-value":_.modelValue,width:"688px",height:"720px","onUpdate:modelValue":u},r.createSlots({title:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(_.title??l.value),1)]),default:r.withCtx(()=>[x[4]||(x[4]=r.createTextVNode()),r.createElementVNode("div",sk,[r.createVNode(r.unref(Au),{modelValue:s.value,"onUpdate:modelValue":x[0]||(x[0]=S=>s.value=S),options:c},null,8,["modelValue"])]),x[5]||(x[5]=r.createTextVNode()),s.value==="remote"?(r.openBlock(),r.createBlock(rk,r.mergeProps({key:0,ref:"remote"},_.$props,{submit:f}),null,16)):r.createCommentVNode("",!0),x[6]||(x[6]=r.createTextVNode()),s.value==="local"?(r.openBlock(),r.createBlock(ik,r.mergeProps({key:1,"import-files":m},_.$props),null,16)):r.createCommentVNode("",!0),x[7]||(x[7]=r.createTextVNode())]),_:2},[s.value==="remote"?{name:"actions",fn:r.withCtx(()=>{var S;return[r.createVNode(r.unref(Cs),{style:{"min-width":"160px"},disabled:!((S=r.unref(p))!=null&&S.isReady),onClick:r.withModifiers(f,["stop"])},{default:r.withCtx(()=>x[1]||(x[1]=[r.createTextVNode("Import")])),_:1},8,["disabled"]),x[3]||(x[3]=r.createTextVNode()),r.createVNode(r.unref(po),{"justify-center":!1,onClick:r.withModifiers(u,["stop"])},{default:r.withCtx(()=>x[2]||(x[2]=[r.createTextVNode("Cancel")])),_:1})]}),key:"0"}:void 0]),1032,["close-on-outside-click","class","model-value"]))}});var Oe;(function(t){t.assertEqual=s=>s;function e(s){}t.assertIs=e;function n(s){throw new Error}t.assertNever=n,t.arrayToEnum=s=>{const l={};for(const c of s)l[c]=c;return l},t.getValidEnumValues=s=>{const l=t.objectKeys(s).filter(u=>typeof s[s[u]]!="number"),c={};for(const u of l)c[u]=s[u];return t.objectValues(c)},t.objectValues=s=>t.objectKeys(s).map(function(l){return s[l]}),t.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const l=[];for(const c in s)Object.prototype.hasOwnProperty.call(s,c)&&l.push(c);return l},t.find=(s,l)=>{for(const c of s)if(l(c))return c},t.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&isFinite(s)&&Math.floor(s)===s;function o(s,l=" | "){return s.map(c=>typeof c=="string"?`'${c}'`:c).join(l)}t.joinValues=o,t.jsonStringifyReplacer=(s,l)=>typeof l=="bigint"?l.toString():l})(Oe||(Oe={}));var El;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(El||(El={}));const se=Oe.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),dr=t=>{switch(typeof t){case"undefined":return se.undefined;case"string":return se.string;case"number":return isNaN(t)?se.nan:se.number;case"boolean":return se.boolean;case"function":return se.function;case"bigint":return se.bigint;case"symbol":return se.symbol;case"object":return Array.isArray(t)?se.array:t===null?se.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?se.promise:typeof Map<"u"&&t instanceof Map?se.map:typeof Set<"u"&&t instanceof Set?se.set:typeof Date<"u"&&t instanceof Date?se.date:se.object;default:return se.unknown}},Q=Oe.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"]),ak=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:");class Gt 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:[]},s=l=>{for(const c of l.issues)if(c.code==="invalid_union")c.unionErrors.map(s);else if(c.code==="invalid_return_type")s(c.returnTypeError);else if(c.code==="invalid_arguments")s(c.argumentsError);else if(c.path.length===0)o._errors.push(n(c));else{let u=o,p=0;for(;p<c.path.length;){const f=c.path[p];p===c.path.length-1?(u[f]=u[f]||{_errors:[]},u[f]._errors.push(n(c))):u[f]=u[f]||{_errors:[]},u=u[f],p++}}};return s(this),o}static assert(e){if(!(e instanceof Gt))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Oe.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){const n={},o=[];for(const s of this.issues)s.path.length>0?(n[s.path[0]]=n[s.path[0]]||[],n[s.path[0]].push(e(s))):o.push(e(s));return{formErrors:o,fieldErrors:n}}get formErrors(){return this.flatten()}}Gt.create=t=>new Gt(t);const go=(t,e)=>{let n;switch(t.code){case Q.invalid_type:t.received===se.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case Q.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,Oe.jsonStringifyReplacer)}`;break;case Q.unrecognized_keys:n=`Unrecognized key(s) in object: ${Oe.joinValues(t.keys,", ")}`;break;case Q.invalid_union:n="Invalid input";break;case Q.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Oe.joinValues(t.options)}`;break;case Q.invalid_enum_value:n=`Invalid enum value. Expected ${Oe.joinValues(t.options)}, received '${t.received}'`;break;case Q.invalid_arguments:n="Invalid function arguments";break;case Q.invalid_return_type:n="Invalid function return type";break;case Q.invalid_date:n="Invalid date";break;case Q.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}"`:Oe.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case Q.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 Q.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 Q.custom:n="Invalid input";break;case Q.invalid_intersection_types:n="Intersection results could not be merged";break;case Q.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case Q.not_finite:n="Number must be finite";break;default:n=e.defaultError,Oe.assertNever(t)}return{message:n}};let Ku=go;function lk(t){Ku=t}function xs(){return Ku}const ks=t=>{const{data:e,path:n,errorMaps:o,issueData:s}=t,l=[...n,...s.path||[]],c={...s,path:l};if(s.message!==void 0)return{...s,path:l,message:s.message};let u="";const p=o.filter(f=>!!f).slice().reverse();for(const f of p)u=f(c,{data:e,defaultError:u}).message;return{...s,path:l,message:u}},ck=[];function re(t,e){const n=xs(),o=ks({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===go?void 0:go].filter(s=>!!s)});t.common.issues.push(o)}class vt{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 s of n){if(s.status==="aborted")return we;s.status==="dirty"&&e.dirty(),o.push(s.value)}return{status:e.value,value:o}}static async mergeObjectAsync(e,n){const o=[];for(const s of n){const l=await s.key,c=await s.value;o.push({key:l,value:c})}return vt.mergeObjectSync(e,o)}static mergeObjectSync(e,n){const o={};for(const s of n){const{key:l,value:c}=s;if(l.status==="aborted"||c.status==="aborted")return we;l.status==="dirty"&&e.dirty(),c.status==="dirty"&&e.dirty(),l.value!=="__proto__"&&(typeof c.value<"u"||s.alwaysSet)&&(o[l.value]=c.value)}return{status:e.value,value:o}}}const we=Object.freeze({status:"aborted"}),Ss=t=>({status:"dirty",value:t}),Et=t=>({status:"valid",value:t}),Tl=t=>t.status==="aborted",Bl=t=>t.status==="dirty",fi=t=>t.status==="valid",mi=t=>typeof Promise<"u"&&t instanceof Promise;function Es(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 Yu(t,e,n,o,s){if(typeof e=="function"?t!==e||!s:!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 pe;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(pe||(pe={}));var gi,yi;class Pn{constructor(e,n,o,s){this._cachedPath=[],this.parent=e,this.data=n,this._path=o,this._key=s}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 Ju=(t,e)=>{if(fi(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 Gt(t.common.issues);return this._error=n,this._error}}};function Ee(t){if(!t)return{};const{errorMap:e,invalid_type_error:n,required_error:o,description:s}=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:s}:{errorMap:(l,c)=>{var u,p;const{message:f}=t;return l.code==="invalid_enum_value"?{message:f??c.defaultError}:typeof c.data>"u"?{message:(u=f??o)!==null&&u!==void 0?u:c.defaultError}:l.code!=="invalid_type"?{message:c.defaultError}:{message:(p=f??n)!==null&&p!==void 0?p:c.defaultError}},description:s}}class Ve{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 dr(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:dr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new vt,ctx:{common:e.parent.common,data:e.data,parsedType:dr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const n=this._parse(e);if(mi(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 s={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:dr(e)},l=this._parseSync({data:e,path:s.path,parent:s});return Ju(s,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:dr(e)},s=this._parse({data:e,path:o.path,parent:o}),l=await(mi(s)?s:Promise.resolve(s));return Ju(o,l)}refine(e,n){const o=s=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(s):n;return this._refinement((s,l)=>{const c=e(s),u=()=>l.addIssue({code:Q.custom,...o(s)});return typeof Promise<"u"&&c instanceof Promise?c.then(p=>p?!0:(u(),!1)):c?!0:(u(),!1)})}refinement(e,n){return this._refinement((o,s)=>e(o)?!0:(s.addIssue(typeof n=="function"?n(o,s):n),!1))}_refinement(e){return new pn({schema:this,typeName:Ce.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return Fn.create(this,this._def)}nullable(){return mr.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return un.create(this,this._def)}promise(){return vo.create(this,this._def)}or(e){return wi.create([this,e],this._def)}and(e){return bi.create(this,e,this._def)}transform(e){return new pn({...Ee(this._def),schema:this,typeName:Ce.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new Ti({...Ee(this._def),innerType:this,defaultValue:n,typeName:Ce.ZodDefault})}brand(){return new Al({typeName:Ce.ZodBranded,type:this,...Ee(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new Bi({...Ee(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 Vi.create(this,e)}readonly(){return Ni.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const dk=/^c[^\s-]{8,}$/i,uk=/^[0-9a-z]+$/,pk=/^[0-9A-HJKMNP-TV-Z]{26}$/,hk=/^[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,fk=/^[a-z0-9_-]{21}$/i,mk=/^[-+]?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)?)??$/,gk=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,yk="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Vl;const _k=/^(?:(?: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])$/,Ck=/^(([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})))$/,vk=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Xu="((\\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])))",wk=new RegExp(`^${Xu}$`);function Qu(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 bk(t){return new RegExp(`^${Qu(t)}$`)}function ep(t){let e=`${Xu}T${Qu(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 xk(t,e){return!!((e==="v4"||!e)&&_k.test(t)||(e==="v6"||!e)&&Ck.test(t))}class dn extends Ve{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==se.string){const s=this._getOrReturnCtx(e);return re(s,{code:Q.invalid_type,expected:se.string,received:s.parsedType}),we}const n=new vt;let o;for(const s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(o=this._getOrReturnCtx(e,o),re(o,{code:Q.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="max")e.data.length>s.value&&(o=this._getOrReturnCtx(e,o),re(o,{code:Q.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="length"){const l=e.data.length>s.value,c=e.data.length<s.value;(l||c)&&(o=this._getOrReturnCtx(e,o),l?re(o,{code:Q.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):c&&re(o,{code:Q.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),n.dirty())}else if(s.kind==="email")gk.test(e.data)||(o=this._getOrReturnCtx(e,o),re(o,{validation:"email",code:Q.invalid_string,message:s.message}),n.dirty());else if(s.kind==="emoji")Vl||(Vl=new RegExp(yk,"u")),Vl.test(e.data)||(o=this._getOrReturnCtx(e,o),re(o,{validation:"emoji",code:Q.invalid_string,message:s.message}),n.dirty());else if(s.kind==="uuid")hk.test(e.data)||(o=this._getOrReturnCtx(e,o),re(o,{validation:"uuid",code:Q.invalid_string,message:s.message}),n.dirty());else if(s.kind==="nanoid")fk.test(e.data)||(o=this._getOrReturnCtx(e,o),re(o,{validation:"nanoid",code:Q.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid")dk.test(e.data)||(o=this._getOrReturnCtx(e,o),re(o,{validation:"cuid",code:Q.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid2")uk.test(e.data)||(o=this._getOrReturnCtx(e,o),re(o,{validation:"cuid2",code:Q.invalid_string,message:s.message}),n.dirty());else if(s.kind==="ulid")pk.test(e.data)||(o=this._getOrReturnCtx(e,o),re(o,{validation:"ulid",code:Q.invalid_string,message:s.message}),n.dirty());else if(s.kind==="url")try{new URL(e.data)}catch{o=this._getOrReturnCtx(e,o),re(o,{validation:"url",code:Q.invalid_string,message:s.message}),n.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(e.data)||(o=this._getOrReturnCtx(e,o),re(o,{validation:"regex",code:Q.invalid_string,message:s.message}),n.dirty())):s.kind==="trim"?e.data=e.data.trim():s.kind==="includes"?e.data.includes(s.value,s.position)||(o=this._getOrReturnCtx(e,o),re(o,{code:Q.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),n.dirty()):s.kind==="toLowerCase"?e.data=e.data.toLowerCase():s.kind==="toUpperCase"?e.data=e.data.toUpperCase():s.kind==="startsWith"?e.data.startsWith(s.value)||(o=this._getOrReturnCtx(e,o),re(o,{code:Q.invalid_string,validation:{startsWith:s.value},message:s.message}),n.dirty()):s.kind==="endsWith"?e.data.endsWith(s.value)||(o=this._getOrReturnCtx(e,o),re(o,{code:Q.invalid_string,validation:{endsWith:s.value},message:s.message}),n.dirty()):s.kind==="datetime"?ep(s).test(e.data)||(o=this._getOrReturnCtx(e,o),re(o,{code:Q.invalid_string,validation:"datetime",message:s.message}),n.dirty()):s.kind==="date"?wk.test(e.data)||(o=this._getOrReturnCtx(e,o),re(o,{code:Q.invalid_string,validation:"date",message:s.message}),n.dirty()):s.kind==="time"?bk(s).test(e.data)||(o=this._getOrReturnCtx(e,o),re(o,{code:Q.invalid_string,validation:"time",message:s.message}),n.dirty()):s.kind==="duration"?mk.test(e.data)||(o=this._getOrReturnCtx(e,o),re(o,{validation:"duration",code:Q.invalid_string,message:s.message}),n.dirty()):s.kind==="ip"?xk(e.data,s.version)||(o=this._getOrReturnCtx(e,o),re(o,{validation:"ip",code:Q.invalid_string,message:s.message}),n.dirty()):s.kind==="base64"?vk.test(e.data)||(o=this._getOrReturnCtx(e,o),re(o,{validation:"base64",code:Q.invalid_string,message:s.message}),n.dirty()):Oe.assertNever(s);return{status:n.value,value:e.data}}_regex(e,n,o){return this.refinement(s=>e.test(s),{validation:n,code:Q.invalid_string,...pe.errToObj(o)})}_addCheck(e){return new dn({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...pe.errToObj(e)})}url(e){return this._addCheck({kind:"url",...pe.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...pe.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...pe.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...pe.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...pe.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...pe.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...pe.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...pe.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...pe.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,...pe.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,...pe.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...pe.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...pe.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n==null?void 0:n.position,...pe.errToObj(n==null?void 0:n.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...pe.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...pe.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...pe.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...pe.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...pe.errToObj(n)})}nonempty(e){return this.min(1,pe.errToObj(e))}trim(){return new dn({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new dn({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new dn({...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}}dn.create=t=>{var e;return new dn({checks:[],typeName:Ce.ZodString,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...Ee(t)})};function kk(t,e){const n=(t.toString().split(".")[1]||"").length,o=(e.toString().split(".")[1]||"").length,s=n>o?n:o,l=parseInt(t.toFixed(s).replace(".","")),c=parseInt(e.toFixed(s).replace(".",""));return l%c/Math.pow(10,s)}class ur extends Ve{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)!==se.number){const s=this._getOrReturnCtx(e);return re(s,{code:Q.invalid_type,expected:se.number,received:s.parsedType}),we}let n;const o=new vt;for(const s of this._def.checks)s.kind==="int"?Oe.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),re(n,{code:Q.invalid_type,expected:"integer",received:"float",message:s.message}),o.dirty()):s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(n=this._getOrReturnCtx(e,n),re(n,{code:Q.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),o.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(n=this._getOrReturnCtx(e,n),re(n,{code:Q.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),o.dirty()):s.kind==="multipleOf"?kk(e.data,s.value)!==0&&(n=this._getOrReturnCtx(e,n),re(n,{code:Q.not_multiple_of,multipleOf:s.value,message:s.message}),o.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),re(n,{code:Q.not_finite,message:s.message}),o.dirty()):Oe.assertNever(s);return{status:o.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,pe.toString(n))}gt(e,n){return this.setLimit("min",e,!1,pe.toString(n))}lte(e,n){return this.setLimit("max",e,!0,pe.toString(n))}lt(e,n){return this.setLimit("max",e,!1,pe.toString(n))}setLimit(e,n,o,s){return new ur({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:o,message:pe.toString(s)}]})}_addCheck(e){return new ur({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:pe.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:pe.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:pe.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:pe.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:pe.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:pe.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:pe.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:pe.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:pe.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"&&Oe.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)}}ur.create=t=>new ur({checks:[],typeName:Ce.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...Ee(t)});class pr extends Ve{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)!==se.bigint){const s=this._getOrReturnCtx(e);return re(s,{code:Q.invalid_type,expected:se.bigint,received:s.parsedType}),we}let n;const o=new vt;for(const s of this._def.checks)s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(n=this._getOrReturnCtx(e,n),re(n,{code:Q.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),o.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(n=this._getOrReturnCtx(e,n),re(n,{code:Q.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),o.dirty()):s.kind==="multipleOf"?e.data%s.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),re(n,{code:Q.not_multiple_of,multipleOf:s.value,message:s.message}),o.dirty()):Oe.assertNever(s);return{status:o.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,pe.toString(n))}gt(e,n){return this.setLimit("min",e,!1,pe.toString(n))}lte(e,n){return this.setLimit("max",e,!0,pe.toString(n))}lt(e,n){return this.setLimit("max",e,!1,pe.toString(n))}setLimit(e,n,o,s){return new pr({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:o,message:pe.toString(s)}]})}_addCheck(e){return new pr({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:pe.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:pe.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:pe.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:pe.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:pe.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}}pr.create=t=>{var e;return new pr({checks:[],typeName:Ce.ZodBigInt,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...Ee(t)})};class _i extends Ve{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==se.boolean){const n=this._getOrReturnCtx(e);return re(n,{code:Q.invalid_type,expected:se.boolean,received:n.parsedType}),we}return Et(e.data)}}_i.create=t=>new _i({typeName:Ce.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...Ee(t)});class Or extends Ve{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==se.date){const s=this._getOrReturnCtx(e);return re(s,{code:Q.invalid_type,expected:se.date,received:s.parsedType}),we}if(isNaN(e.data.getTime())){const s=this._getOrReturnCtx(e);return re(s,{code:Q.invalid_date}),we}const n=new vt;let o;for(const s of this._def.checks)s.kind==="min"?e.data.getTime()<s.value&&(o=this._getOrReturnCtx(e,o),re(o,{code:Q.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),n.dirty()):s.kind==="max"?e.data.getTime()>s.value&&(o=this._getOrReturnCtx(e,o),re(o,{code:Q.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),n.dirty()):Oe.assertNever(s);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Or({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:pe.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:pe.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}}Or.create=t=>new Or({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:Ce.ZodDate,...Ee(t)});class Ts extends Ve{_parse(e){if(this._getType(e)!==se.symbol){const n=this._getOrReturnCtx(e);return re(n,{code:Q.invalid_type,expected:se.symbol,received:n.parsedType}),we}return Et(e.data)}}Ts.create=t=>new Ts({typeName:Ce.ZodSymbol,...Ee(t)});class Ci extends Ve{_parse(e){if(this._getType(e)!==se.undefined){const n=this._getOrReturnCtx(e);return re(n,{code:Q.invalid_type,expected:se.undefined,received:n.parsedType}),we}return Et(e.data)}}Ci.create=t=>new Ci({typeName:Ce.ZodUndefined,...Ee(t)});class vi extends Ve{_parse(e){if(this._getType(e)!==se.null){const n=this._getOrReturnCtx(e);return re(n,{code:Q.invalid_type,expected:se.null,received:n.parsedType}),we}return Et(e.data)}}vi.create=t=>new vi({typeName:Ce.ZodNull,...Ee(t)});class yo extends Ve{constructor(){super(...arguments),this._any=!0}_parse(e){return Et(e.data)}}yo.create=t=>new yo({typeName:Ce.ZodAny,...Ee(t)});class Lr extends Ve{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Et(e.data)}}Lr.create=t=>new Lr({typeName:Ce.ZodUnknown,...Ee(t)});class $n extends Ve{_parse(e){const n=this._getOrReturnCtx(e);return re(n,{code:Q.invalid_type,expected:se.never,received:n.parsedType}),we}}$n.create=t=>new $n({typeName:Ce.ZodNever,...Ee(t)});class Bs extends Ve{_parse(e){if(this._getType(e)!==se.undefined){const n=this._getOrReturnCtx(e);return re(n,{code:Q.invalid_type,expected:se.void,received:n.parsedType}),we}return Et(e.data)}}Bs.create=t=>new Bs({typeName:Ce.ZodVoid,...Ee(t)});class un extends Ve{_parse(e){const{ctx:n,status:o}=this._processInputParams(e),s=this._def;if(n.parsedType!==se.array)return re(n,{code:Q.invalid_type,expected:se.array,received:n.parsedType}),we;if(s.exactLength!==null){const c=n.data.length>s.exactLength.value,u=n.data.length<s.exactLength.value;(c||u)&&(re(n,{code:c?Q.too_big:Q.too_small,minimum:u?s.exactLength.value:void 0,maximum:c?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),o.dirty())}if(s.minLength!==null&&n.data.length<s.minLength.value&&(re(n,{code:Q.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),o.dirty()),s.maxLength!==null&&n.data.length>s.maxLength.value&&(re(n,{code:Q.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),o.dirty()),n.common.async)return Promise.all([...n.data].map((c,u)=>s.type._parseAsync(new Pn(n,c,n.path,u)))).then(c=>vt.mergeArray(o,c));const l=[...n.data].map((c,u)=>s.type._parseSync(new Pn(n,c,n.path,u)));return vt.mergeArray(o,l)}get element(){return this._def.type}min(e,n){return new un({...this._def,minLength:{value:e,message:pe.toString(n)}})}max(e,n){return new un({...this._def,maxLength:{value:e,message:pe.toString(n)}})}length(e,n){return new un({...this._def,exactLength:{value:e,message:pe.toString(n)}})}nonempty(e){return this.min(1,e)}}un.create=(t,e)=>new un({type:t,minLength:null,maxLength:null,exactLength:null,typeName:Ce.ZodArray,...Ee(e)});function _o(t){if(t instanceof Qe){const e={};for(const n in t.shape){const o=t.shape[n];e[n]=Fn.create(_o(o))}return new Qe({...t._def,shape:()=>e})}else return t instanceof un?new un({...t._def,type:_o(t.element)}):t instanceof Fn?Fn.create(_o(t.unwrap())):t instanceof mr?mr.create(_o(t.unwrap())):t instanceof Dn?Dn.create(t.items.map(e=>_o(e))):t}class Qe extends Ve{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=Oe.objectKeys(e);return this._cached={shape:e,keys:n}}_parse(e){if(this._getType(e)!==se.object){const p=this._getOrReturnCtx(e);return re(p,{code:Q.invalid_type,expected:se.object,received:p.parsedType}),we}const{status:n,ctx:o}=this._processInputParams(e),{shape:s,keys:l}=this._getCached(),c=[];if(!(this._def.catchall instanceof $n&&this._def.unknownKeys==="strip"))for(const p in o.data)l.includes(p)||c.push(p);const u=[];for(const p of l){const f=s[p],m=o.data[p];u.push({key:{status:"valid",value:p},value:f._parse(new Pn(o,m,o.path,p)),alwaysSet:p in o.data})}if(this._def.catchall instanceof $n){const p=this._def.unknownKeys;if(p==="passthrough")for(const f of c)u.push({key:{status:"valid",value:f},value:{status:"valid",value:o.data[f]}});else if(p==="strict")c.length>0&&(re(o,{code:Q.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 f of c){const m=o.data[f];u.push({key:{status:"valid",value:f},value:p._parse(new Pn(o,m,o.path,f)),alwaysSet:f in o.data})}}return o.common.async?Promise.resolve().then(async()=>{const p=[];for(const f of u){const m=await f.key,_=await f.value;p.push({key:m,value:_,alwaysSet:f.alwaysSet})}return p}).then(p=>vt.mergeObjectSync(n,p)):vt.mergeObjectSync(n,u)}get shape(){return this._def.shape()}strict(e){return pe.errToObj,new Qe({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,o)=>{var s,l,c,u;const p=(c=(l=(s=this._def).errorMap)===null||l===void 0?void 0:l.call(s,n,o).message)!==null&&c!==void 0?c:o.defaultError;return n.code==="unrecognized_keys"?{message:(u=pe.errToObj(e).message)!==null&&u!==void 0?u:p}:{message:p}}}:{}})}strip(){return new Qe({...this._def,unknownKeys:"strip"})}passthrough(){return new Qe({...this._def,unknownKeys:"passthrough"})}extend(e){return new Qe({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Qe({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 Qe({...this._def,catchall:e})}pick(e){const n={};return Oe.objectKeys(e).forEach(o=>{e[o]&&this.shape[o]&&(n[o]=this.shape[o])}),new Qe({...this._def,shape:()=>n})}omit(e){const n={};return Oe.objectKeys(this.shape).forEach(o=>{e[o]||(n[o]=this.shape[o])}),new Qe({...this._def,shape:()=>n})}deepPartial(){return _o(this)}partial(e){const n={};return Oe.objectKeys(this.shape).forEach(o=>{const s=this.shape[o];e&&!e[o]?n[o]=s:n[o]=s.optional()}),new Qe({...this._def,shape:()=>n})}required(e){const n={};return Oe.objectKeys(this.shape).forEach(o=>{if(e&&!e[o])n[o]=this.shape[o];else{let s=this.shape[o];for(;s instanceof Fn;)s=s._def.innerType;n[o]=s}}),new Qe({...this._def,shape:()=>n})}keyof(){return tp(Oe.objectKeys(this.shape))}}Qe.create=(t,e)=>new Qe({shape:()=>t,unknownKeys:"strip",catchall:$n.create(),typeName:Ce.ZodObject,...Ee(e)}),Qe.strictCreate=(t,e)=>new Qe({shape:()=>t,unknownKeys:"strict",catchall:$n.create(),typeName:Ce.ZodObject,...Ee(e)}),Qe.lazycreate=(t,e)=>new Qe({shape:t,unknownKeys:"strip",catchall:$n.create(),typeName:Ce.ZodObject,...Ee(e)});class wi extends Ve{_parse(e){const{ctx:n}=this._processInputParams(e),o=this._def.options;function s(l){for(const u of l)if(u.result.status==="valid")return u.result;for(const u of l)if(u.result.status==="dirty")return n.common.issues.push(...u.ctx.common.issues),u.result;const c=l.map(u=>new Gt(u.ctx.common.issues));return re(n,{code:Q.invalid_union,unionErrors:c}),we}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(s);{let l;const c=[];for(const p of o){const f={...n,common:{...n.common,issues:[]},parent:null},m=p._parseSync({data:n.data,path:n.path,parent:f});if(m.status==="valid")return m;m.status==="dirty"&&!l&&(l={result:m,ctx:f}),f.common.issues.length&&c.push(f.common.issues)}if(l)return n.common.issues.push(...l.ctx.common.issues),l.result;const u=c.map(p=>new Gt(p));return re(n,{code:Q.invalid_union,unionErrors:u}),we}}get options(){return this._def.options}}wi.create=(t,e)=>new wi({options:t,typeName:Ce.ZodUnion,...Ee(e)});const hr=t=>t instanceof ki?hr(t.schema):t instanceof pn?hr(t.innerType()):t instanceof Si?[t.value]:t instanceof fr?t.options:t instanceof Ei?Oe.objectValues(t.enum):t instanceof Ti?hr(t._def.innerType):t instanceof Ci?[void 0]:t instanceof vi?[null]:t instanceof Fn?[void 0,...hr(t.unwrap())]:t instanceof mr?[null,...hr(t.unwrap())]:t instanceof Al||t instanceof Ni?hr(t.unwrap()):t instanceof Bi?hr(t._def.innerType):[];class Vs extends Ve{_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==se.object)return re(n,{code:Q.invalid_type,expected:se.object,received:n.parsedType}),we;const o=this.discriminator,s=n.data[o],l=this.optionsMap.get(s);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}):(re(n,{code:Q.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[o]}),we)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,o){const s=new Map;for(const l of n){const c=hr(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 u of c){if(s.has(u))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(u)}`);s.set(u,l)}}return new Vs({typeName:Ce.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:s,...Ee(o)})}}function Nl(t,e){const n=dr(t),o=dr(e);if(t===e)return{valid:!0,data:t};if(n===se.object&&o===se.object){const s=Oe.objectKeys(e),l=Oe.objectKeys(t).filter(u=>s.indexOf(u)!==-1),c={...t,...e};for(const u of l){const p=Nl(t[u],e[u]);if(!p.valid)return{valid:!1};c[u]=p.data}return{valid:!0,data:c}}else if(n===se.array&&o===se.array){if(t.length!==e.length)return{valid:!1};const s=[];for(let l=0;l<t.length;l++){const c=t[l],u=e[l],p=Nl(c,u);if(!p.valid)return{valid:!1};s.push(p.data)}return{valid:!0,data:s}}else return n===se.date&&o===se.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class bi extends Ve{_parse(e){const{status:n,ctx:o}=this._processInputParams(e),s=(l,c)=>{if(Tl(l)||Tl(c))return we;const u=Nl(l.value,c.value);return u.valid?((Bl(l)||Bl(c))&&n.dirty(),{status:n.value,value:u.data}):(re(o,{code:Q.invalid_intersection_types}),we)};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])=>s(l,c)):s(this._def.left._parseSync({data:o.data,path:o.path,parent:o}),this._def.right._parseSync({data:o.data,path:o.path,parent:o}))}}bi.create=(t,e,n)=>new bi({left:t,right:e,typeName:Ce.ZodIntersection,...Ee(n)});class Dn extends Ve{_parse(e){const{status:n,ctx:o}=this._processInputParams(e);if(o.parsedType!==se.array)return re(o,{code:Q.invalid_type,expected:se.array,received:o.parsedType}),we;if(o.data.length<this._def.items.length)return re(o,{code:Q.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),we;!this._def.rest&&o.data.length>this._def.items.length&&(re(o,{code:Q.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const s=[...o.data].map((l,c)=>{const u=this._def.items[c]||this._def.rest;return u?u._parse(new Pn(o,l,o.path,c)):null}).filter(l=>!!l);return o.common.async?Promise.all(s).then(l=>vt.mergeArray(n,l)):vt.mergeArray(n,s)}get items(){return this._def.items}rest(e){return new Dn({...this._def,rest:e})}}Dn.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Dn({items:t,typeName:Ce.ZodTuple,rest:null,...Ee(e)})};class xi extends Ve{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!==se.object)return re(o,{code:Q.invalid_type,expected:se.object,received:o.parsedType}),we;const s=[],l=this._def.keyType,c=this._def.valueType;for(const u in o.data)s.push({key:l._parse(new Pn(o,u,o.path,u)),value:c._parse(new Pn(o,o.data[u],o.path,u)),alwaysSet:u in o.data});return o.common.async?vt.mergeObjectAsync(n,s):vt.mergeObjectSync(n,s)}get element(){return this._def.valueType}static create(e,n,o){return n instanceof Ve?new xi({keyType:e,valueType:n,typeName:Ce.ZodRecord,...Ee(o)}):new xi({keyType:dn.create(),valueType:e,typeName:Ce.ZodRecord,...Ee(n)})}}class Ns extends Ve{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!==se.map)return re(o,{code:Q.invalid_type,expected:se.map,received:o.parsedType}),we;const s=this._def.keyType,l=this._def.valueType,c=[...o.data.entries()].map(([u,p],f)=>({key:s._parse(new Pn(o,u,o.path,[f,"key"])),value:l._parse(new Pn(o,p,o.path,[f,"value"]))}));if(o.common.async){const u=new Map;return Promise.resolve().then(async()=>{for(const p of c){const f=await p.key,m=await p.value;if(f.status==="aborted"||m.status==="aborted")return we;(f.status==="dirty"||m.status==="dirty")&&n.dirty(),u.set(f.value,m.value)}return{status:n.value,value:u}})}else{const u=new Map;for(const p of c){const f=p.key,m=p.value;if(f.status==="aborted"||m.status==="aborted")return we;(f.status==="dirty"||m.status==="dirty")&&n.dirty(),u.set(f.value,m.value)}return{status:n.value,value:u}}}}Ns.create=(t,e,n)=>new Ns({valueType:e,keyType:t,typeName:Ce.ZodMap,...Ee(n)});class Gr extends Ve{_parse(e){const{status:n,ctx:o}=this._processInputParams(e);if(o.parsedType!==se.set)return re(o,{code:Q.invalid_type,expected:se.set,received:o.parsedType}),we;const s=this._def;s.minSize!==null&&o.data.size<s.minSize.value&&(re(o,{code:Q.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),n.dirty()),s.maxSize!==null&&o.data.size>s.maxSize.value&&(re(o,{code:Q.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),n.dirty());const l=this._def.valueType;function c(p){const f=new Set;for(const m of p){if(m.status==="aborted")return we;m.status==="dirty"&&n.dirty(),f.add(m.value)}return{status:n.value,value:f}}const u=[...o.data.values()].map((p,f)=>l._parse(new Pn(o,p,o.path,f)));return o.common.async?Promise.all(u).then(p=>c(p)):c(u)}min(e,n){return new Gr({...this._def,minSize:{value:e,message:pe.toString(n)}})}max(e,n){return new Gr({...this._def,maxSize:{value:e,message:pe.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}}Gr.create=(t,e)=>new Gr({valueType:t,minSize:null,maxSize:null,typeName:Ce.ZodSet,...Ee(e)});class Co extends Ve{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==se.function)return re(n,{code:Q.invalid_type,expected:se.function,received:n.parsedType}),we;function o(u,p){return ks({data:u,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,xs(),go].filter(f=>!!f),issueData:{code:Q.invalid_arguments,argumentsError:p}})}function s(u,p){return ks({data:u,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,xs(),go].filter(f=>!!f),issueData:{code:Q.invalid_return_type,returnTypeError:p}})}const l={errorMap:n.common.contextualErrorMap},c=n.data;if(this._def.returns instanceof vo){const u=this;return Et(async function(...p){const f=new Gt([]),m=await u._def.args.parseAsync(p,l).catch(x=>{throw f.addIssue(o(p,x)),f}),_=await Reflect.apply(c,this,m);return await u._def.returns._def.type.parseAsync(_,l).catch(x=>{throw f.addIssue(s(_,x)),f})})}else{const u=this;return Et(function(...p){const f=u._def.args.safeParse(p,l);if(!f.success)throw new Gt([o(p,f.error)]);const m=Reflect.apply(c,this,f.data),_=u._def.returns.safeParse(m,l);if(!_.success)throw new Gt([s(m,_.error)]);return _.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new Co({...this._def,args:Dn.create(e).rest(Lr.create())})}returns(e){return new Co({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,n,o){return new Co({args:e||Dn.create([]).rest(Lr.create()),returns:n||Lr.create(),typeName:Ce.ZodFunction,...Ee(o)})}}class ki extends Ve{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})}}ki.create=(t,e)=>new ki({getter:t,typeName:Ce.ZodLazy,...Ee(e)});class Si extends Ve{_parse(e){if(e.data!==this._def.value){const n=this._getOrReturnCtx(e);return re(n,{received:n.data,code:Q.invalid_literal,expected:this._def.value}),we}return{status:"valid",value:e.data}}get value(){return this._def.value}}Si.create=(t,e)=>new Si({value:t,typeName:Ce.ZodLiteral,...Ee(e)});function tp(t,e){return new fr({values:t,typeName:Ce.ZodEnum,...Ee(e)})}class fr extends Ve{constructor(){super(...arguments),gi.set(this,void 0)}_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),o=this._def.values;return re(n,{expected:Oe.joinValues(o),received:n.parsedType,code:Q.invalid_type}),we}if(Es(this,gi)||Yu(this,gi,new Set(this._def.values)),!Es(this,gi).has(e.data)){const n=this._getOrReturnCtx(e),o=this._def.values;return re(n,{received:n.data,code:Q.invalid_enum_value,options:o}),we}return Et(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 fr.create(e,{...this._def,...n})}exclude(e,n=this._def){return fr.create(this.options.filter(o=>!e.includes(o)),{...this._def,...n})}}gi=new WeakMap,fr.create=tp;class Ei extends Ve{constructor(){super(...arguments),yi.set(this,void 0)}_parse(e){const n=Oe.getValidEnumValues(this._def.values),o=this._getOrReturnCtx(e);if(o.parsedType!==se.string&&o.parsedType!==se.number){const s=Oe.objectValues(n);return re(o,{expected:Oe.joinValues(s),received:o.parsedType,code:Q.invalid_type}),we}if(Es(this,yi)||Yu(this,yi,new Set(Oe.getValidEnumValues(this._def.values))),!Es(this,yi).has(e.data)){const s=Oe.objectValues(n);return re(o,{received:o.data,code:Q.invalid_enum_value,options:s}),we}return Et(e.data)}get enum(){return this._def.values}}yi=new WeakMap,Ei.create=(t,e)=>new Ei({values:t,typeName:Ce.ZodNativeEnum,...Ee(e)});class vo extends Ve{unwrap(){return this._def.type}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==se.promise&&n.common.async===!1)return re(n,{code:Q.invalid_type,expected:se.promise,received:n.parsedType}),we;const o=n.parsedType===se.promise?n.data:Promise.resolve(n.data);return Et(o.then(s=>this._def.type.parseAsync(s,{path:n.path,errorMap:n.common.contextualErrorMap})))}}vo.create=(t,e)=>new vo({type:t,typeName:Ce.ZodPromise,...Ee(e)});class pn extends Ve{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),s=this._def.effect||null,l={addIssue:c=>{re(o,c),c.fatal?n.abort():n.dirty()},get path(){return o.path}};if(l.addIssue=l.addIssue.bind(l),s.type==="preprocess"){const c=s.transform(o.data,l);if(o.common.async)return Promise.resolve(c).then(async u=>{if(n.value==="aborted")return we;const p=await this._def.schema._parseAsync({data:u,path:o.path,parent:o});return p.status==="aborted"?we:p.status==="dirty"||n.value==="dirty"?Ss(p.value):p});{if(n.value==="aborted")return we;const u=this._def.schema._parseSync({data:c,path:o.path,parent:o});return u.status==="aborted"?we:u.status==="dirty"||n.value==="dirty"?Ss(u.value):u}}if(s.type==="refinement"){const c=u=>{const p=s.refinement(u,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 u};if(o.common.async===!1){const u=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});return u.status==="aborted"?we:(u.status==="dirty"&&n.dirty(),c(u.value),{status:n.value,value:u.value})}else return this._def.schema._parseAsync({data:o.data,path:o.path,parent:o}).then(u=>u.status==="aborted"?we:(u.status==="dirty"&&n.dirty(),c(u.value).then(()=>({status:n.value,value:u.value}))))}if(s.type==="transform")if(o.common.async===!1){const c=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});if(!fi(c))return c;const u=s.transform(c.value,l);if(u instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:u}}else return this._def.schema._parseAsync({data:o.data,path:o.path,parent:o}).then(c=>fi(c)?Promise.resolve(s.transform(c.value,l)).then(u=>({status:n.value,value:u})):c);Oe.assertNever(s)}}pn.create=(t,e,n)=>new pn({schema:t,typeName:Ce.ZodEffects,effect:e,...Ee(n)}),pn.createWithPreprocess=(t,e,n)=>new pn({schema:e,effect:{type:"preprocess",transform:t},typeName:Ce.ZodEffects,...Ee(n)});class Fn extends Ve{_parse(e){return this._getType(e)===se.undefined?Et(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Fn.create=(t,e)=>new Fn({innerType:t,typeName:Ce.ZodOptional,...Ee(e)});class mr extends Ve{_parse(e){return this._getType(e)===se.null?Et(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}mr.create=(t,e)=>new mr({innerType:t,typeName:Ce.ZodNullable,...Ee(e)});class Ti extends Ve{_parse(e){const{ctx:n}=this._processInputParams(e);let o=n.data;return n.parsedType===se.undefined&&(o=this._def.defaultValue()),this._def.innerType._parse({data:o,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}Ti.create=(t,e)=>new Ti({innerType:t,typeName:Ce.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Ee(e)});class Bi extends Ve{_parse(e){const{ctx:n}=this._processInputParams(e),o={...n,common:{...n.common,issues:[]}},s=this._def.innerType._parse({data:o.data,path:o.path,parent:{...o}});return mi(s)?s.then(l=>({status:"valid",value:l.status==="valid"?l.value:this._def.catchValue({get error(){return new Gt(o.common.issues)},input:o.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Gt(o.common.issues)},input:o.data})}}removeCatch(){return this._def.innerType}}Bi.create=(t,e)=>new Bi({innerType:t,typeName:Ce.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Ee(e)});class As extends Ve{_parse(e){if(this._getType(e)!==se.nan){const n=this._getOrReturnCtx(e);return re(n,{code:Q.invalid_type,expected:se.nan,received:n.parsedType}),we}return{status:"valid",value:e.data}}}As.create=t=>new As({typeName:Ce.ZodNaN,...Ee(t)});const Sk=Symbol("zod_brand");class Al extends Ve{_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 Vi extends Ve{_parse(e){const{status:n,ctx:o}=this._processInputParams(e);if(o.common.async)return(async()=>{const s=await this._def.in._parseAsync({data:o.data,path:o.path,parent:o});return s.status==="aborted"?we:s.status==="dirty"?(n.dirty(),Ss(s.value)):this._def.out._parseAsync({data:s.value,path:o.path,parent:o})})();{const s=this._def.in._parseSync({data:o.data,path:o.path,parent:o});return s.status==="aborted"?we:s.status==="dirty"?(n.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:o.path,parent:o})}}static create(e,n){return new Vi({in:e,out:n,typeName:Ce.ZodPipeline})}}class Ni extends Ve{_parse(e){const n=this._def.innerType._parse(e),o=s=>(fi(s)&&(s.value=Object.freeze(s.value)),s);return mi(n)?n.then(s=>o(s)):o(n)}unwrap(){return this._def.innerType}}Ni.create=(t,e)=>new Ni({innerType:t,typeName:Ce.ZodReadonly,...Ee(e)});function np(t,e={},n){return t?yo.create().superRefine((o,s)=>{var l,c;if(!t(o)){const u=typeof e=="function"?e(o):typeof e=="string"?{message:e}:e,p=(c=(l=u.fatal)!==null&&l!==void 0?l:n)!==null&&c!==void 0?c:!0,f=typeof u=="string"?{message:u}:u;s.addIssue({code:"custom",...f,fatal:p})}}):yo.create()}const Ek={object:Qe.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 Tk=(t,e={message:`Input not instance of ${t.name}`})=>np(n=>n instanceof t,e),rp=dn.create,op=ur.create,Bk=As.create,Vk=pr.create,ip=_i.create,Nk=Or.create,Ak=Ts.create,Pk=Ci.create,Dk=vi.create,Fk=yo.create,Rk=Lr.create,Mk=$n.create,Ik=Bs.create,Ok=un.create,Lk=Qe.create,Gk=Qe.strictCreate,zk=wi.create,$k=Vs.create,Zk=bi.create,Uk=Dn.create,Wk=xi.create,Hk=Ns.create,jk=Gr.create,qk=Co.create,Kk=ki.create,Yk=Si.create,Jk=fr.create,Xk=Ei.create,Qk=vo.create,sp=pn.create,eS=Fn.create,tS=mr.create,nS=pn.createWithPreprocess,rS=Vi.create;var Rn=Object.freeze({__proto__:null,defaultErrorMap:go,setErrorMap:lk,getErrorMap:xs,makeIssue:ks,EMPTY_PATH:ck,addIssueToContext:re,ParseStatus:vt,INVALID:we,DIRTY:Ss,OK:Et,isAborted:Tl,isDirty:Bl,isValid:fi,isAsync:mi,get util(){return Oe},get objectUtil(){return El},ZodParsedType:se,getParsedType:dr,ZodType:Ve,datetimeRegex:ep,ZodString:dn,ZodNumber:ur,ZodBigInt:pr,ZodBoolean:_i,ZodDate:Or,ZodSymbol:Ts,ZodUndefined:Ci,ZodNull:vi,ZodAny:yo,ZodUnknown:Lr,ZodNever:$n,ZodVoid:Bs,ZodArray:un,ZodObject:Qe,ZodUnion:wi,ZodDiscriminatedUnion:Vs,ZodIntersection:bi,ZodTuple:Dn,ZodRecord:xi,ZodMap:Ns,ZodSet:Gr,ZodFunction:Co,ZodLazy:ki,ZodLiteral:Si,ZodEnum:fr,ZodNativeEnum:Ei,ZodPromise:vo,ZodEffects:pn,ZodTransformer:pn,ZodOptional:Fn,ZodNullable:mr,ZodDefault:Ti,ZodCatch:Bi,ZodNaN:As,BRAND:Sk,ZodBranded:Al,ZodPipeline:Vi,ZodReadonly:Ni,custom:np,Schema:Ve,ZodSchema:Ve,late:Ek,get ZodFirstPartyTypeKind(){return Ce},coerce:{string:t=>dn.create({...t,coerce:!0}),number:t=>ur.create({...t,coerce:!0}),boolean:t=>_i.create({...t,coerce:!0}),bigint:t=>pr.create({...t,coerce:!0}),date:t=>Or.create({...t,coerce:!0})},any:Fk,array:Ok,bigint:Vk,boolean:ip,date:Nk,discriminatedUnion:$k,effect:sp,enum:Jk,function:qk,instanceof:Tk,intersection:Zk,lazy:Kk,literal:Yk,map:Hk,nan:Bk,nativeEnum:Xk,never:Mk,null:Dk,nullable:tS,number:op,object:Lk,oboolean:()=>ip().optional(),onumber:()=>op().optional(),optional:eS,ostring:()=>rp().optional(),pipeline:rS,preprocess:nS,promise:Qk,record:Wk,set:jk,strictObject:Gk,string:rp,symbol:Ak,transformer:sp,tuple:Uk,undefined:Pk,union:zk,unknown:Rk,void:Ik,NEVER:we,ZodIssueCode:Q,quotelessJson:ak,ZodError:Gt});function oS(t){throw new Error("Unexpected object: "+t)}const ap="upload://upload/",lp="index://index/";function iS(t){return t.startsWith(ap)}function sS(t){return t.startsWith(lp)}function cp(t){if(sS(t)){const e=t.slice(lp.length);return JSON.parse(decodeURIComponent(e)).path}else if(iS(t)){const e=t.slice(ap.length);return JSON.parse(decodeURIComponent(e)).localPath}oS(t)}function aS(t){return t.replace(/^.*[\\/]/,"")}function lS(t){return aS(cp(t))}Rn.object({__isRef:Rn.literal(!0).describe("Crucial marker for the block dependency tree reconstruction"),blockId:Rn.string().describe("Upstream block id"),name:Rn.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 cS=Rn.object({type:Rn.string(),importance:Rn.number().optional(),id:Rn.string().optional(),label:Rn.string()});Rn.array(cS);const dS={key:0,ref:"label"},uS={key:0,class:"required-icon"},pS=["data-placeholder"],hS={key:5,class:"pl-file-input__stats"},fS={key:0,class:"pl-file-input__error"},mS={key:1,class:"pl-file-input__helper"},dp=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(),s=e,l=t,c=(L,F)=>{if(L)try{return F(L)}catch(T){return n.error=T instanceof Error?T.message:String(T),L}},u=r.computed(()=>c(l.modelValue,lS)),p=r.computed(()=>c(l.modelValue,cp)),f=r.computed(()=>l.progress&&!l.progress.done),m=r.computed(()=>l.progress&&l.progress.done),_=r.computed(()=>n.error??l.error),x=r.computed(()=>!!_.value),S=r.computed(()=>{const{status:L,done:F}=l.progress??{};return!L||!L.bytesTotal?"":L.bytesProcessed&&!F?sl(L.bytesProcessed,{})+" / "+sl(L.bytesTotal,{}):sl(L.bytesTotal,{})}),V=r.computed(()=>{var L;const{progress:F}=l;return F?{width:F.done?"100%":Math.round((((L=F.status)==null?void 0:L.progress)??0)*100)+"%"}:{}}),I=()=>{n.fileDialogOpen=!0},G=L=>{L.files.length&&s("update:modelValue",L.files[0])},v=()=>s("update:modelValue",void 0);r.watch(()=>l.modelValue,()=>{n.error=""},{immediate:!0});const R=r.ref();return l.cellStyle||zn(R),(L,F)=>(r.openBlock(),r.createElementBlock(r.Fragment,null,[r.createElementVNode("div",{class:r.normalizeClass([{"pl-file-input__cell-style":!!L.cellStyle,"has-file":!!u.value},"pl-file-input__envelope"])},[r.createElementVNode("div",{ref_key:"rootRef",ref:R,class:r.normalizeClass(["pl-file-input",{dashed:L.dashed,error:x.value}]),tabindex:"0",onKeyup:r.withKeys(I,["enter"]),onClick:r.withModifiers(I,["stop"])},[r.createElementVNode("div",{class:"pl-file-input__progress",style:r.normalizeStyle(V.value)},null,4),F[3]||(F[3]=r.createTextVNode()),!L.cellStyle&&L.label?(r.openBlock(),r.createElementBlock("label",dS,[L.required?(r.openBlock(),r.createElementBlock("i",uS)):r.createCommentVNode("",!0),F[1]||(F[1]=r.createTextVNode()),r.createElementVNode("span",null,r.toDisplayString(L.label),1),F[2]||(F[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(L.$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),F[4]||(F[4]=r.createTextVNode()),x.value?(r.openBlock(),r.createBlock(r.unref(Dt),{key:1,name:"restart"})):f.value?(r.openBlock(),r.createBlock(r.unref(Dt),{key:2,name:"cloud-upload"})):m.value?(r.openBlock(),r.createBlock(r.unref(Dt),{key:3,name:"success"})):(r.openBlock(),r.createBlock(r.unref(Dt),{key:4,name:"paper-clip"})),F[5]||(F[5]=r.createTextVNode()),r.createElementVNode("div",{"data-placeholder":L.placeholder??"Choose file",class:"pl-file-input__filename"},r.toDisplayString(u.value),9,pS),F[6]||(F[6]=r.createTextVNode()),S.value?(r.openBlock(),r.createElementBlock("div",hS,r.toDisplayString(S.value),1)):r.createCommentVNode("",!0),F[7]||(F[7]=r.createTextVNode()),L.modelValue?(r.openBlock(),r.createBlock(r.unref(Dt),{key:6,name:"close",onClick:r.withModifiers(v,["stop"])})):r.createCommentVNode("",!0),F[8]||(F[8]=r.createTextVNode()),r.createVNode(cr,{class:"pl-file-input__contour"})],34),F[9]||(F[9]=r.createTextVNode()),x.value?(r.openBlock(),r.createElementBlock("div",fS,r.toDisplayString(_.value),1)):L.helper?(r.openBlock(),r.createElementBlock("div",mS,r.toDisplayString(L.helper),1)):r.createCommentVNode("",!0)],2),F[10]||(F[10]=r.createTextVNode()),r.createVNode(r.unref(qu),{modelValue:n.fileDialogOpen,"onUpdate:modelValue":F[0]||(F[0]=T=>n.fileDialogOpen=T),extensions:L.extensions,title:L.fileDialogTitle,"close-on-outside-click":L.fileDialogCloseOnOutsideClick,"onImport:files":G},null,8,["modelValue","extensions","title","close-on-outside-click"])],64))}}),gS={class:"pl-notification-alert__wrapper d-flex"},yS={class:"pl-notification-alert__content flex-grow-1"},_S={key:0,class:"pl-notification-alert__close"},CS={key:0,class:"pl-notification-alert__actions d-flex"},up=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(s,l)=>n.value?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass([s.type,"pl-notification-alert d-flex flex-column gap-16"]),style:r.normalizeStyle({width:`${s.width}`})},[r.createElementVNode("div",gS,[r.createElementVNode("div",yS,[r.renderSlot(s.$slots,"default")]),l[0]||(l[0]=r.createTextVNode()),s.closable?(r.openBlock(),r.createElementBlock("div",_S,[r.createVNode(r.unref(po),{icon:"close",onClick:o})])):r.createCommentVNode("",!0)]),l[1]||(l[1]=r.createTextVNode()),s.$slots.actions?(r.openBlock(),r.createElementBlock("div",CS,[r.renderSlot(s.$slots,"actions")])):r.createCommentVNode("",!0)],6)):r.createCommentVNode("",!0)}}),vS=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 wt(t,e,n){return e>t?e:t>n?n:t}const Pl=t=>r.computed(()=>{const e=[100],{min:n,max:o,step:s}=t.value;let l=n;for(;l<o;){l+=s;const c=(1-(wt(l,n,o)-n)/(o-n))*100;e.push(c)}return e}),wS={class:"ui-slider__wrapper"},bS={class:"ui-slider__label-section"},xS={key:0,class:"text-s"},kS={key:1,class:"ui-slider__value-static text-s"},SS={class:"ui-slider__base"},ES={class:"ui-slider__container"},TS={class:"ui-slider__container ui-slider__container-thumb"},BS={class:"ui-slider__input-wrapper d-flex"},VS=["value"],NS={key:0,class:"ui-slider__error"},pp=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,s=t,l=r.reactive({deltaValue:0}),c=r.computed(()=>s.max-s.min),u=r.computed(()=>wt((s.modelValue??0)+l.deltaValue,s.min,s.max)),p=r.ref(s.modelValue),f=r.computed(()=>{const T=s.modelValue;return Number.isFinite(T)?T<s.min?`Min value: ${s.min}`:T>s.max?`Max value: ${s.max}`:s.error:"Not a number"}),m=r.computed(()=>s),_=Pl(m),x=r.computed(()=>(u.value-s.min)/c.value),S=r.computed(()=>({right:Math.ceil((1-x.value)*100)+"%"})),V=r.computed(()=>({right:`calc(${Math.ceil((1-x.value)*100)}%) `})),I=r.ref(),G=r.ref();r.watch(()=>s.modelValue,T=>{p.value=T});function v(T){const $=wt(T,s.min,s.max);return Math.round(($+Number.EPSILON)*(1/s.step))/(1/s.step)}ar(G,T=>{var $;at(($=r.unref(I))==null?void 0:$.getBoundingClientRect(),U=>{const{dx:O}=T;l.deltaValue=O/U.width*c.value,p.value=v(wt((s.modelValue??0)+l.deltaValue,s.min,s.max)),T.stop&&(o("update:modelValue",v(u.value)),l.deltaValue=0)})});function R(T){o("update:modelValue",v(T))}function L(T){R(+T.target.value)}function F(T){["ArrowDown","ArrowUp","ArrowRight","ArrowLeft","Enter"].includes(T.code)&&T.preventDefault();const $=T.code==="ArrowUp"||T.code==="ArrowRight"?s.step*1:T.code==="ArrowDown"||T.code==="ArrowLeft"?s.step*-1:0;R(s.modelValue+$)}return(T,$)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass([s.disabled?"ui-slider__disabled":void 0,"ui-slider__envelope"])},[r.createElementVNode("div",{class:r.normalizeClass([`ui-slider__mode-${s.mode}`,"ui-slider"])},[r.createElementVNode("div",wS,[r.createElementVNode("div",bS,[T.label?(r.openBlock(),r.createElementBlock("label",xS,[r.createElementVNode("span",null,r.toDisplayString(T.label),1),$[1]||($[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(T.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0),$[2]||($[2]=r.createTextVNode()),s.mode==="text"?(r.openBlock(),r.createElementBlock("div",kS,r.toDisplayString(p.value)+r.toDisplayString(T.measure),1)):r.createCommentVNode("",!0)]),$[6]||($[6]=r.createTextVNode()),r.createElementVNode("div",SS,[r.createElementVNode("div",ES,[r.createElementVNode("div",{ref_key:"barRef",ref:I,class:"ui-slider__bar"},[r.createElementVNode("div",{class:"ui-slider__progress",style:r.normalizeStyle(S.value)},null,4)],512)]),$[5]||($[5]=r.createTextVNode()),r.createElementVNode("div",TS,[s.breakpoints?(r.openBlock(!0),r.createElementBlock(r.Fragment,{key:0},r.renderList(r.unref(_),(U,O)=>(r.openBlock(),r.createElementBlock("div",{key:O,style:r.normalizeStyle({right:`${U}%`}),class:"ui-slider__thumb-step"},null,4))),128)):r.createCommentVNode("",!0),$[4]||($[4]=r.createTextVNode()),r.createElementVNode("div",{ref_key:"thumbRef",ref:G,tabindex:"0",class:"ui-slider__thumb ui-slider__thumb-active",style:r.normalizeStyle(V.value),onKeydown:F},$[3]||($[3]=[r.createElementVNode("div",{class:"ui-slider__thumb-focused-contour"},null,-1)]),36)])])]),$[7]||($[7]=r.createTextVNode()),r.createElementVNode("div",BS,[s.mode==="input"?(r.openBlock(),r.createElementBlock("input",{key:0,value:p.value,class:"ui-slider__value text-s",onChange:$[0]||($[0]=U=>L(U))},null,40,VS)):r.createCommentVNode("",!0)])],2),$[8]||($[8]=r.createTextVNode()),f.value?(r.openBlock(),r.createElementBlock("div",NS,r.toDisplayString(f.value),1)):r.createCommentVNode("",!0)],2))}});function AS(t,e=null,n=null){function o(u){const{scrollTop:p,scrollHeight:f,clientHeight:m}=u;if(!(f>m)||!e)return null;const _=f-p-m,x=p>e?e:0,S=_>e?m-e-x:m;return`linear-gradient(
52
+ `,j0=["innerHTML"],H0={class:"dropdown-list-item__title-container"},q0={class:"dropdown-list-item__title text-s"},K0={key:0,class:"dropdown-list-item__description text-description"},X0={key:1,class:"dropdown-list-item__icon flex-self-start"},yo=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?W0:Z0);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,j0)):r.createCommentVNode("",!0),c[1]||(c[1]=r.createTextVNode()),r.createElementVNode("div",H0,[r.createElementVNode("div",q0,r.toDisplayString(l.option.label),1),c[0]||(c[0]=r.createTextVNode()),l.option.description?(r.openBlock(),r.createElementBlock("div",K0,r.toDisplayString(l.option.description),1)):r.createCommentVNode("",!0)]),c[2]||(c[2]=r.createTextVNode()),!e.useCheckbox&&e.isSelected?(r.openBlock(),r.createElementBlock("div",X0)):r.createCommentVNode("",!0)],2))}});function vo(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 Y0=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))}}),J0="_icon_1ugxm_2",Q0={icon:J0},ew={$style:Q0},fn=Zt(Y0,[["__cssModules",ew]]),tw=["onKeyup"],nw=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,V=>{if(V){const Z=V.getBoundingClientRect();m.optionsHeight=Z.height,window.dispatchEvent(new CustomEvent("adjust"))}},{immediate:!0});const x=r.computed(()=>m.open?"mask-24 mask-chevron-up":"mask-24 mask-chevron-down"),w=r.computed(()=>(o.options??[]).findIndex(V=>yi(V.value,l.value))),E=r.computed(()=>yr(o.options??[]).map((V,Z)=>({...V,index:Z,isSelected:Z===w.value,isActive:Z===m.activeIndex}))),O=r.computed(()=>o.loading||o.options===void 0),$=r.computed(()=>{var V;return((V=E.value.find(Z=>yi(Z.value,l.value)))==null?void 0:V.label)??(o.options===void 0?"...":"")});vo(c,V=>{const Z=V.top+V.height+3;Z+m.optionsHeight>V.clientHeight?y.top=V.top-m.optionsHeight-3+"px":y.top=Z+"px",y.left=V.left+"px",y.width=V.width+"px"});const b=V=>{var Z;l.value=V,m.open=!1,(Z=c==null?void 0:c.value)==null||Z.focus()};function R(){i("click")}const F=V=>{var Z,ne;if(["ArrowDown","ArrowUp","Enter","Escape"].includes(V.code))V.preventDefault();else return;if(V.target===h.value&&V.code==="Enter"){R();return}const{open:H,activeIndex:J}=m;if(!H&&V.target===p.value){V.code==="Enter"&&(m.open=!0);return}V.code==="Escape"&&(m.open=!1,(Z=c.value)==null||Z.focus());const G=r.unref(E),{length:z}=G;if(!z)return;V.code==="Enter"&&b((ne=G.find(k=>k.index===J))==null?void 0:ne.value);const Q=G.findIndex(k=>k.index===J)??-1,A=V.code==="ArrowDown"?1:V.code==="ArrowUp"?-1:0,C=Math.abs(Q+A+z)%z;m.activeIndex=E.value[C].index??-1},D=V=>{var Z,ne;const H=V.relatedTarget;!((Z=c.value)!=null&&Z.contains(H))&&!((ne=d.value)!=null&&ne.contains(H))&&(m.open=!1)};return(V,Z)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"root",ref:c,class:r.normalizeClass([{disabled:V.disabled||O.value,loading:O.value},"pl-btn-split d-flex"]),onFocusout:D,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:R,onKeyup:r.withKeys(r.withModifiers(R,["stop"]),["enter"])},r.toDisplayString($.value),41,tw),Z[1]||(Z[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:Z[0]||(Z[0]=ne=>m.open=!m.open)},[O.value?(r.openBlock(),r.createBlock(fn,{key:0,name:"loading"})):(r.openBlock(),r.createElementBlock("div",{key:1,class:r.normalizeClass([x.value,"pl-btn-split__icon"])},null,2))],512),Z[2]||(Z[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(E.value,(ne,H)=>(r.openBlock(),r.createBlock(yo,{key:H,option:ne,"is-selected":ne.isSelected,"is-hovered":ne.isActive,size:"medium",onClick:r.withModifiers(J=>b(ne.value),["stop"])},null,8,["option","is-selected","is-hovered","onClick"]))),128))],4)])):r.createCommentVNode("",!0)],34))}});function cp(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 rw={key:0},ow={inheritAttrs:!1},Ts=r.defineComponent({...ow,__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 cp(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",rw,[r.renderSlot(l.$slots,"default")])),c[0]||(c[0]=r.createTextVNode()),l.loading?(r.openBlock(),r.createBlock(r.unref(fn),{key:1,name:"loading",size:l.size},null,8,["size"])):l.icon?(r.openBlock(),r.createBlock(r.unref(fn),{key:2,name:l.icon,size:l.size},null,8,["name","size"])):r.createCommentVNode("",!0)],16))}}),iw={name:"PlBtnPrimary"},Ns=r.defineComponent({...iw,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(Ts,r.mergeProps({class:"pl-btn-primary"},e),{default:r.withCtx(()=>[r.renderSlot(n.$slots,"default")]),_:3},16))}}),sw={name:"PlBtnAccent"},aw=r.defineComponent({...sw,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(Ts,r.mergeProps({class:"pl-btn-accent"},e),{default:r.withCtx(()=>[r.renderSlot(n.$slots,"default")]),_:3},16))}}),lw={name:"PlBtnDanger"},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(Ts,r.mergeProps({class:"pl-btn-danger"},e),{default:r.withCtx(()=>[r.renderSlot(n.$slots,"default")]),_:3},16))}}),dw={name:"PlBtnSecondary"},Pl=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(Ts,r.mergeProps(e,{class:"pl-btn-secondary"}),{default:r.withCtx(()=>[r.renderSlot(n.$slots,"default")]),_:3},16))}}),uw={key:0},pw={name:"PlBtnGhost"},_o=r.defineComponent({...pw,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 cp(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",uw,[r.renderSlot(c.$slots,"default")])):r.createCommentVNode("",!0),d[0]||(d[0]=r.createTextVNode()),c.loading?(r.openBlock(),r.createBlock(r.unref(fn),{key:1,name:"loading",size:c.size},null,8,["size"])):c.icon?(r.openBlock(),r.createBlock(r.unref(fn),{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))}}),hw=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 fw(t,e){const n=r.ref();return vo(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;`:""})}function _i(t,e){return e(t)}function ut(t,e){if(t!=null)return e(t)}function mw(t){return Array.isArray(t)?t:[t]}function gw(t,e,...n){n.forEach(o=>{t[o]=e[o]})}function As(t,e){st(document,"click",n=>{document.contains(n.target)&&(mw(t).map(o=>o.value).filter(o=>!!o).some(o=>o==null?void 0:o.contains(n.target))||e())})}const yw={},vw={class:"beak",width:"5",height:"9",viewBox:"0 0 3 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function _w(t,e){return r.openBlock(),r.createElementBlock("svg",vw,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 Cw=Zt(yw,[["render",_w]]),Rl=new Map,ww={name:"PlTooltip"},xt=r.defineComponent({...ww,props:{openDelay:{default:100},closeDelay:{default:1e3},position:{default:"top"},hide:{type:Boolean},gap:{default:8},element:{default:"div"}},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=op(()=>window.dispatchEvent(new CustomEvent("adjust")),1e3),p=()=>{l.open=!0;for(let[O,$]of Rl.entries())O!==o&&$()},h=()=>{l.open=!1,n("tooltip:close")},m=async()=>{i.hide||(d(),l.over=!0,c(),await Ju(100),l.over&&p())},y=()=>{l.over=!1,c=Qu(()=>{l.over||h()},i.closeDelay)};r.watch(()=>i.hide,O=>{O&&h()});const x=r.ref(),w=r.ref(),E=fw(x,r.toRef(i));return As([x,w],()=>h()),r.onUnmounted(()=>{Rl.delete(o)}),(O,$)=>(r.openBlock(),r.createBlock(r.resolveDynamicComponent(O.element),r.mergeProps(O.$attrs,{ref_key:"rootRef",ref:x,onClick:m,onMouseover:m,onMouseleave:y}),{default:r.withCtx(()=>[r.renderSlot(O.$slots,"default"),$[1]||($[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(E))},[r.createElementVNode("div",{ref_key:"tooltip",ref:w,class:r.normalizeClass(["pl-tooltip",O.position]),onMouseover:m,onMouseleave:y},[r.createElementVNode("div",null,[r.renderSlot(O.$slots,"tooltip")]),$[0]||($[0]=r.createTextVNode()),r.createVNode(Cw)],34)],4)):r.createCommentVNode("",!0)]),_:3})])):r.createCommentVNode("",!0)]),_:3},16))}}),bw={},xw={class:"inner-border"};function kw(t,e,n,o,i,l){return r.openBlock(),r.createElementBlock("div",xw,[r.renderSlot(t.$slots,"default")])}const Sw=Zt(bw,[["render",kw]]),Ew={key:0},Tw=["tabindex","onKeydown","onClick"],Nw={key:1,class:"pl-btn-group__helper"},Aw={key:2,class:"pl-btn-group__error"},Vw={name:"PlBtnGroup"},dp=r.defineComponent({...Vw,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",Ew,[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(xt),{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(Sw,{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,Tw))),128))]),_:1}),p[2]||(p[2]=r.createTextVNode()),d.helper?(r.openBlock(),r.createElementBlock("div",Nw,r.toDisplayString(d.helper),1)):d.error?(r.openBlock(),r.createElementBlock("div",Aw,r.toDisplayString(d.error),1)):r.createCommentVNode("",!0)],2))}});function Bw(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 Pw="_component_1abv8_1",Rw="_container_1abv8_15",Dw="_error_1abv8_69",Dl={component:Pw,container:Rw,error:Dw},Iw={key:0},Fw=["placeholder"],Ow=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=Bw(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",Iw,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,Fw),[[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))}}),Lw={inheritAttrs:!1},Mw={class:"double-contour"};function Gw(t,e,n,o,i,l){return r.openBlock(),r.createElementBlock("div",Mw,[r.createElementVNode("div",r.normalizeProps(r.guardReactiveProps(t.$attrs)),[r.renderSlot(t.$slots,"default")],16)])}const vr=Zt(Lw,[["render",Gw]]);function up(t){r.onMounted(t),r.onUpdated(t)}const Il=new WeakMap,Fl=new ResizeObserver(t=>{for(const e of t)ut(Il.get(e.target),n=>n(e))});function pp(t,e){Il.set(t,e),Fl.unobserve(t),Fl.observe(t)}function hp(t){Fl.unobserve(t),Il.delete(t)}const $w=8,fp=4;function Xn(t,e="label"){const n=new Set;up(()=>{ut(t==null?void 0:t.value,o=>{const i=o.querySelector(e);i&&(n.add(i),pp(i,()=>{const l=Yu(()=>i.getBoundingClientRect().width+_i($w,c=>Number.isNaN(c)?fp:c+fp));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=>hp(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 mp(t,e){return r.computed(()=>zw(t.value,e))}const Uw=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))}}),Zw="_icon_1ugxm_2",Ww={icon:Zw},jw={$style:Ww},Co=Zt(Uw,[["__cssModules",jw]]),Hw=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))}}),qw="_icon_1ugxm_2",Kw={icon:qw},Xw={$style:Kw},Ci=Zt(Hw,[["__cssModules",Xw]]),Yw={class:"pl-text-field__envelope"},Jw={key:0,ref:"label"},Qw={key:0,class:"required-icon"},eb={key:1,class:"pl-text-field__prefix"},tb=["disabled","placeholder","type"],nb={class:"pl-text-field__append"},rb={key:0,class:"pl-text-field__error"},ob={key:1,class:"pl-text-field__helper"},ib={name:"PlTextField"},Wr=r.defineComponent({...ib,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(D){if(d.cached=void 0,o.parse)try{n.value=o.parse(D)}catch(V){d.cached={error:V instanceof Error?V.message:String(V),value:D}}else n.value=D}}),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())},x=mp(p,o.rules||[]),w=r.computed(()=>o.clearable?o.clearable===!0?n.value==="":n.value===o.clearable():n.value===""),E=r.computed(()=>!w.value),O=r.computed(()=>{const D=[];return o.error&&D.push(o.error),d.cached&&D.push(d.cached.error),x.value.isValid||D.push(...x.value.errors),D}),$=r.computed(()=>O.value.length>0),b=r.computed(()=>o.clearable&&E.value&&o.type!=="password"),R=()=>c.value=!c.value,F=()=>{d.cached=void 0};return Xn(i),(D,V)=>(r.openBlock(),r.createElementBlock("div",Yw,[r.createElementVNode("div",{ref_key:"rootRef",ref:i,class:r.normalizeClass(["pl-text-field",{error:$.value,disabled:D.disabled,dashed:D.dashed,nonEmpty:E.value}])},[D.label?(r.openBlock(),r.createElementBlock("label",Jw,[D.required?(r.openBlock(),r.createElementBlock("i",Qw)):r.createCommentVNode("",!0),V[1]||(V[1]=r.createTextVNode()),r.createElementVNode("span",null,r.toDisplayString(D.label),1),V[2]||(V[2]=r.createTextVNode()),r.unref(e).tooltip?(r.openBlock(),r.createBlock(r.unref(xt),{key:1,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.renderSlot(D.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)],512)):r.createCommentVNode("",!0),V[5]||(V[5]=r.createTextVNode()),D.prefix?(r.openBlock(),r.createElementBlock("div",eb,r.toDisplayString(D.prefix),1)):r.createCommentVNode("",!0),V[6]||(V[6]=r.createTextVNode()),r.withDirectives(r.createElementVNode("input",{ref_key:"inputRef",ref:l,"onUpdate:modelValue":V[0]||(V[0]=Z=>p.value=Z),disabled:D.disabled,placeholder:D.placeholder||"...",type:h.value,spellcheck:"false",onFocusout:F},null,40,tb),[[r.vModelDynamic,p.value]]),V[7]||(V[7]=r.createTextVNode()),r.createElementVNode("div",nb,[b.value?(r.openBlock(),r.createBlock(r.unref(Co),{key:0,class:"pl-text-field__clearable",name:"delete-clear",onClick:y})):r.createCommentVNode("",!0),V[3]||(V[3]=r.createTextVNode()),D.type==="password"?(r.openBlock(),r.createBlock(r.unref(Ci),{key:1,name:m.value,style:{cursor:"pointer"},onClick:R},null,8,["name"])):r.createCommentVNode("",!0),V[4]||(V[4]=r.createTextVNode()),r.renderSlot(D.$slots,"append")]),V[8]||(V[8]=r.createTextVNode()),r.createVNode(vr,{class:"pl-text-field__contour"})],2),V[9]||(V[9]=r.createTextVNode()),$.value?(r.openBlock(),r.createElementBlock("div",rb,r.toDisplayString(O.value.join(" ")),1)):D.helper?(r.openBlock(),r.createElementBlock("div",ob,r.toDisplayString(D.helper),1)):r.createCommentVNode("",!0)]))}}),sb=["disabled","placeholder"],ab=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(Ci),{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,sb),[[r.vModelText,c.value]]),m[2]||(m[2]=r.createTextVNode()),h.clearable&&d.value?(r.openBlock(),r.createBlock(r.unref(Co),{key:0,class:r.normalizeClass(h.$style.clear),name:"delete-clear",onClick:r.withModifiers(p,["stop"])},null,8,["class"])):r.createCommentVNode("",!0)],2))}}),lb="_component_1ng5b_1",cb="_clear_1ng5b_35",db={component:lb,clear:cb},ub={$style:db},gp=Zt(ab,[["__cssModules",ub]]),pb={class:"ui-text-area__envelope"},hb={key:0,ref:"label"},fb={key:0,class:"required-icon"},mb=["readonly","rows","disabled","placeholder"],gb={class:"ui-text-area__append"},yb={key:0,class:"ui-text-area__error"},vb={key:1,class:"ui-text-area__helper"},_b={name:"PlTextArea"},Cb=r.defineComponent({..._b,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=mp(d,i.rules||[]);Xn(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),x=()=>{if(!i.autogrow)return;const w=c.value;w&&(w.style.height="auto",w.style.height=`${w.scrollHeight}px`)};return r.onMounted(()=>{x()}),(w,E)=>(r.openBlock(),r.createElementBlock("div",pb,[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",hb,[w.required?(r.openBlock(),r.createElementBlock("i",fb)):r.createCommentVNode("",!0),E[1]||(E[1]=r.createTextVNode()),r.createElementVNode("span",null,r.toDisplayString(w.label),1),E[2]||(E[2]=r.createTextVNode()),r.unref(n).tooltip?(r.openBlock(),r.createBlock(r.unref(xt),{key:1,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.renderSlot(w.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)],512)):r.createCommentVNode("",!0),E[3]||(E[3]=r.createTextVNode()),r.withDirectives(r.createElementVNode("textarea",{ref_key:"input",ref:c,"onUpdate:modelValue":E[0]||(E[0]=O=>d.value=O),readonly:w.readonly,rows:w.rows,disabled:w.disabled,placeholder:w.placeholder??"...",spellcheck:"false",onInput:x},null,40,mb),[[r.vModelText,d.value]]),E[4]||(E[4]=r.createTextVNode()),r.createElementVNode("div",gb,[r.renderSlot(w.$slots,"append")]),E[5]||(E[5]=r.createTextVNode()),r.createVNode(vr,{class:"ui-text-area__contour"})],2),E[6]||(E[6]=r.createTextVNode()),y.value?(r.openBlock(),r.createElementBlock("div",yb,r.toDisplayString(m.value.join(" ")),1)):w.helper?(r.openBlock(),r.createElementBlock("div",vb,r.toDisplayString(w.helper),1)):r.createCommentVNode("",!0)]))}});function yp(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 vp(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 wi(t,e,n={}){const o=t.scrollTop,i=t.getBoundingClientRect().height,l=e.getBoundingClientRect().height,c=e.offsetTop,d=vp(t,e);if(d==="visible")return;const p=h=>{const m=d==="floor"?c-(i-l):c;t.scrollTop=o+h*(m-o)};yp(t,e)||np({duration:n.duration||100,timing:tp(h=>h),draw:p})}function Ol(t,e,n,o){return t.addEventListener(e,n,o),function(){t.removeEventListener(e,n)}}function wb(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}function _p(t){return t!==null&&typeof t=="object"}function Ot(t,e){return _p(t)&&_p(e)?Object.keys(t).length!==Object.keys(e).length?!1:Object.keys(t).every(n=>Ot(t[n],e[n])):t===e}function Ll(t,e){return t.some(n=>Ot(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=rp(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))}}),bb=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))}}),xb="_icon_1ugxm_2",kb={icon:xb},Sb={$style:kb},Lt=Zt(bb,[["__cssModules",Sb]]),Eb={class:"pl-dropdown__envelope"},Tb=["tabindex"],Nb={class:"pl-dropdown__container"},Ab={class:"pl-dropdown__field"},Vb=["disabled","placeholder"],Bb={class:"pl-dropdown__controls"},Pb={key:0},Rb={key:0,class:"required-icon"},Db={key:0,class:"nothing-found"},Ib={key:0,class:"pl-dropdown__error"},Fb={key:1,class:"pl-dropdown__helper"},Ob={key:2,class:"pl-dropdown__helper"},Lb={name:"PlDropdown"},wo=r.defineComponent({...Lb,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,optionsHeight:0}),h=()=>_i(F.value.findIndex(C=>Ot(C.value,o.modelValue)),C=>C<0?0:C),m=()=>p.activeIndex=h(),y=r.computed(()=>o.options===void 0),x=r.computed(()=>y.value?!0:o.disabled),w=r.computed(()=>(o.options??[]).findIndex(C=>Ot(C.value,o.modelValue))),E=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"}}),O=r.computed(()=>yr(o.options??[]).map((C,k)=>({...C,index:k,isSelected:k===w.value,isActive:k===p.activeIndex}))),$=r.computed(()=>{const C=r.unref(O).find(k=>Ot(k.value,o.modelValue));return(C==null?void 0:C.label)||o.modelValue}),b=r.computed(()=>!p.open&&o.modelValue?"":o.modelValue?String($.value):o.placeholder),R=r.computed(()=>o.modelValue!==void 0&&o.modelValue!==null),F=r.computed(()=>{const C=O.value;return p.search?C.filter(k=>{const M=p.search.toLowerCase();return k.label.toLowerCase().includes(M)||k.description&&k.description.toLowerCase().includes(M)?!0:typeof k.value=="string"?k.value.toLowerCase().includes(M):k.value===p.search}):C}),D=r.computed(()=>x.value?void 0:"0"),V=C=>{var k;n("update:modelValue",C),p.search="",p.open=!1,(k=l==null?void 0:l.value)==null||k.focus()},Z=()=>n("update:modelValue",void 0),ne=()=>{var C;return(C=d.value)==null?void 0:C.focus()},H=()=>p.open=!p.open,J=()=>p.open=!0,G=C=>{var k,M;const W=C.relatedTarget;!((k=l.value)!=null&&k.contains(W))&&!((M=c.value)!=null&&M.contains(W))&&(p.search="",p.open=!1)},z=()=>{const C=c.value;C&&ut(C.querySelector(".hovered-item"),k=>{wi(C,k)})},Q=C=>{var k,M;if(["ArrowDown","ArrowUp","Enter","Escape"].includes(C.code))C.preventDefault();else return;const{open:W,activeIndex:q}=p;if(!W){C.code==="Enter"&&(p.open=!0);return}C.code==="Escape"&&(p.open=!1,(k=l.value)==null||k.focus());const re=r.unref(F),{length:ue}=re;if(!ue)return;C.code==="Enter"&&V((M=re.find(ht=>ht.index===q))==null?void 0:M.value);const ke=re.findIndex(ht=>ht.index===q)??-1,Se=C.code==="ArrowDown"?1:C.code==="ArrowUp"?-1:0,Ze=Math.abs(ke+Se+ue)%ue;p.activeIndex=F.value[Ze].index??-1};Xn(l),r.watch(()=>o.modelValue,m,{immediate:!0}),r.watch(()=>p.open,C=>{var k;return C?(k=d.value)==null?void 0:k.focus():""}),r.watchPostEffect(()=>{p.search,p.activeIndex>=0&&p.open&&z()});const A=r.reactive({top:"0px",left:"0px",width:"0px"});return r.watch(c,C=>{if(C){const k=C.getBoundingClientRect();p.optionsHeight=k.height,window.dispatchEvent(new CustomEvent("adjust"))}}),vo(l,C=>{const k=C.top+C.height+3;k+p.optionsHeight>C.clientHeight?A.top=C.top-p.optionsHeight-3+"px":A.top=k+"px",A.left=C.left+"px",A.width=C.width+"px"}),(C,k)=>(r.openBlock(),r.createElementBlock("div",Eb,[r.createElementVNode("div",{ref_key:"root",ref:l,tabindex:D.value,class:r.normalizeClass(["pl-dropdown",{open:p.open,error:C.error,disabled:x.value}]),onKeydown:Q,onFocusout:G},[r.createElementVNode("div",Nb,[r.createElementVNode("div",Ab,[r.withDirectives(r.createElementVNode("input",{ref_key:"input",ref:d,"onUpdate:modelValue":k[0]||(k[0]=M=>p.search=M),type:"text",tabindex:"-1",disabled:x.value,placeholder:b.value,spellcheck:"false",autocomplete:"chrome-off",onFocus:J},null,40,Vb),[[r.vModelText,p.search]]),k[4]||(k[4]=r.createTextVNode()),p.open?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",{key:0,onClick:ne},[r.createVNode(Ml,{class:"input-value"},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString($.value),1)]),_:1})])),k[5]||(k[5]=r.createTextVNode()),r.createElementVNode("div",Bb,[y.value?(r.openBlock(),r.createBlock(r.unref(Lt),{key:0,name:"loading"})):r.createCommentVNode("",!0),k[1]||(k[1]=r.createTextVNode()),C.clearable&&R.value?(r.openBlock(),r.createBlock(r.unref(Co),{key:1,name:"delete-clear",onClick:r.withModifiers(Z,["stop"])})):r.createCommentVNode("",!0),k[2]||(k[2]=r.createTextVNode()),r.renderSlot(C.$slots,"append"),k[3]||(k[3]=r.createTextVNode()),C.arrowIconLarge?(r.openBlock(),r.createElementBlock("div",{key:2,class:r.normalizeClass(["arrow-icon",[`icon-24 ${C.arrowIconLarge}`]]),onClick:r.withModifiers(H,["stop"])},null,2)):C.arrowIcon?(r.openBlock(),r.createElementBlock("div",{key:3,class:r.normalizeClass(["arrow-icon",[`icon-16 ${C.arrowIcon}`]]),onClick:r.withModifiers(H,["stop"])},null,2)):(r.openBlock(),r.createElementBlock("div",{key:4,class:"arrow-icon arrow-icon-default",onClick:r.withModifiers(H,["stop"])}))])]),k[9]||(k[9]=r.createTextVNode()),C.label?(r.openBlock(),r.createElementBlock("label",Pb,[C.required?(r.openBlock(),r.createElementBlock("i",Rb)):r.createCommentVNode("",!0),k[6]||(k[6]=r.createTextVNode()),r.createElementVNode("span",null,r.toDisplayString(C.label),1),k[7]||(k[7]=r.createTextVNode()),r.unref(i).tooltip?(r.openBlock(),r.createBlock(r.unref(xt),{key:1,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.renderSlot(C.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0),k[10]||(k[10]=r.createTextVNode()),p.open?(r.openBlock(),r.createBlock(r.Teleport,{key:1,to:"body"},[r.createElementVNode("div",{ref_key:"list",ref:c,class:"pl-dropdown__options",style:r.normalizeStyle(A),tabindex:"-1"},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(F.value,(M,W)=>(r.openBlock(),r.createBlock(yo,{key:W,option:M,"is-selected":M.isSelected,"is-hovered":M.isActive,size:C.optionSize,onClick:r.withModifiers(q=>V(M.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",Db,"Nothing found"))],4)])):r.createCommentVNode("",!0),k[11]||(k[11]=r.createTextVNode()),r.createVNode(vr,{class:"pl-dropdown__contour"})])],42,Tb),k[12]||(k[12]=r.createTextVNode()),E.value?(r.openBlock(),r.createElementBlock("div",Ib,r.toDisplayString(E.value),1)):y.value&&C.loadingOptionsHelper?(r.openBlock(),r.createElementBlock("div",Fb,r.toDisplayString(C.loadingOptionsHelper),1)):C.helper?(r.openBlock(),r.createElementBlock("div",Ob,r.toDisplayString(C.helper),1)):r.createCommentVNode("",!0)]))}}),Mb={name:"PlDropdownRef"},Gb=r.defineComponent({...Mb,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 $b(t,e){return r.computed(()=>{const n=yr(t.value);return e.value?n.filter(o=>o.label.toLowerCase().includes(e.value.toLowerCase())):n})}const zb={class:"resizable-input"},Ub=["placeholder","value","disabled"],Zb=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,Ub)]))}}),Wb={class:"dropdown-tab-item__title text-caps13"},jb=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",Wb,r.toDisplayString(n.value),1)],2))}}),Hb={class:"pl-line-dropdown__prefix"},qb={class:"pl-line-dropdown__icon-wrapper"},Kb={class:"pl-line-dropdown__icon"},Xb={key:0,class:"pl-line-dropdown__no-item"},Yb={key:0,class:"pl-line-dropdown__no-item"},Cp=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 G=[];return i.isOpen&&G.push("open"),o.disabled&&G.push("disabled"),G.join(" ")}),p=r.ref(""),h=$b(r.toRef(o,"options"),p),m=r.computed(()=>!!(o.clearable&&i.isOpen&&o.modelValue&&y.value)),y=r.computed(()=>{if(o.modelValue){const G=E();if(G!==-1){const z=yr(o.options)[G];return typeof z.label=="object"?z.label.title:z.label}}return""}),x=r.ref(y.value),w=r.computed(()=>i.isOpen&&p.value&&p.value.length>=y.value.length-1?p.value:y.value??"...");As(l,()=>{o.mode==="list"&&(i.isOpen=!1)}),r.watch(()=>x.value,G=>{y.value!==G?p.value=G:p.value=""}),r.watch(()=>i.isOpen,G=>{var z;G&&l.value&&((z=l.value.querySelector("input"))==null||z.focus(),r.nextTick(()=>ne()))}),r.watch(()=>o.modelValue,()=>O(),{immediate:!0});function E(){return o.options.findIndex(G=>Ot(G.value,o.modelValue))}function O(){i.activeOption=_i(h.value.findIndex(G=>Ot(G.value,o.modelValue)),G=>G<0?0:G),x.value=y.value}function $(){p.value=""}function b(){o.disabled?i.isOpen=!1:r.nextTick(()=>{i.isOpen=!i.isOpen})}function R(){o.mode==="list"&&(i.isOpen=!1)}function F(G){G&&(n("update:modelValue",G.value),R(),$())}function D(G){return Ot(G.value,o.modelValue)}const V=G=>{var z,Q;const A=G.relatedTarget;!((z=l.value)!=null&&z.contains(A))&&!((Q=c.value)!=null&&Q.contains(A))&&(p.value="",i.isOpen=!1)};function Z(G){const{activeOption:z}=i;if(!i.isOpen&&G.code==="Enter"){i.isOpen=!0;return}const{length:Q}=h.value;if(!Q)return;["ArrowDown","ArrowUp","Enter"].includes(G.code)&&G.preventDefault(),G.code==="Enter"&&F(h.value[z]);const A=G.code==="ArrowDown"?1:G.code==="ArrowUp"?-1:0;i.activeOption=Math.abs(z+A+Q)%Q,requestAnimationFrame(ne)}function ne(){const G=c.value;G&&ut(G.querySelector(".hovered-item"),z=>{o.mode==="list"?wi(G,z):z.scrollIntoView({behavior:"smooth",block:"nearest",inline:"center"})})}function H(){n("update:modelValue",void 0)}const J=r.reactive({top:"0px",left:"0px"});return r.watch(c,G=>{if(G){const z=G.getBoundingClientRect();i.optionsHeight=z.height,window.dispatchEvent(new CustomEvent("adjust"))}}),vo(l,G=>{const z=G.top+G.height+2;z+i.optionsHeight>G.clientHeight?J.top=G.top-i.optionsHeight-2+"px":J.top=z+"px",J.left=G.left+"px"}),(G,z)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"container",ref:l,tabindex:"0",class:r.normalizeClass([d.value,"pl-line-dropdown uc-pointer"]),onKeydown:Z,onFocusout:V,onClick:b},[r.createElementVNode("div",Hb,r.toDisplayString(o==null?void 0:o.prefix),1),z[6]||(z[6]=r.createTextVNode()),r.createVNode(Zb,{modelValue:x.value,"onUpdate:modelValue":z[0]||(z[0]=Q=>x.value=Q),placeholder:w.value,disabled:o.disabled,class:"pl-line-dropdown__input"},null,8,["modelValue","placeholder","disabled"]),z[7]||(z[7]=r.createTextVNode()),r.createElementVNode("div",qb,[r.withDirectives(r.createElementVNode("div",Kb,null,512),[[r.vShow,!m.value]]),z[1]||(z[1]=r.createTextVNode()),r.withDirectives(r.createElementVNode("div",{class:"pl-line-dropdown__icon-clear",onClick:H},null,512),[[r.vShow,m.value]])]),z[8]||(z[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(J),tabindex:"-1",class:"pl-line-dropdown__items",onFocusout:V},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(h),(Q,A)=>r.renderSlot(G.$slots,"item",{key:A,item:Q,textItem:"text",isSelected:D(Q),isHovered:i.activeOption==A,onClick:r.withModifiers(C=>F(Q),["stop"])},()=>[r.createVNode(yo,{option:Q,"text-item":"text","is-selected":D(Q),"is-hovered":i.activeOption==A,size:"medium",onClick:r.withModifiers(C=>F(Q),["stop"])},null,8,["option","is-selected","is-hovered","onClick"])])),128)),z[3]||(z[3]=r.createTextVNode()),r.unref(h).length===0?(r.openBlock(),r.createElementBlock("div",Xb,z[2]||(z[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(J),tabindex:"-1",class:"pl-line-dropdown__items-tabs",onFocusout:V},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(h),(Q,A)=>r.renderSlot(G.$slots,"item",{key:A,item:Q,isSelected:D(Q),isHovered:i.activeOption==A,onClick:r.withModifiers(C=>F(Q),["stop"])},()=>[r.createVNode(jb,{option:Q,"is-selected":D(Q),"is-hovered":i.activeOption==A,onClick:r.withModifiers(C=>F(Q),["stop"])},null,8,["option","is-selected","is-hovered","onClick"])])),128)),z[5]||(z[5]=r.createTextVNode()),r.unref(h).length===0?(r.openBlock(),r.createElementBlock("div",Yb,z[4]||(z[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))}}),Jb={class:"ui-dropdown__envelope"},Qb=["tabindex"],ex={class:"ui-dropdown__container"},tx={class:"ui-dropdown__field"},nx=["disabled","placeholder"],rx={class:"ui-dropdown__controls"},ox={key:0},ix={key:0,class:"required-icon"},sx={key:0,class:"nothing-found"},ax={key:0,class:"ui-dropdown__error"},lx={key:1,class:"ui-dropdown__helper"},cx={key:2,class:"ui-dropdown__helper"},dx={name:"PlDropdown"},ux=r.defineComponent({...dx,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=()=>_i(F.value.findIndex(A=>Ot(A.value,o.modelValue)),A=>A<0?0:A),m=()=>p.activeIndex=h(),y=r.computed(()=>o.options===void 0),x=r.computed(()=>y.value?!0:o.disabled),w=r.computed(()=>(o.options??[]).findIndex(A=>Ot(A.value,o.modelValue))),E=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"}}),O=r.computed(()=>yr(o.options??[]).map((A,C)=>({...A,index:C,isSelected:C===w.value,isActive:C===p.activeIndex}))),$=r.computed(()=>{const A=r.unref(O).find(C=>Ot(C.value,o.modelValue));return(A==null?void 0:A.label)||o.modelValue}),b=r.computed(()=>!p.open&&o.modelValue?"":o.modelValue?String($.value):o.placeholder),R=r.computed(()=>o.modelValue!==void 0&&o.modelValue!==null),F=r.computed(()=>{const A=O.value;return p.search?A.filter(C=>{const k=p.search.toLowerCase();return C.label.toLowerCase().includes(k)||C.description&&C.description.toLowerCase().includes(k)?!0:typeof C.value=="string"?C.value.toLowerCase().includes(k):C.value===p.search}):A}),D=r.computed(()=>x.value?void 0:"0"),V=A=>{var C;n("update:modelValue",A),p.search="",p.open=!1,(C=l==null?void 0:l.value)==null||C.focus()},Z=()=>n("update:modelValue",void 0),ne=()=>{var A;return(A=d.value)==null?void 0:A.focus()},H=()=>p.open=!p.open,J=()=>p.open=!0,G=A=>{var C;(C=l==null?void 0:l.value)!=null&&C.contains(A.relatedTarget)||(p.search="",p.open=!1)},z=()=>{const A=c.value;A&&ut(A.querySelector(".hovered-item"),C=>{wi(A,C)})},Q=A=>{var C,k;if(["ArrowDown","ArrowUp","Enter","Escape"].includes(A.code))A.preventDefault();else return;const{open:M,activeIndex:W}=p;if(!M){A.code==="Enter"&&(p.open=!0);return}A.code==="Escape"&&(p.open=!1,(C=l.value)==null||C.focus());const q=r.unref(F),{length:re}=q;if(!re)return;A.code==="Enter"&&V((k=q.find(Ze=>Ze.index===W))==null?void 0:k.value);const ue=q.findIndex(Ze=>Ze.index===W)??-1,ke=A.code==="ArrowDown"?1:A.code==="ArrowUp"?-1:0,Se=Math.abs(ue+ke+re)%re;p.activeIndex=F.value[Se].index??-1};return Xn(l),r.watch(()=>o.modelValue,m,{immediate:!0}),r.watch(()=>p.open,A=>{var C;return A?(C=d.value)==null?void 0:C.focus():""}),r.watchPostEffect(()=>{p.search,p.activeIndex>=0&&p.open&&z()}),(A,C)=>(r.openBlock(),r.createElementBlock("div",Jb,[r.createElementVNode("div",{ref_key:"root",ref:l,tabindex:D.value,class:r.normalizeClass(["ui-dropdown",{open:p.open,error:A.error,disabled:x.value}]),onKeydown:Q,onFocusout:G},[r.createElementVNode("div",ex,[r.createElementVNode("div",tx,[r.withDirectives(r.createElementVNode("input",{ref_key:"input",ref:d,"onUpdate:modelValue":C[0]||(C[0]=k=>p.search=k),type:"text",tabindex:"-1",disabled:x.value,placeholder:b.value,spellcheck:"false",autocomplete:"chrome-off",onFocus:J},null,40,nx),[[r.vModelText,p.search]]),C[4]||(C[4]=r.createTextVNode()),p.open?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",{key:0,onClick:ne},[r.createVNode(Ml,{class:"input-value"},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString($.value),1)]),_:1})])),C[5]||(C[5]=r.createTextVNode()),r.createElementVNode("div",rx,[y.value?(r.openBlock(),r.createBlock(r.unref(Lt),{key:0,name:"loading"})):r.createCommentVNode("",!0),C[1]||(C[1]=r.createTextVNode()),A.clearable&&R.value?(r.openBlock(),r.createBlock(r.unref(Co),{key:1,name:"delete-clear",onClick:r.withModifiers(Z,["stop"])})):r.createCommentVNode("",!0),C[2]||(C[2]=r.createTextVNode()),r.renderSlot(A.$slots,"append"),C[3]||(C[3]=r.createTextVNode()),A.arrowIconLarge?(r.openBlock(),r.createElementBlock("div",{key:2,class:r.normalizeClass(["arrow-icon",[`icon-24 ${A.arrowIconLarge}`]]),onClick:r.withModifiers(H,["stop"])},null,2)):A.arrowIcon?(r.openBlock(),r.createElementBlock("div",{key:3,class:r.normalizeClass(["arrow-icon",[`icon-16 ${A.arrowIcon}`]]),onClick:r.withModifiers(H,["stop"])},null,2)):(r.openBlock(),r.createElementBlock("div",{key:4,class:"arrow-icon arrow-icon-default",onClick:r.withModifiers(H,["stop"])}))])]),C[9]||(C[9]=r.createTextVNode()),A.label?(r.openBlock(),r.createElementBlock("label",ox,[A.required?(r.openBlock(),r.createElementBlock("i",ix)):r.createCommentVNode("",!0),C[6]||(C[6]=r.createTextVNode()),r.createElementVNode("span",null,r.toDisplayString(A.label),1),C[7]||(C[7]=r.createTextVNode()),r.unref(i).tooltip?(r.openBlock(),r.createBlock(r.unref(xt),{key:1,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.renderSlot(A.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0),C[10]||(C[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,(k,M)=>(r.openBlock(),r.createBlock(yo,{key:M,option:k,"is-selected":k.isSelected,"is-hovered":k.isActive,size:A.optionSize,onClick:r.withModifiers(W=>V(k.value),["stop"])},null,8,["option","is-selected","is-hovered","size","onClick"]))),128)),C[8]||(C[8]=r.createTextVNode()),F.value.length?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",sx,"Nothing found"))],512)):r.createCommentVNode("",!0),C[11]||(C[11]=r.createTextVNode()),r.createVNode(vr,{class:"ui-dropdown__contour"})])],42,Qb),C[12]||(C[12]=r.createTextVNode()),E.value?(r.openBlock(),r.createElementBlock("div",ax,r.toDisplayString(E.value),1)):y.value&&A.loadingOptionsHelper?(r.openBlock(),r.createElementBlock("div",lx,r.toDisplayString(A.loadingOptionsHelper),1)):A.helper?(r.openBlock(),r.createElementBlock("div",cx,r.toDisplayString(A.helper),1)):r.createCommentVNode("",!0)]))}}),px={key:0,class:"ui-progress-bar"},hx={class:"ui-progress-bar__messages d-flex align-center pl-6 pr-6"},fx={class:"ui-progress-bar__message flex-grow-1"},mx={class:"ui-progress-bar__percent"},gx=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",px,[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",hx,[r.createElementVNode("div",fx,r.toDisplayString(n.value),1),i[0]||(i[0]=r.createTextVNode()),r.createElementVNode("div",mx,r.toDisplayString(o.progress+"%"),1)])])):r.createCommentVNode("",!0)}}),yx={class:"mi-number-field__main-wrapper d-flex"},vx={class:"mi-number-field__wrapper flex-grow d-flex flex-align-center"},_x={key:0,class:"text-description"},Cx=["disabled","placeholder"],wx={class:"mi-number-field__icons d-flex-column"},bx={key:0,class:"mi-number-field__hint text-description"},xx=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();Xn(i);const d=r.ref(!0),p=r.computed({get(){return d.value&&n.modelValue!==void 0?new Number(n.modelValue).toString():""},set(b){var R;b=b.replace(/,/g,""),x(b)?(o("update:modelValue",+b),b.toString()!==((R=n.modelValue)==null?void 0:R.toString())&&+b===n.modelValue&&b[b.length-1]!=="."&&(d.value=!1,r.nextTick(()=>{d.value=!0}))):(b.trim()===""&&o("update:modelValue",void 0),d.value=!1,r.nextTick(()=>{d.value=!0}))}}),h=r.computed(()=>{let b=[];return n.errorMessage&&b.push(n.errorMessage),x(n.modelValue)?(n.minValue!==void 0&&n.modelValue!==void 0&&n.modelValue<n.minValue&&b.push(`Model value must be higher than ${n.minValue}`),n.maxValue!==void 0&&n.modelValue!==void 0&&n.modelValue>n.maxValue&&b.push(`Model value must be less than ${n.maxValue}`)):b.push("Model value is not a number."),b=[...b],b.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 x(b){return b!==void 0?(b=b==null?void 0:b.toString(),!isNaN(+b)&&!isNaN(parseFloat(b))):!1}function w(){if(!m.value){let b=0;n.modelValue===void 0?b=n.minValue?n.minValue:0:b=+(n.modelValue||0)+n.step,p.value=b.toString()}}function E(){if(!y.value){let b=0;n.modelValue===void 0?b=0:b=+(n.modelValue||0)-n.step,p.value=n.minValue?Math.max(n.minValue,b).toString():b.toString()}}function O(b){["ArrowDown","ArrowUp"].includes(b.code)&&b.preventDefault(),b.code==="ArrowUp"?w():b.code==="ArrowDown"&&E()}const $=b=>{b.detail>1&&b.preventDefault()};return(b,R)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"root",ref:i,class:r.normalizeClass([{error:!!h.value.trim(),disabled:b.disabled},"mi-number-field d-flex-column"]),onMousedown:$,onKeydown:R[1]||(R[1]=F=>O(F))},[r.createElementVNode("div",yx,[r.createVNode(vr,{class:"mi-number-field__contour"}),R[6]||(R[6]=r.createTextVNode()),r.createElementVNode("div",vx,[b.label?(r.openBlock(),r.createElementBlock("label",_x,[r.createTextVNode(r.toDisplayString(b.label)+" ",1),r.unref(l).tooltip?(r.openBlock(),r.createBlock(r.unref(xt),{key:0,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.renderSlot(b.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0),R[2]||(R[2]=r.createTextVNode()),r.withDirectives(r.createElementVNode("input",{ref_key:"input",ref:c,"onUpdate:modelValue":R[0]||(R[0]=F=>p.value=F),disabled:b.disabled,placeholder:b.placeholder,class:"text-s flex-grow"},null,8,Cx),[[r.vModelText,p.value]])]),R[7]||(R[7]=r.createTextVNode()),r.createElementVNode("div",wx,[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},R[3]||(R[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),R[5]||(R[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:E},R[4]||(R[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)])]),R[8]||(R[8]=r.createTextVNode()),h.value.trim()?(r.openBlock(),r.createElementBlock("div",bx,r.toDisplayString(h.value),1)):r.createCommentVNode("",!0)],34))}}),kx={class:"pl-chip__text"},Gl=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(xt),{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",kx,[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))}}),Sx={class:"pl-multi-dropdown__envelope"},Ex=["tabindex"],Tx={class:"pl-multi-dropdown__container"},Nx={class:"pl-multi-dropdown__field"},Ax=["disabled","placeholder"],Vx={class:"pl-multi-dropdown__append"},Bx={key:0},Px={key:0,class:"required-icon"},Rx={class:"pl-multi-dropdown__open-chips-container"},Dx={key:0,class:"nothing-found"},Ix={key:0,class:"pl-multi-dropdown__error"},Fx={key:1,class:"pl-multi-dropdown__helper"},Ox={name:"PlDropdownMulti"},Lx=r.defineComponent({...Ox,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=H=>n("update:modelValue",H),i=r.useSlots(),l=t,c=r.ref(),d=r.ref(),p=r.ref(),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),x=r.computed(()=>yr(l.options).filter(H=>Ll(m.value,H.value))),w=r.computed(()=>{const H=r.unref(m),J=yr(l.options);return(h.search?J.filter(G=>{const z=h.search.toLowerCase();return G.label.toLowerCase().includes(z)?!0:typeof G.value=="string"?G.value.toLowerCase().includes(z):G.value===h.search}):[...J]).map(G=>({...G,selected:Ll(H,G.value)}))}),E=r.computed(()=>l.disabled?void 0:"0"),O=()=>{h.activeOption=_i(w.value.findIndex(H=>Ot(H.value,l.modelValue)),H=>H<0?0:H)},$=H=>{var J;const G=r.unref(m);o(Ll(G,H)?G.filter(z=>!Ot(z,H)):[...G,H]),h.search="",(J=c==null?void 0:c.value)==null||J.focus()},b=H=>o(r.unref(m).filter(J=>!Ot(J,H))),R=()=>{var H;return(H=p.value)==null?void 0:H.focus()},F=()=>h.open=!h.open,D=H=>{var J,G;const z=H.relatedTarget;!((J=c.value)!=null&&J.contains(z))&&!((G=d.value)!=null&&G.contains(z))&&(h.search="",h.open=!1)},V=()=>{const H=d.value;H&&ut(H.querySelector(".hovered-item"),J=>{wi(H,J)})},Z=H=>{var J;const{open:G,activeOption:z}=h;if(!G){H.code==="Enter"&&(h.open=!0);return}H.code==="Escape"&&(h.open=!1,(J=c.value)==null||J.focus());const Q=r.unref(w),{length:A}=Q;if(!A)return;["ArrowDown","ArrowUp","Enter"].includes(H.code)&&H.preventDefault(),H.code==="Enter"&&$(Q[z].value);const C=H.code==="ArrowDown"?1:H.code==="ArrowUp"?-1:0;h.activeOption=Math.abs(z+C+A)%A,requestAnimationFrame(V)};Xn(c),r.watch(()=>l.modelValue,()=>O(),{immediate:!0}),r.watchPostEffect(()=>{h.search,h.open&&V()});const ne=r.reactive({top:"0px",left:"0px",width:"0px"});return r.watch(d,H=>{if(H){const J=H.getBoundingClientRect();h.optionsHeight=J.height,window.dispatchEvent(new CustomEvent("adjust"))}}),vo(c,H=>{const J=H.top+H.height+5;J+h.optionsHeight>H.clientHeight?ne.top=H.top-h.optionsHeight-5+"px":ne.top=J+"px",ne.left=H.left+"px",ne.width=H.width+"px"}),(H,J)=>(r.openBlock(),r.createElementBlock("div",Sx,[r.createElementVNode("div",{ref_key:"rootRef",ref:c,tabindex:E.value,class:r.normalizeClass(["pl-multi-dropdown",{open:h.open,error:H.error,disabled:H.disabled}]),onKeydown:Z,onFocusout:D},[r.createElementVNode("div",Tx,[r.createElementVNode("div",Nx,[r.withDirectives(r.createElementVNode("input",{ref_key:"input",ref:p,"onUpdate:modelValue":J[0]||(J[0]=G=>h.search=G),type:"text",tabindex:"-1",disabled:H.disabled,placeholder:y.value,spellcheck:"false",autocomplete:"chrome-off",onFocus:J[1]||(J[1]=G=>h.open=!0)},null,40,Ax),[[r.vModelText,h.search]]),J[3]||(J[3]=r.createTextVNode()),h.open?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",{key:0,class:"chips-container",onClick:R},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(x.value,(G,z)=>(r.openBlock(),r.createBlock(r.unref(Gl),{key:z,closeable:"",small:"",onClick:J[2]||(J[2]=r.withModifiers(Q=>h.open=!0,["stop"])),onClose:Q=>b(G.value)},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(G.label||G.value),1)]),_:2},1032,["onClose"]))),128))])),J[4]||(J[4]=r.createTextVNode()),r.createElementVNode("div",{class:"arrow",onClick:r.withModifiers(F,["stop"])}),J[5]||(J[5]=r.createTextVNode()),r.createElementVNode("div",Vx,[r.renderSlot(H.$slots,"append")])]),J[10]||(J[10]=r.createTextVNode()),H.label?(r.openBlock(),r.createElementBlock("label",Bx,[H.required?(r.openBlock(),r.createElementBlock("i",Px)):r.createCommentVNode("",!0),J[6]||(J[6]=r.createTextVNode()),r.createElementVNode("span",null,r.toDisplayString(H.label),1),J[7]||(J[7]=r.createTextVNode()),r.unref(i).tooltip?(r.openBlock(),r.createBlock(r.unref(xt),{key:1,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.renderSlot(H.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0),J[11]||(J[11]=r.createTextVNode()),h.open?(r.openBlock(),r.createBlock(r.Teleport,{key:1,to:"body"},[r.createElementVNode("div",{ref_key:"list",ref:d,class:"pl-multi-dropdown__options",style:r.normalizeStyle(ne),tabindex:"-1",onFocusout:D},[r.createElementVNode("div",Rx,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(x.value,(G,z)=>(r.openBlock(),r.createBlock(r.unref(Gl),{key:z,closeable:"",small:"",onClose:Q=>b(G.value)},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(G.label||G.value),1)]),_:2},1032,["onClose"]))),128))]),J[8]||(J[8]=r.createTextVNode()),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(w.value,(G,z)=>(r.openBlock(),r.createBlock(yo,{key:z,option:G,"text-item":"text","is-selected":G.selected,"is-hovered":h.activeOption==z,size:"medium","use-checkbox":"",onClick:r.withModifiers(Q=>$(G.value),["stop"])},null,8,["option","is-selected","is-hovered","onClick"]))),128)),J[9]||(J[9]=r.createTextVNode()),w.value.length?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",Dx,"Nothing found"))],36)])):r.createCommentVNode("",!0),J[12]||(J[12]=r.createTextVNode()),r.createVNode(vr,{class:"pl-multi-dropdown__contour"})])],42,Ex),J[13]||(J[13]=r.createTextVNode()),H.error?(r.openBlock(),r.createElementBlock("div",Ix,r.toDisplayString(H.error),1)):H.helper?(r.openBlock(),r.createElementBlock("div",Fx,r.toDisplayString(H.helper),1)):r.createCommentVNode("",!0)]))}}),$l=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))}}),Mx={name:"PlCheckbox"},Gx=r.defineComponent({...Mx,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($l,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($l,r.mergeProps({key:1},e,{"onUpdate:modelValue":i[2]||(i[2]=l=>o.$emit("update:modelValue",l))}),null,16))}}),$x={key:0},zx=["onClick"],Ux={name:"PlCheckboxGroup"},Zx=r.defineComponent({...Ux,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",$x,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($l,{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))}}),Wx="_component_tupwt_1",jx={component:Wx},Hx={};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 Kx={$style:jx},Xx=Zt(Hx,[["render",qx],["__cssModules",Kx]]),Yx={key:1,class:"pl-dialog-modal__title"},Jx={inheritAttrs:!1},zl=r.defineComponent({...Jx,__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(Xx,{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",Yx,[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})]))}}),Qx=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}))}}),ek={key:0,class:"pl-slide-modal__title"},tk={class:"pl-slide-modal__content"},nk={key:1,class:"pl-slide-modal__actions"},rk={name:"PlSlideModal",inheritAttrs:!1},Vs=r.defineComponent({...rk,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 As(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(Qx,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",ek,[r.renderSlot(d.$slots,"title")])):r.createCommentVNode("",!0),p[4]||(p[4]=r.createTextVNode()),r.createElementVNode("div",tk,[r.renderSlot(d.$slots,"default")]),p[5]||(p[5]=r.createTextVNode()),r.unref(n).actions?(r.openBlock(),r.createElementBlock("div",nk,[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)]))}}),ok={key:0,class:"label"},ik={name:"PlToggleSwitch"},Bs=r.defineComponent({...ik,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",ok,r.toDisplayString(e.label),1)):r.createCommentVNode("",!0)],34))}});function wp(t){return r.getCurrentScope()?(r.onScopeDispose(t),!0):!1}function sk(t){return r.unref(t)}const ak=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;function lk(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)},sk(e))}return o&&(i.value=!0,ak&&p()),wp(d),{isPending:r.readonly(i),start:p,stop:d}}function ck(t,e,n){return r.watch(t,(o,i,l)=>{o&&e(o,i,l)},{...n,once:!1})}function dk(t,e,n){const{start:o}=lk(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(),wp(d),{isActive:i,pause:d,resume:c}}const uk="[==PROGRESS==]";function pk(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function hk(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??uk,m=new TextDecoder().decode(p.data).replace(new RegExp(`${pk(h)}`,"g"),"");if(c=Object.assign(c,{lines:c.lines+m,lastOffset:p.newOffset,finished:!p.live}),p.newOffset>=p.size)break}}const i=dk(()=>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 ck(()=>{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 fk={key:0},mk={class:"pl-log-view__copy"},gk={key:1,class:"pl-log-view__error"},yk={name:"PlLogView"},bp=r.defineComponent({...yk,props:{value:{},logHandle:{},progressPrefix:{},error:{},output:{},maxRetries:{},mockPlatforma:{},label:{}},setup(t){const e=E=>{if(E&&E.ok===!1)return E.errors.join(`
53
+ `)},n=t,o=hk(n),i=r.ref(!0),l=r.ref(),c=r.ref(),d=r.computed(()=>{var E;return((E=o.value)==null?void 0:E.error)??n.error??e(n.output)}),p=r.computed(()=>{var E;return((E=o.value)==null?void 0:E.lines)??n.value??q_(n.output)}),h=r.ref(!1);Xn(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)},x=()=>{Zr(l.value,E=>{i.value&&E.scrollTo(E.scrollLeft,E.scrollHeight)})};r.watch(p,()=>{requestAnimationFrame(()=>{x()})},{immediate:!0});const w=E=>{const O=E.target;i.value=O.scrollTop+20>=O.scrollHeight-O.offsetHeight};return(E,O)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"root",ref:c,class:r.normalizeClass(["pl-log-view",{"has-error":d.value}])},[E.label?(r.openBlock(),r.createElementBlock("label",fk,r.toDisplayString(E.label),1)):r.createCommentVNode("",!0),O[1]||(O[1]=r.createTextVNode()),r.createVNode(vr,{class:"pl-log-view__contour"}),O[2]||(O[2]=r.createTextVNode()),r.createElementVNode("div",mk,[r.createVNode(r.unref(xt),{"close-delay":800,position:"top"},{tooltip:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(h.value?"copied":"copy"),1)]),default:r.withCtx(()=>[r.createVNode(r.unref(Lt),{title:"Copy content",name:m.value,onClick:y},null,8,["name"]),O[0]||(O[0]=r.createTextVNode())]),_:1})]),O[3]||(O[3]=r.createTextVNode()),d.value?(r.openBlock(),r.createElementBlock("div",gk,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",_k="_tab_1ukal_14",Ck="_disabled_1ukal_27",wk="_active_1ukal_56",bk="_topLine_1ukal_69",bo={component:vk,tab:_k,disabled:Ck,active:wk,topLine:bk},xk=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(xt),{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"]))}}),kk={name:"PlTabs"},Sk=r.defineComponent({...kk,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(xk,{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))}}),Ek=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))}}),Tk="_compact_rhd5u_16",Nk="_content_rhd5u_20",Ak={compact:Tk,content:Nk},Vk={$style:Ak},xp=Zt(Ek,[["__cssModules",Vk]]),Bk=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))}}),Pk=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}))}}),Rk=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=Uu(),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(xp),{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(fn),{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(Pk,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))}}),Dk="_content_jmjfk_2",Ik="_separator_jmjfk_14",Fk="_chevron_jmjfk_19",Ok="_down_jmjfk_23",Lk={content:Dk,separator:Ik,chevron:Fk,down:Ok},Mk={$style:Lk},Gk=Zt(Rk,[["__cssModules",Mk]]),$k="_component_1ietr_1",zk="_local_1ietr_1",Uk="_supported_1ietr_26",Zk="_remote_1ietr_32",Wk="_search_1ietr_40",jk="_selected_1ietr_72",Hk="_breadcrumbs_1ietr_86",qk="_cat_1ietr_116",Kk="_message_1ietr_122",Xk="_isFile_1ietr_197",Yk="_isDir_1ietr_201",Jk="_canBeSelected_1ietr_207",Qk="_spin_1ietr_1",ct={component:$k,local:zk,supported:Uk,remote:Zk,search:Wk,"ls-container":"_ls-container_1ietr_50","ls-head":"_ls-head_1ietr_57",selected:jk,breadcrumbs:Hk,"ls-error":"_ls-error_1ietr_108",cat:qk,message:Kk,"ls-empty":"_ls-empty_1ietr_131","ls-body":"_ls-body_1ietr_152",isFile:Xk,isDir:Yk,canBeSelected:Jk,"ls-loader":"_ls-loader_1ietr_213","loader-icon":"_loader-icon_1ietr_221",spin:Qk};function kp(t){return t?t.map(e=>"."+Y_(e,["."])):void 0}function eS(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 Sp=()=>({dirPath:"",search:"",storageEntry:void 0,items:[],error:"",storageOptions:[],selected:[],lastSelected:void 0,currentLoadingPath:void 0,showHiddenItems:!1});function tS(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 Ep={mounted:t=>{if(t.clientWidth<t.scrollWidth){const e=t.innerText;t.innerText=e.substring(0,57)+"..."+e.substring(e.length-10)}}},nS=["title","onClick"],rS={key:0,class:"ls-loader"},oS=["onClick"],iS=["title"],sS=["onClick"],aS=["title"],lS=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=t,o=r.reactive(Sp()),i=()=>{o.search="",o.error="",o.lastSelected=void 0},l=r.computed(()=>kp(n.extensions)),c=tS(o),d=r.computed(()=>{var D;return{modelValue:n.modelValue,dirPath:o.dirPath,storageHandle:(D=o.storageEntry)==null?void 0:D.handle}}),p=(D,V)=>{window.platforma&&o.currentLoadingPath!==V&&(o.currentLoadingPath=V,window.platforma.lsDriver.listFiles(D,V).then(Z=>{V===o.dirPath&&(o.items=ks(Z).entries.map(ne=>({path:ne.fullPath,name:ne.name,isDir:ne.type==="dir",canBeSelected:ne.type==="file"&&(!l.value||l.value.some(H=>ne.fullPath.endsWith(H))),handle:ne.type==="file"?ne.handle:void 0,selected:!1})).sort((ne,H)=>ne.isDir&&!H.isDir?-1:!ne.isDir&&H.isDir?1:ne.name.localeCompare(H.name)).map((ne,H)=>({id:H,...ne})),o.lastSelected=void 0)}).catch(Z=>o.error=String(Z)).finally(()=>{o.currentLoadingPath=void 0}))},h=()=>{i();const{storageHandle:D,dirPath:V,modelValue:Z}=d.value;D&&Z&&p(D,V)},m=r.computed(()=>eS(o.dirPath)),y=r.computed(()=>o.items.filter(D=>D.canBeSelected&&D.selected&&!D.isDir)),x=r.computed(()=>{var D;return y.value.length>0&&((D=o.storageEntry)==null?void 0:D.handle)}),w=()=>{var D;return{storageHandle:ks((D=o.storageEntry)==null?void 0:D.handle),files:y.value.map(V=>V.handle)}},E=D=>{o.dirPath=D},O=(D,V)=>{const{shiftKey:Z,metaKey:ne}=D,{lastSelected:H}=o;if(D.preventDefault(),V.canBeSelected){if(n.multi||o.items.forEach(J=>J.selected=!1),V.selected=!0,!n.multi)return;!ne&&!Z&&o.items.forEach(J=>{J.id!==V.id&&(J.selected=!1)}),Z&&H!==void 0&&o.items.forEach(J=>{W_(J.id,H,V.id)&&(J.selected=!0)}),V.selected&&(o.lastSelected=V.id)}},$=D=>{D&&!n.multi||o.items.filter(V=>V.canBeSelected).forEach(V=>{V.selected=D})},b=()=>$(!0),R=()=>$(!1),F=()=>{if(i(),R(),!window.platforma){console.warn("platforma API is not found");return}window.platforma.lsDriver.getStorageList().then(D=>{o.storageOptions=D.map(V=>({text:V.name,value:V})),n.autoSelectStorage&&Zr(D.find(V=>V.name==="local"||V.name.startsWith("local_disk_")&&V.initialFullPath.length>4),V=>{o.storageEntry=V})}).catch(D=>o.error=String(D))};return r.watch(r.toRef(o,"storageEntry"),D=>{i(),o.dirPath=(D==null?void 0:D.initialFullPath)??""},{immediate:!0}),r.watch([()=>o.dirPath,()=>o.storageEntry],()=>{h()}),r.watch(()=>n.modelValue,D=>{D?F():Object.assign(o,Sp())},{immediate:!0}),st(document,"keydown",D=>{n.modelValue&&D.target===document.body&&(D.metaKey&&D.code==="KeyA"&&(D.preventDefault(),b()),D.metaKey&&D.shiftKey&&D.code==="Period"&&(D.preventDefault(),o.showHiddenItems=!o.showHiddenItems),D.code==="Enter"&&n.submit())}),e({isReady:x,getFilesToImport:w}),r.onMounted(F),(D,V)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(r.unref(ct).remote),onClick:r.withModifiers(R,["stop"])},[r.createElementVNode("div",{class:r.normalizeClass(r.unref(ct).search)},[r.createElementVNode("div",null,[r.createVNode(r.unref(wo),{modelValue:o.storageEntry,"onUpdate:modelValue":V[0]||(V[0]=Z=>o.storageEntry=Z),label:"Select storage",options:o.storageOptions},null,8,["modelValue","options"])]),V[2]||(V[2]=r.createTextVNode()),r.createElementVNode("div",null,[r.createVNode(r.unref(gp),{modelValue:o.search,"onUpdate:modelValue":V[1]||(V[1]=Z=>o.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(m.value,(Z,ne)=>(r.openBlock(),r.createElementBlock(r.Fragment,{key:ne},[r.createElementVNode("div",{title:Z.path,onClick:H=>E(Z.path)},r.toDisplayString(Z.name),9,nS),V[3]||(V[3]=r.createTextVNode()),Z.index!==m.value.length-1?(r.openBlock(),r.createBlock(r.unref(Co),{key:0,name:"chevron-right"})):r.createCommentVNode("",!0)],64))),128))],2),V[4]||(V[4]=r.createTextVNode()),r.createElementVNode("div",{class:r.normalizeClass(r.unref(ct).selected)},"Selected: "+r.toDisplayString(y.value.length),3)],2),V[11]||(V[11]=r.createTextVNode()),o.currentLoadingPath!==void 0?(r.openBlock(),r.createElementBlock("div",rS,V[5]||(V[5]=[r.createElementVNode("i",{class:"mask-24 mask-loading loader-icon"},null,-1)]))):o.storageEntry?o.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[7]||(V[7]=r.createTextVNode()),r.createElementVNode("div",{class:r.normalizeClass(r.unref(ct).message)},r.toDisplayString(o.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(c),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:ne=>E(Z.path)},[V[8]||(V[8]=r.createElementVNode("i",{class:"icon-16 icon-chevron-right"},null,-1)),V[9]||(V[9]=r.createTextVNode()),r.withDirectives((r.openBlock(),r.createElementBlock("span",{title:Z.name},[r.createTextVNode(r.toDisplayString(Z.name),1)],8,iS)),[[r.unref(Ep)]])],10,oS)):(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(ne=>O(ne,Z),["stop"])},[r.createElementVNode("i",{class:r.normalizeClass(["mask-16 mask-box",r.unref(ct).isFile])},null,2),V[10]||(V[10]=r.createTextVNode()),r.withDirectives((r.openBlock(),r.createElementBlock("span",{title:Z.name},[r.createTextVNode(r.toDisplayString(Z.name),1)],8,aS)),[[r.unref(Ep)]])],10,sS))],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[6]||(V[6]=r.createTextVNode()),r.createElementVNode("div",{class:r.normalizeClass(r.unref(ct).message)},"Select storage to preview",2)],2))],2)],2))}}),cS={key:1,class:"alert-error"},dS=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=kp(e.extensions),x=await Promise.all([...((h=c.dataTransfer)==null?void 0:h.files)??[]].filter(w=>!!w).filter(w=>y?y.some(E=>w.name.endsWith(E)):!0).map(w=>m(w)));x.length&&e.importFiles({files:x})},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(Ci),{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",cS,r.toDisplayString(n.error),1)):r.createCommentVNode("",!0)],34))}}),uS={style:{margin:"0 24px"}},Tp=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,x;(y=p.value)!=null&&y.isReady&&(n("import:files",ks((x=p.value)==null?void 0:x.getFilesToImport())),d())},m=y=>{n("import:files",y),d()};return(y,x)=>(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(()=>[x[4]||(x[4]=r.createTextVNode()),r.createElementVNode("div",uS,[r.createVNode(r.unref(dp),{modelValue:i.value,"onUpdate:modelValue":x[0]||(x[0]=w=>i.value=w),options:c},null,8,["modelValue"])]),x[5]||(x[5]=r.createTextVNode()),i.value==="remote"?(r.openBlock(),r.createBlock(lS,r.mergeProps({key:0,ref:"remote"},y.$props,{submit:h}),null,16)):r.createCommentVNode("",!0),x[6]||(x[6]=r.createTextVNode()),i.value==="local"?(r.openBlock(),r.createBlock(dS,r.mergeProps({key:1,"import-files":m},y.$props),null,16)):r.createCommentVNode("",!0),x[7]||(x[7]=r.createTextVNode())]),_:2},[i.value==="remote"?{name:"actions",fn:r.withCtx(()=>{var w;return[r.createVNode(r.unref(Ns),{style:{"min-width":"160px"},disabled:!((w=r.unref(p))!=null&&w.isReady),onClick:r.withModifiers(h,["stop"])},{default:r.withCtx(()=>x[1]||(x[1]=[r.createTextVNode("Import")])),_:1},8,["disabled"]),x[3]||(x[3]=r.createTextVNode()),r.createVNode(r.unref(_o),{"justify-center":!1,onClick:r.withModifiers(d,["stop"])},{default:r.withCtx(()=>x[2]||(x[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 Ul;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(Ul||(Ul={}));const ce=$e.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),_r=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"]),pS=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 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 Np=xo;function hS(t){Np=t}function Ps(){return Np}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}},fS=[];function ae(t,e){const n=Ps(),o=Rs({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 kt{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 kt.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}),Vt=t=>({status:"valid",value:t}),Zl=t=>t.status==="aborted",Wl=t=>t.status==="dirty",bi=t=>t.status==="valid",xi=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 Ap(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 ki,Si;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 Vp=(t,e)=>{if(bi(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:(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 _r(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:_r(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new kt,ctx:{common:e.parent.common,data:e.data,parsedType:_r(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const n=this._parse(e);if(xi(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:_r(e)},l=this._parseSync({data:e,path:i.path,parent:i});return Vp(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:_r(e)},i=this._parse({data:e,path:o.path,parent:o}),l=await(xi(i)?i:Promise.resolve(i));return Vp(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 kr.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 Ai.create([this,e],this._def)}and(e){return Vi.create(this,e,this._def)}transform(e){return new yn({...Ve(this._def),schema:this,typeName:we.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new Ii({...Ve(this._def),innerType:this,defaultValue:n,typeName:we.ZodDefault})}brand(){return new ql({typeName:we.ZodBranded,type:this,...Ve(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new Fi({...Ve(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 Oi.create(this,e)}readonly(){return Li.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const mS=/^c[^\s-]{8,}$/i,gS=/^[0-9a-z]+$/,yS=/^[0-9A-HJKMNP-TV-Z]{26}$/,vS=/^[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,_S=/^[a-z0-9_-]{21}$/i,CS=/^[-+]?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)?)??$/,wS=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,bS="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let jl;const xS=/^(?:(?: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])$/,kS=/^(([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})))$/,SS=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Bp="((\\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])))",ES=new RegExp(`^${Bp}$`);function Pp(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 TS(t){return new RegExp(`^${Pp(t)}$`)}function Rp(t){let e=`${Bp}T${Pp(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 NS(t,e){return!!((e==="v4"||!e)&&xS.test(t)||(e==="v6"||!e)&&kS.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 ae(i,{code:te.invalid_type,expected:ce.string,received:i.parsedType}),xe}const n=new kt;let o;for(const i of this._def.checks)if(i.kind==="min")e.data.length<i.value&&(o=this._getOrReturnCtx(e,o),ae(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),ae(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?ae(o,{code:te.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):c&&ae(o,{code:te.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),n.dirty())}else if(i.kind==="email")wS.test(e.data)||(o=this._getOrReturnCtx(e,o),ae(o,{validation:"email",code:te.invalid_string,message:i.message}),n.dirty());else if(i.kind==="emoji")jl||(jl=new RegExp(bS,"u")),jl.test(e.data)||(o=this._getOrReturnCtx(e,o),ae(o,{validation:"emoji",code:te.invalid_string,message:i.message}),n.dirty());else if(i.kind==="uuid")vS.test(e.data)||(o=this._getOrReturnCtx(e,o),ae(o,{validation:"uuid",code:te.invalid_string,message:i.message}),n.dirty());else if(i.kind==="nanoid")_S.test(e.data)||(o=this._getOrReturnCtx(e,o),ae(o,{validation:"nanoid",code:te.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid")mS.test(e.data)||(o=this._getOrReturnCtx(e,o),ae(o,{validation:"cuid",code:te.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid2")gS.test(e.data)||(o=this._getOrReturnCtx(e,o),ae(o,{validation:"cuid2",code:te.invalid_string,message:i.message}),n.dirty());else if(i.kind==="ulid")yS.test(e.data)||(o=this._getOrReturnCtx(e,o),ae(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),ae(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),ae(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),ae(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),ae(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),ae(o,{code:te.invalid_string,validation:{endsWith:i.value},message:i.message}),n.dirty()):i.kind==="datetime"?Rp(i).test(e.data)||(o=this._getOrReturnCtx(e,o),ae(o,{code:te.invalid_string,validation:"datetime",message:i.message}),n.dirty()):i.kind==="date"?ES.test(e.data)||(o=this._getOrReturnCtx(e,o),ae(o,{code:te.invalid_string,validation:"date",message:i.message}),n.dirty()):i.kind==="time"?TS(i).test(e.data)||(o=this._getOrReturnCtx(e,o),ae(o,{code:te.invalid_string,validation:"time",message:i.message}),n.dirty()):i.kind==="duration"?CS.test(e.data)||(o=this._getOrReturnCtx(e,o),ae(o,{validation:"duration",code:te.invalid_string,message:i.message}),n.dirty()):i.kind==="ip"?NS(e.data,i.version)||(o=this._getOrReturnCtx(e,o),ae(o,{validation:"ip",code:te.invalid_string,message:i.message}),n.dirty()):i.kind==="base64"?SS.test(e.data)||(o=this._getOrReturnCtx(e,o),ae(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,...Ve(t)})};function AS(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 Cr 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 ae(i,{code:te.invalid_type,expected:ce.number,received:i.parsedType}),xe}let n;const o=new kt;for(const i of this._def.checks)i.kind==="int"?$e.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),ae(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),ae(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),ae(n,{code:te.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),o.dirty()):i.kind==="multipleOf"?AS(e.data,i.value)!==0&&(n=this._getOrReturnCtx(e,n),ae(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),ae(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 Cr({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:o,message:me.toString(i)}]})}_addCheck(e){return new Cr({...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)}}Cr.create=t=>new Cr({checks:[],typeName:we.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...Ve(t)});class wr 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 ae(i,{code:te.invalid_type,expected:ce.bigint,received:i.parsedType}),xe}let n;const o=new kt;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),ae(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),ae(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),ae(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 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]})}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}}wr.create=t=>{var e;return new wr({checks:[],typeName:we.ZodBigInt,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...Ve(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 ae(n,{code:te.invalid_type,expected:ce.boolean,received:n.parsedType}),xe}return Vt(e.data)}}Ei.create=t=>new Ei({typeName:we.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...Ve(t)});class jr 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 ae(i,{code:te.invalid_type,expected:ce.date,received:i.parsedType}),xe}if(isNaN(e.data.getTime())){const i=this._getOrReturnCtx(e);return ae(i,{code:te.invalid_date}),xe}const n=new kt;let o;for(const i of this._def.checks)i.kind==="min"?e.data.getTime()<i.value&&(o=this._getOrReturnCtx(e,o),ae(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),ae(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 jr({...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}}jr.create=t=>new jr({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:we.ZodDate,...Ve(t)});class Fs extends Re{_parse(e){if(this._getType(e)!==ce.symbol){const n=this._getOrReturnCtx(e);return ae(n,{code:te.invalid_type,expected:ce.symbol,received:n.parsedType}),xe}return Vt(e.data)}}Fs.create=t=>new Fs({typeName:we.ZodSymbol,...Ve(t)});class Ti extends Re{_parse(e){if(this._getType(e)!==ce.undefined){const n=this._getOrReturnCtx(e);return ae(n,{code:te.invalid_type,expected:ce.undefined,received:n.parsedType}),xe}return Vt(e.data)}}Ti.create=t=>new Ti({typeName:we.ZodUndefined,...Ve(t)});class Ni extends Re{_parse(e){if(this._getType(e)!==ce.null){const n=this._getOrReturnCtx(e);return ae(n,{code:te.invalid_type,expected:ce.null,received:n.parsedType}),xe}return Vt(e.data)}}Ni.create=t=>new Ni({typeName:we.ZodNull,...Ve(t)});class ko extends Re{constructor(){super(...arguments),this._any=!0}_parse(e){return Vt(e.data)}}ko.create=t=>new ko({typeName:we.ZodAny,...Ve(t)});class Hr extends Re{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Vt(e.data)}}Hr.create=t=>new Hr({typeName:we.ZodUnknown,...Ve(t)});class Yn extends Re{_parse(e){const n=this._getOrReturnCtx(e);return ae(n,{code:te.invalid_type,expected:ce.never,received:n.parsedType}),xe}}Yn.create=t=>new Yn({typeName:we.ZodNever,...Ve(t)});class Os extends Re{_parse(e){if(this._getType(e)!==ce.undefined){const n=this._getOrReturnCtx(e);return ae(n,{code:te.invalid_type,expected:ce.void,received:n.parsedType}),xe}return Vt(e.data)}}Os.create=t=>new Os({typeName:we.ZodVoid,...Ve(t)});class gn extends Re{_parse(e){const{ctx:n,status:o}=this._processInputParams(e),i=this._def;if(n.parsedType!==ce.array)return ae(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)&&(ae(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&&(ae(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&&(ae(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=>kt.mergeArray(o,c));const l=[...n.data].map((c,d)=>i.type._parseSync(new Mn(n,c,n.path,d)));return kt.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,...Ve(e)});function So(t){if(t instanceof rt){const e={};for(const n in t.shape){const o=t.shape[n];e[n]=$n.create(So(o))}return new rt({...t._def,shape:()=>e})}else return t instanceof gn?new gn({...t._def,type:So(t.element)}):t instanceof $n?$n.create(So(t.unwrap())):t instanceof kr?kr.create(So(t.unwrap())):t instanceof Gn?Gn.create(t.items.map(e=>So(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 ae(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 Yn&&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 Yn){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&&(ae(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=>kt.mergeObjectSync(n,p)):kt.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 So(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 Dp($e.objectKeys(this.shape))}}rt.create=(t,e)=>new rt({shape:()=>t,unknownKeys:"strip",catchall:Yn.create(),typeName:we.ZodObject,...Ve(e)}),rt.strictCreate=(t,e)=>new rt({shape:()=>t,unknownKeys:"strict",catchall:Yn.create(),typeName:we.ZodObject,...Ve(e)}),rt.lazycreate=(t,e)=>new rt({shape:t,unknownKeys:"strip",catchall:Yn.create(),typeName:we.ZodObject,...Ve(e)});class Ai 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 ae(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 ae(n,{code:te.invalid_union,unionErrors:d}),xe}}get options(){return this._def.options}}Ai.create=(t,e)=>new Ai({options:t,typeName:we.ZodUnion,...Ve(e)});const br=t=>t instanceof Pi?br(t.schema):t instanceof yn?br(t.innerType()):t instanceof Ri?[t.value]:t instanceof xr?t.options:t instanceof Di?$e.objectValues(t.enum):t instanceof Ii?br(t._def.innerType):t instanceof Ti?[void 0]:t instanceof Ni?[null]:t instanceof $n?[void 0,...br(t.unwrap())]:t instanceof kr?[null,...br(t.unwrap())]:t instanceof ql||t instanceof Li?br(t.unwrap()):t instanceof Fi?br(t._def.innerType):[];class Ls extends Re{_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==ce.object)return ae(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}):(ae(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=br(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 Ls({typeName:we.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:i,...Ve(o)})}}function Hl(t,e){const n=_r(t),o=_r(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=Hl(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=Hl(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(Zl(l)||Zl(c))return xe;const d=Hl(l.value,c.value);return d.valid?((Wl(l)||Wl(c))&&n.dirty(),{status:n.value,value:d.data}):(ae(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,...Ve(n)});class Gn extends Re{_parse(e){const{status:n,ctx:o}=this._processInputParams(e);if(o.parsedType!==ce.array)return ae(o,{code:te.invalid_type,expected:ce.array,received:o.parsedType}),xe;if(o.data.length<this._def.items.length)return ae(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&&(ae(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=>kt.mergeArray(n,l)):kt.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,...Ve(e)})};class Bi 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 ae(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?kt.mergeObjectAsync(n,i):kt.mergeObjectSync(n,i)}get element(){return this._def.valueType}static create(e,n,o){return n instanceof Re?new Bi({keyType:e,valueType:n,typeName:we.ZodRecord,...Ve(o)}):new Bi({keyType:mn.create(),valueType:e,typeName:we.ZodRecord,...Ve(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 ae(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,...Ve(n)});class qr extends Re{_parse(e){const{status:n,ctx:o}=this._processInputParams(e);if(o.parsedType!==ce.set)return ae(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&&(ae(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&&(ae(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 qr({...this._def,minSize:{value:e,message:me.toString(n)}})}max(e,n){return new qr({...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)}}qr.create=(t,e)=>new qr({valueType:t,minSize:null,maxSize:null,typeName:we.ZodSet,...Ve(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 ae(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(),xo].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(),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 Vt(async function(...p){const h=new Wt([]),m=await d._def.args.parseAsync(p,l).catch(x=>{throw h.addIssue(o(p,x)),h}),y=await Reflect.apply(c,this,m);return await d._def.returns._def.type.parseAsync(y,l).catch(x=>{throw h.addIssue(i(y,x)),h})})}else{const d=this;return Vt(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(Hr.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(Hr.create()),returns:n||Hr.create(),typeName:we.ZodFunction,...Ve(o)})}}class Pi 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})}}Pi.create=(t,e)=>new Pi({getter:t,typeName:we.ZodLazy,...Ve(e)});class Ri extends Re{_parse(e){if(e.data!==this._def.value){const n=this._getOrReturnCtx(e);return ae(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}}Ri.create=(t,e)=>new Ri({value:t,typeName:we.ZodLiteral,...Ve(e)});function Dp(t,e){return new xr({values:t,typeName:we.ZodEnum,...Ve(e)})}class xr extends Re{constructor(){super(...arguments),ki.set(this,void 0)}_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),o=this._def.values;return ae(n,{expected:$e.joinValues(o),received:n.parsedType,code:te.invalid_type}),xe}if(Is(this,ki)||Ap(this,ki,new Set(this._def.values)),!Is(this,ki).has(e.data)){const n=this._getOrReturnCtx(e),o=this._def.values;return ae(n,{received:n.data,code:te.invalid_enum_value,options:o}),xe}return Vt(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 xr.create(e,{...this._def,...n})}exclude(e,n=this._def){return xr.create(this.options.filter(o=>!e.includes(o)),{...this._def,...n})}}ki=new WeakMap,xr.create=Dp;class Di extends Re{constructor(){super(...arguments),Si.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 ae(o,{expected:$e.joinValues(i),received:o.parsedType,code:te.invalid_type}),xe}if(Is(this,Si)||Ap(this,Si,new Set($e.getValidEnumValues(this._def.values))),!Is(this,Si).has(e.data)){const i=$e.objectValues(n);return ae(o,{received:o.data,code:te.invalid_enum_value,options:i}),xe}return Vt(e.data)}get enum(){return this._def.values}}Si=new WeakMap,Di.create=(t,e)=>new Di({values:t,typeName:we.ZodNativeEnum,...Ve(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 ae(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 Vt(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,...Ve(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=>{ae(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(!bi(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=>bi(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,...Ve(n)}),yn.createWithPreprocess=(t,e,n)=>new yn({schema:e,effect:{type:"preprocess",transform:t},typeName:we.ZodEffects,...Ve(n)});class $n extends Re{_parse(e){return this._getType(e)===ce.undefined?Vt(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}$n.create=(t,e)=>new $n({innerType:t,typeName:we.ZodOptional,...Ve(e)});class kr extends Re{_parse(e){return this._getType(e)===ce.null?Vt(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}kr.create=(t,e)=>new kr({innerType:t,typeName:we.ZodNullable,...Ve(e)});class Ii 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}}Ii.create=(t,e)=>new Ii({innerType:t,typeName:we.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Ve(e)});class Fi 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 xi(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}}Fi.create=(t,e)=>new Fi({innerType:t,typeName:we.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Ve(e)});class Gs extends Re{_parse(e){if(this._getType(e)!==ce.nan){const n=this._getOrReturnCtx(e);return ae(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,...Ve(t)});const VS=Symbol("zod_brand");class ql 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 Oi 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 Oi({in:e,out:n,typeName:we.ZodPipeline})}}class Li extends Re{_parse(e){const n=this._def.innerType._parse(e),o=i=>(bi(i)&&(i.value=Object.freeze(i.value)),i);return xi(n)?n.then(i=>o(i)):o(n)}unwrap(){return this._def.innerType}}Li.create=(t,e)=>new Li({innerType:t,typeName:we.ZodReadonly,...Ve(e)});function Ip(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 BS={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 PS=(t,e={message:`Input not instance of ${t.name}`})=>Ip(n=>n instanceof t,e),Fp=mn.create,Op=Cr.create,RS=Gs.create,DS=wr.create,Lp=Ei.create,IS=jr.create,FS=Fs.create,OS=Ti.create,LS=Ni.create,MS=ko.create,GS=Hr.create,$S=Yn.create,zS=Os.create,US=gn.create,ZS=rt.create,WS=rt.strictCreate,jS=Ai.create,HS=Ls.create,qS=Vi.create,KS=Gn.create,XS=Bi.create,YS=Ms.create,JS=qr.create,QS=Eo.create,eE=Pi.create,tE=Ri.create,nE=xr.create,rE=Di.create,oE=To.create,Mp=yn.create,iE=$n.create,sE=kr.create,aE=yn.createWithPreprocess,lE=Oi.create;var zn=Object.freeze({__proto__:null,defaultErrorMap:xo,setErrorMap:hS,getErrorMap:Ps,makeIssue:Rs,EMPTY_PATH:fS,addIssueToContext:ae,ParseStatus:kt,INVALID:xe,DIRTY:Ds,OK:Vt,isAborted:Zl,isDirty:Wl,isValid:bi,isAsync:xi,get util(){return $e},get objectUtil(){return Ul},ZodParsedType:ce,getParsedType:_r,ZodType:Re,datetimeRegex:Rp,ZodString:mn,ZodNumber:Cr,ZodBigInt:wr,ZodBoolean:Ei,ZodDate:jr,ZodSymbol:Fs,ZodUndefined:Ti,ZodNull:Ni,ZodAny:ko,ZodUnknown:Hr,ZodNever:Yn,ZodVoid:Os,ZodArray:gn,ZodObject:rt,ZodUnion:Ai,ZodDiscriminatedUnion:Ls,ZodIntersection:Vi,ZodTuple:Gn,ZodRecord:Bi,ZodMap:Ms,ZodSet:qr,ZodFunction:Eo,ZodLazy:Pi,ZodLiteral:Ri,ZodEnum:xr,ZodNativeEnum:Di,ZodPromise:To,ZodEffects:yn,ZodTransformer:yn,ZodOptional:$n,ZodNullable:kr,ZodDefault:Ii,ZodCatch:Fi,ZodNaN:Gs,BRAND:VS,ZodBranded:ql,ZodPipeline:Oi,ZodReadonly:Li,custom:Ip,Schema:Re,ZodSchema:Re,late:BS,get ZodFirstPartyTypeKind(){return we},coerce:{string:t=>mn.create({...t,coerce:!0}),number:t=>Cr.create({...t,coerce:!0}),boolean:t=>Ei.create({...t,coerce:!0}),bigint:t=>wr.create({...t,coerce:!0}),date:t=>jr.create({...t,coerce:!0})},any:MS,array:US,bigint:DS,boolean:Lp,date:IS,discriminatedUnion:HS,effect:Mp,enum:nE,function:QS,instanceof:PS,intersection:qS,lazy:eE,literal:tE,map:YS,nan:RS,nativeEnum:rE,never:$S,null:LS,nullable:sE,number:Op,object:ZS,oboolean:()=>Lp().optional(),onumber:()=>Op().optional(),optional:iE,ostring:()=>Fp().optional(),pipeline:lE,preprocess:aE,promise:oE,record:XS,set:JS,strictObject:WS,string:Fp,symbol:FS,transformer:Mp,tuple:KS,undefined:OS,union:jS,unknown:GS,void:zS,NEVER:xe,ZodIssueCode:te,quotelessJson:pS,ZodError:Wt});function cE(t){throw new Error("Unexpected object: "+t)}const Gp="upload://upload/",$p="index://index/";function dE(t){return t.startsWith(Gp)}function uE(t){return t.startsWith($p)}function zp(t){if(uE(t)){const e=t.slice($p.length);return JSON.parse(decodeURIComponent(e)).path}else if(dE(t)){const e=t.slice(Gp.length);return JSON.parse(decodeURIComponent(e)).localPath}cE(t)}function pE(t){return t.replace(/^.*[\\/]/,"")}function hE(t){return pE(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 fE=zn.object({type:zn.string(),importance:zn.number().optional(),id:zn.string().optional(),label:zn.string()});zn.array(fE);const mE={key:0,ref:"label"},gE={key:0,class:"required-icon"},yE=["data-placeholder"],vE={key:5,class:"pl-file-input__stats"},_E={key:0,class:"pl-file-input__error"},CE={key:1,class:"pl-file-input__helper"},Up=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,D)=>{if(F)try{return D(F)}catch(V){return n.error=V instanceof Error?V.message:String(V),F}},d=r.computed(()=>c(l.modelValue,hE)),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),x=r.computed(()=>!!y.value),w=r.computed(()=>{const{status:F,done:D}=l.progress??{};return!F||!F.bytesTotal?"":F.bytesProcessed&&!D?xl(F.bytesProcessed,{})+" / "+xl(F.bytesTotal,{}):xl(F.bytesTotal,{})}),E=r.computed(()=>{var F;const{progress:D}=l;return D?{width:D.done?"100%":Math.round((((F=D.status)==null?void 0:F.progress)??0)*100)+"%"}:{}}),O=()=>{n.fileDialogOpen=!0},$=F=>{F.files.length&&i("update:modelValue",F.files[0])},b=()=>i("update:modelValue",void 0);r.watch(()=>l.modelValue,()=>{n.error=""},{immediate:!0});const R=r.ref();return l.cellStyle||Xn(R),(F,D)=>(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:R,class:r.normalizeClass(["pl-file-input",{dashed:F.dashed,error:x.value}]),tabindex:"0",onKeyup:r.withKeys(O,["enter"]),onClick:r.withModifiers(O,["stop"])},[r.createElementVNode("div",{class:"pl-file-input__progress",style:r.normalizeStyle(E.value)},null,4),D[3]||(D[3]=r.createTextVNode()),!F.cellStyle&&F.label?(r.openBlock(),r.createElementBlock("label",mE,[F.required?(r.openBlock(),r.createElementBlock("i",gE)):r.createCommentVNode("",!0),D[1]||(D[1]=r.createTextVNode()),r.createElementVNode("span",null,r.toDisplayString(F.label),1),D[2]||(D[2]=r.createTextVNode()),r.unref(o).tooltip||p.value?(r.openBlock(),r.createBlock(r.unref(xt),{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),D[4]||(D[4]=r.createTextVNode()),x.value?(r.openBlock(),r.createBlock(r.unref(Lt),{key:1,name:"restart"})):h.value?(r.openBlock(),r.createBlock(r.unref(Lt),{key:2,name:"cloud-upload"})):m.value?(r.openBlock(),r.createBlock(r.unref(Lt),{key:3,name:"success"})):(r.openBlock(),r.createBlock(r.unref(Lt),{key:4,name:"paper-clip"})),D[5]||(D[5]=r.createTextVNode()),r.createElementVNode("div",{"data-placeholder":F.placeholder??"Choose file",class:"pl-file-input__filename"},r.toDisplayString(d.value),9,yE),D[6]||(D[6]=r.createTextVNode()),w.value?(r.openBlock(),r.createElementBlock("div",vE,r.toDisplayString(w.value),1)):r.createCommentVNode("",!0),D[7]||(D[7]=r.createTextVNode()),F.modelValue?(r.openBlock(),r.createBlock(r.unref(Lt),{key:6,name:"close",onClick:r.withModifiers(b,["stop"])})):r.createCommentVNode("",!0),D[8]||(D[8]=r.createTextVNode()),r.createVNode(vr,{class:"pl-file-input__contour"})],34),D[9]||(D[9]=r.createTextVNode()),x.value?(r.openBlock(),r.createElementBlock("div",_E,r.toDisplayString(y.value),1)):F.helper?(r.openBlock(),r.createElementBlock("div",CE,r.toDisplayString(F.helper),1)):r.createCommentVNode("",!0)],2),D[10]||(D[10]=r.createTextVNode()),r.createVNode(r.unref(Tp),{modelValue:n.fileDialogOpen,"onUpdate:modelValue":D[0]||(D[0]=V=>n.fileDialogOpen=V),extensions:F.extensions,title:F.fileDialogTitle,"close-on-outside-click":F.fileDialogCloseOnOutsideClick,"onImport:files":$},null,8,["modelValue","extensions","title","close-on-outside-click"])],64))}}),wE={class:"pl-notification-alert__wrapper d-flex"},bE={class:"pl-notification-alert__content flex-grow-1"},xE={key:0,class:"pl-notification-alert__close"},kE={key:0,class:"pl-notification-alert__actions d-flex"},Zp=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",wE,[r.createElementVNode("div",bE,[r.renderSlot(i.$slots,"default")]),l[0]||(l[0]=r.createTextVNode()),i.closable?(r.openBlock(),r.createElementBlock("div",xE,[r.createVNode(r.unref(_o),{icon:"close",onClick:o})])):r.createCommentVNode("",!0)]),l[1]||(l[1]=r.createTextVNode()),i.$slots.actions?(r.openBlock(),r.createElementBlock("div",kE,[r.renderSlot(i.$slots,"actions")])):r.createCommentVNode("",!0)],6)):r.createCommentVNode("",!0)}}),SE=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 St(t,e,n){return e>t?e:t>n?n:t}const Kl=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-(St(l,n,o)-n)/(o-n))*100;e.push(c)}return e}),EE={class:"ui-slider__wrapper"},TE={class:"ui-slider__label-section"},NE={key:0,class:"text-s"},AE={key:1,class:"ui-slider__value-static text-s"},VE={class:"ui-slider__base"},BE={class:"ui-slider__container"},PE={class:"ui-slider__container ui-slider__container-thumb"},RE={class:"ui-slider__input-wrapper d-flex"},DE=["value"],IE={key:0,class:"ui-slider__error"},Wp=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(()=>St((i.modelValue??0)+l.deltaValue,i.min,i.max)),p=r.ref(i.modelValue),h=r.computed(()=>{const V=i.modelValue;return Number.isFinite(V)?V<i.min?`Min value: ${i.min}`:V>i.max?`Max value: ${i.max}`:i.error:"Not a number"}),m=r.computed(()=>i),y=Kl(m),x=r.computed(()=>(d.value-i.min)/c.value),w=r.computed(()=>({right:Math.ceil((1-x.value)*100)+"%"})),E=r.computed(()=>({right:`calc(${Math.ceil((1-x.value)*100)}%) `})),O=r.ref(),$=r.ref();r.watch(()=>i.modelValue,V=>{p.value=V});function b(V){const Z=St(V,i.min,i.max);return Math.round((Z+Number.EPSILON)*(1/i.step))/(1/i.step)}gr($,V=>{var Z;ut((Z=r.unref(O))==null?void 0:Z.getBoundingClientRect(),ne=>{const{dx:H}=V;l.deltaValue=H/ne.width*c.value,p.value=b(St((i.modelValue??0)+l.deltaValue,i.min,i.max)),V.stop&&(o("update:modelValue",b(d.value)),l.deltaValue=0)})});function R(V){o("update:modelValue",b(V))}function F(V){R(+V.target.value)}function D(V){["ArrowDown","ArrowUp","ArrowRight","ArrowLeft","Enter"].includes(V.code)&&V.preventDefault();const Z=V.code==="ArrowUp"||V.code==="ArrowRight"?i.step*1:V.code==="ArrowDown"||V.code==="ArrowLeft"?i.step*-1:0;R(i.modelValue+Z)}return(V,Z)=>(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",EE,[r.createElementVNode("div",TE,[V.label?(r.openBlock(),r.createElementBlock("label",NE,[r.createElementVNode("span",null,r.toDisplayString(V.label),1),Z[1]||(Z[1]=r.createTextVNode()),r.unref(n).tooltip?(r.openBlock(),r.createBlock(r.unref(xt),{key:0,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.renderSlot(V.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0),Z[2]||(Z[2]=r.createTextVNode()),i.mode==="text"?(r.openBlock(),r.createElementBlock("div",AE,r.toDisplayString(p.value)+r.toDisplayString(V.measure),1)):r.createCommentVNode("",!0)]),Z[6]||(Z[6]=r.createTextVNode()),r.createElementVNode("div",VE,[r.createElementVNode("div",BE,[r.createElementVNode("div",{ref_key:"barRef",ref:O,class:"ui-slider__bar"},[r.createElementVNode("div",{class:"ui-slider__progress",style:r.normalizeStyle(w.value)},null,4)],512)]),Z[5]||(Z[5]=r.createTextVNode()),r.createElementVNode("div",PE,[i.breakpoints?(r.openBlock(!0),r.createElementBlock(r.Fragment,{key:0},r.renderList(r.unref(y),(ne,H)=>(r.openBlock(),r.createElementBlock("div",{key:H,style:r.normalizeStyle({right:`${ne}%`}),class:"ui-slider__thumb-step"},null,4))),128)):r.createCommentVNode("",!0),Z[4]||(Z[4]=r.createTextVNode()),r.createElementVNode("div",{ref_key:"thumbRef",ref:$,tabindex:"0",class:"ui-slider__thumb ui-slider__thumb-active",style:r.normalizeStyle(E.value),onKeydown:D},Z[3]||(Z[3]=[r.createElementVNode("div",{class:"ui-slider__thumb-focused-contour"},null,-1)]),36)])])]),Z[7]||(Z[7]=r.createTextVNode()),r.createElementVNode("div",RE,[i.mode==="input"?(r.openBlock(),r.createElementBlock("input",{key:0,value:p.value,class:"ui-slider__value text-s",onChange:Z[0]||(Z[0]=ne=>F(ne))},null,40,DE)):r.createCommentVNode("",!0)])],2),Z[8]||(Z[8]=r.createTextVNode()),h.value?(r.openBlock(),r.createElementBlock("div",IE,r.toDisplayString(h.value),1)):r.createCommentVNode("",!0)],2))}});function FE(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,x=p>e?e:0,w=y>e?m-e-x:m;return`linear-gradient(
54
54
  to bottom,
55
55
  transparent,
56
56
  black ${x}px,
57
- black ${S}px,
57
+ black ${w}px,
58
58
  transparent 100%
59
- )`}function s(u){const{scrollLeft:p,scrollWidth:f,clientWidth:m}=u;if(!(f>m)||!n)return null;const _=f-p-m,x=p>n?n:0,S=_>n?m-n-x:m;return`linear-gradient(
59
+ )`}function i(d){const{scrollLeft:p,scrollWidth:h,clientWidth:m}=d;if(!(h>m)||!n)return null;const y=h-p-m,x=p>n?n:0,w=y>n?m-n-x:m;return`linear-gradient(
60
60
  to right,
61
61
  transparent,
62
62
  black ${x}px,
63
- black ${S}px,
63
+ black ${w}px,
64
64
  transparent 100%
65
- )`}function l(){const u=t.value;if(!u)return;const p=[o(u),s(u)].filter(f=>f!==null);u.style.setProperty("-webkit-mask-image",p.join(",")),u.style.setProperty("mask-image",p.join(",")),p.length>1&&(u.style.setProperty("-webkit-mask-composite","source-in"),u.style.setProperty("mask-composite","source-in"))}const c=ul(l);r.onMounted(l),nt(window,"scroll",c,!0),nt(window,"resize",c,!0)}function hp(t,e){Pu(()=>{at(r.unref(t),n=>{Du(n,()=>e(n))})}),r.onUnmounted(()=>{at(r.unref(t),n=>{Fu(n)})})}const gr={item:"sortable__item",animate:"sortable__animate"},Ai=t=>t.getBoundingClientRect().y,fp=t=>{const{y:e,height:n}=t.getBoundingClientRect();return e+Math.ceil(n/2)},PS=t=>{const{y:e,height:n}=t.getBoundingClientRect();return e+n};function mp(t,e){const n={item:void 0,options(){var S;return[...((S=t.value)==null?void 0:S.children)??[]]}},o=r.computed(()=>n.options()),s=e.shakeBuffer??10,l=e.reorderDelay??100;function c(S){const V=e.handle?this.querySelector(e.handle):null;V&&(V&&!V.contains(S.target)||(this.classList.remove(gr.animate),this.classList.add(gr.item),n.item={el:this,y:S.y,dy:0,orderChanged:!1}))}function u(S){const V=n.options();return V.slice(0,V.indexOf(S))}function p(S){const V=n.options();return V.slice(V.indexOf(S)+1)}function f(S,V){const I=n.options().filter(v=>v!==V),G=I.indexOf(S);return I.splice(G,0,V),I}function m(S,V){const I=n.options().filter(v=>v!==V),G=I.indexOf(S);return I.splice(G+1,0,V),I}function _(S,V){S.dy=V-S.y,S.el.style.setProperty("transform",`translateY(${S.dy}px)`)}function x(S){var V;if(!n.item)return;const{el:I}=n.item;if(!I.isConnected){n.item=void 0;return}const G=S.map($=>Ai($)),v=Ai(I);(V=t.value)==null||V.replaceChildren(...S);const R=Ai(I),L=S.map($=>Ai($)),F=[];for(let $=0;$<L.length;$++){const U=S[$];if(U===n.item.el)continue;const O=L[$],Z=G[$]-O;U.style.transform=`translateY(${Z}px)`,F.push(U)}const T=R-v;n.item.y=n.item.y+T,n.item.dy=n.item.dy-T,n.item.orderChanged=!0,n.item.el.style.setProperty("transform",`translateY(${n.item.dy}px)`),F.forEach($=>$.classList.remove(gr.animate)),requestAnimationFrame(function(){F.forEach($=>{$.classList.add(gr.animate),$.style.transform="",$.addEventListener("transitionend",()=>{$.classList.remove(gr.animate)})})})}nt(window,"mousemove",S=>{if(!n.item)return;const{el:V}=n.item;_(n.item,S.y);const I=Ai(n.item.el),G=PS(n.item.el),v=u(V),R=p(V);v.forEach(L=>{const F=fp(L);I+s<F&&x(f(L,V))}),R.forEach(L=>{const F=fp(L);G-s>F&&x(m(L,V))})}),nt(window,"mouseup",()=>{if(!n.item)return;const{el:S,orderChanged:V}=n.item;S.classList.add(gr.animate),S.style.removeProperty("transform"),S.addEventListener("transitionend",()=>{S.classList.remove(gr.animate,gr.item)}),setTimeout(()=>{if(!V)return;const I=n.options().map(v=>Number(v.getAttribute("data-index"))),G=t.value;if(G){for(const v of n.options())G.removeChild(v);o.value.forEach(v=>{G.appendChild(v)})}e.onChange(I)},l),n.item=void 0}),r.watchEffect(()=>{o.value.forEach((S,V)=>{S.removeEventListener("mousedown",c),S.addEventListener("mousedown",c),S.setAttribute("data-index",String(V))})})}function DS(t,e){let n;r.onMounted(()=>{n=setInterval(t,e)}),r.onUnmounted(()=>clearInterval(n))}function FS(t,e,n){const o=r.reactive({data:il.deepClone(e(t.value)),changed:!1});return r.watch(()=>o.data,s=>{o.changed?n(il.deepClone(s)):o.changed=!0},{deep:!0}),r.watch(t,s=>{Object.assign(o,{data:il.deepClone(e(s)),changed:!1})},{deep:!0,immediate:!0}),o}function RS(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 iC(()=>{const s=n();this.run(...s).catch(console.error)},o)}});return e.run=e.run.bind(e),e}function MS(t,e){function n(c,u){const p=r.unref(t);if(!p)return;const f=`translate(${u.x-c.x}px, ${u.y-c.y}px)`;p.style.setProperty("transform",f),e(u)}function o(c){const u=p=>n(c,p);document.addEventListener("mousemove",u),document.addEventListener("mouseup",()=>{const p=r.unref(t);document.removeEventListener("mousemove",u),p&&(p.style.setProperty("transition","all .3s ease-in-out"),p.style.removeProperty("transform"),p.addEventListener("transitionend",()=>{p.style.removeProperty("transition")}))},{once:!0})}function s(){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(s),r.onUnmounted(l)}const IS={class:"ui-slider__wrapper"},OS={class:"ui-slider__label-section"},LS={key:0,class:"text-s"},GS={class:"ui-slider__base"},zS={class:"ui-slider__container"},$S={class:"ui-slider__container ui-slider__container-thumb"},ZS=["data-percent"],US=["data-percent"],WS=["data-percent"],HS={key:0,class:"ui-slider__error"},jS=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,s=t,l=r.reactive({deltaValue1:0,deltaValue2:0,deltaValue3:0}),c=r.ref(),u=r.ref(),p=r.ref(),f=r.ref(),m=r.computed(()=>s.max-s.min),_=r.computed(()=>s),x=Pl(_),S=r.computed(()=>wt((s.modelValue[0]??0)+l.deltaValue1,s.min,s.max)),V=r.computed(()=>wt((s.modelValue[1]??0)+l.deltaValue2,s.min,s.max)),I=r.computed(()=>wt((s.modelValue[2]??0)+l.deltaValue3,s.min,s.max)),G=r.computed(()=>{const P=s.modelValue;if(!(Array.isArray(P)&&P.length===3&&P.every(oe=>Number.isFinite(oe))))return"Expected model [number, number, number]";const j=[];return[...s.modelValue].forEach(oe=>{oe>s.max&&j.push(`Max model value must be lower than max props ${s.max}.`),oe<s.min&&j.push("Min model value must be greater than max props.")}),j.length>0?j.join(" "):s.error}),v=r.computed(()=>(S.value-s.min)/m.value),R=r.computed(()=>(V.value-s.min)/m.value),L=r.computed(()=>(I.value-s.min)/m.value),F=r.computed(()=>W()),T=r.computed(()=>({right:F.value[0]+"%",left:100-F.value[2]+"%"})),$=r.computed(()=>({right:Math.ceil((1-v.value)*100)+"%"})),U=r.computed(()=>({right:Math.ceil((1-R.value)*100)+"%"})),O=r.computed(()=>({right:Math.ceil((1-L.value)*100)+"%"}));ar(u,P=>{var j;at((j=r.unref(c))==null?void 0:j.getBoundingClientRect(),oe=>{const{dx:ae}=P;l.deltaValue1=ae/oe.width*m.value,u.value&&Z(u.value,s.modelValue[0],l.deltaValue1),P.stop&&(he([J(S.value),J(V.value),J(I.value)]),l.deltaValue1=0)})}),ar(p,P=>{var j;at((j=r.unref(c))==null?void 0:j.getBoundingClientRect(),oe=>{const{dx:ae}=P;l.deltaValue2=ae/oe.width*m.value,p.value&&Z(p.value,s.modelValue[1],l.deltaValue2),P.stop&&(he([J(S.value),J(V.value),J(I.value)]),l.deltaValue2=0)})}),ar(f,P=>{var j;at((j=r.unref(c))==null?void 0:j.getBoundingClientRect(),oe=>{const{dx:ae}=P;l.deltaValue3=ae/oe.width*m.value,f.value&&Z(f.value,s.modelValue[2],l.deltaValue3),P.stop&&(he([J(S.value),J(V.value),J(I.value)]),l.deltaValue3=0)})});function Z(P,j,oe){const ae=J(wt((j??0)+oe,s.min,s.max));P.dataset.percent=`${ae}${s.measure}`,N()}function W(){const P=Math.ceil((1-v.value)*100),j=Math.ceil((1-R.value)*100),oe=Math.ceil((1-L.value)*100);return[P,j,oe].sort((ae,Fe)=>ae-Fe)}function J(P){const j=wt(P,s.min,s.max);return Math.round((j+Number.EPSILON)*(1/s.step))/(1/s.step)}function he(P){o("update:modelValue",P)}function N(){const P=Number($.value.right.substring(0,$.value.right.length-1)),j=Number(U.value.right.substring(0,U.value.right.length-1)),oe=Number(O.value.right.substring(0,O.value.right.length-1)),ae=[{r:P,th:u},{r:j,th:p},{r:oe,th:f}].sort((Fe,Ye)=>Fe.r-Ye.r);ae[0].th.value&&(ae[0].th.value.dataset.hint="high"),ae[1].th.value&&(ae[1].th.value.dataset.hint="mid"),ae[2].th.value&&(ae[2].th.value.dataset.hint="low")}function E(P,j){["ArrowDown","ArrowUp","ArrowRight","ArrowLeft","Enter"].includes(P.code)&&P.preventDefault();const oe=P.code==="ArrowUp"||P.code==="ArrowRight"?s.step*1:P.code==="ArrowDown"||P.code==="ArrowLeft"?s.step*-1:0,ae=[...s.modelValue];ae[j]=wt(ae[j]+oe,s.min,s.max),he(ae),N()}return r.onMounted(()=>{N()}),(P,j)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass([s.disabled?"ui-slider__disabled":void 0,"ui-slider__envelope ui-slider__triple"])},[r.createElementVNode("div",{class:r.normalizeClass([`ui-slider__mode-${s.mode}`,"ui-slider"])},[r.createElementVNode("div",IS,[r.createElementVNode("div",OS,[P.label?(r.openBlock(),r.createElementBlock("label",LS,[r.createElementVNode("span",null,r.toDisplayString(P.label),1),j[3]||(j[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(P.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0)]),j[11]||(j[11]=r.createTextVNode()),r.createElementVNode("div",GS,[r.createElementVNode("div",zS,[r.createElementVNode("div",{ref_key:"barRef",ref:c,class:"ui-slider__bar"},[r.createElementVNode("div",{class:"ui-slider__progress",style:r.normalizeStyle(T.value)},null,4)],512)]),j[10]||(j[10]=r.createTextVNode()),r.createElementVNode("div",$S,[s.breakpoints?(r.openBlock(!0),r.createElementBlock(r.Fragment,{key:0},r.renderList(r.unref(x),(oe,ae)=>(r.openBlock(),r.createElementBlock("div",{key:ae,style:r.normalizeStyle({right:`${oe}%`}),class:"ui-slider__thumb-step"},null,4))),128)):r.createCommentVNode("",!0),j[7]||(j[7]=r.createTextVNode()),r.createElementVNode("div",{ref_key:"thumbRef1",ref:u,style:r.normalizeStyle($.value),"data-percent":s.modelValue[0]+"%",class:"ui-slider__thumb ui-slider__triple-thumb",r1:"",tabindex:"0",onKeydown:j[0]||(j[0]=oe=>E(oe,0))},j[4]||(j[4]=[r.createElementVNode("div",{class:"ui-slider__thumb-focused-contour"},null,-1)]),44,ZS),j[8]||(j[8]=r.createTextVNode()),r.createElementVNode("div",{ref_key:"thumbRef2",ref:p,style:r.normalizeStyle(U.value),"data-percent":s.modelValue[1]+"%",class:"ui-slider__thumb ui-slider__triple-thumb",r2:"",tabindex:"0",onKeydown:j[1]||(j[1]=oe=>E(oe,1))},j[5]||(j[5]=[r.createElementVNode("div",{class:"ui-slider__thumb-focused-contour"},null,-1)]),44,US),j[9]||(j[9]=r.createTextVNode()),r.createElementVNode("div",{ref_key:"thumbRef3",ref:f,style:r.normalizeStyle(O.value),"data-percent":s.modelValue[2]+"%",class:"ui-slider__thumb ui-slider__triple-thumb",r3:"",tabindex:"0",onKeydown:j[2]||(j[2]=oe=>E(oe,2))},j[6]||(j[6]=[r.createElementVNode("div",{class:"ui-slider__thumb-focused-contour"},null,-1)]),44,WS)])])]),j[12]||(j[12]=r.createTextVNode()),j[13]||(j[13]=r.createElementVNode("div",{class:"ui-slider__input-wrapper d-flex"},null,-1))],2),j[14]||(j[14]=r.createTextVNode()),G.value?(r.openBlock(),r.createElementBlock("div",HS,r.toDisplayString(G.value),1)):r.createCommentVNode("",!0)],2))}}),qS={class:"ui-input-range__separator"},KS=r.defineComponent({__name:"InputRange",props:{modelValue:{},separator:{default:"-"}},emits:["update:modelValue","change"],setup(t,{emit:e}){const n=t,o=e,s=r.reactive({left:n.modelValue[0],right:n.modelValue[1]}),l=r.ref(!1),c=r.computed(()=>(l.value,"ui-input-range-focused")),u=r.computed({get(){return{left:Math.min(...n.modelValue),right:Math.max(...n.modelValue)}},set(){}});r.watch(()=>u.value,m=>(s.left=m.left)&&(s.right=m.right));function p(){o("update:modelValue",[+s.left,+s.right]),o("change",[+s.left,+s.right])}function f(m,_){const x=_.target.value;/^[0-9]{0,2}$/.test(x)?m?s.left=+x:s.right=+x:m?s.left=+x.slice(0,x.length-1):s.right=+x.slice(0,x.length-1)}return(m,_)=>(r.openBlock(),r.createElementBlock("div",r.mergeProps({class:[c.value,"ui-input-range"]},m.$attrs),[r.withDirectives(r.createElementVNode("input",{"onUpdate:modelValue":_[0]||(_[0]=x=>u.value.left=x),class:"text-s",type:"text",onChange:p,onFocus:_[1]||(_[1]=x=>l.value=!0),onFocusout:_[2]||(_[2]=x=>l.value=!1),onInput:_[3]||(_[3]=x=>f(!0,x))},null,544),[[r.vModelText,u.value.left]]),_[8]||(_[8]=r.createTextVNode()),r.createElementVNode("div",qS,r.toDisplayString(n.separator),1),_[9]||(_[9]=r.createTextVNode()),r.withDirectives(r.createElementVNode("input",{"onUpdate:modelValue":_[4]||(_[4]=x=>u.value.right=x),class:"text-s",type:"text",onChange:p,onFocus:_[5]||(_[5]=x=>l.value=!0),onFocusout:_[6]||(_[6]=x=>l.value=!1),onInput:_[7]||(_[7]=x=>f(!1,x))},null,544),[[r.vModelText,u.value.right]])],16))}}),YS={class:"ui-slider__wrapper"},JS={class:"ui-slider__label-section"},XS={key:0,class:"text-s"},QS={key:1,class:"ui-slider__value-static text-s"},e1={class:"ui-slider__base"},t1={class:"ui-slider__container"},n1={class:"ui-slider__container ui-slider__container-thumb"},r1={class:"ui-slider__input-wrapper d-flex"},o1={key:0,class:"ui-slider__error"},i1=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,s=t,l=r.reactive({deltaValue1:0,deltaValue2:0}),c=r.ref(),u=r.ref(),p=r.ref(),f=r.ref(s.modelValue),m=r.ref(s.modelValue[0]),_=r.ref(s.modelValue[1]),x=r.computed(()=>s),S=Pl(x),V=r.computed(()=>[m.value,_.value].sort((N,E)=>N-E).join("-")),I=r.computed(()=>s.max-s.min),G=r.computed(()=>wt((s.modelValue[0]??0)+l.deltaValue1,s.min,s.max)),v=r.computed(()=>wt((s.modelValue[1]??0)+l.deltaValue2,s.min,s.max)),R=r.computed(()=>{const N=s.modelValue;return Array.isArray(N)&&N.length===2&&N.every(E=>Number.isFinite(E))?s.error:"Expected model [number, number]"}),L=r.computed(()=>(G.value-s.min)/I.value),F=r.computed(()=>(v.value-s.min)/I.value),T=r.computed(()=>Z()),$=r.computed(()=>({right:T.value[0]+"%",left:100-T.value[1]+"%"})),U=r.computed(()=>({right:Math.ceil((1-L.value)*100)+"%"})),O=r.computed(()=>({right:Math.ceil((1-F.value)*100)+"%"}));r.watch(()=>s.modelValue,N=>{f.value=N,m.value=+N[0],_.value=+N[1]},{immediate:!0}),ar(u,N=>{var E;at((E=r.unref(c))==null?void 0:E.getBoundingClientRect(),P=>{const{dx:j}=N;l.deltaValue1=j/P.width*I.value,m.value=W(wt((s.modelValue[0]??0)+l.deltaValue1,s.min,s.max)),f.value=[m.value,_.value].sort((oe,ae)=>oe-ae),N.stop&&(J([W(G.value),W(v.value)]),l.deltaValue1=0)})}),ar(p,N=>{var E;at((E=r.unref(c))==null?void 0:E.getBoundingClientRect(),P=>{const{dx:j}=N;l.deltaValue2=j/P.width*I.value,_.value=W(wt((s.modelValue[1]??0)+l.deltaValue2,s.min,s.max)),f.value=[m.value,_.value].sort((oe,ae)=>oe-ae),N.stop&&(J([W(G.value),W(v.value)]),l.deltaValue2=0)})});function Z(){const N=Math.ceil((1-L.value)*100),E=Math.ceil((1-F.value)*100);return[N,E].sort((P,j)=>P-j)}function W(N){const E=wt(N,s.min,s.max);return Math.round((E+Number.EPSILON)*(1/s.step))/(1/s.step)}function J(N){o("update:modelValue",N)}function he(N,E){["ArrowDown","ArrowUp","ArrowRight","ArrowLeft","Enter"].includes(N.code)&&N.preventDefault();const P=N.code==="ArrowUp"||N.code==="ArrowRight"?s.step*1:N.code==="ArrowDown"||N.code==="ArrowLeft"?s.step*-1:0,j=[...s.modelValue];j[E]=wt(j[E]+P,s.min,s.max),J(j)}return(N,E)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass([s.disabled?"ui-slider__disabled":void 0,"ui-slider__envelope"])},[r.createElementVNode("div",{class:r.normalizeClass([`ui-slider__mode-${s.mode}`,"ui-slider"])},[r.createElementVNode("div",YS,[r.createElementVNode("div",JS,[N.label?(r.openBlock(),r.createElementBlock("label",XS,[r.createElementVNode("span",null,r.toDisplayString(N.label),1),E[3]||(E[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(N.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0),E[4]||(E[4]=r.createTextVNode()),s.mode==="text"?(r.openBlock(),r.createElementBlock("div",QS,r.toDisplayString(V.value),1)):r.createCommentVNode("",!0)]),E[10]||(E[10]=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($.value)},null,4)],512)]),E[9]||(E[9]=r.createTextVNode()),r.createElementVNode("div",n1,[s.breakpoints?(r.openBlock(!0),r.createElementBlock(r.Fragment,{key:0},r.renderList(r.unref(S),(P,j)=>(r.openBlock(),r.createElementBlock("div",{key:j,style:r.normalizeStyle({right:`${P}%`}),class:"ui-slider__thumb-step"},null,4))),128)):r.createCommentVNode("",!0),E[7]||(E[7]=r.createTextVNode()),r.createElementVNode("div",{ref_key:"thumbRef1",ref:u,style:r.normalizeStyle(U.value),class:"ui-slider__thumb",tabindex:"0",onKeydown:E[0]||(E[0]=P=>he(P,0))},E[5]||(E[5]=[r.createElementVNode("div",{class:"ui-slider__thumb-focused-contour"},null,-1)]),36),E[8]||(E[8]=r.createTextVNode()),r.createElementVNode("div",{ref_key:"thumbRef2",ref:p,style:r.normalizeStyle(O.value),class:"ui-slider__thumb",tabindex:"0",onKeydown:E[1]||(E[1]=P=>he(P,1))},E[6]||(E[6]=[r.createElementVNode("div",{class:"ui-slider__thumb-focused-contour"},null,-1)]),36)])])]),E[11]||(E[11]=r.createTextVNode()),r.createElementVNode("div",r1,[s.mode==="input"?(r.openBlock(),r.createBlock(KS,{key:0,modelValue:f.value,"onUpdate:modelValue":E[2]||(E[2]=P=>f.value=P),class:"ui-focused-border",onChange:J},null,8,["modelValue"])):r.createCommentVNode("",!0)])],2),E[12]||(E[12]=r.createTextVNode()),R.value?(r.openBlock(),r.createElementBlock("div",o1,r.toDisplayString(R.value),1)):r.createCommentVNode("",!0)],2))}}),s1=r.defineComponent({__name:"VScroll",props:{scrollTop:{},clientHeight:{},scrollHeight:{}},emits:["update:scrollTop"],setup(t,{emit:e}){const n=e,o=t,s=r.ref(),l=r.computed(()=>o.clientHeight/(o.scrollHeight||1)),c=r.computed(()=>l.value<1),u=r.computed(()=>{const p=r.unref(l);return{top:o.scrollTop*p+"px",height:Math.floor(o.clientHeight*p)+"px"}});return nt(s,"pointerdown",p=>{const f={clientY:p.clientY},m=vl(document,"mousemove",_=>{const x=(_.clientY-f.clientY)/l.value;n("update:scrollTop",o.scrollTop+x),f.clientY=_.clientY});["mouseup","pointercancel"].forEach(_=>{document.addEventListener(_,m,{once:!0})})}),(p,f)=>c.value?(r.openBlock(),r.createElementBlock("div",{key:0,ref_key:"scrollRef",ref:s,class:"v-scroll"},[r.createElementVNode("div",{class:"v-scroll__scrollbar",style:r.normalizeStyle(u.value)},null,4)],512)):r.createCommentVNode("",!0)}}),a1=r.defineComponent({__name:"HScroll",props:{scrollLeft:{},clientWidth:{},scrollWidth:{}},emits:["update:scrollLeft"],setup(t,{emit:e}){const n=e,o=t,s=r.ref(),l=r.computed(()=>o.clientWidth/(o.scrollWidth||1)),c=r.computed(()=>l.value<1),u=r.computed(()=>{const p=r.unref(l);return{left:o.scrollLeft*p+"px",width:Math.floor(o.clientWidth*p)+"px"}});return nt(s,"pointerdown",p=>{const f={clientX:p.clientX},m=vl(document,"mousemove",_=>{const x=(_.clientX-f.clientX)/l.value;n("update:scrollLeft",o.scrollLeft+x),f.clientX=_.clientX});["mouseup","pointercancel"].forEach(_=>{document.addEventListener(_,m,{once:!0})})}),(p,f)=>c.value?(r.openBlock(),r.createElementBlock("div",{key:0,ref_key:"scrollRef",ref:s,class:"h-scroll"},[r.createElementVNode("div",{class:"h-scroll__scrollbar",style:r.normalizeStyle(u.value)},null,4)],512)):r.createCommentVNode("",!0)}}),l1={class:"ui-scrollable"},c1=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(u){uw(n,u,"scrollTop","scrollLeft","clientHeight","clientWidth","scrollHeight","scrollWidth")}const s=u=>{u.preventDefault();const p=u.currentTarget;p.scrollTop+=u.deltaY,p.scrollLeft+=u.deltaX,o(p)};function l(u){at(r.unref(e),p=>{p.scrollTop=u,o(p)})}function c(u){at(r.unref(e),p=>{p.scrollLeft=u,o(p)})}return hp(e,u=>{at(u,p=>o(p))}),r.onMounted(()=>{at(r.unref(e),u=>{o(u),u.addEventListener("wheel",s)})}),r.onUnmounted(()=>{at(r.unref(e),u=>u.removeEventListener("wheel",s))}),(u,p)=>(r.openBlock(),r.createElementBlock("div",l1,[r.createElementVNode("div",{ref_key:"containerRef",ref:e,class:"ui-scrollable__container",onWheel:s},[r.renderSlot(u.$slots,"default")],544),p[2]||(p[2]=r.createTextVNode()),r.createVNode(s1,{"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(a1,{"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"])]))}}),d1="add.svg",u1="box.svg",p1="calendar.svg",h1="checkmark.svg",f1="clipboard.svg",m1="close.svg",g1="copy.svg",y1="download.svg",_1="duplicate.svg",C1="edit.svg",v1="error.svg",w1="filter.svg",b1="help.svg",x1="info.svg",k1="link.svg",S1="loading.svg",E1="lock.svg",T1="maximize.svg",B1="minimize.svg",V1="minus.svg",N1="more.svg",A1="open.svg",P1="pause.svg",D1="play.svg",F1="renew.svg",R1="restart.svg",M1="reverse.svg",I1="settings.svg",O1="sort.svg",L1="stop.svg",G1="success.svg",z1="time.svg",$1="tune.svg",Z1="warning.svg",U1="zip.svg",W1={add:d1,"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:u1,calendar:p1,"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:h1,"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:f1,close:m1,copy:g1,"data-dimentions":"data-dimentions.svg","delete-bin":"delete-bin.svg","delete-circle":"delete-circle.svg","delete-clear":"delete-clear.svg",download:y1,"drag-dots":"drag-dots.svg",duplicate:_1,edit:C1,error:v1,export:"export.svg","filter-on":"filter-on.svg",filter:w1,"help-outline":"help-outline.svg",help:b1,"info-outline":"info-outline.svg",info:x1,"jump-link":"jump-link.svg",link:k1,loading:S1,lock:E1,maximize:T1,minimize:B1,minus:V1,more:N1,open:A1,"paper-clip":"paper-clip.svg",pause:P1,play:D1,renew:F1,restart:R1,reverse:M1,settings:I1,sort:O1,stop:L1,success:G1,time:z1,tune:$1,warning:Z1,"x-axis":"x-axis.svg","y-axis":"y-axis.svg",zip:U1},H1="add.svg",j1="annotate.svg",q1="annotation.svg",K1="area.svg",Y1="axes.svg",J1="bar.svg",X1="bindot.svg",Q1="box.svg",eE="boxplot.svg",tE="bubble.svg",nE="calendar.svg",rE="canvas.svg",oE="checkbox.svg",iE="checkmark.svg",sE="clipboard.svg",aE="close.svg",lE="cluster.svg",cE="code.svg",dE="color.svg",uE="columns.svg",pE="container.svg",hE="cookie.svg",fE="copy.svg",mE="cpu.svg",gE="debug.svg",yE="dna.svg",_E="download.svg",CE="duplicate.svg",vE="edit.svg",wE="error.svg",bE="filter.svg",xE="generate.svg",kE="graph.svg",SE="heatmap.svg",EE="help.svg",TE="info.svg",BE="jitter.svg",VE="lasso.svg",NE="layers.svg",AE="learn.svg",PE="legend.svg",DE="line.svg",FE="link.svg",RE="loading.svg",ME="lock.svg",IE="maximize.svg",OE="menu.svg",LE="minimize.svg",GE="minus.svg",zE="more.svg",$E="pause.svg",ZE="pin.svg",UE="play.svg",WE="product.svg",HE="publications.svg",jE="renew.svg",qE="restart.svg",KE="reverse.svg",YE="search.svg",JE="server.svg",XE="settings.svg",QE="sina.svg",eT="skatterplot.svg",tT="slice.svg",nT="sort.svg",rT="statistics.svg",oT="stop.svg",iT="success.svg",sT="table.svg",aT="template.svg",lT="terminal.svg",cT="time.svg",dT="tune.svg",uT="venn.svg",pT="violin.svg",hT="warning.svg",fT="wetlab.svg",mT="zip.svg",gT={"add-layer":"add-layer.svg",add:H1,"align-center":"align-center.svg","align-left":"align-left.svg","align-right":"align-right.svg",annotate:j1,annotation:q1,area: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",axes:Y1,"bar-cross":"bar-cross.svg","bar-error":"bar-error.svg","bar-stacked":"bar-stacked.svg","bar-trend":"bar-trend.svg",bar:J1,bindot:X1,box:Q1,"boxplot-binned":"boxplot-binned.svg","boxplot-jitter":"boxplot-jitter.svg","boxplot-notched":"boxplot-notched.svg",boxplot:eE,bubble:tE,calendar:nE,canvas:rE,"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:oE,checkmark:iE,"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:sE,close:aE,"cloud-download":"cloud-download.svg","cloud-offline":"cloud-offline.svg","cloud-online":"cloud-online.svg","cloud-upload":"cloud-upload.svg",cluster:lE,code:cE,"color-fill":"color-fill.svg","color-none":"color-none.svg","color-stroke":"color-stroke.svg",color:dE,columns:uE,"connected-points":"connected-points.svg",container:pE,cookie:hE,copy:fE,cpu:mE,"data-dimentions":"data-dimentions.svg",debug:gE,"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:yE,download:_E,"drag-dots":"drag-dots.svg","drag-horizontal":"drag-horizontal.svg","drag-vertical":"drag-vertical.svg",duplicate:CE,edit:vE,"error-bar":"error-bar.svg",error:wE,"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:bE,"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:xE,graph:kE,heatmap:SE,"help-outline":"help-outline.svg",help:EE,"info-outline":"info-outline.svg",info:TE,jitter:BE,"jump-link":"jump-link.svg",lasso:VE,layers:NE,learn:AE,"legend-box-dot":"legend-box-dot.svg","legend-box":"legend-box.svg",legend:PE,"line-binned":"line-binned.svg","line-error":"line-error.svg","line-jitter":"line-jitter.svg",line:DE,"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:FE,loading:RE,lock:ME,maximize:IE,menu:OE,minimize:LE,minus:GE,more:zE,"paper-clip":"paper-clip.svg",pause:$E,pin:ZE,play:UE,"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:WE,publications:HE,"radio-button-checked":"radio-button-checked.svg","radio-button":"radio-button.svg",renew:jE,restart:qE,reverse:KE,"rotation-0":"rotation-0.svg","rotation-45":"rotation-45.svg","rotation-90":"rotation-90.svg",search:YE,"server-on":"server-on.svg",server:JE,settings:XE,sina:QE,skatterplot:eT,slice:tT,"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:nT,statistics:rT,stop:oT,"strip-plot":"strip-plot.svg",success:iT,"table-add":"table-add.svg","table-alias":"table-alias.svg","table-import":"table-import.svg",table:sT,template:aT,terminal:lT,"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:cT,tune:dT,venn:uT,"view-hide":"view-hide.svg","view-show":"view-show.svg","violin-binned":"violin-binned.svg","violin-jitter":"violin-jitter.svg",violin:pT,warning:hT,wetlab:fT,"windows-collapse":"windows-collapse.svg","windows-expand":"windows-expand.svg","x-axis":"x-axis.svg","y-axis":"y-axis.svg",zip:mT,"zoom-in":"zoom-in.svg","zoom-out":"zoom-out.svg"};function yT(){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 _T=["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"],CT=["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"],vT={allCssVariables:yT(),icons16:W1,icons24:gT},wT={class:"block__not-found"},bT=r.defineComponent({__name:"NotFound",setup(t){const n=nl().useApp(),o=()=>{n.updateNavigationState(s=>{s.href="/"})};return(s,l)=>(r.openBlock(),r.createElementBlock("div",wT,[r.createElementVNode("h1",null,"Not found route: "+r.toDisplayString(r.unref(n).snapshot.navigationState.href),1),r.createVNode(r.unref(ml),{onClick:r.withModifiers(o,["stop"])},{default:r.withCtx(()=>l[0]||(l[0]=[r.createTextVNode("Return to main page")])),_:1})]))}}),Dl=(t,e)=>{const n=t.__vccOpts||t;for(const[o,s]of e)n[o]=s;return n},xT={},kT={class:"block__loader-page"};function ST(t,e){return r.openBlock(),r.createElementBlock("div",kT,e[0]||(e[0]=[r.createElementVNode("div",{class:"loader-container"},[r.createElementVNode("i",{class:"mask-24 mask-loading loader-icon"})],-1)]))}const ET=Dl(xT,[["render",ST]]),TT={class:"pl-app-notification-alert"},BT={class:"pl-app-notification-alert__content"},VT={class:"pl-app-notification-alert__title"},NT=r.defineComponent({__name:"PlAppErrorNotificationAlert",props:{errors:{}},setup(t){const e=t,n=r.ref(!1),o=r.ref(!0),s=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(u=>!!u)},{immediate:!0,deep:!0}),(c,u)=>(r.openBlock(),r.createElementBlock("div",TT,[r.createVNode(r.unref(Sl),{modelValue:n.value,"onUpdate:modelValue":u[0]||(u[0]=p=>n.value=p),width:"720px",style:{"max-height":"100vh"}},{title:r.withCtx(()=>u[2]||(u[2]=[r.createTextVNode(" Errors ")])),default:r.withCtx(()=>[r.createElementVNode("div",BT,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(s.value,p=>{var f;return r.openBlock(),r.createElementBlock("div",{key:p[0],class:"pl-app-notification-alert__item"},[r.createElementVNode("div",VT,r.toDisplayString(p[0]),1),r.createVNode(r.unref(Zu),{value:(f=p[1])==null?void 0:f.message},null,8,["value"])])}),128))])]),_:1},8,["modelValue"]),r.createVNode(r.unref(up),{modelValue:o.value,"onUpdate:modelValue":u[1]||(u[1]=p=>o.value=p),type:"error",closable:""},{actions:r.withCtx(()=>[r.createVNode(r.unref(Cs),{icon:"arrow-right",onClick:l},{default:r.withCtx(()=>u[3]||(u[3]=[r.createTextVNode("See errors")])),_:1}),r.createVNode(r.unref(Vu))]),default:r.withCtx(()=>[u[4]||(u[4]=r.createTextVNode(" Some outputs have errors. "))]),_:1},8,["modelValue"])]))}}),AT={key:0,class:"block__loader"},PT=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 s=e.value;if(typeof s=="number")return s>=1?void 0:(s*100).toFixed(2)+"%"});return(s,l)=>n.value?(r.openBlock(),r.createElementBlock("div",AT)):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)}}),DT={class:"block block__layout"},FT={key:0},RT=r.defineComponent({__name:"BlockLayout",setup(t){const e=nl(),n=f=>{try{return new URL(f,"http://dummy").pathname}catch{console.error("Invalid href",f);return}},o=r.computed(()=>e.loaded?e.useApp().href:void 0),s=r.computed(()=>{if(e.loaded){const f=e.useApp(),m=n(f.snapshot.navigationState.href);return m?f.getRoute(m):void 0}}),l=r.computed(()=>e.loaded?e.useApp():void 0),c=r.computed(()=>l.value?l.value.model.outputErrors:{}),u=r.computed(()=>{var f;return((f=l.value)==null?void 0:f.showErrorsNotification)??!0}),p=r.computed(()=>{var f,m;return(m=(f=l.value)==null?void 0:f.progress)==null?void 0:m.call(f)});return(f,m)=>(r.openBlock(),r.createElementBlock("div",DT,[r.createVNode(PT,{value:p.value},null,8,["value"]),r.unref(e).error?(r.openBlock(),r.createElementBlock("div",FT,r.toDisplayString(r.unref(e).error),1)):r.unref(e).loaded?s.value?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(s.value),{key:o.value})):(r.openBlock(),r.createBlock(bT,{key:3})):(r.openBlock(),r.createBlock(ET,{key:1},{default:r.withCtx(()=>m[0]||(m[0]=[r.createTextVNode("Loading...")])),_:1})),r.unref(e).loaded&&u.value?(r.openBlock(),r.createBlock(r.unref(NT),{key:4,errors:c.value},null,8,["errors"])):r.createCommentVNode("",!0)]))}});var Ps={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=Nl(l);r.onMounted(l),st(window,"scroll",c,!0),st(window,"resize",c,!0)}function jp(t,e){up(()=>{ut(r.unref(t),n=>{pp(n,()=>e(n))})}),r.onUnmounted(()=>{ut(r.unref(t),n=>{hp(n)})})}const Sr={item:"sortable__item",animate:"sortable__animate"},Mi=t=>t.getBoundingClientRect().y,Hp=t=>{const{y:e,height:n}=t.getBoundingClientRect();return e+Math.ceil(n/2)},OE=t=>{const{y:e,height:n}=t.getBoundingClientRect();return e+n};function qp(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 E=e.handle?this.querySelector(e.handle):null;E&&(E&&!E.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 E=n.options();return E.slice(0,E.indexOf(w))}function p(w){const E=n.options();return E.slice(E.indexOf(w)+1)}function h(w,E){const O=n.options().filter(b=>b!==E),$=O.indexOf(w);return O.splice($,0,E),O}function m(w,E){const O=n.options().filter(b=>b!==E),$=O.indexOf(w);return O.splice($+1,0,E),O}function y(w,E){w.dy=E-w.y,w.el.style.setProperty("transform",`translateY(${w.dy}px)`)}function x(w){var E;if(!n.item)return;const{el:O}=n.item;if(!O.isConnected){n.item=void 0;return}const $=w.map(Z=>Mi(Z)),b=Mi(O);(E=t.value)==null||E.replaceChildren(...w);const R=Mi(O),F=w.map(Z=>Mi(Z)),D=[];for(let Z=0;Z<F.length;Z++){const ne=w[Z];if(ne===n.item.el)continue;const H=F[Z],J=$[Z]-H;ne.style.transform=`translateY(${J}px)`,D.push(ne)}const V=R-b;n.item.y=n.item.y+V,n.item.dy=n.item.dy-V,n.item.orderChanged=!0,n.item.el.style.setProperty("transform",`translateY(${n.item.dy}px)`),D.forEach(Z=>Z.classList.remove(Sr.animate)),requestAnimationFrame(function(){D.forEach(Z=>{Z.classList.add(Sr.animate),Z.style.transform="",Z.addEventListener("transitionend",()=>{Z.classList.remove(Sr.animate)})})})}st(window,"mousemove",w=>{if(!n.item)return;const{el:E}=n.item;y(n.item,w.y);const O=Mi(n.item.el),$=OE(n.item.el),b=d(E),R=p(E);b.forEach(F=>{const D=Hp(F);O+i<D&&x(h(F,E))}),R.forEach(F=>{const D=Hp(F);$-i>D&&x(m(F,E))})}),st(window,"mouseup",()=>{if(!n.item)return;const{el:w,orderChanged:E}=n.item;w.classList.add(Sr.animate),w.style.removeProperty("transform"),w.addEventListener("transitionend",()=>{w.classList.remove(Sr.animate,Sr.item)}),setTimeout(()=>{if(!E)return;const O=n.options().map(b=>Number(b.getAttribute("data-index"))),$=t.value;if($){for(const b of n.options())$.removeChild(b);o.value.forEach(b=>{$.appendChild(b)})}e.onChange(O)},l),n.item=void 0}),r.watchEffect(()=>{o.value.forEach((w,E)=>{w.removeEventListener("mousedown",c),w.addEventListener("mousedown",c),w.setAttribute("data-index",String(E))})})}function LE(t,e){let n;r.onMounted(()=>{n=setInterval(t,e)}),r.onUnmounted(()=>clearInterval(n))}function ME(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 GE(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 dC(()=>{const i=n();this.run(...i).catch(console.error)},o)}});return e.run=e.run.bind(e),e}function $E(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 zE={class:"ui-slider__wrapper"},UE={class:"ui-slider__label-section"},ZE={key:0,class:"text-s"},WE={class:"ui-slider__base"},jE={class:"ui-slider__container"},HE={class:"ui-slider__container ui-slider__container-thumb"},qE=["data-percent"],KE=["data-percent"],XE=["data-percent"],YE={key:0,class:"ui-slider__error"},JE=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),x=Kl(y),w=r.computed(()=>St((i.modelValue[0]??0)+l.deltaValue1,i.min,i.max)),E=r.computed(()=>St((i.modelValue[1]??0)+l.deltaValue2,i.min,i.max)),O=r.computed(()=>St((i.modelValue[2]??0)+l.deltaValue3,i.min,i.max)),$=r.computed(()=>{const k=i.modelValue;if(!(Array.isArray(k)&&k.length===3&&k.every(W=>Number.isFinite(W))))return"Expected model [number, number, number]";const M=[];return[...i.modelValue].forEach(W=>{W>i.max&&M.push(`Max model value must be lower than max props ${i.max}.`),W<i.min&&M.push("Min model value must be greater than max props.")}),M.length>0?M.join(" "):i.error}),b=r.computed(()=>(w.value-i.min)/m.value),R=r.computed(()=>(E.value-i.min)/m.value),F=r.computed(()=>(O.value-i.min)/m.value),D=r.computed(()=>G()),V=r.computed(()=>({right:D.value[0]+"%",left:100-D.value[2]+"%"})),Z=r.computed(()=>({right:Math.ceil((1-b.value)*100)+"%"})),ne=r.computed(()=>({right:Math.ceil((1-R.value)*100)+"%"})),H=r.computed(()=>({right:Math.ceil((1-F.value)*100)+"%"}));gr(d,k=>{var M;ut((M=r.unref(c))==null?void 0:M.getBoundingClientRect(),W=>{const{dx:q}=k;l.deltaValue1=q/W.width*m.value,d.value&&J(d.value,i.modelValue[0],l.deltaValue1),k.stop&&(Q([z(w.value),z(E.value),z(O.value)]),l.deltaValue1=0)})}),gr(p,k=>{var M;ut((M=r.unref(c))==null?void 0:M.getBoundingClientRect(),W=>{const{dx:q}=k;l.deltaValue2=q/W.width*m.value,p.value&&J(p.value,i.modelValue[1],l.deltaValue2),k.stop&&(Q([z(w.value),z(E.value),z(O.value)]),l.deltaValue2=0)})}),gr(h,k=>{var M;ut((M=r.unref(c))==null?void 0:M.getBoundingClientRect(),W=>{const{dx:q}=k;l.deltaValue3=q/W.width*m.value,h.value&&J(h.value,i.modelValue[2],l.deltaValue3),k.stop&&(Q([z(w.value),z(E.value),z(O.value)]),l.deltaValue3=0)})});function J(k,M,W){const q=z(St((M??0)+W,i.min,i.max));k.dataset.percent=`${q}${i.measure}`,A()}function G(){const k=Math.ceil((1-b.value)*100),M=Math.ceil((1-R.value)*100),W=Math.ceil((1-F.value)*100);return[k,M,W].sort((q,re)=>q-re)}function z(k){const M=St(k,i.min,i.max);return Math.round((M+Number.EPSILON)*(1/i.step))/(1/i.step)}function Q(k){o("update:modelValue",k)}function A(){const k=Number(Z.value.right.substring(0,Z.value.right.length-1)),M=Number(ne.value.right.substring(0,ne.value.right.length-1)),W=Number(H.value.right.substring(0,H.value.right.length-1)),q=[{r:k,th:d},{r:M,th:p},{r:W,th:h}].sort((re,ue)=>re.r-ue.r);q[0].th.value&&(q[0].th.value.dataset.hint="high"),q[1].th.value&&(q[1].th.value.dataset.hint="mid"),q[2].th.value&&(q[2].th.value.dataset.hint="low")}function C(k,M){["ArrowDown","ArrowUp","ArrowRight","ArrowLeft","Enter"].includes(k.code)&&k.preventDefault();const W=k.code==="ArrowUp"||k.code==="ArrowRight"?i.step*1:k.code==="ArrowDown"||k.code==="ArrowLeft"?i.step*-1:0,q=[...i.modelValue];q[M]=St(q[M]+W,i.min,i.max),Q(q),A()}return r.onMounted(()=>{A()}),(k,M)=>(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",zE,[r.createElementVNode("div",UE,[k.label?(r.openBlock(),r.createElementBlock("label",ZE,[r.createElementVNode("span",null,r.toDisplayString(k.label),1),M[3]||(M[3]=r.createTextVNode()),r.unref(n).tooltip?(r.openBlock(),r.createBlock(r.unref(xt),{key:0,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.renderSlot(k.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0)]),M[11]||(M[11]=r.createTextVNode()),r.createElementVNode("div",WE,[r.createElementVNode("div",jE,[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)]),M[10]||(M[10]=r.createTextVNode()),r.createElementVNode("div",HE,[i.breakpoints?(r.openBlock(!0),r.createElementBlock(r.Fragment,{key:0},r.renderList(r.unref(x),(W,q)=>(r.openBlock(),r.createElementBlock("div",{key:q,style:r.normalizeStyle({right:`${W}%`}),class:"ui-slider__thumb-step"},null,4))),128)):r.createCommentVNode("",!0),M[7]||(M[7]=r.createTextVNode()),r.createElementVNode("div",{ref_key:"thumbRef1",ref:d,style:r.normalizeStyle(Z.value),"data-percent":i.modelValue[0]+"%",class:"ui-slider__thumb ui-slider__triple-thumb",r1:"",tabindex:"0",onKeydown:M[0]||(M[0]=W=>C(W,0))},M[4]||(M[4]=[r.createElementVNode("div",{class:"ui-slider__thumb-focused-contour"},null,-1)]),44,qE),M[8]||(M[8]=r.createTextVNode()),r.createElementVNode("div",{ref_key:"thumbRef2",ref:p,style:r.normalizeStyle(ne.value),"data-percent":i.modelValue[1]+"%",class:"ui-slider__thumb ui-slider__triple-thumb",r2:"",tabindex:"0",onKeydown:M[1]||(M[1]=W=>C(W,1))},M[5]||(M[5]=[r.createElementVNode("div",{class:"ui-slider__thumb-focused-contour"},null,-1)]),44,KE),M[9]||(M[9]=r.createTextVNode()),r.createElementVNode("div",{ref_key:"thumbRef3",ref:h,style:r.normalizeStyle(H.value),"data-percent":i.modelValue[2]+"%",class:"ui-slider__thumb ui-slider__triple-thumb",r3:"",tabindex:"0",onKeydown:M[2]||(M[2]=W=>C(W,2))},M[6]||(M[6]=[r.createElementVNode("div",{class:"ui-slider__thumb-focused-contour"},null,-1)]),44,XE)])])]),M[12]||(M[12]=r.createTextVNode()),M[13]||(M[13]=r.createElementVNode("div",{class:"ui-slider__input-wrapper d-flex"},null,-1))],2),M[14]||(M[14]=r.createTextVNode()),$.value?(r.openBlock(),r.createElementBlock("div",YE,r.toDisplayString($.value),1)):r.createCommentVNode("",!0)],2))}}),QE={class:"ui-input-range__separator"},e1=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 x=y.target.value;/^[0-9]{0,2}$/.test(x)?m?i.left=+x:i.right=+x:m?i.left=+x.slice(0,x.length-1):i.right=+x.slice(0,x.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]=x=>d.value.left=x),class:"text-s",type:"text",onChange:p,onFocus:y[1]||(y[1]=x=>l.value=!0),onFocusout:y[2]||(y[2]=x=>l.value=!1),onInput:y[3]||(y[3]=x=>h(!0,x))},null,544),[[r.vModelText,d.value.left]]),y[8]||(y[8]=r.createTextVNode()),r.createElementVNode("div",QE,r.toDisplayString(n.separator),1),y[9]||(y[9]=r.createTextVNode()),r.withDirectives(r.createElementVNode("input",{"onUpdate:modelValue":y[4]||(y[4]=x=>d.value.right=x),class:"text-s",type:"text",onChange:p,onFocus:y[5]||(y[5]=x=>l.value=!0),onFocusout:y[6]||(y[6]=x=>l.value=!1),onInput:y[7]||(y[7]=x=>h(!1,x))},null,544),[[r.vModelText,d.value.right]])],16))}}),t1={class:"ui-slider__wrapper"},n1={class:"ui-slider__label-section"},r1={key:0,class:"text-s"},o1={key:1,class:"ui-slider__value-static text-s"},i1={class:"ui-slider__base"},s1={class:"ui-slider__container"},a1={class:"ui-slider__container ui-slider__container-thumb"},l1={class:"ui-slider__input-wrapper d-flex"},c1={key:0,class:"ui-slider__error"},d1=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]),x=r.computed(()=>i),w=Kl(x),E=r.computed(()=>[m.value,y.value].sort((A,C)=>A-C).join("-")),O=r.computed(()=>i.max-i.min),$=r.computed(()=>St((i.modelValue[0]??0)+l.deltaValue1,i.min,i.max)),b=r.computed(()=>St((i.modelValue[1]??0)+l.deltaValue2,i.min,i.max)),R=r.computed(()=>{const A=i.modelValue;return Array.isArray(A)&&A.length===2&&A.every(C=>Number.isFinite(C))?i.error:"Expected model [number, number]"}),F=r.computed(()=>($.value-i.min)/O.value),D=r.computed(()=>(b.value-i.min)/O.value),V=r.computed(()=>J()),Z=r.computed(()=>({right:V.value[0]+"%",left:100-V.value[1]+"%"})),ne=r.computed(()=>({right:Math.ceil((1-F.value)*100)+"%"})),H=r.computed(()=>({right:Math.ceil((1-D.value)*100)+"%"}));r.watch(()=>i.modelValue,A=>{h.value=A,m.value=+A[0],y.value=+A[1]},{immediate:!0}),gr(d,A=>{var C;ut((C=r.unref(c))==null?void 0:C.getBoundingClientRect(),k=>{const{dx:M}=A;l.deltaValue1=M/k.width*O.value,m.value=G(St((i.modelValue[0]??0)+l.deltaValue1,i.min,i.max)),h.value=[m.value,y.value].sort((W,q)=>W-q),A.stop&&(z([G($.value),G(b.value)]),l.deltaValue1=0)})}),gr(p,A=>{var C;ut((C=r.unref(c))==null?void 0:C.getBoundingClientRect(),k=>{const{dx:M}=A;l.deltaValue2=M/k.width*O.value,y.value=G(St((i.modelValue[1]??0)+l.deltaValue2,i.min,i.max)),h.value=[m.value,y.value].sort((W,q)=>W-q),A.stop&&(z([G($.value),G(b.value)]),l.deltaValue2=0)})});function J(){const A=Math.ceil((1-F.value)*100),C=Math.ceil((1-D.value)*100);return[A,C].sort((k,M)=>k-M)}function G(A){const C=St(A,i.min,i.max);return Math.round((C+Number.EPSILON)*(1/i.step))/(1/i.step)}function z(A){o("update:modelValue",A)}function Q(A,C){["ArrowDown","ArrowUp","ArrowRight","ArrowLeft","Enter"].includes(A.code)&&A.preventDefault();const k=A.code==="ArrowUp"||A.code==="ArrowRight"?i.step*1:A.code==="ArrowDown"||A.code==="ArrowLeft"?i.step*-1:0,M=[...i.modelValue];M[C]=St(M[C]+k,i.min,i.max),z(M)}return(A,C)=>(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",t1,[r.createElementVNode("div",n1,[A.label?(r.openBlock(),r.createElementBlock("label",r1,[r.createElementVNode("span",null,r.toDisplayString(A.label),1),C[3]||(C[3]=r.createTextVNode()),r.unref(n).tooltip?(r.openBlock(),r.createBlock(r.unref(xt),{key:0,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.renderSlot(A.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0),C[4]||(C[4]=r.createTextVNode()),i.mode==="text"?(r.openBlock(),r.createElementBlock("div",o1,r.toDisplayString(E.value),1)):r.createCommentVNode("",!0)]),C[10]||(C[10]=r.createTextVNode()),r.createElementVNode("div",i1,[r.createElementVNode("div",s1,[r.createElementVNode("div",{ref_key:"barRef",ref:c,class:"ui-slider__bar"},[r.createElementVNode("div",{class:"ui-slider__progress",style:r.normalizeStyle(Z.value)},null,4)],512)]),C[9]||(C[9]=r.createTextVNode()),r.createElementVNode("div",a1,[i.breakpoints?(r.openBlock(!0),r.createElementBlock(r.Fragment,{key:0},r.renderList(r.unref(w),(k,M)=>(r.openBlock(),r.createElementBlock("div",{key:M,style:r.normalizeStyle({right:`${k}%`}),class:"ui-slider__thumb-step"},null,4))),128)):r.createCommentVNode("",!0),C[7]||(C[7]=r.createTextVNode()),r.createElementVNode("div",{ref_key:"thumbRef1",ref:d,style:r.normalizeStyle(ne.value),class:"ui-slider__thumb",tabindex:"0",onKeydown:C[0]||(C[0]=k=>Q(k,0))},C[5]||(C[5]=[r.createElementVNode("div",{class:"ui-slider__thumb-focused-contour"},null,-1)]),36),C[8]||(C[8]=r.createTextVNode()),r.createElementVNode("div",{ref_key:"thumbRef2",ref:p,style:r.normalizeStyle(H.value),class:"ui-slider__thumb",tabindex:"0",onKeydown:C[1]||(C[1]=k=>Q(k,1))},C[6]||(C[6]=[r.createElementVNode("div",{class:"ui-slider__thumb-focused-contour"},null,-1)]),36)])])]),C[11]||(C[11]=r.createTextVNode()),r.createElementVNode("div",l1,[i.mode==="input"?(r.openBlock(),r.createBlock(e1,{key:0,modelValue:h.value,"onUpdate:modelValue":C[2]||(C[2]=k=>h.value=k),class:"ui-focused-border",onChange:z},null,8,["modelValue"])):r.createCommentVNode("",!0)])],2),C[12]||(C[12]=r.createTextVNode()),R.value?(r.openBlock(),r.createElementBlock("div",c1,r.toDisplayString(R.value),1)):r.createCommentVNode("",!0)],2))}}),u1=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=Ol(document,"mousemove",y=>{const x=(y.clientY-h.clientY)/l.value;n("update:scrollTop",o.scrollTop+x),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)}}),p1=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=Ol(document,"mousemove",y=>{const x=(y.clientX-h.clientX)/l.value;n("update:scrollLeft",o.scrollLeft+x),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)}}),h1={class:"ui-scrollable"},f1=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){gw(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){ut(r.unref(e),p=>{p.scrollTop=d,o(p)})}function c(d){ut(r.unref(e),p=>{p.scrollLeft=d,o(p)})}return jp(e,d=>{ut(d,p=>o(p))}),r.onMounted(()=>{ut(r.unref(e),d=>{o(d),d.addEventListener("wheel",i)})}),r.onUnmounted(()=>{ut(r.unref(e),d=>d.removeEventListener("wheel",i))}),(d,p)=>(r.openBlock(),r.createElementBlock("div",h1,[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(u1,{"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(p1,{"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"])]))}}),m1="add.svg",g1="box.svg",y1="calendar.svg",v1="checkmark.svg",_1="clipboard.svg",C1="close.svg",w1="copy.svg",b1="download.svg",x1="duplicate.svg",k1="edit.svg",S1="error.svg",E1="filter.svg",T1="help.svg",N1="info.svg",A1="link.svg",V1="loading.svg",B1="lock.svg",P1="maximize.svg",R1="minimize.svg",D1="minus.svg",I1="more.svg",F1="open.svg",O1="pause.svg",L1="play.svg",M1="renew.svg",G1="restart.svg",$1="reverse.svg",z1="settings.svg",U1="sort.svg",Z1="stop.svg",W1="success.svg",j1="time.svg",H1="tune.svg",q1="warning.svg",K1="zip.svg",X1={add:m1,"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:g1,calendar:y1,"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:v1,"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:_1,close:C1,copy:w1,"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:x1,edit:k1,error:S1,export:"export.svg","filter-on":"filter-on.svg",filter:E1,"help-outline":"help-outline.svg",help:T1,"info-outline":"info-outline.svg",info:N1,"jump-link":"jump-link.svg",link:A1,loading:V1,lock:B1,maximize:P1,minimize:R1,minus:D1,more:I1,open:F1,"paper-clip":"paper-clip.svg",pause:O1,play:L1,renew:M1,restart:G1,reverse:$1,settings:z1,sort:U1,stop:Z1,success:W1,time:j1,tune:H1,warning:q1,"x-axis":"x-axis.svg","y-axis":"y-axis.svg",zip:K1},Y1="add.svg",J1="annotate.svg",Q1="annotation.svg",eT="area.svg",tT="axes.svg",nT="bar.svg",rT="bindot.svg",oT="box.svg",iT="boxplot.svg",sT="bubble.svg",aT="calendar.svg",lT="canvas.svg",cT="checkbox.svg",dT="checkmark.svg",uT="clipboard.svg",pT="close.svg",hT="cluster.svg",fT="code.svg",mT="color.svg",gT="columns.svg",yT="container.svg",vT="cookie.svg",_T="copy.svg",CT="cpu.svg",wT="debug.svg",bT="dna.svg",xT="download.svg",kT="duplicate.svg",ST="edit.svg",ET="error.svg",TT="filter.svg",NT="generate.svg",AT="graph.svg",VT="heatmap.svg",BT="help.svg",PT="info.svg",RT="jitter.svg",DT="lasso.svg",IT="layers.svg",FT="learn.svg",OT="legend.svg",LT="line.svg",MT="link.svg",GT="loading.svg",$T="lock.svg",zT="maximize.svg",UT="menu.svg",ZT="minimize.svg",WT="minus.svg",jT="more.svg",HT="pause.svg",qT="pin.svg",KT="play.svg",XT="product.svg",YT="publications.svg",JT="renew.svg",QT="restart.svg",eN="reverse.svg",tN="search.svg",nN="server.svg",rN="settings.svg",oN="sina.svg",iN="skatterplot.svg",sN="slice.svg",aN="sort.svg",lN="statistics.svg",cN="stop.svg",dN="success.svg",uN="table.svg",pN="template.svg",hN="terminal.svg",fN="time.svg",mN="tune.svg",gN="venn.svg",yN="violin.svg",vN="warning.svg",_N="wetlab.svg",CN="zip.svg",wN={"add-layer":"add-layer.svg",add:Y1,"align-center":"align-center.svg","align-left":"align-left.svg","align-right":"align-right.svg",annotate:J1,annotation:Q1,area:eT,"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:tT,"bar-cross":"bar-cross.svg","bar-error":"bar-error.svg","bar-stacked":"bar-stacked.svg","bar-trend":"bar-trend.svg",bar:nT,bindot:rT,box:oT,"boxplot-binned":"boxplot-binned.svg","boxplot-jitter":"boxplot-jitter.svg","boxplot-notched":"boxplot-notched.svg",boxplot:iT,bubble:sT,calendar:aT,canvas:lT,"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:cT,checkmark:dT,"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:uT,close:pT,"cloud-download":"cloud-download.svg","cloud-offline":"cloud-offline.svg","cloud-online":"cloud-online.svg","cloud-upload":"cloud-upload.svg",cluster:hT,code:fT,"color-fill":"color-fill.svg","color-none":"color-none.svg","color-stroke":"color-stroke.svg",color:mT,columns:gT,"connected-points":"connected-points.svg",container:yT,cookie:vT,copy:_T,cpu:CT,"data-dimentions":"data-dimentions.svg",debug:wT,"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:xT,"drag-dots":"drag-dots.svg","drag-horizontal":"drag-horizontal.svg","drag-vertical":"drag-vertical.svg",duplicate:kT,edit:ST,"error-bar":"error-bar.svg",error:ET,"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:TT,"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:NT,graph:AT,heatmap:VT,"help-outline":"help-outline.svg",help:BT,"info-outline":"info-outline.svg",info:PT,jitter:RT,"jump-link":"jump-link.svg",lasso:DT,layers:IT,learn:FT,"legend-box-dot":"legend-box-dot.svg","legend-box":"legend-box.svg",legend:OT,"line-binned":"line-binned.svg","line-error":"line-error.svg","line-jitter":"line-jitter.svg",line:LT,"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:MT,loading:GT,lock:$T,maximize:zT,menu:UT,minimize:ZT,minus:WT,more:jT,"paper-clip":"paper-clip.svg",pause:HT,pin:qT,play:KT,"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:XT,publications:YT,"radio-button-checked":"radio-button-checked.svg","radio-button":"radio-button.svg",renew:JT,restart:QT,reverse:eN,"rotation-0":"rotation-0.svg","rotation-45":"rotation-45.svg","rotation-90":"rotation-90.svg",search:tN,"server-on":"server-on.svg",server:nN,settings:rN,sina:oN,skatterplot:iN,slice:sN,"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:aN,statistics:lN,stop:cN,"strip-plot":"strip-plot.svg",success:dN,"table-add":"table-add.svg","table-alias":"table-alias.svg","table-import":"table-import.svg",table:uN,template:pN,terminal:hN,"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:fN,tune:mN,venn:gN,"view-hide":"view-hide.svg","view-show":"view-show.svg","violin-binned":"violin-binned.svg","violin-jitter":"violin-jitter.svg",violin:yN,warning:vN,wetlab:_N,"windows-collapse":"windows-collapse.svg","windows-expand":"windows-expand.svg","x-axis":"x-axis.svg","y-axis":"y-axis.svg",zip:CN,"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 xN=["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"],kN=["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"],SN={allCssVariables:bN(),icons16:X1,icons24:wN},EN={class:"block__not-found"},TN=r.defineComponent({__name:"NotFound",setup(t){const n=_l().useApp(),o=()=>{n.updateNavigationState(i=>{i.href="/"})};return(i,l)=>(r.openBlock(),r.createElementBlock("div",EN,[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},NN={},AN={class:"block__loader-page"};function VN(t,e){return r.openBlock(),r.createElementBlock("div",AN,e[0]||(e[0]=[r.createElementVNode("div",{class:"loader-container"},[r.createElementVNode("i",{class:"mask-24 mask-loading loader-icon"})],-1)]))}const BN=Xl(NN,[["render",VN]]),PN={class:"pl-app-notification-alert"},RN={class:"pl-app-notification-alert__content"},DN={class:"pl-app-notification-alert__title"},IN=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",PN,[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",RN,[(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",DN,r.toDisplayString(p[0]),1),r.createVNode(r.unref(bp),{value:(h=p[1])==null?void 0:h.message},null,8,["value"])])}),128))])]),_:1},8,["modelValue"]),r.createVNode(r.unref(Zp),{modelValue:o.value,"onUpdate:modelValue":d[1]||(d[1]=p=>o.value=p),type:"error",closable:""},{actions:r.withCtx(()=>[r.createVNode(r.unref(Ns),{icon:"arrow-right",onClick:l},{default:r.withCtx(()=>d[3]||(d[3]=[r.createTextVNode("See errors")])),_:1}),r.createVNode(r.unref(lp))]),default:r.withCtx(()=>[d[4]||(d[4]=r.createTextVNode(" Some outputs have errors. "))]),_:1},8,["modelValue"])]))}}),FN={key:0,class:"block__loader"},ON=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",FN)):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)}}),LN={class:"block block__layout"},MN={key:0},GN=r.defineComponent({__name:"BlockLayout",setup(t){const e=_l(),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",LN,[r.createVNode(ON,{value:p.value},null,8,["value"]),r.unref(e).error?(r.openBlock(),r.createElementBlock("div",MN,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(TN,{key:3})):(r.openBlock(),r.createBlock(BN,{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(IN),{key:4,errors:c.value},null,8,["errors"])):r.createCommentVNode("",!0)]))}});var $s={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
- */Ps.exports,function(t,e){(function(){var n,o="4.17.21",s=200,l="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",c="Expected a function",u="Invalid `variable` option passed into `_.template`",p="__lodash_hash_undefined__",f=500,m="__lodash_placeholder__",_=1,x=2,S=4,V=1,I=2,G=1,v=2,R=4,L=8,F=16,T=32,$=64,U=128,O=256,Z=512,W=30,J="...",he=800,N=16,E=1,P=2,j=3,oe=1/0,ae=9007199254740991,Fe=17976931348623157e292,Ye=NaN,ft=4294967295,Cr=ft-1,Wr=ft>>>1,Fi=[["ary",U],["bind",G],["bindKey",v],["curry",L],["curryRight",F],["flip",Z],["partial",T],["partialRight",$],["rearg",O]],Eo="[object Arguments]",Ms="[object Array]",WB="[object AsyncFunction]",Ri="[object Boolean]",Mi="[object Date]",HB="[object DOMException]",Is="[object Error]",Os="[object Function]",Mp="[object GeneratorFunction]",wn="[object Map]",Ii="[object Number]",jB="[object Null]",Un="[object Object]",Ip="[object Promise]",qB="[object Proxy]",Oi="[object RegExp]",bn="[object Set]",Li="[object String]",Ls="[object Symbol]",KB="[object Undefined]",Gi="[object WeakMap]",YB="[object WeakSet]",zi="[object ArrayBuffer]",To="[object DataView]",zl="[object Float32Array]",$l="[object Float64Array]",Zl="[object Int8Array]",Ul="[object Int16Array]",Wl="[object Int32Array]",Hl="[object Uint8Array]",jl="[object Uint8ClampedArray]",ql="[object Uint16Array]",Kl="[object Uint32Array]",JB=/\b__p \+= '';/g,XB=/\b(__p \+=) '' \+/g,QB=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Op=/&(?:amp|lt|gt|quot|#39);/g,Lp=/[&<>"']/g,eV=RegExp(Op.source),tV=RegExp(Lp.source),nV=/<%-([\s\S]+?)%>/g,rV=/<%([\s\S]+?)%>/g,Gp=/<%=([\s\S]+?)%>/g,oV=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,iV=/^\w*$/,sV=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Yl=/[\\^$.*+?()[\]{}|]/g,aV=RegExp(Yl.source),Jl=/^\s+/,lV=/\s/,cV=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,dV=/\{\n\/\* \[wrapped with (.+)\] \*/,uV=/,? & /,pV=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,hV=/[()=,{}\[\]\/\s]/,fV=/\\(\\)?/g,mV=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,zp=/\w*$/,gV=/^[-+]0x[0-9a-f]+$/i,yV=/^0b[01]+$/i,_V=/^\[object .+?Constructor\]$/,CV=/^0o[0-7]+$/i,vV=/^(?:0|[1-9]\d*)$/,wV=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Gs=/($^)/,bV=/['\n\r\u2028\u2029\\]/g,zs="\\ud800-\\udfff",xV="\\u0300-\\u036f",kV="\\ufe20-\\ufe2f",SV="\\u20d0-\\u20ff",$p=xV+kV+SV,Zp="\\u2700-\\u27bf",Up="a-z\\xdf-\\xf6\\xf8-\\xff",EV="\\xac\\xb1\\xd7\\xf7",TV="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",BV="\\u2000-\\u206f",VV=" \\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",Wp="A-Z\\xc0-\\xd6\\xd8-\\xde",Hp="\\ufe0e\\ufe0f",jp=EV+TV+BV+VV,Xl="['’]",NV="["+zs+"]",qp="["+jp+"]",$s="["+$p+"]",Kp="\\d+",AV="["+Zp+"]",Yp="["+Up+"]",Jp="[^"+zs+jp+Kp+Zp+Up+Wp+"]",Ql="\\ud83c[\\udffb-\\udfff]",PV="(?:"+$s+"|"+Ql+")",Xp="[^"+zs+"]",ec="(?:\\ud83c[\\udde6-\\uddff]){2}",tc="[\\ud800-\\udbff][\\udc00-\\udfff]",Bo="["+Wp+"]",Qp="\\u200d",eh="(?:"+Yp+"|"+Jp+")",DV="(?:"+Bo+"|"+Jp+")",th="(?:"+Xl+"(?:d|ll|m|re|s|t|ve))?",nh="(?:"+Xl+"(?:D|LL|M|RE|S|T|VE))?",rh=PV+"?",oh="["+Hp+"]?",FV="(?:"+Qp+"(?:"+[Xp,ec,tc].join("|")+")"+oh+rh+")*",RV="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",MV="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",ih=oh+rh+FV,IV="(?:"+[AV,ec,tc].join("|")+")"+ih,OV="(?:"+[Xp+$s+"?",$s,ec,tc,NV].join("|")+")",LV=RegExp(Xl,"g"),GV=RegExp($s,"g"),nc=RegExp(Ql+"(?="+Ql+")|"+OV+ih,"g"),zV=RegExp([Bo+"?"+Yp+"+"+th+"(?="+[qp,Bo,"$"].join("|")+")",DV+"+"+nh+"(?="+[qp,Bo+eh,"$"].join("|")+")",Bo+"?"+eh+"+"+th,Bo+"+"+nh,MV,RV,Kp,IV].join("|"),"g"),$V=RegExp("["+Qp+zs+$p+Hp+"]"),ZV=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,UV=["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"],WV=-1,qe={};qe[zl]=qe[$l]=qe[Zl]=qe[Ul]=qe[Wl]=qe[Hl]=qe[jl]=qe[ql]=qe[Kl]=!0,qe[Eo]=qe[Ms]=qe[zi]=qe[Ri]=qe[To]=qe[Mi]=qe[Is]=qe[Os]=qe[wn]=qe[Ii]=qe[Un]=qe[Oi]=qe[bn]=qe[Li]=qe[Gi]=!1;var He={};He[Eo]=He[Ms]=He[zi]=He[To]=He[Ri]=He[Mi]=He[zl]=He[$l]=He[Zl]=He[Ul]=He[Wl]=He[wn]=He[Ii]=He[Un]=He[Oi]=He[bn]=He[Li]=He[Ls]=He[Hl]=He[jl]=He[ql]=He[Kl]=!0,He[Is]=He[Os]=He[Gi]=!1;var HV={À:"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"},jV={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},qV={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},KV={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},YV=parseFloat,JV=parseInt,sh=typeof $o=="object"&&$o&&$o.Object===Object&&$o,XV=typeof self=="object"&&self&&self.Object===Object&&self,gt=sh||XV||Function("return this")(),rc=e&&!e.nodeType&&e,Hr=rc&&!0&&t&&!t.nodeType&&t,ah=Hr&&Hr.exports===rc,oc=ah&&sh.process,Jt=function(){try{var A=Hr&&Hr.require&&Hr.require("util").types;return A||oc&&oc.binding&&oc.binding("util")}catch{}}(),lh=Jt&&Jt.isArrayBuffer,ch=Jt&&Jt.isDate,dh=Jt&&Jt.isMap,uh=Jt&&Jt.isRegExp,ph=Jt&&Jt.isSet,hh=Jt&&Jt.isTypedArray;function Wt(A,H,z){switch(z.length){case 0:return A.call(H);case 1:return A.call(H,z[0]);case 2:return A.call(H,z[0],z[1]);case 3:return A.call(H,z[0],z[1],z[2])}return A.apply(H,z)}function QV(A,H,z,le){for(var xe=-1,ze=A==null?0:A.length;++xe<ze;){var ct=A[xe];H(le,ct,z(ct),A)}return le}function Xt(A,H){for(var z=-1,le=A==null?0:A.length;++z<le&&H(A[z],z,A)!==!1;);return A}function eN(A,H){for(var z=A==null?0:A.length;z--&&H(A[z],z,A)!==!1;);return A}function fh(A,H){for(var z=-1,le=A==null?0:A.length;++z<le;)if(!H(A[z],z,A))return!1;return!0}function vr(A,H){for(var z=-1,le=A==null?0:A.length,xe=0,ze=[];++z<le;){var ct=A[z];H(ct,z,A)&&(ze[xe++]=ct)}return ze}function Zs(A,H){var z=A==null?0:A.length;return!!z&&Vo(A,H,0)>-1}function ic(A,H,z){for(var le=-1,xe=A==null?0:A.length;++le<xe;)if(z(H,A[le]))return!0;return!1}function Je(A,H){for(var z=-1,le=A==null?0:A.length,xe=Array(le);++z<le;)xe[z]=H(A[z],z,A);return xe}function wr(A,H){for(var z=-1,le=H.length,xe=A.length;++z<le;)A[xe+z]=H[z];return A}function sc(A,H,z,le){var xe=-1,ze=A==null?0:A.length;for(le&&ze&&(z=A[++xe]);++xe<ze;)z=H(z,A[xe],xe,A);return z}function tN(A,H,z,le){var xe=A==null?0:A.length;for(le&&xe&&(z=A[--xe]);xe--;)z=H(z,A[xe],xe,A);return z}function ac(A,H){for(var z=-1,le=A==null?0:A.length;++z<le;)if(H(A[z],z,A))return!0;return!1}var nN=lc("length");function rN(A){return A.split("")}function oN(A){return A.match(pV)||[]}function mh(A,H,z){var le;return z(A,function(xe,ze,ct){if(H(xe,ze,ct))return le=ze,!1}),le}function Us(A,H,z,le){for(var xe=A.length,ze=z+(le?1:-1);le?ze--:++ze<xe;)if(H(A[ze],ze,A))return ze;return-1}function Vo(A,H,z){return H===H?gN(A,H,z):Us(A,gh,z)}function iN(A,H,z,le){for(var xe=z-1,ze=A.length;++xe<ze;)if(le(A[xe],H))return xe;return-1}function gh(A){return A!==A}function yh(A,H){var z=A==null?0:A.length;return z?dc(A,H)/z:Ye}function lc(A){return function(H){return H==null?n:H[A]}}function cc(A){return function(H){return A==null?n:A[H]}}function _h(A,H,z,le,xe){return xe(A,function(ze,ct,We){z=le?(le=!1,ze):H(z,ze,ct,We)}),z}function sN(A,H){var z=A.length;for(A.sort(H);z--;)A[z]=A[z].value;return A}function dc(A,H){for(var z,le=-1,xe=A.length;++le<xe;){var ze=H(A[le]);ze!==n&&(z=z===n?ze:z+ze)}return z}function uc(A,H){for(var z=-1,le=Array(A);++z<A;)le[z]=H(z);return le}function aN(A,H){return Je(H,function(z){return[z,A[z]]})}function Ch(A){return A&&A.slice(0,xh(A)+1).replace(Jl,"")}function Ht(A){return function(H){return A(H)}}function pc(A,H){return Je(H,function(z){return A[z]})}function $i(A,H){return A.has(H)}function vh(A,H){for(var z=-1,le=A.length;++z<le&&Vo(H,A[z],0)>-1;);return z}function wh(A,H){for(var z=A.length;z--&&Vo(H,A[z],0)>-1;);return z}function lN(A,H){for(var z=A.length,le=0;z--;)A[z]===H&&++le;return le}var cN=cc(HV),dN=cc(jV);function uN(A){return"\\"+KV[A]}function pN(A,H){return A==null?n:A[H]}function No(A){return $V.test(A)}function hN(A){return ZV.test(A)}function fN(A){for(var H,z=[];!(H=A.next()).done;)z.push(H.value);return z}function hc(A){var H=-1,z=Array(A.size);return A.forEach(function(le,xe){z[++H]=[xe,le]}),z}function bh(A,H){return function(z){return A(H(z))}}function br(A,H){for(var z=-1,le=A.length,xe=0,ze=[];++z<le;){var ct=A[z];(ct===H||ct===m)&&(A[z]=m,ze[xe++]=z)}return ze}function Ws(A){var H=-1,z=Array(A.size);return A.forEach(function(le){z[++H]=le}),z}function mN(A){var H=-1,z=Array(A.size);return A.forEach(function(le){z[++H]=[le,le]}),z}function gN(A,H,z){for(var le=z-1,xe=A.length;++le<xe;)if(A[le]===H)return le;return-1}function yN(A,H,z){for(var le=z+1;le--;)if(A[le]===H)return le;return le}function Ao(A){return No(A)?CN(A):nN(A)}function xn(A){return No(A)?vN(A):rN(A)}function xh(A){for(var H=A.length;H--&&lV.test(A.charAt(H)););return H}var _N=cc(qV);function CN(A){for(var H=nc.lastIndex=0;nc.test(A);)++H;return H}function vN(A){return A.match(nc)||[]}function wN(A){return A.match(zV)||[]}var bN=function A(H){H=H==null?gt:Po.defaults(gt.Object(),H,Po.pick(gt,UV));var z=H.Array,le=H.Date,xe=H.Error,ze=H.Function,ct=H.Math,We=H.Object,fc=H.RegExp,xN=H.String,Qt=H.TypeError,Hs=z.prototype,kN=ze.prototype,Do=We.prototype,js=H["__core-js_shared__"],qs=kN.toString,Ue=Do.hasOwnProperty,SN=0,kh=function(){var i=/[^.]+$/.exec(js&&js.keys&&js.keys.IE_PROTO||"");return i?"Symbol(src)_1."+i:""}(),Ks=Do.toString,EN=qs.call(We),TN=gt._,BN=fc("^"+qs.call(Ue).replace(Yl,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ys=ah?H.Buffer:n,xr=H.Symbol,Js=H.Uint8Array,Sh=Ys?Ys.allocUnsafe:n,Xs=bh(We.getPrototypeOf,We),Eh=We.create,Th=Do.propertyIsEnumerable,Qs=Hs.splice,Bh=xr?xr.isConcatSpreadable:n,Zi=xr?xr.iterator:n,jr=xr?xr.toStringTag:n,ea=function(){try{var i=Xr(We,"defineProperty");return i({},"",{}),i}catch{}}(),VN=H.clearTimeout!==gt.clearTimeout&&H.clearTimeout,NN=le&&le.now!==gt.Date.now&&le.now,AN=H.setTimeout!==gt.setTimeout&&H.setTimeout,ta=ct.ceil,na=ct.floor,mc=We.getOwnPropertySymbols,PN=Ys?Ys.isBuffer:n,Vh=H.isFinite,DN=Hs.join,FN=bh(We.keys,We),dt=ct.max,xt=ct.min,RN=le.now,MN=H.parseInt,Nh=ct.random,IN=Hs.reverse,gc=Xr(H,"DataView"),Ui=Xr(H,"Map"),yc=Xr(H,"Promise"),Fo=Xr(H,"Set"),Wi=Xr(H,"WeakMap"),Hi=Xr(We,"create"),ra=Wi&&new Wi,Ro={},ON=Qr(gc),LN=Qr(Ui),GN=Qr(yc),zN=Qr(Fo),$N=Qr(Wi),oa=xr?xr.prototype:n,ji=oa?oa.valueOf:n,Ah=oa?oa.toString:n;function y(i){if(tt(i)&&!ke(i)&&!(i instanceof De)){if(i instanceof en)return i;if(Ue.call(i,"__wrapped__"))return Df(i)}return new en(i)}var Mo=function(){function i(){}return function(a){if(!et(a))return{};if(Eh)return Eh(a);i.prototype=a;var d=new i;return i.prototype=n,d}}();function ia(){}function en(i,a){this.__wrapped__=i,this.__actions__=[],this.__chain__=!!a,this.__index__=0,this.__values__=n}y.templateSettings={escape:nV,evaluate:rV,interpolate:Gp,variable:"",imports:{_:y}},y.prototype=ia.prototype,y.prototype.constructor=y,en.prototype=Mo(ia.prototype),en.prototype.constructor=en;function De(i){this.__wrapped__=i,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=ft,this.__views__=[]}function ZN(){var i=new De(this.__wrapped__);return i.__actions__=Ft(this.__actions__),i.__dir__=this.__dir__,i.__filtered__=this.__filtered__,i.__iteratees__=Ft(this.__iteratees__),i.__takeCount__=this.__takeCount__,i.__views__=Ft(this.__views__),i}function UN(){if(this.__filtered__){var i=new De(this);i.__dir__=-1,i.__filtered__=!0}else i=this.clone(),i.__dir__*=-1;return i}function WN(){var i=this.__wrapped__.value(),a=this.__dir__,d=ke(i),h=a<0,g=d?i.length:0,C=rP(0,g,this.__views__),k=C.start,B=C.end,D=B-k,q=h?B:k-1,K=this.__iteratees__,Y=K.length,te=0,de=xt(D,this.__takeCount__);if(!d||!h&&g==D&&de==D)return tf(i,this.__actions__);var ge=[];e:for(;D--&&te<de;){q+=a;for(var Ne=-1,ye=i[q];++Ne<Y;){var Pe=K[Ne],Re=Pe.iteratee,Kt=Pe.type,At=Re(ye);if(Kt==P)ye=At;else if(!At){if(Kt==E)continue e;break e}}ge[te++]=ye}return ge}De.prototype=Mo(ia.prototype),De.prototype.constructor=De;function qr(i){var a=-1,d=i==null?0:i.length;for(this.clear();++a<d;){var h=i[a];this.set(h[0],h[1])}}function HN(){this.__data__=Hi?Hi(null):{},this.size=0}function jN(i){var a=this.has(i)&&delete this.__data__[i];return this.size-=a?1:0,a}function qN(i){var a=this.__data__;if(Hi){var d=a[i];return d===p?n:d}return Ue.call(a,i)?a[i]:n}function KN(i){var a=this.__data__;return Hi?a[i]!==n:Ue.call(a,i)}function YN(i,a){var d=this.__data__;return this.size+=this.has(i)?0:1,d[i]=Hi&&a===n?p:a,this}qr.prototype.clear=HN,qr.prototype.delete=jN,qr.prototype.get=qN,qr.prototype.has=KN,qr.prototype.set=YN;function Wn(i){var a=-1,d=i==null?0:i.length;for(this.clear();++a<d;){var h=i[a];this.set(h[0],h[1])}}function JN(){this.__data__=[],this.size=0}function XN(i){var a=this.__data__,d=sa(a,i);if(d<0)return!1;var h=a.length-1;return d==h?a.pop():Qs.call(a,d,1),--this.size,!0}function QN(i){var a=this.__data__,d=sa(a,i);return d<0?n:a[d][1]}function eA(i){return sa(this.__data__,i)>-1}function tA(i,a){var d=this.__data__,h=sa(d,i);return h<0?(++this.size,d.push([i,a])):d[h][1]=a,this}Wn.prototype.clear=JN,Wn.prototype.delete=XN,Wn.prototype.get=QN,Wn.prototype.has=eA,Wn.prototype.set=tA;function Hn(i){var a=-1,d=i==null?0:i.length;for(this.clear();++a<d;){var h=i[a];this.set(h[0],h[1])}}function nA(){this.size=0,this.__data__={hash:new qr,map:new(Ui||Wn),string:new qr}}function rA(i){var a=_a(this,i).delete(i);return this.size-=a?1:0,a}function oA(i){return _a(this,i).get(i)}function iA(i){return _a(this,i).has(i)}function sA(i,a){var d=_a(this,i),h=d.size;return d.set(i,a),this.size+=d.size==h?0:1,this}Hn.prototype.clear=nA,Hn.prototype.delete=rA,Hn.prototype.get=oA,Hn.prototype.has=iA,Hn.prototype.set=sA;function Kr(i){var a=-1,d=i==null?0:i.length;for(this.__data__=new Hn;++a<d;)this.add(i[a])}function aA(i){return this.__data__.set(i,p),this}function lA(i){return this.__data__.has(i)}Kr.prototype.add=Kr.prototype.push=aA,Kr.prototype.has=lA;function kn(i){var a=this.__data__=new Wn(i);this.size=a.size}function cA(){this.__data__=new Wn,this.size=0}function dA(i){var a=this.__data__,d=a.delete(i);return this.size=a.size,d}function uA(i){return this.__data__.get(i)}function pA(i){return this.__data__.has(i)}function hA(i,a){var d=this.__data__;if(d instanceof Wn){var h=d.__data__;if(!Ui||h.length<s-1)return h.push([i,a]),this.size=++d.size,this;d=this.__data__=new Hn(h)}return d.set(i,a),this.size=d.size,this}kn.prototype.clear=cA,kn.prototype.delete=dA,kn.prototype.get=uA,kn.prototype.has=pA,kn.prototype.set=hA;function Ph(i,a){var d=ke(i),h=!d&&eo(i),g=!d&&!h&&Br(i),C=!d&&!h&&!g&&Go(i),k=d||h||g||C,B=k?uc(i.length,xN):[],D=B.length;for(var q in i)(a||Ue.call(i,q))&&!(k&&(q=="length"||g&&(q=="offset"||q=="parent")||C&&(q=="buffer"||q=="byteLength"||q=="byteOffset")||Yn(q,D)))&&B.push(q);return B}function Dh(i){var a=i.length;return a?i[Bc(0,a-1)]:n}function fA(i,a){return Ca(Ft(i),Yr(a,0,i.length))}function mA(i){return Ca(Ft(i))}function _c(i,a,d){(d!==n&&!Sn(i[a],d)||d===n&&!(a in i))&&jn(i,a,d)}function qi(i,a,d){var h=i[a];(!(Ue.call(i,a)&&Sn(h,d))||d===n&&!(a in i))&&jn(i,a,d)}function sa(i,a){for(var d=i.length;d--;)if(Sn(i[d][0],a))return d;return-1}function gA(i,a,d,h){return kr(i,function(g,C,k){a(h,g,d(g),k)}),h}function Fh(i,a){return i&&In(a,mt(a),i)}function yA(i,a){return i&&In(a,Mt(a),i)}function jn(i,a,d){a=="__proto__"&&ea?ea(i,a,{configurable:!0,enumerable:!0,value:d,writable:!0}):i[a]=d}function Cc(i,a){for(var d=-1,h=a.length,g=z(h),C=i==null;++d<h;)g[d]=C?n:Qc(i,a[d]);return g}function Yr(i,a,d){return i===i&&(d!==n&&(i=i<=d?i:d),a!==n&&(i=i>=a?i:a)),i}function tn(i,a,d,h,g,C){var k,B=a&_,D=a&x,q=a&S;if(d&&(k=g?d(i,h,g,C):d(i)),k!==n)return k;if(!et(i))return i;var K=ke(i);if(K){if(k=iP(i),!B)return Ft(i,k)}else{var Y=kt(i),te=Y==Os||Y==Mp;if(Br(i))return of(i,B);if(Y==Un||Y==Eo||te&&!g){if(k=D||te?{}:kf(i),!B)return D?qA(i,yA(k,i)):jA(i,Fh(k,i))}else{if(!He[Y])return g?i:{};k=sP(i,Y,B)}}C||(C=new kn);var de=C.get(i);if(de)return de;C.set(i,k),Qf(i)?i.forEach(function(ye){k.add(tn(ye,a,d,ye,i,C))}):Jf(i)&&i.forEach(function(ye,Pe){k.set(Pe,tn(ye,a,d,Pe,i,C))});var ge=q?D?Lc:Oc:D?Mt:mt,Ne=K?n:ge(i);return Xt(Ne||i,function(ye,Pe){Ne&&(Pe=ye,ye=i[Pe]),qi(k,Pe,tn(ye,a,d,Pe,i,C))}),k}function _A(i){var a=mt(i);return function(d){return Rh(d,i,a)}}function Rh(i,a,d){var h=d.length;if(i==null)return!h;for(i=We(i);h--;){var g=d[h],C=a[g],k=i[g];if(k===n&&!(g in i)||!C(k))return!1}return!0}function Mh(i,a,d){if(typeof i!="function")throw new Qt(c);return ts(function(){i.apply(n,d)},a)}function Ki(i,a,d,h){var g=-1,C=Zs,k=!0,B=i.length,D=[],q=a.length;if(!B)return D;d&&(a=Je(a,Ht(d))),h?(C=ic,k=!1):a.length>=s&&(C=$i,k=!1,a=new Kr(a));e:for(;++g<B;){var K=i[g],Y=d==null?K:d(K);if(K=h||K!==0?K:0,k&&Y===Y){for(var te=q;te--;)if(a[te]===Y)continue e;D.push(K)}else C(a,Y,h)||D.push(K)}return D}var kr=df(Mn),Ih=df(wc,!0);function CA(i,a){var d=!0;return kr(i,function(h,g,C){return d=!!a(h,g,C),d}),d}function aa(i,a,d){for(var h=-1,g=i.length;++h<g;){var C=i[h],k=a(C);if(k!=null&&(B===n?k===k&&!qt(k):d(k,B)))var B=k,D=C}return D}function vA(i,a,d,h){var g=i.length;for(d=Te(d),d<0&&(d=-d>g?0:g+d),h=h===n||h>g?g:Te(h),h<0&&(h+=g),h=d>h?0:tm(h);d<h;)i[d++]=a;return i}function Oh(i,a){var d=[];return kr(i,function(h,g,C){a(h,g,C)&&d.push(h)}),d}function yt(i,a,d,h,g){var C=-1,k=i.length;for(d||(d=lP),g||(g=[]);++C<k;){var B=i[C];a>0&&d(B)?a>1?yt(B,a-1,d,h,g):wr(g,B):h||(g[g.length]=B)}return g}var vc=uf(),Lh=uf(!0);function Mn(i,a){return i&&vc(i,a,mt)}function wc(i,a){return i&&Lh(i,a,mt)}function la(i,a){return vr(a,function(d){return Jn(i[d])})}function Jr(i,a){a=Er(a,i);for(var d=0,h=a.length;i!=null&&d<h;)i=i[On(a[d++])];return d&&d==h?i:n}function Gh(i,a,d){var h=a(i);return ke(i)?h:wr(h,d(i))}function Vt(i){return i==null?i===n?KB:jB:jr&&jr in We(i)?nP(i):mP(i)}function bc(i,a){return i>a}function wA(i,a){return i!=null&&Ue.call(i,a)}function bA(i,a){return i!=null&&a in We(i)}function xA(i,a,d){return i>=xt(a,d)&&i<dt(a,d)}function xc(i,a,d){for(var h=d?ic:Zs,g=i[0].length,C=i.length,k=C,B=z(C),D=1/0,q=[];k--;){var K=i[k];k&&a&&(K=Je(K,Ht(a))),D=xt(K.length,D),B[k]=!d&&(a||g>=120&&K.length>=120)?new Kr(k&&K):n}K=i[0];var Y=-1,te=B[0];e:for(;++Y<g&&q.length<D;){var de=K[Y],ge=a?a(de):de;if(de=d||de!==0?de:0,!(te?$i(te,ge):h(q,ge,d))){for(k=C;--k;){var Ne=B[k];if(!(Ne?$i(Ne,ge):h(i[k],ge,d)))continue e}te&&te.push(ge),q.push(de)}}return q}function kA(i,a,d,h){return Mn(i,function(g,C,k){a(h,d(g),C,k)}),h}function Yi(i,a,d){a=Er(a,i),i=Bf(i,a);var h=i==null?i:i[On(rn(a))];return h==null?n:Wt(h,i,d)}function zh(i){return tt(i)&&Vt(i)==Eo}function SA(i){return tt(i)&&Vt(i)==zi}function EA(i){return tt(i)&&Vt(i)==Mi}function Ji(i,a,d,h,g){return i===a?!0:i==null||a==null||!tt(i)&&!tt(a)?i!==i&&a!==a:TA(i,a,d,h,Ji,g)}function TA(i,a,d,h,g,C){var k=ke(i),B=ke(a),D=k?Ms:kt(i),q=B?Ms:kt(a);D=D==Eo?Un:D,q=q==Eo?Un:q;var K=D==Un,Y=q==Un,te=D==q;if(te&&Br(i)){if(!Br(a))return!1;k=!0,K=!1}if(te&&!K)return C||(C=new kn),k||Go(i)?wf(i,a,d,h,g,C):eP(i,a,D,d,h,g,C);if(!(d&V)){var de=K&&Ue.call(i,"__wrapped__"),ge=Y&&Ue.call(a,"__wrapped__");if(de||ge){var Ne=de?i.value():i,ye=ge?a.value():a;return C||(C=new kn),g(Ne,ye,d,h,C)}}return te?(C||(C=new kn),tP(i,a,d,h,g,C)):!1}function BA(i){return tt(i)&&kt(i)==wn}function kc(i,a,d,h){var g=d.length,C=g,k=!h;if(i==null)return!C;for(i=We(i);g--;){var B=d[g];if(k&&B[2]?B[1]!==i[B[0]]:!(B[0]in i))return!1}for(;++g<C;){B=d[g];var D=B[0],q=i[D],K=B[1];if(k&&B[2]){if(q===n&&!(D in i))return!1}else{var Y=new kn;if(h)var te=h(q,K,D,i,a,Y);if(!(te===n?Ji(K,q,V|I,h,Y):te))return!1}}return!0}function $h(i){if(!et(i)||dP(i))return!1;var a=Jn(i)?BN:_V;return a.test(Qr(i))}function VA(i){return tt(i)&&Vt(i)==Oi}function NA(i){return tt(i)&&kt(i)==bn}function AA(i){return tt(i)&&Sa(i.length)&&!!qe[Vt(i)]}function Zh(i){return typeof i=="function"?i:i==null?It:typeof i=="object"?ke(i)?Hh(i[0],i[1]):Wh(i):pm(i)}function Sc(i){if(!es(i))return FN(i);var a=[];for(var d in We(i))Ue.call(i,d)&&d!="constructor"&&a.push(d);return a}function PA(i){if(!et(i))return fP(i);var a=es(i),d=[];for(var h in i)h=="constructor"&&(a||!Ue.call(i,h))||d.push(h);return d}function Ec(i,a){return i<a}function Uh(i,a){var d=-1,h=Rt(i)?z(i.length):[];return kr(i,function(g,C,k){h[++d]=a(g,C,k)}),h}function Wh(i){var a=zc(i);return a.length==1&&a[0][2]?Ef(a[0][0],a[0][1]):function(d){return d===i||kc(d,i,a)}}function Hh(i,a){return Zc(i)&&Sf(a)?Ef(On(i),a):function(d){var h=Qc(d,i);return h===n&&h===a?ed(d,i):Ji(a,h,V|I)}}function ca(i,a,d,h,g){i!==a&&vc(a,function(C,k){if(g||(g=new kn),et(C))DA(i,a,k,d,ca,h,g);else{var B=h?h(Wc(i,k),C,k+"",i,a,g):n;B===n&&(B=C),_c(i,k,B)}},Mt)}function DA(i,a,d,h,g,C,k){var B=Wc(i,d),D=Wc(a,d),q=k.get(D);if(q){_c(i,d,q);return}var K=C?C(B,D,d+"",i,a,k):n,Y=K===n;if(Y){var te=ke(D),de=!te&&Br(D),ge=!te&&!de&&Go(D);K=D,te||de||ge?ke(B)?K=B:rt(B)?K=Ft(B):de?(Y=!1,K=of(D,!0)):ge?(Y=!1,K=sf(D,!0)):K=[]:ns(D)||eo(D)?(K=B,eo(B)?K=nm(B):(!et(B)||Jn(B))&&(K=kf(D))):Y=!1}Y&&(k.set(D,K),g(K,D,h,C,k),k.delete(D)),_c(i,d,K)}function jh(i,a){var d=i.length;if(d)return a+=a<0?d:0,Yn(a,d)?i[a]:n}function qh(i,a,d){a.length?a=Je(a,function(C){return ke(C)?function(k){return Jr(k,C.length===1?C[0]:C)}:C}):a=[It];var h=-1;a=Je(a,Ht(fe()));var g=Uh(i,function(C,k,B){var D=Je(a,function(q){return q(C)});return{criteria:D,index:++h,value:C}});return sN(g,function(C,k){return HA(C,k,d)})}function FA(i,a){return Kh(i,a,function(d,h){return ed(i,h)})}function Kh(i,a,d){for(var h=-1,g=a.length,C={};++h<g;){var k=a[h],B=Jr(i,k);d(B,k)&&Xi(C,Er(k,i),B)}return C}function RA(i){return function(a){return Jr(a,i)}}function Tc(i,a,d,h){var g=h?iN:Vo,C=-1,k=a.length,B=i;for(i===a&&(a=Ft(a)),d&&(B=Je(i,Ht(d)));++C<k;)for(var D=0,q=a[C],K=d?d(q):q;(D=g(B,K,D,h))>-1;)B!==i&&Qs.call(B,D,1),Qs.call(i,D,1);return i}function Yh(i,a){for(var d=i?a.length:0,h=d-1;d--;){var g=a[d];if(d==h||g!==C){var C=g;Yn(g)?Qs.call(i,g,1):Ac(i,g)}}return i}function Bc(i,a){return i+na(Nh()*(a-i+1))}function MA(i,a,d,h){for(var g=-1,C=dt(ta((a-i)/(d||1)),0),k=z(C);C--;)k[h?C:++g]=i,i+=d;return k}function Vc(i,a){var d="";if(!i||a<1||a>ae)return d;do a%2&&(d+=i),a=na(a/2),a&&(i+=i);while(a);return d}function Ae(i,a){return Hc(Tf(i,a,It),i+"")}function IA(i){return Dh(zo(i))}function OA(i,a){var d=zo(i);return Ca(d,Yr(a,0,d.length))}function Xi(i,a,d,h){if(!et(i))return i;a=Er(a,i);for(var g=-1,C=a.length,k=C-1,B=i;B!=null&&++g<C;){var D=On(a[g]),q=d;if(D==="__proto__"||D==="constructor"||D==="prototype")return i;if(g!=k){var K=B[D];q=h?h(K,D,B):n,q===n&&(q=et(K)?K:Yn(a[g+1])?[]:{})}qi(B,D,q),B=B[D]}return i}var Jh=ra?function(i,a){return ra.set(i,a),i}:It,LA=ea?function(i,a){return ea(i,"toString",{configurable:!0,enumerable:!1,value:nd(a),writable:!0})}:It;function GA(i){return Ca(zo(i))}function nn(i,a,d){var h=-1,g=i.length;a<0&&(a=-a>g?0:g+a),d=d>g?g:d,d<0&&(d+=g),g=a>d?0:d-a>>>0,a>>>=0;for(var C=z(g);++h<g;)C[h]=i[h+a];return C}function zA(i,a){var d;return kr(i,function(h,g,C){return d=a(h,g,C),!d}),!!d}function da(i,a,d){var h=0,g=i==null?h:i.length;if(typeof a=="number"&&a===a&&g<=Wr){for(;h<g;){var C=h+g>>>1,k=i[C];k!==null&&!qt(k)&&(d?k<=a:k<a)?h=C+1:g=C}return g}return Nc(i,a,It,d)}function Nc(i,a,d,h){var g=0,C=i==null?0:i.length;if(C===0)return 0;a=d(a);for(var k=a!==a,B=a===null,D=qt(a),q=a===n;g<C;){var K=na((g+C)/2),Y=d(i[K]),te=Y!==n,de=Y===null,ge=Y===Y,Ne=qt(Y);if(k)var ye=h||ge;else q?ye=ge&&(h||te):B?ye=ge&&te&&(h||!de):D?ye=ge&&te&&!de&&(h||!Ne):de||Ne?ye=!1:ye=h?Y<=a:Y<a;ye?g=K+1:C=K}return xt(C,Cr)}function Xh(i,a){for(var d=-1,h=i.length,g=0,C=[];++d<h;){var k=i[d],B=a?a(k):k;if(!d||!Sn(B,D)){var D=B;C[g++]=k===0?0:k}}return C}function Qh(i){return typeof i=="number"?i:qt(i)?Ye:+i}function jt(i){if(typeof i=="string")return i;if(ke(i))return Je(i,jt)+"";if(qt(i))return Ah?Ah.call(i):"";var a=i+"";return a=="0"&&1/i==-oe?"-0":a}function Sr(i,a,d){var h=-1,g=Zs,C=i.length,k=!0,B=[],D=B;if(d)k=!1,g=ic;else if(C>=s){var q=a?null:XA(i);if(q)return Ws(q);k=!1,g=$i,D=new Kr}else D=a?[]:B;e:for(;++h<C;){var K=i[h],Y=a?a(K):K;if(K=d||K!==0?K:0,k&&Y===Y){for(var te=D.length;te--;)if(D[te]===Y)continue e;a&&D.push(Y),B.push(K)}else g(D,Y,d)||(D!==B&&D.push(Y),B.push(K))}return B}function Ac(i,a){return a=Er(a,i),i=Bf(i,a),i==null||delete i[On(rn(a))]}function ef(i,a,d,h){return Xi(i,a,d(Jr(i,a)),h)}function ua(i,a,d,h){for(var g=i.length,C=h?g:-1;(h?C--:++C<g)&&a(i[C],C,i););return d?nn(i,h?0:C,h?C+1:g):nn(i,h?C+1:0,h?g:C)}function tf(i,a){var d=i;return d instanceof De&&(d=d.value()),sc(a,function(h,g){return g.func.apply(g.thisArg,wr([h],g.args))},d)}function Pc(i,a,d){var h=i.length;if(h<2)return h?Sr(i[0]):[];for(var g=-1,C=z(h);++g<h;)for(var k=i[g],B=-1;++B<h;)B!=g&&(C[g]=Ki(C[g]||k,i[B],a,d));return Sr(yt(C,1),a,d)}function nf(i,a,d){for(var h=-1,g=i.length,C=a.length,k={};++h<g;){var B=h<C?a[h]:n;d(k,i[h],B)}return k}function Dc(i){return rt(i)?i:[]}function Fc(i){return typeof i=="function"?i:It}function Er(i,a){return ke(i)?i:Zc(i,a)?[i]:Pf(Ze(i))}var $A=Ae;function Tr(i,a,d){var h=i.length;return d=d===n?h:d,!a&&d>=h?i:nn(i,a,d)}var rf=VN||function(i){return gt.clearTimeout(i)};function of(i,a){if(a)return i.slice();var d=i.length,h=Sh?Sh(d):new i.constructor(d);return i.copy(h),h}function Rc(i){var a=new i.constructor(i.byteLength);return new Js(a).set(new Js(i)),a}function ZA(i,a){var d=a?Rc(i.buffer):i.buffer;return new i.constructor(d,i.byteOffset,i.byteLength)}function UA(i){var a=new i.constructor(i.source,zp.exec(i));return a.lastIndex=i.lastIndex,a}function WA(i){return ji?We(ji.call(i)):{}}function sf(i,a){var d=a?Rc(i.buffer):i.buffer;return new i.constructor(d,i.byteOffset,i.length)}function af(i,a){if(i!==a){var d=i!==n,h=i===null,g=i===i,C=qt(i),k=a!==n,B=a===null,D=a===a,q=qt(a);if(!B&&!q&&!C&&i>a||C&&k&&D&&!B&&!q||h&&k&&D||!d&&D||!g)return 1;if(!h&&!C&&!q&&i<a||q&&d&&g&&!h&&!C||B&&d&&g||!k&&g||!D)return-1}return 0}function HA(i,a,d){for(var h=-1,g=i.criteria,C=a.criteria,k=g.length,B=d.length;++h<k;){var D=af(g[h],C[h]);if(D){if(h>=B)return D;var q=d[h];return D*(q=="desc"?-1:1)}}return i.index-a.index}function lf(i,a,d,h){for(var g=-1,C=i.length,k=d.length,B=-1,D=a.length,q=dt(C-k,0),K=z(D+q),Y=!h;++B<D;)K[B]=a[B];for(;++g<k;)(Y||g<C)&&(K[d[g]]=i[g]);for(;q--;)K[B++]=i[g++];return K}function cf(i,a,d,h){for(var g=-1,C=i.length,k=-1,B=d.length,D=-1,q=a.length,K=dt(C-B,0),Y=z(K+q),te=!h;++g<K;)Y[g]=i[g];for(var de=g;++D<q;)Y[de+D]=a[D];for(;++k<B;)(te||g<C)&&(Y[de+d[k]]=i[g++]);return Y}function Ft(i,a){var d=-1,h=i.length;for(a||(a=z(h));++d<h;)a[d]=i[d];return a}function In(i,a,d,h){var g=!d;d||(d={});for(var C=-1,k=a.length;++C<k;){var B=a[C],D=h?h(d[B],i[B],B,d,i):n;D===n&&(D=i[B]),g?jn(d,B,D):qi(d,B,D)}return d}function jA(i,a){return In(i,$c(i),a)}function qA(i,a){return In(i,bf(i),a)}function pa(i,a){return function(d,h){var g=ke(d)?QV:gA,C=a?a():{};return g(d,i,fe(h,2),C)}}function Io(i){return Ae(function(a,d){var h=-1,g=d.length,C=g>1?d[g-1]:n,k=g>2?d[2]:n;for(C=i.length>3&&typeof C=="function"?(g--,C):n,k&&Nt(d[0],d[1],k)&&(C=g<3?n:C,g=1),a=We(a);++h<g;){var B=d[h];B&&i(a,B,h,C)}return a})}function df(i,a){return function(d,h){if(d==null)return d;if(!Rt(d))return i(d,h);for(var g=d.length,C=a?g:-1,k=We(d);(a?C--:++C<g)&&h(k[C],C,k)!==!1;);return d}}function uf(i){return function(a,d,h){for(var g=-1,C=We(a),k=h(a),B=k.length;B--;){var D=k[i?B:++g];if(d(C[D],D,C)===!1)break}return a}}function KA(i,a,d){var h=a&G,g=Qi(i);function C(){var k=this&&this!==gt&&this instanceof C?g:i;return k.apply(h?d:this,arguments)}return C}function pf(i){return function(a){a=Ze(a);var d=No(a)?xn(a):n,h=d?d[0]:a.charAt(0),g=d?Tr(d,1).join(""):a.slice(1);return h[i]()+g}}function Oo(i){return function(a){return sc(dm(cm(a).replace(LV,"")),i,"")}}function Qi(i){return function(){var a=arguments;switch(a.length){case 0:return new i;case 1:return new i(a[0]);case 2:return new i(a[0],a[1]);case 3:return new i(a[0],a[1],a[2]);case 4:return new i(a[0],a[1],a[2],a[3]);case 5:return new i(a[0],a[1],a[2],a[3],a[4]);case 6:return new i(a[0],a[1],a[2],a[3],a[4],a[5]);case 7:return new i(a[0],a[1],a[2],a[3],a[4],a[5],a[6])}var d=Mo(i.prototype),h=i.apply(d,a);return et(h)?h:d}}function YA(i,a,d){var h=Qi(i);function g(){for(var C=arguments.length,k=z(C),B=C,D=Lo(g);B--;)k[B]=arguments[B];var q=C<3&&k[0]!==D&&k[C-1]!==D?[]:br(k,D);if(C-=q.length,C<d)return yf(i,a,ha,g.placeholder,n,k,q,n,n,d-C);var K=this&&this!==gt&&this instanceof g?h:i;return Wt(K,this,k)}return g}function hf(i){return function(a,d,h){var g=We(a);if(!Rt(a)){var C=fe(d,3);a=mt(a),d=function(B){return C(g[B],B,g)}}var k=i(a,d,h);return k>-1?g[C?a[k]:k]:n}}function ff(i){return Kn(function(a){var d=a.length,h=d,g=en.prototype.thru;for(i&&a.reverse();h--;){var C=a[h];if(typeof C!="function")throw new Qt(c);if(g&&!k&&ya(C)=="wrapper")var k=new en([],!0)}for(h=k?h:d;++h<d;){C=a[h];var B=ya(C),D=B=="wrapper"?Gc(C):n;D&&Uc(D[0])&&D[1]==(U|L|T|O)&&!D[4].length&&D[9]==1?k=k[ya(D[0])].apply(k,D[3]):k=C.length==1&&Uc(C)?k[B]():k.thru(C)}return function(){var q=arguments,K=q[0];if(k&&q.length==1&&ke(K))return k.plant(K).value();for(var Y=0,te=d?a[Y].apply(this,q):K;++Y<d;)te=a[Y].call(this,te);return te}})}function ha(i,a,d,h,g,C,k,B,D,q){var K=a&U,Y=a&G,te=a&v,de=a&(L|F),ge=a&Z,Ne=te?n:Qi(i);function ye(){for(var Pe=arguments.length,Re=z(Pe),Kt=Pe;Kt--;)Re[Kt]=arguments[Kt];if(de)var At=Lo(ye),Yt=lN(Re,At);if(h&&(Re=lf(Re,h,g,de)),C&&(Re=cf(Re,C,k,de)),Pe-=Yt,de&&Pe<q){var ot=br(Re,At);return yf(i,a,ha,ye.placeholder,d,Re,ot,B,D,q-Pe)}var En=Y?d:this,Qn=te?En[i]:i;return Pe=Re.length,B?Re=gP(Re,B):ge&&Pe>1&&Re.reverse(),K&&D<Pe&&(Re.length=D),this&&this!==gt&&this instanceof ye&&(Qn=Ne||Qi(Qn)),Qn.apply(En,Re)}return ye}function mf(i,a){return function(d,h){return kA(d,i,a(h),{})}}function fa(i,a){return function(d,h){var g;if(d===n&&h===n)return a;if(d!==n&&(g=d),h!==n){if(g===n)return h;typeof d=="string"||typeof h=="string"?(d=jt(d),h=jt(h)):(d=Qh(d),h=Qh(h)),g=i(d,h)}return g}}function Mc(i){return Kn(function(a){return a=Je(a,Ht(fe())),Ae(function(d){var h=this;return i(a,function(g){return Wt(g,h,d)})})})}function ma(i,a){a=a===n?" ":jt(a);var d=a.length;if(d<2)return d?Vc(a,i):a;var h=Vc(a,ta(i/Ao(a)));return No(a)?Tr(xn(h),0,i).join(""):h.slice(0,i)}function JA(i,a,d,h){var g=a&G,C=Qi(i);function k(){for(var B=-1,D=arguments.length,q=-1,K=h.length,Y=z(K+D),te=this&&this!==gt&&this instanceof k?C:i;++q<K;)Y[q]=h[q];for(;D--;)Y[q++]=arguments[++B];return Wt(te,g?d:this,Y)}return k}function gf(i){return function(a,d,h){return h&&typeof h!="number"&&Nt(a,d,h)&&(d=h=n),a=Xn(a),d===n?(d=a,a=0):d=Xn(d),h=h===n?a<d?1:-1:Xn(h),MA(a,d,h,i)}}function ga(i){return function(a,d){return typeof a=="string"&&typeof d=="string"||(a=on(a),d=on(d)),i(a,d)}}function yf(i,a,d,h,g,C,k,B,D,q){var K=a&L,Y=K?k:n,te=K?n:k,de=K?C:n,ge=K?n:C;a|=K?T:$,a&=~(K?$:T),a&R||(a&=~(G|v));var Ne=[i,a,g,de,Y,ge,te,B,D,q],ye=d.apply(n,Ne);return Uc(i)&&Vf(ye,Ne),ye.placeholder=h,Nf(ye,i,a)}function Ic(i){var a=ct[i];return function(d,h){if(d=on(d),h=h==null?0:xt(Te(h),292),h&&Vh(d)){var g=(Ze(d)+"e").split("e"),C=a(g[0]+"e"+(+g[1]+h));return g=(Ze(C)+"e").split("e"),+(g[0]+"e"+(+g[1]-h))}return a(d)}}var XA=Fo&&1/Ws(new Fo([,-0]))[1]==oe?function(i){return new Fo(i)}:id;function _f(i){return function(a){var d=kt(a);return d==wn?hc(a):d==bn?mN(a):aN(a,i(a))}}function qn(i,a,d,h,g,C,k,B){var D=a&v;if(!D&&typeof i!="function")throw new Qt(c);var q=h?h.length:0;if(q||(a&=~(T|$),h=g=n),k=k===n?k:dt(Te(k),0),B=B===n?B:Te(B),q-=g?g.length:0,a&$){var K=h,Y=g;h=g=n}var te=D?n:Gc(i),de=[i,a,d,h,g,K,Y,C,k,B];if(te&&hP(de,te),i=de[0],a=de[1],d=de[2],h=de[3],g=de[4],B=de[9]=de[9]===n?D?0:i.length:dt(de[9]-q,0),!B&&a&(L|F)&&(a&=~(L|F)),!a||a==G)var ge=KA(i,a,d);else a==L||a==F?ge=YA(i,a,B):(a==T||a==(G|T))&&!g.length?ge=JA(i,a,d,h):ge=ha.apply(n,de);var Ne=te?Jh:Vf;return Nf(Ne(ge,de),i,a)}function Cf(i,a,d,h){return i===n||Sn(i,Do[d])&&!Ue.call(h,d)?a:i}function vf(i,a,d,h,g,C){return et(i)&&et(a)&&(C.set(a,i),ca(i,a,n,vf,C),C.delete(a)),i}function QA(i){return ns(i)?n:i}function wf(i,a,d,h,g,C){var k=d&V,B=i.length,D=a.length;if(B!=D&&!(k&&D>B))return!1;var q=C.get(i),K=C.get(a);if(q&&K)return q==a&&K==i;var Y=-1,te=!0,de=d&I?new Kr:n;for(C.set(i,a),C.set(a,i);++Y<B;){var ge=i[Y],Ne=a[Y];if(h)var ye=k?h(Ne,ge,Y,a,i,C):h(ge,Ne,Y,i,a,C);if(ye!==n){if(ye)continue;te=!1;break}if(de){if(!ac(a,function(Pe,Re){if(!$i(de,Re)&&(ge===Pe||g(ge,Pe,d,h,C)))return de.push(Re)})){te=!1;break}}else if(!(ge===Ne||g(ge,Ne,d,h,C))){te=!1;break}}return C.delete(i),C.delete(a),te}function eP(i,a,d,h,g,C,k){switch(d){case To:if(i.byteLength!=a.byteLength||i.byteOffset!=a.byteOffset)return!1;i=i.buffer,a=a.buffer;case zi:return!(i.byteLength!=a.byteLength||!C(new Js(i),new Js(a)));case Ri:case Mi:case Ii:return Sn(+i,+a);case Is:return i.name==a.name&&i.message==a.message;case Oi:case Li:return i==a+"";case wn:var B=hc;case bn:var D=h&V;if(B||(B=Ws),i.size!=a.size&&!D)return!1;var q=k.get(i);if(q)return q==a;h|=I,k.set(i,a);var K=wf(B(i),B(a),h,g,C,k);return k.delete(i),K;case Ls:if(ji)return ji.call(i)==ji.call(a)}return!1}function tP(i,a,d,h,g,C){var k=d&V,B=Oc(i),D=B.length,q=Oc(a),K=q.length;if(D!=K&&!k)return!1;for(var Y=D;Y--;){var te=B[Y];if(!(k?te in a:Ue.call(a,te)))return!1}var de=C.get(i),ge=C.get(a);if(de&&ge)return de==a&&ge==i;var Ne=!0;C.set(i,a),C.set(a,i);for(var ye=k;++Y<D;){te=B[Y];var Pe=i[te],Re=a[te];if(h)var Kt=k?h(Re,Pe,te,a,i,C):h(Pe,Re,te,i,a,C);if(!(Kt===n?Pe===Re||g(Pe,Re,d,h,C):Kt)){Ne=!1;break}ye||(ye=te=="constructor")}if(Ne&&!ye){var At=i.constructor,Yt=a.constructor;At!=Yt&&"constructor"in i&&"constructor"in a&&!(typeof At=="function"&&At instanceof At&&typeof Yt=="function"&&Yt instanceof Yt)&&(Ne=!1)}return C.delete(i),C.delete(a),Ne}function Kn(i){return Hc(Tf(i,n,Mf),i+"")}function Oc(i){return Gh(i,mt,$c)}function Lc(i){return Gh(i,Mt,bf)}var Gc=ra?function(i){return ra.get(i)}:id;function ya(i){for(var a=i.name+"",d=Ro[a],h=Ue.call(Ro,a)?d.length:0;h--;){var g=d[h],C=g.func;if(C==null||C==i)return g.name}return a}function Lo(i){var a=Ue.call(y,"placeholder")?y:i;return a.placeholder}function fe(){var i=y.iteratee||rd;return i=i===rd?Zh:i,arguments.length?i(arguments[0],arguments[1]):i}function _a(i,a){var d=i.__data__;return cP(a)?d[typeof a=="string"?"string":"hash"]:d.map}function zc(i){for(var a=mt(i),d=a.length;d--;){var h=a[d],g=i[h];a[d]=[h,g,Sf(g)]}return a}function Xr(i,a){var d=pN(i,a);return $h(d)?d:n}function nP(i){var a=Ue.call(i,jr),d=i[jr];try{i[jr]=n;var h=!0}catch{}var g=Ks.call(i);return h&&(a?i[jr]=d:delete i[jr]),g}var $c=mc?function(i){return i==null?[]:(i=We(i),vr(mc(i),function(a){return Th.call(i,a)}))}:sd,bf=mc?function(i){for(var a=[];i;)wr(a,$c(i)),i=Xs(i);return a}:sd,kt=Vt;(gc&&kt(new gc(new ArrayBuffer(1)))!=To||Ui&&kt(new Ui)!=wn||yc&&kt(yc.resolve())!=Ip||Fo&&kt(new Fo)!=bn||Wi&&kt(new Wi)!=Gi)&&(kt=function(i){var a=Vt(i),d=a==Un?i.constructor:n,h=d?Qr(d):"";if(h)switch(h){case ON:return To;case LN:return wn;case GN:return Ip;case zN:return bn;case $N:return Gi}return a});function rP(i,a,d){for(var h=-1,g=d.length;++h<g;){var C=d[h],k=C.size;switch(C.type){case"drop":i+=k;break;case"dropRight":a-=k;break;case"take":a=xt(a,i+k);break;case"takeRight":i=dt(i,a-k);break}}return{start:i,end:a}}function oP(i){var a=i.match(dV);return a?a[1].split(uV):[]}function xf(i,a,d){a=Er(a,i);for(var h=-1,g=a.length,C=!1;++h<g;){var k=On(a[h]);if(!(C=i!=null&&d(i,k)))break;i=i[k]}return C||++h!=g?C:(g=i==null?0:i.length,!!g&&Sa(g)&&Yn(k,g)&&(ke(i)||eo(i)))}function iP(i){var a=i.length,d=new i.constructor(a);return a&&typeof i[0]=="string"&&Ue.call(i,"index")&&(d.index=i.index,d.input=i.input),d}function kf(i){return typeof i.constructor=="function"&&!es(i)?Mo(Xs(i)):{}}function sP(i,a,d){var h=i.constructor;switch(a){case zi:return Rc(i);case Ri:case Mi:return new h(+i);case To:return ZA(i,d);case zl:case $l:case Zl:case Ul:case Wl:case Hl:case jl:case ql:case Kl:return sf(i,d);case wn:return new h;case Ii:case Li:return new h(i);case Oi:return UA(i);case bn:return new h;case Ls:return WA(i)}}function aP(i,a){var d=a.length;if(!d)return i;var h=d-1;return a[h]=(d>1?"& ":"")+a[h],a=a.join(d>2?", ":" "),i.replace(cV,`{
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,x=2,w=4,E=1,O=2,$=1,b=2,R=4,F=8,D=16,V=32,Z=64,ne=128,H=256,J=512,G=30,z="...",Q=800,A=16,C=1,k=2,M=3,W=1/0,q=9007199254740991,re=17976931348623157e292,ue=NaN,ke=4294967295,Se=ke-1,Ze=ke>>>1,ht=[["ary",ne],["bind",$],["bindKey",b],["curry",F],["curryRight",D],["flip",J],["partial",V],["partialRight",Z],["rearg",H]],Ke="[object Arguments]",Un="[object Array]",WB="[object AsyncFunction]",Zi="[object Boolean]",Wi="[object Date]",jB="[object DOMException]",ea="[object Error]",ta="[object Function]",Uh="[object GeneratorFunction]",Nn="[object Map]",ji="[object Number]",HB="[object Null]",Qn="[object Object]",Zh="[object Promise]",qB="[object Proxy]",Hi="[object RegExp]",An="[object Set]",qi="[object String]",na="[object Symbol]",KB="[object Undefined]",Ki="[object WeakMap]",XB="[object WeakSet]",Xi="[object ArrayBuffer]",Io="[object DataView]",vc="[object Float32Array]",_c="[object Float64Array]",Cc="[object Int8Array]",wc="[object Int16Array]",bc="[object Int32Array]",xc="[object Uint8Array]",kc="[object Uint8ClampedArray]",Sc="[object Uint16Array]",Ec="[object Uint32Array]",YB=/\b__p \+= '';/g,JB=/\b(__p \+=) '' \+/g,QB=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Wh=/&(?:amp|lt|gt|quot|#39);/g,jh=/[&<>"']/g,eP=RegExp(Wh.source),tP=RegExp(jh.source),nP=/<%-([\s\S]+?)%>/g,rP=/<%([\s\S]+?)%>/g,Hh=/<%=([\s\S]+?)%>/g,oP=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,iP=/^\w*$/,sP=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Tc=/[\\^$.*+?()[\]{}|]/g,aP=RegExp(Tc.source),Nc=/^\s+/,lP=/\s/,cP=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,dP=/\{\n\/\* \[wrapped with (.+)\] \*/,uP=/,? & /,pP=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,hP=/[()=,{}\[\]\/\s]/,fP=/\\(\\)?/g,mP=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,qh=/\w*$/,gP=/^[-+]0x[0-9a-f]+$/i,yP=/^0b[01]+$/i,vP=/^\[object .+?Constructor\]$/,_P=/^0o[0-7]+$/i,CP=/^(?:0|[1-9]\d*)$/,wP=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ra=/($^)/,bP=/['\n\r\u2028\u2029\\]/g,oa="\\ud800-\\udfff",xP="\\u0300-\\u036f",kP="\\ufe20-\\ufe2f",SP="\\u20d0-\\u20ff",Kh=xP+kP+SP,Xh="\\u2700-\\u27bf",Yh="a-z\\xdf-\\xf6\\xf8-\\xff",EP="\\xac\\xb1\\xd7\\xf7",TP="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",NP="\\u2000-\\u206f",AP=" \\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",Jh="A-Z\\xc0-\\xd6\\xd8-\\xde",Qh="\\ufe0e\\ufe0f",ef=EP+TP+NP+AP,Ac="['’]",VP="["+oa+"]",tf="["+ef+"]",ia="["+Kh+"]",nf="\\d+",BP="["+Xh+"]",rf="["+Yh+"]",of="[^"+oa+ef+nf+Xh+Yh+Jh+"]",Vc="\\ud83c[\\udffb-\\udfff]",PP="(?:"+ia+"|"+Vc+")",sf="[^"+oa+"]",Bc="(?:\\ud83c[\\udde6-\\uddff]){2}",Pc="[\\ud800-\\udbff][\\udc00-\\udfff]",Fo="["+Jh+"]",af="\\u200d",lf="(?:"+rf+"|"+of+")",RP="(?:"+Fo+"|"+of+")",cf="(?:"+Ac+"(?:d|ll|m|re|s|t|ve))?",df="(?:"+Ac+"(?:D|LL|M|RE|S|T|VE))?",uf=PP+"?",pf="["+Qh+"]?",DP="(?:"+af+"(?:"+[sf,Bc,Pc].join("|")+")"+pf+uf+")*",IP="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",FP="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",hf=pf+uf+DP,OP="(?:"+[BP,Bc,Pc].join("|")+")"+hf,LP="(?:"+[sf+ia+"?",ia,Bc,Pc,VP].join("|")+")",MP=RegExp(Ac,"g"),GP=RegExp(ia,"g"),Rc=RegExp(Vc+"(?="+Vc+")|"+LP+hf,"g"),$P=RegExp([Fo+"?"+rf+"+"+cf+"(?="+[tf,Fo,"$"].join("|")+")",RP+"+"+df+"(?="+[tf,Fo+lf,"$"].join("|")+")",Fo+"?"+lf+"+"+cf,Fo+"+"+df,FP,IP,nf,OP].join("|"),"g"),zP=RegExp("["+af+oa+Kh+Qh+"]"),UP=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,ZP=["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"],WP=-1,Qe={};Qe[vc]=Qe[_c]=Qe[Cc]=Qe[wc]=Qe[bc]=Qe[xc]=Qe[kc]=Qe[Sc]=Qe[Ec]=!0,Qe[Ke]=Qe[Un]=Qe[Xi]=Qe[Zi]=Qe[Io]=Qe[Wi]=Qe[ea]=Qe[ta]=Qe[Nn]=Qe[ji]=Qe[Qn]=Qe[Hi]=Qe[An]=Qe[qi]=Qe[Ki]=!1;var Ye={};Ye[Ke]=Ye[Un]=Ye[Xi]=Ye[Io]=Ye[Zi]=Ye[Wi]=Ye[vc]=Ye[_c]=Ye[Cc]=Ye[wc]=Ye[bc]=Ye[Nn]=Ye[ji]=Ye[Qn]=Ye[Hi]=Ye[An]=Ye[qi]=Ye[na]=Ye[xc]=Ye[kc]=Ye[Sc]=Ye[Ec]=!0,Ye[ea]=Ye[ta]=Ye[Ki]=!1;var jP={À:"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"},HP={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},qP={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},KP={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},XP=parseFloat,YP=parseInt,ff=typeof Xo=="object"&&Xo&&Xo.Object===Object&&Xo,JP=typeof self=="object"&&self&&self.Object===Object&&self,Ct=ff||JP||Function("return this")(),Dc=e&&!e.nodeType&&e,Qr=Dc&&!0&&t&&!t.nodeType&&t,mf=Qr&&Qr.exports===Dc,Ic=mf&&ff.process,nn=function(){try{var P=Qr&&Qr.require&&Qr.require("util").types;return P||Ic&&Ic.binding&&Ic.binding("util")}catch{}}(),gf=nn&&nn.isArrayBuffer,yf=nn&&nn.isDate,vf=nn&&nn.isMap,_f=nn&&nn.isRegExp,Cf=nn&&nn.isSet,wf=nn&&nn.isTypedArray;function Xt(P,j,U){switch(U.length){case 0:return P.call(j);case 1:return P.call(j,U[0]);case 2:return P.call(j,U[0],U[1]);case 3:return P.call(j,U[0],U[1],U[2])}return P.apply(j,U)}function QP(P,j,U,de){for(var Te=-1,We=P==null?0:P.length;++Te<We;){var ft=P[Te];j(de,ft,U(ft),P)}return de}function rn(P,j){for(var U=-1,de=P==null?0:P.length;++U<de&&j(P[U],U,P)!==!1;);return P}function eR(P,j){for(var U=P==null?0:P.length;U--&&j(P[U],U,P)!==!1;);return P}function bf(P,j){for(var U=-1,de=P==null?0:P.length;++U<de;)if(!j(P[U],U,P))return!1;return!0}function Nr(P,j){for(var U=-1,de=P==null?0:P.length,Te=0,We=[];++U<de;){var ft=P[U];j(ft,U,P)&&(We[Te++]=ft)}return We}function sa(P,j){var U=P==null?0:P.length;return!!U&&Oo(P,j,0)>-1}function Fc(P,j,U){for(var de=-1,Te=P==null?0:P.length;++de<Te;)if(U(j,P[de]))return!0;return!1}function tt(P,j){for(var U=-1,de=P==null?0:P.length,Te=Array(de);++U<de;)Te[U]=j(P[U],U,P);return Te}function Ar(P,j){for(var U=-1,de=j.length,Te=P.length;++U<de;)P[Te+U]=j[U];return P}function Oc(P,j,U,de){var Te=-1,We=P==null?0:P.length;for(de&&We&&(U=P[++Te]);++Te<We;)U=j(U,P[Te],Te,P);return U}function tR(P,j,U,de){var Te=P==null?0:P.length;for(de&&Te&&(U=P[--Te]);Te--;)U=j(U,P[Te],Te,P);return U}function Lc(P,j){for(var U=-1,de=P==null?0:P.length;++U<de;)if(j(P[U],U,P))return!0;return!1}var nR=Mc("length");function rR(P){return P.split("")}function oR(P){return P.match(pP)||[]}function xf(P,j,U){var de;return U(P,function(Te,We,ft){if(j(Te,We,ft))return de=We,!1}),de}function aa(P,j,U,de){for(var Te=P.length,We=U+(de?1:-1);de?We--:++We<Te;)if(j(P[We],We,P))return We;return-1}function Oo(P,j,U){return j===j?gR(P,j,U):aa(P,kf,U)}function iR(P,j,U,de){for(var Te=U-1,We=P.length;++Te<We;)if(de(P[Te],j))return Te;return-1}function kf(P){return P!==P}function Sf(P,j){var U=P==null?0:P.length;return U?$c(P,j)/U:ue}function Mc(P){return function(j){return j==null?n:j[P]}}function Gc(P){return function(j){return P==null?n:P[j]}}function Ef(P,j,U,de,Te){return Te(P,function(We,ft,Xe){U=de?(de=!1,We):j(U,We,ft,Xe)}),U}function sR(P,j){var U=P.length;for(P.sort(j);U--;)P[U]=P[U].value;return P}function $c(P,j){for(var U,de=-1,Te=P.length;++de<Te;){var We=j(P[de]);We!==n&&(U=U===n?We:U+We)}return U}function zc(P,j){for(var U=-1,de=Array(P);++U<P;)de[U]=j(U);return de}function aR(P,j){return tt(j,function(U){return[U,P[U]]})}function Tf(P){return P&&P.slice(0,Bf(P)+1).replace(Nc,"")}function Yt(P){return function(j){return P(j)}}function Uc(P,j){return tt(j,function(U){return P[U]})}function Yi(P,j){return P.has(j)}function Nf(P,j){for(var U=-1,de=P.length;++U<de&&Oo(j,P[U],0)>-1;);return U}function Af(P,j){for(var U=P.length;U--&&Oo(j,P[U],0)>-1;);return U}function lR(P,j){for(var U=P.length,de=0;U--;)P[U]===j&&++de;return de}var cR=Gc(jP),dR=Gc(HP);function uR(P){return"\\"+KP[P]}function pR(P,j){return P==null?n:P[j]}function Lo(P){return zP.test(P)}function hR(P){return UP.test(P)}function fR(P){for(var j,U=[];!(j=P.next()).done;)U.push(j.value);return U}function Zc(P){var j=-1,U=Array(P.size);return P.forEach(function(de,Te){U[++j]=[Te,de]}),U}function Vf(P,j){return function(U){return P(j(U))}}function Vr(P,j){for(var U=-1,de=P.length,Te=0,We=[];++U<de;){var ft=P[U];(ft===j||ft===m)&&(P[U]=m,We[Te++]=U)}return We}function la(P){var j=-1,U=Array(P.size);return P.forEach(function(de){U[++j]=de}),U}function mR(P){var j=-1,U=Array(P.size);return P.forEach(function(de){U[++j]=[de,de]}),U}function gR(P,j,U){for(var de=U-1,Te=P.length;++de<Te;)if(P[de]===j)return de;return-1}function yR(P,j,U){for(var de=U+1;de--;)if(P[de]===j)return de;return de}function Mo(P){return Lo(P)?_R(P):nR(P)}function Vn(P){return Lo(P)?CR(P):rR(P)}function Bf(P){for(var j=P.length;j--&&lP.test(P.charAt(j)););return j}var vR=Gc(qP);function _R(P){for(var j=Rc.lastIndex=0;Rc.test(P);)++j;return j}function CR(P){return P.match(Rc)||[]}function wR(P){return P.match($P)||[]}var bR=function P(j){j=j==null?Ct:Go.defaults(Ct.Object(),j,Go.pick(Ct,ZP));var U=j.Array,de=j.Date,Te=j.Error,We=j.Function,ft=j.Math,Xe=j.Object,Wc=j.RegExp,xR=j.String,on=j.TypeError,ca=U.prototype,kR=We.prototype,$o=Xe.prototype,da=j["__core-js_shared__"],ua=kR.toString,qe=$o.hasOwnProperty,SR=0,Pf=function(){var s=/[^.]+$/.exec(da&&da.keys&&da.keys.IE_PROTO||"");return s?"Symbol(src)_1."+s:""}(),pa=$o.toString,ER=ua.call(Xe),TR=Ct._,NR=Wc("^"+ua.call(qe).replace(Tc,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ha=mf?j.Buffer:n,Br=j.Symbol,fa=j.Uint8Array,Rf=ha?ha.allocUnsafe:n,ma=Vf(Xe.getPrototypeOf,Xe),Df=Xe.create,If=$o.propertyIsEnumerable,ga=ca.splice,Ff=Br?Br.isConcatSpreadable:n,Ji=Br?Br.iterator:n,eo=Br?Br.toStringTag:n,ya=function(){try{var s=io(Xe,"defineProperty");return s({},"",{}),s}catch{}}(),AR=j.clearTimeout!==Ct.clearTimeout&&j.clearTimeout,VR=de&&de.now!==Ct.Date.now&&de.now,BR=j.setTimeout!==Ct.setTimeout&&j.setTimeout,va=ft.ceil,_a=ft.floor,jc=Xe.getOwnPropertySymbols,PR=ha?ha.isBuffer:n,Of=j.isFinite,RR=ca.join,DR=Vf(Xe.keys,Xe),mt=ft.max,Tt=ft.min,IR=de.now,FR=j.parseInt,Lf=ft.random,OR=ca.reverse,Hc=io(j,"DataView"),Qi=io(j,"Map"),qc=io(j,"Promise"),zo=io(j,"Set"),es=io(j,"WeakMap"),ts=io(Xe,"create"),Ca=es&&new es,Uo={},LR=so(Hc),MR=so(Qi),GR=so(qc),$R=so(zo),zR=so(es),wa=Br?Br.prototype:n,ns=wa?wa.valueOf:n,Mf=wa?wa.toString:n;function v(s){if(it(s)&&!Ne(s)&&!(s instanceof Oe)){if(s instanceof sn)return s;if(qe.call(s,"__wrapped__"))return Gm(s)}return new sn(s)}var Zo=function(){function s(){}return function(a){if(!ot(a))return{};if(Df)return Df(a);s.prototype=a;var u=new s;return s.prototype=n,u}}();function ba(){}function sn(s,a){this.__wrapped__=s,this.__actions__=[],this.__chain__=!!a,this.__index__=0,this.__values__=n}v.templateSettings={escape:nP,evaluate:rP,interpolate:Hh,variable:"",imports:{_:v}},v.prototype=ba.prototype,v.prototype.constructor=v,sn.prototype=Zo(ba.prototype),sn.prototype.constructor=sn;function Oe(s){this.__wrapped__=s,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=ke,this.__views__=[]}function UR(){var s=new Oe(this.__wrapped__);return s.__actions__=Mt(this.__actions__),s.__dir__=this.__dir__,s.__filtered__=this.__filtered__,s.__iteratees__=Mt(this.__iteratees__),s.__takeCount__=this.__takeCount__,s.__views__=Mt(this.__views__),s}function ZR(){if(this.__filtered__){var s=new Oe(this);s.__dir__=-1,s.__filtered__=!0}else s=this.clone(),s.__dir__*=-1;return s}function WR(){var s=this.__wrapped__.value(),a=this.__dir__,u=Ne(s),f=a<0,g=u?s.length:0,_=rI(0,g,this.__views__),N=_.start,B=_.end,I=B-N,K=f?B:N-1,X=this.__iteratees__,Y=X.length,ie=0,he=Tt(I,this.__takeCount__);if(!u||!f&&g==I&&he==I)return cm(s,this.__actions__);var ve=[];e:for(;I--&&ie<he;){K+=a;for(var De=-1,_e=s[K];++De<Y;){var Fe=X[De],Le=Fe.iteratee,en=Fe.type,Ft=Le(_e);if(en==k)_e=Ft;else if(!Ft){if(en==C)continue e;break e}}ve[ie++]=_e}return ve}Oe.prototype=Zo(ba.prototype),Oe.prototype.constructor=Oe;function to(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 jR(){this.__data__=ts?ts(null):{},this.size=0}function HR(s){var a=this.has(s)&&delete this.__data__[s];return this.size-=a?1:0,a}function qR(s){var a=this.__data__;if(ts){var u=a[s];return u===p?n:u}return qe.call(a,s)?a[s]:n}function KR(s){var a=this.__data__;return ts?a[s]!==n:qe.call(a,s)}function XR(s,a){var u=this.__data__;return this.size+=this.has(s)?0:1,u[s]=ts&&a===n?p:a,this}to.prototype.clear=jR,to.prototype.delete=HR,to.prototype.get=qR,to.prototype.has=KR,to.prototype.set=XR;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 YR(){this.__data__=[],this.size=0}function JR(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 QR(s){var a=this.__data__,u=xa(a,s);return u<0?n:a[u][1]}function eD(s){return xa(this.__data__,s)>-1}function tD(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=YR,er.prototype.delete=JR,er.prototype.get=QR,er.prototype.has=eD,er.prototype.set=tD;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 nD(){this.size=0,this.__data__={hash:new to,map:new(Qi||er),string:new to}}function rD(s){var a=Ia(this,s).delete(s);return this.size-=a?1:0,a}function oD(s){return Ia(this,s).get(s)}function iD(s){return Ia(this,s).has(s)}function sD(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=nD,tr.prototype.delete=rD,tr.prototype.get=oD,tr.prototype.has=iD,tr.prototype.set=sD;function no(s){var a=-1,u=s==null?0:s.length;for(this.__data__=new tr;++a<u;)this.add(s[a])}function aD(s){return this.__data__.set(s,p),this}function lD(s){return this.__data__.has(s)}no.prototype.add=no.prototype.push=aD,no.prototype.has=lD;function Bn(s){var a=this.__data__=new er(s);this.size=a.size}function cD(){this.__data__=new er,this.size=0}function dD(s){var a=this.__data__,u=a.delete(s);return this.size=a.size,u}function uD(s){return this.__data__.get(s)}function pD(s){return this.__data__.has(s)}function hD(s,a){var u=this.__data__;if(u instanceof er){var f=u.__data__;if(!Qi||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=cD,Bn.prototype.delete=dD,Bn.prototype.get=uD,Bn.prototype.has=pD,Bn.prototype.set=hD;function Gf(s,a){var u=Ne(s),f=!u&&ao(s),g=!u&&!f&&Fr(s),_=!u&&!f&&!g&&qo(s),N=u||f||g||_,B=N?zc(s.length,xR):[],I=B.length;for(var K in s)(a||qe.call(s,K))&&!(N&&(K=="length"||g&&(K=="offset"||K=="parent")||_&&(K=="buffer"||K=="byteLength"||K=="byteOffset")||ir(K,I)))&&B.push(K);return B}function $f(s){var a=s.length;return a?s[id(0,a-1)]:n}function fD(s,a){return Fa(Mt(s),ro(a,0,s.length))}function mD(s){return Fa(Mt(s))}function Kc(s,a,u){(u!==n&&!Pn(s[a],u)||u===n&&!(a in s))&&nr(s,a,u)}function rs(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 gD(s,a,u,f){return Pr(s,function(g,_,N){a(f,g,u(g),N)}),f}function zf(s,a){return s&&Wn(a,_t(a),s)}function yD(s,a){return s&&Wn(a,$t(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=U(f),_=s==null;++u<f;)g[u]=_?n:Vd(s,a[u]);return g}function ro(s,a,u){return s===s&&(u!==n&&(s=s<=u?s:u),a!==n&&(s=s>=a?s:a)),s}function an(s,a,u,f,g,_){var N,B=a&y,I=a&x,K=a&w;if(u&&(N=g?u(s,f,g,_):u(s)),N!==n)return N;if(!ot(s))return s;var X=Ne(s);if(X){if(N=iI(s),!B)return Mt(s,N)}else{var Y=Nt(s),ie=Y==ta||Y==Uh;if(Fr(s))return pm(s,B);if(Y==Qn||Y==Ke||ie&&!g){if(N=I||ie?{}:Bm(s),!B)return I?qD(s,yD(N,s)):HD(s,zf(N,s))}else{if(!Ye[Y])return g?s:{};N=sI(s,Y,B)}}_||(_=new Bn);var he=_.get(s);if(he)return he;_.set(s,N),sg(s)?s.forEach(function(_e){N.add(an(_e,a,u,_e,s,_))}):og(s)&&s.forEach(function(_e,Fe){N.set(Fe,an(_e,a,u,Fe,s,_))});var ve=K?I?gd:md:I?$t:_t,De=X?n:ve(s);return rn(De||s,function(_e,Fe){De&&(Fe=_e,_e=s[Fe]),rs(N,Fe,an(_e,a,u,Fe,s,_))}),N}function vD(s){var a=_t(s);return function(u){return Uf(u,s,a)}}function Uf(s,a,u){var f=u.length;if(s==null)return!f;for(s=Xe(s);f--;){var g=u[f],_=a[g],N=s[g];if(N===n&&!(g in s)||!_(N))return!1}return!0}function Zf(s,a,u){if(typeof s!="function")throw new on(c);return ds(function(){s.apply(n,u)},a)}function os(s,a,u,f){var g=-1,_=sa,N=!0,B=s.length,I=[],K=a.length;if(!B)return I;u&&(a=tt(a,Yt(u))),f?(_=Fc,N=!1):a.length>=i&&(_=Yi,N=!1,a=new no(a));e:for(;++g<B;){var X=s[g],Y=u==null?X:u(X);if(X=f||X!==0?X:0,N&&Y===Y){for(var ie=K;ie--;)if(a[ie]===Y)continue e;I.push(X)}else _(a,Y,f)||I.push(X)}return I}var Pr=ym(Zn),Wf=ym(Jc,!0);function _D(s,a){var u=!0;return Pr(s,function(f,g,_){return u=!!a(f,g,_),u}),u}function ka(s,a,u){for(var f=-1,g=s.length;++f<g;){var _=s[f],N=a(_);if(N!=null&&(B===n?N===N&&!Qt(N):u(N,B)))var B=N,I=_}return I}function CD(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:lg(f);u<f;)s[u++]=a;return s}function jf(s,a){var u=[];return Pr(s,function(f,g,_){a(f,g,_)&&u.push(f)}),u}function wt(s,a,u,f,g){var _=-1,N=s.length;for(u||(u=lI),g||(g=[]);++_<N;){var B=s[_];a>0&&u(B)?a>1?wt(B,a-1,u,f,g):Ar(g,B):f||(g[g.length]=B)}return g}var Yc=vm(),Hf=vm(!0);function Zn(s,a){return s&&Yc(s,a,_t)}function Jc(s,a){return s&&Hf(s,a,_t)}function Sa(s,a){return Nr(a,function(u){return sr(s[u])})}function oo(s,a){a=Dr(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 Dt(s){return s==null?s===n?KB:HB:eo&&eo in Xe(s)?nI(s):mI(s)}function Qc(s,a){return s>a}function wD(s,a){return s!=null&&qe.call(s,a)}function bD(s,a){return s!=null&&a in Xe(s)}function xD(s,a,u){return s>=Tt(a,u)&&s<mt(a,u)}function ed(s,a,u){for(var f=u?Fc:sa,g=s[0].length,_=s.length,N=_,B=U(_),I=1/0,K=[];N--;){var X=s[N];N&&a&&(X=tt(X,Yt(a))),I=Tt(X.length,I),B[N]=!u&&(a||g>=120&&X.length>=120)?new no(N&&X):n}X=s[0];var Y=-1,ie=B[0];e:for(;++Y<g&&K.length<I;){var he=X[Y],ve=a?a(he):he;if(he=u||he!==0?he:0,!(ie?Yi(ie,ve):f(K,ve,u))){for(N=_;--N;){var De=B[N];if(!(De?Yi(De,ve):f(s[N],ve,u)))continue e}ie&&ie.push(ve),K.push(he)}}return K}function kD(s,a,u,f){return Zn(s,function(g,_,N){a(f,u(g),_,N)}),f}function is(s,a,u){a=Dr(a,s),s=Im(s,a);var f=s==null?s:s[jn(cn(a))];return f==null?n:Xt(f,s,u)}function Kf(s){return it(s)&&Dt(s)==Ke}function SD(s){return it(s)&&Dt(s)==Xi}function ED(s){return it(s)&&Dt(s)==Wi}function ss(s,a,u,f,g){return s===a?!0:s==null||a==null||!it(s)&&!it(a)?s!==s&&a!==a:TD(s,a,u,f,ss,g)}function TD(s,a,u,f,g,_){var N=Ne(s),B=Ne(a),I=N?Un:Nt(s),K=B?Un:Nt(a);I=I==Ke?Qn:I,K=K==Ke?Qn:K;var X=I==Qn,Y=K==Qn,ie=I==K;if(ie&&Fr(s)){if(!Fr(a))return!1;N=!0,X=!1}if(ie&&!X)return _||(_=new Bn),N||qo(s)?Nm(s,a,u,f,g,_):eI(s,a,I,u,f,g,_);if(!(u&E)){var he=X&&qe.call(s,"__wrapped__"),ve=Y&&qe.call(a,"__wrapped__");if(he||ve){var De=he?s.value():s,_e=ve?a.value():a;return _||(_=new Bn),g(De,_e,u,f,_)}}return ie?(_||(_=new Bn),tI(s,a,u,f,g,_)):!1}function ND(s){return it(s)&&Nt(s)==Nn}function td(s,a,u,f){var g=u.length,_=g,N=!f;if(s==null)return!_;for(s=Xe(s);g--;){var B=u[g];if(N&&B[2]?B[1]!==s[B[0]]:!(B[0]in s))return!1}for(;++g<_;){B=u[g];var I=B[0],K=s[I],X=B[1];if(N&&B[2]){if(K===n&&!(I in s))return!1}else{var Y=new Bn;if(f)var ie=f(K,X,I,s,a,Y);if(!(ie===n?ss(X,K,E|O,f,Y):ie))return!1}}return!0}function Xf(s){if(!ot(s)||dI(s))return!1;var a=sr(s)?NR:vP;return a.test(so(s))}function AD(s){return it(s)&&Dt(s)==Hi}function VD(s){return it(s)&&Nt(s)==An}function BD(s){return it(s)&&za(s.length)&&!!Qe[Dt(s)]}function Yf(s){return typeof s=="function"?s:s==null?zt:typeof s=="object"?Ne(s)?em(s[0],s[1]):Qf(s):_g(s)}function nd(s){if(!cs(s))return DR(s);var a=[];for(var u in Xe(s))qe.call(s,u)&&u!="constructor"&&a.push(u);return a}function PD(s){if(!ot(s))return fI(s);var a=cs(s),u=[];for(var f in s)f=="constructor"&&(a||!qe.call(s,f))||u.push(f);return u}function rd(s,a){return s<a}function Jf(s,a){var u=-1,f=Gt(s)?U(s.length):[];return Pr(s,function(g,_,N){f[++u]=a(g,_,N)}),f}function Qf(s){var a=vd(s);return a.length==1&&a[0][2]?Rm(a[0][0],a[0][1]):function(u){return u===s||td(u,s,a)}}function em(s,a){return Cd(s)&&Pm(a)?Rm(jn(s),a):function(u){var f=Vd(u,s);return f===n&&f===a?Bd(u,s):ss(a,f,E|O)}}function Ea(s,a,u,f,g){s!==a&&Yc(a,function(_,N){if(g||(g=new Bn),ot(_))RD(s,a,N,u,Ea,f,g);else{var B=f?f(bd(s,N),_,N+"",s,a,g):n;B===n&&(B=_),Kc(s,N,B)}},$t)}function RD(s,a,u,f,g,_,N){var B=bd(s,u),I=bd(a,u),K=N.get(I);if(K){Kc(s,u,K);return}var X=_?_(B,I,u+"",s,a,N):n,Y=X===n;if(Y){var ie=Ne(I),he=!ie&&Fr(I),ve=!ie&&!he&&qo(I);X=I,ie||he||ve?Ne(B)?X=B:at(B)?X=Mt(B):he?(Y=!1,X=pm(I,!0)):ve?(Y=!1,X=hm(I,!0)):X=[]:us(I)||ao(I)?(X=B,ao(B)?X=cg(B):(!ot(B)||sr(B))&&(X=Bm(I))):Y=!1}Y&&(N.set(I,X),g(X,I,f,_,N),N.delete(I)),Kc(s,u,X)}function tm(s,a){var u=s.length;if(u)return a+=a<0?u:0,ir(a,u)?s[a]:n}function nm(s,a,u){a.length?a=tt(a,function(_){return Ne(_)?function(N){return oo(N,_.length===1?_[0]:_)}:_}):a=[zt];var f=-1;a=tt(a,Yt(ge()));var g=Jf(s,function(_,N,B){var I=tt(a,function(K){return K(_)});return{criteria:I,index:++f,value:_}});return sR(g,function(_,N){return jD(_,N,u)})}function DD(s,a){return rm(s,a,function(u,f){return Bd(s,f)})}function rm(s,a,u){for(var f=-1,g=a.length,_={};++f<g;){var N=a[f],B=oo(s,N);u(B,N)&&as(_,Dr(N,s),B)}return _}function ID(s){return function(a){return oo(a,s)}}function od(s,a,u,f){var g=f?iR:Oo,_=-1,N=a.length,B=s;for(s===a&&(a=Mt(a)),u&&(B=tt(s,Yt(u)));++_<N;)for(var I=0,K=a[_],X=u?u(K):K;(I=g(B,X,I,f))>-1;)B!==s&&ga.call(B,I,1),ga.call(s,I,1);return s}function om(s,a){for(var u=s?a.length:0,f=u-1;u--;){var g=a[u];if(u==f||g!==_){var _=g;ir(g)?ga.call(s,g,1):ld(s,g)}}return s}function id(s,a){return s+_a(Lf()*(a-s+1))}function FD(s,a,u,f){for(var g=-1,_=mt(va((a-s)/(u||1)),0),N=U(_);_--;)N[f?_:++g]=s,s+=u;return N}function sd(s,a){var u="";if(!s||a<1||a>q)return u;do a%2&&(u+=s),a=_a(a/2),a&&(s+=s);while(a);return u}function Ie(s,a){return xd(Dm(s,a,zt),s+"")}function OD(s){return $f(Ko(s))}function LD(s,a){var u=Ko(s);return Fa(u,ro(a,0,u.length))}function as(s,a,u,f){if(!ot(s))return s;a=Dr(a,s);for(var g=-1,_=a.length,N=_-1,B=s;B!=null&&++g<_;){var I=jn(a[g]),K=u;if(I==="__proto__"||I==="constructor"||I==="prototype")return s;if(g!=N){var X=B[I];K=f?f(X,I,B):n,K===n&&(K=ot(X)?X:ir(a[g+1])?[]:{})}rs(B,I,K),B=B[I]}return s}var im=Ca?function(s,a){return Ca.set(s,a),s}:zt,MD=ya?function(s,a){return ya(s,"toString",{configurable:!0,enumerable:!1,value:Rd(a),writable:!0})}:zt;function GD(s){return Fa(Ko(s))}function ln(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 _=U(g);++f<g;)_[f]=s[f+a];return _}function $D(s,a){var u;return Pr(s,function(f,g,_){return u=a(f,g,_),!u}),!!u}function Ta(s,a,u){var f=0,g=s==null?f:s.length;if(typeof a=="number"&&a===a&&g<=Ze){for(;f<g;){var _=f+g>>>1,N=s[_];N!==null&&!Qt(N)&&(u?N<=a:N<a)?f=_+1:g=_}return g}return ad(s,a,zt,u)}function ad(s,a,u,f){var g=0,_=s==null?0:s.length;if(_===0)return 0;a=u(a);for(var N=a!==a,B=a===null,I=Qt(a),K=a===n;g<_;){var X=_a((g+_)/2),Y=u(s[X]),ie=Y!==n,he=Y===null,ve=Y===Y,De=Qt(Y);if(N)var _e=f||ve;else K?_e=ve&&(f||ie):B?_e=ve&&ie&&(f||!he):I?_e=ve&&ie&&!he&&(f||!De):he||De?_e=!1:_e=f?Y<=a:Y<a;_e?g=X+1:_=X}return Tt(_,Se)}function sm(s,a){for(var u=-1,f=s.length,g=0,_=[];++u<f;){var N=s[u],B=a?a(N):N;if(!u||!Pn(B,I)){var I=B;_[g++]=N===0?0:N}}return _}function am(s){return typeof s=="number"?s:Qt(s)?ue:+s}function Jt(s){if(typeof s=="string")return s;if(Ne(s))return tt(s,Jt)+"";if(Qt(s))return Mf?Mf.call(s):"";var a=s+"";return a=="0"&&1/s==-W?"-0":a}function Rr(s,a,u){var f=-1,g=sa,_=s.length,N=!0,B=[],I=B;if(u)N=!1,g=Fc;else if(_>=i){var K=a?null:JD(s);if(K)return la(K);N=!1,g=Yi,I=new no}else I=a?[]:B;e:for(;++f<_;){var X=s[f],Y=a?a(X):X;if(X=u||X!==0?X:0,N&&Y===Y){for(var ie=I.length;ie--;)if(I[ie]===Y)continue e;a&&I.push(Y),B.push(X)}else g(I,Y,u)||(I!==B&&I.push(Y),B.push(X))}return B}function ld(s,a){return a=Dr(a,s),s=Im(s,a),s==null||delete s[jn(cn(a))]}function lm(s,a,u,f){return as(s,a,u(oo(s,a)),f)}function Na(s,a,u,f){for(var g=s.length,_=f?g:-1;(f?_--:++_<g)&&a(s[_],_,s););return u?ln(s,f?0:_,f?_+1:g):ln(s,f?_+1:0,f?g:_)}function cm(s,a){var u=s;return u instanceof Oe&&(u=u.value()),Oc(a,function(f,g){return g.func.apply(g.thisArg,Ar([f],g.args))},u)}function cd(s,a,u){var f=s.length;if(f<2)return f?Rr(s[0]):[];for(var g=-1,_=U(f);++g<f;)for(var N=s[g],B=-1;++B<f;)B!=g&&(_[g]=os(_[g]||N,s[B],a,u));return Rr(wt(_,1),a,u)}function dm(s,a,u){for(var f=-1,g=s.length,_=a.length,N={};++f<g;){var B=f<_?a[f]:n;u(N,s[f],B)}return N}function dd(s){return at(s)?s:[]}function ud(s){return typeof s=="function"?s:zt}function Dr(s,a){return Ne(s)?s:Cd(s,a)?[s]:Mm(He(s))}var zD=Ie;function Ir(s,a,u){var f=s.length;return u=u===n?f:u,!a&&u>=f?s:ln(s,a,u)}var um=AR||function(s){return Ct.clearTimeout(s)};function pm(s,a){if(a)return s.slice();var u=s.length,f=Rf?Rf(u):new s.constructor(u);return s.copy(f),f}function pd(s){var a=new s.constructor(s.byteLength);return new fa(a).set(new fa(s)),a}function UD(s,a){var u=a?pd(s.buffer):s.buffer;return new s.constructor(u,s.byteOffset,s.byteLength)}function ZD(s){var a=new s.constructor(s.source,qh.exec(s));return a.lastIndex=s.lastIndex,a}function WD(s){return ns?Xe(ns.call(s)):{}}function hm(s,a){var u=a?pd(s.buffer):s.buffer;return new s.constructor(u,s.byteOffset,s.length)}function fm(s,a){if(s!==a){var u=s!==n,f=s===null,g=s===s,_=Qt(s),N=a!==n,B=a===null,I=a===a,K=Qt(a);if(!B&&!K&&!_&&s>a||_&&N&&I&&!B&&!K||f&&N&&I||!u&&I||!g)return 1;if(!f&&!_&&!K&&s<a||K&&u&&g&&!f&&!_||B&&u&&g||!N&&g||!I)return-1}return 0}function jD(s,a,u){for(var f=-1,g=s.criteria,_=a.criteria,N=g.length,B=u.length;++f<N;){var I=fm(g[f],_[f]);if(I){if(f>=B)return I;var K=u[f];return I*(K=="desc"?-1:1)}}return s.index-a.index}function mm(s,a,u,f){for(var g=-1,_=s.length,N=u.length,B=-1,I=a.length,K=mt(_-N,0),X=U(I+K),Y=!f;++B<I;)X[B]=a[B];for(;++g<N;)(Y||g<_)&&(X[u[g]]=s[g]);for(;K--;)X[B++]=s[g++];return X}function gm(s,a,u,f){for(var g=-1,_=s.length,N=-1,B=u.length,I=-1,K=a.length,X=mt(_-B,0),Y=U(X+K),ie=!f;++g<X;)Y[g]=s[g];for(var he=g;++I<K;)Y[he+I]=a[I];for(;++N<B;)(ie||g<_)&&(Y[he+u[N]]=s[g++]);return Y}function Mt(s,a){var u=-1,f=s.length;for(a||(a=U(f));++u<f;)a[u]=s[u];return a}function Wn(s,a,u,f){var g=!u;u||(u={});for(var _=-1,N=a.length;++_<N;){var B=a[_],I=f?f(u[B],s[B],B,u,s):n;I===n&&(I=s[B]),g?nr(u,B,I):rs(u,B,I)}return u}function HD(s,a){return Wn(s,_d(s),a)}function qD(s,a){return Wn(s,Am(s),a)}function Aa(s,a){return function(u,f){var g=Ne(u)?QP:gD,_=a?a():{};return g(u,s,ge(f,2),_)}}function Wo(s){return Ie(function(a,u){var f=-1,g=u.length,_=g>1?u[g-1]:n,N=g>2?u[2]:n;for(_=s.length>3&&typeof _=="function"?(g--,_):n,N&&It(u[0],u[1],N)&&(_=g<3?n:_,g=1),a=Xe(a);++f<g;){var B=u[f];B&&s(a,B,f,_)}return a})}function ym(s,a){return function(u,f){if(u==null)return u;if(!Gt(u))return s(u,f);for(var g=u.length,_=a?g:-1,N=Xe(u);(a?_--:++_<g)&&f(N[_],_,N)!==!1;);return u}}function vm(s){return function(a,u,f){for(var g=-1,_=Xe(a),N=f(a),B=N.length;B--;){var I=N[s?B:++g];if(u(_[I],I,_)===!1)break}return a}}function KD(s,a,u){var f=a&$,g=ls(s);function _(){var N=this&&this!==Ct&&this instanceof _?g:s;return N.apply(f?u:this,arguments)}return _}function _m(s){return function(a){a=He(a);var u=Lo(a)?Vn(a):n,f=u?u[0]:a.charAt(0),g=u?Ir(u,1).join(""):a.slice(1);return f[s]()+g}}function jo(s){return function(a){return Oc(yg(gg(a).replace(MP,"")),s,"")}}function ls(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 XD(s,a,u){var f=ls(s);function g(){for(var _=arguments.length,N=U(_),B=_,I=Ho(g);B--;)N[B]=arguments[B];var K=_<3&&N[0]!==I&&N[_-1]!==I?[]:Vr(N,I);if(_-=K.length,_<u)return km(s,a,Va,g.placeholder,n,N,K,n,n,u-_);var X=this&&this!==Ct&&this instanceof g?f:s;return Xt(X,this,N)}return g}function Cm(s){return function(a,u,f){var g=Xe(a);if(!Gt(a)){var _=ge(u,3);a=_t(a),u=function(B){return _(g[B],B,g)}}var N=s(a,u,f);return N>-1?g[_?a[N]:N]:n}}function wm(s){return or(function(a){var u=a.length,f=u,g=sn.prototype.thru;for(s&&a.reverse();f--;){var _=a[f];if(typeof _!="function")throw new on(c);if(g&&!N&&Da(_)=="wrapper")var N=new sn([],!0)}for(f=N?f:u;++f<u;){_=a[f];var B=Da(_),I=B=="wrapper"?yd(_):n;I&&wd(I[0])&&I[1]==(ne|F|V|H)&&!I[4].length&&I[9]==1?N=N[Da(I[0])].apply(N,I[3]):N=_.length==1&&wd(_)?N[B]():N.thru(_)}return function(){var K=arguments,X=K[0];if(N&&K.length==1&&Ne(X))return N.plant(X).value();for(var Y=0,ie=u?a[Y].apply(this,K):X;++Y<u;)ie=a[Y].call(this,ie);return ie}})}function Va(s,a,u,f,g,_,N,B,I,K){var X=a&ne,Y=a&$,ie=a&b,he=a&(F|D),ve=a&J,De=ie?n:ls(s);function _e(){for(var Fe=arguments.length,Le=U(Fe),en=Fe;en--;)Le[en]=arguments[en];if(he)var Ft=Ho(_e),tn=lR(Le,Ft);if(f&&(Le=mm(Le,f,g,he)),_&&(Le=gm(Le,_,N,he)),Fe-=tn,he&&Fe<K){var lt=Vr(Le,Ft);return km(s,a,Va,_e.placeholder,u,Le,lt,B,I,K-Fe)}var Rn=Y?u:this,lr=ie?Rn[s]:s;return Fe=Le.length,B?Le=gI(Le,B):ve&&Fe>1&&Le.reverse(),X&&I<Fe&&(Le.length=I),this&&this!==Ct&&this instanceof _e&&(lr=De||ls(lr)),lr.apply(Rn,Le)}return _e}function bm(s,a){return function(u,f){return kD(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=am(u),f=am(f)),g=s(u,f)}return g}}function hd(s){return or(function(a){return a=tt(a,Yt(ge())),Ie(function(u){var f=this;return s(a,function(g){return Xt(g,f,u)})})})}function Pa(s,a){a=a===n?" ":Jt(a);var u=a.length;if(u<2)return u?sd(a,s):a;var f=sd(a,va(s/Mo(a)));return Lo(a)?Ir(Vn(f),0,s).join(""):f.slice(0,s)}function YD(s,a,u,f){var g=a&$,_=ls(s);function N(){for(var B=-1,I=arguments.length,K=-1,X=f.length,Y=U(X+I),ie=this&&this!==Ct&&this instanceof N?_:s;++K<X;)Y[K]=f[K];for(;I--;)Y[K++]=arguments[++B];return Xt(ie,g?u:this,Y)}return N}function xm(s){return function(a,u,f){return f&&typeof f!="number"&&It(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),FD(a,u,f,s)}}function Ra(s){return function(a,u){return typeof a=="string"&&typeof u=="string"||(a=dn(a),u=dn(u)),s(a,u)}}function km(s,a,u,f,g,_,N,B,I,K){var X=a&F,Y=X?N:n,ie=X?n:N,he=X?_:n,ve=X?n:_;a|=X?V:Z,a&=~(X?Z:V),a&R||(a&=~($|b));var De=[s,a,g,he,Y,ve,ie,B,I,K],_e=u.apply(n,De);return wd(s)&&Fm(_e,De),_e.placeholder=f,Om(_e,s,a)}function fd(s){var a=ft[s];return function(u,f){if(u=dn(u),f=f==null?0:Tt(Be(f),292),f&&Of(u)){var g=(He(u)+"e").split("e"),_=a(g[0]+"e"+(+g[1]+f));return g=(He(_)+"e").split("e"),+(g[0]+"e"+(+g[1]-f))}return a(u)}}var JD=zo&&1/la(new zo([,-0]))[1]==W?function(s){return new zo(s)}:Fd;function Sm(s){return function(a){var u=Nt(a);return u==Nn?Zc(a):u==An?mR(a):aR(a,s(a))}}function rr(s,a,u,f,g,_,N,B){var I=a&b;if(!I&&typeof s!="function")throw new on(c);var K=f?f.length:0;if(K||(a&=~(V|Z),f=g=n),N=N===n?N:mt(Be(N),0),B=B===n?B:Be(B),K-=g?g.length:0,a&Z){var X=f,Y=g;f=g=n}var ie=I?n:yd(s),he=[s,a,u,f,g,X,Y,_,N,B];if(ie&&hI(he,ie),s=he[0],a=he[1],u=he[2],f=he[3],g=he[4],B=he[9]=he[9]===n?I?0:s.length:mt(he[9]-K,0),!B&&a&(F|D)&&(a&=~(F|D)),!a||a==$)var ve=KD(s,a,u);else a==F||a==D?ve=XD(s,a,B):(a==V||a==($|V))&&!g.length?ve=YD(s,a,u,f):ve=Va.apply(n,he);var De=ie?im:Fm;return Om(De(ve,he),s,a)}function Em(s,a,u,f){return s===n||Pn(s,$o[u])&&!qe.call(f,u)?a:s}function Tm(s,a,u,f,g,_){return ot(s)&&ot(a)&&(_.set(a,s),Ea(s,a,n,Tm,_),_.delete(a)),s}function QD(s){return us(s)?n:s}function Nm(s,a,u,f,g,_){var N=u&E,B=s.length,I=a.length;if(B!=I&&!(N&&I>B))return!1;var K=_.get(s),X=_.get(a);if(K&&X)return K==a&&X==s;var Y=-1,ie=!0,he=u&O?new no:n;for(_.set(s,a),_.set(a,s);++Y<B;){var ve=s[Y],De=a[Y];if(f)var _e=N?f(De,ve,Y,a,s,_):f(ve,De,Y,s,a,_);if(_e!==n){if(_e)continue;ie=!1;break}if(he){if(!Lc(a,function(Fe,Le){if(!Yi(he,Le)&&(ve===Fe||g(ve,Fe,u,f,_)))return he.push(Le)})){ie=!1;break}}else if(!(ve===De||g(ve,De,u,f,_))){ie=!1;break}}return _.delete(s),_.delete(a),ie}function eI(s,a,u,f,g,_,N){switch(u){case Io:if(s.byteLength!=a.byteLength||s.byteOffset!=a.byteOffset)return!1;s=s.buffer,a=a.buffer;case Xi:return!(s.byteLength!=a.byteLength||!_(new fa(s),new fa(a)));case Zi:case Wi:case ji:return Pn(+s,+a);case ea:return s.name==a.name&&s.message==a.message;case Hi:case qi:return s==a+"";case Nn:var B=Zc;case An:var I=f&E;if(B||(B=la),s.size!=a.size&&!I)return!1;var K=N.get(s);if(K)return K==a;f|=O,N.set(s,a);var X=Nm(B(s),B(a),f,g,_,N);return N.delete(s),X;case na:if(ns)return ns.call(s)==ns.call(a)}return!1}function tI(s,a,u,f,g,_){var N=u&E,B=md(s),I=B.length,K=md(a),X=K.length;if(I!=X&&!N)return!1;for(var Y=I;Y--;){var ie=B[Y];if(!(N?ie in a:qe.call(a,ie)))return!1}var he=_.get(s),ve=_.get(a);if(he&&ve)return he==a&&ve==s;var De=!0;_.set(s,a),_.set(a,s);for(var _e=N;++Y<I;){ie=B[Y];var Fe=s[ie],Le=a[ie];if(f)var en=N?f(Le,Fe,ie,a,s,_):f(Fe,Le,ie,s,a,_);if(!(en===n?Fe===Le||g(Fe,Le,u,f,_):en)){De=!1;break}_e||(_e=ie=="constructor")}if(De&&!_e){var Ft=s.constructor,tn=a.constructor;Ft!=tn&&"constructor"in s&&"constructor"in a&&!(typeof Ft=="function"&&Ft instanceof Ft&&typeof tn=="function"&&tn instanceof tn)&&(De=!1)}return _.delete(s),_.delete(a),De}function or(s){return xd(Dm(s,n,Um),s+"")}function md(s){return qf(s,_t,_d)}function gd(s){return qf(s,$t,Am)}var yd=Ca?function(s){return Ca.get(s)}:Fd;function Da(s){for(var a=s.name+"",u=Uo[a],f=qe.call(Uo,a)?u.length:0;f--;){var g=u[f],_=g.func;if(_==null||_==s)return g.name}return a}function Ho(s){var a=qe.call(v,"placeholder")?v:s;return a.placeholder}function ge(){var s=v.iteratee||Dd;return s=s===Dd?Yf:s,arguments.length?s(arguments[0],arguments[1]):s}function Ia(s,a){var u=s.__data__;return cI(a)?u[typeof a=="string"?"string":"hash"]:u.map}function vd(s){for(var a=_t(s),u=a.length;u--;){var f=a[u],g=s[f];a[u]=[f,g,Pm(g)]}return a}function io(s,a){var u=pR(s,a);return Xf(u)?u:n}function nI(s){var a=qe.call(s,eo),u=s[eo];try{s[eo]=n;var f=!0}catch{}var g=pa.call(s);return f&&(a?s[eo]=u:delete s[eo]),g}var _d=jc?function(s){return s==null?[]:(s=Xe(s),Nr(jc(s),function(a){return If.call(s,a)}))}:Od,Am=jc?function(s){for(var a=[];s;)Ar(a,_d(s)),s=ma(s);return a}:Od,Nt=Dt;(Hc&&Nt(new Hc(new ArrayBuffer(1)))!=Io||Qi&&Nt(new Qi)!=Nn||qc&&Nt(qc.resolve())!=Zh||zo&&Nt(new zo)!=An||es&&Nt(new es)!=Ki)&&(Nt=function(s){var a=Dt(s),u=a==Qn?s.constructor:n,f=u?so(u):"";if(f)switch(f){case LR:return Io;case MR:return Nn;case GR:return Zh;case $R:return An;case zR:return Ki}return a});function rI(s,a,u){for(var f=-1,g=u.length;++f<g;){var _=u[f],N=_.size;switch(_.type){case"drop":s+=N;break;case"dropRight":a-=N;break;case"take":a=Tt(a,s+N);break;case"takeRight":s=mt(s,a-N);break}}return{start:s,end:a}}function oI(s){var a=s.match(dP);return a?a[1].split(uP):[]}function Vm(s,a,u){a=Dr(a,s);for(var f=-1,g=a.length,_=!1;++f<g;){var N=jn(a[f]);if(!(_=s!=null&&u(s,N)))break;s=s[N]}return _||++f!=g?_:(g=s==null?0:s.length,!!g&&za(g)&&ir(N,g)&&(Ne(s)||ao(s)))}function iI(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 Bm(s){return typeof s.constructor=="function"&&!cs(s)?Zo(ma(s)):{}}function sI(s,a,u){var f=s.constructor;switch(a){case Xi:return pd(s);case Zi:case Wi:return new f(+s);case Io:return UD(s,u);case vc:case _c:case Cc:case wc:case bc:case xc:case kc:case Sc:case Ec:return hm(s,u);case Nn:return new f;case ji:case qi:return new f(s);case Hi:return ZD(s);case An:return new f;case na:return WD(s)}}function aI(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(cP,`{
73
73
  /* [wrapped with `+a+`] */
74
- `)}function lP(i){return ke(i)||eo(i)||!!(Bh&&i&&i[Bh])}function Yn(i,a){var d=typeof i;return a=a??ae,!!a&&(d=="number"||d!="symbol"&&vV.test(i))&&i>-1&&i%1==0&&i<a}function Nt(i,a,d){if(!et(d))return!1;var h=typeof a;return(h=="number"?Rt(d)&&Yn(a,d.length):h=="string"&&a in d)?Sn(d[a],i):!1}function Zc(i,a){if(ke(i))return!1;var d=typeof i;return d=="number"||d=="symbol"||d=="boolean"||i==null||qt(i)?!0:iV.test(i)||!oV.test(i)||a!=null&&i in We(a)}function cP(i){var a=typeof i;return a=="string"||a=="number"||a=="symbol"||a=="boolean"?i!=="__proto__":i===null}function Uc(i){var a=ya(i),d=y[a];if(typeof d!="function"||!(a in De.prototype))return!1;if(i===d)return!0;var h=Gc(d);return!!h&&i===h[0]}function dP(i){return!!kh&&kh in i}var uP=js?Jn:ad;function es(i){var a=i&&i.constructor,d=typeof a=="function"&&a.prototype||Do;return i===d}function Sf(i){return i===i&&!et(i)}function Ef(i,a){return function(d){return d==null?!1:d[i]===a&&(a!==n||i in We(d))}}function pP(i){var a=xa(i,function(h){return d.size===f&&d.clear(),h}),d=a.cache;return a}function hP(i,a){var d=i[1],h=a[1],g=d|h,C=g<(G|v|U),k=h==U&&d==L||h==U&&d==O&&i[7].length<=a[8]||h==(U|O)&&a[7].length<=a[8]&&d==L;if(!(C||k))return i;h&G&&(i[2]=a[2],g|=d&G?0:R);var B=a[3];if(B){var D=i[3];i[3]=D?lf(D,B,a[4]):B,i[4]=D?br(i[3],m):a[4]}return B=a[5],B&&(D=i[5],i[5]=D?cf(D,B,a[6]):B,i[6]=D?br(i[5],m):a[6]),B=a[7],B&&(i[7]=B),h&U&&(i[8]=i[8]==null?a[8]:xt(i[8],a[8])),i[9]==null&&(i[9]=a[9]),i[0]=a[0],i[1]=g,i}function fP(i){var a=[];if(i!=null)for(var d in We(i))a.push(d);return a}function mP(i){return Ks.call(i)}function Tf(i,a,d){return a=dt(a===n?i.length-1:a,0),function(){for(var h=arguments,g=-1,C=dt(h.length-a,0),k=z(C);++g<C;)k[g]=h[a+g];g=-1;for(var B=z(a+1);++g<a;)B[g]=h[g];return B[a]=d(k),Wt(i,this,B)}}function Bf(i,a){return a.length<2?i:Jr(i,nn(a,0,-1))}function gP(i,a){for(var d=i.length,h=xt(a.length,d),g=Ft(i);h--;){var C=a[h];i[h]=Yn(C,d)?g[C]:n}return i}function Wc(i,a){if(!(a==="constructor"&&typeof i[a]=="function")&&a!="__proto__")return i[a]}var Vf=Af(Jh),ts=AN||function(i,a){return gt.setTimeout(i,a)},Hc=Af(LA);function Nf(i,a,d){var h=a+"";return Hc(i,aP(h,yP(oP(h),d)))}function Af(i){var a=0,d=0;return function(){var h=RN(),g=N-(h-d);if(d=h,g>0){if(++a>=he)return arguments[0]}else a=0;return i.apply(n,arguments)}}function Ca(i,a){var d=-1,h=i.length,g=h-1;for(a=a===n?h:a;++d<a;){var C=Bc(d,g),k=i[C];i[C]=i[d],i[d]=k}return i.length=a,i}var Pf=pP(function(i){var a=[];return i.charCodeAt(0)===46&&a.push(""),i.replace(sV,function(d,h,g,C){a.push(g?C.replace(fV,"$1"):h||d)}),a});function On(i){if(typeof i=="string"||qt(i))return i;var a=i+"";return a=="0"&&1/i==-oe?"-0":a}function Qr(i){if(i!=null){try{return qs.call(i)}catch{}try{return i+""}catch{}}return""}function yP(i,a){return Xt(Fi,function(d){var h="_."+d[0];a&d[1]&&!Zs(i,h)&&i.push(h)}),i.sort()}function Df(i){if(i instanceof De)return i.clone();var a=new en(i.__wrapped__,i.__chain__);return a.__actions__=Ft(i.__actions__),a.__index__=i.__index__,a.__values__=i.__values__,a}function _P(i,a,d){(d?Nt(i,a,d):a===n)?a=1:a=dt(Te(a),0);var h=i==null?0:i.length;if(!h||a<1)return[];for(var g=0,C=0,k=z(ta(h/a));g<h;)k[C++]=nn(i,g,g+=a);return k}function CP(i){for(var a=-1,d=i==null?0:i.length,h=0,g=[];++a<d;){var C=i[a];C&&(g[h++]=C)}return g}function vP(){var i=arguments.length;if(!i)return[];for(var a=z(i-1),d=arguments[0],h=i;h--;)a[h-1]=arguments[h];return wr(ke(d)?Ft(d):[d],yt(a,1))}var wP=Ae(function(i,a){return rt(i)?Ki(i,yt(a,1,rt,!0)):[]}),bP=Ae(function(i,a){var d=rn(a);return rt(d)&&(d=n),rt(i)?Ki(i,yt(a,1,rt,!0),fe(d,2)):[]}),xP=Ae(function(i,a){var d=rn(a);return rt(d)&&(d=n),rt(i)?Ki(i,yt(a,1,rt,!0),n,d):[]});function kP(i,a,d){var h=i==null?0:i.length;return h?(a=d||a===n?1:Te(a),nn(i,a<0?0:a,h)):[]}function SP(i,a,d){var h=i==null?0:i.length;return h?(a=d||a===n?1:Te(a),a=h-a,nn(i,0,a<0?0:a)):[]}function EP(i,a){return i&&i.length?ua(i,fe(a,3),!0,!0):[]}function TP(i,a){return i&&i.length?ua(i,fe(a,3),!0):[]}function BP(i,a,d,h){var g=i==null?0:i.length;return g?(d&&typeof d!="number"&&Nt(i,a,d)&&(d=0,h=g),vA(i,a,d,h)):[]}function Ff(i,a,d){var h=i==null?0:i.length;if(!h)return-1;var g=d==null?0:Te(d);return g<0&&(g=dt(h+g,0)),Us(i,fe(a,3),g)}function Rf(i,a,d){var h=i==null?0:i.length;if(!h)return-1;var g=h-1;return d!==n&&(g=Te(d),g=d<0?dt(h+g,0):xt(g,h-1)),Us(i,fe(a,3),g,!0)}function Mf(i){var a=i==null?0:i.length;return a?yt(i,1):[]}function VP(i){var a=i==null?0:i.length;return a?yt(i,oe):[]}function NP(i,a){var d=i==null?0:i.length;return d?(a=a===n?1:Te(a),yt(i,a)):[]}function AP(i){for(var a=-1,d=i==null?0:i.length,h={};++a<d;){var g=i[a];h[g[0]]=g[1]}return h}function If(i){return i&&i.length?i[0]:n}function PP(i,a,d){var h=i==null?0:i.length;if(!h)return-1;var g=d==null?0:Te(d);return g<0&&(g=dt(h+g,0)),Vo(i,a,g)}function DP(i){var a=i==null?0:i.length;return a?nn(i,0,-1):[]}var FP=Ae(function(i){var a=Je(i,Dc);return a.length&&a[0]===i[0]?xc(a):[]}),RP=Ae(function(i){var a=rn(i),d=Je(i,Dc);return a===rn(d)?a=n:d.pop(),d.length&&d[0]===i[0]?xc(d,fe(a,2)):[]}),MP=Ae(function(i){var a=rn(i),d=Je(i,Dc);return a=typeof a=="function"?a:n,a&&d.pop(),d.length&&d[0]===i[0]?xc(d,n,a):[]});function IP(i,a){return i==null?"":DN.call(i,a)}function rn(i){var a=i==null?0:i.length;return a?i[a-1]:n}function OP(i,a,d){var h=i==null?0:i.length;if(!h)return-1;var g=h;return d!==n&&(g=Te(d),g=g<0?dt(h+g,0):xt(g,h-1)),a===a?yN(i,a,g):Us(i,gh,g,!0)}function LP(i,a){return i&&i.length?jh(i,Te(a)):n}var GP=Ae(Of);function Of(i,a){return i&&i.length&&a&&a.length?Tc(i,a):i}function zP(i,a,d){return i&&i.length&&a&&a.length?Tc(i,a,fe(d,2)):i}function $P(i,a,d){return i&&i.length&&a&&a.length?Tc(i,a,n,d):i}var ZP=Kn(function(i,a){var d=i==null?0:i.length,h=Cc(i,a);return Yh(i,Je(a,function(g){return Yn(g,d)?+g:g}).sort(af)),h});function UP(i,a){var d=[];if(!(i&&i.length))return d;var h=-1,g=[],C=i.length;for(a=fe(a,3);++h<C;){var k=i[h];a(k,h,i)&&(d.push(k),g.push(h))}return Yh(i,g),d}function jc(i){return i==null?i:IN.call(i)}function WP(i,a,d){var h=i==null?0:i.length;return h?(d&&typeof d!="number"&&Nt(i,a,d)?(a=0,d=h):(a=a==null?0:Te(a),d=d===n?h:Te(d)),nn(i,a,d)):[]}function HP(i,a){return da(i,a)}function jP(i,a,d){return Nc(i,a,fe(d,2))}function qP(i,a){var d=i==null?0:i.length;if(d){var h=da(i,a);if(h<d&&Sn(i[h],a))return h}return-1}function KP(i,a){return da(i,a,!0)}function YP(i,a,d){return Nc(i,a,fe(d,2),!0)}function JP(i,a){var d=i==null?0:i.length;if(d){var h=da(i,a,!0)-1;if(Sn(i[h],a))return h}return-1}function XP(i){return i&&i.length?Xh(i):[]}function QP(i,a){return i&&i.length?Xh(i,fe(a,2)):[]}function eD(i){var a=i==null?0:i.length;return a?nn(i,1,a):[]}function tD(i,a,d){return i&&i.length?(a=d||a===n?1:Te(a),nn(i,0,a<0?0:a)):[]}function nD(i,a,d){var h=i==null?0:i.length;return h?(a=d||a===n?1:Te(a),a=h-a,nn(i,a<0?0:a,h)):[]}function rD(i,a){return i&&i.length?ua(i,fe(a,3),!1,!0):[]}function oD(i,a){return i&&i.length?ua(i,fe(a,3)):[]}var iD=Ae(function(i){return Sr(yt(i,1,rt,!0))}),sD=Ae(function(i){var a=rn(i);return rt(a)&&(a=n),Sr(yt(i,1,rt,!0),fe(a,2))}),aD=Ae(function(i){var a=rn(i);return a=typeof a=="function"?a:n,Sr(yt(i,1,rt,!0),n,a)});function lD(i){return i&&i.length?Sr(i):[]}function cD(i,a){return i&&i.length?Sr(i,fe(a,2)):[]}function dD(i,a){return a=typeof a=="function"?a:n,i&&i.length?Sr(i,n,a):[]}function qc(i){if(!(i&&i.length))return[];var a=0;return i=vr(i,function(d){if(rt(d))return a=dt(d.length,a),!0}),uc(a,function(d){return Je(i,lc(d))})}function Lf(i,a){if(!(i&&i.length))return[];var d=qc(i);return a==null?d:Je(d,function(h){return Wt(a,n,h)})}var uD=Ae(function(i,a){return rt(i)?Ki(i,a):[]}),pD=Ae(function(i){return Pc(vr(i,rt))}),hD=Ae(function(i){var a=rn(i);return rt(a)&&(a=n),Pc(vr(i,rt),fe(a,2))}),fD=Ae(function(i){var a=rn(i);return a=typeof a=="function"?a:n,Pc(vr(i,rt),n,a)}),mD=Ae(qc);function gD(i,a){return nf(i||[],a||[],qi)}function yD(i,a){return nf(i||[],a||[],Xi)}var _D=Ae(function(i){var a=i.length,d=a>1?i[a-1]:n;return d=typeof d=="function"?(i.pop(),d):n,Lf(i,d)});function Gf(i){var a=y(i);return a.__chain__=!0,a}function CD(i,a){return a(i),i}function va(i,a){return a(i)}var vD=Kn(function(i){var a=i.length,d=a?i[0]:0,h=this.__wrapped__,g=function(C){return Cc(C,i)};return a>1||this.__actions__.length||!(h instanceof De)||!Yn(d)?this.thru(g):(h=h.slice(d,+d+(a?1:0)),h.__actions__.push({func:va,args:[g],thisArg:n}),new en(h,this.__chain__).thru(function(C){return a&&!C.length&&C.push(n),C}))});function wD(){return Gf(this)}function bD(){return new en(this.value(),this.__chain__)}function xD(){this.__values__===n&&(this.__values__=em(this.value()));var i=this.__index__>=this.__values__.length,a=i?n:this.__values__[this.__index__++];return{done:i,value:a}}function kD(){return this}function SD(i){for(var a,d=this;d instanceof ia;){var h=Df(d);h.__index__=0,h.__values__=n,a?g.__wrapped__=h:a=h;var g=h;d=d.__wrapped__}return g.__wrapped__=i,a}function ED(){var i=this.__wrapped__;if(i instanceof De){var a=i;return this.__actions__.length&&(a=new De(this)),a=a.reverse(),a.__actions__.push({func:va,args:[jc],thisArg:n}),new en(a,this.__chain__)}return this.thru(jc)}function TD(){return tf(this.__wrapped__,this.__actions__)}var BD=pa(function(i,a,d){Ue.call(i,d)?++i[d]:jn(i,d,1)});function VD(i,a,d){var h=ke(i)?fh:CA;return d&&Nt(i,a,d)&&(a=n),h(i,fe(a,3))}function ND(i,a){var d=ke(i)?vr:Oh;return d(i,fe(a,3))}var AD=hf(Ff),PD=hf(Rf);function DD(i,a){return yt(wa(i,a),1)}function FD(i,a){return yt(wa(i,a),oe)}function RD(i,a,d){return d=d===n?1:Te(d),yt(wa(i,a),d)}function zf(i,a){var d=ke(i)?Xt:kr;return d(i,fe(a,3))}function $f(i,a){var d=ke(i)?eN:Ih;return d(i,fe(a,3))}var MD=pa(function(i,a,d){Ue.call(i,d)?i[d].push(a):jn(i,d,[a])});function ID(i,a,d,h){i=Rt(i)?i:zo(i),d=d&&!h?Te(d):0;var g=i.length;return d<0&&(d=dt(g+d,0)),Ea(i)?d<=g&&i.indexOf(a,d)>-1:!!g&&Vo(i,a,d)>-1}var OD=Ae(function(i,a,d){var h=-1,g=typeof a=="function",C=Rt(i)?z(i.length):[];return kr(i,function(k){C[++h]=g?Wt(a,k,d):Yi(k,a,d)}),C}),LD=pa(function(i,a,d){jn(i,d,a)});function wa(i,a){var d=ke(i)?Je:Uh;return d(i,fe(a,3))}function GD(i,a,d,h){return i==null?[]:(ke(a)||(a=a==null?[]:[a]),d=h?n:d,ke(d)||(d=d==null?[]:[d]),qh(i,a,d))}var zD=pa(function(i,a,d){i[d?0:1].push(a)},function(){return[[],[]]});function $D(i,a,d){var h=ke(i)?sc:_h,g=arguments.length<3;return h(i,fe(a,4),d,g,kr)}function ZD(i,a,d){var h=ke(i)?tN:_h,g=arguments.length<3;return h(i,fe(a,4),d,g,Ih)}function UD(i,a){var d=ke(i)?vr:Oh;return d(i,ka(fe(a,3)))}function WD(i){var a=ke(i)?Dh:IA;return a(i)}function HD(i,a,d){(d?Nt(i,a,d):a===n)?a=1:a=Te(a);var h=ke(i)?fA:OA;return h(i,a)}function jD(i){var a=ke(i)?mA:GA;return a(i)}function qD(i){if(i==null)return 0;if(Rt(i))return Ea(i)?Ao(i):i.length;var a=kt(i);return a==wn||a==bn?i.size:Sc(i).length}function KD(i,a,d){var h=ke(i)?ac:zA;return d&&Nt(i,a,d)&&(a=n),h(i,fe(a,3))}var YD=Ae(function(i,a){if(i==null)return[];var d=a.length;return d>1&&Nt(i,a[0],a[1])?a=[]:d>2&&Nt(a[0],a[1],a[2])&&(a=[a[0]]),qh(i,yt(a,1),[])}),ba=NN||function(){return gt.Date.now()};function JD(i,a){if(typeof a!="function")throw new Qt(c);return i=Te(i),function(){if(--i<1)return a.apply(this,arguments)}}function Zf(i,a,d){return a=d?n:a,a=i&&a==null?i.length:a,qn(i,U,n,n,n,n,a)}function Uf(i,a){var d;if(typeof a!="function")throw new Qt(c);return i=Te(i),function(){return--i>0&&(d=a.apply(this,arguments)),i<=1&&(a=n),d}}var Kc=Ae(function(i,a,d){var h=G;if(d.length){var g=br(d,Lo(Kc));h|=T}return qn(i,h,a,d,g)}),Wf=Ae(function(i,a,d){var h=G|v;if(d.length){var g=br(d,Lo(Wf));h|=T}return qn(a,h,i,d,g)});function Hf(i,a,d){a=d?n:a;var h=qn(i,L,n,n,n,n,n,a);return h.placeholder=Hf.placeholder,h}function jf(i,a,d){a=d?n:a;var h=qn(i,F,n,n,n,n,n,a);return h.placeholder=jf.placeholder,h}function qf(i,a,d){var h,g,C,k,B,D,q=0,K=!1,Y=!1,te=!0;if(typeof i!="function")throw new Qt(c);a=on(a)||0,et(d)&&(K=!!d.leading,Y="maxWait"in d,C=Y?dt(on(d.maxWait)||0,a):C,te="trailing"in d?!!d.trailing:te);function de(ot){var En=h,Qn=g;return h=g=n,q=ot,k=i.apply(Qn,En),k}function ge(ot){return q=ot,B=ts(Pe,a),K?de(ot):k}function Ne(ot){var En=ot-D,Qn=ot-q,hm=a-En;return Y?xt(hm,C-Qn):hm}function ye(ot){var En=ot-D,Qn=ot-q;return D===n||En>=a||En<0||Y&&Qn>=C}function Pe(){var ot=ba();if(ye(ot))return Re(ot);B=ts(Pe,Ne(ot))}function Re(ot){return B=n,te&&h?de(ot):(h=g=n,k)}function Kt(){B!==n&&rf(B),q=0,h=D=g=B=n}function At(){return B===n?k:Re(ba())}function Yt(){var ot=ba(),En=ye(ot);if(h=arguments,g=this,D=ot,En){if(B===n)return ge(D);if(Y)return rf(B),B=ts(Pe,a),de(D)}return B===n&&(B=ts(Pe,a)),k}return Yt.cancel=Kt,Yt.flush=At,Yt}var XD=Ae(function(i,a){return Mh(i,1,a)}),QD=Ae(function(i,a,d){return Mh(i,on(a)||0,d)});function eF(i){return qn(i,Z)}function xa(i,a){if(typeof i!="function"||a!=null&&typeof a!="function")throw new Qt(c);var d=function(){var h=arguments,g=a?a.apply(this,h):h[0],C=d.cache;if(C.has(g))return C.get(g);var k=i.apply(this,h);return d.cache=C.set(g,k)||C,k};return d.cache=new(xa.Cache||Hn),d}xa.Cache=Hn;function ka(i){if(typeof i!="function")throw new Qt(c);return function(){var a=arguments;switch(a.length){case 0:return!i.call(this);case 1:return!i.call(this,a[0]);case 2:return!i.call(this,a[0],a[1]);case 3:return!i.call(this,a[0],a[1],a[2])}return!i.apply(this,a)}}function tF(i){return Uf(2,i)}var nF=$A(function(i,a){a=a.length==1&&ke(a[0])?Je(a[0],Ht(fe())):Je(yt(a,1),Ht(fe()));var d=a.length;return Ae(function(h){for(var g=-1,C=xt(h.length,d);++g<C;)h[g]=a[g].call(this,h[g]);return Wt(i,this,h)})}),Yc=Ae(function(i,a){var d=br(a,Lo(Yc));return qn(i,T,n,a,d)}),Kf=Ae(function(i,a){var d=br(a,Lo(Kf));return qn(i,$,n,a,d)}),rF=Kn(function(i,a){return qn(i,O,n,n,n,a)});function oF(i,a){if(typeof i!="function")throw new Qt(c);return a=a===n?a:Te(a),Ae(i,a)}function iF(i,a){if(typeof i!="function")throw new Qt(c);return a=a==null?0:dt(Te(a),0),Ae(function(d){var h=d[a],g=Tr(d,0,a);return h&&wr(g,h),Wt(i,this,g)})}function sF(i,a,d){var h=!0,g=!0;if(typeof i!="function")throw new Qt(c);return et(d)&&(h="leading"in d?!!d.leading:h,g="trailing"in d?!!d.trailing:g),qf(i,a,{leading:h,maxWait:a,trailing:g})}function aF(i){return Zf(i,1)}function lF(i,a){return Yc(Fc(a),i)}function cF(){if(!arguments.length)return[];var i=arguments[0];return ke(i)?i:[i]}function dF(i){return tn(i,S)}function uF(i,a){return a=typeof a=="function"?a:n,tn(i,S,a)}function pF(i){return tn(i,_|S)}function hF(i,a){return a=typeof a=="function"?a:n,tn(i,_|S,a)}function fF(i,a){return a==null||Rh(i,a,mt(a))}function Sn(i,a){return i===a||i!==i&&a!==a}var mF=ga(bc),gF=ga(function(i,a){return i>=a}),eo=zh(function(){return arguments}())?zh:function(i){return tt(i)&&Ue.call(i,"callee")&&!Th.call(i,"callee")},ke=z.isArray,yF=lh?Ht(lh):SA;function Rt(i){return i!=null&&Sa(i.length)&&!Jn(i)}function rt(i){return tt(i)&&Rt(i)}function _F(i){return i===!0||i===!1||tt(i)&&Vt(i)==Ri}var Br=PN||ad,CF=ch?Ht(ch):EA;function vF(i){return tt(i)&&i.nodeType===1&&!ns(i)}function wF(i){if(i==null)return!0;if(Rt(i)&&(ke(i)||typeof i=="string"||typeof i.splice=="function"||Br(i)||Go(i)||eo(i)))return!i.length;var a=kt(i);if(a==wn||a==bn)return!i.size;if(es(i))return!Sc(i).length;for(var d in i)if(Ue.call(i,d))return!1;return!0}function bF(i,a){return Ji(i,a)}function xF(i,a,d){d=typeof d=="function"?d:n;var h=d?d(i,a):n;return h===n?Ji(i,a,n,d):!!h}function Jc(i){if(!tt(i))return!1;var a=Vt(i);return a==Is||a==HB||typeof i.message=="string"&&typeof i.name=="string"&&!ns(i)}function kF(i){return typeof i=="number"&&Vh(i)}function Jn(i){if(!et(i))return!1;var a=Vt(i);return a==Os||a==Mp||a==WB||a==qB}function Yf(i){return typeof i=="number"&&i==Te(i)}function Sa(i){return typeof i=="number"&&i>-1&&i%1==0&&i<=ae}function et(i){var a=typeof i;return i!=null&&(a=="object"||a=="function")}function tt(i){return i!=null&&typeof i=="object"}var Jf=dh?Ht(dh):BA;function SF(i,a){return i===a||kc(i,a,zc(a))}function EF(i,a,d){return d=typeof d=="function"?d:n,kc(i,a,zc(a),d)}function TF(i){return Xf(i)&&i!=+i}function BF(i){if(uP(i))throw new xe(l);return $h(i)}function VF(i){return i===null}function NF(i){return i==null}function Xf(i){return typeof i=="number"||tt(i)&&Vt(i)==Ii}function ns(i){if(!tt(i)||Vt(i)!=Un)return!1;var a=Xs(i);if(a===null)return!0;var d=Ue.call(a,"constructor")&&a.constructor;return typeof d=="function"&&d instanceof d&&qs.call(d)==EN}var Xc=uh?Ht(uh):VA;function AF(i){return Yf(i)&&i>=-ae&&i<=ae}var Qf=ph?Ht(ph):NA;function Ea(i){return typeof i=="string"||!ke(i)&&tt(i)&&Vt(i)==Li}function qt(i){return typeof i=="symbol"||tt(i)&&Vt(i)==Ls}var Go=hh?Ht(hh):AA;function PF(i){return i===n}function DF(i){return tt(i)&&kt(i)==Gi}function FF(i){return tt(i)&&Vt(i)==YB}var RF=ga(Ec),MF=ga(function(i,a){return i<=a});function em(i){if(!i)return[];if(Rt(i))return Ea(i)?xn(i):Ft(i);if(Zi&&i[Zi])return fN(i[Zi]());var a=kt(i),d=a==wn?hc:a==bn?Ws:zo;return d(i)}function Xn(i){if(!i)return i===0?i:0;if(i=on(i),i===oe||i===-oe){var a=i<0?-1:1;return a*Fe}return i===i?i:0}function Te(i){var a=Xn(i),d=a%1;return a===a?d?a-d:a:0}function tm(i){return i?Yr(Te(i),0,ft):0}function on(i){if(typeof i=="number")return i;if(qt(i))return Ye;if(et(i)){var a=typeof i.valueOf=="function"?i.valueOf():i;i=et(a)?a+"":a}if(typeof i!="string")return i===0?i:+i;i=Ch(i);var d=yV.test(i);return d||CV.test(i)?JV(i.slice(2),d?2:8):gV.test(i)?Ye:+i}function nm(i){return In(i,Mt(i))}function IF(i){return i?Yr(Te(i),-ae,ae):i===0?i:0}function Ze(i){return i==null?"":jt(i)}var OF=Io(function(i,a){if(es(a)||Rt(a)){In(a,mt(a),i);return}for(var d in a)Ue.call(a,d)&&qi(i,d,a[d])}),rm=Io(function(i,a){In(a,Mt(a),i)}),Ta=Io(function(i,a,d,h){In(a,Mt(a),i,h)}),LF=Io(function(i,a,d,h){In(a,mt(a),i,h)}),GF=Kn(Cc);function zF(i,a){var d=Mo(i);return a==null?d:Fh(d,a)}var $F=Ae(function(i,a){i=We(i);var d=-1,h=a.length,g=h>2?a[2]:n;for(g&&Nt(a[0],a[1],g)&&(h=1);++d<h;)for(var C=a[d],k=Mt(C),B=-1,D=k.length;++B<D;){var q=k[B],K=i[q];(K===n||Sn(K,Do[q])&&!Ue.call(i,q))&&(i[q]=C[q])}return i}),ZF=Ae(function(i){return i.push(n,vf),Wt(om,n,i)});function UF(i,a){return mh(i,fe(a,3),Mn)}function WF(i,a){return mh(i,fe(a,3),wc)}function HF(i,a){return i==null?i:vc(i,fe(a,3),Mt)}function jF(i,a){return i==null?i:Lh(i,fe(a,3),Mt)}function qF(i,a){return i&&Mn(i,fe(a,3))}function KF(i,a){return i&&wc(i,fe(a,3))}function YF(i){return i==null?[]:la(i,mt(i))}function JF(i){return i==null?[]:la(i,Mt(i))}function Qc(i,a,d){var h=i==null?n:Jr(i,a);return h===n?d:h}function XF(i,a){return i!=null&&xf(i,a,wA)}function ed(i,a){return i!=null&&xf(i,a,bA)}var QF=mf(function(i,a,d){a!=null&&typeof a.toString!="function"&&(a=Ks.call(a)),i[a]=d},nd(It)),eR=mf(function(i,a,d){a!=null&&typeof a.toString!="function"&&(a=Ks.call(a)),Ue.call(i,a)?i[a].push(d):i[a]=[d]},fe),tR=Ae(Yi);function mt(i){return Rt(i)?Ph(i):Sc(i)}function Mt(i){return Rt(i)?Ph(i,!0):PA(i)}function nR(i,a){var d={};return a=fe(a,3),Mn(i,function(h,g,C){jn(d,a(h,g,C),h)}),d}function rR(i,a){var d={};return a=fe(a,3),Mn(i,function(h,g,C){jn(d,g,a(h,g,C))}),d}var oR=Io(function(i,a,d){ca(i,a,d)}),om=Io(function(i,a,d,h){ca(i,a,d,h)}),iR=Kn(function(i,a){var d={};if(i==null)return d;var h=!1;a=Je(a,function(C){return C=Er(C,i),h||(h=C.length>1),C}),In(i,Lc(i),d),h&&(d=tn(d,_|x|S,QA));for(var g=a.length;g--;)Ac(d,a[g]);return d});function sR(i,a){return im(i,ka(fe(a)))}var aR=Kn(function(i,a){return i==null?{}:FA(i,a)});function im(i,a){if(i==null)return{};var d=Je(Lc(i),function(h){return[h]});return a=fe(a),Kh(i,d,function(h,g){return a(h,g[0])})}function lR(i,a,d){a=Er(a,i);var h=-1,g=a.length;for(g||(g=1,i=n);++h<g;){var C=i==null?n:i[On(a[h])];C===n&&(h=g,C=d),i=Jn(C)?C.call(i):C}return i}function cR(i,a,d){return i==null?i:Xi(i,a,d)}function dR(i,a,d,h){return h=typeof h=="function"?h:n,i==null?i:Xi(i,a,d,h)}var sm=_f(mt),am=_f(Mt);function uR(i,a,d){var h=ke(i),g=h||Br(i)||Go(i);if(a=fe(a,4),d==null){var C=i&&i.constructor;g?d=h?new C:[]:et(i)?d=Jn(C)?Mo(Xs(i)):{}:d={}}return(g?Xt:Mn)(i,function(k,B,D){return a(d,k,B,D)}),d}function pR(i,a){return i==null?!0:Ac(i,a)}function hR(i,a,d){return i==null?i:ef(i,a,Fc(d))}function fR(i,a,d,h){return h=typeof h=="function"?h:n,i==null?i:ef(i,a,Fc(d),h)}function zo(i){return i==null?[]:pc(i,mt(i))}function mR(i){return i==null?[]:pc(i,Mt(i))}function gR(i,a,d){return d===n&&(d=a,a=n),d!==n&&(d=on(d),d=d===d?d:0),a!==n&&(a=on(a),a=a===a?a:0),Yr(on(i),a,d)}function yR(i,a,d){return a=Xn(a),d===n?(d=a,a=0):d=Xn(d),i=on(i),xA(i,a,d)}function _R(i,a,d){if(d&&typeof d!="boolean"&&Nt(i,a,d)&&(a=d=n),d===n&&(typeof a=="boolean"?(d=a,a=n):typeof i=="boolean"&&(d=i,i=n)),i===n&&a===n?(i=0,a=1):(i=Xn(i),a===n?(a=i,i=0):a=Xn(a)),i>a){var h=i;i=a,a=h}if(d||i%1||a%1){var g=Nh();return xt(i+g*(a-i+YV("1e-"+((g+"").length-1))),a)}return Bc(i,a)}var CR=Oo(function(i,a,d){return a=a.toLowerCase(),i+(d?lm(a):a)});function lm(i){return td(Ze(i).toLowerCase())}function cm(i){return i=Ze(i),i&&i.replace(wV,cN).replace(GV,"")}function vR(i,a,d){i=Ze(i),a=jt(a);var h=i.length;d=d===n?h:Yr(Te(d),0,h);var g=d;return d-=a.length,d>=0&&i.slice(d,g)==a}function wR(i){return i=Ze(i),i&&tV.test(i)?i.replace(Lp,dN):i}function bR(i){return i=Ze(i),i&&aV.test(i)?i.replace(Yl,"\\$&"):i}var xR=Oo(function(i,a,d){return i+(d?"-":"")+a.toLowerCase()}),kR=Oo(function(i,a,d){return i+(d?" ":"")+a.toLowerCase()}),SR=pf("toLowerCase");function ER(i,a,d){i=Ze(i),a=Te(a);var h=a?Ao(i):0;if(!a||h>=a)return i;var g=(a-h)/2;return ma(na(g),d)+i+ma(ta(g),d)}function TR(i,a,d){i=Ze(i),a=Te(a);var h=a?Ao(i):0;return a&&h<a?i+ma(a-h,d):i}function BR(i,a,d){i=Ze(i),a=Te(a);var h=a?Ao(i):0;return a&&h<a?ma(a-h,d)+i:i}function VR(i,a,d){return d||a==null?a=0:a&&(a=+a),MN(Ze(i).replace(Jl,""),a||0)}function NR(i,a,d){return(d?Nt(i,a,d):a===n)?a=1:a=Te(a),Vc(Ze(i),a)}function AR(){var i=arguments,a=Ze(i[0]);return i.length<3?a:a.replace(i[1],i[2])}var PR=Oo(function(i,a,d){return i+(d?"_":"")+a.toLowerCase()});function DR(i,a,d){return d&&typeof d!="number"&&Nt(i,a,d)&&(a=d=n),d=d===n?ft:d>>>0,d?(i=Ze(i),i&&(typeof a=="string"||a!=null&&!Xc(a))&&(a=jt(a),!a&&No(i))?Tr(xn(i),0,d):i.split(a,d)):[]}var FR=Oo(function(i,a,d){return i+(d?" ":"")+td(a)});function RR(i,a,d){return i=Ze(i),d=d==null?0:Yr(Te(d),0,i.length),a=jt(a),i.slice(d,d+a.length)==a}function MR(i,a,d){var h=y.templateSettings;d&&Nt(i,a,d)&&(a=n),i=Ze(i),a=Ta({},a,h,Cf);var g=Ta({},a.imports,h.imports,Cf),C=mt(g),k=pc(g,C),B,D,q=0,K=a.interpolate||Gs,Y="__p += '",te=fc((a.escape||Gs).source+"|"+K.source+"|"+(K===Gp?mV:Gs).source+"|"+(a.evaluate||Gs).source+"|$","g"),de="//# sourceURL="+(Ue.call(a,"sourceURL")?(a.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++WV+"]")+`
75
- `;i.replace(te,function(ye,Pe,Re,Kt,At,Yt){return Re||(Re=Kt),Y+=i.slice(q,Yt).replace(bV,uN),Pe&&(B=!0,Y+=`' +
76
- __e(`+Pe+`) +
77
- '`),At&&(D=!0,Y+=`';
78
- `+At+`;
79
- __p += '`),Re&&(Y+=`' +
80
- ((__t = (`+Re+`)) == null ? '' : __t) +
81
- '`),q=Yt+ye.length,ye}),Y+=`';
82
- `;var ge=Ue.call(a,"variable")&&a.variable;if(!ge)Y=`with (obj) {
74
+ `)}function lI(s){return Ne(s)||ao(s)||!!(Ff&&s&&s[Ff])}function ir(s,a){var u=typeof s;return a=a??q,!!a&&(u=="number"||u!="symbol"&&CP.test(s))&&s>-1&&s%1==0&&s<a}function It(s,a,u){if(!ot(u))return!1;var f=typeof a;return(f=="number"?Gt(u)&&ir(a,u.length):f=="string"&&a in u)?Pn(u[a],s):!1}function Cd(s,a){if(Ne(s))return!1;var u=typeof s;return u=="number"||u=="symbol"||u=="boolean"||s==null||Qt(s)?!0:iP.test(s)||!oP.test(s)||a!=null&&s in Xe(a)}function cI(s){var a=typeof s;return a=="string"||a=="number"||a=="symbol"||a=="boolean"?s!=="__proto__":s===null}function wd(s){var a=Da(s),u=v[a];if(typeof u!="function"||!(a in Oe.prototype))return!1;if(s===u)return!0;var f=yd(u);return!!f&&s===f[0]}function dI(s){return!!Pf&&Pf in s}var uI=da?sr:Ld;function cs(s){var a=s&&s.constructor,u=typeof a=="function"&&a.prototype||$o;return s===u}function Pm(s){return s===s&&!ot(s)}function Rm(s,a){return function(u){return u==null?!1:u[s]===a&&(a!==n||s in Xe(u))}}function pI(s){var a=Ga(s,function(f){return u.size===h&&u.clear(),f}),u=a.cache;return a}function hI(s,a){var u=s[1],f=a[1],g=u|f,_=g<($|b|ne),N=f==ne&&u==F||f==ne&&u==H&&s[7].length<=a[8]||f==(ne|H)&&a[7].length<=a[8]&&u==F;if(!(_||N))return s;f&$&&(s[2]=a[2],g|=u&$?0:R);var B=a[3];if(B){var I=s[3];s[3]=I?mm(I,B,a[4]):B,s[4]=I?Vr(s[3],m):a[4]}return B=a[5],B&&(I=s[5],s[5]=I?gm(I,B,a[6]):B,s[6]=I?Vr(s[5],m):a[6]),B=a[7],B&&(s[7]=B),f&ne&&(s[8]=s[8]==null?a[8]:Tt(s[8],a[8])),s[9]==null&&(s[9]=a[9]),s[0]=a[0],s[1]=g,s}function fI(s){var a=[];if(s!=null)for(var u in Xe(s))a.push(u);return a}function mI(s){return pa.call(s)}function Dm(s,a,u){return a=mt(a===n?s.length-1:a,0),function(){for(var f=arguments,g=-1,_=mt(f.length-a,0),N=U(_);++g<_;)N[g]=f[a+g];g=-1;for(var B=U(a+1);++g<a;)B[g]=f[g];return B[a]=u(N),Xt(s,this,B)}}function Im(s,a){return a.length<2?s:oo(s,ln(a,0,-1))}function gI(s,a){for(var u=s.length,f=Tt(a.length,u),g=Mt(s);f--;){var _=a[f];s[f]=ir(_,u)?g[_]:n}return s}function bd(s,a){if(!(a==="constructor"&&typeof s[a]=="function")&&a!="__proto__")return s[a]}var Fm=Lm(im),ds=BR||function(s,a){return Ct.setTimeout(s,a)},xd=Lm(MD);function Om(s,a,u){var f=a+"";return xd(s,aI(f,yI(oI(f),u)))}function Lm(s){var a=0,u=0;return function(){var f=IR(),g=A-(f-u);if(u=f,g>0){if(++a>=Q)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 _=id(u,g),N=s[_];s[_]=s[u],s[u]=N}return s.length=a,s}var Mm=pI(function(s){var a=[];return s.charCodeAt(0)===46&&a.push(""),s.replace(sP,function(u,f,g,_){a.push(g?_.replace(fP,"$1"):f||u)}),a});function jn(s){if(typeof s=="string"||Qt(s))return s;var a=s+"";return a=="0"&&1/s==-W?"-0":a}function so(s){if(s!=null){try{return ua.call(s)}catch{}try{return s+""}catch{}}return""}function yI(s,a){return rn(ht,function(u){var f="_."+u[0];a&u[1]&&!sa(s,f)&&s.push(f)}),s.sort()}function Gm(s){if(s instanceof Oe)return s.clone();var a=new sn(s.__wrapped__,s.__chain__);return a.__actions__=Mt(s.__actions__),a.__index__=s.__index__,a.__values__=s.__values__,a}function vI(s,a,u){(u?It(s,a,u):a===n)?a=1:a=mt(Be(a),0);var f=s==null?0:s.length;if(!f||a<1)return[];for(var g=0,_=0,N=U(va(f/a));g<f;)N[_++]=ln(s,g,g+=a);return N}function _I(s){for(var a=-1,u=s==null?0:s.length,f=0,g=[];++a<u;){var _=s[a];_&&(g[f++]=_)}return g}function CI(){var s=arguments.length;if(!s)return[];for(var a=U(s-1),u=arguments[0],f=s;f--;)a[f-1]=arguments[f];return Ar(Ne(u)?Mt(u):[u],wt(a,1))}var wI=Ie(function(s,a){return at(s)?os(s,wt(a,1,at,!0)):[]}),bI=Ie(function(s,a){var u=cn(a);return at(u)&&(u=n),at(s)?os(s,wt(a,1,at,!0),ge(u,2)):[]}),xI=Ie(function(s,a){var u=cn(a);return at(u)&&(u=n),at(s)?os(s,wt(a,1,at,!0),n,u):[]});function kI(s,a,u){var f=s==null?0:s.length;return f?(a=u||a===n?1:Be(a),ln(s,a<0?0:a,f)):[]}function SI(s,a,u){var f=s==null?0:s.length;return f?(a=u||a===n?1:Be(a),a=f-a,ln(s,0,a<0?0:a)):[]}function EI(s,a){return s&&s.length?Na(s,ge(a,3),!0,!0):[]}function TI(s,a){return s&&s.length?Na(s,ge(a,3),!0):[]}function NI(s,a,u,f){var g=s==null?0:s.length;return g?(u&&typeof u!="number"&&It(s,a,u)&&(u=0,f=g),CD(s,a,u,f)):[]}function $m(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=mt(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?mt(f+g,0):Tt(g,f-1)),aa(s,ge(a,3),g,!0)}function Um(s){var a=s==null?0:s.length;return a?wt(s,1):[]}function AI(s){var a=s==null?0:s.length;return a?wt(s,W):[]}function VI(s,a){var u=s==null?0:s.length;return u?(a=a===n?1:Be(a),wt(s,a)):[]}function BI(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 Zm(s){return s&&s.length?s[0]:n}function PI(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=mt(f+g,0)),Oo(s,a,g)}function RI(s){var a=s==null?0:s.length;return a?ln(s,0,-1):[]}var DI=Ie(function(s){var a=tt(s,dd);return a.length&&a[0]===s[0]?ed(a):[]}),II=Ie(function(s){var a=cn(s),u=tt(s,dd);return a===cn(u)?a=n:u.pop(),u.length&&u[0]===s[0]?ed(u,ge(a,2)):[]}),FI=Ie(function(s){var a=cn(s),u=tt(s,dd);return a=typeof a=="function"?a:n,a&&u.pop(),u.length&&u[0]===s[0]?ed(u,n,a):[]});function OI(s,a){return s==null?"":RR.call(s,a)}function cn(s){var a=s==null?0:s.length;return a?s[a-1]:n}function LI(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?mt(f+g,0):Tt(g,f-1)),a===a?yR(s,a,g):aa(s,kf,g,!0)}function MI(s,a){return s&&s.length?tm(s,Be(a)):n}var GI=Ie(Wm);function Wm(s,a){return s&&s.length&&a&&a.length?od(s,a):s}function $I(s,a,u){return s&&s.length&&a&&a.length?od(s,a,ge(u,2)):s}function zI(s,a,u){return s&&s.length&&a&&a.length?od(s,a,n,u):s}var UI=or(function(s,a){var u=s==null?0:s.length,f=Xc(s,a);return om(s,tt(a,function(g){return ir(g,u)?+g:g}).sort(fm)),f});function ZI(s,a){var u=[];if(!(s&&s.length))return u;var f=-1,g=[],_=s.length;for(a=ge(a,3);++f<_;){var N=s[f];a(N,f,s)&&(u.push(N),g.push(f))}return om(s,g),u}function kd(s){return s==null?s:OR.call(s)}function WI(s,a,u){var f=s==null?0:s.length;return f?(u&&typeof u!="number"&&It(s,a,u)?(a=0,u=f):(a=a==null?0:Be(a),u=u===n?f:Be(u)),ln(s,a,u)):[]}function jI(s,a){return Ta(s,a)}function HI(s,a,u){return ad(s,a,ge(u,2))}function qI(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 KI(s,a){return Ta(s,a,!0)}function XI(s,a,u){return ad(s,a,ge(u,2),!0)}function YI(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 JI(s){return s&&s.length?sm(s):[]}function QI(s,a){return s&&s.length?sm(s,ge(a,2)):[]}function eF(s){var a=s==null?0:s.length;return a?ln(s,1,a):[]}function tF(s,a,u){return s&&s.length?(a=u||a===n?1:Be(a),ln(s,0,a<0?0:a)):[]}function nF(s,a,u){var f=s==null?0:s.length;return f?(a=u||a===n?1:Be(a),a=f-a,ln(s,a<0?0:a,f)):[]}function rF(s,a){return s&&s.length?Na(s,ge(a,3),!1,!0):[]}function oF(s,a){return s&&s.length?Na(s,ge(a,3)):[]}var iF=Ie(function(s){return Rr(wt(s,1,at,!0))}),sF=Ie(function(s){var a=cn(s);return at(a)&&(a=n),Rr(wt(s,1,at,!0),ge(a,2))}),aF=Ie(function(s){var a=cn(s);return a=typeof a=="function"?a:n,Rr(wt(s,1,at,!0),n,a)});function lF(s){return s&&s.length?Rr(s):[]}function cF(s,a){return s&&s.length?Rr(s,ge(a,2)):[]}function dF(s,a){return a=typeof a=="function"?a:n,s&&s.length?Rr(s,n,a):[]}function Sd(s){if(!(s&&s.length))return[];var a=0;return s=Nr(s,function(u){if(at(u))return a=mt(u.length,a),!0}),zc(a,function(u){return tt(s,Mc(u))})}function jm(s,a){if(!(s&&s.length))return[];var u=Sd(s);return a==null?u:tt(u,function(f){return Xt(a,n,f)})}var uF=Ie(function(s,a){return at(s)?os(s,a):[]}),pF=Ie(function(s){return cd(Nr(s,at))}),hF=Ie(function(s){var a=cn(s);return at(a)&&(a=n),cd(Nr(s,at),ge(a,2))}),fF=Ie(function(s){var a=cn(s);return a=typeof a=="function"?a:n,cd(Nr(s,at),n,a)}),mF=Ie(Sd);function gF(s,a){return dm(s||[],a||[],rs)}function yF(s,a){return dm(s||[],a||[],as)}var vF=Ie(function(s){var a=s.length,u=a>1?s[a-1]:n;return u=typeof u=="function"?(s.pop(),u):n,jm(s,u)});function Hm(s){var a=v(s);return a.__chain__=!0,a}function _F(s,a){return a(s),s}function Oa(s,a){return a(s)}var CF=or(function(s){var a=s.length,u=a?s[0]:0,f=this.__wrapped__,g=function(_){return Xc(_,s)};return a>1||this.__actions__.length||!(f instanceof Oe)||!ir(u)?this.thru(g):(f=f.slice(u,+u+(a?1:0)),f.__actions__.push({func:Oa,args:[g],thisArg:n}),new sn(f,this.__chain__).thru(function(_){return a&&!_.length&&_.push(n),_}))});function wF(){return Hm(this)}function bF(){return new sn(this.value(),this.__chain__)}function xF(){this.__values__===n&&(this.__values__=ag(this.value()));var s=this.__index__>=this.__values__.length,a=s?n:this.__values__[this.__index__++];return{done:s,value:a}}function kF(){return this}function SF(s){for(var a,u=this;u instanceof ba;){var f=Gm(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 EF(){var s=this.__wrapped__;if(s instanceof Oe){var a=s;return this.__actions__.length&&(a=new Oe(this)),a=a.reverse(),a.__actions__.push({func:Oa,args:[kd],thisArg:n}),new sn(a,this.__chain__)}return this.thru(kd)}function TF(){return cm(this.__wrapped__,this.__actions__)}var NF=Aa(function(s,a,u){qe.call(s,u)?++s[u]:nr(s,u,1)});function AF(s,a,u){var f=Ne(s)?bf:_D;return u&&It(s,a,u)&&(a=n),f(s,ge(a,3))}function VF(s,a){var u=Ne(s)?Nr:jf;return u(s,ge(a,3))}var BF=Cm($m),PF=Cm(zm);function RF(s,a){return wt(La(s,a),1)}function DF(s,a){return wt(La(s,a),W)}function IF(s,a,u){return u=u===n?1:Be(u),wt(La(s,a),u)}function qm(s,a){var u=Ne(s)?rn:Pr;return u(s,ge(a,3))}function Km(s,a){var u=Ne(s)?eR:Wf;return u(s,ge(a,3))}var FF=Aa(function(s,a,u){qe.call(s,u)?s[u].push(a):nr(s,u,[a])});function OF(s,a,u,f){s=Gt(s)?s:Ko(s),u=u&&!f?Be(u):0;var g=s.length;return u<0&&(u=mt(g+u,0)),Ua(s)?u<=g&&s.indexOf(a,u)>-1:!!g&&Oo(s,a,u)>-1}var LF=Ie(function(s,a,u){var f=-1,g=typeof a=="function",_=Gt(s)?U(s.length):[];return Pr(s,function(N){_[++f]=g?Xt(a,N,u):is(N,a,u)}),_}),MF=Aa(function(s,a,u){nr(s,u,a)});function La(s,a){var u=Ne(s)?tt:Jf;return u(s,ge(a,3))}function GF(s,a,u,f){return s==null?[]:(Ne(a)||(a=a==null?[]:[a]),u=f?n:u,Ne(u)||(u=u==null?[]:[u]),nm(s,a,u))}var $F=Aa(function(s,a,u){s[u?0:1].push(a)},function(){return[[],[]]});function zF(s,a,u){var f=Ne(s)?Oc:Ef,g=arguments.length<3;return f(s,ge(a,4),u,g,Pr)}function UF(s,a,u){var f=Ne(s)?tR:Ef,g=arguments.length<3;return f(s,ge(a,4),u,g,Wf)}function ZF(s,a){var u=Ne(s)?Nr:jf;return u(s,$a(ge(a,3)))}function WF(s){var a=Ne(s)?$f:OD;return a(s)}function jF(s,a,u){(u?It(s,a,u):a===n)?a=1:a=Be(a);var f=Ne(s)?fD:LD;return f(s,a)}function HF(s){var a=Ne(s)?mD:GD;return a(s)}function qF(s){if(s==null)return 0;if(Gt(s))return Ua(s)?Mo(s):s.length;var a=Nt(s);return a==Nn||a==An?s.size:nd(s).length}function KF(s,a,u){var f=Ne(s)?Lc:$D;return u&&It(s,a,u)&&(a=n),f(s,ge(a,3))}var XF=Ie(function(s,a){if(s==null)return[];var u=a.length;return u>1&&It(s,a[0],a[1])?a=[]:u>2&&It(a[0],a[1],a[2])&&(a=[a[0]]),nm(s,wt(a,1),[])}),Ma=VR||function(){return Ct.Date.now()};function YF(s,a){if(typeof a!="function")throw new on(c);return s=Be(s),function(){if(--s<1)return a.apply(this,arguments)}}function Xm(s,a,u){return a=u?n:a,a=s&&a==null?s.length:a,rr(s,ne,n,n,n,n,a)}function Ym(s,a){var u;if(typeof a!="function")throw new on(c);return s=Be(s),function(){return--s>0&&(u=a.apply(this,arguments)),s<=1&&(a=n),u}}var Ed=Ie(function(s,a,u){var f=$;if(u.length){var g=Vr(u,Ho(Ed));f|=V}return rr(s,f,a,u,g)}),Jm=Ie(function(s,a,u){var f=$|b;if(u.length){var g=Vr(u,Ho(Jm));f|=V}return rr(a,f,s,u,g)});function Qm(s,a,u){a=u?n:a;var f=rr(s,F,n,n,n,n,n,a);return f.placeholder=Qm.placeholder,f}function eg(s,a,u){a=u?n:a;var f=rr(s,D,n,n,n,n,n,a);return f.placeholder=eg.placeholder,f}function tg(s,a,u){var f,g,_,N,B,I,K=0,X=!1,Y=!1,ie=!0;if(typeof s!="function")throw new on(c);a=dn(a)||0,ot(u)&&(X=!!u.leading,Y="maxWait"in u,_=Y?mt(dn(u.maxWait)||0,a):_,ie="trailing"in u?!!u.trailing:ie);function he(lt){var Rn=f,lr=g;return f=g=n,K=lt,N=s.apply(lr,Rn),N}function ve(lt){return K=lt,B=ds(Fe,a),X?he(lt):N}function De(lt){var Rn=lt-I,lr=lt-K,Cg=a-Rn;return Y?Tt(Cg,_-lr):Cg}function _e(lt){var Rn=lt-I,lr=lt-K;return I===n||Rn>=a||Rn<0||Y&&lr>=_}function Fe(){var lt=Ma();if(_e(lt))return Le(lt);B=ds(Fe,De(lt))}function Le(lt){return B=n,ie&&f?he(lt):(f=g=n,N)}function en(){B!==n&&um(B),K=0,f=I=g=B=n}function Ft(){return B===n?N:Le(Ma())}function tn(){var lt=Ma(),Rn=_e(lt);if(f=arguments,g=this,I=lt,Rn){if(B===n)return ve(I);if(Y)return um(B),B=ds(Fe,a),he(I)}return B===n&&(B=ds(Fe,a)),N}return tn.cancel=en,tn.flush=Ft,tn}var JF=Ie(function(s,a){return Zf(s,1,a)}),QF=Ie(function(s,a,u){return Zf(s,dn(a)||0,u)});function eO(s){return rr(s,J)}function Ga(s,a){if(typeof s!="function"||a!=null&&typeof a!="function")throw new on(c);var u=function(){var f=arguments,g=a?a.apply(this,f):f[0],_=u.cache;if(_.has(g))return _.get(g);var N=s.apply(this,f);return u.cache=_.set(g,N)||_,N};return u.cache=new(Ga.Cache||tr),u}Ga.Cache=tr;function $a(s){if(typeof s!="function")throw new on(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 tO(s){return Ym(2,s)}var nO=zD(function(s,a){a=a.length==1&&Ne(a[0])?tt(a[0],Yt(ge())):tt(wt(a,1),Yt(ge()));var u=a.length;return Ie(function(f){for(var g=-1,_=Tt(f.length,u);++g<_;)f[g]=a[g].call(this,f[g]);return Xt(s,this,f)})}),Td=Ie(function(s,a){var u=Vr(a,Ho(Td));return rr(s,V,n,a,u)}),ng=Ie(function(s,a){var u=Vr(a,Ho(ng));return rr(s,Z,n,a,u)}),rO=or(function(s,a){return rr(s,H,n,n,n,a)});function oO(s,a){if(typeof s!="function")throw new on(c);return a=a===n?a:Be(a),Ie(s,a)}function iO(s,a){if(typeof s!="function")throw new on(c);return a=a==null?0:mt(Be(a),0),Ie(function(u){var f=u[a],g=Ir(u,0,a);return f&&Ar(g,f),Xt(s,this,g)})}function sO(s,a,u){var f=!0,g=!0;if(typeof s!="function")throw new on(c);return ot(u)&&(f="leading"in u?!!u.leading:f,g="trailing"in u?!!u.trailing:g),tg(s,a,{leading:f,maxWait:a,trailing:g})}function aO(s){return Xm(s,1)}function lO(s,a){return Td(ud(a),s)}function cO(){if(!arguments.length)return[];var s=arguments[0];return Ne(s)?s:[s]}function dO(s){return an(s,w)}function uO(s,a){return a=typeof a=="function"?a:n,an(s,w,a)}function pO(s){return an(s,y|w)}function hO(s,a){return a=typeof a=="function"?a:n,an(s,y|w,a)}function fO(s,a){return a==null||Uf(s,a,_t(a))}function Pn(s,a){return s===a||s!==s&&a!==a}var mO=Ra(Qc),gO=Ra(function(s,a){return s>=a}),ao=Kf(function(){return arguments}())?Kf:function(s){return it(s)&&qe.call(s,"callee")&&!If.call(s,"callee")},Ne=U.isArray,yO=gf?Yt(gf):SD;function Gt(s){return s!=null&&za(s.length)&&!sr(s)}function at(s){return it(s)&&Gt(s)}function vO(s){return s===!0||s===!1||it(s)&&Dt(s)==Zi}var Fr=PR||Ld,_O=yf?Yt(yf):ED;function CO(s){return it(s)&&s.nodeType===1&&!us(s)}function wO(s){if(s==null)return!0;if(Gt(s)&&(Ne(s)||typeof s=="string"||typeof s.splice=="function"||Fr(s)||qo(s)||ao(s)))return!s.length;var a=Nt(s);if(a==Nn||a==An)return!s.size;if(cs(s))return!nd(s).length;for(var u in s)if(qe.call(s,u))return!1;return!0}function bO(s,a){return ss(s,a)}function xO(s,a,u){u=typeof u=="function"?u:n;var f=u?u(s,a):n;return f===n?ss(s,a,n,u):!!f}function Nd(s){if(!it(s))return!1;var a=Dt(s);return a==ea||a==jB||typeof s.message=="string"&&typeof s.name=="string"&&!us(s)}function kO(s){return typeof s=="number"&&Of(s)}function sr(s){if(!ot(s))return!1;var a=Dt(s);return a==ta||a==Uh||a==WB||a==qB}function rg(s){return typeof s=="number"&&s==Be(s)}function za(s){return typeof s=="number"&&s>-1&&s%1==0&&s<=q}function ot(s){var a=typeof s;return s!=null&&(a=="object"||a=="function")}function it(s){return s!=null&&typeof s=="object"}var og=vf?Yt(vf):ND;function SO(s,a){return s===a||td(s,a,vd(a))}function EO(s,a,u){return u=typeof u=="function"?u:n,td(s,a,vd(a),u)}function TO(s){return ig(s)&&s!=+s}function NO(s){if(uI(s))throw new Te(l);return Xf(s)}function AO(s){return s===null}function VO(s){return s==null}function ig(s){return typeof s=="number"||it(s)&&Dt(s)==ji}function us(s){if(!it(s)||Dt(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)==ER}var Ad=_f?Yt(_f):AD;function BO(s){return rg(s)&&s>=-q&&s<=q}var sg=Cf?Yt(Cf):VD;function Ua(s){return typeof s=="string"||!Ne(s)&&it(s)&&Dt(s)==qi}function Qt(s){return typeof s=="symbol"||it(s)&&Dt(s)==na}var qo=wf?Yt(wf):BD;function PO(s){return s===n}function RO(s){return it(s)&&Nt(s)==Ki}function DO(s){return it(s)&&Dt(s)==XB}var IO=Ra(rd),FO=Ra(function(s,a){return s<=a});function ag(s){if(!s)return[];if(Gt(s))return Ua(s)?Vn(s):Mt(s);if(Ji&&s[Ji])return fR(s[Ji]());var a=Nt(s),u=a==Nn?Zc:a==An?la:Ko;return u(s)}function ar(s){if(!s)return s===0?s:0;if(s=dn(s),s===W||s===-W){var a=s<0?-1:1;return a*re}return s===s?s:0}function Be(s){var a=ar(s),u=a%1;return a===a?u?a-u:a:0}function lg(s){return s?ro(Be(s),0,ke):0}function dn(s){if(typeof s=="number")return s;if(Qt(s))return ue;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=Tf(s);var u=yP.test(s);return u||_P.test(s)?YP(s.slice(2),u?2:8):gP.test(s)?ue:+s}function cg(s){return Wn(s,$t(s))}function OO(s){return s?ro(Be(s),-q,q):s===0?s:0}function He(s){return s==null?"":Jt(s)}var LO=Wo(function(s,a){if(cs(a)||Gt(a)){Wn(a,_t(a),s);return}for(var u in a)qe.call(a,u)&&rs(s,u,a[u])}),dg=Wo(function(s,a){Wn(a,$t(a),s)}),Za=Wo(function(s,a,u,f){Wn(a,$t(a),s,f)}),MO=Wo(function(s,a,u,f){Wn(a,_t(a),s,f)}),GO=or(Xc);function $O(s,a){var u=Zo(s);return a==null?u:zf(u,a)}var zO=Ie(function(s,a){s=Xe(s);var u=-1,f=a.length,g=f>2?a[2]:n;for(g&&It(a[0],a[1],g)&&(f=1);++u<f;)for(var _=a[u],N=$t(_),B=-1,I=N.length;++B<I;){var K=N[B],X=s[K];(X===n||Pn(X,$o[K])&&!qe.call(s,K))&&(s[K]=_[K])}return s}),UO=Ie(function(s){return s.push(n,Tm),Xt(ug,n,s)});function ZO(s,a){return xf(s,ge(a,3),Zn)}function WO(s,a){return xf(s,ge(a,3),Jc)}function jO(s,a){return s==null?s:Yc(s,ge(a,3),$t)}function HO(s,a){return s==null?s:Hf(s,ge(a,3),$t)}function qO(s,a){return s&&Zn(s,ge(a,3))}function KO(s,a){return s&&Jc(s,ge(a,3))}function XO(s){return s==null?[]:Sa(s,_t(s))}function YO(s){return s==null?[]:Sa(s,$t(s))}function Vd(s,a,u){var f=s==null?n:oo(s,a);return f===n?u:f}function JO(s,a){return s!=null&&Vm(s,a,wD)}function Bd(s,a){return s!=null&&Vm(s,a,bD)}var QO=bm(function(s,a,u){a!=null&&typeof a.toString!="function"&&(a=pa.call(a)),s[a]=u},Rd(zt)),eL=bm(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),tL=Ie(is);function _t(s){return Gt(s)?Gf(s):nd(s)}function $t(s){return Gt(s)?Gf(s,!0):PD(s)}function nL(s,a){var u={};return a=ge(a,3),Zn(s,function(f,g,_){nr(u,a(f,g,_),f)}),u}function rL(s,a){var u={};return a=ge(a,3),Zn(s,function(f,g,_){nr(u,g,a(f,g,_))}),u}var oL=Wo(function(s,a,u){Ea(s,a,u)}),ug=Wo(function(s,a,u,f){Ea(s,a,u,f)}),iL=or(function(s,a){var u={};if(s==null)return u;var f=!1;a=tt(a,function(_){return _=Dr(_,s),f||(f=_.length>1),_}),Wn(s,gd(s),u),f&&(u=an(u,y|x|w,QD));for(var g=a.length;g--;)ld(u,a[g]);return u});function sL(s,a){return pg(s,$a(ge(a)))}var aL=or(function(s,a){return s==null?{}:DD(s,a)});function pg(s,a){if(s==null)return{};var u=tt(gd(s),function(f){return[f]});return a=ge(a),rm(s,u,function(f,g){return a(f,g[0])})}function lL(s,a,u){a=Dr(a,s);var f=-1,g=a.length;for(g||(g=1,s=n);++f<g;){var _=s==null?n:s[jn(a[f])];_===n&&(f=g,_=u),s=sr(_)?_.call(s):_}return s}function cL(s,a,u){return s==null?s:as(s,a,u)}function dL(s,a,u,f){return f=typeof f=="function"?f:n,s==null?s:as(s,a,u,f)}var hg=Sm(_t),fg=Sm($t);function uL(s,a,u){var f=Ne(s),g=f||Fr(s)||qo(s);if(a=ge(a,4),u==null){var _=s&&s.constructor;g?u=f?new _:[]:ot(s)?u=sr(_)?Zo(ma(s)):{}:u={}}return(g?rn:Zn)(s,function(N,B,I){return a(u,N,B,I)}),u}function pL(s,a){return s==null?!0:ld(s,a)}function hL(s,a,u){return s==null?s:lm(s,a,ud(u))}function fL(s,a,u,f){return f=typeof f=="function"?f:n,s==null?s:lm(s,a,ud(u),f)}function Ko(s){return s==null?[]:Uc(s,_t(s))}function mL(s){return s==null?[]:Uc(s,$t(s))}function gL(s,a,u){return u===n&&(u=a,a=n),u!==n&&(u=dn(u),u=u===u?u:0),a!==n&&(a=dn(a),a=a===a?a:0),ro(dn(s),a,u)}function yL(s,a,u){return a=ar(a),u===n?(u=a,a=0):u=ar(u),s=dn(s),xD(s,a,u)}function vL(s,a,u){if(u&&typeof u!="boolean"&&It(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=Lf();return Tt(s+g*(a-s+XP("1e-"+((g+"").length-1))),a)}return id(s,a)}var _L=jo(function(s,a,u){return a=a.toLowerCase(),s+(u?mg(a):a)});function mg(s){return Pd(He(s).toLowerCase())}function gg(s){return s=He(s),s&&s.replace(wP,cR).replace(GP,"")}function CL(s,a,u){s=He(s),a=Jt(a);var f=s.length;u=u===n?f:ro(Be(u),0,f);var g=u;return u-=a.length,u>=0&&s.slice(u,g)==a}function wL(s){return s=He(s),s&&tP.test(s)?s.replace(jh,dR):s}function bL(s){return s=He(s),s&&aP.test(s)?s.replace(Tc,"\\$&"):s}var xL=jo(function(s,a,u){return s+(u?"-":"")+a.toLowerCase()}),kL=jo(function(s,a,u){return s+(u?" ":"")+a.toLowerCase()}),SL=_m("toLowerCase");function EL(s,a,u){s=He(s),a=Be(a);var f=a?Mo(s):0;if(!a||f>=a)return s;var g=(a-f)/2;return Pa(_a(g),u)+s+Pa(va(g),u)}function TL(s,a,u){s=He(s),a=Be(a);var f=a?Mo(s):0;return a&&f<a?s+Pa(a-f,u):s}function NL(s,a,u){s=He(s),a=Be(a);var f=a?Mo(s):0;return a&&f<a?Pa(a-f,u)+s:s}function AL(s,a,u){return u||a==null?a=0:a&&(a=+a),FR(He(s).replace(Nc,""),a||0)}function VL(s,a,u){return(u?It(s,a,u):a===n)?a=1:a=Be(a),sd(He(s),a)}function BL(){var s=arguments,a=He(s[0]);return s.length<3?a:a.replace(s[1],s[2])}var PL=jo(function(s,a,u){return s+(u?"_":"")+a.toLowerCase()});function RL(s,a,u){return u&&typeof u!="number"&&It(s,a,u)&&(a=u=n),u=u===n?ke:u>>>0,u?(s=He(s),s&&(typeof a=="string"||a!=null&&!Ad(a))&&(a=Jt(a),!a&&Lo(s))?Ir(Vn(s),0,u):s.split(a,u)):[]}var DL=jo(function(s,a,u){return s+(u?" ":"")+Pd(a)});function IL(s,a,u){return s=He(s),u=u==null?0:ro(Be(u),0,s.length),a=Jt(a),s.slice(u,u+a.length)==a}function FL(s,a,u){var f=v.templateSettings;u&&It(s,a,u)&&(a=n),s=He(s),a=Za({},a,f,Em);var g=Za({},a.imports,f.imports,Em),_=_t(g),N=Uc(g,_),B,I,K=0,X=a.interpolate||ra,Y="__p += '",ie=Wc((a.escape||ra).source+"|"+X.source+"|"+(X===Hh?mP:ra).source+"|"+(a.evaluate||ra).source+"|$","g"),he="//# sourceURL="+(qe.call(a,"sourceURL")?(a.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++WP+"]")+`
75
+ `;s.replace(ie,function(_e,Fe,Le,en,Ft,tn){return Le||(Le=en),Y+=s.slice(K,tn).replace(bP,uR),Fe&&(B=!0,Y+=`' +
76
+ __e(`+Fe+`) +
77
+ '`),Ft&&(I=!0,Y+=`';
78
+ `+Ft+`;
79
+ __p += '`),Le&&(Y+=`' +
80
+ ((__t = (`+Le+`)) == null ? '' : __t) +
81
+ '`),K=tn+_e.length,_e}),Y+=`';
82
+ `;var ve=qe.call(a,"variable")&&a.variable;if(!ve)Y=`with (obj) {
83
83
  `+Y+`
84
84
  }
85
- `;else if(hV.test(ge))throw new xe(u);Y=(D?Y.replace(JB,""):Y).replace(XB,"$1").replace(QB,"$1;"),Y="function("+(ge||"obj")+`) {
86
- `+(ge?"":`obj || (obj = {});
87
- `)+"var __t, __p = ''"+(B?", __e = _.escape":"")+(D?`, __j = Array.prototype.join;
85
+ `;else if(hP.test(ve))throw new Te(d);Y=(I?Y.replace(YB,""):Y).replace(JB,"$1").replace(QB,"$1;"),Y="function("+(ve||"obj")+`) {
86
+ `+(ve?"":`obj || (obj = {});
87
+ `)+"var __t, __p = ''"+(B?", __e = _.escape":"")+(I?`, __j = Array.prototype.join;
88
88
  function print() { __p += __j.call(arguments, '') }
89
89
  `:`;
90
90
  `)+Y+`return __p
91
- }`;var Ne=um(function(){return ze(C,de+"return "+Y).apply(n,k)});if(Ne.source=Y,Jc(Ne))throw Ne;return Ne}function IR(i){return Ze(i).toLowerCase()}function OR(i){return Ze(i).toUpperCase()}function LR(i,a,d){if(i=Ze(i),i&&(d||a===n))return Ch(i);if(!i||!(a=jt(a)))return i;var h=xn(i),g=xn(a),C=vh(h,g),k=wh(h,g)+1;return Tr(h,C,k).join("")}function GR(i,a,d){if(i=Ze(i),i&&(d||a===n))return i.slice(0,xh(i)+1);if(!i||!(a=jt(a)))return i;var h=xn(i),g=wh(h,xn(a))+1;return Tr(h,0,g).join("")}function zR(i,a,d){if(i=Ze(i),i&&(d||a===n))return i.replace(Jl,"");if(!i||!(a=jt(a)))return i;var h=xn(i),g=vh(h,xn(a));return Tr(h,g).join("")}function $R(i,a){var d=W,h=J;if(et(a)){var g="separator"in a?a.separator:g;d="length"in a?Te(a.length):d,h="omission"in a?jt(a.omission):h}i=Ze(i);var C=i.length;if(No(i)){var k=xn(i);C=k.length}if(d>=C)return i;var B=d-Ao(h);if(B<1)return h;var D=k?Tr(k,0,B).join(""):i.slice(0,B);if(g===n)return D+h;if(k&&(B+=D.length-B),Xc(g)){if(i.slice(B).search(g)){var q,K=D;for(g.global||(g=fc(g.source,Ze(zp.exec(g))+"g")),g.lastIndex=0;q=g.exec(K);)var Y=q.index;D=D.slice(0,Y===n?B:Y)}}else if(i.indexOf(jt(g),B)!=B){var te=D.lastIndexOf(g);te>-1&&(D=D.slice(0,te))}return D+h}function ZR(i){return i=Ze(i),i&&eV.test(i)?i.replace(Op,_N):i}var UR=Oo(function(i,a,d){return i+(d?" ":"")+a.toUpperCase()}),td=pf("toUpperCase");function dm(i,a,d){return i=Ze(i),a=d?n:a,a===n?hN(i)?wN(i):oN(i):i.match(a)||[]}var um=Ae(function(i,a){try{return Wt(i,n,a)}catch(d){return Jc(d)?d:new xe(d)}}),WR=Kn(function(i,a){return Xt(a,function(d){d=On(d),jn(i,d,Kc(i[d],i))}),i});function HR(i){var a=i==null?0:i.length,d=fe();return i=a?Je(i,function(h){if(typeof h[1]!="function")throw new Qt(c);return[d(h[0]),h[1]]}):[],Ae(function(h){for(var g=-1;++g<a;){var C=i[g];if(Wt(C[0],this,h))return Wt(C[1],this,h)}})}function jR(i){return _A(tn(i,_))}function nd(i){return function(){return i}}function qR(i,a){return i==null||i!==i?a:i}var KR=ff(),YR=ff(!0);function It(i){return i}function rd(i){return Zh(typeof i=="function"?i:tn(i,_))}function JR(i){return Wh(tn(i,_))}function XR(i,a){return Hh(i,tn(a,_))}var QR=Ae(function(i,a){return function(d){return Yi(d,i,a)}}),eM=Ae(function(i,a){return function(d){return Yi(i,d,a)}});function od(i,a,d){var h=mt(a),g=la(a,h);d==null&&!(et(a)&&(g.length||!h.length))&&(d=a,a=i,i=this,g=la(a,mt(a)));var C=!(et(d)&&"chain"in d)||!!d.chain,k=Jn(i);return Xt(g,function(B){var D=a[B];i[B]=D,k&&(i.prototype[B]=function(){var q=this.__chain__;if(C||q){var K=i(this.__wrapped__),Y=K.__actions__=Ft(this.__actions__);return Y.push({func:D,args:arguments,thisArg:i}),K.__chain__=q,K}return D.apply(i,wr([this.value()],arguments))})}),i}function tM(){return gt._===this&&(gt._=TN),this}function id(){}function nM(i){return i=Te(i),Ae(function(a){return jh(a,i)})}var rM=Mc(Je),oM=Mc(fh),iM=Mc(ac);function pm(i){return Zc(i)?lc(On(i)):RA(i)}function sM(i){return function(a){return i==null?n:Jr(i,a)}}var aM=gf(),lM=gf(!0);function sd(){return[]}function ad(){return!1}function cM(){return{}}function dM(){return""}function uM(){return!0}function pM(i,a){if(i=Te(i),i<1||i>ae)return[];var d=ft,h=xt(i,ft);a=fe(a),i-=ft;for(var g=uc(h,a);++d<i;)a(d);return g}function hM(i){return ke(i)?Je(i,On):qt(i)?[i]:Ft(Pf(Ze(i)))}function fM(i){var a=++SN;return Ze(i)+a}var mM=fa(function(i,a){return i+a},0),gM=Ic("ceil"),yM=fa(function(i,a){return i/a},1),_M=Ic("floor");function CM(i){return i&&i.length?aa(i,It,bc):n}function vM(i,a){return i&&i.length?aa(i,fe(a,2),bc):n}function wM(i){return yh(i,It)}function bM(i,a){return yh(i,fe(a,2))}function xM(i){return i&&i.length?aa(i,It,Ec):n}function kM(i,a){return i&&i.length?aa(i,fe(a,2),Ec):n}var SM=fa(function(i,a){return i*a},1),EM=Ic("round"),TM=fa(function(i,a){return i-a},0);function BM(i){return i&&i.length?dc(i,It):0}function VM(i,a){return i&&i.length?dc(i,fe(a,2)):0}return y.after=JD,y.ary=Zf,y.assign=OF,y.assignIn=rm,y.assignInWith=Ta,y.assignWith=LF,y.at=GF,y.before=Uf,y.bind=Kc,y.bindAll=WR,y.bindKey=Wf,y.castArray=cF,y.chain=Gf,y.chunk=_P,y.compact=CP,y.concat=vP,y.cond=HR,y.conforms=jR,y.constant=nd,y.countBy=BD,y.create=zF,y.curry=Hf,y.curryRight=jf,y.debounce=qf,y.defaults=$F,y.defaultsDeep=ZF,y.defer=XD,y.delay=QD,y.difference=wP,y.differenceBy=bP,y.differenceWith=xP,y.drop=kP,y.dropRight=SP,y.dropRightWhile=EP,y.dropWhile=TP,y.fill=BP,y.filter=ND,y.flatMap=DD,y.flatMapDeep=FD,y.flatMapDepth=RD,y.flatten=Mf,y.flattenDeep=VP,y.flattenDepth=NP,y.flip=eF,y.flow=KR,y.flowRight=YR,y.fromPairs=AP,y.functions=YF,y.functionsIn=JF,y.groupBy=MD,y.initial=DP,y.intersection=FP,y.intersectionBy=RP,y.intersectionWith=MP,y.invert=QF,y.invertBy=eR,y.invokeMap=OD,y.iteratee=rd,y.keyBy=LD,y.keys=mt,y.keysIn=Mt,y.map=wa,y.mapKeys=nR,y.mapValues=rR,y.matches=JR,y.matchesProperty=XR,y.memoize=xa,y.merge=oR,y.mergeWith=om,y.method=QR,y.methodOf=eM,y.mixin=od,y.negate=ka,y.nthArg=nM,y.omit=iR,y.omitBy=sR,y.once=tF,y.orderBy=GD,y.over=rM,y.overArgs=nF,y.overEvery=oM,y.overSome=iM,y.partial=Yc,y.partialRight=Kf,y.partition=zD,y.pick=aR,y.pickBy=im,y.property=pm,y.propertyOf=sM,y.pull=GP,y.pullAll=Of,y.pullAllBy=zP,y.pullAllWith=$P,y.pullAt=ZP,y.range=aM,y.rangeRight=lM,y.rearg=rF,y.reject=UD,y.remove=UP,y.rest=oF,y.reverse=jc,y.sampleSize=HD,y.set=cR,y.setWith=dR,y.shuffle=jD,y.slice=WP,y.sortBy=YD,y.sortedUniq=XP,y.sortedUniqBy=QP,y.split=DR,y.spread=iF,y.tail=eD,y.take=tD,y.takeRight=nD,y.takeRightWhile=rD,y.takeWhile=oD,y.tap=CD,y.throttle=sF,y.thru=va,y.toArray=em,y.toPairs=sm,y.toPairsIn=am,y.toPath=hM,y.toPlainObject=nm,y.transform=uR,y.unary=aF,y.union=iD,y.unionBy=sD,y.unionWith=aD,y.uniq=lD,y.uniqBy=cD,y.uniqWith=dD,y.unset=pR,y.unzip=qc,y.unzipWith=Lf,y.update=hR,y.updateWith=fR,y.values=zo,y.valuesIn=mR,y.without=uD,y.words=dm,y.wrap=lF,y.xor=pD,y.xorBy=hD,y.xorWith=fD,y.zip=mD,y.zipObject=gD,y.zipObjectDeep=yD,y.zipWith=_D,y.entries=sm,y.entriesIn=am,y.extend=rm,y.extendWith=Ta,od(y,y),y.add=mM,y.attempt=um,y.camelCase=CR,y.capitalize=lm,y.ceil=gM,y.clamp=gR,y.clone=dF,y.cloneDeep=pF,y.cloneDeepWith=hF,y.cloneWith=uF,y.conformsTo=fF,y.deburr=cm,y.defaultTo=qR,y.divide=yM,y.endsWith=vR,y.eq=Sn,y.escape=wR,y.escapeRegExp=bR,y.every=VD,y.find=AD,y.findIndex=Ff,y.findKey=UF,y.findLast=PD,y.findLastIndex=Rf,y.findLastKey=WF,y.floor=_M,y.forEach=zf,y.forEachRight=$f,y.forIn=HF,y.forInRight=jF,y.forOwn=qF,y.forOwnRight=KF,y.get=Qc,y.gt=mF,y.gte=gF,y.has=XF,y.hasIn=ed,y.head=If,y.identity=It,y.includes=ID,y.indexOf=PP,y.inRange=yR,y.invoke=tR,y.isArguments=eo,y.isArray=ke,y.isArrayBuffer=yF,y.isArrayLike=Rt,y.isArrayLikeObject=rt,y.isBoolean=_F,y.isBuffer=Br,y.isDate=CF,y.isElement=vF,y.isEmpty=wF,y.isEqual=bF,y.isEqualWith=xF,y.isError=Jc,y.isFinite=kF,y.isFunction=Jn,y.isInteger=Yf,y.isLength=Sa,y.isMap=Jf,y.isMatch=SF,y.isMatchWith=EF,y.isNaN=TF,y.isNative=BF,y.isNil=NF,y.isNull=VF,y.isNumber=Xf,y.isObject=et,y.isObjectLike=tt,y.isPlainObject=ns,y.isRegExp=Xc,y.isSafeInteger=AF,y.isSet=Qf,y.isString=Ea,y.isSymbol=qt,y.isTypedArray=Go,y.isUndefined=PF,y.isWeakMap=DF,y.isWeakSet=FF,y.join=IP,y.kebabCase=xR,y.last=rn,y.lastIndexOf=OP,y.lowerCase=kR,y.lowerFirst=SR,y.lt=RF,y.lte=MF,y.max=CM,y.maxBy=vM,y.mean=wM,y.meanBy=bM,y.min=xM,y.minBy=kM,y.stubArray=sd,y.stubFalse=ad,y.stubObject=cM,y.stubString=dM,y.stubTrue=uM,y.multiply=SM,y.nth=LP,y.noConflict=tM,y.noop=id,y.now=ba,y.pad=ER,y.padEnd=TR,y.padStart=BR,y.parseInt=VR,y.random=_R,y.reduce=$D,y.reduceRight=ZD,y.repeat=NR,y.replace=AR,y.result=lR,y.round=EM,y.runInContext=A,y.sample=WD,y.size=qD,y.snakeCase=PR,y.some=KD,y.sortedIndex=HP,y.sortedIndexBy=jP,y.sortedIndexOf=qP,y.sortedLastIndex=KP,y.sortedLastIndexBy=YP,y.sortedLastIndexOf=JP,y.startCase=FR,y.startsWith=RR,y.subtract=TM,y.sum=BM,y.sumBy=VM,y.template=MR,y.times=pM,y.toFinite=Xn,y.toInteger=Te,y.toLength=tm,y.toLower=IR,y.toNumber=on,y.toSafeInteger=IF,y.toString=Ze,y.toUpper=OR,y.trim=LR,y.trimEnd=GR,y.trimStart=zR,y.truncate=$R,y.unescape=ZR,y.uniqueId=fM,y.upperCase=UR,y.upperFirst=td,y.each=zf,y.eachRight=$f,y.first=If,od(y,function(){var i={};return Mn(y,function(a,d){Ue.call(y.prototype,d)||(i[d]=a)}),i}(),{chain:!1}),y.VERSION=o,Xt(["bind","bindKey","curry","curryRight","partial","partialRight"],function(i){y[i].placeholder=y}),Xt(["drop","take"],function(i,a){De.prototype[i]=function(d){d=d===n?1:dt(Te(d),0);var h=this.__filtered__&&!a?new De(this):this.clone();return h.__filtered__?h.__takeCount__=xt(d,h.__takeCount__):h.__views__.push({size:xt(d,ft),type:i+(h.__dir__<0?"Right":"")}),h},De.prototype[i+"Right"]=function(d){return this.reverse()[i](d).reverse()}}),Xt(["filter","map","takeWhile"],function(i,a){var d=a+1,h=d==E||d==j;De.prototype[i]=function(g){var C=this.clone();return C.__iteratees__.push({iteratee:fe(g,3),type:d}),C.__filtered__=C.__filtered__||h,C}}),Xt(["head","last"],function(i,a){var d="take"+(a?"Right":"");De.prototype[i]=function(){return this[d](1).value()[0]}}),Xt(["initial","tail"],function(i,a){var d="drop"+(a?"":"Right");De.prototype[i]=function(){return this.__filtered__?new De(this):this[d](1)}}),De.prototype.compact=function(){return this.filter(It)},De.prototype.find=function(i){return this.filter(i).head()},De.prototype.findLast=function(i){return this.reverse().find(i)},De.prototype.invokeMap=Ae(function(i,a){return typeof i=="function"?new De(this):this.map(function(d){return Yi(d,i,a)})}),De.prototype.reject=function(i){return this.filter(ka(fe(i)))},De.prototype.slice=function(i,a){i=Te(i);var d=this;return d.__filtered__&&(i>0||a<0)?new De(d):(i<0?d=d.takeRight(-i):i&&(d=d.drop(i)),a!==n&&(a=Te(a),d=a<0?d.dropRight(-a):d.take(a-i)),d)},De.prototype.takeRightWhile=function(i){return this.reverse().takeWhile(i).reverse()},De.prototype.toArray=function(){return this.take(ft)},Mn(De.prototype,function(i,a){var d=/^(?:filter|find|map|reject)|While$/.test(a),h=/^(?:head|last)$/.test(a),g=y[h?"take"+(a=="last"?"Right":""):a],C=h||/^find/.test(a);g&&(y.prototype[a]=function(){var k=this.__wrapped__,B=h?[1]:arguments,D=k instanceof De,q=B[0],K=D||ke(k),Y=function(Pe){var Re=g.apply(y,wr([Pe],B));return h&&te?Re[0]:Re};K&&d&&typeof q=="function"&&q.length!=1&&(D=K=!1);var te=this.__chain__,de=!!this.__actions__.length,ge=C&&!te,Ne=D&&!de;if(!C&&K){k=Ne?k:new De(this);var ye=i.apply(k,B);return ye.__actions__.push({func:va,args:[Y],thisArg:n}),new en(ye,te)}return ge&&Ne?i.apply(this,B):(ye=this.thru(Y),ge?h?ye.value()[0]:ye.value():ye)})}),Xt(["pop","push","shift","sort","splice","unshift"],function(i){var a=Hs[i],d=/^(?:push|sort|unshift)$/.test(i)?"tap":"thru",h=/^(?:pop|shift)$/.test(i);y.prototype[i]=function(){var g=arguments;if(h&&!this.__chain__){var C=this.value();return a.apply(ke(C)?C:[],g)}return this[d](function(k){return a.apply(ke(k)?k:[],g)})}}),Mn(De.prototype,function(i,a){var d=y[a];if(d){var h=d.name+"";Ue.call(Ro,h)||(Ro[h]=[]),Ro[h].push({name:a,func:d})}}),Ro[ha(n,v).name]=[{name:"wrapper",func:n}],De.prototype.clone=ZN,De.prototype.reverse=UN,De.prototype.value=WN,y.prototype.at=vD,y.prototype.chain=wD,y.prototype.commit=bD,y.prototype.next=xD,y.prototype.plant=SD,y.prototype.reverse=ED,y.prototype.toJSON=y.prototype.valueOf=y.prototype.value=TD,y.prototype.first=y.prototype.head,Zi&&(y.prototype[Zi]=kD),y},Po=bN();Hr?((Hr.exports=Po)._=Po,rc._=Po):gt._=Po}).call($o)}(Ps,Ps.exports);var Le=Ps.exports;const MT={class:"grid-overlay-container"},gp=r.defineComponent({__name:"PlAgOverlayLoading",props:{params:{}},setup(t){return(e,n)=>(r.openBlock(),r.createElementBlock("div",MT,[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))]))}}),IT={},OT={class:"grid-overlay-container"};function LT(t,e){return r.openBlock(),r.createElementBlock("div",OT,e[0]||(e[0]=[r.createElementVNode("div",{class:"grid-icon-sad-cat"},null,-1),r.createElementVNode("span",{class:"text-subtitle-m"},"Empty",-1)]))}const yp=Dl(IT,[["render",LT]]);async function GT(t,e){throw Error("not implemented")}function zT(t){return t.axesSpec.filter(e=>{var n;return((n=e.annotations)==null?void 0:n["pl7.app/axisNature"])==="heterogeneous"})}function $T(t,e){const n=[];for(const o of e)if(t[o].type==="column"){const s=zT(t[o].spec);for(const l of s){if(l.type!=="String"){console.warn("heterogeneous axis with string type expected, got",l,"skipping");continue}const c=Ha(l),u=t.findIndex(p=>Le.isEqual(p.id,c));if(u===-1)throw console.error("axis not found",o,c,t),Error("axis not found");n.push({columnIdx:o,axisIdx:u})}}return n}const _p=(t,e)=>(t+e).toString();function ZT(t,e,n,o,s,l){if(t.length>1)throw Error("hColumns.length > 1 is not supported");const c=t[0];let u=-1,p=-1;for(let _=0;_<l.length;++_)l[_]===c.axisIdx&&(u=_),l[_]===c.columnIdx&&(p=_);const f=(()=>{const x=o[u].data.filter(S=>S!==null);return Array.from(new Set(x))})();f.sort(),p>u?(n.splice(p,1),n.splice(u,1)):(n.splice(u,1),n.splice(p,1));const m=UT(s,o,u,p,f,e.rows);for(let _=0;_<f.length;++_){const x=f[_],S=Pr(x+"@"+_);n.push({colId:S,field:_p(o.length,_),headerName:x,valueFormatter:vp})}return{rowModelType:"clientSide",columnDefs:n,rowData:m}}function UT(t,e,n,o,s,l){const c=new Map;let u=0;for(let f=0;f<l;f++){const m={};for(let I=0;I<e.length;++I){if(I===n||I===o)continue;const G=t[I].toString();m[G]=e[I].data[f]}let _;const x=Pr(Object.values(m))??"";c.has(x)?_=c.get(x):(c.set(x,m),_=m,_.id=u.toString(),u++);const S=s.indexOf(e[n].data[f]);if(S===-1)throw Error("index not found");const V=_p(e.length,S);_[V]=e[o].data[f]}return Array.from(c.values())}function WT(t){return Pr(t)}function Cp(t){return JSON.parse(t)}const vp=t=>t?t.value===void 0?"NULL":t.value===null?"NA":t.value.toString():"ERROR";function HT(t,e,n){var s,l,c;const o=WT(e);return{colId:o,field:t.toString(),headerName:((l=(s=e.spec.annotations)==null?void 0:s["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:vp,cellDataType:(u=>{switch(u){case"Int":case"Long":case"Float":case"Double":return"number";case"String":case"Bytes":return"text";default:throw Error(`unsupported data type: ${u}`)}})(e.type==="axis"?e.spec.type:e.spec.valueType)}}function wp(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 bp(t){const e=[];return hs(t,n=>(e.push(n),n)),e}async function jT(t,e,n){return n.length?(await t.findColumns(e,{columnFilter:{name:["pl7.app/label"]},compatibleWith:Le.uniqWith(n.map(s=>Md(s.spec.axesSpec).map(Le.cloneDeep)).flat(),Le.isEqual),strictlyCompatible:!0})).hits.filter(s=>s.spec.axesSpec.length===1):[]}async function qT(t,e,n){const o=bp(n),l=(await jT(t,e,o)).filter(c=>!Le.find(o,u=>c.columnId===u.columnId));return l.length===0?n:{type:"outer",primary:n,secondary:l.map(c=>({type:"column",column:c}))}}async function KT(t,e,n,o){const s=n.filter(m=>m.type!=="Bytes"),l=bp(o),c=s.map(m=>[]),u=s.map(m=>null);for(let m=0;m<l.length;++m){const _=Md(l[m].spec.axesSpec);for(let x=0;x<_.length;++x){const S=Le.findIndex(s,V=>Le.isEqual(V,_[x]));S===-1||u[S]||(_.length===1&&l[m].spec.name==="pl7.app/label"?(c[S]=[[m,x]],u[S]=l[m].columnId):c[S].push([m,x]))}}for(let m=s.length-1;m>=0;--m)c[m].length||(u.splice(m,1),c.splice(m,1),s.splice(m,1));const p=100,f=s.map(m=>new Set);e:for(let m=s.length-1;m>=0;--m){for(const[_,x]of c[m]){const S=await t.getUniqueValues(e,{columnId:l[_].columnId,...!u[m]&&{axis:Le.cloneDeep(s[m])},filters:[],limit:p});if(S.overflow){u.splice(m,1),c.splice(m,1),s.splice(m,1);continue e}const V=S.values.type;for(const I of S.values.data)if(!(Rd(I,V)||I===null)&&(f[m].add(wp(I,V)),f[m].size===p)){u.splice(m,1),c.splice(m,1),s.splice(m,1);continue e}}if(!f[m].size){u.splice(m,1),c.splice(m,1),s.splice(m,1);continue e}}return s.map((m,_)=>{const x=[...f[_]].map(V=>({value:V,label:V.toString()})),S=x[0].value;return{axis:Le.cloneDeep(m),...u[_]&&{column:u[_]},options:x,defaultValue:S}})}function YT(t,e,n,o){const s=t.length,l=[];for(let c=0;c<e[0].data.length;++c){const u=[],p=(o++).toString();for(const m of n)u.push(e[m].data[c]);const f={key:u,id:p};for(let m=0;m<s;++m){const _=t[m].toString(),x=e[m].data[c],S=e[m].type;Gg(e[m].absent,c)?f[_]=void 0:Rd(x,S)||x===null?f[_]=null:f[_]=wp(x,S)}l.push(f)}return l}const JT=t=>t.type==="column"&&t.spec.axesSpec.length===1&&t.spec.name==="pl7.app/label";async function XT(t,e,n,o){const s=await t.getSpec(e);let l=s.findIndex(v=>v.type==="column");l===-1&&(l=s.length);const c=[...s.keys()].filter(v=>!Le.find(n,R=>Le.isEqual(R.axis,s[v].id)||Le.isEqual(R.column,s[v].id))).sort((v,R)=>{var T,$;if(s[v].type!==s[R].type)return s[v].type==="axis"?-1:1;const L=(T=s[v].spec.annotations)==null?void 0:T["pl7.app/table/orderPriority"],F=($=s[R].spec.annotations)==null?void 0:$["pl7.app/table/orderPriority"];return L===void 0?F===void 0?0:1:F===void 0?-1:Number(F)-Number(L)}),u=Le.cloneDeep(c),p=$T(s,c);for(let v=c.length-1;v>=0;--v){const R=c[v];if(!JT(s[R]))continue;const L=Ha(s[R].spec.axesSpec[0]),F=Le.findIndex(c,T=>Le.isEqual(s[T].id,L));if(F===-1&&Le.findIndex(n,$=>Le.isEqual($.axis,L))===-1){console.warn(`added label column, but the axis is not in the data; axisId: ${L}`);continue}c[F]=R;for(const T of p)T.axisIdx===R&&(T.axisIdx=F);c.splice(v,1),u.splice(v,1)}const f=await t.getShape(e),m=f.rows,_=u.map(v=>HT(v,s[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 ZT(p,f,_,await t.getData(e,c),u,c);const x=[...c],S=new Map;for(let v=0;v<l;++v)S.set(v,-1);for(let v=0;v<x.length;++v){const R=x[v];S.has(R)&&S.set(R,v)}for(const[v,R]of S)R===-1&&(S.set(v,x.length),x.push(v));const V=[];for(let v=0;v<l;++v){const R=S.get(v);if(R===void 0||R===-1)throw new Error("assertion exception");V.push(R)}let I;return{rowModelType:"serverSide",columnDefs:_,serverSideDatasource:{getRows:async v=>{try{if(m==0){v.success({rowData:[],rowCount:m}),v.api.setGridOption("loading",!1),v.api.showNoRowsOverlay();return}if(I&&!Le.isEqual(I.request.sortModel,v.request.sortModel)){I=void 0,v.api.setGridOption("loading",!0),v.success({rowData:[],rowCount:0});return}I=v;let R=0,L=[];if(m>0&&v.request.startRow!==void 0&&v.request.endRow!==void 0&&(R=Math.min(m,v.request.endRow)-v.request.startRow,R>0)){const F=await t.getData(e,x,{offset:v.request.startRow,length:R});L=YT(u,F,V,v.request.startRow)}v.success({rowData:L,rowCount:m}),v.api.autoSizeAllColumns(),v.api.setGridOption("loading",!1)}catch(R){v.api.setGridOption("loading",!0),v.fail(),console.trace(R)}}}}}const Fl=Em(),QT=["onClick"],xp=r.defineComponent({__name:"PlAgGridColumnManager",props:{api:{}},setup(t){const e=t,{api:n}=r.toRefs(e),o=r.ref([]),s=r.ref(),l=r.ref(!1),c=r.ref(0);mp(s,{handle:".handle",onChange(p){n.value.moveColumns(p.map(f=>o.value[f]),0)}});function u(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,f)=>(r.openBlock(),r.createElementBlock("div",null,[(r.openBlock(),r.createBlock(r.Teleport,{to:`#${r.unref(Fl)}`},[r.createVNode(r.unref(po),{onClick:f[0]||(f[0]=r.withModifiers(m=>l.value=!l.value,["stop"]))},{append:r.withCtx(()=>[r.createVNode(r.unref(Dt),{name:"columns"})]),default:r.withCtx(()=>[f[2]||(f[2]=r.createTextVNode(" Columns "))]),_:1})],8,["to"])),r.createVNode(r.unref(ws),{modelValue:l.value,"onUpdate:modelValue":f[1]||(f[1]=m=>l.value=m),width:"368px","close-on-outside-click":""},{title:r.withCtx(()=>f[3]||(f[3]=[r.createTextVNode("Columns")])),default:r.withCtx(()=>[(r.openBlock(),r.createElementBlock("div",{ref_key:"listRef",ref:s,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(cn),{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:_=>u(m)},[r.createVNode(r.unref(Ct),{"close-delay":500,position:"top"},{tooltip:r.withCtx(()=>f[4]||(f[4]=[r.createTextVNode("Show/Hide")])),default:r.withCtx(()=>[r.createVNode(r.unref(Dt),{name:m.isVisible()?"view-show":"view-hide"},null,8,["name"])]),_:2},1024)],8,QT)]))),128))]))]),_:1},8,["modelValue"])]))}}),eB=["id"],tB=r.defineComponent({__name:"PlAgDataTableToolsPanel",setup(t){return(e,n)=>(r.openBlock(),r.createElementBlock("div",{id:r.unref(Fl),class:"d-flex gap-6"},[r.renderSlot(e.$slots,"default")],8,eB))}}),nB={class:"ap-ag-data-table-container"},rB={key:1,class:"ap-ag-data-table-sheets"},oB=Dl(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}){b.ModuleRegistry.registerModules([os.ClientSideRowModelModule,fd.ClipboardModule,hd.ServerSideRowModelModule,md.RangeSelectionModule,Ya,ou]);const o=r.useModel(t,"modelValue"),s=t,{settings:l}=r.toRefs(s),c=n;r.watch(()=>l.value,async(N,E)=>{if(N.sourceType!=="pframe"||!N.pFrame||!N.join||E&&E.sourceType==="pframe"&&Le.isEqual(N.pFrame,E.pFrame)&&Le.isEqual(N.join,E.join))return;const P=window.platforma;if(!P)throw Error("platforma not set");const j=P.pFrameDriver;if(!j)throw Error("platforma.pFrameDriver not set");const oe=await qT(j,N.pFrame,N.join),ae=o.value;ae.pTableParams||(ae.pTableParams={sorting:[],filters:[]}),ae.pTableParams.join=oe,o.value=ae});const u=Bp(()=>l.value.sourceType,async N=>{var P;const E=l.value.sourceType;switch(E){case"pframe":{const j=window.platforma;if(!j)throw Error("platforma not set");const oe=j.pFrameDriver;if(!oe)throw Error("platforma.pFrameDriver not set");if(!l.value.pFrame)return[];const ae=l.value.pFrame,Fe=(P=o.value.pTableParams)==null?void 0:P.join;return Fe?await KT(oe,ae,l.value.sheetAxes,Fe):[]}case"ptable":return l.value.sheets??[];case"xsv":return[];default:throw Error(`unsupported source type: ${E}`)}});function p(N){if(!(l.value.sourceType!=="ptable"&&l.value.sourceType!=="pframe"))return(N==null?void 0:N.sortModel.map(E=>{const{spec:P,...j}=Cp(E.colId);return{column:j,ascending:E.sort==="asc",naAndAbsentAreLeastValues:!0}}))??[]}const f=r.computed({get:()=>{const N=o.value;return{columnOrder:N.gridState.columnOrder,sort:N.gridState.sort,columnVisibility:N.gridState.columnVisibility}},set:N=>{const E=o.value,P=V.value.rowModelType==="clientSide"?void 0:p(N.sort);E.gridState={...E.gridState,...N},(l.value.sourceType==="ptable"||l.value.sourceType==="pframe")&&(E.pTableParams||(E.pTableParams={sorting:[],filters:[]}),E.pTableParams.sorting=P),o.value=E}}),m=N=>Pr(N);function _(N){var E;if(!(l.value.sourceType!=="ptable"&&l.value.sourceType!=="pframe"))return((E=u.value)==null?void 0:E.map(P=>({type:"bySingleColumnV2",column:P.column?{type:"column",id:P.column}:{type:"axis",id:P.axis},predicate:{operator:"Equal",reference:N[m(P.axis)]}})))??[]}const x=r.computed({get:()=>o.value.gridState.sheets??{},set:N=>{const E=_(N),P=o.value;P.gridState.sheets=N,(l.value.sourceType==="ptable"||l.value.sourceType==="pframe")&&(P.pTableParams||(P.pTableParams={sorting:[],filters:[]}),P.pTableParams.filters=E),o.value=P}});r.watch(()=>[l.value,u.value],(N,E)=>{const[P,j]=N;if(!j)return;if(E){const[ae,Fe]=E;if((P.sourceType==="ptable"||P.sourceType==="pframe")&&P.sourceType===(ae==null?void 0:ae.sourceType)&&Le.isEqual(j,Fe))return}if(P.sourceType!=="ptable"&&P.sourceType!=="pframe"){x.value={};return}const oe=x.value;for(const ae of j){const Fe=m(ae.axis);oe[Fe]||(oe[Fe]=ae.defaultValue??ae.options[0].value)}x.value=oe},{immediate:!0});const S=r.shallowRef(),V=r.shallowRef({animateRows:!1,suppressColumnMoveAnimation:!0,cellSelection:!0,initialState:f.value,autoSizeStrategy:{type:"fitCellContents"},onRowDataUpdated:N=>{N.api.autoSizeAllColumns()},onRowDoubleClicked:N=>{N.data&&c("onRowDoubleClicked",N.data.key)},defaultColDef:{suppressHeaderMenuButton:!0},maintainColumnOrder:!0,localeText:{loadingError:"..."},rowModelType:"clientSide",maxBlocksInCache:1e3,cacheBlockSize:100,blockLoadDebounceMillis:500,serverSideSortAllLevels:!0,suppressServerSideFullWidthLoadingRow:!0,getRowId:N=>N.data.id,loading:!0,loadingOverlayComponentParams:{notReady:!0},loadingOverlayComponent:gp,noRowsOverlayComponent:yp,sideBar:{},defaultCsvExportParams:{allColumns:!0,suppressQuotes:!0,fileName:"table.csv"}}),I=N=>{const E=N.api;S.value=new Proxy(E,{get(P,j,oe){switch(j){case"setGridOption":return(ae,Fe)=>{const Ye=V.value;Ye[ae]=Fe,V.value=Ye,E.setGridOption(ae,Fe)};case"updateGridOptions":return ae=>{V.value={...V.value,...ae},E.updateGridOptions(ae)};default:return Reflect.get(P,j,oe)}}})},G=N=>({columnOrder:N.columnOrder,sort:N.sort,columnVisibility:N.columnVisibility??(N.columnOrder?{hiddenColIds:[]}:void 0)}),v=N=>{V.value.initialState=f.value=G(N.state),N.api.autoSizeAllColumns()},R=()=>{V.value.initialState=f.value=G(S.value.getState()),S.value=void 0};let L=!1;const F=()=>{if(!L)return;const N=S.value;N!==void 0&&(N.exportDataAsCsv(),L=!1,N.setGridOption("cacheBlockSize",100))},T=()=>{if(!L)return;const N=S.value;if(N===void 0)return;const E=N.getServerSideGroupLevelState()[0];E.cacheBlockSize===E.rowCount&&N.refreshServerSide({route:E.route,purge:!1})};e({exportCsv:async()=>{const N=S.value;if(N!==void 0){if(V.value.rowModelType==="clientSide"){N.exportDataAsCsv();return}if(V.value.rowModelType==="serverSide"){const E=N.getServerSideGroupLevelState()[0];if(E.rowCount<=E.cacheBlockSize){N.exportDataAsCsv();return}L||(L=!0,N.setGridOption("cacheBlockSize",E.rowCount))}}}});const U=r.ref(0);r.watch(()=>[S.value,f.value],(N,E)=>{if(Le.isEqual(N,E))return;const[P,j]=N;if(!P)return;const oe=G(P.getState());Le.isEqual(j,oe)||(V.value.initialState=j,++U.value)}),r.watch(()=>V.value,(N,E)=>{var P;if(E&&(N.rowModelType!=E.rowModelType&&++U.value,!Le.isEqual(N.columnDefs,E.columnDefs)&&N.columnDefs)){const j=Fe=>!("children"in Fe),oe=(P=N.columnDefs)==null?void 0:P.filter(j),ae=oe==null?void 0:oe.map(Fe=>Fe.colId).filter(Fe=>Fe!==void 0).map(Fe=>Cp(Fe));c("columnsChanged",ae??[])}});const O=(N,E)=>{var j;const P=x.value;P[N]!==E&&(P[N]=E,x.value=P,(j=S.value)==null||j.updateGridOptions({loading:!0,loadingOverlayComponentParams:{notReady:!1}}))},Z=window.platforma;if(!Z)throw Error("platforma not set");const W=Z.pFrameDriver;if(!W)throw Error("platforma.pFrameDriver not set");const J=Z.blobDriver;if(!J)throw Error("platforma.blobDriver not set");let he;return r.watch(()=>[S.value,l.value,u.value],async N=>{var ae,Fe;const[E,P,j]=N;if(!E||Le.isEqual(P,he))return;he=P;const oe=P.sourceType;switch(oe){case"pframe":case"ptable":{const Ye=P.pTable;if(!Ye||!j)return E.updateGridOptions({loading:!0,loadingOverlayComponentParams:{notReady:!0},columnDefs:[]});const ft=(Fe=(ae=f.value)==null?void 0:ae.columnVisibility)==null?void 0:Fe.hiddenColIds,Cr=await XT(W,Ye,j,ft);return E.updateGridOptions({loading:Cr.rowModelType!=="clientSide",loadingOverlayComponentParams:{notReady:!1},...Cr})}case"xsv":{const Ye=P.xsvFile;if(!(Ye!=null&&Ye.ok)||!Ye.value)return E.updateGridOptions({loading:!0,loadingOverlayComponentParams:{notReady:!0},columnDefs:[]});const ft=await GT(J,Ye.value);return E.updateGridOptions({loading:!0,loadingOverlayComponentParams:{notReady:!1},...ft})}default:throw Error(`unsupported source type: ${oe}`)}}),(N,E)=>(r.openBlock(),r.createElementBlock("div",nB,[S.value&&N.showColumnsPanel?(r.openBlock(),r.createBlock(r.unref(xp),{key:0,api:S.value},null,8,["api"])):r.createCommentVNode("",!0),r.unref(u).value&&r.unref(u).value.length>0?(r.openBlock(),r.createElementBlock("div",rB,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(u).value,(P,j)=>(r.openBlock(),r.createBlock(r.unref(zu),{key:j,"model-value":x.value[m(P.axis)],options:P.options,"onUpdate:modelValue":oe=>O(m(P.axis),oe)},null,8,["model-value","options","onUpdate:modelValue"]))),128))])):r.createCommentVNode("",!0),(r.openBlock(),r.createBlock(r.unref(bm.AgGridVue),{key:U.value,theme:r.unref(su),class:"ap-ag-data-table-grid","grid-options":V.value,onGridReady:I,onStateUpdated:v,onGridPreDestroyed:R,onStoreRefreshed:F,onModelUpdated:T},null,8,["theme","grid-options"]))]))}}),[["__scopeId","data-v-ea0278e4"]]),iB={key:1,class:"alert-error"},sB={key:2},aB=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),s=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",iB,r.toDisplayString(o.value),1)):r.createCommentVNode("",!0),s.value?(r.openBlock(),r.createElementBlock("div",sB,"Unresolved")):r.createCommentVNode("",!0)]))}}),lB={style:{height:"100%"}},cB=r.defineComponent({__name:"PlAgCellFile",props:{params:{}},setup(t){const e=t,n=r.computed(()=>e.params.extensions),o=r.computed(()=>e.params.value);function s(c){e.params.setValue(c)}const l=r.computed(()=>e.params.resolveProgress?e.params.resolveProgress(o.value):void 0);return(c,u)=>(r.openBlock(),r.createElementBlock("div",lB,[r.createVNode(r.unref(dp),{"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":s},null,8,["placeholder","extensions","model-value","progress"])]))}}),dB={class:"pl-ag-grid-open-cell d-flex"},uB={class:"pl-ag-grid-open-cell__value"},pB=r.defineComponent({__name:"PlAgTextAndButtonCell",props:{params:{}},setup(t){const e=t;function n(){if(e.params.invokeRowsOnDoubleClick){const o=e.params.api,s={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(s)}else e.params.onClick&&e.params.onClick(e.params)}return(o,s)=>(r.openBlock(),r.createElementBlock("div",dB,[r.createElementVNode("div",uB,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(cn),{name:o.params.icon??"maximize"},null,8,["name"]),r.createTextVNode(" "+r.toDisplayString(o.params.btnLabel??"Open"),1)])]))}});function hB(t){return Pr(t.id)}function fB(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 mB=["isNotNA","isNA","number_equals","number_notEquals","number_greaterThan","number_greaterThanOrEqualTo","number_lessThan","number_lessThanOrEqualTo","number_between"],gB=["isNotNA","isNA","string_equals","string_notEquals","string_contains","string_doesNotContain","string_matches","string_doesNotMatch","string_containsFuzzyMatch"];function kp(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 yB(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 Sp(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 _B(t,e){return{columnId:t.columnId,filter:Sp(e,yB(t.filter)),disabled:t.disabled}}function Rl(t,e){var c,u;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 s=(c=t.spec.annotations)==null?void 0:c["pl7.app/min"];if(s!==void 0){const p=Number(s);if(Number.isFinite(p)&&n<Number(s))throw Error("Model value is too low.")}const l=(u=t.spec.annotations)==null?void 0:u["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 Ep(t,e){var o,s;const n=((o=t.spec.domain)==null?void 0:o["pl7.app/alphabet"])??((s=t.spec.annotations)==null?void 0:s["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 CB(t){try{return new RegExp(t),t}catch(e){throw e instanceof SyntaxError?Error("Model value is not a regexp."):e}}function vB(t,e){var s,l;const n=((s=t.spec.domain)==null?void 0:s["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=Le.uniq(e);return o.sort(),o.map(c=>({value:c,text:c}))}function wB(t,e){var s,l;const n=(t.type==="column"?t.spec.valueType:t.spec.type)==="String"&&(((s=t.spec.domain)==null?void 0:s["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 bB={class:"d-flex flex-column gap-24"},Tp=r.defineComponent({__name:"PlTableFilterEntry",props:r.mergeModels({column:{},options:{}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=r.useModel(t,"modelValue"),n=t,{column:o,options:s}=r.toRefs(n);return(l,c)=>(r.openBlock(),r.createElementBlock("div",bB,[r.createVNode(r.unref(fo),{"model-value":e.value.filter.type,options:r.unref(s),label:"Predicate","onUpdate:modelValue":c[0]||(c[0]=u=>e.value=r.unref(_B)(e.value,u))},null,8,["model-value","options"]),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(Ir),{key:0,modelValue:e.value.filter.reference,"onUpdate:modelValue":c[1]||(c[1]=u=>e.value.filter.reference=u),parse:u=>r.unref(Rl)(r.unref(o),u),label:"Reference value"},null,8,["modelValue","parse"])):r.createCommentVNode("",!0),e.value.filter.type==="number_between"?(r.openBlock(),r.createElementBlock(r.Fragment,{key:1},[r.createVNode(r.unref(Ir),{modelValue:e.value.filter.lowerBound,"onUpdate:modelValue":c[2]||(c[2]=u=>e.value.filter.lowerBound=u),parse:u=>r.unref(Rl)(r.unref(o),u),label:"Lower bound"},null,8,["modelValue","parse"]),r.createVNode(r.unref(bs),{modelValue:e.value.filter.includeLowerBound,"onUpdate:modelValue":c[3]||(c[3]=u=>e.value.filter.includeLowerBound=u),label:"Include lower bound"},null,8,["modelValue"]),r.createVNode(r.unref(Ir),{modelValue:e.value.filter.upperBound,"onUpdate:modelValue":c[4]||(c[4]=u=>e.value.filter.upperBound=u),parse:u=>r.unref(Rl)(r.unref(o),u),label:"Upper bound"},null,8,["modelValue","parse"]),r.createVNode(r.unref(bs),{modelValue:e.value.filter.includeUpperBound,"onUpdate:modelValue":c[5]||(c[5]=u=>e.value.filter.includeUpperBound=u),label:"Include upper bound"},null,8,["modelValue"])],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(Ir),{key:2,modelValue:e.value.filter.reference,"onUpdate:modelValue":c[6]||(c[6]=u=>e.value.filter.reference=u),parse:u=>r.unref(Ep)(r.unref(o),u),label:"Reference value"},null,8,["modelValue","parse"])):r.createCommentVNode("",!0),e.value.filter.type==="string_matches"||e.value.filter.type==="string_doesNotMatch"?(r.openBlock(),r.createBlock(r.unref(Ir),{key:3,modelValue:e.value.filter.reference,"onUpdate:modelValue":c[7]||(c[7]=u=>e.value.filter.reference=u),parse:r.unref(CB),label:"Reference value"},null,8,["modelValue","parse"])):r.createCommentVNode("",!0),e.value.filter.type==="string_containsFuzzyMatch"?(r.openBlock(),r.createElementBlock(r.Fragment,{key:4},[r.createVNode(r.unref(Ir),{modelValue:e.value.filter.reference,"onUpdate:modelValue":c[8]||(c[8]=u=>e.value.filter.reference=u),parse:u=>r.unref(Ep)(r.unref(o),u),label:"Reference value"},null,8,["modelValue","parse"]),r.createVNode(r.unref(pp),{modelValue:e.value.filter.maxEdits,"onUpdate:modelValue":c[9]||(c[9]=u=>e.value.filter.maxEdits=u),max:5,breakpoints:"",label:"Maximum nuber of substitutions and indels"},null,8,["modelValue"]),r.createVNode(r.unref(bs),{modelValue:e.value.filter.substitutionsOnly,"onUpdate:modelValue":c[10]||(c[10]=u=>e.value.filter.substitutionsOnly=u),label:"Substitutions only"},null,8,["modelValue"]),r.createVNode(r.unref(fo),{modelValue:e.value.filter.wildcard,"onUpdate:modelValue":c[11]||(c[11]=u=>e.value.filter.wildcard=u),options:r.unref(vB)(r.unref(o),e.value.filter.reference),clearable:"",label:"Wildcard symbol"},null,8,["modelValue","options"])],64)):r.createCommentVNode("",!0)]))}}),xB={class:"d-flex flex-column gap-24"},kB={key:0,class:"text-subtitle-m",style:{color:"var(--txt-mask)"}},SB=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:s,columnOptions:l,filterOptions:c}=r.toRefs(o),u=e,p=r.ref(),f=r.ref();r.watch(()=>p.value,x=>{x?f.value=o.makeFilter(x):f.value=void 0});const m=()=>{p.value=void 0,n.value=!1},_=()=>{f.value&&(u("addFilter",f.value),m())};return(x,S)=>(r.openBlock(),r.createBlock(r.unref(ws),{modelValue:n.value,"onUpdate:modelValue":S[2]||(S[2]=V=>n.value=V),"close-on-outside-click":!1},{title:r.withCtx(()=>S[3]||(S[3]=[r.createTextVNode("Add Filter")])),actions:r.withCtx(()=>[r.createVNode(r.unref(Cs),{disabled:!f.value,onClick:_},{default:r.withCtx(()=>S[4]||(S[4]=[r.createTextVNode("Add Filter")])),_:1},8,["disabled"]),r.createVNode(r.unref(po),{"justify-center":!1,onClick:m},{default:r.withCtx(()=>S[5]||(S[5]=[r.createTextVNode("Cancel")])),_:1})]),default:r.withCtx(()=>[r.createElementVNode("div",xB,[r.createVNode(r.unref(fo),{modelValue:p.value,"onUpdate:modelValue":S[0]||(S[0]=V=>p.value=V),options:r.unref(l),label:"Column",placeholder:"Choose..."},null,8,["modelValue","options"]),f.value?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",kB,"Choose a column to view and adjust its options")),f.value?(r.openBlock(),r.createBlock(Tp,{key:1,modelValue:f.value,"onUpdate:modelValue":S[1]||(S[1]=V=>f.value=V),column:r.unref(s)[f.value.columnId],options:r.unref(c)[f.value.columnId]},null,8,["modelValue","column","options"])):r.createCommentVNode("",!0)])]),_:1},8,["modelValue"]))}}),EB={class:"pl-filter-manager d-flex flex-column gap-6"},TB=["onClick"],BB={class:"pl-filter-manager__expand-icon"},VB={class:"pl-filter-manager__title flex-grow-1 text-s"},NB={class:"pl-filter-manager__actions d-flex gap-12"},AB=["onClick"],PB=["onClick"],DB={class:"pl-filter-manager__content d-flex gap-24 p-24 flex-column"},FB={class:"d-flex justify-center"},RB=["onClick"],MB={class:"pl-filter-manager__add-btn-icon"},IB={key:1},OB=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:s,defaults:l}=r.toRefs(n),c=r.computed(()=>{const U=o.value.filter(Z=>{const W=Z.type;switch(W){case"axis":return Z.spec.type!=="Bytes";case"column":return Z.spec.valueType!=="Bytes";default:throw Error(`unsupported data type: ${W}`)}}),O={};for(const Z of U)O[hB(Z)]=Z;return O}),u=r.computed(()=>{const U=s.value??[],O={};for(const[Z,W]of Object.entries(c.value)){const J=Le.find(U,he=>Le.isEqual(he.column.id,W.id));J&&(O[Z]=J.allowedFilterTypes)}return O}),p=r.computed(()=>{const U=l.value??[],O={};for(const[Z,W]of Object.entries(c.value)){const J=Le.find(U,he=>Le.isEqual(he.column.id,W.id));J&&(O[Z]={columnId:Z,filter:J.default,disabled:!1})}return O});(()=>{let U=e.value.state;typeof U=="object"&&!Array.isArray(U)&&(e.value.state=Object.entries(U).map(([O,Z])=>({columnId:O,filter:Z,disabled:!1})))})();const f=U=>U??Object.values(p.value),m=r.reactive({state:f(e.value.state)});r.watch(()=>e.value,U=>{Le.isEqual(m.state,U.state)||(m.state=f(U.state))}),r.watch(()=>m,U=>{Le.isEqual(U.state,e.value.state)||(e.value={state:Le.cloneDeep(U.state),filters:U.state.filter(O=>!O.disabled).map(O=>{const Z=c.value[O.columnId],{spec:W,...J}=Z;return{type:"bySingleColumnV2",column:J,predicate:wB(Z,O.filter)}})})},{immediate:!0,deep:!0}),r.watch(()=>c.value,U=>{Object.keys(U).length===0&&m.state!==void 0||(m.state=m.state.filter(O=>!!U[O.columnId]))},{immediate:!0});const _=r.computed(()=>Object.keys(c).length>0&&m.state.length>0),x=r.computed(()=>{const U=u.value,O={};for(const[Z,W]of Object.entries(c.value)){let he=(W.type==="column"?W.spec.valueType:W.spec.type)==="String"?gB:mB;const N=U[Z];N&&(he=he.filter(E=>N.includes(E))),O[Z]=he.map(E=>({value:E,text:fB(E)}))}return O}),S=r.computed(()=>Le.some(Object.values(x.value),U=>U.length>0)),V=r.computed(()=>Object.entries(Object.entries(c.value)).filter(([U,[O,Z]])=>x.value[O].length>0).filter(([U,[O,Z]])=>!m.state.some(W=>W.columnId===O)).map(([U,[O,Z]])=>({label:kp(Z,U),value:O}))),I=U=>p.value[U]??{columnId:U,filter:Sp(x.value[U][0].value),disabled:!1},G=U=>{m.state[U]=I(m.state[U].columnId)},v=U=>m.state.splice(U,1),R=r.ref(!1),L=r.ref(!1),F=r.ref(!1);r.onMounted(()=>{F.value=!0});const T=r.reactive({}),$=U=>{T[U]?delete T[U]:T[U]=!0};return(U,O)=>(r.openBlock(),r.createElementBlock(r.Fragment,null,[F.value?(r.openBlock(),r.createBlock(r.Teleport,{key:0,to:`#${r.unref(Fl)}`},[r.createVNode(r.unref(po),{onClick:O[0]||(O[0]=r.withModifiers(Z=>R.value=!0,["stop"]))},{append:r.withCtx(()=>[r.createVNode(r.unref(pi),{name:_.value?"filter-on":"filter"},null,8,["name"])]),default:r.withCtx(()=>[O[5]||(O[5]=r.createTextVNode(" Filters "))]),_:1})],8,["to"])):r.createCommentVNode("",!0),r.createVNode(r.unref(ws),{modelValue:R.value,"onUpdate:modelValue":O[2]||(O[2]=Z=>R.value=Z),"close-on-outside-click":!1},{title:r.withCtx(()=>O[6]||(O[6]=[r.createTextVNode("Manage Filters")])),default:r.withCtx(()=>[r.createElementVNode("div",EB,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(m.state,(Z,W)=>(r.openBlock(),r.createElementBlock("div",{key:Z.columnId,class:r.normalizeClass([{open:T[Z.columnId]},"pl-filter-manager__filter"])},[r.createElementVNode("div",{class:"pl-filter-manager__header d-flex align-center gap-8",onClick:J=>$(Z.columnId)},[r.createElementVNode("div",BB,[r.createVNode(r.unref(cn),{name:"chevron-right"})]),r.createElementVNode("div",VB,r.toDisplayString(r.unref(kp)(c.value[Z.columnId],W)),1),r.createElementVNode("div",NB,[r.createElementVNode("div",{class:"pl-filter-manager__toggle",onClick:r.withModifiers(J=>Z.disabled=!Z.disabled,["stop"])},[r.createVNode(r.unref(Dt),{name:Z.disabled?"view-hide":"view-show"},null,8,["name"])],8,AB),r.createElementVNode("div",{class:"pl-filter-manager__delete",onClick:r.withModifiers(J=>v(W),["stop"])},[r.createVNode(r.unref(Dt),{name:"close"})],8,PB)])],8,TB),r.createElementVNode("div",DB,[r.createVNode(Tp,{modelValue:m.state[W],"onUpdate:modelValue":J=>m.state[W]=J,column:c.value[Z.columnId],options:x.value[Z.columnId]},null,8,["modelValue","onUpdate:modelValue","column","options"]),r.createElementVNode("div",FB,[r.createElementVNode("div",{class:"pl-filter-manager__revert-btn text-s d-flex align-center gap-8",onClick:J=>G(W)},[O[7]||(O[7]=r.createTextVNode(" Revert Settings to Default ")),r.createVNode(r.unref(Dt),{name:"reverse"})],8,RB)])])],2))),128)),V.value.length>0?(r.openBlock(),r.createElementBlock("div",{key:0,class:"pl-filter-manager__add-btn",onClick:O[1]||(O[1]=Z=>L.value=!0)},[r.createElementVNode("div",MB,[r.createVNode(r.unref(cn),{name:"add"})]),O[8]||(O[8]=r.createElementVNode("div",{class:"pl-filter-manager__add-btn-title"},"Add Filter",-1))])):r.createCommentVNode("",!0),S.value?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",IB,"No filters applicable"))])]),_:1},8,["modelValue"]),r.createVNode(SB,{modelValue:L.value,"onUpdate:modelValue":O[3]||(O[3]=Z=>L.value=Z),"columns-by-id":c.value,"column-options":V.value,"filter-options":x.value,"make-filter":I,onAddFilter:O[4]||(O[4]=Z=>m.state.push(Z))},null,8,["modelValue","columns-by-id","column-options","filter-options"])],64))}}),Ds=new Map;function LB(t,e){const n=r.getCurrentScope()??r.effectScope(),o=n.run(()=>(r.onScopeDispose(()=>{Ds.delete(t)}),r.reactive(e())));return o[Symbol.dispose]=()=>{n.stop()},o}function GB(t){const e=Symbol();return()=>(Ds.has(e)||Ds.set(e,LB(e,t)),Ds.get(e))}function zB(t){return r.computed(()=>{try{return wd(t())}catch(e){return{errors:[String(e)],value:void 0}}})}function Bp(t,e,n){const o=r.ref(0),s=r.reactive({loading:r.computed(()=>o.value>0),loadingRef:o,value:void 0,error:void 0}),l=Bm(e);return r.watch(t,async c=>{s.error=void 0,o.value++,l(c).then(u=>{u.ok&&(s.value=u.value)}).catch(u=>{s.value=void 0,s.error=u}).finally(()=>{o.value--})},Object.assign({immediate:!0,deep:!0},n??{})),s}const wo=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,Vp=new Set,Ml=typeof process=="object"&&process?process:{},Np=(t,e,n,o)=>{typeof Ml.emitWarning=="function"?Ml.emitWarning(t,e,n,o):console.error(`[${n}] ${e}: ${t}`)};let Fs=globalThis.AbortController,Ap=globalThis.AbortSignal;if(typeof Fs>"u"){Ap=class{constructor(){$e(this,"onabort");$e(this,"_onabort",[]);$e(this,"reason");$e(this,"aborted",!1)}addEventListener(o,s){this._onabort.push(s)}},Fs=class{constructor(){$e(this,"signal",new Ap);e()}abort(o){var s,l;if(!this.signal.aborted){this.signal.reason=o,this.signal.aborted=!0;for(const c of this.signal._onabort)c(o);(l=(s=this.signal).onabort)==null||l.call(s,o)}}};let t=((Dp=Ml.env)==null?void 0:Dp.LRU_CACHE_IGNORE_AC_WARNING)!=="1";const e=()=>{t&&(t=!1,Np("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 $B=t=>!Vp.has(t),yr=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),Pp=t=>yr(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?Rs:null:null;class Rs extends Array{constructor(e){super(e),this.fill(0)}}const zr=class zr{constructor(e,n){$e(this,"heap");$e(this,"length");if(!w(zr,bo))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new n(e),this.length=0}static create(e){const n=Pp(e);if(!n)return[];me(zr,bo,!0);const o=new zr(e,n);return me(zr,bo,!1),o}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}};bo=new WeakMap,Ge(zr,bo,!1);let Il=zr;const Gl=class Gl{constructor(e){Ge(this,ee);Ge(this,hn);Ge(this,zt);Ge(this,fn);Ge(this,mn);Ge(this,xo);Ge(this,ko);$e(this,"ttl");$e(this,"ttlResolution");$e(this,"ttlAutopurge");$e(this,"updateAgeOnGet");$e(this,"updateAgeOnHas");$e(this,"allowStale");$e(this,"noDisposeOnSet");$e(this,"noUpdateTTL");$e(this,"maxEntrySize");$e(this,"sizeCalculation");$e(this,"noDeleteOnFetchRejection");$e(this,"noDeleteOnStaleGet");$e(this,"allowStaleOnFetchAbort");$e(this,"allowStaleOnFetchRejection");$e(this,"ignoreFetchAbort");Ge(this,lt);Ge(this,gn);Ge(this,st);Ge(this,je);Ge(this,be);Ge(this,Tt);Ge(this,$t);Ge(this,bt);Ge(this,pt);Ge(this,yn);Ge(this,ht);Ge(this,_n);Ge(this,Cn);Ge(this,Zt);Ge(this,vn);Ge(this,_r);Ge(this,Bt);Ge(this,$r,()=>{});Ge(this,Zn,()=>{});Ge(this,Pi,()=>{});Ge(this,Ut,()=>!1);Ge(this,Zr,e=>{});Ge(this,So,(e,n,o)=>{});Ge(this,Di,(e,n,o,s)=>{if(o||s)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});$e(this,Fp,"LRUCache");const{max:n=0,ttl:o,ttlResolution:s=1,ttlAutopurge:l,updateAgeOnGet:c,updateAgeOnHas:u,allowStale:p,dispose:f,disposeAfter:m,noDisposeOnSet:_,noUpdateTTL:x,maxSize:S=0,maxEntrySize:V=0,sizeCalculation:I,fetchMethod:G,memoMethod:v,noDeleteOnFetchRejection:R,noDeleteOnStaleGet:L,allowStaleOnFetchRejection:F,allowStaleOnFetchAbort:T,ignoreFetchAbort:$}=e;if(n!==0&&!yr(n))throw new TypeError("max option must be a nonnegative integer");const U=n?Pp(n):Array;if(!U)throw new Error("invalid max value: "+n);if(me(this,hn,n),me(this,zt,S),this.maxEntrySize=V||w(this,zt),this.sizeCalculation=I,this.sizeCalculation){if(!w(this,zt)&&!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(me(this,ko,v),G!==void 0&&typeof G!="function")throw new TypeError("fetchMethod must be a function if specified");if(me(this,xo,G),me(this,_r,!!G),me(this,st,new Map),me(this,je,new Array(n).fill(void 0)),me(this,be,new Array(n).fill(void 0)),me(this,Tt,new U(n)),me(this,$t,new U(n)),me(this,bt,0),me(this,pt,0),me(this,yn,Il.create(n)),me(this,lt,0),me(this,gn,0),typeof f=="function"&&me(this,fn,f),typeof m=="function"?(me(this,mn,m),me(this,ht,[])):(me(this,mn,void 0),me(this,ht,void 0)),me(this,vn,!!w(this,fn)),me(this,Bt,!!w(this,mn)),this.noDisposeOnSet=!!_,this.noUpdateTTL=!!x,this.noDeleteOnFetchRejection=!!R,this.allowStaleOnFetchRejection=!!F,this.allowStaleOnFetchAbort=!!T,this.ignoreFetchAbort=!!$,this.maxEntrySize!==0){if(w(this,zt)!==0&&!yr(w(this,zt)))throw new TypeError("maxSize must be a positive integer if specified");if(!yr(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");ce(this,ee,gm).call(this)}if(this.allowStale=!!p,this.noDeleteOnStaleGet=!!L,this.updateAgeOnGet=!!c,this.updateAgeOnHas=!!u,this.ttlResolution=yr(s)||s===0?s:1,this.ttlAutopurge=!!l,this.ttl=o||0,this.ttl){if(!yr(this.ttl))throw new TypeError("ttl must be a positive integer if specified");ce(this,ee,cd).call(this)}if(w(this,hn)===0&&this.ttl===0&&w(this,zt)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!w(this,hn)&&!w(this,zt)){const O="LRU_CACHE_UNBOUNDED";$B(O)&&(Vp.add(O),Np("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",O,Gl))}}static unsafeExposeInternals(e){return{starts:w(e,Cn),ttls:w(e,Zt),sizes:w(e,_n),keyMap:w(e,st),keyList:w(e,je),valList:w(e,be),next:w(e,Tt),prev:w(e,$t),get head(){return w(e,bt)},get tail(){return w(e,pt)},free:w(e,yn),isBackgroundFetch:n=>{var o;return ce(o=e,ee,Ke).call(o,n)},backgroundFetch:(n,o,s,l)=>{var c;return ce(c=e,ee,Na).call(c,n,o,s,l)},moveToTail:n=>{var o;return ce(o=e,ee,rs).call(o,n)},indexes:n=>{var o;return ce(o=e,ee,Vr).call(o,n)},rindexes:n=>{var o;return ce(o=e,ee,Nr).call(o,n)},isStale:n=>{var o;return w(o=e,Ut).call(o,n)}}}get max(){return w(this,hn)}get maxSize(){return w(this,zt)}get calculatedSize(){return w(this,gn)}get size(){return w(this,lt)}get fetchMethod(){return w(this,xo)}get memoMethod(){return w(this,ko)}get dispose(){return w(this,fn)}get disposeAfter(){return w(this,mn)}getRemainingTTL(e){return w(this,st).has(e)?1/0:0}*entries(){for(const e of ce(this,ee,Vr).call(this))w(this,be)[e]!==void 0&&w(this,je)[e]!==void 0&&!ce(this,ee,Ke).call(this,w(this,be)[e])&&(yield[w(this,je)[e],w(this,be)[e]])}*rentries(){for(const e of ce(this,ee,Nr).call(this))w(this,be)[e]!==void 0&&w(this,je)[e]!==void 0&&!ce(this,ee,Ke).call(this,w(this,be)[e])&&(yield[w(this,je)[e],w(this,be)[e]])}*keys(){for(const e of ce(this,ee,Vr).call(this)){const n=w(this,je)[e];n!==void 0&&!ce(this,ee,Ke).call(this,w(this,be)[e])&&(yield n)}}*rkeys(){for(const e of ce(this,ee,Nr).call(this)){const n=w(this,je)[e];n!==void 0&&!ce(this,ee,Ke).call(this,w(this,be)[e])&&(yield n)}}*values(){for(const e of ce(this,ee,Vr).call(this))w(this,be)[e]!==void 0&&!ce(this,ee,Ke).call(this,w(this,be)[e])&&(yield w(this,be)[e])}*rvalues(){for(const e of ce(this,ee,Nr).call(this))w(this,be)[e]!==void 0&&!ce(this,ee,Ke).call(this,w(this,be)[e])&&(yield w(this,be)[e])}[(Rp=Symbol.iterator,Fp=Symbol.toStringTag,Rp)](){return this.entries()}find(e,n={}){for(const o of ce(this,ee,Vr).call(this)){const s=w(this,be)[o],l=ce(this,ee,Ke).call(this,s)?s.__staleWhileFetching:s;if(l!==void 0&&e(l,w(this,je)[o],this))return this.get(w(this,je)[o],n)}}forEach(e,n=this){for(const o of ce(this,ee,Vr).call(this)){const s=w(this,be)[o],l=ce(this,ee,Ke).call(this,s)?s.__staleWhileFetching:s;l!==void 0&&e.call(n,l,w(this,je)[o],this)}}rforEach(e,n=this){for(const o of ce(this,ee,Nr).call(this)){const s=w(this,be)[o],l=ce(this,ee,Ke).call(this,s)?s.__staleWhileFetching:s;l!==void 0&&e.call(n,l,w(this,je)[o],this)}}purgeStale(){let e=!1;for(const n of ce(this,ee,Nr).call(this,{allowStale:!0}))w(this,Ut).call(this,n)&&(ce(this,ee,Ar).call(this,w(this,je)[n],"expire"),e=!0);return e}info(e){const n=w(this,st).get(e);if(n===void 0)return;const o=w(this,be)[n],s=ce(this,ee,Ke).call(this,o)?o.__staleWhileFetching:o;if(s===void 0)return;const l={value:s};if(w(this,Zt)&&w(this,Cn)){const c=w(this,Zt)[n],u=w(this,Cn)[n];if(c&&u){const p=c-(wo.now()-u);l.ttl=p,l.start=Date.now()}}return w(this,_n)&&(l.size=w(this,_n)[n]),l}dump(){const e=[];for(const n of ce(this,ee,Vr).call(this,{allowStale:!0})){const o=w(this,je)[n],s=w(this,be)[n],l=ce(this,ee,Ke).call(this,s)?s.__staleWhileFetching:s;if(l===void 0||o===void 0)continue;const c={value:l};if(w(this,Zt)&&w(this,Cn)){c.ttl=w(this,Zt)[n];const u=wo.now()-w(this,Cn)[n];c.start=Math.floor(Date.now()-u)}w(this,_n)&&(c.size=w(this,_n)[n]),e.unshift([o,c])}return e}load(e){this.clear();for(const[n,o]of e){if(o.start){const s=Date.now()-o.start;o.start=wo.now()-s}this.set(n,o.value,o)}}set(e,n,o={}){var x,S,V,I,G;if(n===void 0)return this.delete(e),this;const{ttl:s=this.ttl,start:l,noDisposeOnSet:c=this.noDisposeOnSet,sizeCalculation:u=this.sizeCalculation,status:p}=o;let{noUpdateTTL:f=this.noUpdateTTL}=o;const m=w(this,Di).call(this,e,n,o.size||0,u);if(this.maxEntrySize&&m>this.maxEntrySize)return p&&(p.set="miss",p.maxEntrySizeExceeded=!0),ce(this,ee,Ar).call(this,e,"set"),this;let _=w(this,lt)===0?void 0:w(this,st).get(e);if(_===void 0)_=w(this,lt)===0?w(this,pt):w(this,yn).length!==0?w(this,yn).pop():w(this,lt)===w(this,hn)?ce(this,ee,Va).call(this,!1):w(this,lt),w(this,je)[_]=e,w(this,be)[_]=n,w(this,st).set(e,_),w(this,Tt)[w(this,pt)]=_,w(this,$t)[_]=w(this,pt),me(this,pt,_),Ba(this,lt)._++,w(this,So).call(this,_,m,p),p&&(p.set="add"),f=!1;else{ce(this,ee,rs).call(this,_);const v=w(this,be)[_];if(n!==v){if(w(this,_r)&&ce(this,ee,Ke).call(this,v)){v.__abortController.abort(new Error("replaced"));const{__staleWhileFetching:R}=v;R!==void 0&&!c&&(w(this,vn)&&((x=w(this,fn))==null||x.call(this,R,e,"set")),w(this,Bt)&&((S=w(this,ht))==null||S.push([R,e,"set"])))}else c||(w(this,vn)&&((V=w(this,fn))==null||V.call(this,v,e,"set")),w(this,Bt)&&((I=w(this,ht))==null||I.push([v,e,"set"])));if(w(this,Zr).call(this,_),w(this,So).call(this,_,m,p),w(this,be)[_]=n,p){p.set="replace";const R=v&&ce(this,ee,Ke).call(this,v)?v.__staleWhileFetching:v;R!==void 0&&(p.oldValue=R)}}else p&&(p.set="update")}if(s!==0&&!w(this,Zt)&&ce(this,ee,cd).call(this),w(this,Zt)&&(f||w(this,Pi).call(this,_,s,l),p&&w(this,Zn).call(this,p,_)),!c&&w(this,Bt)&&w(this,ht)){const v=w(this,ht);let R;for(;R=v==null?void 0:v.shift();)(G=w(this,mn))==null||G.call(this,...R)}return this}pop(){var e;try{for(;w(this,lt);){const n=w(this,be)[w(this,bt)];if(ce(this,ee,Va).call(this,!0),ce(this,ee,Ke).call(this,n)){if(n.__staleWhileFetching)return n.__staleWhileFetching}else if(n!==void 0)return n}}finally{if(w(this,Bt)&&w(this,ht)){const n=w(this,ht);let o;for(;o=n==null?void 0:n.shift();)(e=w(this,mn))==null||e.call(this,...o)}}}has(e,n={}){const{updateAgeOnHas:o=this.updateAgeOnHas,status:s}=n,l=w(this,st).get(e);if(l!==void 0){const c=w(this,be)[l];if(ce(this,ee,Ke).call(this,c)&&c.__staleWhileFetching===void 0)return!1;if(w(this,Ut).call(this,l))s&&(s.has="stale",w(this,Zn).call(this,s,l));else return o&&w(this,$r).call(this,l),s&&(s.has="hit",w(this,Zn).call(this,s,l)),!0}else s&&(s.has="miss");return!1}peek(e,n={}){const{allowStale:o=this.allowStale}=n,s=w(this,st).get(e);if(s===void 0||!o&&w(this,Ut).call(this,s))return;const l=w(this,be)[s];return ce(this,ee,Ke).call(this,l)?l.__staleWhileFetching:l}async fetch(e,n={}){const{allowStale:o=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:l=this.noDeleteOnStaleGet,ttl:c=this.ttl,noDisposeOnSet:u=this.noDisposeOnSet,size:p=0,sizeCalculation:f=this.sizeCalculation,noUpdateTTL:m=this.noUpdateTTL,noDeleteOnFetchRejection:_=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:x=this.allowStaleOnFetchRejection,ignoreFetchAbort:S=this.ignoreFetchAbort,allowStaleOnFetchAbort:V=this.allowStaleOnFetchAbort,context:I,forceRefresh:G=!1,status:v,signal:R}=n;if(!w(this,_r))return v&&(v.fetch="get"),this.get(e,{allowStale:o,updateAgeOnGet:s,noDeleteOnStaleGet:l,status:v});const L={allowStale:o,updateAgeOnGet:s,noDeleteOnStaleGet:l,ttl:c,noDisposeOnSet:u,size:p,sizeCalculation:f,noUpdateTTL:m,noDeleteOnFetchRejection:_,allowStaleOnFetchRejection:x,allowStaleOnFetchAbort:V,ignoreFetchAbort:S,status:v,signal:R};let F=w(this,st).get(e);if(F===void 0){v&&(v.fetch="miss");const T=ce(this,ee,Na).call(this,e,F,L,I);return T.__returned=T}else{const T=w(this,be)[F];if(ce(this,ee,Ke).call(this,T)){const W=o&&T.__staleWhileFetching!==void 0;return v&&(v.fetch="inflight",W&&(v.returnedStale=!0)),W?T.__staleWhileFetching:T.__returned=T}const $=w(this,Ut).call(this,F);if(!G&&!$)return v&&(v.fetch="hit"),ce(this,ee,rs).call(this,F),s&&w(this,$r).call(this,F),v&&w(this,Zn).call(this,v,F),T;const U=ce(this,ee,Na).call(this,e,F,L,I),Z=U.__staleWhileFetching!==void 0&&o;return v&&(v.fetch=$?"stale":"refresh",Z&&$&&(v.returnedStale=!0)),Z?U.__staleWhileFetching:U.__returned=U}}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=w(this,ko);if(!o)throw new Error("no memoMethod provided to constructor");const{context:s,forceRefresh:l,...c}=n,u=this.get(e,c);if(!l&&u!==void 0)return u;const p=o(e,u,{options:c,context:s});return this.set(e,p,c),p}get(e,n={}){const{allowStale:o=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:l=this.noDeleteOnStaleGet,status:c}=n,u=w(this,st).get(e);if(u!==void 0){const p=w(this,be)[u],f=ce(this,ee,Ke).call(this,p);return c&&w(this,Zn).call(this,c,u),w(this,Ut).call(this,u)?(c&&(c.get="stale"),f?(c&&o&&p.__staleWhileFetching!==void 0&&(c.returnedStale=!0),o?p.__staleWhileFetching:void 0):(l||ce(this,ee,Ar).call(this,e,"expire"),c&&o&&(c.returnedStale=!0),o?p:void 0)):(c&&(c.get="hit"),f?p.__staleWhileFetching:(ce(this,ee,rs).call(this,u),s&&w(this,$r).call(this,u),p))}else c&&(c.get="miss")}delete(e){return ce(this,ee,Ar).call(this,e,"delete")}clear(){return ce(this,ee,pd).call(this,"delete")}};hn=new WeakMap,zt=new WeakMap,fn=new WeakMap,mn=new WeakMap,xo=new WeakMap,ko=new WeakMap,lt=new WeakMap,gn=new WeakMap,st=new WeakMap,je=new WeakMap,be=new WeakMap,Tt=new WeakMap,$t=new WeakMap,bt=new WeakMap,pt=new WeakMap,yn=new WeakMap,ht=new WeakMap,_n=new WeakMap,Cn=new WeakMap,Zt=new WeakMap,vn=new WeakMap,_r=new WeakMap,Bt=new WeakMap,ee=new WeakSet,cd=function(){const e=new Rs(w(this,hn)),n=new Rs(w(this,hn));me(this,Zt,e),me(this,Cn,n),me(this,Pi,(l,c,u=wo.now())=>{if(n[l]=c!==0?u:0,e[l]=c,c!==0&&this.ttlAutopurge){const p=setTimeout(()=>{w(this,Ut).call(this,l)&&ce(this,ee,Ar).call(this,w(this,je)[l],"expire")},c+1);p.unref&&p.unref()}}),me(this,$r,l=>{n[l]=e[l]!==0?wo.now():0}),me(this,Zn,(l,c)=>{if(e[c]){const u=e[c],p=n[c];if(!u||!p)return;l.ttl=u,l.start=p,l.now=o||s();const f=l.now-p;l.remainingTTL=u-f}});let o=0;const s=()=>{const l=wo.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=w(this,st).get(l);if(c===void 0)return 0;const u=e[c],p=n[c];if(!u||!p)return 1/0;const f=(o||s())-p;return u-f},me(this,Ut,l=>{const c=n[l],u=e[l];return!!u&&!!c&&(o||s())-c>u})},$r=new WeakMap,Zn=new WeakMap,Pi=new WeakMap,Ut=new WeakMap,gm=function(){const e=new Rs(w(this,hn));me(this,gn,0),me(this,_n,e),me(this,Zr,n=>{me(this,gn,w(this,gn)-e[n]),e[n]=0}),me(this,Di,(n,o,s,l)=>{if(ce(this,ee,Ke).call(this,o))return 0;if(!yr(s))if(l){if(typeof l!="function")throw new TypeError("sizeCalculation must be a function");if(s=l(o,n),!yr(s))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 s}),me(this,So,(n,o,s)=>{if(e[n]=o,w(this,zt)){const l=w(this,zt)-e[n];for(;w(this,gn)>l;)ce(this,ee,Va).call(this,!0)}me(this,gn,w(this,gn)+e[n]),s&&(s.entrySize=o,s.totalCalculatedSize=w(this,gn))})},Zr=new WeakMap,So=new WeakMap,Di=new WeakMap,Vr=function*({allowStale:e=this.allowStale}={}){if(w(this,lt))for(let n=w(this,pt);!(!ce(this,ee,dd).call(this,n)||((e||!w(this,Ut).call(this,n))&&(yield n),n===w(this,bt)));)n=w(this,$t)[n]},Nr=function*({allowStale:e=this.allowStale}={}){if(w(this,lt))for(let n=w(this,bt);!(!ce(this,ee,dd).call(this,n)||((e||!w(this,Ut).call(this,n))&&(yield n),n===w(this,pt)));)n=w(this,Tt)[n]},dd=function(e){return e!==void 0&&w(this,st).get(w(this,je)[e])===e},Va=function(e){var l,c;const n=w(this,bt),o=w(this,je)[n],s=w(this,be)[n];return w(this,_r)&&ce(this,ee,Ke).call(this,s)?s.__abortController.abort(new Error("evicted")):(w(this,vn)||w(this,Bt))&&(w(this,vn)&&((l=w(this,fn))==null||l.call(this,s,o,"evict")),w(this,Bt)&&((c=w(this,ht))==null||c.push([s,o,"evict"]))),w(this,Zr).call(this,n),e&&(w(this,je)[n]=void 0,w(this,be)[n]=void 0,w(this,yn).push(n)),w(this,lt)===1?(me(this,bt,me(this,pt,0)),w(this,yn).length=0):me(this,bt,w(this,Tt)[n]),w(this,st).delete(o),Ba(this,lt)._--,n},Na=function(e,n,o,s){const l=n===void 0?void 0:w(this,be)[n];if(ce(this,ee,Ke).call(this,l))return l;const c=new Fs,{signal:u}=o;u==null||u.addEventListener("abort",()=>c.abort(u.reason),{signal:c.signal});const p={signal:c.signal,options:o,context:s},f=(I,G=!1)=>{const{aborted:v}=c.signal,R=o.ignoreFetchAbort&&I!==void 0;if(o.status&&(v&&!G?(o.status.fetchAborted=!0,o.status.fetchError=c.signal.reason,R&&(o.status.fetchAbortIgnored=!0)):o.status.fetchResolved=!0),v&&!R&&!G)return _(c.signal.reason);const L=S;return w(this,be)[n]===S&&(I===void 0?L.__staleWhileFetching?w(this,be)[n]=L.__staleWhileFetching:ce(this,ee,Ar).call(this,e,"fetch"):(o.status&&(o.status.fetchUpdated=!0),this.set(e,I,p.options))),I},m=I=>(o.status&&(o.status.fetchRejected=!0,o.status.fetchError=I),_(I)),_=I=>{const{aborted:G}=c.signal,v=G&&o.allowStaleOnFetchAbort,R=v||o.allowStaleOnFetchRejection,L=R||o.noDeleteOnFetchRejection,F=S;if(w(this,be)[n]===S&&(!L||F.__staleWhileFetching===void 0?ce(this,ee,Ar).call(this,e,"fetch"):v||(w(this,be)[n]=F.__staleWhileFetching)),R)return o.status&&F.__staleWhileFetching!==void 0&&(o.status.returnedStale=!0),F.__staleWhileFetching;if(F.__returned===F)throw I},x=(I,G)=>{var R;const v=(R=w(this,xo))==null?void 0:R.call(this,e,l,p);v&&v instanceof Promise&&v.then(L=>I(L===void 0?void 0:L),G),c.signal.addEventListener("abort",()=>{(!o.ignoreFetchAbort||o.allowStaleOnFetchAbort)&&(I(void 0),o.allowStaleOnFetchAbort&&(I=L=>f(L,!0)))})};o.status&&(o.status.fetchDispatched=!0);const S=new Promise(x).then(f,m),V=Object.assign(S,{__abortController:c,__staleWhileFetching:l,__returned:void 0});return n===void 0?(this.set(e,V,{...p.options,status:void 0}),n=w(this,st).get(e)):w(this,be)[n]=V,V},Ke=function(e){if(!w(this,_r))return!1;const n=e;return!!n&&n instanceof Promise&&n.hasOwnProperty("__staleWhileFetching")&&n.__abortController instanceof Fs},ud=function(e,n){w(this,$t)[n]=e,w(this,Tt)[e]=n},rs=function(e){e!==w(this,pt)&&(e===w(this,bt)?me(this,bt,w(this,Tt)[e]):ce(this,ee,ud).call(this,w(this,$t)[e],w(this,Tt)[e]),ce(this,ee,ud).call(this,w(this,pt),e),me(this,pt,e))},Ar=function(e,n){var s,l,c,u;let o=!1;if(w(this,lt)!==0){const p=w(this,st).get(e);if(p!==void 0)if(o=!0,w(this,lt)===1)ce(this,ee,pd).call(this,n);else{w(this,Zr).call(this,p);const f=w(this,be)[p];if(ce(this,ee,Ke).call(this,f)?f.__abortController.abort(new Error("deleted")):(w(this,vn)||w(this,Bt))&&(w(this,vn)&&((s=w(this,fn))==null||s.call(this,f,e,n)),w(this,Bt)&&((l=w(this,ht))==null||l.push([f,e,n]))),w(this,st).delete(e),w(this,je)[p]=void 0,w(this,be)[p]=void 0,p===w(this,pt))me(this,pt,w(this,$t)[p]);else if(p===w(this,bt))me(this,bt,w(this,Tt)[p]);else{const m=w(this,$t)[p];w(this,Tt)[m]=w(this,Tt)[p];const _=w(this,Tt)[p];w(this,$t)[_]=w(this,$t)[p]}Ba(this,lt)._--,w(this,yn).push(p)}}if(w(this,Bt)&&((c=w(this,ht))!=null&&c.length)){const p=w(this,ht);let f;for(;f=p==null?void 0:p.shift();)(u=w(this,mn))==null||u.call(this,...f)}return o},pd=function(e){var n,o,s;for(const l of ce(this,ee,Nr).call(this,{allowStale:!0})){const c=w(this,be)[l];if(ce(this,ee,Ke).call(this,c))c.__abortController.abort(new Error("deleted"));else{const u=w(this,je)[l];w(this,vn)&&((n=w(this,fn))==null||n.call(this,c,u,e)),w(this,Bt)&&((o=w(this,ht))==null||o.push([c,u,e]))}}if(w(this,st).clear(),w(this,be).fill(void 0),w(this,je).fill(void 0),w(this,Zt)&&w(this,Cn)&&(w(this,Zt).fill(0),w(this,Cn).fill(0)),w(this,_n)&&w(this,_n).fill(0),me(this,bt,0),me(this,pt,0),w(this,yn).length=0,me(this,gn,0),me(this,lt,0),w(this,Bt)&&w(this,ht)){const l=w(this,ht);let c;for(;c=l==null?void 0:l.shift();)(s=w(this,mn))==null||s.call(this,...c)}};let Ol=Gl;const ZB={cacheSize:15e6};class UB{constructor(e){$e(this,"_str");$e(this,"_rawJson");$e(this,"_zodSchema");$e(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 Ur=class Ur{constructor(e){$e(this,"fileDataCache");$e(this,"fileDataRefs",new Map);const n={...ZB,...e??{}};this.fileDataCache=new Ol({maxSize:n.cacheSize,fetchMethod:async o=>new UB(await Ug().blobDriver.getContent(o)),sizeCalculation:o=>o.bytes.length,dispose:(o,s)=>{this.fileDataRefs.delete(s)}})}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 s=await this.fileDataCache.fetch(e);o.value=s}catch(s){console.error(s)}})(),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 s,l;return n===void 0?(s=o==null?void 0:o.value)==null?void 0:s.rawJson:(l=o==null?void 0:o.value)==null?void 0:l.validatedJson(n)})}static getContentBytes(e){return Ur.globalInstance.getContentBytes(e)}static getContentString(e){return Ur.globalInstance.getContentString(e)}static getContentJson(e,n){return Ur.globalInstance.getContentJson(e,n)}};$e(Ur,"globalInstance",new Ur);let Ll=Ur;M.AgGridTheme=su,M.BlockLayout=RT,M.ContextProvider=vS,M.DataTable=av,M.DemoData=vT,M.DropdownListItem=co,M.LongText=bl,M.MultiError=Da,M.PlAccordion=Ex,M.PlAccordionSection=Rx,M.PlAgCellFile=cB,M.PlAgDataTable=oB,M.PlAgDataTableToolsPanel=tB,M.PlAgGridColumnManager=xp,M.PlAgOverlayLoading=gp,M.PlAgOverlayNoRows=yp,M.PlAgTextAndButtonCell=pB,M.PlAlert=Ov,M.PlBlockPage=kv,M.PlBtnAccent=nw,M.PlBtnDanger=ow,M.PlBtnGhost=po,M.PlBtnGroup=Au,M.PlBtnLink=lw,M.PlBtnPrimary=Cs,M.PlBtnSecondary=ml,M.PlBtnSplit=Jv,M.PlCheckbox=Rb,M.PlCheckboxGroup=Lb,M.PlChip=xl,M.PlContainer=Ev,M.PlDialogModal=Sl,M.PlDropdown=fo,M.PlDropdownLegacy=sb,M.PlDropdownLine=zu,M.PlDropdownMulti=Db,M.PlDropdownRef=R0,M.PlEditableTitle=Pw,M.PlFileDialog=qu,M.PlFileInput=dp,M.PlGrid=Pv,M.PlIcon16=ho,M.PlIcon24=pi,M.PlLogView=Zu,M.PlMaskIcon16=cn,M.PlMaskIcon24=Dt,M.PlNotificationAlert=up,M.PlNumberField=_b,M.PlProgressBar=ub,M.PlRow=Bv,M.PlSearchField=Iu,M.PlSectionSeparator=Uu,M.PlSlideModal=ws,M.PlSpacer=Vu,M.PlTableFilters=OB,M.PlTabs=vx,M.PlTextArea=m0,M.PlTextField=Ir,M.PlToggleSwitch=bs,M.PlTooltip=Ct,M.ReactiveFileContent=Ll,M.Scrollable=c1,M.Slider=pp,M.SliderRange=i1,M.SliderRangeTriple=jS,M.ThemeSwitcher=yv,M.UnresolvedError=Pa,M.ValueOrErrorsComponent=aB,M.activateAgGrid=iu,M.animate=xu,M.animateInfinite=pv,M.call=_u,M.computedResult=zB,M.createModel=La,M.debounce=ku,M.defineApp=M_,M.defineStore=GB,M.delay=Cu,M.detectOutside=g0,M.ensureError=Ma,M.eventListener=vl,M.formatZodError=Oa,M.getElementScrollPosition=Lu,M.identity=Ra,M.isDefined=Dm,M.isElementVisible=Ou,M.isJsonEqual=Fa,M.isZodError=Ia,M.listToOptions=hv,M.makeEaseInOut=uv,M.makeEaseOut=bu,M.maskIcons16=_T,M.maskIcons24=CT,M.normalizeListOptions=lr,M.notEmpty=dl,M.randomInt=wu,M.randomString=dv,M.requestTick=ul,M.scrollIntoView=hi,M.showContextMenu=al,M.throttle=Su,M.timeout=vu,M.unwrapOptionalResult=Pm,M.unwrapValueOrErrors=vd,M.useClickOutside=vs,M.useDraggable=MS,M.useEventListener=nt,M.useFormState=FS,M.useHover=gu,M.useInterval=DS,M.useLabelNotch=zn,M.useLocalStorage=Eu,M.useMouse=mu,M.useMouseCapture=ar,M.usePosition=uo,M.useQuery=RS,M.useResizeObserver=hp,M.useScroll=AS,M.useSdkPlugin=nl,M.useSortable=mp,M.useTheme=Bu,M.useWatchFetch=Bp,M.wrapOptionalResult=wd,M.wrapValueOrErrors=Am,Object.defineProperty(M,Symbol.toStringTag,{value:"Module"})});
91
+ }`;var De=vg(function(){return We(_,he+"return "+Y).apply(n,N)});if(De.source=Y,Nd(De))throw De;return De}function OL(s){return He(s).toLowerCase()}function LL(s){return He(s).toUpperCase()}function ML(s,a,u){if(s=He(s),s&&(u||a===n))return Tf(s);if(!s||!(a=Jt(a)))return s;var f=Vn(s),g=Vn(a),_=Nf(f,g),N=Af(f,g)+1;return Ir(f,_,N).join("")}function GL(s,a,u){if(s=He(s),s&&(u||a===n))return s.slice(0,Bf(s)+1);if(!s||!(a=Jt(a)))return s;var f=Vn(s),g=Af(f,Vn(a))+1;return Ir(f,0,g).join("")}function $L(s,a,u){if(s=He(s),s&&(u||a===n))return s.replace(Nc,"");if(!s||!(a=Jt(a)))return s;var f=Vn(s),g=Nf(f,Vn(a));return Ir(f,g).join("")}function zL(s,a){var u=G,f=z;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=He(s);var _=s.length;if(Lo(s)){var N=Vn(s);_=N.length}if(u>=_)return s;var B=u-Mo(f);if(B<1)return f;var I=N?Ir(N,0,B).join(""):s.slice(0,B);if(g===n)return I+f;if(N&&(B+=I.length-B),Ad(g)){if(s.slice(B).search(g)){var K,X=I;for(g.global||(g=Wc(g.source,He(qh.exec(g))+"g")),g.lastIndex=0;K=g.exec(X);)var Y=K.index;I=I.slice(0,Y===n?B:Y)}}else if(s.indexOf(Jt(g),B)!=B){var ie=I.lastIndexOf(g);ie>-1&&(I=I.slice(0,ie))}return I+f}function UL(s){return s=He(s),s&&eP.test(s)?s.replace(Wh,vR):s}var ZL=jo(function(s,a,u){return s+(u?" ":"")+a.toUpperCase()}),Pd=_m("toUpperCase");function yg(s,a,u){return s=He(s),a=u?n:a,a===n?hR(s)?wR(s):oR(s):s.match(a)||[]}var vg=Ie(function(s,a){try{return Xt(s,n,a)}catch(u){return Nd(u)?u:new Te(u)}}),WL=or(function(s,a){return rn(a,function(u){u=jn(u),nr(s,u,Ed(s[u],s))}),s});function jL(s){var a=s==null?0:s.length,u=ge();return s=a?tt(s,function(f){if(typeof f[1]!="function")throw new on(c);return[u(f[0]),f[1]]}):[],Ie(function(f){for(var g=-1;++g<a;){var _=s[g];if(Xt(_[0],this,f))return Xt(_[1],this,f)}})}function HL(s){return vD(an(s,y))}function Rd(s){return function(){return s}}function qL(s,a){return s==null||s!==s?a:s}var KL=wm(),XL=wm(!0);function zt(s){return s}function Dd(s){return Yf(typeof s=="function"?s:an(s,y))}function YL(s){return Qf(an(s,y))}function JL(s,a){return em(s,an(a,y))}var QL=Ie(function(s,a){return function(u){return is(u,s,a)}}),eM=Ie(function(s,a){return function(u){return is(s,u,a)}});function Id(s,a,u){var f=_t(a),g=Sa(a,f);u==null&&!(ot(a)&&(g.length||!f.length))&&(u=a,a=s,s=this,g=Sa(a,_t(a)));var _=!(ot(u)&&"chain"in u)||!!u.chain,N=sr(s);return rn(g,function(B){var I=a[B];s[B]=I,N&&(s.prototype[B]=function(){var K=this.__chain__;if(_||K){var X=s(this.__wrapped__),Y=X.__actions__=Mt(this.__actions__);return Y.push({func:I,args:arguments,thisArg:s}),X.__chain__=K,X}return I.apply(s,Ar([this.value()],arguments))})}),s}function tM(){return Ct._===this&&(Ct._=TR),this}function Fd(){}function nM(s){return s=Be(s),Ie(function(a){return tm(a,s)})}var rM=hd(tt),oM=hd(bf),iM=hd(Lc);function _g(s){return Cd(s)?Mc(jn(s)):ID(s)}function sM(s){return function(a){return s==null?n:oo(s,a)}}var aM=xm(),lM=xm(!0);function Od(){return[]}function Ld(){return!1}function cM(){return{}}function dM(){return""}function uM(){return!0}function pM(s,a){if(s=Be(s),s<1||s>q)return[];var u=ke,f=Tt(s,ke);a=ge(a),s-=ke;for(var g=zc(f,a);++u<s;)a(u);return g}function hM(s){return Ne(s)?tt(s,jn):Qt(s)?[s]:Mt(Mm(He(s)))}function fM(s){var a=++SR;return He(s)+a}var mM=Ba(function(s,a){return s+a},0),gM=fd("ceil"),yM=Ba(function(s,a){return s/a},1),vM=fd("floor");function _M(s){return s&&s.length?ka(s,zt,Qc):n}function CM(s,a){return s&&s.length?ka(s,ge(a,2),Qc):n}function wM(s){return Sf(s,zt)}function bM(s,a){return Sf(s,ge(a,2))}function xM(s){return s&&s.length?ka(s,zt,rd):n}function kM(s,a){return s&&s.length?ka(s,ge(a,2),rd):n}var SM=Ba(function(s,a){return s*a},1),EM=fd("round"),TM=Ba(function(s,a){return s-a},0);function NM(s){return s&&s.length?$c(s,zt):0}function AM(s,a){return s&&s.length?$c(s,ge(a,2)):0}return v.after=YF,v.ary=Xm,v.assign=LO,v.assignIn=dg,v.assignInWith=Za,v.assignWith=MO,v.at=GO,v.before=Ym,v.bind=Ed,v.bindAll=WL,v.bindKey=Jm,v.castArray=cO,v.chain=Hm,v.chunk=vI,v.compact=_I,v.concat=CI,v.cond=jL,v.conforms=HL,v.constant=Rd,v.countBy=NF,v.create=$O,v.curry=Qm,v.curryRight=eg,v.debounce=tg,v.defaults=zO,v.defaultsDeep=UO,v.defer=JF,v.delay=QF,v.difference=wI,v.differenceBy=bI,v.differenceWith=xI,v.drop=kI,v.dropRight=SI,v.dropRightWhile=EI,v.dropWhile=TI,v.fill=NI,v.filter=VF,v.flatMap=RF,v.flatMapDeep=DF,v.flatMapDepth=IF,v.flatten=Um,v.flattenDeep=AI,v.flattenDepth=VI,v.flip=eO,v.flow=KL,v.flowRight=XL,v.fromPairs=BI,v.functions=XO,v.functionsIn=YO,v.groupBy=FF,v.initial=RI,v.intersection=DI,v.intersectionBy=II,v.intersectionWith=FI,v.invert=QO,v.invertBy=eL,v.invokeMap=LF,v.iteratee=Dd,v.keyBy=MF,v.keys=_t,v.keysIn=$t,v.map=La,v.mapKeys=nL,v.mapValues=rL,v.matches=YL,v.matchesProperty=JL,v.memoize=Ga,v.merge=oL,v.mergeWith=ug,v.method=QL,v.methodOf=eM,v.mixin=Id,v.negate=$a,v.nthArg=nM,v.omit=iL,v.omitBy=sL,v.once=tO,v.orderBy=GF,v.over=rM,v.overArgs=nO,v.overEvery=oM,v.overSome=iM,v.partial=Td,v.partialRight=ng,v.partition=$F,v.pick=aL,v.pickBy=pg,v.property=_g,v.propertyOf=sM,v.pull=GI,v.pullAll=Wm,v.pullAllBy=$I,v.pullAllWith=zI,v.pullAt=UI,v.range=aM,v.rangeRight=lM,v.rearg=rO,v.reject=ZF,v.remove=ZI,v.rest=oO,v.reverse=kd,v.sampleSize=jF,v.set=cL,v.setWith=dL,v.shuffle=HF,v.slice=WI,v.sortBy=XF,v.sortedUniq=JI,v.sortedUniqBy=QI,v.split=RL,v.spread=iO,v.tail=eF,v.take=tF,v.takeRight=nF,v.takeRightWhile=rF,v.takeWhile=oF,v.tap=_F,v.throttle=sO,v.thru=Oa,v.toArray=ag,v.toPairs=hg,v.toPairsIn=fg,v.toPath=hM,v.toPlainObject=cg,v.transform=uL,v.unary=aO,v.union=iF,v.unionBy=sF,v.unionWith=aF,v.uniq=lF,v.uniqBy=cF,v.uniqWith=dF,v.unset=pL,v.unzip=Sd,v.unzipWith=jm,v.update=hL,v.updateWith=fL,v.values=Ko,v.valuesIn=mL,v.without=uF,v.words=yg,v.wrap=lO,v.xor=pF,v.xorBy=hF,v.xorWith=fF,v.zip=mF,v.zipObject=gF,v.zipObjectDeep=yF,v.zipWith=vF,v.entries=hg,v.entriesIn=fg,v.extend=dg,v.extendWith=Za,Id(v,v),v.add=mM,v.attempt=vg,v.camelCase=_L,v.capitalize=mg,v.ceil=gM,v.clamp=gL,v.clone=dO,v.cloneDeep=pO,v.cloneDeepWith=hO,v.cloneWith=uO,v.conformsTo=fO,v.deburr=gg,v.defaultTo=qL,v.divide=yM,v.endsWith=CL,v.eq=Pn,v.escape=wL,v.escapeRegExp=bL,v.every=AF,v.find=BF,v.findIndex=$m,v.findKey=ZO,v.findLast=PF,v.findLastIndex=zm,v.findLastKey=WO,v.floor=vM,v.forEach=qm,v.forEachRight=Km,v.forIn=jO,v.forInRight=HO,v.forOwn=qO,v.forOwnRight=KO,v.get=Vd,v.gt=mO,v.gte=gO,v.has=JO,v.hasIn=Bd,v.head=Zm,v.identity=zt,v.includes=OF,v.indexOf=PI,v.inRange=yL,v.invoke=tL,v.isArguments=ao,v.isArray=Ne,v.isArrayBuffer=yO,v.isArrayLike=Gt,v.isArrayLikeObject=at,v.isBoolean=vO,v.isBuffer=Fr,v.isDate=_O,v.isElement=CO,v.isEmpty=wO,v.isEqual=bO,v.isEqualWith=xO,v.isError=Nd,v.isFinite=kO,v.isFunction=sr,v.isInteger=rg,v.isLength=za,v.isMap=og,v.isMatch=SO,v.isMatchWith=EO,v.isNaN=TO,v.isNative=NO,v.isNil=VO,v.isNull=AO,v.isNumber=ig,v.isObject=ot,v.isObjectLike=it,v.isPlainObject=us,v.isRegExp=Ad,v.isSafeInteger=BO,v.isSet=sg,v.isString=Ua,v.isSymbol=Qt,v.isTypedArray=qo,v.isUndefined=PO,v.isWeakMap=RO,v.isWeakSet=DO,v.join=OI,v.kebabCase=xL,v.last=cn,v.lastIndexOf=LI,v.lowerCase=kL,v.lowerFirst=SL,v.lt=IO,v.lte=FO,v.max=_M,v.maxBy=CM,v.mean=wM,v.meanBy=bM,v.min=xM,v.minBy=kM,v.stubArray=Od,v.stubFalse=Ld,v.stubObject=cM,v.stubString=dM,v.stubTrue=uM,v.multiply=SM,v.nth=MI,v.noConflict=tM,v.noop=Fd,v.now=Ma,v.pad=EL,v.padEnd=TL,v.padStart=NL,v.parseInt=AL,v.random=vL,v.reduce=zF,v.reduceRight=UF,v.repeat=VL,v.replace=BL,v.result=lL,v.round=EM,v.runInContext=P,v.sample=WF,v.size=qF,v.snakeCase=PL,v.some=KF,v.sortedIndex=jI,v.sortedIndexBy=HI,v.sortedIndexOf=qI,v.sortedLastIndex=KI,v.sortedLastIndexBy=XI,v.sortedLastIndexOf=YI,v.startCase=DL,v.startsWith=IL,v.subtract=TM,v.sum=NM,v.sumBy=AM,v.template=FL,v.times=pM,v.toFinite=ar,v.toInteger=Be,v.toLength=lg,v.toLower=OL,v.toNumber=dn,v.toSafeInteger=OO,v.toString=He,v.toUpper=LL,v.trim=ML,v.trimEnd=GL,v.trimStart=$L,v.truncate=zL,v.unescape=UL,v.uniqueId=fM,v.upperCase=ZL,v.upperFirst=Pd,v.each=qm,v.eachRight=Km,v.first=Zm,Id(v,function(){var s={};return Zn(v,function(a,u){qe.call(v.prototype,u)||(s[u]=a)}),s}(),{chain:!1}),v.VERSION=o,rn(["bind","bindKey","curry","curryRight","partial","partialRight"],function(s){v[s].placeholder=v}),rn(["drop","take"],function(s,a){Oe.prototype[s]=function(u){u=u===n?1:mt(Be(u),0);var f=this.__filtered__&&!a?new Oe(this):this.clone();return f.__filtered__?f.__takeCount__=Tt(u,f.__takeCount__):f.__views__.push({size:Tt(u,ke),type:s+(f.__dir__<0?"Right":"")}),f},Oe.prototype[s+"Right"]=function(u){return this.reverse()[s](u).reverse()}}),rn(["filter","map","takeWhile"],function(s,a){var u=a+1,f=u==C||u==M;Oe.prototype[s]=function(g){var _=this.clone();return _.__iteratees__.push({iteratee:ge(g,3),type:u}),_.__filtered__=_.__filtered__||f,_}}),rn(["head","last"],function(s,a){var u="take"+(a?"Right":"");Oe.prototype[s]=function(){return this[u](1).value()[0]}}),rn(["initial","tail"],function(s,a){var u="drop"+(a?"":"Right");Oe.prototype[s]=function(){return this.__filtered__?new Oe(this):this[u](1)}}),Oe.prototype.compact=function(){return this.filter(zt)},Oe.prototype.find=function(s){return this.filter(s).head()},Oe.prototype.findLast=function(s){return this.reverse().find(s)},Oe.prototype.invokeMap=Ie(function(s,a){return typeof s=="function"?new Oe(this):this.map(function(u){return is(u,s,a)})}),Oe.prototype.reject=function(s){return this.filter($a(ge(s)))},Oe.prototype.slice=function(s,a){s=Be(s);var u=this;return u.__filtered__&&(s>0||a<0)?new Oe(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)},Oe.prototype.takeRightWhile=function(s){return this.reverse().takeWhile(s).reverse()},Oe.prototype.toArray=function(){return this.take(ke)},Zn(Oe.prototype,function(s,a){var u=/^(?:filter|find|map|reject)|While$/.test(a),f=/^(?:head|last)$/.test(a),g=v[f?"take"+(a=="last"?"Right":""):a],_=f||/^find/.test(a);g&&(v.prototype[a]=function(){var N=this.__wrapped__,B=f?[1]:arguments,I=N instanceof Oe,K=B[0],X=I||Ne(N),Y=function(Fe){var Le=g.apply(v,Ar([Fe],B));return f&&ie?Le[0]:Le};X&&u&&typeof K=="function"&&K.length!=1&&(I=X=!1);var ie=this.__chain__,he=!!this.__actions__.length,ve=_&&!ie,De=I&&!he;if(!_&&X){N=De?N:new Oe(this);var _e=s.apply(N,B);return _e.__actions__.push({func:Oa,args:[Y],thisArg:n}),new sn(_e,ie)}return ve&&De?s.apply(this,B):(_e=this.thru(Y),ve?f?_e.value()[0]:_e.value():_e)})}),rn(["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);v.prototype[s]=function(){var g=arguments;if(f&&!this.__chain__){var _=this.value();return a.apply(Ne(_)?_:[],g)}return this[u](function(N){return a.apply(Ne(N)?N:[],g)})}}),Zn(Oe.prototype,function(s,a){var u=v[a];if(u){var f=u.name+"";qe.call(Uo,f)||(Uo[f]=[]),Uo[f].push({name:a,func:u})}}),Uo[Va(n,b).name]=[{name:"wrapper",func:n}],Oe.prototype.clone=UR,Oe.prototype.reverse=ZR,Oe.prototype.value=WR,v.prototype.at=CF,v.prototype.chain=wF,v.prototype.commit=bF,v.prototype.next=xF,v.prototype.plant=SF,v.prototype.reverse=EF,v.prototype.toJSON=v.prototype.valueOf=v.prototype.value=TF,v.prototype.first=v.prototype.head,Ji&&(v.prototype[Ji]=kF),v},Go=bR();Qr?((Qr.exports=Go)._=Go,Dc._=Go):Ct._=Go}).call(Xo)}($s,$s.exports);var ze=$s.exports;const $N={class:"grid-overlay-container"},Kp=r.defineComponent({__name:"PlAgOverlayLoading",props:{params:{}},setup(t){return(e,n)=>(r.openBlock(),r.createElementBlock("div",$N,[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))]))}}),zN={},UN={class:"grid-overlay-container"};function ZN(t,e){return r.openBlock(),r.createElementBlock("div",UN,e[0]||(e[0]=[r.createElementVNode("div",{class:"grid-icon-sad-cat"},null,-1),r.createElementVNode("span",{class:"text-subtitle-m"},"Empty",-1)]))}const Xp=Xl(zN,[["render",ZN]]);async function WN(t,e){throw Error("not implemented")}function jN(t){return t.axesSpec.filter(e=>{var n;return((n=e.annotations)==null?void 0:n["pl7.app/axisNature"])==="heterogeneous"})}function HN(t,e){const n=[];for(const o of e)if(t[o].type==="column"){const i=jN(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 Yp=(t,e)=>(t+e).toString();function qN(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 x=o[d].data.filter(w=>w!==null);return Array.from(new Set(x))})();h.sort(),p>d?(n.splice(p,1),n.splice(d,1)):(n.splice(d,1),n.splice(p,1));const m=KN(i,o,d,p,h,e.rows);for(let y=0;y<h.length;++y){const x=h[y],w=Gr(x+"@"+y);n.push({colId:w,field:Yp(o.length,y),headerName:x,valueFormatter:Qp})}return{rowModelType:"clientSide",columnDefs:n,rowData:m}}function KN(t,e,n,o,i,l){const c=new Map;let d=0;for(let h=0;h<l;h++){const m={};for(let O=0;O<e.length;++O){if(O===n||O===o)continue;const $=t[O].toString();m[$]=e[O].data[h]}let y;const x=Gr(Object.values(m))??"";c.has(x)?y=c.get(x):(c.set(x,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 E=Yp(e.length,w);y[E]=e[o].data[h]}return Array.from(c.values())}function XN(t){return Gr(t)}function Jp(t){return JSON.parse(t)}const Qp=t=>t?t.value===void 0?"NULL":t.value===null?"NA":t.value.toString():"ERROR";function YN(t,e,n){var i,l,c;const o=XN(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:Qp,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 eh(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 th(t){const e=[];return bs(t,n=>(e.push(n),n)),e}async function JN(t,e,n){return n.length?(await t.findColumns(e,{columnFilter:{name:["pl7.app/label"]},compatibleWith:ze.uniqWith(n.map(i=>fu(i.spec.axesSpec).map(ze.cloneDeep)).flat(),ze.isEqual),strictlyCompatible:!0})).hits.filter(i=>i.spec.axesSpec.length===1):[]}async function QN(t,e,n){const o=th(n),l=(await JN(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 eA(t,e,n,o){const i=n.filter(m=>m.type!=="Bytes"),l=th(o),c=i.map(m=>[]),d=i.map(m=>null);for(let m=0;m<l.length;++m){const y=fu(l[m].spec.axesSpec);for(let x=0;x<y.length;++x){const w=ze.findIndex(i,E=>ze.isEqual(E,y[x]));w===-1||d[w]||(y.length===1&&l[m].spec.name==="pl7.app/label"?(c[w]=[[m,x]],d[w]=l[m].columnId):c[w].push([m,x]))}}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,x]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 E=w.values.type;for(const O of w.values.data)if(!(hu(O,E)||O===null)&&(h[m].add(eh(O,E)),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 x=[...h[y]].map(E=>({value:E,label:E.toString()})),w=x[0].value;return{axis:ze.cloneDeep(m),...d[y]&&{column:d[y]},options:x,defaultValue:w}})}function tA(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(),x=e[m].data[c],w=e[m].type;jy(e[m].absent,c)?h[y]=void 0:hu(x,w)||x===null?h[y]=null:h[y]=eh(x,w)}l.push(h)}return l}const nA=t=>t.type==="column"&&t.spec.axesSpec.length===1&&t.spec.name==="pl7.app/label";async function rA(t,e,n,o){const i=await t.getSpec(e);let l=i.findIndex(b=>b.type==="column");l===-1&&(l=i.length);const c=[...i.keys()].filter(b=>!ze.find(n,R=>ze.isEqual(R.axis,i[b].id)||ze.isEqual(R.column,i[b].id))).sort((b,R)=>{var V,Z;if(i[b].type!==i[R].type)return i[b].type==="axis"?-1:1;const F=(V=i[b].spec.annotations)==null?void 0:V["pl7.app/table/orderPriority"],D=(Z=i[R].spec.annotations)==null?void 0:Z["pl7.app/table/orderPriority"];return F===void 0?D===void 0?0:1:D===void 0?-1:Number(D)-Number(F)}),d=ze.cloneDeep(c),p=HN(i,c);for(let b=c.length-1;b>=0;--b){const R=c[b];if(!nA(i[R]))continue;const F=cl(i[R].spec.axesSpec[0]),D=ze.findIndex(c,V=>ze.isEqual(i[V].id,F));if(D===-1&&ze.findIndex(n,Z=>ze.isEqual(Z.axis,F))===-1){console.warn(`added label column, but the axis is not in the data; axisId: ${F}`);continue}c[D]=R;for(const V of p)V.axisIdx===R&&(V.axisIdx=D);c.splice(b,1),d.splice(b,1)}const h=await t.getShape(e),m=h.rows,y=d.map(b=>YN(b,i[b],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 qN(p,h,y,await t.getData(e,c),d,c);const x=[...c],w=new Map;for(let b=0;b<l;++b)w.set(b,-1);for(let b=0;b<x.length;++b){const R=x[b];w.has(R)&&w.set(R,b)}for(const[b,R]of w)R===-1&&(w.set(b,x.length),x.push(b));const E=[];for(let b=0;b<l;++b){const R=w.get(b);if(R===void 0||R===-1)throw new Error("assertion exception");E.push(R)}let O;return{rowModelType:"serverSide",columnDefs:y,serverSideDatasource:{getRows:async b=>{try{if(m==0){b.success({rowData:[],rowCount:m}),b.api.setGridOption("loading",!1),b.api.showNoRowsOverlay();return}if(O&&!ze.isEqual(O.request.sortModel,b.request.sortModel)){O=void 0,b.api.setGridOption("loading",!0),b.success({rowData:[],rowCount:0});return}O=b;let R=0,F=[];if(m>0&&b.request.startRow!==void 0&&b.request.endRow!==void 0&&(R=Math.min(m,b.request.endRow)-b.request.startRow,R>0)){const D=await t.getData(e,x,{offset:b.request.startRow,length:R});F=tA(d,D,E,b.request.startRow)}b.success({rowData:F,rowCount:m}),b.api.autoSizeAllColumns(),b.api.setGridOption("loading",!1)}catch(R){b.api.setGridOption("loading",!0),b.fail(),console.trace(R)}}}}}const Yl=Rg(),oA=["onClick"],nh=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);qp(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(Yl)}`},[r.createVNode(r.unref(_o),{onClick:h[0]||(h[0]=r.withModifiers(m=>l.value=!l.value,["stop"]))},{append:r.withCtx(()=>[r.createVNode(r.unref(Lt),{name:"columns"})]),default:r.withCtx(()=>[h[2]||(h[2]=r.createTextVNode(" Columns "))]),_:1})],8,["to"])),r.createVNode(r.unref(Vs),{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(fn),{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(xt),{"close-delay":500,position:"top"},{tooltip:r.withCtx(()=>h[4]||(h[4]=[r.createTextVNode("Show/Hide")])),default:r.withCtx(()=>[r.createVNode(r.unref(Lt),{name:m.isVisible()?"view-show":"view-hide"},null,8,["name"])]),_:2},1024)],8,oA)]))),128))]))]),_:1},8,["modelValue"])]))}}),iA=["id"],sA=r.defineComponent({__name:"PlAgDataTableToolsPanel",setup(t){return(e,n)=>(r.openBlock(),r.createElementBlock("div",{id:r.unref(Yl),class:"d-flex gap-6"},[r.renderSlot(e.$slots,"default")],8,iA))}}),aA={class:"ap-ag-data-table-container"},lA={key:1,class:"ap-ag-data-table-sheets"},cA=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([hs.ClientSideRowModelModule,Wd.ClipboardModule,Zd.ServerSideRowModelModule,jd.RangeSelectionModule,hl,Ou]);const o=r.useModel(t,"modelValue"),i=t,{settings:l}=r.toRefs(i),c=n;r.watch(()=>l.value,async(A,C)=>{if(A.sourceType!=="pframe"||!A.pFrame||!A.join||C&&C.sourceType==="pframe"&&ze.isEqual(A.pFrame,C.pFrame)&&ze.isEqual(A.join,C.join))return;const k=window.platforma;if(!k)throw Error("platforma not set");const M=k.pFrameDriver;if(!M)throw Error("platforma.pFrameDriver not set");const W=await QN(M,A.pFrame,A.join),q=o.value;q.pTableParams||(q.pTableParams={sorting:[],filters:[]}),q.pTableParams.join=W,o.value=q});const d=Ih(()=>l.value.sourceType,async A=>{var k;const C=l.value.sourceType;switch(C){case"pframe":{const M=window.platforma;if(!M)throw Error("platforma not set");const W=M.pFrameDriver;if(!W)throw Error("platforma.pFrameDriver not set");if(!l.value.pFrame)return[];const q=l.value.pFrame,re=(k=o.value.pTableParams)==null?void 0:k.join;return re?await eA(W,q,l.value.sheetAxes,re):[]}case"ptable":return l.value.sheets??[];case"xsv":return[];default:throw Error(`unsupported source type: ${C}`)}});function p(A){if(!(l.value.sourceType!=="ptable"&&l.value.sourceType!=="pframe"))return(A==null?void 0:A.sortModel.map(C=>{const{spec:k,...M}=Jp(C.colId);return{column:M,ascending:C.sort==="asc",naAndAbsentAreLeastValues:!0}}))??[]}const h=r.computed({get:()=>{const A=o.value;return{columnOrder:A.gridState.columnOrder,sort:A.gridState.sort,columnVisibility:A.gridState.columnVisibility}},set:A=>{const C=o.value,k=E.value.rowModelType==="clientSide"?void 0:p(A.sort);C.gridState={...C.gridState,...A},(l.value.sourceType==="ptable"||l.value.sourceType==="pframe")&&(C.pTableParams||(C.pTableParams={sorting:[],filters:[]}),C.pTableParams.sorting=k),o.value=C}}),m=A=>Gr(A);function y(A){var C;if(!(l.value.sourceType!=="ptable"&&l.value.sourceType!=="pframe"))return((C=d.value)==null?void 0:C.map(k=>({type:"bySingleColumnV2",column:k.column?{type:"column",id:k.column}:{type:"axis",id:k.axis},predicate:{operator:"Equal",reference:A[m(k.axis)]}})))??[]}const x=r.computed({get:()=>o.value.gridState.sheets??{},set:A=>{const C=y(A),k=o.value;k.gridState.sheets=A,(l.value.sourceType==="ptable"||l.value.sourceType==="pframe")&&(k.pTableParams||(k.pTableParams={sorting:[],filters:[]}),k.pTableParams.filters=C),o.value=k}});r.watch(()=>[l.value,d.value],(A,C)=>{const[k,M]=A;if(!M)return;if(C){const[q,re]=C;if((k.sourceType==="ptable"||k.sourceType==="pframe")&&k.sourceType===(q==null?void 0:q.sourceType)&&ze.isEqual(M,re))return}if(k.sourceType!=="ptable"&&k.sourceType!=="pframe"){x.value={};return}const W=x.value;for(const q of M){const re=m(q.axis);W[re]||(W[re]=q.defaultValue??q.options[0].value)}x.value=W},{immediate:!0});const w=r.shallowRef(),E=r.shallowRef({animateRows:!1,suppressColumnMoveAnimation:!0,cellSelection:!0,initialState:h.value,autoSizeStrategy:{type:"fitCellContents"},onRowDataUpdated:A=>{A.api.autoSizeAllColumns()},onRowDoubleClicked:A=>{A.data&&c("onRowDoubleClicked",A.data.key)},defaultColDef:{suppressHeaderMenuButton:!0},maintainColumnOrder:!0,localeText:{loadingError:"..."},rowModelType:"clientSide",maxBlocksInCache:1e3,cacheBlockSize:100,blockLoadDebounceMillis:500,serverSideSortAllLevels:!0,suppressServerSideFullWidthLoadingRow:!0,getRowId:A=>A.data.id,loading:!0,loadingOverlayComponentParams:{notReady:!0},loadingOverlayComponent:Kp,noRowsOverlayComponent:Xp,sideBar:{},defaultCsvExportParams:{allColumns:!0,suppressQuotes:!0,fileName:"table.csv"}}),O=A=>{const C=A.api;w.value=new Proxy(C,{get(k,M,W){switch(M){case"setGridOption":return(q,re)=>{const ue=E.value;ue[q]=re,E.value=ue,C.setGridOption(q,re)};case"updateGridOptions":return q=>{E.value={...E.value,...q},C.updateGridOptions(q)};default:return Reflect.get(k,M,W)}}})},$=A=>({columnOrder:A.columnOrder,sort:A.sort,columnVisibility:A.columnVisibility??(A.columnOrder?{hiddenColIds:[]}:void 0)}),b=A=>{E.value.initialState=h.value=$(A.state),A.api.autoSizeAllColumns()},R=()=>{E.value.initialState=h.value=$(w.value.getState()),w.value=void 0};let F=!1;const D=()=>{if(!F)return;const A=w.value;A!==void 0&&(A.exportDataAsCsv(),F=!1,A.setGridOption("cacheBlockSize",100))},V=()=>{if(!F)return;const A=w.value;if(A===void 0)return;const C=A.getServerSideGroupLevelState()[0];C.cacheBlockSize===C.rowCount&&A.refreshServerSide({route:C.route,purge:!1})};e({exportCsv:async()=>{const A=w.value;if(A!==void 0){if(E.value.rowModelType==="clientSide"){A.exportDataAsCsv();return}if(E.value.rowModelType==="serverSide"){const C=A.getServerSideGroupLevelState()[0];if(C.rowCount<=C.cacheBlockSize){A.exportDataAsCsv();return}F||(F=!0,A.setGridOption("cacheBlockSize",C.rowCount))}}}});const ne=r.ref(0);r.watch(()=>[w.value,h.value],(A,C)=>{if(ze.isEqual(A,C))return;const[k,M]=A;if(!k)return;const W=$(k.getState());ze.isEqual(M,W)||(E.value.initialState=M,++ne.value)}),r.watch(()=>E.value,(A,C)=>{var k;if(C&&(A.rowModelType!=C.rowModelType&&++ne.value,!ze.isEqual(A.columnDefs,C.columnDefs)&&A.columnDefs)){const M=re=>!("children"in re),W=(k=A.columnDefs)==null?void 0:k.filter(M),q=W==null?void 0:W.map(re=>re.colId).filter(re=>re!==void 0).map(re=>Jp(re));c("columnsChanged",q??[])}});const H=(A,C)=>{var M;const k=x.value;k[A]!==C&&(k[A]=C,x.value=k,(M=w.value)==null||M.updateGridOptions({loading:!0,loadingOverlayComponentParams:{notReady:!1}}))},J=window.platforma;if(!J)throw Error("platforma not set");const G=J.pFrameDriver;if(!G)throw Error("platforma.pFrameDriver not set");const z=J.blobDriver;if(!z)throw Error("platforma.blobDriver not set");let Q;return r.watch(()=>[w.value,l.value,d.value],async A=>{var q,re;const[C,k,M]=A;if(!C||ze.isEqual(k,Q))return;Q=k;const W=k.sourceType;switch(W){case"pframe":case"ptable":{const ue=k.pTable;if(!ue||!M)return C.updateGridOptions({loading:!0,loadingOverlayComponentParams:{notReady:!0},columnDefs:[]});const ke=(re=(q=h.value)==null?void 0:q.columnVisibility)==null?void 0:re.hiddenColIds,Se=await rA(G,ue,M,ke);return C.updateGridOptions({loading:Se.rowModelType!=="clientSide",loadingOverlayComponentParams:{notReady:!1},...Se})}case"xsv":{const ue=k.xsvFile;if(!(ue!=null&&ue.ok)||!ue.value)return C.updateGridOptions({loading:!0,loadingOverlayComponentParams:{notReady:!0},columnDefs:[]});const ke=await WN(z,ue.value);return C.updateGridOptions({loading:!0,loadingOverlayComponentParams:{notReady:!1},...ke})}default:throw Error(`unsupported source type: ${W}`)}}),(A,C)=>(r.openBlock(),r.createElementBlock("div",aA,[w.value&&A.showColumnsPanel?(r.openBlock(),r.createBlock(r.unref(nh),{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",lA,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(d).value,(k,M)=>(r.openBlock(),r.createBlock(r.unref(Cp),{key:M,"model-value":x.value[m(k.axis)],options:k.options,"onUpdate:modelValue":W=>H(m(k.axis),W)},null,8,["model-value","options","onUpdate:modelValue"]))),128))])):r.createCommentVNode("",!0),(r.openBlock(),r.createBlock(r.unref(Ag.AgGridVue),{key:ne.value,theme:r.unref(Mu),class:"ap-ag-data-table-grid","grid-options":E.value,onGridReady:O,onStateUpdated:b,onGridPreDestroyed:R,onStoreRefreshed:D,onModelUpdated:V},null,8,["theme","grid-options"]))]))}}),[["__scopeId","data-v-ea0278e4"]]),dA={key:1,class:"alert-error"},uA={key:2},pA=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",dA,r.toDisplayString(o.value),1)):r.createCommentVNode("",!0),i.value?(r.openBlock(),r.createElementBlock("div",uA,"Unresolved")):r.createCommentVNode("",!0)]))}}),hA={style:{height:"100%"}},fA=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",hA,[r.createVNode(r.unref(Up),{"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"])]))}}),mA={class:"pl-ag-grid-open-cell d-flex"},gA={class:"pl-ag-grid-open-cell__value"},yA=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",mA,[r.createElementVNode("div",gA,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(fn),{name:o.params.icon??"maximize"},null,8,["name"]),r.createTextVNode(" "+r.toDisplayString(o.params.btnLabel??"Open"),1)])]))}});var Jl={exports:{}};const vA="2.0.0",rh=256,_A=Number.MAX_SAFE_INTEGER||9007199254740991,CA=16,wA=rh-6;var zs={MAX_LENGTH:rh,MAX_SAFE_COMPONENT_LENGTH:CA,MAX_SAFE_BUILD_LENGTH:wA,MAX_SAFE_INTEGER:_A,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:vA,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-]",x=[["\\s",1],["\\d",i],[y,o]],w=O=>{for(const[$,b]of x)O=O.split(`${$}*`).join(`${$}{0,${b}}`).split(`${$}+`).join(`${$}{1,${b}}`);return O},E=(O,$,b)=>{const R=w($),F=m++;l(O,F,$),h[O]=F,p[F]=$,c[F]=new RegExp($,b?"g":void 0),d[F]=new RegExp(R,b?"g":void 0)};E("NUMERICIDENTIFIER","0|[1-9]\\d*"),E("NUMERICIDENTIFIERLOOSE","\\d+"),E("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${y}*`),E("MAINVERSION",`(${p[h.NUMERICIDENTIFIER]})\\.(${p[h.NUMERICIDENTIFIER]})\\.(${p[h.NUMERICIDENTIFIER]})`),E("MAINVERSIONLOOSE",`(${p[h.NUMERICIDENTIFIERLOOSE]})\\.(${p[h.NUMERICIDENTIFIERLOOSE]})\\.(${p[h.NUMERICIDENTIFIERLOOSE]})`),E("PRERELEASEIDENTIFIER",`(?:${p[h.NUMERICIDENTIFIER]}|${p[h.NONNUMERICIDENTIFIER]})`),E("PRERELEASEIDENTIFIERLOOSE",`(?:${p[h.NUMERICIDENTIFIERLOOSE]}|${p[h.NONNUMERICIDENTIFIER]})`),E("PRERELEASE",`(?:-(${p[h.PRERELEASEIDENTIFIER]}(?:\\.${p[h.PRERELEASEIDENTIFIER]})*))`),E("PRERELEASELOOSE",`(?:-?(${p[h.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${p[h.PRERELEASEIDENTIFIERLOOSE]})*))`),E("BUILDIDENTIFIER",`${y}+`),E("BUILD",`(?:\\+(${p[h.BUILDIDENTIFIER]}(?:\\.${p[h.BUILDIDENTIFIER]})*))`),E("FULLPLAIN",`v?${p[h.MAINVERSION]}${p[h.PRERELEASE]}?${p[h.BUILD]}?`),E("FULL",`^${p[h.FULLPLAIN]}$`),E("LOOSEPLAIN",`[v=\\s]*${p[h.MAINVERSIONLOOSE]}${p[h.PRERELEASELOOSE]}?${p[h.BUILD]}?`),E("LOOSE",`^${p[h.LOOSEPLAIN]}$`),E("GTLT","((?:<|>)?=?)"),E("XRANGEIDENTIFIERLOOSE",`${p[h.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),E("XRANGEIDENTIFIER",`${p[h.NUMERICIDENTIFIER]}|x|X|\\*`),E("XRANGEPLAIN",`[v=\\s]*(${p[h.XRANGEIDENTIFIER]})(?:\\.(${p[h.XRANGEIDENTIFIER]})(?:\\.(${p[h.XRANGEIDENTIFIER]})(?:${p[h.PRERELEASE]})?${p[h.BUILD]}?)?)?`),E("XRANGEPLAINLOOSE",`[v=\\s]*(${p[h.XRANGEIDENTIFIERLOOSE]})(?:\\.(${p[h.XRANGEIDENTIFIERLOOSE]})(?:\\.(${p[h.XRANGEIDENTIFIERLOOSE]})(?:${p[h.PRERELEASELOOSE]})?${p[h.BUILD]}?)?)?`),E("XRANGE",`^${p[h.GTLT]}\\s*${p[h.XRANGEPLAIN]}$`),E("XRANGELOOSE",`^${p[h.GTLT]}\\s*${p[h.XRANGEPLAINLOOSE]}$`),E("COERCEPLAIN",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?`),E("COERCE",`${p[h.COERCEPLAIN]}(?:$|[^\\d])`),E("COERCEFULL",p[h.COERCEPLAIN]+`(?:${p[h.PRERELEASE]})?(?:${p[h.BUILD]})?(?:$|[^\\d])`),E("COERCERTL",p[h.COERCE],!0),E("COERCERTLFULL",p[h.COERCEFULL],!0),E("LONETILDE","(?:~>?)"),E("TILDETRIM",`(\\s*)${p[h.LONETILDE]}\\s+`,!0),e.tildeTrimReplace="$1~",E("TILDE",`^${p[h.LONETILDE]}${p[h.XRANGEPLAIN]}$`),E("TILDELOOSE",`^${p[h.LONETILDE]}${p[h.XRANGEPLAINLOOSE]}$`),E("LONECARET","(?:\\^)"),E("CARETTRIM",`(\\s*)${p[h.LONECARET]}\\s+`,!0),e.caretTrimReplace="$1^",E("CARET",`^${p[h.LONECARET]}${p[h.XRANGEPLAIN]}$`),E("CARETLOOSE",`^${p[h.LONECARET]}${p[h.XRANGEPLAINLOOSE]}$`),E("COMPARATORLOOSE",`^${p[h.GTLT]}\\s*(${p[h.LOOSEPLAIN]})$|^$`),E("COMPARATOR",`^${p[h.GTLT]}\\s*(${p[h.FULLPLAIN]})$|^$`),E("COMPARATORTRIM",`(\\s*)${p[h.GTLT]}\\s*(${p[h.LOOSEPLAIN]}|${p[h.XRANGEPLAIN]})`,!0),e.comparatorTrimReplace="$1$2$3",E("HYPHENRANGE",`^\\s*(${p[h.XRANGEPLAIN]})\\s+-\\s+(${p[h.XRANGEPLAIN]})\\s*$`),E("HYPHENRANGELOOSE",`^\\s*(${p[h.XRANGEPLAINLOOSE]})\\s+-\\s+(${p[h.XRANGEPLAINLOOSE]})\\s*$`),E("STAR","(<|>)?=?\\s*\\*"),E("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),E("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(Jl,Jl.exports);var Gi=Jl.exports;const bA=Object.freeze({loose:!0}),xA=Object.freeze({});var Ql=t=>t?typeof t!="object"?bA:t:xA;const oh=/^[0-9]+$/,ih=(t,e)=>{const n=oh.test(t),o=oh.test(e);return n&&o&&(t=+t,e=+e),t===e?0:n&&!o?-1:o&&!n?1:t<e?-1:1};var sh={compareIdentifiers:ih,rcompareIdentifiers:(t,e)=>ih(e,t)};const Zs=Us,{MAX_LENGTH:ah,MAX_SAFE_INTEGER:Ws}=zs,{safeRe:lh,t:ch}=Gi,kA=Ql,{compareIdentifiers:No}=sh;var Bt=class Hn{constructor(e,n){if(n=kA(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>ah)throw new TypeError(`version is longer than ${ah} characters`);Zs("SemVer",e,n),this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease;const o=e.trim().match(n.loose?lh[ch.LOOSE]:lh[ch.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)),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(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 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(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 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 dh=Bt;var Ao=(t,e,n=!1)=>{if(t instanceof dh)return t;try{return new dh(t,e)}catch(o){if(!n)return null;throw o}};const SA=Ao;var EA=(t,e)=>{const n=SA(t,e);return n?n.version:null};const TA=Ao;var NA=(t,e)=>{const n=TA(t.trim().replace(/^[=v]+/,""),e);return n?n.version:null};const uh=Bt;var AA=(t,e,n,o,i)=>{typeof n=="string"&&(i=o,o=n,n=void 0);try{return new uh(t instanceof uh?t.version:t,n).inc(e,o,i).version}catch{return null}};const ph=Ao;var VA=(t,e)=>{const n=ph(t,null,!0),o=ph(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 BA=Bt;var PA=(t,e)=>new BA(t,e).major;const RA=Bt;var DA=(t,e)=>new RA(t,e).minor;const IA=Bt;var FA=(t,e)=>new IA(t,e).patch;const OA=Ao;var LA=(t,e)=>{const n=OA(t,e);return n&&n.prerelease.length?n.prerelease:null};const hh=Bt;var vn=(t,e,n)=>new hh(t,n).compare(new hh(e,n));const MA=vn;var GA=(t,e,n)=>MA(e,t,n);const $A=vn;var zA=(t,e)=>$A(t,e,!0);const fh=Bt;var ec=(t,e,n)=>{const o=new fh(t,n),i=new fh(e,n);return o.compare(i)||o.compareBuild(i)};const UA=ec;var ZA=(t,e)=>t.sort((n,o)=>UA(n,o,e));const WA=ec;var jA=(t,e)=>t.sort((n,o)=>WA(o,n,e));const HA=vn;var js=(t,e,n)=>HA(t,e,n)>0;const qA=vn;var tc=(t,e,n)=>qA(t,e,n)<0;const KA=vn;var mh=(t,e,n)=>KA(t,e,n)===0;const XA=vn;var gh=(t,e,n)=>XA(t,e,n)!==0;const YA=vn;var nc=(t,e,n)=>YA(t,e,n)>=0;const JA=vn;var rc=(t,e,n)=>JA(t,e,n)<=0;const QA=mh,eV=gh,tV=js,nV=nc,rV=tc,oV=rc;var yh=(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 QA(t,n,o);case"!=":return eV(t,n,o);case">":return tV(t,n,o);case">=":return nV(t,n,o);case"<":return rV(t,n,o);case"<=":return oV(t,n,o);default:throw new TypeError(`Invalid operator: ${e}`)}};const iV=Bt,sV=Ao,{safeRe:Hs,t:qs}=Gi;var aV=(t,e)=>{if(t instanceof iV)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 sV(`${o}.${i}.${l}${c}${d}`,e)},lV=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}},oc,vh;function _n(){if(vh)return oc;vh=1;const t=/\s+/g;class e{constructor(k,M){if(M=i(M),k instanceof e)return k.loose===!!M.loose&&k.includePrerelease===!!M.includePrerelease?k:new e(k.raw,M);if(k instanceof l)return this.raw=k.value,this.set=[[k]],this.formatted=void 0,this;if(this.options=M,this.loose=!!M.loose,this.includePrerelease=!!M.includePrerelease,this.raw=k.trim().replace(t," "),this.set=this.raw.split("||").map(W=>this.parseRange(W.trim())).filter(W=>W.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const W=this.set[0];if(this.set=this.set.filter(q=>!O(q[0])),this.set.length===0)this.set=[W];else if(this.set.length>1){for(const q of this.set)if(q.length===1&&$(q[0])){this.set=[q];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let k=0;k<this.set.length;k++){k>0&&(this.formatted+="||");const M=this.set[k];for(let W=0;W<M.length;W++)W>0&&(this.formatted+=" "),this.formatted+=M[W].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(k){const W=((this.options.includePrerelease&&w)|(this.options.loose&&E))+":"+k,q=o.get(W);if(q)return q;const re=this.options.loose,ue=re?p[h.HYPHENRANGELOOSE]:p[h.HYPHENRANGE];k=k.replace(ue,Q(this.options.includePrerelease)),c("hyphen replace",k),k=k.replace(p[h.COMPARATORTRIM],m),c("comparator trim",k),k=k.replace(p[h.TILDETRIM],y),c("tilde trim",k),k=k.replace(p[h.CARETTRIM],x),c("caret trim",k);let ke=k.split(" ").map(Ke=>R(Ke,this.options)).join(" ").split(/\s+/).map(Ke=>z(Ke,this.options));re&&(ke=ke.filter(Ke=>(c("loose invalid filter",Ke,this.options),!!Ke.match(p[h.COMPARATORLOOSE])))),c("range list",ke);const Se=new Map,Ze=ke.map(Ke=>new l(Ke,this.options));for(const Ke of Ze){if(O(Ke))return[Ke];Se.set(Ke.value,Ke)}Se.size>1&&Se.has("")&&Se.delete("");const ht=[...Se.values()];return o.set(W,ht),ht}intersects(k,M){if(!(k instanceof e))throw new TypeError("a Range is required");return this.set.some(W=>b(W,M)&&k.set.some(q=>b(q,M)&&W.every(re=>q.every(ue=>re.intersects(ue,M)))))}test(k){if(!k)return!1;if(typeof k=="string")try{k=new d(k,this.options)}catch{return!1}for(let M=0;M<this.set.length;M++)if(A(this.set[M],k,this.options))return!0;return!1}}oc=e;const n=lV,o=new n,i=Ql,l=Ks(),c=Us,d=Bt,{safeRe:p,t:h,comparatorTrimReplace:m,tildeTrimReplace:y,caretTrimReplace:x}=Gi,{FLAG_INCLUDE_PRERELEASE:w,FLAG_LOOSE:E}=zs,O=C=>C.value==="<0.0.0-0",$=C=>C.value==="",b=(C,k)=>{let M=!0;const W=C.slice();let q=W.pop();for(;M&&W.length;)M=W.every(re=>q.intersects(re,k)),q=W.pop();return M},R=(C,k)=>(c("comp",C,k),C=Z(C,k),c("caret",C),C=D(C,k),c("tildes",C),C=H(C,k),c("xrange",C),C=G(C,k),c("stars",C),C),F=C=>!C||C.toLowerCase()==="x"||C==="*",D=(C,k)=>C.trim().split(/\s+/).map(M=>V(M,k)).join(" "),V=(C,k)=>{const M=k.loose?p[h.TILDELOOSE]:p[h.TILDE];return C.replace(M,(W,q,re,ue,ke)=>{c("tilde",C,W,q,re,ue,ke);let Se;return F(q)?Se="":F(re)?Se=`>=${q}.0.0 <${+q+1}.0.0-0`:F(ue)?Se=`>=${q}.${re}.0 <${q}.${+re+1}.0-0`:ke?(c("replaceTilde pr",ke),Se=`>=${q}.${re}.${ue}-${ke} <${q}.${+re+1}.0-0`):Se=`>=${q}.${re}.${ue} <${q}.${+re+1}.0-0`,c("tilde return",Se),Se})},Z=(C,k)=>C.trim().split(/\s+/).map(M=>ne(M,k)).join(" "),ne=(C,k)=>{c("caret",C,k);const M=k.loose?p[h.CARETLOOSE]:p[h.CARET],W=k.includePrerelease?"-0":"";return C.replace(M,(q,re,ue,ke,Se)=>{c("caret",C,q,re,ue,ke,Se);let Ze;return F(re)?Ze="":F(ue)?Ze=`>=${re}.0.0${W} <${+re+1}.0.0-0`:F(ke)?re==="0"?Ze=`>=${re}.${ue}.0${W} <${re}.${+ue+1}.0-0`:Ze=`>=${re}.${ue}.0${W} <${+re+1}.0.0-0`:Se?(c("replaceCaret pr",Se),re==="0"?ue==="0"?Ze=`>=${re}.${ue}.${ke}-${Se} <${re}.${ue}.${+ke+1}-0`:Ze=`>=${re}.${ue}.${ke}-${Se} <${re}.${+ue+1}.0-0`:Ze=`>=${re}.${ue}.${ke}-${Se} <${+re+1}.0.0-0`):(c("no pr"),re==="0"?ue==="0"?Ze=`>=${re}.${ue}.${ke}${W} <${re}.${ue}.${+ke+1}-0`:Ze=`>=${re}.${ue}.${ke}${W} <${re}.${+ue+1}.0-0`:Ze=`>=${re}.${ue}.${ke} <${+re+1}.0.0-0`),c("caret return",Ze),Ze})},H=(C,k)=>(c("replaceXRanges",C,k),C.split(/\s+/).map(M=>J(M,k)).join(" ")),J=(C,k)=>{C=C.trim();const M=k.loose?p[h.XRANGELOOSE]:p[h.XRANGE];return C.replace(M,(W,q,re,ue,ke,Se)=>{c("xRange",C,W,q,re,ue,ke,Se);const Ze=F(re),ht=Ze||F(ue),Ke=ht||F(ke),Un=Ke;return q==="="&&Un&&(q=""),Se=k.includePrerelease?"-0":"",Ze?q===">"||q==="<"?W="<0.0.0-0":W="*":q&&Un?(ht&&(ue=0),ke=0,q===">"?(q=">=",ht?(re=+re+1,ue=0,ke=0):(ue=+ue+1,ke=0)):q==="<="&&(q="<",ht?re=+re+1:ue=+ue+1),q==="<"&&(Se="-0"),W=`${q+re}.${ue}.${ke}${Se}`):ht?W=`>=${re}.0.0${Se} <${+re+1}.0.0-0`:Ke&&(W=`>=${re}.${ue}.0${Se} <${re}.${+ue+1}.0-0`),c("xRange return",W),W})},G=(C,k)=>(c("replaceStars",C,k),C.trim().replace(p[h.STAR],"")),z=(C,k)=>(c("replaceGTE0",C,k),C.trim().replace(p[k.includePrerelease?h.GTE0PRE:h.GTE0],"")),Q=C=>(k,M,W,q,re,ue,ke,Se,Ze,ht,Ke,Un)=>(F(W)?M="":F(q)?M=`>=${W}.0.0${C?"-0":""}`:F(re)?M=`>=${W}.${q}.0${C?"-0":""}`:ue?M=`>=${M}`:M=`>=${M}${C?"-0":""}`,F(Ze)?Se="":F(ht)?Se=`<${+Ze+1}.0.0-0`:F(Ke)?Se=`<${Ze}.${+ht+1}.0-0`:Un?Se=`<=${Ze}.${ht}.${Ke}-${Un}`:C?Se=`<${Ze}.${ht}.${+Ke+1}-0`:Se=`<=${Se}`,`${M} ${Se}`.trim()),A=(C,k,M)=>{for(let W=0;W<C.length;W++)if(!C[W].test(k))return!1;if(k.prerelease.length&&!M.includePrerelease){for(let W=0;W<C.length;W++)if(c(C[W].semver),C[W].semver!==l.ANY&&C[W].semver.prerelease.length>0){const q=C[W].semver;if(q.major===k.major&&q.minor===k.minor&&q.patch===k.patch)return!0}return!1}return!0};return oc}var ic,_h;function Ks(){if(_h)return ic;_h=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],x=m.match(y);if(!x)throw new TypeError(`Invalid comparator: ${m}`);this.operator=x[1]!==void 0?x[1]:"",this.operator==="="&&(this.operator=""),x[2]?this.semver=new d(x[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(">")))}}ic=e;const n=Ql,{safeRe:o,t:i}=Gi,l=yh,c=Us,d=Bt,p=_n();return ic}const cV=_n();var Xs=(t,e,n)=>{try{e=new cV(e,n)}catch{return!1}return e.test(t)};const dV=_n();var uV=(t,e)=>new dV(t,e).set.map(n=>n.map(o=>o.value).join(" ").trim().split(" "));const pV=Bt,hV=_n();var fV=(t,e,n)=>{let o=null,i=null,l=null;try{l=new hV(e,n)}catch{return null}return t.forEach(c=>{l.test(c)&&(!o||i.compare(c)===-1)&&(o=c,i=new pV(o,n))}),o};const mV=Bt,gV=_n();var yV=(t,e,n)=>{let o=null,i=null,l=null;try{l=new gV(e,n)}catch{return null}return t.forEach(c=>{l.test(c)&&(!o||i.compare(c)===1)&&(o=c,i=new mV(o,n))}),o};const sc=Bt,vV=_n(),Ch=js;var _V=(t,e)=>{t=new vV(t,e);let n=new sc("0.0.0");if(t.test(n)||(n=new sc("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 sc(c.semver.version);switch(c.operator){case">":d.prerelease.length===0?d.patch++:d.prerelease.push(0),d.raw=d.format();case"":case">=":(!l||Ch(d,l))&&(l=d);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${c.operator}`)}}),l&&(!n||Ch(n,l))&&(n=l)}return n&&t.test(n)?n:null};const CV=_n();var wV=(t,e)=>{try{return new CV(t,e).range||"*"}catch{return null}};const bV=Bt,wh=Ks(),{ANY:xV}=wh,kV=_n(),SV=Xs,bh=js,xh=tc,EV=rc,TV=nc;var ac=(t,e,n,o)=>{t=new bV(t,o),e=new kV(e,o);let i,l,c,d,p;switch(n){case">":i=bh,l=EV,c=xh,d=">",p=">=";break;case"<":i=xh,l=TV,c=bh,d="<",p="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(SV(t,e,o))return!1;for(let h=0;h<e.set.length;++h){const m=e.set[h];let y=null,x=null;if(m.forEach(w=>{w.semver===xV&&(w=new wh(">=0.0.0")),y=y||w,x=x||w,i(w.semver,y.semver,o)?y=w:c(w.semver,x.semver,o)&&(x=w)}),y.operator===d||y.operator===p||(!x.operator||x.operator===d)&&l(t,x.semver))return!1;if(x.operator===p&&c(t,x.semver))return!1}return!0};const NV=ac;var AV=(t,e,n)=>NV(t,e,">",n);const VV=ac;var BV=(t,e,n)=>VV(t,e,"<",n);const kh=_n();var PV=(t,e,n)=>(t=new kh(t,n),e=new kh(e,n),t.intersects(e,n));const RV=Xs,DV=vn;var IV=(t,e,n)=>{const o=[];let i=null,l=null;const c=t.sort((m,y)=>DV(m,y,n));for(const m of c)RV(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 Sh=_n(),lc=Ks(),{ANY:cc}=lc,$i=Xs,dc=vn,FV=(t,e,n={})=>{if(t===e)return!0;t=new Sh(t,n),e=new Sh(e,n);let o=!1;e:for(const i of t.set){for(const l of e.set){const c=LV(i,l,n);if(o=o||c!==null,c)continue e}if(o)return!1}return!0},OV=[new lc(">=0.0.0-0")],Eh=[new lc(">=0.0.0")],LV=(t,e,n)=>{if(t===e)return!0;if(t.length===1&&t[0].semver===cc){if(e.length===1&&e[0].semver===cc)return!0;n.includePrerelease?t=OV:t=Eh}if(e.length===1&&e[0].semver===cc){if(n.includePrerelease)return!0;e=Eh}const o=new Set;let i,l;for(const w of t)w.operator===">"||w.operator===">="?i=Th(i,w,n):w.operator==="<"||w.operator==="<="?l=Nh(l,w,n):o.add(w.semver);if(o.size>1)return null;let c;if(i&&l){if(c=dc(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&&!$i(w,String(i),n)||l&&!$i(w,String(l),n))return null;for(const E of e)if(!$i(w,String(E),n))return!1;return!0}let d,p,h,m,y=l&&!n.includePrerelease&&l.semver.prerelease.length?l.semver:!1,x=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(x&&w.semver.prerelease&&w.semver.prerelease.length&&w.semver.major===x.major&&w.semver.minor===x.minor&&w.semver.patch===x.patch&&(x=!1),w.operator===">"||w.operator===">="){if(d=Th(i,w,n),d===w&&d!==i)return!1}else if(i.operator===">="&&!$i(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=Nh(l,w,n),p===w&&p!==l)return!1}else if(l.operator==="<="&&!$i(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||x||y)},Th=(t,e,n)=>{if(!t)return e;const o=dc(t.semver,e.semver,n);return o>0?t:o<0||e.operator===">"&&t.operator===">="?e:t},Nh=(t,e,n)=>{if(!t)return e;const o=dc(t.semver,e.semver,n);return o<0?t:o>0||e.operator==="<"&&t.operator==="<="?e:t};var MV=FV;const uc=Gi,Ah=zs,GV=Bt,Vh=sh,$V=Ao,zV=EA,UV=NA,ZV=AA,WV=VA,jV=PA,HV=DA,qV=FA,KV=LA,XV=vn,YV=GA,JV=zA,QV=ec,eB=ZA,tB=jA,nB=js,rB=tc,oB=mh,iB=gh,sB=nc,aB=rc,lB=yh,cB=aV,dB=Ks(),uB=_n();var pB={parse:$V,valid:zV,clean:UV,inc:ZV,diff:WV,major:jV,minor:HV,patch:qV,prerelease:KV,compare:XV,rcompare:YV,compareLoose:JV,compareBuild:QV,sort:eB,rsort:tB,gt:nB,lt:rB,eq:oB,neq:iB,gte:sB,lte:aB,cmp:lB,coerce:cB,Comparator:dB,Range:uB,satisfies:Xs,toComparators:uV,maxSatisfying:fV,minSatisfying:yV,minVersion:_V,validRange:wV,outside:ac,gtr:AV,ltr:BV,intersects:PV,simplifyRange:IV,subset:MV,SemVer:GV,re:uc.re,src:uc.src,tokens:uc.t,SEMVER_SPEC_VERSION:Ah.SEMVER_SPEC_VERSION,RELEASE_TYPES:Ah.RELEASE_TYPES,compareIdentifiers:Vh.compareIdentifiers,rcompareIdentifiers:Vh.rcompareIdentifiers};const hB=Yd(pB);function fB(t){return Gr(t.id)}function mB(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 gB=["isNotNA","isNA","number_equals","number_notEquals","number_greaterThan","number_greaterThanOrEqualTo","number_lessThan","number_lessThanOrEqualTo","number_between"],yB=["isNotNA","isNA","string_equals","string_notEquals","string_contains","string_doesNotContain","string_matches","string_doesNotMatch","string_containsFuzzyMatch"];function Bh(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 vB(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 Ph(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 _B(t,e){return{columnId:t.columnId,filter:Ph(e,vB(t.filter)),disabled:t.disabled}}function pc(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 Rh(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 CB(t){try{return new RegExp(t),t}catch(e){throw e instanceof SyntaxError?Error("Model value is not a regexp."):e}}function wB(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=hB.gt(mu().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 xB={class:"d-flex flex-column gap-24"},Dh=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",xB,[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(_B)(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(Wr),{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(pc)(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(Wr),{modelValue:e.value.filter.lowerBound,"onUpdate:modelValue":c[2]||(c[2]=d=>e.value.filter.lowerBound=d),disabled:l.disabled,parse:d=>r.unref(pc)(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(Wr),{modelValue:e.value.filter.upperBound,"onUpdate:modelValue":c[4]||(c[4]=d=>e.value.filter.upperBound=d),disabled:l.disabled,parse:d=>r.unref(pc)(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(Wr),{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(Rh)(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(Wr),{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(CB),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(Wr),{modelValue:e.value.filter.reference,"onUpdate:modelValue":c[8]||(c[8]=d=>e.value.filter.reference=d),disabled:l.disabled,parse:d=>r.unref(Rh)(r.unref(o),d),label:"Reference value"},null,8,["modelValue","disabled","parse"]),r.createVNode(r.unref(Wp),{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(wo),{modelValue:e.value.filter.wildcard,"onUpdate:modelValue":c[11]||(c[11]=d=>e.value.filter.wildcard=d),disabled:l.disabled,options:r.unref(wB)(r.unref(o),e.value.filter.reference),clearable:"",label:"Wildcard symbol"},null,8,["modelValue","disabled","options"])],64)):r.createCommentVNode("",!0)]))}}),kB={class:"d-flex flex-column gap-24"},SB={key:0,class:"text-subtitle-m",style:{color:"var(--txt-mask)"}},EB=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,x=>{x?h.value=o.makeFilter(x):h.value=void 0});const m=()=>{p.value=void 0,n.value=!1},y=()=>{h.value&&(d("addFilter",h.value),m())};return(x,w)=>(r.openBlock(),r.createBlock(r.unref(Vs),{modelValue:n.value,"onUpdate:modelValue":w[2]||(w[2]=E=>n.value=E),"close-on-outside-click":!1},{title:r.withCtx(()=>w[3]||(w[3]=[r.createTextVNode("Add Filter")])),actions:r.withCtx(()=>[r.createVNode(r.unref(Ns),{disabled:!h.value,onClick:y},{default:r.withCtx(()=>w[4]||(w[4]=[r.createTextVNode("Add Filter")])),_:1},8,["disabled"]),r.createVNode(r.unref(_o),{"justify-center":!1,onClick:m},{default:r.withCtx(()=>w[5]||(w[5]=[r.createTextVNode("Cancel")])),_:1})]),default:r.withCtx(()=>[r.createElementVNode("div",kB,[r.createVNode(r.unref(wo),{modelValue:p.value,"onUpdate:modelValue":w[0]||(w[0]=E=>p.value=E),options:r.unref(l),label:"Column",placeholder:"Choose..."},null,8,["modelValue","options"]),h.value?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",SB,"Choose a column to view and adjust its options")),h.value?(r.openBlock(),r.createBlock(Dh,{key:1,modelValue:h.value,"onUpdate:modelValue":w[1]||(w[1]=E=>h.value=E),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"]))}}),TB=["onClick"],NB={class:"pl-filter-manager__expand-icon"},AB={class:"pl-filter-manager__title flex-grow-1 text-s-btn"},VB={class:"pl-filter-manager__actions d-flex gap-12"},BB=["onClick"],PB=["onClick"],RB={class:"pl-filter-manager__content d-flex gap-24 p-24 flex-column"},DB={class:"d-flex justify-center"},IB=["onClick"],FB={class:"pl-filter-manager__add-btn-icon"},OB={key:0},LB=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 G=o.value.filter(Q=>{const A=Q.type;switch(A){case"axis":return Q.spec.type!=="Bytes";case"column":return Q.spec.valueType!=="Bytes";default:throw Error(`unsupported data type: ${A}`)}}),z={};for(const Q of G)z[fB(Q)]=Q;return z}),d=r.computed(()=>{const G=i.value??[],z={};for(const[Q,A]of Object.entries(c.value)){const C=ze.find(G,k=>ze.isEqual(k.column.id,A.id));C&&(z[Q]=C.allowedFilterTypes)}return z}),p=r.computed(()=>{const G=l.value??[],z={};for(const[Q,A]of Object.entries(c.value)){const C=ze.find(G,k=>ze.isEqual(k.column.id,A.id));C&&(z[Q]={columnId:Q,filter:C.default,disabled:!1})}return z});(()=>{let G=e.value.state;typeof G=="object"&&!Array.isArray(G)&&(e.value.state=Object.entries(G).map(([z,Q])=>({columnId:z,filter:Q,disabled:!1})))})();const h=G=>G??Object.values(p.value),m=r.reactive({state:h(e.value.state)});r.watch(()=>e.value,G=>{ze.isEqual(m.state,G.state)||(m.state=h(G.state))}),r.watch(()=>m,G=>{ze.isEqual(G.state,e.value.state)||(e.value={state:ze.cloneDeep(G.state),filters:G.state.filter(z=>!z.disabled).map(z=>{const Q=c.value[z.columnId],{spec:A,...C}=Q;return{type:"bySingleColumnV2",column:C,predicate:bB(Q,z.filter)}})})},{immediate:!0,deep:!0}),r.watch(()=>c.value,G=>{Object.keys(G).length===0&&m.state!==void 0||(m.state=m.state.filter(z=>!!G[z.columnId]))},{immediate:!0});const y=r.computed(()=>Object.keys(c).length>0&&m.state.length>0),x=r.computed(()=>{const G=d.value,z={};for(const[Q,A]of Object.entries(c.value)){let k=(A.type==="column"?A.spec.valueType:A.spec.type)==="String"?yB:gB;const M=G[Q];M&&(k=k.filter(W=>M.includes(W))),z[Q]=k.map(W=>({value:W,text:mB(W)}))}return z}),w=r.computed(()=>ze.some(Object.values(x.value),G=>G.length>0)),E=r.computed(()=>Object.entries(Object.entries(c.value)).filter(([G,[z,Q]])=>x.value[z].length>0).filter(([G,[z,Q]])=>!m.state.some(A=>A.columnId===z)).map(([G,[z,Q]])=>({label:Bh(Q,G),value:z}))),O=G=>p.value[G]??{columnId:G,filter:Ph(x.value[G][0].value),disabled:!1},$=G=>{m.state[G]=O(m.state[G].columnId)},b=G=>m.state.splice(G,1),R=r.ref(!1),F=r.ref(!1),D=r.ref(!1);r.onMounted(()=>{D.value=!0});const V=r.reactive({}),Z=G=>{V[G]?delete V[G]:V[G]=!0},ne=r.ref(!1),H=r.ref();let J;return r.onMounted(()=>{J=new ResizeObserver(()=>{var z;const G=(z=H.value)==null?void 0:z.parentElement;G&&(ne.value=G.scrollHeight>G.clientHeight||G.scrollWidth>G.clientWidth)}),H.value&&H.value.parentElement&&J.observe(H.value.parentElement)}),r.watch(H,(G,z)=>{z!=null&&z.parentElement&&J.unobserve(z.parentElement),G!=null&&G.parentElement&&J.observe(G.parentElement)}),r.onBeforeUnmount(()=>{J!==void 0&&J.disconnect()}),(G,z)=>(r.openBlock(),r.createElementBlock(r.Fragment,null,[D.value?(r.openBlock(),r.createBlock(r.Teleport,{key:0,to:`#${r.unref(Yl)}`},[r.createVNode(r.unref(_o),{onClick:z[0]||(z[0]=r.withModifiers(Q=>R.value=!0,["stop"]))},{append:r.withCtx(()=>[r.createVNode(r.unref(Ci),{name:y.value?"filter-on":"filter"},null,8,["name"])]),default:r.withCtx(()=>[z[5]||(z[5]=r.createTextVNode(" Filters "))]),_:1})],8,["to"])):r.createCommentVNode("",!0),r.createVNode(r.unref(Vs),{modelValue:R.value,"onUpdate:modelValue":z[2]||(z[2]=Q=>R.value=Q),"close-on-outside-click":!1},{title:r.withCtx(()=>z[6]||(z[6]=[r.createTextVNode("Manage Filters")])),default:r.withCtx(()=>[r.createElementVNode("div",{ref_key:"filterManager",ref:H,class:"pl-filter-manager d-flex flex-column gap-6"},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(m.state,(Q,A)=>(r.openBlock(),r.createElementBlock("div",{key:Q.columnId,class:r.normalizeClass([{open:V[Q.columnId],disabled:Q.disabled},"pl-filter-manager__filter"])},[r.createElementVNode("div",{class:"pl-filter-manager__header d-flex align-center gap-8",onClick:C=>Z(Q.columnId)},[r.createElementVNode("div",NB,[r.createVNode(r.unref(fn),{name:"chevron-right"})]),r.createElementVNode("div",AB,r.toDisplayString(r.unref(Bh)(c.value[Q.columnId],A)),1),r.createElementVNode("div",VB,[r.createElementVNode("div",{class:"pl-filter-manager__toggle",onClick:r.withModifiers(C=>Q.disabled=!Q.disabled,["stop"])},[r.createVNode(r.unref(Lt),{name:Q.disabled?"view-hide":"view-show"},null,8,["name"])],8,BB),r.createElementVNode("div",{class:"pl-filter-manager__delete",onClick:r.withModifiers(C=>b(A),["stop"])},[r.createVNode(r.unref(Lt),{name:"close"})],8,PB)])],8,TB),r.createElementVNode("div",RB,[r.createVNode(Dh,{modelValue:m.state[A],"onUpdate:modelValue":C=>m.state[A]=C,disabled:Q.disabled,column:c.value[Q.columnId],options:x.value[Q.columnId]},null,8,["modelValue","onUpdate:modelValue","disabled","column","options"]),r.createElementVNode("div",DB,[r.createElementVNode("div",{class:r.normalizeClass([{disabled:Q.disabled},"pl-filter-manager__revert-btn text-s-btn d-flex align-center gap-8"]),onClick:C=>$(A)},[z[7]||(z[7]=r.createTextVNode(" Revert Settings to Default ")),r.createVNode(r.unref(Lt),{name:"reverse"})],10,IB)])])],2))),128)),r.createElementVNode("div",{class:r.normalizeClass([{"pt-24":ne.value},"pl-filter-manager__add-action-wrapper"])},[E.value.length>0?(r.openBlock(),r.createElementBlock("div",{key:0,class:"pl-filter-manager__add-btn",onClick:z[1]||(z[1]=Q=>F.value=!0)},[r.createElementVNode("div",FB,[r.createVNode(r.unref(fn),{name:"add"})]),z[8]||(z[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",OB,"No filters applicable"))],512)]),_:1},8,["modelValue"]),r.createVNode(EB,{modelValue:F.value,"onUpdate:modelValue":z[3]||(z[3]=Q=>F.value=Q),"columns-by-id":c.value,"column-options":E.value,"filter-options":x.value,"make-filter":O,onAddFilter:z[4]||(z[4]=Q=>m.state.push(Q))},null,8,["modelValue","columns-by-id","column-options","filter-options"])],64))}}),Ys=new Map;function MB(t,e){const n=r.getCurrentScope()??r.effectScope(),o=n.run(()=>(r.onScopeDispose(()=>{Ys.delete(t)}),r.reactive(e())));return o[Symbol.dispose]=()=>{n.stop()},o}function GB(t){const e=Symbol();return()=>(Ys.has(e)||Ys.set(e,MB(e,t)),Ys.get(e))}function $B(t){return r.computed(()=>{try{return Qd(t())}catch(e){return{errors:[String(e)],value:void 0}}})}function Ih(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=Ig(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,Fh=new Set,hc=typeof process=="object"&&process?process:{},Oh=(t,e,n,o)=>{typeof hc.emitWarning=="function"?hc.emitWarning(t,e,n,o):console.error(`[${n}] ${e}: ${t}`)};let Js=globalThis.AbortController,Lh=globalThis.AbortSignal;if(typeof Js>"u"){Lh=class{constructor(){je(this,"onabort");je(this,"_onabort",[]);je(this,"reason");je(this,"aborted",!1)}addEventListener(o,i){this._onabort.push(i)}},Js=class{constructor(){je(this,"signal",new Lh);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=((Gh=hc.env)==null?void 0:Gh.LRU_CACHE_IGNORE_AC_WARNING)!=="1";const e=()=>{t&&(t=!1,Oh("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 zB=t=>!Fh.has(t),Er=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),Mh=t=>Er(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 Kr=class Kr{constructor(e,n){je(this,"heap");je(this,"length");if(!S(Kr,Bo))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new n(e),this.length=0}static create(e){const n=Mh(e);if(!n)return[];ye(Kr,Bo,!0);const o=new Kr(e,n);return ye(Kr,Bo,!1),o}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}};Bo=new WeakMap,Ue(Kr,Bo,!1);let fc=Kr;const yc=class yc{constructor(e){Ue(this,oe);Ue(this,Cn);Ue(this,jt);Ue(this,wn);Ue(this,bn);Ue(this,Po);Ue(this,Ro);je(this,"ttl");je(this,"ttlResolution");je(this,"ttlAutopurge");je(this,"updateAgeOnGet");je(this,"updateAgeOnHas");je(this,"allowStale");je(this,"noDisposeOnSet");je(this,"noUpdateTTL");je(this,"maxEntrySize");je(this,"sizeCalculation");je(this,"noDeleteOnFetchRejection");je(this,"noDeleteOnStaleGet");je(this,"allowStaleOnFetchAbort");je(this,"allowStaleOnFetchRejection");je(this,"ignoreFetchAbort");Ue(this,pt);Ue(this,xn);Ue(this,dt);Ue(this,Je);Ue(this,Ee);Ue(this,Pt);Ue(this,Ht);Ue(this,Et);Ue(this,yt);Ue(this,kn);Ue(this,vt);Ue(this,Sn);Ue(this,En);Ue(this,qt);Ue(this,Tn);Ue(this,Tr);Ue(this,Rt);Ue(this,Xr,()=>{});Ue(this,Jn,()=>{});Ue(this,zi,()=>{});Ue(this,Kt,()=>!1);Ue(this,Yr,e=>{});Ue(this,Do,(e,n,o)=>{});Ue(this,Ui,(e,n,o,i)=>{if(o||i)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});je(this,$h,"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:x,maxSize:w=0,maxEntrySize:E=0,sizeCalculation:O,fetchMethod:$,memoMethod:b,noDeleteOnFetchRejection:R,noDeleteOnStaleGet:F,allowStaleOnFetchRejection:D,allowStaleOnFetchAbort:V,ignoreFetchAbort:Z}=e;if(n!==0&&!Er(n))throw new TypeError("max option must be a nonnegative integer");const ne=n?Mh(n):Array;if(!ne)throw new Error("invalid max value: "+n);if(ye(this,Cn,n),ye(this,jt,w),this.maxEntrySize=E||S(this,jt),this.sizeCalculation=O,this.sizeCalculation){if(!S(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(b!==void 0&&typeof b!="function")throw new TypeError("memoMethod must be a function if defined");if(ye(this,Ro,b),$!==void 0&&typeof $!="function")throw new TypeError("fetchMethod must be a function if specified");if(ye(this,Po,$),ye(this,Tr,!!$),ye(this,dt,new Map),ye(this,Je,new Array(n).fill(void 0)),ye(this,Ee,new Array(n).fill(void 0)),ye(this,Pt,new ne(n)),ye(this,Ht,new ne(n)),ye(this,Et,0),ye(this,yt,0),ye(this,kn,fc.create(n)),ye(this,pt,0),ye(this,xn,0),typeof h=="function"&&ye(this,wn,h),typeof m=="function"?(ye(this,bn,m),ye(this,vt,[])):(ye(this,bn,void 0),ye(this,vt,void 0)),ye(this,Tn,!!S(this,wn)),ye(this,Rt,!!S(this,bn)),this.noDisposeOnSet=!!y,this.noUpdateTTL=!!x,this.noDeleteOnFetchRejection=!!R,this.allowStaleOnFetchRejection=!!D,this.allowStaleOnFetchAbort=!!V,this.ignoreFetchAbort=!!Z,this.maxEntrySize!==0){if(S(this,jt)!==0&&!Er(S(this,jt)))throw new TypeError("maxSize must be a positive integer if specified");if(!Er(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");pe(this,oe,xg).call(this)}if(this.allowStale=!!p,this.noDeleteOnStaleGet=!!F,this.updateAgeOnGet=!!c,this.updateAgeOnHas=!!d,this.ttlResolution=Er(i)||i===0?i:1,this.ttlAutopurge=!!l,this.ttl=o||0,this.ttl){if(!Er(this.ttl))throw new TypeError("ttl must be a positive integer if specified");pe(this,oe,Gd).call(this)}if(S(this,Cn)===0&&this.ttl===0&&S(this,jt)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!S(this,Cn)&&!S(this,jt)){const H="LRU_CACHE_UNBOUNDED";zB(H)&&(Fh.add(H),Oh("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",H,yc))}}static unsafeExposeInternals(e){return{starts:S(e,En),ttls:S(e,qt),sizes:S(e,Sn),keyMap:S(e,dt),keyList:S(e,Je),valList:S(e,Ee),next:S(e,Pt),prev:S(e,Ht),get head(){return S(e,Et)},get tail(){return S(e,yt)},free:S(e,kn),isBackgroundFetch:n=>{var o;return pe(o=e,oe,et).call(o,n)},backgroundFetch:(n,o,i,l)=>{var c;return pe(c=e,oe,Ha).call(c,n,o,i,l)},moveToTail:n=>{var o;return pe(o=e,oe,ps).call(o,n)},indexes:n=>{var o;return pe(o=e,oe,Or).call(o,n)},rindexes:n=>{var o;return pe(o=e,oe,Lr).call(o,n)},isStale:n=>{var o;return S(o=e,Kt).call(o,n)}}}get max(){return S(this,Cn)}get maxSize(){return S(this,jt)}get calculatedSize(){return S(this,xn)}get size(){return S(this,pt)}get fetchMethod(){return S(this,Po)}get memoMethod(){return S(this,Ro)}get dispose(){return S(this,wn)}get disposeAfter(){return S(this,bn)}getRemainingTTL(e){return S(this,dt).has(e)?1/0:0}*entries(){for(const e of pe(this,oe,Or).call(this))S(this,Ee)[e]!==void 0&&S(this,Je)[e]!==void 0&&!pe(this,oe,et).call(this,S(this,Ee)[e])&&(yield[S(this,Je)[e],S(this,Ee)[e]])}*rentries(){for(const e of pe(this,oe,Lr).call(this))S(this,Ee)[e]!==void 0&&S(this,Je)[e]!==void 0&&!pe(this,oe,et).call(this,S(this,Ee)[e])&&(yield[S(this,Je)[e],S(this,Ee)[e]])}*keys(){for(const e of pe(this,oe,Or).call(this)){const n=S(this,Je)[e];n!==void 0&&!pe(this,oe,et).call(this,S(this,Ee)[e])&&(yield n)}}*rkeys(){for(const e of pe(this,oe,Lr).call(this)){const n=S(this,Je)[e];n!==void 0&&!pe(this,oe,et).call(this,S(this,Ee)[e])&&(yield n)}}*values(){for(const e of pe(this,oe,Or).call(this))S(this,Ee)[e]!==void 0&&!pe(this,oe,et).call(this,S(this,Ee)[e])&&(yield S(this,Ee)[e])}*rvalues(){for(const e of pe(this,oe,Lr).call(this))S(this,Ee)[e]!==void 0&&!pe(this,oe,et).call(this,S(this,Ee)[e])&&(yield S(this,Ee)[e])}[(zh=Symbol.iterator,$h=Symbol.toStringTag,zh)](){return this.entries()}find(e,n={}){for(const o of pe(this,oe,Or).call(this)){const i=S(this,Ee)[o],l=pe(this,oe,et).call(this,i)?i.__staleWhileFetching:i;if(l!==void 0&&e(l,S(this,Je)[o],this))return this.get(S(this,Je)[o],n)}}forEach(e,n=this){for(const o of pe(this,oe,Or).call(this)){const i=S(this,Ee)[o],l=pe(this,oe,et).call(this,i)?i.__staleWhileFetching:i;l!==void 0&&e.call(n,l,S(this,Je)[o],this)}}rforEach(e,n=this){for(const o of pe(this,oe,Lr).call(this)){const i=S(this,Ee)[o],l=pe(this,oe,et).call(this,i)?i.__staleWhileFetching:i;l!==void 0&&e.call(n,l,S(this,Je)[o],this)}}purgeStale(){let e=!1;for(const n of pe(this,oe,Lr).call(this,{allowStale:!0}))S(this,Kt).call(this,n)&&(pe(this,oe,Mr).call(this,S(this,Je)[n],"expire"),e=!0);return e}info(e){const n=S(this,dt).get(e);if(n===void 0)return;const o=S(this,Ee)[n],i=pe(this,oe,et).call(this,o)?o.__staleWhileFetching:o;if(i===void 0)return;const l={value:i};if(S(this,qt)&&S(this,En)){const c=S(this,qt)[n],d=S(this,En)[n];if(c&&d){const p=c-(Vo.now()-d);l.ttl=p,l.start=Date.now()}}return S(this,Sn)&&(l.size=S(this,Sn)[n]),l}dump(){const e=[];for(const n of pe(this,oe,Or).call(this,{allowStale:!0})){const o=S(this,Je)[n],i=S(this,Ee)[n],l=pe(this,oe,et).call(this,i)?i.__staleWhileFetching:i;if(l===void 0||o===void 0)continue;const c={value:l};if(S(this,qt)&&S(this,En)){c.ttl=S(this,qt)[n];const d=Vo.now()-S(this,En)[n];c.start=Math.floor(Date.now()-d)}S(this,Sn)&&(c.size=S(this,Sn)[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 x,w,E,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=S(this,Ui).call(this,e,n,o.size||0,d);if(this.maxEntrySize&&m>this.maxEntrySize)return p&&(p.set="miss",p.maxEntrySizeExceeded=!0),pe(this,oe,Mr).call(this,e,"set"),this;let y=S(this,pt)===0?void 0:S(this,dt).get(e);if(y===void 0)y=S(this,pt)===0?S(this,yt):S(this,kn).length!==0?S(this,kn).pop():S(this,pt)===S(this,Cn)?pe(this,oe,ja).call(this,!1):S(this,pt),S(this,Je)[y]=e,S(this,Ee)[y]=n,S(this,dt).set(e,y),S(this,Pt)[S(this,yt)]=y,S(this,Ht)[y]=S(this,yt),ye(this,yt,y),Wa(this,pt)._++,S(this,Do).call(this,y,m,p),p&&(p.set="add"),h=!1;else{pe(this,oe,ps).call(this,y);const b=S(this,Ee)[y];if(n!==b){if(S(this,Tr)&&pe(this,oe,et).call(this,b)){b.__abortController.abort(new Error("replaced"));const{__staleWhileFetching:R}=b;R!==void 0&&!c&&(S(this,Tn)&&((x=S(this,wn))==null||x.call(this,R,e,"set")),S(this,Rt)&&((w=S(this,vt))==null||w.push([R,e,"set"])))}else c||(S(this,Tn)&&((E=S(this,wn))==null||E.call(this,b,e,"set")),S(this,Rt)&&((O=S(this,vt))==null||O.push([b,e,"set"])));if(S(this,Yr).call(this,y),S(this,Do).call(this,y,m,p),S(this,Ee)[y]=n,p){p.set="replace";const R=b&&pe(this,oe,et).call(this,b)?b.__staleWhileFetching:b;R!==void 0&&(p.oldValue=R)}}else p&&(p.set="update")}if(i!==0&&!S(this,qt)&&pe(this,oe,Gd).call(this),S(this,qt)&&(h||S(this,zi).call(this,y,i,l),p&&S(this,Jn).call(this,p,y)),!c&&S(this,Rt)&&S(this,vt)){const b=S(this,vt);let R;for(;R=b==null?void 0:b.shift();)($=S(this,bn))==null||$.call(this,...R)}return this}pop(){var e;try{for(;S(this,pt);){const n=S(this,Ee)[S(this,Et)];if(pe(this,oe,ja).call(this,!0),pe(this,oe,et).call(this,n)){if(n.__staleWhileFetching)return n.__staleWhileFetching}else if(n!==void 0)return n}}finally{if(S(this,Rt)&&S(this,vt)){const n=S(this,vt);let o;for(;o=n==null?void 0:n.shift();)(e=S(this,bn))==null||e.call(this,...o)}}}has(e,n={}){const{updateAgeOnHas:o=this.updateAgeOnHas,status:i}=n,l=S(this,dt).get(e);if(l!==void 0){const c=S(this,Ee)[l];if(pe(this,oe,et).call(this,c)&&c.__staleWhileFetching===void 0)return!1;if(S(this,Kt).call(this,l))i&&(i.has="stale",S(this,Jn).call(this,i,l));else return o&&S(this,Xr).call(this,l),i&&(i.has="hit",S(this,Jn).call(this,i,l)),!0}else i&&(i.has="miss");return!1}peek(e,n={}){const{allowStale:o=this.allowStale}=n,i=S(this,dt).get(e);if(i===void 0||!o&&S(this,Kt).call(this,i))return;const l=S(this,Ee)[i];return pe(this,oe,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:x=this.allowStaleOnFetchRejection,ignoreFetchAbort:w=this.ignoreFetchAbort,allowStaleOnFetchAbort:E=this.allowStaleOnFetchAbort,context:O,forceRefresh:$=!1,status:b,signal:R}=n;if(!S(this,Tr))return b&&(b.fetch="get"),this.get(e,{allowStale:o,updateAgeOnGet:i,noDeleteOnStaleGet:l,status:b});const F={allowStale:o,updateAgeOnGet:i,noDeleteOnStaleGet:l,ttl:c,noDisposeOnSet:d,size:p,sizeCalculation:h,noUpdateTTL:m,noDeleteOnFetchRejection:y,allowStaleOnFetchRejection:x,allowStaleOnFetchAbort:E,ignoreFetchAbort:w,status:b,signal:R};let D=S(this,dt).get(e);if(D===void 0){b&&(b.fetch="miss");const V=pe(this,oe,Ha).call(this,e,D,F,O);return V.__returned=V}else{const V=S(this,Ee)[D];if(pe(this,oe,et).call(this,V)){const G=o&&V.__staleWhileFetching!==void 0;return b&&(b.fetch="inflight",G&&(b.returnedStale=!0)),G?V.__staleWhileFetching:V.__returned=V}const Z=S(this,Kt).call(this,D);if(!$&&!Z)return b&&(b.fetch="hit"),pe(this,oe,ps).call(this,D),i&&S(this,Xr).call(this,D),b&&S(this,Jn).call(this,b,D),V;const ne=pe(this,oe,Ha).call(this,e,D,F,O),J=ne.__staleWhileFetching!==void 0&&o;return b&&(b.fetch=Z?"stale":"refresh",J&&Z&&(b.returnedStale=!0)),J?ne.__staleWhileFetching:ne.__returned=ne}}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=S(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=S(this,dt).get(e);if(d!==void 0){const p=S(this,Ee)[d],h=pe(this,oe,et).call(this,p);return c&&S(this,Jn).call(this,c,d),S(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||pe(this,oe,Mr).call(this,e,"expire"),c&&o&&(c.returnedStale=!0),o?p:void 0)):(c&&(c.get="hit"),h?p.__staleWhileFetching:(pe(this,oe,ps).call(this,d),i&&S(this,Xr).call(this,d),p))}else c&&(c.get="miss")}delete(e){return pe(this,oe,Mr).call(this,e,"delete")}clear(){return pe(this,oe,Ud).call(this,"delete")}};Cn=new WeakMap,jt=new WeakMap,wn=new WeakMap,bn=new WeakMap,Po=new WeakMap,Ro=new WeakMap,pt=new WeakMap,xn=new WeakMap,dt=new WeakMap,Je=new WeakMap,Ee=new WeakMap,Pt=new WeakMap,Ht=new WeakMap,Et=new WeakMap,yt=new WeakMap,kn=new WeakMap,vt=new WeakMap,Sn=new WeakMap,En=new WeakMap,qt=new WeakMap,Tn=new WeakMap,Tr=new WeakMap,Rt=new WeakMap,oe=new WeakSet,Gd=function(){const e=new Qs(S(this,Cn)),n=new Qs(S(this,Cn));ye(this,qt,e),ye(this,En,n),ye(this,zi,(l,c,d=Vo.now())=>{if(n[l]=c!==0?d:0,e[l]=c,c!==0&&this.ttlAutopurge){const p=setTimeout(()=>{S(this,Kt).call(this,l)&&pe(this,oe,Mr).call(this,S(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=S(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,zi=new WeakMap,Kt=new WeakMap,xg=function(){const e=new Qs(S(this,Cn));ye(this,xn,0),ye(this,Sn,e),ye(this,Yr,n=>{ye(this,xn,S(this,xn)-e[n]),e[n]=0}),ye(this,Ui,(n,o,i,l)=>{if(pe(this,oe,et).call(this,o))return 0;if(!Er(i))if(l){if(typeof l!="function")throw new TypeError("sizeCalculation must be a function");if(i=l(o,n),!Er(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,S(this,jt)){const l=S(this,jt)-e[n];for(;S(this,xn)>l;)pe(this,oe,ja).call(this,!0)}ye(this,xn,S(this,xn)+e[n]),i&&(i.entrySize=o,i.totalCalculatedSize=S(this,xn))})},Yr=new WeakMap,Do=new WeakMap,Ui=new WeakMap,Or=function*({allowStale:e=this.allowStale}={}){if(S(this,pt))for(let n=S(this,yt);!(!pe(this,oe,$d).call(this,n)||((e||!S(this,Kt).call(this,n))&&(yield n),n===S(this,Et)));)n=S(this,Ht)[n]},Lr=function*({allowStale:e=this.allowStale}={}){if(S(this,pt))for(let n=S(this,Et);!(!pe(this,oe,$d).call(this,n)||((e||!S(this,Kt).call(this,n))&&(yield n),n===S(this,yt)));)n=S(this,Pt)[n]},$d=function(e){return e!==void 0&&S(this,dt).get(S(this,Je)[e])===e},ja=function(e){var l,c;const n=S(this,Et),o=S(this,Je)[n],i=S(this,Ee)[n];return S(this,Tr)&&pe(this,oe,et).call(this,i)?i.__abortController.abort(new Error("evicted")):(S(this,Tn)||S(this,Rt))&&(S(this,Tn)&&((l=S(this,wn))==null||l.call(this,i,o,"evict")),S(this,Rt)&&((c=S(this,vt))==null||c.push([i,o,"evict"]))),S(this,Yr).call(this,n),e&&(S(this,Je)[n]=void 0,S(this,Ee)[n]=void 0,S(this,kn).push(n)),S(this,pt)===1?(ye(this,Et,ye(this,yt,0)),S(this,kn).length=0):ye(this,Et,S(this,Pt)[n]),S(this,dt).delete(o),Wa(this,pt)._--,n},Ha=function(e,n,o,i){const l=n===void 0?void 0:S(this,Ee)[n];if(pe(this,oe,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=(O,$=!1)=>{const{aborted:b}=c.signal,R=o.ignoreFetchAbort&&O!==void 0;if(o.status&&(b&&!$?(o.status.fetchAborted=!0,o.status.fetchError=c.signal.reason,R&&(o.status.fetchAbortIgnored=!0)):o.status.fetchResolved=!0),b&&!R&&!$)return y(c.signal.reason);const F=w;return S(this,Ee)[n]===w&&(O===void 0?F.__staleWhileFetching?S(this,Ee)[n]=F.__staleWhileFetching:pe(this,oe,Mr).call(this,e,"fetch"):(o.status&&(o.status.fetchUpdated=!0),this.set(e,O,p.options))),O},m=O=>(o.status&&(o.status.fetchRejected=!0,o.status.fetchError=O),y(O)),y=O=>{const{aborted:$}=c.signal,b=$&&o.allowStaleOnFetchAbort,R=b||o.allowStaleOnFetchRejection,F=R||o.noDeleteOnFetchRejection,D=w;if(S(this,Ee)[n]===w&&(!F||D.__staleWhileFetching===void 0?pe(this,oe,Mr).call(this,e,"fetch"):b||(S(this,Ee)[n]=D.__staleWhileFetching)),R)return o.status&&D.__staleWhileFetching!==void 0&&(o.status.returnedStale=!0),D.__staleWhileFetching;if(D.__returned===D)throw O},x=(O,$)=>{var R;const b=(R=S(this,Po))==null?void 0:R.call(this,e,l,p);b&&b instanceof Promise&&b.then(F=>O(F===void 0?void 0:F),$),c.signal.addEventListener("abort",()=>{(!o.ignoreFetchAbort||o.allowStaleOnFetchAbort)&&(O(void 0),o.allowStaleOnFetchAbort&&(O=F=>h(F,!0)))})};o.status&&(o.status.fetchDispatched=!0);const w=new Promise(x).then(h,m),E=Object.assign(w,{__abortController:c,__staleWhileFetching:l,__returned:void 0});return n===void 0?(this.set(e,E,{...p.options,status:void 0}),n=S(this,dt).get(e)):S(this,Ee)[n]=E,E},et=function(e){if(!S(this,Tr))return!1;const n=e;return!!n&&n instanceof Promise&&n.hasOwnProperty("__staleWhileFetching")&&n.__abortController instanceof Js},zd=function(e,n){S(this,Ht)[n]=e,S(this,Pt)[e]=n},ps=function(e){e!==S(this,yt)&&(e===S(this,Et)?ye(this,Et,S(this,Pt)[e]):pe(this,oe,zd).call(this,S(this,Ht)[e],S(this,Pt)[e]),pe(this,oe,zd).call(this,S(this,yt),e),ye(this,yt,e))},Mr=function(e,n){var i,l,c,d;let o=!1;if(S(this,pt)!==0){const p=S(this,dt).get(e);if(p!==void 0)if(o=!0,S(this,pt)===1)pe(this,oe,Ud).call(this,n);else{S(this,Yr).call(this,p);const h=S(this,Ee)[p];if(pe(this,oe,et).call(this,h)?h.__abortController.abort(new Error("deleted")):(S(this,Tn)||S(this,Rt))&&(S(this,Tn)&&((i=S(this,wn))==null||i.call(this,h,e,n)),S(this,Rt)&&((l=S(this,vt))==null||l.push([h,e,n]))),S(this,dt).delete(e),S(this,Je)[p]=void 0,S(this,Ee)[p]=void 0,p===S(this,yt))ye(this,yt,S(this,Ht)[p]);else if(p===S(this,Et))ye(this,Et,S(this,Pt)[p]);else{const m=S(this,Ht)[p];S(this,Pt)[m]=S(this,Pt)[p];const y=S(this,Pt)[p];S(this,Ht)[y]=S(this,Ht)[p]}Wa(this,pt)._--,S(this,kn).push(p)}}if(S(this,Rt)&&((c=S(this,vt))!=null&&c.length)){const p=S(this,vt);let h;for(;h=p==null?void 0:p.shift();)(d=S(this,bn))==null||d.call(this,...h)}return o},Ud=function(e){var n,o,i;for(const l of pe(this,oe,Lr).call(this,{allowStale:!0})){const c=S(this,Ee)[l];if(pe(this,oe,et).call(this,c))c.__abortController.abort(new Error("deleted"));else{const d=S(this,Je)[l];S(this,Tn)&&((n=S(this,wn))==null||n.call(this,c,d,e)),S(this,Rt)&&((o=S(this,vt))==null||o.push([c,d,e]))}}if(S(this,dt).clear(),S(this,Ee).fill(void 0),S(this,Je).fill(void 0),S(this,qt)&&S(this,En)&&(S(this,qt).fill(0),S(this,En).fill(0)),S(this,Sn)&&S(this,Sn).fill(0),ye(this,Et,0),ye(this,yt,0),S(this,kn).length=0,ye(this,xn,0),ye(this,pt,0),S(this,Rt)&&S(this,vt)){const l=S(this,vt);let c;for(;c=l==null?void 0:l.shift();)(i=S(this,bn))==null||i.call(this,...c)}};let mc=yc;const UB={cacheSize:15e6};class ZB{constructor(e){je(this,"_str");je(this,"_rawJson");je(this,"_zodSchema");je(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 Jr=class Jr{constructor(e){je(this,"fileDataCache");je(this,"fileDataRefs",new Map);const n={...UB,...e??{}};this.fileDataCache=new mc({maxSize:n.cacheSize,fetchMethod:async o=>new ZB(await mu().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 Jr.globalInstance.getContentBytes(e)}static getContentString(e){return Jr.globalInstance.getContentString(e)}static getContentJson(e,n){return Jr.globalInstance.getContentJson(e,n)}};je(Jr,"globalInstance",new Jr);let gc=Jr;L.AgGridTheme=Mu,L.BlockLayout=GN,L.ContextProvider=SE,L.DataTable=p0,L.DemoData=SN,L.DropdownListItem=yo,L.LongText=Ml,L.MultiError=Xa,L.PlAccordion=Bk,L.PlAccordionSection=Gk,L.PlAgCellFile=fA,L.PlAgDataTable=cA,L.PlAgDataTableToolsPanel=sA,L.PlAgGridColumnManager=nh,L.PlAgOverlayLoading=Kp,L.PlAgOverlayNoRows=Xp,L.PlAgTextAndButtonCell=yA,L.PlAlert=U0,L.PlBlockPage=A0,L.PlBtnAccent=aw,L.PlBtnDanger=cw,L.PlBtnGhost=_o,L.PlBtnGroup=dp,L.PlBtnLink=hw,L.PlBtnPrimary=Ns,L.PlBtnSecondary=Pl,L.PlBtnSplit=nw,L.PlCheckbox=Gx,L.PlCheckboxGroup=Zx,L.PlChip=Gl,L.PlContainer=B0,L.PlDialogModal=zl,L.PlDropdown=wo,L.PlDropdownLegacy=ux,L.PlDropdownLine=Cp,L.PlDropdownMulti=Lx,L.PlDropdownRef=Gb,L.PlEditableTitle=Ow,L.PlFileDialog=Tp,L.PlFileInput=Up,L.PlGrid=O0,L.PlIcon16=Co,L.PlIcon24=Ci,L.PlLogView=bp,L.PlMaskIcon16=fn,L.PlMaskIcon24=Lt,L.PlNotificationAlert=Zp,L.PlNumberField=xx,L.PlProgressBar=gx,L.PlRow=R0,L.PlSearchField=gp,L.PlSectionSeparator=xp,L.PlSlideModal=Vs,L.PlSpacer=lp,L.PlTableFilters=LB,L.PlTabs=Sk,L.PlTextArea=Cb,L.PlTextField=Wr,L.PlToggleSwitch=Bs,L.PlTooltip=xt,L.ReactiveFileContent=gc,L.Scrollable=f1,L.Slider=Wp,L.SliderRange=d1,L.SliderRangeTriple=JE,L.ThemeSwitcher=b0,L.UnresolvedError=Ka,L.ValueOrErrorsComponent=pA,L.activateAgGrid=Lu,L.animate=np,L.animateInfinite=y0,L.call=Yu,L.computedResult=$B,L.createModel=nl,L.debounce=rp,L.defineApp=$_,L.defineStore=GB,L.delay=Ju,L.detectOutside=wb,L.ensureError=Qa,L.eventListener=Ol,L.formatZodError=tl,L.getElementScrollPosition=vp,L.identity=Ja,L.isDefined=Mg,L.isElementVisible=yp,L.isJsonEqual=Ya,L.isZodError=el,L.listToOptions=v0,L.makeEaseInOut=g0,L.makeEaseOut=tp,L.maskIcons16=xN,L.maskIcons24=kN,L.normalizeListOptions=yr,L.notEmpty=Tl,L.randomInt=ep,L.randomString=m0,L.requestTick=Nl,L.scrollIntoView=wi,L.showContextMenu=kl,L.throttle=op,L.timeout=Qu,L.unwrapOptionalResult=Lg,L.unwrapValueOrErrors=Jd,L.useClickOutside=As,L.useDraggable=$E,L.useEventListener=st,L.useFormState=ME,L.useHover=Ku,L.useInterval=LE,L.useLabelNotch=Xn,L.useLocalStorage=ip,L.useMouse=qu,L.useMouseCapture=gr,L.usePosition=vo,L.useQuery=GE,L.useResizeObserver=jp,L.useScroll=FE,L.useSdkPlugin=_l,L.useSortable=qp,L.useTheme=ap,L.useWatchFetch=Ih,L.wrapOptionalResult=Qd,L.wrapValueOrErrors=Og,Object.defineProperty(L,Symbol.toStringTag,{value:"Module"})});