@platforma-sdk/ui-vue 1.8.26 → 1.9.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/lib.umd.cjs CHANGED
@@ -1,89 +1,89 @@
1
- (function(R,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):(R=typeof globalThis<"u"?globalThis:R||self,r(R.SdkVueLib={},R.Vue,R.core$1,R.core,R.clientSideRowModel,R.infiniteRowModel,R.serverSideRowModel,R.csvExport,R.clipboard,R.rangeSelection,R.richSelect,R.menu,R.excelExport,R.theming,R.vue3))})(this,function(R,r,Re,w,Ko,$f,nd,Uf,rd,id,Wf,Hf,jf,qf,Kf){"use strict";var NF=Object.defineProperty;var Gf=R=>{throw TypeError(R)};var DF=(R,r,Re)=>r in R?NF(R,r,{enumerable:!0,configurable:!0,writable:!0,value:Re}):R[r]=Re;var Ge=(R,r,Re)=>DF(R,typeof r!="symbol"?r+"":r,Re),Jc=(R,r,Re)=>r.has(R)||Gf("Cannot "+Re);var C=(R,r,Re)=>(Jc(R,r,"read from private field"),Re?Re.call(R):r.get(R)),Le=(R,r,Re)=>r.has(R)?Gf("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(R):r.set(R,Re),he=(R,r,Re,w)=>(Jc(R,r,"write to private field"),w?w.call(R,Re):r.set(R,Re),Re),ae=(R,r,Re)=>(Jc(R,r,"access private method"),Re);var va=(R,r,Re,w)=>({set _(Ko){he(R,r,Ko,Re)},get _(){return C(R,r,w)}});var op,ci,sp,ap,cn,Mt,dn,un,di,ui,ot,pn,rt,We,we,bt,It,yt,ct,hn,dt,fn,mn,Lt,gn,hr,xt,ee,Xc,Rr,Ln,bo,Ot,Zf,Mr,pi,xo,xr,kr,Qc,_a,Ca,je,ed,qo,Sr,td;function Yf(t,e){if(t==null)throw Error(e??"Empty (null | undefined) value");return t}function Jf(t){return t!==null&&typeof t=="object"}function Nn(t){if(Array.isArray(t)){const e=[];for(let n=0;n<t.length;n++)e[n]=Nn(t[n]);return e}else if(Jf(t)){const e={};return Object.keys(t).forEach(n=>{e[n]=Nn(t[n])}),e}else return t}function wa(t,e,n=!0){let i=0,s;return function(...l){s=()=>{t.apply(this,l),i=new Date().getTime()+e,s=null,n&&setTimeout(()=>{s&&s()},e)},new Date().getTime()>i&&s()}}function Xf(t){let e=0n,n;return async function(...i){const s=++e;try{await n}catch{}if(e!==s)return{ok:!1};const l=t(...i);return n=l,{ok:!0,value:await l}}}var Ai=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Qf(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var em=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,d)=>`${s}${d===0?"":","}${t(l===void 0||typeof l=="symbol"?null:l)}`,"")}]`:`{${Object.keys(e).sort().reduce((i,s)=>{if(e[s]===void 0||typeof e[s]=="symbol")return i;const l=i.length===0?"":",";return`${i}${l}${t(s)}:${t(e[s])}`},"")}}`};const Pi=Qf(em);class ba extends Error{}class xa extends Error{constructor(e){super(e.join(`
1
+ (function(D,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):(D=typeof globalThis<"u"?globalThis:D||self,r(D.SdkVueLib={},D.Vue,D.core$1,D.core,D.clientSideRowModel,D.infiniteRowModel,D.serverSideRowModel,D.csvExport,D.clipboard,D.rangeSelection,D.richSelect,D.menu,D.excelExport,D.theming,D.vue3))})(this,function(D,r,Re,b,Ko,$f,nd,Uf,rd,id,Wf,Hf,jf,qf,Kf){"use strict";var DF=Object.defineProperty;var Gf=D=>{throw TypeError(D)};var FF=(D,r,Re)=>r in D?DF(D,r,{enumerable:!0,configurable:!0,writable:!0,value:Re}):D[r]=Re;var Ge=(D,r,Re)=>FF(D,typeof r!="symbol"?r+"":r,Re),Jc=(D,r,Re)=>r.has(D)||Gf("Cannot "+Re);var w=(D,r,Re)=>(Jc(D,r,"read from private field"),Re?Re.call(D):r.get(D)),Le=(D,r,Re)=>r.has(D)?Gf("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(D):r.set(D,Re),he=(D,r,Re,b)=>(Jc(D,r,"write to private field"),b?b.call(D,Re):r.set(D,Re),Re),ae=(D,r,Re)=>(Jc(D,r,"access private method"),Re);var va=(D,r,Re,b)=>({set _(Ko){he(D,r,Ko,Re)},get _(){return w(D,r,b)}});var op,ci,sp,ap,cn,Mt,dn,un,di,ui,ot,pn,rt,We,we,bt,It,yt,ct,hn,dt,fn,mn,Lt,gn,hr,xt,ee,Xc,Rr,Ln,bo,Ot,Zf,Mr,pi,xo,xr,kr,Qc,_a,Ca,je,ed,qo,Sr,td;function Yf(t,e){if(t==null)throw Error(e??"Empty (null | undefined) value");return t}function Jf(t){return t!==null&&typeof t=="object"}function Nn(t){if(Array.isArray(t)){const e=[];for(let n=0;n<t.length;n++)e[n]=Nn(t[n]);return e}else if(Jf(t)){const e={};return Object.keys(t).forEach(n=>{e[n]=Nn(t[n])}),e}else return t}function wa(t,e,n=!0){let i=0,s;return function(...l){s=()=>{t.apply(this,l),i=new Date().getTime()+e,s=null,n&&setTimeout(()=>{s&&s()},e)},new Date().getTime()>i&&s()}}function Xf(t){let e=0n,n;return async function(...i){const s=++e;try{await n}catch{}if(e!==s)return{ok:!1};const l=t(...i);return n=l,{ok:!0,value:await l}}}var Ai=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Qf(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var em=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((i,s)=>{if(e[s]===void 0||typeof e[s]=="symbol")return i;const l=i.length===0?"":",";return`${i}${l}${t(s)}:${t(e[s])}`},"")}}`};const Pi=Qf(em);class ba extends Error{}class xa extends Error{constructor(e){super(e.join(`
2
2
  `)),this.errors=e}toString(){return this.errors.join(`
3
- `)}}function tm(t){return{ok:!0,value:t}}function od(t){if(!t)throw new ba;if(!t.ok)throw Error(t.errors.join(";"));return t.value}function sd(t){return{value:t,errors:void 0}}function nm(t){if(t.errors)throw new xa(t.errors);if(!t.value)throw new ba;return t.value}function rm(t){return t!==void 0}function ka(t,e){return Pi(t)===Pi(e)}const Sa=t=>t,Ea=t=>t instanceof Error?t:Error(String(t)),Ta=t=>t.name==="ZodError",Ba=t=>{const{formErrors:e,fieldErrors:n}=t.flatten(),i=Object.entries(n).map(([s,l])=>s+":"+(l==null?void 0:l.join(",")));return e.concat(i).join("; ")};function Aa(t){const e=t.validate??Sa,{autoSave:n}=t,i=r.ref(),s=r.ref(),l=F=>{s.value={model:Nn(F)}};r.watch(()=>t.get(),F=>l(F),{immediate:!0});const d=()=>{var F;t.onSave(e(Nn((F=s.value)==null?void 0:F.model)))},u=()=>{l(t.get()),i.value=void 0},p=F=>{const T=Ea(F);Ta(T)?i.value=Error(Ba(T)):i.value=T},f=F=>{i.value=void 0;try{e(F),n&&d()}catch(T){p(T)}},m=r.computed({get:()=>{var F;return(F=s.value)==null?void 0:F.model},set(F){l(F),f(F)}});r.watch(s,(F,T)=>{F&&F===T&&f(F.model)},{deep:!0});const v=r.computed(()=>!i.value),S=r.computed(()=>!ka(t.get(),r.unref(s))),x=r.computed(()=>i.value?i.value.message:"");return r.reactive({model:m,valid:v,isChanged:S,error:i,errorString:x,save:d,revert:u,setError:p})}function im(t,e){const n=t.validate??Sa,{autoSave:i}=t,s=r.ref(),l=r.ref(),d=T=>{l.value={model:Object.assign(Nn(T),e??{}),stage:Symbol()}};r.watch(()=>t.get(),T=>d(T),{immediate:!0});const u=()=>{var T;t.onSave(n(Nn((T=l.value)==null?void 0:T.model)))},p=()=>{d(t.get()),s.value=void 0},f=T=>{const A=Ea(T);Ta(A)?s.value=Error(Ba(A)):s.value=A},m=T=>{s.value=void 0;try{n(T),i&&u()}catch(A){f(A)}},v=r.computed({get:()=>{var T;return(T=l.value)==null?void 0:T.model},set(){throw Error("Cannot replace base model")}});r.watch([()=>({args:v.value.args,ui:v.value.ui}),()=>{var T;return(T=l.value)==null?void 0:T.stage}],([T,A],[k,D])=>{A===D&&m(T)},{deep:!0});const S=r.computed(()=>!s.value),x=r.computed(()=>{var k;const{args:T,ui:A}=((k=r.unref(l))==null?void 0:k.model)??{};return!ka(t.get(),{args:T,ui:A})}),F=r.computed(()=>s.value?s.value.message:"");return r.reactive({model:v,valid:S,isChanged:x,error:s,errorString:F,save:u,revert:p,setError:f})}const om=t=>Object.fromEntries(new URL(t,"http://dummy").searchParams);function sm(t,e){const i=wa(e.setBlockArgs,100),s=wa(e.setBlockUiState,100),l=wa(e.setBlockArgsAndUiState,100),d=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 T=>{T.forEach(A=>{A.key==="args"&&(d.args=Object.freeze(A.value)),A.key==="ui"&&(d.ui=Object.freeze(A.value)),A.key==="outputs"&&(d.outputs=Object.freeze(A.value)),A.key==="navigationState"&&(d.navigationState=Object.freeze(A.value))}),await r.nextTick()});const u=()=>Nn(d.args),p=()=>Nn(d.ui),f=()=>Nn(d.navigationState),m={createArgsModel(T={}){return Aa({get(){return T.transform?T.transform(d.args):d.args},validate:T.validate,autoSave:!0,onSave(A){i(A)}})},createUiModel(T={},A){return Aa({get(){return T.transform?T.transform(d.ui):d.ui??A()},validate:T.validate,autoSave:!0,onSave(k){s(k)}})},useOutputs(...T){const A=r.reactive({errors:void 0,value:void 0});return r.watch(()=>d.outputs,()=>{try{Object.assign(A,{value:this.unwrapOutputs(...T),errors:void 0})}catch(k){Object.assign(A,{value:void 0,errors:[String(k)]})}},{immediate:!0,deep:!0}),A},unwrapOutputs(...T){const A=d.outputs,k=T.map(D=>[D,od(A[D])]);return Object.fromEntries(k)},getOutputField(T){return d.outputs[T]},getOutputFieldOkOptional(T){console.warn("use reactive app.outputValues.fieldName instead instead of getOutputFieldOkOptional(fieldName)");const A=this.getOutputField(T);if(A&&A.ok)return A.value},getOutputFieldErrorsOptional(T){console.warn("use reactive app.outputErrors.fieldName instead instead of getOutputFieldErrorsOptional(fieldName)");const A=this.getOutputField(T);if(A&&!A.ok)return A.errors},updateArgs(T){const A=u();return T(A),e.setBlockArgs(A)},updateUiState(T){const A=p();return e.setBlockUiState(T(A))},updateNavigationState(T){const A=f();return T(A),e.setNavigationState(A)},navigateTo(T){const A=f();return A.href=T,e.setNavigationState(A)}},v=r.computed(()=>{const T=Object.entries(d.outputs).map(([A,k])=>[A,k.ok&&k.value!==void 0?k.value:void 0]);return Object.fromEntries(T)}),S=r.computed(()=>{const T=Object.entries(d.outputs).map(([A,k])=>[A,k&&!k.ok?new xa(k.errors):void 0]);return Object.fromEntries(T)}),x={snapshot:d,queryParams:r.computed(()=>om(d.navigationState.href)),href:r.computed(()=>d.navigationState.href),hasErrors:r.computed(()=>Object.values(d.outputs).some(T=>!(T!=null&&T.ok))),outputValues:r.computed(()=>(console.warn("Change app.outputValues to app.model.outputs"),v.value)),outputErrors:r.computed(()=>(console.warn("Change app.outputErrors to app.model.outputErrors"),S.value)),args:r.computed(()=>(console.warn("Change app.args to app.snapshot.args"),d.args)),outputs:r.computed(()=>(console.warn("Change app.outputs to app.snapshot.outputs"),d.outputs)),ui:r.computed(()=>(console.warn("Change app.ui to app.snapshot.ui"),d.ui)),navigationState:r.computed(()=>(console.warn("Change app.navigationState to app.snapshot.navigationState"),d.navigationState))},F=im({get(){return{args:d.args,ui:d.ui}},autoSave:!0,onSave(T){l(T.args,T.ui)}},{outputs:v,outputErrors:S});return r.reactive(Object.assign(F,m,x))}var Me;(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 d of s)l[d]=d;return l},t.getValidEnumValues=s=>{const l=t.objectKeys(s).filter(u=>typeof s[s[u]]!="number"),d={};for(const u of l)d[u]=s[u];return t.objectValues(d)},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 d in s)Object.prototype.hasOwnProperty.call(s,d)&&l.push(d);return l},t.find=(s,l)=>{for(const d of s)if(l(d))return d},t.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&isFinite(s)&&Math.floor(s)===s;function i(s,l=" | "){return s.map(d=>typeof d=="string"?`'${d}'`:d).join(l)}t.joinValues=i,t.jsonStringifyReplacer=(s,l)=>typeof l=="bigint"?l.toString():l})(Me||(Me={}));var Pa;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(Pa||(Pa={}));const ie=Me.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Kn=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}},Y=Me.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"]),am=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:");class Ft extends Error{constructor(e){super(),this.issues=[],this.addIssue=i=>{this.issues=[...this.issues,i]},this.addIssues=(i=[])=>{this.issues=[...this.issues,...i]};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},i={_errors:[]},s=l=>{for(const d of l.issues)if(d.code==="invalid_union")d.unionErrors.map(s);else if(d.code==="invalid_return_type")s(d.returnTypeError);else if(d.code==="invalid_arguments")s(d.argumentsError);else if(d.path.length===0)i._errors.push(n(d));else{let u=i,p=0;for(;p<d.path.length;){const f=d.path[p];p===d.path.length-1?(u[f]=u[f]||{_errors:[]},u[f]._errors.push(n(d))):u[f]=u[f]||{_errors:[]},u=u[f],p++}}};return s(this),i}static assert(e){if(!(e instanceof Ft))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Me.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){const n={},i=[];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))):i.push(e(s));return{formErrors:i,fieldErrors:n}}get formErrors(){return this.flatten()}}Ft.create=t=>new Ft(t);const qr=(t,e)=>{let n;switch(t.code){case Y.invalid_type:t.received===ie.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case Y.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,Me.jsonStringifyReplacer)}`;break;case Y.unrecognized_keys:n=`Unrecognized key(s) in object: ${Me.joinValues(t.keys,", ")}`;break;case Y.invalid_union:n="Invalid input";break;case Y.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Me.joinValues(t.options)}`;break;case Y.invalid_enum_value:n=`Invalid enum value. Expected ${Me.joinValues(t.options)}, received '${t.received}'`;break;case Y.invalid_arguments:n="Invalid function arguments";break;case Y.invalid_return_type:n="Invalid function return type";break;case Y.invalid_date:n="Invalid date";break;case Y.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}"`:Me.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case Y.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 Y.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 Y.custom:n="Invalid input";break;case Y.invalid_intersection_types:n="Intersection results could not be merged";break;case Y.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case Y.not_finite:n="Number must be finite";break;default:n=e.defaultError,Me.assertNever(t)}return{message:n}};let ad=qr;function lm(t){ad=t}function Yo(){return ad}const Jo=t=>{const{data:e,path:n,errorMaps:i,issueData:s}=t,l=[...n,...s.path||[]],d={...s,path:l};if(s.message!==void 0)return{...s,path:l,message:s.message};let u="";const p=i.filter(f=>!!f).slice().reverse();for(const f of p)u=f(d,{data:e,defaultError:u}).message;return{...s,path:l,message:u}},cm=[];function ne(t,e){const n=Yo(),i=Jo({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===qr?void 0:qr].filter(s=>!!s)});t.common.issues.push(i)}class ft{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){const i=[];for(const s of n){if(s.status==="aborted")return _e;s.status==="dirty"&&e.dirty(),i.push(s.value)}return{status:e.value,value:i}}static async mergeObjectAsync(e,n){const i=[];for(const s of n){const l=await s.key,d=await s.value;i.push({key:l,value:d})}return ft.mergeObjectSync(e,i)}static mergeObjectSync(e,n){const i={};for(const s of n){const{key:l,value:d}=s;if(l.status==="aborted"||d.status==="aborted")return _e;l.status==="dirty"&&e.dirty(),d.status==="dirty"&&e.dirty(),l.value!=="__proto__"&&(typeof d.value<"u"||s.alwaysSet)&&(i[l.value]=d.value)}return{status:e.value,value:i}}}const _e=Object.freeze({status:"aborted"}),Kr=t=>({status:"dirty",value:t}),Ct=t=>({status:"valid",value:t}),Va=t=>t.status==="aborted",Na=t=>t.status==="dirty",Vi=t=>t.status==="valid",Ni=t=>typeof Promise<"u"&&t instanceof Promise;function Xo(t,e,n,i){if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e.get(t)}function ld(t,e,n,i,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 de;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(de||(de={}));var Di,Fi;class xn{constructor(e,n,i,s){this._cachedPath=[],this.parent=e,this.data=n,this._path=i,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 cd=(t,e)=>{if(Vi(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 Ft(t.common.issues);return this._error=n,this._error}}};function Se(t){if(!t)return{};const{errorMap:e,invalid_type_error:n,required_error:i,description:s}=t;if(e&&(n||i))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:(d,u)=>{var p,f;const{message:m}=t;return d.code==="invalid_enum_value"?{message:m??u.defaultError}:typeof u.data>"u"?{message:(p=m??i)!==null&&p!==void 0?p:u.defaultError}:d.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 Kn(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:Kn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new ft,ctx:{common:e.parent.common,data:e.data,parsedType:Kn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const n=this._parse(e);if(Ni(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 i=this.safeParse(e,n);if(i.success)return i.data;throw i.error}safeParse(e,n){var i;const s={common:{issues:[],async:(i=n==null?void 0:n.async)!==null&&i!==void 0?i:!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Kn(e)},l=this._parseSync({data:e,path:s.path,parent:s});return cd(s,l)}async parseAsync(e,n){const i=await this.safeParseAsync(e,n);if(i.success)return i.data;throw i.error}async safeParseAsync(e,n){const i={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:Kn(e)},s=this._parse({data:e,path:i.path,parent:i}),l=await(Ni(s)?s:Promise.resolve(s));return cd(i,l)}refine(e,n){const i=s=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(s):n;return this._refinement((s,l)=>{const d=e(s),u=()=>l.addIssue({code:Y.custom,...i(s)});return typeof Promise<"u"&&d instanceof Promise?d.then(p=>p?!0:(u(),!1)):d?!0:(u(),!1)})}refinement(e,n){return this._refinement((i,s)=>e(i)?!0:(s.addIssue(typeof n=="function"?n(i,s):n),!1))}_refinement(e){return new on({schema:this,typeName:ge.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return Sn.create(this,this._def)}nullable(){return Qn.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return rn.create(this,this._def)}promise(){return Qr.create(this,this._def)}or(e){return Li.create([this,e],this._def)}and(e){return Oi.create(this,e,this._def)}transform(e){return new on({...Se(this._def),schema:this,typeName:ge.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new Ui({...Se(this._def),innerType:this,defaultValue:n,typeName:ge.ZodDefault})}brand(){return new Ra({typeName:ge.ZodBranded,type:this,...Se(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new Wi({...Se(this._def),innerType:this,catchValue:n,typeName:ge.ZodCatch})}describe(e){const n=this.constructor;return new n({...this._def,description:e})}pipe(e){return Hi.create(this,e)}readonly(){return ji.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const dm=/^c[^\s-]{8,}$/i,um=/^[0-9a-z]+$/,pm=/^[0-9A-HJKMNP-TV-Z]{26}$/,hm=/^[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,fm=/^[a-z0-9_-]{21}$/i,mm=/^[-+]?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)?)??$/,gm=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,ym="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Da;const vm=/^(?:(?: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])$/,_m=/^(([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})))$/,Cm=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,dd="((\\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])))",wm=new RegExp(`^${dd}$`);function ud(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 bm(t){return new RegExp(`^${ud(t)}$`)}function pd(t){let e=`${dd}T${ud(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 xm(t,e){return!!((e==="v4"||!e)&&vm.test(t)||(e==="v6"||!e)&&_m.test(t))}class nn 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:Y.invalid_type,expected:ie.string,received:l.parsedType}),_e}const i=new ft;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:Y.too_small,minimum:l.value,type:"string",inclusive:!0,exact:!1,message:l.message}),i.dirty());else if(l.kind==="max")e.data.length>l.value&&(s=this._getOrReturnCtx(e,s),ne(s,{code:Y.too_big,maximum:l.value,type:"string",inclusive:!0,exact:!1,message:l.message}),i.dirty());else if(l.kind==="length"){const d=e.data.length>l.value,u=e.data.length<l.value;(d||u)&&(s=this._getOrReturnCtx(e,s),d?ne(s,{code:Y.too_big,maximum:l.value,type:"string",inclusive:!0,exact:!0,message:l.message}):u&&ne(s,{code:Y.too_small,minimum:l.value,type:"string",inclusive:!0,exact:!0,message:l.message}),i.dirty())}else if(l.kind==="email")gm.test(e.data)||(s=this._getOrReturnCtx(e,s),ne(s,{validation:"email",code:Y.invalid_string,message:l.message}),i.dirty());else if(l.kind==="emoji")Da||(Da=new RegExp(ym,"u")),Da.test(e.data)||(s=this._getOrReturnCtx(e,s),ne(s,{validation:"emoji",code:Y.invalid_string,message:l.message}),i.dirty());else if(l.kind==="uuid")hm.test(e.data)||(s=this._getOrReturnCtx(e,s),ne(s,{validation:"uuid",code:Y.invalid_string,message:l.message}),i.dirty());else if(l.kind==="nanoid")fm.test(e.data)||(s=this._getOrReturnCtx(e,s),ne(s,{validation:"nanoid",code:Y.invalid_string,message:l.message}),i.dirty());else if(l.kind==="cuid")dm.test(e.data)||(s=this._getOrReturnCtx(e,s),ne(s,{validation:"cuid",code:Y.invalid_string,message:l.message}),i.dirty());else if(l.kind==="cuid2")um.test(e.data)||(s=this._getOrReturnCtx(e,s),ne(s,{validation:"cuid2",code:Y.invalid_string,message:l.message}),i.dirty());else if(l.kind==="ulid")pm.test(e.data)||(s=this._getOrReturnCtx(e,s),ne(s,{validation:"ulid",code:Y.invalid_string,message:l.message}),i.dirty());else if(l.kind==="url")try{new URL(e.data)}catch{s=this._getOrReturnCtx(e,s),ne(s,{validation:"url",code:Y.invalid_string,message:l.message}),i.dirty()}else l.kind==="regex"?(l.regex.lastIndex=0,l.regex.test(e.data)||(s=this._getOrReturnCtx(e,s),ne(s,{validation:"regex",code:Y.invalid_string,message:l.message}),i.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:Y.invalid_string,validation:{includes:l.value,position:l.position},message:l.message}),i.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:Y.invalid_string,validation:{startsWith:l.value},message:l.message}),i.dirty()):l.kind==="endsWith"?e.data.endsWith(l.value)||(s=this._getOrReturnCtx(e,s),ne(s,{code:Y.invalid_string,validation:{endsWith:l.value},message:l.message}),i.dirty()):l.kind==="datetime"?pd(l).test(e.data)||(s=this._getOrReturnCtx(e,s),ne(s,{code:Y.invalid_string,validation:"datetime",message:l.message}),i.dirty()):l.kind==="date"?wm.test(e.data)||(s=this._getOrReturnCtx(e,s),ne(s,{code:Y.invalid_string,validation:"date",message:l.message}),i.dirty()):l.kind==="time"?bm(l).test(e.data)||(s=this._getOrReturnCtx(e,s),ne(s,{code:Y.invalid_string,validation:"time",message:l.message}),i.dirty()):l.kind==="duration"?mm.test(e.data)||(s=this._getOrReturnCtx(e,s),ne(s,{validation:"duration",code:Y.invalid_string,message:l.message}),i.dirty()):l.kind==="ip"?xm(e.data,l.version)||(s=this._getOrReturnCtx(e,s),ne(s,{validation:"ip",code:Y.invalid_string,message:l.message}),i.dirty()):l.kind==="base64"?Cm.test(e.data)||(s=this._getOrReturnCtx(e,s),ne(s,{validation:"base64",code:Y.invalid_string,message:l.message}),i.dirty()):Me.assertNever(l);return{status:i.value,value:e.data}}_regex(e,n,i){return this.refinement(s=>e.test(s),{validation:n,code:Y.invalid_string,...de.errToObj(i)})}_addCheck(e){return new nn({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...de.errToObj(e)})}url(e){return this._addCheck({kind:"url",...de.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...de.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...de.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...de.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...de.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...de.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...de.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...de.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...de.errToObj(e)})}datetime(e){var n,i;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:(i=e==null?void 0:e.local)!==null&&i!==void 0?i:!1,...de.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,...de.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...de.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...de.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n==null?void 0:n.position,...de.errToObj(n==null?void 0:n.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...de.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...de.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...de.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...de.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...de.errToObj(n)})}nonempty(e){return this.min(1,de.errToObj(e))}trim(){return new nn({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new nn({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new nn({...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}}nn.create=t=>{var e;return new nn({checks:[],typeName:ge.ZodString,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...Se(t)})};function km(t,e){const n=(t.toString().split(".")[1]||"").length,i=(e.toString().split(".")[1]||"").length,s=n>i?n:i,l=parseInt(t.toFixed(s).replace(".","")),d=parseInt(e.toFixed(s).replace(".",""));return l%d/Math.pow(10,s)}class Yn 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:Y.invalid_type,expected:ie.number,received:l.parsedType}),_e}let i;const s=new ft;for(const l of this._def.checks)l.kind==="int"?Me.isInteger(e.data)||(i=this._getOrReturnCtx(e,i),ne(i,{code:Y.invalid_type,expected:"integer",received:"float",message:l.message}),s.dirty()):l.kind==="min"?(l.inclusive?e.data<l.value:e.data<=l.value)&&(i=this._getOrReturnCtx(e,i),ne(i,{code:Y.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)&&(i=this._getOrReturnCtx(e,i),ne(i,{code:Y.too_big,maximum:l.value,type:"number",inclusive:l.inclusive,exact:!1,message:l.message}),s.dirty()):l.kind==="multipleOf"?km(e.data,l.value)!==0&&(i=this._getOrReturnCtx(e,i),ne(i,{code:Y.not_multiple_of,multipleOf:l.value,message:l.message}),s.dirty()):l.kind==="finite"?Number.isFinite(e.data)||(i=this._getOrReturnCtx(e,i),ne(i,{code:Y.not_finite,message:l.message}),s.dirty()):Me.assertNever(l);return{status:s.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,de.toString(n))}gt(e,n){return this.setLimit("min",e,!1,de.toString(n))}lte(e,n){return this.setLimit("max",e,!0,de.toString(n))}lt(e,n){return this.setLimit("max",e,!1,de.toString(n))}setLimit(e,n,i,s){return new Yn({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:i,message:de.toString(s)}]})}_addCheck(e){return new Yn({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:de.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:de.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:de.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:de.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:de.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:de.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:de.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:de.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:de.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"&&Me.isInteger(e.value))}get isFinite(){let e=null,n=null;for(const i of this._def.checks){if(i.kind==="finite"||i.kind==="int"||i.kind==="multipleOf")return!0;i.kind==="min"?(n===null||i.value>n)&&(n=i.value):i.kind==="max"&&(e===null||i.value<e)&&(e=i.value)}return Number.isFinite(n)&&Number.isFinite(e)}}Yn.create=t=>new Yn({checks:[],typeName:ge.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...Se(t)});class Jn 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:Y.invalid_type,expected:ie.bigint,received:l.parsedType}),_e}let i;const s=new ft;for(const l of this._def.checks)l.kind==="min"?(l.inclusive?e.data<l.value:e.data<=l.value)&&(i=this._getOrReturnCtx(e,i),ne(i,{code:Y.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)&&(i=this._getOrReturnCtx(e,i),ne(i,{code:Y.too_big,type:"bigint",maximum:l.value,inclusive:l.inclusive,message:l.message}),s.dirty()):l.kind==="multipleOf"?e.data%l.value!==BigInt(0)&&(i=this._getOrReturnCtx(e,i),ne(i,{code:Y.not_multiple_of,multipleOf:l.value,message:l.message}),s.dirty()):Me.assertNever(l);return{status:s.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,de.toString(n))}gt(e,n){return this.setLimit("min",e,!1,de.toString(n))}lte(e,n){return this.setLimit("max",e,!0,de.toString(n))}lt(e,n){return this.setLimit("max",e,!1,de.toString(n))}setLimit(e,n,i,s){return new Jn({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:i,message:de.toString(s)}]})}_addCheck(e){return new Jn({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:de.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:de.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:de.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:de.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:de.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}}Jn.create=t=>{var e;return new Jn({checks:[],typeName:ge.ZodBigInt,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...Se(t)})};class Ri extends Be{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==ie.boolean){const i=this._getOrReturnCtx(e);return ne(i,{code:Y.invalid_type,expected:ie.boolean,received:i.parsedType}),_e}return Ct(e.data)}}Ri.create=t=>new Ri({typeName:ge.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...Se(t)});class Er 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:Y.invalid_type,expected:ie.date,received:l.parsedType}),_e}if(isNaN(e.data.getTime())){const l=this._getOrReturnCtx(e);return ne(l,{code:Y.invalid_date}),_e}const i=new ft;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:Y.too_small,message:l.message,inclusive:!0,exact:!1,minimum:l.value,type:"date"}),i.dirty()):l.kind==="max"?e.data.getTime()>l.value&&(s=this._getOrReturnCtx(e,s),ne(s,{code:Y.too_big,message:l.message,inclusive:!0,exact:!1,maximum:l.value,type:"date"}),i.dirty()):Me.assertNever(l);return{status:i.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Er({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:de.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:de.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}}Er.create=t=>new Er({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:ge.ZodDate,...Se(t)});class Qo extends Be{_parse(e){if(this._getType(e)!==ie.symbol){const i=this._getOrReturnCtx(e);return ne(i,{code:Y.invalid_type,expected:ie.symbol,received:i.parsedType}),_e}return Ct(e.data)}}Qo.create=t=>new Qo({typeName:ge.ZodSymbol,...Se(t)});class Mi extends Be{_parse(e){if(this._getType(e)!==ie.undefined){const i=this._getOrReturnCtx(e);return ne(i,{code:Y.invalid_type,expected:ie.undefined,received:i.parsedType}),_e}return Ct(e.data)}}Mi.create=t=>new Mi({typeName:ge.ZodUndefined,...Se(t)});class Ii extends Be{_parse(e){if(this._getType(e)!==ie.null){const i=this._getOrReturnCtx(e);return ne(i,{code:Y.invalid_type,expected:ie.null,received:i.parsedType}),_e}return Ct(e.data)}}Ii.create=t=>new Ii({typeName:ge.ZodNull,...Se(t)});class Yr extends Be{constructor(){super(...arguments),this._any=!0}_parse(e){return Ct(e.data)}}Yr.create=t=>new Yr({typeName:ge.ZodAny,...Se(t)});class Tr extends Be{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Ct(e.data)}}Tr.create=t=>new Tr({typeName:ge.ZodUnknown,...Se(t)});class Dn extends Be{_parse(e){const n=this._getOrReturnCtx(e);return ne(n,{code:Y.invalid_type,expected:ie.never,received:n.parsedType}),_e}}Dn.create=t=>new Dn({typeName:ge.ZodNever,...Se(t)});class es extends Be{_parse(e){if(this._getType(e)!==ie.undefined){const i=this._getOrReturnCtx(e);return ne(i,{code:Y.invalid_type,expected:ie.void,received:i.parsedType}),_e}return Ct(e.data)}}es.create=t=>new es({typeName:ge.ZodVoid,...Se(t)});class rn extends Be{_parse(e){const{ctx:n,status:i}=this._processInputParams(e),s=this._def;if(n.parsedType!==ie.array)return ne(n,{code:Y.invalid_type,expected:ie.array,received:n.parsedType}),_e;if(s.exactLength!==null){const d=n.data.length>s.exactLength.value,u=n.data.length<s.exactLength.value;(d||u)&&(ne(n,{code:d?Y.too_big:Y.too_small,minimum:u?s.exactLength.value:void 0,maximum:d?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),i.dirty())}if(s.minLength!==null&&n.data.length<s.minLength.value&&(ne(n,{code:Y.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),i.dirty()),s.maxLength!==null&&n.data.length>s.maxLength.value&&(ne(n,{code:Y.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),i.dirty()),n.common.async)return Promise.all([...n.data].map((d,u)=>s.type._parseAsync(new xn(n,d,n.path,u)))).then(d=>ft.mergeArray(i,d));const l=[...n.data].map((d,u)=>s.type._parseSync(new xn(n,d,n.path,u)));return ft.mergeArray(i,l)}get element(){return this._def.type}min(e,n){return new rn({...this._def,minLength:{value:e,message:de.toString(n)}})}max(e,n){return new rn({...this._def,maxLength:{value:e,message:de.toString(n)}})}length(e,n){return new rn({...this._def,exactLength:{value:e,message:de.toString(n)}})}nonempty(e){return this.min(1,e)}}rn.create=(t,e)=>new rn({type:t,minLength:null,maxLength:null,exactLength:null,typeName:ge.ZodArray,...Se(e)});function Jr(t){if(t instanceof Ke){const e={};for(const n in t.shape){const i=t.shape[n];e[n]=Sn.create(Jr(i))}return new Ke({...t._def,shape:()=>e})}else return t instanceof rn?new rn({...t._def,type:Jr(t.element)}):t instanceof Sn?Sn.create(Jr(t.unwrap())):t instanceof Qn?Qn.create(Jr(t.unwrap())):t instanceof kn?kn.create(t.items.map(e=>Jr(e))):t}class Ke 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=Me.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:Y.invalid_type,expected:ie.object,received:f.parsedType}),_e}const{status:i,ctx:s}=this._processInputParams(e),{shape:l,keys:d}=this._getCached(),u=[];if(!(this._def.catchall instanceof Dn&&this._def.unknownKeys==="strip"))for(const f in s.data)d.includes(f)||u.push(f);const p=[];for(const f of d){const m=l[f],v=s.data[f];p.push({key:{status:"valid",value:f},value:m._parse(new xn(s,v,s.path,f)),alwaysSet:f in s.data})}if(this._def.catchall instanceof Dn){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:Y.unrecognized_keys,keys:u}),i.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 v=s.data[m];p.push({key:{status:"valid",value:m},value:f._parse(new xn(s,v,s.path,m)),alwaysSet:m in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const f=[];for(const m of p){const v=await m.key,S=await m.value;f.push({key:v,value:S,alwaysSet:m.alwaysSet})}return f}).then(f=>ft.mergeObjectSync(i,f)):ft.mergeObjectSync(i,p)}get shape(){return this._def.shape()}strict(e){return de.errToObj,new Ke({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,i)=>{var s,l,d,u;const p=(d=(l=(s=this._def).errorMap)===null||l===void 0?void 0:l.call(s,n,i).message)!==null&&d!==void 0?d:i.defaultError;return n.code==="unrecognized_keys"?{message:(u=de.errToObj(e).message)!==null&&u!==void 0?u:p}:{message:p}}}:{}})}strip(){return new Ke({...this._def,unknownKeys:"strip"})}passthrough(){return new Ke({...this._def,unknownKeys:"passthrough"})}extend(e){return new Ke({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Ke({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:ge.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new Ke({...this._def,catchall:e})}pick(e){const n={};return Me.objectKeys(e).forEach(i=>{e[i]&&this.shape[i]&&(n[i]=this.shape[i])}),new Ke({...this._def,shape:()=>n})}omit(e){const n={};return Me.objectKeys(this.shape).forEach(i=>{e[i]||(n[i]=this.shape[i])}),new Ke({...this._def,shape:()=>n})}deepPartial(){return Jr(this)}partial(e){const n={};return Me.objectKeys(this.shape).forEach(i=>{const s=this.shape[i];e&&!e[i]?n[i]=s:n[i]=s.optional()}),new Ke({...this._def,shape:()=>n})}required(e){const n={};return Me.objectKeys(this.shape).forEach(i=>{if(e&&!e[i])n[i]=this.shape[i];else{let l=this.shape[i];for(;l instanceof Sn;)l=l._def.innerType;n[i]=l}}),new Ke({...this._def,shape:()=>n})}keyof(){return hd(Me.objectKeys(this.shape))}}Ke.create=(t,e)=>new Ke({shape:()=>t,unknownKeys:"strip",catchall:Dn.create(),typeName:ge.ZodObject,...Se(e)}),Ke.strictCreate=(t,e)=>new Ke({shape:()=>t,unknownKeys:"strict",catchall:Dn.create(),typeName:ge.ZodObject,...Se(e)}),Ke.lazycreate=(t,e)=>new Ke({shape:t,unknownKeys:"strip",catchall:Dn.create(),typeName:ge.ZodObject,...Se(e)});class Li extends Be{_parse(e){const{ctx:n}=this._processInputParams(e),i=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 d=l.map(u=>new Ft(u.ctx.common.issues));return ne(n,{code:Y.invalid_union,unionErrors:d}),_e}if(n.common.async)return Promise.all(i.map(async l=>{const d={...n,common:{...n.common,issues:[]},parent:null};return{result:await l._parseAsync({data:n.data,path:n.path,parent:d}),ctx:d}})).then(s);{let l;const d=[];for(const p of i){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&&d.push(f.common.issues)}if(l)return n.common.issues.push(...l.ctx.common.issues),l.result;const u=d.map(p=>new Ft(p));return ne(n,{code:Y.invalid_union,unionErrors:u}),_e}}get options(){return this._def.options}}Li.create=(t,e)=>new Li({options:t,typeName:ge.ZodUnion,...Se(e)});const Fn=t=>t instanceof zi?Fn(t.schema):t instanceof on?Fn(t.innerType()):t instanceof Zi?[t.value]:t instanceof Xn?t.options:t instanceof $i?Me.objectValues(t.enum):t instanceof Ui?Fn(t._def.innerType):t instanceof Mi?[void 0]:t instanceof Ii?[null]:t instanceof Sn?[void 0,...Fn(t.unwrap())]:t instanceof Qn?[null,...Fn(t.unwrap())]:t instanceof Ra||t instanceof ji?Fn(t.unwrap()):t instanceof Wi?Fn(t._def.innerType):[];class ts extends Be{_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==ie.object)return ne(n,{code:Y.invalid_type,expected:ie.object,received:n.parsedType}),_e;const i=this.discriminator,s=n.data[i],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:Y.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[i]}),_e)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,i){const s=new Map;for(const l of n){const d=Fn(l.shape[e]);if(!d.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const u of d){if(s.has(u))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(u)}`);s.set(u,l)}}return new ts({typeName:ge.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:s,...Se(i)})}}function Fa(t,e){const n=Kn(t),i=Kn(e);if(t===e)return{valid:!0,data:t};if(n===ie.object&&i===ie.object){const s=Me.objectKeys(e),l=Me.objectKeys(t).filter(u=>s.indexOf(u)!==-1),d={...t,...e};for(const u of l){const p=Fa(t[u],e[u]);if(!p.valid)return{valid:!1};d[u]=p.data}return{valid:!0,data:d}}else if(n===ie.array&&i===ie.array){if(t.length!==e.length)return{valid:!1};const s=[];for(let l=0;l<t.length;l++){const d=t[l],u=e[l],p=Fa(d,u);if(!p.valid)return{valid:!1};s.push(p.data)}return{valid:!0,data:s}}else return n===ie.date&&i===ie.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class Oi extends Be{_parse(e){const{status:n,ctx:i}=this._processInputParams(e),s=(l,d)=>{if(Va(l)||Va(d))return _e;const u=Fa(l.value,d.value);return u.valid?((Na(l)||Na(d))&&n.dirty(),{status:n.value,value:u.data}):(ne(i,{code:Y.invalid_intersection_types}),_e)};return i.common.async?Promise.all([this._def.left._parseAsync({data:i.data,path:i.path,parent:i}),this._def.right._parseAsync({data:i.data,path:i.path,parent:i})]).then(([l,d])=>s(l,d)):s(this._def.left._parseSync({data:i.data,path:i.path,parent:i}),this._def.right._parseSync({data:i.data,path:i.path,parent:i}))}}Oi.create=(t,e,n)=>new Oi({left:t,right:e,typeName:ge.ZodIntersection,...Se(n)});class kn extends Be{_parse(e){const{status:n,ctx:i}=this._processInputParams(e);if(i.parsedType!==ie.array)return ne(i,{code:Y.invalid_type,expected:ie.array,received:i.parsedType}),_e;if(i.data.length<this._def.items.length)return ne(i,{code:Y.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),_e;!this._def.rest&&i.data.length>this._def.items.length&&(ne(i,{code:Y.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const l=[...i.data].map((d,u)=>{const p=this._def.items[u]||this._def.rest;return p?p._parse(new xn(i,d,i.path,u)):null}).filter(d=>!!d);return i.common.async?Promise.all(l).then(d=>ft.mergeArray(n,d)):ft.mergeArray(n,l)}get items(){return this._def.items}rest(e){return new kn({...this._def,rest:e})}}kn.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new kn({items:t,typeName:ge.ZodTuple,rest:null,...Se(e)})};class Gi extends Be{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:i}=this._processInputParams(e);if(i.parsedType!==ie.object)return ne(i,{code:Y.invalid_type,expected:ie.object,received:i.parsedType}),_e;const s=[],l=this._def.keyType,d=this._def.valueType;for(const u in i.data)s.push({key:l._parse(new xn(i,u,i.path,u)),value:d._parse(new xn(i,i.data[u],i.path,u)),alwaysSet:u in i.data});return i.common.async?ft.mergeObjectAsync(n,s):ft.mergeObjectSync(n,s)}get element(){return this._def.valueType}static create(e,n,i){return n instanceof Be?new Gi({keyType:e,valueType:n,typeName:ge.ZodRecord,...Se(i)}):new Gi({keyType:nn.create(),valueType:e,typeName:ge.ZodRecord,...Se(n)})}}class ns extends Be{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:i}=this._processInputParams(e);if(i.parsedType!==ie.map)return ne(i,{code:Y.invalid_type,expected:ie.map,received:i.parsedType}),_e;const s=this._def.keyType,l=this._def.valueType,d=[...i.data.entries()].map(([u,p],f)=>({key:s._parse(new xn(i,u,i.path,[f,"key"])),value:l._parse(new xn(i,p,i.path,[f,"value"]))}));if(i.common.async){const u=new Map;return Promise.resolve().then(async()=>{for(const p of d){const f=await p.key,m=await p.value;if(f.status==="aborted"||m.status==="aborted")return _e;(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 d){const f=p.key,m=p.value;if(f.status==="aborted"||m.status==="aborted")return _e;(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:ge.ZodMap,...Se(n)});class Br extends Be{_parse(e){const{status:n,ctx:i}=this._processInputParams(e);if(i.parsedType!==ie.set)return ne(i,{code:Y.invalid_type,expected:ie.set,received:i.parsedType}),_e;const s=this._def;s.minSize!==null&&i.data.size<s.minSize.value&&(ne(i,{code:Y.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),n.dirty()),s.maxSize!==null&&i.data.size>s.maxSize.value&&(ne(i,{code:Y.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),n.dirty());const l=this._def.valueType;function d(p){const f=new Set;for(const m of p){if(m.status==="aborted")return _e;m.status==="dirty"&&n.dirty(),f.add(m.value)}return{status:n.value,value:f}}const u=[...i.data.values()].map((p,f)=>l._parse(new xn(i,p,i.path,f)));return i.common.async?Promise.all(u).then(p=>d(p)):d(u)}min(e,n){return new Br({...this._def,minSize:{value:e,message:de.toString(n)}})}max(e,n){return new Br({...this._def,maxSize:{value:e,message:de.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}}Br.create=(t,e)=>new Br({valueType:t,minSize:null,maxSize:null,typeName:ge.ZodSet,...Se(e)});class Xr 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:Y.invalid_type,expected:ie.function,received:n.parsedType}),_e;function i(u,p){return Jo({data:u,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Yo(),qr].filter(f=>!!f),issueData:{code:Y.invalid_arguments,argumentsError:p}})}function s(u,p){return Jo({data:u,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Yo(),qr].filter(f=>!!f),issueData:{code:Y.invalid_return_type,returnTypeError:p}})}const l={errorMap:n.common.contextualErrorMap},d=n.data;if(this._def.returns instanceof Qr){const u=this;return Ct(async function(...p){const f=new Ft([]),m=await u._def.args.parseAsync(p,l).catch(x=>{throw f.addIssue(i(p,x)),f}),v=await Reflect.apply(d,this,m);return await u._def.returns._def.type.parseAsync(v,l).catch(x=>{throw f.addIssue(s(v,x)),f})})}else{const u=this;return Ct(function(...p){const f=u._def.args.safeParse(p,l);if(!f.success)throw new Ft([i(p,f.error)]);const m=Reflect.apply(d,this,f.data),v=u._def.returns.safeParse(m,l);if(!v.success)throw new Ft([s(m,v.error)]);return v.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new Xr({...this._def,args:kn.create(e).rest(Tr.create())})}returns(e){return new Xr({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,n,i){return new Xr({args:e||kn.create([]).rest(Tr.create()),returns:n||Tr.create(),typeName:ge.ZodFunction,...Se(i)})}}class zi 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})}}zi.create=(t,e)=>new zi({getter:t,typeName:ge.ZodLazy,...Se(e)});class Zi extends Be{_parse(e){if(e.data!==this._def.value){const n=this._getOrReturnCtx(e);return ne(n,{received:n.data,code:Y.invalid_literal,expected:this._def.value}),_e}return{status:"valid",value:e.data}}get value(){return this._def.value}}Zi.create=(t,e)=>new Zi({value:t,typeName:ge.ZodLiteral,...Se(e)});function hd(t,e){return new Xn({values:t,typeName:ge.ZodEnum,...Se(e)})}class Xn extends Be{constructor(){super(...arguments),Di.set(this,void 0)}_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),i=this._def.values;return ne(n,{expected:Me.joinValues(i),received:n.parsedType,code:Y.invalid_type}),_e}if(Xo(this,Di)||ld(this,Di,new Set(this._def.values)),!Xo(this,Di).has(e.data)){const n=this._getOrReturnCtx(e),i=this._def.values;return ne(n,{received:n.data,code:Y.invalid_enum_value,options:i}),_e}return Ct(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 Xn.create(e,{...this._def,...n})}exclude(e,n=this._def){return Xn.create(this.options.filter(i=>!e.includes(i)),{...this._def,...n})}}Di=new WeakMap,Xn.create=hd;class $i extends Be{constructor(){super(...arguments),Fi.set(this,void 0)}_parse(e){const n=Me.getValidEnumValues(this._def.values),i=this._getOrReturnCtx(e);if(i.parsedType!==ie.string&&i.parsedType!==ie.number){const s=Me.objectValues(n);return ne(i,{expected:Me.joinValues(s),received:i.parsedType,code:Y.invalid_type}),_e}if(Xo(this,Fi)||ld(this,Fi,new Set(Me.getValidEnumValues(this._def.values))),!Xo(this,Fi).has(e.data)){const s=Me.objectValues(n);return ne(i,{received:i.data,code:Y.invalid_enum_value,options:s}),_e}return Ct(e.data)}get enum(){return this._def.values}}Fi=new WeakMap,$i.create=(t,e)=>new $i({values:t,typeName:ge.ZodNativeEnum,...Se(e)});class Qr 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:Y.invalid_type,expected:ie.promise,received:n.parsedType}),_e;const i=n.parsedType===ie.promise?n.data:Promise.resolve(n.data);return Ct(i.then(s=>this._def.type.parseAsync(s,{path:n.path,errorMap:n.common.contextualErrorMap})))}}Qr.create=(t,e)=>new Qr({type:t,typeName:ge.ZodPromise,...Se(e)});class on extends Be{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ge.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:n,ctx:i}=this._processInputParams(e),s=this._def.effect||null,l={addIssue:d=>{ne(i,d),d.fatal?n.abort():n.dirty()},get path(){return i.path}};if(l.addIssue=l.addIssue.bind(l),s.type==="preprocess"){const d=s.transform(i.data,l);if(i.common.async)return Promise.resolve(d).then(async u=>{if(n.value==="aborted")return _e;const p=await this._def.schema._parseAsync({data:u,path:i.path,parent:i});return p.status==="aborted"?_e:p.status==="dirty"||n.value==="dirty"?Kr(p.value):p});{if(n.value==="aborted")return _e;const u=this._def.schema._parseSync({data:d,path:i.path,parent:i});return u.status==="aborted"?_e:u.status==="dirty"||n.value==="dirty"?Kr(u.value):u}}if(s.type==="refinement"){const d=u=>{const p=s.refinement(u,l);if(i.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(i.common.async===!1){const u=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});return u.status==="aborted"?_e:(u.status==="dirty"&&n.dirty(),d(u.value),{status:n.value,value:u.value})}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(u=>u.status==="aborted"?_e:(u.status==="dirty"&&n.dirty(),d(u.value).then(()=>({status:n.value,value:u.value}))))}if(s.type==="transform")if(i.common.async===!1){const d=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});if(!Vi(d))return d;const u=s.transform(d.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:i.data,path:i.path,parent:i}).then(d=>Vi(d)?Promise.resolve(s.transform(d.value,l)).then(u=>({status:n.value,value:u})):d);Me.assertNever(s)}}on.create=(t,e,n)=>new on({schema:t,typeName:ge.ZodEffects,effect:e,...Se(n)}),on.createWithPreprocess=(t,e,n)=>new on({schema:e,effect:{type:"preprocess",transform:t},typeName:ge.ZodEffects,...Se(n)});class Sn extends Be{_parse(e){return this._getType(e)===ie.undefined?Ct(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Sn.create=(t,e)=>new Sn({innerType:t,typeName:ge.ZodOptional,...Se(e)});class Qn extends Be{_parse(e){return this._getType(e)===ie.null?Ct(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Qn.create=(t,e)=>new Qn({innerType:t,typeName:ge.ZodNullable,...Se(e)});class Ui extends Be{_parse(e){const{ctx:n}=this._processInputParams(e);let i=n.data;return n.parsedType===ie.undefined&&(i=this._def.defaultValue()),this._def.innerType._parse({data:i,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}Ui.create=(t,e)=>new Ui({innerType:t,typeName:ge.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Se(e)});class Wi extends Be{_parse(e){const{ctx:n}=this._processInputParams(e),i={...n,common:{...n.common,issues:[]}},s=this._def.innerType._parse({data:i.data,path:i.path,parent:{...i}});return Ni(s)?s.then(l=>({status:"valid",value:l.status==="valid"?l.value:this._def.catchValue({get error(){return new Ft(i.common.issues)},input:i.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Ft(i.common.issues)},input:i.data})}}removeCatch(){return this._def.innerType}}Wi.create=(t,e)=>new Wi({innerType:t,typeName:ge.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Se(e)});class rs extends Be{_parse(e){if(this._getType(e)!==ie.nan){const i=this._getOrReturnCtx(e);return ne(i,{code:Y.invalid_type,expected:ie.nan,received:i.parsedType}),_e}return{status:"valid",value:e.data}}}rs.create=t=>new rs({typeName:ge.ZodNaN,...Se(t)});const Sm=Symbol("zod_brand");class Ra extends Be{_parse(e){const{ctx:n}=this._processInputParams(e),i=n.data;return this._def.type._parse({data:i,path:n.path,parent:n})}unwrap(){return this._def.type}}class Hi extends Be{_parse(e){const{status:n,ctx:i}=this._processInputParams(e);if(i.common.async)return(async()=>{const l=await this._def.in._parseAsync({data:i.data,path:i.path,parent:i});return l.status==="aborted"?_e:l.status==="dirty"?(n.dirty(),Kr(l.value)):this._def.out._parseAsync({data:l.value,path:i.path,parent:i})})();{const s=this._def.in._parseSync({data:i.data,path:i.path,parent:i});return s.status==="aborted"?_e:s.status==="dirty"?(n.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:i.path,parent:i})}}static create(e,n){return new Hi({in:e,out:n,typeName:ge.ZodPipeline})}}class ji extends Be{_parse(e){const n=this._def.innerType._parse(e),i=s=>(Vi(s)&&(s.value=Object.freeze(s.value)),s);return Ni(n)?n.then(s=>i(s)):i(n)}unwrap(){return this._def.innerType}}ji.create=(t,e)=>new ji({innerType:t,typeName:ge.ZodReadonly,...Se(e)});function fd(t,e={},n){return t?Yr.create().superRefine((i,s)=>{var l,d;if(!t(i)){const u=typeof e=="function"?e(i):typeof e=="string"?{message:e}:e,p=(d=(l=u.fatal)!==null&&l!==void 0?l:n)!==null&&d!==void 0?d:!0,f=typeof u=="string"?{message:u}:u;s.addIssue({code:"custom",...f,fatal:p})}}):Yr.create()}const Em={object:Ke.lazycreate};var ge;(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"})(ge||(ge={}));const Tm=(t,e={message:`Input not instance of ${t.name}`})=>fd(n=>n instanceof t,e),md=nn.create,gd=Yn.create,Bm=rs.create,Am=Jn.create,yd=Ri.create,Pm=Er.create,Vm=Qo.create,Nm=Mi.create,Dm=Ii.create,Fm=Yr.create,Rm=Tr.create,Mm=Dn.create,Im=es.create,Lm=rn.create,Om=Ke.create,Gm=Ke.strictCreate,zm=Li.create,Zm=ts.create,$m=Oi.create,Um=kn.create,Wm=Gi.create,Hm=ns.create,jm=Br.create,qm=Xr.create,Km=zi.create,Ym=Zi.create,Jm=Xn.create,Xm=$i.create,Qm=Qr.create,vd=on.create,eg=Sn.create,tg=Qn.create,ng=on.createWithPreprocess,rg=Hi.create;var is=Object.freeze({__proto__:null,defaultErrorMap:qr,setErrorMap:lm,getErrorMap:Yo,makeIssue:Jo,EMPTY_PATH:cm,addIssueToContext:ne,ParseStatus:ft,INVALID:_e,DIRTY:Kr,OK:Ct,isAborted:Va,isDirty:Na,isValid:Vi,isAsync:Ni,get util(){return Me},get objectUtil(){return Pa},ZodParsedType:ie,getParsedType:Kn,ZodType:Be,datetimeRegex:pd,ZodString:nn,ZodNumber:Yn,ZodBigInt:Jn,ZodBoolean:Ri,ZodDate:Er,ZodSymbol:Qo,ZodUndefined:Mi,ZodNull:Ii,ZodAny:Yr,ZodUnknown:Tr,ZodNever:Dn,ZodVoid:es,ZodArray:rn,ZodObject:Ke,ZodUnion:Li,ZodDiscriminatedUnion:ts,ZodIntersection:Oi,ZodTuple:kn,ZodRecord:Gi,ZodMap:ns,ZodSet:Br,ZodFunction:Xr,ZodLazy:zi,ZodLiteral:Zi,ZodEnum:Xn,ZodNativeEnum:$i,ZodPromise:Qr,ZodEffects:on,ZodTransformer:on,ZodOptional:Sn,ZodNullable:Qn,ZodDefault:Ui,ZodCatch:Wi,ZodNaN:rs,BRAND:Sm,ZodBranded:Ra,ZodPipeline:Hi,ZodReadonly:ji,custom:fd,Schema:Be,ZodSchema:Be,late:Em,get ZodFirstPartyTypeKind(){return ge},coerce:{string:t=>nn.create({...t,coerce:!0}),number:t=>Yn.create({...t,coerce:!0}),boolean:t=>Ri.create({...t,coerce:!0}),bigint:t=>Jn.create({...t,coerce:!0}),date:t=>Er.create({...t,coerce:!0})},any:Fm,array:Lm,bigint:Am,boolean:yd,date:Pm,discriminatedUnion:Zm,effect:vd,enum:Jm,function:qm,instanceof:Tm,intersection:$m,lazy:Km,literal:Ym,map:Hm,nan:Bm,nativeEnum:Xm,never:Mm,null:Dm,nullable:tg,number:gd,object:Om,oboolean:()=>yd().optional(),onumber:()=>gd().optional(),optional:eg,ostring:()=>md().optional(),pipeline:rg,preprocess:ng,promise:Qm,record:Wm,set:jm,strictObject:Gm,string:md,symbol:Vm,transformer:vd,tuple:Um,undefined:Nm,union:zm,unknown:Rm,void:Im,NEVER:_e,ZodIssueCode:Y,quotelessJson:am,ZodError:Ft});function ig(t){throw new Error("Unexpected object: "+t)}const og=-2147483648,_d=-9007199254740991n,sg=NaN,ag=NaN,lg=null,cg=null;function Cd(t,e){switch(e){case"Int":return t===og;case"Long":return t===Number(_d)||t===_d;case"Float":return t===sg;case"Double":return t===ag;case"String":return t===lg;case"Bytes":return t===cg;default:throw Error(`unsupported data type: ${e}`)}}function dg(t,e){const n=Math.floor(e/8),i=1<<7-e%8;return(t[n]&i)>0}function wd(t){const{type:e,name:n,domain:i}=t;return{type:e,name:n,...i&&{domain:i}}}function Ma(t){return t.map(wd)}function os(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=>os(n,e))};case"outer":return{type:"outer",primary:os(t.primary,e),secondary:t.secondary.map(n=>os(n,e))};default:ig(t)}}is.object({__isRef:is.literal(!0).describe("Crucial marker for the block dependency tree reconstruction"),blockId:is.string().describe("Upstream block id"),name:is.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 ug(t){if(typeof globalThis.platforma<"u")return globalThis.platforma;throw new Error("Can't get platforma instance.")}function pg(){return ug()}function hg(t){if(typeof globalThis.getEnvironmentValue=="function")return globalThis.getEnvironmentValue(t)}function ei(t){return!!t&&typeof t.children<"u"}function er(t){return ei(t)?t.groupId:t.colId}function bd(t,e,n){const i=(d,u)=>{const p=d.children.map(er),f=w._includes(p,er(u)),m=w._last(d.children),v=m&&er(m)!==er(u);return f&&v};if(!ei(t))return!0;const s=t,l=n;if(i(s,l))return s.children.push(l),!0;if(s.groupId===e){const d=s.children.map(er);if(!w._includes(d,er(l)))return s.children.push(l),!0}for(let d=s.children.length-1;d>=0&&!bd(s.children[d],e,n);d--);return!1}function fg(t){const e=(s,l)=>ei(s)&&ei(l)&&er(s)===er(l),n=(s,l)=>{if(!ei(l))return s;const d=s,u=l;return u.children&&u.groupId&&bd(d,u.groupId,u.children[0])||u.children.forEach(p=>n(d,p)),d},i=[];for(let s=1;s<=t.length;s++){const l=t[s-1],d=t[s];e(l,d)?t[s]=n(l,d):i.push(l)}return i}var mg=class extends w.BeanStub{constructor(){super(...arguments),this.beanName="toolPanelColDefService"}wireBeans(t){this.columnModel=t.columnModel}createColumnTree(t){const e=[],n=(s,l)=>{if(ei(s)){const d=s,u=typeof d.groupId<"u"?d.groupId:d.headerName,p=new w.AgProvidedColumnGroup(d,u,!1,l),f=[];return d.children.forEach(m=>{const v=n(m,l+1);v&&f.push(v)}),p.setChildren(f),p}else{const d=s,u=d.colId?d.colId:d.field,p=this.columnModel.getColDefCol(u);return p||e.push(d),p}},i=[];return t.forEach(s=>{const l=n(s,0);l&&i.push(l)}),e.length>0&&w._warnOnce("unable to find grid columns for the supplied colDef(s):",e),i}syncLayoutWithGrid(t){const e=this.getLeafPathTrees(),n=fg(e);t(n)}getLeafPathTrees(){const t=(i,s)=>{let l;if(w.isProvidedColumnGroup(i))if(i.isPadding())l=s;else{const u=Object.assign({},i.getColGroupDef());u.groupId=i.getGroupId(),u.children=[s],l=u}else{const u=Object.assign({},i.getColDef());u.colId=i.getColId(),l=u}const d=i.getOriginalParent();return d?t(d,l):l};return this.columnModel.getCols().filter(i=>{const s=i.getColDef();return i.isPrimary()&&!s.showRowGroup}).map(i=>t(i,i.getColDef()))}};function gg(t){var e;return((e=t.sideBarService)==null?void 0:e.getSideBarComp().isDisplayed())??!1}function yg(t,e){var n;(n=t.sideBarService)==null||n.getSideBarComp().setDisplayed(e)}function vg(t,e){var n;(n=t.sideBarService)==null||n.getSideBarComp().setSideBarPosition(e)}function _g(t,e){var n;(n=t.sideBarService)==null||n.getSideBarComp().openToolPanel(e,"api")}function Cg(t){var e;(e=t.sideBarService)==null||e.getSideBarComp().close("api")}function wg(t){var e;return((e=t.sideBarService)==null?void 0:e.getSideBarComp().openedItem())??null}function bg(t){var e;(e=t.sideBarService)==null||e.getSideBarComp().refresh()}function xg(t){var e;return((e=t.sideBarService)==null?void 0:e.getSideBarComp().isToolPanelShowing())??!1}function kg(t,e){var i;const n=(i=t.sideBarService)==null?void 0:i.getSideBarComp().getToolPanelInstance(e);return w._unwrapUserComp(n)}function Sg(t){var e;return(e=t.sideBarService)==null?void 0:e.getSideBarComp().getDef()}var Eg=class extends w.Component{constructor(t){super(),this.eToggleButton=w.RefPlaceholder,this.eIconWrapper=w.RefPlaceholder,this.eLabel=w.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 tm(t){return{ok:!0,value:t}}function od(t){if(!t)throw new ba;if(!t.ok)throw Error(t.errors.join(";"));return t.value}function sd(t){return{value:t,errors:void 0}}function nm(t){if(t.errors)throw new xa(t.errors);if(!t.value)throw new ba;return t.value}function rm(t){return t!==void 0}function ka(t,e){return Pi(t)===Pi(e)}const Sa=t=>t,Ea=t=>t instanceof Error?t:Error(String(t)),Ta=t=>t.name==="ZodError",Ba=t=>{const{formErrors:e,fieldErrors:n}=t.flatten(),i=Object.entries(n).map(([s,l])=>s+":"+(l==null?void 0:l.join(",")));return e.concat(i).join("; ")};function Aa(t){const e=t.validate??Sa,{autoSave:n}=t,i=r.ref(),s=r.ref(),l=F=>{s.value={model:Nn(F)}};r.watch(()=>t.get(),F=>l(F),{immediate:!0});const c=()=>{var F;t.onSave(e(Nn((F=s.value)==null?void 0:F.model)))},u=()=>{l(t.get()),i.value=void 0},p=F=>{const T=Ea(F);Ta(T)?i.value=Error(Ba(T)):i.value=T},f=F=>{i.value=void 0;try{e(F),n&&c()}catch(T){p(T)}},m=r.computed({get:()=>{var F;return(F=s.value)==null?void 0:F.model},set(F){l(F),f(F)}});r.watch(s,(F,T)=>{F&&F===T&&f(F.model)},{deep:!0});const v=r.computed(()=>!i.value),k=r.computed(()=>!ka(t.get(),r.unref(s))),S=r.computed(()=>i.value?i.value.message:"");return r.reactive({model:m,valid:v,isChanged:k,error:i,errorString:S,save:c,revert:u,setError:p})}function im(t,e){const n=t.validate??Sa,{autoSave:i}=t,s=r.ref(),l=r.ref(),c=T=>{l.value={model:Object.assign(Nn(T),e??{}),stage:Symbol()}};r.watch(()=>t.get(),T=>c(T),{immediate:!0});const u=()=>{var T;t.onSave(n(Nn((T=l.value)==null?void 0:T.model)))},p=()=>{c(t.get()),s.value=void 0},f=T=>{const N=Ea(T);Ta(N)?s.value=Error(Ba(N)):s.value=N},m=T=>{s.value=void 0;try{n(T),i&&u()}catch(N){f(N)}},v=r.computed({get:()=>{var T;return(T=l.value)==null?void 0:T.model},set(){throw Error("Cannot replace base model")}});r.watch([()=>({args:v.value.args,ui:v.value.ui}),()=>{var T;return(T=l.value)==null?void 0:T.stage}],([T,N],[C,I])=>{N===I&&m(T)},{deep:!0});const k=r.computed(()=>!s.value),S=r.computed(()=>{var C;const{args:T,ui:N}=((C=r.unref(l))==null?void 0:C.model)??{};return!ka(t.get(),{args:T,ui:N})}),F=r.computed(()=>s.value?s.value.message:"");return r.reactive({model:v,valid:k,isChanged:S,error:s,errorString:F,save:u,revert:p,setError:f})}const om=t=>Object.fromEntries(new URL(t,"http://dummy").searchParams);function sm(t,e){const i=wa(e.setBlockArgs,100),s=wa(e.setBlockUiState,100),l=wa(e.setBlockArgsAndUiState,100),c=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 T=>{T.forEach(N=>{N.key==="args"&&(c.args=Object.freeze(N.value)),N.key==="ui"&&(c.ui=Object.freeze(N.value)),N.key==="outputs"&&(c.outputs=Object.freeze(N.value)),N.key==="navigationState"&&(c.navigationState=Object.freeze(N.value))}),await r.nextTick()});const u=()=>Nn(c.args),p=()=>Nn(c.ui),f=()=>Nn(c.navigationState),m={createArgsModel(T={}){return Aa({get(){return T.transform?T.transform(c.args):c.args},validate:T.validate,autoSave:!0,onSave(N){i(N)}})},createUiModel(T={},N){return Aa({get(){return T.transform?T.transform(c.ui):c.ui??N()},validate:T.validate,autoSave:!0,onSave(C){s(C)}})},useOutputs(...T){const N=r.reactive({errors:void 0,value:void 0});return r.watch(()=>c.outputs,()=>{try{Object.assign(N,{value:this.unwrapOutputs(...T),errors:void 0})}catch(C){Object.assign(N,{value:void 0,errors:[String(C)]})}},{immediate:!0,deep:!0}),N},unwrapOutputs(...T){const N=c.outputs,C=T.map(I=>[I,od(N[I])]);return Object.fromEntries(C)},getOutputField(T){return c.outputs[T]},getOutputFieldOkOptional(T){console.warn("use reactive app.outputValues.fieldName instead instead of getOutputFieldOkOptional(fieldName)");const N=this.getOutputField(T);if(N&&N.ok)return N.value},getOutputFieldErrorsOptional(T){console.warn("use reactive app.outputErrors.fieldName instead instead of getOutputFieldErrorsOptional(fieldName)");const N=this.getOutputField(T);if(N&&!N.ok)return N.errors},updateArgs(T){const N=u();return T(N),e.setBlockArgs(N)},updateUiState(T){const N=p();return e.setBlockUiState(T(N))},updateNavigationState(T){const N=f();return T(N),e.setNavigationState(N)},navigateTo(T){const N=f();return N.href=T,e.setNavigationState(N)}},v=r.computed(()=>{const T=Object.entries(c.outputs).map(([N,C])=>[N,C.ok&&C.value!==void 0?C.value:void 0]);return Object.fromEntries(T)}),k=r.computed(()=>{const T=Object.entries(c.outputs).map(([N,C])=>[N,C&&!C.ok?new xa(C.errors):void 0]);return Object.fromEntries(T)}),S={snapshot:c,queryParams:r.computed(()=>om(c.navigationState.href)),href:r.computed(()=>c.navigationState.href),hasErrors:r.computed(()=>Object.values(c.outputs).some(T=>!(T!=null&&T.ok))),outputValues:r.computed(()=>(console.warn("Change app.outputValues to app.model.outputs"),v.value)),outputErrors:r.computed(()=>(console.warn("Change app.outputErrors to app.model.outputErrors"),k.value)),args:r.computed(()=>(console.warn("Change app.args to app.snapshot.args"),c.args)),outputs:r.computed(()=>(console.warn("Change app.outputs to app.snapshot.outputs"),c.outputs)),ui:r.computed(()=>(console.warn("Change app.ui to app.snapshot.ui"),c.ui)),navigationState:r.computed(()=>(console.warn("Change app.navigationState to app.snapshot.navigationState"),c.navigationState))},F=im({get(){return{args:c.args,ui:c.ui}},autoSave:!0,onSave(T){l(T.args,T.ui)}},{outputs:v,outputErrors:k});return r.reactive(Object.assign(F,m,S))}var Me;(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 i(s,l=" | "){return s.map(c=>typeof c=="string"?`'${c}'`:c).join(l)}t.joinValues=i,t.jsonStringifyReplacer=(s,l)=>typeof l=="bigint"?l.toString():l})(Me||(Me={}));var Pa;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(Pa||(Pa={}));const ie=Me.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Kn=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}},J=Me.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"]),am=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:");class Ft extends Error{constructor(e){super(),this.issues=[],this.addIssue=i=>{this.issues=[...this.issues,i]},this.addIssues=(i=[])=>{this.issues=[...this.issues,...i]};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},i={_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)i._errors.push(n(c));else{let u=i,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),i}static assert(e){if(!(e instanceof Ft))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Me.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){const n={},i=[];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))):i.push(e(s));return{formErrors:i,fieldErrors:n}}get formErrors(){return this.flatten()}}Ft.create=t=>new Ft(t);const qr=(t,e)=>{let n;switch(t.code){case J.invalid_type:t.received===ie.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case J.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,Me.jsonStringifyReplacer)}`;break;case J.unrecognized_keys:n=`Unrecognized key(s) in object: ${Me.joinValues(t.keys,", ")}`;break;case J.invalid_union:n="Invalid input";break;case J.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Me.joinValues(t.options)}`;break;case J.invalid_enum_value:n=`Invalid enum value. Expected ${Me.joinValues(t.options)}, received '${t.received}'`;break;case J.invalid_arguments:n="Invalid function arguments";break;case J.invalid_return_type:n="Invalid function return type";break;case J.invalid_date:n="Invalid date";break;case J.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}"`:Me.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case J.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 J.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 J.custom:n="Invalid input";break;case J.invalid_intersection_types:n="Intersection results could not be merged";break;case J.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case J.not_finite:n="Number must be finite";break;default:n=e.defaultError,Me.assertNever(t)}return{message:n}};let ad=qr;function lm(t){ad=t}function Yo(){return ad}const Jo=t=>{const{data:e,path:n,errorMaps:i,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=i.filter(f=>!!f).slice().reverse();for(const f of p)u=f(c,{data:e,defaultError:u}).message;return{...s,path:l,message:u}},cm=[];function ne(t,e){const n=Yo(),i=Jo({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===qr?void 0:qr].filter(s=>!!s)});t.common.issues.push(i)}class ft{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){const i=[];for(const s of n){if(s.status==="aborted")return _e;s.status==="dirty"&&e.dirty(),i.push(s.value)}return{status:e.value,value:i}}static async mergeObjectAsync(e,n){const i=[];for(const s of n){const l=await s.key,c=await s.value;i.push({key:l,value:c})}return ft.mergeObjectSync(e,i)}static mergeObjectSync(e,n){const i={};for(const s of n){const{key:l,value:c}=s;if(l.status==="aborted"||c.status==="aborted")return _e;l.status==="dirty"&&e.dirty(),c.status==="dirty"&&e.dirty(),l.value!=="__proto__"&&(typeof c.value<"u"||s.alwaysSet)&&(i[l.value]=c.value)}return{status:e.value,value:i}}}const _e=Object.freeze({status:"aborted"}),Kr=t=>({status:"dirty",value:t}),Ct=t=>({status:"valid",value:t}),Va=t=>t.status==="aborted",Na=t=>t.status==="dirty",Vi=t=>t.status==="valid",Ni=t=>typeof Promise<"u"&&t instanceof Promise;function Xo(t,e,n,i){if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e.get(t)}function ld(t,e,n,i,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 ce;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(ce||(ce={}));var Di,Fi;class xn{constructor(e,n,i,s){this._cachedPath=[],this.parent=e,this.data=n,this._path=i,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 cd=(t,e)=>{if(Vi(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 Ft(t.common.issues);return this._error=n,this._error}}};function Se(t){if(!t)return{};const{errorMap:e,invalid_type_error:n,required_error:i,description:s}=t;if(e&&(n||i))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??i)!==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 Kn(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:Kn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new ft,ctx:{common:e.parent.common,data:e.data,parsedType:Kn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const n=this._parse(e);if(Ni(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 i=this.safeParse(e,n);if(i.success)return i.data;throw i.error}safeParse(e,n){var i;const s={common:{issues:[],async:(i=n==null?void 0:n.async)!==null&&i!==void 0?i:!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Kn(e)},l=this._parseSync({data:e,path:s.path,parent:s});return cd(s,l)}async parseAsync(e,n){const i=await this.safeParseAsync(e,n);if(i.success)return i.data;throw i.error}async safeParseAsync(e,n){const i={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:Kn(e)},s=this._parse({data:e,path:i.path,parent:i}),l=await(Ni(s)?s:Promise.resolve(s));return cd(i,l)}refine(e,n){const i=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:J.custom,...i(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((i,s)=>e(i)?!0:(s.addIssue(typeof n=="function"?n(i,s):n),!1))}_refinement(e){return new on({schema:this,typeName:ge.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return Sn.create(this,this._def)}nullable(){return Qn.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return rn.create(this,this._def)}promise(){return Qr.create(this,this._def)}or(e){return Li.create([this,e],this._def)}and(e){return Oi.create(this,e,this._def)}transform(e){return new on({...Se(this._def),schema:this,typeName:ge.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new Ui({...Se(this._def),innerType:this,defaultValue:n,typeName:ge.ZodDefault})}brand(){return new Ra({typeName:ge.ZodBranded,type:this,...Se(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new Wi({...Se(this._def),innerType:this,catchValue:n,typeName:ge.ZodCatch})}describe(e){const n=this.constructor;return new n({...this._def,description:e})}pipe(e){return Hi.create(this,e)}readonly(){return ji.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const dm=/^c[^\s-]{8,}$/i,um=/^[0-9a-z]+$/,pm=/^[0-9A-HJKMNP-TV-Z]{26}$/,hm=/^[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,fm=/^[a-z0-9_-]{21}$/i,mm=/^[-+]?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)?)??$/,gm=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,ym="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Da;const vm=/^(?:(?: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])$/,_m=/^(([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})))$/,Cm=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,dd="((\\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])))",wm=new RegExp(`^${dd}$`);function ud(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 bm(t){return new RegExp(`^${ud(t)}$`)}function pd(t){let e=`${dd}T${ud(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 xm(t,e){return!!((e==="v4"||!e)&&vm.test(t)||(e==="v6"||!e)&&_m.test(t))}class nn 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:J.invalid_type,expected:ie.string,received:l.parsedType}),_e}const i=new ft;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:J.too_small,minimum:l.value,type:"string",inclusive:!0,exact:!1,message:l.message}),i.dirty());else if(l.kind==="max")e.data.length>l.value&&(s=this._getOrReturnCtx(e,s),ne(s,{code:J.too_big,maximum:l.value,type:"string",inclusive:!0,exact:!1,message:l.message}),i.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:J.too_big,maximum:l.value,type:"string",inclusive:!0,exact:!0,message:l.message}):u&&ne(s,{code:J.too_small,minimum:l.value,type:"string",inclusive:!0,exact:!0,message:l.message}),i.dirty())}else if(l.kind==="email")gm.test(e.data)||(s=this._getOrReturnCtx(e,s),ne(s,{validation:"email",code:J.invalid_string,message:l.message}),i.dirty());else if(l.kind==="emoji")Da||(Da=new RegExp(ym,"u")),Da.test(e.data)||(s=this._getOrReturnCtx(e,s),ne(s,{validation:"emoji",code:J.invalid_string,message:l.message}),i.dirty());else if(l.kind==="uuid")hm.test(e.data)||(s=this._getOrReturnCtx(e,s),ne(s,{validation:"uuid",code:J.invalid_string,message:l.message}),i.dirty());else if(l.kind==="nanoid")fm.test(e.data)||(s=this._getOrReturnCtx(e,s),ne(s,{validation:"nanoid",code:J.invalid_string,message:l.message}),i.dirty());else if(l.kind==="cuid")dm.test(e.data)||(s=this._getOrReturnCtx(e,s),ne(s,{validation:"cuid",code:J.invalid_string,message:l.message}),i.dirty());else if(l.kind==="cuid2")um.test(e.data)||(s=this._getOrReturnCtx(e,s),ne(s,{validation:"cuid2",code:J.invalid_string,message:l.message}),i.dirty());else if(l.kind==="ulid")pm.test(e.data)||(s=this._getOrReturnCtx(e,s),ne(s,{validation:"ulid",code:J.invalid_string,message:l.message}),i.dirty());else if(l.kind==="url")try{new URL(e.data)}catch{s=this._getOrReturnCtx(e,s),ne(s,{validation:"url",code:J.invalid_string,message:l.message}),i.dirty()}else l.kind==="regex"?(l.regex.lastIndex=0,l.regex.test(e.data)||(s=this._getOrReturnCtx(e,s),ne(s,{validation:"regex",code:J.invalid_string,message:l.message}),i.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:J.invalid_string,validation:{includes:l.value,position:l.position},message:l.message}),i.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:J.invalid_string,validation:{startsWith:l.value},message:l.message}),i.dirty()):l.kind==="endsWith"?e.data.endsWith(l.value)||(s=this._getOrReturnCtx(e,s),ne(s,{code:J.invalid_string,validation:{endsWith:l.value},message:l.message}),i.dirty()):l.kind==="datetime"?pd(l).test(e.data)||(s=this._getOrReturnCtx(e,s),ne(s,{code:J.invalid_string,validation:"datetime",message:l.message}),i.dirty()):l.kind==="date"?wm.test(e.data)||(s=this._getOrReturnCtx(e,s),ne(s,{code:J.invalid_string,validation:"date",message:l.message}),i.dirty()):l.kind==="time"?bm(l).test(e.data)||(s=this._getOrReturnCtx(e,s),ne(s,{code:J.invalid_string,validation:"time",message:l.message}),i.dirty()):l.kind==="duration"?mm.test(e.data)||(s=this._getOrReturnCtx(e,s),ne(s,{validation:"duration",code:J.invalid_string,message:l.message}),i.dirty()):l.kind==="ip"?xm(e.data,l.version)||(s=this._getOrReturnCtx(e,s),ne(s,{validation:"ip",code:J.invalid_string,message:l.message}),i.dirty()):l.kind==="base64"?Cm.test(e.data)||(s=this._getOrReturnCtx(e,s),ne(s,{validation:"base64",code:J.invalid_string,message:l.message}),i.dirty()):Me.assertNever(l);return{status:i.value,value:e.data}}_regex(e,n,i){return this.refinement(s=>e.test(s),{validation:n,code:J.invalid_string,...ce.errToObj(i)})}_addCheck(e){return new nn({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...ce.errToObj(e)})}url(e){return this._addCheck({kind:"url",...ce.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...ce.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...ce.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...ce.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...ce.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...ce.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...ce.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...ce.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...ce.errToObj(e)})}datetime(e){var n,i;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:(i=e==null?void 0:e.local)!==null&&i!==void 0?i:!1,...ce.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,...ce.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...ce.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...ce.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n==null?void 0:n.position,...ce.errToObj(n==null?void 0:n.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...ce.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...ce.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...ce.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...ce.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...ce.errToObj(n)})}nonempty(e){return this.min(1,ce.errToObj(e))}trim(){return new nn({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new nn({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new nn({...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}}nn.create=t=>{var e;return new nn({checks:[],typeName:ge.ZodString,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...Se(t)})};function km(t,e){const n=(t.toString().split(".")[1]||"").length,i=(e.toString().split(".")[1]||"").length,s=n>i?n:i,l=parseInt(t.toFixed(s).replace(".","")),c=parseInt(e.toFixed(s).replace(".",""));return l%c/Math.pow(10,s)}class Yn 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:J.invalid_type,expected:ie.number,received:l.parsedType}),_e}let i;const s=new ft;for(const l of this._def.checks)l.kind==="int"?Me.isInteger(e.data)||(i=this._getOrReturnCtx(e,i),ne(i,{code:J.invalid_type,expected:"integer",received:"float",message:l.message}),s.dirty()):l.kind==="min"?(l.inclusive?e.data<l.value:e.data<=l.value)&&(i=this._getOrReturnCtx(e,i),ne(i,{code:J.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)&&(i=this._getOrReturnCtx(e,i),ne(i,{code:J.too_big,maximum:l.value,type:"number",inclusive:l.inclusive,exact:!1,message:l.message}),s.dirty()):l.kind==="multipleOf"?km(e.data,l.value)!==0&&(i=this._getOrReturnCtx(e,i),ne(i,{code:J.not_multiple_of,multipleOf:l.value,message:l.message}),s.dirty()):l.kind==="finite"?Number.isFinite(e.data)||(i=this._getOrReturnCtx(e,i),ne(i,{code:J.not_finite,message:l.message}),s.dirty()):Me.assertNever(l);return{status:s.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,ce.toString(n))}gt(e,n){return this.setLimit("min",e,!1,ce.toString(n))}lte(e,n){return this.setLimit("max",e,!0,ce.toString(n))}lt(e,n){return this.setLimit("max",e,!1,ce.toString(n))}setLimit(e,n,i,s){return new Yn({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:i,message:ce.toString(s)}]})}_addCheck(e){return new Yn({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:ce.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:ce.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:ce.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:ce.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:ce.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:ce.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:ce.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:ce.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:ce.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"&&Me.isInteger(e.value))}get isFinite(){let e=null,n=null;for(const i of this._def.checks){if(i.kind==="finite"||i.kind==="int"||i.kind==="multipleOf")return!0;i.kind==="min"?(n===null||i.value>n)&&(n=i.value):i.kind==="max"&&(e===null||i.value<e)&&(e=i.value)}return Number.isFinite(n)&&Number.isFinite(e)}}Yn.create=t=>new Yn({checks:[],typeName:ge.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...Se(t)});class Jn 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:J.invalid_type,expected:ie.bigint,received:l.parsedType}),_e}let i;const s=new ft;for(const l of this._def.checks)l.kind==="min"?(l.inclusive?e.data<l.value:e.data<=l.value)&&(i=this._getOrReturnCtx(e,i),ne(i,{code:J.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)&&(i=this._getOrReturnCtx(e,i),ne(i,{code:J.too_big,type:"bigint",maximum:l.value,inclusive:l.inclusive,message:l.message}),s.dirty()):l.kind==="multipleOf"?e.data%l.value!==BigInt(0)&&(i=this._getOrReturnCtx(e,i),ne(i,{code:J.not_multiple_of,multipleOf:l.value,message:l.message}),s.dirty()):Me.assertNever(l);return{status:s.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,ce.toString(n))}gt(e,n){return this.setLimit("min",e,!1,ce.toString(n))}lte(e,n){return this.setLimit("max",e,!0,ce.toString(n))}lt(e,n){return this.setLimit("max",e,!1,ce.toString(n))}setLimit(e,n,i,s){return new Jn({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:i,message:ce.toString(s)}]})}_addCheck(e){return new Jn({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:ce.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:ce.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:ce.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:ce.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:ce.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}}Jn.create=t=>{var e;return new Jn({checks:[],typeName:ge.ZodBigInt,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...Se(t)})};class Ri extends Be{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==ie.boolean){const i=this._getOrReturnCtx(e);return ne(i,{code:J.invalid_type,expected:ie.boolean,received:i.parsedType}),_e}return Ct(e.data)}}Ri.create=t=>new Ri({typeName:ge.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...Se(t)});class Er 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:J.invalid_type,expected:ie.date,received:l.parsedType}),_e}if(isNaN(e.data.getTime())){const l=this._getOrReturnCtx(e);return ne(l,{code:J.invalid_date}),_e}const i=new ft;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:J.too_small,message:l.message,inclusive:!0,exact:!1,minimum:l.value,type:"date"}),i.dirty()):l.kind==="max"?e.data.getTime()>l.value&&(s=this._getOrReturnCtx(e,s),ne(s,{code:J.too_big,message:l.message,inclusive:!0,exact:!1,maximum:l.value,type:"date"}),i.dirty()):Me.assertNever(l);return{status:i.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Er({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:ce.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:ce.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}}Er.create=t=>new Er({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:ge.ZodDate,...Se(t)});class Qo extends Be{_parse(e){if(this._getType(e)!==ie.symbol){const i=this._getOrReturnCtx(e);return ne(i,{code:J.invalid_type,expected:ie.symbol,received:i.parsedType}),_e}return Ct(e.data)}}Qo.create=t=>new Qo({typeName:ge.ZodSymbol,...Se(t)});class Mi extends Be{_parse(e){if(this._getType(e)!==ie.undefined){const i=this._getOrReturnCtx(e);return ne(i,{code:J.invalid_type,expected:ie.undefined,received:i.parsedType}),_e}return Ct(e.data)}}Mi.create=t=>new Mi({typeName:ge.ZodUndefined,...Se(t)});class Ii extends Be{_parse(e){if(this._getType(e)!==ie.null){const i=this._getOrReturnCtx(e);return ne(i,{code:J.invalid_type,expected:ie.null,received:i.parsedType}),_e}return Ct(e.data)}}Ii.create=t=>new Ii({typeName:ge.ZodNull,...Se(t)});class Yr extends Be{constructor(){super(...arguments),this._any=!0}_parse(e){return Ct(e.data)}}Yr.create=t=>new Yr({typeName:ge.ZodAny,...Se(t)});class Tr extends Be{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Ct(e.data)}}Tr.create=t=>new Tr({typeName:ge.ZodUnknown,...Se(t)});class Dn extends Be{_parse(e){const n=this._getOrReturnCtx(e);return ne(n,{code:J.invalid_type,expected:ie.never,received:n.parsedType}),_e}}Dn.create=t=>new Dn({typeName:ge.ZodNever,...Se(t)});class es extends Be{_parse(e){if(this._getType(e)!==ie.undefined){const i=this._getOrReturnCtx(e);return ne(i,{code:J.invalid_type,expected:ie.void,received:i.parsedType}),_e}return Ct(e.data)}}es.create=t=>new es({typeName:ge.ZodVoid,...Se(t)});class rn extends Be{_parse(e){const{ctx:n,status:i}=this._processInputParams(e),s=this._def;if(n.parsedType!==ie.array)return ne(n,{code:J.invalid_type,expected:ie.array,received:n.parsedType}),_e;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?J.too_big:J.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}),i.dirty())}if(s.minLength!==null&&n.data.length<s.minLength.value&&(ne(n,{code:J.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),i.dirty()),s.maxLength!==null&&n.data.length>s.maxLength.value&&(ne(n,{code:J.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),i.dirty()),n.common.async)return Promise.all([...n.data].map((c,u)=>s.type._parseAsync(new xn(n,c,n.path,u)))).then(c=>ft.mergeArray(i,c));const l=[...n.data].map((c,u)=>s.type._parseSync(new xn(n,c,n.path,u)));return ft.mergeArray(i,l)}get element(){return this._def.type}min(e,n){return new rn({...this._def,minLength:{value:e,message:ce.toString(n)}})}max(e,n){return new rn({...this._def,maxLength:{value:e,message:ce.toString(n)}})}length(e,n){return new rn({...this._def,exactLength:{value:e,message:ce.toString(n)}})}nonempty(e){return this.min(1,e)}}rn.create=(t,e)=>new rn({type:t,minLength:null,maxLength:null,exactLength:null,typeName:ge.ZodArray,...Se(e)});function Jr(t){if(t instanceof Ke){const e={};for(const n in t.shape){const i=t.shape[n];e[n]=Sn.create(Jr(i))}return new Ke({...t._def,shape:()=>e})}else return t instanceof rn?new rn({...t._def,type:Jr(t.element)}):t instanceof Sn?Sn.create(Jr(t.unwrap())):t instanceof Qn?Qn.create(Jr(t.unwrap())):t instanceof kn?kn.create(t.items.map(e=>Jr(e))):t}class Ke 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=Me.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:J.invalid_type,expected:ie.object,received:f.parsedType}),_e}const{status:i,ctx:s}=this._processInputParams(e),{shape:l,keys:c}=this._getCached(),u=[];if(!(this._def.catchall instanceof Dn&&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],v=s.data[f];p.push({key:{status:"valid",value:f},value:m._parse(new xn(s,v,s.path,f)),alwaysSet:f in s.data})}if(this._def.catchall instanceof Dn){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:J.unrecognized_keys,keys:u}),i.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 v=s.data[m];p.push({key:{status:"valid",value:m},value:f._parse(new xn(s,v,s.path,m)),alwaysSet:m in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const f=[];for(const m of p){const v=await m.key,k=await m.value;f.push({key:v,value:k,alwaysSet:m.alwaysSet})}return f}).then(f=>ft.mergeObjectSync(i,f)):ft.mergeObjectSync(i,p)}get shape(){return this._def.shape()}strict(e){return ce.errToObj,new Ke({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,i)=>{var s,l,c,u;const p=(c=(l=(s=this._def).errorMap)===null||l===void 0?void 0:l.call(s,n,i).message)!==null&&c!==void 0?c:i.defaultError;return n.code==="unrecognized_keys"?{message:(u=ce.errToObj(e).message)!==null&&u!==void 0?u:p}:{message:p}}}:{}})}strip(){return new Ke({...this._def,unknownKeys:"strip"})}passthrough(){return new Ke({...this._def,unknownKeys:"passthrough"})}extend(e){return new Ke({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Ke({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:ge.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new Ke({...this._def,catchall:e})}pick(e){const n={};return Me.objectKeys(e).forEach(i=>{e[i]&&this.shape[i]&&(n[i]=this.shape[i])}),new Ke({...this._def,shape:()=>n})}omit(e){const n={};return Me.objectKeys(this.shape).forEach(i=>{e[i]||(n[i]=this.shape[i])}),new Ke({...this._def,shape:()=>n})}deepPartial(){return Jr(this)}partial(e){const n={};return Me.objectKeys(this.shape).forEach(i=>{const s=this.shape[i];e&&!e[i]?n[i]=s:n[i]=s.optional()}),new Ke({...this._def,shape:()=>n})}required(e){const n={};return Me.objectKeys(this.shape).forEach(i=>{if(e&&!e[i])n[i]=this.shape[i];else{let l=this.shape[i];for(;l instanceof Sn;)l=l._def.innerType;n[i]=l}}),new Ke({...this._def,shape:()=>n})}keyof(){return hd(Me.objectKeys(this.shape))}}Ke.create=(t,e)=>new Ke({shape:()=>t,unknownKeys:"strip",catchall:Dn.create(),typeName:ge.ZodObject,...Se(e)}),Ke.strictCreate=(t,e)=>new Ke({shape:()=>t,unknownKeys:"strict",catchall:Dn.create(),typeName:ge.ZodObject,...Se(e)}),Ke.lazycreate=(t,e)=>new Ke({shape:t,unknownKeys:"strip",catchall:Dn.create(),typeName:ge.ZodObject,...Se(e)});class Li extends Be{_parse(e){const{ctx:n}=this._processInputParams(e),i=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 Ft(u.ctx.common.issues));return ne(n,{code:J.invalid_union,unionErrors:c}),_e}if(n.common.async)return Promise.all(i.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 i){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 Ft(p));return ne(n,{code:J.invalid_union,unionErrors:u}),_e}}get options(){return this._def.options}}Li.create=(t,e)=>new Li({options:t,typeName:ge.ZodUnion,...Se(e)});const Fn=t=>t instanceof zi?Fn(t.schema):t instanceof on?Fn(t.innerType()):t instanceof Zi?[t.value]:t instanceof Xn?t.options:t instanceof $i?Me.objectValues(t.enum):t instanceof Ui?Fn(t._def.innerType):t instanceof Mi?[void 0]:t instanceof Ii?[null]:t instanceof Sn?[void 0,...Fn(t.unwrap())]:t instanceof Qn?[null,...Fn(t.unwrap())]:t instanceof Ra||t instanceof ji?Fn(t.unwrap()):t instanceof Wi?Fn(t._def.innerType):[];class ts extends Be{_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==ie.object)return ne(n,{code:J.invalid_type,expected:ie.object,received:n.parsedType}),_e;const i=this.discriminator,s=n.data[i],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:J.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[i]}),_e)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,i){const s=new Map;for(const l of n){const c=Fn(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 ts({typeName:ge.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:s,...Se(i)})}}function Fa(t,e){const n=Kn(t),i=Kn(e);if(t===e)return{valid:!0,data:t};if(n===ie.object&&i===ie.object){const s=Me.objectKeys(e),l=Me.objectKeys(t).filter(u=>s.indexOf(u)!==-1),c={...t,...e};for(const u of l){const p=Fa(t[u],e[u]);if(!p.valid)return{valid:!1};c[u]=p.data}return{valid:!0,data:c}}else if(n===ie.array&&i===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=Fa(c,u);if(!p.valid)return{valid:!1};s.push(p.data)}return{valid:!0,data:s}}else return n===ie.date&&i===ie.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class Oi extends Be{_parse(e){const{status:n,ctx:i}=this._processInputParams(e),s=(l,c)=>{if(Va(l)||Va(c))return _e;const u=Fa(l.value,c.value);return u.valid?((Na(l)||Na(c))&&n.dirty(),{status:n.value,value:u.data}):(ne(i,{code:J.invalid_intersection_types}),_e)};return i.common.async?Promise.all([this._def.left._parseAsync({data:i.data,path:i.path,parent:i}),this._def.right._parseAsync({data:i.data,path:i.path,parent:i})]).then(([l,c])=>s(l,c)):s(this._def.left._parseSync({data:i.data,path:i.path,parent:i}),this._def.right._parseSync({data:i.data,path:i.path,parent:i}))}}Oi.create=(t,e,n)=>new Oi({left:t,right:e,typeName:ge.ZodIntersection,...Se(n)});class kn extends Be{_parse(e){const{status:n,ctx:i}=this._processInputParams(e);if(i.parsedType!==ie.array)return ne(i,{code:J.invalid_type,expected:ie.array,received:i.parsedType}),_e;if(i.data.length<this._def.items.length)return ne(i,{code:J.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),_e;!this._def.rest&&i.data.length>this._def.items.length&&(ne(i,{code:J.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const l=[...i.data].map((c,u)=>{const p=this._def.items[u]||this._def.rest;return p?p._parse(new xn(i,c,i.path,u)):null}).filter(c=>!!c);return i.common.async?Promise.all(l).then(c=>ft.mergeArray(n,c)):ft.mergeArray(n,l)}get items(){return this._def.items}rest(e){return new kn({...this._def,rest:e})}}kn.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new kn({items:t,typeName:ge.ZodTuple,rest:null,...Se(e)})};class Gi extends Be{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:i}=this._processInputParams(e);if(i.parsedType!==ie.object)return ne(i,{code:J.invalid_type,expected:ie.object,received:i.parsedType}),_e;const s=[],l=this._def.keyType,c=this._def.valueType;for(const u in i.data)s.push({key:l._parse(new xn(i,u,i.path,u)),value:c._parse(new xn(i,i.data[u],i.path,u)),alwaysSet:u in i.data});return i.common.async?ft.mergeObjectAsync(n,s):ft.mergeObjectSync(n,s)}get element(){return this._def.valueType}static create(e,n,i){return n instanceof Be?new Gi({keyType:e,valueType:n,typeName:ge.ZodRecord,...Se(i)}):new Gi({keyType:nn.create(),valueType:e,typeName:ge.ZodRecord,...Se(n)})}}class ns extends Be{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:i}=this._processInputParams(e);if(i.parsedType!==ie.map)return ne(i,{code:J.invalid_type,expected:ie.map,received:i.parsedType}),_e;const s=this._def.keyType,l=this._def.valueType,c=[...i.data.entries()].map(([u,p],f)=>({key:s._parse(new xn(i,u,i.path,[f,"key"])),value:l._parse(new xn(i,p,i.path,[f,"value"]))}));if(i.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 _e;(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 _e;(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:ge.ZodMap,...Se(n)});class Br extends Be{_parse(e){const{status:n,ctx:i}=this._processInputParams(e);if(i.parsedType!==ie.set)return ne(i,{code:J.invalid_type,expected:ie.set,received:i.parsedType}),_e;const s=this._def;s.minSize!==null&&i.data.size<s.minSize.value&&(ne(i,{code:J.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),n.dirty()),s.maxSize!==null&&i.data.size>s.maxSize.value&&(ne(i,{code:J.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 _e;m.status==="dirty"&&n.dirty(),f.add(m.value)}return{status:n.value,value:f}}const u=[...i.data.values()].map((p,f)=>l._parse(new xn(i,p,i.path,f)));return i.common.async?Promise.all(u).then(p=>c(p)):c(u)}min(e,n){return new Br({...this._def,minSize:{value:e,message:ce.toString(n)}})}max(e,n){return new Br({...this._def,maxSize:{value:e,message:ce.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}}Br.create=(t,e)=>new Br({valueType:t,minSize:null,maxSize:null,typeName:ge.ZodSet,...Se(e)});class Xr 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:J.invalid_type,expected:ie.function,received:n.parsedType}),_e;function i(u,p){return Jo({data:u,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Yo(),qr].filter(f=>!!f),issueData:{code:J.invalid_arguments,argumentsError:p}})}function s(u,p){return Jo({data:u,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Yo(),qr].filter(f=>!!f),issueData:{code:J.invalid_return_type,returnTypeError:p}})}const l={errorMap:n.common.contextualErrorMap},c=n.data;if(this._def.returns instanceof Qr){const u=this;return Ct(async function(...p){const f=new Ft([]),m=await u._def.args.parseAsync(p,l).catch(S=>{throw f.addIssue(i(p,S)),f}),v=await Reflect.apply(c,this,m);return await u._def.returns._def.type.parseAsync(v,l).catch(S=>{throw f.addIssue(s(v,S)),f})})}else{const u=this;return Ct(function(...p){const f=u._def.args.safeParse(p,l);if(!f.success)throw new Ft([i(p,f.error)]);const m=Reflect.apply(c,this,f.data),v=u._def.returns.safeParse(m,l);if(!v.success)throw new Ft([s(m,v.error)]);return v.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new Xr({...this._def,args:kn.create(e).rest(Tr.create())})}returns(e){return new Xr({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,n,i){return new Xr({args:e||kn.create([]).rest(Tr.create()),returns:n||Tr.create(),typeName:ge.ZodFunction,...Se(i)})}}class zi 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})}}zi.create=(t,e)=>new zi({getter:t,typeName:ge.ZodLazy,...Se(e)});class Zi extends Be{_parse(e){if(e.data!==this._def.value){const n=this._getOrReturnCtx(e);return ne(n,{received:n.data,code:J.invalid_literal,expected:this._def.value}),_e}return{status:"valid",value:e.data}}get value(){return this._def.value}}Zi.create=(t,e)=>new Zi({value:t,typeName:ge.ZodLiteral,...Se(e)});function hd(t,e){return new Xn({values:t,typeName:ge.ZodEnum,...Se(e)})}class Xn extends Be{constructor(){super(...arguments),Di.set(this,void 0)}_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),i=this._def.values;return ne(n,{expected:Me.joinValues(i),received:n.parsedType,code:J.invalid_type}),_e}if(Xo(this,Di)||ld(this,Di,new Set(this._def.values)),!Xo(this,Di).has(e.data)){const n=this._getOrReturnCtx(e),i=this._def.values;return ne(n,{received:n.data,code:J.invalid_enum_value,options:i}),_e}return Ct(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 Xn.create(e,{...this._def,...n})}exclude(e,n=this._def){return Xn.create(this.options.filter(i=>!e.includes(i)),{...this._def,...n})}}Di=new WeakMap,Xn.create=hd;class $i extends Be{constructor(){super(...arguments),Fi.set(this,void 0)}_parse(e){const n=Me.getValidEnumValues(this._def.values),i=this._getOrReturnCtx(e);if(i.parsedType!==ie.string&&i.parsedType!==ie.number){const s=Me.objectValues(n);return ne(i,{expected:Me.joinValues(s),received:i.parsedType,code:J.invalid_type}),_e}if(Xo(this,Fi)||ld(this,Fi,new Set(Me.getValidEnumValues(this._def.values))),!Xo(this,Fi).has(e.data)){const s=Me.objectValues(n);return ne(i,{received:i.data,code:J.invalid_enum_value,options:s}),_e}return Ct(e.data)}get enum(){return this._def.values}}Fi=new WeakMap,$i.create=(t,e)=>new $i({values:t,typeName:ge.ZodNativeEnum,...Se(e)});class Qr 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:J.invalid_type,expected:ie.promise,received:n.parsedType}),_e;const i=n.parsedType===ie.promise?n.data:Promise.resolve(n.data);return Ct(i.then(s=>this._def.type.parseAsync(s,{path:n.path,errorMap:n.common.contextualErrorMap})))}}Qr.create=(t,e)=>new Qr({type:t,typeName:ge.ZodPromise,...Se(e)});class on extends Be{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ge.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:n,ctx:i}=this._processInputParams(e),s=this._def.effect||null,l={addIssue:c=>{ne(i,c),c.fatal?n.abort():n.dirty()},get path(){return i.path}};if(l.addIssue=l.addIssue.bind(l),s.type==="preprocess"){const c=s.transform(i.data,l);if(i.common.async)return Promise.resolve(c).then(async u=>{if(n.value==="aborted")return _e;const p=await this._def.schema._parseAsync({data:u,path:i.path,parent:i});return p.status==="aborted"?_e:p.status==="dirty"||n.value==="dirty"?Kr(p.value):p});{if(n.value==="aborted")return _e;const u=this._def.schema._parseSync({data:c,path:i.path,parent:i});return u.status==="aborted"?_e:u.status==="dirty"||n.value==="dirty"?Kr(u.value):u}}if(s.type==="refinement"){const c=u=>{const p=s.refinement(u,l);if(i.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(i.common.async===!1){const u=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});return u.status==="aborted"?_e:(u.status==="dirty"&&n.dirty(),c(u.value),{status:n.value,value:u.value})}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(u=>u.status==="aborted"?_e:(u.status==="dirty"&&n.dirty(),c(u.value).then(()=>({status:n.value,value:u.value}))))}if(s.type==="transform")if(i.common.async===!1){const c=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});if(!Vi(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:i.data,path:i.path,parent:i}).then(c=>Vi(c)?Promise.resolve(s.transform(c.value,l)).then(u=>({status:n.value,value:u})):c);Me.assertNever(s)}}on.create=(t,e,n)=>new on({schema:t,typeName:ge.ZodEffects,effect:e,...Se(n)}),on.createWithPreprocess=(t,e,n)=>new on({schema:e,effect:{type:"preprocess",transform:t},typeName:ge.ZodEffects,...Se(n)});class Sn extends Be{_parse(e){return this._getType(e)===ie.undefined?Ct(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Sn.create=(t,e)=>new Sn({innerType:t,typeName:ge.ZodOptional,...Se(e)});class Qn extends Be{_parse(e){return this._getType(e)===ie.null?Ct(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Qn.create=(t,e)=>new Qn({innerType:t,typeName:ge.ZodNullable,...Se(e)});class Ui extends Be{_parse(e){const{ctx:n}=this._processInputParams(e);let i=n.data;return n.parsedType===ie.undefined&&(i=this._def.defaultValue()),this._def.innerType._parse({data:i,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}Ui.create=(t,e)=>new Ui({innerType:t,typeName:ge.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Se(e)});class Wi extends Be{_parse(e){const{ctx:n}=this._processInputParams(e),i={...n,common:{...n.common,issues:[]}},s=this._def.innerType._parse({data:i.data,path:i.path,parent:{...i}});return Ni(s)?s.then(l=>({status:"valid",value:l.status==="valid"?l.value:this._def.catchValue({get error(){return new Ft(i.common.issues)},input:i.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Ft(i.common.issues)},input:i.data})}}removeCatch(){return this._def.innerType}}Wi.create=(t,e)=>new Wi({innerType:t,typeName:ge.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Se(e)});class rs extends Be{_parse(e){if(this._getType(e)!==ie.nan){const i=this._getOrReturnCtx(e);return ne(i,{code:J.invalid_type,expected:ie.nan,received:i.parsedType}),_e}return{status:"valid",value:e.data}}}rs.create=t=>new rs({typeName:ge.ZodNaN,...Se(t)});const Sm=Symbol("zod_brand");class Ra extends Be{_parse(e){const{ctx:n}=this._processInputParams(e),i=n.data;return this._def.type._parse({data:i,path:n.path,parent:n})}unwrap(){return this._def.type}}class Hi extends Be{_parse(e){const{status:n,ctx:i}=this._processInputParams(e);if(i.common.async)return(async()=>{const l=await this._def.in._parseAsync({data:i.data,path:i.path,parent:i});return l.status==="aborted"?_e:l.status==="dirty"?(n.dirty(),Kr(l.value)):this._def.out._parseAsync({data:l.value,path:i.path,parent:i})})();{const s=this._def.in._parseSync({data:i.data,path:i.path,parent:i});return s.status==="aborted"?_e:s.status==="dirty"?(n.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:i.path,parent:i})}}static create(e,n){return new Hi({in:e,out:n,typeName:ge.ZodPipeline})}}class ji extends Be{_parse(e){const n=this._def.innerType._parse(e),i=s=>(Vi(s)&&(s.value=Object.freeze(s.value)),s);return Ni(n)?n.then(s=>i(s)):i(n)}unwrap(){return this._def.innerType}}ji.create=(t,e)=>new ji({innerType:t,typeName:ge.ZodReadonly,...Se(e)});function fd(t,e={},n){return t?Yr.create().superRefine((i,s)=>{var l,c;if(!t(i)){const u=typeof e=="function"?e(i):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})}}):Yr.create()}const Em={object:Ke.lazycreate};var ge;(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"})(ge||(ge={}));const Tm=(t,e={message:`Input not instance of ${t.name}`})=>fd(n=>n instanceof t,e),md=nn.create,gd=Yn.create,Bm=rs.create,Am=Jn.create,yd=Ri.create,Pm=Er.create,Vm=Qo.create,Nm=Mi.create,Dm=Ii.create,Fm=Yr.create,Rm=Tr.create,Mm=Dn.create,Im=es.create,Lm=rn.create,Om=Ke.create,Gm=Ke.strictCreate,zm=Li.create,Zm=ts.create,$m=Oi.create,Um=kn.create,Wm=Gi.create,Hm=ns.create,jm=Br.create,qm=Xr.create,Km=zi.create,Ym=Zi.create,Jm=Xn.create,Xm=$i.create,Qm=Qr.create,vd=on.create,eg=Sn.create,tg=Qn.create,ng=on.createWithPreprocess,rg=Hi.create;var is=Object.freeze({__proto__:null,defaultErrorMap:qr,setErrorMap:lm,getErrorMap:Yo,makeIssue:Jo,EMPTY_PATH:cm,addIssueToContext:ne,ParseStatus:ft,INVALID:_e,DIRTY:Kr,OK:Ct,isAborted:Va,isDirty:Na,isValid:Vi,isAsync:Ni,get util(){return Me},get objectUtil(){return Pa},ZodParsedType:ie,getParsedType:Kn,ZodType:Be,datetimeRegex:pd,ZodString:nn,ZodNumber:Yn,ZodBigInt:Jn,ZodBoolean:Ri,ZodDate:Er,ZodSymbol:Qo,ZodUndefined:Mi,ZodNull:Ii,ZodAny:Yr,ZodUnknown:Tr,ZodNever:Dn,ZodVoid:es,ZodArray:rn,ZodObject:Ke,ZodUnion:Li,ZodDiscriminatedUnion:ts,ZodIntersection:Oi,ZodTuple:kn,ZodRecord:Gi,ZodMap:ns,ZodSet:Br,ZodFunction:Xr,ZodLazy:zi,ZodLiteral:Zi,ZodEnum:Xn,ZodNativeEnum:$i,ZodPromise:Qr,ZodEffects:on,ZodTransformer:on,ZodOptional:Sn,ZodNullable:Qn,ZodDefault:Ui,ZodCatch:Wi,ZodNaN:rs,BRAND:Sm,ZodBranded:Ra,ZodPipeline:Hi,ZodReadonly:ji,custom:fd,Schema:Be,ZodSchema:Be,late:Em,get ZodFirstPartyTypeKind(){return ge},coerce:{string:t=>nn.create({...t,coerce:!0}),number:t=>Yn.create({...t,coerce:!0}),boolean:t=>Ri.create({...t,coerce:!0}),bigint:t=>Jn.create({...t,coerce:!0}),date:t=>Er.create({...t,coerce:!0})},any:Fm,array:Lm,bigint:Am,boolean:yd,date:Pm,discriminatedUnion:Zm,effect:vd,enum:Jm,function:qm,instanceof:Tm,intersection:$m,lazy:Km,literal:Ym,map:Hm,nan:Bm,nativeEnum:Xm,never:Mm,null:Dm,nullable:tg,number:gd,object:Om,oboolean:()=>yd().optional(),onumber:()=>gd().optional(),optional:eg,ostring:()=>md().optional(),pipeline:rg,preprocess:ng,promise:Qm,record:Wm,set:jm,strictObject:Gm,string:md,symbol:Vm,transformer:vd,tuple:Um,undefined:Nm,union:zm,unknown:Rm,void:Im,NEVER:_e,ZodIssueCode:J,quotelessJson:am,ZodError:Ft});function ig(t){throw new Error("Unexpected object: "+t)}const og=-2147483648,_d=-9007199254740991n,sg=NaN,ag=NaN,lg=null,cg=null;function Cd(t,e){switch(e){case"Int":return t===og;case"Long":return t===Number(_d)||t===_d;case"Float":return t===sg;case"Double":return t===ag;case"String":return t===lg;case"Bytes":return t===cg;default:throw Error(`unsupported data type: ${e}`)}}function dg(t,e){const n=Math.floor(e/8),i=1<<7-e%8;return(t[n]&i)>0}function wd(t){const{type:e,name:n,domain:i}=t;return{type:e,name:n,...i&&{domain:i}}}function Ma(t){return t.map(wd)}function os(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=>os(n,e))};case"outer":return{type:"outer",primary:os(t.primary,e),secondary:t.secondary.map(n=>os(n,e))};default:ig(t)}}is.object({__isRef:is.literal(!0).describe("Crucial marker for the block dependency tree reconstruction"),blockId:is.string().describe("Upstream block id"),name:is.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 ug(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 pg="1.9.0";function hg(){return ug({sdkVersion:pg})}function fg(t){if(typeof globalThis.getEnvironmentValue=="function")return globalThis.getEnvironmentValue(t)}function ei(t){return!!t&&typeof t.children<"u"}function er(t){return ei(t)?t.groupId:t.colId}function bd(t,e,n){const i=(c,u)=>{const p=c.children.map(er),f=b._includes(p,er(u)),m=b._last(c.children),v=m&&er(m)!==er(u);return f&&v};if(!ei(t))return!0;const s=t,l=n;if(i(s,l))return s.children.push(l),!0;if(s.groupId===e){const c=s.children.map(er);if(!b._includes(c,er(l)))return s.children.push(l),!0}for(let c=s.children.length-1;c>=0&&!bd(s.children[c],e,n);c--);return!1}function mg(t){const e=(s,l)=>ei(s)&&ei(l)&&er(s)===er(l),n=(s,l)=>{if(!ei(l))return s;const c=s,u=l;return u.children&&u.groupId&&bd(c,u.groupId,u.children[0])||u.children.forEach(p=>n(c,p)),c},i=[];for(let s=1;s<=t.length;s++){const l=t[s-1],c=t[s];e(l,c)?t[s]=n(l,c):i.push(l)}return i}var gg=class extends b.BeanStub{constructor(){super(...arguments),this.beanName="toolPanelColDefService"}wireBeans(t){this.columnModel=t.columnModel}createColumnTree(t){const e=[],n=(s,l)=>{if(ei(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 v=n(m,l+1);v&&f.push(v)}),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}},i=[];return t.forEach(s=>{const l=n(s,0);l&&i.push(l)}),e.length>0&&b._warnOnce("unable to find grid columns for the supplied colDef(s):",e),i}syncLayoutWithGrid(t){const e=this.getLeafPathTrees(),n=mg(e);t(n)}getLeafPathTrees(){const t=(i,s)=>{let l;if(b.isProvidedColumnGroup(i))if(i.isPadding())l=s;else{const u=Object.assign({},i.getColGroupDef());u.groupId=i.getGroupId(),u.children=[s],l=u}else{const u=Object.assign({},i.getColDef());u.colId=i.getColId(),l=u}const c=i.getOriginalParent();return c?t(c,l):l};return this.columnModel.getCols().filter(i=>{const s=i.getColDef();return i.isPrimary()&&!s.showRowGroup}).map(i=>t(i,i.getColDef()))}};function yg(t){var e;return((e=t.sideBarService)==null?void 0:e.getSideBarComp().isDisplayed())??!1}function vg(t,e){var n;(n=t.sideBarService)==null||n.getSideBarComp().setDisplayed(e)}function _g(t,e){var n;(n=t.sideBarService)==null||n.getSideBarComp().setSideBarPosition(e)}function Cg(t,e){var n;(n=t.sideBarService)==null||n.getSideBarComp().openToolPanel(e,"api")}function wg(t){var e;(e=t.sideBarService)==null||e.getSideBarComp().close("api")}function bg(t){var e;return((e=t.sideBarService)==null?void 0:e.getSideBarComp().openedItem())??null}function xg(t){var e;(e=t.sideBarService)==null||e.getSideBarComp().refresh()}function kg(t){var e;return((e=t.sideBarService)==null?void 0:e.getSideBarComp().isToolPanelShowing())??!1}function Sg(t,e){var i;const n=(i=t.sideBarService)==null?void 0:i.getSideBarComp().getToolPanelInstance(e);return b._unwrapUserComp(n)}function Eg(t){var e;return(e=t.sideBarService)==null?void 0:e.getSideBarComp().getDef()}var Tg=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">
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",w._createIconNoSpan(this.toolPanelDef.iconKey,this.gos))}onButtonPressed(){this.dispatchLocalEvent({type:"toggleButtonClicked"})}setSelected(t){this.addOrRemoveCssClass("ag-selected",t),w._setAriaExpanded(this.eToggleButton,t)}getButtonElement(){return this.eToggleButton}},Tg=class extends w.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!==w.KeyCode.TAB||!t.shiftKey)){if(this.focusService.focusNextGridCoreContainer(!0)){t.preventDefault();return}w._stopPropagationForAgGrid(t)}}setActiveButton(t){this.buttonComps.forEach(e=>{e.setSelected(t===e.getToolPanelId())})}addButtonComp(t){const e=this.createBean(new Eg(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),w._clearElement(this.getGui()),super.destroy()}destroy(){this.clearButtons(),super.destroy()}},Bg={selector:"AG-SIDE-BAR-BUTTONS",component:Tg},xd={id:"columns",labelDefault:"Columns",labelKey:"columns",iconKey:"columns",toolPanel:"agColumnsToolPanel"},kd={id:"filters",labelDefault:"Filters",labelKey:"filters",iconKey:"filter",toolPanel:"agFiltersToolPanel"},Ia={columns:xd,filters:kd};function La(t){if(!t)return;if(t===!0)return{toolPanels:[xd,kd],defaultToolPanel:"columns"};if(typeof t=="string")return La([t]);if(Array.isArray(t)){const n=[];return t.forEach(i=>{const s=Ia[i];if(!s){Sd(i);return}n.push(s)}),n.length===0?void 0:{toolPanels:n,defaultToolPanel:n[0].id}}return{toolPanels:Ag(t.toolPanels),defaultToolPanel:t.defaultToolPanel,hiddenByDefault:t.hiddenByDefault,position:t.position}}function Sd(t){w._warnOnce(`the key ${t} is not a valid key for specifying a tool panel, valid keys are: ${Object.keys(Ia).join(",")}`)}function Ag(t){const e=[];return t&&t.forEach(n=>{let i=null;if(typeof n=="string"){const s=Ia[n];if(!s){Sd(n);return}i=s}else i=n;e.push(i)}),e}var Pg=class extends w.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 i=Math.max(this.minWidth,Math.floor(this.startingWidth-t*n));this.maxWidth!=null&&(i=Math.min(this.maxWidth,i)),this.elementToResize.style.width=`${i}px`,this.dispatchResizeEvent(!1,e,i)}setInverted(t){this.inverted=t}setMaxWidth(t){this.maxWidth=t}setMinWidth(t){t!=null?this.minWidth=t:this.minWidth=100}},Vg=class extends w.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 Pg);t.setAttribute("id",`ag-${this.getCompId()}`),e.setElementToResize(t),this.appendChild(e)}getToolPanelId(){return this.toolPanelId}setToolPanelDef(t,e){const{id:n,minWidth:i,maxWidth:s,width:l}=t;this.toolPanelId=n,this.width=l;const d=this.userComponentFactory.getToolPanelCompDetails(t,e),u=d.newAgStackInstance();if(this.params=d.params,u==null){w._warnOnce(`error processing tool panel component ${n}. You need to specify 'toolPanel'`);return}u.then(this.setToolPanelComponent.bind(this)),i!=null&&this.resizeBar.setMinWidth(i),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",i=e?n:!n;this.resizeBar.setInverted(i)}refresh(){var t;(t=this.toolPanelCompInstance)==null||t.refresh(this.params)}},Ng=class extends w.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",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}},Bg=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 Tg(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()}},Ag={selector:"AG-SIDE-BAR-BUTTONS",component:Bg},xd={id:"columns",labelDefault:"Columns",labelKey:"columns",iconKey:"columns",toolPanel:"agColumnsToolPanel"},kd={id:"filters",labelDefault:"Filters",labelKey:"filters",iconKey:"filter",toolPanel:"agFiltersToolPanel"},Ia={columns:xd,filters:kd};function La(t){if(!t)return;if(t===!0)return{toolPanels:[xd,kd],defaultToolPanel:"columns"};if(typeof t=="string")return La([t]);if(Array.isArray(t)){const n=[];return t.forEach(i=>{const s=Ia[i];if(!s){Sd(i);return}n.push(s)}),n.length===0?void 0:{toolPanels:n,defaultToolPanel:n[0].id}}return{toolPanels:Pg(t.toolPanels),defaultToolPanel:t.defaultToolPanel,hiddenByDefault:t.hiddenByDefault,position:t.position}}function Sd(t){b._warnOnce(`the key ${t} is not a valid key for specifying a tool panel, valid keys are: ${Object.keys(Ia).join(",")}`)}function Pg(t){const e=[];return t&&t.forEach(n=>{let i=null;if(typeof n=="string"){const s=Ia[n];if(!s){Sd(n);return}i=s}else i=n;e.push(i)}),e}var Vg=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 i=Math.max(this.minWidth,Math.floor(this.startingWidth-t*n));this.maxWidth!=null&&(i=Math.min(this.maxWidth,i)),this.elementToResize.style.width=`${i}px`,this.dispatchResizeEvent(!1,e,i)}setInverted(t){this.inverted=t}setMaxWidth(t){this.maxWidth=t}setMinWidth(t){t!=null?this.minWidth=t:this.minWidth=100}},Ng=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 Vg);t.setAttribute("id",`ag-${this.getCompId()}`),e.setElementToResize(t),this.appendChild(e)}getToolPanelId(){return this.toolPanelId}setToolPanelDef(t,e){const{id:n,minWidth:i,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)),i!=null&&this.resizeBar.setMinWidth(i),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",i=e?n:!n;this.resizeBar.setInverted(i)}refresh(){var t;(t=this.toolPanelCompInstance)==null||t.refresh(this.params)}},Dg=class extends b.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>`,[Bg]),this.sideBarButtons=w.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:La(this.gos.get("sideBar")),sideBarState:t}),this.addManagedPropertyListener("sideBar",this.onSideBarUpdated.bind(this)),this.sideBarService.registerSideBarComp(this);const e=this.getFocusableElement();this.createManagedBean(new w.ManagedFocusFeature(e,{onTabKeyDown:this.onTabKeyDown.bind(this),handleKeyDown:this.handleKeyDown.bind(this)})),w._addFocusableContainerListener(this,e,this.focusService)}onTabKeyDown(t){if(t.defaultPrevented)return;const{focusService:e,sideBarButtons:n}=this,i=this.getGui(),s=n.getGui(),l=w._getActiveDomElement(this.gos),d=i.querySelector(".ag-tool-panel-wrapper:not(.ag-hidden)"),u=t.target;if(!d)return e.focusNextGridCoreContainer(t.shiftKey,!0);if(s.contains(l)){e.focusInto(d,t.shiftKey)&&t.preventDefault();return}if(!t.shiftKey)return;let p=null;d.contains(l)?p=this.focusService.findNextFocusableElement(d,void 0,!0):e.isTargetUnderManagedComponent(d,u)&&t.shiftKey&&(p=this.focusService.findFocusableElementBeforeTabGuard(d,u)),p||(p=s.querySelector(".ag-selected button")),p&&p!==t.target&&(t.preventDefault(),p.focus())}handleKeyDown(t){const e=w._getActiveDomElement(this.gos);if(!this.sideBarButtons.getGui().contains(e))return;const n=this.sideBarButtons.getGui(),i=Array.prototype.slice.call(n.querySelectorAll(".ag-side-button")),s=i.findIndex(u=>u.contains(e));let l=null;switch(t.key){case w.KeyCode.LEFT:case w.KeyCode.UP:l=Math.max(0,s-1);break;case w.KeyCode.RIGHT:case w.KeyCode.DOWN:l=Math.min(s+1,i.length-1);break}if(l===null)return;const d=i[l].querySelector("button");d&&(d.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 i=this.sideBar.toolPanels;if(this.createToolPanelsAndSideButtons(i,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(i=>{i.setResizerSizerSide(n)}),this.dispatchSideBarUpdated(),this}setDisplayed(t,e){super.setDisplayed(t,e),this.dispatchSideBarUpdated()}getState(){const t={};return this.toolPanelWrappers.forEach(e=>{var n,i;t[e.getToolPanelId()]=(i=(n=e.getToolPanelInstance())==null?void 0:n.getState)==null?void 0:i.call(n)}),{visible:this.isDisplayed(),position:this.position,openToolPanel:this.openedItem(),toolPanels:t}}createToolPanelsAndSideButtons(t,e,n){var i;for(const s of t)this.createToolPanelAndSideButton(s,(i=e==null?void 0:e.toolPanels)==null?void 0:i[s.id],n==null?void 0:n[s.id])}validateDef(t){var e;if(t.id==null)return w._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(w.ModuleNames.ColumnsToolPanelModule,"Column Tool Panel"))return!1;if(t.toolPanel==="agFiltersToolPanel"){if(!this.gos.assertModuleRegistered(w.ModuleNames.FiltersToolPanelModule,"Filters Tool Panel"))return!1;if((e=this.filterManager)!=null&&e.isAdvancedFilterEnabled())return w._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 i=this.sideBarButtons.addButtonComp(t);let s;n?s=n:(s=this.createBean(new Vg),s.setToolPanelDef(t,{initialState:e,onStateUpdated:()=>this.dispatchSideBarUpdated()})),s.setDisplayed(!1);const l=s.getGui();this.appendChild(l),this.toolPanelWrappers.push(s),w._setAriaControls(i.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 d=t===l.getToolPanelId();l.setDisplayed(d)});const i=this.openedItem();n!==i&&(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){w._warnOnce(`unable to lookup Tool Panel as invalid key supplied: ${t}`);return}return e.getToolPanelInstance()}raiseToolPanelVisibleEvent(t,e,n){const i=!!t&&!!e;e&&this.eventService.dispatchEvent({type:"toolPanelVisibleChanged",source:n,key:e,visible:!1,switchingToolPanel:i}),t&&this.eventService.dispatchEvent({type:"toolPanelVisibleChanged",source:n,key:t,visible:!0,switchingToolPanel:i})}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=La(this.gos.get("sideBar")),e={};t&&this.sideBar&&((n=t.toolPanels)==null||n.forEach(i=>{var f,m;const{id:s}=i;if(!s)return;const l=(f=this.sideBar.toolPanels)==null?void 0:f.find(v=>v.id===s);if(!l||i.toolPanel!==l.toolPanel)return;const d=this.toolPanelWrappers.find(v=>v.getToolPanelId()===s);if(!d)return;const u=this.gos.addGridCommonParams({...i.toolPanelParams??{},onStateUpdated:()=>this.dispatchSideBarUpdated()});((m=d.getToolPanelInstance())==null?void 0:m.refresh(u))===!0&&(this.toolPanelWrappers=this.toolPanelWrappers.filter(v=>v!==d),w._removeFromParent(d.getGui()),e[s]=d)})),this.clearDownUi(),this.setSideBarDef({sideBarDef:t,existingToolPanelWrappers:e})}dispatchSideBarUpdated(){this.eventService.dispatchEvent({type:"sideBarUpdated"})}destroyToolPanelWrappers(){this.toolPanelWrappers.forEach(t=>{w._removeFromParent(t.getGui()),this.destroyBean(t)}),this.toolPanelWrappers.length=0}destroy(){this.destroyToolPanelWrappers(),super.destroy()}},Dg={selector:"AG-SIDE-BAR",component:Ng},Fg=class extends w.BeanStub{constructor(){super(...arguments),this.beanName="sideBarService"}registerSideBarComp(t){this.sideBarComp=t}getSideBarComp(){return this.sideBarComp}getSideBarSelector(){return Dg}},Oa="32.3.3",Ed=w._defineModule({version:Oa,moduleName:`${w.ModuleNames.SideBarModule}-core`,beans:[mg,Fg],dependantModules:[Re.EnterpriseCoreModule]}),Rg=w._defineModule({version:Oa,moduleName:`${w.ModuleNames.SideBarModule}-api`,apiFunctions:{isSideBarVisible:gg,setSideBarVisible:yg,setSideBarPosition:vg,openToolPanel:_g,closeToolPanel:Cg,getOpenedToolPanel:wg,refreshToolPanel:bg,isToolPanelShowing:xg,getToolPanelInstance:kg,getSideBar:Sg},dependantModules:[Ed]}),Ga=w._defineModule({version:Oa,moduleName:w.ModuleNames.SideBarModule,dependantModules:[Ed,Rg]}),Mg={sum:"Sum",first:"First",last:"Last",min:"Min",max:"Max",count:"Count",avg:"Average"},Ig=class extends w.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=Lg,t.first=Og,t.last=Gg,t.min=zg,t.max=Zg,t.count=$g,t.avg=Ug,this.initialised=!0}isAggFuncPossible(t,e){const n=this.getFuncNames(t),i=w._includes(n,e),s=w._exists(this.aggFuncsMap[e]);return i&&s}getDefaultFuncLabel(t){return Mg[t]??t}getDefaultAggFunc(t){const e=t.getColDef().defaultAggFunc;if(w._exists(e)&&this.isAggFuncPossible(t,e))return e;if(this.isAggFuncPossible(t,"sum"))return"sum";const n=this.getFuncNames(t);return w._existsAndNotEmpty(n)?n[0]:null}addAggFuncs(t){this.init(),w._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 Lg(t){const{values:e}=t;let n=null;for(let i=0;i<e.length;i++){const s=e[i];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 Og(t){return t.values.length>0?t.values[0]:null}function Gg(t){return t.values.length>0?w._last(t.values):null}function zg(t){const{values:e}=t;let n=null;for(let i=0;i<e.length;i++){const s=e[i];(typeof s=="number"||typeof s=="bigint")&&(n===null||n>s)&&(n=s)}return n}function Zg(t){const{values:e}=t;let n=null;for(let i=0;i<e.length;i++){const s=e[i];(typeof s=="number"||typeof s=="bigint")&&(n===null||n<s)&&(n=s)}return n}function $g(t){var s,l;const{values:e}=t;let n=0;for(let d=0;d<e.length;d++){const u=e[d];n+=u!=null&&typeof u.value=="number"?u.value:1}const i=(l=(s=t.rowNode)==null?void 0:s.aggData)==null?void 0:l[t.column.getColId()];return i&&i.value===n?i:{value:n,toString:function(){return this.value.toString()},toNumber:function(){return this.value}}}function Ug(t){var d,u,p;const{values:e}=t;let n=0,i=0;for(let f=0;f<e.length;f++){const m=e[f];let v=null;typeof m=="number"||typeof m=="bigint"?(v=m,i++):m!=null&&(typeof m.value=="number"||typeof m.value=="bigint")&&typeof m.count=="number"&&(v=m.value*(typeof m.value=="number"?m.count:BigInt(m.count)),i+=m.count),typeof v=="number"?n+=typeof n=="number"?v:BigInt(v):typeof v=="bigint"&&(n=(typeof n=="bigint"?n:BigInt(n))+v)}let s=null;i>0&&(s=n/(typeof n=="number"?i:BigInt(i)));const l=(p=(d=t.rowNode)==null?void 0:d.aggData)==null?void 0:p[(u=t.column)==null?void 0:u.getColId()];return l&&l.count===i&&l.value===s?l:{count:i,value:s,toString:function(){return typeof this.value=="number"||typeof this.value=="bigint"?this.value.toString():""},toNumber:function(){return this.value}}}var Wg=class extends w.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=w._missingOrEmpty(this.funcColsService.getValueColumns()),n=!this.gos.getCallback("getGroupRowAgg"),i=t.changedPath&&t.changedPath.isActive();if(e&&n&&i)return;const s=this.createAggDetails(t);this.recursivelyCreateAggData(s)}createAggDetails(t){const e=this.columnModel.isPivotActive(),n=this.funcColsService.getValueColumns(),i=e?this.funcColsService.getPivotColumns():[];return{alwaysAggregateAtRootLevel:this.gos.get("alwaysAggregateAtRootLevel"),groupIncludeTotalFooter:!!w._getGrandTotalRow(this.gos),changedPath:t.changedPath,valueColumns:n,pivotColumns:i,filteredOnly:!this.isSuppressAggFilteredOnly(),userAggFunc:this.gos.getCallback("getGroupRowAgg")}}isSuppressAggFilteredOnly(){return w._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,i=e.pivotColumns.length===0;let s;e.userAggFunc?s=e.userAggFunc({nodes:t.childrenAfterFilter}):n?s=null:i?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 i=!0;for(let l=0;l<n.length;l++){const d=n[l],u=d.getColDef();if(u.pivotTotalColumnIds!=null){i=!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,d)}if(!i)for(let l=0;l<n.length;l++){const d=n[l],u=d.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,d)}return e}aggregateRowNodeUsingValuesOnly(t,e){const n={},i=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,i,e.filteredOnly),d=t.aggData;return i.forEach((u,p)=>{n[u.getId()]=this.aggregateValues(l[p],u.getAggFunc(),u,t)}),s&&d&&s.forEach(u=>{n[u.getId()]=d[u.getId()]}),n}getValuesPivotNonLeaf(t,e){return t.childrenAfterFilter.map(n=>n.aggData[e])}getValuesFromMappedSet(t,e,n){let i=t;for(let s=0;s<e.length;s++){const l=e[s];i=i?i[l]:null}return i?i.map(s=>this.valueService.getValue(n,s)):[]}getValuesNormal(t,e,n){const i=[];e.forEach(()=>i.push([]));const s=e.length,l=n?t.childrenAfterFilter:t.childrenAfterGroup,d=l.length;for(let u=0;u<d;u++){const p=l[u];for(let f=0;f<s;f++){const m=e[f],v=this.valueService.getValue(m,p);i[f].push(v)}}return i}aggregateValues(t,e,n,i,s){const l=typeof e=="string"?this.aggFuncService.getAggFunc(e):e;if(typeof l!="function")return w._errorOnce(`unrecognised aggregation function ${e}`),null;const d=l,u=this.gos.addGridCommonParams({values:t,column:n,colDef:n?n.getColDef():void 0,pivotResultColumn:s,rowNode:i,data:i?i.data:void 0});return d(u)}},Hg=class extends w.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 i=w._isGroupMultiAutoColumn(this.gos);return n&&i&&(w._warnOnce('you cannot mix groupDisplayType = "multipleColumns" with treeData, only one column can be used to display groups when doing tree data'),i=!1),i?t.forEach((s,l)=>{e.push(this.createOneAutoCol(s,l))}):e.push(this.createOneAutoCol()),e}updateAutoCols(t,e){t.forEach((n,i)=>this.updateOneAutoCol(n,i,e))}createOneAutoCol(t,e){let n;t?n=`${w.GROUP_AUTO_COLUMN_ID}-${t.getId()}`:n=w.GROUP_AUTO_COLUMN_ID;const i=this.createAutoColDef(n,t,e);i.colId=n;const s=new w.AgColumn(i,null,n,!0);return this.createBean(s),s}updateOneAutoCol(t,e,n){const i=t.getColDef(),s=typeof i.showRowGroup=="string"?i.showRowGroup:void 0,l=s!=null?this.columnModel.getColDefCol(s):void 0,d=this.createAutoColDef(t.getId(),l??void 0,e);t.setColDef(d,null,n),this.columnFactory.applyColumnState(t,d,n)}createAutoColDef(t,e,n){let i=this.createBaseColDef(e);const s=this.gos.get("autoGroupColumnDef");w._mergeDeep(i,s),i=this.columnFactory.addColumnDefaultAndTypes(i,t),this.gos.get("treeData")||w._missing(i.field)&&w._missing(i.valueGetter)&&w._missing(i.filterValueGetter)&&i.filter!=="agGroupColumnFilter"&&(i.filter=!1),n&&n>0&&(i.headerCheckboxSelection=!1);const l=w._isColumnsSortingCoupledToGroup(this.gos),d=i.valueGetter||i.field!=null;return l&&!d&&(i.sortIndex=void 0,i.initialSort=void 0),i}createBaseColDef(t){const e=this.gos.get("autoGroupColumnDef"),i={headerName:this.localeService.getLocaleTextFunc()("group","Group")};if(e&&(e.cellRenderer||e.cellRendererSelector)||(i.cellRenderer="agGroupCellRenderer"),t){const l=t.getColDef();Object.assign(i,{headerName:this.columnNameService.getDisplayNameForColumn(t,"header"),headerValueGetter:l.headerValueGetter}),l.cellRenderer&&Object.assign(i,{cellRendererParams:{innerRenderer:l.cellRenderer,innerRendererParams:l.cellRendererParams}}),i.showRowGroup=t.getColId()}else i.showRowGroup=!0;return i}},jg=class extends Re.PillDragComp{constructor(t,e,n,i,s){super(e,n,s,`
10
+ </div>`,[Ag]),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:La(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,i=this.getGui(),s=n.getGui(),l=b._getActiveDomElement(this.gos),c=i.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(),i=Array.prototype.slice.call(n.querySelectorAll(".ag-side-button")),s=i.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,i.length-1);break}if(l===null)return;const c=i[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 i=this.sideBar.toolPanels;if(this.createToolPanelsAndSideButtons(i,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(i=>{i.setResizerSizerSide(n)}),this.dispatchSideBarUpdated(),this}setDisplayed(t,e){super.setDisplayed(t,e),this.dispatchSideBarUpdated()}getState(){const t={};return this.toolPanelWrappers.forEach(e=>{var n,i;t[e.getToolPanelId()]=(i=(n=e.getToolPanelInstance())==null?void 0:n.getState)==null?void 0:i.call(n)}),{visible:this.isDisplayed(),position:this.position,openToolPanel:this.openedItem(),toolPanels:t}}createToolPanelsAndSideButtons(t,e,n){var i;for(const s of t)this.createToolPanelAndSideButton(s,(i=e==null?void 0:e.toolPanels)==null?void 0:i[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 i=this.sideBarButtons.addButtonComp(t);let s;n?s=n:(s=this.createBean(new Ng),s.setToolPanelDef(t,{initialState:e,onStateUpdated:()=>this.dispatchSideBarUpdated()})),s.setDisplayed(!1);const l=s.getGui();this.appendChild(l),this.toolPanelWrappers.push(s),b._setAriaControls(i.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 i=this.openedItem();n!==i&&(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 i=!!t&&!!e;e&&this.eventService.dispatchEvent({type:"toolPanelVisibleChanged",source:n,key:e,visible:!1,switchingToolPanel:i}),t&&this.eventService.dispatchEvent({type:"toolPanelVisibleChanged",source:n,key:t,visible:!0,switchingToolPanel:i})}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=La(this.gos.get("sideBar")),e={};t&&this.sideBar&&((n=t.toolPanels)==null||n.forEach(i=>{var f,m;const{id:s}=i;if(!s)return;const l=(f=this.sideBar.toolPanels)==null?void 0:f.find(v=>v.id===s);if(!l||i.toolPanel!==l.toolPanel)return;const c=this.toolPanelWrappers.find(v=>v.getToolPanelId()===s);if(!c)return;const u=this.gos.addGridCommonParams({...i.toolPanelParams??{},onStateUpdated:()=>this.dispatchSideBarUpdated()});((m=c.getToolPanelInstance())==null?void 0:m.refresh(u))===!0&&(this.toolPanelWrappers=this.toolPanelWrappers.filter(v=>v!==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()}},Fg={selector:"AG-SIDE-BAR",component:Dg},Rg=class extends b.BeanStub{constructor(){super(...arguments),this.beanName="sideBarService"}registerSideBarComp(t){this.sideBarComp=t}getSideBarComp(){return this.sideBarComp}getSideBarSelector(){return Fg}},Oa="32.3.3",Ed=b._defineModule({version:Oa,moduleName:`${b.ModuleNames.SideBarModule}-core`,beans:[gg,Rg],dependantModules:[Re.EnterpriseCoreModule]}),Mg=b._defineModule({version:Oa,moduleName:`${b.ModuleNames.SideBarModule}-api`,apiFunctions:{isSideBarVisible:yg,setSideBarVisible:vg,setSideBarPosition:_g,openToolPanel:Cg,closeToolPanel:wg,getOpenedToolPanel:bg,refreshToolPanel:xg,isToolPanelShowing:kg,getToolPanelInstance:Sg,getSideBar:Eg},dependantModules:[Ed]}),Ga=b._defineModule({version:Oa,moduleName:b.ModuleNames.SideBarModule,dependantModules:[Ed,Mg]}),Ig={sum:"Sum",first:"First",last:"Last",min:"Min",max:"Max",count:"Count",avg:"Average"},Lg=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=Og,t.first=Gg,t.last=zg,t.min=Zg,t.max=$g,t.count=Ug,t.avg=Wg,this.initialised=!0}isAggFuncPossible(t,e){const n=this.getFuncNames(t),i=b._includes(n,e),s=b._exists(this.aggFuncsMap[e]);return i&&s}getDefaultFuncLabel(t){return Ig[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 Og(t){const{values:e}=t;let n=null;for(let i=0;i<e.length;i++){const s=e[i];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 Gg(t){return t.values.length>0?t.values[0]:null}function zg(t){return t.values.length>0?b._last(t.values):null}function Zg(t){const{values:e}=t;let n=null;for(let i=0;i<e.length;i++){const s=e[i];(typeof s=="number"||typeof s=="bigint")&&(n===null||n>s)&&(n=s)}return n}function $g(t){const{values:e}=t;let n=null;for(let i=0;i<e.length;i++){const s=e[i];(typeof s=="number"||typeof s=="bigint")&&(n===null||n<s)&&(n=s)}return n}function Ug(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 i=(l=(s=t.rowNode)==null?void 0:s.aggData)==null?void 0:l[t.column.getColId()];return i&&i.value===n?i:{value:n,toString:function(){return this.value.toString()},toNumber:function(){return this.value}}}function Wg(t){var c,u,p;const{values:e}=t;let n=0,i=0;for(let f=0;f<e.length;f++){const m=e[f];let v=null;typeof m=="number"||typeof m=="bigint"?(v=m,i++):m!=null&&(typeof m.value=="number"||typeof m.value=="bigint")&&typeof m.count=="number"&&(v=m.value*(typeof m.value=="number"?m.count:BigInt(m.count)),i+=m.count),typeof v=="number"?n+=typeof n=="number"?v:BigInt(v):typeof v=="bigint"&&(n=(typeof n=="bigint"?n:BigInt(n))+v)}let s=null;i>0&&(s=n/(typeof n=="number"?i:BigInt(i)));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===i&&l.value===s?l:{count:i,value:s,toString:function(){return typeof this.value=="number"||typeof this.value=="bigint"?this.value.toString():""},toNumber:function(){return this.value}}}var Hg=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"),i=t.changedPath&&t.changedPath.isActive();if(e&&n&&i)return;const s=this.createAggDetails(t);this.recursivelyCreateAggData(s)}createAggDetails(t){const e=this.columnModel.isPivotActive(),n=this.funcColsService.getValueColumns(),i=e?this.funcColsService.getPivotColumns():[];return{alwaysAggregateAtRootLevel:this.gos.get("alwaysAggregateAtRootLevel"),groupIncludeTotalFooter:!!b._getGrandTotalRow(this.gos),changedPath:t.changedPath,valueColumns:n,pivotColumns:i,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,i=e.pivotColumns.length===0;let s;e.userAggFunc?s=e.userAggFunc({nodes:t.childrenAfterFilter}):n?s=null:i?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 i=!0;for(let l=0;l<n.length;l++){const c=n[l],u=c.getColDef();if(u.pivotTotalColumnIds!=null){i=!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(!i)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={},i=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,i,e.filteredOnly),c=t.aggData;return i.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 i=t;for(let s=0;s<e.length;s++){const l=e[s];i=i?i[l]:null}return i?i.map(s=>this.valueService.getValue(n,s)):[]}getValuesNormal(t,e,n){const i=[];e.forEach(()=>i.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],v=this.valueService.getValue(m,p);i[f].push(v)}}return i}aggregateValues(t,e,n,i,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:i,data:i?i.data:void 0});return c(u)}},jg=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 i=b._isGroupMultiAutoColumn(this.gos);return n&&i&&(b._warnOnce('you cannot mix groupDisplayType = "multipleColumns" with treeData, only one column can be used to display groups when doing tree data'),i=!1),i?t.forEach((s,l)=>{e.push(this.createOneAutoCol(s,l))}):e.push(this.createOneAutoCol()),e}updateAutoCols(t,e){t.forEach((n,i)=>this.updateOneAutoCol(n,i,e))}createOneAutoCol(t,e){let n;t?n=`${b.GROUP_AUTO_COLUMN_ID}-${t.getId()}`:n=b.GROUP_AUTO_COLUMN_ID;const i=this.createAutoColDef(n,t,e);i.colId=n;const s=new b.AgColumn(i,null,n,!0);return this.createBean(s),s}updateOneAutoCol(t,e,n){const i=t.getColDef(),s=typeof i.showRowGroup=="string"?i.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 i=this.createBaseColDef(e);const s=this.gos.get("autoGroupColumnDef");b._mergeDeep(i,s),i=this.columnFactory.addColumnDefaultAndTypes(i,t),this.gos.get("treeData")||b._missing(i.field)&&b._missing(i.valueGetter)&&b._missing(i.filterValueGetter)&&i.filter!=="agGroupColumnFilter"&&(i.filter=!1),n&&n>0&&(i.headerCheckboxSelection=!1);const l=b._isColumnsSortingCoupledToGroup(this.gos),c=i.valueGetter||i.field!=null;return l&&!c&&(i.sortIndex=void 0,i.initialSort=void 0),i}createBaseColDef(t){const e=this.gos.get("autoGroupColumnDef"),i={headerName:this.localeService.getLocaleTextFunc()("group","Group")};if(e&&(e.cellRenderer||e.cellRendererSelector)||(i.cellRenderer="agGroupCellRenderer"),t){const l=t.getColDef();Object.assign(i,{headerName:this.columnNameService.getDisplayNameForColumn(t,"header"),headerValueGetter:l.headerValueGetter}),l.cellRenderer&&Object.assign(i,{cellRendererParams:{innerRenderer:l.cellRenderer,innerRendererParams:l.cellRendererParams}}),i.showRowGroup=t.getColId()}else i.showRowGroup=!0;return i}},qg=class extends Re.PillDragComp{constructor(t,e,n,i,s){super(e,n,s,`
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
- `,[w.SortIndicatorSelector]),this.column=t,this.dropZonePurpose=i,this.eSortIndicator=w.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"),i=this.gos.get("functionsReadOnly");if(this.isAggregationZone()&&!i){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(),i=t("ariaDropZoneColumnComponentAggFuncSeparator"," of "),s={asc:t("ariaDropZoneColumnComponentSortAscending","ascending"),desc:t("ariaDropZoneColumnComponentSortDescending","descending")},l=this.column.getSort(),d=this.gos.get("rowGroupPanelSuppressSort");return[n&&`${n}${i}`,e,this.isGroupingZone()&&!d&&l&&`, ${s[l]}`].filter(u=>!!u).join("")}getColumnAndAggFuncName(){const t=this.displayName;let e="";if(this.isAggregationZone()){const n=this.column.getAggFunc(),i=typeof n=="string"?n:"agg";e=this.localeService.getLocaleTextFunc()(i,i)}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=i=>{i.preventDefault();const l=this.gos.get("multiSortKey")==="ctrl"?i.ctrlKey||i.metaKey:i.shiftKey;this.sortController.progressSort(this.column,l,"uiColumnSorted")};this.addGuiEventListener("click",n),this.addGuiEventListener("keydown",i=>{i.key===w.KeyCode.ENTER&&this.isGroupingZone()&&n(i)})}}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===w.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 Re.VirtualList({cssIdentifier:"select-agg-func"}),e=this.aggFuncService.getFuncNames(this.column),n=this.getGui(),i=t.getGui();t.setModel({getRow:function(m){return e[m]},getRowCount:function(){return e.length}}),this.createBean(t);const s=w._loadTemplate('<div class="ag-select-agg-func-popup"></div>');s.style.top="0px",s.style.left="0px",s.appendChild(i),s.style.width=`${n.clientWidth}px`;const[l]=this.addManagedElementListeners(s,{focusout:m=>{!s.contains(m.relatedTarget)&&p&&p.hideFunc()}}),d=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:d,ariaLabel:u("ariaLabelAggregationFunction","Aggregation Function")});p&&t.setComponentCreator(this.createAggSelect.bind(this,p.hideFunc)),t.addGuiEventListener("keydown",m=>{if(m.key===w.KeyCode.ENTER||m.key===w.KeyCode.SPACE){const v=t.getLastFocusedRow();if(v==null)return;const S=t.getComponentAt(v);S&&S.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")},i=this.localeService.getLocaleTextFunc(),s=e.toString(),l=i(s,s);return new qg(n,l)}isGroupingAndLocked(){return this.isGroupingZone()&&this.columnModel.isColGroupLocked(this.column)}isAggregationZone(){return this.dropZonePurpose==="aggregation"}isGroupingZone(){return this.dropZonePurpose==="rowGroup"}getDragSourceType(){return w.DragSourceType.ToolPanel}destroy(){super.destroy(),this.column=null}},qg=class extends w.Component{constructor(t,e){super('<div class="ag-select-agg-func-item"/>'),this.selectItem=t,this.getGui().innerText=e,this.addGuiEventListener("click",this.selectItem)}},za=class extends Re.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===w.DragSourceType.HeaderCell||t===w.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 i=t.dragSource.getDragItem().columns;this.setColumnsVisible(i,!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 i=t.filter(s=>!s.getColDef().lockVisible);this.columnModel.setColsVisible(i,e,n)}}isRowGroupPanel(){return this.dropZonePurpose==="rowGroup"}createPillComponent(t,e,n,i){return new jg(t,e,n,this.dropZonePurpose,i)}},Za=class extends za{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:w._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()}},$a=class extends za{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:w._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()}},Kg=class extends w.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"),w._setAriaRole(t,"presentation"),this.rowGroupComp=new $a(!0),this.createManagedBean(this.rowGroupComp),this.pivotComp=new Za(!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)}},Yg={selector:"AG-GRID-HEADER-DROP-ZONES",component:Kg},Jg=class extends w.BeanStub{constructor(){super(...arguments),this.beanName="columnDropZonesService"}getDropZoneSelector(){return Yg}},Xg=class extends w.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()),i=v=>!v.node.group,s=v=>v.node.leafGroup,l=w._getGroupAggFiltering(this.gos)||(e?s:i),{changedPath:d}=t,u=(v,S=!1)=>{v.childrenAfterFilter&&(v.childrenAfterAggFilter=v.childrenAfterFilter,S&&v.childrenAfterAggFilter.forEach(x=>u(x,S)),this.setAllChildrenCount(v)),v.sibling&&(v.sibling.childrenAfterAggFilter=v.childrenAfterAggFilter)},p=v=>{var S;v.childrenAfterAggFilter=((S=v.childrenAfterFilter)==null?void 0:S.filter(x=>{var A;return l({node:x})&&this.filterManager.doesRowPassAggregateFilters({rowNode:x})?(u(x,!0),!0):(A=x.childrenAfterAggFilter)==null?void 0:A.length}))||null,this.setAllChildrenCount(v),v.sibling&&(v.sibling.childrenAfterAggFilter=v.childrenAfterAggFilter)};d.forEachChangedNodeDepthFirst(n?p:u,!0)}setAllChildrenCountTreeData(t){const e=t.childrenAfterAggFilter;let n=0;if(e){const i=e.length;n=i;for(let s=0;s<i;++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)}},Qg=class extends w.TabGuardComp{constructor(){super(`
17
+ `,[b.SortIndicatorSelector]),this.column=t,this.dropZonePurpose=i,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"),i=this.gos.get("functionsReadOnly");if(this.isAggregationZone()&&!i){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(),i=t("ariaDropZoneColumnComponentAggFuncSeparator"," of "),s={asc:t("ariaDropZoneColumnComponentSortAscending","ascending"),desc:t("ariaDropZoneColumnComponentSortDescending","descending")},l=this.column.getSort(),c=this.gos.get("rowGroupPanelSuppressSort");return[n&&`${n}${i}`,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(),i=typeof n=="string"?n:"agg";e=this.localeService.getLocaleTextFunc()(i,i)}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=i=>{i.preventDefault();const l=this.gos.get("multiSortKey")==="ctrl"?i.ctrlKey||i.metaKey:i.shiftKey;this.sortController.progressSort(this.column,l,"uiColumnSorted")};this.addGuiEventListener("click",n),this.addGuiEventListener("keydown",i=>{i.key===b.KeyCode.ENTER&&this.isGroupingZone()&&n(i)})}}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 Re.VirtualList({cssIdentifier:"select-agg-func"}),e=this.aggFuncService.getFuncNames(this.column),n=this.getGui(),i=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(i),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 v=t.getLastFocusedRow();if(v==null)return;const k=t.getComponentAt(v);k&&k.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")},i=this.localeService.getLocaleTextFunc(),s=e.toString(),l=i(s,s);return new Kg(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}},Kg=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)}},za=class extends Re.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 i=t.dragSource.getDragItem().columns;this.setColumnsVisible(i,!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 i=t.filter(s=>!s.getColDef().lockVisible);this.columnModel.setColsVisible(i,e,n)}}isRowGroupPanel(){return this.dropZonePurpose==="rowGroup"}createPillComponent(t,e,n,i){return new qg(t,e,n,this.dropZonePurpose,i)}},Za=class extends za{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()}},$a=class extends za{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()}},Yg=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 $a(!0),this.createManagedBean(this.rowGroupComp),this.pivotComp=new Za(!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)}},Jg={selector:"AG-GRID-HEADER-DROP-ZONES",component:Yg},Xg=class extends b.BeanStub{constructor(){super(...arguments),this.beanName="columnDropZonesService"}getDropZoneSelector(){return Jg}},Qg=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()),i=v=>!v.node.group,s=v=>v.node.leafGroup,l=b._getGroupAggFiltering(this.gos)||(e?s:i),{changedPath:c}=t,u=(v,k=!1)=>{v.childrenAfterFilter&&(v.childrenAfterAggFilter=v.childrenAfterFilter,k&&v.childrenAfterAggFilter.forEach(S=>u(S,k)),this.setAllChildrenCount(v)),v.sibling&&(v.sibling.childrenAfterAggFilter=v.childrenAfterAggFilter)},p=v=>{var k;v.childrenAfterAggFilter=((k=v.childrenAfterFilter)==null?void 0:k.filter(S=>{var N;return l({node:S})&&this.filterManager.doesRowPassAggregateFilters({rowNode:S})?(u(S,!0),!0):(N=S.childrenAfterAggFilter)==null?void 0:N.length}))||null,this.setAllChildrenCount(v),v.sibling&&(v.sibling.childrenAfterAggFilter=v.childrenAfterAggFilter)};c.forEachChangedNodeDepthFirst(n?p:u,!0)}setAllChildrenCountTreeData(t){const e=t.childrenAfterAggFilter;let n=0;if(e){const i=e.length;n=i;for(let s=0;s<i;++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)}},ey=class extends b.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=w.RefPlaceholder,this.eUnderlyingFilter=w.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&&w._warnOnce('Group Column Filter does not work with the colDef property "field". This property will be ignored.'),t.filterValueGetter&&w._warnOnce('Group Column Filter does not work with the colDef property "filterValueGetter". This property will be ignored.'),t.filterParams&&w._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 w._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||(w._warnOnce("Group Column Filter only works on group columns. Please use a different filter."),[])}updateGroupField(){w._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],w._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(w._loadTemplate('<div class="ag-filter-separator"></div>')),w._setDisplayed(this.eGroupField,!0)),e):(this.selectedColumn=void 0,w._setDisplayed(this.eGroupField,!1),null)}createGroupFieldSelectElement(t){this.eGroupFieldSelect=this.createManagedBean(new w.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"),w.AgPromise.resolve();const e=[],n=[];return t.forEach(i=>{const s=this.filterManager.getOrCreateFilterWrapper(i);s!=null&&s.filterPromise&&e.push(s.filterPromise.then(l=>(l&&n.push({filter:l,column:i}),i.getId()===this.selectedColumn.getId()&&(this.selectedFilter=l??void 0),l)))}),w.AgPromise.all(e).then(()=>{this.filterColumnPairs=n,this.groupColumn.setFilterActive(this.isFilterActive(),"columnRowGroupChanged")})}addUnderlyingFilterElement(){var e;if(w._clearElement(this.eUnderlyingFilter),!this.selectedColumn)return w.AgPromise.resolve();const t=this.createManagedBean(new w.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,i;(n=t.afterGuiAttached)==null||n.call(t,this.afterGuiAttachedParams),!((i=this.afterGuiAttachedParams)!=null&&i.suppressFocus)&&this.eGroupFieldSelect&&!this.eGroupFieldSelect.isDisabled()&&this.eGroupFieldSelect.getFocusableElement().focus()}))??w.AgPromise.resolve()):w.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 w.AgPromise.resolve()}afterGuiAttached(t){this.afterGuiAttachedParams=t,this.addUnderlyingFilterElement()}afterGuiDetached(){var t,e;w._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 i;if(e==="gridDestroyed")return;const n=t.getColId();(i=this.filterColumnPairs)!=null&&i.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()}},ey=class extends w.Component{constructor(){super(`
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(i=>{const s=this.filterManager.getOrCreateFilterWrapper(i);s!=null&&s.filterPromise&&e.push(s.filterPromise.then(l=>(l&&n.push({filter:l,column:i}),i.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,i;(n=t.afterGuiAttached)==null||n.call(t,this.afterGuiAttachedParams),!((i=this.afterGuiAttachedParams)!=null&&i.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 i;if(e==="gridDestroyed")return;const n=t.getColId();(i=this.filterColumnPairs)!=null&&i.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()}},ty=class extends b.Component{constructor(){super(`
23
23
  <div data-ref="eFloatingFilter" class="ag-group-floating-filter ag-floating-filter-input" role="presentation"></div>
24
- `),this.eFloatingFilter=w.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 w.AgPromise(n=>{this.params.parentFilterInstance(i=>{this.parentFilterInstance=i,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 w.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,w._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 i,s;this.underlyingFloatingFilter=n,(s=this.underlyingFloatingFilter)==null||s.onParentModelChanged((i=this.parentFilterInstance.getSelectedFilter())==null?void 0:i.getModel()),this.appendChild(n.getGui()),this.showingUnderlyingFloatingFilter=!0})}return this.setupReadOnlyFloatingFilterElement(),w.AgPromise.resolve()}onColumnVisibleChanged(){this.setupUnderlyingFloatingFilterElement()}onColDefChanged(t){var n,i,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=(i=this.underlyingFloatingFilter)==null?void 0:i.onParamsUpdated)==null||s.call(i,e.params))}onParentModelChanged(t,e){var n,i;this.showingUnderlyingFloatingFilter?(i=this.underlyingFloatingFilter)==null||i.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()}},Ua=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 i;const e=this.allSets[t.id];t.childrenAfterGroup=t.childrenAfterGroup.filter(s=>!e.removeFromChildrenAfterGroup[s.id]),t.allLeafChildren=((i=t.allLeafChildren)==null?void 0:i.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 ty(t){if(!t)return!1;const e=t.length;if(e<2)return!1;let n=!1;for(let i=1;i<e;i++)if(Td(t[i-1],t[i])>0){n=!0;break}return n?(t.sort(Td),!0):!1}function Td(t,e){const n=t.sourceRowIndex,i=e.sourceRowIndex,s=n>=0,l=i>=0,d=s&&l,u=!s&&!l;return d?n-i:u?t.__objectId-e.__objectId:s?1:-1}var ny=class extends w.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=[],i=[];let s;e.childrenAfterGroup.forEach(l=>{var d;(d=l.childrenAfterGroup)!=null&&d.length?l.key===""&&!s?s=l:i.push(l):n.push(l)}),s&&i.push(s),e.childrenAfterGroup=[...n,...i]}},!1)}createGroupingDetails(t){const{rowNode:e,changedPath:n,rowNodeTransactions:i,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:i,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 Ua;w._existsAndNotEmpty(e.remove)&&this.removeNodes(e.remove,t,n),w._existsAndNotEmpty(e.update)&&this.moveNodesInWrongPath(e.update,t,n),w._existsAndNotEmpty(e.add)&&this.insertNodes(e.add,t);const i=n.getAllParents().slice();n.flush(),this.removeEmptyGroups(i,t)}),t.rowNodesOrderChanged&&this.sortChildren(t)}sortChildren(t){t.changedPath.forEachChangedNodeDepthFirst(e=>{ty(e.childrenAfterGroup)&&t.changedPath.addParentNode(e)},!1,!0)}orderGroups(t){const e=t.initialGroupOrderComparator;w._exists(e)&&n(t.rootNode);function n(i){w._exists(i.childrenAfterGroup)&&!i.leafGroup&&(i.childrenAfterGroup.sort((l,d)=>e({nodeA:l,nodeB:d})),i.childrenAfterGroup.forEach(l=>n(l)))}}getExistingPathForNode(t,e){const n=[];let i=t.parent;for(;i&&i!==e.rootNode;)n.push({key:i.key,rowGroupColumn:i.rowGroupColumn,field:i.field}),i=i.parent;return n.reverse(),n}moveNodesInWrongPath(t,e,n){t.forEach(i=>{e.changedPath.isActive()&&e.changedPath.addParentNode(i.parent);const s=p=>p.key,l=this.getExistingPathForNode(i,e).map(s),d=this.getGroupInfo(i,e).map(s);w._areEqual(l,d)||this.moveNode(i,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 i=t.parent;e.changedPath.addParentNode(i)}}removeNodes(t,e,n){this.removeNodesFromParents(t,e,n),e.changedPath.isActive()&&t.forEach(i=>e.changedPath.addParentNode(i.parent))}forEachParentGroup(t,e,n){let i=e;for(;i&&i!==t.rootNode;)n(i),i=i.parent}removeNodesFromParents(t,e,n){const i=n==null,s=n||new Ua;t.forEach(l=>{this.removeFromParent(l,s),this.forEachParentGroup(e,l.parent,d=>{s.removeFromAllLeafChildren(d,l)})}),i&&s.flush()}removeEmptyGroups(t,e){let n=!0;const i=s=>{var p;const l=this.getChildrenMappedKey(s.key,s.rowGroupColumn),d=s.parent;return(d!=null&&d.childrenMapped?!d.childrenMapped[l]:!0)?!1:!!s.group&&(((p=s.childrenAfterGroup)==null?void 0:p.length)??0)===0};for(;n;){n=!1;const s=new Ua;t.forEach(l=>{this.forEachParentGroup(e,l,d=>{i(d)&&(n=!0,this.removeFromParent(d,s),d.setSelectedParams({newValue:!1,source:"rowGroupChanged"}))})}),s.flush()}}removeFromParent(t,e){var i;t.parent&&(e?e.removeFromChildrenAfterGroup(t.parent,t):(w._removeFromArray(t.parent.childrenAfterGroup,t),t.parent.updateHasChildren()));const n=this.getChildrenMappedKey(t.key,t.rowGroupColumn);(i=t.parent)!=null&&i.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:w._areEqual(t.groupedCols,e.groupedCols)&&w._areEqual(t.keyCreators,e.keyCreators)}checkAllGroupDataAfterColsChanged(t){const e=n=>{n&&n.forEach(i=>{var d;if(!i.group)return;const l={field:i.field,key:i.key,rowGroupColumn:i.rowGroupColumn,leafNode:(d=i.allLeafChildren)==null?void 0:d[0]};this.setGroupData(i,l,t),e(i.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,i=t.rootNode;i.leafGroup=n.length===0,i.childrenAfterGroup=[],i.childrenMapped={},i.updateHasChildren();const s=i.sibling;s&&(s.childrenAfterGroup=i.childrenAfterGroup,s.childrenMapped=i.childrenMapped),this.insertNodes(i.allLeafChildren,t)}noChangeInGroupingColumns(t,e){let n=!1;const i=this.showRowGroupColsService.getShowRowGroupCols(),s=i?i.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 i=this.getGroupInfo(t,e),s=this.findParentForNode(t,i,e,n);s.group||w._warnOnce("duplicate group keys for row data, keys should be unique",[s.data,t.data]),t.parent=s,t.level=i.length,s.childrenAfterGroup.push(t),s.updateHasChildren()}findParentForNode(t,e,n,i){let s=n.rootNode;return e.forEach((l,d)=>{s=this.getOrCreateNextNode(s,l,d,n),i!=null&&i.isRemoveFromAllLeafChildren(s,t)?i==null||i.preventRemoveFromAllLeafChildren(s,t):s.allLeafChildren.push(t)}),s}getOrCreateNextNode(t,e,n,i){var d;const s=this.getChildrenMappedKey(e.key,e.rowGroupColumn);let l=(d=t==null?void 0:t.childrenMapped)==null?void 0:d[s];return l||(l=this.createGroup(e,t,n,i),this.addToParent(l,t)),l}createGroup(t,e,n,i){const s=new w.RowNode(this.beans);return s.group=!0,s.field=t.field,s.rowGroupColumn=t.rowGroupColumn,this.setGroupData(s,t,i),s.key=t.key,s.id=this.createGroupId(s,e,n),s.level=n,s.leafGroup=n===i.groupedColCount-1,s.allLeafChildren=[],s.setAllChildrenCount(0),s.rowGroupIndex=n,s.childrenAfterGroup=[],s.childrenMapped={},s.updateHasChildren(),s.parent=e,this.setExpandedInitialValue(i,s),s}createGroupId(t,e,n){const i=(s,l)=>{if(!s.rowGroupColumn)return null;const d=l?i(l,l.parent):null;return`${d==null?"":d+"-"}${s.rowGroupColumn.getColId()}-${s.key}`};return w.RowNode.ID_PREFIX_ROW_GROUP+i(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 i={rowNode:e,field:e.field,key:e.key,level:e.level,rowGroupColumn:e.rowGroupColumn};e.expanded=n(i)==!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(i=>{let s=this.valueService.getKeyForNode(i,t),l=s!=null&&s!=="";if((e.pivotMode||!e.groupAllowUnbalanced)&&!l&&(s="",l=!0),l){const u={key:s,field:i.getColDef().field,rowGroupColumn:i,leafNode:t};n.push(u)}}),n}},ry=(t,e)=>t.treeNode.oldSourceRowIndex-e.treeNode.oldSourceRowIndex,lt=Object.freeze([]),iy=lt.values(),ss=(t,e)=>{t.parent=null,t.treeNode=null,e?t.childrenAfterGroup=[]:(t.level=0,t.childrenAfterGroup=null,t.allLeafChildren=null)},oy=class zf{constructor(e,n,i){this.parent=e,this.key=n,this.level=i,this.children=null,this.invalidatedHead=null,this.invalidatedNext=void 0,this.row=null,this.oldRow=null,this.duplicateRows=null,this.childrenAfterGroup=lt,this.allLeafChildren=lt,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())??iy}upsertKey(e){var i,s;typeof e!="string"&&(e=String(e));let n=(i=this.children)==null?void 0:i.get(e);return n||(n=new zf(this,e,this.level+1),(s=this.children??(this.children=new Map))==null||s.set(n.key,n)),n}destroy(){var i;const{row:e,parent:n}=this;n!==null&&((i=n==null?void 0:n.children)==null||i.delete(this.key),e!==null&&ss(e,!0),this.parent=null)}setRow(e){const{level:n,row:i,childrenAfterGroup:s}=this;if(n<0)i!==null&&i!==e&&ss(i,!0);else{if(i===e)return!1;i!==null?(e.allLeafChildren=i.allLeafChildren??this.allLeafChildren??lt,ss(i,!1)):e.allLeafChildren=this.allLeafChildren??lt}return e.level=n,e.childrenAfterGroup=s,e.treeNode=this,this.row=e,!0}removeRow(e){const{level:n,row:i,duplicateRows:s,childrenAfterGroup:l}=this;if(i===e){const d=this.popDuplicateRow();d?(this.row=d,d.childrenAfterGroup=l,n>=0&&(d.allLeafChildren=i.allLeafChildren??this.allLeafChildren??lt)):this.row=null}else{if(!(s!=null&&s.delete(e)))return!1;s.size===0&&(this.duplicateRows=null)}return ss(e,n<0),!0}addDuplicateRow(e){const{level:n}=this;let i=this.duplicateRows;if(i===null)i=new Set,this.duplicateRows=i;else if(i.has(e))return!1;return i.add(e),e.treeNode=this,e.level=n,n>=0&&(e.allLeafChildren=lt),e.childrenAfterGroup=lt,!0}sortFirstDuplicateRow(){const e=this.duplicateRows,n=this.row;if(!n||!e)return n;let i=n;for(const s of e)s.sourceRowIndex<i.sourceRowIndex&&(i=s);return i!==n&&(i.childrenAfterGroup=this.childrenAfterGroup,i.allLeafChildren=n.allLeafChildren??this.allLeafChildren??lt,n.childrenAfterGroup=lt,n.allLeafChildren=lt,e.delete(i),e.add(n),this.row=i),i}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,i;const e=this.parent;e!==null&&!e.childrenChanged&&((((n=this.children)==null?void 0:n.size)??0)>1||!((i=e.row)!=null&&i.data))&&(e.childrenChanged=!0,e.invalidate())}getRowPosition(){var n,i;const e=this.row;return e!=null&&e.data?e.sourceRowIndex:((i=(n=this.childrenAfterGroup[0])==null?void 0:n.treeNode)==null?void 0:i.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=lt,this.row.childrenAfterGroup=lt,!0);let n=!1,i=this.childrenAfterGroup;i===lt?(i=new Array(e),this.childrenAfterGroup=i,this.row.childrenAfterGroup=i,n=!0):i.length!==e&&(i.length=e,n=!0);let s=0,l=-1,d=!1;for(const p of this.enumChildren()){const f=p.getRowPosition();f<l&&(d=!0),l=f,p.oldSourceRowIndex=f;const m=p.row;i[s]!==m&&(i[s]=m,n=!0),++s}return n&&(this.leafChildrenChanged=!0),d&&this.reorderChildrenList(i),n||d}reorderChildrenList(e){const n=e.length,i=this.children;e.sort(ry),i.clear();for(let s=0;s<n;++s){const l=e[s].treeNode;i.set(l.key,l)}}updateAllLeafChildren(){var d,u;const{parent:e,row:n,childrenAfterGroup:i}=this;this.leafChildrenChanged=!1;let s=!1;const l=i.length;if(l===0)s=((d=n.allLeafChildren)==null?void 0:d.length)!==0,n.allLeafChildren=lt,this.allLeafChildren=lt;else if(l===1&&((u=i[0].allLeafChildren)!=null&&u.length))n.allLeafChildren=i[0].allLeafChildren,this.allLeafChildren=null,s=!0;else{let p=this.allLeafChildren;(p===lt||p===null)&&(p=[],this.allLeafChildren=p);const f=p.length;let m=0;for(let v=0;v<l;++v){const S=i[v],x=S.allLeafChildren,F=x.length;if(F)for(let T=0;T<F;++T){const A=x[T];(m>=f||p[m]!==A)&&(p[m]=A,s=!0),++m}else(m>=f||p[m]!==S)&&S&&(p[m]=S,s=!0),++m}f!==m&&(p.length=m,s=!0),n.allLeafChildren!==p&&(n.allLeafChildren=p,s=!0)}s&&e&&(e.leafChildrenChanged=!0)}},Bd=t=>(t.treeNodeFlags&1)!==0,Ad=t=>(t.treeNodeFlags&2)!==0,Pd=t=>(t.treeNodeFlags&4)!==0,sy=t=>(t.treeNodeFlags&8)!==0,Vd=t=>(t.treeNodeFlags&16)!==0,Nd=(t,e)=>{e?t.treeNodeFlags|=2:t.treeNodeFlags&=-3},ay=t=>{const e=t.treeNodeFlags;e&1&&(t.treeNodeFlags=e|4)},ly=t=>{const e=t.treeNodeFlags;e&1&&(t.treeNodeFlags=e|12)},tr=t=>{t.treeNodeFlags|=16},Dd=t=>{t.treeNodeFlags=1|t.treeNodeFlags&-29},qi=t=>{t.treeNodeFlags=0},cy=class extends w.BeanStub{constructor(){super(...arguments),this.rowsPendingDestruction=null,this.root=new oy(null,"",-1)}wireBeans(t){this.beans=t,this.showRowGroupColsService=t.showRowGroupColsService}destroy(){const t=this.root.row;t!==null&&(this.root.removeRow(t),qi(t)),this.destroyTree(this.root),this.commitDestroyedRows(),super.destroy()}execute(t){const{rowNodeTransactions:e,rowNodesOrderChanged:n,changedPath:i}=t,s=t.rowNode,l=this.gos,d={changedPath:i,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(d,e,n):this.handleRowData(d,s,t.afterColumnsChanged===!0)}handleRowData(t,e,n){var s,l,d;const i=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((d=i.row)==null?void 0:d.childrenAfterGroup);return}this.oldGroupDisplayColIds=u}this.clearTree(i),this.addOrUpdateRows(t,e.allLeafChildren,!1),this.commitTree(t)}handleTransaction(t,e,n){for(const{remove:i,update:s,add:l}of e)this.removeRows(i),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,i=t.length;n<i;++n){const s=t[n].treeNode;s&&s.oldSourceRowIndex!==n&&s.invalidateOrder()}}checkAllGroupDataAfterColsChanged(t){var e;for(let n=0,i=(t==null?void 0:t.length)??0;n<i;++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 i=0,s=(e==null?void 0:e.length)??0;i<s;++i){const l=e[i],d=this.upsertPath(this.getDataPath(t,l));d&&this.addOrUpdateRow(d,l,n)}}removeRows(t){for(let e=0,n=(t==null?void 0:t.length)??0;e<n;++e){const i=t[e],s=i.treeNode;s!==null&&this.removeRow(s,i)}}getDataPath({getDataPath:t},{data:e}){const n=(t==null?void 0:t(e))||lt;return n.length||w._warnOnce("getDataPath() should not return an empty path",[e]),n}upsertPath(t){let e=this.root;const n=t.length-1;for(let i=0;i<=n;++i){const s=e.upsertKey(t[i]);if(i>=n)return s.invalidate(),s;e=s}return null}addOrUpdateRow(t,e,n){var d;const{level:i,row:s}=t;if(i<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&&!Pd(e)&&(ay(e),l=!0),l&&t.invalidate(),(d=this.rowsPendingDestruction)==null||d.delete(e)}removeRow(t,e){const{parent:n,level:i}=t;if(i<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 i;const e=this.root;this.commitInvalidatedChildren(t,e);const n=e.row;e.childrenChanged&&e.updateChildrenAfterGroup()&&tr(n),n.updateHasChildren(),Vd(n)&&(i=t.changedPath)!=null&&i.isActive()&&t.changedPath.addParentNode(n),Dd(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 i=e.key;n.key!==i?(n.key=i,ly(n),this.setGroupData(n,i)):n.groupData||this.setGroupData(n,i)}commitNodePostOrder(t,e,n){var f,m,v;const i=n.row,s=n.oldRow;if(n.isEmptyFillerNode()){this.clearTree(n);return}n.childrenChanged&&n.updateChildrenAfterGroup()&&tr(i),n.leafChildrenChanged&&n.updateAllLeafChildren();const l=n.getRowPosition();n.oldSourceRowIndex!==l&&(n.oldSourceRowIndex=l,e.childrenChanged=!0);const d=!!((f=i.childrenAfterGroup)!=null&&f.length),u=d||!i.data,p=i.group;p!==u?(tr(i),i.setGroup(u),!u&&!i.expanded&&Nd(i,!1)):i.hasChildren()!==d&&(tr(i),i.updateHasChildren()),i.group&&!Ad(i)&&(s!==i&&s!==null&&s.group&&Ad(s)&&!t.isGroupOpenByDefault?i.expanded=s.expanded:i.expanded=this.getExpandedInitialValue(t,i),Nd(i,!0)),Pd(i)&&(tr(e.row),sy(i)&&i.setData(i.data)),s!==i&&(n.oldRow=i,s!==null&&(p||n.hasChildren())&&tr(i),e.childrenChanged=!0,tr(e.row)),Vd(i)?(m=t.changedPath)!=null&&m.isActive()&&t.changedPath.addParentNode(i):Bd(i)||(i.childrenAfterFilter||(i.childrenAfterFilter=i.childrenAfterGroup.slice()),i.childrenAfterAggFilter||(i.childrenAfterAggFilter=i.childrenAfterFilter.slice()),i.childrenAfterSort||(i.childrenAfterSort=i.childrenAfterAggFilter.slice())),Dd(i),(v=n.duplicateRows)!=null&&v.size&&!n.duplicateRowsWarned&&(n.duplicateRowsWarned=!0,w._warnOnce("duplicate group keys for row data, keys should be unique",[i.id,i.data,...Array.from(n.duplicateRows).map(S=>S.data)]))}createFillerRow(t){const e=new w.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,i=t.parent;for(;i!==null;){const s=i.parent;if(s===null)break;n=`${i.level}-${i.key}-${n}`,i=s}return e.id=w.RowNode.ID_PREFIX_ROW_GROUP+n,e}setGroupData(t,e){var s;const n={};t.groupData=n;const i=(s=this.showRowGroupColsService)==null?void 0:s.getShowRowGroupCols();if(i)for(const l of i)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:i,level:s}=t;if(e!==null&&n!==null&&(e.childrenChanged=!0,e.row!==null&&tr(e.row)),i!==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:i}=t;if(e&&(n>=0&&!e.data?this.destroyRow(e,!0):qi(e)),i)for(const s of i)n>=0&&!s.data?this.destroyRow(s,!0):qi(s);for(const s of t.enumChildren())this.destroyTree(s);t.destroy()}destroyRow(t,e){if(!Bd(t)){qi(t);return}if(!e){(this.rowsPendingDestruction??(this.rowsPendingDestruction=new Set)).add(t);return}qi(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)}}},dy=class extends w.BeanStub{constructor(){super(...arguments),this.beanName="groupStage"}wireBeans(t){this.selectableService=t.selectableService}execute(t){const e=this.gos.get("treeData")?cy:ny;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()}},Fd="PivotRowTotal_",uy=class extends w.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,d=[]){return l.forEach(u=>{u.children!==void 0?n(u.children,d):d.push(u)}),d}const i=n(e);this.addRowGroupTotals(e,i),this.addExpandablePivotGroups(e,i),this.addPivotTotalsToGroups(e,i);const s=i.map(l=>w._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,i,s){const l=this.funcColsService.getValueColumns();if(t>=i)return this.buildMeasureCols(n);const d=s[t].getColDef(),u=this.headerNameComparator.bind(this,d.pivotComparator);if(l.length===1&&this.gos.get("removePivotHeaderRowWhenSingleValueColumn")&&t===i-1){const f=[];return w._iterateObject(e,m=>{const v=[...n,m],S=this.createColDef(l[0],m,v);S.columnGroupShow="open",f.push(S)}),f.sort(u),f}const p=[];return w._iterateObject(e,(f,m)=>{const v=this.pivotDefaultExpanded===-1||t<this.pivotDefaultExpanded,S=[...n,f];p.push({children:this.recursivelyBuildGroup(t+1,m,S,i,s),headerName:f,pivotKeys:S,columnGroupShow:"open",openByDefault:v,groupId:this.generateColumnGroupId(S)})}),p.sort(u),p}buildMeasureCols(t){const e=this.funcColsService.getValueColumns();return e.length===0?[this.createColDef(null,"-",t)]:e.map(n=>{const i=this.columnNameService.getDisplayNameForColumn(n,"header");return{...this.createColDef(n,i,t),columnGroupShow:"open"}})}addExpandablePivotGroups(t,e){const n=this.gos.get("suppressExpandablePivotGroups");if(n||this.gos.get("pivotColumnGroupTotals"))return;const i=(s,l,d)=>{if("children"in s){const f=new Map;s.children.forEach(v=>{i(v,l,f)});const m=!s.children.some(v=>v.children);this.funcColsService.getValueColumns().forEach(v=>{const S=this.columnNameService.getDisplayNameForColumn(v,"header"),x=this.createColDef(v,S,s.pivotKeys);x.pivotTotalColumnIds=f.get(v.getColId()),x.columnGroupShow=n?"open":"closed",x.aggFunc=v.getAggFunc(),m||(s.children.push(x),l.push(x))}),this.merge(d,f);return}if(!s.pivotValueColumn)return;const u=s.pivotValueColumn.getColId();d.has(u)?d.get(u).push(s.colId):d.set(u,[s.colId])};t.forEach(s=>{i(s,e,new Map)})}addPivotTotalsToGroups(t,e){if(!this.gos.get("pivotColumnGroupTotals"))return;const n=this.gos.get("pivotColumnGroupTotals")==="after",i=this.funcColsService.getValueColumns(),s=i.map(d=>d.getAggFunc());if(!s||s.length<1||!this.sameAggFuncs(s))return;const l=i[0];t.forEach(d=>{this.recursivelyAddPivotTotal(d,e,l,n)})}recursivelyAddPivotTotal(t,e,n,i){const s=t;if(!s.children){const d=t;return d.colId?[d.colId]:null}let l=[];if(s.children.forEach(d=>{const u=this.recursivelyAddPivotTotal(d,e,n,i);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;i?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 d=0;d<s.length;d++){const u=s[d],p=this.columnNameService.getDisplayNameForColumn(u,"header"),f=this.createColDef(u,p,[]),m=[];for(let S=0;S<e.length;S++){const x=e[S];x.pivotValueColumn===u&&m.push(x.colId)}f.pivotTotalColumnIds=m,f.colId=Fd+f.colId;const v=l?{children:[f],pivotKeys:[],groupId:`${Fd}_pivotGroup_${u.getColId()}`}:f;e.push(f),n?t.push(v):t.unshift(v)}}createColDef(t,e,n,i=!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&&!i?t.getColId():""),s.field=s.colId,s.valueGetter=l=>{var d;return(d=l.data)==null?void 0:d[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,i)=>{const l=[...t.has(i)?t.get(i):[],...n];t.set(i,l)})}generateColumnGroupId(t){return`pivotGroup_${this.funcColsService.getPivotColumns().map(n=>n.getColId()).join("-")}_${t.join("-")}`}generateColumnId(t,e){return`pivot_${this.funcColsService.getPivotColumns().map(i=>i.getColId()).join("-")}_${t.join("-")}_${e}`}createColDefsFromFields(t){const e={};for(let s=0;s<t.length;s++){const d=t[s].split(this.fieldSeparator);let u=e;for(let p=0;p<d.length;p++){const f=d[p];u[f]==null&&(u[f]={}),u=u[f]}}const n=(s,l,d,u)=>{const p=[];for(const v in d){const S=d[v],x=n(`${s}${this.fieldSeparator}${v}`,v,S,u+1);p.push(x)}if(p.length===0){const v=this.columnModel.getColDefCol(l);if(v){const x=this.columnNameService.getDisplayNameForColumn(v,"header")??l,F=this.createColDef(v,x,void 0,!1);return F.colId=s,F.aggFunc=v.getAggFunc(),F.valueGetter=T=>{var A;return(A=T.data)==null?void 0:A[s]},F}return{colId:s,headerName:l,valueGetter:x=>{var F;return(F=x.data)==null?void 0:F[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}},i=[];for(const s in e){const l=e[s],d=n(s,s,l,0);i.push(d)}return i}},Rd="Exceeded maximum allowed pivot column count.",py=class extends w.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 i;try{i=this.bucketUpRowNodes(t)}catch(k){if(k.message===Rd){this.pivotResultColsService.setPivotResultCols([],"rowModelUpdated"),this.eventService.dispatchEvent({type:"pivotMaxColumnsExceeded",message:k.message}),this.lastTimeFailed=!0;return}throw k}const s=this.setUniqueValues(i),l=this.funcColsService.getValueColumns(),d=l.map(k=>`${k.getId()}-${k.getColDef().headerName}`).join("#"),u=l.map(k=>k.getAggFunc().toString()).join("#"),p=this.aggregationColumnsHashLastTime!==d,f=this.aggregationFuncsHashLastTime!==u;this.aggregationColumnsHashLastTime=d,this.aggregationFuncsHashLastTime=u;const m=this.funcColsService.getRowGroupColumns().map(k=>k.getId()).join("#"),v=m!==this.groupColumnsHashLastTime;this.groupColumnsHashLastTime=m;const S=this.gos.get("pivotRowTotals"),x=this.gos.get("pivotColumnGroupTotals"),F=this.gos.get("suppressExpandablePivotGroups"),T=this.gos.get("removePivotHeaderRowWhenSingleValueColumn"),A=S!==this.pivotRowTotalsLastTime||x!==this.pivotColumnGroupTotalsLastTime||F!==this.suppressExpandablePivotGroupsLastTime||T!==this.removePivotHeaderRowWhenSingleValueColumnLastTime;if(this.pivotRowTotalsLastTime=S,this.pivotColumnGroupTotalsLastTime=x,this.suppressExpandablePivotGroupsLastTime=F,this.removePivotHeaderRowWhenSingleValueColumnLastTime=T,this.lastTimeFailed||s||p||v||f||A){const{pivotColumnGroupDefs:k,pivotColumnDefs:D}=this.pivotColDefService.createPivotColumnDefs(this.uniqueValues);this.pivotColumnDefs=D,this.pivotResultColsService.setPivotResultCols(k,"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(i=>{i.leafGroup&&(i.childrenMapped=null)});const n=i=>{var s;i.leafGroup?this.bucketRowNode(i,e):(s=i.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,i){const s={},l=e[n];if(t.forEach(d=>{let u=this.valueService.getKeyForNode(l,d);if(w._missing(u)&&(u=""),!i[u]){this.currentUniqueCount+=1,i[u]={};const p=this.maxUniqueValues!==-1,f=this.currentUniqueCount>this.maxUniqueValues;if(p&&f)throw Error(Rd)}s[u]||(s[u]=[]),s[u].push(d)}),n===e.length-1)return s;{const d={};return w._iterateObject(s,(u,p)=>{d[u]=this.bucketChildren(p,e,n+1,i[u])}),d}}getPivotColumnDefs(){return this.pivotColumnDefs}};function hy(t,e,n){t.aggFuncService&&t.aggFuncService.addAggFuncs({key:n})}function fy(t,e){t.aggFuncService&&t.aggFuncService.addAggFuncs(e)}function my(t){t.aggFuncService&&t.aggFuncService.clear()}function gy(t,e,n){t.funcColsService.setColumnAggFunc(e,n,"api")}function yy(t){return t.columnModel.isPivotMode()}function vy(t,e,n){return t.pivotResultColsService.lookupPivotResultCol(e,n)}function _y(t,e){t.funcColsService.setValueColumns(e,"api")}function Cy(t){return t.funcColsService.getValueColumns()}function wy(t,e){t.funcColsService.removeValueColumns([e],"api")}function by(t,e){t.funcColsService.removeValueColumns(e,"api")}function xy(t,e){t.funcColsService.addValueColumns([e],"api")}function ky(t,e){t.funcColsService.addValueColumns(e,"api")}function Sy(t,e){t.funcColsService.setRowGroupColumns(e,"api")}function Ey(t,e){t.funcColsService.removeRowGroupColumns([e],"api")}function Ty(t,e){t.funcColsService.removeRowGroupColumns(e,"api")}function By(t,e){t.funcColsService.addRowGroupColumns([e],"api")}function Ay(t,e){t.funcColsService.addRowGroupColumns(e,"api")}function Py(t,e,n){t.funcColsService.moveRowGroupColumn(e,n,"api")}function Vy(t){return t.funcColsService.getRowGroupColumns()}function Ny(t,e){t.funcColsService.setPivotColumns(e,"api")}function Dy(t,e){t.funcColsService.removePivotColumns([e],"api")}function Fy(t,e){t.funcColsService.removePivotColumns(e,"api")}function Ry(t,e){t.funcColsService.addPivotColumns([e],"api")}function My(t,e){t.funcColsService.addPivotColumns(e,"api")}function Iy(t){return t.funcColsService.getPivotColumns()}function Ly(t,e){t.pivotResultColsService.setPivotResultCols(e,"api")}function Oy(t){const e=t.pivotResultColsService.getPivotResultCols();return e?e.list:null}var Gy=class extends w.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,i=typeof n=="string";!i&&!(n===!0)||(this.showRowGroupCols.push(t),i?this.showRowGroupColsMap[n]=t:this.funcColsService.getRowGroupColumns().forEach(d=>{this.showRowGroupColsMap[d.getId()]=t}))})}getShowRowGroupCols(){return this.showRowGroupCols}getShowRowGroupCol(t){return this.showRowGroupColsMap[t]}},Ki="32.3.3",Wa=w._defineModule({version:Ki,moduleName:`${w.ModuleNames.RowGroupingModule}-core`,beans:[Wg,Xg,dy,uy,py,Ig,Hg,Gy,Jg],userComponents:[{name:"agGroupRowRenderer",classImp:Re.GroupCellRenderer},{name:"agGroupCellRenderer",classImp:Re.GroupCellRenderer}],controllers:[{name:"groupCellRendererCtrl",classImp:Re.GroupCellRendererCtrl}],dependantModules:[Re.EnterpriseCoreModule]}),zy=w._defineModule({version:Ki,moduleName:`${w.ModuleNames.RowGroupingModule}-api`,apiFunctions:{addAggFunc:hy,addAggFuncs:fy,clearAggFuncs:my,setColumnAggFunc:gy,isPivotMode:yy,getPivotResultColumn:vy,setValueColumns:_y,getValueColumns:Cy,removeValueColumn:wy,removeValueColumns:by,addValueColumn:xy,addValueColumns:ky,setRowGroupColumns:Sy,removeRowGroupColumn:Ey,removeRowGroupColumns:Ty,addRowGroupColumn:By,addRowGroupColumns:Ay,getRowGroupColumns:Vy,moveRowGroupColumn:Py,setPivotColumns:Ny,removePivotColumn:Dy,removePivotColumns:Fy,addPivotColumn:Ry,addPivotColumns:My,getPivotColumns:Iy,setPivotResultColumns:Ly,getPivotResultColumns:Oy},dependantModules:[Wa]}),Md=w._defineModule({version:Ki,moduleName:"@ag-grid-enterprise/group-filter",userComponents:[{name:"agGroupColumnFilter",classImp:Qg}],dependantModules:[Wa,w._ColumnFilterModule]}),Zy=w._defineModule({version:Ki,moduleName:"@ag-grid-enterprise/group-floating-filter",userComponents:[{name:"agGroupColumnFloatingFilter",classImp:ey}],dependantModules:[Md,w._FloatingFilterModule]}),$y=w._defineModule({version:Ki,moduleName:w.ModuleNames.RowGroupingModule,dependantModules:[Wa,zy,Md,Zy]}),Id=class extends za{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:w._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()}},Ld=300,Uy=class extends w.Component{constructor(){super(`<div class="ag-column-select-header" role="presentation">
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(i=>{this.parentFilterInstance=i,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 i,s;this.underlyingFloatingFilter=n,(s=this.underlyingFloatingFilter)==null||s.onParentModelChanged((i=this.parentFilterInstance.getSelectedFilter())==null?void 0:i.getModel()),this.appendChild(n.getGui()),this.showingUnderlyingFloatingFilter=!0})}return this.setupReadOnlyFloatingFilterElement(),b.AgPromise.resolve()}onColumnVisibleChanged(){this.setupUnderlyingFloatingFilterElement()}onColDefChanged(t){var n,i,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=(i=this.underlyingFloatingFilter)==null?void 0:i.onParamsUpdated)==null||s.call(i,e.params))}onParentModelChanged(t,e){var n,i;this.showingUnderlyingFloatingFilter?(i=this.underlyingFloatingFilter)==null||i.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()}},Ua=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 i;const e=this.allSets[t.id];t.childrenAfterGroup=t.childrenAfterGroup.filter(s=>!e.removeFromChildrenAfterGroup[s.id]),t.allLeafChildren=((i=t.allLeafChildren)==null?void 0:i.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 ny(t){if(!t)return!1;const e=t.length;if(e<2)return!1;let n=!1;for(let i=1;i<e;i++)if(Td(t[i-1],t[i])>0){n=!0;break}return n?(t.sort(Td),!0):!1}function Td(t,e){const n=t.sourceRowIndex,i=e.sourceRowIndex,s=n>=0,l=i>=0,c=s&&l,u=!s&&!l;return c?n-i:u?t.__objectId-e.__objectId:s?1:-1}var ry=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=[],i=[];let s;e.childrenAfterGroup.forEach(l=>{var c;(c=l.childrenAfterGroup)!=null&&c.length?l.key===""&&!s?s=l:i.push(l):n.push(l)}),s&&i.push(s),e.childrenAfterGroup=[...n,...i]}},!1)}createGroupingDetails(t){const{rowNode:e,changedPath:n,rowNodeTransactions:i,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:i,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 Ua;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 i=n.getAllParents().slice();n.flush(),this.removeEmptyGroups(i,t)}),t.rowNodesOrderChanged&&this.sortChildren(t)}sortChildren(t){t.changedPath.forEachChangedNodeDepthFirst(e=>{ny(e.childrenAfterGroup)&&t.changedPath.addParentNode(e)},!1,!0)}orderGroups(t){const e=t.initialGroupOrderComparator;b._exists(e)&&n(t.rootNode);function n(i){b._exists(i.childrenAfterGroup)&&!i.leafGroup&&(i.childrenAfterGroup.sort((l,c)=>e({nodeA:l,nodeB:c})),i.childrenAfterGroup.forEach(l=>n(l)))}}getExistingPathForNode(t,e){const n=[];let i=t.parent;for(;i&&i!==e.rootNode;)n.push({key:i.key,rowGroupColumn:i.rowGroupColumn,field:i.field}),i=i.parent;return n.reverse(),n}moveNodesInWrongPath(t,e,n){t.forEach(i=>{e.changedPath.isActive()&&e.changedPath.addParentNode(i.parent);const s=p=>p.key,l=this.getExistingPathForNode(i,e).map(s),c=this.getGroupInfo(i,e).map(s);b._areEqual(l,c)||this.moveNode(i,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 i=t.parent;e.changedPath.addParentNode(i)}}removeNodes(t,e,n){this.removeNodesFromParents(t,e,n),e.changedPath.isActive()&&t.forEach(i=>e.changedPath.addParentNode(i.parent))}forEachParentGroup(t,e,n){let i=e;for(;i&&i!==t.rootNode;)n(i),i=i.parent}removeNodesFromParents(t,e,n){const i=n==null,s=n||new Ua;t.forEach(l=>{this.removeFromParent(l,s),this.forEachParentGroup(e,l.parent,c=>{s.removeFromAllLeafChildren(c,l)})}),i&&s.flush()}removeEmptyGroups(t,e){let n=!0;const i=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 Ua;t.forEach(l=>{this.forEachParentGroup(e,l,c=>{i(c)&&(n=!0,this.removeFromParent(c,s),c.setSelectedParams({newValue:!1,source:"rowGroupChanged"}))})}),s.flush()}}removeFromParent(t,e){var i;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);(i=t.parent)!=null&&i.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(i=>{var c;if(!i.group)return;const l={field:i.field,key:i.key,rowGroupColumn:i.rowGroupColumn,leafNode:(c=i.allLeafChildren)==null?void 0:c[0]};this.setGroupData(i,l,t),e(i.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,i=t.rootNode;i.leafGroup=n.length===0,i.childrenAfterGroup=[],i.childrenMapped={},i.updateHasChildren();const s=i.sibling;s&&(s.childrenAfterGroup=i.childrenAfterGroup,s.childrenMapped=i.childrenMapped),this.insertNodes(i.allLeafChildren,t)}noChangeInGroupingColumns(t,e){let n=!1;const i=this.showRowGroupColsService.getShowRowGroupCols(),s=i?i.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 i=this.getGroupInfo(t,e),s=this.findParentForNode(t,i,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=i.length,s.childrenAfterGroup.push(t),s.updateHasChildren()}findParentForNode(t,e,n,i){let s=n.rootNode;return e.forEach((l,c)=>{s=this.getOrCreateNextNode(s,l,c,n),i!=null&&i.isRemoveFromAllLeafChildren(s,t)?i==null||i.preventRemoveFromAllLeafChildren(s,t):s.allLeafChildren.push(t)}),s}getOrCreateNextNode(t,e,n,i){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,i),this.addToParent(l,t)),l}createGroup(t,e,n,i){const s=new b.RowNode(this.beans);return s.group=!0,s.field=t.field,s.rowGroupColumn=t.rowGroupColumn,this.setGroupData(s,t,i),s.key=t.key,s.id=this.createGroupId(s,e,n),s.level=n,s.leafGroup=n===i.groupedColCount-1,s.allLeafChildren=[],s.setAllChildrenCount(0),s.rowGroupIndex=n,s.childrenAfterGroup=[],s.childrenMapped={},s.updateHasChildren(),s.parent=e,this.setExpandedInitialValue(i,s),s}createGroupId(t,e,n){const i=(s,l)=>{if(!s.rowGroupColumn)return null;const c=l?i(l,l.parent):null;return`${c==null?"":c+"-"}${s.rowGroupColumn.getColId()}-${s.key}`};return b.RowNode.ID_PREFIX_ROW_GROUP+i(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 i={rowNode:e,field:e.field,key:e.key,level:e.level,rowGroupColumn:e.rowGroupColumn};e.expanded=n(i)==!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(i=>{let s=this.valueService.getKeyForNode(i,t),l=s!=null&&s!=="";if((e.pivotMode||!e.groupAllowUnbalanced)&&!l&&(s="",l=!0),l){const u={key:s,field:i.getColDef().field,rowGroupColumn:i,leafNode:t};n.push(u)}}),n}},iy=(t,e)=>t.treeNode.oldSourceRowIndex-e.treeNode.oldSourceRowIndex,lt=Object.freeze([]),oy=lt.values(),ss=(t,e)=>{t.parent=null,t.treeNode=null,e?t.childrenAfterGroup=[]:(t.level=0,t.childrenAfterGroup=null,t.allLeafChildren=null)},sy=class zf{constructor(e,n,i){this.parent=e,this.key=n,this.level=i,this.children=null,this.invalidatedHead=null,this.invalidatedNext=void 0,this.row=null,this.oldRow=null,this.duplicateRows=null,this.childrenAfterGroup=lt,this.allLeafChildren=lt,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())??oy}upsertKey(e){var i,s;typeof e!="string"&&(e=String(e));let n=(i=this.children)==null?void 0:i.get(e);return n||(n=new zf(this,e,this.level+1),(s=this.children??(this.children=new Map))==null||s.set(n.key,n)),n}destroy(){var i;const{row:e,parent:n}=this;n!==null&&((i=n==null?void 0:n.children)==null||i.delete(this.key),e!==null&&ss(e,!0),this.parent=null)}setRow(e){const{level:n,row:i,childrenAfterGroup:s}=this;if(n<0)i!==null&&i!==e&&ss(i,!0);else{if(i===e)return!1;i!==null?(e.allLeafChildren=i.allLeafChildren??this.allLeafChildren??lt,ss(i,!1)):e.allLeafChildren=this.allLeafChildren??lt}return e.level=n,e.childrenAfterGroup=s,e.treeNode=this,this.row=e,!0}removeRow(e){const{level:n,row:i,duplicateRows:s,childrenAfterGroup:l}=this;if(i===e){const c=this.popDuplicateRow();c?(this.row=c,c.childrenAfterGroup=l,n>=0&&(c.allLeafChildren=i.allLeafChildren??this.allLeafChildren??lt)):this.row=null}else{if(!(s!=null&&s.delete(e)))return!1;s.size===0&&(this.duplicateRows=null)}return ss(e,n<0),!0}addDuplicateRow(e){const{level:n}=this;let i=this.duplicateRows;if(i===null)i=new Set,this.duplicateRows=i;else if(i.has(e))return!1;return i.add(e),e.treeNode=this,e.level=n,n>=0&&(e.allLeafChildren=lt),e.childrenAfterGroup=lt,!0}sortFirstDuplicateRow(){const e=this.duplicateRows,n=this.row;if(!n||!e)return n;let i=n;for(const s of e)s.sourceRowIndex<i.sourceRowIndex&&(i=s);return i!==n&&(i.childrenAfterGroup=this.childrenAfterGroup,i.allLeafChildren=n.allLeafChildren??this.allLeafChildren??lt,n.childrenAfterGroup=lt,n.allLeafChildren=lt,e.delete(i),e.add(n),this.row=i),i}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,i;const e=this.parent;e!==null&&!e.childrenChanged&&((((n=this.children)==null?void 0:n.size)??0)>1||!((i=e.row)!=null&&i.data))&&(e.childrenChanged=!0,e.invalidate())}getRowPosition(){var n,i;const e=this.row;return e!=null&&e.data?e.sourceRowIndex:((i=(n=this.childrenAfterGroup[0])==null?void 0:n.treeNode)==null?void 0:i.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=lt,this.row.childrenAfterGroup=lt,!0);let n=!1,i=this.childrenAfterGroup;i===lt?(i=new Array(e),this.childrenAfterGroup=i,this.row.childrenAfterGroup=i,n=!0):i.length!==e&&(i.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;i[s]!==m&&(i[s]=m,n=!0),++s}return n&&(this.leafChildrenChanged=!0),c&&this.reorderChildrenList(i),n||c}reorderChildrenList(e){const n=e.length,i=this.children;e.sort(iy),i.clear();for(let s=0;s<n;++s){const l=e[s].treeNode;i.set(l.key,l)}}updateAllLeafChildren(){var c,u;const{parent:e,row:n,childrenAfterGroup:i}=this;this.leafChildrenChanged=!1;let s=!1;const l=i.length;if(l===0)s=((c=n.allLeafChildren)==null?void 0:c.length)!==0,n.allLeafChildren=lt,this.allLeafChildren=lt;else if(l===1&&((u=i[0].allLeafChildren)!=null&&u.length))n.allLeafChildren=i[0].allLeafChildren,this.allLeafChildren=null,s=!0;else{let p=this.allLeafChildren;(p===lt||p===null)&&(p=[],this.allLeafChildren=p);const f=p.length;let m=0;for(let v=0;v<l;++v){const k=i[v],S=k.allLeafChildren,F=S.length;if(F)for(let T=0;T<F;++T){const N=S[T];(m>=f||p[m]!==N)&&(p[m]=N,s=!0),++m}else(m>=f||p[m]!==k)&&k&&(p[m]=k,s=!0),++m}f!==m&&(p.length=m,s=!0),n.allLeafChildren!==p&&(n.allLeafChildren=p,s=!0)}s&&e&&(e.leafChildrenChanged=!0)}},Bd=t=>(t.treeNodeFlags&1)!==0,Ad=t=>(t.treeNodeFlags&2)!==0,Pd=t=>(t.treeNodeFlags&4)!==0,ay=t=>(t.treeNodeFlags&8)!==0,Vd=t=>(t.treeNodeFlags&16)!==0,Nd=(t,e)=>{e?t.treeNodeFlags|=2:t.treeNodeFlags&=-3},ly=t=>{const e=t.treeNodeFlags;e&1&&(t.treeNodeFlags=e|4)},cy=t=>{const e=t.treeNodeFlags;e&1&&(t.treeNodeFlags=e|12)},tr=t=>{t.treeNodeFlags|=16},Dd=t=>{t.treeNodeFlags=1|t.treeNodeFlags&-29},qi=t=>{t.treeNodeFlags=0},dy=class extends b.BeanStub{constructor(){super(...arguments),this.rowsPendingDestruction=null,this.root=new sy(null,"",-1)}wireBeans(t){this.beans=t,this.showRowGroupColsService=t.showRowGroupColsService}destroy(){const t=this.root.row;t!==null&&(this.root.removeRow(t),qi(t)),this.destroyTree(this.root),this.commitDestroyedRows(),super.destroy()}execute(t){const{rowNodeTransactions:e,rowNodesOrderChanged:n,changedPath:i}=t,s=t.rowNode,l=this.gos,c={changedPath:i,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 i=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=i.row)==null?void 0:c.childrenAfterGroup);return}this.oldGroupDisplayColIds=u}this.clearTree(i),this.addOrUpdateRows(t,e.allLeafChildren,!1),this.commitTree(t)}handleTransaction(t,e,n){for(const{remove:i,update:s,add:l}of e)this.removeRows(i),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,i=t.length;n<i;++n){const s=t[n].treeNode;s&&s.oldSourceRowIndex!==n&&s.invalidateOrder()}}checkAllGroupDataAfterColsChanged(t){var e;for(let n=0,i=(t==null?void 0:t.length)??0;n<i;++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 i=0,s=(e==null?void 0:e.length)??0;i<s;++i){const l=e[i],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 i=t[e],s=i.treeNode;s!==null&&this.removeRow(s,i)}}getDataPath({getDataPath:t},{data:e}){const n=(t==null?void 0:t(e))||lt;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 i=0;i<=n;++i){const s=e.upsertKey(t[i]);if(i>=n)return s.invalidate(),s;e=s}return null}addOrUpdateRow(t,e,n){var c;const{level:i,row:s}=t;if(i<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&&!Pd(e)&&(ly(e),l=!0),l&&t.invalidate(),(c=this.rowsPendingDestruction)==null||c.delete(e)}removeRow(t,e){const{parent:n,level:i}=t;if(i<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 i;const e=this.root;this.commitInvalidatedChildren(t,e);const n=e.row;e.childrenChanged&&e.updateChildrenAfterGroup()&&tr(n),n.updateHasChildren(),Vd(n)&&(i=t.changedPath)!=null&&i.isActive()&&t.changedPath.addParentNode(n),Dd(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 i=e.key;n.key!==i?(n.key=i,cy(n),this.setGroupData(n,i)):n.groupData||this.setGroupData(n,i)}commitNodePostOrder(t,e,n){var f,m,v;const i=n.row,s=n.oldRow;if(n.isEmptyFillerNode()){this.clearTree(n);return}n.childrenChanged&&n.updateChildrenAfterGroup()&&tr(i),n.leafChildrenChanged&&n.updateAllLeafChildren();const l=n.getRowPosition();n.oldSourceRowIndex!==l&&(n.oldSourceRowIndex=l,e.childrenChanged=!0);const c=!!((f=i.childrenAfterGroup)!=null&&f.length),u=c||!i.data,p=i.group;p!==u?(tr(i),i.setGroup(u),!u&&!i.expanded&&Nd(i,!1)):i.hasChildren()!==c&&(tr(i),i.updateHasChildren()),i.group&&!Ad(i)&&(s!==i&&s!==null&&s.group&&Ad(s)&&!t.isGroupOpenByDefault?i.expanded=s.expanded:i.expanded=this.getExpandedInitialValue(t,i),Nd(i,!0)),Pd(i)&&(tr(e.row),ay(i)&&i.setData(i.data)),s!==i&&(n.oldRow=i,s!==null&&(p||n.hasChildren())&&tr(i),e.childrenChanged=!0,tr(e.row)),Vd(i)?(m=t.changedPath)!=null&&m.isActive()&&t.changedPath.addParentNode(i):Bd(i)||(i.childrenAfterFilter||(i.childrenAfterFilter=i.childrenAfterGroup.slice()),i.childrenAfterAggFilter||(i.childrenAfterAggFilter=i.childrenAfterFilter.slice()),i.childrenAfterSort||(i.childrenAfterSort=i.childrenAfterAggFilter.slice())),Dd(i),(v=n.duplicateRows)!=null&&v.size&&!n.duplicateRowsWarned&&(n.duplicateRowsWarned=!0,b._warnOnce("duplicate group keys for row data, keys should be unique",[i.id,i.data,...Array.from(n.duplicateRows).map(k=>k.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,i=t.parent;for(;i!==null;){const s=i.parent;if(s===null)break;n=`${i.level}-${i.key}-${n}`,i=s}return e.id=b.RowNode.ID_PREFIX_ROW_GROUP+n,e}setGroupData(t,e){var s;const n={};t.groupData=n;const i=(s=this.showRowGroupColsService)==null?void 0:s.getShowRowGroupCols();if(i)for(const l of i)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:i,level:s}=t;if(e!==null&&n!==null&&(e.childrenChanged=!0,e.row!==null&&tr(e.row)),i!==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:i}=t;if(e&&(n>=0&&!e.data?this.destroyRow(e,!0):qi(e)),i)for(const s of i)n>=0&&!s.data?this.destroyRow(s,!0):qi(s);for(const s of t.enumChildren())this.destroyTree(s);t.destroy()}destroyRow(t,e){if(!Bd(t)){qi(t);return}if(!e){(this.rowsPendingDestruction??(this.rowsPendingDestruction=new Set)).add(t);return}qi(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)}}},uy=class extends b.BeanStub{constructor(){super(...arguments),this.beanName="groupStage"}wireBeans(t){this.selectableService=t.selectableService}execute(t){const e=this.gos.get("treeData")?dy:ry;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()}},Fd="PivotRowTotal_",py=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 i=n(e);this.addRowGroupTotals(e,i),this.addExpandablePivotGroups(e,i),this.addPivotTotalsToGroups(e,i);const s=i.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,i,s){const l=this.funcColsService.getValueColumns();if(t>=i)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===i-1){const f=[];return b._iterateObject(e,m=>{const v=[...n,m],k=this.createColDef(l[0],m,v);k.columnGroupShow="open",f.push(k)}),f.sort(u),f}const p=[];return b._iterateObject(e,(f,m)=>{const v=this.pivotDefaultExpanded===-1||t<this.pivotDefaultExpanded,k=[...n,f];p.push({children:this.recursivelyBuildGroup(t+1,m,k,i,s),headerName:f,pivotKeys:k,columnGroupShow:"open",openByDefault:v,groupId:this.generateColumnGroupId(k)})}),p.sort(u),p}buildMeasureCols(t){const e=this.funcColsService.getValueColumns();return e.length===0?[this.createColDef(null,"-",t)]:e.map(n=>{const i=this.columnNameService.getDisplayNameForColumn(n,"header");return{...this.createColDef(n,i,t),columnGroupShow:"open"}})}addExpandablePivotGroups(t,e){const n=this.gos.get("suppressExpandablePivotGroups");if(n||this.gos.get("pivotColumnGroupTotals"))return;const i=(s,l,c)=>{if("children"in s){const f=new Map;s.children.forEach(v=>{i(v,l,f)});const m=!s.children.some(v=>v.children);this.funcColsService.getValueColumns().forEach(v=>{const k=this.columnNameService.getDisplayNameForColumn(v,"header"),S=this.createColDef(v,k,s.pivotKeys);S.pivotTotalColumnIds=f.get(v.getColId()),S.columnGroupShow=n?"open":"closed",S.aggFunc=v.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=>{i(s,e,new Map)})}addPivotTotalsToGroups(t,e){if(!this.gos.get("pivotColumnGroupTotals"))return;const n=this.gos.get("pivotColumnGroupTotals")==="after",i=this.funcColsService.getValueColumns(),s=i.map(c=>c.getAggFunc());if(!s||s.length<1||!this.sameAggFuncs(s))return;const l=i[0];t.forEach(c=>{this.recursivelyAddPivotTotal(c,e,l,n)})}recursivelyAddPivotTotal(t,e,n,i){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,i);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;i?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 k=0;k<e.length;k++){const S=e[k];S.pivotValueColumn===u&&m.push(S.colId)}f.pivotTotalColumnIds=m,f.colId=Fd+f.colId;const v=l?{children:[f],pivotKeys:[],groupId:`${Fd}_pivotGroup_${u.getColId()}`}:f;e.push(f),n?t.push(v):t.unshift(v)}}createColDef(t,e,n,i=!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&&!i?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,i)=>{const l=[...t.has(i)?t.get(i):[],...n];t.set(i,l)})}generateColumnGroupId(t){return`pivotGroup_${this.funcColsService.getPivotColumns().map(n=>n.getColId()).join("-")}_${t.join("-")}`}generateColumnId(t,e){return`pivot_${this.funcColsService.getPivotColumns().map(i=>i.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 v in c){const k=c[v],S=n(`${s}${this.fieldSeparator}${v}`,v,k,u+1);p.push(S)}if(p.length===0){const v=this.columnModel.getColDefCol(l);if(v){const S=this.columnNameService.getDisplayNameForColumn(v,"header")??l,F=this.createColDef(v,S,void 0,!1);return F.colId=s,F.aggFunc=v.getAggFunc(),F.valueGetter=T=>{var N;return(N=T.data)==null?void 0:N[s]},F}return{colId:s,headerName:l,valueGetter:S=>{var F;return(F=S.data)==null?void 0:F[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}},i=[];for(const s in e){const l=e[s],c=n(s,s,l,0);i.push(c)}return i}},Rd="Exceeded maximum allowed pivot column count.",hy=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 i;try{i=this.bucketUpRowNodes(t)}catch(C){if(C.message===Rd){this.pivotResultColsService.setPivotResultCols([],"rowModelUpdated"),this.eventService.dispatchEvent({type:"pivotMaxColumnsExceeded",message:C.message}),this.lastTimeFailed=!0;return}throw C}const s=this.setUniqueValues(i),l=this.funcColsService.getValueColumns(),c=l.map(C=>`${C.getId()}-${C.getColDef().headerName}`).join("#"),u=l.map(C=>C.getAggFunc().toString()).join("#"),p=this.aggregationColumnsHashLastTime!==c,f=this.aggregationFuncsHashLastTime!==u;this.aggregationColumnsHashLastTime=c,this.aggregationFuncsHashLastTime=u;const m=this.funcColsService.getRowGroupColumns().map(C=>C.getId()).join("#"),v=m!==this.groupColumnsHashLastTime;this.groupColumnsHashLastTime=m;const k=this.gos.get("pivotRowTotals"),S=this.gos.get("pivotColumnGroupTotals"),F=this.gos.get("suppressExpandablePivotGroups"),T=this.gos.get("removePivotHeaderRowWhenSingleValueColumn"),N=k!==this.pivotRowTotalsLastTime||S!==this.pivotColumnGroupTotalsLastTime||F!==this.suppressExpandablePivotGroupsLastTime||T!==this.removePivotHeaderRowWhenSingleValueColumnLastTime;if(this.pivotRowTotalsLastTime=k,this.pivotColumnGroupTotalsLastTime=S,this.suppressExpandablePivotGroupsLastTime=F,this.removePivotHeaderRowWhenSingleValueColumnLastTime=T,this.lastTimeFailed||s||p||v||f||N){const{pivotColumnGroupDefs:C,pivotColumnDefs:I}=this.pivotColDefService.createPivotColumnDefs(this.uniqueValues);this.pivotColumnDefs=I,this.pivotResultColsService.setPivotResultCols(C,"rowModelUpdated"),t&&t.setInactive()}this.lastTimeFailed=!1}setUniqueValues(t){const e=JSON.stringify(t),n=JSON.stringify(this.uniqueValues);return e!==n?(this.uniqueValues=t,!0):!1}bucketUpRowNodes(t){this.currentUniqueCount=0;const e={};t.forEachChangedNodeDepthFirst(i=>{i.leafGroup&&(i.childrenMapped=null)});const n=i=>{var s;i.leafGroup?this.bucketRowNode(i,e):(s=i.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,i){const s={},l=e[n];if(t.forEach(c=>{let u=this.valueService.getKeyForNode(l,c);if(b._missing(u)&&(u=""),!i[u]){this.currentUniqueCount+=1,i[u]={};const p=this.maxUniqueValues!==-1,f=this.currentUniqueCount>this.maxUniqueValues;if(p&&f)throw Error(Rd)}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,i[u])}),c}}getPivotColumnDefs(){return this.pivotColumnDefs}};function fy(t,e,n){t.aggFuncService&&t.aggFuncService.addAggFuncs({key:n})}function my(t,e){t.aggFuncService&&t.aggFuncService.addAggFuncs(e)}function gy(t){t.aggFuncService&&t.aggFuncService.clear()}function yy(t,e,n){t.funcColsService.setColumnAggFunc(e,n,"api")}function vy(t){return t.columnModel.isPivotMode()}function _y(t,e,n){return t.pivotResultColsService.lookupPivotResultCol(e,n)}function Cy(t,e){t.funcColsService.setValueColumns(e,"api")}function wy(t){return t.funcColsService.getValueColumns()}function by(t,e){t.funcColsService.removeValueColumns([e],"api")}function xy(t,e){t.funcColsService.removeValueColumns(e,"api")}function ky(t,e){t.funcColsService.addValueColumns([e],"api")}function Sy(t,e){t.funcColsService.addValueColumns(e,"api")}function Ey(t,e){t.funcColsService.setRowGroupColumns(e,"api")}function Ty(t,e){t.funcColsService.removeRowGroupColumns([e],"api")}function By(t,e){t.funcColsService.removeRowGroupColumns(e,"api")}function Ay(t,e){t.funcColsService.addRowGroupColumns([e],"api")}function Py(t,e){t.funcColsService.addRowGroupColumns(e,"api")}function Vy(t,e,n){t.funcColsService.moveRowGroupColumn(e,n,"api")}function Ny(t){return t.funcColsService.getRowGroupColumns()}function Dy(t,e){t.funcColsService.setPivotColumns(e,"api")}function Fy(t,e){t.funcColsService.removePivotColumns([e],"api")}function Ry(t,e){t.funcColsService.removePivotColumns(e,"api")}function My(t,e){t.funcColsService.addPivotColumns([e],"api")}function Iy(t,e){t.funcColsService.addPivotColumns(e,"api")}function Ly(t){return t.funcColsService.getPivotColumns()}function Oy(t,e){t.pivotResultColsService.setPivotResultCols(e,"api")}function Gy(t){const e=t.pivotResultColsService.getPivotResultCols();return e?e.list:null}var zy=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,i=typeof n=="string";!i&&!(n===!0)||(this.showRowGroupCols.push(t),i?this.showRowGroupColsMap[n]=t:this.funcColsService.getRowGroupColumns().forEach(c=>{this.showRowGroupColsMap[c.getId()]=t}))})}getShowRowGroupCols(){return this.showRowGroupCols}getShowRowGroupCol(t){return this.showRowGroupColsMap[t]}},Ki="32.3.3",Wa=b._defineModule({version:Ki,moduleName:`${b.ModuleNames.RowGroupingModule}-core`,beans:[Hg,Qg,uy,py,hy,Lg,jg,zy,Xg],userComponents:[{name:"agGroupRowRenderer",classImp:Re.GroupCellRenderer},{name:"agGroupCellRenderer",classImp:Re.GroupCellRenderer}],controllers:[{name:"groupCellRendererCtrl",classImp:Re.GroupCellRendererCtrl}],dependantModules:[Re.EnterpriseCoreModule]}),Zy=b._defineModule({version:Ki,moduleName:`${b.ModuleNames.RowGroupingModule}-api`,apiFunctions:{addAggFunc:fy,addAggFuncs:my,clearAggFuncs:gy,setColumnAggFunc:yy,isPivotMode:vy,getPivotResultColumn:_y,setValueColumns:Cy,getValueColumns:wy,removeValueColumn:by,removeValueColumns:xy,addValueColumn:ky,addValueColumns:Sy,setRowGroupColumns:Ey,removeRowGroupColumn:Ty,removeRowGroupColumns:By,addRowGroupColumn:Ay,addRowGroupColumns:Py,getRowGroupColumns:Ny,moveRowGroupColumn:Vy,setPivotColumns:Dy,removePivotColumn:Fy,removePivotColumns:Ry,addPivotColumn:My,addPivotColumns:Iy,getPivotColumns:Ly,setPivotResultColumns:Oy,getPivotResultColumns:Gy},dependantModules:[Wa]}),Md=b._defineModule({version:Ki,moduleName:"@ag-grid-enterprise/group-filter",userComponents:[{name:"agGroupColumnFilter",classImp:ey}],dependantModules:[Wa,b._ColumnFilterModule]}),$y=b._defineModule({version:Ki,moduleName:"@ag-grid-enterprise/group-floating-filter",userComponents:[{name:"agGroupColumnFloatingFilter",classImp:ty}],dependantModules:[Md,b._FloatingFilterModule]}),Uy=b._defineModule({version:Ki,moduleName:b.ModuleNames.RowGroupingModule,dependantModules:[Wa,Zy,Md,$y]}),Id=class extends za{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()}},Ld=300,Wy=class extends b.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>`,[w.AgCheckboxSelector,w.AgInputTextFieldSelector]),this.eExpand=w.RefPlaceholder,this.eSelect=w.RefPlaceholder,this.eFilterTextField=w.RefPlaceholder}wireBeans(t){this.columnModel=t.columnModel}postConstruct(){this.createExpandIcons(),this.addManagedListeners(this.eExpand,{click:this.onExpandClicked.bind(this),keydown:e=>{e.key===w.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=w._createIconNoSpan("columnSelectOpen",this.gos)),this.eExpand.appendChild(this.eExpandUnchecked=w._createIconNoSpan("columnSelectClosed",this.gos)),this.eExpand.appendChild(this.eExpandIndeterminate=w._createIconNoSpan("columnSelectIndeterminate",this.gos)),this.setExpandState(0)}showOrHideOptions(){const t=!this.params.suppressColumnFilter,e=!this.params.suppressColumnSelectAll,n=!this.params.suppressColumnExpandAll,i=this.columnModel.isProvidedColGroupsPresent(),s=this.localeService.getLocaleTextFunc();this.eFilterTextField.setInputPlaceholder(s("searchOoo","Search...")),w._setDisplayed(this.eFilterTextField.getGui(),t),w._setDisplayed(this.eSelect.getGui(),e),w._setDisplayed(this.eExpand,n&&i)}onFilterTextChanged(){this.onFilterTextChangedDebounced||(this.onFilterTextChangedDebounced=w._debounce(()=>{const t=this.eFilterTextField.getValue();this.dispatchLocalEvent({type:"filterChanged",filterText:t})},Ld)),this.onFilterTextChangedDebounced()}onMiniFilterKeyDown(t){t.key===w.KeyCode.ENTER&&setTimeout(()=>this.onSelectClicked(),Ld)}onSelectClicked(){this.dispatchLocalEvent({type:this.selectState?"unselectAll":"selectAll"})}onExpandClicked(){this.dispatchLocalEvent({type:this.expandState===0?"collapseAll":"expandAll"})}setExpandState(t){this.expandState=t,w._setDisplayed(this.eExpandChecked,this.expandState===0),w._setDisplayed(this.eExpandUnchecked,this.expandState===1),w._setDisplayed(this.eExpandIndeterminate,this.expandState===2)}setSelectionState(t){this.selectState=t,this.eSelect.setValue(this.selectState)}},Wy={selector:"AG-PRIMARY-COLS-HEADER",component:Uy},Od=class{constructor(t,e,n,i=!1,s){this.localEventService=new w.LocalEventService,this.displayName=t,this.dept=n,this.group=i,i?(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)}},Gd=class extends w.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(),w.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){w.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 Re.AgMenuList),i=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:i("ariaLabelContextMenu","Context Menu"),closedCallback:d=>{d 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)),i=this.columns.some(s=>e.allowedFunction(s)&&e.activeFunction(s));n&&t.push({name:e.activateLabel(this.displayName),icon:w._createIconNoSpan(e.addIcon,this.gos,null),action:()=>e.activateFunction()}),i&&t.push({name:e.deactivateLabel(this.displayName),icon:w._createIconNoSpan(e.removeIcon,this.gos,null),action:()=>e.deActivateFunction()})}return t}},zd=class extends w.Component{constructor(t,e,n,i){super(),this.modelItem=t,this.allowDragging=e,this.eventType=n,this.focusWrapper=i,this.cbSelect=w.RefPlaceholder,this.eLabel=w.RefPlaceholder,this.eGroupOpenedIcon=w.RefPlaceholder,this.eGroupClosedIcon=w.RefPlaceholder,this.eColumnGroupIcons=w.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>`,[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,i=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&&i)}onFilterTextChanged(){this.onFilterTextChangedDebounced||(this.onFilterTextChangedDebounced=b._debounce(()=>{const t=this.eFilterTextField.getValue();this.dispatchLocalEvent({type:"filterChanged",filterText:t})},Ld)),this.onFilterTextChangedDebounced()}onMiniFilterKeyDown(t){t.key===b.KeyCode.ENTER&&setTimeout(()=>this.onSelectClicked(),Ld)}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)}},Hy={selector:"AG-PRIMARY-COLS-HEADER",component:Wy},Od=class{constructor(t,e,n,i=!1,s){this.localEventService=new b.LocalEventService,this.displayName=t,this.dept=n,this.group=i,i?(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)}},Gd=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 Re.AgMenuList),i=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:i("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)),i=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()}),i&&t.push({name:e.deactivateLabel(this.displayName),icon:b._createIconNoSpan(e.removeIcon,this.gos,null),action:()=>e.deActivateFunction()})}return t}},zd=class extends b.Component{constructor(t,e,n,i){super(),this.modelItem=t,this.allowDragging=e,this.eventType=n,this.focusWrapper=i,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">
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>`,[w.AgCheckboxSelector]),this.eDragHandle=w._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(),w._getToolPanelClassesFromColDef(this.columnGroup.getColGroupDef(),this.gos,null,this.columnGroup).forEach(i=>this.addOrRemoveCssClass(i,!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 i=()=>{const s=t.headerTooltip;this.setTooltip({newTooltipText:s,location:"columnToolPanelColumnGroup",shouldDisplayTooltip:n})};i(),this.addManagedEventListeners({newColumnsLoaded:i})}getTooltipParams(){const t=super.getTooltipParams();return t.location="columnToolPanelColumnGroup",t}handleKeyDown(t){switch(t.key){case w.KeyCode.LEFT:t.preventDefault(),this.modelItem.setExpanded(!1);break;case w.KeyCode.RIGHT:t.preventDefault(),this.modelItem.setExpanded(!0);break;case w.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 i=this.createBean(new Gd(e,t,this.focusWrapper));this.addDestroyFunc(()=>{i.isAlive()&&this.destroyBean(i)})}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){w._setDisplayed(this.eDragHandle,!1);return}let t=!this.gos.get("suppressDragLeaveHidesColumns");const e={type:w.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(i=>{const s=i.getId();e[s]=i.isVisible(),n[s]=this.modelItemUtils.createPivotState(i)}),{columns:t,visibleState:e,pivotState:n}}setupExpandContract(){this.eGroupClosedIcon.appendChild(w._createIcon("columnSelectClosed",this.gos,null)),this.eGroupOpenedIcon.appendChild(w._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 w.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(i=>{i.isPassesFilter()&&(i.isGroup()?e(i.getChildren()):t.push(i.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(),i=n===void 0?t("ariaIndeterminate","indeterminate"):n?t("ariaVisible","visible"):t("ariaHidden","hidden"),s=t("ariaToggleVisibility","Press SPACE to toggle visibility");w._setAriaLabel(this.focusWrapper,`${this.displayName} ${e}`),this.cbSelect.setInputAriaLabel(`${s} (${i})`),w._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,i=0;if(e.forEach(s=>{!t&&s.getColDef().lockVisible||(this.isColumnChecked(s,t)?n++:i++)}),!(n>0&&i>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(),i=t.isRowGroupActive(),s=t.isValueActive();return n||i||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();w._setDisplayed(this.eGroupClosedIcon,!t),w._setDisplayed(this.eGroupOpenedIcon,t)}refreshAriaExpanded(){w._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)}},Hy=class extends w.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 Re.VirtualListDragFeature(this.comp,this.virtualList,{dragSourceType:w.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 w.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 i=null,s=e.position==="top";if(n instanceof zd?(i=n.getColumns()[0],s=!0):n&&(i=n.getColumn()),!i)return;const l=this.getMoveTargetIndex({currentColumns:t,lastHoveredColumn:i,isBefore:s});l!=null&&this.columnMoveService.moveColumns(t,l,"toolPanelUi")}getMoveTargetIndex(t){const{currentColumns:e,lastHoveredColumn:n,isBefore:i}=t;if(!n||!e)return null;const s=this.columnModel.getCols().indexOf(n),l=i?s:s+1,d=this.getMoveDiff(e,l);return l-d}getMoveDiff(t,e){const n=this.columnModel.getCols();if(!t)return 0;const i=t[0],s=t.length;return n.indexOf(i)<e?s:0}},jy=class extends w.Component{constructor(t,e,n,i){super(),this.allowDragging=e,this.groupsExist=n,this.focusWrapper=i,this.eLabel=w.RefPlaceholder,this.cbSelect=w.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>`,[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(i=>this.addOrRemoveCssClass(i,!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 i=()=>{const s=t.headerTooltip;this.setTooltip({newTooltipText:s,location:"columnToolPanelColumnGroup",shouldDisplayTooltip:n})};i(),this.addManagedEventListeners({newColumnsLoaded:i})}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 i=this.createBean(new Gd(e,t,this.focusWrapper));this.addDestroyFunc(()=>{i.isAlive()&&this.destroyBean(i)})}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(i=>{const s=i.getId();e[s]=i.isVisible(),n[s]=this.modelItemUtils.createPivotState(i)}),{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(i=>{i.isPassesFilter()&&(i.isGroup()?e(i.getChildren()):t.push(i.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(),i=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} (${i})`),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,i=0;if(e.forEach(s=>{!t&&s.getColDef().lockVisible||(this.isColumnChecked(s,t)?n++:i++)}),!(n>0&&i>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(),i=t.isRowGroupActive(),s=t.isValueActive();return n||i||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)}},jy=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 Re.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 i=null,s=e.position==="top";if(n instanceof zd?(i=n.getColumns()[0],s=!0):n&&(i=n.getColumn()),!i)return;const l=this.getMoveTargetIndex({currentColumns:t,lastHoveredColumn:i,isBefore:s});l!=null&&this.columnMoveService.moveColumns(t,l,"toolPanelUi")}getMoveTargetIndex(t){const{currentColumns:e,lastHoveredColumn:n,isBefore:i}=t;if(!n||!e)return null;const s=this.columnModel.getCols().indexOf(n),l=i?s:s+1,c=this.getMoveDiff(e,l);return l-c}getMoveDiff(t,e){const n=this.columnModel.getCols();if(!t)return 0;const i=t[0],s=t.length;return n.indexOf(i)<e?s:0}},qy=class extends b.Component{constructor(t,e,n,i){super(),this.allowDragging=e,this.groupsExist=n,this.focusWrapper=i,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">
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>`,[w.AgCheckboxSelector]),this.eDragHandle=w._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=w._escapeString(this.displayName);this.eLabel.innerHTML=n;const i=this.columnDept;this.groupsExist&&this.addCssClass("ag-column-select-add-group-indent"),this.addCssClass(`ag-column-select-indent-${i}`),this.getGui().style.setProperty("--ag-indentation-level",String(i)),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(),w._getToolPanelClassesFromColDef(this.column.getColDef(),this.gos,this.column,null).forEach(d=>this.addOrRemoveCssClass(d,!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 i=this.column.getColDef().headerTooltip;this.setTooltip({newTooltipText:i,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 i=this.createBean(new Gd(e,t,this.focusWrapper));this.addDestroyFunc(()=>{i.isAlive()&&this.destroyBean(i)})}handleKeyDown(t){t.key===w.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"),i=t("ariaToggleVisibility","Press SPACE to toggle visibility");w._setAriaLabel(this.focusWrapper,`${this.displayName} ${e}`),this.cbSelect.setInputAriaLabel(`${i} (${n})`),w._setAriaDescribedBy(this.focusWrapper,this.cbSelect.getInputElement().id)}setupDragging(){if(!this.allowDragging){w._setDisplayed(this.eDragHandle,!1);return}let t=!this.gos.get("suppressDragLeaveHidesColumns");const e={type:w.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 i=this.column.isAnyFunctionActive();this.cbSelect.setValue(i)}else this.cbSelect.setValue(this.column.isVisible());let e=!0,n=!0;if(t){const i=this.gos.get("functionsReadOnly"),s=!this.column.isAnyFunctionAllowed();e=!i&&!s,n=e}else{const{enableRowGroup:i,enableValue:s,lockPosition:l,suppressMovable:d,lockVisible:u}=this.column.getColDef(),p=!!i||!!s,f=!!l||!!d;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){w._warnOnce("can not expand a column item that does not represent a column group header")}},qy=class{constructor(t){this.items=t}getRowCount(){return this.items.length}getRow(t){return this.items[t]}},Ky="ag-column-select-list",Yy=class extends w.Component{constructor(){super(`<div class="${Ky}" 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 i=this.fireSelectionChangedEvent.bind(this);this.addManagedEventListeners({columnPivotChanged:i,columnPivotModeChanged:i,columnRowGroupChanged:i,columnValueChanged:i,columnVisible:i,newColumnsLoaded:i}),this.expandGroupsByDefault=!this.params.contractColumnSelection,this.virtualList=this.createManagedBean(new Re.VirtualList({cssIdentifier:"column-select",ariaRole:"tree"})),this.appendChild(this.virtualList.getGui()),this.virtualList.setComponentCreator((s,l)=>(w._setAriaLevel(l,s.getDept()+1),this.createComponentFromItem(s,l))),this.columnModel.isReady()&&this.onColumnsChanged(),!this.params.suppressColumnMove&&this.createManagedBean(new Hy(this,this.virtualList))}createComponentFromItem(t,e){if(t.isGroup()){const i=new zd(t,this.allowDragging,this.eventType,e);return this.createBean(i),i}const n=new jy(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 i=n.getColumnGroup();if(i){const s=t[i.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=d=>{d.addEventListener("expandedChanged",e);const u=d.removeEventListener.bind(d,"expandedChanged",e);this.destroyColumnItemFuncs.push(u)},i=(d,u,p)=>{d.forEach(f=>{w.isProvidedColumnGroup(f)?s(f,u,p):l(f,u,p)})},s=(d,u,p)=>{const f=d.getColGroupDef();if(f&&f.suppressColumnsToolPanel)return;if(d.isPadding()){i(d.getChildren(),u,p);return}const v=this.columnNameService.getDisplayNameForProvidedColumnGroup(null,d,"columnToolPanel"),S=new Od(v,d,u,!0,this.expandGroupsByDefault);p.push(S),n(S),i(d.getChildren(),u+1,S.getChildren())},l=(d,u,p)=>{if(d.getColDef()&&d.getColDef().suppressColumnsToolPanel)return;const m=this.columnNameService.getDisplayNameForColumn(d,"columnToolPanel");p.push(new Od(m,d,u))};this.destroyColumnTree(),i(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 qy(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"),i=this.displayedColsList.length;w._setAriaLabel(this.virtualList.getAriaElement(),`${e} ${i} ${n}`)}focusRowIfAlive(t){window.setTimeout(()=>{this.isAlive()&&this.virtualList.focusRow(t)},0)}forEachItem(t){const e=n=>{n.forEach(i=>{t(i),i.isGroup()&&e(i.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 i=e.filter(s=>!w._includes(n,s));i.length>0&&w._warnOnce("unable to find group(s) for supplied groupIds:",i)}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(i=>{if(i.isGroup()||!i.isPassesFilter())return;const s=i.getColumn(),l=s.getColDef();let d;if(n){if(!s.isAllowPivot()&&!s.isAllowRowGroup()&&!s.isAllowValue())return;d=s.isValueActive()||s.isPivotActive()||s.isRowGroupActive()}else{if(l.lockVisible)return;d=s.isVisible()}d?t++:e++}),!(t>0&&e>0))return!(t===0||e>0)}setFilterText(t){this.filterText=w._exists(t)?t.toLowerCase():null,this.markFilteredColumns(),this.flattenAndFilterModel()}markFilteredColumns(){const t=n=>{if(!w._exists(this.filterText))return!0;const i=n.getDisplayName();return i==null||i.toLowerCase().indexOf(this.filterText)!==-1},e=(n,i)=>{let s=!1;if(n.isGroup()){const d=t(n);n.getChildren().forEach(u=>{const p=e(u,d||i);p&&(s=p)})}const l=i||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}},Jy={selector:"AG-PRIMARY-COLS-LIST",component:Yy},Xy=class extends w.Component{constructor(){super(`<div class="ag-column-select">
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 i=this.columnDept;this.groupsExist&&this.addCssClass("ag-column-select-add-group-indent"),this.addCssClass(`ag-column-select-indent-${i}`),this.getGui().style.setProperty("--ag-indentation-level",String(i)),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 i=this.column.getColDef().headerTooltip;this.setTooltip({newTooltipText:i,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 i=this.createBean(new Gd(e,t,this.focusWrapper));this.addDestroyFunc(()=>{i.isAlive()&&this.destroyBean(i)})}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"),i=t("ariaToggleVisibility","Press SPACE to toggle visibility");b._setAriaLabel(this.focusWrapper,`${this.displayName} ${e}`),this.cbSelect.setInputAriaLabel(`${i} (${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 i=this.column.isAnyFunctionActive();this.cbSelect.setValue(i)}else this.cbSelect.setValue(this.column.isVisible());let e=!0,n=!0;if(t){const i=this.gos.get("functionsReadOnly"),s=!this.column.isAnyFunctionAllowed();e=!i&&!s,n=e}else{const{enableRowGroup:i,enableValue:s,lockPosition:l,suppressMovable:c,lockVisible:u}=this.column.getColDef(),p=!!i||!!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")}},Ky=class{constructor(t){this.items=t}getRowCount(){return this.items.length}getRow(t){return this.items[t]}},Yy="ag-column-select-list",Jy=class extends b.Component{constructor(){super(`<div class="${Yy}" 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 i=this.fireSelectionChangedEvent.bind(this);this.addManagedEventListeners({columnPivotChanged:i,columnPivotModeChanged:i,columnRowGroupChanged:i,columnValueChanged:i,columnVisible:i,newColumnsLoaded:i}),this.expandGroupsByDefault=!this.params.contractColumnSelection,this.virtualList=this.createManagedBean(new Re.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 jy(this,this.virtualList))}createComponentFromItem(t,e){if(t.isGroup()){const i=new zd(t,this.allowDragging,this.eventType,e);return this.createBean(i),i}const n=new qy(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 i=n.getColumnGroup();if(i){const s=t[i.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)},i=(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()){i(c.getChildren(),u,p);return}const v=this.columnNameService.getDisplayNameForProvidedColumnGroup(null,c,"columnToolPanel"),k=new Od(v,c,u,!0,this.expandGroupsByDefault);p.push(k),n(k),i(c.getChildren(),u+1,k.getChildren())},l=(c,u,p)=>{if(c.getColDef()&&c.getColDef().suppressColumnsToolPanel)return;const m=this.columnNameService.getDisplayNameForColumn(c,"columnToolPanel");p.push(new Od(m,c,u))};this.destroyColumnTree(),i(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 Ky(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"),i=this.displayedColsList.length;b._setAriaLabel(this.virtualList.getAriaElement(),`${e} ${i} ${n}`)}focusRowIfAlive(t){window.setTimeout(()=>{this.isAlive()&&this.virtualList.focusRow(t)},0)}forEachItem(t){const e=n=>{n.forEach(i=>{t(i),i.isGroup()&&e(i.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 i=e.filter(s=>!b._includes(n,s));i.length>0&&b._warnOnce("unable to find group(s) for supplied groupIds:",i)}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(i=>{if(i.isGroup()||!i.isPassesFilter())return;const s=i.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 i=n.getDisplayName();return i==null||i.toLowerCase().indexOf(this.filterText)!==-1},e=(n,i)=>{let s=!1;if(n.isGroup()){const c=t(n);n.getChildren().forEach(u=>{const p=e(u,c||i);p&&(s=p)})}const l=i||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}},Xy={selector:"AG-PRIMARY-COLS-LIST",component:Jy},Qy=class extends b.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>`,[Wy,Jy]),this.primaryColsHeaderPanel=w.RefPlaceholder,this.primaryColsListPanel=w.RefPlaceholder}init(t,e,n){this.allowDragging=t,this.params=e,this.eventType=n,this.primaryColsHeaderPanel.init(this.params);const i=this.params.suppressColumnFilter,s=this.params.suppressColumnSelectAll;this.params.suppressColumnExpandAll&&i&&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 w.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()}},Zd=class extends w.Component{constructor(){super(...arguments),this.cbPivotMode=w.RefPlaceholder}wireBeans(t){this.columnModel=t.columnModel,this.ctrlsService=t.ctrlsService}createTemplate(){return`<div class="ag-pivot-mode-panel">
41
+ </div>`,[Hy,Xy]),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 i=this.params.suppressColumnFilter,s=this.params.suppressColumnSelectAll;this.params.suppressColumnExpandAll&&i&&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()}},Zd=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">
42
42
  <ag-toggle-button data-ref="cbPivotMode" class="ag-pivot-mode-select"></ag-toggle-button>
43
- </div>`}postConstruct(){this.setTemplate(this.createTemplate(),[w.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)}},Qy=class extends w.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 Zd),this.childDestroyFuncs.push(()=>this.destroyBean(this.pivotModePanel)),this.appendChild(this.pivotModePanel)),this.primaryColsPanel=this.createBean(new Xy),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 $a(!1)),this.childDestroyFuncs.push(()=>this.destroyBean(this.rowGroupDropZonePanel)),this.appendChild(this.rowGroupDropZonePanel)),this.params.suppressValues||(this.valuesDropZonePanel=this.createBean(new Id(!1)),this.childDestroyFuncs.push(()=>this.destroyBean(this.valuesDropZonePanel)),this.appendChild(this.valuesDropZonePanel)),this.params.suppressPivots||(this.pivotDropZonePanel=this.createBean(new Za(!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 Zd),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 $a(!1)),this.appendChild(this.rowGroupDropZonePanel)),this.setLastVisible())}setValuesSectionVisible(t){this.isRowGroupingModuleLoaded()&&(this.valuesDropZonePanel?this.valuesDropZonePanel.setDisplayed(t):t&&(this.valuesDropZonePanel=this.createManagedBean(new Id(!1)),this.appendChild(this.valuesDropZonePanel)),this.setLastVisible())}setPivotSectionVisible(t){this.isRowGroupingModuleLoaded()&&(this.pivotDropZonePanel?this.pivotDropZonePanel.setDisplayed(t):t&&(this.pivotDropZonePanel=this.createManagedBean(new Za(!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)"),i=w._last(n);i&&i.classList.add("ag-last-column-drop"),this.setResizers()}resetChildrenHeight(){const e=this.getGui().children;for(let n=0;n<e.length;n++){const i=e[n];i.style.removeProperty("height"),i.style.removeProperty("flex")}}isRowGroupingModuleLoaded(){return this.gos.assertModuleRegistered(w.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,w._clearElement(this.getGui())}refresh(t){return this.destroyChildren(),this.init(t),!0}getState(){return{expandedGroupIds:this.primaryColsPanel.getExpandedGroups()}}destroy(){this.destroyChildren(),super.destroy()}},ev=class extends w.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 i=this.extractAllLeafColumns(t);this.setAllColumns(i,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=i=>{i.forEach(s=>{s.isPassesFilter()&&(s.isGroup()?n(s.getChildren()):e.push(s.getColumn()))})};return n(t),e}setAllVisible(t,e,n){const i=[];t.forEach(s=>{s.getColDef().lockVisible||s.isVisible()!=e&&i.push({colId:s.getId(),hide:!e})}),i.length>0&&this.columnApplyStateService.applyColumnState({state:i},n)}setAllPivot(t,e,n){this.setAllPivotActive(t,e,n)}setAllPivotActive(t,e,n){const i=[],d=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);i.push({colId:u.getId(),aggFunc:f})}else u.isAllowRowGroup()?i.push({colId:u.getId(),rowGroup:!0}):u.isAllowPivot()&&i.push({colId:u.getId(),pivot:!0})}:u=>{(u.isPivotActive()||u.isRowGroupActive()||u.isValueActive())&&i.push({colId:u.getId(),pivot:!1,rowGroup:!1,aggFunc:null})};t.forEach(d),i.length>0&&this.columnApplyStateService.applyColumnState({state:i},n)}updateColumns(t){const{columns:e,visibleState:n,pivotState:i,eventType:s}=t,l=e.map(d=>{const u=d.getColId();if(this.columnModel.isPivotMode()){const p=i==null?void 0:i[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}}},tv="32.3.3",$d=w._defineModule({version:tv,moduleName:w.ModuleNames.ColumnsToolPanelModule,beans:[ev],userComponents:[{name:"agColumnsToolPanel",classImp:Qy},{name:"agMenuItem",classImp:Re.AgMenuItemRenderer}],dependantModules:[Re.EnterpriseCoreModule,$y,Ga]});function Ud(){w.ModuleRegistry.registerModules([Ko.ClientSideRowModelModule,$f.InfiniteRowModelModule,nd.ServerSideRowModelModule,Uf.CsvExportModule,rd.ClipboardModule,id.RangeSelectionModule,Wf.RichSelectModule,Hf.MenuModule,jf.ExcelExportModule,Ga,$d]);const t=hg("AGGRID_LICENSE");t?(Re.LicenseManager.setLicenseKey(t),console.log("AG Grid Activated")):console.log("AG Grid License not found")}const Wd=qf.themeQuartz.withParams({headerColumnResizeHandleColor:"transparent",accentColor:"#110529",borderColor:"#E1E3EB",cellHorizontalPaddingScale:1,checkboxBorderRadius:"3px",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"}),Hd=Symbol("sdk-vue");function Ha(){return r.inject(Hd)}function nv(t,e){let n;Ud();const i=()=>{t.loadBlockState().then(l=>{s.loaded=!0;const d=sm(l,t),u=e(d),p=Object.fromEntries(Object.entries(u.routes).map(([f,m])=>{const v=typeof m=="function"?m():m;return[f,r.markRaw(v)]}));n=Object.assign(d,{...u,getRoute(f){return p[f]}})}).catch(l=>{console.error("load initial state error",l),s.error=l})},s=r.reactive({loaded:!1,error:void 0,useApp(){return Yf(n,"App is not loaded")},install(l){l.provide(Hd,this),i()}});return s}var rv=Object.defineProperty,iv=(t,e,n)=>e in t?rv(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,ov=(t,e,n)=>iv(t,e+"",n);function jd(t,e){if(t==null)throw Error("Empty (null | undefined) value");return t}function sv(t,e,n){const i=Math.min(e,n),s=Math.max(e,n);return t>=i&&t<=s}function av(t){return new Promise(e=>setTimeout(e,t))}function lv(t){return t()}function as(t,e,n){return e>t?e:t>n?n:t}function qd(t,e){return e(t)}function Ar(t,e){if(t!=null)return e(t)}function cv(t){if(t&&t.ok)return t.value}async function dv(t){return Object.fromEntries(await Promise.all(Object.entries(t).map(async([e,n])=>[e,await n])))}const Kd=t=>t;function uv(t,e){return t=Math.ceil(t),e=Math.floor(e),Math.floor(Math.random()*(e-t))+t}function pv(t){let e="";for(let n=0;n<t;n++)e+=String.fromCharCode(uv(65,91));return e}function hv(){return pv(42)}function Yi(t){return t!==null&&typeof t=="object"}function fv(t,e){return Object.keys(t).map(n=>e(t[n],n))}function ja(t,e){return Yi(t)&&Yi(e)?Object.keys(t).length!==Object.keys(e).length?!1:Object.keys(t).every(n=>ja(t[n],e[n])):t===e}function Ji(t){if(Array.isArray(t)){const e=[];for(let n=0;n<t.length;n++)e[n]=Ji(t[n]);return e}else if(Yi(t)){const e={};return Object.keys(t).forEach(n=>{e[n]=Ji(t[n])}),e}else return t}function mv(t){return Array.isArray(t)?Object.assign([],t):Yi(t)?Object.assign({},t):t}function gv(t,e){const n={};for(const i in e)e[i]!==t[i]&&(n[i]=t[i]);return n}function yv(t,e,n){return Object.assign({},t,{[e]:n})}function vv(t){return Object.entries(t).forEach(([e,n])=>{n instanceof Function&&(t[e]=n.bind(t))}),t}function _v(t,e,n){return t[e]=n,t}function Cv(t,e){return t[e]}function wv(t,e){t={...t};const n=t[e];return delete t[e],[n,t]}function bv(t,...e){return Object.assign({},...e.map(n=>({[n]:t[n]})))}function xv(t,...e){return e.map(n=>t[n])}function kv(t,...e){const n=Object.assign({},t);return e.forEach(i=>delete n[i]),n}const qa=Object.freeze(Object.defineProperty({__proto__:null,bindMethods:vv,deepClone:Ji,deepEqual:ja,getProp:Cv,iSet:yv,isObject:Yi,map:fv,omit:kv,pick:bv,pickValues:xv,setProp:_v,shallowClone:mv,shallowDiff:gv,shiftProp:wv},Symbol.toStringTag,{value:"Module"}));function Sv(t,e){const n=t.findIndex(e);if(n<0)return[];const i=(()=>{for(let s=n;s<t.length;s++)if(!e(t[s],s))return s;return t.length})();return t.slice(n,i)}function Yd(t,e,n){let i;return function(...s){i&&clearTimeout(i),i=setTimeout(()=>{i=void 0,t.apply(this,s)},e)}}const Ev=["B","kB","MB","GB","TB","PB","EB","ZB","YB"],Tv=["B","kiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],Bv=["b","kbit","Mbit","Gbit","Tbit","Pbit","Ebit","Zbit","Ybit"],Av=["b","kibit","Mibit","Gibit","Tibit","Pibit","Eibit","Zibit","Yibit"],Jd=(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 Ka(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?Av:Bv:e.binary?Tv:Ev;if(e.signed&&t===0)return` 0 ${n[0]}`;const i=t<0,s=i?"-":e.signed?"+":"";if(i&&(t=-t),t<1){const p=Jd(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 d=Jd(Number(t),e.locale),u=n[l];return s+d+" "+u}const Pv={class:"context-menu"},Vv=["onClick"],Nv=r.defineComponent({__name:"Menu",props:{options:{}},emits:["close"],setup(t,{emit:e}){const n=e,i=s=>{s.cb(),n("close")};return(s,l)=>(r.openBlock(),r.createElementBlock("div",Pv,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(s.options,(d,u)=>(r.openBlock(),r.createElementBlock("div",{key:u,onClick:r.withModifiers(p=>i(d),["stop"])},[r.createElementVNode("span",null,r.toDisplayString(d.text),1)],8,Vv))),128))]))}}),nr=(t,e)=>{const n=t.__vccOpts||t;for(const[i,s]of e)n[i]=s;return n},Dv=nr(Nv,[["__scopeId","data-v-12530966"]]);function Ya(t,e){t.preventDefault();const n=()=>{r.render(null,document.body)},i=r.h(Dv,{options:e,onClose:()=>{n()}});r.render(i,document.body);const s=i.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 Xd=Symbol(),ls=()=>r.inject(Xd),Fv=["value"],Rv={key:1},Mv=r.defineComponent({__name:"BaseCellComponent",props:{modelValue:{},valueType:{},editable:{type:Boolean}},emits:["update:modelValue"],setup(t,{emit:e}){const n=e,i=t,s=r.reactive({edit:!1}),l=r.computed(()=>i.valueType),d=f=>{var m;let v=(m=f.target)==null?void 0:m.value;const S=r.unref(l),x=lv(()=>S==="integer"?parseInt(v,10):S==="float"?Number(v):v);n("update:modelValue",x),s.edit=!1},u=r.ref(),p=f=>{!f.metaKey&&i.editable&&(s.edit=!0,requestAnimationFrame(()=>{var m,v;(v=(m=u.value)==null?void 0:m.querySelector("input"))==null||v.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]=v=>s.edit=!1),onChange:d},null,40,Fv)):(r.openBlock(),r.createElementBlock("div",Rv,r.toDisplayString(f.modelValue),1))],2))}}),Iv=["^data-row-index"],Lv={key:0,class:"control-cell"},Ov=r.defineComponent({__name:"TdCell",props:{cell:{}},setup(t){const e=t,n=ls(),i=r.computed(()=>e.cell.column.valueType),s=f=>{Ar(n.settings.value.onUpdatedRow,m=>{const v=e.cell.row,S={...v.dataRow,[e.cell.id]:f};m({...v,dataRow:S})})},l=f=>{f.metaKey&&n.selectRow(e.cell.row.primaryKey)},d=(f,m)=>{if(f.type==="contextmenu")f.preventDefault();else return;const v=n.settings??{},S=[],{onSelectedRows:x,onSelectedColumns:F}=v.value,T=n.data.selectedRows.has(m.primaryKey);x&&x.length&&(T?S.push({text:"Deselect row",cb(){n.data.selectedRows.delete(e.cell.row.primaryKey)}}):S.push({text:"Select row",cb(){n.selectRow(e.cell.row.primaryKey)}})),F&&F.length&&(S.push({text:"Select column",cb(){n.selectColumn(e.cell.column.id)}}),S.push({text:"Unselect column",cb(){n.unselectColumn(e.cell.column.id)}})),S.length&&Ya(f,S)},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]=v=>d(v,f.cell.row))},[f.cell.control?(r.openBlock(),r.createElementBlock("div",Lv,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(Mv,{key:2,"model-value":f.cell.value,"value-type":i.value,editable:f.cell.column.editable,"onUpdate:modelValue":s},null,8,["model-value","value-type","editable"]))],42,Iv))}}),Gv={},zv={width:"48",height:"48",viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function Zv(t,e){return r.openBlock(),r.createElementBlock("svg",zv,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 $v=nr(Gv,[["render",Zv]]),Uv={class:"tr-head"},Wv=r.defineComponent({__name:"TrHead",setup(t){return(e,n)=>(r.openBlock(),r.createElementBlock("div",Uv,[r.renderSlot(e.$slots,"default")]))}});function Hv(t,e){const n=e.indexOf(t)+1;return e[n>=e.length?0:n]}function jv(t,e){const n=t.findIndex(e);if(n<0)return[];const i=(()=>{for(let s=n;s<t.length;s++)if(!e(t[s],s))return s;return t.length})();return t.slice(n,i)}const qv=["^data-col-id"],Kv=r.defineComponent({__name:"ThCell",props:{col:{}},emits:["delete:column","expand:column","change:sort"],setup(t,{emit:e}){const n=e;function i(l){l.preventDefault();const d=[];d.length&&Ya(l,d)}function s(l){var d;const u=((d=l.sort)==null?void 0:d.direction)??"DESC";n("change:sort",{colId:l.id,direction:Hv(u,["DESC","ASC"])})}return(l,d)=>(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:i},[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:d[0]||(d[0]=r.withModifiers(()=>s(l.col),["stop"]))},null,2)):r.createCommentVNode("",!0)],42,qv))}}),Yv=r.defineComponent({__name:"TrBody",props:{row:{}},setup(t){const e=r.ref(),n=()=>{r.nextTick().then(()=>{Ar(e.value,i=>i.scrollLeft=0)})};return(i,s)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"trRef",ref:e,class:r.normalizeClass(["tr-body",{selected:i.row.selected}]),scroll:"no",style:r.normalizeStyle(i.row.style),onScroll:n},[r.renderSlot(i.$slots,"default")],38))}}),Jv=r.defineComponent({__name:"ColumnCaret",props:{column:{}},setup(t){const e=ls(),n=t,i=r.computed(()=>e.data.selectedColumns.has(n.column.id));return(s,l)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["column-caret",{selected:i.value,frozen:s.column.frozen}])},null,2))}});function et(t,e,n,i){r.onMounted(()=>{var s;return(s=r.unref(t))==null?void 0:s.addEventListener(e,n,i)}),r.onUnmounted(()=>{var s;return(s=r.unref(t))==null?void 0:s.removeEventListener(e,n,i)})}function Xv(t){r.onMounted(()=>window.addEventListener("mouseup",t)),r.onUnmounted(()=>window.removeEventListener("mouseup",t))}function Qv(t){let e=!1;return function(...n){e?console.log("handle pressure"):(requestAnimationFrame(()=>{t(...n),e=!1}),e=!0)}}function e_(t,e){let n;function i(l){n={...l}}Xv(()=>{n=void 0,e()});const s=Qv(t);return et(window,"mousemove",l=>{n&&s({x:n.x,width:n.width,diff:l.x-n.x})}),{start:i}}const ti=1,t_=10,n_=30,Qd=60;function eu(){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 tu(t,e={}){const{delayEnter:n=0,delayLeave:i=0}=e,s=r.ref(!1);let l;const d=u=>{const p=u?n:i;l&&(clearTimeout(l),l=void 0),p?l=setTimeout(()=>s.value=u,p):s.value=u};return window&&(et(t,"mouseenter",()=>d(!0)),et(t,"mouseleave",()=>d(!1))),s}function r_(t){var e;const n=Ar((e=r.unref(t))==null?void 0:e.querySelectorAll(".th-cell"),i=>[...i])??[];return n.map(i=>{const{width:s,x:l}=i.getBoundingClientRect(),d=i.getAttribute("data-col-id");return Kd({colId:d,width:s,x:l,right:l+s})}).slice(0,n.length-1)}function i_(t,e){const n=eu(),i=tu(e,{}),{data:s}=t,l=e_(u=>{Ar(s.resizeTh,p=>{const f=s.columns.find(m=>m.id===p.colId);f&&(f.width=as(u.width+u.diff,n_,1e4),t.adjustWidth())})},()=>{s.resize=!1,s.resizeTh=void 0,document.body.style.cursor=""}),d=u=>{s.resizeTh&&(s.resize=!0,l.start({x:u.x,width:s.resizeTh.width}))};return r.watchEffect(()=>{if(!i.value){document.body.style.cursor="";return}if(s.resize)return;const u=r_(e).find(p=>Math.abs(n.x-p.right)<t_);u?(document.body.style.cursor="col-resize",s.resizeTh=u):(s.resizeTh=void 0,document.body.style.cursor="")}),{mouseDown:d}}const o_={key:0,class:"command-menu"},s_={key:0},a_=["onClick"],l_=r.defineComponent({__name:"RowsCommandMenu",setup(t){const e=ls(),n=r.computed(()=>e.getSelectedRows()),i=r.computed(()=>n.value.length>0),s=r.computed(()=>{var d;return((d=e.settings)==null?void 0:d.value.onSelectedRows)??[]}),l=r.computed(()=>s.value.map(d=>({label:d.label,cb:()=>{d.cb(n.value),e.data.selectedRows.clear(),e.data.rows=[]}})));return(d,u)=>i.value?(r.openBlock(),r.createElementBlock("div",o_,[n.value.length?(r.openBlock(),r.createElementBlock("span",s_,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,a_))),128))])):r.createCommentVNode("",!0)}}),c_={key:0,class:"command-menu"},d_={key:0},u_=["onClick"],p_=r.defineComponent({__name:"ColumnsCommandMenu",setup(t){const e=ls(),n=r.computed(()=>e.getSelectedColumns()),i=r.computed(()=>n.value.length>0),s=r.computed(()=>{var d;return((d=e.settings)==null?void 0:d.value.onSelectedColumns)??[]}),l=r.computed(()=>s.value.map(d=>({label:d.label,cb:()=>{d.cb(n.value),e.data.selectedColumns.clear()}})));return(d,u)=>i.value?(r.openBlock(),r.createElementBlock("div",c_,[n.value.length?(r.openBlock(),r.createElementBlock("span",d_,"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,u_))),128))])):r.createCommentVNode("",!0)}});function rr(t,e){const n={el:void 0,x:0,y:0},i=s=>({x:s.x,y:s.y,dx:s.x-n.x,dy:s.y-n.y});et(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)}),et(document,"mouseup",s=>{n.el&&(n.el=void 0,e({...i(s),stop:!0},n))}),et(document,"mousemove",s=>{n.el&&e(i(s),n)})}const h_=r.defineComponent({__name:"TScroll",props:{offset:{},windowSize:{},dataSize:{}},emits:["change:offset"],setup(t,{emit:e}){const n=e,i=t,s=r.ref(),l=r.computed(()=>i.windowSize-12),d=r.computed(()=>i.windowSize<i.dataSize),u=r.computed(()=>Math.ceil(i.offset*(l.value/i.dataSize))),p=r.computed(()=>Math.ceil(l.value*l.value/i.dataSize)),f=r.computed(()=>({top:`${u.value}px`,height:`${p.value}px`}));return rr(s,(m,v)=>{const S=(u.value+m.dy)*i.dataSize/l.value;n("change:offset",S),v.x=m.x,v.y=m.y}),(m,v)=>(r.openBlock(),r.createElementBlock("div",{class:"t-scroll",style:r.normalizeStyle({height:`${m.windowSize}px`})},[r.createElementVNode("div",null,[d.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 f_(t){return r.computed(()=>{const{data:e,settings:n}=t,{bodyWidth:i,scrollLeft:s}=e,l=[...e.columns],d=hv();n.value.controlColumn&&l.unshift({id:d,label:"#",width:60,frozen:!0});let u=0;const p=l.map(m=>{const v={...m,offset:u};return u+=m.width+ti,v}),f=p.filter(m=>m.frozen);return Sv(p,m=>m.frozen?!1:s<m.offset+m.width&&m.offset<i+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===d}))})}function m_(t,e){const n=r.computed(()=>e.value.reduce((i,s)=>(i[s.id]=s.justify?"justify-"+s.justify:"",i),{}));return r.computed(()=>t.rows.map(i=>{const s=n.value,{primaryKey:l,offset:d,dataRow:u,height:p}=i,f=e.value.map(m=>({id:m.id,column:m,row:i,value:u[m.id],class:s[m.id],editable:m.editable,width:m.width,style:m.style,control:m.control}));return Kd({style:{top:`${d-t.scrollTop}px`,height:`${i.height}px`},primaryKey:l,offset:d,height:p,cells:f,selected:t.selectedRows.has(l)})}))}const g_=async(t,e)=>{const{scrollTop:n,bodyHeight:i}=t;return await av(0),dv({rows:e.getRows(n,i),dataWindow:t})};function y_(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=Ji(m.columns),e.currentWindow=void 0,m.dataSource.getHeight().then(v=>{e.dataHeight=v,f.updateBodyHeight()}).catch(v=>e.error=v)},{immediate:!0});const n=r.computed(()=>t.settings),i=r.computed(()=>e.columns.reduce((m,v)=>m+v.width+ti,0)),s=r.computed(()=>qd(f.data.dataHeight-f.data.bodyHeight,m=>m>0?m:0)),l=r.computed(()=>qd(i.value-f.data.bodyWidth,m=>m>0?m:0)),d=r.computed(()=>({bodyHeight:e.bodyHeight,scrollTop:e.scrollTop,current:e.currentWindow})),u=f_({data:e,settings:n}),p=m_(e,u),f={data:e,settings:n,tableColumns:u,tableRows:p,adjustWidth:()=>{const m=e.columns.reduce((S,x)=>S+x.width+ti,0),v=e.bodyWidth+e.scrollLeft;if(m<v){const S=e.columns[e.columns.length-1];S.width=S.width+(v-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=as(m,0,s.value)},updateScrollLeft(m){e.scrollLeft=as(m,0,l.value)},updateBodyHeight(){const{height:m}=t.settings,{dataHeight:v}=e,S=m>v?v:m;e.bodyHeight=S},updateDimensions(m){this.updateBodyHeight(),f.data.bodyWidth=m.width,f.adjustWidth(),e.rows=[],e.currentWindow=void 0}};return r.watch(d,(m,v)=>{const S=m.current;(!S||m.scrollTop<S.scrollTop||m.scrollTop+m.bodyHeight>S.bodyHeight+S.scrollTop)&&(e.currentWindow={scrollTop:m.scrollTop-Qd,bodyHeight:m.bodyHeight+Qd*2},g_(Ji(e.currentWindow),n.value.dataSource).then(({rows:x,dataWindow:F})=>{ja(e.currentWindow,F)&&(e.rows=x)}))},{deep:!0,immediate:!0}),r.provide(Xd,f),f}const v_={class:"command-menu__container"},__={key:0,class:"table-body__no-data"},C_={class:"carets"},Ja=r.defineComponent({__name:"TableComponent",props:{settings:{}},emits:["update:data","change:sort"],setup(t,{emit:e}){const n=e,i=t,s=y_(i),l=r.computed(()=>s.data.rows.length===0),d=r.computed(()=>({height:l.value?"212px":s.data.bodyHeight+"px"}));r.watch(s.data,T=>n("update:data",T),{deep:!0}),r.watch(i,()=>m);const u=r.ref(),p=r.ref(),f=r.ref(),m=()=>{Ar(f.value,T=>{s.updateDimensions(T.getBoundingClientRect())})},v=s.tableColumns,S=s.tableRows,{mouseDown:x}=i_(s,u);r.onMounted(()=>{r.nextTick(m)}),r.watchPostEffect(()=>{r.unref(i.settings),r.nextTick(m)}),et(window,"resize",()=>r.nextTick(m));const F=T=>{T.preventDefault(),s.updateOffsets(T)};return(T,A)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"tableRef",ref:u,class:"data-table",onMousedown:A[2]||(A[2]=(...k)=>r.unref(x)&&r.unref(x)(...k))},[r.createElementVNode("div",v_,[r.createVNode(l_),A[3]||(A[3]=r.createTextVNode()),r.createVNode(p_)]),A[7]||(A[7]=r.createTextVNode()),r.createElementVNode("div",{ref_key:"headRef",ref:p,class:"table-head"},[r.createVNode(Wv,null,{default:r.withCtx(()=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(v),(k,D)=>(r.openBlock(),r.createBlock(Kv,{key:D,col:k,style:r.normalizeStyle(k.style),"onChange:sort":A[0]||(A[0]=$=>T.$emit("change:sort",$))},null,8,["col","style"]))),128))]),_:1})],512),A[8]||(A[8]=r.createTextVNode()),r.createElementVNode("div",{ref_key:"bodyRef",ref:f,class:"table-body",style:r.normalizeStyle(d.value),onWheel:F},[l.value?(r.openBlock(),r.createElementBlock("div",__,[r.createElementVNode("div",null,[r.createVNode($v),A[4]||(A[4]=r.createTextVNode()),A[5]||(A[5]=r.createElementVNode("div",null,"No Data To Show",-1))])])):r.createCommentVNode("",!0),A[6]||(A[6]=r.createTextVNode()),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(S),(k,D)=>(r.openBlock(),r.createBlock(Yv,{key:D,row:k},{default:r.withCtx(()=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(k.cells,$=>(r.openBlock(),r.createBlock(Ov,{key:$.column.id+":"+D,cell:$,style:r.normalizeStyle($.style)},null,8,["cell","style"]))),128))]),_:2},1032,["row"]))),128))],36),A[9]||(A[9]=r.createTextVNode()),r.createElementVNode("div",C_,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(v),(k,D)=>(r.openBlock(),r.createBlock(Jv,{key:D,column:k,style:r.normalizeStyle(k.style),"onChange:sort":A[1]||(A[1]=$=>T.$emit("change:sort",$))},null,8,["column","style"]))),128))]),A[10]||(A[10]=r.createTextVNode()),r.createVNode(h_,{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))}}),nu=new WeakMap;class w_{constructor(e,n,i){ov(this,"dataHeight"),this.datum=e,this.resolveHeight=n,this.resolvePrimaryKey=i;const s=e.reduce((d,u,p)=>(d.indices.set(p,d.total),d.total+=this.resolveHeight(u,p)+ti,d),{total:0,indices:new Map});this.dataHeight=s.total;const l=e.map((d,u)=>({dataRow:d,index:u,primaryKey:this.resolvePrimaryKey(d,u),offset:jd(s.indices.get(u)),height:this.resolveHeight(d,u)}));nu.set(this,l)}get rows(){return nu.get(this)}async getHeight(){return this.dataHeight}async getRows(e,n){return jv(this.rows,i=>{const s=i.offset;return e<s+i.height&&s<n+e})}}class b_{constructor(e,n,i){this.api=e,this.rowHeight=n,this.resolvePrimaryKey=i}get height(){return this.rowHeight+ti}async getHeight(){return await this.api.count()*this.height}async getRows(e,n){const i=as(Math.floor(e/this.height),0,Number.POSITIVE_INFINITY),s=Math.ceil(n+40/this.height);return(await this.api.query({offset:i,limit:s})).map((l,d)=>({dataRow:l,index:i+d,primaryKey:this.resolvePrimaryKey(l,i+d),offset:(i+d)*(this.rowHeight+ti),height:this.rowHeight}))}}function x_(t){return Object.freeze(t)}function k_(t){return r.h(Ja,{settings:Object.freeze(t)})}function Xa(t,e){const n=new w_(t,e.resolveRowHeight,e.resolvePrimaryKey);return{...e,dataSource:n}}function S_(t,e){return r.computed(()=>{const n=r.unref(t);return Xa(n,r.unref(e))})}function E_(t,e){const n=r.computed(()=>{const s=r.unref(t);return Xa(s,r.unref(e))}),i=r.reactive({settings:n});return r.computed(()=>r.h(Ja,i))}const T_=Object.freeze(Object.defineProperty({__proto__:null,AsyncData:b_,Component:Ja,factory:k_,rawDataSettings:Xa,settings:x_,useRawData:S_,useRawDataComponent:E_},Symbol.toStringTag,{value:"Module"}));function*B_(t,e){for(const n of t)yield e(n)}function A_(t){const e=[];for(const n of t)e.push(n);return e}function ru(t){return t()}function Qa(t,e){if(t==null)throw Error(e);return t}function el(t){let e=!1;return function(...n){e||(requestAnimationFrame(()=>{t(...n),e=!1}),e=!0)}}function iu(t){return new Promise(e=>setTimeout(e,t))}function ou(t,e){const n=setTimeout(t,e);return()=>{clearTimeout(n)}}function su(t,e){return t=Math.ceil(t),e=Math.floor(e),Math.floor(Math.random()*(e-t))+t}function P_(t){let e="";for(let n=0;n<t;n++)e+=String.fromCharCode(su(65,91));return e}function au(t){return function(e){return 1-t(1-e)}}function V_(t){return function(e){return e<.5?t(2*e)/2:(2-t(2*(1-e)))/2}}function lu(t){const{duration:e,draw:n,timing:i}=t,s=performance.now();let l=!1;return requestAnimationFrame(function d(u){let p=(u-s)/e;(p>1||l)&&(p=1);const f=i(p);n(f),p<1&&requestAnimationFrame(d)}),function(){l=!0}}function N_(t){const{getFraction:e,draw:n,timing:i}=t,s=performance.now();let l=!1;return requestAnimationFrame(function d(u){let p=e(u-s);if(l)return;p>1&&(p=1);const f=i(p);n(f),p<1&&requestAnimationFrame(d)}),function(){l=!0}}function cu(t,e){let n=-1;return(...i)=>{n!==-1&&(clearTimeout(n),n=-1),n=window.setTimeout(()=>t(...i),e)}}function du(t,e,n=!0){let i=0,s;return function(...l){s=()=>{t.apply(this,l),i=new Date().getTime()+e,s=null,n&&setTimeout(()=>{s&&s()},e)},new Date().getTime()>i&&s()}}function D_(t){return t.map(e=>({text:String(e),value:e}))}function Pr(t){return t.map(e=>({label:"label"in e?e.label:e.text,value:e.value,description:e.description}))}const tl=new Map;function F_(t){return tl.has(t)||tl.set(t,r.ref(localStorage.getItem(t))),Qa(tl.get(t),"...")}function R_(t,e){e==null?localStorage.removeItem(t):localStorage.setItem(t,e)}function uu(t){const e=F_(t);return r.watch(e,n=>R_(t,n)),e}const nl=new Set;window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",t=>{A_(B_(nl.values(),e=>e(t.matches?"dark":"light")))});const M_=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",pu=r.ref(M_),rl=uu("theme");function hu(t){const e=r.computed(()=>rl.value?rl.value:pu.value),n=s=>{pu.value=s,t&&t(s)};function i(){rl.value=e.value==="light"?"dark":(e.value,"light")}return r.watch(e,s=>{t&&t(r.unref(s))}),r.onMounted(()=>{nl.add(n)}),r.onUnmounted(()=>{nl.delete(n)}),[e,i]}const I_=r.defineComponent({__name:"ThemeSwitcher",setup(t){const[e,n]=hu();return(i,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))}}),L_={class:"pl-layout-component pl-block-page"},O_={key:0,class:"pl-block-page__title"},G_={class:"pl-block-page__title__append"},z_={key:1},Z_={class:"pl-block-page__body"},$_={name:"PlBlockPage"},U_=r.defineComponent({...$_,setup(t){const e=r.useSlots();return(n,i)=>(r.openBlock(),r.createElementBlock("div",L_,[r.unref(e).title?(r.openBlock(),r.createElementBlock("div",O_,[r.createElementVNode("h1",null,[r.renderSlot(n.$slots,"title")]),i[0]||(i[0]=r.createTextVNode()),r.createElementVNode("div",G_,[r.renderSlot(n.$slots,"append")])])):(r.openBlock(),r.createElementBlock("div",z_)),i[1]||(i[1]=r.createTextVNode()),r.createElementVNode("div",Z_,[r.renderSlot(n.$slots,"default")])]))}}),W_={name:"PlContainer"},H_=r.defineComponent({...W_,props:{width:{}},setup(t){const e=t,n=r.computed(()=>({width:e.width}));return(i,s)=>(r.openBlock(),r.createElementBlock("div",{class:"pl-container pl-layout-component",style:r.normalizeStyle(n.value)},[r.renderSlot(i.$slots,"default")],4))}}),j_={name:"PlRow"},q_=r.defineComponent({...j_,props:{wrap:{type:Boolean},alignCenter:{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))}}),K_={class:"pl-layout-component",style:{"flex-grow":"1"}},Y_={name:"PlSpacer"},fu=r.defineComponent({...Y_,setup(t){return(e,n)=>(r.openBlock(),r.createElementBlock("div",K_))}}),J_={name:"PlGrid"},X_=r.defineComponent({...J_,props:{columns:{}},setup(t){const e=t,n=r.computed(()=>({gridTemplateColumns:`repeat(${e.columns}, minmax(0, 1fr))`}));return(i,s)=>(r.openBlock(),r.createElementBlock("div",{class:"pl-layout-component pl-grid",style:r.normalizeStyle(n.value)},[r.renderSlot(i.$slots,"default")],4))}}),Q_={key:0,class:"pl-alert__icon"},eC={class:"pl-alert__main"},tC={key:0},nC={class:"pl-alert__main__text"},rC={name:"PlAlert"},iC=r.defineComponent({...rC,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,i)=>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",Q_,[r.createElementVNode("div",{class:r.normalizeClass(`icon-24 icon-${e[n.type]}`)},null,2)])):r.createCommentVNode("",!0),i[2]||(i[2]=r.createTextVNode()),r.createElementVNode("div",eC,[n.label?(r.openBlock(),r.createElementBlock("label",tC,r.toDisplayString(n.label),1)):r.createCommentVNode("",!0),i[1]||(i[1]=r.createTextVNode()),r.createElementVNode("div",nC,[r.renderSlot(n.$slots,"default")])]),i[3]||(i[3]=r.createTextVNode()),n.closeable?(r.openBlock(),r.createElementBlock("div",{key:1,class:"pl-alert__close-btn","aria-label":"Close alert",role:"button",onClick:i[0]||(i[0]=s=>n.$emit("update:modelValue",!1))})):r.createCommentVNode("",!0)],6)):r.createCommentVNode("",!0)}}),Xi=r.defineComponent({__name:"PlMaskIcon16",props:{name:{},size:{}},setup(t){const e=t,n=r.computed(()=>e.size==="large"?"--mask-size: 24px":""),i=r.computed(()=>`mask-16 mask-${e.name}`);return(s,l)=>(r.openBlock(),r.createElementBlock("i",{style:r.normalizeStyle(n.value),class:r.normalizeClass(i.value)},null,6))}});function mu(t){function e(n){const i=n.currentTarget,s=document.createElement("span"),l=Math.max(i.clientWidth,i.clientHeight),d=l/2;s.style.width=s.style.height=`${l}px`,s.style.left=`${n.clientX-i.offsetLeft-d}px`,s.style.top=`${n.clientY-i.offsetTop-d}px`,s.classList.add("ripple");const u=i.getElementsByClassName("ripple")[0];u&&u.remove(),i.appendChild(s)}r.onMounted(()=>{var n;(n=t.value)==null||n.addEventListener("click",e)})}const oC={key:0},sC={inheritAttrs:!1},cs=r.defineComponent({...sC,__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(),i=r.computed(()=>e.small||e.size==="small"),s=r.computed(()=>e.large||e.size==="large");return mu(n),(l,d)=>(r.openBlock(),r.createElementBlock("button",r.mergeProps({ref_key:"btn",ref:n,tabindex:"0",class:{loading:l.loading,small:i.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",oC,[r.renderSlot(l.$slots,"default")])),d[0]||(d[0]=r.createTextVNode()),l.loading?(r.openBlock(),r.createBlock(r.unref(Xi),{key:1,name:"loading",size:l.size},null,8,["size"])):l.icon?(r.openBlock(),r.createBlock(r.unref(Xi),{key:2,name:l.icon,size:l.size},null,8,["name","size"])):r.createCommentVNode("",!0)],16))}}),aC={name:"PlBtnPrimary"},il=r.defineComponent({...aC,props:{loading:{type:Boolean},size:{},round:{type:Boolean},icon:{},reverse:{type:Boolean},justifyCenter:{type:Boolean}},setup(t){const e=t;return(n,i)=>(r.openBlock(),r.createBlock(cs,r.mergeProps({class:"pl-btn-primary"},e),{default:r.withCtx(()=>[r.renderSlot(n.$slots,"default")]),_:3},16))}}),lC={name:"PlBtnAccent"},cC=r.defineComponent({...lC,props:{loading:{type:Boolean},size:{},round:{type:Boolean},icon:{},reverse:{type:Boolean},justifyCenter:{type:Boolean}},setup(t){const e=t;return(n,i)=>(r.openBlock(),r.createBlock(cs,r.mergeProps({class:"pl-btn-accent"},e),{default:r.withCtx(()=>[r.renderSlot(n.$slots,"default")]),_:3},16))}}),dC={name:"PlBtnDanger"},uC=r.defineComponent({...dC,props:{loading:{type:Boolean},size:{},round:{type:Boolean},icon:{},reverse:{type:Boolean},justifyCenter:{type:Boolean}},setup(t){const e=t;return(n,i)=>(r.openBlock(),r.createBlock(cs,r.mergeProps({class:"pl-btn-danger"},e),{default:r.withCtx(()=>[r.renderSlot(n.$slots,"default")]),_:3},16))}}),pC={name:"PlBtnSecondary"},ol=r.defineComponent({...pC,props:{loading:{type:Boolean},size:{},round:{type:Boolean},icon:{},reverse:{type:Boolean},justifyCenter:{type:Boolean}},setup(t){const e=t;return(n,i)=>(r.openBlock(),r.createBlock(cs,r.mergeProps(e,{class:"pl-btn-secondary"}),{default:r.withCtx(()=>[r.renderSlot(n.$slots,"default")]),_:3},16))}}),hC={key:0},fC={name:"PlBtnGhost"},sl=r.defineComponent({...fC,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"),i=r.computed(()=>e.size==="large"),s=r.ref(),l=r.useSlots();return mu(s),(d,u)=>(r.openBlock(),r.createElementBlock("button",r.mergeProps({ref_key:"btnRef",ref:s,tabindex:"0",class:["pl-btn-ghost",{loading:d.loading,small:n.value,large:i.value,round:d.round,reverse:d.reverse,justifyCenter:d.justifyCenter,[d.$attrs.class+""]:!0}]},{...d.$attrs,disabled:!!d.$attrs.disabled||d.loading}),[r.unref(l).default&&!d.round?(r.openBlock(),r.createElementBlock("span",hC,[r.renderSlot(d.$slots,"default")])):r.createCommentVNode("",!0),u[0]||(u[0]=r.createTextVNode()),d.loading?(r.openBlock(),r.createBlock(r.unref(Xi),{key:1,name:"loading",size:d.size},null,8,["size"])):d.icon?(r.openBlock(),r.createBlock(r.unref(Xi),{key:2,name:d.icon,size:d.size},null,8,["name","size"])):r.createCommentVNode("",!0),u[1]||(u[1]=r.createTextVNode()),r.renderSlot(d.$slots,"append")],16))}}),mC=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(i,s)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["ui-btn-link",{disabled:i.disabled,loading:i.loading,hover:n.value}]),onMouseover:s[0]||(s[0]=l=>n.value=!0),onMouseleave:s[1]||(s[1]=l=>n.value=!1)},[r.createVNode(ol,r.mergeProps({round:"",hover:n.value},e),null,16,["hover"]),s[2]||(s[2]=r.createTextVNode()),r.renderSlot(i.$slots,"default")],34))}});function Qi(t,e){const n=el(()=>{if(t.value){const{scrollTop:i,scrollLeft:s,scrollHeight:l,scrollWidth:d,clientHeight:u,clientWidth:p}=document.documentElement,f=t.value.getBoundingClientRect();e({scrollTop:i,scrollLeft:s,scrollHeight:l,scrollWidth:d,clientHeight:u,clientWidth:p,offsetY:i+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),et(window,"scroll",n,{capture:!0,passive:!0}),et(window,"resize",n,{passive:!0}),et(window,"adjust",n,!0)}function gC(t,e){const n=r.ref();return Qi(t,i=>{n.value=i}),r.computed(()=>{const i=r.unref(n),s=r.unref(e),l=s.position??"top",d=s.gap??8;if(!i)return"";const u=i.offsetY+Math.floor(i.height/2),p=i.offsetX+Math.floor(i.width/2);return l==="top-left"?`left: ${i.offsetX}px; top: ${i.offsetY-d}px;`:l==="top"?`left: ${p}px; top: ${i.offsetY-d}px;`:l==="right"?`left: ${i.offsetX+i.width+d}px; top: ${u}px;`:l==="left"?`right: ${i.scrollWidth-i.x+d}px; top: ${u}px;`:""})}function eo(t,e){return e(t)}function it(t,e){if(t!=null)return e(t)}function yC(t){return Array.isArray(t)?t:[t]}function vC(t,e,...n){n.forEach(i=>{t[i]=e[i]})}function ds(t,e){et(document,"click",n=>{document.contains(n.target)&&(yC(t).map(i=>i.value).filter(i=>!!i).some(i=>i==null?void 0:i.contains(n.target))||e())})}const _C={},CC={class:"beak",width:"5",height:"9",viewBox:"0 0 3 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function wC(t,e){return r.openBlock(),r.createElementBlock("svg",CC,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 bC=nr(_C,[["render",wC]]),al=new Map,xC={name:"PlTooltip"},Tt=r.defineComponent({...xC,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,i=Symbol(),s=t,l=r.reactive({open:!1,over:!1,tooltipOpen:!1,key:Symbol()});al.set(i,()=>f()),r.watch(()=>l.open,T=>{requestAnimationFrame(()=>{l.tooltipOpen=T})});let d=()=>{};const u=du(()=>window.dispatchEvent(new CustomEvent("adjust")),1e3),p=()=>{l.open=!0;for(let[T,A]of al.entries())T!==i&&A()},f=()=>{l.open=!1,n("tooltip:close")},m=async()=>{s.hide||(u(),l.over=!0,d(),await iu(100),l.over&&p())},v=()=>{l.over=!1,d=ou(()=>{l.over||f()},s.closeDelay)};r.watch(()=>s.hide,T=>{T&&f()});const S=r.ref(),x=r.ref(),F=gC(S,r.toRef(s));return ds([S,x],()=>f()),r.onUnmounted(()=>{al.delete(i)}),(T,A)=>(r.openBlock(),r.createBlock(r.resolveDynamicComponent(T.element),r.mergeProps(T.$attrs,{ref_key:"rootRef",ref:S,onClick:m,onMouseover:m,onMouseleave:v}),{default:r.withCtx(()=>[r.renderSlot(T.$slots,"default"),A[1]||(A[1]=r.createTextVNode()),T.$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(F))},[r.createElementVNode("div",{ref_key:"tooltip",ref:x,class:r.normalizeClass(["pl-tooltip",T.position]),onMouseover:m,onMouseleave:v},[r.createElementVNode("div",null,[r.renderSlot(T.$slots,"tooltip")]),A[0]||(A[0]=r.createTextVNode()),r.createVNode(bC)],34)],4)):r.createCommentVNode("",!0)]),_:3})])):r.createCommentVNode("",!0)]),_:3},16))}}),kC={},SC={class:"inner-border"};function EC(t,e,n,i,s,l){return r.openBlock(),r.createElementBlock("div",SC,[r.renderSlot(t.$slots,"default")])}const TC=nr(kC,[["render",EC]]),BC={key:0},AC=["tabindex","onKeydown","onClick"],PC={key:1,class:"ui-btn-group__helper"},VC={key:2,class:"ui-btn-group__error"},NC={name:"PlBtnGroup"},DC=r.defineComponent({...NC,props:{modelValue:{},label:{},options:{},disabled:{type:Boolean},helper:{},error:{}},emits:["update:modelValue"],setup(t,{emit:e}){const n=r.useSlots(),i=e,s=u=>i("update:modelValue",u),l=t,d=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(["ui-btn-group",{disabled:u.disabled}])},[u.label?(r.openBlock(),r.createElementBlock("label",BC,[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(Tt),{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(TC,{class:"ui-btn-group__container"},{default:r.withCtx(()=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(d.value,(f,m)=>(r.openBlock(),r.createElementBlock("div",{key:m,class:r.normalizeClass(["ui-btn-group__option text-s",{active:u.modelValue===f.value}]),tabindex:u.modelValue===f.value||u.disabled?void 0:0,onKeydown:r.withKeys(v=>s(f.value),["enter"]),onClick:v=>s(f.value)},r.toDisplayString(f.label),43,AC))),128))]),_:1}),p[2]||(p[2]=r.createTextVNode()),u.helper?(r.openBlock(),r.createElementBlock("div",PC,r.toDisplayString(u.helper),1)):u.error?(r.openBlock(),r.createElementBlock("div",VC,r.toDisplayString(u.error),1)):r.createCommentVNode("",!0)],2))}}),FC={inheritAttrs:!1},RC={class:"double-contour"};function MC(t,e,n,i,s,l){return r.openBlock(),r.createElementBlock("div",RC,[r.createElementVNode("div",r.normalizeProps(r.guardReactiveProps(t.$attrs)),[r.renderSlot(t.$slots,"default")],16)])}const ir=nr(FC,[["render",MC]]);function gu(t){r.onMounted(t),r.onUpdated(t)}const ll=new WeakMap,cl=new ResizeObserver(t=>{for(const e of t)it(ll.get(e.target),n=>n(e))});function yu(t,e){ll.set(t,e),cl.unobserve(t),cl.observe(t)}function vu(t){cl.unobserve(t),ll.delete(t)}const IC=8,_u=4;function Rn(t,e="label"){const n=new Set;gu(()=>{it(t==null?void 0:t.value,i=>{const s=i.querySelector(e);s&&(n.add(s),yu(s,()=>{const l=ru(()=>s.getBoundingClientRect().width+eo(IC,d=>Number.isNaN(d)?_u:d+_u));i.style.getPropertyValue("--label-offset-right-x")!==`${l}px`&&i.style.setProperty("--label-offset-right-x",`${l}px`)}))})}),r.onBeforeUnmount(()=>{Array.from(n.values()).map(i=>vu(i))})}function LC(t,e){const n=[];return e&&e.length>0&&e.forEach(i=>{const s=i(t);typeof s=="string"&&n.push(s)}),{isValid:n.length===0,errors:n}}function Cu(t,e){return r.computed(()=>LC(t.value,e))}const OC=r.defineComponent({__name:"PlIcon16",props:{name:{},size:{}},setup(t){const e=t,n=r.computed(()=>e.size==="large"?"--icon-size: 24px":""),i=r.computed(()=>`icon-16 icon-${e.name}`);return(s,l)=>(r.openBlock(),r.createElementBlock("i",{style:r.normalizeStyle(n.value),class:r.normalizeClass([i.value,s.$style.icon])},null,6))}}),GC="_icon_1ugxm_2",zC={icon:GC},ZC={$style:zC},us=nr(OC,[["__cssModules",ZC]]),$C=r.defineComponent({__name:"PlIcon24",props:{name:{},size:{}},setup(t){const e=t,n=r.computed(()=>`icon-24 icon-${e.name}`);return(i,s)=>(r.openBlock(),r.createElementBlock("i",{class:r.normalizeClass([n.value,i.$style.icon])},null,2))}}),UC="_icon_1ugxm_2",WC={icon:UC},HC={$style:WC},wu=nr($C,[["__cssModules",HC]]),jC={class:"pl-text-field__envelope"},qC={key:0,ref:"label"},KC={key:0,class:"required-icon"},YC={key:1,class:"pl-text-field__prefix"},JC=["disabled","placeholder","type"],XC={class:"pl-text-field__append"},QC={key:0,class:"pl-text-field__error"},e0={key:1,class:"pl-text-field__helper"},t0={name:"PlTextField"},bu=r.defineComponent({...t0,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"),i=t,s=r.ref(void 0),l=r.ref(),d=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(z){if(u.cached=void 0,i.parse)try{n.value=i.parse(z)}catch(L){u.cached={error:L instanceof Error?L.message:String(L),value:z}}else n.value=z}}),f=r.computed(()=>i.type&&i.type==="password"?d.value?"text":i.type:"text"),m=r.computed(()=>d.value?"view-show":"view-hide"),v=()=>{i.clearable&&(u.cached=void 0,n.value=i.clearable===!0?"":i.clearable())},S=Cu(p,i.rules||[]),x=r.computed(()=>i.clearable?i.clearable===!0?n.value==="":n.value===i.clearable():n.value===""),F=r.computed(()=>!x.value),T=r.computed(()=>{const z=[];return i.error&&z.push(i.error),u.cached&&z.push(u.cached.error),S.value.isValid||z.push(...S.value.errors),z}),A=r.computed(()=>T.value.length>0),k=r.computed(()=>i.clearable&&F.value&&i.type!=="password"),D=()=>d.value=!d.value,$=()=>{u.cached=void 0};return Rn(s),(z,L)=>(r.openBlock(),r.createElementBlock("div",jC,[r.createElementVNode("div",{ref_key:"rootRef",ref:s,class:r.normalizeClass(["pl-text-field",{error:A.value,disabled:z.disabled,dashed:z.dashed,nonEmpty:F.value}])},[z.label?(r.openBlock(),r.createElementBlock("label",qC,[z.required?(r.openBlock(),r.createElementBlock("i",KC)):r.createCommentVNode("",!0),L[1]||(L[1]=r.createTextVNode()),r.createElementVNode("span",null,r.toDisplayString(z.label),1),L[2]||(L[2]=r.createTextVNode()),r.unref(e).tooltip?(r.openBlock(),r.createBlock(r.unref(Tt),{key:1,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.renderSlot(z.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)],512)):r.createCommentVNode("",!0),L[5]||(L[5]=r.createTextVNode()),z.prefix?(r.openBlock(),r.createElementBlock("div",YC,r.toDisplayString(z.prefix),1)):r.createCommentVNode("",!0),L[6]||(L[6]=r.createTextVNode()),r.withDirectives(r.createElementVNode("input",{ref_key:"inputRef",ref:l,"onUpdate:modelValue":L[0]||(L[0]=X=>p.value=X),disabled:z.disabled,placeholder:z.placeholder||"...",type:f.value,spellcheck:"false",onFocusout:$},null,40,JC),[[r.vModelDynamic,p.value]]),L[7]||(L[7]=r.createTextVNode()),r.createElementVNode("div",XC,[k.value?(r.openBlock(),r.createBlock(r.unref(us),{key:0,name:"delete-clear",onClick:v})):r.createCommentVNode("",!0),L[3]||(L[3]=r.createTextVNode()),z.type==="password"?(r.openBlock(),r.createBlock(r.unref(wu),{key:1,name:m.value,style:{cursor:"pointer"},onClick:D},null,8,["name"])):r.createCommentVNode("",!0),L[4]||(L[4]=r.createTextVNode()),r.renderSlot(z.$slots,"append")]),L[8]||(L[8]=r.createTextVNode()),r.createVNode(ir,{class:"pl-text-field__contour"})],2),L[9]||(L[9]=r.createTextVNode()),A.value?(r.openBlock(),r.createElementBlock("div",QC,r.toDisplayString(T.value.join(" ")),1)):z.helper?(r.openBlock(),r.createElementBlock("div",e0,r.toDisplayString(z.helper),1)):r.createCommentVNode("",!0)]))}}),n0={class:"ui-text-area__envelope"},r0={key:0,ref:"label"},i0={key:0,class:"required-icon"},o0=["readonly","rows","disabled","placeholder"],s0={class:"ui-text-area__append"},a0={key:0,class:"ui-text-area__error"},l0={key:1,class:"ui-text-area__helper"},c0={name:"PlTextArea"},d0=r.defineComponent({...c0,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(),i=e,s=t,l=r.ref(),d=r.ref(),u=r.computed({get(){return s.modelValue??""},set(x){i("update:modelValue",x)}}),p=r.computed(()=>!!s.modelValue),f=Cu(u,s.rules||[]);Rn(l);const m=r.computed(()=>{const x=[];return s.error&&x.push(s.error),x.push(...f.value.errors),x}),v=r.computed(()=>m.value.length>0),S=()=>{if(!s.autogrow)return;const x=d.value;x&&(x.style.height="auto",x.style.height=`${x.scrollHeight}px`)};return r.onMounted(()=>{S()}),(x,F)=>(r.openBlock(),r.createElementBlock("div",n0,[r.createElementVNode("div",{ref_key:"root",ref:l,class:r.normalizeClass(["ui-text-area",{error:v.value,disabled:x.disabled,dashed:x.dashed,nonEmpty:p.value}])},[x.label?(r.openBlock(),r.createElementBlock("label",r0,[x.required?(r.openBlock(),r.createElementBlock("i",i0)):r.createCommentVNode("",!0),F[1]||(F[1]=r.createTextVNode()),r.createElementVNode("span",null,r.toDisplayString(x.label),1),F[2]||(F[2]=r.createTextVNode()),r.unref(n).tooltip?(r.openBlock(),r.createBlock(r.unref(Tt),{key:1,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.renderSlot(x.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)],512)):r.createCommentVNode("",!0),F[3]||(F[3]=r.createTextVNode()),r.withDirectives(r.createElementVNode("textarea",{ref_key:"input",ref:d,"onUpdate:modelValue":F[0]||(F[0]=T=>u.value=T),readonly:x.readonly,rows:x.rows,disabled:x.disabled,placeholder:x.placeholder??"...",spellcheck:"false",onInput:S},null,40,o0),[[r.vModelText,u.value]]),F[4]||(F[4]=r.createTextVNode()),r.createElementVNode("div",s0,[r.renderSlot(x.$slots,"append")]),F[5]||(F[5]=r.createTextVNode()),r.createVNode(ir,{class:"ui-text-area__contour"})],2),F[6]||(F[6]=r.createTextVNode()),v.value?(r.openBlock(),r.createElementBlock("div",a0,r.toDisplayString(m.value.join(" ")),1)):x.helper?(r.openBlock(),r.createElementBlock("div",l0,r.toDisplayString(x.helper),1)):r.createCommentVNode("",!0)]))}});function xu(t,e){const n=t.scrollTop,i=t.getBoundingClientRect().height,s=e.offsetTop,l=e.getBoundingClientRect().height;return s+l<i+n&&s>n}function ku(t,e){const n=t.scrollTop,i=t.getBoundingClientRect().height,s=e.offsetTop,l=e.getBoundingClientRect().height;return s+l<i+n?"ceil":s>n?"floor":"visible"}function to(t,e,n={}){const i=t.scrollTop,s=t.getBoundingClientRect().height,l=e.getBoundingClientRect().height,d=e.offsetTop,u=ku(t,e);if(u==="visible")return;const p=f=>{const m=u==="floor"?d-(s-l):d;t.scrollTop=i+f*(m-i)};xu(t,e)||lu({duration:n.duration||100,timing:au(f=>f),draw:p})}function dl(t,e,n,i){return t.addEventListener(e,n,i),function(){t.removeEventListener(e,n)}}function u0(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 Su(t){return t!==null&&typeof t=="object"}function Bt(t,e){return Su(t)&&Su(e)?Object.keys(t).length!==Object.keys(e).length?!1:Object.keys(t).every(n=>Bt(t[n],e[n])):t===e}function ul(t,e){return t.some(n=>Bt(n,e))}const p0=`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
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)}},ev=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 Zd),this.childDestroyFuncs.push(()=>this.destroyBean(this.pivotModePanel)),this.appendChild(this.pivotModePanel)),this.primaryColsPanel=this.createBean(new Qy),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 $a(!1)),this.childDestroyFuncs.push(()=>this.destroyBean(this.rowGroupDropZonePanel)),this.appendChild(this.rowGroupDropZonePanel)),this.params.suppressValues||(this.valuesDropZonePanel=this.createBean(new Id(!1)),this.childDestroyFuncs.push(()=>this.destroyBean(this.valuesDropZonePanel)),this.appendChild(this.valuesDropZonePanel)),this.params.suppressPivots||(this.pivotDropZonePanel=this.createBean(new Za(!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 Zd),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 $a(!1)),this.appendChild(this.rowGroupDropZonePanel)),this.setLastVisible())}setValuesSectionVisible(t){this.isRowGroupingModuleLoaded()&&(this.valuesDropZonePanel?this.valuesDropZonePanel.setDisplayed(t):t&&(this.valuesDropZonePanel=this.createManagedBean(new Id(!1)),this.appendChild(this.valuesDropZonePanel)),this.setLastVisible())}setPivotSectionVisible(t){this.isRowGroupingModuleLoaded()&&(this.pivotDropZonePanel?this.pivotDropZonePanel.setDisplayed(t):t&&(this.pivotDropZonePanel=this.createManagedBean(new Za(!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)"),i=b._last(n);i&&i.classList.add("ag-last-column-drop"),this.setResizers()}resetChildrenHeight(){const e=this.getGui().children;for(let n=0;n<e.length;n++){const i=e[n];i.style.removeProperty("height"),i.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()}},tv=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 i=this.extractAllLeafColumns(t);this.setAllColumns(i,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=i=>{i.forEach(s=>{s.isPassesFilter()&&(s.isGroup()?n(s.getChildren()):e.push(s.getColumn()))})};return n(t),e}setAllVisible(t,e,n){const i=[];t.forEach(s=>{s.getColDef().lockVisible||s.isVisible()!=e&&i.push({colId:s.getId(),hide:!e})}),i.length>0&&this.columnApplyStateService.applyColumnState({state:i},n)}setAllPivot(t,e,n){this.setAllPivotActive(t,e,n)}setAllPivotActive(t,e,n){const i=[],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);i.push({colId:u.getId(),aggFunc:f})}else u.isAllowRowGroup()?i.push({colId:u.getId(),rowGroup:!0}):u.isAllowPivot()&&i.push({colId:u.getId(),pivot:!0})}:u=>{(u.isPivotActive()||u.isRowGroupActive()||u.isValueActive())&&i.push({colId:u.getId(),pivot:!1,rowGroup:!1,aggFunc:null})};t.forEach(c),i.length>0&&this.columnApplyStateService.applyColumnState({state:i},n)}updateColumns(t){const{columns:e,visibleState:n,pivotState:i,eventType:s}=t,l=e.map(c=>{const u=c.getColId();if(this.columnModel.isPivotMode()){const p=i==null?void 0:i[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}}},nv="32.3.3",$d=b._defineModule({version:nv,moduleName:b.ModuleNames.ColumnsToolPanelModule,beans:[tv],userComponents:[{name:"agColumnsToolPanel",classImp:ev},{name:"agMenuItem",classImp:Re.AgMenuItemRenderer}],dependantModules:[Re.EnterpriseCoreModule,Uy,Ga]});function Ud(){b.ModuleRegistry.registerModules([Ko.ClientSideRowModelModule,$f.InfiniteRowModelModule,nd.ServerSideRowModelModule,Uf.CsvExportModule,rd.ClipboardModule,id.RangeSelectionModule,Wf.RichSelectModule,Hf.MenuModule,jf.ExcelExportModule,Ga,$d]);const t=fg("AGGRID_LICENSE");t?(Re.LicenseManager.setLicenseKey(t),console.log("AG Grid Activated")):console.log("AG Grid License not found")}const Wd=qf.themeQuartz.withParams({headerColumnResizeHandleColor:"transparent",accentColor:"#110529",borderColor:"#E1E3EB",cellHorizontalPaddingScale:1,checkboxBorderRadius:"3px",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"}),Hd=Symbol("sdk-vue");function Ha(){return r.inject(Hd)}function rv(t,e){let n;Ud();const i=()=>{t.loadBlockState().then(l=>{s.loaded=!0;const c=sm(l,t),u=e(c),p=Object.fromEntries(Object.entries(u.routes).map(([f,m])=>{const v=typeof m=="function"?m():m;return[f,r.markRaw(v)]}));n=Object.assign(c,{...u,getRoute(f){return p[f]}})}).catch(l=>{console.error("load initial state error",l),s.error=l})},s=r.reactive({loaded:!1,error:void 0,useApp(){return Yf(n,"App is not loaded")},install(l){l.provide(Hd,this),i()}});return s}var iv=Object.defineProperty,ov=(t,e,n)=>e in t?iv(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,sv=(t,e,n)=>ov(t,e+"",n);function jd(t,e){if(t==null)throw Error("Empty (null | undefined) value");return t}function av(t,e,n){const i=Math.min(e,n),s=Math.max(e,n);return t>=i&&t<=s}function lv(t){return new Promise(e=>setTimeout(e,t))}function cv(t){return t()}function as(t,e,n){return e>t?e:t>n?n:t}function qd(t,e){return e(t)}function Ar(t,e){if(t!=null)return e(t)}function dv(t){if(t&&t.ok)return t.value}async function uv(t){return Object.fromEntries(await Promise.all(Object.entries(t).map(async([e,n])=>[e,await n])))}const Kd=t=>t;function pv(t,e){return t=Math.ceil(t),e=Math.floor(e),Math.floor(Math.random()*(e-t))+t}function hv(t){let e="";for(let n=0;n<t;n++)e+=String.fromCharCode(pv(65,91));return e}function fv(){return hv(42)}function Yi(t){return t!==null&&typeof t=="object"}function mv(t,e){return Object.keys(t).map(n=>e(t[n],n))}function ja(t,e){return Yi(t)&&Yi(e)?Object.keys(t).length!==Object.keys(e).length?!1:Object.keys(t).every(n=>ja(t[n],e[n])):t===e}function Ji(t){if(Array.isArray(t)){const e=[];for(let n=0;n<t.length;n++)e[n]=Ji(t[n]);return e}else if(Yi(t)){const e={};return Object.keys(t).forEach(n=>{e[n]=Ji(t[n])}),e}else return t}function gv(t){return Array.isArray(t)?Object.assign([],t):Yi(t)?Object.assign({},t):t}function yv(t,e){const n={};for(const i in e)e[i]!==t[i]&&(n[i]=t[i]);return n}function vv(t,e,n){return Object.assign({},t,{[e]:n})}function _v(t){return Object.entries(t).forEach(([e,n])=>{n instanceof Function&&(t[e]=n.bind(t))}),t}function Cv(t,e,n){return t[e]=n,t}function wv(t,e){return t[e]}function bv(t,e){t={...t};const n=t[e];return delete t[e],[n,t]}function xv(t,...e){return Object.assign({},...e.map(n=>({[n]:t[n]})))}function kv(t,...e){return e.map(n=>t[n])}function Sv(t,...e){const n=Object.assign({},t);return e.forEach(i=>delete n[i]),n}const qa=Object.freeze(Object.defineProperty({__proto__:null,bindMethods:_v,deepClone:Ji,deepEqual:ja,getProp:wv,iSet:vv,isObject:Yi,map:mv,omit:Sv,pick:xv,pickValues:kv,setProp:Cv,shallowClone:gv,shallowDiff:yv,shiftProp:bv},Symbol.toStringTag,{value:"Module"}));function Ev(t,e){const n=t.findIndex(e);if(n<0)return[];const i=(()=>{for(let s=n;s<t.length;s++)if(!e(t[s],s))return s;return t.length})();return t.slice(n,i)}function Yd(t,e,n){let i;return function(...s){i&&clearTimeout(i),i=setTimeout(()=>{i=void 0,t.apply(this,s)},e)}}const Tv=["B","kB","MB","GB","TB","PB","EB","ZB","YB"],Bv=["B","kiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],Av=["b","kbit","Mbit","Gbit","Tbit","Pbit","Ebit","Zbit","Ybit"],Pv=["b","kibit","Mibit","Gibit","Tibit","Pibit","Eibit","Zibit","Yibit"],Jd=(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 Ka(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?Pv:Av:e.binary?Bv:Tv;if(e.signed&&t===0)return` 0 ${n[0]}`;const i=t<0,s=i?"-":e.signed?"+":"";if(i&&(t=-t),t<1){const p=Jd(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=Jd(Number(t),e.locale),u=n[l];return s+c+" "+u}const Vv={class:"context-menu"},Nv=["onClick"],Dv=r.defineComponent({__name:"Menu",props:{options:{}},emits:["close"],setup(t,{emit:e}){const n=e,i=s=>{s.cb(),n("close")};return(s,l)=>(r.openBlock(),r.createElementBlock("div",Vv,[(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=>i(c),["stop"])},[r.createElementVNode("span",null,r.toDisplayString(c.text),1)],8,Nv))),128))]))}}),nr=(t,e)=>{const n=t.__vccOpts||t;for(const[i,s]of e)n[i]=s;return n},Fv=nr(Dv,[["__scopeId","data-v-12530966"]]);function Ya(t,e){t.preventDefault();const n=()=>{r.render(null,document.body)},i=r.h(Fv,{options:e,onClose:()=>{n()}});r.render(i,document.body);const s=i.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 Xd=Symbol(),ls=()=>r.inject(Xd),Rv=["value"],Mv={key:1},Iv=r.defineComponent({__name:"BaseCellComponent",props:{modelValue:{},valueType:{},editable:{type:Boolean}},emits:["update:modelValue"],setup(t,{emit:e}){const n=e,i=t,s=r.reactive({edit:!1}),l=r.computed(()=>i.valueType),c=f=>{var m;let v=(m=f.target)==null?void 0:m.value;const k=r.unref(l),S=cv(()=>k==="integer"?parseInt(v,10):k==="float"?Number(v):v);n("update:modelValue",S),s.edit=!1},u=r.ref(),p=f=>{!f.metaKey&&i.editable&&(s.edit=!0,requestAnimationFrame(()=>{var m,v;(v=(m=u.value)==null?void 0:m.querySelector("input"))==null||v.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]=v=>s.edit=!1),onChange:c},null,40,Rv)):(r.openBlock(),r.createElementBlock("div",Mv,r.toDisplayString(f.modelValue),1))],2))}}),Lv=["^data-row-index"],Ov={key:0,class:"control-cell"},Gv=r.defineComponent({__name:"TdCell",props:{cell:{}},setup(t){const e=t,n=ls(),i=r.computed(()=>e.cell.column.valueType),s=f=>{Ar(n.settings.value.onUpdatedRow,m=>{const v=e.cell.row,k={...v.dataRow,[e.cell.id]:f};m({...v,dataRow:k})})},l=f=>{f.metaKey&&n.selectRow(e.cell.row.primaryKey)},c=(f,m)=>{if(f.type==="contextmenu")f.preventDefault();else return;const v=n.settings??{},k=[],{onSelectedRows:S,onSelectedColumns:F}=v.value,T=n.data.selectedRows.has(m.primaryKey);S&&S.length&&(T?k.push({text:"Deselect row",cb(){n.data.selectedRows.delete(e.cell.row.primaryKey)}}):k.push({text:"Select row",cb(){n.selectRow(e.cell.row.primaryKey)}})),F&&F.length&&(k.push({text:"Select column",cb(){n.selectColumn(e.cell.column.id)}}),k.push({text:"Unselect column",cb(){n.unselectColumn(e.cell.column.id)}})),k.length&&Ya(f,k)},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]=v=>c(v,f.cell.row))},[f.cell.control?(r.openBlock(),r.createElementBlock("div",Ov,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(Iv,{key:2,"model-value":f.cell.value,"value-type":i.value,editable:f.cell.column.editable,"onUpdate:modelValue":s},null,8,["model-value","value-type","editable"]))],42,Lv))}}),zv={},Zv={width:"48",height:"48",viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function $v(t,e){return r.openBlock(),r.createElementBlock("svg",Zv,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 Uv=nr(zv,[["render",$v]]),Wv={class:"tr-head"},Hv=r.defineComponent({__name:"TrHead",setup(t){return(e,n)=>(r.openBlock(),r.createElementBlock("div",Wv,[r.renderSlot(e.$slots,"default")]))}});function jv(t,e){const n=e.indexOf(t)+1;return e[n>=e.length?0:n]}function qv(t,e){const n=t.findIndex(e);if(n<0)return[];const i=(()=>{for(let s=n;s<t.length;s++)if(!e(t[s],s))return s;return t.length})();return t.slice(n,i)}const Kv=["^data-col-id"],Yv=r.defineComponent({__name:"ThCell",props:{col:{}},emits:["delete:column","expand:column","change:sort"],setup(t,{emit:e}){const n=e;function i(l){l.preventDefault();const c=[];c.length&&Ya(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:jv(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:i},[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,Kv))}}),Jv=r.defineComponent({__name:"TrBody",props:{row:{}},setup(t){const e=r.ref(),n=()=>{r.nextTick().then(()=>{Ar(e.value,i=>i.scrollLeft=0)})};return(i,s)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"trRef",ref:e,class:r.normalizeClass(["tr-body",{selected:i.row.selected}]),scroll:"no",style:r.normalizeStyle(i.row.style),onScroll:n},[r.renderSlot(i.$slots,"default")],38))}}),Xv=r.defineComponent({__name:"ColumnCaret",props:{column:{}},setup(t){const e=ls(),n=t,i=r.computed(()=>e.data.selectedColumns.has(n.column.id));return(s,l)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["column-caret",{selected:i.value,frozen:s.column.frozen}])},null,2))}});function et(t,e,n,i){r.onMounted(()=>{var s;return(s=r.unref(t))==null?void 0:s.addEventListener(e,n,i)}),r.onUnmounted(()=>{var s;return(s=r.unref(t))==null?void 0:s.removeEventListener(e,n,i)})}function Qv(t){r.onMounted(()=>window.addEventListener("mouseup",t)),r.onUnmounted(()=>window.removeEventListener("mouseup",t))}function e_(t){let e=!1;return function(...n){e?console.log("handle pressure"):(requestAnimationFrame(()=>{t(...n),e=!1}),e=!0)}}function t_(t,e){let n;function i(l){n={...l}}Qv(()=>{n=void 0,e()});const s=e_(t);return et(window,"mousemove",l=>{n&&s({x:n.x,width:n.width,diff:l.x-n.x})}),{start:i}}const ti=1,n_=10,r_=30,Qd=60;function eu(){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 tu(t,e={}){const{delayEnter:n=0,delayLeave:i=0}=e,s=r.ref(!1);let l;const c=u=>{const p=u?n:i;l&&(clearTimeout(l),l=void 0),p?l=setTimeout(()=>s.value=u,p):s.value=u};return window&&(et(t,"mouseenter",()=>c(!0)),et(t,"mouseleave",()=>c(!1))),s}function i_(t){var e;const n=Ar((e=r.unref(t))==null?void 0:e.querySelectorAll(".th-cell"),i=>[...i])??[];return n.map(i=>{const{width:s,x:l}=i.getBoundingClientRect(),c=i.getAttribute("data-col-id");return Kd({colId:c,width:s,x:l,right:l+s})}).slice(0,n.length-1)}function o_(t,e){const n=eu(),i=tu(e,{}),{data:s}=t,l=t_(u=>{Ar(s.resizeTh,p=>{const f=s.columns.find(m=>m.id===p.colId);f&&(f.width=as(u.width+u.diff,r_,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(!i.value){document.body.style.cursor="";return}if(s.resize)return;const u=i_(e).find(p=>Math.abs(n.x-p.right)<n_);u?(document.body.style.cursor="col-resize",s.resizeTh=u):(s.resizeTh=void 0,document.body.style.cursor="")}),{mouseDown:c}}const s_={key:0,class:"command-menu"},a_={key:0},l_=["onClick"],c_=r.defineComponent({__name:"RowsCommandMenu",setup(t){const e=ls(),n=r.computed(()=>e.getSelectedRows()),i=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)=>i.value?(r.openBlock(),r.createElementBlock("div",s_,[n.value.length?(r.openBlock(),r.createElementBlock("span",a_,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,l_))),128))])):r.createCommentVNode("",!0)}}),d_={key:0,class:"command-menu"},u_={key:0},p_=["onClick"],h_=r.defineComponent({__name:"ColumnsCommandMenu",setup(t){const e=ls(),n=r.computed(()=>e.getSelectedColumns()),i=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)=>i.value?(r.openBlock(),r.createElementBlock("div",d_,[n.value.length?(r.openBlock(),r.createElementBlock("span",u_,"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,p_))),128))])):r.createCommentVNode("",!0)}});function rr(t,e){const n={el:void 0,x:0,y:0},i=s=>({x:s.x,y:s.y,dx:s.x-n.x,dy:s.y-n.y});et(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)}),et(document,"mouseup",s=>{n.el&&(n.el=void 0,e({...i(s),stop:!0},n))}),et(document,"mousemove",s=>{n.el&&e(i(s),n)})}const f_=r.defineComponent({__name:"TScroll",props:{offset:{},windowSize:{},dataSize:{}},emits:["change:offset"],setup(t,{emit:e}){const n=e,i=t,s=r.ref(),l=r.computed(()=>i.windowSize-12),c=r.computed(()=>i.windowSize<i.dataSize),u=r.computed(()=>Math.ceil(i.offset*(l.value/i.dataSize))),p=r.computed(()=>Math.ceil(l.value*l.value/i.dataSize)),f=r.computed(()=>({top:`${u.value}px`,height:`${p.value}px`}));return rr(s,(m,v)=>{const k=(u.value+m.dy)*i.dataSize/l.value;n("change:offset",k),v.x=m.x,v.y=m.y}),(m,v)=>(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 m_(t){return r.computed(()=>{const{data:e,settings:n}=t,{bodyWidth:i,scrollLeft:s}=e,l=[...e.columns],c=fv();n.value.controlColumn&&l.unshift({id:c,label:"#",width:60,frozen:!0});let u=0;const p=l.map(m=>{const v={...m,offset:u};return u+=m.width+ti,v}),f=p.filter(m=>m.frozen);return Ev(p,m=>m.frozen?!1:s<m.offset+m.width&&m.offset<i+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 g_(t,e){const n=r.computed(()=>e.value.reduce((i,s)=>(i[s.id]=s.justify?"justify-"+s.justify:"",i),{}));return r.computed(()=>t.rows.map(i=>{const s=n.value,{primaryKey:l,offset:c,dataRow:u,height:p}=i,f=e.value.map(m=>({id:m.id,column:m,row:i,value:u[m.id],class:s[m.id],editable:m.editable,width:m.width,style:m.style,control:m.control}));return Kd({style:{top:`${c-t.scrollTop}px`,height:`${i.height}px`},primaryKey:l,offset:c,height:p,cells:f,selected:t.selectedRows.has(l)})}))}const y_=async(t,e)=>{const{scrollTop:n,bodyHeight:i}=t;return await lv(0),uv({rows:e.getRows(n,i),dataWindow:t})};function v_(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=Ji(m.columns),e.currentWindow=void 0,m.dataSource.getHeight().then(v=>{e.dataHeight=v,f.updateBodyHeight()}).catch(v=>e.error=v)},{immediate:!0});const n=r.computed(()=>t.settings),i=r.computed(()=>e.columns.reduce((m,v)=>m+v.width+ti,0)),s=r.computed(()=>qd(f.data.dataHeight-f.data.bodyHeight,m=>m>0?m:0)),l=r.computed(()=>qd(i.value-f.data.bodyWidth,m=>m>0?m:0)),c=r.computed(()=>({bodyHeight:e.bodyHeight,scrollTop:e.scrollTop,current:e.currentWindow})),u=m_({data:e,settings:n}),p=g_(e,u),f={data:e,settings:n,tableColumns:u,tableRows:p,adjustWidth:()=>{const m=e.columns.reduce((k,S)=>k+S.width+ti,0),v=e.bodyWidth+e.scrollLeft;if(m<v){const k=e.columns[e.columns.length-1];k.width=k.width+(v-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=as(m,0,s.value)},updateScrollLeft(m){e.scrollLeft=as(m,0,l.value)},updateBodyHeight(){const{height:m}=t.settings,{dataHeight:v}=e,k=m>v?v:m;e.bodyHeight=k},updateDimensions(m){this.updateBodyHeight(),f.data.bodyWidth=m.width,f.adjustWidth(),e.rows=[],e.currentWindow=void 0}};return r.watch(c,(m,v)=>{const k=m.current;(!k||m.scrollTop<k.scrollTop||m.scrollTop+m.bodyHeight>k.bodyHeight+k.scrollTop)&&(e.currentWindow={scrollTop:m.scrollTop-Qd,bodyHeight:m.bodyHeight+Qd*2},y_(Ji(e.currentWindow),n.value.dataSource).then(({rows:S,dataWindow:F})=>{ja(e.currentWindow,F)&&(e.rows=S)}))},{deep:!0,immediate:!0}),r.provide(Xd,f),f}const __={class:"command-menu__container"},C_={key:0,class:"table-body__no-data"},w_={class:"carets"},Ja=r.defineComponent({__name:"TableComponent",props:{settings:{}},emits:["update:data","change:sort"],setup(t,{emit:e}){const n=e,i=t,s=v_(i),l=r.computed(()=>s.data.rows.length===0),c=r.computed(()=>({height:l.value?"212px":s.data.bodyHeight+"px"}));r.watch(s.data,T=>n("update:data",T),{deep:!0}),r.watch(i,()=>m);const u=r.ref(),p=r.ref(),f=r.ref(),m=()=>{Ar(f.value,T=>{s.updateDimensions(T.getBoundingClientRect())})},v=s.tableColumns,k=s.tableRows,{mouseDown:S}=o_(s,u);r.onMounted(()=>{r.nextTick(m)}),r.watchPostEffect(()=>{r.unref(i.settings),r.nextTick(m)}),et(window,"resize",()=>r.nextTick(m));const F=T=>{T.preventDefault(),s.updateOffsets(T)};return(T,N)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"tableRef",ref:u,class:"data-table",onMousedown:N[2]||(N[2]=(...C)=>r.unref(S)&&r.unref(S)(...C))},[r.createElementVNode("div",__,[r.createVNode(c_),N[3]||(N[3]=r.createTextVNode()),r.createVNode(h_)]),N[7]||(N[7]=r.createTextVNode()),r.createElementVNode("div",{ref_key:"headRef",ref:p,class:"table-head"},[r.createVNode(Hv,null,{default:r.withCtx(()=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(v),(C,I)=>(r.openBlock(),r.createBlock(Yv,{key:I,col:C,style:r.normalizeStyle(C.style),"onChange:sort":N[0]||(N[0]=Q=>T.$emit("change:sort",Q))},null,8,["col","style"]))),128))]),_:1})],512),N[8]||(N[8]=r.createTextVNode()),r.createElementVNode("div",{ref_key:"bodyRef",ref:f,class:"table-body",style:r.normalizeStyle(c.value),onWheel:F},[l.value?(r.openBlock(),r.createElementBlock("div",C_,[r.createElementVNode("div",null,[r.createVNode(Uv),N[4]||(N[4]=r.createTextVNode()),N[5]||(N[5]=r.createElementVNode("div",null,"No Data To Show",-1))])])):r.createCommentVNode("",!0),N[6]||(N[6]=r.createTextVNode()),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(k),(C,I)=>(r.openBlock(),r.createBlock(Jv,{key:I,row:C},{default:r.withCtx(()=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(C.cells,Q=>(r.openBlock(),r.createBlock(Gv,{key:Q.column.id+":"+I,cell:Q,style:r.normalizeStyle(Q.style)},null,8,["cell","style"]))),128))]),_:2},1032,["row"]))),128))],36),N[9]||(N[9]=r.createTextVNode()),r.createElementVNode("div",w_,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(v),(C,I)=>(r.openBlock(),r.createBlock(Xv,{key:I,column:C,style:r.normalizeStyle(C.style),"onChange:sort":N[1]||(N[1]=Q=>T.$emit("change:sort",Q))},null,8,["column","style"]))),128))]),N[10]||(N[10]=r.createTextVNode()),r.createVNode(f_,{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))}}),nu=new WeakMap;class b_{constructor(e,n,i){sv(this,"dataHeight"),this.datum=e,this.resolveHeight=n,this.resolvePrimaryKey=i;const s=e.reduce((c,u,p)=>(c.indices.set(p,c.total),c.total+=this.resolveHeight(u,p)+ti,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:jd(s.indices.get(u)),height:this.resolveHeight(c,u)}));nu.set(this,l)}get rows(){return nu.get(this)}async getHeight(){return this.dataHeight}async getRows(e,n){return qv(this.rows,i=>{const s=i.offset;return e<s+i.height&&s<n+e})}}class x_{constructor(e,n,i){this.api=e,this.rowHeight=n,this.resolvePrimaryKey=i}get height(){return this.rowHeight+ti}async getHeight(){return await this.api.count()*this.height}async getRows(e,n){const i=as(Math.floor(e/this.height),0,Number.POSITIVE_INFINITY),s=Math.ceil(n+40/this.height);return(await this.api.query({offset:i,limit:s})).map((l,c)=>({dataRow:l,index:i+c,primaryKey:this.resolvePrimaryKey(l,i+c),offset:(i+c)*(this.rowHeight+ti),height:this.rowHeight}))}}function k_(t){return Object.freeze(t)}function S_(t){return r.h(Ja,{settings:Object.freeze(t)})}function Xa(t,e){const n=new b_(t,e.resolveRowHeight,e.resolvePrimaryKey);return{...e,dataSource:n}}function E_(t,e){return r.computed(()=>{const n=r.unref(t);return Xa(n,r.unref(e))})}function T_(t,e){const n=r.computed(()=>{const s=r.unref(t);return Xa(s,r.unref(e))}),i=r.reactive({settings:n});return r.computed(()=>r.h(Ja,i))}const B_=Object.freeze(Object.defineProperty({__proto__:null,AsyncData:x_,Component:Ja,factory:S_,rawDataSettings:Xa,settings:k_,useRawData:E_,useRawDataComponent:T_},Symbol.toStringTag,{value:"Module"}));function*A_(t,e){for(const n of t)yield e(n)}function P_(t){const e=[];for(const n of t)e.push(n);return e}function ru(t){return t()}function Qa(t,e){if(t==null)throw Error(e);return t}function el(t){let e=!1;return function(...n){e||(requestAnimationFrame(()=>{t(...n),e=!1}),e=!0)}}function iu(t){return new Promise(e=>setTimeout(e,t))}function ou(t,e){const n=setTimeout(t,e);return()=>{clearTimeout(n)}}function su(t,e){return t=Math.ceil(t),e=Math.floor(e),Math.floor(Math.random()*(e-t))+t}function V_(t){let e="";for(let n=0;n<t;n++)e+=String.fromCharCode(su(65,91));return e}function au(t){return function(e){return 1-t(1-e)}}function N_(t){return function(e){return e<.5?t(2*e)/2:(2-t(2*(1-e)))/2}}function lu(t){const{duration:e,draw:n,timing:i}=t,s=performance.now();let l=!1;return requestAnimationFrame(function c(u){let p=(u-s)/e;(p>1||l)&&(p=1);const f=i(p);n(f),p<1&&requestAnimationFrame(c)}),function(){l=!0}}function D_(t){const{getFraction:e,draw:n,timing:i}=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=i(p);n(f),p<1&&requestAnimationFrame(c)}),function(){l=!0}}function cu(t,e){let n=-1;return(...i)=>{n!==-1&&(clearTimeout(n),n=-1),n=window.setTimeout(()=>t(...i),e)}}function du(t,e,n=!0){let i=0,s;return function(...l){s=()=>{t.apply(this,l),i=new Date().getTime()+e,s=null,n&&setTimeout(()=>{s&&s()},e)},new Date().getTime()>i&&s()}}function F_(t){return t.map(e=>({text:String(e),value:e}))}function Pr(t){return t.map(e=>({label:"label"in e?e.label:e.text,value:e.value,description:e.description}))}const tl=new Map;function R_(t){return tl.has(t)||tl.set(t,r.ref(localStorage.getItem(t))),Qa(tl.get(t),"...")}function M_(t,e){e==null?localStorage.removeItem(t):localStorage.setItem(t,e)}function uu(t){const e=R_(t);return r.watch(e,n=>M_(t,n)),e}const nl=new Set;window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",t=>{P_(A_(nl.values(),e=>e(t.matches?"dark":"light")))});const I_=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",pu=r.ref(I_),rl=uu("theme");function hu(t){const e=r.computed(()=>rl.value?rl.value:pu.value),n=s=>{pu.value=s,t&&t(s)};function i(){rl.value=e.value==="light"?"dark":(e.value,"light")}return r.watch(e,s=>{t&&t(r.unref(s))}),r.onMounted(()=>{nl.add(n)}),r.onUnmounted(()=>{nl.delete(n)}),[e,i]}const L_=r.defineComponent({__name:"ThemeSwitcher",setup(t){const[e,n]=hu();return(i,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))}}),O_={class:"pl-layout-component pl-block-page"},G_={key:0,class:"pl-block-page__title"},z_={class:"pl-block-page__title__append"},Z_={key:1},$_={class:"pl-block-page__body"},U_={name:"PlBlockPage"},W_=r.defineComponent({...U_,setup(t){const e=r.useSlots();return(n,i)=>(r.openBlock(),r.createElementBlock("div",O_,[r.unref(e).title?(r.openBlock(),r.createElementBlock("div",G_,[r.createElementVNode("h1",null,[r.renderSlot(n.$slots,"title")]),i[0]||(i[0]=r.createTextVNode()),r.createElementVNode("div",z_,[r.renderSlot(n.$slots,"append")])])):(r.openBlock(),r.createElementBlock("div",Z_)),i[1]||(i[1]=r.createTextVNode()),r.createElementVNode("div",$_,[r.renderSlot(n.$slots,"default")])]))}}),H_={name:"PlContainer"},j_=r.defineComponent({...H_,props:{width:{}},setup(t){const e=t,n=r.computed(()=>({width:e.width}));return(i,s)=>(r.openBlock(),r.createElementBlock("div",{class:"pl-container pl-layout-component",style:r.normalizeStyle(n.value)},[r.renderSlot(i.$slots,"default")],4))}}),q_={name:"PlRow"},K_=r.defineComponent({...q_,props:{wrap:{type:Boolean},alignCenter:{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))}}),Y_={class:"pl-layout-component",style:{"flex-grow":"1"}},J_={name:"PlSpacer"},fu=r.defineComponent({...J_,setup(t){return(e,n)=>(r.openBlock(),r.createElementBlock("div",Y_))}}),X_={name:"PlGrid"},Q_=r.defineComponent({...X_,props:{columns:{}},setup(t){const e=t,n=r.computed(()=>({gridTemplateColumns:`repeat(${e.columns}, minmax(0, 1fr))`}));return(i,s)=>(r.openBlock(),r.createElementBlock("div",{class:"pl-layout-component pl-grid",style:r.normalizeStyle(n.value)},[r.renderSlot(i.$slots,"default")],4))}}),eC={key:0,class:"pl-alert__icon"},tC={class:"pl-alert__main"},nC={key:0},rC={class:"pl-alert__main__text"},iC={name:"PlAlert"},oC=r.defineComponent({...iC,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,i)=>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",eC,[r.createElementVNode("div",{class:r.normalizeClass(`icon-24 icon-${e[n.type]}`)},null,2)])):r.createCommentVNode("",!0),i[2]||(i[2]=r.createTextVNode()),r.createElementVNode("div",tC,[n.label?(r.openBlock(),r.createElementBlock("label",nC,r.toDisplayString(n.label),1)):r.createCommentVNode("",!0),i[1]||(i[1]=r.createTextVNode()),r.createElementVNode("div",rC,[r.renderSlot(n.$slots,"default")])]),i[3]||(i[3]=r.createTextVNode()),n.closeable?(r.openBlock(),r.createElementBlock("div",{key:1,class:"pl-alert__close-btn","aria-label":"Close alert",role:"button",onClick:i[0]||(i[0]=s=>n.$emit("update:modelValue",!1))})):r.createCommentVNode("",!0)],6)):r.createCommentVNode("",!0)}}),Xi=r.defineComponent({__name:"PlMaskIcon16",props:{name:{},size:{}},setup(t){const e=t,n=r.computed(()=>e.size==="large"?"--mask-size: 24px":""),i=r.computed(()=>`mask-16 mask-${e.name}`);return(s,l)=>(r.openBlock(),r.createElementBlock("i",{style:r.normalizeStyle(n.value),class:r.normalizeClass(i.value)},null,6))}});function mu(t){function e(n){const i=n.currentTarget,s=document.createElement("span"),l=Math.max(i.clientWidth,i.clientHeight),c=l/2;s.style.width=s.style.height=`${l}px`,s.style.left=`${n.clientX-i.offsetLeft-c}px`,s.style.top=`${n.clientY-i.offsetTop-c}px`,s.classList.add("ripple");const u=i.getElementsByClassName("ripple")[0];u&&u.remove(),i.appendChild(s)}r.onMounted(()=>{var n;(n=t.value)==null||n.addEventListener("click",e)})}const sC={key:0},aC={inheritAttrs:!1},cs=r.defineComponent({...aC,__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(),i=r.computed(()=>e.small||e.size==="small"),s=r.computed(()=>e.large||e.size==="large");return mu(n),(l,c)=>(r.openBlock(),r.createElementBlock("button",r.mergeProps({ref_key:"btn",ref:n,tabindex:"0",class:{loading:l.loading,small:i.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",sC,[r.renderSlot(l.$slots,"default")])),c[0]||(c[0]=r.createTextVNode()),l.loading?(r.openBlock(),r.createBlock(r.unref(Xi),{key:1,name:"loading",size:l.size},null,8,["size"])):l.icon?(r.openBlock(),r.createBlock(r.unref(Xi),{key:2,name:l.icon,size:l.size},null,8,["name","size"])):r.createCommentVNode("",!0)],16))}}),lC={name:"PlBtnPrimary"},il=r.defineComponent({...lC,props:{loading:{type:Boolean},size:{},round:{type:Boolean},icon:{},reverse:{type:Boolean},justifyCenter:{type:Boolean}},setup(t){const e=t;return(n,i)=>(r.openBlock(),r.createBlock(cs,r.mergeProps({class:"pl-btn-primary"},e),{default:r.withCtx(()=>[r.renderSlot(n.$slots,"default")]),_:3},16))}}),cC={name:"PlBtnAccent"},dC=r.defineComponent({...cC,props:{loading:{type:Boolean},size:{},round:{type:Boolean},icon:{},reverse:{type:Boolean},justifyCenter:{type:Boolean}},setup(t){const e=t;return(n,i)=>(r.openBlock(),r.createBlock(cs,r.mergeProps({class:"pl-btn-accent"},e),{default:r.withCtx(()=>[r.renderSlot(n.$slots,"default")]),_:3},16))}}),uC={name:"PlBtnDanger"},pC=r.defineComponent({...uC,props:{loading:{type:Boolean},size:{},round:{type:Boolean},icon:{},reverse:{type:Boolean},justifyCenter:{type:Boolean}},setup(t){const e=t;return(n,i)=>(r.openBlock(),r.createBlock(cs,r.mergeProps({class:"pl-btn-danger"},e),{default:r.withCtx(()=>[r.renderSlot(n.$slots,"default")]),_:3},16))}}),hC={name:"PlBtnSecondary"},ol=r.defineComponent({...hC,props:{loading:{type:Boolean},size:{},round:{type:Boolean},icon:{},reverse:{type:Boolean},justifyCenter:{type:Boolean}},setup(t){const e=t;return(n,i)=>(r.openBlock(),r.createBlock(cs,r.mergeProps(e,{class:"pl-btn-secondary"}),{default:r.withCtx(()=>[r.renderSlot(n.$slots,"default")]),_:3},16))}}),fC={key:0},mC={name:"PlBtnGhost"},sl=r.defineComponent({...mC,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"),i=r.computed(()=>e.size==="large"),s=r.ref(),l=r.useSlots();return mu(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:i.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",fC,[r.renderSlot(c.$slots,"default")])):r.createCommentVNode("",!0),u[0]||(u[0]=r.createTextVNode()),c.loading?(r.openBlock(),r.createBlock(r.unref(Xi),{key:1,name:"loading",size:c.size},null,8,["size"])):c.icon?(r.openBlock(),r.createBlock(r.unref(Xi),{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))}}),gC=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(i,s)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["ui-btn-link",{disabled:i.disabled,loading:i.loading,hover:n.value}]),onMouseover:s[0]||(s[0]=l=>n.value=!0),onMouseleave:s[1]||(s[1]=l=>n.value=!1)},[r.createVNode(ol,r.mergeProps({round:"",hover:n.value},e),null,16,["hover"]),s[2]||(s[2]=r.createTextVNode()),r.renderSlot(i.$slots,"default")],34))}});function Qi(t,e){const n=el(()=>{if(t.value){const{scrollTop:i,scrollLeft:s,scrollHeight:l,scrollWidth:c,clientHeight:u,clientWidth:p}=document.documentElement,f=t.value.getBoundingClientRect();e({scrollTop:i,scrollLeft:s,scrollHeight:l,scrollWidth:c,clientHeight:u,clientWidth:p,offsetY:i+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),et(window,"scroll",n,{capture:!0,passive:!0}),et(window,"resize",n,{passive:!0}),et(window,"adjust",n,!0)}function yC(t,e){const n=r.ref();return Qi(t,i=>{n.value=i}),r.computed(()=>{const i=r.unref(n),s=r.unref(e),l=s.position??"top",c=s.gap??8;if(!i)return"";const u=i.offsetY+Math.floor(i.height/2),p=i.offsetX+Math.floor(i.width/2);return l==="top-left"?`left: ${i.offsetX}px; top: ${i.offsetY-c}px;`:l==="top"?`left: ${p}px; top: ${i.offsetY-c}px;`:l==="right"?`left: ${i.offsetX+i.width+c}px; top: ${u}px;`:l==="left"?`right: ${i.scrollWidth-i.x+c}px; top: ${u}px;`:""})}function eo(t,e){return e(t)}function it(t,e){if(t!=null)return e(t)}function vC(t){return Array.isArray(t)?t:[t]}function _C(t,e,...n){n.forEach(i=>{t[i]=e[i]})}function ds(t,e){et(document,"click",n=>{document.contains(n.target)&&(vC(t).map(i=>i.value).filter(i=>!!i).some(i=>i==null?void 0:i.contains(n.target))||e())})}const CC={},wC={class:"beak",width:"5",height:"9",viewBox:"0 0 3 8",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",{d:"M4.00222 8.00933L0 4.00711L4.00222 0.00488281L4.00222 8.00933Z",fill:"#24223D"},null,-1)]))}const xC=nr(CC,[["render",bC]]),al=new Map,kC={name:"PlTooltip"},Tt=r.defineComponent({...kC,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,i=Symbol(),s=t,l=r.reactive({open:!1,over:!1,tooltipOpen:!1,key:Symbol()});al.set(i,()=>f()),r.watch(()=>l.open,T=>{requestAnimationFrame(()=>{l.tooltipOpen=T})});let c=()=>{};const u=du(()=>window.dispatchEvent(new CustomEvent("adjust")),1e3),p=()=>{l.open=!0;for(let[T,N]of al.entries())T!==i&&N()},f=()=>{l.open=!1,n("tooltip:close")},m=async()=>{s.hide||(u(),l.over=!0,c(),await iu(100),l.over&&p())},v=()=>{l.over=!1,c=ou(()=>{l.over||f()},s.closeDelay)};r.watch(()=>s.hide,T=>{T&&f()});const k=r.ref(),S=r.ref(),F=yC(k,r.toRef(s));return ds([k,S],()=>f()),r.onUnmounted(()=>{al.delete(i)}),(T,N)=>(r.openBlock(),r.createBlock(r.resolveDynamicComponent(T.element),r.mergeProps(T.$attrs,{ref_key:"rootRef",ref:k,onClick:m,onMouseover:m,onMouseleave:v}),{default:r.withCtx(()=>[r.renderSlot(T.$slots,"default"),N[1]||(N[1]=r.createTextVNode()),T.$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(F))},[r.createElementVNode("div",{ref_key:"tooltip",ref:S,class:r.normalizeClass(["pl-tooltip",T.position]),onMouseover:m,onMouseleave:v},[r.createElementVNode("div",null,[r.renderSlot(T.$slots,"tooltip")]),N[0]||(N[0]=r.createTextVNode()),r.createVNode(xC)],34)],4)):r.createCommentVNode("",!0)]),_:3})])):r.createCommentVNode("",!0)]),_:3},16))}}),SC={},EC={class:"inner-border"};function TC(t,e,n,i,s,l){return r.openBlock(),r.createElementBlock("div",EC,[r.renderSlot(t.$slots,"default")])}const BC=nr(SC,[["render",TC]]),AC={key:0},PC=["tabindex","onKeydown","onClick"],VC={key:1,class:"ui-btn-group__helper"},NC={key:2,class:"ui-btn-group__error"},DC={name:"PlBtnGroup"},FC=r.defineComponent({...DC,props:{modelValue:{},label:{},options:{},disabled:{type:Boolean},helper:{},error:{}},emits:["update:modelValue"],setup(t,{emit:e}){const n=r.useSlots(),i=e,s=u=>i("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(["ui-btn-group",{disabled:u.disabled}])},[u.label?(r.openBlock(),r.createElementBlock("label",AC,[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(Tt),{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(BC,{class:"ui-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(["ui-btn-group__option text-s",{active:u.modelValue===f.value}]),tabindex:u.modelValue===f.value||u.disabled?void 0:0,onKeydown:r.withKeys(v=>s(f.value),["enter"]),onClick:v=>s(f.value)},r.toDisplayString(f.label),43,PC))),128))]),_:1}),p[2]||(p[2]=r.createTextVNode()),u.helper?(r.openBlock(),r.createElementBlock("div",VC,r.toDisplayString(u.helper),1)):u.error?(r.openBlock(),r.createElementBlock("div",NC,r.toDisplayString(u.error),1)):r.createCommentVNode("",!0)],2))}}),RC={inheritAttrs:!1},MC={class:"double-contour"};function IC(t,e,n,i,s,l){return r.openBlock(),r.createElementBlock("div",MC,[r.createElementVNode("div",r.normalizeProps(r.guardReactiveProps(t.$attrs)),[r.renderSlot(t.$slots,"default")],16)])}const ir=nr(RC,[["render",IC]]);function gu(t){r.onMounted(t),r.onUpdated(t)}const ll=new WeakMap,cl=new ResizeObserver(t=>{for(const e of t)it(ll.get(e.target),n=>n(e))});function yu(t,e){ll.set(t,e),cl.unobserve(t),cl.observe(t)}function vu(t){cl.unobserve(t),ll.delete(t)}const LC=8,_u=4;function Rn(t,e="label"){const n=new Set;gu(()=>{it(t==null?void 0:t.value,i=>{const s=i.querySelector(e);s&&(n.add(s),yu(s,()=>{const l=ru(()=>s.getBoundingClientRect().width+eo(LC,c=>Number.isNaN(c)?_u:c+_u));i.style.getPropertyValue("--label-offset-right-x")!==`${l}px`&&i.style.setProperty("--label-offset-right-x",`${l}px`)}))})}),r.onBeforeUnmount(()=>{Array.from(n.values()).map(i=>vu(i))})}function OC(t,e){const n=[];return e&&e.length>0&&e.forEach(i=>{const s=i(t);typeof s=="string"&&n.push(s)}),{isValid:n.length===0,errors:n}}function Cu(t,e){return r.computed(()=>OC(t.value,e))}const GC=r.defineComponent({__name:"PlIcon16",props:{name:{},size:{}},setup(t){const e=t,n=r.computed(()=>e.size==="large"?"--icon-size: 24px":""),i=r.computed(()=>`icon-16 icon-${e.name}`);return(s,l)=>(r.openBlock(),r.createElementBlock("i",{style:r.normalizeStyle(n.value),class:r.normalizeClass([i.value,s.$style.icon])},null,6))}}),zC="_icon_1ugxm_2",ZC={icon:zC},$C={$style:ZC},us=nr(GC,[["__cssModules",$C]]),UC=r.defineComponent({__name:"PlIcon24",props:{name:{},size:{}},setup(t){const e=t,n=r.computed(()=>`icon-24 icon-${e.name}`);return(i,s)=>(r.openBlock(),r.createElementBlock("i",{class:r.normalizeClass([n.value,i.$style.icon])},null,2))}}),WC="_icon_1ugxm_2",HC={icon:WC},jC={$style:HC},wu=nr(UC,[["__cssModules",jC]]),qC={class:"pl-text-field__envelope"},KC={key:0,ref:"label"},YC={key:0,class:"required-icon"},JC={key:1,class:"pl-text-field__prefix"},XC=["disabled","placeholder","type"],QC={class:"pl-text-field__append"},e0={key:0,class:"pl-text-field__error"},t0={key:1,class:"pl-text-field__helper"},n0={name:"PlTextField"},bu=r.defineComponent({...n0,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"),i=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(M){if(u.cached=void 0,i.parse)try{n.value=i.parse(M)}catch(R){u.cached={error:R instanceof Error?R.message:String(R),value:M}}else n.value=M}}),f=r.computed(()=>i.type&&i.type==="password"?c.value?"text":i.type:"text"),m=r.computed(()=>c.value?"view-show":"view-hide"),v=()=>{i.clearable&&(u.cached=void 0,n.value=i.clearable===!0?"":i.clearable())},k=Cu(p,i.rules||[]),S=r.computed(()=>i.clearable?i.clearable===!0?n.value==="":n.value===i.clearable():n.value===""),F=r.computed(()=>!S.value),T=r.computed(()=>{const M=[];return i.error&&M.push(i.error),u.cached&&M.push(u.cached.error),k.value.isValid||M.push(...k.value.errors),M}),N=r.computed(()=>T.value.length>0),C=r.computed(()=>i.clearable&&F.value&&i.type!=="password"),I=()=>c.value=!c.value,Q=()=>{u.cached=void 0};return Rn(s),(M,R)=>(r.openBlock(),r.createElementBlock("div",qC,[r.createElementVNode("div",{ref_key:"rootRef",ref:s,class:r.normalizeClass(["pl-text-field",{error:N.value,disabled:M.disabled,dashed:M.dashed,nonEmpty:F.value}])},[M.label?(r.openBlock(),r.createElementBlock("label",KC,[M.required?(r.openBlock(),r.createElementBlock("i",YC)):r.createCommentVNode("",!0),R[1]||(R[1]=r.createTextVNode()),r.createElementVNode("span",null,r.toDisplayString(M.label),1),R[2]||(R[2]=r.createTextVNode()),r.unref(e).tooltip?(r.openBlock(),r.createBlock(r.unref(Tt),{key:1,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.renderSlot(M.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)],512)):r.createCommentVNode("",!0),R[5]||(R[5]=r.createTextVNode()),M.prefix?(r.openBlock(),r.createElementBlock("div",JC,r.toDisplayString(M.prefix),1)):r.createCommentVNode("",!0),R[6]||(R[6]=r.createTextVNode()),r.withDirectives(r.createElementVNode("input",{ref_key:"inputRef",ref:l,"onUpdate:modelValue":R[0]||(R[0]=U=>p.value=U),disabled:M.disabled,placeholder:M.placeholder||"...",type:f.value,spellcheck:"false",onFocusout:Q},null,40,XC),[[r.vModelDynamic,p.value]]),R[7]||(R[7]=r.createTextVNode()),r.createElementVNode("div",QC,[C.value?(r.openBlock(),r.createBlock(r.unref(us),{key:0,name:"delete-clear",onClick:v})):r.createCommentVNode("",!0),R[3]||(R[3]=r.createTextVNode()),M.type==="password"?(r.openBlock(),r.createBlock(r.unref(wu),{key:1,name:m.value,style:{cursor:"pointer"},onClick:I},null,8,["name"])):r.createCommentVNode("",!0),R[4]||(R[4]=r.createTextVNode()),r.renderSlot(M.$slots,"append")]),R[8]||(R[8]=r.createTextVNode()),r.createVNode(ir,{class:"pl-text-field__contour"})],2),R[9]||(R[9]=r.createTextVNode()),N.value?(r.openBlock(),r.createElementBlock("div",e0,r.toDisplayString(T.value.join(" ")),1)):M.helper?(r.openBlock(),r.createElementBlock("div",t0,r.toDisplayString(M.helper),1)):r.createCommentVNode("",!0)]))}}),r0={class:"ui-text-area__envelope"},i0={key:0,ref:"label"},o0={key:0,class:"required-icon"},s0=["readonly","rows","disabled","placeholder"],a0={class:"ui-text-area__append"},l0={key:0,class:"ui-text-area__error"},c0={key:1,class:"ui-text-area__helper"},d0={name:"PlTextArea"},u0=r.defineComponent({...d0,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(),i=e,s=t,l=r.ref(),c=r.ref(),u=r.computed({get(){return s.modelValue??""},set(S){i("update:modelValue",S)}}),p=r.computed(()=>!!s.modelValue),f=Cu(u,s.rules||[]);Rn(l);const m=r.computed(()=>{const S=[];return s.error&&S.push(s.error),S.push(...f.value.errors),S}),v=r.computed(()=>m.value.length>0),k=()=>{if(!s.autogrow)return;const S=c.value;S&&(S.style.height="auto",S.style.height=`${S.scrollHeight}px`)};return r.onMounted(()=>{k()}),(S,F)=>(r.openBlock(),r.createElementBlock("div",r0,[r.createElementVNode("div",{ref_key:"root",ref:l,class:r.normalizeClass(["ui-text-area",{error:v.value,disabled:S.disabled,dashed:S.dashed,nonEmpty:p.value}])},[S.label?(r.openBlock(),r.createElementBlock("label",i0,[S.required?(r.openBlock(),r.createElementBlock("i",o0)):r.createCommentVNode("",!0),F[1]||(F[1]=r.createTextVNode()),r.createElementVNode("span",null,r.toDisplayString(S.label),1),F[2]||(F[2]=r.createTextVNode()),r.unref(n).tooltip?(r.openBlock(),r.createBlock(r.unref(Tt),{key:1,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.renderSlot(S.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)],512)):r.createCommentVNode("",!0),F[3]||(F[3]=r.createTextVNode()),r.withDirectives(r.createElementVNode("textarea",{ref_key:"input",ref:c,"onUpdate:modelValue":F[0]||(F[0]=T=>u.value=T),readonly:S.readonly,rows:S.rows,disabled:S.disabled,placeholder:S.placeholder??"...",spellcheck:"false",onInput:k},null,40,s0),[[r.vModelText,u.value]]),F[4]||(F[4]=r.createTextVNode()),r.createElementVNode("div",a0,[r.renderSlot(S.$slots,"append")]),F[5]||(F[5]=r.createTextVNode()),r.createVNode(ir,{class:"ui-text-area__contour"})],2),F[6]||(F[6]=r.createTextVNode()),v.value?(r.openBlock(),r.createElementBlock("div",l0,r.toDisplayString(m.value.join(" ")),1)):S.helper?(r.openBlock(),r.createElementBlock("div",c0,r.toDisplayString(S.helper),1)):r.createCommentVNode("",!0)]))}});function xu(t,e){const n=t.scrollTop,i=t.getBoundingClientRect().height,s=e.offsetTop,l=e.getBoundingClientRect().height;return s+l<i+n&&s>n}function ku(t,e){const n=t.scrollTop,i=t.getBoundingClientRect().height,s=e.offsetTop,l=e.getBoundingClientRect().height;return s+l<i+n?"ceil":s>n?"floor":"visible"}function to(t,e,n={}){const i=t.scrollTop,s=t.getBoundingClientRect().height,l=e.getBoundingClientRect().height,c=e.offsetTop,u=ku(t,e);if(u==="visible")return;const p=f=>{const m=u==="floor"?c-(s-l):c;t.scrollTop=i+f*(m-i)};xu(t,e)||lu({duration:n.duration||100,timing:au(f=>f),draw:p})}function dl(t,e,n,i){return t.addEventListener(e,n,i),function(){t.removeEventListener(e,n)}}function p0(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 Su(t){return t!==null&&typeof t=="object"}function Bt(t,e){return Su(t)&&Su(e)?Object.keys(t).length!==Object.keys(e).length?!1:Object.keys(t).every(n=>Bt(t[n],e[n])):t===e}function ul(t,e){return t.some(n=>Bt(n,e))}const h0=`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
44
44
  <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"/>
45
45
  </svg>
46
- `,h0=`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
46
+ `,f0=`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
47
47
  <rect x="3" y="3" width="18" height="18" rx="2" fill="#110529"/>
48
48
  <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"/>
49
49
  </svg>
50
- `,f0=["innerHTML"],m0={class:"dropdown-list-item__title-container"},g0={class:"dropdown-list-item__title text-s"},y0={key:0,class:"dropdown-list-item__description text-description"},v0={key:1,class:"dropdown-list-item__icon flex-self-start"},no=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(" ")}),i=r.computed(()=>{const l=["dropdown-list-item__checkbox","flex-self-start"];return e.isSelected&&l.push("checked"),l.join(" ")}),s=r.computed(()=>e.isSelected?h0:p0);return(l,d)=>(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(i.value),innerHTML:s.value},null,10,f0)):r.createCommentVNode("",!0),d[1]||(d[1]=r.createTextVNode()),r.createElementVNode("div",m0,[r.createElementVNode("div",g0,r.toDisplayString(l.option.label),1),d[0]||(d[0]=r.createTextVNode()),l.option.description?(r.openBlock(),r.createElementBlock("div",y0,r.toDisplayString(l.option.description),1)):r.createCommentVNode("",!0)]),d[2]||(d[2]=r.createTextVNode()),!e.useCheckbox&&e.isSelected?(r.openBlock(),r.createElementBlock("div",v0)):r.createCommentVNode("",!0)],2))}}),pl=r.defineComponent({__name:"LongText",setup(t){r.useCssVars(m=>({"8d68520c":d.value}));const e=r.ref(!1),n=r.ref(),i=r.ref(!1),s=r.computed(()=>i.value&&e.value?"ui-lt-animate":""),l=cu(m=>i.value=m,500),d=r.computed(()=>{var m;return n.value?`${((m=n.value)==null?void 0:m.innerHTML.length)*.4}s`:"5s"});function u(){const m=Qa(n.value,"span cannot be empty");e.value=m.clientWidth<m.scrollWidth}function p(){u(),l(!0)}function f(){l(!1)}return(m,v)=>(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))}}),Mn=r.defineComponent({__name:"PlMaskIcon24",props:{name:{},size:{}},setup(t){const e=t,n=r.computed(()=>`mask-24 mask-${e.name}`);return(i,s)=>(r.openBlock(),r.createElementBlock("i",{class:r.normalizeClass(n.value)},null,2))}}),_0={class:"pl-dropdown__envelope"},C0=["tabindex"],w0={class:"pl-dropdown__container"},b0={class:"pl-dropdown__field"},x0=["disabled","placeholder"],k0={class:"pl-dropdown__controls"},S0={key:0},E0={key:0,class:"required-icon"},T0={key:0,class:"nothing-found"},B0={key:0,class:"pl-dropdown__error"},A0={key:1,class:"pl-dropdown__helper"},P0={key:2,class:"pl-dropdown__helper"},V0={name:"PlDropdown"},hl=r.defineComponent({...V0,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,i=t,s=r.useSlots(),l=r.ref(),d=r.ref(),u=r.ref(),p=r.reactive({search:"",activeIndex:-1,open:!1,optionsHeight:0}),f=()=>eo($.value.findIndex(P=>Bt(P.value,i.modelValue)),P=>P<0?0:P),m=()=>p.activeIndex=f(),v=r.computed(()=>i.options===void 0),S=r.computed(()=>v.value?!0:i.disabled),x=r.computed(()=>(i.options??[]).findIndex(P=>Bt(P.value,i.modelValue))),F=r.computed(()=>{if(!v.value){if(i.error)return i.error;if(i.modelValue!==void 0&&x.value===-1)return"The selected value is not one of the options"}}),T=r.computed(()=>Pr(i.options??[]).map((P,O)=>({...P,index:O,isSelected:O===x.value,isActive:O===p.activeIndex}))),A=r.computed(()=>{const P=r.unref(T).find(O=>Bt(O.value,i.modelValue));return(P==null?void 0:P.label)||i.modelValue}),k=r.computed(()=>!p.open&&i.modelValue?"":i.modelValue?String(A.value):i.placeholder),D=r.computed(()=>i.modelValue!==void 0&&i.modelValue!==null),$=r.computed(()=>{const P=T.value;return p.search?P.filter(O=>{const Q=p.search.toLowerCase();return O.label.toLowerCase().includes(Q)||O.description&&O.description.toLowerCase().includes(Q)?!0:typeof O.value=="string"?O.value.toLowerCase().includes(Q):O.value===p.search}):P}),z=r.computed(()=>S.value?void 0:"0"),L=P=>{var O;n("update:modelValue",P),p.search="",p.open=!1,(O=l==null?void 0:l.value)==null||O.focus()},X=()=>n("update:modelValue",void 0),I=()=>{var P;return(P=u.value)==null?void 0:P.focus()},N=()=>p.open=!p.open,j=()=>p.open=!0,Z=P=>{var O,Q;const ve=P.relatedTarget;!((O=l.value)!=null&&O.contains(ve))&&!((Q=d.value)!=null&&Q.contains(ve))&&(p.search="",p.open=!1)},K=()=>{const P=d.value;P&&it(P.querySelector(".hovered-item"),O=>{to(P,O)})},le=P=>{var O,Q;if(["ArrowDown","ArrowUp","Enter","Escape"].includes(P.code))P.preventDefault();else return;const{open:ve,activeIndex:xe}=p;if(!ve){P.code==="Enter"&&(p.open=!0);return}P.code==="Escape"&&(p.open=!1,(O=l.value)==null||O.focus());const Gt=r.unref($),{length:jt}=Gt;if(!jt)return;P.code==="Enter"&&L((Q=Gt.find(So=>So.index===xe))==null?void 0:Q.value);const At=Gt.findIndex(So=>So.index===xe)??-1,ko=P.code==="ArrowDown"?1:P.code==="ArrowUp"?-1:0,Lr=Math.abs(At+ko+jt)%jt;p.activeIndex=$.value[Lr].index??-1};Rn(l),r.watch(()=>i.modelValue,m,{immediate:!0}),r.watch(()=>p.open,P=>{var O;return P?(O=u.value)==null?void 0:O.focus():""}),r.watchPostEffect(()=>{p.search,p.activeIndex>=0&&p.open&&K()});const U=r.reactive({top:"0px",left:"0px",width:"0px"});return r.watch(d,P=>{if(P){const O=P.getBoundingClientRect();p.optionsHeight=O.height,window.dispatchEvent(new CustomEvent("adjust"))}}),Qi(l,P=>{const O=P.top+P.height+3;O+p.optionsHeight>P.clientHeight?U.top=P.top-p.optionsHeight-3+"px":U.top=O+"px",U.left=P.left+"px",U.width=P.width+"px"}),(P,O)=>(r.openBlock(),r.createElementBlock("div",_0,[r.createElementVNode("div",{ref_key:"root",ref:l,tabindex:z.value,class:r.normalizeClass(["pl-dropdown",{open:p.open,error:P.error,disabled:S.value}]),onKeydown:le,onFocusout:Z},[r.createElementVNode("div",w0,[r.createElementVNode("div",b0,[r.withDirectives(r.createElementVNode("input",{ref_key:"input",ref:u,"onUpdate:modelValue":O[0]||(O[0]=Q=>p.search=Q),type:"text",tabindex:"-1",disabled:S.value,placeholder:k.value,spellcheck:"false",autocomplete:"chrome-off",onFocus:j},null,40,x0),[[r.vModelText,p.search]]),O[4]||(O[4]=r.createTextVNode()),p.open?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",{key:0,onClick:I},[r.createVNode(pl,{class:"input-value"},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(A.value),1)]),_:1})])),O[5]||(O[5]=r.createTextVNode()),r.createElementVNode("div",k0,[v.value?(r.openBlock(),r.createBlock(r.unref(Mn),{key:0,name:"loading"})):r.createCommentVNode("",!0),O[1]||(O[1]=r.createTextVNode()),P.clearable&&D.value?(r.openBlock(),r.createBlock(r.unref(us),{key:1,name:"delete-clear",onClick:r.withModifiers(X,["stop"])})):r.createCommentVNode("",!0),O[2]||(O[2]=r.createTextVNode()),r.renderSlot(P.$slots,"append"),O[3]||(O[3]=r.createTextVNode()),P.arrowIconLarge?(r.openBlock(),r.createElementBlock("div",{key:2,class:r.normalizeClass(["arrow-icon",[`icon-24 ${P.arrowIconLarge}`]]),onClick:r.withModifiers(N,["stop"])},null,2)):P.arrowIcon?(r.openBlock(),r.createElementBlock("div",{key:3,class:r.normalizeClass(["arrow-icon",[`icon-16 ${P.arrowIcon}`]]),onClick:r.withModifiers(N,["stop"])},null,2)):(r.openBlock(),r.createElementBlock("div",{key:4,class:"arrow-icon arrow-icon-default",onClick:r.withModifiers(N,["stop"])}))])]),O[9]||(O[9]=r.createTextVNode()),P.label?(r.openBlock(),r.createElementBlock("label",S0,[P.required?(r.openBlock(),r.createElementBlock("i",E0)):r.createCommentVNode("",!0),O[6]||(O[6]=r.createTextVNode()),r.createElementVNode("span",null,r.toDisplayString(P.label),1),O[7]||(O[7]=r.createTextVNode()),r.unref(s).tooltip?(r.openBlock(),r.createBlock(r.unref(Tt),{key:1,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.renderSlot(P.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0),O[10]||(O[10]=r.createTextVNode()),p.open?(r.openBlock(),r.createBlock(r.Teleport,{key:1,to:"body"},[r.createElementVNode("div",{ref_key:"list",ref:d,class:"pl-dropdown__options",style:r.normalizeStyle(U),tabindex:"-1"},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList($.value,(Q,ve)=>(r.openBlock(),r.createBlock(no,{key:ve,option:Q,"is-selected":Q.isSelected,"is-hovered":Q.isActive,size:P.optionSize,onClick:r.withModifiers(xe=>L(Q.value),["stop"])},null,8,["option","is-selected","is-hovered","size","onClick"]))),128)),O[8]||(O[8]=r.createTextVNode()),$.value.length?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",T0,"Nothing found"))],4)])):r.createCommentVNode("",!0),O[11]||(O[11]=r.createTextVNode()),r.createVNode(ir,{class:"pl-dropdown__contour"})])],42,C0),O[12]||(O[12]=r.createTextVNode()),F.value?(r.openBlock(),r.createElementBlock("div",B0,r.toDisplayString(F.value),1)):v.value&&P.loadingOptionsHelper?(r.openBlock(),r.createElementBlock("div",A0,r.toDisplayString(P.loadingOptionsHelper),1)):P.helper?(r.openBlock(),r.createElementBlock("div",P0,r.toDisplayString(P.helper),1)):r.createCommentVNode("",!0)]))}}),N0={name:"PlDropdownRef"},D0=r.defineComponent({...N0,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}))}),i=r.computed(()=>e.disabled?"icon-link-disabled":"icon-link");return(s,l)=>(r.openBlock(),r.createBlock(r.unref(hl),r.mergeProps(e,{options:n.value,"loading-options-helper":s.loadingOptionsHelper,"arrow-icon-large":i.value,"onUpdate:modelValue":l[0]||(l[0]=d=>s.$emit("update:modelValue",d))}),null,16,["options","loading-options-helper","arrow-icon-large"]))}});function F0(t,e){return r.computed(()=>{const n=Pr(t.value);return e.value?n.filter(i=>i.label.toLowerCase().includes(e.value.toLowerCase())):n})}const R0={class:"resizable-input"},M0=["placeholder","value","disabled"],I0=r.defineComponent({__name:"ResizableInput",props:{modelValue:{},placeholder:{},value:{},disabled:{type:Boolean},maxWidth:{},width:{}},emits:["input","update:modelValue"],setup(t,{emit:e}){const n=t,i=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 d(u){const p=u.target.value;i("update:modelValue",p)}return(u,p)=>(r.openBlock(),r.createElementBlock("div",R0,[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:d}),null,16,M0)]))}}),L0={class:"dropdown-tab-item__title text-caps13"},O0=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),i=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([i.value,"dropdown-tab-item"])},[r.createElementVNode("div",L0,r.toDisplayString(n.value),1)],2))}}),G0={class:"pl-line-dropdown__prefix"},z0={class:"pl-line-dropdown__icon-wrapper"},Z0={class:"pl-line-dropdown__icon"},$0={key:0,class:"pl-line-dropdown__no-item"},U0={key:0,class:"pl-line-dropdown__no-item"},Eu=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,i=t,s=r.reactive({isOpen:!1,activeOption:-1,optionsHeight:0}),l=r.ref(),d=r.ref(),u=r.computed(()=>{const Z=[];return s.isOpen&&Z.push("open"),i.disabled&&Z.push("disabled"),Z.join(" ")}),p=r.ref(""),f=F0(r.toRef(i,"options"),p),m=r.computed(()=>!!(i.clearable&&s.isOpen&&i.modelValue&&v.value)),v=r.computed(()=>{if(i.modelValue){const Z=F();if(Z!==-1){const K=Pr(i.options)[Z];return typeof K.label=="object"?K.label.title:K.label}}return""}),S=r.ref(v.value),x=r.computed(()=>s.isOpen&&p.value&&p.value.length>=v.value.length-1?p.value:v.value??"...");ds(l,()=>{i.mode==="list"&&(s.isOpen=!1)}),r.watch(()=>S.value,Z=>{v.value!==Z?p.value=Z:p.value=""}),r.watch(()=>s.isOpen,Z=>{var K;Z&&l.value&&((K=l.value.querySelector("input"))==null||K.focus(),r.nextTick(()=>I()))}),r.watch(()=>i.modelValue,()=>T(),{immediate:!0});function F(){return i.options.findIndex(Z=>Bt(Z.value,i.modelValue))}function T(){s.activeOption=eo(f.value.findIndex(Z=>Bt(Z.value,i.modelValue)),Z=>Z<0?0:Z),S.value=v.value}function A(){p.value=""}function k(){i.disabled?s.isOpen=!1:r.nextTick(()=>{s.isOpen=!s.isOpen})}function D(){i.mode==="list"&&(s.isOpen=!1)}function $(Z){Z&&(n("update:modelValue",Z.value),D(),A())}function z(Z){return Bt(Z.value,i.modelValue)}const L=Z=>{var K,le;const U=Z.relatedTarget;!((K=l.value)!=null&&K.contains(U))&&!((le=d.value)!=null&&le.contains(U))&&(p.value="",s.isOpen=!1)};function X(Z){const{activeOption:K}=s;if(!s.isOpen&&Z.code==="Enter"){s.isOpen=!0;return}const{length:le}=f.value;if(!le)return;["ArrowDown","ArrowUp","Enter"].includes(Z.code)&&Z.preventDefault(),Z.code==="Enter"&&$(f.value[K]);const U=Z.code==="ArrowDown"?1:Z.code==="ArrowUp"?-1:0;s.activeOption=Math.abs(K+U+le)%le,requestAnimationFrame(I)}function I(){const Z=d.value;Z&&it(Z.querySelector(".hovered-item"),K=>{i.mode==="list"?to(Z,K):K.scrollIntoView({behavior:"smooth",block:"nearest",inline:"center"})})}function N(){n("update:modelValue",void 0)}const j=r.reactive({top:"0px",left:"0px"});return r.watch(d,Z=>{if(Z){const K=Z.getBoundingClientRect();s.optionsHeight=K.height,window.dispatchEvent(new CustomEvent("adjust"))}}),Qi(l,Z=>{const K=Z.top+Z.height+2;K+s.optionsHeight>Z.clientHeight?j.top=Z.top-s.optionsHeight-2+"px":j.top=K+"px",j.left=Z.left+"px"}),(Z,K)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"container",ref:l,tabindex:"0",class:r.normalizeClass([u.value,"pl-line-dropdown uc-pointer"]),onKeydown:X,onFocusout:L,onClick:k},[r.createElementVNode("div",G0,r.toDisplayString(i==null?void 0:i.prefix),1),K[6]||(K[6]=r.createTextVNode()),r.createVNode(I0,{modelValue:S.value,"onUpdate:modelValue":K[0]||(K[0]=le=>S.value=le),placeholder:x.value,disabled:i.disabled,class:"pl-line-dropdown__input"},null,8,["modelValue","placeholder","disabled"]),K[7]||(K[7]=r.createTextVNode()),r.createElementVNode("div",z0,[r.withDirectives(r.createElementVNode("div",Z0,null,512),[[r.vShow,!m.value]]),K[1]||(K[1]=r.createTextVNode()),r.withDirectives(r.createElementVNode("div",{class:"pl-line-dropdown__icon-clear",onClick:N},null,512),[[r.vShow,m.value]])]),K[8]||(K[8]=r.createTextVNode()),s.isOpen?(r.openBlock(),r.createBlock(r.Teleport,{key:0,to:"body"},[i.mode==="list"?(r.openBlock(),r.createElementBlock("div",{key:0,ref_key:"list",ref:d,style:r.normalizeStyle(j),tabindex:"-1",class:"pl-line-dropdown__items",onFocusout:L},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(f),(le,U)=>r.renderSlot(Z.$slots,"item",{key:U,item:le,textItem:"text",isSelected:z(le),isHovered:s.activeOption==U,onClick:r.withModifiers(P=>$(le),["stop"])},()=>[r.createVNode(no,{option:le,"text-item":"text","is-selected":z(le),"is-hovered":s.activeOption==U,size:"medium",onClick:r.withModifiers(P=>$(le),["stop"])},null,8,["option","is-selected","is-hovered","onClick"])])),128)),K[3]||(K[3]=r.createTextVNode()),r.unref(f).length===0?(r.openBlock(),r.createElementBlock("div",$0,K[2]||(K[2]=[r.createElementVNode("div",{class:"pl-line-dropdown__no-item-title text-s"},"Didn't find anything that matched",-1)]))):r.createCommentVNode("",!0)],36)):i.mode==="tabs"?(r.openBlock(),r.createElementBlock("div",{key:1,ref_key:"list",ref:d,style:r.normalizeStyle(j),tabindex:"-1",class:"pl-line-dropdown__items-tabs",onFocusout:L},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(f),(le,U)=>r.renderSlot(Z.$slots,"item",{key:U,item:le,isSelected:z(le),isHovered:s.activeOption==U,onClick:r.withModifiers(P=>$(le),["stop"])},()=>[r.createVNode(O0,{option:le,"is-selected":z(le),"is-hovered":s.activeOption==U,onClick:r.withModifiers(P=>$(le),["stop"])},null,8,["option","is-selected","is-hovered","onClick"])])),128)),K[5]||(K[5]=r.createTextVNode()),r.unref(f).length===0?(r.openBlock(),r.createElementBlock("div",U0,K[4]||(K[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))}}),W0={class:"ui-dropdown__envelope"},H0=["tabindex"],j0={class:"ui-dropdown__container"},q0={class:"ui-dropdown__field"},K0=["disabled","placeholder"],Y0={class:"ui-dropdown__controls"},J0={key:0},X0={key:0,class:"required-icon"},Q0={key:0,class:"nothing-found"},ew={key:0,class:"ui-dropdown__error"},tw={key:1,class:"ui-dropdown__helper"},nw={key:2,class:"ui-dropdown__helper"},rw={name:"PlDropdown"},iw=r.defineComponent({...rw,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,i=t,s=r.useSlots(),l=r.ref(),d=r.ref(),u=r.ref(),p=r.reactive({search:"",activeIndex:-1,open:!1}),f=()=>eo($.value.findIndex(U=>Bt(U.value,i.modelValue)),U=>U<0?0:U),m=()=>p.activeIndex=f(),v=r.computed(()=>i.options===void 0),S=r.computed(()=>v.value?!0:i.disabled),x=r.computed(()=>(i.options??[]).findIndex(U=>Bt(U.value,i.modelValue))),F=r.computed(()=>{if(!v.value){if(i.error)return i.error;if(i.modelValue!==void 0&&x.value===-1)return"The selected value is not one of the options"}}),T=r.computed(()=>Pr(i.options??[]).map((U,P)=>({...U,index:P,isSelected:P===x.value,isActive:P===p.activeIndex}))),A=r.computed(()=>{const U=r.unref(T).find(P=>Bt(P.value,i.modelValue));return(U==null?void 0:U.label)||i.modelValue}),k=r.computed(()=>!p.open&&i.modelValue?"":i.modelValue?String(A.value):i.placeholder),D=r.computed(()=>i.modelValue!==void 0&&i.modelValue!==null),$=r.computed(()=>{const U=T.value;return p.search?U.filter(P=>{const O=p.search.toLowerCase();return P.label.toLowerCase().includes(O)||P.description&&P.description.toLowerCase().includes(O)?!0:typeof P.value=="string"?P.value.toLowerCase().includes(O):P.value===p.search}):U}),z=r.computed(()=>S.value?void 0:"0"),L=U=>{var P;n("update:modelValue",U),p.search="",p.open=!1,(P=l==null?void 0:l.value)==null||P.focus()},X=()=>n("update:modelValue",void 0),I=()=>{var U;return(U=u.value)==null?void 0:U.focus()},N=()=>p.open=!p.open,j=()=>p.open=!0,Z=U=>{var P;(P=l==null?void 0:l.value)!=null&&P.contains(U.relatedTarget)||(p.search="",p.open=!1)},K=()=>{const U=d.value;U&&it(U.querySelector(".hovered-item"),P=>{to(U,P)})},le=U=>{var P,O;if(["ArrowDown","ArrowUp","Enter","Escape"].includes(U.code))U.preventDefault();else return;const{open:Q,activeIndex:ve}=p;if(!Q){U.code==="Enter"&&(p.open=!0);return}U.code==="Escape"&&(p.open=!1,(P=l.value)==null||P.focus());const xe=r.unref($),{length:Gt}=xe;if(!Gt)return;U.code==="Enter"&&L((O=xe.find(Lr=>Lr.index===ve))==null?void 0:O.value);const jt=xe.findIndex(Lr=>Lr.index===ve)??-1,At=U.code==="ArrowDown"?1:U.code==="ArrowUp"?-1:0,ko=Math.abs(jt+At+Gt)%Gt;p.activeIndex=$.value[ko].index??-1};return Rn(l),r.watch(()=>i.modelValue,m,{immediate:!0}),r.watch(()=>p.open,U=>{var P;return U?(P=u.value)==null?void 0:P.focus():""}),r.watchPostEffect(()=>{p.search,p.activeIndex>=0&&p.open&&K()}),(U,P)=>(r.openBlock(),r.createElementBlock("div",W0,[r.createElementVNode("div",{ref_key:"root",ref:l,tabindex:z.value,class:r.normalizeClass(["ui-dropdown",{open:p.open,error:U.error,disabled:S.value}]),onKeydown:le,onFocusout:Z},[r.createElementVNode("div",j0,[r.createElementVNode("div",q0,[r.withDirectives(r.createElementVNode("input",{ref_key:"input",ref:u,"onUpdate:modelValue":P[0]||(P[0]=O=>p.search=O),type:"text",tabindex:"-1",disabled:S.value,placeholder:k.value,spellcheck:"false",autocomplete:"chrome-off",onFocus:j},null,40,K0),[[r.vModelText,p.search]]),P[4]||(P[4]=r.createTextVNode()),p.open?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",{key:0,onClick:I},[r.createVNode(pl,{class:"input-value"},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(A.value),1)]),_:1})])),P[5]||(P[5]=r.createTextVNode()),r.createElementVNode("div",Y0,[v.value?(r.openBlock(),r.createBlock(r.unref(Mn),{key:0,name:"loading"})):r.createCommentVNode("",!0),P[1]||(P[1]=r.createTextVNode()),U.clearable&&D.value?(r.openBlock(),r.createBlock(r.unref(us),{key:1,name:"delete-clear",onClick:r.withModifiers(X,["stop"])})):r.createCommentVNode("",!0),P[2]||(P[2]=r.createTextVNode()),r.renderSlot(U.$slots,"append"),P[3]||(P[3]=r.createTextVNode()),U.arrowIconLarge?(r.openBlock(),r.createElementBlock("div",{key:2,class:r.normalizeClass(["arrow-icon",[`icon-24 ${U.arrowIconLarge}`]]),onClick:r.withModifiers(N,["stop"])},null,2)):U.arrowIcon?(r.openBlock(),r.createElementBlock("div",{key:3,class:r.normalizeClass(["arrow-icon",[`icon-16 ${U.arrowIcon}`]]),onClick:r.withModifiers(N,["stop"])},null,2)):(r.openBlock(),r.createElementBlock("div",{key:4,class:"arrow-icon arrow-icon-default",onClick:r.withModifiers(N,["stop"])}))])]),P[9]||(P[9]=r.createTextVNode()),U.label?(r.openBlock(),r.createElementBlock("label",J0,[U.required?(r.openBlock(),r.createElementBlock("i",X0)):r.createCommentVNode("",!0),P[6]||(P[6]=r.createTextVNode()),r.createElementVNode("span",null,r.toDisplayString(U.label),1),P[7]||(P[7]=r.createTextVNode()),r.unref(s).tooltip?(r.openBlock(),r.createBlock(r.unref(Tt),{key:1,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.renderSlot(U.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0),P[10]||(P[10]=r.createTextVNode()),p.open?(r.openBlock(),r.createElementBlock("div",{key:1,ref_key:"list",ref:d,class:"ui-dropdown__options"},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList($.value,(O,Q)=>(r.openBlock(),r.createBlock(no,{key:Q,option:O,"is-selected":O.isSelected,"is-hovered":O.isActive,size:U.optionSize,onClick:r.withModifiers(ve=>L(O.value),["stop"])},null,8,["option","is-selected","is-hovered","size","onClick"]))),128)),P[8]||(P[8]=r.createTextVNode()),$.value.length?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",Q0,"Nothing found"))],512)):r.createCommentVNode("",!0),P[11]||(P[11]=r.createTextVNode()),r.createVNode(ir,{class:"ui-dropdown__contour"})])],42,H0),P[12]||(P[12]=r.createTextVNode()),F.value?(r.openBlock(),r.createElementBlock("div",ew,r.toDisplayString(F.value),1)):v.value&&U.loadingOptionsHelper?(r.openBlock(),r.createElementBlock("div",tw,r.toDisplayString(U.loadingOptionsHelper),1)):U.helper?(r.openBlock(),r.createElementBlock("div",nw,r.toDisplayString(U.helper),1)):r.createCommentVNode("",!0)]))}}),ow={key:0,class:"ui-progress-bar"},sw={class:"ui-progress-bar__messages d-flex align-center pl-6 pr-6"},aw={class:"ui-progress-bar__message flex-grow-1"},lw={class:"ui-progress-bar__percent"},cw=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(i,s)=>i.loading?(r.openBlock(),r.createElementBlock("div",ow,[r.createElementVNode("div",{class:"ui-progress-bar__indicator",style:r.normalizeStyle({width:i.progress+"%"})},null,4),s[1]||(s[1]=r.createTextVNode()),r.createElementVNode("div",sw,[r.createElementVNode("div",aw,r.toDisplayString(n.value),1),s[0]||(s[0]=r.createTextVNode()),r.createElementVNode("div",lw,r.toDisplayString(i.progress+"%"),1)])])):r.createCommentVNode("",!0)}}),dw={class:"mi-number-field__main-wrapper d-flex"},uw={class:"mi-number-field__wrapper flex-grow d-flex flex-align-center"},pw={key:0,class:"text-description"},hw=["disabled","placeholder"],fw={class:"mi-number-field__icons d-flex-column"},mw={key:0,class:"mi-number-field__hint text-description"},gw=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,i=e,s=r.ref(),l=r.useSlots(),d=r.ref();Rn(s);const u=r.ref(!0),p=r.computed({get(){return u.value&&n.modelValue!==void 0?new Number(n.modelValue).toString():""},set(k){var D;k=k.replace(/,/g,""),S(k)?(i("update:modelValue",+k),k.toString()!==((D=n.modelValue)==null?void 0:D.toString())&&+k===n.modelValue&&k[k.length-1]!=="."&&(u.value=!1,r.nextTick(()=>{u.value=!0}))):(k.trim()===""&&i("update:modelValue",void 0),u.value=!1,r.nextTick(()=>{u.value=!0}))}}),f=r.computed(()=>{let k=[];return n.errorMessage&&k.push(n.errorMessage),S(n.modelValue)?(n.minValue!==void 0&&n.modelValue!==void 0&&n.modelValue<n.minValue&&k.push(`Model value must be higher than ${n.minValue}`),n.maxValue!==void 0&&n.modelValue!==void 0&&n.modelValue>n.maxValue&&k.push(`Model value must be less than ${n.maxValue}`)):k.push("Model value is not a number."),k=[...k],k.join(" ")}),m=r.computed(()=>!!(n.maxValue&&n.modelValue!==void 0&&(n.modelValue||0)+n.step>n.maxValue)),v=r.computed(()=>!!(n.minValue&&n.modelValue!==void 0&&(n.modelValue||0)-n.step<n.minValue));function S(k){return k!==void 0?(k=k==null?void 0:k.toString(),!isNaN(+k)&&!isNaN(parseFloat(k))):!1}function x(){if(!m.value){let k=0;n.modelValue===void 0?k=n.minValue?n.minValue:0:k=+(n.modelValue||0)+n.step,p.value=k.toString()}}function F(){if(!v.value){let k=0;n.modelValue===void 0?k=0:k=+(n.modelValue||0)-n.step,p.value=n.minValue?Math.max(n.minValue,k).toString():k.toString()}}function T(k){["ArrowDown","ArrowUp"].includes(k.code)&&k.preventDefault(),k.code==="ArrowUp"?x():k.code==="ArrowDown"&&F()}const A=k=>{k.detail>1&&k.preventDefault()};return(k,D)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"root",ref:s,class:r.normalizeClass([{error:!!f.value.trim(),disabled:k.disabled},"mi-number-field d-flex-column"]),onMousedown:A,onKeydown:D[1]||(D[1]=$=>T($))},[r.createElementVNode("div",dw,[r.createVNode(ir,{class:"mi-number-field__contour"}),D[6]||(D[6]=r.createTextVNode()),r.createElementVNode("div",uw,[k.label?(r.openBlock(),r.createElementBlock("label",pw,[r.createTextVNode(r.toDisplayString(k.label)+" ",1),r.unref(l).tooltip?(r.openBlock(),r.createBlock(r.unref(Tt),{key:0,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.renderSlot(k.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0),D[2]||(D[2]=r.createTextVNode()),r.withDirectives(r.createElementVNode("input",{ref_key:"input",ref:d,"onUpdate:modelValue":D[0]||(D[0]=$=>p.value=$),disabled:k.disabled,placeholder:k.placeholder,class:"text-s flex-grow"},null,8,hw),[[r.vModelText,p.value]])]),D[7]||(D[7]=r.createTextVNode()),r.createElementVNode("div",fw,[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:x},D[3]||(D[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),D[5]||(D[5]=r.createTextVNode()),r.createElementVNode("div",{class:r.normalizeClass([{disabled:v.value},"mi-number-field__icon d-flex flex-justify-center uc-pointer flex-grow flex-align-center"]),onClick:F},D[4]||(D[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)])]),D[8]||(D[8]=r.createTextVNode()),f.value.trim()?(r.openBlock(),r.createElementBlock("div",mw,r.toDisplayString(f.value),1)):r.createCommentVNode("",!0)],34))}}),yw={class:"pl-chip__text"},fl=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 i;e.value&&(n.value=((i=e.value)==null?void 0:i.clientWidth)>=256)}),(i,s)=>(r.openBlock(),r.createBlock(r.unref(Tt),{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:i.small}])},[r.createElementVNode("div",yw,[r.renderSlot(i.$slots,"default")]),s[3]||(s[3]=r.createTextVNode()),i.closeable?(r.openBlock(),r.createElementBlock("div",{key:0,tabindex:"0",class:"pl-chip__close",onKeydown:s[0]||(s[0]=r.withKeys(l=>i.$emit("close"),["enter"])),onClick:s[1]||(s[1]=r.withModifiers(l=>i.$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(i.$slots,"default")]),key:"0"}:void 0]),1024))}}),vw={class:"pl-multi-dropdown__envelope"},_w=["tabindex"],Cw={class:"pl-multi-dropdown__container"},ww={class:"pl-multi-dropdown__field"},bw=["disabled","placeholder"],xw={class:"pl-multi-dropdown__append"},kw={key:0},Sw={key:0,class:"required-icon"},Ew={class:"pl-multi-dropdown__open-chips-container"},Tw={key:0,class:"nothing-found"},Bw={key:0,class:"pl-multi-dropdown__error"},Aw={key:1,class:"pl-multi-dropdown__helper"},Pw={name:"PlDropdownMulti"},Vw=r.defineComponent({...Pw,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,i=N=>n("update:modelValue",N),s=r.useSlots(),l=t,d=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:[]),v=r.computed(()=>f.open&&l.modelValue.length>0?l.placeholder:l.modelValue.length>0?"":l.placeholder),S=r.computed(()=>Pr(l.options).filter(N=>ul(m.value,N.value))),x=r.computed(()=>{const N=r.unref(m),j=Pr(l.options);return(f.search?j.filter(Z=>{const K=f.search.toLowerCase();return Z.label.toLowerCase().includes(K)?!0:typeof Z.value=="string"?Z.value.toLowerCase().includes(K):Z.value===f.search}):[...j]).map(Z=>({...Z,selected:ul(N,Z.value)}))}),F=r.computed(()=>l.disabled?void 0:"0"),T=()=>{f.activeOption=eo(x.value.findIndex(N=>Bt(N.value,l.modelValue)),N=>N<0?0:N)},A=N=>{var j;const Z=r.unref(m);i(ul(Z,N)?Z.filter(K=>!Bt(K,N)):[...Z,N]),f.search="",(j=d==null?void 0:d.value)==null||j.focus()},k=N=>i(r.unref(m).filter(j=>!Bt(j,N))),D=()=>{var N;return(N=p.value)==null?void 0:N.focus()},$=()=>f.open=!f.open,z=N=>{var j,Z;const K=N.relatedTarget;!((j=d.value)!=null&&j.contains(K))&&!((Z=u.value)!=null&&Z.contains(K))&&(f.search="",f.open=!1)},L=()=>{const N=u.value;N&&it(N.querySelector(".hovered-item"),j=>{to(N,j)})},X=N=>{var j;const{open:Z,activeOption:K}=f;if(!Z){N.code==="Enter"&&(f.open=!0);return}N.code==="Escape"&&(f.open=!1,(j=d.value)==null||j.focus());const le=r.unref(x),{length:U}=le;if(!U)return;["ArrowDown","ArrowUp","Enter"].includes(N.code)&&N.preventDefault(),N.code==="Enter"&&A(le[K].value);const P=N.code==="ArrowDown"?1:N.code==="ArrowUp"?-1:0;f.activeOption=Math.abs(K+P+U)%U,requestAnimationFrame(L)};Rn(d),r.watch(()=>l.modelValue,()=>T(),{immediate:!0}),r.watchPostEffect(()=>{f.search,f.open&&L()});const I=r.reactive({top:"0px",left:"0px",width:"0px"});return r.watch(u,N=>{if(N){const j=N.getBoundingClientRect();f.optionsHeight=j.height,window.dispatchEvent(new CustomEvent("adjust"))}}),Qi(d,N=>{const j=N.top+N.height+5;j+f.optionsHeight>N.clientHeight?I.top=N.top-f.optionsHeight-5+"px":I.top=j+"px",I.left=N.left+"px",I.width=N.width+"px"}),(N,j)=>(r.openBlock(),r.createElementBlock("div",vw,[r.createElementVNode("div",{ref_key:"rootRef",ref:d,tabindex:F.value,class:r.normalizeClass(["pl-multi-dropdown",{open:f.open,error:N.error,disabled:N.disabled}]),onKeydown:X,onFocusout:z},[r.createElementVNode("div",Cw,[r.createElementVNode("div",ww,[r.withDirectives(r.createElementVNode("input",{ref_key:"input",ref:p,"onUpdate:modelValue":j[0]||(j[0]=Z=>f.search=Z),type:"text",tabindex:"-1",disabled:N.disabled,placeholder:v.value,spellcheck:"false",autocomplete:"chrome-off",onFocus:j[1]||(j[1]=Z=>f.open=!0)},null,40,bw),[[r.vModelText,f.search]]),j[3]||(j[3]=r.createTextVNode()),f.open?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",{key:0,class:"chips-container",onClick:D},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(S.value,(Z,K)=>(r.openBlock(),r.createBlock(r.unref(fl),{key:K,closeable:"",small:"",onClick:j[2]||(j[2]=r.withModifiers(le=>f.open=!0,["stop"])),onClose:le=>k(Z.value)},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(Z.label||Z.value),1)]),_:2},1032,["onClose"]))),128))])),j[4]||(j[4]=r.createTextVNode()),r.createElementVNode("div",{class:"arrow",onClick:r.withModifiers($,["stop"])}),j[5]||(j[5]=r.createTextVNode()),r.createElementVNode("div",xw,[r.renderSlot(N.$slots,"append")])]),j[10]||(j[10]=r.createTextVNode()),N.label?(r.openBlock(),r.createElementBlock("label",kw,[N.required?(r.openBlock(),r.createElementBlock("i",Sw)):r.createCommentVNode("",!0),j[6]||(j[6]=r.createTextVNode()),r.createElementVNode("span",null,r.toDisplayString(N.label),1),j[7]||(j[7]=r.createTextVNode()),r.unref(s).tooltip?(r.openBlock(),r.createBlock(r.unref(Tt),{key:1,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.renderSlot(N.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0),j[11]||(j[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(I),tabindex:"-1",onFocusout:z},[r.createElementVNode("div",Ew,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(S.value,(Z,K)=>(r.openBlock(),r.createBlock(r.unref(fl),{key:K,closeable:"",small:"",onClose:le=>k(Z.value)},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(Z.label||Z.value),1)]),_:2},1032,["onClose"]))),128))]),j[8]||(j[8]=r.createTextVNode()),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(x.value,(Z,K)=>(r.openBlock(),r.createBlock(no,{key:K,option:Z,"text-item":"text","is-selected":Z.selected,"is-hovered":f.activeOption==K,size:"medium","use-checkbox":"",onClick:r.withModifiers(le=>A(Z.value),["stop"])},null,8,["option","is-selected","is-hovered","onClick"]))),128)),j[9]||(j[9]=r.createTextVNode()),x.value.length?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",Tw,"Nothing found"))],36)])):r.createCommentVNode("",!0),j[12]||(j[12]=r.createTextVNode()),r.createVNode(ir,{class:"pl-multi-dropdown__contour"})])],42,_w),j[13]||(j[13]=r.createTextVNode()),N.error?(r.openBlock(),r.createElementBlock("div",Bw,r.toDisplayString(N.error),1)):N.helper?(r.openBlock(),r.createElementBlock("div",Aw,r.toDisplayString(N.helper),1)):r.createCommentVNode("",!0)]))}}),ml=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(i,s)=>(r.openBlock(),r.createElementBlock("div",{tabindex:"0",class:r.normalizeClass(["pl-checkbox-base",{checked:n.value,disabled:i.disabled}]),onClick:s[0]||(s[0]=l=>i.$emit("update:modelValue",!i.modelValue)),onKeydown:s[1]||(s[1]=r.withKeys(l=>i.$emit("update:modelValue",!i.modelValue),["enter"]))},null,34))}}),Nw={name:"PlCheckbox"},Dw=r.defineComponent({...Nw,props:{modelValue:{type:Boolean},disabled:{type:Boolean}},emits:["update:modelValue"],setup(t){const e=t,n=r.useSlots();return(i,s)=>r.unref(n).default?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(["pl-checkbox",{disabled:i.disabled}])},[r.createVNode(ml,r.mergeProps(e,{"onUpdate:modelValue":s[0]||(s[0]=l=>i.$emit("update:modelValue",l))}),null,16),s[3]||(s[3]=r.createTextVNode()),r.createElementVNode("label",{onClick:s[1]||(s[1]=l=>i.$emit("update:modelValue",!i.$props.modelValue))},[r.renderSlot(i.$slots,"default")])],2)):(r.openBlock(),r.createBlock(ml,r.mergeProps({key:1},e,{"onUpdate:modelValue":s[2]||(s[2]=l=>i.$emit("update:modelValue",l))}),null,16))}}),Fw={key:0},Rw=["onClick"],Mw={name:"PlCheckboxGroup"},Iw=r.defineComponent({...Mw,props:{modelValue:{},label:{},options:{},disabled:{type:Boolean}},emits:["update:modelValue"],setup(t,{emit:e}){const n=e,i=t,s=d=>i.modelValue.includes(d),l=d=>{const u=i.modelValue??[];n("update:modelValue",s(d)?u.filter(p=>p!==d):[...u,d])};return(d,u)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["ui-checkbox-group",{disabled:d.disabled}])},[d.label?(r.openBlock(),r.createElementBlock("label",Fw,r.toDisplayString(d.label),1)):r.createCommentVNode("",!0),u[1]||(u[1]=r.createTextVNode()),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(d.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(ml,{disabled:d.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,Rw)]))),128))],2))}}),Lw="_component_tupwt_1",Ow={component:Lw},Gw={};function zw(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 Zw={$style:Ow},$w=nr(Gw,[["render",zw],["__cssModules",Zw]]),Uw={key:1,class:"pl-dialog-modal__title"},Ww={inheritAttrs:!1},gl=r.defineComponent({...Ww,__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}},emits:["update:modelValue"],setup(t,{emit:e}){const n=r.useSlots(),i=e,s=t,l=r.ref(),d=r.useAttrs();function u(p){l.value&&document.contains(p.target)&&!l.value.contains(p.target)&&i("update:modelValue",!1)}return et(document.body,"keyup",p=>{s.modelValue&&p.code==="Escape"&&i("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(d),{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($w,{key:0,class:"close-modal-btn",onClick:f[0]||(f[0]=r.withModifiers(m=>i("update:modelValue",!1),["stop"]))})):r.createCommentVNode("",!0),f[1]||(f[1]=r.createTextVNode()),r.unref(n).title?(r.openBlock(),r.createElementBlock("div",Uw,[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})]))}}),Hw=r.defineComponent({__name:"TransitionSlidePanel",setup(t){function e(){window.dispatchEvent(new CustomEvent("adjust"))}function n(){window.dispatchEvent(new CustomEvent("adjust"))}return(i,s)=>(r.openBlock(),r.createBlock(r.Transition,{name:"slide-panel",onAfterEnter:e,onAfterLeave:n},{default:r.withCtx(()=>[r.renderSlot(i.$slots,"default")]),_:3}))}}),jw={key:0,class:"pl-slide-modal__title"},qw={class:"pl-slide-modal__content"},Kw={key:1,class:"pl-slide-modal__actions"},Yw={name:"PlSlideModal",inheritAttrs:!1},Jw=r.defineComponent({...Yw,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(),i=e,s=t,l=r.ref(),d=r.useAttrs();return ds(l,()=>{s.modelValue&&s.closeOnOutsideClick&&i("update:modelValue",!1)}),et(document,"keydown",u=>{u.key==="Escape"&&i("update:modelValue",!1)}),(u,p)=>(r.openBlock(),r.createBlock(r.Teleport,{to:"body"},[r.createVNode(Hw,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(d),{class:["pl-slide-modal",{"has-title":r.unref(n).title,"has-actions":r.unref(n).actions}],onKeyup:p[1]||(p[1]=r.withKeys(f=>i("update:modelValue",!1),["esc"]))}),[r.createElementVNode("div",{class:"close-dialog-btn",onClick:p[0]||(p[0]=f=>i("update:modelValue",!1))}),p[3]||(p[3]=r.createTextVNode()),r.unref(n).title?(r.openBlock(),r.createElementBlock("div",jw,[r.renderSlot(u.$slots,"title")])):r.createCommentVNode("",!0),p[4]||(p[4]=r.createTextVNode()),r.createElementVNode("div",qw,[r.renderSlot(u.$slots,"default")]),p[5]||(p[5]=r.createTextVNode()),r.unref(n).actions?(r.openBlock(),r.createElementBlock("div",Kw,[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=>i("update:modelValue",!1),["esc"]))},null,32)):r.createCommentVNode("",!0)]))}}),Xw={key:0,class:"label"},Qw={name:"PlToggleSwitch"},eb=r.defineComponent({...Qw,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]=i=>e.$emit("update:modelValue",!e.modelValue)),onKeydown:n[1]||(n[1]=r.withKeys(i=>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",Xw,r.toDisplayString(e.label),1)):r.createCommentVNode("",!0)],34))}});function Tu(t){return r.getCurrentScope()?(r.onScopeDispose(t),!0):!1}function tb(t){return r.unref(t)}const nb=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;function rb(t,e,n={}){const{immediate:i=!0}=n,s=r.ref(!1);let l=null;function d(){l&&(clearTimeout(l),l=null)}function u(){s.value=!1,d()}function p(...f){d(),s.value=!0,l=setTimeout(()=>{s.value=!1,l=null,t(...f)},tb(e))}return i&&(s.value=!0,nb&&p()),Tu(u),{isPending:r.readonly(s),start:p,stop:u}}function ib(t,e,n){return r.watch(t,(i,s,l)=>{i&&e(i,s,l)},{...n,once:!1})}function ob(t,e,n){const{start:i}=rb(l,e,{immediate:!1}),s=r.ref(!1);async function l(){s.value&&(await t(),i())}function d(){s.value||(s.value=!0,l())}function u(){s.value=!1}return n!=null&&n.immediate&&d(),Tu(u),{isActive:s,pause:u,resume:d}}const sb="[==PROGRESS==]";function ab(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function lb(t){const e=r.ref(),n=r.reactive({errorCount:0});async function i(){var l;let d=e.value;if(d===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(d.logHandle,100,d.lastOffset);if(d.error=void 0,n.errorCount=0,p.shouldUpdateHandle||d.logHandle!==((l=e.value)==null?void 0:l.logHandle))return;const f=t.progressPrefix??sb,m=new TextDecoder().decode(p.data).replace(new RegExp(`${ab(f)}`,"g"),"");if(d=Object.assign(d,{lines:d.lines+m,lastOffset:p.newOffset,finished:!p.live}),p.newOffset>=p.size)break}}const s=ob(()=>i().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 ib(()=>{var l;return(l=e==null?void 0:e.value)==null?void 0:l.finished},()=>s.pause()),r.watch(()=>t.logHandle,l=>{var d;l===void 0?(e.value=void 0,s.pause()):l!==((d=e.value)==null?void 0:d.logHandle)&&(e.value={logHandle:l,lastOffset:0,lines:"",finished:!1,error:void 0},n.errorCount=0,s.resume())},{immediate:!0}),e}const cb={key:0},db={key:1,class:"pl-log-view__error"},ub={name:"PlLogView"},pb=r.defineComponent({...ub,props:{value:{},logHandle:{},progressPrefix:{},error:{},output:{},maxRetries:{},mockPlatforma:{},label:{}},setup(t){const e=S=>{if(S&&S.ok===!1)return S.errors.join(`
51
- `)},n=t,i=lb(n),s=r.ref(!0),l=r.ref(),d=r.ref(),u=r.computed(()=>{var S;return((S=i.value)==null?void 0:S.error)??n.error??e(n.output)}),p=r.computed(()=>{var S;return((S=i.value)==null?void 0:S.lines)??n.value??cv(n.output)});Rn(d);const f=()=>{p.value&&typeof p.value=="string"&&navigator.clipboard.writeText(p.value)},m=()=>{Ar(l.value,S=>{s.value&&S.scrollTo(S.scrollLeft,S.scrollHeight)})};r.watch(p,()=>{requestAnimationFrame(()=>{m()})},{immediate:!0});const v=S=>{const x=S.target;s.value=x.scrollTop+20>=x.scrollHeight-x.offsetHeight};return(S,x)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"root",ref:d,class:r.normalizeClass(["pl-log-view",{"has-error":u.value}])},[S.label?(r.openBlock(),r.createElementBlock("label",cb,r.toDisplayString(S.label),1)):r.createCommentVNode("",!0),x[0]||(x[0]=r.createTextVNode()),r.createVNode(ir,{class:"pl-log-view__contour"}),x[1]||(x[1]=r.createTextVNode()),r.createVNode(r.unref(Mn),{title:"Copy content",class:"pl-log-view__copy",name:"clipboard",onClick:f}),x[2]||(x[2]=r.createTextVNode()),u.value?(r.openBlock(),r.createElementBlock("div",db,r.toDisplayString(u.value),1)):(r.openBlock(),r.createElementBlock("div",{key:2,ref_key:"contentRef",ref:l,class:"pl-log-view__content",onScroll:v},r.toDisplayString(p.value),545))],2))}}),hb="_component_1ukal_1",fb="_tab_1ukal_14",mb="_disabled_1ukal_27",gb="_active_1ukal_56",yb="_topLine_1ukal_69",ni={component:hb,tab:fb,disabled:mb,active:gb,topLine:yb},vb=r.defineComponent({__name:"Tab",props:{option:{}},setup(t){const e=r.ref(),n=r.reactive({isOverflown:!1});return r.onMounted(()=>{const i=r.unref(e);if(!i)return;const s=i.$el.querySelector("span");s&&requestAnimationFrame(()=>{s.offsetWidth<s.scrollWidth&&(n.isOverflown=!0),console.log("el.offsetWidth, el.scrollWidth",s.offsetWidth,s.scrollWidth)})}),(i,s)=>(r.openBlock(),r.createBlock(r.unref(Tt),{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(i.option.label),1)]),default:r.withCtx(()=>[r.renderSlot(i.$slots,"default"),s[0]||(s[0]=r.createTextVNode())]),_:3},8,["hide","data-is-overflown"]))}}),_b={name:"PlTabs"},Cb=r.defineComponent({..._b,props:{modelValue:{},options:{},disabled:{type:Boolean},topLine:{type:Boolean},maxTabWidth:{}},emits:["update:modelValue"],setup(t,{emit:e}){const n=e,i=s=>n("update:modelValue",s);return(s,l)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass([r.unref(ni).component,{[r.unref(ni).disabled]:s.disabled,[r.unref(ni).topLine]:s.topLine}])},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(s.options,(d,u)=>(r.openBlock(),r.createBlock(vb,{key:u,tabindex:s.modelValue===d.value||s.disabled||d.disabled?void 0:0,option:d,class:r.normalizeClass([{[r.unref(ni).active]:s.modelValue===d.value,[r.unref(ni).disabled]:d.disabled},r.unref(ni).tab]),style:r.normalizeStyle({"--pl-tabs-item-max-width":d.maxWidth??s.maxTabWidth}),onKeydown:r.withKeys(p=>i(d.value),["enter"]),onClick:p=>i(d.value)},{default:r.withCtx(()=>[r.renderSlot(s.$slots,d.value,{option:d},()=>[r.createElementVNode("span",null,r.toDisplayString(d.label),1)])]),_:2},1032,["tabindex","option","class","style","onKeydown","onClick"]))),128))],2))}});function wb(t){const e=t.split("/"),n=[];for(let i=0;i<e.length;i++)n.push({index:i,name:i===0?"Root":e[i],path:e.slice(0,i+1).join("/")});return n}const bb={class:"file-dialog"},xb={class:"file-dialog__search"},kb={class:"ls-container"},Sb={class:"ls-head"},Eb={class:"ls-head__breadcrumbs"},Tb=["title","onClick"],Bb={key:0,class:"icon-16 icon-chevron-right"},Ab={class:"d-flex ml-auto align-center gap-12"},Pb={class:"ls-head__selected"},Vb={key:0,class:"ls-loader"},Nb={key:1,class:"ls-empty"},Db={key:2,class:"ls-error"},Fb={class:"ls-error__message"},Rb={key:3,class:"ls-body"},Mb=["onClick"],Ib=["title"],Lb=["onClick"],Ob=["title"],Bu=r.defineComponent({__name:"PlFileDialog",props:{modelValue:{type:Boolean},extensions:{default:void 0},multi:{type:Boolean},title:{default:void 0},autoSelectStorage:{type:Boolean,default:!0}},emits:["update:modelValue","import:files"],setup(t,{emit:e}){const n=e,i=t,s=()=>({dirPath:"",storageEntry:void 0,items:[],error:"",storageOptions:[],selected:[],lastSelected:void 0,currentLoadingPath:void 0,showHiddenItems:!1}),l=r.reactive(s()),d=r.computed(()=>l.showHiddenItems?l.items:l.items.filter(I=>!I.name.startsWith("."))),u=r.computed(()=>{var I;return{modelValue:i.modelValue,dirPath:l.dirPath,storageHandle:(I=l.storageEntry)==null?void 0:I.handle}}),p=(I,N)=>{window.platforma&&l.currentLoadingPath!==N&&(l.error="",l.items=[],l.lastSelected=void 0,l.currentLoadingPath=N,window.platforma.lsDriver.listFiles(I,N).then(j=>{N===l.dirPath&&(l.items=jd(j).entries.map(Z=>({path:Z.fullPath,name:Z.name,isDir:Z.type==="dir",canBeSelected:Z.type==="file"&&(!i.extensions||i.extensions.some(K=>Z.fullPath.endsWith(K))),handle:Z.type==="file"?Z.handle:void 0,selected:!1})).sort((Z,K)=>Z.isDir&&!K.isDir?-1:!Z.isDir&&K.isDir?1:Z.name.localeCompare(K.name)).map((Z,K)=>({id:K,...Z})),l.lastSelected=void 0)}).catch(j=>l.error=String(j)).finally(()=>{l.currentLoadingPath=void 0}))},f=()=>{const{storageHandle:I,dirPath:N,modelValue:j}=u.value;I&&j&&p(I,N)},m=Yd(I=>{l.dirPath=I??""},1e3),v=r.computed(()=>wb(l.dirPath)),S=r.computed(()=>l.items.filter(I=>I.canBeSelected&&I.selected&&!I.isDir)),x=r.computed(()=>S.value.length>0),F=()=>{n("update:modelValue",!1)},T=()=>{var I;x.value&&(I=l.storageEntry)!=null&&I.handle&&(n("import:files",{storageHandle:l.storageEntry.handle,files:S.value.map(N=>N.handle)}),F())},A=I=>{l.dirPath=I,l.storageEntry&&f()},k=(I,N)=>{const{shiftKey:j,metaKey:Z}=I,{lastSelected:K}=l;if(I.preventDefault(),N.canBeSelected){if(i.multi||l.items.forEach(le=>le.selected=!1),N.selected=!0,!i.multi)return;!Z&&!j&&l.items.forEach(le=>{le.id!==N.id&&(le.selected=!1)}),j&&K!==void 0&&l.items.forEach(le=>{sv(le.id,K,N.id)&&(le.selected=!0)}),N.selected&&(l.lastSelected=N.id)}},D=I=>{I&&!i.multi||l.items.filter(N=>N.canBeSelected).forEach(N=>{N.selected=I})},$=()=>D(!0),z=()=>D(!1),L=()=>{if(l.error="",l.lastSelected=void 0,z(),!window.platforma){console.warn("platforma API is not found");return}window.platforma.lsDriver.getStorageList().then(I=>{l.storageOptions=I.map(N=>({text:N.name,value:N})),i.autoSelectStorage&&Ar(I.find(N=>N.name==="local"||N.name.startsWith("local_disk_")&&N.initialFullPath.length>4),N=>{l.storageEntry=N,l.dirPath=N.initialFullPath})}).catch(I=>l.error=String(I))};r.watch(r.toRef(l,"storageEntry"),I=>{l.dirPath=(I==null?void 0:I.initialFullPath)??""}),r.watch([()=>l.dirPath,()=>l.storageEntry],()=>{f()}),r.watch(()=>i.modelValue,I=>{I?L():Object.assign(l,s())},{immediate:!0}),et(document,"keydown",I=>{i.modelValue&&I.target===document.body&&(I.metaKey&&I.code==="KeyA"&&(I.preventDefault(),$()),I.metaKey&&I.shiftKey&&I.code==="Period"&&(I.preventDefault(),l.showHiddenItems=!l.showHiddenItems),I.code==="Enter"&&T())}),r.onUpdated(L);const X={mounted:I=>{if(I.clientWidth<I.scrollWidth){const N=I.innerText;I.innerText=N.substring(0,57)+"..."+N.substring(N.length-10)}}};return(I,N)=>(r.openBlock(),r.createBlock(r.unref(gl),{"no-content-gutters":!0,class:"split","model-value":I.modelValue,width:"688px",height:"720px","onUpdate:modelValue":F,onClick:r.withModifiers(z,["stop"])},{title:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(I.title??"Select files"),1)]),actions:r.withCtx(()=>[r.createVNode(r.unref(il),{style:{"min-width":"160px"},disabled:!x.value,onClick:r.withModifiers(T,["stop"])},{default:r.withCtx(()=>N[14]||(N[14]=[r.createTextVNode("Import")])),_:1},8,["disabled"]),N[16]||(N[16]=r.createTextVNode()),r.createVNode(r.unref(sl),{"justify-center":!1,onClick:r.withModifiers(F,["stop"])},{default:r.withCtx(()=>N[15]||(N[15]=[r.createTextVNode("Cancel")])),_:1})]),default:r.withCtx(()=>[N[17]||(N[17]=r.createTextVNode()),r.createElementVNode("div",bb,[r.createElementVNode("div",xb,[r.createVNode(r.unref(hl),{modelValue:l.storageEntry,"onUpdate:modelValue":N[0]||(N[0]=j=>l.storageEntry=j),label:"Select storage",options:l.storageOptions},null,8,["modelValue","options"]),N[1]||(N[1]=r.createTextVNode()),r.createVNode(r.unref(bu),{"model-value":l.dirPath,label:"Enter path","onUpdate:modelValue":r.unref(m)},null,8,["model-value","onUpdate:modelValue"])]),N[13]||(N[13]=r.createTextVNode()),r.createElementVNode("div",kb,[r.createElementVNode("div",Sb,[r.createElementVNode("div",Eb,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(v.value,(j,Z)=>(r.openBlock(),r.createElementBlock(r.Fragment,{key:Z},[r.createElementVNode("div",{title:j.path,onClick:K=>A(j.path)},r.toDisplayString(j.name),9,Tb),N[2]||(N[2]=r.createTextVNode()),j.index!==v.value.length-1?(r.openBlock(),r.createElementBlock("i",Bb)):r.createCommentVNode("",!0)],64))),128))]),N[3]||(N[3]=r.createTextVNode()),r.createElementVNode("div",Ab,[r.createElementVNode("span",Pb,"Selected: "+r.toDisplayString(S.value.length),1)])]),N[12]||(N[12]=r.createTextVNode()),l.currentLoadingPath!==void 0?(r.openBlock(),r.createElementBlock("div",Vb,N[4]||(N[4]=[r.createElementVNode("i",{class:"mask-24 mask-loading loader-icon"},null,-1)]))):l.storageEntry?l.error?(r.openBlock(),r.createElementBlock("div",Db,[N[6]||(N[6]=r.createElementVNode("div",{class:"ls-error__cat"},null,-1)),N[7]||(N[7]=r.createTextVNode()),r.createElementVNode("div",Fb,r.toDisplayString(l.error),1)])):(r.openBlock(),r.createElementBlock("div",Rb,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(d.value,j=>(r.openBlock(),r.createElementBlock(r.Fragment,{key:j.id},[j.isDir?(r.openBlock(),r.createElementBlock("div",{key:0,class:"isDir",onClick:Z=>A(j.path)},[N[8]||(N[8]=r.createElementVNode("i",{class:"icon-16 icon-chevron-right"},null,-1)),N[9]||(N[9]=r.createTextVNode()),r.withDirectives((r.openBlock(),r.createElementBlock("span",{title:j.name},[r.createTextVNode(r.toDisplayString(j.name),1)],8,Ib)),[[X]])],8,Mb)):(r.openBlock(),r.createElementBlock("div",{key:1,class:r.normalizeClass({canBeSelected:j.canBeSelected,selected:j.selected}),onClick:r.withModifiers(Z=>k(Z,j),["stop"])},[N[10]||(N[10]=r.createElementVNode("i",{class:"mask-16 mask-box isFile"},null,-1)),N[11]||(N[11]=r.createTextVNode()),r.withDirectives((r.openBlock(),r.createElementBlock("span",{title:j.name},[r.createTextVNode(r.toDisplayString(j.name),1)],8,Ob)),[[X]])],10,Lb))],64))),128))])):(r.openBlock(),r.createElementBlock("div",Nb,N[5]||(N[5]=[r.createElementVNode("div",{class:"ls-empty__cat"},null,-1),r.createTextVNode(),r.createElementVNode("div",{class:"ls-empty__message"},"Select storage to preview",-1)])))])]),N[18]||(N[18]=r.createTextVNode())]),_:1},8,["model-value"]))}});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 d of s)l[d]=d;return l},t.getValidEnumValues=s=>{const l=t.objectKeys(s).filter(u=>typeof s[s[u]]!="number"),d={};for(const u of l)d[u]=s[u];return t.objectValues(d)},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 d in s)Object.prototype.hasOwnProperty.call(s,d)&&l.push(d);return l},t.find=(s,l)=>{for(const d of s)if(l(d))return d},t.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&isFinite(s)&&Math.floor(s)===s;function i(s,l=" | "){return s.map(d=>typeof d=="string"?`'${d}'`:d).join(l)}t.joinValues=i,t.jsonStringifyReplacer=(s,l)=>typeof l=="bigint"?l.toString():l})(Ie||(Ie={}));var yl;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(yl||(yl={}));const oe=Ie.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),or=t=>{switch(typeof t){case"undefined":return oe.undefined;case"string":return oe.string;case"number":return isNaN(t)?oe.nan:oe.number;case"boolean":return oe.boolean;case"function":return oe.function;case"bigint":return oe.bigint;case"symbol":return oe.symbol;case"object":return Array.isArray(t)?oe.array:t===null?oe.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?oe.promise:typeof Map<"u"&&t instanceof Map?oe.map:typeof Set<"u"&&t instanceof Set?oe.set:typeof Date<"u"&&t instanceof Date?oe.date:oe.object;default:return oe.unknown}},J=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"]),Gb=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:");class Rt extends Error{constructor(e){super(),this.issues=[],this.addIssue=i=>{this.issues=[...this.issues,i]},this.addIssues=(i=[])=>{this.issues=[...this.issues,...i]};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},i={_errors:[]},s=l=>{for(const d of l.issues)if(d.code==="invalid_union")d.unionErrors.map(s);else if(d.code==="invalid_return_type")s(d.returnTypeError);else if(d.code==="invalid_arguments")s(d.argumentsError);else if(d.path.length===0)i._errors.push(n(d));else{let u=i,p=0;for(;p<d.path.length;){const f=d.path[p];p===d.path.length-1?(u[f]=u[f]||{_errors:[]},u[f]._errors.push(n(d))):u[f]=u[f]||{_errors:[]},u=u[f],p++}}};return s(this),i}static assert(e){if(!(e instanceof Rt))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={},i=[];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))):i.push(e(s));return{formErrors:i,fieldErrors:n}}get formErrors(){return this.flatten()}}Rt.create=t=>new Rt(t);const ri=(t,e)=>{let n;switch(t.code){case J.invalid_type:t.received===oe.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case J.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,Ie.jsonStringifyReplacer)}`;break;case J.unrecognized_keys:n=`Unrecognized key(s) in object: ${Ie.joinValues(t.keys,", ")}`;break;case J.invalid_union:n="Invalid input";break;case J.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Ie.joinValues(t.options)}`;break;case J.invalid_enum_value:n=`Invalid enum value. Expected ${Ie.joinValues(t.options)}, received '${t.received}'`;break;case J.invalid_arguments:n="Invalid function arguments";break;case J.invalid_return_type:n="Invalid function return type";break;case J.invalid_date:n="Invalid date";break;case J.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 J.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 J.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 J.custom:n="Invalid input";break;case J.invalid_intersection_types:n="Intersection results could not be merged";break;case J.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case J.not_finite:n="Number must be finite";break;default:n=e.defaultError,Ie.assertNever(t)}return{message:n}};let Au=ri;function zb(t){Au=t}function ps(){return Au}const hs=t=>{const{data:e,path:n,errorMaps:i,issueData:s}=t,l=[...n,...s.path||[]],d={...s,path:l};if(s.message!==void 0)return{...s,path:l,message:s.message};let u="";const p=i.filter(f=>!!f).slice().reverse();for(const f of p)u=f(d,{data:e,defaultError:u}).message;return{...s,path:l,message:u}},Zb=[];function re(t,e){const n=ps(),i=hs({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===ri?void 0:ri].filter(s=>!!s)});t.common.issues.push(i)}class mt{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){const i=[];for(const s of n){if(s.status==="aborted")return Ce;s.status==="dirty"&&e.dirty(),i.push(s.value)}return{status:e.value,value:i}}static async mergeObjectAsync(e,n){const i=[];for(const s of n){const l=await s.key,d=await s.value;i.push({key:l,value:d})}return mt.mergeObjectSync(e,i)}static mergeObjectSync(e,n){const i={};for(const s of n){const{key:l,value:d}=s;if(l.status==="aborted"||d.status==="aborted")return Ce;l.status==="dirty"&&e.dirty(),d.status==="dirty"&&e.dirty(),l.value!=="__proto__"&&(typeof d.value<"u"||s.alwaysSet)&&(i[l.value]=d.value)}return{status:e.value,value:i}}}const Ce=Object.freeze({status:"aborted"}),fs=t=>({status:"dirty",value:t}),wt=t=>({status:"valid",value:t}),vl=t=>t.status==="aborted",_l=t=>t.status==="dirty",ro=t=>t.status==="valid",io=t=>typeof Promise<"u"&&t instanceof Promise;function ms(t,e,n,i){if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e.get(t)}function Pu(t,e,n,i,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 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 oo,so;class En{constructor(e,n,i,s){this._cachedPath=[],this.parent=e,this.data=n,this._path=i,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 Vu=(t,e)=>{if(ro(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 Rt(t.common.issues);return this._error=n,this._error}}};function Ee(t){if(!t)return{};const{errorMap:e,invalid_type_error:n,required_error:i,description:s}=t;if(e&&(n||i))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,d)=>{var u,p;const{message:f}=t;return l.code==="invalid_enum_value"?{message:f??d.defaultError}:typeof d.data>"u"?{message:(u=f??i)!==null&&u!==void 0?u:d.defaultError}:l.code!=="invalid_type"?{message:d.defaultError}:{message:(p=f??n)!==null&&p!==void 0?p:d.defaultError}},description:s}}class Ae{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 or(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:or(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new mt,ctx:{common:e.parent.common,data:e.data,parsedType:or(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const n=this._parse(e);if(io(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 i=this.safeParse(e,n);if(i.success)return i.data;throw i.error}safeParse(e,n){var i;const s={common:{issues:[],async:(i=n==null?void 0:n.async)!==null&&i!==void 0?i:!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:or(e)},l=this._parseSync({data:e,path:s.path,parent:s});return Vu(s,l)}async parseAsync(e,n){const i=await this.safeParseAsync(e,n);if(i.success)return i.data;throw i.error}async safeParseAsync(e,n){const i={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:or(e)},s=this._parse({data:e,path:i.path,parent:i}),l=await(io(s)?s:Promise.resolve(s));return Vu(i,l)}refine(e,n){const i=s=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(s):n;return this._refinement((s,l)=>{const d=e(s),u=()=>l.addIssue({code:J.custom,...i(s)});return typeof Promise<"u"&&d instanceof Promise?d.then(p=>p?!0:(u(),!1)):d?!0:(u(),!1)})}refinement(e,n){return this._refinement((i,s)=>e(i)?!0:(s.addIssue(typeof n=="function"?n(i,s):n),!1))}_refinement(e){return new ln({schema:this,typeName:ye.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return Bn.create(this,this._def)}nullable(){return dr.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return an.create(this,this._def)}promise(){return ai.create(this,this._def)}or(e){return uo.create([this,e],this._def)}and(e){return po.create(this,e,this._def)}transform(e){return new ln({...Ee(this._def),schema:this,typeName:ye.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new yo({...Ee(this._def),innerType:this,defaultValue:n,typeName:ye.ZodDefault})}brand(){return new bl({typeName:ye.ZodBranded,type:this,...Ee(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new vo({...Ee(this._def),innerType:this,catchValue:n,typeName:ye.ZodCatch})}describe(e){const n=this.constructor;return new n({...this._def,description:e})}pipe(e){return _o.create(this,e)}readonly(){return Co.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const $b=/^c[^\s-]{8,}$/i,Ub=/^[0-9a-z]+$/,Wb=/^[0-9A-HJKMNP-TV-Z]{26}$/,Hb=/^[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,jb=/^[a-z0-9_-]{21}$/i,qb=/^[-+]?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)?)??$/,Kb=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Yb="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Cl;const Jb=/^(?:(?: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])$/,Xb=/^(([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})))$/,Qb=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Nu="((\\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])))",ex=new RegExp(`^${Nu}$`);function Du(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 tx(t){return new RegExp(`^${Du(t)}$`)}function Fu(t){let e=`${Nu}T${Du(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 nx(t,e){return!!((e==="v4"||!e)&&Jb.test(t)||(e==="v6"||!e)&&Xb.test(t))}class sn extends Ae{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==oe.string){const s=this._getOrReturnCtx(e);return re(s,{code:J.invalid_type,expected:oe.string,received:s.parsedType}),Ce}const n=new mt;let i;for(const s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(i=this._getOrReturnCtx(e,i),re(i,{code:J.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&&(i=this._getOrReturnCtx(e,i),re(i,{code:J.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,d=e.data.length<s.value;(l||d)&&(i=this._getOrReturnCtx(e,i),l?re(i,{code:J.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):d&&re(i,{code:J.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),n.dirty())}else if(s.kind==="email")Kb.test(e.data)||(i=this._getOrReturnCtx(e,i),re(i,{validation:"email",code:J.invalid_string,message:s.message}),n.dirty());else if(s.kind==="emoji")Cl||(Cl=new RegExp(Yb,"u")),Cl.test(e.data)||(i=this._getOrReturnCtx(e,i),re(i,{validation:"emoji",code:J.invalid_string,message:s.message}),n.dirty());else if(s.kind==="uuid")Hb.test(e.data)||(i=this._getOrReturnCtx(e,i),re(i,{validation:"uuid",code:J.invalid_string,message:s.message}),n.dirty());else if(s.kind==="nanoid")jb.test(e.data)||(i=this._getOrReturnCtx(e,i),re(i,{validation:"nanoid",code:J.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid")$b.test(e.data)||(i=this._getOrReturnCtx(e,i),re(i,{validation:"cuid",code:J.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid2")Ub.test(e.data)||(i=this._getOrReturnCtx(e,i),re(i,{validation:"cuid2",code:J.invalid_string,message:s.message}),n.dirty());else if(s.kind==="ulid")Wb.test(e.data)||(i=this._getOrReturnCtx(e,i),re(i,{validation:"ulid",code:J.invalid_string,message:s.message}),n.dirty());else if(s.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),re(i,{validation:"url",code:J.invalid_string,message:s.message}),n.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),re(i,{validation:"regex",code:J.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)||(i=this._getOrReturnCtx(e,i),re(i,{code:J.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)||(i=this._getOrReturnCtx(e,i),re(i,{code:J.invalid_string,validation:{startsWith:s.value},message:s.message}),n.dirty()):s.kind==="endsWith"?e.data.endsWith(s.value)||(i=this._getOrReturnCtx(e,i),re(i,{code:J.invalid_string,validation:{endsWith:s.value},message:s.message}),n.dirty()):s.kind==="datetime"?Fu(s).test(e.data)||(i=this._getOrReturnCtx(e,i),re(i,{code:J.invalid_string,validation:"datetime",message:s.message}),n.dirty()):s.kind==="date"?ex.test(e.data)||(i=this._getOrReturnCtx(e,i),re(i,{code:J.invalid_string,validation:"date",message:s.message}),n.dirty()):s.kind==="time"?tx(s).test(e.data)||(i=this._getOrReturnCtx(e,i),re(i,{code:J.invalid_string,validation:"time",message:s.message}),n.dirty()):s.kind==="duration"?qb.test(e.data)||(i=this._getOrReturnCtx(e,i),re(i,{validation:"duration",code:J.invalid_string,message:s.message}),n.dirty()):s.kind==="ip"?nx(e.data,s.version)||(i=this._getOrReturnCtx(e,i),re(i,{validation:"ip",code:J.invalid_string,message:s.message}),n.dirty()):s.kind==="base64"?Qb.test(e.data)||(i=this._getOrReturnCtx(e,i),re(i,{validation:"base64",code:J.invalid_string,message:s.message}),n.dirty()):Ie.assertNever(s);return{status:n.value,value:e.data}}_regex(e,n,i){return this.refinement(s=>e.test(s),{validation:n,code:J.invalid_string,...ue.errToObj(i)})}_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,i;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:(i=e==null?void 0:e.local)!==null&&i!==void 0?i:!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:ye.ZodString,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...Ee(t)})};function rx(t,e){const n=(t.toString().split(".")[1]||"").length,i=(e.toString().split(".")[1]||"").length,s=n>i?n:i,l=parseInt(t.toFixed(s).replace(".","")),d=parseInt(e.toFixed(s).replace(".",""));return l%d/Math.pow(10,s)}class sr extends Ae{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)!==oe.number){const s=this._getOrReturnCtx(e);return re(s,{code:J.invalid_type,expected:oe.number,received:s.parsedType}),Ce}let n;const i=new mt;for(const s of this._def.checks)s.kind==="int"?Ie.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),re(n,{code:J.invalid_type,expected:"integer",received:"float",message:s.message}),i.dirty()):s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(n=this._getOrReturnCtx(e,n),re(n,{code:J.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(n=this._getOrReturnCtx(e,n),re(n,{code:J.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="multipleOf"?rx(e.data,s.value)!==0&&(n=this._getOrReturnCtx(e,n),re(n,{code:J.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),re(n,{code:J.not_finite,message:s.message}),i.dirty()):Ie.assertNever(s);return{status:i.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,i,s){return new sr({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:i,message:ue.toString(s)}]})}_addCheck(e){return new sr({...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 i of this._def.checks){if(i.kind==="finite"||i.kind==="int"||i.kind==="multipleOf")return!0;i.kind==="min"?(n===null||i.value>n)&&(n=i.value):i.kind==="max"&&(e===null||i.value<e)&&(e=i.value)}return Number.isFinite(n)&&Number.isFinite(e)}}sr.create=t=>new sr({checks:[],typeName:ye.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...Ee(t)});class ar extends Ae{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)!==oe.bigint){const s=this._getOrReturnCtx(e);return re(s,{code:J.invalid_type,expected:oe.bigint,received:s.parsedType}),Ce}let n;const i=new mt;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:J.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(n=this._getOrReturnCtx(e,n),re(n,{code:J.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="multipleOf"?e.data%s.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),re(n,{code:J.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):Ie.assertNever(s);return{status:i.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,i,s){return new ar({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:i,message:ue.toString(s)}]})}_addCheck(e){return new ar({...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}}ar.create=t=>{var e;return new ar({checks:[],typeName:ye.ZodBigInt,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...Ee(t)})};class ao extends Ae{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==oe.boolean){const n=this._getOrReturnCtx(e);return re(n,{code:J.invalid_type,expected:oe.boolean,received:n.parsedType}),Ce}return wt(e.data)}}ao.create=t=>new ao({typeName:ye.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...Ee(t)});class Vr extends Ae{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==oe.date){const s=this._getOrReturnCtx(e);return re(s,{code:J.invalid_type,expected:oe.date,received:s.parsedType}),Ce}if(isNaN(e.data.getTime())){const s=this._getOrReturnCtx(e);return re(s,{code:J.invalid_date}),Ce}const n=new mt;let i;for(const s of this._def.checks)s.kind==="min"?e.data.getTime()<s.value&&(i=this._getOrReturnCtx(e,i),re(i,{code:J.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),n.dirty()):s.kind==="max"?e.data.getTime()>s.value&&(i=this._getOrReturnCtx(e,i),re(i,{code:J.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),n.dirty()):Ie.assertNever(s);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Vr({...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}}Vr.create=t=>new Vr({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:ye.ZodDate,...Ee(t)});class gs extends Ae{_parse(e){if(this._getType(e)!==oe.symbol){const n=this._getOrReturnCtx(e);return re(n,{code:J.invalid_type,expected:oe.symbol,received:n.parsedType}),Ce}return wt(e.data)}}gs.create=t=>new gs({typeName:ye.ZodSymbol,...Ee(t)});class lo extends Ae{_parse(e){if(this._getType(e)!==oe.undefined){const n=this._getOrReturnCtx(e);return re(n,{code:J.invalid_type,expected:oe.undefined,received:n.parsedType}),Ce}return wt(e.data)}}lo.create=t=>new lo({typeName:ye.ZodUndefined,...Ee(t)});class co extends Ae{_parse(e){if(this._getType(e)!==oe.null){const n=this._getOrReturnCtx(e);return re(n,{code:J.invalid_type,expected:oe.null,received:n.parsedType}),Ce}return wt(e.data)}}co.create=t=>new co({typeName:ye.ZodNull,...Ee(t)});class ii extends Ae{constructor(){super(...arguments),this._any=!0}_parse(e){return wt(e.data)}}ii.create=t=>new ii({typeName:ye.ZodAny,...Ee(t)});class Nr extends Ae{constructor(){super(...arguments),this._unknown=!0}_parse(e){return wt(e.data)}}Nr.create=t=>new Nr({typeName:ye.ZodUnknown,...Ee(t)});class In extends Ae{_parse(e){const n=this._getOrReturnCtx(e);return re(n,{code:J.invalid_type,expected:oe.never,received:n.parsedType}),Ce}}In.create=t=>new In({typeName:ye.ZodNever,...Ee(t)});class ys extends Ae{_parse(e){if(this._getType(e)!==oe.undefined){const n=this._getOrReturnCtx(e);return re(n,{code:J.invalid_type,expected:oe.void,received:n.parsedType}),Ce}return wt(e.data)}}ys.create=t=>new ys({typeName:ye.ZodVoid,...Ee(t)});class an extends Ae{_parse(e){const{ctx:n,status:i}=this._processInputParams(e),s=this._def;if(n.parsedType!==oe.array)return re(n,{code:J.invalid_type,expected:oe.array,received:n.parsedType}),Ce;if(s.exactLength!==null){const d=n.data.length>s.exactLength.value,u=n.data.length<s.exactLength.value;(d||u)&&(re(n,{code:d?J.too_big:J.too_small,minimum:u?s.exactLength.value:void 0,maximum:d?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),i.dirty())}if(s.minLength!==null&&n.data.length<s.minLength.value&&(re(n,{code:J.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),i.dirty()),s.maxLength!==null&&n.data.length>s.maxLength.value&&(re(n,{code:J.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),i.dirty()),n.common.async)return Promise.all([...n.data].map((d,u)=>s.type._parseAsync(new En(n,d,n.path,u)))).then(d=>mt.mergeArray(i,d));const l=[...n.data].map((d,u)=>s.type._parseSync(new En(n,d,n.path,u)));return mt.mergeArray(i,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:ye.ZodArray,...Ee(e)});function oi(t){if(t instanceof Ye){const e={};for(const n in t.shape){const i=t.shape[n];e[n]=Bn.create(oi(i))}return new Ye({...t._def,shape:()=>e})}else return t instanceof an?new an({...t._def,type:oi(t.element)}):t instanceof Bn?Bn.create(oi(t.unwrap())):t instanceof dr?dr.create(oi(t.unwrap())):t instanceof Tn?Tn.create(t.items.map(e=>oi(e))):t}class Ye extends Ae{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)!==oe.object){const p=this._getOrReturnCtx(e);return re(p,{code:J.invalid_type,expected:oe.object,received:p.parsedType}),Ce}const{status:n,ctx:i}=this._processInputParams(e),{shape:s,keys:l}=this._getCached(),d=[];if(!(this._def.catchall instanceof In&&this._def.unknownKeys==="strip"))for(const p in i.data)l.includes(p)||d.push(p);const u=[];for(const p of l){const f=s[p],m=i.data[p];u.push({key:{status:"valid",value:p},value:f._parse(new En(i,m,i.path,p)),alwaysSet:p in i.data})}if(this._def.catchall instanceof In){const p=this._def.unknownKeys;if(p==="passthrough")for(const f of d)u.push({key:{status:"valid",value:f},value:{status:"valid",value:i.data[f]}});else if(p==="strict")d.length>0&&(re(i,{code:J.unrecognized_keys,keys:d}),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 d){const m=i.data[f];u.push({key:{status:"valid",value:f},value:p._parse(new En(i,m,i.path,f)),alwaysSet:f in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const p=[];for(const f of u){const m=await f.key,v=await f.value;p.push({key:m,value:v,alwaysSet:f.alwaysSet})}return p}).then(p=>mt.mergeObjectSync(n,p)):mt.mergeObjectSync(n,u)}get shape(){return this._def.shape()}strict(e){return ue.errToObj,new Ye({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,i)=>{var s,l,d,u;const p=(d=(l=(s=this._def).errorMap)===null||l===void 0?void 0:l.call(s,n,i).message)!==null&&d!==void 0?d:i.defaultError;return n.code==="unrecognized_keys"?{message:(u=ue.errToObj(e).message)!==null&&u!==void 0?u:p}:{message:p}}}:{}})}strip(){return new Ye({...this._def,unknownKeys:"strip"})}passthrough(){return new Ye({...this._def,unknownKeys:"passthrough"})}extend(e){return new Ye({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Ye({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:ye.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new Ye({...this._def,catchall:e})}pick(e){const n={};return Ie.objectKeys(e).forEach(i=>{e[i]&&this.shape[i]&&(n[i]=this.shape[i])}),new Ye({...this._def,shape:()=>n})}omit(e){const n={};return Ie.objectKeys(this.shape).forEach(i=>{e[i]||(n[i]=this.shape[i])}),new Ye({...this._def,shape:()=>n})}deepPartial(){return oi(this)}partial(e){const n={};return Ie.objectKeys(this.shape).forEach(i=>{const s=this.shape[i];e&&!e[i]?n[i]=s:n[i]=s.optional()}),new Ye({...this._def,shape:()=>n})}required(e){const n={};return Ie.objectKeys(this.shape).forEach(i=>{if(e&&!e[i])n[i]=this.shape[i];else{let s=this.shape[i];for(;s instanceof Bn;)s=s._def.innerType;n[i]=s}}),new Ye({...this._def,shape:()=>n})}keyof(){return Ru(Ie.objectKeys(this.shape))}}Ye.create=(t,e)=>new Ye({shape:()=>t,unknownKeys:"strip",catchall:In.create(),typeName:ye.ZodObject,...Ee(e)}),Ye.strictCreate=(t,e)=>new Ye({shape:()=>t,unknownKeys:"strict",catchall:In.create(),typeName:ye.ZodObject,...Ee(e)}),Ye.lazycreate=(t,e)=>new Ye({shape:t,unknownKeys:"strip",catchall:In.create(),typeName:ye.ZodObject,...Ee(e)});class uo extends Ae{_parse(e){const{ctx:n}=this._processInputParams(e),i=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 d=l.map(u=>new Rt(u.ctx.common.issues));return re(n,{code:J.invalid_union,unionErrors:d}),Ce}if(n.common.async)return Promise.all(i.map(async l=>{const d={...n,common:{...n.common,issues:[]},parent:null};return{result:await l._parseAsync({data:n.data,path:n.path,parent:d}),ctx:d}})).then(s);{let l;const d=[];for(const p of i){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&&d.push(f.common.issues)}if(l)return n.common.issues.push(...l.ctx.common.issues),l.result;const u=d.map(p=>new Rt(p));return re(n,{code:J.invalid_union,unionErrors:u}),Ce}}get options(){return this._def.options}}uo.create=(t,e)=>new uo({options:t,typeName:ye.ZodUnion,...Ee(e)});const lr=t=>t instanceof fo?lr(t.schema):t instanceof ln?lr(t.innerType()):t instanceof mo?[t.value]:t instanceof cr?t.options:t instanceof go?Ie.objectValues(t.enum):t instanceof yo?lr(t._def.innerType):t instanceof lo?[void 0]:t instanceof co?[null]:t instanceof Bn?[void 0,...lr(t.unwrap())]:t instanceof dr?[null,...lr(t.unwrap())]:t instanceof bl||t instanceof Co?lr(t.unwrap()):t instanceof vo?lr(t._def.innerType):[];class vs extends Ae{_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==oe.object)return re(n,{code:J.invalid_type,expected:oe.object,received:n.parsedType}),Ce;const i=this.discriminator,s=n.data[i],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:J.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[i]}),Ce)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,i){const s=new Map;for(const l of n){const d=lr(l.shape[e]);if(!d.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const u of d){if(s.has(u))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(u)}`);s.set(u,l)}}return new vs({typeName:ye.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:s,...Ee(i)})}}function wl(t,e){const n=or(t),i=or(e);if(t===e)return{valid:!0,data:t};if(n===oe.object&&i===oe.object){const s=Ie.objectKeys(e),l=Ie.objectKeys(t).filter(u=>s.indexOf(u)!==-1),d={...t,...e};for(const u of l){const p=wl(t[u],e[u]);if(!p.valid)return{valid:!1};d[u]=p.data}return{valid:!0,data:d}}else if(n===oe.array&&i===oe.array){if(t.length!==e.length)return{valid:!1};const s=[];for(let l=0;l<t.length;l++){const d=t[l],u=e[l],p=wl(d,u);if(!p.valid)return{valid:!1};s.push(p.data)}return{valid:!0,data:s}}else return n===oe.date&&i===oe.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class po extends Ae{_parse(e){const{status:n,ctx:i}=this._processInputParams(e),s=(l,d)=>{if(vl(l)||vl(d))return Ce;const u=wl(l.value,d.value);return u.valid?((_l(l)||_l(d))&&n.dirty(),{status:n.value,value:u.data}):(re(i,{code:J.invalid_intersection_types}),Ce)};return i.common.async?Promise.all([this._def.left._parseAsync({data:i.data,path:i.path,parent:i}),this._def.right._parseAsync({data:i.data,path:i.path,parent:i})]).then(([l,d])=>s(l,d)):s(this._def.left._parseSync({data:i.data,path:i.path,parent:i}),this._def.right._parseSync({data:i.data,path:i.path,parent:i}))}}po.create=(t,e,n)=>new po({left:t,right:e,typeName:ye.ZodIntersection,...Ee(n)});class Tn extends Ae{_parse(e){const{status:n,ctx:i}=this._processInputParams(e);if(i.parsedType!==oe.array)return re(i,{code:J.invalid_type,expected:oe.array,received:i.parsedType}),Ce;if(i.data.length<this._def.items.length)return re(i,{code:J.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Ce;!this._def.rest&&i.data.length>this._def.items.length&&(re(i,{code:J.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const s=[...i.data].map((l,d)=>{const u=this._def.items[d]||this._def.rest;return u?u._parse(new En(i,l,i.path,d)):null}).filter(l=>!!l);return i.common.async?Promise.all(s).then(l=>mt.mergeArray(n,l)):mt.mergeArray(n,s)}get items(){return this._def.items}rest(e){return new Tn({...this._def,rest:e})}}Tn.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Tn({items:t,typeName:ye.ZodTuple,rest:null,...Ee(e)})};class ho extends Ae{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:i}=this._processInputParams(e);if(i.parsedType!==oe.object)return re(i,{code:J.invalid_type,expected:oe.object,received:i.parsedType}),Ce;const s=[],l=this._def.keyType,d=this._def.valueType;for(const u in i.data)s.push({key:l._parse(new En(i,u,i.path,u)),value:d._parse(new En(i,i.data[u],i.path,u)),alwaysSet:u in i.data});return i.common.async?mt.mergeObjectAsync(n,s):mt.mergeObjectSync(n,s)}get element(){return this._def.valueType}static create(e,n,i){return n instanceof Ae?new ho({keyType:e,valueType:n,typeName:ye.ZodRecord,...Ee(i)}):new ho({keyType:sn.create(),valueType:e,typeName:ye.ZodRecord,...Ee(n)})}}class _s extends Ae{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:i}=this._processInputParams(e);if(i.parsedType!==oe.map)return re(i,{code:J.invalid_type,expected:oe.map,received:i.parsedType}),Ce;const s=this._def.keyType,l=this._def.valueType,d=[...i.data.entries()].map(([u,p],f)=>({key:s._parse(new En(i,u,i.path,[f,"key"])),value:l._parse(new En(i,p,i.path,[f,"value"]))}));if(i.common.async){const u=new Map;return Promise.resolve().then(async()=>{for(const p of d){const f=await p.key,m=await p.value;if(f.status==="aborted"||m.status==="aborted")return Ce;(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 d){const f=p.key,m=p.value;if(f.status==="aborted"||m.status==="aborted")return Ce;(f.status==="dirty"||m.status==="dirty")&&n.dirty(),u.set(f.value,m.value)}return{status:n.value,value:u}}}}_s.create=(t,e,n)=>new _s({valueType:e,keyType:t,typeName:ye.ZodMap,...Ee(n)});class Dr extends Ae{_parse(e){const{status:n,ctx:i}=this._processInputParams(e);if(i.parsedType!==oe.set)return re(i,{code:J.invalid_type,expected:oe.set,received:i.parsedType}),Ce;const s=this._def;s.minSize!==null&&i.data.size<s.minSize.value&&(re(i,{code:J.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),n.dirty()),s.maxSize!==null&&i.data.size>s.maxSize.value&&(re(i,{code:J.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),n.dirty());const l=this._def.valueType;function d(p){const f=new Set;for(const m of p){if(m.status==="aborted")return Ce;m.status==="dirty"&&n.dirty(),f.add(m.value)}return{status:n.value,value:f}}const u=[...i.data.values()].map((p,f)=>l._parse(new En(i,p,i.path,f)));return i.common.async?Promise.all(u).then(p=>d(p)):d(u)}min(e,n){return new Dr({...this._def,minSize:{value:e,message:ue.toString(n)}})}max(e,n){return new Dr({...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)}}Dr.create=(t,e)=>new Dr({valueType:t,minSize:null,maxSize:null,typeName:ye.ZodSet,...Ee(e)});class si extends Ae{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==oe.function)return re(n,{code:J.invalid_type,expected:oe.function,received:n.parsedType}),Ce;function i(u,p){return hs({data:u,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,ps(),ri].filter(f=>!!f),issueData:{code:J.invalid_arguments,argumentsError:p}})}function s(u,p){return hs({data:u,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,ps(),ri].filter(f=>!!f),issueData:{code:J.invalid_return_type,returnTypeError:p}})}const l={errorMap:n.common.contextualErrorMap},d=n.data;if(this._def.returns instanceof ai){const u=this;return wt(async function(...p){const f=new Rt([]),m=await u._def.args.parseAsync(p,l).catch(S=>{throw f.addIssue(i(p,S)),f}),v=await Reflect.apply(d,this,m);return await u._def.returns._def.type.parseAsync(v,l).catch(S=>{throw f.addIssue(s(v,S)),f})})}else{const u=this;return wt(function(...p){const f=u._def.args.safeParse(p,l);if(!f.success)throw new Rt([i(p,f.error)]);const m=Reflect.apply(d,this,f.data),v=u._def.returns.safeParse(m,l);if(!v.success)throw new Rt([s(m,v.error)]);return v.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new si({...this._def,args:Tn.create(e).rest(Nr.create())})}returns(e){return new si({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,n,i){return new si({args:e||Tn.create([]).rest(Nr.create()),returns:n||Nr.create(),typeName:ye.ZodFunction,...Ee(i)})}}class fo extends Ae{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})}}fo.create=(t,e)=>new fo({getter:t,typeName:ye.ZodLazy,...Ee(e)});class mo extends Ae{_parse(e){if(e.data!==this._def.value){const n=this._getOrReturnCtx(e);return re(n,{received:n.data,code:J.invalid_literal,expected:this._def.value}),Ce}return{status:"valid",value:e.data}}get value(){return this._def.value}}mo.create=(t,e)=>new mo({value:t,typeName:ye.ZodLiteral,...Ee(e)});function Ru(t,e){return new cr({values:t,typeName:ye.ZodEnum,...Ee(e)})}class cr extends Ae{constructor(){super(...arguments),oo.set(this,void 0)}_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),i=this._def.values;return re(n,{expected:Ie.joinValues(i),received:n.parsedType,code:J.invalid_type}),Ce}if(ms(this,oo)||Pu(this,oo,new Set(this._def.values)),!ms(this,oo).has(e.data)){const n=this._getOrReturnCtx(e),i=this._def.values;return re(n,{received:n.data,code:J.invalid_enum_value,options:i}),Ce}return wt(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 cr.create(e,{...this._def,...n})}exclude(e,n=this._def){return cr.create(this.options.filter(i=>!e.includes(i)),{...this._def,...n})}}oo=new WeakMap,cr.create=Ru;class go extends Ae{constructor(){super(...arguments),so.set(this,void 0)}_parse(e){const n=Ie.getValidEnumValues(this._def.values),i=this._getOrReturnCtx(e);if(i.parsedType!==oe.string&&i.parsedType!==oe.number){const s=Ie.objectValues(n);return re(i,{expected:Ie.joinValues(s),received:i.parsedType,code:J.invalid_type}),Ce}if(ms(this,so)||Pu(this,so,new Set(Ie.getValidEnumValues(this._def.values))),!ms(this,so).has(e.data)){const s=Ie.objectValues(n);return re(i,{received:i.data,code:J.invalid_enum_value,options:s}),Ce}return wt(e.data)}get enum(){return this._def.values}}so=new WeakMap,go.create=(t,e)=>new go({values:t,typeName:ye.ZodNativeEnum,...Ee(e)});class ai extends Ae{unwrap(){return this._def.type}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==oe.promise&&n.common.async===!1)return re(n,{code:J.invalid_type,expected:oe.promise,received:n.parsedType}),Ce;const i=n.parsedType===oe.promise?n.data:Promise.resolve(n.data);return wt(i.then(s=>this._def.type.parseAsync(s,{path:n.path,errorMap:n.common.contextualErrorMap})))}}ai.create=(t,e)=>new ai({type:t,typeName:ye.ZodPromise,...Ee(e)});class ln extends Ae{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ye.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:n,ctx:i}=this._processInputParams(e),s=this._def.effect||null,l={addIssue:d=>{re(i,d),d.fatal?n.abort():n.dirty()},get path(){return i.path}};if(l.addIssue=l.addIssue.bind(l),s.type==="preprocess"){const d=s.transform(i.data,l);if(i.common.async)return Promise.resolve(d).then(async u=>{if(n.value==="aborted")return Ce;const p=await this._def.schema._parseAsync({data:u,path:i.path,parent:i});return p.status==="aborted"?Ce:p.status==="dirty"||n.value==="dirty"?fs(p.value):p});{if(n.value==="aborted")return Ce;const u=this._def.schema._parseSync({data:d,path:i.path,parent:i});return u.status==="aborted"?Ce:u.status==="dirty"||n.value==="dirty"?fs(u.value):u}}if(s.type==="refinement"){const d=u=>{const p=s.refinement(u,l);if(i.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(i.common.async===!1){const u=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});return u.status==="aborted"?Ce:(u.status==="dirty"&&n.dirty(),d(u.value),{status:n.value,value:u.value})}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(u=>u.status==="aborted"?Ce:(u.status==="dirty"&&n.dirty(),d(u.value).then(()=>({status:n.value,value:u.value}))))}if(s.type==="transform")if(i.common.async===!1){const d=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});if(!ro(d))return d;const u=s.transform(d.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:i.data,path:i.path,parent:i}).then(d=>ro(d)?Promise.resolve(s.transform(d.value,l)).then(u=>({status:n.value,value:u})):d);Ie.assertNever(s)}}ln.create=(t,e,n)=>new ln({schema:t,typeName:ye.ZodEffects,effect:e,...Ee(n)}),ln.createWithPreprocess=(t,e,n)=>new ln({schema:e,effect:{type:"preprocess",transform:t},typeName:ye.ZodEffects,...Ee(n)});class Bn extends Ae{_parse(e){return this._getType(e)===oe.undefined?wt(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Bn.create=(t,e)=>new Bn({innerType:t,typeName:ye.ZodOptional,...Ee(e)});class dr extends Ae{_parse(e){return this._getType(e)===oe.null?wt(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}dr.create=(t,e)=>new dr({innerType:t,typeName:ye.ZodNullable,...Ee(e)});class yo extends Ae{_parse(e){const{ctx:n}=this._processInputParams(e);let i=n.data;return n.parsedType===oe.undefined&&(i=this._def.defaultValue()),this._def.innerType._parse({data:i,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}yo.create=(t,e)=>new yo({innerType:t,typeName:ye.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Ee(e)});class vo extends Ae{_parse(e){const{ctx:n}=this._processInputParams(e),i={...n,common:{...n.common,issues:[]}},s=this._def.innerType._parse({data:i.data,path:i.path,parent:{...i}});return io(s)?s.then(l=>({status:"valid",value:l.status==="valid"?l.value:this._def.catchValue({get error(){return new Rt(i.common.issues)},input:i.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Rt(i.common.issues)},input:i.data})}}removeCatch(){return this._def.innerType}}vo.create=(t,e)=>new vo({innerType:t,typeName:ye.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Ee(e)});class Cs extends Ae{_parse(e){if(this._getType(e)!==oe.nan){const n=this._getOrReturnCtx(e);return re(n,{code:J.invalid_type,expected:oe.nan,received:n.parsedType}),Ce}return{status:"valid",value:e.data}}}Cs.create=t=>new Cs({typeName:ye.ZodNaN,...Ee(t)});const ix=Symbol("zod_brand");class bl extends Ae{_parse(e){const{ctx:n}=this._processInputParams(e),i=n.data;return this._def.type._parse({data:i,path:n.path,parent:n})}unwrap(){return this._def.type}}class _o extends Ae{_parse(e){const{status:n,ctx:i}=this._processInputParams(e);if(i.common.async)return(async()=>{const s=await this._def.in._parseAsync({data:i.data,path:i.path,parent:i});return s.status==="aborted"?Ce:s.status==="dirty"?(n.dirty(),fs(s.value)):this._def.out._parseAsync({data:s.value,path:i.path,parent:i})})();{const s=this._def.in._parseSync({data:i.data,path:i.path,parent:i});return s.status==="aborted"?Ce:s.status==="dirty"?(n.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:i.path,parent:i})}}static create(e,n){return new _o({in:e,out:n,typeName:ye.ZodPipeline})}}class Co extends Ae{_parse(e){const n=this._def.innerType._parse(e),i=s=>(ro(s)&&(s.value=Object.freeze(s.value)),s);return io(n)?n.then(s=>i(s)):i(n)}unwrap(){return this._def.innerType}}Co.create=(t,e)=>new Co({innerType:t,typeName:ye.ZodReadonly,...Ee(e)});function Mu(t,e={},n){return t?ii.create().superRefine((i,s)=>{var l,d;if(!t(i)){const u=typeof e=="function"?e(i):typeof e=="string"?{message:e}:e,p=(d=(l=u.fatal)!==null&&l!==void 0?l:n)!==null&&d!==void 0?d:!0,f=typeof u=="string"?{message:u}:u;s.addIssue({code:"custom",...f,fatal:p})}}):ii.create()}const ox={object:Ye.lazycreate};var ye;(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"})(ye||(ye={}));const sx=(t,e={message:`Input not instance of ${t.name}`})=>Mu(n=>n instanceof t,e),Iu=sn.create,Lu=sr.create,ax=Cs.create,lx=ar.create,Ou=ao.create,cx=Vr.create,dx=gs.create,ux=lo.create,px=co.create,hx=ii.create,fx=Nr.create,mx=In.create,gx=ys.create,yx=an.create,vx=Ye.create,_x=Ye.strictCreate,Cx=uo.create,wx=vs.create,bx=po.create,xx=Tn.create,kx=ho.create,Sx=_s.create,Ex=Dr.create,Tx=si.create,Bx=fo.create,Ax=mo.create,Px=cr.create,Vx=go.create,Nx=ai.create,Gu=ln.create,Dx=Bn.create,Fx=dr.create,Rx=ln.createWithPreprocess,Mx=_o.create;var ws=Object.freeze({__proto__:null,defaultErrorMap:ri,setErrorMap:zb,getErrorMap:ps,makeIssue:hs,EMPTY_PATH:Zb,addIssueToContext:re,ParseStatus:mt,INVALID:Ce,DIRTY:fs,OK:wt,isAborted:vl,isDirty:_l,isValid:ro,isAsync:io,get util(){return Ie},get objectUtil(){return yl},ZodParsedType:oe,getParsedType:or,ZodType:Ae,datetimeRegex:Fu,ZodString:sn,ZodNumber:sr,ZodBigInt:ar,ZodBoolean:ao,ZodDate:Vr,ZodSymbol:gs,ZodUndefined:lo,ZodNull:co,ZodAny:ii,ZodUnknown:Nr,ZodNever:In,ZodVoid:ys,ZodArray:an,ZodObject:Ye,ZodUnion:uo,ZodDiscriminatedUnion:vs,ZodIntersection:po,ZodTuple:Tn,ZodRecord:ho,ZodMap:_s,ZodSet:Dr,ZodFunction:si,ZodLazy:fo,ZodLiteral:mo,ZodEnum:cr,ZodNativeEnum:go,ZodPromise:ai,ZodEffects:ln,ZodTransformer:ln,ZodOptional:Bn,ZodNullable:dr,ZodDefault:yo,ZodCatch:vo,ZodNaN:Cs,BRAND:ix,ZodBranded:bl,ZodPipeline:_o,ZodReadonly:Co,custom:Mu,Schema:Ae,ZodSchema:Ae,late:ox,get ZodFirstPartyTypeKind(){return ye},coerce:{string:t=>sn.create({...t,coerce:!0}),number:t=>sr.create({...t,coerce:!0}),boolean:t=>ao.create({...t,coerce:!0}),bigint:t=>ar.create({...t,coerce:!0}),date:t=>Vr.create({...t,coerce:!0})},any:hx,array:yx,bigint:lx,boolean:Ou,date:cx,discriminatedUnion:wx,effect:Gu,enum:Px,function:Tx,instanceof:sx,intersection:bx,lazy:Bx,literal:Ax,map:Sx,nan:ax,nativeEnum:Vx,never:mx,null:px,nullable:Fx,number:Lu,object:vx,oboolean:()=>Ou().optional(),onumber:()=>Lu().optional(),optional:Dx,ostring:()=>Iu().optional(),pipeline:Mx,preprocess:Rx,promise:Nx,record:kx,set:Ex,strictObject:_x,string:Iu,symbol:dx,transformer:Gu,tuple:xx,undefined:ux,union:Cx,unknown:fx,void:gx,NEVER:Ce,ZodIssueCode:J,quotelessJson:Gb,ZodError:Rt});function Ix(t){throw new Error("Unexpected object: "+t)}const zu="upload://upload/",Zu="index://index/";function Lx(t){return t.startsWith(zu)}function Ox(t){return t.startsWith(Zu)}function Gx(t){if(Ox(t)){const e=t.slice(Zu.length);return JSON.parse(decodeURIComponent(e)).path}else if(Lx(t)){const e=t.slice(zu.length);return JSON.parse(decodeURIComponent(e)).localPath}Ix(t)}ws.object({__isRef:ws.literal(!0).describe("Crucial marker for the block dependency tree reconstruction"),blockId:ws.string().describe("Upstream block id"),name:ws.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 zx(t){return t.replace(/^.*[\\/]/,"")}const Zx={key:0,ref:"label"},$x={key:0,class:"required-icon"},Ux=["data-placeholder"],Wx={key:5,class:"pl-file-input__stats"},Hx={key:0,class:"pl-file-input__error"},jx={key:1,class:"upl-file-input__helper"},$u=r.defineComponent({__name:"PlFileInput",props:{modelValue:{},label:{default:void 0},required:{type:Boolean},dashed:{type:Boolean},extensions:{default:void 0},fileDialogTitle:{default:void 0},placeholder:{default:void 0},progress:{default:void 0},error:{default:void 0},helper:{default:void 0},showFilenameOnly:{type:Boolean},cellStyle:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{emit:e}){const n=r.reactive({fileDialogOpen:!1}),i=r.useSlots(),s=e,l=t,d=r.computed(()=>{if(l.modelValue)try{const k=Gx(l.modelValue).trim();return l.showFilenameOnly?zx(k):k}catch(k){return console.error(k),l.modelValue}return""}),u=r.computed(()=>l.progress&&!l.progress.done),p=r.computed(()=>l.progress&&l.progress.done),f=r.computed(()=>l.error),m=r.computed(()=>l.error),v=r.computed(()=>{const{status:k,done:D}=l.progress??{};return!k||!k.bytesTotal?"":k.bytesProcessed&&!D?Ka(k.bytesProcessed,{})+" / "+Ka(k.bytesTotal,{}):Ka(k.bytesTotal,{})}),S=r.computed(()=>{var k;const{progress:D}=l;return D?{width:D.done?"100%":Math.round((((k=D.status)==null?void 0:k.progress)??0)*100)+"%"}:{}}),x=()=>{n.fileDialogOpen=!0},F=k=>{k.files.length&&s("update:modelValue",k.files[0])},T=()=>s("update:modelValue",void 0),A=r.ref();return l.cellStyle||Rn(A),(k,D)=>(r.openBlock(),r.createElementBlock(r.Fragment,null,[r.createElementVNode("div",{class:r.normalizeClass([{"pl-file-input__cell-style":!!k.cellStyle,"has-file":!!d.value},"pl-file-input__envelope"])},[r.createElementVNode("div",{ref_key:"rootRef",ref:A,class:r.normalizeClass(["pl-file-input",{dashed:k.dashed,error:f.value}]),tabindex:"0",onKeyup:r.withKeys(x,["enter"])},[r.createElementVNode("div",{class:"pl-file-input__progress",style:r.normalizeStyle(S.value)},null,4),D[3]||(D[3]=r.createTextVNode()),!k.cellStyle&&k.label?(r.openBlock(),r.createElementBlock("label",Zx,[k.required?(r.openBlock(),r.createElementBlock("i",$x)):r.createCommentVNode("",!0),D[1]||(D[1]=r.createTextVNode()),r.createElementVNode("span",null,r.toDisplayString(k.label),1),D[2]||(D[2]=r.createTextVNode()),r.unref(i).tooltip?(r.openBlock(),r.createBlock(r.unref(Tt),{key:1,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.renderSlot(k.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)],512)):r.createCommentVNode("",!0),D[4]||(D[4]=r.createTextVNode()),f.value?(r.openBlock(),r.createBlock(r.unref(Mn),{key:1,name:"restart"})):u.value?(r.openBlock(),r.createBlock(r.unref(Mn),{key:2,name:"cloud-upload"})):p.value?(r.openBlock(),r.createBlock(r.unref(Mn),{key:3,name:"success"})):(r.openBlock(),r.createBlock(r.unref(Mn),{key:4,name:"paper-clip"})),D[5]||(D[5]=r.createTextVNode()),r.createElementVNode("div",{"data-placeholder":k.placeholder??"Choose file",class:"pl-file-input__filename",onClick:r.withModifiers(x,["stop"])},r.toDisplayString(d.value),9,Ux),D[6]||(D[6]=r.createTextVNode()),v.value?(r.openBlock(),r.createElementBlock("div",Wx,r.toDisplayString(v.value),1)):r.createCommentVNode("",!0),D[7]||(D[7]=r.createTextVNode()),k.modelValue?(r.openBlock(),r.createBlock(r.unref(Mn),{key:6,name:"close",onClick:r.withModifiers(T,["stop"])})):r.createCommentVNode("",!0),D[8]||(D[8]=r.createTextVNode()),r.createVNode(ir,{class:"pl-file-input__contour"})],34),D[9]||(D[9]=r.createTextVNode()),f.value?(r.openBlock(),r.createElementBlock("div",Hx,r.toDisplayString(m.value),1)):k.helper?(r.openBlock(),r.createElementBlock("div",jx,r.toDisplayString(k.helper),1)):r.createCommentVNode("",!0)],2),D[10]||(D[10]=r.createTextVNode()),r.createVNode(r.unref(Bu),{modelValue:n.fileDialogOpen,"onUpdate:modelValue":D[0]||(D[0]=$=>n.fileDialogOpen=$),extensions:k.extensions,title:k.fileDialogTitle,"onImport:files":F},null,8,["modelValue","extensions","title"])],64))}}),qx={class:"pl-notification-alert__wrapper d-flex"},Kx={class:"pl-notification-alert__content flex-grow-1"},Yx={key:0,class:"pl-notification-alert__close"},Jx={key:0,class:"pl-notification-alert__actions d-flex"},Uu=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 i(){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",qx,[r.createElementVNode("div",Kx,[r.renderSlot(s.$slots,"default")]),l[0]||(l[0]=r.createTextVNode()),s.closable?(r.openBlock(),r.createElementBlock("div",Yx,[r.createVNode(r.unref(sl),{icon:"close",onClick:i})])):r.createCommentVNode("",!0)]),l[1]||(l[1]=r.createTextVNode()),s.$slots.actions?(r.openBlock(),r.createElementBlock("div",Jx,[r.renderSlot(s.$slots,"actions")])):r.createCommentVNode("",!0)],6)):r.createCommentVNode("",!0)}}),Wu=r.defineComponent({__name:"PlCopyData",emits:["copy"],setup(t,{emit:e}){const n=e,i=r.ref(!1),s=r.computed(()=>i.value?"mask-clipboard-copied":"mask-clipboard");function l(){i.value=!0,setTimeout(()=>i.value=!1,700),n("copy")}return(d,u)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass([s.value,"mask-24"]),onClick:l},null,2))}}),Xx=r.defineComponent({__name:"ContextProvider",props:{context:{},contextKey:{}},setup(t){const e=t;return r.provide(e.contextKey,r.computed(()=>e.context)),(n,i)=>r.renderSlot(n.$slots,"default")}});function gt(t,e,n){return e>t?e:t>n?n:t}const xl=t=>r.computed(()=>{const e=[100],{min:n,max:i,step:s}=t.value;let l=n;for(;l<i;){l+=s;const d=(1-(gt(l,n,i)-n)/(i-n))*100;e.push(d)}return e}),Qx={class:"ui-slider__wrapper"},ek={class:"ui-slider__label-section"},tk={key:0,class:"text-s"},nk={key:1,class:"ui-slider__value-static text-s"},rk={class:"ui-slider__base"},ik={class:"ui-slider__container"},ok={class:"ui-slider__container ui-slider__container-thumb"},sk={class:"ui-slider__input-wrapper d-flex"},ak=["value"],lk={key:0,class:"ui-slider__error"},ck=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(),i=e,s=t,l=r.reactive({deltaValue:0}),d=r.computed(()=>s.max-s.min),u=r.computed(()=>gt((s.modelValue??0)+l.deltaValue,s.min,s.max)),p=r.ref(s.modelValue),f=r.computed(()=>{const L=s.modelValue;return Number.isFinite(L)?L<s.min?`Min value: ${s.min}`:L>s.max?`Max value: ${s.max}`:s.error:"Not a number"}),m=r.computed(()=>s),v=xl(m),S=r.computed(()=>(u.value-s.min)/d.value),x=r.computed(()=>({right:Math.ceil((1-S.value)*100)+"%"})),F=r.computed(()=>({right:`calc(${Math.ceil((1-S.value)*100)}%) `})),T=r.ref(),A=r.ref();r.watch(()=>s.modelValue,L=>{p.value=L});function k(L){const X=gt(L,s.min,s.max);return Math.round((X+Number.EPSILON)*(1/s.step))/(1/s.step)}rr(A,L=>{var X;it((X=r.unref(T))==null?void 0:X.getBoundingClientRect(),I=>{const{dx:N}=L;l.deltaValue=N/I.width*d.value,p.value=k(gt((s.modelValue??0)+l.deltaValue,s.min,s.max)),L.stop&&(i("update:modelValue",k(u.value)),l.deltaValue=0)})});function D(L){i("update:modelValue",k(L))}function $(L){D(+L.target.value)}function z(L){["ArrowDown","ArrowUp","ArrowRight","ArrowLeft","Enter"].includes(L.code)&&L.preventDefault();const X=L.code==="ArrowUp"||L.code==="ArrowRight"?s.step*1:L.code==="ArrowDown"||L.code==="ArrowLeft"?s.step*-1:0;D(s.modelValue+X)}return(L,X)=>(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",Qx,[r.createElementVNode("div",ek,[L.label?(r.openBlock(),r.createElementBlock("label",tk,[r.createElementVNode("span",null,r.toDisplayString(L.label),1),X[1]||(X[1]=r.createTextVNode()),r.unref(n).tooltip?(r.openBlock(),r.createBlock(r.unref(Tt),{key:0,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.renderSlot(L.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0),X[2]||(X[2]=r.createTextVNode()),s.mode==="text"?(r.openBlock(),r.createElementBlock("div",nk,r.toDisplayString(p.value)+r.toDisplayString(L.measure),1)):r.createCommentVNode("",!0)]),X[6]||(X[6]=r.createTextVNode()),r.createElementVNode("div",rk,[r.createElementVNode("div",ik,[r.createElementVNode("div",{ref_key:"barRef",ref:T,class:"ui-slider__bar"},[r.createElementVNode("div",{class:"ui-slider__progress",style:r.normalizeStyle(x.value)},null,4)],512)]),X[5]||(X[5]=r.createTextVNode()),r.createElementVNode("div",ok,[s.breakpoints?(r.openBlock(!0),r.createElementBlock(r.Fragment,{key:0},r.renderList(r.unref(v),(I,N)=>(r.openBlock(),r.createElementBlock("div",{key:N,style:r.normalizeStyle({right:`${I}%`}),class:"ui-slider__thumb-step"},null,4))),128)):r.createCommentVNode("",!0),X[4]||(X[4]=r.createTextVNode()),r.createElementVNode("div",{ref_key:"thumbRef",ref:A,tabindex:"0",class:"ui-slider__thumb ui-slider__thumb-active",style:r.normalizeStyle(F.value),onKeydown:z},X[3]||(X[3]=[r.createElementVNode("div",{class:"ui-slider__thumb-focused-contour"},null,-1)]),36)])])]),X[7]||(X[7]=r.createTextVNode()),r.createElementVNode("div",sk,[s.mode==="input"?(r.openBlock(),r.createElementBlock("input",{key:0,value:p.value,class:"ui-slider__value text-s",onChange:X[0]||(X[0]=I=>$(I))},null,40,ak)):r.createCommentVNode("",!0)])],2),X[8]||(X[8]=r.createTextVNode()),f.value?(r.openBlock(),r.createElementBlock("div",lk,r.toDisplayString(f.value),1)):r.createCommentVNode("",!0)],2))}});function dk(t,e=null,n=null){function i(u){const{scrollTop:p,scrollHeight:f,clientHeight:m}=u;if(!(f>m)||!e)return null;const v=f-p-m,S=p>e?e:0,x=v>e?m-e-S:m;return`linear-gradient(
50
+ `,m0=["innerHTML"],g0={class:"dropdown-list-item__title-container"},y0={class:"dropdown-list-item__title text-s"},v0={key:0,class:"dropdown-list-item__description text-description"},_0={key:1,class:"dropdown-list-item__icon flex-self-start"},no=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(" ")}),i=r.computed(()=>{const l=["dropdown-list-item__checkbox","flex-self-start"];return e.isSelected&&l.push("checked"),l.join(" ")}),s=r.computed(()=>e.isSelected?f0:h0);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(i.value),innerHTML:s.value},null,10,m0)):r.createCommentVNode("",!0),c[1]||(c[1]=r.createTextVNode()),r.createElementVNode("div",g0,[r.createElementVNode("div",y0,r.toDisplayString(l.option.label),1),c[0]||(c[0]=r.createTextVNode()),l.option.description?(r.openBlock(),r.createElementBlock("div",v0,r.toDisplayString(l.option.description),1)):r.createCommentVNode("",!0)]),c[2]||(c[2]=r.createTextVNode()),!e.useCheckbox&&e.isSelected?(r.openBlock(),r.createElementBlock("div",_0)):r.createCommentVNode("",!0)],2))}}),pl=r.defineComponent({__name:"LongText",setup(t){r.useCssVars(m=>({"8d68520c":c.value}));const e=r.ref(!1),n=r.ref(),i=r.ref(!1),s=r.computed(()=>i.value&&e.value?"ui-lt-animate":""),l=cu(m=>i.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=Qa(n.value,"span cannot be empty");e.value=m.clientWidth<m.scrollWidth}function p(){u(),l(!0)}function f(){l(!1)}return(m,v)=>(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))}}),Mn=r.defineComponent({__name:"PlMaskIcon24",props:{name:{},size:{}},setup(t){const e=t,n=r.computed(()=>`mask-24 mask-${e.name}`);return(i,s)=>(r.openBlock(),r.createElementBlock("i",{class:r.normalizeClass(n.value)},null,2))}}),C0={class:"pl-dropdown__envelope"},w0=["tabindex"],b0={class:"pl-dropdown__container"},x0={class:"pl-dropdown__field"},k0=["disabled","placeholder"],S0={class:"pl-dropdown__controls"},E0={key:0},T0={key:0,class:"required-icon"},B0={key:0,class:"nothing-found"},A0={key:0,class:"pl-dropdown__error"},P0={key:1,class:"pl-dropdown__helper"},V0={key:2,class:"pl-dropdown__helper"},N0={name:"PlDropdown"},hl=r.defineComponent({...N0,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,i=t,s=r.useSlots(),l=r.ref(),c=r.ref(),u=r.ref(),p=r.reactive({search:"",activeIndex:-1,open:!1,optionsHeight:0}),f=()=>eo(Q.value.findIndex(A=>Bt(A.value,i.modelValue)),A=>A<0?0:A),m=()=>p.activeIndex=f(),v=r.computed(()=>i.options===void 0),k=r.computed(()=>v.value?!0:i.disabled),S=r.computed(()=>(i.options??[]).findIndex(A=>Bt(A.value,i.modelValue))),F=r.computed(()=>{if(!v.value){if(i.error)return i.error;if(i.modelValue!==void 0&&S.value===-1)return"The selected value is not one of the options"}}),T=r.computed(()=>Pr(i.options??[]).map((A,G)=>({...A,index:G,isSelected:G===S.value,isActive:G===p.activeIndex}))),N=r.computed(()=>{const A=r.unref(T).find(G=>Bt(G.value,i.modelValue));return(A==null?void 0:A.label)||i.modelValue}),C=r.computed(()=>!p.open&&i.modelValue?"":i.modelValue?String(N.value):i.placeholder),I=r.computed(()=>i.modelValue!==void 0&&i.modelValue!==null),Q=r.computed(()=>{const A=T.value;return p.search?A.filter(G=>{const Y=p.search.toLowerCase();return G.label.toLowerCase().includes(Y)||G.description&&G.description.toLowerCase().includes(Y)?!0:typeof G.value=="string"?G.value.toLowerCase().includes(Y):G.value===p.search}):A}),M=r.computed(()=>k.value?void 0:"0"),R=A=>{var G;n("update:modelValue",A),p.search="",p.open=!1,(G=l==null?void 0:l.value)==null||G.focus()},U=()=>n("update:modelValue",void 0),z=()=>{var A;return(A=u.value)==null?void 0:A.focus()},P=()=>p.open=!p.open,Z=()=>p.open=!0,O=A=>{var G,Y;const ve=A.relatedTarget;!((G=l.value)!=null&&G.contains(ve))&&!((Y=c.value)!=null&&Y.contains(ve))&&(p.search="",p.open=!1)},K=()=>{const A=c.value;A&&it(A.querySelector(".hovered-item"),G=>{to(A,G)})},ue=A=>{var G,Y;if(["ArrowDown","ArrowUp","Enter","Escape"].includes(A.code))A.preventDefault();else return;const{open:ve,activeIndex:xe}=p;if(!ve){A.code==="Enter"&&(p.open=!0);return}A.code==="Escape"&&(p.open=!1,(G=l.value)==null||G.focus());const Gt=r.unref(Q),{length:jt}=Gt;if(!jt)return;A.code==="Enter"&&R((Y=Gt.find(So=>So.index===xe))==null?void 0:Y.value);const At=Gt.findIndex(So=>So.index===xe)??-1,ko=A.code==="ArrowDown"?1:A.code==="ArrowUp"?-1:0,Lr=Math.abs(At+ko+jt)%jt;p.activeIndex=Q.value[Lr].index??-1};Rn(l),r.watch(()=>i.modelValue,m,{immediate:!0}),r.watch(()=>p.open,A=>{var G;return A?(G=u.value)==null?void 0:G.focus():""}),r.watchPostEffect(()=>{p.search,p.activeIndex>=0&&p.open&&K()});const W=r.reactive({top:"0px",left:"0px",width:"0px"});return r.watch(c,A=>{if(A){const G=A.getBoundingClientRect();p.optionsHeight=G.height,window.dispatchEvent(new CustomEvent("adjust"))}}),Qi(l,A=>{const G=A.top+A.height+3;G+p.optionsHeight>A.clientHeight?W.top=A.top-p.optionsHeight-3+"px":W.top=G+"px",W.left=A.left+"px",W.width=A.width+"px"}),(A,G)=>(r.openBlock(),r.createElementBlock("div",C0,[r.createElementVNode("div",{ref_key:"root",ref:l,tabindex:M.value,class:r.normalizeClass(["pl-dropdown",{open:p.open,error:A.error,disabled:k.value}]),onKeydown:ue,onFocusout:O},[r.createElementVNode("div",b0,[r.createElementVNode("div",x0,[r.withDirectives(r.createElementVNode("input",{ref_key:"input",ref:u,"onUpdate:modelValue":G[0]||(G[0]=Y=>p.search=Y),type:"text",tabindex:"-1",disabled:k.value,placeholder:C.value,spellcheck:"false",autocomplete:"chrome-off",onFocus:Z},null,40,k0),[[r.vModelText,p.search]]),G[4]||(G[4]=r.createTextVNode()),p.open?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",{key:0,onClick:z},[r.createVNode(pl,{class:"input-value"},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(N.value),1)]),_:1})])),G[5]||(G[5]=r.createTextVNode()),r.createElementVNode("div",S0,[v.value?(r.openBlock(),r.createBlock(r.unref(Mn),{key:0,name:"loading"})):r.createCommentVNode("",!0),G[1]||(G[1]=r.createTextVNode()),A.clearable&&I.value?(r.openBlock(),r.createBlock(r.unref(us),{key:1,name:"delete-clear",onClick:r.withModifiers(U,["stop"])})):r.createCommentVNode("",!0),G[2]||(G[2]=r.createTextVNode()),r.renderSlot(A.$slots,"append"),G[3]||(G[3]=r.createTextVNode()),A.arrowIconLarge?(r.openBlock(),r.createElementBlock("div",{key:2,class:r.normalizeClass(["arrow-icon",[`icon-24 ${A.arrowIconLarge}`]]),onClick:r.withModifiers(P,["stop"])},null,2)):A.arrowIcon?(r.openBlock(),r.createElementBlock("div",{key:3,class:r.normalizeClass(["arrow-icon",[`icon-16 ${A.arrowIcon}`]]),onClick:r.withModifiers(P,["stop"])},null,2)):(r.openBlock(),r.createElementBlock("div",{key:4,class:"arrow-icon arrow-icon-default",onClick:r.withModifiers(P,["stop"])}))])]),G[9]||(G[9]=r.createTextVNode()),A.label?(r.openBlock(),r.createElementBlock("label",E0,[A.required?(r.openBlock(),r.createElementBlock("i",T0)):r.createCommentVNode("",!0),G[6]||(G[6]=r.createTextVNode()),r.createElementVNode("span",null,r.toDisplayString(A.label),1),G[7]||(G[7]=r.createTextVNode()),r.unref(s).tooltip?(r.openBlock(),r.createBlock(r.unref(Tt),{key:1,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.renderSlot(A.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0),G[10]||(G[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(W),tabindex:"-1"},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(Q.value,(Y,ve)=>(r.openBlock(),r.createBlock(no,{key:ve,option:Y,"is-selected":Y.isSelected,"is-hovered":Y.isActive,size:A.optionSize,onClick:r.withModifiers(xe=>R(Y.value),["stop"])},null,8,["option","is-selected","is-hovered","size","onClick"]))),128)),G[8]||(G[8]=r.createTextVNode()),Q.value.length?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",B0,"Nothing found"))],4)])):r.createCommentVNode("",!0),G[11]||(G[11]=r.createTextVNode()),r.createVNode(ir,{class:"pl-dropdown__contour"})])],42,w0),G[12]||(G[12]=r.createTextVNode()),F.value?(r.openBlock(),r.createElementBlock("div",A0,r.toDisplayString(F.value),1)):v.value&&A.loadingOptionsHelper?(r.openBlock(),r.createElementBlock("div",P0,r.toDisplayString(A.loadingOptionsHelper),1)):A.helper?(r.openBlock(),r.createElementBlock("div",V0,r.toDisplayString(A.helper),1)):r.createCommentVNode("",!0)]))}}),D0={name:"PlDropdownRef"},F0=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},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}))}),i=r.computed(()=>e.disabled?"icon-link-disabled":"icon-link");return(s,l)=>(r.openBlock(),r.createBlock(r.unref(hl),r.mergeProps(e,{options:n.value,"loading-options-helper":s.loadingOptionsHelper,"arrow-icon-large":i.value,"onUpdate:modelValue":l[0]||(l[0]=c=>s.$emit("update:modelValue",c))}),null,16,["options","loading-options-helper","arrow-icon-large"]))}});function R0(t,e){return r.computed(()=>{const n=Pr(t.value);return e.value?n.filter(i=>i.label.toLowerCase().includes(e.value.toLowerCase())):n})}const M0={class:"resizable-input"},I0=["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,i=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;i("update:modelValue",p)}return(u,p)=>(r.openBlock(),r.createElementBlock("div",M0,[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,I0)]))}}),O0={class:"dropdown-tab-item__title text-caps13"},G0=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),i=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([i.value,"dropdown-tab-item"])},[r.createElementVNode("div",O0,r.toDisplayString(n.value),1)],2))}}),z0={class:"pl-line-dropdown__prefix"},Z0={class:"pl-line-dropdown__icon-wrapper"},$0={class:"pl-line-dropdown__icon"},U0={key:0,class:"pl-line-dropdown__no-item"},W0={key:0,class:"pl-line-dropdown__no-item"},Eu=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,i=t,s=r.reactive({isOpen:!1,activeOption:-1,optionsHeight:0}),l=r.ref(),c=r.ref(),u=r.computed(()=>{const O=[];return s.isOpen&&O.push("open"),i.disabled&&O.push("disabled"),O.join(" ")}),p=r.ref(""),f=R0(r.toRef(i,"options"),p),m=r.computed(()=>!!(i.clearable&&s.isOpen&&i.modelValue&&v.value)),v=r.computed(()=>{if(i.modelValue){const O=F();if(O!==-1){const K=Pr(i.options)[O];return typeof K.label=="object"?K.label.title:K.label}}return""}),k=r.ref(v.value),S=r.computed(()=>s.isOpen&&p.value&&p.value.length>=v.value.length-1?p.value:v.value??"...");ds(l,()=>{i.mode==="list"&&(s.isOpen=!1)}),r.watch(()=>k.value,O=>{v.value!==O?p.value=O:p.value=""}),r.watch(()=>s.isOpen,O=>{var K;O&&l.value&&((K=l.value.querySelector("input"))==null||K.focus(),r.nextTick(()=>z()))}),r.watch(()=>i.modelValue,()=>T(),{immediate:!0});function F(){return i.options.findIndex(O=>Bt(O.value,i.modelValue))}function T(){s.activeOption=eo(f.value.findIndex(O=>Bt(O.value,i.modelValue)),O=>O<0?0:O),k.value=v.value}function N(){p.value=""}function C(){i.disabled?s.isOpen=!1:r.nextTick(()=>{s.isOpen=!s.isOpen})}function I(){i.mode==="list"&&(s.isOpen=!1)}function Q(O){O&&(n("update:modelValue",O.value),I(),N())}function M(O){return Bt(O.value,i.modelValue)}const R=O=>{var K,ue;const W=O.relatedTarget;!((K=l.value)!=null&&K.contains(W))&&!((ue=c.value)!=null&&ue.contains(W))&&(p.value="",s.isOpen=!1)};function U(O){const{activeOption:K}=s;if(!s.isOpen&&O.code==="Enter"){s.isOpen=!0;return}const{length:ue}=f.value;if(!ue)return;["ArrowDown","ArrowUp","Enter"].includes(O.code)&&O.preventDefault(),O.code==="Enter"&&Q(f.value[K]);const W=O.code==="ArrowDown"?1:O.code==="ArrowUp"?-1:0;s.activeOption=Math.abs(K+W+ue)%ue,requestAnimationFrame(z)}function z(){const O=c.value;O&&it(O.querySelector(".hovered-item"),K=>{i.mode==="list"?to(O,K):K.scrollIntoView({behavior:"smooth",block:"nearest",inline:"center"})})}function P(){n("update:modelValue",void 0)}const Z=r.reactive({top:"0px",left:"0px"});return r.watch(c,O=>{if(O){const K=O.getBoundingClientRect();s.optionsHeight=K.height,window.dispatchEvent(new CustomEvent("adjust"))}}),Qi(l,O=>{const K=O.top+O.height+2;K+s.optionsHeight>O.clientHeight?Z.top=O.top-s.optionsHeight-2+"px":Z.top=K+"px",Z.left=O.left+"px"}),(O,K)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"container",ref:l,tabindex:"0",class:r.normalizeClass([u.value,"pl-line-dropdown uc-pointer"]),onKeydown:U,onFocusout:R,onClick:C},[r.createElementVNode("div",z0,r.toDisplayString(i==null?void 0:i.prefix),1),K[6]||(K[6]=r.createTextVNode()),r.createVNode(L0,{modelValue:k.value,"onUpdate:modelValue":K[0]||(K[0]=ue=>k.value=ue),placeholder:S.value,disabled:i.disabled,class:"pl-line-dropdown__input"},null,8,["modelValue","placeholder","disabled"]),K[7]||(K[7]=r.createTextVNode()),r.createElementVNode("div",Z0,[r.withDirectives(r.createElementVNode("div",$0,null,512),[[r.vShow,!m.value]]),K[1]||(K[1]=r.createTextVNode()),r.withDirectives(r.createElementVNode("div",{class:"pl-line-dropdown__icon-clear",onClick:P},null,512),[[r.vShow,m.value]])]),K[8]||(K[8]=r.createTextVNode()),s.isOpen?(r.openBlock(),r.createBlock(r.Teleport,{key:0,to:"body"},[i.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:R},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(f),(ue,W)=>r.renderSlot(O.$slots,"item",{key:W,item:ue,textItem:"text",isSelected:M(ue),isHovered:s.activeOption==W,onClick:r.withModifiers(A=>Q(ue),["stop"])},()=>[r.createVNode(no,{option:ue,"text-item":"text","is-selected":M(ue),"is-hovered":s.activeOption==W,size:"medium",onClick:r.withModifiers(A=>Q(ue),["stop"])},null,8,["option","is-selected","is-hovered","onClick"])])),128)),K[3]||(K[3]=r.createTextVNode()),r.unref(f).length===0?(r.openBlock(),r.createElementBlock("div",U0,K[2]||(K[2]=[r.createElementVNode("div",{class:"pl-line-dropdown__no-item-title text-s"},"Didn't find anything that matched",-1)]))):r.createCommentVNode("",!0)],36)):i.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:R},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(f),(ue,W)=>r.renderSlot(O.$slots,"item",{key:W,item:ue,isSelected:M(ue),isHovered:s.activeOption==W,onClick:r.withModifiers(A=>Q(ue),["stop"])},()=>[r.createVNode(G0,{option:ue,"is-selected":M(ue),"is-hovered":s.activeOption==W,onClick:r.withModifiers(A=>Q(ue),["stop"])},null,8,["option","is-selected","is-hovered","onClick"])])),128)),K[5]||(K[5]=r.createTextVNode()),r.unref(f).length===0?(r.openBlock(),r.createElementBlock("div",W0,K[4]||(K[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))}}),H0={class:"ui-dropdown__envelope"},j0=["tabindex"],q0={class:"ui-dropdown__container"},K0={class:"ui-dropdown__field"},Y0=["disabled","placeholder"],J0={class:"ui-dropdown__controls"},X0={key:0},Q0={key:0,class:"required-icon"},ew={key:0,class:"nothing-found"},tw={key:0,class:"ui-dropdown__error"},nw={key:1,class:"ui-dropdown__helper"},rw={key:2,class:"ui-dropdown__helper"},iw={name:"PlDropdown"},ow=r.defineComponent({...iw,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,i=t,s=r.useSlots(),l=r.ref(),c=r.ref(),u=r.ref(),p=r.reactive({search:"",activeIndex:-1,open:!1}),f=()=>eo(Q.value.findIndex(W=>Bt(W.value,i.modelValue)),W=>W<0?0:W),m=()=>p.activeIndex=f(),v=r.computed(()=>i.options===void 0),k=r.computed(()=>v.value?!0:i.disabled),S=r.computed(()=>(i.options??[]).findIndex(W=>Bt(W.value,i.modelValue))),F=r.computed(()=>{if(!v.value){if(i.error)return i.error;if(i.modelValue!==void 0&&S.value===-1)return"The selected value is not one of the options"}}),T=r.computed(()=>Pr(i.options??[]).map((W,A)=>({...W,index:A,isSelected:A===S.value,isActive:A===p.activeIndex}))),N=r.computed(()=>{const W=r.unref(T).find(A=>Bt(A.value,i.modelValue));return(W==null?void 0:W.label)||i.modelValue}),C=r.computed(()=>!p.open&&i.modelValue?"":i.modelValue?String(N.value):i.placeholder),I=r.computed(()=>i.modelValue!==void 0&&i.modelValue!==null),Q=r.computed(()=>{const W=T.value;return p.search?W.filter(A=>{const G=p.search.toLowerCase();return A.label.toLowerCase().includes(G)||A.description&&A.description.toLowerCase().includes(G)?!0:typeof A.value=="string"?A.value.toLowerCase().includes(G):A.value===p.search}):W}),M=r.computed(()=>k.value?void 0:"0"),R=W=>{var A;n("update:modelValue",W),p.search="",p.open=!1,(A=l==null?void 0:l.value)==null||A.focus()},U=()=>n("update:modelValue",void 0),z=()=>{var W;return(W=u.value)==null?void 0:W.focus()},P=()=>p.open=!p.open,Z=()=>p.open=!0,O=W=>{var A;(A=l==null?void 0:l.value)!=null&&A.contains(W.relatedTarget)||(p.search="",p.open=!1)},K=()=>{const W=c.value;W&&it(W.querySelector(".hovered-item"),A=>{to(W,A)})},ue=W=>{var A,G;if(["ArrowDown","ArrowUp","Enter","Escape"].includes(W.code))W.preventDefault();else return;const{open:Y,activeIndex:ve}=p;if(!Y){W.code==="Enter"&&(p.open=!0);return}W.code==="Escape"&&(p.open=!1,(A=l.value)==null||A.focus());const xe=r.unref(Q),{length:Gt}=xe;if(!Gt)return;W.code==="Enter"&&R((G=xe.find(Lr=>Lr.index===ve))==null?void 0:G.value);const jt=xe.findIndex(Lr=>Lr.index===ve)??-1,At=W.code==="ArrowDown"?1:W.code==="ArrowUp"?-1:0,ko=Math.abs(jt+At+Gt)%Gt;p.activeIndex=Q.value[ko].index??-1};return Rn(l),r.watch(()=>i.modelValue,m,{immediate:!0}),r.watch(()=>p.open,W=>{var A;return W?(A=u.value)==null?void 0:A.focus():""}),r.watchPostEffect(()=>{p.search,p.activeIndex>=0&&p.open&&K()}),(W,A)=>(r.openBlock(),r.createElementBlock("div",H0,[r.createElementVNode("div",{ref_key:"root",ref:l,tabindex:M.value,class:r.normalizeClass(["ui-dropdown",{open:p.open,error:W.error,disabled:k.value}]),onKeydown:ue,onFocusout:O},[r.createElementVNode("div",q0,[r.createElementVNode("div",K0,[r.withDirectives(r.createElementVNode("input",{ref_key:"input",ref:u,"onUpdate:modelValue":A[0]||(A[0]=G=>p.search=G),type:"text",tabindex:"-1",disabled:k.value,placeholder:C.value,spellcheck:"false",autocomplete:"chrome-off",onFocus:Z},null,40,Y0),[[r.vModelText,p.search]]),A[4]||(A[4]=r.createTextVNode()),p.open?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",{key:0,onClick:z},[r.createVNode(pl,{class:"input-value"},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(N.value),1)]),_:1})])),A[5]||(A[5]=r.createTextVNode()),r.createElementVNode("div",J0,[v.value?(r.openBlock(),r.createBlock(r.unref(Mn),{key:0,name:"loading"})):r.createCommentVNode("",!0),A[1]||(A[1]=r.createTextVNode()),W.clearable&&I.value?(r.openBlock(),r.createBlock(r.unref(us),{key:1,name:"delete-clear",onClick:r.withModifiers(U,["stop"])})):r.createCommentVNode("",!0),A[2]||(A[2]=r.createTextVNode()),r.renderSlot(W.$slots,"append"),A[3]||(A[3]=r.createTextVNode()),W.arrowIconLarge?(r.openBlock(),r.createElementBlock("div",{key:2,class:r.normalizeClass(["arrow-icon",[`icon-24 ${W.arrowIconLarge}`]]),onClick:r.withModifiers(P,["stop"])},null,2)):W.arrowIcon?(r.openBlock(),r.createElementBlock("div",{key:3,class:r.normalizeClass(["arrow-icon",[`icon-16 ${W.arrowIcon}`]]),onClick:r.withModifiers(P,["stop"])},null,2)):(r.openBlock(),r.createElementBlock("div",{key:4,class:"arrow-icon arrow-icon-default",onClick:r.withModifiers(P,["stop"])}))])]),A[9]||(A[9]=r.createTextVNode()),W.label?(r.openBlock(),r.createElementBlock("label",X0,[W.required?(r.openBlock(),r.createElementBlock("i",Q0)):r.createCommentVNode("",!0),A[6]||(A[6]=r.createTextVNode()),r.createElementVNode("span",null,r.toDisplayString(W.label),1),A[7]||(A[7]=r.createTextVNode()),r.unref(s).tooltip?(r.openBlock(),r.createBlock(r.unref(Tt),{key:1,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.renderSlot(W.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0),A[10]||(A[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(Q.value,(G,Y)=>(r.openBlock(),r.createBlock(no,{key:Y,option:G,"is-selected":G.isSelected,"is-hovered":G.isActive,size:W.optionSize,onClick:r.withModifiers(ve=>R(G.value),["stop"])},null,8,["option","is-selected","is-hovered","size","onClick"]))),128)),A[8]||(A[8]=r.createTextVNode()),Q.value.length?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",ew,"Nothing found"))],512)):r.createCommentVNode("",!0),A[11]||(A[11]=r.createTextVNode()),r.createVNode(ir,{class:"ui-dropdown__contour"})])],42,j0),A[12]||(A[12]=r.createTextVNode()),F.value?(r.openBlock(),r.createElementBlock("div",tw,r.toDisplayString(F.value),1)):v.value&&W.loadingOptionsHelper?(r.openBlock(),r.createElementBlock("div",nw,r.toDisplayString(W.loadingOptionsHelper),1)):W.helper?(r.openBlock(),r.createElementBlock("div",rw,r.toDisplayString(W.helper),1)):r.createCommentVNode("",!0)]))}}),sw={key:0,class:"ui-progress-bar"},aw={class:"ui-progress-bar__messages d-flex align-center pl-6 pr-6"},lw={class:"ui-progress-bar__message flex-grow-1"},cw={class:"ui-progress-bar__percent"},dw=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(i,s)=>i.loading?(r.openBlock(),r.createElementBlock("div",sw,[r.createElementVNode("div",{class:"ui-progress-bar__indicator",style:r.normalizeStyle({width:i.progress+"%"})},null,4),s[1]||(s[1]=r.createTextVNode()),r.createElementVNode("div",aw,[r.createElementVNode("div",lw,r.toDisplayString(n.value),1),s[0]||(s[0]=r.createTextVNode()),r.createElementVNode("div",cw,r.toDisplayString(i.progress+"%"),1)])])):r.createCommentVNode("",!0)}}),uw={class:"mi-number-field__main-wrapper d-flex"},pw={class:"mi-number-field__wrapper flex-grow d-flex flex-align-center"},hw={key:0,class:"text-description"},fw=["disabled","placeholder"],mw={class:"mi-number-field__icons d-flex-column"},gw={key:0,class:"mi-number-field__hint text-description"},yw=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,i=e,s=r.ref(),l=r.useSlots(),c=r.ref();Rn(s);const u=r.ref(!0),p=r.computed({get(){return u.value&&n.modelValue!==void 0?new Number(n.modelValue).toString():""},set(C){var I;C=C.replace(/,/g,""),k(C)?(i("update:modelValue",+C),C.toString()!==((I=n.modelValue)==null?void 0:I.toString())&&+C===n.modelValue&&C[C.length-1]!=="."&&(u.value=!1,r.nextTick(()=>{u.value=!0}))):(C.trim()===""&&i("update:modelValue",void 0),u.value=!1,r.nextTick(()=>{u.value=!0}))}}),f=r.computed(()=>{let C=[];return n.errorMessage&&C.push(n.errorMessage),k(n.modelValue)?(n.minValue!==void 0&&n.modelValue!==void 0&&n.modelValue<n.minValue&&C.push(`Model value must be higher than ${n.minValue}`),n.maxValue!==void 0&&n.modelValue!==void 0&&n.modelValue>n.maxValue&&C.push(`Model value must be less than ${n.maxValue}`)):C.push("Model value is not a number."),C=[...C],C.join(" ")}),m=r.computed(()=>!!(n.maxValue&&n.modelValue!==void 0&&(n.modelValue||0)+n.step>n.maxValue)),v=r.computed(()=>!!(n.minValue&&n.modelValue!==void 0&&(n.modelValue||0)-n.step<n.minValue));function k(C){return C!==void 0?(C=C==null?void 0:C.toString(),!isNaN(+C)&&!isNaN(parseFloat(C))):!1}function S(){if(!m.value){let C=0;n.modelValue===void 0?C=n.minValue?n.minValue:0:C=+(n.modelValue||0)+n.step,p.value=C.toString()}}function F(){if(!v.value){let C=0;n.modelValue===void 0?C=0:C=+(n.modelValue||0)-n.step,p.value=n.minValue?Math.max(n.minValue,C).toString():C.toString()}}function T(C){["ArrowDown","ArrowUp"].includes(C.code)&&C.preventDefault(),C.code==="ArrowUp"?S():C.code==="ArrowDown"&&F()}const N=C=>{C.detail>1&&C.preventDefault()};return(C,I)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"root",ref:s,class:r.normalizeClass([{error:!!f.value.trim(),disabled:C.disabled},"mi-number-field d-flex-column"]),onMousedown:N,onKeydown:I[1]||(I[1]=Q=>T(Q))},[r.createElementVNode("div",uw,[r.createVNode(ir,{class:"mi-number-field__contour"}),I[6]||(I[6]=r.createTextVNode()),r.createElementVNode("div",pw,[C.label?(r.openBlock(),r.createElementBlock("label",hw,[r.createTextVNode(r.toDisplayString(C.label)+" ",1),r.unref(l).tooltip?(r.openBlock(),r.createBlock(r.unref(Tt),{key:0,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.renderSlot(C.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0),I[2]||(I[2]=r.createTextVNode()),r.withDirectives(r.createElementVNode("input",{ref_key:"input",ref:c,"onUpdate:modelValue":I[0]||(I[0]=Q=>p.value=Q),disabled:C.disabled,placeholder:C.placeholder,class:"text-s flex-grow"},null,8,fw),[[r.vModelText,p.value]])]),I[7]||(I[7]=r.createTextVNode()),r.createElementVNode("div",mw,[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},I[3]||(I[3]=[r.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},[r.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M8 4.93933L13.5303 10.4697L12.4697 11.5303L8 7.06065L3.53033 11.5303L2.46967 10.4697L8 4.93933Z",fill:"#110529"})],-1)]),2),I[5]||(I[5]=r.createTextVNode()),r.createElementVNode("div",{class:r.normalizeClass([{disabled:v.value},"mi-number-field__icon d-flex flex-justify-center uc-pointer flex-grow flex-align-center"]),onClick:F},I[4]||(I[4]=[r.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},[r.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M2.46967 6.53033L3.53033 5.46967L8 9.93934L12.4697 5.46967L13.5303 6.53033L8 12.0607L2.46967 6.53033Z",fill:"#110529"})],-1)]),2)])]),I[8]||(I[8]=r.createTextVNode()),f.value.trim()?(r.openBlock(),r.createElementBlock("div",gw,r.toDisplayString(f.value),1)):r.createCommentVNode("",!0)],34))}}),vw={class:"pl-chip__text"},fl=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 i;e.value&&(n.value=((i=e.value)==null?void 0:i.clientWidth)>=256)}),(i,s)=>(r.openBlock(),r.createBlock(r.unref(Tt),{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:i.small}])},[r.createElementVNode("div",vw,[r.renderSlot(i.$slots,"default")]),s[3]||(s[3]=r.createTextVNode()),i.closeable?(r.openBlock(),r.createElementBlock("div",{key:0,tabindex:"0",class:"pl-chip__close",onKeydown:s[0]||(s[0]=r.withKeys(l=>i.$emit("close"),["enter"])),onClick:s[1]||(s[1]=r.withModifiers(l=>i.$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(i.$slots,"default")]),key:"0"}:void 0]),1024))}}),_w={class:"pl-multi-dropdown__envelope"},Cw=["tabindex"],ww={class:"pl-multi-dropdown__container"},bw={class:"pl-multi-dropdown__field"},xw=["disabled","placeholder"],kw={class:"pl-multi-dropdown__append"},Sw={key:0},Ew={key:0,class:"required-icon"},Tw={class:"pl-multi-dropdown__open-chips-container"},Bw={key:0,class:"nothing-found"},Aw={key:0,class:"pl-multi-dropdown__error"},Pw={key:1,class:"pl-multi-dropdown__helper"},Vw={name:"PlDropdownMulti"},Nw=r.defineComponent({...Vw,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,i=P=>n("update:modelValue",P),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:[]),v=r.computed(()=>f.open&&l.modelValue.length>0?l.placeholder:l.modelValue.length>0?"":l.placeholder),k=r.computed(()=>Pr(l.options).filter(P=>ul(m.value,P.value))),S=r.computed(()=>{const P=r.unref(m),Z=Pr(l.options);return(f.search?Z.filter(O=>{const K=f.search.toLowerCase();return O.label.toLowerCase().includes(K)?!0:typeof O.value=="string"?O.value.toLowerCase().includes(K):O.value===f.search}):[...Z]).map(O=>({...O,selected:ul(P,O.value)}))}),F=r.computed(()=>l.disabled?void 0:"0"),T=()=>{f.activeOption=eo(S.value.findIndex(P=>Bt(P.value,l.modelValue)),P=>P<0?0:P)},N=P=>{var Z;const O=r.unref(m);i(ul(O,P)?O.filter(K=>!Bt(K,P)):[...O,P]),f.search="",(Z=c==null?void 0:c.value)==null||Z.focus()},C=P=>i(r.unref(m).filter(Z=>!Bt(Z,P))),I=()=>{var P;return(P=p.value)==null?void 0:P.focus()},Q=()=>f.open=!f.open,M=P=>{var Z,O;const K=P.relatedTarget;!((Z=c.value)!=null&&Z.contains(K))&&!((O=u.value)!=null&&O.contains(K))&&(f.search="",f.open=!1)},R=()=>{const P=u.value;P&&it(P.querySelector(".hovered-item"),Z=>{to(P,Z)})},U=P=>{var Z;const{open:O,activeOption:K}=f;if(!O){P.code==="Enter"&&(f.open=!0);return}P.code==="Escape"&&(f.open=!1,(Z=c.value)==null||Z.focus());const ue=r.unref(S),{length:W}=ue;if(!W)return;["ArrowDown","ArrowUp","Enter"].includes(P.code)&&P.preventDefault(),P.code==="Enter"&&N(ue[K].value);const A=P.code==="ArrowDown"?1:P.code==="ArrowUp"?-1:0;f.activeOption=Math.abs(K+A+W)%W,requestAnimationFrame(R)};Rn(c),r.watch(()=>l.modelValue,()=>T(),{immediate:!0}),r.watchPostEffect(()=>{f.search,f.open&&R()});const z=r.reactive({top:"0px",left:"0px",width:"0px"});return r.watch(u,P=>{if(P){const Z=P.getBoundingClientRect();f.optionsHeight=Z.height,window.dispatchEvent(new CustomEvent("adjust"))}}),Qi(c,P=>{const Z=P.top+P.height+5;Z+f.optionsHeight>P.clientHeight?z.top=P.top-f.optionsHeight-5+"px":z.top=Z+"px",z.left=P.left+"px",z.width=P.width+"px"}),(P,Z)=>(r.openBlock(),r.createElementBlock("div",_w,[r.createElementVNode("div",{ref_key:"rootRef",ref:c,tabindex:F.value,class:r.normalizeClass(["pl-multi-dropdown",{open:f.open,error:P.error,disabled:P.disabled}]),onKeydown:U,onFocusout:M},[r.createElementVNode("div",ww,[r.createElementVNode("div",bw,[r.withDirectives(r.createElementVNode("input",{ref_key:"input",ref:p,"onUpdate:modelValue":Z[0]||(Z[0]=O=>f.search=O),type:"text",tabindex:"-1",disabled:P.disabled,placeholder:v.value,spellcheck:"false",autocomplete:"chrome-off",onFocus:Z[1]||(Z[1]=O=>f.open=!0)},null,40,xw),[[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:I},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(k.value,(O,K)=>(r.openBlock(),r.createBlock(r.unref(fl),{key:K,closeable:"",small:"",onClick:Z[2]||(Z[2]=r.withModifiers(ue=>f.open=!0,["stop"])),onClose:ue=>C(O.value)},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(O.label||O.value),1)]),_:2},1032,["onClose"]))),128))])),Z[4]||(Z[4]=r.createTextVNode()),r.createElementVNode("div",{class:"arrow",onClick:r.withModifiers(Q,["stop"])}),Z[5]||(Z[5]=r.createTextVNode()),r.createElementVNode("div",kw,[r.renderSlot(P.$slots,"append")])]),Z[10]||(Z[10]=r.createTextVNode()),P.label?(r.openBlock(),r.createElementBlock("label",Sw,[P.required?(r.openBlock(),r.createElementBlock("i",Ew)):r.createCommentVNode("",!0),Z[6]||(Z[6]=r.createTextVNode()),r.createElementVNode("span",null,r.toDisplayString(P.label),1),Z[7]||(Z[7]=r.createTextVNode()),r.unref(s).tooltip?(r.openBlock(),r.createBlock(r.unref(Tt),{key:1,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.renderSlot(P.$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(z),tabindex:"-1",onFocusout:M},[r.createElementVNode("div",Tw,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(k.value,(O,K)=>(r.openBlock(),r.createBlock(r.unref(fl),{key:K,closeable:"",small:"",onClose:ue=>C(O.value)},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(O.label||O.value),1)]),_:2},1032,["onClose"]))),128))]),Z[8]||(Z[8]=r.createTextVNode()),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(S.value,(O,K)=>(r.openBlock(),r.createBlock(no,{key:K,option:O,"text-item":"text","is-selected":O.selected,"is-hovered":f.activeOption==K,size:"medium","use-checkbox":"",onClick:r.withModifiers(ue=>N(O.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",Bw,"Nothing found"))],36)])):r.createCommentVNode("",!0),Z[12]||(Z[12]=r.createTextVNode()),r.createVNode(ir,{class:"pl-multi-dropdown__contour"})])],42,Cw),Z[13]||(Z[13]=r.createTextVNode()),P.error?(r.openBlock(),r.createElementBlock("div",Aw,r.toDisplayString(P.error),1)):P.helper?(r.openBlock(),r.createElementBlock("div",Pw,r.toDisplayString(P.helper),1)):r.createCommentVNode("",!0)]))}}),ml=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(i,s)=>(r.openBlock(),r.createElementBlock("div",{tabindex:"0",class:r.normalizeClass(["pl-checkbox-base",{checked:n.value,disabled:i.disabled}]),onClick:s[0]||(s[0]=l=>i.$emit("update:modelValue",!i.modelValue)),onKeydown:s[1]||(s[1]=r.withKeys(l=>i.$emit("update:modelValue",!i.modelValue),["enter"]))},null,34))}}),Dw={name:"PlCheckbox"},Fw=r.defineComponent({...Dw,props:{modelValue:{type:Boolean},disabled:{type:Boolean}},emits:["update:modelValue"],setup(t){const e=t,n=r.useSlots();return(i,s)=>r.unref(n).default?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(["pl-checkbox",{disabled:i.disabled}])},[r.createVNode(ml,r.mergeProps(e,{"onUpdate:modelValue":s[0]||(s[0]=l=>i.$emit("update:modelValue",l))}),null,16),s[3]||(s[3]=r.createTextVNode()),r.createElementVNode("label",{onClick:s[1]||(s[1]=l=>i.$emit("update:modelValue",!i.$props.modelValue))},[r.renderSlot(i.$slots,"default")])],2)):(r.openBlock(),r.createBlock(ml,r.mergeProps({key:1},e,{"onUpdate:modelValue":s[2]||(s[2]=l=>i.$emit("update:modelValue",l))}),null,16))}}),Rw={key:0},Mw=["onClick"],Iw={name:"PlCheckboxGroup"},Lw=r.defineComponent({...Iw,props:{modelValue:{},label:{},options:{},disabled:{type:Boolean}},emits:["update:modelValue"],setup(t,{emit:e}){const n=e,i=t,s=c=>i.modelValue.includes(c),l=c=>{const u=i.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",Rw,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(ml,{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,Mw)]))),128))],2))}}),Ow="_component_tupwt_1",Gw={component:Ow},zw={};function Zw(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 $w={$style:Gw},Uw=nr(zw,[["render",Zw],["__cssModules",$w]]),Ww={key:1,class:"pl-dialog-modal__title"},Hw={inheritAttrs:!1},gl=r.defineComponent({...Hw,__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}},emits:["update:modelValue"],setup(t,{emit:e}){const n=r.useSlots(),i=e,s=t,l=r.ref(),c=r.useAttrs();function u(p){l.value&&document.contains(p.target)&&!l.value.contains(p.target)&&i("update:modelValue",!1)}return et(document.body,"keyup",p=>{s.modelValue&&p.code==="Escape"&&i("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(Uw,{key:0,class:"close-modal-btn",onClick:f[0]||(f[0]=r.withModifiers(m=>i("update:modelValue",!1),["stop"]))})):r.createCommentVNode("",!0),f[1]||(f[1]=r.createTextVNode()),r.unref(n).title?(r.openBlock(),r.createElementBlock("div",Ww,[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})]))}}),jw=r.defineComponent({__name:"TransitionSlidePanel",setup(t){function e(){window.dispatchEvent(new CustomEvent("adjust"))}function n(){window.dispatchEvent(new CustomEvent("adjust"))}return(i,s)=>(r.openBlock(),r.createBlock(r.Transition,{name:"slide-panel",onAfterEnter:e,onAfterLeave:n},{default:r.withCtx(()=>[r.renderSlot(i.$slots,"default")]),_:3}))}}),qw={key:0,class:"pl-slide-modal__title"},Kw={class:"pl-slide-modal__content"},Yw={key:1,class:"pl-slide-modal__actions"},Jw={name:"PlSlideModal",inheritAttrs:!1},Xw=r.defineComponent({...Jw,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(),i=e,s=t,l=r.ref(),c=r.useAttrs();return ds(l,()=>{s.modelValue&&s.closeOnOutsideClick&&i("update:modelValue",!1)}),et(document,"keydown",u=>{u.key==="Escape"&&i("update:modelValue",!1)}),(u,p)=>(r.openBlock(),r.createBlock(r.Teleport,{to:"body"},[r.createVNode(jw,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=>i("update:modelValue",!1),["esc"]))}),[r.createElementVNode("div",{class:"close-dialog-btn",onClick:p[0]||(p[0]=f=>i("update:modelValue",!1))}),p[3]||(p[3]=r.createTextVNode()),r.unref(n).title?(r.openBlock(),r.createElementBlock("div",qw,[r.renderSlot(u.$slots,"title")])):r.createCommentVNode("",!0),p[4]||(p[4]=r.createTextVNode()),r.createElementVNode("div",Kw,[r.renderSlot(u.$slots,"default")]),p[5]||(p[5]=r.createTextVNode()),r.unref(n).actions?(r.openBlock(),r.createElementBlock("div",Yw,[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=>i("update:modelValue",!1),["esc"]))},null,32)):r.createCommentVNode("",!0)]))}}),Qw={key:0,class:"label"},eb={name:"PlToggleSwitch"},tb=r.defineComponent({...eb,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]=i=>e.$emit("update:modelValue",!e.modelValue)),onKeydown:n[1]||(n[1]=r.withKeys(i=>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",Qw,r.toDisplayString(e.label),1)):r.createCommentVNode("",!0)],34))}});function Tu(t){return r.getCurrentScope()?(r.onScopeDispose(t),!0):!1}function nb(t){return r.unref(t)}const rb=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;function ib(t,e,n={}){const{immediate:i=!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)},nb(e))}return i&&(s.value=!0,rb&&p()),Tu(u),{isPending:r.readonly(s),start:p,stop:u}}function ob(t,e,n){return r.watch(t,(i,s,l)=>{i&&e(i,s,l)},{...n,once:!1})}function sb(t,e,n){const{start:i}=ib(l,e,{immediate:!1}),s=r.ref(!1);async function l(){s.value&&(await t(),i())}function c(){s.value||(s.value=!0,l())}function u(){s.value=!1}return n!=null&&n.immediate&&c(),Tu(u),{isActive:s,pause:u,resume:c}}const ab="[==PROGRESS==]";function lb(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function cb(t){const e=r.ref(),n=r.reactive({errorCount:0});async function i(){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??ab,m=new TextDecoder().decode(p.data).replace(new RegExp(`${lb(f)}`,"g"),"");if(c=Object.assign(c,{lines:c.lines+m,lastOffset:p.newOffset,finished:!p.live}),p.newOffset>=p.size)break}}const s=sb(()=>i().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 ob(()=>{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 db={key:0},ub={key:1,class:"pl-log-view__error"},pb={name:"PlLogView"},hb=r.defineComponent({...pb,props:{value:{},logHandle:{},progressPrefix:{},error:{},output:{},maxRetries:{},mockPlatforma:{},label:{}},setup(t){const e=k=>{if(k&&k.ok===!1)return k.errors.join(`
51
+ `)},n=t,i=cb(n),s=r.ref(!0),l=r.ref(),c=r.ref(),u=r.computed(()=>{var k;return((k=i.value)==null?void 0:k.error)??n.error??e(n.output)}),p=r.computed(()=>{var k;return((k=i.value)==null?void 0:k.lines)??n.value??dv(n.output)});Rn(c);const f=()=>{p.value&&typeof p.value=="string"&&navigator.clipboard.writeText(p.value)},m=()=>{Ar(l.value,k=>{s.value&&k.scrollTo(k.scrollLeft,k.scrollHeight)})};r.watch(p,()=>{requestAnimationFrame(()=>{m()})},{immediate:!0});const v=k=>{const S=k.target;s.value=S.scrollTop+20>=S.scrollHeight-S.offsetHeight};return(k,S)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"root",ref:c,class:r.normalizeClass(["pl-log-view",{"has-error":u.value}])},[k.label?(r.openBlock(),r.createElementBlock("label",db,r.toDisplayString(k.label),1)):r.createCommentVNode("",!0),S[0]||(S[0]=r.createTextVNode()),r.createVNode(ir,{class:"pl-log-view__contour"}),S[1]||(S[1]=r.createTextVNode()),r.createVNode(r.unref(Mn),{title:"Copy content",class:"pl-log-view__copy",name:"clipboard",onClick:f}),S[2]||(S[2]=r.createTextVNode()),u.value?(r.openBlock(),r.createElementBlock("div",ub,r.toDisplayString(u.value),1)):(r.openBlock(),r.createElementBlock("div",{key:2,ref_key:"contentRef",ref:l,class:"pl-log-view__content",onScroll:v},r.toDisplayString(p.value),545))],2))}}),fb="_component_1ukal_1",mb="_tab_1ukal_14",gb="_disabled_1ukal_27",yb="_active_1ukal_56",vb="_topLine_1ukal_69",ni={component:fb,tab:mb,disabled:gb,active:yb,topLine:vb},_b=r.defineComponent({__name:"Tab",props:{option:{}},setup(t){const e=r.ref(),n=r.reactive({isOverflown:!1});return r.onMounted(()=>{const i=r.unref(e);if(!i)return;const s=i.$el.querySelector("span");s&&requestAnimationFrame(()=>{s.offsetWidth<s.scrollWidth&&(n.isOverflown=!0),console.log("el.offsetWidth, el.scrollWidth",s.offsetWidth,s.scrollWidth)})}),(i,s)=>(r.openBlock(),r.createBlock(r.unref(Tt),{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(i.option.label),1)]),default:r.withCtx(()=>[r.renderSlot(i.$slots,"default"),s[0]||(s[0]=r.createTextVNode())]),_:3},8,["hide","data-is-overflown"]))}}),Cb={name:"PlTabs"},wb=r.defineComponent({...Cb,props:{modelValue:{},options:{},disabled:{type:Boolean},topLine:{type:Boolean},maxTabWidth:{}},emits:["update:modelValue"],setup(t,{emit:e}){const n=e,i=s=>n("update:modelValue",s);return(s,l)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass([r.unref(ni).component,{[r.unref(ni).disabled]:s.disabled,[r.unref(ni).topLine]:s.topLine}])},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(s.options,(c,u)=>(r.openBlock(),r.createBlock(_b,{key:u,tabindex:s.modelValue===c.value||s.disabled||c.disabled?void 0:0,option:c,class:r.normalizeClass([{[r.unref(ni).active]:s.modelValue===c.value,[r.unref(ni).disabled]:c.disabled},r.unref(ni).tab]),style:r.normalizeStyle({"--pl-tabs-item-max-width":c.maxWidth??s.maxTabWidth}),onKeydown:r.withKeys(p=>i(c.value),["enter"]),onClick:p=>i(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))}});function bb(t){const e=t.split("/"),n=[];for(let i=0;i<e.length;i++)n.push({index:i,name:i===0?"Root":e[i],path:e.slice(0,i+1).join("/")});return n}const xb={class:"file-dialog"},kb={class:"file-dialog__search"},Sb={class:"ls-container"},Eb={class:"ls-head"},Tb={class:"ls-head__breadcrumbs"},Bb=["title","onClick"],Ab={key:0,class:"icon-16 icon-chevron-right"},Pb={class:"d-flex ml-auto align-center gap-12"},Vb={class:"ls-head__selected"},Nb={key:0,class:"ls-loader"},Db={key:1,class:"ls-empty"},Fb={key:2,class:"ls-error"},Rb={class:"ls-error__message"},Mb={key:3,class:"ls-body"},Ib=["onClick"],Lb=["title"],Ob=["onClick"],Gb=["title"],Bu=r.defineComponent({__name:"PlFileDialog",props:{modelValue:{type:Boolean},extensions:{default:void 0},multi:{type:Boolean},title:{default:void 0},autoSelectStorage:{type:Boolean,default:!0}},emits:["update:modelValue","import:files"],setup(t,{emit:e}){const n=e,i=t,s=()=>({dirPath:"",storageEntry:void 0,items:[],error:"",storageOptions:[],selected:[],lastSelected:void 0,currentLoadingPath:void 0,showHiddenItems:!1}),l=r.reactive(s()),c=r.computed(()=>l.showHiddenItems?l.items:l.items.filter(z=>!z.name.startsWith("."))),u=r.computed(()=>{var z;return{modelValue:i.modelValue,dirPath:l.dirPath,storageHandle:(z=l.storageEntry)==null?void 0:z.handle}}),p=(z,P)=>{window.platforma&&l.currentLoadingPath!==P&&(l.error="",l.items=[],l.lastSelected=void 0,l.currentLoadingPath=P,window.platforma.lsDriver.listFiles(z,P).then(Z=>{P===l.dirPath&&(l.items=jd(Z).entries.map(O=>({path:O.fullPath,name:O.name,isDir:O.type==="dir",canBeSelected:O.type==="file"&&(!i.extensions||i.extensions.some(K=>O.fullPath.endsWith(K))),handle:O.type==="file"?O.handle:void 0,selected:!1})).sort((O,K)=>O.isDir&&!K.isDir?-1:!O.isDir&&K.isDir?1:O.name.localeCompare(K.name)).map((O,K)=>({id:K,...O})),l.lastSelected=void 0)}).catch(Z=>l.error=String(Z)).finally(()=>{l.currentLoadingPath=void 0}))},f=()=>{const{storageHandle:z,dirPath:P,modelValue:Z}=u.value;z&&Z&&p(z,P)},m=Yd(z=>{l.dirPath=z??""},1e3),v=r.computed(()=>bb(l.dirPath)),k=r.computed(()=>l.items.filter(z=>z.canBeSelected&&z.selected&&!z.isDir)),S=r.computed(()=>k.value.length>0),F=()=>{n("update:modelValue",!1)},T=()=>{var z;S.value&&(z=l.storageEntry)!=null&&z.handle&&(n("import:files",{storageHandle:l.storageEntry.handle,files:k.value.map(P=>P.handle)}),F())},N=z=>{l.dirPath=z,l.storageEntry&&f()},C=(z,P)=>{const{shiftKey:Z,metaKey:O}=z,{lastSelected:K}=l;if(z.preventDefault(),P.canBeSelected){if(i.multi||l.items.forEach(ue=>ue.selected=!1),P.selected=!0,!i.multi)return;!O&&!Z&&l.items.forEach(ue=>{ue.id!==P.id&&(ue.selected=!1)}),Z&&K!==void 0&&l.items.forEach(ue=>{av(ue.id,K,P.id)&&(ue.selected=!0)}),P.selected&&(l.lastSelected=P.id)}},I=z=>{z&&!i.multi||l.items.filter(P=>P.canBeSelected).forEach(P=>{P.selected=z})},Q=()=>I(!0),M=()=>I(!1),R=()=>{if(l.error="",l.lastSelected=void 0,M(),!window.platforma){console.warn("platforma API is not found");return}window.platforma.lsDriver.getStorageList().then(z=>{l.storageOptions=z.map(P=>({text:P.name,value:P})),i.autoSelectStorage&&Ar(z.find(P=>P.name==="local"||P.name.startsWith("local_disk_")&&P.initialFullPath.length>4),P=>{l.storageEntry=P,l.dirPath=P.initialFullPath})}).catch(z=>l.error=String(z))};r.watch(r.toRef(l,"storageEntry"),z=>{l.dirPath=(z==null?void 0:z.initialFullPath)??""}),r.watch([()=>l.dirPath,()=>l.storageEntry],()=>{f()}),r.watch(()=>i.modelValue,z=>{z?R():Object.assign(l,s())},{immediate:!0}),et(document,"keydown",z=>{i.modelValue&&z.target===document.body&&(z.metaKey&&z.code==="KeyA"&&(z.preventDefault(),Q()),z.metaKey&&z.shiftKey&&z.code==="Period"&&(z.preventDefault(),l.showHiddenItems=!l.showHiddenItems),z.code==="Enter"&&T())}),r.onUpdated(R);const U={mounted:z=>{if(z.clientWidth<z.scrollWidth){const P=z.innerText;z.innerText=P.substring(0,57)+"..."+P.substring(P.length-10)}}};return(z,P)=>(r.openBlock(),r.createBlock(r.unref(gl),{"no-content-gutters":!0,class:"split","model-value":z.modelValue,width:"688px",height:"720px","onUpdate:modelValue":F,onClick:r.withModifiers(M,["stop"])},{title:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(z.title??"Select files"),1)]),actions:r.withCtx(()=>[r.createVNode(r.unref(il),{style:{"min-width":"160px"},disabled:!S.value,onClick:r.withModifiers(T,["stop"])},{default:r.withCtx(()=>P[14]||(P[14]=[r.createTextVNode("Import")])),_:1},8,["disabled"]),P[16]||(P[16]=r.createTextVNode()),r.createVNode(r.unref(sl),{"justify-center":!1,onClick:r.withModifiers(F,["stop"])},{default:r.withCtx(()=>P[15]||(P[15]=[r.createTextVNode("Cancel")])),_:1})]),default:r.withCtx(()=>[P[17]||(P[17]=r.createTextVNode()),r.createElementVNode("div",xb,[r.createElementVNode("div",kb,[r.createVNode(r.unref(hl),{modelValue:l.storageEntry,"onUpdate:modelValue":P[0]||(P[0]=Z=>l.storageEntry=Z),label:"Select storage",options:l.storageOptions},null,8,["modelValue","options"]),P[1]||(P[1]=r.createTextVNode()),r.createVNode(r.unref(bu),{"model-value":l.dirPath,label:"Enter path","onUpdate:modelValue":r.unref(m)},null,8,["model-value","onUpdate:modelValue"])]),P[13]||(P[13]=r.createTextVNode()),r.createElementVNode("div",Sb,[r.createElementVNode("div",Eb,[r.createElementVNode("div",Tb,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(v.value,(Z,O)=>(r.openBlock(),r.createElementBlock(r.Fragment,{key:O},[r.createElementVNode("div",{title:Z.path,onClick:K=>N(Z.path)},r.toDisplayString(Z.name),9,Bb),P[2]||(P[2]=r.createTextVNode()),Z.index!==v.value.length-1?(r.openBlock(),r.createElementBlock("i",Ab)):r.createCommentVNode("",!0)],64))),128))]),P[3]||(P[3]=r.createTextVNode()),r.createElementVNode("div",Pb,[r.createElementVNode("span",Vb,"Selected: "+r.toDisplayString(k.value.length),1)])]),P[12]||(P[12]=r.createTextVNode()),l.currentLoadingPath!==void 0?(r.openBlock(),r.createElementBlock("div",Nb,P[4]||(P[4]=[r.createElementVNode("i",{class:"mask-24 mask-loading loader-icon"},null,-1)]))):l.storageEntry?l.error?(r.openBlock(),r.createElementBlock("div",Fb,[P[6]||(P[6]=r.createElementVNode("div",{class:"ls-error__cat"},null,-1)),P[7]||(P[7]=r.createTextVNode()),r.createElementVNode("div",Rb,r.toDisplayString(l.error),1)])):(r.openBlock(),r.createElementBlock("div",Mb,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(c.value,Z=>(r.openBlock(),r.createElementBlock(r.Fragment,{key:Z.id},[Z.isDir?(r.openBlock(),r.createElementBlock("div",{key:0,class:"isDir",onClick:O=>N(Z.path)},[P[8]||(P[8]=r.createElementVNode("i",{class:"icon-16 icon-chevron-right"},null,-1)),P[9]||(P[9]=r.createTextVNode()),r.withDirectives((r.openBlock(),r.createElementBlock("span",{title:Z.name},[r.createTextVNode(r.toDisplayString(Z.name),1)],8,Lb)),[[U]])],8,Ib)):(r.openBlock(),r.createElementBlock("div",{key:1,class:r.normalizeClass({canBeSelected:Z.canBeSelected,selected:Z.selected}),onClick:r.withModifiers(O=>C(O,Z),["stop"])},[P[10]||(P[10]=r.createElementVNode("i",{class:"mask-16 mask-box isFile"},null,-1)),P[11]||(P[11]=r.createTextVNode()),r.withDirectives((r.openBlock(),r.createElementBlock("span",{title:Z.name},[r.createTextVNode(r.toDisplayString(Z.name),1)],8,Gb)),[[U]])],10,Ob))],64))),128))])):(r.openBlock(),r.createElementBlock("div",Db,P[5]||(P[5]=[r.createElementVNode("div",{class:"ls-empty__cat"},null,-1),r.createTextVNode(),r.createElementVNode("div",{class:"ls-empty__message"},"Select storage to preview",-1)])))])]),P[18]||(P[18]=r.createTextVNode())]),_:1},8,["model-value"]))}});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 i(s,l=" | "){return s.map(c=>typeof c=="string"?`'${c}'`:c).join(l)}t.joinValues=i,t.jsonStringifyReplacer=(s,l)=>typeof l=="bigint"?l.toString():l})(Ie||(Ie={}));var yl;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(yl||(yl={}));const oe=Ie.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),or=t=>{switch(typeof t){case"undefined":return oe.undefined;case"string":return oe.string;case"number":return isNaN(t)?oe.nan:oe.number;case"boolean":return oe.boolean;case"function":return oe.function;case"bigint":return oe.bigint;case"symbol":return oe.symbol;case"object":return Array.isArray(t)?oe.array:t===null?oe.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?oe.promise:typeof Map<"u"&&t instanceof Map?oe.map:typeof Set<"u"&&t instanceof Set?oe.set:typeof Date<"u"&&t instanceof Date?oe.date:oe.object;default:return oe.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"]),zb=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:");class Rt extends Error{constructor(e){super(),this.issues=[],this.addIssue=i=>{this.issues=[...this.issues,i]},this.addIssues=(i=[])=>{this.issues=[...this.issues,...i]};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},i={_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)i._errors.push(n(c));else{let u=i,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),i}static assert(e){if(!(e instanceof Rt))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={},i=[];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))):i.push(e(s));return{formErrors:i,fieldErrors:n}}get formErrors(){return this.flatten()}}Rt.create=t=>new Rt(t);const ri=(t,e)=>{let n;switch(t.code){case X.invalid_type:t.received===oe.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 Au=ri;function Zb(t){Au=t}function ps(){return Au}const hs=t=>{const{data:e,path:n,errorMaps:i,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=i.filter(f=>!!f).slice().reverse();for(const f of p)u=f(c,{data:e,defaultError:u}).message;return{...s,path:l,message:u}},$b=[];function re(t,e){const n=ps(),i=hs({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===ri?void 0:ri].filter(s=>!!s)});t.common.issues.push(i)}class mt{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){const i=[];for(const s of n){if(s.status==="aborted")return Ce;s.status==="dirty"&&e.dirty(),i.push(s.value)}return{status:e.value,value:i}}static async mergeObjectAsync(e,n){const i=[];for(const s of n){const l=await s.key,c=await s.value;i.push({key:l,value:c})}return mt.mergeObjectSync(e,i)}static mergeObjectSync(e,n){const i={};for(const s of n){const{key:l,value:c}=s;if(l.status==="aborted"||c.status==="aborted")return Ce;l.status==="dirty"&&e.dirty(),c.status==="dirty"&&e.dirty(),l.value!=="__proto__"&&(typeof c.value<"u"||s.alwaysSet)&&(i[l.value]=c.value)}return{status:e.value,value:i}}}const Ce=Object.freeze({status:"aborted"}),fs=t=>({status:"dirty",value:t}),wt=t=>({status:"valid",value:t}),vl=t=>t.status==="aborted",_l=t=>t.status==="dirty",ro=t=>t.status==="valid",io=t=>typeof Promise<"u"&&t instanceof Promise;function ms(t,e,n,i){if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e.get(t)}function Pu(t,e,n,i,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 de;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(de||(de={}));var oo,so;class En{constructor(e,n,i,s){this._cachedPath=[],this.parent=e,this.data=n,this._path=i,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 Vu=(t,e)=>{if(ro(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 Rt(t.common.issues);return this._error=n,this._error}}};function Ee(t){if(!t)return{};const{errorMap:e,invalid_type_error:n,required_error:i,description:s}=t;if(e&&(n||i))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??i)!==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 Ae{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 or(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:or(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new mt,ctx:{common:e.parent.common,data:e.data,parsedType:or(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const n=this._parse(e);if(io(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 i=this.safeParse(e,n);if(i.success)return i.data;throw i.error}safeParse(e,n){var i;const s={common:{issues:[],async:(i=n==null?void 0:n.async)!==null&&i!==void 0?i:!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:or(e)},l=this._parseSync({data:e,path:s.path,parent:s});return Vu(s,l)}async parseAsync(e,n){const i=await this.safeParseAsync(e,n);if(i.success)return i.data;throw i.error}async safeParseAsync(e,n){const i={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:or(e)},s=this._parse({data:e,path:i.path,parent:i}),l=await(io(s)?s:Promise.resolve(s));return Vu(i,l)}refine(e,n){const i=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,...i(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((i,s)=>e(i)?!0:(s.addIssue(typeof n=="function"?n(i,s):n),!1))}_refinement(e){return new ln({schema:this,typeName:ye.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return Bn.create(this,this._def)}nullable(){return dr.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return an.create(this,this._def)}promise(){return ai.create(this,this._def)}or(e){return uo.create([this,e],this._def)}and(e){return po.create(this,e,this._def)}transform(e){return new ln({...Ee(this._def),schema:this,typeName:ye.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new yo({...Ee(this._def),innerType:this,defaultValue:n,typeName:ye.ZodDefault})}brand(){return new bl({typeName:ye.ZodBranded,type:this,...Ee(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new vo({...Ee(this._def),innerType:this,catchValue:n,typeName:ye.ZodCatch})}describe(e){const n=this.constructor;return new n({...this._def,description:e})}pipe(e){return _o.create(this,e)}readonly(){return Co.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Ub=/^c[^\s-]{8,}$/i,Wb=/^[0-9a-z]+$/,Hb=/^[0-9A-HJKMNP-TV-Z]{26}$/,jb=/^[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,qb=/^[a-z0-9_-]{21}$/i,Kb=/^[-+]?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)?)??$/,Yb=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Jb="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Cl;const Xb=/^(?:(?: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])$/,Qb=/^(([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})))$/,ex=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Nu="((\\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])))",tx=new RegExp(`^${Nu}$`);function Du(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 nx(t){return new RegExp(`^${Du(t)}$`)}function Fu(t){let e=`${Nu}T${Du(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 rx(t,e){return!!((e==="v4"||!e)&&Xb.test(t)||(e==="v6"||!e)&&Qb.test(t))}class sn extends Ae{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==oe.string){const s=this._getOrReturnCtx(e);return re(s,{code:X.invalid_type,expected:oe.string,received:s.parsedType}),Ce}const n=new mt;let i;for(const s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(i=this._getOrReturnCtx(e,i),re(i,{code:X.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&&(i=this._getOrReturnCtx(e,i),re(i,{code:X.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)&&(i=this._getOrReturnCtx(e,i),l?re(i,{code:X.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):c&&re(i,{code:X.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),n.dirty())}else if(s.kind==="email")Yb.test(e.data)||(i=this._getOrReturnCtx(e,i),re(i,{validation:"email",code:X.invalid_string,message:s.message}),n.dirty());else if(s.kind==="emoji")Cl||(Cl=new RegExp(Jb,"u")),Cl.test(e.data)||(i=this._getOrReturnCtx(e,i),re(i,{validation:"emoji",code:X.invalid_string,message:s.message}),n.dirty());else if(s.kind==="uuid")jb.test(e.data)||(i=this._getOrReturnCtx(e,i),re(i,{validation:"uuid",code:X.invalid_string,message:s.message}),n.dirty());else if(s.kind==="nanoid")qb.test(e.data)||(i=this._getOrReturnCtx(e,i),re(i,{validation:"nanoid",code:X.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid")Ub.test(e.data)||(i=this._getOrReturnCtx(e,i),re(i,{validation:"cuid",code:X.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid2")Wb.test(e.data)||(i=this._getOrReturnCtx(e,i),re(i,{validation:"cuid2",code:X.invalid_string,message:s.message}),n.dirty());else if(s.kind==="ulid")Hb.test(e.data)||(i=this._getOrReturnCtx(e,i),re(i,{validation:"ulid",code:X.invalid_string,message:s.message}),n.dirty());else if(s.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),re(i,{validation:"url",code:X.invalid_string,message:s.message}),n.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),re(i,{validation:"regex",code:X.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)||(i=this._getOrReturnCtx(e,i),re(i,{code:X.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)||(i=this._getOrReturnCtx(e,i),re(i,{code:X.invalid_string,validation:{startsWith:s.value},message:s.message}),n.dirty()):s.kind==="endsWith"?e.data.endsWith(s.value)||(i=this._getOrReturnCtx(e,i),re(i,{code:X.invalid_string,validation:{endsWith:s.value},message:s.message}),n.dirty()):s.kind==="datetime"?Fu(s).test(e.data)||(i=this._getOrReturnCtx(e,i),re(i,{code:X.invalid_string,validation:"datetime",message:s.message}),n.dirty()):s.kind==="date"?tx.test(e.data)||(i=this._getOrReturnCtx(e,i),re(i,{code:X.invalid_string,validation:"date",message:s.message}),n.dirty()):s.kind==="time"?nx(s).test(e.data)||(i=this._getOrReturnCtx(e,i),re(i,{code:X.invalid_string,validation:"time",message:s.message}),n.dirty()):s.kind==="duration"?Kb.test(e.data)||(i=this._getOrReturnCtx(e,i),re(i,{validation:"duration",code:X.invalid_string,message:s.message}),n.dirty()):s.kind==="ip"?rx(e.data,s.version)||(i=this._getOrReturnCtx(e,i),re(i,{validation:"ip",code:X.invalid_string,message:s.message}),n.dirty()):s.kind==="base64"?ex.test(e.data)||(i=this._getOrReturnCtx(e,i),re(i,{validation:"base64",code:X.invalid_string,message:s.message}),n.dirty()):Ie.assertNever(s);return{status:n.value,value:e.data}}_regex(e,n,i){return this.refinement(s=>e.test(s),{validation:n,code:X.invalid_string,...de.errToObj(i)})}_addCheck(e){return new sn({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...de.errToObj(e)})}url(e){return this._addCheck({kind:"url",...de.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...de.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...de.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...de.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...de.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...de.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...de.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...de.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...de.errToObj(e)})}datetime(e){var n,i;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:(i=e==null?void 0:e.local)!==null&&i!==void 0?i:!1,...de.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,...de.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...de.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...de.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n==null?void 0:n.position,...de.errToObj(n==null?void 0:n.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...de.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...de.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...de.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...de.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...de.errToObj(n)})}nonempty(e){return this.min(1,de.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:ye.ZodString,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...Ee(t)})};function ix(t,e){const n=(t.toString().split(".")[1]||"").length,i=(e.toString().split(".")[1]||"").length,s=n>i?n:i,l=parseInt(t.toFixed(s).replace(".","")),c=parseInt(e.toFixed(s).replace(".",""));return l%c/Math.pow(10,s)}class sr extends Ae{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)!==oe.number){const s=this._getOrReturnCtx(e);return re(s,{code:X.invalid_type,expected:oe.number,received:s.parsedType}),Ce}let n;const i=new mt;for(const s of this._def.checks)s.kind==="int"?Ie.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),re(n,{code:X.invalid_type,expected:"integer",received:"float",message:s.message}),i.dirty()):s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(n=this._getOrReturnCtx(e,n),re(n,{code:X.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(n=this._getOrReturnCtx(e,n),re(n,{code:X.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="multipleOf"?ix(e.data,s.value)!==0&&(n=this._getOrReturnCtx(e,n),re(n,{code:X.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),re(n,{code:X.not_finite,message:s.message}),i.dirty()):Ie.assertNever(s);return{status:i.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,de.toString(n))}gt(e,n){return this.setLimit("min",e,!1,de.toString(n))}lte(e,n){return this.setLimit("max",e,!0,de.toString(n))}lt(e,n){return this.setLimit("max",e,!1,de.toString(n))}setLimit(e,n,i,s){return new sr({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:i,message:de.toString(s)}]})}_addCheck(e){return new sr({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:de.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:de.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:de.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:de.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:de.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:de.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:de.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:de.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:de.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 i of this._def.checks){if(i.kind==="finite"||i.kind==="int"||i.kind==="multipleOf")return!0;i.kind==="min"?(n===null||i.value>n)&&(n=i.value):i.kind==="max"&&(e===null||i.value<e)&&(e=i.value)}return Number.isFinite(n)&&Number.isFinite(e)}}sr.create=t=>new sr({checks:[],typeName:ye.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...Ee(t)});class ar extends Ae{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)!==oe.bigint){const s=this._getOrReturnCtx(e);return re(s,{code:X.invalid_type,expected:oe.bigint,received:s.parsedType}),Ce}let n;const i=new mt;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:X.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(n=this._getOrReturnCtx(e,n),re(n,{code:X.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="multipleOf"?e.data%s.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),re(n,{code:X.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):Ie.assertNever(s);return{status:i.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,de.toString(n))}gt(e,n){return this.setLimit("min",e,!1,de.toString(n))}lte(e,n){return this.setLimit("max",e,!0,de.toString(n))}lt(e,n){return this.setLimit("max",e,!1,de.toString(n))}setLimit(e,n,i,s){return new ar({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:i,message:de.toString(s)}]})}_addCheck(e){return new ar({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:de.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:de.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:de.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:de.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:de.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}}ar.create=t=>{var e;return new ar({checks:[],typeName:ye.ZodBigInt,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...Ee(t)})};class ao extends Ae{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==oe.boolean){const n=this._getOrReturnCtx(e);return re(n,{code:X.invalid_type,expected:oe.boolean,received:n.parsedType}),Ce}return wt(e.data)}}ao.create=t=>new ao({typeName:ye.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...Ee(t)});class Vr extends Ae{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==oe.date){const s=this._getOrReturnCtx(e);return re(s,{code:X.invalid_type,expected:oe.date,received:s.parsedType}),Ce}if(isNaN(e.data.getTime())){const s=this._getOrReturnCtx(e);return re(s,{code:X.invalid_date}),Ce}const n=new mt;let i;for(const s of this._def.checks)s.kind==="min"?e.data.getTime()<s.value&&(i=this._getOrReturnCtx(e,i),re(i,{code:X.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),n.dirty()):s.kind==="max"?e.data.getTime()>s.value&&(i=this._getOrReturnCtx(e,i),re(i,{code:X.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),n.dirty()):Ie.assertNever(s);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Vr({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:de.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:de.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}}Vr.create=t=>new Vr({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:ye.ZodDate,...Ee(t)});class gs extends Ae{_parse(e){if(this._getType(e)!==oe.symbol){const n=this._getOrReturnCtx(e);return re(n,{code:X.invalid_type,expected:oe.symbol,received:n.parsedType}),Ce}return wt(e.data)}}gs.create=t=>new gs({typeName:ye.ZodSymbol,...Ee(t)});class lo extends Ae{_parse(e){if(this._getType(e)!==oe.undefined){const n=this._getOrReturnCtx(e);return re(n,{code:X.invalid_type,expected:oe.undefined,received:n.parsedType}),Ce}return wt(e.data)}}lo.create=t=>new lo({typeName:ye.ZodUndefined,...Ee(t)});class co extends Ae{_parse(e){if(this._getType(e)!==oe.null){const n=this._getOrReturnCtx(e);return re(n,{code:X.invalid_type,expected:oe.null,received:n.parsedType}),Ce}return wt(e.data)}}co.create=t=>new co({typeName:ye.ZodNull,...Ee(t)});class ii extends Ae{constructor(){super(...arguments),this._any=!0}_parse(e){return wt(e.data)}}ii.create=t=>new ii({typeName:ye.ZodAny,...Ee(t)});class Nr extends Ae{constructor(){super(...arguments),this._unknown=!0}_parse(e){return wt(e.data)}}Nr.create=t=>new Nr({typeName:ye.ZodUnknown,...Ee(t)});class In extends Ae{_parse(e){const n=this._getOrReturnCtx(e);return re(n,{code:X.invalid_type,expected:oe.never,received:n.parsedType}),Ce}}In.create=t=>new In({typeName:ye.ZodNever,...Ee(t)});class ys extends Ae{_parse(e){if(this._getType(e)!==oe.undefined){const n=this._getOrReturnCtx(e);return re(n,{code:X.invalid_type,expected:oe.void,received:n.parsedType}),Ce}return wt(e.data)}}ys.create=t=>new ys({typeName:ye.ZodVoid,...Ee(t)});class an extends Ae{_parse(e){const{ctx:n,status:i}=this._processInputParams(e),s=this._def;if(n.parsedType!==oe.array)return re(n,{code:X.invalid_type,expected:oe.array,received:n.parsedType}),Ce;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?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}),i.dirty())}if(s.minLength!==null&&n.data.length<s.minLength.value&&(re(n,{code:X.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),i.dirty()),s.maxLength!==null&&n.data.length>s.maxLength.value&&(re(n,{code:X.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),i.dirty()),n.common.async)return Promise.all([...n.data].map((c,u)=>s.type._parseAsync(new En(n,c,n.path,u)))).then(c=>mt.mergeArray(i,c));const l=[...n.data].map((c,u)=>s.type._parseSync(new En(n,c,n.path,u)));return mt.mergeArray(i,l)}get element(){return this._def.type}min(e,n){return new an({...this._def,minLength:{value:e,message:de.toString(n)}})}max(e,n){return new an({...this._def,maxLength:{value:e,message:de.toString(n)}})}length(e,n){return new an({...this._def,exactLength:{value:e,message:de.toString(n)}})}nonempty(e){return this.min(1,e)}}an.create=(t,e)=>new an({type:t,minLength:null,maxLength:null,exactLength:null,typeName:ye.ZodArray,...Ee(e)});function oi(t){if(t instanceof Ye){const e={};for(const n in t.shape){const i=t.shape[n];e[n]=Bn.create(oi(i))}return new Ye({...t._def,shape:()=>e})}else return t instanceof an?new an({...t._def,type:oi(t.element)}):t instanceof Bn?Bn.create(oi(t.unwrap())):t instanceof dr?dr.create(oi(t.unwrap())):t instanceof Tn?Tn.create(t.items.map(e=>oi(e))):t}class Ye extends Ae{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)!==oe.object){const p=this._getOrReturnCtx(e);return re(p,{code:X.invalid_type,expected:oe.object,received:p.parsedType}),Ce}const{status:n,ctx:i}=this._processInputParams(e),{shape:s,keys:l}=this._getCached(),c=[];if(!(this._def.catchall instanceof In&&this._def.unknownKeys==="strip"))for(const p in i.data)l.includes(p)||c.push(p);const u=[];for(const p of l){const f=s[p],m=i.data[p];u.push({key:{status:"valid",value:p},value:f._parse(new En(i,m,i.path,p)),alwaysSet:p in i.data})}if(this._def.catchall instanceof In){const p=this._def.unknownKeys;if(p==="passthrough")for(const f of c)u.push({key:{status:"valid",value:f},value:{status:"valid",value:i.data[f]}});else if(p==="strict")c.length>0&&(re(i,{code:X.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=i.data[f];u.push({key:{status:"valid",value:f},value:p._parse(new En(i,m,i.path,f)),alwaysSet:f in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const p=[];for(const f of u){const m=await f.key,v=await f.value;p.push({key:m,value:v,alwaysSet:f.alwaysSet})}return p}).then(p=>mt.mergeObjectSync(n,p)):mt.mergeObjectSync(n,u)}get shape(){return this._def.shape()}strict(e){return de.errToObj,new Ye({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,i)=>{var s,l,c,u;const p=(c=(l=(s=this._def).errorMap)===null||l===void 0?void 0:l.call(s,n,i).message)!==null&&c!==void 0?c:i.defaultError;return n.code==="unrecognized_keys"?{message:(u=de.errToObj(e).message)!==null&&u!==void 0?u:p}:{message:p}}}:{}})}strip(){return new Ye({...this._def,unknownKeys:"strip"})}passthrough(){return new Ye({...this._def,unknownKeys:"passthrough"})}extend(e){return new Ye({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Ye({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:ye.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new Ye({...this._def,catchall:e})}pick(e){const n={};return Ie.objectKeys(e).forEach(i=>{e[i]&&this.shape[i]&&(n[i]=this.shape[i])}),new Ye({...this._def,shape:()=>n})}omit(e){const n={};return Ie.objectKeys(this.shape).forEach(i=>{e[i]||(n[i]=this.shape[i])}),new Ye({...this._def,shape:()=>n})}deepPartial(){return oi(this)}partial(e){const n={};return Ie.objectKeys(this.shape).forEach(i=>{const s=this.shape[i];e&&!e[i]?n[i]=s:n[i]=s.optional()}),new Ye({...this._def,shape:()=>n})}required(e){const n={};return Ie.objectKeys(this.shape).forEach(i=>{if(e&&!e[i])n[i]=this.shape[i];else{let s=this.shape[i];for(;s instanceof Bn;)s=s._def.innerType;n[i]=s}}),new Ye({...this._def,shape:()=>n})}keyof(){return Ru(Ie.objectKeys(this.shape))}}Ye.create=(t,e)=>new Ye({shape:()=>t,unknownKeys:"strip",catchall:In.create(),typeName:ye.ZodObject,...Ee(e)}),Ye.strictCreate=(t,e)=>new Ye({shape:()=>t,unknownKeys:"strict",catchall:In.create(),typeName:ye.ZodObject,...Ee(e)}),Ye.lazycreate=(t,e)=>new Ye({shape:t,unknownKeys:"strip",catchall:In.create(),typeName:ye.ZodObject,...Ee(e)});class uo extends Ae{_parse(e){const{ctx:n}=this._processInputParams(e),i=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 Rt(u.ctx.common.issues));return re(n,{code:X.invalid_union,unionErrors:c}),Ce}if(n.common.async)return Promise.all(i.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 i){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 Rt(p));return re(n,{code:X.invalid_union,unionErrors:u}),Ce}}get options(){return this._def.options}}uo.create=(t,e)=>new uo({options:t,typeName:ye.ZodUnion,...Ee(e)});const lr=t=>t instanceof fo?lr(t.schema):t instanceof ln?lr(t.innerType()):t instanceof mo?[t.value]:t instanceof cr?t.options:t instanceof go?Ie.objectValues(t.enum):t instanceof yo?lr(t._def.innerType):t instanceof lo?[void 0]:t instanceof co?[null]:t instanceof Bn?[void 0,...lr(t.unwrap())]:t instanceof dr?[null,...lr(t.unwrap())]:t instanceof bl||t instanceof Co?lr(t.unwrap()):t instanceof vo?lr(t._def.innerType):[];class vs extends Ae{_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==oe.object)return re(n,{code:X.invalid_type,expected:oe.object,received:n.parsedType}),Ce;const i=this.discriminator,s=n.data[i],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:X.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[i]}),Ce)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,i){const s=new Map;for(const l of n){const c=lr(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:ye.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:s,...Ee(i)})}}function wl(t,e){const n=or(t),i=or(e);if(t===e)return{valid:!0,data:t};if(n===oe.object&&i===oe.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=wl(t[u],e[u]);if(!p.valid)return{valid:!1};c[u]=p.data}return{valid:!0,data:c}}else if(n===oe.array&&i===oe.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=wl(c,u);if(!p.valid)return{valid:!1};s.push(p.data)}return{valid:!0,data:s}}else return n===oe.date&&i===oe.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class po extends Ae{_parse(e){const{status:n,ctx:i}=this._processInputParams(e),s=(l,c)=>{if(vl(l)||vl(c))return Ce;const u=wl(l.value,c.value);return u.valid?((_l(l)||_l(c))&&n.dirty(),{status:n.value,value:u.data}):(re(i,{code:X.invalid_intersection_types}),Ce)};return i.common.async?Promise.all([this._def.left._parseAsync({data:i.data,path:i.path,parent:i}),this._def.right._parseAsync({data:i.data,path:i.path,parent:i})]).then(([l,c])=>s(l,c)):s(this._def.left._parseSync({data:i.data,path:i.path,parent:i}),this._def.right._parseSync({data:i.data,path:i.path,parent:i}))}}po.create=(t,e,n)=>new po({left:t,right:e,typeName:ye.ZodIntersection,...Ee(n)});class Tn extends Ae{_parse(e){const{status:n,ctx:i}=this._processInputParams(e);if(i.parsedType!==oe.array)return re(i,{code:X.invalid_type,expected:oe.array,received:i.parsedType}),Ce;if(i.data.length<this._def.items.length)return re(i,{code:X.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Ce;!this._def.rest&&i.data.length>this._def.items.length&&(re(i,{code:X.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const s=[...i.data].map((l,c)=>{const u=this._def.items[c]||this._def.rest;return u?u._parse(new En(i,l,i.path,c)):null}).filter(l=>!!l);return i.common.async?Promise.all(s).then(l=>mt.mergeArray(n,l)):mt.mergeArray(n,s)}get items(){return this._def.items}rest(e){return new Tn({...this._def,rest:e})}}Tn.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Tn({items:t,typeName:ye.ZodTuple,rest:null,...Ee(e)})};class ho extends Ae{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:i}=this._processInputParams(e);if(i.parsedType!==oe.object)return re(i,{code:X.invalid_type,expected:oe.object,received:i.parsedType}),Ce;const s=[],l=this._def.keyType,c=this._def.valueType;for(const u in i.data)s.push({key:l._parse(new En(i,u,i.path,u)),value:c._parse(new En(i,i.data[u],i.path,u)),alwaysSet:u in i.data});return i.common.async?mt.mergeObjectAsync(n,s):mt.mergeObjectSync(n,s)}get element(){return this._def.valueType}static create(e,n,i){return n instanceof Ae?new ho({keyType:e,valueType:n,typeName:ye.ZodRecord,...Ee(i)}):new ho({keyType:sn.create(),valueType:e,typeName:ye.ZodRecord,...Ee(n)})}}class _s extends Ae{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:i}=this._processInputParams(e);if(i.parsedType!==oe.map)return re(i,{code:X.invalid_type,expected:oe.map,received:i.parsedType}),Ce;const s=this._def.keyType,l=this._def.valueType,c=[...i.data.entries()].map(([u,p],f)=>({key:s._parse(new En(i,u,i.path,[f,"key"])),value:l._parse(new En(i,p,i.path,[f,"value"]))}));if(i.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 Ce;(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 Ce;(f.status==="dirty"||m.status==="dirty")&&n.dirty(),u.set(f.value,m.value)}return{status:n.value,value:u}}}}_s.create=(t,e,n)=>new _s({valueType:e,keyType:t,typeName:ye.ZodMap,...Ee(n)});class Dr extends Ae{_parse(e){const{status:n,ctx:i}=this._processInputParams(e);if(i.parsedType!==oe.set)return re(i,{code:X.invalid_type,expected:oe.set,received:i.parsedType}),Ce;const s=this._def;s.minSize!==null&&i.data.size<s.minSize.value&&(re(i,{code:X.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),n.dirty()),s.maxSize!==null&&i.data.size>s.maxSize.value&&(re(i,{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 Ce;m.status==="dirty"&&n.dirty(),f.add(m.value)}return{status:n.value,value:f}}const u=[...i.data.values()].map((p,f)=>l._parse(new En(i,p,i.path,f)));return i.common.async?Promise.all(u).then(p=>c(p)):c(u)}min(e,n){return new Dr({...this._def,minSize:{value:e,message:de.toString(n)}})}max(e,n){return new Dr({...this._def,maxSize:{value:e,message:de.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}}Dr.create=(t,e)=>new Dr({valueType:t,minSize:null,maxSize:null,typeName:ye.ZodSet,...Ee(e)});class si extends Ae{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==oe.function)return re(n,{code:X.invalid_type,expected:oe.function,received:n.parsedType}),Ce;function i(u,p){return hs({data:u,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,ps(),ri].filter(f=>!!f),issueData:{code:X.invalid_arguments,argumentsError:p}})}function s(u,p){return hs({data:u,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,ps(),ri].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 ai){const u=this;return wt(async function(...p){const f=new Rt([]),m=await u._def.args.parseAsync(p,l).catch(k=>{throw f.addIssue(i(p,k)),f}),v=await Reflect.apply(c,this,m);return await u._def.returns._def.type.parseAsync(v,l).catch(k=>{throw f.addIssue(s(v,k)),f})})}else{const u=this;return wt(function(...p){const f=u._def.args.safeParse(p,l);if(!f.success)throw new Rt([i(p,f.error)]);const m=Reflect.apply(c,this,f.data),v=u._def.returns.safeParse(m,l);if(!v.success)throw new Rt([s(m,v.error)]);return v.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new si({...this._def,args:Tn.create(e).rest(Nr.create())})}returns(e){return new si({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,n,i){return new si({args:e||Tn.create([]).rest(Nr.create()),returns:n||Nr.create(),typeName:ye.ZodFunction,...Ee(i)})}}class fo extends Ae{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})}}fo.create=(t,e)=>new fo({getter:t,typeName:ye.ZodLazy,...Ee(e)});class mo extends Ae{_parse(e){if(e.data!==this._def.value){const n=this._getOrReturnCtx(e);return re(n,{received:n.data,code:X.invalid_literal,expected:this._def.value}),Ce}return{status:"valid",value:e.data}}get value(){return this._def.value}}mo.create=(t,e)=>new mo({value:t,typeName:ye.ZodLiteral,...Ee(e)});function Ru(t,e){return new cr({values:t,typeName:ye.ZodEnum,...Ee(e)})}class cr extends Ae{constructor(){super(...arguments),oo.set(this,void 0)}_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),i=this._def.values;return re(n,{expected:Ie.joinValues(i),received:n.parsedType,code:X.invalid_type}),Ce}if(ms(this,oo)||Pu(this,oo,new Set(this._def.values)),!ms(this,oo).has(e.data)){const n=this._getOrReturnCtx(e),i=this._def.values;return re(n,{received:n.data,code:X.invalid_enum_value,options:i}),Ce}return wt(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 cr.create(e,{...this._def,...n})}exclude(e,n=this._def){return cr.create(this.options.filter(i=>!e.includes(i)),{...this._def,...n})}}oo=new WeakMap,cr.create=Ru;class go extends Ae{constructor(){super(...arguments),so.set(this,void 0)}_parse(e){const n=Ie.getValidEnumValues(this._def.values),i=this._getOrReturnCtx(e);if(i.parsedType!==oe.string&&i.parsedType!==oe.number){const s=Ie.objectValues(n);return re(i,{expected:Ie.joinValues(s),received:i.parsedType,code:X.invalid_type}),Ce}if(ms(this,so)||Pu(this,so,new Set(Ie.getValidEnumValues(this._def.values))),!ms(this,so).has(e.data)){const s=Ie.objectValues(n);return re(i,{received:i.data,code:X.invalid_enum_value,options:s}),Ce}return wt(e.data)}get enum(){return this._def.values}}so=new WeakMap,go.create=(t,e)=>new go({values:t,typeName:ye.ZodNativeEnum,...Ee(e)});class ai extends Ae{unwrap(){return this._def.type}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==oe.promise&&n.common.async===!1)return re(n,{code:X.invalid_type,expected:oe.promise,received:n.parsedType}),Ce;const i=n.parsedType===oe.promise?n.data:Promise.resolve(n.data);return wt(i.then(s=>this._def.type.parseAsync(s,{path:n.path,errorMap:n.common.contextualErrorMap})))}}ai.create=(t,e)=>new ai({type:t,typeName:ye.ZodPromise,...Ee(e)});class ln extends Ae{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ye.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:n,ctx:i}=this._processInputParams(e),s=this._def.effect||null,l={addIssue:c=>{re(i,c),c.fatal?n.abort():n.dirty()},get path(){return i.path}};if(l.addIssue=l.addIssue.bind(l),s.type==="preprocess"){const c=s.transform(i.data,l);if(i.common.async)return Promise.resolve(c).then(async u=>{if(n.value==="aborted")return Ce;const p=await this._def.schema._parseAsync({data:u,path:i.path,parent:i});return p.status==="aborted"?Ce:p.status==="dirty"||n.value==="dirty"?fs(p.value):p});{if(n.value==="aborted")return Ce;const u=this._def.schema._parseSync({data:c,path:i.path,parent:i});return u.status==="aborted"?Ce:u.status==="dirty"||n.value==="dirty"?fs(u.value):u}}if(s.type==="refinement"){const c=u=>{const p=s.refinement(u,l);if(i.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(i.common.async===!1){const u=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});return u.status==="aborted"?Ce:(u.status==="dirty"&&n.dirty(),c(u.value),{status:n.value,value:u.value})}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(u=>u.status==="aborted"?Ce:(u.status==="dirty"&&n.dirty(),c(u.value).then(()=>({status:n.value,value:u.value}))))}if(s.type==="transform")if(i.common.async===!1){const c=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});if(!ro(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:i.data,path:i.path,parent:i}).then(c=>ro(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:ye.ZodEffects,effect:e,...Ee(n)}),ln.createWithPreprocess=(t,e,n)=>new ln({schema:e,effect:{type:"preprocess",transform:t},typeName:ye.ZodEffects,...Ee(n)});class Bn extends Ae{_parse(e){return this._getType(e)===oe.undefined?wt(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Bn.create=(t,e)=>new Bn({innerType:t,typeName:ye.ZodOptional,...Ee(e)});class dr extends Ae{_parse(e){return this._getType(e)===oe.null?wt(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}dr.create=(t,e)=>new dr({innerType:t,typeName:ye.ZodNullable,...Ee(e)});class yo extends Ae{_parse(e){const{ctx:n}=this._processInputParams(e);let i=n.data;return n.parsedType===oe.undefined&&(i=this._def.defaultValue()),this._def.innerType._parse({data:i,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}yo.create=(t,e)=>new yo({innerType:t,typeName:ye.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Ee(e)});class vo extends Ae{_parse(e){const{ctx:n}=this._processInputParams(e),i={...n,common:{...n.common,issues:[]}},s=this._def.innerType._parse({data:i.data,path:i.path,parent:{...i}});return io(s)?s.then(l=>({status:"valid",value:l.status==="valid"?l.value:this._def.catchValue({get error(){return new Rt(i.common.issues)},input:i.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Rt(i.common.issues)},input:i.data})}}removeCatch(){return this._def.innerType}}vo.create=(t,e)=>new vo({innerType:t,typeName:ye.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Ee(e)});class Cs extends Ae{_parse(e){if(this._getType(e)!==oe.nan){const n=this._getOrReturnCtx(e);return re(n,{code:X.invalid_type,expected:oe.nan,received:n.parsedType}),Ce}return{status:"valid",value:e.data}}}Cs.create=t=>new Cs({typeName:ye.ZodNaN,...Ee(t)});const ox=Symbol("zod_brand");class bl extends Ae{_parse(e){const{ctx:n}=this._processInputParams(e),i=n.data;return this._def.type._parse({data:i,path:n.path,parent:n})}unwrap(){return this._def.type}}class _o extends Ae{_parse(e){const{status:n,ctx:i}=this._processInputParams(e);if(i.common.async)return(async()=>{const s=await this._def.in._parseAsync({data:i.data,path:i.path,parent:i});return s.status==="aborted"?Ce:s.status==="dirty"?(n.dirty(),fs(s.value)):this._def.out._parseAsync({data:s.value,path:i.path,parent:i})})();{const s=this._def.in._parseSync({data:i.data,path:i.path,parent:i});return s.status==="aborted"?Ce:s.status==="dirty"?(n.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:i.path,parent:i})}}static create(e,n){return new _o({in:e,out:n,typeName:ye.ZodPipeline})}}class Co extends Ae{_parse(e){const n=this._def.innerType._parse(e),i=s=>(ro(s)&&(s.value=Object.freeze(s.value)),s);return io(n)?n.then(s=>i(s)):i(n)}unwrap(){return this._def.innerType}}Co.create=(t,e)=>new Co({innerType:t,typeName:ye.ZodReadonly,...Ee(e)});function Mu(t,e={},n){return t?ii.create().superRefine((i,s)=>{var l,c;if(!t(i)){const u=typeof e=="function"?e(i):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})}}):ii.create()}const sx={object:Ye.lazycreate};var ye;(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"})(ye||(ye={}));const ax=(t,e={message:`Input not instance of ${t.name}`})=>Mu(n=>n instanceof t,e),Iu=sn.create,Lu=sr.create,lx=Cs.create,cx=ar.create,Ou=ao.create,dx=Vr.create,ux=gs.create,px=lo.create,hx=co.create,fx=ii.create,mx=Nr.create,gx=In.create,yx=ys.create,vx=an.create,_x=Ye.create,Cx=Ye.strictCreate,wx=uo.create,bx=vs.create,xx=po.create,kx=Tn.create,Sx=ho.create,Ex=_s.create,Tx=Dr.create,Bx=si.create,Ax=fo.create,Px=mo.create,Vx=cr.create,Nx=go.create,Dx=ai.create,Gu=ln.create,Fx=Bn.create,Rx=dr.create,Mx=ln.createWithPreprocess,Ix=_o.create;var ws=Object.freeze({__proto__:null,defaultErrorMap:ri,setErrorMap:Zb,getErrorMap:ps,makeIssue:hs,EMPTY_PATH:$b,addIssueToContext:re,ParseStatus:mt,INVALID:Ce,DIRTY:fs,OK:wt,isAborted:vl,isDirty:_l,isValid:ro,isAsync:io,get util(){return Ie},get objectUtil(){return yl},ZodParsedType:oe,getParsedType:or,ZodType:Ae,datetimeRegex:Fu,ZodString:sn,ZodNumber:sr,ZodBigInt:ar,ZodBoolean:ao,ZodDate:Vr,ZodSymbol:gs,ZodUndefined:lo,ZodNull:co,ZodAny:ii,ZodUnknown:Nr,ZodNever:In,ZodVoid:ys,ZodArray:an,ZodObject:Ye,ZodUnion:uo,ZodDiscriminatedUnion:vs,ZodIntersection:po,ZodTuple:Tn,ZodRecord:ho,ZodMap:_s,ZodSet:Dr,ZodFunction:si,ZodLazy:fo,ZodLiteral:mo,ZodEnum:cr,ZodNativeEnum:go,ZodPromise:ai,ZodEffects:ln,ZodTransformer:ln,ZodOptional:Bn,ZodNullable:dr,ZodDefault:yo,ZodCatch:vo,ZodNaN:Cs,BRAND:ox,ZodBranded:bl,ZodPipeline:_o,ZodReadonly:Co,custom:Mu,Schema:Ae,ZodSchema:Ae,late:sx,get ZodFirstPartyTypeKind(){return ye},coerce:{string:t=>sn.create({...t,coerce:!0}),number:t=>sr.create({...t,coerce:!0}),boolean:t=>ao.create({...t,coerce:!0}),bigint:t=>ar.create({...t,coerce:!0}),date:t=>Vr.create({...t,coerce:!0})},any:fx,array:vx,bigint:cx,boolean:Ou,date:dx,discriminatedUnion:bx,effect:Gu,enum:Vx,function:Bx,instanceof:ax,intersection:xx,lazy:Ax,literal:Px,map:Ex,nan:lx,nativeEnum:Nx,never:gx,null:hx,nullable:Rx,number:Lu,object:_x,oboolean:()=>Ou().optional(),onumber:()=>Lu().optional(),optional:Fx,ostring:()=>Iu().optional(),pipeline:Ix,preprocess:Mx,promise:Dx,record:Sx,set:Tx,strictObject:Cx,string:Iu,symbol:ux,transformer:Gu,tuple:kx,undefined:px,union:wx,unknown:mx,void:yx,NEVER:Ce,ZodIssueCode:X,quotelessJson:zb,ZodError:Rt});function Lx(t){throw new Error("Unexpected object: "+t)}const zu="upload://upload/",Zu="index://index/";function Ox(t){return t.startsWith(zu)}function Gx(t){return t.startsWith(Zu)}function zx(t){if(Gx(t)){const e=t.slice(Zu.length);return JSON.parse(decodeURIComponent(e)).path}else if(Ox(t)){const e=t.slice(zu.length);return JSON.parse(decodeURIComponent(e)).localPath}Lx(t)}ws.object({__isRef:ws.literal(!0).describe("Crucial marker for the block dependency tree reconstruction"),blockId:ws.string().describe("Upstream block id"),name:ws.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 Zx(t){return t.replace(/^.*[\\/]/,"")}const $x={key:0,ref:"label"},Ux={key:0,class:"required-icon"},Wx=["data-placeholder"],Hx={key:5,class:"pl-file-input__stats"},jx={key:0,class:"pl-file-input__error"},qx={key:1,class:"upl-file-input__helper"},$u=r.defineComponent({__name:"PlFileInput",props:{modelValue:{},label:{default:void 0},required:{type:Boolean},dashed:{type:Boolean},extensions:{default:void 0},fileDialogTitle:{default:void 0},placeholder:{default:void 0},progress:{default:void 0},error:{default:void 0},helper:{default:void 0},showFilenameOnly:{type:Boolean},cellStyle:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{emit:e}){const n=r.reactive({fileDialogOpen:!1}),i=r.useSlots(),s=e,l=t,c=r.computed(()=>{if(l.modelValue)try{const C=zx(l.modelValue).trim();return l.showFilenameOnly?Zx(C):C}catch(C){return console.error(C),l.modelValue}return""}),u=r.computed(()=>l.progress&&!l.progress.done),p=r.computed(()=>l.progress&&l.progress.done),f=r.computed(()=>l.error),m=r.computed(()=>l.error),v=r.computed(()=>{const{status:C,done:I}=l.progress??{};return!C||!C.bytesTotal?"":C.bytesProcessed&&!I?Ka(C.bytesProcessed,{})+" / "+Ka(C.bytesTotal,{}):Ka(C.bytesTotal,{})}),k=r.computed(()=>{var C;const{progress:I}=l;return I?{width:I.done?"100%":Math.round((((C=I.status)==null?void 0:C.progress)??0)*100)+"%"}:{}}),S=()=>{n.fileDialogOpen=!0},F=C=>{C.files.length&&s("update:modelValue",C.files[0])},T=()=>s("update:modelValue",void 0),N=r.ref();return l.cellStyle||Rn(N),(C,I)=>(r.openBlock(),r.createElementBlock(r.Fragment,null,[r.createElementVNode("div",{class:r.normalizeClass([{"pl-file-input__cell-style":!!C.cellStyle,"has-file":!!c.value},"pl-file-input__envelope"])},[r.createElementVNode("div",{ref_key:"rootRef",ref:N,class:r.normalizeClass(["pl-file-input",{dashed:C.dashed,error:f.value}]),tabindex:"0",onKeyup:r.withKeys(S,["enter"])},[r.createElementVNode("div",{class:"pl-file-input__progress",style:r.normalizeStyle(k.value)},null,4),I[3]||(I[3]=r.createTextVNode()),!C.cellStyle&&C.label?(r.openBlock(),r.createElementBlock("label",$x,[C.required?(r.openBlock(),r.createElementBlock("i",Ux)):r.createCommentVNode("",!0),I[1]||(I[1]=r.createTextVNode()),r.createElementVNode("span",null,r.toDisplayString(C.label),1),I[2]||(I[2]=r.createTextVNode()),r.unref(i).tooltip?(r.openBlock(),r.createBlock(r.unref(Tt),{key:1,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.renderSlot(C.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)],512)):r.createCommentVNode("",!0),I[4]||(I[4]=r.createTextVNode()),f.value?(r.openBlock(),r.createBlock(r.unref(Mn),{key:1,name:"restart"})):u.value?(r.openBlock(),r.createBlock(r.unref(Mn),{key:2,name:"cloud-upload"})):p.value?(r.openBlock(),r.createBlock(r.unref(Mn),{key:3,name:"success"})):(r.openBlock(),r.createBlock(r.unref(Mn),{key:4,name:"paper-clip"})),I[5]||(I[5]=r.createTextVNode()),r.createElementVNode("div",{"data-placeholder":C.placeholder??"Choose file",class:"pl-file-input__filename",onClick:r.withModifiers(S,["stop"])},r.toDisplayString(c.value),9,Wx),I[6]||(I[6]=r.createTextVNode()),v.value?(r.openBlock(),r.createElementBlock("div",Hx,r.toDisplayString(v.value),1)):r.createCommentVNode("",!0),I[7]||(I[7]=r.createTextVNode()),C.modelValue?(r.openBlock(),r.createBlock(r.unref(Mn),{key:6,name:"close",onClick:r.withModifiers(T,["stop"])})):r.createCommentVNode("",!0),I[8]||(I[8]=r.createTextVNode()),r.createVNode(ir,{class:"pl-file-input__contour"})],34),I[9]||(I[9]=r.createTextVNode()),f.value?(r.openBlock(),r.createElementBlock("div",jx,r.toDisplayString(m.value),1)):C.helper?(r.openBlock(),r.createElementBlock("div",qx,r.toDisplayString(C.helper),1)):r.createCommentVNode("",!0)],2),I[10]||(I[10]=r.createTextVNode()),r.createVNode(r.unref(Bu),{modelValue:n.fileDialogOpen,"onUpdate:modelValue":I[0]||(I[0]=Q=>n.fileDialogOpen=Q),extensions:C.extensions,title:C.fileDialogTitle,"onImport:files":F},null,8,["modelValue","extensions","title"])],64))}}),Kx={class:"pl-notification-alert__wrapper d-flex"},Yx={class:"pl-notification-alert__content flex-grow-1"},Jx={key:0,class:"pl-notification-alert__close"},Xx={key:0,class:"pl-notification-alert__actions d-flex"},Uu=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 i(){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",Kx,[r.createElementVNode("div",Yx,[r.renderSlot(s.$slots,"default")]),l[0]||(l[0]=r.createTextVNode()),s.closable?(r.openBlock(),r.createElementBlock("div",Jx,[r.createVNode(r.unref(sl),{icon:"close",onClick:i})])):r.createCommentVNode("",!0)]),l[1]||(l[1]=r.createTextVNode()),s.$slots.actions?(r.openBlock(),r.createElementBlock("div",Xx,[r.renderSlot(s.$slots,"actions")])):r.createCommentVNode("",!0)],6)):r.createCommentVNode("",!0)}}),Wu=r.defineComponent({__name:"PlCopyData",emits:["copy"],setup(t,{emit:e}){const n=e,i=r.ref(!1),s=r.computed(()=>i.value?"mask-clipboard-copied":"mask-clipboard");function l(){i.value=!0,setTimeout(()=>i.value=!1,700),n("copy")}return(c,u)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass([s.value,"mask-24"]),onClick:l},null,2))}}),Qx=r.defineComponent({__name:"ContextProvider",props:{context:{},contextKey:{}},setup(t){const e=t;return r.provide(e.contextKey,r.computed(()=>e.context)),(n,i)=>r.renderSlot(n.$slots,"default")}});function gt(t,e,n){return e>t?e:t>n?n:t}const xl=t=>r.computed(()=>{const e=[100],{min:n,max:i,step:s}=t.value;let l=n;for(;l<i;){l+=s;const c=(1-(gt(l,n,i)-n)/(i-n))*100;e.push(c)}return e}),ek={class:"ui-slider__wrapper"},tk={class:"ui-slider__label-section"},nk={key:0,class:"text-s"},rk={key:1,class:"ui-slider__value-static text-s"},ik={class:"ui-slider__base"},ok={class:"ui-slider__container"},sk={class:"ui-slider__container ui-slider__container-thumb"},ak={class:"ui-slider__input-wrapper d-flex"},lk=["value"],ck={key:0,class:"ui-slider__error"},dk=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(),i=e,s=t,l=r.reactive({deltaValue:0}),c=r.computed(()=>s.max-s.min),u=r.computed(()=>gt((s.modelValue??0)+l.deltaValue,s.min,s.max)),p=r.ref(s.modelValue),f=r.computed(()=>{const R=s.modelValue;return Number.isFinite(R)?R<s.min?`Min value: ${s.min}`:R>s.max?`Max value: ${s.max}`:s.error:"Not a number"}),m=r.computed(()=>s),v=xl(m),k=r.computed(()=>(u.value-s.min)/c.value),S=r.computed(()=>({right:Math.ceil((1-k.value)*100)+"%"})),F=r.computed(()=>({right:`calc(${Math.ceil((1-k.value)*100)}%) `})),T=r.ref(),N=r.ref();r.watch(()=>s.modelValue,R=>{p.value=R});function C(R){const U=gt(R,s.min,s.max);return Math.round((U+Number.EPSILON)*(1/s.step))/(1/s.step)}rr(N,R=>{var U;it((U=r.unref(T))==null?void 0:U.getBoundingClientRect(),z=>{const{dx:P}=R;l.deltaValue=P/z.width*c.value,p.value=C(gt((s.modelValue??0)+l.deltaValue,s.min,s.max)),R.stop&&(i("update:modelValue",C(u.value)),l.deltaValue=0)})});function I(R){i("update:modelValue",C(R))}function Q(R){I(+R.target.value)}function M(R){["ArrowDown","ArrowUp","ArrowRight","ArrowLeft","Enter"].includes(R.code)&&R.preventDefault();const U=R.code==="ArrowUp"||R.code==="ArrowRight"?s.step*1:R.code==="ArrowDown"||R.code==="ArrowLeft"?s.step*-1:0;I(s.modelValue+U)}return(R,U)=>(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",ek,[r.createElementVNode("div",tk,[R.label?(r.openBlock(),r.createElementBlock("label",nk,[r.createElementVNode("span",null,r.toDisplayString(R.label),1),U[1]||(U[1]=r.createTextVNode()),r.unref(n).tooltip?(r.openBlock(),r.createBlock(r.unref(Tt),{key:0,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.renderSlot(R.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0),U[2]||(U[2]=r.createTextVNode()),s.mode==="text"?(r.openBlock(),r.createElementBlock("div",rk,r.toDisplayString(p.value)+r.toDisplayString(R.measure),1)):r.createCommentVNode("",!0)]),U[6]||(U[6]=r.createTextVNode()),r.createElementVNode("div",ik,[r.createElementVNode("div",ok,[r.createElementVNode("div",{ref_key:"barRef",ref:T,class:"ui-slider__bar"},[r.createElementVNode("div",{class:"ui-slider__progress",style:r.normalizeStyle(S.value)},null,4)],512)]),U[5]||(U[5]=r.createTextVNode()),r.createElementVNode("div",sk,[s.breakpoints?(r.openBlock(!0),r.createElementBlock(r.Fragment,{key:0},r.renderList(r.unref(v),(z,P)=>(r.openBlock(),r.createElementBlock("div",{key:P,style:r.normalizeStyle({right:`${z}%`}),class:"ui-slider__thumb-step"},null,4))),128)):r.createCommentVNode("",!0),U[4]||(U[4]=r.createTextVNode()),r.createElementVNode("div",{ref_key:"thumbRef",ref:N,tabindex:"0",class:"ui-slider__thumb ui-slider__thumb-active",style:r.normalizeStyle(F.value),onKeydown:M},U[3]||(U[3]=[r.createElementVNode("div",{class:"ui-slider__thumb-focused-contour"},null,-1)]),36)])])]),U[7]||(U[7]=r.createTextVNode()),r.createElementVNode("div",ak,[s.mode==="input"?(r.openBlock(),r.createElementBlock("input",{key:0,value:p.value,class:"ui-slider__value text-s",onChange:U[0]||(U[0]=z=>Q(z))},null,40,lk)):r.createCommentVNode("",!0)])],2),U[8]||(U[8]=r.createTextVNode()),f.value?(r.openBlock(),r.createElementBlock("div",ck,r.toDisplayString(f.value),1)):r.createCommentVNode("",!0)],2))}});function uk(t,e=null,n=null){function i(u){const{scrollTop:p,scrollHeight:f,clientHeight:m}=u;if(!(f>m)||!e)return null;const v=f-p-m,k=p>e?e:0,S=v>e?m-e-k:m;return`linear-gradient(
52
52
  to bottom,
53
53
  transparent,
54
+ black ${k}px,
54
55
  black ${S}px,
55
- black ${x}px,
56
56
  transparent 100%
57
- )`}function s(u){const{scrollLeft:p,scrollWidth:f,clientWidth:m}=u;if(!(f>m)||!n)return null;const v=f-p-m,S=p>n?n:0,x=v>n?m-n-S:m;return`linear-gradient(
57
+ )`}function s(u){const{scrollLeft:p,scrollWidth:f,clientWidth:m}=u;if(!(f>m)||!n)return null;const v=f-p-m,k=p>n?n:0,S=v>n?m-n-k:m;return`linear-gradient(
58
58
  to right,
59
59
  transparent,
60
+ black ${k}px,
60
61
  black ${S}px,
61
- black ${x}px,
62
62
  transparent 100%
63
- )`}function l(){const u=t.value;if(!u)return;const p=[i(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 d=el(l);r.onMounted(l),et(window,"scroll",d,!0),et(window,"resize",d,!0)}function Hu(t,e){gu(()=>{it(r.unref(t),n=>{yu(n,()=>e(n))})}),r.onUnmounted(()=>{it(r.unref(t),n=>{vu(n)})})}const ur={item:"sortable__item",animate:"sortable__animate"},wo=t=>t.getBoundingClientRect().y,ju=t=>{const{y:e,height:n}=t.getBoundingClientRect();return e+Math.ceil(n/2)},uk=t=>{const{y:e,height:n}=t.getBoundingClientRect();return e+n};function pk(t,e){const n={item:void 0,options(){var x;return[...((x=t.value)==null?void 0:x.children)??[]]}},i=r.computed(()=>n.options()),s=e.shakeBuffer??10,l=e.reorderDelay??100;function d(x){const F=e.handle?this.querySelector(e.handle):null;F&&!F.contains(x.target)||(this.classList.remove(ur.animate),this.classList.add(ur.item),n.item={el:this,y:x.y,dy:0,orderChanged:!1})}function u(x){const F=n.options();return F.slice(0,F.indexOf(x))}function p(x){const F=n.options();return F.slice(F.indexOf(x)+1)}function f(x,F){const T=n.options().filter(k=>k!==F),A=T.indexOf(x);return T.splice(A,0,F),T}function m(x,F){const T=n.options().filter(k=>k!==F),A=T.indexOf(x);return T.splice(A+1,0,F),T}function v(x,F){x.dy=F-x.y,x.el.style.setProperty("transform",`translateY(${x.dy}px)`)}function S(x){var F;if(!n.item)return;const{el:T}=n.item;if(!T.isConnected){n.item=void 0;return}const A=x.map(X=>wo(X)),k=wo(T);(F=t.value)==null||F.replaceChildren(...x);const D=wo(T),$=x.map(X=>wo(X)),z=[];for(let X=0;X<$.length;X++){const I=x[X];if(I===n.item.el)continue;const N=$[X],j=A[X]-N;I.style.transform=`translateY(${j}px)`,z.push(I)}const L=D-k;n.item.y=n.item.y+L,n.item.dy=n.item.dy-L,n.item.orderChanged=!0,n.item.el.style.setProperty("transform",`translateY(${n.item.dy}px)`),z.forEach(X=>X.classList.remove(ur.animate)),requestAnimationFrame(function(){z.forEach(X=>{X.classList.add(ur.animate),X.style.transform="",X.addEventListener("transitionend",()=>{X.classList.remove(ur.animate)})})})}et(window,"mousemove",x=>{if(!n.item)return;const{el:F}=n.item;v(n.item,x.y);const T=wo(n.item.el),A=uk(n.item.el),k=u(F),D=p(F);k.forEach($=>{const z=ju($);T+s<z&&S(f($,F))}),D.forEach($=>{const z=ju($);A-s>z&&S(m($,F))})}),et(window,"mouseup",()=>{if(!n.item)return;const{el:x,orderChanged:F}=n.item;x.classList.add(ur.animate),x.style.removeProperty("transform"),x.addEventListener("transitionend",()=>{x.classList.remove(ur.animate,ur.item)}),setTimeout(()=>{if(!F)return;const T=n.options().map(k=>Number(k.getAttribute("data-index"))),A=t.value;if(A){for(const k of n.options())A.removeChild(k);i.value.forEach(k=>{A.appendChild(k)})}e.onChange(T)},l),n.item=void 0}),r.watchEffect(()=>{i.value.forEach((x,F)=>{x.removeEventListener("mousedown",d),x.addEventListener("mousedown",d),x.setAttribute("data-index",String(F))})})}function hk(t,e){let n;r.onMounted(()=>{n=setInterval(t,e)}),r.onUnmounted(()=>clearInterval(n))}function fk(t,e,n){const i=r.reactive({data:qa.deepClone(e(t.value)),changed:!1});return r.watch(()=>i.data,s=>{i.changed?n(qa.deepClone(s)):i.changed=!0},{deep:!0}),r.watch(t,s=>{Object.assign(i,{data:qa.deepClone(e(s)),changed:!1})},{deep:!0,immediate:!0}),i}function mk(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(i){this.error=i}finally{this.isLoading=!1}},debounce(n,i=1e3){return Yd(()=>{const s=n();this.run(...s).catch(console.error)},i)}});return e.run=e.run.bind(e),e}function gk(t,e){function n(d,u){const p=r.unref(t);if(!p)return;const f=`translate(${u.x-d.x}px, ${u.y-d.y}px)`;p.style.setProperty("transform",f),e(u)}function i(d){const u=p=>n(d,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 d;(d=r.unref(t))==null||d.addEventListener("mousedown",i)}function l(){var d;(d=r.unref(t))==null||d.removeEventListener("mousedown",i)}r.onMounted(s),r.onUnmounted(l)}const yk={class:"ui-slider__wrapper"},vk={class:"ui-slider__label-section"},_k={key:0,class:"text-s"},Ck={class:"ui-slider__base"},wk={class:"ui-slider__container"},bk={class:"ui-slider__container ui-slider__container-thumb"},xk=["data-percent"],kk=["data-percent"],Sk=["data-percent"],Ek={key:0,class:"ui-slider__error"},Tk=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(),i=e,s=t,l=r.reactive({deltaValue1:0,deltaValue2:0,deltaValue3:0}),d=r.ref(),u=r.ref(),p=r.ref(),f=r.ref(),m=r.computed(()=>s.max-s.min),v=r.computed(()=>s),S=xl(v),x=r.computed(()=>gt((s.modelValue[0]??0)+l.deltaValue1,s.min,s.max)),F=r.computed(()=>gt((s.modelValue[1]??0)+l.deltaValue2,s.min,s.max)),T=r.computed(()=>gt((s.modelValue[2]??0)+l.deltaValue3,s.min,s.max)),A=r.computed(()=>{const O=s.modelValue;if(!(Array.isArray(O)&&O.length===3&&O.every(ve=>Number.isFinite(ve))))return"Expected model [number, number, number]";const Q=[];return[...s.modelValue].forEach(ve=>{ve>s.max&&Q.push(`Max model value must be lower than max props ${s.max}.`),ve<s.min&&Q.push("Min model value must be greater than max props.")}),Q.length>0?Q.join(" "):s.error}),k=r.computed(()=>(x.value-s.min)/m.value),D=r.computed(()=>(F.value-s.min)/m.value),$=r.computed(()=>(T.value-s.min)/m.value),z=r.computed(()=>Z()),L=r.computed(()=>({right:z.value[0]+"%",left:100-z.value[2]+"%"})),X=r.computed(()=>({right:Math.ceil((1-k.value)*100)+"%"})),I=r.computed(()=>({right:Math.ceil((1-D.value)*100)+"%"})),N=r.computed(()=>({right:Math.ceil((1-$.value)*100)+"%"}));rr(u,O=>{var Q;it((Q=r.unref(d))==null?void 0:Q.getBoundingClientRect(),ve=>{const{dx:xe}=O;l.deltaValue1=xe/ve.width*m.value,u.value&&j(u.value,s.modelValue[0],l.deltaValue1),O.stop&&(le([K(x.value),K(F.value),K(T.value)]),l.deltaValue1=0)})}),rr(p,O=>{var Q;it((Q=r.unref(d))==null?void 0:Q.getBoundingClientRect(),ve=>{const{dx:xe}=O;l.deltaValue2=xe/ve.width*m.value,p.value&&j(p.value,s.modelValue[1],l.deltaValue2),O.stop&&(le([K(x.value),K(F.value),K(T.value)]),l.deltaValue2=0)})}),rr(f,O=>{var Q;it((Q=r.unref(d))==null?void 0:Q.getBoundingClientRect(),ve=>{const{dx:xe}=O;l.deltaValue3=xe/ve.width*m.value,f.value&&j(f.value,s.modelValue[2],l.deltaValue3),O.stop&&(le([K(x.value),K(F.value),K(T.value)]),l.deltaValue3=0)})});function j(O,Q,ve){const xe=K(gt((Q??0)+ve,s.min,s.max));O.dataset.percent=`${xe}${s.measure}`,U()}function Z(){const O=Math.ceil((1-k.value)*100),Q=Math.ceil((1-D.value)*100),ve=Math.ceil((1-$.value)*100);return[O,Q,ve].sort((xe,Gt)=>xe-Gt)}function K(O){const Q=gt(O,s.min,s.max);return Math.round((Q+Number.EPSILON)*(1/s.step))/(1/s.step)}function le(O){i("update:modelValue",O)}function U(){const O=Number(X.value.right.substring(0,X.value.right.length-1)),Q=Number(I.value.right.substring(0,I.value.right.length-1)),ve=Number(N.value.right.substring(0,N.value.right.length-1)),xe=[{r:O,th:u},{r:Q,th:p},{r:ve,th:f}].sort((Gt,jt)=>Gt.r-jt.r);xe[0].th.value&&(xe[0].th.value.dataset.hint="high"),xe[1].th.value&&(xe[1].th.value.dataset.hint="mid"),xe[2].th.value&&(xe[2].th.value.dataset.hint="low")}function P(O,Q){["ArrowDown","ArrowUp","ArrowRight","ArrowLeft","Enter"].includes(O.code)&&O.preventDefault();const ve=O.code==="ArrowUp"||O.code==="ArrowRight"?s.step*1:O.code==="ArrowDown"||O.code==="ArrowLeft"?s.step*-1:0,xe=[...s.modelValue];xe[Q]=gt(xe[Q]+ve,s.min,s.max),le(xe),U()}return r.onMounted(()=>{U()}),(O,Q)=>(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",yk,[r.createElementVNode("div",vk,[O.label?(r.openBlock(),r.createElementBlock("label",_k,[r.createElementVNode("span",null,r.toDisplayString(O.label),1),Q[3]||(Q[3]=r.createTextVNode()),r.unref(n).tooltip?(r.openBlock(),r.createBlock(r.unref(Tt),{key:0,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.renderSlot(O.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0)]),Q[11]||(Q[11]=r.createTextVNode()),r.createElementVNode("div",Ck,[r.createElementVNode("div",wk,[r.createElementVNode("div",{ref_key:"barRef",ref:d,class:"ui-slider__bar"},[r.createElementVNode("div",{class:"ui-slider__progress",style:r.normalizeStyle(L.value)},null,4)],512)]),Q[10]||(Q[10]=r.createTextVNode()),r.createElementVNode("div",bk,[s.breakpoints?(r.openBlock(!0),r.createElementBlock(r.Fragment,{key:0},r.renderList(r.unref(S),(ve,xe)=>(r.openBlock(),r.createElementBlock("div",{key:xe,style:r.normalizeStyle({right:`${ve}%`}),class:"ui-slider__thumb-step"},null,4))),128)):r.createCommentVNode("",!0),Q[7]||(Q[7]=r.createTextVNode()),r.createElementVNode("div",{ref_key:"thumbRef1",ref:u,style:r.normalizeStyle(X.value),"data-percent":s.modelValue[0]+"%",class:"ui-slider__thumb ui-slider__triple-thumb",r1:"",tabindex:"0",onKeydown:Q[0]||(Q[0]=ve=>P(ve,0))},Q[4]||(Q[4]=[r.createElementVNode("div",{class:"ui-slider__thumb-focused-contour"},null,-1)]),44,xk),Q[8]||(Q[8]=r.createTextVNode()),r.createElementVNode("div",{ref_key:"thumbRef2",ref:p,style:r.normalizeStyle(I.value),"data-percent":s.modelValue[1]+"%",class:"ui-slider__thumb ui-slider__triple-thumb",r2:"",tabindex:"0",onKeydown:Q[1]||(Q[1]=ve=>P(ve,1))},Q[5]||(Q[5]=[r.createElementVNode("div",{class:"ui-slider__thumb-focused-contour"},null,-1)]),44,kk),Q[9]||(Q[9]=r.createTextVNode()),r.createElementVNode("div",{ref_key:"thumbRef3",ref:f,style:r.normalizeStyle(N.value),"data-percent":s.modelValue[2]+"%",class:"ui-slider__thumb ui-slider__triple-thumb",r3:"",tabindex:"0",onKeydown:Q[2]||(Q[2]=ve=>P(ve,2))},Q[6]||(Q[6]=[r.createElementVNode("div",{class:"ui-slider__thumb-focused-contour"},null,-1)]),44,Sk)])])]),Q[12]||(Q[12]=r.createTextVNode()),Q[13]||(Q[13]=r.createElementVNode("div",{class:"ui-slider__input-wrapper d-flex"},null,-1))],2),Q[14]||(Q[14]=r.createTextVNode()),A.value?(r.openBlock(),r.createElementBlock("div",Ek,r.toDisplayString(A.value),1)):r.createCommentVNode("",!0)],2))}}),Bk={class:"ui-input-range__separator"},Ak=r.defineComponent({__name:"InputRange",props:{modelValue:{},separator:{default:"-"}},emits:["update:modelValue","change"],setup(t,{emit:e}){const n=t,i=e,s=r.reactive({left:n.modelValue[0],right:n.modelValue[1]}),l=r.ref(!1),d=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(){i("update:modelValue",[+s.left,+s.right]),i("change",[+s.left,+s.right])}function f(m,v){const S=v.target.value;/^[0-9]{0,2}$/.test(S)?m?s.left=+S:s.right=+S:m?s.left=+S.slice(0,S.length-1):s.right=+S.slice(0,S.length-1)}return(m,v)=>(r.openBlock(),r.createElementBlock("div",r.mergeProps({class:[d.value,"ui-input-range"]},m.$attrs),[r.withDirectives(r.createElementVNode("input",{"onUpdate:modelValue":v[0]||(v[0]=S=>u.value.left=S),class:"text-s",type:"text",onChange:p,onFocus:v[1]||(v[1]=S=>l.value=!0),onFocusout:v[2]||(v[2]=S=>l.value=!1),onInput:v[3]||(v[3]=S=>f(!0,S))},null,544),[[r.vModelText,u.value.left]]),v[8]||(v[8]=r.createTextVNode()),r.createElementVNode("div",Bk,r.toDisplayString(n.separator),1),v[9]||(v[9]=r.createTextVNode()),r.withDirectives(r.createElementVNode("input",{"onUpdate:modelValue":v[4]||(v[4]=S=>u.value.right=S),class:"text-s",type:"text",onChange:p,onFocus:v[5]||(v[5]=S=>l.value=!0),onFocusout:v[6]||(v[6]=S=>l.value=!1),onInput:v[7]||(v[7]=S=>f(!1,S))},null,544),[[r.vModelText,u.value.right]])],16))}}),Pk={class:"ui-slider__wrapper"},Vk={class:"ui-slider__label-section"},Nk={key:0,class:"text-s"},Dk={key:1,class:"ui-slider__value-static text-s"},Fk={class:"ui-slider__base"},Rk={class:"ui-slider__container"},Mk={class:"ui-slider__container ui-slider__container-thumb"},Ik={class:"ui-slider__input-wrapper d-flex"},Lk={key:0,class:"ui-slider__error"},Ok=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(),i=e,s=t,l=r.reactive({deltaValue1:0,deltaValue2:0}),d=r.ref(),u=r.ref(),p=r.ref(),f=r.ref(s.modelValue),m=r.ref(s.modelValue[0]),v=r.ref(s.modelValue[1]),S=r.computed(()=>s),x=xl(S),F=r.computed(()=>[m.value,v.value].sort((U,P)=>U-P).join("-")),T=r.computed(()=>s.max-s.min),A=r.computed(()=>gt((s.modelValue[0]??0)+l.deltaValue1,s.min,s.max)),k=r.computed(()=>gt((s.modelValue[1]??0)+l.deltaValue2,s.min,s.max)),D=r.computed(()=>{const U=s.modelValue;return Array.isArray(U)&&U.length===2&&U.every(P=>Number.isFinite(P))?s.error:"Expected model [number, number]"}),$=r.computed(()=>(A.value-s.min)/T.value),z=r.computed(()=>(k.value-s.min)/T.value),L=r.computed(()=>j()),X=r.computed(()=>({right:L.value[0]+"%",left:100-L.value[1]+"%"})),I=r.computed(()=>({right:Math.ceil((1-$.value)*100)+"%"})),N=r.computed(()=>({right:Math.ceil((1-z.value)*100)+"%"}));r.watch(()=>s.modelValue,U=>{f.value=U,m.value=+U[0],v.value=+U[1]},{immediate:!0}),rr(u,U=>{var P;it((P=r.unref(d))==null?void 0:P.getBoundingClientRect(),O=>{const{dx:Q}=U;l.deltaValue1=Q/O.width*T.value,m.value=Z(gt((s.modelValue[0]??0)+l.deltaValue1,s.min,s.max)),f.value=[m.value,v.value].sort((ve,xe)=>ve-xe),U.stop&&(K([Z(A.value),Z(k.value)]),l.deltaValue1=0)})}),rr(p,U=>{var P;it((P=r.unref(d))==null?void 0:P.getBoundingClientRect(),O=>{const{dx:Q}=U;l.deltaValue2=Q/O.width*T.value,v.value=Z(gt((s.modelValue[1]??0)+l.deltaValue2,s.min,s.max)),f.value=[m.value,v.value].sort((ve,xe)=>ve-xe),U.stop&&(K([Z(A.value),Z(k.value)]),l.deltaValue2=0)})});function j(){const U=Math.ceil((1-$.value)*100),P=Math.ceil((1-z.value)*100);return[U,P].sort((O,Q)=>O-Q)}function Z(U){const P=gt(U,s.min,s.max);return Math.round((P+Number.EPSILON)*(1/s.step))/(1/s.step)}function K(U){i("update:modelValue",U)}function le(U,P){["ArrowDown","ArrowUp","ArrowRight","ArrowLeft","Enter"].includes(U.code)&&U.preventDefault();const O=U.code==="ArrowUp"||U.code==="ArrowRight"?s.step*1:U.code==="ArrowDown"||U.code==="ArrowLeft"?s.step*-1:0,Q=[...s.modelValue];Q[P]=gt(Q[P]+O,s.min,s.max),K(Q)}return(U,P)=>(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",Pk,[r.createElementVNode("div",Vk,[U.label?(r.openBlock(),r.createElementBlock("label",Nk,[r.createElementVNode("span",null,r.toDisplayString(U.label),1),P[3]||(P[3]=r.createTextVNode()),r.unref(n).tooltip?(r.openBlock(),r.createBlock(r.unref(Tt),{key:0,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.renderSlot(U.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0),P[4]||(P[4]=r.createTextVNode()),s.mode==="text"?(r.openBlock(),r.createElementBlock("div",Dk,r.toDisplayString(F.value),1)):r.createCommentVNode("",!0)]),P[10]||(P[10]=r.createTextVNode()),r.createElementVNode("div",Fk,[r.createElementVNode("div",Rk,[r.createElementVNode("div",{ref_key:"barRef",ref:d,class:"ui-slider__bar"},[r.createElementVNode("div",{class:"ui-slider__progress",style:r.normalizeStyle(X.value)},null,4)],512)]),P[9]||(P[9]=r.createTextVNode()),r.createElementVNode("div",Mk,[s.breakpoints?(r.openBlock(!0),r.createElementBlock(r.Fragment,{key:0},r.renderList(r.unref(x),(O,Q)=>(r.openBlock(),r.createElementBlock("div",{key:Q,style:r.normalizeStyle({right:`${O}%`}),class:"ui-slider__thumb-step"},null,4))),128)):r.createCommentVNode("",!0),P[7]||(P[7]=r.createTextVNode()),r.createElementVNode("div",{ref_key:"thumbRef1",ref:u,style:r.normalizeStyle(I.value),class:"ui-slider__thumb",tabindex:"0",onKeydown:P[0]||(P[0]=O=>le(O,0))},P[5]||(P[5]=[r.createElementVNode("div",{class:"ui-slider__thumb-focused-contour"},null,-1)]),36),P[8]||(P[8]=r.createTextVNode()),r.createElementVNode("div",{ref_key:"thumbRef2",ref:p,style:r.normalizeStyle(N.value),class:"ui-slider__thumb",tabindex:"0",onKeydown:P[1]||(P[1]=O=>le(O,1))},P[6]||(P[6]=[r.createElementVNode("div",{class:"ui-slider__thumb-focused-contour"},null,-1)]),36)])])]),P[11]||(P[11]=r.createTextVNode()),r.createElementVNode("div",Ik,[s.mode==="input"?(r.openBlock(),r.createBlock(Ak,{key:0,modelValue:f.value,"onUpdate:modelValue":P[2]||(P[2]=O=>f.value=O),class:"ui-focused-border",onChange:K},null,8,["modelValue"])):r.createCommentVNode("",!0)])],2),P[12]||(P[12]=r.createTextVNode()),D.value?(r.openBlock(),r.createElementBlock("div",Lk,r.toDisplayString(D.value),1)):r.createCommentVNode("",!0)],2))}}),Gk=r.defineComponent({__name:"VScroll",props:{scrollTop:{},clientHeight:{},scrollHeight:{}},emits:["update:scrollTop"],setup(t,{emit:e}){const n=e,i=t,s=r.ref(),l=r.computed(()=>i.clientHeight/(i.scrollHeight||1)),d=r.computed(()=>l.value<1),u=r.computed(()=>{const p=r.unref(l);return{top:i.scrollTop*p+"px",height:Math.floor(i.clientHeight*p)+"px"}});return et(s,"pointerdown",p=>{const f={clientY:p.clientY},m=dl(document,"mousemove",v=>{const S=(v.clientY-f.clientY)/l.value;n("update:scrollTop",i.scrollTop+S),f.clientY=v.clientY});["mouseup","pointercancel"].forEach(v=>{document.addEventListener(v,m,{once:!0})})}),(p,f)=>d.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)}}),zk=r.defineComponent({__name:"HScroll",props:{scrollLeft:{},clientWidth:{},scrollWidth:{}},emits:["update:scrollLeft"],setup(t,{emit:e}){const n=e,i=t,s=r.ref(),l=r.computed(()=>i.clientWidth/(i.scrollWidth||1)),d=r.computed(()=>l.value<1),u=r.computed(()=>{const p=r.unref(l);return{left:i.scrollLeft*p+"px",width:Math.floor(i.clientWidth*p)+"px"}});return et(s,"pointerdown",p=>{const f={clientX:p.clientX},m=dl(document,"mousemove",v=>{const S=(v.clientX-f.clientX)/l.value;n("update:scrollLeft",i.scrollLeft+S),f.clientX=v.clientX});["mouseup","pointercancel"].forEach(v=>{document.addEventListener(v,m,{once:!0})})}),(p,f)=>d.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)}}),Zk={class:"ui-scrollable"},$k=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 i(u){vC(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,i(p)};function l(u){it(r.unref(e),p=>{p.scrollTop=u,i(p)})}function d(u){it(r.unref(e),p=>{p.scrollLeft=u,i(p)})}return Hu(e,u=>{it(u,p=>i(p))}),r.onMounted(()=>{it(r.unref(e),u=>{i(u),u.addEventListener("wheel",s)})}),r.onUnmounted(()=>{it(r.unref(e),u=>u.removeEventListener("wheel",s))}),(u,p)=>(r.openBlock(),r.createElementBlock("div",Zk,[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(Gk,{"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(zk,{"scroll-left":n.scrollLeft,"client-width":n.clientWidth,"scroll-width":n.scrollWidth,onWheel:p[1]||(p[1]=r.withModifiers(()=>{},["stop"])),"onUpdate:scrollLeft":d},null,8,["scroll-left","client-width","scroll-width"])]))}}),Uk="add.svg",Wk="box.svg",Hk="calendar.svg",jk="checkmark.svg",qk="clipboard.svg",Kk="close.svg",Yk="copy.svg",Jk="download.svg",Xk="duplicate.svg",Qk="edit.svg",eS="error.svg",tS="filter.svg",nS="help.svg",rS="info.svg",iS="link.svg",oS="loading.svg",sS="lock.svg",aS="maximize.svg",lS="minimize.svg",cS="minus.svg",dS="more.svg",uS="open.svg",pS="pause.svg",hS="play.svg",fS="renew.svg",mS="restart.svg",gS="reverse.svg",yS="settings.svg",vS="sort.svg",_S="stop.svg",CS="success.svg",wS="time.svg",bS="tune.svg",xS="warning.svg",kS="zip.svg",SS={add:Uk,"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:Wk,calendar:Hk,"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:jk,"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:qk,close:Kk,copy:Yk,"data-dimentions":"data-dimentions.svg","delete-bin":"delete-bin.svg","delete-circle":"delete-circle.svg","delete-clear":"delete-clear.svg",download:Jk,"drag-dots":"drag-dots.svg",duplicate:Xk,edit:Qk,error:eS,export:"export.svg","filter-on":"filter-on.svg",filter:tS,"help-outline":"help-outline.svg",help:nS,"info-outline":"info-outline.svg",info:rS,"jump-link":"jump-link.svg",link:iS,loading:oS,lock:sS,maximize:aS,minimize:lS,minus:cS,more:dS,open:uS,"paper-clip":"paper-clip.svg",pause:pS,play:hS,renew:fS,restart:mS,reverse:gS,settings:yS,sort:vS,stop:_S,success:CS,time:wS,tune:bS,warning:xS,"x-axis":"x-axis.svg","y-axis":"y-axis.svg",zip:kS},ES="add.svg",TS="annotate.svg",BS="annotation.svg",AS="area.svg",PS="axes.svg",VS="bar.svg",NS="bindot.svg",DS="box.svg",FS="boxplot.svg",RS="bubble.svg",MS="calendar.svg",IS="canvas.svg",LS="checkbox.svg",OS="checkmark.svg",GS="clipboard.svg",zS="close.svg",ZS="cluster.svg",$S="code.svg",US="color.svg",WS="columns.svg",HS="container.svg",jS="cookie.svg",qS="copy.svg",KS="cpu.svg",YS="debug.svg",JS="dna.svg",XS="download.svg",QS="duplicate.svg",e1="edit.svg",t1="error.svg",n1="filter.svg",r1="generate.svg",i1="graph.svg",o1="heatmap.svg",s1="help.svg",a1="info.svg",l1="jitter.svg",c1="lasso.svg",d1="layers.svg",u1="learn.svg",p1="legend.svg",h1="line.svg",f1="link.svg",m1="loading.svg",g1="lock.svg",y1="maximize.svg",v1="menu.svg",_1="minimize.svg",C1="minus.svg",w1="more.svg",b1="pause.svg",x1="pin.svg",k1="play.svg",S1="product.svg",E1="publications.svg",T1="renew.svg",B1="restart.svg",A1="reverse.svg",P1="search.svg",V1="server.svg",N1="settings.svg",D1="sina.svg",F1="skatterplot.svg",R1="slice.svg",M1="sort.svg",I1="statistics.svg",L1="stop.svg",O1="success.svg",G1="table.svg",z1="template.svg",Z1="terminal.svg",$1="time.svg",U1="tune.svg",W1="venn.svg",H1="violin.svg",j1="warning.svg",q1="wetlab.svg",K1="zip.svg",Y1={"add-layer":"add-layer.svg",add:ES,"align-center":"align-center.svg","align-left":"align-left.svg","align-right":"align-right.svg",annotate:TS,annotation:BS,area:AS,"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:PS,"bar-cross":"bar-cross.svg","bar-error":"bar-error.svg","bar-stacked":"bar-stacked.svg","bar-trend":"bar-trend.svg",bar:VS,bindot:NS,box:DS,"boxplot-binned":"boxplot-binned.svg","boxplot-jitter":"boxplot-jitter.svg","boxplot-notched":"boxplot-notched.svg",boxplot:FS,bubble:RS,calendar:MS,canvas:IS,"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:LS,checkmark:OS,"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:GS,close:zS,"cloud-download":"cloud-download.svg","cloud-offline":"cloud-offline.svg","cloud-online":"cloud-online.svg","cloud-upload":"cloud-upload.svg",cluster:ZS,code:$S,"color-fill":"color-fill.svg","color-none":"color-none.svg","color-stroke":"color-stroke.svg",color:US,columns:WS,"connected-points":"connected-points.svg",container:HS,cookie:jS,copy:qS,cpu:KS,"data-dimentions":"data-dimentions.svg",debug:YS,"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:JS,download:XS,"drag-dots":"drag-dots.svg","drag-horizontal":"drag-horizontal.svg","drag-vertical":"drag-vertical.svg",duplicate:QS,edit:e1,"error-bar":"error-bar.svg",error:t1,"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","files-export":"files-export.svg","files-import":"files-import.svg","filter-on":"filter-on.svg",filter:n1,"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:r1,graph:i1,heatmap:o1,"help-outline":"help-outline.svg",help:s1,"info-outline":"info-outline.svg",info:a1,jitter:l1,"jump-link":"jump-link.svg",lasso:c1,layers:d1,learn:u1,"legend-box-dot":"legend-box-dot.svg","legend-box":"legend-box.svg",legend:p1,"line-binned":"line-binned.svg","line-error":"line-error.svg","line-jitter":"line-jitter.svg",line:h1,"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:f1,loading:m1,lock:g1,maximize:y1,menu:v1,minimize:_1,minus:C1,more:w1,"paper-clip":"paper-clip.svg",pause:b1,pin:x1,play:k1,"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:S1,publications:E1,"radio-button-checked":"radio-button-checked.svg","radio-button":"radio-button.svg",renew:T1,restart:B1,reverse:A1,"rotation-0":"rotation-0.svg","rotation-45":"rotation-45.svg","rotation-90":"rotation-90.svg",search:P1,"server-on":"server-on.svg",server:V1,settings:N1,sina:D1,skatterplot:F1,slice:R1,"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:M1,statistics:I1,stop:L1,"strip-plot":"strip-plot.svg",success:O1,"table-add":"table-add.svg","table-alias":"table-alias.svg","table-import":"table-import.svg",table:G1,template:z1,terminal:Z1,"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:$1,tune:U1,venn:W1,"view-hide":"view-hide.svg","view-show":"view-show.svg","violin-binned":"violin-binned.svg","violin-jitter":"violin-jitter.svg",violin:H1,warning:j1,wetlab:q1,"windows-collapse":"windows-collapse.svg","windows-expand":"windows-expand.svg","x-axis":"x-axis.svg","y-axis":"y-axis.svg",zip:K1,"zoom-in":"zoom-in.svg","zoom-out":"zoom-out.svg"};function J1(){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 X1=["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"],Q1=["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","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","files-export","files-import","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"],eE={allCssVariables:J1(),icons16:SS,icons24:Y1},tE={class:"block__not-found"},nE=r.defineComponent({__name:"NotFound",setup(t){const n=Ha().useApp(),i=()=>{n.updateNavigationState(s=>{s.href="/"})};return(s,l)=>(r.openBlock(),r.createElementBlock("div",tE,[r.createElementVNode("h1",null,"Not found route: "+r.toDisplayString(r.unref(n).snapshot.navigationState.href),1),r.createVNode(r.unref(ol),{onClick:r.withModifiers(i,["stop"])},{default:r.withCtx(()=>l[0]||(l[0]=[r.createTextVNode("Return to main page")])),_:1})]))}}),kl=(t,e)=>{const n=t.__vccOpts||t;for(const[i,s]of e)n[i]=s;return n},rE={},iE={class:"block__loader-page"};function oE(t,e){return r.openBlock(),r.createElementBlock("div",iE,e[0]||(e[0]=[r.createElementVNode("div",{class:"loader-container"},[r.createElementVNode("i",{class:"mask-24 mask-loading loader-icon"})],-1)]))}const sE=kl(rE,[["render",oE]]),aE={class:"pl-app-notification-alert"},lE={class:"pl-app-notification-alert__content"},cE={class:"pl-app-notification-alert__title"},dE={class:"pl-app-notification-alert__error-description"},uE=r.defineComponent({__name:"PlAppErrorNotificationAlert",props:{errors:{}},setup(t){const e=t,n=r.ref(!1),i=r.ref(!0),s=r.computed(()=>Object.entries(e.errors).filter(u=>!!u[1]));function l(){n.value=!0}function d(u){navigator.clipboard&&navigator.clipboard.writeText(JSON.stringify(u))}return r.watch(()=>e.errors,u=>{i.value=Object.values(u).some(p=>!!p)},{immediate:!0,deep:!0}),(u,p)=>(r.openBlock(),r.createElementBlock("div",aE,[r.createVNode(r.unref(gl),{modelValue:n.value,"onUpdate:modelValue":p[0]||(p[0]=f=>n.value=f),width:"50%",style:{"max-height":"100vh"}},{title:r.withCtx(()=>p[2]||(p[2]=[r.createTextVNode(" Errors ")])),default:r.withCtx(()=>[r.createElementVNode("div",lE,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(s.value,f=>{var m;return r.openBlock(),r.createElementBlock("div",{key:f[0],class:"pl-app-notification-alert__item"},[r.createElementVNode("div",cE,r.toDisplayString(f[0]),1),r.createElementVNode("div",dE,[r.createElementVNode("code",null,r.toDisplayString((m=f[1])==null?void 0:m.message),1),r.createVNode(r.unref(Wu),{class:"pl-app-notification-alert__copy-icon",onCopyData:v=>d(f[1])},null,8,["onCopyData"])])])}),128))])]),_:1},8,["modelValue"]),r.createVNode(r.unref(Uu),{modelValue:i.value,"onUpdate:modelValue":p[1]||(p[1]=f=>i.value=f),type:"error",closable:""},{actions:r.withCtx(()=>[r.createVNode(r.unref(il),{icon:"arrow-right",onClick:l},{default:r.withCtx(()=>p[3]||(p[3]=[r.createTextVNode("See errors")])),_:1}),r.createVNode(r.unref(fu))]),default:r.withCtx(()=>[p[4]||(p[4]=r.createTextVNode(" Some outputs have errors. "))]),_:1},8,["modelValue"])]))}}),pE={class:"block block__layout"},hE={key:0},fE=r.defineComponent({__name:"BlockLayout",setup(t){const e=Ha(),n=p=>{try{return new URL(p,"http://dummy").pathname}catch{console.error("Invalid href",p);return}},i=r.computed(()=>e.loaded?e.useApp().href:void 0),s=r.computed(()=>{if(e.loaded){const p=e.useApp(),f=n(p.snapshot.navigationState.href);return f?p.getRoute(f):void 0}}),l=r.computed(()=>e.loaded?e.useApp():void 0),d=r.computed(()=>l.value?l.value.model.outputErrors:{}),u=r.computed(()=>{var p;return((p=l.value)==null?void 0:p.showErrorsNotification)??!0});return(p,f)=>(r.openBlock(),r.createElementBlock("div",pE,[r.unref(e).error?(r.openBlock(),r.createElementBlock("div",hE,r.toDisplayString(r.unref(e).error),1)):r.unref(e).loaded?s.value?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(s.value),{key:i.value})):(r.openBlock(),r.createBlock(nE,{key:3})):(r.openBlock(),r.createBlock(sE,{key:1},{default:r.withCtx(()=>f[0]||(f[0]=[r.createTextVNode("Loading...")])),_:1})),r.unref(e).loaded&&u.value?(r.openBlock(),r.createBlock(r.unref(uE),{key:4,errors:d.value},null,8,["errors"])):r.createCommentVNode("",!0)]))}});var bs={exports:{}};/**
63
+ )`}function l(){const u=t.value;if(!u)return;const p=[i(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=el(l);r.onMounted(l),et(window,"scroll",c,!0),et(window,"resize",c,!0)}function Hu(t,e){gu(()=>{it(r.unref(t),n=>{yu(n,()=>e(n))})}),r.onUnmounted(()=>{it(r.unref(t),n=>{vu(n)})})}const ur={item:"sortable__item",animate:"sortable__animate"},wo=t=>t.getBoundingClientRect().y,ju=t=>{const{y:e,height:n}=t.getBoundingClientRect();return e+Math.ceil(n/2)},pk=t=>{const{y:e,height:n}=t.getBoundingClientRect();return e+n};function hk(t,e){const n={item:void 0,options(){var S;return[...((S=t.value)==null?void 0:S.children)??[]]}},i=r.computed(()=>n.options()),s=e.shakeBuffer??10,l=e.reorderDelay??100;function c(S){const F=e.handle?this.querySelector(e.handle):null;F&&!F.contains(S.target)||(this.classList.remove(ur.animate),this.classList.add(ur.item),n.item={el:this,y:S.y,dy:0,orderChanged:!1})}function u(S){const F=n.options();return F.slice(0,F.indexOf(S))}function p(S){const F=n.options();return F.slice(F.indexOf(S)+1)}function f(S,F){const T=n.options().filter(C=>C!==F),N=T.indexOf(S);return T.splice(N,0,F),T}function m(S,F){const T=n.options().filter(C=>C!==F),N=T.indexOf(S);return T.splice(N+1,0,F),T}function v(S,F){S.dy=F-S.y,S.el.style.setProperty("transform",`translateY(${S.dy}px)`)}function k(S){var F;if(!n.item)return;const{el:T}=n.item;if(!T.isConnected){n.item=void 0;return}const N=S.map(U=>wo(U)),C=wo(T);(F=t.value)==null||F.replaceChildren(...S);const I=wo(T),Q=S.map(U=>wo(U)),M=[];for(let U=0;U<Q.length;U++){const z=S[U];if(z===n.item.el)continue;const P=Q[U],Z=N[U]-P;z.style.transform=`translateY(${Z}px)`,M.push(z)}const R=I-C;n.item.y=n.item.y+R,n.item.dy=n.item.dy-R,n.item.orderChanged=!0,n.item.el.style.setProperty("transform",`translateY(${n.item.dy}px)`),M.forEach(U=>U.classList.remove(ur.animate)),requestAnimationFrame(function(){M.forEach(U=>{U.classList.add(ur.animate),U.style.transform="",U.addEventListener("transitionend",()=>{U.classList.remove(ur.animate)})})})}et(window,"mousemove",S=>{if(!n.item)return;const{el:F}=n.item;v(n.item,S.y);const T=wo(n.item.el),N=pk(n.item.el),C=u(F),I=p(F);C.forEach(Q=>{const M=ju(Q);T+s<M&&k(f(Q,F))}),I.forEach(Q=>{const M=ju(Q);N-s>M&&k(m(Q,F))})}),et(window,"mouseup",()=>{if(!n.item)return;const{el:S,orderChanged:F}=n.item;S.classList.add(ur.animate),S.style.removeProperty("transform"),S.addEventListener("transitionend",()=>{S.classList.remove(ur.animate,ur.item)}),setTimeout(()=>{if(!F)return;const T=n.options().map(C=>Number(C.getAttribute("data-index"))),N=t.value;if(N){for(const C of n.options())N.removeChild(C);i.value.forEach(C=>{N.appendChild(C)})}e.onChange(T)},l),n.item=void 0}),r.watchEffect(()=>{i.value.forEach((S,F)=>{S.removeEventListener("mousedown",c),S.addEventListener("mousedown",c),S.setAttribute("data-index",String(F))})})}function fk(t,e){let n;r.onMounted(()=>{n=setInterval(t,e)}),r.onUnmounted(()=>clearInterval(n))}function mk(t,e,n){const i=r.reactive({data:qa.deepClone(e(t.value)),changed:!1});return r.watch(()=>i.data,s=>{i.changed?n(qa.deepClone(s)):i.changed=!0},{deep:!0}),r.watch(t,s=>{Object.assign(i,{data:qa.deepClone(e(s)),changed:!1})},{deep:!0,immediate:!0}),i}function gk(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(i){this.error=i}finally{this.isLoading=!1}},debounce(n,i=1e3){return Yd(()=>{const s=n();this.run(...s).catch(console.error)},i)}});return e.run=e.run.bind(e),e}function yk(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 i(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",i)}function l(){var c;(c=r.unref(t))==null||c.removeEventListener("mousedown",i)}r.onMounted(s),r.onUnmounted(l)}const vk={class:"ui-slider__wrapper"},_k={class:"ui-slider__label-section"},Ck={key:0,class:"text-s"},wk={class:"ui-slider__base"},bk={class:"ui-slider__container"},xk={class:"ui-slider__container ui-slider__container-thumb"},kk=["data-percent"],Sk=["data-percent"],Ek=["data-percent"],Tk={key:0,class:"ui-slider__error"},Bk=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(),i=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),v=r.computed(()=>s),k=xl(v),S=r.computed(()=>gt((s.modelValue[0]??0)+l.deltaValue1,s.min,s.max)),F=r.computed(()=>gt((s.modelValue[1]??0)+l.deltaValue2,s.min,s.max)),T=r.computed(()=>gt((s.modelValue[2]??0)+l.deltaValue3,s.min,s.max)),N=r.computed(()=>{const G=s.modelValue;if(!(Array.isArray(G)&&G.length===3&&G.every(ve=>Number.isFinite(ve))))return"Expected model [number, number, number]";const Y=[];return[...s.modelValue].forEach(ve=>{ve>s.max&&Y.push(`Max model value must be lower than max props ${s.max}.`),ve<s.min&&Y.push("Min model value must be greater than max props.")}),Y.length>0?Y.join(" "):s.error}),C=r.computed(()=>(S.value-s.min)/m.value),I=r.computed(()=>(F.value-s.min)/m.value),Q=r.computed(()=>(T.value-s.min)/m.value),M=r.computed(()=>O()),R=r.computed(()=>({right:M.value[0]+"%",left:100-M.value[2]+"%"})),U=r.computed(()=>({right:Math.ceil((1-C.value)*100)+"%"})),z=r.computed(()=>({right:Math.ceil((1-I.value)*100)+"%"})),P=r.computed(()=>({right:Math.ceil((1-Q.value)*100)+"%"}));rr(u,G=>{var Y;it((Y=r.unref(c))==null?void 0:Y.getBoundingClientRect(),ve=>{const{dx:xe}=G;l.deltaValue1=xe/ve.width*m.value,u.value&&Z(u.value,s.modelValue[0],l.deltaValue1),G.stop&&(ue([K(S.value),K(F.value),K(T.value)]),l.deltaValue1=0)})}),rr(p,G=>{var Y;it((Y=r.unref(c))==null?void 0:Y.getBoundingClientRect(),ve=>{const{dx:xe}=G;l.deltaValue2=xe/ve.width*m.value,p.value&&Z(p.value,s.modelValue[1],l.deltaValue2),G.stop&&(ue([K(S.value),K(F.value),K(T.value)]),l.deltaValue2=0)})}),rr(f,G=>{var Y;it((Y=r.unref(c))==null?void 0:Y.getBoundingClientRect(),ve=>{const{dx:xe}=G;l.deltaValue3=xe/ve.width*m.value,f.value&&Z(f.value,s.modelValue[2],l.deltaValue3),G.stop&&(ue([K(S.value),K(F.value),K(T.value)]),l.deltaValue3=0)})});function Z(G,Y,ve){const xe=K(gt((Y??0)+ve,s.min,s.max));G.dataset.percent=`${xe}${s.measure}`,W()}function O(){const G=Math.ceil((1-C.value)*100),Y=Math.ceil((1-I.value)*100),ve=Math.ceil((1-Q.value)*100);return[G,Y,ve].sort((xe,Gt)=>xe-Gt)}function K(G){const Y=gt(G,s.min,s.max);return Math.round((Y+Number.EPSILON)*(1/s.step))/(1/s.step)}function ue(G){i("update:modelValue",G)}function W(){const G=Number(U.value.right.substring(0,U.value.right.length-1)),Y=Number(z.value.right.substring(0,z.value.right.length-1)),ve=Number(P.value.right.substring(0,P.value.right.length-1)),xe=[{r:G,th:u},{r:Y,th:p},{r:ve,th:f}].sort((Gt,jt)=>Gt.r-jt.r);xe[0].th.value&&(xe[0].th.value.dataset.hint="high"),xe[1].th.value&&(xe[1].th.value.dataset.hint="mid"),xe[2].th.value&&(xe[2].th.value.dataset.hint="low")}function A(G,Y){["ArrowDown","ArrowUp","ArrowRight","ArrowLeft","Enter"].includes(G.code)&&G.preventDefault();const ve=G.code==="ArrowUp"||G.code==="ArrowRight"?s.step*1:G.code==="ArrowDown"||G.code==="ArrowLeft"?s.step*-1:0,xe=[...s.modelValue];xe[Y]=gt(xe[Y]+ve,s.min,s.max),ue(xe),W()}return r.onMounted(()=>{W()}),(G,Y)=>(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",vk,[r.createElementVNode("div",_k,[G.label?(r.openBlock(),r.createElementBlock("label",Ck,[r.createElementVNode("span",null,r.toDisplayString(G.label),1),Y[3]||(Y[3]=r.createTextVNode()),r.unref(n).tooltip?(r.openBlock(),r.createBlock(r.unref(Tt),{key:0,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.renderSlot(G.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0)]),Y[11]||(Y[11]=r.createTextVNode()),r.createElementVNode("div",wk,[r.createElementVNode("div",bk,[r.createElementVNode("div",{ref_key:"barRef",ref:c,class:"ui-slider__bar"},[r.createElementVNode("div",{class:"ui-slider__progress",style:r.normalizeStyle(R.value)},null,4)],512)]),Y[10]||(Y[10]=r.createTextVNode()),r.createElementVNode("div",xk,[s.breakpoints?(r.openBlock(!0),r.createElementBlock(r.Fragment,{key:0},r.renderList(r.unref(k),(ve,xe)=>(r.openBlock(),r.createElementBlock("div",{key:xe,style:r.normalizeStyle({right:`${ve}%`}),class:"ui-slider__thumb-step"},null,4))),128)):r.createCommentVNode("",!0),Y[7]||(Y[7]=r.createTextVNode()),r.createElementVNode("div",{ref_key:"thumbRef1",ref:u,style:r.normalizeStyle(U.value),"data-percent":s.modelValue[0]+"%",class:"ui-slider__thumb ui-slider__triple-thumb",r1:"",tabindex:"0",onKeydown:Y[0]||(Y[0]=ve=>A(ve,0))},Y[4]||(Y[4]=[r.createElementVNode("div",{class:"ui-slider__thumb-focused-contour"},null,-1)]),44,kk),Y[8]||(Y[8]=r.createTextVNode()),r.createElementVNode("div",{ref_key:"thumbRef2",ref:p,style:r.normalizeStyle(z.value),"data-percent":s.modelValue[1]+"%",class:"ui-slider__thumb ui-slider__triple-thumb",r2:"",tabindex:"0",onKeydown:Y[1]||(Y[1]=ve=>A(ve,1))},Y[5]||(Y[5]=[r.createElementVNode("div",{class:"ui-slider__thumb-focused-contour"},null,-1)]),44,Sk),Y[9]||(Y[9]=r.createTextVNode()),r.createElementVNode("div",{ref_key:"thumbRef3",ref:f,style:r.normalizeStyle(P.value),"data-percent":s.modelValue[2]+"%",class:"ui-slider__thumb ui-slider__triple-thumb",r3:"",tabindex:"0",onKeydown:Y[2]||(Y[2]=ve=>A(ve,2))},Y[6]||(Y[6]=[r.createElementVNode("div",{class:"ui-slider__thumb-focused-contour"},null,-1)]),44,Ek)])])]),Y[12]||(Y[12]=r.createTextVNode()),Y[13]||(Y[13]=r.createElementVNode("div",{class:"ui-slider__input-wrapper d-flex"},null,-1))],2),Y[14]||(Y[14]=r.createTextVNode()),N.value?(r.openBlock(),r.createElementBlock("div",Tk,r.toDisplayString(N.value),1)):r.createCommentVNode("",!0)],2))}}),Ak={class:"ui-input-range__separator"},Pk=r.defineComponent({__name:"InputRange",props:{modelValue:{},separator:{default:"-"}},emits:["update:modelValue","change"],setup(t,{emit:e}){const n=t,i=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(){i("update:modelValue",[+s.left,+s.right]),i("change",[+s.left,+s.right])}function f(m,v){const k=v.target.value;/^[0-9]{0,2}$/.test(k)?m?s.left=+k:s.right=+k:m?s.left=+k.slice(0,k.length-1):s.right=+k.slice(0,k.length-1)}return(m,v)=>(r.openBlock(),r.createElementBlock("div",r.mergeProps({class:[c.value,"ui-input-range"]},m.$attrs),[r.withDirectives(r.createElementVNode("input",{"onUpdate:modelValue":v[0]||(v[0]=k=>u.value.left=k),class:"text-s",type:"text",onChange:p,onFocus:v[1]||(v[1]=k=>l.value=!0),onFocusout:v[2]||(v[2]=k=>l.value=!1),onInput:v[3]||(v[3]=k=>f(!0,k))},null,544),[[r.vModelText,u.value.left]]),v[8]||(v[8]=r.createTextVNode()),r.createElementVNode("div",Ak,r.toDisplayString(n.separator),1),v[9]||(v[9]=r.createTextVNode()),r.withDirectives(r.createElementVNode("input",{"onUpdate:modelValue":v[4]||(v[4]=k=>u.value.right=k),class:"text-s",type:"text",onChange:p,onFocus:v[5]||(v[5]=k=>l.value=!0),onFocusout:v[6]||(v[6]=k=>l.value=!1),onInput:v[7]||(v[7]=k=>f(!1,k))},null,544),[[r.vModelText,u.value.right]])],16))}}),Vk={class:"ui-slider__wrapper"},Nk={class:"ui-slider__label-section"},Dk={key:0,class:"text-s"},Fk={key:1,class:"ui-slider__value-static text-s"},Rk={class:"ui-slider__base"},Mk={class:"ui-slider__container"},Ik={class:"ui-slider__container ui-slider__container-thumb"},Lk={class:"ui-slider__input-wrapper d-flex"},Ok={key:0,class:"ui-slider__error"},Gk=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(),i=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]),v=r.ref(s.modelValue[1]),k=r.computed(()=>s),S=xl(k),F=r.computed(()=>[m.value,v.value].sort((W,A)=>W-A).join("-")),T=r.computed(()=>s.max-s.min),N=r.computed(()=>gt((s.modelValue[0]??0)+l.deltaValue1,s.min,s.max)),C=r.computed(()=>gt((s.modelValue[1]??0)+l.deltaValue2,s.min,s.max)),I=r.computed(()=>{const W=s.modelValue;return Array.isArray(W)&&W.length===2&&W.every(A=>Number.isFinite(A))?s.error:"Expected model [number, number]"}),Q=r.computed(()=>(N.value-s.min)/T.value),M=r.computed(()=>(C.value-s.min)/T.value),R=r.computed(()=>Z()),U=r.computed(()=>({right:R.value[0]+"%",left:100-R.value[1]+"%"})),z=r.computed(()=>({right:Math.ceil((1-Q.value)*100)+"%"})),P=r.computed(()=>({right:Math.ceil((1-M.value)*100)+"%"}));r.watch(()=>s.modelValue,W=>{f.value=W,m.value=+W[0],v.value=+W[1]},{immediate:!0}),rr(u,W=>{var A;it((A=r.unref(c))==null?void 0:A.getBoundingClientRect(),G=>{const{dx:Y}=W;l.deltaValue1=Y/G.width*T.value,m.value=O(gt((s.modelValue[0]??0)+l.deltaValue1,s.min,s.max)),f.value=[m.value,v.value].sort((ve,xe)=>ve-xe),W.stop&&(K([O(N.value),O(C.value)]),l.deltaValue1=0)})}),rr(p,W=>{var A;it((A=r.unref(c))==null?void 0:A.getBoundingClientRect(),G=>{const{dx:Y}=W;l.deltaValue2=Y/G.width*T.value,v.value=O(gt((s.modelValue[1]??0)+l.deltaValue2,s.min,s.max)),f.value=[m.value,v.value].sort((ve,xe)=>ve-xe),W.stop&&(K([O(N.value),O(C.value)]),l.deltaValue2=0)})});function Z(){const W=Math.ceil((1-Q.value)*100),A=Math.ceil((1-M.value)*100);return[W,A].sort((G,Y)=>G-Y)}function O(W){const A=gt(W,s.min,s.max);return Math.round((A+Number.EPSILON)*(1/s.step))/(1/s.step)}function K(W){i("update:modelValue",W)}function ue(W,A){["ArrowDown","ArrowUp","ArrowRight","ArrowLeft","Enter"].includes(W.code)&&W.preventDefault();const G=W.code==="ArrowUp"||W.code==="ArrowRight"?s.step*1:W.code==="ArrowDown"||W.code==="ArrowLeft"?s.step*-1:0,Y=[...s.modelValue];Y[A]=gt(Y[A]+G,s.min,s.max),K(Y)}return(W,A)=>(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",Vk,[r.createElementVNode("div",Nk,[W.label?(r.openBlock(),r.createElementBlock("label",Dk,[r.createElementVNode("span",null,r.toDisplayString(W.label),1),A[3]||(A[3]=r.createTextVNode()),r.unref(n).tooltip?(r.openBlock(),r.createBlock(r.unref(Tt),{key:0,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.renderSlot(W.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0),A[4]||(A[4]=r.createTextVNode()),s.mode==="text"?(r.openBlock(),r.createElementBlock("div",Fk,r.toDisplayString(F.value),1)):r.createCommentVNode("",!0)]),A[10]||(A[10]=r.createTextVNode()),r.createElementVNode("div",Rk,[r.createElementVNode("div",Mk,[r.createElementVNode("div",{ref_key:"barRef",ref:c,class:"ui-slider__bar"},[r.createElementVNode("div",{class:"ui-slider__progress",style:r.normalizeStyle(U.value)},null,4)],512)]),A[9]||(A[9]=r.createTextVNode()),r.createElementVNode("div",Ik,[s.breakpoints?(r.openBlock(!0),r.createElementBlock(r.Fragment,{key:0},r.renderList(r.unref(S),(G,Y)=>(r.openBlock(),r.createElementBlock("div",{key:Y,style:r.normalizeStyle({right:`${G}%`}),class:"ui-slider__thumb-step"},null,4))),128)):r.createCommentVNode("",!0),A[7]||(A[7]=r.createTextVNode()),r.createElementVNode("div",{ref_key:"thumbRef1",ref:u,style:r.normalizeStyle(z.value),class:"ui-slider__thumb",tabindex:"0",onKeydown:A[0]||(A[0]=G=>ue(G,0))},A[5]||(A[5]=[r.createElementVNode("div",{class:"ui-slider__thumb-focused-contour"},null,-1)]),36),A[8]||(A[8]=r.createTextVNode()),r.createElementVNode("div",{ref_key:"thumbRef2",ref:p,style:r.normalizeStyle(P.value),class:"ui-slider__thumb",tabindex:"0",onKeydown:A[1]||(A[1]=G=>ue(G,1))},A[6]||(A[6]=[r.createElementVNode("div",{class:"ui-slider__thumb-focused-contour"},null,-1)]),36)])])]),A[11]||(A[11]=r.createTextVNode()),r.createElementVNode("div",Lk,[s.mode==="input"?(r.openBlock(),r.createBlock(Pk,{key:0,modelValue:f.value,"onUpdate:modelValue":A[2]||(A[2]=G=>f.value=G),class:"ui-focused-border",onChange:K},null,8,["modelValue"])):r.createCommentVNode("",!0)])],2),A[12]||(A[12]=r.createTextVNode()),I.value?(r.openBlock(),r.createElementBlock("div",Ok,r.toDisplayString(I.value),1)):r.createCommentVNode("",!0)],2))}}),zk=r.defineComponent({__name:"VScroll",props:{scrollTop:{},clientHeight:{},scrollHeight:{}},emits:["update:scrollTop"],setup(t,{emit:e}){const n=e,i=t,s=r.ref(),l=r.computed(()=>i.clientHeight/(i.scrollHeight||1)),c=r.computed(()=>l.value<1),u=r.computed(()=>{const p=r.unref(l);return{top:i.scrollTop*p+"px",height:Math.floor(i.clientHeight*p)+"px"}});return et(s,"pointerdown",p=>{const f={clientY:p.clientY},m=dl(document,"mousemove",v=>{const k=(v.clientY-f.clientY)/l.value;n("update:scrollTop",i.scrollTop+k),f.clientY=v.clientY});["mouseup","pointercancel"].forEach(v=>{document.addEventListener(v,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)}}),Zk=r.defineComponent({__name:"HScroll",props:{scrollLeft:{},clientWidth:{},scrollWidth:{}},emits:["update:scrollLeft"],setup(t,{emit:e}){const n=e,i=t,s=r.ref(),l=r.computed(()=>i.clientWidth/(i.scrollWidth||1)),c=r.computed(()=>l.value<1),u=r.computed(()=>{const p=r.unref(l);return{left:i.scrollLeft*p+"px",width:Math.floor(i.clientWidth*p)+"px"}});return et(s,"pointerdown",p=>{const f={clientX:p.clientX},m=dl(document,"mousemove",v=>{const k=(v.clientX-f.clientX)/l.value;n("update:scrollLeft",i.scrollLeft+k),f.clientX=v.clientX});["mouseup","pointercancel"].forEach(v=>{document.addEventListener(v,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)}}),$k={class:"ui-scrollable"},Uk=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 i(u){_C(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,i(p)};function l(u){it(r.unref(e),p=>{p.scrollTop=u,i(p)})}function c(u){it(r.unref(e),p=>{p.scrollLeft=u,i(p)})}return Hu(e,u=>{it(u,p=>i(p))}),r.onMounted(()=>{it(r.unref(e),u=>{i(u),u.addEventListener("wheel",s)})}),r.onUnmounted(()=>{it(r.unref(e),u=>u.removeEventListener("wheel",s))}),(u,p)=>(r.openBlock(),r.createElementBlock("div",$k,[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(zk,{"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(Zk,{"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"])]))}}),Wk="add.svg",Hk="box.svg",jk="calendar.svg",qk="checkmark.svg",Kk="clipboard.svg",Yk="close.svg",Jk="copy.svg",Xk="download.svg",Qk="duplicate.svg",eS="edit.svg",tS="error.svg",nS="filter.svg",rS="help.svg",iS="info.svg",oS="link.svg",sS="loading.svg",aS="lock.svg",lS="maximize.svg",cS="minimize.svg",dS="minus.svg",uS="more.svg",pS="open.svg",hS="pause.svg",fS="play.svg",mS="renew.svg",gS="restart.svg",yS="reverse.svg",vS="settings.svg",_S="sort.svg",CS="stop.svg",wS="success.svg",bS="time.svg",xS="tune.svg",kS="warning.svg",SS="zip.svg",ES={add:Wk,"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:Hk,calendar:jk,"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:qk,"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:Kk,close:Yk,copy:Jk,"data-dimentions":"data-dimentions.svg","delete-bin":"delete-bin.svg","delete-circle":"delete-circle.svg","delete-clear":"delete-clear.svg",download:Xk,"drag-dots":"drag-dots.svg",duplicate:Qk,edit:eS,error:tS,export:"export.svg","filter-on":"filter-on.svg",filter:nS,"help-outline":"help-outline.svg",help:rS,"info-outline":"info-outline.svg",info:iS,"jump-link":"jump-link.svg",link:oS,loading:sS,lock:aS,maximize:lS,minimize:cS,minus:dS,more:uS,open:pS,"paper-clip":"paper-clip.svg",pause:hS,play:fS,renew:mS,restart:gS,reverse:yS,settings:vS,sort:_S,stop:CS,success:wS,time:bS,tune:xS,warning:kS,"x-axis":"x-axis.svg","y-axis":"y-axis.svg",zip:SS},TS="add.svg",BS="annotate.svg",AS="annotation.svg",PS="area.svg",VS="axes.svg",NS="bar.svg",DS="bindot.svg",FS="box.svg",RS="boxplot.svg",MS="bubble.svg",IS="calendar.svg",LS="canvas.svg",OS="checkbox.svg",GS="checkmark.svg",zS="clipboard.svg",ZS="close.svg",$S="cluster.svg",US="code.svg",WS="color.svg",HS="columns.svg",jS="container.svg",qS="cookie.svg",KS="copy.svg",YS="cpu.svg",JS="debug.svg",XS="dna.svg",QS="download.svg",e1="duplicate.svg",t1="edit.svg",n1="error.svg",r1="filter.svg",i1="generate.svg",o1="graph.svg",s1="heatmap.svg",a1="help.svg",l1="info.svg",c1="jitter.svg",d1="lasso.svg",u1="layers.svg",p1="learn.svg",h1="legend.svg",f1="line.svg",m1="link.svg",g1="loading.svg",y1="lock.svg",v1="maximize.svg",_1="menu.svg",C1="minimize.svg",w1="minus.svg",b1="more.svg",x1="pause.svg",k1="pin.svg",S1="play.svg",E1="product.svg",T1="publications.svg",B1="renew.svg",A1="restart.svg",P1="reverse.svg",V1="search.svg",N1="server.svg",D1="settings.svg",F1="sina.svg",R1="skatterplot.svg",M1="slice.svg",I1="sort.svg",L1="statistics.svg",O1="stop.svg",G1="success.svg",z1="table.svg",Z1="template.svg",$1="terminal.svg",U1="time.svg",W1="tune.svg",H1="venn.svg",j1="violin.svg",q1="warning.svg",K1="wetlab.svg",Y1="zip.svg",J1={"add-layer":"add-layer.svg",add:TS,"align-center":"align-center.svg","align-left":"align-left.svg","align-right":"align-right.svg",annotate:BS,annotation:AS,area:PS,"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:VS,"bar-cross":"bar-cross.svg","bar-error":"bar-error.svg","bar-stacked":"bar-stacked.svg","bar-trend":"bar-trend.svg",bar:NS,bindot:DS,box:FS,"boxplot-binned":"boxplot-binned.svg","boxplot-jitter":"boxplot-jitter.svg","boxplot-notched":"boxplot-notched.svg",boxplot:RS,bubble:MS,calendar:IS,canvas:LS,"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:OS,checkmark:GS,"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:zS,close:ZS,"cloud-download":"cloud-download.svg","cloud-offline":"cloud-offline.svg","cloud-online":"cloud-online.svg","cloud-upload":"cloud-upload.svg",cluster:$S,code:US,"color-fill":"color-fill.svg","color-none":"color-none.svg","color-stroke":"color-stroke.svg",color:WS,columns:HS,"connected-points":"connected-points.svg",container:jS,cookie:qS,copy:KS,cpu:YS,"data-dimentions":"data-dimentions.svg",debug:JS,"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:XS,download:QS,"drag-dots":"drag-dots.svg","drag-horizontal":"drag-horizontal.svg","drag-vertical":"drag-vertical.svg",duplicate:e1,edit:t1,"error-bar":"error-bar.svg",error:n1,"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","files-export":"files-export.svg","files-import":"files-import.svg","filter-on":"filter-on.svg",filter:r1,"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:i1,graph:o1,heatmap:s1,"help-outline":"help-outline.svg",help:a1,"info-outline":"info-outline.svg",info:l1,jitter:c1,"jump-link":"jump-link.svg",lasso:d1,layers:u1,learn:p1,"legend-box-dot":"legend-box-dot.svg","legend-box":"legend-box.svg",legend:h1,"line-binned":"line-binned.svg","line-error":"line-error.svg","line-jitter":"line-jitter.svg",line:f1,"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:m1,loading:g1,lock:y1,maximize:v1,menu:_1,minimize:C1,minus:w1,more:b1,"paper-clip":"paper-clip.svg",pause:x1,pin:k1,play:S1,"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:E1,publications:T1,"radio-button-checked":"radio-button-checked.svg","radio-button":"radio-button.svg",renew:B1,restart:A1,reverse:P1,"rotation-0":"rotation-0.svg","rotation-45":"rotation-45.svg","rotation-90":"rotation-90.svg",search:V1,"server-on":"server-on.svg",server:N1,settings:D1,sina:F1,skatterplot:R1,slice:M1,"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:I1,statistics:L1,stop:O1,"strip-plot":"strip-plot.svg",success:G1,"table-add":"table-add.svg","table-alias":"table-alias.svg","table-import":"table-import.svg",table:z1,template:Z1,terminal:$1,"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:U1,tune:W1,venn:H1,"view-hide":"view-hide.svg","view-show":"view-show.svg","violin-binned":"violin-binned.svg","violin-jitter":"violin-jitter.svg",violin:j1,warning:q1,wetlab:K1,"windows-collapse":"windows-collapse.svg","windows-expand":"windows-expand.svg","x-axis":"x-axis.svg","y-axis":"y-axis.svg",zip:Y1,"zoom-in":"zoom-in.svg","zoom-out":"zoom-out.svg"};function X1(){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 Q1=["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"],eE=["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","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","files-export","files-import","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"],tE={allCssVariables:X1(),icons16:ES,icons24:J1},nE={class:"block__not-found"},rE=r.defineComponent({__name:"NotFound",setup(t){const n=Ha().useApp(),i=()=>{n.updateNavigationState(s=>{s.href="/"})};return(s,l)=>(r.openBlock(),r.createElementBlock("div",nE,[r.createElementVNode("h1",null,"Not found route: "+r.toDisplayString(r.unref(n).snapshot.navigationState.href),1),r.createVNode(r.unref(ol),{onClick:r.withModifiers(i,["stop"])},{default:r.withCtx(()=>l[0]||(l[0]=[r.createTextVNode("Return to main page")])),_:1})]))}}),kl=(t,e)=>{const n=t.__vccOpts||t;for(const[i,s]of e)n[i]=s;return n},iE={},oE={class:"block__loader-page"};function sE(t,e){return r.openBlock(),r.createElementBlock("div",oE,e[0]||(e[0]=[r.createElementVNode("div",{class:"loader-container"},[r.createElementVNode("i",{class:"mask-24 mask-loading loader-icon"})],-1)]))}const aE=kl(iE,[["render",sE]]),lE={class:"pl-app-notification-alert"},cE={class:"pl-app-notification-alert__content"},dE={class:"pl-app-notification-alert__title"},uE={class:"pl-app-notification-alert__error-description"},pE=r.defineComponent({__name:"PlAppErrorNotificationAlert",props:{errors:{}},setup(t){const e=t,n=r.ref(!1),i=r.ref(!0),s=r.computed(()=>Object.entries(e.errors).filter(u=>!!u[1]));function l(){n.value=!0}function c(u){navigator.clipboard&&navigator.clipboard.writeText(JSON.stringify(u))}return r.watch(()=>e.errors,u=>{i.value=Object.values(u).some(p=>!!p)},{immediate:!0,deep:!0}),(u,p)=>(r.openBlock(),r.createElementBlock("div",lE,[r.createVNode(r.unref(gl),{modelValue:n.value,"onUpdate:modelValue":p[0]||(p[0]=f=>n.value=f),width:"50%",style:{"max-height":"100vh"}},{title:r.withCtx(()=>p[2]||(p[2]=[r.createTextVNode(" Errors ")])),default:r.withCtx(()=>[r.createElementVNode("div",cE,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(s.value,f=>{var m;return r.openBlock(),r.createElementBlock("div",{key:f[0],class:"pl-app-notification-alert__item"},[r.createElementVNode("div",dE,r.toDisplayString(f[0]),1),r.createElementVNode("div",uE,[r.createElementVNode("code",null,r.toDisplayString((m=f[1])==null?void 0:m.message),1),r.createVNode(r.unref(Wu),{class:"pl-app-notification-alert__copy-icon",onCopyData:v=>c(f[1])},null,8,["onCopyData"])])])}),128))])]),_:1},8,["modelValue"]),r.createVNode(r.unref(Uu),{modelValue:i.value,"onUpdate:modelValue":p[1]||(p[1]=f=>i.value=f),type:"error",closable:""},{actions:r.withCtx(()=>[r.createVNode(r.unref(il),{icon:"arrow-right",onClick:l},{default:r.withCtx(()=>p[3]||(p[3]=[r.createTextVNode("See errors")])),_:1}),r.createVNode(r.unref(fu))]),default:r.withCtx(()=>[p[4]||(p[4]=r.createTextVNode(" Some outputs have errors. "))]),_:1},8,["modelValue"])]))}}),hE={class:"block block__layout"},fE={key:0},mE=r.defineComponent({__name:"BlockLayout",setup(t){const e=Ha(),n=p=>{try{return new URL(p,"http://dummy").pathname}catch{console.error("Invalid href",p);return}},i=r.computed(()=>e.loaded?e.useApp().href:void 0),s=r.computed(()=>{if(e.loaded){const p=e.useApp(),f=n(p.snapshot.navigationState.href);return f?p.getRoute(f):void 0}}),l=r.computed(()=>e.loaded?e.useApp():void 0),c=r.computed(()=>l.value?l.value.model.outputErrors:{}),u=r.computed(()=>{var p;return((p=l.value)==null?void 0:p.showErrorsNotification)??!0});return(p,f)=>(r.openBlock(),r.createElementBlock("div",hE,[r.unref(e).error?(r.openBlock(),r.createElementBlock("div",fE,r.toDisplayString(r.unref(e).error),1)):r.unref(e).loaded?s.value?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(s.value),{key:i.value})):(r.openBlock(),r.createBlock(rE,{key:3})):(r.openBlock(),r.createBlock(aE,{key:1},{default:r.withCtx(()=>f[0]||(f[0]=[r.createTextVNode("Loading...")])),_:1})),r.unref(e).loaded&&u.value?(r.openBlock(),r.createBlock(r.unref(pE),{key:4,errors:c.value},null,8,["errors"])):r.createCommentVNode("",!0)]))}});var bs={exports:{}};/**
64
64
  * @license
65
65
  * Lodash <https://lodash.com/>
66
66
  * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
67
67
  * Released under MIT license <https://lodash.com/license>
68
68
  * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
69
69
  * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
70
- */bs.exports,function(t,e){(function(){var n,i="4.17.21",s=200,l="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",d="Expected a function",u="Invalid `variable` option passed into `_.template`",p="__lodash_hash_undefined__",f=500,m="__lodash_placeholder__",v=1,S=2,x=4,F=1,T=2,A=1,k=2,D=4,$=8,z=16,L=32,X=64,I=128,N=256,j=512,Z=30,K="...",le=800,U=16,P=1,O=2,Q=3,ve=1/0,xe=9007199254740991,Gt=17976931348623157e292,jt=NaN,At=4294967295,ko=At-1,Lr=At>>>1,So=[["ary",I],["bind",A],["bindKey",k],["curry",$],["curryRight",z],["flip",j],["partial",L],["partialRight",X],["rearg",N]],hi="[object Arguments]",Es="[object Array]",jE="[object AsyncFunction]",Eo="[object Boolean]",To="[object Date]",qE="[object DOMException]",Ts="[object Error]",Bs="[object Function]",lp="[object GeneratorFunction]",yn="[object Map]",Bo="[object Number]",KE="[object Null]",On="[object Object]",cp="[object Promise]",YE="[object Proxy]",Ao="[object RegExp]",vn="[object Set]",Po="[object String]",As="[object Symbol]",JE="[object Undefined]",Vo="[object WeakMap]",XE="[object WeakSet]",No="[object ArrayBuffer]",fi="[object DataView]",Pl="[object Float32Array]",Vl="[object Float64Array]",Nl="[object Int8Array]",Dl="[object Int16Array]",Fl="[object Int32Array]",Rl="[object Uint8Array]",Ml="[object Uint8ClampedArray]",Il="[object Uint16Array]",Ll="[object Uint32Array]",QE=/\b__p \+= '';/g,eT=/\b(__p \+=) '' \+/g,tT=/(__e\(.*?\)|\b__t\)) \+\n'';/g,dp=/&(?:amp|lt|gt|quot|#39);/g,up=/[&<>"']/g,nT=RegExp(dp.source),rT=RegExp(up.source),iT=/<%-([\s\S]+?)%>/g,oT=/<%([\s\S]+?)%>/g,pp=/<%=([\s\S]+?)%>/g,sT=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,aT=/^\w*$/,lT=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ol=/[\\^$.*+?()[\]{}|]/g,cT=RegExp(Ol.source),Gl=/^\s+/,dT=/\s/,uT=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,pT=/\{\n\/\* \[wrapped with (.+)\] \*/,hT=/,? & /,fT=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,mT=/[()=,{}\[\]\/\s]/,gT=/\\(\\)?/g,yT=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,hp=/\w*$/,vT=/^[-+]0x[0-9a-f]+$/i,_T=/^0b[01]+$/i,CT=/^\[object .+?Constructor\]$/,wT=/^0o[0-7]+$/i,bT=/^(?:0|[1-9]\d*)$/,xT=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Ps=/($^)/,kT=/['\n\r\u2028\u2029\\]/g,Vs="\\ud800-\\udfff",ST="\\u0300-\\u036f",ET="\\ufe20-\\ufe2f",TT="\\u20d0-\\u20ff",fp=ST+ET+TT,mp="\\u2700-\\u27bf",gp="a-z\\xdf-\\xf6\\xf8-\\xff",BT="\\xac\\xb1\\xd7\\xf7",AT="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",PT="\\u2000-\\u206f",VT=" \\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",yp="A-Z\\xc0-\\xd6\\xd8-\\xde",vp="\\ufe0e\\ufe0f",_p=BT+AT+PT+VT,zl="['’]",NT="["+Vs+"]",Cp="["+_p+"]",Ns="["+fp+"]",wp="\\d+",DT="["+mp+"]",bp="["+gp+"]",xp="[^"+Vs+_p+wp+mp+gp+yp+"]",Zl="\\ud83c[\\udffb-\\udfff]",FT="(?:"+Ns+"|"+Zl+")",kp="[^"+Vs+"]",$l="(?:\\ud83c[\\udde6-\\uddff]){2}",Ul="[\\ud800-\\udbff][\\udc00-\\udfff]",mi="["+yp+"]",Sp="\\u200d",Ep="(?:"+bp+"|"+xp+")",RT="(?:"+mi+"|"+xp+")",Tp="(?:"+zl+"(?:d|ll|m|re|s|t|ve))?",Bp="(?:"+zl+"(?:D|LL|M|RE|S|T|VE))?",Ap=FT+"?",Pp="["+vp+"]?",MT="(?:"+Sp+"(?:"+[kp,$l,Ul].join("|")+")"+Pp+Ap+")*",IT="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",LT="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Vp=Pp+Ap+MT,OT="(?:"+[DT,$l,Ul].join("|")+")"+Vp,GT="(?:"+[kp+Ns+"?",Ns,$l,Ul,NT].join("|")+")",zT=RegExp(zl,"g"),ZT=RegExp(Ns,"g"),Wl=RegExp(Zl+"(?="+Zl+")|"+GT+Vp,"g"),$T=RegExp([mi+"?"+bp+"+"+Tp+"(?="+[Cp,mi,"$"].join("|")+")",RT+"+"+Bp+"(?="+[Cp,mi+Ep,"$"].join("|")+")",mi+"?"+Ep+"+"+Tp,mi+"+"+Bp,LT,IT,wp,OT].join("|"),"g"),UT=RegExp("["+Sp+Vs+fp+vp+"]"),WT=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,HT=["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"],jT=-1,He={};He[Pl]=He[Vl]=He[Nl]=He[Dl]=He[Fl]=He[Rl]=He[Ml]=He[Il]=He[Ll]=!0,He[hi]=He[Es]=He[No]=He[Eo]=He[fi]=He[To]=He[Ts]=He[Bs]=He[yn]=He[Bo]=He[On]=He[Ao]=He[vn]=He[Po]=He[Vo]=!1;var Ue={};Ue[hi]=Ue[Es]=Ue[No]=Ue[fi]=Ue[Eo]=Ue[To]=Ue[Pl]=Ue[Vl]=Ue[Nl]=Ue[Dl]=Ue[Fl]=Ue[yn]=Ue[Bo]=Ue[On]=Ue[Ao]=Ue[vn]=Ue[Po]=Ue[As]=Ue[Rl]=Ue[Ml]=Ue[Il]=Ue[Ll]=!0,Ue[Ts]=Ue[Bs]=Ue[Vo]=!1;var qT={À:"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"},KT={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},YT={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},JT={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},XT=parseFloat,QT=parseInt,Np=typeof Ai=="object"&&Ai&&Ai.Object===Object&&Ai,eB=typeof self=="object"&&self&&self.Object===Object&&self,pt=Np||eB||Function("return this")(),Hl=e&&!e.nodeType&&e,Or=Hl&&!0&&t&&!t.nodeType&&t,Dp=Or&&Or.exports===Hl,jl=Dp&&Np.process,qt=function(){try{var B=Or&&Or.require&&Or.require("util").types;return B||jl&&jl.binding&&jl.binding("util")}catch{}}(),Fp=qt&&qt.isArrayBuffer,Rp=qt&&qt.isDate,Mp=qt&&qt.isMap,Ip=qt&&qt.isRegExp,Lp=qt&&qt.isSet,Op=qt&&qt.isTypedArray;function zt(B,G,M){switch(M.length){case 0:return B.call(G);case 1:return B.call(G,M[0]);case 2:return B.call(G,M[0],M[1]);case 3:return B.call(G,M[0],M[1],M[2])}return B.apply(G,M)}function tB(B,G,M,se){for(var be=-1,Oe=B==null?0:B.length;++be<Oe;){var st=B[be];G(se,st,M(st),B)}return se}function Kt(B,G){for(var M=-1,se=B==null?0:B.length;++M<se&&G(B[M],M,B)!==!1;);return B}function nB(B,G){for(var M=B==null?0:B.length;M--&&G(B[M],M,B)!==!1;);return B}function Gp(B,G){for(var M=-1,se=B==null?0:B.length;++M<se;)if(!G(B[M],M,B))return!1;return!0}function fr(B,G){for(var M=-1,se=B==null?0:B.length,be=0,Oe=[];++M<se;){var st=B[M];G(st,M,B)&&(Oe[be++]=st)}return Oe}function Ds(B,G){var M=B==null?0:B.length;return!!M&&gi(B,G,0)>-1}function ql(B,G,M){for(var se=-1,be=B==null?0:B.length;++se<be;)if(M(G,B[se]))return!0;return!1}function qe(B,G){for(var M=-1,se=B==null?0:B.length,be=Array(se);++M<se;)be[M]=G(B[M],M,B);return be}function mr(B,G){for(var M=-1,se=G.length,be=B.length;++M<se;)B[be+M]=G[M];return B}function Kl(B,G,M,se){var be=-1,Oe=B==null?0:B.length;for(se&&Oe&&(M=B[++be]);++be<Oe;)M=G(M,B[be],be,B);return M}function rB(B,G,M,se){var be=B==null?0:B.length;for(se&&be&&(M=B[--be]);be--;)M=G(M,B[be],be,B);return M}function Yl(B,G){for(var M=-1,se=B==null?0:B.length;++M<se;)if(G(B[M],M,B))return!0;return!1}var iB=Jl("length");function oB(B){return B.split("")}function sB(B){return B.match(fT)||[]}function zp(B,G,M){var se;return M(B,function(be,Oe,st){if(G(be,Oe,st))return se=Oe,!1}),se}function Fs(B,G,M,se){for(var be=B.length,Oe=M+(se?1:-1);se?Oe--:++Oe<be;)if(G(B[Oe],Oe,B))return Oe;return-1}function gi(B,G,M){return G===G?vB(B,G,M):Fs(B,Zp,M)}function aB(B,G,M,se){for(var be=M-1,Oe=B.length;++be<Oe;)if(se(B[be],G))return be;return-1}function Zp(B){return B!==B}function $p(B,G){var M=B==null?0:B.length;return M?Ql(B,G)/M:jt}function Jl(B){return function(G){return G==null?n:G[B]}}function Xl(B){return function(G){return B==null?n:B[G]}}function Up(B,G,M,se,be){return be(B,function(Oe,st,$e){M=se?(se=!1,Oe):G(M,Oe,st,$e)}),M}function lB(B,G){var M=B.length;for(B.sort(G);M--;)B[M]=B[M].value;return B}function Ql(B,G){for(var M,se=-1,be=B.length;++se<be;){var Oe=G(B[se]);Oe!==n&&(M=M===n?Oe:M+Oe)}return M}function ec(B,G){for(var M=-1,se=Array(B);++M<B;)se[M]=G(M);return se}function cB(B,G){return qe(G,function(M){return[M,B[M]]})}function Wp(B){return B&&B.slice(0,Kp(B)+1).replace(Gl,"")}function Zt(B){return function(G){return B(G)}}function tc(B,G){return qe(G,function(M){return B[M]})}function Do(B,G){return B.has(G)}function Hp(B,G){for(var M=-1,se=B.length;++M<se&&gi(G,B[M],0)>-1;);return M}function jp(B,G){for(var M=B.length;M--&&gi(G,B[M],0)>-1;);return M}function dB(B,G){for(var M=B.length,se=0;M--;)B[M]===G&&++se;return se}var uB=Xl(qT),pB=Xl(KT);function hB(B){return"\\"+JT[B]}function fB(B,G){return B==null?n:B[G]}function yi(B){return UT.test(B)}function mB(B){return WT.test(B)}function gB(B){for(var G,M=[];!(G=B.next()).done;)M.push(G.value);return M}function nc(B){var G=-1,M=Array(B.size);return B.forEach(function(se,be){M[++G]=[be,se]}),M}function qp(B,G){return function(M){return B(G(M))}}function gr(B,G){for(var M=-1,se=B.length,be=0,Oe=[];++M<se;){var st=B[M];(st===G||st===m)&&(B[M]=m,Oe[be++]=M)}return Oe}function Rs(B){var G=-1,M=Array(B.size);return B.forEach(function(se){M[++G]=se}),M}function yB(B){var G=-1,M=Array(B.size);return B.forEach(function(se){M[++G]=[se,se]}),M}function vB(B,G,M){for(var se=M-1,be=B.length;++se<be;)if(B[se]===G)return se;return-1}function _B(B,G,M){for(var se=M+1;se--;)if(B[se]===G)return se;return se}function vi(B){return yi(B)?wB(B):iB(B)}function _n(B){return yi(B)?bB(B):oB(B)}function Kp(B){for(var G=B.length;G--&&dT.test(B.charAt(G)););return G}var CB=Xl(YT);function wB(B){for(var G=Wl.lastIndex=0;Wl.test(B);)++G;return G}function bB(B){return B.match(Wl)||[]}function xB(B){return B.match($T)||[]}var kB=function B(G){G=G==null?pt:_i.defaults(pt.Object(),G,_i.pick(pt,HT));var M=G.Array,se=G.Date,be=G.Error,Oe=G.Function,st=G.Math,$e=G.Object,rc=G.RegExp,SB=G.String,Yt=G.TypeError,Ms=M.prototype,EB=Oe.prototype,Ci=$e.prototype,Is=G["__core-js_shared__"],Ls=EB.toString,Ze=Ci.hasOwnProperty,TB=0,Yp=function(){var o=/[^.]+$/.exec(Is&&Is.keys&&Is.keys.IE_PROTO||"");return o?"Symbol(src)_1."+o:""}(),Os=Ci.toString,BB=Ls.call($e),AB=pt._,PB=rc("^"+Ls.call(Ze).replace(Ol,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Gs=Dp?G.Buffer:n,yr=G.Symbol,zs=G.Uint8Array,Jp=Gs?Gs.allocUnsafe:n,Zs=qp($e.getPrototypeOf,$e),Xp=$e.create,Qp=Ci.propertyIsEnumerable,$s=Ms.splice,eh=yr?yr.isConcatSpreadable:n,Fo=yr?yr.iterator:n,Gr=yr?yr.toStringTag:n,Us=function(){try{var o=Wr($e,"defineProperty");return o({},"",{}),o}catch{}}(),VB=G.clearTimeout!==pt.clearTimeout&&G.clearTimeout,NB=se&&se.now!==pt.Date.now&&se.now,DB=G.setTimeout!==pt.setTimeout&&G.setTimeout,Ws=st.ceil,Hs=st.floor,ic=$e.getOwnPropertySymbols,FB=Gs?Gs.isBuffer:n,th=G.isFinite,RB=Ms.join,MB=qp($e.keys,$e),at=st.max,vt=st.min,IB=se.now,LB=G.parseInt,nh=st.random,OB=Ms.reverse,oc=Wr(G,"DataView"),Ro=Wr(G,"Map"),sc=Wr(G,"Promise"),wi=Wr(G,"Set"),Mo=Wr(G,"WeakMap"),Io=Wr($e,"create"),js=Mo&&new Mo,bi={},GB=Hr(oc),zB=Hr(Ro),ZB=Hr(sc),$B=Hr(wi),UB=Hr(Mo),qs=yr?yr.prototype:n,Lo=qs?qs.valueOf:n,rh=qs?qs.toString:n;function y(o){if(Qe(o)&&!ke(o)&&!(o instanceof De)){if(o instanceof Jt)return o;if(Ze.call(o,"__wrapped__"))return of(o)}return new Jt(o)}var xi=function(){function o(){}return function(a){if(!Je(a))return{};if(Xp)return Xp(a);o.prototype=a;var c=new o;return o.prototype=n,c}}();function Ks(){}function Jt(o,a){this.__wrapped__=o,this.__actions__=[],this.__chain__=!!a,this.__index__=0,this.__values__=n}y.templateSettings={escape:iT,evaluate:oT,interpolate:pp,variable:"",imports:{_:y}},y.prototype=Ks.prototype,y.prototype.constructor=y,Jt.prototype=xi(Ks.prototype),Jt.prototype.constructor=Jt;function De(o){this.__wrapped__=o,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=At,this.__views__=[]}function WB(){var o=new De(this.__wrapped__);return o.__actions__=Pt(this.__actions__),o.__dir__=this.__dir__,o.__filtered__=this.__filtered__,o.__iteratees__=Pt(this.__iteratees__),o.__takeCount__=this.__takeCount__,o.__views__=Pt(this.__views__),o}function HB(){if(this.__filtered__){var o=new De(this);o.__dir__=-1,o.__filtered__=!0}else o=this.clone(),o.__dir__*=-1;return o}function jB(){var o=this.__wrapped__.value(),a=this.__dir__,c=ke(o),h=a<0,g=c?o.length:0,_=oP(0,g,this.__views__),b=_.start,E=_.end,V=E-b,W=h?E:b-1,H=this.__iteratees__,q=H.length,te=0,ce=vt(V,this.__takeCount__);if(!c||!h&&g==V&&ce==V)return Th(o,this.__actions__);var fe=[];e:for(;V--&&te<ce;){W+=a;for(var Pe=-1,me=o[W];++Pe<q;){var Ne=H[Pe],Fe=Ne.iteratee,Wt=Ne.type,Et=Fe(me);if(Wt==O)me=Et;else if(!Et){if(Wt==P)continue e;break e}}fe[te++]=me}return fe}De.prototype=xi(Ks.prototype),De.prototype.constructor=De;function zr(o){var a=-1,c=o==null?0:o.length;for(this.clear();++a<c;){var h=o[a];this.set(h[0],h[1])}}function qB(){this.__data__=Io?Io(null):{},this.size=0}function KB(o){var a=this.has(o)&&delete this.__data__[o];return this.size-=a?1:0,a}function YB(o){var a=this.__data__;if(Io){var c=a[o];return c===p?n:c}return Ze.call(a,o)?a[o]:n}function JB(o){var a=this.__data__;return Io?a[o]!==n:Ze.call(a,o)}function XB(o,a){var c=this.__data__;return this.size+=this.has(o)?0:1,c[o]=Io&&a===n?p:a,this}zr.prototype.clear=qB,zr.prototype.delete=KB,zr.prototype.get=YB,zr.prototype.has=JB,zr.prototype.set=XB;function Gn(o){var a=-1,c=o==null?0:o.length;for(this.clear();++a<c;){var h=o[a];this.set(h[0],h[1])}}function QB(){this.__data__=[],this.size=0}function eA(o){var a=this.__data__,c=Ys(a,o);if(c<0)return!1;var h=a.length-1;return c==h?a.pop():$s.call(a,c,1),--this.size,!0}function tA(o){var a=this.__data__,c=Ys(a,o);return c<0?n:a[c][1]}function nA(o){return Ys(this.__data__,o)>-1}function rA(o,a){var c=this.__data__,h=Ys(c,o);return h<0?(++this.size,c.push([o,a])):c[h][1]=a,this}Gn.prototype.clear=QB,Gn.prototype.delete=eA,Gn.prototype.get=tA,Gn.prototype.has=nA,Gn.prototype.set=rA;function zn(o){var a=-1,c=o==null?0:o.length;for(this.clear();++a<c;){var h=o[a];this.set(h[0],h[1])}}function iA(){this.size=0,this.__data__={hash:new zr,map:new(Ro||Gn),string:new zr}}function oA(o){var a=la(this,o).delete(o);return this.size-=a?1:0,a}function sA(o){return la(this,o).get(o)}function aA(o){return la(this,o).has(o)}function lA(o,a){var c=la(this,o),h=c.size;return c.set(o,a),this.size+=c.size==h?0:1,this}zn.prototype.clear=iA,zn.prototype.delete=oA,zn.prototype.get=sA,zn.prototype.has=aA,zn.prototype.set=lA;function Zr(o){var a=-1,c=o==null?0:o.length;for(this.__data__=new zn;++a<c;)this.add(o[a])}function cA(o){return this.__data__.set(o,p),this}function dA(o){return this.__data__.has(o)}Zr.prototype.add=Zr.prototype.push=cA,Zr.prototype.has=dA;function Cn(o){var a=this.__data__=new Gn(o);this.size=a.size}function uA(){this.__data__=new Gn,this.size=0}function pA(o){var a=this.__data__,c=a.delete(o);return this.size=a.size,c}function hA(o){return this.__data__.get(o)}function fA(o){return this.__data__.has(o)}function mA(o,a){var c=this.__data__;if(c instanceof Gn){var h=c.__data__;if(!Ro||h.length<s-1)return h.push([o,a]),this.size=++c.size,this;c=this.__data__=new zn(h)}return c.set(o,a),this.size=c.size,this}Cn.prototype.clear=uA,Cn.prototype.delete=pA,Cn.prototype.get=hA,Cn.prototype.has=fA,Cn.prototype.set=mA;function ih(o,a){var c=ke(o),h=!c&&jr(o),g=!c&&!h&&br(o),_=!c&&!h&&!g&&Ti(o),b=c||h||g||_,E=b?ec(o.length,SB):[],V=E.length;for(var W in o)(a||Ze.call(o,W))&&!(b&&(W=="length"||g&&(W=="offset"||W=="parent")||_&&(W=="buffer"||W=="byteLength"||W=="byteOffset")||Wn(W,V)))&&E.push(W);return E}function oh(o){var a=o.length;return a?o[yc(0,a-1)]:n}function gA(o,a){return ca(Pt(o),$r(a,0,o.length))}function yA(o){return ca(Pt(o))}function ac(o,a,c){(c!==n&&!wn(o[a],c)||c===n&&!(a in o))&&Zn(o,a,c)}function Oo(o,a,c){var h=o[a];(!(Ze.call(o,a)&&wn(h,c))||c===n&&!(a in o))&&Zn(o,a,c)}function Ys(o,a){for(var c=o.length;c--;)if(wn(o[c][0],a))return c;return-1}function vA(o,a,c,h){return vr(o,function(g,_,b){a(h,g,c(g),b)}),h}function sh(o,a){return o&&Pn(a,ut(a),o)}function _A(o,a){return o&&Pn(a,Nt(a),o)}function Zn(o,a,c){a=="__proto__"&&Us?Us(o,a,{configurable:!0,enumerable:!0,value:c,writable:!0}):o[a]=c}function lc(o,a){for(var c=-1,h=a.length,g=M(h),_=o==null;++c<h;)g[c]=_?n:Zc(o,a[c]);return g}function $r(o,a,c){return o===o&&(c!==n&&(o=o<=c?o:c),a!==n&&(o=o>=a?o:a)),o}function Xt(o,a,c,h,g,_){var b,E=a&v,V=a&S,W=a&x;if(c&&(b=g?c(o,h,g,_):c(o)),b!==n)return b;if(!Je(o))return o;var H=ke(o);if(H){if(b=aP(o),!E)return Pt(o,b)}else{var q=_t(o),te=q==Bs||q==lp;if(br(o))return Ph(o,E);if(q==On||q==hi||te&&!g){if(b=V||te?{}:Kh(o),!E)return V?YA(o,_A(b,o)):KA(o,sh(b,o))}else{if(!Ue[q])return g?o:{};b=lP(o,q,E)}}_||(_=new Cn);var ce=_.get(o);if(ce)return ce;_.set(o,b),Sf(o)?o.forEach(function(me){b.add(Xt(me,a,c,me,o,_))}):xf(o)&&o.forEach(function(me,Ne){b.set(Ne,Xt(me,a,c,Ne,o,_))});var fe=W?V?Bc:Tc:V?Nt:ut,Pe=H?n:fe(o);return Kt(Pe||o,function(me,Ne){Pe&&(Ne=me,me=o[Ne]),Oo(b,Ne,Xt(me,a,c,Ne,o,_))}),b}function CA(o){var a=ut(o);return function(c){return ah(c,o,a)}}function ah(o,a,c){var h=c.length;if(o==null)return!h;for(o=$e(o);h--;){var g=c[h],_=a[g],b=o[g];if(b===n&&!(g in o)||!_(b))return!1}return!0}function lh(o,a,c){if(typeof o!="function")throw new Yt(d);return Ho(function(){o.apply(n,c)},a)}function Go(o,a,c,h){var g=-1,_=Ds,b=!0,E=o.length,V=[],W=a.length;if(!E)return V;c&&(a=qe(a,Zt(c))),h?(_=ql,b=!1):a.length>=s&&(_=Do,b=!1,a=new Zr(a));e:for(;++g<E;){var H=o[g],q=c==null?H:c(H);if(H=h||H!==0?H:0,b&&q===q){for(var te=W;te--;)if(a[te]===q)continue e;V.push(H)}else _(a,q,h)||V.push(H)}return V}var vr=Rh(An),ch=Rh(dc,!0);function wA(o,a){var c=!0;return vr(o,function(h,g,_){return c=!!a(h,g,_),c}),c}function Js(o,a,c){for(var h=-1,g=o.length;++h<g;){var _=o[h],b=a(_);if(b!=null&&(E===n?b===b&&!Ut(b):c(b,E)))var E=b,V=_}return V}function bA(o,a,c,h){var g=o.length;for(c=Te(c),c<0&&(c=-c>g?0:g+c),h=h===n||h>g?g:Te(h),h<0&&(h+=g),h=c>h?0:Tf(h);c<h;)o[c++]=a;return o}function dh(o,a){var c=[];return vr(o,function(h,g,_){a(h,g,_)&&c.push(h)}),c}function ht(o,a,c,h,g){var _=-1,b=o.length;for(c||(c=dP),g||(g=[]);++_<b;){var E=o[_];a>0&&c(E)?a>1?ht(E,a-1,c,h,g):mr(g,E):h||(g[g.length]=E)}return g}var cc=Mh(),uh=Mh(!0);function An(o,a){return o&&cc(o,a,ut)}function dc(o,a){return o&&uh(o,a,ut)}function Xs(o,a){return fr(a,function(c){return Hn(o[c])})}function Ur(o,a){a=Cr(a,o);for(var c=0,h=a.length;o!=null&&c<h;)o=o[Vn(a[c++])];return c&&c==h?o:n}function ph(o,a,c){var h=a(o);return ke(o)?h:mr(h,c(o))}function kt(o){return o==null?o===n?JE:KE:Gr&&Gr in $e(o)?iP(o):yP(o)}function uc(o,a){return o>a}function xA(o,a){return o!=null&&Ze.call(o,a)}function kA(o,a){return o!=null&&a in $e(o)}function SA(o,a,c){return o>=vt(a,c)&&o<at(a,c)}function pc(o,a,c){for(var h=c?ql:Ds,g=o[0].length,_=o.length,b=_,E=M(_),V=1/0,W=[];b--;){var H=o[b];b&&a&&(H=qe(H,Zt(a))),V=vt(H.length,V),E[b]=!c&&(a||g>=120&&H.length>=120)?new Zr(b&&H):n}H=o[0];var q=-1,te=E[0];e:for(;++q<g&&W.length<V;){var ce=H[q],fe=a?a(ce):ce;if(ce=c||ce!==0?ce:0,!(te?Do(te,fe):h(W,fe,c))){for(b=_;--b;){var Pe=E[b];if(!(Pe?Do(Pe,fe):h(o[b],fe,c)))continue e}te&&te.push(fe),W.push(ce)}}return W}function EA(o,a,c,h){return An(o,function(g,_,b){a(h,c(g),_,b)}),h}function zo(o,a,c){a=Cr(a,o),o=Qh(o,a);var h=o==null?o:o[Vn(en(a))];return h==null?n:zt(h,o,c)}function hh(o){return Qe(o)&&kt(o)==hi}function TA(o){return Qe(o)&&kt(o)==No}function BA(o){return Qe(o)&&kt(o)==To}function Zo(o,a,c,h,g){return o===a?!0:o==null||a==null||!Qe(o)&&!Qe(a)?o!==o&&a!==a:AA(o,a,c,h,Zo,g)}function AA(o,a,c,h,g,_){var b=ke(o),E=ke(a),V=b?Es:_t(o),W=E?Es:_t(a);V=V==hi?On:V,W=W==hi?On:W;var H=V==On,q=W==On,te=V==W;if(te&&br(o)){if(!br(a))return!1;b=!0,H=!1}if(te&&!H)return _||(_=new Cn),b||Ti(o)?Hh(o,a,c,h,g,_):nP(o,a,V,c,h,g,_);if(!(c&F)){var ce=H&&Ze.call(o,"__wrapped__"),fe=q&&Ze.call(a,"__wrapped__");if(ce||fe){var Pe=ce?o.value():o,me=fe?a.value():a;return _||(_=new Cn),g(Pe,me,c,h,_)}}return te?(_||(_=new Cn),rP(o,a,c,h,g,_)):!1}function PA(o){return Qe(o)&&_t(o)==yn}function hc(o,a,c,h){var g=c.length,_=g,b=!h;if(o==null)return!_;for(o=$e(o);g--;){var E=c[g];if(b&&E[2]?E[1]!==o[E[0]]:!(E[0]in o))return!1}for(;++g<_;){E=c[g];var V=E[0],W=o[V],H=E[1];if(b&&E[2]){if(W===n&&!(V in o))return!1}else{var q=new Cn;if(h)var te=h(W,H,V,o,a,q);if(!(te===n?Zo(H,W,F|T,h,q):te))return!1}}return!0}function fh(o){if(!Je(o)||pP(o))return!1;var a=Hn(o)?PB:CT;return a.test(Hr(o))}function VA(o){return Qe(o)&&kt(o)==Ao}function NA(o){return Qe(o)&&_t(o)==vn}function DA(o){return Qe(o)&&ma(o.length)&&!!He[kt(o)]}function mh(o){return typeof o=="function"?o:o==null?Dt:typeof o=="object"?ke(o)?vh(o[0],o[1]):yh(o):Lf(o)}function fc(o){if(!Wo(o))return MB(o);var a=[];for(var c in $e(o))Ze.call(o,c)&&c!="constructor"&&a.push(c);return a}function FA(o){if(!Je(o))return gP(o);var a=Wo(o),c=[];for(var h in o)h=="constructor"&&(a||!Ze.call(o,h))||c.push(h);return c}function mc(o,a){return o<a}function gh(o,a){var c=-1,h=Vt(o)?M(o.length):[];return vr(o,function(g,_,b){h[++c]=a(g,_,b)}),h}function yh(o){var a=Pc(o);return a.length==1&&a[0][2]?Jh(a[0][0],a[0][1]):function(c){return c===o||hc(c,o,a)}}function vh(o,a){return Nc(o)&&Yh(a)?Jh(Vn(o),a):function(c){var h=Zc(c,o);return h===n&&h===a?$c(c,o):Zo(a,h,F|T)}}function Qs(o,a,c,h,g){o!==a&&cc(a,function(_,b){if(g||(g=new Cn),Je(_))RA(o,a,b,c,Qs,h,g);else{var E=h?h(Fc(o,b),_,b+"",o,a,g):n;E===n&&(E=_),ac(o,b,E)}},Nt)}function RA(o,a,c,h,g,_,b){var E=Fc(o,c),V=Fc(a,c),W=b.get(V);if(W){ac(o,c,W);return}var H=_?_(E,V,c+"",o,a,b):n,q=H===n;if(q){var te=ke(V),ce=!te&&br(V),fe=!te&&!ce&&Ti(V);H=V,te||ce||fe?ke(E)?H=E:tt(E)?H=Pt(E):ce?(q=!1,H=Ph(V,!0)):fe?(q=!1,H=Vh(V,!0)):H=[]:jo(V)||jr(V)?(H=E,jr(E)?H=Bf(E):(!Je(E)||Hn(E))&&(H=Kh(V))):q=!1}q&&(b.set(V,H),g(H,V,h,_,b),b.delete(V)),ac(o,c,H)}function _h(o,a){var c=o.length;if(c)return a+=a<0?c:0,Wn(a,c)?o[a]:n}function Ch(o,a,c){a.length?a=qe(a,function(_){return ke(_)?function(b){return Ur(b,_.length===1?_[0]:_)}:_}):a=[Dt];var h=-1;a=qe(a,Zt(pe()));var g=gh(o,function(_,b,E){var V=qe(a,function(W){return W(_)});return{criteria:V,index:++h,value:_}});return lB(g,function(_,b){return qA(_,b,c)})}function MA(o,a){return wh(o,a,function(c,h){return $c(o,h)})}function wh(o,a,c){for(var h=-1,g=a.length,_={};++h<g;){var b=a[h],E=Ur(o,b);c(E,b)&&$o(_,Cr(b,o),E)}return _}function IA(o){return function(a){return Ur(a,o)}}function gc(o,a,c,h){var g=h?aB:gi,_=-1,b=a.length,E=o;for(o===a&&(a=Pt(a)),c&&(E=qe(o,Zt(c)));++_<b;)for(var V=0,W=a[_],H=c?c(W):W;(V=g(E,H,V,h))>-1;)E!==o&&$s.call(E,V,1),$s.call(o,V,1);return o}function bh(o,a){for(var c=o?a.length:0,h=c-1;c--;){var g=a[c];if(c==h||g!==_){var _=g;Wn(g)?$s.call(o,g,1):Cc(o,g)}}return o}function yc(o,a){return o+Hs(nh()*(a-o+1))}function LA(o,a,c,h){for(var g=-1,_=at(Ws((a-o)/(c||1)),0),b=M(_);_--;)b[h?_:++g]=o,o+=c;return b}function vc(o,a){var c="";if(!o||a<1||a>xe)return c;do a%2&&(c+=o),a=Hs(a/2),a&&(o+=o);while(a);return c}function Ve(o,a){return Rc(Xh(o,a,Dt),o+"")}function OA(o){return oh(Bi(o))}function GA(o,a){var c=Bi(o);return ca(c,$r(a,0,c.length))}function $o(o,a,c,h){if(!Je(o))return o;a=Cr(a,o);for(var g=-1,_=a.length,b=_-1,E=o;E!=null&&++g<_;){var V=Vn(a[g]),W=c;if(V==="__proto__"||V==="constructor"||V==="prototype")return o;if(g!=b){var H=E[V];W=h?h(H,V,E):n,W===n&&(W=Je(H)?H:Wn(a[g+1])?[]:{})}Oo(E,V,W),E=E[V]}return o}var xh=js?function(o,a){return js.set(o,a),o}:Dt,zA=Us?function(o,a){return Us(o,"toString",{configurable:!0,enumerable:!1,value:Wc(a),writable:!0})}:Dt;function ZA(o){return ca(Bi(o))}function Qt(o,a,c){var h=-1,g=o.length;a<0&&(a=-a>g?0:g+a),c=c>g?g:c,c<0&&(c+=g),g=a>c?0:c-a>>>0,a>>>=0;for(var _=M(g);++h<g;)_[h]=o[h+a];return _}function $A(o,a){var c;return vr(o,function(h,g,_){return c=a(h,g,_),!c}),!!c}function ea(o,a,c){var h=0,g=o==null?h:o.length;if(typeof a=="number"&&a===a&&g<=Lr){for(;h<g;){var _=h+g>>>1,b=o[_];b!==null&&!Ut(b)&&(c?b<=a:b<a)?h=_+1:g=_}return g}return _c(o,a,Dt,c)}function _c(o,a,c,h){var g=0,_=o==null?0:o.length;if(_===0)return 0;a=c(a);for(var b=a!==a,E=a===null,V=Ut(a),W=a===n;g<_;){var H=Hs((g+_)/2),q=c(o[H]),te=q!==n,ce=q===null,fe=q===q,Pe=Ut(q);if(b)var me=h||fe;else W?me=fe&&(h||te):E?me=fe&&te&&(h||!ce):V?me=fe&&te&&!ce&&(h||!Pe):ce||Pe?me=!1:me=h?q<=a:q<a;me?g=H+1:_=H}return vt(_,ko)}function kh(o,a){for(var c=-1,h=o.length,g=0,_=[];++c<h;){var b=o[c],E=a?a(b):b;if(!c||!wn(E,V)){var V=E;_[g++]=b===0?0:b}}return _}function Sh(o){return typeof o=="number"?o:Ut(o)?jt:+o}function $t(o){if(typeof o=="string")return o;if(ke(o))return qe(o,$t)+"";if(Ut(o))return rh?rh.call(o):"";var a=o+"";return a=="0"&&1/o==-ve?"-0":a}function _r(o,a,c){var h=-1,g=Ds,_=o.length,b=!0,E=[],V=E;if(c)b=!1,g=ql;else if(_>=s){var W=a?null:eP(o);if(W)return Rs(W);b=!1,g=Do,V=new Zr}else V=a?[]:E;e:for(;++h<_;){var H=o[h],q=a?a(H):H;if(H=c||H!==0?H:0,b&&q===q){for(var te=V.length;te--;)if(V[te]===q)continue e;a&&V.push(q),E.push(H)}else g(V,q,c)||(V!==E&&V.push(q),E.push(H))}return E}function Cc(o,a){return a=Cr(a,o),o=Qh(o,a),o==null||delete o[Vn(en(a))]}function Eh(o,a,c,h){return $o(o,a,c(Ur(o,a)),h)}function ta(o,a,c,h){for(var g=o.length,_=h?g:-1;(h?_--:++_<g)&&a(o[_],_,o););return c?Qt(o,h?0:_,h?_+1:g):Qt(o,h?_+1:0,h?g:_)}function Th(o,a){var c=o;return c instanceof De&&(c=c.value()),Kl(a,function(h,g){return g.func.apply(g.thisArg,mr([h],g.args))},c)}function wc(o,a,c){var h=o.length;if(h<2)return h?_r(o[0]):[];for(var g=-1,_=M(h);++g<h;)for(var b=o[g],E=-1;++E<h;)E!=g&&(_[g]=Go(_[g]||b,o[E],a,c));return _r(ht(_,1),a,c)}function Bh(o,a,c){for(var h=-1,g=o.length,_=a.length,b={};++h<g;){var E=h<_?a[h]:n;c(b,o[h],E)}return b}function bc(o){return tt(o)?o:[]}function xc(o){return typeof o=="function"?o:Dt}function Cr(o,a){return ke(o)?o:Nc(o,a)?[o]:rf(ze(o))}var UA=Ve;function wr(o,a,c){var h=o.length;return c=c===n?h:c,!a&&c>=h?o:Qt(o,a,c)}var Ah=VB||function(o){return pt.clearTimeout(o)};function Ph(o,a){if(a)return o.slice();var c=o.length,h=Jp?Jp(c):new o.constructor(c);return o.copy(h),h}function kc(o){var a=new o.constructor(o.byteLength);return new zs(a).set(new zs(o)),a}function WA(o,a){var c=a?kc(o.buffer):o.buffer;return new o.constructor(c,o.byteOffset,o.byteLength)}function HA(o){var a=new o.constructor(o.source,hp.exec(o));return a.lastIndex=o.lastIndex,a}function jA(o){return Lo?$e(Lo.call(o)):{}}function Vh(o,a){var c=a?kc(o.buffer):o.buffer;return new o.constructor(c,o.byteOffset,o.length)}function Nh(o,a){if(o!==a){var c=o!==n,h=o===null,g=o===o,_=Ut(o),b=a!==n,E=a===null,V=a===a,W=Ut(a);if(!E&&!W&&!_&&o>a||_&&b&&V&&!E&&!W||h&&b&&V||!c&&V||!g)return 1;if(!h&&!_&&!W&&o<a||W&&c&&g&&!h&&!_||E&&c&&g||!b&&g||!V)return-1}return 0}function qA(o,a,c){for(var h=-1,g=o.criteria,_=a.criteria,b=g.length,E=c.length;++h<b;){var V=Nh(g[h],_[h]);if(V){if(h>=E)return V;var W=c[h];return V*(W=="desc"?-1:1)}}return o.index-a.index}function Dh(o,a,c,h){for(var g=-1,_=o.length,b=c.length,E=-1,V=a.length,W=at(_-b,0),H=M(V+W),q=!h;++E<V;)H[E]=a[E];for(;++g<b;)(q||g<_)&&(H[c[g]]=o[g]);for(;W--;)H[E++]=o[g++];return H}function Fh(o,a,c,h){for(var g=-1,_=o.length,b=-1,E=c.length,V=-1,W=a.length,H=at(_-E,0),q=M(H+W),te=!h;++g<H;)q[g]=o[g];for(var ce=g;++V<W;)q[ce+V]=a[V];for(;++b<E;)(te||g<_)&&(q[ce+c[b]]=o[g++]);return q}function Pt(o,a){var c=-1,h=o.length;for(a||(a=M(h));++c<h;)a[c]=o[c];return a}function Pn(o,a,c,h){var g=!c;c||(c={});for(var _=-1,b=a.length;++_<b;){var E=a[_],V=h?h(c[E],o[E],E,c,o):n;V===n&&(V=o[E]),g?Zn(c,E,V):Oo(c,E,V)}return c}function KA(o,a){return Pn(o,Vc(o),a)}function YA(o,a){return Pn(o,jh(o),a)}function na(o,a){return function(c,h){var g=ke(c)?tB:vA,_=a?a():{};return g(c,o,pe(h,2),_)}}function ki(o){return Ve(function(a,c){var h=-1,g=c.length,_=g>1?c[g-1]:n,b=g>2?c[2]:n;for(_=o.length>3&&typeof _=="function"?(g--,_):n,b&&St(c[0],c[1],b)&&(_=g<3?n:_,g=1),a=$e(a);++h<g;){var E=c[h];E&&o(a,E,h,_)}return a})}function Rh(o,a){return function(c,h){if(c==null)return c;if(!Vt(c))return o(c,h);for(var g=c.length,_=a?g:-1,b=$e(c);(a?_--:++_<g)&&h(b[_],_,b)!==!1;);return c}}function Mh(o){return function(a,c,h){for(var g=-1,_=$e(a),b=h(a),E=b.length;E--;){var V=b[o?E:++g];if(c(_[V],V,_)===!1)break}return a}}function JA(o,a,c){var h=a&A,g=Uo(o);function _(){var b=this&&this!==pt&&this instanceof _?g:o;return b.apply(h?c:this,arguments)}return _}function Ih(o){return function(a){a=ze(a);var c=yi(a)?_n(a):n,h=c?c[0]:a.charAt(0),g=c?wr(c,1).join(""):a.slice(1);return h[o]()+g}}function Si(o){return function(a){return Kl(Mf(Rf(a).replace(zT,"")),o,"")}}function Uo(o){return function(){var a=arguments;switch(a.length){case 0:return new o;case 1:return new o(a[0]);case 2:return new o(a[0],a[1]);case 3:return new o(a[0],a[1],a[2]);case 4:return new o(a[0],a[1],a[2],a[3]);case 5:return new o(a[0],a[1],a[2],a[3],a[4]);case 6:return new o(a[0],a[1],a[2],a[3],a[4],a[5]);case 7:return new o(a[0],a[1],a[2],a[3],a[4],a[5],a[6])}var c=xi(o.prototype),h=o.apply(c,a);return Je(h)?h:c}}function XA(o,a,c){var h=Uo(o);function g(){for(var _=arguments.length,b=M(_),E=_,V=Ei(g);E--;)b[E]=arguments[E];var W=_<3&&b[0]!==V&&b[_-1]!==V?[]:gr(b,V);if(_-=W.length,_<c)return Zh(o,a,ra,g.placeholder,n,b,W,n,n,c-_);var H=this&&this!==pt&&this instanceof g?h:o;return zt(H,this,b)}return g}function Lh(o){return function(a,c,h){var g=$e(a);if(!Vt(a)){var _=pe(c,3);a=ut(a),c=function(E){return _(g[E],E,g)}}var b=o(a,c,h);return b>-1?g[_?a[b]:b]:n}}function Oh(o){return Un(function(a){var c=a.length,h=c,g=Jt.prototype.thru;for(o&&a.reverse();h--;){var _=a[h];if(typeof _!="function")throw new Yt(d);if(g&&!b&&aa(_)=="wrapper")var b=new Jt([],!0)}for(h=b?h:c;++h<c;){_=a[h];var E=aa(_),V=E=="wrapper"?Ac(_):n;V&&Dc(V[0])&&V[1]==(I|$|L|N)&&!V[4].length&&V[9]==1?b=b[aa(V[0])].apply(b,V[3]):b=_.length==1&&Dc(_)?b[E]():b.thru(_)}return function(){var W=arguments,H=W[0];if(b&&W.length==1&&ke(H))return b.plant(H).value();for(var q=0,te=c?a[q].apply(this,W):H;++q<c;)te=a[q].call(this,te);return te}})}function ra(o,a,c,h,g,_,b,E,V,W){var H=a&I,q=a&A,te=a&k,ce=a&($|z),fe=a&j,Pe=te?n:Uo(o);function me(){for(var Ne=arguments.length,Fe=M(Ne),Wt=Ne;Wt--;)Fe[Wt]=arguments[Wt];if(ce)var Et=Ei(me),Ht=dB(Fe,Et);if(h&&(Fe=Dh(Fe,h,g,ce)),_&&(Fe=Fh(Fe,_,b,ce)),Ne-=Ht,ce&&Ne<W){var nt=gr(Fe,Et);return Zh(o,a,ra,me.placeholder,c,Fe,nt,E,V,W-Ne)}var bn=q?c:this,qn=te?bn[o]:o;return Ne=Fe.length,E?Fe=vP(Fe,E):fe&&Ne>1&&Fe.reverse(),H&&V<Ne&&(Fe.length=V),this&&this!==pt&&this instanceof me&&(qn=Pe||Uo(qn)),qn.apply(bn,Fe)}return me}function Gh(o,a){return function(c,h){return EA(c,o,a(h),{})}}function ia(o,a){return function(c,h){var g;if(c===n&&h===n)return a;if(c!==n&&(g=c),h!==n){if(g===n)return h;typeof c=="string"||typeof h=="string"?(c=$t(c),h=$t(h)):(c=Sh(c),h=Sh(h)),g=o(c,h)}return g}}function Sc(o){return Un(function(a){return a=qe(a,Zt(pe())),Ve(function(c){var h=this;return o(a,function(g){return zt(g,h,c)})})})}function oa(o,a){a=a===n?" ":$t(a);var c=a.length;if(c<2)return c?vc(a,o):a;var h=vc(a,Ws(o/vi(a)));return yi(a)?wr(_n(h),0,o).join(""):h.slice(0,o)}function QA(o,a,c,h){var g=a&A,_=Uo(o);function b(){for(var E=-1,V=arguments.length,W=-1,H=h.length,q=M(H+V),te=this&&this!==pt&&this instanceof b?_:o;++W<H;)q[W]=h[W];for(;V--;)q[W++]=arguments[++E];return zt(te,g?c:this,q)}return b}function zh(o){return function(a,c,h){return h&&typeof h!="number"&&St(a,c,h)&&(c=h=n),a=jn(a),c===n?(c=a,a=0):c=jn(c),h=h===n?a<c?1:-1:jn(h),LA(a,c,h,o)}}function sa(o){return function(a,c){return typeof a=="string"&&typeof c=="string"||(a=tn(a),c=tn(c)),o(a,c)}}function Zh(o,a,c,h,g,_,b,E,V,W){var H=a&$,q=H?b:n,te=H?n:b,ce=H?_:n,fe=H?n:_;a|=H?L:X,a&=~(H?X:L),a&D||(a&=~(A|k));var Pe=[o,a,g,ce,q,fe,te,E,V,W],me=c.apply(n,Pe);return Dc(o)&&ef(me,Pe),me.placeholder=h,tf(me,o,a)}function Ec(o){var a=st[o];return function(c,h){if(c=tn(c),h=h==null?0:vt(Te(h),292),h&&th(c)){var g=(ze(c)+"e").split("e"),_=a(g[0]+"e"+(+g[1]+h));return g=(ze(_)+"e").split("e"),+(g[0]+"e"+(+g[1]-h))}return a(c)}}var eP=wi&&1/Rs(new wi([,-0]))[1]==ve?function(o){return new wi(o)}:qc;function $h(o){return function(a){var c=_t(a);return c==yn?nc(a):c==vn?yB(a):cB(a,o(a))}}function $n(o,a,c,h,g,_,b,E){var V=a&k;if(!V&&typeof o!="function")throw new Yt(d);var W=h?h.length:0;if(W||(a&=~(L|X),h=g=n),b=b===n?b:at(Te(b),0),E=E===n?E:Te(E),W-=g?g.length:0,a&X){var H=h,q=g;h=g=n}var te=V?n:Ac(o),ce=[o,a,c,h,g,H,q,_,b,E];if(te&&mP(ce,te),o=ce[0],a=ce[1],c=ce[2],h=ce[3],g=ce[4],E=ce[9]=ce[9]===n?V?0:o.length:at(ce[9]-W,0),!E&&a&($|z)&&(a&=~($|z)),!a||a==A)var fe=JA(o,a,c);else a==$||a==z?fe=XA(o,a,E):(a==L||a==(A|L))&&!g.length?fe=QA(o,a,c,h):fe=ra.apply(n,ce);var Pe=te?xh:ef;return tf(Pe(fe,ce),o,a)}function Uh(o,a,c,h){return o===n||wn(o,Ci[c])&&!Ze.call(h,c)?a:o}function Wh(o,a,c,h,g,_){return Je(o)&&Je(a)&&(_.set(a,o),Qs(o,a,n,Wh,_),_.delete(a)),o}function tP(o){return jo(o)?n:o}function Hh(o,a,c,h,g,_){var b=c&F,E=o.length,V=a.length;if(E!=V&&!(b&&V>E))return!1;var W=_.get(o),H=_.get(a);if(W&&H)return W==a&&H==o;var q=-1,te=!0,ce=c&T?new Zr:n;for(_.set(o,a),_.set(a,o);++q<E;){var fe=o[q],Pe=a[q];if(h)var me=b?h(Pe,fe,q,a,o,_):h(fe,Pe,q,o,a,_);if(me!==n){if(me)continue;te=!1;break}if(ce){if(!Yl(a,function(Ne,Fe){if(!Do(ce,Fe)&&(fe===Ne||g(fe,Ne,c,h,_)))return ce.push(Fe)})){te=!1;break}}else if(!(fe===Pe||g(fe,Pe,c,h,_))){te=!1;break}}return _.delete(o),_.delete(a),te}function nP(o,a,c,h,g,_,b){switch(c){case fi:if(o.byteLength!=a.byteLength||o.byteOffset!=a.byteOffset)return!1;o=o.buffer,a=a.buffer;case No:return!(o.byteLength!=a.byteLength||!_(new zs(o),new zs(a)));case Eo:case To:case Bo:return wn(+o,+a);case Ts:return o.name==a.name&&o.message==a.message;case Ao:case Po:return o==a+"";case yn:var E=nc;case vn:var V=h&F;if(E||(E=Rs),o.size!=a.size&&!V)return!1;var W=b.get(o);if(W)return W==a;h|=T,b.set(o,a);var H=Hh(E(o),E(a),h,g,_,b);return b.delete(o),H;case As:if(Lo)return Lo.call(o)==Lo.call(a)}return!1}function rP(o,a,c,h,g,_){var b=c&F,E=Tc(o),V=E.length,W=Tc(a),H=W.length;if(V!=H&&!b)return!1;for(var q=V;q--;){var te=E[q];if(!(b?te in a:Ze.call(a,te)))return!1}var ce=_.get(o),fe=_.get(a);if(ce&&fe)return ce==a&&fe==o;var Pe=!0;_.set(o,a),_.set(a,o);for(var me=b;++q<V;){te=E[q];var Ne=o[te],Fe=a[te];if(h)var Wt=b?h(Fe,Ne,te,a,o,_):h(Ne,Fe,te,o,a,_);if(!(Wt===n?Ne===Fe||g(Ne,Fe,c,h,_):Wt)){Pe=!1;break}me||(me=te=="constructor")}if(Pe&&!me){var Et=o.constructor,Ht=a.constructor;Et!=Ht&&"constructor"in o&&"constructor"in a&&!(typeof Et=="function"&&Et instanceof Et&&typeof Ht=="function"&&Ht instanceof Ht)&&(Pe=!1)}return _.delete(o),_.delete(a),Pe}function Un(o){return Rc(Xh(o,n,lf),o+"")}function Tc(o){return ph(o,ut,Vc)}function Bc(o){return ph(o,Nt,jh)}var Ac=js?function(o){return js.get(o)}:qc;function aa(o){for(var a=o.name+"",c=bi[a],h=Ze.call(bi,a)?c.length:0;h--;){var g=c[h],_=g.func;if(_==null||_==o)return g.name}return a}function Ei(o){var a=Ze.call(y,"placeholder")?y:o;return a.placeholder}function pe(){var o=y.iteratee||Hc;return o=o===Hc?mh:o,arguments.length?o(arguments[0],arguments[1]):o}function la(o,a){var c=o.__data__;return uP(a)?c[typeof a=="string"?"string":"hash"]:c.map}function Pc(o){for(var a=ut(o),c=a.length;c--;){var h=a[c],g=o[h];a[c]=[h,g,Yh(g)]}return a}function Wr(o,a){var c=fB(o,a);return fh(c)?c:n}function iP(o){var a=Ze.call(o,Gr),c=o[Gr];try{o[Gr]=n;var h=!0}catch{}var g=Os.call(o);return h&&(a?o[Gr]=c:delete o[Gr]),g}var Vc=ic?function(o){return o==null?[]:(o=$e(o),fr(ic(o),function(a){return Qp.call(o,a)}))}:Kc,jh=ic?function(o){for(var a=[];o;)mr(a,Vc(o)),o=Zs(o);return a}:Kc,_t=kt;(oc&&_t(new oc(new ArrayBuffer(1)))!=fi||Ro&&_t(new Ro)!=yn||sc&&_t(sc.resolve())!=cp||wi&&_t(new wi)!=vn||Mo&&_t(new Mo)!=Vo)&&(_t=function(o){var a=kt(o),c=a==On?o.constructor:n,h=c?Hr(c):"";if(h)switch(h){case GB:return fi;case zB:return yn;case ZB:return cp;case $B:return vn;case UB:return Vo}return a});function oP(o,a,c){for(var h=-1,g=c.length;++h<g;){var _=c[h],b=_.size;switch(_.type){case"drop":o+=b;break;case"dropRight":a-=b;break;case"take":a=vt(a,o+b);break;case"takeRight":o=at(o,a-b);break}}return{start:o,end:a}}function sP(o){var a=o.match(pT);return a?a[1].split(hT):[]}function qh(o,a,c){a=Cr(a,o);for(var h=-1,g=a.length,_=!1;++h<g;){var b=Vn(a[h]);if(!(_=o!=null&&c(o,b)))break;o=o[b]}return _||++h!=g?_:(g=o==null?0:o.length,!!g&&ma(g)&&Wn(b,g)&&(ke(o)||jr(o)))}function aP(o){var a=o.length,c=new o.constructor(a);return a&&typeof o[0]=="string"&&Ze.call(o,"index")&&(c.index=o.index,c.input=o.input),c}function Kh(o){return typeof o.constructor=="function"&&!Wo(o)?xi(Zs(o)):{}}function lP(o,a,c){var h=o.constructor;switch(a){case No:return kc(o);case Eo:case To:return new h(+o);case fi:return WA(o,c);case Pl:case Vl:case Nl:case Dl:case Fl:case Rl:case Ml:case Il:case Ll:return Vh(o,c);case yn:return new h;case Bo:case Po:return new h(o);case Ao:return HA(o);case vn:return new h;case As:return jA(o)}}function cP(o,a){var c=a.length;if(!c)return o;var h=c-1;return a[h]=(c>1?"& ":"")+a[h],a=a.join(c>2?", ":" "),o.replace(uT,`{
70
+ */bs.exports,function(t,e){(function(){var n,i="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__",v=1,k=2,S=4,F=1,T=2,N=1,C=2,I=4,Q=8,M=16,R=32,U=64,z=128,P=256,Z=512,O=30,K="...",ue=800,W=16,A=1,G=2,Y=3,ve=1/0,xe=9007199254740991,Gt=17976931348623157e292,jt=NaN,At=4294967295,ko=At-1,Lr=At>>>1,So=[["ary",z],["bind",N],["bindKey",C],["curry",Q],["curryRight",M],["flip",Z],["partial",R],["partialRight",U],["rearg",P]],hi="[object Arguments]",Es="[object Array]",qE="[object AsyncFunction]",Eo="[object Boolean]",To="[object Date]",KE="[object DOMException]",Ts="[object Error]",Bs="[object Function]",lp="[object GeneratorFunction]",yn="[object Map]",Bo="[object Number]",YE="[object Null]",On="[object Object]",cp="[object Promise]",JE="[object Proxy]",Ao="[object RegExp]",vn="[object Set]",Po="[object String]",As="[object Symbol]",XE="[object Undefined]",Vo="[object WeakMap]",QE="[object WeakSet]",No="[object ArrayBuffer]",fi="[object DataView]",Pl="[object Float32Array]",Vl="[object Float64Array]",Nl="[object Int8Array]",Dl="[object Int16Array]",Fl="[object Int32Array]",Rl="[object Uint8Array]",Ml="[object Uint8ClampedArray]",Il="[object Uint16Array]",Ll="[object Uint32Array]",eT=/\b__p \+= '';/g,tT=/\b(__p \+=) '' \+/g,nT=/(__e\(.*?\)|\b__t\)) \+\n'';/g,dp=/&(?:amp|lt|gt|quot|#39);/g,up=/[&<>"']/g,rT=RegExp(dp.source),iT=RegExp(up.source),oT=/<%-([\s\S]+?)%>/g,sT=/<%([\s\S]+?)%>/g,pp=/<%=([\s\S]+?)%>/g,aT=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,lT=/^\w*$/,cT=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ol=/[\\^$.*+?()[\]{}|]/g,dT=RegExp(Ol.source),Gl=/^\s+/,uT=/\s/,pT=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,hT=/\{\n\/\* \[wrapped with (.+)\] \*/,fT=/,? & /,mT=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,gT=/[()=,{}\[\]\/\s]/,yT=/\\(\\)?/g,vT=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,hp=/\w*$/,_T=/^[-+]0x[0-9a-f]+$/i,CT=/^0b[01]+$/i,wT=/^\[object .+?Constructor\]$/,bT=/^0o[0-7]+$/i,xT=/^(?:0|[1-9]\d*)$/,kT=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Ps=/($^)/,ST=/['\n\r\u2028\u2029\\]/g,Vs="\\ud800-\\udfff",ET="\\u0300-\\u036f",TT="\\ufe20-\\ufe2f",BT="\\u20d0-\\u20ff",fp=ET+TT+BT,mp="\\u2700-\\u27bf",gp="a-z\\xdf-\\xf6\\xf8-\\xff",AT="\\xac\\xb1\\xd7\\xf7",PT="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",VT="\\u2000-\\u206f",NT=" \\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",yp="A-Z\\xc0-\\xd6\\xd8-\\xde",vp="\\ufe0e\\ufe0f",_p=AT+PT+VT+NT,zl="['’]",DT="["+Vs+"]",Cp="["+_p+"]",Ns="["+fp+"]",wp="\\d+",FT="["+mp+"]",bp="["+gp+"]",xp="[^"+Vs+_p+wp+mp+gp+yp+"]",Zl="\\ud83c[\\udffb-\\udfff]",RT="(?:"+Ns+"|"+Zl+")",kp="[^"+Vs+"]",$l="(?:\\ud83c[\\udde6-\\uddff]){2}",Ul="[\\ud800-\\udbff][\\udc00-\\udfff]",mi="["+yp+"]",Sp="\\u200d",Ep="(?:"+bp+"|"+xp+")",MT="(?:"+mi+"|"+xp+")",Tp="(?:"+zl+"(?:d|ll|m|re|s|t|ve))?",Bp="(?:"+zl+"(?:D|LL|M|RE|S|T|VE))?",Ap=RT+"?",Pp="["+vp+"]?",IT="(?:"+Sp+"(?:"+[kp,$l,Ul].join("|")+")"+Pp+Ap+")*",LT="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",OT="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Vp=Pp+Ap+IT,GT="(?:"+[FT,$l,Ul].join("|")+")"+Vp,zT="(?:"+[kp+Ns+"?",Ns,$l,Ul,DT].join("|")+")",ZT=RegExp(zl,"g"),$T=RegExp(Ns,"g"),Wl=RegExp(Zl+"(?="+Zl+")|"+zT+Vp,"g"),UT=RegExp([mi+"?"+bp+"+"+Tp+"(?="+[Cp,mi,"$"].join("|")+")",MT+"+"+Bp+"(?="+[Cp,mi+Ep,"$"].join("|")+")",mi+"?"+Ep+"+"+Tp,mi+"+"+Bp,OT,LT,wp,GT].join("|"),"g"),WT=RegExp("["+Sp+Vs+fp+vp+"]"),HT=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,jT=["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"],qT=-1,He={};He[Pl]=He[Vl]=He[Nl]=He[Dl]=He[Fl]=He[Rl]=He[Ml]=He[Il]=He[Ll]=!0,He[hi]=He[Es]=He[No]=He[Eo]=He[fi]=He[To]=He[Ts]=He[Bs]=He[yn]=He[Bo]=He[On]=He[Ao]=He[vn]=He[Po]=He[Vo]=!1;var Ue={};Ue[hi]=Ue[Es]=Ue[No]=Ue[fi]=Ue[Eo]=Ue[To]=Ue[Pl]=Ue[Vl]=Ue[Nl]=Ue[Dl]=Ue[Fl]=Ue[yn]=Ue[Bo]=Ue[On]=Ue[Ao]=Ue[vn]=Ue[Po]=Ue[As]=Ue[Rl]=Ue[Ml]=Ue[Il]=Ue[Ll]=!0,Ue[Ts]=Ue[Bs]=Ue[Vo]=!1;var KT={À:"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"},YT={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},JT={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},XT={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},QT=parseFloat,eB=parseInt,Np=typeof Ai=="object"&&Ai&&Ai.Object===Object&&Ai,tB=typeof self=="object"&&self&&self.Object===Object&&self,pt=Np||tB||Function("return this")(),Hl=e&&!e.nodeType&&e,Or=Hl&&!0&&t&&!t.nodeType&&t,Dp=Or&&Or.exports===Hl,jl=Dp&&Np.process,qt=function(){try{var B=Or&&Or.require&&Or.require("util").types;return B||jl&&jl.binding&&jl.binding("util")}catch{}}(),Fp=qt&&qt.isArrayBuffer,Rp=qt&&qt.isDate,Mp=qt&&qt.isMap,Ip=qt&&qt.isRegExp,Lp=qt&&qt.isSet,Op=qt&&qt.isTypedArray;function zt(B,$,L){switch(L.length){case 0:return B.call($);case 1:return B.call($,L[0]);case 2:return B.call($,L[0],L[1]);case 3:return B.call($,L[0],L[1],L[2])}return B.apply($,L)}function nB(B,$,L,se){for(var be=-1,Oe=B==null?0:B.length;++be<Oe;){var st=B[be];$(se,st,L(st),B)}return se}function Kt(B,$){for(var L=-1,se=B==null?0:B.length;++L<se&&$(B[L],L,B)!==!1;);return B}function rB(B,$){for(var L=B==null?0:B.length;L--&&$(B[L],L,B)!==!1;);return B}function Gp(B,$){for(var L=-1,se=B==null?0:B.length;++L<se;)if(!$(B[L],L,B))return!1;return!0}function fr(B,$){for(var L=-1,se=B==null?0:B.length,be=0,Oe=[];++L<se;){var st=B[L];$(st,L,B)&&(Oe[be++]=st)}return Oe}function Ds(B,$){var L=B==null?0:B.length;return!!L&&gi(B,$,0)>-1}function ql(B,$,L){for(var se=-1,be=B==null?0:B.length;++se<be;)if(L($,B[se]))return!0;return!1}function qe(B,$){for(var L=-1,se=B==null?0:B.length,be=Array(se);++L<se;)be[L]=$(B[L],L,B);return be}function mr(B,$){for(var L=-1,se=$.length,be=B.length;++L<se;)B[be+L]=$[L];return B}function Kl(B,$,L,se){var be=-1,Oe=B==null?0:B.length;for(se&&Oe&&(L=B[++be]);++be<Oe;)L=$(L,B[be],be,B);return L}function iB(B,$,L,se){var be=B==null?0:B.length;for(se&&be&&(L=B[--be]);be--;)L=$(L,B[be],be,B);return L}function Yl(B,$){for(var L=-1,se=B==null?0:B.length;++L<se;)if($(B[L],L,B))return!0;return!1}var oB=Jl("length");function sB(B){return B.split("")}function aB(B){return B.match(mT)||[]}function zp(B,$,L){var se;return L(B,function(be,Oe,st){if($(be,Oe,st))return se=Oe,!1}),se}function Fs(B,$,L,se){for(var be=B.length,Oe=L+(se?1:-1);se?Oe--:++Oe<be;)if($(B[Oe],Oe,B))return Oe;return-1}function gi(B,$,L){return $===$?_B(B,$,L):Fs(B,Zp,L)}function lB(B,$,L,se){for(var be=L-1,Oe=B.length;++be<Oe;)if(se(B[be],$))return be;return-1}function Zp(B){return B!==B}function $p(B,$){var L=B==null?0:B.length;return L?Ql(B,$)/L:jt}function Jl(B){return function($){return $==null?n:$[B]}}function Xl(B){return function($){return B==null?n:B[$]}}function Up(B,$,L,se,be){return be(B,function(Oe,st,$e){L=se?(se=!1,Oe):$(L,Oe,st,$e)}),L}function cB(B,$){var L=B.length;for(B.sort($);L--;)B[L]=B[L].value;return B}function Ql(B,$){for(var L,se=-1,be=B.length;++se<be;){var Oe=$(B[se]);Oe!==n&&(L=L===n?Oe:L+Oe)}return L}function ec(B,$){for(var L=-1,se=Array(B);++L<B;)se[L]=$(L);return se}function dB(B,$){return qe($,function(L){return[L,B[L]]})}function Wp(B){return B&&B.slice(0,Kp(B)+1).replace(Gl,"")}function Zt(B){return function($){return B($)}}function tc(B,$){return qe($,function(L){return B[L]})}function Do(B,$){return B.has($)}function Hp(B,$){for(var L=-1,se=B.length;++L<se&&gi($,B[L],0)>-1;);return L}function jp(B,$){for(var L=B.length;L--&&gi($,B[L],0)>-1;);return L}function uB(B,$){for(var L=B.length,se=0;L--;)B[L]===$&&++se;return se}var pB=Xl(KT),hB=Xl(YT);function fB(B){return"\\"+XT[B]}function mB(B,$){return B==null?n:B[$]}function yi(B){return WT.test(B)}function gB(B){return HT.test(B)}function yB(B){for(var $,L=[];!($=B.next()).done;)L.push($.value);return L}function nc(B){var $=-1,L=Array(B.size);return B.forEach(function(se,be){L[++$]=[be,se]}),L}function qp(B,$){return function(L){return B($(L))}}function gr(B,$){for(var L=-1,se=B.length,be=0,Oe=[];++L<se;){var st=B[L];(st===$||st===m)&&(B[L]=m,Oe[be++]=L)}return Oe}function Rs(B){var $=-1,L=Array(B.size);return B.forEach(function(se){L[++$]=se}),L}function vB(B){var $=-1,L=Array(B.size);return B.forEach(function(se){L[++$]=[se,se]}),L}function _B(B,$,L){for(var se=L-1,be=B.length;++se<be;)if(B[se]===$)return se;return-1}function CB(B,$,L){for(var se=L+1;se--;)if(B[se]===$)return se;return se}function vi(B){return yi(B)?bB(B):oB(B)}function _n(B){return yi(B)?xB(B):sB(B)}function Kp(B){for(var $=B.length;$--&&uT.test(B.charAt($)););return $}var wB=Xl(JT);function bB(B){for(var $=Wl.lastIndex=0;Wl.test(B);)++$;return $}function xB(B){return B.match(Wl)||[]}function kB(B){return B.match(UT)||[]}var SB=function B($){$=$==null?pt:_i.defaults(pt.Object(),$,_i.pick(pt,jT));var L=$.Array,se=$.Date,be=$.Error,Oe=$.Function,st=$.Math,$e=$.Object,rc=$.RegExp,EB=$.String,Yt=$.TypeError,Ms=L.prototype,TB=Oe.prototype,Ci=$e.prototype,Is=$["__core-js_shared__"],Ls=TB.toString,Ze=Ci.hasOwnProperty,BB=0,Yp=function(){var o=/[^.]+$/.exec(Is&&Is.keys&&Is.keys.IE_PROTO||"");return o?"Symbol(src)_1."+o:""}(),Os=Ci.toString,AB=Ls.call($e),PB=pt._,VB=rc("^"+Ls.call(Ze).replace(Ol,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Gs=Dp?$.Buffer:n,yr=$.Symbol,zs=$.Uint8Array,Jp=Gs?Gs.allocUnsafe:n,Zs=qp($e.getPrototypeOf,$e),Xp=$e.create,Qp=Ci.propertyIsEnumerable,$s=Ms.splice,eh=yr?yr.isConcatSpreadable:n,Fo=yr?yr.iterator:n,Gr=yr?yr.toStringTag:n,Us=function(){try{var o=Wr($e,"defineProperty");return o({},"",{}),o}catch{}}(),NB=$.clearTimeout!==pt.clearTimeout&&$.clearTimeout,DB=se&&se.now!==pt.Date.now&&se.now,FB=$.setTimeout!==pt.setTimeout&&$.setTimeout,Ws=st.ceil,Hs=st.floor,ic=$e.getOwnPropertySymbols,RB=Gs?Gs.isBuffer:n,th=$.isFinite,MB=Ms.join,IB=qp($e.keys,$e),at=st.max,vt=st.min,LB=se.now,OB=$.parseInt,nh=st.random,GB=Ms.reverse,oc=Wr($,"DataView"),Ro=Wr($,"Map"),sc=Wr($,"Promise"),wi=Wr($,"Set"),Mo=Wr($,"WeakMap"),Io=Wr($e,"create"),js=Mo&&new Mo,bi={},zB=Hr(oc),ZB=Hr(Ro),$B=Hr(sc),UB=Hr(wi),WB=Hr(Mo),qs=yr?yr.prototype:n,Lo=qs?qs.valueOf:n,rh=qs?qs.toString:n;function y(o){if(Qe(o)&&!ke(o)&&!(o instanceof De)){if(o instanceof Jt)return o;if(Ze.call(o,"__wrapped__"))return of(o)}return new Jt(o)}var xi=function(){function o(){}return function(a){if(!Je(a))return{};if(Xp)return Xp(a);o.prototype=a;var d=new o;return o.prototype=n,d}}();function Ks(){}function Jt(o,a){this.__wrapped__=o,this.__actions__=[],this.__chain__=!!a,this.__index__=0,this.__values__=n}y.templateSettings={escape:oT,evaluate:sT,interpolate:pp,variable:"",imports:{_:y}},y.prototype=Ks.prototype,y.prototype.constructor=y,Jt.prototype=xi(Ks.prototype),Jt.prototype.constructor=Jt;function De(o){this.__wrapped__=o,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=At,this.__views__=[]}function HB(){var o=new De(this.__wrapped__);return o.__actions__=Pt(this.__actions__),o.__dir__=this.__dir__,o.__filtered__=this.__filtered__,o.__iteratees__=Pt(this.__iteratees__),o.__takeCount__=this.__takeCount__,o.__views__=Pt(this.__views__),o}function jB(){if(this.__filtered__){var o=new De(this);o.__dir__=-1,o.__filtered__=!0}else o=this.clone(),o.__dir__*=-1;return o}function qB(){var o=this.__wrapped__.value(),a=this.__dir__,d=ke(o),h=a<0,g=d?o.length:0,_=sP(0,g,this.__views__),x=_.start,E=_.end,V=E-x,H=h?E:x-1,j=this.__iteratees__,q=j.length,te=0,le=vt(V,this.__takeCount__);if(!d||!h&&g==V&&le==V)return Th(o,this.__actions__);var fe=[];e:for(;V--&&te<le;){H+=a;for(var Pe=-1,me=o[H];++Pe<q;){var Ne=j[Pe],Fe=Ne.iteratee,Wt=Ne.type,Et=Fe(me);if(Wt==G)me=Et;else if(!Et){if(Wt==A)continue e;break e}}fe[te++]=me}return fe}De.prototype=xi(Ks.prototype),De.prototype.constructor=De;function zr(o){var a=-1,d=o==null?0:o.length;for(this.clear();++a<d;){var h=o[a];this.set(h[0],h[1])}}function KB(){this.__data__=Io?Io(null):{},this.size=0}function YB(o){var a=this.has(o)&&delete this.__data__[o];return this.size-=a?1:0,a}function JB(o){var a=this.__data__;if(Io){var d=a[o];return d===p?n:d}return Ze.call(a,o)?a[o]:n}function XB(o){var a=this.__data__;return Io?a[o]!==n:Ze.call(a,o)}function QB(o,a){var d=this.__data__;return this.size+=this.has(o)?0:1,d[o]=Io&&a===n?p:a,this}zr.prototype.clear=KB,zr.prototype.delete=YB,zr.prototype.get=JB,zr.prototype.has=XB,zr.prototype.set=QB;function Gn(o){var a=-1,d=o==null?0:o.length;for(this.clear();++a<d;){var h=o[a];this.set(h[0],h[1])}}function eA(){this.__data__=[],this.size=0}function tA(o){var a=this.__data__,d=Ys(a,o);if(d<0)return!1;var h=a.length-1;return d==h?a.pop():$s.call(a,d,1),--this.size,!0}function nA(o){var a=this.__data__,d=Ys(a,o);return d<0?n:a[d][1]}function rA(o){return Ys(this.__data__,o)>-1}function iA(o,a){var d=this.__data__,h=Ys(d,o);return h<0?(++this.size,d.push([o,a])):d[h][1]=a,this}Gn.prototype.clear=eA,Gn.prototype.delete=tA,Gn.prototype.get=nA,Gn.prototype.has=rA,Gn.prototype.set=iA;function zn(o){var a=-1,d=o==null?0:o.length;for(this.clear();++a<d;){var h=o[a];this.set(h[0],h[1])}}function oA(){this.size=0,this.__data__={hash:new zr,map:new(Ro||Gn),string:new zr}}function sA(o){var a=la(this,o).delete(o);return this.size-=a?1:0,a}function aA(o){return la(this,o).get(o)}function lA(o){return la(this,o).has(o)}function cA(o,a){var d=la(this,o),h=d.size;return d.set(o,a),this.size+=d.size==h?0:1,this}zn.prototype.clear=oA,zn.prototype.delete=sA,zn.prototype.get=aA,zn.prototype.has=lA,zn.prototype.set=cA;function Zr(o){var a=-1,d=o==null?0:o.length;for(this.__data__=new zn;++a<d;)this.add(o[a])}function dA(o){return this.__data__.set(o,p),this}function uA(o){return this.__data__.has(o)}Zr.prototype.add=Zr.prototype.push=dA,Zr.prototype.has=uA;function Cn(o){var a=this.__data__=new Gn(o);this.size=a.size}function pA(){this.__data__=new Gn,this.size=0}function hA(o){var a=this.__data__,d=a.delete(o);return this.size=a.size,d}function fA(o){return this.__data__.get(o)}function mA(o){return this.__data__.has(o)}function gA(o,a){var d=this.__data__;if(d instanceof Gn){var h=d.__data__;if(!Ro||h.length<s-1)return h.push([o,a]),this.size=++d.size,this;d=this.__data__=new zn(h)}return d.set(o,a),this.size=d.size,this}Cn.prototype.clear=pA,Cn.prototype.delete=hA,Cn.prototype.get=fA,Cn.prototype.has=mA,Cn.prototype.set=gA;function ih(o,a){var d=ke(o),h=!d&&jr(o),g=!d&&!h&&br(o),_=!d&&!h&&!g&&Ti(o),x=d||h||g||_,E=x?ec(o.length,EB):[],V=E.length;for(var H in o)(a||Ze.call(o,H))&&!(x&&(H=="length"||g&&(H=="offset"||H=="parent")||_&&(H=="buffer"||H=="byteLength"||H=="byteOffset")||Wn(H,V)))&&E.push(H);return E}function oh(o){var a=o.length;return a?o[yc(0,a-1)]:n}function yA(o,a){return ca(Pt(o),$r(a,0,o.length))}function vA(o){return ca(Pt(o))}function ac(o,a,d){(d!==n&&!wn(o[a],d)||d===n&&!(a in o))&&Zn(o,a,d)}function Oo(o,a,d){var h=o[a];(!(Ze.call(o,a)&&wn(h,d))||d===n&&!(a in o))&&Zn(o,a,d)}function Ys(o,a){for(var d=o.length;d--;)if(wn(o[d][0],a))return d;return-1}function _A(o,a,d,h){return vr(o,function(g,_,x){a(h,g,d(g),x)}),h}function sh(o,a){return o&&Pn(a,ut(a),o)}function CA(o,a){return o&&Pn(a,Nt(a),o)}function Zn(o,a,d){a=="__proto__"&&Us?Us(o,a,{configurable:!0,enumerable:!0,value:d,writable:!0}):o[a]=d}function lc(o,a){for(var d=-1,h=a.length,g=L(h),_=o==null;++d<h;)g[d]=_?n:Zc(o,a[d]);return g}function $r(o,a,d){return o===o&&(d!==n&&(o=o<=d?o:d),a!==n&&(o=o>=a?o:a)),o}function Xt(o,a,d,h,g,_){var x,E=a&v,V=a&k,H=a&S;if(d&&(x=g?d(o,h,g,_):d(o)),x!==n)return x;if(!Je(o))return o;var j=ke(o);if(j){if(x=lP(o),!E)return Pt(o,x)}else{var q=_t(o),te=q==Bs||q==lp;if(br(o))return Ph(o,E);if(q==On||q==hi||te&&!g){if(x=V||te?{}:Kh(o),!E)return V?JA(o,CA(x,o)):YA(o,sh(x,o))}else{if(!Ue[q])return g?o:{};x=cP(o,q,E)}}_||(_=new Cn);var le=_.get(o);if(le)return le;_.set(o,x),Sf(o)?o.forEach(function(me){x.add(Xt(me,a,d,me,o,_))}):xf(o)&&o.forEach(function(me,Ne){x.set(Ne,Xt(me,a,d,Ne,o,_))});var fe=H?V?Bc:Tc:V?Nt:ut,Pe=j?n:fe(o);return Kt(Pe||o,function(me,Ne){Pe&&(Ne=me,me=o[Ne]),Oo(x,Ne,Xt(me,a,d,Ne,o,_))}),x}function wA(o){var a=ut(o);return function(d){return ah(d,o,a)}}function ah(o,a,d){var h=d.length;if(o==null)return!h;for(o=$e(o);h--;){var g=d[h],_=a[g],x=o[g];if(x===n&&!(g in o)||!_(x))return!1}return!0}function lh(o,a,d){if(typeof o!="function")throw new Yt(c);return Ho(function(){o.apply(n,d)},a)}function Go(o,a,d,h){var g=-1,_=Ds,x=!0,E=o.length,V=[],H=a.length;if(!E)return V;d&&(a=qe(a,Zt(d))),h?(_=ql,x=!1):a.length>=s&&(_=Do,x=!1,a=new Zr(a));e:for(;++g<E;){var j=o[g],q=d==null?j:d(j);if(j=h||j!==0?j:0,x&&q===q){for(var te=H;te--;)if(a[te]===q)continue e;V.push(j)}else _(a,q,h)||V.push(j)}return V}var vr=Rh(An),ch=Rh(dc,!0);function bA(o,a){var d=!0;return vr(o,function(h,g,_){return d=!!a(h,g,_),d}),d}function Js(o,a,d){for(var h=-1,g=o.length;++h<g;){var _=o[h],x=a(_);if(x!=null&&(E===n?x===x&&!Ut(x):d(x,E)))var E=x,V=_}return V}function xA(o,a,d,h){var g=o.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:Tf(h);d<h;)o[d++]=a;return o}function dh(o,a){var d=[];return vr(o,function(h,g,_){a(h,g,_)&&d.push(h)}),d}function ht(o,a,d,h,g){var _=-1,x=o.length;for(d||(d=uP),g||(g=[]);++_<x;){var E=o[_];a>0&&d(E)?a>1?ht(E,a-1,d,h,g):mr(g,E):h||(g[g.length]=E)}return g}var cc=Mh(),uh=Mh(!0);function An(o,a){return o&&cc(o,a,ut)}function dc(o,a){return o&&uh(o,a,ut)}function Xs(o,a){return fr(a,function(d){return Hn(o[d])})}function Ur(o,a){a=Cr(a,o);for(var d=0,h=a.length;o!=null&&d<h;)o=o[Vn(a[d++])];return d&&d==h?o:n}function ph(o,a,d){var h=a(o);return ke(o)?h:mr(h,d(o))}function kt(o){return o==null?o===n?XE:YE:Gr&&Gr in $e(o)?oP(o):vP(o)}function uc(o,a){return o>a}function kA(o,a){return o!=null&&Ze.call(o,a)}function SA(o,a){return o!=null&&a in $e(o)}function EA(o,a,d){return o>=vt(a,d)&&o<at(a,d)}function pc(o,a,d){for(var h=d?ql:Ds,g=o[0].length,_=o.length,x=_,E=L(_),V=1/0,H=[];x--;){var j=o[x];x&&a&&(j=qe(j,Zt(a))),V=vt(j.length,V),E[x]=!d&&(a||g>=120&&j.length>=120)?new Zr(x&&j):n}j=o[0];var q=-1,te=E[0];e:for(;++q<g&&H.length<V;){var le=j[q],fe=a?a(le):le;if(le=d||le!==0?le:0,!(te?Do(te,fe):h(H,fe,d))){for(x=_;--x;){var Pe=E[x];if(!(Pe?Do(Pe,fe):h(o[x],fe,d)))continue e}te&&te.push(fe),H.push(le)}}return H}function TA(o,a,d,h){return An(o,function(g,_,x){a(h,d(g),_,x)}),h}function zo(o,a,d){a=Cr(a,o),o=Qh(o,a);var h=o==null?o:o[Vn(en(a))];return h==null?n:zt(h,o,d)}function hh(o){return Qe(o)&&kt(o)==hi}function BA(o){return Qe(o)&&kt(o)==No}function AA(o){return Qe(o)&&kt(o)==To}function Zo(o,a,d,h,g){return o===a?!0:o==null||a==null||!Qe(o)&&!Qe(a)?o!==o&&a!==a:PA(o,a,d,h,Zo,g)}function PA(o,a,d,h,g,_){var x=ke(o),E=ke(a),V=x?Es:_t(o),H=E?Es:_t(a);V=V==hi?On:V,H=H==hi?On:H;var j=V==On,q=H==On,te=V==H;if(te&&br(o)){if(!br(a))return!1;x=!0,j=!1}if(te&&!j)return _||(_=new Cn),x||Ti(o)?Hh(o,a,d,h,g,_):rP(o,a,V,d,h,g,_);if(!(d&F)){var le=j&&Ze.call(o,"__wrapped__"),fe=q&&Ze.call(a,"__wrapped__");if(le||fe){var Pe=le?o.value():o,me=fe?a.value():a;return _||(_=new Cn),g(Pe,me,d,h,_)}}return te?(_||(_=new Cn),iP(o,a,d,h,g,_)):!1}function VA(o){return Qe(o)&&_t(o)==yn}function hc(o,a,d,h){var g=d.length,_=g,x=!h;if(o==null)return!_;for(o=$e(o);g--;){var E=d[g];if(x&&E[2]?E[1]!==o[E[0]]:!(E[0]in o))return!1}for(;++g<_;){E=d[g];var V=E[0],H=o[V],j=E[1];if(x&&E[2]){if(H===n&&!(V in o))return!1}else{var q=new Cn;if(h)var te=h(H,j,V,o,a,q);if(!(te===n?Zo(j,H,F|T,h,q):te))return!1}}return!0}function fh(o){if(!Je(o)||hP(o))return!1;var a=Hn(o)?VB:wT;return a.test(Hr(o))}function NA(o){return Qe(o)&&kt(o)==Ao}function DA(o){return Qe(o)&&_t(o)==vn}function FA(o){return Qe(o)&&ma(o.length)&&!!He[kt(o)]}function mh(o){return typeof o=="function"?o:o==null?Dt:typeof o=="object"?ke(o)?vh(o[0],o[1]):yh(o):Lf(o)}function fc(o){if(!Wo(o))return IB(o);var a=[];for(var d in $e(o))Ze.call(o,d)&&d!="constructor"&&a.push(d);return a}function RA(o){if(!Je(o))return yP(o);var a=Wo(o),d=[];for(var h in o)h=="constructor"&&(a||!Ze.call(o,h))||d.push(h);return d}function mc(o,a){return o<a}function gh(o,a){var d=-1,h=Vt(o)?L(o.length):[];return vr(o,function(g,_,x){h[++d]=a(g,_,x)}),h}function yh(o){var a=Pc(o);return a.length==1&&a[0][2]?Jh(a[0][0],a[0][1]):function(d){return d===o||hc(d,o,a)}}function vh(o,a){return Nc(o)&&Yh(a)?Jh(Vn(o),a):function(d){var h=Zc(d,o);return h===n&&h===a?$c(d,o):Zo(a,h,F|T)}}function Qs(o,a,d,h,g){o!==a&&cc(a,function(_,x){if(g||(g=new Cn),Je(_))MA(o,a,x,d,Qs,h,g);else{var E=h?h(Fc(o,x),_,x+"",o,a,g):n;E===n&&(E=_),ac(o,x,E)}},Nt)}function MA(o,a,d,h,g,_,x){var E=Fc(o,d),V=Fc(a,d),H=x.get(V);if(H){ac(o,d,H);return}var j=_?_(E,V,d+"",o,a,x):n,q=j===n;if(q){var te=ke(V),le=!te&&br(V),fe=!te&&!le&&Ti(V);j=V,te||le||fe?ke(E)?j=E:tt(E)?j=Pt(E):le?(q=!1,j=Ph(V,!0)):fe?(q=!1,j=Vh(V,!0)):j=[]:jo(V)||jr(V)?(j=E,jr(E)?j=Bf(E):(!Je(E)||Hn(E))&&(j=Kh(V))):q=!1}q&&(x.set(V,j),g(j,V,h,_,x),x.delete(V)),ac(o,d,j)}function _h(o,a){var d=o.length;if(d)return a+=a<0?d:0,Wn(a,d)?o[a]:n}function Ch(o,a,d){a.length?a=qe(a,function(_){return ke(_)?function(x){return Ur(x,_.length===1?_[0]:_)}:_}):a=[Dt];var h=-1;a=qe(a,Zt(pe()));var g=gh(o,function(_,x,E){var V=qe(a,function(H){return H(_)});return{criteria:V,index:++h,value:_}});return cB(g,function(_,x){return KA(_,x,d)})}function IA(o,a){return wh(o,a,function(d,h){return $c(o,h)})}function wh(o,a,d){for(var h=-1,g=a.length,_={};++h<g;){var x=a[h],E=Ur(o,x);d(E,x)&&$o(_,Cr(x,o),E)}return _}function LA(o){return function(a){return Ur(a,o)}}function gc(o,a,d,h){var g=h?lB:gi,_=-1,x=a.length,E=o;for(o===a&&(a=Pt(a)),d&&(E=qe(o,Zt(d)));++_<x;)for(var V=0,H=a[_],j=d?d(H):H;(V=g(E,j,V,h))>-1;)E!==o&&$s.call(E,V,1),$s.call(o,V,1);return o}function bh(o,a){for(var d=o?a.length:0,h=d-1;d--;){var g=a[d];if(d==h||g!==_){var _=g;Wn(g)?$s.call(o,g,1):Cc(o,g)}}return o}function yc(o,a){return o+Hs(nh()*(a-o+1))}function OA(o,a,d,h){for(var g=-1,_=at(Ws((a-o)/(d||1)),0),x=L(_);_--;)x[h?_:++g]=o,o+=d;return x}function vc(o,a){var d="";if(!o||a<1||a>xe)return d;do a%2&&(d+=o),a=Hs(a/2),a&&(o+=o);while(a);return d}function Ve(o,a){return Rc(Xh(o,a,Dt),o+"")}function GA(o){return oh(Bi(o))}function zA(o,a){var d=Bi(o);return ca(d,$r(a,0,d.length))}function $o(o,a,d,h){if(!Je(o))return o;a=Cr(a,o);for(var g=-1,_=a.length,x=_-1,E=o;E!=null&&++g<_;){var V=Vn(a[g]),H=d;if(V==="__proto__"||V==="constructor"||V==="prototype")return o;if(g!=x){var j=E[V];H=h?h(j,V,E):n,H===n&&(H=Je(j)?j:Wn(a[g+1])?[]:{})}Oo(E,V,H),E=E[V]}return o}var xh=js?function(o,a){return js.set(o,a),o}:Dt,ZA=Us?function(o,a){return Us(o,"toString",{configurable:!0,enumerable:!1,value:Wc(a),writable:!0})}:Dt;function $A(o){return ca(Bi(o))}function Qt(o,a,d){var h=-1,g=o.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 _=L(g);++h<g;)_[h]=o[h+a];return _}function UA(o,a){var d;return vr(o,function(h,g,_){return d=a(h,g,_),!d}),!!d}function ea(o,a,d){var h=0,g=o==null?h:o.length;if(typeof a=="number"&&a===a&&g<=Lr){for(;h<g;){var _=h+g>>>1,x=o[_];x!==null&&!Ut(x)&&(d?x<=a:x<a)?h=_+1:g=_}return g}return _c(o,a,Dt,d)}function _c(o,a,d,h){var g=0,_=o==null?0:o.length;if(_===0)return 0;a=d(a);for(var x=a!==a,E=a===null,V=Ut(a),H=a===n;g<_;){var j=Hs((g+_)/2),q=d(o[j]),te=q!==n,le=q===null,fe=q===q,Pe=Ut(q);if(x)var me=h||fe;else H?me=fe&&(h||te):E?me=fe&&te&&(h||!le):V?me=fe&&te&&!le&&(h||!Pe):le||Pe?me=!1:me=h?q<=a:q<a;me?g=j+1:_=j}return vt(_,ko)}function kh(o,a){for(var d=-1,h=o.length,g=0,_=[];++d<h;){var x=o[d],E=a?a(x):x;if(!d||!wn(E,V)){var V=E;_[g++]=x===0?0:x}}return _}function Sh(o){return typeof o=="number"?o:Ut(o)?jt:+o}function $t(o){if(typeof o=="string")return o;if(ke(o))return qe(o,$t)+"";if(Ut(o))return rh?rh.call(o):"";var a=o+"";return a=="0"&&1/o==-ve?"-0":a}function _r(o,a,d){var h=-1,g=Ds,_=o.length,x=!0,E=[],V=E;if(d)x=!1,g=ql;else if(_>=s){var H=a?null:tP(o);if(H)return Rs(H);x=!1,g=Do,V=new Zr}else V=a?[]:E;e:for(;++h<_;){var j=o[h],q=a?a(j):j;if(j=d||j!==0?j:0,x&&q===q){for(var te=V.length;te--;)if(V[te]===q)continue e;a&&V.push(q),E.push(j)}else g(V,q,d)||(V!==E&&V.push(q),E.push(j))}return E}function Cc(o,a){return a=Cr(a,o),o=Qh(o,a),o==null||delete o[Vn(en(a))]}function Eh(o,a,d,h){return $o(o,a,d(Ur(o,a)),h)}function ta(o,a,d,h){for(var g=o.length,_=h?g:-1;(h?_--:++_<g)&&a(o[_],_,o););return d?Qt(o,h?0:_,h?_+1:g):Qt(o,h?_+1:0,h?g:_)}function Th(o,a){var d=o;return d instanceof De&&(d=d.value()),Kl(a,function(h,g){return g.func.apply(g.thisArg,mr([h],g.args))},d)}function wc(o,a,d){var h=o.length;if(h<2)return h?_r(o[0]):[];for(var g=-1,_=L(h);++g<h;)for(var x=o[g],E=-1;++E<h;)E!=g&&(_[g]=Go(_[g]||x,o[E],a,d));return _r(ht(_,1),a,d)}function Bh(o,a,d){for(var h=-1,g=o.length,_=a.length,x={};++h<g;){var E=h<_?a[h]:n;d(x,o[h],E)}return x}function bc(o){return tt(o)?o:[]}function xc(o){return typeof o=="function"?o:Dt}function Cr(o,a){return ke(o)?o:Nc(o,a)?[o]:rf(ze(o))}var WA=Ve;function wr(o,a,d){var h=o.length;return d=d===n?h:d,!a&&d>=h?o:Qt(o,a,d)}var Ah=NB||function(o){return pt.clearTimeout(o)};function Ph(o,a){if(a)return o.slice();var d=o.length,h=Jp?Jp(d):new o.constructor(d);return o.copy(h),h}function kc(o){var a=new o.constructor(o.byteLength);return new zs(a).set(new zs(o)),a}function HA(o,a){var d=a?kc(o.buffer):o.buffer;return new o.constructor(d,o.byteOffset,o.byteLength)}function jA(o){var a=new o.constructor(o.source,hp.exec(o));return a.lastIndex=o.lastIndex,a}function qA(o){return Lo?$e(Lo.call(o)):{}}function Vh(o,a){var d=a?kc(o.buffer):o.buffer;return new o.constructor(d,o.byteOffset,o.length)}function Nh(o,a){if(o!==a){var d=o!==n,h=o===null,g=o===o,_=Ut(o),x=a!==n,E=a===null,V=a===a,H=Ut(a);if(!E&&!H&&!_&&o>a||_&&x&&V&&!E&&!H||h&&x&&V||!d&&V||!g)return 1;if(!h&&!_&&!H&&o<a||H&&d&&g&&!h&&!_||E&&d&&g||!x&&g||!V)return-1}return 0}function KA(o,a,d){for(var h=-1,g=o.criteria,_=a.criteria,x=g.length,E=d.length;++h<x;){var V=Nh(g[h],_[h]);if(V){if(h>=E)return V;var H=d[h];return V*(H=="desc"?-1:1)}}return o.index-a.index}function Dh(o,a,d,h){for(var g=-1,_=o.length,x=d.length,E=-1,V=a.length,H=at(_-x,0),j=L(V+H),q=!h;++E<V;)j[E]=a[E];for(;++g<x;)(q||g<_)&&(j[d[g]]=o[g]);for(;H--;)j[E++]=o[g++];return j}function Fh(o,a,d,h){for(var g=-1,_=o.length,x=-1,E=d.length,V=-1,H=a.length,j=at(_-E,0),q=L(j+H),te=!h;++g<j;)q[g]=o[g];for(var le=g;++V<H;)q[le+V]=a[V];for(;++x<E;)(te||g<_)&&(q[le+d[x]]=o[g++]);return q}function Pt(o,a){var d=-1,h=o.length;for(a||(a=L(h));++d<h;)a[d]=o[d];return a}function Pn(o,a,d,h){var g=!d;d||(d={});for(var _=-1,x=a.length;++_<x;){var E=a[_],V=h?h(d[E],o[E],E,d,o):n;V===n&&(V=o[E]),g?Zn(d,E,V):Oo(d,E,V)}return d}function YA(o,a){return Pn(o,Vc(o),a)}function JA(o,a){return Pn(o,jh(o),a)}function na(o,a){return function(d,h){var g=ke(d)?nB:_A,_=a?a():{};return g(d,o,pe(h,2),_)}}function ki(o){return Ve(function(a,d){var h=-1,g=d.length,_=g>1?d[g-1]:n,x=g>2?d[2]:n;for(_=o.length>3&&typeof _=="function"?(g--,_):n,x&&St(d[0],d[1],x)&&(_=g<3?n:_,g=1),a=$e(a);++h<g;){var E=d[h];E&&o(a,E,h,_)}return a})}function Rh(o,a){return function(d,h){if(d==null)return d;if(!Vt(d))return o(d,h);for(var g=d.length,_=a?g:-1,x=$e(d);(a?_--:++_<g)&&h(x[_],_,x)!==!1;);return d}}function Mh(o){return function(a,d,h){for(var g=-1,_=$e(a),x=h(a),E=x.length;E--;){var V=x[o?E:++g];if(d(_[V],V,_)===!1)break}return a}}function XA(o,a,d){var h=a&N,g=Uo(o);function _(){var x=this&&this!==pt&&this instanceof _?g:o;return x.apply(h?d:this,arguments)}return _}function Ih(o){return function(a){a=ze(a);var d=yi(a)?_n(a):n,h=d?d[0]:a.charAt(0),g=d?wr(d,1).join(""):a.slice(1);return h[o]()+g}}function Si(o){return function(a){return Kl(Mf(Rf(a).replace(ZT,"")),o,"")}}function Uo(o){return function(){var a=arguments;switch(a.length){case 0:return new o;case 1:return new o(a[0]);case 2:return new o(a[0],a[1]);case 3:return new o(a[0],a[1],a[2]);case 4:return new o(a[0],a[1],a[2],a[3]);case 5:return new o(a[0],a[1],a[2],a[3],a[4]);case 6:return new o(a[0],a[1],a[2],a[3],a[4],a[5]);case 7:return new o(a[0],a[1],a[2],a[3],a[4],a[5],a[6])}var d=xi(o.prototype),h=o.apply(d,a);return Je(h)?h:d}}function QA(o,a,d){var h=Uo(o);function g(){for(var _=arguments.length,x=L(_),E=_,V=Ei(g);E--;)x[E]=arguments[E];var H=_<3&&x[0]!==V&&x[_-1]!==V?[]:gr(x,V);if(_-=H.length,_<d)return Zh(o,a,ra,g.placeholder,n,x,H,n,n,d-_);var j=this&&this!==pt&&this instanceof g?h:o;return zt(j,this,x)}return g}function Lh(o){return function(a,d,h){var g=$e(a);if(!Vt(a)){var _=pe(d,3);a=ut(a),d=function(E){return _(g[E],E,g)}}var x=o(a,d,h);return x>-1?g[_?a[x]:x]:n}}function Oh(o){return Un(function(a){var d=a.length,h=d,g=Jt.prototype.thru;for(o&&a.reverse();h--;){var _=a[h];if(typeof _!="function")throw new Yt(c);if(g&&!x&&aa(_)=="wrapper")var x=new Jt([],!0)}for(h=x?h:d;++h<d;){_=a[h];var E=aa(_),V=E=="wrapper"?Ac(_):n;V&&Dc(V[0])&&V[1]==(z|Q|R|P)&&!V[4].length&&V[9]==1?x=x[aa(V[0])].apply(x,V[3]):x=_.length==1&&Dc(_)?x[E]():x.thru(_)}return function(){var H=arguments,j=H[0];if(x&&H.length==1&&ke(j))return x.plant(j).value();for(var q=0,te=d?a[q].apply(this,H):j;++q<d;)te=a[q].call(this,te);return te}})}function ra(o,a,d,h,g,_,x,E,V,H){var j=a&z,q=a&N,te=a&C,le=a&(Q|M),fe=a&Z,Pe=te?n:Uo(o);function me(){for(var Ne=arguments.length,Fe=L(Ne),Wt=Ne;Wt--;)Fe[Wt]=arguments[Wt];if(le)var Et=Ei(me),Ht=uB(Fe,Et);if(h&&(Fe=Dh(Fe,h,g,le)),_&&(Fe=Fh(Fe,_,x,le)),Ne-=Ht,le&&Ne<H){var nt=gr(Fe,Et);return Zh(o,a,ra,me.placeholder,d,Fe,nt,E,V,H-Ne)}var bn=q?d:this,qn=te?bn[o]:o;return Ne=Fe.length,E?Fe=_P(Fe,E):fe&&Ne>1&&Fe.reverse(),j&&V<Ne&&(Fe.length=V),this&&this!==pt&&this instanceof me&&(qn=Pe||Uo(qn)),qn.apply(bn,Fe)}return me}function Gh(o,a){return function(d,h){return TA(d,o,a(h),{})}}function ia(o,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=$t(d),h=$t(h)):(d=Sh(d),h=Sh(h)),g=o(d,h)}return g}}function Sc(o){return Un(function(a){return a=qe(a,Zt(pe())),Ve(function(d){var h=this;return o(a,function(g){return zt(g,h,d)})})})}function oa(o,a){a=a===n?" ":$t(a);var d=a.length;if(d<2)return d?vc(a,o):a;var h=vc(a,Ws(o/vi(a)));return yi(a)?wr(_n(h),0,o).join(""):h.slice(0,o)}function eP(o,a,d,h){var g=a&N,_=Uo(o);function x(){for(var E=-1,V=arguments.length,H=-1,j=h.length,q=L(j+V),te=this&&this!==pt&&this instanceof x?_:o;++H<j;)q[H]=h[H];for(;V--;)q[H++]=arguments[++E];return zt(te,g?d:this,q)}return x}function zh(o){return function(a,d,h){return h&&typeof h!="number"&&St(a,d,h)&&(d=h=n),a=jn(a),d===n?(d=a,a=0):d=jn(d),h=h===n?a<d?1:-1:jn(h),OA(a,d,h,o)}}function sa(o){return function(a,d){return typeof a=="string"&&typeof d=="string"||(a=tn(a),d=tn(d)),o(a,d)}}function Zh(o,a,d,h,g,_,x,E,V,H){var j=a&Q,q=j?x:n,te=j?n:x,le=j?_:n,fe=j?n:_;a|=j?R:U,a&=~(j?U:R),a&I||(a&=~(N|C));var Pe=[o,a,g,le,q,fe,te,E,V,H],me=d.apply(n,Pe);return Dc(o)&&ef(me,Pe),me.placeholder=h,tf(me,o,a)}function Ec(o){var a=st[o];return function(d,h){if(d=tn(d),h=h==null?0:vt(Te(h),292),h&&th(d)){var g=(ze(d)+"e").split("e"),_=a(g[0]+"e"+(+g[1]+h));return g=(ze(_)+"e").split("e"),+(g[0]+"e"+(+g[1]-h))}return a(d)}}var tP=wi&&1/Rs(new wi([,-0]))[1]==ve?function(o){return new wi(o)}:qc;function $h(o){return function(a){var d=_t(a);return d==yn?nc(a):d==vn?vB(a):dB(a,o(a))}}function $n(o,a,d,h,g,_,x,E){var V=a&C;if(!V&&typeof o!="function")throw new Yt(c);var H=h?h.length:0;if(H||(a&=~(R|U),h=g=n),x=x===n?x:at(Te(x),0),E=E===n?E:Te(E),H-=g?g.length:0,a&U){var j=h,q=g;h=g=n}var te=V?n:Ac(o),le=[o,a,d,h,g,j,q,_,x,E];if(te&&gP(le,te),o=le[0],a=le[1],d=le[2],h=le[3],g=le[4],E=le[9]=le[9]===n?V?0:o.length:at(le[9]-H,0),!E&&a&(Q|M)&&(a&=~(Q|M)),!a||a==N)var fe=XA(o,a,d);else a==Q||a==M?fe=QA(o,a,E):(a==R||a==(N|R))&&!g.length?fe=eP(o,a,d,h):fe=ra.apply(n,le);var Pe=te?xh:ef;return tf(Pe(fe,le),o,a)}function Uh(o,a,d,h){return o===n||wn(o,Ci[d])&&!Ze.call(h,d)?a:o}function Wh(o,a,d,h,g,_){return Je(o)&&Je(a)&&(_.set(a,o),Qs(o,a,n,Wh,_),_.delete(a)),o}function nP(o){return jo(o)?n:o}function Hh(o,a,d,h,g,_){var x=d&F,E=o.length,V=a.length;if(E!=V&&!(x&&V>E))return!1;var H=_.get(o),j=_.get(a);if(H&&j)return H==a&&j==o;var q=-1,te=!0,le=d&T?new Zr:n;for(_.set(o,a),_.set(a,o);++q<E;){var fe=o[q],Pe=a[q];if(h)var me=x?h(Pe,fe,q,a,o,_):h(fe,Pe,q,o,a,_);if(me!==n){if(me)continue;te=!1;break}if(le){if(!Yl(a,function(Ne,Fe){if(!Do(le,Fe)&&(fe===Ne||g(fe,Ne,d,h,_)))return le.push(Fe)})){te=!1;break}}else if(!(fe===Pe||g(fe,Pe,d,h,_))){te=!1;break}}return _.delete(o),_.delete(a),te}function rP(o,a,d,h,g,_,x){switch(d){case fi:if(o.byteLength!=a.byteLength||o.byteOffset!=a.byteOffset)return!1;o=o.buffer,a=a.buffer;case No:return!(o.byteLength!=a.byteLength||!_(new zs(o),new zs(a)));case Eo:case To:case Bo:return wn(+o,+a);case Ts:return o.name==a.name&&o.message==a.message;case Ao:case Po:return o==a+"";case yn:var E=nc;case vn:var V=h&F;if(E||(E=Rs),o.size!=a.size&&!V)return!1;var H=x.get(o);if(H)return H==a;h|=T,x.set(o,a);var j=Hh(E(o),E(a),h,g,_,x);return x.delete(o),j;case As:if(Lo)return Lo.call(o)==Lo.call(a)}return!1}function iP(o,a,d,h,g,_){var x=d&F,E=Tc(o),V=E.length,H=Tc(a),j=H.length;if(V!=j&&!x)return!1;for(var q=V;q--;){var te=E[q];if(!(x?te in a:Ze.call(a,te)))return!1}var le=_.get(o),fe=_.get(a);if(le&&fe)return le==a&&fe==o;var Pe=!0;_.set(o,a),_.set(a,o);for(var me=x;++q<V;){te=E[q];var Ne=o[te],Fe=a[te];if(h)var Wt=x?h(Fe,Ne,te,a,o,_):h(Ne,Fe,te,o,a,_);if(!(Wt===n?Ne===Fe||g(Ne,Fe,d,h,_):Wt)){Pe=!1;break}me||(me=te=="constructor")}if(Pe&&!me){var Et=o.constructor,Ht=a.constructor;Et!=Ht&&"constructor"in o&&"constructor"in a&&!(typeof Et=="function"&&Et instanceof Et&&typeof Ht=="function"&&Ht instanceof Ht)&&(Pe=!1)}return _.delete(o),_.delete(a),Pe}function Un(o){return Rc(Xh(o,n,lf),o+"")}function Tc(o){return ph(o,ut,Vc)}function Bc(o){return ph(o,Nt,jh)}var Ac=js?function(o){return js.get(o)}:qc;function aa(o){for(var a=o.name+"",d=bi[a],h=Ze.call(bi,a)?d.length:0;h--;){var g=d[h],_=g.func;if(_==null||_==o)return g.name}return a}function Ei(o){var a=Ze.call(y,"placeholder")?y:o;return a.placeholder}function pe(){var o=y.iteratee||Hc;return o=o===Hc?mh:o,arguments.length?o(arguments[0],arguments[1]):o}function la(o,a){var d=o.__data__;return pP(a)?d[typeof a=="string"?"string":"hash"]:d.map}function Pc(o){for(var a=ut(o),d=a.length;d--;){var h=a[d],g=o[h];a[d]=[h,g,Yh(g)]}return a}function Wr(o,a){var d=mB(o,a);return fh(d)?d:n}function oP(o){var a=Ze.call(o,Gr),d=o[Gr];try{o[Gr]=n;var h=!0}catch{}var g=Os.call(o);return h&&(a?o[Gr]=d:delete o[Gr]),g}var Vc=ic?function(o){return o==null?[]:(o=$e(o),fr(ic(o),function(a){return Qp.call(o,a)}))}:Kc,jh=ic?function(o){for(var a=[];o;)mr(a,Vc(o)),o=Zs(o);return a}:Kc,_t=kt;(oc&&_t(new oc(new ArrayBuffer(1)))!=fi||Ro&&_t(new Ro)!=yn||sc&&_t(sc.resolve())!=cp||wi&&_t(new wi)!=vn||Mo&&_t(new Mo)!=Vo)&&(_t=function(o){var a=kt(o),d=a==On?o.constructor:n,h=d?Hr(d):"";if(h)switch(h){case zB:return fi;case ZB:return yn;case $B:return cp;case UB:return vn;case WB:return Vo}return a});function sP(o,a,d){for(var h=-1,g=d.length;++h<g;){var _=d[h],x=_.size;switch(_.type){case"drop":o+=x;break;case"dropRight":a-=x;break;case"take":a=vt(a,o+x);break;case"takeRight":o=at(o,a-x);break}}return{start:o,end:a}}function aP(o){var a=o.match(hT);return a?a[1].split(fT):[]}function qh(o,a,d){a=Cr(a,o);for(var h=-1,g=a.length,_=!1;++h<g;){var x=Vn(a[h]);if(!(_=o!=null&&d(o,x)))break;o=o[x]}return _||++h!=g?_:(g=o==null?0:o.length,!!g&&ma(g)&&Wn(x,g)&&(ke(o)||jr(o)))}function lP(o){var a=o.length,d=new o.constructor(a);return a&&typeof o[0]=="string"&&Ze.call(o,"index")&&(d.index=o.index,d.input=o.input),d}function Kh(o){return typeof o.constructor=="function"&&!Wo(o)?xi(Zs(o)):{}}function cP(o,a,d){var h=o.constructor;switch(a){case No:return kc(o);case Eo:case To:return new h(+o);case fi:return HA(o,d);case Pl:case Vl:case Nl:case Dl:case Fl:case Rl:case Ml:case Il:case Ll:return Vh(o,d);case yn:return new h;case Bo:case Po:return new h(o);case Ao:return jA(o);case vn:return new h;case As:return qA(o)}}function dP(o,a){var d=a.length;if(!d)return o;var h=d-1;return a[h]=(d>1?"& ":"")+a[h],a=a.join(d>2?", ":" "),o.replace(pT,`{
71
71
  /* [wrapped with `+a+`] */
72
- `)}function dP(o){return ke(o)||jr(o)||!!(eh&&o&&o[eh])}function Wn(o,a){var c=typeof o;return a=a??xe,!!a&&(c=="number"||c!="symbol"&&bT.test(o))&&o>-1&&o%1==0&&o<a}function St(o,a,c){if(!Je(c))return!1;var h=typeof a;return(h=="number"?Vt(c)&&Wn(a,c.length):h=="string"&&a in c)?wn(c[a],o):!1}function Nc(o,a){if(ke(o))return!1;var c=typeof o;return c=="number"||c=="symbol"||c=="boolean"||o==null||Ut(o)?!0:aT.test(o)||!sT.test(o)||a!=null&&o in $e(a)}function uP(o){var a=typeof o;return a=="string"||a=="number"||a=="symbol"||a=="boolean"?o!=="__proto__":o===null}function Dc(o){var a=aa(o),c=y[a];if(typeof c!="function"||!(a in De.prototype))return!1;if(o===c)return!0;var h=Ac(c);return!!h&&o===h[0]}function pP(o){return!!Yp&&Yp in o}var hP=Is?Hn:Yc;function Wo(o){var a=o&&o.constructor,c=typeof a=="function"&&a.prototype||Ci;return o===c}function Yh(o){return o===o&&!Je(o)}function Jh(o,a){return function(c){return c==null?!1:c[o]===a&&(a!==n||o in $e(c))}}function fP(o){var a=ha(o,function(h){return c.size===f&&c.clear(),h}),c=a.cache;return a}function mP(o,a){var c=o[1],h=a[1],g=c|h,_=g<(A|k|I),b=h==I&&c==$||h==I&&c==N&&o[7].length<=a[8]||h==(I|N)&&a[7].length<=a[8]&&c==$;if(!(_||b))return o;h&A&&(o[2]=a[2],g|=c&A?0:D);var E=a[3];if(E){var V=o[3];o[3]=V?Dh(V,E,a[4]):E,o[4]=V?gr(o[3],m):a[4]}return E=a[5],E&&(V=o[5],o[5]=V?Fh(V,E,a[6]):E,o[6]=V?gr(o[5],m):a[6]),E=a[7],E&&(o[7]=E),h&I&&(o[8]=o[8]==null?a[8]:vt(o[8],a[8])),o[9]==null&&(o[9]=a[9]),o[0]=a[0],o[1]=g,o}function gP(o){var a=[];if(o!=null)for(var c in $e(o))a.push(c);return a}function yP(o){return Os.call(o)}function Xh(o,a,c){return a=at(a===n?o.length-1:a,0),function(){for(var h=arguments,g=-1,_=at(h.length-a,0),b=M(_);++g<_;)b[g]=h[a+g];g=-1;for(var E=M(a+1);++g<a;)E[g]=h[g];return E[a]=c(b),zt(o,this,E)}}function Qh(o,a){return a.length<2?o:Ur(o,Qt(a,0,-1))}function vP(o,a){for(var c=o.length,h=vt(a.length,c),g=Pt(o);h--;){var _=a[h];o[h]=Wn(_,c)?g[_]:n}return o}function Fc(o,a){if(!(a==="constructor"&&typeof o[a]=="function")&&a!="__proto__")return o[a]}var ef=nf(xh),Ho=DB||function(o,a){return pt.setTimeout(o,a)},Rc=nf(zA);function tf(o,a,c){var h=a+"";return Rc(o,cP(h,_P(sP(h),c)))}function nf(o){var a=0,c=0;return function(){var h=IB(),g=U-(h-c);if(c=h,g>0){if(++a>=le)return arguments[0]}else a=0;return o.apply(n,arguments)}}function ca(o,a){var c=-1,h=o.length,g=h-1;for(a=a===n?h:a;++c<a;){var _=yc(c,g),b=o[_];o[_]=o[c],o[c]=b}return o.length=a,o}var rf=fP(function(o){var a=[];return o.charCodeAt(0)===46&&a.push(""),o.replace(lT,function(c,h,g,_){a.push(g?_.replace(gT,"$1"):h||c)}),a});function Vn(o){if(typeof o=="string"||Ut(o))return o;var a=o+"";return a=="0"&&1/o==-ve?"-0":a}function Hr(o){if(o!=null){try{return Ls.call(o)}catch{}try{return o+""}catch{}}return""}function _P(o,a){return Kt(So,function(c){var h="_."+c[0];a&c[1]&&!Ds(o,h)&&o.push(h)}),o.sort()}function of(o){if(o instanceof De)return o.clone();var a=new Jt(o.__wrapped__,o.__chain__);return a.__actions__=Pt(o.__actions__),a.__index__=o.__index__,a.__values__=o.__values__,a}function CP(o,a,c){(c?St(o,a,c):a===n)?a=1:a=at(Te(a),0);var h=o==null?0:o.length;if(!h||a<1)return[];for(var g=0,_=0,b=M(Ws(h/a));g<h;)b[_++]=Qt(o,g,g+=a);return b}function wP(o){for(var a=-1,c=o==null?0:o.length,h=0,g=[];++a<c;){var _=o[a];_&&(g[h++]=_)}return g}function bP(){var o=arguments.length;if(!o)return[];for(var a=M(o-1),c=arguments[0],h=o;h--;)a[h-1]=arguments[h];return mr(ke(c)?Pt(c):[c],ht(a,1))}var xP=Ve(function(o,a){return tt(o)?Go(o,ht(a,1,tt,!0)):[]}),kP=Ve(function(o,a){var c=en(a);return tt(c)&&(c=n),tt(o)?Go(o,ht(a,1,tt,!0),pe(c,2)):[]}),SP=Ve(function(o,a){var c=en(a);return tt(c)&&(c=n),tt(o)?Go(o,ht(a,1,tt,!0),n,c):[]});function EP(o,a,c){var h=o==null?0:o.length;return h?(a=c||a===n?1:Te(a),Qt(o,a<0?0:a,h)):[]}function TP(o,a,c){var h=o==null?0:o.length;return h?(a=c||a===n?1:Te(a),a=h-a,Qt(o,0,a<0?0:a)):[]}function BP(o,a){return o&&o.length?ta(o,pe(a,3),!0,!0):[]}function AP(o,a){return o&&o.length?ta(o,pe(a,3),!0):[]}function PP(o,a,c,h){var g=o==null?0:o.length;return g?(c&&typeof c!="number"&&St(o,a,c)&&(c=0,h=g),bA(o,a,c,h)):[]}function sf(o,a,c){var h=o==null?0:o.length;if(!h)return-1;var g=c==null?0:Te(c);return g<0&&(g=at(h+g,0)),Fs(o,pe(a,3),g)}function af(o,a,c){var h=o==null?0:o.length;if(!h)return-1;var g=h-1;return c!==n&&(g=Te(c),g=c<0?at(h+g,0):vt(g,h-1)),Fs(o,pe(a,3),g,!0)}function lf(o){var a=o==null?0:o.length;return a?ht(o,1):[]}function VP(o){var a=o==null?0:o.length;return a?ht(o,ve):[]}function NP(o,a){var c=o==null?0:o.length;return c?(a=a===n?1:Te(a),ht(o,a)):[]}function DP(o){for(var a=-1,c=o==null?0:o.length,h={};++a<c;){var g=o[a];h[g[0]]=g[1]}return h}function cf(o){return o&&o.length?o[0]:n}function FP(o,a,c){var h=o==null?0:o.length;if(!h)return-1;var g=c==null?0:Te(c);return g<0&&(g=at(h+g,0)),gi(o,a,g)}function RP(o){var a=o==null?0:o.length;return a?Qt(o,0,-1):[]}var MP=Ve(function(o){var a=qe(o,bc);return a.length&&a[0]===o[0]?pc(a):[]}),IP=Ve(function(o){var a=en(o),c=qe(o,bc);return a===en(c)?a=n:c.pop(),c.length&&c[0]===o[0]?pc(c,pe(a,2)):[]}),LP=Ve(function(o){var a=en(o),c=qe(o,bc);return a=typeof a=="function"?a:n,a&&c.pop(),c.length&&c[0]===o[0]?pc(c,n,a):[]});function OP(o,a){return o==null?"":RB.call(o,a)}function en(o){var a=o==null?0:o.length;return a?o[a-1]:n}function GP(o,a,c){var h=o==null?0:o.length;if(!h)return-1;var g=h;return c!==n&&(g=Te(c),g=g<0?at(h+g,0):vt(g,h-1)),a===a?_B(o,a,g):Fs(o,Zp,g,!0)}function zP(o,a){return o&&o.length?_h(o,Te(a)):n}var ZP=Ve(df);function df(o,a){return o&&o.length&&a&&a.length?gc(o,a):o}function $P(o,a,c){return o&&o.length&&a&&a.length?gc(o,a,pe(c,2)):o}function UP(o,a,c){return o&&o.length&&a&&a.length?gc(o,a,n,c):o}var WP=Un(function(o,a){var c=o==null?0:o.length,h=lc(o,a);return bh(o,qe(a,function(g){return Wn(g,c)?+g:g}).sort(Nh)),h});function HP(o,a){var c=[];if(!(o&&o.length))return c;var h=-1,g=[],_=o.length;for(a=pe(a,3);++h<_;){var b=o[h];a(b,h,o)&&(c.push(b),g.push(h))}return bh(o,g),c}function Mc(o){return o==null?o:OB.call(o)}function jP(o,a,c){var h=o==null?0:o.length;return h?(c&&typeof c!="number"&&St(o,a,c)?(a=0,c=h):(a=a==null?0:Te(a),c=c===n?h:Te(c)),Qt(o,a,c)):[]}function qP(o,a){return ea(o,a)}function KP(o,a,c){return _c(o,a,pe(c,2))}function YP(o,a){var c=o==null?0:o.length;if(c){var h=ea(o,a);if(h<c&&wn(o[h],a))return h}return-1}function JP(o,a){return ea(o,a,!0)}function XP(o,a,c){return _c(o,a,pe(c,2),!0)}function QP(o,a){var c=o==null?0:o.length;if(c){var h=ea(o,a,!0)-1;if(wn(o[h],a))return h}return-1}function eV(o){return o&&o.length?kh(o):[]}function tV(o,a){return o&&o.length?kh(o,pe(a,2)):[]}function nV(o){var a=o==null?0:o.length;return a?Qt(o,1,a):[]}function rV(o,a,c){return o&&o.length?(a=c||a===n?1:Te(a),Qt(o,0,a<0?0:a)):[]}function iV(o,a,c){var h=o==null?0:o.length;return h?(a=c||a===n?1:Te(a),a=h-a,Qt(o,a<0?0:a,h)):[]}function oV(o,a){return o&&o.length?ta(o,pe(a,3),!1,!0):[]}function sV(o,a){return o&&o.length?ta(o,pe(a,3)):[]}var aV=Ve(function(o){return _r(ht(o,1,tt,!0))}),lV=Ve(function(o){var a=en(o);return tt(a)&&(a=n),_r(ht(o,1,tt,!0),pe(a,2))}),cV=Ve(function(o){var a=en(o);return a=typeof a=="function"?a:n,_r(ht(o,1,tt,!0),n,a)});function dV(o){return o&&o.length?_r(o):[]}function uV(o,a){return o&&o.length?_r(o,pe(a,2)):[]}function pV(o,a){return a=typeof a=="function"?a:n,o&&o.length?_r(o,n,a):[]}function Ic(o){if(!(o&&o.length))return[];var a=0;return o=fr(o,function(c){if(tt(c))return a=at(c.length,a),!0}),ec(a,function(c){return qe(o,Jl(c))})}function uf(o,a){if(!(o&&o.length))return[];var c=Ic(o);return a==null?c:qe(c,function(h){return zt(a,n,h)})}var hV=Ve(function(o,a){return tt(o)?Go(o,a):[]}),fV=Ve(function(o){return wc(fr(o,tt))}),mV=Ve(function(o){var a=en(o);return tt(a)&&(a=n),wc(fr(o,tt),pe(a,2))}),gV=Ve(function(o){var a=en(o);return a=typeof a=="function"?a:n,wc(fr(o,tt),n,a)}),yV=Ve(Ic);function vV(o,a){return Bh(o||[],a||[],Oo)}function _V(o,a){return Bh(o||[],a||[],$o)}var CV=Ve(function(o){var a=o.length,c=a>1?o[a-1]:n;return c=typeof c=="function"?(o.pop(),c):n,uf(o,c)});function pf(o){var a=y(o);return a.__chain__=!0,a}function wV(o,a){return a(o),o}function da(o,a){return a(o)}var bV=Un(function(o){var a=o.length,c=a?o[0]:0,h=this.__wrapped__,g=function(_){return lc(_,o)};return a>1||this.__actions__.length||!(h instanceof De)||!Wn(c)?this.thru(g):(h=h.slice(c,+c+(a?1:0)),h.__actions__.push({func:da,args:[g],thisArg:n}),new Jt(h,this.__chain__).thru(function(_){return a&&!_.length&&_.push(n),_}))});function xV(){return pf(this)}function kV(){return new Jt(this.value(),this.__chain__)}function SV(){this.__values__===n&&(this.__values__=Ef(this.value()));var o=this.__index__>=this.__values__.length,a=o?n:this.__values__[this.__index__++];return{done:o,value:a}}function EV(){return this}function TV(o){for(var a,c=this;c instanceof Ks;){var h=of(c);h.__index__=0,h.__values__=n,a?g.__wrapped__=h:a=h;var g=h;c=c.__wrapped__}return g.__wrapped__=o,a}function BV(){var o=this.__wrapped__;if(o instanceof De){var a=o;return this.__actions__.length&&(a=new De(this)),a=a.reverse(),a.__actions__.push({func:da,args:[Mc],thisArg:n}),new Jt(a,this.__chain__)}return this.thru(Mc)}function AV(){return Th(this.__wrapped__,this.__actions__)}var PV=na(function(o,a,c){Ze.call(o,c)?++o[c]:Zn(o,c,1)});function VV(o,a,c){var h=ke(o)?Gp:wA;return c&&St(o,a,c)&&(a=n),h(o,pe(a,3))}function NV(o,a){var c=ke(o)?fr:dh;return c(o,pe(a,3))}var DV=Lh(sf),FV=Lh(af);function RV(o,a){return ht(ua(o,a),1)}function MV(o,a){return ht(ua(o,a),ve)}function IV(o,a,c){return c=c===n?1:Te(c),ht(ua(o,a),c)}function hf(o,a){var c=ke(o)?Kt:vr;return c(o,pe(a,3))}function ff(o,a){var c=ke(o)?nB:ch;return c(o,pe(a,3))}var LV=na(function(o,a,c){Ze.call(o,c)?o[c].push(a):Zn(o,c,[a])});function OV(o,a,c,h){o=Vt(o)?o:Bi(o),c=c&&!h?Te(c):0;var g=o.length;return c<0&&(c=at(g+c,0)),ga(o)?c<=g&&o.indexOf(a,c)>-1:!!g&&gi(o,a,c)>-1}var GV=Ve(function(o,a,c){var h=-1,g=typeof a=="function",_=Vt(o)?M(o.length):[];return vr(o,function(b){_[++h]=g?zt(a,b,c):zo(b,a,c)}),_}),zV=na(function(o,a,c){Zn(o,c,a)});function ua(o,a){var c=ke(o)?qe:gh;return c(o,pe(a,3))}function ZV(o,a,c,h){return o==null?[]:(ke(a)||(a=a==null?[]:[a]),c=h?n:c,ke(c)||(c=c==null?[]:[c]),Ch(o,a,c))}var $V=na(function(o,a,c){o[c?0:1].push(a)},function(){return[[],[]]});function UV(o,a,c){var h=ke(o)?Kl:Up,g=arguments.length<3;return h(o,pe(a,4),c,g,vr)}function WV(o,a,c){var h=ke(o)?rB:Up,g=arguments.length<3;return h(o,pe(a,4),c,g,ch)}function HV(o,a){var c=ke(o)?fr:dh;return c(o,fa(pe(a,3)))}function jV(o){var a=ke(o)?oh:OA;return a(o)}function qV(o,a,c){(c?St(o,a,c):a===n)?a=1:a=Te(a);var h=ke(o)?gA:GA;return h(o,a)}function KV(o){var a=ke(o)?yA:ZA;return a(o)}function YV(o){if(o==null)return 0;if(Vt(o))return ga(o)?vi(o):o.length;var a=_t(o);return a==yn||a==vn?o.size:fc(o).length}function JV(o,a,c){var h=ke(o)?Yl:$A;return c&&St(o,a,c)&&(a=n),h(o,pe(a,3))}var XV=Ve(function(o,a){if(o==null)return[];var c=a.length;return c>1&&St(o,a[0],a[1])?a=[]:c>2&&St(a[0],a[1],a[2])&&(a=[a[0]]),Ch(o,ht(a,1),[])}),pa=NB||function(){return pt.Date.now()};function QV(o,a){if(typeof a!="function")throw new Yt(d);return o=Te(o),function(){if(--o<1)return a.apply(this,arguments)}}function mf(o,a,c){return a=c?n:a,a=o&&a==null?o.length:a,$n(o,I,n,n,n,n,a)}function gf(o,a){var c;if(typeof a!="function")throw new Yt(d);return o=Te(o),function(){return--o>0&&(c=a.apply(this,arguments)),o<=1&&(a=n),c}}var Lc=Ve(function(o,a,c){var h=A;if(c.length){var g=gr(c,Ei(Lc));h|=L}return $n(o,h,a,c,g)}),yf=Ve(function(o,a,c){var h=A|k;if(c.length){var g=gr(c,Ei(yf));h|=L}return $n(a,h,o,c,g)});function vf(o,a,c){a=c?n:a;var h=$n(o,$,n,n,n,n,n,a);return h.placeholder=vf.placeholder,h}function _f(o,a,c){a=c?n:a;var h=$n(o,z,n,n,n,n,n,a);return h.placeholder=_f.placeholder,h}function Cf(o,a,c){var h,g,_,b,E,V,W=0,H=!1,q=!1,te=!0;if(typeof o!="function")throw new Yt(d);a=tn(a)||0,Je(c)&&(H=!!c.leading,q="maxWait"in c,_=q?at(tn(c.maxWait)||0,a):_,te="trailing"in c?!!c.trailing:te);function ce(nt){var bn=h,qn=g;return h=g=n,W=nt,b=o.apply(qn,bn),b}function fe(nt){return W=nt,E=Ho(Ne,a),H?ce(nt):b}function Pe(nt){var bn=nt-V,qn=nt-W,Of=a-bn;return q?vt(Of,_-qn):Of}function me(nt){var bn=nt-V,qn=nt-W;return V===n||bn>=a||bn<0||q&&qn>=_}function Ne(){var nt=pa();if(me(nt))return Fe(nt);E=Ho(Ne,Pe(nt))}function Fe(nt){return E=n,te&&h?ce(nt):(h=g=n,b)}function Wt(){E!==n&&Ah(E),W=0,h=V=g=E=n}function Et(){return E===n?b:Fe(pa())}function Ht(){var nt=pa(),bn=me(nt);if(h=arguments,g=this,V=nt,bn){if(E===n)return fe(V);if(q)return Ah(E),E=Ho(Ne,a),ce(V)}return E===n&&(E=Ho(Ne,a)),b}return Ht.cancel=Wt,Ht.flush=Et,Ht}var eN=Ve(function(o,a){return lh(o,1,a)}),tN=Ve(function(o,a,c){return lh(o,tn(a)||0,c)});function nN(o){return $n(o,j)}function ha(o,a){if(typeof o!="function"||a!=null&&typeof a!="function")throw new Yt(d);var c=function(){var h=arguments,g=a?a.apply(this,h):h[0],_=c.cache;if(_.has(g))return _.get(g);var b=o.apply(this,h);return c.cache=_.set(g,b)||_,b};return c.cache=new(ha.Cache||zn),c}ha.Cache=zn;function fa(o){if(typeof o!="function")throw new Yt(d);return function(){var a=arguments;switch(a.length){case 0:return!o.call(this);case 1:return!o.call(this,a[0]);case 2:return!o.call(this,a[0],a[1]);case 3:return!o.call(this,a[0],a[1],a[2])}return!o.apply(this,a)}}function rN(o){return gf(2,o)}var iN=UA(function(o,a){a=a.length==1&&ke(a[0])?qe(a[0],Zt(pe())):qe(ht(a,1),Zt(pe()));var c=a.length;return Ve(function(h){for(var g=-1,_=vt(h.length,c);++g<_;)h[g]=a[g].call(this,h[g]);return zt(o,this,h)})}),Oc=Ve(function(o,a){var c=gr(a,Ei(Oc));return $n(o,L,n,a,c)}),wf=Ve(function(o,a){var c=gr(a,Ei(wf));return $n(o,X,n,a,c)}),oN=Un(function(o,a){return $n(o,N,n,n,n,a)});function sN(o,a){if(typeof o!="function")throw new Yt(d);return a=a===n?a:Te(a),Ve(o,a)}function aN(o,a){if(typeof o!="function")throw new Yt(d);return a=a==null?0:at(Te(a),0),Ve(function(c){var h=c[a],g=wr(c,0,a);return h&&mr(g,h),zt(o,this,g)})}function lN(o,a,c){var h=!0,g=!0;if(typeof o!="function")throw new Yt(d);return Je(c)&&(h="leading"in c?!!c.leading:h,g="trailing"in c?!!c.trailing:g),Cf(o,a,{leading:h,maxWait:a,trailing:g})}function cN(o){return mf(o,1)}function dN(o,a){return Oc(xc(a),o)}function uN(){if(!arguments.length)return[];var o=arguments[0];return ke(o)?o:[o]}function pN(o){return Xt(o,x)}function hN(o,a){return a=typeof a=="function"?a:n,Xt(o,x,a)}function fN(o){return Xt(o,v|x)}function mN(o,a){return a=typeof a=="function"?a:n,Xt(o,v|x,a)}function gN(o,a){return a==null||ah(o,a,ut(a))}function wn(o,a){return o===a||o!==o&&a!==a}var yN=sa(uc),vN=sa(function(o,a){return o>=a}),jr=hh(function(){return arguments}())?hh:function(o){return Qe(o)&&Ze.call(o,"callee")&&!Qp.call(o,"callee")},ke=M.isArray,_N=Fp?Zt(Fp):TA;function Vt(o){return o!=null&&ma(o.length)&&!Hn(o)}function tt(o){return Qe(o)&&Vt(o)}function CN(o){return o===!0||o===!1||Qe(o)&&kt(o)==Eo}var br=FB||Yc,wN=Rp?Zt(Rp):BA;function bN(o){return Qe(o)&&o.nodeType===1&&!jo(o)}function xN(o){if(o==null)return!0;if(Vt(o)&&(ke(o)||typeof o=="string"||typeof o.splice=="function"||br(o)||Ti(o)||jr(o)))return!o.length;var a=_t(o);if(a==yn||a==vn)return!o.size;if(Wo(o))return!fc(o).length;for(var c in o)if(Ze.call(o,c))return!1;return!0}function kN(o,a){return Zo(o,a)}function SN(o,a,c){c=typeof c=="function"?c:n;var h=c?c(o,a):n;return h===n?Zo(o,a,n,c):!!h}function Gc(o){if(!Qe(o))return!1;var a=kt(o);return a==Ts||a==qE||typeof o.message=="string"&&typeof o.name=="string"&&!jo(o)}function EN(o){return typeof o=="number"&&th(o)}function Hn(o){if(!Je(o))return!1;var a=kt(o);return a==Bs||a==lp||a==jE||a==YE}function bf(o){return typeof o=="number"&&o==Te(o)}function ma(o){return typeof o=="number"&&o>-1&&o%1==0&&o<=xe}function Je(o){var a=typeof o;return o!=null&&(a=="object"||a=="function")}function Qe(o){return o!=null&&typeof o=="object"}var xf=Mp?Zt(Mp):PA;function TN(o,a){return o===a||hc(o,a,Pc(a))}function BN(o,a,c){return c=typeof c=="function"?c:n,hc(o,a,Pc(a),c)}function AN(o){return kf(o)&&o!=+o}function PN(o){if(hP(o))throw new be(l);return fh(o)}function VN(o){return o===null}function NN(o){return o==null}function kf(o){return typeof o=="number"||Qe(o)&&kt(o)==Bo}function jo(o){if(!Qe(o)||kt(o)!=On)return!1;var a=Zs(o);if(a===null)return!0;var c=Ze.call(a,"constructor")&&a.constructor;return typeof c=="function"&&c instanceof c&&Ls.call(c)==BB}var zc=Ip?Zt(Ip):VA;function DN(o){return bf(o)&&o>=-xe&&o<=xe}var Sf=Lp?Zt(Lp):NA;function ga(o){return typeof o=="string"||!ke(o)&&Qe(o)&&kt(o)==Po}function Ut(o){return typeof o=="symbol"||Qe(o)&&kt(o)==As}var Ti=Op?Zt(Op):DA;function FN(o){return o===n}function RN(o){return Qe(o)&&_t(o)==Vo}function MN(o){return Qe(o)&&kt(o)==XE}var IN=sa(mc),LN=sa(function(o,a){return o<=a});function Ef(o){if(!o)return[];if(Vt(o))return ga(o)?_n(o):Pt(o);if(Fo&&o[Fo])return gB(o[Fo]());var a=_t(o),c=a==yn?nc:a==vn?Rs:Bi;return c(o)}function jn(o){if(!o)return o===0?o:0;if(o=tn(o),o===ve||o===-ve){var a=o<0?-1:1;return a*Gt}return o===o?o:0}function Te(o){var a=jn(o),c=a%1;return a===a?c?a-c:a:0}function Tf(o){return o?$r(Te(o),0,At):0}function tn(o){if(typeof o=="number")return o;if(Ut(o))return jt;if(Je(o)){var a=typeof o.valueOf=="function"?o.valueOf():o;o=Je(a)?a+"":a}if(typeof o!="string")return o===0?o:+o;o=Wp(o);var c=_T.test(o);return c||wT.test(o)?QT(o.slice(2),c?2:8):vT.test(o)?jt:+o}function Bf(o){return Pn(o,Nt(o))}function ON(o){return o?$r(Te(o),-xe,xe):o===0?o:0}function ze(o){return o==null?"":$t(o)}var GN=ki(function(o,a){if(Wo(a)||Vt(a)){Pn(a,ut(a),o);return}for(var c in a)Ze.call(a,c)&&Oo(o,c,a[c])}),Af=ki(function(o,a){Pn(a,Nt(a),o)}),ya=ki(function(o,a,c,h){Pn(a,Nt(a),o,h)}),zN=ki(function(o,a,c,h){Pn(a,ut(a),o,h)}),ZN=Un(lc);function $N(o,a){var c=xi(o);return a==null?c:sh(c,a)}var UN=Ve(function(o,a){o=$e(o);var c=-1,h=a.length,g=h>2?a[2]:n;for(g&&St(a[0],a[1],g)&&(h=1);++c<h;)for(var _=a[c],b=Nt(_),E=-1,V=b.length;++E<V;){var W=b[E],H=o[W];(H===n||wn(H,Ci[W])&&!Ze.call(o,W))&&(o[W]=_[W])}return o}),WN=Ve(function(o){return o.push(n,Wh),zt(Pf,n,o)});function HN(o,a){return zp(o,pe(a,3),An)}function jN(o,a){return zp(o,pe(a,3),dc)}function qN(o,a){return o==null?o:cc(o,pe(a,3),Nt)}function KN(o,a){return o==null?o:uh(o,pe(a,3),Nt)}function YN(o,a){return o&&An(o,pe(a,3))}function JN(o,a){return o&&dc(o,pe(a,3))}function XN(o){return o==null?[]:Xs(o,ut(o))}function QN(o){return o==null?[]:Xs(o,Nt(o))}function Zc(o,a,c){var h=o==null?n:Ur(o,a);return h===n?c:h}function eD(o,a){return o!=null&&qh(o,a,xA)}function $c(o,a){return o!=null&&qh(o,a,kA)}var tD=Gh(function(o,a,c){a!=null&&typeof a.toString!="function"&&(a=Os.call(a)),o[a]=c},Wc(Dt)),nD=Gh(function(o,a,c){a!=null&&typeof a.toString!="function"&&(a=Os.call(a)),Ze.call(o,a)?o[a].push(c):o[a]=[c]},pe),rD=Ve(zo);function ut(o){return Vt(o)?ih(o):fc(o)}function Nt(o){return Vt(o)?ih(o,!0):FA(o)}function iD(o,a){var c={};return a=pe(a,3),An(o,function(h,g,_){Zn(c,a(h,g,_),h)}),c}function oD(o,a){var c={};return a=pe(a,3),An(o,function(h,g,_){Zn(c,g,a(h,g,_))}),c}var sD=ki(function(o,a,c){Qs(o,a,c)}),Pf=ki(function(o,a,c,h){Qs(o,a,c,h)}),aD=Un(function(o,a){var c={};if(o==null)return c;var h=!1;a=qe(a,function(_){return _=Cr(_,o),h||(h=_.length>1),_}),Pn(o,Bc(o),c),h&&(c=Xt(c,v|S|x,tP));for(var g=a.length;g--;)Cc(c,a[g]);return c});function lD(o,a){return Vf(o,fa(pe(a)))}var cD=Un(function(o,a){return o==null?{}:MA(o,a)});function Vf(o,a){if(o==null)return{};var c=qe(Bc(o),function(h){return[h]});return a=pe(a),wh(o,c,function(h,g){return a(h,g[0])})}function dD(o,a,c){a=Cr(a,o);var h=-1,g=a.length;for(g||(g=1,o=n);++h<g;){var _=o==null?n:o[Vn(a[h])];_===n&&(h=g,_=c),o=Hn(_)?_.call(o):_}return o}function uD(o,a,c){return o==null?o:$o(o,a,c)}function pD(o,a,c,h){return h=typeof h=="function"?h:n,o==null?o:$o(o,a,c,h)}var Nf=$h(ut),Df=$h(Nt);function hD(o,a,c){var h=ke(o),g=h||br(o)||Ti(o);if(a=pe(a,4),c==null){var _=o&&o.constructor;g?c=h?new _:[]:Je(o)?c=Hn(_)?xi(Zs(o)):{}:c={}}return(g?Kt:An)(o,function(b,E,V){return a(c,b,E,V)}),c}function fD(o,a){return o==null?!0:Cc(o,a)}function mD(o,a,c){return o==null?o:Eh(o,a,xc(c))}function gD(o,a,c,h){return h=typeof h=="function"?h:n,o==null?o:Eh(o,a,xc(c),h)}function Bi(o){return o==null?[]:tc(o,ut(o))}function yD(o){return o==null?[]:tc(o,Nt(o))}function vD(o,a,c){return c===n&&(c=a,a=n),c!==n&&(c=tn(c),c=c===c?c:0),a!==n&&(a=tn(a),a=a===a?a:0),$r(tn(o),a,c)}function _D(o,a,c){return a=jn(a),c===n?(c=a,a=0):c=jn(c),o=tn(o),SA(o,a,c)}function CD(o,a,c){if(c&&typeof c!="boolean"&&St(o,a,c)&&(a=c=n),c===n&&(typeof a=="boolean"?(c=a,a=n):typeof o=="boolean"&&(c=o,o=n)),o===n&&a===n?(o=0,a=1):(o=jn(o),a===n?(a=o,o=0):a=jn(a)),o>a){var h=o;o=a,a=h}if(c||o%1||a%1){var g=nh();return vt(o+g*(a-o+XT("1e-"+((g+"").length-1))),a)}return yc(o,a)}var wD=Si(function(o,a,c){return a=a.toLowerCase(),o+(c?Ff(a):a)});function Ff(o){return Uc(ze(o).toLowerCase())}function Rf(o){return o=ze(o),o&&o.replace(xT,uB).replace(ZT,"")}function bD(o,a,c){o=ze(o),a=$t(a);var h=o.length;c=c===n?h:$r(Te(c),0,h);var g=c;return c-=a.length,c>=0&&o.slice(c,g)==a}function xD(o){return o=ze(o),o&&rT.test(o)?o.replace(up,pB):o}function kD(o){return o=ze(o),o&&cT.test(o)?o.replace(Ol,"\\$&"):o}var SD=Si(function(o,a,c){return o+(c?"-":"")+a.toLowerCase()}),ED=Si(function(o,a,c){return o+(c?" ":"")+a.toLowerCase()}),TD=Ih("toLowerCase");function BD(o,a,c){o=ze(o),a=Te(a);var h=a?vi(o):0;if(!a||h>=a)return o;var g=(a-h)/2;return oa(Hs(g),c)+o+oa(Ws(g),c)}function AD(o,a,c){o=ze(o),a=Te(a);var h=a?vi(o):0;return a&&h<a?o+oa(a-h,c):o}function PD(o,a,c){o=ze(o),a=Te(a);var h=a?vi(o):0;return a&&h<a?oa(a-h,c)+o:o}function VD(o,a,c){return c||a==null?a=0:a&&(a=+a),LB(ze(o).replace(Gl,""),a||0)}function ND(o,a,c){return(c?St(o,a,c):a===n)?a=1:a=Te(a),vc(ze(o),a)}function DD(){var o=arguments,a=ze(o[0]);return o.length<3?a:a.replace(o[1],o[2])}var FD=Si(function(o,a,c){return o+(c?"_":"")+a.toLowerCase()});function RD(o,a,c){return c&&typeof c!="number"&&St(o,a,c)&&(a=c=n),c=c===n?At:c>>>0,c?(o=ze(o),o&&(typeof a=="string"||a!=null&&!zc(a))&&(a=$t(a),!a&&yi(o))?wr(_n(o),0,c):o.split(a,c)):[]}var MD=Si(function(o,a,c){return o+(c?" ":"")+Uc(a)});function ID(o,a,c){return o=ze(o),c=c==null?0:$r(Te(c),0,o.length),a=$t(a),o.slice(c,c+a.length)==a}function LD(o,a,c){var h=y.templateSettings;c&&St(o,a,c)&&(a=n),o=ze(o),a=ya({},a,h,Uh);var g=ya({},a.imports,h.imports,Uh),_=ut(g),b=tc(g,_),E,V,W=0,H=a.interpolate||Ps,q="__p += '",te=rc((a.escape||Ps).source+"|"+H.source+"|"+(H===pp?yT:Ps).source+"|"+(a.evaluate||Ps).source+"|$","g"),ce="//# sourceURL="+(Ze.call(a,"sourceURL")?(a.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++jT+"]")+`
73
- `;o.replace(te,function(me,Ne,Fe,Wt,Et,Ht){return Fe||(Fe=Wt),q+=o.slice(W,Ht).replace(kT,hB),Ne&&(E=!0,q+=`' +
72
+ `)}function uP(o){return ke(o)||jr(o)||!!(eh&&o&&o[eh])}function Wn(o,a){var d=typeof o;return a=a??xe,!!a&&(d=="number"||d!="symbol"&&xT.test(o))&&o>-1&&o%1==0&&o<a}function St(o,a,d){if(!Je(d))return!1;var h=typeof a;return(h=="number"?Vt(d)&&Wn(a,d.length):h=="string"&&a in d)?wn(d[a],o):!1}function Nc(o,a){if(ke(o))return!1;var d=typeof o;return d=="number"||d=="symbol"||d=="boolean"||o==null||Ut(o)?!0:lT.test(o)||!aT.test(o)||a!=null&&o in $e(a)}function pP(o){var a=typeof o;return a=="string"||a=="number"||a=="symbol"||a=="boolean"?o!=="__proto__":o===null}function Dc(o){var a=aa(o),d=y[a];if(typeof d!="function"||!(a in De.prototype))return!1;if(o===d)return!0;var h=Ac(d);return!!h&&o===h[0]}function hP(o){return!!Yp&&Yp in o}var fP=Is?Hn:Yc;function Wo(o){var a=o&&o.constructor,d=typeof a=="function"&&a.prototype||Ci;return o===d}function Yh(o){return o===o&&!Je(o)}function Jh(o,a){return function(d){return d==null?!1:d[o]===a&&(a!==n||o in $e(d))}}function mP(o){var a=ha(o,function(h){return d.size===f&&d.clear(),h}),d=a.cache;return a}function gP(o,a){var d=o[1],h=a[1],g=d|h,_=g<(N|C|z),x=h==z&&d==Q||h==z&&d==P&&o[7].length<=a[8]||h==(z|P)&&a[7].length<=a[8]&&d==Q;if(!(_||x))return o;h&N&&(o[2]=a[2],g|=d&N?0:I);var E=a[3];if(E){var V=o[3];o[3]=V?Dh(V,E,a[4]):E,o[4]=V?gr(o[3],m):a[4]}return E=a[5],E&&(V=o[5],o[5]=V?Fh(V,E,a[6]):E,o[6]=V?gr(o[5],m):a[6]),E=a[7],E&&(o[7]=E),h&z&&(o[8]=o[8]==null?a[8]:vt(o[8],a[8])),o[9]==null&&(o[9]=a[9]),o[0]=a[0],o[1]=g,o}function yP(o){var a=[];if(o!=null)for(var d in $e(o))a.push(d);return a}function vP(o){return Os.call(o)}function Xh(o,a,d){return a=at(a===n?o.length-1:a,0),function(){for(var h=arguments,g=-1,_=at(h.length-a,0),x=L(_);++g<_;)x[g]=h[a+g];g=-1;for(var E=L(a+1);++g<a;)E[g]=h[g];return E[a]=d(x),zt(o,this,E)}}function Qh(o,a){return a.length<2?o:Ur(o,Qt(a,0,-1))}function _P(o,a){for(var d=o.length,h=vt(a.length,d),g=Pt(o);h--;){var _=a[h];o[h]=Wn(_,d)?g[_]:n}return o}function Fc(o,a){if(!(a==="constructor"&&typeof o[a]=="function")&&a!="__proto__")return o[a]}var ef=nf(xh),Ho=FB||function(o,a){return pt.setTimeout(o,a)},Rc=nf(ZA);function tf(o,a,d){var h=a+"";return Rc(o,dP(h,CP(aP(h),d)))}function nf(o){var a=0,d=0;return function(){var h=LB(),g=W-(h-d);if(d=h,g>0){if(++a>=ue)return arguments[0]}else a=0;return o.apply(n,arguments)}}function ca(o,a){var d=-1,h=o.length,g=h-1;for(a=a===n?h:a;++d<a;){var _=yc(d,g),x=o[_];o[_]=o[d],o[d]=x}return o.length=a,o}var rf=mP(function(o){var a=[];return o.charCodeAt(0)===46&&a.push(""),o.replace(cT,function(d,h,g,_){a.push(g?_.replace(yT,"$1"):h||d)}),a});function Vn(o){if(typeof o=="string"||Ut(o))return o;var a=o+"";return a=="0"&&1/o==-ve?"-0":a}function Hr(o){if(o!=null){try{return Ls.call(o)}catch{}try{return o+""}catch{}}return""}function CP(o,a){return Kt(So,function(d){var h="_."+d[0];a&d[1]&&!Ds(o,h)&&o.push(h)}),o.sort()}function of(o){if(o instanceof De)return o.clone();var a=new Jt(o.__wrapped__,o.__chain__);return a.__actions__=Pt(o.__actions__),a.__index__=o.__index__,a.__values__=o.__values__,a}function wP(o,a,d){(d?St(o,a,d):a===n)?a=1:a=at(Te(a),0);var h=o==null?0:o.length;if(!h||a<1)return[];for(var g=0,_=0,x=L(Ws(h/a));g<h;)x[_++]=Qt(o,g,g+=a);return x}function bP(o){for(var a=-1,d=o==null?0:o.length,h=0,g=[];++a<d;){var _=o[a];_&&(g[h++]=_)}return g}function xP(){var o=arguments.length;if(!o)return[];for(var a=L(o-1),d=arguments[0],h=o;h--;)a[h-1]=arguments[h];return mr(ke(d)?Pt(d):[d],ht(a,1))}var kP=Ve(function(o,a){return tt(o)?Go(o,ht(a,1,tt,!0)):[]}),SP=Ve(function(o,a){var d=en(a);return tt(d)&&(d=n),tt(o)?Go(o,ht(a,1,tt,!0),pe(d,2)):[]}),EP=Ve(function(o,a){var d=en(a);return tt(d)&&(d=n),tt(o)?Go(o,ht(a,1,tt,!0),n,d):[]});function TP(o,a,d){var h=o==null?0:o.length;return h?(a=d||a===n?1:Te(a),Qt(o,a<0?0:a,h)):[]}function BP(o,a,d){var h=o==null?0:o.length;return h?(a=d||a===n?1:Te(a),a=h-a,Qt(o,0,a<0?0:a)):[]}function AP(o,a){return o&&o.length?ta(o,pe(a,3),!0,!0):[]}function PP(o,a){return o&&o.length?ta(o,pe(a,3),!0):[]}function VP(o,a,d,h){var g=o==null?0:o.length;return g?(d&&typeof d!="number"&&St(o,a,d)&&(d=0,h=g),xA(o,a,d,h)):[]}function sf(o,a,d){var h=o==null?0:o.length;if(!h)return-1;var g=d==null?0:Te(d);return g<0&&(g=at(h+g,0)),Fs(o,pe(a,3),g)}function af(o,a,d){var h=o==null?0:o.length;if(!h)return-1;var g=h-1;return d!==n&&(g=Te(d),g=d<0?at(h+g,0):vt(g,h-1)),Fs(o,pe(a,3),g,!0)}function lf(o){var a=o==null?0:o.length;return a?ht(o,1):[]}function NP(o){var a=o==null?0:o.length;return a?ht(o,ve):[]}function DP(o,a){var d=o==null?0:o.length;return d?(a=a===n?1:Te(a),ht(o,a)):[]}function FP(o){for(var a=-1,d=o==null?0:o.length,h={};++a<d;){var g=o[a];h[g[0]]=g[1]}return h}function cf(o){return o&&o.length?o[0]:n}function RP(o,a,d){var h=o==null?0:o.length;if(!h)return-1;var g=d==null?0:Te(d);return g<0&&(g=at(h+g,0)),gi(o,a,g)}function MP(o){var a=o==null?0:o.length;return a?Qt(o,0,-1):[]}var IP=Ve(function(o){var a=qe(o,bc);return a.length&&a[0]===o[0]?pc(a):[]}),LP=Ve(function(o){var a=en(o),d=qe(o,bc);return a===en(d)?a=n:d.pop(),d.length&&d[0]===o[0]?pc(d,pe(a,2)):[]}),OP=Ve(function(o){var a=en(o),d=qe(o,bc);return a=typeof a=="function"?a:n,a&&d.pop(),d.length&&d[0]===o[0]?pc(d,n,a):[]});function GP(o,a){return o==null?"":MB.call(o,a)}function en(o){var a=o==null?0:o.length;return a?o[a-1]:n}function zP(o,a,d){var h=o==null?0:o.length;if(!h)return-1;var g=h;return d!==n&&(g=Te(d),g=g<0?at(h+g,0):vt(g,h-1)),a===a?CB(o,a,g):Fs(o,Zp,g,!0)}function ZP(o,a){return o&&o.length?_h(o,Te(a)):n}var $P=Ve(df);function df(o,a){return o&&o.length&&a&&a.length?gc(o,a):o}function UP(o,a,d){return o&&o.length&&a&&a.length?gc(o,a,pe(d,2)):o}function WP(o,a,d){return o&&o.length&&a&&a.length?gc(o,a,n,d):o}var HP=Un(function(o,a){var d=o==null?0:o.length,h=lc(o,a);return bh(o,qe(a,function(g){return Wn(g,d)?+g:g}).sort(Nh)),h});function jP(o,a){var d=[];if(!(o&&o.length))return d;var h=-1,g=[],_=o.length;for(a=pe(a,3);++h<_;){var x=o[h];a(x,h,o)&&(d.push(x),g.push(h))}return bh(o,g),d}function Mc(o){return o==null?o:GB.call(o)}function qP(o,a,d){var h=o==null?0:o.length;return h?(d&&typeof d!="number"&&St(o,a,d)?(a=0,d=h):(a=a==null?0:Te(a),d=d===n?h:Te(d)),Qt(o,a,d)):[]}function KP(o,a){return ea(o,a)}function YP(o,a,d){return _c(o,a,pe(d,2))}function JP(o,a){var d=o==null?0:o.length;if(d){var h=ea(o,a);if(h<d&&wn(o[h],a))return h}return-1}function XP(o,a){return ea(o,a,!0)}function QP(o,a,d){return _c(o,a,pe(d,2),!0)}function eV(o,a){var d=o==null?0:o.length;if(d){var h=ea(o,a,!0)-1;if(wn(o[h],a))return h}return-1}function tV(o){return o&&o.length?kh(o):[]}function nV(o,a){return o&&o.length?kh(o,pe(a,2)):[]}function rV(o){var a=o==null?0:o.length;return a?Qt(o,1,a):[]}function iV(o,a,d){return o&&o.length?(a=d||a===n?1:Te(a),Qt(o,0,a<0?0:a)):[]}function oV(o,a,d){var h=o==null?0:o.length;return h?(a=d||a===n?1:Te(a),a=h-a,Qt(o,a<0?0:a,h)):[]}function sV(o,a){return o&&o.length?ta(o,pe(a,3),!1,!0):[]}function aV(o,a){return o&&o.length?ta(o,pe(a,3)):[]}var lV=Ve(function(o){return _r(ht(o,1,tt,!0))}),cV=Ve(function(o){var a=en(o);return tt(a)&&(a=n),_r(ht(o,1,tt,!0),pe(a,2))}),dV=Ve(function(o){var a=en(o);return a=typeof a=="function"?a:n,_r(ht(o,1,tt,!0),n,a)});function uV(o){return o&&o.length?_r(o):[]}function pV(o,a){return o&&o.length?_r(o,pe(a,2)):[]}function hV(o,a){return a=typeof a=="function"?a:n,o&&o.length?_r(o,n,a):[]}function Ic(o){if(!(o&&o.length))return[];var a=0;return o=fr(o,function(d){if(tt(d))return a=at(d.length,a),!0}),ec(a,function(d){return qe(o,Jl(d))})}function uf(o,a){if(!(o&&o.length))return[];var d=Ic(o);return a==null?d:qe(d,function(h){return zt(a,n,h)})}var fV=Ve(function(o,a){return tt(o)?Go(o,a):[]}),mV=Ve(function(o){return wc(fr(o,tt))}),gV=Ve(function(o){var a=en(o);return tt(a)&&(a=n),wc(fr(o,tt),pe(a,2))}),yV=Ve(function(o){var a=en(o);return a=typeof a=="function"?a:n,wc(fr(o,tt),n,a)}),vV=Ve(Ic);function _V(o,a){return Bh(o||[],a||[],Oo)}function CV(o,a){return Bh(o||[],a||[],$o)}var wV=Ve(function(o){var a=o.length,d=a>1?o[a-1]:n;return d=typeof d=="function"?(o.pop(),d):n,uf(o,d)});function pf(o){var a=y(o);return a.__chain__=!0,a}function bV(o,a){return a(o),o}function da(o,a){return a(o)}var xV=Un(function(o){var a=o.length,d=a?o[0]:0,h=this.__wrapped__,g=function(_){return lc(_,o)};return a>1||this.__actions__.length||!(h instanceof De)||!Wn(d)?this.thru(g):(h=h.slice(d,+d+(a?1:0)),h.__actions__.push({func:da,args:[g],thisArg:n}),new Jt(h,this.__chain__).thru(function(_){return a&&!_.length&&_.push(n),_}))});function kV(){return pf(this)}function SV(){return new Jt(this.value(),this.__chain__)}function EV(){this.__values__===n&&(this.__values__=Ef(this.value()));var o=this.__index__>=this.__values__.length,a=o?n:this.__values__[this.__index__++];return{done:o,value:a}}function TV(){return this}function BV(o){for(var a,d=this;d instanceof Ks;){var h=of(d);h.__index__=0,h.__values__=n,a?g.__wrapped__=h:a=h;var g=h;d=d.__wrapped__}return g.__wrapped__=o,a}function AV(){var o=this.__wrapped__;if(o instanceof De){var a=o;return this.__actions__.length&&(a=new De(this)),a=a.reverse(),a.__actions__.push({func:da,args:[Mc],thisArg:n}),new Jt(a,this.__chain__)}return this.thru(Mc)}function PV(){return Th(this.__wrapped__,this.__actions__)}var VV=na(function(o,a,d){Ze.call(o,d)?++o[d]:Zn(o,d,1)});function NV(o,a,d){var h=ke(o)?Gp:bA;return d&&St(o,a,d)&&(a=n),h(o,pe(a,3))}function DV(o,a){var d=ke(o)?fr:dh;return d(o,pe(a,3))}var FV=Lh(sf),RV=Lh(af);function MV(o,a){return ht(ua(o,a),1)}function IV(o,a){return ht(ua(o,a),ve)}function LV(o,a,d){return d=d===n?1:Te(d),ht(ua(o,a),d)}function hf(o,a){var d=ke(o)?Kt:vr;return d(o,pe(a,3))}function ff(o,a){var d=ke(o)?rB:ch;return d(o,pe(a,3))}var OV=na(function(o,a,d){Ze.call(o,d)?o[d].push(a):Zn(o,d,[a])});function GV(o,a,d,h){o=Vt(o)?o:Bi(o),d=d&&!h?Te(d):0;var g=o.length;return d<0&&(d=at(g+d,0)),ga(o)?d<=g&&o.indexOf(a,d)>-1:!!g&&gi(o,a,d)>-1}var zV=Ve(function(o,a,d){var h=-1,g=typeof a=="function",_=Vt(o)?L(o.length):[];return vr(o,function(x){_[++h]=g?zt(a,x,d):zo(x,a,d)}),_}),ZV=na(function(o,a,d){Zn(o,d,a)});function ua(o,a){var d=ke(o)?qe:gh;return d(o,pe(a,3))}function $V(o,a,d,h){return o==null?[]:(ke(a)||(a=a==null?[]:[a]),d=h?n:d,ke(d)||(d=d==null?[]:[d]),Ch(o,a,d))}var UV=na(function(o,a,d){o[d?0:1].push(a)},function(){return[[],[]]});function WV(o,a,d){var h=ke(o)?Kl:Up,g=arguments.length<3;return h(o,pe(a,4),d,g,vr)}function HV(o,a,d){var h=ke(o)?iB:Up,g=arguments.length<3;return h(o,pe(a,4),d,g,ch)}function jV(o,a){var d=ke(o)?fr:dh;return d(o,fa(pe(a,3)))}function qV(o){var a=ke(o)?oh:GA;return a(o)}function KV(o,a,d){(d?St(o,a,d):a===n)?a=1:a=Te(a);var h=ke(o)?yA:zA;return h(o,a)}function YV(o){var a=ke(o)?vA:$A;return a(o)}function JV(o){if(o==null)return 0;if(Vt(o))return ga(o)?vi(o):o.length;var a=_t(o);return a==yn||a==vn?o.size:fc(o).length}function XV(o,a,d){var h=ke(o)?Yl:UA;return d&&St(o,a,d)&&(a=n),h(o,pe(a,3))}var QV=Ve(function(o,a){if(o==null)return[];var d=a.length;return d>1&&St(o,a[0],a[1])?a=[]:d>2&&St(a[0],a[1],a[2])&&(a=[a[0]]),Ch(o,ht(a,1),[])}),pa=DB||function(){return pt.Date.now()};function eN(o,a){if(typeof a!="function")throw new Yt(c);return o=Te(o),function(){if(--o<1)return a.apply(this,arguments)}}function mf(o,a,d){return a=d?n:a,a=o&&a==null?o.length:a,$n(o,z,n,n,n,n,a)}function gf(o,a){var d;if(typeof a!="function")throw new Yt(c);return o=Te(o),function(){return--o>0&&(d=a.apply(this,arguments)),o<=1&&(a=n),d}}var Lc=Ve(function(o,a,d){var h=N;if(d.length){var g=gr(d,Ei(Lc));h|=R}return $n(o,h,a,d,g)}),yf=Ve(function(o,a,d){var h=N|C;if(d.length){var g=gr(d,Ei(yf));h|=R}return $n(a,h,o,d,g)});function vf(o,a,d){a=d?n:a;var h=$n(o,Q,n,n,n,n,n,a);return h.placeholder=vf.placeholder,h}function _f(o,a,d){a=d?n:a;var h=$n(o,M,n,n,n,n,n,a);return h.placeholder=_f.placeholder,h}function Cf(o,a,d){var h,g,_,x,E,V,H=0,j=!1,q=!1,te=!0;if(typeof o!="function")throw new Yt(c);a=tn(a)||0,Je(d)&&(j=!!d.leading,q="maxWait"in d,_=q?at(tn(d.maxWait)||0,a):_,te="trailing"in d?!!d.trailing:te);function le(nt){var bn=h,qn=g;return h=g=n,H=nt,x=o.apply(qn,bn),x}function fe(nt){return H=nt,E=Ho(Ne,a),j?le(nt):x}function Pe(nt){var bn=nt-V,qn=nt-H,Of=a-bn;return q?vt(Of,_-qn):Of}function me(nt){var bn=nt-V,qn=nt-H;return V===n||bn>=a||bn<0||q&&qn>=_}function Ne(){var nt=pa();if(me(nt))return Fe(nt);E=Ho(Ne,Pe(nt))}function Fe(nt){return E=n,te&&h?le(nt):(h=g=n,x)}function Wt(){E!==n&&Ah(E),H=0,h=V=g=E=n}function Et(){return E===n?x:Fe(pa())}function Ht(){var nt=pa(),bn=me(nt);if(h=arguments,g=this,V=nt,bn){if(E===n)return fe(V);if(q)return Ah(E),E=Ho(Ne,a),le(V)}return E===n&&(E=Ho(Ne,a)),x}return Ht.cancel=Wt,Ht.flush=Et,Ht}var tN=Ve(function(o,a){return lh(o,1,a)}),nN=Ve(function(o,a,d){return lh(o,tn(a)||0,d)});function rN(o){return $n(o,Z)}function ha(o,a){if(typeof o!="function"||a!=null&&typeof a!="function")throw new Yt(c);var d=function(){var h=arguments,g=a?a.apply(this,h):h[0],_=d.cache;if(_.has(g))return _.get(g);var x=o.apply(this,h);return d.cache=_.set(g,x)||_,x};return d.cache=new(ha.Cache||zn),d}ha.Cache=zn;function fa(o){if(typeof o!="function")throw new Yt(c);return function(){var a=arguments;switch(a.length){case 0:return!o.call(this);case 1:return!o.call(this,a[0]);case 2:return!o.call(this,a[0],a[1]);case 3:return!o.call(this,a[0],a[1],a[2])}return!o.apply(this,a)}}function iN(o){return gf(2,o)}var oN=WA(function(o,a){a=a.length==1&&ke(a[0])?qe(a[0],Zt(pe())):qe(ht(a,1),Zt(pe()));var d=a.length;return Ve(function(h){for(var g=-1,_=vt(h.length,d);++g<_;)h[g]=a[g].call(this,h[g]);return zt(o,this,h)})}),Oc=Ve(function(o,a){var d=gr(a,Ei(Oc));return $n(o,R,n,a,d)}),wf=Ve(function(o,a){var d=gr(a,Ei(wf));return $n(o,U,n,a,d)}),sN=Un(function(o,a){return $n(o,P,n,n,n,a)});function aN(o,a){if(typeof o!="function")throw new Yt(c);return a=a===n?a:Te(a),Ve(o,a)}function lN(o,a){if(typeof o!="function")throw new Yt(c);return a=a==null?0:at(Te(a),0),Ve(function(d){var h=d[a],g=wr(d,0,a);return h&&mr(g,h),zt(o,this,g)})}function cN(o,a,d){var h=!0,g=!0;if(typeof o!="function")throw new Yt(c);return Je(d)&&(h="leading"in d?!!d.leading:h,g="trailing"in d?!!d.trailing:g),Cf(o,a,{leading:h,maxWait:a,trailing:g})}function dN(o){return mf(o,1)}function uN(o,a){return Oc(xc(a),o)}function pN(){if(!arguments.length)return[];var o=arguments[0];return ke(o)?o:[o]}function hN(o){return Xt(o,S)}function fN(o,a){return a=typeof a=="function"?a:n,Xt(o,S,a)}function mN(o){return Xt(o,v|S)}function gN(o,a){return a=typeof a=="function"?a:n,Xt(o,v|S,a)}function yN(o,a){return a==null||ah(o,a,ut(a))}function wn(o,a){return o===a||o!==o&&a!==a}var vN=sa(uc),_N=sa(function(o,a){return o>=a}),jr=hh(function(){return arguments}())?hh:function(o){return Qe(o)&&Ze.call(o,"callee")&&!Qp.call(o,"callee")},ke=L.isArray,CN=Fp?Zt(Fp):BA;function Vt(o){return o!=null&&ma(o.length)&&!Hn(o)}function tt(o){return Qe(o)&&Vt(o)}function wN(o){return o===!0||o===!1||Qe(o)&&kt(o)==Eo}var br=RB||Yc,bN=Rp?Zt(Rp):AA;function xN(o){return Qe(o)&&o.nodeType===1&&!jo(o)}function kN(o){if(o==null)return!0;if(Vt(o)&&(ke(o)||typeof o=="string"||typeof o.splice=="function"||br(o)||Ti(o)||jr(o)))return!o.length;var a=_t(o);if(a==yn||a==vn)return!o.size;if(Wo(o))return!fc(o).length;for(var d in o)if(Ze.call(o,d))return!1;return!0}function SN(o,a){return Zo(o,a)}function EN(o,a,d){d=typeof d=="function"?d:n;var h=d?d(o,a):n;return h===n?Zo(o,a,n,d):!!h}function Gc(o){if(!Qe(o))return!1;var a=kt(o);return a==Ts||a==KE||typeof o.message=="string"&&typeof o.name=="string"&&!jo(o)}function TN(o){return typeof o=="number"&&th(o)}function Hn(o){if(!Je(o))return!1;var a=kt(o);return a==Bs||a==lp||a==qE||a==JE}function bf(o){return typeof o=="number"&&o==Te(o)}function ma(o){return typeof o=="number"&&o>-1&&o%1==0&&o<=xe}function Je(o){var a=typeof o;return o!=null&&(a=="object"||a=="function")}function Qe(o){return o!=null&&typeof o=="object"}var xf=Mp?Zt(Mp):VA;function BN(o,a){return o===a||hc(o,a,Pc(a))}function AN(o,a,d){return d=typeof d=="function"?d:n,hc(o,a,Pc(a),d)}function PN(o){return kf(o)&&o!=+o}function VN(o){if(fP(o))throw new be(l);return fh(o)}function NN(o){return o===null}function DN(o){return o==null}function kf(o){return typeof o=="number"||Qe(o)&&kt(o)==Bo}function jo(o){if(!Qe(o)||kt(o)!=On)return!1;var a=Zs(o);if(a===null)return!0;var d=Ze.call(a,"constructor")&&a.constructor;return typeof d=="function"&&d instanceof d&&Ls.call(d)==AB}var zc=Ip?Zt(Ip):NA;function FN(o){return bf(o)&&o>=-xe&&o<=xe}var Sf=Lp?Zt(Lp):DA;function ga(o){return typeof o=="string"||!ke(o)&&Qe(o)&&kt(o)==Po}function Ut(o){return typeof o=="symbol"||Qe(o)&&kt(o)==As}var Ti=Op?Zt(Op):FA;function RN(o){return o===n}function MN(o){return Qe(o)&&_t(o)==Vo}function IN(o){return Qe(o)&&kt(o)==QE}var LN=sa(mc),ON=sa(function(o,a){return o<=a});function Ef(o){if(!o)return[];if(Vt(o))return ga(o)?_n(o):Pt(o);if(Fo&&o[Fo])return yB(o[Fo]());var a=_t(o),d=a==yn?nc:a==vn?Rs:Bi;return d(o)}function jn(o){if(!o)return o===0?o:0;if(o=tn(o),o===ve||o===-ve){var a=o<0?-1:1;return a*Gt}return o===o?o:0}function Te(o){var a=jn(o),d=a%1;return a===a?d?a-d:a:0}function Tf(o){return o?$r(Te(o),0,At):0}function tn(o){if(typeof o=="number")return o;if(Ut(o))return jt;if(Je(o)){var a=typeof o.valueOf=="function"?o.valueOf():o;o=Je(a)?a+"":a}if(typeof o!="string")return o===0?o:+o;o=Wp(o);var d=CT.test(o);return d||bT.test(o)?eB(o.slice(2),d?2:8):_T.test(o)?jt:+o}function Bf(o){return Pn(o,Nt(o))}function GN(o){return o?$r(Te(o),-xe,xe):o===0?o:0}function ze(o){return o==null?"":$t(o)}var zN=ki(function(o,a){if(Wo(a)||Vt(a)){Pn(a,ut(a),o);return}for(var d in a)Ze.call(a,d)&&Oo(o,d,a[d])}),Af=ki(function(o,a){Pn(a,Nt(a),o)}),ya=ki(function(o,a,d,h){Pn(a,Nt(a),o,h)}),ZN=ki(function(o,a,d,h){Pn(a,ut(a),o,h)}),$N=Un(lc);function UN(o,a){var d=xi(o);return a==null?d:sh(d,a)}var WN=Ve(function(o,a){o=$e(o);var d=-1,h=a.length,g=h>2?a[2]:n;for(g&&St(a[0],a[1],g)&&(h=1);++d<h;)for(var _=a[d],x=Nt(_),E=-1,V=x.length;++E<V;){var H=x[E],j=o[H];(j===n||wn(j,Ci[H])&&!Ze.call(o,H))&&(o[H]=_[H])}return o}),HN=Ve(function(o){return o.push(n,Wh),zt(Pf,n,o)});function jN(o,a){return zp(o,pe(a,3),An)}function qN(o,a){return zp(o,pe(a,3),dc)}function KN(o,a){return o==null?o:cc(o,pe(a,3),Nt)}function YN(o,a){return o==null?o:uh(o,pe(a,3),Nt)}function JN(o,a){return o&&An(o,pe(a,3))}function XN(o,a){return o&&dc(o,pe(a,3))}function QN(o){return o==null?[]:Xs(o,ut(o))}function eD(o){return o==null?[]:Xs(o,Nt(o))}function Zc(o,a,d){var h=o==null?n:Ur(o,a);return h===n?d:h}function tD(o,a){return o!=null&&qh(o,a,kA)}function $c(o,a){return o!=null&&qh(o,a,SA)}var nD=Gh(function(o,a,d){a!=null&&typeof a.toString!="function"&&(a=Os.call(a)),o[a]=d},Wc(Dt)),rD=Gh(function(o,a,d){a!=null&&typeof a.toString!="function"&&(a=Os.call(a)),Ze.call(o,a)?o[a].push(d):o[a]=[d]},pe),iD=Ve(zo);function ut(o){return Vt(o)?ih(o):fc(o)}function Nt(o){return Vt(o)?ih(o,!0):RA(o)}function oD(o,a){var d={};return a=pe(a,3),An(o,function(h,g,_){Zn(d,a(h,g,_),h)}),d}function sD(o,a){var d={};return a=pe(a,3),An(o,function(h,g,_){Zn(d,g,a(h,g,_))}),d}var aD=ki(function(o,a,d){Qs(o,a,d)}),Pf=ki(function(o,a,d,h){Qs(o,a,d,h)}),lD=Un(function(o,a){var d={};if(o==null)return d;var h=!1;a=qe(a,function(_){return _=Cr(_,o),h||(h=_.length>1),_}),Pn(o,Bc(o),d),h&&(d=Xt(d,v|k|S,nP));for(var g=a.length;g--;)Cc(d,a[g]);return d});function cD(o,a){return Vf(o,fa(pe(a)))}var dD=Un(function(o,a){return o==null?{}:IA(o,a)});function Vf(o,a){if(o==null)return{};var d=qe(Bc(o),function(h){return[h]});return a=pe(a),wh(o,d,function(h,g){return a(h,g[0])})}function uD(o,a,d){a=Cr(a,o);var h=-1,g=a.length;for(g||(g=1,o=n);++h<g;){var _=o==null?n:o[Vn(a[h])];_===n&&(h=g,_=d),o=Hn(_)?_.call(o):_}return o}function pD(o,a,d){return o==null?o:$o(o,a,d)}function hD(o,a,d,h){return h=typeof h=="function"?h:n,o==null?o:$o(o,a,d,h)}var Nf=$h(ut),Df=$h(Nt);function fD(o,a,d){var h=ke(o),g=h||br(o)||Ti(o);if(a=pe(a,4),d==null){var _=o&&o.constructor;g?d=h?new _:[]:Je(o)?d=Hn(_)?xi(Zs(o)):{}:d={}}return(g?Kt:An)(o,function(x,E,V){return a(d,x,E,V)}),d}function mD(o,a){return o==null?!0:Cc(o,a)}function gD(o,a,d){return o==null?o:Eh(o,a,xc(d))}function yD(o,a,d,h){return h=typeof h=="function"?h:n,o==null?o:Eh(o,a,xc(d),h)}function Bi(o){return o==null?[]:tc(o,ut(o))}function vD(o){return o==null?[]:tc(o,Nt(o))}function _D(o,a,d){return d===n&&(d=a,a=n),d!==n&&(d=tn(d),d=d===d?d:0),a!==n&&(a=tn(a),a=a===a?a:0),$r(tn(o),a,d)}function CD(o,a,d){return a=jn(a),d===n?(d=a,a=0):d=jn(d),o=tn(o),EA(o,a,d)}function wD(o,a,d){if(d&&typeof d!="boolean"&&St(o,a,d)&&(a=d=n),d===n&&(typeof a=="boolean"?(d=a,a=n):typeof o=="boolean"&&(d=o,o=n)),o===n&&a===n?(o=0,a=1):(o=jn(o),a===n?(a=o,o=0):a=jn(a)),o>a){var h=o;o=a,a=h}if(d||o%1||a%1){var g=nh();return vt(o+g*(a-o+QT("1e-"+((g+"").length-1))),a)}return yc(o,a)}var bD=Si(function(o,a,d){return a=a.toLowerCase(),o+(d?Ff(a):a)});function Ff(o){return Uc(ze(o).toLowerCase())}function Rf(o){return o=ze(o),o&&o.replace(kT,pB).replace($T,"")}function xD(o,a,d){o=ze(o),a=$t(a);var h=o.length;d=d===n?h:$r(Te(d),0,h);var g=d;return d-=a.length,d>=0&&o.slice(d,g)==a}function kD(o){return o=ze(o),o&&iT.test(o)?o.replace(up,hB):o}function SD(o){return o=ze(o),o&&dT.test(o)?o.replace(Ol,"\\$&"):o}var ED=Si(function(o,a,d){return o+(d?"-":"")+a.toLowerCase()}),TD=Si(function(o,a,d){return o+(d?" ":"")+a.toLowerCase()}),BD=Ih("toLowerCase");function AD(o,a,d){o=ze(o),a=Te(a);var h=a?vi(o):0;if(!a||h>=a)return o;var g=(a-h)/2;return oa(Hs(g),d)+o+oa(Ws(g),d)}function PD(o,a,d){o=ze(o),a=Te(a);var h=a?vi(o):0;return a&&h<a?o+oa(a-h,d):o}function VD(o,a,d){o=ze(o),a=Te(a);var h=a?vi(o):0;return a&&h<a?oa(a-h,d)+o:o}function ND(o,a,d){return d||a==null?a=0:a&&(a=+a),OB(ze(o).replace(Gl,""),a||0)}function DD(o,a,d){return(d?St(o,a,d):a===n)?a=1:a=Te(a),vc(ze(o),a)}function FD(){var o=arguments,a=ze(o[0]);return o.length<3?a:a.replace(o[1],o[2])}var RD=Si(function(o,a,d){return o+(d?"_":"")+a.toLowerCase()});function MD(o,a,d){return d&&typeof d!="number"&&St(o,a,d)&&(a=d=n),d=d===n?At:d>>>0,d?(o=ze(o),o&&(typeof a=="string"||a!=null&&!zc(a))&&(a=$t(a),!a&&yi(o))?wr(_n(o),0,d):o.split(a,d)):[]}var ID=Si(function(o,a,d){return o+(d?" ":"")+Uc(a)});function LD(o,a,d){return o=ze(o),d=d==null?0:$r(Te(d),0,o.length),a=$t(a),o.slice(d,d+a.length)==a}function OD(o,a,d){var h=y.templateSettings;d&&St(o,a,d)&&(a=n),o=ze(o),a=ya({},a,h,Uh);var g=ya({},a.imports,h.imports,Uh),_=ut(g),x=tc(g,_),E,V,H=0,j=a.interpolate||Ps,q="__p += '",te=rc((a.escape||Ps).source+"|"+j.source+"|"+(j===pp?vT:Ps).source+"|"+(a.evaluate||Ps).source+"|$","g"),le="//# sourceURL="+(Ze.call(a,"sourceURL")?(a.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++qT+"]")+`
73
+ `;o.replace(te,function(me,Ne,Fe,Wt,Et,Ht){return Fe||(Fe=Wt),q+=o.slice(H,Ht).replace(ST,fB),Ne&&(E=!0,q+=`' +
74
74
  __e(`+Ne+`) +
75
75
  '`),Et&&(V=!0,q+=`';
76
76
  `+Et+`;
77
77
  __p += '`),Fe&&(q+=`' +
78
78
  ((__t = (`+Fe+`)) == null ? '' : __t) +
79
- '`),W=Ht+me.length,me}),q+=`';
79
+ '`),H=Ht+me.length,me}),q+=`';
80
80
  `;var fe=Ze.call(a,"variable")&&a.variable;if(!fe)q=`with (obj) {
81
81
  `+q+`
82
82
  }
83
- `;else if(mT.test(fe))throw new be(u);q=(V?q.replace(QE,""):q).replace(eT,"$1").replace(tT,"$1;"),q="function("+(fe||"obj")+`) {
83
+ `;else if(gT.test(fe))throw new be(u);q=(V?q.replace(eT,""):q).replace(tT,"$1").replace(nT,"$1;"),q="function("+(fe||"obj")+`) {
84
84
  `+(fe?"":`obj || (obj = {});
85
85
  `)+"var __t, __p = ''"+(E?", __e = _.escape":"")+(V?`, __j = Array.prototype.join;
86
86
  function print() { __p += __j.call(arguments, '') }
87
87
  `:`;
88
88
  `)+q+`return __p
89
- }`;var Pe=If(function(){return Oe(_,ce+"return "+q).apply(n,b)});if(Pe.source=q,Gc(Pe))throw Pe;return Pe}function OD(o){return ze(o).toLowerCase()}function GD(o){return ze(o).toUpperCase()}function zD(o,a,c){if(o=ze(o),o&&(c||a===n))return Wp(o);if(!o||!(a=$t(a)))return o;var h=_n(o),g=_n(a),_=Hp(h,g),b=jp(h,g)+1;return wr(h,_,b).join("")}function ZD(o,a,c){if(o=ze(o),o&&(c||a===n))return o.slice(0,Kp(o)+1);if(!o||!(a=$t(a)))return o;var h=_n(o),g=jp(h,_n(a))+1;return wr(h,0,g).join("")}function $D(o,a,c){if(o=ze(o),o&&(c||a===n))return o.replace(Gl,"");if(!o||!(a=$t(a)))return o;var h=_n(o),g=Hp(h,_n(a));return wr(h,g).join("")}function UD(o,a){var c=Z,h=K;if(Je(a)){var g="separator"in a?a.separator:g;c="length"in a?Te(a.length):c,h="omission"in a?$t(a.omission):h}o=ze(o);var _=o.length;if(yi(o)){var b=_n(o);_=b.length}if(c>=_)return o;var E=c-vi(h);if(E<1)return h;var V=b?wr(b,0,E).join(""):o.slice(0,E);if(g===n)return V+h;if(b&&(E+=V.length-E),zc(g)){if(o.slice(E).search(g)){var W,H=V;for(g.global||(g=rc(g.source,ze(hp.exec(g))+"g")),g.lastIndex=0;W=g.exec(H);)var q=W.index;V=V.slice(0,q===n?E:q)}}else if(o.indexOf($t(g),E)!=E){var te=V.lastIndexOf(g);te>-1&&(V=V.slice(0,te))}return V+h}function WD(o){return o=ze(o),o&&nT.test(o)?o.replace(dp,CB):o}var HD=Si(function(o,a,c){return o+(c?" ":"")+a.toUpperCase()}),Uc=Ih("toUpperCase");function Mf(o,a,c){return o=ze(o),a=c?n:a,a===n?mB(o)?xB(o):sB(o):o.match(a)||[]}var If=Ve(function(o,a){try{return zt(o,n,a)}catch(c){return Gc(c)?c:new be(c)}}),jD=Un(function(o,a){return Kt(a,function(c){c=Vn(c),Zn(o,c,Lc(o[c],o))}),o});function qD(o){var a=o==null?0:o.length,c=pe();return o=a?qe(o,function(h){if(typeof h[1]!="function")throw new Yt(d);return[c(h[0]),h[1]]}):[],Ve(function(h){for(var g=-1;++g<a;){var _=o[g];if(zt(_[0],this,h))return zt(_[1],this,h)}})}function KD(o){return CA(Xt(o,v))}function Wc(o){return function(){return o}}function YD(o,a){return o==null||o!==o?a:o}var JD=Oh(),XD=Oh(!0);function Dt(o){return o}function Hc(o){return mh(typeof o=="function"?o:Xt(o,v))}function QD(o){return yh(Xt(o,v))}function eF(o,a){return vh(o,Xt(a,v))}var tF=Ve(function(o,a){return function(c){return zo(c,o,a)}}),nF=Ve(function(o,a){return function(c){return zo(o,c,a)}});function jc(o,a,c){var h=ut(a),g=Xs(a,h);c==null&&!(Je(a)&&(g.length||!h.length))&&(c=a,a=o,o=this,g=Xs(a,ut(a)));var _=!(Je(c)&&"chain"in c)||!!c.chain,b=Hn(o);return Kt(g,function(E){var V=a[E];o[E]=V,b&&(o.prototype[E]=function(){var W=this.__chain__;if(_||W){var H=o(this.__wrapped__),q=H.__actions__=Pt(this.__actions__);return q.push({func:V,args:arguments,thisArg:o}),H.__chain__=W,H}return V.apply(o,mr([this.value()],arguments))})}),o}function rF(){return pt._===this&&(pt._=AB),this}function qc(){}function iF(o){return o=Te(o),Ve(function(a){return _h(a,o)})}var oF=Sc(qe),sF=Sc(Gp),aF=Sc(Yl);function Lf(o){return Nc(o)?Jl(Vn(o)):IA(o)}function lF(o){return function(a){return o==null?n:Ur(o,a)}}var cF=zh(),dF=zh(!0);function Kc(){return[]}function Yc(){return!1}function uF(){return{}}function pF(){return""}function hF(){return!0}function fF(o,a){if(o=Te(o),o<1||o>xe)return[];var c=At,h=vt(o,At);a=pe(a),o-=At;for(var g=ec(h,a);++c<o;)a(c);return g}function mF(o){return ke(o)?qe(o,Vn):Ut(o)?[o]:Pt(rf(ze(o)))}function gF(o){var a=++TB;return ze(o)+a}var yF=ia(function(o,a){return o+a},0),vF=Ec("ceil"),_F=ia(function(o,a){return o/a},1),CF=Ec("floor");function wF(o){return o&&o.length?Js(o,Dt,uc):n}function bF(o,a){return o&&o.length?Js(o,pe(a,2),uc):n}function xF(o){return $p(o,Dt)}function kF(o,a){return $p(o,pe(a,2))}function SF(o){return o&&o.length?Js(o,Dt,mc):n}function EF(o,a){return o&&o.length?Js(o,pe(a,2),mc):n}var TF=ia(function(o,a){return o*a},1),BF=Ec("round"),AF=ia(function(o,a){return o-a},0);function PF(o){return o&&o.length?Ql(o,Dt):0}function VF(o,a){return o&&o.length?Ql(o,pe(a,2)):0}return y.after=QV,y.ary=mf,y.assign=GN,y.assignIn=Af,y.assignInWith=ya,y.assignWith=zN,y.at=ZN,y.before=gf,y.bind=Lc,y.bindAll=jD,y.bindKey=yf,y.castArray=uN,y.chain=pf,y.chunk=CP,y.compact=wP,y.concat=bP,y.cond=qD,y.conforms=KD,y.constant=Wc,y.countBy=PV,y.create=$N,y.curry=vf,y.curryRight=_f,y.debounce=Cf,y.defaults=UN,y.defaultsDeep=WN,y.defer=eN,y.delay=tN,y.difference=xP,y.differenceBy=kP,y.differenceWith=SP,y.drop=EP,y.dropRight=TP,y.dropRightWhile=BP,y.dropWhile=AP,y.fill=PP,y.filter=NV,y.flatMap=RV,y.flatMapDeep=MV,y.flatMapDepth=IV,y.flatten=lf,y.flattenDeep=VP,y.flattenDepth=NP,y.flip=nN,y.flow=JD,y.flowRight=XD,y.fromPairs=DP,y.functions=XN,y.functionsIn=QN,y.groupBy=LV,y.initial=RP,y.intersection=MP,y.intersectionBy=IP,y.intersectionWith=LP,y.invert=tD,y.invertBy=nD,y.invokeMap=GV,y.iteratee=Hc,y.keyBy=zV,y.keys=ut,y.keysIn=Nt,y.map=ua,y.mapKeys=iD,y.mapValues=oD,y.matches=QD,y.matchesProperty=eF,y.memoize=ha,y.merge=sD,y.mergeWith=Pf,y.method=tF,y.methodOf=nF,y.mixin=jc,y.negate=fa,y.nthArg=iF,y.omit=aD,y.omitBy=lD,y.once=rN,y.orderBy=ZV,y.over=oF,y.overArgs=iN,y.overEvery=sF,y.overSome=aF,y.partial=Oc,y.partialRight=wf,y.partition=$V,y.pick=cD,y.pickBy=Vf,y.property=Lf,y.propertyOf=lF,y.pull=ZP,y.pullAll=df,y.pullAllBy=$P,y.pullAllWith=UP,y.pullAt=WP,y.range=cF,y.rangeRight=dF,y.rearg=oN,y.reject=HV,y.remove=HP,y.rest=sN,y.reverse=Mc,y.sampleSize=qV,y.set=uD,y.setWith=pD,y.shuffle=KV,y.slice=jP,y.sortBy=XV,y.sortedUniq=eV,y.sortedUniqBy=tV,y.split=RD,y.spread=aN,y.tail=nV,y.take=rV,y.takeRight=iV,y.takeRightWhile=oV,y.takeWhile=sV,y.tap=wV,y.throttle=lN,y.thru=da,y.toArray=Ef,y.toPairs=Nf,y.toPairsIn=Df,y.toPath=mF,y.toPlainObject=Bf,y.transform=hD,y.unary=cN,y.union=aV,y.unionBy=lV,y.unionWith=cV,y.uniq=dV,y.uniqBy=uV,y.uniqWith=pV,y.unset=fD,y.unzip=Ic,y.unzipWith=uf,y.update=mD,y.updateWith=gD,y.values=Bi,y.valuesIn=yD,y.without=hV,y.words=Mf,y.wrap=dN,y.xor=fV,y.xorBy=mV,y.xorWith=gV,y.zip=yV,y.zipObject=vV,y.zipObjectDeep=_V,y.zipWith=CV,y.entries=Nf,y.entriesIn=Df,y.extend=Af,y.extendWith=ya,jc(y,y),y.add=yF,y.attempt=If,y.camelCase=wD,y.capitalize=Ff,y.ceil=vF,y.clamp=vD,y.clone=pN,y.cloneDeep=fN,y.cloneDeepWith=mN,y.cloneWith=hN,y.conformsTo=gN,y.deburr=Rf,y.defaultTo=YD,y.divide=_F,y.endsWith=bD,y.eq=wn,y.escape=xD,y.escapeRegExp=kD,y.every=VV,y.find=DV,y.findIndex=sf,y.findKey=HN,y.findLast=FV,y.findLastIndex=af,y.findLastKey=jN,y.floor=CF,y.forEach=hf,y.forEachRight=ff,y.forIn=qN,y.forInRight=KN,y.forOwn=YN,y.forOwnRight=JN,y.get=Zc,y.gt=yN,y.gte=vN,y.has=eD,y.hasIn=$c,y.head=cf,y.identity=Dt,y.includes=OV,y.indexOf=FP,y.inRange=_D,y.invoke=rD,y.isArguments=jr,y.isArray=ke,y.isArrayBuffer=_N,y.isArrayLike=Vt,y.isArrayLikeObject=tt,y.isBoolean=CN,y.isBuffer=br,y.isDate=wN,y.isElement=bN,y.isEmpty=xN,y.isEqual=kN,y.isEqualWith=SN,y.isError=Gc,y.isFinite=EN,y.isFunction=Hn,y.isInteger=bf,y.isLength=ma,y.isMap=xf,y.isMatch=TN,y.isMatchWith=BN,y.isNaN=AN,y.isNative=PN,y.isNil=NN,y.isNull=VN,y.isNumber=kf,y.isObject=Je,y.isObjectLike=Qe,y.isPlainObject=jo,y.isRegExp=zc,y.isSafeInteger=DN,y.isSet=Sf,y.isString=ga,y.isSymbol=Ut,y.isTypedArray=Ti,y.isUndefined=FN,y.isWeakMap=RN,y.isWeakSet=MN,y.join=OP,y.kebabCase=SD,y.last=en,y.lastIndexOf=GP,y.lowerCase=ED,y.lowerFirst=TD,y.lt=IN,y.lte=LN,y.max=wF,y.maxBy=bF,y.mean=xF,y.meanBy=kF,y.min=SF,y.minBy=EF,y.stubArray=Kc,y.stubFalse=Yc,y.stubObject=uF,y.stubString=pF,y.stubTrue=hF,y.multiply=TF,y.nth=zP,y.noConflict=rF,y.noop=qc,y.now=pa,y.pad=BD,y.padEnd=AD,y.padStart=PD,y.parseInt=VD,y.random=CD,y.reduce=UV,y.reduceRight=WV,y.repeat=ND,y.replace=DD,y.result=dD,y.round=BF,y.runInContext=B,y.sample=jV,y.size=YV,y.snakeCase=FD,y.some=JV,y.sortedIndex=qP,y.sortedIndexBy=KP,y.sortedIndexOf=YP,y.sortedLastIndex=JP,y.sortedLastIndexBy=XP,y.sortedLastIndexOf=QP,y.startCase=MD,y.startsWith=ID,y.subtract=AF,y.sum=PF,y.sumBy=VF,y.template=LD,y.times=fF,y.toFinite=jn,y.toInteger=Te,y.toLength=Tf,y.toLower=OD,y.toNumber=tn,y.toSafeInteger=ON,y.toString=ze,y.toUpper=GD,y.trim=zD,y.trimEnd=ZD,y.trimStart=$D,y.truncate=UD,y.unescape=WD,y.uniqueId=gF,y.upperCase=HD,y.upperFirst=Uc,y.each=hf,y.eachRight=ff,y.first=cf,jc(y,function(){var o={};return An(y,function(a,c){Ze.call(y.prototype,c)||(o[c]=a)}),o}(),{chain:!1}),y.VERSION=i,Kt(["bind","bindKey","curry","curryRight","partial","partialRight"],function(o){y[o].placeholder=y}),Kt(["drop","take"],function(o,a){De.prototype[o]=function(c){c=c===n?1:at(Te(c),0);var h=this.__filtered__&&!a?new De(this):this.clone();return h.__filtered__?h.__takeCount__=vt(c,h.__takeCount__):h.__views__.push({size:vt(c,At),type:o+(h.__dir__<0?"Right":"")}),h},De.prototype[o+"Right"]=function(c){return this.reverse()[o](c).reverse()}}),Kt(["filter","map","takeWhile"],function(o,a){var c=a+1,h=c==P||c==Q;De.prototype[o]=function(g){var _=this.clone();return _.__iteratees__.push({iteratee:pe(g,3),type:c}),_.__filtered__=_.__filtered__||h,_}}),Kt(["head","last"],function(o,a){var c="take"+(a?"Right":"");De.prototype[o]=function(){return this[c](1).value()[0]}}),Kt(["initial","tail"],function(o,a){var c="drop"+(a?"":"Right");De.prototype[o]=function(){return this.__filtered__?new De(this):this[c](1)}}),De.prototype.compact=function(){return this.filter(Dt)},De.prototype.find=function(o){return this.filter(o).head()},De.prototype.findLast=function(o){return this.reverse().find(o)},De.prototype.invokeMap=Ve(function(o,a){return typeof o=="function"?new De(this):this.map(function(c){return zo(c,o,a)})}),De.prototype.reject=function(o){return this.filter(fa(pe(o)))},De.prototype.slice=function(o,a){o=Te(o);var c=this;return c.__filtered__&&(o>0||a<0)?new De(c):(o<0?c=c.takeRight(-o):o&&(c=c.drop(o)),a!==n&&(a=Te(a),c=a<0?c.dropRight(-a):c.take(a-o)),c)},De.prototype.takeRightWhile=function(o){return this.reverse().takeWhile(o).reverse()},De.prototype.toArray=function(){return this.take(At)},An(De.prototype,function(o,a){var c=/^(?:filter|find|map|reject)|While$/.test(a),h=/^(?:head|last)$/.test(a),g=y[h?"take"+(a=="last"?"Right":""):a],_=h||/^find/.test(a);g&&(y.prototype[a]=function(){var b=this.__wrapped__,E=h?[1]:arguments,V=b instanceof De,W=E[0],H=V||ke(b),q=function(Ne){var Fe=g.apply(y,mr([Ne],E));return h&&te?Fe[0]:Fe};H&&c&&typeof W=="function"&&W.length!=1&&(V=H=!1);var te=this.__chain__,ce=!!this.__actions__.length,fe=_&&!te,Pe=V&&!ce;if(!_&&H){b=Pe?b:new De(this);var me=o.apply(b,E);return me.__actions__.push({func:da,args:[q],thisArg:n}),new Jt(me,te)}return fe&&Pe?o.apply(this,E):(me=this.thru(q),fe?h?me.value()[0]:me.value():me)})}),Kt(["pop","push","shift","sort","splice","unshift"],function(o){var a=Ms[o],c=/^(?:push|sort|unshift)$/.test(o)?"tap":"thru",h=/^(?:pop|shift)$/.test(o);y.prototype[o]=function(){var g=arguments;if(h&&!this.__chain__){var _=this.value();return a.apply(ke(_)?_:[],g)}return this[c](function(b){return a.apply(ke(b)?b:[],g)})}}),An(De.prototype,function(o,a){var c=y[a];if(c){var h=c.name+"";Ze.call(bi,h)||(bi[h]=[]),bi[h].push({name:a,func:c})}}),bi[ra(n,k).name]=[{name:"wrapper",func:n}],De.prototype.clone=WB,De.prototype.reverse=HB,De.prototype.value=jB,y.prototype.at=bV,y.prototype.chain=xV,y.prototype.commit=kV,y.prototype.next=SV,y.prototype.plant=TV,y.prototype.reverse=BV,y.prototype.toJSON=y.prototype.valueOf=y.prototype.value=AV,y.prototype.first=y.prototype.head,Fo&&(y.prototype[Fo]=EV),y},_i=kB();Or?((Or.exports=_i)._=_i,Hl._=_i):pt._=_i}).call(Ai)}(bs,bs.exports);var Xe=bs.exports;const mE={class:"grid-overlay-container"},qu=r.defineComponent({__name:"PlAgOverlayLoading",props:{params:{}},setup(t){return(e,n)=>(r.openBlock(),r.createElementBlock("div",mE,[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))]))}}),gE={},yE={class:"grid-overlay-container"};function vE(t,e){return r.openBlock(),r.createElementBlock("div",yE,e[0]||(e[0]=[r.createElementVNode("div",{class:"grid-icon-sad-cat"},null,-1),r.createElementVNode("span",{class:"text-subtitle-m"},"Empty",-1)]))}const Ku=kl(gE,[["render",vE]]);async function _E(t,e){throw Error("not implemented")}function CE(t){return t.axesSpec.filter(e=>{var n;return((n=e.annotations)==null?void 0:n["pl7.app/axisNature"])==="heterogeneous"})}function wE(t,e){const n=[];for(const i of e)if(t[i].type==="column"){const s=CE(t[i].spec);for(const l of s){if(l.type!=="String"){console.warn("heterogeneous axis with string type expected, got",l,"skipping");continue}const d=wd(l),u=t.findIndex(p=>Xe.isEqual(p.id,d));if(u===-1)throw console.error("axis not found",i,d,t),Error("axis not found");n.push({columnIdx:i,axisIdx:u})}}return n}const Yu=(t,e)=>(t+e).toString();function bE(t,e,n,i,s,l){if(t.length>1)throw Error("hColumns.length > 1 is not supported");const d=t[0];let u=-1,p=-1;for(let v=0;v<l.length;++v)l[v]===d.axisIdx&&(u=v),l[v]===d.columnIdx&&(p=v);const f=(()=>{const S=i[u].data.filter(x=>x!==null);return Array.from(new Set(S))})();f.sort(),p>u?(n.splice(p,1),n.splice(u,1)):(n.splice(u,1),n.splice(p,1));const m=xE(s,i,u,p,f,e.rows);for(let v=0;v<f.length;++v){const S=f[v],x=S+"@"+v;n.push({colId:x,field:Yu(i.length,v),headerName:S,valueFormatter:Ju})}return{rowModelType:"clientSide",columnDefs:n,rowData:m}}function xE(t,e,n,i,s,l){const d=new Map;let u=0;for(let f=0;f<l;f++){const m={};for(let T=0;T<e.length;++T){if(T===n||T===i)continue;const A=t[T].toString();m[A]=e[T].data[f]}let v;const S=Pi(Object.values(m))??"";d.has(S)?v=d.get(S):(d.set(S,m),v=m,v.id=u.toString(),u++);const x=s.indexOf(e[n].data[f]);if(x===-1)throw Error("index not found");const F=Yu(e.length,x);v[F]=e[i].data[f]}return Array.from(d.values())}function kE(t){return Pi({type:t.type,id:t.id})}function SE(t){return JSON.parse(t)}const Ju=t=>t?t.value===void 0?"NULL":t.value===null?"NA":t.value.toString():"ERROR";function EE(t,e,n){var s,l,d;const i=kE(e);return{colId:i,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(i))??((d=e.spec.annotations)==null?void 0:d["pl7.app/table/visibility"])==="optional",valueFormatter:Ju,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 Xu(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 Qu(t){const e=[];return os(t,n=>(e.push(n),n)),e}async function TE(t,e,n){return n.length?(await t.findColumns(e,{columnFilter:{name:["pl7.app/label"]},compatibleWith:Xe.uniqWith(n.map(s=>Ma(s.spec.axesSpec).map(Xe.cloneDeep)).flat(),Xe.isEqual),strictlyCompatible:!0})).hits.filter(s=>s.spec.axesSpec.length===1):[]}async function BE(t,e,n){const i=Qu(n),l=(await TE(t,e,i)).filter(d=>!Xe.find(i,u=>d.columnId===u.columnId));return l.length===0?n:{type:"outer",primary:n,secondary:l.map(d=>({type:"column",column:d}))}}async function AE(t,e,n,i){const s=n.filter(m=>m.type!=="Bytes"),l=Qu(i),d=s.map(m=>[]),u=s.map(m=>null);for(let m=0;m<l.length;++m){const v=Ma(l[m].spec.axesSpec);for(let S=0;S<v.length;++S){const x=Xe.findIndex(s,F=>Xe.isEqual(F,v[S]));x===-1||u[x]||(v.length===1&&l[m].spec.name==="pl7.app/label"?(d[x]=[[m,S]],u[x]=l[m].columnId):d[x].push([m,S]))}}for(let m=s.length-1;m>=0;--m)d[m].length||(u.splice(m,1),d.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[v,S]of d[m]){const x=await t.getUniqueValues(e,{columnId:l[v].columnId,...!u[m]&&{axis:Xe.cloneDeep(s[m])},filters:[],limit:p});if(x.overflow){u.splice(m,1),d.splice(m,1),s.splice(m,1);continue e}const F=x.values.type;for(const T of x.values.data)if(!(Cd(T,F)||T===null)&&(f[m].add(Xu(T,F)),f[m].size===p)){u.splice(m,1),d.splice(m,1),s.splice(m,1);continue e}}if(!f[m].size){u.splice(m,1),d.splice(m,1),s.splice(m,1);continue e}}return s.map((m,v)=>{const S=[...f[v]].map(F=>({value:F,text:F.toString()})),x=S[0].value;return{axis:Xe.cloneDeep(m),...u[v]&&{column:u[v]},options:S,defaultValue:x}})}function PE(t,e,n){const i=e.length,s=[];for(let l=0;l<e[0].data.length;++l){const d={};for(let u=0;u<i;++u){const p=t[u].toString(),f=e[u].data[l],m=e[u].type;dg(e[u].absent,l)?d[p]=void 0:Cd(f,m)||f===null?d[p]=null:d[p]=Xu(f,m)}d.id=(n++).toString(),s.push(d)}return s}const VE=t=>t.type==="column"&&t.spec.axesSpec.length===1&&t.spec.name==="pl7.app/label";async function NE(t,e,n,i){const s=await t.getSpec(e),l=[...s.keys()].filter(x=>!Xe.find(n,F=>Xe.isEqual(F.axis,s[x].id)||Xe.isEqual(F.column,s[x].id))).sort((x,F)=>{var k,D;if(s[x].type!==s[F].type)return s[x].type==="axis"?-1:1;const T=(k=s[x].spec.annotations)==null?void 0:k["pl7.app/table/orderPriority"],A=(D=s[F].spec.annotations)==null?void 0:D["pl7.app/table/orderPriority"];return T===void 0?A===void 0?0:1:A===void 0?-1:Number(A)-Number(T)}),d=Xe.cloneDeep(l),u=wE(s,l);for(let x=l.length-1;x>=0;--x){const F=l[x];if(!VE(s[F]))continue;const T=Ma(s[F].spec.axesSpec)[0],A=Xe.findIndex(l,k=>Xe.isEqual(s[k].id,T));if(A!==-1){l[A]=F;for(const k of u)k.axisIdx===F&&(k.axisIdx=A);l.splice(x,1),d.splice(x,1)}}const p=await t.getShape(e),f=p.rows,m=d.map(x=>EE(x,s[x],i));if(u.length>1&&console.warn("Currently, only one heterogeneous axis is supported in the table, got",u.length," transposition will not be applied."),u.length===1)return bE(u,p,m,await t.getData(e,l),d,l);let v;return{rowModelType:"serverSide",columnDefs:m,serverSideDatasource:{getRows:async x=>{try{if(f==0){x.success({rowData:[],rowCount:f}),x.api.showNoRowsOverlay(),x.api.setGridOption("loading",!1);return}if(v&&!Xe.isEqual(v.request.sortModel,x.request.sortModel)){v=void 0,x.fail(),x.api.setGridOption("loading",!0);return}v=x;let F=0,T=[];if(f>0&&x.request.startRow!==void 0&&x.request.endRow!==void 0&&(F=Math.min(f,x.request.endRow)-x.request.startRow,F>0)){const A=await t.getData(e,l,{offset:x.request.startRow,length:F});T=PE(d,A,x.request.startRow)}x.success({rowData:T,rowCount:f}),x.api.autoSizeAllColumns(),x.api.setGridOption("loading",!1)}catch{x.fail(),x.api.setGridOption("loading",!0)}}}}}const DE={class:"ap-ag-data-table-container"},FE={key:0,class:"ap-ag-data-table-sheets"},RE=kl(r.defineComponent({__name:"PlAgDataTable",props:r.mergeModels({settings:{}},{modelValue:{default:{gridState:{}}},modelModifiers:{}}),emits:["update:modelValue"],setup(t){w.ModuleRegistry.registerModules([Ko.ClientSideRowModelModule,rd.ClipboardModule,nd.ServerSideRowModelModule,id.RangeSelectionModule,Ga,$d]);const e=r.useModel(t,"modelValue"),n=t,{settings:i}=r.toRefs(n);r.watch(()=>i.value,async(D,$)=>{if(D.sourceType!=="pframe"||!D.pFrame||!D.join||$&&$.sourceType==="pframe"&&Xe.isEqual(D.pFrame,$.pFrame)&&Xe.isEqual(D.join,$.join))return;const z=window.platforma;if(!z)throw Error("platforma not set");const L=z.pFrameDriver;if(!L)throw Error("platforma.pFrameDriver not set");const X=await BE(L,D.pFrame,D.join),I=e.value;I.pTableParams||(I.pTableParams={sorting:[],filters:[]}),I.pTableParams.join=X,e.value=I});const s=ep(()=>i.value.sourceType,async D=>{var z;const $=i.value.sourceType;switch($){case"pframe":{const L=window.platforma;if(!L)throw Error("platforma not set");const X=L.pFrameDriver;if(!X)throw Error("platforma.pFrameDriver not set");if(!i.value.pFrame)return[];const I=i.value.pFrame,N=(z=e.value.pTableParams)==null?void 0:z.join;return N?await AE(X,I,i.value.sheetAxes,N):[]}case"ptable":return i.value.sheets??[];case"xsv":return[];default:throw Error(`unsupported source type: ${$}`)}});function l(D){if(!(i.value.sourceType!=="ptable"&&i.value.sourceType!=="pframe"))return(D==null?void 0:D.sortModel.map($=>({column:SE($.colId),ascending:$.sort==="asc",naAndAbsentAreLeastValues:!0})))??[]}const d=r.computed({get:()=>{const D=e.value;return{columnOrder:D.gridState.columnOrder,sort:D.gridState.sort,columnVisibility:D.gridState.columnVisibility}},set:D=>{const $=e.value,z=v.value.rowModelType==="clientSide"?void 0:l(D.sort);$.gridState={...$.gridState,...D},(i.value.sourceType==="ptable"||i.value.sourceType==="pframe")&&($.pTableParams||($.pTableParams={sorting:[],filters:[]}),$.pTableParams.sorting=z),e.value=$}}),u=D=>Pi(D);function p(D){var $;if(!(i.value.sourceType!=="ptable"&&i.value.sourceType!=="pframe"))return(($=s.value)==null?void 0:$.map(z=>({type:"bySingleColumn",column:z.column?{type:"column",id:z.column}:{type:"axis",id:z.axis},predicate:{operator:"Equal",reference:D[u(z.axis)]}})))??[]}const f=r.computed({get:()=>e.value.gridState.sheets??{},set:D=>{const $=p(D),z=e.value;z.gridState.sheets=D,(i.value.sourceType==="ptable"||i.value.sourceType==="pframe")&&(z.pTableParams||(z.pTableParams={sorting:[],filters:[]}),z.pTableParams.filters=$),e.value=z}});r.watch(()=>[i.value,s.value],(D,$)=>{const[z,L]=D;if(!L)return;if($){const[I,N]=$;if((z.sourceType==="ptable"||z.sourceType==="pframe")&&z.sourceType===(I==null?void 0:I.sourceType)&&Xe.isEqual(L,N))return}if(z.sourceType!=="ptable"&&z.sourceType!=="pframe"){f.value={};return}const X=f.value;for(const I of L){const N=u(I.axis);X[N]||(X[N]=I.defaultValue??I.options[0].value)}f.value=X},{immediate:!0});const m=r.shallowRef(),v=r.ref({animateRows:!1,suppressColumnMoveAnimation:!0,cellSelection:!0,initialState:d.value,autoSizeStrategy:{type:"fitCellContents"},onRowDataUpdated:D=>{D.api.autoSizeAllColumns()},defaultColDef:{suppressHeaderMenuButton:!0},maintainColumnOrder:!0,localeText:{loadingError:"..."},rowModelType:"clientSide",maxBlocksInCache:1e3,cacheBlockSize:100,blockLoadDebounceMillis:500,serverSideSortAllLevels:!0,suppressServerSideFullWidthLoadingRow:!0,getRowId:D=>D.data.id,loading:!0,loadingOverlayComponentParams:{notReady:!0},loadingOverlayComponent:qu,noRowsOverlayComponent:Ku,sideBar:{toolPanels:[{id:"columns",labelDefault:"Columns",labelKey:"columns",iconKey:"columns",toolPanel:"agColumnsToolPanel",toolPanelParams:{suppressRowGroups:!0,suppressValues:!0,suppressPivots:!0,suppressPivotMode:!0,suppressColumnFilter:!0,suppressColumnSelectAll:!0,suppressColumnExpandAll:!0}}],defaultToolPanel:"columns"}}),S=D=>{const $=D.api;m.value=new Proxy($,{get(z,L,X){switch(L){case"setGridOption":return(I,N)=>{const j=v.value;j[I]=N,v.value=j,$.updateGridOptions(j)};case"updateGridOptions":return I=>{v.value={...v.value,...I},$.updateGridOptions(I)};default:return Reflect.get(z,L,X)}}})},x=D=>({columnOrder:D.columnOrder,sort:D.sort,columnVisibility:D.columnVisibility??(D.columnOrder?{hiddenColIds:[]}:void 0)}),F=D=>{v.value.initialState=d.value=x(D.state),D.api.autoSizeAllColumns()},T=()=>{v.value.initialState=d.value=x(m.value.getState()),m.value=void 0},A=r.ref(0);r.watch(()=>[m.value,d.value],(D,$)=>{if(Xe.isEqual(D,$))return;const[z,L]=D;if(!z)return;const X=x(z.getState());Xe.isEqual(L,X)||(v.value.initialState=L,++A.value)}),r.watch(()=>v.value,(D,$)=>{$&&D.rowModelType!=$.rowModelType&&++A.value});const k=(D,$)=>{var L;const z=f.value;z[D]!==$&&(z[D]=$,f.value=z,(L=m.value)==null||L.updateGridOptions({loading:!0,loadingOverlayComponentParams:{notReady:!1}}))};return r.watch(()=>[m.value,i.value,s.value],async(D,$)=>{var j,Z;if(Xe.isEqual(D,$))return;const[z,L,X]=D;if(!z)return;const I=window.platforma;if(!I)throw Error("platforma not set");const N=L.sourceType;switch(N){case"pframe":case"ptable":{const K=I.pFrameDriver;if(!K)throw Error("platforma.pFrameDriver not set");const le=L.pTable;if(!le||!X)return z.updateGridOptions({loading:!0,loadingOverlayComponentParams:{notReady:!0},columnDefs:[]});const U=(Z=(j=d.value)==null?void 0:j.columnVisibility)==null?void 0:Z.hiddenColIds,P=await NE(K,le,X,U);return z.updateGridOptions({loading:P.rowModelType!=="clientSide",loadingOverlayComponentParams:{notReady:!1},...P})}case"xsv":{const K=I.blobDriver;if(!K)throw Error("platforma.blobDriver not set");const le=L.xsvFile;if(!(le!=null&&le.ok)||!le.value)return z.updateGridOptions({loading:!0,loadingOverlayComponentParams:{notReady:!0},columnDefs:[]});const U=await _E(K,le.value);return z.updateGridOptions({loading:!0,loadingOverlayComponentParams:{notReady:!1},...U})}default:throw Error(`unsupported source type: ${N}`)}}),(D,$)=>(r.openBlock(),r.createElementBlock("div",DE,[r.createVNode(r.Transition,{name:"ap-ag-data-table-sheets-transition"},{default:r.withCtx(()=>[r.unref(s).value&&r.unref(s).value.length>0?(r.openBlock(),r.createElementBlock("div",FE,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(s).value,(z,L)=>(r.openBlock(),r.createBlock(r.unref(Eu),{key:L,"model-value":f.value[u(z.axis)],options:z.options,"onUpdate:modelValue":X=>k(u(z.axis),X)},null,8,["model-value","options","onUpdate:modelValue"]))),128))])):r.createCommentVNode("",!0)]),_:1}),(r.openBlock(),r.createBlock(r.unref(Kf.AgGridVue),{key:A.value,theme:r.unref(Wd),class:"ap-ag-data-table-grid","grid-options":v.value,onGridReady:S,onStateUpdated:F,onGridPreDestroyed:T},null,8,["theme","grid-options"]))]))}}),[["__scopeId","data-v-5b27ed88"]]),ME={key:1,class:"alert-error"},IE={key:2},LE=r.defineComponent({__name:"ValueOrErrorsComponent",props:{valueOrError:{}},setup(t){const e=t,n=r.computed(()=>e.valueOrError&&e.valueOrError.ok?e.valueOrError.value:void 0),i=r.computed(()=>e.valueOrError&&!e.valueOrError.ok?e.valueOrError.errors:void 0),s=r.computed(()=>n.value===void 0&&i.value===void 0);return(l,d)=>(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),i.value?(r.openBlock(),r.createElementBlock("div",ME,r.toDisplayString(i.value),1)):r.createCommentVNode("",!0),s.value?(r.openBlock(),r.createElementBlock("div",IE,"Unresolved")):r.createCommentVNode("",!0)]))}}),OE={style:{height:"100%"}},GE=r.defineComponent({__name:"PlAgCellFile",props:{params:{}},setup(t){const e=t,n=r.computed(()=>e.params.extensions),i=r.computed(()=>e.params.value);function s(d){e.params.setValue(d)}const l=r.computed(()=>e.params.resolveProgress?e.params.resolveProgress(i.value):void 0);return(d,u)=>(r.openBlock(),r.createElementBlock("div",OE,[r.createVNode(r.unref($u),{"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":i.value,progress:l.value,"onUpdate:modelValue":s},null,8,["placeholder","extensions","model-value","progress"])]))}}),xs=new Map;function zE(t,e){const n=r.getCurrentScope()??r.effectScope(),i=n.run(()=>(r.onScopeDispose(()=>{xs.delete(t)}),r.reactive(e())));return i[Symbol.dispose]=()=>{n.stop()},i}function ZE(t){const e=Symbol();return()=>(xs.has(e)||xs.set(e,zE(e,t)),xs.get(e))}function $E(t){return r.computed(()=>{try{return sd(t())}catch(e){return{errors:[String(e)],value:void 0}}})}function ep(t,e,n){const i=r.ref(0),s=r.reactive({loading:r.computed(()=>i.value>0),loadingRef:i,value:void 0,error:void 0}),l=Xf(e);return r.watch(t,async d=>{s.error=void 0,i.value++,l(d).then(u=>{u.ok&&(s.value=u.value)}).catch(u=>{s.value=void 0,s.error=u}).finally(()=>{i.value--})},Object.assign({immediate:!0,deep:!0},n??{})),s}const li=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,tp=new Set,Sl=typeof process=="object"&&process?process:{},np=(t,e,n,i)=>{typeof Sl.emitWarning=="function"?Sl.emitWarning(t,e,n,i):console.error(`[${n}] ${e}: ${t}`)};let ks=globalThis.AbortController,rp=globalThis.AbortSignal;if(typeof ks>"u"){rp=class{constructor(){Ge(this,"onabort");Ge(this,"_onabort",[]);Ge(this,"reason");Ge(this,"aborted",!1)}addEventListener(i,s){this._onabort.push(s)}},ks=class{constructor(){Ge(this,"signal",new rp);e()}abort(i){var s,l;if(!this.signal.aborted){this.signal.reason=i,this.signal.aborted=!0;for(const d of this.signal._onabort)d(i);(l=(s=this.signal).onabort)==null||l.call(s,i)}}};let t=((op=Sl.env)==null?void 0:op.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 UE=t=>!tp.has(t),pr=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),ip=t=>pr(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?Ss:null:null;class Ss extends Array{constructor(e){super(e),this.fill(0)}}const Fr=class Fr{constructor(e,n){Ge(this,"heap");Ge(this,"length");if(!C(Fr,ci))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new n(e),this.length=0}static create(e){const n=ip(e);if(!n)return[];he(Fr,ci,!0);const i=new Fr(e,n);return he(Fr,ci,!1),i}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}};ci=new WeakMap,Le(Fr,ci,!1);let El=Fr;const Al=class Al{constructor(e){Le(this,ee);Le(this,cn);Le(this,Mt);Le(this,dn);Le(this,un);Le(this,di);Le(this,ui);Ge(this,"ttl");Ge(this,"ttlResolution");Ge(this,"ttlAutopurge");Ge(this,"updateAgeOnGet");Ge(this,"updateAgeOnHas");Ge(this,"allowStale");Ge(this,"noDisposeOnSet");Ge(this,"noUpdateTTL");Ge(this,"maxEntrySize");Ge(this,"sizeCalculation");Ge(this,"noDeleteOnFetchRejection");Ge(this,"noDeleteOnStaleGet");Ge(this,"allowStaleOnFetchAbort");Ge(this,"allowStaleOnFetchRejection");Ge(this,"ignoreFetchAbort");Le(this,ot);Le(this,pn);Le(this,rt);Le(this,We);Le(this,we);Le(this,bt);Le(this,It);Le(this,yt);Le(this,ct);Le(this,hn);Le(this,dt);Le(this,fn);Le(this,mn);Le(this,Lt);Le(this,gn);Le(this,hr);Le(this,xt);Le(this,Rr,()=>{});Le(this,Ln,()=>{});Le(this,bo,()=>{});Le(this,Ot,()=>!1);Le(this,Mr,e=>{});Le(this,pi,(e,n,i)=>{});Le(this,xo,(e,n,i,s)=>{if(i||s)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});Ge(this,sp,"LRUCache");const{max:n=0,ttl:i,ttlResolution:s=1,ttlAutopurge:l,updateAgeOnGet:d,updateAgeOnHas:u,allowStale:p,dispose:f,disposeAfter:m,noDisposeOnSet:v,noUpdateTTL:S,maxSize:x=0,maxEntrySize:F=0,sizeCalculation:T,fetchMethod:A,memoMethod:k,noDeleteOnFetchRejection:D,noDeleteOnStaleGet:$,allowStaleOnFetchRejection:z,allowStaleOnFetchAbort:L,ignoreFetchAbort:X}=e;if(n!==0&&!pr(n))throw new TypeError("max option must be a nonnegative integer");const I=n?ip(n):Array;if(!I)throw new Error("invalid max value: "+n);if(he(this,cn,n),he(this,Mt,x),this.maxEntrySize=F||C(this,Mt),this.sizeCalculation=T,this.sizeCalculation){if(!C(this,Mt)&&!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(k!==void 0&&typeof k!="function")throw new TypeError("memoMethod must be a function if defined");if(he(this,ui,k),A!==void 0&&typeof A!="function")throw new TypeError("fetchMethod must be a function if specified");if(he(this,di,A),he(this,hr,!!A),he(this,rt,new Map),he(this,We,new Array(n).fill(void 0)),he(this,we,new Array(n).fill(void 0)),he(this,bt,new I(n)),he(this,It,new I(n)),he(this,yt,0),he(this,ct,0),he(this,hn,El.create(n)),he(this,ot,0),he(this,pn,0),typeof f=="function"&&he(this,dn,f),typeof m=="function"?(he(this,un,m),he(this,dt,[])):(he(this,un,void 0),he(this,dt,void 0)),he(this,gn,!!C(this,dn)),he(this,xt,!!C(this,un)),this.noDisposeOnSet=!!v,this.noUpdateTTL=!!S,this.noDeleteOnFetchRejection=!!D,this.allowStaleOnFetchRejection=!!z,this.allowStaleOnFetchAbort=!!L,this.ignoreFetchAbort=!!X,this.maxEntrySize!==0){if(C(this,Mt)!==0&&!pr(C(this,Mt)))throw new TypeError("maxSize must be a positive integer if specified");if(!pr(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");ae(this,ee,Zf).call(this)}if(this.allowStale=!!p,this.noDeleteOnStaleGet=!!$,this.updateAgeOnGet=!!d,this.updateAgeOnHas=!!u,this.ttlResolution=pr(s)||s===0?s:1,this.ttlAutopurge=!!l,this.ttl=i||0,this.ttl){if(!pr(this.ttl))throw new TypeError("ttl must be a positive integer if specified");ae(this,ee,Xc).call(this)}if(C(this,cn)===0&&this.ttl===0&&C(this,Mt)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!C(this,cn)&&!C(this,Mt)){const N="LRU_CACHE_UNBOUNDED";UE(N)&&(tp.add(N),np("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",N,Al))}}static unsafeExposeInternals(e){return{starts:C(e,mn),ttls:C(e,Lt),sizes:C(e,fn),keyMap:C(e,rt),keyList:C(e,We),valList:C(e,we),next:C(e,bt),prev:C(e,It),get head(){return C(e,yt)},get tail(){return C(e,ct)},free:C(e,hn),isBackgroundFetch:n=>{var i;return ae(i=e,ee,je).call(i,n)},backgroundFetch:(n,i,s,l)=>{var d;return ae(d=e,ee,Ca).call(d,n,i,s,l)},moveToTail:n=>{var i;return ae(i=e,ee,qo).call(i,n)},indexes:n=>{var i;return ae(i=e,ee,xr).call(i,n)},rindexes:n=>{var i;return ae(i=e,ee,kr).call(i,n)},isStale:n=>{var i;return C(i=e,Ot).call(i,n)}}}get max(){return C(this,cn)}get maxSize(){return C(this,Mt)}get calculatedSize(){return C(this,pn)}get size(){return C(this,ot)}get fetchMethod(){return C(this,di)}get memoMethod(){return C(this,ui)}get dispose(){return C(this,dn)}get disposeAfter(){return C(this,un)}getRemainingTTL(e){return C(this,rt).has(e)?1/0:0}*entries(){for(const e of ae(this,ee,xr).call(this))C(this,we)[e]!==void 0&&C(this,We)[e]!==void 0&&!ae(this,ee,je).call(this,C(this,we)[e])&&(yield[C(this,We)[e],C(this,we)[e]])}*rentries(){for(const e of ae(this,ee,kr).call(this))C(this,we)[e]!==void 0&&C(this,We)[e]!==void 0&&!ae(this,ee,je).call(this,C(this,we)[e])&&(yield[C(this,We)[e],C(this,we)[e]])}*keys(){for(const e of ae(this,ee,xr).call(this)){const n=C(this,We)[e];n!==void 0&&!ae(this,ee,je).call(this,C(this,we)[e])&&(yield n)}}*rkeys(){for(const e of ae(this,ee,kr).call(this)){const n=C(this,We)[e];n!==void 0&&!ae(this,ee,je).call(this,C(this,we)[e])&&(yield n)}}*values(){for(const e of ae(this,ee,xr).call(this))C(this,we)[e]!==void 0&&!ae(this,ee,je).call(this,C(this,we)[e])&&(yield C(this,we)[e])}*rvalues(){for(const e of ae(this,ee,kr).call(this))C(this,we)[e]!==void 0&&!ae(this,ee,je).call(this,C(this,we)[e])&&(yield C(this,we)[e])}[(ap=Symbol.iterator,sp=Symbol.toStringTag,ap)](){return this.entries()}find(e,n={}){for(const i of ae(this,ee,xr).call(this)){const s=C(this,we)[i],l=ae(this,ee,je).call(this,s)?s.__staleWhileFetching:s;if(l!==void 0&&e(l,C(this,We)[i],this))return this.get(C(this,We)[i],n)}}forEach(e,n=this){for(const i of ae(this,ee,xr).call(this)){const s=C(this,we)[i],l=ae(this,ee,je).call(this,s)?s.__staleWhileFetching:s;l!==void 0&&e.call(n,l,C(this,We)[i],this)}}rforEach(e,n=this){for(const i of ae(this,ee,kr).call(this)){const s=C(this,we)[i],l=ae(this,ee,je).call(this,s)?s.__staleWhileFetching:s;l!==void 0&&e.call(n,l,C(this,We)[i],this)}}purgeStale(){let e=!1;for(const n of ae(this,ee,kr).call(this,{allowStale:!0}))C(this,Ot).call(this,n)&&(ae(this,ee,Sr).call(this,C(this,We)[n],"expire"),e=!0);return e}info(e){const n=C(this,rt).get(e);if(n===void 0)return;const i=C(this,we)[n],s=ae(this,ee,je).call(this,i)?i.__staleWhileFetching:i;if(s===void 0)return;const l={value:s};if(C(this,Lt)&&C(this,mn)){const d=C(this,Lt)[n],u=C(this,mn)[n];if(d&&u){const p=d-(li.now()-u);l.ttl=p,l.start=Date.now()}}return C(this,fn)&&(l.size=C(this,fn)[n]),l}dump(){const e=[];for(const n of ae(this,ee,xr).call(this,{allowStale:!0})){const i=C(this,We)[n],s=C(this,we)[n],l=ae(this,ee,je).call(this,s)?s.__staleWhileFetching:s;if(l===void 0||i===void 0)continue;const d={value:l};if(C(this,Lt)&&C(this,mn)){d.ttl=C(this,Lt)[n];const u=li.now()-C(this,mn)[n];d.start=Math.floor(Date.now()-u)}C(this,fn)&&(d.size=C(this,fn)[n]),e.unshift([i,d])}return e}load(e){this.clear();for(const[n,i]of e){if(i.start){const s=Date.now()-i.start;i.start=li.now()-s}this.set(n,i.value,i)}}set(e,n,i={}){var S,x,F,T,A;if(n===void 0)return this.delete(e),this;const{ttl:s=this.ttl,start:l,noDisposeOnSet:d=this.noDisposeOnSet,sizeCalculation:u=this.sizeCalculation,status:p}=i;let{noUpdateTTL:f=this.noUpdateTTL}=i;const m=C(this,xo).call(this,e,n,i.size||0,u);if(this.maxEntrySize&&m>this.maxEntrySize)return p&&(p.set="miss",p.maxEntrySizeExceeded=!0),ae(this,ee,Sr).call(this,e,"set"),this;let v=C(this,ot)===0?void 0:C(this,rt).get(e);if(v===void 0)v=C(this,ot)===0?C(this,ct):C(this,hn).length!==0?C(this,hn).pop():C(this,ot)===C(this,cn)?ae(this,ee,_a).call(this,!1):C(this,ot),C(this,We)[v]=e,C(this,we)[v]=n,C(this,rt).set(e,v),C(this,bt)[C(this,ct)]=v,C(this,It)[v]=C(this,ct),he(this,ct,v),va(this,ot)._++,C(this,pi).call(this,v,m,p),p&&(p.set="add"),f=!1;else{ae(this,ee,qo).call(this,v);const k=C(this,we)[v];if(n!==k){if(C(this,hr)&&ae(this,ee,je).call(this,k)){k.__abortController.abort(new Error("replaced"));const{__staleWhileFetching:D}=k;D!==void 0&&!d&&(C(this,gn)&&((S=C(this,dn))==null||S.call(this,D,e,"set")),C(this,xt)&&((x=C(this,dt))==null||x.push([D,e,"set"])))}else d||(C(this,gn)&&((F=C(this,dn))==null||F.call(this,k,e,"set")),C(this,xt)&&((T=C(this,dt))==null||T.push([k,e,"set"])));if(C(this,Mr).call(this,v),C(this,pi).call(this,v,m,p),C(this,we)[v]=n,p){p.set="replace";const D=k&&ae(this,ee,je).call(this,k)?k.__staleWhileFetching:k;D!==void 0&&(p.oldValue=D)}}else p&&(p.set="update")}if(s!==0&&!C(this,Lt)&&ae(this,ee,Xc).call(this),C(this,Lt)&&(f||C(this,bo).call(this,v,s,l),p&&C(this,Ln).call(this,p,v)),!d&&C(this,xt)&&C(this,dt)){const k=C(this,dt);let D;for(;D=k==null?void 0:k.shift();)(A=C(this,un))==null||A.call(this,...D)}return this}pop(){var e;try{for(;C(this,ot);){const n=C(this,we)[C(this,yt)];if(ae(this,ee,_a).call(this,!0),ae(this,ee,je).call(this,n)){if(n.__staleWhileFetching)return n.__staleWhileFetching}else if(n!==void 0)return n}}finally{if(C(this,xt)&&C(this,dt)){const n=C(this,dt);let i;for(;i=n==null?void 0:n.shift();)(e=C(this,un))==null||e.call(this,...i)}}}has(e,n={}){const{updateAgeOnHas:i=this.updateAgeOnHas,status:s}=n,l=C(this,rt).get(e);if(l!==void 0){const d=C(this,we)[l];if(ae(this,ee,je).call(this,d)&&d.__staleWhileFetching===void 0)return!1;if(C(this,Ot).call(this,l))s&&(s.has="stale",C(this,Ln).call(this,s,l));else return i&&C(this,Rr).call(this,l),s&&(s.has="hit",C(this,Ln).call(this,s,l)),!0}else s&&(s.has="miss");return!1}peek(e,n={}){const{allowStale:i=this.allowStale}=n,s=C(this,rt).get(e);if(s===void 0||!i&&C(this,Ot).call(this,s))return;const l=C(this,we)[s];return ae(this,ee,je).call(this,l)?l.__staleWhileFetching:l}async fetch(e,n={}){const{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:l=this.noDeleteOnStaleGet,ttl:d=this.ttl,noDisposeOnSet:u=this.noDisposeOnSet,size:p=0,sizeCalculation:f=this.sizeCalculation,noUpdateTTL:m=this.noUpdateTTL,noDeleteOnFetchRejection:v=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:S=this.allowStaleOnFetchRejection,ignoreFetchAbort:x=this.ignoreFetchAbort,allowStaleOnFetchAbort:F=this.allowStaleOnFetchAbort,context:T,forceRefresh:A=!1,status:k,signal:D}=n;if(!C(this,hr))return k&&(k.fetch="get"),this.get(e,{allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:l,status:k});const $={allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:l,ttl:d,noDisposeOnSet:u,size:p,sizeCalculation:f,noUpdateTTL:m,noDeleteOnFetchRejection:v,allowStaleOnFetchRejection:S,allowStaleOnFetchAbort:F,ignoreFetchAbort:x,status:k,signal:D};let z=C(this,rt).get(e);if(z===void 0){k&&(k.fetch="miss");const L=ae(this,ee,Ca).call(this,e,z,$,T);return L.__returned=L}else{const L=C(this,we)[z];if(ae(this,ee,je).call(this,L)){const Z=i&&L.__staleWhileFetching!==void 0;return k&&(k.fetch="inflight",Z&&(k.returnedStale=!0)),Z?L.__staleWhileFetching:L.__returned=L}const X=C(this,Ot).call(this,z);if(!A&&!X)return k&&(k.fetch="hit"),ae(this,ee,qo).call(this,z),s&&C(this,Rr).call(this,z),k&&C(this,Ln).call(this,k,z),L;const I=ae(this,ee,Ca).call(this,e,z,$,T),j=I.__staleWhileFetching!==void 0&&i;return k&&(k.fetch=X?"stale":"refresh",j&&X&&(k.returnedStale=!0)),j?I.__staleWhileFetching:I.__returned=I}}async forceFetch(e,n={}){const i=await this.fetch(e,n);if(i===void 0)throw new Error("fetch() returned undefined");return i}memo(e,n={}){const i=C(this,ui);if(!i)throw new Error("no memoMethod provided to constructor");const{context:s,forceRefresh:l,...d}=n,u=this.get(e,d);if(!l&&u!==void 0)return u;const p=i(e,u,{options:d,context:s});return this.set(e,p,d),p}get(e,n={}){const{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:l=this.noDeleteOnStaleGet,status:d}=n,u=C(this,rt).get(e);if(u!==void 0){const p=C(this,we)[u],f=ae(this,ee,je).call(this,p);return d&&C(this,Ln).call(this,d,u),C(this,Ot).call(this,u)?(d&&(d.get="stale"),f?(d&&i&&p.__staleWhileFetching!==void 0&&(d.returnedStale=!0),i?p.__staleWhileFetching:void 0):(l||ae(this,ee,Sr).call(this,e,"expire"),d&&i&&(d.returnedStale=!0),i?p:void 0)):(d&&(d.get="hit"),f?p.__staleWhileFetching:(ae(this,ee,qo).call(this,u),s&&C(this,Rr).call(this,u),p))}else d&&(d.get="miss")}delete(e){return ae(this,ee,Sr).call(this,e,"delete")}clear(){return ae(this,ee,td).call(this,"delete")}};cn=new WeakMap,Mt=new WeakMap,dn=new WeakMap,un=new WeakMap,di=new WeakMap,ui=new WeakMap,ot=new WeakMap,pn=new WeakMap,rt=new WeakMap,We=new WeakMap,we=new WeakMap,bt=new WeakMap,It=new WeakMap,yt=new WeakMap,ct=new WeakMap,hn=new WeakMap,dt=new WeakMap,fn=new WeakMap,mn=new WeakMap,Lt=new WeakMap,gn=new WeakMap,hr=new WeakMap,xt=new WeakMap,ee=new WeakSet,Xc=function(){const e=new Ss(C(this,cn)),n=new Ss(C(this,cn));he(this,Lt,e),he(this,mn,n),he(this,bo,(l,d,u=li.now())=>{if(n[l]=d!==0?u:0,e[l]=d,d!==0&&this.ttlAutopurge){const p=setTimeout(()=>{C(this,Ot).call(this,l)&&ae(this,ee,Sr).call(this,C(this,We)[l],"expire")},d+1);p.unref&&p.unref()}}),he(this,Rr,l=>{n[l]=e[l]!==0?li.now():0}),he(this,Ln,(l,d)=>{if(e[d]){const u=e[d],p=n[d];if(!u||!p)return;l.ttl=u,l.start=p,l.now=i||s();const f=l.now-p;l.remainingTTL=u-f}});let i=0;const s=()=>{const l=li.now();if(this.ttlResolution>0){i=l;const d=setTimeout(()=>i=0,this.ttlResolution);d.unref&&d.unref()}return l};this.getRemainingTTL=l=>{const d=C(this,rt).get(l);if(d===void 0)return 0;const u=e[d],p=n[d];if(!u||!p)return 1/0;const f=(i||s())-p;return u-f},he(this,Ot,l=>{const d=n[l],u=e[l];return!!u&&!!d&&(i||s())-d>u})},Rr=new WeakMap,Ln=new WeakMap,bo=new WeakMap,Ot=new WeakMap,Zf=function(){const e=new Ss(C(this,cn));he(this,pn,0),he(this,fn,e),he(this,Mr,n=>{he(this,pn,C(this,pn)-e[n]),e[n]=0}),he(this,xo,(n,i,s,l)=>{if(ae(this,ee,je).call(this,i))return 0;if(!pr(s))if(l){if(typeof l!="function")throw new TypeError("sizeCalculation must be a function");if(s=l(i,n),!pr(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}),he(this,pi,(n,i,s)=>{if(e[n]=i,C(this,Mt)){const l=C(this,Mt)-e[n];for(;C(this,pn)>l;)ae(this,ee,_a).call(this,!0)}he(this,pn,C(this,pn)+e[n]),s&&(s.entrySize=i,s.totalCalculatedSize=C(this,pn))})},Mr=new WeakMap,pi=new WeakMap,xo=new WeakMap,xr=function*({allowStale:e=this.allowStale}={}){if(C(this,ot))for(let n=C(this,ct);!(!ae(this,ee,Qc).call(this,n)||((e||!C(this,Ot).call(this,n))&&(yield n),n===C(this,yt)));)n=C(this,It)[n]},kr=function*({allowStale:e=this.allowStale}={}){if(C(this,ot))for(let n=C(this,yt);!(!ae(this,ee,Qc).call(this,n)||((e||!C(this,Ot).call(this,n))&&(yield n),n===C(this,ct)));)n=C(this,bt)[n]},Qc=function(e){return e!==void 0&&C(this,rt).get(C(this,We)[e])===e},_a=function(e){var l,d;const n=C(this,yt),i=C(this,We)[n],s=C(this,we)[n];return C(this,hr)&&ae(this,ee,je).call(this,s)?s.__abortController.abort(new Error("evicted")):(C(this,gn)||C(this,xt))&&(C(this,gn)&&((l=C(this,dn))==null||l.call(this,s,i,"evict")),C(this,xt)&&((d=C(this,dt))==null||d.push([s,i,"evict"]))),C(this,Mr).call(this,n),e&&(C(this,We)[n]=void 0,C(this,we)[n]=void 0,C(this,hn).push(n)),C(this,ot)===1?(he(this,yt,he(this,ct,0)),C(this,hn).length=0):he(this,yt,C(this,bt)[n]),C(this,rt).delete(i),va(this,ot)._--,n},Ca=function(e,n,i,s){const l=n===void 0?void 0:C(this,we)[n];if(ae(this,ee,je).call(this,l))return l;const d=new ks,{signal:u}=i;u==null||u.addEventListener("abort",()=>d.abort(u.reason),{signal:d.signal});const p={signal:d.signal,options:i,context:s},f=(T,A=!1)=>{const{aborted:k}=d.signal,D=i.ignoreFetchAbort&&T!==void 0;if(i.status&&(k&&!A?(i.status.fetchAborted=!0,i.status.fetchError=d.signal.reason,D&&(i.status.fetchAbortIgnored=!0)):i.status.fetchResolved=!0),k&&!D&&!A)return v(d.signal.reason);const $=x;return C(this,we)[n]===x&&(T===void 0?$.__staleWhileFetching?C(this,we)[n]=$.__staleWhileFetching:ae(this,ee,Sr).call(this,e,"fetch"):(i.status&&(i.status.fetchUpdated=!0),this.set(e,T,p.options))),T},m=T=>(i.status&&(i.status.fetchRejected=!0,i.status.fetchError=T),v(T)),v=T=>{const{aborted:A}=d.signal,k=A&&i.allowStaleOnFetchAbort,D=k||i.allowStaleOnFetchRejection,$=D||i.noDeleteOnFetchRejection,z=x;if(C(this,we)[n]===x&&(!$||z.__staleWhileFetching===void 0?ae(this,ee,Sr).call(this,e,"fetch"):k||(C(this,we)[n]=z.__staleWhileFetching)),D)return i.status&&z.__staleWhileFetching!==void 0&&(i.status.returnedStale=!0),z.__staleWhileFetching;if(z.__returned===z)throw T},S=(T,A)=>{var D;const k=(D=C(this,di))==null?void 0:D.call(this,e,l,p);k&&k instanceof Promise&&k.then($=>T($===void 0?void 0:$),A),d.signal.addEventListener("abort",()=>{(!i.ignoreFetchAbort||i.allowStaleOnFetchAbort)&&(T(void 0),i.allowStaleOnFetchAbort&&(T=$=>f($,!0)))})};i.status&&(i.status.fetchDispatched=!0);const x=new Promise(S).then(f,m),F=Object.assign(x,{__abortController:d,__staleWhileFetching:l,__returned:void 0});return n===void 0?(this.set(e,F,{...p.options,status:void 0}),n=C(this,rt).get(e)):C(this,we)[n]=F,F},je=function(e){if(!C(this,hr))return!1;const n=e;return!!n&&n instanceof Promise&&n.hasOwnProperty("__staleWhileFetching")&&n.__abortController instanceof ks},ed=function(e,n){C(this,It)[n]=e,C(this,bt)[e]=n},qo=function(e){e!==C(this,ct)&&(e===C(this,yt)?he(this,yt,C(this,bt)[e]):ae(this,ee,ed).call(this,C(this,It)[e],C(this,bt)[e]),ae(this,ee,ed).call(this,C(this,ct),e),he(this,ct,e))},Sr=function(e,n){var s,l,d,u;let i=!1;if(C(this,ot)!==0){const p=C(this,rt).get(e);if(p!==void 0)if(i=!0,C(this,ot)===1)ae(this,ee,td).call(this,n);else{C(this,Mr).call(this,p);const f=C(this,we)[p];if(ae(this,ee,je).call(this,f)?f.__abortController.abort(new Error("deleted")):(C(this,gn)||C(this,xt))&&(C(this,gn)&&((s=C(this,dn))==null||s.call(this,f,e,n)),C(this,xt)&&((l=C(this,dt))==null||l.push([f,e,n]))),C(this,rt).delete(e),C(this,We)[p]=void 0,C(this,we)[p]=void 0,p===C(this,ct))he(this,ct,C(this,It)[p]);else if(p===C(this,yt))he(this,yt,C(this,bt)[p]);else{const m=C(this,It)[p];C(this,bt)[m]=C(this,bt)[p];const v=C(this,bt)[p];C(this,It)[v]=C(this,It)[p]}va(this,ot)._--,C(this,hn).push(p)}}if(C(this,xt)&&((d=C(this,dt))!=null&&d.length)){const p=C(this,dt);let f;for(;f=p==null?void 0:p.shift();)(u=C(this,un))==null||u.call(this,...f)}return i},td=function(e){var n,i,s;for(const l of ae(this,ee,kr).call(this,{allowStale:!0})){const d=C(this,we)[l];if(ae(this,ee,je).call(this,d))d.__abortController.abort(new Error("deleted"));else{const u=C(this,We)[l];C(this,gn)&&((n=C(this,dn))==null||n.call(this,d,u,e)),C(this,xt)&&((i=C(this,dt))==null||i.push([d,u,e]))}}if(C(this,rt).clear(),C(this,we).fill(void 0),C(this,We).fill(void 0),C(this,Lt)&&C(this,mn)&&(C(this,Lt).fill(0),C(this,mn).fill(0)),C(this,fn)&&C(this,fn).fill(0),he(this,yt,0),he(this,ct,0),C(this,hn).length=0,he(this,pn,0),he(this,ot,0),C(this,xt)&&C(this,dt)){const l=C(this,dt);let d;for(;d=l==null?void 0:l.shift();)(s=C(this,un))==null||s.call(this,...d)}};let Tl=Al;const WE={cacheSize:15e6};class HE{constructor(e){Ge(this,"_str");Ge(this,"_rawJson");Ge(this,"_zodSchema");Ge(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 Ir=class Ir{constructor(e){Ge(this,"fileDataCache");Ge(this,"fileDataRefs",new Map);const n={...WE,...e??{}};this.fileDataCache=new Tl({maxSize:n.cacheSize,fetchMethod:async i=>new HE(await pg().blobDriver.getContent(i)),sizeCalculation:i=>i.bytes.length,dispose:(i,s)=>{this.fileDataRefs.delete(s)}})}getDataRef(e){const n=this.fileDataRefs.get(e);if(n!==void 0)return n;const i=r.shallowRef();return this.fileDataRefs.set(e,i),(async()=>{try{const s=await this.fileDataCache.fetch(e);i.value=s}catch(s){console.error(s)}})(),i}getContentBytes(e){if(e===void 0)return;const n=this.getDataRef(e);return r.computed(()=>{var i;return(i=n.value)==null?void 0:i.bytes})}getContentString(e){if(e===void 0)return;const n=this.getDataRef(e);return r.computed(()=>{var i;return(i=n==null?void 0:n.value)==null?void 0:i.str})}getContentJson(e,n){if(e===void 0)return;const i=this.getDataRef(e);return r.computed(()=>{var s,l;return n===void 0?(s=i==null?void 0:i.value)==null?void 0:s.rawJson:(l=i==null?void 0:i.value)==null?void 0:l.validatedJson(n)})}static getContentBytes(e){return Ir.globalInstance.getContentBytes(e)}static getContentString(e){return Ir.globalInstance.getContentString(e)}static getContentJson(e,n){return Ir.globalInstance.getContentJson(e,n)}};Ge(Ir,"globalInstance",new Ir);let Bl=Ir;R.AgGridTheme=Wd,R.BlockLayout=fE,R.ContextProvider=Xx,R.DataTable=T_,R.DemoData=eE,R.DropdownListItem=no,R.LongText=pl,R.MultiError=xa,R.PlAgCellFile=GE,R.PlAgDataTable=RE,R.PlAgOverlayLoading=qu,R.PlAgOverlayNoRows=Ku,R.PlAlert=iC,R.PlBlockPage=U_,R.PlBtnAccent=cC,R.PlBtnDanger=uC,R.PlBtnGhost=sl,R.PlBtnGroup=DC,R.PlBtnLink=mC,R.PlBtnPrimary=il,R.PlBtnSecondary=ol,R.PlCheckbox=Dw,R.PlCheckboxGroup=Iw,R.PlChip=fl,R.PlContainer=H_,R.PlCopyData=Wu,R.PlDialogModal=gl,R.PlDropdown=hl,R.PlDropdownLegacy=iw,R.PlDropdownLine=Eu,R.PlDropdownMulti=Vw,R.PlDropdownRef=D0,R.PlFileDialog=Bu,R.PlFileInput=$u,R.PlGrid=X_,R.PlIcon16=us,R.PlIcon24=wu,R.PlLogView=pb,R.PlMaskIcon16=Xi,R.PlMaskIcon24=Mn,R.PlNotificationAlert=Uu,R.PlNumberField=gw,R.PlProgressBar=cw,R.PlRow=q_,R.PlSlideModal=Jw,R.PlSpacer=fu,R.PlTabs=Cb,R.PlTextArea=d0,R.PlTextField=bu,R.PlToggleSwitch=eb,R.PlTooltip=Tt,R.ReactiveFileContent=Bl,R.Scrollable=$k,R.Slider=ck,R.SliderRange=Ok,R.SliderRangeTriple=Tk,R.ThemeSwitcher=I_,R.UnresolvedError=ba,R.ValueOrErrorsComponent=LE,R.activateAgGrid=Ud,R.animate=lu,R.animateInfinite=N_,R.call=ru,R.computedResult=$E,R.createModel=Aa,R.debounce=cu,R.defineApp=nv,R.defineStore=ZE,R.delay=iu,R.detectOutside=u0,R.ensureError=Ea,R.eventListener=dl,R.formatZodError=Ba,R.getElementScrollPosition=ku,R.identity=Sa,R.isDefined=rm,R.isElementVisible=xu,R.isJsonEqual=ka,R.isZodError=Ta,R.listToOptions=D_,R.makeEaseInOut=V_,R.makeEaseOut=au,R.maskIcons16=X1,R.maskIcons24=Q1,R.normalizeListOptions=Pr,R.notEmpty=Qa,R.randomInt=su,R.randomString=P_,R.requestTick=el,R.scrollIntoView=to,R.showContextMenu=Ya,R.throttle=du,R.timeout=ou,R.unwrapOptionalResult=nm,R.unwrapValueOrErrors=od,R.useClickOutside=ds,R.useDraggable=gk,R.useEventListener=et,R.useFormState=fk,R.useHover=tu,R.useInterval=hk,R.useLabelNotch=Rn,R.useLocalStorage=uu,R.useMouse=eu,R.useMouseCapture=rr,R.usePosition=Qi,R.useQuery=mk,R.useResizeObserver=Hu,R.useScroll=dk,R.useSdkPlugin=Ha,R.useSortable=pk,R.useTheme=hu,R.useWatchFetch=ep,R.wrapOptionalResult=sd,R.wrapValueOrErrors=tm,Object.defineProperty(R,Symbol.toStringTag,{value:"Module"})});
89
+ }`;var Pe=If(function(){return Oe(_,le+"return "+q).apply(n,x)});if(Pe.source=q,Gc(Pe))throw Pe;return Pe}function GD(o){return ze(o).toLowerCase()}function zD(o){return ze(o).toUpperCase()}function ZD(o,a,d){if(o=ze(o),o&&(d||a===n))return Wp(o);if(!o||!(a=$t(a)))return o;var h=_n(o),g=_n(a),_=Hp(h,g),x=jp(h,g)+1;return wr(h,_,x).join("")}function $D(o,a,d){if(o=ze(o),o&&(d||a===n))return o.slice(0,Kp(o)+1);if(!o||!(a=$t(a)))return o;var h=_n(o),g=jp(h,_n(a))+1;return wr(h,0,g).join("")}function UD(o,a,d){if(o=ze(o),o&&(d||a===n))return o.replace(Gl,"");if(!o||!(a=$t(a)))return o;var h=_n(o),g=Hp(h,_n(a));return wr(h,g).join("")}function WD(o,a){var d=O,h=K;if(Je(a)){var g="separator"in a?a.separator:g;d="length"in a?Te(a.length):d,h="omission"in a?$t(a.omission):h}o=ze(o);var _=o.length;if(yi(o)){var x=_n(o);_=x.length}if(d>=_)return o;var E=d-vi(h);if(E<1)return h;var V=x?wr(x,0,E).join(""):o.slice(0,E);if(g===n)return V+h;if(x&&(E+=V.length-E),zc(g)){if(o.slice(E).search(g)){var H,j=V;for(g.global||(g=rc(g.source,ze(hp.exec(g))+"g")),g.lastIndex=0;H=g.exec(j);)var q=H.index;V=V.slice(0,q===n?E:q)}}else if(o.indexOf($t(g),E)!=E){var te=V.lastIndexOf(g);te>-1&&(V=V.slice(0,te))}return V+h}function HD(o){return o=ze(o),o&&rT.test(o)?o.replace(dp,wB):o}var jD=Si(function(o,a,d){return o+(d?" ":"")+a.toUpperCase()}),Uc=Ih("toUpperCase");function Mf(o,a,d){return o=ze(o),a=d?n:a,a===n?gB(o)?kB(o):aB(o):o.match(a)||[]}var If=Ve(function(o,a){try{return zt(o,n,a)}catch(d){return Gc(d)?d:new be(d)}}),qD=Un(function(o,a){return Kt(a,function(d){d=Vn(d),Zn(o,d,Lc(o[d],o))}),o});function KD(o){var a=o==null?0:o.length,d=pe();return o=a?qe(o,function(h){if(typeof h[1]!="function")throw new Yt(c);return[d(h[0]),h[1]]}):[],Ve(function(h){for(var g=-1;++g<a;){var _=o[g];if(zt(_[0],this,h))return zt(_[1],this,h)}})}function YD(o){return wA(Xt(o,v))}function Wc(o){return function(){return o}}function JD(o,a){return o==null||o!==o?a:o}var XD=Oh(),QD=Oh(!0);function Dt(o){return o}function Hc(o){return mh(typeof o=="function"?o:Xt(o,v))}function eF(o){return yh(Xt(o,v))}function tF(o,a){return vh(o,Xt(a,v))}var nF=Ve(function(o,a){return function(d){return zo(d,o,a)}}),rF=Ve(function(o,a){return function(d){return zo(o,d,a)}});function jc(o,a,d){var h=ut(a),g=Xs(a,h);d==null&&!(Je(a)&&(g.length||!h.length))&&(d=a,a=o,o=this,g=Xs(a,ut(a)));var _=!(Je(d)&&"chain"in d)||!!d.chain,x=Hn(o);return Kt(g,function(E){var V=a[E];o[E]=V,x&&(o.prototype[E]=function(){var H=this.__chain__;if(_||H){var j=o(this.__wrapped__),q=j.__actions__=Pt(this.__actions__);return q.push({func:V,args:arguments,thisArg:o}),j.__chain__=H,j}return V.apply(o,mr([this.value()],arguments))})}),o}function iF(){return pt._===this&&(pt._=PB),this}function qc(){}function oF(o){return o=Te(o),Ve(function(a){return _h(a,o)})}var sF=Sc(qe),aF=Sc(Gp),lF=Sc(Yl);function Lf(o){return Nc(o)?Jl(Vn(o)):LA(o)}function cF(o){return function(a){return o==null?n:Ur(o,a)}}var dF=zh(),uF=zh(!0);function Kc(){return[]}function Yc(){return!1}function pF(){return{}}function hF(){return""}function fF(){return!0}function mF(o,a){if(o=Te(o),o<1||o>xe)return[];var d=At,h=vt(o,At);a=pe(a),o-=At;for(var g=ec(h,a);++d<o;)a(d);return g}function gF(o){return ke(o)?qe(o,Vn):Ut(o)?[o]:Pt(rf(ze(o)))}function yF(o){var a=++BB;return ze(o)+a}var vF=ia(function(o,a){return o+a},0),_F=Ec("ceil"),CF=ia(function(o,a){return o/a},1),wF=Ec("floor");function bF(o){return o&&o.length?Js(o,Dt,uc):n}function xF(o,a){return o&&o.length?Js(o,pe(a,2),uc):n}function kF(o){return $p(o,Dt)}function SF(o,a){return $p(o,pe(a,2))}function EF(o){return o&&o.length?Js(o,Dt,mc):n}function TF(o,a){return o&&o.length?Js(o,pe(a,2),mc):n}var BF=ia(function(o,a){return o*a},1),AF=Ec("round"),PF=ia(function(o,a){return o-a},0);function VF(o){return o&&o.length?Ql(o,Dt):0}function NF(o,a){return o&&o.length?Ql(o,pe(a,2)):0}return y.after=eN,y.ary=mf,y.assign=zN,y.assignIn=Af,y.assignInWith=ya,y.assignWith=ZN,y.at=$N,y.before=gf,y.bind=Lc,y.bindAll=qD,y.bindKey=yf,y.castArray=pN,y.chain=pf,y.chunk=wP,y.compact=bP,y.concat=xP,y.cond=KD,y.conforms=YD,y.constant=Wc,y.countBy=VV,y.create=UN,y.curry=vf,y.curryRight=_f,y.debounce=Cf,y.defaults=WN,y.defaultsDeep=HN,y.defer=tN,y.delay=nN,y.difference=kP,y.differenceBy=SP,y.differenceWith=EP,y.drop=TP,y.dropRight=BP,y.dropRightWhile=AP,y.dropWhile=PP,y.fill=VP,y.filter=DV,y.flatMap=MV,y.flatMapDeep=IV,y.flatMapDepth=LV,y.flatten=lf,y.flattenDeep=NP,y.flattenDepth=DP,y.flip=rN,y.flow=XD,y.flowRight=QD,y.fromPairs=FP,y.functions=QN,y.functionsIn=eD,y.groupBy=OV,y.initial=MP,y.intersection=IP,y.intersectionBy=LP,y.intersectionWith=OP,y.invert=nD,y.invertBy=rD,y.invokeMap=zV,y.iteratee=Hc,y.keyBy=ZV,y.keys=ut,y.keysIn=Nt,y.map=ua,y.mapKeys=oD,y.mapValues=sD,y.matches=eF,y.matchesProperty=tF,y.memoize=ha,y.merge=aD,y.mergeWith=Pf,y.method=nF,y.methodOf=rF,y.mixin=jc,y.negate=fa,y.nthArg=oF,y.omit=lD,y.omitBy=cD,y.once=iN,y.orderBy=$V,y.over=sF,y.overArgs=oN,y.overEvery=aF,y.overSome=lF,y.partial=Oc,y.partialRight=wf,y.partition=UV,y.pick=dD,y.pickBy=Vf,y.property=Lf,y.propertyOf=cF,y.pull=$P,y.pullAll=df,y.pullAllBy=UP,y.pullAllWith=WP,y.pullAt=HP,y.range=dF,y.rangeRight=uF,y.rearg=sN,y.reject=jV,y.remove=jP,y.rest=aN,y.reverse=Mc,y.sampleSize=KV,y.set=pD,y.setWith=hD,y.shuffle=YV,y.slice=qP,y.sortBy=QV,y.sortedUniq=tV,y.sortedUniqBy=nV,y.split=MD,y.spread=lN,y.tail=rV,y.take=iV,y.takeRight=oV,y.takeRightWhile=sV,y.takeWhile=aV,y.tap=bV,y.throttle=cN,y.thru=da,y.toArray=Ef,y.toPairs=Nf,y.toPairsIn=Df,y.toPath=gF,y.toPlainObject=Bf,y.transform=fD,y.unary=dN,y.union=lV,y.unionBy=cV,y.unionWith=dV,y.uniq=uV,y.uniqBy=pV,y.uniqWith=hV,y.unset=mD,y.unzip=Ic,y.unzipWith=uf,y.update=gD,y.updateWith=yD,y.values=Bi,y.valuesIn=vD,y.without=fV,y.words=Mf,y.wrap=uN,y.xor=mV,y.xorBy=gV,y.xorWith=yV,y.zip=vV,y.zipObject=_V,y.zipObjectDeep=CV,y.zipWith=wV,y.entries=Nf,y.entriesIn=Df,y.extend=Af,y.extendWith=ya,jc(y,y),y.add=vF,y.attempt=If,y.camelCase=bD,y.capitalize=Ff,y.ceil=_F,y.clamp=_D,y.clone=hN,y.cloneDeep=mN,y.cloneDeepWith=gN,y.cloneWith=fN,y.conformsTo=yN,y.deburr=Rf,y.defaultTo=JD,y.divide=CF,y.endsWith=xD,y.eq=wn,y.escape=kD,y.escapeRegExp=SD,y.every=NV,y.find=FV,y.findIndex=sf,y.findKey=jN,y.findLast=RV,y.findLastIndex=af,y.findLastKey=qN,y.floor=wF,y.forEach=hf,y.forEachRight=ff,y.forIn=KN,y.forInRight=YN,y.forOwn=JN,y.forOwnRight=XN,y.get=Zc,y.gt=vN,y.gte=_N,y.has=tD,y.hasIn=$c,y.head=cf,y.identity=Dt,y.includes=GV,y.indexOf=RP,y.inRange=CD,y.invoke=iD,y.isArguments=jr,y.isArray=ke,y.isArrayBuffer=CN,y.isArrayLike=Vt,y.isArrayLikeObject=tt,y.isBoolean=wN,y.isBuffer=br,y.isDate=bN,y.isElement=xN,y.isEmpty=kN,y.isEqual=SN,y.isEqualWith=EN,y.isError=Gc,y.isFinite=TN,y.isFunction=Hn,y.isInteger=bf,y.isLength=ma,y.isMap=xf,y.isMatch=BN,y.isMatchWith=AN,y.isNaN=PN,y.isNative=VN,y.isNil=DN,y.isNull=NN,y.isNumber=kf,y.isObject=Je,y.isObjectLike=Qe,y.isPlainObject=jo,y.isRegExp=zc,y.isSafeInteger=FN,y.isSet=Sf,y.isString=ga,y.isSymbol=Ut,y.isTypedArray=Ti,y.isUndefined=RN,y.isWeakMap=MN,y.isWeakSet=IN,y.join=GP,y.kebabCase=ED,y.last=en,y.lastIndexOf=zP,y.lowerCase=TD,y.lowerFirst=BD,y.lt=LN,y.lte=ON,y.max=bF,y.maxBy=xF,y.mean=kF,y.meanBy=SF,y.min=EF,y.minBy=TF,y.stubArray=Kc,y.stubFalse=Yc,y.stubObject=pF,y.stubString=hF,y.stubTrue=fF,y.multiply=BF,y.nth=ZP,y.noConflict=iF,y.noop=qc,y.now=pa,y.pad=AD,y.padEnd=PD,y.padStart=VD,y.parseInt=ND,y.random=wD,y.reduce=WV,y.reduceRight=HV,y.repeat=DD,y.replace=FD,y.result=uD,y.round=AF,y.runInContext=B,y.sample=qV,y.size=JV,y.snakeCase=RD,y.some=XV,y.sortedIndex=KP,y.sortedIndexBy=YP,y.sortedIndexOf=JP,y.sortedLastIndex=XP,y.sortedLastIndexBy=QP,y.sortedLastIndexOf=eV,y.startCase=ID,y.startsWith=LD,y.subtract=PF,y.sum=VF,y.sumBy=NF,y.template=OD,y.times=mF,y.toFinite=jn,y.toInteger=Te,y.toLength=Tf,y.toLower=GD,y.toNumber=tn,y.toSafeInteger=GN,y.toString=ze,y.toUpper=zD,y.trim=ZD,y.trimEnd=$D,y.trimStart=UD,y.truncate=WD,y.unescape=HD,y.uniqueId=yF,y.upperCase=jD,y.upperFirst=Uc,y.each=hf,y.eachRight=ff,y.first=cf,jc(y,function(){var o={};return An(y,function(a,d){Ze.call(y.prototype,d)||(o[d]=a)}),o}(),{chain:!1}),y.VERSION=i,Kt(["bind","bindKey","curry","curryRight","partial","partialRight"],function(o){y[o].placeholder=y}),Kt(["drop","take"],function(o,a){De.prototype[o]=function(d){d=d===n?1:at(Te(d),0);var h=this.__filtered__&&!a?new De(this):this.clone();return h.__filtered__?h.__takeCount__=vt(d,h.__takeCount__):h.__views__.push({size:vt(d,At),type:o+(h.__dir__<0?"Right":"")}),h},De.prototype[o+"Right"]=function(d){return this.reverse()[o](d).reverse()}}),Kt(["filter","map","takeWhile"],function(o,a){var d=a+1,h=d==A||d==Y;De.prototype[o]=function(g){var _=this.clone();return _.__iteratees__.push({iteratee:pe(g,3),type:d}),_.__filtered__=_.__filtered__||h,_}}),Kt(["head","last"],function(o,a){var d="take"+(a?"Right":"");De.prototype[o]=function(){return this[d](1).value()[0]}}),Kt(["initial","tail"],function(o,a){var d="drop"+(a?"":"Right");De.prototype[o]=function(){return this.__filtered__?new De(this):this[d](1)}}),De.prototype.compact=function(){return this.filter(Dt)},De.prototype.find=function(o){return this.filter(o).head()},De.prototype.findLast=function(o){return this.reverse().find(o)},De.prototype.invokeMap=Ve(function(o,a){return typeof o=="function"?new De(this):this.map(function(d){return zo(d,o,a)})}),De.prototype.reject=function(o){return this.filter(fa(pe(o)))},De.prototype.slice=function(o,a){o=Te(o);var d=this;return d.__filtered__&&(o>0||a<0)?new De(d):(o<0?d=d.takeRight(-o):o&&(d=d.drop(o)),a!==n&&(a=Te(a),d=a<0?d.dropRight(-a):d.take(a-o)),d)},De.prototype.takeRightWhile=function(o){return this.reverse().takeWhile(o).reverse()},De.prototype.toArray=function(){return this.take(At)},An(De.prototype,function(o,a){var d=/^(?:filter|find|map|reject)|While$/.test(a),h=/^(?:head|last)$/.test(a),g=y[h?"take"+(a=="last"?"Right":""):a],_=h||/^find/.test(a);g&&(y.prototype[a]=function(){var x=this.__wrapped__,E=h?[1]:arguments,V=x instanceof De,H=E[0],j=V||ke(x),q=function(Ne){var Fe=g.apply(y,mr([Ne],E));return h&&te?Fe[0]:Fe};j&&d&&typeof H=="function"&&H.length!=1&&(V=j=!1);var te=this.__chain__,le=!!this.__actions__.length,fe=_&&!te,Pe=V&&!le;if(!_&&j){x=Pe?x:new De(this);var me=o.apply(x,E);return me.__actions__.push({func:da,args:[q],thisArg:n}),new Jt(me,te)}return fe&&Pe?o.apply(this,E):(me=this.thru(q),fe?h?me.value()[0]:me.value():me)})}),Kt(["pop","push","shift","sort","splice","unshift"],function(o){var a=Ms[o],d=/^(?:push|sort|unshift)$/.test(o)?"tap":"thru",h=/^(?:pop|shift)$/.test(o);y.prototype[o]=function(){var g=arguments;if(h&&!this.__chain__){var _=this.value();return a.apply(ke(_)?_:[],g)}return this[d](function(x){return a.apply(ke(x)?x:[],g)})}}),An(De.prototype,function(o,a){var d=y[a];if(d){var h=d.name+"";Ze.call(bi,h)||(bi[h]=[]),bi[h].push({name:a,func:d})}}),bi[ra(n,C).name]=[{name:"wrapper",func:n}],De.prototype.clone=HB,De.prototype.reverse=jB,De.prototype.value=qB,y.prototype.at=xV,y.prototype.chain=kV,y.prototype.commit=SV,y.prototype.next=EV,y.prototype.plant=BV,y.prototype.reverse=AV,y.prototype.toJSON=y.prototype.valueOf=y.prototype.value=PV,y.prototype.first=y.prototype.head,Fo&&(y.prototype[Fo]=TV),y},_i=SB();Or?((Or.exports=_i)._=_i,Hl._=_i):pt._=_i}).call(Ai)}(bs,bs.exports);var Xe=bs.exports;const gE={class:"grid-overlay-container"},qu=r.defineComponent({__name:"PlAgOverlayLoading",props:{params:{}},setup(t){return(e,n)=>(r.openBlock(),r.createElementBlock("div",gE,[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))]))}}),yE={},vE={class:"grid-overlay-container"};function _E(t,e){return r.openBlock(),r.createElementBlock("div",vE,e[0]||(e[0]=[r.createElementVNode("div",{class:"grid-icon-sad-cat"},null,-1),r.createElementVNode("span",{class:"text-subtitle-m"},"Empty",-1)]))}const Ku=kl(yE,[["render",_E]]);async function CE(t,e){throw Error("not implemented")}function wE(t){return t.axesSpec.filter(e=>{var n;return((n=e.annotations)==null?void 0:n["pl7.app/axisNature"])==="heterogeneous"})}function bE(t,e){const n=[];for(const i of e)if(t[i].type==="column"){const s=wE(t[i].spec);for(const l of s){if(l.type!=="String"){console.warn("heterogeneous axis with string type expected, got",l,"skipping");continue}const c=wd(l),u=t.findIndex(p=>Xe.isEqual(p.id,c));if(u===-1)throw console.error("axis not found",i,c,t),Error("axis not found");n.push({columnIdx:i,axisIdx:u})}}return n}const Yu=(t,e)=>(t+e).toString();function xE(t,e,n,i,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 v=0;v<l.length;++v)l[v]===c.axisIdx&&(u=v),l[v]===c.columnIdx&&(p=v);const f=(()=>{const k=i[u].data.filter(S=>S!==null);return Array.from(new Set(k))})();f.sort(),p>u?(n.splice(p,1),n.splice(u,1)):(n.splice(u,1),n.splice(p,1));const m=kE(s,i,u,p,f,e.rows);for(let v=0;v<f.length;++v){const k=f[v],S=k+"@"+v;n.push({colId:S,field:Yu(i.length,v),headerName:k,valueFormatter:Ju})}return{rowModelType:"clientSide",columnDefs:n,rowData:m}}function kE(t,e,n,i,s,l){const c=new Map;let u=0;for(let f=0;f<l;f++){const m={};for(let T=0;T<e.length;++T){if(T===n||T===i)continue;const N=t[T].toString();m[N]=e[T].data[f]}let v;const k=Pi(Object.values(m))??"";c.has(k)?v=c.get(k):(c.set(k,m),v=m,v.id=u.toString(),u++);const S=s.indexOf(e[n].data[f]);if(S===-1)throw Error("index not found");const F=Yu(e.length,S);v[F]=e[i].data[f]}return Array.from(c.values())}function SE(t){return Pi({type:t.type,id:t.id})}function EE(t){return JSON.parse(t)}const Ju=t=>t?t.value===void 0?"NULL":t.value===null?"NA":t.value.toString():"ERROR";function TE(t,e,n){var s,l,c;const i=SE(e);return{colId:i,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(i))??((c=e.spec.annotations)==null?void 0:c["pl7.app/table/visibility"])==="optional",valueFormatter:Ju,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 Xu(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 Qu(t){const e=[];return os(t,n=>(e.push(n),n)),e}async function BE(t,e,n){return n.length?(await t.findColumns(e,{columnFilter:{name:["pl7.app/label"]},compatibleWith:Xe.uniqWith(n.map(s=>Ma(s.spec.axesSpec).map(Xe.cloneDeep)).flat(),Xe.isEqual),strictlyCompatible:!0})).hits.filter(s=>s.spec.axesSpec.length===1):[]}async function AE(t,e,n){const i=Qu(n),l=(await BE(t,e,i)).filter(c=>!Xe.find(i,u=>c.columnId===u.columnId));return l.length===0?n:{type:"outer",primary:n,secondary:l.map(c=>({type:"column",column:c}))}}async function PE(t,e,n,i){const s=n.filter(m=>m.type!=="Bytes"),l=Qu(i),c=s.map(m=>[]),u=s.map(m=>null);for(let m=0;m<l.length;++m){const v=Ma(l[m].spec.axesSpec);for(let k=0;k<v.length;++k){const S=Xe.findIndex(s,F=>Xe.isEqual(F,v[k]));S===-1||u[S]||(v.length===1&&l[m].spec.name==="pl7.app/label"?(c[S]=[[m,k]],u[S]=l[m].columnId):c[S].push([m,k]))}}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[v,k]of c[m]){const S=await t.getUniqueValues(e,{columnId:l[v].columnId,...!u[m]&&{axis:Xe.cloneDeep(s[m])},filters:[],limit:p});if(S.overflow){u.splice(m,1),c.splice(m,1),s.splice(m,1);continue e}const F=S.values.type;for(const T of S.values.data)if(!(Cd(T,F)||T===null)&&(f[m].add(Xu(T,F)),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,v)=>{const k=[...f[v]].map(F=>({value:F,text:F.toString()})),S=k[0].value;return{axis:Xe.cloneDeep(m),...u[v]&&{column:u[v]},options:k,defaultValue:S}})}function VE(t,e,n,i){const s=e.length,l=[];for(let c=0;c<e[0].data.length;++c){const u=[],p=(i++).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 v=t[m].toString(),k=e[m].data[c],S=e[m].type;dg(e[m].absent,c)?f[v]=void 0:Cd(k,S)||k===null?f[v]=null:f[v]=Xu(k,S)}l.push(f)}return l}const NE=t=>t.type==="column"&&t.spec.axesSpec.length===1&&t.spec.name==="pl7.app/label";async function DE(t,e,n,i){const s=await t.getSpec(e);let l=s.findIndex(C=>C.type==="column");l===-1&&(l=s.length);const c=[...s.keys()].filter(C=>!Xe.find(n,I=>Xe.isEqual(I.axis,s[C].id)||Xe.isEqual(I.column,s[C].id))).sort((C,I)=>{var R,U;if(s[C].type!==s[I].type)return s[C].type==="axis"?-1:1;const Q=(R=s[C].spec.annotations)==null?void 0:R["pl7.app/table/orderPriority"],M=(U=s[I].spec.annotations)==null?void 0:U["pl7.app/table/orderPriority"];return Q===void 0?M===void 0?0:1:M===void 0?-1:Number(M)-Number(Q)}),u=Xe.cloneDeep(c),p=bE(s,c);for(let C=c.length-1;C>=0;--C){const I=c[C];if(!NE(s[I]))continue;const Q=Ma(s[I].spec.axesSpec)[0],M=Xe.findIndex(c,R=>Xe.isEqual(s[R].id,Q));if(M!==-1){c[M]=I;for(const R of p)R.axisIdx===I&&(R.axisIdx=M);c.splice(C,1),u.splice(C,1)}}const f=[...c],m=new Map;for(let C=0;C<l;++C)m.set(C,-1);for(let C=0;C<f.length;++C){const I=f[C];m.has(I)&&m.set(I,C)}for(const[C,I]of m)I===-1&&(m.set(C,f.length),f.push(C));const v=[];for(let C=0;C<l;++C){const I=m.get(C);if(I===void 0||I===-1)throw new Error("assertion exception");v.push(I)}const k=await t.getShape(e),S=k.rows,F=u.map(C=>TE(C,s[C],i));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 xE(p,k,F,await t.getData(e,c),u,c);let T;return{rowModelType:"serverSide",columnDefs:F,serverSideDatasource:{getRows:async C=>{try{if(S==0){C.success({rowData:[],rowCount:S}),C.api.showNoRowsOverlay(),C.api.setGridOption("loading",!1);return}if(T&&!Xe.isEqual(T.request.sortModel,C.request.sortModel)){T=void 0,C.fail(),C.api.setGridOption("loading",!0);return}T=C;let I=0,Q=[];if(S>0&&C.request.startRow!==void 0&&C.request.endRow!==void 0&&(I=Math.min(S,C.request.endRow)-C.request.startRow,I>0)){const M=await t.getData(e,f,{offset:C.request.startRow,length:I});Q=VE(u,M,v,C.request.startRow)}C.success({rowData:Q,rowCount:S}),C.api.autoSizeAllColumns(),C.api.setGridOption("loading",!1)}catch{C.fail(),C.api.setGridOption("loading",!0)}}}}}const FE={class:"ap-ag-data-table-container"},RE={key:0,class:"ap-ag-data-table-sheets"},ME=kl(r.defineComponent({__name:"PlAgDataTable",props:r.mergeModels({settings:{}},{modelValue:{default:{gridState:{}}},modelModifiers:{}}),emits:r.mergeModels(["onRowDoubleClicked"],["update:modelValue"]),setup(t,{emit:e}){b.ModuleRegistry.registerModules([Ko.ClientSideRowModelModule,rd.ClipboardModule,nd.ServerSideRowModelModule,id.RangeSelectionModule,Ga,$d]);const n=e,i=r.useModel(t,"modelValue"),s=t,{settings:l}=r.toRefs(s);r.watch(()=>l.value,async(M,R)=>{if(M.sourceType!=="pframe"||!M.pFrame||!M.join||R&&R.sourceType==="pframe"&&Xe.isEqual(M.pFrame,R.pFrame)&&Xe.isEqual(M.join,R.join))return;const U=window.platforma;if(!U)throw Error("platforma not set");const z=U.pFrameDriver;if(!z)throw Error("platforma.pFrameDriver not set");const P=await AE(z,M.pFrame,M.join),Z=i.value;Z.pTableParams||(Z.pTableParams={sorting:[],filters:[]}),Z.pTableParams.join=P,i.value=Z});const c=ep(()=>l.value.sourceType,async M=>{var U;const R=l.value.sourceType;switch(R){case"pframe":{const z=window.platforma;if(!z)throw Error("platforma not set");const P=z.pFrameDriver;if(!P)throw Error("platforma.pFrameDriver not set");if(!l.value.pFrame)return[];const Z=l.value.pFrame,O=(U=i.value.pTableParams)==null?void 0:U.join;return O?await PE(P,Z,l.value.sheetAxes,O):[]}case"ptable":return l.value.sheets??[];case"xsv":return[];default:throw Error(`unsupported source type: ${R}`)}});function u(M){if(!(l.value.sourceType!=="ptable"&&l.value.sourceType!=="pframe"))return(M==null?void 0:M.sortModel.map(R=>({column:EE(R.colId),ascending:R.sort==="asc",naAndAbsentAreLeastValues:!0})))??[]}const p=r.computed({get:()=>{const M=i.value;return{columnOrder:M.gridState.columnOrder,sort:M.gridState.sort,columnVisibility:M.gridState.columnVisibility}},set:M=>{const R=i.value,U=S.value.rowModelType==="clientSide"?void 0:u(M.sort);R.gridState={...R.gridState,...M},(l.value.sourceType==="ptable"||l.value.sourceType==="pframe")&&(R.pTableParams||(R.pTableParams={sorting:[],filters:[]}),R.pTableParams.sorting=U),i.value=R}}),f=M=>Pi(M);function m(M){var R;if(!(l.value.sourceType!=="ptable"&&l.value.sourceType!=="pframe"))return((R=c.value)==null?void 0:R.map(U=>({type:"bySingleColumn",column:U.column?{type:"column",id:U.column}:{type:"axis",id:U.axis},predicate:{operator:"Equal",reference:M[f(U.axis)]}})))??[]}const v=r.computed({get:()=>i.value.gridState.sheets??{},set:M=>{const R=m(M),U=i.value;U.gridState.sheets=M,(l.value.sourceType==="ptable"||l.value.sourceType==="pframe")&&(U.pTableParams||(U.pTableParams={sorting:[],filters:[]}),U.pTableParams.filters=R),i.value=U}});r.watch(()=>[l.value,c.value],(M,R)=>{const[U,z]=M;if(!z)return;if(R){const[Z,O]=R;if((U.sourceType==="ptable"||U.sourceType==="pframe")&&U.sourceType===(Z==null?void 0:Z.sourceType)&&Xe.isEqual(z,O))return}if(U.sourceType!=="ptable"&&U.sourceType!=="pframe"){v.value={};return}const P=v.value;for(const Z of z){const O=f(Z.axis);P[O]||(P[O]=Z.defaultValue??Z.options[0].value)}v.value=P},{immediate:!0});const k=r.shallowRef(),S=r.ref({animateRows:!1,suppressColumnMoveAnimation:!0,cellSelection:!0,initialState:p.value,autoSizeStrategy:{type:"fitCellContents"},onRowDataUpdated:M=>{M.api.autoSizeAllColumns()},onRowDoubleClicked:M=>{M.data&&n("onRowDoubleClicked",M.data.key)},defaultColDef:{suppressHeaderMenuButton:!0},maintainColumnOrder:!0,localeText:{loadingError:"..."},rowModelType:"clientSide",maxBlocksInCache:1e3,cacheBlockSize:100,blockLoadDebounceMillis:500,serverSideSortAllLevels:!0,suppressServerSideFullWidthLoadingRow:!0,getRowId:M=>M.data.id,loading:!0,loadingOverlayComponentParams:{notReady:!0},loadingOverlayComponent:qu,noRowsOverlayComponent:Ku,sideBar:{toolPanels:[{id:"columns",labelDefault:"Columns",labelKey:"columns",iconKey:"columns",toolPanel:"agColumnsToolPanel",toolPanelParams:{suppressRowGroups:!0,suppressValues:!0,suppressPivots:!0,suppressPivotMode:!0,suppressColumnFilter:!0,suppressColumnSelectAll:!0,suppressColumnExpandAll:!0}}],defaultToolPanel:"columns"}}),F=M=>{const R=M.api;k.value=new Proxy(R,{get(U,z,P){switch(z){case"setGridOption":return(Z,O)=>{const K=S.value;K[Z]=O,S.value=K,R.updateGridOptions(K)};case"updateGridOptions":return Z=>{S.value={...S.value,...Z},R.updateGridOptions(Z)};default:return Reflect.get(U,z,P)}}})},T=M=>({columnOrder:M.columnOrder,sort:M.sort,columnVisibility:M.columnVisibility??(M.columnOrder?{hiddenColIds:[]}:void 0)}),N=M=>{S.value.initialState=p.value=T(M.state),M.api.autoSizeAllColumns()},C=()=>{S.value.initialState=p.value=T(k.value.getState()),k.value=void 0},I=r.ref(0);r.watch(()=>[k.value,p.value],(M,R)=>{if(Xe.isEqual(M,R))return;const[U,z]=M;if(!U)return;const P=T(U.getState());Xe.isEqual(z,P)||(S.value.initialState=z,++I.value)}),r.watch(()=>S.value,(M,R)=>{R&&M.rowModelType!=R.rowModelType&&++I.value});const Q=(M,R)=>{var z;const U=v.value;U[M]!==R&&(U[M]=R,v.value=U,(z=k.value)==null||z.updateGridOptions({loading:!0,loadingOverlayComponentParams:{notReady:!1}}))};return r.watch(()=>[k.value,l.value,c.value],async(M,R)=>{var K,ue;if(Xe.isEqual(M,R))return;const[U,z,P]=M;if(!U)return;const Z=window.platforma;if(!Z)throw Error("platforma not set");const O=z.sourceType;switch(O){case"pframe":case"ptable":{const W=Z.pFrameDriver;if(!W)throw Error("platforma.pFrameDriver not set");const A=z.pTable;if(!A||!P)return U.updateGridOptions({loading:!0,loadingOverlayComponentParams:{notReady:!0},columnDefs:[]});const G=(ue=(K=p.value)==null?void 0:K.columnVisibility)==null?void 0:ue.hiddenColIds,Y=await DE(W,A,P,G);return U.updateGridOptions({loading:Y.rowModelType!=="clientSide",loadingOverlayComponentParams:{notReady:!1},...Y})}case"xsv":{const W=Z.blobDriver;if(!W)throw Error("platforma.blobDriver not set");const A=z.xsvFile;if(!(A!=null&&A.ok)||!A.value)return U.updateGridOptions({loading:!0,loadingOverlayComponentParams:{notReady:!0},columnDefs:[]});const G=await CE(W,A.value);return U.updateGridOptions({loading:!0,loadingOverlayComponentParams:{notReady:!1},...G})}default:throw Error(`unsupported source type: ${O}`)}}),(M,R)=>(r.openBlock(),r.createElementBlock("div",FE,[r.createVNode(r.Transition,{name:"ap-ag-data-table-sheets-transition"},{default:r.withCtx(()=>[r.unref(c).value&&r.unref(c).value.length>0?(r.openBlock(),r.createElementBlock("div",RE,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(c).value,(U,z)=>(r.openBlock(),r.createBlock(r.unref(Eu),{key:z,"model-value":v.value[f(U.axis)],options:U.options,"onUpdate:modelValue":P=>Q(f(U.axis),P)},null,8,["model-value","options","onUpdate:modelValue"]))),128))])):r.createCommentVNode("",!0)]),_:1}),(r.openBlock(),r.createBlock(r.unref(Kf.AgGridVue),{key:I.value,theme:r.unref(Wd),class:"ap-ag-data-table-grid","grid-options":S.value,onGridReady:F,onStateUpdated:N,onGridPreDestroyed:C},null,8,["theme","grid-options"]))]))}}),[["__scopeId","data-v-ba75cb02"]]),IE={key:1,class:"alert-error"},LE={key:2},OE=r.defineComponent({__name:"ValueOrErrorsComponent",props:{valueOrError:{}},setup(t){const e=t,n=r.computed(()=>e.valueOrError&&e.valueOrError.ok?e.valueOrError.value:void 0),i=r.computed(()=>e.valueOrError&&!e.valueOrError.ok?e.valueOrError.errors:void 0),s=r.computed(()=>n.value===void 0&&i.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),i.value?(r.openBlock(),r.createElementBlock("div",IE,r.toDisplayString(i.value),1)):r.createCommentVNode("",!0),s.value?(r.openBlock(),r.createElementBlock("div",LE,"Unresolved")):r.createCommentVNode("",!0)]))}}),GE={style:{height:"100%"}},zE=r.defineComponent({__name:"PlAgCellFile",props:{params:{}},setup(t){const e=t,n=r.computed(()=>e.params.extensions),i=r.computed(()=>e.params.value);function s(c){e.params.setValue(c)}const l=r.computed(()=>e.params.resolveProgress?e.params.resolveProgress(i.value):void 0);return(c,u)=>(r.openBlock(),r.createElementBlock("div",GE,[r.createVNode(r.unref($u),{"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":i.value,progress:l.value,"onUpdate:modelValue":s},null,8,["placeholder","extensions","model-value","progress"])]))}}),xs=new Map;function ZE(t,e){const n=r.getCurrentScope()??r.effectScope(),i=n.run(()=>(r.onScopeDispose(()=>{xs.delete(t)}),r.reactive(e())));return i[Symbol.dispose]=()=>{n.stop()},i}function $E(t){const e=Symbol();return()=>(xs.has(e)||xs.set(e,ZE(e,t)),xs.get(e))}function UE(t){return r.computed(()=>{try{return sd(t())}catch(e){return{errors:[String(e)],value:void 0}}})}function ep(t,e,n){const i=r.ref(0),s=r.reactive({loading:r.computed(()=>i.value>0),loadingRef:i,value:void 0,error:void 0}),l=Xf(e);return r.watch(t,async c=>{s.error=void 0,i.value++,l(c).then(u=>{u.ok&&(s.value=u.value)}).catch(u=>{s.value=void 0,s.error=u}).finally(()=>{i.value--})},Object.assign({immediate:!0,deep:!0},n??{})),s}const li=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,tp=new Set,Sl=typeof process=="object"&&process?process:{},np=(t,e,n,i)=>{typeof Sl.emitWarning=="function"?Sl.emitWarning(t,e,n,i):console.error(`[${n}] ${e}: ${t}`)};let ks=globalThis.AbortController,rp=globalThis.AbortSignal;if(typeof ks>"u"){rp=class{constructor(){Ge(this,"onabort");Ge(this,"_onabort",[]);Ge(this,"reason");Ge(this,"aborted",!1)}addEventListener(i,s){this._onabort.push(s)}},ks=class{constructor(){Ge(this,"signal",new rp);e()}abort(i){var s,l;if(!this.signal.aborted){this.signal.reason=i,this.signal.aborted=!0;for(const c of this.signal._onabort)c(i);(l=(s=this.signal).onabort)==null||l.call(s,i)}}};let t=((op=Sl.env)==null?void 0:op.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 WE=t=>!tp.has(t),pr=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),ip=t=>pr(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?Ss:null:null;class Ss extends Array{constructor(e){super(e),this.fill(0)}}const Fr=class Fr{constructor(e,n){Ge(this,"heap");Ge(this,"length");if(!w(Fr,ci))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new n(e),this.length=0}static create(e){const n=ip(e);if(!n)return[];he(Fr,ci,!0);const i=new Fr(e,n);return he(Fr,ci,!1),i}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}};ci=new WeakMap,Le(Fr,ci,!1);let El=Fr;const Al=class Al{constructor(e){Le(this,ee);Le(this,cn);Le(this,Mt);Le(this,dn);Le(this,un);Le(this,di);Le(this,ui);Ge(this,"ttl");Ge(this,"ttlResolution");Ge(this,"ttlAutopurge");Ge(this,"updateAgeOnGet");Ge(this,"updateAgeOnHas");Ge(this,"allowStale");Ge(this,"noDisposeOnSet");Ge(this,"noUpdateTTL");Ge(this,"maxEntrySize");Ge(this,"sizeCalculation");Ge(this,"noDeleteOnFetchRejection");Ge(this,"noDeleteOnStaleGet");Ge(this,"allowStaleOnFetchAbort");Ge(this,"allowStaleOnFetchRejection");Ge(this,"ignoreFetchAbort");Le(this,ot);Le(this,pn);Le(this,rt);Le(this,We);Le(this,we);Le(this,bt);Le(this,It);Le(this,yt);Le(this,ct);Le(this,hn);Le(this,dt);Le(this,fn);Le(this,mn);Le(this,Lt);Le(this,gn);Le(this,hr);Le(this,xt);Le(this,Rr,()=>{});Le(this,Ln,()=>{});Le(this,bo,()=>{});Le(this,Ot,()=>!1);Le(this,Mr,e=>{});Le(this,pi,(e,n,i)=>{});Le(this,xo,(e,n,i,s)=>{if(i||s)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});Ge(this,sp,"LRUCache");const{max:n=0,ttl:i,ttlResolution:s=1,ttlAutopurge:l,updateAgeOnGet:c,updateAgeOnHas:u,allowStale:p,dispose:f,disposeAfter:m,noDisposeOnSet:v,noUpdateTTL:k,maxSize:S=0,maxEntrySize:F=0,sizeCalculation:T,fetchMethod:N,memoMethod:C,noDeleteOnFetchRejection:I,noDeleteOnStaleGet:Q,allowStaleOnFetchRejection:M,allowStaleOnFetchAbort:R,ignoreFetchAbort:U}=e;if(n!==0&&!pr(n))throw new TypeError("max option must be a nonnegative integer");const z=n?ip(n):Array;if(!z)throw new Error("invalid max value: "+n);if(he(this,cn,n),he(this,Mt,S),this.maxEntrySize=F||w(this,Mt),this.sizeCalculation=T,this.sizeCalculation){if(!w(this,Mt)&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(C!==void 0&&typeof C!="function")throw new TypeError("memoMethod must be a function if defined");if(he(this,ui,C),N!==void 0&&typeof N!="function")throw new TypeError("fetchMethod must be a function if specified");if(he(this,di,N),he(this,hr,!!N),he(this,rt,new Map),he(this,We,new Array(n).fill(void 0)),he(this,we,new Array(n).fill(void 0)),he(this,bt,new z(n)),he(this,It,new z(n)),he(this,yt,0),he(this,ct,0),he(this,hn,El.create(n)),he(this,ot,0),he(this,pn,0),typeof f=="function"&&he(this,dn,f),typeof m=="function"?(he(this,un,m),he(this,dt,[])):(he(this,un,void 0),he(this,dt,void 0)),he(this,gn,!!w(this,dn)),he(this,xt,!!w(this,un)),this.noDisposeOnSet=!!v,this.noUpdateTTL=!!k,this.noDeleteOnFetchRejection=!!I,this.allowStaleOnFetchRejection=!!M,this.allowStaleOnFetchAbort=!!R,this.ignoreFetchAbort=!!U,this.maxEntrySize!==0){if(w(this,Mt)!==0&&!pr(w(this,Mt)))throw new TypeError("maxSize must be a positive integer if specified");if(!pr(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");ae(this,ee,Zf).call(this)}if(this.allowStale=!!p,this.noDeleteOnStaleGet=!!Q,this.updateAgeOnGet=!!c,this.updateAgeOnHas=!!u,this.ttlResolution=pr(s)||s===0?s:1,this.ttlAutopurge=!!l,this.ttl=i||0,this.ttl){if(!pr(this.ttl))throw new TypeError("ttl must be a positive integer if specified");ae(this,ee,Xc).call(this)}if(w(this,cn)===0&&this.ttl===0&&w(this,Mt)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!w(this,cn)&&!w(this,Mt)){const P="LRU_CACHE_UNBOUNDED";WE(P)&&(tp.add(P),np("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",P,Al))}}static unsafeExposeInternals(e){return{starts:w(e,mn),ttls:w(e,Lt),sizes:w(e,fn),keyMap:w(e,rt),keyList:w(e,We),valList:w(e,we),next:w(e,bt),prev:w(e,It),get head(){return w(e,yt)},get tail(){return w(e,ct)},free:w(e,hn),isBackgroundFetch:n=>{var i;return ae(i=e,ee,je).call(i,n)},backgroundFetch:(n,i,s,l)=>{var c;return ae(c=e,ee,Ca).call(c,n,i,s,l)},moveToTail:n=>{var i;return ae(i=e,ee,qo).call(i,n)},indexes:n=>{var i;return ae(i=e,ee,xr).call(i,n)},rindexes:n=>{var i;return ae(i=e,ee,kr).call(i,n)},isStale:n=>{var i;return w(i=e,Ot).call(i,n)}}}get max(){return w(this,cn)}get maxSize(){return w(this,Mt)}get calculatedSize(){return w(this,pn)}get size(){return w(this,ot)}get fetchMethod(){return w(this,di)}get memoMethod(){return w(this,ui)}get dispose(){return w(this,dn)}get disposeAfter(){return w(this,un)}getRemainingTTL(e){return w(this,rt).has(e)?1/0:0}*entries(){for(const e of ae(this,ee,xr).call(this))w(this,we)[e]!==void 0&&w(this,We)[e]!==void 0&&!ae(this,ee,je).call(this,w(this,we)[e])&&(yield[w(this,We)[e],w(this,we)[e]])}*rentries(){for(const e of ae(this,ee,kr).call(this))w(this,we)[e]!==void 0&&w(this,We)[e]!==void 0&&!ae(this,ee,je).call(this,w(this,we)[e])&&(yield[w(this,We)[e],w(this,we)[e]])}*keys(){for(const e of ae(this,ee,xr).call(this)){const n=w(this,We)[e];n!==void 0&&!ae(this,ee,je).call(this,w(this,we)[e])&&(yield n)}}*rkeys(){for(const e of ae(this,ee,kr).call(this)){const n=w(this,We)[e];n!==void 0&&!ae(this,ee,je).call(this,w(this,we)[e])&&(yield n)}}*values(){for(const e of ae(this,ee,xr).call(this))w(this,we)[e]!==void 0&&!ae(this,ee,je).call(this,w(this,we)[e])&&(yield w(this,we)[e])}*rvalues(){for(const e of ae(this,ee,kr).call(this))w(this,we)[e]!==void 0&&!ae(this,ee,je).call(this,w(this,we)[e])&&(yield w(this,we)[e])}[(ap=Symbol.iterator,sp=Symbol.toStringTag,ap)](){return this.entries()}find(e,n={}){for(const i of ae(this,ee,xr).call(this)){const s=w(this,we)[i],l=ae(this,ee,je).call(this,s)?s.__staleWhileFetching:s;if(l!==void 0&&e(l,w(this,We)[i],this))return this.get(w(this,We)[i],n)}}forEach(e,n=this){for(const i of ae(this,ee,xr).call(this)){const s=w(this,we)[i],l=ae(this,ee,je).call(this,s)?s.__staleWhileFetching:s;l!==void 0&&e.call(n,l,w(this,We)[i],this)}}rforEach(e,n=this){for(const i of ae(this,ee,kr).call(this)){const s=w(this,we)[i],l=ae(this,ee,je).call(this,s)?s.__staleWhileFetching:s;l!==void 0&&e.call(n,l,w(this,We)[i],this)}}purgeStale(){let e=!1;for(const n of ae(this,ee,kr).call(this,{allowStale:!0}))w(this,Ot).call(this,n)&&(ae(this,ee,Sr).call(this,w(this,We)[n],"expire"),e=!0);return e}info(e){const n=w(this,rt).get(e);if(n===void 0)return;const i=w(this,we)[n],s=ae(this,ee,je).call(this,i)?i.__staleWhileFetching:i;if(s===void 0)return;const l={value:s};if(w(this,Lt)&&w(this,mn)){const c=w(this,Lt)[n],u=w(this,mn)[n];if(c&&u){const p=c-(li.now()-u);l.ttl=p,l.start=Date.now()}}return w(this,fn)&&(l.size=w(this,fn)[n]),l}dump(){const e=[];for(const n of ae(this,ee,xr).call(this,{allowStale:!0})){const i=w(this,We)[n],s=w(this,we)[n],l=ae(this,ee,je).call(this,s)?s.__staleWhileFetching:s;if(l===void 0||i===void 0)continue;const c={value:l};if(w(this,Lt)&&w(this,mn)){c.ttl=w(this,Lt)[n];const u=li.now()-w(this,mn)[n];c.start=Math.floor(Date.now()-u)}w(this,fn)&&(c.size=w(this,fn)[n]),e.unshift([i,c])}return e}load(e){this.clear();for(const[n,i]of e){if(i.start){const s=Date.now()-i.start;i.start=li.now()-s}this.set(n,i.value,i)}}set(e,n,i={}){var k,S,F,T,N;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}=i;let{noUpdateTTL:f=this.noUpdateTTL}=i;const m=w(this,xo).call(this,e,n,i.size||0,u);if(this.maxEntrySize&&m>this.maxEntrySize)return p&&(p.set="miss",p.maxEntrySizeExceeded=!0),ae(this,ee,Sr).call(this,e,"set"),this;let v=w(this,ot)===0?void 0:w(this,rt).get(e);if(v===void 0)v=w(this,ot)===0?w(this,ct):w(this,hn).length!==0?w(this,hn).pop():w(this,ot)===w(this,cn)?ae(this,ee,_a).call(this,!1):w(this,ot),w(this,We)[v]=e,w(this,we)[v]=n,w(this,rt).set(e,v),w(this,bt)[w(this,ct)]=v,w(this,It)[v]=w(this,ct),he(this,ct,v),va(this,ot)._++,w(this,pi).call(this,v,m,p),p&&(p.set="add"),f=!1;else{ae(this,ee,qo).call(this,v);const C=w(this,we)[v];if(n!==C){if(w(this,hr)&&ae(this,ee,je).call(this,C)){C.__abortController.abort(new Error("replaced"));const{__staleWhileFetching:I}=C;I!==void 0&&!c&&(w(this,gn)&&((k=w(this,dn))==null||k.call(this,I,e,"set")),w(this,xt)&&((S=w(this,dt))==null||S.push([I,e,"set"])))}else c||(w(this,gn)&&((F=w(this,dn))==null||F.call(this,C,e,"set")),w(this,xt)&&((T=w(this,dt))==null||T.push([C,e,"set"])));if(w(this,Mr).call(this,v),w(this,pi).call(this,v,m,p),w(this,we)[v]=n,p){p.set="replace";const I=C&&ae(this,ee,je).call(this,C)?C.__staleWhileFetching:C;I!==void 0&&(p.oldValue=I)}}else p&&(p.set="update")}if(s!==0&&!w(this,Lt)&&ae(this,ee,Xc).call(this),w(this,Lt)&&(f||w(this,bo).call(this,v,s,l),p&&w(this,Ln).call(this,p,v)),!c&&w(this,xt)&&w(this,dt)){const C=w(this,dt);let I;for(;I=C==null?void 0:C.shift();)(N=w(this,un))==null||N.call(this,...I)}return this}pop(){var e;try{for(;w(this,ot);){const n=w(this,we)[w(this,yt)];if(ae(this,ee,_a).call(this,!0),ae(this,ee,je).call(this,n)){if(n.__staleWhileFetching)return n.__staleWhileFetching}else if(n!==void 0)return n}}finally{if(w(this,xt)&&w(this,dt)){const n=w(this,dt);let i;for(;i=n==null?void 0:n.shift();)(e=w(this,un))==null||e.call(this,...i)}}}has(e,n={}){const{updateAgeOnHas:i=this.updateAgeOnHas,status:s}=n,l=w(this,rt).get(e);if(l!==void 0){const c=w(this,we)[l];if(ae(this,ee,je).call(this,c)&&c.__staleWhileFetching===void 0)return!1;if(w(this,Ot).call(this,l))s&&(s.has="stale",w(this,Ln).call(this,s,l));else return i&&w(this,Rr).call(this,l),s&&(s.has="hit",w(this,Ln).call(this,s,l)),!0}else s&&(s.has="miss");return!1}peek(e,n={}){const{allowStale:i=this.allowStale}=n,s=w(this,rt).get(e);if(s===void 0||!i&&w(this,Ot).call(this,s))return;const l=w(this,we)[s];return ae(this,ee,je).call(this,l)?l.__staleWhileFetching:l}async fetch(e,n={}){const{allowStale:i=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:v=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:k=this.allowStaleOnFetchRejection,ignoreFetchAbort:S=this.ignoreFetchAbort,allowStaleOnFetchAbort:F=this.allowStaleOnFetchAbort,context:T,forceRefresh:N=!1,status:C,signal:I}=n;if(!w(this,hr))return C&&(C.fetch="get"),this.get(e,{allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:l,status:C});const Q={allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:l,ttl:c,noDisposeOnSet:u,size:p,sizeCalculation:f,noUpdateTTL:m,noDeleteOnFetchRejection:v,allowStaleOnFetchRejection:k,allowStaleOnFetchAbort:F,ignoreFetchAbort:S,status:C,signal:I};let M=w(this,rt).get(e);if(M===void 0){C&&(C.fetch="miss");const R=ae(this,ee,Ca).call(this,e,M,Q,T);return R.__returned=R}else{const R=w(this,we)[M];if(ae(this,ee,je).call(this,R)){const O=i&&R.__staleWhileFetching!==void 0;return C&&(C.fetch="inflight",O&&(C.returnedStale=!0)),O?R.__staleWhileFetching:R.__returned=R}const U=w(this,Ot).call(this,M);if(!N&&!U)return C&&(C.fetch="hit"),ae(this,ee,qo).call(this,M),s&&w(this,Rr).call(this,M),C&&w(this,Ln).call(this,C,M),R;const z=ae(this,ee,Ca).call(this,e,M,Q,T),Z=z.__staleWhileFetching!==void 0&&i;return C&&(C.fetch=U?"stale":"refresh",Z&&U&&(C.returnedStale=!0)),Z?z.__staleWhileFetching:z.__returned=z}}async forceFetch(e,n={}){const i=await this.fetch(e,n);if(i===void 0)throw new Error("fetch() returned undefined");return i}memo(e,n={}){const i=w(this,ui);if(!i)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=i(e,u,{options:c,context:s});return this.set(e,p,c),p}get(e,n={}){const{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:l=this.noDeleteOnStaleGet,status:c}=n,u=w(this,rt).get(e);if(u!==void 0){const p=w(this,we)[u],f=ae(this,ee,je).call(this,p);return c&&w(this,Ln).call(this,c,u),w(this,Ot).call(this,u)?(c&&(c.get="stale"),f?(c&&i&&p.__staleWhileFetching!==void 0&&(c.returnedStale=!0),i?p.__staleWhileFetching:void 0):(l||ae(this,ee,Sr).call(this,e,"expire"),c&&i&&(c.returnedStale=!0),i?p:void 0)):(c&&(c.get="hit"),f?p.__staleWhileFetching:(ae(this,ee,qo).call(this,u),s&&w(this,Rr).call(this,u),p))}else c&&(c.get="miss")}delete(e){return ae(this,ee,Sr).call(this,e,"delete")}clear(){return ae(this,ee,td).call(this,"delete")}};cn=new WeakMap,Mt=new WeakMap,dn=new WeakMap,un=new WeakMap,di=new WeakMap,ui=new WeakMap,ot=new WeakMap,pn=new WeakMap,rt=new WeakMap,We=new WeakMap,we=new WeakMap,bt=new WeakMap,It=new WeakMap,yt=new WeakMap,ct=new WeakMap,hn=new WeakMap,dt=new WeakMap,fn=new WeakMap,mn=new WeakMap,Lt=new WeakMap,gn=new WeakMap,hr=new WeakMap,xt=new WeakMap,ee=new WeakSet,Xc=function(){const e=new Ss(w(this,cn)),n=new Ss(w(this,cn));he(this,Lt,e),he(this,mn,n),he(this,bo,(l,c,u=li.now())=>{if(n[l]=c!==0?u:0,e[l]=c,c!==0&&this.ttlAutopurge){const p=setTimeout(()=>{w(this,Ot).call(this,l)&&ae(this,ee,Sr).call(this,w(this,We)[l],"expire")},c+1);p.unref&&p.unref()}}),he(this,Rr,l=>{n[l]=e[l]!==0?li.now():0}),he(this,Ln,(l,c)=>{if(e[c]){const u=e[c],p=n[c];if(!u||!p)return;l.ttl=u,l.start=p,l.now=i||s();const f=l.now-p;l.remainingTTL=u-f}});let i=0;const s=()=>{const l=li.now();if(this.ttlResolution>0){i=l;const c=setTimeout(()=>i=0,this.ttlResolution);c.unref&&c.unref()}return l};this.getRemainingTTL=l=>{const c=w(this,rt).get(l);if(c===void 0)return 0;const u=e[c],p=n[c];if(!u||!p)return 1/0;const f=(i||s())-p;return u-f},he(this,Ot,l=>{const c=n[l],u=e[l];return!!u&&!!c&&(i||s())-c>u})},Rr=new WeakMap,Ln=new WeakMap,bo=new WeakMap,Ot=new WeakMap,Zf=function(){const e=new Ss(w(this,cn));he(this,pn,0),he(this,fn,e),he(this,Mr,n=>{he(this,pn,w(this,pn)-e[n]),e[n]=0}),he(this,xo,(n,i,s,l)=>{if(ae(this,ee,je).call(this,i))return 0;if(!pr(s))if(l){if(typeof l!="function")throw new TypeError("sizeCalculation must be a function");if(s=l(i,n),!pr(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}),he(this,pi,(n,i,s)=>{if(e[n]=i,w(this,Mt)){const l=w(this,Mt)-e[n];for(;w(this,pn)>l;)ae(this,ee,_a).call(this,!0)}he(this,pn,w(this,pn)+e[n]),s&&(s.entrySize=i,s.totalCalculatedSize=w(this,pn))})},Mr=new WeakMap,pi=new WeakMap,xo=new WeakMap,xr=function*({allowStale:e=this.allowStale}={}){if(w(this,ot))for(let n=w(this,ct);!(!ae(this,ee,Qc).call(this,n)||((e||!w(this,Ot).call(this,n))&&(yield n),n===w(this,yt)));)n=w(this,It)[n]},kr=function*({allowStale:e=this.allowStale}={}){if(w(this,ot))for(let n=w(this,yt);!(!ae(this,ee,Qc).call(this,n)||((e||!w(this,Ot).call(this,n))&&(yield n),n===w(this,ct)));)n=w(this,bt)[n]},Qc=function(e){return e!==void 0&&w(this,rt).get(w(this,We)[e])===e},_a=function(e){var l,c;const n=w(this,yt),i=w(this,We)[n],s=w(this,we)[n];return w(this,hr)&&ae(this,ee,je).call(this,s)?s.__abortController.abort(new Error("evicted")):(w(this,gn)||w(this,xt))&&(w(this,gn)&&((l=w(this,dn))==null||l.call(this,s,i,"evict")),w(this,xt)&&((c=w(this,dt))==null||c.push([s,i,"evict"]))),w(this,Mr).call(this,n),e&&(w(this,We)[n]=void 0,w(this,we)[n]=void 0,w(this,hn).push(n)),w(this,ot)===1?(he(this,yt,he(this,ct,0)),w(this,hn).length=0):he(this,yt,w(this,bt)[n]),w(this,rt).delete(i),va(this,ot)._--,n},Ca=function(e,n,i,s){const l=n===void 0?void 0:w(this,we)[n];if(ae(this,ee,je).call(this,l))return l;const c=new ks,{signal:u}=i;u==null||u.addEventListener("abort",()=>c.abort(u.reason),{signal:c.signal});const p={signal:c.signal,options:i,context:s},f=(T,N=!1)=>{const{aborted:C}=c.signal,I=i.ignoreFetchAbort&&T!==void 0;if(i.status&&(C&&!N?(i.status.fetchAborted=!0,i.status.fetchError=c.signal.reason,I&&(i.status.fetchAbortIgnored=!0)):i.status.fetchResolved=!0),C&&!I&&!N)return v(c.signal.reason);const Q=S;return w(this,we)[n]===S&&(T===void 0?Q.__staleWhileFetching?w(this,we)[n]=Q.__staleWhileFetching:ae(this,ee,Sr).call(this,e,"fetch"):(i.status&&(i.status.fetchUpdated=!0),this.set(e,T,p.options))),T},m=T=>(i.status&&(i.status.fetchRejected=!0,i.status.fetchError=T),v(T)),v=T=>{const{aborted:N}=c.signal,C=N&&i.allowStaleOnFetchAbort,I=C||i.allowStaleOnFetchRejection,Q=I||i.noDeleteOnFetchRejection,M=S;if(w(this,we)[n]===S&&(!Q||M.__staleWhileFetching===void 0?ae(this,ee,Sr).call(this,e,"fetch"):C||(w(this,we)[n]=M.__staleWhileFetching)),I)return i.status&&M.__staleWhileFetching!==void 0&&(i.status.returnedStale=!0),M.__staleWhileFetching;if(M.__returned===M)throw T},k=(T,N)=>{var I;const C=(I=w(this,di))==null?void 0:I.call(this,e,l,p);C&&C instanceof Promise&&C.then(Q=>T(Q===void 0?void 0:Q),N),c.signal.addEventListener("abort",()=>{(!i.ignoreFetchAbort||i.allowStaleOnFetchAbort)&&(T(void 0),i.allowStaleOnFetchAbort&&(T=Q=>f(Q,!0)))})};i.status&&(i.status.fetchDispatched=!0);const S=new Promise(k).then(f,m),F=Object.assign(S,{__abortController:c,__staleWhileFetching:l,__returned:void 0});return n===void 0?(this.set(e,F,{...p.options,status:void 0}),n=w(this,rt).get(e)):w(this,we)[n]=F,F},je=function(e){if(!w(this,hr))return!1;const n=e;return!!n&&n instanceof Promise&&n.hasOwnProperty("__staleWhileFetching")&&n.__abortController instanceof ks},ed=function(e,n){w(this,It)[n]=e,w(this,bt)[e]=n},qo=function(e){e!==w(this,ct)&&(e===w(this,yt)?he(this,yt,w(this,bt)[e]):ae(this,ee,ed).call(this,w(this,It)[e],w(this,bt)[e]),ae(this,ee,ed).call(this,w(this,ct),e),he(this,ct,e))},Sr=function(e,n){var s,l,c,u;let i=!1;if(w(this,ot)!==0){const p=w(this,rt).get(e);if(p!==void 0)if(i=!0,w(this,ot)===1)ae(this,ee,td).call(this,n);else{w(this,Mr).call(this,p);const f=w(this,we)[p];if(ae(this,ee,je).call(this,f)?f.__abortController.abort(new Error("deleted")):(w(this,gn)||w(this,xt))&&(w(this,gn)&&((s=w(this,dn))==null||s.call(this,f,e,n)),w(this,xt)&&((l=w(this,dt))==null||l.push([f,e,n]))),w(this,rt).delete(e),w(this,We)[p]=void 0,w(this,we)[p]=void 0,p===w(this,ct))he(this,ct,w(this,It)[p]);else if(p===w(this,yt))he(this,yt,w(this,bt)[p]);else{const m=w(this,It)[p];w(this,bt)[m]=w(this,bt)[p];const v=w(this,bt)[p];w(this,It)[v]=w(this,It)[p]}va(this,ot)._--,w(this,hn).push(p)}}if(w(this,xt)&&((c=w(this,dt))!=null&&c.length)){const p=w(this,dt);let f;for(;f=p==null?void 0:p.shift();)(u=w(this,un))==null||u.call(this,...f)}return i},td=function(e){var n,i,s;for(const l of ae(this,ee,kr).call(this,{allowStale:!0})){const c=w(this,we)[l];if(ae(this,ee,je).call(this,c))c.__abortController.abort(new Error("deleted"));else{const u=w(this,We)[l];w(this,gn)&&((n=w(this,dn))==null||n.call(this,c,u,e)),w(this,xt)&&((i=w(this,dt))==null||i.push([c,u,e]))}}if(w(this,rt).clear(),w(this,we).fill(void 0),w(this,We).fill(void 0),w(this,Lt)&&w(this,mn)&&(w(this,Lt).fill(0),w(this,mn).fill(0)),w(this,fn)&&w(this,fn).fill(0),he(this,yt,0),he(this,ct,0),w(this,hn).length=0,he(this,pn,0),he(this,ot,0),w(this,xt)&&w(this,dt)){const l=w(this,dt);let c;for(;c=l==null?void 0:l.shift();)(s=w(this,un))==null||s.call(this,...c)}};let Tl=Al;const HE={cacheSize:15e6};class jE{constructor(e){Ge(this,"_str");Ge(this,"_rawJson");Ge(this,"_zodSchema");Ge(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 Ir=class Ir{constructor(e){Ge(this,"fileDataCache");Ge(this,"fileDataRefs",new Map);const n={...HE,...e??{}};this.fileDataCache=new Tl({maxSize:n.cacheSize,fetchMethod:async i=>new jE(await hg().blobDriver.getContent(i)),sizeCalculation:i=>i.bytes.length,dispose:(i,s)=>{this.fileDataRefs.delete(s)}})}getDataRef(e){const n=this.fileDataRefs.get(e);if(n!==void 0)return n;const i=r.shallowRef();return this.fileDataRefs.set(e,i),(async()=>{try{const s=await this.fileDataCache.fetch(e);i.value=s}catch(s){console.error(s)}})(),i}getContentBytes(e){if(e===void 0)return;const n=this.getDataRef(e);return r.computed(()=>{var i;return(i=n.value)==null?void 0:i.bytes})}getContentString(e){if(e===void 0)return;const n=this.getDataRef(e);return r.computed(()=>{var i;return(i=n==null?void 0:n.value)==null?void 0:i.str})}getContentJson(e,n){if(e===void 0)return;const i=this.getDataRef(e);return r.computed(()=>{var s,l;return n===void 0?(s=i==null?void 0:i.value)==null?void 0:s.rawJson:(l=i==null?void 0:i.value)==null?void 0:l.validatedJson(n)})}static getContentBytes(e){return Ir.globalInstance.getContentBytes(e)}static getContentString(e){return Ir.globalInstance.getContentString(e)}static getContentJson(e,n){return Ir.globalInstance.getContentJson(e,n)}};Ge(Ir,"globalInstance",new Ir);let Bl=Ir;D.AgGridTheme=Wd,D.BlockLayout=mE,D.ContextProvider=Qx,D.DataTable=B_,D.DemoData=tE,D.DropdownListItem=no,D.LongText=pl,D.MultiError=xa,D.PlAgCellFile=zE,D.PlAgDataTable=ME,D.PlAgOverlayLoading=qu,D.PlAgOverlayNoRows=Ku,D.PlAlert=oC,D.PlBlockPage=W_,D.PlBtnAccent=dC,D.PlBtnDanger=pC,D.PlBtnGhost=sl,D.PlBtnGroup=FC,D.PlBtnLink=gC,D.PlBtnPrimary=il,D.PlBtnSecondary=ol,D.PlCheckbox=Fw,D.PlCheckboxGroup=Lw,D.PlChip=fl,D.PlContainer=j_,D.PlCopyData=Wu,D.PlDialogModal=gl,D.PlDropdown=hl,D.PlDropdownLegacy=ow,D.PlDropdownLine=Eu,D.PlDropdownMulti=Nw,D.PlDropdownRef=F0,D.PlFileDialog=Bu,D.PlFileInput=$u,D.PlGrid=Q_,D.PlIcon16=us,D.PlIcon24=wu,D.PlLogView=hb,D.PlMaskIcon16=Xi,D.PlMaskIcon24=Mn,D.PlNotificationAlert=Uu,D.PlNumberField=yw,D.PlProgressBar=dw,D.PlRow=K_,D.PlSlideModal=Xw,D.PlSpacer=fu,D.PlTabs=wb,D.PlTextArea=u0,D.PlTextField=bu,D.PlToggleSwitch=tb,D.PlTooltip=Tt,D.ReactiveFileContent=Bl,D.Scrollable=Uk,D.Slider=dk,D.SliderRange=Gk,D.SliderRangeTriple=Bk,D.ThemeSwitcher=L_,D.UnresolvedError=ba,D.ValueOrErrorsComponent=OE,D.activateAgGrid=Ud,D.animate=lu,D.animateInfinite=D_,D.call=ru,D.computedResult=UE,D.createModel=Aa,D.debounce=cu,D.defineApp=rv,D.defineStore=$E,D.delay=iu,D.detectOutside=p0,D.ensureError=Ea,D.eventListener=dl,D.formatZodError=Ba,D.getElementScrollPosition=ku,D.identity=Sa,D.isDefined=rm,D.isElementVisible=xu,D.isJsonEqual=ka,D.isZodError=Ta,D.listToOptions=F_,D.makeEaseInOut=N_,D.makeEaseOut=au,D.maskIcons16=Q1,D.maskIcons24=eE,D.normalizeListOptions=Pr,D.notEmpty=Qa,D.randomInt=su,D.randomString=V_,D.requestTick=el,D.scrollIntoView=to,D.showContextMenu=Ya,D.throttle=du,D.timeout=ou,D.unwrapOptionalResult=nm,D.unwrapValueOrErrors=od,D.useClickOutside=ds,D.useDraggable=yk,D.useEventListener=et,D.useFormState=mk,D.useHover=tu,D.useInterval=fk,D.useLabelNotch=Rn,D.useLocalStorage=uu,D.useMouse=eu,D.useMouseCapture=rr,D.usePosition=Qi,D.useQuery=gk,D.useResizeObserver=Hu,D.useScroll=uk,D.useSdkPlugin=Ha,D.useSortable=hk,D.useTheme=hu,D.useWatchFetch=ep,D.wrapOptionalResult=sd,D.wrapValueOrErrors=tm,Object.defineProperty(D,Symbol.toStringTag,{value:"Module"})});